alshabib | 86ac11c | 2014-08-14 16:14:41 -0700 | [diff] [blame] | 1 | // Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University |
| 2 | // Copyright (c) 2011, 2012 Open Networking Foundation |
| 3 | // Copyright (c) 2012, 2013 Big Switch Networks, Inc. |
| 4 | // This library was generated by the LoxiGen Compiler. |
| 5 | // See the file LICENSE.txt which should have been included in the source distribution |
| 6 | |
| 7 | // Automatically generated by LOXI from template of_virtual_class.java |
| 8 | // Do not modify |
| 9 | |
| 10 | package org.projectfloodlight.openflow.protocol.ver11; |
| 11 | |
| 12 | import org.projectfloodlight.openflow.protocol.*; |
| 13 | import org.projectfloodlight.openflow.protocol.action.*; |
| 14 | import org.projectfloodlight.openflow.protocol.actionid.*; |
| 15 | import org.projectfloodlight.openflow.protocol.bsntlv.*; |
| 16 | import org.projectfloodlight.openflow.protocol.errormsg.*; |
| 17 | import org.projectfloodlight.openflow.protocol.meterband.*; |
| 18 | import org.projectfloodlight.openflow.protocol.instruction.*; |
| 19 | import org.projectfloodlight.openflow.protocol.instructionid.*; |
| 20 | import org.projectfloodlight.openflow.protocol.match.*; |
| 21 | import org.projectfloodlight.openflow.protocol.oxm.*; |
| 22 | import org.projectfloodlight.openflow.protocol.queueprop.*; |
| 23 | import org.projectfloodlight.openflow.types.*; |
| 24 | import org.projectfloodlight.openflow.util.*; |
| 25 | import org.projectfloodlight.openflow.exceptions.*; |
| 26 | import org.jboss.netty.buffer.ChannelBuffer; |
| 27 | import java.util.Set; |
| 28 | |
| 29 | abstract class OFActionBsnVer11 { |
| 30 | // version: 1.1 |
| 31 | final static byte WIRE_VERSION = 2; |
| 32 | final static int MINIMUM_LENGTH = 16; |
| 33 | |
| 34 | |
| 35 | public final static OFActionBsnVer11.Reader READER = new Reader(); |
| 36 | |
| 37 | static class Reader implements OFMessageReader<OFActionBsn> { |
| 38 | @Override |
| 39 | public OFActionBsn readFrom(ChannelBuffer bb) throws OFParseError { |
| 40 | if(bb.readableBytes() < MINIMUM_LENGTH) |
| 41 | return null; |
| 42 | int start = bb.readerIndex(); |
| 43 | // fixed value property type == 65535 |
| 44 | short type = bb.readShort(); |
| 45 | if(type != (short) 0xffff) |
| 46 | throw new OFParseError("Wrong type: Expected=OFActionType.EXPERIMENTER(65535), got="+type); |
| 47 | int length = U16.f(bb.readShort()); |
| 48 | if(length < MINIMUM_LENGTH) |
| 49 | throw new OFParseError("Wrong length: Expected to be >= " + MINIMUM_LENGTH + ", was: " + length); |
| 50 | // fixed value property experimenter == 0x5c16c7L |
| 51 | int experimenter = bb.readInt(); |
| 52 | if(experimenter != 0x5c16c7) |
| 53 | throw new OFParseError("Wrong experimenter: Expected=0x5c16c7L(0x5c16c7L), got="+experimenter); |
| 54 | int subtype = bb.readInt(); |
| 55 | bb.readerIndex(start); |
| 56 | switch(subtype) { |
| 57 | case 0x4: |
| 58 | // discriminator value 0x4L=0x4L for class OFActionBsnChecksumVer11 |
| 59 | return OFActionBsnChecksumVer11.READER.readFrom(bb); |
| 60 | case 0x1: |
| 61 | // discriminator value 0x1L=0x1L for class OFActionBsnMirrorVer11 |
| 62 | return OFActionBsnMirrorVer11.READER.readFrom(bb); |
| 63 | case 0x2: |
| 64 | // discriminator value 0x2L=0x2L for class OFActionBsnSetTunnelDstVer11 |
| 65 | return OFActionBsnSetTunnelDstVer11.READER.readFrom(bb); |
| 66 | default: |
| 67 | throw new OFParseError("Unknown value for discriminator subtype of class OFActionBsnVer11: " + subtype); |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | } |