Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
xt_resolve_hostname(3)	    Library Functions Manual	  xt_resolve_hostname(3)

NAME
     xt_resolve_hostname() - Convert hostname to IP address

LIBRARY
     #include <xtend/net.h>
     -lxtend

SYNOPSIS
     int     xt_resolve_hostname(const char *hostname, char *ip, size_t ip_buff_len)

ARGUMENTS
     hostname	 Name of the host to be resolved
     ip 	 Character array to receive IP address
     ip_buff_len Size of ip array including null byte

DESCRIPTION
     Resolve a host name to an IP address.

RETURN VALUES
     XT_OK on success, XT_FAIL otherwise

EXAMPLES
     #define IP_MAX_CHARS    64

     char    *hostname = "my.site.edu",
	     ip[IP_MAX_CHARS + 1];

     if ( xt_resolve_hostname(hostname, ip, IP_MAX_CHARS + 1) == XT_OK )
     {
     }

SEE ALSO
     gethostbyname(3), getaddrinfo(3)

							  xt_resolve_hostname(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=xt_resolve_hostname&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help