However, keep in mind that these modules might not be available
everywhere that Python itself is. Runtimes such as Google App Engine gut
the socket
module. struct
is also limited to
processing 32-bit integers which is fine for IPv4 but isn't suitable for
IPv6.
|
|
|
valid_str(self,
addr)
Returns:
True if network address in string form is valid for this
address type, False otherwise. |
source code
|
|
|
str_to_int(self,
addr)
Returns:
A network byte order integer that is equivalent to value represented
by the IPv4 dotted decimal address string. |
source code
|
|
|
int_to_str(self,
int_val)
Returns:
An IPv4 dotted decimal address string that is equivalent to value
represented by a 32 bit integer in network byte order. |
source code
|
|
|
int_to_words(self,
int_val,
num_words=None,
word_size=None)
Returns:
An integer word (octet) sequence that is equivalent to value
represented by network byte order integer. |
source code
|
|
|
words_to_int(self,
octets)
Returns:
A network byte order integer that is equivalent to value represented
by word (octet) sequence. |
source code
|
|
Inherited from IPv4StrategyStd :
int_to_arpa
Inherited from AddrStrategy :
__repr__ ,
bits_to_int ,
int_to_bin ,
int_to_bits ,
int_to_packed ,
packed_to_int ,
valid_bits ,
valid_int ,
valid_words
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__str__
|