Package netaddr :: Module strategy :: Class IPv4StrategyStd
[frames] | no frames]

Class IPv4StrategyStd

source code

  object --+    
           |    
AddrStrategy --+
               |
              IPv4StrategyStd
Known Subclasses:

A 'safe' AddrStrategy for IPv4 addresses. Unlike IPv4StrategyOpt.

It contains all methods related to IPv4 addresses that the optimised version has, without the reliance on the socket or struct modules. There are several cases where the use of this class are preferable when either the modules mentioned do not exist on certain Python implementations or contain bugs like the infamous inet_aton('255.255.255.254') bug.

All methods shared between the optimised class and this one should be defined here.

Instance Methods
 
__init__(self)
Constructor.
source code
 
int_to_arpa(self, int_val)
Returns: The reverse DNS lookup for an IPv4 address in network byte order integer form.
source code

Inherited from AddrStrategy: __repr__, bits_to_int, bits_to_str, bits_to_words, description, int_to_bits, int_to_str, int_to_words, str_to_bits, str_to_int, str_to_words, valid_bits, valid_int, valid_str, valid_words, word_to_bits, words_to_bits, words_to_int, words_to_str

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

Constructor.

Overrides: object.__init__

int_to_arpa(self, int_val)

source code 
Parameters:
  • int_val - A network byte order integer.
Returns:
The reverse DNS lookup for an IPv4 address in network byte order integer form.