Table of contents Index

Module SockAddr

class SockAddrInet
class SockAddrInetRange
def inet_aton(ip) # Converts an internet address to a 32 bit integer
def inet_ntoa(ip) # Converts a 32 bit integer into IP number's string representation
string __file__ = './SockAddr.py'


inet_aton(ip)

Converts an internet address to a 32 bit integer

ip
A dotted-quad string

splits on the dot, atoi the parts, and bitshift the whole thing into one

Returns:

unsigned long in network byte order

Notes:

FIXME: there is no parameter check

inet_ntoa(ip)

Converts a 32 bit integer into IP number's string representation

ip
The ip number in 32 bit integer (network byte order)
Masks the necessary bytes out and formats them into a string.

Returns:

string representation of IP
Copyright © 2000 BalaBit IT Ltd.
Written by: Balázs Scheidler