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