Ethereal-dev: Re: [Ethereal-dev] How can I submit a modified file?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "SHINGO HORISAWA" <name4n5@xxxxxxxxxxx>
Date: Sun, 21 Nov 2004 18:29:51 +0900
I made a patch.

Changes are as follows:

o added D & U flags to RREQ.
o fixed a bug about "Unreachable Destination" in RERR.
o changed a tree about AODV information.
 (AODV was displayed in the same level as root tree now.)

The patch Bart Braem submitted before me may be the same as my patch about D & U flags...

Regards.

------------------
Shingo HORISAWA

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ --- ethereal-0.10.7/epan/dissectors/packet-aodv.c 2004-10-21 07:35:00.000000000 +0900 +++ ethereal-0.10.7/epan/dissectors/packet-aodv.c 2004-11-21 17:52:59.288037112 +0900
@@ -73,6 +73,8 @@
#define RREQ_GRAT	0x20
#define RREQ_REP	0x40
#define RREQ_JOIN	0x80
+#define RREQ_DESTONLY 0x10
+#define RREQ_UNKNOWN 0x08

#define RREP_ACK_REQ	0x40
#define RREP_REP	0x80
@@ -80,15 +82,15 @@
#define RERR_NODEL	0x80

static const value_string type_vals[] = {
-    { RREQ,                 "Route Request" },
-    { RREP,                 "Route Reply" },
-    { RERR,                 "Route Error" },
-    { RREP_ACK,             "Route Reply Acknowledgment"},
-    { DRAFT_01_V6_RREQ,     "draft-perkins-aodv6-01 Route Request"},
-    { DRAFT_01_V6_RREP,     "draft-perkins-aodv6-01 Route Reply"},
-    { DRAFT_01_V6_RERR,     "draft-perkins-aodv6-01 Route Error"},
- { DRAFT_01_V6_RREP_ACK, "draft-perkins-aodv6-01 Route Reply Acknowledgment"},
-    { 0,                    NULL }
+    { RREQ,			"Route Request" },
+    { RREP,			"Route Reply" },
+    { RERR,			"Route Error" },
+    { RREP_ACK,		"Route Reply Acknowledgment"},
+    { DRAFT_01_V6_RREQ,		"IPv6 Route Request"},
+    { DRAFT_01_V6_RREP,		"IPv6 Route Reply"},
+    { DRAFT_01_V6_RERR,		"IPv6 Route Error"},
+    { DRAFT_01_V6_RREP_ACK,	"IPv6 Route Reply Acknowledgment"},
+    { 0,			NULL }
};

static const value_string exttype_vals[] = {
@@ -124,6 +126,8 @@
static int hf_aodv_flags_rreq_join = -1;
static int hf_aodv_flags_rreq_repair = -1;
static int hf_aodv_flags_rreq_gratuitous = -1;
+static int hf_aodv_flags_rreq_destonly = -1;
+static int hf_aodv_flags_rreq_unknown = -1;
static int hf_aodv_flags_rrep_repair = -1;
static int hf_aodv_flags_rrep_ack = -1;
static int hf_aodv_flags_rerr_nodelete = -1;
@@ -227,12 +231,20 @@
			       tvb, offset, 1, flags);
	proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_gratuitous,
			       tvb, offset, 1, flags);
+	proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_destonly,
+			       tvb, offset, 1, flags);
+	proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_unknown,
+			       tvb, offset, 1, flags);
	if (flags & RREQ_JOIN)
	    proto_item_append_text(tj, " J");
	if (flags & RREQ_REP)
	    proto_item_append_text(tj, " R");
	if (flags & RREQ_GRAT)
	    proto_item_append_text(tj, " G");
+	if (flags & RREQ_DESTONLY)
+	    proto_item_append_text(tj, " D");
+	if (flags & RREQ_UNKNOWN)
+	    proto_item_append_text(tj, " U");
    }
    offset += 2;	/* skip reserved byte */

@@ -500,9 +512,10 @@
	for (i = 0; i < dest_count; i++) {
	    proto_tree_add_item(aodv_unreach_dest_tree, hf_aodv_unreach_dest_ip,
				tvb, offset, 4, FALSE);
+	    offset += 4;
	    proto_tree_add_item(aodv_unreach_dest_tree, hf_aodv_dest_seqno,
				tvb, offset, 4, FALSE);
-	    offset += 4 + 4;
+	    offset += 4;
	}
    }
}
@@ -533,12 +546,20 @@
			       tvb, offset, 1, flags);
	proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_gratuitous,
			       tvb, offset, 1, flags);
