STRUCT BATADV_ORIG_NODE(9)
π 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 interfacelast_bonding_candidateβ pointer to the last ifinfo of the last used routerdat_addrβ address of the orig node in the distributed hash (only exists whenCONFIG_BATMAN_ADV_DATis on)last_seenβ time when the last packet from this node was received β°bcast_seqno_resetβ time when the broadcast seqno window was resetmcast_handler_lockβ synchronizes mcast-capability and -flag changes (mcast build only)mcast_flagsβ multicast flags announced by the orig nodemcast_want_all_unsnoopables_nodeβ a list node for themcast.want_all_unsnoopableslistmcast_want_all_ipv4_nodeβ a list node for themcast.want_all_ipv4listmcast_want_all_ipv6_nodeβ a list node for themcast.want_all_ipv6listmcast_want_all_rtr4_nodeβ a list node for themcast.want_all_rtr4listmcast_want_all_rtr6_nodeβ a list node for themcast.want_all_rtr6listcapabilitiesβ announced capabilities of this originator πcapa_initializedβ bitfield to remember whether a capability was initializedlast_ttvnβ last seen translation table version numbertt_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 nodett_buff_lockβ lock that protectstt_buffandtt_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 tolast_bcast_seqno)last_bcast_seqnoβ last broadcast sequence number received by this hostneigh_listβ list of potential next hop neighbor towards this orig node π―neigh_list_lockβ lock protectingneigh_list,ifinfo_list,last_bonding_candidateandrouterhash_entryβ hlist node forbatadv_priv.orig_hashbat_privβ pointer to mesh_iface this orig node belongs tobcast_seqno_lockβ lock protectingbcast_bits&last_bcast_seqnorefcountβ number of contexts the object is usedrcuβ struct used for freeing in an RCU-safe manner π§fragmentsβ array with heads for fragment chainsvlan_listβ a list oforig_node_vlanstructs, one per VLAN served by the originator represented by this objectvlan_list_lockβ lock protectingvlan_listbat_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#ifdefblocks mean some of these members literally don't exist unless your kernel was built withCONFIG_BATMAN_ADV_DATorCONFIG_BATMAN_ADV_MCASTenabled. 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms