2 * Routines for SNA-over-Ethernet (Ethernet type 80d5)
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@ethereal.com>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 #include <epan/packet.h>
36 * http://www.cisco.com/univercd/cc/td/doc/product/software/ssr90/rpc_r/18059.pdf
39 static int proto_snaeth = -1;
40 static int hf_snaeth_len = -1;
42 static gint ett_snaeth = -1;
44 static dissector_handle_t llc_handle;
47 dissect_snaeth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
49 proto_tree *snaeth_tree;
50 proto_item *snaeth_ti;
54 if (check_col(pinfo->cinfo, COL_PROTOCOL))
55 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SNAETH");
56 if (check_col(pinfo->cinfo, COL_INFO))
57 col_set_str(pinfo->cinfo, COL_INFO, "SNA over Ethernet");
60 len = tvb_get_ntohs(tvb, 0);
63 snaeth_ti = proto_tree_add_item(tree, proto_snaeth, tvb, 0, 3,
65 snaeth_tree = proto_item_add_subtree(snaeth_ti, ett_snaeth);
66 proto_tree_add_uint(snaeth_tree, hf_snaeth_len, tvb, 0, 2, len);
67 proto_tree_add_text(snaeth_tree, tvb, 2, 1, "Padding");
71 * Adjust the length of this tvbuff to include only the SNA-over-
72 * Ethernet header and data.
74 set_actual_length(tvb, 3 + len);
77 * Rest of packet starts with an 802.2 LLC header.
79 next_tvb = tvb_new_subset(tvb, 3, -1, -1);
80 call_dissector(llc_handle, next_tvb, pinfo, tree);
84 proto_register_snaeth(void)
86 static hf_register_info hf[] = {
88 { "Length", "snaeth_len", FT_UINT16, BASE_DEC, NULL, 0x0,
89 "Length of LLC payload", HFILL }},
91 static gint *ett[] = {
95 proto_snaeth = proto_register_protocol("SNA-over-Ethernet",
97 proto_register_field_array(proto_snaeth, hf, array_length(hf));
98 proto_register_subtree_array(ett, array_length(ett));
102 proto_reg_handoff_snaeth(void)
104 dissector_handle_t snaeth_handle;
107 * Get handle for the LLC dissector.
109 llc_handle = find_dissector("llc");
111 snaeth_handle = create_dissector_handle(dissect_snaeth, proto_snaeth);
112 dissector_add("ethertype", ETHERTYPE_SNA, snaeth_handle);