diff options
author | Marek Lindner | 2015-08-04 15:09:55 +0200 |
---|---|---|
committer | Antonio Quartulli | 2015-12-15 17:21:41 +0100 |
commit | cef63419f7dbd52e535d1932a88904b3facb1546 (patch) | |
tree | 166cd7f6ab64dd82b1be76e24a3c14c23a6cb496 /net/batman-adv/types.h | |
parent | Doc: update email address (diff) | |
download | kernel-qcow2-linux-cef63419f7dbd52e535d1932a88904b3facb1546.tar.gz kernel-qcow2-linux-cef63419f7dbd52e535d1932a88904b3facb1546.tar.xz kernel-qcow2-linux-cef63419f7dbd52e535d1932a88904b3facb1546.zip |
batman-adv: add list of unique single hop neighbors per hard-interface
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Diffstat (limited to 'net/batman-adv/types.h')
-rw-r--r-- | net/batman-adv/types.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index d260efd70499..71c7d9f1f79f 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h @@ -100,6 +100,8 @@ struct batadv_hard_iface_bat_iv { * @bat_iv: BATMAN IV specific per hard interface data * @cleanup_work: work queue callback item for hard interface deinit * @debug_dir: dentry for nc subdir in batman-adv directory in debugfs + * @neigh_list: list of unique single hop neighbors via this interface + * @neigh_list_lock: lock protecting neigh_list */ struct batadv_hard_iface { struct list_head list; @@ -115,6 +117,9 @@ struct batadv_hard_iface { struct batadv_hard_iface_bat_iv bat_iv; struct work_struct cleanup_work; struct dentry *debug_dir; + struct hlist_head neigh_list; + /* neigh_list_lock protects: neigh_list */ + spinlock_t neigh_list_lock; }; /** @@ -341,6 +346,23 @@ struct batadv_gw_node { }; /** + * batadv_hardif_neigh_node - unique neighbor per hard interface + * @list: list node for batadv_hard_iface::neigh_list + * @addr: the MAC address of the neighboring interface + * @if_incoming: pointer to incoming hard interface + * @refcount: number of contexts the object is used + * @rcu: struct used for freeing in a RCU-safe manner + */ +struct batadv_hardif_neigh_node { + struct hlist_node list; + u8 addr[ETH_ALEN]; + struct batadv_hard_iface *if_incoming; + unsigned long last_seen; + atomic_t refcount; + struct rcu_head rcu; +}; + +/** * struct batadv_neigh_node - structure for single hops neighbors * @list: list node for batadv_orig_node::neigh_list * @orig_node: pointer to corresponding orig_node |