The following commit has been merged in the next branch: commit 473d8c9f790a326db627c52fb92dbeeaabd49d6d Author: Marek Lindner lindner_marek@yahoo.de Date: Tue Feb 7 17:20:51 2012 +0800
batman-adv: mark existing ogm variables as batman iv
The coming protocol changes also will have a part called "OGM". That makes it necessary to introduce a distinction in the code base.
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
diff --git a/packet.h b/packet.h index caa12fe..db6946a 100644 --- a/packet.h +++ b/packet.h @@ -25,7 +25,7 @@ #define ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */
enum bat_packettype { - BAT_OGM = 0x01, + BAT_IV_OGM = 0x01, BAT_ICMP = 0x02, BAT_UNICAST = 0x03, BAT_BCAST = 0x04, @@ -38,7 +38,7 @@ enum bat_packettype { /* this file is included by batctl which needs these defines */ #define COMPAT_VERSION 14
-enum batman_flags { +enum batman_iv_flags { PRIMARIES_FIRST_HOP = 1 << 4, VIS_SERVER = 1 << 5, DIRECTLINK = 1 << 6 diff --git a/tcpdump.c b/tcpdump.c index b37b7ec..771e4f0 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -315,12 +315,12 @@ static void dump_batman_roam(unsigned char *packet_buff, ssize_t buff_len, int r (size_t)buff_len - sizeof(struct ether_header)); }
-static void dump_batman_ogm(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed) +static void dump_batman_iv_ogm(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed) { struct ether_header *ether_header; struct batman_ogm_packet *batman_ogm_packet;
- LEN_CHECK((size_t)buff_len - sizeof(struct ether_header), sizeof(struct batman_ogm_packet), "BAT OGM"); + LEN_CHECK((size_t)buff_len - sizeof(struct ether_header), sizeof(struct batman_ogm_packet), "BAT IV OGM");
ether_header = (struct ether_header *)packet_buff; batman_ogm_packet = (struct batman_ogm_packet *)(packet_buff + sizeof(struct ether_header)); @@ -331,7 +331,7 @@ static void dump_batman_ogm(unsigned char *packet_buff, ssize_t buff_len, int re printf("BAT %s: ", get_name_by_macaddr((struct ether_addr *)batman_ogm_packet->orig, read_opt));
- printf("OGM via neigh %s, seq %u, tq %3d, ttvn %d, ttcrc %hu, ttl %2d, v %d, flags [%c%c%c%c], length %zu\n", + printf("OGM IV via neigh %s, seq %u, tq %3d, ttvn %d, ttcrc %hu, ttl %2d, v %d, flags [%c%c%c%c], length %zu\n", get_name_by_macaddr((struct ether_addr *)ether_header->ether_shost, read_opt), ntohl(batman_ogm_packet->seqno), batman_ogm_packet->tq, batman_ogm_packet->ttvn, ntohs(batman_ogm_packet->tt_crc), batman_ogm_packet->header.ttl, batman_ogm_packet->header.version, @@ -491,9 +491,9 @@ static void parse_eth_hdr(unsigned char *packet_buff, ssize_t buff_len, int read batman_ogm_packet = (struct batman_ogm_packet *)(packet_buff + ETH_HLEN);
switch (batman_ogm_packet->header.packet_type) { - case BAT_OGM: + case BAT_IV_OGM: if (dump_level & DUMP_TYPE_BATOGM) - dump_batman_ogm(packet_buff, buff_len, read_opt, time_printed); + dump_batman_iv_ogm(packet_buff, buff_len, read_opt, time_printed); break; case BAT_ICMP: if (dump_level & DUMP_TYPE_BATICMP)