blob: 12e35403962fdab981b68c14be17bd9e3a175076 [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.ver12;
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 OFBsnHeaderVer12 {
30 // version: 1.2
31 final static byte WIRE_VERSION = 3;
32 final static int MINIMUM_LENGTH = 16;
33
34
35 public final static OFBsnHeaderVer12.Reader READER = new Reader();
36
37 static class Reader implements OFMessageReader<OFBsnHeader> {
38 @Override
39 public OFBsnHeader readFrom(ChannelBuffer bb) throws OFParseError {
40 if(bb.readableBytes() < MINIMUM_LENGTH)
41 return null;
42 int start = bb.readerIndex();
43 // fixed value property version == 3
44 byte version = bb.readByte();
45 if(version != (byte) 0x3)
46 throw new OFParseError("Wrong version: Expected=OFVersion.OF_12(3), got="+version);
47 // fixed value property type == 4
48 byte type = bb.readByte();
49 if(type != (byte) 0x4)
50 throw new OFParseError("Wrong type: Expected=OFType.EXPERIMENTER(4), got="+type);
51 int length = U16.f(bb.readShort());
52 if(length < MINIMUM_LENGTH)
53 throw new OFParseError("Wrong length: Expected to be >= " + MINIMUM_LENGTH + ", was: " + length);
54 U32.f(bb.readInt());
55 // fixed value property experimenter == 0x5c16c7L
56 int experimenter = bb.readInt();
57 if(experimenter != 0x5c16c7)
58 throw new OFParseError("Wrong experimenter: Expected=0x5c16c7L(0x5c16c7L), got="+experimenter);
59 int subtype = bb.readInt();
60 bb.readerIndex(start);
61 switch(subtype) {
62 case 0x16:
63 // discriminator value 0x16L=0x16L for class OFBsnBwClearDataReplyVer12
64 return OFBsnBwClearDataReplyVer12.READER.readFrom(bb);
65 case 0x15:
66 // discriminator value 0x15L=0x15L for class OFBsnBwClearDataRequestVer12
67 return OFBsnBwClearDataRequestVer12.READER.readFrom(bb);
68 case 0x14:
69 // discriminator value 0x14L=0x14L for class OFBsnBwEnableGetReplyVer12
70 return OFBsnBwEnableGetReplyVer12.READER.readFrom(bb);
71 case 0x13:
72 // discriminator value 0x13L=0x13L for class OFBsnBwEnableGetRequestVer12
73 return OFBsnBwEnableGetRequestVer12.READER.readFrom(bb);
74 case 0x17:
75 // discriminator value 0x17L=0x17L for class OFBsnBwEnableSetReplyVer12
76 return OFBsnBwEnableSetReplyVer12.READER.readFrom(bb);
77 case 0x12:
78 // discriminator value 0x12L=0x12L for class OFBsnBwEnableSetRequestVer12
79 return OFBsnBwEnableSetRequestVer12.READER.readFrom(bb);
80 case 0xa:
81 // discriminator value 0xaL=0xaL for class OFBsnGetInterfacesReplyVer12
82 return OFBsnGetInterfacesReplyVer12.READER.readFrom(bb);
83 case 0x9:
84 // discriminator value 0x9L=0x9L for class OFBsnGetInterfacesRequestVer12
85 return OFBsnGetInterfacesRequestVer12.READER.readFrom(bb);
86 case 0x5:
87 // discriminator value 0x5L=0x5L for class OFBsnGetMirroringReplyVer12
88 return OFBsnGetMirroringReplyVer12.READER.readFrom(bb);
89 case 0x4:
90 // discriminator value 0x4L=0x4L for class OFBsnGetMirroringRequestVer12
91 return OFBsnGetMirroringRequestVer12.READER.readFrom(bb);
92 case 0x22:
93 // discriminator value 0x22L=0x22L for class OFBsnPduRxReplyVer12
94 return OFBsnPduRxReplyVer12.READER.readFrom(bb);
95 case 0x21:
96 // discriminator value 0x21L=0x21L for class OFBsnPduRxRequestVer12
97 return OFBsnPduRxRequestVer12.READER.readFrom(bb);
98 case 0x23:
99 // discriminator value 0x23L=0x23L for class OFBsnPduRxTimeoutVer12
100 return OFBsnPduRxTimeoutVer12.READER.readFrom(bb);
101 case 0x20:
102 // discriminator value 0x20L=0x20L for class OFBsnPduTxReplyVer12
103 return OFBsnPduTxReplyVer12.READER.readFrom(bb);
104 case 0x1f:
105 // discriminator value 0x1fL=0x1fL for class OFBsnPduTxRequestVer12
106 return OFBsnPduTxRequestVer12.READER.readFrom(bb);
107 case 0x3:
108 // discriminator value 0x3L=0x3L for class OFBsnSetMirroringVer12
109 return OFBsnSetMirroringVer12.READER.readFrom(bb);
110 case 0x19:
111 // discriminator value 0x19L=0x19L for class OFBsnSetPktinSuppressionReplyVer12
112 return OFBsnSetPktinSuppressionReplyVer12.READER.readFrom(bb);
113 case 0xb:
114 // discriminator value 0xbL=0xbL for class OFBsnSetPktinSuppressionRequestVer12
115 return OFBsnSetPktinSuppressionRequestVer12.READER.readFrom(bb);
116 case 0x10:
117 // discriminator value 0x10L=0x10L for class OFBsnVirtualPortCreateReplyVer12
118 return OFBsnVirtualPortCreateReplyVer12.READER.readFrom(bb);
119 case 0xf:
120 // discriminator value 0xfL=0xfL for class OFBsnVirtualPortCreateRequestVer12
121 return OFBsnVirtualPortCreateRequestVer12.READER.readFrom(bb);
122 case 0x1a:
123 // discriminator value 0x1aL=0x1aL for class OFBsnVirtualPortRemoveReplyVer12
124 return OFBsnVirtualPortRemoveReplyVer12.READER.readFrom(bb);
125 case 0x11:
126 // discriminator value 0x11L=0x11L for class OFBsnVirtualPortRemoveRequestVer12
127 return OFBsnVirtualPortRemoveRequestVer12.READER.readFrom(bb);
128 default:
129 throw new OFParseError("Unknown value for discriminator subtype of class OFBsnHeaderVer12: " + subtype);
130 }
131 }
132 }
133}