batman-adv: Reformat multiline comments to consistent style
batman-adv doesn't follow the style for multiline comments that David S. Miller prefers. All comments should be reformatted to follow this consistent style to make the code slightly more readable. Signed-off-by: Sven Eckelmann <sven@narfation.org>
This commit is contained in:
parent
3193e8fdfa
commit
9cfc7bd608
40 changed files with 349 additions and 388 deletions
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2011-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2011-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_BAT_ALGO_H_
|
#ifndef _NET_BATMAN_ADV_BAT_ALGO_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,10 +15,8 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_DEBUGFS_H_
|
#ifndef _NET_BATMAN_ADV_DEBUGFS_H_
|
||||||
#define _NET_BATMAN_ADV_DEBUGFS_H_
|
#define _NET_BATMAN_ADV_DEBUGFS_H_
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -170,7 +168,8 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet,
|
||||||
batman_ogm_packet->tt_num_changes)) {
|
batman_ogm_packet->tt_num_changes)) {
|
||||||
|
|
||||||
/* we might have aggregated direct link packets with an
|
/* we might have aggregated direct link packets with an
|
||||||
* ordinary base packet */
|
* ordinary base packet
|
||||||
|
*/
|
||||||
if ((forw_packet->direct_link_flags & (1 << packet_num)) &&
|
if ((forw_packet->direct_link_flags & (1 << packet_num)) &&
|
||||||
(forw_packet->if_incoming == hard_iface))
|
(forw_packet->if_incoming == hard_iface))
|
||||||
batman_ogm_packet->flags |= DIRECTLINK;
|
batman_ogm_packet->flags |= DIRECTLINK;
|
||||||
|
@ -237,8 +236,9 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
|
||||||
if (!primary_if)
|
if (!primary_if)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* multihomed peer assumed */
|
/* multihomed peer assumed
|
||||||
/* non-primary OGMs are only broadcasted on their interface */
|
* non-primary OGMs are only broadcasted on their interface
|
||||||
|
*/
|
||||||
if ((directlink && (batman_ogm_packet->header.ttl == 1)) ||
|
if ((directlink && (batman_ogm_packet->header.ttl == 1)) ||
|
||||||
(forw_packet->own && (forw_packet->if_incoming != primary_if))) {
|
(forw_packet->own && (forw_packet->if_incoming != primary_if))) {
|
||||||
|
|
||||||
|
@ -292,41 +292,39 @@ static bool bat_iv_ogm_can_aggregate(const struct batman_ogm_packet
|
||||||
|
|
||||||
batman_ogm_packet = (struct batman_ogm_packet *)forw_packet->skb->data;
|
batman_ogm_packet = (struct batman_ogm_packet *)forw_packet->skb->data;
|
||||||
|
|
||||||
/**
|
/* we can aggregate the current packet to this aggregated packet
|
||||||
* we can aggregate the current packet to this aggregated packet
|
|
||||||
* if:
|
* if:
|
||||||
*
|
*
|
||||||
* - the send time is within our MAX_AGGREGATION_MS time
|
* - the send time is within our MAX_AGGREGATION_MS time
|
||||||
* - the resulting packet wont be bigger than
|
* - the resulting packet wont be bigger than
|
||||||
* MAX_AGGREGATION_BYTES
|
* MAX_AGGREGATION_BYTES
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (time_before(send_time, forw_packet->send_time) &&
|
if (time_before(send_time, forw_packet->send_time) &&
|
||||||
time_after_eq(send_time + msecs_to_jiffies(MAX_AGGREGATION_MS),
|
time_after_eq(send_time + msecs_to_jiffies(MAX_AGGREGATION_MS),
|
||||||
forw_packet->send_time) &&
|
forw_packet->send_time) &&
|
||||||
(aggregated_bytes <= MAX_AGGREGATION_BYTES)) {
|
(aggregated_bytes <= MAX_AGGREGATION_BYTES)) {
|
||||||
|
|
||||||
/**
|
/* check aggregation compatibility
|
||||||
* check aggregation compatibility
|
|
||||||
* -> direct link packets are broadcasted on
|
* -> direct link packets are broadcasted on
|
||||||
* their interface only
|
* their interface only
|
||||||
* -> aggregate packet if the current packet is
|
* -> aggregate packet if the current packet is
|
||||||
* a "global" packet as well as the base
|
* a "global" packet as well as the base
|
||||||
* packet
|
* packet
|
||||||
*/
|
*/
|
||||||
|
|
||||||
primary_if = primary_if_get_selected(bat_priv);
|
primary_if = primary_if_get_selected(bat_priv);
|
||||||
if (!primary_if)
|
if (!primary_if)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* packets without direct link flag and high TTL
|
/* packets without direct link flag and high TTL
|
||||||
* are flooded through the net */
|
* are flooded through the net
|
||||||
|
*/
|
||||||
if ((!directlink) &&
|
if ((!directlink) &&
|
||||||
(!(batman_ogm_packet->flags & DIRECTLINK)) &&
|
(!(batman_ogm_packet->flags & DIRECTLINK)) &&
|
||||||
(batman_ogm_packet->header.ttl != 1) &&
|
(batman_ogm_packet->header.ttl != 1) &&
|
||||||
|
|
||||||
/* own packets originating non-primary
|
/* own packets originating non-primary
|
||||||
* interfaces leave only that interface */
|
* interfaces leave only that interface
|
||||||
|
*/
|
||||||
((!forw_packet->own) ||
|
((!forw_packet->own) ||
|
||||||
(forw_packet->if_incoming == primary_if))) {
|
(forw_packet->if_incoming == primary_if))) {
|
||||||
res = true;
|
res = true;
|
||||||
|
@ -334,14 +332,16 @@ static bool bat_iv_ogm_can_aggregate(const struct batman_ogm_packet
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if the incoming packet is sent via this one
|
/* if the incoming packet is sent via this one
|
||||||
* interface only - we still can aggregate */
|
* interface only - we still can aggregate
|
||||||
|
*/
|
||||||
if ((directlink) &&
|
if ((directlink) &&
|
||||||
(new_batman_ogm_packet->header.ttl == 1) &&
|
(new_batman_ogm_packet->header.ttl == 1) &&
|
||||||
(forw_packet->if_incoming == if_incoming) &&
|
(forw_packet->if_incoming == if_incoming) &&
|
||||||
|
|
||||||
/* packets from direct neighbors or
|
/* packets from direct neighbors or
|
||||||
* own secondary interface packets
|
* own secondary interface packets
|
||||||
* (= secondary interface packets in general) */
|
* (= secondary interface packets in general)
|
||||||
|
*/
|
||||||
(batman_ogm_packet->flags & DIRECTLINK ||
|
(batman_ogm_packet->flags & DIRECTLINK ||
|
||||||
(forw_packet->own &&
|
(forw_packet->own &&
|
||||||
forw_packet->if_incoming != primary_if))) {
|
forw_packet->if_incoming != primary_if))) {
|
||||||
|
@ -457,8 +457,7 @@ static void bat_iv_ogm_queue_add(struct bat_priv *bat_priv,
|
||||||
int packet_len, struct hard_iface *if_incoming,
|
int packet_len, struct hard_iface *if_incoming,
|
||||||
int own_packet, unsigned long send_time)
|
int own_packet, unsigned long send_time)
|
||||||
{
|
{
|
||||||
/**
|
/* _aggr -> pointer to the packet we want to aggregate with
|
||||||
* _aggr -> pointer to the packet we want to aggregate with
|
|
||||||
* _pos -> pointer to the position in the queue
|
* _pos -> pointer to the position in the queue
|
||||||
*/
|
*/
|
||||||
struct forw_packet *forw_packet_aggr = NULL, *forw_packet_pos = NULL;
|
struct forw_packet *forw_packet_aggr = NULL, *forw_packet_pos = NULL;
|
||||||
|
@ -487,13 +486,13 @@ static void bat_iv_ogm_queue_add(struct bat_priv *bat_priv,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* nothing to aggregate with - either aggregation disabled or no
|
/* nothing to aggregate with - either aggregation disabled or no
|
||||||
* suitable aggregation packet found */
|
* suitable aggregation packet found
|
||||||
|
*/
|
||||||
if (!forw_packet_aggr) {
|
if (!forw_packet_aggr) {
|
||||||
/* the following section can run without the lock */
|
/* the following section can run without the lock */
|
||||||
spin_unlock_bh(&bat_priv->forw_bat_list_lock);
|
spin_unlock_bh(&bat_priv->forw_bat_list_lock);
|
||||||
|
|
||||||
/**
|
/* if we could not aggregate this packet with one of the others
|
||||||
* if we could not aggregate this packet with one of the others
|
|
||||||
* we hold it back for a while, so that it might be aggregated
|
* we hold it back for a while, so that it might be aggregated
|
||||||
* later on
|
* later on
|
||||||
*/
|
*/
|
||||||
|
@ -691,7 +690,8 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
|
||||||
batadv_bonding_candidate_add(orig_node, neigh_node);
|
batadv_bonding_candidate_add(orig_node, neigh_node);
|
||||||
|
|
||||||
/* if this neighbor already is our next hop there is nothing
|
/* if this neighbor already is our next hop there is nothing
|
||||||
* to change */
|
* to change
|
||||||
|
*/
|
||||||
router = batadv_orig_node_get_router(orig_node);
|
router = batadv_orig_node_get_router(orig_node);
|
||||||
if (router == neigh_node)
|
if (router == neigh_node)
|
||||||
goto update_tt;
|
goto update_tt;
|
||||||
|
@ -701,7 +701,8 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
|
||||||
goto update_tt;
|
goto update_tt;
|
||||||
|
|
||||||
/* if the TQ is the same and the link not more symmetric we
|
/* if the TQ is the same and the link not more symmetric we
|
||||||
* won't consider it either */
|
* won't consider it either
|
||||||
|
*/
|
||||||
if (router && (neigh_node->tq_avg == router->tq_avg)) {
|
if (router && (neigh_node->tq_avg == router->tq_avg)) {
|
||||||
orig_node_tmp = router->orig_node;
|
orig_node_tmp = router->orig_node;
|
||||||
spin_lock_bh(&orig_node_tmp->ogm_cnt_lock);
|
spin_lock_bh(&orig_node_tmp->ogm_cnt_lock);
|
||||||
|
@ -723,7 +724,8 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
|
||||||
|
|
||||||
update_tt:
|
update_tt:
|
||||||
/* I have to check for transtable changes only if the OGM has been
|
/* I have to check for transtable changes only if the OGM has been
|
||||||
* sent through a primary interface */
|
* sent through a primary interface
|
||||||
|
*/
|
||||||
if (((batman_ogm_packet->orig != ethhdr->h_source) &&
|
if (((batman_ogm_packet->orig != ethhdr->h_source) &&
|
||||||
(batman_ogm_packet->header.ttl > 2)) ||
|
(batman_ogm_packet->header.ttl > 2)) ||
|
||||||
(batman_ogm_packet->flags & PRIMARIES_FIRST_HOP))
|
(batman_ogm_packet->flags & PRIMARIES_FIRST_HOP))
|
||||||
|
@ -812,15 +814,17 @@ static int bat_iv_ogm_calc_tq(struct orig_node *orig_node,
|
||||||
total_count = (orig_eq_count > neigh_rq_count ?
|
total_count = (orig_eq_count > neigh_rq_count ?
|
||||||
neigh_rq_count : orig_eq_count);
|
neigh_rq_count : orig_eq_count);
|
||||||
|
|
||||||
/* if we have too few packets (too less data) we set tq_own to zero */
|
/* if we have too few packets (too less data) we set tq_own to zero
|
||||||
/* if we receive too few packets it is not considered bidirectional */
|
* if we receive too few packets it is not considered bidirectional
|
||||||
|
*/
|
||||||
if ((total_count < TQ_LOCAL_BIDRECT_SEND_MINIMUM) ||
|
if ((total_count < TQ_LOCAL_BIDRECT_SEND_MINIMUM) ||
|
||||||
(neigh_rq_count < TQ_LOCAL_BIDRECT_RECV_MINIMUM))
|
(neigh_rq_count < TQ_LOCAL_BIDRECT_RECV_MINIMUM))
|
||||||
tq_own = 0;
|
tq_own = 0;
|
||||||
else
|
else
|
||||||
/* neigh_node->real_packet_count is never zero as we
|
/* neigh_node->real_packet_count is never zero as we
|
||||||
* only purge old information when getting new
|
* only purge old information when getting new
|
||||||
* information */
|
* information
|
||||||
|
*/
|
||||||
tq_own = (TQ_MAX_VALUE * total_count) / neigh_rq_count;
|
tq_own = (TQ_MAX_VALUE * total_count) / neigh_rq_count;
|
||||||
|
|
||||||
/* 1 - ((1-x) ** 3), normalized to TQ_MAX_VALUE this does
|
/* 1 - ((1-x) ** 3), normalized to TQ_MAX_VALUE this does
|
||||||
|
@ -846,7 +850,8 @@ static int bat_iv_ogm_calc_tq(struct orig_node *orig_node,
|
||||||
neigh_rq_count, tq_own, tq_asym_penalty, batman_ogm_packet->tq);
|
neigh_rq_count, tq_own, tq_asym_penalty, batman_ogm_packet->tq);
|
||||||
|
|
||||||
/* if link has the minimum required transmission quality
|
/* if link has the minimum required transmission quality
|
||||||
* consider it bidirectional */
|
* consider it bidirectional
|
||||||
|
*/
|
||||||
if (batman_ogm_packet->tq >= TQ_TOTAL_BIDRECT_LIMIT)
|
if (batman_ogm_packet->tq >= TQ_TOTAL_BIDRECT_LIMIT)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
|
||||||
|
@ -1039,8 +1044,9 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* neighbor has to indicate direct link and it has to
|
/* neighbor has to indicate direct link and it has to
|
||||||
* come via the corresponding interface */
|
* come via the corresponding interface
|
||||||
/* save packet seqno for bidirectional check */
|
* save packet seqno for bidirectional check
|
||||||
|
*/
|
||||||
if (has_directlink_flag &&
|
if (has_directlink_flag &&
|
||||||
compare_eth(if_incoming->net_dev->dev_addr,
|
compare_eth(if_incoming->net_dev->dev_addr,
|
||||||
batman_ogm_packet->orig)) {
|
batman_ogm_packet->orig)) {
|
||||||
|
@ -1117,7 +1123,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if sender is a direct neighbor the sender mac equals
|
/* if sender is a direct neighbor the sender mac equals
|
||||||
* originator mac */
|
* originator mac
|
||||||
|
*/
|
||||||
orig_neigh_node = (is_single_hop_neigh ?
|
orig_neigh_node = (is_single_hop_neigh ?
|
||||||
orig_node :
|
orig_node :
|
||||||
batadv_get_orig_node(bat_priv, ethhdr->h_source));
|
batadv_get_orig_node(bat_priv, ethhdr->h_source));
|
||||||
|
@ -1127,7 +1134,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
|
||||||
orig_neigh_router = batadv_orig_node_get_router(orig_neigh_node);
|
orig_neigh_router = batadv_orig_node_get_router(orig_neigh_node);
|
||||||
|
|
||||||
/* drop packet if sender is not a direct neighbor and if we
|
/* drop packet if sender is not a direct neighbor and if we
|
||||||
* don't route towards it */
|
* don't route towards it
|
||||||
|
*/
|
||||||
if (!is_single_hop_neigh && (!orig_neigh_router)) {
|
if (!is_single_hop_neigh && (!orig_neigh_router)) {
|
||||||
bat_dbg(DBG_BATMAN, bat_priv,
|
bat_dbg(DBG_BATMAN, bat_priv,
|
||||||
"Drop packet: OGM via unknown neighbor!\n");
|
"Drop packet: OGM via unknown neighbor!\n");
|
||||||
|
@ -1141,7 +1149,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
|
||||||
batman_ogm_packet);
|
batman_ogm_packet);
|
||||||
|
|
||||||
/* update ranking if it is not a duplicate or has the same
|
/* update ranking if it is not a duplicate or has the same
|
||||||
* seqno and similar ttl as the non-duplicate */
|
* seqno and similar ttl as the non-duplicate
|
||||||
|
*/
|
||||||
if (is_bidirectional &&
|
if (is_bidirectional &&
|
||||||
(!is_duplicate ||
|
(!is_duplicate ||
|
||||||
((orig_node->last_real_seqno == ntohl(batman_ogm_packet->seqno)) &&
|
((orig_node->last_real_seqno == ntohl(batman_ogm_packet->seqno)) &&
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -84,7 +82,8 @@ ssize_t show_##_name(struct kobject *kobj, \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
/* Use this, if you are going to turn a [name] in the soft-interface
|
/* Use this, if you are going to turn a [name] in the soft-interface
|
||||||
* (bat_priv) on or off */
|
* (bat_priv) on or off
|
||||||
|
*/
|
||||||
#define BAT_ATTR_SIF_BOOL(_name, _mode, _post_func) \
|
#define BAT_ATTR_SIF_BOOL(_name, _mode, _post_func) \
|
||||||
static BAT_ATTR_SIF_STORE_BOOL(_name, _post_func) \
|
static BAT_ATTR_SIF_STORE_BOOL(_name, _post_func) \
|
||||||
static BAT_ATTR_SIF_SHOW_BOOL(_name) \
|
static BAT_ATTR_SIF_SHOW_BOOL(_name) \
|
||||||
|
@ -110,7 +109,8 @@ ssize_t show_##_name(struct kobject *kobj, \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
/* Use this, if you are going to set [name] in the soft-interface
|
/* Use this, if you are going to set [name] in the soft-interface
|
||||||
* (bat_priv) to an unsigned integer value */
|
* (bat_priv) to an unsigned integer value
|
||||||
|
*/
|
||||||
#define BAT_ATTR_SIF_UINT(_name, _mode, _min, _max, _post_func) \
|
#define BAT_ATTR_SIF_UINT(_name, _mode, _min, _max, _post_func) \
|
||||||
static BAT_ATTR_SIF_STORE_UINT(_name, _min, _max, _post_func) \
|
static BAT_ATTR_SIF_STORE_UINT(_name, _min, _max, _post_func) \
|
||||||
static BAT_ATTR_SIF_SHOW_UINT(_name) \
|
static BAT_ATTR_SIF_SHOW_UINT(_name) \
|
||||||
|
@ -155,7 +155,8 @@ ssize_t show_##_name(struct kobject *kobj, \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use this, if you are going to set [name] in hard_iface to an
|
/* Use this, if you are going to set [name] in hard_iface to an
|
||||||
* unsigned integer value*/
|
* unsigned integer value
|
||||||
|
*/
|
||||||
#define BAT_ATTR_HIF_UINT(_name, _mode, _min, _max, _post_func) \
|
#define BAT_ATTR_HIF_UINT(_name, _mode, _min, _max, _post_func) \
|
||||||
static BAT_ATTR_HIF_STORE_UINT(_name, _min, _max, _post_func) \
|
static BAT_ATTR_HIF_STORE_UINT(_name, _min, _max, _post_func) \
|
||||||
static BAT_ATTR_HIF_SHOW_UINT(_name) \
|
static BAT_ATTR_HIF_SHOW_UINT(_name) \
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,10 +15,8 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_SYSFS_H_
|
#ifndef _NET_BATMAN_ADV_SYSFS_H_
|
||||||
#define _NET_BATMAN_ADV_SYSFS_H_
|
#define _NET_BATMAN_ADV_SYSFS_H_
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Simon Wunderlich, Marek Lindner
|
* Simon Wunderlich, Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -46,8 +44,8 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
|
||||||
struct bat_priv *bat_priv = priv;
|
struct bat_priv *bat_priv = priv;
|
||||||
|
|
||||||
/* sequence number is slightly older. We already got a sequence number
|
/* sequence number is slightly older. We already got a sequence number
|
||||||
* higher than this one, so we just mark it. */
|
* higher than this one, so we just mark it.
|
||||||
|
*/
|
||||||
if ((seq_num_diff <= 0) && (seq_num_diff > -TQ_LOCAL_WINDOW_SIZE)) {
|
if ((seq_num_diff <= 0) && (seq_num_diff > -TQ_LOCAL_WINDOW_SIZE)) {
|
||||||
if (set_mark)
|
if (set_mark)
|
||||||
bat_set_bit(seq_bits, -seq_num_diff);
|
bat_set_bit(seq_bits, -seq_num_diff);
|
||||||
|
@ -55,8 +53,8 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sequence number is slightly newer, so we shift the window and
|
/* sequence number is slightly newer, so we shift the window and
|
||||||
* set the mark if required */
|
* set the mark if required
|
||||||
|
*/
|
||||||
if ((seq_num_diff > 0) && (seq_num_diff < TQ_LOCAL_WINDOW_SIZE)) {
|
if ((seq_num_diff > 0) && (seq_num_diff < TQ_LOCAL_WINDOW_SIZE)) {
|
||||||
batadv_bitmap_shift_left(seq_bits, seq_num_diff);
|
batadv_bitmap_shift_left(seq_bits, seq_num_diff);
|
||||||
|
|
||||||
|
@ -66,7 +64,6 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sequence number is much newer, probably missed a lot of packets */
|
/* sequence number is much newer, probably missed a lot of packets */
|
||||||
|
|
||||||
if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE) &&
|
if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE) &&
|
||||||
(seq_num_diff < EXPECTED_SEQNO_RANGE)) {
|
(seq_num_diff < EXPECTED_SEQNO_RANGE)) {
|
||||||
bat_dbg(DBG_BATMAN, bat_priv,
|
bat_dbg(DBG_BATMAN, bat_priv,
|
||||||
|
@ -81,8 +78,8 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
|
||||||
/* received a much older packet. The other host either restarted
|
/* received a much older packet. The other host either restarted
|
||||||
* or the old packet got delayed somewhere in the network. The
|
* or the old packet got delayed somewhere in the network. The
|
||||||
* packet should be dropped without calling this function if the
|
* packet should be dropped without calling this function if the
|
||||||
* seqno window is protected. */
|
* seqno window is protected.
|
||||||
|
*/
|
||||||
if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
|
if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
|
||||||
(seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
|
(seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Simon Wunderlich, Marek Lindner
|
* Simon Wunderlich, Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,14 +15,14 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_BITARRAY_H_
|
#ifndef _NET_BATMAN_ADV_BITARRAY_H_
|
||||||
#define _NET_BATMAN_ADV_BITARRAY_H_
|
#define _NET_BATMAN_ADV_BITARRAY_H_
|
||||||
|
|
||||||
/* returns true if the corresponding bit in the given seq_bits indicates true
|
/* returns true if the corresponding bit in the given seq_bits indicates true
|
||||||
* and curr_seqno is within range of last_seqno */
|
* and curr_seqno is within range of last_seqno
|
||||||
|
*/
|
||||||
static inline int bat_test_bit(const unsigned long *seq_bits,
|
static inline int bat_test_bit(const unsigned long *seq_bits,
|
||||||
uint32_t last_seqno, uint32_t curr_seqno)
|
uint32_t last_seqno, uint32_t curr_seqno)
|
||||||
{
|
{
|
||||||
|
@ -47,7 +46,8 @@ static inline void bat_set_bit(unsigned long *seq_bits, int32_t n)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* receive and process one packet, returns 1 if received seq_num is considered
|
/* receive and process one packet, returns 1 if received seq_num is considered
|
||||||
* new, 0 if old */
|
* new, 0 if old
|
||||||
|
*/
|
||||||
int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
|
int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
|
||||||
int32_t seq_num_diff, int set_mark);
|
int32_t seq_num_diff, int set_mark);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2011-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2011-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Simon Wunderlich
|
* Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -123,8 +121,7 @@ static void claim_free_ref(struct claim *claim)
|
||||||
call_rcu(&claim->rcu, claim_free_rcu);
|
call_rcu(&claim->rcu, claim_free_rcu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @data: search data (may be local/static data)
|
* @data: search data (may be local/static data)
|
||||||
*
|
*
|
||||||
* looks for a claim in the hash, and returns it if found
|
* looks for a claim in the hash, and returns it if found
|
||||||
|
@ -162,8 +159,7 @@ static struct claim *claim_hash_find(struct bat_priv *bat_priv,
|
||||||
return claim_tmp;
|
return claim_tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @addr: the address of the originator
|
* @addr: the address of the originator
|
||||||
* @vid: the VLAN ID
|
* @vid: the VLAN ID
|
||||||
*
|
*
|
||||||
|
@ -241,8 +237,7 @@ static void bla_del_backbone_claims(struct backbone_gw *backbone_gw)
|
||||||
backbone_gw->crc = BLA_CRC_INIT;
|
backbone_gw->crc = BLA_CRC_INIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @orig: the mac address to be announced within the claim
|
* @orig: the mac address to be announced within the claim
|
||||||
* @vid: the VLAN ID
|
* @vid: the VLAN ID
|
||||||
* @claimtype: the type of the claim (CLAIM, UNCLAIM, ANNOUNCE, ...)
|
* @claimtype: the type of the claim (CLAIM, UNCLAIM, ANNOUNCE, ...)
|
||||||
|
@ -347,8 +342,7 @@ static void bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac,
|
||||||
hardif_free_ref(primary_if);
|
hardif_free_ref(primary_if);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @orig: the mac address of the originator
|
* @orig: the mac address of the originator
|
||||||
* @vid: the VLAN ID
|
* @vid: the VLAN ID
|
||||||
*
|
*
|
||||||
|
@ -422,8 +416,7 @@ static void bla_update_own_backbone_gw(struct bat_priv *bat_priv,
|
||||||
backbone_gw_free_ref(backbone_gw);
|
backbone_gw_free_ref(backbone_gw);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @vid: the vid where the request came on
|
* @vid: the vid where the request came on
|
||||||
*
|
*
|
||||||
* Repeat all of our own claims, and finally send an ANNOUNCE frame
|
* Repeat all of our own claims, and finally send an ANNOUNCE frame
|
||||||
|
@ -468,8 +461,7 @@ static void bla_answer_request(struct bat_priv *bat_priv,
|
||||||
backbone_gw_free_ref(backbone_gw);
|
backbone_gw_free_ref(backbone_gw);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @backbone_gw: the backbone gateway from whom we are out of sync
|
||||||
* @backbone_gw: the backbone gateway from whom we are out of sync
|
|
||||||
*
|
*
|
||||||
* When the crc is wrong, ask the backbone gateway for a full table update.
|
* When the crc is wrong, ask the backbone gateway for a full table update.
|
||||||
* After the request, it will repeat all of his own claims and finally
|
* After the request, it will repeat all of his own claims and finally
|
||||||
|
@ -495,8 +487,7 @@ static void bla_send_request(struct backbone_gw *backbone_gw)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @backbone_gw: our backbone gateway which should be announced
|
* @backbone_gw: our backbone gateway which should be announced
|
||||||
*
|
*
|
||||||
* This function sends an announcement. It is called from multiple
|
* This function sends an announcement. It is called from multiple
|
||||||
|
@ -516,8 +507,7 @@ static void bla_send_announce(struct bat_priv *bat_priv,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @mac: the mac address of the claim
|
* @mac: the mac address of the claim
|
||||||
* @vid: the VLAN ID of the frame
|
* @vid: the VLAN ID of the frame
|
||||||
* @backbone_gw: the backbone gateway which claims it
|
* @backbone_gw: the backbone gateway which claims it
|
||||||
|
@ -731,8 +721,7 @@ static int handle_claim(struct bat_priv *bat_priv,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @hw_src: the Hardware source in the ARP Header
|
* @hw_src: the Hardware source in the ARP Header
|
||||||
* @hw_dst: the Hardware destination in the ARP Header
|
* @hw_dst: the Hardware destination in the ARP Header
|
||||||
* @ethhdr: pointer to the Ethernet header of the claim frame
|
* @ethhdr: pointer to the Ethernet header of the claim frame
|
||||||
|
@ -810,8 +799,7 @@ static int check_claim_group(struct bat_priv *bat_priv,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @skb: the frame to be checked
|
* @skb: the frame to be checked
|
||||||
*
|
*
|
||||||
* Check if this is a claim frame, and process it accordingly.
|
* Check if this is a claim frame, and process it accordingly.
|
||||||
|
@ -860,7 +848,6 @@ static int bla_process_claim(struct bat_priv *bat_priv,
|
||||||
/* Check whether the ARP frame carries a valid
|
/* Check whether the ARP frame carries a valid
|
||||||
* IP information
|
* IP information
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (arphdr->ar_hrd != htons(ARPHRD_ETHER))
|
if (arphdr->ar_hrd != htons(ARPHRD_ETHER))
|
||||||
return 0;
|
return 0;
|
||||||
if (arphdr->ar_pro != htons(ETH_P_IP))
|
if (arphdr->ar_pro != htons(ETH_P_IP))
|
||||||
|
@ -963,8 +950,7 @@ static void bla_purge_backbone_gw(struct bat_priv *bat_priv, int now)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @primary_if: the selected primary interface, may be NULL if now is set
|
* @primary_if: the selected primary interface, may be NULL if now is set
|
||||||
* @now: whether the whole hash shall be wiped now
|
* @now: whether the whole hash shall be wiped now
|
||||||
*
|
*
|
||||||
|
@ -1011,13 +997,11 @@ static void bla_purge_claims(struct bat_priv *bat_priv,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @primary_if: the new selected primary_if
|
* @primary_if: the new selected primary_if
|
||||||
* @oldif: the old primary interface, may be NULL
|
* @oldif: the old primary interface, may be NULL
|
||||||
*
|
*
|
||||||
* Update the backbone gateways when the own orig address changes.
|
* Update the backbone gateways when the own orig address changes.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
|
void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
|
||||||
struct hard_iface *primary_if,
|
struct hard_iface *primary_if,
|
||||||
|
@ -1183,8 +1167,7 @@ int batadv_bla_init(struct bat_priv *bat_priv)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @bcast_packet: originator mac address
|
* @bcast_packet: originator mac address
|
||||||
* @hdr_size: maximum length of the frame
|
* @hdr_size: maximum length of the frame
|
||||||
*
|
*
|
||||||
|
@ -1196,9 +1179,7 @@ int batadv_bla_init(struct bat_priv *bat_priv)
|
||||||
* with a good chance that it is the same packet. If it is furthermore
|
* with a good chance that it is the same packet. If it is furthermore
|
||||||
* sent by another host, drop it. We allow equal packets from
|
* sent by another host, drop it. We allow equal packets from
|
||||||
* the same host however as this might be intended.
|
* the same host however as this might be intended.
|
||||||
*
|
*/
|
||||||
**/
|
|
||||||
|
|
||||||
int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv,
|
int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv,
|
||||||
struct bcast_packet *bcast_packet,
|
struct bcast_packet *bcast_packet,
|
||||||
int hdr_size)
|
int hdr_size)
|
||||||
|
@ -1250,16 +1231,13 @@ int batadv_bla_check_bcast_duplist(struct bat_priv *bat_priv,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @orig: originator mac address
|
* @orig: originator mac address
|
||||||
*
|
*
|
||||||
* check if the originator is a gateway for any VLAN ID.
|
* check if the originator is a gateway for any VLAN ID.
|
||||||
*
|
*
|
||||||
* returns 1 if it is found, 0 otherwise
|
* returns 1 if it is found, 0 otherwise
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig)
|
int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig)
|
||||||
{
|
{
|
||||||
struct hashtable_t *hash = bat_priv->backbone_hash;
|
struct hashtable_t *hash = bat_priv->backbone_hash;
|
||||||
|
@ -1291,15 +1269,13 @@ int batadv_bla_is_backbone_gw_orig(struct bat_priv *bat_priv, uint8_t *orig)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/* @skb: the frame to be checked
|
||||||
* @skb: the frame to be checked
|
|
||||||
* @orig_node: the orig_node of the frame
|
* @orig_node: the orig_node of the frame
|
||||||
* @hdr_size: maximum length of the frame
|
* @hdr_size: maximum length of the frame
|
||||||
*
|
*
|
||||||
* bla_is_backbone_gw inspects the skb for the VLAN ID and returns 1
|
* bla_is_backbone_gw inspects the skb for the VLAN ID and returns 1
|
||||||
* if the orig_node is also a gateway on the soft interface, otherwise it
|
* if the orig_node is also a gateway on the soft interface, otherwise it
|
||||||
* returns 0.
|
* returns 0.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
int batadv_bla_is_backbone_gw(struct sk_buff *skb,
|
int batadv_bla_is_backbone_gw(struct sk_buff *skb,
|
||||||
struct orig_node *orig_node, int hdr_size)
|
struct orig_node *orig_node, int hdr_size)
|
||||||
|
@ -1328,7 +1304,6 @@ int batadv_bla_is_backbone_gw(struct sk_buff *skb,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* see if this originator is a backbone gw for this VLAN */
|
/* see if this originator is a backbone gw for this VLAN */
|
||||||
|
|
||||||
backbone_gw = backbone_hash_find(orig_node->bat_priv,
|
backbone_gw = backbone_hash_find(orig_node->bat_priv,
|
||||||
orig_node->orig, vid);
|
orig_node->orig, vid);
|
||||||
if (!backbone_gw)
|
if (!backbone_gw)
|
||||||
|
@ -1360,8 +1335,7 @@ void batadv_bla_free(struct bat_priv *bat_priv)
|
||||||
hardif_free_ref(primary_if);
|
hardif_free_ref(primary_if);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @skb: the frame to be checked
|
* @skb: the frame to be checked
|
||||||
* @vid: the VLAN ID of the frame
|
* @vid: the VLAN ID of the frame
|
||||||
*
|
*
|
||||||
|
@ -1372,7 +1346,6 @@ void batadv_bla_free(struct bat_priv *bat_priv)
|
||||||
* in these cases, the skb is further handled by this function and
|
* in these cases, the skb is further handled by this function and
|
||||||
* returns 1, otherwise it returns 0 and the caller shall further
|
* returns 1, otherwise it returns 0 and the caller shall further
|
||||||
* process the skb.
|
* process the skb.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
|
int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
|
||||||
{
|
{
|
||||||
|
@ -1449,8 +1422,7 @@ int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* @bat_priv: the bat priv with all the soft interface information
|
||||||
* @bat_priv: the bat priv with all the soft interface information
|
|
||||||
* @skb: the frame to be checked
|
* @skb: the frame to be checked
|
||||||
* @vid: the VLAN ID of the frame
|
* @vid: the VLAN ID of the frame
|
||||||
*
|
*
|
||||||
|
@ -1461,7 +1433,6 @@ int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
|
||||||
* in these cases, the skb is further handled by this function and
|
* in these cases, the skb is further handled by this function and
|
||||||
* returns 1, otherwise it returns 0 and the caller shall further
|
* returns 1, otherwise it returns 0 and the caller shall further
|
||||||
* process the skb.
|
* process the skb.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
|
int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2011-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2011-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Simon Wunderlich
|
* Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_BLA_H_
|
#ifndef _NET_BATMAN_ADV_BLA_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -33,7 +31,8 @@
|
||||||
#include <linux/if_vlan.h>
|
#include <linux/if_vlan.h>
|
||||||
|
|
||||||
/* This is the offset of the options field in a dhcp packet starting at
|
/* This is the offset of the options field in a dhcp packet starting at
|
||||||
* the beginning of the dhcp header */
|
* the beginning of the dhcp header
|
||||||
|
*/
|
||||||
#define DHCP_OPTIONS_OFFSET 240
|
#define DHCP_OPTIONS_OFFSET 240
|
||||||
#define DHCP_REQUEST 3
|
#define DHCP_REQUEST 3
|
||||||
|
|
||||||
|
@ -151,14 +150,13 @@ static struct gw_node *gw_get_best_gw_node(struct bat_priv *bat_priv)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: /**
|
default: /* 2: stable connection (use best statistic)
|
||||||
* 2: stable connection (use best statistic)
|
|
||||||
* 3: fast-switch (use best statistic but change as
|
* 3: fast-switch (use best statistic but change as
|
||||||
* soon as a better gateway appears)
|
* soon as a better gateway appears)
|
||||||
* XX: late-switch (use best statistic but change as
|
* XX: late-switch (use best statistic but change as
|
||||||
* soon as a better gateway appears which has
|
* soon as a better gateway appears which has
|
||||||
* $routing_class more tq points)
|
* $routing_class more tq points)
|
||||||
**/
|
*/
|
||||||
if (router->tq_avg > max_tq) {
|
if (router->tq_avg > max_tq) {
|
||||||
if (curr_gw)
|
if (curr_gw)
|
||||||
gw_node_free_ref(curr_gw);
|
gw_node_free_ref(curr_gw);
|
||||||
|
@ -190,12 +188,11 @@ void batadv_gw_election(struct bat_priv *bat_priv)
|
||||||
struct neigh_node *router = NULL;
|
struct neigh_node *router = NULL;
|
||||||
char gw_addr[18] = { '\0' };
|
char gw_addr[18] = { '\0' };
|
||||||
|
|
||||||
/**
|
/* The batman daemon checks here if we already passed a full originator
|
||||||
* The batman daemon checks here if we already passed a full originator
|
|
||||||
* cycle in order to make sure we don't choose the first gateway we
|
* cycle in order to make sure we don't choose the first gateway we
|
||||||
* hear about. This check is based on the daemon's uptime which we
|
* hear about. This check is based on the daemon's uptime which we
|
||||||
* don't have.
|
* don't have.
|
||||||
**/
|
*/
|
||||||
if (atomic_read(&bat_priv->gw_mode) != GW_MODE_CLIENT)
|
if (atomic_read(&bat_priv->gw_mode) != GW_MODE_CLIENT)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
@ -278,10 +275,9 @@ void batadv_gw_check_election(struct bat_priv *bat_priv,
|
||||||
if (orig_tq_avg < gw_tq_avg)
|
if (orig_tq_avg < gw_tq_avg)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/**
|
/* if the routing class is greater than 3 the value tells us how much
|
||||||
* if the routing class is greater than 3 the value tells us how much
|
|
||||||
* greater the TQ value of the new gateway must be
|
* greater the TQ value of the new gateway must be
|
||||||
**/
|
*/
|
||||||
if ((atomic_read(&bat_priv->gw_sel_class) > 3) &&
|
if ((atomic_read(&bat_priv->gw_sel_class) > 3) &&
|
||||||
(orig_tq_avg - gw_tq_avg < atomic_read(&bat_priv->gw_sel_class)))
|
(orig_tq_avg - gw_tq_avg < atomic_read(&bat_priv->gw_sel_class)))
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -337,8 +333,7 @@ void batadv_gw_node_update(struct bat_priv *bat_priv,
|
||||||
struct hlist_node *node;
|
struct hlist_node *node;
|
||||||
struct gw_node *gw_node, *curr_gw;
|
struct gw_node *gw_node, *curr_gw;
|
||||||
|
|
||||||
/**
|
/* Note: We don't need a NULL check here, since curr_gw never gets
|
||||||
* Note: We don't need a NULL check here, since curr_gw never gets
|
|
||||||
* dereferenced. If curr_gw is NULL we also should not exit as we may
|
* dereferenced. If curr_gw is NULL we also should not exit as we may
|
||||||
* have this gateway in our list (duplication check!) even though we
|
* have this gateway in our list (duplication check!) even though we
|
||||||
* have no currently selected gateway.
|
* have no currently selected gateway.
|
||||||
|
@ -426,9 +421,7 @@ void batadv_gw_node_purge(struct bat_priv *bat_priv)
|
||||||
gw_node_free_ref(curr_gw);
|
gw_node_free_ref(curr_gw);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* fails if orig_node has no router */
|
||||||
* fails if orig_node has no router
|
|
||||||
*/
|
|
||||||
static int _write_buffer_text(struct bat_priv *bat_priv, struct seq_file *seq,
|
static int _write_buffer_text(struct bat_priv *bat_priv, struct seq_file *seq,
|
||||||
const struct gw_node *gw_node)
|
const struct gw_node *gw_node)
|
||||||
{
|
{
|
||||||
|
@ -534,12 +527,14 @@ static bool is_type_dhcprequest(struct sk_buff *skb, int header_len)
|
||||||
/* Access the dhcp option lists. Each entry is made up by:
|
/* Access the dhcp option lists. Each entry is made up by:
|
||||||
* - octet 1: option type
|
* - octet 1: option type
|
||||||
* - octet 2: option data len (only if type != 255 and 0)
|
* - octet 2: option data len (only if type != 255 and 0)
|
||||||
* - octet 3: option data */
|
* - octet 3: option data
|
||||||
|
*/
|
||||||
while (*p != 255 && !ret) {
|
while (*p != 255 && !ret) {
|
||||||
/* p now points to the first octet: option type */
|
/* p now points to the first octet: option type */
|
||||||
if (*p == 53) {
|
if (*p == 53) {
|
||||||
/* type 53 is the message type option.
|
/* type 53 is the message type option.
|
||||||
* Jump the len octet and go to the data octet */
|
* Jump the len octet and go to the data octet
|
||||||
|
*/
|
||||||
if (pkt_len < 2)
|
if (pkt_len < 2)
|
||||||
goto out;
|
goto out;
|
||||||
p += 2;
|
p += 2;
|
||||||
|
@ -667,7 +662,8 @@ bool batadv_gw_out_of_range(struct bat_priv *bat_priv,
|
||||||
switch (atomic_read(&bat_priv->gw_mode)) {
|
switch (atomic_read(&bat_priv->gw_mode)) {
|
||||||
case GW_MODE_SERVER:
|
case GW_MODE_SERVER:
|
||||||
/* If we are a GW then we are our best GW. We can artificially
|
/* If we are a GW then we are our best GW. We can artificially
|
||||||
* set the tq towards ourself as the maximum value */
|
* set the tq towards ourself as the maximum value
|
||||||
|
*/
|
||||||
curr_tq_avg = TQ_MAX_VALUE;
|
curr_tq_avg = TQ_MAX_VALUE;
|
||||||
break;
|
break;
|
||||||
case GW_MODE_CLIENT:
|
case GW_MODE_CLIENT:
|
||||||
|
@ -681,7 +677,8 @@ bool batadv_gw_out_of_range(struct bat_priv *bat_priv,
|
||||||
|
|
||||||
/* If the dhcp packet has been sent to a different gw,
|
/* If the dhcp packet has been sent to a different gw,
|
||||||
* we have to evaluate whether the old gw is still
|
* we have to evaluate whether the old gw is still
|
||||||
* reliable enough */
|
* reliable enough
|
||||||
|
*/
|
||||||
neigh_curr = batadv_find_router(bat_priv, curr_gw->orig_node,
|
neigh_curr = batadv_find_router(bat_priv, curr_gw->orig_node,
|
||||||
NULL);
|
NULL);
|
||||||
if (!neigh_curr)
|
if (!neigh_curr)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_GATEWAY_CLIENT_H_
|
#ifndef _NET_BATMAN_ADV_GATEWAY_CLIENT_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -156,11 +154,10 @@ ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff,
|
||||||
|
|
||||||
kbit_to_gw_bandwidth(down, up, &gw_bandwidth_tmp);
|
kbit_to_gw_bandwidth(down, up, &gw_bandwidth_tmp);
|
||||||
|
|
||||||
/**
|
/* the gw bandwidth we guessed above might not match the given
|
||||||
* the gw bandwidth we guessed above might not match the given
|
|
||||||
* speeds, hence we need to calculate it back to show the number
|
* speeds, hence we need to calculate it back to show the number
|
||||||
* that is going to be propagated
|
* that is going to be propagated
|
||||||
**/
|
*/
|
||||||
batadv_gw_bandwidth_to_kbit((uint8_t)gw_bandwidth_tmp, &down, &up);
|
batadv_gw_bandwidth_to_kbit((uint8_t)gw_bandwidth_tmp, &down, &up);
|
||||||
|
|
||||||
if (atomic_read(&bat_priv->gw_bandwidth) == gw_bandwidth_tmp)
|
if (atomic_read(&bat_priv->gw_bandwidth) == gw_bandwidth_tmp)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_
|
#ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -74,10 +72,6 @@ static int is_valid_iface(const struct net_device *net_dev)
|
||||||
if (batadv_softif_is_valid(net_dev))
|
if (batadv_softif_is_valid(net_dev))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Device is being bridged */
|
|
||||||
/* if (net_dev->priv_flags & IFF_BRIDGE_PORT)
|
|
||||||
return 0; */
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +179,8 @@ int batadv_hardif_min_mtu(struct net_device *soft_iface)
|
||||||
const struct bat_priv *bat_priv = netdev_priv(soft_iface);
|
const struct bat_priv *bat_priv = netdev_priv(soft_iface);
|
||||||
const struct hard_iface *hard_iface;
|
const struct hard_iface *hard_iface;
|
||||||
/* allow big frames if all devices are capable to do so
|
/* allow big frames if all devices are capable to do so
|
||||||
* (have MTU > 1500 + BAT_HEADER_LEN) */
|
* (have MTU > 1500 + BAT_HEADER_LEN)
|
||||||
|
*/
|
||||||
int min_mtu = ETH_DATA_LEN;
|
int min_mtu = ETH_DATA_LEN;
|
||||||
|
|
||||||
if (atomic_read(&bat_priv->fragmentation))
|
if (atomic_read(&bat_priv->fragmentation))
|
||||||
|
@ -231,8 +226,7 @@ static void hardif_activate_interface(struct hard_iface *hard_iface)
|
||||||
bat_priv->bat_algo_ops->bat_iface_update_mac(hard_iface);
|
bat_priv->bat_algo_ops->bat_iface_update_mac(hard_iface);
|
||||||
hard_iface->if_status = IF_TO_BE_ACTIVATED;
|
hard_iface->if_status = IF_TO_BE_ACTIVATED;
|
||||||
|
|
||||||
/**
|
/* the first active interface becomes our primary interface or
|
||||||
* the first active interface becomes our primary interface or
|
|
||||||
* the next active interface after the old primary interface was removed
|
* the next active interface after the old primary interface was removed
|
||||||
*/
|
*/
|
||||||
primary_if = primary_if_get_selected(bat_priv);
|
primary_if = primary_if_get_selected(bat_priv);
|
||||||
|
@ -438,8 +432,7 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev)
|
||||||
check_known_mac_addr(hard_iface->net_dev);
|
check_known_mac_addr(hard_iface->net_dev);
|
||||||
list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list);
|
list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list);
|
||||||
|
|
||||||
/**
|
/* This can't be called via a bat_priv callback because
|
||||||
* This can't be called via a bat_priv callback because
|
|
||||||
* we have no bat_priv yet.
|
* we have no bat_priv yet.
|
||||||
*/
|
*/
|
||||||
atomic_set(&hard_iface->seqno, 1);
|
atomic_set(&hard_iface->seqno, 1);
|
||||||
|
@ -544,7 +537,8 @@ static int hard_if_event(struct notifier_block *this,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function returns true if the interface represented by ifindex is a
|
/* This function returns true if the interface represented by ifindex is a
|
||||||
* 802.11 wireless device */
|
* 802.11 wireless device
|
||||||
|
*/
|
||||||
bool batadv_is_wifi_iface(int ifindex)
|
bool batadv_is_wifi_iface(int ifindex)
|
||||||
{
|
{
|
||||||
struct net_device *net_device = NULL;
|
struct net_device *net_device = NULL;
|
||||||
|
@ -559,7 +553,8 @@ bool batadv_is_wifi_iface(int ifindex)
|
||||||
|
|
||||||
#ifdef CONFIG_WIRELESS_EXT
|
#ifdef CONFIG_WIRELESS_EXT
|
||||||
/* pre-cfg80211 drivers have to implement WEXT, so it is possible to
|
/* pre-cfg80211 drivers have to implement WEXT, so it is possible to
|
||||||
* check for wireless_handlers != NULL */
|
* check for wireless_handlers != NULL
|
||||||
|
*/
|
||||||
if (net_device->wireless_handlers)
|
if (net_device->wireless_handlers)
|
||||||
ret = true;
|
ret = true;
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_HARD_INTERFACE_H_
|
#ifndef _NET_BATMAN_ADV_HARD_INTERFACE_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Simon Wunderlich, Marek Lindner
|
* Simon Wunderlich, Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2006-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Simon Wunderlich, Marek Lindner
|
* Simon Wunderlich, Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_HASH_H_
|
#ifndef _NET_BATMAN_ADV_HASH_H_
|
||||||
|
@ -24,15 +22,15 @@
|
||||||
|
|
||||||
#include <linux/list.h>
|
#include <linux/list.h>
|
||||||
|
|
||||||
/* callback to a compare function. should
|
/* callback to a compare function. should compare 2 element datas for their
|
||||||
* compare 2 element datas for their keys,
|
* keys, return 0 if same and not 0 if not same
|
||||||
* return 0 if same and not 0 if not
|
*/
|
||||||
* same */
|
|
||||||
typedef int (*hashdata_compare_cb)(const struct hlist_node *, const void *);
|
typedef int (*hashdata_compare_cb)(const struct hlist_node *, const void *);
|
||||||
|
|
||||||
/* the hashfunction, should return an index
|
/* the hashfunction, should return an index
|
||||||
* based on the key in the data of the first
|
* based on the key in the data of the first
|
||||||
* argument and the size the second */
|
* argument and the size the second
|
||||||
|
*/
|
||||||
typedef uint32_t (*hashdata_choose_cb)(const void *, uint32_t);
|
typedef uint32_t (*hashdata_choose_cb)(const void *, uint32_t);
|
||||||
typedef void (*hashdata_free_cb)(struct hlist_node *, void *);
|
typedef void (*hashdata_free_cb)(struct hlist_node *, void *);
|
||||||
|
|
||||||
|
@ -54,7 +52,8 @@ void batadv_hash_destroy(struct hashtable_t *hash);
|
||||||
|
|
||||||
/* remove the hash structure. if hashdata_free_cb != NULL, this function will be
|
/* remove the hash structure. if hashdata_free_cb != NULL, this function will be
|
||||||
* called to remove the elements inside of the hash. if you don't remove the
|
* called to remove the elements inside of the hash. if you don't remove the
|
||||||
* elements, memory might be leaked. */
|
* elements, memory might be leaked.
|
||||||
|
*/
|
||||||
static inline void hash_delete(struct hashtable_t *hash,
|
static inline void hash_delete(struct hashtable_t *hash,
|
||||||
hashdata_free_cb free_cb, void *arg)
|
hashdata_free_cb free_cb, void *arg)
|
||||||
{
|
{
|
||||||
|
@ -80,8 +79,7 @@ static inline void hash_delete(struct hashtable_t *hash,
|
||||||
batadv_hash_destroy(hash);
|
batadv_hash_destroy(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* hash_add - adds data to the hashtable
|
||||||
* hash_add - adds data to the hashtable
|
|
||||||
* @hash: storage hash table
|
* @hash: storage hash table
|
||||||
* @compare: callback to determine if 2 hash elements are identical
|
* @compare: callback to determine if 2 hash elements are identical
|
||||||
* @choose: callback calculating the hash index
|
* @choose: callback calculating the hash index
|
||||||
|
@ -91,7 +89,6 @@ static inline void hash_delete(struct hashtable_t *hash,
|
||||||
* Returns 0 on success, 1 if the element already is in the hash
|
* Returns 0 on success, 1 if the element already is in the hash
|
||||||
* and -1 on error.
|
* and -1 on error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline int hash_add(struct hashtable_t *hash,
|
static inline int hash_add(struct hashtable_t *hash,
|
||||||
hashdata_compare_cb compare,
|
hashdata_compare_cb compare,
|
||||||
hashdata_choose_cb choose,
|
hashdata_choose_cb choose,
|
||||||
|
@ -134,7 +131,8 @@ static inline int hash_add(struct hashtable_t *hash,
|
||||||
/* removes data from hash, if found. returns pointer do data on success, so you
|
/* removes data from hash, if found. returns pointer do data on success, so you
|
||||||
* can remove the used structure yourself, or NULL on error . data could be the
|
* can remove the used structure yourself, or NULL on error . data could be the
|
||||||
* structure you use with just the key filled, we just need the key for
|
* structure you use with just the key filled, we just need the key for
|
||||||
* comparing. */
|
* comparing.
|
||||||
|
*/
|
||||||
static inline void *hash_remove(struct hashtable_t *hash,
|
static inline void *hash_remove(struct hashtable_t *hash,
|
||||||
hashdata_compare_cb compare,
|
hashdata_compare_cb compare,
|
||||||
hashdata_choose_cb choose, void *data)
|
hashdata_choose_cb choose, void *data)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -312,7 +310,8 @@ static void bat_socket_add_packet(struct socket_client *socket_client,
|
||||||
spin_lock_bh(&socket_client->lock);
|
spin_lock_bh(&socket_client->lock);
|
||||||
|
|
||||||
/* while waiting for the lock the socket_client could have been
|
/* while waiting for the lock the socket_client could have been
|
||||||
* deleted */
|
* deleted
|
||||||
|
*/
|
||||||
if (!socket_client_hash[icmp_packet->uid]) {
|
if (!socket_client_hash[icmp_packet->uid]) {
|
||||||
spin_unlock_bh(&socket_client->lock);
|
spin_unlock_bh(&socket_client->lock);
|
||||||
kfree(socket_packet);
|
kfree(socket_packet);
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_ICMP_SOCKET_H_
|
#ifndef _NET_BATMAN_ADV_ICMP_SOCKET_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -37,7 +35,8 @@
|
||||||
|
|
||||||
|
|
||||||
/* List manipulations on hardif_list have to be rtnl_lock()'ed,
|
/* List manipulations on hardif_list have to be rtnl_lock()'ed,
|
||||||
* list traversals just rcu-locked */
|
* list traversals just rcu-locked
|
||||||
|
*/
|
||||||
struct list_head batadv_hardif_list;
|
struct list_head batadv_hardif_list;
|
||||||
static int (*recv_packet_handler[256])(struct sk_buff *, struct hard_iface *);
|
static int (*recv_packet_handler[256])(struct sk_buff *, struct hard_iface *);
|
||||||
char batadv_routing_algo[20] = "BATMAN_IV";
|
char batadv_routing_algo[20] = "BATMAN_IV";
|
||||||
|
@ -59,7 +58,8 @@ static int __init batman_init(void)
|
||||||
batadv_iv_init();
|
batadv_iv_init();
|
||||||
|
|
||||||
/* the name should not be longer than 10 chars - see
|
/* the name should not be longer than 10 chars - see
|
||||||
* http://lwn.net/Articles/23634/ */
|
* http://lwn.net/Articles/23634/
|
||||||
|
*/
|
||||||
batadv_event_workqueue = create_singlethread_workqueue("bat_events");
|
batadv_event_workqueue = create_singlethread_workqueue("bat_events");
|
||||||
|
|
||||||
if (!batadv_event_workqueue)
|
if (!batadv_event_workqueue)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_MAIN_H_
|
#ifndef _NET_BATMAN_ADV_MAIN_H_
|
||||||
|
@ -36,19 +34,21 @@
|
||||||
#define TQ_MAX_VALUE 255
|
#define TQ_MAX_VALUE 255
|
||||||
#define JITTER 20
|
#define JITTER 20
|
||||||
|
|
||||||
/* Time To Live of broadcast messages */
|
/* Time To Live of broadcast messages */
|
||||||
#define TTL 50
|
#define TTL 50
|
||||||
|
|
||||||
/* purge originators after time in seconds if no valid packet comes in
|
/* purge originators after time in seconds if no valid packet comes in
|
||||||
* -> TODO: check influence on TQ_LOCAL_WINDOW_SIZE */
|
* -> TODO: check influence on TQ_LOCAL_WINDOW_SIZE
|
||||||
|
*/
|
||||||
#define PURGE_TIMEOUT 200000 /* 200 seconds */
|
#define PURGE_TIMEOUT 200000 /* 200 seconds */
|
||||||
#define TT_LOCAL_TIMEOUT 3600000 /* in miliseconds */
|
#define TT_LOCAL_TIMEOUT 3600000 /* in miliseconds */
|
||||||
#define TT_CLIENT_ROAM_TIMEOUT 600000 /* in miliseconds */
|
#define TT_CLIENT_ROAM_TIMEOUT 600000 /* in miliseconds */
|
||||||
/* sliding packet range of received originator messages in sequence numbers
|
/* sliding packet range of received originator messages in sequence numbers
|
||||||
* (should be a multiple of our word size) */
|
* (should be a multiple of our word size)
|
||||||
|
*/
|
||||||
#define TQ_LOCAL_WINDOW_SIZE 64
|
#define TQ_LOCAL_WINDOW_SIZE 64
|
||||||
#define TT_REQUEST_TIMEOUT 3000 /* miliseconds we have to keep
|
/* miliseconds we have to keep pending tt_req */
|
||||||
* pending tt_req */
|
#define TT_REQUEST_TIMEOUT 3000
|
||||||
|
|
||||||
#define TQ_GLOBAL_WINDOW_SIZE 5
|
#define TQ_GLOBAL_WINDOW_SIZE 5
|
||||||
#define TQ_LOCAL_BIDRECT_SEND_MINIMUM 1
|
#define TQ_LOCAL_BIDRECT_SEND_MINIMUM 1
|
||||||
|
@ -57,8 +57,10 @@
|
||||||
|
|
||||||
#define TT_OGM_APPEND_MAX 3 /* number of OGMs sent with the last tt diff */
|
#define TT_OGM_APPEND_MAX 3 /* number of OGMs sent with the last tt diff */
|
||||||
|
|
||||||
#define ROAMING_MAX_TIME 20000 /* Time in which a client can roam at most
|
/* Time in which a client can roam at most ROAMING_MAX_COUNT times in
|
||||||
* ROAMING_MAX_COUNT times in miliseconds*/
|
* miliseconds
|
||||||
|
*/
|
||||||
|
#define ROAMING_MAX_TIME 20000
|
||||||
#define ROAMING_MAX_COUNT 5
|
#define ROAMING_MAX_COUNT 5
|
||||||
|
|
||||||
#define NO_FLAGS 0
|
#define NO_FLAGS 0
|
||||||
|
@ -72,11 +74,13 @@
|
||||||
#define VIS_INTERVAL 5000 /* 5 seconds */
|
#define VIS_INTERVAL 5000 /* 5 seconds */
|
||||||
|
|
||||||
/* how much worse secondary interfaces may be to be considered as bonding
|
/* how much worse secondary interfaces may be to be considered as bonding
|
||||||
* candidates */
|
* candidates
|
||||||
|
*/
|
||||||
#define BONDING_TQ_THRESHOLD 50
|
#define BONDING_TQ_THRESHOLD 50
|
||||||
|
|
||||||
/* should not be bigger than 512 bytes or change the size of
|
/* should not be bigger than 512 bytes or change the size of
|
||||||
* forw_packet->direct_link_flags */
|
* forw_packet->direct_link_flags
|
||||||
|
*/
|
||||||
#define MAX_AGGREGATION_BYTES 512
|
#define MAX_AGGREGATION_BYTES 512
|
||||||
#define MAX_AGGREGATION_MS 100
|
#define MAX_AGGREGATION_MS 100
|
||||||
|
|
||||||
|
@ -201,19 +205,16 @@ static inline void bat_dbg(int type __always_unused,
|
||||||
pr_err("%s: " fmt, _netdev->name, ## arg); \
|
pr_err("%s: " fmt, _netdev->name, ## arg); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/**
|
/* returns 1 if they are the same ethernet addr
|
||||||
* returns 1 if they are the same ethernet addr
|
|
||||||
*
|
*
|
||||||
* note: can't use compare_ether_addr() as it requires aligned memory
|
* note: can't use compare_ether_addr() as it requires aligned memory
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline int compare_eth(const void *data1, const void *data2)
|
static inline int compare_eth(const void *data1, const void *data2)
|
||||||
{
|
{
|
||||||
return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
|
return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* has_timed_out - compares current time (jiffies) and timestamp + timeout
|
||||||
* has_timed_out - compares current time (jiffies) and timestamp + timeout
|
|
||||||
* @timestamp: base value to compare with (in jiffies)
|
* @timestamp: base value to compare with (in jiffies)
|
||||||
* @timeout: added to base value before comparing (in milliseconds)
|
* @timeout: added to base value before comparing (in milliseconds)
|
||||||
*
|
*
|
||||||
|
@ -237,7 +238,8 @@ static inline bool has_timed_out(unsigned long timestamp, unsigned int timeout)
|
||||||
* - when adding nothing - it is neither a predecessor nor a successor
|
* - when adding nothing - it is neither a predecessor nor a successor
|
||||||
* - before adding more than 127 to the starting value - it is a predecessor,
|
* - before adding more than 127 to the starting value - it is a predecessor,
|
||||||
* - when adding 128 - it is neither a predecessor nor a successor,
|
* - when adding 128 - it is neither a predecessor nor a successor,
|
||||||
* - after adding more than 127 to the starting value - it is a successor */
|
* - after adding more than 127 to the starting value - it is a successor
|
||||||
|
*/
|
||||||
#define seq_before(x, y) ({typeof(x) _d1 = (x); \
|
#define seq_before(x, y) ({typeof(x) _d1 = (x); \
|
||||||
typeof(y) _d2 = (y); \
|
typeof(y) _d2 = (y); \
|
||||||
typeof(x) _dummy = (_d1 - _d2); \
|
typeof(x) _dummy = (_d1 - _d2); \
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2009-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -188,7 +186,8 @@ void batadv_originator_free(struct bat_priv *bat_priv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this function finds or creates an originator entry for the given
|
/* this function finds or creates an originator entry for the given
|
||||||
* address if it does not exits */
|
* address if it does not exits
|
||||||
|
*/
|
||||||
struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
|
struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
|
||||||
const uint8_t *addr)
|
const uint8_t *addr)
|
||||||
{
|
{
|
||||||
|
@ -521,7 +520,8 @@ int batadv_orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* resize all orig nodes because orig_node->bcast_own(_sum) depend on
|
/* resize all orig nodes because orig_node->bcast_own(_sum) depend on
|
||||||
* if_num */
|
* if_num
|
||||||
|
*/
|
||||||
for (i = 0; i < hash->size; i++) {
|
for (i = 0; i < hash->size; i++) {
|
||||||
head = &hash->table[i];
|
head = &hash->table[i];
|
||||||
|
|
||||||
|
@ -604,7 +604,8 @@ int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* resize all orig nodes because orig_node->bcast_own(_sum) depend on
|
/* resize all orig nodes because orig_node->bcast_own(_sum) depend on
|
||||||
* if_num */
|
* if_num
|
||||||
|
*/
|
||||||
for (i = 0; i < hash->size; i++) {
|
for (i = 0; i < hash->size; i++) {
|
||||||
head = &hash->table[i];
|
head = &hash->table[i];
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_ORIGINATOR_H_
|
#ifndef _NET_BATMAN_ADV_ORIGINATOR_H_
|
||||||
|
@ -40,8 +38,9 @@ int batadv_orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num);
|
||||||
int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num);
|
int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num);
|
||||||
|
|
||||||
|
|
||||||
/* hashfunction to choose an entry in a hash table of given size */
|
/* hashfunction to choose an entry in a hash table of given size
|
||||||
/* hash algorithm from http://en.wikipedia.org/wiki/Hash_table */
|
* hash algorithm from http://en.wikipedia.org/wiki/Hash_table
|
||||||
|
*/
|
||||||
static inline uint32_t choose_orig(const void *data, uint32_t size)
|
static inline uint32_t choose_orig(const void *data, uint32_t size)
|
||||||
{
|
{
|
||||||
const unsigned char *key = data;
|
const unsigned char *key = data;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_PACKET_H_
|
#ifndef _NET_BATMAN_ADV_PACKET_H_
|
||||||
|
@ -81,7 +79,8 @@ enum tt_query_flags {
|
||||||
|
|
||||||
/* TT_CLIENT flags.
|
/* TT_CLIENT flags.
|
||||||
* Flags from 1 to 1 << 7 are sent on the wire, while flags from 1 << 8 to
|
* Flags from 1 to 1 << 7 are sent on the wire, while flags from 1 << 8 to
|
||||||
* 1 << 15 are used for local computation only */
|
* 1 << 15 are used for local computation only
|
||||||
|
*/
|
||||||
enum tt_client_flags {
|
enum tt_client_flags {
|
||||||
TT_CLIENT_DEL = 1 << 0,
|
TT_CLIENT_DEL = 1 << 0,
|
||||||
TT_CLIENT_ROAM = 1 << 1,
|
TT_CLIENT_ROAM = 1 << 1,
|
||||||
|
@ -142,7 +141,8 @@ struct icmp_packet {
|
||||||
#define BAT_RR_LEN 16
|
#define BAT_RR_LEN 16
|
||||||
|
|
||||||
/* icmp_packet_rr must start with all fields from imcp_packet
|
/* icmp_packet_rr must start with all fields from imcp_packet
|
||||||
* as this is assumed by code that handles ICMP packets */
|
* as this is assumed by code that handles ICMP packets
|
||||||
|
*/
|
||||||
struct icmp_packet_rr {
|
struct icmp_packet_rr {
|
||||||
struct batman_header header;
|
struct batman_header header;
|
||||||
uint8_t msg_type; /* see ICMP message types above */
|
uint8_t msg_type; /* see ICMP message types above */
|
||||||
|
@ -192,7 +192,8 @@ struct tt_query_packet {
|
||||||
struct batman_header header;
|
struct batman_header header;
|
||||||
/* the flag field is a combination of:
|
/* the flag field is a combination of:
|
||||||
* - TT_REQUEST or TT_RESPONSE
|
* - TT_REQUEST or TT_RESPONSE
|
||||||
* - TT_FULL_TABLE */
|
* - TT_FULL_TABLE
|
||||||
|
*/
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
uint8_t dst[ETH_ALEN];
|
uint8_t dst[ETH_ALEN];
|
||||||
uint8_t src[ETH_ALEN];
|
uint8_t src[ETH_ALEN];
|
||||||
|
@ -200,13 +201,15 @@ struct tt_query_packet {
|
||||||
* if TT_REQUEST: ttvn that triggered the
|
* if TT_REQUEST: ttvn that triggered the
|
||||||
* request
|
* request
|
||||||
* if TT_RESPONSE: new ttvn for the src
|
* if TT_RESPONSE: new ttvn for the src
|
||||||
* orig_node */
|
* orig_node
|
||||||
|
*/
|
||||||
uint8_t ttvn;
|
uint8_t ttvn;
|
||||||
/* tt_data field is:
|
/* tt_data field is:
|
||||||
* if TT_REQUEST: crc associated with the
|
* if TT_REQUEST: crc associated with the
|
||||||
* ttvn
|
* ttvn
|
||||||
* if TT_RESPONSE: table_size */
|
* if TT_RESPONSE: table_size
|
||||||
__be16 tt_data;
|
*/
|
||||||
|
__be16 tt_data;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
struct roam_adv_packet {
|
struct roam_adv_packet {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_RING_BUFFER_H_
|
#ifndef _NET_BATMAN_ADV_RING_BUFFER_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -165,8 +163,7 @@ void batadv_bonding_candidate_add(struct orig_node *orig_node,
|
||||||
if (neigh_node->tq_avg < router->tq_avg - BONDING_TQ_THRESHOLD)
|
if (neigh_node->tq_avg < router->tq_avg - BONDING_TQ_THRESHOLD)
|
||||||
goto candidate_del;
|
goto candidate_del;
|
||||||
|
|
||||||
/**
|
/* check if we have another candidate with the same mac address or
|
||||||
* check if we have another candidate with the same mac address or
|
|
||||||
* interface. If we do, we won't select this candidate because of
|
* interface. If we do, we won't select this candidate because of
|
||||||
* possible interference.
|
* possible interference.
|
||||||
*/
|
*/
|
||||||
|
@ -177,7 +174,8 @@ void batadv_bonding_candidate_add(struct orig_node *orig_node,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* we only care if the other candidate is even
|
/* we only care if the other candidate is even
|
||||||
* considered as candidate. */
|
* considered as candidate.
|
||||||
|
*/
|
||||||
if (list_empty(&tmp_neigh_node->bonding_list))
|
if (list_empty(&tmp_neigh_node->bonding_list))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -398,9 +396,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
|
||||||
int hdr_size = sizeof(struct icmp_packet);
|
int hdr_size = sizeof(struct icmp_packet);
|
||||||
int ret = NET_RX_DROP;
|
int ret = NET_RX_DROP;
|
||||||
|
|
||||||
/**
|
/* we truncate all incoming icmp packets if they don't match our size */
|
||||||
* we truncate all incoming icmp packets if they don't match our size
|
|
||||||
*/
|
|
||||||
if (skb->len >= sizeof(struct icmp_packet_rr))
|
if (skb->len >= sizeof(struct icmp_packet_rr))
|
||||||
hdr_size = sizeof(struct icmp_packet_rr);
|
hdr_size = sizeof(struct icmp_packet_rr);
|
||||||
|
|
||||||
|
@ -474,7 +470,8 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
|
||||||
* robin fashion over the remaining interfaces.
|
* robin fashion over the remaining interfaces.
|
||||||
*
|
*
|
||||||
* This method rotates the bonding list and increases the
|
* This method rotates the bonding list and increases the
|
||||||
* returned router's refcount. */
|
* returned router's refcount.
|
||||||
|
*/
|
||||||
static struct neigh_node *find_bond_router(struct orig_node *primary_orig,
|
static struct neigh_node *find_bond_router(struct orig_node *primary_orig,
|
||||||
const struct hard_iface *recv_if)
|
const struct hard_iface *recv_if)
|
||||||
{
|
{
|
||||||
|
@ -507,10 +504,12 @@ static struct neigh_node *find_bond_router(struct orig_node *primary_orig,
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* selected should point to the next element
|
/* selected should point to the next element
|
||||||
* after the current router */
|
* after the current router
|
||||||
|
*/
|
||||||
spin_lock_bh(&primary_orig->neigh_list_lock);
|
spin_lock_bh(&primary_orig->neigh_list_lock);
|
||||||
/* this is a list_move(), which unfortunately
|
/* this is a list_move(), which unfortunately
|
||||||
* does not exist as rcu version */
|
* does not exist as rcu version
|
||||||
|
*/
|
||||||
list_del_rcu(&primary_orig->bond_list);
|
list_del_rcu(&primary_orig->bond_list);
|
||||||
list_add_rcu(&primary_orig->bond_list,
|
list_add_rcu(&primary_orig->bond_list,
|
||||||
&router->bonding_list);
|
&router->bonding_list);
|
||||||
|
@ -525,7 +524,8 @@ static struct neigh_node *find_bond_router(struct orig_node *primary_orig,
|
||||||
* remaining candidates which are not using
|
* remaining candidates which are not using
|
||||||
* this interface.
|
* this interface.
|
||||||
*
|
*
|
||||||
* Increases the returned router's refcount */
|
* Increases the returned router's refcount
|
||||||
|
*/
|
||||||
static struct neigh_node *find_ifalter_router(struct orig_node *primary_orig,
|
static struct neigh_node *find_ifalter_router(struct orig_node *primary_orig,
|
||||||
const struct hard_iface *recv_if)
|
const struct hard_iface *recv_if)
|
||||||
{
|
{
|
||||||
|
@ -546,11 +546,13 @@ static struct neigh_node *find_ifalter_router(struct orig_node *primary_orig,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* if we don't have a router yet
|
/* if we don't have a router yet
|
||||||
* or this one is better, choose it. */
|
* or this one is better, choose it.
|
||||||
|
*/
|
||||||
if ((!router) ||
|
if ((!router) ||
|
||||||
(tmp_neigh_node->tq_avg > router->tq_avg)) {
|
(tmp_neigh_node->tq_avg > router->tq_avg)) {
|
||||||
/* decrement refcount of
|
/* decrement refcount of
|
||||||
* previously selected router */
|
* previously selected router
|
||||||
|
*/
|
||||||
if (router)
|
if (router)
|
||||||
batadv_neigh_node_free_ref(router);
|
batadv_neigh_node_free_ref(router);
|
||||||
|
|
||||||
|
@ -602,7 +604,8 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
|
||||||
batadv_inc_counter(bat_priv, BAT_CNT_TT_REQUEST_RX);
|
batadv_inc_counter(bat_priv, BAT_CNT_TT_REQUEST_RX);
|
||||||
|
|
||||||
/* If we cannot provide an answer the tt_request is
|
/* If we cannot provide an answer the tt_request is
|
||||||
* forwarded */
|
* forwarded
|
||||||
|
*/
|
||||||
if (!batadv_send_tt_response(bat_priv, tt_query)) {
|
if (!batadv_send_tt_response(bat_priv, tt_query)) {
|
||||||
bat_dbg(DBG_TT, bat_priv,
|
bat_dbg(DBG_TT, bat_priv,
|
||||||
"Routing TT_REQUEST to %pM [%c]\n",
|
"Routing TT_REQUEST to %pM [%c]\n",
|
||||||
|
@ -616,7 +619,8 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
|
||||||
|
|
||||||
if (batadv_is_my_mac(tt_query->dst)) {
|
if (batadv_is_my_mac(tt_query->dst)) {
|
||||||
/* packet needs to be linearized to access the TT
|
/* packet needs to be linearized to access the TT
|
||||||
* changes */
|
* changes
|
||||||
|
*/
|
||||||
if (skb_linearize(skb) < 0)
|
if (skb_linearize(skb) < 0)
|
||||||
goto out;
|
goto out;
|
||||||
/* skb_linearize() possibly changed skb->data */
|
/* skb_linearize() possibly changed skb->data */
|
||||||
|
@ -694,7 +698,8 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
|
||||||
|
|
||||||
/* Roaming phase starts: I have new information but the ttvn has not
|
/* Roaming phase starts: I have new information but the ttvn has not
|
||||||
* been incremented yet. This flag will make me check all the incoming
|
* been incremented yet. This flag will make me check all the incoming
|
||||||
* packets for the correct destination. */
|
* packets for the correct destination.
|
||||||
|
*/
|
||||||
bat_priv->tt_poss_change = true;
|
bat_priv->tt_poss_change = true;
|
||||||
|
|
||||||
batadv_orig_node_free_ref(orig_node);
|
batadv_orig_node_free_ref(orig_node);
|
||||||
|
@ -705,7 +710,8 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
|
||||||
|
|
||||||
/* find a suitable router for this originator, and use
|
/* find a suitable router for this originator, and use
|
||||||
* bonding if possible. increases the found neighbors
|
* bonding if possible. increases the found neighbors
|
||||||
* refcount.*/
|
* refcount.
|
||||||
|
*/
|
||||||
struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
|
struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
|
||||||
struct orig_node *orig_node,
|
struct orig_node *orig_node,
|
||||||
const struct hard_iface *recv_if)
|
const struct hard_iface *recv_if)
|
||||||
|
@ -724,7 +730,8 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
/* without bonding, the first node should
|
/* without bonding, the first node should
|
||||||
* always choose the default router. */
|
* always choose the default router.
|
||||||
|
*/
|
||||||
bonding_enabled = atomic_read(&bat_priv->bonding);
|
bonding_enabled = atomic_read(&bat_priv->bonding);
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
|
@ -737,13 +744,14 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
|
||||||
goto return_router;
|
goto return_router;
|
||||||
|
|
||||||
/* if we have something in the primary_addr, we can search
|
/* if we have something in the primary_addr, we can search
|
||||||
* for a potential bonding candidate. */
|
* for a potential bonding candidate.
|
||||||
|
*/
|
||||||
if (compare_eth(router_orig->primary_addr, zero_mac))
|
if (compare_eth(router_orig->primary_addr, zero_mac))
|
||||||
goto return_router;
|
goto return_router;
|
||||||
|
|
||||||
/* find the orig_node which has the primary interface. might
|
/* find the orig_node which has the primary interface. might
|
||||||
* even be the same as our router_orig in many cases */
|
* even be the same as our router_orig in many cases
|
||||||
|
*/
|
||||||
if (compare_eth(router_orig->primary_addr, router_orig->orig)) {
|
if (compare_eth(router_orig->primary_addr, router_orig->orig)) {
|
||||||
primary_orig_node = router_orig;
|
primary_orig_node = router_orig;
|
||||||
} else {
|
} else {
|
||||||
|
@ -756,14 +764,15 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* with less than 2 candidates, we can't do any
|
/* with less than 2 candidates, we can't do any
|
||||||
* bonding and prefer the original router. */
|
* bonding and prefer the original router.
|
||||||
|
*/
|
||||||
if (atomic_read(&primary_orig_node->bond_candidates) < 2)
|
if (atomic_read(&primary_orig_node->bond_candidates) < 2)
|
||||||
goto return_router;
|
goto return_router;
|
||||||
|
|
||||||
/* all nodes between should choose a candidate which
|
/* all nodes between should choose a candidate which
|
||||||
* is is not on the interface where the packet came
|
* is is not on the interface where the packet came
|
||||||
* in. */
|
* in.
|
||||||
|
*/
|
||||||
batadv_neigh_node_free_ref(router);
|
batadv_neigh_node_free_ref(router);
|
||||||
|
|
||||||
if (bonding_enabled)
|
if (bonding_enabled)
|
||||||
|
@ -1089,7 +1098,8 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
|
||||||
goto spin_unlock;
|
goto spin_unlock;
|
||||||
|
|
||||||
/* mark broadcast in flood history, update window position
|
/* mark broadcast in flood history, update window position
|
||||||
* if required. */
|
* if required.
|
||||||
|
*/
|
||||||
if (batadv_bit_get_packet(bat_priv, orig_node->bcast_bits, seq_diff, 1))
|
if (batadv_bit_get_packet(bat_priv, orig_node->bcast_bits, seq_diff, 1))
|
||||||
orig_node->last_bcast_seqno = ntohl(bcast_packet->seqno);
|
orig_node->last_bcast_seqno = ntohl(bcast_packet->seqno);
|
||||||
|
|
||||||
|
@ -1165,6 +1175,7 @@ int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We take a copy of the data in the packet, so we should
|
/* We take a copy of the data in the packet, so we should
|
||||||
always free the skbuf. */
|
* always free the skbuf.
|
||||||
|
*/
|
||||||
return NET_RX_DROP;
|
return NET_RX_DROP;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_ROUTING_H_
|
#ifndef _NET_BATMAN_ADV_ROUTING_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -32,7 +30,8 @@
|
||||||
static void send_outstanding_bcast_packet(struct work_struct *work);
|
static void send_outstanding_bcast_packet(struct work_struct *work);
|
||||||
|
|
||||||
/* send out an already prepared packet to the given address via the
|
/* send out an already prepared packet to the given address via the
|
||||||
* specified batman interface */
|
* specified batman interface
|
||||||
|
*/
|
||||||
int batadv_send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
|
int batadv_send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
|
||||||
const uint8_t *dst_addr)
|
const uint8_t *dst_addr)
|
||||||
{
|
{
|
||||||
|
@ -69,8 +68,8 @@ int batadv_send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
|
||||||
|
|
||||||
/* dev_queue_xmit() returns a negative result on error. However on
|
/* dev_queue_xmit() returns a negative result on error. However on
|
||||||
* congestion and traffic shaping, it drops and returns NET_XMIT_DROP
|
* congestion and traffic shaping, it drops and returns NET_XMIT_DROP
|
||||||
* (which is > 0). This will not be treated as an error. */
|
* (which is > 0). This will not be treated as an error.
|
||||||
|
*/
|
||||||
return dev_queue_xmit(skb);
|
return dev_queue_xmit(skb);
|
||||||
send_skb_err:
|
send_skb_err:
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
|
@ -85,8 +84,7 @@ void batadv_schedule_bat_ogm(struct hard_iface *hard_iface)
|
||||||
(hard_iface->if_status == IF_TO_BE_REMOVED))
|
(hard_iface->if_status == IF_TO_BE_REMOVED))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/**
|
/* the interface gets activated here to avoid race conditions between
|
||||||
* the interface gets activated here to avoid race conditions between
|
|
||||||
* the moment of activating the interface in
|
* the moment of activating the interface in
|
||||||
* hardif_activate_interface() where the originator mac is set and
|
* hardif_activate_interface() where the originator mac is set and
|
||||||
* outdated packets (especially uninitialized mac addresses) in the
|
* outdated packets (especially uninitialized mac addresses) in the
|
||||||
|
@ -132,7 +130,8 @@ static void _add_bcast_packet_to_list(struct bat_priv *bat_priv,
|
||||||
* errors.
|
* errors.
|
||||||
*
|
*
|
||||||
* The skb is not consumed, so the caller should make sure that the
|
* The skb is not consumed, so the caller should make sure that the
|
||||||
* skb is freed. */
|
* skb is freed.
|
||||||
|
*/
|
||||||
int batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv,
|
int batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv,
|
||||||
const struct sk_buff *skb,
|
const struct sk_buff *skb,
|
||||||
unsigned long delay)
|
unsigned long delay)
|
||||||
|
@ -249,8 +248,7 @@ void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work)
|
||||||
|
|
||||||
bat_priv->bat_algo_ops->bat_ogm_emit(forw_packet);
|
bat_priv->bat_algo_ops->bat_ogm_emit(forw_packet);
|
||||||
|
|
||||||
/**
|
/* we have to have at least one packet in the queue
|
||||||
* we have to have at least one packet in the queue
|
|
||||||
* to determine the queues wake up time unless we are
|
* to determine the queues wake up time unless we are
|
||||||
* shutting down
|
* shutting down
|
||||||
*/
|
*/
|
||||||
|
@ -285,8 +283,7 @@ void batadv_purge_outstanding_packets(struct bat_priv *bat_priv,
|
||||||
hlist_for_each_entry_safe(forw_packet, tmp_node, safe_tmp_node,
|
hlist_for_each_entry_safe(forw_packet, tmp_node, safe_tmp_node,
|
||||||
&bat_priv->forw_bcast_list, list) {
|
&bat_priv->forw_bcast_list, list) {
|
||||||
|
|
||||||
/**
|
/* if purge_outstanding_packets() was called with an argument
|
||||||
* if purge_outstanding_packets() was called with an argument
|
|
||||||
* we delete only packets belonging to the given interface
|
* we delete only packets belonging to the given interface
|
||||||
*/
|
*/
|
||||||
if ((hard_iface) &&
|
if ((hard_iface) &&
|
||||||
|
@ -295,8 +292,7 @@ void batadv_purge_outstanding_packets(struct bat_priv *bat_priv,
|
||||||
|
|
||||||
spin_unlock_bh(&bat_priv->forw_bcast_list_lock);
|
spin_unlock_bh(&bat_priv->forw_bcast_list_lock);
|
||||||
|
|
||||||
/**
|
/* send_outstanding_bcast_packet() will lock the list to
|
||||||
* send_outstanding_bcast_packet() will lock the list to
|
|
||||||
* delete the item from the list
|
* delete the item from the list
|
||||||
*/
|
*/
|
||||||
pending = cancel_delayed_work_sync(&forw_packet->delayed_work);
|
pending = cancel_delayed_work_sync(&forw_packet->delayed_work);
|
||||||
|
@ -314,8 +310,7 @@ void batadv_purge_outstanding_packets(struct bat_priv *bat_priv,
|
||||||
hlist_for_each_entry_safe(forw_packet, tmp_node, safe_tmp_node,
|
hlist_for_each_entry_safe(forw_packet, tmp_node, safe_tmp_node,
|
||||||
&bat_priv->forw_bat_list, list) {
|
&bat_priv->forw_bat_list, list) {
|
||||||
|
|
||||||
/**
|
/* if purge_outstanding_packets() was called with an argument
|
||||||
* if purge_outstanding_packets() was called with an argument
|
|
||||||
* we delete only packets belonging to the given interface
|
* we delete only packets belonging to the given interface
|
||||||
*/
|
*/
|
||||||
if ((hard_iface) &&
|
if ((hard_iface) &&
|
||||||
|
@ -324,8 +319,7 @@ void batadv_purge_outstanding_packets(struct bat_priv *bat_priv,
|
||||||
|
|
||||||
spin_unlock_bh(&bat_priv->forw_bat_list_lock);
|
spin_unlock_bh(&bat_priv->forw_bat_list_lock);
|
||||||
|
|
||||||
/**
|
/* send_outstanding_bat_packet() will lock the list to
|
||||||
* send_outstanding_bat_packet() will lock the list to
|
|
||||||
* delete the item from the list
|
* delete the item from the list
|
||||||
*/
|
*/
|
||||||
pending = cancel_delayed_work_sync(&forw_packet->delayed_work);
|
pending = cancel_delayed_work_sync(&forw_packet->delayed_work);
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_SEND_H_
|
#ifndef _NET_BATMAN_ADV_SEND_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -65,8 +63,7 @@ int batadv_skb_head_push(struct sk_buff *skb, unsigned int len)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
/**
|
/* TODO: We must check if we can release all references to non-payload
|
||||||
* TODO: We must check if we can release all references to non-payload
|
|
||||||
* data using skb_header_release in our skbs to allow skb_cow_header to
|
* data using skb_header_release in our skbs to allow skb_cow_header to
|
||||||
* work optimally. This means that those skbs are not allowed to read
|
* work optimally. This means that those skbs are not allowed to read
|
||||||
* or write any data which is before the current position of skb->data
|
* or write any data which is before the current position of skb->data
|
||||||
|
@ -180,14 +177,16 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
|
||||||
switch (atomic_read(&bat_priv->gw_mode)) {
|
switch (atomic_read(&bat_priv->gw_mode)) {
|
||||||
case GW_MODE_SERVER:
|
case GW_MODE_SERVER:
|
||||||
/* gateway servers should not send dhcp
|
/* gateway servers should not send dhcp
|
||||||
* requests into the mesh */
|
* requests into the mesh
|
||||||
|
*/
|
||||||
ret = batadv_gw_is_dhcp_target(skb, &header_len);
|
ret = batadv_gw_is_dhcp_target(skb, &header_len);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto dropped;
|
goto dropped;
|
||||||
break;
|
break;
|
||||||
case GW_MODE_CLIENT:
|
case GW_MODE_CLIENT:
|
||||||
/* gateway clients should send dhcp requests
|
/* gateway clients should send dhcp requests
|
||||||
* via unicast to their gateway */
|
* via unicast to their gateway
|
||||||
|
*/
|
||||||
ret = batadv_gw_is_dhcp_target(skb, &header_len);
|
ret = batadv_gw_is_dhcp_target(skb, &header_len);
|
||||||
if (ret)
|
if (ret)
|
||||||
do_bcast = false;
|
do_bcast = false;
|
||||||
|
@ -215,7 +214,8 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
|
||||||
bcast_packet->header.packet_type = BAT_BCAST;
|
bcast_packet->header.packet_type = BAT_BCAST;
|
||||||
|
|
||||||
/* hw address of first interface is the orig mac because only
|
/* hw address of first interface is the orig mac because only
|
||||||
* this mac is known throughout the mesh */
|
* this mac is known throughout the mesh
|
||||||
|
*/
|
||||||
memcpy(bcast_packet->orig,
|
memcpy(bcast_packet->orig,
|
||||||
primary_if->net_dev->dev_addr, ETH_ALEN);
|
primary_if->net_dev->dev_addr, ETH_ALEN);
|
||||||
|
|
||||||
|
@ -226,7 +226,8 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
|
||||||
batadv_add_bcast_packet_to_list(bat_priv, skb, 1);
|
batadv_add_bcast_packet_to_list(bat_priv, skb, 1);
|
||||||
|
|
||||||
/* a copy is stored in the bcast list, therefore removing
|
/* a copy is stored in the bcast list, therefore removing
|
||||||
* the original skb. */
|
* the original skb.
|
||||||
|
*/
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
|
|
||||||
/* unicast packet */
|
/* unicast packet */
|
||||||
|
@ -294,9 +295,10 @@ void batadv_interface_rx(struct net_device *soft_iface,
|
||||||
|
|
||||||
/* should not be necessary anymore as we use skb_pull_rcsum()
|
/* should not be necessary anymore as we use skb_pull_rcsum()
|
||||||
* TODO: please verify this and remove this TODO
|
* TODO: please verify this and remove this TODO
|
||||||
* -- Dec 21st 2009, Simon Wunderlich */
|
* -- Dec 21st 2009, Simon Wunderlich
|
||||||
|
*/
|
||||||
|
|
||||||
/* skb->ip_summed = CHECKSUM_UNNECESSARY;*/
|
/* skb->ip_summed = CHECKSUM_UNNECESSARY; */
|
||||||
|
|
||||||
bat_priv->stats.rx_packets++;
|
bat_priv->stats.rx_packets++;
|
||||||
bat_priv->stats.rx_bytes += skb->len + ETH_HLEN;
|
bat_priv->stats.rx_bytes += skb->len + ETH_HLEN;
|
||||||
|
@ -341,8 +343,7 @@ static void interface_setup(struct net_device *dev)
|
||||||
dev->destructor = free_netdev;
|
dev->destructor = free_netdev;
|
||||||
dev->tx_queue_len = 0;
|
dev->tx_queue_len = 0;
|
||||||
|
|
||||||
/**
|
/* can't call min_mtu, because the needed variables
|
||||||
* can't call min_mtu, because the needed variables
|
|
||||||
* have not been initialized yet
|
* have not been initialized yet
|
||||||
*/
|
*/
|
||||||
dev->mtu = ETH_DATA_LEN;
|
dev->mtu = ETH_DATA_LEN;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner
|
* Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_SOFT_INTERFACE_H_
|
#ifndef _NET_BATMAN_ADV_SOFT_INTERFACE_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich, Antonio Quartulli
|
* Marek Lindner, Simon Wunderlich, Antonio Quartulli
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -232,7 +230,8 @@ void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
|
||||||
|
|
||||||
/* The local entry has to be marked as NEW to avoid to send it in
|
/* The local entry has to be marked as NEW to avoid to send it in
|
||||||
* a full table response going out before the next ttvn increment
|
* a full table response going out before the next ttvn increment
|
||||||
* (consistency check) */
|
* (consistency check)
|
||||||
|
*/
|
||||||
tt_local_entry->common.flags |= TT_CLIENT_NEW;
|
tt_local_entry->common.flags |= TT_CLIENT_NEW;
|
||||||
|
|
||||||
hash_added = hash_add(bat_priv->tt_local_hash, compare_tt, choose_orig,
|
hash_added = hash_add(bat_priv->tt_local_hash, compare_tt, choose_orig,
|
||||||
|
@ -437,7 +436,8 @@ static void tt_local_set_pending(struct bat_priv *bat_priv,
|
||||||
|
|
||||||
/* The local client has to be marked as "pending to be removed" but has
|
/* The local client has to be marked as "pending to be removed" but has
|
||||||
* to be kept in the table in order to send it in a full table
|
* to be kept in the table in order to send it in a full table
|
||||||
* response issued before the net ttvn increment (consistency check) */
|
* response issued before the net ttvn increment (consistency check)
|
||||||
|
*/
|
||||||
tt_local_entry->common.flags |= TT_CLIENT_PENDING;
|
tt_local_entry->common.flags |= TT_CLIENT_PENDING;
|
||||||
|
|
||||||
bat_dbg(DBG_TT, bat_priv,
|
bat_dbg(DBG_TT, bat_priv,
|
||||||
|
@ -898,8 +898,8 @@ static void tt_global_del(struct bat_priv *bat_priv,
|
||||||
* If there are other originators left, we directly delete
|
* If there are other originators left, we directly delete
|
||||||
* the originator.
|
* the originator.
|
||||||
* 2) the client roamed to us => we can directly delete
|
* 2) the client roamed to us => we can directly delete
|
||||||
* the global entry, since it is useless now. */
|
* the global entry, since it is useless now.
|
||||||
|
*/
|
||||||
tt_local_entry = tt_local_hash_find(bat_priv,
|
tt_local_entry = tt_local_hash_find(bat_priv,
|
||||||
tt_global_entry->common.addr);
|
tt_global_entry->common.addr);
|
||||||
if (tt_local_entry) {
|
if (tt_local_entry) {
|
||||||
|
@ -1072,7 +1072,8 @@ struct orig_node *batadv_transtable_search(struct bat_priv *bat_priv,
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* check whether the clients should not communicate due to AP
|
/* check whether the clients should not communicate due to AP
|
||||||
* isolation */
|
* isolation
|
||||||
|
*/
|
||||||
if (tt_local_entry && _is_ap_isolated(tt_local_entry, tt_global_entry))
|
if (tt_local_entry && _is_ap_isolated(tt_local_entry, tt_global_entry))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
@ -1171,7 +1172,8 @@ static uint16_t batadv_tt_local_crc(struct bat_priv *bat_priv)
|
||||||
hlist_for_each_entry_rcu(tt_common_entry, node,
|
hlist_for_each_entry_rcu(tt_common_entry, node,
|
||||||
head, hash_entry) {
|
head, hash_entry) {
|
||||||
/* not yet committed clients have not to be taken into
|
/* not yet committed clients have not to be taken into
|
||||||
* account while computing the CRC */
|
* account while computing the CRC
|
||||||
|
*/
|
||||||
if (tt_common_entry->flags & TT_CLIENT_NEW)
|
if (tt_common_entry->flags & TT_CLIENT_NEW)
|
||||||
continue;
|
continue;
|
||||||
total_one = 0;
|
total_one = 0;
|
||||||
|
@ -1208,7 +1210,8 @@ static void tt_save_orig_buffer(struct bat_priv *bat_priv,
|
||||||
uint16_t tt_buff_len = batadv_tt_len(tt_num_changes);
|
uint16_t tt_buff_len = batadv_tt_len(tt_num_changes);
|
||||||
|
|
||||||
/* Replace the old buffer only if I received something in the
|
/* Replace the old buffer only if I received something in the
|
||||||
* last OGM (the OGM could carry no changes) */
|
* last OGM (the OGM could carry no changes)
|
||||||
|
*/
|
||||||
spin_lock_bh(&orig_node->tt_buff_lock);
|
spin_lock_bh(&orig_node->tt_buff_lock);
|
||||||
if (tt_buff_len > 0) {
|
if (tt_buff_len > 0) {
|
||||||
kfree(orig_node->tt_buff);
|
kfree(orig_node->tt_buff);
|
||||||
|
@ -1237,7 +1240,8 @@ static void tt_req_purge(struct bat_priv *bat_priv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns the pointer to the new tt_req_node struct if no request
|
/* returns the pointer to the new tt_req_node struct if no request
|
||||||
* has already been issued for this orig_node, NULL otherwise */
|
* has already been issued for this orig_node, NULL otherwise
|
||||||
|
*/
|
||||||
static struct tt_req_node *new_tt_req_node(struct bat_priv *bat_priv,
|
static struct tt_req_node *new_tt_req_node(struct bat_priv *bat_priv,
|
||||||
struct orig_node *orig_node)
|
struct orig_node *orig_node)
|
||||||
{
|
{
|
||||||
|
@ -1347,7 +1351,8 @@ static struct sk_buff *tt_response_fill_table(uint16_t tt_len, uint8_t ttvn,
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
|
||||||
/* store in the message the number of entries we have successfully
|
/* store in the message the number of entries we have successfully
|
||||||
* copied */
|
* copied
|
||||||
|
*/
|
||||||
tt_response->tt_data = htons(tt_count);
|
tt_response->tt_data = htons(tt_count);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
@ -1370,7 +1375,8 @@ static int send_tt_request(struct bat_priv *bat_priv,
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* The new tt_req will be issued only if I'm not waiting for a
|
/* The new tt_req will be issued only if I'm not waiting for a
|
||||||
* reply from the same orig_node yet */
|
* reply from the same orig_node yet
|
||||||
|
*/
|
||||||
tt_req_node = new_tt_req_node(bat_priv, dst_orig_node);
|
tt_req_node = new_tt_req_node(bat_priv, dst_orig_node);
|
||||||
if (!tt_req_node)
|
if (!tt_req_node)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -1478,7 +1484,8 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
|
||||||
full_table = false;
|
full_table = false;
|
||||||
|
|
||||||
/* In this version, fragmentation is not implemented, then
|
/* In this version, fragmentation is not implemented, then
|
||||||
* I'll send only one packet with as much TT entries as I can */
|
* I'll send only one packet with as much TT entries as I can
|
||||||
|
*/
|
||||||
if (!full_table) {
|
if (!full_table) {
|
||||||
spin_lock_bh(&req_dst_orig_node->tt_buff_lock);
|
spin_lock_bh(&req_dst_orig_node->tt_buff_lock);
|
||||||
tt_len = req_dst_orig_node->tt_buff_len;
|
tt_len = req_dst_orig_node->tt_buff_len;
|
||||||
|
@ -1590,7 +1597,8 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* If the full table has been explicitly requested or the gap
|
/* If the full table has been explicitly requested or the gap
|
||||||
* is too big send the whole local translation table */
|
* is too big send the whole local translation table
|
||||||
|
*/
|
||||||
if (tt_request->flags & TT_FULL_TABLE || my_ttvn != req_ttvn ||
|
if (tt_request->flags & TT_FULL_TABLE || my_ttvn != req_ttvn ||
|
||||||
!bat_priv->tt_buff)
|
!bat_priv->tt_buff)
|
||||||
full_table = true;
|
full_table = true;
|
||||||
|
@ -1598,7 +1606,8 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
|
||||||
full_table = false;
|
full_table = false;
|
||||||
|
|
||||||
/* In this version, fragmentation is not implemented, then
|
/* In this version, fragmentation is not implemented, then
|
||||||
* I'll send only one packet with as much TT entries as I can */
|
* I'll send only one packet with as much TT entries as I can
|
||||||
|
*/
|
||||||
if (!full_table) {
|
if (!full_table) {
|
||||||
spin_lock_bh(&bat_priv->tt_buff_lock);
|
spin_lock_bh(&bat_priv->tt_buff_lock);
|
||||||
tt_len = bat_priv->tt_buff_len;
|
tt_len = bat_priv->tt_buff_len;
|
||||||
|
@ -1766,7 +1775,8 @@ bool batadv_is_my_client(struct bat_priv *bat_priv, const uint8_t *addr)
|
||||||
if (!tt_local_entry)
|
if (!tt_local_entry)
|
||||||
goto out;
|
goto out;
|
||||||
/* Check if the client has been logically deleted (but is kept for
|
/* Check if the client has been logically deleted (but is kept for
|
||||||
* consistency purpose) */
|
* consistency purpose)
|
||||||
|
*/
|
||||||
if (tt_local_entry->common.flags & TT_CLIENT_PENDING)
|
if (tt_local_entry->common.flags & TT_CLIENT_PENDING)
|
||||||
goto out;
|
goto out;
|
||||||
ret = true;
|
ret = true;
|
||||||
|
@ -1817,7 +1827,8 @@ void batadv_handle_tt_response(struct bat_priv *bat_priv,
|
||||||
/* Recalculate the CRC for this orig_node and store it */
|
/* Recalculate the CRC for this orig_node and store it */
|
||||||
orig_node->tt_crc = tt_global_crc(bat_priv, orig_node);
|
orig_node->tt_crc = tt_global_crc(bat_priv, orig_node);
|
||||||
/* Roaming phase is over: tables are in sync again. I can
|
/* Roaming phase is over: tables are in sync again. I can
|
||||||
* unset the flag */
|
* unset the flag
|
||||||
|
*/
|
||||||
orig_node->tt_poss_change = false;
|
orig_node->tt_poss_change = false;
|
||||||
out:
|
out:
|
||||||
if (orig_node)
|
if (orig_node)
|
||||||
|
@ -1874,7 +1885,8 @@ static void tt_roam_purge(struct bat_priv *bat_priv)
|
||||||
* maximum number of possible roaming phases. In this case the ROAMING_ADV
|
* maximum number of possible roaming phases. In this case the ROAMING_ADV
|
||||||
* will not be sent.
|
* will not be sent.
|
||||||
*
|
*
|
||||||
* returns true if the ROAMING_ADV can be sent, false otherwise */
|
* returns true if the ROAMING_ADV can be sent, false otherwise
|
||||||
|
*/
|
||||||
static bool tt_check_roam_count(struct bat_priv *bat_priv,
|
static bool tt_check_roam_count(struct bat_priv *bat_priv,
|
||||||
uint8_t *client)
|
uint8_t *client)
|
||||||
{
|
{
|
||||||
|
@ -1883,7 +1895,8 @@ static bool tt_check_roam_count(struct bat_priv *bat_priv,
|
||||||
|
|
||||||
spin_lock_bh(&bat_priv->tt_roam_list_lock);
|
spin_lock_bh(&bat_priv->tt_roam_list_lock);
|
||||||
/* The new tt_req will be issued only if I'm not waiting for a
|
/* The new tt_req will be issued only if I'm not waiting for a
|
||||||
* reply from the same orig_node yet */
|
* reply from the same orig_node yet
|
||||||
|
*/
|
||||||
list_for_each_entry(tt_roam_node, &bat_priv->tt_roam_list, list) {
|
list_for_each_entry(tt_roam_node, &bat_priv->tt_roam_list, list) {
|
||||||
if (!compare_eth(tt_roam_node->addr, client))
|
if (!compare_eth(tt_roam_node->addr, client))
|
||||||
continue;
|
continue;
|
||||||
|
@ -1926,7 +1939,8 @@ static void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
|
||||||
struct hard_iface *primary_if;
|
struct hard_iface *primary_if;
|
||||||
|
|
||||||
/* before going on we have to check whether the client has
|
/* before going on we have to check whether the client has
|
||||||
* already roamed to us too many times */
|
* already roamed to us too many times
|
||||||
|
*/
|
||||||
if (!tt_check_roam_count(bat_priv, client))
|
if (!tt_check_roam_count(bat_priv, client))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
@ -2000,7 +2014,8 @@ void batadv_tt_free(struct bat_priv *bat_priv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function will enable or disable the specified flags for all the entries
|
/* This function will enable or disable the specified flags for all the entries
|
||||||
* in the given hash table and returns the number of modified entries */
|
* in the given hash table and returns the number of modified entries
|
||||||
|
*/
|
||||||
static uint16_t tt_set_flags(struct hashtable_t *hash, uint16_t flags,
|
static uint16_t tt_set_flags(struct hashtable_t *hash, uint16_t flags,
|
||||||
bool enable)
|
bool enable)
|
||||||
{
|
{
|
||||||
|
@ -2172,12 +2187,14 @@ void batadv_tt_update_orig(struct bat_priv *bat_priv,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* orig table not initialised AND first diff is in the OGM OR the ttvn
|
/* orig table not initialised AND first diff is in the OGM OR the ttvn
|
||||||
* increased by one -> we can apply the attached changes */
|
* increased by one -> we can apply the attached changes
|
||||||
|
*/
|
||||||
if ((!orig_node->tt_initialised && ttvn == 1) ||
|
if ((!orig_node->tt_initialised && ttvn == 1) ||
|
||||||
ttvn - orig_ttvn == 1) {
|
ttvn - orig_ttvn == 1) {
|
||||||
/* the OGM could not contain the changes due to their size or
|
/* the OGM could not contain the changes due to their size or
|
||||||
* because they have already been sent TT_OGM_APPEND_MAX times.
|
* because they have already been sent TT_OGM_APPEND_MAX times.
|
||||||
* In this case send a tt request */
|
* In this case send a tt request
|
||||||
|
*/
|
||||||
if (!tt_num_changes) {
|
if (!tt_num_changes) {
|
||||||
full_table = false;
|
full_table = false;
|
||||||
goto request_table;
|
goto request_table;
|
||||||
|
@ -2188,7 +2205,8 @@ void batadv_tt_update_orig(struct bat_priv *bat_priv,
|
||||||
|
|
||||||
/* Even if we received the precomputed crc with the OGM, we
|
/* Even if we received the precomputed crc with the OGM, we
|
||||||
* prefer to recompute it to spot any possible inconsistency
|
* prefer to recompute it to spot any possible inconsistency
|
||||||
* in the global table */
|
* in the global table
|
||||||
|
*/
|
||||||
orig_node->tt_crc = tt_global_crc(bat_priv, orig_node);
|
orig_node->tt_crc = tt_global_crc(bat_priv, orig_node);
|
||||||
|
|
||||||
/* The ttvn alone is not enough to guarantee consistency
|
/* The ttvn alone is not enough to guarantee consistency
|
||||||
|
@ -2198,17 +2216,19 @@ void batadv_tt_update_orig(struct bat_priv *bat_priv,
|
||||||
* consistent or not. E.g. a node could disconnect while its
|
* consistent or not. E.g. a node could disconnect while its
|
||||||
* ttvn is X and reconnect on ttvn = X + TTVN_MAX: in this case
|
* ttvn is X and reconnect on ttvn = X + TTVN_MAX: in this case
|
||||||
* checking the CRC value is mandatory to detect the
|
* checking the CRC value is mandatory to detect the
|
||||||
* inconsistency */
|
* inconsistency
|
||||||
|
*/
|
||||||
if (orig_node->tt_crc != tt_crc)
|
if (orig_node->tt_crc != tt_crc)
|
||||||
goto request_table;
|
goto request_table;
|
||||||
|
|
||||||
/* Roaming phase is over: tables are in sync again. I can
|
/* Roaming phase is over: tables are in sync again. I can
|
||||||
* unset the flag */
|
* unset the flag
|
||||||
|
*/
|
||||||
orig_node->tt_poss_change = false;
|
orig_node->tt_poss_change = false;
|
||||||
} else {
|
} else {
|
||||||
/* if we missed more than one change or our tables are not
|
/* if we missed more than one change or our tables are not
|
||||||
* in sync anymore -> request fresh tt data */
|
* in sync anymore -> request fresh tt data
|
||||||
|
*/
|
||||||
if (!orig_node->tt_initialised || ttvn != orig_ttvn ||
|
if (!orig_node->tt_initialised || ttvn != orig_ttvn ||
|
||||||
orig_node->tt_crc != tt_crc) {
|
orig_node->tt_crc != tt_crc) {
|
||||||
request_table:
|
request_table:
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich, Antonio Quartulli
|
* Marek Lindner, Simon Wunderlich, Antonio Quartulli
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_TRANSLATION_TABLE_H_
|
#ifndef _NET_BATMAN_ADV_TRANSLATION_TABLE_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Marek Lindner, Simon Wunderlich
|
* Marek Lindner, Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,11 +15,8 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_TYPES_H_
|
#ifndef _NET_BATMAN_ADV_TYPES_H_
|
||||||
#define _NET_BATMAN_ADV_TYPES_H_
|
#define _NET_BATMAN_ADV_TYPES_H_
|
||||||
|
|
||||||
|
@ -49,8 +45,7 @@ struct hard_iface {
|
||||||
struct rcu_head rcu;
|
struct rcu_head rcu;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/* orig_node - structure for orig_list maintaining nodes of mesh
|
||||||
* orig_node - structure for orig_list maintaining nodes of mesh
|
|
||||||
* @primary_addr: hosts primary interface address
|
* @primary_addr: hosts primary interface address
|
||||||
* @last_seen: when last packet from this node was received
|
* @last_seen: when last packet from this node was received
|
||||||
* @bcast_seqno_reset: time when the broadcast seqno window was reset
|
* @bcast_seqno_reset: time when the broadcast seqno window was reset
|
||||||
|
@ -86,7 +81,8 @@ struct orig_node {
|
||||||
* If true, then I sent a Roaming_adv to this orig_node and I have to
|
* If true, then I sent a Roaming_adv to this orig_node and I have to
|
||||||
* inspect every packet directed to it to check whether it is still
|
* inspect every packet directed to it to check whether it is still
|
||||||
* the true destination or not. This flag will be reset to false as
|
* the true destination or not. This flag will be reset to false as
|
||||||
* soon as I receive a new TTVN from this orig_node */
|
* soon as I receive a new TTVN from this orig_node
|
||||||
|
*/
|
||||||
bool tt_poss_change;
|
bool tt_poss_change;
|
||||||
uint32_t last_real_seqno;
|
uint32_t last_real_seqno;
|
||||||
uint8_t last_ttl;
|
uint8_t last_ttl;
|
||||||
|
@ -101,7 +97,8 @@ struct orig_node {
|
||||||
struct bat_priv *bat_priv;
|
struct bat_priv *bat_priv;
|
||||||
unsigned long last_frag_packet;
|
unsigned long last_frag_packet;
|
||||||
/* ogm_cnt_lock protects: bcast_own, bcast_own_sum,
|
/* ogm_cnt_lock protects: bcast_own, bcast_own_sum,
|
||||||
* neigh_node->real_bits, neigh_node->real_packet_count */
|
* neigh_node->real_bits, neigh_node->real_packet_count
|
||||||
|
*/
|
||||||
spinlock_t ogm_cnt_lock;
|
spinlock_t ogm_cnt_lock;
|
||||||
/* bcast_seqno_lock protects bcast_bits, last_bcast_seqno */
|
/* bcast_seqno_lock protects bcast_bits, last_bcast_seqno */
|
||||||
spinlock_t bcast_seqno_lock;
|
spinlock_t bcast_seqno_lock;
|
||||||
|
@ -118,8 +115,7 @@ struct gw_node {
|
||||||
struct rcu_head rcu;
|
struct rcu_head rcu;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/* neigh_node
|
||||||
* neigh_node
|
|
||||||
* @last_seen: when last packet via this neighbor was received
|
* @last_seen: when last packet via this neighbor was received
|
||||||
*/
|
*/
|
||||||
struct neigh_node {
|
struct neigh_node {
|
||||||
|
@ -191,7 +187,8 @@ struct bat_priv {
|
||||||
* If true, then I received a Roaming_adv and I have to inspect every
|
* If true, then I received a Roaming_adv and I have to inspect every
|
||||||
* packet directed to me to check whether I am still the true
|
* packet directed to me to check whether I am still the true
|
||||||
* destination or not. This flag will be reset to false as soon as I
|
* destination or not. This flag will be reset to false as soon as I
|
||||||
* increase my TTVN */
|
* increase my TTVN
|
||||||
|
*/
|
||||||
bool tt_poss_change;
|
bool tt_poss_change;
|
||||||
char num_ifaces;
|
char num_ifaces;
|
||||||
struct debug_log *debug_log;
|
struct debug_log *debug_log;
|
||||||
|
@ -326,8 +323,7 @@ struct tt_roam_node {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/* forw_packet - structure for forw_list maintaining packets to be
|
||||||
* forw_packet - structure for forw_list maintaining packets to be
|
|
||||||
* send/forwarded
|
* send/forwarded
|
||||||
*/
|
*/
|
||||||
struct forw_packet {
|
struct forw_packet {
|
||||||
|
@ -369,7 +365,8 @@ struct frag_packet_list_entry {
|
||||||
struct vis_info {
|
struct vis_info {
|
||||||
unsigned long first_seen;
|
unsigned long first_seen;
|
||||||
/* list of server-neighbors we received a vis-packet
|
/* list of server-neighbors we received a vis-packet
|
||||||
* from. we should not reply to them. */
|
* from. we should not reply to them.
|
||||||
|
*/
|
||||||
struct list_head recv_list;
|
struct list_head recv_list;
|
||||||
struct list_head send_list;
|
struct list_head send_list;
|
||||||
struct kref refcount;
|
struct kref refcount;
|
||||||
|
@ -377,7 +374,7 @@ struct vis_info {
|
||||||
struct bat_priv *bat_priv;
|
struct bat_priv *bat_priv;
|
||||||
/* this packet might be part of the vis send queue. */
|
/* this packet might be part of the vis send queue. */
|
||||||
struct sk_buff *skb_packet;
|
struct sk_buff *skb_packet;
|
||||||
/* vis_info may follow here*/
|
/* vis_info may follow here */
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
struct vis_info_entry {
|
struct vis_info_entry {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Andreas Langer
|
* Andreas Langer
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -300,12 +298,12 @@ int batadv_unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for tt host - increases orig_node refcount.
|
/* check for tt host - increases orig_node refcount.
|
||||||
* returns NULL in case of AP isolation */
|
* returns NULL in case of AP isolation
|
||||||
|
*/
|
||||||
orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
|
orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
|
||||||
ethhdr->h_dest);
|
ethhdr->h_dest);
|
||||||
find_router:
|
find_router:
|
||||||
/**
|
/* find_router():
|
||||||
* find_router():
|
|
||||||
* - if orig_node is NULL it returns NULL
|
* - if orig_node is NULL it returns NULL
|
||||||
* - increases neigh_nodes refcount if found.
|
* - increases neigh_nodes refcount if found.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2010-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Andreas Langer
|
* Andreas Langer
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_UNICAST_H_
|
#ifndef _NET_BATMAN_ADV_UNICAST_H_
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2008-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2008-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Simon Wunderlich
|
* Simon Wunderlich
|
||||||
*
|
*
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -64,8 +62,9 @@ static int vis_info_cmp(const struct hlist_node *node, const void *data2)
|
||||||
return compare_eth(p1->vis_orig, p2->vis_orig);
|
return compare_eth(p1->vis_orig, p2->vis_orig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hash function to choose an entry in a hash table of given size */
|
/* hash function to choose an entry in a hash table of given size
|
||||||
/* hash algorithm from http://en.wikipedia.org/wiki/Hash_table */
|
* hash algorithm from http://en.wikipedia.org/wiki/Hash_table
|
||||||
|
*/
|
||||||
static uint32_t vis_info_choose(const void *data, uint32_t size)
|
static uint32_t vis_info_choose(const void *data, uint32_t size)
|
||||||
{
|
{
|
||||||
const struct vis_info *vis_info = data;
|
const struct vis_info *vis_info = data;
|
||||||
|
@ -118,7 +117,8 @@ static struct vis_info *vis_hash_find(struct bat_priv *bat_priv,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* insert interface to the list of interfaces of one originator, if it
|
/* insert interface to the list of interfaces of one originator, if it
|
||||||
* does not already exist in the list */
|
* does not already exist in the list
|
||||||
|
*/
|
||||||
static void vis_data_insert_interface(const uint8_t *interface,
|
static void vis_data_insert_interface(const uint8_t *interface,
|
||||||
struct hlist_head *if_list,
|
struct hlist_head *if_list,
|
||||||
bool primary)
|
bool primary)
|
||||||
|
@ -334,7 +334,8 @@ int batadv_vis_seq_print_text(struct seq_file *seq, void *offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add the info packet to the send list, if it was not
|
/* add the info packet to the send list, if it was not
|
||||||
* already linked in. */
|
* already linked in.
|
||||||
|
*/
|
||||||
static void send_list_add(struct bat_priv *bat_priv, struct vis_info *info)
|
static void send_list_add(struct bat_priv *bat_priv, struct vis_info *info)
|
||||||
{
|
{
|
||||||
if (list_empty(&info->send_list)) {
|
if (list_empty(&info->send_list)) {
|
||||||
|
@ -344,7 +345,8 @@ static void send_list_add(struct bat_priv *bat_priv, struct vis_info *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delete the info packet from the send list, if it was
|
/* delete the info packet from the send list, if it was
|
||||||
* linked in. */
|
* linked in.
|
||||||
|
*/
|
||||||
static void send_list_del(struct vis_info *info)
|
static void send_list_del(struct vis_info *info)
|
||||||
{
|
{
|
||||||
if (!list_empty(&info->send_list)) {
|
if (!list_empty(&info->send_list)) {
|
||||||
|
@ -388,7 +390,8 @@ static int recv_list_is_in(struct bat_priv *bat_priv,
|
||||||
|
|
||||||
/* try to add the packet to the vis_hash. return NULL if invalid (e.g. too old,
|
/* try to add the packet to the vis_hash. return NULL if invalid (e.g. too old,
|
||||||
* broken.. ). vis hash must be locked outside. is_new is set when the packet
|
* broken.. ). vis hash must be locked outside. is_new is set when the packet
|
||||||
* is newer than old entries in the hash. */
|
* is newer than old entries in the hash.
|
||||||
|
*/
|
||||||
static struct vis_info *add_packet(struct bat_priv *bat_priv,
|
static struct vis_info *add_packet(struct bat_priv *bat_priv,
|
||||||
struct vis_packet *vis_packet,
|
struct vis_packet *vis_packet,
|
||||||
int vis_info_len, int *is_new,
|
int vis_info_len, int *is_new,
|
||||||
|
@ -500,7 +503,8 @@ void batadv_receive_server_sync_packet(struct bat_priv *bat_priv,
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
/* only if we are server ourselves and packet is newer than the one in
|
/* only if we are server ourselves and packet is newer than the one in
|
||||||
* hash.*/
|
* hash.
|
||||||
|
*/
|
||||||
if (vis_server == VIS_TYPE_SERVER_SYNC && is_new)
|
if (vis_server == VIS_TYPE_SERVER_SYNC && is_new)
|
||||||
send_list_add(bat_priv, info);
|
send_list_add(bat_priv, info);
|
||||||
end:
|
end:
|
||||||
|
@ -554,7 +558,8 @@ void batadv_receive_client_update_packet(struct bat_priv *bat_priv,
|
||||||
/* Walk the originators and find the VIS server with the best tq. Set the packet
|
/* Walk the originators and find the VIS server with the best tq. Set the packet
|
||||||
* address to its address and return the best_tq.
|
* address to its address and return the best_tq.
|
||||||
*
|
*
|
||||||
* Must be called with the originator hash locked */
|
* Must be called with the originator hash locked
|
||||||
|
*/
|
||||||
static int find_best_vis_server(struct bat_priv *bat_priv,
|
static int find_best_vis_server(struct bat_priv *bat_priv,
|
||||||
struct vis_info *info)
|
struct vis_info *info)
|
||||||
{
|
{
|
||||||
|
@ -605,7 +610,8 @@ static bool vis_packet_full(const struct vis_info *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* generates a packet of own vis data,
|
/* generates a packet of own vis data,
|
||||||
* returns 0 on success, -1 if no packet could be generated */
|
* returns 0 on success, -1 if no packet could be generated
|
||||||
|
*/
|
||||||
static int generate_vis_packet(struct bat_priv *bat_priv)
|
static int generate_vis_packet(struct bat_priv *bat_priv)
|
||||||
{
|
{
|
||||||
struct hashtable_t *hash = bat_priv->orig_hash;
|
struct hashtable_t *hash = bat_priv->orig_hash;
|
||||||
|
@ -703,7 +709,8 @@ static int generate_vis_packet(struct bat_priv *bat_priv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free old vis packets. Must be called with this vis_hash_lock
|
/* free old vis packets. Must be called with this vis_hash_lock
|
||||||
* held */
|
* held
|
||||||
|
*/
|
||||||
static void purge_vis_packets(struct bat_priv *bat_priv)
|
static void purge_vis_packets(struct bat_priv *bat_priv)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
@ -762,7 +769,8 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* don't send it if we already received the packet from
|
/* don't send it if we already received the packet from
|
||||||
* this node. */
|
* this node.
|
||||||
|
*/
|
||||||
if (recv_list_is_in(bat_priv, &info->recv_list,
|
if (recv_list_is_in(bat_priv, &info->recv_list,
|
||||||
orig_node->orig)) {
|
orig_node->orig)) {
|
||||||
batadv_neigh_node_free_ref(router);
|
batadv_neigh_node_free_ref(router);
|
||||||
|
@ -879,7 +887,8 @@ static void send_vis_packets(struct work_struct *work)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* init the vis server. this may only be called when if_list is already
|
/* init the vis server. this may only be called when if_list is already
|
||||||
* initialized (e.g. bat0 is initialized, interfaces have been added) */
|
* initialized (e.g. bat0 is initialized, interfaces have been added)
|
||||||
|
*/
|
||||||
int batadv_vis_init(struct bat_priv *bat_priv)
|
int batadv_vis_init(struct bat_priv *bat_priv)
|
||||||
{
|
{
|
||||||
struct vis_packet *packet;
|
struct vis_packet *packet;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*
|
/* Copyright (C) 2008-2012 B.A.T.M.A.N. contributors:
|
||||||
* Copyright (C) 2008-2012 B.A.T.M.A.N. contributors:
|
|
||||||
*
|
*
|
||||||
* Simon Wunderlich, Marek Lindner
|
* Simon Wunderlich, Marek Lindner
|
||||||
*
|
*
|
||||||
|
@ -16,14 +15,13 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
* 02110-1301, USA
|
* 02110-1301, USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NET_BATMAN_ADV_VIS_H_
|
#ifndef _NET_BATMAN_ADV_VIS_H_
|
||||||
#define _NET_BATMAN_ADV_VIS_H_
|
#define _NET_BATMAN_ADV_VIS_H_
|
||||||
|
|
||||||
#define VIS_TIMEOUT 200000 /* timeout of vis packets
|
/* timeout of vis packets in miliseconds */
|
||||||
* in miliseconds */
|
#define VIS_TIMEOUT 200000
|
||||||
|
|
||||||
int batadv_vis_seq_print_text(struct seq_file *seq, void *offset);
|
int batadv_vis_seq_print_text(struct seq_file *seq, void *offset);
|
||||||
void batadv_receive_server_sync_packet(struct bat_priv *bat_priv,
|
void batadv_receive_server_sync_packet(struct bat_priv *bat_priv,
|
||||||
|
|
Loading…
Reference in a new issue