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