Skip to content

Commit

Permalink
batman-adv: agglomerate all batman iv ogm processing functions in a s…
Browse files Browse the repository at this point in the history
…ingle file

In preparation of the upcoming improved routing algorithm the code based has
to be re-organized to allow choosing the routing algorithm at compile time.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
  • Loading branch information
Marek Lindner committed Sep 8, 2011
1 parent b6da4bf commit fc95727
Show file tree
Hide file tree
Showing 9 changed files with 698 additions and 634 deletions.
1 change: 1 addition & 0 deletions net/batman-adv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
obj-$(CONFIG_BATMAN_ADV) += batman-adv.o
batman-adv-y += aggregation.o
batman-adv-y += bat_debugfs.o
batman-adv-y += bat_iv_ogm.o
batman-adv-y += bat_sysfs.o
batman-adv-y += bitarray.o
batman-adv-y += gateway_client.o
Expand Down
31 changes: 0 additions & 31 deletions net/batman-adv/aggregation.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,34 +264,3 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv,
spin_unlock_bh(&bat_priv->forw_bat_list_lock);
}
}

/* unpack the aggregated packets and process them one by one */
void receive_aggr_bat_packet(const struct ethhdr *ethhdr,
unsigned char *packet_buff, int packet_len,
struct hard_iface *if_incoming)
{
struct batman_ogm_packet *batman_ogm_packet;
int buff_pos = 0;
unsigned char *tt_buff;

batman_ogm_packet = (struct batman_ogm_packet *)packet_buff;

do {
/* network to host order for our 32bit seqno and the
orig_interval */
batman_ogm_packet->seqno = ntohl(batman_ogm_packet->seqno);
batman_ogm_packet->tt_crc = ntohs(batman_ogm_packet->tt_crc);

tt_buff = packet_buff + buff_pos + BATMAN_OGM_LEN;

receive_bat_packet(ethhdr, batman_ogm_packet,
tt_buff, if_incoming);

buff_pos += BATMAN_OGM_LEN +
tt_len(batman_ogm_packet->tt_num_changes);

batman_ogm_packet = (struct batman_ogm_packet *)
(packet_buff + buff_pos);
} while (aggregated_packet(buff_pos, packet_len,
batman_ogm_packet->tt_num_changes));
}
3 changes: 0 additions & 3 deletions net/batman-adv/aggregation.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,5 @@ void add_bat_packet_to_list(struct bat_priv *bat_priv,
unsigned char *packet_buff, int packet_len,
struct hard_iface *if_incoming, int own_packet,
unsigned long send_time);
void receive_aggr_bat_packet(const struct ethhdr *ethhdr,
unsigned char *packet_buff, int packet_len,
struct hard_iface *if_incoming);

#endif /* _NET_BATMAN_ADV_AGGREGATION_H_ */
Loading

0 comments on commit fc95727

Please sign in to comment.