ENUM SOCK_TYPE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ enum sock_type(9) β€” the Kernel API Manual, but make it make sense

okay bestie, sit down, hydrate, because we're talking about enum sock_type β€” the lil ✨iconic✨ list of socket types from the kernel API manual, and honestly? it's giving "short but powerful." no cap.


🌸 NAME 🌸

enum sock_type β€” socket types. that's it. that's the whole name. short, sweet, and absolutely load-bearing. 🫢


✨ SYNOPSIS ✨

here's the whole squad, exactly as written, no edits, no notes:

enum sock_type {
    SOCK_STREAM ,
    SOCK_DGRAM ,
    SOCK_RAW ,
    SOCK_RDM ,
    SOCK_SEQPACKET ,
    SOCK_DCCP ,
    SOCK_PACKET

};

(and yes, that blank line before the closing brace is canon, we respect the source material in this house πŸ’…)


πŸŽ€ Constants πŸŽ€

every member, one by one, with zero skips because we don't do that here:

  • SOCK_STREAM β€” stream (connection) socket. the classic reliable-connection girlie πŸ’–
  • SOCK_DGRAM β€” datagram (conn.less) socket. connectionless, free-spirited, sends it and moves on πŸ¦‹
  • SOCK_RAW β€” raw socket. no filter, no chill, straight to the metal πŸ”₯
  • SOCK_RDM β€” reliably-delivered message. exactly what it says on the tin, bestie πŸ’Œ
  • SOCK_SEQPACKET β€” sequential packet socket. packets, but in order, because chaos isn't always the vibe ⭐
  • SOCK_DCCP β€” Datagram Congestion Control Protocol socket. datagram energy but with congestion control, highkey sophisticated πŸ‘‘
  • SOCK_PACKET β€” linux specific way of getting packets at the dev level. for writing rarp and other similar things on the user level. lowkey the reckless one of the group πŸ™ˆ

🌈 Description 🌈

okay so real talk, this is the part where the kernel maintainers basically leave a note on the fridge for future you:

When adding some new socket type please grep ARCH_HAS_SOCKET_TYPE include/asm-* /socket.h, at least MIPS overrides this enum for binary compat reasons.

fr fr, that's the whole description β€” but it's an important one!! if you're out here adding a brand new socket type like it's a new emoji, you gotta go grep for ARCH_HAS_SOCKET_TYPE across include/asm-* /socket.h first. and why? because at least MIPS overrides this enum for binary compat reasons. so like… don't just yeet a new constant in there and call it a day, the MIPS girlies need their binary compat intact 😭


🧚 SEE ALSO 🧚

go click around, bestie, there's lore in here:

  • Kernel file ./include/linux/net.h struct sockopt(9)
  • enum sock_shutdown_cmd(9)
  • struct socket(9)

anyway, that's the page πŸ’… stay hydrated, read your headers, and remember: adding socket types is a group project, not a solo era.

🫢 this little transmission came straight out of ./include/linux, dated October 2026, and it's filed under enum sock_type(9). mwah, go touch grass (or a socket) πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from