blob: 4c85195ea186a8d2dd256713eeba83cd9fe2339f [file] [log] [blame]
Harald Weltec25b3692009-08-27 21:59:22 +09001Index: wireshark/epan/dissectors/packet-lucent_hnb.c
2===================================================================
3--- /dev/null
4+++ wireshark/epan/dissectors/packet-lucent_hnb.c
5@@ -0,0 +1,103 @@
6+/* packet-lucent_hnb.c
7+ * Routines for packet dissection of Alcatel/Lucent HomeNodeB
8+ * Copyright 2009 by Harald Welte <laforge@gnumonks.org>
9+ *
10+ * This protocol decoder is based entirely on reverse engineering, i.e.
11+ * on educated guesses.
12+ *
13+ * $Id: packet-lucent_hnb.c 29254 2009-07-31 19:19:25Z gerald $
14+ *
15+ * Wireshark - Network traffic analyzer
16+ * By Gerald Combs <gerald@wireshark.org>
17+ * Copyright 1998 Gerald Combs
18+ *
19+ * This program is free software; you can redistribute it and/or
20+ * modify it under the terms of the GNU General Public License
21+ * as published by the Free Software Foundation; either version 2
22+ * of the License, or (at your option) any later version.
23+ *
24+ * This program is distributed in the hope that it will be useful,
25+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
26+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27+ * GNU General Public License for more details.
28+ *
29+ * You should have received a copy of the GNU General Public License
30+ * along with this program; if not, write to the Free Software
31+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32+ */
33+
34+#ifdef HAVE_CONFIG_H
35+# include "config.h"
36+#endif
37+
38+#define LHNB_SCTP_PPI_MM 1
39+#define LHNB_SCTP_PPI_GMM 6
40+
41+#define LHNB_SCTP_PORT 6005
42+
43+#include <glib.h>
44+
45+#include <epan/packet.h>
46+
47+/* Initialize the protocol and registered fields */
48+static int proto_lhnb = -1;
49+
50+static int hf_lhnb_length = -1;
51+
52+/* Initialize the subtree pointers */
53+static gint ett_lhnb = -1;
54+
55+static dissector_handle_t ranap_handle;
56+
57+/* Code to actually dissect the packets */
58+static void
59+dissect_lhnb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
60+{
61+
62+ int offset = 0;
63+ u_int16_t len;
64+ tvbuff_t *next_tvb;
65+
66+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "LHNB");
67+ col_clear(pinfo->cinfo, COL_INFO);
68+
69+ proto_tree_add_item(tree, hf_lhnb_length, tvb, offset+2, 2, FALSE);
70+ len = tvb_get_ntohs(tvb, offset+2);
71+ next_tvb = tvb_new_subset(tvb, offset+2+6, len-4, -1);
72+
73+ call_dissector(ranap_handle, next_tvb, pinfo, tree);
74+}
75+
76+void proto_register_lucent_hnb(void)
77+{
78+ static hf_register_info hf[] = {
79+ {&hf_lhnb_length,
80+ {"Length", "lhnb.len",
81+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
82+ },
83+ };
84+
85+ static gint *ett[] = {
86+ &ett_lhnb,
87+ };
88+
89+ proto_lhnb =
90+ proto_register_protocol("Alcatel/Lucent HomeNodeB",
91+ "Lucent HNB", "lhnb");
92+
93+ proto_register_field_array(proto_lhnb, hf, array_length(hf));
94+ proto_register_subtree_array(ett, array_length(ett));
95+}
96+
97+void proto_reg_handoff_lucent_hnb(void)
98+{
99+ dissector_handle_t lhnb_handle;
100+
101+ ranap_handle = find_dissector("ranap");
102+
103+ lhnb_handle = create_dissector_handle(dissect_lhnb, proto_lhnb);
104+
105+ dissector_add("sctp.ppi", LHNB_SCTP_PPI_MM, lhnb_handle);
106+ dissector_add("sctp.ppi", LHNB_SCTP_PPI_GMM, lhnb_handle);
107+ dissector_add("sctp.port", LHNB_SCTP_PORT, lhnb_handle);
108+}
109Index: wireshark/epan/dissectors/Makefile.common
110===================================================================
111--- wireshark.orig/epan/dissectors/Makefile.common
112+++ wireshark/epan/dissectors/Makefile.common
113@@ -605,6 +605,7 @@
114 packet-loop.c \
115 packet-lpd.c \
116 packet-lsc.c \
117+ packet-lucent_hnb.c \
118 packet-lwapp.c \
119 packet-lwres.c \
120 packet-m2pa.c \