1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
# -----------------------------------------------------------------------------
# Copyright (c) 2008 by David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
# -----------------------------------------------------------------------------
"""A Python library for manipulating IP and EUI network addresses."""
#: Version info (major, minor, maintenance, status)
__version__ = '1.3.0'
VERSION = tuple(int(part) for part in __version__.split('.'))
STATUS = ''
import sys as _sys
if _sys.version_info[0:2] < (3, 7):
raise RuntimeError('Python 3.7.0 or higher is required!')
__all__ = [
'AddrConversionError',
'AddrFormatError',
'NotRegisteredError',
'ZEROFILL',
'INET_ATON',
'INET_PTON',
'NOHOST',
'IPAddress',
'IPNetwork',
'IPRange',
'all_matching_cidrs',
'cidr_abbrev_to_verbose',
'cidr_exclude',
'cidr_merge',
'expand_partial_ipv4_address',
'iprange_to_cidrs',
'iter_iprange',
'iter_unique_ips',
'largest_matching_cidr',
'smallest_matching_cidr',
'spanning_cidr',
'IPSet',
'IPGlob',
'cidr_to_glob',
'glob_to_cidrs',
'glob_to_iprange',
'glob_to_iptuple',
'iprange_to_globs',
'valid_glob',
'valid_nmap_range',
'iter_nmap_range',
'base85_to_ipv6',
'ipv6_to_base85',
'EUI',
'IAB',
'OUI',
'valid_ipv4',
'valid_ipv6',
'ipv6_compact',
'ipv6_full',
'ipv6_verbose',
'mac_eui48',
'mac_unix',
'mac_unix_expanded',
'mac_cisco',
'mac_bare',
'mac_pgsql',
'valid_mac',
'eui64_base',
'eui64_unix',
'eui64_unix_expanded',
'eui64_cisco',
'eui64_bare',
'valid_eui64',
'SubnetSplitter',
]
from netaddr.core import (
AddrConversionError,
AddrFormatError,
NotRegisteredError,
ZEROFILL,
INET_ATON,
INET_PTON,
NOHOST,
)
from netaddr.ip import (
IPAddress,
IPNetwork,
IPRange,
all_matching_cidrs,
cidr_abbrev_to_verbose,
cidr_exclude,
cidr_merge,
iprange_to_cidrs,
iter_iprange,
iter_unique_ips,
largest_matching_cidr,
smallest_matching_cidr,
spanning_cidr,
)
from netaddr.ip.sets import IPSet
from netaddr.ip.glob import (
IPGlob,
cidr_to_glob,
glob_to_cidrs,
glob_to_iprange,
glob_to_iptuple,
iprange_to_globs,
valid_glob,
)
from netaddr.ip.nmap import valid_nmap_range, iter_nmap_range
from netaddr.ip.rfc1924 import base85_to_ipv6, ipv6_to_base85
from netaddr.eui import EUI, IAB, OUI
from netaddr.strategy.ipv4 import (
expand_partial_address as expand_partial_ipv4_address,
valid_str as valid_ipv4,
)
from netaddr.strategy.ipv6 import valid_str as valid_ipv6, ipv6_compact, ipv6_full, ipv6_verbose
from netaddr.strategy.eui48 import (
mac_eui48,
mac_unix,
mac_unix_expanded,
mac_cisco,
mac_bare,
mac_pgsql,
valid_str as valid_mac,
)
from netaddr.strategy.eui64 import (
eui64_base,
eui64_unix,
eui64_unix_expanded,
eui64_cisco,
eui64_bare,
valid_str as valid_eui64,
)
from netaddr.contrib.subnet_splitter import SubnetSplitter
|