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.ver11; |
| 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 OFActionVer11 { |
| 30 | // version: 1.1 |
| 31 | final static byte WIRE_VERSION = 2; |
| 32 | final static int MINIMUM_LENGTH = 8; |
| 33 | |
| 34 | |
| 35 | public final static OFActionVer11.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 OFActionExperimenterVer11 |
| 48 | return OFActionExperimenterVer11.READER.readFrom(bb); |
| 49 | case (short) 0x0: |
| 50 | // discriminator value OFActionType.OUTPUT=0 for class OFActionOutputVer11 |
| 51 | return OFActionOutputVer11.READER.readFrom(bb); |
| 52 | case (short) 0x4: |
| 53 | // discriminator value OFActionType.SET_DL_DST=4 for class OFActionSetDlDstVer11 |
| 54 | return OFActionSetDlDstVer11.READER.readFrom(bb); |
| 55 | case (short) 0x3: |
| 56 | // discriminator value OFActionType.SET_DL_SRC=3 for class OFActionSetDlSrcVer11 |
| 57 | return OFActionSetDlSrcVer11.READER.readFrom(bb); |
| 58 | case (short) 0x6: |
| 59 | // discriminator value OFActionType.SET_NW_DST=6 for class OFActionSetNwDstVer11 |
| 60 | return OFActionSetNwDstVer11.READER.readFrom(bb); |
| 61 | case (short) 0x5: |
| 62 | // discriminator value OFActionType.SET_NW_SRC=5 for class OFActionSetNwSrcVer11 |
| 63 | return OFActionSetNwSrcVer11.READER.readFrom(bb); |
| 64 | case (short) 0x7: |
| 65 | // discriminator value OFActionType.SET_NW_TOS=7 for class OFActionSetNwTosVer11 |
| 66 | return OFActionSetNwTosVer11.READER.readFrom(bb); |
| 67 | case (short) 0xa: |
| 68 | // discriminator value OFActionType.SET_TP_DST=10 for class OFActionSetTpDstVer11 |
| 69 | return OFActionSetTpDstVer11.READER.readFrom(bb); |
| 70 | case (short) 0x9: |
| 71 | // discriminator value OFActionType.SET_TP_SRC=9 for class OFActionSetTpSrcVer11 |
| 72 | return OFActionSetTpSrcVer11.READER.readFrom(bb); |
| 73 | case (short) 0x2: |
| 74 | // discriminator value OFActionType.SET_VLAN_PCP=2 for class OFActionSetVlanPcpVer11 |
| 75 | return OFActionSetVlanPcpVer11.READER.readFrom(bb); |
| 76 | case (short) 0x1: |
| 77 | // discriminator value OFActionType.SET_VLAN_VID=1 for class OFActionSetVlanVidVer11 |
| 78 | return OFActionSetVlanVidVer11.READER.readFrom(bb); |
| 79 | case (short) 0xc: |
| 80 | // discriminator value OFActionType.COPY_TTL_IN=12 for class OFActionCopyTtlInVer11 |
| 81 | return OFActionCopyTtlInVer11.READER.readFrom(bb); |
| 82 | case (short) 0xb: |
| 83 | // discriminator value OFActionType.COPY_TTL_OUT=11 for class OFActionCopyTtlOutVer11 |
| 84 | return OFActionCopyTtlOutVer11.READER.readFrom(bb); |
| 85 | case (short) 0x10: |
| 86 | // discriminator value OFActionType.DEC_MPLS_TTL=16 for class OFActionDecMplsTtlVer11 |
| 87 | return OFActionDecMplsTtlVer11.READER.readFrom(bb); |
| 88 | case (short) 0x18: |
| 89 | // discriminator value OFActionType.DEC_NW_TTL=24 for class OFActionDecNwTtlVer11 |
| 90 | return OFActionDecNwTtlVer11.READER.readFrom(bb); |
| 91 | case (short) 0x16: |
| 92 | // discriminator value OFActionType.GROUP=22 for class OFActionGroupVer11 |
| 93 | return OFActionGroupVer11.READER.readFrom(bb); |
| 94 | case (short) 0x14: |
| 95 | // discriminator value OFActionType.POP_MPLS=20 for class OFActionPopMplsVer11 |
| 96 | return OFActionPopMplsVer11.READER.readFrom(bb); |
| 97 | case (short) 0x12: |
| 98 | // discriminator value OFActionType.POP_VLAN=18 for class OFActionPopVlanVer11 |
| 99 | return OFActionPopVlanVer11.READER.readFrom(bb); |
| 100 | case (short) 0x13: |
| 101 | // discriminator value OFActionType.PUSH_MPLS=19 for class OFActionPushMplsVer11 |
| 102 | return OFActionPushMplsVer11.READER.readFrom(bb); |
| 103 | case (short) 0x11: |
| 104 | // discriminator value OFActionType.PUSH_VLAN=17 for class OFActionPushVlanVer11 |
| 105 | return OFActionPushVlanVer11.READER.readFrom(bb); |
| 106 | case (short) 0xd: |
| 107 | // discriminator value OFActionType.SET_MPLS_LABEL=13 for class OFActionSetMplsLabelVer11 |
| 108 | return OFActionSetMplsLabelVer11.READER.readFrom(bb); |
| 109 | case (short) 0xe: |
| 110 | // discriminator value OFActionType.SET_MPLS_TC=14 for class OFActionSetMplsTcVer11 |
| 111 | return OFActionSetMplsTcVer11.READER.readFrom(bb); |
| 112 | case (short) 0xf: |
| 113 | // discriminator value OFActionType.SET_MPLS_TTL=15 for class OFActionSetMplsTtlVer11 |
| 114 | return OFActionSetMplsTtlVer11.READER.readFrom(bb); |
| 115 | case (short) 0x8: |
| 116 | // discriminator value OFActionType.SET_NW_ECN=8 for class OFActionSetNwEcnVer11 |
| 117 | return OFActionSetNwEcnVer11.READER.readFrom(bb); |
| 118 | case (short) 0x17: |
| 119 | // discriminator value OFActionType.SET_NW_TTL=23 for class OFActionSetNwTtlVer11 |
| 120 | return OFActionSetNwTtlVer11.READER.readFrom(bb); |
| 121 | case (short) 0x15: |
| 122 | // discriminator value OFActionType.SET_QUEUE=21 for class OFActionSetQueueVer11 |
| 123 | return OFActionSetQueueVer11.READER.readFrom(bb); |
| 124 | default: |
| 125 | throw new OFParseError("Unknown value for discriminator type of class OFActionVer11: " + type); |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | } |