Scroll to navigation

IPPROTO_IP(2const) IPPROTO_IP(2const)

NAME

IPPROTO_IP - include a user-supplied IP header

LIBRARY

Standard C library (libc-lc)

SYNOPSIS

#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));

DESCRIPTION

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.

ERRORS

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

HISTORY

Linux 2.0.

SEE ALSO

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

2025-11-25 Linux man-pages (unreleased)