1 /* Copyright (C) 1991,92,93,94,95,96,97,98 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 Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 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 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
22 # error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
25 /* Options for use with `getsockopt' and `setsockopt' at the IP level.
26 The first word in the comment at the right is the data type used;
27 "bool" means a boolean value stored in an `int'. */
28 #define IP_TOS 1 /* int; IP type of service and precedence. */
29 #define IP_TTL 2 /* int; IP time to live. */
30 #define IP_HDRINCL 3 /* int; Header is included with data. */
31 #define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */
32 #define IP_ROUTER_ALERT 5 /* bool */
33 #define IP_RECVOPTS 6 /* bool */
34 #define IP_RETOPTS 7 /* bool */
35 #define IP_PKTINFO 8 /* bool */
36 #define IP_PKTOPTIONS 9
37 #define IP_PMTUDISC 10 /* obsolete name? */
38 #define IP_MTU_DISCOVER 10 /* int; see below */
39 #define IP_RECVERR 11 /* bool */
40 #define IP_RECVTTL 12 /* bool */
41 #define IP_RECVTOS 13 /* bool */
42 #define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */
43 #define IP_MULTICAST_TTL 33 /* u_char; set/get IP multicast ttl */
44 #define IP_MULTICAST_LOOP 34 /* i_char; set/get IP multicast loopback */
45 #define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */
46 #define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */
48 /* For BSD compatibility. */
49 #define IP_RECVRETOPTS IP_RETOPTS
51 /* IP_MTU_DISCOVER arguments. */
52 #define IP_PMTUDISC_DONT 0 /* Never send DF frames. */
53 #define IP_PMTUDISC_WANT 1 /* Use per route hints. */
54 #define IP_PMTUDISC_DO 2 /* Always DF. */
56 /* To select the IP level. */
59 #define IP_DEFAULT_MULTICAST_TTL 1
60 #define IP_DEFAULT_MULTICAST_LOOP 1
61 #define IP_MAX_MEMBERSHIPS 20
63 /* Structure used to describe IP options for IP_OPTIONS. The `ip_dst'
64 field is used for the first-hop gateway when using a source route
65 (this gets put into the header proper). */
68 struct in_addr ip_dst; /* First hop; zero without source route. */
69 char ip_opts[40]; /* Actually variable in size. */
72 /* Structure used for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. */
75 struct in_addr imr_multiaddr; /* IP multicast address of group */
76 struct in_addr imr_interface; /* local IP address of interface */
79 /* As above but including interface specification by index. */
82 struct in_addr imr_multiaddr; /* IP multicast address of group */
83 struct in_addr imr_address; /* local IP address of interface */
84 int imr_ifindex; /* Interface index */
87 /* As above but for IPv6. */
90 struct in6_addr ipv6mr_multiaddr; /* IPv6 multicast address of group */
91 int ipv6mr_ifindex; /* local IPv6 address of interface */
94 /* Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
95 The first word in the comment at the right is the data type used;
96 "bool" means a boolean value stored in an `int'. */
97 #define IPV6_ADDRFORM 1
98 #define IPV6_PKTINFO 2
99 #define IPV6_HOPOPTS 3
100 #define IPV6_DSTOPTS 4
101 #define IPV6_RXSRCRT 5
102 #define IPV6_PKTOPTIONS 6
103 #define IPV6_CHECKSUM 7
104 #define IPV6_HOPLIMIT 8
105 #define IPV6_NEXTHOP 9
106 #define IPV6_AUTHHDR 10
107 #define IPV6_UNICAST_HOPS 16
108 #define IPV6_MULTICAST_IF 17
109 #define IPV6_MULTICAST_HOPS 18
110 #define IPV6_MULTICAST_LOOP 19
111 #define IPV6_ADD_MEMBERSHIP 20
112 #define IPV6_DROP_MEMBERSHIP 21
113 #define IPV6_ROUTER_ALERT 22
115 #define SCM_SRCRT IPV6_RXSRCRT
117 #define IPV6_RXHOPOPTS IPV6_HOPOPTS /* obsolete name */
118 #define IPV6_RXDSTOPTS IPV6_DSTOPTS /* obsolete name */
120 /* IPV6_MTU_DISCOVER values. */
121 #define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */
122 #define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */
123 #define IPV6_PMTUDISC_DO 2 /* Always DF. */
125 /* Socket level values for IPv6. */
127 #define SOL_ICMPV6 58