IPPROTO_IP(2const)

πŸ“¦
version 6.20 Β· 4 versions
, in arch rolling, nixpkgs unstable

✨ 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 🌈:

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 β€” opt is 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