Use inet_ntop() and pack()/unpack() for ip/address conversion.