Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 167c37add861a1f7c1641df078e0cdbf32556945
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sun Oct 14 16:54:31 2012 +0200
batctl: add support for the DAT local table
With the introduction of DAT in batman-adv, another table is now exported
through debugfs. This patch adds the possibility to print it
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
167c37add861a1f7c1641df078e0cdbf32556945
README | 18 ++++++++++++++++++
debug.c | 5 +++++
debug.h | 1 +
functions.c | 1 +
man/batctl.8 | 3 +++
5 files changed, 28 insertions(+)
diff --git a/README b/README
index 03d36c4..5e58452 100644
--- a/README
+++ b/README
@@ -408,6 +408,24 @@ where:
If any of the flags is not enabled, a '.' will substitute its symbol.
+batctl dat_cache
+=================
+
+display the local D.A.T. cache
+
+Usage batctl dat_cache|dc
+
+Example:
+
+Distributed ARP Table (bat0):
+ IPv4 MAC last-seen
+ * 172.100.0.1 b6:9b:d0:ea:b1:13 0:00
+
+where:
+- IPv4 is the IP address of a client in the mesh network
+- MAC is the MAC address associated to that IP
+- last-seen is the amount of time since last refresh of this entry
+
batctl vis_mode
=================
diff --git a/debug.c b/debug.c
index 9b5146f..a230a12 100644
--- a/debug.c
+++ b/debug.c
@@ -64,6 +64,11 @@ const struct debug_table_data batctl_debug_tables[BATCTL_TABLE_NUM] = {
.opt_short = "bbt",
.debugfs_name = "bla_backbone_table",
},
+ {
+ .opt_long = "dat_cache",
+ .opt_short = "dc",
+ .debugfs_name = "dat_cache",
+ },
};
void debug_table_usage(int debug_table)
diff --git a/debug.h b/debug.h
index 6068c2c..4e935cb 100644
--- a/debug.h
+++ b/debug.h
@@ -31,6 +31,7 @@ enum batctl_debug_tables {
BATCTL_TABLE_TRANSGLOBAL,
BATCTL_TABLE_BLA_CLAIMS,
BATCTL_TABLE_BLA_BACKBONES,
+ BATCTL_TABLE_DAT,
BATCTL_TABLE_NUM,
};
diff --git a/functions.c b/functions.c
index e095fd0..0d88137 100644
--- a/functions.c
+++ b/functions.c
@@ -48,6 +48,7 @@ const char *fs_compile_out_param[] = {
batctl_settings[BATCTL_SETTINGS_BLA].sysfs_name,
batctl_debug_tables[BATCTL_TABLE_BLA_CLAIMS].debugfs_name,
batctl_debug_tables[BATCTL_TABLE_BLA_BACKBONES].debugfs_name,
+ batctl_debug_tables[BATCTL_TABLE_DAT].debugfs_name,
NULL,
};
diff --git a/man/batctl.8 b/man/batctl.8
index ab02e9a..310b43f 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -187,6 +187,9 @@ List of debug tables:
.RS 10
\- backbonetable|bbt (compile time option)
.RE
+.RS 10
+\- datcache|dc (compile time option)
+.RE
.RE
.br
.IP "\fBstatistics\fP|\fBs\fP"
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 2b105ca9d1ec396aa8bbdcc472d89fdc9563ca62
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Tue Oct 9 15:00:11 2012 +0200
batman-adv: fix DAT packet counting
DAT packets must be counted before any batadv_dat_snoop_incoming_* invocation
otherwise the counters may not be incremented at all
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
2b105ca9d1ec396aa8bbdcc472d89fdc9563ca62
routing.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/routing.c b/routing.c
index e146370..96375c5 100644
--- a/routing.c
+++ b/routing.c
@@ -1061,6 +1061,10 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
/* packet for me */
if (batadv_is_my_mac(unicast_packet->dest)) {
+ if (is4addr)
+ batadv_dat_inc_counter(bat_priv,
+ unicast_4addr_packet->subtype);
+
if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb,
hdr_size))
goto rx_success;
@@ -1068,10 +1072,6 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
hdr_size))
goto rx_success;
- if (is4addr)
- batadv_dat_inc_counter(bat_priv,
- unicast_4addr_packet->subtype);
-
batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size,
NULL);