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.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 | import java.util.Set; |
| 28 | |
| 29 | abstract class OFActionVer12 { |
| 30 | // version: 1.2 |
| 31 | final static byte WIRE_VERSION = 3; |
| 32 | final static int MINIMUM_LENGTH = 8; |
| 33 | |
| 34 | |
| 35 | public final static OFActionVer12.Reader READER = new Reader(); |
| 36 | |
| 37 | static class Reader implements OFMessageReader<OFAction> { |
| 38 | @Override |
| 39 | public OFAction readFrom(ChannelBuffer bb) throws OFParseError { |
| 40 | if(bb.readableBytes() < MINIMUM_LENGTH) |
| 41 | return null; |
| 42 | int start = bb.readerIndex(); |
| 43 | short type = bb.readShort(); |
| 44 | bb.readerIndex(start); |
| 45 | switch(type) { |
| 46 | case (short) 0xffff: |
| 47 | // discriminator value OFActionType.EXPERIMENTER=65535 for class OFActionExperimenterVer12 |
| 48 | return OFActionExperimenterVer12.READER.readFrom(bb); |
| 49 | case (short) 0x0: |
| 50 | // discriminator value OFActionType.OUTPUT=0 for class OFActionOutputVer12 |
| 51 | return OFActionOutputVer12.READER.readFrom(bb); |
| 52 | case (short) 0xc: |
| 53 | // discriminator value OFActionType.COPY_TTL_IN=12 for class OFActionCopyTtlInVer12 |
| 54 | return OFActionCopyTtlInVer12.READER.readFrom(bb); |
| 55 | case (short) 0xb: |
| 56 | // discriminator value OFActionType.COPY_TTL_OUT=11 for class OFActionCopyTtlOutVer12 |
| 57 | return OFActionCopyTtlOutVer12.READER.readFrom(bb); |
| 58 | case (short) 0x10: |
| 59 | // discriminator value OFActionType.DEC_MPLS_TTL=16 for class OFActionDecMplsTtlVer12 |
| 60 | return OFActionDecMplsTtlVer12.READER.readFrom(bb); |
| 61 | case (short) 0x18: |
| 62 | // discriminator value OFActionType.DEC_NW_TTL=24 for class OFActionDecNwTtlVer12 |
| 63 | return OFActionDecNwTtlVer12.READER.readFrom(bb); |
| 64 | case (short) 0x16: |
| 65 | // discriminator value OFActionType.GROUP=22 for class OFActionGroupVer12 |
| 66 | return OFActionGroupVer12.READER.readFrom(bb); |
| 67 | case (short) 0x14: |
| 68 | // discriminator value OFActionType.POP_MPLS=20 for class OFActionPopMplsVer12 |
| 69 | return OFActionPopMplsVer12.READER.readFrom(bb); |
| 70 | case (short) 0x12: |
| 71 | // discriminator value OFActionType.POP_VLAN=18 for class OFActionPopVlanVer12 |
| 72 | return OFActionPopVlanVer12.READER.readFrom(bb); |
| 73 | case (short) 0x13: |
| 74 | // discriminator value OFActionType.PUSH_MPLS=19 for class OFActionPushMplsVer12 |
| 75 | return OFActionPushMplsVer12.READER.readFrom(bb); |
| 76 | case (short) 0x11: |
| 77 | // discriminator value OFActionType.PUSH_VLAN=17 for class OFActionPushVlanVer12 |
| 78 | return OFActionPushVlanVer12.READER.readFrom(bb); |
| 79 | case (short) 0xf: |
| 80 | // discriminator value OFActionType.SET_MPLS_TTL=15 for class OFActionSetMplsTtlVer12 |
| 81 | return OFActionSetMplsTtlVer12.READER.readFrom(bb); |
| 82 | case (short) 0x17: |
| 83 | // discriminator value OFActionType.SET_NW_TTL=23 for class OFActionSetNwTtlVer12 |
| 84 | return OFActionSetNwTtlVer12.READER.readFrom(bb); |
| 85 | case (short) 0x15: |
| 86 | // discriminator value OFActionType.SET_QUEUE=21 for class OFActionSetQueueVer12 |
| 87 | return OFActionSetQueueVer12.READER.readFrom(bb); |
| 88 | case (short) 0x19: |
| 89 | // discriminator value OFActionType.SET_FIELD=25 for class OFActionSetFieldVer12 |
| 90 | return OFActionSetFieldVer12.READER.readFrom(bb); |
| 91 | default: |
| 92 | throw new OFParseError("Unknown value for discriminator type of class OFActionVer12: " + type); |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | } |