Skip to contentSkip to conversation

net: Add batman-adv meshing protocol

PATCH New Sven Eckelmann 1 participant 1 message Nov 22, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v7 1/1 net: Add batman-adv meshing protocol

B.A.T.M.A.N. (better approach to mobile ad-hoc networking) is a routing protocol for multi-hop ad-hoc mesh networks. The networks may be wired or wireless. See http://www.open-mesh.org/ for more information and user space tools.

---
batman-adv is a layer2 meshing protocol currently in drivers/staging/batman-adv. GregKH recently [1][2] gave us his blessing to leave the staging tree and move to a more suitable location.

Short functionality overview:

The batman-adv module is an implementation of the B.A.T.M.A.N. routing protocol operating on layer2 optimized for (but not limited to) wireless networks. Next to finding the best possible path through the network it encapsulates the data traffic and optimizes the transport as well. There also is a user space tool "batctl" which offers various functionalities next to a kernel module configuration interface. Detailed documentation can be found at the project homepage[3].

Everything is addressed in the last round of comments [4].

I am sorry that I had to resubmit it again after 14 days, but I try to keep that in sync with Staging and the changes are relative small.

Following patches were integrated since the last submission:

Marek Lindner (1):
batman-adv: ensure that eth_type_trans gets linear memory

Sven Eckelmann (3):
batman-adv: Use kernel version min macro
batman-adv: Don't remove interface with spinlock held
batman-adv: Use kernel functions to identify broadcasts

[1] https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2010-June/002881.html
[2] https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2010-June/002968.html
[3] http://www.open-mesh.org
[4] https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2010-November/003665.html

 .../ABI/testing/sysfs-class-net-batman-adv         |   14 +
 Documentation/ABI/testing/sysfs-class-net-mesh     |   69 +
 Documentation/networking/batman-adv.txt            |  240 ++++
 MAINTAINERS                                        |    9 +
 net/Kconfig                                        |    1 +
 net/Makefile                                       |    1 +
 net/batman-adv/Kconfig                             |   25 +
 net/batman-adv/Makefile                            |   39 +
 net/batman-adv/aggregation.c                       |  273 ++++
 net/batman-adv/aggregation.h                       |   43 +
 net/batman-adv/bat_debugfs.c                       |  360 +++++
 net/batman-adv/bat_debugfs.h                       |   33 +
 net/batman-adv/bat_sysfs.c                         |  593 +++++++++
 net/batman-adv/bat_sysfs.h                         |   42 +
 net/batman-adv/bitarray.c                          |  201 +++
 net/batman-adv/bitarray.h                          |   47 +
 net/batman-adv/gateway_client.c                    |  477 +++++++
 net/batman-adv/gateway_client.h                    |   36 +
 net/batman-adv/gateway_common.c                    |  177 +++
 net/batman-adv/gateway_common.h                    |   38 +
 net/batman-adv/hard-interface.c                    |  651 +++++++++
 net/batman-adv/hard-interface.h                    |   53 +
 net/batman-adv/hash.c                              |   83 ++
 net/batman-adv/hash.h                              |  259 ++++
 net/batman-adv/icmp_socket.c                       |  356 +++++
 net/batman-adv/icmp_socket.h                       |   34 +
 net/batman-adv/main.c                              |  187 +++
 net/batman-adv/main.h                              |  183 +++
 net/batman-adv/originator.c                        |  546 ++++++++
 net/batman-adv/originator.h                        |   64 +
 net/batman-adv/packet.h                            |  136 ++
 net/batman-adv/ring_buffer.c                       |   52 +
 net/batman-adv/ring_buffer.h                       |   28 +
 net/batman-adv/routing.c                           | 1393 ++++++++++++++++++++
 net/batman-adv/routing.h                           |   48 +
 net/batman-adv/send.c                              |  585 ++++++++
 net/batman-adv/send.h                              |   41 +
 net/batman-adv/soft-interface.c                    |  697 ++++++++++
 net/batman-adv/soft-interface.h                    |   35 +
 net/batman-adv/translation-table.c                 |  528 ++++++++
 net/batman-adv/translation-table.h                 |   45 +
 net/batman-adv/types.h                             |  271 ++++
 net/batman-adv/unicast.c                           |  343 +++++
 net/batman-adv/unicast.h                           |   35 +
 net/batman-adv/vis.c                               |  903 +++++++++++++
 net/batman-adv/vis.h                               |   37 +
 46 files changed, 10311 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-class-net-batman-adv
 create mode 100644 Documentation/ABI/testing/sysfs-class-net-mesh
 create mode 100644 Documentation/networking/batman-adv.txt
 create mode 100644 net/batman-adv/Kconfig
 create mode 100644 net/batman-adv/Makefile
 create mode 100644 net/batman-adv/aggregation.c
 create mode 100644 net/batman-adv/aggregation.h
 create mode 100644 net/batman-adv/bat_debugfs.c
 create mode 100644 net/batman-adv/bat_debugfs.h
 create mode 100644 net/batman-adv/bat_sysfs.c
 create mode 100644 net/batman-adv/bat_sysfs.h
 create mode 100644 net/batman-adv/bitarray.c
 create mode 100644 net/batman-adv/bitarray.h
 create mode 100644 net/batman-adv/gateway_client.c
 create mode 100644 net/batman-adv/gateway_client.h
 create mode 100644 net/batman-adv/gateway_common.c
 create mode 100644 net/batman-adv/gateway_common.h
 create mode 100644 net/batman-adv/hard-interface.c
 create mode 100644 net/batman-adv/hard-interface.h
 create mode 100644 net/batman-adv/hash.c
 create mode 100644 net/batman-adv/hash.h
 create mode 100644 net/batman-adv/icmp_socket.c
 create mode 100644 net/batman-adv/icmp_socket.h
 create mode 100644 net/batman-adv/main.c
 create mode 100644 net/batman-adv/main.h
 create mode 100644 net/batman-adv/originator.c
 create mode 100644 net/batman-adv/originator.h
 create mode 100644 net/batman-adv/packet.h
 create mode 100644 net/batman-adv/ring_buffer.c
 create mode 100644 net/batman-adv/ring_buffer.h
 create mode 100644 net/batman-adv/routing.c
 create mode 100644 net/batman-adv/routing.h
 create mode 100644 net/batman-adv/send.c
 create mode 100644 net/batman-adv/send.h
 create mode 100644 net/batman-adv/soft-interface.c
 create mode 100644 net/batman-adv/soft-interface.h
 create mode 100644 net/batman-adv/translation-table.c
 create mode 100644 net/batman-adv/translation-table.h
 create mode 100644 net/batman-adv/types.h
 create mode 100644 net/batman-adv/unicast.c
 create mode 100644 net/batman-adv/unicast.h
 create mode 100644 net/batman-adv/vis.c
 create mode 100644 net/batman-adv/vis.h
