Debian Codegraph @

upstream/debian-unstable/man2/IPPROTO_IP.2const

raw
1 .\" Copyright, the authors of the Linux man-pages project
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .\" FIXME The following socket options are yet to be documented
6 .\"
7 .\" IP_XFRM_POLICY (2.5.48)
8 .\" Needs CAP_NET_ADMIN
9 .\"
10 .\" IP_IPSEC_POLICY (2.5.47)
11 .\" Needs CAP_NET_ADMIN
12 .\"
13 .\" IP_MINTTL (2.6.34)
14 .\" commit d218d11133d888f9745802146a50255a4781d37a
15 .\" Author: Stephen Hemminger <[email protected]>
16 .\"
17 .\" MCAST_JOIN_GROUP (2.4.22 / 2.6)
18 .\"
19 .\" MCAST_BLOCK_SOURCE (2.4.22 / 2.6)
20 .\"
21 .\" MCAST_UNBLOCK_SOURCE (2.4.22 / 2.6)
22 .\"
23 .\" MCAST_LEAVE_GROUP (2.4.22 / 2.6)
24 .\"
25 .\" MCAST_JOIN_SOURCE_GROUP (2.4.22 / 2.6)
26 .\"
27 .\" MCAST_LEAVE_SOURCE_GROUP (2.4.22 / 2.6)
28 .\"
29 .\" MCAST_MSFILTER (2.4.22 / 2.6)
30 .\"
31 .\" IP_UNICAST_IF (3.4)
32 .\" commit 76e21053b5bf33a07c76f99d27a74238310e3c71
33 .\" Author: Erich E. Hoover <[email protected]>
34 .\"
35 .TH IPPROTO_IP 2const 2026-01-05 "Linux man-pages 6.18"
36 .SH NAME
37 IPPROTO_IP
38 \-
39 Linux IPv4 protocol socket options
40 .SH LIBRARY
41 Standard C library
42 .RI ( libc ,\~ \-lc )
43 .SH SYNOPSIS
44 .nf
45 .BR "#include <netinet/in.h>" " /* Definition of " IP* " constants */"
46 .B #include <sys/socket.h>
47 .P
48 .BI int\~setsockopt(int\~ sockfd ,\~IPPROTO_IP,\~int\~ opt ,
49 .BI " const\~void\~" val [ size ],\~size_t\~ size );
50 .BI int\~getsockopt(int\~ sockfd ,\~IPPROTO_IP,\~int\~ opt ,
51 .BI " void\~" val [ size ],\~size_t\~ size );
52 .fi
53 .SH DESCRIPTION
54 IP supports some protocol-specific socket options that can be set with
55 .BR setsockopt (2)
56 and read with
57 .BR getsockopt (2).
58 The socket option level for IP is
59 .BR IPPROTO_IP .
60 .\" or SOL_IP on Linux
61 .P
62 The following socket options are supported.
63 .TP
64 .BR IP_ADD_MEMBERSHIP (2const)
65 .TQ
66 .BR IP_ADD_SOURCE_MEMBERSHIP (2const)
67 .TQ
68 .BR IP_BIND_ADDRESS_NO_PORT (2const)
69 .TQ
70 .BR IP_BLOCK_SOURCE (2const)
71 .TQ
72 .BR IP_DROP_MEMBERSHIP (2const)
73 .TQ
74 .BR IP_DROP_SOURCE_MEMBERSHIP (2const)
75 .TQ
76 .BR IP_FREEBIND (2const)
77 .TQ
78 .BR IP_HDRINCL (2const)
79 .TQ
80 .BR IP_LOCAL_PORT_RANGE (2const)
81 .TQ
82 .BR IP_MSFILTER (2const)
83 .TQ
84 .BR IP_MTU (2const)
85 .TQ
86 .BR IP_MTU_DISCOVER (2const)
87 .TQ
88 .BR IP_MULTICAST_ALL (2const)
89 .TQ
90 .BR IP_MULTICAST_IF (2const)
91 .TQ
92 .BR IP_MULTICAST_LOOP (2const)
93 .TQ
94 .BR IP_MULTICAST_TTL (2const)
95 .TQ
96 .BR IP_NODEFRAG (2const)
97 .TQ
98 .BR IP_OPTIONS (2const)
99 .TQ
100 .BR IP_PASSSEC (2const)
101 .TQ
102 .BR IP_PKTINFO (2const)
103 .TQ
104 .BR IP_RECVERR (2const)
105 .TQ
106 .BR IP_RECVOPTS (2const)
107 .TQ
108 .BR IP_RECVORIGDSTADDR (2const)
109 .TQ
110 .BR IP_RECVTOS (2const)
111 .TQ
112 .BR IP_RECVTTL (2const)
113 .TQ
114 .BR IP_RETOPTS (2const)
115 .TQ
116 .BR IP_ROUTER_ALERT (2const)
117 .TQ
118 .BR IP_TOS (2const)
119 .TQ
120 .BR IP_TRANSPARENT (2const)
121 .TQ
122 .BR IP_TTL (2const)
123 .TQ
124 .BR IP_UNBLOCK_SOURCE (2const)
125 .SH ERRORS
126 See
127 .BR setsockopt (2).
128 See
129 .BR ip (7).
130 .TP
131 .B ENOPROTOOPT
132 .I opt
133 is invalid.
134 .\" .SH STANDARDS
135 .\" IP_XFRM_POLICY is Linux-specific
136 .\" IP_IPSEC_POLICY is a nonstandard extension, also present on some BSDs
137 .SH HISTORY
138 .TP
139 .B IPPROTO_IP
140 POSIX.1-2001.
141 .SH SEE ALSO
142 .BR setsockopt (2),
143 .BR ip (7)