aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2005-08-27 05:22:44 +0000
committerJörg Mayer <jmayer@loplof.de>2005-08-27 05:22:44 +0000
commitfd51dcd73eef0022af763b1e3b09456c237c7afb (patch)
treeb0f67f53b0a6c4bd43b9d1669feda26f844671d1 /epan
parent9653fbb81b8af190f0d1592332b014610dc46c05 (diff)
Started to decode some Cisco proprietary L2 protocol:
* I couldn't find any documentation on this protocol. Neither * what it's good for nor what the elements do. This is purely * reverse engineered by looking at the hex dump of the packets. * * TODO * - Find out more about unknown fields * - Currently only one type of packet is really handled at all svn path=/trunk/; revision=15562
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/Makefile.common1
-rw-r--r--epan/dissectors/packet-cisco-wireless.c269
2 files changed, 270 insertions, 0 deletions
diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common
index 6275a97f31..014ffaae76 100644
--- a/epan/dissectors/Makefile.common
+++ b/epan/dissectors/Makefile.common
@@ -124,6 +124,7 @@ DISSECTOR_SRC = \
packet-cgmp.c \
packet-chdlc.c \
packet-cip.c \
+ packet-cisco-wireless.c \
packet-cisco-oui.c \
packet-clearcase.c \
packet-clip.c \
diff --git a/epan/dissectors/packet-cisco-wireless.c b/epan/dissectors/packet-cisco-wireless.c
new file mode 100644
index 0000000000..3cdb4f262b
--- /dev/null
+++ b/epan/dissectors/packet-cisco-wireless.c
@@ -0,0 +1,269 @@
+/* packet-cisco-wireless.c
+ * Routines for the disassembly of some (unknown) L2 packets
+ * sent by Ciscos Access Points (Aironet)
+ *
+ * Copyright 2005 Joerg Mayer (see AUTHORS file)
+ *
+ * $Id$
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@ethereal.com>
+ * Copyright 1998 Gerald Combs
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * I couldn't find any documentation on this protocol. Neither
+ * what it's good for nor what the elements do. This is purely
+ * reverse engineered by looking at the hex dump of the packets.
+ *
+ * TODO
+ * - Find out more about unknown fields
+ * - Currently only one type of packet is really handled at all
+ *
+ * Packets are sent in two possible encapsulations:
+ * Ethernet V2 with type 0x872d or SNAP with OUI 0x004096
+ *
+ * Header (Eth V2 or SNAP)
+ * Length (2 bytes)
+ * Unknown1 (2 bytes)
+ * Dst MAC (6 bytes)
+ * Src MAC (6 bytes)
+ * Unknown2 (4 bytes)
+ * 0 (17 bytes)
+ * Device IP (4 bytes)
+ * 0 (2 bytes)
+ * Device name (8 bytes)
+ * 0 (20 bytes)
+ * Unknown3 (2 bytes)
+ * Unknown4 (4 bytes)
+ * Version string (10 bytes)
+ * 0 (4 bytes)
+ * 0 (2 bytes)
+ */
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <string.h>
+#include <glib.h>
+#include <epan/packet.h>
+#include <epan/strutil.h>
+#include "packet-llc.h"
+#include "oui.h"
+#include "etypes.h"
+
+static int hf_llc_ciscowl_pid = -1;
+
+static int proto_ciscowl = -1;
+
+static int hf_ciscowl_length = -1;
+static int hf_ciscowl_unknown1 = -1;
+static int hf_ciscowl_srcmac = -1;
+static int hf_ciscowl_dstmac = -1;
+static int hf_ciscowl_unknown19 = -1;
+static int hf_ciscowl_unknown2 = -1;
+static int hf_ciscowl_null1 = -1;
+static int hf_ciscowl_ip = -1;
+static int hf_ciscowl_null2 = -1;
+static int hf_ciscowl_name = -1;
+static int hf_ciscowl_unknown3 = -1;
+static int hf_ciscowl_unknown4 = -1;
+static int hf_ciscowl_version = -1;
+static int hf_ciscowl_null3 = -1;
+
+static gint ett_ciscowl = -1;
+
+#define PROTO_SHORT_NAME "CISCOWL-L2"
+#define PROTO_LONG_NAME "Cisco Wireless Layer 2"
+
+static const value_string cisco_pid_vals[] = {
+ { 0x0000, "CiscoWL" },
+
+ { 0, NULL }
+};
+
+static void
+dissect_ciscowl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ proto_item *ti;
+ proto_tree *ciscowl_tree = NULL;
+ guint32 offset = 0;
+
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_set_str(pinfo->cinfo, COL_INFO, PROTO_SHORT_NAME);
+
+ if (tree) {
+ ti = proto_tree_add_item(tree, proto_ciscowl, tvb, offset, -1,
+ FALSE);
+ ciscowl_tree = proto_item_add_subtree(ti, ett_ciscowl);
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_length, tvb, offset, 2,
+ FALSE);
+ offset += 2;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_unknown1, tvb, offset, 2,
+ FALSE);
+ offset += 2;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_dstmac, tvb, offset, 6,
+ FALSE);
+ offset += 6;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_srcmac, tvb, offset, 6,
+ FALSE);
+ offset += 6;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_unknown19, tvb, offset, 2,
+ FALSE);
+ offset += 2;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_unknown2, tvb, offset, 4,
+ FALSE);
+ offset += 4;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_null1, tvb, offset, 16,
+ FALSE);
+ offset += 16;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_ip, tvb, offset, 4,
+ FALSE);
+ offset += 4;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_null2, tvb, offset, 2,
+ FALSE);
+ offset += 2;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_name, tvb, offset, 28,
+ FALSE);
+ offset += 28;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_unknown3, tvb, offset, 2,
+ FALSE);
+ offset += 2;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_unknown4, tvb, offset, 4,
+ FALSE);
+ offset += 4;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_version, tvb, offset, 14,
+ FALSE);
+ offset += 14;
+
+ proto_tree_add_item(ciscowl_tree, hf_ciscowl_null3, tvb, offset, 2,
+ FALSE);
+ offset += 2;
+
+ }
+}
+
+void
+proto_register_ciscowl(void)
+{
+ static hf_register_info hf[] = {
+
+ { &hf_ciscowl_length,
+ { "Length", "ciscowl.length", FT_UINT16, BASE_DEC, NULL,
+ 0x0, "", HFILL }},
+
+ { &hf_ciscowl_unknown1,
+ { "Unknown1", "ciscowl.unknown1", FT_BYTES, BASE_HEX, NULL,
+ 0x0, "", HFILL }},
+
+ { &hf_ciscowl_srcmac,
+ { "Src MAC", "ciscowl.srcmac", FT_ETHER, BASE_NONE, NULL,
+ 0x0, "Source MAC", HFILL }},
+
+ { &hf_ciscowl_dstmac,
+ { "Dst MAC", "ciscowl.dstmac", FT_ETHER, BASE_NONE, NULL,
+ 0x0, "Destination MAC", HFILL }},
+
+ { &hf_ciscowl_unknown19,
+ { "Unknown19", "ciscowl.unknown19", FT_BYTES, BASE_HEX, NULL,
+ 0x0, "", HFILL }},
+
+ { &hf_ciscowl_unknown2,
+ { "Unknown2", "ciscowl.unknown2", FT_BYTES, BASE_HEX, NULL,
+ 0x0, "", HFILL }},
+
+ { &hf_ciscowl_null1,
+ { "Null1", "ciscowl.null1", FT_BYTES, BASE_HEX, NULL,
+ 0x0, "", HFILL }},
+
+ { &hf_ciscowl_ip,
+ { "IP", "ciscowl.ip", FT_IPv4, BASE_NONE, NULL,
+ 0x0, "Device IP", HFILL }},
+
+ { &hf_ciscowl_null2,
+ { "Null2", "ciscowl.null2", FT_BYTES, BASE_HEX, NULL,
+ 0x0, "", HFILL }},
+
+ { &hf_ciscowl_name,
+ { "Name", "ciscowl.name", FT_STRING, BASE_NONE, NULL,
+ 0x0, "Device Name", HFILL }},
+
+ { &hf_ciscowl_unknown3,
+ { "Unknown3", "ciscowl.unknown3", FT_BYTES, BASE_HEX, NULL,
+ 0x0, "", HFILL }},
+
+ { &hf_ciscowl_unknown4,
+ { "Unknown4", "ciscowl.unknown4", FT_BYTES, BASE_HEX, NULL,
+ 0x0, "", HFILL }},
+
+ { &hf_ciscowl_version,
+ { "Version", "ciscowl.version", FT_STRING, BASE_NONE, NULL,
+ 0x0, "Device Version String", HFILL }},
+
+ { &hf_ciscowl_null3,
+ { "Null3", "ciscowl.null3", FT_BYTES, BASE_HEX, NULL,
+ 0x0, "", HFILL }},
+
+ };
+ static gint *ett[] = {
+ &ett_ciscowl,
+ };
+
+ proto_ciscowl = proto_register_protocol(PROTO_LONG_NAME,
+ PROTO_SHORT_NAME, "ciscowl");
+ proto_register_field_array(proto_ciscowl, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
+}
+
+void
+proto_reg_handoff_ciscowl(void)
+{
+ dissector_handle_t ciscowl_handle;
+
+ ciscowl_handle = create_dissector_handle(dissect_ciscowl, proto_ciscowl);
+ dissector_add("llc.ciscowl_pid", 0x0000, ciscowl_handle);
+ dissector_add("ethertype", ETHERTYPE_CISCOWL, ciscowl_handle);
+}
+
+void
+proto_register_ciscowl_oui(void)
+{
+ static hf_register_info hf = {
+ &hf_llc_ciscowl_pid,
+ { "PID", "llc.ciscowl_pid", FT_UINT16, BASE_HEX,
+ VALS(cisco_pid_vals), 0x0, "", HFILL },
+ };
+
+ llc_add_oui(OUI_CISCOWL, "llc.ciscowl_pid", "Cisco Wireless OUI PID", &hf);
+}