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