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.ver13; |
| 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 | |
| 28 | abstract class OFInstructionIdBsnVer13 { |
| 29 | // version: 1.3 |
| 30 | final static byte WIRE_VERSION = 4; |
| 31 | final static int MINIMUM_LENGTH = 12; |
| 32 | |
| 33 | |
| 34 | public final static OFInstructionIdBsnVer13.Reader READER = new Reader(); |
| 35 | |
| 36 | static class Reader implements OFMessageReader<OFInstructionIdBsn> { |
| 37 | @Override |
| 38 | public OFInstructionIdBsn readFrom(ChannelBuffer bb) throws OFParseError { |
| 39 | if(bb.readableBytes() < MINIMUM_LENGTH) |
| 40 | return null; |
| 41 | int start = bb.readerIndex(); |
| 42 | // fixed value property type == 65535 |
| 43 | short type = bb.readShort(); |
| 44 | if(type != (short) 0xffff) |
| 45 | throw new OFParseError("Wrong type: Expected=OFInstructionType.EXPERIMENTER(65535), got="+type); |
| 46 | int length = U16.f(bb.readShort()); |
| 47 | if(length < MINIMUM_LENGTH) |
| 48 | throw new OFParseError("Wrong length: Expected to be >= " + MINIMUM_LENGTH + ", was: " + length); |
| 49 | // fixed value property experimenter == 0x5c16c7L |
| 50 | int experimenter = bb.readInt(); |
| 51 | if(experimenter != 0x5c16c7) |
| 52 | throw new OFParseError("Wrong experimenter: Expected=0x5c16c7L(0x5c16c7L), got="+experimenter); |
| 53 | int subtype = bb.readInt(); |
| 54 | bb.readerIndex(start); |
| 55 | switch(subtype) { |
| 56 | case 0x1: |
| 57 | // discriminator value 0x1L=0x1L for class OFInstructionIdBsnArpOffloadVer13 |
| 58 | return OFInstructionIdBsnArpOffloadVer13.READER.readFrom(bb); |
| 59 | case 0x5: |
| 60 | // discriminator value 0x5L=0x5L for class OFInstructionIdBsnDenyVer13 |
| 61 | return OFInstructionIdBsnDenyVer13.READER.readFrom(bb); |
| 62 | case 0x2: |
| 63 | // discriminator value 0x2L=0x2L for class OFInstructionIdBsnDhcpOffloadVer13 |
| 64 | return OFInstructionIdBsnDhcpOffloadVer13.READER.readFrom(bb); |
| 65 | case 0x3: |
| 66 | // discriminator value 0x3L=0x3L for class OFInstructionIdBsnDisableSplitHorizonCheckVer13 |
| 67 | return OFInstructionIdBsnDisableSplitHorizonCheckVer13.READER.readFrom(bb); |
| 68 | case 0x0: |
| 69 | // discriminator value 0x0L=0x0L for class OFInstructionIdBsnDisableSrcMacCheckVer13 |
| 70 | return OFInstructionIdBsnDisableSrcMacCheckVer13.READER.readFrom(bb); |
| 71 | case 0x9: |
| 72 | // discriminator value 0x9L=0x9L for class OFInstructionIdBsnDisableVlanCountersVer13 |
| 73 | return OFInstructionIdBsnDisableVlanCountersVer13.READER.readFrom(bb); |
| 74 | case 0x6: |
| 75 | // discriminator value 0x6L=0x6L for class OFInstructionIdBsnPacketOfDeathVer13 |
| 76 | return OFInstructionIdBsnPacketOfDeathVer13.READER.readFrom(bb); |
| 77 | case 0x4: |
| 78 | // discriminator value 0x4L=0x4L for class OFInstructionIdBsnPermitVer13 |
| 79 | return OFInstructionIdBsnPermitVer13.READER.readFrom(bb); |
| 80 | case 0x7: |
| 81 | // discriminator value 0x7L=0x7L for class OFInstructionIdBsnPrioritizePdusVer13 |
| 82 | return OFInstructionIdBsnPrioritizePdusVer13.READER.readFrom(bb); |
| 83 | case 0x8: |
| 84 | // discriminator value 0x8L=0x8L for class OFInstructionIdBsnRequireVlanXlateVer13 |
| 85 | return OFInstructionIdBsnRequireVlanXlateVer13.READER.readFrom(bb); |
| 86 | default: |
| 87 | throw new OFParseError("Unknown value for discriminator subtype of class OFInstructionIdBsnVer13: " + subtype); |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | } |