blob: de531126953754b9d7f53d860115660ea32be553 [file] [log] [blame]
Rich Lanec2ee4b82013-04-24 17:12:38 -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.
Dan Talaycof6202252013-07-02 01:00:29 -07004# See the file LICENSE.pyloxi which should have been included in the source distribution
Rich Lanec2ee4b82013-04-24 17:12:38 -07005
6# Automatically generated by LOXI from template oxm.py
7# Do not modify
8
9import struct
10import const
11import util
12import loxi.generic_util
13import loxi
14
Rich Laned53156a2013-08-05 17:17:33 -070015def unpack(reader):
16 type_len, = reader.peek('!L')
17 if type_len in parsers:
18 return parsers[type_len](reader)
19 else:
20 raise loxi.ProtocolError("unknown OXM cls=%#x type=%#x masked=%d len=%d (%#x)" % \
21 ((type_len >> 16) & 0xffff, (type_len >> 9) & 0x7f, (type_len >> 8) & 1, type_len & 0xff, type_len))
22
Rich Lanec2ee4b82013-04-24 17:12:38 -070023def unpack_list(reader):
Rich Laned53156a2013-08-05 17:17:33 -070024 return loxi.generic_util.unpack_list(reader, unpack)
Rich Lanec2ee4b82013-04-24 17:12:38 -070025
26class OXM(object):
27 type_len = None # override in subclass
28 pass
29
30class arp_op(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -070031 type_len = 2147494402
Rich Lanec2ee4b82013-04-24 17:12:38 -070032
33 def __init__(self, value=None):
34 if value != None:
35 self.value = value
36 else:
37 self.value = 0
38
39 def pack(self):
40 packed = []
41 packed.append(struct.pack("!L", self.type_len))
42 packed.append(struct.pack("!H", self.value))
43 return ''.join(packed)
44
45 @staticmethod
46 def unpack(buf):
47 obj = arp_op()
48 if type(buf) == loxi.generic_util.OFReader:
49 reader = buf
50 else:
51 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -070052 _type_len = reader.read("!L")[0]
53 assert(_type_len == 2147494402)
54 obj.value = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -070055 return obj
56
57 def __eq__(self, other):
58 if type(self) != type(other): return False
59 if self.value != other.value: return False
60 return True
61
62 def __ne__(self, other):
63 return not self.__eq__(other)
64
65 def show(self):
66 import loxi.pp
67 return loxi.pp.pp(self)
68
69 def pretty_print(self, q):
70 q.text("arp_op {")
71 with q.group():
72 with q.indent(2):
73 q.breakable()
74 q.text("value = ");
75 q.text("%#x" % self.value)
76 q.breakable()
77 q.text('}')
78
79class arp_op_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -070080 type_len = 2147494660
Rich Lanec2ee4b82013-04-24 17:12:38 -070081
82 def __init__(self, value=None, value_mask=None):
83 if value != None:
84 self.value = value
85 else:
86 self.value = 0
87 if value_mask != None:
88 self.value_mask = value_mask
89 else:
90 self.value_mask = 0
91
92 def pack(self):
93 packed = []
94 packed.append(struct.pack("!L", self.type_len))
95 packed.append(struct.pack("!H", self.value))
96 packed.append(struct.pack("!H", self.value_mask))
97 return ''.join(packed)
98
99 @staticmethod
100 def unpack(buf):
101 obj = arp_op_masked()
102 if type(buf) == loxi.generic_util.OFReader:
103 reader = buf
104 else:
105 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -0700106 _type_len = reader.read("!L")[0]
107 assert(_type_len == 2147494660)
108 obj.value = reader.read("!H")[0]
109 obj.value_mask = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700110 return obj
111
112 def __eq__(self, other):
113 if type(self) != type(other): return False
114 if self.value != other.value: return False
115 if self.value_mask != other.value_mask: return False
116 return True
117
118 def __ne__(self, other):
119 return not self.__eq__(other)
120
121 def show(self):
122 import loxi.pp
123 return loxi.pp.pp(self)
124
125 def pretty_print(self, q):
126 q.text("arp_op_masked {")
127 with q.group():
128 with q.indent(2):
129 q.breakable()
130 q.text("value = ");
131 q.text("%#x" % self.value)
132 q.text(","); q.breakable()
133 q.text("value_mask = ");
134 q.text("%#x" % self.value_mask)
135 q.breakable()
136 q.text('}')
137
138class arp_sha(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -0700139 type_len = 2147495942
Rich Lanec2ee4b82013-04-24 17:12:38 -0700140
141 def __init__(self, value=None):
142 if value != None:
143 self.value = value
144 else:
145 self.value = [0,0,0,0,0,0]
146
147 def pack(self):
148 packed = []
149 packed.append(struct.pack("!L", self.type_len))
150 packed.append(struct.pack("!6B", *self.value))
151 return ''.join(packed)
152
153 @staticmethod
154 def unpack(buf):
155 obj = arp_sha()
156 if type(buf) == loxi.generic_util.OFReader:
157 reader = buf
158 else:
159 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -0700160 _type_len = reader.read("!L")[0]
161 assert(_type_len == 2147495942)
Rich Lanec2ee4b82013-04-24 17:12:38 -0700162 obj.value = list(reader.read('!6B'))
163 return obj
164
165 def __eq__(self, other):
166 if type(self) != type(other): return False
167 if self.value != other.value: return False
168 return True
169
170 def __ne__(self, other):
171 return not self.__eq__(other)
172
173 def show(self):
174 import loxi.pp
175 return loxi.pp.pp(self)
176
177 def pretty_print(self, q):
178 q.text("arp_sha {")
179 with q.group():
180 with q.indent(2):
181 q.breakable()
182 q.text("value = ");
183 q.text(util.pretty_mac(self.value))
184 q.breakable()
185 q.text('}')
186
187class arp_sha_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -0700188 type_len = 2147496204
Rich Lanec2ee4b82013-04-24 17:12:38 -0700189
190 def __init__(self, value=None, value_mask=None):
191 if value != None:
192 self.value = value
193 else:
194 self.value = [0,0,0,0,0,0]
195 if value_mask != None:
196 self.value_mask = value_mask
197 else:
198 self.value_mask = [0,0,0,0,0,0]
199
200 def pack(self):
201 packed = []
202 packed.append(struct.pack("!L", self.type_len))
203 packed.append(struct.pack("!6B", *self.value))
204 packed.append(struct.pack("!6B", *self.value_mask))
205 return ''.join(packed)
206
207 @staticmethod
208 def unpack(buf):
209 obj = arp_sha_masked()
210 if type(buf) == loxi.generic_util.OFReader:
211 reader = buf
212 else:
213 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -0700214 _type_len = reader.read("!L")[0]
215 assert(_type_len == 2147496204)
Rich Lanec2ee4b82013-04-24 17:12:38 -0700216 obj.value = list(reader.read('!6B'))
217 obj.value_mask = list(reader.read('!6B'))
218 return obj
219
220 def __eq__(self, other):
221 if type(self) != type(other): return False
222 if self.value != other.value: return False
223 if self.value_mask != other.value_mask: return False
224 return True
225
226 def __ne__(self, other):
227 return not self.__eq__(other)
228
229 def show(self):
230 import loxi.pp
231 return loxi.pp.pp(self)
232
233 def pretty_print(self, q):
234 q.text("arp_sha_masked {")
235 with q.group():
236 with q.indent(2):
237 q.breakable()
238 q.text("value = ");
239 q.text(util.pretty_mac(self.value))
240 q.text(","); q.breakable()
241 q.text("value_mask = ");
242 q.text(util.pretty_mac(self.value_mask))
243 q.breakable()
244 q.text('}')
245
246class arp_spa(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -0700247 type_len = 2147494916
Rich Lanec2ee4b82013-04-24 17:12:38 -0700248
249 def __init__(self, value=None):
250 if value != None:
251 self.value = value
252 else:
253 self.value = 0
254
255 def pack(self):
256 packed = []
257 packed.append(struct.pack("!L", self.type_len))
258 packed.append(struct.pack("!L", self.value))
259 return ''.join(packed)
260
261 @staticmethod
262 def unpack(buf):
263 obj = arp_spa()
264 if type(buf) == loxi.generic_util.OFReader:
265 reader = buf
266 else:
267 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -0700268 _type_len = reader.read("!L")[0]
269 assert(_type_len == 2147494916)
270 obj.value = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700271 return obj
272
273 def __eq__(self, other):
274 if type(self) != type(other): return False
275 if self.value != other.value: return False
276 return True
277
278 def __ne__(self, other):
279 return not self.__eq__(other)
280
281 def show(self):
282 import loxi.pp
283 return loxi.pp.pp(self)
284
285 def pretty_print(self, q):
286 q.text("arp_spa {")
287 with q.group():
288 with q.indent(2):
289 q.breakable()
290 q.text("value = ");
291 q.text("%#x" % self.value)
292 q.breakable()
293 q.text('}')
294
295class arp_spa_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -0700296 type_len = 2147495176
Rich Lanec2ee4b82013-04-24 17:12:38 -0700297
298 def __init__(self, value=None, value_mask=None):
299 if value != None:
300 self.value = value
301 else:
302 self.value = 0
303 if value_mask != None:
304 self.value_mask = value_mask
305 else:
306 self.value_mask = 0
307
308 def pack(self):
309 packed = []
310 packed.append(struct.pack("!L", self.type_len))
311 packed.append(struct.pack("!L", self.value))
312 packed.append(struct.pack("!L", self.value_mask))
313 return ''.join(packed)
314
315 @staticmethod
316 def unpack(buf):
317 obj = arp_spa_masked()
318 if type(buf) == loxi.generic_util.OFReader:
319 reader = buf
320 else:
321 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -0700322 _type_len = reader.read("!L")[0]
323 assert(_type_len == 2147495176)
324 obj.value = reader.read("!L")[0]
325 obj.value_mask = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700326 return obj
327
328 def __eq__(self, other):
329 if type(self) != type(other): return False
330 if self.value != other.value: return False
331 if self.value_mask != other.value_mask: return False
332 return True
333
334 def __ne__(self, other):
335 return not self.__eq__(other)
336
337 def show(self):
338 import loxi.pp
339 return loxi.pp.pp(self)
340
341 def pretty_print(self, q):
342 q.text("arp_spa_masked {")
343 with q.group():
344 with q.indent(2):
345 q.breakable()
346 q.text("value = ");
347 q.text("%#x" % self.value)
348 q.text(","); q.breakable()
349 q.text("value_mask = ");
350 q.text("%#x" % self.value_mask)
351 q.breakable()
352 q.text('}')
353
354class arp_tha(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -0700355 type_len = 2147496454
Rich Lanec2ee4b82013-04-24 17:12:38 -0700356
357 def __init__(self, value=None):
358 if value != None:
359 self.value = value
360 else:
361 self.value = [0,0,0,0,0,0]
362
363 def pack(self):
364 packed = []
365 packed.append(struct.pack("!L", self.type_len))
366 packed.append(struct.pack("!6B", *self.value))
367 return ''.join(packed)
368
369 @staticmethod
370 def unpack(buf):
371 obj = arp_tha()
372 if type(buf) == loxi.generic_util.OFReader:
373 reader = buf
374 else:
375 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -0700376 _type_len = reader.read("!L")[0]
377 assert(_type_len == 2147496454)
Rich Lanec2ee4b82013-04-24 17:12:38 -0700378 obj.value = list(reader.read('!6B'))
379 return obj
380
381 def __eq__(self, other):
382 if type(self) != type(other): return False
383 if self.value != other.value: return False
384 return True
385
386 def __ne__(self, other):
387 return not self.__eq__(other)
388
389 def show(self):
390 import loxi.pp
391 return loxi.pp.pp(self)
392
393 def pretty_print(self, q):
394 q.text("arp_tha {")
395 with q.group():
396 with q.indent(2):
397 q.breakable()
398 q.text("value = ");
399 q.text(util.pretty_mac(self.value))
400 q.breakable()
401 q.text('}')
402
403class arp_tha_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -0700404 type_len = 2147496716
Rich Lanec2ee4b82013-04-24 17:12:38 -0700405
406 def __init__(self, value=None, value_mask=None):
407 if value != None:
408 self.value = value
409 else:
410 self.value = [0,0,0,0,0,0]
411 if value_mask != None:
412 self.value_mask = value_mask
413 else:
414 self.value_mask = [0,0,0,0,0,0]
415
416 def pack(self):
417 packed = []
418 packed.append(struct.pack("!L", self.type_len))
419 packed.append(struct.pack("!6B", *self.value))
420 packed.append(struct.pack("!6B", *self.value_mask))
421 return ''.join(packed)
422
423 @staticmethod
424 def unpack(buf):
425 obj = arp_tha_masked()
426 if type(buf) == loxi.generic_util.OFReader:
427 reader = buf
428 else:
429 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -0700430 _type_len = reader.read("!L")[0]
431 assert(_type_len == 2147496716)
Rich Lanec2ee4b82013-04-24 17:12:38 -0700432 obj.value = list(reader.read('!6B'))
433 obj.value_mask = list(reader.read('!6B'))
434 return obj
435
436 def __eq__(self, other):
437 if type(self) != type(other): return False
438 if self.value != other.value: return False
439 if self.value_mask != other.value_mask: return False
440 return True
441
442 def __ne__(self, other):
443 return not self.__eq__(other)
444
445 def show(self):
446 import loxi.pp
447 return loxi.pp.pp(self)
448
449 def pretty_print(self, q):
450 q.text("arp_tha_masked {")
451 with q.group():
452 with q.indent(2):
453 q.breakable()
454 q.text("value = ");
455 q.text(util.pretty_mac(self.value))
456 q.text(","); q.breakable()
457 q.text("value_mask = ");
458 q.text(util.pretty_mac(self.value_mask))
459 q.breakable()
460 q.text('}')
461
462class arp_tpa(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -0700463 type_len = 2147495428
Rich Lanec2ee4b82013-04-24 17:12:38 -0700464
465 def __init__(self, value=None):
466 if value != None:
467 self.value = value
468 else:
469 self.value = 0
470
471 def pack(self):
472 packed = []
473 packed.append(struct.pack("!L", self.type_len))
474 packed.append(struct.pack("!L", self.value))
475 return ''.join(packed)
476
477 @staticmethod
478 def unpack(buf):
479 obj = arp_tpa()
480 if type(buf) == loxi.generic_util.OFReader:
481 reader = buf
482 else:
483 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -0700484 _type_len = reader.read("!L")[0]
485 assert(_type_len == 2147495428)
486 obj.value = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700487 return obj
488
489 def __eq__(self, other):
490 if type(self) != type(other): return False
491 if self.value != other.value: return False
492 return True
493
494 def __ne__(self, other):
495 return not self.__eq__(other)
496
497 def show(self):
498 import loxi.pp
499 return loxi.pp.pp(self)
500
501 def pretty_print(self, q):
502 q.text("arp_tpa {")
503 with q.group():
504 with q.indent(2):
505 q.breakable()
506 q.text("value = ");
507 q.text("%#x" % self.value)
508 q.breakable()
509 q.text('}')
510
511class arp_tpa_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -0700512 type_len = 2147495688
Rich Lanec2ee4b82013-04-24 17:12:38 -0700513
514 def __init__(self, value=None, value_mask=None):
515 if value != None:
516 self.value = value
517 else:
518 self.value = 0
519 if value_mask != None:
520 self.value_mask = value_mask
521 else:
522 self.value_mask = 0
523
524 def pack(self):
525 packed = []
526 packed.append(struct.pack("!L", self.type_len))
527 packed.append(struct.pack("!L", self.value))
528 packed.append(struct.pack("!L", self.value_mask))
529 return ''.join(packed)
530
531 @staticmethod
532 def unpack(buf):
533 obj = arp_tpa_masked()
534 if type(buf) == loxi.generic_util.OFReader:
535 reader = buf
536 else:
537 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -0700538 _type_len = reader.read("!L")[0]
539 assert(_type_len == 2147495688)
540 obj.value = reader.read("!L")[0]
541 obj.value_mask = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700542 return obj
543
544 def __eq__(self, other):
545 if type(self) != type(other): return False
546 if self.value != other.value: return False
547 if self.value_mask != other.value_mask: return False
548 return True
549
550 def __ne__(self, other):
551 return not self.__eq__(other)
552
553 def show(self):
554 import loxi.pp
555 return loxi.pp.pp(self)
556
557 def pretty_print(self, q):
558 q.text("arp_tpa_masked {")
559 with q.group():
560 with q.indent(2):
561 q.breakable()
562 q.text("value = ");
563 q.text("%#x" % self.value)
564 q.text(","); q.breakable()
565 q.text("value_mask = ");
566 q.text("%#x" % self.value_mask)
567 q.breakable()
568 q.text('}')
569
Rich Laned9e3f7b2013-11-04 11:40:43 -0800570class bsn_global_vrf_allowed(OXM):
571 type_len = 198145
572
573 def __init__(self, value=None):
574 if value != None:
575 self.value = value
576 else:
577 self.value = 0
578
579 def pack(self):
580 packed = []
581 packed.append(struct.pack("!L", self.type_len))
582 packed.append(struct.pack("!B", self.value))
583 return ''.join(packed)
584
585 @staticmethod
586 def unpack(buf):
587 obj = bsn_global_vrf_allowed()
588 if type(buf) == loxi.generic_util.OFReader:
589 reader = buf
590 else:
591 reader = loxi.generic_util.OFReader(buf)
592 _type_len = reader.read("!L")[0]
593 assert(_type_len == 198145)
594 obj.value = reader.read("!B")[0]
595 return obj
596
597 def __eq__(self, other):
598 if type(self) != type(other): return False
599 if self.value != other.value: return False
600 return True
601
602 def __ne__(self, other):
603 return not self.__eq__(other)
604
605 def show(self):
606 import loxi.pp
607 return loxi.pp.pp(self)
608
609 def pretty_print(self, q):
610 q.text("bsn_global_vrf_allowed {")
611 with q.group():
612 with q.indent(2):
613 q.breakable()
614 q.text("value = ");
615 q.text("%#x" % self.value)
616 q.breakable()
617 q.text('}')
618
619class bsn_global_vrf_allowed_masked(OXM):
620 type_len = 198401
621
622 def __init__(self, value=None, value_mask=None):
623 if value != None:
624 self.value = value
625 else:
626 self.value = 0
627 if value_mask != None:
628 self.value_mask = value_mask
629 else:
630 self.value_mask = 0
631
632 def pack(self):
633 packed = []
634 packed.append(struct.pack("!L", self.type_len))
635 packed.append(struct.pack("!B", self.value))
636 packed.append(struct.pack("!B", self.value_mask))
637 return ''.join(packed)
638
639 @staticmethod
640 def unpack(buf):
641 obj = bsn_global_vrf_allowed_masked()
642 if type(buf) == loxi.generic_util.OFReader:
643 reader = buf
644 else:
645 reader = loxi.generic_util.OFReader(buf)
646 _type_len = reader.read("!L")[0]
647 assert(_type_len == 198401)
648 obj.value = reader.read("!B")[0]
649 obj.value_mask = reader.read("!B")[0]
650 return obj
651
652 def __eq__(self, other):
653 if type(self) != type(other): return False
654 if self.value != other.value: return False
655 if self.value_mask != other.value_mask: return False
656 return True
657
658 def __ne__(self, other):
659 return not self.__eq__(other)
660
661 def show(self):
662 import loxi.pp
663 return loxi.pp.pp(self)
664
665 def pretty_print(self, q):
666 q.text("bsn_global_vrf_allowed_masked {")
667 with q.group():
668 with q.indent(2):
669 q.breakable()
670 q.text("value = ");
671 q.text("%#x" % self.value)
672 q.text(","); q.breakable()
673 q.text("value_mask = ");
674 q.text("%#x" % self.value_mask)
675 q.breakable()
676 q.text('}')
677
Rich Lane6f4978c2013-10-20 21:33:52 -0700678class bsn_in_ports_128(OXM):
679 type_len = 196640
680
681 def __init__(self, value=None):
682 if value != None:
683 self.value = value
684 else:
685 self.value = set()
686
687 def pack(self):
688 packed = []
689 packed.append(struct.pack("!L", self.type_len))
690 packed.append(util.pack_bitmap_128(self.value))
691 return ''.join(packed)
692
693 @staticmethod
694 def unpack(buf):
695 obj = bsn_in_ports_128()
696 if type(buf) == loxi.generic_util.OFReader:
697 reader = buf
698 else:
699 reader = loxi.generic_util.OFReader(buf)
700 _type_len = reader.read("!L")[0]
701 assert(_type_len == 196640)
702 obj.value = util.unpack_bitmap_128(reader)
703 return obj
704
705 def __eq__(self, other):
706 if type(self) != type(other): return False
707 if self.value != other.value: return False
708 return True
709
710 def __ne__(self, other):
711 return not self.__eq__(other)
712
713 def show(self):
714 import loxi.pp
715 return loxi.pp.pp(self)
716
717 def pretty_print(self, q):
718 q.text("bsn_in_ports_128 {")
719 with q.group():
720 with q.indent(2):
721 q.breakable()
722 q.text("value = ");
723 q.pp(self.value)
724 q.breakable()
725 q.text('}')
726
727class bsn_in_ports_128_masked(OXM):
728 type_len = 196896
729
730 def __init__(self, value=None, value_mask=None):
731 if value != None:
732 self.value = value
733 else:
734 self.value = set()
735 if value_mask != None:
736 self.value_mask = value_mask
737 else:
738 self.value_mask = set()
739
740 def pack(self):
741 packed = []
742 packed.append(struct.pack("!L", self.type_len))
743 packed.append(util.pack_bitmap_128(self.value))
744 packed.append(util.pack_bitmap_128(self.value_mask))
745 return ''.join(packed)
746
747 @staticmethod
748 def unpack(buf):
749 obj = bsn_in_ports_128_masked()
750 if type(buf) == loxi.generic_util.OFReader:
751 reader = buf
752 else:
753 reader = loxi.generic_util.OFReader(buf)
754 _type_len = reader.read("!L")[0]
755 assert(_type_len == 196896)
756 obj.value = util.unpack_bitmap_128(reader)
757 obj.value_mask = util.unpack_bitmap_128(reader)
758 return obj
759
760 def __eq__(self, other):
761 if type(self) != type(other): return False
762 if self.value != other.value: return False
763 if self.value_mask != other.value_mask: return False
764 return True
765
766 def __ne__(self, other):
767 return not self.__eq__(other)
768
769 def show(self):
770 import loxi.pp
771 return loxi.pp.pp(self)
772
773 def pretty_print(self, q):
774 q.text("bsn_in_ports_128_masked {")
775 with q.group():
776 with q.indent(2):
777 q.breakable()
778 q.text("value = ");
779 q.pp(self.value)
780 q.text(","); q.breakable()
781 q.text("value_mask = ");
782 q.pp(self.value_mask)
783 q.breakable()
784 q.text('}')
785
Rich Laned9e3f7b2013-11-04 11:40:43 -0800786class bsn_l3_dst_class_id(OXM):
787 type_len = 199684
788
789 def __init__(self, value=None):
790 if value != None:
791 self.value = value
792 else:
793 self.value = 0
794
795 def pack(self):
796 packed = []
797 packed.append(struct.pack("!L", self.type_len))
798 packed.append(struct.pack("!L", self.value))
799 return ''.join(packed)
800
801 @staticmethod
802 def unpack(buf):
803 obj = bsn_l3_dst_class_id()
804 if type(buf) == loxi.generic_util.OFReader:
805 reader = buf
806 else:
807 reader = loxi.generic_util.OFReader(buf)
808 _type_len = reader.read("!L")[0]
809 assert(_type_len == 199684)
810 obj.value = reader.read("!L")[0]
811 return obj
812
813 def __eq__(self, other):
814 if type(self) != type(other): return False
815 if self.value != other.value: return False
816 return True
817
818 def __ne__(self, other):
819 return not self.__eq__(other)
820
821 def show(self):
822 import loxi.pp
823 return loxi.pp.pp(self)
824
825 def pretty_print(self, q):
826 q.text("bsn_l3_dst_class_id {")
827 with q.group():
828 with q.indent(2):
829 q.breakable()
830 q.text("value = ");
831 q.text("%#x" % self.value)
832 q.breakable()
833 q.text('}')
834
835class bsn_l3_dst_class_id_masked(OXM):
836 type_len = 199940
837
838 def __init__(self, value=None, value_mask=None):
839 if value != None:
840 self.value = value
841 else:
842 self.value = 0
843 if value_mask != None:
844 self.value_mask = value_mask
845 else:
846 self.value_mask = 0
847
848 def pack(self):
849 packed = []
850 packed.append(struct.pack("!L", self.type_len))
851 packed.append(struct.pack("!L", self.value))
852 packed.append(struct.pack("!L", self.value_mask))
853 return ''.join(packed)
854
855 @staticmethod
856 def unpack(buf):
857 obj = bsn_l3_dst_class_id_masked()
858 if type(buf) == loxi.generic_util.OFReader:
859 reader = buf
860 else:
861 reader = loxi.generic_util.OFReader(buf)
862 _type_len = reader.read("!L")[0]
863 assert(_type_len == 199940)
864 obj.value = reader.read("!L")[0]
865 obj.value_mask = reader.read("!L")[0]
866 return obj
867
868 def __eq__(self, other):
869 if type(self) != type(other): return False
870 if self.value != other.value: return False
871 if self.value_mask != other.value_mask: return False
872 return True
873
874 def __ne__(self, other):
875 return not self.__eq__(other)
876
877 def show(self):
878 import loxi.pp
879 return loxi.pp.pp(self)
880
881 def pretty_print(self, q):
882 q.text("bsn_l3_dst_class_id_masked {")
883 with q.group():
884 with q.indent(2):
885 q.breakable()
886 q.text("value = ");
887 q.text("%#x" % self.value)
888 q.text(","); q.breakable()
889 q.text("value_mask = ");
890 q.text("%#x" % self.value_mask)
891 q.breakable()
892 q.text('}')
893
894class bsn_l3_interface_class_id(OXM):
895 type_len = 198660
896
897 def __init__(self, value=None):
898 if value != None:
899 self.value = value
900 else:
901 self.value = 0
902
903 def pack(self):
904 packed = []
905 packed.append(struct.pack("!L", self.type_len))
906 packed.append(struct.pack("!L", self.value))
907 return ''.join(packed)
908
909 @staticmethod
910 def unpack(buf):
911 obj = bsn_l3_interface_class_id()
912 if type(buf) == loxi.generic_util.OFReader:
913 reader = buf
914 else:
915 reader = loxi.generic_util.OFReader(buf)
916 _type_len = reader.read("!L")[0]
917 assert(_type_len == 198660)
918 obj.value = reader.read("!L")[0]
919 return obj
920
921 def __eq__(self, other):
922 if type(self) != type(other): return False
923 if self.value != other.value: return False
924 return True
925
926 def __ne__(self, other):
927 return not self.__eq__(other)
928
929 def show(self):
930 import loxi.pp
931 return loxi.pp.pp(self)
932
933 def pretty_print(self, q):
934 q.text("bsn_l3_interface_class_id {")
935 with q.group():
936 with q.indent(2):
937 q.breakable()
938 q.text("value = ");
939 q.text("%#x" % self.value)
940 q.breakable()
941 q.text('}')
942
943class bsn_l3_interface_class_id_masked(OXM):
944 type_len = 198916
945
946 def __init__(self, value=None, value_mask=None):
947 if value != None:
948 self.value = value
949 else:
950 self.value = 0
951 if value_mask != None:
952 self.value_mask = value_mask
953 else:
954 self.value_mask = 0
955
956 def pack(self):
957 packed = []
958 packed.append(struct.pack("!L", self.type_len))
959 packed.append(struct.pack("!L", self.value))
960 packed.append(struct.pack("!L", self.value_mask))
961 return ''.join(packed)
962
963 @staticmethod
964 def unpack(buf):
965 obj = bsn_l3_interface_class_id_masked()
966 if type(buf) == loxi.generic_util.OFReader:
967 reader = buf
968 else:
969 reader = loxi.generic_util.OFReader(buf)
970 _type_len = reader.read("!L")[0]
971 assert(_type_len == 198916)
972 obj.value = reader.read("!L")[0]
973 obj.value_mask = reader.read("!L")[0]
974 return obj
975
976 def __eq__(self, other):
977 if type(self) != type(other): return False
978 if self.value != other.value: return False
979 if self.value_mask != other.value_mask: return False
980 return True
981
982 def __ne__(self, other):
983 return not self.__eq__(other)
984
985 def show(self):
986 import loxi.pp
987 return loxi.pp.pp(self)
988
989 def pretty_print(self, q):
990 q.text("bsn_l3_interface_class_id_masked {")
991 with q.group():
992 with q.indent(2):
993 q.breakable()
994 q.text("value = ");
995 q.text("%#x" % self.value)
996 q.text(","); q.breakable()
997 q.text("value_mask = ");
998 q.text("%#x" % self.value_mask)
999 q.breakable()
1000 q.text('}')
1001
1002class bsn_l3_src_class_id(OXM):
1003 type_len = 199172
1004
1005 def __init__(self, value=None):
1006 if value != None:
1007 self.value = value
1008 else:
1009 self.value = 0
1010
1011 def pack(self):
1012 packed = []
1013 packed.append(struct.pack("!L", self.type_len))
1014 packed.append(struct.pack("!L", self.value))
1015 return ''.join(packed)
1016
1017 @staticmethod
1018 def unpack(buf):
1019 obj = bsn_l3_src_class_id()
1020 if type(buf) == loxi.generic_util.OFReader:
1021 reader = buf
1022 else:
1023 reader = loxi.generic_util.OFReader(buf)
1024 _type_len = reader.read("!L")[0]
1025 assert(_type_len == 199172)
1026 obj.value = reader.read("!L")[0]
1027 return obj
1028
1029 def __eq__(self, other):
1030 if type(self) != type(other): return False
1031 if self.value != other.value: return False
1032 return True
1033
1034 def __ne__(self, other):
1035 return not self.__eq__(other)
1036
1037 def show(self):
1038 import loxi.pp
1039 return loxi.pp.pp(self)
1040
1041 def pretty_print(self, q):
1042 q.text("bsn_l3_src_class_id {")
1043 with q.group():
1044 with q.indent(2):
1045 q.breakable()
1046 q.text("value = ");
1047 q.text("%#x" % self.value)
1048 q.breakable()
1049 q.text('}')
1050
1051class bsn_l3_src_class_id_masked(OXM):
1052 type_len = 199428
1053
1054 def __init__(self, value=None, value_mask=None):
1055 if value != None:
1056 self.value = value
1057 else:
1058 self.value = 0
1059 if value_mask != None:
1060 self.value_mask = value_mask
1061 else:
1062 self.value_mask = 0
1063
1064 def pack(self):
1065 packed = []
1066 packed.append(struct.pack("!L", self.type_len))
1067 packed.append(struct.pack("!L", self.value))
1068 packed.append(struct.pack("!L", self.value_mask))
1069 return ''.join(packed)
1070
1071 @staticmethod
1072 def unpack(buf):
1073 obj = bsn_l3_src_class_id_masked()
1074 if type(buf) == loxi.generic_util.OFReader:
1075 reader = buf
1076 else:
1077 reader = loxi.generic_util.OFReader(buf)
1078 _type_len = reader.read("!L")[0]
1079 assert(_type_len == 199428)
1080 obj.value = reader.read("!L")[0]
1081 obj.value_mask = reader.read("!L")[0]
1082 return obj
1083
1084 def __eq__(self, other):
1085 if type(self) != type(other): return False
1086 if self.value != other.value: return False
1087 if self.value_mask != other.value_mask: return False
1088 return True
1089
1090 def __ne__(self, other):
1091 return not self.__eq__(other)
1092
1093 def show(self):
1094 import loxi.pp
1095 return loxi.pp.pp(self)
1096
1097 def pretty_print(self, q):
1098 q.text("bsn_l3_src_class_id_masked {")
1099 with q.group():
1100 with q.indent(2):
1101 q.breakable()
1102 q.text("value = ");
1103 q.text("%#x" % self.value)
1104 q.text(","); q.breakable()
1105 q.text("value_mask = ");
1106 q.text("%#x" % self.value_mask)
1107 q.breakable()
1108 q.text('}')
1109
1110class bsn_lag_id(OXM):
1111 type_len = 197124
1112
1113 def __init__(self, value=None):
1114 if value != None:
1115 self.value = value
1116 else:
1117 self.value = 0
1118
1119 def pack(self):
1120 packed = []
1121 packed.append(struct.pack("!L", self.type_len))
1122 packed.append(struct.pack("!L", self.value))
1123 return ''.join(packed)
1124
1125 @staticmethod
1126 def unpack(buf):
1127 obj = bsn_lag_id()
1128 if type(buf) == loxi.generic_util.OFReader:
1129 reader = buf
1130 else:
1131 reader = loxi.generic_util.OFReader(buf)
1132 _type_len = reader.read("!L")[0]
1133 assert(_type_len == 197124)
1134 obj.value = reader.read("!L")[0]
1135 return obj
1136
1137 def __eq__(self, other):
1138 if type(self) != type(other): return False
1139 if self.value != other.value: return False
1140 return True
1141
1142 def __ne__(self, other):
1143 return not self.__eq__(other)
1144
1145 def show(self):
1146 import loxi.pp
1147 return loxi.pp.pp(self)
1148
1149 def pretty_print(self, q):
1150 q.text("bsn_lag_id {")
1151 with q.group():
1152 with q.indent(2):
1153 q.breakable()
1154 q.text("value = ");
1155 q.text("%#x" % self.value)
1156 q.breakable()
1157 q.text('}')
1158
1159class bsn_lag_id_masked(OXM):
1160 type_len = 197380
1161
1162 def __init__(self, value=None, value_mask=None):
1163 if value != None:
1164 self.value = value
1165 else:
1166 self.value = 0
1167 if value_mask != None:
1168 self.value_mask = value_mask
1169 else:
1170 self.value_mask = 0
1171
1172 def pack(self):
1173 packed = []
1174 packed.append(struct.pack("!L", self.type_len))
1175 packed.append(struct.pack("!L", self.value))
1176 packed.append(struct.pack("!L", self.value_mask))
1177 return ''.join(packed)
1178
1179 @staticmethod
1180 def unpack(buf):
1181 obj = bsn_lag_id_masked()
1182 if type(buf) == loxi.generic_util.OFReader:
1183 reader = buf
1184 else:
1185 reader = loxi.generic_util.OFReader(buf)
1186 _type_len = reader.read("!L")[0]
1187 assert(_type_len == 197380)
1188 obj.value = reader.read("!L")[0]
1189 obj.value_mask = reader.read("!L")[0]
1190 return obj
1191
1192 def __eq__(self, other):
1193 if type(self) != type(other): return False
1194 if self.value != other.value: return False
1195 if self.value_mask != other.value_mask: return False
1196 return True
1197
1198 def __ne__(self, other):
1199 return not self.__eq__(other)
1200
1201 def show(self):
1202 import loxi.pp
1203 return loxi.pp.pp(self)
1204
1205 def pretty_print(self, q):
1206 q.text("bsn_lag_id_masked {")
1207 with q.group():
1208 with q.indent(2):
1209 q.breakable()
1210 q.text("value = ");
1211 q.text("%#x" % self.value)
1212 q.text(","); q.breakable()
1213 q.text("value_mask = ");
1214 q.text("%#x" % self.value_mask)
1215 q.breakable()
1216 q.text('}')
1217
1218class bsn_vrf(OXM):
1219 type_len = 197636
1220
1221 def __init__(self, value=None):
1222 if value != None:
1223 self.value = value
1224 else:
1225 self.value = 0
1226
1227 def pack(self):
1228 packed = []
1229 packed.append(struct.pack("!L", self.type_len))
1230 packed.append(struct.pack("!L", self.value))
1231 return ''.join(packed)
1232
1233 @staticmethod
1234 def unpack(buf):
1235 obj = bsn_vrf()
1236 if type(buf) == loxi.generic_util.OFReader:
1237 reader = buf
1238 else:
1239 reader = loxi.generic_util.OFReader(buf)
1240 _type_len = reader.read("!L")[0]
1241 assert(_type_len == 197636)
1242 obj.value = reader.read("!L")[0]
1243 return obj
1244
1245 def __eq__(self, other):
1246 if type(self) != type(other): return False
1247 if self.value != other.value: return False
1248 return True
1249
1250 def __ne__(self, other):
1251 return not self.__eq__(other)
1252
1253 def show(self):
1254 import loxi.pp
1255 return loxi.pp.pp(self)
1256
1257 def pretty_print(self, q):
1258 q.text("bsn_vrf {")
1259 with q.group():
1260 with q.indent(2):
1261 q.breakable()
1262 q.text("value = ");
1263 q.text("%#x" % self.value)
1264 q.breakable()
1265 q.text('}')
1266
1267class bsn_vrf_masked(OXM):
1268 type_len = 197892
1269
1270 def __init__(self, value=None, value_mask=None):
1271 if value != None:
1272 self.value = value
1273 else:
1274 self.value = 0
1275 if value_mask != None:
1276 self.value_mask = value_mask
1277 else:
1278 self.value_mask = 0
1279
1280 def pack(self):
1281 packed = []
1282 packed.append(struct.pack("!L", self.type_len))
1283 packed.append(struct.pack("!L", self.value))
1284 packed.append(struct.pack("!L", self.value_mask))
1285 return ''.join(packed)
1286
1287 @staticmethod
1288 def unpack(buf):
1289 obj = bsn_vrf_masked()
1290 if type(buf) == loxi.generic_util.OFReader:
1291 reader = buf
1292 else:
1293 reader = loxi.generic_util.OFReader(buf)
1294 _type_len = reader.read("!L")[0]
1295 assert(_type_len == 197892)
1296 obj.value = reader.read("!L")[0]
1297 obj.value_mask = reader.read("!L")[0]
1298 return obj
1299
1300 def __eq__(self, other):
1301 if type(self) != type(other): return False
1302 if self.value != other.value: return False
1303 if self.value_mask != other.value_mask: return False
1304 return True
1305
1306 def __ne__(self, other):
1307 return not self.__eq__(other)
1308
1309 def show(self):
1310 import loxi.pp
1311 return loxi.pp.pp(self)
1312
1313 def pretty_print(self, q):
1314 q.text("bsn_vrf_masked {")
1315 with q.group():
1316 with q.indent(2):
1317 q.breakable()
1318 q.text("value = ");
1319 q.text("%#x" % self.value)
1320 q.text(","); q.breakable()
1321 q.text("value_mask = ");
1322 q.text("%#x" % self.value_mask)
1323 q.breakable()
1324 q.text('}')
1325
Rich Lanec2ee4b82013-04-24 17:12:38 -07001326class eth_dst(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001327 type_len = 2147485190
Rich Lanec2ee4b82013-04-24 17:12:38 -07001328
1329 def __init__(self, value=None):
1330 if value != None:
1331 self.value = value
1332 else:
1333 self.value = [0,0,0,0,0,0]
1334
1335 def pack(self):
1336 packed = []
1337 packed.append(struct.pack("!L", self.type_len))
1338 packed.append(struct.pack("!6B", *self.value))
1339 return ''.join(packed)
1340
1341 @staticmethod
1342 def unpack(buf):
1343 obj = eth_dst()
1344 if type(buf) == loxi.generic_util.OFReader:
1345 reader = buf
1346 else:
1347 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001348 _type_len = reader.read("!L")[0]
1349 assert(_type_len == 2147485190)
Rich Lanec2ee4b82013-04-24 17:12:38 -07001350 obj.value = list(reader.read('!6B'))
1351 return obj
1352
1353 def __eq__(self, other):
1354 if type(self) != type(other): return False
1355 if self.value != other.value: return False
1356 return True
1357
1358 def __ne__(self, other):
1359 return not self.__eq__(other)
1360
1361 def show(self):
1362 import loxi.pp
1363 return loxi.pp.pp(self)
1364
1365 def pretty_print(self, q):
1366 q.text("eth_dst {")
1367 with q.group():
1368 with q.indent(2):
1369 q.breakable()
1370 q.text("value = ");
1371 q.text(util.pretty_mac(self.value))
1372 q.breakable()
1373 q.text('}')
1374
1375class eth_dst_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001376 type_len = 2147485452
Rich Lanec2ee4b82013-04-24 17:12:38 -07001377
1378 def __init__(self, value=None, value_mask=None):
1379 if value != None:
1380 self.value = value
1381 else:
1382 self.value = [0,0,0,0,0,0]
1383 if value_mask != None:
1384 self.value_mask = value_mask
1385 else:
1386 self.value_mask = [0,0,0,0,0,0]
1387
1388 def pack(self):
1389 packed = []
1390 packed.append(struct.pack("!L", self.type_len))
1391 packed.append(struct.pack("!6B", *self.value))
1392 packed.append(struct.pack("!6B", *self.value_mask))
1393 return ''.join(packed)
1394
1395 @staticmethod
1396 def unpack(buf):
1397 obj = eth_dst_masked()
1398 if type(buf) == loxi.generic_util.OFReader:
1399 reader = buf
1400 else:
1401 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001402 _type_len = reader.read("!L")[0]
1403 assert(_type_len == 2147485452)
Rich Lanec2ee4b82013-04-24 17:12:38 -07001404 obj.value = list(reader.read('!6B'))
1405 obj.value_mask = list(reader.read('!6B'))
1406 return obj
1407
1408 def __eq__(self, other):
1409 if type(self) != type(other): return False
1410 if self.value != other.value: return False
1411 if self.value_mask != other.value_mask: return False
1412 return True
1413
1414 def __ne__(self, other):
1415 return not self.__eq__(other)
1416
1417 def show(self):
1418 import loxi.pp
1419 return loxi.pp.pp(self)
1420
1421 def pretty_print(self, q):
1422 q.text("eth_dst_masked {")
1423 with q.group():
1424 with q.indent(2):
1425 q.breakable()
1426 q.text("value = ");
1427 q.text(util.pretty_mac(self.value))
1428 q.text(","); q.breakable()
1429 q.text("value_mask = ");
1430 q.text(util.pretty_mac(self.value_mask))
1431 q.breakable()
1432 q.text('}')
1433
1434class eth_src(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001435 type_len = 2147485702
Rich Lanec2ee4b82013-04-24 17:12:38 -07001436
1437 def __init__(self, value=None):
1438 if value != None:
1439 self.value = value
1440 else:
1441 self.value = [0,0,0,0,0,0]
1442
1443 def pack(self):
1444 packed = []
1445 packed.append(struct.pack("!L", self.type_len))
1446 packed.append(struct.pack("!6B", *self.value))
1447 return ''.join(packed)
1448
1449 @staticmethod
1450 def unpack(buf):
1451 obj = eth_src()
1452 if type(buf) == loxi.generic_util.OFReader:
1453 reader = buf
1454 else:
1455 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001456 _type_len = reader.read("!L")[0]
1457 assert(_type_len == 2147485702)
Rich Lanec2ee4b82013-04-24 17:12:38 -07001458 obj.value = list(reader.read('!6B'))
1459 return obj
1460
1461 def __eq__(self, other):
1462 if type(self) != type(other): return False
1463 if self.value != other.value: return False
1464 return True
1465
1466 def __ne__(self, other):
1467 return not self.__eq__(other)
1468
1469 def show(self):
1470 import loxi.pp
1471 return loxi.pp.pp(self)
1472
1473 def pretty_print(self, q):
1474 q.text("eth_src {")
1475 with q.group():
1476 with q.indent(2):
1477 q.breakable()
1478 q.text("value = ");
1479 q.text(util.pretty_mac(self.value))
1480 q.breakable()
1481 q.text('}')
1482
1483class eth_src_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001484 type_len = 2147485964
Rich Lanec2ee4b82013-04-24 17:12:38 -07001485
1486 def __init__(self, value=None, value_mask=None):
1487 if value != None:
1488 self.value = value
1489 else:
1490 self.value = [0,0,0,0,0,0]
1491 if value_mask != None:
1492 self.value_mask = value_mask
1493 else:
1494 self.value_mask = [0,0,0,0,0,0]
1495
1496 def pack(self):
1497 packed = []
1498 packed.append(struct.pack("!L", self.type_len))
1499 packed.append(struct.pack("!6B", *self.value))
1500 packed.append(struct.pack("!6B", *self.value_mask))
1501 return ''.join(packed)
1502
1503 @staticmethod
1504 def unpack(buf):
1505 obj = eth_src_masked()
1506 if type(buf) == loxi.generic_util.OFReader:
1507 reader = buf
1508 else:
1509 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001510 _type_len = reader.read("!L")[0]
1511 assert(_type_len == 2147485964)
Rich Lanec2ee4b82013-04-24 17:12:38 -07001512 obj.value = list(reader.read('!6B'))
1513 obj.value_mask = list(reader.read('!6B'))
1514 return obj
1515
1516 def __eq__(self, other):
1517 if type(self) != type(other): return False
1518 if self.value != other.value: return False
1519 if self.value_mask != other.value_mask: return False
1520 return True
1521
1522 def __ne__(self, other):
1523 return not self.__eq__(other)
1524
1525 def show(self):
1526 import loxi.pp
1527 return loxi.pp.pp(self)
1528
1529 def pretty_print(self, q):
1530 q.text("eth_src_masked {")
1531 with q.group():
1532 with q.indent(2):
1533 q.breakable()
1534 q.text("value = ");
1535 q.text(util.pretty_mac(self.value))
1536 q.text(","); q.breakable()
1537 q.text("value_mask = ");
1538 q.text(util.pretty_mac(self.value_mask))
1539 q.breakable()
1540 q.text('}')
1541
1542class eth_type(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001543 type_len = 2147486210
Rich Lanec2ee4b82013-04-24 17:12:38 -07001544
1545 def __init__(self, value=None):
1546 if value != None:
1547 self.value = value
1548 else:
1549 self.value = 0
1550
1551 def pack(self):
1552 packed = []
1553 packed.append(struct.pack("!L", self.type_len))
1554 packed.append(struct.pack("!H", self.value))
1555 return ''.join(packed)
1556
1557 @staticmethod
1558 def unpack(buf):
1559 obj = eth_type()
1560 if type(buf) == loxi.generic_util.OFReader:
1561 reader = buf
1562 else:
1563 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001564 _type_len = reader.read("!L")[0]
1565 assert(_type_len == 2147486210)
1566 obj.value = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001567 return obj
1568
1569 def __eq__(self, other):
1570 if type(self) != type(other): return False
1571 if self.value != other.value: return False
1572 return True
1573
1574 def __ne__(self, other):
1575 return not self.__eq__(other)
1576
1577 def show(self):
1578 import loxi.pp
1579 return loxi.pp.pp(self)
1580
1581 def pretty_print(self, q):
1582 q.text("eth_type {")
1583 with q.group():
1584 with q.indent(2):
1585 q.breakable()
1586 q.text("value = ");
1587 q.text("%#x" % self.value)
1588 q.breakable()
1589 q.text('}')
1590
1591class eth_type_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001592 type_len = 2147486468
Rich Lanec2ee4b82013-04-24 17:12:38 -07001593
1594 def __init__(self, value=None, value_mask=None):
1595 if value != None:
1596 self.value = value
1597 else:
1598 self.value = 0
1599 if value_mask != None:
1600 self.value_mask = value_mask
1601 else:
1602 self.value_mask = 0
1603
1604 def pack(self):
1605 packed = []
1606 packed.append(struct.pack("!L", self.type_len))
1607 packed.append(struct.pack("!H", self.value))
1608 packed.append(struct.pack("!H", self.value_mask))
1609 return ''.join(packed)
1610
1611 @staticmethod
1612 def unpack(buf):
1613 obj = eth_type_masked()
1614 if type(buf) == loxi.generic_util.OFReader:
1615 reader = buf
1616 else:
1617 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001618 _type_len = reader.read("!L")[0]
1619 assert(_type_len == 2147486468)
1620 obj.value = reader.read("!H")[0]
1621 obj.value_mask = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001622 return obj
1623
1624 def __eq__(self, other):
1625 if type(self) != type(other): return False
1626 if self.value != other.value: return False
1627 if self.value_mask != other.value_mask: return False
1628 return True
1629
1630 def __ne__(self, other):
1631 return not self.__eq__(other)
1632
1633 def show(self):
1634 import loxi.pp
1635 return loxi.pp.pp(self)
1636
1637 def pretty_print(self, q):
1638 q.text("eth_type_masked {")
1639 with q.group():
1640 with q.indent(2):
1641 q.breakable()
1642 q.text("value = ");
1643 q.text("%#x" % self.value)
1644 q.text(","); q.breakable()
1645 q.text("value_mask = ");
1646 q.text("%#x" % self.value_mask)
1647 q.breakable()
1648 q.text('}')
1649
1650class icmpv4_code(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001651 type_len = 2147493889
Rich Lanec2ee4b82013-04-24 17:12:38 -07001652
1653 def __init__(self, value=None):
1654 if value != None:
1655 self.value = value
1656 else:
1657 self.value = 0
1658
1659 def pack(self):
1660 packed = []
1661 packed.append(struct.pack("!L", self.type_len))
1662 packed.append(struct.pack("!B", self.value))
1663 return ''.join(packed)
1664
1665 @staticmethod
1666 def unpack(buf):
1667 obj = icmpv4_code()
1668 if type(buf) == loxi.generic_util.OFReader:
1669 reader = buf
1670 else:
1671 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001672 _type_len = reader.read("!L")[0]
1673 assert(_type_len == 2147493889)
1674 obj.value = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001675 return obj
1676
1677 def __eq__(self, other):
1678 if type(self) != type(other): return False
1679 if self.value != other.value: return False
1680 return True
1681
1682 def __ne__(self, other):
1683 return not self.__eq__(other)
1684
1685 def show(self):
1686 import loxi.pp
1687 return loxi.pp.pp(self)
1688
1689 def pretty_print(self, q):
1690 q.text("icmpv4_code {")
1691 with q.group():
1692 with q.indent(2):
1693 q.breakable()
1694 q.text("value = ");
1695 q.text("%#x" % self.value)
1696 q.breakable()
1697 q.text('}')
1698
1699class icmpv4_code_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001700 type_len = 2147494146
Rich Lanec2ee4b82013-04-24 17:12:38 -07001701
1702 def __init__(self, value=None, value_mask=None):
1703 if value != None:
1704 self.value = value
1705 else:
1706 self.value = 0
1707 if value_mask != None:
1708 self.value_mask = value_mask
1709 else:
1710 self.value_mask = 0
1711
1712 def pack(self):
1713 packed = []
1714 packed.append(struct.pack("!L", self.type_len))
1715 packed.append(struct.pack("!B", self.value))
1716 packed.append(struct.pack("!B", self.value_mask))
1717 return ''.join(packed)
1718
1719 @staticmethod
1720 def unpack(buf):
1721 obj = icmpv4_code_masked()
1722 if type(buf) == loxi.generic_util.OFReader:
1723 reader = buf
1724 else:
1725 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001726 _type_len = reader.read("!L")[0]
1727 assert(_type_len == 2147494146)
1728 obj.value = reader.read("!B")[0]
1729 obj.value_mask = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001730 return obj
1731
1732 def __eq__(self, other):
1733 if type(self) != type(other): return False
1734 if self.value != other.value: return False
1735 if self.value_mask != other.value_mask: return False
1736 return True
1737
1738 def __ne__(self, other):
1739 return not self.__eq__(other)
1740
1741 def show(self):
1742 import loxi.pp
1743 return loxi.pp.pp(self)
1744
1745 def pretty_print(self, q):
1746 q.text("icmpv4_code_masked {")
1747 with q.group():
1748 with q.indent(2):
1749 q.breakable()
1750 q.text("value = ");
1751 q.text("%#x" % self.value)
1752 q.text(","); q.breakable()
1753 q.text("value_mask = ");
1754 q.text("%#x" % self.value_mask)
1755 q.breakable()
1756 q.text('}')
1757
1758class icmpv4_type(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001759 type_len = 2147493377
Rich Lanec2ee4b82013-04-24 17:12:38 -07001760
1761 def __init__(self, value=None):
1762 if value != None:
1763 self.value = value
1764 else:
1765 self.value = 0
1766
1767 def pack(self):
1768 packed = []
1769 packed.append(struct.pack("!L", self.type_len))
1770 packed.append(struct.pack("!B", self.value))
1771 return ''.join(packed)
1772
1773 @staticmethod
1774 def unpack(buf):
1775 obj = icmpv4_type()
1776 if type(buf) == loxi.generic_util.OFReader:
1777 reader = buf
1778 else:
1779 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001780 _type_len = reader.read("!L")[0]
1781 assert(_type_len == 2147493377)
1782 obj.value = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001783 return obj
1784
1785 def __eq__(self, other):
1786 if type(self) != type(other): return False
1787 if self.value != other.value: return False
1788 return True
1789
1790 def __ne__(self, other):
1791 return not self.__eq__(other)
1792
1793 def show(self):
1794 import loxi.pp
1795 return loxi.pp.pp(self)
1796
1797 def pretty_print(self, q):
1798 q.text("icmpv4_type {")
1799 with q.group():
1800 with q.indent(2):
1801 q.breakable()
1802 q.text("value = ");
1803 q.text("%#x" % self.value)
1804 q.breakable()
1805 q.text('}')
1806
1807class icmpv4_type_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001808 type_len = 2147493634
Rich Lanec2ee4b82013-04-24 17:12:38 -07001809
1810 def __init__(self, value=None, value_mask=None):
1811 if value != None:
1812 self.value = value
1813 else:
1814 self.value = 0
1815 if value_mask != None:
1816 self.value_mask = value_mask
1817 else:
1818 self.value_mask = 0
1819
1820 def pack(self):
1821 packed = []
1822 packed.append(struct.pack("!L", self.type_len))
1823 packed.append(struct.pack("!B", self.value))
1824 packed.append(struct.pack("!B", self.value_mask))
1825 return ''.join(packed)
1826
1827 @staticmethod
1828 def unpack(buf):
1829 obj = icmpv4_type_masked()
1830 if type(buf) == loxi.generic_util.OFReader:
1831 reader = buf
1832 else:
1833 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001834 _type_len = reader.read("!L")[0]
1835 assert(_type_len == 2147493634)
1836 obj.value = reader.read("!B")[0]
1837 obj.value_mask = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001838 return obj
1839
1840 def __eq__(self, other):
1841 if type(self) != type(other): return False
1842 if self.value != other.value: return False
1843 if self.value_mask != other.value_mask: return False
1844 return True
1845
1846 def __ne__(self, other):
1847 return not self.__eq__(other)
1848
1849 def show(self):
1850 import loxi.pp
1851 return loxi.pp.pp(self)
1852
1853 def pretty_print(self, q):
1854 q.text("icmpv4_type_masked {")
1855 with q.group():
1856 with q.indent(2):
1857 q.breakable()
1858 q.text("value = ");
1859 q.text("%#x" % self.value)
1860 q.text(","); q.breakable()
1861 q.text("value_mask = ");
1862 q.text("%#x" % self.value_mask)
1863 q.breakable()
1864 q.text('}')
1865
1866class icmpv6_code(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001867 type_len = 2147499009
Rich Lanec2ee4b82013-04-24 17:12:38 -07001868
1869 def __init__(self, value=None):
1870 if value != None:
1871 self.value = value
1872 else:
1873 self.value = 0
1874
1875 def pack(self):
1876 packed = []
1877 packed.append(struct.pack("!L", self.type_len))
1878 packed.append(struct.pack("!B", self.value))
1879 return ''.join(packed)
1880
1881 @staticmethod
1882 def unpack(buf):
1883 obj = icmpv6_code()
1884 if type(buf) == loxi.generic_util.OFReader:
1885 reader = buf
1886 else:
1887 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001888 _type_len = reader.read("!L")[0]
1889 assert(_type_len == 2147499009)
1890 obj.value = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001891 return obj
1892
1893 def __eq__(self, other):
1894 if type(self) != type(other): return False
1895 if self.value != other.value: return False
1896 return True
1897
1898 def __ne__(self, other):
1899 return not self.__eq__(other)
1900
1901 def show(self):
1902 import loxi.pp
1903 return loxi.pp.pp(self)
1904
1905 def pretty_print(self, q):
1906 q.text("icmpv6_code {")
1907 with q.group():
1908 with q.indent(2):
1909 q.breakable()
1910 q.text("value = ");
1911 q.text("%#x" % self.value)
1912 q.breakable()
1913 q.text('}')
1914
1915class icmpv6_code_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001916 type_len = 2147499266
Rich Lanec2ee4b82013-04-24 17:12:38 -07001917
1918 def __init__(self, value=None, value_mask=None):
1919 if value != None:
1920 self.value = value
1921 else:
1922 self.value = 0
1923 if value_mask != None:
1924 self.value_mask = value_mask
1925 else:
1926 self.value_mask = 0
1927
1928 def pack(self):
1929 packed = []
1930 packed.append(struct.pack("!L", self.type_len))
1931 packed.append(struct.pack("!B", self.value))
1932 packed.append(struct.pack("!B", self.value_mask))
1933 return ''.join(packed)
1934
1935 @staticmethod
1936 def unpack(buf):
1937 obj = icmpv6_code_masked()
1938 if type(buf) == loxi.generic_util.OFReader:
1939 reader = buf
1940 else:
1941 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001942 _type_len = reader.read("!L")[0]
1943 assert(_type_len == 2147499266)
1944 obj.value = reader.read("!B")[0]
1945 obj.value_mask = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001946 return obj
1947
1948 def __eq__(self, other):
1949 if type(self) != type(other): return False
1950 if self.value != other.value: return False
1951 if self.value_mask != other.value_mask: return False
1952 return True
1953
1954 def __ne__(self, other):
1955 return not self.__eq__(other)
1956
1957 def show(self):
1958 import loxi.pp
1959 return loxi.pp.pp(self)
1960
1961 def pretty_print(self, q):
1962 q.text("icmpv6_code_masked {")
1963 with q.group():
1964 with q.indent(2):
1965 q.breakable()
1966 q.text("value = ");
1967 q.text("%#x" % self.value)
1968 q.text(","); q.breakable()
1969 q.text("value_mask = ");
1970 q.text("%#x" % self.value_mask)
1971 q.breakable()
1972 q.text('}')
1973
1974class icmpv6_type(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07001975 type_len = 2147498497
Rich Lanec2ee4b82013-04-24 17:12:38 -07001976
1977 def __init__(self, value=None):
1978 if value != None:
1979 self.value = value
1980 else:
1981 self.value = 0
1982
1983 def pack(self):
1984 packed = []
1985 packed.append(struct.pack("!L", self.type_len))
1986 packed.append(struct.pack("!B", self.value))
1987 return ''.join(packed)
1988
1989 @staticmethod
1990 def unpack(buf):
1991 obj = icmpv6_type()
1992 if type(buf) == loxi.generic_util.OFReader:
1993 reader = buf
1994 else:
1995 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07001996 _type_len = reader.read("!L")[0]
1997 assert(_type_len == 2147498497)
1998 obj.value = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001999 return obj
2000
2001 def __eq__(self, other):
2002 if type(self) != type(other): return False
2003 if self.value != other.value: return False
2004 return True
2005
2006 def __ne__(self, other):
2007 return not self.__eq__(other)
2008
2009 def show(self):
2010 import loxi.pp
2011 return loxi.pp.pp(self)
2012
2013 def pretty_print(self, q):
2014 q.text("icmpv6_type {")
2015 with q.group():
2016 with q.indent(2):
2017 q.breakable()
2018 q.text("value = ");
2019 q.text("%#x" % self.value)
2020 q.breakable()
2021 q.text('}')
2022
2023class icmpv6_type_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002024 type_len = 2147498754
Rich Lanec2ee4b82013-04-24 17:12:38 -07002025
2026 def __init__(self, value=None, value_mask=None):
2027 if value != None:
2028 self.value = value
2029 else:
2030 self.value = 0
2031 if value_mask != None:
2032 self.value_mask = value_mask
2033 else:
2034 self.value_mask = 0
2035
2036 def pack(self):
2037 packed = []
2038 packed.append(struct.pack("!L", self.type_len))
2039 packed.append(struct.pack("!B", self.value))
2040 packed.append(struct.pack("!B", self.value_mask))
2041 return ''.join(packed)
2042
2043 @staticmethod
2044 def unpack(buf):
2045 obj = icmpv6_type_masked()
2046 if type(buf) == loxi.generic_util.OFReader:
2047 reader = buf
2048 else:
2049 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002050 _type_len = reader.read("!L")[0]
2051 assert(_type_len == 2147498754)
2052 obj.value = reader.read("!B")[0]
2053 obj.value_mask = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002054 return obj
2055
2056 def __eq__(self, other):
2057 if type(self) != type(other): return False
2058 if self.value != other.value: return False
2059 if self.value_mask != other.value_mask: return False
2060 return True
2061
2062 def __ne__(self, other):
2063 return not self.__eq__(other)
2064
2065 def show(self):
2066 import loxi.pp
2067 return loxi.pp.pp(self)
2068
2069 def pretty_print(self, q):
2070 q.text("icmpv6_type_masked {")
2071 with q.group():
2072 with q.indent(2):
2073 q.breakable()
2074 q.text("value = ");
2075 q.text("%#x" % self.value)
2076 q.text(","); q.breakable()
2077 q.text("value_mask = ");
2078 q.text("%#x" % self.value_mask)
2079 q.breakable()
2080 q.text('}')
2081
2082class in_phy_port(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002083 type_len = 2147484164
Rich Lanec2ee4b82013-04-24 17:12:38 -07002084
2085 def __init__(self, value=None):
2086 if value != None:
2087 self.value = value
2088 else:
2089 self.value = 0
2090
2091 def pack(self):
2092 packed = []
2093 packed.append(struct.pack("!L", self.type_len))
Dan Talaycof6202252013-07-02 01:00:29 -07002094 packed.append(util.pack_port_no(self.value))
Rich Lanec2ee4b82013-04-24 17:12:38 -07002095 return ''.join(packed)
2096
2097 @staticmethod
2098 def unpack(buf):
2099 obj = in_phy_port()
2100 if type(buf) == loxi.generic_util.OFReader:
2101 reader = buf
2102 else:
2103 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002104 _type_len = reader.read("!L")[0]
2105 assert(_type_len == 2147484164)
2106 obj.value = util.unpack_port_no(reader)
Rich Lanec2ee4b82013-04-24 17:12:38 -07002107 return obj
2108
2109 def __eq__(self, other):
2110 if type(self) != type(other): return False
2111 if self.value != other.value: return False
2112 return True
2113
2114 def __ne__(self, other):
2115 return not self.__eq__(other)
2116
2117 def show(self):
2118 import loxi.pp
2119 return loxi.pp.pp(self)
2120
2121 def pretty_print(self, q):
2122 q.text("in_phy_port {")
2123 with q.group():
2124 with q.indent(2):
2125 q.breakable()
2126 q.text("value = ");
2127 q.text(util.pretty_port(self.value))
2128 q.breakable()
2129 q.text('}')
2130
2131class in_phy_port_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002132 type_len = 2147484424
Rich Lanec2ee4b82013-04-24 17:12:38 -07002133
2134 def __init__(self, value=None, value_mask=None):
2135 if value != None:
2136 self.value = value
2137 else:
2138 self.value = 0
2139 if value_mask != None:
2140 self.value_mask = value_mask
2141 else:
2142 self.value_mask = 0
2143
2144 def pack(self):
2145 packed = []
2146 packed.append(struct.pack("!L", self.type_len))
Dan Talaycof6202252013-07-02 01:00:29 -07002147 packed.append(util.pack_port_no(self.value))
2148 packed.append(util.pack_port_no(self.value_mask))
Rich Lanec2ee4b82013-04-24 17:12:38 -07002149 return ''.join(packed)
2150
2151 @staticmethod
2152 def unpack(buf):
2153 obj = in_phy_port_masked()
2154 if type(buf) == loxi.generic_util.OFReader:
2155 reader = buf
2156 else:
2157 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002158 _type_len = reader.read("!L")[0]
2159 assert(_type_len == 2147484424)
2160 obj.value = util.unpack_port_no(reader)
2161 obj.value_mask = util.unpack_port_no(reader)
Rich Lanec2ee4b82013-04-24 17:12:38 -07002162 return obj
2163
2164 def __eq__(self, other):
2165 if type(self) != type(other): return False
2166 if self.value != other.value: return False
2167 if self.value_mask != other.value_mask: return False
2168 return True
2169
2170 def __ne__(self, other):
2171 return not self.__eq__(other)
2172
2173 def show(self):
2174 import loxi.pp
2175 return loxi.pp.pp(self)
2176
2177 def pretty_print(self, q):
2178 q.text("in_phy_port_masked {")
2179 with q.group():
2180 with q.indent(2):
2181 q.breakable()
2182 q.text("value = ");
2183 q.text(util.pretty_port(self.value))
2184 q.text(","); q.breakable()
2185 q.text("value_mask = ");
2186 q.text(util.pretty_port(self.value_mask))
2187 q.breakable()
2188 q.text('}')
2189
2190class in_port(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002191 type_len = 2147483652
Rich Lanec2ee4b82013-04-24 17:12:38 -07002192
2193 def __init__(self, value=None):
2194 if value != None:
2195 self.value = value
2196 else:
2197 self.value = 0
2198
2199 def pack(self):
2200 packed = []
2201 packed.append(struct.pack("!L", self.type_len))
Dan Talaycof6202252013-07-02 01:00:29 -07002202 packed.append(util.pack_port_no(self.value))
Rich Lanec2ee4b82013-04-24 17:12:38 -07002203 return ''.join(packed)
2204
2205 @staticmethod
2206 def unpack(buf):
2207 obj = in_port()
2208 if type(buf) == loxi.generic_util.OFReader:
2209 reader = buf
2210 else:
2211 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002212 _type_len = reader.read("!L")[0]
2213 assert(_type_len == 2147483652)
2214 obj.value = util.unpack_port_no(reader)
Rich Lanec2ee4b82013-04-24 17:12:38 -07002215 return obj
2216
2217 def __eq__(self, other):
2218 if type(self) != type(other): return False
2219 if self.value != other.value: return False
2220 return True
2221
2222 def __ne__(self, other):
2223 return not self.__eq__(other)
2224
2225 def show(self):
2226 import loxi.pp
2227 return loxi.pp.pp(self)
2228
2229 def pretty_print(self, q):
2230 q.text("in_port {")
2231 with q.group():
2232 with q.indent(2):
2233 q.breakable()
2234 q.text("value = ");
2235 q.text(util.pretty_port(self.value))
2236 q.breakable()
2237 q.text('}')
2238
2239class in_port_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002240 type_len = 2147483912
Rich Lanec2ee4b82013-04-24 17:12:38 -07002241
2242 def __init__(self, value=None, value_mask=None):
2243 if value != None:
2244 self.value = value
2245 else:
2246 self.value = 0
2247 if value_mask != None:
2248 self.value_mask = value_mask
2249 else:
2250 self.value_mask = 0
2251
2252 def pack(self):
2253 packed = []
2254 packed.append(struct.pack("!L", self.type_len))
Dan Talaycof6202252013-07-02 01:00:29 -07002255 packed.append(util.pack_port_no(self.value))
2256 packed.append(util.pack_port_no(self.value_mask))
Rich Lanec2ee4b82013-04-24 17:12:38 -07002257 return ''.join(packed)
2258
2259 @staticmethod
2260 def unpack(buf):
2261 obj = in_port_masked()
2262 if type(buf) == loxi.generic_util.OFReader:
2263 reader = buf
2264 else:
2265 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002266 _type_len = reader.read("!L")[0]
2267 assert(_type_len == 2147483912)
2268 obj.value = util.unpack_port_no(reader)
2269 obj.value_mask = util.unpack_port_no(reader)
Rich Lanec2ee4b82013-04-24 17:12:38 -07002270 return obj
2271
2272 def __eq__(self, other):
2273 if type(self) != type(other): return False
2274 if self.value != other.value: return False
2275 if self.value_mask != other.value_mask: return False
2276 return True
2277
2278 def __ne__(self, other):
2279 return not self.__eq__(other)
2280
2281 def show(self):
2282 import loxi.pp
2283 return loxi.pp.pp(self)
2284
2285 def pretty_print(self, q):
2286 q.text("in_port_masked {")
2287 with q.group():
2288 with q.indent(2):
2289 q.breakable()
2290 q.text("value = ");
2291 q.text(util.pretty_port(self.value))
2292 q.text(","); q.breakable()
2293 q.text("value_mask = ");
2294 q.text(util.pretty_port(self.value_mask))
2295 q.breakable()
2296 q.text('}')
2297
2298class ip_dscp(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002299 type_len = 2147487745
Rich Lanec2ee4b82013-04-24 17:12:38 -07002300
2301 def __init__(self, value=None):
2302 if value != None:
2303 self.value = value
2304 else:
2305 self.value = 0
2306
2307 def pack(self):
2308 packed = []
2309 packed.append(struct.pack("!L", self.type_len))
2310 packed.append(struct.pack("!B", self.value))
2311 return ''.join(packed)
2312
2313 @staticmethod
2314 def unpack(buf):
2315 obj = ip_dscp()
2316 if type(buf) == loxi.generic_util.OFReader:
2317 reader = buf
2318 else:
2319 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002320 _type_len = reader.read("!L")[0]
2321 assert(_type_len == 2147487745)
2322 obj.value = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002323 return obj
2324
2325 def __eq__(self, other):
2326 if type(self) != type(other): return False
2327 if self.value != other.value: return False
2328 return True
2329
2330 def __ne__(self, other):
2331 return not self.__eq__(other)
2332
2333 def show(self):
2334 import loxi.pp
2335 return loxi.pp.pp(self)
2336
2337 def pretty_print(self, q):
2338 q.text("ip_dscp {")
2339 with q.group():
2340 with q.indent(2):
2341 q.breakable()
2342 q.text("value = ");
2343 q.text("%#x" % self.value)
2344 q.breakable()
2345 q.text('}')
2346
2347class ip_dscp_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002348 type_len = 2147488002
Rich Lanec2ee4b82013-04-24 17:12:38 -07002349
2350 def __init__(self, value=None, value_mask=None):
2351 if value != None:
2352 self.value = value
2353 else:
2354 self.value = 0
2355 if value_mask != None:
2356 self.value_mask = value_mask
2357 else:
2358 self.value_mask = 0
2359
2360 def pack(self):
2361 packed = []
2362 packed.append(struct.pack("!L", self.type_len))
2363 packed.append(struct.pack("!B", self.value))
2364 packed.append(struct.pack("!B", self.value_mask))
2365 return ''.join(packed)
2366
2367 @staticmethod
2368 def unpack(buf):
2369 obj = ip_dscp_masked()
2370 if type(buf) == loxi.generic_util.OFReader:
2371 reader = buf
2372 else:
2373 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002374 _type_len = reader.read("!L")[0]
2375 assert(_type_len == 2147488002)
2376 obj.value = reader.read("!B")[0]
2377 obj.value_mask = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002378 return obj
2379
2380 def __eq__(self, other):
2381 if type(self) != type(other): return False
2382 if self.value != other.value: return False
2383 if self.value_mask != other.value_mask: return False
2384 return True
2385
2386 def __ne__(self, other):
2387 return not self.__eq__(other)
2388
2389 def show(self):
2390 import loxi.pp
2391 return loxi.pp.pp(self)
2392
2393 def pretty_print(self, q):
2394 q.text("ip_dscp_masked {")
2395 with q.group():
2396 with q.indent(2):
2397 q.breakable()
2398 q.text("value = ");
2399 q.text("%#x" % self.value)
2400 q.text(","); q.breakable()
2401 q.text("value_mask = ");
2402 q.text("%#x" % self.value_mask)
2403 q.breakable()
2404 q.text('}')
2405
2406class ip_ecn(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002407 type_len = 2147488257
Rich Lanec2ee4b82013-04-24 17:12:38 -07002408
2409 def __init__(self, value=None):
2410 if value != None:
2411 self.value = value
2412 else:
2413 self.value = 0
2414
2415 def pack(self):
2416 packed = []
2417 packed.append(struct.pack("!L", self.type_len))
2418 packed.append(struct.pack("!B", self.value))
2419 return ''.join(packed)
2420
2421 @staticmethod
2422 def unpack(buf):
2423 obj = ip_ecn()
2424 if type(buf) == loxi.generic_util.OFReader:
2425 reader = buf
2426 else:
2427 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002428 _type_len = reader.read("!L")[0]
2429 assert(_type_len == 2147488257)
2430 obj.value = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002431 return obj
2432
2433 def __eq__(self, other):
2434 if type(self) != type(other): return False
2435 if self.value != other.value: return False
2436 return True
2437
2438 def __ne__(self, other):
2439 return not self.__eq__(other)
2440
2441 def show(self):
2442 import loxi.pp
2443 return loxi.pp.pp(self)
2444
2445 def pretty_print(self, q):
2446 q.text("ip_ecn {")
2447 with q.group():
2448 with q.indent(2):
2449 q.breakable()
2450 q.text("value = ");
2451 q.text("%#x" % self.value)
2452 q.breakable()
2453 q.text('}')
2454
2455class ip_ecn_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002456 type_len = 2147488514
Rich Lanec2ee4b82013-04-24 17:12:38 -07002457
2458 def __init__(self, value=None, value_mask=None):
2459 if value != None:
2460 self.value = value
2461 else:
2462 self.value = 0
2463 if value_mask != None:
2464 self.value_mask = value_mask
2465 else:
2466 self.value_mask = 0
2467
2468 def pack(self):
2469 packed = []
2470 packed.append(struct.pack("!L", self.type_len))
2471 packed.append(struct.pack("!B", self.value))
2472 packed.append(struct.pack("!B", self.value_mask))
2473 return ''.join(packed)
2474
2475 @staticmethod
2476 def unpack(buf):
2477 obj = ip_ecn_masked()
2478 if type(buf) == loxi.generic_util.OFReader:
2479 reader = buf
2480 else:
2481 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002482 _type_len = reader.read("!L")[0]
2483 assert(_type_len == 2147488514)
2484 obj.value = reader.read("!B")[0]
2485 obj.value_mask = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002486 return obj
2487
2488 def __eq__(self, other):
2489 if type(self) != type(other): return False
2490 if self.value != other.value: return False
2491 if self.value_mask != other.value_mask: return False
2492 return True
2493
2494 def __ne__(self, other):
2495 return not self.__eq__(other)
2496
2497 def show(self):
2498 import loxi.pp
2499 return loxi.pp.pp(self)
2500
2501 def pretty_print(self, q):
2502 q.text("ip_ecn_masked {")
2503 with q.group():
2504 with q.indent(2):
2505 q.breakable()
2506 q.text("value = ");
2507 q.text("%#x" % self.value)
2508 q.text(","); q.breakable()
2509 q.text("value_mask = ");
2510 q.text("%#x" % self.value_mask)
2511 q.breakable()
2512 q.text('}')
2513
2514class ip_proto(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002515 type_len = 2147488769
Rich Lanec2ee4b82013-04-24 17:12:38 -07002516
2517 def __init__(self, value=None):
2518 if value != None:
2519 self.value = value
2520 else:
2521 self.value = 0
2522
2523 def pack(self):
2524 packed = []
2525 packed.append(struct.pack("!L", self.type_len))
2526 packed.append(struct.pack("!B", self.value))
2527 return ''.join(packed)
2528
2529 @staticmethod
2530 def unpack(buf):
2531 obj = ip_proto()
2532 if type(buf) == loxi.generic_util.OFReader:
2533 reader = buf
2534 else:
2535 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002536 _type_len = reader.read("!L")[0]
2537 assert(_type_len == 2147488769)
2538 obj.value = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002539 return obj
2540
2541 def __eq__(self, other):
2542 if type(self) != type(other): return False
2543 if self.value != other.value: return False
2544 return True
2545
2546 def __ne__(self, other):
2547 return not self.__eq__(other)
2548
2549 def show(self):
2550 import loxi.pp
2551 return loxi.pp.pp(self)
2552
2553 def pretty_print(self, q):
2554 q.text("ip_proto {")
2555 with q.group():
2556 with q.indent(2):
2557 q.breakable()
2558 q.text("value = ");
2559 q.text("%#x" % self.value)
2560 q.breakable()
2561 q.text('}')
2562
2563class ip_proto_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002564 type_len = 2147489026
Rich Lanec2ee4b82013-04-24 17:12:38 -07002565
2566 def __init__(self, value=None, value_mask=None):
2567 if value != None:
2568 self.value = value
2569 else:
2570 self.value = 0
2571 if value_mask != None:
2572 self.value_mask = value_mask
2573 else:
2574 self.value_mask = 0
2575
2576 def pack(self):
2577 packed = []
2578 packed.append(struct.pack("!L", self.type_len))
2579 packed.append(struct.pack("!B", self.value))
2580 packed.append(struct.pack("!B", self.value_mask))
2581 return ''.join(packed)
2582
2583 @staticmethod
2584 def unpack(buf):
2585 obj = ip_proto_masked()
2586 if type(buf) == loxi.generic_util.OFReader:
2587 reader = buf
2588 else:
2589 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002590 _type_len = reader.read("!L")[0]
2591 assert(_type_len == 2147489026)
2592 obj.value = reader.read("!B")[0]
2593 obj.value_mask = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002594 return obj
2595
2596 def __eq__(self, other):
2597 if type(self) != type(other): return False
2598 if self.value != other.value: return False
2599 if self.value_mask != other.value_mask: return False
2600 return True
2601
2602 def __ne__(self, other):
2603 return not self.__eq__(other)
2604
2605 def show(self):
2606 import loxi.pp
2607 return loxi.pp.pp(self)
2608
2609 def pretty_print(self, q):
2610 q.text("ip_proto_masked {")
2611 with q.group():
2612 with q.indent(2):
2613 q.breakable()
2614 q.text("value = ");
2615 q.text("%#x" % self.value)
2616 q.text(","); q.breakable()
2617 q.text("value_mask = ");
2618 q.text("%#x" % self.value_mask)
2619 q.breakable()
2620 q.text('}')
2621
2622class ipv4_dst(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002623 type_len = 2147489796
Rich Lanec2ee4b82013-04-24 17:12:38 -07002624
2625 def __init__(self, value=None):
2626 if value != None:
2627 self.value = value
2628 else:
2629 self.value = 0
2630
2631 def pack(self):
2632 packed = []
2633 packed.append(struct.pack("!L", self.type_len))
2634 packed.append(struct.pack("!L", self.value))
2635 return ''.join(packed)
2636
2637 @staticmethod
2638 def unpack(buf):
2639 obj = ipv4_dst()
2640 if type(buf) == loxi.generic_util.OFReader:
2641 reader = buf
2642 else:
2643 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002644 _type_len = reader.read("!L")[0]
2645 assert(_type_len == 2147489796)
2646 obj.value = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002647 return obj
2648
2649 def __eq__(self, other):
2650 if type(self) != type(other): return False
2651 if self.value != other.value: return False
2652 return True
2653
2654 def __ne__(self, other):
2655 return not self.__eq__(other)
2656
2657 def show(self):
2658 import loxi.pp
2659 return loxi.pp.pp(self)
2660
2661 def pretty_print(self, q):
2662 q.text("ipv4_dst {")
2663 with q.group():
2664 with q.indent(2):
2665 q.breakable()
2666 q.text("value = ");
Rich Laned53156a2013-08-05 17:17:33 -07002667 q.text(util.pretty_ipv4(self.value))
Rich Lanec2ee4b82013-04-24 17:12:38 -07002668 q.breakable()
2669 q.text('}')
2670
2671class ipv4_dst_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002672 type_len = 2147490056
Rich Lanec2ee4b82013-04-24 17:12:38 -07002673
2674 def __init__(self, value=None, value_mask=None):
2675 if value != None:
2676 self.value = value
2677 else:
2678 self.value = 0
2679 if value_mask != None:
2680 self.value_mask = value_mask
2681 else:
2682 self.value_mask = 0
2683
2684 def pack(self):
2685 packed = []
2686 packed.append(struct.pack("!L", self.type_len))
2687 packed.append(struct.pack("!L", self.value))
2688 packed.append(struct.pack("!L", self.value_mask))
2689 return ''.join(packed)
2690
2691 @staticmethod
2692 def unpack(buf):
2693 obj = ipv4_dst_masked()
2694 if type(buf) == loxi.generic_util.OFReader:
2695 reader = buf
2696 else:
2697 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002698 _type_len = reader.read("!L")[0]
2699 assert(_type_len == 2147490056)
2700 obj.value = reader.read("!L")[0]
2701 obj.value_mask = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002702 return obj
2703
2704 def __eq__(self, other):
2705 if type(self) != type(other): return False
2706 if self.value != other.value: return False
2707 if self.value_mask != other.value_mask: return False
2708 return True
2709
2710 def __ne__(self, other):
2711 return not self.__eq__(other)
2712
2713 def show(self):
2714 import loxi.pp
2715 return loxi.pp.pp(self)
2716
2717 def pretty_print(self, q):
2718 q.text("ipv4_dst_masked {")
2719 with q.group():
2720 with q.indent(2):
2721 q.breakable()
2722 q.text("value = ");
Rich Laned53156a2013-08-05 17:17:33 -07002723 q.text(util.pretty_ipv4(self.value))
Rich Lanec2ee4b82013-04-24 17:12:38 -07002724 q.text(","); q.breakable()
2725 q.text("value_mask = ");
Rich Laned53156a2013-08-05 17:17:33 -07002726 q.text(util.pretty_ipv4(self.value_mask))
Rich Lanec2ee4b82013-04-24 17:12:38 -07002727 q.breakable()
2728 q.text('}')
2729
2730class ipv4_src(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002731 type_len = 2147489284
Rich Lanec2ee4b82013-04-24 17:12:38 -07002732
2733 def __init__(self, value=None):
2734 if value != None:
2735 self.value = value
2736 else:
2737 self.value = 0
2738
2739 def pack(self):
2740 packed = []
2741 packed.append(struct.pack("!L", self.type_len))
2742 packed.append(struct.pack("!L", self.value))
2743 return ''.join(packed)
2744
2745 @staticmethod
2746 def unpack(buf):
2747 obj = ipv4_src()
2748 if type(buf) == loxi.generic_util.OFReader:
2749 reader = buf
2750 else:
2751 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002752 _type_len = reader.read("!L")[0]
2753 assert(_type_len == 2147489284)
2754 obj.value = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002755 return obj
2756
2757 def __eq__(self, other):
2758 if type(self) != type(other): return False
2759 if self.value != other.value: return False
2760 return True
2761
2762 def __ne__(self, other):
2763 return not self.__eq__(other)
2764
2765 def show(self):
2766 import loxi.pp
2767 return loxi.pp.pp(self)
2768
2769 def pretty_print(self, q):
2770 q.text("ipv4_src {")
2771 with q.group():
2772 with q.indent(2):
2773 q.breakable()
2774 q.text("value = ");
Rich Laned53156a2013-08-05 17:17:33 -07002775 q.text(util.pretty_ipv4(self.value))
Rich Lanec2ee4b82013-04-24 17:12:38 -07002776 q.breakable()
2777 q.text('}')
2778
2779class ipv4_src_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002780 type_len = 2147489544
Rich Lanec2ee4b82013-04-24 17:12:38 -07002781
2782 def __init__(self, value=None, value_mask=None):
2783 if value != None:
2784 self.value = value
2785 else:
2786 self.value = 0
2787 if value_mask != None:
2788 self.value_mask = value_mask
2789 else:
2790 self.value_mask = 0
2791
2792 def pack(self):
2793 packed = []
2794 packed.append(struct.pack("!L", self.type_len))
2795 packed.append(struct.pack("!L", self.value))
2796 packed.append(struct.pack("!L", self.value_mask))
2797 return ''.join(packed)
2798
2799 @staticmethod
2800 def unpack(buf):
2801 obj = ipv4_src_masked()
2802 if type(buf) == loxi.generic_util.OFReader:
2803 reader = buf
2804 else:
2805 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002806 _type_len = reader.read("!L")[0]
2807 assert(_type_len == 2147489544)
2808 obj.value = reader.read("!L")[0]
2809 obj.value_mask = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002810 return obj
2811
2812 def __eq__(self, other):
2813 if type(self) != type(other): return False
2814 if self.value != other.value: return False
2815 if self.value_mask != other.value_mask: return False
2816 return True
2817
2818 def __ne__(self, other):
2819 return not self.__eq__(other)
2820
2821 def show(self):
2822 import loxi.pp
2823 return loxi.pp.pp(self)
2824
2825 def pretty_print(self, q):
2826 q.text("ipv4_src_masked {")
2827 with q.group():
2828 with q.indent(2):
2829 q.breakable()
2830 q.text("value = ");
Rich Laned53156a2013-08-05 17:17:33 -07002831 q.text(util.pretty_ipv4(self.value))
Rich Lanec2ee4b82013-04-24 17:12:38 -07002832 q.text(","); q.breakable()
2833 q.text("value_mask = ");
Rich Laned53156a2013-08-05 17:17:33 -07002834 q.text(util.pretty_ipv4(self.value_mask))
Rich Lanec2ee4b82013-04-24 17:12:38 -07002835 q.breakable()
2836 q.text('}')
2837
2838class ipv6_dst(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002839 type_len = 2147497488
Rich Lanec2ee4b82013-04-24 17:12:38 -07002840
2841 def __init__(self, value=None):
2842 if value != None:
2843 self.value = value
2844 else:
2845 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
2846
2847 def pack(self):
2848 packed = []
2849 packed.append(struct.pack("!L", self.type_len))
2850 packed.append(struct.pack("!16s", self.value))
2851 return ''.join(packed)
2852
2853 @staticmethod
2854 def unpack(buf):
2855 obj = ipv6_dst()
2856 if type(buf) == loxi.generic_util.OFReader:
2857 reader = buf
2858 else:
2859 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002860 _type_len = reader.read("!L")[0]
2861 assert(_type_len == 2147497488)
Rich Lanec2ee4b82013-04-24 17:12:38 -07002862 obj.value = reader.read('!16s')[0]
2863 return obj
2864
2865 def __eq__(self, other):
2866 if type(self) != type(other): return False
2867 if self.value != other.value: return False
2868 return True
2869
2870 def __ne__(self, other):
2871 return not self.__eq__(other)
2872
2873 def show(self):
2874 import loxi.pp
2875 return loxi.pp.pp(self)
2876
2877 def pretty_print(self, q):
2878 q.text("ipv6_dst {")
2879 with q.group():
2880 with q.indent(2):
2881 q.breakable()
2882 q.text("value = ");
2883 q.pp(self.value)
2884 q.breakable()
2885 q.text('}')
2886
2887class ipv6_dst_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002888 type_len = 2147497760
Rich Lanec2ee4b82013-04-24 17:12:38 -07002889
2890 def __init__(self, value=None, value_mask=None):
2891 if value != None:
2892 self.value = value
2893 else:
2894 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
2895 if value_mask != None:
2896 self.value_mask = value_mask
2897 else:
2898 self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
2899
2900 def pack(self):
2901 packed = []
2902 packed.append(struct.pack("!L", self.type_len))
2903 packed.append(struct.pack("!16s", self.value))
2904 packed.append(struct.pack("!16s", self.value_mask))
2905 return ''.join(packed)
2906
2907 @staticmethod
2908 def unpack(buf):
2909 obj = ipv6_dst_masked()
2910 if type(buf) == loxi.generic_util.OFReader:
2911 reader = buf
2912 else:
2913 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002914 _type_len = reader.read("!L")[0]
2915 assert(_type_len == 2147497760)
Rich Lanec2ee4b82013-04-24 17:12:38 -07002916 obj.value = reader.read('!16s')[0]
2917 obj.value_mask = reader.read('!16s')[0]
2918 return obj
2919
2920 def __eq__(self, other):
2921 if type(self) != type(other): return False
2922 if self.value != other.value: return False
2923 if self.value_mask != other.value_mask: return False
2924 return True
2925
2926 def __ne__(self, other):
2927 return not self.__eq__(other)
2928
2929 def show(self):
2930 import loxi.pp
2931 return loxi.pp.pp(self)
2932
2933 def pretty_print(self, q):
2934 q.text("ipv6_dst_masked {")
2935 with q.group():
2936 with q.indent(2):
2937 q.breakable()
2938 q.text("value = ");
2939 q.pp(self.value)
2940 q.text(","); q.breakable()
2941 q.text("value_mask = ");
2942 q.pp(self.value_mask)
2943 q.breakable()
2944 q.text('}')
2945
2946class ipv6_flabel(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002947 type_len = 2147497988
Rich Lanec2ee4b82013-04-24 17:12:38 -07002948
2949 def __init__(self, value=None):
2950 if value != None:
2951 self.value = value
2952 else:
2953 self.value = 0
2954
2955 def pack(self):
2956 packed = []
2957 packed.append(struct.pack("!L", self.type_len))
2958 packed.append(struct.pack("!L", self.value))
2959 return ''.join(packed)
2960
2961 @staticmethod
2962 def unpack(buf):
2963 obj = ipv6_flabel()
2964 if type(buf) == loxi.generic_util.OFReader:
2965 reader = buf
2966 else:
2967 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07002968 _type_len = reader.read("!L")[0]
2969 assert(_type_len == 2147497988)
2970 obj.value = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07002971 return obj
2972
2973 def __eq__(self, other):
2974 if type(self) != type(other): return False
2975 if self.value != other.value: return False
2976 return True
2977
2978 def __ne__(self, other):
2979 return not self.__eq__(other)
2980
2981 def show(self):
2982 import loxi.pp
2983 return loxi.pp.pp(self)
2984
2985 def pretty_print(self, q):
2986 q.text("ipv6_flabel {")
2987 with q.group():
2988 with q.indent(2):
2989 q.breakable()
2990 q.text("value = ");
2991 q.text("%#x" % self.value)
2992 q.breakable()
2993 q.text('}')
2994
2995class ipv6_flabel_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07002996 type_len = 2147498248
Rich Lanec2ee4b82013-04-24 17:12:38 -07002997
2998 def __init__(self, value=None, value_mask=None):
2999 if value != None:
3000 self.value = value
3001 else:
3002 self.value = 0
3003 if value_mask != None:
3004 self.value_mask = value_mask
3005 else:
3006 self.value_mask = 0
3007
3008 def pack(self):
3009 packed = []
3010 packed.append(struct.pack("!L", self.type_len))
3011 packed.append(struct.pack("!L", self.value))
3012 packed.append(struct.pack("!L", self.value_mask))
3013 return ''.join(packed)
3014
3015 @staticmethod
3016 def unpack(buf):
3017 obj = ipv6_flabel_masked()
3018 if type(buf) == loxi.generic_util.OFReader:
3019 reader = buf
3020 else:
3021 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003022 _type_len = reader.read("!L")[0]
3023 assert(_type_len == 2147498248)
3024 obj.value = reader.read("!L")[0]
3025 obj.value_mask = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07003026 return obj
3027
3028 def __eq__(self, other):
3029 if type(self) != type(other): return False
3030 if self.value != other.value: return False
3031 if self.value_mask != other.value_mask: return False
3032 return True
3033
3034 def __ne__(self, other):
3035 return not self.__eq__(other)
3036
3037 def show(self):
3038 import loxi.pp
3039 return loxi.pp.pp(self)
3040
3041 def pretty_print(self, q):
3042 q.text("ipv6_flabel_masked {")
3043 with q.group():
3044 with q.indent(2):
3045 q.breakable()
3046 q.text("value = ");
3047 q.text("%#x" % self.value)
3048 q.text(","); q.breakable()
3049 q.text("value_mask = ");
3050 q.text("%#x" % self.value_mask)
3051 q.breakable()
3052 q.text('}')
3053
3054class ipv6_nd_sll(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003055 type_len = 2147500038
Rich Lanec2ee4b82013-04-24 17:12:38 -07003056
3057 def __init__(self, value=None):
3058 if value != None:
3059 self.value = value
3060 else:
3061 self.value = [0,0,0,0,0,0]
3062
3063 def pack(self):
3064 packed = []
3065 packed.append(struct.pack("!L", self.type_len))
3066 packed.append(struct.pack("!6B", *self.value))
3067 return ''.join(packed)
3068
3069 @staticmethod
3070 def unpack(buf):
3071 obj = ipv6_nd_sll()
3072 if type(buf) == loxi.generic_util.OFReader:
3073 reader = buf
3074 else:
3075 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003076 _type_len = reader.read("!L")[0]
3077 assert(_type_len == 2147500038)
Rich Lanec2ee4b82013-04-24 17:12:38 -07003078 obj.value = list(reader.read('!6B'))
3079 return obj
3080
3081 def __eq__(self, other):
3082 if type(self) != type(other): return False
3083 if self.value != other.value: return False
3084 return True
3085
3086 def __ne__(self, other):
3087 return not self.__eq__(other)
3088
3089 def show(self):
3090 import loxi.pp
3091 return loxi.pp.pp(self)
3092
3093 def pretty_print(self, q):
3094 q.text("ipv6_nd_sll {")
3095 with q.group():
3096 with q.indent(2):
3097 q.breakable()
3098 q.text("value = ");
3099 q.text(util.pretty_mac(self.value))
3100 q.breakable()
3101 q.text('}')
3102
3103class ipv6_nd_sll_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003104 type_len = 2147500300
Rich Lanec2ee4b82013-04-24 17:12:38 -07003105
3106 def __init__(self, value=None, value_mask=None):
3107 if value != None:
3108 self.value = value
3109 else:
3110 self.value = [0,0,0,0,0,0]
3111 if value_mask != None:
3112 self.value_mask = value_mask
3113 else:
3114 self.value_mask = [0,0,0,0,0,0]
3115
3116 def pack(self):
3117 packed = []
3118 packed.append(struct.pack("!L", self.type_len))
3119 packed.append(struct.pack("!6B", *self.value))
3120 packed.append(struct.pack("!6B", *self.value_mask))
3121 return ''.join(packed)
3122
3123 @staticmethod
3124 def unpack(buf):
3125 obj = ipv6_nd_sll_masked()
3126 if type(buf) == loxi.generic_util.OFReader:
3127 reader = buf
3128 else:
3129 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003130 _type_len = reader.read("!L")[0]
3131 assert(_type_len == 2147500300)
Rich Lanec2ee4b82013-04-24 17:12:38 -07003132 obj.value = list(reader.read('!6B'))
3133 obj.value_mask = list(reader.read('!6B'))
3134 return obj
3135
3136 def __eq__(self, other):
3137 if type(self) != type(other): return False
3138 if self.value != other.value: return False
3139 if self.value_mask != other.value_mask: return False
3140 return True
3141
3142 def __ne__(self, other):
3143 return not self.__eq__(other)
3144
3145 def show(self):
3146 import loxi.pp
3147 return loxi.pp.pp(self)
3148
3149 def pretty_print(self, q):
3150 q.text("ipv6_nd_sll_masked {")
3151 with q.group():
3152 with q.indent(2):
3153 q.breakable()
3154 q.text("value = ");
3155 q.text(util.pretty_mac(self.value))
3156 q.text(","); q.breakable()
3157 q.text("value_mask = ");
3158 q.text(util.pretty_mac(self.value_mask))
3159 q.breakable()
3160 q.text('}')
3161
3162class ipv6_nd_target(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003163 type_len = 2147499536
Rich Lanec2ee4b82013-04-24 17:12:38 -07003164
3165 def __init__(self, value=None):
3166 if value != None:
3167 self.value = value
3168 else:
3169 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
3170
3171 def pack(self):
3172 packed = []
3173 packed.append(struct.pack("!L", self.type_len))
3174 packed.append(struct.pack("!16s", self.value))
3175 return ''.join(packed)
3176
3177 @staticmethod
3178 def unpack(buf):
3179 obj = ipv6_nd_target()
3180 if type(buf) == loxi.generic_util.OFReader:
3181 reader = buf
3182 else:
3183 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003184 _type_len = reader.read("!L")[0]
3185 assert(_type_len == 2147499536)
Rich Lanec2ee4b82013-04-24 17:12:38 -07003186 obj.value = reader.read('!16s')[0]
3187 return obj
3188
3189 def __eq__(self, other):
3190 if type(self) != type(other): return False
3191 if self.value != other.value: return False
3192 return True
3193
3194 def __ne__(self, other):
3195 return not self.__eq__(other)
3196
3197 def show(self):
3198 import loxi.pp
3199 return loxi.pp.pp(self)
3200
3201 def pretty_print(self, q):
3202 q.text("ipv6_nd_target {")
3203 with q.group():
3204 with q.indent(2):
3205 q.breakable()
3206 q.text("value = ");
3207 q.pp(self.value)
3208 q.breakable()
3209 q.text('}')
3210
3211class ipv6_nd_target_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003212 type_len = 2147499808
Rich Lanec2ee4b82013-04-24 17:12:38 -07003213
3214 def __init__(self, value=None, value_mask=None):
3215 if value != None:
3216 self.value = value
3217 else:
3218 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
3219 if value_mask != None:
3220 self.value_mask = value_mask
3221 else:
3222 self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
3223
3224 def pack(self):
3225 packed = []
3226 packed.append(struct.pack("!L", self.type_len))
3227 packed.append(struct.pack("!16s", self.value))
3228 packed.append(struct.pack("!16s", self.value_mask))
3229 return ''.join(packed)
3230
3231 @staticmethod
3232 def unpack(buf):
3233 obj = ipv6_nd_target_masked()
3234 if type(buf) == loxi.generic_util.OFReader:
3235 reader = buf
3236 else:
3237 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003238 _type_len = reader.read("!L")[0]
3239 assert(_type_len == 2147499808)
Rich Lanec2ee4b82013-04-24 17:12:38 -07003240 obj.value = reader.read('!16s')[0]
3241 obj.value_mask = reader.read('!16s')[0]
3242 return obj
3243
3244 def __eq__(self, other):
3245 if type(self) != type(other): return False
3246 if self.value != other.value: return False
3247 if self.value_mask != other.value_mask: return False
3248 return True
3249
3250 def __ne__(self, other):
3251 return not self.__eq__(other)
3252
3253 def show(self):
3254 import loxi.pp
3255 return loxi.pp.pp(self)
3256
3257 def pretty_print(self, q):
3258 q.text("ipv6_nd_target_masked {")
3259 with q.group():
3260 with q.indent(2):
3261 q.breakable()
3262 q.text("value = ");
3263 q.pp(self.value)
3264 q.text(","); q.breakable()
3265 q.text("value_mask = ");
3266 q.pp(self.value_mask)
3267 q.breakable()
3268 q.text('}')
3269
3270class ipv6_nd_tll(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003271 type_len = 2147500550
Rich Lanec2ee4b82013-04-24 17:12:38 -07003272
3273 def __init__(self, value=None):
3274 if value != None:
3275 self.value = value
3276 else:
3277 self.value = [0,0,0,0,0,0]
3278
3279 def pack(self):
3280 packed = []
3281 packed.append(struct.pack("!L", self.type_len))
3282 packed.append(struct.pack("!6B", *self.value))
3283 return ''.join(packed)
3284
3285 @staticmethod
3286 def unpack(buf):
3287 obj = ipv6_nd_tll()
3288 if type(buf) == loxi.generic_util.OFReader:
3289 reader = buf
3290 else:
3291 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003292 _type_len = reader.read("!L")[0]
3293 assert(_type_len == 2147500550)
Rich Lanec2ee4b82013-04-24 17:12:38 -07003294 obj.value = list(reader.read('!6B'))
3295 return obj
3296
3297 def __eq__(self, other):
3298 if type(self) != type(other): return False
3299 if self.value != other.value: return False
3300 return True
3301
3302 def __ne__(self, other):
3303 return not self.__eq__(other)
3304
3305 def show(self):
3306 import loxi.pp
3307 return loxi.pp.pp(self)
3308
3309 def pretty_print(self, q):
3310 q.text("ipv6_nd_tll {")
3311 with q.group():
3312 with q.indent(2):
3313 q.breakable()
3314 q.text("value = ");
3315 q.text(util.pretty_mac(self.value))
3316 q.breakable()
3317 q.text('}')
3318
3319class ipv6_nd_tll_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003320 type_len = 2147500812
Rich Lanec2ee4b82013-04-24 17:12:38 -07003321
3322 def __init__(self, value=None, value_mask=None):
3323 if value != None:
3324 self.value = value
3325 else:
3326 self.value = [0,0,0,0,0,0]
3327 if value_mask != None:
3328 self.value_mask = value_mask
3329 else:
3330 self.value_mask = [0,0,0,0,0,0]
3331
3332 def pack(self):
3333 packed = []
3334 packed.append(struct.pack("!L", self.type_len))
3335 packed.append(struct.pack("!6B", *self.value))
3336 packed.append(struct.pack("!6B", *self.value_mask))
3337 return ''.join(packed)
3338
3339 @staticmethod
3340 def unpack(buf):
3341 obj = ipv6_nd_tll_masked()
3342 if type(buf) == loxi.generic_util.OFReader:
3343 reader = buf
3344 else:
3345 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003346 _type_len = reader.read("!L")[0]
3347 assert(_type_len == 2147500812)
Rich Lanec2ee4b82013-04-24 17:12:38 -07003348 obj.value = list(reader.read('!6B'))
3349 obj.value_mask = list(reader.read('!6B'))
3350 return obj
3351
3352 def __eq__(self, other):
3353 if type(self) != type(other): return False
3354 if self.value != other.value: return False
3355 if self.value_mask != other.value_mask: return False
3356 return True
3357
3358 def __ne__(self, other):
3359 return not self.__eq__(other)
3360
3361 def show(self):
3362 import loxi.pp
3363 return loxi.pp.pp(self)
3364
3365 def pretty_print(self, q):
3366 q.text("ipv6_nd_tll_masked {")
3367 with q.group():
3368 with q.indent(2):
3369 q.breakable()
3370 q.text("value = ");
3371 q.text(util.pretty_mac(self.value))
3372 q.text(","); q.breakable()
3373 q.text("value_mask = ");
3374 q.text(util.pretty_mac(self.value_mask))
3375 q.breakable()
3376 q.text('}')
3377
3378class ipv6_src(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003379 type_len = 2147496976
Rich Lanec2ee4b82013-04-24 17:12:38 -07003380
3381 def __init__(self, value=None):
3382 if value != None:
3383 self.value = value
3384 else:
3385 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
3386
3387 def pack(self):
3388 packed = []
3389 packed.append(struct.pack("!L", self.type_len))
3390 packed.append(struct.pack("!16s", self.value))
3391 return ''.join(packed)
3392
3393 @staticmethod
3394 def unpack(buf):
3395 obj = ipv6_src()
3396 if type(buf) == loxi.generic_util.OFReader:
3397 reader = buf
3398 else:
3399 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003400 _type_len = reader.read("!L")[0]
3401 assert(_type_len == 2147496976)
Rich Lanec2ee4b82013-04-24 17:12:38 -07003402 obj.value = reader.read('!16s')[0]
3403 return obj
3404
3405 def __eq__(self, other):
3406 if type(self) != type(other): return False
3407 if self.value != other.value: return False
3408 return True
3409
3410 def __ne__(self, other):
3411 return not self.__eq__(other)
3412
3413 def show(self):
3414 import loxi.pp
3415 return loxi.pp.pp(self)
3416
3417 def pretty_print(self, q):
3418 q.text("ipv6_src {")
3419 with q.group():
3420 with q.indent(2):
3421 q.breakable()
3422 q.text("value = ");
3423 q.pp(self.value)
3424 q.breakable()
3425 q.text('}')
3426
3427class ipv6_src_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003428 type_len = 2147497248
Rich Lanec2ee4b82013-04-24 17:12:38 -07003429
3430 def __init__(self, value=None, value_mask=None):
3431 if value != None:
3432 self.value = value
3433 else:
3434 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
3435 if value_mask != None:
3436 self.value_mask = value_mask
3437 else:
3438 self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
3439
3440 def pack(self):
3441 packed = []
3442 packed.append(struct.pack("!L", self.type_len))
3443 packed.append(struct.pack("!16s", self.value))
3444 packed.append(struct.pack("!16s", self.value_mask))
3445 return ''.join(packed)
3446
3447 @staticmethod
3448 def unpack(buf):
3449 obj = ipv6_src_masked()
3450 if type(buf) == loxi.generic_util.OFReader:
3451 reader = buf
3452 else:
3453 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003454 _type_len = reader.read("!L")[0]
3455 assert(_type_len == 2147497248)
Rich Lanec2ee4b82013-04-24 17:12:38 -07003456 obj.value = reader.read('!16s')[0]
3457 obj.value_mask = reader.read('!16s')[0]
3458 return obj
3459
3460 def __eq__(self, other):
3461 if type(self) != type(other): return False
3462 if self.value != other.value: return False
3463 if self.value_mask != other.value_mask: return False
3464 return True
3465
3466 def __ne__(self, other):
3467 return not self.__eq__(other)
3468
3469 def show(self):
3470 import loxi.pp
3471 return loxi.pp.pp(self)
3472
3473 def pretty_print(self, q):
3474 q.text("ipv6_src_masked {")
3475 with q.group():
3476 with q.indent(2):
3477 q.breakable()
3478 q.text("value = ");
3479 q.pp(self.value)
3480 q.text(","); q.breakable()
3481 q.text("value_mask = ");
3482 q.pp(self.value_mask)
3483 q.breakable()
3484 q.text('}')
3485
3486class metadata(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003487 type_len = 2147484680
Rich Lanec2ee4b82013-04-24 17:12:38 -07003488
3489 def __init__(self, value=None):
3490 if value != None:
3491 self.value = value
3492 else:
3493 self.value = 0
3494
3495 def pack(self):
3496 packed = []
3497 packed.append(struct.pack("!L", self.type_len))
3498 packed.append(struct.pack("!Q", self.value))
3499 return ''.join(packed)
3500
3501 @staticmethod
3502 def unpack(buf):
3503 obj = metadata()
3504 if type(buf) == loxi.generic_util.OFReader:
3505 reader = buf
3506 else:
3507 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003508 _type_len = reader.read("!L")[0]
3509 assert(_type_len == 2147484680)
3510 obj.value = reader.read("!Q")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07003511 return obj
3512
3513 def __eq__(self, other):
3514 if type(self) != type(other): return False
3515 if self.value != other.value: return False
3516 return True
3517
3518 def __ne__(self, other):
3519 return not self.__eq__(other)
3520
3521 def show(self):
3522 import loxi.pp
3523 return loxi.pp.pp(self)
3524
3525 def pretty_print(self, q):
3526 q.text("metadata {")
3527 with q.group():
3528 with q.indent(2):
3529 q.breakable()
3530 q.text("value = ");
3531 q.text("%#x" % self.value)
3532 q.breakable()
3533 q.text('}')
3534
3535class metadata_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003536 type_len = 2147484944
Rich Lanec2ee4b82013-04-24 17:12:38 -07003537
3538 def __init__(self, value=None, value_mask=None):
3539 if value != None:
3540 self.value = value
3541 else:
3542 self.value = 0
3543 if value_mask != None:
3544 self.value_mask = value_mask
3545 else:
3546 self.value_mask = 0
3547
3548 def pack(self):
3549 packed = []
3550 packed.append(struct.pack("!L", self.type_len))
3551 packed.append(struct.pack("!Q", self.value))
3552 packed.append(struct.pack("!Q", self.value_mask))
3553 return ''.join(packed)
3554
3555 @staticmethod
3556 def unpack(buf):
3557 obj = metadata_masked()
3558 if type(buf) == loxi.generic_util.OFReader:
3559 reader = buf
3560 else:
3561 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003562 _type_len = reader.read("!L")[0]
3563 assert(_type_len == 2147484944)
3564 obj.value = reader.read("!Q")[0]
3565 obj.value_mask = reader.read("!Q")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07003566 return obj
3567
3568 def __eq__(self, other):
3569 if type(self) != type(other): return False
3570 if self.value != other.value: return False
3571 if self.value_mask != other.value_mask: return False
3572 return True
3573
3574 def __ne__(self, other):
3575 return not self.__eq__(other)
3576
3577 def show(self):
3578 import loxi.pp
3579 return loxi.pp.pp(self)
3580
3581 def pretty_print(self, q):
3582 q.text("metadata_masked {")
3583 with q.group():
3584 with q.indent(2):
3585 q.breakable()
3586 q.text("value = ");
3587 q.text("%#x" % self.value)
3588 q.text(","); q.breakable()
3589 q.text("value_mask = ");
3590 q.text("%#x" % self.value_mask)
3591 q.breakable()
3592 q.text('}')
3593
3594class mpls_label(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003595 type_len = 2147501060
Rich Lanec2ee4b82013-04-24 17:12:38 -07003596
3597 def __init__(self, value=None):
3598 if value != None:
3599 self.value = value
3600 else:
3601 self.value = 0
3602
3603 def pack(self):
3604 packed = []
3605 packed.append(struct.pack("!L", self.type_len))
3606 packed.append(struct.pack("!L", self.value))
3607 return ''.join(packed)
3608
3609 @staticmethod
3610 def unpack(buf):
3611 obj = mpls_label()
3612 if type(buf) == loxi.generic_util.OFReader:
3613 reader = buf
3614 else:
3615 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003616 _type_len = reader.read("!L")[0]
3617 assert(_type_len == 2147501060)
3618 obj.value = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07003619 return obj
3620
3621 def __eq__(self, other):
3622 if type(self) != type(other): return False
3623 if self.value != other.value: return False
3624 return True
3625
3626 def __ne__(self, other):
3627 return not self.__eq__(other)
3628
3629 def show(self):
3630 import loxi.pp
3631 return loxi.pp.pp(self)
3632
3633 def pretty_print(self, q):
3634 q.text("mpls_label {")
3635 with q.group():
3636 with q.indent(2):
3637 q.breakable()
3638 q.text("value = ");
3639 q.text("%#x" % self.value)
3640 q.breakable()
3641 q.text('}')
3642
3643class mpls_label_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003644 type_len = 2147501320
Rich Lanec2ee4b82013-04-24 17:12:38 -07003645
3646 def __init__(self, value=None, value_mask=None):
3647 if value != None:
3648 self.value = value
3649 else:
3650 self.value = 0
3651 if value_mask != None:
3652 self.value_mask = value_mask
3653 else:
3654 self.value_mask = 0
3655
3656 def pack(self):
3657 packed = []
3658 packed.append(struct.pack("!L", self.type_len))
3659 packed.append(struct.pack("!L", self.value))
3660 packed.append(struct.pack("!L", self.value_mask))
3661 return ''.join(packed)
3662
3663 @staticmethod
3664 def unpack(buf):
3665 obj = mpls_label_masked()
3666 if type(buf) == loxi.generic_util.OFReader:
3667 reader = buf
3668 else:
3669 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003670 _type_len = reader.read("!L")[0]
3671 assert(_type_len == 2147501320)
3672 obj.value = reader.read("!L")[0]
3673 obj.value_mask = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07003674 return obj
3675
3676 def __eq__(self, other):
3677 if type(self) != type(other): return False
3678 if self.value != other.value: return False
3679 if self.value_mask != other.value_mask: return False
3680 return True
3681
3682 def __ne__(self, other):
3683 return not self.__eq__(other)
3684
3685 def show(self):
3686 import loxi.pp
3687 return loxi.pp.pp(self)
3688
3689 def pretty_print(self, q):
3690 q.text("mpls_label_masked {")
3691 with q.group():
3692 with q.indent(2):
3693 q.breakable()
3694 q.text("value = ");
3695 q.text("%#x" % self.value)
3696 q.text(","); q.breakable()
3697 q.text("value_mask = ");
3698 q.text("%#x" % self.value_mask)
3699 q.breakable()
3700 q.text('}')
3701
3702class mpls_tc(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003703 type_len = 2147501569
Rich Lanec2ee4b82013-04-24 17:12:38 -07003704
3705 def __init__(self, value=None):
3706 if value != None:
3707 self.value = value
3708 else:
3709 self.value = 0
3710
3711 def pack(self):
3712 packed = []
3713 packed.append(struct.pack("!L", self.type_len))
3714 packed.append(struct.pack("!B", self.value))
3715 return ''.join(packed)
3716
3717 @staticmethod
3718 def unpack(buf):
3719 obj = mpls_tc()
3720 if type(buf) == loxi.generic_util.OFReader:
3721 reader = buf
3722 else:
3723 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003724 _type_len = reader.read("!L")[0]
3725 assert(_type_len == 2147501569)
3726 obj.value = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07003727 return obj
3728
3729 def __eq__(self, other):
3730 if type(self) != type(other): return False
3731 if self.value != other.value: return False
3732 return True
3733
3734 def __ne__(self, other):
3735 return not self.__eq__(other)
3736
3737 def show(self):
3738 import loxi.pp
3739 return loxi.pp.pp(self)
3740
3741 def pretty_print(self, q):
3742 q.text("mpls_tc {")
3743 with q.group():
3744 with q.indent(2):
3745 q.breakable()
3746 q.text("value = ");
3747 q.text("%#x" % self.value)
3748 q.breakable()
3749 q.text('}')
3750
3751class mpls_tc_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003752 type_len = 2147501826
Rich Lanec2ee4b82013-04-24 17:12:38 -07003753
3754 def __init__(self, value=None, value_mask=None):
3755 if value != None:
3756 self.value = value
3757 else:
3758 self.value = 0
3759 if value_mask != None:
3760 self.value_mask = value_mask
3761 else:
3762 self.value_mask = 0
3763
3764 def pack(self):
3765 packed = []
3766 packed.append(struct.pack("!L", self.type_len))
3767 packed.append(struct.pack("!B", self.value))
3768 packed.append(struct.pack("!B", self.value_mask))
3769 return ''.join(packed)
3770
3771 @staticmethod
3772 def unpack(buf):
3773 obj = mpls_tc_masked()
3774 if type(buf) == loxi.generic_util.OFReader:
3775 reader = buf
3776 else:
3777 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003778 _type_len = reader.read("!L")[0]
3779 assert(_type_len == 2147501826)
3780 obj.value = reader.read("!B")[0]
3781 obj.value_mask = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07003782 return obj
3783
3784 def __eq__(self, other):
3785 if type(self) != type(other): return False
3786 if self.value != other.value: return False
3787 if self.value_mask != other.value_mask: return False
3788 return True
3789
3790 def __ne__(self, other):
3791 return not self.__eq__(other)
3792
3793 def show(self):
3794 import loxi.pp
3795 return loxi.pp.pp(self)
3796
3797 def pretty_print(self, q):
3798 q.text("mpls_tc_masked {")
3799 with q.group():
3800 with q.indent(2):
3801 q.breakable()
3802 q.text("value = ");
3803 q.text("%#x" % self.value)
3804 q.text(","); q.breakable()
3805 q.text("value_mask = ");
3806 q.text("%#x" % self.value_mask)
3807 q.breakable()
3808 q.text('}')
3809
3810class sctp_dst(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003811 type_len = 2147492866
Rich Lanec2ee4b82013-04-24 17:12:38 -07003812
3813 def __init__(self, value=None):
3814 if value != None:
3815 self.value = value
3816 else:
3817 self.value = 0
3818
3819 def pack(self):
3820 packed = []
3821 packed.append(struct.pack("!L", self.type_len))
3822 packed.append(struct.pack("!H", self.value))
3823 return ''.join(packed)
3824
3825 @staticmethod
3826 def unpack(buf):
3827 obj = sctp_dst()
3828 if type(buf) == loxi.generic_util.OFReader:
3829 reader = buf
3830 else:
3831 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003832 _type_len = reader.read("!L")[0]
3833 assert(_type_len == 2147492866)
3834 obj.value = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07003835 return obj
3836
3837 def __eq__(self, other):
3838 if type(self) != type(other): return False
3839 if self.value != other.value: return False
3840 return True
3841
3842 def __ne__(self, other):
3843 return not self.__eq__(other)
3844
3845 def show(self):
3846 import loxi.pp
3847 return loxi.pp.pp(self)
3848
3849 def pretty_print(self, q):
3850 q.text("sctp_dst {")
3851 with q.group():
3852 with q.indent(2):
3853 q.breakable()
3854 q.text("value = ");
3855 q.text("%#x" % self.value)
3856 q.breakable()
3857 q.text('}')
3858
3859class sctp_dst_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003860 type_len = 2147493124
Rich Lanec2ee4b82013-04-24 17:12:38 -07003861
3862 def __init__(self, value=None, value_mask=None):
3863 if value != None:
3864 self.value = value
3865 else:
3866 self.value = 0
3867 if value_mask != None:
3868 self.value_mask = value_mask
3869 else:
3870 self.value_mask = 0
3871
3872 def pack(self):
3873 packed = []
3874 packed.append(struct.pack("!L", self.type_len))
3875 packed.append(struct.pack("!H", self.value))
3876 packed.append(struct.pack("!H", self.value_mask))
3877 return ''.join(packed)
3878
3879 @staticmethod
3880 def unpack(buf):
3881 obj = sctp_dst_masked()
3882 if type(buf) == loxi.generic_util.OFReader:
3883 reader = buf
3884 else:
3885 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003886 _type_len = reader.read("!L")[0]
3887 assert(_type_len == 2147493124)
3888 obj.value = reader.read("!H")[0]
3889 obj.value_mask = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07003890 return obj
3891
3892 def __eq__(self, other):
3893 if type(self) != type(other): return False
3894 if self.value != other.value: return False
3895 if self.value_mask != other.value_mask: return False
3896 return True
3897
3898 def __ne__(self, other):
3899 return not self.__eq__(other)
3900
3901 def show(self):
3902 import loxi.pp
3903 return loxi.pp.pp(self)
3904
3905 def pretty_print(self, q):
3906 q.text("sctp_dst_masked {")
3907 with q.group():
3908 with q.indent(2):
3909 q.breakable()
3910 q.text("value = ");
3911 q.text("%#x" % self.value)
3912 q.text(","); q.breakable()
3913 q.text("value_mask = ");
3914 q.text("%#x" % self.value_mask)
3915 q.breakable()
3916 q.text('}')
3917
3918class sctp_src(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003919 type_len = 2147492354
Rich Lanec2ee4b82013-04-24 17:12:38 -07003920
3921 def __init__(self, value=None):
3922 if value != None:
3923 self.value = value
3924 else:
3925 self.value = 0
3926
3927 def pack(self):
3928 packed = []
3929 packed.append(struct.pack("!L", self.type_len))
3930 packed.append(struct.pack("!H", self.value))
3931 return ''.join(packed)
3932
3933 @staticmethod
3934 def unpack(buf):
3935 obj = sctp_src()
3936 if type(buf) == loxi.generic_util.OFReader:
3937 reader = buf
3938 else:
3939 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003940 _type_len = reader.read("!L")[0]
3941 assert(_type_len == 2147492354)
3942 obj.value = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07003943 return obj
3944
3945 def __eq__(self, other):
3946 if type(self) != type(other): return False
3947 if self.value != other.value: return False
3948 return True
3949
3950 def __ne__(self, other):
3951 return not self.__eq__(other)
3952
3953 def show(self):
3954 import loxi.pp
3955 return loxi.pp.pp(self)
3956
3957 def pretty_print(self, q):
3958 q.text("sctp_src {")
3959 with q.group():
3960 with q.indent(2):
3961 q.breakable()
3962 q.text("value = ");
3963 q.text("%#x" % self.value)
3964 q.breakable()
3965 q.text('}')
3966
3967class sctp_src_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07003968 type_len = 2147492612
Rich Lanec2ee4b82013-04-24 17:12:38 -07003969
3970 def __init__(self, value=None, value_mask=None):
3971 if value != None:
3972 self.value = value
3973 else:
3974 self.value = 0
3975 if value_mask != None:
3976 self.value_mask = value_mask
3977 else:
3978 self.value_mask = 0
3979
3980 def pack(self):
3981 packed = []
3982 packed.append(struct.pack("!L", self.type_len))
3983 packed.append(struct.pack("!H", self.value))
3984 packed.append(struct.pack("!H", self.value_mask))
3985 return ''.join(packed)
3986
3987 @staticmethod
3988 def unpack(buf):
3989 obj = sctp_src_masked()
3990 if type(buf) == loxi.generic_util.OFReader:
3991 reader = buf
3992 else:
3993 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07003994 _type_len = reader.read("!L")[0]
3995 assert(_type_len == 2147492612)
3996 obj.value = reader.read("!H")[0]
3997 obj.value_mask = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07003998 return obj
3999
4000 def __eq__(self, other):
4001 if type(self) != type(other): return False
4002 if self.value != other.value: return False
4003 if self.value_mask != other.value_mask: return False
4004 return True
4005
4006 def __ne__(self, other):
4007 return not self.__eq__(other)
4008
4009 def show(self):
4010 import loxi.pp
4011 return loxi.pp.pp(self)
4012
4013 def pretty_print(self, q):
4014 q.text("sctp_src_masked {")
4015 with q.group():
4016 with q.indent(2):
4017 q.breakable()
4018 q.text("value = ");
4019 q.text("%#x" % self.value)
4020 q.text(","); q.breakable()
4021 q.text("value_mask = ");
4022 q.text("%#x" % self.value_mask)
4023 q.breakable()
4024 q.text('}')
4025
4026class tcp_dst(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004027 type_len = 2147490818
Rich Lanec2ee4b82013-04-24 17:12:38 -07004028
4029 def __init__(self, value=None):
4030 if value != None:
4031 self.value = value
4032 else:
4033 self.value = 0
4034
4035 def pack(self):
4036 packed = []
4037 packed.append(struct.pack("!L", self.type_len))
4038 packed.append(struct.pack("!H", self.value))
4039 return ''.join(packed)
4040
4041 @staticmethod
4042 def unpack(buf):
4043 obj = tcp_dst()
4044 if type(buf) == loxi.generic_util.OFReader:
4045 reader = buf
4046 else:
4047 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004048 _type_len = reader.read("!L")[0]
4049 assert(_type_len == 2147490818)
4050 obj.value = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004051 return obj
4052
4053 def __eq__(self, other):
4054 if type(self) != type(other): return False
4055 if self.value != other.value: return False
4056 return True
4057
4058 def __ne__(self, other):
4059 return not self.__eq__(other)
4060
4061 def show(self):
4062 import loxi.pp
4063 return loxi.pp.pp(self)
4064
4065 def pretty_print(self, q):
4066 q.text("tcp_dst {")
4067 with q.group():
4068 with q.indent(2):
4069 q.breakable()
4070 q.text("value = ");
4071 q.text("%#x" % self.value)
4072 q.breakable()
4073 q.text('}')
4074
4075class tcp_dst_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004076 type_len = 2147491076
Rich Lanec2ee4b82013-04-24 17:12:38 -07004077
4078 def __init__(self, value=None, value_mask=None):
4079 if value != None:
4080 self.value = value
4081 else:
4082 self.value = 0
4083 if value_mask != None:
4084 self.value_mask = value_mask
4085 else:
4086 self.value_mask = 0
4087
4088 def pack(self):
4089 packed = []
4090 packed.append(struct.pack("!L", self.type_len))
4091 packed.append(struct.pack("!H", self.value))
4092 packed.append(struct.pack("!H", self.value_mask))
4093 return ''.join(packed)
4094
4095 @staticmethod
4096 def unpack(buf):
4097 obj = tcp_dst_masked()
4098 if type(buf) == loxi.generic_util.OFReader:
4099 reader = buf
4100 else:
4101 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004102 _type_len = reader.read("!L")[0]
4103 assert(_type_len == 2147491076)
4104 obj.value = reader.read("!H")[0]
4105 obj.value_mask = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004106 return obj
4107
4108 def __eq__(self, other):
4109 if type(self) != type(other): return False
4110 if self.value != other.value: return False
4111 if self.value_mask != other.value_mask: return False
4112 return True
4113
4114 def __ne__(self, other):
4115 return not self.__eq__(other)
4116
4117 def show(self):
4118 import loxi.pp
4119 return loxi.pp.pp(self)
4120
4121 def pretty_print(self, q):
4122 q.text("tcp_dst_masked {")
4123 with q.group():
4124 with q.indent(2):
4125 q.breakable()
4126 q.text("value = ");
4127 q.text("%#x" % self.value)
4128 q.text(","); q.breakable()
4129 q.text("value_mask = ");
4130 q.text("%#x" % self.value_mask)
4131 q.breakable()
4132 q.text('}')
4133
4134class tcp_src(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004135 type_len = 2147490306
Rich Lanec2ee4b82013-04-24 17:12:38 -07004136
4137 def __init__(self, value=None):
4138 if value != None:
4139 self.value = value
4140 else:
4141 self.value = 0
4142
4143 def pack(self):
4144 packed = []
4145 packed.append(struct.pack("!L", self.type_len))
4146 packed.append(struct.pack("!H", self.value))
4147 return ''.join(packed)
4148
4149 @staticmethod
4150 def unpack(buf):
4151 obj = tcp_src()
4152 if type(buf) == loxi.generic_util.OFReader:
4153 reader = buf
4154 else:
4155 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004156 _type_len = reader.read("!L")[0]
4157 assert(_type_len == 2147490306)
4158 obj.value = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004159 return obj
4160
4161 def __eq__(self, other):
4162 if type(self) != type(other): return False
4163 if self.value != other.value: return False
4164 return True
4165
4166 def __ne__(self, other):
4167 return not self.__eq__(other)
4168
4169 def show(self):
4170 import loxi.pp
4171 return loxi.pp.pp(self)
4172
4173 def pretty_print(self, q):
4174 q.text("tcp_src {")
4175 with q.group():
4176 with q.indent(2):
4177 q.breakable()
4178 q.text("value = ");
4179 q.text("%#x" % self.value)
4180 q.breakable()
4181 q.text('}')
4182
4183class tcp_src_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004184 type_len = 2147490564
Rich Lanec2ee4b82013-04-24 17:12:38 -07004185
4186 def __init__(self, value=None, value_mask=None):
4187 if value != None:
4188 self.value = value
4189 else:
4190 self.value = 0
4191 if value_mask != None:
4192 self.value_mask = value_mask
4193 else:
4194 self.value_mask = 0
4195
4196 def pack(self):
4197 packed = []
4198 packed.append(struct.pack("!L", self.type_len))
4199 packed.append(struct.pack("!H", self.value))
4200 packed.append(struct.pack("!H", self.value_mask))
4201 return ''.join(packed)
4202
4203 @staticmethod
4204 def unpack(buf):
4205 obj = tcp_src_masked()
4206 if type(buf) == loxi.generic_util.OFReader:
4207 reader = buf
4208 else:
4209 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004210 _type_len = reader.read("!L")[0]
4211 assert(_type_len == 2147490564)
4212 obj.value = reader.read("!H")[0]
4213 obj.value_mask = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004214 return obj
4215
4216 def __eq__(self, other):
4217 if type(self) != type(other): return False
4218 if self.value != other.value: return False
4219 if self.value_mask != other.value_mask: return False
4220 return True
4221
4222 def __ne__(self, other):
4223 return not self.__eq__(other)
4224
4225 def show(self):
4226 import loxi.pp
4227 return loxi.pp.pp(self)
4228
4229 def pretty_print(self, q):
4230 q.text("tcp_src_masked {")
4231 with q.group():
4232 with q.indent(2):
4233 q.breakable()
4234 q.text("value = ");
4235 q.text("%#x" % self.value)
4236 q.text(","); q.breakable()
4237 q.text("value_mask = ");
4238 q.text("%#x" % self.value_mask)
4239 q.breakable()
4240 q.text('}')
4241
4242class udp_dst(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004243 type_len = 2147491842
Rich Lanec2ee4b82013-04-24 17:12:38 -07004244
4245 def __init__(self, value=None):
4246 if value != None:
4247 self.value = value
4248 else:
4249 self.value = 0
4250
4251 def pack(self):
4252 packed = []
4253 packed.append(struct.pack("!L", self.type_len))
4254 packed.append(struct.pack("!H", self.value))
4255 return ''.join(packed)
4256
4257 @staticmethod
4258 def unpack(buf):
4259 obj = udp_dst()
4260 if type(buf) == loxi.generic_util.OFReader:
4261 reader = buf
4262 else:
4263 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004264 _type_len = reader.read("!L")[0]
4265 assert(_type_len == 2147491842)
4266 obj.value = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004267 return obj
4268
4269 def __eq__(self, other):
4270 if type(self) != type(other): return False
4271 if self.value != other.value: return False
4272 return True
4273
4274 def __ne__(self, other):
4275 return not self.__eq__(other)
4276
4277 def show(self):
4278 import loxi.pp
4279 return loxi.pp.pp(self)
4280
4281 def pretty_print(self, q):
4282 q.text("udp_dst {")
4283 with q.group():
4284 with q.indent(2):
4285 q.breakable()
4286 q.text("value = ");
4287 q.text("%#x" % self.value)
4288 q.breakable()
4289 q.text('}')
4290
4291class udp_dst_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004292 type_len = 2147492100
Rich Lanec2ee4b82013-04-24 17:12:38 -07004293
4294 def __init__(self, value=None, value_mask=None):
4295 if value != None:
4296 self.value = value
4297 else:
4298 self.value = 0
4299 if value_mask != None:
4300 self.value_mask = value_mask
4301 else:
4302 self.value_mask = 0
4303
4304 def pack(self):
4305 packed = []
4306 packed.append(struct.pack("!L", self.type_len))
4307 packed.append(struct.pack("!H", self.value))
4308 packed.append(struct.pack("!H", self.value_mask))
4309 return ''.join(packed)
4310
4311 @staticmethod
4312 def unpack(buf):
4313 obj = udp_dst_masked()
4314 if type(buf) == loxi.generic_util.OFReader:
4315 reader = buf
4316 else:
4317 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004318 _type_len = reader.read("!L")[0]
4319 assert(_type_len == 2147492100)
4320 obj.value = reader.read("!H")[0]
4321 obj.value_mask = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004322 return obj
4323
4324 def __eq__(self, other):
4325 if type(self) != type(other): return False
4326 if self.value != other.value: return False
4327 if self.value_mask != other.value_mask: return False
4328 return True
4329
4330 def __ne__(self, other):
4331 return not self.__eq__(other)
4332
4333 def show(self):
4334 import loxi.pp
4335 return loxi.pp.pp(self)
4336
4337 def pretty_print(self, q):
4338 q.text("udp_dst_masked {")
4339 with q.group():
4340 with q.indent(2):
4341 q.breakable()
4342 q.text("value = ");
4343 q.text("%#x" % self.value)
4344 q.text(","); q.breakable()
4345 q.text("value_mask = ");
4346 q.text("%#x" % self.value_mask)
4347 q.breakable()
4348 q.text('}')
4349
4350class udp_src(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004351 type_len = 2147491330
Rich Lanec2ee4b82013-04-24 17:12:38 -07004352
4353 def __init__(self, value=None):
4354 if value != None:
4355 self.value = value
4356 else:
4357 self.value = 0
4358
4359 def pack(self):
4360 packed = []
4361 packed.append(struct.pack("!L", self.type_len))
4362 packed.append(struct.pack("!H", self.value))
4363 return ''.join(packed)
4364
4365 @staticmethod
4366 def unpack(buf):
4367 obj = udp_src()
4368 if type(buf) == loxi.generic_util.OFReader:
4369 reader = buf
4370 else:
4371 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004372 _type_len = reader.read("!L")[0]
4373 assert(_type_len == 2147491330)
4374 obj.value = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004375 return obj
4376
4377 def __eq__(self, other):
4378 if type(self) != type(other): return False
4379 if self.value != other.value: return False
4380 return True
4381
4382 def __ne__(self, other):
4383 return not self.__eq__(other)
4384
4385 def show(self):
4386 import loxi.pp
4387 return loxi.pp.pp(self)
4388
4389 def pretty_print(self, q):
4390 q.text("udp_src {")
4391 with q.group():
4392 with q.indent(2):
4393 q.breakable()
4394 q.text("value = ");
4395 q.text("%#x" % self.value)
4396 q.breakable()
4397 q.text('}')
4398
4399class udp_src_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004400 type_len = 2147491588
Rich Lanec2ee4b82013-04-24 17:12:38 -07004401
4402 def __init__(self, value=None, value_mask=None):
4403 if value != None:
4404 self.value = value
4405 else:
4406 self.value = 0
4407 if value_mask != None:
4408 self.value_mask = value_mask
4409 else:
4410 self.value_mask = 0
4411
4412 def pack(self):
4413 packed = []
4414 packed.append(struct.pack("!L", self.type_len))
4415 packed.append(struct.pack("!H", self.value))
4416 packed.append(struct.pack("!H", self.value_mask))
4417 return ''.join(packed)
4418
4419 @staticmethod
4420 def unpack(buf):
4421 obj = udp_src_masked()
4422 if type(buf) == loxi.generic_util.OFReader:
4423 reader = buf
4424 else:
4425 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004426 _type_len = reader.read("!L")[0]
4427 assert(_type_len == 2147491588)
4428 obj.value = reader.read("!H")[0]
4429 obj.value_mask = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004430 return obj
4431
4432 def __eq__(self, other):
4433 if type(self) != type(other): return False
4434 if self.value != other.value: return False
4435 if self.value_mask != other.value_mask: return False
4436 return True
4437
4438 def __ne__(self, other):
4439 return not self.__eq__(other)
4440
4441 def show(self):
4442 import loxi.pp
4443 return loxi.pp.pp(self)
4444
4445 def pretty_print(self, q):
4446 q.text("udp_src_masked {")
4447 with q.group():
4448 with q.indent(2):
4449 q.breakable()
4450 q.text("value = ");
4451 q.text("%#x" % self.value)
4452 q.text(","); q.breakable()
4453 q.text("value_mask = ");
4454 q.text("%#x" % self.value_mask)
4455 q.breakable()
4456 q.text('}')
4457
4458class vlan_pcp(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004459 type_len = 2147487233
Rich Lanec2ee4b82013-04-24 17:12:38 -07004460
4461 def __init__(self, value=None):
4462 if value != None:
4463 self.value = value
4464 else:
4465 self.value = 0
4466
4467 def pack(self):
4468 packed = []
4469 packed.append(struct.pack("!L", self.type_len))
4470 packed.append(struct.pack("!B", self.value))
4471 return ''.join(packed)
4472
4473 @staticmethod
4474 def unpack(buf):
4475 obj = vlan_pcp()
4476 if type(buf) == loxi.generic_util.OFReader:
4477 reader = buf
4478 else:
4479 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004480 _type_len = reader.read("!L")[0]
4481 assert(_type_len == 2147487233)
4482 obj.value = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004483 return obj
4484
4485 def __eq__(self, other):
4486 if type(self) != type(other): return False
4487 if self.value != other.value: return False
4488 return True
4489
4490 def __ne__(self, other):
4491 return not self.__eq__(other)
4492
4493 def show(self):
4494 import loxi.pp
4495 return loxi.pp.pp(self)
4496
4497 def pretty_print(self, q):
4498 q.text("vlan_pcp {")
4499 with q.group():
4500 with q.indent(2):
4501 q.breakable()
4502 q.text("value = ");
4503 q.text("%#x" % self.value)
4504 q.breakable()
4505 q.text('}')
4506
4507class vlan_pcp_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004508 type_len = 2147487490
Rich Lanec2ee4b82013-04-24 17:12:38 -07004509
4510 def __init__(self, value=None, value_mask=None):
4511 if value != None:
4512 self.value = value
4513 else:
4514 self.value = 0
4515 if value_mask != None:
4516 self.value_mask = value_mask
4517 else:
4518 self.value_mask = 0
4519
4520 def pack(self):
4521 packed = []
4522 packed.append(struct.pack("!L", self.type_len))
4523 packed.append(struct.pack("!B", self.value))
4524 packed.append(struct.pack("!B", self.value_mask))
4525 return ''.join(packed)
4526
4527 @staticmethod
4528 def unpack(buf):
4529 obj = vlan_pcp_masked()
4530 if type(buf) == loxi.generic_util.OFReader:
4531 reader = buf
4532 else:
4533 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004534 _type_len = reader.read("!L")[0]
4535 assert(_type_len == 2147487490)
4536 obj.value = reader.read("!B")[0]
4537 obj.value_mask = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004538 return obj
4539
4540 def __eq__(self, other):
4541 if type(self) != type(other): return False
4542 if self.value != other.value: return False
4543 if self.value_mask != other.value_mask: return False
4544 return True
4545
4546 def __ne__(self, other):
4547 return not self.__eq__(other)
4548
4549 def show(self):
4550 import loxi.pp
4551 return loxi.pp.pp(self)
4552
4553 def pretty_print(self, q):
4554 q.text("vlan_pcp_masked {")
4555 with q.group():
4556 with q.indent(2):
4557 q.breakable()
4558 q.text("value = ");
4559 q.text("%#x" % self.value)
4560 q.text(","); q.breakable()
4561 q.text("value_mask = ");
4562 q.text("%#x" % self.value_mask)
4563 q.breakable()
4564 q.text('}')
4565
4566class vlan_vid(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004567 type_len = 2147486722
Rich Lanec2ee4b82013-04-24 17:12:38 -07004568
4569 def __init__(self, value=None):
4570 if value != None:
4571 self.value = value
4572 else:
4573 self.value = 0
4574
4575 def pack(self):
4576 packed = []
4577 packed.append(struct.pack("!L", self.type_len))
4578 packed.append(struct.pack("!H", self.value))
4579 return ''.join(packed)
4580
4581 @staticmethod
4582 def unpack(buf):
4583 obj = vlan_vid()
4584 if type(buf) == loxi.generic_util.OFReader:
4585 reader = buf
4586 else:
4587 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004588 _type_len = reader.read("!L")[0]
4589 assert(_type_len == 2147486722)
4590 obj.value = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004591 return obj
4592
4593 def __eq__(self, other):
4594 if type(self) != type(other): return False
4595 if self.value != other.value: return False
4596 return True
4597
4598 def __ne__(self, other):
4599 return not self.__eq__(other)
4600
4601 def show(self):
4602 import loxi.pp
4603 return loxi.pp.pp(self)
4604
4605 def pretty_print(self, q):
4606 q.text("vlan_vid {")
4607 with q.group():
4608 with q.indent(2):
4609 q.breakable()
4610 q.text("value = ");
4611 q.text("%#x" % self.value)
4612 q.breakable()
4613 q.text('}')
4614
4615class vlan_vid_masked(OXM):
Dan Talaycof6202252013-07-02 01:00:29 -07004616 type_len = 2147486980
Rich Lanec2ee4b82013-04-24 17:12:38 -07004617
4618 def __init__(self, value=None, value_mask=None):
4619 if value != None:
4620 self.value = value
4621 else:
4622 self.value = 0
4623 if value_mask != None:
4624 self.value_mask = value_mask
4625 else:
4626 self.value_mask = 0
4627
4628 def pack(self):
4629 packed = []
4630 packed.append(struct.pack("!L", self.type_len))
4631 packed.append(struct.pack("!H", self.value))
4632 packed.append(struct.pack("!H", self.value_mask))
4633 return ''.join(packed)
4634
4635 @staticmethod
4636 def unpack(buf):
4637 obj = vlan_vid_masked()
4638 if type(buf) == loxi.generic_util.OFReader:
4639 reader = buf
4640 else:
4641 reader = loxi.generic_util.OFReader(buf)
Dan Talaycof6202252013-07-02 01:00:29 -07004642 _type_len = reader.read("!L")[0]
4643 assert(_type_len == 2147486980)
4644 obj.value = reader.read("!H")[0]
4645 obj.value_mask = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -07004646 return obj
4647
4648 def __eq__(self, other):
4649 if type(self) != type(other): return False
4650 if self.value != other.value: return False
4651 if self.value_mask != other.value_mask: return False
4652 return True
4653
4654 def __ne__(self, other):
4655 return not self.__eq__(other)
4656
4657 def show(self):
4658 import loxi.pp
4659 return loxi.pp.pp(self)
4660
4661 def pretty_print(self, q):
4662 q.text("vlan_vid_masked {")
4663 with q.group():
4664 with q.indent(2):
4665 q.breakable()
4666 q.text("value = ");
4667 q.text("%#x" % self.value)
4668 q.text(","); q.breakable()
4669 q.text("value_mask = ");
4670 q.text("%#x" % self.value_mask)
4671 q.breakable()
4672 q.text('}')
4673
4674
4675parsers = {
Rich Lane6f4978c2013-10-20 21:33:52 -07004676 196640 : bsn_in_ports_128.unpack,
4677 196896 : bsn_in_ports_128_masked.unpack,
Rich Laned9e3f7b2013-11-04 11:40:43 -08004678 197124 : bsn_lag_id.unpack,
4679 197380 : bsn_lag_id_masked.unpack,
4680 197636 : bsn_vrf.unpack,
4681 197892 : bsn_vrf_masked.unpack,
4682 198145 : bsn_global_vrf_allowed.unpack,
4683 198401 : bsn_global_vrf_allowed_masked.unpack,
4684 198660 : bsn_l3_interface_class_id.unpack,
4685 198916 : bsn_l3_interface_class_id_masked.unpack,
4686 199172 : bsn_l3_src_class_id.unpack,
4687 199428 : bsn_l3_src_class_id_masked.unpack,
4688 199684 : bsn_l3_dst_class_id.unpack,
4689 199940 : bsn_l3_dst_class_id_masked.unpack,
Rich Lanec2ee4b82013-04-24 17:12:38 -07004690 2147483652 : in_port.unpack,
4691 2147483912 : in_port_masked.unpack,
4692 2147484164 : in_phy_port.unpack,
4693 2147484424 : in_phy_port_masked.unpack,
4694 2147484680 : metadata.unpack,
4695 2147484944 : metadata_masked.unpack,
4696 2147485190 : eth_dst.unpack,
4697 2147485452 : eth_dst_masked.unpack,
4698 2147485702 : eth_src.unpack,
4699 2147485964 : eth_src_masked.unpack,
4700 2147486210 : eth_type.unpack,
4701 2147486468 : eth_type_masked.unpack,
4702 2147486722 : vlan_vid.unpack,
4703 2147486980 : vlan_vid_masked.unpack,
4704 2147487233 : vlan_pcp.unpack,
4705 2147487490 : vlan_pcp_masked.unpack,
4706 2147487745 : ip_dscp.unpack,
4707 2147488002 : ip_dscp_masked.unpack,
4708 2147488257 : ip_ecn.unpack,
4709 2147488514 : ip_ecn_masked.unpack,
4710 2147488769 : ip_proto.unpack,
4711 2147489026 : ip_proto_masked.unpack,
4712 2147489284 : ipv4_src.unpack,
4713 2147489544 : ipv4_src_masked.unpack,
4714 2147489796 : ipv4_dst.unpack,
4715 2147490056 : ipv4_dst_masked.unpack,
4716 2147490306 : tcp_src.unpack,
4717 2147490564 : tcp_src_masked.unpack,
4718 2147490818 : tcp_dst.unpack,
4719 2147491076 : tcp_dst_masked.unpack,
4720 2147491330 : udp_src.unpack,
4721 2147491588 : udp_src_masked.unpack,
4722 2147491842 : udp_dst.unpack,
4723 2147492100 : udp_dst_masked.unpack,
4724 2147492354 : sctp_src.unpack,
4725 2147492612 : sctp_src_masked.unpack,
4726 2147492866 : sctp_dst.unpack,
4727 2147493124 : sctp_dst_masked.unpack,
4728 2147493377 : icmpv4_type.unpack,
4729 2147493634 : icmpv4_type_masked.unpack,
4730 2147493889 : icmpv4_code.unpack,
4731 2147494146 : icmpv4_code_masked.unpack,
4732 2147494402 : arp_op.unpack,
4733 2147494660 : arp_op_masked.unpack,
4734 2147494916 : arp_spa.unpack,
4735 2147495176 : arp_spa_masked.unpack,
4736 2147495428 : arp_tpa.unpack,
4737 2147495688 : arp_tpa_masked.unpack,
4738 2147495942 : arp_sha.unpack,
4739 2147496204 : arp_sha_masked.unpack,
4740 2147496454 : arp_tha.unpack,
4741 2147496716 : arp_tha_masked.unpack,
4742 2147496976 : ipv6_src.unpack,
4743 2147497248 : ipv6_src_masked.unpack,
4744 2147497488 : ipv6_dst.unpack,
4745 2147497760 : ipv6_dst_masked.unpack,
4746 2147497988 : ipv6_flabel.unpack,
4747 2147498248 : ipv6_flabel_masked.unpack,
4748 2147498497 : icmpv6_type.unpack,
4749 2147498754 : icmpv6_type_masked.unpack,
4750 2147499009 : icmpv6_code.unpack,
4751 2147499266 : icmpv6_code_masked.unpack,
4752 2147499536 : ipv6_nd_target.unpack,
4753 2147499808 : ipv6_nd_target_masked.unpack,
4754 2147500038 : ipv6_nd_sll.unpack,
4755 2147500300 : ipv6_nd_sll_masked.unpack,
4756 2147500550 : ipv6_nd_tll.unpack,
4757 2147500812 : ipv6_nd_tll_masked.unpack,
4758 2147501060 : mpls_label.unpack,
4759 2147501320 : mpls_label_masked.unpack,
4760 2147501569 : mpls_tc.unpack,
4761 2147501826 : mpls_tc_masked.unpack,
4762}