blob: 9bed4ebbde71196ff7bdf98601f4cf5d438ff9a3 [file] [log] [blame]
tom0eb04ca2014-08-25 14:34:51 -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.ver11;
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;
27import java.util.Set;
28
29abstract class OFMessageVer11 {
30 // version: 1.1
31 final static byte WIRE_VERSION = 2;
32 final static int MINIMUM_LENGTH = 8;
33
34
35 public final static OFMessageVer11.Reader READER = new Reader();
36
37 static class Reader implements OFMessageReader<OFMessage> {
38 @Override
39 public OFMessage readFrom(ChannelBuffer bb) throws OFParseError {
40 if(bb.readableBytes() < MINIMUM_LENGTH)
41 return null;
42 int start = bb.readerIndex();
43 // fixed value property version == 2
44 byte version = bb.readByte();
45 if(version != (byte) 0x2)
46 throw new OFParseError("Wrong version: Expected=OFVersion.OF_11(2), got="+version);
47 byte type = bb.readByte();
48 bb.readerIndex(start);
49 switch(type) {
50 case (byte) 0x13:
51 // discriminator value OFType.STATS_REPLY=19 for class OFStatsReplyVer11
52 return OFStatsReplyVer11.READER.readFrom(bb);
53 case (byte) 0x12:
54 // discriminator value OFType.STATS_REQUEST=18 for class OFStatsRequestVer11
55 return OFStatsRequestVer11.READER.readFrom(bb);
56 case (byte) 0x1:
57 // discriminator value OFType.ERROR=1 for class OFErrorMsgVer11
58 return OFErrorMsgVer11.READER.readFrom(bb);
59 case (byte) 0x15:
60 // discriminator value OFType.BARRIER_REPLY=21 for class OFBarrierReplyVer11
61 return OFBarrierReplyVer11.READER.readFrom(bb);
62 case (byte) 0x14:
63 // discriminator value OFType.BARRIER_REQUEST=20 for class OFBarrierRequestVer11
64 return OFBarrierRequestVer11.READER.readFrom(bb);
65 case (byte) 0x4:
66 // discriminator value OFType.EXPERIMENTER=4 for class OFExperimenterVer11
67 return OFExperimenterVer11.READER.readFrom(bb);
68 case (byte) 0x3:
69 // discriminator value OFType.ECHO_REPLY=3 for class OFEchoReplyVer11
70 return OFEchoReplyVer11.READER.readFrom(bb);
71 case (byte) 0x2:
72 // discriminator value OFType.ECHO_REQUEST=2 for class OFEchoRequestVer11
73 return OFEchoRequestVer11.READER.readFrom(bb);
74 case (byte) 0x6:
75 // discriminator value OFType.FEATURES_REPLY=6 for class OFFeaturesReplyVer11
76 return OFFeaturesReplyVer11.READER.readFrom(bb);
77 case (byte) 0x5:
78 // discriminator value OFType.FEATURES_REQUEST=5 for class OFFeaturesRequestVer11
79 return OFFeaturesRequestVer11.READER.readFrom(bb);
80 case (byte) 0xe:
81 // discriminator value OFType.FLOW_MOD=14 for class OFFlowModVer11
82 return OFFlowModVer11.READER.readFrom(bb);
83 case (byte) 0xb:
84 // discriminator value OFType.FLOW_REMOVED=11 for class OFFlowRemovedVer11
85 return OFFlowRemovedVer11.READER.readFrom(bb);
86 case (byte) 0x8:
87 // discriminator value OFType.GET_CONFIG_REPLY=8 for class OFGetConfigReplyVer11
88 return OFGetConfigReplyVer11.READER.readFrom(bb);
89 case (byte) 0x7:
90 // discriminator value OFType.GET_CONFIG_REQUEST=7 for class OFGetConfigRequestVer11
91 return OFGetConfigRequestVer11.READER.readFrom(bb);
92 case (byte) 0x0:
93 // discriminator value OFType.HELLO=0 for class OFHelloVer11
94 return OFHelloVer11.READER.readFrom(bb);
95 case (byte) 0xa:
96 // discriminator value OFType.PACKET_IN=10 for class OFPacketInVer11
97 return OFPacketInVer11.READER.readFrom(bb);
98 case (byte) 0xd:
99 // discriminator value OFType.PACKET_OUT=13 for class OFPacketOutVer11
100 return OFPacketOutVer11.READER.readFrom(bb);
101 case (byte) 0x10:
102 // discriminator value OFType.PORT_MOD=16 for class OFPortModVer11
103 return OFPortModVer11.READER.readFrom(bb);
104 case (byte) 0xc:
105 // discriminator value OFType.PORT_STATUS=12 for class OFPortStatusVer11
106 return OFPortStatusVer11.READER.readFrom(bb);
107 case (byte) 0x17:
108 // discriminator value OFType.QUEUE_GET_CONFIG_REPLY=23 for class OFQueueGetConfigReplyVer11
109 return OFQueueGetConfigReplyVer11.READER.readFrom(bb);
110 case (byte) 0x16:
111 // discriminator value OFType.QUEUE_GET_CONFIG_REQUEST=22 for class OFQueueGetConfigRequestVer11
112 return OFQueueGetConfigRequestVer11.READER.readFrom(bb);
113 case (byte) 0x9:
114 // discriminator value OFType.SET_CONFIG=9 for class OFSetConfigVer11
115 return OFSetConfigVer11.READER.readFrom(bb);
116 case (byte) 0x11:
117 // discriminator value OFType.TABLE_MOD=17 for class OFTableModVer11
118 return OFTableModVer11.READER.readFrom(bb);
119 case (byte) 0xf:
120 // discriminator value OFType.GROUP_MOD=15 for class OFGroupModVer11
121 return OFGroupModVer11.READER.readFrom(bb);
122 default:
123 throw new OFParseError("Unknown value for discriminator type of class OFMessageVer11: " + type);
124 }
125 }
126 }
127}