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.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 | |
| 28 | abstract class OFBsnStatsRequestVer13 { |
| 29 | // version: 1.3 |
| 30 | final static byte WIRE_VERSION = 4; |
| 31 | final static int MINIMUM_LENGTH = 24; |
| 32 | |
| 33 | |
| 34 | public final static OFBsnStatsRequestVer13.Reader READER = new Reader(); |
| 35 | |
| 36 | static class Reader implements OFMessageReader<OFBsnStatsRequest<?>> { |
| 37 | @Override |
| 38 | public OFBsnStatsRequest<?> readFrom(ChannelBuffer bb) throws OFParseError { |
| 39 | if(bb.readableBytes() < MINIMUM_LENGTH) |
| 40 | return null; |
| 41 | int start = bb.readerIndex(); |
| 42 | // fixed value property version == 4 |
| 43 | byte version = bb.readByte(); |
| 44 | if(version != (byte) 0x4) |
| 45 | throw new OFParseError("Wrong version: Expected=OFVersion.OF_13(4), got="+version); |
| 46 | // fixed value property type == 18 |
| 47 | byte type = bb.readByte(); |
| 48 | if(type != (byte) 0x12) |
| 49 | throw new OFParseError("Wrong type: Expected=OFType.STATS_REQUEST(18), got="+type); |
| 50 | int length = U16.f(bb.readShort()); |
| 51 | if(length < MINIMUM_LENGTH) |
| 52 | throw new OFParseError("Wrong length: Expected to be >= " + MINIMUM_LENGTH + ", was: " + length); |
| 53 | U32.f(bb.readInt()); |
| 54 | // fixed value property statsType == 65535 |
| 55 | short statsType = bb.readShort(); |
| 56 | if(statsType != (short) 0xffff) |
| 57 | throw new OFParseError("Wrong statsType: Expected=OFStatsType.EXPERIMENTER(65535), got="+statsType); |
| 58 | OFStatsRequestFlagsSerializerVer13.readFrom(bb); |
| 59 | // pad: 4 bytes |
| 60 | bb.skipBytes(4); |
| 61 | // fixed value property experimenter == 0x5c16c7L |
| 62 | int experimenter = bb.readInt(); |
| 63 | if(experimenter != 0x5c16c7) |
| 64 | throw new OFParseError("Wrong experimenter: Expected=0x5c16c7L(0x5c16c7L), got="+experimenter); |
| 65 | int subtype = bb.readInt(); |
| 66 | bb.readerIndex(start); |
| 67 | switch(subtype) { |
| 68 | case 0xd: |
| 69 | // discriminator value 0xdL=0xdL for class OFBsnDebugCounterDescStatsRequestVer13 |
| 70 | return OFBsnDebugCounterDescStatsRequestVer13.READER.readFrom(bb); |
| 71 | case 0xc: |
| 72 | // discriminator value 0xcL=0xcL for class OFBsnDebugCounterStatsRequestVer13 |
| 73 | return OFBsnDebugCounterStatsRequestVer13.READER.readFrom(bb); |
| 74 | case 0xa: |
| 75 | // discriminator value 0xaL=0xaL for class OFBsnFlowChecksumBucketStatsRequestVer13 |
| 76 | return OFBsnFlowChecksumBucketStatsRequestVer13.READER.readFrom(bb); |
| 77 | case 0x5: |
| 78 | // discriminator value 0x5L=0x5L for class OFBsnGentableBucketStatsRequestVer13 |
| 79 | return OFBsnGentableBucketStatsRequestVer13.READER.readFrom(bb); |
| 80 | case 0x4: |
| 81 | // discriminator value 0x4L=0x4L for class OFBsnGentableDescStatsRequestVer13 |
| 82 | return OFBsnGentableDescStatsRequestVer13.READER.readFrom(bb); |
| 83 | case 0x2: |
| 84 | // discriminator value 0x2L=0x2L for class OFBsnGentableEntryDescStatsRequestVer13 |
| 85 | return OFBsnGentableEntryDescStatsRequestVer13.READER.readFrom(bb); |
| 86 | case 0x3: |
| 87 | // discriminator value 0x3L=0x3L for class OFBsnGentableEntryStatsRequestVer13 |
| 88 | return OFBsnGentableEntryStatsRequestVer13.READER.readFrom(bb); |
| 89 | case 0x7: |
| 90 | // discriminator value 0x7L=0x7L for class OFBsnGentableStatsRequestVer13 |
| 91 | return OFBsnGentableStatsRequestVer13.READER.readFrom(bb); |
| 92 | case 0xe: |
| 93 | // discriminator value 0xeL=0xeL for class OFBsnImageDescStatsRequestVer13 |
| 94 | return OFBsnImageDescStatsRequestVer13.READER.readFrom(bb); |
| 95 | case 0x1: |
| 96 | // discriminator value 0x1L=0x1L for class OFBsnLacpStatsRequestVer13 |
| 97 | return OFBsnLacpStatsRequestVer13.READER.readFrom(bb); |
| 98 | case 0x8: |
| 99 | // discriminator value 0x8L=0x8L for class OFBsnPortCounterStatsRequestVer13 |
| 100 | return OFBsnPortCounterStatsRequestVer13.READER.readFrom(bb); |
| 101 | case 0x6: |
| 102 | // discriminator value 0x6L=0x6L for class OFBsnSwitchPipelineStatsRequestVer13 |
| 103 | return OFBsnSwitchPipelineStatsRequestVer13.READER.readFrom(bb); |
| 104 | case 0xb: |
| 105 | // discriminator value 0xbL=0xbL for class OFBsnTableChecksumStatsRequestVer13 |
| 106 | return OFBsnTableChecksumStatsRequestVer13.READER.readFrom(bb); |
| 107 | case 0x9: |
| 108 | // discriminator value 0x9L=0x9L for class OFBsnVlanCounterStatsRequestVer13 |
| 109 | return OFBsnVlanCounterStatsRequestVer13.READER.readFrom(bb); |
| 110 | case 0xf: |
| 111 | // discriminator value 0xfL=0xfL for class OFBsnVrfCounterStatsRequestVer13 |
| 112 | return OFBsnVrfCounterStatsRequestVer13.READER.readFrom(bb); |
| 113 | default: |
| 114 | throw new OFParseError("Unknown value for discriminator subtype of class OFBsnStatsRequestVer13: " + subtype); |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | } |