* Routines for the disassembly of the "Cisco Discovery Protocol"
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-cdp.c,v 1.39 2001/08/28 08:28:14 guy Exp $
+ * $Id: packet-cdp.c,v 1.42 2001/12/10 00:25:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
static gint ett_cdp_address = -1;
static gint ett_cdp_capabilities = -1;
+static dissector_handle_t data_handle;
+
static int
dissect_address_tlv(tvbuff_t *tvb, int offset, int length, proto_tree *tree);
static void
guint32 naddresses;
int addr_length;
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "CDP");
- if (check_col(pinfo->fd, COL_INFO))
- col_set_str(pinfo->fd, COL_INFO, "Cisco Discovery Protocol");
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "CDP");
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_set_str(pinfo->cinfo, COL_INFO, "Cisco Discovery Protocol");
if (tree){
ti = proto_tree_add_item(tree, proto_cdp, tvb, offset,
offset += length;
}
}
- dissect_data(tvb, offset, pinfo, cdp_tree);
+ call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, cdp_tree);
}
}
void
proto_reg_handoff_cdp(void)
{
- dissector_add("llc.cisco_pid", 0x2000, dissect_cdp, proto_cdp);
- dissector_add("chdlctype", 0x2000, dissect_cdp, proto_cdp);
+ dissector_handle_t cdp_handle;
+
+ data_handle = find_dissector("data");
+ cdp_handle = create_dissector_handle(dissect_cdp, proto_cdp);
+ dissector_add("llc.cisco_pid", 0x2000, cdp_handle);
+ dissector_add("chdlctype", 0x2000, cdp_handle);
}