dnspython  1.16.0
About: dnspython is a DNS toolkit (for Python 2.x) that supports almost all record types.
  Fossies Dox: dnspython-1.16.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

dns.inet Namespace Reference

Functions

def inet_pton (family, text)
 
def inet_ntop (family, address)
 
def af_for_address (text)
 
def is_multicast (text)
 

Variables

 AF_INET = socket.AF_INET
 
 AF_INET6 = socket.AF_INET6
 

Function Documentation

◆ af_for_address()

def dns.inet.af_for_address (   text)
Determine the address family of a textual-form network address.

*text*, a ``text``, the textual address.

Raises ``ValueError`` if the address family cannot be determined
from the input.

Returns an ``int``.

Definition at line 83 of file inet.py.

References dns.ipv4.inet_aton(), and dns.ipv6.inet_aton().

Referenced by dns.edns.ECSOption.__init__(), and dns.query._destination_and_source().

◆ inet_ntop()

def dns.inet.inet_ntop (   family,
  address 
)
Convert the binary form of a network address into its textual form.

*family* is an ``int``, the address family.

*address* is a ``binary``, the network address in binary form.

Raises ``NotImplementedError`` if the address family specified is not
implemented.

Returns a ``text``.

Definition at line 62 of file inet.py.

References dns.ipv4.inet_ntoa(), and dns.ipv6.inet_ntoa().

Referenced by dns.rdtypes.IN.AAAA.AAAA.from_wire(), dns.rdtypes.IN.IPSECKEY.IPSECKEY.from_wire(), dns.rdtypes.IN.APL.APL.from_wire(), and dns.edns.ECSOption.from_wire().

◆ inet_pton()

def dns.inet.inet_pton (   family,
  text 
)
Convert the textual form of a network address into its binary form.

*family* is an ``int``, the address family.

*text* is a ``text``, the textual address.

Raises ``NotImplementedError`` if the address family specified is not
implemented.

Returns a ``binary``.

Definition at line 41 of file inet.py.

References dns.ipv4.inet_aton(), and dns.ipv6.inet_aton().

Referenced by dns.rdtypes.IN.AAAA.AAAA.__init__(), dns.rdtypes.IN.IPSECKEY.IPSECKEY.__init__(), dns.query._addresses_equal(), dns.rdtypes.IN.AAAA.AAAA.to_wire(), dns.rdtypes.IN.APL.APLItem.to_wire(), and dns.rdtypes.IN.IPSECKEY.IPSECKEY.to_wire().

◆ is_multicast()

def dns.inet.is_multicast (   text)
Is the textual-form network address a multicast address?

*text*, a ``text``, the textual address.

Raises ``ValueError`` if the address family cannot be determined
from the input.

Returns a ``bool``.

Definition at line 105 of file inet.py.

References dns.ipv4.inet_aton(), dns.ipv6.inet_aton(), and dns._compat.maybe_ord().

Referenced by dns.query.receive_udp().

Variable Documentation

◆ AF_INET

dns.inet.AF_INET = socket.AF_INET

Definition at line 29 of file inet.py.

◆ AF_INET6

int dns.inet.AF_INET6 = socket.AF_INET6

Definition at line 36 of file inet.py.