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