Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit f35a41365b9639fbca96867cc24bf59e48ad22d4
Author: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Date: Thu Apr 25 11:57:42 2013 +0200
batctl: remove vis functionality
This is replaced by a userspace program, we don't need this
functionality to bloat the kernel.
Signed-off-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
f35a41365b9639fbca96867cc24bf59e48ad22d4
packet.h | 21 +--------------------
tcpdump.c | 10 ++--------
tcpdump.h | 1 -
3 files changed, 3 insertions(+), 29 deletions(-)
diff --git a/packet.h b/packet.h
index aee6b96..cda77c2 100644
--- a/packet.h
+++ b/packet.h
@@ -29,7 +29,6 @@ enum batadv_packettype {
BATADV_ICMP = 0x02,
BATADV_UNICAST = 0x03,
BATADV_BCAST = 0x04,
- BATADV_VIS = 0x05,
BATADV_UNICAST_FRAG = 0x06,
BATADV_UNICAST_4ADDR = 0x09,
BATADV_CODED = 0x0a,
@@ -56,7 +55,6 @@ enum batadv_subtype {
enum batadv_iv_flags {
BATADV_NOT_BEST_NEXT_HOP = BIT(3),
BATADV_PRIMARIES_FIRST_HOP = BIT(4),
- BATADV_VIS_SERVER = BIT(5),
BATADV_DIRECTLINK = BIT(6),
};
@@ -69,12 +67,6 @@ enum batadv_icmp_packettype {
BATADV_PARAMETER_PROBLEM = 12,
};
-/* vis defines */
-enum batadv_vis_packettype {
- BATADV_VIS_TYPE_SERVER_SYNC = 0,
- BATADV_VIS_TYPE_CLIENT_UPDATE = 1,
-};
-
/* fragmentation defines */
enum batadv_unicast_frag_flags {
BATADV_UNI_FRAG_HEAD = BIT(0),
@@ -161,7 +153,7 @@ struct batadv_header {
*/
struct batadv_ogm_packet {
struct batadv_header header;
- uint8_t flags; /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
+ uint8_t flags; /* 0x40: DIRECTLINK flag ... */
__be32 seqno;
uint8_t orig[ETH_ALEN];
uint8_t prev_sender[ETH_ALEN];
@@ -257,17 +249,6 @@ struct batadv_bcast_packet {
#pragma pack()
-struct batadv_vis_packet {
- struct batadv_header header;
- uint8_t vis_type; /* which type of vis-participant sent this? */
- __be32 seqno; /* sequence number */
- uint8_t entries; /* number of entries behind this struct */
- uint8_t reserved;
- uint8_t vis_orig[ETH_ALEN]; /* originator reporting its neighbors */
- uint8_t target_orig[ETH_ALEN]; /* who should receive this packet */
- uint8_t sender_orig[ETH_ALEN]; /* who sent or forwarded this packet */
-};
-
/**
* struct batadv_coded_packet - network coded packet
* @header: common batman packet header and ttl of first included packet
diff --git a/tcpdump.c b/tcpdump.c
index 4eae324..cdc2c19 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -55,7 +55,7 @@ if ((size_t)(buff_len) < (check_len)) { \
}
static unsigned short dump_level_all = DUMP_TYPE_BATOGM | DUMP_TYPE_BATICMP | DUMP_TYPE_BATUCAST |
- DUMP_TYPE_BATBCAST | DUMP_TYPE_BATVIS | DUMP_TYPE_BATFRAG | DUMP_TYPE_NONBAT;
+ DUMP_TYPE_BATBCAST | DUMP_TYPE_BATFRAG | DUMP_TYPE_NONBAT;
static unsigned short dump_level;
static void parse_eth_hdr(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed);
@@ -74,7 +74,6 @@ static void tcpdump_usage(void)
fprintf(stderr, " \t\t%3d - batman icmp packets\n", DUMP_TYPE_BATICMP);
fprintf(stderr, " \t\t%3d - batman unicast packets\n", DUMP_TYPE_BATUCAST);
fprintf(stderr, " \t\t%3d - batman broadcast packets\n", DUMP_TYPE_BATBCAST);
- fprintf(stderr, " \t\t%3d - batman vis packets\n", DUMP_TYPE_BATVIS);
fprintf(stderr, " \t\t%3d - batman fragmented packets\n", DUMP_TYPE_BATFRAG);
fprintf(stderr, " \t\t%3d - non batman packets\n", DUMP_TYPE_NONBAT);
fprintf(stderr, " \t\t%3d - batman ogm & non batman packets\n", DUMP_TYPE_BATOGM | DUMP_TYPE_NONBAT);
@@ -340,13 +339,12 @@ static void dump_batman_iv_ogm(unsigned char *packet_buff, ssize_t buff_len, int
printf("BAT %s: ",
get_name_by_macaddr((struct ether_addr *)batman_ogm_packet->orig, read_opt));
- printf("OGM IV via neigh %s, seq %u, tq %3d, ttl %2d, v %d, flags [%c%c%c%c], length %zu\n",
+ printf("OGM IV via neigh %s, seq %u, tq %3d, ttl %2d, v %d, flags [%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->header.ttl, batman_ogm_packet->header.version,
(batman_ogm_packet->flags & BATADV_NOT_BEST_NEXT_HOP ? 'N' : '.'),
(batman_ogm_packet->flags & BATADV_DIRECTLINK ? 'D' : '.'),
- (batman_ogm_packet->flags & BATADV_VIS_SERVER ? 'V' : '.'),
(batman_ogm_packet->flags & BATADV_PRIMARIES_FIRST_HOP ? 'F' : '.'),
(size_t)buff_len - sizeof(struct ether_header));
}
@@ -549,10 +547,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_VIS:
- if (dump_level & DUMP_TYPE_BATVIS)
- fprintf(stderr, "Warning - batman vis packet received: function not implemented yet\n");
- break;
case BATADV_UNICAST_FRAG:
if (dump_level & DUMP_TYPE_BATFRAG)
dump_batman_frag(packet_buff, buff_len, read_opt, time_printed);
diff --git a/tcpdump.h b/tcpdump.h
index 7698ec7..3c6657d 100644
--- a/tcpdump.h
+++ b/tcpdump.h
@@ -36,7 +36,6 @@
#define DUMP_TYPE_BATICMP 2
#define DUMP_TYPE_BATUCAST 4
#define DUMP_TYPE_BATBCAST 8
-#define DUMP_TYPE_BATVIS 16
#define DUMP_TYPE_BATFRAG 32
#define DUMP_TYPE_NONBAT 128