STRUCT DCCP_HDR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct dccp_hdr(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual entry for struct dccp_hdr β€” no cap, this is the ✨generic✨ part of the DCCP packet header, and we're gonna get into it. πŸ¦‹


🌸 NAME 🌸

struct dccp_hdr β€” the generic part of a DCCP packet header. that's it, that's the vibe. πŸ’–


✨ SYNOPSIS ✨

here's the icon itself, in all her bitfield glory. copying it exactly because we do not mess with the source, periodt:

struct dccp_hdr {
    __be16 dccph_sport, dccph_dport;
    __u8 dccph_doff;
  #if defined(__LITTLE_ENDIAN_BITFIELD);
    __u8 dccph_cscov:4, dccph_ccval:4;
  #elif defined(__BIG_ENDIAN_BITFIELD);
    __u8 dccph_ccval:4, dccph_cscov:4;
  #else;
  #error Adjustyour<asm/byteorder.h>defines";"
  #endif;
    __sum16 dccph_checksum;
  #if defined(__LITTLE_ENDIAN_BITFIELD);
    __u8 dccph_x:1, dccph_type:4, dccph_reserved:3;
  #elif defined(__BIG_ENDIAN_BITFIELD);
    __u8 dccph_reserved:3, dccph_type:4, dccph_x:1;
  #else;
  #error Adjustyour<asm/byteorder.h>defines";"
  #endif;
    __u8 dccph_seq2;
    __be16 dccph_seq;
 };
πŸ‘€ quick vibe check: those two #error lines are literally the struct telling you to adjust your <asm/byteorder.h> defines if neither endianness bitfield macro is set. it's giving "fix your build, bestie." 😭

πŸŽ€ Members πŸŽ€

πŸ’œ Description πŸ’œ

here's the member-by-member breakdown, main character energy only:

  • dccph_sport β€” the relevant port on the endpoint that sent this packet 🫢
  • dccph_dport β€” the relevant port on the other endpoint
  • dccph_doff β€” Data Offset from the start of the DCCP header, measured in 32-bit words
  • dccph_ccval β€” used by the HC-Sender CCID ⭐
  • dccph_cscov β€” the parts of the packet that are covered by the Checksum field
  • dccph_checksum β€” the Internet checksum, which depends on dccph_cscov πŸ”₯
  • dccph_x β€” 0 = 24 bit sequence number, 1 = 48 πŸ¦‹
  • dccph_type β€” packet type, see the DCCP_PKT_ prefixed macros πŸ‘‘
  • dccph_seq β€” sequence number high or low order 24 bits, depends on dccph_x
πŸ™ˆ side eye to dccph_reserved and dccph_seq2 for sitting in the struct and not getting a description. we see you. we love you anyway. πŸ’…

also lowkey obsessed with how the endian branches just swap the bitfield order β€” little endian gets dccph_cscov:4, dccph_ccval:4 and big endian gets dccph_ccval:4, dccph_cscov:4. same for dccph_x:1, dccph_type:4, dccph_reserved:3 vs dccph_reserved:3, dccph_type:4, dccph_x:1. iykyk. 🌈


🧚 SEE ALSO 🧚

go read the kernel file ./include/uapi/linux/dccp.h fr fr, and then these iconic siblings:

  • struct dccp_hdr_ext(9)
  • struct dccp_hdr_request(9)
  • struct dccp_hdr_ack_bits(9)
  • struct dccp_hdr_response(9)
  • struct dccp_hdr_reset(9)

and that's the whole page, bestie!! πŸ’– this little beauty lives in ./include/uapi/linux, dated October 2026, and it will forever be known as struct dccp_hdr(9). slay. πŸŽ€βœ¨

πŸ“¦ where this page comes from