Skip to content

Commit

Permalink
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
Browse files Browse the repository at this point in the history
Included changes:
- minimal fixes to the packet layout to avoid the __packed attribute when not
  needed
- new packet type called UNICAST_4ADDR: in this packet it is possible to find
  both source and destination node (in the classic UNICAST header only the
  destination field exists).
- a new feature: Distributed ARP Table (D.A.T.). It aims to reduce ARP lookups
  latency by means of a simil-DHT approach.
  • Loading branch information
David S. Miller committed Nov 8, 2012
2 parents b20b6d9 + 9affec6 commit f1e0b5b
Show file tree
Hide file tree
Showing 22 changed files with 1,682 additions and 55 deletions.
3 changes: 2 additions & 1 deletion Documentation/networking/batman-adv.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ abled during run time. Following log_levels are defined:
2 - Enable messages related to route added / changed / deleted
4 - Enable messages related to translation table operations
8 - Enable messages related to bridge loop avoidance
15 - enable all messages
16 - Enable messaged related to DAT, ARP snooping and parsing
31 - Enable all messages

The debug output can be changed at runtime using the file
/sys/class/net/bat0/mesh/log_level. e.g.
Expand Down
10 changes: 10 additions & 0 deletions net/batman-adv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ config BATMAN_ADV_BLA
more than one mesh node in the same LAN, you can safely remove
this feature and save some space.

config BATMAN_ADV_DAT
bool "Distributed ARP Table"
depends on BATMAN_ADV && INET
default n
help
This option enables DAT (Distributed ARP Table), a DHT based
mechanism that increases ARP reliability on sparse wireless
mesh networks. If you think that your network does not need
this option you can safely remove it and save some space.

config BATMAN_ADV_DEBUG
bool "B.A.T.M.A.N. debugging"
depends on BATMAN_ADV
Expand Down
1 change: 1 addition & 0 deletions net/batman-adv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ batman-adv-y += bat_iv_ogm.o
batman-adv-y += bitarray.o
batman-adv-$(CONFIG_BATMAN_ADV_BLA) += bridge_loop_avoidance.o
batman-adv-y += debugfs.o
batman-adv-$(CONFIG_BATMAN_ADV_DAT) += distributed-arp-table.o
batman-adv-y += gateway_client.o
batman-adv-y += gateway_common.o
batman-adv-y += hard-interface.o
Expand Down
8 changes: 5 additions & 3 deletions net/batman-adv/bat_iv_ogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,11 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff,

if ((atomic_read(&bat_priv->aggregated_ogms)) &&
(packet_len < BATADV_MAX_AGGREGATION_BYTES))
skb_size = BATADV_MAX_AGGREGATION_BYTES + ETH_HLEN;
skb_size = BATADV_MAX_AGGREGATION_BYTES;
else
skb_size = packet_len + ETH_HLEN;
skb_size = packet_len;

skb_size += ETH_HLEN + NET_IP_ALIGN;

forw_packet_aggr->skb = dev_alloc_skb(skb_size);
if (!forw_packet_aggr->skb) {
Expand All @@ -422,7 +424,7 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff,
kfree(forw_packet_aggr);
goto out;
}
skb_reserve(forw_packet_aggr->skb, ETH_HLEN);
skb_reserve(forw_packet_aggr->skb, ETH_HLEN + NET_IP_ALIGN);

INIT_HLIST_NODE(&forw_packet_aggr->list);

Expand Down
20 changes: 20 additions & 0 deletions net/batman-adv/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "vis.h"
#include "icmp_socket.h"
#include "bridge_loop_avoidance.h"
#include "distributed-arp-table.h"

static struct dentry *batadv_debugfs;

Expand Down Expand Up @@ -280,6 +281,19 @@ static int batadv_bla_backbone_table_open(struct inode *inode,

#endif

#ifdef CONFIG_BATMAN_ADV_DAT
/**
* batadv_dat_cache_open - Prepare file handler for reads from dat_chache
* @inode: inode which was opened
* @file: file handle to be initialized
*/
static int batadv_dat_cache_open(struct inode *inode, struct file *file)
{
struct net_device *net_dev = (struct net_device *)inode->i_private;
return single_open(file, batadv_dat_cache_seq_print_text, net_dev);
}
#endif

static int batadv_transtable_local_open(struct inode *inode, struct file *file)
{
struct net_device *net_dev = (struct net_device *)inode->i_private;
Expand Down Expand Up @@ -319,6 +333,9 @@ static BATADV_DEBUGINFO(bla_claim_table, S_IRUGO, batadv_bla_claim_table_open);
static BATADV_DEBUGINFO(bla_backbone_table, S_IRUGO,
batadv_bla_backbone_table_open);
#endif
#ifdef CONFIG_BATMAN_ADV_DAT
static BATADV_DEBUGINFO(dat_cache, S_IRUGO, batadv_dat_cache_open);
#endif
static BATADV_DEBUGINFO(transtable_local, S_IRUGO,
batadv_transtable_local_open);
static BATADV_DEBUGINFO(vis_data, S_IRUGO, batadv_vis_data_open);
Expand All @@ -330,6 +347,9 @@ static struct batadv_debuginfo *batadv_mesh_debuginfos[] = {
#ifdef CONFIG_BATMAN_ADV_BLA
&batadv_debuginfo_bla_claim_table,
&batadv_debuginfo_bla_backbone_table,
#endif
#ifdef CONFIG_BATMAN_ADV_DAT
&batadv_debuginfo_dat_cache,
#endif
&batadv_debuginfo_transtable_local,
&batadv_debuginfo_vis_data,
Expand Down
Loading

0 comments on commit f1e0b5b

Please sign in to comment.