Create capture dissector table for LLC non-snap dissectors.

Change-Id: I37602d0e2148150b55b2812855bccf2f181d31b8
Reviewed-on: https://code.wireshark.org/review/12737
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2015-12-19 21:43:53 -05:00
parent f1e07c4d60
commit 7e0ec2c8eb
9 changed files with 10 additions and 55 deletions

View File

@ -1721,7 +1721,6 @@ DISSECTOR_INCLUDES = \
packet-umts_mac.h \
packet-usb.h \
packet-usb-hid.h \
packet-vines.h \
packet-wap.h \
packet-wccp.h \
packet-windows-common.h \

View File

@ -3203,6 +3203,7 @@ proto_reg_handoff_ip(void)
register_capture_dissector("ax25.pid", AX25_P_IP, capture_ip, proto_ip);
register_capture_dissector("enc", BSD_AF_INET, capture_ip, proto_ip);
register_capture_dissector("ppp_hdlc", PPP_IP, capture_ip, proto_ip);
register_capture_dissector("llc.dsap", SAP_IP, capture_ip, proto_ip);
}
/*

View File

@ -1627,6 +1627,8 @@ proto_reg_handoff_ipx(void)
register_capture_dissector("ethertype", ETHERTYPE_IPX, capture_ipx, proto_ipx);
register_capture_dissector("ppp_hdlc", PPP_IPX, capture_ipx, proto_ipx);
register_capture_dissector("sll.ltype", LINUX_SLL_P_802_3, capture_ipx, proto_ipx);
register_capture_dissector("llc.dsap", SAP_NETWARE1, capture_ipx, proto_ipx);
register_capture_dissector("llc.dsap", SAP_NETWARE2, capture_ipx, proto_ipx);
data_handle = find_dissector("data");
}

View File

@ -38,7 +38,6 @@
#include "packet-ip.h"
#include "packet-ipx.h"
#include "packet-netbios.h"
#include "packet-vines.h"
#include "packet-sll.h"
#include "packet-juniper.h"
@ -282,23 +281,7 @@ capture_llc(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo
return capture_snap(pd, offset+llc_header_len, len, cpinfo, pseudo_header);
/* non-SNAP */
switch (pd[offset]) {
case SAP_IP:
return capture_ip(pd, offset + llc_header_len, len, cpinfo, pseudo_header);
case SAP_NETWARE1:
case SAP_NETWARE2:
return capture_ipx(pd, offset + llc_header_len, len, cpinfo, pseudo_header);
case SAP_NETBIOS:
return capture_netbios(pd, offset + llc_header_len, len, cpinfo, pseudo_header);
case SAP_VINES1:
case SAP_VINES2:
return capture_vines(pd, offset + llc_header_len, len, cpinfo, pseudo_header);
}
return FALSE;
return try_capture_dissector("llc.dsap", pd[offset], pd, offset + llc_header_len, len, cpinfo, pseudo_header);
}
gboolean
@ -838,6 +821,7 @@ proto_register_llc(void)
"LLC SAP", FT_UINT8, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
xid_subdissector_table = register_dissector_table("llc.xid_dsap",
"LLC XID SAP", FT_UINT8, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE);
register_capture_dissector_table("llc.dsap", "LLC");
register_dissector("llc", dissect_llc, proto_llc);
}

View File

@ -27,6 +27,7 @@
#include "config.h"
#include <epan/packet.h>
#include <epan/capture_dissectors.h>
#include <epan/llcsaps.h>
#include <epan/reassemble.h>
#include <epan/prefs.h>
@ -284,7 +285,7 @@ static const value_string max_frame_size_vals[] = {
};
gboolean
static gboolean
capture_netbios(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
cpinfo->counts->netbios++;
@ -1488,6 +1489,7 @@ proto_reg_handoff_netbios(void)
netbios_handle = create_dissector_handle(dissect_netbios,
proto_netbios);
dissector_add_uint("llc.dsap", SAP_NETBIOS, netbios_handle);
register_capture_dissector("llc.dsap", SAP_NETBIOS, capture_netbios, proto_netbios);
data_handle = find_dissector("data");
}

View File

@ -30,8 +30,6 @@
/* Length of NetBIOS names */
#define NETBIOS_NAME_LEN 16
gboolean capture_netbios(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
extern int process_netbios_name(const guchar *name_ptr, char *name_ret, int name_ret_len);
extern int get_netbios_name(tvbuff_t *tvb, int offset,
char *name_ret, int name_ret_len);

View File

@ -38,7 +38,6 @@
#include "packet-chdlc.h"
#include "packet-ip.h"
#include "packet-ipx.h"
#include "packet-vines.h"
#include <epan/nlpid.h>
#include <epan/crc16-tvb.h>
#include <epan/crc32-tvb.h>

View File

@ -84,7 +84,6 @@
#include <epan/packet.h>
#include <epan/capture_dissectors.h>
#include "packet-vines.h"
#include <epan/etypes.h>
#include <epan/ppptypes.h>
#include <epan/ipproto.h>
@ -2022,6 +2021,8 @@ proto_reg_handoff_vines_icp(void)
register_capture_dissector("ppp_hdlc", PPP_VINES, capture_vines, proto_vines_echo);
register_capture_dissector("ip.proto", PPP_VINES, capture_vines, proto_vines_echo);
register_capture_dissector("ipv6.nxt", PPP_VINES, capture_vines, proto_vines_echo);
register_capture_dissector("llc.dsap", SAP_VINES1, capture_vines, proto_vines_echo);
register_capture_dissector("llc.dsap", SAP_VINES2, capture_vines, proto_vines_echo);
}
/*

View File

@ -1,31 +0,0 @@
/* packet-vines.h
* Definitions for packet disassembly structures and routines
*
* Don Lafontaine <lafont02@cn.ca>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
* Joerg Mayer (see AUTHORS file)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __PACKETVINES_H__
#define __PACKETVINES_H__
gboolean capture_vines(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
#endif /* packet-vines.h */