From 4046b24aface62f5647699e9af3260a486bc5f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= Date: Fri, 20 Apr 2012 17:02:45 +0200 Subject: batman-adv: Add get_ethtool_stats() support for DAT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added additional counters for D.A.T. Signed-off-by: Martin Hundebøll Signed-off-by: Antonio Quartulli --- net/batman-adv/distributed-arp-table.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'net/batman-adv/distributed-arp-table.h') diff --git a/net/batman-adv/distributed-arp-table.h b/net/batman-adv/distributed-arp-table.h index fdb3522ad516..d060c033e7de 100644 --- a/net/batman-adv/distributed-arp-table.h +++ b/net/batman-adv/distributed-arp-table.h @@ -74,6 +74,28 @@ int batadv_dat_init(struct batadv_priv *bat_priv); void batadv_dat_free(struct batadv_priv *bat_priv); int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset); +/** + * batadv_dat_inc_counter - increment the correct DAT packet counter + * @bat_priv: the bat priv with all the soft interface information + * @subtype: the 4addr subtype of the packet to be counted + * + * Updates the ethtool statistics for the received packet if it is a DAT subtype + */ +static inline void batadv_dat_inc_counter(struct batadv_priv *bat_priv, + uint8_t subtype) +{ + switch (subtype) { + case BATADV_P_DAT_DHT_GET: + batadv_inc_counter(bat_priv, + BATADV_CNT_DAT_GET_RX); + break; + case BATADV_P_DAT_DHT_PUT: + batadv_inc_counter(bat_priv, + BATADV_CNT_DAT_PUT_RX); + break; + } +} + #else static inline bool @@ -135,6 +157,11 @@ static inline void batadv_dat_free(struct batadv_priv *bat_priv) { } +static inline void batadv_dat_inc_counter(struct batadv_priv *bat_priv, + uint8_t subtype) +{ +} + #endif /* CONFIG_BATMAN_ADV_DAT */ #endif /* _NET_BATMAN_ADV_ARP_H_ */ -- cgit v1.2.3