aboutsummaryrefslogtreecommitdiffstats
path: root/packet-aodv.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-08-22 07:32:22 +0000
committerGuy Harris <guy@alum.mit.edu>2002-08-22 07:32:22 +0000
commit90e83c9238f510f09721bdbefbef7c49045486be (patch)
tree0bc3b46858b89918cff028348974391d39d7925c /packet-aodv.c
parent99e286d8a321ee185dfa24c9544ba46c58a31dc2 (diff)
From Andy Hood: in the AODV6 dissector, rename "ext_t" to "aodv6_ext_t",
as "ext_t" is defined by a system header file on AIX. Get rid of the bitfields in "struct aodv_rrep" and "rrep_t", as some compilers don't allow any type other than "int" or "unsigned int" for bitfields (so "guint8" won't work), and as there's no guarantee of the order of bitfields in a structure. Make "rreq", "rrep", and "rerr" local to "dissect_aodv()" and "dissect_aodv6()", as they're not used outside them. Add a protocol tree item for the prefix size field in AODV and AODV6 replies. svn path=/trunk/; revision=6060
Diffstat (limited to 'packet-aodv.c')
-rw-r--r--packet-aodv.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/packet-aodv.c b/packet-aodv.c
index 9b1ce4d6b6..4b893eff05 100644
--- a/packet-aodv.c
+++ b/packet-aodv.c
@@ -2,7 +2,7 @@
* Routines for AODV dissection
* Copyright 2000, Erik Nordström <erik.nordstrom@it.uu.se>
*
- * $Id: packet-aodv.c,v 1.4 2002/08/21 21:25:23 tpot Exp $
+ * $Id: packet-aodv.c,v 1.5 2002/08/22 07:32:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -73,8 +73,7 @@ struct aodv_rreq {
struct aodv_rrep {
guint8 type;
guint8 flags;
- guint8 res2:3;
- guint8 prefix:5;
+ guint8 prefix_sz;
guint8 hop_count;
guint32 dest_addr;
guint32 dest_seqno;
@@ -91,14 +90,11 @@ struct aodv_rerr {
guint32 dest_seqno;
};
-static struct aodv_rreq rreq;
-static struct aodv_rrep rrep;
-static struct aodv_rerr rerr;
-
/* Initialize the protocol and registered fields */
static int proto_aodv = -1;
static int hf_aodv_type = -1;
static int hf_aodv_flags = -1;
+static int hf_aodv_prefix_sz = -1;
static int hf_aodv_hopcount = -1;
static int hf_aodv_rreq_id = -1;
static int hf_aodv_dest_ip = -1;
@@ -130,6 +126,9 @@ dissect_aodv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*aodv_unreach_dest_tree = NULL;
guint8 type;
int i;
+ struct aodv_rreq rreq;
+ struct aodv_rrep rrep;
+ struct aodv_rerr rerr;
/* Make entries in Protocol column and Info column on summary display */
if (check_col(pinfo->cinfo, COL_PROTOCOL))
@@ -204,6 +203,7 @@ dissect_aodv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case RREP:
rrep.type = type;
rrep.flags = tvb_get_guint8(tvb, 1);
+ rrep.prefix_sz = tvb_get_guint8(tvb, 2) & 0x1F;
rrep.hop_count = tvb_get_guint8(tvb, 3);
tvb_memcpy(tvb, (guint8 *)&rrep.dest_addr, 4, 4);
rrep.dest_seqno = tvb_get_ntohl(tvb, 8);
@@ -217,6 +217,7 @@ dissect_aodv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_append_text(tj, " R");
if (rrep.flags & RREP_ACK)
proto_item_append_text(tj, " A");
+ proto_tree_add_uint(aodv_tree, hf_aodv_prefix_sz, tvb, 3, 1, rrep.prefix_sz);
proto_tree_add_uint(aodv_tree, hf_aodv_hopcount, tvb, 3, 1, rrep.hop_count);
proto_tree_add_ipv4(aodv_tree, hf_aodv_dest_ip, tvb, 4, 4, rrep.dest_addr);
proto_tree_add_uint(aodv_tree, hf_aodv_dest_seqno, tvb, 8, 4, rrep.dest_seqno);
@@ -317,6 +318,11 @@ proto_register_aodv(void)
FT_BOOLEAN, 8, TFS(&flags_set_truth), RERR_NODEL,
"", HFILL }
},
+ { &hf_aodv_prefix_sz,
+ { "Prefix Size", "aodv.prefix_sz",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "Prefix_size", HFILL }
+ },
{ &hf_aodv_hopcount,
{ "Hop Count", "aodv.hopcount",
FT_UINT8, BASE_DEC, NULL, 0x0,