STRUCT BATADV_HARD_IFACE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct batadv_hard_iface (9) πŸ’–

okay so this is the Kernel API Manual, section 9, and today's main character is struct batadv_hard_iface β€” literally the struct that says "yeah this network device? she's known to batman-adv." no cap.


🌸 NAME 🌸

struct batadv_hard_iface β€” network device known to batman-adv

like, the whole personality of this page is just: a struct describing a net device that batman-adv has claimed as one of its own. periodt.


✨ SYNOPSIS ✨

struct batadv_hard_iface {
    char if_status;
    u8 num_bcasts;
    struct net_device *net_dev;
    netdevice_tracker dev_tracker;
    struct kref refcount;
    struct packet_type batman_adv_ptype;
    struct net_device *mesh_iface;
    netdevice_tracker meshif_dev_tracker;
    struct rcu_head rcu;
    u8 hop_penalty;
    struct batadv_hard_iface_bat_iv bat_iv;
  #ifdef CONFIG_BATMAN_ADV_BATMAN_V;
    struct batadv_hard_iface_bat_v bat_v;
  #endif;
    struct hlist_head neigh_list;
    spinlock_t neigh_list_lock;
};

look at her. iconic. πŸŽ€ (and yes, that #ifdef CONFIG_BATMAN_ADV_BATMAN_V is doing her own thing inside the struct, we love a conditional queen.)


πŸ¦‹ Members πŸ¦‹

okay bestie let's do a vibe check on every single field, because we're not skipping any of them, obviously:

  • if_status β€” status of the interface for batman-adv πŸ‘‘
  • num_bcasts β€” number of payload re-broadcasts on this interface (ARQ). yes, ARQ is the whole reason this number exists.
  • net_dev β€” pointer to the net_device
  • dev_tracker β€” device tracker for net_dev 🫢 (she's keeping tabs, as she should)
  • refcount β€” number of contexts the object is used
  • batman_adv_ptype β€” packet type describing packets that should be processed by batman-adv for this interface πŸ“¦
  • mesh_iface β€” the batman-adv interface which uses this network interface
  • meshif_dev_tracker β€” device tracker for mesh_iface
  • rcu β€” struct used for freeing in an RCU-safe manner. very demure, very careful with memory ✨
  • hop_penalty β€” penalty which will be applied to the tq-field of an OGM received via this interface πŸ’€ (yes, the received OGM gets penalized, that's just how it is)
  • bat_iv β€” per hard-interface B.A.T.M.A.N. IV data
  • bat_v β€” per hard-interface B.A.T.M.A.N. V data πŸ”₯
  • neigh_list β€” list of unique single hop neighbors via this interface
  • neigh_list_lock β€” lock protecting neigh_list πŸ”’ (don't touch the list without her, fr fr)

πŸ” SEE ALSO πŸ”

Kernel file ./net/batman-adv/types.h, plus the whole entire extended friend group β€” like genuinely the full group chat, nobody gets left out:

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_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_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)

like… that's the whole roster. iykyk. 🌈


ngl bestie, this is a kernel struct page β€” read it as a map of the fields, not as instructions you run. no commands here, just the anatomy of a hard interface. 🧚

anyway that's the page!! shipped from ./net/batman-adv, dated October 2026, and yes the title at the very top is struct batadv_hard_iface(9) β€” slay, bye πŸ’…πŸ’œ

πŸ“¦ where this page comes from