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 |
Harshmeet Singh | 1db4633 | 2014-10-14 16:29:13 -0700 | [diff] [blame^] | 12 | import bsn_tlv |
| 13 | import meter_band |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 14 | import instruction |
| 15 | import oxm |
Harshmeet Singh | 1db4633 | 2014-10-14 16:29:13 -0700 | [diff] [blame^] | 16 | import common |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 17 | import instruction_id |
Harshmeet Singh | 1db4633 | 2014-10-14 16:29:13 -0700 | [diff] [blame^] | 18 | import action |
| 19 | import message |
| 20 | import action_id |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 21 | import util |
| 22 | import loxi.generic_util |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 23 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 24 | class oxm(loxi.OFObject): |
| 25 | subtypes = {} |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 26 | |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 27 | |
| 28 | def __init__(self, type_len=None): |
| 29 | if type_len != None: |
| 30 | self.type_len = type_len |
| 31 | else: |
| 32 | self.type_len = 0 |
| 33 | return |
| 34 | |
| 35 | def pack(self): |
| 36 | packed = [] |
| 37 | packed.append(struct.pack("!L", self.type_len)) |
| 38 | return ''.join(packed) |
| 39 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 40 | @staticmethod |
| 41 | def unpack(reader): |
| 42 | subtype, = reader.peek('!L', 0) |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 43 | subclass = oxm.subtypes.get(subtype) |
| 44 | if subclass: |
| 45 | return subclass.unpack(reader) |
| 46 | |
| 47 | obj = oxm() |
| 48 | obj.type_len = reader.read("!L")[0] |
| 49 | return obj |
| 50 | |
| 51 | def __eq__(self, other): |
| 52 | if type(self) != type(other): return False |
| 53 | if self.type_len != other.type_len: return False |
| 54 | return True |
| 55 | |
| 56 | def pretty_print(self, q): |
| 57 | q.text("oxm {") |
| 58 | with q.group(): |
| 59 | with q.indent(2): |
| 60 | q.breakable() |
| 61 | q.breakable() |
| 62 | q.text('}') |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 63 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 64 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 65 | class arp_op(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 66 | type_len = 2147494402 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 67 | |
| 68 | def __init__(self, value=None): |
| 69 | if value != None: |
| 70 | self.value = value |
| 71 | else: |
| 72 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 73 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 74 | |
| 75 | def pack(self): |
| 76 | packed = [] |
| 77 | packed.append(struct.pack("!L", self.type_len)) |
| 78 | packed.append(struct.pack("!H", self.value)) |
| 79 | return ''.join(packed) |
| 80 | |
| 81 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 82 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 83 | obj = arp_op() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 84 | _type_len = reader.read("!L")[0] |
| 85 | assert(_type_len == 2147494402) |
| 86 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 87 | return obj |
| 88 | |
| 89 | def __eq__(self, other): |
| 90 | if type(self) != type(other): return False |
| 91 | if self.value != other.value: return False |
| 92 | return True |
| 93 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 94 | def pretty_print(self, q): |
| 95 | q.text("arp_op {") |
| 96 | with q.group(): |
| 97 | with q.indent(2): |
| 98 | q.breakable() |
| 99 | q.text("value = "); |
| 100 | q.text("%#x" % self.value) |
| 101 | q.breakable() |
| 102 | q.text('}') |
| 103 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 104 | oxm.subtypes[2147494402] = arp_op |
| 105 | |
| 106 | class arp_op_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 107 | type_len = 2147494660 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 108 | |
| 109 | def __init__(self, value=None, value_mask=None): |
| 110 | if value != None: |
| 111 | self.value = value |
| 112 | else: |
| 113 | self.value = 0 |
| 114 | if value_mask != None: |
| 115 | self.value_mask = value_mask |
| 116 | else: |
| 117 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 118 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 119 | |
| 120 | def pack(self): |
| 121 | packed = [] |
| 122 | packed.append(struct.pack("!L", self.type_len)) |
| 123 | packed.append(struct.pack("!H", self.value)) |
| 124 | packed.append(struct.pack("!H", self.value_mask)) |
| 125 | return ''.join(packed) |
| 126 | |
| 127 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 128 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 129 | obj = arp_op_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 130 | _type_len = reader.read("!L")[0] |
| 131 | assert(_type_len == 2147494660) |
| 132 | obj.value = reader.read("!H")[0] |
| 133 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 134 | return obj |
| 135 | |
| 136 | def __eq__(self, other): |
| 137 | if type(self) != type(other): return False |
| 138 | if self.value != other.value: return False |
| 139 | if self.value_mask != other.value_mask: return False |
| 140 | return True |
| 141 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 142 | def pretty_print(self, q): |
| 143 | q.text("arp_op_masked {") |
| 144 | with q.group(): |
| 145 | with q.indent(2): |
| 146 | q.breakable() |
| 147 | q.text("value = "); |
| 148 | q.text("%#x" % self.value) |
| 149 | q.text(","); q.breakable() |
| 150 | q.text("value_mask = "); |
| 151 | q.text("%#x" % self.value_mask) |
| 152 | q.breakable() |
| 153 | q.text('}') |
| 154 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 155 | oxm.subtypes[2147494660] = arp_op_masked |
| 156 | |
| 157 | class arp_sha(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 158 | type_len = 2147495942 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 159 | |
| 160 | def __init__(self, value=None): |
| 161 | if value != None: |
| 162 | self.value = value |
| 163 | else: |
| 164 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 165 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 166 | |
| 167 | def pack(self): |
| 168 | packed = [] |
| 169 | packed.append(struct.pack("!L", self.type_len)) |
| 170 | packed.append(struct.pack("!6B", *self.value)) |
| 171 | return ''.join(packed) |
| 172 | |
| 173 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 174 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 175 | obj = arp_sha() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 176 | _type_len = reader.read("!L")[0] |
| 177 | assert(_type_len == 2147495942) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 178 | obj.value = list(reader.read('!6B')) |
| 179 | return obj |
| 180 | |
| 181 | def __eq__(self, other): |
| 182 | if type(self) != type(other): return False |
| 183 | if self.value != other.value: return False |
| 184 | return True |
| 185 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 186 | def pretty_print(self, q): |
| 187 | q.text("arp_sha {") |
| 188 | with q.group(): |
| 189 | with q.indent(2): |
| 190 | q.breakable() |
| 191 | q.text("value = "); |
| 192 | q.text(util.pretty_mac(self.value)) |
| 193 | q.breakable() |
| 194 | q.text('}') |
| 195 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 196 | oxm.subtypes[2147495942] = arp_sha |
| 197 | |
| 198 | class arp_sha_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 199 | type_len = 2147496204 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 200 | |
| 201 | def __init__(self, value=None, value_mask=None): |
| 202 | if value != None: |
| 203 | self.value = value |
| 204 | else: |
| 205 | self.value = [0,0,0,0,0,0] |
| 206 | if value_mask != None: |
| 207 | self.value_mask = value_mask |
| 208 | else: |
| 209 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 210 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 211 | |
| 212 | def pack(self): |
| 213 | packed = [] |
| 214 | packed.append(struct.pack("!L", self.type_len)) |
| 215 | packed.append(struct.pack("!6B", *self.value)) |
| 216 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 217 | return ''.join(packed) |
| 218 | |
| 219 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 220 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 221 | obj = arp_sha_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 222 | _type_len = reader.read("!L")[0] |
| 223 | assert(_type_len == 2147496204) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 224 | obj.value = list(reader.read('!6B')) |
| 225 | obj.value_mask = list(reader.read('!6B')) |
| 226 | return obj |
| 227 | |
| 228 | def __eq__(self, other): |
| 229 | if type(self) != type(other): return False |
| 230 | if self.value != other.value: return False |
| 231 | if self.value_mask != other.value_mask: return False |
| 232 | return True |
| 233 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 234 | def pretty_print(self, q): |
| 235 | q.text("arp_sha_masked {") |
| 236 | with q.group(): |
| 237 | with q.indent(2): |
| 238 | q.breakable() |
| 239 | q.text("value = "); |
| 240 | q.text(util.pretty_mac(self.value)) |
| 241 | q.text(","); q.breakable() |
| 242 | q.text("value_mask = "); |
| 243 | q.text(util.pretty_mac(self.value_mask)) |
| 244 | q.breakable() |
| 245 | q.text('}') |
| 246 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 247 | oxm.subtypes[2147496204] = arp_sha_masked |
| 248 | |
| 249 | class arp_spa(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 250 | type_len = 2147494916 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 251 | |
| 252 | def __init__(self, value=None): |
| 253 | if value != None: |
| 254 | self.value = value |
| 255 | else: |
| 256 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 257 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 258 | |
| 259 | def pack(self): |
| 260 | packed = [] |
| 261 | packed.append(struct.pack("!L", self.type_len)) |
| 262 | packed.append(struct.pack("!L", self.value)) |
| 263 | return ''.join(packed) |
| 264 | |
| 265 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 266 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 267 | obj = arp_spa() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 268 | _type_len = reader.read("!L")[0] |
| 269 | assert(_type_len == 2147494916) |
| 270 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 271 | return obj |
| 272 | |
| 273 | def __eq__(self, other): |
| 274 | if type(self) != type(other): return False |
| 275 | if self.value != other.value: return False |
| 276 | return True |
| 277 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 278 | def pretty_print(self, q): |
| 279 | q.text("arp_spa {") |
| 280 | with q.group(): |
| 281 | with q.indent(2): |
| 282 | q.breakable() |
| 283 | q.text("value = "); |
| 284 | q.text("%#x" % self.value) |
| 285 | q.breakable() |
| 286 | q.text('}') |
| 287 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 288 | oxm.subtypes[2147494916] = arp_spa |
| 289 | |
| 290 | class arp_spa_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 291 | type_len = 2147495176 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 292 | |
| 293 | def __init__(self, value=None, value_mask=None): |
| 294 | if value != None: |
| 295 | self.value = value |
| 296 | else: |
| 297 | self.value = 0 |
| 298 | if value_mask != None: |
| 299 | self.value_mask = value_mask |
| 300 | else: |
| 301 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 302 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 303 | |
| 304 | def pack(self): |
| 305 | packed = [] |
| 306 | packed.append(struct.pack("!L", self.type_len)) |
| 307 | packed.append(struct.pack("!L", self.value)) |
| 308 | packed.append(struct.pack("!L", self.value_mask)) |
| 309 | return ''.join(packed) |
| 310 | |
| 311 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 312 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 313 | obj = arp_spa_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 314 | _type_len = reader.read("!L")[0] |
| 315 | assert(_type_len == 2147495176) |
| 316 | obj.value = reader.read("!L")[0] |
| 317 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 318 | return obj |
| 319 | |
| 320 | def __eq__(self, other): |
| 321 | if type(self) != type(other): return False |
| 322 | if self.value != other.value: return False |
| 323 | if self.value_mask != other.value_mask: return False |
| 324 | return True |
| 325 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 326 | def pretty_print(self, q): |
| 327 | q.text("arp_spa_masked {") |
| 328 | with q.group(): |
| 329 | with q.indent(2): |
| 330 | q.breakable() |
| 331 | q.text("value = "); |
| 332 | q.text("%#x" % self.value) |
| 333 | q.text(","); q.breakable() |
| 334 | q.text("value_mask = "); |
| 335 | q.text("%#x" % self.value_mask) |
| 336 | q.breakable() |
| 337 | q.text('}') |
| 338 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 339 | oxm.subtypes[2147495176] = arp_spa_masked |
| 340 | |
| 341 | class arp_tha(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 342 | type_len = 2147496454 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 343 | |
| 344 | def __init__(self, value=None): |
| 345 | if value != None: |
| 346 | self.value = value |
| 347 | else: |
| 348 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 349 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 350 | |
| 351 | def pack(self): |
| 352 | packed = [] |
| 353 | packed.append(struct.pack("!L", self.type_len)) |
| 354 | packed.append(struct.pack("!6B", *self.value)) |
| 355 | return ''.join(packed) |
| 356 | |
| 357 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 358 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 359 | obj = arp_tha() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 360 | _type_len = reader.read("!L")[0] |
| 361 | assert(_type_len == 2147496454) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 362 | obj.value = list(reader.read('!6B')) |
| 363 | return obj |
| 364 | |
| 365 | def __eq__(self, other): |
| 366 | if type(self) != type(other): return False |
| 367 | if self.value != other.value: return False |
| 368 | return True |
| 369 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 370 | def pretty_print(self, q): |
| 371 | q.text("arp_tha {") |
| 372 | with q.group(): |
| 373 | with q.indent(2): |
| 374 | q.breakable() |
| 375 | q.text("value = "); |
| 376 | q.text(util.pretty_mac(self.value)) |
| 377 | q.breakable() |
| 378 | q.text('}') |
| 379 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 380 | oxm.subtypes[2147496454] = arp_tha |
| 381 | |
| 382 | class arp_tha_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 383 | type_len = 2147496716 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 384 | |
| 385 | def __init__(self, value=None, value_mask=None): |
| 386 | if value != None: |
| 387 | self.value = value |
| 388 | else: |
| 389 | self.value = [0,0,0,0,0,0] |
| 390 | if value_mask != None: |
| 391 | self.value_mask = value_mask |
| 392 | else: |
| 393 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 394 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 395 | |
| 396 | def pack(self): |
| 397 | packed = [] |
| 398 | packed.append(struct.pack("!L", self.type_len)) |
| 399 | packed.append(struct.pack("!6B", *self.value)) |
| 400 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 401 | return ''.join(packed) |
| 402 | |
| 403 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 404 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 405 | obj = arp_tha_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 406 | _type_len = reader.read("!L")[0] |
| 407 | assert(_type_len == 2147496716) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 408 | obj.value = list(reader.read('!6B')) |
| 409 | obj.value_mask = list(reader.read('!6B')) |
| 410 | return obj |
| 411 | |
| 412 | def __eq__(self, other): |
| 413 | if type(self) != type(other): return False |
| 414 | if self.value != other.value: return False |
| 415 | if self.value_mask != other.value_mask: return False |
| 416 | return True |
| 417 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 418 | def pretty_print(self, q): |
| 419 | q.text("arp_tha_masked {") |
| 420 | with q.group(): |
| 421 | with q.indent(2): |
| 422 | q.breakable() |
| 423 | q.text("value = "); |
| 424 | q.text(util.pretty_mac(self.value)) |
| 425 | q.text(","); q.breakable() |
| 426 | q.text("value_mask = "); |
| 427 | q.text(util.pretty_mac(self.value_mask)) |
| 428 | q.breakable() |
| 429 | q.text('}') |
| 430 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 431 | oxm.subtypes[2147496716] = arp_tha_masked |
| 432 | |
| 433 | class arp_tpa(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 434 | type_len = 2147495428 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 435 | |
| 436 | def __init__(self, value=None): |
| 437 | if value != None: |
| 438 | self.value = value |
| 439 | else: |
| 440 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 441 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 442 | |
| 443 | def pack(self): |
| 444 | packed = [] |
| 445 | packed.append(struct.pack("!L", self.type_len)) |
| 446 | packed.append(struct.pack("!L", self.value)) |
| 447 | return ''.join(packed) |
| 448 | |
| 449 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 450 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 451 | obj = arp_tpa() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 452 | _type_len = reader.read("!L")[0] |
| 453 | assert(_type_len == 2147495428) |
| 454 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 455 | return obj |
| 456 | |
| 457 | def __eq__(self, other): |
| 458 | if type(self) != type(other): return False |
| 459 | if self.value != other.value: return False |
| 460 | return True |
| 461 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 462 | def pretty_print(self, q): |
| 463 | q.text("arp_tpa {") |
| 464 | with q.group(): |
| 465 | with q.indent(2): |
| 466 | q.breakable() |
| 467 | q.text("value = "); |
| 468 | q.text("%#x" % self.value) |
| 469 | q.breakable() |
| 470 | q.text('}') |
| 471 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 472 | oxm.subtypes[2147495428] = arp_tpa |
| 473 | |
| 474 | class arp_tpa_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 475 | type_len = 2147495688 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 476 | |
| 477 | def __init__(self, value=None, value_mask=None): |
| 478 | if value != None: |
| 479 | self.value = value |
| 480 | else: |
| 481 | self.value = 0 |
| 482 | if value_mask != None: |
| 483 | self.value_mask = value_mask |
| 484 | else: |
| 485 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 486 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 487 | |
| 488 | def pack(self): |
| 489 | packed = [] |
| 490 | packed.append(struct.pack("!L", self.type_len)) |
| 491 | packed.append(struct.pack("!L", self.value)) |
| 492 | packed.append(struct.pack("!L", self.value_mask)) |
| 493 | return ''.join(packed) |
| 494 | |
| 495 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 496 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 497 | obj = arp_tpa_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 498 | _type_len = reader.read("!L")[0] |
| 499 | assert(_type_len == 2147495688) |
| 500 | obj.value = reader.read("!L")[0] |
| 501 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 502 | return obj |
| 503 | |
| 504 | def __eq__(self, other): |
| 505 | if type(self) != type(other): return False |
| 506 | if self.value != other.value: return False |
| 507 | if self.value_mask != other.value_mask: return False |
| 508 | return True |
| 509 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 510 | def pretty_print(self, q): |
| 511 | q.text("arp_tpa_masked {") |
| 512 | with q.group(): |
| 513 | with q.indent(2): |
| 514 | q.breakable() |
| 515 | q.text("value = "); |
| 516 | q.text("%#x" % self.value) |
| 517 | q.text(","); q.breakable() |
| 518 | q.text("value_mask = "); |
| 519 | q.text("%#x" % self.value_mask) |
| 520 | q.breakable() |
| 521 | q.text('}') |
| 522 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 523 | oxm.subtypes[2147495688] = arp_tpa_masked |
| 524 | |
Rich Lane | c0d05d1 | 2014-03-11 18:02:24 -0700 | [diff] [blame] | 525 | class bsn_egr_port_group_id(oxm): |
| 526 | type_len = 200196 |
| 527 | |
| 528 | def __init__(self, value=None): |
| 529 | if value != None: |
| 530 | self.value = value |
| 531 | else: |
| 532 | self.value = 0 |
| 533 | return |
| 534 | |
| 535 | def pack(self): |
| 536 | packed = [] |
| 537 | packed.append(struct.pack("!L", self.type_len)) |
| 538 | packed.append(struct.pack("!L", self.value)) |
| 539 | return ''.join(packed) |
| 540 | |
| 541 | @staticmethod |
| 542 | def unpack(reader): |
| 543 | obj = bsn_egr_port_group_id() |
| 544 | _type_len = reader.read("!L")[0] |
| 545 | assert(_type_len == 200196) |
| 546 | obj.value = reader.read("!L")[0] |
| 547 | return obj |
| 548 | |
| 549 | def __eq__(self, other): |
| 550 | if type(self) != type(other): return False |
| 551 | if self.value != other.value: return False |
| 552 | return True |
| 553 | |
| 554 | def pretty_print(self, q): |
| 555 | q.text("bsn_egr_port_group_id {") |
| 556 | with q.group(): |
| 557 | with q.indent(2): |
| 558 | q.breakable() |
| 559 | q.text("value = "); |
| 560 | q.text("%#x" % self.value) |
| 561 | q.breakable() |
| 562 | q.text('}') |
| 563 | |
| 564 | oxm.subtypes[200196] = bsn_egr_port_group_id |
| 565 | |
| 566 | class bsn_egr_port_group_id_masked(oxm): |
| 567 | type_len = 200456 |
| 568 | |
| 569 | def __init__(self, value=None, value_mask=None): |
| 570 | if value != None: |
| 571 | self.value = value |
| 572 | else: |
| 573 | self.value = 0 |
| 574 | if value_mask != None: |
| 575 | self.value_mask = value_mask |
| 576 | else: |
| 577 | self.value_mask = 0 |
| 578 | return |
| 579 | |
| 580 | def pack(self): |
| 581 | packed = [] |
| 582 | packed.append(struct.pack("!L", self.type_len)) |
| 583 | packed.append(struct.pack("!L", self.value)) |
| 584 | packed.append(struct.pack("!L", self.value_mask)) |
| 585 | return ''.join(packed) |
| 586 | |
| 587 | @staticmethod |
| 588 | def unpack(reader): |
| 589 | obj = bsn_egr_port_group_id_masked() |
| 590 | _type_len = reader.read("!L")[0] |
| 591 | assert(_type_len == 200456) |
| 592 | obj.value = reader.read("!L")[0] |
| 593 | obj.value_mask = reader.read("!L")[0] |
| 594 | return obj |
| 595 | |
| 596 | def __eq__(self, other): |
| 597 | if type(self) != type(other): return False |
| 598 | if self.value != other.value: return False |
| 599 | if self.value_mask != other.value_mask: return False |
| 600 | return True |
| 601 | |
| 602 | def pretty_print(self, q): |
| 603 | q.text("bsn_egr_port_group_id_masked {") |
| 604 | with q.group(): |
| 605 | with q.indent(2): |
| 606 | q.breakable() |
| 607 | q.text("value = "); |
| 608 | q.text("%#x" % self.value) |
| 609 | q.text(","); q.breakable() |
| 610 | q.text("value_mask = "); |
| 611 | q.text("%#x" % self.value_mask) |
| 612 | q.breakable() |
| 613 | q.text('}') |
| 614 | |
| 615 | oxm.subtypes[200456] = bsn_egr_port_group_id_masked |
| 616 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 617 | class bsn_global_vrf_allowed(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 618 | type_len = 198145 |
| 619 | |
| 620 | def __init__(self, value=None): |
| 621 | if value != None: |
| 622 | self.value = value |
| 623 | else: |
| 624 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 625 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 626 | |
| 627 | def pack(self): |
| 628 | packed = [] |
| 629 | packed.append(struct.pack("!L", self.type_len)) |
| 630 | packed.append(struct.pack("!B", self.value)) |
| 631 | return ''.join(packed) |
| 632 | |
| 633 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 634 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 635 | obj = bsn_global_vrf_allowed() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 636 | _type_len = reader.read("!L")[0] |
| 637 | assert(_type_len == 198145) |
| 638 | obj.value = reader.read("!B")[0] |
| 639 | return obj |
| 640 | |
| 641 | def __eq__(self, other): |
| 642 | if type(self) != type(other): return False |
| 643 | if self.value != other.value: return False |
| 644 | return True |
| 645 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 646 | def pretty_print(self, q): |
| 647 | q.text("bsn_global_vrf_allowed {") |
| 648 | with q.group(): |
| 649 | with q.indent(2): |
| 650 | q.breakable() |
| 651 | q.text("value = "); |
| 652 | q.text("%#x" % self.value) |
| 653 | q.breakable() |
| 654 | q.text('}') |
| 655 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 656 | oxm.subtypes[198145] = bsn_global_vrf_allowed |
| 657 | |
| 658 | class bsn_global_vrf_allowed_masked(oxm): |
| 659 | type_len = 198402 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 660 | |
| 661 | def __init__(self, value=None, value_mask=None): |
| 662 | if value != None: |
| 663 | self.value = value |
| 664 | else: |
| 665 | self.value = 0 |
| 666 | if value_mask != None: |
| 667 | self.value_mask = value_mask |
| 668 | else: |
| 669 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 670 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 671 | |
| 672 | def pack(self): |
| 673 | packed = [] |
| 674 | packed.append(struct.pack("!L", self.type_len)) |
| 675 | packed.append(struct.pack("!B", self.value)) |
| 676 | packed.append(struct.pack("!B", self.value_mask)) |
| 677 | return ''.join(packed) |
| 678 | |
| 679 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 680 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 681 | obj = bsn_global_vrf_allowed_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 682 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 683 | assert(_type_len == 198402) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 684 | obj.value = reader.read("!B")[0] |
| 685 | obj.value_mask = reader.read("!B")[0] |
| 686 | return obj |
| 687 | |
| 688 | def __eq__(self, other): |
| 689 | if type(self) != type(other): return False |
| 690 | if self.value != other.value: return False |
| 691 | if self.value_mask != other.value_mask: return False |
| 692 | return True |
| 693 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 694 | def pretty_print(self, q): |
| 695 | q.text("bsn_global_vrf_allowed_masked {") |
| 696 | with q.group(): |
| 697 | with q.indent(2): |
| 698 | q.breakable() |
| 699 | q.text("value = "); |
| 700 | q.text("%#x" % self.value) |
| 701 | q.text(","); q.breakable() |
| 702 | q.text("value_mask = "); |
| 703 | q.text("%#x" % self.value_mask) |
| 704 | q.breakable() |
| 705 | q.text('}') |
| 706 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 707 | oxm.subtypes[198402] = bsn_global_vrf_allowed_masked |
| 708 | |
| 709 | class bsn_in_ports_128(oxm): |
| 710 | type_len = 196624 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 711 | |
| 712 | def __init__(self, value=None): |
| 713 | if value != None: |
| 714 | self.value = value |
| 715 | else: |
| 716 | self.value = set() |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 717 | return |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 718 | |
| 719 | def pack(self): |
| 720 | packed = [] |
| 721 | packed.append(struct.pack("!L", self.type_len)) |
| 722 | packed.append(util.pack_bitmap_128(self.value)) |
| 723 | return ''.join(packed) |
| 724 | |
| 725 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 726 | def unpack(reader): |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 727 | obj = bsn_in_ports_128() |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 728 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 729 | assert(_type_len == 196624) |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 730 | obj.value = util.unpack_bitmap_128(reader) |
| 731 | return obj |
| 732 | |
| 733 | def __eq__(self, other): |
| 734 | if type(self) != type(other): return False |
| 735 | if self.value != other.value: return False |
| 736 | return True |
| 737 | |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 738 | def pretty_print(self, q): |
| 739 | q.text("bsn_in_ports_128 {") |
| 740 | with q.group(): |
| 741 | with q.indent(2): |
| 742 | q.breakable() |
| 743 | q.text("value = "); |
| 744 | q.pp(self.value) |
| 745 | q.breakable() |
| 746 | q.text('}') |
| 747 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 748 | oxm.subtypes[196624] = bsn_in_ports_128 |
| 749 | |
| 750 | class bsn_in_ports_128_masked(oxm): |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 751 | type_len = 196896 |
| 752 | |
| 753 | def __init__(self, value=None, value_mask=None): |
| 754 | if value != None: |
| 755 | self.value = value |
| 756 | else: |
| 757 | self.value = set() |
| 758 | if value_mask != None: |
| 759 | self.value_mask = value_mask |
| 760 | else: |
| 761 | self.value_mask = set() |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 762 | return |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 763 | |
| 764 | def pack(self): |
| 765 | packed = [] |
| 766 | packed.append(struct.pack("!L", self.type_len)) |
| 767 | packed.append(util.pack_bitmap_128(self.value)) |
| 768 | packed.append(util.pack_bitmap_128(self.value_mask)) |
| 769 | return ''.join(packed) |
| 770 | |
| 771 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 772 | def unpack(reader): |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 773 | obj = bsn_in_ports_128_masked() |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 774 | _type_len = reader.read("!L")[0] |
| 775 | assert(_type_len == 196896) |
| 776 | obj.value = util.unpack_bitmap_128(reader) |
| 777 | obj.value_mask = util.unpack_bitmap_128(reader) |
| 778 | return obj |
| 779 | |
| 780 | def __eq__(self, other): |
| 781 | if type(self) != type(other): return False |
| 782 | if self.value != other.value: return False |
| 783 | if self.value_mask != other.value_mask: return False |
| 784 | return True |
| 785 | |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 786 | def pretty_print(self, q): |
| 787 | q.text("bsn_in_ports_128_masked {") |
| 788 | with q.group(): |
| 789 | with q.indent(2): |
| 790 | q.breakable() |
| 791 | q.text("value = "); |
| 792 | q.pp(self.value) |
| 793 | q.text(","); q.breakable() |
| 794 | q.text("value_mask = "); |
| 795 | q.pp(self.value_mask) |
| 796 | q.breakable() |
| 797 | q.text('}') |
| 798 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 799 | oxm.subtypes[196896] = bsn_in_ports_128_masked |
| 800 | |
| 801 | class bsn_l3_dst_class_id(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 802 | type_len = 199684 |
| 803 | |
| 804 | def __init__(self, value=None): |
| 805 | if value != None: |
| 806 | self.value = value |
| 807 | else: |
| 808 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 809 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 810 | |
| 811 | def pack(self): |
| 812 | packed = [] |
| 813 | packed.append(struct.pack("!L", self.type_len)) |
| 814 | packed.append(struct.pack("!L", self.value)) |
| 815 | return ''.join(packed) |
| 816 | |
| 817 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 818 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 819 | obj = bsn_l3_dst_class_id() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 820 | _type_len = reader.read("!L")[0] |
| 821 | assert(_type_len == 199684) |
| 822 | obj.value = reader.read("!L")[0] |
| 823 | return obj |
| 824 | |
| 825 | def __eq__(self, other): |
| 826 | if type(self) != type(other): return False |
| 827 | if self.value != other.value: return False |
| 828 | return True |
| 829 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 830 | def pretty_print(self, q): |
| 831 | q.text("bsn_l3_dst_class_id {") |
| 832 | with q.group(): |
| 833 | with q.indent(2): |
| 834 | q.breakable() |
| 835 | q.text("value = "); |
| 836 | q.text("%#x" % self.value) |
| 837 | q.breakable() |
| 838 | q.text('}') |
| 839 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 840 | oxm.subtypes[199684] = bsn_l3_dst_class_id |
| 841 | |
| 842 | class bsn_l3_dst_class_id_masked(oxm): |
| 843 | type_len = 199944 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 844 | |
| 845 | def __init__(self, value=None, value_mask=None): |
| 846 | if value != None: |
| 847 | self.value = value |
| 848 | else: |
| 849 | self.value = 0 |
| 850 | if value_mask != None: |
| 851 | self.value_mask = value_mask |
| 852 | else: |
| 853 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 854 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 855 | |
| 856 | def pack(self): |
| 857 | packed = [] |
| 858 | packed.append(struct.pack("!L", self.type_len)) |
| 859 | packed.append(struct.pack("!L", self.value)) |
| 860 | packed.append(struct.pack("!L", self.value_mask)) |
| 861 | return ''.join(packed) |
| 862 | |
| 863 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 864 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 865 | obj = bsn_l3_dst_class_id_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 866 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 867 | assert(_type_len == 199944) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 868 | obj.value = reader.read("!L")[0] |
| 869 | obj.value_mask = reader.read("!L")[0] |
| 870 | return obj |
| 871 | |
| 872 | def __eq__(self, other): |
| 873 | if type(self) != type(other): return False |
| 874 | if self.value != other.value: return False |
| 875 | if self.value_mask != other.value_mask: return False |
| 876 | return True |
| 877 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 878 | def pretty_print(self, q): |
| 879 | q.text("bsn_l3_dst_class_id_masked {") |
| 880 | with q.group(): |
| 881 | with q.indent(2): |
| 882 | q.breakable() |
| 883 | q.text("value = "); |
| 884 | q.text("%#x" % self.value) |
| 885 | q.text(","); q.breakable() |
| 886 | q.text("value_mask = "); |
| 887 | q.text("%#x" % self.value_mask) |
| 888 | q.breakable() |
| 889 | q.text('}') |
| 890 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 891 | oxm.subtypes[199944] = bsn_l3_dst_class_id_masked |
| 892 | |
| 893 | class bsn_l3_interface_class_id(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 894 | type_len = 198660 |
| 895 | |
| 896 | def __init__(self, value=None): |
| 897 | if value != None: |
| 898 | self.value = value |
| 899 | else: |
| 900 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 901 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 902 | |
| 903 | def pack(self): |
| 904 | packed = [] |
| 905 | packed.append(struct.pack("!L", self.type_len)) |
| 906 | packed.append(struct.pack("!L", self.value)) |
| 907 | return ''.join(packed) |
| 908 | |
| 909 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 910 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 911 | obj = bsn_l3_interface_class_id() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 912 | _type_len = reader.read("!L")[0] |
| 913 | assert(_type_len == 198660) |
| 914 | obj.value = reader.read("!L")[0] |
| 915 | return obj |
| 916 | |
| 917 | def __eq__(self, other): |
| 918 | if type(self) != type(other): return False |
| 919 | if self.value != other.value: return False |
| 920 | return True |
| 921 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 922 | def pretty_print(self, q): |
| 923 | q.text("bsn_l3_interface_class_id {") |
| 924 | with q.group(): |
| 925 | with q.indent(2): |
| 926 | q.breakable() |
| 927 | q.text("value = "); |
| 928 | q.text("%#x" % self.value) |
| 929 | q.breakable() |
| 930 | q.text('}') |
| 931 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 932 | oxm.subtypes[198660] = bsn_l3_interface_class_id |
| 933 | |
| 934 | class bsn_l3_interface_class_id_masked(oxm): |
| 935 | type_len = 198920 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 936 | |
| 937 | def __init__(self, value=None, value_mask=None): |
| 938 | if value != None: |
| 939 | self.value = value |
| 940 | else: |
| 941 | self.value = 0 |
| 942 | if value_mask != None: |
| 943 | self.value_mask = value_mask |
| 944 | else: |
| 945 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 946 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 947 | |
| 948 | def pack(self): |
| 949 | packed = [] |
| 950 | packed.append(struct.pack("!L", self.type_len)) |
| 951 | packed.append(struct.pack("!L", self.value)) |
| 952 | packed.append(struct.pack("!L", self.value_mask)) |
| 953 | return ''.join(packed) |
| 954 | |
| 955 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 956 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 957 | obj = bsn_l3_interface_class_id_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 958 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 959 | assert(_type_len == 198920) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 960 | obj.value = reader.read("!L")[0] |
| 961 | obj.value_mask = reader.read("!L")[0] |
| 962 | return obj |
| 963 | |
| 964 | def __eq__(self, other): |
| 965 | if type(self) != type(other): return False |
| 966 | if self.value != other.value: return False |
| 967 | if self.value_mask != other.value_mask: return False |
| 968 | return True |
| 969 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 970 | def pretty_print(self, q): |
| 971 | q.text("bsn_l3_interface_class_id_masked {") |
| 972 | with q.group(): |
| 973 | with q.indent(2): |
| 974 | q.breakable() |
| 975 | q.text("value = "); |
| 976 | q.text("%#x" % self.value) |
| 977 | q.text(","); q.breakable() |
| 978 | q.text("value_mask = "); |
| 979 | q.text("%#x" % self.value_mask) |
| 980 | q.breakable() |
| 981 | q.text('}') |
| 982 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 983 | oxm.subtypes[198920] = bsn_l3_interface_class_id_masked |
| 984 | |
| 985 | class bsn_l3_src_class_id(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 986 | type_len = 199172 |
| 987 | |
| 988 | def __init__(self, value=None): |
| 989 | if value != None: |
| 990 | self.value = value |
| 991 | else: |
| 992 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 993 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 994 | |
| 995 | def pack(self): |
| 996 | packed = [] |
| 997 | packed.append(struct.pack("!L", self.type_len)) |
| 998 | packed.append(struct.pack("!L", self.value)) |
| 999 | return ''.join(packed) |
| 1000 | |
| 1001 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1002 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1003 | obj = bsn_l3_src_class_id() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1004 | _type_len = reader.read("!L")[0] |
| 1005 | assert(_type_len == 199172) |
| 1006 | obj.value = reader.read("!L")[0] |
| 1007 | return obj |
| 1008 | |
| 1009 | def __eq__(self, other): |
| 1010 | if type(self) != type(other): return False |
| 1011 | if self.value != other.value: return False |
| 1012 | return True |
| 1013 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1014 | def pretty_print(self, q): |
| 1015 | q.text("bsn_l3_src_class_id {") |
| 1016 | with q.group(): |
| 1017 | with q.indent(2): |
| 1018 | q.breakable() |
| 1019 | q.text("value = "); |
| 1020 | q.text("%#x" % self.value) |
| 1021 | q.breakable() |
| 1022 | q.text('}') |
| 1023 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1024 | oxm.subtypes[199172] = bsn_l3_src_class_id |
| 1025 | |
| 1026 | class bsn_l3_src_class_id_masked(oxm): |
| 1027 | type_len = 199432 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1028 | |
| 1029 | def __init__(self, value=None, value_mask=None): |
| 1030 | if value != None: |
| 1031 | self.value = value |
| 1032 | else: |
| 1033 | self.value = 0 |
| 1034 | if value_mask != None: |
| 1035 | self.value_mask = value_mask |
| 1036 | else: |
| 1037 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1038 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1039 | |
| 1040 | def pack(self): |
| 1041 | packed = [] |
| 1042 | packed.append(struct.pack("!L", self.type_len)) |
| 1043 | packed.append(struct.pack("!L", self.value)) |
| 1044 | packed.append(struct.pack("!L", self.value_mask)) |
| 1045 | return ''.join(packed) |
| 1046 | |
| 1047 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1048 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1049 | obj = bsn_l3_src_class_id_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1050 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1051 | assert(_type_len == 199432) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1052 | obj.value = reader.read("!L")[0] |
| 1053 | obj.value_mask = reader.read("!L")[0] |
| 1054 | return obj |
| 1055 | |
| 1056 | def __eq__(self, other): |
| 1057 | if type(self) != type(other): return False |
| 1058 | if self.value != other.value: return False |
| 1059 | if self.value_mask != other.value_mask: return False |
| 1060 | return True |
| 1061 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1062 | def pretty_print(self, q): |
| 1063 | q.text("bsn_l3_src_class_id_masked {") |
| 1064 | with q.group(): |
| 1065 | with q.indent(2): |
| 1066 | q.breakable() |
| 1067 | q.text("value = "); |
| 1068 | q.text("%#x" % self.value) |
| 1069 | q.text(","); q.breakable() |
| 1070 | q.text("value_mask = "); |
| 1071 | q.text("%#x" % self.value_mask) |
| 1072 | q.breakable() |
| 1073 | q.text('}') |
| 1074 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1075 | oxm.subtypes[199432] = bsn_l3_src_class_id_masked |
| 1076 | |
| 1077 | class bsn_lag_id(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1078 | type_len = 197124 |
| 1079 | |
| 1080 | def __init__(self, value=None): |
| 1081 | if value != None: |
| 1082 | self.value = value |
| 1083 | else: |
| 1084 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1085 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1086 | |
| 1087 | def pack(self): |
| 1088 | packed = [] |
| 1089 | packed.append(struct.pack("!L", self.type_len)) |
| 1090 | packed.append(struct.pack("!L", self.value)) |
| 1091 | return ''.join(packed) |
| 1092 | |
| 1093 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1094 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1095 | obj = bsn_lag_id() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1096 | _type_len = reader.read("!L")[0] |
| 1097 | assert(_type_len == 197124) |
| 1098 | obj.value = reader.read("!L")[0] |
| 1099 | return obj |
| 1100 | |
| 1101 | def __eq__(self, other): |
| 1102 | if type(self) != type(other): return False |
| 1103 | if self.value != other.value: return False |
| 1104 | return True |
| 1105 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1106 | def pretty_print(self, q): |
| 1107 | q.text("bsn_lag_id {") |
| 1108 | with q.group(): |
| 1109 | with q.indent(2): |
| 1110 | q.breakable() |
| 1111 | q.text("value = "); |
| 1112 | q.text("%#x" % self.value) |
| 1113 | q.breakable() |
| 1114 | q.text('}') |
| 1115 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1116 | oxm.subtypes[197124] = bsn_lag_id |
| 1117 | |
| 1118 | class bsn_lag_id_masked(oxm): |
| 1119 | type_len = 197384 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1120 | |
| 1121 | def __init__(self, value=None, value_mask=None): |
| 1122 | if value != None: |
| 1123 | self.value = value |
| 1124 | else: |
| 1125 | self.value = 0 |
| 1126 | if value_mask != None: |
| 1127 | self.value_mask = value_mask |
| 1128 | else: |
| 1129 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1130 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1131 | |
| 1132 | def pack(self): |
| 1133 | packed = [] |
| 1134 | packed.append(struct.pack("!L", self.type_len)) |
| 1135 | packed.append(struct.pack("!L", self.value)) |
| 1136 | packed.append(struct.pack("!L", self.value_mask)) |
| 1137 | return ''.join(packed) |
| 1138 | |
| 1139 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1140 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1141 | obj = bsn_lag_id_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1142 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1143 | assert(_type_len == 197384) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1144 | obj.value = reader.read("!L")[0] |
| 1145 | obj.value_mask = reader.read("!L")[0] |
| 1146 | return obj |
| 1147 | |
| 1148 | def __eq__(self, other): |
| 1149 | if type(self) != type(other): return False |
| 1150 | if self.value != other.value: return False |
| 1151 | if self.value_mask != other.value_mask: return False |
| 1152 | return True |
| 1153 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 1154 | def pretty_print(self, q): |
| 1155 | q.text("bsn_lag_id_masked {") |
| 1156 | with q.group(): |
| 1157 | with q.indent(2): |
| 1158 | q.breakable() |
| 1159 | q.text("value = "); |
| 1160 | q.text("%#x" % self.value) |
| 1161 | q.text(","); q.breakable() |
| 1162 | q.text("value_mask = "); |
| 1163 | q.text("%#x" % self.value_mask) |
| 1164 | q.breakable() |
| 1165 | q.text('}') |
| 1166 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1167 | oxm.subtypes[197384] = bsn_lag_id_masked |
| 1168 | |
Harshmeet Singh | c51f404 | 2014-05-21 13:32:52 -0700 | [diff] [blame] | 1169 | class bsn_tcp_flags(oxm): |
| 1170 | type_len = 204802 |
| 1171 | |
| 1172 | def __init__(self, value=None): |
| 1173 | if value != None: |
| 1174 | self.value = value |
| 1175 | else: |
| 1176 | self.value = 0 |
| 1177 | return |
| 1178 | |
| 1179 | def pack(self): |
| 1180 | packed = [] |
| 1181 | packed.append(struct.pack("!L", self.type_len)) |
| 1182 | packed.append(struct.pack("!H", self.value)) |
| 1183 | return ''.join(packed) |
| 1184 | |
| 1185 | @staticmethod |
| 1186 | def unpack(reader): |
| 1187 | obj = bsn_tcp_flags() |
| 1188 | _type_len = reader.read("!L")[0] |
| 1189 | assert(_type_len == 204802) |
| 1190 | obj.value = reader.read("!H")[0] |
| 1191 | return obj |
| 1192 | |
| 1193 | def __eq__(self, other): |
| 1194 | if type(self) != type(other): return False |
| 1195 | if self.value != other.value: return False |
| 1196 | return True |
| 1197 | |
| 1198 | def pretty_print(self, q): |
| 1199 | q.text("bsn_tcp_flags {") |
| 1200 | with q.group(): |
| 1201 | with q.indent(2): |
| 1202 | q.breakable() |
| 1203 | q.text("value = "); |
| 1204 | q.text("%#x" % self.value) |
| 1205 | q.breakable() |
| 1206 | q.text('}') |
| 1207 | |
| 1208 | oxm.subtypes[204802] = bsn_tcp_flags |
| 1209 | |
| 1210 | class bsn_tcp_flags_masked(oxm): |
| 1211 | type_len = 205060 |
| 1212 | |
| 1213 | def __init__(self, value=None, value_mask=None): |
| 1214 | if value != None: |
| 1215 | self.value = value |
| 1216 | else: |
| 1217 | self.value = 0 |
| 1218 | if value_mask != None: |
| 1219 | self.value_mask = value_mask |
| 1220 | else: |
| 1221 | self.value_mask = 0 |
| 1222 | return |
| 1223 | |
| 1224 | def pack(self): |
| 1225 | packed = [] |
| 1226 | packed.append(struct.pack("!L", self.type_len)) |
| 1227 | packed.append(struct.pack("!H", self.value)) |
| 1228 | packed.append(struct.pack("!H", self.value_mask)) |
| 1229 | return ''.join(packed) |
| 1230 | |
| 1231 | @staticmethod |
| 1232 | def unpack(reader): |
| 1233 | obj = bsn_tcp_flags_masked() |
| 1234 | _type_len = reader.read("!L")[0] |
| 1235 | assert(_type_len == 205060) |
| 1236 | obj.value = reader.read("!H")[0] |
| 1237 | obj.value_mask = reader.read("!H")[0] |
| 1238 | return obj |
| 1239 | |
| 1240 | def __eq__(self, other): |
| 1241 | if type(self) != type(other): return False |
| 1242 | if self.value != other.value: return False |
| 1243 | if self.value_mask != other.value_mask: return False |
| 1244 | return True |
| 1245 | |
| 1246 | def pretty_print(self, q): |
| 1247 | q.text("bsn_tcp_flags_masked {") |
| 1248 | with q.group(): |
| 1249 | with q.indent(2): |
| 1250 | q.breakable() |
| 1251 | q.text("value = "); |
| 1252 | q.text("%#x" % self.value) |
| 1253 | q.text(","); q.breakable() |
| 1254 | q.text("value_mask = "); |
| 1255 | q.text("%#x" % self.value_mask) |
| 1256 | q.breakable() |
| 1257 | q.text('}') |
| 1258 | |
| 1259 | oxm.subtypes[205060] = bsn_tcp_flags_masked |
| 1260 | |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1261 | class bsn_udf0(oxm): |
| 1262 | type_len = 200708 |
| 1263 | |
| 1264 | def __init__(self, value=None): |
| 1265 | if value != None: |
| 1266 | self.value = value |
| 1267 | else: |
| 1268 | self.value = 0 |
| 1269 | return |
| 1270 | |
| 1271 | def pack(self): |
| 1272 | packed = [] |
| 1273 | packed.append(struct.pack("!L", self.type_len)) |
| 1274 | packed.append(struct.pack("!L", self.value)) |
| 1275 | return ''.join(packed) |
| 1276 | |
| 1277 | @staticmethod |
| 1278 | def unpack(reader): |
| 1279 | obj = bsn_udf0() |
| 1280 | _type_len = reader.read("!L")[0] |
| 1281 | assert(_type_len == 200708) |
| 1282 | obj.value = reader.read("!L")[0] |
| 1283 | return obj |
| 1284 | |
| 1285 | def __eq__(self, other): |
| 1286 | if type(self) != type(other): return False |
| 1287 | if self.value != other.value: return False |
| 1288 | return True |
| 1289 | |
| 1290 | def pretty_print(self, q): |
| 1291 | q.text("bsn_udf0 {") |
| 1292 | with q.group(): |
| 1293 | with q.indent(2): |
| 1294 | q.breakable() |
| 1295 | q.text("value = "); |
| 1296 | q.text("%#x" % self.value) |
| 1297 | q.breakable() |
| 1298 | q.text('}') |
| 1299 | |
| 1300 | oxm.subtypes[200708] = bsn_udf0 |
| 1301 | |
| 1302 | class bsn_udf0_masked(oxm): |
| 1303 | type_len = 200968 |
| 1304 | |
| 1305 | def __init__(self, value=None, value_mask=None): |
| 1306 | if value != None: |
| 1307 | self.value = value |
| 1308 | else: |
| 1309 | self.value = 0 |
| 1310 | if value_mask != None: |
| 1311 | self.value_mask = value_mask |
| 1312 | else: |
| 1313 | self.value_mask = 0 |
| 1314 | return |
| 1315 | |
| 1316 | def pack(self): |
| 1317 | packed = [] |
| 1318 | packed.append(struct.pack("!L", self.type_len)) |
| 1319 | packed.append(struct.pack("!L", self.value)) |
| 1320 | packed.append(struct.pack("!L", self.value_mask)) |
| 1321 | return ''.join(packed) |
| 1322 | |
| 1323 | @staticmethod |
| 1324 | def unpack(reader): |
| 1325 | obj = bsn_udf0_masked() |
| 1326 | _type_len = reader.read("!L")[0] |
| 1327 | assert(_type_len == 200968) |
| 1328 | obj.value = reader.read("!L")[0] |
| 1329 | obj.value_mask = reader.read("!L")[0] |
| 1330 | return obj |
| 1331 | |
| 1332 | def __eq__(self, other): |
| 1333 | if type(self) != type(other): return False |
| 1334 | if self.value != other.value: return False |
| 1335 | if self.value_mask != other.value_mask: return False |
| 1336 | return True |
| 1337 | |
| 1338 | def pretty_print(self, q): |
| 1339 | q.text("bsn_udf0_masked {") |
| 1340 | with q.group(): |
| 1341 | with q.indent(2): |
| 1342 | q.breakable() |
| 1343 | q.text("value = "); |
| 1344 | q.text("%#x" % self.value) |
| 1345 | q.text(","); q.breakable() |
| 1346 | q.text("value_mask = "); |
| 1347 | q.text("%#x" % self.value_mask) |
| 1348 | q.breakable() |
| 1349 | q.text('}') |
| 1350 | |
| 1351 | oxm.subtypes[200968] = bsn_udf0_masked |
| 1352 | |
| 1353 | class bsn_udf1(oxm): |
| 1354 | type_len = 201220 |
| 1355 | |
| 1356 | def __init__(self, value=None): |
| 1357 | if value != None: |
| 1358 | self.value = value |
| 1359 | else: |
| 1360 | self.value = 0 |
| 1361 | return |
| 1362 | |
| 1363 | def pack(self): |
| 1364 | packed = [] |
| 1365 | packed.append(struct.pack("!L", self.type_len)) |
| 1366 | packed.append(struct.pack("!L", self.value)) |
| 1367 | return ''.join(packed) |
| 1368 | |
| 1369 | @staticmethod |
| 1370 | def unpack(reader): |
| 1371 | obj = bsn_udf1() |
| 1372 | _type_len = reader.read("!L")[0] |
| 1373 | assert(_type_len == 201220) |
| 1374 | obj.value = reader.read("!L")[0] |
| 1375 | return obj |
| 1376 | |
| 1377 | def __eq__(self, other): |
| 1378 | if type(self) != type(other): return False |
| 1379 | if self.value != other.value: return False |
| 1380 | return True |
| 1381 | |
| 1382 | def pretty_print(self, q): |
| 1383 | q.text("bsn_udf1 {") |
| 1384 | with q.group(): |
| 1385 | with q.indent(2): |
| 1386 | q.breakable() |
| 1387 | q.text("value = "); |
| 1388 | q.text("%#x" % self.value) |
| 1389 | q.breakable() |
| 1390 | q.text('}') |
| 1391 | |
| 1392 | oxm.subtypes[201220] = bsn_udf1 |
| 1393 | |
| 1394 | class bsn_udf1_masked(oxm): |
| 1395 | type_len = 201480 |
| 1396 | |
| 1397 | def __init__(self, value=None, value_mask=None): |
| 1398 | if value != None: |
| 1399 | self.value = value |
| 1400 | else: |
| 1401 | self.value = 0 |
| 1402 | if value_mask != None: |
| 1403 | self.value_mask = value_mask |
| 1404 | else: |
| 1405 | self.value_mask = 0 |
| 1406 | return |
| 1407 | |
| 1408 | def pack(self): |
| 1409 | packed = [] |
| 1410 | packed.append(struct.pack("!L", self.type_len)) |
| 1411 | packed.append(struct.pack("!L", self.value)) |
| 1412 | packed.append(struct.pack("!L", self.value_mask)) |
| 1413 | return ''.join(packed) |
| 1414 | |
| 1415 | @staticmethod |
| 1416 | def unpack(reader): |
| 1417 | obj = bsn_udf1_masked() |
| 1418 | _type_len = reader.read("!L")[0] |
| 1419 | assert(_type_len == 201480) |
| 1420 | obj.value = reader.read("!L")[0] |
| 1421 | obj.value_mask = reader.read("!L")[0] |
| 1422 | return obj |
| 1423 | |
| 1424 | def __eq__(self, other): |
| 1425 | if type(self) != type(other): return False |
| 1426 | if self.value != other.value: return False |
| 1427 | if self.value_mask != other.value_mask: return False |
| 1428 | return True |
| 1429 | |
| 1430 | def pretty_print(self, q): |
| 1431 | q.text("bsn_udf1_masked {") |
| 1432 | with q.group(): |
| 1433 | with q.indent(2): |
| 1434 | q.breakable() |
| 1435 | q.text("value = "); |
| 1436 | q.text("%#x" % self.value) |
| 1437 | q.text(","); q.breakable() |
| 1438 | q.text("value_mask = "); |
| 1439 | q.text("%#x" % self.value_mask) |
| 1440 | q.breakable() |
| 1441 | q.text('}') |
| 1442 | |
| 1443 | oxm.subtypes[201480] = bsn_udf1_masked |
| 1444 | |
| 1445 | class bsn_udf2(oxm): |
| 1446 | type_len = 201732 |
| 1447 | |
| 1448 | def __init__(self, value=None): |
| 1449 | if value != None: |
| 1450 | self.value = value |
| 1451 | else: |
| 1452 | self.value = 0 |
| 1453 | return |
| 1454 | |
| 1455 | def pack(self): |
| 1456 | packed = [] |
| 1457 | packed.append(struct.pack("!L", self.type_len)) |
| 1458 | packed.append(struct.pack("!L", self.value)) |
| 1459 | return ''.join(packed) |
| 1460 | |
| 1461 | @staticmethod |
| 1462 | def unpack(reader): |
| 1463 | obj = bsn_udf2() |
| 1464 | _type_len = reader.read("!L")[0] |
| 1465 | assert(_type_len == 201732) |
| 1466 | obj.value = reader.read("!L")[0] |
| 1467 | return obj |
| 1468 | |
| 1469 | def __eq__(self, other): |
| 1470 | if type(self) != type(other): return False |
| 1471 | if self.value != other.value: return False |
| 1472 | return True |
| 1473 | |
| 1474 | def pretty_print(self, q): |
| 1475 | q.text("bsn_udf2 {") |
| 1476 | with q.group(): |
| 1477 | with q.indent(2): |
| 1478 | q.breakable() |
| 1479 | q.text("value = "); |
| 1480 | q.text("%#x" % self.value) |
| 1481 | q.breakable() |
| 1482 | q.text('}') |
| 1483 | |
| 1484 | oxm.subtypes[201732] = bsn_udf2 |
| 1485 | |
| 1486 | class bsn_udf2_masked(oxm): |
| 1487 | type_len = 201992 |
| 1488 | |
| 1489 | def __init__(self, value=None, value_mask=None): |
| 1490 | if value != None: |
| 1491 | self.value = value |
| 1492 | else: |
| 1493 | self.value = 0 |
| 1494 | if value_mask != None: |
| 1495 | self.value_mask = value_mask |
| 1496 | else: |
| 1497 | self.value_mask = 0 |
| 1498 | return |
| 1499 | |
| 1500 | def pack(self): |
| 1501 | packed = [] |
| 1502 | packed.append(struct.pack("!L", self.type_len)) |
| 1503 | packed.append(struct.pack("!L", self.value)) |
| 1504 | packed.append(struct.pack("!L", self.value_mask)) |
| 1505 | return ''.join(packed) |
| 1506 | |
| 1507 | @staticmethod |
| 1508 | def unpack(reader): |
| 1509 | obj = bsn_udf2_masked() |
| 1510 | _type_len = reader.read("!L")[0] |
| 1511 | assert(_type_len == 201992) |
| 1512 | obj.value = reader.read("!L")[0] |
| 1513 | obj.value_mask = reader.read("!L")[0] |
| 1514 | return obj |
| 1515 | |
| 1516 | def __eq__(self, other): |
| 1517 | if type(self) != type(other): return False |
| 1518 | if self.value != other.value: return False |
| 1519 | if self.value_mask != other.value_mask: return False |
| 1520 | return True |
| 1521 | |
| 1522 | def pretty_print(self, q): |
| 1523 | q.text("bsn_udf2_masked {") |
| 1524 | with q.group(): |
| 1525 | with q.indent(2): |
| 1526 | q.breakable() |
| 1527 | q.text("value = "); |
| 1528 | q.text("%#x" % self.value) |
| 1529 | q.text(","); q.breakable() |
| 1530 | q.text("value_mask = "); |
| 1531 | q.text("%#x" % self.value_mask) |
| 1532 | q.breakable() |
| 1533 | q.text('}') |
| 1534 | |
| 1535 | oxm.subtypes[201992] = bsn_udf2_masked |
| 1536 | |
| 1537 | class bsn_udf3(oxm): |
| 1538 | type_len = 202244 |
| 1539 | |
| 1540 | def __init__(self, value=None): |
| 1541 | if value != None: |
| 1542 | self.value = value |
| 1543 | else: |
| 1544 | self.value = 0 |
| 1545 | return |
| 1546 | |
| 1547 | def pack(self): |
| 1548 | packed = [] |
| 1549 | packed.append(struct.pack("!L", self.type_len)) |
| 1550 | packed.append(struct.pack("!L", self.value)) |
| 1551 | return ''.join(packed) |
| 1552 | |
| 1553 | @staticmethod |
| 1554 | def unpack(reader): |
| 1555 | obj = bsn_udf3() |
| 1556 | _type_len = reader.read("!L")[0] |
| 1557 | assert(_type_len == 202244) |
| 1558 | obj.value = reader.read("!L")[0] |
| 1559 | return obj |
| 1560 | |
| 1561 | def __eq__(self, other): |
| 1562 | if type(self) != type(other): return False |
| 1563 | if self.value != other.value: return False |
| 1564 | return True |
| 1565 | |
| 1566 | def pretty_print(self, q): |
| 1567 | q.text("bsn_udf3 {") |
| 1568 | with q.group(): |
| 1569 | with q.indent(2): |
| 1570 | q.breakable() |
| 1571 | q.text("value = "); |
| 1572 | q.text("%#x" % self.value) |
| 1573 | q.breakable() |
| 1574 | q.text('}') |
| 1575 | |
| 1576 | oxm.subtypes[202244] = bsn_udf3 |
| 1577 | |
| 1578 | class bsn_udf3_masked(oxm): |
| 1579 | type_len = 202504 |
| 1580 | |
| 1581 | def __init__(self, value=None, value_mask=None): |
| 1582 | if value != None: |
| 1583 | self.value = value |
| 1584 | else: |
| 1585 | self.value = 0 |
| 1586 | if value_mask != None: |
| 1587 | self.value_mask = value_mask |
| 1588 | else: |
| 1589 | self.value_mask = 0 |
| 1590 | return |
| 1591 | |
| 1592 | def pack(self): |
| 1593 | packed = [] |
| 1594 | packed.append(struct.pack("!L", self.type_len)) |
| 1595 | packed.append(struct.pack("!L", self.value)) |
| 1596 | packed.append(struct.pack("!L", self.value_mask)) |
| 1597 | return ''.join(packed) |
| 1598 | |
| 1599 | @staticmethod |
| 1600 | def unpack(reader): |
| 1601 | obj = bsn_udf3_masked() |
| 1602 | _type_len = reader.read("!L")[0] |
| 1603 | assert(_type_len == 202504) |
| 1604 | obj.value = reader.read("!L")[0] |
| 1605 | obj.value_mask = reader.read("!L")[0] |
| 1606 | return obj |
| 1607 | |
| 1608 | def __eq__(self, other): |
| 1609 | if type(self) != type(other): return False |
| 1610 | if self.value != other.value: return False |
| 1611 | if self.value_mask != other.value_mask: return False |
| 1612 | return True |
| 1613 | |
| 1614 | def pretty_print(self, q): |
| 1615 | q.text("bsn_udf3_masked {") |
| 1616 | with q.group(): |
| 1617 | with q.indent(2): |
| 1618 | q.breakable() |
| 1619 | q.text("value = "); |
| 1620 | q.text("%#x" % self.value) |
| 1621 | q.text(","); q.breakable() |
| 1622 | q.text("value_mask = "); |
| 1623 | q.text("%#x" % self.value_mask) |
| 1624 | q.breakable() |
| 1625 | q.text('}') |
| 1626 | |
| 1627 | oxm.subtypes[202504] = bsn_udf3_masked |
| 1628 | |
| 1629 | class bsn_udf4(oxm): |
| 1630 | type_len = 202756 |
| 1631 | |
| 1632 | def __init__(self, value=None): |
| 1633 | if value != None: |
| 1634 | self.value = value |
| 1635 | else: |
| 1636 | self.value = 0 |
| 1637 | return |
| 1638 | |
| 1639 | def pack(self): |
| 1640 | packed = [] |
| 1641 | packed.append(struct.pack("!L", self.type_len)) |
| 1642 | packed.append(struct.pack("!L", self.value)) |
| 1643 | return ''.join(packed) |
| 1644 | |
| 1645 | @staticmethod |
| 1646 | def unpack(reader): |
| 1647 | obj = bsn_udf4() |
| 1648 | _type_len = reader.read("!L")[0] |
| 1649 | assert(_type_len == 202756) |
| 1650 | obj.value = reader.read("!L")[0] |
| 1651 | return obj |
| 1652 | |
| 1653 | def __eq__(self, other): |
| 1654 | if type(self) != type(other): return False |
| 1655 | if self.value != other.value: return False |
| 1656 | return True |
| 1657 | |
| 1658 | def pretty_print(self, q): |
| 1659 | q.text("bsn_udf4 {") |
| 1660 | with q.group(): |
| 1661 | with q.indent(2): |
| 1662 | q.breakable() |
| 1663 | q.text("value = "); |
| 1664 | q.text("%#x" % self.value) |
| 1665 | q.breakable() |
| 1666 | q.text('}') |
| 1667 | |
| 1668 | oxm.subtypes[202756] = bsn_udf4 |
| 1669 | |
| 1670 | class bsn_udf4_masked(oxm): |
| 1671 | type_len = 203016 |
| 1672 | |
| 1673 | def __init__(self, value=None, value_mask=None): |
| 1674 | if value != None: |
| 1675 | self.value = value |
| 1676 | else: |
| 1677 | self.value = 0 |
| 1678 | if value_mask != None: |
| 1679 | self.value_mask = value_mask |
| 1680 | else: |
| 1681 | self.value_mask = 0 |
| 1682 | return |
| 1683 | |
| 1684 | def pack(self): |
| 1685 | packed = [] |
| 1686 | packed.append(struct.pack("!L", self.type_len)) |
| 1687 | packed.append(struct.pack("!L", self.value)) |
| 1688 | packed.append(struct.pack("!L", self.value_mask)) |
| 1689 | return ''.join(packed) |
| 1690 | |
| 1691 | @staticmethod |
| 1692 | def unpack(reader): |
| 1693 | obj = bsn_udf4_masked() |
| 1694 | _type_len = reader.read("!L")[0] |
| 1695 | assert(_type_len == 203016) |
| 1696 | obj.value = reader.read("!L")[0] |
| 1697 | obj.value_mask = reader.read("!L")[0] |
| 1698 | return obj |
| 1699 | |
| 1700 | def __eq__(self, other): |
| 1701 | if type(self) != type(other): return False |
| 1702 | if self.value != other.value: return False |
| 1703 | if self.value_mask != other.value_mask: return False |
| 1704 | return True |
| 1705 | |
| 1706 | def pretty_print(self, q): |
| 1707 | q.text("bsn_udf4_masked {") |
| 1708 | with q.group(): |
| 1709 | with q.indent(2): |
| 1710 | q.breakable() |
| 1711 | q.text("value = "); |
| 1712 | q.text("%#x" % self.value) |
| 1713 | q.text(","); q.breakable() |
| 1714 | q.text("value_mask = "); |
| 1715 | q.text("%#x" % self.value_mask) |
| 1716 | q.breakable() |
| 1717 | q.text('}') |
| 1718 | |
| 1719 | oxm.subtypes[203016] = bsn_udf4_masked |
| 1720 | |
| 1721 | class bsn_udf5(oxm): |
| 1722 | type_len = 203268 |
| 1723 | |
| 1724 | def __init__(self, value=None): |
| 1725 | if value != None: |
| 1726 | self.value = value |
| 1727 | else: |
| 1728 | self.value = 0 |
| 1729 | return |
| 1730 | |
| 1731 | def pack(self): |
| 1732 | packed = [] |
| 1733 | packed.append(struct.pack("!L", self.type_len)) |
| 1734 | packed.append(struct.pack("!L", self.value)) |
| 1735 | return ''.join(packed) |
| 1736 | |
| 1737 | @staticmethod |
| 1738 | def unpack(reader): |
| 1739 | obj = bsn_udf5() |
| 1740 | _type_len = reader.read("!L")[0] |
| 1741 | assert(_type_len == 203268) |
| 1742 | obj.value = reader.read("!L")[0] |
| 1743 | return obj |
| 1744 | |
| 1745 | def __eq__(self, other): |
| 1746 | if type(self) != type(other): return False |
| 1747 | if self.value != other.value: return False |
| 1748 | return True |
| 1749 | |
| 1750 | def pretty_print(self, q): |
| 1751 | q.text("bsn_udf5 {") |
| 1752 | with q.group(): |
| 1753 | with q.indent(2): |
| 1754 | q.breakable() |
| 1755 | q.text("value = "); |
| 1756 | q.text("%#x" % self.value) |
| 1757 | q.breakable() |
| 1758 | q.text('}') |
| 1759 | |
| 1760 | oxm.subtypes[203268] = bsn_udf5 |
| 1761 | |
| 1762 | class bsn_udf5_masked(oxm): |
| 1763 | type_len = 203528 |
| 1764 | |
| 1765 | def __init__(self, value=None, value_mask=None): |
| 1766 | if value != None: |
| 1767 | self.value = value |
| 1768 | else: |
| 1769 | self.value = 0 |
| 1770 | if value_mask != None: |
| 1771 | self.value_mask = value_mask |
| 1772 | else: |
| 1773 | self.value_mask = 0 |
| 1774 | return |
| 1775 | |
| 1776 | def pack(self): |
| 1777 | packed = [] |
| 1778 | packed.append(struct.pack("!L", self.type_len)) |
| 1779 | packed.append(struct.pack("!L", self.value)) |
| 1780 | packed.append(struct.pack("!L", self.value_mask)) |
| 1781 | return ''.join(packed) |
| 1782 | |
| 1783 | @staticmethod |
| 1784 | def unpack(reader): |
| 1785 | obj = bsn_udf5_masked() |
| 1786 | _type_len = reader.read("!L")[0] |
| 1787 | assert(_type_len == 203528) |
| 1788 | obj.value = reader.read("!L")[0] |
| 1789 | obj.value_mask = reader.read("!L")[0] |
| 1790 | return obj |
| 1791 | |
| 1792 | def __eq__(self, other): |
| 1793 | if type(self) != type(other): return False |
| 1794 | if self.value != other.value: return False |
| 1795 | if self.value_mask != other.value_mask: return False |
| 1796 | return True |
| 1797 | |
| 1798 | def pretty_print(self, q): |
| 1799 | q.text("bsn_udf5_masked {") |
| 1800 | with q.group(): |
| 1801 | with q.indent(2): |
| 1802 | q.breakable() |
| 1803 | q.text("value = "); |
| 1804 | q.text("%#x" % self.value) |
| 1805 | q.text(","); q.breakable() |
| 1806 | q.text("value_mask = "); |
| 1807 | q.text("%#x" % self.value_mask) |
| 1808 | q.breakable() |
| 1809 | q.text('}') |
| 1810 | |
| 1811 | oxm.subtypes[203528] = bsn_udf5_masked |
| 1812 | |
| 1813 | class bsn_udf6(oxm): |
| 1814 | type_len = 203780 |
| 1815 | |
| 1816 | def __init__(self, value=None): |
| 1817 | if value != None: |
| 1818 | self.value = value |
| 1819 | else: |
| 1820 | self.value = 0 |
| 1821 | return |
| 1822 | |
| 1823 | def pack(self): |
| 1824 | packed = [] |
| 1825 | packed.append(struct.pack("!L", self.type_len)) |
| 1826 | packed.append(struct.pack("!L", self.value)) |
| 1827 | return ''.join(packed) |
| 1828 | |
| 1829 | @staticmethod |
| 1830 | def unpack(reader): |
| 1831 | obj = bsn_udf6() |
| 1832 | _type_len = reader.read("!L")[0] |
| 1833 | assert(_type_len == 203780) |
| 1834 | obj.value = reader.read("!L")[0] |
| 1835 | return obj |
| 1836 | |
| 1837 | def __eq__(self, other): |
| 1838 | if type(self) != type(other): return False |
| 1839 | if self.value != other.value: return False |
| 1840 | return True |
| 1841 | |
| 1842 | def pretty_print(self, q): |
| 1843 | q.text("bsn_udf6 {") |
| 1844 | with q.group(): |
| 1845 | with q.indent(2): |
| 1846 | q.breakable() |
| 1847 | q.text("value = "); |
| 1848 | q.text("%#x" % self.value) |
| 1849 | q.breakable() |
| 1850 | q.text('}') |
| 1851 | |
| 1852 | oxm.subtypes[203780] = bsn_udf6 |
| 1853 | |
| 1854 | class bsn_udf6_masked(oxm): |
| 1855 | type_len = 204040 |
| 1856 | |
| 1857 | def __init__(self, value=None, value_mask=None): |
| 1858 | if value != None: |
| 1859 | self.value = value |
| 1860 | else: |
| 1861 | self.value = 0 |
| 1862 | if value_mask != None: |
| 1863 | self.value_mask = value_mask |
| 1864 | else: |
| 1865 | self.value_mask = 0 |
| 1866 | return |
| 1867 | |
| 1868 | def pack(self): |
| 1869 | packed = [] |
| 1870 | packed.append(struct.pack("!L", self.type_len)) |
| 1871 | packed.append(struct.pack("!L", self.value)) |
| 1872 | packed.append(struct.pack("!L", self.value_mask)) |
| 1873 | return ''.join(packed) |
| 1874 | |
| 1875 | @staticmethod |
| 1876 | def unpack(reader): |
| 1877 | obj = bsn_udf6_masked() |
| 1878 | _type_len = reader.read("!L")[0] |
| 1879 | assert(_type_len == 204040) |
| 1880 | obj.value = reader.read("!L")[0] |
| 1881 | obj.value_mask = reader.read("!L")[0] |
| 1882 | return obj |
| 1883 | |
| 1884 | def __eq__(self, other): |
| 1885 | if type(self) != type(other): return False |
| 1886 | if self.value != other.value: return False |
| 1887 | if self.value_mask != other.value_mask: return False |
| 1888 | return True |
| 1889 | |
| 1890 | def pretty_print(self, q): |
| 1891 | q.text("bsn_udf6_masked {") |
| 1892 | with q.group(): |
| 1893 | with q.indent(2): |
| 1894 | q.breakable() |
| 1895 | q.text("value = "); |
| 1896 | q.text("%#x" % self.value) |
| 1897 | q.text(","); q.breakable() |
| 1898 | q.text("value_mask = "); |
| 1899 | q.text("%#x" % self.value_mask) |
| 1900 | q.breakable() |
| 1901 | q.text('}') |
| 1902 | |
| 1903 | oxm.subtypes[204040] = bsn_udf6_masked |
| 1904 | |
| 1905 | class bsn_udf7(oxm): |
| 1906 | type_len = 204292 |
| 1907 | |
| 1908 | def __init__(self, value=None): |
| 1909 | if value != None: |
| 1910 | self.value = value |
| 1911 | else: |
| 1912 | self.value = 0 |
| 1913 | return |
| 1914 | |
| 1915 | def pack(self): |
| 1916 | packed = [] |
| 1917 | packed.append(struct.pack("!L", self.type_len)) |
| 1918 | packed.append(struct.pack("!L", self.value)) |
| 1919 | return ''.join(packed) |
| 1920 | |
| 1921 | @staticmethod |
| 1922 | def unpack(reader): |
| 1923 | obj = bsn_udf7() |
| 1924 | _type_len = reader.read("!L")[0] |
| 1925 | assert(_type_len == 204292) |
| 1926 | obj.value = reader.read("!L")[0] |
| 1927 | return obj |
| 1928 | |
| 1929 | def __eq__(self, other): |
| 1930 | if type(self) != type(other): return False |
| 1931 | if self.value != other.value: return False |
| 1932 | return True |
| 1933 | |
| 1934 | def pretty_print(self, q): |
| 1935 | q.text("bsn_udf7 {") |
| 1936 | with q.group(): |
| 1937 | with q.indent(2): |
| 1938 | q.breakable() |
| 1939 | q.text("value = "); |
| 1940 | q.text("%#x" % self.value) |
| 1941 | q.breakable() |
| 1942 | q.text('}') |
| 1943 | |
| 1944 | oxm.subtypes[204292] = bsn_udf7 |
| 1945 | |
| 1946 | class bsn_udf7_masked(oxm): |
| 1947 | type_len = 204552 |
| 1948 | |
| 1949 | def __init__(self, value=None, value_mask=None): |
| 1950 | if value != None: |
| 1951 | self.value = value |
| 1952 | else: |
| 1953 | self.value = 0 |
| 1954 | if value_mask != None: |
| 1955 | self.value_mask = value_mask |
| 1956 | else: |
| 1957 | self.value_mask = 0 |
| 1958 | return |
| 1959 | |
| 1960 | def pack(self): |
| 1961 | packed = [] |
| 1962 | packed.append(struct.pack("!L", self.type_len)) |
| 1963 | packed.append(struct.pack("!L", self.value)) |
| 1964 | packed.append(struct.pack("!L", self.value_mask)) |
| 1965 | return ''.join(packed) |
| 1966 | |
| 1967 | @staticmethod |
| 1968 | def unpack(reader): |
| 1969 | obj = bsn_udf7_masked() |
| 1970 | _type_len = reader.read("!L")[0] |
| 1971 | assert(_type_len == 204552) |
| 1972 | obj.value = reader.read("!L")[0] |
| 1973 | obj.value_mask = reader.read("!L")[0] |
| 1974 | return obj |
| 1975 | |
| 1976 | def __eq__(self, other): |
| 1977 | if type(self) != type(other): return False |
| 1978 | if self.value != other.value: return False |
| 1979 | if self.value_mask != other.value_mask: return False |
| 1980 | return True |
| 1981 | |
| 1982 | def pretty_print(self, q): |
| 1983 | q.text("bsn_udf7_masked {") |
| 1984 | with q.group(): |
| 1985 | with q.indent(2): |
| 1986 | q.breakable() |
| 1987 | q.text("value = "); |
| 1988 | q.text("%#x" % self.value) |
| 1989 | q.text(","); q.breakable() |
| 1990 | q.text("value_mask = "); |
| 1991 | q.text("%#x" % self.value_mask) |
| 1992 | q.breakable() |
| 1993 | q.text('}') |
| 1994 | |
| 1995 | oxm.subtypes[204552] = bsn_udf7_masked |
| 1996 | |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 1997 | class bsn_vlan_xlate_port_group_id(oxm): |
| 1998 | type_len = 205316 |
| 1999 | |
| 2000 | def __init__(self, value=None): |
| 2001 | if value != None: |
| 2002 | self.value = value |
| 2003 | else: |
| 2004 | self.value = 0 |
| 2005 | return |
| 2006 | |
| 2007 | def pack(self): |
| 2008 | packed = [] |
| 2009 | packed.append(struct.pack("!L", self.type_len)) |
| 2010 | packed.append(struct.pack("!L", self.value)) |
| 2011 | return ''.join(packed) |
| 2012 | |
| 2013 | @staticmethod |
| 2014 | def unpack(reader): |
| 2015 | obj = bsn_vlan_xlate_port_group_id() |
| 2016 | _type_len = reader.read("!L")[0] |
| 2017 | assert(_type_len == 205316) |
| 2018 | obj.value = reader.read("!L")[0] |
| 2019 | return obj |
| 2020 | |
| 2021 | def __eq__(self, other): |
| 2022 | if type(self) != type(other): return False |
| 2023 | if self.value != other.value: return False |
| 2024 | return True |
| 2025 | |
| 2026 | def pretty_print(self, q): |
| 2027 | q.text("bsn_vlan_xlate_port_group_id {") |
| 2028 | with q.group(): |
| 2029 | with q.indent(2): |
| 2030 | q.breakable() |
| 2031 | q.text("value = "); |
| 2032 | q.text("%#x" % self.value) |
| 2033 | q.breakable() |
| 2034 | q.text('}') |
| 2035 | |
| 2036 | oxm.subtypes[205316] = bsn_vlan_xlate_port_group_id |
| 2037 | |
| 2038 | class bsn_vlan_xlate_port_group_id_masked(oxm): |
| 2039 | type_len = 205576 |
| 2040 | |
| 2041 | def __init__(self, value=None, value_mask=None): |
| 2042 | if value != None: |
| 2043 | self.value = value |
| 2044 | else: |
| 2045 | self.value = 0 |
| 2046 | if value_mask != None: |
| 2047 | self.value_mask = value_mask |
| 2048 | else: |
| 2049 | self.value_mask = 0 |
| 2050 | return |
| 2051 | |
| 2052 | def pack(self): |
| 2053 | packed = [] |
| 2054 | packed.append(struct.pack("!L", self.type_len)) |
| 2055 | packed.append(struct.pack("!L", self.value)) |
| 2056 | packed.append(struct.pack("!L", self.value_mask)) |
| 2057 | return ''.join(packed) |
| 2058 | |
| 2059 | @staticmethod |
| 2060 | def unpack(reader): |
| 2061 | obj = bsn_vlan_xlate_port_group_id_masked() |
| 2062 | _type_len = reader.read("!L")[0] |
| 2063 | assert(_type_len == 205576) |
| 2064 | obj.value = reader.read("!L")[0] |
| 2065 | obj.value_mask = reader.read("!L")[0] |
| 2066 | return obj |
| 2067 | |
| 2068 | def __eq__(self, other): |
| 2069 | if type(self) != type(other): return False |
| 2070 | if self.value != other.value: return False |
| 2071 | if self.value_mask != other.value_mask: return False |
| 2072 | return True |
| 2073 | |
| 2074 | def pretty_print(self, q): |
| 2075 | q.text("bsn_vlan_xlate_port_group_id_masked {") |
| 2076 | with q.group(): |
| 2077 | with q.indent(2): |
| 2078 | q.breakable() |
| 2079 | q.text("value = "); |
| 2080 | q.text("%#x" % self.value) |
| 2081 | q.text(","); q.breakable() |
| 2082 | q.text("value_mask = "); |
| 2083 | q.text("%#x" % self.value_mask) |
| 2084 | q.breakable() |
| 2085 | q.text('}') |
| 2086 | |
| 2087 | oxm.subtypes[205576] = bsn_vlan_xlate_port_group_id_masked |
| 2088 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2089 | class bsn_vrf(oxm): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 2090 | type_len = 197636 |
| 2091 | |
| 2092 | def __init__(self, value=None): |
| 2093 | if value != None: |
| 2094 | self.value = value |
| 2095 | else: |
| 2096 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2097 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 2098 | |
| 2099 | def pack(self): |
| 2100 | packed = [] |
| 2101 | packed.append(struct.pack("!L", self.type_len)) |
| 2102 | packed.append(struct.pack("!L", self.value)) |
| 2103 | return ''.join(packed) |
| 2104 | |
| 2105 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2106 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 2107 | obj = bsn_vrf() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 2108 | _type_len = reader.read("!L")[0] |
| 2109 | assert(_type_len == 197636) |
| 2110 | obj.value = reader.read("!L")[0] |
| 2111 | return obj |
| 2112 | |
| 2113 | def __eq__(self, other): |
| 2114 | if type(self) != type(other): return False |
| 2115 | if self.value != other.value: return False |
| 2116 | return True |
| 2117 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 2118 | def pretty_print(self, q): |
| 2119 | q.text("bsn_vrf {") |
| 2120 | with q.group(): |
| 2121 | with q.indent(2): |
| 2122 | q.breakable() |
| 2123 | q.text("value = "); |
| 2124 | q.text("%#x" % self.value) |
| 2125 | q.breakable() |
| 2126 | q.text('}') |
| 2127 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2128 | oxm.subtypes[197636] = bsn_vrf |
| 2129 | |
| 2130 | class bsn_vrf_masked(oxm): |
| 2131 | type_len = 197896 |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 2132 | |
| 2133 | def __init__(self, value=None, value_mask=None): |
| 2134 | if value != None: |
| 2135 | self.value = value |
| 2136 | else: |
| 2137 | self.value = 0 |
| 2138 | if value_mask != None: |
| 2139 | self.value_mask = value_mask |
| 2140 | else: |
| 2141 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2142 | return |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 2143 | |
| 2144 | def pack(self): |
| 2145 | packed = [] |
| 2146 | packed.append(struct.pack("!L", self.type_len)) |
| 2147 | packed.append(struct.pack("!L", self.value)) |
| 2148 | packed.append(struct.pack("!L", self.value_mask)) |
| 2149 | return ''.join(packed) |
| 2150 | |
| 2151 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2152 | def unpack(reader): |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 2153 | obj = bsn_vrf_masked() |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 2154 | _type_len = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2155 | assert(_type_len == 197896) |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 2156 | obj.value = reader.read("!L")[0] |
| 2157 | obj.value_mask = reader.read("!L")[0] |
| 2158 | return obj |
| 2159 | |
| 2160 | def __eq__(self, other): |
| 2161 | if type(self) != type(other): return False |
| 2162 | if self.value != other.value: return False |
| 2163 | if self.value_mask != other.value_mask: return False |
| 2164 | return True |
| 2165 | |
Rich Lane | d9e3f7b | 2013-11-04 11:40:43 -0800 | [diff] [blame] | 2166 | def pretty_print(self, q): |
| 2167 | q.text("bsn_vrf_masked {") |
| 2168 | with q.group(): |
| 2169 | with q.indent(2): |
| 2170 | q.breakable() |
| 2171 | q.text("value = "); |
| 2172 | q.text("%#x" % self.value) |
| 2173 | q.text(","); q.breakable() |
| 2174 | q.text("value_mask = "); |
| 2175 | q.text("%#x" % self.value_mask) |
| 2176 | q.breakable() |
| 2177 | q.text('}') |
| 2178 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2179 | oxm.subtypes[197896] = bsn_vrf_masked |
| 2180 | |
| 2181 | class eth_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2182 | type_len = 2147485190 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2183 | |
| 2184 | def __init__(self, value=None): |
| 2185 | if value != None: |
| 2186 | self.value = value |
| 2187 | else: |
| 2188 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2189 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2190 | |
| 2191 | def pack(self): |
| 2192 | packed = [] |
| 2193 | packed.append(struct.pack("!L", self.type_len)) |
| 2194 | packed.append(struct.pack("!6B", *self.value)) |
| 2195 | return ''.join(packed) |
| 2196 | |
| 2197 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2198 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2199 | obj = eth_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2200 | _type_len = reader.read("!L")[0] |
| 2201 | assert(_type_len == 2147485190) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2202 | obj.value = list(reader.read('!6B')) |
| 2203 | return obj |
| 2204 | |
| 2205 | def __eq__(self, other): |
| 2206 | if type(self) != type(other): return False |
| 2207 | if self.value != other.value: return False |
| 2208 | return True |
| 2209 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2210 | def pretty_print(self, q): |
| 2211 | q.text("eth_dst {") |
| 2212 | with q.group(): |
| 2213 | with q.indent(2): |
| 2214 | q.breakable() |
| 2215 | q.text("value = "); |
| 2216 | q.text(util.pretty_mac(self.value)) |
| 2217 | q.breakable() |
| 2218 | q.text('}') |
| 2219 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2220 | oxm.subtypes[2147485190] = eth_dst |
| 2221 | |
| 2222 | class eth_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2223 | type_len = 2147485452 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2224 | |
| 2225 | def __init__(self, value=None, value_mask=None): |
| 2226 | if value != None: |
| 2227 | self.value = value |
| 2228 | else: |
| 2229 | self.value = [0,0,0,0,0,0] |
| 2230 | if value_mask != None: |
| 2231 | self.value_mask = value_mask |
| 2232 | else: |
| 2233 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2234 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2235 | |
| 2236 | def pack(self): |
| 2237 | packed = [] |
| 2238 | packed.append(struct.pack("!L", self.type_len)) |
| 2239 | packed.append(struct.pack("!6B", *self.value)) |
| 2240 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 2241 | return ''.join(packed) |
| 2242 | |
| 2243 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2244 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2245 | obj = eth_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2246 | _type_len = reader.read("!L")[0] |
| 2247 | assert(_type_len == 2147485452) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2248 | obj.value = list(reader.read('!6B')) |
| 2249 | obj.value_mask = list(reader.read('!6B')) |
| 2250 | return obj |
| 2251 | |
| 2252 | def __eq__(self, other): |
| 2253 | if type(self) != type(other): return False |
| 2254 | if self.value != other.value: return False |
| 2255 | if self.value_mask != other.value_mask: return False |
| 2256 | return True |
| 2257 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2258 | def pretty_print(self, q): |
| 2259 | q.text("eth_dst_masked {") |
| 2260 | with q.group(): |
| 2261 | with q.indent(2): |
| 2262 | q.breakable() |
| 2263 | q.text("value = "); |
| 2264 | q.text(util.pretty_mac(self.value)) |
| 2265 | q.text(","); q.breakable() |
| 2266 | q.text("value_mask = "); |
| 2267 | q.text(util.pretty_mac(self.value_mask)) |
| 2268 | q.breakable() |
| 2269 | q.text('}') |
| 2270 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2271 | oxm.subtypes[2147485452] = eth_dst_masked |
| 2272 | |
| 2273 | class eth_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2274 | type_len = 2147485702 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2275 | |
| 2276 | def __init__(self, value=None): |
| 2277 | if value != None: |
| 2278 | self.value = value |
| 2279 | else: |
| 2280 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2281 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2282 | |
| 2283 | def pack(self): |
| 2284 | packed = [] |
| 2285 | packed.append(struct.pack("!L", self.type_len)) |
| 2286 | packed.append(struct.pack("!6B", *self.value)) |
| 2287 | return ''.join(packed) |
| 2288 | |
| 2289 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2290 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2291 | obj = eth_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2292 | _type_len = reader.read("!L")[0] |
| 2293 | assert(_type_len == 2147485702) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2294 | obj.value = list(reader.read('!6B')) |
| 2295 | return obj |
| 2296 | |
| 2297 | def __eq__(self, other): |
| 2298 | if type(self) != type(other): return False |
| 2299 | if self.value != other.value: return False |
| 2300 | return True |
| 2301 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2302 | def pretty_print(self, q): |
| 2303 | q.text("eth_src {") |
| 2304 | with q.group(): |
| 2305 | with q.indent(2): |
| 2306 | q.breakable() |
| 2307 | q.text("value = "); |
| 2308 | q.text(util.pretty_mac(self.value)) |
| 2309 | q.breakable() |
| 2310 | q.text('}') |
| 2311 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2312 | oxm.subtypes[2147485702] = eth_src |
| 2313 | |
| 2314 | class eth_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2315 | type_len = 2147485964 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2316 | |
| 2317 | def __init__(self, value=None, value_mask=None): |
| 2318 | if value != None: |
| 2319 | self.value = value |
| 2320 | else: |
| 2321 | self.value = [0,0,0,0,0,0] |
| 2322 | if value_mask != None: |
| 2323 | self.value_mask = value_mask |
| 2324 | else: |
| 2325 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2326 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2327 | |
| 2328 | def pack(self): |
| 2329 | packed = [] |
| 2330 | packed.append(struct.pack("!L", self.type_len)) |
| 2331 | packed.append(struct.pack("!6B", *self.value)) |
| 2332 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 2333 | return ''.join(packed) |
| 2334 | |
| 2335 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2336 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2337 | obj = eth_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2338 | _type_len = reader.read("!L")[0] |
| 2339 | assert(_type_len == 2147485964) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2340 | obj.value = list(reader.read('!6B')) |
| 2341 | obj.value_mask = list(reader.read('!6B')) |
| 2342 | return obj |
| 2343 | |
| 2344 | def __eq__(self, other): |
| 2345 | if type(self) != type(other): return False |
| 2346 | if self.value != other.value: return False |
| 2347 | if self.value_mask != other.value_mask: return False |
| 2348 | return True |
| 2349 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2350 | def pretty_print(self, q): |
| 2351 | q.text("eth_src_masked {") |
| 2352 | with q.group(): |
| 2353 | with q.indent(2): |
| 2354 | q.breakable() |
| 2355 | q.text("value = "); |
| 2356 | q.text(util.pretty_mac(self.value)) |
| 2357 | q.text(","); q.breakable() |
| 2358 | q.text("value_mask = "); |
| 2359 | q.text(util.pretty_mac(self.value_mask)) |
| 2360 | q.breakable() |
| 2361 | q.text('}') |
| 2362 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2363 | oxm.subtypes[2147485964] = eth_src_masked |
| 2364 | |
| 2365 | class eth_type(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2366 | type_len = 2147486210 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2367 | |
| 2368 | def __init__(self, value=None): |
| 2369 | if value != None: |
| 2370 | self.value = value |
| 2371 | else: |
| 2372 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2373 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2374 | |
| 2375 | def pack(self): |
| 2376 | packed = [] |
| 2377 | packed.append(struct.pack("!L", self.type_len)) |
| 2378 | packed.append(struct.pack("!H", self.value)) |
| 2379 | return ''.join(packed) |
| 2380 | |
| 2381 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2382 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2383 | obj = eth_type() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2384 | _type_len = reader.read("!L")[0] |
| 2385 | assert(_type_len == 2147486210) |
| 2386 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2387 | return obj |
| 2388 | |
| 2389 | def __eq__(self, other): |
| 2390 | if type(self) != type(other): return False |
| 2391 | if self.value != other.value: return False |
| 2392 | return True |
| 2393 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2394 | def pretty_print(self, q): |
| 2395 | q.text("eth_type {") |
| 2396 | with q.group(): |
| 2397 | with q.indent(2): |
| 2398 | q.breakable() |
| 2399 | q.text("value = "); |
| 2400 | q.text("%#x" % self.value) |
| 2401 | q.breakable() |
| 2402 | q.text('}') |
| 2403 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2404 | oxm.subtypes[2147486210] = eth_type |
| 2405 | |
| 2406 | class eth_type_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2407 | type_len = 2147486468 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2408 | |
| 2409 | def __init__(self, value=None, value_mask=None): |
| 2410 | if value != None: |
| 2411 | self.value = value |
| 2412 | else: |
| 2413 | self.value = 0 |
| 2414 | if value_mask != None: |
| 2415 | self.value_mask = value_mask |
| 2416 | else: |
| 2417 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2418 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2419 | |
| 2420 | def pack(self): |
| 2421 | packed = [] |
| 2422 | packed.append(struct.pack("!L", self.type_len)) |
| 2423 | packed.append(struct.pack("!H", self.value)) |
| 2424 | packed.append(struct.pack("!H", self.value_mask)) |
| 2425 | return ''.join(packed) |
| 2426 | |
| 2427 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2428 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2429 | obj = eth_type_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2430 | _type_len = reader.read("!L")[0] |
| 2431 | assert(_type_len == 2147486468) |
| 2432 | obj.value = reader.read("!H")[0] |
| 2433 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2434 | return obj |
| 2435 | |
| 2436 | def __eq__(self, other): |
| 2437 | if type(self) != type(other): return False |
| 2438 | if self.value != other.value: return False |
| 2439 | if self.value_mask != other.value_mask: return False |
| 2440 | return True |
| 2441 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2442 | def pretty_print(self, q): |
| 2443 | q.text("eth_type_masked {") |
| 2444 | with q.group(): |
| 2445 | with q.indent(2): |
| 2446 | q.breakable() |
| 2447 | q.text("value = "); |
| 2448 | q.text("%#x" % self.value) |
| 2449 | q.text(","); q.breakable() |
| 2450 | q.text("value_mask = "); |
| 2451 | q.text("%#x" % self.value_mask) |
| 2452 | q.breakable() |
| 2453 | q.text('}') |
| 2454 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2455 | oxm.subtypes[2147486468] = eth_type_masked |
| 2456 | |
| 2457 | class icmpv4_code(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2458 | type_len = 2147493889 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2459 | |
| 2460 | def __init__(self, value=None): |
| 2461 | if value != None: |
| 2462 | self.value = value |
| 2463 | else: |
| 2464 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2465 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2466 | |
| 2467 | def pack(self): |
| 2468 | packed = [] |
| 2469 | packed.append(struct.pack("!L", self.type_len)) |
| 2470 | packed.append(struct.pack("!B", self.value)) |
| 2471 | return ''.join(packed) |
| 2472 | |
| 2473 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2474 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2475 | obj = icmpv4_code() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2476 | _type_len = reader.read("!L")[0] |
| 2477 | assert(_type_len == 2147493889) |
| 2478 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2479 | return obj |
| 2480 | |
| 2481 | def __eq__(self, other): |
| 2482 | if type(self) != type(other): return False |
| 2483 | if self.value != other.value: return False |
| 2484 | return True |
| 2485 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2486 | def pretty_print(self, q): |
| 2487 | q.text("icmpv4_code {") |
| 2488 | with q.group(): |
| 2489 | with q.indent(2): |
| 2490 | q.breakable() |
| 2491 | q.text("value = "); |
| 2492 | q.text("%#x" % self.value) |
| 2493 | q.breakable() |
| 2494 | q.text('}') |
| 2495 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2496 | oxm.subtypes[2147493889] = icmpv4_code |
| 2497 | |
| 2498 | class icmpv4_code_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2499 | type_len = 2147494146 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2500 | |
| 2501 | def __init__(self, value=None, value_mask=None): |
| 2502 | if value != None: |
| 2503 | self.value = value |
| 2504 | else: |
| 2505 | self.value = 0 |
| 2506 | if value_mask != None: |
| 2507 | self.value_mask = value_mask |
| 2508 | else: |
| 2509 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2510 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2511 | |
| 2512 | def pack(self): |
| 2513 | packed = [] |
| 2514 | packed.append(struct.pack("!L", self.type_len)) |
| 2515 | packed.append(struct.pack("!B", self.value)) |
| 2516 | packed.append(struct.pack("!B", self.value_mask)) |
| 2517 | return ''.join(packed) |
| 2518 | |
| 2519 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2520 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2521 | obj = icmpv4_code_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2522 | _type_len = reader.read("!L")[0] |
| 2523 | assert(_type_len == 2147494146) |
| 2524 | obj.value = reader.read("!B")[0] |
| 2525 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2526 | return obj |
| 2527 | |
| 2528 | def __eq__(self, other): |
| 2529 | if type(self) != type(other): return False |
| 2530 | if self.value != other.value: return False |
| 2531 | if self.value_mask != other.value_mask: return False |
| 2532 | return True |
| 2533 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2534 | def pretty_print(self, q): |
| 2535 | q.text("icmpv4_code_masked {") |
| 2536 | with q.group(): |
| 2537 | with q.indent(2): |
| 2538 | q.breakable() |
| 2539 | q.text("value = "); |
| 2540 | q.text("%#x" % self.value) |
| 2541 | q.text(","); q.breakable() |
| 2542 | q.text("value_mask = "); |
| 2543 | q.text("%#x" % self.value_mask) |
| 2544 | q.breakable() |
| 2545 | q.text('}') |
| 2546 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2547 | oxm.subtypes[2147494146] = icmpv4_code_masked |
| 2548 | |
| 2549 | class icmpv4_type(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2550 | type_len = 2147493377 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2551 | |
| 2552 | def __init__(self, value=None): |
| 2553 | if value != None: |
| 2554 | self.value = value |
| 2555 | else: |
| 2556 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2557 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2558 | |
| 2559 | def pack(self): |
| 2560 | packed = [] |
| 2561 | packed.append(struct.pack("!L", self.type_len)) |
| 2562 | packed.append(struct.pack("!B", self.value)) |
| 2563 | return ''.join(packed) |
| 2564 | |
| 2565 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2566 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2567 | obj = icmpv4_type() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2568 | _type_len = reader.read("!L")[0] |
| 2569 | assert(_type_len == 2147493377) |
| 2570 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2571 | return obj |
| 2572 | |
| 2573 | def __eq__(self, other): |
| 2574 | if type(self) != type(other): return False |
| 2575 | if self.value != other.value: return False |
| 2576 | return True |
| 2577 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2578 | def pretty_print(self, q): |
| 2579 | q.text("icmpv4_type {") |
| 2580 | with q.group(): |
| 2581 | with q.indent(2): |
| 2582 | q.breakable() |
| 2583 | q.text("value = "); |
| 2584 | q.text("%#x" % self.value) |
| 2585 | q.breakable() |
| 2586 | q.text('}') |
| 2587 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2588 | oxm.subtypes[2147493377] = icmpv4_type |
| 2589 | |
| 2590 | class icmpv4_type_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2591 | type_len = 2147493634 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2592 | |
| 2593 | def __init__(self, value=None, value_mask=None): |
| 2594 | if value != None: |
| 2595 | self.value = value |
| 2596 | else: |
| 2597 | self.value = 0 |
| 2598 | if value_mask != None: |
| 2599 | self.value_mask = value_mask |
| 2600 | else: |
| 2601 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2602 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2603 | |
| 2604 | def pack(self): |
| 2605 | packed = [] |
| 2606 | packed.append(struct.pack("!L", self.type_len)) |
| 2607 | packed.append(struct.pack("!B", self.value)) |
| 2608 | packed.append(struct.pack("!B", self.value_mask)) |
| 2609 | return ''.join(packed) |
| 2610 | |
| 2611 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2612 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2613 | obj = icmpv4_type_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2614 | _type_len = reader.read("!L")[0] |
| 2615 | assert(_type_len == 2147493634) |
| 2616 | obj.value = reader.read("!B")[0] |
| 2617 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2618 | return obj |
| 2619 | |
| 2620 | def __eq__(self, other): |
| 2621 | if type(self) != type(other): return False |
| 2622 | if self.value != other.value: return False |
| 2623 | if self.value_mask != other.value_mask: return False |
| 2624 | return True |
| 2625 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2626 | def pretty_print(self, q): |
| 2627 | q.text("icmpv4_type_masked {") |
| 2628 | with q.group(): |
| 2629 | with q.indent(2): |
| 2630 | q.breakable() |
| 2631 | q.text("value = "); |
| 2632 | q.text("%#x" % self.value) |
| 2633 | q.text(","); q.breakable() |
| 2634 | q.text("value_mask = "); |
| 2635 | q.text("%#x" % self.value_mask) |
| 2636 | q.breakable() |
| 2637 | q.text('}') |
| 2638 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2639 | oxm.subtypes[2147493634] = icmpv4_type_masked |
| 2640 | |
| 2641 | class icmpv6_code(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2642 | type_len = 2147499009 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2643 | |
| 2644 | def __init__(self, value=None): |
| 2645 | if value != None: |
| 2646 | self.value = value |
| 2647 | else: |
| 2648 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2649 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2650 | |
| 2651 | def pack(self): |
| 2652 | packed = [] |
| 2653 | packed.append(struct.pack("!L", self.type_len)) |
| 2654 | packed.append(struct.pack("!B", self.value)) |
| 2655 | return ''.join(packed) |
| 2656 | |
| 2657 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2658 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2659 | obj = icmpv6_code() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2660 | _type_len = reader.read("!L")[0] |
| 2661 | assert(_type_len == 2147499009) |
| 2662 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2663 | return obj |
| 2664 | |
| 2665 | def __eq__(self, other): |
| 2666 | if type(self) != type(other): return False |
| 2667 | if self.value != other.value: return False |
| 2668 | return True |
| 2669 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2670 | def pretty_print(self, q): |
| 2671 | q.text("icmpv6_code {") |
| 2672 | with q.group(): |
| 2673 | with q.indent(2): |
| 2674 | q.breakable() |
| 2675 | q.text("value = "); |
| 2676 | q.text("%#x" % self.value) |
| 2677 | q.breakable() |
| 2678 | q.text('}') |
| 2679 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2680 | oxm.subtypes[2147499009] = icmpv6_code |
| 2681 | |
| 2682 | class icmpv6_code_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2683 | type_len = 2147499266 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2684 | |
| 2685 | def __init__(self, value=None, value_mask=None): |
| 2686 | if value != None: |
| 2687 | self.value = value |
| 2688 | else: |
| 2689 | self.value = 0 |
| 2690 | if value_mask != None: |
| 2691 | self.value_mask = value_mask |
| 2692 | else: |
| 2693 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2694 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2695 | |
| 2696 | def pack(self): |
| 2697 | packed = [] |
| 2698 | packed.append(struct.pack("!L", self.type_len)) |
| 2699 | packed.append(struct.pack("!B", self.value)) |
| 2700 | packed.append(struct.pack("!B", self.value_mask)) |
| 2701 | return ''.join(packed) |
| 2702 | |
| 2703 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2704 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2705 | obj = icmpv6_code_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2706 | _type_len = reader.read("!L")[0] |
| 2707 | assert(_type_len == 2147499266) |
| 2708 | obj.value = reader.read("!B")[0] |
| 2709 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2710 | return obj |
| 2711 | |
| 2712 | def __eq__(self, other): |
| 2713 | if type(self) != type(other): return False |
| 2714 | if self.value != other.value: return False |
| 2715 | if self.value_mask != other.value_mask: return False |
| 2716 | return True |
| 2717 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2718 | def pretty_print(self, q): |
| 2719 | q.text("icmpv6_code_masked {") |
| 2720 | with q.group(): |
| 2721 | with q.indent(2): |
| 2722 | q.breakable() |
| 2723 | q.text("value = "); |
| 2724 | q.text("%#x" % self.value) |
| 2725 | q.text(","); q.breakable() |
| 2726 | q.text("value_mask = "); |
| 2727 | q.text("%#x" % self.value_mask) |
| 2728 | q.breakable() |
| 2729 | q.text('}') |
| 2730 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2731 | oxm.subtypes[2147499266] = icmpv6_code_masked |
| 2732 | |
| 2733 | class icmpv6_type(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2734 | type_len = 2147498497 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2735 | |
| 2736 | def __init__(self, value=None): |
| 2737 | if value != None: |
| 2738 | self.value = value |
| 2739 | else: |
| 2740 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2741 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2742 | |
| 2743 | def pack(self): |
| 2744 | packed = [] |
| 2745 | packed.append(struct.pack("!L", self.type_len)) |
| 2746 | packed.append(struct.pack("!B", self.value)) |
| 2747 | return ''.join(packed) |
| 2748 | |
| 2749 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2750 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2751 | obj = icmpv6_type() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2752 | _type_len = reader.read("!L")[0] |
| 2753 | assert(_type_len == 2147498497) |
| 2754 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2755 | return obj |
| 2756 | |
| 2757 | def __eq__(self, other): |
| 2758 | if type(self) != type(other): return False |
| 2759 | if self.value != other.value: return False |
| 2760 | return True |
| 2761 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2762 | def pretty_print(self, q): |
| 2763 | q.text("icmpv6_type {") |
| 2764 | with q.group(): |
| 2765 | with q.indent(2): |
| 2766 | q.breakable() |
| 2767 | q.text("value = "); |
| 2768 | q.text("%#x" % self.value) |
| 2769 | q.breakable() |
| 2770 | q.text('}') |
| 2771 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2772 | oxm.subtypes[2147498497] = icmpv6_type |
| 2773 | |
| 2774 | class icmpv6_type_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2775 | type_len = 2147498754 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2776 | |
| 2777 | def __init__(self, value=None, value_mask=None): |
| 2778 | if value != None: |
| 2779 | self.value = value |
| 2780 | else: |
| 2781 | self.value = 0 |
| 2782 | if value_mask != None: |
| 2783 | self.value_mask = value_mask |
| 2784 | else: |
| 2785 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2786 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2787 | |
| 2788 | def pack(self): |
| 2789 | packed = [] |
| 2790 | packed.append(struct.pack("!L", self.type_len)) |
| 2791 | packed.append(struct.pack("!B", self.value)) |
| 2792 | packed.append(struct.pack("!B", self.value_mask)) |
| 2793 | return ''.join(packed) |
| 2794 | |
| 2795 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2796 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2797 | obj = icmpv6_type_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2798 | _type_len = reader.read("!L")[0] |
| 2799 | assert(_type_len == 2147498754) |
| 2800 | obj.value = reader.read("!B")[0] |
| 2801 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2802 | return obj |
| 2803 | |
| 2804 | def __eq__(self, other): |
| 2805 | if type(self) != type(other): return False |
| 2806 | if self.value != other.value: return False |
| 2807 | if self.value_mask != other.value_mask: return False |
| 2808 | return True |
| 2809 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2810 | def pretty_print(self, q): |
| 2811 | q.text("icmpv6_type_masked {") |
| 2812 | with q.group(): |
| 2813 | with q.indent(2): |
| 2814 | q.breakable() |
| 2815 | q.text("value = "); |
| 2816 | q.text("%#x" % self.value) |
| 2817 | q.text(","); q.breakable() |
| 2818 | q.text("value_mask = "); |
| 2819 | q.text("%#x" % self.value_mask) |
| 2820 | q.breakable() |
| 2821 | q.text('}') |
| 2822 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2823 | oxm.subtypes[2147498754] = icmpv6_type_masked |
| 2824 | |
| 2825 | class in_phy_port(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2826 | type_len = 2147484164 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2827 | |
| 2828 | def __init__(self, value=None): |
| 2829 | if value != None: |
| 2830 | self.value = value |
| 2831 | else: |
| 2832 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2833 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2834 | |
| 2835 | def pack(self): |
| 2836 | packed = [] |
| 2837 | packed.append(struct.pack("!L", self.type_len)) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2838 | packed.append(util.pack_port_no(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2839 | return ''.join(packed) |
| 2840 | |
| 2841 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2842 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2843 | obj = in_phy_port() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2844 | _type_len = reader.read("!L")[0] |
| 2845 | assert(_type_len == 2147484164) |
| 2846 | obj.value = util.unpack_port_no(reader) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2847 | return obj |
| 2848 | |
| 2849 | def __eq__(self, other): |
| 2850 | if type(self) != type(other): return False |
| 2851 | if self.value != other.value: return False |
| 2852 | return True |
| 2853 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2854 | def pretty_print(self, q): |
| 2855 | q.text("in_phy_port {") |
| 2856 | with q.group(): |
| 2857 | with q.indent(2): |
| 2858 | q.breakable() |
| 2859 | q.text("value = "); |
| 2860 | q.text(util.pretty_port(self.value)) |
| 2861 | q.breakable() |
| 2862 | q.text('}') |
| 2863 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2864 | oxm.subtypes[2147484164] = in_phy_port |
| 2865 | |
| 2866 | class in_phy_port_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2867 | type_len = 2147484424 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2868 | |
| 2869 | def __init__(self, value=None, value_mask=None): |
| 2870 | if value != None: |
| 2871 | self.value = value |
| 2872 | else: |
| 2873 | self.value = 0 |
| 2874 | if value_mask != None: |
| 2875 | self.value_mask = value_mask |
| 2876 | else: |
| 2877 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2878 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2879 | |
| 2880 | def pack(self): |
| 2881 | packed = [] |
| 2882 | packed.append(struct.pack("!L", self.type_len)) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2883 | packed.append(util.pack_port_no(self.value)) |
| 2884 | packed.append(util.pack_port_no(self.value_mask)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2885 | return ''.join(packed) |
| 2886 | |
| 2887 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2888 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2889 | obj = in_phy_port_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2890 | _type_len = reader.read("!L")[0] |
| 2891 | assert(_type_len == 2147484424) |
| 2892 | obj.value = util.unpack_port_no(reader) |
| 2893 | obj.value_mask = util.unpack_port_no(reader) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2894 | return obj |
| 2895 | |
| 2896 | def __eq__(self, other): |
| 2897 | if type(self) != type(other): return False |
| 2898 | if self.value != other.value: return False |
| 2899 | if self.value_mask != other.value_mask: return False |
| 2900 | return True |
| 2901 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2902 | def pretty_print(self, q): |
| 2903 | q.text("in_phy_port_masked {") |
| 2904 | with q.group(): |
| 2905 | with q.indent(2): |
| 2906 | q.breakable() |
| 2907 | q.text("value = "); |
| 2908 | q.text(util.pretty_port(self.value)) |
| 2909 | q.text(","); q.breakable() |
| 2910 | q.text("value_mask = "); |
| 2911 | q.text(util.pretty_port(self.value_mask)) |
| 2912 | q.breakable() |
| 2913 | q.text('}') |
| 2914 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2915 | oxm.subtypes[2147484424] = in_phy_port_masked |
| 2916 | |
| 2917 | class in_port(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2918 | type_len = 2147483652 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2919 | |
| 2920 | def __init__(self, value=None): |
| 2921 | if value != None: |
| 2922 | self.value = value |
| 2923 | else: |
| 2924 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2925 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2926 | |
| 2927 | def pack(self): |
| 2928 | packed = [] |
| 2929 | packed.append(struct.pack("!L", self.type_len)) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2930 | packed.append(util.pack_port_no(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2931 | return ''.join(packed) |
| 2932 | |
| 2933 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2934 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2935 | obj = in_port() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2936 | _type_len = reader.read("!L")[0] |
| 2937 | assert(_type_len == 2147483652) |
| 2938 | obj.value = util.unpack_port_no(reader) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2939 | return obj |
| 2940 | |
| 2941 | def __eq__(self, other): |
| 2942 | if type(self) != type(other): return False |
| 2943 | if self.value != other.value: return False |
| 2944 | return True |
| 2945 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2946 | def pretty_print(self, q): |
| 2947 | q.text("in_port {") |
| 2948 | with q.group(): |
| 2949 | with q.indent(2): |
| 2950 | q.breakable() |
| 2951 | q.text("value = "); |
| 2952 | q.text(util.pretty_port(self.value)) |
| 2953 | q.breakable() |
| 2954 | q.text('}') |
| 2955 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2956 | oxm.subtypes[2147483652] = in_port |
| 2957 | |
| 2958 | class in_port_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2959 | type_len = 2147483912 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2960 | |
| 2961 | def __init__(self, value=None, value_mask=None): |
| 2962 | if value != None: |
| 2963 | self.value = value |
| 2964 | else: |
| 2965 | self.value = 0 |
| 2966 | if value_mask != None: |
| 2967 | self.value_mask = value_mask |
| 2968 | else: |
| 2969 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2970 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2971 | |
| 2972 | def pack(self): |
| 2973 | packed = [] |
| 2974 | packed.append(struct.pack("!L", self.type_len)) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2975 | packed.append(util.pack_port_no(self.value)) |
| 2976 | packed.append(util.pack_port_no(self.value_mask)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2977 | return ''.join(packed) |
| 2978 | |
| 2979 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2980 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2981 | obj = in_port_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2982 | _type_len = reader.read("!L")[0] |
| 2983 | assert(_type_len == 2147483912) |
| 2984 | obj.value = util.unpack_port_no(reader) |
| 2985 | obj.value_mask = util.unpack_port_no(reader) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2986 | return obj |
| 2987 | |
| 2988 | def __eq__(self, other): |
| 2989 | if type(self) != type(other): return False |
| 2990 | if self.value != other.value: return False |
| 2991 | if self.value_mask != other.value_mask: return False |
| 2992 | return True |
| 2993 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2994 | def pretty_print(self, q): |
| 2995 | q.text("in_port_masked {") |
| 2996 | with q.group(): |
| 2997 | with q.indent(2): |
| 2998 | q.breakable() |
| 2999 | q.text("value = "); |
| 3000 | q.text(util.pretty_port(self.value)) |
| 3001 | q.text(","); q.breakable() |
| 3002 | q.text("value_mask = "); |
| 3003 | q.text(util.pretty_port(self.value_mask)) |
| 3004 | q.breakable() |
| 3005 | q.text('}') |
| 3006 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3007 | oxm.subtypes[2147483912] = in_port_masked |
| 3008 | |
| 3009 | class ip_dscp(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3010 | type_len = 2147487745 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3011 | |
| 3012 | def __init__(self, value=None): |
| 3013 | if value != None: |
| 3014 | self.value = value |
| 3015 | else: |
| 3016 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3017 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3018 | |
| 3019 | def pack(self): |
| 3020 | packed = [] |
| 3021 | packed.append(struct.pack("!L", self.type_len)) |
| 3022 | packed.append(struct.pack("!B", self.value)) |
| 3023 | return ''.join(packed) |
| 3024 | |
| 3025 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3026 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3027 | obj = ip_dscp() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3028 | _type_len = reader.read("!L")[0] |
| 3029 | assert(_type_len == 2147487745) |
| 3030 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3031 | return obj |
| 3032 | |
| 3033 | def __eq__(self, other): |
| 3034 | if type(self) != type(other): return False |
| 3035 | if self.value != other.value: return False |
| 3036 | return True |
| 3037 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3038 | def pretty_print(self, q): |
| 3039 | q.text("ip_dscp {") |
| 3040 | with q.group(): |
| 3041 | with q.indent(2): |
| 3042 | q.breakable() |
| 3043 | q.text("value = "); |
| 3044 | q.text("%#x" % self.value) |
| 3045 | q.breakable() |
| 3046 | q.text('}') |
| 3047 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3048 | oxm.subtypes[2147487745] = ip_dscp |
| 3049 | |
| 3050 | class ip_dscp_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3051 | type_len = 2147488002 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3052 | |
| 3053 | def __init__(self, value=None, value_mask=None): |
| 3054 | if value != None: |
| 3055 | self.value = value |
| 3056 | else: |
| 3057 | self.value = 0 |
| 3058 | if value_mask != None: |
| 3059 | self.value_mask = value_mask |
| 3060 | else: |
| 3061 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3062 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3063 | |
| 3064 | def pack(self): |
| 3065 | packed = [] |
| 3066 | packed.append(struct.pack("!L", self.type_len)) |
| 3067 | packed.append(struct.pack("!B", self.value)) |
| 3068 | packed.append(struct.pack("!B", self.value_mask)) |
| 3069 | return ''.join(packed) |
| 3070 | |
| 3071 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3072 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3073 | obj = ip_dscp_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3074 | _type_len = reader.read("!L")[0] |
| 3075 | assert(_type_len == 2147488002) |
| 3076 | obj.value = reader.read("!B")[0] |
| 3077 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3078 | return obj |
| 3079 | |
| 3080 | def __eq__(self, other): |
| 3081 | if type(self) != type(other): return False |
| 3082 | if self.value != other.value: return False |
| 3083 | if self.value_mask != other.value_mask: return False |
| 3084 | return True |
| 3085 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3086 | def pretty_print(self, q): |
| 3087 | q.text("ip_dscp_masked {") |
| 3088 | with q.group(): |
| 3089 | with q.indent(2): |
| 3090 | q.breakable() |
| 3091 | q.text("value = "); |
| 3092 | q.text("%#x" % self.value) |
| 3093 | q.text(","); q.breakable() |
| 3094 | q.text("value_mask = "); |
| 3095 | q.text("%#x" % self.value_mask) |
| 3096 | q.breakable() |
| 3097 | q.text('}') |
| 3098 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3099 | oxm.subtypes[2147488002] = ip_dscp_masked |
| 3100 | |
| 3101 | class ip_ecn(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3102 | type_len = 2147488257 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3103 | |
| 3104 | def __init__(self, value=None): |
| 3105 | if value != None: |
| 3106 | self.value = value |
| 3107 | else: |
| 3108 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3109 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3110 | |
| 3111 | def pack(self): |
| 3112 | packed = [] |
| 3113 | packed.append(struct.pack("!L", self.type_len)) |
| 3114 | packed.append(struct.pack("!B", self.value)) |
| 3115 | return ''.join(packed) |
| 3116 | |
| 3117 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3118 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3119 | obj = ip_ecn() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3120 | _type_len = reader.read("!L")[0] |
| 3121 | assert(_type_len == 2147488257) |
| 3122 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3123 | return obj |
| 3124 | |
| 3125 | def __eq__(self, other): |
| 3126 | if type(self) != type(other): return False |
| 3127 | if self.value != other.value: return False |
| 3128 | return True |
| 3129 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3130 | def pretty_print(self, q): |
| 3131 | q.text("ip_ecn {") |
| 3132 | with q.group(): |
| 3133 | with q.indent(2): |
| 3134 | q.breakable() |
| 3135 | q.text("value = "); |
| 3136 | q.text("%#x" % self.value) |
| 3137 | q.breakable() |
| 3138 | q.text('}') |
| 3139 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3140 | oxm.subtypes[2147488257] = ip_ecn |
| 3141 | |
| 3142 | class ip_ecn_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3143 | type_len = 2147488514 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3144 | |
| 3145 | def __init__(self, value=None, value_mask=None): |
| 3146 | if value != None: |
| 3147 | self.value = value |
| 3148 | else: |
| 3149 | self.value = 0 |
| 3150 | if value_mask != None: |
| 3151 | self.value_mask = value_mask |
| 3152 | else: |
| 3153 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3154 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3155 | |
| 3156 | def pack(self): |
| 3157 | packed = [] |
| 3158 | packed.append(struct.pack("!L", self.type_len)) |
| 3159 | packed.append(struct.pack("!B", self.value)) |
| 3160 | packed.append(struct.pack("!B", self.value_mask)) |
| 3161 | return ''.join(packed) |
| 3162 | |
| 3163 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3164 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3165 | obj = ip_ecn_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3166 | _type_len = reader.read("!L")[0] |
| 3167 | assert(_type_len == 2147488514) |
| 3168 | obj.value = reader.read("!B")[0] |
| 3169 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3170 | return obj |
| 3171 | |
| 3172 | def __eq__(self, other): |
| 3173 | if type(self) != type(other): return False |
| 3174 | if self.value != other.value: return False |
| 3175 | if self.value_mask != other.value_mask: return False |
| 3176 | return True |
| 3177 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3178 | def pretty_print(self, q): |
| 3179 | q.text("ip_ecn_masked {") |
| 3180 | with q.group(): |
| 3181 | with q.indent(2): |
| 3182 | q.breakable() |
| 3183 | q.text("value = "); |
| 3184 | q.text("%#x" % self.value) |
| 3185 | q.text(","); q.breakable() |
| 3186 | q.text("value_mask = "); |
| 3187 | q.text("%#x" % self.value_mask) |
| 3188 | q.breakable() |
| 3189 | q.text('}') |
| 3190 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3191 | oxm.subtypes[2147488514] = ip_ecn_masked |
| 3192 | |
| 3193 | class ip_proto(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3194 | type_len = 2147488769 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3195 | |
| 3196 | def __init__(self, value=None): |
| 3197 | if value != None: |
| 3198 | self.value = value |
| 3199 | else: |
| 3200 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3201 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3202 | |
| 3203 | def pack(self): |
| 3204 | packed = [] |
| 3205 | packed.append(struct.pack("!L", self.type_len)) |
| 3206 | packed.append(struct.pack("!B", self.value)) |
| 3207 | return ''.join(packed) |
| 3208 | |
| 3209 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3210 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3211 | obj = ip_proto() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3212 | _type_len = reader.read("!L")[0] |
| 3213 | assert(_type_len == 2147488769) |
| 3214 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3215 | return obj |
| 3216 | |
| 3217 | def __eq__(self, other): |
| 3218 | if type(self) != type(other): return False |
| 3219 | if self.value != other.value: return False |
| 3220 | return True |
| 3221 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3222 | def pretty_print(self, q): |
| 3223 | q.text("ip_proto {") |
| 3224 | with q.group(): |
| 3225 | with q.indent(2): |
| 3226 | q.breakable() |
| 3227 | q.text("value = "); |
| 3228 | q.text("%#x" % self.value) |
| 3229 | q.breakable() |
| 3230 | q.text('}') |
| 3231 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3232 | oxm.subtypes[2147488769] = ip_proto |
| 3233 | |
| 3234 | class ip_proto_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3235 | type_len = 2147489026 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3236 | |
| 3237 | def __init__(self, value=None, value_mask=None): |
| 3238 | if value != None: |
| 3239 | self.value = value |
| 3240 | else: |
| 3241 | self.value = 0 |
| 3242 | if value_mask != None: |
| 3243 | self.value_mask = value_mask |
| 3244 | else: |
| 3245 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3246 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3247 | |
| 3248 | def pack(self): |
| 3249 | packed = [] |
| 3250 | packed.append(struct.pack("!L", self.type_len)) |
| 3251 | packed.append(struct.pack("!B", self.value)) |
| 3252 | packed.append(struct.pack("!B", self.value_mask)) |
| 3253 | return ''.join(packed) |
| 3254 | |
| 3255 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3256 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3257 | obj = ip_proto_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3258 | _type_len = reader.read("!L")[0] |
| 3259 | assert(_type_len == 2147489026) |
| 3260 | obj.value = reader.read("!B")[0] |
| 3261 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3262 | return obj |
| 3263 | |
| 3264 | def __eq__(self, other): |
| 3265 | if type(self) != type(other): return False |
| 3266 | if self.value != other.value: return False |
| 3267 | if self.value_mask != other.value_mask: return False |
| 3268 | return True |
| 3269 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3270 | def pretty_print(self, q): |
| 3271 | q.text("ip_proto_masked {") |
| 3272 | with q.group(): |
| 3273 | with q.indent(2): |
| 3274 | q.breakable() |
| 3275 | q.text("value = "); |
| 3276 | q.text("%#x" % self.value) |
| 3277 | q.text(","); q.breakable() |
| 3278 | q.text("value_mask = "); |
| 3279 | q.text("%#x" % self.value_mask) |
| 3280 | q.breakable() |
| 3281 | q.text('}') |
| 3282 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3283 | oxm.subtypes[2147489026] = ip_proto_masked |
| 3284 | |
| 3285 | class ipv4_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3286 | type_len = 2147489796 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3287 | |
| 3288 | def __init__(self, value=None): |
| 3289 | if value != None: |
| 3290 | self.value = value |
| 3291 | else: |
| 3292 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3293 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3294 | |
| 3295 | def pack(self): |
| 3296 | packed = [] |
| 3297 | packed.append(struct.pack("!L", self.type_len)) |
| 3298 | packed.append(struct.pack("!L", self.value)) |
| 3299 | return ''.join(packed) |
| 3300 | |
| 3301 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3302 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3303 | obj = ipv4_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3304 | _type_len = reader.read("!L")[0] |
| 3305 | assert(_type_len == 2147489796) |
| 3306 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3307 | return obj |
| 3308 | |
| 3309 | def __eq__(self, other): |
| 3310 | if type(self) != type(other): return False |
| 3311 | if self.value != other.value: return False |
| 3312 | return True |
| 3313 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3314 | def pretty_print(self, q): |
| 3315 | q.text("ipv4_dst {") |
| 3316 | with q.group(): |
| 3317 | with q.indent(2): |
| 3318 | q.breakable() |
| 3319 | q.text("value = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 3320 | q.text(util.pretty_ipv4(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3321 | q.breakable() |
| 3322 | q.text('}') |
| 3323 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3324 | oxm.subtypes[2147489796] = ipv4_dst |
| 3325 | |
| 3326 | class ipv4_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3327 | type_len = 2147490056 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3328 | |
| 3329 | def __init__(self, value=None, value_mask=None): |
| 3330 | if value != None: |
| 3331 | self.value = value |
| 3332 | else: |
| 3333 | self.value = 0 |
| 3334 | if value_mask != None: |
| 3335 | self.value_mask = value_mask |
| 3336 | else: |
| 3337 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3338 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3339 | |
| 3340 | def pack(self): |
| 3341 | packed = [] |
| 3342 | packed.append(struct.pack("!L", self.type_len)) |
| 3343 | packed.append(struct.pack("!L", self.value)) |
| 3344 | packed.append(struct.pack("!L", self.value_mask)) |
| 3345 | return ''.join(packed) |
| 3346 | |
| 3347 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3348 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3349 | obj = ipv4_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3350 | _type_len = reader.read("!L")[0] |
| 3351 | assert(_type_len == 2147490056) |
| 3352 | obj.value = reader.read("!L")[0] |
| 3353 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3354 | return obj |
| 3355 | |
| 3356 | def __eq__(self, other): |
| 3357 | if type(self) != type(other): return False |
| 3358 | if self.value != other.value: return False |
| 3359 | if self.value_mask != other.value_mask: return False |
| 3360 | return True |
| 3361 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3362 | def pretty_print(self, q): |
| 3363 | q.text("ipv4_dst_masked {") |
| 3364 | with q.group(): |
| 3365 | with q.indent(2): |
| 3366 | q.breakable() |
| 3367 | q.text("value = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 3368 | q.text(util.pretty_ipv4(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3369 | q.text(","); q.breakable() |
| 3370 | q.text("value_mask = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 3371 | q.text(util.pretty_ipv4(self.value_mask)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3372 | q.breakable() |
| 3373 | q.text('}') |
| 3374 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3375 | oxm.subtypes[2147490056] = ipv4_dst_masked |
| 3376 | |
| 3377 | class ipv4_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3378 | type_len = 2147489284 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3379 | |
| 3380 | def __init__(self, value=None): |
| 3381 | if value != None: |
| 3382 | self.value = value |
| 3383 | else: |
| 3384 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3385 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3386 | |
| 3387 | def pack(self): |
| 3388 | packed = [] |
| 3389 | packed.append(struct.pack("!L", self.type_len)) |
| 3390 | packed.append(struct.pack("!L", self.value)) |
| 3391 | return ''.join(packed) |
| 3392 | |
| 3393 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3394 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3395 | obj = ipv4_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3396 | _type_len = reader.read("!L")[0] |
| 3397 | assert(_type_len == 2147489284) |
| 3398 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3399 | return obj |
| 3400 | |
| 3401 | def __eq__(self, other): |
| 3402 | if type(self) != type(other): return False |
| 3403 | if self.value != other.value: return False |
| 3404 | return True |
| 3405 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3406 | def pretty_print(self, q): |
| 3407 | q.text("ipv4_src {") |
| 3408 | with q.group(): |
| 3409 | with q.indent(2): |
| 3410 | q.breakable() |
| 3411 | q.text("value = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 3412 | q.text(util.pretty_ipv4(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3413 | q.breakable() |
| 3414 | q.text('}') |
| 3415 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3416 | oxm.subtypes[2147489284] = ipv4_src |
| 3417 | |
| 3418 | class ipv4_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3419 | type_len = 2147489544 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3420 | |
| 3421 | def __init__(self, value=None, value_mask=None): |
| 3422 | if value != None: |
| 3423 | self.value = value |
| 3424 | else: |
| 3425 | self.value = 0 |
| 3426 | if value_mask != None: |
| 3427 | self.value_mask = value_mask |
| 3428 | else: |
| 3429 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3430 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3431 | |
| 3432 | def pack(self): |
| 3433 | packed = [] |
| 3434 | packed.append(struct.pack("!L", self.type_len)) |
| 3435 | packed.append(struct.pack("!L", self.value)) |
| 3436 | packed.append(struct.pack("!L", self.value_mask)) |
| 3437 | return ''.join(packed) |
| 3438 | |
| 3439 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3440 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3441 | obj = ipv4_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3442 | _type_len = reader.read("!L")[0] |
| 3443 | assert(_type_len == 2147489544) |
| 3444 | obj.value = reader.read("!L")[0] |
| 3445 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3446 | return obj |
| 3447 | |
| 3448 | def __eq__(self, other): |
| 3449 | if type(self) != type(other): return False |
| 3450 | if self.value != other.value: return False |
| 3451 | if self.value_mask != other.value_mask: return False |
| 3452 | return True |
| 3453 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3454 | def pretty_print(self, q): |
| 3455 | q.text("ipv4_src_masked {") |
| 3456 | with q.group(): |
| 3457 | with q.indent(2): |
| 3458 | q.breakable() |
| 3459 | q.text("value = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 3460 | q.text(util.pretty_ipv4(self.value)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3461 | q.text(","); q.breakable() |
| 3462 | q.text("value_mask = "); |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 3463 | q.text(util.pretty_ipv4(self.value_mask)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3464 | q.breakable() |
| 3465 | q.text('}') |
| 3466 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3467 | oxm.subtypes[2147489544] = ipv4_src_masked |
| 3468 | |
| 3469 | class ipv6_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3470 | type_len = 2147497488 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3471 | |
| 3472 | def __init__(self, value=None): |
| 3473 | if value != None: |
| 3474 | self.value = value |
| 3475 | else: |
| 3476 | 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] | 3477 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3478 | |
| 3479 | def pack(self): |
| 3480 | packed = [] |
| 3481 | packed.append(struct.pack("!L", self.type_len)) |
| 3482 | packed.append(struct.pack("!16s", self.value)) |
| 3483 | return ''.join(packed) |
| 3484 | |
| 3485 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3486 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3487 | obj = ipv6_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3488 | _type_len = reader.read("!L")[0] |
| 3489 | assert(_type_len == 2147497488) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3490 | obj.value = reader.read('!16s')[0] |
| 3491 | return obj |
| 3492 | |
| 3493 | def __eq__(self, other): |
| 3494 | if type(self) != type(other): return False |
| 3495 | if self.value != other.value: return False |
| 3496 | return True |
| 3497 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3498 | def pretty_print(self, q): |
| 3499 | q.text("ipv6_dst {") |
| 3500 | with q.group(): |
| 3501 | with q.indent(2): |
| 3502 | q.breakable() |
| 3503 | q.text("value = "); |
| 3504 | q.pp(self.value) |
| 3505 | q.breakable() |
| 3506 | q.text('}') |
| 3507 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3508 | oxm.subtypes[2147497488] = ipv6_dst |
| 3509 | |
| 3510 | class ipv6_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3511 | type_len = 2147497760 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3512 | |
| 3513 | def __init__(self, value=None, value_mask=None): |
| 3514 | if value != None: |
| 3515 | self.value = value |
| 3516 | else: |
| 3517 | self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
| 3518 | if value_mask != None: |
| 3519 | self.value_mask = value_mask |
| 3520 | else: |
| 3521 | 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] | 3522 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3523 | |
| 3524 | def pack(self): |
| 3525 | packed = [] |
| 3526 | packed.append(struct.pack("!L", self.type_len)) |
| 3527 | packed.append(struct.pack("!16s", self.value)) |
| 3528 | packed.append(struct.pack("!16s", self.value_mask)) |
| 3529 | return ''.join(packed) |
| 3530 | |
| 3531 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3532 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3533 | obj = ipv6_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3534 | _type_len = reader.read("!L")[0] |
| 3535 | assert(_type_len == 2147497760) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3536 | obj.value = reader.read('!16s')[0] |
| 3537 | obj.value_mask = reader.read('!16s')[0] |
| 3538 | return obj |
| 3539 | |
| 3540 | def __eq__(self, other): |
| 3541 | if type(self) != type(other): return False |
| 3542 | if self.value != other.value: return False |
| 3543 | if self.value_mask != other.value_mask: return False |
| 3544 | return True |
| 3545 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3546 | def pretty_print(self, q): |
| 3547 | q.text("ipv6_dst_masked {") |
| 3548 | with q.group(): |
| 3549 | with q.indent(2): |
| 3550 | q.breakable() |
| 3551 | q.text("value = "); |
| 3552 | q.pp(self.value) |
| 3553 | q.text(","); q.breakable() |
| 3554 | q.text("value_mask = "); |
| 3555 | q.pp(self.value_mask) |
| 3556 | q.breakable() |
| 3557 | q.text('}') |
| 3558 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3559 | oxm.subtypes[2147497760] = ipv6_dst_masked |
| 3560 | |
| 3561 | class ipv6_flabel(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3562 | type_len = 2147497988 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3563 | |
| 3564 | def __init__(self, value=None): |
| 3565 | if value != None: |
| 3566 | self.value = value |
| 3567 | else: |
| 3568 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3569 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3570 | |
| 3571 | def pack(self): |
| 3572 | packed = [] |
| 3573 | packed.append(struct.pack("!L", self.type_len)) |
| 3574 | packed.append(struct.pack("!L", self.value)) |
| 3575 | return ''.join(packed) |
| 3576 | |
| 3577 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3578 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3579 | obj = ipv6_flabel() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3580 | _type_len = reader.read("!L")[0] |
| 3581 | assert(_type_len == 2147497988) |
| 3582 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3583 | return obj |
| 3584 | |
| 3585 | def __eq__(self, other): |
| 3586 | if type(self) != type(other): return False |
| 3587 | if self.value != other.value: return False |
| 3588 | return True |
| 3589 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3590 | def pretty_print(self, q): |
| 3591 | q.text("ipv6_flabel {") |
| 3592 | with q.group(): |
| 3593 | with q.indent(2): |
| 3594 | q.breakable() |
| 3595 | q.text("value = "); |
| 3596 | q.text("%#x" % self.value) |
| 3597 | q.breakable() |
| 3598 | q.text('}') |
| 3599 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3600 | oxm.subtypes[2147497988] = ipv6_flabel |
| 3601 | |
| 3602 | class ipv6_flabel_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3603 | type_len = 2147498248 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3604 | |
| 3605 | def __init__(self, value=None, value_mask=None): |
| 3606 | if value != None: |
| 3607 | self.value = value |
| 3608 | else: |
| 3609 | self.value = 0 |
| 3610 | if value_mask != None: |
| 3611 | self.value_mask = value_mask |
| 3612 | else: |
| 3613 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3614 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3615 | |
| 3616 | def pack(self): |
| 3617 | packed = [] |
| 3618 | packed.append(struct.pack("!L", self.type_len)) |
| 3619 | packed.append(struct.pack("!L", self.value)) |
| 3620 | packed.append(struct.pack("!L", self.value_mask)) |
| 3621 | return ''.join(packed) |
| 3622 | |
| 3623 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3624 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3625 | obj = ipv6_flabel_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3626 | _type_len = reader.read("!L")[0] |
| 3627 | assert(_type_len == 2147498248) |
| 3628 | obj.value = reader.read("!L")[0] |
| 3629 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3630 | return obj |
| 3631 | |
| 3632 | def __eq__(self, other): |
| 3633 | if type(self) != type(other): return False |
| 3634 | if self.value != other.value: return False |
| 3635 | if self.value_mask != other.value_mask: return False |
| 3636 | return True |
| 3637 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3638 | def pretty_print(self, q): |
| 3639 | q.text("ipv6_flabel_masked {") |
| 3640 | with q.group(): |
| 3641 | with q.indent(2): |
| 3642 | q.breakable() |
| 3643 | q.text("value = "); |
| 3644 | q.text("%#x" % self.value) |
| 3645 | q.text(","); q.breakable() |
| 3646 | q.text("value_mask = "); |
| 3647 | q.text("%#x" % self.value_mask) |
| 3648 | q.breakable() |
| 3649 | q.text('}') |
| 3650 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3651 | oxm.subtypes[2147498248] = ipv6_flabel_masked |
| 3652 | |
| 3653 | class ipv6_nd_sll(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3654 | type_len = 2147500038 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3655 | |
| 3656 | def __init__(self, value=None): |
| 3657 | if value != None: |
| 3658 | self.value = value |
| 3659 | else: |
| 3660 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3661 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3662 | |
| 3663 | def pack(self): |
| 3664 | packed = [] |
| 3665 | packed.append(struct.pack("!L", self.type_len)) |
| 3666 | packed.append(struct.pack("!6B", *self.value)) |
| 3667 | return ''.join(packed) |
| 3668 | |
| 3669 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3670 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3671 | obj = ipv6_nd_sll() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3672 | _type_len = reader.read("!L")[0] |
| 3673 | assert(_type_len == 2147500038) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3674 | obj.value = list(reader.read('!6B')) |
| 3675 | return obj |
| 3676 | |
| 3677 | def __eq__(self, other): |
| 3678 | if type(self) != type(other): return False |
| 3679 | if self.value != other.value: return False |
| 3680 | return True |
| 3681 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3682 | def pretty_print(self, q): |
| 3683 | q.text("ipv6_nd_sll {") |
| 3684 | with q.group(): |
| 3685 | with q.indent(2): |
| 3686 | q.breakable() |
| 3687 | q.text("value = "); |
| 3688 | q.text(util.pretty_mac(self.value)) |
| 3689 | q.breakable() |
| 3690 | q.text('}') |
| 3691 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3692 | oxm.subtypes[2147500038] = ipv6_nd_sll |
| 3693 | |
| 3694 | class ipv6_nd_sll_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3695 | type_len = 2147500300 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3696 | |
| 3697 | def __init__(self, value=None, value_mask=None): |
| 3698 | if value != None: |
| 3699 | self.value = value |
| 3700 | else: |
| 3701 | self.value = [0,0,0,0,0,0] |
| 3702 | if value_mask != None: |
| 3703 | self.value_mask = value_mask |
| 3704 | else: |
| 3705 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3706 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3707 | |
| 3708 | def pack(self): |
| 3709 | packed = [] |
| 3710 | packed.append(struct.pack("!L", self.type_len)) |
| 3711 | packed.append(struct.pack("!6B", *self.value)) |
| 3712 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 3713 | return ''.join(packed) |
| 3714 | |
| 3715 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3716 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3717 | obj = ipv6_nd_sll_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3718 | _type_len = reader.read("!L")[0] |
| 3719 | assert(_type_len == 2147500300) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3720 | obj.value = list(reader.read('!6B')) |
| 3721 | obj.value_mask = list(reader.read('!6B')) |
| 3722 | return obj |
| 3723 | |
| 3724 | def __eq__(self, other): |
| 3725 | if type(self) != type(other): return False |
| 3726 | if self.value != other.value: return False |
| 3727 | if self.value_mask != other.value_mask: return False |
| 3728 | return True |
| 3729 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3730 | def pretty_print(self, q): |
| 3731 | q.text("ipv6_nd_sll_masked {") |
| 3732 | with q.group(): |
| 3733 | with q.indent(2): |
| 3734 | q.breakable() |
| 3735 | q.text("value = "); |
| 3736 | q.text(util.pretty_mac(self.value)) |
| 3737 | q.text(","); q.breakable() |
| 3738 | q.text("value_mask = "); |
| 3739 | q.text(util.pretty_mac(self.value_mask)) |
| 3740 | q.breakable() |
| 3741 | q.text('}') |
| 3742 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3743 | oxm.subtypes[2147500300] = ipv6_nd_sll_masked |
| 3744 | |
| 3745 | class ipv6_nd_target(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3746 | type_len = 2147499536 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3747 | |
| 3748 | def __init__(self, value=None): |
| 3749 | if value != None: |
| 3750 | self.value = value |
| 3751 | else: |
| 3752 | 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] | 3753 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3754 | |
| 3755 | def pack(self): |
| 3756 | packed = [] |
| 3757 | packed.append(struct.pack("!L", self.type_len)) |
| 3758 | packed.append(struct.pack("!16s", self.value)) |
| 3759 | return ''.join(packed) |
| 3760 | |
| 3761 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3762 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3763 | obj = ipv6_nd_target() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3764 | _type_len = reader.read("!L")[0] |
| 3765 | assert(_type_len == 2147499536) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3766 | obj.value = reader.read('!16s')[0] |
| 3767 | return obj |
| 3768 | |
| 3769 | def __eq__(self, other): |
| 3770 | if type(self) != type(other): return False |
| 3771 | if self.value != other.value: return False |
| 3772 | return True |
| 3773 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3774 | def pretty_print(self, q): |
| 3775 | q.text("ipv6_nd_target {") |
| 3776 | with q.group(): |
| 3777 | with q.indent(2): |
| 3778 | q.breakable() |
| 3779 | q.text("value = "); |
| 3780 | q.pp(self.value) |
| 3781 | q.breakable() |
| 3782 | q.text('}') |
| 3783 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3784 | oxm.subtypes[2147499536] = ipv6_nd_target |
| 3785 | |
| 3786 | class ipv6_nd_target_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3787 | type_len = 2147499808 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3788 | |
| 3789 | def __init__(self, value=None, value_mask=None): |
| 3790 | if value != None: |
| 3791 | self.value = value |
| 3792 | else: |
| 3793 | self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
| 3794 | if value_mask != None: |
| 3795 | self.value_mask = value_mask |
| 3796 | else: |
| 3797 | 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] | 3798 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3799 | |
| 3800 | def pack(self): |
| 3801 | packed = [] |
| 3802 | packed.append(struct.pack("!L", self.type_len)) |
| 3803 | packed.append(struct.pack("!16s", self.value)) |
| 3804 | packed.append(struct.pack("!16s", self.value_mask)) |
| 3805 | return ''.join(packed) |
| 3806 | |
| 3807 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3808 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3809 | obj = ipv6_nd_target_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3810 | _type_len = reader.read("!L")[0] |
| 3811 | assert(_type_len == 2147499808) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3812 | obj.value = reader.read('!16s')[0] |
| 3813 | obj.value_mask = reader.read('!16s')[0] |
| 3814 | return obj |
| 3815 | |
| 3816 | def __eq__(self, other): |
| 3817 | if type(self) != type(other): return False |
| 3818 | if self.value != other.value: return False |
| 3819 | if self.value_mask != other.value_mask: return False |
| 3820 | return True |
| 3821 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3822 | def pretty_print(self, q): |
| 3823 | q.text("ipv6_nd_target_masked {") |
| 3824 | with q.group(): |
| 3825 | with q.indent(2): |
| 3826 | q.breakable() |
| 3827 | q.text("value = "); |
| 3828 | q.pp(self.value) |
| 3829 | q.text(","); q.breakable() |
| 3830 | q.text("value_mask = "); |
| 3831 | q.pp(self.value_mask) |
| 3832 | q.breakable() |
| 3833 | q.text('}') |
| 3834 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3835 | oxm.subtypes[2147499808] = ipv6_nd_target_masked |
| 3836 | |
| 3837 | class ipv6_nd_tll(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3838 | type_len = 2147500550 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3839 | |
| 3840 | def __init__(self, value=None): |
| 3841 | if value != None: |
| 3842 | self.value = value |
| 3843 | else: |
| 3844 | self.value = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3845 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3846 | |
| 3847 | def pack(self): |
| 3848 | packed = [] |
| 3849 | packed.append(struct.pack("!L", self.type_len)) |
| 3850 | packed.append(struct.pack("!6B", *self.value)) |
| 3851 | return ''.join(packed) |
| 3852 | |
| 3853 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3854 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3855 | obj = ipv6_nd_tll() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3856 | _type_len = reader.read("!L")[0] |
| 3857 | assert(_type_len == 2147500550) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3858 | obj.value = list(reader.read('!6B')) |
| 3859 | return obj |
| 3860 | |
| 3861 | def __eq__(self, other): |
| 3862 | if type(self) != type(other): return False |
| 3863 | if self.value != other.value: return False |
| 3864 | return True |
| 3865 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3866 | def pretty_print(self, q): |
| 3867 | q.text("ipv6_nd_tll {") |
| 3868 | with q.group(): |
| 3869 | with q.indent(2): |
| 3870 | q.breakable() |
| 3871 | q.text("value = "); |
| 3872 | q.text(util.pretty_mac(self.value)) |
| 3873 | q.breakable() |
| 3874 | q.text('}') |
| 3875 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3876 | oxm.subtypes[2147500550] = ipv6_nd_tll |
| 3877 | |
| 3878 | class ipv6_nd_tll_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3879 | type_len = 2147500812 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3880 | |
| 3881 | def __init__(self, value=None, value_mask=None): |
| 3882 | if value != None: |
| 3883 | self.value = value |
| 3884 | else: |
| 3885 | self.value = [0,0,0,0,0,0] |
| 3886 | if value_mask != None: |
| 3887 | self.value_mask = value_mask |
| 3888 | else: |
| 3889 | self.value_mask = [0,0,0,0,0,0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3890 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3891 | |
| 3892 | def pack(self): |
| 3893 | packed = [] |
| 3894 | packed.append(struct.pack("!L", self.type_len)) |
| 3895 | packed.append(struct.pack("!6B", *self.value)) |
| 3896 | packed.append(struct.pack("!6B", *self.value_mask)) |
| 3897 | return ''.join(packed) |
| 3898 | |
| 3899 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3900 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3901 | obj = ipv6_nd_tll_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3902 | _type_len = reader.read("!L")[0] |
| 3903 | assert(_type_len == 2147500812) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3904 | obj.value = list(reader.read('!6B')) |
| 3905 | obj.value_mask = list(reader.read('!6B')) |
| 3906 | return obj |
| 3907 | |
| 3908 | def __eq__(self, other): |
| 3909 | if type(self) != type(other): return False |
| 3910 | if self.value != other.value: return False |
| 3911 | if self.value_mask != other.value_mask: return False |
| 3912 | return True |
| 3913 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3914 | def pretty_print(self, q): |
| 3915 | q.text("ipv6_nd_tll_masked {") |
| 3916 | with q.group(): |
| 3917 | with q.indent(2): |
| 3918 | q.breakable() |
| 3919 | q.text("value = "); |
| 3920 | q.text(util.pretty_mac(self.value)) |
| 3921 | q.text(","); q.breakable() |
| 3922 | q.text("value_mask = "); |
| 3923 | q.text(util.pretty_mac(self.value_mask)) |
| 3924 | q.breakable() |
| 3925 | q.text('}') |
| 3926 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3927 | oxm.subtypes[2147500812] = ipv6_nd_tll_masked |
| 3928 | |
| 3929 | class ipv6_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3930 | type_len = 2147496976 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3931 | |
| 3932 | def __init__(self, value=None): |
| 3933 | if value != None: |
| 3934 | self.value = value |
| 3935 | else: |
| 3936 | 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] | 3937 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3938 | |
| 3939 | def pack(self): |
| 3940 | packed = [] |
| 3941 | packed.append(struct.pack("!L", self.type_len)) |
| 3942 | packed.append(struct.pack("!16s", self.value)) |
| 3943 | return ''.join(packed) |
| 3944 | |
| 3945 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3946 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3947 | obj = ipv6_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3948 | _type_len = reader.read("!L")[0] |
| 3949 | assert(_type_len == 2147496976) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3950 | obj.value = reader.read('!16s')[0] |
| 3951 | return obj |
| 3952 | |
| 3953 | def __eq__(self, other): |
| 3954 | if type(self) != type(other): return False |
| 3955 | if self.value != other.value: return False |
| 3956 | return True |
| 3957 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3958 | def pretty_print(self, q): |
| 3959 | q.text("ipv6_src {") |
| 3960 | with q.group(): |
| 3961 | with q.indent(2): |
| 3962 | q.breakable() |
| 3963 | q.text("value = "); |
| 3964 | q.pp(self.value) |
| 3965 | q.breakable() |
| 3966 | q.text('}') |
| 3967 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3968 | oxm.subtypes[2147496976] = ipv6_src |
| 3969 | |
| 3970 | class ipv6_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3971 | type_len = 2147497248 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3972 | |
| 3973 | def __init__(self, value=None, value_mask=None): |
| 3974 | if value != None: |
| 3975 | self.value = value |
| 3976 | else: |
| 3977 | self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
| 3978 | if value_mask != None: |
| 3979 | self.value_mask = value_mask |
| 3980 | else: |
| 3981 | 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] | 3982 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3983 | |
| 3984 | def pack(self): |
| 3985 | packed = [] |
| 3986 | packed.append(struct.pack("!L", self.type_len)) |
| 3987 | packed.append(struct.pack("!16s", self.value)) |
| 3988 | packed.append(struct.pack("!16s", self.value_mask)) |
| 3989 | return ''.join(packed) |
| 3990 | |
| 3991 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3992 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3993 | obj = ipv6_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3994 | _type_len = reader.read("!L")[0] |
| 3995 | assert(_type_len == 2147497248) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3996 | obj.value = reader.read('!16s')[0] |
| 3997 | obj.value_mask = reader.read('!16s')[0] |
| 3998 | return obj |
| 3999 | |
| 4000 | def __eq__(self, other): |
| 4001 | if type(self) != type(other): return False |
| 4002 | if self.value != other.value: return False |
| 4003 | if self.value_mask != other.value_mask: return False |
| 4004 | return True |
| 4005 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4006 | def pretty_print(self, q): |
| 4007 | q.text("ipv6_src_masked {") |
| 4008 | with q.group(): |
| 4009 | with q.indent(2): |
| 4010 | q.breakable() |
| 4011 | q.text("value = "); |
| 4012 | q.pp(self.value) |
| 4013 | q.text(","); q.breakable() |
| 4014 | q.text("value_mask = "); |
| 4015 | q.pp(self.value_mask) |
| 4016 | q.breakable() |
| 4017 | q.text('}') |
| 4018 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4019 | oxm.subtypes[2147497248] = ipv6_src_masked |
| 4020 | |
| 4021 | class metadata(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4022 | type_len = 2147484680 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4023 | |
| 4024 | def __init__(self, value=None): |
| 4025 | if value != None: |
| 4026 | self.value = value |
| 4027 | else: |
| 4028 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4029 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4030 | |
| 4031 | def pack(self): |
| 4032 | packed = [] |
| 4033 | packed.append(struct.pack("!L", self.type_len)) |
| 4034 | packed.append(struct.pack("!Q", self.value)) |
| 4035 | return ''.join(packed) |
| 4036 | |
| 4037 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4038 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4039 | obj = metadata() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4040 | _type_len = reader.read("!L")[0] |
| 4041 | assert(_type_len == 2147484680) |
| 4042 | obj.value = reader.read("!Q")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4043 | return obj |
| 4044 | |
| 4045 | def __eq__(self, other): |
| 4046 | if type(self) != type(other): return False |
| 4047 | if self.value != other.value: return False |
| 4048 | return True |
| 4049 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4050 | def pretty_print(self, q): |
| 4051 | q.text("metadata {") |
| 4052 | with q.group(): |
| 4053 | with q.indent(2): |
| 4054 | q.breakable() |
| 4055 | q.text("value = "); |
| 4056 | q.text("%#x" % self.value) |
| 4057 | q.breakable() |
| 4058 | q.text('}') |
| 4059 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4060 | oxm.subtypes[2147484680] = metadata |
| 4061 | |
| 4062 | class metadata_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4063 | type_len = 2147484944 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4064 | |
| 4065 | def __init__(self, value=None, value_mask=None): |
| 4066 | if value != None: |
| 4067 | self.value = value |
| 4068 | else: |
| 4069 | self.value = 0 |
| 4070 | if value_mask != None: |
| 4071 | self.value_mask = value_mask |
| 4072 | else: |
| 4073 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4074 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4075 | |
| 4076 | def pack(self): |
| 4077 | packed = [] |
| 4078 | packed.append(struct.pack("!L", self.type_len)) |
| 4079 | packed.append(struct.pack("!Q", self.value)) |
| 4080 | packed.append(struct.pack("!Q", self.value_mask)) |
| 4081 | return ''.join(packed) |
| 4082 | |
| 4083 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4084 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4085 | obj = metadata_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4086 | _type_len = reader.read("!L")[0] |
| 4087 | assert(_type_len == 2147484944) |
| 4088 | obj.value = reader.read("!Q")[0] |
| 4089 | obj.value_mask = reader.read("!Q")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4090 | return obj |
| 4091 | |
| 4092 | def __eq__(self, other): |
| 4093 | if type(self) != type(other): return False |
| 4094 | if self.value != other.value: return False |
| 4095 | if self.value_mask != other.value_mask: return False |
| 4096 | return True |
| 4097 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4098 | def pretty_print(self, q): |
| 4099 | q.text("metadata_masked {") |
| 4100 | with q.group(): |
| 4101 | with q.indent(2): |
| 4102 | q.breakable() |
| 4103 | q.text("value = "); |
| 4104 | q.text("%#x" % self.value) |
| 4105 | q.text(","); q.breakable() |
| 4106 | q.text("value_mask = "); |
| 4107 | q.text("%#x" % self.value_mask) |
| 4108 | q.breakable() |
| 4109 | q.text('}') |
| 4110 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4111 | oxm.subtypes[2147484944] = metadata_masked |
| 4112 | |
Harshmeet Singh | 1db4633 | 2014-10-14 16:29:13 -0700 | [diff] [blame^] | 4113 | class mpls_bos(oxm): |
| 4114 | type_len = 2147502081 |
| 4115 | |
| 4116 | def __init__(self, value=None): |
| 4117 | if value != None: |
| 4118 | self.value = value |
| 4119 | else: |
| 4120 | self.value = 0 |
| 4121 | return |
| 4122 | |
| 4123 | def pack(self): |
| 4124 | packed = [] |
| 4125 | packed.append(struct.pack("!L", self.type_len)) |
| 4126 | packed.append(struct.pack("!B", self.value)) |
| 4127 | return ''.join(packed) |
| 4128 | |
| 4129 | @staticmethod |
| 4130 | def unpack(reader): |
| 4131 | obj = mpls_bos() |
| 4132 | _type_len = reader.read("!L")[0] |
| 4133 | assert(_type_len == 2147502081) |
| 4134 | obj.value = reader.read("!B")[0] |
| 4135 | return obj |
| 4136 | |
| 4137 | def __eq__(self, other): |
| 4138 | if type(self) != type(other): return False |
| 4139 | if self.value != other.value: return False |
| 4140 | return True |
| 4141 | |
| 4142 | def pretty_print(self, q): |
| 4143 | q.text("mpls_bos {") |
| 4144 | with q.group(): |
| 4145 | with q.indent(2): |
| 4146 | q.breakable() |
| 4147 | q.text("value = "); |
| 4148 | q.text("%#x" % self.value) |
| 4149 | q.breakable() |
| 4150 | q.text('}') |
| 4151 | |
| 4152 | oxm.subtypes[2147502081] = mpls_bos |
| 4153 | |
| 4154 | class mpls_bos_masked(oxm): |
| 4155 | type_len = 2147502338 |
| 4156 | |
| 4157 | def __init__(self, value=None, value_mask=None): |
| 4158 | if value != None: |
| 4159 | self.value = value |
| 4160 | else: |
| 4161 | self.value = 0 |
| 4162 | if value_mask != None: |
| 4163 | self.value_mask = value_mask |
| 4164 | else: |
| 4165 | self.value_mask = 0 |
| 4166 | return |
| 4167 | |
| 4168 | def pack(self): |
| 4169 | packed = [] |
| 4170 | packed.append(struct.pack("!L", self.type_len)) |
| 4171 | packed.append(struct.pack("!B", self.value)) |
| 4172 | packed.append(struct.pack("!B", self.value_mask)) |
| 4173 | return ''.join(packed) |
| 4174 | |
| 4175 | @staticmethod |
| 4176 | def unpack(reader): |
| 4177 | obj = mpls_bos_masked() |
| 4178 | _type_len = reader.read("!L")[0] |
| 4179 | assert(_type_len == 2147502338) |
| 4180 | obj.value = reader.read("!B")[0] |
| 4181 | obj.value_mask = reader.read("!B")[0] |
| 4182 | return obj |
| 4183 | |
| 4184 | def __eq__(self, other): |
| 4185 | if type(self) != type(other): return False |
| 4186 | if self.value != other.value: return False |
| 4187 | if self.value_mask != other.value_mask: return False |
| 4188 | return True |
| 4189 | |
| 4190 | def pretty_print(self, q): |
| 4191 | q.text("mpls_bos_masked {") |
| 4192 | with q.group(): |
| 4193 | with q.indent(2): |
| 4194 | q.breakable() |
| 4195 | q.text("value = "); |
| 4196 | q.text("%#x" % self.value) |
| 4197 | q.text(","); q.breakable() |
| 4198 | q.text("value_mask = "); |
| 4199 | q.text("%#x" % self.value_mask) |
| 4200 | q.breakable() |
| 4201 | q.text('}') |
| 4202 | |
| 4203 | oxm.subtypes[2147502338] = mpls_bos_masked |
| 4204 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4205 | class mpls_label(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4206 | type_len = 2147501060 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4207 | |
| 4208 | def __init__(self, value=None): |
| 4209 | if value != None: |
| 4210 | self.value = value |
| 4211 | else: |
| 4212 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4213 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4214 | |
| 4215 | def pack(self): |
| 4216 | packed = [] |
| 4217 | packed.append(struct.pack("!L", self.type_len)) |
| 4218 | packed.append(struct.pack("!L", self.value)) |
| 4219 | return ''.join(packed) |
| 4220 | |
| 4221 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4222 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4223 | obj = mpls_label() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4224 | _type_len = reader.read("!L")[0] |
| 4225 | assert(_type_len == 2147501060) |
| 4226 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4227 | return obj |
| 4228 | |
| 4229 | def __eq__(self, other): |
| 4230 | if type(self) != type(other): return False |
| 4231 | if self.value != other.value: return False |
| 4232 | return True |
| 4233 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4234 | def pretty_print(self, q): |
| 4235 | q.text("mpls_label {") |
| 4236 | with q.group(): |
| 4237 | with q.indent(2): |
| 4238 | q.breakable() |
| 4239 | q.text("value = "); |
| 4240 | q.text("%#x" % self.value) |
| 4241 | q.breakable() |
| 4242 | q.text('}') |
| 4243 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4244 | oxm.subtypes[2147501060] = mpls_label |
| 4245 | |
| 4246 | class mpls_label_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4247 | type_len = 2147501320 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4248 | |
| 4249 | def __init__(self, value=None, value_mask=None): |
| 4250 | if value != None: |
| 4251 | self.value = value |
| 4252 | else: |
| 4253 | self.value = 0 |
| 4254 | if value_mask != None: |
| 4255 | self.value_mask = value_mask |
| 4256 | else: |
| 4257 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4258 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4259 | |
| 4260 | def pack(self): |
| 4261 | packed = [] |
| 4262 | packed.append(struct.pack("!L", self.type_len)) |
| 4263 | packed.append(struct.pack("!L", self.value)) |
| 4264 | packed.append(struct.pack("!L", self.value_mask)) |
| 4265 | return ''.join(packed) |
| 4266 | |
| 4267 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4268 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4269 | obj = mpls_label_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4270 | _type_len = reader.read("!L")[0] |
| 4271 | assert(_type_len == 2147501320) |
| 4272 | obj.value = reader.read("!L")[0] |
| 4273 | obj.value_mask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4274 | return obj |
| 4275 | |
| 4276 | def __eq__(self, other): |
| 4277 | if type(self) != type(other): return False |
| 4278 | if self.value != other.value: return False |
| 4279 | if self.value_mask != other.value_mask: return False |
| 4280 | return True |
| 4281 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4282 | def pretty_print(self, q): |
| 4283 | q.text("mpls_label_masked {") |
| 4284 | with q.group(): |
| 4285 | with q.indent(2): |
| 4286 | q.breakable() |
| 4287 | q.text("value = "); |
| 4288 | q.text("%#x" % self.value) |
| 4289 | q.text(","); q.breakable() |
| 4290 | q.text("value_mask = "); |
| 4291 | q.text("%#x" % self.value_mask) |
| 4292 | q.breakable() |
| 4293 | q.text('}') |
| 4294 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4295 | oxm.subtypes[2147501320] = mpls_label_masked |
| 4296 | |
| 4297 | class mpls_tc(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4298 | type_len = 2147501569 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4299 | |
| 4300 | def __init__(self, value=None): |
| 4301 | if value != None: |
| 4302 | self.value = value |
| 4303 | else: |
| 4304 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4305 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4306 | |
| 4307 | def pack(self): |
| 4308 | packed = [] |
| 4309 | packed.append(struct.pack("!L", self.type_len)) |
| 4310 | packed.append(struct.pack("!B", self.value)) |
| 4311 | return ''.join(packed) |
| 4312 | |
| 4313 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4314 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4315 | obj = mpls_tc() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4316 | _type_len = reader.read("!L")[0] |
| 4317 | assert(_type_len == 2147501569) |
| 4318 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4319 | return obj |
| 4320 | |
| 4321 | def __eq__(self, other): |
| 4322 | if type(self) != type(other): return False |
| 4323 | if self.value != other.value: return False |
| 4324 | return True |
| 4325 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4326 | def pretty_print(self, q): |
| 4327 | q.text("mpls_tc {") |
| 4328 | with q.group(): |
| 4329 | with q.indent(2): |
| 4330 | q.breakable() |
| 4331 | q.text("value = "); |
| 4332 | q.text("%#x" % self.value) |
| 4333 | q.breakable() |
| 4334 | q.text('}') |
| 4335 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4336 | oxm.subtypes[2147501569] = mpls_tc |
| 4337 | |
| 4338 | class mpls_tc_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4339 | type_len = 2147501826 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4340 | |
| 4341 | def __init__(self, value=None, value_mask=None): |
| 4342 | if value != None: |
| 4343 | self.value = value |
| 4344 | else: |
| 4345 | self.value = 0 |
| 4346 | if value_mask != None: |
| 4347 | self.value_mask = value_mask |
| 4348 | else: |
| 4349 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4350 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4351 | |
| 4352 | def pack(self): |
| 4353 | packed = [] |
| 4354 | packed.append(struct.pack("!L", self.type_len)) |
| 4355 | packed.append(struct.pack("!B", self.value)) |
| 4356 | packed.append(struct.pack("!B", self.value_mask)) |
| 4357 | return ''.join(packed) |
| 4358 | |
| 4359 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4360 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4361 | obj = mpls_tc_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4362 | _type_len = reader.read("!L")[0] |
| 4363 | assert(_type_len == 2147501826) |
| 4364 | obj.value = reader.read("!B")[0] |
| 4365 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4366 | return obj |
| 4367 | |
| 4368 | def __eq__(self, other): |
| 4369 | if type(self) != type(other): return False |
| 4370 | if self.value != other.value: return False |
| 4371 | if self.value_mask != other.value_mask: return False |
| 4372 | return True |
| 4373 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4374 | def pretty_print(self, q): |
| 4375 | q.text("mpls_tc_masked {") |
| 4376 | with q.group(): |
| 4377 | with q.indent(2): |
| 4378 | q.breakable() |
| 4379 | q.text("value = "); |
| 4380 | q.text("%#x" % self.value) |
| 4381 | q.text(","); q.breakable() |
| 4382 | q.text("value_mask = "); |
| 4383 | q.text("%#x" % self.value_mask) |
| 4384 | q.breakable() |
| 4385 | q.text('}') |
| 4386 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4387 | oxm.subtypes[2147501826] = mpls_tc_masked |
| 4388 | |
| 4389 | class sctp_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4390 | type_len = 2147492866 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4391 | |
| 4392 | def __init__(self, value=None): |
| 4393 | if value != None: |
| 4394 | self.value = value |
| 4395 | else: |
| 4396 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4397 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4398 | |
| 4399 | def pack(self): |
| 4400 | packed = [] |
| 4401 | packed.append(struct.pack("!L", self.type_len)) |
| 4402 | packed.append(struct.pack("!H", self.value)) |
| 4403 | return ''.join(packed) |
| 4404 | |
| 4405 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4406 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4407 | obj = sctp_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4408 | _type_len = reader.read("!L")[0] |
| 4409 | assert(_type_len == 2147492866) |
| 4410 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4411 | return obj |
| 4412 | |
| 4413 | def __eq__(self, other): |
| 4414 | if type(self) != type(other): return False |
| 4415 | if self.value != other.value: return False |
| 4416 | return True |
| 4417 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4418 | def pretty_print(self, q): |
| 4419 | q.text("sctp_dst {") |
| 4420 | with q.group(): |
| 4421 | with q.indent(2): |
| 4422 | q.breakable() |
| 4423 | q.text("value = "); |
| 4424 | q.text("%#x" % self.value) |
| 4425 | q.breakable() |
| 4426 | q.text('}') |
| 4427 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4428 | oxm.subtypes[2147492866] = sctp_dst |
| 4429 | |
| 4430 | class sctp_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4431 | type_len = 2147493124 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4432 | |
| 4433 | def __init__(self, value=None, value_mask=None): |
| 4434 | if value != None: |
| 4435 | self.value = value |
| 4436 | else: |
| 4437 | self.value = 0 |
| 4438 | if value_mask != None: |
| 4439 | self.value_mask = value_mask |
| 4440 | else: |
| 4441 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4442 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4443 | |
| 4444 | def pack(self): |
| 4445 | packed = [] |
| 4446 | packed.append(struct.pack("!L", self.type_len)) |
| 4447 | packed.append(struct.pack("!H", self.value)) |
| 4448 | packed.append(struct.pack("!H", self.value_mask)) |
| 4449 | return ''.join(packed) |
| 4450 | |
| 4451 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4452 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4453 | obj = sctp_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4454 | _type_len = reader.read("!L")[0] |
| 4455 | assert(_type_len == 2147493124) |
| 4456 | obj.value = reader.read("!H")[0] |
| 4457 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4458 | return obj |
| 4459 | |
| 4460 | def __eq__(self, other): |
| 4461 | if type(self) != type(other): return False |
| 4462 | if self.value != other.value: return False |
| 4463 | if self.value_mask != other.value_mask: return False |
| 4464 | return True |
| 4465 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4466 | def pretty_print(self, q): |
| 4467 | q.text("sctp_dst_masked {") |
| 4468 | with q.group(): |
| 4469 | with q.indent(2): |
| 4470 | q.breakable() |
| 4471 | q.text("value = "); |
| 4472 | q.text("%#x" % self.value) |
| 4473 | q.text(","); q.breakable() |
| 4474 | q.text("value_mask = "); |
| 4475 | q.text("%#x" % self.value_mask) |
| 4476 | q.breakable() |
| 4477 | q.text('}') |
| 4478 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4479 | oxm.subtypes[2147493124] = sctp_dst_masked |
| 4480 | |
| 4481 | class sctp_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4482 | type_len = 2147492354 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4483 | |
| 4484 | def __init__(self, value=None): |
| 4485 | if value != None: |
| 4486 | self.value = value |
| 4487 | else: |
| 4488 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4489 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4490 | |
| 4491 | def pack(self): |
| 4492 | packed = [] |
| 4493 | packed.append(struct.pack("!L", self.type_len)) |
| 4494 | packed.append(struct.pack("!H", self.value)) |
| 4495 | return ''.join(packed) |
| 4496 | |
| 4497 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4498 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4499 | obj = sctp_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4500 | _type_len = reader.read("!L")[0] |
| 4501 | assert(_type_len == 2147492354) |
| 4502 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4503 | return obj |
| 4504 | |
| 4505 | def __eq__(self, other): |
| 4506 | if type(self) != type(other): return False |
| 4507 | if self.value != other.value: return False |
| 4508 | return True |
| 4509 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4510 | def pretty_print(self, q): |
| 4511 | q.text("sctp_src {") |
| 4512 | with q.group(): |
| 4513 | with q.indent(2): |
| 4514 | q.breakable() |
| 4515 | q.text("value = "); |
| 4516 | q.text("%#x" % self.value) |
| 4517 | q.breakable() |
| 4518 | q.text('}') |
| 4519 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4520 | oxm.subtypes[2147492354] = sctp_src |
| 4521 | |
| 4522 | class sctp_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4523 | type_len = 2147492612 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4524 | |
| 4525 | def __init__(self, value=None, value_mask=None): |
| 4526 | if value != None: |
| 4527 | self.value = value |
| 4528 | else: |
| 4529 | self.value = 0 |
| 4530 | if value_mask != None: |
| 4531 | self.value_mask = value_mask |
| 4532 | else: |
| 4533 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4534 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4535 | |
| 4536 | def pack(self): |
| 4537 | packed = [] |
| 4538 | packed.append(struct.pack("!L", self.type_len)) |
| 4539 | packed.append(struct.pack("!H", self.value)) |
| 4540 | packed.append(struct.pack("!H", self.value_mask)) |
| 4541 | return ''.join(packed) |
| 4542 | |
| 4543 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4544 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4545 | obj = sctp_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4546 | _type_len = reader.read("!L")[0] |
| 4547 | assert(_type_len == 2147492612) |
| 4548 | obj.value = reader.read("!H")[0] |
| 4549 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4550 | return obj |
| 4551 | |
| 4552 | def __eq__(self, other): |
| 4553 | if type(self) != type(other): return False |
| 4554 | if self.value != other.value: return False |
| 4555 | if self.value_mask != other.value_mask: return False |
| 4556 | return True |
| 4557 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4558 | def pretty_print(self, q): |
| 4559 | q.text("sctp_src_masked {") |
| 4560 | with q.group(): |
| 4561 | with q.indent(2): |
| 4562 | q.breakable() |
| 4563 | q.text("value = "); |
| 4564 | q.text("%#x" % self.value) |
| 4565 | q.text(","); q.breakable() |
| 4566 | q.text("value_mask = "); |
| 4567 | q.text("%#x" % self.value_mask) |
| 4568 | q.breakable() |
| 4569 | q.text('}') |
| 4570 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4571 | oxm.subtypes[2147492612] = sctp_src_masked |
| 4572 | |
| 4573 | class tcp_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4574 | type_len = 2147490818 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4575 | |
| 4576 | def __init__(self, value=None): |
| 4577 | if value != None: |
| 4578 | self.value = value |
| 4579 | else: |
| 4580 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4581 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4582 | |
| 4583 | def pack(self): |
| 4584 | packed = [] |
| 4585 | packed.append(struct.pack("!L", self.type_len)) |
| 4586 | packed.append(struct.pack("!H", self.value)) |
| 4587 | return ''.join(packed) |
| 4588 | |
| 4589 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4590 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4591 | obj = tcp_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4592 | _type_len = reader.read("!L")[0] |
| 4593 | assert(_type_len == 2147490818) |
| 4594 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4595 | return obj |
| 4596 | |
| 4597 | def __eq__(self, other): |
| 4598 | if type(self) != type(other): return False |
| 4599 | if self.value != other.value: return False |
| 4600 | return True |
| 4601 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4602 | def pretty_print(self, q): |
| 4603 | q.text("tcp_dst {") |
| 4604 | with q.group(): |
| 4605 | with q.indent(2): |
| 4606 | q.breakable() |
| 4607 | q.text("value = "); |
| 4608 | q.text("%#x" % self.value) |
| 4609 | q.breakable() |
| 4610 | q.text('}') |
| 4611 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4612 | oxm.subtypes[2147490818] = tcp_dst |
| 4613 | |
| 4614 | class tcp_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4615 | type_len = 2147491076 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4616 | |
| 4617 | def __init__(self, value=None, value_mask=None): |
| 4618 | if value != None: |
| 4619 | self.value = value |
| 4620 | else: |
| 4621 | self.value = 0 |
| 4622 | if value_mask != None: |
| 4623 | self.value_mask = value_mask |
| 4624 | else: |
| 4625 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4626 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4627 | |
| 4628 | def pack(self): |
| 4629 | packed = [] |
| 4630 | packed.append(struct.pack("!L", self.type_len)) |
| 4631 | packed.append(struct.pack("!H", self.value)) |
| 4632 | packed.append(struct.pack("!H", self.value_mask)) |
| 4633 | return ''.join(packed) |
| 4634 | |
| 4635 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4636 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4637 | obj = tcp_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4638 | _type_len = reader.read("!L")[0] |
| 4639 | assert(_type_len == 2147491076) |
| 4640 | obj.value = reader.read("!H")[0] |
| 4641 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4642 | return obj |
| 4643 | |
| 4644 | def __eq__(self, other): |
| 4645 | if type(self) != type(other): return False |
| 4646 | if self.value != other.value: return False |
| 4647 | if self.value_mask != other.value_mask: return False |
| 4648 | return True |
| 4649 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4650 | def pretty_print(self, q): |
| 4651 | q.text("tcp_dst_masked {") |
| 4652 | with q.group(): |
| 4653 | with q.indent(2): |
| 4654 | q.breakable() |
| 4655 | q.text("value = "); |
| 4656 | q.text("%#x" % self.value) |
| 4657 | q.text(","); q.breakable() |
| 4658 | q.text("value_mask = "); |
| 4659 | q.text("%#x" % self.value_mask) |
| 4660 | q.breakable() |
| 4661 | q.text('}') |
| 4662 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4663 | oxm.subtypes[2147491076] = tcp_dst_masked |
| 4664 | |
| 4665 | class tcp_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4666 | type_len = 2147490306 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4667 | |
| 4668 | def __init__(self, value=None): |
| 4669 | if value != None: |
| 4670 | self.value = value |
| 4671 | else: |
| 4672 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4673 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4674 | |
| 4675 | def pack(self): |
| 4676 | packed = [] |
| 4677 | packed.append(struct.pack("!L", self.type_len)) |
| 4678 | packed.append(struct.pack("!H", self.value)) |
| 4679 | return ''.join(packed) |
| 4680 | |
| 4681 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4682 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4683 | obj = tcp_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4684 | _type_len = reader.read("!L")[0] |
| 4685 | assert(_type_len == 2147490306) |
| 4686 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4687 | return obj |
| 4688 | |
| 4689 | def __eq__(self, other): |
| 4690 | if type(self) != type(other): return False |
| 4691 | if self.value != other.value: return False |
| 4692 | return True |
| 4693 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4694 | def pretty_print(self, q): |
| 4695 | q.text("tcp_src {") |
| 4696 | with q.group(): |
| 4697 | with q.indent(2): |
| 4698 | q.breakable() |
| 4699 | q.text("value = "); |
| 4700 | q.text("%#x" % self.value) |
| 4701 | q.breakable() |
| 4702 | q.text('}') |
| 4703 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4704 | oxm.subtypes[2147490306] = tcp_src |
| 4705 | |
| 4706 | class tcp_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4707 | type_len = 2147490564 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4708 | |
| 4709 | def __init__(self, value=None, value_mask=None): |
| 4710 | if value != None: |
| 4711 | self.value = value |
| 4712 | else: |
| 4713 | self.value = 0 |
| 4714 | if value_mask != None: |
| 4715 | self.value_mask = value_mask |
| 4716 | else: |
| 4717 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4718 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4719 | |
| 4720 | def pack(self): |
| 4721 | packed = [] |
| 4722 | packed.append(struct.pack("!L", self.type_len)) |
| 4723 | packed.append(struct.pack("!H", self.value)) |
| 4724 | packed.append(struct.pack("!H", self.value_mask)) |
| 4725 | return ''.join(packed) |
| 4726 | |
| 4727 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4728 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4729 | obj = tcp_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4730 | _type_len = reader.read("!L")[0] |
| 4731 | assert(_type_len == 2147490564) |
| 4732 | obj.value = reader.read("!H")[0] |
| 4733 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4734 | return obj |
| 4735 | |
| 4736 | def __eq__(self, other): |
| 4737 | if type(self) != type(other): return False |
| 4738 | if self.value != other.value: return False |
| 4739 | if self.value_mask != other.value_mask: return False |
| 4740 | return True |
| 4741 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4742 | def pretty_print(self, q): |
| 4743 | q.text("tcp_src_masked {") |
| 4744 | with q.group(): |
| 4745 | with q.indent(2): |
| 4746 | q.breakable() |
| 4747 | q.text("value = "); |
| 4748 | q.text("%#x" % self.value) |
| 4749 | q.text(","); q.breakable() |
| 4750 | q.text("value_mask = "); |
| 4751 | q.text("%#x" % self.value_mask) |
| 4752 | q.breakable() |
| 4753 | q.text('}') |
| 4754 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4755 | oxm.subtypes[2147490564] = tcp_src_masked |
| 4756 | |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 4757 | class tunnel_id(oxm): |
| 4758 | type_len = 2147503112 |
| 4759 | |
| 4760 | def __init__(self, value=None): |
| 4761 | if value != None: |
| 4762 | self.value = value |
| 4763 | else: |
| 4764 | self.value = 0 |
| 4765 | return |
| 4766 | |
| 4767 | def pack(self): |
| 4768 | packed = [] |
| 4769 | packed.append(struct.pack("!L", self.type_len)) |
| 4770 | packed.append(struct.pack("!Q", self.value)) |
| 4771 | return ''.join(packed) |
| 4772 | |
| 4773 | @staticmethod |
| 4774 | def unpack(reader): |
| 4775 | obj = tunnel_id() |
| 4776 | _type_len = reader.read("!L")[0] |
| 4777 | assert(_type_len == 2147503112) |
| 4778 | obj.value = reader.read("!Q")[0] |
| 4779 | return obj |
| 4780 | |
| 4781 | def __eq__(self, other): |
| 4782 | if type(self) != type(other): return False |
| 4783 | if self.value != other.value: return False |
| 4784 | return True |
| 4785 | |
| 4786 | def pretty_print(self, q): |
| 4787 | q.text("tunnel_id {") |
| 4788 | with q.group(): |
| 4789 | with q.indent(2): |
| 4790 | q.breakable() |
| 4791 | q.text("value = "); |
| 4792 | q.text("%#x" % self.value) |
| 4793 | q.breakable() |
| 4794 | q.text('}') |
| 4795 | |
| 4796 | oxm.subtypes[2147503112] = tunnel_id |
| 4797 | |
| 4798 | class tunnel_id_masked(oxm): |
| 4799 | type_len = 2147503376 |
| 4800 | |
| 4801 | def __init__(self, value=None, value_mask=None): |
| 4802 | if value != None: |
| 4803 | self.value = value |
| 4804 | else: |
| 4805 | self.value = 0 |
| 4806 | if value_mask != None: |
| 4807 | self.value_mask = value_mask |
| 4808 | else: |
| 4809 | self.value_mask = 0 |
| 4810 | return |
| 4811 | |
| 4812 | def pack(self): |
| 4813 | packed = [] |
| 4814 | packed.append(struct.pack("!L", self.type_len)) |
| 4815 | packed.append(struct.pack("!Q", self.value)) |
| 4816 | packed.append(struct.pack("!Q", self.value_mask)) |
| 4817 | return ''.join(packed) |
| 4818 | |
| 4819 | @staticmethod |
| 4820 | def unpack(reader): |
| 4821 | obj = tunnel_id_masked() |
| 4822 | _type_len = reader.read("!L")[0] |
| 4823 | assert(_type_len == 2147503376) |
| 4824 | obj.value = reader.read("!Q")[0] |
| 4825 | obj.value_mask = reader.read("!Q")[0] |
| 4826 | return obj |
| 4827 | |
| 4828 | def __eq__(self, other): |
| 4829 | if type(self) != type(other): return False |
| 4830 | if self.value != other.value: return False |
| 4831 | if self.value_mask != other.value_mask: return False |
| 4832 | return True |
| 4833 | |
| 4834 | def pretty_print(self, q): |
| 4835 | q.text("tunnel_id_masked {") |
| 4836 | with q.group(): |
| 4837 | with q.indent(2): |
| 4838 | q.breakable() |
| 4839 | q.text("value = "); |
| 4840 | q.text("%#x" % self.value) |
| 4841 | q.text(","); q.breakable() |
| 4842 | q.text("value_mask = "); |
| 4843 | q.text("%#x" % self.value_mask) |
| 4844 | q.breakable() |
| 4845 | q.text('}') |
| 4846 | |
| 4847 | oxm.subtypes[2147503376] = tunnel_id_masked |
| 4848 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4849 | class udp_dst(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4850 | type_len = 2147491842 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4851 | |
| 4852 | def __init__(self, value=None): |
| 4853 | if value != None: |
| 4854 | self.value = value |
| 4855 | else: |
| 4856 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4857 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4858 | |
| 4859 | def pack(self): |
| 4860 | packed = [] |
| 4861 | packed.append(struct.pack("!L", self.type_len)) |
| 4862 | packed.append(struct.pack("!H", self.value)) |
| 4863 | return ''.join(packed) |
| 4864 | |
| 4865 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4866 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4867 | obj = udp_dst() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4868 | _type_len = reader.read("!L")[0] |
| 4869 | assert(_type_len == 2147491842) |
| 4870 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4871 | return obj |
| 4872 | |
| 4873 | def __eq__(self, other): |
| 4874 | if type(self) != type(other): return False |
| 4875 | if self.value != other.value: return False |
| 4876 | return True |
| 4877 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4878 | def pretty_print(self, q): |
| 4879 | q.text("udp_dst {") |
| 4880 | with q.group(): |
| 4881 | with q.indent(2): |
| 4882 | q.breakable() |
| 4883 | q.text("value = "); |
| 4884 | q.text("%#x" % self.value) |
| 4885 | q.breakable() |
| 4886 | q.text('}') |
| 4887 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4888 | oxm.subtypes[2147491842] = udp_dst |
| 4889 | |
| 4890 | class udp_dst_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4891 | type_len = 2147492100 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4892 | |
| 4893 | def __init__(self, value=None, value_mask=None): |
| 4894 | if value != None: |
| 4895 | self.value = value |
| 4896 | else: |
| 4897 | self.value = 0 |
| 4898 | if value_mask != None: |
| 4899 | self.value_mask = value_mask |
| 4900 | else: |
| 4901 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4902 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4903 | |
| 4904 | def pack(self): |
| 4905 | packed = [] |
| 4906 | packed.append(struct.pack("!L", self.type_len)) |
| 4907 | packed.append(struct.pack("!H", self.value)) |
| 4908 | packed.append(struct.pack("!H", self.value_mask)) |
| 4909 | return ''.join(packed) |
| 4910 | |
| 4911 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4912 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4913 | obj = udp_dst_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4914 | _type_len = reader.read("!L")[0] |
| 4915 | assert(_type_len == 2147492100) |
| 4916 | obj.value = reader.read("!H")[0] |
| 4917 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4918 | return obj |
| 4919 | |
| 4920 | def __eq__(self, other): |
| 4921 | if type(self) != type(other): return False |
| 4922 | if self.value != other.value: return False |
| 4923 | if self.value_mask != other.value_mask: return False |
| 4924 | return True |
| 4925 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4926 | def pretty_print(self, q): |
| 4927 | q.text("udp_dst_masked {") |
| 4928 | with q.group(): |
| 4929 | with q.indent(2): |
| 4930 | q.breakable() |
| 4931 | q.text("value = "); |
| 4932 | q.text("%#x" % self.value) |
| 4933 | q.text(","); q.breakable() |
| 4934 | q.text("value_mask = "); |
| 4935 | q.text("%#x" % self.value_mask) |
| 4936 | q.breakable() |
| 4937 | q.text('}') |
| 4938 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4939 | oxm.subtypes[2147492100] = udp_dst_masked |
| 4940 | |
| 4941 | class udp_src(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4942 | type_len = 2147491330 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4943 | |
| 4944 | def __init__(self, value=None): |
| 4945 | if value != None: |
| 4946 | self.value = value |
| 4947 | else: |
| 4948 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4949 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4950 | |
| 4951 | def pack(self): |
| 4952 | packed = [] |
| 4953 | packed.append(struct.pack("!L", self.type_len)) |
| 4954 | packed.append(struct.pack("!H", self.value)) |
| 4955 | return ''.join(packed) |
| 4956 | |
| 4957 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4958 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4959 | obj = udp_src() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4960 | _type_len = reader.read("!L")[0] |
| 4961 | assert(_type_len == 2147491330) |
| 4962 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4963 | return obj |
| 4964 | |
| 4965 | def __eq__(self, other): |
| 4966 | if type(self) != type(other): return False |
| 4967 | if self.value != other.value: return False |
| 4968 | return True |
| 4969 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4970 | def pretty_print(self, q): |
| 4971 | q.text("udp_src {") |
| 4972 | with q.group(): |
| 4973 | with q.indent(2): |
| 4974 | q.breakable() |
| 4975 | q.text("value = "); |
| 4976 | q.text("%#x" % self.value) |
| 4977 | q.breakable() |
| 4978 | q.text('}') |
| 4979 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4980 | oxm.subtypes[2147491330] = udp_src |
| 4981 | |
| 4982 | class udp_src_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4983 | type_len = 2147491588 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4984 | |
| 4985 | def __init__(self, value=None, value_mask=None): |
| 4986 | if value != None: |
| 4987 | self.value = value |
| 4988 | else: |
| 4989 | self.value = 0 |
| 4990 | if value_mask != None: |
| 4991 | self.value_mask = value_mask |
| 4992 | else: |
| 4993 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4994 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4995 | |
| 4996 | def pack(self): |
| 4997 | packed = [] |
| 4998 | packed.append(struct.pack("!L", self.type_len)) |
| 4999 | packed.append(struct.pack("!H", self.value)) |
| 5000 | packed.append(struct.pack("!H", self.value_mask)) |
| 5001 | return ''.join(packed) |
| 5002 | |
| 5003 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5004 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5005 | obj = udp_src_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 5006 | _type_len = reader.read("!L")[0] |
| 5007 | assert(_type_len == 2147491588) |
| 5008 | obj.value = reader.read("!H")[0] |
| 5009 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5010 | return obj |
| 5011 | |
| 5012 | def __eq__(self, other): |
| 5013 | if type(self) != type(other): return False |
| 5014 | if self.value != other.value: return False |
| 5015 | if self.value_mask != other.value_mask: return False |
| 5016 | return True |
| 5017 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5018 | def pretty_print(self, q): |
| 5019 | q.text("udp_src_masked {") |
| 5020 | with q.group(): |
| 5021 | with q.indent(2): |
| 5022 | q.breakable() |
| 5023 | q.text("value = "); |
| 5024 | q.text("%#x" % self.value) |
| 5025 | q.text(","); q.breakable() |
| 5026 | q.text("value_mask = "); |
| 5027 | q.text("%#x" % self.value_mask) |
| 5028 | q.breakable() |
| 5029 | q.text('}') |
| 5030 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5031 | oxm.subtypes[2147491588] = udp_src_masked |
| 5032 | |
| 5033 | class vlan_pcp(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 5034 | type_len = 2147487233 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5035 | |
| 5036 | def __init__(self, value=None): |
| 5037 | if value != None: |
| 5038 | self.value = value |
| 5039 | else: |
| 5040 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5041 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5042 | |
| 5043 | def pack(self): |
| 5044 | packed = [] |
| 5045 | packed.append(struct.pack("!L", self.type_len)) |
| 5046 | packed.append(struct.pack("!B", self.value)) |
| 5047 | return ''.join(packed) |
| 5048 | |
| 5049 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5050 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5051 | obj = vlan_pcp() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 5052 | _type_len = reader.read("!L")[0] |
| 5053 | assert(_type_len == 2147487233) |
| 5054 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5055 | return obj |
| 5056 | |
| 5057 | def __eq__(self, other): |
| 5058 | if type(self) != type(other): return False |
| 5059 | if self.value != other.value: return False |
| 5060 | return True |
| 5061 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5062 | def pretty_print(self, q): |
| 5063 | q.text("vlan_pcp {") |
| 5064 | with q.group(): |
| 5065 | with q.indent(2): |
| 5066 | q.breakable() |
| 5067 | q.text("value = "); |
| 5068 | q.text("%#x" % self.value) |
| 5069 | q.breakable() |
| 5070 | q.text('}') |
| 5071 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5072 | oxm.subtypes[2147487233] = vlan_pcp |
| 5073 | |
| 5074 | class vlan_pcp_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 5075 | type_len = 2147487490 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5076 | |
| 5077 | def __init__(self, value=None, value_mask=None): |
| 5078 | if value != None: |
| 5079 | self.value = value |
| 5080 | else: |
| 5081 | self.value = 0 |
| 5082 | if value_mask != None: |
| 5083 | self.value_mask = value_mask |
| 5084 | else: |
| 5085 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5086 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5087 | |
| 5088 | def pack(self): |
| 5089 | packed = [] |
| 5090 | packed.append(struct.pack("!L", self.type_len)) |
| 5091 | packed.append(struct.pack("!B", self.value)) |
| 5092 | packed.append(struct.pack("!B", self.value_mask)) |
| 5093 | return ''.join(packed) |
| 5094 | |
| 5095 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5096 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5097 | obj = vlan_pcp_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 5098 | _type_len = reader.read("!L")[0] |
| 5099 | assert(_type_len == 2147487490) |
| 5100 | obj.value = reader.read("!B")[0] |
| 5101 | obj.value_mask = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5102 | return obj |
| 5103 | |
| 5104 | def __eq__(self, other): |
| 5105 | if type(self) != type(other): return False |
| 5106 | if self.value != other.value: return False |
| 5107 | if self.value_mask != other.value_mask: return False |
| 5108 | return True |
| 5109 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5110 | def pretty_print(self, q): |
| 5111 | q.text("vlan_pcp_masked {") |
| 5112 | with q.group(): |
| 5113 | with q.indent(2): |
| 5114 | q.breakable() |
| 5115 | q.text("value = "); |
| 5116 | q.text("%#x" % self.value) |
| 5117 | q.text(","); q.breakable() |
| 5118 | q.text("value_mask = "); |
| 5119 | q.text("%#x" % self.value_mask) |
| 5120 | q.breakable() |
| 5121 | q.text('}') |
| 5122 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5123 | oxm.subtypes[2147487490] = vlan_pcp_masked |
| 5124 | |
| 5125 | class vlan_vid(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 5126 | type_len = 2147486722 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5127 | |
| 5128 | def __init__(self, value=None): |
| 5129 | if value != None: |
| 5130 | self.value = value |
| 5131 | else: |
| 5132 | self.value = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5133 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5134 | |
| 5135 | def pack(self): |
| 5136 | packed = [] |
| 5137 | packed.append(struct.pack("!L", self.type_len)) |
| 5138 | packed.append(struct.pack("!H", self.value)) |
| 5139 | return ''.join(packed) |
| 5140 | |
| 5141 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5142 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5143 | obj = vlan_vid() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 5144 | _type_len = reader.read("!L")[0] |
| 5145 | assert(_type_len == 2147486722) |
| 5146 | obj.value = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5147 | return obj |
| 5148 | |
| 5149 | def __eq__(self, other): |
| 5150 | if type(self) != type(other): return False |
| 5151 | if self.value != other.value: return False |
| 5152 | return True |
| 5153 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5154 | def pretty_print(self, q): |
| 5155 | q.text("vlan_vid {") |
| 5156 | with q.group(): |
| 5157 | with q.indent(2): |
| 5158 | q.breakable() |
| 5159 | q.text("value = "); |
| 5160 | q.text("%#x" % self.value) |
| 5161 | q.breakable() |
| 5162 | q.text('}') |
| 5163 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5164 | oxm.subtypes[2147486722] = vlan_vid |
| 5165 | |
| 5166 | class vlan_vid_masked(oxm): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 5167 | type_len = 2147486980 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5168 | |
| 5169 | def __init__(self, value=None, value_mask=None): |
| 5170 | if value != None: |
| 5171 | self.value = value |
| 5172 | else: |
| 5173 | self.value = 0 |
| 5174 | if value_mask != None: |
| 5175 | self.value_mask = value_mask |
| 5176 | else: |
| 5177 | self.value_mask = 0 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5178 | return |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5179 | |
| 5180 | def pack(self): |
| 5181 | packed = [] |
| 5182 | packed.append(struct.pack("!L", self.type_len)) |
| 5183 | packed.append(struct.pack("!H", self.value)) |
| 5184 | packed.append(struct.pack("!H", self.value_mask)) |
| 5185 | return ''.join(packed) |
| 5186 | |
| 5187 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5188 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5189 | obj = vlan_vid_masked() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 5190 | _type_len = reader.read("!L")[0] |
| 5191 | assert(_type_len == 2147486980) |
| 5192 | obj.value = reader.read("!H")[0] |
| 5193 | obj.value_mask = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5194 | return obj |
| 5195 | |
| 5196 | def __eq__(self, other): |
| 5197 | if type(self) != type(other): return False |
| 5198 | if self.value != other.value: return False |
| 5199 | if self.value_mask != other.value_mask: return False |
| 5200 | return True |
| 5201 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5202 | def pretty_print(self, q): |
| 5203 | q.text("vlan_vid_masked {") |
| 5204 | with q.group(): |
| 5205 | with q.indent(2): |
| 5206 | q.breakable() |
| 5207 | q.text("value = "); |
| 5208 | q.text("%#x" % self.value) |
| 5209 | q.text(","); q.breakable() |
| 5210 | q.text("value_mask = "); |
| 5211 | q.text("%#x" % self.value_mask) |
| 5212 | q.breakable() |
| 5213 | q.text('}') |
| 5214 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5215 | oxm.subtypes[2147486980] = vlan_vid_masked |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 5216 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5217 | |