STRUCT BATADV_DHCP_PACKET(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct batadv_dhcp_packet β€” a Kernel API Manual moment (manual: struct batadv_dhcp_packet(9))

okay so bestie, listen β€” this is the struct batadv_dhcp_packet, and it's literally the BOOTP/DHCP packet header. That's the NAME, that's the whole vibe. It's the shape your bytes have to be in when you're talking DHCP out here in batman-adv land. πŸŽ€


✨ SYNOPSIS ✨

Like, here's the whole layout, every single field, no shortcuts:

struct batadv_dhcp_packet {
    __u8 op;
    __u8 htype;
    __u8 hlen;
    __u8 hops;
    __be32 xid;
    __be16 secs;
    __be16 flags;
    __be32 ciaddr;
    __be32 yiaddr;
    __be32 siaddr;
    __be32 giaddr;
    __u8 chaddr[16];
    __u8 sname[64];
    __u8 file[128];
    __be32 magic;
 };

πŸ¦‹ Members (aka the whole cast, and yes they all ate) πŸ¦‹

  • op β€” the message op code / message type. It's giving "what kind of packet is this".
  • htype β€” hardware address type. what flavour of hardware addr are we dealing with.
  • hlen β€” hardware address length. how long that hardware addr actually is.
  • hops β€” number of relay hops.
  • xid β€” transaction identifier. the little tag that ties a convo together.
  • secs β€” seconds elapsed since the client started trying to boot. the "how long have you been standing there" counter.
  • flags β€” BOOTP/DHCP flags.
  • ciaddr β€” client IP address.
  • yiaddr β€” "your" (client) IP address as assigned by the server. yes the quotes are canon, that's literally the field's whole personality.
  • siaddr β€” IP address of next server to use in bootstrap.
  • giaddr β€” relay agent IP address.
  • chaddr β€” client hardware address.
  • sname β€” optional server host name.
  • file β€” boot file name.
  • magic β€” BOOTP/DHCP magic cookie identifying the start of options. the little "options start HERE" signal, iconic behavior honestly πŸ”₯

🌈 SEE ALSO 🌈

Kernel file ./net/batman-adv/distributed-arp-table.c and, like, an entire friend group of symbols β€” all of them, in order, no one left out:


quick vibe check: every field name, every type, every one of those (9) references above is straight-up load-bearing. don't be out here editing the struct in your head, bestie β€” copy it fr fr. πŸ’€

and that's the page! 🫢 brought to you by ./net/batman-adv, dated October 2026 β€” go off, kernel docs, you ate β­πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from