Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit 80ef6302f59b6aa20b48317f07085c035b487a60 Author: Martin Hundebøll martin@hundeboll.net Date: Thu May 23 16:53:01 2013 +0200
batctl: Remove old fragmentation code
Remove the existing fragmentation code before adding the new version and delete unicast.{h,c}.
batadv_unicast_send_skb() is moved to send.c and renamed to batadv_send_skb_unicast().
fragmentation entry in sysfs (bat_priv->fragmentation) is kept for use in the new fragmentation code.
BATADV_UNICAST_FRAG packet type is renamed to BATADV_FRAG for use in the new fragmentation code.
Signed-off-by: Martin Hundebøll martin@hundeboll.net Signed-off-by: Marek Lindner lindner_marek@yahoo.de
80ef6302f59b6aa20b48317f07085c035b487a60 packet.h | 16 ---------------- tcpdump.c | 33 --------------------------------- 2 files changed, 49 deletions(-)
diff --git a/packet.h b/packet.h index 7d45890..96b8e57 100644 --- a/packet.h +++ b/packet.h @@ -91,12 +91,6 @@ enum batadv_icmp_packettype { BATADV_PARAMETER_PROBLEM = 12, };
-/* fragmentation defines */ -enum batadv_unicast_frag_flags { - BATADV_UNI_FRAG_HEAD = BIT(0), - BATADV_UNI_FRAG_LARGETAIL = BIT(1), -}; - /* tt data subtypes */ #define BATADV_TT_DATA_TYPE_MASK 0x0F
@@ -255,16 +249,6 @@ struct batadv_unicast_4addr_packet { */ };
-struct batadv_unicast_frag_packet { - struct batadv_header header; - uint8_t ttvn; /* destination translation table version number */ - uint8_t dest[ETH_ALEN]; - uint8_t flags; - uint8_t align; - uint8_t orig[ETH_ALEN]; - __be16 seqno; -} __packed; - struct batadv_bcast_packet { struct batadv_header header; uint8_t reserved; diff --git a/tcpdump.c b/tcpdump.c index cdc2c19..3e932cd 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -445,35 +445,6 @@ static void dump_batman_bcast(unsigned char *packet_buff, ssize_t buff_len, int read_opt, time_printed); }
-static void dump_batman_frag(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed) -{ - struct batadv_unicast_frag_packet *unicast_frag_packet; - - LEN_CHECK((size_t)buff_len - ETH_HLEN, sizeof(struct batadv_unicast_frag_packet), "BAT FRAG"); - LEN_CHECK((size_t)buff_len - ETH_HLEN - sizeof(struct batadv_unicast_frag_packet), (size_t)ETH_HLEN, "BAT FRAG (unpacked)"); - - unicast_frag_packet = (struct batadv_unicast_frag_packet *)(packet_buff + ETH_HLEN); - - if (!time_printed) - time_printed = print_time(); - - printf("BAT %s > ", - get_name_by_macaddr((struct ether_addr *)unicast_frag_packet->orig, read_opt)); - - printf("%s: FRAG, seq %hu, ttvn %d, ttl %hhu, flags [%c%c], ", - get_name_by_macaddr((struct ether_addr *)unicast_frag_packet->dest, read_opt), - ntohs(unicast_frag_packet->seqno), unicast_frag_packet->ttvn, unicast_frag_packet->header.ttl, - (unicast_frag_packet->flags & BATADV_UNI_FRAG_HEAD ? 'H' : '.'), - (unicast_frag_packet->flags & BATADV_UNI_FRAG_LARGETAIL ? 'L' : '.')); - - if (unicast_frag_packet->flags & BATADV_UNI_FRAG_HEAD) - parse_eth_hdr(packet_buff + ETH_HLEN + sizeof(struct batadv_unicast_frag_packet), - buff_len - ETH_HLEN - sizeof(struct batadv_unicast_frag_packet), - read_opt, time_printed); - else - printf("length %zu\n", (size_t)buff_len - ETH_HLEN - sizeof(struct batadv_unicast_frag_packet)); -} - static void dump_batman_4addr(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed) { struct ether_header *ether_header; @@ -547,10 +518,6 @@ static void parse_eth_hdr(unsigned char *packet_buff, ssize_t buff_len, int read if (dump_level & DUMP_TYPE_BATBCAST) dump_batman_bcast(packet_buff, buff_len, read_opt, time_printed); break; - case BATADV_UNICAST_FRAG: - if (dump_level & DUMP_TYPE_BATFRAG) - dump_batman_frag(packet_buff, buff_len, read_opt, time_printed); - break; case BATADV_UNICAST_4ADDR: if (dump_level & DUMP_TYPE_BATUCAST) dump_batman_4addr(packet_buff, buff_len, read_opt, time_printed);