Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1 | # 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 Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4 | # See the file LICENSE.pyloxi which should have been included in the source distribution |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 6 | # Automatically generated by LOXI from template module.py |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 7 | # Do not modify |
| 8 | |
| 9 | import struct |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 10 | import loxi |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 11 | import const |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 12 | import common |
| 13 | import action |
| 14 | import instruction |
| 15 | import oxm |
| 16 | import action_id |
| 17 | import instruction_id |
| 18 | import meter_band |
Rich Lane | 5454b68 | 2014-01-14 17:07:36 -0800 | [diff] [blame] | 19 | import bsn_tlv |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 20 | import util |
| 21 | import loxi.generic_util |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 22 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 23 | class oxm(loxi.OFObject): |
| 24 | subtypes = {} |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 25 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 26 | @staticmethod |
| 27 | def unpack(reader): |
| 28 | subtype, = reader.peek('!L', 0) |
| 29 | try: |
| 30 | subclass = oxm.subtypes[subtype] |
| 31 | except KeyError: |
| 32 | raise loxi.ProtocolError("unknown oxm subtype %#x" % subtype) |
| 33 | return subclass.unpack(reader) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 34 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 35 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 36 | class arp_op(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 37 | type_len = 2147494402 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 38 | |
| 39 | def __init__(self, value=None): |
| 40 | if value != None: |
| 41 | self.value = value |
| 42 | else: |
| 43 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 44 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 45 | |
| 46 | def pack(self): |
| 47 | packed = [] |
| 48 | packed.append(struct.pack("!L", self.type_len)) |
| 49 | packed.append(struct.pack("!H", self.value)) |
| 50 | return ''.join(packed) |
| 51 | |
| 52 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 53 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 54 | obj = arp_op() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 55 | _type_len = reader.read("!L")[0] |
| 56 | assert(_type_len == 2147494402) |
| 57 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 58 | return obj |
| 59 | |
| 60 | def __eq__(self, other): |
| 61 | if type(self) != type(other): return False |
| 62 | if self.value != other.value: return False |
| 63 | return True |
| 64 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 65 | def pretty_print(self, q): |
| 66 | q.text("arp_op {") |
| 67 | with q.group(): |
| 68 | with q.indent(2): |
| 69 | q.breakable() |
| 70 | q.text("value = "); |
| 71 | q.text("%#x" % self.value) |
| 72 | q.breakable() |
| 73 | q.text('}') |
| 74 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 75 | oxm.subtypes[2147494402] = arp_op |
| 76 | |
| 77 | class arp_op_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 78 | type_len = 2147494660 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 79 | |
| 80 | def __init__(self, value=None, value_mask=None): |
| 81 | if value != None: |
| 82 | self.value = value |
| 83 | else: |
| 84 | self.value = 0 |
| 85 | if value_mask != None: |
| 86 | self.value_mask = value_mask |
| 87 | else: |
| 88 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 89 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 90 | |
| 91 | def pack(self): |
| 92 | packed = [] |
| 93 | packed.append(struct.pack("!L", self.type_len)) |
| 94 | packed.append(struct.pack("!H", self.value)) |
| 95 | packed.append(struct.pack("!H", self.value_mask)) |
| 96 | return ''.join(packed) |
| 97 | |
| 98 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 99 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 100 | obj = arp_op_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 101 | _type_len = reader.read("!L")[0] |
| 102 | assert(_type_len == 2147494660) |
| 103 | obj.value = reader.read("!H")[0] |
| 104 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 105 | return obj |
| 106 | |
| 107 | def __eq__(self, other): |
| 108 | if type(self) != type(other): return False |
| 109 | if self.value != other.value: return False |
| 110 | if self.value_mask != other.value_mask: return False |
| 111 | return True |
| 112 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 113 | def pretty_print(self, q): |
| 114 | q.text("arp_op_masked {") |
| 115 | with q.group(): |
| 116 | with q.indent(2): |
| 117 | q.breakable() |
| 118 | q.text("value = "); |
| 119 | q.text("%#x" % self.value) |
| 120 | q.text(","); q.breakable() |
| 121 | q.text("value_mask = "); |
| 122 | q.text("%#x" % self.value_mask) |
| 123 | q.breakable() |
| 124 | q.text('}') |
| 125 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 126 | oxm.subtypes[2147494660] = arp_op_masked |
| 127 | |
| 128 | class arp_sha(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 129 | type_len = 2147495942 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 130 | |
| 131 | def __init__(self, value=None): |
| 132 | if value != None: |
| 133 | self.value = value |
| 134 | else: |
| 135 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 136 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 137 | |
| 138 | def pack(self): |
| 139 | packed = [] |
| 140 | packed.append(struct.pack("!L", self.type_len)) |
| 141 | packed.append(struct.pack("!6B", *self.value)) |
| 142 | return ''.join(packed) |
| 143 | |
| 144 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 145 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 146 | obj = arp_sha() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 147 | _type_len = reader.read("!L")[0] |
| 148 | assert(_type_len == 2147495942) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 149 | obj.value = list(reader.read('!6B')) |
| 150 | return obj |
| 151 | |
| 152 | def __eq__(self, other): |
| 153 | if type(self) != type(other): return False |
| 154 | if self.value != other.value: return False |
| 155 | return True |
| 156 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 157 | def pretty_print(self, q): |
| 158 | q.text("arp_sha {") |
| 159 | with q.group(): |
| 160 | with q.indent(2): |
| 161 | q.breakable() |
| 162 | q.text("value = "); |
| 163 | q.text(util.pretty_mac(self.value)) |
| 164 | q.breakable() |
| 165 | q.text('}') |
| 166 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 167 | oxm.subtypes[2147495942] = arp_sha |
| 168 | |
| 169 | class arp_sha_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 170 | type_len = 2147496204 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 171 | |
| 172 | def __init__(self, value=None, value_mask=None): |
| 173 | if value != None: |
| 174 | self.value = value |
| 175 | else: |
| 176 | self.value = [0,0,0,0,0,0] |
| 177 | if value_mask != None: |
| 178 | self.value_mask = value_mask |
| 179 | else: |
| 180 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 181 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 182 | |
| 183 | def pack(self): |
| 184 | packed = [] |
| 185 | packed.append(struct.pack("!L", self.type_len)) |
| 186 | packed.append(struct.pack("!6B", *self.value)) |
| 187 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 188 | return ''.join(packed) |
| 189 | |
| 190 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 191 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 192 | obj = arp_sha_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 193 | _type_len = reader.read("!L")[0] |
| 194 | assert(_type_len == 2147496204) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 195 | obj.value = list(reader.read('!6B')) |
| 196 | obj.value_mask = list(reader.read('!6B')) |
| 197 | return obj |
| 198 | |
| 199 | def __eq__(self, other): |
| 200 | if type(self) != type(other): return False |
| 201 | if self.value != other.value: return False |
| 202 | if self.value_mask != other.value_mask: return False |
| 203 | return True |
| 204 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 205 | def pretty_print(self, q): |
| 206 | q.text("arp_sha_masked {") |
| 207 | with q.group(): |
| 208 | with q.indent(2): |
| 209 | q.breakable() |
| 210 | q.text("value = "); |
| 211 | q.text(util.pretty_mac(self.value)) |
| 212 | q.text(","); q.breakable() |
| 213 | q.text("value_mask = "); |
| 214 | q.text(util.pretty_mac(self.value_mask)) |
| 215 | q.breakable() |
| 216 | q.text('}') |
| 217 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 218 | oxm.subtypes[2147496204] = arp_sha_masked |
| 219 | |
| 220 | class arp_spa(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 221 | type_len = 2147494916 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 222 | |
| 223 | def __init__(self, value=None): |
| 224 | if value != None: |
| 225 | self.value = value |
| 226 | else: |
| 227 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 228 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 229 | |
| 230 | def pack(self): |
| 231 | packed = [] |
| 232 | packed.append(struct.pack("!L", self.type_len)) |
| 233 | packed.append(struct.pack("!L", self.value)) |
| 234 | return ''.join(packed) |
| 235 | |
| 236 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 237 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 238 | obj = arp_spa() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 239 | _type_len = reader.read("!L")[0] |
| 240 | assert(_type_len == 2147494916) |
| 241 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 242 | return obj |
| 243 | |
| 244 | def __eq__(self, other): |
| 245 | if type(self) != type(other): return False |
| 246 | if self.value != other.value: return False |
| 247 | return True |
| 248 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 249 | def pretty_print(self, q): |
| 250 | q.text("arp_spa {") |
| 251 | with q.group(): |
| 252 | with q.indent(2): |
| 253 | q.breakable() |
| 254 | q.text("value = "); |
| 255 | q.text("%#x" % self.value) |
| 256 | q.breakable() |
| 257 | q.text('}') |
| 258 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 259 | oxm.subtypes[2147494916] = arp_spa |
| 260 | |
| 261 | class arp_spa_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 262 | type_len = 2147495176 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 263 | |
| 264 | def __init__(self, value=None, value_mask=None): |
| 265 | if value != None: |
| 266 | self.value = value |
| 267 | else: |
| 268 | self.value = 0 |
| 269 | if value_mask != None: |
| 270 | self.value_mask = value_mask |
| 271 | else: |
| 272 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 273 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 274 | |
| 275 | def pack(self): |
| 276 | packed = [] |
| 277 | packed.append(struct.pack("!L", self.type_len)) |
| 278 | packed.append(struct.pack("!L", self.value)) |
| 279 | packed.append(struct.pack("!L", self.value_mask)) |
| 280 | return ''.join(packed) |
| 281 | |
| 282 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 283 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 284 | obj = arp_spa_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 285 | _type_len = reader.read("!L")[0] |
| 286 | assert(_type_len == 2147495176) |
| 287 | obj.value = reader.read("!L")[0] |
| 288 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 289 | return obj |
| 290 | |
| 291 | def __eq__(self, other): |
| 292 | if type(self) != type(other): return False |
| 293 | if self.value != other.value: return False |
| 294 | if self.value_mask != other.value_mask: return False |
| 295 | return True |
| 296 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 297 | def pretty_print(self, q): |
| 298 | q.text("arp_spa_masked {") |
| 299 | with q.group(): |
| 300 | with q.indent(2): |
| 301 | q.breakable() |
| 302 | q.text("value = "); |
| 303 | q.text("%#x" % self.value) |
| 304 | q.text(","); q.breakable() |
| 305 | q.text("value_mask = "); |
| 306 | q.text("%#x" % self.value_mask) |
| 307 | q.breakable() |
| 308 | q.text('}') |
| 309 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 310 | oxm.subtypes[2147495176] = arp_spa_masked |
| 311 | |
| 312 | class arp_tha(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 313 | type_len = 2147496454 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 314 | |
| 315 | def __init__(self, value=None): |
| 316 | if value != None: |
| 317 | self.value = value |
| 318 | else: |
| 319 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 320 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 321 | |
| 322 | def pack(self): |
| 323 | packed = [] |
| 324 | packed.append(struct.pack("!L", self.type_len)) |
| 325 | packed.append(struct.pack("!6B", *self.value)) |
| 326 | return ''.join(packed) |
| 327 | |
| 328 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 329 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 330 | obj = arp_tha() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 331 | _type_len = reader.read("!L")[0] |
| 332 | assert(_type_len == 2147496454) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 333 | obj.value = list(reader.read('!6B')) |
| 334 | return obj |
| 335 | |
| 336 | def __eq__(self, other): |
| 337 | if type(self) != type(other): return False |
| 338 | if self.value != other.value: return False |
| 339 | return True |
| 340 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 341 | def pretty_print(self, q): |
| 342 | q.text("arp_tha {") |
| 343 | with q.group(): |
| 344 | with q.indent(2): |
| 345 | q.breakable() |
| 346 | q.text("value = "); |
| 347 | q.text(util.pretty_mac(self.value)) |
| 348 | q.breakable() |
| 349 | q.text('}') |
| 350 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 351 | oxm.subtypes[2147496454] = arp_tha |
| 352 | |
| 353 | class arp_tha_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 354 | type_len = 2147496716 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 355 | |
| 356 | def __init__(self, value=None, value_mask=None): |
| 357 | if value != None: |
| 358 | self.value = value |
| 359 | else: |
| 360 | self.value = [0,0,0,0,0,0] |
| 361 | if value_mask != None: |
| 362 | self.value_mask = value_mask |
| 363 | else: |
| 364 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 365 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 366 | |
| 367 | def pack(self): |
| 368 | packed = [] |
| 369 | packed.append(struct.pack("!L", self.type_len)) |
| 370 | packed.append(struct.pack("!6B", *self.value)) |
| 371 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 372 | return ''.join(packed) |
| 373 | |
| 374 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 375 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 376 | obj = arp_tha_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 377 | _type_len = reader.read("!L")[0] |
| 378 | assert(_type_len == 2147496716) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 379 | obj.value = list(reader.read('!6B')) |
| 380 | obj.value_mask = list(reader.read('!6B')) |
| 381 | return obj |
| 382 | |
| 383 | def __eq__(self, other): |
| 384 | if type(self) != type(other): return False |
| 385 | if self.value != other.value: return False |
| 386 | if self.value_mask != other.value_mask: return False |
| 387 | return True |
| 388 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 389 | def pretty_print(self, q): |
| 390 | q.text("arp_tha_masked {") |
| 391 | with q.group(): |
| 392 | with q.indent(2): |
| 393 | q.breakable() |
| 394 | q.text("value = "); |
| 395 | q.text(util.pretty_mac(self.value)) |
| 396 | q.text(","); q.breakable() |
| 397 | q.text("value_mask = "); |
| 398 | q.text(util.pretty_mac(self.value_mask)) |
| 399 | q.breakable() |
| 400 | q.text('}') |
| 401 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 402 | oxm.subtypes[2147496716] = arp_tha_masked |
| 403 | |
| 404 | class arp_tpa(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 405 | type_len = 2147495428 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 406 | |
| 407 | def __init__(self, value=None): |
| 408 | if value != None: |
| 409 | self.value = value |
| 410 | else: |
| 411 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 412 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 413 | |
| 414 | def pack(self): |
| 415 | packed = [] |
| 416 | packed.append(struct.pack("!L", self.type_len)) |
| 417 | packed.append(struct.pack("!L", self.value)) |
| 418 | return ''.join(packed) |
| 419 | |
| 420 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 421 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 422 | obj = arp_tpa() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 423 | _type_len = reader.read("!L")[0] |
| 424 | assert(_type_len == 2147495428) |
| 425 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 426 | return obj |
| 427 | |
| 428 | def __eq__(self, other): |
| 429 | if type(self) != type(other): return False |
| 430 | if self.value != other.value: return False |
| 431 | return True |
| 432 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 433 | def pretty_print(self, q): |
| 434 | q.text("arp_tpa {") |
| 435 | with q.group(): |
| 436 | with q.indent(2): |
| 437 | q.breakable() |
| 438 | q.text("value = "); |
| 439 | q.text("%#x" % self.value) |
| 440 | q.breakable() |
| 441 | q.text('}') |
| 442 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 443 | oxm.subtypes[2147495428] = arp_tpa |
| 444 | |
| 445 | class arp_tpa_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 446 | type_len = 2147495688 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 447 | |
| 448 | def __init__(self, value=None, value_mask=None): |
| 449 | if value != None: |
| 450 | self.value = value |
| 451 | else: |
| 452 | self.value = 0 |
| 453 | if value_mask != None: |
| 454 | self.value_mask = value_mask |
| 455 | else: |
| 456 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 457 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 458 | |
| 459 | def pack(self): |
| 460 | packed = [] |
| 461 | packed.append(struct.pack("!L", self.type_len)) |
| 462 | packed.append(struct.pack("!L", self.value)) |
| 463 | packed.append(struct.pack("!L", self.value_mask)) |
| 464 | return ''.join(packed) |
| 465 | |
| 466 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 467 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 468 | obj = arp_tpa_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 469 | _type_len = reader.read("!L")[0] |
| 470 | assert(_type_len == 2147495688) |
| 471 | obj.value = reader.read("!L")[0] |
| 472 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 473 | return obj |
| 474 | |
| 475 | def __eq__(self, other): |
| 476 | if type(self) != type(other): return False |
| 477 | if self.value != other.value: return False |
| 478 | if self.value_mask != other.value_mask: return False |
| 479 | return True |
| 480 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 481 | def pretty_print(self, q): |
| 482 | q.text("arp_tpa_masked {") |
| 483 | with q.group(): |
| 484 | with q.indent(2): |
| 485 | q.breakable() |
| 486 | q.text("value = "); |
| 487 | q.text("%#x" % self.value) |
| 488 | q.text(","); q.breakable() |
| 489 | q.text("value_mask = "); |
| 490 | q.text("%#x" % self.value_mask) |
| 491 | q.breakable() |
| 492 | q.text('}') |
| 493 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 494 | oxm.subtypes[2147495688] = arp_tpa_masked |
| 495 | |
| 496 | class bsn_global_vrf_allowed(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 497 | type_len = 198145 |
| 498 | |
| 499 | def __init__(self, value=None): |
| 500 | if value != None: |
| 501 | self.value = value |
| 502 | else: |
| 503 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 504 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 505 | |
| 506 | def pack(self): |
| 507 | packed = [] |
| 508 | packed.append(struct.pack("!L", self.type_len)) |
| 509 | packed.append(struct.pack("!B", self.value)) |
| 510 | return ''.join(packed) |
| 511 | |
| 512 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 513 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 514 | obj = bsn_global_vrf_allowed() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 515 | _type_len = reader.read("!L")[0] |
| 516 | assert(_type_len == 198145) |
| 517 | obj.value = reader.read("!B")[0] |
| 518 | return obj |
| 519 | |
| 520 | def __eq__(self, other): |
| 521 | if type(self) != type(other): return False |
| 522 | if self.value != other.value: return False |
| 523 | return True |
| 524 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 525 | def pretty_print(self, q): |
| 526 | q.text("bsn_global_vrf_allowed {") |
| 527 | with q.group(): |
| 528 | with q.indent(2): |
| 529 | q.breakable() |
| 530 | q.text("value = "); |
| 531 | q.text("%#x" % self.value) |
| 532 | q.breakable() |
| 533 | q.text('}') |
| 534 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 535 | oxm.subtypes[198145] = bsn_global_vrf_allowed |
| 536 | |
| 537 | class bsn_global_vrf_allowed_masked(oxm): |
| 538 | type_len = 198402 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 539 | |
| 540 | def __init__(self, value=None, value_mask=None): |
| 541 | if value != None: |
| 542 | self.value = value |
| 543 | else: |
| 544 | self.value = 0 |
| 545 | if value_mask != None: |
| 546 | self.value_mask = value_mask |
| 547 | else: |
| 548 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 549 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 550 | |
| 551 | def pack(self): |
| 552 | packed = [] |
| 553 | packed.append(struct.pack("!L", self.type_len)) |
| 554 | packed.append(struct.pack("!B", self.value)) |
| 555 | packed.append(struct.pack("!B", self.value_mask)) |
| 556 | return ''.join(packed) |
| 557 | |
| 558 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 559 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 560 | obj = bsn_global_vrf_allowed_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 561 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 562 | assert(_type_len == 198402) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 563 | obj.value = reader.read("!B")[0] |
| 564 | obj.value_mask = reader.read("!B")[0] |
| 565 | return obj |
| 566 | |
| 567 | def __eq__(self, other): |
| 568 | if type(self) != type(other): return False |
| 569 | if self.value != other.value: return False |
| 570 | if self.value_mask != other.value_mask: return False |
| 571 | return True |
| 572 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 573 | def pretty_print(self, q): |
| 574 | q.text("bsn_global_vrf_allowed_masked {") |
| 575 | with q.group(): |
| 576 | with q.indent(2): |
| 577 | q.breakable() |
| 578 | q.text("value = "); |
| 579 | q.text("%#x" % self.value) |
| 580 | q.text(","); q.breakable() |
| 581 | q.text("value_mask = "); |
| 582 | q.text("%#x" % self.value_mask) |
| 583 | q.breakable() |
| 584 | q.text('}') |
| 585 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 586 | oxm.subtypes[198402] = bsn_global_vrf_allowed_masked |
| 587 | |
| 588 | class bsn_in_ports_128(oxm): |
| 589 | type_len = 196624 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 590 | |
| 591 | def __init__(self, value=None): |
| 592 | if value != None: |
| 593 | self.value = value |
| 594 | else: |
| 595 | self.value = set() |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 596 | return |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 597 | |
| 598 | def pack(self): |
| 599 | packed = [] |
| 600 | packed.append(struct.pack("!L", self.type_len)) |
| 601 | packed.append(util.pack_bitmap_128(self.value)) |
| 602 | return ''.join(packed) |
| 603 | |
| 604 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 605 | def unpack(reader): |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 606 | obj = bsn_in_ports_128() |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 607 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 608 | assert(_type_len == 196624) |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 609 | obj.value = util.unpack_bitmap_128(reader) |
| 610 | return obj |
| 611 | |
| 612 | def __eq__(self, other): |
| 613 | if type(self) != type(other): return False |
| 614 | if self.value != other.value: return False |
| 615 | return True |
| 616 | |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 617 | def pretty_print(self, q): |
| 618 | q.text("bsn_in_ports_128 {") |
| 619 | with q.group(): |
| 620 | with q.indent(2): |
| 621 | q.breakable() |
| 622 | q.text("value = "); |
| 623 | q.pp(self.value) |
| 624 | q.breakable() |
| 625 | q.text('}') |
| 626 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 627 | oxm.subtypes[196624] = bsn_in_ports_128 |
| 628 | |
| 629 | class bsn_in_ports_128_masked(oxm): |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 630 | type_len = 196896 |
| 631 | |
| 632 | def __init__(self, value=None, value_mask=None): |
| 633 | if value != None: |
| 634 | self.value = value |
| 635 | else: |
| 636 | self.value = set() |
| 637 | if value_mask != None: |
| 638 | self.value_mask = value_mask |
| 639 | else: |
| 640 | self.value_mask = set() |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 641 | return |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 642 | |
| 643 | def pack(self): |
| 644 | packed = [] |
| 645 | packed.append(struct.pack("!L", self.type_len)) |
| 646 | packed.append(util.pack_bitmap_128(self.value)) |
| 647 | packed.append(util.pack_bitmap_128(self.value_mask)) |
| 648 | return ''.join(packed) |
| 649 | |
| 650 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 651 | def unpack(reader): |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 652 | obj = bsn_in_ports_128_masked() |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 653 | _type_len = reader.read("!L")[0] |
| 654 | assert(_type_len == 196896) |
| 655 | obj.value = util.unpack_bitmap_128(reader) |
| 656 | obj.value_mask = util.unpack_bitmap_128(reader) |
| 657 | return obj |
| 658 | |
| 659 | def __eq__(self, other): |
| 660 | if type(self) != type(other): return False |
| 661 | if self.value != other.value: return False |
| 662 | if self.value_mask != other.value_mask: return False |
| 663 | return True |
| 664 | |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 665 | def pretty_print(self, q): |
| 666 | q.text("bsn_in_ports_128_masked {") |
| 667 | with q.group(): |
| 668 | with q.indent(2): |
| 669 | q.breakable() |
| 670 | q.text("value = "); |
| 671 | q.pp(self.value) |
| 672 | q.text(","); q.breakable() |
| 673 | q.text("value_mask = "); |
| 674 | q.pp(self.value_mask) |
| 675 | q.breakable() |
| 676 | q.text('}') |
| 677 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 678 | oxm.subtypes[196896] = bsn_in_ports_128_masked |
| 679 | |
| 680 | class bsn_l3_dst_class_id(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 681 | type_len = 199684 |
| 682 | |
| 683 | def __init__(self, value=None): |
| 684 | if value != None: |
| 685 | self.value = value |
| 686 | else: |
| 687 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 688 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 689 | |
| 690 | def pack(self): |
| 691 | packed = [] |
| 692 | packed.append(struct.pack("!L", self.type_len)) |
| 693 | packed.append(struct.pack("!L", self.value)) |
| 694 | return ''.join(packed) |
| 695 | |
| 696 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 697 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 698 | obj = bsn_l3_dst_class_id() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 699 | _type_len = reader.read("!L")[0] |
| 700 | assert(_type_len == 199684) |
| 701 | obj.value = reader.read("!L")[0] |
| 702 | return obj |
| 703 | |
| 704 | def __eq__(self, other): |
| 705 | if type(self) != type(other): return False |
| 706 | if self.value != other.value: return False |
| 707 | return True |
| 708 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 709 | def pretty_print(self, q): |
| 710 | q.text("bsn_l3_dst_class_id {") |
| 711 | with q.group(): |
| 712 | with q.indent(2): |
| 713 | q.breakable() |
| 714 | q.text("value = "); |
| 715 | q.text("%#x" % self.value) |
| 716 | q.breakable() |
| 717 | q.text('}') |
| 718 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 719 | oxm.subtypes[199684] = bsn_l3_dst_class_id |
| 720 | |
| 721 | class bsn_l3_dst_class_id_masked(oxm): |
| 722 | type_len = 199944 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 723 | |
| 724 | def __init__(self, value=None, value_mask=None): |
| 725 | if value != None: |
| 726 | self.value = value |
| 727 | else: |
| 728 | self.value = 0 |
| 729 | if value_mask != None: |
| 730 | self.value_mask = value_mask |
| 731 | else: |
| 732 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 733 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 734 | |
| 735 | def pack(self): |
| 736 | packed = [] |
| 737 | packed.append(struct.pack("!L", self.type_len)) |
| 738 | packed.append(struct.pack("!L", self.value)) |
| 739 | packed.append(struct.pack("!L", self.value_mask)) |
| 740 | return ''.join(packed) |
| 741 | |
| 742 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 743 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 744 | obj = bsn_l3_dst_class_id_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 745 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 746 | assert(_type_len == 199944) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 747 | obj.value = reader.read("!L")[0] |
| 748 | obj.value_mask = reader.read("!L")[0] |
| 749 | return obj |
| 750 | |
| 751 | def __eq__(self, other): |
| 752 | if type(self) != type(other): return False |
| 753 | if self.value != other.value: return False |
| 754 | if self.value_mask != other.value_mask: return False |
| 755 | return True |
| 756 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 757 | def pretty_print(self, q): |
| 758 | q.text("bsn_l3_dst_class_id_masked {") |
| 759 | with q.group(): |
| 760 | with q.indent(2): |
| 761 | q.breakable() |
| 762 | q.text("value = "); |
| 763 | q.text("%#x" % self.value) |
| 764 | q.text(","); q.breakable() |
| 765 | q.text("value_mask = "); |
| 766 | q.text("%#x" % self.value_mask) |
| 767 | q.breakable() |
| 768 | q.text('}') |
| 769 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 770 | oxm.subtypes[199944] = bsn_l3_dst_class_id_masked |
| 771 | |
| 772 | class bsn_l3_interface_class_id(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 773 | type_len = 198660 |
| 774 | |
| 775 | def __init__(self, value=None): |
| 776 | if value != None: |
| 777 | self.value = value |
| 778 | else: |
| 779 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 780 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 781 | |
| 782 | def pack(self): |
| 783 | packed = [] |
| 784 | packed.append(struct.pack("!L", self.type_len)) |
| 785 | packed.append(struct.pack("!L", self.value)) |
| 786 | return ''.join(packed) |
| 787 | |
| 788 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 789 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 790 | obj = bsn_l3_interface_class_id() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 791 | _type_len = reader.read("!L")[0] |
| 792 | assert(_type_len == 198660) |
| 793 | obj.value = reader.read("!L")[0] |
| 794 | return obj |
| 795 | |
| 796 | def __eq__(self, other): |
| 797 | if type(self) != type(other): return False |
| 798 | if self.value != other.value: return False |
| 799 | return True |
| 800 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 801 | def pretty_print(self, q): |
| 802 | q.text("bsn_l3_interface_class_id {") |
| 803 | with q.group(): |
| 804 | with q.indent(2): |
| 805 | q.breakable() |
| 806 | q.text("value = "); |
| 807 | q.text("%#x" % self.value) |
| 808 | q.breakable() |
| 809 | q.text('}') |
| 810 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 811 | oxm.subtypes[198660] = bsn_l3_interface_class_id |
| 812 | |
| 813 | class bsn_l3_interface_class_id_masked(oxm): |
| 814 | type_len = 198920 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 815 | |
| 816 | def __init__(self, value=None, value_mask=None): |
| 817 | if value != None: |
| 818 | self.value = value |
| 819 | else: |
| 820 | self.value = 0 |
| 821 | if value_mask != None: |
| 822 | self.value_mask = value_mask |
| 823 | else: |
| 824 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 825 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 826 | |
| 827 | def pack(self): |
| 828 | packed = [] |
| 829 | packed.append(struct.pack("!L", self.type_len)) |
| 830 | packed.append(struct.pack("!L", self.value)) |
| 831 | packed.append(struct.pack("!L", self.value_mask)) |
| 832 | return ''.join(packed) |
| 833 | |
| 834 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 835 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 836 | obj = bsn_l3_interface_class_id_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 837 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 838 | assert(_type_len == 198920) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 839 | obj.value = reader.read("!L")[0] |
| 840 | obj.value_mask = reader.read("!L")[0] |
| 841 | return obj |
| 842 | |
| 843 | def __eq__(self, other): |
| 844 | if type(self) != type(other): return False |
| 845 | if self.value != other.value: return False |
| 846 | if self.value_mask != other.value_mask: return False |
| 847 | return True |
| 848 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 849 | def pretty_print(self, q): |
| 850 | q.text("bsn_l3_interface_class_id_masked {") |
| 851 | with q.group(): |
| 852 | with q.indent(2): |
| 853 | q.breakable() |
| 854 | q.text("value = "); |
| 855 | q.text("%#x" % self.value) |
| 856 | q.text(","); q.breakable() |
| 857 | q.text("value_mask = "); |
| 858 | q.text("%#x" % self.value_mask) |
| 859 | q.breakable() |
| 860 | q.text('}') |
| 861 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 862 | oxm.subtypes[198920] = bsn_l3_interface_class_id_masked |
| 863 | |
| 864 | class bsn_l3_src_class_id(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 865 | type_len = 199172 |
| 866 | |
| 867 | def __init__(self, value=None): |
| 868 | if value != None: |
| 869 | self.value = value |
| 870 | else: |
| 871 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 872 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 873 | |
| 874 | def pack(self): |
| 875 | packed = [] |
| 876 | packed.append(struct.pack("!L", self.type_len)) |
| 877 | packed.append(struct.pack("!L", self.value)) |
| 878 | return ''.join(packed) |
| 879 | |
| 880 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 881 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 882 | obj = bsn_l3_src_class_id() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 883 | _type_len = reader.read("!L")[0] |
| 884 | assert(_type_len == 199172) |
| 885 | obj.value = reader.read("!L")[0] |
| 886 | return obj |
| 887 | |
| 888 | def __eq__(self, other): |
| 889 | if type(self) != type(other): return False |
| 890 | if self.value != other.value: return False |
| 891 | return True |
| 892 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 893 | def pretty_print(self, q): |
| 894 | q.text("bsn_l3_src_class_id {") |
| 895 | with q.group(): |
| 896 | with q.indent(2): |
| 897 | q.breakable() |
| 898 | q.text("value = "); |
| 899 | q.text("%#x" % self.value) |
| 900 | q.breakable() |
| 901 | q.text('}') |
| 902 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 903 | oxm.subtypes[199172] = bsn_l3_src_class_id |
| 904 | |
| 905 | class bsn_l3_src_class_id_masked(oxm): |
| 906 | type_len = 199432 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 907 | |
| 908 | def __init__(self, value=None, value_mask=None): |
| 909 | if value != None: |
| 910 | self.value = value |
| 911 | else: |
| 912 | self.value = 0 |
| 913 | if value_mask != None: |
| 914 | self.value_mask = value_mask |
| 915 | else: |
| 916 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 917 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 918 | |
| 919 | def pack(self): |
| 920 | packed = [] |
| 921 | packed.append(struct.pack("!L", self.type_len)) |
| 922 | packed.append(struct.pack("!L", self.value)) |
| 923 | packed.append(struct.pack("!L", self.value_mask)) |
| 924 | return ''.join(packed) |
| 925 | |
| 926 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 927 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 928 | obj = bsn_l3_src_class_id_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 929 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 930 | assert(_type_len == 199432) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 931 | obj.value = reader.read("!L")[0] |
| 932 | obj.value_mask = reader.read("!L")[0] |
| 933 | return obj |
| 934 | |
| 935 | def __eq__(self, other): |
| 936 | if type(self) != type(other): return False |
| 937 | if self.value != other.value: return False |
| 938 | if self.value_mask != other.value_mask: return False |
| 939 | return True |
| 940 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 941 | def pretty_print(self, q): |
| 942 | q.text("bsn_l3_src_class_id_masked {") |
| 943 | with q.group(): |
| 944 | with q.indent(2): |
| 945 | q.breakable() |
| 946 | q.text("value = "); |
| 947 | q.text("%#x" % self.value) |
| 948 | q.text(","); q.breakable() |
| 949 | q.text("value_mask = "); |
| 950 | q.text("%#x" % self.value_mask) |
| 951 | q.breakable() |
| 952 | q.text('}') |
| 953 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 954 | oxm.subtypes[199432] = bsn_l3_src_class_id_masked |
| 955 | |
| 956 | class bsn_lag_id(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 957 | type_len = 197124 |
| 958 | |
| 959 | def __init__(self, value=None): |
| 960 | if value != None: |
| 961 | self.value = value |
| 962 | else: |
| 963 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 964 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 965 | |
| 966 | def pack(self): |
| 967 | packed = [] |
| 968 | packed.append(struct.pack("!L", self.type_len)) |
| 969 | packed.append(struct.pack("!L", self.value)) |
| 970 | return ''.join(packed) |
| 971 | |
| 972 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 973 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 974 | obj = bsn_lag_id() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 975 | _type_len = reader.read("!L")[0] |
| 976 | assert(_type_len == 197124) |
| 977 | obj.value = reader.read("!L")[0] |
| 978 | return obj |
| 979 | |
| 980 | def __eq__(self, other): |
| 981 | if type(self) != type(other): return False |
| 982 | if self.value != other.value: return False |
| 983 | return True |
| 984 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 985 | def pretty_print(self, q): |
| 986 | q.text("bsn_lag_id {") |
| 987 | with q.group(): |
| 988 | with q.indent(2): |
| 989 | q.breakable() |
| 990 | q.text("value = "); |
| 991 | q.text("%#x" % self.value) |
| 992 | q.breakable() |
| 993 | q.text('}') |
| 994 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 995 | oxm.subtypes[197124] = bsn_lag_id |
| 996 | |
| 997 | class bsn_lag_id_masked(oxm): |
| 998 | type_len = 197384 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 999 | |
| 1000 | def __init__(self, value=None, value_mask=None): |
| 1001 | if value != None: |
| 1002 | self.value = value |
| 1003 | else: |
| 1004 | self.value = 0 |
| 1005 | if value_mask != None: |
| 1006 | self.value_mask = value_mask |
| 1007 | else: |
| 1008 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1009 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 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 | packed.append(struct.pack("!L", self.value_mask)) |
| 1016 | return ''.join(packed) |
| 1017 | |
| 1018 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1019 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1020 | obj = bsn_lag_id_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1021 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1022 | assert(_type_len == 197384) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1023 | obj.value = reader.read("!L")[0] |
| 1024 | obj.value_mask = reader.read("!L")[0] |
| 1025 | return obj |
| 1026 | |
| 1027 | def __eq__(self, other): |
| 1028 | if type(self) != type(other): return False |
| 1029 | if self.value != other.value: return False |
| 1030 | if self.value_mask != other.value_mask: return False |
| 1031 | return True |
| 1032 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1033 | def pretty_print(self, q): |
| 1034 | q.text("bsn_lag_id_masked {") |
| 1035 | with q.group(): |
| 1036 | with q.indent(2): |
| 1037 | q.breakable() |
| 1038 | q.text("value = "); |
| 1039 | q.text("%#x" % self.value) |
| 1040 | q.text(","); q.breakable() |
| 1041 | q.text("value_mask = "); |
| 1042 | q.text("%#x" % self.value_mask) |
| 1043 | q.breakable() |
| 1044 | q.text('}') |
| 1045 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1046 | oxm.subtypes[197384] = bsn_lag_id_masked |
| 1047 | |
| 1048 | class bsn_vrf(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1049 | type_len = 197636 |
| 1050 | |
| 1051 | def __init__(self, value=None): |
| 1052 | if value != None: |
| 1053 | self.value = value |
| 1054 | else: |
| 1055 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1056 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1057 | |
| 1058 | def pack(self): |
| 1059 | packed = [] |
| 1060 | packed.append(struct.pack("!L", self.type_len)) |
| 1061 | packed.append(struct.pack("!L", self.value)) |
| 1062 | return ''.join(packed) |
| 1063 | |
| 1064 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1065 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1066 | obj = bsn_vrf() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1067 | _type_len = reader.read("!L")[0] |
| 1068 | assert(_type_len == 197636) |
| 1069 | obj.value = reader.read("!L")[0] |
| 1070 | return obj |
| 1071 | |
| 1072 | def __eq__(self, other): |
| 1073 | if type(self) != type(other): return False |
| 1074 | if self.value != other.value: return False |
| 1075 | return True |
| 1076 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1077 | def pretty_print(self, q): |
| 1078 | q.text("bsn_vrf {") |
| 1079 | with q.group(): |
| 1080 | with q.indent(2): |
| 1081 | q.breakable() |
| 1082 | q.text("value = "); |
| 1083 | q.text("%#x" % self.value) |
| 1084 | q.breakable() |
| 1085 | q.text('}') |
| 1086 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1087 | oxm.subtypes[197636] = bsn_vrf |
| 1088 | |
| 1089 | class bsn_vrf_masked(oxm): |
| 1090 | type_len = 197896 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1091 | |
| 1092 | def __init__(self, value=None, value_mask=None): |
| 1093 | if value != None: |
| 1094 | self.value = value |
| 1095 | else: |
| 1096 | self.value = 0 |
| 1097 | if value_mask != None: |
| 1098 | self.value_mask = value_mask |
| 1099 | else: |
| 1100 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1101 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1102 | |
| 1103 | def pack(self): |
| 1104 | packed = [] |
| 1105 | packed.append(struct.pack("!L", self.type_len)) |
| 1106 | packed.append(struct.pack("!L", self.value)) |
| 1107 | packed.append(struct.pack("!L", self.value_mask)) |
| 1108 | return ''.join(packed) |
| 1109 | |
| 1110 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1111 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1112 | obj = bsn_vrf_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1113 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1114 | assert(_type_len == 197896) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1115 | obj.value = reader.read("!L")[0] |
| 1116 | obj.value_mask = reader.read("!L")[0] |
| 1117 | return obj |
| 1118 | |
| 1119 | def __eq__(self, other): |
| 1120 | if type(self) != type(other): return False |
| 1121 | if self.value != other.value: return False |
| 1122 | if self.value_mask != other.value_mask: return False |
| 1123 | return True |
| 1124 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1125 | def pretty_print(self, q): |
| 1126 | q.text("bsn_vrf_masked {") |
| 1127 | with q.group(): |
| 1128 | with q.indent(2): |
| 1129 | q.breakable() |
| 1130 | q.text("value = "); |
| 1131 | q.text("%#x" % self.value) |
| 1132 | q.text(","); q.breakable() |
| 1133 | q.text("value_mask = "); |
| 1134 | q.text("%#x" % self.value_mask) |
| 1135 | q.breakable() |
| 1136 | q.text('}') |
| 1137 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1138 | oxm.subtypes[197896] = bsn_vrf_masked |
| 1139 | |
| 1140 | class eth_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1141 | type_len = 2147485190 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1142 | |
| 1143 | def __init__(self, value=None): |
| 1144 | if value != None: |
| 1145 | self.value = value |
| 1146 | else: |
| 1147 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1148 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1149 | |
| 1150 | def pack(self): |
| 1151 | packed = [] |
| 1152 | packed.append(struct.pack("!L", self.type_len)) |
| 1153 | packed.append(struct.pack("!6B", *self.value)) |
| 1154 | return ''.join(packed) |
| 1155 | |
| 1156 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1157 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1158 | obj = eth_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1159 | _type_len = reader.read("!L")[0] |
| 1160 | assert(_type_len == 2147485190) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1161 | obj.value = list(reader.read('!6B')) |
| 1162 | return obj |
| 1163 | |
| 1164 | def __eq__(self, other): |
| 1165 | if type(self) != type(other): return False |
| 1166 | if self.value != other.value: return False |
| 1167 | return True |
| 1168 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1169 | def pretty_print(self, q): |
| 1170 | q.text("eth_dst {") |
| 1171 | with q.group(): |
| 1172 | with q.indent(2): |
| 1173 | q.breakable() |
| 1174 | q.text("value = "); |
| 1175 | q.text(util.pretty_mac(self.value)) |
| 1176 | q.breakable() |
| 1177 | q.text('}') |
| 1178 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1179 | oxm.subtypes[2147485190] = eth_dst |
| 1180 | |
| 1181 | class eth_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1182 | type_len = 2147485452 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1183 | |
| 1184 | def __init__(self, value=None, value_mask=None): |
| 1185 | if value != None: |
| 1186 | self.value = value |
| 1187 | else: |
| 1188 | self.value = [0,0,0,0,0,0] |
| 1189 | if value_mask != None: |
| 1190 | self.value_mask = value_mask |
| 1191 | else: |
| 1192 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1193 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1194 | |
| 1195 | def pack(self): |
| 1196 | packed = [] |
| 1197 | packed.append(struct.pack("!L", self.type_len)) |
| 1198 | packed.append(struct.pack("!6B", *self.value)) |
| 1199 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 1200 | return ''.join(packed) |
| 1201 | |
| 1202 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1203 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1204 | obj = eth_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1205 | _type_len = reader.read("!L")[0] |
| 1206 | assert(_type_len == 2147485452) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1207 | obj.value = list(reader.read('!6B')) |
| 1208 | obj.value_mask = list(reader.read('!6B')) |
| 1209 | return obj |
| 1210 | |
| 1211 | def __eq__(self, other): |
| 1212 | if type(self) != type(other): return False |
| 1213 | if self.value != other.value: return False |
| 1214 | if self.value_mask != other.value_mask: return False |
| 1215 | return True |
| 1216 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1217 | def pretty_print(self, q): |
| 1218 | q.text("eth_dst_masked {") |
| 1219 | with q.group(): |
| 1220 | with q.indent(2): |
| 1221 | q.breakable() |
| 1222 | q.text("value = "); |
| 1223 | q.text(util.pretty_mac(self.value)) |
| 1224 | q.text(","); q.breakable() |
| 1225 | q.text("value_mask = "); |
| 1226 | q.text(util.pretty_mac(self.value_mask)) |
| 1227 | q.breakable() |
| 1228 | q.text('}') |
| 1229 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1230 | oxm.subtypes[2147485452] = eth_dst_masked |
| 1231 | |
| 1232 | class eth_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1233 | type_len = 2147485702 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1234 | |
| 1235 | def __init__(self, value=None): |
| 1236 | if value != None: |
| 1237 | self.value = value |
| 1238 | else: |
| 1239 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1240 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1241 | |
| 1242 | def pack(self): |
| 1243 | packed = [] |
| 1244 | packed.append(struct.pack("!L", self.type_len)) |
| 1245 | packed.append(struct.pack("!6B", *self.value)) |
| 1246 | return ''.join(packed) |
| 1247 | |
| 1248 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1249 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1250 | obj = eth_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1251 | _type_len = reader.read("!L")[0] |
| 1252 | assert(_type_len == 2147485702) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1253 | obj.value = list(reader.read('!6B')) |
| 1254 | return obj |
| 1255 | |
| 1256 | def __eq__(self, other): |
| 1257 | if type(self) != type(other): return False |
| 1258 | if self.value != other.value: return False |
| 1259 | return True |
| 1260 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1261 | def pretty_print(self, q): |
| 1262 | q.text("eth_src {") |
| 1263 | with q.group(): |
| 1264 | with q.indent(2): |
| 1265 | q.breakable() |
| 1266 | q.text("value = "); |
| 1267 | q.text(util.pretty_mac(self.value)) |
| 1268 | q.breakable() |
| 1269 | q.text('}') |
| 1270 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1271 | oxm.subtypes[2147485702] = eth_src |
| 1272 | |
| 1273 | class eth_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1274 | type_len = 2147485964 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1275 | |
| 1276 | def __init__(self, value=None, value_mask=None): |
| 1277 | if value != None: |
| 1278 | self.value = value |
| 1279 | else: |
| 1280 | self.value = [0,0,0,0,0,0] |
| 1281 | if value_mask != None: |
| 1282 | self.value_mask = value_mask |
| 1283 | else: |
| 1284 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1285 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1286 | |
| 1287 | def pack(self): |
| 1288 | packed = [] |
| 1289 | packed.append(struct.pack("!L", self.type_len)) |
| 1290 | packed.append(struct.pack("!6B", *self.value)) |
| 1291 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 1292 | return ''.join(packed) |
| 1293 | |
| 1294 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1295 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1296 | obj = eth_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1297 | _type_len = reader.read("!L")[0] |
| 1298 | assert(_type_len == 2147485964) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1299 | obj.value = list(reader.read('!6B')) |
| 1300 | obj.value_mask = list(reader.read('!6B')) |
| 1301 | return obj |
| 1302 | |
| 1303 | def __eq__(self, other): |
| 1304 | if type(self) != type(other): return False |
| 1305 | if self.value != other.value: return False |
| 1306 | if self.value_mask != other.value_mask: return False |
| 1307 | return True |
| 1308 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1309 | def pretty_print(self, q): |
| 1310 | q.text("eth_src_masked {") |
| 1311 | with q.group(): |
| 1312 | with q.indent(2): |
| 1313 | q.breakable() |
| 1314 | q.text("value = "); |
| 1315 | q.text(util.pretty_mac(self.value)) |
| 1316 | q.text(","); q.breakable() |
| 1317 | q.text("value_mask = "); |
| 1318 | q.text(util.pretty_mac(self.value_mask)) |
| 1319 | q.breakable() |
| 1320 | q.text('}') |
| 1321 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1322 | oxm.subtypes[2147485964] = eth_src_masked |
| 1323 | |
| 1324 | class eth_type(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1325 | type_len = 2147486210 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1326 | |
| 1327 | def __init__(self, value=None): |
| 1328 | if value != None: |
| 1329 | self.value = value |
| 1330 | else: |
| 1331 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1332 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1333 | |
| 1334 | def pack(self): |
| 1335 | packed = [] |
| 1336 | packed.append(struct.pack("!L", self.type_len)) |
| 1337 | packed.append(struct.pack("!H", self.value)) |
| 1338 | return ''.join(packed) |
| 1339 | |
| 1340 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1341 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1342 | obj = eth_type() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1343 | _type_len = reader.read("!L")[0] |
| 1344 | assert(_type_len == 2147486210) |
| 1345 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1346 | return obj |
| 1347 | |
| 1348 | def __eq__(self, other): |
| 1349 | if type(self) != type(other): return False |
| 1350 | if self.value != other.value: return False |
| 1351 | return True |
| 1352 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1353 | def pretty_print(self, q): |
| 1354 | q.text("eth_type {") |
| 1355 | with q.group(): |
| 1356 | with q.indent(2): |
| 1357 | q.breakable() |
| 1358 | q.text("value = "); |
| 1359 | q.text("%#x" % self.value) |
| 1360 | q.breakable() |
| 1361 | q.text('}') |
| 1362 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1363 | oxm.subtypes[2147486210] = eth_type |
| 1364 | |
| 1365 | class eth_type_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1366 | type_len = 2147486468 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1367 | |
| 1368 | def __init__(self, value=None, value_mask=None): |
| 1369 | if value != None: |
| 1370 | self.value = value |
| 1371 | else: |
| 1372 | self.value = 0 |
| 1373 | if value_mask != None: |
| 1374 | self.value_mask = value_mask |
| 1375 | else: |
| 1376 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1377 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1378 | |
| 1379 | def pack(self): |
| 1380 | packed = [] |
| 1381 | packed.append(struct.pack("!L", self.type_len)) |
| 1382 | packed.append(struct.pack("!H", self.value)) |
| 1383 | packed.append(struct.pack("!H", self.value_mask)) |
| 1384 | return ''.join(packed) |
| 1385 | |
| 1386 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1387 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1388 | obj = eth_type_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1389 | _type_len = reader.read("!L")[0] |
| 1390 | assert(_type_len == 2147486468) |
| 1391 | obj.value = reader.read("!H")[0] |
| 1392 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1393 | return obj |
| 1394 | |
| 1395 | def __eq__(self, other): |
| 1396 | if type(self) != type(other): return False |
| 1397 | if self.value != other.value: return False |
| 1398 | if self.value_mask != other.value_mask: return False |
| 1399 | return True |
| 1400 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1401 | def pretty_print(self, q): |
| 1402 | q.text("eth_type_masked {") |
| 1403 | with q.group(): |
| 1404 | with q.indent(2): |
| 1405 | q.breakable() |
| 1406 | q.text("value = "); |
| 1407 | q.text("%#x" % self.value) |
| 1408 | q.text(","); q.breakable() |
| 1409 | q.text("value_mask = "); |
| 1410 | q.text("%#x" % self.value_mask) |
| 1411 | q.breakable() |
| 1412 | q.text('}') |
| 1413 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1414 | oxm.subtypes[2147486468] = eth_type_masked |
| 1415 | |
| 1416 | class icmpv4_code(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1417 | type_len = 2147493889 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1418 | |
| 1419 | def __init__(self, value=None): |
| 1420 | if value != None: |
| 1421 | self.value = value |
| 1422 | else: |
| 1423 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1424 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1425 | |
| 1426 | def pack(self): |
| 1427 | packed = [] |
| 1428 | packed.append(struct.pack("!L", self.type_len)) |
| 1429 | packed.append(struct.pack("!B", self.value)) |
| 1430 | return ''.join(packed) |
| 1431 | |
| 1432 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1433 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1434 | obj = icmpv4_code() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1435 | _type_len = reader.read("!L")[0] |
| 1436 | assert(_type_len == 2147493889) |
| 1437 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1438 | return obj |
| 1439 | |
| 1440 | def __eq__(self, other): |
| 1441 | if type(self) != type(other): return False |
| 1442 | if self.value != other.value: return False |
| 1443 | return True |
| 1444 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1445 | def pretty_print(self, q): |
| 1446 | q.text("icmpv4_code {") |
| 1447 | with q.group(): |
| 1448 | with q.indent(2): |
| 1449 | q.breakable() |
| 1450 | q.text("value = "); |
| 1451 | q.text("%#x" % self.value) |
| 1452 | q.breakable() |
| 1453 | q.text('}') |
| 1454 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1455 | oxm.subtypes[2147493889] = icmpv4_code |
| 1456 | |
| 1457 | class icmpv4_code_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1458 | type_len = 2147494146 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1459 | |
| 1460 | def __init__(self, value=None, value_mask=None): |
| 1461 | if value != None: |
| 1462 | self.value = value |
| 1463 | else: |
| 1464 | self.value = 0 |
| 1465 | if value_mask != None: |
| 1466 | self.value_mask = value_mask |
| 1467 | else: |
| 1468 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1469 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1470 | |
| 1471 | def pack(self): |
| 1472 | packed = [] |
| 1473 | packed.append(struct.pack("!L", self.type_len)) |
| 1474 | packed.append(struct.pack("!B", self.value)) |
| 1475 | packed.append(struct.pack("!B", self.value_mask)) |
| 1476 | return ''.join(packed) |
| 1477 | |
| 1478 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1479 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1480 | obj = icmpv4_code_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1481 | _type_len = reader.read("!L")[0] |
| 1482 | assert(_type_len == 2147494146) |
| 1483 | obj.value = reader.read("!B")[0] |
| 1484 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1485 | return obj |
| 1486 | |
| 1487 | def __eq__(self, other): |
| 1488 | if type(self) != type(other): return False |
| 1489 | if self.value != other.value: return False |
| 1490 | if self.value_mask != other.value_mask: return False |
| 1491 | return True |
| 1492 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1493 | def pretty_print(self, q): |
| 1494 | q.text("icmpv4_code_masked {") |
| 1495 | with q.group(): |
| 1496 | with q.indent(2): |
| 1497 | q.breakable() |
| 1498 | q.text("value = "); |
| 1499 | q.text("%#x" % self.value) |
| 1500 | q.text(","); q.breakable() |
| 1501 | q.text("value_mask = "); |
| 1502 | q.text("%#x" % self.value_mask) |
| 1503 | q.breakable() |
| 1504 | q.text('}') |
| 1505 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1506 | oxm.subtypes[2147494146] = icmpv4_code_masked |
| 1507 | |
| 1508 | class icmpv4_type(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1509 | type_len = 2147493377 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1510 | |
| 1511 | def __init__(self, value=None): |
| 1512 | if value != None: |
| 1513 | self.value = value |
| 1514 | else: |
| 1515 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1516 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1517 | |
| 1518 | def pack(self): |
| 1519 | packed = [] |
| 1520 | packed.append(struct.pack("!L", self.type_len)) |
| 1521 | packed.append(struct.pack("!B", self.value)) |
| 1522 | return ''.join(packed) |
| 1523 | |
| 1524 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1525 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1526 | obj = icmpv4_type() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1527 | _type_len = reader.read("!L")[0] |
| 1528 | assert(_type_len == 2147493377) |
| 1529 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1530 | return obj |
| 1531 | |
| 1532 | def __eq__(self, other): |
| 1533 | if type(self) != type(other): return False |
| 1534 | if self.value != other.value: return False |
| 1535 | return True |
| 1536 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1537 | def pretty_print(self, q): |
| 1538 | q.text("icmpv4_type {") |
| 1539 | with q.group(): |
| 1540 | with q.indent(2): |
| 1541 | q.breakable() |
| 1542 | q.text("value = "); |
| 1543 | q.text("%#x" % self.value) |
| 1544 | q.breakable() |
| 1545 | q.text('}') |
| 1546 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1547 | oxm.subtypes[2147493377] = icmpv4_type |
| 1548 | |
| 1549 | class icmpv4_type_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1550 | type_len = 2147493634 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1551 | |
| 1552 | def __init__(self, value=None, value_mask=None): |
| 1553 | if value != None: |
| 1554 | self.value = value |
| 1555 | else: |
| 1556 | self.value = 0 |
| 1557 | if value_mask != None: |
| 1558 | self.value_mask = value_mask |
| 1559 | else: |
| 1560 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1561 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1562 | |
| 1563 | def pack(self): |
| 1564 | packed = [] |
| 1565 | packed.append(struct.pack("!L", self.type_len)) |
| 1566 | packed.append(struct.pack("!B", self.value)) |
| 1567 | packed.append(struct.pack("!B", self.value_mask)) |
| 1568 | return ''.join(packed) |
| 1569 | |
| 1570 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1571 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1572 | obj = icmpv4_type_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1573 | _type_len = reader.read("!L")[0] |
| 1574 | assert(_type_len == 2147493634) |
| 1575 | obj.value = reader.read("!B")[0] |
| 1576 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1577 | return obj |
| 1578 | |
| 1579 | def __eq__(self, other): |
| 1580 | if type(self) != type(other): return False |
| 1581 | if self.value != other.value: return False |
| 1582 | if self.value_mask != other.value_mask: return False |
| 1583 | return True |
| 1584 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1585 | def pretty_print(self, q): |
| 1586 | q.text("icmpv4_type_masked {") |
| 1587 | with q.group(): |
| 1588 | with q.indent(2): |
| 1589 | q.breakable() |
| 1590 | q.text("value = "); |
| 1591 | q.text("%#x" % self.value) |
| 1592 | q.text(","); q.breakable() |
| 1593 | q.text("value_mask = "); |
| 1594 | q.text("%#x" % self.value_mask) |
| 1595 | q.breakable() |
| 1596 | q.text('}') |
| 1597 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1598 | oxm.subtypes[2147493634] = icmpv4_type_masked |
| 1599 | |
| 1600 | class icmpv6_code(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1601 | type_len = 2147499009 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1602 | |
| 1603 | def __init__(self, value=None): |
| 1604 | if value != None: |
| 1605 | self.value = value |
| 1606 | else: |
| 1607 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1608 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1609 | |
| 1610 | def pack(self): |
| 1611 | packed = [] |
| 1612 | packed.append(struct.pack("!L", self.type_len)) |
| 1613 | packed.append(struct.pack("!B", self.value)) |
| 1614 | return ''.join(packed) |
| 1615 | |
| 1616 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1617 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1618 | obj = icmpv6_code() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1619 | _type_len = reader.read("!L")[0] |
| 1620 | assert(_type_len == 2147499009) |
| 1621 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1622 | 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 | return True |
| 1628 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1629 | def pretty_print(self, q): |
| 1630 | q.text("icmpv6_code {") |
| 1631 | with q.group(): |
| 1632 | with q.indent(2): |
| 1633 | q.breakable() |
| 1634 | q.text("value = "); |
| 1635 | q.text("%#x" % self.value) |
| 1636 | q.breakable() |
| 1637 | q.text('}') |
| 1638 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1639 | oxm.subtypes[2147499009] = icmpv6_code |
| 1640 | |
| 1641 | class icmpv6_code_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1642 | type_len = 2147499266 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1643 | |
| 1644 | def __init__(self, value=None, value_mask=None): |
| 1645 | if value != None: |
| 1646 | self.value = value |
| 1647 | else: |
| 1648 | self.value = 0 |
| 1649 | if value_mask != None: |
| 1650 | self.value_mask = value_mask |
| 1651 | else: |
| 1652 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1653 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1654 | |
| 1655 | def pack(self): |
| 1656 | packed = [] |
| 1657 | packed.append(struct.pack("!L", self.type_len)) |
| 1658 | packed.append(struct.pack("!B", self.value)) |
| 1659 | packed.append(struct.pack("!B", self.value_mask)) |
| 1660 | return ''.join(packed) |
| 1661 | |
| 1662 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1663 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1664 | obj = icmpv6_code_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1665 | _type_len = reader.read("!L")[0] |
| 1666 | assert(_type_len == 2147499266) |
| 1667 | obj.value = reader.read("!B")[0] |
| 1668 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1669 | return obj |
| 1670 | |
| 1671 | def __eq__(self, other): |
| 1672 | if type(self) != type(other): return False |
| 1673 | if self.value != other.value: return False |
| 1674 | if self.value_mask != other.value_mask: return False |
| 1675 | return True |
| 1676 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1677 | def pretty_print(self, q): |
| 1678 | q.text("icmpv6_code_masked {") |
| 1679 | with q.group(): |
| 1680 | with q.indent(2): |
| 1681 | q.breakable() |
| 1682 | q.text("value = "); |
| 1683 | q.text("%#x" % self.value) |
| 1684 | q.text(","); q.breakable() |
| 1685 | q.text("value_mask = "); |
| 1686 | q.text("%#x" % self.value_mask) |
| 1687 | q.breakable() |
| 1688 | q.text('}') |
| 1689 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1690 | oxm.subtypes[2147499266] = icmpv6_code_masked |
| 1691 | |
| 1692 | class icmpv6_type(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1693 | type_len = 2147498497 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1694 | |
| 1695 | def __init__(self, value=None): |
| 1696 | if value != None: |
| 1697 | self.value = value |
| 1698 | else: |
| 1699 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1700 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1701 | |
| 1702 | def pack(self): |
| 1703 | packed = [] |
| 1704 | packed.append(struct.pack("!L", self.type_len)) |
| 1705 | packed.append(struct.pack("!B", self.value)) |
| 1706 | return ''.join(packed) |
| 1707 | |
| 1708 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1709 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1710 | obj = icmpv6_type() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1711 | _type_len = reader.read("!L")[0] |
| 1712 | assert(_type_len == 2147498497) |
| 1713 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1714 | return obj |
| 1715 | |
| 1716 | def __eq__(self, other): |
| 1717 | if type(self) != type(other): return False |
| 1718 | if self.value != other.value: return False |
| 1719 | return True |
| 1720 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1721 | def pretty_print(self, q): |
| 1722 | q.text("icmpv6_type {") |
| 1723 | with q.group(): |
| 1724 | with q.indent(2): |
| 1725 | q.breakable() |
| 1726 | q.text("value = "); |
| 1727 | q.text("%#x" % self.value) |
| 1728 | q.breakable() |
| 1729 | q.text('}') |
| 1730 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1731 | oxm.subtypes[2147498497] = icmpv6_type |
| 1732 | |
| 1733 | class icmpv6_type_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1734 | type_len = 2147498754 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1735 | |
| 1736 | def __init__(self, value=None, value_mask=None): |
| 1737 | if value != None: |
| 1738 | self.value = value |
| 1739 | else: |
| 1740 | self.value = 0 |
| 1741 | if value_mask != None: |
| 1742 | self.value_mask = value_mask |
| 1743 | else: |
| 1744 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1745 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1746 | |
| 1747 | def pack(self): |
| 1748 | packed = [] |
| 1749 | packed.append(struct.pack("!L", self.type_len)) |
| 1750 | packed.append(struct.pack("!B", self.value)) |
| 1751 | packed.append(struct.pack("!B", self.value_mask)) |
| 1752 | return ''.join(packed) |
| 1753 | |
| 1754 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1755 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1756 | obj = icmpv6_type_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1757 | _type_len = reader.read("!L")[0] |
| 1758 | assert(_type_len == 2147498754) |
| 1759 | obj.value = reader.read("!B")[0] |
| 1760 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1761 | return obj |
| 1762 | |
| 1763 | def __eq__(self, other): |
| 1764 | if type(self) != type(other): return False |
| 1765 | if self.value != other.value: return False |
| 1766 | if self.value_mask != other.value_mask: return False |
| 1767 | return True |
| 1768 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1769 | def pretty_print(self, q): |
| 1770 | q.text("icmpv6_type_masked {") |
| 1771 | with q.group(): |
| 1772 | with q.indent(2): |
| 1773 | q.breakable() |
| 1774 | q.text("value = "); |
| 1775 | q.text("%#x" % self.value) |
| 1776 | q.text(","); q.breakable() |
| 1777 | q.text("value_mask = "); |
| 1778 | q.text("%#x" % self.value_mask) |
| 1779 | q.breakable() |
| 1780 | q.text('}') |
| 1781 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1782 | oxm.subtypes[2147498754] = icmpv6_type_masked |
| 1783 | |
| 1784 | class in_phy_port(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1785 | type_len = 2147484164 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1786 | |
| 1787 | def __init__(self, value=None): |
| 1788 | if value != None: |
| 1789 | self.value = value |
| 1790 | else: |
| 1791 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1792 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1793 | |
| 1794 | def pack(self): |
| 1795 | packed = [] |
| 1796 | packed.append(struct.pack("!L", self.type_len)) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1797 | packed.append(util.pack_port_no(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1798 | return ''.join(packed) |
| 1799 | |
| 1800 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1801 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1802 | obj = in_phy_port() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1803 | _type_len = reader.read("!L")[0] |
| 1804 | assert(_type_len == 2147484164) |
| 1805 | obj.value = util.unpack_port_no(reader) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1806 | return obj |
| 1807 | |
| 1808 | def __eq__(self, other): |
| 1809 | if type(self) != type(other): return False |
| 1810 | if self.value != other.value: return False |
| 1811 | return True |
| 1812 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1813 | def pretty_print(self, q): |
| 1814 | q.text("in_phy_port {") |
| 1815 | with q.group(): |
| 1816 | with q.indent(2): |
| 1817 | q.breakable() |
| 1818 | q.text("value = "); |
| 1819 | q.text(util.pretty_port(self.value)) |
| 1820 | q.breakable() |
| 1821 | q.text('}') |
| 1822 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1823 | oxm.subtypes[2147484164] = in_phy_port |
| 1824 | |
| 1825 | class in_phy_port_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1826 | type_len = 2147484424 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1827 | |
| 1828 | def __init__(self, value=None, value_mask=None): |
| 1829 | if value != None: |
| 1830 | self.value = value |
| 1831 | else: |
| 1832 | self.value = 0 |
| 1833 | if value_mask != None: |
| 1834 | self.value_mask = value_mask |
| 1835 | else: |
| 1836 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1837 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1838 | |
| 1839 | def pack(self): |
| 1840 | packed = [] |
| 1841 | packed.append(struct.pack("!L", self.type_len)) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1842 | packed.append(util.pack_port_no(self.value)) |
| 1843 | packed.append(util.pack_port_no(self.value_mask)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1844 | return ''.join(packed) |
| 1845 | |
| 1846 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1847 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1848 | obj = in_phy_port_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1849 | _type_len = reader.read("!L")[0] |
| 1850 | assert(_type_len == 2147484424) |
| 1851 | obj.value = util.unpack_port_no(reader) |
| 1852 | obj.value_mask = util.unpack_port_no(reader) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1853 | return obj |
| 1854 | |
| 1855 | def __eq__(self, other): |
| 1856 | if type(self) != type(other): return False |
| 1857 | if self.value != other.value: return False |
| 1858 | if self.value_mask != other.value_mask: return False |
| 1859 | return True |
| 1860 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1861 | def pretty_print(self, q): |
| 1862 | q.text("in_phy_port_masked {") |
| 1863 | with q.group(): |
| 1864 | with q.indent(2): |
| 1865 | q.breakable() |
| 1866 | q.text("value = "); |
| 1867 | q.text(util.pretty_port(self.value)) |
| 1868 | q.text(","); q.breakable() |
| 1869 | q.text("value_mask = "); |
| 1870 | q.text(util.pretty_port(self.value_mask)) |
| 1871 | q.breakable() |
| 1872 | q.text('}') |
| 1873 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1874 | oxm.subtypes[2147484424] = in_phy_port_masked |
| 1875 | |
| 1876 | class in_port(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1877 | type_len = 2147483652 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1878 | |
| 1879 | def __init__(self, value=None): |
| 1880 | if value != None: |
| 1881 | self.value = value |
| 1882 | else: |
| 1883 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1884 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1885 | |
| 1886 | def pack(self): |
| 1887 | packed = [] |
| 1888 | packed.append(struct.pack("!L", self.type_len)) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1889 | packed.append(util.pack_port_no(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1890 | return ''.join(packed) |
| 1891 | |
| 1892 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1893 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1894 | obj = in_port() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1895 | _type_len = reader.read("!L")[0] |
| 1896 | assert(_type_len == 2147483652) |
| 1897 | obj.value = util.unpack_port_no(reader) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1898 | return obj |
| 1899 | |
| 1900 | def __eq__(self, other): |
| 1901 | if type(self) != type(other): return False |
| 1902 | if self.value != other.value: return False |
| 1903 | return True |
| 1904 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1905 | def pretty_print(self, q): |
| 1906 | q.text("in_port {") |
| 1907 | with q.group(): |
| 1908 | with q.indent(2): |
| 1909 | q.breakable() |
| 1910 | q.text("value = "); |
| 1911 | q.text(util.pretty_port(self.value)) |
| 1912 | q.breakable() |
| 1913 | q.text('}') |
| 1914 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1915 | oxm.subtypes[2147483652] = in_port |
| 1916 | |
| 1917 | class in_port_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1918 | type_len = 2147483912 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1919 | |
| 1920 | def __init__(self, value=None, value_mask=None): |
| 1921 | if value != None: |
| 1922 | self.value = value |
| 1923 | else: |
| 1924 | self.value = 0 |
| 1925 | if value_mask != None: |
| 1926 | self.value_mask = value_mask |
| 1927 | else: |
| 1928 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1929 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1930 | |
| 1931 | def pack(self): |
| 1932 | packed = [] |
| 1933 | packed.append(struct.pack("!L", self.type_len)) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1934 | packed.append(util.pack_port_no(self.value)) |
| 1935 | packed.append(util.pack_port_no(self.value_mask)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1936 | return ''.join(packed) |
| 1937 | |
| 1938 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1939 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1940 | obj = in_port_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1941 | _type_len = reader.read("!L")[0] |
| 1942 | assert(_type_len == 2147483912) |
| 1943 | obj.value = util.unpack_port_no(reader) |
| 1944 | obj.value_mask = util.unpack_port_no(reader) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1945 | return obj |
| 1946 | |
| 1947 | def __eq__(self, other): |
| 1948 | if type(self) != type(other): return False |
| 1949 | if self.value != other.value: return False |
| 1950 | if self.value_mask != other.value_mask: return False |
| 1951 | return True |
| 1952 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1953 | def pretty_print(self, q): |
| 1954 | q.text("in_port_masked {") |
| 1955 | with q.group(): |
| 1956 | with q.indent(2): |
| 1957 | q.breakable() |
| 1958 | q.text("value = "); |
| 1959 | q.text(util.pretty_port(self.value)) |
| 1960 | q.text(","); q.breakable() |
| 1961 | q.text("value_mask = "); |
| 1962 | q.text(util.pretty_port(self.value_mask)) |
| 1963 | q.breakable() |
| 1964 | q.text('}') |
| 1965 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1966 | oxm.subtypes[2147483912] = in_port_masked |
| 1967 | |
| 1968 | class ip_dscp(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1969 | type_len = 2147487745 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1970 | |
| 1971 | def __init__(self, value=None): |
| 1972 | if value != None: |
| 1973 | self.value = value |
| 1974 | else: |
| 1975 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1976 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1977 | |
| 1978 | def pack(self): |
| 1979 | packed = [] |
| 1980 | packed.append(struct.pack("!L", self.type_len)) |
| 1981 | packed.append(struct.pack("!B", self.value)) |
| 1982 | return ''.join(packed) |
| 1983 | |
| 1984 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1985 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1986 | obj = ip_dscp() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1987 | _type_len = reader.read("!L")[0] |
| 1988 | assert(_type_len == 2147487745) |
| 1989 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1990 | return obj |
| 1991 | |
| 1992 | def __eq__(self, other): |
| 1993 | if type(self) != type(other): return False |
| 1994 | if self.value != other.value: return False |
| 1995 | return True |
| 1996 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1997 | def pretty_print(self, q): |
| 1998 | q.text("ip_dscp {") |
| 1999 | with q.group(): |
| 2000 | with q.indent(2): |
| 2001 | q.breakable() |
| 2002 | q.text("value = "); |
| 2003 | q.text("%#x" % self.value) |
| 2004 | q.breakable() |
| 2005 | q.text('}') |
| 2006 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2007 | oxm.subtypes[2147487745] = ip_dscp |
| 2008 | |
| 2009 | class ip_dscp_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2010 | type_len = 2147488002 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2011 | |
| 2012 | def __init__(self, value=None, value_mask=None): |
| 2013 | if value != None: |
| 2014 | self.value = value |
| 2015 | else: |
| 2016 | self.value = 0 |
| 2017 | if value_mask != None: |
| 2018 | self.value_mask = value_mask |
| 2019 | else: |
| 2020 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2021 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2022 | |
| 2023 | def pack(self): |
| 2024 | packed = [] |
| 2025 | packed.append(struct.pack("!L", self.type_len)) |
| 2026 | packed.append(struct.pack("!B", self.value)) |
| 2027 | packed.append(struct.pack("!B", self.value_mask)) |
| 2028 | return ''.join(packed) |
| 2029 | |
| 2030 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2031 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2032 | obj = ip_dscp_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2033 | _type_len = reader.read("!L")[0] |
| 2034 | assert(_type_len == 2147488002) |
| 2035 | obj.value = reader.read("!B")[0] |
| 2036 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2037 | return obj |
| 2038 | |
| 2039 | def __eq__(self, other): |
| 2040 | if type(self) != type(other): return False |
| 2041 | if self.value != other.value: return False |
| 2042 | if self.value_mask != other.value_mask: return False |
| 2043 | return True |
| 2044 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2045 | def pretty_print(self, q): |
| 2046 | q.text("ip_dscp_masked {") |
| 2047 | with q.group(): |
| 2048 | with q.indent(2): |
| 2049 | q.breakable() |
| 2050 | q.text("value = "); |
| 2051 | q.text("%#x" % self.value) |
| 2052 | q.text(","); q.breakable() |
| 2053 | q.text("value_mask = "); |
| 2054 | q.text("%#x" % self.value_mask) |
| 2055 | q.breakable() |
| 2056 | q.text('}') |
| 2057 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2058 | oxm.subtypes[2147488002] = ip_dscp_masked |
| 2059 | |
| 2060 | class ip_ecn(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2061 | type_len = 2147488257 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2062 | |
| 2063 | def __init__(self, value=None): |
| 2064 | if value != None: |
| 2065 | self.value = value |
| 2066 | else: |
| 2067 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2068 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2069 | |
| 2070 | def pack(self): |
| 2071 | packed = [] |
| 2072 | packed.append(struct.pack("!L", self.type_len)) |
| 2073 | packed.append(struct.pack("!B", self.value)) |
| 2074 | return ''.join(packed) |
| 2075 | |
| 2076 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2077 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2078 | obj = ip_ecn() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2079 | _type_len = reader.read("!L")[0] |
| 2080 | assert(_type_len == 2147488257) |
| 2081 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2082 | return obj |
| 2083 | |
| 2084 | def __eq__(self, other): |
| 2085 | if type(self) != type(other): return False |
| 2086 | if self.value != other.value: return False |
| 2087 | return True |
| 2088 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2089 | def pretty_print(self, q): |
| 2090 | q.text("ip_ecn {") |
| 2091 | with q.group(): |
| 2092 | with q.indent(2): |
| 2093 | q.breakable() |
| 2094 | q.text("value = "); |
| 2095 | q.text("%#x" % self.value) |
| 2096 | q.breakable() |
| 2097 | q.text('}') |
| 2098 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2099 | oxm.subtypes[2147488257] = ip_ecn |
| 2100 | |
| 2101 | class ip_ecn_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2102 | type_len = 2147488514 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2103 | |
| 2104 | def __init__(self, value=None, value_mask=None): |
| 2105 | if value != None: |
| 2106 | self.value = value |
| 2107 | else: |
| 2108 | self.value = 0 |
| 2109 | if value_mask != None: |
| 2110 | self.value_mask = value_mask |
| 2111 | else: |
| 2112 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2113 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2114 | |
| 2115 | def pack(self): |
| 2116 | packed = [] |
| 2117 | packed.append(struct.pack("!L", self.type_len)) |
| 2118 | packed.append(struct.pack("!B", self.value)) |
| 2119 | packed.append(struct.pack("!B", self.value_mask)) |
| 2120 | return ''.join(packed) |
| 2121 | |
| 2122 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2123 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2124 | obj = ip_ecn_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2125 | _type_len = reader.read("!L")[0] |
| 2126 | assert(_type_len == 2147488514) |
| 2127 | obj.value = reader.read("!B")[0] |
| 2128 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2129 | return obj |
| 2130 | |
| 2131 | def __eq__(self, other): |
| 2132 | if type(self) != type(other): return False |
| 2133 | if self.value != other.value: return False |
| 2134 | if self.value_mask != other.value_mask: return False |
| 2135 | return True |
| 2136 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2137 | def pretty_print(self, q): |
| 2138 | q.text("ip_ecn_masked {") |
| 2139 | with q.group(): |
| 2140 | with q.indent(2): |
| 2141 | q.breakable() |
| 2142 | q.text("value = "); |
| 2143 | q.text("%#x" % self.value) |
| 2144 | q.text(","); q.breakable() |
| 2145 | q.text("value_mask = "); |
| 2146 | q.text("%#x" % self.value_mask) |
| 2147 | q.breakable() |
| 2148 | q.text('}') |
| 2149 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2150 | oxm.subtypes[2147488514] = ip_ecn_masked |
| 2151 | |
| 2152 | class ip_proto(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2153 | type_len = 2147488769 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2154 | |
| 2155 | def __init__(self, value=None): |
| 2156 | if value != None: |
| 2157 | self.value = value |
| 2158 | else: |
| 2159 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2160 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2161 | |
| 2162 | def pack(self): |
| 2163 | packed = [] |
| 2164 | packed.append(struct.pack("!L", self.type_len)) |
| 2165 | packed.append(struct.pack("!B", self.value)) |
| 2166 | return ''.join(packed) |
| 2167 | |
| 2168 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2169 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2170 | obj = ip_proto() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2171 | _type_len = reader.read("!L")[0] |
| 2172 | assert(_type_len == 2147488769) |
| 2173 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2174 | return obj |
| 2175 | |
| 2176 | def __eq__(self, other): |
| 2177 | if type(self) != type(other): return False |
| 2178 | if self.value != other.value: return False |
| 2179 | return True |
| 2180 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2181 | def pretty_print(self, q): |
| 2182 | q.text("ip_proto {") |
| 2183 | with q.group(): |
| 2184 | with q.indent(2): |
| 2185 | q.breakable() |
| 2186 | q.text("value = "); |
| 2187 | q.text("%#x" % self.value) |
| 2188 | q.breakable() |
| 2189 | q.text('}') |
| 2190 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2191 | oxm.subtypes[2147488769] = ip_proto |
| 2192 | |
| 2193 | class ip_proto_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2194 | type_len = 2147489026 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2195 | |
| 2196 | def __init__(self, value=None, value_mask=None): |
| 2197 | if value != None: |
| 2198 | self.value = value |
| 2199 | else: |
| 2200 | self.value = 0 |
| 2201 | if value_mask != None: |
| 2202 | self.value_mask = value_mask |
| 2203 | else: |
| 2204 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2205 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2206 | |
| 2207 | def pack(self): |
| 2208 | packed = [] |
| 2209 | packed.append(struct.pack("!L", self.type_len)) |
| 2210 | packed.append(struct.pack("!B", self.value)) |
| 2211 | packed.append(struct.pack("!B", self.value_mask)) |
| 2212 | return ''.join(packed) |
| 2213 | |
| 2214 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2215 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2216 | obj = ip_proto_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2217 | _type_len = reader.read("!L")[0] |
| 2218 | assert(_type_len == 2147489026) |
| 2219 | obj.value = reader.read("!B")[0] |
| 2220 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2221 | return obj |
| 2222 | |
| 2223 | def __eq__(self, other): |
| 2224 | if type(self) != type(other): return False |
| 2225 | if self.value != other.value: return False |
| 2226 | if self.value_mask != other.value_mask: return False |
| 2227 | return True |
| 2228 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2229 | def pretty_print(self, q): |
| 2230 | q.text("ip_proto_masked {") |
| 2231 | with q.group(): |
| 2232 | with q.indent(2): |
| 2233 | q.breakable() |
| 2234 | q.text("value = "); |
| 2235 | q.text("%#x" % self.value) |
| 2236 | q.text(","); q.breakable() |
| 2237 | q.text("value_mask = "); |
| 2238 | q.text("%#x" % self.value_mask) |
| 2239 | q.breakable() |
| 2240 | q.text('}') |
| 2241 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2242 | oxm.subtypes[2147489026] = ip_proto_masked |
| 2243 | |
| 2244 | class ipv4_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2245 | type_len = 2147489796 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2246 | |
| 2247 | def __init__(self, value=None): |
| 2248 | if value != None: |
| 2249 | self.value = value |
| 2250 | else: |
| 2251 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2252 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2253 | |
| 2254 | def pack(self): |
| 2255 | packed = [] |
| 2256 | packed.append(struct.pack("!L", self.type_len)) |
| 2257 | packed.append(struct.pack("!L", self.value)) |
| 2258 | return ''.join(packed) |
| 2259 | |
| 2260 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2261 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2262 | obj = ipv4_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2263 | _type_len = reader.read("!L")[0] |
| 2264 | assert(_type_len == 2147489796) |
| 2265 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2266 | return obj |
| 2267 | |
| 2268 | def __eq__(self, other): |
| 2269 | if type(self) != type(other): return False |
| 2270 | if self.value != other.value: return False |
| 2271 | return True |
| 2272 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2273 | def pretty_print(self, q): |
| 2274 | q.text("ipv4_dst {") |
| 2275 | with q.group(): |
| 2276 | with q.indent(2): |
| 2277 | q.breakable() |
| 2278 | q.text("value = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 2279 | q.text(util.pretty_ipv4(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2280 | q.breakable() |
| 2281 | q.text('}') |
| 2282 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2283 | oxm.subtypes[2147489796] = ipv4_dst |
| 2284 | |
| 2285 | class ipv4_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2286 | type_len = 2147490056 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2287 | |
| 2288 | def __init__(self, value=None, value_mask=None): |
| 2289 | if value != None: |
| 2290 | self.value = value |
| 2291 | else: |
| 2292 | self.value = 0 |
| 2293 | if value_mask != None: |
| 2294 | self.value_mask = value_mask |
| 2295 | else: |
| 2296 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2297 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2298 | |
| 2299 | def pack(self): |
| 2300 | packed = [] |
| 2301 | packed.append(struct.pack("!L", self.type_len)) |
| 2302 | packed.append(struct.pack("!L", self.value)) |
| 2303 | packed.append(struct.pack("!L", self.value_mask)) |
| 2304 | return ''.join(packed) |
| 2305 | |
| 2306 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2307 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2308 | obj = ipv4_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2309 | _type_len = reader.read("!L")[0] |
| 2310 | assert(_type_len == 2147490056) |
| 2311 | obj.value = reader.read("!L")[0] |
| 2312 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2313 | return obj |
| 2314 | |
| 2315 | def __eq__(self, other): |
| 2316 | if type(self) != type(other): return False |
| 2317 | if self.value != other.value: return False |
| 2318 | if self.value_mask != other.value_mask: return False |
| 2319 | return True |
| 2320 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2321 | def pretty_print(self, q): |
| 2322 | q.text("ipv4_dst_masked {") |
| 2323 | with q.group(): |
| 2324 | with q.indent(2): |
| 2325 | q.breakable() |
| 2326 | q.text("value = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 2327 | q.text(util.pretty_ipv4(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2328 | q.text(","); q.breakable() |
| 2329 | q.text("value_mask = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 2330 | q.text(util.pretty_ipv4(self.value_mask)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2331 | q.breakable() |
| 2332 | q.text('}') |
| 2333 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2334 | oxm.subtypes[2147490056] = ipv4_dst_masked |
| 2335 | |
| 2336 | class ipv4_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2337 | type_len = 2147489284 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2338 | |
| 2339 | def __init__(self, value=None): |
| 2340 | if value != None: |
| 2341 | self.value = value |
| 2342 | else: |
| 2343 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2344 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2345 | |
| 2346 | def pack(self): |
| 2347 | packed = [] |
| 2348 | packed.append(struct.pack("!L", self.type_len)) |
| 2349 | packed.append(struct.pack("!L", self.value)) |
| 2350 | return ''.join(packed) |
| 2351 | |
| 2352 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2353 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2354 | obj = ipv4_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2355 | _type_len = reader.read("!L")[0] |
| 2356 | assert(_type_len == 2147489284) |
| 2357 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2358 | return obj |
| 2359 | |
| 2360 | def __eq__(self, other): |
| 2361 | if type(self) != type(other): return False |
| 2362 | if self.value != other.value: return False |
| 2363 | return True |
| 2364 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2365 | def pretty_print(self, q): |
| 2366 | q.text("ipv4_src {") |
| 2367 | with q.group(): |
| 2368 | with q.indent(2): |
| 2369 | q.breakable() |
| 2370 | q.text("value = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 2371 | q.text(util.pretty_ipv4(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2372 | q.breakable() |
| 2373 | q.text('}') |
| 2374 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2375 | oxm.subtypes[2147489284] = ipv4_src |
| 2376 | |
| 2377 | class ipv4_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2378 | type_len = 2147489544 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2379 | |
| 2380 | def __init__(self, value=None, value_mask=None): |
| 2381 | if value != None: |
| 2382 | self.value = value |
| 2383 | else: |
| 2384 | self.value = 0 |
| 2385 | if value_mask != None: |
| 2386 | self.value_mask = value_mask |
| 2387 | else: |
| 2388 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2389 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2390 | |
| 2391 | def pack(self): |
| 2392 | packed = [] |
| 2393 | packed.append(struct.pack("!L", self.type_len)) |
| 2394 | packed.append(struct.pack("!L", self.value)) |
| 2395 | packed.append(struct.pack("!L", self.value_mask)) |
| 2396 | return ''.join(packed) |
| 2397 | |
| 2398 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2399 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2400 | obj = ipv4_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2401 | _type_len = reader.read("!L")[0] |
| 2402 | assert(_type_len == 2147489544) |
| 2403 | obj.value = reader.read("!L")[0] |
| 2404 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2405 | return obj |
| 2406 | |
| 2407 | def __eq__(self, other): |
| 2408 | if type(self) != type(other): return False |
| 2409 | if self.value != other.value: return False |
| 2410 | if self.value_mask != other.value_mask: return False |
| 2411 | return True |
| 2412 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2413 | def pretty_print(self, q): |
| 2414 | q.text("ipv4_src_masked {") |
| 2415 | with q.group(): |
| 2416 | with q.indent(2): |
| 2417 | q.breakable() |
| 2418 | q.text("value = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 2419 | q.text(util.pretty_ipv4(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2420 | q.text(","); q.breakable() |
| 2421 | q.text("value_mask = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 2422 | q.text(util.pretty_ipv4(self.value_mask)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2423 | q.breakable() |
| 2424 | q.text('}') |
| 2425 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2426 | oxm.subtypes[2147489544] = ipv4_src_masked |
| 2427 | |
| 2428 | class ipv6_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2429 | type_len = 2147497488 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2430 | |
| 2431 | def __init__(self, value=None): |
| 2432 | if value != None: |
| 2433 | self.value = value |
| 2434 | else: |
| 2435 | self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2436 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2437 | |
| 2438 | def pack(self): |
| 2439 | packed = [] |
| 2440 | packed.append(struct.pack("!L", self.type_len)) |
| 2441 | packed.append(struct.pack("!16s", self.value)) |
| 2442 | return ''.join(packed) |
| 2443 | |
| 2444 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2445 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2446 | obj = ipv6_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2447 | _type_len = reader.read("!L")[0] |
| 2448 | assert(_type_len == 2147497488) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2449 | obj.value = reader.read('!16s')[0] |
| 2450 | return obj |
| 2451 | |
| 2452 | def __eq__(self, other): |
| 2453 | if type(self) != type(other): return False |
| 2454 | if self.value != other.value: return False |
| 2455 | return True |
| 2456 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2457 | def pretty_print(self, q): |
| 2458 | q.text("ipv6_dst {") |
| 2459 | with q.group(): |
| 2460 | with q.indent(2): |
| 2461 | q.breakable() |
| 2462 | q.text("value = "); |
| 2463 | q.pp(self.value) |
| 2464 | q.breakable() |
| 2465 | q.text('}') |
| 2466 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2467 | oxm.subtypes[2147497488] = ipv6_dst |
| 2468 | |
| 2469 | class ipv6_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2470 | type_len = 2147497760 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2471 | |
| 2472 | def __init__(self, value=None, value_mask=None): |
| 2473 | if value != None: |
| 2474 | self.value = value |
| 2475 | else: |
| 2476 | self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
| 2477 | if value_mask != None: |
| 2478 | self.value_mask = value_mask |
| 2479 | else: |
| 2480 | self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2481 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2482 | |
| 2483 | def pack(self): |
| 2484 | packed = [] |
| 2485 | packed.append(struct.pack("!L", self.type_len)) |
| 2486 | packed.append(struct.pack("!16s", self.value)) |
| 2487 | packed.append(struct.pack("!16s", self.value_mask)) |
| 2488 | return ''.join(packed) |
| 2489 | |
| 2490 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2491 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2492 | obj = ipv6_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2493 | _type_len = reader.read("!L")[0] |
| 2494 | assert(_type_len == 2147497760) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2495 | obj.value = reader.read('!16s')[0] |
| 2496 | obj.value_mask = reader.read('!16s')[0] |
| 2497 | return obj |
| 2498 | |
| 2499 | def __eq__(self, other): |
| 2500 | if type(self) != type(other): return False |
| 2501 | if self.value != other.value: return False |
| 2502 | if self.value_mask != other.value_mask: return False |
| 2503 | return True |
| 2504 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2505 | def pretty_print(self, q): |
| 2506 | q.text("ipv6_dst_masked {") |
| 2507 | with q.group(): |
| 2508 | with q.indent(2): |
| 2509 | q.breakable() |
| 2510 | q.text("value = "); |
| 2511 | q.pp(self.value) |
| 2512 | q.text(","); q.breakable() |
| 2513 | q.text("value_mask = "); |
| 2514 | q.pp(self.value_mask) |
| 2515 | q.breakable() |
| 2516 | q.text('}') |
| 2517 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2518 | oxm.subtypes[2147497760] = ipv6_dst_masked |
| 2519 | |
| 2520 | class ipv6_flabel(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2521 | type_len = 2147497988 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2522 | |
| 2523 | def __init__(self, value=None): |
| 2524 | if value != None: |
| 2525 | self.value = value |
| 2526 | else: |
| 2527 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2528 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2529 | |
| 2530 | def pack(self): |
| 2531 | packed = [] |
| 2532 | packed.append(struct.pack("!L", self.type_len)) |
| 2533 | packed.append(struct.pack("!L", self.value)) |
| 2534 | return ''.join(packed) |
| 2535 | |
| 2536 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2537 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2538 | obj = ipv6_flabel() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2539 | _type_len = reader.read("!L")[0] |
| 2540 | assert(_type_len == 2147497988) |
| 2541 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2542 | return obj |
| 2543 | |
| 2544 | def __eq__(self, other): |
| 2545 | if type(self) != type(other): return False |
| 2546 | if self.value != other.value: return False |
| 2547 | return True |
| 2548 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2549 | def pretty_print(self, q): |
| 2550 | q.text("ipv6_flabel {") |
| 2551 | with q.group(): |
| 2552 | with q.indent(2): |
| 2553 | q.breakable() |
| 2554 | q.text("value = "); |
| 2555 | q.text("%#x" % self.value) |
| 2556 | q.breakable() |
| 2557 | q.text('}') |
| 2558 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2559 | oxm.subtypes[2147497988] = ipv6_flabel |
| 2560 | |
| 2561 | class ipv6_flabel_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2562 | type_len = 2147498248 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2563 | |
| 2564 | def __init__(self, value=None, value_mask=None): |
| 2565 | if value != None: |
| 2566 | self.value = value |
| 2567 | else: |
| 2568 | self.value = 0 |
| 2569 | if value_mask != None: |
| 2570 | self.value_mask = value_mask |
| 2571 | else: |
| 2572 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2573 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2574 | |
| 2575 | def pack(self): |
| 2576 | packed = [] |
| 2577 | packed.append(struct.pack("!L", self.type_len)) |
| 2578 | packed.append(struct.pack("!L", self.value)) |
| 2579 | packed.append(struct.pack("!L", self.value_mask)) |
| 2580 | return ''.join(packed) |
| 2581 | |
| 2582 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2583 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2584 | obj = ipv6_flabel_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2585 | _type_len = reader.read("!L")[0] |
| 2586 | assert(_type_len == 2147498248) |
| 2587 | obj.value = reader.read("!L")[0] |
| 2588 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2589 | return obj |
| 2590 | |
| 2591 | def __eq__(self, other): |
| 2592 | if type(self) != type(other): return False |
| 2593 | if self.value != other.value: return False |
| 2594 | if self.value_mask != other.value_mask: return False |
| 2595 | return True |
| 2596 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2597 | def pretty_print(self, q): |
| 2598 | q.text("ipv6_flabel_masked {") |
| 2599 | with q.group(): |
| 2600 | with q.indent(2): |
| 2601 | q.breakable() |
| 2602 | q.text("value = "); |
| 2603 | q.text("%#x" % self.value) |
| 2604 | q.text(","); q.breakable() |
| 2605 | q.text("value_mask = "); |
| 2606 | q.text("%#x" % self.value_mask) |
| 2607 | q.breakable() |
| 2608 | q.text('}') |
| 2609 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2610 | oxm.subtypes[2147498248] = ipv6_flabel_masked |
| 2611 | |
| 2612 | class ipv6_nd_sll(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2613 | type_len = 2147500038 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2614 | |
| 2615 | def __init__(self, value=None): |
| 2616 | if value != None: |
| 2617 | self.value = value |
| 2618 | else: |
| 2619 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2620 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2621 | |
| 2622 | def pack(self): |
| 2623 | packed = [] |
| 2624 | packed.append(struct.pack("!L", self.type_len)) |
| 2625 | packed.append(struct.pack("!6B", *self.value)) |
| 2626 | return ''.join(packed) |
| 2627 | |
| 2628 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2629 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2630 | obj = ipv6_nd_sll() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2631 | _type_len = reader.read("!L")[0] |
| 2632 | assert(_type_len == 2147500038) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2633 | obj.value = list(reader.read('!6B')) |
| 2634 | return obj |
| 2635 | |
| 2636 | def __eq__(self, other): |
| 2637 | if type(self) != type(other): return False |
| 2638 | if self.value != other.value: return False |
| 2639 | return True |
| 2640 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2641 | def pretty_print(self, q): |
| 2642 | q.text("ipv6_nd_sll {") |
| 2643 | with q.group(): |
| 2644 | with q.indent(2): |
| 2645 | q.breakable() |
| 2646 | q.text("value = "); |
| 2647 | q.text(util.pretty_mac(self.value)) |
| 2648 | q.breakable() |
| 2649 | q.text('}') |
| 2650 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2651 | oxm.subtypes[2147500038] = ipv6_nd_sll |
| 2652 | |
| 2653 | class ipv6_nd_sll_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2654 | type_len = 2147500300 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2655 | |
| 2656 | def __init__(self, value=None, value_mask=None): |
| 2657 | if value != None: |
| 2658 | self.value = value |
| 2659 | else: |
| 2660 | self.value = [0,0,0,0,0,0] |
| 2661 | if value_mask != None: |
| 2662 | self.value_mask = value_mask |
| 2663 | else: |
| 2664 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2665 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2666 | |
| 2667 | def pack(self): |
| 2668 | packed = [] |
| 2669 | packed.append(struct.pack("!L", self.type_len)) |
| 2670 | packed.append(struct.pack("!6B", *self.value)) |
| 2671 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 2672 | return ''.join(packed) |
| 2673 | |
| 2674 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2675 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2676 | obj = ipv6_nd_sll_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2677 | _type_len = reader.read("!L")[0] |
| 2678 | assert(_type_len == 2147500300) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2679 | obj.value = list(reader.read('!6B')) |
| 2680 | obj.value_mask = list(reader.read('!6B')) |
| 2681 | return obj |
| 2682 | |
| 2683 | def __eq__(self, other): |
| 2684 | if type(self) != type(other): return False |
| 2685 | if self.value != other.value: return False |
| 2686 | if self.value_mask != other.value_mask: return False |
| 2687 | return True |
| 2688 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2689 | def pretty_print(self, q): |
| 2690 | q.text("ipv6_nd_sll_masked {") |
| 2691 | with q.group(): |
| 2692 | with q.indent(2): |
| 2693 | q.breakable() |
| 2694 | q.text("value = "); |
| 2695 | q.text(util.pretty_mac(self.value)) |
| 2696 | q.text(","); q.breakable() |
| 2697 | q.text("value_mask = "); |
| 2698 | q.text(util.pretty_mac(self.value_mask)) |
| 2699 | q.breakable() |
| 2700 | q.text('}') |
| 2701 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2702 | oxm.subtypes[2147500300] = ipv6_nd_sll_masked |
| 2703 | |
| 2704 | class ipv6_nd_target(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2705 | type_len = 2147499536 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2706 | |
| 2707 | def __init__(self, value=None): |
| 2708 | if value != None: |
| 2709 | self.value = value |
| 2710 | else: |
| 2711 | self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2712 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2713 | |
| 2714 | def pack(self): |
| 2715 | packed = [] |
| 2716 | packed.append(struct.pack("!L", self.type_len)) |
| 2717 | packed.append(struct.pack("!16s", self.value)) |
| 2718 | return ''.join(packed) |
| 2719 | |
| 2720 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2721 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2722 | obj = ipv6_nd_target() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2723 | _type_len = reader.read("!L")[0] |
| 2724 | assert(_type_len == 2147499536) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2725 | obj.value = reader.read('!16s')[0] |
| 2726 | return obj |
| 2727 | |
| 2728 | def __eq__(self, other): |
| 2729 | if type(self) != type(other): return False |
| 2730 | if self.value != other.value: return False |
| 2731 | return True |
| 2732 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2733 | def pretty_print(self, q): |
| 2734 | q.text("ipv6_nd_target {") |
| 2735 | with q.group(): |
| 2736 | with q.indent(2): |
| 2737 | q.breakable() |
| 2738 | q.text("value = "); |
| 2739 | q.pp(self.value) |
| 2740 | q.breakable() |
| 2741 | q.text('}') |
| 2742 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2743 | oxm.subtypes[2147499536] = ipv6_nd_target |
| 2744 | |
| 2745 | class ipv6_nd_target_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2746 | type_len = 2147499808 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2747 | |
| 2748 | def __init__(self, value=None, value_mask=None): |
| 2749 | if value != None: |
| 2750 | self.value = value |
| 2751 | else: |
| 2752 | self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
| 2753 | if value_mask != None: |
| 2754 | self.value_mask = value_mask |
| 2755 | else: |
| 2756 | self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2757 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2758 | |
| 2759 | def pack(self): |
| 2760 | packed = [] |
| 2761 | packed.append(struct.pack("!L", self.type_len)) |
| 2762 | packed.append(struct.pack("!16s", self.value)) |
| 2763 | packed.append(struct.pack("!16s", self.value_mask)) |
| 2764 | return ''.join(packed) |
| 2765 | |
| 2766 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2767 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2768 | obj = ipv6_nd_target_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2769 | _type_len = reader.read("!L")[0] |
| 2770 | assert(_type_len == 2147499808) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2771 | obj.value = reader.read('!16s')[0] |
| 2772 | obj.value_mask = reader.read('!16s')[0] |
| 2773 | return obj |
| 2774 | |
| 2775 | def __eq__(self, other): |
| 2776 | if type(self) != type(other): return False |
| 2777 | if self.value != other.value: return False |
| 2778 | if self.value_mask != other.value_mask: return False |
| 2779 | return True |
| 2780 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2781 | def pretty_print(self, q): |
| 2782 | q.text("ipv6_nd_target_masked {") |
| 2783 | with q.group(): |
| 2784 | with q.indent(2): |
| 2785 | q.breakable() |
| 2786 | q.text("value = "); |
| 2787 | q.pp(self.value) |
| 2788 | q.text(","); q.breakable() |
| 2789 | q.text("value_mask = "); |
| 2790 | q.pp(self.value_mask) |
| 2791 | q.breakable() |
| 2792 | q.text('}') |
| 2793 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2794 | oxm.subtypes[2147499808] = ipv6_nd_target_masked |
| 2795 | |
| 2796 | class ipv6_nd_tll(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2797 | type_len = 2147500550 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2798 | |
| 2799 | def __init__(self, value=None): |
| 2800 | if value != None: |
| 2801 | self.value = value |
| 2802 | else: |
| 2803 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2804 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2805 | |
| 2806 | def pack(self): |
| 2807 | packed = [] |
| 2808 | packed.append(struct.pack("!L", self.type_len)) |
| 2809 | packed.append(struct.pack("!6B", *self.value)) |
| 2810 | return ''.join(packed) |
| 2811 | |
| 2812 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2813 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2814 | obj = ipv6_nd_tll() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2815 | _type_len = reader.read("!L")[0] |
| 2816 | assert(_type_len == 2147500550) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2817 | obj.value = list(reader.read('!6B')) |
| 2818 | return obj |
| 2819 | |
| 2820 | def __eq__(self, other): |
| 2821 | if type(self) != type(other): return False |
| 2822 | if self.value != other.value: return False |
| 2823 | return True |
| 2824 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2825 | def pretty_print(self, q): |
| 2826 | q.text("ipv6_nd_tll {") |
| 2827 | with q.group(): |
| 2828 | with q.indent(2): |
| 2829 | q.breakable() |
| 2830 | q.text("value = "); |
| 2831 | q.text(util.pretty_mac(self.value)) |
| 2832 | q.breakable() |
| 2833 | q.text('}') |
| 2834 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2835 | oxm.subtypes[2147500550] = ipv6_nd_tll |
| 2836 | |
| 2837 | class ipv6_nd_tll_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2838 | type_len = 2147500812 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2839 | |
| 2840 | def __init__(self, value=None, value_mask=None): |
| 2841 | if value != None: |
| 2842 | self.value = value |
| 2843 | else: |
| 2844 | self.value = [0,0,0,0,0,0] |
| 2845 | if value_mask != None: |
| 2846 | self.value_mask = value_mask |
| 2847 | else: |
| 2848 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2849 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2850 | |
| 2851 | def pack(self): |
| 2852 | packed = [] |
| 2853 | packed.append(struct.pack("!L", self.type_len)) |
| 2854 | packed.append(struct.pack("!6B", *self.value)) |
| 2855 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 2856 | return ''.join(packed) |
| 2857 | |
| 2858 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2859 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2860 | obj = ipv6_nd_tll_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2861 | _type_len = reader.read("!L")[0] |
| 2862 | assert(_type_len == 2147500812) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2863 | obj.value = list(reader.read('!6B')) |
| 2864 | obj.value_mask = list(reader.read('!6B')) |
| 2865 | return obj |
| 2866 | |
| 2867 | def __eq__(self, other): |
| 2868 | if type(self) != type(other): return False |
| 2869 | if self.value != other.value: return False |
| 2870 | if self.value_mask != other.value_mask: return False |
| 2871 | return True |
| 2872 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2873 | def pretty_print(self, q): |
| 2874 | q.text("ipv6_nd_tll_masked {") |
| 2875 | with q.group(): |
| 2876 | with q.indent(2): |
| 2877 | q.breakable() |
| 2878 | q.text("value = "); |
| 2879 | q.text(util.pretty_mac(self.value)) |
| 2880 | q.text(","); q.breakable() |
| 2881 | q.text("value_mask = "); |
| 2882 | q.text(util.pretty_mac(self.value_mask)) |
| 2883 | q.breakable() |
| 2884 | q.text('}') |
| 2885 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2886 | oxm.subtypes[2147500812] = ipv6_nd_tll_masked |
| 2887 | |
| 2888 | class ipv6_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2889 | type_len = 2147496976 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2890 | |
| 2891 | def __init__(self, value=None): |
| 2892 | if value != None: |
| 2893 | self.value = value |
| 2894 | else: |
| 2895 | self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2896 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2897 | |
| 2898 | def pack(self): |
| 2899 | packed = [] |
| 2900 | packed.append(struct.pack("!L", self.type_len)) |
| 2901 | packed.append(struct.pack("!16s", self.value)) |
| 2902 | return ''.join(packed) |
| 2903 | |
| 2904 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2905 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2906 | obj = ipv6_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2907 | _type_len = reader.read("!L")[0] |
| 2908 | assert(_type_len == 2147496976) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2909 | obj.value = reader.read('!16s')[0] |
| 2910 | return obj |
| 2911 | |
| 2912 | def __eq__(self, other): |
| 2913 | if type(self) != type(other): return False |
| 2914 | if self.value != other.value: return False |
| 2915 | return True |
| 2916 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2917 | def pretty_print(self, q): |
| 2918 | q.text("ipv6_src {") |
| 2919 | with q.group(): |
| 2920 | with q.indent(2): |
| 2921 | q.breakable() |
| 2922 | q.text("value = "); |
| 2923 | q.pp(self.value) |
| 2924 | q.breakable() |
| 2925 | q.text('}') |
| 2926 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2927 | oxm.subtypes[2147496976] = ipv6_src |
| 2928 | |
| 2929 | class ipv6_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2930 | type_len = 2147497248 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2931 | |
| 2932 | def __init__(self, value=None, value_mask=None): |
| 2933 | if value != None: |
| 2934 | self.value = value |
| 2935 | else: |
| 2936 | self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
| 2937 | if value_mask != None: |
| 2938 | self.value_mask = value_mask |
| 2939 | else: |
| 2940 | self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2941 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2942 | |
| 2943 | def pack(self): |
| 2944 | packed = [] |
| 2945 | packed.append(struct.pack("!L", self.type_len)) |
| 2946 | packed.append(struct.pack("!16s", self.value)) |
| 2947 | packed.append(struct.pack("!16s", self.value_mask)) |
| 2948 | return ''.join(packed) |
| 2949 | |
| 2950 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2951 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2952 | obj = ipv6_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2953 | _type_len = reader.read("!L")[0] |
| 2954 | assert(_type_len == 2147497248) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2955 | obj.value = reader.read('!16s')[0] |
| 2956 | obj.value_mask = reader.read('!16s')[0] |
| 2957 | return obj |
| 2958 | |
| 2959 | def __eq__(self, other): |
| 2960 | if type(self) != type(other): return False |
| 2961 | if self.value != other.value: return False |
| 2962 | if self.value_mask != other.value_mask: return False |
| 2963 | return True |
| 2964 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2965 | def pretty_print(self, q): |
| 2966 | q.text("ipv6_src_masked {") |
| 2967 | with q.group(): |
| 2968 | with q.indent(2): |
| 2969 | q.breakable() |
| 2970 | q.text("value = "); |
| 2971 | q.pp(self.value) |
| 2972 | q.text(","); q.breakable() |
| 2973 | q.text("value_mask = "); |
| 2974 | q.pp(self.value_mask) |
| 2975 | q.breakable() |
| 2976 | q.text('}') |
| 2977 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2978 | oxm.subtypes[2147497248] = ipv6_src_masked |
| 2979 | |
| 2980 | class metadata(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2981 | type_len = 2147484680 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2982 | |
| 2983 | def __init__(self, value=None): |
| 2984 | if value != None: |
| 2985 | self.value = value |
| 2986 | else: |
| 2987 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2988 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2989 | |
| 2990 | def pack(self): |
| 2991 | packed = [] |
| 2992 | packed.append(struct.pack("!L", self.type_len)) |
| 2993 | packed.append(struct.pack("!Q", self.value)) |
| 2994 | return ''.join(packed) |
| 2995 | |
| 2996 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2997 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2998 | obj = metadata() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2999 | _type_len = reader.read("!L")[0] |
| 3000 | assert(_type_len == 2147484680) |
| 3001 | obj.value = reader.read("!Q")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3002 | return obj |
| 3003 | |
| 3004 | def __eq__(self, other): |
| 3005 | if type(self) != type(other): return False |
| 3006 | if self.value != other.value: return False |
| 3007 | return True |
| 3008 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3009 | def pretty_print(self, q): |
| 3010 | q.text("metadata {") |
| 3011 | with q.group(): |
| 3012 | with q.indent(2): |
| 3013 | q.breakable() |
| 3014 | q.text("value = "); |
| 3015 | q.text("%#x" % self.value) |
| 3016 | q.breakable() |
| 3017 | q.text('}') |
| 3018 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3019 | oxm.subtypes[2147484680] = metadata |
| 3020 | |
| 3021 | class metadata_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3022 | type_len = 2147484944 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3023 | |
| 3024 | def __init__(self, value=None, value_mask=None): |
| 3025 | if value != None: |
| 3026 | self.value = value |
| 3027 | else: |
| 3028 | self.value = 0 |
| 3029 | if value_mask != None: |
| 3030 | self.value_mask = value_mask |
| 3031 | else: |
| 3032 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3033 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3034 | |
| 3035 | def pack(self): |
| 3036 | packed = [] |
| 3037 | packed.append(struct.pack("!L", self.type_len)) |
| 3038 | packed.append(struct.pack("!Q", self.value)) |
| 3039 | packed.append(struct.pack("!Q", self.value_mask)) |
| 3040 | return ''.join(packed) |
| 3041 | |
| 3042 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3043 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3044 | obj = metadata_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3045 | _type_len = reader.read("!L")[0] |
| 3046 | assert(_type_len == 2147484944) |
| 3047 | obj.value = reader.read("!Q")[0] |
| 3048 | obj.value_mask = reader.read("!Q")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3049 | return obj |
| 3050 | |
| 3051 | def __eq__(self, other): |
| 3052 | if type(self) != type(other): return False |
| 3053 | if self.value != other.value: return False |
| 3054 | if self.value_mask != other.value_mask: return False |
| 3055 | return True |
| 3056 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3057 | def pretty_print(self, q): |
| 3058 | q.text("metadata_masked {") |
| 3059 | with q.group(): |
| 3060 | with q.indent(2): |
| 3061 | q.breakable() |
| 3062 | q.text("value = "); |
| 3063 | q.text("%#x" % self.value) |
| 3064 | q.text(","); q.breakable() |
| 3065 | q.text("value_mask = "); |
| 3066 | q.text("%#x" % self.value_mask) |
| 3067 | q.breakable() |
| 3068 | q.text('}') |
| 3069 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3070 | oxm.subtypes[2147484944] = metadata_masked |
| 3071 | |
| 3072 | class mpls_label(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3073 | type_len = 2147501060 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3074 | |
| 3075 | def __init__(self, value=None): |
| 3076 | if value != None: |
| 3077 | self.value = value |
| 3078 | else: |
| 3079 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3080 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3081 | |
| 3082 | def pack(self): |
| 3083 | packed = [] |
| 3084 | packed.append(struct.pack("!L", self.type_len)) |
| 3085 | packed.append(struct.pack("!L", self.value)) |
| 3086 | return ''.join(packed) |
| 3087 | |
| 3088 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3089 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3090 | obj = mpls_label() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3091 | _type_len = reader.read("!L")[0] |
| 3092 | assert(_type_len == 2147501060) |
| 3093 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3094 | return obj |
| 3095 | |
| 3096 | def __eq__(self, other): |
| 3097 | if type(self) != type(other): return False |
| 3098 | if self.value != other.value: return False |
| 3099 | return True |
| 3100 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3101 | def pretty_print(self, q): |
| 3102 | q.text("mpls_label {") |
| 3103 | with q.group(): |
| 3104 | with q.indent(2): |
| 3105 | q.breakable() |
| 3106 | q.text("value = "); |
| 3107 | q.text("%#x" % self.value) |
| 3108 | q.breakable() |
| 3109 | q.text('}') |
| 3110 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3111 | oxm.subtypes[2147501060] = mpls_label |
| 3112 | |
| 3113 | class mpls_label_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3114 | type_len = 2147501320 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3115 | |
| 3116 | def __init__(self, value=None, value_mask=None): |
| 3117 | if value != None: |
| 3118 | self.value = value |
| 3119 | else: |
| 3120 | self.value = 0 |
| 3121 | if value_mask != None: |
| 3122 | self.value_mask = value_mask |
| 3123 | else: |
| 3124 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3125 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3126 | |
| 3127 | def pack(self): |
| 3128 | packed = [] |
| 3129 | packed.append(struct.pack("!L", self.type_len)) |
| 3130 | packed.append(struct.pack("!L", self.value)) |
| 3131 | packed.append(struct.pack("!L", self.value_mask)) |
| 3132 | return ''.join(packed) |
| 3133 | |
| 3134 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3135 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3136 | obj = mpls_label_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3137 | _type_len = reader.read("!L")[0] |
| 3138 | assert(_type_len == 2147501320) |
| 3139 | obj.value = reader.read("!L")[0] |
| 3140 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3141 | return obj |
| 3142 | |
| 3143 | def __eq__(self, other): |
| 3144 | if type(self) != type(other): return False |
| 3145 | if self.value != other.value: return False |
| 3146 | if self.value_mask != other.value_mask: return False |
| 3147 | return True |
| 3148 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3149 | def pretty_print(self, q): |
| 3150 | q.text("mpls_label_masked {") |
| 3151 | with q.group(): |
| 3152 | with q.indent(2): |
| 3153 | q.breakable() |
| 3154 | q.text("value = "); |
| 3155 | q.text("%#x" % self.value) |
| 3156 | q.text(","); q.breakable() |
| 3157 | q.text("value_mask = "); |
| 3158 | q.text("%#x" % self.value_mask) |
| 3159 | q.breakable() |
| 3160 | q.text('}') |
| 3161 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3162 | oxm.subtypes[2147501320] = mpls_label_masked |
| 3163 | |
| 3164 | class mpls_tc(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3165 | type_len = 2147501569 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3166 | |
| 3167 | def __init__(self, value=None): |
| 3168 | if value != None: |
| 3169 | self.value = value |
| 3170 | else: |
| 3171 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3172 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3173 | |
| 3174 | def pack(self): |
| 3175 | packed = [] |
| 3176 | packed.append(struct.pack("!L", self.type_len)) |
| 3177 | packed.append(struct.pack("!B", self.value)) |
| 3178 | return ''.join(packed) |
| 3179 | |
| 3180 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3181 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3182 | obj = mpls_tc() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3183 | _type_len = reader.read("!L")[0] |
| 3184 | assert(_type_len == 2147501569) |
| 3185 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3186 | return obj |
| 3187 | |
| 3188 | def __eq__(self, other): |
| 3189 | if type(self) != type(other): return False |
| 3190 | if self.value != other.value: return False |
| 3191 | return True |
| 3192 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3193 | def pretty_print(self, q): |
| 3194 | q.text("mpls_tc {") |
| 3195 | with q.group(): |
| 3196 | with q.indent(2): |
| 3197 | q.breakable() |
| 3198 | q.text("value = "); |
| 3199 | q.text("%#x" % self.value) |
| 3200 | q.breakable() |
| 3201 | q.text('}') |
| 3202 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3203 | oxm.subtypes[2147501569] = mpls_tc |
| 3204 | |
| 3205 | class mpls_tc_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3206 | type_len = 2147501826 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3207 | |
| 3208 | def __init__(self, value=None, value_mask=None): |
| 3209 | if value != None: |
| 3210 | self.value = value |
| 3211 | else: |
| 3212 | self.value = 0 |
| 3213 | if value_mask != None: |
| 3214 | self.value_mask = value_mask |
| 3215 | else: |
| 3216 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3217 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3218 | |
| 3219 | def pack(self): |
| 3220 | packed = [] |
| 3221 | packed.append(struct.pack("!L", self.type_len)) |
| 3222 | packed.append(struct.pack("!B", self.value)) |
| 3223 | packed.append(struct.pack("!B", self.value_mask)) |
| 3224 | return ''.join(packed) |
| 3225 | |
| 3226 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3227 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3228 | obj = mpls_tc_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3229 | _type_len = reader.read("!L")[0] |
| 3230 | assert(_type_len == 2147501826) |
| 3231 | obj.value = reader.read("!B")[0] |
| 3232 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3233 | return obj |
| 3234 | |
| 3235 | def __eq__(self, other): |
| 3236 | if type(self) != type(other): return False |
| 3237 | if self.value != other.value: return False |
| 3238 | if self.value_mask != other.value_mask: return False |
| 3239 | return True |
| 3240 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3241 | def pretty_print(self, q): |
| 3242 | q.text("mpls_tc_masked {") |
| 3243 | with q.group(): |
| 3244 | with q.indent(2): |
| 3245 | q.breakable() |
| 3246 | q.text("value = "); |
| 3247 | q.text("%#x" % self.value) |
| 3248 | q.text(","); q.breakable() |
| 3249 | q.text("value_mask = "); |
| 3250 | q.text("%#x" % self.value_mask) |
| 3251 | q.breakable() |
| 3252 | q.text('}') |
| 3253 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3254 | oxm.subtypes[2147501826] = mpls_tc_masked |
| 3255 | |
| 3256 | class sctp_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3257 | type_len = 2147492866 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3258 | |
| 3259 | def __init__(self, value=None): |
| 3260 | if value != None: |
| 3261 | self.value = value |
| 3262 | else: |
| 3263 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3264 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3265 | |
| 3266 | def pack(self): |
| 3267 | packed = [] |
| 3268 | packed.append(struct.pack("!L", self.type_len)) |
| 3269 | packed.append(struct.pack("!H", self.value)) |
| 3270 | return ''.join(packed) |
| 3271 | |
| 3272 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3273 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3274 | obj = sctp_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3275 | _type_len = reader.read("!L")[0] |
| 3276 | assert(_type_len == 2147492866) |
| 3277 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3278 | return obj |
| 3279 | |
| 3280 | def __eq__(self, other): |
| 3281 | if type(self) != type(other): return False |
| 3282 | if self.value != other.value: return False |
| 3283 | return True |
| 3284 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3285 | def pretty_print(self, q): |
| 3286 | q.text("sctp_dst {") |
| 3287 | with q.group(): |
| 3288 | with q.indent(2): |
| 3289 | q.breakable() |
| 3290 | q.text("value = "); |
| 3291 | q.text("%#x" % self.value) |
| 3292 | q.breakable() |
| 3293 | q.text('}') |
| 3294 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3295 | oxm.subtypes[2147492866] = sctp_dst |
| 3296 | |
| 3297 | class sctp_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3298 | type_len = 2147493124 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3299 | |
| 3300 | def __init__(self, value=None, value_mask=None): |
| 3301 | if value != None: |
| 3302 | self.value = value |
| 3303 | else: |
| 3304 | self.value = 0 |
| 3305 | if value_mask != None: |
| 3306 | self.value_mask = value_mask |
| 3307 | else: |
| 3308 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3309 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3310 | |
| 3311 | def pack(self): |
| 3312 | packed = [] |
| 3313 | packed.append(struct.pack("!L", self.type_len)) |
| 3314 | packed.append(struct.pack("!H", self.value)) |
| 3315 | packed.append(struct.pack("!H", self.value_mask)) |
| 3316 | return ''.join(packed) |
| 3317 | |
| 3318 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3319 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3320 | obj = sctp_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3321 | _type_len = reader.read("!L")[0] |
| 3322 | assert(_type_len == 2147493124) |
| 3323 | obj.value = reader.read("!H")[0] |
| 3324 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3325 | return obj |
| 3326 | |
| 3327 | def __eq__(self, other): |
| 3328 | if type(self) != type(other): return False |
| 3329 | if self.value != other.value: return False |
| 3330 | if self.value_mask != other.value_mask: return False |
| 3331 | return True |
| 3332 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3333 | def pretty_print(self, q): |
| 3334 | q.text("sctp_dst_masked {") |
| 3335 | with q.group(): |
| 3336 | with q.indent(2): |
| 3337 | q.breakable() |
| 3338 | q.text("value = "); |
| 3339 | q.text("%#x" % self.value) |
| 3340 | q.text(","); q.breakable() |
| 3341 | q.text("value_mask = "); |
| 3342 | q.text("%#x" % self.value_mask) |
| 3343 | q.breakable() |
| 3344 | q.text('}') |
| 3345 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3346 | oxm.subtypes[2147493124] = sctp_dst_masked |
| 3347 | |
| 3348 | class sctp_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3349 | type_len = 2147492354 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3350 | |
| 3351 | def __init__(self, value=None): |
| 3352 | if value != None: |
| 3353 | self.value = value |
| 3354 | else: |
| 3355 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3356 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3357 | |
| 3358 | def pack(self): |
| 3359 | packed = [] |
| 3360 | packed.append(struct.pack("!L", self.type_len)) |
| 3361 | packed.append(struct.pack("!H", self.value)) |
| 3362 | return ''.join(packed) |
| 3363 | |
| 3364 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3365 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3366 | obj = sctp_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3367 | _type_len = reader.read("!L")[0] |
| 3368 | assert(_type_len == 2147492354) |
| 3369 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3370 | return obj |
| 3371 | |
| 3372 | def __eq__(self, other): |
| 3373 | if type(self) != type(other): return False |
| 3374 | if self.value != other.value: return False |
| 3375 | return True |
| 3376 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3377 | def pretty_print(self, q): |
| 3378 | q.text("sctp_src {") |
| 3379 | with q.group(): |
| 3380 | with q.indent(2): |
| 3381 | q.breakable() |
| 3382 | q.text("value = "); |
| 3383 | q.text("%#x" % self.value) |
| 3384 | q.breakable() |
| 3385 | q.text('}') |
| 3386 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3387 | oxm.subtypes[2147492354] = sctp_src |
| 3388 | |
| 3389 | class sctp_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3390 | type_len = 2147492612 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3391 | |
| 3392 | def __init__(self, value=None, value_mask=None): |
| 3393 | if value != None: |
| 3394 | self.value = value |
| 3395 | else: |
| 3396 | self.value = 0 |
| 3397 | if value_mask != None: |
| 3398 | self.value_mask = value_mask |
| 3399 | else: |
| 3400 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3401 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3402 | |
| 3403 | def pack(self): |
| 3404 | packed = [] |
| 3405 | packed.append(struct.pack("!L", self.type_len)) |
| 3406 | packed.append(struct.pack("!H", self.value)) |
| 3407 | packed.append(struct.pack("!H", self.value_mask)) |
| 3408 | return ''.join(packed) |
| 3409 | |
| 3410 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3411 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3412 | obj = sctp_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3413 | _type_len = reader.read("!L")[0] |
| 3414 | assert(_type_len == 2147492612) |
| 3415 | obj.value = reader.read("!H")[0] |
| 3416 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3417 | return obj |
| 3418 | |
| 3419 | def __eq__(self, other): |
| 3420 | if type(self) != type(other): return False |
| 3421 | if self.value != other.value: return False |
| 3422 | if self.value_mask != other.value_mask: return False |
| 3423 | return True |
| 3424 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3425 | def pretty_print(self, q): |
| 3426 | q.text("sctp_src_masked {") |
| 3427 | with q.group(): |
| 3428 | with q.indent(2): |
| 3429 | q.breakable() |
| 3430 | q.text("value = "); |
| 3431 | q.text("%#x" % self.value) |
| 3432 | q.text(","); q.breakable() |
| 3433 | q.text("value_mask = "); |
| 3434 | q.text("%#x" % self.value_mask) |
| 3435 | q.breakable() |
| 3436 | q.text('}') |
| 3437 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3438 | oxm.subtypes[2147492612] = sctp_src_masked |
| 3439 | |
| 3440 | class tcp_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3441 | type_len = 2147490818 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3442 | |
| 3443 | def __init__(self, value=None): |
| 3444 | if value != None: |
| 3445 | self.value = value |
| 3446 | else: |
| 3447 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3448 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3449 | |
| 3450 | def pack(self): |
| 3451 | packed = [] |
| 3452 | packed.append(struct.pack("!L", self.type_len)) |
| 3453 | packed.append(struct.pack("!H", self.value)) |
| 3454 | return ''.join(packed) |
| 3455 | |
| 3456 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3457 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3458 | obj = tcp_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3459 | _type_len = reader.read("!L")[0] |
| 3460 | assert(_type_len == 2147490818) |
| 3461 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3462 | return obj |
| 3463 | |
| 3464 | def __eq__(self, other): |
| 3465 | if type(self) != type(other): return False |
| 3466 | if self.value != other.value: return False |
| 3467 | return True |
| 3468 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3469 | def pretty_print(self, q): |
| 3470 | q.text("tcp_dst {") |
| 3471 | with q.group(): |
| 3472 | with q.indent(2): |
| 3473 | q.breakable() |
| 3474 | q.text("value = "); |
| 3475 | q.text("%#x" % self.value) |
| 3476 | q.breakable() |
| 3477 | q.text('}') |
| 3478 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3479 | oxm.subtypes[2147490818] = tcp_dst |
| 3480 | |
| 3481 | class tcp_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3482 | type_len = 2147491076 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3483 | |
| 3484 | def __init__(self, value=None, value_mask=None): |
| 3485 | if value != None: |
| 3486 | self.value = value |
| 3487 | else: |
| 3488 | self.value = 0 |
| 3489 | if value_mask != None: |
| 3490 | self.value_mask = value_mask |
| 3491 | else: |
| 3492 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3493 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3494 | |
| 3495 | def pack(self): |
| 3496 | packed = [] |
| 3497 | packed.append(struct.pack("!L", self.type_len)) |
| 3498 | packed.append(struct.pack("!H", self.value)) |
| 3499 | packed.append(struct.pack("!H", self.value_mask)) |
| 3500 | return ''.join(packed) |
| 3501 | |
| 3502 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3503 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3504 | obj = tcp_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3505 | _type_len = reader.read("!L")[0] |
| 3506 | assert(_type_len == 2147491076) |
| 3507 | obj.value = reader.read("!H")[0] |
| 3508 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3509 | return obj |
| 3510 | |
| 3511 | def __eq__(self, other): |
| 3512 | if type(self) != type(other): return False |
| 3513 | if self.value != other.value: return False |
| 3514 | if self.value_mask != other.value_mask: return False |
| 3515 | return True |
| 3516 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3517 | def pretty_print(self, q): |
| 3518 | q.text("tcp_dst_masked {") |
| 3519 | with q.group(): |
| 3520 | with q.indent(2): |
| 3521 | q.breakable() |
| 3522 | q.text("value = "); |
| 3523 | q.text("%#x" % self.value) |
| 3524 | q.text(","); q.breakable() |
| 3525 | q.text("value_mask = "); |
| 3526 | q.text("%#x" % self.value_mask) |
| 3527 | q.breakable() |
| 3528 | q.text('}') |
| 3529 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3530 | oxm.subtypes[2147491076] = tcp_dst_masked |
| 3531 | |
| 3532 | class tcp_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3533 | type_len = 2147490306 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3534 | |
| 3535 | def __init__(self, value=None): |
| 3536 | if value != None: |
| 3537 | self.value = value |
| 3538 | else: |
| 3539 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3540 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3541 | |
| 3542 | def pack(self): |
| 3543 | packed = [] |
| 3544 | packed.append(struct.pack("!L", self.type_len)) |
| 3545 | packed.append(struct.pack("!H", self.value)) |
| 3546 | return ''.join(packed) |
| 3547 | |
| 3548 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3549 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3550 | obj = tcp_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3551 | _type_len = reader.read("!L")[0] |
| 3552 | assert(_type_len == 2147490306) |
| 3553 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3554 | return obj |
| 3555 | |
| 3556 | def __eq__(self, other): |
| 3557 | if type(self) != type(other): return False |
| 3558 | if self.value != other.value: return False |
| 3559 | return True |
| 3560 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3561 | def pretty_print(self, q): |
| 3562 | q.text("tcp_src {") |
| 3563 | with q.group(): |
| 3564 | with q.indent(2): |
| 3565 | q.breakable() |
| 3566 | q.text("value = "); |
| 3567 | q.text("%#x" % self.value) |
| 3568 | q.breakable() |
| 3569 | q.text('}') |
| 3570 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3571 | oxm.subtypes[2147490306] = tcp_src |
| 3572 | |
| 3573 | class tcp_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3574 | type_len = 2147490564 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3575 | |
| 3576 | def __init__(self, value=None, value_mask=None): |
| 3577 | if value != None: |
| 3578 | self.value = value |
| 3579 | else: |
| 3580 | self.value = 0 |
| 3581 | if value_mask != None: |
| 3582 | self.value_mask = value_mask |
| 3583 | else: |
| 3584 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3585 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3586 | |
| 3587 | def pack(self): |
| 3588 | packed = [] |
| 3589 | packed.append(struct.pack("!L", self.type_len)) |
| 3590 | packed.append(struct.pack("!H", self.value)) |
| 3591 | packed.append(struct.pack("!H", self.value_mask)) |
| 3592 | return ''.join(packed) |
| 3593 | |
| 3594 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3595 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3596 | obj = tcp_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3597 | _type_len = reader.read("!L")[0] |
| 3598 | assert(_type_len == 2147490564) |
| 3599 | obj.value = reader.read("!H")[0] |
| 3600 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3601 | return obj |
| 3602 | |
| 3603 | def __eq__(self, other): |
| 3604 | if type(self) != type(other): return False |
| 3605 | if self.value != other.value: return False |
| 3606 | if self.value_mask != other.value_mask: return False |
| 3607 | return True |
| 3608 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3609 | def pretty_print(self, q): |
| 3610 | q.text("tcp_src_masked {") |
| 3611 | with q.group(): |
| 3612 | with q.indent(2): |
| 3613 | q.breakable() |
| 3614 | q.text("value = "); |
| 3615 | q.text("%#x" % self.value) |
| 3616 | q.text(","); q.breakable() |
| 3617 | q.text("value_mask = "); |
| 3618 | q.text("%#x" % self.value_mask) |
| 3619 | q.breakable() |
| 3620 | q.text('}') |
| 3621 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3622 | oxm.subtypes[2147490564] = tcp_src_masked |
| 3623 | |
| 3624 | class udp_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3625 | type_len = 2147491842 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3626 | |
| 3627 | def __init__(self, value=None): |
| 3628 | if value != None: |
| 3629 | self.value = value |
| 3630 | else: |
| 3631 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3632 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3633 | |
| 3634 | def pack(self): |
| 3635 | packed = [] |
| 3636 | packed.append(struct.pack("!L", self.type_len)) |
| 3637 | packed.append(struct.pack("!H", self.value)) |
| 3638 | return ''.join(packed) |
| 3639 | |
| 3640 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3641 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3642 | obj = udp_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3643 | _type_len = reader.read("!L")[0] |
| 3644 | assert(_type_len == 2147491842) |
| 3645 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3646 | return obj |
| 3647 | |
| 3648 | def __eq__(self, other): |
| 3649 | if type(self) != type(other): return False |
| 3650 | if self.value != other.value: return False |
| 3651 | return True |
| 3652 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3653 | def pretty_print(self, q): |
| 3654 | q.text("udp_dst {") |
| 3655 | with q.group(): |
| 3656 | with q.indent(2): |
| 3657 | q.breakable() |
| 3658 | q.text("value = "); |
| 3659 | q.text("%#x" % self.value) |
| 3660 | q.breakable() |
| 3661 | q.text('}') |
| 3662 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3663 | oxm.subtypes[2147491842] = udp_dst |
| 3664 | |
| 3665 | class udp_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3666 | type_len = 2147492100 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3667 | |
| 3668 | def __init__(self, value=None, value_mask=None): |
| 3669 | if value != None: |
| 3670 | self.value = value |
| 3671 | else: |
| 3672 | self.value = 0 |
| 3673 | if value_mask != None: |
| 3674 | self.value_mask = value_mask |
| 3675 | else: |
| 3676 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3677 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3678 | |
| 3679 | def pack(self): |
| 3680 | packed = [] |
| 3681 | packed.append(struct.pack("!L", self.type_len)) |
| 3682 | packed.append(struct.pack("!H", self.value)) |
| 3683 | packed.append(struct.pack("!H", self.value_mask)) |
| 3684 | return ''.join(packed) |
| 3685 | |
| 3686 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3687 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3688 | obj = udp_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3689 | _type_len = reader.read("!L")[0] |
| 3690 | assert(_type_len == 2147492100) |
| 3691 | obj.value = reader.read("!H")[0] |
| 3692 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3693 | return obj |
| 3694 | |
| 3695 | def __eq__(self, other): |
| 3696 | if type(self) != type(other): return False |
| 3697 | if self.value != other.value: return False |
| 3698 | if self.value_mask != other.value_mask: return False |
| 3699 | return True |
| 3700 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3701 | def pretty_print(self, q): |
| 3702 | q.text("udp_dst_masked {") |
| 3703 | with q.group(): |
| 3704 | with q.indent(2): |
| 3705 | q.breakable() |
| 3706 | q.text("value = "); |
| 3707 | q.text("%#x" % self.value) |
| 3708 | q.text(","); q.breakable() |
| 3709 | q.text("value_mask = "); |
| 3710 | q.text("%#x" % self.value_mask) |
| 3711 | q.breakable() |
| 3712 | q.text('}') |
| 3713 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3714 | oxm.subtypes[2147492100] = udp_dst_masked |
| 3715 | |
| 3716 | class udp_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3717 | type_len = 2147491330 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3718 | |
| 3719 | def __init__(self, value=None): |
| 3720 | if value != None: |
| 3721 | self.value = value |
| 3722 | else: |
| 3723 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3724 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3725 | |
| 3726 | def pack(self): |
| 3727 | packed = [] |
| 3728 | packed.append(struct.pack("!L", self.type_len)) |
| 3729 | packed.append(struct.pack("!H", self.value)) |
| 3730 | return ''.join(packed) |
| 3731 | |
| 3732 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3733 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3734 | obj = udp_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3735 | _type_len = reader.read("!L")[0] |
| 3736 | assert(_type_len == 2147491330) |
| 3737 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3738 | return obj |
| 3739 | |
| 3740 | def __eq__(self, other): |
| 3741 | if type(self) != type(other): return False |
| 3742 | if self.value != other.value: return False |
| 3743 | return True |
| 3744 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3745 | def pretty_print(self, q): |
| 3746 | q.text("udp_src {") |
| 3747 | with q.group(): |
| 3748 | with q.indent(2): |
| 3749 | q.breakable() |
| 3750 | q.text("value = "); |
| 3751 | q.text("%#x" % self.value) |
| 3752 | q.breakable() |
| 3753 | q.text('}') |
| 3754 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3755 | oxm.subtypes[2147491330] = udp_src |
| 3756 | |
| 3757 | class udp_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3758 | type_len = 2147491588 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3759 | |
| 3760 | def __init__(self, value=None, value_mask=None): |
| 3761 | if value != None: |
| 3762 | self.value = value |
| 3763 | else: |
| 3764 | self.value = 0 |
| 3765 | if value_mask != None: |
| 3766 | self.value_mask = value_mask |
| 3767 | else: |
| 3768 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3769 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3770 | |
| 3771 | def pack(self): |
| 3772 | packed = [] |
| 3773 | packed.append(struct.pack("!L", self.type_len)) |
| 3774 | packed.append(struct.pack("!H", self.value)) |
| 3775 | packed.append(struct.pack("!H", self.value_mask)) |
| 3776 | return ''.join(packed) |
| 3777 | |
| 3778 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3779 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3780 | obj = udp_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3781 | _type_len = reader.read("!L")[0] |
| 3782 | assert(_type_len == 2147491588) |
| 3783 | obj.value = reader.read("!H")[0] |
| 3784 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3785 | return obj |
| 3786 | |
| 3787 | def __eq__(self, other): |
| 3788 | if type(self) != type(other): return False |
| 3789 | if self.value != other.value: return False |
| 3790 | if self.value_mask != other.value_mask: return False |
| 3791 | return True |
| 3792 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3793 | def pretty_print(self, q): |
| 3794 | q.text("udp_src_masked {") |
| 3795 | with q.group(): |
| 3796 | with q.indent(2): |
| 3797 | q.breakable() |
| 3798 | q.text("value = "); |
| 3799 | q.text("%#x" % self.value) |
| 3800 | q.text(","); q.breakable() |
| 3801 | q.text("value_mask = "); |
| 3802 | q.text("%#x" % self.value_mask) |
| 3803 | q.breakable() |
| 3804 | q.text('}') |
| 3805 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3806 | oxm.subtypes[2147491588] = udp_src_masked |
| 3807 | |
| 3808 | class vlan_pcp(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3809 | type_len = 2147487233 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3810 | |
| 3811 | def __init__(self, value=None): |
| 3812 | if value != None: |
| 3813 | self.value = value |
| 3814 | else: |
| 3815 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3816 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3817 | |
| 3818 | def pack(self): |
| 3819 | packed = [] |
| 3820 | packed.append(struct.pack("!L", self.type_len)) |
| 3821 | packed.append(struct.pack("!B", self.value)) |
| 3822 | return ''.join(packed) |
| 3823 | |
| 3824 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3825 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3826 | obj = vlan_pcp() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3827 | _type_len = reader.read("!L")[0] |
| 3828 | assert(_type_len == 2147487233) |
| 3829 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3830 | return obj |
| 3831 | |
| 3832 | def __eq__(self, other): |
| 3833 | if type(self) != type(other): return False |
| 3834 | if self.value != other.value: return False |
| 3835 | return True |
| 3836 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3837 | def pretty_print(self, q): |
| 3838 | q.text("vlan_pcp {") |
| 3839 | with q.group(): |
| 3840 | with q.indent(2): |
| 3841 | q.breakable() |
| 3842 | q.text("value = "); |
| 3843 | q.text("%#x" % self.value) |
| 3844 | q.breakable() |
| 3845 | q.text('}') |
| 3846 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3847 | oxm.subtypes[2147487233] = vlan_pcp |
| 3848 | |
| 3849 | class vlan_pcp_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3850 | type_len = 2147487490 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3851 | |
| 3852 | def __init__(self, value=None, value_mask=None): |
| 3853 | if value != None: |
| 3854 | self.value = value |
| 3855 | else: |
| 3856 | self.value = 0 |
| 3857 | if value_mask != None: |
| 3858 | self.value_mask = value_mask |
| 3859 | else: |
| 3860 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3861 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3862 | |
| 3863 | def pack(self): |
| 3864 | packed = [] |
| 3865 | packed.append(struct.pack("!L", self.type_len)) |
| 3866 | packed.append(struct.pack("!B", self.value)) |
| 3867 | packed.append(struct.pack("!B", self.value_mask)) |
| 3868 | return ''.join(packed) |
| 3869 | |
| 3870 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3871 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3872 | obj = vlan_pcp_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3873 | _type_len = reader.read("!L")[0] |
| 3874 | assert(_type_len == 2147487490) |
| 3875 | obj.value = reader.read("!B")[0] |
| 3876 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3877 | return obj |
| 3878 | |
| 3879 | def __eq__(self, other): |
| 3880 | if type(self) != type(other): return False |
| 3881 | if self.value != other.value: return False |
| 3882 | if self.value_mask != other.value_mask: return False |
| 3883 | return True |
| 3884 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3885 | def pretty_print(self, q): |
| 3886 | q.text("vlan_pcp_masked {") |
| 3887 | with q.group(): |
| 3888 | with q.indent(2): |
| 3889 | q.breakable() |
| 3890 | q.text("value = "); |
| 3891 | q.text("%#x" % self.value) |
| 3892 | q.text(","); q.breakable() |
| 3893 | q.text("value_mask = "); |
| 3894 | q.text("%#x" % self.value_mask) |
| 3895 | q.breakable() |
| 3896 | q.text('}') |
| 3897 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3898 | oxm.subtypes[2147487490] = vlan_pcp_masked |
| 3899 | |
| 3900 | class vlan_vid(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3901 | type_len = 2147486722 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3902 | |
| 3903 | def __init__(self, value=None): |
| 3904 | if value != None: |
| 3905 | self.value = value |
| 3906 | else: |
| 3907 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3908 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3909 | |
| 3910 | def pack(self): |
| 3911 | packed = [] |
| 3912 | packed.append(struct.pack("!L", self.type_len)) |
| 3913 | packed.append(struct.pack("!H", self.value)) |
| 3914 | return ''.join(packed) |
| 3915 | |
| 3916 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3917 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3918 | obj = vlan_vid() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3919 | _type_len = reader.read("!L")[0] |
| 3920 | assert(_type_len == 2147486722) |
| 3921 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3922 | return obj |
| 3923 | |
| 3924 | def __eq__(self, other): |
| 3925 | if type(self) != type(other): return False |
| 3926 | if self.value != other.value: return False |
| 3927 | return True |
| 3928 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3929 | def pretty_print(self, q): |
| 3930 | q.text("vlan_vid {") |
| 3931 | with q.group(): |
| 3932 | with q.indent(2): |
| 3933 | q.breakable() |
| 3934 | q.text("value = "); |
| 3935 | q.text("%#x" % self.value) |
| 3936 | q.breakable() |
| 3937 | q.text('}') |
| 3938 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3939 | oxm.subtypes[2147486722] = vlan_vid |
| 3940 | |
| 3941 | class vlan_vid_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3942 | type_len = 2147486980 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3943 | |
| 3944 | def __init__(self, value=None, value_mask=None): |
| 3945 | if value != None: |
| 3946 | self.value = value |
| 3947 | else: |
| 3948 | self.value = 0 |
| 3949 | if value_mask != None: |
| 3950 | self.value_mask = value_mask |
| 3951 | else: |
| 3952 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3953 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3954 | |
| 3955 | def pack(self): |
| 3956 | packed = [] |
| 3957 | packed.append(struct.pack("!L", self.type_len)) |
| 3958 | packed.append(struct.pack("!H", self.value)) |
| 3959 | packed.append(struct.pack("!H", self.value_mask)) |
| 3960 | return ''.join(packed) |
| 3961 | |
| 3962 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3963 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3964 | obj = vlan_vid_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3965 | _type_len = reader.read("!L")[0] |
| 3966 | assert(_type_len == 2147486980) |
| 3967 | obj.value = reader.read("!H")[0] |
| 3968 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3969 | return obj |
| 3970 | |
| 3971 | def __eq__(self, other): |
| 3972 | if type(self) != type(other): return False |
| 3973 | if self.value != other.value: return False |
| 3974 | if self.value_mask != other.value_mask: return False |
| 3975 | return True |
| 3976 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3977 | def pretty_print(self, q): |
| 3978 | q.text("vlan_vid_masked {") |
| 3979 | with q.group(): |
| 3980 | with q.indent(2): |
| 3981 | q.breakable() |
| 3982 | q.text("value = "); |
| 3983 | q.text("%#x" % self.value) |
| 3984 | q.text(","); q.breakable() |
| 3985 | q.text("value_mask = "); |
| 3986 | q.text("%#x" % self.value_mask) |
| 3987 | q.breakable() |
| 3988 | q.text('}') |
| 3989 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3990 | oxm.subtypes[2147486980] = vlan_vid_masked |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3991 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3992 | |