.TH "pydhcplib.ipv4" "3" "" "" "PYDHCPLIB" .SH "NAME" pydhcplib.ipv4 \- Type for IP addresses version 4 .SH "SYNOPSIS" from pydhcplib.type_ipv4 import ipv4 a = ipv4() .br a = ipv4(string) .br a = ipv4(strlist) .br a = ipv4(int) .SH "DESCRIPTION" The class pydhcplib.ipv4 is a type "IP address version 4". It's used for string processing like "192.168.0.4". The class creation argument can be a string like "192.168.0.4". The class creation argument can be a list of bytes like [192,168,0,4]. .SH "METHODS" The implemented methods in this class are mostly methods of comparison (= =, >, etc...) else : str() return data converted into a printable string. list() return data converted into a list of bytes. int() return data converted into an 4 bytes int. .SH "EXAMPLES" \fBExample program ipv4_example.py :\fR from pydhcplib.type_ipv4 import ipv4 address = ipv4() .br address1 = ipv4("192.168.0.1") .br address2 = ipv4("10.0.0.1") .br address3 = ipv4([192,168,0,1]) print "a0 : ",address .br print "a1 : ",address1 .br print "a2 : ",address2 .br print "a3 : ",address3 if address1 == address2 : .br print "test 1 : ",address1, "==",address2 .br else : .br print "test 1 : " ,address1, "!=",address2 if address1 == address3 : .br print "test 2 : ", address1, "==",address3 .br else : .br print "test 2 : ", address1, "!=",address3 .SH "SEE ALSO" pydhcp(8), pydhcplib.hwmac(3), pydhcplib.ipv4(3), pydhcplib.strlist(3), pydhcplib.DhcpPacket(3), pydhcplib.DhcpBasicPacket(3), pydhcplib.DhcpNetwork(3), pydhcplib.DhcpClient(3), pydhcplib.DhcpRawClient(3), pydhcplib.DhcpDerver(3) .SH "BUGS" See http://pydhcplib.tuxfamily.org/ for more information. .SH "AUTHOR" Mathieu Ignacio (mignacio[AT]april.org)