IPPROTO_IP(2const)

NAME
IPPROTO_IP - Linux IPv4 protocol socket options

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, int opt,
               const void val[size], size_t size);
int getsockopt(int sockfd, IPPROTO_IP, int opt,
               void val[size], size_t size);

DESCRIPTION
IP supports some protocol-specific socket options that can be set with setsockopt(2) and read with getsockopt(2). The socket option level for IP is IPPROTO_IP.

The following socket options are supported.

IP_ADD_MEMBERSHIP(2const)
IP_ADD_SOURCE_MEMBERSHIP(2const)
IP_BIND_ADDRESS_NO_PORT(2const)
IP_BLOCK_SOURCE(2const)
IP_DROP_MEMBERSHIP(2const)
IP_DROP_SOURCE_MEMBERSHIP(2const)
IP_FREEBIND(2const)
IP_HDRINCL(2const)
IP_LOCAL_PORT_RANGE(2const)
IP_MSFILTER(2const)
IP_MTU(2const)
IP_MTU_DISCOVER(2const)
IP_MULTICAST_ALL(2const)
IP_MULTICAST_IF(2const)
IP_MULTICAST_LOOP(2const)
IP_MULTICAST_TTL(2const)
IP_NODEFRAG(2const)
IP_OPTIONS(2const)
IP_PASSSEC(2const)
IP_PKTINFO(2const)
IP_RECVERR(2const)
IP_RECVOPTS(2const)
IP_RECVORIGDSTADDR(2const)
IP_RECVTOS(2const)
IP_RECVTTL(2const)
IP_RETOPTS(2const)
IP_ROUTER_ALERT(2const)
IP_TOS(2const)
IP_TRANSPARENT(2const)
IP_TTL(2const)
IP_UNBLOCK_SOURCE(2const)

ERRORS
See setsockopt(2). See ip(7).

ENOPROTOOPT
    opt is invalid.

HISTORY

IPPROTO_IP
    POSIX.1-2001.

SEE ALSO
setsockopt(2), ip(7)