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 | import java.util.Set; |
| 28 | |
| 29 | abstract class OFActionVer13 { |
| 30 | // version: 1.3 |
| 31 | final static byte WIRE_VERSION = 4; |
| 32 | final static int MINIMUM_LENGTH = 8; |
| 33 | |
| 34 | |
| 35 | public final static OFActionVer13.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 OFActionExperimenterVer13 |
| 48 | return OFActionExperimenterVer13.READER.readFrom(bb); |
| 49 | case (short) 0x0: |
| 50 | // discriminator value OFActionType.OUTPUT=0 for class OFActionOutputVer13 |
| 51 | return OFActionOutputVer13.READER.readFrom(bb); |
| 52 | case (short) 0xc: |
| 53 | // discriminator value OFActionType.COPY_TTL_IN=12 for class OFActionCopyTtlInVer13 |
| 54 | return OFActionCopyTtlInVer13.READER.readFrom(bb); |
| 55 | case (short) 0xb: |
| 56 | // discriminator value OFActionType.COPY_TTL_OUT=11 for class OFActionCopyTtlOutVer13 |
| 57 | return OFActionCopyTtlOutVer13.READER.readFrom(bb); |
| 58 | case (short) 0x10: |
| 59 | // discriminator value OFActionType.DEC_MPLS_TTL=16 for class OFActionDecMplsTtlVer13 |
| 60 | return OFActionDecMplsTtlVer13.READER.readFrom(bb); |
| 61 | case (short) 0x18: |
| 62 | // discriminator value OFActionType.DEC_NW_TTL=24 for class OFActionDecNwTtlVer13 |
| 63 | return OFActionDecNwTtlVer13.READER.readFrom(bb); |
| 64 | case (short) 0x16: |
| 65 | // discriminator value OFActionType.GROUP=22 for class OFActionGroupVer13 |
| 66 | return OFActionGroupVer13.READER.readFrom(bb); |
| 67 | case (short) 0x14: |
| 68 | // discriminator value OFActionType.POP_MPLS=20 for class OFActionPopMplsVer13 |
| 69 | return OFActionPopMplsVer13.READER.readFrom(bb); |
| 70 | case (short) 0x12: |
| 71 | // discriminator value OFActionType.POP_VLAN=18 for class OFActionPopVlanVer13 |
| 72 | return OFActionPopVlanVer13.READER.readFrom(bb); |
| 73 | case (short) 0x13: |
| 74 | // discriminator value OFActionType.PUSH_MPLS=19 for class OFActionPushMplsVer13 |
| 75 | return OFActionPushMplsVer13.READER.readFrom(bb); |
| 76 | case (short) 0x11: |
| 77 | // discriminator value OFActionType.PUSH_VLAN=17 for class OFActionPushVlanVer13 |
| 78 | return OFActionPushVlanVer13.READER.readFrom(bb); |
| 79 | case (short) 0xf: |
| 80 | // discriminator value OFActionType.SET_MPLS_TTL=15 for class OFActionSetMplsTtlVer13 |
| 81 | return OFActionSetMplsTtlVer13.READER.readFrom(bb); |
| 82 | case (short) 0x17: |
| 83 | // discriminator value OFActionType.SET_NW_TTL=23 for class OFActionSetNwTtlVer13 |
| 84 | return OFActionSetNwTtlVer13.READER.readFrom(bb); |
| 85 | case (short) 0x15: |
| 86 | // discriminator value OFActionType.SET_QUEUE=21 for class OFActionSetQueueVer13 |
| 87 | return OFActionSetQueueVer13.READER.readFrom(bb); |
| 88 | case (short) 0x19: |
| 89 | // discriminator value OFActionType.SET_FIELD=25 for class OFActionSetFieldVer13 |
| 90 | return OFActionSetFieldVer13.READER.readFrom(bb); |
| 91 | case (short) 0x1b: |
| 92 | // discriminator value OFActionType.POP_PBB=27 for class OFActionPopPbbVer13 |
| 93 | return OFActionPopPbbVer13.READER.readFrom(bb); |
| 94 | case (short) 0x1a: |
| 95 | // discriminator value OFActionType.PUSH_PBB=26 for class OFActionPushPbbVer13 |
| 96 | return OFActionPushPbbVer13.READER.readFrom(bb); |
| 97 | default: |
| 98 | throw new OFParseError("Unknown value for discriminator type of class OFActionVer13: " + type); |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | } |