Back to index

glibc  2.9
in.h
Go to the documentation of this file.
00001 /* Copyright (C) 1997, 2000, 2004, 2007 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 /* Generic version.  */
00020 
00021 #ifndef _NETINET_IN_H
00022 # error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
00023 #endif
00024 
00025 /* Options for use with `getsockopt' and `setsockopt' at the IP level.
00026    The first word in the comment at the right is the data type used;
00027    "bool" means a boolean value stored in an `int'.  */
00028 #define       IP_OPTIONS    1      /* ip_opts; IP per-packet options.  */
00029 #define       IP_HDRINCL    2      /* int; Header is included with data.  */
00030 #define       IP_TOS        3      /* int; IP type of service and precedence.  */
00031 #define       IP_TTL        4      /* int; IP time to live.  */
00032 #define       IP_RECVOPTS   5      /* bool; Receive all IP options w/datagram.  */
00033 #define       IP_RECVRETOPTS       6      /* bool; Receive IP options for response.  */
00034 #define       IP_RECVDSTADDR       7      /* bool; Receive IP dst addr w/datagram.  */
00035 #define       IP_RETOPTS    8      /* ip_opts; Set/get IP per-packet options.  */
00036 #define IP_MULTICAST_IF 9   /* in_addr; set/get IP multicast i/f */
00037 #define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
00038 #define IP_MULTICAST_LOOP 11       /* i_char; set/get IP multicast loopback */
00039 #define IP_ADD_MEMBERSHIP 12       /* ip_mreq; add an IP group membership */
00040 #define IP_DROP_MEMBERSHIP 13      /* ip_mreq; drop an IP group membership */
00041 
00042 /* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
00043    The `ip_dst' field is used for the first-hop gateway when using a
00044    source route (this gets put into the header proper).  */
00045 struct ip_opts
00046   {
00047     struct in_addr ip_dst;  /* First hop; zero without source route.  */
00048     char ip_opts[40];              /* Actually variable in size.  */
00049   };
00050 
00051 /* IPV6 socket options.  */
00052 #define IPV6_ADDRFORM              1
00053 #define IPV6_RXINFO         2
00054 #define IPV6_HOPOPTS        3
00055 #define IPV6_DSTOPTS        4
00056 #define IPV6_RTHDR          5
00057 #define IPV6_PKTOPTIONS            6
00058 #define IPV6_CHECKSUM              7
00059 #define IPV6_HOPLIMIT              8
00060 
00061 #define IPV6_TXINFO         IPV6_RXINFO
00062 #define SCM_SRCINFO         IPV6_TXINFO
00063 #define SCM_SRCRT           IPV6_RXSRCRT
00064 
00065 #define IPV6_UNICAST_HOPS   16
00066 #define IPV6_MULTICAST_IF   17
00067 #define IPV6_MULTICAST_HOPS 18
00068 #define IPV6_MULTICAST_LOOP 19
00069 #define IPV6_JOIN_GROUP            20
00070 #define IPV6_LEAVE_GROUP    21
00071 #define IPV6_ROUTER_ALERT      22
00072 #define IPV6_MTU_DISCOVER      23
00073 #define IPV6_MTU               24
00074 #define IPV6_RECVERR           25
00075 #define IPV6_V6ONLY            26
00076 #define IPV6_JOIN_ANYCAST      27
00077 #define IPV6_LEAVE_ANYCAST     28
00078 
00079 /* Obsolete synonyms for the above.  */
00080 #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
00081 #define IPV6_DROP_MEMBERSHIP       IPV6_LEAVE_GROUP
00082 #define IPV6_RXHOPOPTS             IPV6_HOPOPTS
00083 #define IPV6_RXDSTOPTS             IPV6_DSTOPTS
00084 
00085 /* Routing header options for IPv6.  */
00086 #define IPV6_RTHDR_LOOSE    0      /* Hop doesn't need to be neighbour. */
00087 #define IPV6_RTHDR_STRICT   1      /* Hop must be a neighbour.  */
00088 
00089 #define IPV6_RTHDR_TYPE_0   0      /* IPv6 Routing header type 0.  */