diff --git a/packet-gre.c b/packet-gre.c index 584a195491..8d3f5f3abf 100644 --- a/packet-gre.c +++ b/packet-gre.c @@ -2,7 +2,7 @@ * Routines for the Generic Routing Encapsulation (GRE) protocol * Brad Robel-Forrest * - * $Id: packet-gre.c,v 1.45 2001/10/23 19:02:59 guy Exp $ + * $Id: packet-gre.c,v 1.46 2001/11/25 22:51:13 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -58,6 +58,7 @@ static gint ett_gre_flags = -1; static gint ett_gre_wccp2_redirect_header = -1; static dissector_table_t gre_dissector_table; +static dissector_handle_t data_handle; /* bit positions for flags in header */ #define GH_B_C 0x8000 @@ -274,7 +275,7 @@ dissect_gre(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } next_tvb = tvb_new_subset(tvb, offset, -1, -1); if (!dissector_try_port(gre_dissector_table, type, next_tvb, pinfo, tree)) - dissect_data(next_tvb, 0, pinfo, gre_tree); + call_dissector(data_handle,next_tvb, pinfo, gre_tree); } static void @@ -381,4 +382,5 @@ void proto_reg_handoff_gre(void) { dissector_add("ip.proto", IP_PROTO_GRE, dissect_gre, proto_gre); + data_handle = find_dissector("data"); } diff --git a/packet-h1.c b/packet-h1.c index d03a333660..18835afbbb 100644 --- a/packet-h1.c +++ b/packet-h1.c @@ -2,7 +2,7 @@ * Routines for Sinec H1 packet disassembly * Gerrit Gehnen * - * $Id: packet-h1.c,v 1.20 2001/06/18 02:17:46 guy Exp $ + * $Id: packet-h1.c,v 1.21 2001/11/25 22:51:13 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -54,6 +54,8 @@ static int hf_h1_response_value = -1; static int hf_h1_empty_len = -1; static int hf_h1_empty = -1; +static dissector_handle_t data_handle; + #define EMPTY_BLOCK 0xFF #define OPCODE_BLOCK 0x01 #define REQUEST_BLOCK 0x03 @@ -245,7 +247,7 @@ static gboolean dissect_h1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) position += tvb_get_guint8(tvb,offset + position + 1); /* Goto next section */ } /* ..while */ next_tvb = tvb_new_subset(tvb, offset+tvb_get_guint8(tvb,offset+2), -1, -1); - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); return TRUE; } @@ -318,4 +320,5 @@ void proto_reg_handoff_h1(void) { heur_dissector_add("cotp_is", dissect_h1, proto_h1); + data_handle = find_dissector("data"); } diff --git a/packet-icmpv6.c b/packet-icmpv6.c index 23e736705d..a4689481bf 100644 --- a/packet-icmpv6.c +++ b/packet-icmpv6.c @@ -1,7 +1,7 @@ /* packet-icmpv6.c * Routines for ICMPv6 packet disassembly * - * $Id: packet-icmpv6.c,v 1.53 2001/10/01 08:29:34 guy Exp $ + * $Id: packet-icmpv6.c,v 1.54 2001/11/25 22:51:13 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -82,6 +82,7 @@ static gint ett_nodeinfo_nodebitmap = -1; static gint ett_nodeinfo_nodedns = -1; static dissector_handle_t ipv6_handle; +static dissector_handle_t data_handle; static const value_string names_nodeinfo_qtype[] = { { NI_QTYPE_NOOP, "NOOP" }, @@ -173,7 +174,7 @@ dissect_contained_icmpv6(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr pinfo->src = save_src; pinfo->dst = save_dst; } else - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } static void @@ -796,7 +797,7 @@ dissect_nodeinfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree nodata:; /* the rest of data */ - dissect_data(tvb_new_subset(tvb, offset + off, -1, -1), 0, pinfo, tree); + call_dissector(data_handle,tvb_new_subset(tvb, offset + off, -1, -1), pinfo, tree); } static void @@ -844,7 +845,7 @@ dissect_rrenum(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) proto_tree_add_text(tree, tvb, offset + offsetof(struct icmp6_router_renum, rr_maxdelay), 2, "Max delay: 0x%04x", pntohs(&rr->rr_maxdelay)); - dissect_data(tvb_new_subset(tvb, offset + sizeof(*rr), -1, -1), 0, pinfo, tree); /*XXX*/ + call_dissector(data_handle,tvb_new_subset(tvb, offset + sizeof(*rr), -1, -1), pinfo, tree); /*XXX*/ if (rr->rr_code == ICMP6_ROUTER_RENUMBERING_COMMAND) { off = offset + sizeof(*rr); @@ -1251,7 +1252,7 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset + offsetof(struct icmp6_hdr, icmp6_seq), 2, "Sequence: 0x%04x", (guint16)ntohs(dp->icmp6_seq)); next_tvb = tvb_new_subset(tvb, offset + sizeof(*dp), -1, -1); - dissect_data(next_tvb, 0, pinfo, icmp6_tree); + call_dissector(data_handle,next_tvb, pinfo, icmp6_tree); break; case ICMP6_MEMBERSHIP_QUERY: case ICMP6_MEMBERSHIP_REPORT: @@ -1408,7 +1409,7 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: next_tvb = tvb_new_subset(tvb, offset + sizeof(*dp), -1, -1); - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); break; } } @@ -1459,4 +1460,5 @@ proto_reg_handoff_icmpv6(void) * Get a handle for the IPv6 dissector. */ ipv6_handle = find_dissector("ipv6"); + data_handle = find_dissector("data"); } diff --git a/packet-ipx.c b/packet-ipx.c index c09afe1c89..e697f4d88e 100644 --- a/packet-ipx.c +++ b/packet-ipx.c @@ -2,7 +2,7 @@ * Routines for NetWare's IPX * Gilbert Ramirez * - * $Id: packet-ipx.c,v 1.94 2001/11/25 01:28:00 guy Exp $ + * $Id: packet-ipx.c,v 1.95 2001/11/25 22:51:13 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -99,6 +99,8 @@ static int proto_ipxmsg = -1; static int hf_msg_conn = -1; static int hf_msg_sigchar = -1; +static dissector_handle_t data_handle; + static void dissect_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); @@ -280,7 +282,7 @@ dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (dissector_try_port(ipx_socket_dissector_table, ipx_ssocket, next_tvb, pinfo, tree)) return; - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } @@ -363,7 +365,7 @@ dissect_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(spx_tree, hf_spx_all_nr, tvb, 10, 2, FALSE); next_tvb = tvb_new_subset(tvb, SPX_HEADER_LEN, -1, -1); - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } } @@ -994,4 +996,5 @@ proto_reg_handoff_ipx(void) proto_ipxrip); dissector_add("ipx.socket", IPX_SOCKET_IPX_MESSAGE, dissect_ipxmsg, proto_ipxmsg); + data_handle = find_dissector("data"); } diff --git a/packet-isl.c b/packet-isl.c index 71ea4c8067..1258968b06 100644 --- a/packet-isl.c +++ b/packet-isl.c @@ -1,7 +1,7 @@ /* packet-isl.c * Routines for Cisco ISL Ethernet header disassembly * - * $Id: packet-isl.c,v 1.27 2001/11/20 22:29:04 guy Exp $ + * $Id: packet-isl.c,v 1.28 2001/11/25 22:51:13 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -83,6 +83,7 @@ static gint ett_isl = -1; static dissector_handle_t eth_handle; static dissector_handle_t tr_handle; +static dissector_handle_t data_handle; void capture_isl(const u_char *pd, int offset, int len, packet_counts *ld) @@ -259,7 +260,7 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) default: next_tvb = tvb_new_subset(tvb, ISL_HEADER_SIZE, -1, -1); - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); break; } } @@ -344,4 +345,5 @@ proto_reg_handoff_isl(void) */ eth_handle = find_dissector("eth"); tr_handle = find_dissector("tr"); + data_handle = find_dissector("data"); } diff --git a/packet-lapd.c b/packet-lapd.c index 3cc725b94e..fea72a6be0 100644 --- a/packet-lapd.c +++ b/packet-lapd.c @@ -2,7 +2,7 @@ * Routines for LAPD frame disassembly * Gilbert Ramirez * - * $Id: packet-lapd.c,v 1.24 2001/11/13 23:55:30 gram Exp $ + * $Id: packet-lapd.c,v 1.25 2001/11/25 22:51:13 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -59,6 +59,7 @@ static gint ett_lapd_address = -1; static gint ett_lapd_control = -1; static dissector_handle_t q931_handle; +static dissector_handle_t data_handle; /* * Bits in the address field. @@ -150,11 +151,11 @@ dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); break; } } else - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } void @@ -208,6 +209,7 @@ proto_reg_handoff_lapd(void) * Get handle for the Q.931 dissector. */ q931_handle = find_dissector("q931"); + data_handle = find_dissector("data"); dissector_add("wtap_encap", WTAP_ENCAP_LAPD, dissect_lapd, proto_lapd); } diff --git a/packet-llc.c b/packet-llc.c index 33df7f5ad1..0058f7ede0 100644 --- a/packet-llc.c +++ b/packet-llc.c @@ -2,7 +2,7 @@ * Routines for IEEE 802.2 LLC layer * Gilbert Ramirez * - * $Id: packet-llc.c,v 1.89 2001/11/20 21:59:13 guy Exp $ + * $Id: packet-llc.c,v 1.90 2001/11/25 22:51:13 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -65,6 +65,7 @@ static dissector_handle_t bpdu_handle; static dissector_handle_t eth_handle; static dissector_handle_t fddi_handle; static dissector_handle_t tr_handle; +static dissector_handle_t data_handle; typedef void (capture_func_t)(const u_char *, int, int, packet_counts *); @@ -348,10 +349,10 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* do lookup with the subdissector table */ if (!dissector_try_port(subdissector_table, dsap, next_tvb, pinfo, tree)) { - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } } else { - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } } } @@ -397,7 +398,7 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, pinfo, tree, snap_tree, hf_type, -1); } else { next_tvb = tvb_new_subset(tvb, offset+5, -1, -1); - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } break; @@ -453,7 +454,7 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, default: next_tvb = tvb_new_subset(tvb, offset+5, -1, -1); - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); break; } break; @@ -474,9 +475,9 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, /* for future reference, 0x0102 is Cisco DRIP */ if (!dissector_try_port(cisco_subdissector_table, etype, next_tvb, pinfo, tree)) - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } else - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); break; case OUI_CABLE_BPDU: /* DOCSIS cable modem spanning tree BPDU */ @@ -494,7 +495,7 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, etype); } next_tvb = tvb_new_subset(tvb, offset+5, -1, -1); - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); break; } } @@ -566,6 +567,7 @@ proto_reg_handoff_llc(void) eth_handle = find_dissector("eth"); fddi_handle = find_dissector("fddi"); tr_handle = find_dissector("tr"); + data_handle = find_dissector("data"); dissector_add("wtap_encap", WTAP_ENCAP_ATM_RFC1483, dissect_llc, proto_llc); diff --git a/packet-lpd.c b/packet-lpd.c index 7c2a5532aa..f3cc388515 100644 --- a/packet-lpd.c +++ b/packet-lpd.c @@ -2,7 +2,7 @@ * Routines for LPR and LPRng packet disassembly * Gilbert Ramirez * - * $Id: packet-lpd.c,v 1.29 2001/11/13 23:55:30 gram Exp $ + * $Id: packet-lpd.c,v 1.30 2001/11/25 22:51:13 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -49,6 +49,8 @@ enum lpr_type { request, response, unknown }; static gint find_printer_string(tvbuff_t *tvb, int offset); +static dissector_handle_t data_handle; + static void dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -132,7 +134,7 @@ dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvb_format_text(tvb, 1, printer_len)); } else { - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); } } else if (lpr_packet_type == response) { @@ -141,11 +143,11 @@ dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "Response: %s", lpd_server_code[code]); } else { - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); } } else { - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); } } } @@ -193,4 +195,5 @@ void proto_reg_handoff_lpd(void) { dissector_add("tcp.port", TCP_PORT_PRINTER, &dissect_lpd, proto_lpd); + data_handle = find_dissector("data"); } diff --git a/packet-osi.c b/packet-osi.c index 1cbf57bc76..7bfd86afea 100644 --- a/packet-osi.c +++ b/packet-osi.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI network and transport protocol packet disassembly * Main entrance point and common functions * - * $Id: packet-osi.c,v 1.46 2001/09/14 07:10:05 guy Exp $ + * $Id: packet-osi.c,v 1.47 2001/11/25 22:51:13 hagbard Exp $ * Laurent Deniel * Ralf Schneider * @@ -126,6 +126,7 @@ const value_string nlpid_vals[] = { }; dissector_table_t osinl_subdissector_table; +static dissector_handle_t data_handle; static void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -147,13 +148,13 @@ static void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (check_col(pinfo->fd, COL_PROTOCOL)) { col_set_str(pinfo->fd, COL_PROTOCOL, "ESIS (X.25)"); } - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); break; case NLPID_ISO10747_IDRP: if (check_col(pinfo->fd, COL_PROTOCOL)) { col_set_str(pinfo->fd, COL_PROTOCOL, "IDRP"); } - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); break; default: if (check_col(pinfo->fd, COL_PROTOCOL)) { @@ -162,7 +163,7 @@ static void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (check_col(pinfo->fd, COL_INFO)) { col_add_fstr(pinfo->fd, COL_INFO, "Unknown ISO protocol (%02x)", nlpid); } - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); break; } } /* dissect_osi */ @@ -182,4 +183,5 @@ proto_reg_handoff_osi(void) dissector_add("llc.dsap", SAP_OSINL, dissect_osi, -1); dissector_add("ppp.protocol", PPP_OSI, dissect_osi, -1); dissector_add("null.type", BSD_AF_ISO, dissect_osi, -1); + data_handle = find_dissector("data"); } diff --git a/packet-pgm.c b/packet-pgm.c index 130169916e..b5501b0180 100644 --- a/packet-pgm.c +++ b/packet-pgm.c @@ -1,7 +1,7 @@ /* packet-pgm.c * Routines for pgm packet disassembly * - * $Id: packet-pgm.c,v 1.8 2001/11/21 02:01:05 guy Exp $ + * $Id: packet-pgm.c,v 1.9 2001/11/25 22:51:14 hagbard Exp $ * * Copyright (c) 2000 by Talarian Corp * @@ -147,6 +147,7 @@ static int hf_pgm_opt_ccfeedbk_acker = -1; static dissector_table_t subdissector_table; static heur_dissector_list_t heur_subdissector_list; +static dissector_handle_t data_handle; /* * As of the time this comment was typed @@ -568,7 +569,7 @@ decode_pgm_ports(tvbuff_t *tvb, int offset, packet_info *pinfo, return; /* Oh, well, we don't know this; dissect it as data. */ - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } int @@ -1114,7 +1115,8 @@ proto_reg_handoff_pgm(void) dissector_add("udp.port", udp_encap_mcast_port, dissect_pgm, proto_pgm); dissector_add("ip.proto", IP_PROTO_PGM, dissect_pgm, proto_pgm); - + + data_handle = find_dissector("data"); } void proto_rereg_pgm(void) diff --git a/packet-pop.c b/packet-pop.c index 1ca93ecb7e..6ff7ef3ee0 100644 --- a/packet-pop.c +++ b/packet-pop.c @@ -2,7 +2,7 @@ * Routines for pop packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-pop.c,v 1.25 2001/06/18 02:17:50 guy Exp $ + * $Id: packet-pop.c,v 1.26 2001/11/25 22:51:14 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -50,6 +50,8 @@ static int hf_pop_request = -1; static gint ett_pop = -1; +static dissector_handle_t data_handle; + #define TCP_PORT_POP 110 static gboolean response_is_continuation(const u_char *data); @@ -113,7 +115,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * Put the whole packet into the tree as data. */ - dissect_data(tvb, 0, pinfo, pop_tree); + call_dissector(data_handle,tvb, pinfo, pop_tree); return; } @@ -223,4 +225,5 @@ void proto_reg_handoff_pop(void) { dissector_add("tcp.port", TCP_PORT_POP, dissect_pop, proto_pop); + data_handle = find_dissector("data"); } diff --git a/packet-ppp.c b/packet-ppp.c index 9e376a73d3..9534f057da 100644 --- a/packet-ppp.c +++ b/packet-ppp.c @@ -1,7 +1,7 @@ /* packet-ppp.c * Routines for ppp packet disassembly * - * $Id: packet-ppp.c,v 1.76 2001/11/21 02:01:04 guy Exp $ + * $Id: packet-ppp.c,v 1.77 2001/11/25 22:51:14 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -116,6 +116,7 @@ static gint ett_chap_message = -1; static dissector_table_t subdissector_table; static dissector_handle_t chdlc_handle; +static dissector_handle_t data_handle; /* options */ static gint ppp_fcs_decode = 0; /* 0 = No FCS, 1 = 16 bit FCS, 2 = 32 bit FCS */ @@ -1640,7 +1641,7 @@ dissect_ppp_common( tvbuff_t *tvb, int offset, packet_info *pinfo, if (check_col(pinfo->fd, COL_INFO)) col_add_fstr(pinfo->fd, COL_INFO, "PPP %s (0x%04x)", val_to_str(ppp_prot, ppp_vals, "Unknown"), ppp_prot); - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } } @@ -2106,6 +2107,7 @@ proto_reg_handoff_ppp(void) * Get a handle for the CHDLC dissector. */ chdlc_handle = find_dissector("chdlc"); + data_handle = find_dissector("data"); dissector_add("wtap_encap", WTAP_ENCAP_PPP, dissect_ppp_hdlc, proto_ppp); dissector_add("wtap_encap", WTAP_ENCAP_PPP_WITH_PHDR, dissect_ppp_hdlc, proto_ppp);