Fix some compiler warnings (at least one of which is for a real problem).
[metze/wireshark/wip.git] / asn1 / gsmmap / packet-gsm_map-template.c
1 /* packet-gsm_map-template.c
2  * Routines for GSM MobileApplication packet dissection
3  * Copyright 2004, Anders Broman <anders.broman@ericsson.com>
4  * Based on the dissector by:
5  * Felix Fei <felix.fei [AT] utstar.com>
6  * and Michael Lum <mlum [AT] telostech.com>
7  *
8  * $Id$
9  *
10  * Ethereal - Network traffic analyzer
11  * By Gerald Combs <gerald@ethereal.com>
12  * Copyright 1998 Gerald Combs
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27  * References: ETSI TS 129 002
28  */
29
30 #ifdef HAVE_CONFIG_H
31 # include "config.h"
32 #endif
33
34 #include <glib.h>
35 #include <epan/packet.h>
36 #include <epan/prefs.h>
37 #include <epan/conversation.h>
38 #include <epan/tap.h>
39
40 #include <stdio.h>
41 #include <string.h>
42
43 #include "packet-ber.h"
44 #include "packet-q931.h"
45 #include "packet-gsm_map.h"
46
47 #define PNAME  "GSM_MobileAPplication"
48 #define PSNAME "GSM_MAP"
49 #define PFNAME "gsm_map"
50
51 /* Initialize the protocol and registered fields */
52 int proto_gsm_map = -1;
53 static int hf_gsm_map_invokeCmd = -1;             /* Opcode */
54 static int hf_gsm_map_invokeid = -1;              /* INTEGER */
55 static int hf_gsm_map_absent = -1;                /* NULL */
56 static int hf_gsm_map_invokeId = -1;              /* InvokeId */
57 static int hf_gsm_map_invoke = -1;                /* InvokePDU */
58 static int hf_gsm_map_returnResult = -1;          /* InvokePDU */
59 static int hf_gsm_map_returnResult_result = -1;
60 static int hf_gsm_map_returnError_result = -1;
61 static int hf_gsm_map_returnError = -1;
62 static int hf_gsm_map_local_errorCode = -1;
63 static int hf_gsm_map_global_errorCode_oid = -1;
64 static int hf_gsm_map_global_errorCode = -1;
65 static int hf_gsm_map_SendAuthenticationInfoArg = -1;
66 static int hf_gsm_mapSendEndSignal = -1;
67 static int hf_gsm_map_getPassword = -1;  
68 static int hf_gsm_map_currentPassword = -1;
69 static int hf_gsm_map_extension = -1;
70 static int hf_gsm_map_nature_of_number = -1;
71 static int hf_gsm_map_number_plan = -1;
72 static int hf_gsm_map_misdn_digits = -1;
73 static int hf_gsm_map_servicecentreaddress_digits = -1;
74 static int hf_gsm_map_imsi_digits = -1;
75 static int hf_gsm_map_map_gmsc_address_digits = -1;
76 static int hf_gsm_map_map_RoamingNumber_digits = -1;
77 static int hf_gsm_map_map_hlr_number_digits = -1;
78 static int hf_gsm_map_map_ForwardedToNumber_digits = -1;
79 static int hf_gsm_map_Ss_Status_unused = -1;
80 static int hf_gsm_map_Ss_Status_q_bit = -1;
81 static int hf_gsm_map_Ss_Status_p_bit = -1;
82 static int hf_gsm_map_Ss_Status_r_bit = -1;
83 static int hf_gsm_map_Ss_Status_a_bit = -1;
84
85 #include "packet-gsm_map-hf.c"
86
87 /* Initialize the subtree pointers */
88 static gint ett_gsm_map = -1;
89 static gint ett_gsm_map_InvokeId = -1;
90 static gint ett_gsm_map_InvokePDU = -1;
91 static gint ett_gsm_map_ReturnResultPDU = -1;
92 static gint ett_gsm_map_ReturnErrorPDU = -1;
93 static gint ett_gsm_map_ReturnResult_result = -1;
94 static gint ett_gsm_map_ReturnError_result = -1;
95 static gint ett_gsm_map_GSMMAPPDU = -1;
96
97 #include "packet-gsm_map-ett.c"
98
99 static dissector_table_t        sms_dissector_table;    /* SMS TPDU */
100 /* Preferenc settings default */
101 static guint tcap_itu_ssn1 = 6;
102 static guint tcap_itu_ssn2 = 7;
103 static guint tcap_itu_ssn3 = 8;
104 static guint tcap_itu_ssn4 = 9;
105
106 static guint global_tcap_itu_ssn1 = 6;
107 static guint global_tcap_itu_ssn2 = 7;
108 static guint global_tcap_itu_ssn3 = 8;
109 static guint global_tcap_itu_ssn4 = 9;
110
111 /* Global variables */
112 static proto_tree *top_tree;
113 int application_context_version;
114 gint protocolId;
115 static int gsm_map_tap = -1;
116
117
118 static char*
119 unpack_digits(tvbuff_t *tvb, int offset){
120
121         int length;
122         guint8 octet;
123         int i=0;
124         char *digit_str;
125
126         length = tvb_length(tvb);
127         length = length - offset;
128         digit_str = g_malloc(length+1);
129
130         while ( offset <= length ){
131
132                 octet = tvb_get_guint8(tvb,offset);
133                 digit_str[i] = ((octet & 0x0f) + 0x30);
134                 i++;
135
136                 /*
137                  * unpack second value in byte
138                  */
139                 octet = octet >> 4;
140
141                 if (octet == 0x0f)      /* odd number bytes - hit filler */
142                         break;
143
144                 digit_str[i] = ((octet & 0x0f) + 0x30);
145                 i++;
146                 offset++;
147
148         }
149         digit_str[i]= '\0';
150         return digit_str;
151 }
152
153
154 #include "packet-gsm_map-fn.c"
155
156 /* Stuff included from the "old" packet-gsm_map.c for tapping purposes */
157 static gchar *
158 my_match_strval(guint32 val, const value_string *vs, gint *idx)
159 {
160     gint        i = 0;
161
162     while (vs[i].strptr) {
163         if (vs[i].value == val)
164         {
165             *idx = i;
166             return(vs[i].strptr);
167         }
168
169         i++;
170     }
171
172     *idx = -1;
173     return(NULL);
174 }
175 /* End includes from old" packet-gsm_map.c */
176
177 const value_string gsm_map_opr_code_strings[] = {
178   {   2, "updateLocation" },
179   {   3, "cancelLocation" },
180   {   4, "provideRoamingNumber" },
181   {   6, "resumeCallHandling" },
182   {   7, "insertSubscriberData" },
183   {   8, "deleteSubscriberData" },
184   {   9, "sendParameters" },                                    /* map-ac infoRetrieval (14) version1 (1)*/
185   {  10, "registerSS" },
186   {  11, "eraseSS" },
187   {  12, "activateSS" },
188   {  13, "deactivateSS" },
189   {  14, "interrogateSS" },
190   {  17, "registerPassword" },
191   {  18, "getPassword" },
192   {  19, "processUnstructuredSS-Data" },                /* map-ac networkFunctionalSs (18) version1 (1) */
193   {  22, "sendRoutingInfo" },
194   {  23, "updateGprsLocation" },
195   {  24, "sendRoutingInfoForGprs" },
196   {  25, "failureReport" },
197   {  26, "noteMsPresentForGprs" },
198   {  28, "performHandover" },                                   /* map-ac handoverControl (11) version1 (1)*/
199   {  29, "sendEndSignal" },
200   {  30, "performSubsequentHandover" },                 /* map-ac handoverControl (11) version1 (1) */
201   {  31, "provideSIWFSNumber" },
202   {  32, "sIWFSSignallingModify" },
203   {  33, "processAccessSignalling" },
204   {  34, "forwardAccessSignalling" },
205   {  35, "noteInternalHandover" },                              /* map-ac handoverControl (11) version1 (1) */
206   {  37, "reset" },
207   {  38, "forwardCheckSS-Indication" },
208   {  39, "prepareGroupCall" },
209   {  40, "sendGroupCallEndSignal" },
210   {  41, "processGroupCallSignalling" },
211   {  42, "forwardGroupCallSignalling" },
212   {  43, "checkIMEI" },
213   {  44, "mt-forwardSM" },
214   {  45, "sendRoutingInfoForSM" },
215   {  46, "mo-forwardSM" },
216   {  47, "reportSM-DeliveryStatus" },
217   {  48, "noteSubscriberPresent" },                             /* map-ac mwdMngt (24) version1 (1) */
218   {  49, "alertServiceCentreWithoutResult" },   /* map-ac shortMsgAlert (23) version1 (1) */
219   {  50, "activateTraceMode" },
220   {  51, "deactivateTraceMode" },
221   {  52, "traceSubscriberActivity" },                   /* map-ac handoverControl (11) version1 (1) */
222   {  54, "beginSubscriberActivity" },                   /* map-ac networkFunctionalSs (18) version1 (1) */
223   {  55, "sendIdentification" },
224   {  56, "sendAuthenticationInfo" },
225   {  57, "restoreData" },
226   {  58, "sendIMSI" },
227   {  59, "processUnstructuredSS-Request" },
228   {  60, "unstructuredSS-Request" },
229   {  61, "unstructuredSS-Notify" },
230   {  63, "informServiceCentre" },
231   {  64, "alertServiceCentre" },
232   {  66, "readyForSM" },
233   {  67, "purgeMS" },
234   {  68, "prepareHandover" },
235   {  69, "prepareSubsequentHandover" },
236   {  70, "provideSubscriberInfo" },
237   {  71, "anyTimeInterrogation" },
238   {  72, "ss-InvocationNotification" },
239   {  73, "setReportingState" },
240   {  74, "statusReport" },
241   {  75, "remoteUserFree" },
242   {  76, "registerCC-Entry" },
243   {  77, "eraseCC-Entry" },
244   {  83, "provideSubscriberLocation" },
245   {  85, "sendRoutingInfoForLCS" },
246   {  86, "subscriberLocationReport" },
247   { 0, NULL }
248 };
249 static const value_string gsm_map_err_code_string_vals[] = {
250     { 1,        "Unknown Subscriber" },
251     { 3,        "Unknown MSC" },
252     { 5,        "Unidentified Subscriber" },
253     { 6,        "Absent Subscriber SM" },
254     { 7,        "Unknown Equipment" },
255     { 8,        "Roaming Not Allowed" },
256     { 9,        "Illegal Subscriber" },
257     { 10,       "Bearer Service Not Provisioned" },
258     { 11,       "Teleservice Not Provisioned" },
259     { 12,       "Illegal Equipment" },
260     { 13,       "Call Barred" },
261     { 14,       "Forwarding Violation" },
262     { 15,       "CUG Reject" },
263     { 16,       "Illegal SS Operation" },
264     { 17,       "SS Error Status" },
265     { 18,       "SS Not Available" },
266     { 19,       "SS Subscription Violation" },
267     { 20,       "SS Incompatibility" },
268     { 21,       "Facility Not Supported" },
269     { 25,       "No Handover Number Available" },
270     { 26,       "Subsequent Handover Failure" },
271     { 27,       "Absent Subscriber" },
272     { 28,       "Incompatible Terminal" },
273     { 29,       "Short Term Denial" },
274     { 30,       "Long Term Denial" },
275     { 31,       "Subscriber Busy For MT SMS" },
276     { 32,       "SM Delivery Failure" },
277     { 33,       "Message Waiting List Full" },
278     { 34,       "System Failure" },
279     { 35,       "Data Missing" },
280     { 36,       "Unexpected Data Value" },
281     { 37,       "PW Registration Failure" },
282     { 38,       "Negative PW Check" },
283     { 39,       "No Roaming Number Available" },
284     { 40,       "Tracing Buffer Full" },
285     { 42,       "Target Cell Outside Group Call Area" },
286     { 43,       "Number Of PW Attempts Violation" },
287     { 44,       "Number Changed" },
288     { 45,       "Busy Subscriber" },
289     { 46,       "No Subscriber Reply" },
290     { 47,       "Forwarding Failed" },
291     { 48,       "OR Not Allowed" },
292     { 49,       "ATI Not Allowed" },
293     { 50,       "No Group Call Number Available" },
294     { 51,       "Resource Limitation" },
295     { 52,       "Unauthorized Requesting Network" },
296     { 53,       "Unauthorized LCS Client" },
297     { 54,       "Position Method Failure" },
298     { 58,       "Unknown Or Unreachable LCS Client" },
299     { 59,       "MM Event Not Supported" },
300     { 60,       "ATSI Not Allowed" },
301     { 61,       "ATM Not Allowed" },
302     { 62,       "Information Not Available" },
303     { 71,       "Unknown Alphabet" },
304     { 72,       "USSD Busy" },
305     { 120,      "Nbr Sb Exceeded" },
306     { 121,      "Rejected By User" },
307     { 122,      "Rejected By Network" },
308     { 123,      "Deflection To Served Subscriber" },
309     { 124,      "Special Service Code" },
310     { 125,      "Invalid Deflected To Number" },
311     { 126,      "Max Number Of MPTY Participants Exceeded" },
312     { 127,      "Resources Not Available" },
313     { 0, NULL }
314 };
315 static const true_false_string gsm_map_extension_value = {
316   "No Extension",
317   "Extension"
318 };
319 static const value_string gsm_map_nature_of_number_values[] = {
320         {   0x00,       "unknown" },
321         {   0x01,       "International Number" },
322         {   0x02,       "National Significant Number" },
323         {   0x03,       "Network Specific Number" },
324         {   0x04,       "Subscriber Number" },
325         {   0x05,       "Reserved" },
326         {   0x06,       "Abbreviated Number" },
327         {   0x07,       "Reserved for extension" },
328         { 0, NULL }
329 };
330 static const value_string gsm_map_number_plan_values[] = {
331         {   0x00,       "unknown" },
332         {   0x01,       "ISDN/Telephony Numbering (Rec ITU-T E.164)" },
333         {   0x02,       "spare" },
334         {   0x03,       "Data Numbering (ITU-T Rec. X.121)" },
335         {   0x04,       "Telex Numbering (ITU-T Rec. F.69)" },
336         {   0x05,       "spare" },
337         {   0x06,       "Land Mobile Numbering (ITU-T Rec. E.212)" },
338         {   0x07,       "spare" },
339         {   0x08,       "National Numbering" },
340         {   0x09,       "Private Numbering" },
341         {   0x0f,       "Reserved for extension" },
342         { 0, NULL }
343 };
344
345 static const true_false_string gsm_map_Ss_Status_q_bit_values = {
346   "Quiescent",
347   "Operative"
348 };
349 static const true_false_string gsm_map_Ss_Status_p_values = {
350   "Provisioned",
351   "Not Provisioned"
352 };
353 static const true_false_string gsm_map_Ss_Status_r_values = {
354   "Registered",
355   "Not Registered"
356 };
357 static const true_false_string gsm_map_Ss_Status_a_values = {
358   "Active",
359   "not Active"
360 };
361
362 static guint32 opcode=0;
363
364 static int
365 dissect_gsm_map_Opcode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
366   offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_index, &opcode);
367
368   if (check_col(pinfo->cinfo, COL_INFO)){
369     col_append_fstr(pinfo->cinfo, COL_INFO, val_to_str(opcode, gsm_map_opr_code_strings, "Unknown GSM-MAP (%u)"));
370   }
371
372   return offset;
373 }
374
375 static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
376
377   guint8 octet;
378
379   switch(opcode){
380   case  2: /*updateLocation*/
381     offset=dissect_gsm_map_UpdateLocationArg(FALSE, tvb, offset, pinfo, tree, -1);
382     break;
383   case  3: /*cancelLocation*/
384     offset=dissect_gsm_map_CancelLocationArg(FALSE, tvb, offset, pinfo, tree, -1);
385     break;
386   case  4: /*provideRoamingNumber*/
387     offset=dissect_gsm_map_ProvideRoamingNumberArg(FALSE, tvb, offset, pinfo, tree, -1);
388     break;
389   case  6: /*resumeCallHandling*/
390     offset=dissect_gsm_map_ResumeCallHandlingArg(FALSE, tvb, offset, pinfo, tree, -1);
391     break;
392   case  7: /*insertSubscriberData*/
393     offset=dissect_gsm_map_InsertSubscriberDataArg(FALSE, tvb, offset, pinfo, tree, -1);
394     break;
395   case  8: /*deleteSubscriberData*/
396     offset=dissect_gsm_map_DeleteSubscriberDataArg(FALSE, tvb, offset, pinfo, tree, -1);
397     break;
398         /* TODO find out why this isn't in the ASN1 file
399   case  9: sendParameters
400     offset=dissect_gsm_map_DeleteSubscriberDataArg(FALSE, tvb, offset, pinfo, tree, -1);
401     break;
402         */
403   case  10: /*registerSS*/
404     offset=dissect_gsm_map_RegisterSS_Arg(FALSE, tvb, offset, pinfo, tree, -1);
405     break;
406   case  11: /*eraseSS*/
407     offset=dissect_gsm_map_Ss_ForBS(FALSE, tvb, offset, pinfo, tree, -1);
408     break;
409   case 12: /*activateSS*/
410     offset=dissect_gsm_map_Ss_ForBS(FALSE, tvb, offset, pinfo, tree, -1);
411     break;
412   case 13: /*deactivateSS*/
413     offset=dissect_gsm_map_Ss_ForBS(FALSE, tvb, offset, pinfo, tree, -1);
414     break;
415   case 14: /*interrogateSS*/
416     offset=dissect_gsm_map_InterrogateSS_Res(FALSE, tvb, offset, pinfo, tree, -1);
417     break;
418   case 17: /*registerPassword*/
419     offset=dissect_gsm_map_Ss_Code(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_ss_Code);
420     break;
421   case 18: /*getPassword*/
422     offset=dissect_gsm_map_GetPasswordArg(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_getPassword);
423     break;
424   case 22: /*sendRoutingInfo*/
425     offset=dissect_gsm_map_SendRoutingInfoArg(FALSE, tvb, offset, pinfo, tree, -1);
426     break;
427   case 23: /*updateGprsLocation*/
428     offset=dissect_gsm_map_UpdateGprsLocationArg(FALSE, tvb, offset, pinfo, tree, -1);
429     break;
430   case 24: /*sendRoutingInfoForGprs*/
431     offset=dissect_gsm_map_SendRoutingInfoForGprsArg(FALSE, tvb, offset, pinfo, tree, -1);
432     break;
433   case 25: /*failureReport*/
434     offset=dissect_gsm_map_FailureReportArg(FALSE, tvb, offset, pinfo, tree, -1);
435     break;
436   case 26: /*noteMsPresentForGprs*/
437     offset=dissect_gsm_map_NoteMsPresentForGprsArg(FALSE, tvb, offset, pinfo, tree, -1);
438     break;
439   case 29: /*sendEndSignal*/
440         octet = tvb_get_guint8(tvb,0) & 0xf;
441         if ( octet == 3){ /* This is a V9 message ??? */
442                 offset = offset +2;
443                 offset=dissect_gsm_map_SendEndSignalV9Arg(TRUE, tvb, offset, pinfo, tree, hf_gsm_mapSendEndSignal);
444         }else{
445                 offset=dissect_gsm_map_Bss_APDU(FALSE, tvb, offset, pinfo, tree, hf_gsm_mapSendEndSignal);
446         }
447     break;
448   case 31: /*provideSIWFSNumbe*/
449     offset=dissect_gsm_map_ProvideSIWFSNumberArg(FALSE, tvb, offset, pinfo, tree, -1);
450     break;
451   case 32: /*sIWFSSignallingModify*/
452     offset=dissect_gsm_map_SIWFSSignallingModifyArg(FALSE, tvb, offset, pinfo, tree, -1);
453     break;
454   case 33: /*processAccessSignalling*/
455     offset=dissect_gsm_map_Bss_APDU(FALSE, tvb, offset, pinfo, tree, -1);
456     break;
457   case 34: /*forwardAccessSignalling*/
458     offset=dissect_gsm_map_Bss_APDU(FALSE, tvb, offset, pinfo, tree, -1);
459     break;
460   case 37: /*reset*/
461     offset=dissect_gsm_map_ResetArg(FALSE, tvb, offset, pinfo, tree, -1);
462     break;
463   case 38: /*forwardCheckSS-Indication*/
464     return offset;
465     break;
466   case 39: /*prepareGroupCall*/
467     offset=dissect_gsm_map_PrepareGroupCallArg(FALSE, tvb, offset, pinfo, tree, -1);
468     break;
469   case 40: /*sendGroupCallEndSignal*/
470     dissect_gsm_map_SendGroupCallEndSignalArg(FALSE, tvb, offset, pinfo, tree, -1);
471     break;
472   case 42: /*processGroupCallSignalling*/
473     offset=dissect_gsm_map_ProcessGroupCallSignallingArg(FALSE, tvb, offset, pinfo, tree, -1);
474     break;
475   case 43: /*checkIMEI*/
476     offset=dissect_gsm_map_CheckIMEIArg(FALSE, tvb, offset, pinfo, tree, -1);
477     break;
478   case 44: /*mt-forwardSM*/
479     offset=dissect_gsm_map_CheckIMEIArg(FALSE, tvb, offset, pinfo, tree, -1);
480     break;
481   case 45: /*sendRoutingInfoForSM*/
482     offset=dissect_gsm_map_RoutingInfoForSMRes(FALSE, tvb, offset, pinfo, tree, -1);
483     break;
484   case 46: /*mo-forwardSM*/
485     offset=dissect_gsm_map_Mo_forwardSM_Arg(FALSE, tvb, offset, pinfo, tree, -1);
486     break;
487   case 47: /*reportSM-DeliveryStatus*/
488     offset=dissect_gsm_map_ReportSM_DeliveryStatusArg(FALSE, tvb, offset, pinfo, tree, -1);
489     break;
490   case 50: /*activateTraceMode*/
491     offset=dissect_gsm_map_ActivateTraceModeArg(FALSE, tvb, offset, pinfo, tree, -1);
492     break;
493   case 51: /*deactivateTraceMode*/
494     offset=dissect_gsm_map_DeactivateTraceModeArg(FALSE, tvb, offset, pinfo, tree, -1);
495     break;
496   case 55: /*sendIdentification*/
497     offset=dissect_gsm_map_Tmsi(FALSE, tvb, offset, pinfo, tree, -1);
498     break;
499   case 56: /*sendAuthenticationInfo*/
500           if (application_context_version < 3 ){
501                   offset=dissect_gsm_map_SendAuthenticationInfoArg(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_imsi);
502           }else{
503                   offset=dissect_gsm_map_SendAuthenticationInfoArgV3(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_SendAuthenticationInfoArg);
504           }
505         break;
506   case 57: /*restoreData*/
507         offset=dissect_gsm_map_RestoreDataArg(FALSE, tvb, offset, pinfo, tree, -1);
508         break;
509   case 58: /*sendIMSI*/
510         offset=dissect_gsm_map_Msisdn(FALSE, tvb, offset, pinfo, tree, -1);
511         break;
512   case 59: /*processUnstructuredSS-Request*/
513     offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1);
514     break;
515   case 60: /*unstructuredSS-Request*/
516     offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1);
517     break;
518   case 61: /*unstructuredSS-Notify*/
519     offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1);
520     break;
521   case 63: /*informServiceCentre*/
522     offset=dissect_gsm_map_InformServiceCentreArg(FALSE, tvb, offset, pinfo, tree, -1);
523     break;
524   case 64: /*alertServiceCentre*/
525     offset=dissect_gsm_map_AlertServiceCentreArg(FALSE, tvb, offset, pinfo, tree, -1);
526     break;
527   case 66: /*readyForSM*/
528     offset=dissect_gsm_map_ReadyForSM_Arg(FALSE, tvb, offset, pinfo, tree, -1);
529     break;
530   case 67: /*purgeMS*/
531     offset=dissect_gsm_map_PurgeMS_Arg(FALSE, tvb, offset, pinfo, tree, -1);
532     break;
533   case 68: /*prepareHandover*/
534         octet = tvb_get_guint8(tvb,0) & 0xf;
535         if ( octet == 3){ /* This is a V9 message ??? */
536                 offset = offset +2;
537                 offset=dissect_gsm_map_PrepareHandoverV3Arg(TRUE, tvb, offset, pinfo, tree, -1);
538         }else{
539                 offset=dissect_gsm_map_PrepareHO_Arg(FALSE, tvb, offset, pinfo, tree, -1);
540         }
541     break;
542   case 69: /*prepareSubsequentHandover*/
543     offset=dissect_gsm_map_PrepareSubsequentHO_Arg(FALSE, tvb, offset, pinfo, tree, -1);
544     break;
545   case 70: /*provideSubscriberInfo*/
546     offset=dissect_gsm_map_ProvideSubscriberInfoArg(FALSE, tvb, offset, pinfo, tree, -1);
547     break;
548   case 71: /*anyTimeInterrogation*/
549     offset=dissect_gsm_map_AnyTimeInterrogationArg(FALSE, tvb, offset, pinfo, tree, -1);
550     break;
551   case 72: /*ss-InvocationNotificatio*/
552     offset=dissect_gsm_map_Ss_InvocationNotificationArg(FALSE, tvb, offset, pinfo, tree, -1);
553     break;
554   case 73: /*setReportingState*/
555     offset=dissect_gsm_map_SetReportingStateArg(FALSE, tvb, offset, pinfo, tree, -1);
556     break;
557   case 74: /*statusReport*/
558     offset=dissect_gsm_map_StatusReportArg(FALSE, tvb, offset, pinfo, tree, -1);
559     break;
560   case 75: /*remoteUserFree*/
561     offset=dissect_gsm_map_RemoteUserFreeArg(FALSE, tvb, offset, pinfo, tree, -1);
562     break;
563   case 76: /*registerCC-Entry*/
564     offset=dissect_gsm_map_RegisterCC_EntryArg(FALSE, tvb, offset, pinfo, tree, -1);
565     break;
566   case 77: /*eraseCC-Entry*/
567     offset=dissect_gsm_map_EraseCC_EntryArg(FALSE, tvb, offset, pinfo, tree, -1);
568     break;
569   case 83: /*provideSubscriberLocation*/
570     offset=dissect_gsm_map_ProvideSubscriberLocation_Arg(FALSE, tvb, offset, pinfo, tree, -1);
571     break;
572   case 85: /*sendRoutingInfoForLCS*/
573     offset=dissect_gsm_map_RoutingInfoForLCS_Arg(FALSE, tvb, offset, pinfo, tree, -1);
574     break;
575   case 86: /*subscriberLocationReport*/
576     offset=dissect_gsm_map_SubscriberLocationReport_Arg(FALSE, tvb, offset, pinfo, tree, -1);
577     break;
578   default:
579     proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob");
580   }
581   return offset;
582 }
583
584
585 static int dissect_returnResultData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
586         
587   guint8 octet;
588   switch(opcode){
589   case  2: /*updateLocation*/
590     offset=dissect_gsm_map_UpdateLocationRes(FALSE, tvb, offset, pinfo, tree, -1);
591     break;
592   case  3: /*cancelLocation*/
593     offset=dissect_gsm_map_CancelLocationRes(FALSE, tvb, offset, pinfo, tree, -1);
594     break;
595   case  4: /*provideRoamingNumber*/
596     offset=dissect_gsm_map_ProvideRoamingNumberRes(FALSE, tvb, offset, pinfo, tree, -1);
597     break;
598   case  6: /*resumeCallHandling*/
599     offset=dissect_gsm_map_ResumeCallHandlingRes(FALSE, tvb, offset, pinfo, tree, -1);
600     break;
601   case  7: /*insertSubscriberData*/
602     offset=dissect_gsm_map_InsertSubscriberDataRes(FALSE, tvb, offset, pinfo, tree, -1);
603     break;
604   case  8: /*deleteSubscriberData*/
605     offset=dissect_gsm_map_DeleteSubscriberDataRes(FALSE, tvb, offset, pinfo, tree, -1);
606     break;
607         /* TODO find out why this isn't in the ASN1 file
608   case  9: sendParameters
609     offset=dissect_gsm_map_DeleteSubscriberDataArg(FALSE, tvb, offset, pinfo, tree, -1);
610     break;
611         */
612   case  10: /*registerSS*/
613     offset=dissect_gsm_map_Ss_Info(FALSE, tvb, offset, pinfo, tree, -1);
614     break;
615   case  11: /*eraseSS*/
616     offset=dissect_gsm_map_Ss_Info(FALSE, tvb, offset, pinfo, tree, -1);
617     break;
618   case 12: /*activateSS*/
619     offset=dissect_gsm_map_Ss_Info(FALSE, tvb, offset, pinfo, tree, -1);
620     break;
621   case 13: /*deactivateSS*/
622     offset=dissect_gsm_map_Ss_Info(FALSE, tvb, offset, pinfo, tree, -1);
623     break;
624   case 14: /*interrogateSS*/
625     offset=dissect_gsm_map_InterrogateSS_Res(FALSE, tvb, offset, pinfo, tree, -1);
626     break;
627   case 17: /*registerPassword*/
628     offset=dissect_gsm_map_NewPassword(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_ss_Code);
629     break;
630   case 18: /*getPassword*/
631     offset=dissect_gsm_map_CurrentPassword(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_currentPassword);
632     break;
633   case 22: /*sendRoutingInfo*/
634           /* This is done to get around a problem with IMPLICIT tag:s */
635     offset = offset +2;
636     offset=dissect_gsm_map_SendRoutingInfoRes(TRUE, tvb, offset, pinfo, tree, -1);
637     break;
638   case 23: /*updateGprsLocation*/
639     offset=dissect_gsm_map_UpdateGprsLocationRes(FALSE, tvb, offset, pinfo, tree, -1);
640     break;
641   case 24: /*sendRoutingInfoForGprs*/
642     offset=dissect_gsm_map_SendRoutingInfoForGprsRes(FALSE, tvb, offset, pinfo, tree, -1);
643     break;
644   case 25: /*failureReport*/
645     offset=dissect_gsm_map_FailureReportRes(FALSE, tvb, offset, pinfo, tree, -1);
646     break;
647   case 26: /*noteMsPresentForGprs*/
648     offset=dissect_gsm_map_NoteMsPresentForGprsRes(FALSE, tvb, offset, pinfo, tree, -1);
649     break;
650   case 29: /*sendEndSignal*/
651           /* Taken from MAP-MobileServiceOperations{ 0 identified-organization (4) etsi (0) mobileDomain 
652            * (0) gsm-Network (1) modules (3) map-MobileServiceOperations (5) version9 (9) }
653            */
654     offset=dissect_gsm_map_ExtensionContainer(FALSE, tvb, offset, pinfo, tree, -1);
655     break;
656   case 31: /*provideSIWFSNumbe*/
657     offset=dissect_gsm_map_ProvideSIWFSNumberRes(FALSE, tvb, offset, pinfo, tree, -1);
658     break;
659   case 32: /*provideSIWFSNumbe*/
660     offset=dissect_gsm_map_SIWFSSignallingModifyRes(FALSE, tvb, offset, pinfo, tree, -1);
661     break;
662   case 39: /*prepareGroupCall*/
663     offset=dissect_gsm_map_PrepareGroupCallRes(FALSE, tvb, offset, pinfo, tree, -1);
664     break;
665   case 40: /*sendGroupCallEndSignal*/
666     dissect_gsm_map_SendGroupCallEndSignalRes(FALSE, tvb, offset, pinfo, tree, -1);
667     break;
668   case 43: /*checkIMEI*/
669     offset=dissect_gsm_map_EquipmentStatus(FALSE, tvb, offset, pinfo, tree, -1);
670     break;
671   case 45: /*sendRoutingInfoForSM*/
672     offset=dissect_gsm_map_RoutingInfoForSMRes(FALSE, tvb, offset, pinfo, tree, -1);
673     break;
674   case 46: /*mo-forwardSM*/
675     offset=dissect_gsm_map_Mo_forwardSM_Res(FALSE, tvb, offset, pinfo, tree, -1);
676     break;
677   case 48: /*reportSM-DeliveryStatus*/
678     offset=dissect_gsm_map_ReportSM_DeliveryStatusArg(FALSE, tvb, offset, pinfo, tree, -1);
679     break;
680   case 50: /*activateTraceMode*/
681     offset=dissect_gsm_map_ActivateTraceModeRes(FALSE, tvb, offset, pinfo, tree, -1);
682     break;
683   case 51: /*deactivateTraceMode*/
684     offset=dissect_gsm_map_DeactivateTraceModeRes(FALSE, tvb, offset, pinfo, tree, -1);
685     break;
686   case 55: /*sendIdentification*/
687     offset=dissect_gsm_map_SendIdentificationRes(FALSE, tvb, offset, pinfo, tree, -1);
688     break;
689   case 56:
690           offset = dissect_gsm_map_SendAuthenticationInfoRes(FALSE, tvb, offset, pinfo, tree, -1);
691   case 57: /*restoreData*/
692         offset=dissect_gsm_map_RestoreDataRes(FALSE, tvb, offset, pinfo, tree, -1);
693         break;
694   case 58: /*sendIMSI*/
695         offset=dissect_gsm_map_Imsi(FALSE, tvb, offset, pinfo, tree,hf_gsm_map_imsi);
696         break;
697   case 59: /*unstructuredSS-Request*/
698     offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1);
699     break;
700   case 60: /*unstructuredSS-Request*/
701     offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1);
702     break;
703   case 61: /*unstructuredSS-Notify*/
704     /* TRUE ? */
705     proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob");
706     break;
707   case 66: /*readyForSM*/
708     offset=dissect_gsm_map_ReadyForSM_Res(FALSE, tvb, offset, pinfo, tree, -1);
709     break;
710   case 67: /*purgeMS*/
711     offset=dissect_gsm_map_PurgeMS_Res(FALSE, tvb, offset, pinfo, tree, -1);
712     break;
713   case 68: /*prepareHandover*/
714         octet = tvb_get_guint8(tvb,0) & 0xf;
715         if ( octet == 3){ /* This is a V9 message ??? */
716                 offset = offset +2;
717                 offset=dissect_gsm_map_PrepareHandoverV3Res(TRUE, tvb, offset, pinfo, tree, hf_gsm_mapSendEndSignal);
718         }else{
719                 offset=dissect_gsm_map_PrepareHO_Res(FALSE, tvb, offset, pinfo, tree, -1);
720         }
721     break;
722   case 69: /*prepareSubsequentHandover*/
723      offset=dissect_gsm_map_Bss_APDU(FALSE, tvb, offset, pinfo, tree, -1);
724     break;
725   case 70: /*provideSubscriberInfo*/
726     offset=dissect_gsm_map_ProvideSubscriberInfoRes(FALSE, tvb, offset, pinfo, tree, -1);
727     break;
728   case 71: /*anyTimeInterrogation*/
729     offset=dissect_gsm_map_AnyTimeInterrogationRes(FALSE, tvb, offset, pinfo, tree, -1);
730     break;
731   case 72: /*ss-InvocationNotificatio*/
732     offset=dissect_gsm_map_Ss_InvocationNotificationRes(FALSE, tvb, offset, pinfo, tree, -1);
733     break;
734   case 73: /*setReportingState*/
735     offset=dissect_gsm_map_SetReportingStateRes(FALSE, tvb, offset, pinfo, tree, -1);
736     break;
737   case 74: /*statusReport*/
738     offset=dissect_gsm_map_StatusReportRes(FALSE, tvb, offset, pinfo, tree, -1);
739     break;
740   case 75: /*remoteUserFree*/
741     offset=dissect_gsm_map_RemoteUserFreeRes(FALSE, tvb, offset, pinfo, tree, -1);
742     break;
743   case 76: /*registerCC-Entry*/
744     offset=dissect_gsm_map_RegisterCC_EntryRes(FALSE, tvb, offset, pinfo, tree, -1);
745     break;
746   case 77: /*eraseCC-Entry*/
747     offset=dissect_gsm_map_EraseCC_EntryRes(FALSE, tvb, offset, pinfo, tree, -1);
748     break;
749   case 83: /*provideSubscriberLocation*/
750     offset=dissect_gsm_map_ProvideSubscriberLocation_Res(FALSE, tvb, offset, pinfo, tree, -1);
751     break;
752   case 85: /*sendRoutingInfoForLCS*/
753     offset=dissect_gsm_map_RoutingInfoForLCS_Arg(FALSE, tvb, offset, pinfo, tree, -1);
754     break;
755   case 86: /*subscriberLocationReport*/
756     offset=dissect_gsm_map_SubscriberLocationReport_Res(FALSE, tvb, offset, pinfo, tree, -1);
757     break;
758  default:
759     proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob");
760   }
761   return offset;
762 }
763
764 static int 
765 dissect_invokeCmd(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
766   return dissect_gsm_map_Opcode(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_invokeCmd);
767 }
768
769 static int dissect_invokeid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
770   return dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_gsm_map_invokeid, NULL);
771 }
772
773
774 static const value_string InvokeId_vals[] = {
775   {   0, "invokeid" },
776   {   1, "absent" },
777   { 0, NULL }
778 };
779
780 static int dissect_absent(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
781   return dissect_gsm_map_NULL(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_absent);
782 }
783
784
785 static const ber_choice_t InvokeId_choice[] = {
786   {   0, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeid },
787   {   1, BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_absent },
788   { 0, 0, 0, 0, NULL }
789 };
790
791 static int
792 dissect_gsm_map_InvokeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
793   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
794                               InvokeId_choice, hf_index, ett_gsm_map_InvokeId);
795
796   return offset;
797 }
798 static int dissect_invokeId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
799   return dissect_gsm_map_InvokeId(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_invokeId);
800 }
801
802 static const ber_sequence_t InvokePDU_sequence[] = {
803   { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
804   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeCmd },
805   { BER_CLASS_UNI, -1/*depends on Cmd*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeData },
806   { 0, 0, 0, NULL }
807 };
808
809 static int
810 dissect_gsm_map_InvokePDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
811   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
812                                 InvokePDU_sequence, hf_index, ett_gsm_map_InvokePDU);
813
814   return offset;
815 }
816 static int dissect_invoke_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
817   return dissect_gsm_map_InvokePDU(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_invoke);
818 }
819
820 static const ber_sequence_t ReturnResult_result_sequence[] = {
821   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeCmd },
822   { BER_CLASS_UNI, -1/*depends on Cmd*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_returnResultData },
823   { 0, 0, 0, NULL }
824 };
825 static int
826 dissect_returnResult_result(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
827   offset = dissect_ber_sequence(FALSE, pinfo, tree, tvb, offset,
828                                 ReturnResult_result_sequence, hf_gsm_map_returnResult_result, ett_gsm_map_ReturnResult_result);
829
830   return offset;
831 }
832
833 static const ber_sequence_t ReturnResultPDU_sequence[] = {
834   { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
835   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_returnResult_result },
836   { 0, 0, 0, NULL }
837 };
838
839 static int
840 dissect_gsm_map_returnResultPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
841   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
842                                 ReturnResultPDU_sequence, hf_index, ett_gsm_map_ReturnResultPDU);
843
844   return offset;
845 }
846 static int dissect_returnResult_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
847   return dissect_gsm_map_returnResultPDU(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_returnResult);
848 }
849
850 static int
851 dissect_local_errorCode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
852   return dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_gsm_map_local_errorCode, NULL);
853 }
854
855 static int
856 dissect_global_errorCode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
857   offset =  dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
858                                          hf_gsm_map_global_errorCode_oid, NULL);
859   return dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_gsm_map_global_errorCode, NULL);
860 }
861 static const ber_choice_t ReturnError_result_choice[] = {
862   {   0, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_local_errorCode },
863   {   1, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_global_errorCode },
864   {   0, 0, 0, 0, NULL }
865 };
866
867
868 static int
869 dissect_ReturnError_result(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
870
871   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
872                               ReturnError_result_choice, hf_gsm_map_returnError_result, ett_gsm_map_ReturnError_result);
873
874   return offset;
875 }
876
877 static const ber_sequence_t ReturnErrorPDU_sequence[] = {
878   { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
879   { BER_CLASS_UNI, -1/*choice*/,BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ReturnError_result },
880   { 0, 0, 0, NULL }
881 };
882
883 static int
884 dissect_gsm_map_ReturnErrorPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
885   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
886                                 ReturnErrorPDU_sequence, hf_index, ett_gsm_map_ReturnErrorPDU);
887
888   return offset;
889 }
890 static int dissect_returnError_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
891   return dissect_gsm_map_ReturnErrorPDU(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_returnError);
892 }
893
894
895 static const value_string GSMMAPPDU_vals[] = {
896   {   1, "Invoke " },
897   {   2, "ReturnResult " },
898   {   3, "ReturnError " },
899   {   4, "Reject " },
900   { 0, NULL }
901 };
902
903 static const ber_choice_t GSMMAPPDU_choice[] = {
904   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_invoke_impl },
905   {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_returnResult_impl },
906   {   3, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_returnError_impl },
907 #ifdef REMOVED
908   {   4, BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_reject_impl },
909 #endif
910   { 0, 0, 0, 0, NULL }
911 };
912
913 static guint8 gsmmap_pdu_type = 0;
914 static guint8 gsm_map_pdu_size = 0;
915
916 static int
917 dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo , proto_tree *tree, int hf_index) {
918
919         char *version_ptr, *version_str;
920
921         opcode = 0;
922         application_context_version = 0;
923         if (pinfo->private_data != NULL){
924                 version_ptr = strrchr(pinfo->private_data,'.');
925                 version_str = g_strdup(version_ptr+1);
926                 application_context_version = atoi(version_str);
927         }
928
929   gsmmap_pdu_type = tvb_get_guint8(tvb, offset)&0x0f;
930   /* Get the length and add 2 */
931   gsm_map_pdu_size = tvb_get_guint8(tvb, offset+1)+2;
932
933   if (check_col(pinfo->cinfo, COL_INFO)){
934     col_set_str(pinfo->cinfo, COL_INFO, val_to_str(gsmmap_pdu_type, GSMMAPPDU_vals, "Unknown GSM-MAP PDU (%u)"));
935   }
936
937   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
938                               GSMMAPPDU_choice, hf_index, ett_gsm_map_GSMMAPPDU);
939
940
941   return offset;
942 }
943
944
945
946
947 static void
948 dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
949 {
950     proto_item          *item=NULL;
951     proto_tree          *tree=NULL;
952         /* Used for gsm_map TAP */
953         static                  gsm_map_tap_rec_t tap_rec;
954         gint                    op_idx;
955     gchar                       *str = NULL;
956
957
958     if (check_col(pinfo->cinfo, COL_PROTOCOL))
959     {
960         col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM MAP");
961     }
962
963         top_tree = parent_tree;
964
965     /* create display subtree for the protocol */
966     if(parent_tree){
967        item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, FALSE);
968        tree = proto_item_add_subtree(item, ett_gsm_map);
969     }
970
971     dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, pinfo, tree, -1);
972         str = my_match_strval(opcode, gsm_map_opr_code_strings, &op_idx);
973
974         tap_rec.invoke = FALSE;
975         if ( gsmmap_pdu_type  == 1 )
976                 tap_rec.invoke = TRUE;
977         tap_rec.opr_code_idx = op_idx;
978         tap_rec.size = gsm_map_pdu_size;
979
980         tap_queue_packet(gsm_map_tap, pinfo, &tap_rec);
981
982
983 }
984
985 static const value_string ssCode_vals[] = {
986   { 0x00, "allSS - all SS" },
987   { 0x10 ,"allLineIdentificationSS - all line identification SS" },
988   { 0x11 ,"clip - calling line identification presentation" },
989   { 0x12 ,"clir - calling line identification restriction" },
990   { 0x13 ,"colp - connected line identification presentation" },
991   { 0x14 ,"colr - connected line identification restriction" },
992   { 0x15 ,"mci - malicious call identification" },
993   { 0x18 ,"allNameIdentificationSS - all name indentification SS" },
994   { 0x19 ,"cnap - calling name presentation" },
995   { 0x20 ,"allForwardingSS - all forwarding SS" },
996   { 0x21 ,"cfu - call forwarding unconditional" },
997   { 0x28 ,"allCondForwardingSS - all conditional forwarding SS" },
998   { 0x29 ,"cfb - call forwarding busy" },
999   { 0x2a ,"cfnry - call forwarding on no reply" },
1000   { 0x2b ,"cfnrc - call forwarding on mobile subscriber not reachable" },
1001   { 0x24 ,"cd - call deflection" },
1002   { 0x30 ,"allCallOfferingSS - all call offering SS includes also all forwarding SS" },
1003   { 0x31 ,"ect - explicit call transfer" },
1004   { 0x32 ,"mah - mobile access hunting" },
1005   { 0x40 ,"allCallCompletionSS - all Call completion SS" },
1006   { 0x41 ,"cw - call waiting" },
1007   { 0x42 ,"hold - call hold" },
1008   { 0x43 ,"ccbs-A - completion of call to busy subscribers, originating side" },
1009   { 0x44 ,"ccbs-B - completion of call to busy subscribers, destination side" },
1010   { 0x45 ,"mc - multicall" },
1011   { 0x50 ,"allMultiPartySS - all multiparty SS" },
1012   { 0x51 ,"multiPTY - multiparty" },
1013   { 0x60 ,"allCommunityOfInterestSS - all community of interest SS" },
1014   { 0x61 ,"cug - closed user group" },
1015   { 0x70 ,"allChargingSS - all charging SS" },
1016   { 0x71 ,"aoci - advice of charge information" },
1017   { 0x72 ,"aocc - advice of charge charging" },
1018   { 0x80 ,"allAdditionalInfoTransferSS - all additional information transfer SS" },
1019   { 0x81 ,"uus1 - UUS1 user-to-user signalling" },
1020   { 0x82 ,"uus2 - UUS2 user-to-user signalling" },
1021   { 0x83 ,"uus3 - UUS3 user-to-user signalling" },
1022   { 0x90 ,"allCallRestrictionSS - all Callrestriction SS" },
1023   { 0x91 ,"barringOfOutgoingCalls" },
1024   { 0x92 ,"baoc - barring of all outgoing calls" },
1025   { 0x93 ,"boic - barring of outgoing international calls" },
1026   { 0x94 ,"boicExHC - barring of outgoing international calls except those directed to the home PLMN" },
1027   { 0x99 ,"barringOfIncomingCalls" },
1028   { 0x9a ,"baic - barring of all incoming calls" },
1029   { 0x9b ,"bicRoam - barring of incoming calls when roaming outside home PLMN Country" },
1030   { 0xf0 ,"allPLMN-specificSS" },
1031   { 0xa0 ,"allCallPrioritySS - all call priority SS" },
1032   { 0xa1 ,"emlpp - enhanced Multilevel Precedence Pre-emption (EMLPP) service" },
1033   { 0xb0 ,"allLCSPrivacyException - all LCS Privacy Exception Classes" },
1034   { 0xb1 ,"universal - allow location by any LCS client" },
1035   { 0xb2 ,"callrelated - allow location by any value added LCS client to which a call is established from the target MS" },
1036   { 0xb3 ,"callunrelated - allow location by designated external value added LCS clients" },
1037   { 0xb4 ,"plmnoperator - allow location by designated PLMN operator LCS clients" },
1038   { 0xc0 ,"allMOLR-SS - all Mobile Originating Location Request Classes" },
1039   { 0xc1 ,"basicSelfLocation - allow an MS to request its own location" },
1040   { 0xc2 ,"autonomousSelfLocation - allow an MS to perform self location without interaction with the PLMN for a predetermined period of time" },
1041   { 0xc3 ,"transferToThirdParty - allow an MS to request transfer of its location to another LCS client" },
1042
1043   { 0xf1 ,"plmn-specificSS-1" },
1044   { 0xf2 ,"plmn-specificSS-2" },
1045   { 0xf3 ,"plmn-specificSS-3" },
1046   { 0xf4 ,"plmn-specificSS-4" },
1047   { 0xf5 ,"plmn-specificSS-5" },
1048   { 0xf6 ,"plmn-specificSS-6" },
1049   { 0xf7 ,"plmn-specificSS-7" },
1050   { 0xf8 ,"plmn-specificSS-8" },
1051   { 0xf9 ,"plmn-specificSS-9" },
1052   { 0xfa ,"plmn-specificSS-a" },
1053   { 0xfb ,"plmn-specificSS-b" },
1054   { 0xfc ,"plmn-specificSS-c" },
1055   { 0xfd ,"plmn-specificSS-d" },
1056   { 0xfe ,"plmn-specificSS-e" },
1057   { 0xff ,"plmn-specificSS-f" },
1058   { 0, NULL }
1059 };
1060
1061 static const value_string Teleservice_vals[] = {
1062 {0x00, "allTeleservices" },
1063 {0x10, "allSpeechTransmissionServices" },
1064 {0x11, "telephony" },
1065 {0x12, "emergencyCalls" },
1066 {0x20, "allShortMessageServices" },
1067 {0x21, "shortMessageMT-PP" },
1068 {0x22, "shortMessageMO-PP" },
1069 {0x60, "allFacsimileTransmissionServices" },
1070 {0x61, "facsimileGroup3AndAlterSpeech" },
1071 {0x62, "automaticFacsimileGroup3" },
1072 {0x63, "facsimileGroup4" },
1073
1074 {0x70, "allDataTeleservices" },
1075 {0x80, "allTeleservices-ExeptSMS" },
1076
1077 {0x90, "allVoiceGroupCallServices" },
1078 {0x91, "voiceGroupCall" },
1079 {0x92, "voiceBroadcastCall" },
1080
1081 {0xd0, "allPLMN-specificTS" },
1082 {0xd1, "plmn-specificTS-1" },
1083 {0xd2, "plmn-specificTS-2" },
1084 {0xd3, "plmn-specificTS-3" },
1085 {0xd4, "plmn-specificTS-4" },
1086 {0xd5, "plmn-specificTS-5" },
1087 {0xd6, "plmn-specificTS-6" },
1088 {0xd7, "plmn-specificTS-7" },
1089 {0xd8, "plmn-specificTS-8" },
1090 {0xd9, "plmn-specificTS-9" },
1091 {0xda, "plmn-specificTS-A" },
1092 {0xdb, "plmn-specificTS-B" },
1093 {0xdc, "plmn-specificTS-C" },
1094 {0xdd, "plmn-specificTS-D" },
1095 {0xde, "plmn-specificTS-E" },
1096 {0xdf, "plmn-specificTS-F" },
1097   { 0, NULL }
1098 };
1099 /*--- proto_reg_handoff_gsm_map ---------------------------------------*/
1100 void proto_reg_handoff_gsm_map(void) {
1101     dissector_handle_t  map_handle;
1102         static int map_prefs_initialized = FALSE;
1103
1104     map_handle = create_dissector_handle(dissect_gsm_map, proto_gsm_map);
1105
1106         if (!map_prefs_initialized) {
1107                 map_prefs_initialized = TRUE;
1108         }
1109         else {
1110                 dissector_delete("tcap.itu_ssn", tcap_itu_ssn1, map_handle);
1111                 dissector_delete("tcap.itu_ssn", tcap_itu_ssn2, map_handle);
1112                 dissector_delete("tcap.itu_ssn", tcap_itu_ssn3, map_handle);
1113                 dissector_delete("tcap.itu_ssn", tcap_itu_ssn4, map_handle);
1114         }
1115                 /* Set our sub system number for future use */
1116         tcap_itu_ssn1 = global_tcap_itu_ssn1;
1117         tcap_itu_ssn2 = global_tcap_itu_ssn2;
1118         tcap_itu_ssn3 = global_tcap_itu_ssn3;
1119         tcap_itu_ssn4 = global_tcap_itu_ssn4;
1120
1121     dissector_add("tcap.itu_ssn", tcap_itu_ssn1, map_handle);
1122     dissector_add("tcap.itu_ssn", tcap_itu_ssn2, map_handle);
1123     dissector_add("tcap.itu_ssn", tcap_itu_ssn3, map_handle);
1124     dissector_add("tcap.itu_ssn", tcap_itu_ssn4, map_handle);
1125 }
1126
1127 /*--- proto_register_gsm_map -------------------------------------------*/
1128 void proto_register_gsm_map(void) {
1129         module_t *gsm_map_module;
1130
1131   /* List of fields */
1132   static hf_register_info hf[] = {
1133     { &hf_gsm_map_invokeCmd,
1134       { "invokeCmd", "gsm_map.invokeCmd",
1135         FT_UINT32, BASE_DEC, VALS(gsm_map_opr_code_strings), 0,
1136         "InvokePDU/invokeCmd", HFILL }},
1137     { &hf_gsm_map_invokeid,
1138       { "invokeid", "gsm_map.invokeid",
1139         FT_INT32, BASE_DEC, NULL, 0,
1140         "InvokeId/invokeid", HFILL }},
1141     { &hf_gsm_map_absent,
1142       { "absent", "gsm_map.absent",
1143         FT_NONE, BASE_NONE, NULL, 0,
1144         "InvokeId/absent", HFILL }},
1145     { &hf_gsm_map_invokeId,
1146       { "invokeId", "gsm_map.invokeId",
1147         FT_UINT32, BASE_DEC, VALS(InvokeId_vals), 0,
1148         "InvokePDU/invokeId", HFILL }},
1149         { &hf_gsm_map_SendAuthenticationInfoArg,
1150       { "SendAuthenticationInfoArg", "gsm_map.SendAuthenticationInfoArg",
1151         FT_BYTES, BASE_NONE, NULL, 0,
1152         "SendAuthenticationInfoArg", HFILL }},
1153     { &hf_gsm_map_currentPassword,
1154       { "currentPassword", "gsm_map.currentPassword",
1155         FT_STRING, BASE_NONE, NULL, 0,
1156         "", HFILL }},
1157         { &hf_gsm_mapSendEndSignal,
1158       { "mapSendEndSignalArg", "gsm_map.mapsendendsignalarg",
1159         FT_BYTES, BASE_NONE, NULL, 0,
1160         "mapSendEndSignalArg", HFILL }},
1161     { &hf_gsm_map_invoke,
1162       { "invoke", "gsm_map.invoke",
1163         FT_NONE, BASE_NONE, NULL, 0,
1164         "GSMMAPPDU/invoke", HFILL }},
1165     { &hf_gsm_map_returnResult,
1166       { "returnResult", "gsm_map.returnResult",
1167         FT_NONE, BASE_NONE, NULL, 0,
1168         "GSMMAPPDU/returnResult", HFILL }},
1169         {&hf_gsm_map_returnResult_result,
1170       { "returnResult_result", "gsm_map.returnresultresult",
1171         FT_BYTES, BASE_NONE, NULL, 0,
1172         "returnResult_result", HFILL }},
1173         {&hf_gsm_map_returnError_result,
1174       { "returnError_result", "gsm_map.returnerrorresult",
1175         FT_UINT32, BASE_DEC, NULL, 0,
1176         "returnError_result", HFILL }},
1177         {&hf_gsm_map_returnError,
1178       { "returnError", "gsm_map.returnError",
1179         FT_NONE, BASE_NONE, NULL, 0,
1180         "GSMMAPPDU/returnError", HFILL }},
1181         {&hf_gsm_map_local_errorCode,
1182       { "Local Error Code", "gsm_map.localerrorCode",
1183         FT_UINT32, BASE_DEC, VALS(gsm_map_err_code_string_vals), 0,
1184         "localerrorCode", HFILL }},
1185         {&hf_gsm_map_global_errorCode_oid,
1186       { "Global Error Code OID", "gsm_map.hlobalerrorCodeoid",
1187         FT_BYTES, BASE_NONE, NULL, 0,
1188         "globalerrorCodeoid", HFILL }},
1189         {&hf_gsm_map_global_errorCode,
1190       { "Global Error Code", "gsm_map.globalerrorCode",
1191         FT_UINT32, BASE_DEC, NULL, 0,
1192         "globalerrorCode", HFILL }},
1193     { &hf_gsm_map_getPassword,
1194       { "Password", "gsm_map.password",
1195         FT_UINT8, BASE_DEC, VALS(gsm_map_GetPasswordArg_vals), 0,
1196         "Password", HFILL }},
1197     { &hf_gsm_map_extension,
1198       { "Extension", "gsm_map.extension",
1199         FT_BOOLEAN, 8, TFS(&gsm_map_extension_value), 0x80,
1200         "Extension", HFILL }},
1201     { &hf_gsm_map_nature_of_number,
1202       { "Nature of number", "gsm_map.nature_of_number",
1203         FT_UINT8, BASE_HEX, VALS(gsm_map_nature_of_number_values), 0x70,
1204         "ature of number", HFILL }},
1205     { &hf_gsm_map_number_plan,
1206       { "Number plan", "gsm_map.number_plan",
1207         FT_UINT8, BASE_HEX, VALS(gsm_map_number_plan_values), 0x0f,
1208         "Number plan", HFILL }},
1209         { &hf_gsm_map_misdn_digits,
1210       { "Misdn digits", "gsm_map.misdn_digits",
1211         FT_STRING, BASE_NONE, NULL, 0,
1212         "Misdn digits", HFILL }},
1213         { &hf_gsm_map_servicecentreaddress_digits,
1214       { "ServiceCentreAddress digits", "gsm_map.servicecentreaddress_digits",
1215         FT_STRING, BASE_NONE, NULL, 0,
1216         "ServiceCentreAddress digits", HFILL }},
1217         { &hf_gsm_map_map_gmsc_address_digits,
1218       { "Gmsc Address digits digits", "gsm_map.gmsc_address_digits",
1219         FT_STRING, BASE_NONE, NULL, 0,
1220         "Gmsc Address digits", HFILL }},
1221         { &hf_gsm_map_imsi_digits,
1222       { "Imsi digits", "gsm_map.imsi_digits",
1223         FT_STRING, BASE_NONE, NULL, 0,
1224         "Imsi digits", HFILL }},
1225         {&hf_gsm_map_map_RoamingNumber_digits,
1226       { "RoamingNumber digits", "gsm_map.RoamingNumber_digits",
1227         FT_STRING, BASE_NONE, NULL, 0,
1228         "RoamingNumber digits", HFILL }},
1229         {&hf_gsm_map_map_hlr_number_digits,
1230       { "Hlr-Number digits", "gsm_map.hlr_number_digits",
1231         FT_STRING, BASE_NONE, NULL, 0,
1232         "Hlr-Number digits", HFILL }},
1233         {&hf_gsm_map_map_ForwardedToNumber_digits,
1234       { "Forwarded To Number digits", "gsm_map.forwardedtonumber_digits",
1235         FT_STRING, BASE_NONE, NULL, 0,
1236         "Forwarded To Number digits", HFILL }},
1237         { &hf_gsm_map_Ss_Status_unused,
1238       { "Unused", "gsm_map.unused",
1239         FT_UINT8, BASE_HEX, NULL, 0xf0,
1240         "Unused", HFILL }},
1241         { &hf_gsm_map_Ss_Status_q_bit,
1242       { "Q bit", "gsm_map.ss_status_q_bit",
1243         FT_BOOLEAN, 8, TFS(&gsm_map_Ss_Status_q_bit_values), 0x08,
1244         "Q bit", HFILL }},
1245         { &hf_gsm_map_Ss_Status_p_bit,
1246       { "P bit", "gsm_map.ss_status_p_bit",
1247         FT_BOOLEAN, 8, TFS(&gsm_map_Ss_Status_p_values), 0x04,
1248         "P bit", HFILL }},
1249         { &hf_gsm_map_Ss_Status_r_bit,
1250       { "R bit", "ss_status_r_bit",
1251         FT_BOOLEAN, 8, TFS(&gsm_map_Ss_Status_r_values), 0x02,
1252         "R bit", HFILL }},
1253         { &hf_gsm_map_Ss_Status_a_bit,
1254       { "A bit", "ss_status_a_bit",
1255         FT_BOOLEAN, 8, TFS(&gsm_map_Ss_Status_a_values), 0x01,
1256         "A bit", HFILL }},
1257
1258 #include "packet-gsm_map-hfarr.c"
1259   };
1260
1261   /* List of subtrees */
1262   static gint *ett[] = {
1263     &ett_gsm_map,
1264     &ett_gsm_map_InvokeId,
1265     &ett_gsm_map_InvokePDU,
1266     &ett_gsm_map_ReturnResultPDU,
1267         &ett_gsm_map_ReturnErrorPDU,
1268     &ett_gsm_map_ReturnResult_result,
1269         &ett_gsm_map_ReturnError_result,
1270     &ett_gsm_map_GSMMAPPDU,
1271 #include "packet-gsm_map-ettarr.c"
1272   };
1273
1274   /* Register protocol */
1275   proto_gsm_map = proto_register_protocol(PNAME, PSNAME, PFNAME);
1276 /*XXX  register_dissector("gsm_map", dissect_gsm_map, proto_gsm_map);*/
1277   /* Register fields and subtrees */
1278   proto_register_field_array(proto_gsm_map, hf, array_length(hf));
1279   proto_register_subtree_array(ett, array_length(ett));
1280
1281         sms_dissector_table = register_dissector_table("gsm_map.sms_tpdu", 
1282                 "GSM SMS TPDU",FT_UINT8, BASE_DEC);
1283
1284         gsm_map_tap = register_tap("gsm_map");
1285         register_ber_oid_name("0.4.0.0.1.0.1.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkLocUp(1) version3(3)" );
1286         register_ber_oid_name("0.4.0.0.1.0.1.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkLocUp(1) version2(2)" );
1287         register_ber_oid_name("0.4.0.0.1.0.2.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locationCancel(2) version3(3)" );
1288         register_ber_oid_name("0.4.0.0.1.0.2.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locationCancel(2) version2(2)" );
1289         register_ber_oid_name("0.4.0.0.1.0.2.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locationCancel(2) version1(1)" );
1290         register_ber_oid_name("0.4.0.0.1.0.3.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) roamingNbEnquiry(3) version3(3)" );
1291         register_ber_oid_name("0.4.0.0.1.0.3.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) roamingNbEnquiry(3) version2(2)" );
1292         register_ber_oid_name("0.4.0.0.1.0.3.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) roamingNbEnquiry(3) version1(1)" );
1293         register_ber_oid_name("0.4.0.0.1.0.5.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locInfoRetrieval(5) version3(3)" );
1294         register_ber_oid_name("0.4.0.0.1.0.5.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locInfoRetrieval(5) version2(2)" );
1295         register_ber_oid_name("0.4.0.0.1.0.5.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) locInfoRetrieval(5) version1(1)" );
1296         register_ber_oid_name("0.4.0.0.1.0.10.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) reset(10) version2(2)" );
1297         register_ber_oid_name("0.4.0.0.1.0.10.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) reset(10) version1(1)" );
1298         register_ber_oid_name("0.4.0.0.1.0.11.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) handoverControl(11) version3(3)" );
1299         register_ber_oid_name("0.4.0.0.1.0.11.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) handoverControl(11) version2(2)" );
1300         register_ber_oid_name("0.4.0.0.1.0.11.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) handoverControl(11) version1(1)" );
1301         register_ber_oid_name("0.4.0.0.1.0.26.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) imsiRetrieval(26) version2(2)" );
1302         register_ber_oid_name("0.4.0.0.1.0.13.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) equipmentMngt(13) version2(2)" );
1303         register_ber_oid_name("0.4.0.0.1.0.13.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) equipmentMngt(13) version1(1)" );
1304         register_ber_oid_name("0.4.0.0.1.0.14.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) infoRetrieval(14) version3(3)" );
1305         register_ber_oid_name("0.4.0.0.1.0.14.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) infoRetrieval(14) version2(2)" );
1306         register_ber_oid_name("0.4.0.0.1.0.14.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) infoRetrieval(14) version1(1)" );
1307         register_ber_oid_name("0.4.0.0.1.0.15.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) interVlrInfoRetrieval(15) version2(2)" );
1308         register_ber_oid_name("0.4.0.0.1.0.16.3","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) subscriberDataMngt(16) version3(3)" );
1309         register_ber_oid_name("0.4.0.0.1.0.16.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) subscriberDataMngt(16) version2(2)" );
1310         register_ber_oid_name("0.4.0.0.1.0.16.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) subscriberDataMngt(16) version1(1)" );
1311         register_ber_oid_name("0.4.0.0.1.0.17.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) tracing(17) version2(2)" );
1312         register_ber_oid_name("0.4.0.0.1.0.17.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) tracing(17) version1(1)" );
1313         register_ber_oid_name("0.4.0.0.1.0.18.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkFunctionalSs(18) version2(2)" );
1314         register_ber_oid_name("0.4.0.0.1.0.18.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkFunctionalSs(18) version1(1)" );
1315         register_ber_oid_name("0.4.0.0.1.0.19.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) networkUnstructuredSs(19) version2(2)" );
1316         register_ber_oid_name("0.4.0.0.1.0.20.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgGateway(20) version2(2)" );
1317         register_ber_oid_name("0.4.0.0.1.0.20.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgGateway(20) version1(1)" );
1318         register_ber_oid_name("0.4.0.0.1.0.21.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgMO-Relay(21) version2(2)" );
1319         register_ber_oid_name("0.4.0.0.1.0.21.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) --shortMsgRelay--21 version1(1)" );
1320         register_ber_oid_name("0.4.0.0.1.0.23.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgAlert(23) version2(2)" );
1321         register_ber_oid_name("0.4.0.0.1.0.23.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgAlert(23) version1(1)" );
1322         register_ber_oid_name("0.4.0.0.1.0.24.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) mwdMngt(24) version2(2)" );
1323         register_ber_oid_name("0.4.0.0.1.0.24.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) mwdMngt(24) version1(1)" );
1324         register_ber_oid_name("0.4.0.0.1.0.25.2","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) shortMsgMT-Relay(25) version2(2)" );
1325         register_ber_oid_name("0.4.0.0.1.0.25.1","itu-t(0) identified-organization(4) etsi(0) mobileDomain(0) gsm-Network(1) map-ac(0) msPurging(27) version2(2)" );
1326
1327         /* Register our configuration options, particularly our ssn:s */
1328
1329         gsm_map_module = prefs_register_protocol(proto_gsm_map, proto_reg_handoff_gsm_map);
1330         prefs_register_uint_preference(gsm_map_module, "tcap.itu_ssn1",
1331                 "Subsystem number used for GSM MAP 1",
1332                 "Set Subsystem number used for GSM MAP",
1333                 10, &global_tcap_itu_ssn1);
1334         prefs_register_uint_preference(gsm_map_module, "tcap.itu_ssn2",
1335                 "Subsystem number used for GSM MAP 2",
1336                 "Set Subsystem number used for GSM MAP",
1337                 10, &global_tcap_itu_ssn2);
1338         prefs_register_uint_preference(gsm_map_module, "tcap.itu_ssn3",
1339                 "Subsystem number used for GSM MAP 3",
1340                 "Set Subsystem number used for GSM MAP",
1341                 10, &global_tcap_itu_ssn3);
1342         prefs_register_uint_preference(gsm_map_module, "tcap.itu_ssn4",
1343                 "Subsystem number used for GSM MAP 4",
1344                 "Set Subsystem number used for GSM MAP",
1345                 10, &global_tcap_itu_ssn4);
1346
1347
1348 }
1349
1350