* 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>
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;
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;
*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))
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);
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);
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,
* Copyright 2002, Antti J. Tuominen <ajtuomin@tml.hut.fi>
* Loosely based on packet-aodv.c.
*
- * $Id: packet-aodv6.c,v 1.3 2002/08/21 21:25:23 tpot Exp $
+ * $Id: packet-aodv6.c,v 1.4 2002/08/22 07:32:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
typedef struct aodv6_rrep {
guint8 type;
guint8 flags;
- guint8 res2:1;
- guint8 prefix:7;
+ guint8 prefix_sz;
guint8 hop_count;
guint32 dest_seqno;
struct e_in6_addr dest_addr;
typedef struct aodv6_ext {
guint8 type;
guint8 length;
-} ext_t;
-
-static rreq_t rreq;
-static rrep_t rrep;
-static rerr_t rerr;
+} aodv6_ext_t;
/* Initialize the protocol and registered fields */
static int proto_aodv6 = -1;
static int hf_aodv6_type = -1;
static int hf_aodv6_flags = -1;
+static int hf_aodv6_prefix_sz = -1;
static int hf_aodv6_hopcount = -1;
static int hf_aodv6_rreq_id = -1;
static int hf_aodv6_dest_ip = -1;
{
proto_tree *aodv6ext_tree;
proto_item *ti;
- ext_t aodv6ext, *ext;
+ aodv6_ext_t aodv6ext, *ext;
char *typename;
int len;
tvb_memcpy(tvb, (guint8 *) ext, offset, sizeof(*ext));
len = ext->length;
- ti = proto_tree_add_text(tree, tvb, offset, sizeof(ext_t) +
+ ti = proto_tree_add_text(tree, tvb, offset, sizeof(aodv6_ext_t) +
len, "AODV6 Extensions");
aodv6ext_tree = proto_item_add_subtree(ti, ett_aodv6_extensions);
if (len == 0) {
proto_tree_add_text(aodv6ext_tree, tvb,
- offset + offsetof(ext_t, length), 1,
+ offset + offsetof(aodv6_ext_t, length), 1,
"Invalid option length: %u", ext->length);
return; /* we must not try to decode this */
}
break;
}
proto_tree_add_text(aodv6ext_tree, tvb,
- offset + offsetof(ext_t, type), 1,
+ offset + offsetof(aodv6_ext_t, type), 1,
"Type: %u (%s)", ext->type, typename);
proto_tree_add_text(aodv6ext_tree, tvb,
- offset + offsetof(ext_t, length), 1,
+ offset + offsetof(aodv6_ext_t, length), 1,
"Length: %u bytes", ext->length);
- offset += sizeof(ext_t);
+ offset += sizeof(aodv6_ext_t);
switch (ext->type) {
case AODV6_EXT_INT:
*aodv6_unreach_dest_tree = NULL;
guint8 type;
int i, extlen;
+ rreq_t rreq;
+ rrep_t rrep;
+ rerr_t rerr;
/* Make entries in Protocol column and Info column on summary
* display
case AODV6_RREP:
rrep.type = type;
rrep.flags = tvb_get_guint8(tvb, offsetof(rrep_t, flags));
+ rrep.prefix_sz = tvb_get_guint8(tvb, offsetof(rrep_t, prefix_sz)) & 0x1F;
rrep.hop_count = tvb_get_guint8(tvb, offsetof(rrep_t, hop_count));
rrep.dest_seqno = tvb_get_ntohl(tvb, offsetof(rrep_t, dest_seqno));
tvb_memcpy(tvb, (guint8 *) & rrep.dest_addr,
proto_item_append_text(tj, " R");
if (rrep.flags & RREP_ACK)
proto_item_append_text(tj, " A");
+ proto_tree_add_uint(aodv6_tree, hf_aodv6_prefix_sz,
+ tvb, offsetof(rrep_t, prefix_sz), 1,
+ rrep.prefix_sz);
proto_tree_add_uint(aodv6_tree, hf_aodv6_hopcount,
tvb, offsetof(rrep_t, hop_count), 1,
rrep.hop_count);
FT_BOOLEAN, 8, TFS(&flags_set_truth), RERR_NODEL,
"", HFILL}
},
+ {&hf_aodv6_prefix_sz,
+ {"Prefix Size", "aodv6.prefix_sz",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "Prefix Size", HFILL}
+ },
{&hf_aodv6_hopcount,
{"Hop Count", "aodv6.hopcount",
FT_UINT8, BASE_DEC, NULL, 0x0,