aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/routing.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-16 14:23:13 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-25 02:21:45 -0400
commit63b010371efebe6342b7f2bfad2f7881d03cf5f7 (patch)
tree058c305709ae3c4475c1660bc5aca03bcf91f46e /net/batman-adv/routing.c
parent03fc7f863dc53516ca9764b324f54d10c4a137f6 (diff)
batman-adv: Prefix routing local static functions with batadv_
All non-static symbols of batman-adv were prefixed with batadv_ to avoid collisions with other symbols of the kernel. Other symbols of batman-adv should use the same prefix to keep the naming scheme consistent. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/routing.c')
-rw-r--r--net/batman-adv/routing.c65
1 files changed, 34 insertions, 31 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 57ff85178216..e7ee40d6d609 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -29,8 +29,8 @@
29#include "unicast.h" 29#include "unicast.h"
30#include "bridge_loop_avoidance.h" 30#include "bridge_loop_avoidance.h"
31 31
32static int route_unicast_packet(struct sk_buff *skb, 32static int batadv_route_unicast_packet(struct sk_buff *skb,
33 struct hard_iface *recv_if); 33 struct hard_iface *recv_if);
34 34
35void batadv_slide_own_bcast_window(struct hard_iface *hard_iface) 35void batadv_slide_own_bcast_window(struct hard_iface *hard_iface)
36{ 36{
@@ -61,9 +61,9 @@ void batadv_slide_own_bcast_window(struct hard_iface *hard_iface)
61 } 61 }
62} 62}
63 63
64static void _update_route(struct bat_priv *bat_priv, 64static void _batadv_update_route(struct bat_priv *bat_priv,
65 struct orig_node *orig_node, 65 struct orig_node *orig_node,
66 struct neigh_node *neigh_node) 66 struct neigh_node *neigh_node)
67{ 67{
68 struct neigh_node *curr_router; 68 struct neigh_node *curr_router;
69 69
@@ -117,7 +117,7 @@ void batadv_update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
117 router = batadv_orig_node_get_router(orig_node); 117 router = batadv_orig_node_get_router(orig_node);
118 118
119 if (router != neigh_node) 119 if (router != neigh_node)
120 _update_route(bat_priv, orig_node, neigh_node); 120 _batadv_update_route(bat_priv, orig_node, neigh_node);
121 121
122out: 122out:
123 if (router) 123 if (router)
@@ -276,8 +276,8 @@ bool batadv_check_management_packet(struct sk_buff *skb,
276 return true; 276 return true;
277} 277}
278 278
279static int recv_my_icmp_packet(struct bat_priv *bat_priv, 279static int batadv_recv_my_icmp_packet(struct bat_priv *bat_priv,
280 struct sk_buff *skb, size_t icmp_len) 280 struct sk_buff *skb, size_t icmp_len)
281{ 281{
282 struct hard_iface *primary_if = NULL; 282 struct hard_iface *primary_if = NULL;
283 struct orig_node *orig_node = NULL; 283 struct orig_node *orig_node = NULL;
@@ -331,8 +331,8 @@ out:
331 return ret; 331 return ret;
332} 332}
333 333
334static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv, 334static int batadv_recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
335 struct sk_buff *skb) 335 struct sk_buff *skb)
336{ 336{
337 struct hard_iface *primary_if = NULL; 337 struct hard_iface *primary_if = NULL;
338 struct orig_node *orig_node = NULL; 338 struct orig_node *orig_node = NULL;
@@ -431,11 +431,11 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
431 431
432 /* packet for me */ 432 /* packet for me */
433 if (batadv_is_my_mac(icmp_packet->dst)) 433 if (batadv_is_my_mac(icmp_packet->dst))
434 return recv_my_icmp_packet(bat_priv, skb, hdr_size); 434 return batadv_recv_my_icmp_packet(bat_priv, skb, hdr_size);
435 435
436 /* TTL exceeded */ 436 /* TTL exceeded */
437 if (icmp_packet->header.ttl < 2) 437 if (icmp_packet->header.ttl < 2)
438 return recv_icmp_ttl_exceeded(bat_priv, skb); 438 return batadv_recv_icmp_ttl_exceeded(bat_priv, skb);
439 439
440 /* get routing information */ 440 /* get routing information */
441 orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->dst); 441 orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->dst);
@@ -473,8 +473,9 @@ out:
473 * This method rotates the bonding list and increases the 473 * This method rotates the bonding list and increases the
474 * returned router's refcount. 474 * returned router's refcount.
475 */ 475 */
476static struct neigh_node *find_bond_router(struct orig_node *primary_orig, 476static struct neigh_node *
477 const struct hard_iface *recv_if) 477batadv_find_bond_router(struct orig_node *primary_orig,
478 const struct hard_iface *recv_if)
478{ 479{
479 struct neigh_node *tmp_neigh_node; 480 struct neigh_node *tmp_neigh_node;
480 struct neigh_node *router = NULL, *first_candidate = NULL; 481 struct neigh_node *router = NULL, *first_candidate = NULL;
@@ -527,8 +528,9 @@ out:
527 * 528 *
528 * Increases the returned router's refcount 529 * Increases the returned router's refcount
529 */ 530 */
530static struct neigh_node *find_ifalter_router(struct orig_node *primary_orig, 531static struct neigh_node *
531 const struct hard_iface *recv_if) 532batadv_find_ifalter_router(struct orig_node *primary_orig,
533 const struct hard_iface *recv_if)
532{ 534{
533 struct neigh_node *tmp_neigh_node; 535 struct neigh_node *tmp_neigh_node;
534 struct neigh_node *router = NULL, *first_candidate = NULL; 536 struct neigh_node *router = NULL, *first_candidate = NULL;
@@ -614,7 +616,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
614 "Routing TT_REQUEST to %pM [%c]\n", 616 "Routing TT_REQUEST to %pM [%c]\n",
615 tt_query->dst, 617 tt_query->dst,
616 tt_flag); 618 tt_flag);
617 return route_unicast_packet(skb, recv_if); 619 return batadv_route_unicast_packet(skb, recv_if);
618 } 620 }
619 break; 621 break;
620 case TT_RESPONSE: 622 case TT_RESPONSE:
@@ -643,7 +645,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
643 "Routing TT_RESPONSE to %pM [%c]\n", 645 "Routing TT_RESPONSE to %pM [%c]\n",
644 tt_query->dst, 646 tt_query->dst,
645 tt_flag); 647 tt_flag);
646 return route_unicast_packet(skb, recv_if); 648 return batadv_route_unicast_packet(skb, recv_if);
647 } 649 }
648 break; 650 break;
649 } 651 }
@@ -679,7 +681,7 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
679 roam_adv_packet = (struct roam_adv_packet *)skb->data; 681 roam_adv_packet = (struct roam_adv_packet *)skb->data;
680 682
681 if (!batadv_is_my_mac(roam_adv_packet->dst)) 683 if (!batadv_is_my_mac(roam_adv_packet->dst))
682 return route_unicast_packet(skb, recv_if); 684 return batadv_route_unicast_packet(skb, recv_if);
683 685
684 /* check if it is a backbone gateway. we don't accept 686 /* check if it is a backbone gateway. we don't accept
685 * roaming advertisement from it, as it has the same 687 * roaming advertisement from it, as it has the same
@@ -783,9 +785,9 @@ struct neigh_node *batadv_find_router(struct bat_priv *bat_priv,
783 batadv_neigh_node_free_ref(router); 785 batadv_neigh_node_free_ref(router);
784 786
785 if (bonding_enabled) 787 if (bonding_enabled)
786 router = find_bond_router(primary_orig_node, recv_if); 788 router = batadv_find_bond_router(primary_orig_node, recv_if);
787 else 789 else
788 router = find_ifalter_router(primary_orig_node, recv_if); 790 router = batadv_find_ifalter_router(primary_orig_node, recv_if);
789 791
790return_router: 792return_router:
791 if (router && router->if_incoming->if_status != IF_ACTIVE) 793 if (router && router->if_incoming->if_status != IF_ACTIVE)
@@ -801,7 +803,7 @@ err:
801 return NULL; 803 return NULL;
802} 804}
803 805
804static int check_unicast_packet(struct sk_buff *skb, int hdr_size) 806static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size)
805{ 807{
806 struct ethhdr *ethhdr; 808 struct ethhdr *ethhdr;
807 809
@@ -826,7 +828,8 @@ static int check_unicast_packet(struct sk_buff *skb, int hdr_size)
826 return 0; 828 return 0;
827} 829}
828 830
829static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if) 831static int batadv_route_unicast_packet(struct sk_buff *skb,
832 struct hard_iface *recv_if)
830{ 833{
831 struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); 834 struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
832 struct orig_node *orig_node = NULL; 835 struct orig_node *orig_node = NULL;
@@ -911,8 +914,8 @@ out:
911 return ret; 914 return ret;
912} 915}
913 916
914static int check_unicast_ttvn(struct bat_priv *bat_priv, 917static int batadv_check_unicast_ttvn(struct bat_priv *bat_priv,
915 struct sk_buff *skb) { 918 struct sk_buff *skb) {
916 uint8_t curr_ttvn; 919 uint8_t curr_ttvn;
917 struct orig_node *orig_node; 920 struct orig_node *orig_node;
918 struct ethhdr *ethhdr; 921 struct ethhdr *ethhdr;
@@ -994,10 +997,10 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
994 struct unicast_packet *unicast_packet; 997 struct unicast_packet *unicast_packet;
995 int hdr_size = sizeof(*unicast_packet); 998 int hdr_size = sizeof(*unicast_packet);
996 999
997 if (check_unicast_packet(skb, hdr_size) < 0) 1000 if (batadv_check_unicast_packet(skb, hdr_size) < 0)
998 return NET_RX_DROP; 1001 return NET_RX_DROP;
999 1002
1000 if (!check_unicast_ttvn(bat_priv, skb)) 1003 if (!batadv_check_unicast_ttvn(bat_priv, skb))
1001 return NET_RX_DROP; 1004 return NET_RX_DROP;
1002 1005
1003 unicast_packet = (struct unicast_packet *)skb->data; 1006 unicast_packet = (struct unicast_packet *)skb->data;
@@ -1009,7 +1012,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
1009 return NET_RX_SUCCESS; 1012 return NET_RX_SUCCESS;
1010 } 1013 }
1011 1014
1012 return route_unicast_packet(skb, recv_if); 1015 return batadv_route_unicast_packet(skb, recv_if);
1013} 1016}
1014 1017
1015int batadv_recv_ucast_frag_packet(struct sk_buff *skb, 1018int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
@@ -1021,10 +1024,10 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
1021 struct sk_buff *new_skb = NULL; 1024 struct sk_buff *new_skb = NULL;
1022 int ret; 1025 int ret;
1023 1026
1024 if (check_unicast_packet(skb, hdr_size) < 0) 1027 if (batadv_check_unicast_packet(skb, hdr_size) < 0)
1025 return NET_RX_DROP; 1028 return NET_RX_DROP;
1026 1029
1027 if (!check_unicast_ttvn(bat_priv, skb)) 1030 if (!batadv_check_unicast_ttvn(bat_priv, skb))
1028 return NET_RX_DROP; 1031 return NET_RX_DROP;
1029 1032
1030 unicast_packet = (struct unicast_frag_packet *)skb->data; 1033 unicast_packet = (struct unicast_frag_packet *)skb->data;
@@ -1046,7 +1049,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
1046 return NET_RX_SUCCESS; 1049 return NET_RX_SUCCESS;
1047 } 1050 }
1048 1051
1049 return route_unicast_packet(skb, recv_if); 1052 return batadv_route_unicast_packet(skb, recv_if);
1050} 1053}
1051 1054
1052 1055