Wireshark-commits: [Wireshark-commits] master 75c739e: ISDN, LAPD: clean up the way they connect to

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 25 Jul 2020 18:31:46 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=75c739e4b71f1fb6d907b8d5ceb31db50dbd1fc7
Submitter: "Guy Harris <gharris@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

75c739e by Guy Harris (gharris@xxxxxxxxx):

    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@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <gharris@xxxxxxxxx>
    

Actions performed:

    from  ac2883f   NSIS uninstaller: ensure the uninstaller runs with elevated privileges
     add  75c739e   ISDN, LAPD: clean up the way they connect to other dissectors.


Summary of changes:
 epan/dissectors/packet-actrace.c          |  24 ++--
 epan/dissectors/packet-ascend.c           |  44 +++++--
 epan/dissectors/packet-catapult-dct2000.c |  10 +-
 epan/dissectors/packet-isdn.c             |  48 +++++---
 epan/dissectors/packet-lapd.c             | 197 +++++++++++++++++++++---------
 epan/dissectors/packet-v5ef.c             |  11 +-
 wiretap/ascendtext.c                      |  35 +-----
 7 files changed, 238 insertions(+), 131 deletions(-)