aboutsummaryrefslogtreecommitdiff
path: root/net/batman-adv/distributed-arp-table.h
diff options
context:
space:
mode:
authorMartin Hundebøll <martin@hundeboll.net>2012-04-20 17:02:45 +0200
committerAntonio Quartulli <ordex@autistici.org>2012-11-07 20:00:23 +0100
commit4046b24aface62f5647699e9af3260a486bc5f49 (patch)
tree82e7fe03be17690b109fb3fff82e83fb63ef28cd /net/batman-adv/distributed-arp-table.h
parent33af49ad8ae44de52c0ac30b1a9707dad5e4c418 (diff)
batman-adv: Add get_ethtool_stats() support for DAT
Added additional counters for D.A.T. Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/distributed-arp-table.h')
-rw-r--r--net/batman-adv/distributed-arp-table.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/net/batman-adv/distributed-arp-table.h b/net/batman-adv/distributed-arp-table.h
index fdb3522ad51..d060c033e7d 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_ */