tom | 0eb04ca | 2014-08-25 14:34:51 -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.ver10; |
| 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 OFBsnHeaderVer10 { |
| 30 | // version: 1.0 |
| 31 | final static byte WIRE_VERSION = 1; |
| 32 | final static int MINIMUM_LENGTH = 16; |
| 33 | |
| 34 | |
| 35 | public final static OFBsnHeaderVer10.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 == 1 |
| 44 | byte version = bb.readByte(); |
| 45 | if(version != (byte) 0x1) |
| 46 | throw new OFParseError("Wrong version: Expected=OFVersion.OF_10(1), 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 OFBsnBwClearDataReplyVer10 |
| 64 | return OFBsnBwClearDataReplyVer10.READER.readFrom(bb); |
| 65 | case 0x15: |
| 66 | // discriminator value 0x15L=0x15L for class OFBsnBwClearDataRequestVer10 |
| 67 | return OFBsnBwClearDataRequestVer10.READER.readFrom(bb); |
| 68 | case 0x14: |
| 69 | // discriminator value 0x14L=0x14L for class OFBsnBwEnableGetReplyVer10 |
| 70 | return OFBsnBwEnableGetReplyVer10.READER.readFrom(bb); |
| 71 | case 0x13: |
| 72 | // discriminator value 0x13L=0x13L for class OFBsnBwEnableGetRequestVer10 |
| 73 | return OFBsnBwEnableGetRequestVer10.READER.readFrom(bb); |
| 74 | case 0x17: |
| 75 | // discriminator value 0x17L=0x17L for class OFBsnBwEnableSetReplyVer10 |
| 76 | return OFBsnBwEnableSetReplyVer10.READER.readFrom(bb); |
| 77 | case 0x12: |
| 78 | // discriminator value 0x12L=0x12L for class OFBsnBwEnableSetRequestVer10 |
| 79 | return OFBsnBwEnableSetRequestVer10.READER.readFrom(bb); |
| 80 | case 0xa: |
| 81 | // discriminator value 0xaL=0xaL for class OFBsnGetInterfacesReplyVer10 |
| 82 | return OFBsnGetInterfacesReplyVer10.READER.readFrom(bb); |
| 83 | case 0x9: |
| 84 | // discriminator value 0x9L=0x9L for class OFBsnGetInterfacesRequestVer10 |
| 85 | return OFBsnGetInterfacesRequestVer10.READER.readFrom(bb); |
| 86 | case 0x2: |
| 87 | // discriminator value 0x2L=0x2L for class OFBsnGetIpMaskReplyVer10 |
| 88 | return OFBsnGetIpMaskReplyVer10.READER.readFrom(bb); |
| 89 | case 0x1: |
| 90 | // discriminator value 0x1L=0x1L for class OFBsnGetIpMaskRequestVer10 |
| 91 | return OFBsnGetIpMaskRequestVer10.READER.readFrom(bb); |
| 92 | case 0xe: |
| 93 | // discriminator value 0xeL=0xeL for class OFBsnGetL2TableReplyVer10 |
| 94 | return OFBsnGetL2TableReplyVer10.READER.readFrom(bb); |
| 95 | case 0xd: |
| 96 | // discriminator value 0xdL=0xdL for class OFBsnGetL2TableRequestVer10 |
| 97 | return OFBsnGetL2TableRequestVer10.READER.readFrom(bb); |
| 98 | case 0x5: |
| 99 | // discriminator value 0x5L=0x5L for class OFBsnGetMirroringReplyVer10 |
| 100 | return OFBsnGetMirroringReplyVer10.READER.readFrom(bb); |
| 101 | case 0x4: |
| 102 | // discriminator value 0x4L=0x4L for class OFBsnGetMirroringRequestVer10 |
| 103 | return OFBsnGetMirroringRequestVer10.READER.readFrom(bb); |
| 104 | case 0x1c: |
| 105 | // discriminator value 0x1cL=0x1cL for class OFBsnHybridGetReplyVer10 |
| 106 | return OFBsnHybridGetReplyVer10.READER.readFrom(bb); |
| 107 | case 0x1b: |
| 108 | // discriminator value 0x1bL=0x1bL for class OFBsnHybridGetRequestVer10 |
| 109 | return OFBsnHybridGetRequestVer10.READER.readFrom(bb); |
| 110 | case 0x22: |
| 111 | // discriminator value 0x22L=0x22L for class OFBsnPduRxReplyVer10 |
| 112 | return OFBsnPduRxReplyVer10.READER.readFrom(bb); |
| 113 | case 0x21: |
| 114 | // discriminator value 0x21L=0x21L for class OFBsnPduRxRequestVer10 |
| 115 | return OFBsnPduRxRequestVer10.READER.readFrom(bb); |
| 116 | case 0x23: |
| 117 | // discriminator value 0x23L=0x23L for class OFBsnPduRxTimeoutVer10 |
| 118 | return OFBsnPduRxTimeoutVer10.READER.readFrom(bb); |
| 119 | case 0x20: |
| 120 | // discriminator value 0x20L=0x20L for class OFBsnPduTxReplyVer10 |
| 121 | return OFBsnPduTxReplyVer10.READER.readFrom(bb); |
| 122 | case 0x1f: |
| 123 | // discriminator value 0x1fL=0x1fL for class OFBsnPduTxRequestVer10 |
| 124 | return OFBsnPduTxRequestVer10.READER.readFrom(bb); |
| 125 | case 0x0: |
| 126 | // discriminator value 0x0L=0x0L for class OFBsnSetIpMaskVer10 |
| 127 | return OFBsnSetIpMaskVer10.READER.readFrom(bb); |
| 128 | case 0x18: |
| 129 | // discriminator value 0x18L=0x18L for class OFBsnSetL2TableReplyVer10 |
| 130 | return OFBsnSetL2TableReplyVer10.READER.readFrom(bb); |
| 131 | case 0xc: |
| 132 | // discriminator value 0xcL=0xcL for class OFBsnSetL2TableRequestVer10 |
| 133 | return OFBsnSetL2TableRequestVer10.READER.readFrom(bb); |
| 134 | case 0x3: |
| 135 | // discriminator value 0x3L=0x3L for class OFBsnSetMirroringVer10 |
| 136 | return OFBsnSetMirroringVer10.READER.readFrom(bb); |
| 137 | case 0x19: |
| 138 | // discriminator value 0x19L=0x19L for class OFBsnSetPktinSuppressionReplyVer10 |
| 139 | return OFBsnSetPktinSuppressionReplyVer10.READER.readFrom(bb); |
| 140 | case 0xb: |
| 141 | // discriminator value 0xbL=0xbL for class OFBsnSetPktinSuppressionRequestVer10 |
| 142 | return OFBsnSetPktinSuppressionRequestVer10.READER.readFrom(bb); |
| 143 | case 0x6: |
| 144 | // discriminator value 0x6L=0x6L for class OFBsnShellCommandVer10 |
| 145 | return OFBsnShellCommandVer10.READER.readFrom(bb); |
| 146 | case 0x7: |
| 147 | // discriminator value 0x7L=0x7L for class OFBsnShellOutputVer10 |
| 148 | return OFBsnShellOutputVer10.READER.readFrom(bb); |
| 149 | case 0x8: |
| 150 | // discriminator value 0x8L=0x8L for class OFBsnShellStatusVer10 |
| 151 | return OFBsnShellStatusVer10.READER.readFrom(bb); |
| 152 | case 0x10: |
| 153 | // discriminator value 0x10L=0x10L for class OFBsnVirtualPortCreateReplyVer10 |
| 154 | return OFBsnVirtualPortCreateReplyVer10.READER.readFrom(bb); |
| 155 | case 0xf: |
| 156 | // discriminator value 0xfL=0xfL for class OFBsnVirtualPortCreateRequestVer10 |
| 157 | return OFBsnVirtualPortCreateRequestVer10.READER.readFrom(bb); |
| 158 | case 0x1a: |
| 159 | // discriminator value 0x1aL=0x1aL for class OFBsnVirtualPortRemoveReplyVer10 |
| 160 | return OFBsnVirtualPortRemoveReplyVer10.READER.readFrom(bb); |
| 161 | case 0x11: |
| 162 | // discriminator value 0x11L=0x11L for class OFBsnVirtualPortRemoveRequestVer10 |
| 163 | return OFBsnVirtualPortRemoveRequestVer10.READER.readFrom(bb); |
| 164 | default: |
| 165 | throw new OFParseError("Unknown value for discriminator subtype of class OFBsnHeaderVer10: " + subtype); |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | } |