Skip to content

Commit

Permalink
batman-adv: remove vis functionality
Browse files Browse the repository at this point in the history
This is replaced by a userspace program, we don't need this
functionality to bloat the kernel.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
  • Loading branch information
Simon Wunderlich authored and Antonio Quartulli committed Oct 9, 2013
1 parent 0035f97 commit 9f4980e
Showing 17 changed files with 3 additions and 1,304 deletions.
11 changes: 0 additions & 11 deletions Documentation/ABI/testing/sysfs-class-net-mesh
Original file line number Diff line number Diff line change
@@ -88,14 +88,3 @@ Contact: Marek Lindner <lindner_marek@yahoo.de>
Description:
Defines the routing procotol this mesh instance
uses to find the optimal paths through the mesh.

What: /sys/class/net/<mesh_iface>/mesh/vis_mode
Date: May 2010
Contact: Marek Lindner <lindner_marek@yahoo.de>
Description:
Each batman node only maintains information about its
own local neighborhood, therefore generating graphs
showing the topology of the entire mesh is not easily
feasible without having a central instance to collect
the local topologies from all nodes. This file allows
to activate the collecting (server) mode.
50 changes: 2 additions & 48 deletions Documentation/networking/batman-adv.txt
Original file line number Diff line number Diff line change
@@ -69,16 +69,15 @@ folder:
# aggregated_ogms gw_bandwidth log_level
# ap_isolation gw_mode orig_interval
# bonding gw_sel_class routing_algo
# bridge_loop_avoidance hop_penalty vis_mode
# fragmentation
# bridge_loop_avoidance hop_penalty fragmentation


There is a special folder for debugging information:

# ls /sys/kernel/debug/batman_adv/bat0/
# bla_backbone_table log transtable_global
# bla_claim_table originators transtable_local
# gateways socket vis_data
# gateways socket

Some of the files contain all sort of status information regard-
ing the mesh network. For example, you can view the table of
@@ -127,51 +126,6 @@ ously assigned to interfaces now used by batman advanced, e.g.
# ifconfig eth0 0.0.0.0


VISUALIZATION
-------------

If you want topology visualization, at least one mesh node must
be configured as VIS-server:

# echo "server" > /sys/class/net/bat0/mesh/vis_mode

Each node is either configured as "server" or as "client" (de-
fault: "client"). Clients send their topology data to the server
next to them, and server synchronize with other servers. If there
is no server configured (default) within the mesh, no topology
information will be transmitted. With these "synchronizing
servers", there can be 1 or more vis servers sharing the same (or
at least very similar) data.

When configured as server, you can get a topology snapshot of
your mesh:

# cat /sys/kernel/debug/batman_adv/bat0/vis_data

This raw output is intended to be easily parsable and convertable
with other tools. Have a look at the batctl README if you want a
vis output in dot or json format for instance and how those out-
puts could then be visualised in an image.

The raw format consists of comma separated values per entry where
each entry is giving information about a certain source inter-
face. Each entry can/has to have the following values:
-> "mac" - mac address of an originator's source interface
(each line begins with it)
-> "TQ mac value" - src mac's link quality towards mac address
of a neighbor originator's interface which
is being used for routing
-> "TT mac" - TT announced by source mac
-> "PRIMARY" - this is a primary interface
-> "SEC mac" - secondary mac address of source
(requires preceding PRIMARY)

The TQ value has a range from 4 to 255 with 255 being the best.
The TT entries are showing which hosts are connected to the mesh
via bat0 or being bridged into the mesh network. The PRIMARY/SEC
values are only applied on primary interfaces


LOGGING/DEBUGGING
-----------------

1 change: 0 additions & 1 deletion net/batman-adv/Makefile
Original file line number Diff line number Diff line change
@@ -38,4 +38,3 @@ batman-adv-y += soft-interface.o
batman-adv-y += sysfs.o
batman-adv-y += translation-table.o
batman-adv-y += unicast.o
batman-adv-y += vis.o
8 changes: 0 additions & 8 deletions net/batman-adv/bat_iv_ogm.c
Original file line number Diff line number Diff line change
@@ -687,11 +687,9 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface)
struct batadv_ogm_packet *batadv_ogm_packet;
struct batadv_hard_iface *primary_if;
int *ogm_buff_len = &hard_iface->bat_iv.ogm_buff_len;
int vis_server;
uint32_t seqno;
uint16_t tvlv_len = 0;

vis_server = atomic_read(&bat_priv->vis_mode);
primary_if = batadv_primary_if_get_selected(bat_priv);

if (hard_iface == primary_if) {
@@ -712,11 +710,6 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface)
batadv_ogm_packet->seqno = htonl(seqno);
atomic_inc(&hard_iface->bat_iv.ogm_seqno);

if (vis_server == BATADV_VIS_TYPE_SERVER_SYNC)
batadv_ogm_packet->flags |= BATADV_VIS_SERVER;
else
batadv_ogm_packet->flags &= ~BATADV_VIS_SERVER;

batadv_iv_ogm_slide_own_bcast_window(hard_iface);
batadv_iv_ogm_queue_add(bat_priv, hard_iface->bat_iv.ogm_buff,
hard_iface->bat_iv.ogm_buff_len, hard_iface, 1,
@@ -790,7 +783,6 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,

rcu_read_unlock();

orig_node->flags = batadv_ogm_packet->flags;
neigh_node->last_seen = jiffies;

spin_lock_bh(&neigh_node->lq_update_lock);
9 changes: 0 additions & 9 deletions net/batman-adv/debugfs.c
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@
#include "gateway_common.h"
#include "gateway_client.h"
#include "soft-interface.h"
#include "vis.h"
#include "icmp_socket.h"
#include "bridge_loop_avoidance.h"
#include "distributed-arp-table.h"
@@ -300,12 +299,6 @@ static int batadv_transtable_local_open(struct inode *inode, struct file *file)
return single_open(file, batadv_tt_local_seq_print_text, net_dev);
}

static int batadv_vis_data_open(struct inode *inode, struct file *file)
{
struct net_device *net_dev = (struct net_device *)inode->i_private;
return single_open(file, batadv_vis_seq_print_text, net_dev);
}

