aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-catapult-dct2000.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-07-25 02:20:10 -0700
committerGuy Harris <gharris@sonic.net>2020-07-25 18:31:34 +0000
commit75c739e4b71f1fb6d907b8d5ceb31db50dbd1fc7 (patch)
treec42c2d08471c75cecbb7a85251d7f9ef7ea6f050 /epan/dissectors/packet-catapult-dct2000.c
parentac2883f5e8e0a461ba06733294738358eb527b8c (diff)
ISDN, LAPD: clean up the way they connect to other dissectors.
Have the ISDN dissector take the ISDN pseudo-header through its data argument, rather than assuming it's in pinfo->pseudo_header, so it can be used if the link-layer type of the capture isn't ISDN. Have it add the direction to its protocol tree, so it's there for all ISDN packets. Have more versions of the LAPD dissector: one where the ISDN direction information is available through an ISDN pseudo-header passed as its data argument; one for use when the link-layer type *is* LAPD, where the ISDN direction information may be available through the direction part of the packet flags. Pass more flags to the routine that does LAPD dissection to indicate the direction (user->network or network->user) and whether the user or network side is on another machine; set those appropriately in the dissector routines that call it. To set those flags: in the routine that handles WTAP_ENCAP_LAPD, check the direction flags in pinfo->rec->rec_header.packet_header.pack_flags; in the routine that handles WTAP_ENCAP_LINUX_LAPD, check the SLL header; in the routine that's called from the ISDN dissector and other dissectors that can supply an ISDN pseudo-header, check the struct isdn_phdr passed to it via the data argument; for the routine that's to be called from L2TP pseudowire type and SCTP dissector tables, pass nothing, as there's currently no direction indication supplied - if that information is available from the encapsulating protocol in some fashion, we should make changes to supply that information. Have the AudioCodes Trunk trace protocol dissector call the LAPD-with-pseudoheader dissector, handing it an ISDN pseudo-header with a direction indication from the direction field (and a channel of 0 to indicate the D channel). Have the Ascend text dump reader in libwiretap use WTAP_ENCAP_ASCEND for all packets, even Ethernet and ISDN packets, and have the Ascend text dump dissector handle that, calling the "no FCS" version of the Ethernet dissector and calling the LAPD-with-pseudoheader dissector with a pseudo-header filled in with the direction (and a channel of 0). Have the Catapult DCT 2000 text dump dissector call the LAPD-with-pseudoheader dissector with the pseudo-header supplied by libwireshark. Have the V5 envelope function frame get its ISDN pseudo-header from its data argument, and call the LAPD-with-pseudoheader dissector with that pseudo-header. Have the ISDN dissector treat its data argument as pointing to the ISDN pseudo-header, rather than assuming it's the one in pinfo->pseudo_header->isdn - the latter is the one supplied by libwiretap, but there's no guarantee that an ISDN pseudo-header was supplied by libwiretap, as the lowest-level protocol layer might not have been ISDN. Change-Id: I9f702b879bbc3fb42bcb43c28f797bfc327562c6 Reviewed-on: https://code.wireshark.org/review/37953 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
Diffstat (limited to 'epan/dissectors/packet-catapult-dct2000.c')
-rw-r--r--epan/dissectors/packet-catapult-dct2000.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c
index 843f700c91..4d0d28ee02 100644
--- a/epan/dissectors/packet-catapult-dct2000.c
+++ b/epan/dissectors/packet-catapult-dct2000.c
@@ -2573,8 +2573,14 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
protocol_handle = find_dissector("eth_withoutfcs");
break;
case WTAP_ENCAP_ISDN:
- protocol_handle = find_dissector("lapd");
- pinfo->p2p_dir = pinfo->pseudo_header->isdn.uton;
+ /*
+ * XXX - if the file can handle B-channel traffic as well
+ * as D-channel traffic, have the libwiretap code fill
+ * in the channel, and call the ISDN dissector rather
+ * than the LAPD-with-pseudoheader dissector.
+ */
+ protocol_handle = find_dissector("lapd-phdr");
+ protocol_data = &pinfo->pseudo_header->dct2000.inner_pseudo_header.isdn;
break;
case WTAP_ENCAP_ATM_PDUS_UNTRUNCATED:
protocol_handle = find_dissector("atm_untruncated");