1 /* packet-gsm_ss-template.c
2 * Routines for GSM Supplementary Services dissection
3 * Copyright 2005, Anders Broman <anders.broman@ericsson.com>
4 * Based on the dissector by:
5 * Michael Lum <mlum [AT] telostech.com>
6 * In association with Telos Technology Inc.
11 * Mobile radio Layer 3 supplementary service specification;
13 * (3GPP TS 24.080 version )
16 * Wireshark - Network traffic analyzer
17 * By Gerald Combs <gerald@wireshark.org>
18 * Copyright 1998 Gerald Combs
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version 2
23 * of the License, or (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 * References: ETSI TS 129 002
41 #include <epan/packet.h>
42 #include <epan/prefs.h>
43 #include <epan/conversation.h>
49 #include "packet-ber.h"
50 #include "packet-gsm_ss.h"
51 #include "packet-gsm_map.h"
53 #define PNAME "GSM_SS"
54 #define PSNAME "GSM_SS"
55 #define PFNAME "gsm_ss"
57 const value_string gsm_ss_err_code_strings[] = {
58 { 1, "Unknown Subscriber" },
60 { 5, "Unidentified Subscriber" },
61 { 6, "Absent Subscriber SM" },
62 { 7, "Unknown Equipment" },
63 { 8, "Roaming Not Allowed" },
64 { 9, "Illegal Subscriber" },
65 { 10, "Bearer Service Not Provisioned" },
66 { 11, "Teleservice Not Provisioned" },
67 { 12, "Illegal Equipment" },
68 { 13, "Call Barred" },
69 { 14, "Forwarding Violation" },
71 { 16, "Illegal SS Operation" },
72 { 17, "SS Error Status" },
73 { 18, "SS Not Available" },
74 { 19, "SS Subscription Violation" },
75 { 20, "SS Incompatibility" },
76 { 21, "Facility Not Supported" },
77 { 25, "No Handover Number Available" },
78 { 26, "Subsequent Handover Failure" },
79 { 27, "Absent Subscriber" },
80 { 28, "Incompatible Terminal" },
81 { 29, "Short Term Denial" },
82 { 30, "Long Term Denial" },
83 { 31, "Subscriber Busy For MT SMS" },
84 { 32, "SM Delivery Failure" },
85 { 33, "Message Waiting List Full" },
86 { 34, "System Failure" },
87 { 35, "Data Missing" },
88 { 36, "Unexpected Data Value" },
89 { 37, "PW Registration Failure" },
90 { 38, "Negative PW Check" },
91 { 39, "No Roaming Number Available" },
92 { 40, "Tracing Buffer Full" },
93 { 42, "Target Cell Outside Group Call Area" },
94 { 43, "Number Of PW Attempts Violation" },
95 { 44, "Number Changed" },
96 { 45, "Busy Subscriber" },
97 { 46, "No Subscriber Reply" },
98 { 47, "Forwarding Failed" },
99 { 48, "OR Not Allowed" },
100 { 49, "ATI Not Allowed" },
101 { 50, "No Group Call Number Available" },
102 { 51, "Resource Limitation" },
103 { 52, "Unauthorized Requesting Network" },
104 { 53, "Unauthorized LCS Client" },
105 { 54, "Position Method Failure" },
106 { 58, "Unknown Or Unreachable LCS Client" },
107 { 59, "MM Event Not Supported" },
108 { 60, "ATSI Not Allowed" },
109 { 61, "ATM Not Allowed" },
110 { 62, "Information Not Available" },
111 { 71, "Unknown Alphabet" },
113 { 120, "Nbr Sb Exceeded" },
114 { 121, "Rejected By User" },
115 { 122, "Rejected By Network" },
116 { 123, "Deflection To Served Subscriber" },
117 { 124, "Special Service Code" },
118 { 125, "Invalid Deflected To Number" },
119 { 126, "Max Number Of MPTY Participants Exceeded" },
120 { 127, "Resources Not Available" },
124 const value_string gsm_ss_opr_code_strings[] = {
125 { 10, "Register SS" },
127 { 12, "Activate SS" },
128 { 13, "Deactivate SS" },
129 { 14, "Interrogate SS" },
131 { 17, "Register Password" },
132 { 18, "Get Password" },
133 { 19, "Process Unstructured SS Data" },
134 { 38, "Forward Check SS Indication" },
135 { 59, "Process Unstructured SS Request" },
136 { 60, "Unstructured SS Request" },
137 { 61, "Unstructured SS Notify" },
138 { 77, "Erase CC Entry" },
139 { 112, "lcs-AreaEventCancellation" },
140 { 113, "lcs-AreaEventReport" },
141 { 114, "LCS-AreaEventRequest" },
143 { 116, "LCS Location Notification" },
144 { 117, "Call Deflection" },
145 { 118, "User User Service" },
146 { 119, "Access Register CC Entry" },
147 { 120, "Forward CUG Info" },
148 { 121, "Split MPTY" },
149 { 122, "Retrieve MPTY" },
150 { 123, "Hold MPTY" },
151 { 124, "Build MPTY" },
152 { 125, "Forward Charge Advice" },
153 { 126, "Explicit CT" },
158 /* Initialize the protocol and registered fields */
159 int proto_gsm_ss = -1;
161 static int hf_gsm_ss_getPassword = -1;
162 static int hf_gsm_ss_currentPassword = -1;
163 static int hf_gsm_ss_SS_Code = -1;
164 #include "packet-gsm_ss-hf.c"
166 /* Initialize the subtree pointers */
167 #include "packet-gsm_ss-ett.c"
169 static dissector_table_t sms_dissector_table; /* SMS TPDU */
171 #include "packet-gsm_ss-fn.c"
175 gsm_ss_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,guint32 opcode, gint comp_type_tag)
177 switch (comp_type_tag){
180 case 10: /* Register SS -- imports operations from MAP-SupplementaryServiceOperations*/
181 offset=dissect_gsm_map_RegisterSS_Arg(FALSE, tvb, offset, pinfo, tree, -1);
183 case 11: /* Erase SS -- imports operations from MAP-SupplementaryServiceOperations*/
184 offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1);
186 case 12: /* Activate SS -- imports operations from MAP-SupplementaryServiceOperations*/
187 offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1);
189 case 13: /*Deactivate SS -- imports operations from MAP-SupplementaryServiceOperations*/
190 offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1);
192 case 14: /*Interrogate SS -- imports operations from MAP-SupplementaryServiceOperations*/
193 offset=dissect_gsm_map_SS_ForBS_Code(FALSE, tvb, offset, pinfo, tree, -1);
195 case 16: /*Notify SS */
196 offset = dissect_notifySS(pinfo, tree, tvb, offset);
198 case 17: /*Register Password -- imports operations from MAP-SupplementaryServiceOperations*/
199 offset=dissect_gsm_map_SS_Code(FALSE, tvb, offset, pinfo, tree, -1);
201 case 18: /*Get Password -- imports operations from MAP-SupplementaryServiceOperations*/
202 offset=dissect_gsm_map_GetPasswordArg(FALSE, tvb, offset, pinfo, tree, hf_gsm_ss_getPassword);
204 case 19: /*Process Unstructured SS Data */
205 offset = dissect_processUnstructuredSS_Data(pinfo, tree, tvb, offset);
207 case 38: /*Forward Check SS Indication -- imports operation from MAP-MobileServiceOperations*/
209 case 59: /*Process Unstructured SS Request -- imports operations from MAP-SupplementaryServiceOperations*/
210 offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1);
212 case 60: /*Unstructured SS Request -- imports operations from MAP-SupplementaryServiceOperations*/
213 offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1);
215 case 61: /*Unstructured SS Notify -- imports operations from MAP-SupplementaryServiceOperations*/
216 offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1);
218 case 77: /*Erase CC Entry -- imports operations from MAP-SupplementaryServiceOperations*/
219 offset=dissect_gsm_map_EraseCC_EntryArg(FALSE, tvb, offset, pinfo, tree, -1);
221 case 112: /*lcs-AreaEventCancellation */
222 offset = dissect_lcs_AreaEventCancellation(pinfo, tree, tvb, offset);
224 case 113: /*lcs-AreaEventReport */
225 offset = dissect_lcs_AreaEventReport(pinfo, tree, tvb, offset);
227 case 114: /*LCS-AreaEventRequest */
228 offset = dissect_lcs_AreaEventRequest(pinfo, tree, tvb, offset);
230 case 115: /*LCS MOLR */
231 offset = dissect_lcs_MOLR(pinfo, tree, tvb, offset);
233 case 116: /*LCS Location Notification */
234 offset = dissect_lcs_LocationNotification(pinfo, tree, tvb,offset);
236 case 117: /*Call Deflection */
237 offset = dissect_callDeflection(pinfo, tree, tvb,offset);
239 case 118: /*User User Service */
240 offset = dissect_gsm_ss_UserUserServiceArg(FALSE, tvb, offset, pinfo, tree, -1);
242 case 119: /* Access Register CC Entry */
243 offset = dissect_gsm_ss_AccessRegisterCCEntryArg(FALSE, tvb, offset, pinfo, tree, -1);
245 case 120: /*Forward CUG Info */
246 offset = dissect_forwardCUG_Info(pinfo, tree, tvb,offset);
248 case 121: /*Split MPTY */
250 case 122: /*Retrieve MPTY */
252 case 123: /*Hold MPTY */
254 case 124: /*Build MPTY */
256 case 125: /*Forward Charge Advice */
257 dissect_forwardChargeAdvice(pinfo, tree, tvb,offset);
259 case 126: /*Explicit CT */
265 case 2: /* returnResultLast */
267 case 10: /*registerSS*/
268 offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1);
271 offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1);
273 case 12: /*activateSS*/
274 offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1);
276 case 13: /*deactivateSS*/
277 offset=dissect_gsm_map_SS_Info(FALSE, tvb, offset, pinfo, tree, -1);
279 case 14: /*interrogateSS*/
280 offset=dissect_gsm_map_InterrogateSS_Res(FALSE, tvb, offset, pinfo, tree, -1);
282 case 16: /*Notify SS */
284 case 17: /*Register Password -- imports operations from MAP-SupplementaryServiceOperations*/
285 offset=dissect_gsm_map_NewPassword(FALSE, tvb, offset, pinfo, tree, hf_gsm_ss_SS_Code);
287 case 18: /*Get Password -- imports operations from MAP-SupplementaryServiceOperations*/
288 offset=dissect_gsm_map_CurrentPassword(FALSE, tvb, offset, pinfo, tree, hf_gsm_ss_currentPassword);
290 case 19: /*Process Unstructured SS Data */
291 offset=dissect_gsm_ss_SS_UserData(FALSE, tvb, offset, pinfo, tree, -1);
293 case 38: /*Forward Check SS Indication -- imports operation from MAP-MobileServiceOperations*/
295 case 59: /*Process Unstructured SS Request -- imports operations from MAP-SupplementaryServiceOperations*/
296 offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1);
298 case 60: /*Unstructured SS Request -- imports operations from MAP-SupplementaryServiceOperations*/
299 offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1);
301 case 61: /*Unstructured SS Notify -- imports operations from MAP-SupplementaryServiceOperations*/
302 offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1);
304 case 77: /*Erase CC Entry -- imports operations from MAP-SupplementaryServiceOperations*/
305 offset=dissect_gsm_map_EraseCC_EntryRes(FALSE, tvb, offset, pinfo, tree, -1);
307 case 112: /*lcs-AreaEventCancellation */
309 case 113: /*lcs-AreaEventReport */
311 case 114: /*LCS-AreaEventRequest */
313 case 115: /*LCS MOLR */
314 offset=dissect_gsm_ss_LCS_MOLRRes(FALSE, tvb, offset, pinfo, tree, -1);
316 case 116: /*LCS Location Notification */
317 offset=dissect_gsm_ss_LocationNotificationRes(FALSE, tvb, offset, pinfo, tree, -1);
319 case 117: /*Call Deflection */
321 case 118: /*User User Service */
323 case 119: /* Access Register CC Entry */
324 offset=dissect_gsm_map_RegisterCC_EntryRes(FALSE, tvb, offset, pinfo, tree, -1);
326 case 120: /*Forward CUG Info */
328 case 121: /*Split MPTY */
330 case 122: /*Retrieve MPTY */
332 case 123: /*Hold MPTY */
334 case 124: /*Build MPTY */
336 case 125: /*Forward Charge Advice */
338 case 126: /*Explicit CT */
344 case 3: /* returnError */
355 dissect_gsm_ss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
360 /*--- proto_reg_handoff_gsm_ss ---------------------------------------
361 This proto is called directly from packet-gsm_a and needs to know component type */
362 void proto_reg_handoff_gsm_ss(void) {
363 dissector_handle_t gsm_ss_handle;
365 gsm_ss_handle = create_dissector_handle(dissect_gsm_ss, proto_gsm_ss);
370 /*--- proto_register_gsm_ss -------------------------------------------*/
371 void proto_register_gsm_ss(void) {
374 static hf_register_info hf[] = {
375 { &hf_gsm_ss_getPassword,
376 { "Password", "gsm_ss.password",
377 FT_UINT8, BASE_DEC, VALS(gsm_map_GetPasswordArg_vals), 0,
378 "Password", HFILL }},
379 { &hf_gsm_ss_currentPassword,
380 { "currentPassword", "gsm_ss.currentPassword",
381 FT_STRING, BASE_NONE, NULL, 0,
383 { &hf_gsm_ss_SS_Code,
384 { "ss-Code", "gsm_ss.ss_Code",
385 FT_UINT8, BASE_DEC, VALS(ssCode_vals), 0,
388 #include "packet-gsm_ss-hfarr.c"
391 /* List of subtrees */
392 static gint *ett[] = {
393 #include "packet-gsm_ss-ettarr.c"
396 /* Register protocol */
397 proto_gsm_ss = proto_register_protocol(PNAME, PSNAME, PFNAME);
398 /*XXX register_dissector("gsm_ss", dissect_gsm_ss, proto_gsm_ss);*/
399 /* Register fields and subtrees */
400 proto_register_field_array(proto_gsm_ss, hf, array_length(hf));
401 proto_register_subtree_array(ett, array_length(ett));