text: IPV6Section: Linux Programmer's Manual (7)
  Updated: 1999-06-29
  Index Return to Main Contents
  NAMEipv6, PF_INET6 - Linux IPv6 protocol implementation
  SYNOPSIS#include <sys/socket.h>
  #include <netinet/in.h>
  tcp6_socket = socket(PF_INET6, SOCK_STREAM, 0);
  raw6_socket = socket(PF_INET6, SOCK_RAW, protocol);
  udp6_socket = socket(PF_INET6, SOCK_DGRAM, protocol);
  DESCRIPTIONLinux(7) v4 API. only needs only to support this API type to support both protocols. This is handled transparently by the address handling functions in libc.
  IPv4 and IPv6 share the local port space. When you get an IPv4 connection or packet to a IPv6 socket its source address will be mapped to v6 and it'll be mapped to v6.
  Address Format
  struct sockaddr_in6 { u_int16_t sin6_family; /* AF_INET6 */ u_int16_t sin6_port; /* port number */ u_int32_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ u_intbit IPv6 address. sin6_scope_id is an ID of depending of on the scope of the address. It is new in Linux 2.4. Linux only supports it for link scope a IPv4 host, and other reserved address types.
  The address notation for IPv6 is a group of 16 2IP only allowed for IPv6 sockets that are connected and bound to a v4-mapped-on-v6 address. The argument is a pointer to structure.
  - IPV6_MTU
  - only allowed for SOCK_DGRAM and SOCK_RAW socket. The argument is all forwarded packets containing an router alert option to this socket. Only allowed for datagram sockets and for root. Argument is a pointer to boolean.
  - IPV6_UNICAST_HOPS
  - Set the unicast hop limit for the socket. Argument is an pointer to an integer. -1 in the value means use the route default, otherwise it should be between 0 and 255.
  VERSIONSThe older libinet6 libc5 based IPv6 API implementation for Linux is not described here and may vary in details.
  Linux 2.4 will break binary compatibility for the sockaddr_in6 for 64bit hosts by changing the alignment of in6_addr and adding an additional sin6_scope_id field. The kernel interfaces stay compatible, but a program including sockaddr_in6 or in6_addr into other structures may not be. This is not a problem for 32bit.
  BUGST.
  SEE ALSOcmsg(3), ip(7)
  RFC 2553: IPv6 BASIC API. Linux tries to be compliant to this.
  RFC 2460: IPv6 specification.
  Index
  Random Man Pages:
  crackberg
  iso-8859-9
  listxattr
  clone