[B.A.T.M.A.N.] Problems with Gateway-Selection without option -g
by Michael Rack
Dear B.A.T.M.A.N List,
i've installed BATMAN v0.3.2 in a ethernet network to dynamicly route my
network-informations. Before switching to BATMAN, i've used OLSR.
With OLSR all things went fine. But since my network grows faster as
intended, i like to switch to BATMAN.
NOW TO MY PROBLEM:
I like to announce a gateway that is behind an VPN-Tunnel. The
VPN-Tunnel is established, before BATMAN is running.
When i try to start BATMAN on the Gateway with this options:
batmand -g 30mbit/2mbit
the clients will create a gate0 interface. I do not need this gate0
interface. All routers have static public ip-addresses assigned. The
once that i need is, that BATMAN inserts a DEFAULT-ROUTE to the next
neighbour hop thats reach the gateway.
NETWORK-Setup:
1. i386 Router located on ISP runs batman as gateway-provider
xxx.205.12.0/32 brd 255.255.255.255
<--- VPN-Tunnel over ISP-Network --->
xxx.205.12.4/32 brd 255.255.255.255
2. i386 Router located at home #1
xxx.205.12.17/30 brd xxx.205.12.19
<--- Wireless Bridge-Connection --->
xxx.205.12.18/30 brd xxx.205.12.19
3. i386 Router located at home #2
xxx.205.12.21/30 brd xxx.205.12.23
<--- Wireless Bridge-Connection --->
xxx.205.12.22/30 brd xxx.205.12.23
4. i386 Router located at home #3
How can i tell BATMAN (gateway) to announce 0.0.0.0/0 as HNA?
# batmand -c -a 0.0.0.0/0
Invalid announced network (netmask is invalid): 0.0.0.0/0
I dont like to setup a second VPN / P2P Tunnel, because thats not needed.
Thanks in advance,
Michael
13 years, 3 months
[B.A.T.M.A.N.] List policy for none subscribers
by Andrew Lunn
Hi folks
Yesterday evening i sent an email to Greg KH about getting batman into
mainline via staging. I CCed the list. Since i used an account which is
not subscribed, i got a bounce:
You are not allowed to post to this mailing list, and your message
has been automatically rejected. If you think that your messages
are being rejected in error, contact the mailing list owner at
b.a.t.m.a.n-owner(a)lists.open-mesh.net.
This is contrary to what the wiki says:
http://open-mesh.org/wiki/MailingList
You can subscribe to our Mailing List here. You can also send an
E-Mail without subscription to b.a.t.m.a.n@…, but note that this
message will have to be accepted manually (and this can take some
time).
Greg KH reply also bounced, and he was not so happy about that.
If we want to receive comments from the kernel experts, we are
probably going to need an open list.
I can think of two options:
1) Make the batman list open for none subscribers to post to.
2) Create a batman-adv list which is open and we use that for all
discussion about kernel work.
As a side issue, i'm not sure batman-adv is the right name for
mainline. In the context of the batman project, it makes sense, but
from the perspective of mainline, this is the first version of batman,
and maybe we cannot justify the advanced.
Andrew
13 years, 4 months
[B.A.T.M.A.N.] [patch] adding subgraph-feature to vis-output in dot-file-format
by Linus Lüssing
Pfeh... long night again, but here you go. With this patch,
batman-adv now supports the subgraphing-feature of the
dot-file-format. The vis-output can then be parsed with
"fdp -Tsvg -Gcharset=utf8 /proc/net/batman-adv/vis > test.svg"
for example.
Interfaces belonging to one BATMAN-node can be found
inside a box, the primary interface of a BATMAN-node is
double-circled. The output also got more detailed, in that
connections between nodes are being displayed with the exact
mac address of the used interface instead of replacing one end
with the primary interface's mac (see [0] for the problems I had
posted before).
Cheers, Linus
PS: Please check if I got that kmalloc stuff right.
PPS: I had to introduce a src-field in the vis-packet-struct,
therefore the compatibility version had to be increased as well.
[0] https://lists.open-mesh.net/pipermail/b.a.t.m.a.n/2009-August/002832.html
Index: vis.c
===================================================================
--- vis.c (revision 1417)
+++ vis.c (working copy)
@@ -333,6 +333,7 @@
/* fill one entry into buffer. */
entry = &entry_array[info->packet.entries];
+ memcpy(entry->src, orig_node->batman_if->net_dev->dev_addr, ETH_ALEN);
memcpy(entry->dest, orig_node->orig, ETH_ALEN);
entry->quality = orig_node->router->tq_avg;
info->packet.entries++;
@@ -351,6 +352,7 @@
while (NULL != (hashit = hash_iterate(hna_local_hash, hashit))) {
hna_local_entry = hashit->bucket->data;
entry = &entry_array[info->packet.entries];
+ memset(entry->src, 0, ETH_ALEN);
memcpy(entry->dest, hna_local_entry->addr, ETH_ALEN);
entry->quality = 0; /* 0 means HNA */
info->packet.entries++;
Index: vis.h
===================================================================
--- vis.h (revision 1417)
+++ vis.h (working copy)
@@ -33,6 +33,7 @@
} __attribute__((packed));
struct vis_info_entry {
+ uint8_t src[ETH_ALEN];
uint8_t dest[ETH_ALEN];
uint8_t quality; /* quality = 0 means HNA */
} __attribute__((packed));
Index: packet.h
===================================================================
--- packet.h (revision 1417)
+++ packet.h (working copy)
@@ -26,7 +26,7 @@
#define BAT_VIS 0x05
/* this file is included by batctl which needs these defines */
-#define COMPAT_VERSION 7
+#define COMPAT_VERSION 8
#define DIRECTLINK 0x40
#define VIS_SERVER 0x20
Index: proc.c
===================================================================
--- proc.c (revision 1417)
+++ proc.c (working copy)
@@ -403,17 +403,47 @@
return single_open(file, proc_transt_global_read, NULL);
}
+static void proc_vis_insert_interface(const uint8_t *interface,
+ struct vis_if_list **if_entry,
+ bool primary)
+{
+ // Did we get an empty list? (then insert imediately)
+ if(*if_entry == NULL) {
+ *if_entry = kmalloc(sizeof(struct vis_if_list), GFP_KERNEL);
+ (*if_entry)->primary = primary;
+ (*if_entry)->next = NULL;
+ memcpy((*if_entry)->addr, interface, ETH_ALEN);
+ } else {
+ // Do we already have this interface in our list?
+ while(memcmp((*if_entry)->addr, interface, ETH_ALEN)) {
+ // Or did we reach the end (then append the interface)
+ if((*if_entry)->next == NULL) {
+ (*if_entry)->next = kmalloc(sizeof(struct vis_if_list), GFP_KERNEL);
+ memcpy((*if_entry)->next->addr, interface, ETH_ALEN);
+ (*if_entry)->next->primary = primary;
+ (*if_entry)->next->next = NULL;
+ break;
+ }
+ *if_entry = (*if_entry)->next;
+ }
+ }
+}
+
static void proc_vis_read_entry(struct seq_file *seq,
struct vis_info_entry *entry,
- char *from,
+ struct vis_if_list **if_entry,
+ uint8_t *vis_orig,
uint8_t current_format,
uint8_t first_line)
{
+ char from[40];
char to[40];
int int_part, frac_part;
addr_to_string(to, entry->dest);
if (entry->quality == 0) {
+ proc_vis_insert_interface(vis_orig, if_entry, true);
+ addr_to_string(from, vis_orig);
if (current_format == DOT_DRAW) {
seq_printf(seq, "\t\"%s\" -> \"%s\" [label=\"HNA\"]\n",
from, to);
@@ -425,6 +455,9 @@
} else {
/* kernel has no printf-support for %f? it'd be better to return
* this in float. */
+ proc_vis_insert_interface(entry->src, if_entry,
+ (memcmp(entry->src, vis_orig, ETH_ALEN)) ? false : true);
+ addr_to_string(from, entry->src);
int_part = TQ_MAX_VALUE / entry->quality;
frac_part = 1000 * TQ_MAX_VALUE / entry->quality - int_part * 1000;
if (current_format == DOT_DRAW) {
@@ -444,9 +477,11 @@
struct hash_it_t *hashit = NULL;
struct vis_info *info;
struct vis_info_entry *entries;
- char from[40];
+ struct vis_if_list *if_entries = NULL;
int i;
uint8_t current_format, first_line = 1;
+ char tmp_addr_str[ETH_STR_LEN];
+ struct vis_if_list *tmp_if_next;
current_format = vis_format;
@@ -468,14 +503,32 @@
info = hashit->bucket->data;
entries = (struct vis_info_entry *)
((char *)info + sizeof(struct vis_info));
- addr_to_string(from, info->packet.vis_orig);
for (i = 0; i < info->packet.entries; i++) {
- proc_vis_read_entry(seq, &entries[i], from,
+ proc_vis_read_entry(seq, &entries[i], &if_entries,
+ info->packet.vis_orig,
current_format, first_line);
if (first_line)
first_line = 0;
}
+
+ // Generate subgraphs from the collected items
+ if (current_format == DOT_DRAW) {
+ addr_to_string(tmp_addr_str, info->packet.vis_orig);
+ seq_printf(seq, "\tsubgraph \"cluster_%s\" \{\n", tmp_addr_str);
+ while (if_entries != NULL) {
+ addr_to_string(tmp_addr_str, if_entries->addr);
+ if (if_entries->primary)
+ seq_printf(seq, "\t\t\"%s\" [peripheries=2]\n", tmp_addr_str);
+ else
+ seq_printf(seq, "\t\t\"%s\"\n", tmp_addr_str);
+ // ... and empty the list while doing this
+ tmp_if_next = if_entries->next;
+ kfree(if_entries);
+ if_entries = tmp_if_next;
+ }
+ seq_printf(seq, "\t}\n");
+ }
}
spin_unlock(&vis_hash_lock);
Index: proc.h
===================================================================
--- proc.h (revision 1417)
+++ proc.h (working copy)
@@ -35,3 +35,12 @@
void cleanup_procfs(void);
int setup_procfs(void);
+
+// While scanning for vis-entries of a particular vis-originator
+// this list collects its interfaces to create a subgraph/cluster
+// out of them later
+struct vis_if_list {
+ uint8_t addr[ETH_ALEN];
+ bool primary;
+ struct vis_if_list *next;
+};
13 years, 4 months
[B.A.T.M.A.N.] [PATCH] [batman-adv] Remove compatibility code for pre 2.6 kernel versions
by Sven Eckelmann
The earliest version of linux which is compatible to
batman-adv-kernelland is 2.6.20. Their are patches available in debian
for batman-adv-kernelland 0.1 to make it build against linux 2.6.15, but
they cannot be ported to current trunk due to changes to the working
queues. To have "support" for much older versions isn't needed and can
be removed without loosing any functionality.
As result the only remaining LINUX_VERSION_CODE dependend precomiler
code beside compat.h is for netdevice_ops support in soft-interface.c
and result code checking of unregister_chrdev in device.c. For a
possible merge into linux compat.h and all appearances of
LINUX_VERSION_CODE should be removed according to checkpatch.pl.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
---
batman-adv-kernelland/device.c | 14 --------------
batman-adv-kernelland/main.c | 8 --------
2 files changed, 0 insertions(+), 22 deletions(-)
diff --git a/batman-adv-kernelland/device.c b/batman-adv-kernelland/device.c
index 80a6215..6383839 100644
--- a/batman-adv-kernelland/device.c
+++ b/batman-adv-kernelland/device.c
@@ -26,9 +26,7 @@
#include "compat.h"
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
static struct class *batman_class;
-#endif
static int Major; /* Major number assigned to our device driver */
@@ -65,13 +63,6 @@ int bat_device_setup(void)
return 0;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
- if (devfs_mk_cdev(MKDEV(tmp_major, 0), S_IFCHR | S_IRUGO | S_IWUGO,
- "batman-adv", 0)) {
- debug_log(LOG_TYPE_WARN, "Could not create /dev/batman-adv\n");
- return 0;
- }
-#else
batman_class = class_create(THIS_MODULE, "batman-adv");
if (IS_ERR(batman_class)) {
@@ -81,7 +72,6 @@ int bat_device_setup(void)
device_create(batman_class, NULL, MKDEV(tmp_major, 0), NULL,
"batman-adv");
-#endif
Major = tmp_major;
return 1;
@@ -94,12 +84,8 @@ void bat_device_destroy(void)
if (!Major)
return;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
- devfs_remove("batman-adv", 0);
-#else
device_destroy(batman_class, MKDEV(Major, 0));
class_destroy(batman_class);
-#endif
/* Unregister the device */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
diff --git a/batman-adv-kernelland/main.c b/batman-adv-kernelland/main.c
index 584b141..8fbefc2 100644
--- a/batman-adv-kernelland/main.c
+++ b/batman-adv-kernelland/main.c
@@ -203,20 +203,12 @@ void shutdown_module(void)
void inc_module_count(void)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
- MOD_INC_USE_COUNT;
-#else
try_module_get(THIS_MODULE);
-#endif
}
void dec_module_count(void)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
- MOD_DEC_USE_COUNT;
-#else
module_put(THIS_MODULE);
-#endif
}
int addr_to_string(char *buff, uint8_t *addr)
--
1.6.3.3
13 years, 4 months
[B.A.T.M.A.N.] [PATCH] Remove compatibility code for pre 2.6 kernel versions
by Sven Eckelmann
The earliest version of linux which is compatible to
batman-adv-kernelland is 2.6.20. Their are patches available in debian
for batman-adv-kernelland 0.1 to make it build against linux 2.6.15, but
they cannot be ported to current trunk due to changes to the working
queues. To have "support" for much older versions isn't needed and can
be removed without loosing any functionality.
As result the only remaining LINUX_VERSION_CODE dependend precomiler
code beside compat.h is for netdevice_ops support in soft-interface.c
and result code checking of unregister_chrdev in device.c. For a
possible merge into linux compat.h and all appearances of
LINUX_VERSION_CODE should be removed according to checkpatch.pl.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
---
batman-adv-kernelland/device.c | 14 --------------
batman-adv-kernelland/main.c | 8 --------
2 files changed, 0 insertions(+), 22 deletions(-)
diff --git a/batman-adv-kernelland/device.c b/batman-adv-kernelland/device.c
index 80a6215..6383839 100644
--- a/batman-adv-kernelland/device.c
+++ b/batman-adv-kernelland/device.c
@@ -26,9 +26,7 @@
#include "compat.h"
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
static struct class *batman_class;
-#endif
static int Major; /* Major number assigned to our device driver */
@@ -65,13 +63,6 @@ int bat_device_setup(void)
return 0;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
- if (devfs_mk_cdev(MKDEV(tmp_major, 0), S_IFCHR | S_IRUGO | S_IWUGO,
- "batman-adv", 0)) {
- debug_log(LOG_TYPE_WARN, "Could not create /dev/batman-adv\n");
- return 0;
- }
-#else
batman_class = class_create(THIS_MODULE, "batman-adv");
if (IS_ERR(batman_class)) {
@@ -81,7 +72,6 @@ int bat_device_setup(void)
device_create(batman_class, NULL, MKDEV(tmp_major, 0), NULL,
"batman-adv");
-#endif
Major = tmp_major;
return 1;
@@ -94,12 +84,8 @@ void bat_device_destroy(void)
if (!Major)
return;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
- devfs_remove("batman-adv", 0);
-#else
device_destroy(batman_class, MKDEV(Major, 0));
class_destroy(batman_class);
-#endif
/* Unregister the device */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
diff --git a/batman-adv-kernelland/main.c b/batman-adv-kernelland/main.c
index 584b141..8fbefc2 100644
--- a/batman-adv-kernelland/main.c
+++ b/batman-adv-kernelland/main.c
@@ -203,20 +203,12 @@ void shutdown_module(void)
void inc_module_count(void)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
- MOD_INC_USE_COUNT;
-#else
try_module_get(THIS_MODULE);
-#endif
}
void dec_module_count(void)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
- MOD_DEC_USE_COUNT;
-#else
module_put(THIS_MODULE);
-#endif
}
int addr_to_string(char *buff, uint8_t *addr)
--
1.6.3.3
13 years, 5 months
[B.A.T.M.A.N.] HSB announces the second Wireless Battle Mesh (Brussels, 17-18 Oct)
by Benjamin Henrion
=======================================================================
HackerSpaceBrussels announces the second Wireless Battle Mesh
WBM2009 v2 (Brussels, 17-18 October)
=======================================================================
HackerSpaceBrussels (HSB) announces the second Wireless Battle Mesh,
which aims to test 3 popular WiFi routing protocols (OLSR, Batman and
Babel), in Brussels on Saturday and Sunday 17-18 October 2009.
Agenda
======
* Tue 06 Oct @ 21:00: final IRC meeting to prepare the design of the
networks (see below)
* Sat 10 Oct @19:30: IPv6 presentation (Filip P.) + panel on
possibilities and pittfalls of IPv6 for free networks
* Tue 13 Oct - Fri 16 Oct: OpenWRT workshops (we're still up to
organising things, some points of interest: openwrt installation and
config, kamikaze build environment, ssh keys infrastructure, firmware
generation, UCI configuration tool, asterisk/ SIP phone)
* Friday 16th Oct @ 18:00 : Deploy the nodes
* Sat 17 Oct @ 14:00: Deploy the nodes, setup tests
* Sat 17 Oct @ 19:00: concert "I'm sitting under an antenna" v.a.,
org. by OKNO
* Sun 18 Oct @ 14:00: The battle! :-)
IRC meetings
============
We setup some IRC meetings to prepare the configuration: IP's, versions,
and everything that took too much time at WBM v1. The meetings will be
held on the tuesdays of 15 and 22 September and 06 October at 21:00 CET
on irc.freenode.net channel #hsbxl. People from brussels and around are
invited to join us at the hackerspace.
Fee
===
The event is free. We'll kindly ask you for a donation to cover some
costs.
Location
========
Okno
Quai des Charbonnages 30-34
1080 Brussels
http://okno.be
http://tinyurl.com/oknomap
Transport
=========
* Metro: Compte de Flandres / Graaf van Vlaanderen
* Train: Go to Brussels central station and take metro from there
(metro 5 direction Erasmus)
* Route planner in Brussels: http://mivb.be/index.htm
Registration
============
Space is limited, so we ask you to register in advance by registering:
1. send an email with your name and surname to contact at voidpointer.be
AND
2. register on Doodle: http://www.doodle.com/7yzcn8ptibyq7gxv
Requirements
============
* Bring your laptop/computer
* Bring your compatible router(s) with OpenWRT pre-installed
* Bring your WiFi antenna(s) and connectors
Accomodation
============
* Zoobab is offering some free space to sleep (contact him at zoobab at
gmail.com)
* If you have problems finding accomodation, let us know (contact at
voidpointer.be) -- there always be some couches free at HSB.
Contact
======
Email: contact at voidpointer.be
Tel (ptr_): +32 493 52 50 09
Tel (zoobab): +32 484 56 61 09
Links
=====
http://hackerspace.be/wbm2009v2
http://www.olsr.org
http://www.pps.jussieu.fr/~jch/software/babel/
http://en.wikipedia.org/wiki/B.A.T.M.A.N.
http://hackerspace.be/wbm2009
http://www.tmplab.org/2009/02/16/first-tmplab-wireless-battle-mesh-april-...
http://openwrt.org/
http://www.tmplab.org/wiki/index.php/Wireless_Battle_Mesh
13 years, 5 months