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.ver12; |
| 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 OFInstructionVer12 { |
| 29 | // version: 1.2 |
| 30 | final static byte WIRE_VERSION = 3; |
| 31 | final static int MINIMUM_LENGTH = 8; |
| 32 | |
| 33 | |
| 34 | public final static OFInstructionVer12.Reader READER = new Reader(); |
| 35 | |
| 36 | static class Reader implements OFMessageReader<OFInstruction> { |
| 37 | @Override |
| 38 | public OFInstruction readFrom(ChannelBuffer bb) throws OFParseError { |
| 39 | if(bb.readableBytes() < MINIMUM_LENGTH) |
| 40 | return null; |
| 41 | int start = bb.readerIndex(); |
| 42 | short type = bb.readShort(); |
| 43 | bb.readerIndex(start); |
| 44 | switch(type) { |
| 45 | case (short) 0x4: |
| 46 | // discriminator value OFInstructionType.APPLY_ACTIONS=4 for class OFInstructionApplyActionsVer12 |
| 47 | return OFInstructionApplyActionsVer12.READER.readFrom(bb); |
| 48 | case (short) 0x5: |
| 49 | // discriminator value OFInstructionType.CLEAR_ACTIONS=5 for class OFInstructionClearActionsVer12 |
| 50 | return OFInstructionClearActionsVer12.READER.readFrom(bb); |
| 51 | case (short) 0xffff: |
| 52 | // discriminator value OFInstructionType.EXPERIMENTER=65535 for class OFInstructionExperimenterVer12 |
| 53 | return OFInstructionExperimenterVer12.READER.readFrom(bb); |
| 54 | case (short) 0x1: |
| 55 | // discriminator value OFInstructionType.GOTO_TABLE=1 for class OFInstructionGotoTableVer12 |
| 56 | return OFInstructionGotoTableVer12.READER.readFrom(bb); |
| 57 | case (short) 0x3: |
| 58 | // discriminator value OFInstructionType.WRITE_ACTIONS=3 for class OFInstructionWriteActionsVer12 |
| 59 | return OFInstructionWriteActionsVer12.READER.readFrom(bb); |
| 60 | case (short) 0x2: |
| 61 | // discriminator value OFInstructionType.WRITE_METADATA=2 for class OFInstructionWriteMetadataVer12 |
| 62 | return OFInstructionWriteMetadataVer12.READER.readFrom(bb); |
| 63 | default: |
| 64 | throw new OFParseError("Unknown value for discriminator type of class OFInstructionVer12: " + type); |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | } |