1998-09-16 02:39:15 +00:00
|
|
|
/* packet-llc.c
|
|
|
|
* Routines for IEEE 802.2 LLC layer
|
2001-11-13 23:55:44 +00:00
|
|
|
* Gilbert Ramirez <gram@alumni.rice.edu>
|
1998-09-16 02:39:15 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1998-09-16 03:22:19 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1998-09-16 02:39:15 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
1998-09-16 02:39:15 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
1998-09-16 02:39:15 +00:00
|
|
|
|
1999-03-23 03:14:46 +00:00
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/oui.h>
|
2004-09-28 23:48:02 +00:00
|
|
|
#include <epan/xdlc.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/etypes.h>
|
|
|
|
#include <epan/llcsaps.h>
|
|
|
|
#include <epan/bridged_pids.h>
|
|
|
|
#include <epan/ppptypes.h>
|
|
|
|
#include <epan/arcnet_pids.h>
|
2006-04-21 11:08:24 +00:00
|
|
|
#include <epan/conversation.h>
|
2006-10-11 10:38:59 +00:00
|
|
|
#include "packet-scsi.h"
|
Move the handling of the Network_Header for full FC frames into the FC
dissector, and have the LLC dissector register itself as the dissector
for IP-over-FC frames, as the payload is just an LLC 802.2 header plus
payload for the protocol specified by that header.
In the dissector for IP-over-FC as a Wiretap link-layer type, have its
top-level item be a protocol item rather than a text item, and don't
register it as the dissector for IP-over-FC frames from the FC dissector
- it assumes what it's handed includes the Network_Header, but for full
FC frames, the FC dissector has already consumed the Network_Header.
Move the definitions of the value_string tables out of the header file;
most of them are used only in one file, so define them in that file, and
for "fc_fc4_val", define it in "packet-fc.c", make it not static, and
declare it in "packet-fc.h".
Use FALSE, rather than 0, as the last argument to
"proto_tree_add_item()" calls that add a big-endian value.
Fix one "proto_tree_add_uint()" call that was supposed to be a
"proto_tree_add_item()" call.
Use "%u", not "%d", to display unsigned values.
svn path=/trunk/; revision=6773
2002-12-10 02:49:31 +00:00
|
|
|
#include "packet-fc.h"
|
2000-02-15 21:06:58 +00:00
|
|
|
#include "packet-ip.h"
|
|
|
|
#include "packet-ipx.h"
|
|
|
|
#include "packet-netbios.h"
|
2003-04-18 03:41:39 +00:00
|
|
|
#include "packet-vines.h"
|
2010-09-12 01:13:42 +00:00
|
|
|
#include "packet-sll.h"
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/sna-utils.h>
|
2000-02-15 21:06:58 +00:00
|
|
|
|
2001-01-10 09:07:35 +00:00
|
|
|
#include "packet-llc.h"
|
|
|
|
|
2002-05-29 03:08:02 +00:00
|
|
|
#define UDP_PORT_LLC1 12000
|
|
|
|
#define UDP_PORT_LLC2 12001
|
|
|
|
#define UDP_PORT_LLC3 12002
|
|
|
|
#define UDP_PORT_LLC4 12003
|
|
|
|
#define UDP_PORT_LLC5 12004
|
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
static int proto_llc = -1;
|
|
|
|
static int hf_llc_dsap = -1;
|
|
|
|
static int hf_llc_ssap = -1;
|
1999-12-13 21:48:18 +00:00
|
|
|
static int hf_llc_dsap_ig = -1;
|
|
|
|
static int hf_llc_ssap_cr = -1;
|
1999-07-29 05:47:07 +00:00
|
|
|
static int hf_llc_ctrl = -1;
|
2004-01-03 03:51:27 +00:00
|
|
|
static int hf_llc_n_r = -1;
|
|
|
|
static int hf_llc_n_s = -1;
|
|
|
|
static int hf_llc_p = -1;
|
|
|
|
static int hf_llc_p_ext = -1;
|
|
|
|
static int hf_llc_f = -1;
|
|
|
|
static int hf_llc_f_ext = -1;
|
|
|
|
static int hf_llc_s_ftype = -1;
|
|
|
|
static int hf_llc_u_modifier_cmd = -1;
|
|
|
|
static int hf_llc_u_modifier_resp = -1;
|
|
|
|
static int hf_llc_ftype_i = -1;
|
|
|
|
static int hf_llc_ftype_s_u = -1;
|
|
|
|
static int hf_llc_ftype_s_u_ext = -1;
|
1999-07-29 05:47:07 +00:00
|
|
|
static int hf_llc_type = -1;
|
|
|
|
static int hf_llc_oui = -1;
|
1999-12-05 09:45:32 +00:00
|
|
|
static int hf_llc_pid = -1;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2005-10-25 06:00:53 +00:00
|
|
|
static int proto_basicxid = -1;
|
|
|
|
static int hf_llc_xid_format = -1;
|
|
|
|
static int hf_llc_xid_types = -1;
|
|
|
|
static int hf_llc_xid_wsize = -1;
|
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_llc = -1;
|
|
|
|
static gint ett_llc_ctrl = -1;
|
2005-10-25 06:00:53 +00:00
|
|
|
static gint ett_llc_basicxid = -1;
|
1999-11-16 11:44:20 +00:00
|
|
|
|
2009-05-03 01:16:34 +00:00
|
|
|
static dissector_table_t dsap_subdissector_table;
|
2003-02-13 00:47:42 +00:00
|
|
|
static dissector_table_t xid_subdissector_table;
|
2000-04-17 00:32:43 +00:00
|
|
|
|
2009-05-02 21:51:51 +00:00
|
|
|
static dissector_table_t ethertype_subdissector_table;
|
2009-06-23 21:05:47 +00:00
|
|
|
static dissector_table_t hpteam_subdissector_table;
|
2009-05-02 21:51:51 +00:00
|
|
|
|
2000-11-16 07:35:43 +00:00
|
|
|
static dissector_handle_t bpdu_handle;
|
2004-11-24 09:13:52 +00:00
|
|
|
static dissector_handle_t eth_withoutfcs_handle;
|
|
|
|
static dissector_handle_t eth_withfcs_handle;
|
2001-01-10 09:07:35 +00:00
|
|
|
static dissector_handle_t fddi_handle;
|
|
|
|
static dissector_handle_t tr_handle;
|
2008-04-10 23:56:10 +00:00
|
|
|
static dissector_handle_t turbo_handle;
|
2009-05-02 21:51:51 +00:00
|
|
|
static dissector_handle_t mesh_handle;
|
2001-11-25 22:51:14 +00:00
|
|
|
static dissector_handle_t data_handle;
|
2000-11-16 07:35:43 +00:00
|
|
|
|
1999-12-13 23:39:59 +00:00
|
|
|
/*
|
|
|
|
* Group/Individual bit, in the DSAP.
|
|
|
|
*/
|
|
|
|
#define DSAP_GI_BIT 0x01
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Command/Response bit, in the SSAP.
|
|
|
|
*
|
|
|
|
* The low-order bit of the SSAP apparently determines whether this
|
|
|
|
* is a request or a response. (RFC 1390, "Transmission of IP and
|
|
|
|
* ARP over FDDI Networks", says
|
|
|
|
*
|
|
|
|
* Command frames are identified by having the low order
|
|
|
|
* bit of the SSAP address reset to zero. Response frames
|
|
|
|
* have the low order bit of the SSAP address set to one.
|
|
|
|
*
|
|
|
|
* and a page I've seen seems to imply that's part of 802.2.)
|
|
|
|
*/
|
|
|
|
#define SSAP_CR_BIT 0x01
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mask to extrace the SAP number from the DSAP or the SSAP.
|
|
|
|
*/
|
|
|
|
#define SAP_MASK 0xFE
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These are for SSAP and DSAP, wth last bit always zero.
|
1999-12-14 07:22:56 +00:00
|
|
|
* XXX - some DSAPs come in separate "individual" and "group" versions,
|
|
|
|
* with the last bit 0 and 1, respectively (e.g., LLC Sub-layer Management,
|
2000-01-24 02:44:52 +00:00
|
|
|
* IBM SNA Path Control, IBM Net Management), but, whilst 0xFE is
|
1999-12-14 07:22:56 +00:00
|
|
|
* the ISO Network Layer Protocol, 0xFF is the Global LSAP.
|
1999-12-13 23:39:59 +00:00
|
|
|
*/
|
2002-11-05 22:50:42 +00:00
|
|
|
const value_string sap_vals[] = {
|
2000-04-17 00:32:43 +00:00
|
|
|
{ SAP_NULL, "NULL LSAP" },
|
|
|
|
{ SAP_LLC_SLMGMT, "LLC Sub-Layer Management" },
|
|
|
|
{ SAP_SNA_PATHCTRL, "SNA Path Control" },
|
|
|
|
{ SAP_IP, "TCP/IP" },
|
|
|
|
{ SAP_SNA1, "SNA" },
|
|
|
|
{ SAP_SNA2, "SNA" },
|
|
|
|
{ SAP_PROWAY_NM_INIT, "PROWAY (IEC955) Network Management and Initialization" },
|
2003-06-10 05:38:52 +00:00
|
|
|
{ SAP_NETWARE1, "NetWare (unofficial?)" },
|
|
|
|
{ SAP_OSINL1, "ISO Network Layer (OSLAN 1)" },
|
2000-04-17 00:32:43 +00:00
|
|
|
{ SAP_TI, "Texas Instruments" },
|
2003-06-10 05:38:52 +00:00
|
|
|
{ SAP_OSINL2, "ISO Network Layer (unofficial?)" },
|
|
|
|
{ SAP_OSINL3, "ISO Network Layer (unofficial?)" },
|
2000-04-17 00:32:43 +00:00
|
|
|
{ SAP_BPDU, "Spanning Tree BPDU" },
|
|
|
|
{ SAP_RS511, "EIA RS-511 Manufacturing Message Service" },
|
2003-06-10 05:38:52 +00:00
|
|
|
{ SAP_OSINL4, "ISO Network Layer (OSLAN 2)" },
|
2001-01-05 19:07:38 +00:00
|
|
|
{ SAP_X25, "ISO 8208 (X.25 over 802.2)" },
|
|
|
|
/*
|
|
|
|
* XXX - setting the group bit of SAP_X25 make 0x7F; is this just
|
|
|
|
* a group version of that?
|
|
|
|
*/
|
2000-04-17 00:32:43 +00:00
|
|
|
{ 0x7F, "ISO 802.2" },
|
|
|
|
{ SAP_XNS, "XNS" },
|
2002-11-16 08:55:13 +00:00
|
|
|
{ SAP_BACNET, "BACnet" },
|
2000-04-17 00:32:43 +00:00
|
|
|
{ SAP_NESTAR, "Nestar" },
|
|
|
|
{ SAP_PROWAY_ASLM, "PROWAY (IEC955) Active Station List Maintenance" },
|
|
|
|
{ SAP_ARP, "ARP" }, /* XXX - hand to "dissect_arp()"? */
|
2005-10-25 06:00:53 +00:00
|
|
|
{ SAP_HPJD, "HP JetDirect Printer" },
|
2000-04-17 00:32:43 +00:00
|
|
|
{ SAP_SNAP, "SNAP" },
|
|
|
|
{ SAP_VINES1, "Banyan Vines" },
|
|
|
|
{ SAP_VINES2, "Banyan Vines" },
|
2003-06-10 05:38:52 +00:00
|
|
|
{ SAP_NETWARE2, "NetWare" },
|
2000-04-17 00:32:43 +00:00
|
|
|
{ SAP_NETBIOS, "NetBIOS" },
|
|
|
|
{ SAP_IBMNM, "IBM Net Management" },
|
2003-03-02 21:52:21 +00:00
|
|
|
{ SAP_HPEXT, "HP Extended LLC" },
|
2000-04-17 00:32:43 +00:00
|
|
|
{ SAP_UB, "Ungermann-Bass" },
|
2003-03-02 21:52:21 +00:00
|
|
|
{ SAP_RPL, "Remote Program Load" },
|
2003-06-10 05:38:52 +00:00
|
|
|
{ SAP_OSINL5, "ISO Network Layer" },
|
2000-04-17 00:32:43 +00:00
|
|
|
{ SAP_GLOBAL, "Global LSAP" },
|
|
|
|
{ 0x00, NULL }
|
1998-09-17 18:43:11 +00:00
|
|
|
};
|
|
|
|
|
2000-02-05 09:34:33 +00:00
|
|
|
/*
|
|
|
|
* See
|
|
|
|
*
|
2005-08-25 21:01:42 +00:00
|
|
|
* http://standards.ieee.org/regauth/oui/oui.txt
|
|
|
|
*
|
2000-02-05 09:34:33 +00:00
|
|
|
* http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/vlan.htm
|
|
|
|
*
|
|
|
|
* for the PIDs for VTP and DRiP that go with an OUI of OUI_CISCO.
|
|
|
|
*/
|
1999-12-29 05:20:00 +00:00
|
|
|
const value_string oui_vals[] = {
|
2006-09-20 06:13:02 +00:00
|
|
|
{ OUI_ENCAP_ETHER, "Encapsulated Ethernet" },
|
|
|
|
{ OUI_XEROX, "Xerox" },
|
1999-07-07 22:52:57 +00:00
|
|
|
/*
|
|
|
|
http://www.cisco.com/univercd/cc/td/doc/product/software/ios113ed/113ed_cr/ibm_r/brprt1/brsrb.htm
|
|
|
|
*/
|
2010-01-29 07:44:39 +00:00
|
|
|
{ OUI_CISCO, "Cisco" },
|
2010-08-16 17:19:42 +00:00
|
|
|
{ OUI_NORTEL, "Nortel Discovery Protocol" },
|
2010-01-29 07:44:39 +00:00
|
|
|
{ OUI_CISCO_90, "Cisco IOS 9.0 Compatible" },
|
|
|
|
{ OUI_FORCE10, "Force10 Networks" },
|
|
|
|
{ OUI_ERICSSON, "Ericsson Group" },
|
|
|
|
{ OUI_CATENA, "Catena Networks" },
|
2006-09-20 06:13:02 +00:00
|
|
|
{ OUI_SONY_ERICSSON, "Sony Ericsson Mobile Communications AB" },
|
|
|
|
{ OUI_SONY_ERICSSON_2, "Sony Ericsson Mobile Communications AB" },
|
2010-01-29 07:44:39 +00:00
|
|
|
{ OUI_PROFINET, "PROFIBUS Nutzerorganisation e.V." },
|
2006-09-20 06:13:02 +00:00
|
|
|
{ OUI_SONY_ERICSSON_3, "Sony Ericsson Mobile Communications AB" },
|
2010-01-29 07:44:39 +00:00
|
|
|
{ OUI_CIMETRICS, "Cimetrics" },
|
|
|
|
{ OUI_IEEE_802_3, "IEEE 802.3" },
|
2006-09-20 06:13:02 +00:00
|
|
|
{ OUI_MEDIA_ENDPOINT, "Media (TIA TR-41 Committee)" },
|
|
|
|
{ OUI_SONY_ERICSSON_4, "Sony Ericsson Mobile Communications AB" },
|
|
|
|
{ OUI_ERICSSON_MOBILE, "Ericsson Mobile Platforms" },
|
|
|
|
{ OUI_SONY_ERICSSON_5, "Sony Ericsson Mobile Communications AB" },
|
|
|
|
{ OUI_SONY_ERICSSON_6, "Sony Ericsson Mobile Communications AB" },
|
|
|
|
{ OUI_SONY_ERICSSON_7, "Sony Ericsson Mobile Communications AB" },
|
2012-11-04 12:47:02 +00:00
|
|
|
{ OUI_BLUETOOTH, "Bluetooth" },
|
2006-09-20 06:13:02 +00:00
|
|
|
{ OUI_SONY_ERICSSON_8, "Sony Ericsson Mobile Communications AB" },
|
2012-02-28 08:04:24 +00:00
|
|
|
{ OUI_IEEE_802_1QBG, "IEEE 802.1Qbg" },
|
2010-01-29 07:44:39 +00:00
|
|
|
{ OUI_TURBOCELL, "Karlnet (Turbocell)" },
|
|
|
|
{ OUI_CISCOWL, "Cisco Wireless (Aironet) L2" },
|
|
|
|
{ OUI_MARVELL, "Marvell Semiconductor" },
|
|
|
|
{ OUI_BRIDGED, "Frame Relay or ATM bridged frames" },
|
|
|
|
{ OUI_IEEE_802_1, "IEEE 802.1 Committee" },
|
|
|
|
{ OUI_ATM_FORUM, "ATM Forum" },
|
|
|
|
{ OUI_EXTREME, "Extreme Networks" },
|
2006-09-20 06:13:02 +00:00
|
|
|
/* RFC 2427, RFC 2684 */
|
2010-01-29 07:44:39 +00:00
|
|
|
{ OUI_CABLE_BPDU, "DOCSIS Spanning Tree" }, /* DOCSIS spanning tree BPDU */
|
|
|
|
{ OUI_SIEMENS, "Siemens AG" },
|
|
|
|
{ OUI_APPLE_ATALK, "Apple (AppleTalk)" },
|
|
|
|
{ OUI_HP, "Hewlett-Packard" },
|
|
|
|
{ OUI_HP_2, "Hewlett-Packard" },
|
2010-02-03 16:59:21 +00:00
|
|
|
/* Registry Name: PPP Vendor Specific OUI Options */
|
|
|
|
{ OUI_3GPP2, "3GPP2 Vendor specific packet ID" },
|
|
|
|
{ OUI_ERICSSON_2, "Ericsson Group" },
|
2010-01-29 07:44:39 +00:00
|
|
|
{ 0, NULL }
|
1999-07-07 22:52:57 +00:00
|
|
|
};
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2010-10-10 23:28:40 +00:00
|
|
|
static const value_string format_vals[] = {
|
2005-10-25 06:00:53 +00:00
|
|
|
{ 0x81, "LLC basic format" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mask to extract the type from XID frame.
|
|
|
|
*/
|
|
|
|
#define TYPES_MASK 0x1F
|
|
|
|
|
2010-10-10 23:28:40 +00:00
|
|
|
static const value_string type_vals[] = {
|
2005-10-25 06:00:53 +00:00
|
|
|
{ 1, "Type 1 LLC (Class I LLC)" },
|
|
|
|
{ 2, "Type 2 LLC" },
|
|
|
|
{ 3, "Type 1 and Type 2 LLCs (Class II LLC)" },
|
|
|
|
{ 4, "Type 3 LLC" },
|
|
|
|
{ 5, "Type 1 and Type 3 LLCs (Class III LLC)" },
|
|
|
|
{ 6, "Type 2 and Type 3 LLCs" },
|
|
|
|
{ 7, "Type 1 and Type 2 and Type 3 LLCs (Class IV LLC)" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2003-08-28 01:29:16 +00:00
|
|
|
/*
|
2009-05-05 03:50:06 +00:00
|
|
|
* Hash table for translating OUIs to an oui_info_t.
|
2003-08-28 01:29:16 +00:00
|
|
|
*/
|
2003-09-03 06:27:03 +00:00
|
|
|
static GHashTable *oui_info_table = NULL;
|
2003-08-28 01:29:16 +00:00
|
|
|
|
|
|
|
/*
|
2003-09-03 06:27:03 +00:00
|
|
|
* Add an entry for a new OUI.
|
2003-08-28 01:29:16 +00:00
|
|
|
*/
|
|
|
|
void
|
2005-07-28 07:53:38 +00:00
|
|
|
llc_add_oui(guint32 oui, const char *table_name, const char *table_ui_name,
|
2003-09-03 06:27:03 +00:00
|
|
|
hf_register_info *hf_item)
|
2003-08-28 01:29:16 +00:00
|
|
|
{
|
|
|
|
oui_info_t *new_info;
|
|
|
|
|
|
|
|
new_info = g_malloc(sizeof (oui_info_t));
|
|
|
|
new_info->table = register_dissector_table(table_name,
|
|
|
|
table_ui_name, FT_UINT16, BASE_HEX);
|
2003-09-03 06:27:03 +00:00
|
|
|
new_info->field_info = hf_item;
|
2003-08-28 01:29:16 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Create the hash table for OUI information, if it doesn't
|
|
|
|
* already exist.
|
|
|
|
*/
|
2003-09-03 06:27:03 +00:00
|
|
|
if (oui_info_table == NULL) {
|
|
|
|
oui_info_table = g_hash_table_new(g_direct_hash,
|
2003-08-28 01:29:16 +00:00
|
|
|
g_direct_equal);
|
|
|
|
}
|
2004-12-25 13:49:30 +00:00
|
|
|
g_hash_table_insert(oui_info_table, GUINT_TO_POINTER(oui), new_info);
|
2003-08-28 01:29:16 +00:00
|
|
|
}
|
|
|
|
|
1999-02-09 00:35:38 +00:00
|
|
|
void
|
2002-08-02 23:36:07 +00:00
|
|
|
capture_llc(const guchar *pd, int offset, int len, packet_counts *ld) {
|
1999-02-09 00:35:38 +00:00
|
|
|
|
|
|
|
int is_snap;
|
1999-09-26 20:31:51 +00:00
|
|
|
guint16 control;
|
1999-11-11 08:04:06 +00:00
|
|
|
int llc_header_len;
|
1999-02-09 00:35:38 +00:00
|
|
|
|
2001-11-20 21:59:18 +00:00
|
|
|
if (!BYTES_ARE_IN_FRAME(offset, len, 2)) {
|
Apple, for some unknown reason, doesn't just encapsulate AppleTalk data
packets as SNAP-encapsulated Ethernet; instead, they use one of their
*own* OUIs, followed by the Ethernet packet type for AppleTalk. (Even
more oddly, they *do* use SNAP-encapsulated Ethernet for AARP....)
Dissect OUI 08-00-07 the same way we dissect the SNAP-encapsulated
Ethernet OUI of 00-00-00, and identify it as an Apple OUI.
Add checks to make sure we actually have a full LLC header and, if it's
a SNAP frame, that we have a full SNAP header as well.
For non-SNAP frames, list both the DSAP and the SSAP in the Info column,
and, for SNAP frames, list the OUI and PID.
svn path=/trunk/; revision=1220
1999-12-05 22:52:00 +00:00
|
|
|
ld->other++;
|
|
|
|
return;
|
|
|
|
}
|
2000-01-24 02:44:52 +00:00
|
|
|
is_snap = (pd[offset] == SAP_SNAP) && (pd[offset+1] == SAP_SNAP);
|
1999-11-11 08:04:06 +00:00
|
|
|
llc_header_len = 2; /* DSAP + SSAP */
|
1999-02-09 00:35:38 +00:00
|
|
|
|
1999-08-23 22:47:13 +00:00
|
|
|
/*
|
1999-12-13 23:39:59 +00:00
|
|
|
* XXX - the page referred to in the comment above about the
|
|
|
|
* Command/Response bit also implies that LLC Type 2 always
|
|
|
|
* uses extended operation, so we don't need to determine
|
|
|
|
* whether it's basic or extended operation; is that the case?
|
1999-08-23 22:47:13 +00:00
|
|
|
*/
|
2002-03-31 21:09:00 +00:00
|
|
|
control = get_xdlc_control(pd, offset+2, pd[offset+1] & SSAP_CR_BIT);
|
1999-11-11 08:04:06 +00:00
|
|
|
llc_header_len += XDLC_CONTROL_LEN(control, TRUE);
|
2001-11-20 21:59:18 +00:00
|
|
|
if (!BYTES_ARE_IN_FRAME(offset, len, llc_header_len)) {
|
Apple, for some unknown reason, doesn't just encapsulate AppleTalk data
packets as SNAP-encapsulated Ethernet; instead, they use one of their
*own* OUIs, followed by the Ethernet packet type for AppleTalk. (Even
more oddly, they *do* use SNAP-encapsulated Ethernet for AARP....)
Dissect OUI 08-00-07 the same way we dissect the SNAP-encapsulated
Ethernet OUI of 00-00-00, and identify it as an Apple OUI.
Add checks to make sure we actually have a full LLC header and, if it's
a SNAP frame, that we have a full SNAP header as well.
For non-SNAP frames, list both the DSAP and the SSAP in the Info column,
and, for SNAP frames, list the OUI and PID.
svn path=/trunk/; revision=1220
1999-12-05 22:52:00 +00:00
|
|
|
ld->other++;
|
|
|
|
return;
|
|
|
|
}
|
1999-02-09 00:35:38 +00:00
|
|
|
|
2005-03-21 03:55:50 +00:00
|
|
|
if (!XDLC_IS_INFORMATION(control)) {
|
|
|
|
ld->other++;
|
|
|
|
return;
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|
2005-03-21 03:55:50 +00:00
|
|
|
if (is_snap)
|
2009-07-13 22:29:59 +00:00
|
|
|
capture_snap(pd, offset+llc_header_len, len, ld);
|
1999-08-23 22:47:13 +00:00
|
|
|
else {
|
2002-04-24 06:03:34 +00:00
|
|
|
/* non-SNAP */
|
2005-03-21 03:55:50 +00:00
|
|
|
switch (pd[offset]) {
|
|
|
|
|
|
|
|
case SAP_IP:
|
|
|
|
capture_ip(pd, offset + llc_header_len, len, ld);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SAP_NETWARE1:
|
|
|
|
case SAP_NETWARE2:
|
|
|
|
capture_ipx(ld);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SAP_NETBIOS:
|
|
|
|
capture_netbios(ld);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SAP_VINES1:
|
|
|
|
case SAP_VINES2:
|
|
|
|
capture_vines(ld);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
ld->other++;
|
|
|
|
break;
|
1999-02-09 00:35:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-21 03:55:50 +00:00
|
|
|
void
|
|
|
|
capture_snap(const guchar *pd, int offset, int len, packet_counts *ld)
|
|
|
|
{
|
|
|
|
guint32 oui;
|
|
|
|
guint16 etype;
|
|
|
|
|
|
|
|
if (!BYTES_ARE_IN_FRAME(offset, len, 5)) {
|
|
|
|
ld->other++;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
oui = pd[offset] << 16 | pd[offset+1] << 8 | pd[offset+2];
|
|
|
|
etype = pntohs(&pd[offset+3]);
|
|
|
|
switch (oui) {
|
|
|
|
|
|
|
|
case OUI_ENCAP_ETHER:
|
|
|
|
case OUI_CISCO_90:
|
|
|
|
case OUI_APPLE_ATALK:
|
|
|
|
/* No, I have no idea why Apple used
|
|
|
|
one of their own OUIs, rather than
|
|
|
|
OUI_ENCAP_ETHER, and an Ethernet
|
|
|
|
packet type as protocol ID, for
|
|
|
|
AppleTalk data packets - but used
|
|
|
|
OUI_ENCAP_ETHER and an Ethernet
|
|
|
|
packet type for AARP packets. */
|
|
|
|
capture_ethertype(etype, pd, offset+5, len, ld);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OUI_CISCO:
|
|
|
|
capture_ethertype(etype, pd, offset+5, len, ld);
|
|
|
|
break;
|
|
|
|
|
2009-05-02 21:51:51 +00:00
|
|
|
case OUI_MARVELL:
|
|
|
|
/*
|
|
|
|
* OLPC packet. The PID is an Ethertype, but
|
|
|
|
* there's a mesh header between the PID and
|
|
|
|
* the payload. (We assume the header is
|
|
|
|
* 5 bytes, for now).
|
|
|
|
*/
|
|
|
|
capture_ethertype(etype, pd, offset+5+5, len, ld);
|
|
|
|
break;
|
|
|
|
|
2005-03-21 03:55:50 +00:00
|
|
|
default:
|
|
|
|
ld->other++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-03 03:51:27 +00:00
|
|
|
/* Used only for U frames */
|
|
|
|
static const xdlc_cf_items llc_cf_items = {
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
&hf_llc_p,
|
|
|
|
&hf_llc_f,
|
|
|
|
NULL,
|
|
|
|
&hf_llc_u_modifier_cmd,
|
|
|
|
&hf_llc_u_modifier_resp,
|
|
|
|
NULL,
|
|
|
|
&hf_llc_ftype_s_u
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Used only for I and S frames */
|
|
|
|
static const xdlc_cf_items llc_cf_items_ext = {
|
|
|
|
&hf_llc_n_r,
|
|
|
|
&hf_llc_n_s,
|
|
|
|
&hf_llc_p_ext,
|
|
|
|
&hf_llc_f_ext,
|
|
|
|
&hf_llc_s_ftype,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
&hf_llc_ftype_i,
|
|
|
|
&hf_llc_ftype_s_u_ext
|
|
|
|
};
|
|
|
|
|
2005-10-25 06:00:53 +00:00
|
|
|
static void
|
|
|
|
dissect_basicxid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_tree *xid_tree = NULL;
|
|
|
|
proto_item *ti = NULL;
|
|
|
|
guint8 format, types, wsize;
|
|
|
|
|
2009-08-09 07:59:51 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "XID");
|
2009-08-09 08:14:59 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2005-10-25 06:00:53 +00:00
|
|
|
|
|
|
|
format = tvb_get_guint8(tvb, 0);
|
|
|
|
if (tree) {
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_basicxid, tvb, 0, -1, ENC_NA);
|
2005-10-25 06:00:53 +00:00
|
|
|
xid_tree = proto_item_add_subtree(ti, ett_llc_basicxid);
|
|
|
|
proto_tree_add_uint(xid_tree, hf_llc_xid_format, tvb, 0,
|
|
|
|
1, format);
|
|
|
|
} else
|
|
|
|
xid_tree = NULL;
|
2009-09-24 20:00:21 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO,
|
2005-10-25 06:00:53 +00:00
|
|
|
"Basic Format");
|
|
|
|
|
|
|
|
types = tvb_get_guint8(tvb, 1);
|
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_uint(xid_tree, hf_llc_xid_types, tvb, 1,
|
|
|
|
1, types & TYPES_MASK);
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO,
|
|
|
|
"; %s", val_to_str(types & TYPES_MASK, type_vals, "0x%02x")
|
|
|
|
);
|
|
|
|
}
|
|
|
|
wsize = tvb_get_guint8(tvb, 2);
|
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_uint(xid_tree, hf_llc_xid_wsize, tvb, 2,
|
|
|
|
1, (wsize & 0xFE) >> 1);
|
|
|
|
}
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO,
|
|
|
|
"; Window Size %d", (wsize & 0xFE) >> 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-01-03 10:34:42 +00:00
|
|
|
static void
|
2000-05-11 22:04:18 +00:00
|
|
|
dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
1999-03-23 03:14:46 +00:00
|
|
|
proto_tree *llc_tree = NULL;
|
1999-09-26 20:31:51 +00:00
|
|
|
proto_item *ti = NULL;
|
1998-09-17 18:43:11 +00:00
|
|
|
int is_snap;
|
1999-09-26 20:31:51 +00:00
|
|
|
guint16 control;
|
1999-11-11 08:04:06 +00:00
|
|
|
int llc_header_len;
|
2005-10-25 06:00:53 +00:00
|
|
|
guint8 dsap, ssap, format;
|
2000-05-11 22:04:18 +00:00
|
|
|
tvbuff_t *next_tvb;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2009-08-09 07:59:51 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LLC");
|
2009-08-09 08:14:59 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
Apple, for some unknown reason, doesn't just encapsulate AppleTalk data
packets as SNAP-encapsulated Ethernet; instead, they use one of their
*own* OUIs, followed by the Ethernet packet type for AppleTalk. (Even
more oddly, they *do* use SNAP-encapsulated Ethernet for AARP....)
Dissect OUI 08-00-07 the same way we dissect the SNAP-encapsulated
Ethernet OUI of 00-00-00, and identify it as an Apple OUI.
Add checks to make sure we actually have a full LLC header and, if it's
a SNAP frame, that we have a full SNAP header as well.
For non-SNAP frames, list both the DSAP and the SSAP in the Info column,
and, for SNAP frames, list the OUI and PID.
svn path=/trunk/; revision=1220
1999-12-05 22:52:00 +00:00
|
|
|
|
2000-05-11 22:04:18 +00:00
|
|
|
dsap = tvb_get_guint8(tvb, 0);
|
1998-09-16 02:39:15 +00:00
|
|
|
if (tree) {
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_llc, tvb, 0, -1, ENC_NA);
|
1999-11-16 11:44:20 +00:00
|
|
|
llc_tree = proto_item_add_subtree(ti, ett_llc);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_uint(llc_tree, hf_llc_dsap, tvb, 0,
|
2000-05-11 22:04:18 +00:00
|
|
|
1, dsap & SAP_MASK);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(llc_tree, hf_llc_dsap_ig, tvb, 0,
|
2000-05-11 22:04:18 +00:00
|
|
|
1, dsap & DSAP_GI_BIT);
|
2000-05-28 22:02:17 +00:00
|
|
|
} else
|
|
|
|
llc_tree = NULL;
|
|
|
|
|
|
|
|
ssap = tvb_get_guint8(tvb, 1);
|
|
|
|
if (tree) {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_uint(llc_tree, hf_llc_ssap, tvb, 1,
|
2000-05-11 22:04:18 +00:00
|
|
|
1, ssap & SAP_MASK);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(llc_tree, hf_llc_ssap_cr, tvb, 1,
|
2000-05-11 22:04:18 +00:00
|
|
|
1, ssap & SSAP_CR_BIT);
|
1999-08-04 04:37:46 +00:00
|
|
|
} else
|
|
|
|
llc_tree = NULL;
|
|
|
|
|
2000-05-28 22:02:17 +00:00
|
|
|
is_snap = (dsap == SAP_SNAP) && (ssap == SAP_SNAP);
|
|
|
|
llc_header_len = 2; /* DSAP + SSAP */
|
|
|
|
|
1999-08-04 04:37:46 +00:00
|
|
|
/*
|
1999-12-13 23:39:59 +00:00
|
|
|
* XXX - the page referred to in the comment above about the
|
|
|
|
* Command/Response bit also implies that LLC Type 2 always
|
|
|
|
* uses extended operation, so we don't need to determine
|
|
|
|
* whether it's basic or extended operation; is that the case?
|
1999-08-04 04:37:46 +00:00
|
|
|
*/
|
2000-05-31 03:58:56 +00:00
|
|
|
control = dissect_xdlc_control(tvb, 2, pinfo, llc_tree,
|
1999-11-16 11:44:20 +00:00
|
|
|
hf_llc_ctrl, ett_llc_ctrl,
|
2004-01-03 03:51:27 +00:00
|
|
|
&llc_cf_items, &llc_cf_items_ext,
|
2004-01-18 08:32:46 +00:00
|
|
|
NULL, NULL, ssap & SSAP_CR_BIT, TRUE, FALSE);
|
1999-11-11 08:04:06 +00:00
|
|
|
llc_header_len += XDLC_CONTROL_LEN(control, TRUE);
|
1999-09-26 20:40:00 +00:00
|
|
|
if (is_snap)
|
1999-12-05 09:45:32 +00:00
|
|
|
llc_header_len += 5; /* 3 bytes of OUI, 2 bytes of protocol ID */
|
2000-05-11 22:04:18 +00:00
|
|
|
|
1999-09-26 20:31:51 +00:00
|
|
|
if (tree)
|
1999-11-11 08:04:06 +00:00
|
|
|
proto_item_set_len(ti, llc_header_len);
|
1999-08-04 04:37:46 +00:00
|
|
|
|
1998-09-16 02:39:15 +00:00
|
|
|
if (is_snap) {
|
2009-07-13 22:29:59 +00:00
|
|
|
dissect_snap(tvb, 2+XDLC_CONTROL_LEN(control, TRUE), pinfo, tree, llc_tree, control,
|
2001-01-11 07:24:17 +00:00
|
|
|
hf_llc_oui, hf_llc_type, hf_llc_pid, 2);
|
2000-05-11 22:04:18 +00:00
|
|
|
}
|
1998-09-16 02:39:15 +00:00
|
|
|
else {
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
2002-08-28 21:04:11 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO,
|
2000-08-25 06:31:25 +00:00
|
|
|
"; DSAP %s %s, SSAP %s %s",
|
2005-07-20 22:11:48 +00:00
|
|
|
val_to_str(dsap & SAP_MASK, sap_vals, "0x%02x"),
|
2000-05-11 22:04:18 +00:00
|
|
|
dsap & DSAP_GI_BIT ?
|
1999-12-13 23:39:59 +00:00
|
|
|
"Group" : "Individual",
|
2005-07-20 22:11:48 +00:00
|
|
|
val_to_str(ssap & SAP_MASK, sap_vals, "0x%02x"),
|
2000-05-11 22:04:18 +00:00
|
|
|
ssap & SSAP_CR_BIT ?
|
2000-04-09 18:33:26 +00:00
|
|
|
"Response" : "Command"
|
1999-12-13 23:39:59 +00:00
|
|
|
);
|
1998-09-16 02:39:15 +00:00
|
|
|
}
|
|
|
|
|
2003-02-13 00:47:42 +00:00
|
|
|
if (tvb_length_remaining(tvb, llc_header_len) > 0) {
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, llc_header_len);
|
2003-02-13 00:47:42 +00:00
|
|
|
if (XDLC_IS_INFORMATION(control)) {
|
|
|
|
/*
|
|
|
|
* Non-SNAP I or UI frame.
|
|
|
|
* Try the regular LLC subdissector table
|
|
|
|
* with the DSAP.
|
|
|
|
*/
|
2010-12-20 05:35:29 +00:00
|
|
|
if (!dissector_try_uint(dsap_subdissector_table,
|
2003-02-13 00:47:42 +00:00
|
|
|
dsap, next_tvb, pinfo, tree)) {
|
|
|
|
call_dissector(data_handle, next_tvb,
|
|
|
|
pinfo, tree);
|
|
|
|
}
|
|
|
|
} else if ((control & (XDLC_U_MODIFIER_MASK|XDLC_U))
|
|
|
|
== (XDLC_XID|XDLC_U)) {
|
|
|
|
/*
|
|
|
|
* Non-SNAP XID frame.
|
2005-10-25 06:00:53 +00:00
|
|
|
* Test for LLC basic format first
|
|
|
|
*/
|
|
|
|
format = tvb_get_guint8(next_tvb, 0);
|
|
|
|
if (format == 0x81) {
|
|
|
|
dissect_basicxid(next_tvb, pinfo, tree);
|
|
|
|
} else {
|
|
|
|
/*
|
2003-02-13 00:47:42 +00:00
|
|
|
* Try the XID LLC subdissector table
|
|
|
|
* with the DSAP.
|
|
|
|
*/
|
2010-12-20 05:35:29 +00:00
|
|
|
if (!dissector_try_uint(
|
2005-10-25 06:00:53 +00:00
|
|
|
xid_subdissector_table, dsap, next_tvb,
|
|
|
|
pinfo, tree)) {
|
|
|
|
call_dissector(data_handle,
|
|
|
|
next_tvb, pinfo, tree);
|
|
|
|
}
|
2003-02-13 00:47:42 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
call_dissector(data_handle, next_tvb, pinfo,
|
|
|
|
tree);
|
1999-08-23 22:47:13 +00:00
|
|
|
}
|
2000-04-09 18:33:26 +00:00
|
|
|
}
|
1998-09-16 02:39:15 +00:00
|
|
|
}
|
|
|
|
}
|
1999-07-07 22:52:57 +00:00
|
|
|
|
2001-01-10 09:07:35 +00:00
|
|
|
/*
|
|
|
|
* Dissect SNAP header; used elsewhere, e.g. in the Frame Relay dissector.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
|
|
|
|
proto_tree *snap_tree, int control, int hf_oui, int hf_type, int hf_pid,
|
|
|
|
int bridge_pad)
|
|
|
|
{
|
|
|
|
guint32 oui;
|
|
|
|
guint16 etype;
|
|
|
|
tvbuff_t *next_tvb;
|
2003-08-28 01:29:16 +00:00
|
|
|
oui_info_t *oui_info;
|
|
|
|
dissector_table_t subdissector_table;
|
|
|
|
int hf;
|
2009-05-02 21:51:51 +00:00
|
|
|
int mesh_header_len;
|
2001-01-10 09:07:35 +00:00
|
|
|
|
2005-03-21 03:55:50 +00:00
|
|
|
/*
|
|
|
|
* XXX - what about non-UI frames?
|
|
|
|
*/
|
2001-01-10 09:07:35 +00:00
|
|
|
oui = tvb_get_ntoh24(tvb, offset);
|
|
|
|
etype = tvb_get_ntohs(tvb, offset+3);
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO,
|
2001-01-10 09:07:35 +00:00
|
|
|
"; SNAP, OUI 0x%06X (%s), PID 0x%04X",
|
2012-08-10 22:55:02 +00:00
|
|
|
oui, val_to_str_const(oui, oui_vals, "Unknown"), etype);
|
2001-01-10 09:07:35 +00:00
|
|
|
}
|
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_uint(snap_tree, hf_oui, tvb, offset, 3, oui);
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (oui) {
|
|
|
|
|
2009-06-23 21:05:47 +00:00
|
|
|
case OUI_HP_2:
|
|
|
|
oui_info = get_snap_oui_info(oui);
|
|
|
|
hf = *oui_info->field_info->p_id;
|
|
|
|
subdissector_table = oui_info->table;
|
|
|
|
proto_tree_add_uint(snap_tree, hf, tvb, offset+3, 2, etype);
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5);
|
2009-06-23 21:05:47 +00:00
|
|
|
|
2010-12-20 05:35:29 +00:00
|
|
|
if(!dissector_try_uint(hpteam_subdissector_table,etype, next_tvb, pinfo, tree))
|
2009-06-23 21:05:47 +00:00
|
|
|
call_dissector(data_handle, next_tvb, pinfo, tree);
|
|
|
|
break;
|
|
|
|
|
2001-01-10 09:07:35 +00:00
|
|
|
case OUI_ENCAP_ETHER:
|
2001-06-02 03:04:12 +00:00
|
|
|
case OUI_CISCO_90:
|
2001-01-10 09:07:35 +00:00
|
|
|
case OUI_APPLE_ATALK:
|
|
|
|
/* No, I have no idea why Apple used
|
|
|
|
one of their own OUIs, rather than
|
|
|
|
OUI_ENCAP_ETHER, and an Ethernet
|
|
|
|
packet type as protocol ID, for
|
|
|
|
AppleTalk data packets - but used
|
|
|
|
OUI_ENCAP_ETHER and an Ethernet
|
2001-06-02 03:04:12 +00:00
|
|
|
packet type for AARP packets. */
|
2001-01-10 09:07:35 +00:00
|
|
|
if (XDLC_IS_INFORMATION(control)) {
|
2009-05-03 01:16:34 +00:00
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_uint(snap_tree, hf_type,
|
|
|
|
tvb, offset+3, 2, etype);
|
|
|
|
}
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5);
|
2010-12-20 05:35:29 +00:00
|
|
|
if (!dissector_try_uint(ethertype_subdissector_table,
|
2009-05-03 01:16:34 +00:00
|
|
|
etype, next_tvb, pinfo, tree))
|
|
|
|
call_dissector(data_handle, next_tvb, pinfo,
|
|
|
|
tree);
|
2001-01-10 09:07:35 +00:00
|
|
|
} else {
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5);
|
2009-05-03 01:16:34 +00:00
|
|
|
call_dissector(data_handle, next_tvb, pinfo, tree);
|
2001-01-10 09:07:35 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OUI_BRIDGED:
|
|
|
|
/*
|
|
|
|
* MAC frames bridged over ATM (RFC 2684) or Frame Relay
|
|
|
|
* (RFC 2427).
|
|
|
|
*
|
|
|
|
* We have to figure out how much padding to put
|
|
|
|
* into the frame. We were handed a "bridge_pad"
|
|
|
|
* argument which should be 0 for Frame Relay and
|
|
|
|
* 2 for ATM; we add to that the amount of padding
|
|
|
|
* common to both bridging types.
|
|
|
|
*/
|
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_uint(snap_tree, hf_pid, tvb, offset+3, 2,
|
|
|
|
etype);
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (etype) {
|
|
|
|
|
|
|
|
case BPID_ETH_WITH_FCS:
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5+bridge_pad);
|
2004-11-24 09:13:52 +00:00
|
|
|
call_dissector(eth_withfcs_handle, next_tvb, pinfo,
|
|
|
|
tree);
|
|
|
|
break;
|
|
|
|
|
2001-01-10 09:07:35 +00:00
|
|
|
case BPID_ETH_WITHOUT_FCS:
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5+bridge_pad);
|
2004-11-24 09:13:52 +00:00
|
|
|
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
|
2001-01-10 09:07:35 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BPID_802_5_WITH_FCS:
|
|
|
|
case BPID_802_5_WITHOUT_FCS:
|
|
|
|
/*
|
|
|
|
* We treat the last padding byte as the Access
|
|
|
|
* Control byte, as that's what the Token
|
|
|
|
* Ring dissector expects the first byte to
|
|
|
|
* be.
|
|
|
|
*/
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5+bridge_pad);
|
2001-01-10 09:07:35 +00:00
|
|
|
call_dissector(tr_handle, next_tvb, pinfo, tree);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BPID_FDDI_WITH_FCS:
|
|
|
|
case BPID_FDDI_WITHOUT_FCS:
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5+1+bridge_pad);
|
2001-01-10 09:07:35 +00:00
|
|
|
call_dissector(fddi_handle, next_tvb, pinfo, tree);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BPID_BPDU:
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5);
|
2001-01-10 09:07:35 +00:00
|
|
|
call_dissector(bpdu_handle, next_tvb, pinfo, tree);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5);
|
2009-05-03 01:16:34 +00:00
|
|
|
call_dissector(data_handle, next_tvb, pinfo, tree);
|
2001-01-10 09:07:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-01-10 09:07:35 +00:00
|
|
|
case OUI_CABLE_BPDU: /* DOCSIS cable modem spanning tree BPDU */
|
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_uint(snap_tree, hf_pid, tvb, offset+3, 2,
|
|
|
|
etype);
|
|
|
|
}
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5);
|
2001-01-10 09:07:35 +00:00
|
|
|
call_dissector(bpdu_handle, next_tvb, pinfo, tree);
|
|
|
|
break;
|
|
|
|
|
2008-04-10 23:56:10 +00:00
|
|
|
case OUI_TURBOCELL:
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+3);
|
2008-04-10 23:56:10 +00:00
|
|
|
call_dissector(turbo_handle, next_tvb, pinfo, tree);
|
|
|
|
break;
|
|
|
|
|
2009-05-02 21:51:51 +00:00
|
|
|
case OUI_MARVELL:
|
|
|
|
/*
|
|
|
|
* OLPC packet. The PID is an Ethertype, but
|
|
|
|
* there's a mesh header between the PID and
|
|
|
|
* the payload.
|
|
|
|
*/
|
|
|
|
if (XDLC_IS_INFORMATION(control)) {
|
|
|
|
if (tree) {
|
2009-05-03 01:16:34 +00:00
|
|
|
proto_tree_add_uint(snap_tree, hf_type,
|
2009-05-02 21:51:51 +00:00
|
|
|
tvb, offset+3, 2, etype);
|
|
|
|
}
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5);
|
2009-05-02 21:51:51 +00:00
|
|
|
mesh_header_len = call_dissector(mesh_handle,
|
|
|
|
next_tvb, pinfo, tree);
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5+mesh_header_len);
|
2010-12-20 05:35:29 +00:00
|
|
|
if (!dissector_try_uint(ethertype_subdissector_table,
|
2009-05-02 21:51:51 +00:00
|
|
|
etype, next_tvb, pinfo, tree))
|
2009-05-03 01:16:34 +00:00
|
|
|
call_dissector(data_handle, next_tvb, pinfo,
|
|
|
|
tree);
|
2009-05-02 21:51:51 +00:00
|
|
|
} else {
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5);
|
2009-05-03 01:16:34 +00:00
|
|
|
call_dissector(data_handle, next_tvb, pinfo, tree);
|
2009-05-02 21:51:51 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-01-10 09:07:35 +00:00
|
|
|
default:
|
2003-08-28 01:29:16 +00:00
|
|
|
/*
|
|
|
|
* Do we have information for this OUI?
|
|
|
|
*/
|
2009-05-05 03:50:06 +00:00
|
|
|
oui_info = get_snap_oui_info(oui);
|
|
|
|
if (oui_info != NULL) {
|
2003-08-28 01:29:16 +00:00
|
|
|
/*
|
|
|
|
* Yes - use it.
|
|
|
|
*/
|
2003-09-03 06:27:03 +00:00
|
|
|
hf = *oui_info->field_info->p_id;
|
2003-08-28 01:29:16 +00:00
|
|
|
subdissector_table = oui_info->table;
|
|
|
|
} else {
|
|
|
|
/*
|
|
|
|
* No, use hf_pid for the PID and just dissect
|
|
|
|
* the payload as data.
|
|
|
|
*/
|
|
|
|
hf = hf_pid;
|
|
|
|
subdissector_table = NULL;
|
|
|
|
}
|
2001-01-10 09:07:35 +00:00
|
|
|
if (tree) {
|
2003-08-28 01:29:16 +00:00
|
|
|
proto_tree_add_uint(snap_tree, hf, tvb, offset+3, 2,
|
2001-01-10 09:07:35 +00:00
|
|
|
etype);
|
|
|
|
}
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset+5);
|
2003-08-28 01:29:16 +00:00
|
|
|
if (XDLC_IS_INFORMATION(control)) {
|
|
|
|
if (subdissector_table != NULL) {
|
|
|
|
/* do lookup with the subdissector table */
|
2010-12-20 05:35:29 +00:00
|
|
|
if (dissector_try_uint(subdissector_table,
|
2003-08-28 01:29:16 +00:00
|
|
|
etype, next_tvb, pinfo, tree))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
call_dissector(data_handle, next_tvb, pinfo, tree);
|
2001-01-10 09:07:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-05-05 03:50:06 +00:00
|
|
|
/*
|
|
|
|
* Return the oui_info_t for the PID for a particular OUI value, or NULL
|
|
|
|
* if there isn't one.
|
|
|
|
*/
|
|
|
|
oui_info_t *
|
|
|
|
get_snap_oui_info(guint32 oui)
|
|
|
|
{
|
|
|
|
if (oui_info_table != NULL) {
|
|
|
|
return g_hash_table_lookup(oui_info_table,
|
|
|
|
GUINT_TO_POINTER(oui));
|
|
|
|
} else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1999-07-07 22:52:57 +00:00
|
|
|
void
|
|
|
|
proto_register_llc(void)
|
|
|
|
{
|
1999-12-13 21:48:18 +00:00
|
|
|
static struct true_false_string ig_bit = { "Group", "Individual" };
|
|
|
|
static struct true_false_string cr_bit = { "Response", "Command" };
|
|
|
|
|
1999-07-15 15:33:52 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_llc_dsap,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "DSAP", "llc.dsap", FT_UINT8, BASE_HEX,
|
2005-07-20 22:11:48 +00:00
|
|
|
VALS(sap_vals), 0x0, "DSAP - 7 Most Significant Bits only", HFILL }},
|
1999-12-13 21:48:18 +00:00
|
|
|
|
|
|
|
{ &hf_llc_dsap_ig,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "IG Bit", "llc.dsap.ig", FT_BOOLEAN, BASE_NONE,
|
2009-05-08 06:53:43 +00:00
|
|
|
TFS(&ig_bit), 0x0, "Individual/Group - Least Significant Bit only", HFILL }},
|
1999-07-07 22:52:57 +00:00
|
|
|
|
1999-07-15 15:33:52 +00:00
|
|
|
{ &hf_llc_ssap,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "SSAP", "llc.ssap", FT_UINT8, BASE_HEX,
|
2005-07-20 22:11:48 +00:00
|
|
|
VALS(sap_vals), 0x0, "SSAP - 7 Most Significant Bits only", HFILL }},
|
1999-12-13 21:48:18 +00:00
|
|
|
|
|
|
|
{ &hf_llc_ssap_cr,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "CR Bit", "llc.ssap.cr", FT_BOOLEAN, BASE_NONE,
|
2009-05-08 06:53:43 +00:00
|
|
|
TFS(&cr_bit), 0x0, "Command/Response - Least Significant Bit only", HFILL }},
|
1999-07-07 22:52:57 +00:00
|
|
|
|
1999-07-15 15:33:52 +00:00
|
|
|
{ &hf_llc_ctrl,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Control", "llc.control", FT_UINT16, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-07-15 15:33:52 +00:00
|
|
|
|
2004-01-03 03:51:27 +00:00
|
|
|
{ &hf_llc_n_r,
|
|
|
|
{ "N(R)", "llc.control.n_r", FT_UINT16, BASE_DEC,
|
2009-05-08 06:53:43 +00:00
|
|
|
NULL, XDLC_N_R_EXT_MASK, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
|
|
|
{ &hf_llc_n_s,
|
|
|
|
{ "N(S)", "llc.control.n_s", FT_UINT16, BASE_DEC,
|
2009-05-08 06:53:43 +00:00
|
|
|
NULL, XDLC_N_S_EXT_MASK, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
|
|
|
{ &hf_llc_p,
|
|
|
|
{ "Poll", "llc.control.p", FT_BOOLEAN, 8,
|
2009-07-07 14:54:15 +00:00
|
|
|
TFS(&tfs_set_notset), XDLC_P_F, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
|
|
|
{ &hf_llc_p_ext,
|
|
|
|
{ "Poll", "llc.control.p", FT_BOOLEAN, 16,
|
2009-07-07 14:54:15 +00:00
|
|
|
TFS(&tfs_set_notset), XDLC_P_F_EXT, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
|
|
|
{ &hf_llc_f,
|
|
|
|
{ "Final", "llc.control.f", FT_BOOLEAN, 8,
|
2009-07-07 14:54:15 +00:00
|
|
|
TFS(&tfs_set_notset), XDLC_P_F, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
|
|
|
{ &hf_llc_f_ext,
|
|
|
|
{ "Final", "llc.control.f", FT_BOOLEAN, 16,
|
2009-07-07 14:54:15 +00:00
|
|
|
TFS(&tfs_set_notset), XDLC_P_F_EXT, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
|
|
|
{ &hf_llc_s_ftype,
|
|
|
|
{ "Supervisory frame type", "llc.control.s_ftype", FT_UINT16, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
VALS(stype_vals), XDLC_S_FTYPE_MASK, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
|
|
|
{ &hf_llc_u_modifier_cmd,
|
|
|
|
{ "Command", "llc.control.u_modifier_cmd", FT_UINT8, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
VALS(modifier_vals_cmd), XDLC_U_MODIFIER_MASK, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
|
|
|
{ &hf_llc_u_modifier_resp,
|
|
|
|
{ "Response", "llc.control.u_modifier_resp", FT_UINT8, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
VALS(modifier_vals_resp), XDLC_U_MODIFIER_MASK, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
|
|
|
{ &hf_llc_ftype_i,
|
|
|
|
{ "Frame type", "llc.control.ftype", FT_UINT16, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
VALS(ftype_vals), XDLC_I_MASK, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
|
|
|
{ &hf_llc_ftype_s_u,
|
|
|
|
{ "Frame type", "llc.control.ftype", FT_UINT8, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
VALS(ftype_vals), XDLC_S_U_MASK, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
|
|
|
{ &hf_llc_ftype_s_u_ext,
|
|
|
|
{ "Frame type", "llc.control.ftype", FT_UINT16, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
VALS(ftype_vals), XDLC_S_U_MASK, NULL, HFILL }},
|
2004-01-03 03:51:27 +00:00
|
|
|
|
1999-07-15 15:33:52 +00:00
|
|
|
/* registered here but handled in ethertype.c */
|
|
|
|
{ &hf_llc_type,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Type", "llc.type", FT_UINT16, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
VALS(etype_vals), 0x0, NULL, HFILL }},
|
1999-07-15 15:33:52 +00:00
|
|
|
|
|
|
|
{ &hf_llc_oui,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Organization Code", "llc.oui", FT_UINT24, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
VALS(oui_vals), 0x0, NULL, HFILL }},
|
1999-12-05 09:45:32 +00:00
|
|
|
|
|
|
|
{ &hf_llc_pid,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Protocol ID", "llc.pid", FT_UINT16, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }}
|
1999-07-07 22:52:57 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_llc,
|
2009-05-08 06:53:43 +00:00
|
|
|
&ett_llc_ctrl
|
1999-11-16 11:44:20 +00:00
|
|
|
};
|
1999-07-07 22:52:57 +00:00
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_llc = proto_register_protocol("Logical-Link Control", "LLC", "llc");
|
1999-07-07 22:52:57 +00:00
|
|
|
proto_register_field_array(proto_llc, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2000-04-17 00:32:43 +00:00
|
|
|
|
2009-05-08 06:53:43 +00:00
|
|
|
/* subdissector code */
|
2009-05-03 01:16:34 +00:00
|
|
|
dsap_subdissector_table = register_dissector_table("llc.dsap",
|
2001-12-08 06:41:48 +00:00
|
|
|
"LLC SAP", FT_UINT8, BASE_HEX);
|
2003-02-13 00:47:42 +00:00
|
|
|
xid_subdissector_table = register_dissector_table("llc.xid_dsap",
|
|
|
|
"LLC XID SAP", FT_UINT8, BASE_HEX);
|
2001-01-03 10:34:42 +00:00
|
|
|
|
2001-01-09 06:32:10 +00:00
|
|
|
register_dissector("llc", dissect_llc, proto_llc);
|
1999-07-07 22:52:57 +00:00
|
|
|
}
|
2000-11-16 07:35:43 +00:00
|
|
|
|
2005-10-25 06:00:53 +00:00
|
|
|
void
|
|
|
|
proto_register_basicxid(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_llc_xid_format,
|
2007-10-07 23:30:14 +00:00
|
|
|
{ "XID Format", "basicxid.llc.xid.format", FT_UINT8, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
VALS(format_vals), 0x0, NULL, HFILL }},
|
2005-10-25 06:00:53 +00:00
|
|
|
|
|
|
|
{ &hf_llc_xid_types,
|
2007-10-07 23:30:14 +00:00
|
|
|
{ "LLC Types/Classes", "basicxid.llc.xid.types", FT_UINT8, BASE_HEX,
|
2009-05-08 06:53:43 +00:00
|
|
|
VALS(type_vals), 0x0, NULL, HFILL }},
|
2005-10-25 06:00:53 +00:00
|
|
|
|
|
|
|
{ &hf_llc_xid_wsize,
|
2007-10-07 23:30:14 +00:00
|
|
|
{ "Receive Window Size", "basicxid.llc.xid.wsize", FT_UINT8, BASE_DEC,
|
2009-05-08 06:53:43 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }}
|
2005-10-25 06:00:53 +00:00
|
|
|
};
|
|
|
|
static gint *ett[] = {
|
2009-05-08 06:53:43 +00:00
|
|
|
&ett_llc_basicxid
|
2005-10-25 06:00:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
proto_basicxid = proto_register_protocol("Logical-Link Control Basic Format XID", "Basic Format XID", "basicxid");
|
|
|
|
proto_register_field_array(proto_basicxid, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
|
|
|
register_dissector("basicxid", dissect_basicxid, proto_basicxid);
|
|
|
|
}
|
|
|
|
|
2003-09-03 06:27:03 +00:00
|
|
|
static void
|
|
|
|
register_hf(gpointer key _U_, gpointer value, gpointer user_data _U_)
|
|
|
|
{
|
|
|
|
oui_info_t *info = value;
|
|
|
|
|
|
|
|
proto_register_field_array(proto_llc, info->field_info, 1);
|
|
|
|
}
|
|
|
|
|
2000-11-16 07:35:43 +00:00
|
|
|
void
|
|
|
|
proto_reg_handoff_llc(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t llc_handle;
|
|
|
|
|
2000-11-16 07:35:43 +00:00
|
|
|
/*
|
2008-04-10 23:56:10 +00:00
|
|
|
* Get handles for the BPDU, Ethernet, FDDI, Token Ring and
|
|
|
|
* Turbocell dissectors.
|
2000-11-16 07:35:43 +00:00
|
|
|
*/
|
|
|
|
bpdu_handle = find_dissector("bpdu");
|
2004-11-24 09:13:52 +00:00
|
|
|
eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
|
|
|
|
eth_withfcs_handle = find_dissector("eth_withfcs");
|
2001-01-10 09:07:35 +00:00
|
|
|
fddi_handle = find_dissector("fddi");
|
|
|
|
tr_handle = find_dissector("tr");
|
2008-04-10 23:56:10 +00:00
|
|
|
turbo_handle = find_dissector("turbocell");
|
2009-05-02 21:51:51 +00:00
|
|
|
mesh_handle = find_dissector("mesh");
|
2001-11-25 22:51:14 +00:00
|
|
|
data_handle = find_dissector("data");
|
Tvbuffify the CDP, CGMP, ISL, and VTP dissectors.
Add a new subdissector table in the LLC dissector for protocol IDs with
a Cisco OUI, and register the CDP, CGMP, and VTMP dissectors in that
table, rather than calling them via a switch statement.
Register the ISL dissector by name, and have the Ethernet dissector call
it via a handle.
Fix the handling of the checksum field in the CDP dissector.
The strings in CDP are counted, not null-terminated; treat them as such.
Fix the handling of the encapsulated frame CRC, and the encapsulated
frame, in the ISL dissector, at least for Ethernet frames; it may not be
correct for encapsulated Token Ring frames.
svn path=/trunk/; revision=2792
2000-12-28 09:49:09 +00:00
|
|
|
|
2009-05-02 21:51:51 +00:00
|
|
|
/*
|
|
|
|
* Get the Ethertype dissector table.
|
|
|
|
*/
|
|
|
|
ethertype_subdissector_table = find_dissector_table("ethertype");
|
2009-06-23 21:05:47 +00:00
|
|
|
hpteam_subdissector_table = find_dissector_table("llc.hpteam_pid");
|
2009-05-02 21:51:51 +00:00
|
|
|
|
2001-12-03 04:00:26 +00:00
|
|
|
llc_handle = find_dissector("llc");
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("wtap_encap", WTAP_ENCAP_ATM_RFC1483, llc_handle);
|
|
|
|
dissector_add_uint("sll.ltype", LINUX_SLL_P_802_2, llc_handle);
|
2002-05-29 03:08:02 +00:00
|
|
|
/* RFC 2043 */
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ppp.protocol", PPP_LLC, llc_handle);
|
2002-05-29 03:08:02 +00:00
|
|
|
/* RFC 2353 */
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("udp.port", UDP_PORT_LLC1, llc_handle);
|
|
|
|
dissector_add_uint("udp.port", UDP_PORT_LLC2, llc_handle);
|
|
|
|
dissector_add_uint("udp.port", UDP_PORT_LLC3, llc_handle);
|
|
|
|
dissector_add_uint("udp.port", UDP_PORT_LLC4, llc_handle);
|
|
|
|
dissector_add_uint("udp.port", UDP_PORT_LLC5, llc_handle);
|
Move the handling of the Network_Header for full FC frames into the FC
dissector, and have the LLC dissector register itself as the dissector
for IP-over-FC frames, as the payload is just an LLC 802.2 header plus
payload for the protocol specified by that header.
In the dissector for IP-over-FC as a Wiretap link-layer type, have its
top-level item be a protocol item rather than a text item, and don't
register it as the dissector for IP-over-FC frames from the FC dissector
- it assumes what it's handed includes the Network_Header, but for full
FC frames, the FC dissector has already consumed the Network_Header.
Move the definitions of the value_string tables out of the header file;
most of them are used only in one file, so define them in that file, and
for "fc_fc4_val", define it in "packet-fc.c", make it not static, and
declare it in "packet-fc.h".
Use FALSE, rather than 0, as the last argument to
"proto_tree_add_item()" calls that add a big-endian value.
Fix one "proto_tree_add_uint()" call that was supposed to be a
"proto_tree_add_item()" call.
Use "%u", not "%d", to display unsigned values.
svn path=/trunk/; revision=6773
2002-12-10 02:49:31 +00:00
|
|
|
/* IP-over-FC when we have the full FC frame */
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("fc.ftype", FC_FTYPE_IP, llc_handle);
|
2003-01-25 00:06:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* BACNET-over-ARCNET is really BACNET-over-802.2 LLC-over-ARCNET,
|
|
|
|
* apparently.
|
|
|
|
*/
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("arcnet.protocol_id", ARCNET_PROTO_BACNET, llc_handle);
|
|
|
|
dissector_add_uint("ethertype", ETHERTYPE_JUMBO_LLC, llc_handle);
|
2003-09-03 06:27:03 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Register all the fields for PIDs for various OUIs.
|
|
|
|
*/
|
2005-01-06 08:21:25 +00:00
|
|
|
if (oui_info_table != NULL)
|
|
|
|
g_hash_table_foreach(oui_info_table, register_hf, NULL);
|
2000-11-16 07:35:43 +00:00
|
|
|
}
|