2002-02-17 00:16:19 +00:00
|
|
|
/* packet-snaeth.c
|
|
|
|
* Routines for SNA-over-Ethernet (Ethernet type 80d5)
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2002-02-17 00:16:19 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2002-02-17 00:16:19 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2002-02-17 00:16:19 +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
|
|
|
*
|
2002-02-17 00:16:19 +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
|
|
|
*
|
2002-02-17 00:16:19 +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.
|
2002-02-17 00:16:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/etypes.h>
|
2002-02-17 00:16:19 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* See
|
|
|
|
*
|
|
|
|
* http://www.cisco.com/univercd/cc/td/doc/product/software/ssr90/rpc_r/18059.pdf
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int proto_snaeth = -1;
|
|
|
|
static int hf_snaeth_len = -1;
|
|
|
|
|
|
|
|
static gint ett_snaeth = -1;
|
|
|
|
|
|
|
|
static dissector_handle_t llc_handle;
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_snaeth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_tree *snaeth_tree;
|
|
|
|
proto_item *snaeth_ti;
|
|
|
|
guint16 len;
|
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SNAETH");
|
2009-08-09 07:01:26 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "SNA over Ethernet");
|
2002-02-17 00:16:19 +00:00
|
|
|
|
|
|
|
/* length */
|
|
|
|
len = tvb_get_ntohs(tvb, 0);
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
snaeth_ti = proto_tree_add_item(tree, proto_snaeth, tvb, 0, 3,
|
2011-10-21 02:10:19 +00:00
|
|
|
ENC_NA);
|
2002-02-17 00:16:19 +00:00
|
|
|
snaeth_tree = proto_item_add_subtree(snaeth_ti, ett_snaeth);
|
|
|
|
proto_tree_add_uint(snaeth_tree, hf_snaeth_len, tvb, 0, 2, len);
|
|
|
|
proto_tree_add_text(snaeth_tree, tvb, 2, 1, "Padding");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Adjust the length of this tvbuff to include only the SNA-over-
|
|
|
|
* Ethernet header and data.
|
|
|
|
*/
|
2002-02-17 00:51:21 +00:00
|
|
|
set_actual_length(tvb, 3 + len);
|
2002-02-17 00:16:19 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Rest of packet starts with an 802.2 LLC header.
|
|
|
|
*/
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, 3);
|
2002-02-17 00:16:19 +00:00
|
|
|
call_dissector(llc_handle, next_tvb, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_snaeth(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_snaeth_len,
|
2011-04-19 08:22:58 +00:00
|
|
|
{ "Length", "snaeth.len", FT_UINT16, BASE_DEC, NULL, 0x0,
|
2002-02-17 00:16:19 +00:00
|
|
|
"Length of LLC payload", HFILL }},
|
|
|
|
};
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_snaeth,
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_snaeth = proto_register_protocol("SNA-over-Ethernet",
|
|
|
|
"SNAETH", "snaeth");
|
|
|
|
proto_register_field_array(proto_snaeth, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_snaeth(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t snaeth_handle;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get handle for the LLC dissector.
|
|
|
|
*/
|
|
|
|
llc_handle = find_dissector("llc");
|
|
|
|
|
|
|
|
snaeth_handle = create_dissector_handle(dissect_snaeth, proto_snaeth);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ethertype", ETHERTYPE_SNA, snaeth_handle);
|
2002-02-17 00:16:19 +00:00
|
|
|
}
|