+	proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_destonly,
+			       tvb, offset, 1, flags);
+	proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_unknown,
+			       tvb, offset, 1, flags);
	if (flags & RREQ_JOIN)
	    proto_item_append_text(tj, " J");
	if (flags & RREQ_REP)
	    proto_item_append_text(tj, " R");
	if (flags & RREQ_GRAT)
	    proto_item_append_text(tj, " G");
+	if (flags & RREQ_DESTONLY)
+	    proto_item_append_text(tj, " D");
+	if (flags & RREQ_UNKNOWN)
+	    proto_item_append_text(tj, " U");
    }
    offset += 2;	/* skip reserved byte */

@@ -633,7 +654,7 @@
    }
    offset += 1;

-    prefix_sz = tvb_get_guint8(tvb, offset) & 0x1F;
+    prefix_sz = tvb_get_guint8(tvb, offset) & 0x7F;
    if (aodv_tree)
	proto_tree_add_uint(aodv_tree, hf_aodv_prefix_sz, tvb, offset, 1,
			    prefix_sz);
@@ -667,11 +688,11 @@
    if (aodv_tree) {
	proto_tree_add_ipv6(aodv_tree, hf_aodv_orig_ipv6, tvb, offset,
			    INET6_ADDRLEN, (guint8 *)&orig_addr_v6);
-	proto_item_append_text(ti, ", Dest IP: %s",
+	proto_item_append_text(ti, ", Orig IP: %s",
			       ip6_to_str(&orig_addr_v6));
    }
    if (check_col(pinfo->cinfo, COL_INFO))
-	col_append_fstr(pinfo->cinfo, COL_INFO, ", D: %s",
+	col_append_fstr(pinfo->cinfo, COL_INFO, ", O: %s",
			ip6_to_str(&orig_addr_v6));
    offset += INET6_ADDRLEN;

@@ -734,10 +755,11 @@
    for (i = 0; i < dest_count; i++) {
	proto_tree_add_item(aodv_unreach_dest_tree, hf_aodv_dest_seqno,
			    tvb, offset, 4, FALSE);
+	offset += 4;
	proto_tree_add_item(aodv_unreach_dest_tree,
			    hf_aodv_unreach_dest_ipv6,
			    tvb, offset, INET6_ADDRLEN, FALSE);
-	offset += 4 + INET6_ADDRLEN;
+	offset += INET6_ADDRLEN;
    }
}

@@ -783,24 +805,24 @@

    switch (type) {
    case RREQ:
-	dissect_aodv_rreq(tvb, pinfo, tree, ti, is_ipv6);
+	dissect_aodv_rreq(tvb, pinfo, aodv_tree, ti, is_ipv6);
	break;
    case RREP:
-	dissect_aodv_rrep(tvb, pinfo, tree, ti, is_ipv6);
+	dissect_aodv_rrep(tvb, pinfo, aodv_tree, ti, is_ipv6);
	break;
    case RERR:
-	dissect_aodv_rerr(tvb, pinfo, tree, is_ipv6);
+	dissect_aodv_rerr(tvb, pinfo, aodv_tree, is_ipv6);
	break;
    case RREP_ACK:
	break;
    case DRAFT_01_V6_RREQ:
-	dissect_aodv_draft_01_v6_rreq(tvb, pinfo, tree, ti);
+	dissect_aodv_draft_01_v6_rreq(tvb, pinfo, aodv_tree, ti);
	break;
    case DRAFT_01_V6_RREP:
-	dissect_aodv_draft_01_v6_rrep(tvb, pinfo, tree, ti);
+	dissect_aodv_draft_01_v6_rrep(tvb, pinfo, aodv_tree, ti);
	break;
    case DRAFT_01_V6_RERR:
-	dissect_aodv_draft_01_v6_rerr(tvb, pinfo, tree);
+	dissect_aodv_draft_01_v6_rerr(tvb, pinfo, aodv_tree);
	break;
    case DRAFT_01_V6_RREP_ACK:
	break;
@@ -843,6 +865,16 @@
	    FT_BOOLEAN, 8, TFS(&flags_set_truth), RREQ_GRAT,
	    "", HFILL }
	},
+	{ &hf_aodv_flags_rreq_destonly,
+	  { "RREQ Destination Only", "aodv.flags.rreq_destonly",
+	    FT_BOOLEAN, 8, TFS(&flags_set_truth), RREQ_DESTONLY,
+	    "", HFILL }
+	},
+	{ &hf_aodv_flags_rreq_unknown,
+	  { "RREQ Unknown Sequence Number", "aodv.flags.rreq_unknown",
+	    FT_BOOLEAN, 8, TFS(&flags_set_truth), RREQ_UNKNOWN,
+	    "", HFILL }
+	},
	{ &hf_aodv_flags_rrep_repair,
	  { "RREP Repair", "aodv.flags.rrep_repair",
	    FT_BOOLEAN, 8, TFS(&flags_set_truth), RREP_REP,