Monday, May 18, 2009

Adding functionality to PCS

Sent the below to GNN, hopefully it'll make its way into PCS.

def inet_lton(integer):
return struct.pack(">L",integer)

def inet_ltoa(integer):
return socket.inet_ntoa(inet_lton(integer))

def inet_ntol(byteString):
return struct.unpack(">L",byteString)[0]

def inet_atol(ipString):
return inet_ntol(socket.inet_aton(ipString))
Read more...

No comments:

Post a Comment

Followers

Blog Archive

About Me