2002-04-25 23:35:52 +00:00
|
|
|
/* packet-aodv.c
|
|
|
|
* Routines for AODV dissection
|
2009-03-16 10:14:44 +00:00
|
|
|
* Copyright 2000, Erik Nordstrom <erik.nordstrom@it.uu.se>
|
2002-04-25 23:35:52 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2002-04-25 23:35:52 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2002-04-25 23:35:52 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2002-04-25 23:35:52 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2002-04-25 23:35:52 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2003-04-30 23:21:19 +00:00
|
|
|
#ifdef HAVE_STDDEF_H
|
|
|
|
#include <stddef.h>
|
|
|
|
#endif
|
2002-04-25 23:35:52 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
2003-04-30 23:21:19 +00:00
|
|
|
|
|
|
|
#ifndef offsetof
|
|
|
|
#define offsetof(type, member) ((size_t)(&((type *)0)->member))
|
|
|
|
#endif
|
2002-04-25 23:35:52 +00:00
|
|
|
|
2003-04-30 23:21:19 +00:00
|
|
|
/*
|
|
|
|
* See
|
|
|
|
*
|
2004-11-21 21:05:16 +00:00
|
|
|
* RFC 3561 (which indicates that, for IPv6, the only change is that
|
|
|
|
* the address fields are enlarged)
|
2003-04-30 23:21:19 +00:00
|
|
|
*
|
|
|
|
* http://www.cs.ucsb.edu/~ebelding/txt/aodv6.txt
|
|
|
|
*
|
|
|
|
* http://www.tcs.hut.fi/~anttit/manet/drafts/draft-perkins-aodv6-01.txt
|
2004-11-21 21:05:16 +00:00
|
|
|
*
|
|
|
|
* (both of the above two are draft-perkins-manet-aodv6-01.txt, which
|
|
|
|
* is from November 2000)
|
2003-04-30 23:21:19 +00:00
|
|
|
*/
|
2002-04-25 23:35:52 +00:00
|
|
|
|
2003-04-30 23:21:19 +00:00
|
|
|
#define INET6_ADDRLEN 16
|
|
|
|
#define UDP_PORT_AODV 654
|
|
|
|
|
|
|
|
/* Message Types */
|
2003-09-13 00:57:10 +00:00
|
|
|
#define RREQ 1
|
|
|
|
#define RREP 2
|
|
|
|
#define RERR 3
|
|
|
|
#define RREP_ACK 4
|
|
|
|
#define DRAFT_01_V6_RREQ 16
|
|
|
|
#define DRAFT_01_V6_RREP 17
|
|
|
|
#define DRAFT_01_V6_RERR 18
|
|
|
|
#define DRAFT_01_V6_RREP_ACK 19
|
2003-04-30 23:21:19 +00:00
|
|
|
|
|
|
|
/* Extension Types */
|
2003-07-09 03:59:59 +00:00
|
|
|
#define AODV_EXT 1
|
|
|
|
#define AODV_EXT_INT 2
|
|
|
|
#define AODV_EXT_NTP 3
|
2002-04-25 23:35:52 +00:00
|
|
|
|
|
|
|
/* Flag bits: */
|
2004-11-21 21:05:16 +00:00
|
|
|
#define RREQ_UNKNSEQ 0x08
|
|
|
|
#define RREQ_DESTONLY 0x10
|
|
|
|
#define RREQ_GRATRREP 0x20
|
2003-09-12 22:52:22 +00:00
|
|
|
#define RREQ_REP 0x40
|
|
|
|
#define RREQ_JOIN 0x80
|
2002-04-25 23:35:52 +00:00
|
|
|
|
2003-09-12 22:52:22 +00:00
|
|
|
#define RREP_ACK_REQ 0x40
|
|
|
|
#define RREP_REP 0x80
|
2002-04-25 23:35:52 +00:00
|
|
|
|
2003-09-12 22:52:22 +00:00
|
|
|
#define RERR_NODEL 0x80
|
2002-04-25 23:35:52 +00:00
|
|
|
|
|
|
|
static const value_string type_vals[] = {
|
2003-09-13 00:57:10 +00:00
|
|
|
{ RREQ, "Route Request" },
|
|
|
|
{ RREP, "Route Reply" },
|
|
|
|
{ RERR, "Route Error" },
|
|
|
|
{ RREP_ACK, "Route Reply Acknowledgment"},
|
2004-11-21 21:05:16 +00:00
|
|
|
{ DRAFT_01_V6_RREQ, "draft-perkins-manet-aodv6-01 IPv6 Route Request"},
|
|
|
|
{ DRAFT_01_V6_RREP, "draft-perkins-manet-aodv6-01 IPv6 Route Reply"},
|
|
|
|
{ DRAFT_01_V6_RERR, "draft-perkins-manet-aodv6-01 IPv6 Route Error"},
|
|
|
|
{ DRAFT_01_V6_RREP_ACK, "draft-perkins-manet-aodv6-01 IPv6 Route Reply Acknowledgment"},
|
2003-09-13 00:57:10 +00:00
|
|
|
{ 0, NULL }
|
2003-04-30 23:21:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string exttype_vals[] = {
|
2003-07-09 03:59:59 +00:00
|
|
|
{ AODV_EXT, "None"},
|
|
|
|
{ AODV_EXT_INT, "Hello Interval"},
|
|
|
|
{ AODV_EXT_NTP, "Timestamp"},
|
|
|
|
{ 0, NULL}
|
2002-04-25 23:35:52 +00:00
|
|
|
};
|
|
|
|
|
2003-04-30 23:21:19 +00:00
|
|
|
typedef struct v6_ext {
|
|
|
|
guint8 type;
|
|
|
|
guint8 length;
|
2003-07-09 03:59:59 +00:00
|
|
|
} aodv_ext_t;
|
2003-04-30 23:21:19 +00:00
|
|
|
|
2002-04-25 23:35:52 +00:00
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_aodv = -1;
|
|
|
|
static int hf_aodv_type = -1;
|
|
|
|
static int hf_aodv_flags = -1;
|
2002-08-22 07:32:22 +00:00
|
|
|
static int hf_aodv_prefix_sz = -1;
|
2002-04-25 23:35:52 +00:00
|
|
|
static int hf_aodv_hopcount = -1;
|
|
|
|
static int hf_aodv_rreq_id = -1;
|
|
|
|
static int hf_aodv_dest_ip = -1;
|
2003-04-30 23:21:19 +00:00
|
|
|
static int hf_aodv_dest_ipv6 = -1;
|
2002-04-25 23:35:52 +00:00
|
|
|
static int hf_aodv_dest_seqno = -1;
|
|
|
|
static int hf_aodv_orig_ip = -1;
|
2003-04-30 23:21:19 +00:00
|
|
|
static int hf_aodv_orig_ipv6 = -1;
|
2002-04-25 23:35:52 +00:00
|
|
|
static int hf_aodv_orig_seqno = -1;
|
|
|
|
static int hf_aodv_lifetime = -1;
|
|
|
|
static int hf_aodv_destcount = -1;
|
|
|
|
static int hf_aodv_unreach_dest_ip = -1;
|
2003-04-30 23:21:19 +00:00
|
|
|
static int hf_aodv_unreach_dest_ipv6 = -1;
|
2002-04-25 23:35:52 +00:00
|
|
|
static int hf_aodv_unreach_dest_seqno = -1;
|
|
|
|
static int hf_aodv_flags_rreq_join = -1;
|
|
|
|
static int hf_aodv_flags_rreq_repair = -1;
|
|
|
|
static int hf_aodv_flags_rreq_gratuitous = -1;
|
2004-11-21 03:21:02 +00:00
|
|
|
static int hf_aodv_flags_rreq_destinationonly = -1;
|
2004-11-21 21:05:16 +00:00
|
|
|
static int hf_aodv_flags_rreq_unknown = -1;
|
2002-04-25 23:35:52 +00:00
|
|
|
static int hf_aodv_flags_rrep_repair = -1;
|
|
|
|
static int hf_aodv_flags_rrep_ack = -1;
|
|
|
|
static int hf_aodv_flags_rerr_nodelete = -1;
|
2003-04-30 23:21:19 +00:00
|
|
|
static int hf_aodv_ext_type = -1;
|
|
|
|
static int hf_aodv_ext_length = -1;
|
|
|
|
static int hf_aodv_ext_interval = -1;
|
|
|
|
static int hf_aodv_ext_timestamp = -1;
|
2002-04-25 23:35:52 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
static gint ett_aodv = -1;
|
|
|
|
static gint ett_aodv_flags = -1;
|
|
|
|
static gint ett_aodv_unreach_dest = -1;
|
2003-04-30 23:21:19 +00:00
|
|
|
static gint ett_aodv_extensions = -1;
|
2002-04-25 23:35:52 +00:00
|
|
|
|
|
|
|
/* Code to actually dissect the packets */
|
2003-04-30 23:21:19 +00:00
|
|
|
|
|
|
|
static void
|
2003-07-09 03:59:59 +00:00
|
|
|
dissect_aodv_ext(tvbuff_t * tvb, int offset, proto_tree * tree)
|
2003-04-30 23:21:19 +00:00
|
|
|
{
|
2003-07-09 03:59:59 +00:00
|
|
|
proto_tree *ext_tree;
|
2003-04-30 23:21:19 +00:00
|
|
|
proto_item *ti;
|
2009-04-22 03:07:37 +00:00
|
|
|
guint8 type, len;
|
2003-04-30 23:21:19 +00:00
|
|
|
|
|
|
|
if (!tree)
|
|
|
|
return;
|
|
|
|
|
|
|
|
again:
|
|
|
|
if ((int) tvb_reported_length(tvb) <= offset)
|
|
|
|
return; /* No more options left */
|
|
|
|
|
2009-04-22 03:07:37 +00:00
|
|
|
type = tvb_get_guint8(tvb, offset);
|
|
|
|
len = tvb_get_guint8(tvb, offset + 1);
|
2003-04-30 23:21:19 +00:00
|
|
|
|
2009-04-22 03:07:37 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, 2 + len, "Extensions");
|
2003-07-09 03:59:59 +00:00
|
|
|
ext_tree = proto_item_add_subtree(ti, ett_aodv_extensions);
|
2003-04-30 23:21:19 +00:00
|
|
|
|
2009-04-22 03:07:37 +00:00
|
|
|
proto_tree_add_text(ext_tree, tvb, offset, 1,
|
|
|
|
"Type: %u (%s)", type,
|
|
|
|
val_to_str(type, exttype_vals, "Unknown"));
|
|
|
|
|
2003-04-30 23:21:19 +00:00
|
|
|
if (len == 0) {
|
2009-04-22 03:07:37 +00:00
|
|
|
proto_tree_add_text(ext_tree, tvb, offset + 1, 1,
|
|
|
|
"Invalid option length: %u", len);
|
2003-04-30 23:21:19 +00:00
|
|
|
return; /* we must not try to decode this */
|
|
|
|
}
|
2009-04-22 03:07:37 +00:00
|
|
|
proto_tree_add_text(ext_tree, tvb, offset + 1, 1,
|
|
|
|
"Length: %u bytes", len);
|
2003-04-30 23:21:19 +00:00
|
|
|
|
2009-04-22 03:07:37 +00:00
|
|
|
offset += 2;
|
2003-04-30 23:21:19 +00:00
|
|
|
|
2009-04-22 03:07:37 +00:00
|
|
|
switch (type) {
|
2003-07-09 03:59:59 +00:00
|
|
|
case AODV_EXT_INT:
|
|
|
|
proto_tree_add_uint(ext_tree, hf_aodv_ext_interval,
|
2003-04-30 23:21:19 +00:00
|
|
|
tvb, offset, 4, tvb_get_ntohl(tvb, offset));
|
|
|
|
break;
|
2003-07-09 03:59:59 +00:00
|
|
|
case AODV_EXT_NTP:
|
|
|
|
proto_tree_add_item(ext_tree, hf_aodv_ext_timestamp,
|
2003-04-30 23:21:19 +00:00
|
|
|
tvb, offset, 8, FALSE);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* If multifield extensions appear, we need more
|
|
|
|
* sophisticated handler. For now, this is okay. */
|
|
|
|
|
2009-04-22 03:07:37 +00:00
|
|
|
offset += len;
|
2003-04-30 23:21:19 +00:00
|
|
|
goto again;
|
|
|
|
}
|
|
|
|
|
2003-09-12 22:52:22 +00:00
|
|
|
static void
|
|
|
|
dissect_aodv_rreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aodv_tree,
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_item *ti, gboolean is_ipv6)
|
2002-04-25 23:35:52 +00:00
|
|
|
{
|
2003-09-13 00:57:10 +00:00
|
|
|
int offset = 1;
|
2003-09-12 22:52:22 +00:00
|
|
|
proto_item *tj;
|
|
|
|
proto_tree *aodv_flags_tree;
|
2003-04-30 23:21:19 +00:00
|
|
|
guint8 flags;
|
2003-09-13 00:57:10 +00:00
|
|
|
guint8 hop_count;
|
|
|
|
guint32 rreq_id;
|
|
|
|
guint32 dest_addr_v4;
|
|
|
|
struct e_in6_addr dest_addr_v6;
|
|
|
|
guint32 dest_seqno;
|
|
|
|
guint32 orig_addr_v4;
|
|
|
|
struct e_in6_addr orig_addr_v6;
|
|
|
|
guint32 orig_seqno;
|
2003-09-12 22:52:22 +00:00
|
|
|
int extlen;
|
|
|
|
|
2003-09-13 00:57:10 +00:00
|
|
|
flags = tvb_get_guint8(tvb, offset);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (aodv_tree) {
|
2003-09-13 00:57:10 +00:00
|
|
|
tj = proto_tree_add_text(aodv_tree, tvb, offset, 1, "Flags:");
|
2003-09-12 22:52:22 +00:00
|
|
|
aodv_flags_tree = proto_item_add_subtree(tj, ett_aodv_flags);
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_join,
|
|
|
|
tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_repair,
|
|
|
|
tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_gratuitous,
|
|
|
|
tvb, offset, 1, flags);
|
2004-11-21 03:21:02 +00:00
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_destinationonly,
|
|
|
|
tvb, offset, 1, flags);
|
2004-11-21 21:05:16 +00:00
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_unknown,
|
|
|
|
tvb, offset, 1, flags);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (flags & RREQ_JOIN)
|
|
|
|
proto_item_append_text(tj, " J");
|
|
|
|
if (flags & RREQ_REP)
|
|
|
|
proto_item_append_text(tj, " R");
|
2004-11-21 21:05:16 +00:00
|
|
|
if (flags & RREQ_GRATRREP)
|
2003-09-12 22:52:22 +00:00
|
|
|
proto_item_append_text(tj, " G");
|
2004-11-21 21:05:16 +00:00
|
|
|
if (flags & RREQ_DESTONLY)
|
2004-11-21 03:21:02 +00:00
|
|
|
proto_item_append_text(tj, " D");
|
2004-11-21 21:05:16 +00:00
|
|
|
if (flags & RREQ_UNKNSEQ)
|
|
|
|
proto_item_append_text(tj, " U");
|
2003-09-13 00:57:10 +00:00
|
|
|
}
|
|
|
|
offset += 2; /* skip reserved byte */
|
|
|
|
|
|
|
|
hop_count = tvb_get_guint8(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_hopcount, tvb, offset, 1,
|
|
|
|
hop_count);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
rreq_id = tvb_get_ntohl(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_rreq_id, tvb, offset, 4,
|
|
|
|
rreq_id);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
if (is_ipv6) {
|
2005-09-11 21:25:37 +00:00
|
|
|
tvb_get_ipv6(tvb, offset, &dest_addr_v6);
|
2003-09-13 00:57:10 +00:00
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_ipv6(aodv_tree, hf_aodv_dest_ipv6, tvb, offset,
|
|
|
|
INET6_ADDRLEN, (guint8 *)&dest_addr_v6);
|
|
|
|
proto_item_append_text(ti, ", Dest IP: %s",
|
|
|
|
ip6_to_str(&dest_addr_v6));
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", D: %s",
|
|
|
|
ip6_to_str(&dest_addr_v6));
|
|
|
|
offset += INET6_ADDRLEN;
|
|
|
|
} else {
|
2005-09-11 21:25:37 +00:00
|
|
|
dest_addr_v4 = tvb_get_ipv4(tvb, offset);
|
2003-09-13 00:57:10 +00:00
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_ipv4(aodv_tree, hf_aodv_dest_ip, tvb, offset, 4,
|
|
|
|
dest_addr_v4);
|
|
|
|
proto_item_append_text(ti, ", Dest IP: %s",
|
|
|
|
ip_to_str((guint8 *)&dest_addr_v4));
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", D: %s",
|
|
|
|
ip_to_str((guint8 *)&dest_addr_v4));
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
dest_seqno = tvb_get_ntohl(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_dest_seqno, tvb, offset, 4,
|
|
|
|
dest_seqno);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
if (is_ipv6) {
|
2005-09-11 21:25:37 +00:00
|
|
|
tvb_get_ipv6(tvb, offset, &orig_addr_v6);
|
2003-09-13 00:57:10 +00:00
|
|
|
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, ", Orig IP: %s",
|
|
|
|
ip6_to_str(&orig_addr_v6));
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", O: %s",
|
|
|
|
ip6_to_str(&orig_addr_v6));
|
|
|
|
offset += INET6_ADDRLEN;
|
|
|
|
} else {
|
2005-09-11 21:25:37 +00:00
|
|
|
orig_addr_v4 = tvb_get_ipv4(tvb, offset);
|
2003-09-13 00:57:10 +00:00
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_ipv4(aodv_tree, hf_aodv_orig_ip, tvb, offset, 4,
|
|
|
|
orig_addr_v4);
|
|
|
|
proto_item_append_text(ti, ", Orig IP: %s",
|
|
|
|
ip_to_str((guint8 *)&orig_addr_v4));
|
2003-09-12 22:52:22 +00:00
|
|
|
}
|
2003-09-13 00:57:10 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", O: %s",
|
|
|
|
ip_to_str((guint8 *)&orig_addr_v4));
|
|
|
|
offset += 4;
|
2003-09-12 22:52:22 +00:00
|
|
|
}
|
|
|
|
|
2003-09-13 00:57:10 +00:00
|
|
|
orig_seqno = tvb_get_ntohl(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_orig_seqno, tvb, offset, 4,
|
|
|
|
orig_seqno);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2003-09-13 00:57:10 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " Id=%u Hcnt=%u DSN=%u OSN=%u",
|
|
|
|
rreq_id,
|
|
|
|
hop_count,
|
|
|
|
dest_seqno,
|
|
|
|
orig_seqno);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
if (aodv_tree) {
|
|
|
|
extlen = tvb_reported_length_remaining(tvb, offset);
|
|
|
|
if (extlen > 0)
|
|
|
|
dissect_aodv_ext(tvb, offset, aodv_tree);
|
|
|
|
}
|
2003-09-12 22:52:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_aodv_rrep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aodv_tree,
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_item *ti, gboolean is_ipv6)
|
2003-09-12 22:52:22 +00:00
|
|
|
{
|
2003-09-13 00:57:10 +00:00
|
|
|
int offset = 1;
|
2003-09-12 22:52:22 +00:00
|
|
|
proto_item *tj;
|
|
|
|
proto_tree *aodv_flags_tree;
|
|
|
|
guint8 flags;
|
2003-09-13 00:57:10 +00:00
|
|
|
guint8 prefix_sz;
|
|
|
|
guint8 hop_count;
|
|
|
|
guint32 dest_addr_v4;
|
|
|
|
struct e_in6_addr dest_addr_v6;
|
|
|
|
guint32 dest_seqno;
|
|
|
|
guint32 orig_addr_v4;
|
|
|
|
struct e_in6_addr orig_addr_v6;
|
|
|
|
guint32 lifetime;
|
2003-09-12 22:52:22 +00:00
|
|
|
int extlen;
|
|
|
|
|
2003-09-13 00:57:10 +00:00
|
|
|
flags = tvb_get_guint8(tvb, offset);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (aodv_tree) {
|
2003-09-13 00:57:10 +00:00
|
|
|
tj = proto_tree_add_text(aodv_tree, tvb, offset, 1, "Flags:");
|
2003-09-12 22:52:22 +00:00
|
|
|
aodv_flags_tree = proto_item_add_subtree(tj, ett_aodv_flags);
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rrep_repair,
|
|
|
|
tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rrep_ack, tvb,
|
|
|
|
offset, 1, flags);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (flags & RREP_REP)
|
|
|
|
proto_item_append_text(tj, " R");
|
|
|
|
if (flags & RREP_ACK_REQ)
|
|
|
|
proto_item_append_text(tj, " A");
|
2003-09-13 00:57:10 +00:00
|
|
|
}
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
prefix_sz = tvb_get_guint8(tvb, offset) & 0x1F;
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_prefix_sz, tvb, offset, 1,
|
|
|
|
prefix_sz);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
hop_count = tvb_get_guint8(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_hopcount, tvb, offset, 1,
|
|
|
|
hop_count);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
if (is_ipv6) {
|
2005-09-11 21:25:37 +00:00
|
|
|
tvb_get_ipv6(tvb, offset, &dest_addr_v6);
|
2003-09-13 00:57:10 +00:00
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_ipv6(aodv_tree, hf_aodv_dest_ipv6, tvb, offset,
|
|
|
|
INET6_ADDRLEN, (guint8 *)&dest_addr_v6);
|
|
|
|
proto_item_append_text(ti, ", Dest IP: %s",
|
|
|
|
ip6_to_str(&dest_addr_v6));
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", D: %s",
|
|
|
|
ip6_to_str(&dest_addr_v6));
|
|
|
|
offset += INET6_ADDRLEN;
|
|
|
|
} else {
|
2005-09-11 21:25:37 +00:00
|
|
|
dest_addr_v4 = tvb_get_ipv4(tvb, offset);
|
2003-09-13 00:57:10 +00:00
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_ipv4(aodv_tree, hf_aodv_dest_ip, tvb, offset, 4,
|
|
|
|
dest_addr_v4);
|
|
|
|
proto_item_append_text(ti, ", Dest IP: %s",
|
|
|
|
ip_to_str((guint8 *)&dest_addr_v4));
|
2003-09-12 22:52:22 +00:00
|
|
|
}
|
2003-09-13 00:57:10 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", D: %s",
|
|
|
|
ip_to_str((guint8 *)&dest_addr_v4));
|
|
|
|
offset += 4;
|
2003-09-12 22:52:22 +00:00
|
|
|
}
|
|
|
|
|
2003-09-13 00:57:10 +00:00
|
|
|
dest_seqno = tvb_get_ntohl(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_dest_seqno, tvb, offset, 4,
|
|
|
|
dest_seqno);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
if (is_ipv6) {
|
2005-09-11 21:25:37 +00:00
|
|
|
tvb_get_ipv6(tvb, offset, &orig_addr_v6);
|
2003-09-13 00:57:10 +00:00
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_ipv6(aodv_tree, hf_aodv_orig_ipv6, tvb, offset,
|
|
|
|
INET6_ADDRLEN, (guint8 *)&orig_addr_v6);
|
2004-11-21 21:05:16 +00:00
|
|
|
proto_item_append_text(ti, ", Orig IP: %s",
|
2003-09-13 00:57:10 +00:00
|
|
|
ip6_to_str(&orig_addr_v6));
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2004-11-21 21:05:16 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", O: %s",
|
2003-09-13 00:57:10 +00:00
|
|
|
ip6_to_str(&orig_addr_v6));
|
|
|
|
offset += INET6_ADDRLEN;
|
|
|
|
} else {
|
2005-09-11 21:25:37 +00:00
|
|
|
orig_addr_v4 = tvb_get_ipv4(tvb, offset);
|
2003-09-13 00:57:10 +00:00
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_ipv4(aodv_tree, hf_aodv_orig_ip, tvb, offset, 4,
|
|
|
|
orig_addr_v4);
|
|
|
|
proto_item_append_text(ti, ", Orig IP: %s",
|
|
|
|
ip_to_str((guint8 *)&orig_addr_v4));
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", O: %s",
|
|
|
|
ip_to_str((guint8 *)&orig_addr_v4));
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
lifetime = tvb_get_ntohl(tvb, offset);
|
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_lifetime, tvb, offset, 4,
|
|
|
|
lifetime);
|
|
|
|
proto_item_append_text(ti, ", Lifetime=%u", lifetime);
|
|
|
|
}
|
2003-09-12 22:52:22 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2003-09-13 00:57:10 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " Hcnt=%u DSN=%u Lifetime=%u",
|
|
|
|
hop_count,
|
|
|
|
dest_seqno,
|
|
|
|
lifetime);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
if (aodv_tree) {
|
|
|
|
extlen = tvb_reported_length_remaining(tvb, offset);
|
|
|
|
if (extlen > 0)
|
|
|
|
dissect_aodv_ext(tvb, offset, aodv_tree);
|
|
|
|
}
|
2003-09-12 22:52:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-09-13 00:57:10 +00:00
|
|
|
dissect_aodv_rerr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aodv_tree,
|
|
|
|
gboolean is_ipv6)
|
2003-09-12 22:52:22 +00:00
|
|
|
{
|
2003-09-13 00:57:10 +00:00
|
|
|
int offset = 1;
|
2003-09-12 22:52:22 +00:00
|
|
|
proto_item *tj;
|
|
|
|
proto_tree *aodv_flags_tree;
|
|
|
|
proto_tree *aodv_unreach_dest_tree;
|
|
|
|
guint8 flags;
|
2003-09-13 00:57:10 +00:00
|
|
|
guint8 dest_count;
|
2003-09-12 22:52:22 +00:00
|
|
|
int i;
|
|
|
|
|
2003-09-13 00:57:10 +00:00
|
|
|
flags = tvb_get_guint8(tvb, offset);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (aodv_tree) {
|
2003-09-13 00:57:10 +00:00
|
|
|
tj = proto_tree_add_text(aodv_tree, tvb, offset, 1, "Flags:");
|
2003-09-12 22:52:22 +00:00
|
|
|
aodv_flags_tree = proto_item_add_subtree(tj, ett_aodv_flags);
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rerr_nodelete,
|
|
|
|
tvb, offset, 1, flags);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (flags & RERR_NODEL)
|
|
|
|
proto_item_append_text(tj, " N");
|
|
|
|
}
|
2003-09-13 00:57:10 +00:00
|
|
|
offset += 2; /* skip reserved byte */
|
2003-09-12 22:52:22 +00:00
|
|
|
|
2003-09-13 00:57:10 +00:00
|
|
|
dest_count = tvb_get_guint8(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_destcount, tvb, offset, 1,
|
|
|
|
dest_count);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", Dest Count=%u",
|
2003-09-13 00:57:10 +00:00
|
|
|
dest_count);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
if (is_ipv6) {
|
|
|
|
tj = proto_tree_add_text(aodv_tree, tvb, offset,
|
|
|
|
(INET6_ADDRLEN + 4)*dest_count,
|
|
|
|
"Unreachable Destinations");
|
|
|
|
aodv_unreach_dest_tree = proto_item_add_subtree(tj, ett_aodv_unreach_dest);
|
|
|
|
for (i = 0; i < dest_count; i++) {
|
|
|
|
proto_tree_add_item(aodv_unreach_dest_tree,
|
|
|
|
hf_aodv_unreach_dest_ipv6,
|
|
|
|
tvb, offset, INET6_ADDRLEN, FALSE);
|
2004-11-21 21:05:16 +00:00
|
|
|
offset += INET6_ADDRLEN;
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_tree_add_item(aodv_unreach_dest_tree, hf_aodv_dest_seqno,
|
|
|
|
tvb, offset, 4, FALSE);
|
2004-11-21 21:05:16 +00:00
|
|
|
offset += 4;
|
2003-09-13 00:57:10 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
tj = proto_tree_add_text(aodv_tree, tvb, offset, (4 + 4)*dest_count,
|
|
|
|
"Unreachable Destinations");
|
|
|
|
aodv_unreach_dest_tree = proto_item_add_subtree(tj, ett_aodv_unreach_dest);
|
|
|
|
for (i = 0; i < dest_count; i++) {
|
|
|
|
proto_tree_add_item(aodv_unreach_dest_tree, hf_aodv_unreach_dest_ip,
|
|
|
|
tvb, offset, 4, FALSE);
|
2004-11-21 21:05:16 +00:00
|
|
|
offset += 4;
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_tree_add_item(aodv_unreach_dest_tree, hf_aodv_dest_seqno,
|
|
|
|
tvb, offset, 4, FALSE);
|
2004-11-21 21:05:16 +00:00
|
|
|
offset += 4;
|
2003-09-13 00:57:10 +00:00
|
|
|
}
|
|
|
|
}
|
2003-09-12 22:52:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-09-13 00:57:10 +00:00
|
|
|
dissect_aodv_draft_01_v6_rreq(tvbuff_t *tvb, packet_info *pinfo,
|
|
|
|
proto_tree *aodv_tree, proto_item *ti)
|
2003-09-12 22:52:22 +00:00
|
|
|
{
|
2003-09-13 00:57:10 +00:00
|
|
|
int offset = 1;
|
2003-09-12 22:52:22 +00:00
|
|
|
proto_item *tj;
|
|
|
|
proto_tree *aodv_flags_tree;
|
|
|
|
guint8 flags;
|
2003-09-13 00:57:10 +00:00
|
|
|
guint8 hop_count;
|
|
|
|
guint32 rreq_id;
|
|
|
|
guint32 dest_seqno;
|
|
|
|
guint32 orig_seqno;
|
|
|
|
struct e_in6_addr dest_addr_v6;
|
|
|
|
struct e_in6_addr orig_addr_v6;
|
2003-09-12 22:52:22 +00:00
|
|
|
int extlen;
|
|
|
|
|
2003-09-13 00:57:10 +00:00
|
|
|
flags = tvb_get_guint8(tvb, offset);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (aodv_tree) {
|
2003-09-13 00:57:10 +00:00
|
|
|
tj = proto_tree_add_text(aodv_tree, tvb, offset, 1, "Flags:");
|
2003-09-12 22:52:22 +00:00
|
|
|
aodv_flags_tree = proto_item_add_subtree(tj, ett_aodv_flags);
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_join,
|
|
|
|
tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_repair,
|
|
|
|
tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_gratuitous,
|
|
|
|
tvb, offset, 1, flags);
|
2004-11-21 03:21:02 +00:00
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_destinationonly,
|
|
|
|
tvb, offset, 1, flags);
|
2004-11-21 21:05:16 +00:00
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rreq_unknown,
|
|
|
|
tvb, offset, 1, flags);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (flags & RREQ_JOIN)
|
|
|
|
proto_item_append_text(tj, " J");
|
|
|
|
if (flags & RREQ_REP)
|
|
|
|
proto_item_append_text(tj, " R");
|
2004-11-21 21:05:16 +00:00
|
|
|
if (flags & RREQ_GRATRREP)
|
2003-09-12 22:52:22 +00:00
|
|
|
proto_item_append_text(tj, " G");
|
2004-11-21 21:05:16 +00:00
|
|
|
if (flags & RREQ_DESTONLY)
|
2004-11-21 03:21:02 +00:00
|
|
|
proto_item_append_text(tj, " D");
|
2004-11-21 21:05:16 +00:00
|
|
|
if (flags & RREQ_UNKNSEQ)
|
|
|
|
proto_item_append_text(tj, " U");
|
2003-09-12 22:52:22 +00:00
|
|
|
}
|
2003-09-13 00:57:10 +00:00
|
|
|
offset += 2; /* skip reserved byte */
|
|
|
|
|
|
|
|
hop_count = tvb_get_guint8(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_hopcount, tvb, offset, 1,
|
|
|
|
hop_count);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
rreq_id = tvb_get_ntohl(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_rreq_id, tvb, offset, 4,
|
|
|
|
rreq_id);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
dest_seqno = tvb_get_ntohl(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_dest_seqno, tvb, offset, 4,
|
|
|
|
dest_seqno);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
orig_seqno = tvb_get_ntohl(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_orig_seqno, tvb, offset, 4,
|
|
|
|
orig_seqno);
|
|
|
|
offset += 4;
|
|
|
|
|
2005-09-11 21:25:37 +00:00
|
|
|
tvb_get_ipv6(tvb, offset, &dest_addr_v6);
|
2003-09-13 00:57:10 +00:00
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_ipv6(aodv_tree, hf_aodv_dest_ipv6, tvb, offset,
|
|
|
|
INET6_ADDRLEN, (guint8 *)&dest_addr_v6);
|
|
|
|
proto_item_append_text(ti, ", Dest IP: %s",
|
|
|
|
ip6_to_str(&dest_addr_v6));
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", D: %s",
|
|
|
|
ip6_to_str(&dest_addr_v6));
|
|
|
|
offset += INET6_ADDRLEN;
|
2003-09-12 22:52:22 +00:00
|
|
|
|
2005-09-11 21:25:37 +00:00
|
|
|
tvb_get_ipv6(tvb, offset, &orig_addr_v6);
|
2003-09-13 00:57:10 +00:00
|
|
|
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, ", Orig IP: %s",
|
|
|
|
ip6_to_str(&orig_addr_v6));
|
|
|
|
}
|
2003-09-12 22:52:22 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO,
|
2003-09-13 00:57:10 +00:00
|
|
|
", O: %s Id=%u Hcnt=%u DSN=%u OSN=%u",
|
|
|
|
ip6_to_str(&orig_addr_v6),
|
|
|
|
rreq_id,
|
|
|
|
hop_count,
|
|
|
|
dest_seqno,
|
|
|
|
orig_seqno);
|
|
|
|
offset += INET6_ADDRLEN;
|
|
|
|
|
|
|
|
if (aodv_tree) {
|
|
|
|
extlen = tvb_reported_length_remaining(tvb, offset);
|
|
|
|
if (extlen > 0)
|
|
|
|
dissect_aodv_ext(tvb, offset, aodv_tree);
|
|
|
|
}
|
2003-09-12 22:52:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-09-13 00:57:10 +00:00
|
|
|
dissect_aodv_draft_01_v6_rrep(tvbuff_t *tvb, packet_info *pinfo,
|
|
|
|
proto_tree *aodv_tree, proto_item *ti)
|
2003-09-12 22:52:22 +00:00
|
|
|
{
|
2003-09-13 00:57:10 +00:00
|
|
|
int offset = 1;
|
2003-09-12 22:52:22 +00:00
|
|
|
proto_item *tj;
|
|
|
|
proto_tree *aodv_flags_tree;
|
|
|
|
guint8 flags;
|
2003-09-13 00:57:10 +00:00
|
|
|
guint8 prefix_sz;
|
|
|
|
guint8 hop_count;
|
|
|
|
guint32 dest_seqno;
|
|
|
|
struct e_in6_addr dest_addr_v6;
|
|
|
|
struct e_in6_addr orig_addr_v6;
|
|
|
|
guint32 lifetime;
|
2003-09-12 22:52:22 +00:00
|
|
|
int extlen;
|
|
|
|
|
2003-09-13 00:57:10 +00:00
|
|
|
flags = tvb_get_guint8(tvb, offset);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (aodv_tree) {
|
2003-09-13 00:57:10 +00:00
|
|
|
tj = proto_tree_add_text(aodv_tree, tvb, offset, 1, "Flags:");
|
2003-09-12 22:52:22 +00:00
|
|
|
aodv_flags_tree = proto_item_add_subtree(tj, ett_aodv_flags);
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rrep_repair,
|
|
|
|
tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rrep_ack, tvb,
|
|
|
|
offset, 1, flags);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (flags & RREP_REP)
|
|
|
|
proto_item_append_text(tj, " R");
|
|
|
|
if (flags & RREP_ACK_REQ)
|
|
|
|
proto_item_append_text(tj, " A");
|
|
|
|
}
|
2003-09-13 00:57:10 +00:00
|
|
|
offset += 1;
|
|
|
|
|
2004-11-21 21:05:16 +00:00
|
|
|
prefix_sz = tvb_get_guint8(tvb, offset) & 0x7F;
|
2003-09-13 00:57:10 +00:00
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_prefix_sz, tvb, offset, 1,
|
|
|
|
prefix_sz);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
hop_count = tvb_get_guint8(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_hopcount, tvb, offset, 1,
|
|
|
|
hop_count);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
dest_seqno = tvb_get_ntohl(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_dest_seqno, tvb, offset, 4,
|
|
|
|
dest_seqno);
|
|
|
|
offset += 4;
|
|
|
|
|
2005-09-11 21:25:37 +00:00
|
|
|
tvb_get_ipv6(tvb, offset, &dest_addr_v6);
|
2003-09-13 00:57:10 +00:00
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_ipv6(aodv_tree, hf_aodv_dest_ipv6, tvb, offset,
|
|
|
|
INET6_ADDRLEN, (guint8 *)&dest_addr_v6);
|
|
|
|
proto_item_append_text(ti, ", Dest IP: %s",
|
|
|
|
ip6_to_str(&dest_addr_v6));
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", D: %s",
|
|
|
|
ip6_to_str(&dest_addr_v6));
|
|
|
|
offset += INET6_ADDRLEN;
|
2003-09-12 22:52:22 +00:00
|
|
|
|
2005-09-11 21:25:37 +00:00
|
|
|
tvb_get_ipv6(tvb, offset, &orig_addr_v6);
|
2003-09-13 00:57:10 +00:00
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_ipv6(aodv_tree, hf_aodv_orig_ipv6, tvb, offset,
|
|
|
|
INET6_ADDRLEN, (guint8 *)&orig_addr_v6);
|
2004-11-21 21:05:16 +00:00
|
|
|
proto_item_append_text(ti, ", Orig IP: %s",
|
2003-09-13 00:57:10 +00:00
|
|
|
ip6_to_str(&orig_addr_v6));
|
|
|
|
}
|
2003-09-12 22:52:22 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2004-11-21 21:05:16 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", O: %s",
|
2003-09-13 00:57:10 +00:00
|
|
|
ip6_to_str(&orig_addr_v6));
|
|
|
|
offset += INET6_ADDRLEN;
|
|
|
|
|
|
|
|
lifetime = tvb_get_ntohl(tvb, offset);
|
|
|
|
if (aodv_tree) {
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_lifetime, tvb, offset, 4,
|
|
|
|
lifetime);
|
|
|
|
proto_item_append_text(ti, ", Lifetime=%u", lifetime);
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " Hcnt=%u DSN=%u Lifetime=%u",
|
|
|
|
hop_count,
|
|
|
|
dest_seqno,
|
|
|
|
lifetime);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
if (aodv_tree) {
|
|
|
|
extlen = tvb_reported_length_remaining(tvb, offset);
|
|
|
|
if (extlen > 0)
|
|
|
|
dissect_aodv_ext(tvb, offset, aodv_tree);
|
|
|
|
}
|
2003-09-12 22:52:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-09-13 00:57:10 +00:00
|
|
|
dissect_aodv_draft_01_v6_rerr(tvbuff_t *tvb, packet_info *pinfo,
|
|
|
|
proto_tree *aodv_tree)
|
2003-09-12 22:52:22 +00:00
|
|
|
{
|
2003-09-13 00:57:10 +00:00
|
|
|
int offset = 1;
|
2003-09-12 22:52:22 +00:00
|
|
|
proto_item *tj;
|
|
|
|
proto_tree *aodv_flags_tree;
|
|
|
|
proto_tree *aodv_unreach_dest_tree;
|
|
|
|
guint8 flags;
|
2003-09-13 00:57:10 +00:00
|
|
|
guint8 dest_count;
|
2003-09-12 22:52:22 +00:00
|
|
|
int i;
|
|
|
|
|
2003-09-13 00:57:10 +00:00
|
|
|
flags = tvb_get_guint8(tvb, offset);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (aodv_tree) {
|
2003-09-13 00:57:10 +00:00
|
|
|
tj = proto_tree_add_text(aodv_tree, tvb, offset, 1, "Flags:");
|
2003-09-12 22:52:22 +00:00
|
|
|
aodv_flags_tree = proto_item_add_subtree(tj, ett_aodv_flags);
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_tree_add_boolean(aodv_flags_tree, hf_aodv_flags_rerr_nodelete,
|
|
|
|
tvb, offset, 1, flags);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (flags & RERR_NODEL)
|
|
|
|
proto_item_append_text(tj, " N");
|
|
|
|
}
|
2003-09-13 00:57:10 +00:00
|
|
|
offset += 2; /* skip reserved byte */
|
2003-09-12 22:52:22 +00:00
|
|
|
|
2003-09-13 00:57:10 +00:00
|
|
|
dest_count = tvb_get_guint8(tvb, offset);
|
|
|
|
if (aodv_tree)
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_destcount, tvb, offset, 1,
|
|
|
|
dest_count);
|
2003-09-12 22:52:22 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", Dest Count=%u",
|
2003-09-13 00:57:10 +00:00
|
|
|
dest_count);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
tj = proto_tree_add_text(aodv_tree, tvb, offset,
|
|
|
|
(4 + INET6_ADDRLEN)*dest_count,
|
|
|
|
"Unreachable Destinations");
|
|
|
|
aodv_unreach_dest_tree = proto_item_add_subtree(tj, ett_aodv_unreach_dest);
|
|
|
|
for (i = 0; i < dest_count; i++) {
|
|
|
|
proto_tree_add_item(aodv_unreach_dest_tree, hf_aodv_dest_seqno,
|
|
|
|
tvb, offset, 4, FALSE);
|
2004-11-21 21:05:16 +00:00
|
|
|
offset += 4;
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_tree_add_item(aodv_unreach_dest_tree,
|
|
|
|
hf_aodv_unreach_dest_ipv6,
|
|
|
|
tvb, offset, INET6_ADDRLEN, FALSE);
|
2004-11-21 21:05:16 +00:00
|
|
|
offset += INET6_ADDRLEN;
|
2003-09-13 00:57:10 +00:00
|
|
|
}
|
2003-09-12 22:52:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_aodv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *ti = NULL;
|
|
|
|
proto_tree *aodv_tree = NULL;
|
|
|
|
gboolean is_ipv6;
|
|
|
|
guint8 type;
|
2002-04-28 20:49:51 +00:00
|
|
|
|
2002-04-25 23:35:52 +00:00
|
|
|
/* Make entries in Protocol column and Info column on summary display */
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AODV");
|
2002-04-25 23:35:52 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2002-04-25 23:35:52 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2003-09-12 22:52:22 +00:00
|
|
|
/* Is this running over IPv6? */
|
|
|
|
is_ipv6 = (pinfo->src.type == AT_IPv6);
|
|
|
|
|
2002-04-28 20:49:51 +00:00
|
|
|
/* Check the type of AODV packet. */
|
2002-04-25 23:35:52 +00:00
|
|
|
type = tvb_get_guint8(tvb, 0);
|
2003-04-30 23:21:19 +00:00
|
|
|
if (match_strval(type, type_vals) == NULL) {
|
2002-04-28 20:49:51 +00:00
|
|
|
/*
|
|
|
|
* We assume this is not an AODV packet.
|
|
|
|
*/
|
|
|
|
return 0;
|
2002-04-25 23:35:52 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2003-09-12 22:52:22 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2007-10-15 20:44:03 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
2003-09-12 22:52:22 +00:00
|
|
|
val_to_str(type, type_vals,
|
|
|
|
"Unknown AODV Packet Type (%u)"));
|
2002-04-25 23:35:52 +00:00
|
|
|
if (tree) {
|
2002-04-28 20:49:51 +00:00
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_aodv, tvb, 0, -1,
|
|
|
|
"Ad hoc On-demand Distance Vector Routing Protocol, %s",
|
|
|
|
val_to_str(type, type_vals, "Unknown AODV Packet Type (%u)"));
|
2002-04-25 23:35:52 +00:00
|
|
|
aodv_tree = proto_item_add_subtree(ti, ett_aodv);
|
2002-04-28 20:49:51 +00:00
|
|
|
|
|
|
|
proto_tree_add_uint(aodv_tree, hf_aodv_type, tvb, 0, 1, type);
|
2002-04-25 23:35:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
case RREQ:
|
2004-11-21 21:05:16 +00:00
|
|
|
dissect_aodv_rreq(tvb, pinfo, aodv_tree, ti, is_ipv6);
|
2002-04-25 23:35:52 +00:00
|
|
|
break;
|
|
|
|
case RREP:
|
2004-11-21 21:05:16 +00:00
|
|
|
dissect_aodv_rrep(tvb, pinfo, aodv_tree, ti, is_ipv6);
|
2002-04-25 23:35:52 +00:00
|
|
|
break;
|
|
|
|
case RERR:
|
2004-11-21 21:05:16 +00:00
|
|
|
dissect_aodv_rerr(tvb, pinfo, aodv_tree, is_ipv6);
|
2003-09-13 00:57:10 +00:00
|
|
|
break;
|
|
|
|
case RREP_ACK:
|
|
|
|
break;
|
|
|
|
case DRAFT_01_V6_RREQ:
|
2004-11-21 21:05:16 +00:00
|
|
|
dissect_aodv_draft_01_v6_rreq(tvb, pinfo, aodv_tree, ti);
|
2002-04-25 23:35:52 +00:00
|
|
|
break;
|
2003-09-13 00:57:10 +00:00
|
|
|
case DRAFT_01_V6_RREP:
|
2004-11-21 21:05:16 +00:00
|
|
|
dissect_aodv_draft_01_v6_rrep(tvb, pinfo, aodv_tree, ti);
|
2003-04-30 23:21:19 +00:00
|
|
|
break;
|
2003-09-13 00:57:10 +00:00
|
|
|
case DRAFT_01_V6_RERR:
|
2004-11-21 21:05:16 +00:00
|
|
|
dissect_aodv_draft_01_v6_rerr(tvb, pinfo, aodv_tree);
|
2003-04-30 23:21:19 +00:00
|
|
|
break;
|
2003-09-13 00:57:10 +00:00
|
|
|
case DRAFT_01_V6_RREP_ACK:
|
2003-04-30 23:21:19 +00:00
|
|
|
break;
|
2002-04-25 23:35:52 +00:00
|
|
|
default:
|
2003-09-13 00:57:10 +00:00
|
|
|
proto_tree_add_text(aodv_tree, tvb, 0, -1,
|
|
|
|
"Unknown AODV Packet Type (%u)", type);
|
2002-04-25 23:35:52 +00:00
|
|
|
}
|
2002-04-28 20:49:51 +00:00
|
|
|
|
|
|
|
return tvb_length(tvb);
|
2002-04-25 23:35:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-21 04:49:01 +00:00
|
|
|
/* Register the protocol with Wireshark */
|
2002-04-25 23:35:52 +00:00
|
|
|
void
|
|
|
|
proto_register_aodv(void)
|
2002-08-28 21:04:11 +00:00
|
|
|
{
|
2002-04-25 23:35:52 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_aodv_type,
|
|
|
|
{ "Type", "aodv.type",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(type_vals), 0x0,
|
2002-04-25 23:35:52 +00:00
|
|
|
"AODV packet type", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_aodv_flags,
|
|
|
|
{ "Flags", "aodv.flags",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_flags_rreq_join,
|
|
|
|
{ "RREQ Join", "aodv.flags.rreq_join",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RREQ_JOIN,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_flags_rreq_repair,
|
|
|
|
{ "RREQ Repair", "aodv.flags.rreq_repair",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RREQ_REP,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_flags_rreq_gratuitous,
|
2004-11-21 21:05:16 +00:00
|
|
|
{ "RREQ Gratuitous RREP", "aodv.flags.rreq_gratuitous",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RREQ_GRATRREP,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
2004-11-21 03:21:02 +00:00
|
|
|
{ &hf_aodv_flags_rreq_destinationonly,
|
|
|
|
{ "RREQ Destination only", "aodv.flags.rreq_destinationonly",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RREQ_DESTONLY,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-11-21 21:05:16 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_flags_rreq_unknown,
|
|
|
|
{ "RREQ Unknown Sequence Number", "aodv.flags.rreq_unknown",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RREQ_UNKNSEQ,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-11-21 03:21:02 +00:00
|
|
|
},
|
2002-04-25 23:35:52 +00:00
|
|
|
{ &hf_aodv_flags_rrep_repair,
|
|
|
|
{ "RREP Repair", "aodv.flags.rrep_repair",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RREP_REP,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_flags_rrep_ack,
|
|
|
|
{ "RREP Acknowledgement", "aodv.flags.rrep_ack",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RREP_ACK_REQ,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_flags_rerr_nodelete,
|
|
|
|
{ "RERR No Delete", "aodv.flags.rerr_nodelete",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RERR_NODEL,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
2002-08-22 07:32:22 +00:00
|
|
|
{ &hf_aodv_prefix_sz,
|
|
|
|
{ "Prefix Size", "aodv.prefix_sz",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-08-22 07:32:22 +00:00
|
|
|
},
|
2002-04-25 23:35:52 +00:00
|
|
|
{ &hf_aodv_hopcount,
|
|
|
|
{ "Hop Count", "aodv.hopcount",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_rreq_id,
|
|
|
|
{ "RREQ Id", "aodv.rreq_id",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_dest_ip,
|
|
|
|
{ "Destination IP", "aodv.dest_ip",
|
2003-04-30 23:21:19 +00:00
|
|
|
FT_IPv4, BASE_NONE, NULL, 0x0,
|
2002-04-25 23:35:52 +00:00
|
|
|
"Destination IP Address", HFILL }
|
|
|
|
},
|
2003-04-30 23:21:19 +00:00
|
|
|
{ &hf_aodv_dest_ipv6,
|
|
|
|
{ "Destination IPv6", "aodv.dest_ipv6",
|
|
|
|
FT_IPv6, BASE_NONE, NULL, 0x0,
|
|
|
|
"Destination IPv6 Address", HFILL}
|
|
|
|
},
|
2002-04-25 23:35:52 +00:00
|
|
|
{ &hf_aodv_dest_seqno,
|
|
|
|
{ "Destination Sequence Number", "aodv.dest_seqno",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_orig_ip,
|
|
|
|
{ "Originator IP", "aodv.orig_ip",
|
2003-04-30 23:21:19 +00:00
|
|
|
FT_IPv4, BASE_NONE, NULL, 0x0,
|
2002-04-25 23:35:52 +00:00
|
|
|
"Originator IP Address", HFILL }
|
|
|
|
},
|
2003-04-30 23:21:19 +00:00
|
|
|
{ &hf_aodv_orig_ipv6,
|
|
|
|
{ "Originator IPv6", "aodv.orig_ipv6",
|
|
|
|
FT_IPv6, BASE_NONE, NULL, 0x0,
|
|
|
|
"Originator IPv6 Address", HFILL}
|
|
|
|
},
|
2002-04-25 23:35:52 +00:00
|
|
|
{ &hf_aodv_orig_seqno,
|
|
|
|
{ "Originator Sequence Number", "aodv.orig_seqno",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_lifetime,
|
|
|
|
{ "Lifetime", "aodv.lifetime",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_destcount,
|
|
|
|
{ "Destination Count", "aodv.destcount",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
2002-04-25 23:35:52 +00:00
|
|
|
"Unreachable Destinations Count", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_aodv_unreach_dest_ip,
|
|
|
|
{ "Unreachable Destination IP", "aodv.unreach_dest_ip",
|
2003-04-30 23:21:19 +00:00
|
|
|
FT_IPv4, BASE_NONE, NULL, 0x0,
|
|
|
|
"Unreachable Destination IP Address", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_aodv_unreach_dest_ipv6,
|
|
|
|
{ "Unreachable Destination IPv6", "aodv.unreach_dest_ipv6",
|
|
|
|
FT_IPv6, BASE_NONE, NULL, 0x0,
|
|
|
|
"Unreachable Destination IPv6 Address", HFILL}
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
|
|
|
{ &hf_aodv_unreach_dest_seqno,
|
|
|
|
{ "Unreachable Destination Sequence Number", "aodv.unreach_dest_seqno",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2002-04-25 23:35:52 +00:00
|
|
|
},
|
2003-04-30 23:21:19 +00:00
|
|
|
{ &hf_aodv_ext_type,
|
|
|
|
{ "Extension Type", "aodv.ext_type",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"Extension Format Type", HFILL}
|
|
|
|
},
|
|
|
|
{ &hf_aodv_ext_length,
|
|
|
|
{ "Extension Length", "aodv.ext_length",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"Extension Data Length", HFILL}
|
|
|
|
},
|
|
|
|
{ &hf_aodv_ext_interval,
|
|
|
|
{ "Hello Interval", "aodv.hello_interval",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"Hello Interval Extension", HFILL}
|
|
|
|
},
|
|
|
|
{ &hf_aodv_ext_timestamp,
|
|
|
|
{ "Timestamp", "aodv.timestamp",
|
|
|
|
FT_UINT64, BASE_DEC, NULL, 0x0,
|
|
|
|
"Timestamp Extension", HFILL}
|
|
|
|
},
|
2002-04-25 23:35:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Setup protocol subtree array */
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_aodv,
|
|
|
|
&ett_aodv_flags,
|
|
|
|
&ett_aodv_unreach_dest,
|
2003-04-30 23:21:19 +00:00
|
|
|
&ett_aodv_extensions,
|
2002-04-25 23:35:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Register the protocol name and description */
|
|
|
|
proto_aodv = proto_register_protocol("Ad hoc On-demand Distance Vector Routing Protocol", "AODV", "aodv");
|
|
|
|
|
|
|
|
/* Required function calls to register the header fields and subtrees used */
|
|
|
|
proto_register_field_array(proto_aodv, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_aodv(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t aodv_handle;
|
|
|
|
|
2002-04-28 20:49:51 +00:00
|
|
|
aodv_handle = new_create_dissector_handle(dissect_aodv,
|
|
|
|
proto_aodv);
|
2002-04-25 23:35:52 +00:00
|
|
|
dissector_add("udp.port", UDP_PORT_AODV, aodv_handle);
|
|
|
|
}
|