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 OFBsnHeaderVer11 { |
| 30 | // version: 1.1 |
| 31 | final static byte WIRE_VERSION = 2; |
| 32 | final static int MINIMUM_LENGTH = 16; |
| 33 | |
| 34 | |
| 35 | public final static OFBsnHeaderVer11.Reader READER = new Reader(); |
| 36 | |
| 37 | static class Reader implements OFMessageReader<OFBsnHeader> { |
| 38 | @Override |
| 39 | public OFBsnHeader readFrom(ChannelBuffer bb) throws OFParseError { |
| 40 | if(bb.readableBytes() < MINIMUM_LENGTH) |
| 41 | return null; |
| 42 | int start = bb.readerIndex(); |
| 43 | // fixed value property version == 2 |
| 44 | byte version = bb.readByte(); |
| 45 | if(version != (byte) 0x2) |
| 46 | throw new OFParseError("Wrong version: Expected=OFVersion.OF_11(2), got="+version); |
| 47 | // fixed value property type == 4 |
| 48 | byte type = bb.readByte(); |
| 49 | if(type != (byte) 0x4) |
| 50 | throw new OFParseError("Wrong type: Expected=OFType.EXPERIMENTER(4), got="+type); |
| 51 | int length = U16.f(bb.readShort()); |
| 52 | if(length < MINIMUM_LENGTH) |
| 53 | throw new OFParseError("Wrong length: Expected to be >= " + MINIMUM_LENGTH + ", was: " + length); |
| 54 | U32.f(bb.readInt()); |
| 55 | // fixed value property experimenter == 0x5c16c7L |
| 56 | int experimenter = bb.readInt(); |
| 57 | if(experimenter != 0x5c16c7) |
| 58 | throw new OFParseError("Wrong experimenter: Expected=0x5c16c7L(0x5c16c7L), got="+experimenter); |
| 59 | int subtype = bb.readInt(); |
| 60 | bb.readerIndex(start); |
| 61 | switch(subtype) { |
| 62 | case 0x16: |
| 63 | // discriminator value 0x16L=0x16L for class OFBsnBwClearDataReplyVer11 |
| 64 | return OFBsnBwClearDataReplyVer11.READER.readFrom(bb); |
| 65 | case 0x15: |
| 66 | // discriminator value 0x15L=0x15L for class OFBsnBwClearDataRequestVer11 |
| 67 | return OFBsnBwClearDataRequestVer11.READER.readFrom(bb); |
| 68 | case 0x14: |
| 69 | // discriminator value 0x14L=0x14L for class OFBsnBwEnableGetReplyVer11 |
| 70 | return OFBsnBwEnableGetReplyVer11.READER.readFrom(bb); |
| 71 | case 0x13: |
| 72 | // discriminator value 0x13L=0x13L for class OFBsnBwEnableGetRequestVer11 |
| 73 | return OFBsnBwEnableGetRequestVer11.READER.readFrom(bb); |
| 74 | case 0x17: |
| 75 | // discriminator value 0x17L=0x17L for class OFBsnBwEnableSetReplyVer11 |
| 76 | return OFBsnBwEnableSetReplyVer11.READER.readFrom(bb); |
| 77 | case 0x12: |
| 78 | // discriminator value 0x12L=0x12L for class OFBsnBwEnableSetRequestVer11 |
| 79 | return OFBsnBwEnableSetRequestVer11.READER.readFrom(bb); |
| 80 | case 0xa: |
| 81 | // discriminator value 0xaL=0xaL for class OFBsnGetInterfacesReplyVer11 |
| 82 | return OFBsnGetInterfacesReplyVer11.READER.readFrom(bb); |
| 83 | case 0x9: |
| 84 | // discriminator value 0x9L=0x9L for class OFBsnGetInterfacesRequestVer11 |
| 85 | return OFBsnGetInterfacesRequestVer11.READER.readFrom(bb); |
| 86 | case 0x5: |
| 87 | // discriminator value 0x5L=0x5L for class OFBsnGetMirroringReplyVer11 |
| 88 | return OFBsnGetMirroringReplyVer11.READER.readFrom(bb); |
| 89 | case 0x4: |
| 90 | // discriminator value 0x4L=0x4L for class OFBsnGetMirroringRequestVer11 |
| 91 | return OFBsnGetMirroringRequestVer11.READER.readFrom(bb); |
| 92 | case 0x22: |
| 93 | // discriminator value 0x22L=0x22L for class OFBsnPduRxReplyVer11 |
| 94 | return OFBsnPduRxReplyVer11.READER.readFrom(bb); |
| 95 | case 0x21: |
| 96 | // discriminator value 0x21L=0x21L for class OFBsnPduRxRequestVer11 |
| 97 | return OFBsnPduRxRequestVer11.READER.readFrom(bb); |
| 98 | case 0x23: |
| 99 | // discriminator value 0x23L=0x23L for class OFBsnPduRxTimeoutVer11 |
| 100 | return OFBsnPduRxTimeoutVer11.READER.readFrom(bb); |
| 101 | case 0x20: |
| 102 | // discriminator value 0x20L=0x20L for class OFBsnPduTxReplyVer11 |
| 103 | return OFBsnPduTxReplyVer11.READER.readFrom(bb); |
| 104 | case 0x1f: |
| 105 | // discriminator value 0x1fL=0x1fL for class OFBsnPduTxRequestVer11 |
| 106 | return OFBsnPduTxRequestVer11.READER.readFrom(bb); |
| 107 | case 0x3: |
| 108 | // discriminator value 0x3L=0x3L for class OFBsnSetMirroringVer11 |
| 109 | return OFBsnSetMirroringVer11.READER.readFrom(bb); |
| 110 | case 0x19: |
| 111 | // discriminator value 0x19L=0x19L for class OFBsnSetPktinSuppressionReplyVer11 |
| 112 | return OFBsnSetPktinSuppressionReplyVer11.READER.readFrom(bb); |
| 113 | case 0xb: |
| 114 | // discriminator value 0xbL=0xbL for class OFBsnSetPktinSuppressionRequestVer11 |
| 115 | return OFBsnSetPktinSuppressionRequestVer11.READER.readFrom(bb); |
| 116 | case 0x10: |
| 117 | // discriminator value 0x10L=0x10L for class OFBsnVirtualPortCreateReplyVer11 |
| 118 | return OFBsnVirtualPortCreateReplyVer11.READER.readFrom(bb); |
| 119 | case 0xf: |
| 120 | // discriminator value 0xfL=0xfL for class OFBsnVirtualPortCreateRequestVer11 |
| 121 | return OFBsnVirtualPortCreateRequestVer11.READER.readFrom(bb); |
| 122 | case 0x1a: |
| 123 | // discriminator value 0x1aL=0x1aL for class OFBsnVirtualPortRemoveReplyVer11 |
| 124 | return OFBsnVirtualPortRemoveReplyVer11.READER.readFrom(bb); |
| 125 | case 0x11: |
| 126 | // discriminator value 0x11L=0x11L for class OFBsnVirtualPortRemoveRequestVer11 |
| 127 | return OFBsnVirtualPortRemoveRequestVer11.READER.readFrom(bb); |
| 128 | default: |
| 129 | throw new OFParseError("Unknown value for discriminator subtype of class OFBsnHeaderVer11: " + subtype); |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | } |