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