|
|
@ -294,12 +294,12 @@ def test_inet_conv(): |
|
|
|
|
|
|
|
def test_parse_header(): |
|
|
|
assert parse_header(b'\x03\x0ewww.google.com\x00\x50') == \ |
|
|
|
(3, b'www.google.com', 80, 18) |
|
|
|
(0, b'www.google.com', 80, 18) |
|
|
|
assert parse_header(b'\x01\x08\x08\x08\x08\x00\x35') == \ |
|
|
|
(1, b'8.8.8.8', 53, 7) |
|
|
|
(0, b'8.8.8.8', 53, 7) |
|
|
|
assert parse_header((b'\x04$\x04h\x00@\x05\x08\x05\x00\x00\x00\x00\x00' |
|
|
|
b'\x00\x10\x11\x00\x50')) == \ |
|
|
|
(4, b'2404:6800:4005:805::1011', 80, 19) |
|
|
|
(0, b'2404:6800:4005:805::1011', 80, 19) |
|
|
|
|
|
|
|
|
|
|
|
def test_pack_header(): |
|
|
|