aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorCharlie Lenahan <clenahan@sonicbison.com>2017-05-05 16:56:41 -0400
committerMichael Mann <mmann78@netscape.net>2017-05-06 02:15:36 +0000
commit5d67b334e7d1ab7bf06500daed22e92ac52b379f (patch)
treecd2e39791c8d228d99645b006b48853b2731cac4 /epan
parentdddde02e251213002f2dedeaea85a1a97044a1a3 (diff)
Add Netgear Ensemble protocol
Bug: 13689 Change-Id: I9573d0106a1639cfc2d416a4146f558047cfd67e Reviewed-on: https://code.wireshark.org/review/21524 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/CMakeLists.txt1
-rw-r--r--epan/dissectors/Makefile.am1
-rw-r--r--epan/dissectors/packet-netgear.c214
3 files changed, 216 insertions, 0 deletions
diff --git a/epan/dissectors/CMakeLists.txt b/epan/dissectors/CMakeLists.txt
index c3fa212364..67624bcc99 100644
--- a/epan/dissectors/CMakeLists.txt
+++ b/epan/dissectors/CMakeLists.txt
@@ -960,6 +960,7 @@ set(DISSECTOR_SRC
packet-netanalyzer.c
packet-netbios.c
packet-netdump.c
+ packet-netgear.c
packet-netflow.c
packet-netlink-generic.c
packet-netlink-netfilter.c
diff --git a/epan/dissectors/Makefile.am b/epan/dissectors/Makefile.am
index 1dc17e9230..bcc3b02c9c 100644
--- a/epan/dissectors/Makefile.am
+++ b/epan/dissectors/Makefile.am
@@ -982,6 +982,7 @@ DISSECTOR_SRC = \
packet-netanalyzer.c \
packet-netbios.c \
packet-netdump.c \
+ packet-netgear.c \
packet-netflow.c \
packet-netlink-generic.c \
packet-netlink-netfilter.c \
diff --git a/epan/dissectors/packet-netgear.c b/epan/dissectors/packet-netgear.c
new file mode 100644
index 0000000000..943e80b890
--- /dev/null
+++ b/epan/dissectors/packet-netgear.c
@@ -0,0 +1,214 @@
+/* packet-netgear.c
+ *
+ * Routines for Netgear AP Ensemble Protocol
+ * Charlie Lenahan <clenahan@sonicbison.com>
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include <epan/packet.h>
+
+#define NETGEAR_ENSEMBLE_PORT 4554
+
+static int proto_nge = -1;
+
+static int hf_nge_version = -1;
+static int hf_nge_unknown = -1;
+static int hf_nge_unknown_int32 = -1;
+static int hf_nge_sequence = -1;
+static int hf_nge_tlv_length = -1;
+static int hf_nge_ensemble_name = -1;
+static int hf_nge_firmware_name = -1;
+static int hf_nge_region_name = -1;
+static int hf_nge_firmware_version = -1;
+static int hf_nge_ap_name = -1;
+static int hf_nge_uptime = -1;
+static int hf_nge_mac = -1;
+static int hf_nge_ip = -1;
+static int hf_nge_uuid = -1;
+
+static gint ett_nge = -1;
+static gint ett_nge_lv = -1;
+static gint ett_nge_ensemble = -1;
+
+
+static void
+dissect_nge_esemble(tvbuff_t *tvb,proto_tree *tree _U_, int offset)
+{
+ guint strLen=0;
+
+ guint32 length = tvb_get_guint32(tvb, offset,ENC_BIG_ENDIAN);
+ proto_tree *ensemble_tree = proto_tree_add_subtree(tree, tvb, offset, length+4, ett_nge_ensemble, NULL,"Ensemble");
+
+ proto_tree_add_uint(ensemble_tree, hf_nge_tlv_length, tvb, offset, 4, length);
+ offset += 4;
+
+ proto_tree_add_item(ensemble_tree, hf_nge_unknown, tvb, offset, 17, ENC_NA);
+ offset += 17;
+
+ /* type == 1 ? */
+ proto_tree_add_item(ensemble_tree, hf_nge_unknown_int32, tvb, offset, 4, ENC_BIG_ENDIAN);
+ offset += 4;
+
+ /* uuid ? */
+ proto_tree_add_item(ensemble_tree, hf_nge_uuid, tvb, offset, 16, ENC_BIG_ENDIAN);
+ offset += 16;
+
+ proto_tree_add_item(ensemble_tree, hf_nge_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
+ offset += 4;
+
+ proto_tree_add_item(ensemble_tree, hf_nge_unknown, tvb, offset, 20, ENC_NA);
+ offset += 20;
+
+ proto_tree_add_item(ensemble_tree, hf_nge_mac, tvb, offset, 6, ENC_NA);
+ offset += 6;
+
+ /* type == 2 ? */
+ proto_tree_add_item(ensemble_tree, hf_nge_unknown_int32, tvb, offset, 4, ENC_BIG_ENDIAN);
+ offset += 4;
+
+ proto_tree_add_item_ret_length(ensemble_tree, hf_nge_ensemble_name, tvb, offset, 4, ENC_ASCII|ENC_BIG_ENDIAN, &strLen);
+ offset += strLen;
+
+ proto_tree_add_item_ret_length(ensemble_tree, hf_nge_firmware_name, tvb, offset, 4, ENC_ASCII|ENC_BIG_ENDIAN, &strLen);
+ offset += strLen;
+
+ proto_tree_add_item_ret_length(ensemble_tree, hf_nge_region_name, tvb, offset, 4, ENC_ASCII|ENC_BIG_ENDIAN, &strLen);
+ offset += strLen;
+
+ /* type == 0 ? */
+ proto_tree_add_item(ensemble_tree, hf_nge_unknown_int32, tvb, offset, 4, ENC_BIG_ENDIAN);
+ offset += 4;
+
+ proto_tree_add_item_ret_length(ensemble_tree, hf_nge_firmware_version, tvb, offset, 4, ENC_ASCII|ENC_BIG_ENDIAN, &strLen);
+ offset += strLen;
+
+ proto_tree_add_item(ensemble_tree, hf_nge_unknown, tvb, offset, 16, ENC_NA);
+ offset += 16;
+
+ /* timestamp? */
+ proto_tree_add_item(ensemble_tree, hf_nge_uptime, tvb, offset, 4, ENC_BIG_ENDIAN);
+ offset += 4;
+
+ proto_tree_add_item_ret_length(ensemble_tree, hf_nge_ap_name, tvb, offset, 4, ENC_ASCII|ENC_BIG_ENDIAN, &strLen);
+ offset += strLen;
+
+ proto_tree_add_item(ensemble_tree, hf_nge_unknown, tvb, offset, -1, ENC_NA);
+
+}
+
+static int
+dissect_nge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+{
+ int offset = 0;
+
+ proto_item *ti = proto_tree_add_item(tree, proto_nge, tvb, 0, -1, ENC_NA);
+ proto_tree *nge_tree = proto_item_add_subtree(ti, ett_nge);
+
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "NGE");
+ /* Clear out stuff in the info column */
+ col_clear(pinfo->cinfo,COL_INFO);
+
+ /* presumed version */
+ proto_tree_add_item(nge_tree, hf_nge_version, tvb, offset, 1, ENC_BIG_ENDIAN);
+ offset += 1;
+
+ proto_tree_add_item(nge_tree, hf_nge_unknown, tvb, offset, 3, ENC_NA);
+ offset += 3;
+
+ proto_tree_add_item(nge_tree, hf_nge_sequence, tvb, offset, 4, ENC_BIG_ENDIAN);
+ offset += 4;
+
+ dissect_nge_esemble(tvb, nge_tree, offset);
+
+ return tvb_captured_length(tvb);
+}
+
+
+void
+proto_register_nge(void)
+{
+ static hf_register_info hf[] = {
+ { &hf_nge_version,
+ { "Version", "nge.version",FT_UINT8, BASE_DEC,
+ NULL, 0x0,NULL, HFILL }},
+ { &hf_nge_unknown,
+ { "Unknown", "nge.unknown", FT_BYTES, BASE_NONE,
+ NULL, 0x0,NULL, HFILL }},
+ { &hf_nge_unknown_int32,
+ { "Unknown", "nge.unknown", FT_UINT32, BASE_DEC,
+ NULL, 0x0, NULL, HFILL }},
+ { &hf_nge_sequence,
+ { "Sequence", "nge.sequence", FT_UINT32, BASE_DEC,
+ NULL, 0x0, NULL, HFILL }},
+ { &hf_nge_uptime,
+ { "Uptime", "nge.uptime", FT_UINT32, BASE_DEC,
+ NULL, 0x0, NULL, HFILL }},
+ { &hf_nge_mac,
+ { "MAC", "nge.mac", FT_ETHER, BASE_NONE,
+ NULL, 0x0,NULL, HFILL }},
+ { &hf_nge_ip,
+ { "IP", "nge.ip", FT_IPv4, BASE_NONE,
+ NULL, 0x0,NULL, HFILL }},
+ { &hf_nge_uuid,
+ { "Device UUID", "nge.uuid", FT_GUID, BASE_NONE,
+ NULL, 0x0,NULL, HFILL }},
+ { &hf_nge_ensemble_name,
+ { "Ensemble Name", "nge.ensemble_name", FT_UINT_STRING, BASE_NONE,
+ NULL, 0x0, NULL, HFILL }},
+ { &hf_nge_firmware_name,
+ { "Firmware Name", "nge.firmware_name", FT_UINT_STRING, BASE_NONE,
+ NULL, 0x0, NULL, HFILL }},
+ { &hf_nge_region_name,
+ { "Region Name", "nge.region_name", FT_UINT_STRING, BASE_NONE,
+ NULL, 0x0, NULL, HFILL }},
+ { &hf_nge_firmware_version,
+ { "Firmware Version", "nge.firmware_version", FT_UINT_STRING, BASE_NONE,
+ NULL, 0x0, NULL, HFILL }},
+ { &hf_nge_ap_name,
+ { "AP Name", "nge.ap_name", FT_UINT_STRING, BASE_NONE,
+ NULL, 0x0, NULL, HFILL }},
+ { &hf_nge_tlv_length,
+ { "Length", "nge.tlv_len", FT_UINT32, BASE_DEC,
+ NULL, 0x0, NULL, HFILL }},
+ };
+
+ /* Setup protocol subtree array */
+ static gint *ett[] = {
+ &ett_nge,
+ &ett_nge_lv,
+ &ett_nge_ensemble
+ };
+
+ proto_nge = proto_register_protocol ("Netgear Ensemble Protocol", "NGE", "nge");
+
+ proto_register_field_array(proto_nge, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
+}
+
+void
+proto_reg_handoff_nge(void)
+{
+ dissector_handle_t nge_handle;
+
+ nge_handle = create_dissector_handle(dissect_nge, proto_nge);
+ dissector_add_for_decode_as_with_preference("udp.port", nge_handle);
+}