Package dns :: Module inet
[hide private]
[frames] | no frames]

Module inet

source code

Generic Internet address helper functions.

Functions [hide private]
string
inet_pton(family, text)
Convert the textual form of a network address into its binary form.
source code
string
inet_ntop(family, address)
Convert the binary form of a network address into its textual form.
source code
int
af_for_address(text)
Determine the address family of a textual-form network address.
source code
bool
is_multicast(text)
Is the textual-form network address a multicast address?
source code
Variables [hide private]
  AF_INET = 2
  AF_INET6 = 30
  __package__ = 'dns'
Function Details [hide private]

inet_pton(family, text)

source code 

Convert the textual form of a network address into its binary form.

Parameters:
  • family (int) - the address family
  • text (string) - the textual address
Returns: string
Raises:
  • NotImplementedError - the address family specified is not implemented.

inet_ntop(family, address)

source code 

Convert the binary form of a network address into its textual form.

Parameters:
  • family (int) - the address family
  • address (string) - the binary address
Returns: string
Raises:
  • NotImplementedError - the address family specified is not implemented.

af_for_address(text)

source code 

Determine the address family of a textual-form network address.

Parameters:
  • text (string) - the textual address
Returns: int
Raises:
  • ValueError - the address family cannot be determined from the input.

is_multicast(text)

source code 

Is the textual-form network address a multicast address?

Parameters:
  • text - the textual address
Returns: bool
Raises:
  • ValueError - the address family cannot be determined from the input.