| 1 |
.\" Copyright, the authors of the Linux man-pages project |
| 2 |
.\" |
| 3 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 4 |
.\" |
| 5 |
.TH IPPROTO_IP 2const 2025-11-25 "Linux man-pages 6.18" |
| 6 |
.SH NAME |
| 7 |
IPPROTO_IP |
| 8 |
\- |
| 9 |
include a user-supplied IP header |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.BR "#include <netinet/in.h>" " /* Definition of " IP* " constants */" |
| 16 |
.B #include <sys/socket.h> |
| 17 |
.P |
| 18 |
.BI int\~setsockopt(int\~ sockfd ,\~IPPROTO_IP,\~IP_HDRINCL, |
| 19 |
.BI " const\~int\~*" enable ,\~sizeof(int)); |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
If enabled, |
| 23 |
the user supplies an IP header in front of the user data. |
| 24 |
.P |
| 25 |
Valid only for |
| 26 |
.B SOCK_RAW |
| 27 |
sockets; |
| 28 |
see |
| 29 |
.BR raw (7) |
| 30 |
for more information. |
| 31 |
.P |
| 32 |
When this flag is enabled, |
| 33 |
the values set by |
| 34 |
.BR IP_OPTIONS (2const), |
| 35 |
.BR IP_TTL (2const), |
| 36 |
and |
| 37 |
.BR IP_TOS (2const) |
| 38 |
are ignored. |
| 39 |
.SH ERRORS |
| 40 |
See |
| 41 |
.BR IPPROTO_IP (2const). |
| 42 |
See |
| 43 |
.BR setsockopt (2). |
| 44 |
See |
| 45 |
.BR ip (7). |
| 46 |
.SH HISTORY |
| 47 |
Linux 2.0. |
| 48 |
.SH SEE ALSO |
| 49 |
.BR IPPROTO_IP (2const), |
| 50 |
.BR setsockopt (2), |
| 51 |
.BR ip (7) |