mirror of
https://git.photon.obnh.io/AXSY/whois.git
synced 2026-03-15 02:43:39 +00:00
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:
48
netaddr/tests/3.x/ip/functions.txt
Normal file
48
netaddr/tests/3.x/ip/functions.txt
Normal file
@@ -0,0 +1,48 @@
|
||||
=IP Function Tests=
|
||||
|
||||
Copyright (c) 2008-2015, David P. D. Moss. All rights reserved.
|
||||
|
||||
{{{
|
||||
|
||||
>>> from netaddr import *
|
||||
|
||||
}}}
|
||||
|
||||
During a cidr merge operation, the address 0.0.0.0/0, representing the whole of the IPv4 address space, should swallow anything it is merged with.
|
||||
|
||||
{{{
|
||||
|
||||
>>> cidr_merge(['0.0.0.0/0', '0.0.0.0'])
|
||||
[IPNetwork('0.0.0.0/0')]
|
||||
|
||||
>>> cidr_merge(['0.0.0.0/0', '255.255.255.255'])
|
||||
[IPNetwork('0.0.0.0/0')]
|
||||
|
||||
>>> cidr_merge(['0.0.0.0/0', '192.0.2.0/24', '10.0.0.0/8'])
|
||||
[IPNetwork('0.0.0.0/0')]
|
||||
|
||||
}}}
|
||||
|
||||
Same goes for the IPv6 CIDR ::/0, representing the whole of the IPv6 address space.
|
||||
|
||||
{{{
|
||||
|
||||
>>> cidr_merge(['::/0', 'fe80::1'])
|
||||
[IPNetwork('::/0')]
|
||||
|
||||
>>> cidr_merge(['::/0', '::'])
|
||||
[IPNetwork('::/0')]
|
||||
|
||||
>>> cidr_merge(['::/0', '::192.0.2.0/124', 'ff00::101'])
|
||||
[IPNetwork('::/0')]
|
||||
|
||||
}}}
|
||||
|
||||
This also applies to mixed IPv4 and IPv6 address lists.
|
||||
|
||||
{{{
|
||||
|
||||
>>> cidr_merge(['0.0.0.0/0', '0.0.0.0', '::/0', '::'])
|
||||
[IPNetwork('0.0.0.0/0'), IPNetwork('::/0')]
|
||||
|
||||
}}}
|
||||
Reference in New Issue
Block a user