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.ver10; |
| 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 OFActionVer10 { |
| 30 | // version: 1.0 |
| 31 | final static byte WIRE_VERSION = 1; |
| 32 | final static int MINIMUM_LENGTH = 8; |
| 33 | |
| 34 | |
| 35 | public final static OFActionVer10.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 OFActionExperimenterVer10 |
| 48 | return OFActionExperimenterVer10.READER.readFrom(bb); |
| 49 | case (short) 0xb: |
| 50 | // discriminator value OFActionType.ENQUEUE=11 for class OFActionEnqueueVer10 |
| 51 | return OFActionEnqueueVer10.READER.readFrom(bb); |
| 52 | case (short) 0x0: |
| 53 | // discriminator value OFActionType.OUTPUT=0 for class OFActionOutputVer10 |
| 54 | return OFActionOutputVer10.READER.readFrom(bb); |
| 55 | case (short) 0x5: |
| 56 | // discriminator value OFActionType.SET_DL_DST=5 for class OFActionSetDlDstVer10 |
| 57 | return OFActionSetDlDstVer10.READER.readFrom(bb); |
| 58 | case (short) 0x4: |
| 59 | // discriminator value OFActionType.SET_DL_SRC=4 for class OFActionSetDlSrcVer10 |
| 60 | return OFActionSetDlSrcVer10.READER.readFrom(bb); |
| 61 | case (short) 0x7: |
| 62 | // discriminator value OFActionType.SET_NW_DST=7 for class OFActionSetNwDstVer10 |
| 63 | return OFActionSetNwDstVer10.READER.readFrom(bb); |
| 64 | case (short) 0x6: |
| 65 | // discriminator value OFActionType.SET_NW_SRC=6 for class OFActionSetNwSrcVer10 |
| 66 | return OFActionSetNwSrcVer10.READER.readFrom(bb); |
| 67 | case (short) 0x8: |
| 68 | // discriminator value OFActionType.SET_NW_TOS=8 for class OFActionSetNwTosVer10 |
| 69 | return OFActionSetNwTosVer10.READER.readFrom(bb); |
| 70 | case (short) 0xa: |
| 71 | // discriminator value OFActionType.SET_TP_DST=10 for class OFActionSetTpDstVer10 |
| 72 | return OFActionSetTpDstVer10.READER.readFrom(bb); |
| 73 | case (short) 0x9: |
| 74 | // discriminator value OFActionType.SET_TP_SRC=9 for class OFActionSetTpSrcVer10 |
| 75 | return OFActionSetTpSrcVer10.READER.readFrom(bb); |
| 76 | case (short) 0x2: |
| 77 | // discriminator value OFActionType.SET_VLAN_PCP=2 for class OFActionSetVlanPcpVer10 |
| 78 | return OFActionSetVlanPcpVer10.READER.readFrom(bb); |
| 79 | case (short) 0x1: |
| 80 | // discriminator value OFActionType.SET_VLAN_VID=1 for class OFActionSetVlanVidVer10 |
| 81 | return OFActionSetVlanVidVer10.READER.readFrom(bb); |
| 82 | case (short) 0x3: |
| 83 | // discriminator value OFActionType.STRIP_VLAN=3 for class OFActionStripVlanVer10 |
| 84 | return OFActionStripVlanVer10.READER.readFrom(bb); |
| 85 | default: |
| 86 | throw new OFParseError("Unknown value for discriminator type of class OFActionVer10: " + type); |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | } |