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