Documentation/ABI/testing/sysfs-class-net-batman-adv new file +14 -0
new file mode 100644
index 0000000..38dd762
@@ -0,0 +1,14 @@
+
+What:           /sys/class/net/<iface>/batman-adv/mesh_iface
+Date:           May 2010
+Contact:        Marek Lindner <[email protected]>
+Description:
+                The /sys/class/net/<iface>/batman-adv/mesh_iface file
+                displays the batman mesh interface this <iface>
+                currently is associated with.
+
+What:           /sys/class/net/<iface>/batman-adv/iface_status
+Date:           May 2010
+Contact:        Marek Lindner <[email protected]>
+Description:
+                Indicates the status of <iface> as it is seen by batman.
Documentation/ABI/testing/sysfs-class-net-mesh new file +69 -0

69 lines not on this page · raw message

Documentation/networking/batman-adv.txt new file +240 -0

240 lines not on this page · raw message

MAINTAINERS +9 -0
index 9ac6540..cda613b 100644
@@ -1258,6 +1258,15 @@ S:	Maintained
 F:	drivers/video/backlight/
 F:	include/linux/backlight.h
 
+BATMAN ADVANCED
+M:	Marek Lindner <[email protected]>
+M:	Simon Wunderlich <[email protected]>
+M:	Sven Eckelmann <[email protected]>
+L:	[email protected]
+W:	http://www.open-mesh.org/
+S:	Maintained
+F:	net/batman-adv/
+
 BAYCOM/HDLCDRV DRIVERS FOR AX.25
 M:	Thomas Sailer <[email protected]>
 L:	[email protected]
net/Kconfig +1 -0
index 5e203b5..895ca8b 100644
@@ -214,6 +214,7 @@ source "net/ieee802154/Kconfig"
 source "net/sched/Kconfig"
 source "net/dcb/Kconfig"
 source "net/dns_resolver/Kconfig"
+source "net/batman-adv/Kconfig"
 
 config RPS
 	boolean
