STRUCT BATADV_NEIGH_NODE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ struct batadv_neigh_node β€” the kernel API manual, page (9)

okay so bestie, this page lives in the Kernel API Manual and it's literally all about struct batadv_neigh_node. yes we're doing kernel structs today, drink some water first πŸ’–


✨ NAME

struct batadv_neigh_node β€” the structure that holds your single-hop neighbors. one hop, no cap, that's the whole vibe πŸŽ€


🌸 SYNOPSIS

struct batadv_neigh_node {
    struct hlist_node list;
  #ifdef CONFIG_BATMAN_ADV_BATMAN_V;
    struct batadv_orig_node *orig_node_id;
  #endif;
    u8 addr[ETH_ALEN];
    struct hlist_head ifinfo_list;
    spinlock_t ifinfo_lock;
    struct batadv_hard_iface *if_incoming;
    unsigned long last_seen;
    struct batadv_hardif_neigh_node *hardif_neigh;
    struct kref refcount;
    struct rcu_head rcu;
 };

like look at her. she's serving fields. she's iconic. let's go through every single one because we do not skip πŸ’…


πŸ‘‘ Members

  • list β€” the list node for batadv_orig_node.neigh_list. honestly just a linked-list girly doing her job πŸ¦‹
  • orig_node_id β€” pointer to the corresponding orig_node. warning bestie, this is the important part: it must only be used to identify the node and must NEVER be dereferenced. the reference counter was not increased when this was assigned, because doing that would otherwise create a reference cycle. so like… look respectfully, don't touch πŸ™ˆ
  • addr β€” the MAC address of the neighboring interface. her literal identity ✨
  • ifinfo_list β€” list for routing metrics per outgoing interface. metrics for days πŸ“
  • ifinfo_lock β€” the lock protecting ifinfo_list and its members. no concurrent nonsense allowed, periodt πŸ”’
  • if_incoming β€” pointer to the incoming hard-interface πŸ”₯
  • last_seen β€” when the last packet via this neighbor was received. timestamp queen πŸ‘‘
  • hardif_neigh β€” the hardif_neigh of this neighbor 🌈
  • refcount β€” number of contexts the object is used. counting her commitments fr fr πŸ’œ
  • rcu β€” struct used for freeing in an RCU-safe manner. clean exit, no drama, love that for her 🧚

πŸ’€ SEE ALSO

Kernel file ./net/batman-adv/types.h, plus the whole extended friend group (and yes, everybody's invited, it's a group chat):

  • 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)
  • struct batadv_orig_node(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_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)

lowkey a whole ecosystem in here. read the neighbors, respect the neighbors, never dereference orig_node_id. iykyk πŸ’…

and that's the page, bestie 🫢 this cutie came out of ./net/batman-adv, dated October 2026, and she ate. no crumbs. periodt πŸ’–βœ¨

πŸ“¦ where this page comes from