IPPROTO_IP(2const) IPPROTO_IP(2const)

IPPROTO_IP - include a user-supplied IP header

Standard C library (libc-lc)

#include <netinet/in.h>  /* Definition of IP* constants */
#include <sys/socket.h>
int setsockopt(int sockfd, IPPROTO_IP, IP_HDRINCL,
               const int *enable, sizeof(int));

If enabled, the user supplies an IP header in front of the user data.

Valid only for SOCK_RAW sockets; see raw(7) for more information.

When this flag is enabled, the values set by IP_OPTIONS(2const), IP_TTL(2const), and IP_TOS(2const) are ignored.

See IPPROTO_IP(2const). See setsockopt(2). See ip(7).

Linux 2.0.

IPPROTO_IP(2const), setsockopt(2), ip(7)

2025-11-25 Linux man-pages 6.17