IPPROTO_IP(2const)
β¨ IPPROTO_IP β the Linux IPv4 protocol socket options page (section 2const) β¨
okay bestie so this is IPPROTO_IP(2const) and it's literally your cheat-sheet page for the socket options that the IPv4 protocol layer keeps in its back pocket π it's short, it's sweet, it's a table of contents with main character energy π
πΈ 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 π
so IP lowkey has its own little collection of protocol-specific socket options, and you set them with setsockopt(2) and read them back with getsockopt(2), no cap. the socket option level you pass for all of these is IPPROTO_IP. periodt.
and here's every single one of them that's supported β each one has its own whole separate page, so this is basically the group chat roster and you go DM them individually π:
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)
thirty-one icons. we love to see it. π
π ERRORS π
check setsockopt(2), and also check ip(7) β that's where the rest of the lore lives, bestie.
ENOPROTOOPTβoptis invalid. that's it, that's the whole vibe, you passed something that isn't a real option π
π HISTORY π
IPPROTO_IPβ POSIX.1-2001. literally an elder, been iconic since forever π
π¦ SEE ALSO π¦
and that's the page, bestie π₯° this one's from Linux man-pages 6.20, dated 2026-01-05 β go forth and setsockopt responsibly, mwah ππ
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms