From Lars Roland:
[obnox/wireshark/wip.git] / packet-dvmrp.c
index 51728ac1c3849e05708473eb30431b7ee84f8bdb..dbbb89dfb7a15fd6fe48f940f5f5f3bfffd2064f 100644 (file)
@@ -1,22 +1,22 @@
-/* packet-dvmrp.c   2001 Ronnie Sahlberg <rsahlber@bigpond.net.au>
+/* packet-dvmrp.c   2001 Ronnie Sahlberg <See AUTHORS for email>
  * Routines for IGMP/DVMRP packet disassembly
  *
- * $Id: packet-dvmrp.c,v 1.1 2001/06/12 06:21:55 guy Exp $
+ * $Id: packet-dvmrp.c,v 1.14 2003/11/16 23:17:17 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * 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.
- * 
+ *
  * 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.
- * 
+ *
  * 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.
@@ -43,7 +43,7 @@
        RFC1075 Version 1
        draft-ietf-idmr-dvmrp-v3-10.txt Version 3
 
-       V1 and V3 can be distinguished by looking at bytes 6 and 7 in the 
+       V1 and V3 can be distinguished by looking at bytes 6 and 7 in the
        IGMP/DVMRP header.
        If header[6]==0xff and header[7]==0x03 we have version 3.
 
 # include "config.h"
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
 #include <stdio.h>
 #include <string.h>
 #include <glib.h>
 
-#include "packet.h"
+#include <epan/packet.h>
 #include "ipproto.h"
-#include "in_cksum.h"
+#include "packet-igmp.h"
 #include "packet-dvmrp.h"
 
 static int proto_dvmrp = -1;
@@ -97,7 +93,6 @@ static int hf_cap_netmask = -1;
 static int hf_min_ver = -1;
 static int hf_maj_ver = -1;
 static int hf_genid = -1;
-static int hf_naddr = -1;
 static int hf_route = -1;
 static int hf_saddr = -1;
 static int hf_life = -1;
@@ -123,22 +118,30 @@ static const value_string code_v1[] = {
        {DVMRP_V1_RESPONSE,                     "Response"                      },
        {DVMRP_V1_REQUEST,                      "Request"                       },
        {DVMRP_V1_NON_MEMBERSHIP_REPORT,        "Non-membership report"         },
-       {DVMRP_V1_NON_MEMBERSHIP_CANCELLATION,  "Non-membership cancellation"   },      
+       {DVMRP_V1_NON_MEMBERSHIP_CANCELLATION,  "Non-membership cancellation"   },
        {0,                                     NULL}
 };
 
-#define DVMRP_V3_PROBE                         1
-#define DVMRP_V3_REPORT                                2
-#define DVMRP_V3_PRUNE                         7
-#define DVMRP_V3_GRAFT                         8
-#define DVMRP_V3_GRAFT_ACK                     9
+#define DVMRP_V3_PROBE                         0x1
+#define DVMRP_V3_REPORT                                0x2
+#define DVMRP_V3_ASK_NEIGHBORS                 0x3
+#define DVMRP_V3_NEIGHBORS                     0x4
+#define DVMRP_V3_ASK_NEIGHBORS_2               0x5
+#define DVMRP_V3_NEIGHBORS_2                   0x6
+#define DVMRP_V3_PRUNE                         0x7
+#define DVMRP_V3_GRAFT                         0x8
+#define DVMRP_V3_GRAFT_ACK                     0x9
 static const value_string code_v3[] = {
-       {DVMRP_V3_PROBE,        "Probe"},
-       {DVMRP_V3_REPORT,       "Report"},
-       {DVMRP_V3_PRUNE,        "Prune"},
-       {DVMRP_V3_GRAFT,        "Graft"},
-       {DVMRP_V3_GRAFT_ACK,    "Graft ACK"},
-       {0,                     NULL}
+       {DVMRP_V3_PROBE,                "Probe"},
+       {DVMRP_V3_REPORT,               "Report"},
+       {DVMRP_V3_ASK_NEIGHBORS,        "Ask Neighbors"},
+       {DVMRP_V3_NEIGHBORS,            "Neighbors"},
+       {DVMRP_V3_ASK_NEIGHBORS_2,      "Ask Neighbors 2"},
+       {DVMRP_V3_NEIGHBORS_2,          "Neighbors 2"},
+       {DVMRP_V3_PRUNE,                "Prune"},
+       {DVMRP_V3_GRAFT,                "Graft"},
+       {DVMRP_V3_GRAFT_ACK,            "Graft ACK"},
+       {0,                             NULL}
 };
 
 #define DVMRP_V3_CAP_LEAF      0x01
@@ -147,7 +150,7 @@ static const value_string code_v3[] = {
 #define DVMRP_V3_CAP_MTRACE    0x08
 #define DVMRP_V3_CAP_SNMP      0x10
 #define DVMRP_V3_CAP_NETMASK   0x20
-       
+
 
 #define V1_COMMAND_NULL                0
 #define V1_COMMAND_AFI         2
@@ -214,44 +217,21 @@ static const true_false_string tfs_cap_netmask = {
        "NOT Netmask capable"
 };
 
-static void dvmrp_checksum(proto_tree *tree,tvbuff_t *tvb, int len)
-{
-       guint16 cksum,hdrcksum;
-       vec_t cksum_vec[1];
-
-       cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, len);
-       cksum_vec[0].len = len;
-
-       hdrcksum = tvb_get_ntohs(tvb, 2);
-       cksum = in_cksum(&cksum_vec[0],1);
-
-       if (cksum==0) {
-               proto_tree_add_uint_format(tree, hf_checksum, tvb, 2, 2, hdrcksum, "Header checksum: 0x%04x (correct)", hdrcksum);
-       } else {
-               proto_tree_add_item_hidden(tree, hf_checksum_bad, tvb, 2, 2, TRUE);
-               proto_tree_add_uint_format(tree, hf_checksum, tvb, 2, 2, hdrcksum, "Header checksum: 0x%04x (incorrect, should be 0x%04x)", hdrcksum,in_cksum_shouldbe(hdrcksum,cksum));
-       }
-
-       return;
-}
-
-
-
-int
-dissect_v3_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset)
+static int
+dissect_v3_report(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
 {
        guint8 m0,m1,m2,m3;
        guint8 s0,s1,s2,s3;
        guint8 metric;
        guint32 ip;
 
-       while (tvb_length_remaining(tvb, offset)) {
+       while (tvb_reported_length_remaining(tvb, offset) > 0) {
                proto_tree *tree;
                proto_item *item;
                int old_offset = offset;
 
-               item = proto_tree_add_item(parent_tree, hf_route, 
-                               tvb, offset, 0, FALSE);
+               item = proto_tree_add_item(parent_tree, hf_route,
+                               tvb, offset, -1, FALSE);
                tree = proto_item_add_subtree(item, ett_route);
 
                m0 = 0xff;
@@ -302,12 +282,12 @@ dissect_v3_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, in
                        ip = (ip<<8)|s2;
                        ip = (ip<<8)|s1;
                        ip = (ip<<8)|s0;
-                       proto_tree_add_ipv4_format(tree, hf_saddr, tvb, 
+                       proto_tree_add_ipv4_format(tree, hf_saddr, tvb,
                                old_offset, offset-old_offset, ip,
                                "%s %d.%d.%d.%d (netmask %d.%d.%d.%d)",
                                m0?"Source Network":"Default Route",
                                s0,s1,s2,s3,m0,m1,m2,m3);
-                       
+
                        metric = tvb_get_guint8(tvb, offset);
                        proto_tree_add_uint(tree, hf_metric, tvb,
                                offset, 1, metric&0x7f);
@@ -322,7 +302,7 @@ dissect_v3_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, in
        return offset;
 }
 
-int
+static int
 dissect_dvmrp_v3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset)
 {
        guint8 code,count;
@@ -338,25 +318,26 @@ dissect_dvmrp_v3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
        code = tvb_get_guint8(tvb, offset);
        proto_tree_add_uint(parent_tree, hf_code_v3, tvb, offset, 1, code);
        offset += 1;
-       if (check_col(pinfo->fd, COL_INFO)) {
-               col_add_fstr(pinfo->fd, COL_INFO,
-                       "V%d %s",3 ,val_to_str(code, code_v3, 
+       if (check_col(pinfo->cinfo, COL_INFO)) {
+               col_add_fstr(pinfo->cinfo, COL_INFO,
+                       "V%d %s",3 ,val_to_str(code, code_v3,
                                "Unknown Type:0x%02x"));
        }
 
        /* checksum */
-       dvmrp_checksum(parent_tree, tvb, tvb_length_remaining(tvb, 0));
+       igmp_checksum(parent_tree, tvb, hf_checksum, hf_checksum_bad, pinfo, 0);
        offset += 2;
 
        /* skip unused byte */
        offset += 1;
 
-       /* PROBE packets have capabilities flags, unused for other packets */
-       if (code==DVMRP_V3_PROBE) {
+       /* PROBE and NEIGHBORS 2 packets have capabilities flags, unused
+          for other packets */
+       if (code==DVMRP_V3_PROBE || code==DVMRP_V3_NEIGHBORS_2) {
                proto_tree *tree;
                proto_item *item;
 
-               item = proto_tree_add_item(parent_tree, hf_capabilities, 
+               item = proto_tree_add_item(parent_tree, hf_capabilities,
                                tvb, offset, 1, FALSE);
                tree = proto_item_add_subtree(item, ett_capabilities);
 
@@ -371,98 +352,97 @@ dissect_dvmrp_v3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
        offset += 1;
 
        /* minor version */
-       proto_tree_add_uint(parent_tree, hf_min_ver, tvb, offset, 1, tvb_get_guint8(tvb, offset));
+       proto_tree_add_item(parent_tree, hf_min_ver, tvb, offset, 1, FALSE);
        offset += 1;
 
        /* major version */
-       proto_tree_add_uint(parent_tree, hf_maj_ver, tvb, offset, 1, tvb_get_guint8(tvb, offset));
+       proto_tree_add_item(parent_tree, hf_maj_ver, tvb, offset, 1, FALSE);
        offset += 1;
 
        switch (code) {
        case DVMRP_V3_PROBE:
                /* generation id */
-               proto_tree_add_uint(parent_tree, hf_genid, tvb, 
-                       offset, 4, tvb_get_ntohl(tvb, offset));
+               proto_tree_add_item(parent_tree, hf_genid, tvb,
+                       offset, 4, FALSE);
                offset += 4;
-               while (tvb_length_remaining(tvb, offset)) {
-                       proto_tree_add_ipv4(parent_tree, hf_neighbor, 
-                               tvb, offset, 4, 
-                               tvb_get_letohl(tvb, offset));
+               while (tvb_reported_length_remaining(tvb, offset) > 0) {
+                       proto_tree_add_item(parent_tree, hf_neighbor,
+                               tvb, offset, 4, FALSE);
                        offset += 4;
                }
                break;
        case DVMRP_V3_REPORT:
-               offset = dissect_v3_report(tvb, pinfo, parent_tree, offset);
+               offset = dissect_v3_report(tvb, parent_tree, offset);
                break;
        case DVMRP_V3_PRUNE:
                /* source address */
-               proto_tree_add_ipv4(parent_tree, hf_saddr, 
-                       tvb, offset, 4, 
-                       tvb_get_letohl(tvb, offset));
+               proto_tree_add_item(parent_tree, hf_saddr,
+                       tvb, offset, 4, FALSE);
                offset += 4;
                /* group address */
-               proto_tree_add_ipv4(parent_tree, hf_maddr, 
-                       tvb, offset, 4, 
-                       tvb_get_letohl(tvb, offset));
+               proto_tree_add_item(parent_tree, hf_maddr,
+                       tvb, offset, 4, FALSE);
                offset += 4;
                /* prune lifetime */
-               proto_tree_add_uint(parent_tree, hf_life, 
-                       tvb, offset, 4, 
-                       tvb_get_ntohl(tvb, offset));
+               proto_tree_add_item(parent_tree, hf_life,
+                       tvb, offset, 4, FALSE);
                offset += 4;
                /* source netmask */
-               if (tvb_length_remaining(tvb, offset)>=4) {
-                       proto_tree_add_ipv4(parent_tree, hf_netmask, 
-                               tvb, offset, 4, 
-                               tvb_get_letohl(tvb, offset));
+               if (tvb_reported_length_remaining(tvb, offset)>=4) {
+                       proto_tree_add_item(parent_tree, hf_netmask,
+                               tvb, offset, 4, FALSE);
                        offset += 4;
                }
                break;
        case DVMRP_V3_GRAFT:
                /* source address */
-               proto_tree_add_ipv4(parent_tree, hf_saddr, 
-                       tvb, offset, 4, 
-                       tvb_get_letohl(tvb, offset));
+               proto_tree_add_item(parent_tree, hf_saddr,
+                       tvb, offset, 4, FALSE);
                offset += 4;
                /* group address */
-               proto_tree_add_ipv4(parent_tree, hf_maddr, 
-                       tvb, offset, 4, 
-                       tvb_get_letohl(tvb, offset));
+               proto_tree_add_item(parent_tree, hf_maddr,
+                       tvb, offset, 4, FALSE);
                offset += 4;
                /* source netmask */
-               if (tvb_length_remaining(tvb, offset)>=4) {
-                       proto_tree_add_ipv4(parent_tree, hf_netmask, 
-                               tvb, offset, 4, 
-                               tvb_get_letohl(tvb, offset));
+               if (tvb_reported_length_remaining(tvb, offset)>=4) {
+                       proto_tree_add_item(parent_tree, hf_netmask,
+                               tvb, offset, 4, FALSE);
                        offset += 4;
                }
                break;
        case DVMRP_V3_GRAFT_ACK:
                /* source address */
-               proto_tree_add_ipv4(parent_tree, hf_saddr, 
-                       tvb, offset, 4, 
-                       tvb_get_letohl(tvb, offset));
+               proto_tree_add_item(parent_tree, hf_saddr,
+                       tvb, offset, 4, FALSE);
                offset += 4;
                /* group address */
-               proto_tree_add_ipv4(parent_tree, hf_maddr, 
-                       tvb, offset, 4, 
-                       tvb_get_letohl(tvb, offset));
+               proto_tree_add_item(parent_tree, hf_maddr,
+                       tvb, offset, 4, FALSE);
                offset += 4;
                /* source netmask */
-               if (tvb_length_remaining(tvb, offset)>=4) {
-                       proto_tree_add_ipv4(parent_tree, hf_netmask, 
-                               tvb, offset, 4, 
-                               tvb_get_letohl(tvb, offset));
+               if (tvb_reported_length_remaining(tvb, offset)>=4) {
+                       proto_tree_add_item(parent_tree, hf_netmask,
+                               tvb, offset, 4, FALSE);
                        offset += 4;
                }
                break;
+       case DVMRP_V3_ASK_NEIGHBORS:
+       case DVMRP_V3_NEIGHBORS:
+               /* XXX - obsolete, and the draft doesn't describe them */
+               break;
+       case DVMRP_V3_ASK_NEIGHBORS_2:
+               /* No data */
+               break;
+       case DVMRP_V3_NEIGHBORS_2:
+               /* XXX - fill this in */
+               break;
        }
 
        return offset;
 }
-       
 
-int
+
+static int
 dissect_dvmrp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset)
 {
        guint8 code;
@@ -479,25 +459,25 @@ dissect_dvmrp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
        code = tvb_get_guint8(tvb, offset);
        proto_tree_add_uint(parent_tree, hf_code_v1, tvb, offset, 1, code);
        offset += 1;
-       if (check_col(pinfo->fd, COL_INFO)) {
-               col_add_fstr(pinfo->fd, COL_INFO,
-                       "V%d %s",1 ,val_to_str(code, code_v1, 
+       if (check_col(pinfo->cinfo, COL_INFO)) {
+               col_add_fstr(pinfo->cinfo, COL_INFO,
+                       "V%d %s",1 ,val_to_str(code, code_v1,
                                "Unknown Type:0x%02x"));
        }
 
        /* checksum */
-       dvmrp_checksum(parent_tree, tvb, tvb_length_remaining(tvb, 0));
+       igmp_checksum(parent_tree, tvb, hf_checksum, hf_checksum_bad, pinfo, 0);
        offset += 2;
 
        /* decode all the v1 commands */
-       while (tvb_length_remaining(tvb, offset)) {
+       while (tvb_reported_length_remaining(tvb, offset)) {
                proto_tree *tree;
                proto_item *item;
                guint8 cmd,count;
                int old_offset = offset;
 
-               item = proto_tree_add_item(parent_tree, hf_commands, 
-                               tvb, offset, 0, FALSE);
+               item = proto_tree_add_item(parent_tree, hf_commands,
+                               tvb, offset, -1, FALSE);
                tree = proto_item_add_subtree(item, ett_commands);
 
                cmd = tvb_get_guint8(tvb, offset);
@@ -523,19 +503,18 @@ dissect_dvmrp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
                                        val_to_str(af, afi, "Unknown Family:0x%02x")
                                );
                        }
-                       break;          
+                       break;
                case V1_COMMAND_SUBNETMASK:
                        count = tvb_get_guint8(tvb, offset);
                        proto_tree_add_uint(tree, hf_count, tvb,
                                offset, 1, count);
                        offset += 1;
                        if (count) { /* must be 0 or 1 */
-                               proto_tree_add_ipv4(tree, hf_netmask, 
-                                       tvb, offset, 4, 
-                                       tvb_get_letohl(tvb, offset));
+                               proto_tree_add_item(tree, hf_netmask,
+                                       tvb, offset, 4, FALSE);
                                if (item) {
                                        proto_item_set_text(item, "%s: %d.%d.%d.%d",
-                                               val_to_str(cmd, command, "Unknown Command:0x%02x"), 
+                                               val_to_str(cmd, command, "Unknown Command:0x%02x"),
                                                tvb_get_guint8(tvb, offset),
                                                tvb_get_guint8(tvb, offset+1),
                                                tvb_get_guint8(tvb, offset+2),
@@ -548,17 +527,17 @@ dissect_dvmrp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
                                                val_to_str(cmd, command, "Unknown Command:0x%02x"));
                                }
                        }
-                       break;  
+                       break;
                case V1_COMMAND_METRIC:
-                       proto_tree_add_uint(tree, hf_metric, tvb,
-                               offset, 1, tvb_get_guint8(tvb, offset));
+                       proto_tree_add_item(tree, hf_metric, tvb,
+                               offset, 1, FALSE);
                        if (item) {
                                proto_item_set_text(item, "%s: %d",
-                                       val_to_str(cmd, command, "Unknown Command:0x%02x"), 
+                                       val_to_str(cmd, command, "Unknown Command:0x%02x"),
                                        tvb_get_guint8(tvb, offset));
                        }
                        offset += 1;
-                       break;          
+                       break;
                case V1_COMMAND_FLAGS0:
                        count = tvb_get_guint8(tvb, offset);
                        proto_tree_add_boolean(tree, hf_dest_unr, tvb, offset, 1, count);
@@ -570,14 +549,14 @@ dissect_dvmrp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
                        offset += 1;
                        break;
                case V1_COMMAND_INFINITY:
-                       proto_tree_add_uint(tree, hf_infinity, tvb,
-                               offset, 1, tvb_get_guint8(tvb, offset));
+                       proto_tree_add_item(tree, hf_infinity, tvb,
+                               offset, 1, FALSE);
                        if (item) {
                                proto_item_set_text(item, "%s: %d",
                                        val_to_str(cmd, command, "Unknown Command:0x%02x"), tvb_get_guint8(tvb, offset));
                        }
                        offset += 1;
-                       break;          
+                       break;
                case V1_COMMAND_DA:
                case V1_COMMAND_RDA: /* same as DA */
                        count = tvb_get_guint8(tvb, offset);
@@ -585,51 +564,48 @@ dissect_dvmrp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
                                offset, 1, count);
                        offset += 1;
                        while (count--) {
-                               proto_tree_add_ipv4(tree, hf_daddr, 
-                                       tvb, offset, 4, 
-                                       tvb_get_letohl(tvb, offset));
+                               proto_tree_add_item(tree, hf_daddr,
+                                       tvb, offset, 4, FALSE);
                                offset += 4;
                        }
                        if (item) {
                                proto_item_set_text(item, "%s",
                                        val_to_str(cmd, command, "Unknown Command:0x%02x"));
                        }
-                       break;  
+                       break;
                case V1_COMMAND_NMR:
                        count = tvb_get_guint8(tvb, offset);
                        proto_tree_add_uint(tree, hf_count, tvb,
                                offset, 1, count);
                        offset += 1;
                        while (count--) {
-                               proto_tree_add_ipv4(tree, hf_maddr, 
-                                       tvb, offset, 4, 
-                                       tvb_get_letohl(tvb, offset));
+                               proto_tree_add_item(tree, hf_maddr,
+                                       tvb, offset, 4, FALSE);
                                offset += 4;
-                               proto_tree_add_uint(tree, hf_hold, tvb,
-                                       offset, 4, tvb_get_ntohl(tvb, offset));
+                               proto_tree_add_item(tree, hf_hold, tvb,
+                                       offset, 4, FALSE);
                                offset += 4;
                        }
                        if (item) {
                                proto_item_set_text(item, "%s",
                                        val_to_str(cmd, command, "Unknown Command:0x%02x"));
                        }
-                       break;  
+                       break;
                case V1_COMMAND_NMR_CANCEL:
                        count = tvb_get_guint8(tvb, offset);
                        proto_tree_add_uint(tree, hf_count, tvb,
                                offset, 1, count);
                        offset += 1;
                        while (count--) {
-                               proto_tree_add_ipv4(tree, hf_maddr, 
-                                       tvb, offset, 4, 
-                                       tvb_get_letohl(tvb, offset));
+                               proto_tree_add_item(tree, hf_maddr,
+                                       tvb, offset, 4, FALSE);
                                offset += 4;
                        }
                        if (item) {
                                proto_item_set_text(item, "%s",
                                        val_to_str(cmd, command, "Unknown Command:0x%02x"));
                        }
-                       break;  
+                       break;
                }
 
                proto_item_set_len(item, offset-old_offset);
@@ -645,22 +621,22 @@ dissect_dvmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int of
        proto_tree *tree;
        proto_item *item;
 
-       if (!proto_is_protocol_enabled(proto_dvmrp)) {
+       if (!proto_is_protocol_enabled(find_protocol_by_id(proto_dvmrp))) {
                /* we are not enabled, skip entire packet to be nice
                   to the igmp layer. (so clicking on IGMP will display the data)
                 */
                return offset+tvb_length_remaining(tvb, offset);
        }
 
-       item = proto_tree_add_item(parent_tree, proto_dvmrp, tvb, offset, 0, FALSE);
+       item = proto_tree_add_item(parent_tree, proto_dvmrp, tvb, offset, -1, FALSE);
        tree = proto_item_add_subtree(item, ett_dvmrp);
 
 
-       if (check_col(pinfo->fd, COL_PROTOCOL)) {
-               col_set_str(pinfo->fd, COL_PROTOCOL, "DVMRP");
+       if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
+               col_set_str(pinfo->cinfo, COL_PROTOCOL, "DVMRP");
        }
-       if (check_col(pinfo->fd, COL_INFO)) {
-               col_clear(pinfo->fd, COL_INFO);
+       if (check_col(pinfo->cinfo, COL_INFO)) {
+               col_clear(pinfo->cinfo, COL_INFO);
        }
 
 
@@ -672,7 +648,7 @@ dissect_dvmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int of
                return offset;
        }
 
-       
+
        offset = dissect_dvmrp_v1(tvb, pinfo, tree, offset);
        proto_item_set_len(item, offset);
        return offset;
@@ -684,135 +660,131 @@ proto_register_dvmrp(void)
        static hf_register_info hf[] = {
                { &hf_version,
                        { "DVMRP Version", "dvmrp.version", FT_UINT8, BASE_DEC,
-                         NULL, 0, "DVMRP Version" }},
+                         NULL, 0, "DVMRP Version", HFILL }},
 
                { &hf_type,
                        { "Type", "dvmrp.type", FT_UINT8, BASE_HEX,
-                         VALS(dvmrp_type), 0, "DVMRP Packet Type" }},
+                         VALS(dvmrp_type), 0, "DVMRP Packet Type", HFILL }},
 
                { &hf_code_v1,
                        { "Code", "dvmrp.v1.code", FT_UINT8, BASE_HEX,
-                         VALS(code_v1), 0, "DVMRP Packet Code" }},
+                         VALS(code_v1), 0, "DVMRP Packet Code", HFILL }},
 
                { &hf_checksum,
                        { "Checksum", "dvmrp.checksum", FT_UINT16, BASE_HEX,
-                         NULL, 0, "DVMRP Checksum" }},
+                         NULL, 0, "DVMRP Checksum", HFILL }},
 
                { &hf_checksum_bad,
                        { "Bad Checksum", "dvmrp.checksum_bad", FT_BOOLEAN, BASE_NONE,
-                         NULL, 0, "Bad DVMRP Checksum" }},
+                         NULL, 0, "Bad DVMRP Checksum", HFILL }},
 
                { &hf_commands,
                        { "Commands", "dvmrp.commands", FT_NONE, BASE_NONE,
-                         NULL, 0, "DVMRP V1 Commands" }},
+                         NULL, 0, "DVMRP V1 Commands", HFILL }},
 
                { &hf_command,
                        { "Command", "dvmrp.command", FT_UINT8, BASE_HEX,
-                         VALS(command), 0, "DVMRP V1 Command" }},
+                         VALS(command), 0, "DVMRP V1 Command", HFILL }},
 
                { &hf_afi,
                        { "Address Family", "dvmrp.afi", FT_UINT8, BASE_HEX,
-                         VALS(afi), 0, "DVMRP Address Family Indicator" }},
+                         VALS(afi), 0, "DVMRP Address Family Indicator", HFILL }},
 
                { &hf_count,
                        { "Count", "dvmrp.count", FT_UINT8, BASE_HEX,
-                         NULL, 0, "Count" }},
+                         NULL, 0, "Count", HFILL }},
 
                { &hf_netmask,
                        { "Netmask", "igmp.netmask", FT_IPv4, BASE_NONE,
-                         NULL, 0, "DVMRP Netmask" }},
+                         NULL, 0, "DVMRP Netmask", HFILL }},
 
                { &hf_metric,
                        { "Metric", "dvmrp.metric", FT_UINT8, BASE_DEC,
-                         NULL, 0, "DVMRP Metric" }},
+                         NULL, 0, "DVMRP Metric", HFILL }},
 
                {&hf_dest_unr,
                        { "Destination Unreachable", "dvmrp.dest_unreach", FT_BOOLEAN, 8,
-                       TFS(&tfs_dest_unreach), 0x01, "Destination Unreachable" }},
+                       TFS(&tfs_dest_unreach), 0x01, "Destination Unreachable", HFILL }},
 
                {&hf_split_horiz,
                        { "Split Horizon", "dvmrp.split_horiz", FT_BOOLEAN, 8,
-                       TFS(&tfs_split_horiz), 0x02, "Split Horizon concealed route" }},
+                       TFS(&tfs_split_horiz), 0x02, "Split Horizon concealed route", HFILL }},
 
                { &hf_infinity,
                        { "Infinity", "dvmrp.infinity", FT_UINT8, BASE_DEC,
-                         NULL, 0, "DVMRP Infinity" }},
+                         NULL, 0, "DVMRP Infinity", HFILL }},
 
                { &hf_daddr,
                        { "Dest Addr", "igmp.daddr", FT_IPv4, BASE_NONE,
-                         NULL, 0, "DVMRP Destination Address" }},
+                         NULL, 0, "DVMRP Destination Address", HFILL }},
 
                { &hf_maddr,
                        { "Multicast Addr", "igmp.maddr", FT_IPv4, BASE_NONE,
-                         NULL, 0, "DVMRP Multicast Address" }},
+                         NULL, 0, "DVMRP Multicast Address", HFILL }},
 
                { &hf_hold,
                        { "Hold Time", "dvmrp.hold", FT_UINT32, BASE_DEC,
-                         NULL, 0, "DVMRP Hold Time in seconds" }},
+                         NULL, 0, "DVMRP Hold Time in seconds", HFILL }},
 
                { &hf_code_v3,
                        { "Code", "dvmrp.v3.code", FT_UINT8, BASE_HEX,
-                         VALS(code_v3), 0, "DVMRP Packet Code" }},
+                         VALS(code_v3), 0, "DVMRP Packet Code", HFILL }},
 
                { &hf_capabilities,
                        { "Capabilities", "dvmrp.capabilities", FT_NONE, BASE_NONE,
-                         NULL, 0, "DVMRP V3 Capabilities" }},
+                         NULL, 0, "DVMRP V3 Capabilities", HFILL }},
 
                {&hf_cap_leaf,
                        { "Leaf", "dvmrp.cap.leaf", FT_BOOLEAN, 8,
-                       TFS(&tfs_cap_leaf), DVMRP_V3_CAP_LEAF, "Leaf" }},
+                       TFS(&tfs_cap_leaf), DVMRP_V3_CAP_LEAF, "Leaf", HFILL }},
 
                {&hf_cap_prune,
                        { "Prune", "dvmrp.cap.prune", FT_BOOLEAN, 8,
-                       TFS(&tfs_cap_prune), DVMRP_V3_CAP_PRUNE, "Prune capability" }},
+                       TFS(&tfs_cap_prune), DVMRP_V3_CAP_PRUNE, "Prune capability", HFILL }},
 
                {&hf_cap_genid,
                        { "Genid", "dvmrp.cap.genid", FT_BOOLEAN, 8,
-                       TFS(&tfs_cap_genid), DVMRP_V3_CAP_GENID, "Genid capability" }},
+                       TFS(&tfs_cap_genid), DVMRP_V3_CAP_GENID, "Genid capability", HFILL }},
 
                {&hf_cap_mtrace,
                        { "Mtrace", "dvmrp.cap.mtrace", FT_BOOLEAN, 8,
-                       TFS(&tfs_cap_mtrace), DVMRP_V3_CAP_MTRACE, "Mtrace capability" }},
+                       TFS(&tfs_cap_mtrace), DVMRP_V3_CAP_MTRACE, "Mtrace capability", HFILL }},
 
                {&hf_cap_snmp,
                        { "SNMP", "dvmrp.cap.snmp", FT_BOOLEAN, 8,
-                       TFS(&tfs_cap_snmp), DVMRP_V3_CAP_SNMP, "SNMP capability" }},
+                       TFS(&tfs_cap_snmp), DVMRP_V3_CAP_SNMP, "SNMP capability", HFILL }},
 
                {&hf_cap_netmask,
                        { "Netmask", "dvmrp.cap.netmask", FT_BOOLEAN, 8,
-                       TFS(&tfs_cap_netmask), DVMRP_V3_CAP_NETMASK, "Netmask capability" }},
+                       TFS(&tfs_cap_netmask), DVMRP_V3_CAP_NETMASK, "Netmask capability", HFILL }},
 
                { &hf_min_ver,
                        { "Minor Version", "dvmrp.min_ver", FT_UINT8, BASE_HEX,
-                         NULL, 0, "DVMRP Minor Version" }},
+                         NULL, 0, "DVMRP Minor Version", HFILL }},
 
                { &hf_maj_ver,
                        { "Major Version", "dvmrp.maj_ver", FT_UINT8, BASE_HEX,
-                         NULL, 0, "DVMRP Major Version" }},
+                         NULL, 0, "DVMRP Major Version", HFILL }},
 
                { &hf_genid,
                        { "Generation ID", "dvmrp.genid", FT_UINT32, BASE_DEC,
-                         NULL, 0, "DVMRP Generation ID" }},
-
-               { &hf_naddr,
-                       { "Neighbor Addr", "igmp.naddr", FT_IPv4, BASE_NONE,
-                         NULL, 0, "DVMRP Neighbor Address" }},
+                         NULL, 0, "DVMRP Generation ID", HFILL }},
 
                { &hf_route,
                        { "Route", "dvmrp.route", FT_NONE, BASE_NONE,
-                         NULL, 0, "DVMRP V3 Route Report" }},
+                         NULL, 0, "DVMRP V3 Route Report", HFILL }},
 
                { &hf_saddr,
                        { "Source Addr", "igmp.saddr", FT_IPv4, BASE_NONE,
-                         NULL, 0, "DVMRP Source Address" }},
+                         NULL, 0, "DVMRP Source Address", HFILL }},
 
                { &hf_life,
                        { "Prune lifetime", "dvmrp.lifetime", FT_UINT32, BASE_DEC,
-                         NULL, 0, "DVMRP Prune Lifetime" }},
+                         NULL, 0, "DVMRP Prune Lifetime", HFILL }},
 
                { &hf_neighbor,
                        { "Neighbor Addr", "igmp.neighbor", FT_IPv4, BASE_NONE,
-                         NULL, 0, "DVMRP Neighbor Address" }},
+                         NULL, 0, "DVMRP Neighbor Address", HFILL }},
 
        };
        static gint *ett[] = {
@@ -827,4 +799,3 @@ proto_register_dvmrp(void)
        proto_register_field_array(proto_dvmrp, hf, array_length(hf));
        proto_register_subtree_array(ett, array_length(ett));
 }
-