STRUCT BATADV_ORIG_NODE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct batadv_orig_node β€” the mesh's main character πŸ’–

okay bestie, so this is a page from the Kernel API Manual, and today's hyperfixation is struct batadv_orig_node ✨


🌸 NAME 🌸

struct batadv_orig_node β€” the structure for orig_list that maintains the nodes of the mesh πŸ•ΈοΈπŸ’« (yes literally, this is the vibe-check record card for every originator in your mesh, no cap)


πŸ¦‹ SYNOPSIS πŸ¦‹

struct batadv_orig_node {
    u8 orig[ETH_ALEN];
    struct hlist_head ifinfo_list;
    struct batadv_orig_ifinfo *last_bonding_candidate;
  #ifdef CONFIG_BATMAN_ADV_DAT;
    batadv_dat_addr_t dat_addr;
  #endif;
    unsigned long last_seen;
    unsigned long bcast_seqno_reset;
  #ifdef CONFIG_BATMAN_ADV_MCAST;
    spinlock_t mcast_handler_lock;
    u8 mcast_flags;
    struct hlist_node mcast_want_all_unsnoopables_node;
    struct hlist_node mcast_want_all_ipv4_node;
    struct hlist_node mcast_want_all_ipv6_node;
    struct hlist_node mcast_want_all_rtr4_node;
    struct hlist_node mcast_want_all_rtr6_node;
  #endif;
    unsigned long capabilities;
    unsigned long capa_initialized;
    u8 last_ttvn;
    unsigned char *tt_buff;
    u16 tt_buff_len;
    spinlock_t tt_buff_lock;
    spinlock_t tt_lock;
    unsigned long bcast_bits[BITS_TO_LONGS(BATADV_TQ_LOCAL_WINDOW_SIZE)];
    u32 last_bcast_seqno;
    struct hlist_head neigh_list;
    spinlock_t neigh_list_lock;
    struct hlist_node hash_entry;
    struct batadv_priv *bat_priv;
    spinlock_t bcast_seqno_lock;
    struct kref refcount;
    struct rcu_head rcu;
    struct batadv_frag_table_entry fragments[BATADV_FRAG_BUFFER_COUNT];
    struct hlist_head vlan_list;
    spinlock_t vlan_list_lock;
    struct batadv_orig_bat_iv bat_iv;
};

like, look at that. the #ifdefs are giving conditional-compilation couture πŸ’… and the locks? so many locks. protective queen behavior πŸ”’πŸ‘‘


πŸŽ€ Members πŸŽ€