net/Makefile +1 -0
index 6b7bfd7..a3330eb 100644
@@ -69,3 +69,4 @@ endif
 obj-$(CONFIG_WIMAX)		+= wimax/
 obj-$(CONFIG_DNS_RESOLVER)	+= dns_resolver/
 obj-$(CONFIG_CEPH_LIB)		+= ceph/
+obj-$(CONFIG_BATMAN_ADV)	+= batman-adv/
net/batman-adv/Kconfig new file +25 -0
new file mode 100644
index 0000000..6c051ad
@@ -0,0 +1,25 @@
+#
+# B.A.T.M.A.N meshing protocol
+#
+
+config BATMAN_ADV
+	tristate "B.A.T.M.A.N. Advanced Meshing Protocol"
+	depends on NET
+        default n
+	---help---
+
+        B.A.T.M.A.N. (better approach to mobile ad-hoc networking) is
+        a routing protocol for multi-hop ad-hoc mesh networks. The
+        networks may be wired or wireless. See
+        http://www.open-mesh.org/ for more information and user space
+        tools.
+
+config BATMAN_ADV_DEBUG
+	bool "B.A.T.M.A.N. debugging"
+	depends on BATMAN_ADV != n
+	---help---
+
+	  This is an option for use by developers; most people should
+	  say N here. This enables compilation of support for
+	  outputting debugging information to the kernel log. The
+	  output is controlled via the module parameter debug.
net/batman-adv/Makefile new file +39 -0
new file mode 100644
index 0000000..d936aec
@@ -0,0 +1,39 @@
+#
+# Copyright (C) 2007-2010 B.A.T.M.A.N. contributors:
+#
+# Marek Lindner, Simon Wunderlich
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of version 2 of the GNU General Public
+# License as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA
+#
+
+obj-$(CONFIG_BATMAN_ADV) += batman-adv.o
+batman-adv-y += aggregation.o
+batman-adv-y += bat_debugfs.o
+batman-adv-y += bat_sysfs.o
+batman-adv-y += bitarray.o
+batman-adv-y += gateway_client.o
+batman-adv-y += gateway_common.o
+batman-adv-y += hard-interface.o
+batman-adv-y += hash.o
+batman-adv-y += icmp_socket.o
+batman-adv-y += main.o
+batman-adv-y += originator.o
+batman-adv-y += ring_buffer.o
+batman-adv-y += routing.o
+batman-adv-y += send.o
+batman-adv-y += soft-interface.o
+batman-adv-y += translation-table.o
+batman-adv-y += unicast.o
+batman-adv-y += vis.o
net/batman-adv/aggregation.c new file +273 -0

273 lines not on this page · raw message

net/batman-adv/aggregation.h new file +43 -0

43 lines not on this page · raw message

net/batman-adv/bat_debugfs.c new file +360 -0

360 lines not on this page · raw message

net/batman-adv/bat_debugfs.h new file +33 -0
new file mode 100644
index 0000000..72df532
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2010 B.A.T.M.A.N. contributors:
+ *
+ * Marek Lindner
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA
+ *
+ */
+
+
+#ifndef _NET_BATMAN_ADV_DEBUGFS_H_
+#define _NET_BATMAN_ADV_DEBUGFS_H_
+
+#define DEBUGFS_BAT_SUBDIR "batman_adv"
+
+void debugfs_init(void);
+void debugfs_destroy(void);
+int debugfs_add_meshif(struct net_device *dev);
+void debugfs_del_meshif(struct net_device *dev);
+
+#endif /* _NET_BATMAN_ADV_DEBUGFS_H_ */
net/batman-adv/bat_sysfs.c new file +593 -0

593 lines not on this page · raw message

net/batman-adv/bat_sysfs.h new file +42 -0

42 lines not on this page · raw message

net/batman-adv/bitarray.c new file +201 -0

201 lines not on this page · raw message

net/batman-adv/bitarray.h new file +47 -0

47 lines not on this page · raw message

net/batman-adv/gateway_client.c new file +477 -0

477 lines not on this page · raw message

