STRUCT BATADV_ALGO_NEIGH_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct batadv_algo_neigh_ops(9) β€” welcome to the Kernel API Manual, bestie πŸŽ€

Okay so picture this: you're deep in the Kernel API Manual, right, and you hit struct batadv_algo_neigh_ops β€” yes the title's got a lil' truncation thing going on (struct batad...go_neigh_ops(9)) but don't let that jump scare you, it's literally just the long name being shy. This is the mesh algorithm callbacks struct, and it's specifically the neighbour specific one. Neighbour-specific callback energy only. Periodt. ✨


🌸 NAME 🌸

struct batadv_algo_neigh_ops β€” mesh algorithm callbacks (neighbour specific). That's the whole vibe. It's giving "the function-pointer starter pack for how your mesh algo handles neighbours" πŸ¦‹


⭐ SYNOPSIS ⭐

struct batadv_algo_neigh_ops {
    void (*hardif_init)(struct batadv_hardif_neigh_node *neigh);
    int (*cmp)(struct batadv_neigh_node *neigh1, struct batadv_hard_iface *if_outgoing1, struct batadv_neigh_node *neigh2, struct batadv_hard_iface *if_outgoing2);
    bool (*is_similar_or_better)(struct batadv_neigh_node *neigh1, struct batadv_hard_iface *if_outgoing1, struct batadv_neigh_node *neigh2, struct batadv_hard_iface *if_outgoing2);
    void (*dump)(struct sk_buff *msg, struct netlink_callback *cb, struct batadv_priv *priv, struct batadv_hard_iface *hard_iface);
 };

Look at those four little function pointers living their best lives 🫢 Copy them exactly if you're writing code, bestie β€” no cap, character for character.


πŸ¦‹ Members πŸ¦‹

Aka the main characters, one by one πŸ’–

  • hardif_init β€” called on creation of single hop entry. It's optional, so if you don't feel like implementing it, honestly valid πŸ™ˆ
  • cmp β€” compare the metrics of two neighbors for their respective outgoing interfaces. It's the "who's doing better" showdown πŸ‘‘
  • is_similar_or_better β€” check if neigh1 is equally similar or better than neigh2 for their respective outgoing interface from the metric prospective. Yes, "prospective" β€” that's the original wording, we don't touch the wording, we just appreciate it 😭
  • dump β€” dump neighbors to a netlink socket. Also optional β€” so it's giving "nice to have, not a must" ✨

πŸ”₯ SEE ALSO πŸ”₯

Hiii okay this is the part where the man page just drops the entire friend group on you at once πŸ’€ First up, the actual place this struct lives:

  • Kernel file ./net/batman-adv/types.h

And now, the full guest list β€” every single one, in order, because we don't skip anyone at this party πŸŽ€

  • 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_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_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 friend group chat right there 😭 screenshot it, study it, iykyk πŸ’œ


Lowkey important reminder: hardif_init and dump are both marked optional in the Members list β€” that's straight from the page, not me guessing. Don't come for me if you assumed otherwise πŸ™ˆ

And that's the page, bestie β€” this lil' number comes to you from ./net/batman-adv, dated October 2026, and yes the header still reads struct batad...go_neigh_ops(9) at the top and the bottom because the man page is committed to the bit πŸ’€ slay, honestly. Mwah πŸ’‹πŸ’–

πŸ“¦ where this page comes from