okay so every field, one by one, and what it's actually doing. grab a snack πŸ“

  • orig β€” the originator's ethernet address 🏷️ (the actual identity, the whole point)
  • ifinfo_list β€” list for routers per outgoing interface
  • last_bonding_candidate β€” pointer to the last ifinfo of the last used router
  • dat_addr β€” address of the orig node in the distributed hash (only exists when CONFIG_BATMAN_ADV_DAT is on)
  • last_seen β€” time when the last packet from this node was received ⏰
  • bcast_seqno_reset β€” time when the broadcast seqno window was reset
  • mcast_handler_lock β€” synchronizes mcast-capability and -flag changes (mcast build only)
  • mcast_flags β€” multicast flags announced by the orig node
  • mcast_want_all_unsnoopables_node β€” a list node for the mcast.want_all_unsnoopables list
  • mcast_want_all_ipv4_node β€” a list node for the mcast.want_all_ipv4 list
  • mcast_want_all_ipv6_node β€” a list node for the mcast.want_all_ipv6 list
  • mcast_want_all_rtr4_node β€” a list node for the mcast.want_all_rtr4 list
  • mcast_want_all_rtr6_node β€” a list node for the mcast.want_all_rtr6 list
  • capabilities β€” announced capabilities of this originator πŸ…
  • capa_initialized β€” bitfield to remember whether a capability was initialized
  • last_ttvn β€” last seen translation table version number
  • tt_buff β€” last tt changeset this node received from the orig node πŸ“œ
  • tt_buff_len β€” length of the last tt changeset this node received from the orig node
  • tt_buff_lock β€” lock that protects tt_buff and tt_buff_len πŸ”’
  • tt_lock β€” avoids concurrent read from and write to the table. Table update is made up of two operations (data structure update and metadata -CRC/TTVN-recalculation) and they have to be executed atomically in order to avoid another thread to read the table/metadata between those. πŸ”₯ (fr fr, this one is doing the Lord's work)
  • bcast_bits β€” bitfield containing the info which payload broadcast originated from this orig node this host already has seen (relative to last_bcast_seqno)
  • last_bcast_seqno β€” last broadcast sequence number received by this host
  • neigh_list β€” list of potential next hop neighbor towards this orig node πŸ‘―
  • neigh_list_lock β€” lock protecting neigh_list, ifinfo_list, last_bonding_candidate and router
  • hash_entry β€” hlist node for batadv_priv.orig_hash
  • bat_priv β€” pointer to mesh_iface this orig node belongs to
  • bcast_seqno_lock β€” lock protecting bcast_bits & last_bcast_seqno
  • refcount β€” number of contexts the object is used
  • rcu β€” struct used for freeing in an RCU-safe manner 🧚
  • fragments β€” array with heads for fragment chains
  • vlan_list β€” a list of orig_node_vlan structs, one per VLAN served by the originator represented by this object
  • vlan_list_lock β€” lock protecting vlan_list
  • bat_iv β€” B.A.T.M.A.N. IV private structure

πŸ‘‘ SEE ALSO πŸ‘‘

the manpage says "Kernel file ./net/batman-adv/types.h", and honestly the whole squad is linked from there. here's every single one, because we don't do "etc." in this house πŸ’–

  • batadv_dat_addr_t(9)
  • enum batadv_dhcp_recipient(9)
  • BATADV_TT_REMOTE_MASK(9)
  • BATADV_TT_SYNC_MASK(9)
  • struct batadv_ogm_buf(9)
  • struct batadv_hard_iface_bat_iv(9)
  • enum batadv_v_hard_iface_flags(9)
  • struct batadv_hard_iface_bat_v(9)
  • enum batadv_hard_iface_wifi_flags(9)
  • struct batadv_wifi_net_device_state(9)
  • struct batadv_hard_iface(9)
  • struct batadv_orig_ifinfo_bat_iv(9)
  • struct batadv_orig_ifinfo(9)
  • struct batadv_frag_table_entry(9)
  • struct batadv_frag_list_entry(9)
  • struct batadv_vlan_tt(9)
  • struct batadv_orig_node_vlan(9)
  • struct batadv_orig_bat_iv(9)
  • enum batadv_orig_capabilities(9)
  • struct batadv_gw_node(9)
  • struct batadv_hardif_neigh_node_bat_v(9)
  • struct batadv_hardif_neigh_node(9)
  • struct batadv_neigh_node(9)
  • struct batadv_neigh_ifinfo_bat_iv(9)
  • struct batadv_neigh_ifinfo_bat_v(9)
  • struct batadv_neigh_ifinfo(9)
  • struct batadv_bcast_duplist_entry(9)
  • enum batadv_counters(9)
  • struct batadv_priv_tt(9)
  • struct batadv_priv_bla(9)
  • struct batadv_priv_gw(9)
  • struct batadv_priv_tvlv(9)
  • struct batadv_priv_dat(9)
  • struct batadv_mcast_querier_state(9)
  • struct batadv_mcast_mla_flags(9)
  • struct batadv_priv_mcast(9)
  • struct batadv_tp_unacked(9)
  • struct batadv_tp_vars_common(9)
  • struct batadv_tp_sender_cc(9)
  • struct batadv_tp_sender(9)
  • struct batadv_tp_receiver(9)
  • struct batadv_meshif_vlan(9)
  • struct batadv_priv_bat_v(9)
  • struct batadv_priv(9)
  • enum batadv_bla_backbone_gw_state(9)
  • struct batadv_bla_backbone_gw(9)
  • struct batadv_bla_claim(9)
  • struct batadv_tt_common_entry(9)
  • struct batadv_tt_local_entry(9)
  • struct batadv_tt_global_entry(9)
  • struct batadv_tt_orig_list_entry(9)
  • struct batadv_tt_change_node(9)
  • struct batadv_tt_req_node(9)
  • struct batadv_tt_roam_node(9)
  • struct batadv_skb_cb(9)
  • struct batadv_forw_packet(9)
  • struct batadv_algo_iface_ops(9)
  • struct batadv_algo_neigh_ops(9)
  • struct batadv_algo_orig_ops(9)
  • struct batadv_algo_gw_ops(9)
  • struct batadv_algo_ops(9)
  • struct batadv_dat_entry(9)
  • struct batadv_hw_addr(9)
  • struct batadv_dat_candidate(9)
  • struct batadv_tvlv_container(9)
  • struct batadv_tvlv_handler(9)
  • enum batadv_tvlv_handler_flags(9)

🫢 reminder bestie: this is kernel source, so the #ifdef blocks mean some of these members literally don't exist unless your kernel was built with CONFIG_BATMAN_ADV_DAT or CONFIG_BATMAN_ADV_MCAST enabled. don't go dereferencing a field that isn't there, i'm begging 😭

and that's the whole page!! sourced straight from ./net/batman-adv, dated October 2026 β€” that's the whole sign-off, mwah πŸ’‹βœ¨ go read types.h, it ate πŸ’…

πŸ“¦ where this page comes from