STRUCT BATADV_CODED_PACKET(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct batadv_coded_packet(9) β€” network coded packet

Okay bestie, so this is a page straight outta the Kernel API Manual, and it's literally the blueprint for a network coded packet. It's giving "two packets walked into a bar and left as one" energy, and honestly? Iconic. Let's get into it πŸ¦‹


✨ NAME ✨

struct batadv_coded_packet β€” network coded packet. That's it, that's the vibe. Lowkey the whole point of this struct is packing two packets into one coded situation, and I'm obsessed πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

struct batadv_coded_packet {
    __u8 packet_type;
    __u8 version;
    __u8 ttl;
    __u8 first_ttvn;
    __u8 first_source[ETH_ALEN];
    __u8 first_orig_dest[ETH_ALEN];
    __be32 first_crc;
    __u8 second_ttl;
    __u8 second_ttvn;
    __u8 second_dest[ETH_ALEN];
    __u8 second_source[ETH_ALEN];
    __u8 second_orig_dest[ETH_ALEN];
    __be32 second_crc;
    __be16 coded_len;
};

Copy that exactly babe, every field, every type, no freestyling 😀


🌸 Members 🌸

Okay let's go field by field, main-character by main-character:

  • packet_type β€” batman-adv packet type, part of the general header 🫢
  • version β€” batman-adv protocol version, part of the general header
  • ttl β€” time to live for this packet, part of the general header
  • first_ttvn β€” tt-version number of first included packet
  • first_source β€” original source of first included packet
  • first_orig_dest β€” original destination of first included packet
  • first_crc β€” checksum of first included packet
  • second_ttl β€” ttl of second packet
  • second_ttvn β€” tt version number of second included packet
  • second_dest β€” second receiver of this coded packet
  • second_source β€” original source of second included packet
  • second_orig_dest β€” original destination of second included packet
  • second_crc β€” checksum of second included packet
  • coded_len β€” length of network coded part of the payload
Notice how the whole struct is basically two packets holding hands 🀝 first-everything up top, second-everything in the middle, and coded_len tying it all together at the end. The way that structure ATE πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

The kernel file ./include/uapi/linux/batadv_packet.h is where this lives, and here's the whole squad it runs with β€” every single one, no skipping:

  • batadv_tp_is_error(9)
  • enum batadv_packettype(9)
  • enum batadv_subtype(9)
  • enum batadv_iv_flags(9)
  • enum batadv_icmp_packettype(9)
  • enum batadv_mcast_flags(9)
  • enum batadv_tt_data_flags(9)
  • enum batadv_vlan_flags(9)
  • enum batadv_bla_claimframe(9)
  • enum batadv_tvlv_type(9)
  • struct batadv_bla_claim_dst(9)
  • struct batadv_ogm_packet(9)
  • struct batadv_ogm2_packet(9)
  • struct batadv_elp_packet(9)
  • struct batadv_icmp_header(9)
  • struct batadv_icmp_packet(9)
  • struct batadv_icmp_tp_packet(9)
  • enum batadv_icmp_tp_subtype(9)
  • struct batadv_icmp_packet_rr(9)
  • struct batadv_unicast_packet(9)
  • struct batadv_unicast_4addr_packet(9)
  • struct batadv_frag_packet(9)
  • struct batadv_bcast_packet(9)
  • struct batadv_mcast_packet(9)
  • struct batadv_unicast_tvlv_packet(9)
  • struct batadv_tvlv_hdr(9)
  • struct batadv_tvlv_gateway_data(9)
  • struct batadv_tvlv_tt_vlan_data(9)
  • struct batadv_tvlv_tt_data(9)
  • struct batadv_tvlv_tt_change(9)
  • struct batadv_tvlv_roam_adv(9)
  • struct batadv_tvlv_mcast_data(9)
  • struct batadv_tvlv_mcast_tracker(9)

That's the whole page bestie, go forth and code πŸ’œ

Source: ./include/uapi/linux Β· Date: October 2026 Β· fr fr that's the tea β˜•βœ¨

πŸ“¦ where this page comes from