IPv6 Header

[1]:
from byteclasses.handlers.network.ipv6_hdr import IPv6Hdr
from byteclasses.print import byteclass_inspect, collection_table, byteclass_info
[2]:
ipv6_hdr = IPv6Hdr()
data = bytearray(b"\x60\x00\x00\x00\x00\x18\x06\x80\x20\x02\x51\x83\x43\x83\x00\x00\x00\x00\x00\x00\x51\x83\x43\x83\x20\x01\x06\x38\x09\x02\x00\x01\x02\x01\x02\xff\xfe\xe2\x75\x96")
ipv6_hdr.attach(memoryview(data))
[3]:
byteclass_info(ipv6_hdr)
                                                  Byteclass Info                                                   
┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Property  Value                                                                                                ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ type()    IPv6Hdr                                                                                              │
│ mro       IPv6Hdr -> object                                                                                    │
│ len()     40                                                                                                   │
│ str()     IPv6Hdr(vtf=VTF(data=b'`\x00\x00\x00'), payload_length=UInt16(24), next_hdr=UInt8(6),                │
│           hop_limit=UInt8(128), src_addr=IPv6Addr(uint8=[UInt8(32), UInt8(2), UInt8(81), UInt8(131),           │
│           UInt8(67), UInt8(131), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(81),        │
│           UInt8(131), UInt8(67), UInt8(131)], uint32=[UInt32(537022851), UInt32(1132658688), UInt32(0),        │
│           UInt32(1367556995)], uint64=[UInt64(2306495583382339584), UInt64(1367556995)]),                      │
│           dst_addr=IPv6Addr(uint8=[UInt8(32), UInt8(1), UInt8(6), UInt8(56), UInt8(9), UInt8(2), UInt8(0),     │
│           UInt8(1), UInt8(2), UInt8(1), UInt8(2), UInt8(255), UInt8(254), UInt8(226), UInt8(117), UInt8(150)], │
│           uint32=[UInt32(536938040), UInt32(151126017), UInt32(33620735), UInt32(4276254102)],                 │
│           uint64=[UInt64(2306131321929465857), UInt64(144399961568736662)]))                                   │
│ repr()    IPv6Hdr(vtf=VTF(data=b'`\x00\x00\x00'), payload_length=UInt16(24), next_hdr=UInt8(6),                │
│           hop_limit=UInt8(128), src_addr=IPv6Addr(uint8=[UInt8(32), UInt8(2), UInt8(81), UInt8(131),           │
│           UInt8(67), UInt8(131), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(81),        │
│           UInt8(131), UInt8(67), UInt8(131)], uint32=[UInt32(537022851), UInt32(1132658688), UInt32(0),        │
│           UInt32(1367556995)], uint64=[UInt64(2306495583382339584), UInt64(1367556995)]),                      │
│           dst_addr=IPv6Addr(uint8=[UInt8(32), UInt8(1), UInt8(6), UInt8(56), UInt8(9), UInt8(2), UInt8(0),     │
│           UInt8(1), UInt8(2), UInt8(1), UInt8(2), UInt8(255), UInt8(254), UInt8(226), UInt8(117), UInt8(150)], │
│           uint32=[UInt32(536938040), UInt32(151126017), UInt32(33620735), UInt32(4276254102)],                 │
│           uint64=[UInt64(2306131321929465857), UInt64(144399961568736662)]))                                   │
│ .data     bytearray(b'`\x00\x00\x00\x00\x18\x06\x80 \x02Q\x83C\x83\x00\x00\x00\x00\x00\x00Q\x83C\x83           │
│           \x01\x068\t\x02\x00\x01\x02\x01\x02\xff\xfe\xe2u\x96')                                               │
└──────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────┘
[5]:
byteclass_inspect(ipv6_hdr)
╭────────────────────────────────────────── Byteclass Inspect ──────────────────────────────────────────╮
│      00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f  │
│ ----------------------------------------------------------------------------------------------------  │
│ 0x0  60 00 00 0000 18068020 02 51 83 43 83 00 00 00 00 00 00 51 83 43 8320 01 06 38 09 02 00 01 02 01 │
│ 0x20  02 ff fe e2 75 96                                                                               │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯
                                                      Legend                                                       
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Member          Value                                                                                          ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ vtf             VTF(00000110000000000000000000000000, flags={'version': 0, 'traffic_class': 6, 'flow_label':   │
│                 0})                                                                                            │
│ payload_length  24                                                                                             │
│ next_hdr        6                                                                                              │
│ hop_limit       128                                                                                            │
│ src_addr        IPv6Addr(uint8=[UInt8(32), UInt8(2), UInt8(81), UInt8(131), UInt8(67), UInt8(131), UInt8(0),   │
│                 UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(81), UInt8(131), UInt8(67),            │
│                 UInt8(131)], uint32=[UInt32(537022851), UInt32(1132658688), UInt32(0), UInt32(1367556995)],    │
│                 uint64=[UInt64(2306495583382339584), UInt64(1367556995)])                                      │
│ dst_addr        IPv6Addr(uint8=[UInt8(32), UInt8(1), UInt8(6), UInt8(56), UInt8(9), UInt8(2), UInt8(0),        │
│                 UInt8(1), UInt8(2), UInt8(1), UInt8(2), UInt8(255), UInt8(254), UInt8(226), UInt8(117),        │
│                 UInt8(150)], uint32=[UInt32(536938040), UInt32(151126017), UInt32(33620735),                   │
│                 UInt32(4276254102)], uint64=[UInt64(2306131321929465857), UInt64(144399961568736662)])         │
└────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┘
[6]:
collection_table(ipv6_hdr)
                                                      IPv6Hdr                                                      
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Member          Value                                          Data                                           ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ vtf             VTF(00000110000000000000000000000000,          b'`\x00\x00\x00'                               │
│                 flags={'version': 0, 'traffic_class': 6,                                                      │
│                 'flow_label': 0})                                                                             │
│ payload_length  24                                             b'\x00\x18'                                    │
│ next_hdr        6                                              b'\x06'                                        │
│ hop_limit       128                                            b'\x80'                                        │
│ src_addr        IPv6Addr(uint8=[UInt8(32), UInt8(2),           bytearray(b'                                   │
│                 UInt8(81), UInt8(131), UInt8(67), UInt8(131),  \x02Q\x83C\x83\x00\x00\x00\x00\x00\x00Q\x83C\… │
│                 UInt8(0), UInt8(0), UInt8(0), UInt8(0),                                                       │
│                 UInt8(0), UInt8(0), UInt8(81), UInt8(131),                                                    │
│                 UInt8(67), UInt8(131)],                                                                       │
│                 uint32=[UInt32(537022851),                                                                    │
│                 UInt32(1132658688), UInt32(0),                                                                │
│                 UInt32(1367556995)],                                                                          │
│                 uint64=[UInt64(2306495583382339584),                                                          │
│                 UInt64(1367556995)])                                                                          │
│ dst_addr        IPv6Addr(uint8=[UInt8(32), UInt8(1),           bytearray(b'                                   │
│                 UInt8(6), UInt8(56), UInt8(9), UInt8(2),       \x01\x068\t\x02\x00\x01\x02\x01\x02\xff\xfe\x… │
│                 UInt8(0), UInt8(1), UInt8(2), UInt8(1),                                                       │
│                 UInt8(2), UInt8(255), UInt8(254), UInt8(226),                                                 │
│                 UInt8(117), UInt8(150)],                                                                      │
│                 uint32=[UInt32(536938040), UInt32(151126017),                                                 │
│                 UInt32(33620735), UInt32(4276254102)],                                                        │
│                 uint64=[UInt64(2306131321929465857),                                                          │
│                 UInt64(144399961568736662)])                                                                  │
└────────────────┴───────────────────────────────────────────────┴────────────────────────────────────────────────┘