Fix of asn1 code for one opcode to new spec used?
[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  *
5  * $Id$
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  * References: ETSI TS 129 002
25  */
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <glib.h>
32 #include <epan/packet.h>
33 #include <epan/conversation.h>
34 #include <epan/tap.h>
35
36 #include <stdio.h>
37 #include <string.h>
38
39 #include "packet-ber.h"
40 #include "packet-gsm_map.h"
41
42 #define PNAME  "GSM_MobileAPplication"
43 #define PSNAME "GSM_MAP"
44 #define PFNAME "gsm_map"
45
46 /* Initialize the protocol and registered fields */
47 int proto_gsm_map = -1;
48 static int hf_gsm_map_invokeCmd = -1;             /* Opcode */
49 static int hf_gsm_map_invokeid = -1;              /* INTEGER */
50 static int hf_gsm_map_absent = -1;                /* NULL */
51 static int hf_gsm_map_invokeId = -1;              /* InvokeId */
52 static int hf_gsm_map_invoke = -1;                /* InvokePDU */
53 static int hf_gsm_map_returnResult = -1;                /* InvokePDU */
54 static int hf_gsm_map_returnResult_result = -1;
55 static int hf_gsm_map_getPassword = -1;  
56 static int hf_gsm_map_currentPassword = -1;  
57 #include "packet-gsm_map-hf.c"
58
59 /* Initialize the subtree pointers */
60 static gint ett_gsm_map = -1;
61 static gint ett_gsm_map_InvokeId = -1;
62 static gint ett_gsm_map_InvokePDU = -1;
63 static gint ett_gsm_map_ReturnResultPDU = -1;
64 static gint ett_gsm_map_ReturnResult_result = -1;
65 static gint ett_gsm_map_GSMMAPPDU = -1;
66 static int gsm_map_tap = -1;
67 #include "packet-gsm_map-ett.c"
68
69 static dissector_table_t        sms_dissector_table;    /* SMS TPDU */
70
71 static int  dissect_invokeCmd(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset);
72
73 typedef struct dgt_set_t
74 {
75     unsigned char out[15];
76 }
77 dgt_set_t;
78
79 static dgt_set_t Dgt_msid = {
80     {
81   /*  0   1   2   3   4   5   6   7   8   9   a   b   c   d   e */
82      '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?'
83     }
84 };
85
86 /*
87  * Unpack BCD input pattern into output ASCII pattern
88  *
89  * Input Pattern is supplied using the same format as the digits
90  *
91  * Returns: length of unpacked pattern
92  */
93 static int
94 my_dgt_tbcd_unpack(
95     char        *out,           /* ASCII pattern out */
96     guchar      *in,            /* packed pattern in */
97     int         num_octs,       /* Number of octets to unpack */
98     dgt_set_t   *dgt            /* Digit definitions */
99     )
100 {
101     int cnt = 0;
102     unsigned char i;
103
104     while (num_octs)
105     {
106         /*
107          * unpack first value in byte
108          */
109         i = *in++;
110         *out++ = dgt->out[i & 0x0f];
111         cnt++;
112
113         /*
114          * unpack second value in byte
115          */
116         i >>= 4;
117
118         if (i == 0x0f)  /* odd number bytes - hit filler */
119             break;
120
121         *out++ = dgt->out[i];
122         cnt++;
123         num_octs--;
124     }
125
126     *out = '\0';
127
128     return(cnt);
129 }
130
131
132 #include "packet-gsm_map-fn.c"
133
134 /* Stuff included from the "old" packet-gsm_map.c for tapping purposes */
135 static gchar *
136 my_match_strval(guint32 val, const value_string *vs, gint *idx)
137 {
138     gint        i = 0;
139
140     while (vs[i].strptr) {
141         if (vs[i].value == val)
142         {
143             *idx = i;
144             return(vs[i].strptr);
145         }
146
147         i++;
148     }
149
150     *idx = -1;
151     return(NULL);
152 }
153 /* End includes from old" packet-gsm_map.c */
154
155 const value_string gsm_map_opr_code_strings[] = {
156   {   2, "updateLocation" },
157   {   3, "cancelLocation" },
158   {   4, "provideRoamingNumber" },
159   {   6, "resumeCallHandling" },
160   {   7, "insertSubscriberData" },
161   {   8, "deleteSubscriberData" },
162   {   9, "sendParameters" },                                    /* map-ac infoRetrieval (14) version1 (1)*/
163   {  10, "registerSS" },
164   {  11, "eraseSS" },
165   {  12, "activateSS" },
166   {  13, "deactivateSS" },
167   {  14, "interrogateSS" },
168   {  17, "registerPassword" },
169   {  18, "getPassword" },
170   {  19, "processUnstructuredSS-Data" },                /* map-ac networkFunctionalSs (18) version1 (1) */
171   {  22, "sendRoutingInfo" },
172   {  23, "updateGprsLocation" },
173   {  24, "sendRoutingInfoForGprs" },
174   {  25, "failureReport" },
175   {  26, "noteMsPresentForGprs" },
176   {  28, "performHandover" },                                   /* map-ac handoverControl (11) version1 (1)*/
177   {  29, "sendEndSignal" },
178   {  30, "performSubsequentHandover" },                 /* map-ac handoverControl (11) version1 (1) */
179   {  31, "provideSIWFSNumber" },
180   {  32, "sIWFSSignallingModify" },
181   {  33, "processAccessSignalling" },
182   {  34, "forwardAccessSignalling" },
183   {  35, "noteInternalHandover" },                              /* map-ac handoverControl (11) version1 (1) */
184   {  37, "reset" },
185   {  38, "forwardCheckSS-Indication" },
186   {  39, "prepareGroupCall" },
187   {  40, "sendGroupCallEndSignal" },
188   {  41, "processGroupCallSignalling" },
189   {  42, "forwardGroupCallSignalling" },
190   {  43, "checkIMEI" },
191   {  44, "mt-forwardSM" },
192   {  45, "sendRoutingInfoForSM" },
193   {  46, "mo-forwardSM" },
194   {  47, "reportSM-DeliveryStatus" },
195   {  48, "noteSubscriberPresent" },                             /* map-ac mwdMngt (24) version1 (1) */
196   {  49, "alertServiceCentreWithoutResult" },   /* map-ac shortMsgAlert (23) version1 (1) */
197   {  50, "activateTraceMode" },
198   {  51, "deactivateTraceMode" },
199   {  52, "traceSubscriberActivity" },                   /* map-ac handoverControl (11) version1 (1) */
200   {  54, "beginSubscriberActivity" },                   /* map-ac networkFunctionalSs (18) version1 (1) */
201   {  55, "sendIdentification" },
202   {  56, "sendAuthenticationInfo" },
203   {  57, "restoreData" },
204   {  58, "sendIMSI" },
205   {  59, "processUnstructuredSS-Request" },
206   {  60, "unstructuredSS-Request" },
207   {  61, "unstructuredSS-Notify" },
208   {  63, "informServiceCentre" },
209   {  64, "alertServiceCentre" },
210   {  66, "readyForSM" },
211   {  67, "purgeMS" },
212   {  68, "prepareHandover" },
213   {  69, "prepareSubsequentHandover" },
214   {  70, "provideSubscriberInfo" },
215   {  71, "anyTimeInterrogation" },
216   {  72, "ss-InvocationNotification" },
217   {  73, "setReportingState" },
218   {  74, "statusReport" },
219   {  75, "remoteUserFree" },
220   {  76, "registerCC-Entry" },
221   {  77, "eraseCC-Entry" },
222   {  83, "provideSubscriberLocation" },
223   {  85, "sendRoutingInfoForLCS" },
224   {  86, "subscriberLocationReport" },
225   { 0, NULL }
226 };
227
228 static guint32 opcode=0;
229
230 static int
231 dissect_gsm_map_Opcode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
232   offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_index, &opcode);
233
234   if (check_col(pinfo->cinfo, COL_INFO)){
235     col_set_str(pinfo->cinfo, COL_INFO, val_to_str(opcode, gsm_map_opr_code_strings, "Unknown GSM-MAP (%u)"));
236   }
237
238   return offset;
239 }
240
241 static int dissect_invokeData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
242   switch(opcode){
243   case  2: /*updateLocation*/
244     offset=dissect_gsm_map_UpdateLocationArg(FALSE, tvb, offset, pinfo, tree, -1);
245     break;
246   case  3: /*cancelLocation*/
247     offset=dissect_gsm_map_CancelLocationArg(FALSE, tvb, offset, pinfo, tree, -1);
248     break;
249   case  4: /*provideRoamingNumber*/
250     offset=dissect_gsm_map_ProvideRoamingNumberArg(FALSE, tvb, offset, pinfo, tree, -1);
251     break;
252   case  6: /*resumeCallHandling*/
253     offset=dissect_gsm_map_ResumeCallHandlingArg(FALSE, tvb, offset, pinfo, tree, -1);
254     break;
255   case  7: /*insertSubscriberData*/
256     offset=dissect_gsm_map_InsertSubscriberDataArg(FALSE, tvb, offset, pinfo, tree, -1);
257     break;
258   case  8: /*deleteSubscriberData*/
259     offset=dissect_gsm_map_DeleteSubscriberDataArg(FALSE, tvb, offset, pinfo, tree, -1);
260     break;
261         /* TODO find out why this isn't in the ASN1 file
262   case  9: sendParameters
263     offset=dissect_gsm_map_DeleteSubscriberDataArg(FALSE, tvb, offset, pinfo, tree, -1);
264     break;
265         */
266   case  10: /*registerSS*/
267     offset=dissect_gsm_map_RegisterSS_Arg(FALSE, tvb, offset, pinfo, tree, -1);
268     break;
269   case  11: /*eraseSS*/
270     offset=dissect_gsm_map_Ss_ForBS(FALSE, tvb, offset, pinfo, tree, -1);
271     break;
272   case 12: /*activateSS*/
273     offset=dissect_gsm_map_Ss_ForBS(FALSE, tvb, offset, pinfo, tree, -1);
274     break;
275   case 13: /*deactivateSS*/
276     offset=dissect_gsm_map_Ss_ForBS(FALSE, tvb, offset, pinfo, tree, -1);
277     break;
278   case 14: /*interrogateSS*/
279     offset=dissect_gsm_map_Ss_ForBS(FALSE, tvb, offset, pinfo, tree, -1);
280     break;
281   case 17: /*registerPassword*/
282     offset=dissect_gsm_map_Ss_Code(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_ss_Code);
283     break;
284   case 18: /*getPassword*/
285     offset=dissect_gsm_map_GetPasswordArg(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_getPassword);
286     break;
287   case 22: /*sendRoutingInfo*/
288     offset=dissect_gsm_map_SendRoutingInfoForGprsArg(FALSE, tvb, offset, pinfo, tree, -1);
289     break;
290   case 23: /*updateGprsLocation*/
291     offset=dissect_gsm_map_UpdateGprsLocationArg(FALSE, tvb, offset, pinfo, tree, -1);
292     break;
293   case 24: /*sendRoutingInfoForGprs*/
294     offset=dissect_gsm_map_SendRoutingInfoForGprsArg(FALSE, tvb, offset, pinfo, tree, -1);
295     break;
296   case 25: /*failureReport*/
297     offset=dissect_gsm_map_FailureReportArg(FALSE, tvb, offset, pinfo, tree, -1);
298     break;
299   case 26: /*noteMsPresentForGprs*/
300     offset=dissect_gsm_map_NoteMsPresentForGprsArg(FALSE, tvb, offset, pinfo, tree, -1);
301     break;
302   case 29: /*sendEndSignal*/
303     offset=dissect_gsm_map_Bss_APDU(FALSE, tvb, offset, pinfo, tree, -1);
304     break;
305   case 31: /*provideSIWFSNumbe*/
306     offset=dissect_gsm_map_ProvideSIWFSNumberArg(FALSE, tvb, offset, pinfo, tree, -1);
307     break;
308   case 32: /*sIWFSSignallingModify*/
309     offset=dissect_gsm_map_SIWFSSignallingModifyArg(FALSE, tvb, offset, pinfo, tree, -1);
310     break;
311   case 33: /*processAccessSignalling*/
312     offset=dissect_gsm_map_Bss_APDU(FALSE, tvb, offset, pinfo, tree, -1);
313     break;
314   case 34: /*forwardAccessSignalling*/
315     offset=dissect_gsm_map_Bss_APDU(FALSE, tvb, offset, pinfo, tree, -1);
316     break;
317   case 37: /*reset*/
318     offset=dissect_gsm_map_ResetArg(FALSE, tvb, offset, pinfo, tree, -1);
319     break;
320   case 38: /*forwardCheckSS-Indication*/
321     return offset;
322     break;
323   case 39: /*prepareGroupCall*/
324     offset=dissect_gsm_map_PrepareGroupCallArg(FALSE, tvb, offset, pinfo, tree, -1);
325     break;
326   case 40: /*sendGroupCallEndSignal*/
327     dissect_gsm_map_SendGroupCallEndSignalArg(FALSE, tvb, offset, pinfo, tree, -1);
328     break;
329   case 42: /*processGroupCallSignalling*/
330     offset=dissect_gsm_map_ProcessGroupCallSignallingArg(FALSE, tvb, offset, pinfo, tree, -1);
331     break;
332   case 43: /*checkIMEI*/
333     offset=dissect_gsm_map_CheckIMEIArg(FALSE, tvb, offset, pinfo, tree, -1);
334     break;
335   case 44: /*mt-forwardSM*/
336     offset=dissect_gsm_map_CheckIMEIArg(FALSE, tvb, offset, pinfo, tree, -1);
337     break;
338   case 45: /*sendRoutingInfoForSM*/
339     offset=dissect_gsm_map_RoutingInfoForSMRes(FALSE, tvb, offset, pinfo, tree, -1);
340     break;
341   case 46: /*mo-forwardSM*/
342     offset=dissect_gsm_map_Mo_forwardSM_Arg(FALSE, tvb, offset, pinfo, tree, -1);
343     break;
344   case 47: /*reportSM-DeliveryStatus*/
345     offset=dissect_gsm_map_ReportSM_DeliveryStatusArg(FALSE, tvb, offset, pinfo, tree, -1);
346     break;
347   case 50: /*activateTraceMode*/
348     offset=dissect_gsm_map_ActivateTraceModeArg(FALSE, tvb, offset, pinfo, tree, -1);
349     break;
350   case 51: /*deactivateTraceMode*/
351     offset=dissect_gsm_map_DeactivateTraceModeArg(FALSE, tvb, offset, pinfo, tree, -1);
352     break;
353   case 55: /*sendIdentification*/
354     offset=dissect_gsm_map_Tmsi(FALSE, tvb, offset, pinfo, tree, -1);
355     break;
356   case 56: /*sendAuthenticationInfo*/
357         offset=dissect_gsm_map_SendAuthenticationInfoArg(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_imsi);
358         break;
359   case 57: /*restoreData*/
360         offset=dissect_gsm_map_RestoreDataArg(FALSE, tvb, offset, pinfo, tree, -1);
361         break;
362   case 58: /*sendIMSI*/
363         offset=dissect_gsm_map_Msisdn(FALSE, tvb, offset, pinfo, tree, -1);
364         break;
365   case 59: /*processUnstructuredSS-Request*/
366     offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1);
367     break;
368   case 60: /*unstructuredSS-Request*/
369     offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1);
370     break;
371   case 61: /*unstructuredSS-Notify*/
372     offset=dissect_gsm_map_Ussd_Arg(FALSE, tvb, offset, pinfo, tree, -1);
373     break;
374   case 63: /*informServiceCentre*/
375     offset=dissect_gsm_map_InformServiceCentreArg(FALSE, tvb, offset, pinfo, tree, -1);
376     break;
377   case 64: /*alertServiceCentre*/
378     offset=dissect_gsm_map_AlertServiceCentreArg(FALSE, tvb, offset, pinfo, tree, -1);
379     break;
380   case 66: /*readyForSM*/
381     offset=dissect_gsm_map_ReadyForSM_Arg(FALSE, tvb, offset, pinfo, tree, -1);
382     break;
383   case 67: /*purgeMS*/
384     offset=dissect_gsm_map_PurgeMS_Arg(FALSE, tvb, offset, pinfo, tree, -1);
385     break;
386   case 68: /*prepareHandover*/
387     offset=dissect_gsm_map_PrepareHO_Arg(FALSE, tvb, offset, pinfo, tree, -1);
388     break;
389   case 69: /*prepareSubsequentHandover*/
390     offset=dissect_gsm_map_PrepareSubsequentHO_Arg(FALSE, tvb, offset, pinfo, tree, -1);
391     break;
392   case 70: /*provideSubscriberInfo*/
393     offset=dissect_gsm_map_ProvideSubscriberInfoArg(FALSE, tvb, offset, pinfo, tree, -1);
394     break;
395   case 71: /*anyTimeInterrogation*/
396     offset=dissect_gsm_map_AnyTimeInterrogationArg(FALSE, tvb, offset, pinfo, tree, -1);
397     break;
398   case 72: /*ss-InvocationNotificatio*/
399     offset=dissect_gsm_map_Ss_InvocationNotificationArg(FALSE, tvb, offset, pinfo, tree, -1);
400     break;
401   case 73: /*setReportingState*/
402     offset=dissect_gsm_map_SetReportingStateArg(FALSE, tvb, offset, pinfo, tree, -1);
403     break;
404   case 74: /*statusReport*/
405     offset=dissect_gsm_map_StatusReportArg(FALSE, tvb, offset, pinfo, tree, -1);
406     break;
407   case 75: /*remoteUserFree*/
408     offset=dissect_gsm_map_RemoteUserFreeArg(FALSE, tvb, offset, pinfo, tree, -1);
409     break;
410   case 76: /*registerCC-Entry*/
411     offset=dissect_gsm_map_RegisterCC_EntryArg(FALSE, tvb, offset, pinfo, tree, -1);
412     break;
413   case 77: /*eraseCC-Entry*/
414     offset=dissect_gsm_map_EraseCC_EntryArg(FALSE, tvb, offset, pinfo, tree, -1);
415     break;
416   case 83: /*provideSubscriberLocation*/
417     offset=dissect_gsm_map_ProvideSubscriberLocation_Arg(FALSE, tvb, offset, pinfo, tree, -1);
418     break;
419   case 85: /*sendRoutingInfoForLCS*/
420     offset=dissect_gsm_map_RoutingInfoForLCS_Arg(FALSE, tvb, offset, pinfo, tree, -1);
421     break;
422   case 86: /*subscriberLocationReport*/
423     offset=dissect_gsm_map_SubscriberLocationReport_Arg(FALSE, tvb, offset, pinfo, tree, -1);
424     break;
425   default:
426     proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob");
427   }
428   return offset;
429 }
430
431
432 static int dissect_returnResultData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
433   switch(opcode){
434   case  2: /*updateLocation*/
435     offset=dissect_gsm_map_UpdateLocationRes(FALSE, tvb, offset, pinfo, tree, -1);
436     break;
437   case  3: /*cancelLocation*/
438     offset=dissect_gsm_map_CancelLocationRes(FALSE, tvb, offset, pinfo, tree, -1);
439     break;
440   case  4: /*provideRoamingNumber*/
441     offset=dissect_gsm_map_ProvideRoamingNumberRes(FALSE, tvb, offset, pinfo, tree, -1);
442     break;
443   case  6: /*resumeCallHandling*/
444     offset=dissect_gsm_map_ResumeCallHandlingRes(FALSE, tvb, offset, pinfo, tree, -1);
445     break;
446   case  7: /*insertSubscriberData*/
447     offset=dissect_gsm_map_InsertSubscriberDataRes(FALSE, tvb, offset, pinfo, tree, -1);
448     break;
449   case  8: /*deleteSubscriberData*/
450     offset=dissect_gsm_map_DeleteSubscriberDataRes(FALSE, tvb, offset, pinfo, tree, -1);
451     break;
452         /* TODO find out why this isn't in the ASN1 file
453   case  9: sendParameters
454     offset=dissect_gsm_map_DeleteSubscriberDataArg(FALSE, tvb, offset, pinfo, tree, -1);
455     break;
456         */
457   case  10: /*registerSS*/
458     offset=dissect_gsm_map_Ss_Info(FALSE, tvb, offset, pinfo, tree, -1);
459     break;
460   case  11: /*eraseSS*/
461     offset=dissect_gsm_map_Ss_Info(FALSE, tvb, offset, pinfo, tree, -1);
462     break;
463   case 12: /*activateSS*/
464     offset=dissect_gsm_map_Ss_Info(FALSE, tvb, offset, pinfo, tree, -1);
465     break;
466   case 13: /*deactivateSS*/
467     offset=dissect_gsm_map_Ss_Info(FALSE, tvb, offset, pinfo, tree, -1);
468     break;
469   case 14: /*interrogateSS*/
470     offset=dissect_gsm_map_Ss_Info(FALSE, tvb, offset, pinfo, tree, -1);
471     break;
472   case 17: /*registerPassword*/
473     offset=dissect_gsm_map_NewPassword(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_ss_Code);
474     break;
475   case 18: /*getPassword*/
476     offset=dissect_gsm_map_CurrentPassword(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_currentPassword);
477     break;
478   case 22: /*sendRoutingInfo*/
479     offset=dissect_gsm_map_SendRoutingInfoForGprsRes(FALSE, tvb, offset, pinfo, tree, -1);
480     break;
481   case 23: /*updateGprsLocation*/
482     offset=dissect_gsm_map_UpdateGprsLocationRes(FALSE, tvb, offset, pinfo, tree, -1);
483     break;
484   case 24: /*sendRoutingInfoForGprs*/
485     offset=dissect_gsm_map_SendRoutingInfoForGprsRes(FALSE, tvb, offset, pinfo, tree, -1);
486     break;
487   case 25: /*failureReport*/
488     offset=dissect_gsm_map_FailureReportRes(FALSE, tvb, offset, pinfo, tree, -1);
489     break;
490   case 26: /*noteMsPresentForGprs*/
491     offset=dissect_gsm_map_NoteMsPresentForGprsRes(FALSE, tvb, offset, pinfo, tree, -1);
492     break;
493   case 29: /*sendEndSignal*/
494           /* Taken from MAP-MobileServiceOperations{ 0 identified-organization (4) etsi (0) mobileDomain 
495            * (0) gsm-Network (1) modules (3) map-MobileServiceOperations (5) version9 (9) }
496            */
497     offset=dissect_gsm_map_ExtensionContainer(FALSE, tvb, offset, pinfo, tree, -1);
498     break;
499   case 31: /*provideSIWFSNumbe*/
500     offset=dissect_gsm_map_ProvideSIWFSNumberRes(FALSE, tvb, offset, pinfo, tree, -1);
501     break;
502   case 32: /*provideSIWFSNumbe*/
503     offset=dissect_gsm_map_SIWFSSignallingModifyRes(FALSE, tvb, offset, pinfo, tree, -1);
504     break;
505   case 39: /*prepareGroupCall*/
506     offset=dissect_gsm_map_PrepareGroupCallRes(FALSE, tvb, offset, pinfo, tree, -1);
507     break;
508   case 40: /*sendGroupCallEndSignal*/
509     dissect_gsm_map_SendGroupCallEndSignalRes(FALSE, tvb, offset, pinfo, tree, -1);
510     break;
511   case 43: /*checkIMEI*/
512     offset=dissect_gsm_map_EquipmentStatus(FALSE, tvb, offset, pinfo, tree, -1);
513     break;
514   case 45: /*sendRoutingInfoForSM*/
515     offset=dissect_gsm_map_RoutingInfoForSMRes(FALSE, tvb, offset, pinfo, tree, -1);
516     break;
517   case 46: /*mo-forwardSM*/
518     offset=dissect_gsm_map_Mo_forwardSM_Res(FALSE, tvb, offset, pinfo, tree, -1);
519     break;
520   case 48: /*reportSM-DeliveryStatus*/
521     offset=dissect_gsm_map_ReportSM_DeliveryStatusArg(FALSE, tvb, offset, pinfo, tree, -1);
522     break;
523   case 50: /*activateTraceMode*/
524     offset=dissect_gsm_map_ActivateTraceModeRes(FALSE, tvb, offset, pinfo, tree, -1);
525     break;
526   case 51: /*deactivateTraceMode*/
527     offset=dissect_gsm_map_DeactivateTraceModeRes(FALSE, tvb, offset, pinfo, tree, -1);
528     break;
529   case 55: /*sendIdentification*/
530     offset=dissect_gsm_map_SendIdentificationRes(FALSE, tvb, offset, pinfo, tree, -1);
531     break;
532   case 57: /*restoreData*/
533         offset=dissect_gsm_map_RestoreDataRes(FALSE, tvb, offset, pinfo, tree, -1);
534         break;
535   case 58: /*sendIMSI*/
536         offset=dissect_gsm_map_Imsi(FALSE, tvb, offset, pinfo, tree,hf_gsm_map_imsi);
537         break;
538   case 59: /*unstructuredSS-Request*/
539     offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1);
540     break;
541   case 60: /*unstructuredSS-Request*/
542     offset=dissect_gsm_map_Ussd_Res(FALSE, tvb, offset, pinfo, tree, -1);
543     break;
544   case 61: /*unstructuredSS-Notify*/
545     /* TRUE ? */
546     proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob");
547     break;
548   case 66: /*readyForSM*/
549     offset=dissect_gsm_map_ReadyForSM_Res(FALSE, tvb, offset, pinfo, tree, -1);
550     break;
551   case 67: /*purgeMS*/
552     offset=dissect_gsm_map_PurgeMS_Res(FALSE, tvb, offset, pinfo, tree, -1);
553     break;
554   case 68: /*prepareHandover*/
555     offset=dissect_gsm_map_PrepareHO_Res(FALSE, tvb, offset, pinfo, tree, -1);
556     break;
557   case 69: /*prepareSubsequentHandover*/
558      offset=dissect_gsm_map_Bss_APDU(FALSE, tvb, offset, pinfo, tree, -1);
559     break;
560   case 70: /*provideSubscriberInfo*/
561     offset=dissect_gsm_map_ProvideSubscriberInfoRes(FALSE, tvb, offset, pinfo, tree, -1);
562     break;
563   case 71: /*anyTimeInterrogation*/
564     offset=dissect_gsm_map_AnyTimeInterrogationRes(FALSE, tvb, offset, pinfo, tree, -1);
565     break;
566   case 72: /*ss-InvocationNotificatio*/
567     offset=dissect_gsm_map_Ss_InvocationNotificationRes(FALSE, tvb, offset, pinfo, tree, -1);
568     break;
569   case 73: /*setReportingState*/
570     offset=dissect_gsm_map_SetReportingStateRes(FALSE, tvb, offset, pinfo, tree, -1);
571     break;
572   case 74: /*statusReport*/
573     offset=dissect_gsm_map_StatusReportRes(FALSE, tvb, offset, pinfo, tree, -1);
574     break;
575   case 75: /*remoteUserFree*/
576     offset=dissect_gsm_map_RemoteUserFreeRes(FALSE, tvb, offset, pinfo, tree, -1);
577     break;
578   case 76: /*registerCC-Entry*/
579     offset=dissect_gsm_map_RegisterCC_EntryRes(FALSE, tvb, offset, pinfo, tree, -1);
580     break;
581   case 77: /*eraseCC-Entry*/
582     offset=dissect_gsm_map_EraseCC_EntryRes(FALSE, tvb, offset, pinfo, tree, -1);
583     break;
584   case 83: /*provideSubscriberLocation*/
585     offset=dissect_gsm_map_ProvideSubscriberLocation_Res(FALSE, tvb, offset, pinfo, tree, -1);
586     break;
587   case 85: /*sendRoutingInfoForLCS*/
588     offset=dissect_gsm_map_RoutingInfoForLCS_Arg(FALSE, tvb, offset, pinfo, tree, -1);
589     break;
590   case 86: /*subscriberLocationReport*/
591     offset=dissect_gsm_map_SubscriberLocationReport_Res(FALSE, tvb, offset, pinfo, tree, -1);
592     break;
593  default:
594     proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob");
595   }
596   return offset;
597 }
598
599 static int 
600 dissect_invokeCmd(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
601   return dissect_gsm_map_Opcode(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_invokeCmd);
602 }
603
604 static int dissect_invokeid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
605   return dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_gsm_map_invokeid, NULL);
606 }
607
608
609 static const value_string InvokeId_vals[] = {
610   {   0, "invokeid" },
611   {   1, "absent" },
612   { 0, NULL }
613 };
614
615 static int dissect_absent(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
616   return dissect_gsm_map_NULL(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_absent);
617 }
618
619
620 static const ber_choice_t InvokeId_choice[] = {
621   {   0, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeid },
622   {   1, BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_absent },
623   { 0, 0, 0, 0, NULL }
624 };
625
626 static int
627 dissect_gsm_map_InvokeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
628   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
629                               InvokeId_choice, hf_index, ett_gsm_map_InvokeId);
630
631   return offset;
632 }
633 static int dissect_invokeId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
634   return dissect_gsm_map_InvokeId(FALSE, tvb, offset, pinfo, tree, hf_gsm_map_invokeId);
635 }
636
637 static const ber_sequence_t InvokePDU_sequence[] = {
638   { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
639   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeCmd },
640   { BER_CLASS_UNI, -1/*depends on Cmd*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeData },
641   { 0, 0, 0, NULL }
642 };
643
644 static int
645 dissect_gsm_map_InvokePDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
646   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
647                                 InvokePDU_sequence, hf_index, ett_gsm_map_InvokePDU);
648
649   return offset;
650 }
651 static int dissect_invoke_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
652   return dissect_gsm_map_InvokePDU(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_invoke);
653 }
654
655 static const ber_sequence_t ReturnResult_result_sequence[] = {
656   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_invokeCmd },
657   { BER_CLASS_UNI, -1/*depends on Cmd*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_returnResultData },
658   { 0, 0, 0, NULL }
659 };
660 static int
661 dissect_returnResult_result(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
662   offset = dissect_ber_sequence(FALSE, pinfo, tree, tvb, offset,
663                                 ReturnResult_result_sequence, hf_gsm_map_returnResult_result, ett_gsm_map_ReturnResult_result);
664
665   return offset;
666 }
667
668 static const ber_sequence_t ReturnResultPDU_sequence[] = {
669   { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_invokeId },
670   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_returnResult_result },
671   { 0, 0, 0, NULL }
672 };
673
674 static int
675 dissect_gsm_map_returnResultPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
676   offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
677                                 ReturnResultPDU_sequence, hf_index, ett_gsm_map_ReturnResultPDU);
678
679   return offset;
680 }
681 static int dissect_returnResult_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
682   return dissect_gsm_map_returnResultPDU(TRUE, tvb, offset, pinfo, tree, hf_gsm_map_returnResult);
683 }
684
685 static const value_string GSMMAPPDU_vals[] = {
686   {   1, "invoke" },
687   {   2, "returnResult" },
688   {   3, "returnError" },
689   {   4, "reject" },
690   { 0, NULL }
691 };
692
693 static const ber_choice_t GSMMAPPDU_choice[] = {
694   {   1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_invoke_impl },
695   {   2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_returnResult_impl },
696 #ifdef REMOVED
697   {   3, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_returnError_impl },
698   {   4, BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_reject_impl },
699 #endif
700   { 0, 0, 0, 0, NULL }
701 };
702
703 static guint8 gsmmap_pdu_type = 0;
704 static guint8 gsm_map_pdu_size = 0;
705
706 static int
707 dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
708
709   gsmmap_pdu_type = tvb_get_guint8(tvb, offset)&0x0f;
710   /* Get the length and add 2 */
711   gsm_map_pdu_size = tvb_get_guint8(tvb, offset+1)+2;
712
713   offset = dissect_ber_choice(pinfo, tree, tvb, offset,
714                               GSMMAPPDU_choice, hf_index, ett_gsm_map_GSMMAPPDU);
715
716   if (check_col(pinfo->cinfo, COL_INFO)){
717     col_prepend_fstr(pinfo->cinfo, COL_INFO, val_to_str(opcode, gsm_map_opr_code_strings, "Unknown GSM-MAP (%u)"));
718   }
719
720   return offset;
721 }
722
723
724
725
726 static void
727 dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
728 {
729     proto_item          *item=NULL;
730     proto_tree          *tree=NULL;
731         /* Used for gsm_map TAP */
732         static                  gsm_map_tap_rec_t tap_rec;
733         gint                    op_idx;
734     gchar                       *str = NULL;
735
736
737     if (check_col(pinfo->cinfo, COL_PROTOCOL))
738     {
739         col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM MAP");
740     }
741
742     /* create display subtree for the protocol */
743     if(parent_tree){
744        item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, FALSE);
745        tree = proto_item_add_subtree(item, ett_gsm_map);
746     }
747
748     dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, pinfo, tree, -1);
749         str = my_match_strval(opcode, gsm_map_opr_code_strings, &op_idx);
750
751         tap_rec.invoke = FALSE;
752         if ( gsmmap_pdu_type  == 1 )
753                 tap_rec.invoke = TRUE;
754         tap_rec.opr_code_idx = op_idx;
755         tap_rec.size = gsm_map_pdu_size;
756         tap_queue_packet(gsm_map_tap, pinfo, &tap_rec);
757         
758
759
760 }
761
762 static const value_string ssCode_vals[] = {
763   { 0x00, "allSS - all SS" },
764   { 0x10 ,"allLineIdentificationSS - all line identification SS" },
765   { 0x11 ,"clip - calling line identification presentation" },
766   { 0x12 ,"clir - calling line identification restriction" },
767   { 0x13 ,"colp - connected line identification presentation" },
768   { 0x14 ,"colr - connected line identification restriction" },
769   { 0x15 ,"mci - malicious call identification" },
770   { 0x18 ,"allNameIdentificationSS - all name indentification SS" },
771   { 0x19 ,"cnap - calling name presentation" },
772   { 0x20 ,"allForwardingSS - all forwarding SS" },
773   { 0x21 ,"cfu - call forwarding unconditional" },
774   { 0x28 ,"allCondForwardingSS - all conditional forwarding SS" },
775   { 0x29 ,"cfb - call forwarding busy" },
776   { 0x2a ,"cfnry - call forwarding on no reply" },
777   { 0x2b ,"cfnrc - call forwarding on mobile subscriber not reachable" },
778   { 0x24 ,"cd - call deflection" },
779   { 0x30 ,"allCallOfferingSS - all call offering SS includes also all forwarding SS" },
780   { 0x31 ,"ect - explicit call transfer" },
781   { 0x32 ,"mah - mobile access hunting" },
782   { 0x40 ,"allCallCompletionSS - all Call completion SS" },
783   { 0x41 ,"cw - call waiting" },
784   { 0x42 ,"hold - call hold" },
785   { 0x43 ,"ccbs-A - completion of call to busy subscribers, originating side" },
786   { 0x44 ,"ccbs-B - completion of call to busy subscribers, destination side" },
787   { 0x45 ,"mc - multicall" },
788   { 0x50 ,"allMultiPartySS - all multiparty SS" },
789   { 0x51 ,"multiPTY - multiparty" },
790   { 0x60 ,"allCommunityOfInterestSS - all community of interest SS" },
791   { 0x61 ,"cug - closed user group" },
792   { 0x70 ,"allChargingSS - all charging SS" },
793   { 0x71 ,"aoci - advice of charge information" },
794   { 0x72 ,"aocc - advice of charge charging" },
795   { 0x80 ,"allAdditionalInfoTransferSS - all additional information transfer SS" },
796   { 0x81 ,"uus1 - UUS1 user-to-user signalling" },
797   { 0x82 ,"uus2 - UUS2 user-to-user signalling" },
798   { 0x83 ,"uus3 - UUS3 user-to-user signalling" },
799   { 0x90 ,"allCallRestrictionSS - all Callrestriction SS" },
800   { 0x91 ,"barringOfOutgoingCalls" },
801   { 0x92 ,"baoc - barring of all outgoing calls" },
802   { 0x93 ,"boic - barring of outgoing international calls" },
803   { 0x94 ,"boicExHC - barring of outgoing international calls except those directed to the home PLMN" },
804   { 0x99 ,"barringOfIncomingCalls" },
805   { 0x9a ,"baic - barring of all incoming calls" },
806   { 0x9b ,"bicRoam - barring of incoming calls when roaming outside home PLMN Country" },
807   { 0xf0 ,"allPLMN-specificSS" },
808   { 0xa0 ,"allCallPrioritySS - all call priority SS" },
809   { 0xa1 ,"emlpp - enhanced Multilevel Precedence Pre-emption (EMLPP) service" },
810   { 0xb0 ,"allLCSPrivacyException - all LCS Privacy Exception Classes" },
811   { 0xb1 ,"universal - allow location by any LCS client" },
812   { 0xb2 ,"callrelated - allow location by any value added LCS client to which a call is established from the target MS" },
813   { 0xb3 ,"callunrelated - allow location by designated external value added LCS clients" },
814   { 0xb4 ,"plmnoperator - allow location by designated PLMN operator LCS clients" },
815   { 0xc0 ,"allMOLR-SS - all Mobile Originating Location Request Classes" },
816   { 0xc1 ,"basicSelfLocation - allow an MS to request its own location" },
817   { 0xc2 ,"autonomousSelfLocation - allow an MS to perform self location without interaction with the PLMN for a predetermined period of time" },
818   { 0xc3 ,"transferToThirdParty - allow an MS to request transfer of its location to another LCS client" },
819
820   { 0xf1 ,"plmn-specificSS-1" },
821   { 0xf2 ,"plmn-specificSS-2" },
822   { 0xf3 ,"plmn-specificSS-3" },
823   { 0xf4 ,"plmn-specificSS-4" },
824   { 0xf5 ,"plmn-specificSS-5" },
825   { 0xf6 ,"plmn-specificSS-6" },
826   { 0xf7 ,"plmn-specificSS-7" },
827   { 0xf8 ,"plmn-specificSS-8" },
828   { 0xf9 ,"plmn-specificSS-9" },
829   { 0xfa ,"plmn-specificSS-a" },
830   { 0xfb ,"plmn-specificSS-b" },
831   { 0xfc ,"plmn-specificSS-c" },
832   { 0xfd ,"plmn-specificSS-d" },
833   { 0xfe ,"plmn-specificSS-e" },
834   { 0xff ,"plmn-specificSS-f" },
835   { 0, NULL }
836 };
837
838 static const value_string Teleservice_vals[] = {
839 {0x00, "allTeleservices" },
840 {0x10, "allSpeechTransmissionServices" },
841 {0x11, "telephony" },
842 {0x12, "emergencyCalls" },
843 {0x20, "allShortMessageServices" },
844 {0x21, "shortMessageMT-PP" },
845 {0x22, "shortMessageMO-PP" },
846 {0x60, "allFacsimileTransmissionServices" },
847 {0x61, "facsimileGroup3AndAlterSpeech" },
848 {0x62, "automaticFacsimileGroup3" },
849 {0x63, "facsimileGroup4" },
850
851 {0x70, "allDataTeleservices" },
852 {0x80, "allTeleservices-ExeptSMS" },
853
854 {0x90, "allVoiceGroupCallServices" },
855 {0x91, "voiceGroupCall" },
856 {0x92, "voiceBroadcastCall" },
857
858 {0xd0, "allPLMN-specificTS" },
859 {0xd1, "plmn-specificTS-1" },
860 {0xd2, "plmn-specificTS-2" },
861 {0xd3, "plmn-specificTS-3" },
862 {0xd4, "plmn-specificTS-4" },
863 {0xd5, "plmn-specificTS-5" },
864 {0xd6, "plmn-specificTS-6" },
865 {0xd7, "plmn-specificTS-7" },
866 {0xd8, "plmn-specificTS-8" },
867 {0xd9, "plmn-specificTS-9" },
868 {0xda, "plmn-specificTS-A" },
869 {0xdb, "plmn-specificTS-B" },
870 {0xdc, "plmn-specificTS-C" },
871 {0xdd, "plmn-specificTS-D" },
872 {0xde, "plmn-specificTS-E" },
873 {0xdf, "plmn-specificTS-F" },
874   { 0, NULL }
875 };
876
877 /*--- proto_register_gsm_map -------------------------------------------*/
878 void proto_register_gsm_map(void) {
879
880   /* List of fields */
881   static hf_register_info hf[] = {
882     { &hf_gsm_map_invokeCmd,
883       { "invokeCmd", "gsm_map.invokeCmd",
884         FT_UINT32, BASE_DEC, VALS(gsm_map_opr_code_strings), 0,
885         "InvokePDU/invokeCmd", HFILL }},
886     { &hf_gsm_map_invokeid,
887       { "invokeid", "gsm_map.invokeid",
888         FT_INT32, BASE_DEC, NULL, 0,
889         "InvokeId/invokeid", HFILL }},
890     { &hf_gsm_map_absent,
891       { "absent", "gsm_map.absent",
892         FT_NONE, BASE_NONE, NULL, 0,
893         "InvokeId/absent", HFILL }},
894     { &hf_gsm_map_invokeId,
895       { "invokeId", "gsm_map.invokeId",
896         FT_UINT32, BASE_DEC, VALS(InvokeId_vals), 0,
897         "InvokePDU/invokeId", HFILL }},
898     { &hf_gsm_map_currentPassword,
899       { "currentPassword", "gsm_map.currentPassword",
900         FT_STRING, BASE_NONE, NULL, 0,
901         "", HFILL }},
902     { &hf_gsm_map_invoke,
903       { "invoke", "gsm_map.invoke",
904         FT_NONE, BASE_NONE, NULL, 0,
905         "GSMMAPPDU/invoke", HFILL }},
906     { &hf_gsm_map_returnResult,
907       { "returnResult", "gsm_map.returnResult",
908         FT_NONE, BASE_NONE, NULL, 0,
909         "GSMMAPPDU/returnResult", HFILL }},
910     { &hf_gsm_map_getPassword,
911       { "Password", "gsm_map.password",
912         FT_UINT8, BASE_DEC, VALS(gsm_map_GetPasswordArg_vals), 0,
913         "Password", HFILL }},
914
915
916 #include "packet-gsm_map-hfarr.c"
917   };
918
919   /* List of subtrees */
920   static gint *ett[] = {
921     &ett_gsm_map,
922     &ett_gsm_map_InvokeId,
923     &ett_gsm_map_InvokePDU,
924     &ett_gsm_map_ReturnResultPDU,
925     &ett_gsm_map_ReturnResult_result,
926     &ett_gsm_map_GSMMAPPDU,
927 #include "packet-gsm_map-ettarr.c"
928   };
929
930   /* Register protocol */
931   proto_gsm_map = proto_register_protocol(PNAME, PSNAME, PFNAME);
932 /*XXX  register_dissector("gsm_map", dissect_gsm_map, proto_gsm_map);*/
933   /* Register fields and subtrees */
934   proto_register_field_array(proto_gsm_map, hf, array_length(hf));
935   proto_register_subtree_array(ett, array_length(ett));
936
937   sms_dissector_table =
938         register_dissector_table("gsm_map.sms_tpdu", "GSM SMS TPDU",
939         FT_UINT8, BASE_DEC);
940
941   gsm_map_tap = register_tap("gsm_map");
942         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)" );
943         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)" );
944         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)" );
945         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)" );
946         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)" );
947         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)" );
948         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)" );
949         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)" );
950         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)" );
951         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)" );
952         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)" );
953         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)" );
954         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)" );
955         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)" );
956         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)" );
957         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)" );
958         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)" );
959         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)" );
960         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)" );
961         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)" );
962         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)" );
963         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)" );
964         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)" );
965         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)" );
966         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)" );
967         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)" );
968         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)" );
969         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)" );
970         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)" );
971         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)" );
972         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)" );
973         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)" );
974         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)" );
975         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)" );
976
977 }
978
979
980 /*--- proto_reg_handoff_gsm_map ---------------------------------------*/
981 void proto_reg_handoff_gsm_map(void) {
982     dissector_handle_t  map_handle;
983
984     map_handle = create_dissector_handle(dissect_gsm_map, proto_gsm_map);
985     dissector_add("tcap.itu_ssn", 6, map_handle);
986     dissector_add("tcap.itu_ssn", 7, map_handle);
987     dissector_add("tcap.itu_ssn", 8, map_handle);
988     dissector_add("tcap.itu_ssn", 9, map_handle);
989 }