blob: 868042fc692d8eef96c7c45f115ec500a7377053 [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_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.slf4j.Logger;
27import org.slf4j.LoggerFactory;
28import org.jboss.netty.buffer.ChannelBuffer;
29import com.google.common.hash.PrimitiveSink;
30import com.google.common.hash.Funnel;
31
32class OFInstructionBsnDisableSrcMacCheckVer13 implements OFInstructionBsnDisableSrcMacCheck {
33 private static final Logger logger = LoggerFactory.getLogger(OFInstructionBsnDisableSrcMacCheckVer13.class);
34 // version: 1.3
35 final static byte WIRE_VERSION = 4;
36 final static int LENGTH = 16;
37
38
39 // OF message fields
40//
41 // Immutable default instance
42 final static OFInstructionBsnDisableSrcMacCheckVer13 DEFAULT = new OFInstructionBsnDisableSrcMacCheckVer13(
43
44 );
45
46 final static OFInstructionBsnDisableSrcMacCheckVer13 INSTANCE = new OFInstructionBsnDisableSrcMacCheckVer13();
47 // private empty constructor - use shared instance!
48 private OFInstructionBsnDisableSrcMacCheckVer13() {
49 }
50
51 // Accessors for OF message fields
52 @Override
53 public OFInstructionType getType() {
54 return OFInstructionType.EXPERIMENTER;
55 }
56
57 @Override
58 public long getExperimenter() {
59 return 0x5c16c7L;
60 }
61
62 @Override
63 public long getSubtype() {
64 return 0x0L;
65 }
66
67 @Override
68 public OFVersion getVersion() {
69 return OFVersion.OF_13;
70 }
71
72
73
74 // no data members - do not support builder
75 public OFInstructionBsnDisableSrcMacCheck.Builder createBuilder() {
76 throw new UnsupportedOperationException("OFInstructionBsnDisableSrcMacCheckVer13 has no mutable properties -- builder unneeded");
77 }
78
79
80 final static Reader READER = new Reader();
81 static class Reader implements OFMessageReader<OFInstructionBsnDisableSrcMacCheck> {
82 @Override
83 public OFInstructionBsnDisableSrcMacCheck readFrom(ChannelBuffer bb) throws OFParseError {
84 int start = bb.readerIndex();
85 // fixed value property type == 65535
86 short type = bb.readShort();
87 if(type != (short) 0xffff)
88 throw new OFParseError("Wrong type: Expected=OFInstructionType.EXPERIMENTER(65535), got="+type);
89 int length = U16.f(bb.readShort());
90 if(length != 16)
91 throw new OFParseError("Wrong length: Expected=16(16), got="+length);
92 if(bb.readableBytes() + (bb.readerIndex() - start) < length) {
93 // Buffer does not have all data yet
94 bb.readerIndex(start);
95 return null;
96 }
97 if(logger.isTraceEnabled())
98 logger.trace("readFrom - length={}", length);
99 // fixed value property experimenter == 0x5c16c7L
100 int experimenter = bb.readInt();
101 if(experimenter != 0x5c16c7)
102 throw new OFParseError("Wrong experimenter: Expected=0x5c16c7L(0x5c16c7L), got="+experimenter);
103 // fixed value property subtype == 0x0L
104 int subtype = bb.readInt();
105 if(subtype != 0x0)
106 throw new OFParseError("Wrong subtype: Expected=0x0L(0x0L), got="+subtype);
107 // pad: 4 bytes
108 bb.skipBytes(4);
109
110 if(logger.isTraceEnabled())
111 logger.trace("readFrom - returning shared instance={}", INSTANCE);
112 return INSTANCE;
113 }
114 }
115
116 public void putTo(PrimitiveSink sink) {
117 FUNNEL.funnel(this, sink);
118 }
119
120 final static OFInstructionBsnDisableSrcMacCheckVer13Funnel FUNNEL = new OFInstructionBsnDisableSrcMacCheckVer13Funnel();
121 static class OFInstructionBsnDisableSrcMacCheckVer13Funnel implements Funnel<OFInstructionBsnDisableSrcMacCheckVer13> {
122 private static final long serialVersionUID = 1L;
123 @Override
124 public void funnel(OFInstructionBsnDisableSrcMacCheckVer13 message, PrimitiveSink sink) {
125 // fixed value property type = 65535
126 sink.putShort((short) 0xffff);
127 // fixed value property length = 16
128 sink.putShort((short) 0x10);
129 // fixed value property experimenter = 0x5c16c7L
130 sink.putInt(0x5c16c7);
131 // fixed value property subtype = 0x0L
132 sink.putInt(0x0);
133 // skip pad (4 bytes)
134 }
135 }
136
137
138 public void writeTo(ChannelBuffer bb) {
139 WRITER.write(bb, this);
140 }
141
142 final static Writer WRITER = new Writer();
143 static class Writer implements OFMessageWriter<OFInstructionBsnDisableSrcMacCheckVer13> {
144 @Override
145 public void write(ChannelBuffer bb, OFInstructionBsnDisableSrcMacCheckVer13 message) {
146 // fixed value property type = 65535
147 bb.writeShort((short) 0xffff);
148 // fixed value property length = 16
149 bb.writeShort((short) 0x10);
150 // fixed value property experimenter = 0x5c16c7L
151 bb.writeInt(0x5c16c7);
152 // fixed value property subtype = 0x0L
153 bb.writeInt(0x0);
154 // pad: 4 bytes
155 bb.writeZero(4);
156
157
158 }
159 }
160
161 @Override
162 public String toString() {
163 StringBuilder b = new StringBuilder("OFInstructionBsnDisableSrcMacCheckVer13(");
164 b.append(")");
165 return b.toString();
166 }
167
168 @Override
169 public boolean equals(Object obj) {
170 if (this == obj)
171 return true;
172 if (obj == null)
173 return false;
174 if (getClass() != obj.getClass())
175 return false;
176
177 return true;
178 }
179
180 @Override
181 public int hashCode() {
182 int result = 1;
183
184 return result;
185 }
186
187}