Replace FSF snail mail address with URLs.
[glibc.git] / sysdeps / unix / sysv / linux / bits / in.h
blob672757e6647099920ece47e7af349e3f8e933d14
1 /* Copyright (C) 1991-2000,2004,2008,2010,2011 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
18 /* Linux version. */
20 #ifndef _NETINET_IN_H
21 # error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
22 #endif
24 /* Options for use with `getsockopt' and `setsockopt' at the IP level.
25 The first word in the comment at the right is the data type used;
26 "bool" means a boolean value stored in an `int'. */
27 #define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */
28 #define IP_HDRINCL 3 /* int; Header is included with data. */
29 #define IP_TOS 1 /* int; IP type of service and precedence. */
30 #define IP_TTL 2 /* int; IP time to live. */
31 #define IP_RECVOPTS 6 /* bool; Receive all IP options w/datagram. */
32 /* For BSD compatibility. */
33 #define IP_RECVRETOPTS IP_RETOPTS /* bool; Receive IP options for response. */
34 #define IP_RETOPTS 7 /* ip_opts; Set/get IP per-packet options. */
35 #define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */
36 #define IP_MULTICAST_TTL 33 /* u_char; set/get IP multicast ttl */
37 #define IP_MULTICAST_LOOP 34 /* i_char; set/get IP multicast loopback */
38 #define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */
39 #define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */
40 #define IP_UNBLOCK_SOURCE 37 /* ip_mreq_source: unblock data from source */
41 #define IP_BLOCK_SOURCE 38 /* ip_mreq_source: block data from source */
42 #define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */
43 #define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */
44 #define IP_MSFILTER 41
45 #if defined __USE_MISC || defined __USE_GNU
46 # define MCAST_JOIN_GROUP 42 /* group_req: join any-source group */
47 # define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */
48 # define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group*/
49 # define MCAST_LEAVE_GROUP 45 /* group_req: leave any-source group */
50 # define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */
51 # define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr*/
52 # define MCAST_MSFILTER 48
54 # define MCAST_EXCLUDE 0
55 # define MCAST_INCLUDE 1
56 #endif
58 #define IP_ROUTER_ALERT 5 /* bool */
59 #define IP_PKTINFO 8 /* bool */
60 #define IP_PKTOPTIONS 9
61 #define IP_PMTUDISC 10 /* obsolete name? */
62 #define IP_MTU_DISCOVER 10 /* int; see below */
63 #define IP_RECVERR 11 /* bool */
64 #define IP_RECVTTL 12 /* bool */
65 #define IP_RECVTOS 13 /* bool */
66 #define IP_MTU 14 /* int */
67 #define IP_FREEBIND 15
68 #define IP_IPSEC_POLICY 16
69 #define IP_XFRM_POLICY 17
70 #define IP_PASSSEC 18
71 #define IP_TRANSPARENT 19
72 #define IP_MULTICAST_ALL 49 /* bool */
74 /* TProxy original addresses */
75 #define IP_ORIGDSTADDR 20
76 #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
78 #define IP_MINTTL 21
81 /* IP_MTU_DISCOVER arguments. */
82 #define IP_PMTUDISC_DONT 0 /* Never send DF frames. */
83 #define IP_PMTUDISC_WANT 1 /* Use per route hints. */
84 #define IP_PMTUDISC_DO 2 /* Always DF. */
85 #define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */
87 /* To select the IP level. */
88 #define SOL_IP 0
90 #define IP_DEFAULT_MULTICAST_TTL 1
91 #define IP_DEFAULT_MULTICAST_LOOP 1
92 #define IP_MAX_MEMBERSHIPS 20
94 #if defined __USE_MISC || defined __USE_GNU
95 /* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
96 The `ip_dst' field is used for the first-hop gateway when using a
97 source route (this gets put into the header proper). */
98 struct ip_opts
100 struct in_addr ip_dst; /* First hop; zero without source route. */
101 char ip_opts[40]; /* Actually variable in size. */
104 /* Like `struct ip_mreq' but including interface specification by index. */
105 struct ip_mreqn
107 struct in_addr imr_multiaddr; /* IP multicast address of group */
108 struct in_addr imr_address; /* local IP address of interface */
109 int imr_ifindex; /* Interface index */
112 /* Structure used for IP_PKTINFO. */
113 struct in_pktinfo
115 int ipi_ifindex; /* Interface index */
116 struct in_addr ipi_spec_dst; /* Routing destination address */
117 struct in_addr ipi_addr; /* Header destination address */
119 #endif
121 /* Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
122 The first word in the comment at the right is the data type used;
123 "bool" means a boolean value stored in an `int'. */
124 #define IPV6_ADDRFORM 1
125 #define IPV6_2292PKTINFO 2
126 #define IPV6_2292HOPOPTS 3
127 #define IPV6_2292DSTOPTS 4
128 #define IPV6_2292RTHDR 5
129 #define IPV6_2292PKTOPTIONS 6
130 #define IPV6_CHECKSUM 7
131 #define IPV6_2292HOPLIMIT 8
133 #define SCM_SRCRT IPV6_RXSRCRT
135 #define IPV6_NEXTHOP 9
136 #define IPV6_AUTHHDR 10
137 #define IPV6_UNICAST_HOPS 16
138 #define IPV6_MULTICAST_IF 17
139 #define IPV6_MULTICAST_HOPS 18
140 #define IPV6_MULTICAST_LOOP 19
141 #define IPV6_JOIN_GROUP 20
142 #define IPV6_LEAVE_GROUP 21
143 #define IPV6_ROUTER_ALERT 22
144 #define IPV6_MTU_DISCOVER 23
145 #define IPV6_MTU 24
146 #define IPV6_RECVERR 25
147 #define IPV6_V6ONLY 26
148 #define IPV6_JOIN_ANYCAST 27
149 #define IPV6_LEAVE_ANYCAST 28
150 #define IPV6_IPSEC_POLICY 34
151 #define IPV6_XFRM_POLICY 35
153 #define IPV6_RECVPKTINFO 49
154 #define IPV6_PKTINFO 50
155 #define IPV6_RECVHOPLIMIT 51
156 #define IPV6_HOPLIMIT 52
157 #define IPV6_RECVHOPOPTS 53
158 #define IPV6_HOPOPTS 54
159 #define IPV6_RTHDRDSTOPTS 55
160 #define IPV6_RECVRTHDR 56
161 #define IPV6_RTHDR 57
162 #define IPV6_RECVDSTOPTS 58
163 #define IPV6_DSTOPTS 59
165 #define IPV6_RECVTCLASS 66
166 #define IPV6_TCLASS 67
168 /* Obsolete synonyms for the above. */
169 #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
170 #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
171 #define IPV6_RXHOPOPTS IPV6_HOPOPTS
172 #define IPV6_RXDSTOPTS IPV6_DSTOPTS
174 /* IPV6_MTU_DISCOVER values. */
175 #define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */
176 #define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */
177 #define IPV6_PMTUDISC_DO 2 /* Always DF. */
178 #define IPV6_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */
180 /* Socket level values for IPv6. */
181 #define SOL_IPV6 41
182 #define SOL_ICMPV6 58
184 /* Routing header options for IPv6. */
185 #define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */
186 #define IPV6_RTHDR_STRICT 1 /* Hop must be a neighbour. */
188 #define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0. */