diff options
author | Antonio Quartulli <ordex@autistici.org> | 2011-05-05 02:42:45 -0400 |
---|---|---|
committer | Sven Eckelmann <sven@narfation.org> | 2011-05-08 10:10:42 -0400 |
commit | 2dafb49d84a9195193b28ac5047df1bbab6053b9 (patch) | |
tree | cb3a9a77496257c54ce9fb61c4ff08743a98dc31 /net/batman-adv/routing.c | |
parent | 01df2b65e97735547ce37844f4134b5ea99b4037 (diff) |
batman-adv: rename everything from *hna* into *tt* (translation table)
To be coherent, all the functions/variables/constants have been renamed
to the TranslationTable style
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/routing.c')
-rw-r--r-- | net/batman-adv/routing.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index d8cde2b8d1cf..7648b92aec47 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -64,28 +64,28 @@ void slide_own_bcast_window(struct hard_iface *hard_iface) | |||
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | static void update_HNA(struct bat_priv *bat_priv, struct orig_node *orig_node, | 67 | static void update_TT(struct bat_priv *bat_priv, struct orig_node *orig_node, |
68 | unsigned char *hna_buff, int hna_buff_len) | 68 | unsigned char *tt_buff, int tt_buff_len) |
69 | { | 69 | { |
70 | if ((hna_buff_len != orig_node->hna_buff_len) || | 70 | if ((tt_buff_len != orig_node->tt_buff_len) || |
71 | ((hna_buff_len > 0) && | 71 | ((tt_buff_len > 0) && |
72 | (orig_node->hna_buff_len > 0) && | 72 | (orig_node->tt_buff_len > 0) && |
73 | (memcmp(orig_node->hna_buff, hna_buff, hna_buff_len) != 0))) { | 73 | (memcmp(orig_node->tt_buff, tt_buff, tt_buff_len) != 0))) { |
74 | 74 | ||
75 | if (orig_node->hna_buff_len > 0) | 75 | if (orig_node->tt_buff_len > 0) |
76 | hna_global_del_orig(bat_priv, orig_node, | 76 | tt_global_del_orig(bat_priv, orig_node, |
77 | "originator changed hna"); | 77 | "originator changed tt"); |
78 | 78 | ||
79 | if ((hna_buff_len > 0) && (hna_buff)) | 79 | if ((tt_buff_len > 0) && (tt_buff)) |
80 | hna_global_add_orig(bat_priv, orig_node, | 80 | tt_global_add_orig(bat_priv, orig_node, |
81 | hna_buff, hna_buff_len); | 81 | tt_buff, tt_buff_len); |
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | static void update_route(struct bat_priv *bat_priv, | 85 | static void update_route(struct bat_priv *bat_priv, |
86 | struct orig_node *orig_node, | 86 | struct orig_node *orig_node, |
87 | struct neigh_node *neigh_node, | 87 | struct neigh_node *neigh_node, |
88 | unsigned char *hna_buff, int hna_buff_len) | 88 | unsigned char *tt_buff, int tt_buff_len) |
89 | { | 89 | { |
90 | struct neigh_node *curr_router; | 90 | struct neigh_node *curr_router; |
91 | 91 | ||
@@ -96,7 +96,7 @@ static void update_route(struct bat_priv *bat_priv, | |||
96 | 96 | ||
97 | bat_dbg(DBG_ROUTES, bat_priv, "Deleting route towards: %pM\n", | 97 | bat_dbg(DBG_ROUTES, bat_priv, "Deleting route towards: %pM\n", |
98 | orig_node->orig); | 98 | orig_node->orig); |
99 | hna_global_del_orig(bat_priv, orig_node, | 99 | tt_global_del_orig(bat_priv, orig_node, |
100 | "originator timed out"); | 100 | "originator timed out"); |
101 | 101 | ||
102 | /* route added */ | 102 | /* route added */ |
@@ -105,8 +105,8 @@ static void update_route(struct bat_priv *bat_priv, | |||
105 | bat_dbg(DBG_ROUTES, bat_priv, | 105 | bat_dbg(DBG_ROUTES, bat_priv, |
106 | "Adding route towards: %pM (via %pM)\n", | 106 | "Adding route towards: %pM (via %pM)\n", |
107 | orig_node->orig, neigh_node->addr); | 107 | orig_node->orig, neigh_node->addr); |
108 | hna_global_add_orig(bat_priv, orig_node, | 108 | tt_global_add_orig(bat_priv, orig_node, |
109 | hna_buff, hna_buff_len); | 109 | tt_buff, tt_buff_len); |
110 | 110 | ||
111 | /* route changed */ | 111 | /* route changed */ |
112 | } else { | 112 | } else { |
@@ -135,8 +135,8 @@ static void update_route(struct bat_priv *bat_priv, | |||
135 | 135 | ||
136 | 136 | ||
137 | void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node, | 137 | void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node, |
138 | struct neigh_node *neigh_node, unsigned char *hna_buff, | 138 | struct neigh_node *neigh_node, unsigned char *tt_buff, |
139 | int hna_buff_len) | 139 | int tt_buff_len) |
140 | { | 140 | { |
141 | struct neigh_node *router = NULL; | 141 | struct neigh_node *router = NULL; |
142 | 142 | ||
@@ -147,10 +147,10 @@ void update_routes(struct bat_priv *bat_priv, struct orig_node *orig_node, | |||
147 | 147 | ||
148 | if (router != neigh_node) | 148 | if (router != neigh_node) |
149 | update_route(bat_priv, orig_node, neigh_node, | 149 | update_route(bat_priv, orig_node, neigh_node, |
150 | hna_buff, hna_buff_len); | 150 | tt_buff, tt_buff_len); |
151 | /* may be just HNA changed */ | 151 | /* may be just TT changed */ |
152 | else | 152 | else |
153 | update_HNA(bat_priv, orig_node, hna_buff, hna_buff_len); | 153 | update_TT(bat_priv, orig_node, tt_buff, tt_buff_len); |
154 | 154 | ||
155 | out: | 155 | out: |
156 | if (router) | 156 | if (router) |
@@ -387,14 +387,14 @@ static void update_orig(struct bat_priv *bat_priv, | |||
387 | struct ethhdr *ethhdr, | 387 | struct ethhdr *ethhdr, |
388 | struct batman_packet *batman_packet, | 388 | struct batman_packet *batman_packet, |
389 | struct hard_iface *if_incoming, | 389 | struct hard_iface *if_incoming, |
390 | unsigned char *hna_buff, int hna_buff_len, | 390 | unsigned char *tt_buff, int tt_buff_len, |
391 | char is_duplicate) | 391 | char is_duplicate) |
392 | { | 392 | { |
393 | struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; | 393 | struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; |
394 | struct neigh_node *router = NULL; | 394 | struct neigh_node *router = NULL; |
395 | struct orig_node *orig_node_tmp; | 395 | struct orig_node *orig_node_tmp; |
396 | struct hlist_node *node; | 396 | struct hlist_node *node; |
397 | int tmp_hna_buff_len; | 397 | int tmp_tt_buff_len; |
398 | uint8_t bcast_own_sum_orig, bcast_own_sum_neigh; | 398 | uint8_t bcast_own_sum_orig, bcast_own_sum_neigh; |
399 | 399 | ||
400 | bat_dbg(DBG_BATMAN, bat_priv, "update_originator(): " | 400 | bat_dbg(DBG_BATMAN, bat_priv, "update_originator(): " |
@@ -459,18 +459,18 @@ static void update_orig(struct bat_priv *bat_priv, | |||
459 | 459 | ||
460 | bonding_candidate_add(orig_node, neigh_node); | 460 | bonding_candidate_add(orig_node, neigh_node); |
461 | 461 | ||
462 | tmp_hna_buff_len = (hna_buff_len > batman_packet->num_hna * ETH_ALEN ? | 462 | tmp_tt_buff_len = (tt_buff_len > batman_packet->num_tt * ETH_ALEN ? |
463 | batman_packet->num_hna * ETH_ALEN : hna_buff_len); | 463 | batman_packet->num_tt * ETH_ALEN : tt_buff_len); |
464 | 464 | ||
465 | /* if this neighbor already is our next hop there is nothing | 465 | /* if this neighbor already is our next hop there is nothing |
466 | * to change */ | 466 | * to change */ |
467 | router = orig_node_get_router(orig_node); | 467 | router = orig_node_get_router(orig_node); |
468 | if (router == neigh_node) | 468 | if (router == neigh_node) |
469 | goto update_hna; | 469 | goto update_tt; |
470 | 470 | ||
471 | /* if this neighbor does not offer a better TQ we won't consider it */ | 471 | /* if this neighbor does not offer a better TQ we won't consider it */ |
472 | if (router && (router->tq_avg > neigh_node->tq_avg)) | 472 | if (router && (router->tq_avg > neigh_node->tq_avg)) |
473 | goto update_hna; | 473 | goto update_tt; |
474 | 474 | ||
475 | /* if the TQ is the same and the link not more symetric we | 475 | /* if the TQ is the same and the link not more symetric we |
476 | * won't consider it either */ | 476 | * won't consider it either */ |
@@ -488,16 +488,16 @@ static void update_orig(struct bat_priv *bat_priv, | |||
488 | spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); | 488 | spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock); |
489 | 489 | ||
490 | if (bcast_own_sum_orig >= bcast_own_sum_neigh) | 490 | if (bcast_own_sum_orig >= bcast_own_sum_neigh) |
491 | goto update_hna; | 491 | goto update_tt; |
492 | } | 492 | } |
493 | 493 | ||
494 | update_routes(bat_priv, orig_node, neigh_node, | 494 | update_routes(bat_priv, orig_node, neigh_node, |
495 | hna_buff, tmp_hna_buff_len); | 495 | tt_buff, tmp_tt_buff_len); |
496 | goto update_gw; | 496 | goto update_gw; |
497 | 497 | ||
498 | update_hna: | 498 | update_tt: |
499 | update_routes(bat_priv, orig_node, router, | 499 | update_routes(bat_priv, orig_node, router, |
500 | hna_buff, tmp_hna_buff_len); | 500 | tt_buff, tmp_tt_buff_len); |
501 | 501 | ||
502 | update_gw: | 502 | update_gw: |
503 | if (orig_node->gw_flags != batman_packet->gw_flags) | 503 | if (orig_node->gw_flags != batman_packet->gw_flags) |
@@ -621,7 +621,7 @@ out: | |||
621 | 621 | ||
622 | void receive_bat_packet(struct ethhdr *ethhdr, | 622 | void receive_bat_packet(struct ethhdr *ethhdr, |
623 | struct batman_packet *batman_packet, | 623 | struct batman_packet *batman_packet, |
624 | unsigned char *hna_buff, int hna_buff_len, | 624 | unsigned char *tt_buff, int tt_buff_len, |
625 | struct hard_iface *if_incoming) | 625 | struct hard_iface *if_incoming) |
626 | { | 626 | { |
627 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); | 627 | struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); |
@@ -818,14 +818,14 @@ void receive_bat_packet(struct ethhdr *ethhdr, | |||
818 | ((orig_node->last_real_seqno == batman_packet->seqno) && | 818 | ((orig_node->last_real_seqno == batman_packet->seqno) && |
819 | (orig_node->last_ttl - 3 <= batman_packet->ttl)))) | 819 | (orig_node->last_ttl - 3 <= batman_packet->ttl)))) |
820 | update_orig(bat_priv, orig_node, ethhdr, batman_packet, | 820 | update_orig(bat_priv, orig_node, ethhdr, batman_packet, |
821 | if_incoming, hna_buff, hna_buff_len, is_duplicate); | 821 | if_incoming, tt_buff, tt_buff_len, is_duplicate); |
822 | 822 | ||
823 | /* is single hop (direct) neighbor */ | 823 | /* is single hop (direct) neighbor */ |
824 | if (is_single_hop_neigh) { | 824 | if (is_single_hop_neigh) { |
825 | 825 | ||
826 | /* mark direct link on incoming interface */ | 826 | /* mark direct link on incoming interface */ |
827 | schedule_forward_packet(orig_node, ethhdr, batman_packet, | 827 | schedule_forward_packet(orig_node, ethhdr, batman_packet, |
828 | 1, hna_buff_len, if_incoming); | 828 | 1, tt_buff_len, if_incoming); |
829 | 829 | ||
830 | bat_dbg(DBG_BATMAN, bat_priv, "Forwarding packet: " | 830 | bat_dbg(DBG_BATMAN, bat_priv, "Forwarding packet: " |
831 | "rebroadcast neighbor packet with direct link flag\n"); | 831 | "rebroadcast neighbor packet with direct link flag\n"); |
@@ -848,7 +848,7 @@ void receive_bat_packet(struct ethhdr *ethhdr, | |||
848 | bat_dbg(DBG_BATMAN, bat_priv, | 848 | bat_dbg(DBG_BATMAN, bat_priv, |
849 | "Forwarding packet: rebroadcast originator packet\n"); | 849 | "Forwarding packet: rebroadcast originator packet\n"); |
850 | schedule_forward_packet(orig_node, ethhdr, batman_packet, | 850 | schedule_forward_packet(orig_node, ethhdr, batman_packet, |
851 | 0, hna_buff_len, if_incoming); | 851 | 0, tt_buff_len, if_incoming); |
852 | 852 | ||
853 | out_neigh: | 853 | out_neigh: |
854 | if ((orig_neigh_node) && (!is_single_hop_neigh)) | 854 | if ((orig_neigh_node) && (!is_single_hop_neigh)) |