net/batman-adv/gateway_client.h new file +36 -0
new file mode 100644
index 0000000..4585e65
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2009-2010 B.A.T.M.A.N. contributors:
+ *
+ * Marek Lindner
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA
+ *
+ */
+
+#ifndef _NET_BATMAN_ADV_GATEWAY_CLIENT_H_
+#define _NET_BATMAN_ADV_GATEWAY_CLIENT_H_
+
+void gw_deselect(struct bat_priv *bat_priv);
+void gw_election(struct bat_priv *bat_priv);
+void *gw_get_selected(struct bat_priv *bat_priv);
+void gw_check_election(struct bat_priv *bat_priv, struct orig_node *orig_node);
+void gw_node_update(struct bat_priv *bat_priv,
+		    struct orig_node *orig_node, uint8_t new_gwflags);
+void gw_node_delete(struct bat_priv *bat_priv, struct orig_node *orig_node);
+void gw_node_purge(struct bat_priv *bat_priv);
+int gw_client_seq_print_text(struct seq_file *seq, void *offset);
+int gw_is_target(struct bat_priv *bat_priv, struct sk_buff *skb);
+
+#endif /* _NET_BATMAN_ADV_GATEWAY_CLIENT_H_ */
net/batman-adv/gateway_common.c new file +177 -0

177 lines not on this page · raw message

net/batman-adv/gateway_common.h new file +38 -0
new file mode 100644
index 0000000..5e728d0
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2009-2010 B.A.T.M.A.N. contributors:
+ *
+ * Marek Lindner
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA
+ *
+ */
+
+#ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_
+#define _NET_BATMAN_ADV_GATEWAY_COMMON_H_
+
+enum gw_modes {
+	GW_MODE_OFF,
+	GW_MODE_CLIENT,
+	GW_MODE_SERVER,
+};
+
+#define GW_MODE_OFF_NAME	"off"
+#define GW_MODE_CLIENT_NAME	"client"
+#define GW_MODE_SERVER_NAME	"server"
+
+void gw_bandwidth_to_kbit(uint8_t gw_class, int *down, int *up);
+ssize_t gw_bandwidth_set(struct net_device *net_dev, char *buff, size_t count);
+
+#endif /* _NET_BATMAN_ADV_GATEWAY_COMMON_H_ */
net/batman-adv/hard-interface.c new file +651 -0

267 lines not on this page · raw message

net/batman-adv/hard-interface.h new file +53 -0

53 lines not on this page · raw message

net/batman-adv/hash.c new file +83 -0

83 lines not on this page · raw message

net/batman-adv/hash.h new file +259 -0

259 lines not on this page · raw message

net/batman-adv/icmp_socket.c new file +356 -0

356 lines not on this page · raw message

net/batman-adv/icmp_socket.h new file +34 -0
new file mode 100644
index 0000000..bf9b348

Lines of this file are not shown. View the raw message.

net/batman-adv/main.c new file +187 -0

187 lines not on this page · raw message

net/batman-adv/main.h new file +183 -0

183 lines not on this page · raw message

net/batman-adv/originator.c new file +546 -0

546 lines not on this page · raw message

net/batman-adv/originator.h new file +64 -0

64 lines not on this page · raw message

net/batman-adv/packet.h new file +136 -0

136 lines not on this page · raw message

net/batman-adv/ring_buffer.c new file +52 -0

52 lines not on this page · raw message

net/batman-adv/ring_buffer.h new file +28 -0
new file mode 100644
index 0000000..6b0cb9a

Lines of this file are not shown. View the raw message.

net/batman-adv/routing.c new file +1393 -0

1,393 lines not on this page · raw message

net/batman-adv/routing.h new file +48 -0

48 lines not on this page · raw message

net/batman-adv/send.c new file +585 -0

585 lines not on this page · raw message

net/batman-adv/send.h new file +41 -0

41 lines not on this page · raw message

net/batman-adv/soft-interface.c new file +697 -0

697 lines not on this page · raw message

net/batman-adv/soft-interface.h new file +35 -0
new file mode 100644
index 0000000..02b7733

Lines of this file are not shown. View the raw message.

net/batman-adv/translation-table.c new file +528 -0

528 lines not on this page · raw message

net/batman-adv/translation-table.h new file +45 -0

45 lines not on this page · raw message

net/batman-adv/types.h new file +271 -0

271 lines not on this page · raw message

net/batman-adv/unicast.c new file +343 -0

343 lines not on this page · raw message

net/batman-adv/unicast.h new file +35 -0
new file mode 100644
index 0000000..e32b786

Lines of this file are not shown. View the raw message.

net/batman-adv/vis.c new file +903 -0

903 lines not on this page · raw message

net/batman-adv/vis.h new file +37 -0
new file mode 100644
index 0000000..2c3b330

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.2.3

Part of the diff is not shown here. View the raw message.