aboutsummaryrefslogtreecommitdiffstats
path: root/wireshark/0003-lucent-hnb.patch
blob: c9fc3dc47fcfa56977f0b957f4e4927ff8556574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
From 48f2a191de62686c2ffdb97e46b5cc6bb61a868d Mon Sep 17 00:00:00 2001
From: Holger Hans Peter Freyther <zecke@selfish.org>
Date: Tue, 11 Jan 2011 15:16:19 +0100
Subject: [PATCH 3/4] lucent-hnb

Add lucent hnb patch from OpenBSC
---
 epan/CMakeLists.txt                 |    1 +
 epan/dissectors/Makefile.common     |    1 +
 epan/dissectors/packet-lucent_hnb.c |  103 +++++++++++++++++++++++++++++++++++
 3 files changed, 105 insertions(+), 0 deletions(-)
 create mode 100644 epan/dissectors/packet-lucent_hnb.c

Index: wireshark/epan/CMakeLists.txt
===================================================================
--- wireshark.orig/epan/CMakeLists.txt	2011-09-06 12:30:50.000000000 +0200
+++ wireshark/epan/CMakeLists.txt	2011-09-06 12:30:52.000000000 +0200
@@ -738,6 +738,7 @@
 	dissectors/packet-lpd.c
 	dissectors/packet-lsc.c
 	dissectors/packet-ltp.c
+	dissectors/packet-lucent_hnb.c
 	dissectors/packet-lwapp.c
 	dissectors/packet-lwres.c
 	dissectors/packet-m2pa.c
Index: wireshark/epan/dissectors/Makefile.common
===================================================================
--- wireshark.orig/epan/dissectors/Makefile.common	2011-09-06 12:30:50.000000000 +0200
+++ wireshark/epan/dissectors/Makefile.common	2011-09-06 12:30:52.000000000 +0200
@@ -657,6 +657,7 @@
 	packet-lpd.c		\
 	packet-lsc.c		\
 	packet-ltp.c		\
+	packet-lucent_hnb.c	\
 	packet-lwapp.c		\
 	packet-lwres.c		\
 	packet-m2pa.c		\
Index: wireshark/epan/dissectors/packet-lucent_hnb.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ wireshark/epan/dissectors/packet-lucent_hnb.c	2011-09-06 12:30:52.000000000 +0200
@@ -0,0 +1,103 @@
+/* packet-lucent_hnb.c
+ * Routines for packet dissection of Alcatel/Lucent HomeNodeB
+ * Copyright 2009 by Harald Welte <laforge@gnumonks.org>
+ *
+ * This protocol decoder is based entirely on reverse engineering, i.e.
+ * on educated guesses.
+ *
+ * $Id: packet-lucent_hnb.c 29254 2009-07-31 19:19:25Z gerald $
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#define LHNB_SCTP_PPI_MM	1
+#define LHNB_SCTP_PPI_GMM	6
+
+#define LHNB_SCTP_PORT		6005
+
+#include <glib.h>
+
+#include <epan/packet.h>
+
+/* Initialize the protocol and registered fields */
+static int proto_lhnb = -1;
+
+static int hf_lhnb_length = -1;
+
+/* Initialize the subtree pointers */
+static gint ett_lhnb = -1;
+
+static dissector_handle_t ranap_handle;
+
+/* Code to actually dissect the packets */
+static void
+dissect_lhnb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+
+	int offset = 0;
+	u_int16_t len;
+	tvbuff_t *next_tvb;
+
+	col_set_str(pinfo->cinfo, COL_PROTOCOL, "LHNB");
+	col_clear(pinfo->cinfo, COL_INFO);
+
+	proto_tree_add_item(tree, hf_lhnb_length, tvb, offset+2, 2, FALSE);
+	len = tvb_get_ntohs(tvb, offset+2);
+	next_tvb = tvb_new_subset(tvb, offset+2+6, len-4, -1);
+
+	call_dissector(ranap_handle, next_tvb, pinfo, tree);
+}
+
+void proto_register_lucent_hnb(void)
+{
+	static hf_register_info hf[] = {
+		{&hf_lhnb_length,
+		 {"Length", "lhnb.len",
+		  FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+		 },
+	};
+
+	static gint *ett[] = {
+		&ett_lhnb,
+	};
+
+	proto_lhnb =
+	    proto_register_protocol("Alcatel/Lucent HomeNodeB",
+				    "Lucent HNB", "lhnb");
+
+	proto_register_field_array(proto_lhnb, hf, array_length(hf));
+	proto_register_subtree_array(ett, array_length(ett));
+}
+
+void proto_reg_handoff_lucent_hnb(void)
+{
+	dissector_handle_t lhnb_handle;
+
+	ranap_handle = find_dissector("ranap");
+
+	lhnb_handle = create_dissector_handle(dissect_lhnb, proto_lhnb);
+
+	dissector_add("sctp.ppi", LHNB_SCTP_PPI_MM, lhnb_handle);
+	dissector_add("sctp.ppi", LHNB_SCTP_PPI_GMM, lhnb_handle);
+	dissector_add("sctp.port", LHNB_SCTP_PORT, lhnb_handle);
+}