Register the WSP dissector, make it static, and have the WTP dissector

call it through a handle.

svn path=/trunk/; revision=2815
This commit is contained in:
Guy Harris 2001-01-03 08:42:48 +00:00
parent bf94988818
commit b92ebd4a23
3 changed files with 14 additions and 8 deletions

View File

@ -3,7 +3,7 @@
*
* Routines to dissect WSP component of WAP traffic.
*
* $Id: packet-wsp.c,v 1.6 2001/01/03 06:55:34 guy Exp $
* $Id: packet-wsp.c,v 1.7 2001/01/03 08:42:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -369,7 +369,7 @@ tvb_get_guintvar (tvbuff_t *tvb, guint offset, guint *octetCount)
}
/* Code to actually dissect the packets */
void
static void
dissect_wsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
frame_data *fdata = pinfo->fd;
@ -1468,6 +1468,8 @@ proto_register_wsp(void)
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_wsp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_dissector("wsp", dissect_wsp);
};
void

View File

@ -3,7 +3,7 @@
*
* Declarations for disassembly of WSP component of WAP traffic.
*
* $Id: packet-wsp.h,v 1.1 2000/11/04 03:30:40 guy Exp $
* $Id: packet-wsp.h,v 1.2 2001/01/03 08:42:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -61,7 +61,4 @@ static const value_string vals_wsp_reason_codes[] = {
{ 0xEE, "Content type cannot be processed" },
};
void
dissect_wsp(tvbuff_t *, packet_info *, proto_tree *);
#endif /* packet-wsp.h */

View File

@ -3,7 +3,7 @@
*
* Routines to dissect WTP component of WAP traffic.
*
* $Id: packet-wtp.c,v 1.6 2001/01/03 06:55:34 guy Exp $
* $Id: packet-wtp.c,v 1.7 2001/01/03 08:42:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -162,6 +162,8 @@ static int hf_wtp_header_missing_packets = HF_EMPTY;
static gint ett_wtp = ETT_EMPTY;
static gint ett_header = ETT_EMPTY;
static dissector_handle_t wsp_handle;
/* Declarations */
static char transaction_class(unsigned char octet);
static char pdu_type(unsigned char octet);
@ -417,7 +419,7 @@ dissect_wtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_reported_length (tvb) > cbHeader)
{
wsp_tvb = tvb_new_subset(tvb, cbHeader, -1, tvb_reported_length (tvb)-cbHeader);
dissect_wsp( wsp_tvb, pinfo, tree);
call_dissector(wsp_handle, wsp_tvb, pinfo, tree);
}
#ifdef DEBUG
@ -617,6 +619,11 @@ proto_register_wtp(void)
void
proto_reg_handoff_wtp(void)
{
/*
* Get a handle for the IP WSP dissector.
*/
wsp_handle = find_dissector("wsp");
dissector_add("udp.port", UDP_PORT_WTP_WSP, dissect_wtp);
/* dissector_add("udp.port", UDP_PORT_WTLS_WTP_WSP, dissect_wsp); */
}