blob: c37a7bab8cfcccf7dd4d957314e59d5a4e97d96f [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 OFInstructionIdClearActionsVer13 implements OFInstructionIdClearActions {
33 private static final Logger logger = LoggerFactory.getLogger(OFInstructionIdClearActionsVer13.class);
34 // version: 1.3
35 final static byte WIRE_VERSION = 4;
36 final static int LENGTH = 4;
37
38
39 // OF message fields
40//
41 // Immutable default instance
42 final static OFInstructionIdClearActionsVer13 DEFAULT = new OFInstructionIdClearActionsVer13(
43
44 );
45
46 final static OFInstructionIdClearActionsVer13 INSTANCE = new OFInstructionIdClearActionsVer13();
47 // private empty constructor - use shared instance!
48 private OFInstructionIdClearActionsVer13() {
49 }
50
51 // Accessors for OF message fields
52 @Override
53 public OFInstructionType getType() {
54 return OFInstructionType.CLEAR_ACTIONS;
55 }
56
57 @Override
58 public OFVersion getVersion() {
59 return OFVersion.OF_13;
60 }
61
62
63
64 // no data members - do not support builder
65 public OFInstructionIdClearActions.Builder createBuilder() {
66 throw new UnsupportedOperationException("OFInstructionIdClearActionsVer13 has no mutable properties -- builder unneeded");
67 }
68
69
70 final static Reader READER = new Reader();
71 static class Reader implements OFMessageReader<OFInstructionIdClearActions> {
72 @Override
73 public OFInstructionIdClearActions readFrom(ChannelBuffer bb) throws OFParseError {
74 int start = bb.readerIndex();
75 // fixed value property type == 5
76 short type = bb.readShort();
77 if(type != (short) 0x5)
78 throw new OFParseError("Wrong type: Expected=OFInstructionType.CLEAR_ACTIONS(5), got="+type);
79 int length = U16.f(bb.readShort());
80 if(length != 4)
81 throw new OFParseError("Wrong length: Expected=4(4), got="+length);
82 if(bb.readableBytes() + (bb.readerIndex() - start) < length) {
83 // Buffer does not have all data yet
84 bb.readerIndex(start);
85 return null;
86 }
87 if(logger.isTraceEnabled())
88 logger.trace("readFrom - length={}", length);
89
90 if(logger.isTraceEnabled())
91 logger.trace("readFrom - returning shared instance={}", INSTANCE);
92 return INSTANCE;
93 }
94 }
95
96 public void putTo(PrimitiveSink sink) {
97 FUNNEL.funnel(this, sink);
98 }
99
100 final static OFInstructionIdClearActionsVer13Funnel FUNNEL = new OFInstructionIdClearActionsVer13Funnel();
101 static class OFInstructionIdClearActionsVer13Funnel implements Funnel<OFInstructionIdClearActionsVer13> {
102 private static final long serialVersionUID = 1L;
103 @Override
104 public void funnel(OFInstructionIdClearActionsVer13 message, PrimitiveSink sink) {
105 // fixed value property type = 5
106 sink.putShort((short) 0x5);
107 // fixed value property length = 4
108 sink.putShort((short) 0x4);
109 }
110 }
111
112
113 public void writeTo(ChannelBuffer bb) {
114 WRITER.write(bb, this);
115 }
116
117 final static Writer WRITER = new Writer();
118 static class Writer implements OFMessageWriter<OFInstructionIdClearActionsVer13> {
119 @Override
120 public void write(ChannelBuffer bb, OFInstructionIdClearActionsVer13 message) {
121 // fixed value property type = 5
122 bb.writeShort((short) 0x5);
123 // fixed value property length = 4
124 bb.writeShort((short) 0x4);
125
126
127 }
128 }
129
130 @Override
131 public String toString() {
132 StringBuilder b = new StringBuilder("OFInstructionIdClearActionsVer13(");
133 b.append(")");
134 return b.toString();
135 }
136
137 @Override
138 public boolean equals(Object obj) {
139 if (this == obj)
140 return true;
141 if (obj == null)
142 return false;
143 if (getClass() != obj.getClass())
144 return false;
145
146 return true;
147 }
148
149 @Override
150 public int hashCode() {
151 int result = 1;
152
153 return result;
154 }
155
156}