PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` netaddr.ip.nmap
Package netaddr :: Package ip :: Module nmap
[hide private]
[frames] | no frames]

Module nmap

Routines for dealing with nmap-style IPv4 address ranges.

The nmap range specification represents between 1 and 4 contiguous IP address blocks depending on the range specified.

Each octets can be represented with hyphenated range sets according to the following rules:

  1. * 'x-y' - the hyphenated octet (represents values x through y)
  2. x must be less than or equal to y
  3. x and y must be values between 0 through 255

Example nmap ranges :

   '192.0.2.1'                 #   one IP address
   '192.0.2.0-31'              #   one block with 32 IP addresses.
   '192.0.2-3.1-254'           #   two blocks with 254 IP addresses.
   '0-255.0-255.0-255.0-255'   #   the whole IPv4 address space
Functions [hide private]
 
valid_nmap_range(iprange)
Returns: True if IP range is valid, False otherwise.
 
iter_nmap_range(iprange)
The nmap security tool supports a custom type of IPv4 range using multiple hyphenated octets.
Variables [hide private]
  __package__ = 'netaddr.ip'
Function Details [hide private]

valid_nmap_range(iprange)

 
Parameters:
  • iprange - an nmap-style IP address range.
Returns:
True if IP range is valid, False otherwise.

iter_nmap_range(iprange)

 

The nmap security tool supports a custom type of IPv4 range using multiple hyphenated octets. This generator provides iterators yielding IP addresses according to this rule set.

Parameters:
  • iprange - an nmap-style IP address range.
Returns:
an iterator producing IPAddress objects for each IP in the range.