P_dns4_IP_to_addr 3porty 2011-04-13 libporty manual

NAME

P_dns4_IP_to_addr, P_dns4_addr_to_IP, P_dns4_is_addr

SYNPOSIS

#include <libporty/net/dns4.h>

int P_dns4_IP_to_addr (unsigned long int * ip_in , char * addr_out );
int P_dns4_addr_to_IP (unsigned long int * ip_out , const char * addr_in );
int P_dns4_is_addr (char * name );

Link with -lporty_net

DESCRIPTION

These calls are provided to ease printing and reading IP addresses to/from strings. Operation is always done without any DNS related system calls, ensuring that these functions return immediately. Whenever output is a name, it is allocated by the caller and should be long enough for an IPv4 IP address - 16 bytes is a good choice.

RETURN VALUE

P_dns4_IP_to_addr and P_dns4_addr_to_IP calls return 0 on success. P_dns4_is_addr returns zero if name is not a valid-looking IP address.

P_dns4_IP_to_addr 3porty 2011-04-13 libporty manual