blob: e532526ac315799b3a8c5fd855a1311fee78ee41 [file] [log] [blame]
alshabib86ac11c2014-08-14 16:14:41 -07001// 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
10package org.projectfloodlight.openflow.protocol.ver13;
11
12import org.projectfloodlight.openflow.protocol.*;
13import org.projectfloodlight.openflow.protocol.action.*;
14import org.projectfloodlight.openflow.protocol.actionid.*;
15import org.projectfloodlight.openflow.protocol.bsntlv.*;
16import org.projectfloodlight.openflow.protocol.errormsg.*;
17import org.projectfloodlight.openflow.protocol.meterband.*;
18import org.projectfloodlight.openflow.protocol.instruction.*;
19import org.projectfloodlight.openflow.protocol.instructionid.*;
20import org.projectfloodlight.openflow.protocol.match.*;
21import org.projectfloodlight.openflow.protocol.oxm.*;
22import org.projectfloodlight.openflow.protocol.queueprop.*;
23import org.projectfloodlight.openflow.types.*;
24import org.projectfloodlight.openflow.util.*;
25import org.projectfloodlight.openflow.exceptions.*;
26import org.jboss.netty.buffer.ChannelBuffer;
27
28abstract class OFStatsRequestVer13 {
29 // version: 1.3
30 final static byte WIRE_VERSION = 4;
31 final static int MINIMUM_LENGTH = 16;
32
33
34 public final static OFStatsRequestVer13.Reader READER = new Reader();
35
36 static class Reader implements OFMessageReader<OFStatsRequest<?>> {
37 @Override
38 public OFStatsRequest<?> 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 short statsType = bb.readShort();
55 bb.readerIndex(start);
56 switch(statsType) {
57 case (short) 0x2:
58 // discriminator value OFStatsType.AGGREGATE=2 for class OFAggregateStatsRequestVer13
59 return OFAggregateStatsRequestVer13.READER.readFrom(bb);
60 case (short) 0xffff:
61 // discriminator value OFStatsType.EXPERIMENTER=65535 for class OFExperimenterStatsRequestVer13
62 return OFExperimenterStatsRequestVer13.READER.readFrom(bb);
63 case (short) 0x0:
64 // discriminator value OFStatsType.DESC=0 for class OFDescStatsRequestVer13
65 return OFDescStatsRequestVer13.READER.readFrom(bb);
66 case (short) 0x1:
67 // discriminator value OFStatsType.FLOW=1 for class OFFlowStatsRequestVer13
68 return OFFlowStatsRequestVer13.READER.readFrom(bb);
69 case (short) 0x4:
70 // discriminator value OFStatsType.PORT=4 for class OFPortStatsRequestVer13
71 return OFPortStatsRequestVer13.READER.readFrom(bb);
72 case (short) 0x5:
73 // discriminator value OFStatsType.QUEUE=5 for class OFQueueStatsRequestVer13
74 return OFQueueStatsRequestVer13.READER.readFrom(bb);
75 case (short) 0x3:
76 // discriminator value OFStatsType.TABLE=3 for class OFTableStatsRequestVer13
77 return OFTableStatsRequestVer13.READER.readFrom(bb);
78 case (short) 0x7:
79 // discriminator value OFStatsType.GROUP_DESC=7 for class OFGroupDescStatsRequestVer13
80 return OFGroupDescStatsRequestVer13.READER.readFrom(bb);
81 case (short) 0x6:
82 // discriminator value OFStatsType.GROUP=6 for class OFGroupStatsRequestVer13
83 return OFGroupStatsRequestVer13.READER.readFrom(bb);
84 case (short) 0x8:
85 // discriminator value OFStatsType.GROUP_FEATURES=8 for class OFGroupFeaturesStatsRequestVer13
86 return OFGroupFeaturesStatsRequestVer13.READER.readFrom(bb);
87 case (short) 0xa:
88 // discriminator value OFStatsType.METER_CONFIG=10 for class OFMeterConfigStatsRequestVer13
89 return OFMeterConfigStatsRequestVer13.READER.readFrom(bb);
90 case (short) 0xb:
91 // discriminator value OFStatsType.METER_FEATURES=11 for class OFMeterFeaturesStatsRequestVer13
92 return OFMeterFeaturesStatsRequestVer13.READER.readFrom(bb);
93 case (short) 0x9:
94 // discriminator value OFStatsType.METER=9 for class OFMeterStatsRequestVer13
95 return OFMeterStatsRequestVer13.READER.readFrom(bb);
96 case (short) 0xd:
97 // discriminator value OFStatsType.PORT_DESC=13 for class OFPortDescStatsRequestVer13
98 return OFPortDescStatsRequestVer13.READER.readFrom(bb);
99 case (short) 0xc:
100 // discriminator value OFStatsType.TABLE_FEATURES=12 for class OFTableFeaturesStatsRequestVer13
101 return OFTableFeaturesStatsRequestVer13.READER.readFrom(bb);
102 default:
103 throw new OFParseError("Unknown value for discriminator statsType of class OFStatsRequestVer13: " + statsType);
104 }
105 }
106 }
107}