blob: 64ea5c0f92a97db74c60eab80f14c0ec4bf03145 [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 Laneb658ddd2013-03-12 10:15:10 -07005
Rich Lane7dcdf022013-12-11 14:45:27 -08006# Automatically generated by LOXI from template module.py
Rich Laneb658ddd2013-03-12 10:15:10 -07007# Do not modify
8
9import struct
Rich Lane7dcdf022013-12-11 14:45:27 -080010import loxi
Rich Laneb658ddd2013-03-12 10:15:10 -070011import const
Rich Lane7dcdf022013-12-11 14:45:27 -080012import common
13import action
Rich Laneb658ddd2013-03-12 10:15:10 -070014import util
Rich Lanec2ee4b82013-04-24 17:12:38 -070015import loxi.generic_util
Rich Laneb658ddd2013-03-12 10:15:10 -070016
Rich Lane7dcdf022013-12-11 14:45:27 -080017class action(loxi.OFObject):
18 subtypes = {}
Rich Laneb658ddd2013-03-12 10:15:10 -070019
Rich Lane95f7fc92014-01-27 17:08:16 -080020
21 def __init__(self, type=None):
22 if type != None:
23 self.type = type
24 else:
25 self.type = 0
26 return
27
28 def pack(self):
29 packed = []
30 packed.append(struct.pack("!H", self.type))
31 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
32 packed.append('\x00' * 4)
33 length = sum([len(x) for x in packed])
34 packed[1] = struct.pack("!H", length)
35 return ''.join(packed)
36
Rich Lane7dcdf022013-12-11 14:45:27 -080037 @staticmethod
38 def unpack(reader):
39 subtype, = reader.peek('!H', 0)
Rich Lane95f7fc92014-01-27 17:08:16 -080040 subclass = action.subtypes.get(subtype)
41 if subclass:
42 return subclass.unpack(reader)
43
44 obj = action()
45 obj.type = reader.read("!H")[0]
46 _len = reader.read("!H")[0]
47 orig_reader = reader
48 reader = orig_reader.slice(_len - (2 + 2))
49 reader.skip(4)
50 return obj
51
52 def __eq__(self, other):
53 if type(self) != type(other): return False
54 if self.type != other.type: return False
55 return True
56
57 def pretty_print(self, q):
58 q.text("action {")
59 with q.group():
60 with q.indent(2):
61 q.breakable()
62 q.breakable()
63 q.text('}')
Rich Laneb658ddd2013-03-12 10:15:10 -070064
Rich Lane7dcdf022013-12-11 14:45:27 -080065
66class experimenter(action):
67 subtypes = {}
68
Rich Lane95f7fc92014-01-27 17:08:16 -080069 type = 65535
70
71 def __init__(self, experimenter=None, data=None):
72 if experimenter != None:
73 self.experimenter = experimenter
74 else:
75 self.experimenter = 0
76 if data != None:
77 self.data = data
78 else:
79 self.data = ''
80 return
81
82 def pack(self):
83 packed = []
84 packed.append(struct.pack("!H", self.type))
85 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
86 packed.append(struct.pack("!L", self.experimenter))
87 packed.append(self.data)
88 length = sum([len(x) for x in packed])
89 packed[1] = struct.pack("!H", length)
90 return ''.join(packed)
91
Rich Lane7dcdf022013-12-11 14:45:27 -080092 @staticmethod
93 def unpack(reader):
94 subtype, = reader.peek('!L', 4)
Rich Lane95f7fc92014-01-27 17:08:16 -080095 subclass = experimenter.subtypes.get(subtype)
96 if subclass:
97 return subclass.unpack(reader)
98
99 obj = experimenter()
100 _type = reader.read("!H")[0]
101 assert(_type == 65535)
102 _len = reader.read("!H")[0]
103 orig_reader = reader
104 reader = orig_reader.slice(_len - (2 + 2))
105 obj.experimenter = reader.read("!L")[0]
106 obj.data = str(reader.read_all())
107 return obj
108
109 def __eq__(self, other):
110 if type(self) != type(other): return False
111 if self.experimenter != other.experimenter: return False
112 if self.data != other.data: return False
113 return True
114
115 def pretty_print(self, q):
116 q.text("experimenter {")
117 with q.group():
118 with q.indent(2):
119 q.breakable()
120 q.text("data = ");
121 q.pp(self.data)
122 q.breakable()
123 q.text('}')
Rich Lane7dcdf022013-12-11 14:45:27 -0800124
125action.subtypes[65535] = experimenter
126
127class bsn(experimenter):
128 subtypes = {}
129
Rich Lane95f7fc92014-01-27 17:08:16 -0800130 type = 65535
131 experimenter = 6035143
132
133 def __init__(self, subtype=None):
134 if subtype != None:
135 self.subtype = subtype
136 else:
137 self.subtype = 0
138 return
139
140 def pack(self):
141 packed = []
142 packed.append(struct.pack("!H", self.type))
143 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
144 packed.append(struct.pack("!L", self.experimenter))
145 packed.append(struct.pack("!L", self.subtype))
146 packed.append('\x00' * 4)
147 length = sum([len(x) for x in packed])
148 packed[1] = struct.pack("!H", length)
149 return ''.join(packed)
150
Rich Lane7dcdf022013-12-11 14:45:27 -0800151 @staticmethod
152 def unpack(reader):
153 subtype, = reader.peek('!L', 8)
Rich Lane95f7fc92014-01-27 17:08:16 -0800154 subclass = bsn.subtypes.get(subtype)
155 if subclass:
156 return subclass.unpack(reader)
157
158 obj = bsn()
159 _type = reader.read("!H")[0]
160 assert(_type == 65535)
161 _len = reader.read("!H")[0]
162 orig_reader = reader
163 reader = orig_reader.slice(_len - (2 + 2))
164 _experimenter = reader.read("!L")[0]
165 assert(_experimenter == 6035143)
166 obj.subtype = reader.read("!L")[0]
167 reader.skip(4)
168 return obj
169
170 def __eq__(self, other):
171 if type(self) != type(other): return False
172 if self.subtype != other.subtype: return False
173 return True
174
175 def pretty_print(self, q):
176 q.text("bsn {")
177 with q.group():
178 with q.indent(2):
179 q.breakable()
180 q.breakable()
181 q.text('}')
Rich Lane7dcdf022013-12-11 14:45:27 -0800182
183experimenter.subtypes[6035143] = bsn
184
185class bsn_mirror(bsn):
Dan Talaycof6202252013-07-02 01:00:29 -0700186 type = 65535
187 experimenter = 6035143
Rich Laneb658ddd2013-03-12 10:15:10 -0700188 subtype = 1
189
Rich Lanec2ee4b82013-04-24 17:12:38 -0700190 def __init__(self, dest_port=None, vlan_tag=None, copy_stage=None):
Rich Laneb658ddd2013-03-12 10:15:10 -0700191 if dest_port != None:
192 self.dest_port = dest_port
193 else:
194 self.dest_port = 0
195 if vlan_tag != None:
196 self.vlan_tag = vlan_tag
197 else:
198 self.vlan_tag = 0
199 if copy_stage != None:
200 self.copy_stage = copy_stage
201 else:
202 self.copy_stage = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -0700203 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700204
205 def pack(self):
206 packed = []
207 packed.append(struct.pack("!H", self.type))
208 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
209 packed.append(struct.pack("!L", self.experimenter))
210 packed.append(struct.pack("!L", self.subtype))
211 packed.append(struct.pack("!L", self.dest_port))
212 packed.append(struct.pack("!L", self.vlan_tag))
213 packed.append(struct.pack("!B", self.copy_stage))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700214 packed.append('\x00' * 3)
Rich Laneb658ddd2013-03-12 10:15:10 -0700215 length = sum([len(x) for x in packed])
216 packed[1] = struct.pack("!H", length)
217 return ''.join(packed)
218
219 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800220 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700221 obj = bsn_mirror()
Dan Talaycof6202252013-07-02 01:00:29 -0700222 _type = reader.read("!H")[0]
223 assert(_type == 65535)
224 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800225 orig_reader = reader
226 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700227 _experimenter = reader.read("!L")[0]
228 assert(_experimenter == 6035143)
229 _subtype = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700230 assert(_subtype == 1)
Dan Talaycof6202252013-07-02 01:00:29 -0700231 obj.dest_port = reader.read("!L")[0]
232 obj.vlan_tag = reader.read("!L")[0]
233 obj.copy_stage = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700234 reader.skip(3)
Rich Laneb658ddd2013-03-12 10:15:10 -0700235 return obj
236
237 def __eq__(self, other):
238 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700239 if self.dest_port != other.dest_port: return False
240 if self.vlan_tag != other.vlan_tag: return False
241 if self.copy_stage != other.copy_stage: return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700242 return True
243
Rich Laneb658ddd2013-03-12 10:15:10 -0700244 def pretty_print(self, q):
245 q.text("bsn_mirror {")
246 with q.group():
247 with q.indent(2):
248 q.breakable()
249 q.text("dest_port = ");
250 q.text("%#x" % self.dest_port)
251 q.text(","); q.breakable()
252 q.text("vlan_tag = ");
253 q.text("%#x" % self.vlan_tag)
254 q.text(","); q.breakable()
255 q.text("copy_stage = ");
256 q.text("%#x" % self.copy_stage)
Rich Laneb658ddd2013-03-12 10:15:10 -0700257 q.breakable()
258 q.text('}')
259
Rich Lane7dcdf022013-12-11 14:45:27 -0800260bsn.subtypes[1] = bsn_mirror
261
262class bsn_set_tunnel_dst(bsn):
Dan Talaycof6202252013-07-02 01:00:29 -0700263 type = 65535
264 experimenter = 6035143
Rich Laneb658ddd2013-03-12 10:15:10 -0700265 subtype = 2
266
267 def __init__(self, dst=None):
268 if dst != None:
269 self.dst = dst
270 else:
271 self.dst = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -0700272 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700273
274 def pack(self):
275 packed = []
276 packed.append(struct.pack("!H", self.type))
277 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
278 packed.append(struct.pack("!L", self.experimenter))
279 packed.append(struct.pack("!L", self.subtype))
280 packed.append(struct.pack("!L", self.dst))
281 length = sum([len(x) for x in packed])
282 packed[1] = struct.pack("!H", length)
283 return ''.join(packed)
284
285 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800286 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700287 obj = bsn_set_tunnel_dst()
Dan Talaycof6202252013-07-02 01:00:29 -0700288 _type = reader.read("!H")[0]
289 assert(_type == 65535)
290 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800291 orig_reader = reader
292 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700293 _experimenter = reader.read("!L")[0]
294 assert(_experimenter == 6035143)
295 _subtype = reader.read("!L")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700296 assert(_subtype == 2)
Dan Talaycof6202252013-07-02 01:00:29 -0700297 obj.dst = reader.read("!L")[0]
Rich Laneb658ddd2013-03-12 10:15:10 -0700298 return obj
299
300 def __eq__(self, other):
301 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700302 if self.dst != other.dst: return False
303 return True
304
Rich Laneb658ddd2013-03-12 10:15:10 -0700305 def pretty_print(self, q):
306 q.text("bsn_set_tunnel_dst {")
307 with q.group():
308 with q.indent(2):
309 q.breakable()
310 q.text("dst = ");
311 q.text("%#x" % self.dst)
312 q.breakable()
313 q.text('}')
314
Rich Lane7dcdf022013-12-11 14:45:27 -0800315bsn.subtypes[2] = bsn_set_tunnel_dst
316
317class enqueue(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700318 type = 11
Rich Laneb658ddd2013-03-12 10:15:10 -0700319
Rich Lanec2ee4b82013-04-24 17:12:38 -0700320 def __init__(self, port=None, queue_id=None):
Rich Laneb658ddd2013-03-12 10:15:10 -0700321 if port != None:
322 self.port = port
323 else:
324 self.port = 0
Rich Laneb658ddd2013-03-12 10:15:10 -0700325 if queue_id != None:
326 self.queue_id = queue_id
327 else:
328 self.queue_id = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -0700329 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700330
331 def pack(self):
332 packed = []
333 packed.append(struct.pack("!H", self.type))
334 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
Dan Talaycof6202252013-07-02 01:00:29 -0700335 packed.append(util.pack_port_no(self.port))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700336 packed.append('\x00' * 6)
Rich Laneb658ddd2013-03-12 10:15:10 -0700337 packed.append(struct.pack("!L", self.queue_id))
338 length = sum([len(x) for x in packed])
339 packed[1] = struct.pack("!H", length)
340 return ''.join(packed)
341
342 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800343 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700344 obj = enqueue()
Dan Talaycof6202252013-07-02 01:00:29 -0700345 _type = reader.read("!H")[0]
346 assert(_type == 11)
347 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800348 orig_reader = reader
349 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700350 obj.port = util.unpack_port_no(reader)
Rich Lanec2ee4b82013-04-24 17:12:38 -0700351 reader.skip(6)
Dan Talaycof6202252013-07-02 01:00:29 -0700352 obj.queue_id = reader.read("!L")[0]
Rich Laneb658ddd2013-03-12 10:15:10 -0700353 return obj
354
355 def __eq__(self, other):
356 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700357 if self.port != other.port: return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700358 if self.queue_id != other.queue_id: return False
359 return True
360
Rich Laneb658ddd2013-03-12 10:15:10 -0700361 def pretty_print(self, q):
362 q.text("enqueue {")
363 with q.group():
364 with q.indent(2):
365 q.breakable()
366 q.text("port = ");
367 q.text(util.pretty_port(self.port))
368 q.text(","); q.breakable()
Rich Laneb658ddd2013-03-12 10:15:10 -0700369 q.text("queue_id = ");
370 q.text("%#x" % self.queue_id)
371 q.breakable()
372 q.text('}')
373
Rich Lane7dcdf022013-12-11 14:45:27 -0800374action.subtypes[11] = enqueue
375
376class nicira(experimenter):
377 subtypes = {}
378
Rich Lane95f7fc92014-01-27 17:08:16 -0800379 type = 65535
380 experimenter = 8992
381
382 def __init__(self, subtype=None):
383 if subtype != None:
384 self.subtype = subtype
385 else:
386 self.subtype = 0
387 return
388
389 def pack(self):
390 packed = []
391 packed.append(struct.pack("!H", self.type))
392 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
393 packed.append(struct.pack("!L", self.experimenter))
394 packed.append(struct.pack("!H", self.subtype))
395 packed.append('\x00' * 2)
396 packed.append('\x00' * 4)
397 length = sum([len(x) for x in packed])
398 packed[1] = struct.pack("!H", length)
399 return ''.join(packed)
400
Rich Lane7dcdf022013-12-11 14:45:27 -0800401 @staticmethod
402 def unpack(reader):
403 subtype, = reader.peek('!H', 8)
Rich Lane95f7fc92014-01-27 17:08:16 -0800404 subclass = nicira.subtypes.get(subtype)
405 if subclass:
406 return subclass.unpack(reader)
407
408 obj = nicira()
409 _type = reader.read("!H")[0]
410 assert(_type == 65535)
411 _len = reader.read("!H")[0]
412 orig_reader = reader
413 reader = orig_reader.slice(_len - (2 + 2))
414 _experimenter = reader.read("!L")[0]
415 assert(_experimenter == 8992)
416 obj.subtype = reader.read("!H")[0]
417 reader.skip(2)
418 reader.skip(4)
419 return obj
420
421 def __eq__(self, other):
422 if type(self) != type(other): return False
423 if self.subtype != other.subtype: return False
424 return True
425
426 def pretty_print(self, q):
427 q.text("nicira {")
428 with q.group():
429 with q.indent(2):
430 q.breakable()
431 q.breakable()
432 q.text('}')
Rich Lane7dcdf022013-12-11 14:45:27 -0800433
434experimenter.subtypes[8992] = nicira
435
436class nicira_dec_ttl(nicira):
Dan Talaycof6202252013-07-02 01:00:29 -0700437 type = 65535
438 experimenter = 8992
Rich Laneb658ddd2013-03-12 10:15:10 -0700439 subtype = 18
440
Rich Lanec2ee4b82013-04-24 17:12:38 -0700441 def __init__(self):
442 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700443
444 def pack(self):
445 packed = []
446 packed.append(struct.pack("!H", self.type))
447 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
448 packed.append(struct.pack("!L", self.experimenter))
449 packed.append(struct.pack("!H", self.subtype))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700450 packed.append('\x00' * 2)
451 packed.append('\x00' * 4)
Rich Laneb658ddd2013-03-12 10:15:10 -0700452 length = sum([len(x) for x in packed])
453 packed[1] = struct.pack("!H", length)
454 return ''.join(packed)
455
456 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800457 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700458 obj = nicira_dec_ttl()
Dan Talaycof6202252013-07-02 01:00:29 -0700459 _type = reader.read("!H")[0]
460 assert(_type == 65535)
461 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800462 orig_reader = reader
463 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700464 _experimenter = reader.read("!L")[0]
465 assert(_experimenter == 8992)
466 _subtype = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700467 assert(_subtype == 18)
468 reader.skip(2)
469 reader.skip(4)
Rich Laneb658ddd2013-03-12 10:15:10 -0700470 return obj
471
472 def __eq__(self, other):
473 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700474 return True
475
Rich Laneb658ddd2013-03-12 10:15:10 -0700476 def pretty_print(self, q):
477 q.text("nicira_dec_ttl {")
478 with q.group():
479 with q.indent(2):
480 q.breakable()
Rich Laneb658ddd2013-03-12 10:15:10 -0700481 q.breakable()
482 q.text('}')
483
Rich Lane7dcdf022013-12-11 14:45:27 -0800484nicira.subtypes[18] = nicira_dec_ttl
485
486class output(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700487 type = 0
Rich Laneb658ddd2013-03-12 10:15:10 -0700488
489 def __init__(self, port=None, max_len=None):
490 if port != None:
491 self.port = port
492 else:
493 self.port = 0
494 if max_len != None:
495 self.max_len = max_len
496 else:
497 self.max_len = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -0700498 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700499
500 def pack(self):
501 packed = []
502 packed.append(struct.pack("!H", self.type))
503 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
Dan Talaycof6202252013-07-02 01:00:29 -0700504 packed.append(util.pack_port_no(self.port))
Rich Laneb658ddd2013-03-12 10:15:10 -0700505 packed.append(struct.pack("!H", self.max_len))
506 length = sum([len(x) for x in packed])
507 packed[1] = struct.pack("!H", length)
508 return ''.join(packed)
509
510 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800511 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700512 obj = output()
Dan Talaycof6202252013-07-02 01:00:29 -0700513 _type = reader.read("!H")[0]
514 assert(_type == 0)
515 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800516 orig_reader = reader
517 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700518 obj.port = util.unpack_port_no(reader)
519 obj.max_len = reader.read("!H")[0]
Rich Laneb658ddd2013-03-12 10:15:10 -0700520 return obj
521
522 def __eq__(self, other):
523 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700524 if self.port != other.port: return False
525 if self.max_len != other.max_len: return False
526 return True
527
Rich Laneb658ddd2013-03-12 10:15:10 -0700528 def pretty_print(self, q):
529 q.text("output {")
530 with q.group():
531 with q.indent(2):
532 q.breakable()
533 q.text("port = ");
534 q.text(util.pretty_port(self.port))
535 q.text(","); q.breakable()
536 q.text("max_len = ");
537 q.text("%#x" % self.max_len)
538 q.breakable()
539 q.text('}')
540
Rich Lane7dcdf022013-12-11 14:45:27 -0800541action.subtypes[0] = output
542
543class set_dl_dst(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700544 type = 5
Rich Laneb658ddd2013-03-12 10:15:10 -0700545
Rich Lanec2ee4b82013-04-24 17:12:38 -0700546 def __init__(self, dl_addr=None):
Rich Laneb658ddd2013-03-12 10:15:10 -0700547 if dl_addr != None:
548 self.dl_addr = dl_addr
549 else:
550 self.dl_addr = [0,0,0,0,0,0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700551 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700552
553 def pack(self):
554 packed = []
555 packed.append(struct.pack("!H", self.type))
556 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
557 packed.append(struct.pack("!6B", *self.dl_addr))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700558 packed.append('\x00' * 6)
Rich Laneb658ddd2013-03-12 10:15:10 -0700559 length = sum([len(x) for x in packed])
560 packed[1] = struct.pack("!H", length)
561 return ''.join(packed)
562
563 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800564 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700565 obj = set_dl_dst()
Dan Talaycof6202252013-07-02 01:00:29 -0700566 _type = reader.read("!H")[0]
567 assert(_type == 5)
568 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800569 orig_reader = reader
570 reader = orig_reader.slice(_len - (2 + 2))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700571 obj.dl_addr = list(reader.read('!6B'))
572 reader.skip(6)
Rich Laneb658ddd2013-03-12 10:15:10 -0700573 return obj
574
575 def __eq__(self, other):
576 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700577 if self.dl_addr != other.dl_addr: return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700578 return True
579
Rich Laneb658ddd2013-03-12 10:15:10 -0700580 def pretty_print(self, q):
581 q.text("set_dl_dst {")
582 with q.group():
583 with q.indent(2):
584 q.breakable()
585 q.text("dl_addr = ");
586 q.text(util.pretty_mac(self.dl_addr))
Rich Laneb658ddd2013-03-12 10:15:10 -0700587 q.breakable()
588 q.text('}')
589
Rich Lane7dcdf022013-12-11 14:45:27 -0800590action.subtypes[5] = set_dl_dst
591
592class set_dl_src(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700593 type = 4
Rich Laneb658ddd2013-03-12 10:15:10 -0700594
Rich Lanec2ee4b82013-04-24 17:12:38 -0700595 def __init__(self, dl_addr=None):
Rich Laneb658ddd2013-03-12 10:15:10 -0700596 if dl_addr != None:
597 self.dl_addr = dl_addr
598 else:
599 self.dl_addr = [0,0,0,0,0,0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700600 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700601
602 def pack(self):
603 packed = []
604 packed.append(struct.pack("!H", self.type))
605 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
606 packed.append(struct.pack("!6B", *self.dl_addr))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700607 packed.append('\x00' * 6)
Rich Laneb658ddd2013-03-12 10:15:10 -0700608 length = sum([len(x) for x in packed])
609 packed[1] = struct.pack("!H", length)
610 return ''.join(packed)
611
612 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800613 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700614 obj = set_dl_src()
Dan Talaycof6202252013-07-02 01:00:29 -0700615 _type = reader.read("!H")[0]
616 assert(_type == 4)
617 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800618 orig_reader = reader
619 reader = orig_reader.slice(_len - (2 + 2))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700620 obj.dl_addr = list(reader.read('!6B'))
621 reader.skip(6)
Rich Laneb658ddd2013-03-12 10:15:10 -0700622 return obj
623
624 def __eq__(self, other):
625 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700626 if self.dl_addr != other.dl_addr: return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700627 return True
628
Rich Laneb658ddd2013-03-12 10:15:10 -0700629 def pretty_print(self, q):
630 q.text("set_dl_src {")
631 with q.group():
632 with q.indent(2):
633 q.breakable()
634 q.text("dl_addr = ");
635 q.text(util.pretty_mac(self.dl_addr))
Rich Laneb658ddd2013-03-12 10:15:10 -0700636 q.breakable()
637 q.text('}')
638
Rich Lane7dcdf022013-12-11 14:45:27 -0800639action.subtypes[4] = set_dl_src
640
641class set_nw_dst(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700642 type = 7
Rich Laneb658ddd2013-03-12 10:15:10 -0700643
644 def __init__(self, nw_addr=None):
645 if nw_addr != None:
646 self.nw_addr = nw_addr
647 else:
648 self.nw_addr = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -0700649 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700650
651 def pack(self):
652 packed = []
653 packed.append(struct.pack("!H", self.type))
654 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
655 packed.append(struct.pack("!L", self.nw_addr))
656 length = sum([len(x) for x in packed])
657 packed[1] = struct.pack("!H", length)
658 return ''.join(packed)
659
660 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800661 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700662 obj = set_nw_dst()
Dan Talaycof6202252013-07-02 01:00:29 -0700663 _type = reader.read("!H")[0]
664 assert(_type == 7)
665 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800666 orig_reader = reader
667 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700668 obj.nw_addr = reader.read("!L")[0]
Rich Laneb658ddd2013-03-12 10:15:10 -0700669 return obj
670
671 def __eq__(self, other):
672 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700673 if self.nw_addr != other.nw_addr: return False
674 return True
675
Rich Laneb658ddd2013-03-12 10:15:10 -0700676 def pretty_print(self, q):
677 q.text("set_nw_dst {")
678 with q.group():
679 with q.indent(2):
680 q.breakable()
681 q.text("nw_addr = ");
682 q.text("%#x" % self.nw_addr)
683 q.breakable()
684 q.text('}')
685
Rich Lane7dcdf022013-12-11 14:45:27 -0800686action.subtypes[7] = set_nw_dst
687
688class set_nw_src(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700689 type = 6
Rich Laneb658ddd2013-03-12 10:15:10 -0700690
691 def __init__(self, nw_addr=None):
692 if nw_addr != None:
693 self.nw_addr = nw_addr
694 else:
695 self.nw_addr = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -0700696 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700697
698 def pack(self):
699 packed = []
700 packed.append(struct.pack("!H", self.type))
701 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
702 packed.append(struct.pack("!L", self.nw_addr))
703 length = sum([len(x) for x in packed])
704 packed[1] = struct.pack("!H", length)
705 return ''.join(packed)
706
707 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800708 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700709 obj = set_nw_src()
Dan Talaycof6202252013-07-02 01:00:29 -0700710 _type = reader.read("!H")[0]
711 assert(_type == 6)
712 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800713 orig_reader = reader
714 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700715 obj.nw_addr = reader.read("!L")[0]
Rich Laneb658ddd2013-03-12 10:15:10 -0700716 return obj
717
718 def __eq__(self, other):
719 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700720 if self.nw_addr != other.nw_addr: return False
721 return True
722
Rich Laneb658ddd2013-03-12 10:15:10 -0700723 def pretty_print(self, q):
724 q.text("set_nw_src {")
725 with q.group():
726 with q.indent(2):
727 q.breakable()
728 q.text("nw_addr = ");
729 q.text("%#x" % self.nw_addr)
730 q.breakable()
731 q.text('}')
732
Rich Lane7dcdf022013-12-11 14:45:27 -0800733action.subtypes[6] = set_nw_src
734
735class set_nw_tos(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700736 type = 8
Rich Laneb658ddd2013-03-12 10:15:10 -0700737
Rich Lanec2ee4b82013-04-24 17:12:38 -0700738 def __init__(self, nw_tos=None):
Rich Laneb658ddd2013-03-12 10:15:10 -0700739 if nw_tos != None:
740 self.nw_tos = nw_tos
741 else:
742 self.nw_tos = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -0700743 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700744
745 def pack(self):
746 packed = []
747 packed.append(struct.pack("!H", self.type))
748 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
749 packed.append(struct.pack("!B", self.nw_tos))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700750 packed.append('\x00' * 3)
Rich Laneb658ddd2013-03-12 10:15:10 -0700751 length = sum([len(x) for x in packed])
752 packed[1] = struct.pack("!H", length)
753 return ''.join(packed)
754
755 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800756 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700757 obj = set_nw_tos()
Dan Talaycof6202252013-07-02 01:00:29 -0700758 _type = reader.read("!H")[0]
759 assert(_type == 8)
760 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800761 orig_reader = reader
762 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700763 obj.nw_tos = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700764 reader.skip(3)
Rich Laneb658ddd2013-03-12 10:15:10 -0700765 return obj
766
767 def __eq__(self, other):
768 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700769 if self.nw_tos != other.nw_tos: return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700770 return True
771
Rich Laneb658ddd2013-03-12 10:15:10 -0700772 def pretty_print(self, q):
773 q.text("set_nw_tos {")
774 with q.group():
775 with q.indent(2):
776 q.breakable()
777 q.text("nw_tos = ");
778 q.text("%#x" % self.nw_tos)
Rich Laneb658ddd2013-03-12 10:15:10 -0700779 q.breakable()
780 q.text('}')
781
Rich Lane7dcdf022013-12-11 14:45:27 -0800782action.subtypes[8] = set_nw_tos
783
784class set_tp_dst(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700785 type = 10
Rich Laneb658ddd2013-03-12 10:15:10 -0700786
Rich Lanec2ee4b82013-04-24 17:12:38 -0700787 def __init__(self, tp_port=None):
Rich Laneb658ddd2013-03-12 10:15:10 -0700788 if tp_port != None:
789 self.tp_port = tp_port
790 else:
791 self.tp_port = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -0700792 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700793
794 def pack(self):
795 packed = []
796 packed.append(struct.pack("!H", self.type))
797 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
798 packed.append(struct.pack("!H", self.tp_port))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700799 packed.append('\x00' * 2)
Rich Laneb658ddd2013-03-12 10:15:10 -0700800 length = sum([len(x) for x in packed])
801 packed[1] = struct.pack("!H", length)
802 return ''.join(packed)
803
804 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800805 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700806 obj = set_tp_dst()
Dan Talaycof6202252013-07-02 01:00:29 -0700807 _type = reader.read("!H")[0]
808 assert(_type == 10)
809 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800810 orig_reader = reader
811 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700812 obj.tp_port = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700813 reader.skip(2)
Rich Laneb658ddd2013-03-12 10:15:10 -0700814 return obj
815
816 def __eq__(self, other):
817 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700818 if self.tp_port != other.tp_port: return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700819 return True
820
Rich Laneb658ddd2013-03-12 10:15:10 -0700821 def pretty_print(self, q):
822 q.text("set_tp_dst {")
823 with q.group():
824 with q.indent(2):
825 q.breakable()
826 q.text("tp_port = ");
827 q.text("%#x" % self.tp_port)
Rich Laneb658ddd2013-03-12 10:15:10 -0700828 q.breakable()
829 q.text('}')
830
Rich Lane7dcdf022013-12-11 14:45:27 -0800831action.subtypes[10] = set_tp_dst
832
833class set_tp_src(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700834 type = 9
Rich Laneb658ddd2013-03-12 10:15:10 -0700835
Rich Lanec2ee4b82013-04-24 17:12:38 -0700836 def __init__(self, tp_port=None):
Rich Laneb658ddd2013-03-12 10:15:10 -0700837 if tp_port != None:
838 self.tp_port = tp_port
839 else:
840 self.tp_port = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -0700841 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700842
843 def pack(self):
844 packed = []
845 packed.append(struct.pack("!H", self.type))
846 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
847 packed.append(struct.pack("!H", self.tp_port))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700848 packed.append('\x00' * 2)
Rich Laneb658ddd2013-03-12 10:15:10 -0700849 length = sum([len(x) for x in packed])
850 packed[1] = struct.pack("!H", length)
851 return ''.join(packed)
852
853 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800854 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700855 obj = set_tp_src()
Dan Talaycof6202252013-07-02 01:00:29 -0700856 _type = reader.read("!H")[0]
857 assert(_type == 9)
858 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800859 orig_reader = reader
860 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700861 obj.tp_port = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700862 reader.skip(2)
Rich Laneb658ddd2013-03-12 10:15:10 -0700863 return obj
864
865 def __eq__(self, other):
866 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700867 if self.tp_port != other.tp_port: return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700868 return True
869
Rich Laneb658ddd2013-03-12 10:15:10 -0700870 def pretty_print(self, q):
871 q.text("set_tp_src {")
872 with q.group():
873 with q.indent(2):
874 q.breakable()
875 q.text("tp_port = ");
876 q.text("%#x" % self.tp_port)
Rich Laneb658ddd2013-03-12 10:15:10 -0700877 q.breakable()
878 q.text('}')
879
Rich Lane7dcdf022013-12-11 14:45:27 -0800880action.subtypes[9] = set_tp_src
881
882class set_vlan_pcp(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700883 type = 2
Rich Laneb658ddd2013-03-12 10:15:10 -0700884
Rich Lanec2ee4b82013-04-24 17:12:38 -0700885 def __init__(self, vlan_pcp=None):
Rich Laneb658ddd2013-03-12 10:15:10 -0700886 if vlan_pcp != None:
887 self.vlan_pcp = vlan_pcp
888 else:
889 self.vlan_pcp = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -0700890 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700891
892 def pack(self):
893 packed = []
894 packed.append(struct.pack("!H", self.type))
895 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
896 packed.append(struct.pack("!B", self.vlan_pcp))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700897 packed.append('\x00' * 3)
Rich Laneb658ddd2013-03-12 10:15:10 -0700898 length = sum([len(x) for x in packed])
899 packed[1] = struct.pack("!H", length)
900 return ''.join(packed)
901
902 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800903 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700904 obj = set_vlan_pcp()
Dan Talaycof6202252013-07-02 01:00:29 -0700905 _type = reader.read("!H")[0]
906 assert(_type == 2)
907 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800908 orig_reader = reader
909 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700910 obj.vlan_pcp = reader.read("!B")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700911 reader.skip(3)
Rich Laneb658ddd2013-03-12 10:15:10 -0700912 return obj
913
914 def __eq__(self, other):
915 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700916 if self.vlan_pcp != other.vlan_pcp: return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700917 return True
918
Rich Laneb658ddd2013-03-12 10:15:10 -0700919 def pretty_print(self, q):
920 q.text("set_vlan_pcp {")
921 with q.group():
922 with q.indent(2):
923 q.breakable()
924 q.text("vlan_pcp = ");
925 q.text("%#x" % self.vlan_pcp)
Rich Laneb658ddd2013-03-12 10:15:10 -0700926 q.breakable()
927 q.text('}')
928
Rich Lane7dcdf022013-12-11 14:45:27 -0800929action.subtypes[2] = set_vlan_pcp
930
931class set_vlan_vid(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700932 type = 1
Rich Laneb658ddd2013-03-12 10:15:10 -0700933
Rich Lanec2ee4b82013-04-24 17:12:38 -0700934 def __init__(self, vlan_vid=None):
Rich Laneb658ddd2013-03-12 10:15:10 -0700935 if vlan_vid != None:
936 self.vlan_vid = vlan_vid
937 else:
938 self.vlan_vid = 0
Rich Lanec2ee4b82013-04-24 17:12:38 -0700939 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700940
941 def pack(self):
942 packed = []
943 packed.append(struct.pack("!H", self.type))
944 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
945 packed.append(struct.pack("!H", self.vlan_vid))
Rich Lanec2ee4b82013-04-24 17:12:38 -0700946 packed.append('\x00' * 2)
Rich Laneb658ddd2013-03-12 10:15:10 -0700947 length = sum([len(x) for x in packed])
948 packed[1] = struct.pack("!H", length)
949 return ''.join(packed)
950
951 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800952 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700953 obj = set_vlan_vid()
Dan Talaycof6202252013-07-02 01:00:29 -0700954 _type = reader.read("!H")[0]
955 assert(_type == 1)
956 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -0800957 orig_reader = reader
958 reader = orig_reader.slice(_len - (2 + 2))
Dan Talaycof6202252013-07-02 01:00:29 -0700959 obj.vlan_vid = reader.read("!H")[0]
Rich Lanec2ee4b82013-04-24 17:12:38 -0700960 reader.skip(2)
Rich Laneb658ddd2013-03-12 10:15:10 -0700961 return obj
962
963 def __eq__(self, other):
964 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700965 if self.vlan_vid != other.vlan_vid: return False
Rich Laneb658ddd2013-03-12 10:15:10 -0700966 return True
967
Rich Laneb658ddd2013-03-12 10:15:10 -0700968 def pretty_print(self, q):
969 q.text("set_vlan_vid {")
970 with q.group():
971 with q.indent(2):
972 q.breakable()
973 q.text("vlan_vid = ");
974 q.text("%#x" % self.vlan_vid)
Rich Laneb658ddd2013-03-12 10:15:10 -0700975 q.breakable()
976 q.text('}')
977
Rich Lane7dcdf022013-12-11 14:45:27 -0800978action.subtypes[1] = set_vlan_vid
979
980class strip_vlan(action):
Dan Talaycof6202252013-07-02 01:00:29 -0700981 type = 3
Rich Laneb658ddd2013-03-12 10:15:10 -0700982
Rich Lanec2ee4b82013-04-24 17:12:38 -0700983 def __init__(self):
984 return
Rich Laneb658ddd2013-03-12 10:15:10 -0700985
986 def pack(self):
987 packed = []
988 packed.append(struct.pack("!H", self.type))
989 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
Rich Lanec2ee4b82013-04-24 17:12:38 -0700990 packed.append('\x00' * 4)
Rich Laneb658ddd2013-03-12 10:15:10 -0700991 length = sum([len(x) for x in packed])
992 packed[1] = struct.pack("!H", length)
993 return ''.join(packed)
994
995 @staticmethod
Rich Lane7dcdf022013-12-11 14:45:27 -0800996 def unpack(reader):
Rich Laneb658ddd2013-03-12 10:15:10 -0700997 obj = strip_vlan()
Dan Talaycof6202252013-07-02 01:00:29 -0700998 _type = reader.read("!H")[0]
999 assert(_type == 3)
1000 _len = reader.read("!H")[0]
Rich Lane7dcdf022013-12-11 14:45:27 -08001001 orig_reader = reader
1002 reader = orig_reader.slice(_len - (2 + 2))
Rich Lanec2ee4b82013-04-24 17:12:38 -07001003 reader.skip(4)
Rich Laneb658ddd2013-03-12 10:15:10 -07001004 return obj
1005
1006 def __eq__(self, other):
1007 if type(self) != type(other): return False
Rich Laneb658ddd2013-03-12 10:15:10 -07001008 return True
1009
Rich Laneb658ddd2013-03-12 10:15:10 -07001010 def pretty_print(self, q):
1011 q.text("strip_vlan {")
1012 with q.group():
1013 with q.indent(2):
1014 q.breakable()
Rich Laneb658ddd2013-03-12 10:15:10 -07001015 q.breakable()
1016 q.text('}')
1017
Rich Lane7dcdf022013-12-11 14:45:27 -08001018action.subtypes[3] = strip_vlan
Rich Laneb658ddd2013-03-12 10:15:10 -07001019
Rich Laneb658ddd2013-03-12 10:15:10 -07001020