*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> inet_ntop (3)              



NAME    [Toc]    [Back]

       inet_ntop - Parse network address structures

SYNOPSIS    [Toc]    [Back]

       #include <sys/types.h>
       #include <sys/socket.h>
       #include <arpa/inet.h>

       const char *inet_ntop(int af, const void *src,
			     char *dst, size_t cnt);

DESCRIPTION    [Toc]    [Back]

       This  function  converts  the  network  address structure src in the af
       address family into a character string, which is copied to a  character
       buffer dst, which is cnt bytes long.

       inet_ntop(3)  extends  the  inet_ntoa(3)  function  to support multiple
       address families, inet_ntoa(3) is now considered to  be	deprecated  in
       favor  of  inet_ntop(3).   The following address families are currently

       AF_INET    [Toc]    [Back]
	      src points to a struct in_addr (network byte order format) which
	      is  converted to an IPv4 network address in the dotted-quad format,
  "ddd.ddd.ddd.ddd".	 The  buffer  dst  must  be  at  least
	      INET_ADDRSTRLEN bytes long.

       AF_INET6    [Toc]    [Back]
	      src  points  to  a  struct  in6_addr (network byte order format)
	      which is converted to a representation of this  address  in  the
	      most  appropriate  IPv6 network address format for this address.
	      The buffer dst must be at least INET6_ADDRSTRLEN bytes long.

RETURN VALUE    [Toc]    [Back]

       inet_ntop returns a non-null pointer to dst.  NULL is returned if there
       was  an	error,	with  errno set to EAFNOSUPPORT if af was not set to a
       valid address family, or to ENOSPC  if  the  converted  address	string
       would exceed the size of dst given by the cnt argument.

SEE ALSO    [Toc]    [Back]


BUGS    [Toc]    [Back]

       AF_INET6 converts IPv6-mapped IPv4 addresses into an IPv6 format.

Linux Man Page			  2000-12-18			  inet_ntop(3)
[ Back ]
 Similar pages
Name OS Title
inet_network Tru64 Translate an Internet dot-formatted address string to a network address integer
net_addrcmp OpenBSD compare socket address structures
inet_netof Tru64 Translate an Internet address into its network address component
inet_addr Tru64 Translate an Internet network address string to an Internet address integer
getnetbyaddr Tru64 Get a network entry by address
getnetbyaddr_r Tru64 Get a network entry by address
getaddrinfo Linux network address and service translation
inet_pton Linux Create a network address structure
inet_makeaddr Tru64 Translate an Internet network address and
getipnodebyaddr Tru64 Get a network host entry by address
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service