__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
import types
from netaddr import IPNetwork, cidr_merge
def test_ipnetwork_cidr_merge():
ip_list = (
list(IPNetwork('fe80::/120'))
+ [
IPNetwork('192.0.2.0/24'),
IPNetwork('192.0.4.0/25'),
IPNetwork('192.0.4.128/25'),
]
+ list(map(str, IPNetwork('192.0.3.0/24')))
)
assert len(ip_list) == 515
assert cidr_merge(ip_list) == [
IPNetwork('192.0.2.0/23'),
IPNetwork('192.0.4.0/24'),
IPNetwork('fe80::/120'),
]
def test_subnetting():
ip = IPNetwork('172.24.0.0/23')
assert isinstance(ip.subnet(28), types.GeneratorType)
subnets = list(ip.subnet(28))
assert len(subnets) == 32
assert subnets == [
IPNetwork('172.24.0.0/28'),
IPNetwork('172.24.0.16/28'),
IPNetwork('172.24.0.32/28'),
IPNetwork('172.24.0.48/28'),
IPNetwork('172.24.0.64/28'),
IPNetwork('172.24.0.80/28'),
IPNetwork('172.24.0.96/28'),
IPNetwork('172.24.0.112/28'),
IPNetwork('172.24.0.128/28'),
IPNetwork('172.24.0.144/28'),
IPNetwork('172.24.0.160/28'),
IPNetwork('172.24.0.176/28'),
IPNetwork('172.24.0.192/28'),
IPNetwork('172.24.0.208/28'),
IPNetwork('172.24.0.224/28'),
IPNetwork('172.24.0.240/28'),
IPNetwork('172.24.1.0/28'),
IPNetwork('172.24.1.16/28'),
IPNetwork('172.24.1.32/28'),
IPNetwork('172.24.1.48/28'),
IPNetwork('172.24.1.64/28'),
IPNetwork('172.24.1.80/28'),
IPNetwork('172.24.1.96/28'),
IPNetwork('172.24.1.112/28'),
IPNetwork('172.24.1.128/28'),
IPNetwork('172.24.1.144/28'),
IPNetwork('172.24.1.160/28'),
IPNetwork('172.24.1.176/28'),
IPNetwork('172.24.1.192/28'),
IPNetwork('172.24.1.208/28'),
IPNetwork('172.24.1.224/28'),
IPNetwork('172.24.1.240/28'),
]
def test_supernetting():
ip = IPNetwork('192.0.2.114')
supernets = ip.supernet(22)
assert supernets == [
IPNetwork('192.0.0.0/22'),
IPNetwork('192.0.2.0/23'),
IPNetwork('192.0.2.0/24'),
IPNetwork('192.0.2.0/25'),
IPNetwork('192.0.2.64/26'),
IPNetwork('192.0.2.96/27'),
IPNetwork('192.0.2.112/28'),
IPNetwork('192.0.2.112/29'),
IPNetwork('192.0.2.112/30'),
IPNetwork('192.0.2.114/31'),
]
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| __init__.py | File | 0 B | 0644 |
|
| test_cidr_v4.py | File | 7.4 KB | 0644 |
|
| test_cidr_v6.py | File | 4.56 KB | 0644 |
|
| test_dns.py | File | 320 B | 0644 |
|
| test_ip.py | File | 625 B | 0644 |
|
| test_ip_categories.py | File | 4.04 KB | 0644 |
|
| test_ip_comparisons.py | File | 1.39 KB | 0644 |
|
| test_ip_globs.py | File | 2.09 KB | 0644 |
|
| test_ip_network_categories.py | File | 547 B | 0644 |
|
| test_ip_ranges.py | File | 8.57 KB | 0644 |
|
| test_ip_rfc1924.py | File | 512 B | 0644 |
|
| test_ip_sets.py | File | 22.68 KB | 0644 |
|
| test_ip_splitter.py | File | 2.21 KB | 0644 |
|
| test_ip_v4.py | File | 15.07 KB | 0644 |
|
| test_ip_v4_v6_conversions.py | File | 1.22 KB | 0644 |
|
| test_ip_v6.py | File | 5.95 KB | 0644 |
|
| test_network_ops.py | File | 2.37 KB | 0644 |
|
| test_nmap.py | File | 3.62 KB | 0644 |
|
| test_old_specs.py | File | 6.37 KB | 0644 |
|
| test_platform_osx.py | File | 5.29 KB | 0644 |
|
| test_socket_module_fallback.py | File | 1.48 KB | 0644 |
|