struct batadv_debuginfo {
struct attribute attr;
const struct file_operations fops;
@@ -356,7 +349,6 @@ 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);
#ifdef CONFIG_BATMAN_ADV_NC
static BATADV_DEBUGINFO(nc_nodes, S_IRUGO, batadv_nc_nodes_open);
#endif
@@ -373,7 +365,6 @@ static struct batadv_debuginfo *batadv_mesh_debuginfos[] = {
&batadv_debuginfo_dat_cache,
#endif
&batadv_debuginfo_transtable_local,
&batadv_debuginfo_vis_data,
#ifdef CONFIG_BATMAN_ADV_NC
&batadv_debuginfo_nc_nodes,
#endif
9 changes: 0 additions & 9 deletions net/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
@@ -194,22 +194,13 @@ batadv_hardif_get_active(const struct net_device *soft_iface)
static void batadv_primary_if_update_addr(struct batadv_priv *bat_priv,
struct batadv_hard_iface *oldif)
{
struct batadv_vis_packet *vis_packet;
struct batadv_hard_iface *primary_if;
struct sk_buff *skb;

primary_if = batadv_primary_if_get_selected(bat_priv);
if (!primary_if)
goto out;

batadv_dat_init_own_addr(bat_priv, primary_if);

skb = bat_priv->vis.my_info->skb_packet;
vis_packet = (struct batadv_vis_packet *)skb->data;
memcpy(vis_packet->vis_orig, primary_if->net_dev->dev_addr, ETH_ALEN);
memcpy(vis_packet->sender_orig,
primary_if->net_dev->dev_addr, ETH_ALEN);

batadv_bla_update_orig_address(bat_priv, primary_if, oldif);
out:
if (primary_if)
11 changes: 0 additions & 11 deletions net/batman-adv/main.c
Original file line number Diff line number Diff line change
@@ -38,7 +38,6 @@
#include "distributed-arp-table.h"
#include "unicast.h"
#include "gateway_common.h"
#include "vis.h"
#include "hash.h"
#include "bat_algo.h"
#include "network-coding.h"
@@ -112,8 +111,6 @@ int batadv_mesh_init(struct net_device *soft_iface)
spin_lock_init(&bat_priv->tt.roam_list_lock);
spin_lock_init(&bat_priv->tt.last_changeset_lock);
spin_lock_init(&bat_priv->gw.list_lock);
spin_lock_init(&bat_priv->vis.hash_lock);
spin_lock_init(&bat_priv->vis.list_lock);
spin_lock_init(&bat_priv->tvlv.container_list_lock);
spin_lock_init(&bat_priv->tvlv.handler_list_lock);

@@ -137,10 +134,6 @@ int batadv_mesh_init(struct net_device *soft_iface)
batadv_tt_local_add(soft_iface, soft_iface->dev_addr,
BATADV_NULL_IFINDEX);

ret = batadv_vis_init(bat_priv);
if (ret < 0)
goto err;

ret = batadv_bla_init(bat_priv);
if (ret < 0)
goto err;
@@ -173,8 +166,6 @@ void batadv_mesh_free(struct net_device *soft_iface)

batadv_purge_outstanding_packets(bat_priv, NULL);

batadv_vis_quit(bat_priv);

batadv_gw_node_purge(bat_priv);
batadv_nc_mesh_free(bat_priv);
batadv_dat_free(bat_priv);
@@ -412,8 +403,6 @@ static void batadv_recv_handler_init(void)
batadv_rx_handler[BATADV_UNICAST_FRAG] = batadv_recv_ucast_frag_packet;
/* broadcast packet */
batadv_rx_handler[BATADV_BCAST] = batadv_recv_bcast_packet;
/* vis packet */
batadv_rx_handler[BATADV_VIS] = batadv_recv_vis_packet;
/* unicast tvlv packet */
batadv_rx_handler[BATADV_UNICAST_TVLV] = batadv_recv_unicast_tvlv;
}
2 changes: 0 additions & 2 deletions net/batman-adv/main.h
Original file line number Diff line number Diff line change
@@ -86,8 +86,6 @@
/* numbers of originator to contact for any PUT/GET DHT operation */
#define BATADV_DAT_CANDIDATES_NUM 3

#define BATADV_VIS_INTERVAL 5000 /* 5 seconds */

/* how much worse secondary interfaces may be to be considered as bonding
* candidates
*/
21 changes: 1 addition & 20 deletions net/batman-adv/packet.h
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@ enum batadv_packettype {
BATADV_ICMP = 0x02,
BATADV_UNICAST = 0x03,
BATADV_BCAST = 0x04,
BATADV_VIS = 0x05,
BATADV_UNICAST_FRAG = 0x06,
BATADV_UNICAST_4ADDR = 0x09,
BATADV_CODED = 0x0a,
@@ -56,7 +55,6 @@ enum batadv_subtype {
enum batadv_iv_flags {
BATADV_NOT_BEST_NEXT_HOP = BIT(3),
BATADV_PRIMARIES_FIRST_HOP = BIT(4),
BATADV_VIS_SERVER = BIT(5),
BATADV_DIRECTLINK = BIT(6),
};

@@ -69,12 +67,6 @@ enum batadv_icmp_packettype {
BATADV_PARAMETER_PROBLEM = 12,
};

/* vis defines */
enum batadv_vis_packettype {
BATADV_VIS_TYPE_SERVER_SYNC = 0,
BATADV_VIS_TYPE_CLIENT_UPDATE = 1,
};

/* fragmentation defines */
enum batadv_unicast_frag_flags {
BATADV_UNI_FRAG_HEAD = BIT(0),
@@ -161,7 +153,7 @@ struct batadv_header {
*/
struct batadv_ogm_packet {
struct batadv_header header;
uint8_t flags; /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
uint8_t flags; /* 0x40: DIRECTLINK flag ... */
__be32 seqno;
uint8_t orig[ETH_ALEN];
uint8_t prev_sender[ETH_ALEN];
@@ -257,17 +249,6 @@ struct batadv_bcast_packet {

#pragma pack()

struct batadv_vis_packet {
struct batadv_header header;
uint8_t vis_type; /* which type of vis-participant sent this? */
__be32 seqno; /* sequence number */
uint8_t entries; /* number of entries behind this struct */
uint8_t reserved;
uint8_t vis_orig[ETH_ALEN]; /* originator reporting its neighbors */
uint8_t target_orig[ETH_ALEN]; /* who should receive this packet */
uint8_t sender_orig[ETH_ALEN]; /* who sent or forwarded this packet */
};

/**
* struct batadv_coded_packet - network coded packet
* @header: common batman packet header and ttl of first included packet
51 changes: 0 additions & 51 deletions net/batman-adv/routing.c
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@
#include "icmp_socket.h"
#include "translation-table.h"
#include "originator.h"
#include "vis.h"
#include "unicast.h"
#include "bridge_loop_avoidance.h"
#include "distributed-arp-table.h"
@@ -1168,53 +1167,3 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
batadv_orig_node_free_ref(orig_node);
return ret;
}

int batadv_recv_vis_packet(struct sk_buff *skb,
struct batadv_hard_iface *recv_if)
{
struct batadv_vis_packet *vis_packet;
struct ethhdr *ethhdr;
struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface);
int hdr_size = sizeof(*vis_packet);

/* keep skb linear */
if (skb_linearize(skb) < 0)
return NET_RX_DROP;

if (unlikely(!pskb_may_pull(skb, hdr_size)))
return NET_RX_DROP;

vis_packet = (struct batadv_vis_packet *)skb->data;
ethhdr = eth_hdr(skb);

/* not for me */
if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest))
return NET_RX_DROP;

/* ignore own packets */
if (batadv_is_my_mac(bat_priv, vis_packet->vis_orig))
return NET_RX_DROP;

if (batadv_is_my_mac(bat_priv, vis_packet->sender_orig))
return NET_RX_DROP;

switch (vis_packet->vis_type) {
case BATADV_VIS_TYPE_SERVER_SYNC:
batadv_receive_server_sync_packet(bat_priv, vis_packet,
skb_headlen(skb));
break;

case BATADV_VIS_TYPE_CLIENT_UPDATE:
batadv_receive_client_update_packet(bat_priv, vis_packet,
skb_headlen(skb));
break;

default: /* ignore unknown packet */
break;
}

/* We take a copy of the data in the packet, so we should
* always free the skbuf.
*/
return NET_RX_DROP;
}
2 changes: 0 additions & 2 deletions net/batman-adv/routing.h
Original file line number Diff line number Diff line change
@@ -34,8 +34,6 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
struct batadv_hard_iface *recv_if);
int batadv_recv_bcast_packet(struct sk_buff *skb,
struct batadv_hard_iface *recv_if);
int batadv_recv_vis_packet(struct sk_buff *skb,
struct batadv_hard_iface *recv_if);
int batadv_recv_tt_query(struct sk_buff *skb,
struct batadv_hard_iface *recv_if);
int batadv_recv_roam_adv(struct sk_buff *skb,
1 change: 0 additions & 1 deletion net/batman-adv/send.c
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@
#include "translation-table.h"
#include "soft-interface.h"
#include "hard-interface.h"
#include "vis.h"
#include "gateway_common.h"
#include "originator.h"
#include "network-coding.h"
1 change: 0 additions & 1 deletion net/batman-adv/soft-interface.c
Original file line number Diff line number Diff line change
@@ -469,7 +469,6 @@ static int batadv_softif_init_late(struct net_device *dev)
atomic_set(&bat_priv->distributed_arp_table, 1);
#endif
atomic_set(&bat_priv->ap_isolation, 0);
atomic_set(&bat_priv->vis_mode, BATADV_VIS_TYPE_CLIENT_UPDATE);
atomic_set(&bat_priv->gw_mode, BATADV_GW_MODE_OFF);
atomic_set(&bat_priv->gw_sel_class, 20);
atomic_set(&bat_priv->gw.bandwidth_down, 100);
Loading

0 comments on commit 9f4980e

Please sign in to comment.