batman-adv; branch, master, updated. v2012.1.0-149-g920535a
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 920535afae409445e8e504012b7c61c755f1ed92
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:42 2012 +0200
batman-adv: Prefix main non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_debugfs.c b/bat_debugfs.c
index 43a422b..3bdd99a 100644
--- a/bat_debugfs.c
+++ b/bat_debugfs.c
@@ -94,13 +94,13 @@ static int log_open(struct inode *inode, struct file *file)
{
nonseekable_open(inode, file);
file->private_data = inode->i_private;
- inc_module_count();
+ batadv_inc_module_count();
return 0;
}
static int log_release(struct inode *inode, struct file *file)
{
- dec_module_count();
+ batadv_dec_module_count();
return 0;
}
@@ -224,7 +224,7 @@ static void debug_log_cleanup(struct bat_priv *bat_priv)
static int bat_algorithms_open(struct inode *inode, struct file *file)
{
- return single_open(file, bat_algo_seq_print_text, NULL);
+ return single_open(file, batadv_algo_seq_print_text, NULL);
}
static int originators_open(struct inode *inode, struct file *file)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 2518781..aadc3c6 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -204,7 +204,7 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet,
inc_counter(bat_priv, BAT_CNT_MGMT_TX);
add_counter(bat_priv, BAT_CNT_MGMT_TX_BYTES,
skb->len + ETH_HLEN);
- batadv_send_skb_packet(skb, hard_iface, broadcast_addr);
+ batadv_send_skb_packet(skb, hard_iface, batadv_broadcast_addr);
}
}
@@ -255,7 +255,7 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
/* skb is only used once and than forw_packet is free'd */
batadv_send_skb_packet(forw_packet->skb,
forw_packet->if_incoming,
- broadcast_addr);
+ batadv_broadcast_addr);
forw_packet->skb = NULL;
goto out;
@@ -263,7 +263,7 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
/* broadcast on every interface */
rcu_read_lock();
- list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
+ list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
if (hard_iface->soft_iface != soft_iface)
continue;
@@ -425,7 +425,7 @@ static void bat_iv_ogm_aggregate_new(const unsigned char *packet_buff,
/* start timer for this packet */
INIT_DELAYED_WORK(&forw_packet_aggr->delayed_work,
batadv_send_outstanding_bat_ogm_packet);
- queue_delayed_work(bat_event_workqueue,
+ queue_delayed_work(batadv_event_workqueue,
&forw_packet_aggr->delayed_work,
send_time - jiffies);
@@ -984,7 +984,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
batman_ogm_packet->header.version, has_directlink_flag);
rcu_read_lock();
- list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
+ list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
if (hard_iface->if_status != IF_ACTIVE)
continue;
@@ -1258,18 +1258,18 @@ int __init batadv_iv_init(void)
int ret;
/* batman originator packet */
- ret = recv_handler_register(BAT_IV_OGM, bat_iv_ogm_receive);
+ ret = batadv_recv_handler_register(BAT_IV_OGM, bat_iv_ogm_receive);
if (ret < 0)
goto out;
- ret = bat_algo_register(&batman_iv);
+ ret = batadv_algo_register(&batman_iv);
if (ret < 0)
goto handler_unregister;
goto out;
handler_unregister:
- recv_handler_unregister(BAT_IV_OGM);
+ batadv_recv_handler_unregister(BAT_IV_OGM);
out:
return ret;
}
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
index bd356a1..27f451a 100644
--- a/bridge_loop_avoidance.c
+++ b/bridge_loop_avoidance.c
@@ -1070,7 +1070,7 @@ void batadv_bla_update_orig_address(struct bat_priv *bat_priv,
static void bla_start_timer(struct bat_priv *bat_priv)
{
INIT_DELAYED_WORK(&bat_priv->bla_work, bla_periodic_work);
- queue_delayed_work(bat_event_workqueue, &bat_priv->bla_work,
+ queue_delayed_work(batadv_event_workqueue, &bat_priv->bla_work,
msecs_to_jiffies(BLA_PERIOD_LENGTH));
}
diff --git a/hard-interface.c b/hard-interface.c
index 3845d32..106b4e3 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -47,7 +47,7 @@ struct hard_iface *batadv_hardif_get_by_netdev(const struct net_device *net_dev)
struct hard_iface *hard_iface;
rcu_read_lock();
- list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
+ list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
if (hard_iface->net_dev == net_dev &&
atomic_inc_not_zero(&hard_iface->refcount))
goto out;
@@ -87,7 +87,7 @@ static struct hard_iface *hardif_get_active(const struct net_device *soft_iface)
struct hard_iface *hard_iface;
rcu_read_lock();
- list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
+ list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
if (hard_iface->soft_iface != soft_iface)
continue;
@@ -164,7 +164,7 @@ static void check_known_mac_addr(const struct net_device *net_dev)
const struct hard_iface *hard_iface;
rcu_read_lock();
- list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
+ list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
if ((hard_iface->if_status != IF_ACTIVE) &&
(hard_iface->if_status != IF_TO_BE_ACTIVATED))
continue;
@@ -195,7 +195,7 @@ int batadv_hardif_min_mtu(struct net_device *soft_iface)
goto out;
rcu_read_lock();
- list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
+ list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
if ((hard_iface->if_status != IF_ACTIVE) &&
(hard_iface->if_status != IF_TO_BE_ACTIVATED))
continue;
@@ -318,7 +318,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
batadv_orig_hash_add_if(hard_iface, bat_priv->num_ifaces);
hard_iface->batman_adv_ptype.type = __constant_htons(ETH_P_BATMAN);
- hard_iface->batman_adv_ptype.func = batman_skb_recv;
+ hard_iface->batman_adv_ptype.func = batadv_batman_skb_recv;
hard_iface->batman_adv_ptype.dev = hard_iface->net_dev;
dev_add_pack(&hard_iface->batman_adv_ptype);
@@ -439,7 +439,7 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev)
atomic_set(&hard_iface->refcount, 2);
check_known_mac_addr(hard_iface->net_dev);
- list_add_tail_rcu(&hard_iface->list, &hardif_list);
+ list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list);
/**
* This can't be called via a bat_priv callback because
@@ -480,7 +480,7 @@ void batadv_hardif_remove_interfaces(void)
rtnl_lock();
list_for_each_entry_safe(hard_iface, hard_iface_tmp,
- &hardif_list, list) {
+ &batadv_hardif_list, list) {
list_del_rcu(&hard_iface->list);
hardif_remove_interface(hard_iface);
}
diff --git a/icmp_socket.c b/icmp_socket.c
index c7ef760..cd4e357 100644
--- a/icmp_socket.c
+++ b/icmp_socket.c
@@ -73,7 +73,7 @@ static int bat_socket_open(struct inode *inode, struct file *file)
file->private_data = socket_client;
- inc_module_count();
+ batadv_inc_module_count();
return 0;
}
@@ -98,7 +98,7 @@ static int bat_socket_release(struct inode *inode, struct file *file)
spin_unlock_bh(&socket_client->lock);
kfree(socket_client);
- dec_module_count();
+ batadv_dec_module_count();
return 0;
}
diff --git a/main.c b/main.c
index 3cc3b28..535d785 100644
--- a/main.c
+++ b/main.c
@@ -38,20 +38,20 @@
/* List manipulations on hardif_list have to be rtnl_lock()'ed,
* list traversals just rcu-locked */
-struct list_head hardif_list;
+struct list_head batadv_hardif_list;
static int (*recv_packet_handler[256])(struct sk_buff *, struct hard_iface *);
-char bat_routing_algo[20] = "BATMAN_IV";
+char batadv_routing_algo[20] = "BATMAN_IV";
static struct hlist_head bat_algo_list;
-unsigned char broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+unsigned char batadv_broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-struct workqueue_struct *bat_event_workqueue;
+struct workqueue_struct *batadv_event_workqueue;
static void recv_handler_init(void);
static int __init batman_init(void)
{
- INIT_LIST_HEAD(&hardif_list);
+ INIT_LIST_HEAD(&batadv_hardif_list);
INIT_HLIST_HEAD(&bat_algo_list);
recv_handler_init();
@@ -60,9 +60,9 @@ static int __init batman_init(void)
/* the name should not be longer than 10 chars - see
* http://lwn.net/Articles/23634/ */
- bat_event_workqueue = create_singlethread_workqueue("bat_events");
+ batadv_event_workqueue = create_singlethread_workqueue("bat_events");
- if (!bat_event_workqueue)
+ if (!batadv_event_workqueue)
return -ENOMEM;
batadv_socket_init();
@@ -82,14 +82,14 @@ static void __exit batman_exit(void)
unregister_netdevice_notifier(&batadv_hard_if_notifier);
batadv_hardif_remove_interfaces();
- flush_workqueue(bat_event_workqueue);
- destroy_workqueue(bat_event_workqueue);
- bat_event_workqueue = NULL;
+ flush_workqueue(batadv_event_workqueue);
+ destroy_workqueue(batadv_event_workqueue);
+ batadv_event_workqueue = NULL;
rcu_barrier();
}
-int mesh_init(struct net_device *soft_iface)
+int batadv_mesh_init(struct net_device *soft_iface)
{
struct bat_priv *bat_priv = netdev_priv(soft_iface);
int ret;
@@ -135,11 +135,11 @@ int mesh_init(struct net_device *soft_iface)
return 0;
err:
- mesh_free(soft_iface);
+ batadv_mesh_free(soft_iface);
return ret;
}
-void mesh_free(struct net_device *soft_iface)
+void batadv_mesh_free(struct net_device *soft_iface)
{
struct bat_priv *bat_priv = netdev_priv(soft_iface);
@@ -161,22 +161,22 @@ void mesh_free(struct net_device *soft_iface)
atomic_set(&bat_priv->mesh_state, MESH_INACTIVE);
}
-void inc_module_count(void)
+void batadv_inc_module_count(void)
{
try_module_get(THIS_MODULE);
}
-void dec_module_count(void)
+void batadv_dec_module_count(void)
{
module_put(THIS_MODULE);
}
-int is_my_mac(const uint8_t *addr)
+int batadv_is_my_mac(const uint8_t *addr)
{
const struct hard_iface *hard_iface;
rcu_read_lock();
- list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
+ list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
if (hard_iface->if_status != IF_ACTIVE)
continue;
@@ -198,8 +198,9 @@ static int recv_unhandled_packet(struct sk_buff *skb,
/* incoming packets with the batman ethertype received on any active hard
* interface
*/
-int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
- struct packet_type *ptype, struct net_device *orig_dev)
+int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
+ struct packet_type *ptype,
+ struct net_device *orig_dev)
{
struct bat_priv *bat_priv;
struct batman_ogm_packet *batman_ogm_packet;
@@ -289,9 +290,9 @@ static void recv_handler_init(void)
recv_packet_handler[BAT_ROAM_ADV] = batadv_recv_roam_adv;
}
-int recv_handler_register(uint8_t packet_type,
- int (*recv_handler)(struct sk_buff *,
- struct hard_iface *))
+int batadv_recv_handler_register(uint8_t packet_type,
+ int (*recv_handler)(struct sk_buff *,
+ struct hard_iface *))
{
if (recv_packet_handler[packet_type] != &recv_unhandled_packet)
return -EBUSY;
@@ -300,7 +301,7 @@ int recv_handler_register(uint8_t packet_type,
return 0;
}
-void recv_handler_unregister(uint8_t packet_type)
+void batadv_recv_handler_unregister(uint8_t packet_type)
{
recv_packet_handler[packet_type] = recv_unhandled_packet;
}
@@ -321,7 +322,7 @@ static struct bat_algo_ops *bat_algo_get(char *name)
return bat_algo_ops;
}
-int bat_algo_register(struct bat_algo_ops *bat_algo_ops)
+int batadv_algo_register(struct bat_algo_ops *bat_algo_ops)
{
struct bat_algo_ops *bat_algo_ops_tmp;
int ret;
@@ -355,7 +356,7 @@ out:
return ret;
}
-int bat_algo_select(struct bat_priv *bat_priv, char *name)
+int batadv_algo_select(struct bat_priv *bat_priv, char *name)
{
struct bat_algo_ops *bat_algo_ops;
int ret = -EINVAL;
@@ -371,7 +372,7 @@ out:
return ret;
}
-int bat_algo_seq_print_text(struct seq_file *seq, void *offset)
+int batadv_algo_seq_print_text(struct seq_file *seq, void *offset)
{
struct bat_algo_ops *bat_algo_ops;
struct hlist_node *node;
@@ -409,8 +410,8 @@ static const struct kernel_param_ops param_ops_ra = {
};
static struct kparam_string __param_string_ra = {
- .maxlen = sizeof(bat_routing_algo),
- .string = bat_routing_algo,
+ .maxlen = sizeof(batadv_routing_algo),
+ .string = batadv_routing_algo,
};
module_param_cb(routing_algo, ¶m_ops_ra, &__param_string_ra, 0644);
diff --git a/main.h b/main.h
index fef7fd6..b15cd94 100644
--- a/main.h
+++ b/main.h
@@ -160,26 +160,27 @@ enum dbg_level {
#include "types.h"
-extern char bat_routing_algo[];
-extern struct list_head hardif_list;
-
-extern unsigned char broadcast_addr[];
-extern struct workqueue_struct *bat_event_workqueue;
-
-int mesh_init(struct net_device *soft_iface);
-void mesh_free(struct net_device *soft_iface);
-void inc_module_count(void);
-void dec_module_count(void);
-int is_my_mac(const uint8_t *addr);
-int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
- struct packet_type *ptype, struct net_device *orig_dev);
-int recv_handler_register(uint8_t packet_type,
- int (*recv_handler)(struct sk_buff *,
- struct hard_iface *));
-void recv_handler_unregister(uint8_t packet_type);
-int bat_algo_register(struct bat_algo_ops *bat_algo_ops);
-int bat_algo_select(struct bat_priv *bat_priv, char *name);
-int bat_algo_seq_print_text(struct seq_file *seq, void *offset);
+extern char batadv_routing_algo[];
+extern struct list_head batadv_hardif_list;
+
+extern unsigned char batadv_broadcast_addr[];
+extern struct workqueue_struct *batadv_event_workqueue;
+
+int batadv_mesh_init(struct net_device *soft_iface);
+void batadv_mesh_free(struct net_device *soft_iface);
+void batadv_inc_module_count(void);
+void batadv_dec_module_count(void);
+int batadv_is_my_mac(const uint8_t *addr);
+int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
+ struct packet_type *ptype,
+ struct net_device *orig_dev);
+int batadv_recv_handler_register(uint8_t packet_type,
+ int (*recv_handler)(struct sk_buff *,
+ struct hard_iface *));
+void batadv_recv_handler_unregister(uint8_t packet_type);
+int batadv_algo_register(struct bat_algo_ops *bat_algo_ops);
+int batadv_algo_select(struct bat_priv *bat_priv, char *name);
+int batadv_algo_seq_print_text(struct seq_file *seq, void *offset);
#ifdef CONFIG_BATMAN_ADV_DEBUG
int batadv_debug_log(struct bat_priv *bat_priv, const char *fmt, ...)
diff --git a/originator.c b/originator.c
index 7decb40..2fe3a4f 100644
--- a/originator.c
+++ b/originator.c
@@ -36,7 +36,7 @@ static void purge_orig(struct work_struct *work);
static void start_purge_timer(struct bat_priv *bat_priv)
{
INIT_DELAYED_WORK(&bat_priv->orig_work, purge_orig);
- queue_delayed_work(bat_event_workqueue,
+ queue_delayed_work(batadv_event_workqueue,
&bat_priv->orig_work, msecs_to_jiffies(1000));
}
@@ -625,7 +625,7 @@ int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num)
/* renumber remaining batman interfaces _inside_ of orig_hash_lock */
rcu_read_lock();
- list_for_each_entry_rcu(hard_iface_tmp, &hardif_list, list) {
+ list_for_each_entry_rcu(hard_iface_tmp, &batadv_hardif_list, list) {
if (hard_iface_tmp->if_status == IF_NOT_IN_USE)
continue;
diff --git a/routing.c b/routing.c
index 178d2bc..a50e9fe 100644
--- a/routing.c
+++ b/routing.c
@@ -419,7 +419,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
goto out;
/* not for me */
- if (!is_my_mac(ethhdr->h_dest))
+ if (!batadv_is_my_mac(ethhdr->h_dest))
goto out;
icmp_packet = (struct icmp_packet_rr *)skb->data;
@@ -433,7 +433,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
}
/* packet for me */
- if (is_my_mac(icmp_packet->dst))
+ if (batadv_is_my_mac(icmp_packet->dst))
return recv_my_icmp_packet(bat_priv, skb, hdr_size);
/* TTL exceeded */
@@ -614,7 +614,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
case TT_RESPONSE:
inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_RX);
- if (is_my_mac(tt_query->dst)) {
+ if (batadv_is_my_mac(tt_query->dst)) {
/* packet needs to be linearized to access the TT
* changes */
if (skb_linearize(skb) < 0)
@@ -668,7 +668,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
roam_adv_packet = (struct roam_adv_packet *)skb->data;
- if (!is_my_mac(roam_adv_packet->dst))
+ if (!batadv_is_my_mac(roam_adv_packet->dst))
return route_unicast_packet(skb, recv_if);
/* check if it is a backbone gateway. we don't accept
@@ -802,7 +802,7 @@ static int check_unicast_packet(struct sk_buff *skb, int hdr_size)
return -1;
/* not for me */
- if (!is_my_mac(ethhdr->h_dest))
+ if (!batadv_is_my_mac(ethhdr->h_dest))
return -1;
return 0;
@@ -906,7 +906,7 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
unicast_packet = (struct unicast_packet *)skb->data;
- if (is_my_mac(unicast_packet->dest)) {
+ if (batadv_is_my_mac(unicast_packet->dest)) {
tt_poss_change = bat_priv->tt_poss_change;
curr_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn);
} else {
@@ -986,7 +986,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
return NET_RX_DROP;
/* packet for me */
- if (is_my_mac(unicast_packet->dest)) {
+ if (batadv_is_my_mac(unicast_packet->dest)) {
batadv_interface_rx(recv_if->soft_iface, skb, recv_if,
hdr_size);
return NET_RX_SUCCESS;
@@ -1013,7 +1013,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
unicast_packet = (struct unicast_frag_packet *)skb->data;
/* packet for me */
- if (is_my_mac(unicast_packet->dest)) {
+ if (batadv_is_my_mac(unicast_packet->dest)) {
ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb);
@@ -1058,13 +1058,13 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
goto out;
/* ignore broadcasts sent by myself */
- if (is_my_mac(ethhdr->h_source))
+ if (batadv_is_my_mac(ethhdr->h_source))
goto out;
bcast_packet = (struct bcast_packet *)skb->data;
/* ignore broadcasts originated by myself */
- if (is_my_mac(bcast_packet->orig))
+ if (batadv_is_my_mac(bcast_packet->orig))
goto out;
if (bcast_packet->header.ttl < 2)
@@ -1140,14 +1140,14 @@ int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if)
ethhdr = (struct ethhdr *)skb_mac_header(skb);
/* not for me */
- if (!is_my_mac(ethhdr->h_dest))
+ if (!batadv_is_my_mac(ethhdr->h_dest))
return NET_RX_DROP;
/* ignore own packets */
- if (is_my_mac(vis_packet->vis_orig))
+ if (batadv_is_my_mac(vis_packet->vis_orig))
return NET_RX_DROP;
- if (is_my_mac(vis_packet->sender_orig))
+ if (batadv_is_my_mac(vis_packet->sender_orig))
return NET_RX_DROP;
switch (vis_packet->vis_type) {
diff --git a/send.c b/send.c
index a8af6e3..109853f 100644
--- a/send.c
+++ b/send.c
@@ -122,7 +122,7 @@ static void _add_bcast_packet_to_list(struct bat_priv *bat_priv,
/* start timer for this packet */
INIT_DELAYED_WORK(&forw_packet->delayed_work,
send_outstanding_bcast_packet);
- queue_delayed_work(bat_event_workqueue, &forw_packet->delayed_work,
+ queue_delayed_work(batadv_event_workqueue, &forw_packet->delayed_work,
send_time);
}
@@ -209,7 +209,7 @@ static void send_outstanding_bcast_packet(struct work_struct *work)
/* rebroadcast packet */
rcu_read_lock();
- list_for_each_entry_rcu(hard_iface, &hardif_list, list) {
+ list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
if (hard_iface->soft_iface != soft_iface)
continue;
@@ -217,7 +217,7 @@ static void send_outstanding_bcast_packet(struct work_struct *work)
skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC);
if (skb1)
batadv_send_skb_packet(skb1, hard_iface,
- broadcast_addr);
+ batadv_broadcast_addr);
}
rcu_read_unlock();
diff --git a/soft-interface.c b/soft-interface.c
index 947a0b1..eb76396 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -426,7 +426,7 @@ struct net_device *batadv_softif_create(const char *name)
if (!bat_priv->bat_counters)
goto unreg_soft_iface;
- ret = bat_algo_select(bat_priv, bat_routing_algo);
+ ret = batadv_algo_select(bat_priv, batadv_routing_algo);
if (ret < 0)
goto free_bat_counters;
@@ -438,7 +438,7 @@ struct net_device *batadv_softif_create(const char *name)
if (ret < 0)
goto unreg_sysfs;
- ret = mesh_init(soft_iface);
+ ret = batadv_mesh_init(soft_iface);
if (ret < 0)
goto unreg_debugfs;
@@ -464,7 +464,7 @@ void batadv_softif_destroy(struct net_device *soft_iface)
{
batadv_debugfs_del_meshif(soft_iface);
batadv_sysfs_del_meshif(soft_iface);
- mesh_free(soft_iface);
+ batadv_mesh_free(soft_iface);
unregister_netdevice(soft_iface);
}
diff --git a/translation-table.c b/translation-table.c
index e27502e..3ecb18b 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -48,7 +48,7 @@ static int compare_tt(const struct hlist_node *node, const void *data2)
static void tt_start_timer(struct bat_priv *bat_priv)
{
INIT_DELAYED_WORK(&bat_priv->tt_work, tt_purge);
- queue_delayed_work(bat_event_workqueue, &bat_priv->tt_work,
+ queue_delayed_work(batadv_event_workqueue, &bat_priv->tt_work,
msecs_to_jiffies(5000));
}
@@ -1673,7 +1673,7 @@ out:
bool batadv_send_tt_response(struct bat_priv *bat_priv,
struct tt_query_packet *tt_request)
{
- if (is_my_mac(tt_request->dst)) {
+ if (batadv_is_my_mac(tt_request->dst)) {
/* don't answer backbone gws! */
if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_request->src))
return true;
diff --git a/vis.c b/vis.c
index 24040c3..83c931f 100644
--- a/vis.c
+++ b/vis.c
@@ -462,7 +462,7 @@ static struct vis_info *add_packet(struct bat_priv *bat_priv,
/* Make it a broadcast packet, if required */
if (make_broadcast)
- memcpy(packet->target_orig, broadcast_addr, ETH_ALEN);
+ memcpy(packet->target_orig, batadv_broadcast_addr, ETH_ALEN);
/* repair if entries is longer than packet. */
if (packet->entries * sizeof(struct vis_info_entry) > vis_info_len)
@@ -524,7 +524,7 @@ void batadv_receive_client_update_packet(struct bat_priv *bat_priv,
/* Are we the target for this VIS packet? */
if (vis_server == VIS_TYPE_SERVER_SYNC &&
- is_my_mac(vis_packet->target_orig))
+ batadv_is_my_mac(vis_packet->target_orig))
are_target = 1;
spin_lock_bh(&bat_priv->vis_hash_lock);
@@ -543,7 +543,7 @@ void batadv_receive_client_update_packet(struct bat_priv *bat_priv,
send_list_add(bat_priv, info);
/* ... we're not the recipient (and thus need to forward). */
- } else if (!is_my_mac(packet->target_orig)) {
+ } else if (!batadv_is_my_mac(packet->target_orig)) {
send_list_add(bat_priv, info);
}
@@ -623,7 +623,7 @@ static int generate_vis_packet(struct bat_priv *bat_priv)
info->first_seen = jiffies;
packet->vis_type = atomic_read(&bat_priv->vis_mode);
- memcpy(packet->target_orig, broadcast_addr, ETH_ALEN);
+ memcpy(packet->target_orig, batadv_broadcast_addr, ETH_ALEN);
packet->header.ttl = TTL;
packet->seqno = htonl(ntohl(packet->seqno) + 1);
packet->entries = 0;
@@ -978,6 +978,6 @@ void batadv_vis_quit(struct bat_priv *bat_priv)
static void start_vis_timer(struct bat_priv *bat_priv)
{
INIT_DELAYED_WORK(&bat_priv->vis_work, send_vis_packets);
- queue_delayed_work(bat_event_workqueue, &bat_priv->vis_work,
+ queue_delayed_work(batadv_event_workqueue, &bat_priv->vis_work,
msecs_to_jiffies(VIS_INTERVAL));
}
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-148-ge0c233a
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit e0c233a34178c3db2a57912f19686d4f6851b3c6
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:41 2012 +0200
batman-adv: Prefix vis non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_debugfs.c b/bat_debugfs.c
index cab2425..43a422b 100644
--- a/bat_debugfs.c
+++ b/bat_debugfs.c
@@ -263,7 +263,7 @@ static int transtable_local_open(struct inode *inode, struct file *file)
static int vis_data_open(struct inode *inode, struct file *file)
{
struct net_device *net_dev = (struct net_device *)inode->i_private;
- return single_open(file, vis_seq_print_text, net_dev);
+ return single_open(file, batadv_vis_seq_print_text, net_dev);
}
struct bat_debuginfo {
diff --git a/main.c b/main.c
index a405513..3cc3b28 100644
--- a/main.c
+++ b/main.c
@@ -121,7 +121,7 @@ int mesh_init(struct net_device *soft_iface)
batadv_tt_local_add(soft_iface, soft_iface->dev_addr, NULL_IFINDEX);
- ret = vis_init(bat_priv);
+ ret = batadv_vis_init(bat_priv);
if (ret < 0)
goto err;
@@ -147,7 +147,7 @@ void mesh_free(struct net_device *soft_iface)
batadv_purge_outstanding_packets(bat_priv, NULL);
- vis_quit(bat_priv);
+ batadv_vis_quit(bat_priv);
batadv_gw_node_purge(bat_priv);
batadv_originator_free(bat_priv);
diff --git a/routing.c b/routing.c
index 62af48d..178d2bc 100644
--- a/routing.c
+++ b/routing.c
@@ -1152,13 +1152,13 @@ int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if)
switch (vis_packet->vis_type) {
case VIS_TYPE_SERVER_SYNC:
- receive_server_sync_packet(bat_priv, vis_packet,
- skb_headlen(skb));
+ batadv_receive_server_sync_packet(bat_priv, vis_packet,
+ skb_headlen(skb));
break;
case VIS_TYPE_CLIENT_UPDATE:
- receive_client_update_packet(bat_priv, vis_packet,
- skb_headlen(skb));
+ batadv_receive_client_update_packet(bat_priv, vis_packet,
+ skb_headlen(skb));
break;
default: /* ignore unknown packet */
diff --git a/vis.c b/vis.c
index c56737c..24040c3 100644
--- a/vis.c
+++ b/vis.c
@@ -188,7 +188,7 @@ static ssize_t vis_data_read_entry(char *buff,
return 0;
}
-int vis_seq_print_text(struct seq_file *seq, void *offset)
+int batadv_vis_seq_print_text(struct seq_file *seq, void *offset)
{
struct hard_iface *primary_if;
struct hlist_node *node;
@@ -483,9 +483,9 @@ static struct vis_info *add_packet(struct bat_priv *bat_priv,
}
/* handle the server sync packet, forward if needed. */
-void receive_server_sync_packet(struct bat_priv *bat_priv,
- struct vis_packet *vis_packet,
- int vis_info_len)
+void batadv_receive_server_sync_packet(struct bat_priv *bat_priv,
+ struct vis_packet *vis_packet,
+ int vis_info_len)
{
struct vis_info *info;
int is_new, make_broadcast;
@@ -508,9 +508,9 @@ end:
}
/* handle an incoming client update packet and schedule forward if needed. */
-void receive_client_update_packet(struct bat_priv *bat_priv,
- struct vis_packet *vis_packet,
- int vis_info_len)
+void batadv_receive_client_update_packet(struct bat_priv *bat_priv,
+ struct vis_packet *vis_packet,
+ int vis_info_len)
{
struct vis_info *info;
struct vis_packet *packet;
@@ -880,7 +880,7 @@ static void send_vis_packets(struct work_struct *work)
/* init the vis server. this may only be called when if_list is already
* initialized (e.g. bat0 is initialized, interfaces have been added) */
-int vis_init(struct bat_priv *bat_priv)
+int batadv_vis_init(struct bat_priv *bat_priv)
{
struct vis_packet *packet;
int hash_added;
@@ -944,7 +944,7 @@ free_info:
bat_priv->my_vis_info = NULL;
err:
spin_unlock_bh(&bat_priv->vis_hash_lock);
- vis_quit(bat_priv);
+ batadv_vis_quit(bat_priv);
return -ENOMEM;
}
@@ -959,7 +959,7 @@ static void free_info_ref(struct hlist_node *node, void *arg)
}
/* shutdown vis-server */
-void vis_quit(struct bat_priv *bat_priv)
+void batadv_vis_quit(struct bat_priv *bat_priv)
{
if (!bat_priv->vis_hash)
return;
diff --git a/vis.h b/vis.h
index ee2e46e..932514e 100644
--- a/vis.h
+++ b/vis.h
@@ -25,14 +25,14 @@
#define VIS_TIMEOUT 200000 /* timeout of vis packets
* in miliseconds */
-int vis_seq_print_text(struct seq_file *seq, void *offset);
-void receive_server_sync_packet(struct bat_priv *bat_priv,
- struct vis_packet *vis_packet,
- int vis_info_len);
-void receive_client_update_packet(struct bat_priv *bat_priv,
- struct vis_packet *vis_packet,
- int vis_info_len);
-int vis_init(struct bat_priv *bat_priv);
-void vis_quit(struct bat_priv *bat_priv);
+int batadv_vis_seq_print_text(struct seq_file *seq, void *offset);
+void batadv_receive_server_sync_packet(struct bat_priv *bat_priv,
+ struct vis_packet *vis_packet,
+ int vis_info_len);
+void batadv_receive_client_update_packet(struct bat_priv *bat_priv,
+ struct vis_packet *vis_packet,
+ int vis_info_len);
+int batadv_vis_init(struct bat_priv *bat_priv);
+void batadv_vis_quit(struct bat_priv *bat_priv);
#endif /* _NET_BATMAN_ADV_VIS_H_ */
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-147-g6b8bdc6
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 6b8bdc67536d7515d077976528526e8901523274
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:40 2012 +0200
batman-adv: Prefix unicast non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/distributed-arp-table.c b/distributed-arp-table.c
index 97e229d..6bc64f8 100644
--- a/distributed-arp-table.c
+++ b/distributed-arp-table.c
@@ -259,9 +259,9 @@ static bool dht_send_data(struct bat_priv *bat_priv, struct sk_buff *skb,
goto free_orig;
tmp_skb = pskb_copy(skb, GFP_ATOMIC);
- if (!prepare_unicast_4addr_packet(bat_priv, tmp_skb,
- cand[i].orig_node,
- packet_subtype)) {
+ if (!batadv_prepare_unicast_4addr_packet(bat_priv, tmp_skb,
+ cand[i].orig_node,
+ packet_subtype)) {
kfree_skb(tmp_skb);
goto free_neigh;
}
diff --git a/originator.c b/originator.c
index d560301..7decb40 100644
--- a/originator.c
+++ b/originator.c
@@ -139,7 +139,7 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
spin_unlock_bh(&orig_node->neigh_list_lock);
- frag_list_free(&orig_node->frag_list);
+ batadv_frag_list_free(&orig_node->frag_list);
batadv_tt_global_del_orig(orig_node->bat_priv, orig_node,
"originator timed out");
@@ -374,7 +374,7 @@ static void _purge_orig(struct bat_priv *bat_priv)
if (has_timed_out(orig_node->last_frag_packet,
FRAG_TIMEOUT))
- frag_list_free(&orig_node->frag_list);
+ batadv_frag_list_free(&orig_node->frag_list);
}
spin_unlock_bh(list_lock);
}
diff --git a/routing.c b/routing.c
index fbdce11..62af48d 100644
--- a/routing.c
+++ b/routing.c
@@ -848,15 +848,16 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
if (unicast_packet->header.packet_type == BAT_UNICAST &&
atomic_read(&bat_priv->fragmentation) &&
skb->len > neigh_node->if_incoming->net_dev->mtu) {
- ret = frag_send_skb(skb, bat_priv,
- neigh_node->if_incoming, neigh_node->addr);
+ ret = batadv_frag_send_skb(skb, bat_priv,
+ neigh_node->if_incoming,
+ neigh_node->addr);
goto out;
}
if (unicast_packet->header.packet_type == BAT_UNICAST_FRAG &&
frag_can_reassemble(skb, neigh_node->if_incoming->net_dev->mtu)) {
- ret = frag_reassemble_skb(skb, bat_priv, &new_skb);
+ ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb);
if (ret == NET_RX_DROP)
goto out;
@@ -1014,7 +1015,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
/* packet for me */
if (is_my_mac(unicast_packet->dest)) {
- ret = frag_reassemble_skb(skb, bat_priv, &new_skb);
+ ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb);
if (ret == NET_RX_DROP)
return NET_RX_DROP;
diff --git a/unicast.c b/unicast.c
index 4ac6cac..7e740d9 100644
--- a/unicast.c
+++ b/unicast.c
@@ -101,7 +101,7 @@ static int frag_create_buffer(struct list_head *head)
for (i = 0; i < FRAG_BUFFER_SIZE; i++) {
tfp = kmalloc(sizeof(*tfp), GFP_ATOMIC);
if (!tfp) {
- frag_list_free(head);
+ batadv_frag_list_free(head);
return -ENOMEM;
}
tfp->skb = NULL;
@@ -151,7 +151,7 @@ mov_tail:
return NULL;
}
-void frag_list_free(struct list_head *head)
+void batadv_frag_list_free(struct list_head *head)
{
struct frag_packet_list_entry *pf, *tmp_pf;
@@ -172,8 +172,8 @@ void frag_list_free(struct list_head *head)
* or the skb could be reassembled (skb_new will point to the new packet and
* skb was freed)
*/
-int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
- struct sk_buff **new_skb)
+int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
+ struct sk_buff **new_skb)
{
struct orig_node *orig_node;
struct frag_packet_list_entry *tmp_frag_entry;
@@ -216,8 +216,8 @@ out:
return ret;
}
-int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
- struct hard_iface *hard_iface, const uint8_t dstaddr[])
+int batadv_frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
+ struct hard_iface *hard_iface, const uint8_t dstaddr[])
{
struct unicast_packet tmp_uc, *unicast_packet;
struct hard_iface *primary_if;
@@ -313,10 +313,10 @@ static bool prepare_unicast_packet(struct sk_buff *skb,
orig_node);
}
-bool prepare_unicast_4addr_packet(struct bat_priv *bat_priv,
- struct sk_buff *skb,
- struct orig_node *orig_node,
- int packet_subtype)
+bool batadv_prepare_unicast_4addr_packet(struct bat_priv *bat_priv,
+ struct sk_buff *skb,
+ struct orig_node *orig_node,
+ int packet_subtype)
{
struct hard_iface *primary_if;
struct unicast_4addr_packet *unicast_4addr_packet;
@@ -347,8 +347,9 @@ out:
return ret;
}
-int unicast_generic_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
- int packet_type, int packet_subtype)
+int batadv_unicast_generic_send_skb(struct sk_buff *skb,
+ struct bat_priv *bat_priv,
+ int packet_type, int packet_subtype)
{
struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
struct orig_node *orig_node;
@@ -383,8 +384,8 @@ find_router:
prepare_unicast_packet(skb, orig_node);
break;
case BAT_UNICAST_4ADDR:
- prepare_unicast_4addr_packet(bat_priv, skb, orig_node,
- packet_subtype);
+ batadv_prepare_unicast_4addr_packet(bat_priv, skb, orig_node,
+ packet_subtype);
break;
default:
/* this function supports UNICAST and UNICAST_4ADDR only. It
@@ -410,8 +411,9 @@ find_router:
neigh_node->if_incoming->net_dev->mtu) {
/* send frag skb decreases ttl */
unicast_packet->header.ttl++;
- ret = frag_send_skb(skb, bat_priv,
- neigh_node->if_incoming, neigh_node->addr);
+ ret = batadv_frag_send_skb(skb, bat_priv,
+ neigh_node->if_incoming,
+ neigh_node->addr);
goto out;
}
diff --git a/unicast.h b/unicast.h
index e15aa62..da402b1 100644
--- a/unicast.h
+++ b/unicast.h
@@ -27,30 +27,32 @@
#define FRAG_TIMEOUT 10000 /* purge frag list entries after time in ms */
#define FRAG_BUFFER_SIZE 6 /* number of list elements in buffer */
-int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
- struct sk_buff **new_skb);
-void frag_list_free(struct list_head *head);
-int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
- struct hard_iface *hard_iface, const uint8_t dstaddr[]);
-bool prepare_unicast_4addr_packet(struct bat_priv *bat_priv,
- struct sk_buff *skb,
- struct orig_node *orig_node,
- int packet_subtype);
-int unicast_generic_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
- int packet_type, int packet_subtype);
+int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
+ struct sk_buff **new_skb);
+void batadv_frag_list_free(struct list_head *head);
+int batadv_frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
+ struct hard_iface *hard_iface,
+ const uint8_t dstaddr[]);
+bool batadv_prepare_unicast_4addr_packet(struct bat_priv *bat_priv,
+ struct sk_buff *skb,
+ struct orig_node *orig_node,
+ int packet_subtype);
+int batadv_unicast_generic_send_skb(struct sk_buff *skb,
+ struct bat_priv *bat_priv,
+ int packet_type, int packet_subtype);
static inline int unicast_send_skb(struct sk_buff *skb,
struct bat_priv *bat_priv)
{
- return unicast_generic_send_skb(skb, bat_priv, BAT_UNICAST, 0);
+ return batadv_unicast_generic_send_skb(skb, bat_priv, BAT_UNICAST, 0);
}
static inline int unicast_4addr_send_skb(struct sk_buff *skb,
struct bat_priv *bat_priv,
int packet_subtype)
{
- return unicast_generic_send_skb(skb, bat_priv, BAT_UNICAST_4ADDR,
- packet_subtype);
+ return batadv_unicast_generic_send_skb(skb, bat_priv, BAT_UNICAST_4ADDR,
+ packet_subtype);
}
static inline int frag_can_reassemble(const struct sk_buff *skb, int mtu)
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-146-gcc6f72b
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit cc6f72b154339908e6fe97841aa8de74eb7eec45
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:39 2012 +0200
batman-adv: Prefix translation-table non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_debugfs.c b/bat_debugfs.c
index fe4599e..cab2425 100644
--- a/bat_debugfs.c
+++ b/bat_debugfs.c
@@ -242,7 +242,7 @@ static int gateways_open(struct inode *inode, struct file *file)
static int transtable_global_open(struct inode *inode, struct file *file)
{
struct net_device *net_dev = (struct net_device *)inode->i_private;
- return single_open(file, tt_global_seq_print_text, net_dev);
+ return single_open(file, batadv_tt_global_seq_print_text, net_dev);
}
#ifdef CONFIG_BATMAN_ADV_BLA
@@ -257,7 +257,7 @@ static int bla_claim_table_open(struct inode *inode, struct file *file)
static int transtable_local_open(struct inode *inode, struct file *file)
{
struct net_device *net_dev = (struct net_device *)inode->i_private;
- return single_open(file, tt_local_seq_print_text, net_dev);
+ return single_open(file, batadv_tt_local_seq_print_text, net_dev);
}
static int vis_data_open(struct inode *inode, struct file *file)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index d4e94ca..2518781 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -138,7 +138,10 @@ static uint8_t hop_penalty(uint8_t tq, const struct bat_priv *bat_priv)
static int bat_iv_ogm_aggr_packet(int buff_pos, int packet_len,
int tt_num_changes)
{
- int next_buff_pos = buff_pos + BATMAN_OGM_HLEN + tt_len(tt_num_changes);
+ int next_buff_pos = 0;
+
+ next_buff_pos += buff_pos + BATMAN_OGM_HLEN;
+ next_buff_pos += batadv_tt_len(tt_num_changes);
return (next_buff_pos <= packet_len) &&
(next_buff_pos <= MAX_AGGREGATION_BYTES);
@@ -188,8 +191,8 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet,
batman_ogm_packet->ttvn, hard_iface->net_dev->name,
hard_iface->net_dev->dev_addr);
- buff_pos += BATMAN_OGM_HLEN +
- tt_len(batman_ogm_packet->tt_num_changes);
+ buff_pos += BATMAN_OGM_HLEN;
+ buff_pos += batadv_tt_len(batman_ogm_packet->tt_num_changes);
packet_num++;
batman_ogm_packet = (struct batman_ogm_packet *)
(forw_packet->skb->data + buff_pos);
@@ -556,7 +559,7 @@ static void bat_iv_ogm_forward(struct orig_node *orig_node,
batman_ogm_packet->flags &= ~DIRECTLINK;
bat_iv_ogm_queue_add(bat_priv, (unsigned char *)batman_ogm_packet,
- BATMAN_OGM_HLEN + tt_len(tt_num_changes),
+ BATMAN_OGM_HLEN + batadv_tt_len(tt_num_changes),
if_incoming, 0, bat_iv_ogm_fwd_send_time());
}
@@ -724,10 +727,10 @@ update_tt:
if (((batman_ogm_packet->orig != ethhdr->h_source) &&
(batman_ogm_packet->header.ttl > 2)) ||
(batman_ogm_packet->flags & PRIMARIES_FIRST_HOP))
- tt_update_orig(bat_priv, orig_node, tt_buff,
- batman_ogm_packet->tt_num_changes,
- batman_ogm_packet->ttvn,
- ntohs(batman_ogm_packet->tt_crc));
+ batadv_tt_update_orig(bat_priv, orig_node, tt_buff,
+ batman_ogm_packet->tt_num_changes,
+ batman_ogm_packet->ttvn,
+ ntohs(batman_ogm_packet->tt_crc));
if (orig_node->gw_flags != batman_ogm_packet->gw_flags)
batadv_gw_node_update(bat_priv, orig_node,
@@ -1228,8 +1231,8 @@ static int bat_iv_ogm_receive(struct sk_buff *skb,
bat_iv_ogm_process(ethhdr, batman_ogm_packet,
tt_buff, if_incoming);
- buff_pos += BATMAN_OGM_HLEN +
- tt_len(batman_ogm_packet->tt_num_changes);
+ buff_pos += BATMAN_OGM_HLEN;
+ buff_pos += batadv_tt_len(batman_ogm_packet->tt_num_changes);
batman_ogm_packet = (struct batman_ogm_packet *)
(packet_buff + buff_pos);
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
index c4b28af..bd356a1 100644
--- a/bridge_loop_avoidance.c
+++ b/bridge_loop_avoidance.c
@@ -397,8 +397,8 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv,
/* this is a gateway now, remove any tt entries */
orig_node = orig_hash_find(bat_priv, orig);
if (orig_node) {
- tt_global_del_orig(bat_priv, orig_node,
- "became a backbone gateway");
+ batadv_tt_global_del_orig(bat_priv, orig_node,
+ "became a backbone gateway");
batadv_orig_node_free_ref(orig_node);
}
return entry;
diff --git a/distributed-arp-table.c b/distributed-arp-table.c
index 64b02f1..97e229d 100644
--- a/distributed-arp-table.c
+++ b/distributed-arp-table.c
@@ -557,7 +557,7 @@ bool batadv_dat_snoop_incoming_arp_reply(struct bat_priv *bat_priv,
/* if this REPLY is directed to a client of mine, let's deliver the
* packet to the interface
*/
- ret = !is_my_client(bat_priv, hw_dst);
+ ret = !batadv_is_my_client(bat_priv, hw_dst);
out:
/* if ret == false packet has to be delivered to the interface */
return ret;
diff --git a/gateway_client.c b/gateway_client.c
index 2bf330d..e396029 100644
--- a/gateway_client.c
+++ b/gateway_client.c
@@ -652,8 +652,8 @@ bool batadv_gw_out_of_range(struct bat_priv *bat_priv,
if (!ret)
goto out;
- orig_dst_node = transtable_search(bat_priv, ethhdr->h_source,
- ethhdr->h_dest);
+ orig_dst_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
+ ethhdr->h_dest);
if (!orig_dst_node)
goto out;
diff --git a/main.c b/main.c
index 4921c13..a405513 100644
--- a/main.c
+++ b/main.c
@@ -115,11 +115,11 @@ int mesh_init(struct net_device *soft_iface)
if (ret < 0)
goto err;
- ret = tt_init(bat_priv);
+ ret = batadv_tt_init(bat_priv);
if (ret < 0)
goto err;
- tt_local_add(soft_iface, soft_iface->dev_addr, NULL_IFINDEX);
+ batadv_tt_local_add(soft_iface, soft_iface->dev_addr, NULL_IFINDEX);
ret = vis_init(bat_priv);
if (ret < 0)
@@ -152,7 +152,7 @@ void mesh_free(struct net_device *soft_iface)
batadv_gw_node_purge(bat_priv);
batadv_originator_free(bat_priv);
- tt_free(bat_priv);
+ batadv_tt_free(bat_priv);
batadv_bla_free(bat_priv);
diff --git a/originator.c b/originator.c
index e6a2680..d560301 100644
--- a/originator.c
+++ b/originator.c
@@ -140,8 +140,8 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
spin_unlock_bh(&orig_node->neigh_list_lock);
frag_list_free(&orig_node->frag_list);
- tt_global_del_orig(orig_node->bat_priv, orig_node,
- "originator timed out");
+ batadv_tt_global_del_orig(orig_node->bat_priv, orig_node,
+ "originator timed out");
kfree(orig_node->tt_buff);
kfree(orig_node->bcast_own);
diff --git a/routing.c b/routing.c
index 4cf5d71..fbdce11 100644
--- a/routing.c
+++ b/routing.c
@@ -75,8 +75,8 @@ static void _update_route(struct bat_priv *bat_priv,
if ((curr_router) && (!neigh_node)) {
bat_dbg(DBG_ROUTES, bat_priv, "Deleting route towards: %pM\n",
orig_node->orig);
- tt_global_del_orig(bat_priv, orig_node,
- "Deleted route towards originator");
+ batadv_tt_global_del_orig(bat_priv, orig_node,
+ "Deleted route towards originator");
/* route added */
} else if ((!curr_router) && (neigh_node)) {
@@ -603,7 +603,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
/* If we cannot provide an answer the tt_request is
* forwarded */
- if (!send_tt_response(bat_priv, tt_query)) {
+ if (!batadv_send_tt_response(bat_priv, tt_query)) {
bat_dbg(DBG_TT, bat_priv,
"Routing TT_REQUEST to %pM [%c]\n",
tt_query->dst,
@@ -620,14 +620,14 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
if (skb_linearize(skb) < 0)
goto out;
- tt_size = tt_len(ntohs(tt_query->tt_data));
+ tt_size = batadv_tt_len(ntohs(tt_query->tt_data));
/* Ensure we have all the claimed data */
if (unlikely(skb_headlen(skb) <
sizeof(struct tt_query_packet) + tt_size))
goto out;
- handle_tt_response(bat_priv, tt_query);
+ batadv_handle_tt_response(bat_priv, tt_query);
} else {
bat_dbg(DBG_TT, bat_priv,
"Routing TT_RESPONSE to %pM [%c]\n",
@@ -686,8 +686,9 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
"Received ROAMING_ADV from %pM (client %pM)\n",
roam_adv_packet->src, roam_adv_packet->client);
- tt_global_add(bat_priv, orig_node, roam_adv_packet->client,
- atomic_read(&orig_node->last_ttvn) + 1, true, false);
+ batadv_tt_global_add(bat_priv, orig_node, roam_adv_packet->client,
+ atomic_read(&orig_node->last_ttvn) + 1, true,
+ false);
/* Roaming phase starts: I have new information but the ttvn has not
* been incremented yet. This flag will make me check all the incoming
@@ -931,13 +932,15 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
/* we don't have an updated route for this client, so we should
* not try to reroute the packet!!
*/
- if (tt_global_client_is_roaming(bat_priv, ethhdr->h_dest))
+ if (batadv_tt_global_client_is_roaming(bat_priv,
+ ethhdr->h_dest))
return 1;
- orig_node = transtable_search(bat_priv, NULL, ethhdr->h_dest);
+ orig_node = batadv_transtable_search(bat_priv, NULL,
+ ethhdr->h_dest);
if (!orig_node) {
- if (!is_my_client(bat_priv, ethhdr->h_dest))
+ if (!batadv_is_my_client(bat_priv, ethhdr->h_dest))
return 0;
primary_if = primary_if_get_selected(bat_priv);
if (!primary_if)
diff --git a/soft-interface.c b/soft-interface.c
index 462c705..947a0b1 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -110,9 +110,9 @@ static int interface_set_mac_addr(struct net_device *dev, void *p)
/* only modify transtable if it has been initialized before */
if (atomic_read(&bat_priv->mesh_state) == MESH_ACTIVE) {
- tt_local_remove(bat_priv, dev->dev_addr,
- "mac address changed", false);
- tt_local_add(dev, addr->sa_data, NULL_IFINDEX);
+ batadv_tt_local_remove(bat_priv, dev->dev_addr,
+ "mac address changed", false);
+ batadv_tt_local_add(dev, addr->sa_data, NULL_IFINDEX);
}
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
@@ -168,7 +168,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
goto dropped;
/* Register the client MAC in the transtable */
- tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif);
+ batadv_tt_local_add(soft_iface, ethhdr->h_source, skb->skb_iif);
/* don't accept stp packets. STP does not help in meshes.
* better use the bridge loop avoidance ...
@@ -316,7 +316,7 @@ void batadv_interface_rx(struct net_device *soft_iface,
soft_iface->last_rx = jiffies;
- if (is_ap_isolated(bat_priv, ethhdr->h_source, ethhdr->h_dest))
+ if (batadv_is_ap_isolated(bat_priv, ethhdr->h_source, ethhdr->h_dest))
goto dropped;
/* Let the bridge loop avoidance check the packet. If will
diff --git a/translation-table.c b/translation-table.c
index 11dfb6d..e27502e 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -173,7 +173,7 @@ static void tt_local_event(struct bat_priv *bat_priv, const uint8_t *addr,
atomic_set(&bat_priv->tt_ogm_append_cnt, 0);
}
-int tt_len(int changes_num)
+int batadv_tt_len(int changes_num)
{
return changes_num * sizeof(struct tt_change);
}
@@ -191,8 +191,8 @@ static int tt_local_init(struct bat_priv *bat_priv)
return 0;
}
-void tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
- int ifindex)
+void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
+ int ifindex)
{
struct bat_priv *bat_priv = netdev_priv(soft_iface);
struct tt_local_entry *tt_local_entry = NULL;
@@ -302,7 +302,7 @@ static void tt_prepare_packet_buff(struct bat_priv *bat_priv,
primary_if = primary_if_get_selected(bat_priv);
req_len = min_packet_len;
- req_len += tt_len(atomic_read(&bat_priv->tt_local_changes));
+ req_len += batadv_tt_len(atomic_read(&bat_priv->tt_local_changes));
/* if we have too many changes for one packet don't send any
* and wait for the tt table request which will be fragmented
@@ -332,7 +332,7 @@ static int tt_changes_fill_buff(struct bat_priv *bat_priv,
tt_buff = *packet_buff + min_packet_len;
if (new_len > 0)
- tot_changes = new_len / tt_len(1);
+ tot_changes = new_len / batadv_tt_len(1);
spin_lock_bh(&bat_priv->tt_changes_list_lock);
atomic_set(&bat_priv->tt_local_changes, 0);
@@ -340,7 +340,7 @@ static int tt_changes_fill_buff(struct bat_priv *bat_priv,
list_for_each_entry_safe(entry, safe, &bat_priv->tt_changes_list,
list) {
if (count < tot_changes) {
- memcpy(tt_buff + tt_len(count),
+ memcpy(tt_buff + batadv_tt_len(count),
&entry->change, sizeof(struct tt_change));
count++;
}
@@ -370,7 +370,7 @@ static int tt_changes_fill_buff(struct bat_priv *bat_priv,
return count;
}
-int tt_local_seq_print_text(struct seq_file *seq, void *offset)
+int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset)
{
struct net_device *net_dev = (struct net_device *)seq->private;
struct bat_priv *bat_priv = netdev_priv(net_dev);
@@ -445,8 +445,8 @@ static void tt_local_set_pending(struct bat_priv *bat_priv,
tt_local_entry->common.addr, message);
}
-void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
- const char *message, bool roaming)
+void batadv_tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
+ const char *message, bool roaming)
{
struct tt_local_entry *tt_local_entry = NULL;
@@ -611,9 +611,9 @@ static void tt_global_add_orig_entry(struct tt_global_entry *tt_global_entry,
}
/* caller must hold orig_node refcount */
-int tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
- const unsigned char *tt_addr, uint8_t ttvn, bool roaming,
- bool wifi)
+int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
+ const unsigned char *tt_addr, uint8_t ttvn,
+ bool roaming, bool wifi)
{
struct tt_global_entry *tt_global_entry = NULL;
int ret = 0;
@@ -677,8 +677,8 @@ int tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
out_remove:
/* remove address from local hash if present */
- tt_local_remove(bat_priv, tt_global_entry->common.addr,
- "global tt received", roaming);
+ batadv_tt_local_remove(bat_priv, tt_global_entry->common.addr,
+ "global tt received", roaming);
ret = 1;
out:
if (tt_global_entry)
@@ -714,7 +714,7 @@ static void tt_global_print_entry(struct tt_global_entry *tt_global_entry,
}
}
-int tt_global_seq_print_text(struct seq_file *seq, void *offset)
+int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset)
{
struct net_device *net_dev = (struct net_device *)seq->private;
struct bat_priv *bat_priv = netdev_priv(net_dev);
@@ -919,8 +919,8 @@ out:
tt_local_entry_free_ref(tt_local_entry);
}
-void tt_global_del_orig(struct bat_priv *bat_priv,
- struct orig_node *orig_node, const char *message)
+void batadv_tt_global_del_orig(struct bat_priv *bat_priv,
+ struct orig_node *orig_node, const char *message)
{
struct tt_global_entry *tt_global_entry;
struct tt_common_entry *tt_common_entry;
@@ -1048,8 +1048,9 @@ static bool _is_ap_isolated(struct tt_local_entry *tt_local_entry,
return ret;
}
-struct orig_node *transtable_search(struct bat_priv *bat_priv,
- const uint8_t *src, const uint8_t *addr)
+struct orig_node *batadv_transtable_search(struct bat_priv *bat_priv,
+ const uint8_t *src,
+ const uint8_t *addr)
{
struct tt_local_entry *tt_local_entry = NULL;
struct tt_global_entry *tt_global_entry = NULL;
@@ -1153,7 +1154,7 @@ static uint16_t tt_global_crc(struct bat_priv *bat_priv,
}
/* Calculates the checksum of the local table */
-uint16_t tt_local_crc(struct bat_priv *bat_priv)
+uint16_t batadv_tt_local_crc(struct bat_priv *bat_priv)
{
uint16_t total = 0, total_one;
struct hashtable_t *hash = bat_priv->tt_local_hash;
@@ -1204,7 +1205,7 @@ static void tt_save_orig_buffer(struct bat_priv *bat_priv,
const unsigned char *tt_buff,
uint8_t tt_num_changes)
{
- uint16_t tt_buff_len = 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
* last OGM (the OGM could carry no changes) */
@@ -1669,8 +1670,8 @@ out:
return true;
}
-bool send_tt_response(struct bat_priv *bat_priv,
- struct tt_query_packet *tt_request)
+bool batadv_send_tt_response(struct bat_priv *bat_priv,
+ struct tt_query_packet *tt_request)
{
if (is_my_mac(tt_request->dst)) {
/* don't answer backbone gws! */
@@ -1689,18 +1690,19 @@ static void _tt_update_changes(struct bat_priv *bat_priv,
uint16_t tt_num_changes, uint8_t ttvn)
{
int i;
+ int is_wifi;
for (i = 0; i < tt_num_changes; i++) {
- if ((tt_change + i)->flags & TT_CLIENT_DEL)
+ if ((tt_change + i)->flags & TT_CLIENT_DEL) {
tt_global_del(bat_priv, orig_node,
(tt_change + i)->addr,
"tt removed by changes",
(tt_change + i)->flags & TT_CLIENT_ROAM);
- else
- if (!tt_global_add(bat_priv, orig_node,
- (tt_change + i)->addr, ttvn, false,
- (tt_change + i)->flags &
- TT_CLIENT_WIFI))
+ } else {
+ is_wifi = (tt_change + i)->flags & TT_CLIENT_WIFI;
+ if (!batadv_tt_global_add(bat_priv, orig_node,
+ (tt_change + i)->addr, ttvn,
+ false, is_wifi))
/* In case of problem while storing a
* global_entry, we stop the updating
* procedure without committing the
@@ -1708,6 +1710,7 @@ static void _tt_update_changes(struct bat_priv *bat_priv,
* corrupted data on tt_request
*/
return;
+ }
}
orig_node->tt_initialised = true;
}
@@ -1722,7 +1725,7 @@ static void tt_fill_gtable(struct bat_priv *bat_priv,
goto out;
/* Purge the old table first.. */
- tt_global_del_orig(bat_priv, orig_node, "Received full table");
+ batadv_tt_global_del_orig(bat_priv, orig_node, "Received full table");
_tt_update_changes(bat_priv, orig_node,
(struct tt_change *)(tt_response + 1),
@@ -1754,7 +1757,7 @@ static void tt_update_changes(struct bat_priv *bat_priv,
atomic_set(&orig_node->last_ttvn, ttvn);
}
-bool is_my_client(struct bat_priv *bat_priv, const uint8_t *addr)
+bool batadv_is_my_client(struct bat_priv *bat_priv, const uint8_t *addr)
{
struct tt_local_entry *tt_local_entry = NULL;
bool ret = false;
@@ -1773,8 +1776,8 @@ out:
return ret;
}
-void handle_tt_response(struct bat_priv *bat_priv,
- struct tt_query_packet *tt_response)
+void batadv_handle_tt_response(struct bat_priv *bat_priv,
+ struct tt_query_packet *tt_response)
{
struct tt_req_node *node, *safe;
struct orig_node *orig_node = NULL;
@@ -1821,7 +1824,7 @@ out:
batadv_orig_node_free_ref(orig_node);
}
-int tt_init(struct bat_priv *bat_priv)
+int batadv_tt_init(struct bat_priv *bat_priv)
{
int ret;
@@ -1983,7 +1986,7 @@ static void tt_purge(struct work_struct *work)
tt_start_timer(bat_priv);
}
-void tt_free(struct bat_priv *bat_priv)
+void batadv_tt_free(struct bat_priv *bat_priv)
{
cancel_delayed_work_sync(&bat_priv->tt_work);
@@ -2088,7 +2091,7 @@ static int tt_commit_changes(struct bat_priv *bat_priv,
/* all reset entries have to be counted as local entries */
atomic_add(changed_num, &bat_priv->num_local_tt);
tt_local_purge_pending_clients(bat_priv);
- bat_priv->tt_crc = tt_local_crc(bat_priv);
+ bat_priv->tt_crc = batadv_tt_local_crc(bat_priv);
/* Increment the TTVN only once per OGM interval */
atomic_inc(&bat_priv->ttvn);
@@ -2125,7 +2128,8 @@ int batadv_tt_append_diff(struct bat_priv *bat_priv,
return tt_num_changes;
}
-bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst)
+bool batadv_is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src,
+ uint8_t *dst)
{
struct tt_local_entry *tt_local_entry = NULL;
struct tt_global_entry *tt_global_entry = NULL;
@@ -2155,9 +2159,10 @@ out:
return ret;
}
-void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
- const unsigned char *tt_buff, uint8_t tt_num_changes,
- uint8_t ttvn, uint16_t tt_crc)
+void batadv_tt_update_orig(struct bat_priv *bat_priv,
+ struct orig_node *orig_node,
+ const unsigned char *tt_buff, uint8_t tt_num_changes,
+ uint8_t ttvn, uint16_t tt_crc)
{
uint8_t orig_ttvn = (uint8_t)atomic_read(&orig_node->last_ttvn);
bool full_table = true;
@@ -2222,7 +2227,8 @@ request_table:
* originator to another one. This entry is kept is still kept for consistency
* purposes
*/
-bool tt_global_client_is_roaming(struct bat_priv *bat_priv, uint8_t *addr)
+bool batadv_tt_global_client_is_roaming(struct bat_priv *bat_priv,
+ uint8_t *addr)
{
struct tt_global_entry *tt_global_entry;
bool ret = false;
diff --git a/translation-table.h b/translation-table.h
index d6af2ba..aea1ce8 100644
--- a/translation-table.h
+++ b/translation-table.h
@@ -22,38 +22,45 @@
#ifndef _NET_BATMAN_ADV_TRANSLATION_TABLE_H_
#define _NET_BATMAN_ADV_TRANSLATION_TABLE_H_
-int tt_len(int changes_num);
-int tt_init(struct bat_priv *bat_priv);
-void tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
- int ifindex);
-void tt_local_remove(struct bat_priv *bat_priv,
- const uint8_t *addr, const char *message, bool roaming);
-int tt_local_seq_print_text(struct seq_file *seq, void *offset);
-void tt_global_add_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
- const unsigned char *tt_buff, int tt_buff_len);
-int tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
- const unsigned char *addr, uint8_t ttvn, bool roaming,
- bool wifi);
-int tt_global_seq_print_text(struct seq_file *seq, void *offset);
-void tt_global_del_orig(struct bat_priv *bat_priv,
- struct orig_node *orig_node, const char *message);
-struct orig_node *transtable_search(struct bat_priv *bat_priv,
- const uint8_t *src, const uint8_t *addr);
-uint16_t tt_local_crc(struct bat_priv *bat_priv);
-void tt_free(struct bat_priv *bat_priv);
-bool send_tt_response(struct bat_priv *bat_priv,
- struct tt_query_packet *tt_request);
-bool is_my_client(struct bat_priv *bat_priv, const uint8_t *addr);
-void handle_tt_response(struct bat_priv *bat_priv,
- struct tt_query_packet *tt_response);
-bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst);
-void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
- const unsigned char *tt_buff, uint8_t tt_num_changes,
- uint8_t ttvn, uint16_t tt_crc);
+int batadv_tt_len(int changes_num);
+int batadv_tt_init(struct bat_priv *bat_priv);
+void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
+ int ifindex);
+void batadv_tt_local_remove(struct bat_priv *bat_priv,
+ const uint8_t *addr, const char *message,
+ bool roaming);
+int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset);
+void batadv_tt_global_add_orig(struct bat_priv *bat_priv,
+ struct orig_node *orig_node,
+ const unsigned char *tt_buff, int tt_buff_len);
+int batadv_tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node,
+ const unsigned char *addr, uint8_t ttvn, bool roaming,
+ bool wifi);
+int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset);
+void batadv_tt_global_del_orig(struct bat_priv *bat_priv,
+ struct orig_node *orig_node,
+ const char *message);
+struct orig_node *batadv_transtable_search(struct bat_priv *bat_priv,
+ const uint8_t *src,
+ const uint8_t *addr);
+uint16_t batadv_tt_local_crc(struct bat_priv *bat_priv);
+void batadv_tt_free(struct bat_priv *bat_priv);
+bool batadv_send_tt_response(struct bat_priv *bat_priv,
+ struct tt_query_packet *tt_request);
+bool batadv_is_my_client(struct bat_priv *bat_priv, const uint8_t *addr);
+void batadv_handle_tt_response(struct bat_priv *bat_priv,
+ struct tt_query_packet *tt_response);
+bool batadv_is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src,
+ uint8_t *dst);
+void batadv_tt_update_orig(struct bat_priv *bat_priv,
+ struct orig_node *orig_node,
+ const unsigned char *tt_buff, uint8_t tt_num_changes,
+ uint8_t ttvn, uint16_t tt_crc);
int batadv_tt_append_diff(struct bat_priv *bat_priv,
unsigned char **packet_buff, int *packet_buff_len,
int packet_min_len);
-bool tt_global_client_is_roaming(struct bat_priv *bat_priv, uint8_t *addr);
+bool batadv_tt_global_client_is_roaming(struct bat_priv *bat_priv,
+ uint8_t *addr);
#endif /* _NET_BATMAN_ADV_TRANSLATION_TABLE_H_ */
diff --git a/unicast.c b/unicast.c
index c3fad05..4ac6cac 100644
--- a/unicast.c
+++ b/unicast.c
@@ -366,8 +366,8 @@ int unicast_generic_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
/* check for tt host - increases orig_node refcount.
* returns NULL in case of AP isolation */
- orig_node = transtable_search(bat_priv, ethhdr->h_source,
- ethhdr->h_dest);
+ orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
+ ethhdr->h_dest);
find_router:
/**
* find_router():
@@ -400,7 +400,7 @@ find_router:
* try to reroute it because the ttvn contained in the header is less
* than the current one
*/
- if (tt_global_client_is_roaming(bat_priv, ethhdr->h_dest))
+ if (batadv_tt_global_client_is_roaming(bat_priv, ethhdr->h_dest))
unicast_packet->ttvn = unicast_packet->ttvn - 1;
/* fragmentation mechanism only works for UNICAST (now) */
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-145-g8ed9d7a
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 8ed9d7a13fb4c57d911767bad6cc2addfd88a308
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:38 2012 +0200
batman-adv: Prefix soft-interface non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/hard-interface.c b/hard-interface.c
index ce75b12..3845d32 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -72,7 +72,7 @@ static int is_valid_iface(const struct net_device *net_dev)
return 0;
/* no batman over batman */
- if (softif_is_valid(net_dev))
+ if (batadv_softif_is_valid(net_dev))
return 0;
/* Device is being bridged */
@@ -287,7 +287,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
soft_iface = dev_get_by_name(&init_net, iface_name);
if (!soft_iface) {
- soft_iface = softif_create(iface_name);
+ soft_iface = batadv_softif_create(iface_name);
if (!soft_iface) {
ret = -ENOMEM;
@@ -298,7 +298,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
dev_hold(soft_iface);
}
- if (!softif_is_valid(soft_iface)) {
+ if (!batadv_softif_is_valid(soft_iface)) {
pr_err("Can't create batman mesh interface %s: already exists as regular interface\n",
soft_iface->name);
ret = -EINVAL;
@@ -399,7 +399,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
/* nobody uses this interface anymore */
if (!bat_priv->num_ifaces)
- softif_destroy(hard_iface->soft_iface);
+ batadv_softif_destroy(hard_iface->soft_iface);
hard_iface->soft_iface = NULL;
hardif_free_ref(hard_iface);
diff --git a/routing.c b/routing.c
index 89824ba..4cf5d71 100644
--- a/routing.c
+++ b/routing.c
@@ -983,7 +983,8 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
/* packet for me */
if (is_my_mac(unicast_packet->dest)) {
- interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size);
+ batadv_interface_rx(recv_if->soft_iface, skb, recv_if,
+ hdr_size);
return NET_RX_SUCCESS;
}
@@ -1019,8 +1020,8 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
if (!new_skb)
return NET_RX_SUCCESS;
- interface_rx(recv_if->soft_iface, new_skb, recv_if,
- sizeof(struct unicast_packet));
+ batadv_interface_rx(recv_if->soft_iface, new_skb, recv_if,
+ sizeof(struct unicast_packet));
return NET_RX_SUCCESS;
}
@@ -1105,7 +1106,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
goto out;
/* broadcast for me */
- interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size);
+ batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size);
ret = NET_RX_SUCCESS;
goto out;
diff --git a/send.c b/send.c
index 57c8adb..a8af6e3 100644
--- a/send.c
+++ b/send.c
@@ -52,7 +52,7 @@ int batadv_send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
}
/* push to the ethernet header. */
- if (my_skb_head_push(skb, ETH_HLEN) < 0)
+ if (batadv_skb_head_push(skb, ETH_HLEN) < 0)
goto send_skb_err;
skb_reset_mac_header(skb);
diff --git a/soft-interface.c b/soft-interface.c
index ed9bdab..462c705 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -62,7 +62,7 @@ static const struct ethtool_ops bat_ethtool_ops = {
.get_sset_count = bat_get_sset_count,
};
-int my_skb_head_push(struct sk_buff *skb, unsigned int len)
+int batadv_skb_head_push(struct sk_buff *skb, unsigned int len)
{
int result;
@@ -209,7 +209,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
if (batadv_dat_snoop_outgoing_arp_request(bat_priv, skb))
brd_delay = msecs_to_jiffies(ARP_REQ_DELAY);
- if (my_skb_head_push(skb, sizeof(*bcast_packet)) < 0)
+ if (batadv_skb_head_push(skb, sizeof(*bcast_packet)) < 0)
goto dropped;
bcast_packet = (struct bcast_packet *)skb->data;
@@ -263,9 +263,9 @@ end:
return NETDEV_TX_OK;
}
-void interface_rx(struct net_device *soft_iface,
- struct sk_buff *skb, struct hard_iface *recv_if,
- int hdr_size)
+void batadv_interface_rx(struct net_device *soft_iface,
+ struct sk_buff *skb, struct hard_iface *recv_if,
+ int hdr_size)
{
struct bat_priv *bat_priv = netdev_priv(soft_iface);
struct ethhdr *ethhdr;
@@ -370,7 +370,7 @@ static void interface_setup(struct net_device *dev)
memset(priv, 0, sizeof(*priv));
}
-struct net_device *softif_create(const char *name)
+struct net_device *batadv_softif_create(const char *name)
{
struct net_device *soft_iface;
struct bat_priv *bat_priv;
@@ -460,7 +460,7 @@ out:
return NULL;
}
-void softif_destroy(struct net_device *soft_iface)
+void batadv_softif_destroy(struct net_device *soft_iface)
{
batadv_debugfs_del_meshif(soft_iface);
batadv_sysfs_del_meshif(soft_iface);
@@ -468,7 +468,7 @@ void softif_destroy(struct net_device *soft_iface)
unregister_netdevice(soft_iface);
}
-int softif_is_valid(const struct net_device *net_dev)
+int batadv_softif_is_valid(const struct net_device *net_dev)
{
if (net_dev->netdev_ops->ndo_start_xmit == interface_tx)
return 1;
diff --git a/soft-interface.h b/soft-interface.h
index 0203006..7e2bfaf 100644
--- a/soft-interface.h
+++ b/soft-interface.h
@@ -22,12 +22,11 @@
#ifndef _NET_BATMAN_ADV_SOFT_INTERFACE_H_
#define _NET_BATMAN_ADV_SOFT_INTERFACE_H_
-int my_skb_head_push(struct sk_buff *skb, unsigned int len);
-void interface_rx(struct net_device *soft_iface,
- struct sk_buff *skb, struct hard_iface *recv_if,
- int hdr_size);
-struct net_device *softif_create(const char *name);
-void softif_destroy(struct net_device *soft_iface);
-int softif_is_valid(const struct net_device *net_dev);
+int batadv_skb_head_push(struct sk_buff *skb, unsigned int len);
+void batadv_interface_rx(struct net_device *soft_iface, struct sk_buff *skb,
+ struct hard_iface *recv_if, int hdr_size);
+struct net_device *batadv_softif_create(const char *name);
+void batadv_softif_destroy(struct net_device *soft_iface);
+int batadv_softif_is_valid(const struct net_device *net_dev);
#endif /* _NET_BATMAN_ADV_SOFT_INTERFACE_H_ */
diff --git a/unicast.c b/unicast.c
index cae142c..c3fad05 100644
--- a/unicast.c
+++ b/unicast.c
@@ -242,8 +242,8 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
memcpy(&tmp_uc, unicast_packet, uc_hdr_len);
skb_split(skb, frag_skb, data_len / 2 + uc_hdr_len);
- if (my_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 ||
- my_skb_head_push(frag_skb, ucf_hdr_len) < 0)
+ if (batadv_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 ||
+ batadv_skb_head_push(frag_skb, ucf_hdr_len) < 0)
goto drop_frag;
frag1 = (struct unicast_frag_packet *)skb->data;
@@ -288,7 +288,7 @@ static bool pull_and_fill_unicast(struct sk_buff *skb, int hdr_size,
{
struct unicast_packet *unicast_packet;
- if (my_skb_head_push(skb, hdr_size) < 0)
+ if (batadv_skb_head_push(skb, hdr_size) < 0)
return false;
unicast_packet = (struct unicast_packet *)skb->data;
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-144-g8bad6dc
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 8bad6dc4bd15cdd29fb76d94f24e5f44dd72cdcf
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:37 2012 +0200
batman-adv: Prefix send non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index b045bf7..d4e94ca 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -201,7 +201,7 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet,
inc_counter(bat_priv, BAT_CNT_MGMT_TX);
add_counter(bat_priv, BAT_CNT_MGMT_TX_BYTES,
skb->len + ETH_HLEN);
- send_skb_packet(skb, hard_iface, broadcast_addr);
+ batadv_send_skb_packet(skb, hard_iface, broadcast_addr);
}
}
@@ -250,8 +250,9 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
forw_packet->if_incoming->net_dev->dev_addr);
/* skb is only used once and than forw_packet is free'd */
- send_skb_packet(forw_packet->skb, forw_packet->if_incoming,
- broadcast_addr);
+ batadv_send_skb_packet(forw_packet->skb,
+ forw_packet->if_incoming,
+ broadcast_addr);
forw_packet->skb = NULL;
goto out;
@@ -420,7 +421,7 @@ static void bat_iv_ogm_aggregate_new(const unsigned char *packet_buff,
/* start timer for this packet */
INIT_DELAYED_WORK(&forw_packet_aggr->delayed_work,
- send_outstanding_bat_ogm_packet);
+ batadv_send_outstanding_bat_ogm_packet);
queue_delayed_work(bat_event_workqueue,
&forw_packet_aggr->delayed_work,
send_time - jiffies);
diff --git a/distributed-arp-table.c b/distributed-arp-table.c
index 3069a01..64b02f1 100644
--- a/distributed-arp-table.c
+++ b/distributed-arp-table.c
@@ -240,6 +240,7 @@ static bool dht_send_data(struct bat_priv *bat_priv, struct sk_buff *skb,
{
int i;
bool ret = false;
+ int send_status;
struct neigh_node *neigh_node = NULL;
struct sk_buff *tmp_skb;
struct dht_candidate *cand = dht_select_candidates(bat_priv, ip);
@@ -264,8 +265,11 @@ static bool dht_send_data(struct bat_priv *bat_priv, struct sk_buff *skb,
kfree_skb(tmp_skb);
goto free_neigh;
}
- if (send_skb_packet(tmp_skb, neigh_node->if_incoming,
- neigh_node->addr) == NET_XMIT_SUCCESS)
+
+ send_status = batadv_send_skb_packet(tmp_skb,
+ neigh_node->if_incoming,
+ neigh_node->addr);
+ if (send_status == NET_XMIT_SUCCESS)
/* packet sent to a candidate: we can return true */
ret = true;
free_neigh:
diff --git a/hard-interface.c b/hard-interface.c
index 7e70cc3..ce75b12 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -348,7 +348,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
hard_iface->net_dev->name);
/* begin scheduling originator messages on that interface */
- schedule_bat_ogm(hard_iface);
+ batadv_schedule_bat_ogm(hard_iface);
out:
return 0;
@@ -394,7 +394,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
/* delete all references to this hard_iface */
batadv_purge_orig_ref(bat_priv);
- purge_outstanding_packets(bat_priv, hard_iface);
+ batadv_purge_outstanding_packets(bat_priv, hard_iface);
dev_put(hard_iface->soft_iface);
/* nobody uses this interface anymore */
diff --git a/icmp_socket.c b/icmp_socket.c
index 60e7f87..c7ef760 100644
--- a/icmp_socket.c
+++ b/icmp_socket.c
@@ -236,7 +236,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
memcpy(icmp_packet->rr,
neigh_node->if_incoming->net_dev->dev_addr, ETH_ALEN);
- send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+ batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
goto out;
dst_unreach:
diff --git a/main.c b/main.c
index c3eb3d5..4921c13 100644
--- a/main.c
+++ b/main.c
@@ -145,7 +145,7 @@ void mesh_free(struct net_device *soft_iface)
atomic_set(&bat_priv->mesh_state, MESH_DEACTIVATING);
- purge_outstanding_packets(bat_priv, NULL);
+ batadv_purge_outstanding_packets(bat_priv, NULL);
vis_quit(bat_priv);
diff --git a/routing.c b/routing.c
index 0654c0e..89824ba 100644
--- a/routing.c
+++ b/routing.c
@@ -319,7 +319,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
icmp_packet->msg_type = ECHO_REPLY;
icmp_packet->header.ttl = TTL;
- send_skb_packet(skb, router->if_incoming, router->addr);
+ batadv_send_skb_packet(skb, router->if_incoming, router->addr);
ret = NET_RX_SUCCESS;
out:
@@ -374,7 +374,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
icmp_packet->msg_type = TTL_EXCEEDED;
icmp_packet->header.ttl = TTL;
- send_skb_packet(skb, router->if_incoming, router->addr);
+ batadv_send_skb_packet(skb, router->if_incoming, router->addr);
ret = NET_RX_SUCCESS;
out:
@@ -459,7 +459,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
icmp_packet->header.ttl--;
/* route it */
- send_skb_packet(skb, router->if_incoming, router->addr);
+ batadv_send_skb_packet(skb, router->if_incoming, router->addr);
ret = NET_RX_SUCCESS;
out:
@@ -878,7 +878,7 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
add_counter(bat_priv, BAT_CNT_FORWARD_BYTES, skb->len + ETH_HLEN);
/* route it */
- send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+ batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = NET_RX_SUCCESS;
out:
@@ -1096,7 +1096,7 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
goto out;
/* rebroadcast packet */
- add_bcast_packet_to_list(bat_priv, skb, 1);
+ batadv_add_bcast_packet_to_list(bat_priv, skb, 1);
/* don't hand the broadcast up if it is from an originator
* from the same backbone.
diff --git a/send.c b/send.c
index 43f6f39..57c8adb 100644
--- a/send.c
+++ b/send.c
@@ -34,8 +34,8 @@ static void send_outstanding_bcast_packet(struct work_struct *work);
/* send out an already prepared packet to the given address via the
* specified batman interface */
-int send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
- const uint8_t *dst_addr)
+int batadv_send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
+ const uint8_t *dst_addr)
{
struct ethhdr *ethhdr;
@@ -78,7 +78,7 @@ send_skb_err:
return NET_XMIT_DROP;
}
-void schedule_bat_ogm(struct hard_iface *hard_iface)
+void batadv_schedule_bat_ogm(struct hard_iface *hard_iface)
{
struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
@@ -134,8 +134,9 @@ static void _add_bcast_packet_to_list(struct bat_priv *bat_priv,
*
* The skb is not consumed, so the caller should make sure that the
* skb is freed. */
-int add_bcast_packet_to_list(struct bat_priv *bat_priv,
- const struct sk_buff *skb, unsigned long delay)
+int batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv,
+ const struct sk_buff *skb,
+ unsigned long delay)
{
struct hard_iface *primary_if = NULL;
struct forw_packet *forw_packet;
@@ -215,7 +216,8 @@ static void send_outstanding_bcast_packet(struct work_struct *work)
/* send a copy of the saved skb */
skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC);
if (skb1)
- send_skb_packet(skb1, hard_iface, broadcast_addr);
+ batadv_send_skb_packet(skb1, hard_iface,
+ broadcast_addr);
}
rcu_read_unlock();
@@ -233,7 +235,7 @@ out:
atomic_inc(&bat_priv->bcast_queue_left);
}
-void send_outstanding_bat_ogm_packet(struct work_struct *work)
+void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work)
{
struct delayed_work *delayed_work =
container_of(work, struct delayed_work, work);
@@ -257,7 +259,7 @@ void send_outstanding_bat_ogm_packet(struct work_struct *work)
* shutting down
*/
if (forw_packet->own)
- schedule_bat_ogm(forw_packet->if_incoming);
+ batadv_schedule_bat_ogm(forw_packet->if_incoming);
out:
/* don't count own packet */
@@ -267,8 +269,8 @@ out:
forw_packet_free(forw_packet);
}
-void purge_outstanding_packets(struct bat_priv *bat_priv,
- const struct hard_iface *hard_iface)
+void batadv_purge_outstanding_packets(struct bat_priv *bat_priv,
+ const struct hard_iface *hard_iface)
{
struct forw_packet *forw_packet;
struct hlist_node *tmp_node, *safe_tmp_node;
diff --git a/send.h b/send.h
index 824ef06..452e8df 100644
--- a/send.h
+++ b/send.h
@@ -22,13 +22,14 @@
#ifndef _NET_BATMAN_ADV_SEND_H_
#define _NET_BATMAN_ADV_SEND_H_
-int send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
- const uint8_t *dst_addr);
-void schedule_bat_ogm(struct hard_iface *hard_iface);
-int add_bcast_packet_to_list(struct bat_priv *bat_priv,
- const struct sk_buff *skb, unsigned long delay);
-void send_outstanding_bat_ogm_packet(struct work_struct *work);
-void purge_outstanding_packets(struct bat_priv *bat_priv,
- const struct hard_iface *hard_iface);
+int batadv_send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
+ const uint8_t *dst_addr);
+void batadv_schedule_bat_ogm(struct hard_iface *hard_iface);
+int batadv_add_bcast_packet_to_list(struct bat_priv *bat_priv,
+ const struct sk_buff *skb,
+ unsigned long delay);
+void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work);
+void batadv_purge_outstanding_packets(struct bat_priv *bat_priv,
+ const struct hard_iface *hard_iface);
#endif /* _NET_BATMAN_ADV_SEND_H_ */
diff --git a/soft-interface.c b/soft-interface.c
index eb9e759..ed9bdab 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -228,7 +228,7 @@ static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
bcast_packet->seqno =
htonl(atomic_inc_return(&bat_priv->bcast_seqno));
- add_bcast_packet_to_list(bat_priv, skb, brd_delay);
+ batadv_add_bcast_packet_to_list(bat_priv, skb, brd_delay);
/* a copy is stored in the bcast list, therefore removing
* the original skb. */
diff --git a/translation-table.c b/translation-table.c
index 46a8942..11dfb6d 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -1406,7 +1406,7 @@ static int send_tt_request(struct bat_priv *bat_priv,
inc_counter(bat_priv, BAT_CNT_TT_REQUEST_TX);
- send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+ batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = 0;
out:
@@ -1532,7 +1532,7 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_TX);
- send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+ batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = true;
goto out;
@@ -1650,7 +1650,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
inc_counter(bat_priv, BAT_CNT_TT_RESPONSE_TX);
- send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+ batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = true;
goto out;
@@ -1957,7 +1957,7 @@ static void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
inc_counter(bat_priv, BAT_CNT_TT_ROAM_ADV_TX);
- send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+ batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = 0;
out:
diff --git a/unicast.c b/unicast.c
index aafe73f..cae142c 100644
--- a/unicast.c
+++ b/unicast.c
@@ -268,8 +268,8 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
frag1->seqno = htons(seqno - 1);
frag2->seqno = htons(seqno);
- send_skb_packet(skb, hard_iface, dstaddr);
- send_skb_packet(frag_skb, hard_iface, dstaddr);
+ batadv_send_skb_packet(skb, hard_iface, dstaddr);
+ batadv_send_skb_packet(frag_skb, hard_iface, dstaddr);
ret = NET_RX_SUCCESS;
goto out;
@@ -415,7 +415,7 @@ find_router:
goto out;
}
- send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
+ batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
ret = 0;
out:
diff --git a/vis.c b/vis.c
index 1972a11..c56737c 100644
--- a/vis.c
+++ b/vis.c
@@ -777,7 +777,8 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
skb = skb_clone(info->skb_packet, GFP_ATOMIC);
if (skb)
- send_skb_packet(skb, hard_iface, dstaddr);
+ batadv_send_skb_packet(skb, hard_iface,
+ dstaddr);
}
rcu_read_unlock();
@@ -804,7 +805,7 @@ static void unicast_vis_packet(struct bat_priv *bat_priv,
skb = skb_clone(info->skb_packet, GFP_ATOMIC);
if (skb)
- send_skb_packet(skb, router->if_incoming, router->addr);
+ batadv_send_skb_packet(skb, router->if_incoming, router->addr);
out:
if (router)
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-143-gfa358e5
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit fa358e5508bf5523086de6f5442e67210d7b31d1
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:36 2012 +0200
batman-adv: Prefix routing non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 9afbe17..b045bf7 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -599,7 +599,7 @@ static void bat_iv_ogm_schedule(struct hard_iface *hard_iface)
else
batman_ogm_packet->gw_flags = NO_FLAGS;
- slide_own_bcast_window(hard_iface);
+ batadv_slide_own_bcast_window(hard_iface);
bat_iv_ogm_queue_add(bat_priv, hard_iface->packet_buff,
hard_iface->packet_len, hard_iface, 1,
bat_iv_ogm_emit_send_time(bat_priv));
@@ -684,7 +684,7 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
neigh_node->last_ttl = batman_ogm_packet->header.ttl;
}
- 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
* to change */
@@ -715,7 +715,7 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
goto update_tt;
}
- update_route(bat_priv, orig_node, neigh_node);
+ batadv_update_route(bat_priv, orig_node, neigh_node);
update_tt:
/* I have to check for transtable changes only if the OGM has been
@@ -884,8 +884,8 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
/* signalize caller that the packet is to be dropped. */
if (!hlist_empty(&orig_node->neigh_list) &&
- window_protected(bat_priv, seq_diff,
- &orig_node->batman_seqno_reset))
+ batadv_window_protected(bat_priv, seq_diff,
+ &orig_node->batman_seqno_reset))
goto out;
rcu_read_lock();
@@ -1133,7 +1133,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
is_bidirectional = bat_iv_ogm_calc_tq(orig_node, orig_neigh_node,
batman_ogm_packet, if_incoming);
- bonding_save_primary(orig_node, orig_neigh_node, batman_ogm_packet);
+ batadv_bonding_save_primary(orig_node, orig_neigh_node,
+ batman_ogm_packet);
/* update ranking if it is not a duplicate or has the same
* seqno and similar ttl as the non-duplicate */
@@ -1201,7 +1202,7 @@ static int bat_iv_ogm_receive(struct sk_buff *skb,
unsigned char *tt_buff, *packet_buff;
bool ret;
- ret = check_management_packet(skb, if_incoming, BATMAN_OGM_HLEN);
+ ret = batadv_check_management_packet(skb, if_incoming, BATMAN_OGM_HLEN);
if (!ret)
return NET_RX_DROP;
diff --git a/gateway_client.c b/gateway_client.c
index e92055d..2bf330d 100644
--- a/gateway_client.c
+++ b/gateway_client.c
@@ -682,7 +682,8 @@ bool batadv_gw_out_of_range(struct bat_priv *bat_priv,
/* If the dhcp packet has been sent to a different gw,
* we have to evaluate whether the old gw is still
* reliable enough */
- neigh_curr = find_router(bat_priv, curr_gw->orig_node, NULL);
+ neigh_curr = batadv_find_router(bat_priv, curr_gw->orig_node,
+ NULL);
if (!neigh_curr)
goto out;
@@ -693,7 +694,7 @@ bool batadv_gw_out_of_range(struct bat_priv *bat_priv,
goto out;
}
- neigh_old = find_router(bat_priv, orig_dst_node, NULL);
+ neigh_old = batadv_find_router(bat_priv, orig_dst_node, NULL);
if (!neigh_old)
goto out;
diff --git a/main.c b/main.c
index 4524502..c3eb3d5 100644
--- a/main.c
+++ b/main.c
@@ -272,21 +272,21 @@ static void recv_handler_init(void)
recv_packet_handler[i] = recv_unhandled_packet;
/* batman icmp packet */
- recv_packet_handler[BAT_ICMP] = recv_icmp_packet;
+ recv_packet_handler[BAT_ICMP] = batadv_recv_icmp_packet;
/* unicast with 4 addresses packet */
- recv_packet_handler[BAT_UNICAST_4ADDR] = recv_unicast_packet;
+ recv_packet_handler[BAT_UNICAST_4ADDR] = batadv_recv_unicast_packet;
/* unicast packet */
- recv_packet_handler[BAT_UNICAST] = recv_unicast_packet;
+ recv_packet_handler[BAT_UNICAST] = batadv_recv_unicast_packet;
/* fragmented unicast packet */
- recv_packet_handler[BAT_UNICAST_FRAG] = recv_ucast_frag_packet;
+ recv_packet_handler[BAT_UNICAST_FRAG] = batadv_recv_ucast_frag_packet;
/* broadcast packet */
- recv_packet_handler[BAT_BCAST] = recv_bcast_packet;
+ recv_packet_handler[BAT_BCAST] = batadv_recv_bcast_packet;
/* vis packet */
- recv_packet_handler[BAT_VIS] = recv_vis_packet;
+ recv_packet_handler[BAT_VIS] = batadv_recv_vis_packet;
/* Translation table query (request or response) */
- recv_packet_handler[BAT_TT_QUERY] = recv_tt_query;
+ recv_packet_handler[BAT_TT_QUERY] = batadv_recv_tt_query;
/* Roaming advertisement */
- recv_packet_handler[BAT_ROAM_ADV] = recv_roam_adv;
+ recv_packet_handler[BAT_ROAM_ADV] = batadv_recv_roam_adv;
}
int recv_handler_register(uint8_t packet_type,
diff --git a/originator.c b/originator.c
index 329b4ea..e6a2680 100644
--- a/originator.c
+++ b/originator.c
@@ -309,7 +309,7 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv,
neigh_purged = true;
hlist_del_rcu(&neigh_node->list);
- bonding_candidate_del(orig_node, neigh_node);
+ batadv_bonding_candidate_del(orig_node, neigh_node);
batadv_neigh_node_free_ref(neigh_node);
} else {
if ((!*best_neigh_node) ||
@@ -336,7 +336,8 @@ static bool purge_orig_node(struct bat_priv *bat_priv,
} else {
if (purge_orig_neighbors(bat_priv, orig_node,
&best_neigh_node))
- update_route(bat_priv, orig_node, best_neigh_node);
+ batadv_update_route(bat_priv, orig_node,
+ best_neigh_node);
}
return false;
diff --git a/routing.c b/routing.c
index 1a774fb..0654c0e 100644
--- a/routing.c
+++ b/routing.c
@@ -34,7 +34,7 @@
static int route_unicast_packet(struct sk_buff *skb,
struct hard_iface *recv_if);
-void slide_own_bcast_window(struct hard_iface *hard_iface)
+void batadv_slide_own_bcast_window(struct hard_iface *hard_iface)
{
struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
struct hashtable_t *hash = bat_priv->orig_hash;
@@ -108,8 +108,8 @@ static void _update_route(struct bat_priv *bat_priv,
batadv_neigh_node_free_ref(curr_router);
}
-void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
- struct neigh_node *neigh_node)
+void batadv_update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
+ struct neigh_node *neigh_node)
{
struct neigh_node *router = NULL;
@@ -127,8 +127,8 @@ out:
}
/* caller must hold the neigh_list_lock */
-void bonding_candidate_del(struct orig_node *orig_node,
- struct neigh_node *neigh_node)
+void batadv_bonding_candidate_del(struct orig_node *orig_node,
+ struct neigh_node *neigh_node)
{
/* this neighbor is not part of our candidate list */
if (list_empty(&neigh_node->bonding_list))
@@ -143,8 +143,8 @@ out:
return;
}
-void bonding_candidate_add(struct orig_node *orig_node,
- struct neigh_node *neigh_node)
+void batadv_bonding_candidate_add(struct orig_node *orig_node,
+ struct neigh_node *neigh_node)
{
struct hlist_node *node;
struct neigh_node *tmp_neigh_node, *router = NULL;
@@ -204,7 +204,7 @@ void bonding_candidate_add(struct orig_node *orig_node,
goto out;
candidate_del:
- bonding_candidate_del(orig_node, neigh_node);
+ batadv_bonding_candidate_del(orig_node, neigh_node);
out:
spin_unlock_bh(&orig_node->neigh_list_lock);
@@ -214,9 +214,10 @@ out:
}
/* copy primary address for bonding */
-void bonding_save_primary(const struct orig_node *orig_node,
- struct orig_node *orig_neigh_node,
- const struct batman_ogm_packet *batman_ogm_packet)
+void
+batadv_bonding_save_primary(const struct orig_node *orig_node,
+ struct orig_node *orig_neigh_node,
+ const struct batman_ogm_packet *batman_ogm_packet)
{
if (!(batman_ogm_packet->flags & PRIMARIES_FIRST_HOP))
return;
@@ -229,8 +230,8 @@ void bonding_save_primary(const struct orig_node *orig_node,
* 0 if the packet is to be accepted
* 1 if the packet is to be ignored.
*/
-int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
- unsigned long *last_reset)
+int batadv_window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
+ unsigned long *last_reset)
{
if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
(seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
@@ -245,9 +246,9 @@ int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
return 0;
}
-bool check_management_packet(struct sk_buff *skb,
- struct hard_iface *hard_iface,
- int header_len)
+bool batadv_check_management_packet(struct sk_buff *skb,
+ struct hard_iface *hard_iface,
+ int header_len)
{
struct ethhdr *ethhdr;
@@ -387,7 +388,7 @@ out:
}
-int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
+int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
{
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct icmp_packet_rr *icmp_packet;
@@ -569,7 +570,7 @@ static struct neigh_node *find_ifalter_router(struct orig_node *primary_orig,
return router;
}
-int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
+int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
{
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct tt_query_packet *tt_query;
@@ -642,7 +643,7 @@ out:
return NET_RX_DROP;
}
-int recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
+int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
{
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct roam_adv_packet *roam_adv_packet;
@@ -702,9 +703,9 @@ out:
/* find a suitable router for this originator, and use
* bonding if possible. increases the found neighbors
* refcount.*/
-struct neigh_node *find_router(struct bat_priv *bat_priv,
- struct orig_node *orig_node,
- const struct hard_iface *recv_if)
+struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
+ struct orig_node *orig_node,
+ const struct hard_iface *recv_if)
{
struct orig_node *primary_orig_node;
struct orig_node *router_orig;
@@ -832,7 +833,7 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
goto out;
/* find_router() increases neigh_nodes refcount if found. */
- neigh_node = find_router(bat_priv, orig_node, recv_if);
+ neigh_node = batadv_find_router(bat_priv, orig_node, recv_if);
if (!neigh_node)
goto out;
@@ -962,7 +963,7 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
return 1;
}
-int recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
+int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
{
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct unicast_packet *unicast_packet;
@@ -989,7 +990,8 @@ int recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
return route_unicast_packet(skb, recv_if);
}
-int recv_ucast_frag_packet(struct sk_buff *skb, struct hard_iface *recv_if)
+int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
+ struct hard_iface *recv_if)
{
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct unicast_frag_packet *unicast_packet;
@@ -1026,7 +1028,7 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct hard_iface *recv_if)
}
-int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
+int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
{
struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct orig_node *orig_node = NULL;
@@ -1078,8 +1080,8 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
seq_diff = ntohl(bcast_packet->seqno) - orig_node->last_bcast_seqno;
/* check whether the packet is old and the host just restarted. */
- if (window_protected(bat_priv, seq_diff,
- &orig_node->bcast_seqno_reset))
+ if (batadv_window_protected(bat_priv, seq_diff,
+ &orig_node->bcast_seqno_reset))
goto spin_unlock;
/* mark broadcast in flood history, update window position
@@ -1115,7 +1117,7 @@ out:
return ret;
}
-int recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if)
+int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if)
{
struct vis_packet *vis_packet;
struct ethhdr *ethhdr;
diff --git a/routing.h b/routing.h
index d6bbbeb..4652f0c 100644
--- a/routing.h
+++ b/routing.h
@@ -22,30 +22,32 @@
#ifndef _NET_BATMAN_ADV_ROUTING_H_
#define _NET_BATMAN_ADV_ROUTING_H_
-void slide_own_bcast_window(struct hard_iface *hard_iface);
-bool check_management_packet(struct sk_buff *skb,
- struct hard_iface *hard_iface,
- int header_len);
-void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
- struct neigh_node *neigh_node);
-int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if);
-int recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if);
-int recv_ucast_frag_packet(struct sk_buff *skb, struct hard_iface *recv_if);
-int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if);
-int recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if);
-int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if);
-int recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if);
-struct neigh_node *find_router(struct bat_priv *bat_priv,
- struct orig_node *orig_node,
- const struct hard_iface *recv_if);
-void bonding_candidate_del(struct orig_node *orig_node,
- struct neigh_node *neigh_node);
-void bonding_candidate_add(struct orig_node *orig_node,
- struct neigh_node *neigh_node);
-void bonding_save_primary(const struct orig_node *orig_node,
- struct orig_node *orig_neigh_node,
- const struct batman_ogm_packet *batman_ogm_packet);
-int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
- unsigned long *last_reset);
+void batadv_slide_own_bcast_window(struct hard_iface *hard_iface);
+bool batadv_check_management_packet(struct sk_buff *skb,
+ struct hard_iface *hard_iface,
+ int header_len);
+void batadv_update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
+ struct neigh_node *neigh_node);
+int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if);
+int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if);
+int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
+ struct hard_iface *recv_if);
+int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if);
+int batadv_recv_vis_packet(struct sk_buff *skb, struct hard_iface *recv_if);
+int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if);
+int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if);
+struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
+ struct orig_node *orig_node,
+ const struct hard_iface *recv_if);
+void batadv_bonding_candidate_del(struct orig_node *orig_node,
+ struct neigh_node *neigh_node);
+void batadv_bonding_candidate_add(struct orig_node *orig_node,
+ struct neigh_node *neigh_node);
+void batadv_bonding_save_primary(const struct orig_node *orig_node,
+ struct orig_node *orig_neigh_node,
+ const struct batman_ogm_packet
+ *batman_ogm_packet);
+int batadv_window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
+ unsigned long *last_reset);
#endif /* _NET_BATMAN_ADV_ROUTING_H_ */
diff --git a/unicast.c b/unicast.c
index 3977fc4..aafe73f 100644
--- a/unicast.c
+++ b/unicast.c
@@ -374,7 +374,7 @@ find_router:
* - if orig_node is NULL it returns NULL
* - increases neigh_nodes refcount if found.
*/
- neigh_node = find_router(bat_priv, orig_node, NULL);
+ neigh_node = batadv_find_router(bat_priv, orig_node, NULL);
if (!neigh_node)
goto out;
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-142-g217bc92
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 217bc92c81951344d1466d08592b5beaee89c06f
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:35 2012 +0200
batman-adv: Prefix ring_buffer non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 8589014..9afbe17 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -642,10 +642,10 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
continue;
spin_lock_bh(&tmp_neigh_node->lq_update_lock);
- ring_buffer_set(tmp_neigh_node->tq_recv,
- &tmp_neigh_node->tq_index, 0);
+ batadv_ring_buffer_set(tmp_neigh_node->tq_recv,
+ &tmp_neigh_node->tq_index, 0);
tmp_neigh_node->tq_avg =
- ring_buffer_avg(tmp_neigh_node->tq_recv);
+ batadv_ring_buffer_avg(tmp_neigh_node->tq_recv);
spin_unlock_bh(&tmp_neigh_node->lq_update_lock);
}
@@ -673,10 +673,10 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
neigh_node->last_seen = jiffies;
spin_lock_bh(&neigh_node->lq_update_lock);
- ring_buffer_set(neigh_node->tq_recv,
- &neigh_node->tq_index,
- batman_ogm_packet->tq);
- neigh_node->tq_avg = ring_buffer_avg(neigh_node->tq_recv);
+ batadv_ring_buffer_set(neigh_node->tq_recv,
+ &neigh_node->tq_index,
+ batman_ogm_packet->tq);
+ neigh_node->tq_avg = batadv_ring_buffer_avg(neigh_node->tq_recv);
spin_unlock_bh(&neigh_node->lq_update_lock);
if (!is_duplicate) {
diff --git a/ring_buffer.c b/ring_buffer.c
index fd63951..db8f5ef 100644
--- a/ring_buffer.c
+++ b/ring_buffer.c
@@ -22,13 +22,14 @@
#include "main.h"
#include "ring_buffer.h"
-void ring_buffer_set(uint8_t lq_recv[], uint8_t *lq_index, uint8_t value)
+void batadv_ring_buffer_set(uint8_t lq_recv[], uint8_t *lq_index,
+ uint8_t value)
{
lq_recv[*lq_index] = value;
*lq_index = (*lq_index + 1) % TQ_GLOBAL_WINDOW_SIZE;
}
-uint8_t ring_buffer_avg(const uint8_t lq_recv[])
+uint8_t batadv_ring_buffer_avg(const uint8_t lq_recv[])
{
const uint8_t *ptr;
uint16_t count = 0, i = 0, sum = 0;
diff --git a/ring_buffer.h b/ring_buffer.h
index 8b58bd8..fbaf9d2 100644
--- a/ring_buffer.h
+++ b/ring_buffer.h
@@ -22,7 +22,8 @@
#ifndef _NET_BATMAN_ADV_RING_BUFFER_H_
#define _NET_BATMAN_ADV_RING_BUFFER_H_
-void ring_buffer_set(uint8_t lq_recv[], uint8_t *lq_index, uint8_t value);
-uint8_t ring_buffer_avg(const uint8_t lq_recv[]);
+void batadv_ring_buffer_set(uint8_t lq_recv[], uint8_t *lq_index,
+ uint8_t value);
+uint8_t batadv_ring_buffer_avg(const uint8_t lq_recv[]);
#endif /* _NET_BATMAN_ADV_RING_BUFFER_H_ */
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-141-gd7917d0
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit d7917d001613ba40423edfa95c556aceb5f4c76b
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:34 2012 +0200
batman-adv: Prefix originator non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_debugfs.c b/bat_debugfs.c
index f8b3fa5..fe4599e 100644
--- a/bat_debugfs.c
+++ b/bat_debugfs.c
@@ -230,7 +230,7 @@ static int bat_algorithms_open(struct inode *inode, struct file *file)
static int originators_open(struct inode *inode, struct file *file)
{
struct net_device *net_dev = (struct net_device *)inode->i_private;
- return single_open(file, orig_seq_print_text, net_dev);
+ return single_open(file, batadv_orig_seq_print_text, net_dev);
}
static int gateways_open(struct inode *inode, struct file *file)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 71b6b2f..8589014 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -633,7 +633,7 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
(tmp_neigh_node->if_incoming == if_incoming) &&
atomic_inc_not_zero(&tmp_neigh_node->refcount)) {
if (neigh_node)
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
neigh_node = tmp_neigh_node;
continue;
}
@@ -652,7 +652,7 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
if (!neigh_node) {
struct orig_node *orig_tmp;
- orig_tmp = get_orig_node(bat_priv, ethhdr->h_source);
+ orig_tmp = batadv_get_orig_node(bat_priv, ethhdr->h_source);
if (!orig_tmp)
goto unlock;
@@ -660,7 +660,7 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
orig_node, orig_tmp,
batman_ogm_packet->seqno);
- orig_node_free_ref(orig_tmp);
+ batadv_orig_node_free_ref(orig_tmp);
if (!neigh_node)
goto unlock;
} else
@@ -688,7 +688,7 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
/* if this neighbor already is our next hop there is nothing
* to change */
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (router == neigh_node)
goto update_tt;
@@ -746,9 +746,9 @@ unlock:
rcu_read_unlock();
out:
if (neigh_node)
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
if (router)
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
}
static int bat_iv_ogm_calc_tq(struct orig_node *orig_node,
@@ -848,7 +848,7 @@ static int bat_iv_ogm_calc_tq(struct orig_node *orig_node,
out:
if (neigh_node)
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
return ret;
}
@@ -875,7 +875,7 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
int set_mark, ret = -1;
uint32_t seqno = ntohl(batman_ogm_packet->seqno);
- orig_node = get_orig_node(bat_priv, batman_ogm_packet->orig);
+ orig_node = batadv_get_orig_node(bat_priv, batman_ogm_packet->orig);
if (!orig_node)
return 0;
@@ -924,7 +924,7 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
out:
spin_unlock_bh(&orig_node->ogm_cnt_lock);
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
return ret;
}
@@ -1029,7 +1029,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
unsigned long *word;
int offset;
- orig_neigh_node = get_orig_node(bat_priv, ethhdr->h_source);
+ orig_neigh_node = batadv_get_orig_node(bat_priv,
+ ethhdr->h_source);
if (!orig_neigh_node)
return;
@@ -1053,7 +1054,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
bat_dbg(DBG_BATMAN, bat_priv,
"Drop packet: originator packet from myself (via neighbor)\n");
- orig_node_free_ref(orig_neigh_node);
+ batadv_orig_node_free_ref(orig_neigh_node);
return;
}
@@ -1071,7 +1072,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
return;
}
- orig_node = get_orig_node(bat_priv, batman_ogm_packet->orig);
+ orig_node = batadv_get_orig_node(bat_priv, batman_ogm_packet->orig);
if (!orig_node)
return;
@@ -1091,9 +1092,9 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
goto out;
}
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (router)
- router_router = orig_node_get_router(router->orig_node);
+ router_router = batadv_orig_node_get_router(router->orig_node);
if ((router && router->tq_avg != 0) &&
(compare_eth(router->addr, ethhdr->h_source)))
@@ -1115,11 +1116,11 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
* originator mac */
orig_neigh_node = (is_single_hop_neigh ?
orig_node :
- get_orig_node(bat_priv, ethhdr->h_source));
+ batadv_get_orig_node(bat_priv, ethhdr->h_source));
if (!orig_neigh_node)
goto out;
- orig_neigh_router = 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
* don't route towards it */
@@ -1178,16 +1179,16 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
out_neigh:
if ((orig_neigh_node) && (!is_single_hop_neigh))
- orig_node_free_ref(orig_neigh_node);
+ batadv_orig_node_free_ref(orig_neigh_node);
out:
if (router)
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
if (router_router)
- neigh_node_free_ref(router_router);
+ batadv_neigh_node_free_ref(router_router);
if (orig_neigh_router)
- neigh_node_free_ref(orig_neigh_router);
+ batadv_neigh_node_free_ref(orig_neigh_router);
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
}
static int bat_iv_ogm_receive(struct sk_buff *skb,
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
index eb21789..c4b28af 100644
--- a/bridge_loop_avoidance.c
+++ b/bridge_loop_avoidance.c
@@ -399,7 +399,7 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv,
if (orig_node) {
tt_global_del_orig(bat_priv, orig_node,
"became a backbone gateway");
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
}
return entry;
}
@@ -804,7 +804,7 @@ static int check_claim_group(struct bat_priv *bat_priv,
bla_dst_own->group = bla_dst->group;
}
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
return 2;
}
diff --git a/distributed-arp-table.c b/distributed-arp-table.c
index d9f1c9b..3069a01 100644
--- a/distributed-arp-table.c
+++ b/distributed-arp-table.c
@@ -179,7 +179,7 @@ static void choose_next_candidate(struct bat_priv *bat_priv,
max = tmp_max;
if (max_orig_node)
- orig_node_free_ref(max_orig_node);
+ batadv_orig_node_free_ref(max_orig_node);
max_orig_node = orig_node;
}
rcu_read_unlock();
@@ -253,7 +253,7 @@ static bool dht_send_data(struct bat_priv *bat_priv, struct sk_buff *skb,
if (cand[i].type == DHT_CANDIDATE_NOT_FOUND)
continue;
- neigh_node = orig_node_get_router(cand[i].orig_node);
+ neigh_node = batadv_orig_node_get_router(cand[i].orig_node);
if (!neigh_node)
goto free_orig;
@@ -269,9 +269,9 @@ static bool dht_send_data(struct bat_priv *bat_priv, struct sk_buff *skb,
/* packet sent to a candidate: we can return true */
ret = true;
free_neigh:
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
free_orig:
- orig_node_free_ref(cand[i].orig_node);
+ batadv_orig_node_free_ref(cand[i].orig_node);
}
out:
diff --git a/gateway_client.c b/gateway_client.c
index a3f944b..e92055d 100644
--- a/gateway_client.c
+++ b/gateway_client.c
@@ -124,7 +124,7 @@ static struct gw_node *gw_get_best_gw_node(struct bat_priv *bat_priv)
continue;
orig_node = gw_node->orig_node;
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (!router)
continue;
@@ -177,7 +177,7 @@ static struct gw_node *gw_get_best_gw_node(struct bat_priv *bat_priv)
gw_node_free_ref(gw_node);
next:
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
}
rcu_read_unlock();
@@ -212,7 +212,7 @@ void batadv_gw_election(struct bat_priv *bat_priv)
if (next_gw) {
sprintf(gw_addr, "%pM", next_gw->orig_node->orig);
- router = orig_node_get_router(next_gw->orig_node);
+ router = batadv_orig_node_get_router(next_gw->orig_node);
if (!router) {
batadv_gw_deselect(bat_priv);
goto out;
@@ -245,7 +245,7 @@ out:
if (next_gw)
gw_node_free_ref(next_gw);
if (router)
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
}
void batadv_gw_check_election(struct bat_priv *bat_priv,
@@ -259,7 +259,7 @@ void batadv_gw_check_election(struct bat_priv *bat_priv,
if (!curr_gw_orig)
goto deselect;
- router_gw = orig_node_get_router(curr_gw_orig);
+ router_gw = batadv_orig_node_get_router(curr_gw_orig);
if (!router_gw)
goto deselect;
@@ -267,7 +267,7 @@ void batadv_gw_check_election(struct bat_priv *bat_priv,
if (curr_gw_orig == orig_node)
goto out;
- router_orig = orig_node_get_router(orig_node);
+ router_orig = batadv_orig_node_get_router(orig_node);
if (!router_orig)
goto out;
@@ -294,11 +294,11 @@ deselect:
batadv_gw_deselect(bat_priv);
out:
if (curr_gw_orig)
- orig_node_free_ref(curr_gw_orig);
+ batadv_orig_node_free_ref(curr_gw_orig);
if (router_gw)
- neigh_node_free_ref(router_gw);
+ batadv_neigh_node_free_ref(router_gw);
if (router_orig)
- neigh_node_free_ref(router_orig);
+ batadv_neigh_node_free_ref(router_orig);
return;
}
@@ -438,7 +438,7 @@ static int _write_buffer_text(struct bat_priv *bat_priv, struct seq_file *seq,
batadv_gw_bandwidth_to_kbit(gw_node->orig_node->gw_flags, &down, &up);
- router = orig_node_get_router(gw_node->orig_node);
+ router = batadv_orig_node_get_router(gw_node->orig_node);
if (!router)
goto out;
@@ -455,7 +455,7 @@ static int _write_buffer_text(struct bat_priv *bat_priv, struct seq_file *seq,
(up > 2048 ? up / 1024 : up),
(up > 2048 ? "MBit" : "KBit"));
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
if (curr_gw)
gw_node_free_ref(curr_gw);
out:
@@ -702,12 +702,12 @@ bool batadv_gw_out_of_range(struct bat_priv *bat_priv,
out:
if (orig_dst_node)
- orig_node_free_ref(orig_dst_node);
+ batadv_orig_node_free_ref(orig_dst_node);
if (curr_gw)
gw_node_free_ref(curr_gw);
if (neigh_old)
- neigh_node_free_ref(neigh_old);
+ batadv_neigh_node_free_ref(neigh_old);
if (neigh_curr)
- neigh_node_free_ref(neigh_curr);
+ batadv_neigh_node_free_ref(neigh_curr);
return out_of_range;
}
diff --git a/hard-interface.c b/hard-interface.c
index 44206b6..7e70cc3 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -315,7 +315,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
hard_iface->if_num = bat_priv->num_ifaces;
bat_priv->num_ifaces++;
hard_iface->if_status = IF_INACTIVE;
- orig_hash_add_if(hard_iface, bat_priv->num_ifaces);
+ batadv_orig_hash_add_if(hard_iface, bat_priv->num_ifaces);
hard_iface->batman_adv_ptype.type = __constant_htons(ETH_P_BATMAN);
hard_iface->batman_adv_ptype.func = batman_skb_recv;
@@ -376,7 +376,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
dev_remove_pack(&hard_iface->batman_adv_ptype);
bat_priv->num_ifaces--;
- orig_hash_del_if(hard_iface, bat_priv->num_ifaces);
+ batadv_orig_hash_del_if(hard_iface, bat_priv->num_ifaces);
primary_if = primary_if_get_selected(bat_priv);
if (hard_iface == primary_if) {
@@ -393,7 +393,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
hard_iface->if_status = IF_NOT_IN_USE;
/* delete all references to this hard_iface */
- purge_orig_ref(bat_priv);
+ batadv_purge_orig_ref(bat_priv);
purge_outstanding_packets(bat_priv, hard_iface);
dev_put(hard_iface->soft_iface);
diff --git a/icmp_socket.c b/icmp_socket.c
index c734655..60e7f87 100644
--- a/icmp_socket.c
+++ b/icmp_socket.c
@@ -219,7 +219,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
if (!orig_node)
goto dst_unreach;
- neigh_node = orig_node_get_router(orig_node);
+ neigh_node = batadv_orig_node_get_router(orig_node);
if (!neigh_node)
goto dst_unreach;
@@ -248,9 +248,9 @@ out:
if (primary_if)
hardif_free_ref(primary_if);
if (neigh_node)
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
return len;
}
diff --git a/main.c b/main.c
index 534956b..4524502 100644
--- a/main.c
+++ b/main.c
@@ -111,7 +111,7 @@ int mesh_init(struct net_device *soft_iface)
INIT_LIST_HEAD(&bat_priv->tt_req_list);
INIT_LIST_HEAD(&bat_priv->tt_roam_list);
- ret = originator_init(bat_priv);
+ ret = batadv_originator_init(bat_priv);
if (ret < 0)
goto err;
@@ -150,7 +150,7 @@ void mesh_free(struct net_device *soft_iface)
vis_quit(bat_priv);
batadv_gw_node_purge(bat_priv);
- originator_free(bat_priv);
+ batadv_originator_free(bat_priv);
tt_free(bat_priv);
diff --git a/originator.c b/originator.c
index 4d00f0f..329b4ea 100644
--- a/originator.c
+++ b/originator.c
@@ -48,7 +48,7 @@ static int compare_orig(const struct hlist_node *node, const void *data2)
return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
}
-int originator_init(struct bat_priv *bat_priv)
+int batadv_originator_init(struct bat_priv *bat_priv)
{
if (bat_priv->orig_hash)
return 0;
@@ -65,14 +65,14 @@ err:
return -ENOMEM;
}
-void neigh_node_free_ref(struct neigh_node *neigh_node)
+void batadv_neigh_node_free_ref(struct neigh_node *neigh_node)
{
if (atomic_dec_and_test(&neigh_node->refcount))
kfree_rcu(neigh_node, rcu);
}
/* increases the refcounter of a found router */
-struct neigh_node *orig_node_get_router(struct orig_node *orig_node)
+struct neigh_node *batadv_orig_node_get_router(struct orig_node *orig_node)
{
struct neigh_node *router;
@@ -127,14 +127,14 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
list_for_each_entry_safe(neigh_node, tmp_neigh_node,
&orig_node->bond_list, bonding_list) {
list_del_rcu(&neigh_node->bonding_list);
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
}
/* for all neighbors towards this originator ... */
hlist_for_each_entry_safe(neigh_node, node, node_tmp,
&orig_node->neigh_list, list) {
hlist_del_rcu(&neigh_node->list);
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
}
spin_unlock_bh(&orig_node->neigh_list_lock);
@@ -149,13 +149,13 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
kfree(orig_node);
}
-void orig_node_free_ref(struct orig_node *orig_node)
+void batadv_orig_node_free_ref(struct orig_node *orig_node)
{
if (atomic_dec_and_test(&orig_node->refcount))
call_rcu(&orig_node->rcu, orig_node_free_rcu);
}
-void originator_free(struct bat_priv *bat_priv)
+void batadv_originator_free(struct bat_priv *bat_priv)
{
struct hashtable_t *hash = bat_priv->orig_hash;
struct hlist_node *node, *node_tmp;
@@ -180,7 +180,7 @@ void originator_free(struct bat_priv *bat_priv)
head, hash_entry) {
hlist_del_rcu(node);
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
}
spin_unlock_bh(list_lock);
}
@@ -190,7 +190,8 @@ void originator_free(struct bat_priv *bat_priv)
/* this function finds or creates an originator entry for the given
* address if it does not exits */
-struct orig_node *get_orig_node(struct bat_priv *bat_priv, const uint8_t *addr)
+struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
+ const uint8_t *addr)
{
struct orig_node *orig_node;
int size;
@@ -309,7 +310,7 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv,
hlist_del_rcu(&neigh_node->list);
bonding_candidate_del(orig_node, neigh_node);
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
} else {
if ((!*best_neigh_node) ||
(neigh_node->tq_avg > (*best_neigh_node)->tq_avg))
@@ -366,7 +367,7 @@ static void _purge_orig(struct bat_priv *bat_priv)
batadv_gw_node_delete(bat_priv,
orig_node);
hlist_del_rcu(node);
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
continue;
}
@@ -392,12 +393,12 @@ static void purge_orig(struct work_struct *work)
start_purge_timer(bat_priv);
}
-void purge_orig_ref(struct bat_priv *bat_priv)
+void batadv_purge_orig_ref(struct bat_priv *bat_priv)
{
_purge_orig(bat_priv);
}
-int orig_seq_print_text(struct seq_file *seq, void *offset)
+int batadv_orig_seq_print_text(struct seq_file *seq, void *offset)
{
struct net_device *net_dev = (struct net_device *)seq->private;
struct bat_priv *bat_priv = netdev_priv(net_dev);
@@ -441,7 +442,7 @@ int orig_seq_print_text(struct seq_file *seq, void *offset)
rcu_read_lock();
hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
- neigh_node = orig_node_get_router(orig_node);
+ neigh_node = batadv_orig_node_get_router(orig_node);
if (!neigh_node)
continue;
@@ -470,7 +471,7 @@ int orig_seq_print_text(struct seq_file *seq, void *offset)
batman_count++;
next:
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
}
rcu_read_unlock();
}
@@ -510,7 +511,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
return 0;
}
-int orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num)
+int batadv_orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num)
{
struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
struct hashtable_t *hash = bat_priv->orig_hash;
@@ -592,7 +593,7 @@ free_own_sum:
return 0;
}
-int 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)
{
struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
struct hashtable_t *hash = bat_priv->orig_hash;
diff --git a/originator.h b/originator.h
index f74d0d6..97deeba 100644
--- a/originator.h
+++ b/originator.h
@@ -24,19 +24,20 @@
#include "hash.h"
-int originator_init(struct bat_priv *bat_priv);
-void originator_free(struct bat_priv *bat_priv);
-void purge_orig_ref(struct bat_priv *bat_priv);
-void orig_node_free_ref(struct orig_node *orig_node);
-struct orig_node *get_orig_node(struct bat_priv *bat_priv, const uint8_t *addr);
+int batadv_originator_init(struct bat_priv *bat_priv);
+void batadv_originator_free(struct bat_priv *bat_priv);
+void batadv_purge_orig_ref(struct bat_priv *bat_priv);
+void batadv_orig_node_free_ref(struct orig_node *orig_node);
+struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
+ const uint8_t *addr);
struct neigh_node *batadv_neigh_node_new(struct hard_iface *hard_iface,
const uint8_t *neigh_addr,
uint32_t seqno);
-void neigh_node_free_ref(struct neigh_node *neigh_node);
-struct neigh_node *orig_node_get_router(struct orig_node *orig_node);
-int orig_seq_print_text(struct seq_file *seq, void *offset);
-int orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num);
-int orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num);
+void batadv_neigh_node_free_ref(struct neigh_node *neigh_node);
+struct neigh_node *batadv_orig_node_get_router(struct orig_node *orig_node);
+int batadv_orig_seq_print_text(struct seq_file *seq, void *offset);
+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);
/* hashfunction to choose an entry in a hash table of given size */
diff --git a/routing.c b/routing.c
index ee0aff0..1a774fb 100644
--- a/routing.c
+++ b/routing.c
@@ -69,7 +69,7 @@ static void _update_route(struct bat_priv *bat_priv,
{
struct neigh_node *curr_router;
- curr_router = orig_node_get_router(orig_node);
+ curr_router = batadv_orig_node_get_router(orig_node);
/* route deleted */
if ((curr_router) && (!neigh_node)) {
@@ -93,7 +93,7 @@ static void _update_route(struct bat_priv *bat_priv,
}
if (curr_router)
- neigh_node_free_ref(curr_router);
+ batadv_neigh_node_free_ref(curr_router);
/* increase refcount of new best neighbor */
if (neigh_node && !atomic_inc_not_zero(&neigh_node->refcount))
@@ -105,7 +105,7 @@ static void _update_route(struct bat_priv *bat_priv,
/* decrease refcount of previous best neighbor */
if (curr_router)
- neigh_node_free_ref(curr_router);
+ batadv_neigh_node_free_ref(curr_router);
}
void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
@@ -116,14 +116,14 @@ void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
if (!orig_node)
goto out;
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (router != neigh_node)
_update_route(bat_priv, orig_node, neigh_node);
out:
if (router)
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
}
/* caller must hold the neigh_list_lock */
@@ -136,7 +136,7 @@ void bonding_candidate_del(struct orig_node *orig_node,
list_del_rcu(&neigh_node->bonding_list);
INIT_LIST_HEAD(&neigh_node->bonding_list);
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
atomic_dec(&orig_node->bond_candidates);
out:
@@ -157,7 +157,7 @@ void bonding_candidate_add(struct orig_node *orig_node,
neigh_node->orig_node->primary_addr))
goto candidate_del;
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (!router)
goto candidate_del;
@@ -210,7 +210,7 @@ out:
spin_unlock_bh(&orig_node->neigh_list_lock);
if (router)
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
}
/* copy primary address for bonding */
@@ -303,7 +303,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
if (!orig_node)
goto out;
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (!router)
goto out;
@@ -325,9 +325,9 @@ out:
if (primary_if)
hardif_free_ref(primary_if);
if (router)
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
return ret;
}
@@ -358,7 +358,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
if (!orig_node)
goto out;
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (!router)
goto out;
@@ -380,9 +380,9 @@ out:
if (primary_if)
hardif_free_ref(primary_if);
if (router)
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
return ret;
}
@@ -444,7 +444,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
if (!orig_node)
goto out;
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (!router)
goto out;
@@ -463,9 +463,9 @@ int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
out:
if (router)
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
return ret;
}
@@ -551,13 +551,13 @@ static struct neigh_node *find_ifalter_router(struct orig_node *primary_orig,
/* decrement refcount of
* previously selected router */
if (router)
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
router = tmp_neigh_node;
atomic_inc_not_zero(&router->refcount);
}
- neigh_node_free_ref(tmp_neigh_node);
+ batadv_neigh_node_free_ref(tmp_neigh_node);
}
/* use the first candidate if nothing was found. */
@@ -693,7 +693,7 @@ int recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
* packets for the correct destination. */
bat_priv->tt_poss_change = true;
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
out:
/* returning NET_RX_DROP will make the caller function kfree the skb */
return NET_RX_DROP;
@@ -715,7 +715,7 @@ struct neigh_node *find_router(struct bat_priv *bat_priv,
if (!orig_node)
return NULL;
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (!router)
goto err;
@@ -748,7 +748,7 @@ struct neigh_node *find_router(struct bat_priv *bat_priv,
if (!primary_orig_node)
goto return_router;
- orig_node_free_ref(primary_orig_node);
+ batadv_orig_node_free_ref(primary_orig_node);
}
/* with less than 2 candidates, we can't do any
@@ -760,7 +760,7 @@ struct neigh_node *find_router(struct bat_priv *bat_priv,
* is is not on the interface where the packet came
* in. */
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
if (bonding_enabled)
router = find_bond_router(primary_orig_node, recv_if);
@@ -777,7 +777,7 @@ err_unlock:
rcu_read_unlock();
err:
if (router)
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
return NULL;
}
@@ -882,9 +882,9 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
out:
if (neigh_node)
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
return ret;
}
@@ -914,7 +914,7 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
curr_ttvn = (uint8_t)atomic_read(&orig_node->last_ttvn);
tt_poss_change = orig_node->tt_poss_change;
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
}
/* Check whether I have to reroute the packet */
@@ -949,7 +949,7 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
ETH_ALEN);
curr_ttvn = (uint8_t)
atomic_read(&orig_node->last_ttvn);
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
}
bat_dbg(DBG_ROUTES, bat_priv,
@@ -1111,7 +1111,7 @@ spin_unlock:
spin_unlock_bh(&orig_node->bcast_seqno_lock);
out:
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
return ret;
}
diff --git a/translation-table.c b/translation-table.c
index 3558ad7..46a8942 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -142,7 +142,7 @@ static void tt_orig_list_entry_free_rcu(struct rcu_head *rcu)
orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu);
atomic_dec(&orig_entry->orig_node->tt_size);
- orig_node_free_ref(orig_entry->orig_node);
+ batadv_orig_node_free_ref(orig_entry->orig_node);
kfree(orig_entry);
}
@@ -1080,7 +1080,7 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv,
rcu_read_lock();
head = &tt_global_entry->orig_list;
hlist_for_each_entry_rcu(orig_entry, node, head, list) {
- router = orig_node_get_router(orig_entry->orig_node);
+ router = batadv_orig_node_get_router(orig_entry->orig_node);
if (!router)
continue;
@@ -1088,7 +1088,7 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv,
orig_node = orig_entry->orig_node;
best_tq = router->tq_avg;
}
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
}
/* found anything? */
if (orig_node && !atomic_inc_not_zero(&orig_node->refcount))
@@ -1395,7 +1395,7 @@ static int send_tt_request(struct bat_priv *bat_priv,
if (full_table)
tt_request->flags |= TT_FULL_TABLE;
- neigh_node = orig_node_get_router(dst_orig_node);
+ neigh_node = batadv_orig_node_get_router(dst_orig_node);
if (!neigh_node)
goto out;
@@ -1411,7 +1411,7 @@ static int send_tt_request(struct bat_priv *bat_priv,
out:
if (neigh_node)
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
if (primary_if)
hardif_free_ref(primary_if);
if (ret)
@@ -1453,7 +1453,7 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
if (!res_dst_orig_node)
goto out;
- neigh_node = orig_node_get_router(res_dst_orig_node);
+ neigh_node = batadv_orig_node_get_router(res_dst_orig_node);
if (!neigh_node)
goto out;
@@ -1541,11 +1541,11 @@ unlock:
out:
if (res_dst_orig_node)
- orig_node_free_ref(res_dst_orig_node);
+ batadv_orig_node_free_ref(res_dst_orig_node);
if (req_dst_orig_node)
- orig_node_free_ref(req_dst_orig_node);
+ batadv_orig_node_free_ref(req_dst_orig_node);
if (neigh_node)
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
if (primary_if)
hardif_free_ref(primary_if);
if (!ret)
@@ -1580,7 +1580,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
if (!orig_node)
goto out;
- neigh_node = orig_node_get_router(orig_node);
+ neigh_node = batadv_orig_node_get_router(orig_node);
if (!neigh_node)
goto out;
@@ -1658,9 +1658,9 @@ unlock:
spin_unlock_bh(&bat_priv->tt_buff_lock);
out:
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
if (neigh_node)
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
if (primary_if)
hardif_free_ref(primary_if);
if (!ret)
@@ -1738,7 +1738,7 @@ static void tt_fill_gtable(struct bat_priv *bat_priv,
out:
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
}
static void tt_update_changes(struct bat_priv *bat_priv,
@@ -1818,7 +1818,7 @@ void handle_tt_response(struct bat_priv *bat_priv,
orig_node->tt_poss_change = false;
out:
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
}
int tt_init(struct bat_priv *bat_priv)
@@ -1947,7 +1947,7 @@ static void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
memcpy(roam_adv_packet->dst, orig_node->orig, ETH_ALEN);
memcpy(roam_adv_packet->client, client, ETH_ALEN);
- neigh_node = orig_node_get_router(orig_node);
+ neigh_node = batadv_orig_node_get_router(orig_node);
if (!neigh_node)
goto out;
@@ -1962,7 +1962,7 @@ static void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
out:
if (neigh_node)
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
if (ret)
kfree_skb(skb);
return;
diff --git a/unicast.c b/unicast.c
index 699426d..3977fc4 100644
--- a/unicast.c
+++ b/unicast.c
@@ -212,7 +212,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
out:
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
return ret;
}
@@ -420,9 +420,9 @@ find_router:
out:
if (neigh_node)
- neigh_node_free_ref(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
if (ret == 1)
kfree_skb(skb);
return ret;
diff --git a/vis.c b/vis.c
index 99f1931..1972a11 100644
--- a/vis.c
+++ b/vis.c
@@ -574,7 +574,7 @@ static int find_best_vis_server(struct bat_priv *bat_priv,
rcu_read_lock();
hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (!router)
continue;
@@ -584,7 +584,7 @@ static int find_best_vis_server(struct bat_priv *bat_priv,
memcpy(packet->target_orig, orig_node->orig,
ETH_ALEN);
}
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
}
rcu_read_unlock();
}
@@ -641,7 +641,7 @@ static int generate_vis_packet(struct bat_priv *bat_priv)
rcu_read_lock();
hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (!router)
continue;
@@ -665,7 +665,7 @@ static int generate_vis_packet(struct bat_priv *bat_priv)
packet->entries++;
next:
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
if (vis_packet_full(info))
goto unlock;
@@ -757,7 +757,7 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
if (!(orig_node->flags & VIS_SERVER))
continue;
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (!router)
continue;
@@ -765,7 +765,7 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
* this node. */
if (recv_list_is_in(bat_priv, &info->recv_list,
orig_node->orig)) {
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
continue;
}
@@ -773,7 +773,7 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
hard_iface = router->if_incoming;
memcpy(dstaddr, router->addr, ETH_ALEN);
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
skb = skb_clone(info->skb_packet, GFP_ATOMIC);
if (skb)
@@ -798,7 +798,7 @@ static void unicast_vis_packet(struct bat_priv *bat_priv,
if (!orig_node)
goto out;
- router = orig_node_get_router(orig_node);
+ router = batadv_orig_node_get_router(orig_node);
if (!router)
goto out;
@@ -808,9 +808,9 @@ static void unicast_vis_packet(struct bat_priv *bat_priv,
out:
if (router)
- neigh_node_free_ref(router);
+ batadv_neigh_node_free_ref(router);
if (orig_node)
- orig_node_free_ref(orig_node);
+ batadv_orig_node_free_ref(orig_node);
}
/* only send one vis packet. called from send_vis_packets() */
--
batman-adv
10 years, 1 month
batman-adv; branch, master, updated. v2012.1.0-140-g3397fdd
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 3397fdd9bf1d88bdadefde63719a9124f12fc7b9
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat May 12 02:09:33 2012 +0200
batman-adv: Prefix icmp-socket non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem(a)davemloft.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/bat_debugfs.c b/bat_debugfs.c
index 939c5be..f8b3fa5 100644
--- a/bat_debugfs.c
+++ b/bat_debugfs.c
@@ -349,7 +349,7 @@ int batadv_debugfs_add_meshif(struct net_device *dev)
if (!bat_priv->debug_dir)
goto out;
- bat_socket_setup(bat_priv);
+ batadv_socket_setup(bat_priv);
debug_log_setup(bat_priv);
for (bat_debug = mesh_debuginfos; *bat_debug; ++bat_debug) {
diff --git a/icmp_socket.c b/icmp_socket.c
index 2e98a57..c734655 100644
--- a/icmp_socket.c
+++ b/icmp_socket.c
@@ -34,7 +34,7 @@ static void bat_socket_add_packet(struct socket_client *socket_client,
struct icmp_packet_rr *icmp_packet,
size_t icmp_len);
-void bat_socket_init(void)
+void batadv_socket_init(void)
{
memset(socket_client_hash, 0, sizeof(socket_client_hash));
}
@@ -276,7 +276,7 @@ static const struct file_operations fops = {
.llseek = no_llseek,
};
-int bat_socket_setup(struct bat_priv *bat_priv)
+int batadv_socket_setup(struct bat_priv *bat_priv)
{
struct dentry *d;
@@ -336,8 +336,8 @@ static void bat_socket_add_packet(struct socket_client *socket_client,
wake_up(&socket_client->queue_wait);
}
-void bat_socket_receive_packet(struct icmp_packet_rr *icmp_packet,
- size_t icmp_len)
+void batadv_socket_receive_packet(struct icmp_packet_rr *icmp_packet,
+ size_t icmp_len)
{
struct socket_client *hash = socket_client_hash[icmp_packet->uid];
diff --git a/icmp_socket.h b/icmp_socket.h
index 380ed4c..7b88636 100644
--- a/icmp_socket.h
+++ b/icmp_socket.h
@@ -24,9 +24,9 @@
#define ICMP_SOCKET "socket"
-void bat_socket_init(void);
-int bat_socket_setup(struct bat_priv *bat_priv);
-void bat_socket_receive_packet(struct icmp_packet_rr *icmp_packet,
- size_t icmp_len);
+void batadv_socket_init(void);
+int batadv_socket_setup(struct bat_priv *bat_priv);
+void batadv_socket_receive_packet(struct icmp_packet_rr *icmp_packet,
+ size_t icmp_len);
#endif /* _NET_BATMAN_ADV_ICMP_SOCKET_H_ */
diff --git a/main.c b/main.c
index 0d42edf..534956b 100644
--- a/main.c
+++ b/main.c
@@ -65,7 +65,7 @@ static int __init batman_init(void)
if (!bat_event_workqueue)
return -ENOMEM;
- bat_socket_init();
+ batadv_socket_init();
batadv_debugfs_init();
register_netdevice_notifier(&batadv_hard_if_notifier);
diff --git a/routing.c b/routing.c
index e4d13dc..ee0aff0 100644
--- a/routing.c
+++ b/routing.c
@@ -289,7 +289,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
/* add data to device queue */
if (icmp_packet->msg_type != ECHO_REQUEST) {
- bat_socket_receive_packet(icmp_packet, icmp_len);
+ batadv_socket_receive_packet(icmp_packet, icmp_len);
goto out;
}
--
batman-adv
10 years, 1 month