From bf7e4ce90948af368a11a043fa2617f72e357b96 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 9 Apr 2002 08:15:04 +0000 Subject: Move the definition of the FROM_DCE bit in the "flags" field of a "struct x25_phdr" to "wiretap/wtap.h". Have two X.25 dissectors, one of which assumes that there's a "struct x25_phdr" pseudo-header and one of which doesn't; the former uses the information in that pseudo-header to determine whether the packet is DTE->DCE or DCE->DTE, and the latter assumes it has no clue whether the packet is DTE->DCE or DCE->TDE. Use the former one in the LAPB dissector, and the latter one in the XOT dissector and in the LLC dissector table. In the X.25-over-TCP dissector, handle multiple X.25 packets per TCP segment, and handle X.25 packets split across TCP segments. svn path=/trunk/; revision=5134 --- packet-lapb.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'packet-lapb.c') diff --git a/packet-lapb.c b/packet-lapb.c index 79e25b5147..f781a0c78b 100644 --- a/packet-lapb.c +++ b/packet-lapb.c @@ -2,7 +2,7 @@ * Routines for lapb frame disassembly * Olivier Abad * - * $Id: packet-lapb.c,v 1.34 2002/01/24 09:20:49 guy Exp $ + * $Id: packet-lapb.c,v 1.35 2002/04/09 08:15:02 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -37,8 +37,6 @@ #include #include "xdlc.h" -#define FROM_DCE 0x80 - static int proto_lapb = -1; static int hf_lapb_address = -1; static int hf_lapb_control = -1; @@ -46,7 +44,7 @@ static int hf_lapb_control = -1; static gint ett_lapb = -1; static gint ett_lapb_control = -1; -static dissector_handle_t x25_handle; +static dissector_handle_t x25_dir_handle; static void dissect_lapb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -108,7 +106,7 @@ dissect_lapb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* not end of frame ==> X.25 */ if (tvb_reported_length(tvb) > 2) { next_tvb = tvb_new_subset(tvb, 2, -1, -1); - call_dissector(x25_handle, next_tvb, pinfo, tree); + call_dissector(x25_dir_handle, next_tvb, pinfo, tree); } } @@ -143,9 +141,10 @@ proto_reg_handoff_lapb(void) dissector_handle_t lapb_handle; /* - * Get a handle for the X.25 dissector. + * Get a handle for the X.25 dissector; we will be getting an + * X.25 pseudo-header, so call the dissector that can handle it. */ - x25_handle = find_dissector("x.25"); + x25_dir_handle = find_dissector("x.25_dir"); lapb_handle = find_dissector("lapb"); dissector_add("wtap_encap", WTAP_ENCAP_LAPB, lapb_handle); -- cgit v1.2.3