blob: a5a6ad5fa22cf06edbb5901f05817738755525cf [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.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.slf4j.Logger;
27import org.slf4j.LoggerFactory;
28import java.util.Set;
29import org.jboss.netty.buffer.ChannelBuffer;
30import com.google.common.hash.PrimitiveSink;
31import com.google.common.hash.Funnel;
32
33class OFTableStatsEntryVer12 implements OFTableStatsEntry {
34 private static final Logger logger = LoggerFactory.getLogger(OFTableStatsEntryVer12.class);
35 // version: 1.2
36 final static byte WIRE_VERSION = 3;
37 final static int LENGTH = 128;
38
39 private final static TableId DEFAULT_TABLE_ID = TableId.ALL;
40 private final static String DEFAULT_NAME = "";
41 private final static int DEFAULT_WILDCARDS = 0x0;
42 private final static long DEFAULT_WRITE_ACTIONS = 0x0L;
43 private final static long DEFAULT_APPLY_ACTIONS = 0x0L;
44 private final static U64 DEFAULT_WRITE_SETFIELDS = U64.ZERO;
45 private final static U64 DEFAULT_APPLY_SETFIELDS = U64.ZERO;
46 private final static U64 DEFAULT_METADATA_MATCH = U64.ZERO;
47 private final static U64 DEFAULT_METADATA_WRITE = U64.ZERO;
48 private final static long DEFAULT_INSTRUCTIONS = 0x0L;
49 private final static long DEFAULT_CONFIG = 0x0L;
50 private final static long DEFAULT_MAX_ENTRIES = 0x0L;
51 private final static long DEFAULT_ACTIVE_COUNT = 0x0L;
52 private final static U64 DEFAULT_LOOKUP_COUNT = U64.ZERO;
53 private final static U64 DEFAULT_MATCHED_COUNT = U64.ZERO;
54
55 // OF message fields
56 private final TableId tableId;
57 private final String name;
58 private final OFMatchBmap match;
59 private final int wildcards;
60 private final long writeActions;
61 private final long applyActions;
62 private final U64 writeSetfields;
63 private final U64 applySetfields;
64 private final U64 metadataMatch;
65 private final U64 metadataWrite;
66 private final long instructions;
67 private final long config;
68 private final long maxEntries;
69 private final long activeCount;
70 private final U64 lookupCount;
71 private final U64 matchedCount;
72//
73
74 // package private constructor - used by readers, builders, and factory
75 OFTableStatsEntryVer12(TableId tableId, String name, OFMatchBmap match, int wildcards, long writeActions, long applyActions, U64 writeSetfields, U64 applySetfields, U64 metadataMatch, U64 metadataWrite, long instructions, long config, long maxEntries, long activeCount, U64 lookupCount, U64 matchedCount) {
76 this.tableId = tableId;
77 this.name = name;
78 this.match = match;
79 this.wildcards = wildcards;
80 this.writeActions = writeActions;
81 this.applyActions = applyActions;
82 this.writeSetfields = writeSetfields;
83 this.applySetfields = applySetfields;
84 this.metadataMatch = metadataMatch;
85 this.metadataWrite = metadataWrite;
86 this.instructions = instructions;
87 this.config = config;
88 this.maxEntries = maxEntries;
89 this.activeCount = activeCount;
90 this.lookupCount = lookupCount;
91 this.matchedCount = matchedCount;
92 }
93
94 // Accessors for OF message fields
95 @Override
96 public TableId getTableId() {
97 return tableId;
98 }
99
100 @Override
101 public String getName() {
102 return name;
103 }
104
105 @Override
106 public OFMatchBmap getMatch() {
107 return match;
108 }
109
110 @Override
111 public int getWildcards() {
112 return wildcards;
113 }
114
115 @Override
116 public long getWriteActions() {
117 return writeActions;
118 }
119
120 @Override
121 public long getApplyActions() {
122 return applyActions;
123 }
124
125 @Override
126 public U64 getWriteSetfields() {
127 return writeSetfields;
128 }
129
130 @Override
131 public U64 getApplySetfields() {
132 return applySetfields;
133 }
134
135 @Override
136 public U64 getMetadataMatch() {
137 return metadataMatch;
138 }
139
140 @Override
141 public U64 getMetadataWrite() {
142 return metadataWrite;
143 }
144
145 @Override
146 public long getInstructions() {
147 return instructions;
148 }
149
150 @Override
151 public long getConfig() {
152 return config;
153 }
154
155 @Override
156 public long getMaxEntries() {
157 return maxEntries;
158 }
159
160 @Override
161 public long getActiveCount() {
162 return activeCount;
163 }
164
165 @Override
166 public U64 getLookupCount() {
167 return lookupCount;
168 }
169
170 @Override
171 public U64 getMatchedCount() {
172 return matchedCount;
173 }
174
175 @Override
176 public OFVersion getVersion() {
177 return OFVersion.OF_12;
178 }
179
180
181
182 public OFTableStatsEntry.Builder createBuilder() {
183 return new BuilderWithParent(this);
184 }
185
186 static class BuilderWithParent implements OFTableStatsEntry.Builder {
187 final OFTableStatsEntryVer12 parentMessage;
188
189 // OF message fields
190 private boolean tableIdSet;
191 private TableId tableId;
192 private boolean nameSet;
193 private String name;
194 private boolean matchSet;
195 private OFMatchBmap match;
196 private boolean wildcardsSet;
197 private int wildcards;
198 private boolean writeActionsSet;
199 private long writeActions;
200 private boolean applyActionsSet;
201 private long applyActions;
202 private boolean writeSetfieldsSet;
203 private U64 writeSetfields;
204 private boolean applySetfieldsSet;
205 private U64 applySetfields;
206 private boolean metadataMatchSet;
207 private U64 metadataMatch;
208 private boolean metadataWriteSet;
209 private U64 metadataWrite;
210 private boolean instructionsSet;
211 private long instructions;
212 private boolean configSet;
213 private long config;
214 private boolean maxEntriesSet;
215 private long maxEntries;
216 private boolean activeCountSet;
217 private long activeCount;
218 private boolean lookupCountSet;
219 private U64 lookupCount;
220 private boolean matchedCountSet;
221 private U64 matchedCount;
222
223 BuilderWithParent(OFTableStatsEntryVer12 parentMessage) {
224 this.parentMessage = parentMessage;
225 }
226
227 @Override
228 public TableId getTableId() {
229 return tableId;
230 }
231
232 @Override
233 public OFTableStatsEntry.Builder setTableId(TableId tableId) {
234 this.tableId = tableId;
235 this.tableIdSet = true;
236 return this;
237 }
238 @Override
239 public String getName() {
240 return name;
241 }
242
243 @Override
244 public OFTableStatsEntry.Builder setName(String name) {
245 this.name = name;
246 this.nameSet = true;
247 return this;
248 }
249 @Override
250 public OFMatchBmap getMatch() {
251 return match;
252 }
253
254 @Override
255 public OFTableStatsEntry.Builder setMatch(OFMatchBmap match) {
256 this.match = match;
257 this.matchSet = true;
258 return this;
259 }
260 @Override
261 public int getWildcards() {
262 return wildcards;
263 }
264
265 @Override
266 public OFTableStatsEntry.Builder setWildcards(int wildcards) {
267 this.wildcards = wildcards;
268 this.wildcardsSet = true;
269 return this;
270 }
271 @Override
272 public long getWriteActions() {
273 return writeActions;
274 }
275
276 @Override
277 public OFTableStatsEntry.Builder setWriteActions(long writeActions) {
278 this.writeActions = writeActions;
279 this.writeActionsSet = true;
280 return this;
281 }
282 @Override
283 public long getApplyActions() {
284 return applyActions;
285 }
286
287 @Override
288 public OFTableStatsEntry.Builder setApplyActions(long applyActions) {
289 this.applyActions = applyActions;
290 this.applyActionsSet = true;
291 return this;
292 }
293 @Override
294 public U64 getWriteSetfields() {
295 return writeSetfields;
296 }
297
298 @Override
299 public OFTableStatsEntry.Builder setWriteSetfields(U64 writeSetfields) {
300 this.writeSetfields = writeSetfields;
301 this.writeSetfieldsSet = true;
302 return this;
303 }
304 @Override
305 public U64 getApplySetfields() {
306 return applySetfields;
307 }
308
309 @Override
310 public OFTableStatsEntry.Builder setApplySetfields(U64 applySetfields) {
311 this.applySetfields = applySetfields;
312 this.applySetfieldsSet = true;
313 return this;
314 }
315 @Override
316 public U64 getMetadataMatch() {
317 return metadataMatch;
318 }
319
320 @Override
321 public OFTableStatsEntry.Builder setMetadataMatch(U64 metadataMatch) {
322 this.metadataMatch = metadataMatch;
323 this.metadataMatchSet = true;
324 return this;
325 }
326 @Override
327 public U64 getMetadataWrite() {
328 return metadataWrite;
329 }
330
331 @Override
332 public OFTableStatsEntry.Builder setMetadataWrite(U64 metadataWrite) {
333 this.metadataWrite = metadataWrite;
334 this.metadataWriteSet = true;
335 return this;
336 }
337 @Override
338 public long getInstructions() {
339 return instructions;
340 }
341
342 @Override
343 public OFTableStatsEntry.Builder setInstructions(long instructions) {
344 this.instructions = instructions;
345 this.instructionsSet = true;
346 return this;
347 }
348 @Override
349 public long getConfig() {
350 return config;
351 }
352
353 @Override
354 public OFTableStatsEntry.Builder setConfig(long config) {
355 this.config = config;
356 this.configSet = true;
357 return this;
358 }
359 @Override
360 public long getMaxEntries() {
361 return maxEntries;
362 }
363
364 @Override
365 public OFTableStatsEntry.Builder setMaxEntries(long maxEntries) {
366 this.maxEntries = maxEntries;
367 this.maxEntriesSet = true;
368 return this;
369 }
370 @Override
371 public long getActiveCount() {
372 return activeCount;
373 }
374
375 @Override
376 public OFTableStatsEntry.Builder setActiveCount(long activeCount) {
377 this.activeCount = activeCount;
378 this.activeCountSet = true;
379 return this;
380 }
381 @Override
382 public U64 getLookupCount() {
383 return lookupCount;
384 }
385
386 @Override
387 public OFTableStatsEntry.Builder setLookupCount(U64 lookupCount) {
388 this.lookupCount = lookupCount;
389 this.lookupCountSet = true;
390 return this;
391 }
392 @Override
393 public U64 getMatchedCount() {
394 return matchedCount;
395 }
396
397 @Override
398 public OFTableStatsEntry.Builder setMatchedCount(U64 matchedCount) {
399 this.matchedCount = matchedCount;
400 this.matchedCountSet = true;
401 return this;
402 }
403 @Override
404 public OFVersion getVersion() {
405 return OFVersion.OF_12;
406 }
407
408
409
410 @Override
411 public OFTableStatsEntry build() {
412 TableId tableId = this.tableIdSet ? this.tableId : parentMessage.tableId;
413 if(tableId == null)
414 throw new NullPointerException("Property tableId must not be null");
415 String name = this.nameSet ? this.name : parentMessage.name;
416 if(name == null)
417 throw new NullPointerException("Property name must not be null");
418 OFMatchBmap match = this.matchSet ? this.match : parentMessage.match;
419 if(match == null)
420 throw new NullPointerException("Property match must not be null");
421 int wildcards = this.wildcardsSet ? this.wildcards : parentMessage.wildcards;
422 long writeActions = this.writeActionsSet ? this.writeActions : parentMessage.writeActions;
423 long applyActions = this.applyActionsSet ? this.applyActions : parentMessage.applyActions;
424 U64 writeSetfields = this.writeSetfieldsSet ? this.writeSetfields : parentMessage.writeSetfields;
425 if(writeSetfields == null)
426 throw new NullPointerException("Property writeSetfields must not be null");
427 U64 applySetfields = this.applySetfieldsSet ? this.applySetfields : parentMessage.applySetfields;
428 if(applySetfields == null)
429 throw new NullPointerException("Property applySetfields must not be null");
430 U64 metadataMatch = this.metadataMatchSet ? this.metadataMatch : parentMessage.metadataMatch;
431 if(metadataMatch == null)
432 throw new NullPointerException("Property metadataMatch must not be null");
433 U64 metadataWrite = this.metadataWriteSet ? this.metadataWrite : parentMessage.metadataWrite;
434 if(metadataWrite == null)
435 throw new NullPointerException("Property metadataWrite must not be null");
436 long instructions = this.instructionsSet ? this.instructions : parentMessage.instructions;
437 long config = this.configSet ? this.config : parentMessage.config;
438 long maxEntries = this.maxEntriesSet ? this.maxEntries : parentMessage.maxEntries;
439 long activeCount = this.activeCountSet ? this.activeCount : parentMessage.activeCount;
440 U64 lookupCount = this.lookupCountSet ? this.lookupCount : parentMessage.lookupCount;
441 if(lookupCount == null)
442 throw new NullPointerException("Property lookupCount must not be null");
443 U64 matchedCount = this.matchedCountSet ? this.matchedCount : parentMessage.matchedCount;
444 if(matchedCount == null)
445 throw new NullPointerException("Property matchedCount must not be null");
446
447 //
448 return new OFTableStatsEntryVer12(
449 tableId,
450 name,
451 match,
452 wildcards,
453 writeActions,
454 applyActions,
455 writeSetfields,
456 applySetfields,
457 metadataMatch,
458 metadataWrite,
459 instructions,
460 config,
461 maxEntries,
462 activeCount,
463 lookupCount,
464 matchedCount
465 );
466 }
467
468 }
469
470 static class Builder implements OFTableStatsEntry.Builder {
471 // OF message fields
472 private boolean tableIdSet;
473 private TableId tableId;
474 private boolean nameSet;
475 private String name;
476 private boolean matchSet;
477 private OFMatchBmap match;
478 private boolean wildcardsSet;
479 private int wildcards;
480 private boolean writeActionsSet;
481 private long writeActions;
482 private boolean applyActionsSet;
483 private long applyActions;
484 private boolean writeSetfieldsSet;
485 private U64 writeSetfields;
486 private boolean applySetfieldsSet;
487 private U64 applySetfields;
488 private boolean metadataMatchSet;
489 private U64 metadataMatch;
490 private boolean metadataWriteSet;
491 private U64 metadataWrite;
492 private boolean instructionsSet;
493 private long instructions;
494 private boolean configSet;
495 private long config;
496 private boolean maxEntriesSet;
497 private long maxEntries;
498 private boolean activeCountSet;
499 private long activeCount;
500 private boolean lookupCountSet;
501 private U64 lookupCount;
502 private boolean matchedCountSet;
503 private U64 matchedCount;
504
505 @Override
506 public TableId getTableId() {
507 return tableId;
508 }
509
510 @Override
511 public OFTableStatsEntry.Builder setTableId(TableId tableId) {
512 this.tableId = tableId;
513 this.tableIdSet = true;
514 return this;
515 }
516 @Override
517 public String getName() {
518 return name;
519 }
520
521 @Override
522 public OFTableStatsEntry.Builder setName(String name) {
523 this.name = name;
524 this.nameSet = true;
525 return this;
526 }
527 @Override
528 public OFMatchBmap getMatch() {
529 return match;
530 }
531
532 @Override
533 public OFTableStatsEntry.Builder setMatch(OFMatchBmap match) {
534 this.match = match;
535 this.matchSet = true;
536 return this;
537 }
538 @Override
539 public int getWildcards() {
540 return wildcards;
541 }
542
543 @Override
544 public OFTableStatsEntry.Builder setWildcards(int wildcards) {
545 this.wildcards = wildcards;
546 this.wildcardsSet = true;
547 return this;
548 }
549 @Override
550 public long getWriteActions() {
551 return writeActions;
552 }
553
554 @Override
555 public OFTableStatsEntry.Builder setWriteActions(long writeActions) {
556 this.writeActions = writeActions;
557 this.writeActionsSet = true;
558 return this;
559 }
560 @Override
561 public long getApplyActions() {
562 return applyActions;
563 }
564
565 @Override
566 public OFTableStatsEntry.Builder setApplyActions(long applyActions) {
567 this.applyActions = applyActions;
568 this.applyActionsSet = true;
569 return this;
570 }
571 @Override
572 public U64 getWriteSetfields() {
573 return writeSetfields;
574 }
575
576 @Override
577 public OFTableStatsEntry.Builder setWriteSetfields(U64 writeSetfields) {
578 this.writeSetfields = writeSetfields;
579 this.writeSetfieldsSet = true;
580 return this;
581 }
582 @Override
583 public U64 getApplySetfields() {
584 return applySetfields;
585 }
586
587 @Override
588 public OFTableStatsEntry.Builder setApplySetfields(U64 applySetfields) {
589 this.applySetfields = applySetfields;
590 this.applySetfieldsSet = true;
591 return this;
592 }
593 @Override
594 public U64 getMetadataMatch() {
595 return metadataMatch;
596 }
597
598 @Override
599 public OFTableStatsEntry.Builder setMetadataMatch(U64 metadataMatch) {
600 this.metadataMatch = metadataMatch;
601 this.metadataMatchSet = true;
602 return this;
603 }
604 @Override
605 public U64 getMetadataWrite() {
606 return metadataWrite;
607 }
608
609 @Override
610 public OFTableStatsEntry.Builder setMetadataWrite(U64 metadataWrite) {
611 this.metadataWrite = metadataWrite;
612 this.metadataWriteSet = true;
613 return this;
614 }
615 @Override
616 public long getInstructions() {
617 return instructions;
618 }
619
620 @Override
621 public OFTableStatsEntry.Builder setInstructions(long instructions) {
622 this.instructions = instructions;
623 this.instructionsSet = true;
624 return this;
625 }
626 @Override
627 public long getConfig() {
628 return config;
629 }
630
631 @Override
632 public OFTableStatsEntry.Builder setConfig(long config) {
633 this.config = config;
634 this.configSet = true;
635 return this;
636 }
637 @Override
638 public long getMaxEntries() {
639 return maxEntries;
640 }
641
642 @Override
643 public OFTableStatsEntry.Builder setMaxEntries(long maxEntries) {
644 this.maxEntries = maxEntries;
645 this.maxEntriesSet = true;
646 return this;
647 }
648 @Override
649 public long getActiveCount() {
650 return activeCount;
651 }
652
653 @Override
654 public OFTableStatsEntry.Builder setActiveCount(long activeCount) {
655 this.activeCount = activeCount;
656 this.activeCountSet = true;
657 return this;
658 }
659 @Override
660 public U64 getLookupCount() {
661 return lookupCount;
662 }
663
664 @Override
665 public OFTableStatsEntry.Builder setLookupCount(U64 lookupCount) {
666 this.lookupCount = lookupCount;
667 this.lookupCountSet = true;
668 return this;
669 }
670 @Override
671 public U64 getMatchedCount() {
672 return matchedCount;
673 }
674
675 @Override
676 public OFTableStatsEntry.Builder setMatchedCount(U64 matchedCount) {
677 this.matchedCount = matchedCount;
678 this.matchedCountSet = true;
679 return this;
680 }
681 @Override
682 public OFVersion getVersion() {
683 return OFVersion.OF_12;
684 }
685
686//
687 @Override
688 public OFTableStatsEntry build() {
689 TableId tableId = this.tableIdSet ? this.tableId : DEFAULT_TABLE_ID;
690 if(tableId == null)
691 throw new NullPointerException("Property tableId must not be null");
692 String name = this.nameSet ? this.name : DEFAULT_NAME;
693 if(name == null)
694 throw new NullPointerException("Property name must not be null");
695 if(!this.matchSet)
696 throw new IllegalStateException("Property match doesn't have default value -- must be set");
697 if(match == null)
698 throw new NullPointerException("Property match must not be null");
699 int wildcards = this.wildcardsSet ? this.wildcards : DEFAULT_WILDCARDS;
700 long writeActions = this.writeActionsSet ? this.writeActions : DEFAULT_WRITE_ACTIONS;
701 long applyActions = this.applyActionsSet ? this.applyActions : DEFAULT_APPLY_ACTIONS;
702 U64 writeSetfields = this.writeSetfieldsSet ? this.writeSetfields : DEFAULT_WRITE_SETFIELDS;
703 if(writeSetfields == null)
704 throw new NullPointerException("Property writeSetfields must not be null");
705 U64 applySetfields = this.applySetfieldsSet ? this.applySetfields : DEFAULT_APPLY_SETFIELDS;
706 if(applySetfields == null)
707 throw new NullPointerException("Property applySetfields must not be null");
708 U64 metadataMatch = this.metadataMatchSet ? this.metadataMatch : DEFAULT_METADATA_MATCH;
709 if(metadataMatch == null)
710 throw new NullPointerException("Property metadataMatch must not be null");
711 U64 metadataWrite = this.metadataWriteSet ? this.metadataWrite : DEFAULT_METADATA_WRITE;
712 if(metadataWrite == null)
713 throw new NullPointerException("Property metadataWrite must not be null");
714 long instructions = this.instructionsSet ? this.instructions : DEFAULT_INSTRUCTIONS;
715 long config = this.configSet ? this.config : DEFAULT_CONFIG;
716 long maxEntries = this.maxEntriesSet ? this.maxEntries : DEFAULT_MAX_ENTRIES;
717 long activeCount = this.activeCountSet ? this.activeCount : DEFAULT_ACTIVE_COUNT;
718 U64 lookupCount = this.lookupCountSet ? this.lookupCount : DEFAULT_LOOKUP_COUNT;
719 if(lookupCount == null)
720 throw new NullPointerException("Property lookupCount must not be null");
721 U64 matchedCount = this.matchedCountSet ? this.matchedCount : DEFAULT_MATCHED_COUNT;
722 if(matchedCount == null)
723 throw new NullPointerException("Property matchedCount must not be null");
724
725
726 return new OFTableStatsEntryVer12(
727 tableId,
728 name,
729 match,
730 wildcards,
731 writeActions,
732 applyActions,
733 writeSetfields,
734 applySetfields,
735 metadataMatch,
736 metadataWrite,
737 instructions,
738 config,
739 maxEntries,
740 activeCount,
741 lookupCount,
742 matchedCount
743 );
744 }
745
746 }
747
748
749 final static Reader READER = new Reader();
750 static class Reader implements OFMessageReader<OFTableStatsEntry> {
751 @Override
752 public OFTableStatsEntry readFrom(ChannelBuffer bb) throws OFParseError {
753 TableId tableId = TableId.readByte(bb);
754 // pad: 7 bytes
755 bb.skipBytes(7);
756 String name = ChannelUtils.readFixedLengthString(bb, 32);
757 OFMatchBmap match = ChannelUtilsVer12.readOFMatchBmap(bb);
758 int wildcards = bb.readInt();
759 long writeActions = U32.f(bb.readInt());
760 long applyActions = U32.f(bb.readInt());
761 U64 writeSetfields = U64.ofRaw(bb.readLong());
762 U64 applySetfields = U64.ofRaw(bb.readLong());
763 U64 metadataMatch = U64.ofRaw(bb.readLong());
764 U64 metadataWrite = U64.ofRaw(bb.readLong());
765 long instructions = U32.f(bb.readInt());
766 long config = U32.f(bb.readInt());
767 long maxEntries = U32.f(bb.readInt());
768 long activeCount = U32.f(bb.readInt());
769 U64 lookupCount = U64.ofRaw(bb.readLong());
770 U64 matchedCount = U64.ofRaw(bb.readLong());
771
772 OFTableStatsEntryVer12 tableStatsEntryVer12 = new OFTableStatsEntryVer12(
773 tableId,
774 name,
775 match,
776 wildcards,
777 writeActions,
778 applyActions,
779 writeSetfields,
780 applySetfields,
781 metadataMatch,
782 metadataWrite,
783 instructions,
784 config,
785 maxEntries,
786 activeCount,
787 lookupCount,
788 matchedCount
789 );
790 if(logger.isTraceEnabled())
791 logger.trace("readFrom - read={}", tableStatsEntryVer12);
792 return tableStatsEntryVer12;
793 }
794 }
795
796 public void putTo(PrimitiveSink sink) {
797 FUNNEL.funnel(this, sink);
798 }
799
800 final static OFTableStatsEntryVer12Funnel FUNNEL = new OFTableStatsEntryVer12Funnel();
801 static class OFTableStatsEntryVer12Funnel implements Funnel<OFTableStatsEntryVer12> {
802 private static final long serialVersionUID = 1L;
803 @Override
804 public void funnel(OFTableStatsEntryVer12 message, PrimitiveSink sink) {
805 message.tableId.putTo(sink);
806 // skip pad (7 bytes)
807 sink.putUnencodedChars(message.name);
808 message.match.putTo(sink);
809 sink.putInt(message.wildcards);
810 sink.putLong(message.writeActions);
811 sink.putLong(message.applyActions);
812 message.writeSetfields.putTo(sink);
813 message.applySetfields.putTo(sink);
814 message.metadataMatch.putTo(sink);
815 message.metadataWrite.putTo(sink);
816 sink.putLong(message.instructions);
817 sink.putLong(message.config);
818 sink.putLong(message.maxEntries);
819 sink.putLong(message.activeCount);
820 message.lookupCount.putTo(sink);
821 message.matchedCount.putTo(sink);
822 }
823 }
824
825
826 public void writeTo(ChannelBuffer bb) {
827 WRITER.write(bb, this);
828 }
829
830 final static Writer WRITER = new Writer();
831 static class Writer implements OFMessageWriter<OFTableStatsEntryVer12> {
832 @Override
833 public void write(ChannelBuffer bb, OFTableStatsEntryVer12 message) {
834 message.tableId.writeByte(bb);
835 // pad: 7 bytes
836 bb.writeZero(7);
837 ChannelUtils.writeFixedLengthString(bb, message.name, 32);
838 ChannelUtilsVer12.writeOFMatchBmap(bb, message.match);
839 bb.writeInt(message.wildcards);
840 bb.writeInt(U32.t(message.writeActions));
841 bb.writeInt(U32.t(message.applyActions));
842 bb.writeLong(message.writeSetfields.getValue());
843 bb.writeLong(message.applySetfields.getValue());
844 bb.writeLong(message.metadataMatch.getValue());
845 bb.writeLong(message.metadataWrite.getValue());
846 bb.writeInt(U32.t(message.instructions));
847 bb.writeInt(U32.t(message.config));
848 bb.writeInt(U32.t(message.maxEntries));
849 bb.writeInt(U32.t(message.activeCount));
850 bb.writeLong(message.lookupCount.getValue());
851 bb.writeLong(message.matchedCount.getValue());
852
853
854 }
855 }
856
857 @Override
858 public String toString() {
859 StringBuilder b = new StringBuilder("OFTableStatsEntryVer12(");
860 b.append("tableId=").append(tableId);
861 b.append(", ");
862 b.append("name=").append(name);
863 b.append(", ");
864 b.append("match=").append(match);
865 b.append(", ");
866 b.append("wildcards=").append(wildcards);
867 b.append(", ");
868 b.append("writeActions=").append(writeActions);
869 b.append(", ");
870 b.append("applyActions=").append(applyActions);
871 b.append(", ");
872 b.append("writeSetfields=").append(writeSetfields);
873 b.append(", ");
874 b.append("applySetfields=").append(applySetfields);
875 b.append(", ");
876 b.append("metadataMatch=").append(metadataMatch);
877 b.append(", ");
878 b.append("metadataWrite=").append(metadataWrite);
879 b.append(", ");
880 b.append("instructions=").append(instructions);
881 b.append(", ");
882 b.append("config=").append(config);
883 b.append(", ");
884 b.append("maxEntries=").append(maxEntries);
885 b.append(", ");
886 b.append("activeCount=").append(activeCount);
887 b.append(", ");
888 b.append("lookupCount=").append(lookupCount);
889 b.append(", ");
890 b.append("matchedCount=").append(matchedCount);
891 b.append(")");
892 return b.toString();
893 }
894
895 @Override
896 public boolean equals(Object obj) {
897 if (this == obj)
898 return true;
899 if (obj == null)
900 return false;
901 if (getClass() != obj.getClass())
902 return false;
903 OFTableStatsEntryVer12 other = (OFTableStatsEntryVer12) obj;
904
905 if (tableId == null) {
906 if (other.tableId != null)
907 return false;
908 } else if (!tableId.equals(other.tableId))
909 return false;
910 if (name == null) {
911 if (other.name != null)
912 return false;
913 } else if (!name.equals(other.name))
914 return false;
915 if (match == null) {
916 if (other.match != null)
917 return false;
918 } else if (!match.equals(other.match))
919 return false;
920 if( wildcards != other.wildcards)
921 return false;
922 if( writeActions != other.writeActions)
923 return false;
924 if( applyActions != other.applyActions)
925 return false;
926 if (writeSetfields == null) {
927 if (other.writeSetfields != null)
928 return false;
929 } else if (!writeSetfields.equals(other.writeSetfields))
930 return false;
931 if (applySetfields == null) {
932 if (other.applySetfields != null)
933 return false;
934 } else if (!applySetfields.equals(other.applySetfields))
935 return false;
936 if (metadataMatch == null) {
937 if (other.metadataMatch != null)
938 return false;
939 } else if (!metadataMatch.equals(other.metadataMatch))
940 return false;
941 if (metadataWrite == null) {
942 if (other.metadataWrite != null)
943 return false;
944 } else if (!metadataWrite.equals(other.metadataWrite))
945 return false;
946 if( instructions != other.instructions)
947 return false;
948 if( config != other.config)
949 return false;
950 if( maxEntries != other.maxEntries)
951 return false;
952 if( activeCount != other.activeCount)
953 return false;
954 if (lookupCount == null) {
955 if (other.lookupCount != null)
956 return false;
957 } else if (!lookupCount.equals(other.lookupCount))
958 return false;
959 if (matchedCount == null) {
960 if (other.matchedCount != null)
961 return false;
962 } else if (!matchedCount.equals(other.matchedCount))
963 return false;
964 return true;
965 }
966
967 @Override
968 public int hashCode() {
969 final int prime = 31;
970 int result = 1;
971
972 result = prime * result + ((tableId == null) ? 0 : tableId.hashCode());
973 result = prime * result + ((name == null) ? 0 : name.hashCode());
974 result = prime * result + ((match == null) ? 0 : match.hashCode());
975 result = prime * result + wildcards;
976 result = prime * (int) (writeActions ^ (writeActions >>> 32));
977 result = prime * (int) (applyActions ^ (applyActions >>> 32));
978 result = prime * result + ((writeSetfields == null) ? 0 : writeSetfields.hashCode());
979 result = prime * result + ((applySetfields == null) ? 0 : applySetfields.hashCode());
980 result = prime * result + ((metadataMatch == null) ? 0 : metadataMatch.hashCode());
981 result = prime * result + ((metadataWrite == null) ? 0 : metadataWrite.hashCode());
982 result = prime * (int) (instructions ^ (instructions >>> 32));
983 result = prime * (int) (config ^ (config >>> 32));
984 result = prime * (int) (maxEntries ^ (maxEntries >>> 32));
985 result = prime * (int) (activeCount ^ (activeCount >>> 32));
986 result = prime * result + ((lookupCount == null) ? 0 : lookupCount.hashCode());
987 result = prime * result + ((matchedCount == null) ? 0 : matchedCount.hashCode());
988 return result;
989 }
990
991}