From: mihail.costea2005@gmail.com
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [RFC 3/6] batman-adv: Adds IPv6 to DAT and generic struct in distributed-arp-table.c
Date: Mon, 8 Jul 2013 03:12:42 +0300 [thread overview]
Message-ID: <1373242365-763-3-git-send-email-mihail.costea2005@gmail.com> (raw)
In-Reply-To: <1373242365-763-1-git-send-email-mihail.costea2005@gmail.com>
From: Mihail Costea <mihail.costea90@gmail.com>
Adds IPv6 functionality to the generic struct.
Signed-off-by: Mihail Costea <mihail.costea90@gmail.com>
Signed-off-by: Stefan Popa <Stefan.A.Popa@intel.com>
Reviewed-by: Stefan Popa <Stefan.A.Popa@intel.com>
---
distributed-arp-table.c | 12 +++++++++---
distributed-arp-table.h | 2 +-
types.h | 6 +++++-
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/distributed-arp-table.c b/distributed-arp-table.c
index b2a4fe5..f941913 100644
--- a/distributed-arp-table.c
+++ b/distributed-arp-table.c
@@ -36,6 +36,12 @@ static struct batadv_dat_type_info batadv_dat_types_info[] = {
.size = sizeof(__be32),
.str_fmt = "%pI4",
},
+#if IS_ENABLED(CONFIG_IPV6)
+ {
+ .size = sizeof(struct in6_addr),
+ .str_fmt = "%pI6c",
+ },
+#endif
};
static void batadv_dat_purge(struct work_struct *work);
@@ -845,8 +851,8 @@ int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset)
goto out;
seq_printf(seq, "Distributed ARP Table (%s):\n", net_dev->name);
- seq_printf(seq, " %-7s %-13s %5s\n", "IPv4", "MAC",
- "last-seen");
+ seq_printf(seq, " %-26s %-15s %5s\n",
+ "IPv4/IPv6", "MAC", "last-seen");
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
@@ -859,7 +865,7 @@ int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset)
last_seen_msecs = last_seen_msecs % 60000;
last_seen_secs = last_seen_msecs / 1000;
- seq_printf(seq, " * %15s %14pM %6i:%02i\n",
+ seq_printf(seq, " * %40s %15pM %6i:%02i\n",
batadv_dat_data_to_str(dat_entry->data,
dat_entry->type,
dbg_data,
diff --git a/distributed-arp-table.h b/distributed-arp-table.h
index 21d7b24..d029b4b 100644
--- a/distributed-arp-table.h
+++ b/distributed-arp-table.h
@@ -28,7 +28,7 @@
#include <linux/if_arp.h>
#define BATADV_DAT_ADDR_MAX ((batadv_dat_addr_t)~(batadv_dat_addr_t)0)
-#define BATADV_DAT_DATA_MAX_LEN 16
+#define BATADV_DAT_DATA_MAX_LEN 40
void batadv_dat_status_update(struct net_device *net_dev);
bool batadv_dat_snoop_outgoing_pkt_request(struct batadv_priv *bat_priv,
diff --git a/types.h b/types.h
index 69c187e..60d2d64 100644
--- a/types.h
+++ b/types.h
@@ -953,10 +953,14 @@ struct batadv_dat_entry {
/**
* batadv_dat_types - types used in batadv_dat_entry for IP
- * @BATADV_DAT_IPv4: IPv4 address type
+ * @BATADV_DAT_IPV4: IPv4 address type
+ * @BATADV_DAT_IPV6: IPv6 address type
*/
enum batadv_dat_types {
BATADV_DAT_IPV4 = 0,
+#if IS_ENABLED(CONFIG_IPV6)
+ BATADV_DAT_IPV6 = 1,
+#endif
};
/**
--
1.7.10.4
next prev parent reply other threads:[~2013-07-08 0:12 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-08 0:12 [B.A.T.M.A.N.] [RFC 1/6] batman-adv: Generalize DAT in order to support any type of data, not only IPv4 mihail.costea2005
2013-07-08 0:12 ` [B.A.T.M.A.N.] [RFC 2/6] batman-adv: Renames batadv_dat_snoop_*_arp_* functions to batadv_dat_snoop_*_pkt_* mihail.costea2005
2013-07-08 0:12 ` mihail.costea2005 [this message]
2013-08-10 11:14 ` [B.A.T.M.A.N.] [RFC 3/6] batman-adv: Adds IPv6 to DAT and generic struct in distributed-arp-table.c Antonio Quartulli
2013-07-08 0:12 ` [B.A.T.M.A.N.] [RFC 4/6] batman-adv: Adds necessary functions for NDP, like checking if a packet is valid or creating a Neighbor Advertisement mihail.costea2005
2013-08-10 12:20 ` Antonio Quartulli
2013-08-14 13:38 ` Mihail Costea
2013-07-08 0:12 ` [B.A.T.M.A.N.] [RFC 5/6] batman-adv: Generalize snooping mechanism in order to suport NDP too mihail.costea2005
2013-09-30 20:06 ` Linus Lüssing
2013-09-30 20:38 ` Linus Lüssing
2013-10-04 18:28 ` Mihail Costea
2013-10-05 7:14 ` Antonio Quartulli
2013-10-05 9:48 ` Mihail Costea
2013-07-08 0:12 ` [B.A.T.M.A.N.] [RFC 6/6] batman-adv: Adds snooping of router and override flags for NA creation mihail.costea2005
2013-08-10 13:20 ` Antonio Quartulli
2013-08-14 13:51 ` Mihail Costea
2013-08-14 15:42 ` Linus Lüssing
2013-08-14 17:42 ` Antonio Quartulli
2013-07-23 7:27 ` [B.A.T.M.A.N.] [RFC 1/6] batman-adv: Generalize DAT in order to support any type of data, not only IPv4 Antonio Quartulli
2013-07-24 16:50 ` Mihail Costea
2013-08-10 11:03 ` Antonio Quartulli
2013-08-10 19:01 ` Mihail Costea
2013-08-10 20:36 ` Antonio Quartulli
2013-09-09 14:05 ` Mihail Costea
2013-09-09 14:53 ` Antonio Quartulli
2013-09-10 4:35 ` Mihail Costea
2013-09-10 5:38 ` Antonio Quartulli
2013-09-10 12:45 ` Mihail Costea
2013-09-10 21:01 ` Antonio Quartulli
2013-09-11 4:33 ` Mihail Costea
2013-09-11 6:46 ` Antonio Quartulli
2016-03-10 19:11 ` Sven Eckelmann
2016-03-20 12:02 ` Antonio Quartulli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373242365-763-3-git-send-email-mihail.costea2005@gmail.com \
--to=mihail.costea2005@gmail.com \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).