GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
GETNAMEINFO(3) FreeBSD Library Functions Manual GETNAMEINFO(3)

getnameinfoaddress-to-name translation in protocol-independent manner

#include <sys/socket.h>
#include <netdb.h>

int
getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags);

The () function is defined for protocol-independent address-to-nodename translation. It performs functionality of gethostbyaddr(3) and getservbyport(3) in more sophisticated manner.

The sa arguement is a pointer to a generic socket address structure of size salen. The arguements host and serv are pointers to buffers to hold the return values. Their sizes are specified by hostlen and servlen repectively. Either host or serv may be NULL if the hostname or service name is not required.

The flags arguement modifies the behaviour of () as follows:

If NI_NOFQDN is set only the unqualified hostname is returned for local fully qualified names.

If NI_NUMERICHOST is set then the numeric form of the hostname is returned.

If NI_NAMEREQD is set, then a error is returned if the hostname cannot be looked up.

If NI_NUMERICSERV is set then the service is returned in numeric form.

If NI_DGRAM is set then the service is UDP based rather than TCP based.

getaddrinfo(3), gethostbyaddr(3), getservbyport(3), hosts(5), services(5), hostname(7),

R. Gilligan, S. Thomson, J. Bound, and W. Stevens, ``Basic Socket Interface Extensions for IPv6,'' RFC2133, April 1997.

The getaddrinfo() function is defined IEEE POSIX 1003.1g draft specification, and documented in ``Basic Socket Interface Extensions for IPv6'' (RFC2133).

January 11, 1999

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.