/* SPDX-License-Identifier: GPL-2.0 */ /* Copyright (C) B.A.T.M.A.N. contributors: * * Marek Lindner, Simon Wunderlich */ #ifndef _NET_BATMAN_ADV_TYPES_H_ #define _NET_BATMAN_ADV_TYPES_H_ #ifndef _NET_BATMAN_ADV_MAIN_H_ #error only "main.h" can be included directly #endif #include <linux/average.h> #include <linux/bitops.h> #include <linux/compiler.h> #include <linux/if.h> #include <linux/if_ether.h> #include <linux/kref.h> #include <linux/mutex.h> #include <linux/netdevice.h> #include <linux/netlink.h> #include <linux/sched.h> /* for linux/wait.h */ #include <linux/skbuff.h> #include <linux/spinlock.h> #include <linux/timer.h> #include <linux/types.h> #include <linux/wait.h> #include <linux/workqueue.h> #include <uapi/linux/batadv_packet.h> #include <uapi/linux/batman_adv.h> #ifdef CONFIG_BATMAN_ADV_DAT /** * typedef batadv_dat_addr_t - type used for all DHT addresses * * If it is changed, BATADV_DAT_ADDR_MAX is changed as well. * * *Please be careful: batadv_dat_addr_t must be UNSIGNED* */ batadv_dat_addr_t; #endif /* CONFIG_BATMAN_ADV_DAT */ /** * enum batadv_dhcp_recipient - dhcp destination */ enum batadv_dhcp_recipient { … }; /** * BATADV_TT_REMOTE_MASK - bitmask selecting the flags that are sent over the * wire only */ #define BATADV_TT_REMOTE_MASK … /** * BATADV_TT_SYNC_MASK - bitmask of the flags that need to be kept in sync * among the nodes. These flags are used to compute the global/local CRC */ #define BATADV_TT_SYNC_MASK … /** * struct batadv_hard_iface_bat_iv - per hard-interface B.A.T.M.A.N. IV data */ struct batadv_hard_iface_bat_iv { … }; /** * enum batadv_v_hard_iface_flags - interface flags useful to B.A.T.M.A.N. V */ enum batadv_v_hard_iface_flags { … }; /** * struct batadv_hard_iface_bat_v - per hard-interface B.A.T.M.A.N. V data */ struct batadv_hard_iface_bat_v { … }; /** * enum batadv_hard_iface_wifi_flags - Flags describing the wifi configuration * of a batadv_hard_iface */ enum batadv_hard_iface_wifi_flags { … }; /** * struct batadv_hard_iface - network device known to batman-adv */ struct batadv_hard_iface { … }; /** * struct batadv_orig_ifinfo_bat_iv - B.A.T.M.A.N. IV private orig_ifinfo * members */ struct batadv_orig_ifinfo_bat_iv { … }; /** * struct batadv_orig_ifinfo - originator info per outgoing interface */ struct batadv_orig_ifinfo { … }; /** * struct batadv_frag_table_entry - head in the fragment buffer table */ struct batadv_frag_table_entry { … }; /** * struct batadv_frag_list_entry - entry in a list of fragments */ struct batadv_frag_list_entry { … }; /** * struct batadv_vlan_tt - VLAN specific TT attributes */ struct batadv_vlan_tt { … }; /** * struct batadv_orig_node_vlan - VLAN specific data per orig_node */ struct batadv_orig_node_vlan { … }; /** * struct batadv_orig_bat_iv - B.A.T.M.A.N. IV private orig_node members */ struct batadv_orig_bat_iv { … }; /** * struct batadv_orig_node - structure for orig_list maintaining nodes of mesh */ struct batadv_orig_node { … }; /** * enum batadv_orig_capabilities - orig node capabilities */ enum batadv_orig_capabilities { … }; /** * struct batadv_gw_node - structure for orig nodes announcing gw capabilities */ struct batadv_gw_node { … }; DECLARE_EWMA(throughput, 10, 8) /** * struct batadv_hardif_neigh_node_bat_v - B.A.T.M.A.N. V private neighbor * information */ struct batadv_hardif_neigh_node_bat_v { … }; /** * struct batadv_hardif_neigh_node - unique neighbor per hard-interface */ struct batadv_hardif_neigh_node { … }; /** * struct batadv_neigh_node - structure for single hops neighbors */ struct batadv_neigh_node { … }; /** * struct batadv_neigh_ifinfo_bat_iv - neighbor information per outgoing * interface for B.A.T.M.A.N. IV */ struct batadv_neigh_ifinfo_bat_iv { … }; /** * struct batadv_neigh_ifinfo_bat_v - neighbor information per outgoing * interface for B.A.T.M.A.N. V */ struct batadv_neigh_ifinfo_bat_v { … }; /** * struct batadv_neigh_ifinfo - neighbor information per outgoing interface */ struct batadv_neigh_ifinfo { … }; #ifdef CONFIG_BATMAN_ADV_BLA /** * struct batadv_bcast_duplist_entry - structure for LAN broadcast suppression */ struct batadv_bcast_duplist_entry { … }; #endif /** * enum batadv_counters - indices for traffic counters */ enum batadv_counters { … }; /** * struct batadv_priv_tt - per mesh interface translation table data */ struct batadv_priv_tt { … }; #ifdef CONFIG_BATMAN_ADV_BLA /** * struct batadv_priv_bla - per mesh interface bridge loop avoidance data */ struct batadv_priv_bla { … }; #endif #ifdef CONFIG_BATMAN_ADV_DEBUG /** * struct batadv_priv_debug_log - debug logging data */ struct batadv_priv_debug_log { … }; #endif /** * struct batadv_priv_gw - per mesh interface gateway data */ struct batadv_priv_gw { … }; /** * struct batadv_priv_tvlv - per mesh interface tvlv data */ struct batadv_priv_tvlv { … }; #ifdef CONFIG_BATMAN_ADV_DAT /** * struct batadv_priv_dat - per mesh interface DAT private data */ struct batadv_priv_dat { … }; #endif #ifdef CONFIG_BATMAN_ADV_MCAST /** * struct batadv_mcast_querier_state - IGMP/MLD querier state when bridged */ struct batadv_mcast_querier_state { … }; /** * struct batadv_mcast_mla_flags - flags for the querier, bridge and tvlv state */ struct batadv_mcast_mla_flags { … }; /** * struct batadv_priv_mcast - per mesh interface mcast data */ struct batadv_priv_mcast { … }; #endif /** * struct batadv_priv_nc - per mesh interface network coding private data */ struct batadv_priv_nc { … }; /** * struct batadv_tp_unacked - unacked packet meta-information * * This struct is supposed to represent a buffer unacked packet. However, since * the purpose of the TP meter is to count the traffic only, there is no need to * store the entire sk_buff, the starting offset and the length are enough */ struct batadv_tp_unacked { … }; /** * enum batadv_tp_meter_role - Modus in tp meter session */ enum batadv_tp_meter_role { … }; /** * struct batadv_tp_vars - tp meter private variables per session */ struct batadv_tp_vars { … }; /** * struct batadv_softif_vlan - per VLAN attributes set */ struct batadv_softif_vlan { … }; /** * struct batadv_priv_bat_v - B.A.T.M.A.N. V per soft-interface private data */ struct batadv_priv_bat_v { … }; /** * struct batadv_priv - per mesh interface data */ struct batadv_priv { … }; #ifdef CONFIG_BATMAN_ADV_BLA /** * struct batadv_bla_backbone_gw - batman-adv gateway bridged into the LAN */ struct batadv_bla_backbone_gw { … }; /** * struct batadv_bla_claim - claimed non-mesh client structure */ struct batadv_bla_claim { … }; #endif /** * struct batadv_tt_common_entry - tt local & tt global common data */ struct batadv_tt_common_entry { … }; /** * struct batadv_tt_local_entry - translation table local entry data */ struct batadv_tt_local_entry { … }; /** * struct batadv_tt_global_entry - translation table global entry data */ struct batadv_tt_global_entry { … }; /** * struct batadv_tt_orig_list_entry - orig node announcing a non-mesh client */ struct batadv_tt_orig_list_entry { … }; /** * struct batadv_tt_change_node - structure for tt changes occurred */ struct batadv_tt_change_node { … }; /** * struct batadv_tt_req_node - data to keep track of the tt requests in flight */ struct batadv_tt_req_node { … }; /** * struct batadv_tt_roam_node - roaming client data */ struct batadv_tt_roam_node { … }; /** * struct batadv_nc_node - network coding node */ struct batadv_nc_node { … }; /** * struct batadv_nc_path - network coding path */ struct batadv_nc_path { … }; /** * struct batadv_nc_packet - network coding packet used when coding and * decoding packets */ struct batadv_nc_packet { … }; /** * struct batadv_skb_cb - control buffer structure used to store private data * relevant to batman-adv in the skb->cb buffer in skbs. */ struct batadv_skb_cb { … }; /** * struct batadv_forw_packet - structure for bcast packets to be sent/forwarded */ struct batadv_forw_packet { … }; /** * struct batadv_algo_iface_ops - mesh algorithm callbacks (interface specific) */ struct batadv_algo_iface_ops { … }; /** * struct batadv_algo_neigh_ops - mesh algorithm callbacks (neighbour specific) */ struct batadv_algo_neigh_ops { … }; /** * struct batadv_algo_orig_ops - mesh algorithm callbacks (originator specific) */ struct batadv_algo_orig_ops { … }; /** * struct batadv_algo_gw_ops - mesh algorithm callbacks (GW specific) */ struct batadv_algo_gw_ops { … }; /** * struct batadv_algo_ops - mesh algorithm callbacks */ struct batadv_algo_ops { … }; /** * struct batadv_dat_entry - it is a single entry of batman-adv ARP backend. It * is used to stored ARP entries needed for the global DAT cache */ struct batadv_dat_entry { … }; /** * struct batadv_hw_addr - a list entry for a MAC address */ struct batadv_hw_addr { … }; /** * struct batadv_dat_candidate - candidate destination for DAT operations */ struct batadv_dat_candidate { … }; /** * struct batadv_tvlv_container - container for tvlv appended to OGMs */ struct batadv_tvlv_container { … }; /** * struct batadv_tvlv_handler - handler for specific tvlv type and version */ struct batadv_tvlv_handler { … }; /** * enum batadv_tvlv_handler_flags - tvlv handler flags definitions */ enum batadv_tvlv_handler_flags { … }; #endif /* _NET_BATMAN_ADV_TYPES_H_ */