Package ZenUtils :: Module IpUtil
[hide private]
[frames] | no frames]

Module IpUtil

source code

Util

Utility functions for the Confmon Product

$Id: IpUtil.py,v 1.4 2002/12/18 18:50:47 edahl Exp $


Version: 1.4

Classes [hide private]
  IpAddressError
Functions [hide private]
 
isip(...)
return match if this is an ip.
source code
 
checkip(ip)
check that an ip is valid
source code
 
numbip(ip)
convert a string ip to number
source code
 
ipFromIpMask(ipmask)
get just the ip from an ip mask pair like 1.1.1.1/24
source code
 
strip(ip)
convert a number ip to a string
source code
 
hexToBits(hex)
convert hex number (0xff000000 of netbits to numeric netmask (8)
source code
 
hexToMask(hex)
converts a netmask represented in hex to octets represented in decimal.
source code
 
maskToBits(netmask)
convert string rep of netmask to number of bits
source code
 
bitsToMaskNumb(netbits)
convert integer number of netbits to string netmask
source code
 
bitsToMask(netbits) source code
 
getnet(ip, netmask)
get network address of ip as string netmask is in form 255.255.255.0
source code
 
getnetstr(ip, netmask)
return network number as string
source code
Variables [hide private]
  __doc__ = """U...
  _masks = (255, 65280, 16711680, 4278190080)
Function Details [hide private]

isip(...)

source code 
return match if this is an ip.

hexToMask(hex)

source code 
converts a netmask represented in hex to octets represented in decimal. e.g. "0xffffff00" -> "255.255.255.0"

Variables Details [hide private]

__doc__

Value:
"""Util

Utility functions for the Confmon Product

$Id: IpUtil.py,v 1.4 2002/12/18 18:50:47 edahl Exp $"""