Initial commit: mwhois with SCION AS support and decimal AS conversion

Based on mwhois by Antonios A. Chariton
Modifications for SCION AS support by Olaf Baumert, Axpo Systems AG
This commit is contained in:
Olaf Baumert
2025-06-03 11:01:02 +00:00
commit 34c631a06d
340 changed files with 212460 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
=Socket Fallback Module Tests=
Copyright (c) 2008-2015, David P. D. Moss. All rights reserved.
{{{
>>> from netaddr.fbsocket import *
}}}
IPv6 '::' compression algorithm tests.
{{{
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:0:0:0:0:0:0:0'))
'::'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:0:0:0:0:0:0:A'))
'::a'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:0:0:0:0:0:0'))
'a::'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:A:0:0:0:0:0'))
'a:0:a::'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:0:0:0:0:0:A'))
'a::a'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:A:0:0:0:0:0:A'))
'0:a::a'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:A:0:0:0:0:A'))
'a:0:a::a'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:0:0:A:0:0:0:A'))
'::a:0:0:0:a'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:0:0:0:A:0:0:A'))
'::a:0:0:a'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:0:0:0:A:0:A'))
'a::a:0:a'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:0:A:0:0:A:0'))
'a::a:0:0:a:0'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'A:0:A:0:A:0:A:0'))
'a:0:a:0:a:0:a:0'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '0:A:0:A:0:A:0:A'))
'0:a:0:a:0:a:0:a'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, '1080:0:0:0:8:800:200C:417A'))
'1080::8:800:200c:417a'
>>> inet_ntop(AF_INET6, inet_pton(AF_INET6, 'FEDC:BA98:7654:3210:FEDC:BA98:7654:3210'))
'fedc:ba98:7654:3210:fedc:ba98:7654:3210'
}}}
IPv4 failure tests
{{{
>>> inet_ntoa(1)
Traceback (most recent call last):
...
TypeError: string type expected, not <type 'int'>
>>> inet_ntoa('\x00')
Traceback (most recent call last):
...
ValueError: invalid length of packed IP address string
}}}
IPv6 failure tests.
{{{
>>> inet_pton(AF_INET6, '::0x07f')
Traceback (most recent call last):
...
ValueError: illegal IP address string '::0x07f'
}}}