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

FreeBSD Manual Pages

  
 
  

home | help
IPADDR_FAMILY(3)	   libdill Library Functions	      IPADDR_FAMILY(3)

NAME
       ipaddr_family - returns family of the IP	address

SYNOPSIS
	      #include <libdill.h>

	      int ipaddr_family(
		  const	struct ipaddr* addr);

DESCRIPTION
       Returns	family of the address, i.e.  either AF_INET for	IPv4 addresses
       or AF_INET6 for IPv6 addresses.

       addr: IP	address	object.

       This function is	not available  if  libdill  is	compiled  with	--dis-
       able-sockets option.

RETURN VALUE
       IP family.

ERRORS
       None.

EXAMPLE
	      ipaddr addr;
	      ipaddr_remote(&addr, "www.example.org", 80, 0, -1);
	      int s = socket(ipaddr_family(addr), SOCK_STREAM, 0);
	      connect(s, ipaddr_sockaddr(&addr), ipaddr_len(&addr));

SEE ALSO
       ipaddr_equal(3) ipaddr_len(3) ipaddr_local(3) ipaddr_port(3) ipaddr_re-
       mote(3) ipaddr_remotes(3)  ipaddr_setport(3)  ipaddr_sockaddr(3)	 ipad-
       dr_str(3)

libdill							      IPADDR_FAMILY(3)

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | EXAMPLE | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=ipaddr_family&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help