aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_iv_ogm.c
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2011-11-28 08:31:55 -0500
committerMarek Lindner <lindner_marek@yahoo.de>2012-02-16 13:50:20 -0500
commit01c4224b51feba2ba64d070ab9f4aa32c9d0bb29 (patch)
tree80ca19da3b90b2b69f01492c06310be4c8678efc /net/batman-adv/bat_iv_ogm.c
parent1c280471b013e26c833fc86acc231c73442cfa21 (diff)
batman-adv: convert batman iv algorithm to use dynamic infrastructure
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/bat_iv_ogm.c')
-rw-r--r--net/batman-adv/bat_iv_ogm.c179
1 files changed, 94 insertions, 85 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 1847efaaa6fd..1c483a5dd808 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -20,7 +20,6 @@
20 */ 20 */
21 21
22#include "main.h" 22#include "main.h"
23#include "bat_ogm.h"
24#include "translation-table.h" 23#include "translation-table.h"
25#include "ring_buffer.h" 24#include "ring_buffer.h"
26#include "originator.h" 25#include "originator.h"
@@ -31,7 +30,7 @@
31#include "send.h" 30#include "send.h"
32#include "bat_algo.h" 31#include "bat_algo.h"
33 32
34void bat_ogm_init(struct hard_iface *hard_iface) 33static void bat_iv_ogm_init(struct hard_iface *hard_iface)
35{ 34{
36 struct batman_ogm_packet *batman_ogm_packet; 35 struct batman_ogm_packet *batman_ogm_packet;
37 36
@@ -48,7 +47,7 @@ void bat_ogm_init(struct hard_iface *hard_iface)
48 batman_ogm_packet->ttvn = 0; 47 batman_ogm_packet->ttvn = 0;
49} 48}
50 49
51void bat_ogm_init_primary(struct hard_iface *hard_iface) 50static void bat_iv_ogm_init_primary(struct hard_iface *hard_iface)
52{ 51{
53 struct batman_ogm_packet *batman_ogm_packet; 52 struct batman_ogm_packet *batman_ogm_packet;
54 53
@@ -57,7 +56,7 @@ void bat_ogm_init_primary(struct hard_iface *hard_iface)
57 batman_ogm_packet->header.ttl = TTL; 56 batman_ogm_packet->header.ttl = TTL;
58} 57}
59 58
60void bat_ogm_update_mac(struct hard_iface *hard_iface) 59static void bat_iv_ogm_update_mac(struct hard_iface *hard_iface)
61{ 60{
62 struct batman_ogm_packet *batman_ogm_packet; 61 struct batman_ogm_packet *batman_ogm_packet;
63 62
@@ -69,7 +68,7 @@ void bat_ogm_update_mac(struct hard_iface *hard_iface)
69} 68}
70 69
71/* when do we schedule our own ogm to be sent */ 70/* when do we schedule our own ogm to be sent */
72static unsigned long bat_ogm_emit_send_time(const struct bat_priv *bat_priv) 71static unsigned long bat_iv_ogm_emit_send_time(const struct bat_priv *bat_priv)
73{ 72{
74 return jiffies + msecs_to_jiffies( 73 return jiffies + msecs_to_jiffies(
75 atomic_read(&bat_priv->orig_interval) - 74 atomic_read(&bat_priv->orig_interval) -
@@ -77,7 +76,7 @@ static unsigned long bat_ogm_emit_send_time(const struct bat_priv *bat_priv)
77} 76}
78 77
79/* when do we schedule a ogm packet to be sent */ 78/* when do we schedule a ogm packet to be sent */
80static unsigned long bat_ogm_fwd_send_time(void) 79static unsigned long bat_iv_ogm_fwd_send_time(void)
81{ 80{
82 return jiffies + msecs_to_jiffies(random32() % (JITTER/2)); 81 return jiffies + msecs_to_jiffies(random32() % (JITTER/2));
83} 82}
@@ -90,8 +89,8 @@ static uint8_t hop_penalty(uint8_t tq, const struct bat_priv *bat_priv)
90} 89}
91 90
92/* is there another aggregated packet here? */ 91/* is there another aggregated packet here? */
93static int bat_ogm_aggr_packet(int buff_pos, int packet_len, 92static int bat_iv_ogm_aggr_packet(int buff_pos, int packet_len,
94 int tt_num_changes) 93 int tt_num_changes)
95{ 94{
96 int next_buff_pos = buff_pos + BATMAN_OGM_LEN + tt_len(tt_num_changes); 95 int next_buff_pos = buff_pos + BATMAN_OGM_LEN + tt_len(tt_num_changes);
97 96
@@ -100,8 +99,8 @@ static int bat_ogm_aggr_packet(int buff_pos, int packet_len,
100} 99}
101 100
102/* send a batman ogm to a given interface */ 101/* send a batman ogm to a given interface */
103static void bat_ogm_send_to_if(struct forw_packet *forw_packet, 102static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet,
104 struct hard_iface *hard_iface) 103 struct hard_iface *hard_iface)
105{ 104{
106 struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 105 struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
107 char *fwd_str; 106 char *fwd_str;
@@ -118,8 +117,8 @@ static void bat_ogm_send_to_if(struct forw_packet *forw_packet,
118 batman_ogm_packet = (struct batman_ogm_packet *)forw_packet->skb->data; 117 batman_ogm_packet = (struct batman_ogm_packet *)forw_packet->skb->data;
119 118
120 /* adjust all flags and log packets */ 119 /* adjust all flags and log packets */
121 while (bat_ogm_aggr_packet(buff_pos, forw_packet->packet_len, 120 while (bat_iv_ogm_aggr_packet(buff_pos, forw_packet->packet_len,
122 batman_ogm_packet->tt_num_changes)) { 121 batman_ogm_packet->tt_num_changes)) {
123 122
124 /* we might have aggregated direct link packets with an 123 /* we might have aggregated direct link packets with an
125 * ordinary base packet */ 124 * ordinary base packet */
@@ -158,7 +157,7 @@ static void bat_ogm_send_to_if(struct forw_packet *forw_packet,
158} 157}
159 158
160/* send a batman ogm packet */ 159/* send a batman ogm packet */
161void bat_ogm_emit(struct forw_packet *forw_packet) 160static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
162{ 161{
163 struct hard_iface *hard_iface; 162 struct hard_iface *hard_iface;
164 struct net_device *soft_iface; 163 struct net_device *soft_iface;
@@ -217,7 +216,7 @@ void bat_ogm_emit(struct forw_packet *forw_packet)
217 if (hard_iface->soft_iface != soft_iface) 216 if (hard_iface->soft_iface != soft_iface)
218 continue; 217 continue;
219 218
220 bat_ogm_send_to_if(forw_packet, hard_iface); 219 bat_iv_ogm_send_to_if(forw_packet, hard_iface);
221 } 220 }
222 rcu_read_unlock(); 221 rcu_read_unlock();
223 222
@@ -227,13 +226,13 @@ out:
227} 226}
228 227
229/* return true if new_packet can be aggregated with forw_packet */ 228/* return true if new_packet can be aggregated with forw_packet */
230static bool bat_ogm_can_aggregate(const struct batman_ogm_packet 229static bool bat_iv_ogm_can_aggregate(const struct batman_ogm_packet
231 *new_batman_ogm_packet, 230 *new_batman_ogm_packet,
232 struct bat_priv *bat_priv, 231 struct bat_priv *bat_priv,
233 int packet_len, unsigned long send_time, 232 int packet_len, unsigned long send_time,
234 bool directlink, 233 bool directlink,
235 const struct hard_iface *if_incoming, 234 const struct hard_iface *if_incoming,
236 const struct forw_packet *forw_packet) 235 const struct forw_packet *forw_packet)
237{ 236{
238 struct batman_ogm_packet *batman_ogm_packet; 237 struct batman_ogm_packet *batman_ogm_packet;
239 int aggregated_bytes = forw_packet->packet_len + packet_len; 238 int aggregated_bytes = forw_packet->packet_len + packet_len;
@@ -307,11 +306,11 @@ out:
307} 306}
308 307
309/* create a new aggregated packet and add this packet to it */ 308/* create a new aggregated packet and add this packet to it */
310static void bat_ogm_aggregate_new(const unsigned char *packet_buff, 309static void bat_iv_ogm_aggregate_new(const unsigned char *packet_buff,
311 int packet_len, unsigned long send_time, 310 int packet_len, unsigned long send_time,
312 bool direct_link, 311 bool direct_link,
313 struct hard_iface *if_incoming, 312 struct hard_iface *if_incoming,
314 int own_packet) 313 int own_packet)
315{ 314{
316 struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 315 struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
317 struct forw_packet *forw_packet_aggr; 316 struct forw_packet *forw_packet_aggr;
@@ -386,9 +385,9 @@ out:
386} 385}
387 386
388/* aggregate a new packet into the existing ogm packet */ 387/* aggregate a new packet into the existing ogm packet */
389static void bat_ogm_aggregate(struct forw_packet *forw_packet_aggr, 388static void bat_iv_ogm_aggregate(struct forw_packet *forw_packet_aggr,
390 const unsigned char *packet_buff, 389 const unsigned char *packet_buff,
391 int packet_len, bool direct_link) 390 int packet_len, bool direct_link)
392{ 391{
393 unsigned char *skb_buff; 392 unsigned char *skb_buff;
394 393
@@ -403,10 +402,10 @@ static void bat_ogm_aggregate(struct forw_packet *forw_packet_aggr,
403 (1 << forw_packet_aggr->num_packets); 402 (1 << forw_packet_aggr->num_packets);
404} 403}
405 404
406static void bat_ogm_queue_add(struct bat_priv *bat_priv, 405static void bat_iv_ogm_queue_add(struct bat_priv *bat_priv,
407 unsigned char *packet_buff, 406 unsigned char *packet_buff,
408 int packet_len, struct hard_iface *if_incoming, 407 int packet_len, struct hard_iface *if_incoming,
409 int own_packet, unsigned long send_time) 408 int own_packet, unsigned long send_time)
410{ 409{
411 /** 410 /**
412 * _aggr -> pointer to the packet we want to aggregate with 411 * _aggr -> pointer to the packet we want to aggregate with
@@ -426,11 +425,11 @@ static void bat_ogm_queue_add(struct bat_priv *bat_priv,
426 if ((atomic_read(&bat_priv->aggregated_ogms)) && (!own_packet)) { 425 if ((atomic_read(&bat_priv->aggregated_ogms)) && (!own_packet)) {
427 hlist_for_each_entry(forw_packet_pos, tmp_node, 426 hlist_for_each_entry(forw_packet_pos, tmp_node,
428 &bat_priv->forw_bat_list, list) { 427 &bat_priv->forw_bat_list, list) {
429 if (bat_ogm_can_aggregate(batman_ogm_packet, 428 if (bat_iv_ogm_can_aggregate(batman_ogm_packet,
430 bat_priv, packet_len, 429 bat_priv, packet_len,
431 send_time, direct_link, 430 send_time, direct_link,
432 if_incoming, 431 if_incoming,
433 forw_packet_pos)) { 432 forw_packet_pos)) {
434 forw_packet_aggr = forw_packet_pos; 433 forw_packet_aggr = forw_packet_pos;
435 break; 434 break;
436 } 435 }
@@ -452,20 +451,20 @@ static void bat_ogm_queue_add(struct bat_priv *bat_priv,
452 (atomic_read(&bat_priv->aggregated_ogms))) 451 (atomic_read(&bat_priv->aggregated_ogms)))
453 send_time += msecs_to_jiffies(MAX_AGGREGATION_MS); 452 send_time += msecs_to_jiffies(MAX_AGGREGATION_MS);
454 453
455 bat_ogm_aggregate_new(packet_buff, packet_len, 454 bat_iv_ogm_aggregate_new(packet_buff, packet_len,
456 send_time, direct_link, 455 send_time, direct_link,
457 if_incoming, own_packet); 456 if_incoming, own_packet);
458 } else { 457 } else {
459 bat_ogm_aggregate(forw_packet_aggr, packet_buff, packet_len, 458 bat_iv_ogm_aggregate(forw_packet_aggr, packet_buff,
460 direct_link); 459 packet_len, direct_link);
461 spin_unlock_bh(&bat_priv->forw_bat_list_lock); 460 spin_unlock_bh(&bat_priv->forw_bat_list_lock);
462 } 461 }
463} 462}
464 463
465static void bat_ogm_forward(struct orig_node *orig_node, 464static void bat_iv_ogm_forward(struct orig_node *orig_node,
466 const struct ethhdr *ethhdr, 465 const struct ethhdr *ethhdr,
467 struct batman_ogm_packet *batman_ogm_packet, 466 struct batman_ogm_packet *batman_ogm_packet,
468 int directlink, struct hard_iface *if_incoming) 467 int directlink, struct hard_iface *if_incoming)
469{ 468{
470 struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 469 struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
471 struct neigh_node *router; 470 struct neigh_node *router;
@@ -524,12 +523,13 @@ static void bat_ogm_forward(struct orig_node *orig_node,
524 else 523 else
525 batman_ogm_packet->flags &= ~DIRECTLINK; 524 batman_ogm_packet->flags &= ~DIRECTLINK;
526 525
527 bat_ogm_queue_add(bat_priv, (unsigned char *)batman_ogm_packet, 526 bat_iv_ogm_queue_add(bat_priv, (unsigned char *)batman_ogm_packet,
528 BATMAN_OGM_LEN + tt_len(tt_num_changes), 527 BATMAN_OGM_LEN + tt_len(tt_num_changes),
529 if_incoming, 0, bat_ogm_fwd_send_time()); 528 if_incoming, 0, bat_iv_ogm_fwd_send_time());
530} 529}
531 530
532void bat_ogm_schedule(struct hard_iface *hard_iface, int tt_num_changes) 531static void bat_iv_ogm_schedule(struct hard_iface *hard_iface,
532 int tt_num_changes)
533{ 533{
534 struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 534 struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
535 struct batman_ogm_packet *batman_ogm_packet; 535 struct batman_ogm_packet *batman_ogm_packet;
@@ -566,21 +566,22 @@ void bat_ogm_schedule(struct hard_iface *hard_iface, int tt_num_changes)
566 atomic_inc(&hard_iface->seqno); 566 atomic_inc(&hard_iface->seqno);
567 567
568 slide_own_bcast_window(hard_iface); 568 slide_own_bcast_window(hard_iface);
569 bat_ogm_queue_add(bat_priv, hard_iface->packet_buff, 569 bat_iv_ogm_queue_add(bat_priv, hard_iface->packet_buff,
570 hard_iface->packet_len, hard_iface, 1, 570 hard_iface->packet_len, hard_iface, 1,
571 bat_ogm_emit_send_time(bat_priv)); 571 bat_iv_ogm_emit_send_time(bat_priv));
572 572
573 if (primary_if) 573 if (primary_if)
574 hardif_free_ref(primary_if); 574 hardif_free_ref(primary_if);
575} 575}
576 576
577static void bat_ogm_orig_update(struct bat_priv *bat_priv, 577static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
578 struct orig_node *orig_node, 578 struct orig_node *orig_node,
579 const struct ethhdr *ethhdr, 579 const struct ethhdr *ethhdr,
580 const struct batman_ogm_packet 580 const struct batman_ogm_packet
581 *batman_ogm_packet, 581 *batman_ogm_packet,
582 struct hard_iface *if_incoming, 582 struct hard_iface *if_incoming,
583 const unsigned char *tt_buff, int is_duplicate) 583 const unsigned char *tt_buff,
584 int is_duplicate)
584{ 585{
585 struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; 586 struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL;
586 struct neigh_node *router = NULL; 587 struct neigh_node *router = NULL;
@@ -715,10 +716,10 @@ out:
715 neigh_node_free_ref(router); 716 neigh_node_free_ref(router);
716} 717}
717 718
718static int bat_ogm_calc_tq(struct orig_node *orig_node, 719static int bat_iv_ogm_calc_tq(struct orig_node *orig_node,
719 struct orig_node *orig_neigh_node, 720 struct orig_node *orig_neigh_node,
720 struct batman_ogm_packet *batman_ogm_packet, 721 struct batman_ogm_packet *batman_ogm_packet,
721 struct hard_iface *if_incoming) 722 struct hard_iface *if_incoming)
722{ 723{
723 struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 724 struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
724 struct neigh_node *neigh_node = NULL, *tmp_neigh_node; 725 struct neigh_node *neigh_node = NULL, *tmp_neigh_node;
@@ -827,10 +828,10 @@ out:
827 * -1 the packet is old and has been received while the seqno window 828 * -1 the packet is old and has been received while the seqno window
828 * was protected. Caller should drop it. 829 * was protected. Caller should drop it.
829 */ 830 */
830static int bat_ogm_update_seqnos(const struct ethhdr *ethhdr, 831static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
831 const struct batman_ogm_packet 832 const struct batman_ogm_packet
832 *batman_ogm_packet, 833 *batman_ogm_packet,
833 const struct hard_iface *if_incoming) 834 const struct hard_iface *if_incoming)
834{ 835{
835 struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 836 struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
836 struct orig_node *orig_node; 837 struct orig_node *orig_node;
@@ -892,10 +893,10 @@ out:
892 return ret; 893 return ret;
893} 894}
894 895
895static void bat_ogm_process(const struct ethhdr *ethhdr, 896static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
896 struct batman_ogm_packet *batman_ogm_packet, 897 struct batman_ogm_packet *batman_ogm_packet,
897 const unsigned char *tt_buff, 898 const unsigned char *tt_buff,
898 struct hard_iface *if_incoming) 899 struct hard_iface *if_incoming)
899{ 900{
900 struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 901 struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
901 struct hard_iface *hard_iface; 902 struct hard_iface *hard_iface;
@@ -1033,8 +1034,8 @@ static void bat_ogm_process(const struct ethhdr *ethhdr,
1033 if (!orig_node) 1034 if (!orig_node)
1034 return; 1035 return;
1035 1036
1036 is_duplicate = bat_ogm_update_seqnos(ethhdr, batman_ogm_packet, 1037 is_duplicate = bat_iv_ogm_update_seqnos(ethhdr, batman_ogm_packet,
1037 if_incoming); 1038 if_incoming);
1038 1039
1039 if (is_duplicate == -1) { 1040 if (is_duplicate == -1) {
1040 bat_dbg(DBG_BATMAN, bat_priv, 1041 bat_dbg(DBG_BATMAN, bat_priv,
@@ -1083,8 +1084,8 @@ static void bat_ogm_process(const struct ethhdr *ethhdr,
1083 goto out_neigh; 1084 goto out_neigh;
1084 } 1085 }
1085 1086
1086 is_bidirectional = bat_ogm_calc_tq(orig_node, orig_neigh_node, 1087 is_bidirectional = bat_iv_ogm_calc_tq(orig_node, orig_neigh_node,
1087 batman_ogm_packet, if_incoming); 1088 batman_ogm_packet, if_incoming);
1088 1089
1089 bonding_save_primary(orig_node, orig_neigh_node, batman_ogm_packet); 1090 bonding_save_primary(orig_node, orig_neigh_node, batman_ogm_packet);
1090 1091
@@ -1094,16 +1095,16 @@ static void bat_ogm_process(const struct ethhdr *ethhdr,
1094 (!is_duplicate || 1095 (!is_duplicate ||
1095 ((orig_node->last_real_seqno == batman_ogm_packet->seqno) && 1096 ((orig_node->last_real_seqno == batman_ogm_packet->seqno) &&
1096 (orig_node->last_ttl - 3 <= batman_ogm_packet->header.ttl)))) 1097 (orig_node->last_ttl - 3 <= batman_ogm_packet->header.ttl))))
1097 bat_ogm_orig_update(bat_priv, orig_node, ethhdr, 1098 bat_iv_ogm_orig_update(bat_priv, orig_node, ethhdr,
1098 batman_ogm_packet, if_incoming, 1099 batman_ogm_packet, if_incoming,
1099 tt_buff, is_duplicate); 1100 tt_buff, is_duplicate);
1100 1101
1101 /* is single hop (direct) neighbor */ 1102 /* is single hop (direct) neighbor */
1102 if (is_single_hop_neigh) { 1103 if (is_single_hop_neigh) {
1103 1104
1104 /* mark direct link on incoming interface */ 1105 /* mark direct link on incoming interface */
1105 bat_ogm_forward(orig_node, ethhdr, batman_ogm_packet, 1106 bat_iv_ogm_forward(orig_node, ethhdr, batman_ogm_packet,
1106 1, if_incoming); 1107 1, if_incoming);
1107 1108
1108 bat_dbg(DBG_BATMAN, bat_priv, "Forwarding packet: " 1109 bat_dbg(DBG_BATMAN, bat_priv, "Forwarding packet: "
1109 "rebroadcast neighbor packet with direct link flag\n"); 1110 "rebroadcast neighbor packet with direct link flag\n");
@@ -1125,7 +1126,8 @@ static void bat_ogm_process(const struct ethhdr *ethhdr,
1125 1126
1126 bat_dbg(DBG_BATMAN, bat_priv, 1127 bat_dbg(DBG_BATMAN, bat_priv,
1127 "Forwarding packet: rebroadcast originator packet\n"); 1128 "Forwarding packet: rebroadcast originator packet\n");
1128 bat_ogm_forward(orig_node, ethhdr, batman_ogm_packet, 0, if_incoming); 1129 bat_iv_ogm_forward(orig_node, ethhdr, batman_ogm_packet,
1130 0, if_incoming);
1129 1131
1130out_neigh: 1132out_neigh:
1131 if ((orig_neigh_node) && (!is_single_hop_neigh)) 1133 if ((orig_neigh_node) && (!is_single_hop_neigh))
@@ -1141,7 +1143,8 @@ out:
1141 orig_node_free_ref(orig_node); 1143 orig_node_free_ref(orig_node);
1142} 1144}
1143 1145
1144void bat_ogm_receive(struct hard_iface *if_incoming, struct sk_buff *skb) 1146static void bat_iv_ogm_receive(struct hard_iface *if_incoming,
1147 struct sk_buff *skb)
1145{ 1148{
1146 struct batman_ogm_packet *batman_ogm_packet; 1149 struct batman_ogm_packet *batman_ogm_packet;
1147 struct ethhdr *ethhdr; 1150 struct ethhdr *ethhdr;
@@ -1162,20 +1165,26 @@ void bat_ogm_receive(struct hard_iface *if_incoming, struct sk_buff *skb)
1162 1165
1163 tt_buff = packet_buff + buff_pos + BATMAN_OGM_LEN; 1166 tt_buff = packet_buff + buff_pos + BATMAN_OGM_LEN;
1164 1167
1165 bat_ogm_process(ethhdr, batman_ogm_packet, 1168 bat_iv_ogm_process(ethhdr, batman_ogm_packet,
1166 tt_buff, if_incoming); 1169 tt_buff, if_incoming);
1167 1170
1168 buff_pos += BATMAN_OGM_LEN + 1171 buff_pos += BATMAN_OGM_LEN +
1169 tt_len(batman_ogm_packet->tt_num_changes); 1172 tt_len(batman_ogm_packet->tt_num_changes);
1170 1173
1171 batman_ogm_packet = (struct batman_ogm_packet *) 1174 batman_ogm_packet = (struct batman_ogm_packet *)
1172 (packet_buff + buff_pos); 1175 (packet_buff + buff_pos);
1173 } while (bat_ogm_aggr_packet(buff_pos, packet_len, 1176 } while (bat_iv_ogm_aggr_packet(buff_pos, packet_len,
1174 batman_ogm_packet->tt_num_changes)); 1177 batman_ogm_packet->tt_num_changes));
1175} 1178}
1176 1179
1177static struct bat_algo_ops batman_iv __read_mostly = { 1180static struct bat_algo_ops batman_iv __read_mostly = {
1178 .name = "BATMAN IV", 1181 .name = "BATMAN IV",
1182 .bat_ogm_init = bat_iv_ogm_init,
1183 .bat_ogm_init_primary = bat_iv_ogm_init_primary,
1184 .bat_ogm_update_mac = bat_iv_ogm_update_mac,
1185 .bat_ogm_schedule = bat_iv_ogm_schedule,
1186 .bat_ogm_emit = bat_iv_ogm_emit,
1187 .bat_ogm_receive = bat_iv_ogm_receive,
1179}; 1188};
1180 1189
1181int __init bat_iv_init(void) 1190int __init bat_iv_init(void)