2 * Routines for 3Com's encapsulation of XNS over 802.2 LLC
3 * (and other protocols using DSAP 80)
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include <epan/packet.h>
32 #include <epan/etypes.h>
34 static int proto_3com_xns = -1;
36 static int hf_3com_xns_type_ethertype = -1;
37 static int hf_3com_xns_type_retix_bpdu = -1;
39 static gint ett_3com_xns = -1;
41 static const value_string retix_bpdu_type_vals[] = {
42 { 0x0004, "Retix Spanning Tree" },
46 static dissector_handle_t retix_bpdu_handle;
49 * Apparently 3Com had some scheme for encapsulating XNS in 802.2 LLC,
50 * using a DSAP and SSAP of 0x80, and putting a 2-byte field that appeared
51 * to contain, at least for IPP, the Ethertype value for IPP.
53 * We assume that the value there is an Ethertype value, except for
54 * the Retix spanning tree protocol, which also uses a DSAP and SSAP
55 * of 0x80 but has, at least in one capture, 0x0004 as the type
56 * field. We handle that specially.
58 * XXX - I've also seen packets on 802.11 with a DSAP and SSAP of 0x80,
59 * but with random stuff that appears neither to be XNS nor Retix
63 dissect_3com_xns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
65 proto_tree *subtree = NULL;
69 if (check_col(pinfo->cinfo, COL_PROTOCOL))
70 col_set_str(pinfo->cinfo, COL_PROTOCOL, "3Com XNS");
71 if (check_col(pinfo->cinfo, COL_INFO))
72 col_clear(pinfo->cinfo, COL_INFO);
75 ti = proto_tree_add_item(tree, proto_3com_xns, tvb, 0, 4, FALSE);
76 subtree = proto_item_add_subtree(ti, ett_3com_xns);
79 type = tvb_get_ntohs(tvb, 0);
81 proto_tree_add_uint(subtree, hf_3com_xns_type_retix_bpdu,
83 call_dissector(retix_bpdu_handle,
84 tvb_new_subset(tvb, 2, -1, -1), pinfo, tree);
86 ethertype(type, tvb, 2, pinfo, tree, subtree,
87 hf_3com_xns_type_ethertype, -1, 0);
92 proto_register_3com_xns(void)
94 static hf_register_info hf[] = {
95 /* registered here but handled in ethertype.c */
96 { &hf_3com_xns_type_ethertype,
97 { "Type", "xnsllc.type", FT_UINT16, BASE_HEX,
98 VALS(etype_vals), 0x0, "", HFILL }},
100 { &hf_3com_xns_type_retix_bpdu,
101 { "Type", "xnsllc.type", FT_UINT16, BASE_HEX,
102 VALS(retix_bpdu_type_vals), 0x0, "", HFILL }},
105 static gint *ett[] ={
109 proto_3com_xns = proto_register_protocol("3Com XNS Encapsulation", "3COMXNS", "3comxns");
110 proto_register_field_array(proto_3com_xns, hf, array_length(hf));
111 proto_register_subtree_array(ett, array_length(ett));
115 proto_reg_handoff_3com_xns(void)
117 dissector_handle_t our_xns_handle;
119 retix_bpdu_handle = find_dissector("rbpdu");
121 our_xns_handle = create_dissector_handle(dissect_3com_xns,
123 dissector_add("llc.dsap", 0x80, our_xns_handle);