Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / asn1 / gsm_map / gsm_map.cnf
blob465e0ea3c1875080337f2cebf43e0691cdb7c6cf
1 #.OPT
2 -b
3 #-d satcom
4 #-s packet-gsm_map-tmp
5 #-k
6 -o gsm_map
7 #.END
9 #.MODULE
10 MAP-BS-Code             gsm_map
11 MAP-TS-Code             gsm_map
12 MAP-SS-Code             gsm_map
13 MAP-ExtensionDataTypes  gsm_map
14 MAP-CommonDataTypes     gsm_map
16 MAP-SS-DataTypes        gsm_map.ss
17 MAP-OM-DataTypes        gsm_map.om
18 MAP-ER-DataTypes        gsm_map.er
19 MAP-SM-DataTypes        gsm_map.sm
20 MAP-MS-DataTypes        gsm_map.ms
21 MAP-LCS-DataTypes       gsm_map.lcs
22 MAP-GR-DataTypes        gsm_map.gr
23 MAP-CH-DataTypes        gsm_map.ch
25 MAP-Errors              gsm_map
26 MAP-LocationServiceOperations   gsm_map
27 MAP-Group-Call-Operations       gsm_map
28 MAP-ShortMessageServiceOperations  gsm_map
29 MAP-SupplementaryServiceOperations  gsm_map
30 MAP-CallHandlingOperations      gsm_map
31 MAP-OperationAndMaintenanceOperations  gsm_map
32 MAP-MobileServiceOperations     gsm_map
33 MAP-Protocol                    gsm_map
34 MAP-DialogueInformation         gsm_map.dialogue
35 MAP-ApplicationContexts         gsm_map
36 SS-DataTypes                                    gsm_ss
37 SS-Operations                                   gsm_ss
38 DummyMAP                                                gsm_old
39 EricssonMAP                     gsm_map.ericsson
41 Remote-Operations-Information-Objects ROS
43 #.NO_EMIT ONLY_VALS
44 CallBarredParam
45 PW-RegistrationFailureCause
46 SystemFailureParam
47 ExtensionType
48 NumberPorted/_untag
50 #.OMIT_ASSIGNMENT
51 Code
52 Priority
53 CommonComponentId
54 GuidanceInfo
55 SS-InfoList
56 # Omitting SubscriberData makes CONTENT OF fail and InsertSubscriberDataArg will not get all its tags
57 # Not yet used Nokia extensions
58 SS-DataEmoInExt
59 EmoInCategoryKey
60 ANSIIsdArgExt
61 ANSISriResExt
62 PrefCarrierIdList
63 USSD-Extension
64 CosInfo
65 AnyTimePO-BarringArg
66 AnyTimePO-BarringRes
67 CarrierIdCode
68 COS-FeatureList
69 GprsBarring
70 COS-Feature
71 CustomerGroupID
72 SubGroupID
73 ClassOfServiceID
74 #.END
75 #.PDU
76 LCS-ClientID
77 ISDN-AddressString
79 #.USE_VALS_EXT
80 GSMMAPOperationLocalvalue
81 OperationLocalvalue
83 #.EXPORTS
84 AddressString
85 Add-GeographicalInformation
86 AgeOfLocationInformation
87 AlertingPattern
88 AreaEventInfo
89 BasicServiceCode
90 CallReferenceNumber
91 CCBS-Feature
92 CellGlobalIdOrServiceAreaIdOrLAI
93 CellGlobalIdOrServiceAreaIdFixedLength
94 CUG-CheckInfo
95 CUG-Index
96 CUG-Interlock
97 CUG-Info
98 CurrentPassword
99 D-CSI
100 DeferredLocationEventType
101 DefaultGPRS-Handling
102 DefaultSMS-Handling
103 EraseCC-EntryArg
104 EraseCC-EntryRes
105 Ext-BasicServiceCode
106 Ext-ForwOptions
107 Ext-GeographicalInformation EXTERN WS_DLL
108 Ext-NoRepCondTime
109 Ext-QoS-Subscribed
110 Ext2-QoS-Subscribed
111 Ext3-QoS-Subscribed
112 ExtensionContainer
113 ExternalSignalInfo
114 ForwardingOptions
115 GeographicalInformation
116 GetPasswordArg
117 GlobalCellId EXTERN WS_DLL
118 GPRSChargingID
119 GPRSMSClass
120 GSMMAPLocalErrorcode
121 GSN-Address
122 IMEI
123 IMSI EXTERN WS_DLL
124 InterrogateSS-Res
125 ISDN-AddressString EXTERN WS_DLL
126 ISDN-AddressString_PDU EXTERN WS_DLL
127 ISDN-SubaddressString
128 LAIFixedLength
129 LCS-CancelDeferredLocationArg
130 LCSClientExternalID
131 LCS-ClientID
132 LCS-ClientID_PDU
133 LCSClientInternalID
134 LCSClientName
135 LCSClientType
136 LCSCodeword
137 LCS-DLRSPPTransportArg
138 LCS-DLRSPPTransportRes
139 LCS-EventReportArg
140 LCS-EventReportRes
141 LCS-LocationPrivacySettingArg
142 LCS-Priority
143 LCS-PruDisassociationArg
144 LCS-PruAssociationArg
145 LCS-PruAssociationRes
146 LCS-ReferenceNumber
147 LCSRequestorID
148 LCSServiceTypeID
149 LCS-SLMTLRArg
150 LCS-SLMTLRRes
151 LCS-SLMOLRArg
152 LCS-SLMOLRRes
153 LCS-ULRSPPTransportArg
154 LCS-ULRSPPTransportRes
155 LCS-QoS
156 LocationInformation
157 LocationMethod
158 LocationType
159 LSAIdentity
160 MS-Classmark2
161 NAEA-CIC
162 NetworkResource
163 NewPassword
164 NotificationToMSUser
165 O-CSI
166 O-BcsmCamelTDPCriteriaList
167 OfferedCamel4Functionalities
168 PositionMethodFailure-Diagnostic
169 ProtectedPayload
170 QoS-Subscribed
171 RAIdentity
172 RegisterCC-EntryRes
173 RegisterSS-Arg
174 SM-RP-DA
175 SM-RP-OA
176 SubscriberState
177 SecurityHeader
178 ServiceKey
179 SupportedCamelPhases
180 SupportedGADShapes
181 SuppressionOfAnnouncement
182 SS-Code
183 SS-Status
184 SS-Info
185 SS-ForBS-Code
186 TBCD-STRING
187 UnauthorizedLCSClient-Diagnostic
188 USSD-DataCodingScheme
189 USSD-String
190 USSD-Arg
191 USSD-Res
192 UU-Data
193 VelocityEstimate
194 #.END
195 #.REGISTER
196 MAP-DialoguePDU                         B "0.4.0.0.1.1.1.1" "map-DialogueAS"
198 # This table creates the value_string to name GSM MAP operation codes and errors
199 # in file packet-camel-table.c which is included in the template file
201 #.TABLE_BODY OPERATION
202         { %(&operationCode)s, "%(_ident)s" },
203 #.END
205 #.TABLE2_BODY ERROR
206         { %(&errorCode)s, "%(_ident)s" },
207 #.END
210 # Conformance for ROS stuff
212 #.FN_BODY InvokeParameter
213         offset = dissect_invokeData(tree, tvb, offset, actx);
215 #.FN_BODY ReturnResultParameter
216         offset = dissect_returnResultData(tree, tvb, offset, actx);
218 #.FN_BODY ReturnErrorParameter
219         offset = dissect_returnErrorData(tree, tvb, offset, actx);
221 #.FN_PARS  GSMMAPOperationLocalvalue
223   VAL_PTR = &opcode
225 #.FN_BODY  GSMMAPOperationLocalvalue
226   const char *opcode_string;
228 %(DEFAULT_BODY)s
229   /* Retrieve opcode string and eventually update item value */
230   opcode_string = gsm_map_opr_code(opcode, actx->created_item);
231   col_append_str(actx->pinfo->cinfo, COL_INFO, opcode_string);
232   col_append_str(actx->pinfo->cinfo, COL_INFO, " ");
234 #.FN_PARS  GSMMAPLocalErrorcode
236   VAL_PTR = &errorCode
237 # End ROS
238 #----------------------------------------------------------------------------------------
240 #.FN_BODY PrivateExtension/extId  FN_VARIANT = _str  VAL_PTR = &actx->external.direct_reference
241 %(DEFAULT_BODY)s
242   actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? true : false;
244 #.FN_BODY PrivateExtension/extType
245   proto_tree *ext_tree;
246   ext_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gsm_map_extension_data, NULL, "Extension Data");
247   if (actx->external.direct_ref_present){
248          offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, ext_tree, NULL);
249   }else{
250          call_data_dissector(tvb, actx->pinfo, ext_tree);
251          offset = tvb_reported_length_remaining(tvb,offset);
252   }
254 #.FN_PARS  AccessNetworkProtocolId
256   VAL_PTR = &AccessNetworkProtocolId
258 #.FN_BODY AddressString VAL_PTR = &parameter_tvb
260   tvbuff_t      *parameter_tvb;
261   proto_tree *subtree;
263 %(DEFAULT_BODY)s
265   if (!parameter_tvb)
266     return offset;
268   subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_isdn_address_string);
269   dissect_gsm_map_msisdn(parameter_tvb, actx->pinfo , subtree);
270   if (!PINFO_FD_VISITED(actx->pinfo))
271     actx->private_data = tvb_bytes_to_str(wmem_file_scope(), parameter_tvb, 0, tvb_captured_length(parameter_tvb));
273 #.FN_BODY IMSI VAL_PTR = &parameter_tvb
274   tvbuff_t   *parameter_tvb;
275   const char *imsi_str;
277   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &parameter_tvb);
279   if (!parameter_tvb)
280     return offset;
281   if(tvb_reported_length(parameter_tvb)==0)
282     return offset;
284   /* Hide the octet string default printout */
285   proto_item_set_hidden(actx->created_item);
286   imsi_str = dissect_e212_imsi(parameter_tvb, actx->pinfo, tree,
287                                0, tvb_reported_length(parameter_tvb), false);
288   if (!PINFO_FD_VISITED(actx->pinfo))
289     actx->private_data = wmem_strdup(wmem_file_scope(), imsi_str);
291 #.FN_BODY LMSI VAL_PTR = &parameter_tvb
292   tvbuff_t *parameter_tvb;
293 %(DEFAULT_BODY)s
294   if (parameter_tvb && !PINFO_FD_VISITED(actx->pinfo)) {
295     actx->private_data = tvb_bytes_to_str(wmem_file_scope(), parameter_tvb, 0, tvb_captured_length(parameter_tvb));
296   }
298 #.FN_BODY TBCD-STRING VAL_PTR = &parameter_tvb
299  tvbuff_t       *parameter_tvb;
300  proto_tree *subtree;
303  %(DEFAULT_BODY)s
305  if (!parameter_tvb)
306         return offset;
307  if(tvb_reported_length(parameter_tvb)==0)
308      return offset;
310  subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_tbcd_digits);
311  proto_tree_add_item(subtree, hf_gsm_map_TBCD_digits, parameter_tvb, 0, -1, ENC_KEYPAD_ABC_TBCD|ENC_LITTLE_ENDIAN);
313 #----------------------------------------------------------------------------------------
314 #.FN_BODY LongSignalInfo VAL_PTR = &parameter_tvb
316 #7.6.9.1 AN-apdu
317 #This parameter includes one or two concatenated complete 3GPP TS 25.413 or 3GPP TS 48.006 [48] messages, as
318 #described in 3GPP TS 23.009 and 3GPP TS 29.010. The access network protocol ID indicates that the message or
319 #messages are according to either 3GPP TS 48.006 [48] or 3GPP TS 25.413. For the coding of the messages see 3GPP
320 #TS 25.413, 3GPP TS 48.006 [48] and 3GPP TS 48.008 [49].
322  tvbuff_t       *parameter_tvb;
323  uint8_t                octet;
324  tvbuff_t       *next_tvb;
325  proto_tree *subtree;
326  gsm_map_private_info_t *gsm_map_priv;
327  sccp_msg_info_t *sccp_msg_info;
330 %(DEFAULT_BODY)s
332  if (!parameter_tvb)
333         return offset;
335  gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
336  sccp_msg_info = gsm_map_priv ? gsm_map_priv->sccp_msg_info : NULL;
337  subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_LongSignalInfo);
339  switch (AccessNetworkProtocolId){
340         /* ts3G-48006 */
341         case 1:
342                 octet = tvb_get_uint8(parameter_tvb,0);
343                 /* Discrimination parameter */
344                 proto_tree_add_item(subtree, hf_gsm_map_disc_par, parameter_tvb, 0,1,ENC_BIG_ENDIAN);
345                 if ( octet == 0) {/* DISCRIMINATION TS 48 006(GSM 08.06 version 5.3.0) */
346                         /* Strip off discrimination and length */
347                         proto_tree_add_item(subtree, hf_gsm_map_len, parameter_tvb, 1,1,ENC_BIG_ENDIAN);
348                         next_tvb = tvb_new_subset_remaining(parameter_tvb, 2);
349                         call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, sccp_msg_info);
350                 }else if(octet==1){
351                         proto_tree_add_item(subtree, hf_gsm_map_dlci, parameter_tvb, 1,1,ENC_BIG_ENDIAN);
352                         proto_tree_add_item(subtree, hf_gsm_map_len, parameter_tvb, 2,1,ENC_BIG_ENDIAN);
353                         next_tvb = tvb_new_subset_remaining(parameter_tvb, 3);
354                         call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree);
355                 }
356                 break;
357         /* ts3G-25413 */
358         case 2:
359                 call_dissector(ranap_handle, parameter_tvb, actx->pinfo, tree);
360                 break;
361         default:
362                 break;
365 # Set SENT/RECEIVED depending if ISDN-AddressString or AddressString is used.
366 # as it's a CHOICE only one is present.
367 #.FN_BODY SM-RP-OAold/serviceCentreAddressOA
368   actx->private_data = NULL;
369   actx->pinfo->p2p_dir = P2P_DIR_SENT;
370 %(DEFAULT_BODY)s
371   if (actx->private_data) {
372     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, true);
373     gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_SERVICE_CENTER_ADDRESS;
374     gsm_map_pi->sm_rp_oa_str = (const char*)actx->private_data;
375     actx->private_data = NULL;
376   }
378 #.FN_BODY SM-RP-OA/serviceCentreAddressOA
379   actx->private_data = NULL;
380   actx->pinfo->p2p_dir = P2P_DIR_SENT;
381 %(DEFAULT_BODY)s
382   if (actx->private_data) {
383     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, true);
384     gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_SERVICE_CENTER_ADDRESS;
385     gsm_map_pi->sm_rp_oa_str = (const char*)actx->private_data;
386     actx->private_data = NULL;
387   }
389 #.FN_BODY SM-RP-DAold/imsi
390   actx->private_data = NULL;
391   actx->pinfo->p2p_dir = P2P_DIR_SENT;
392 %(DEFAULT_BODY)s
393   if (actx->private_data) {
394     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, true);
395     gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_IMSI;
396     gsm_map_pi->sm_rp_da_str = (const char*)actx->private_data;
397     actx->private_data = NULL;
398   }
400 #.FN_BODY SM-RP-DAold/lmsi
401   actx->private_data = NULL;
402   actx->pinfo->p2p_dir = P2P_DIR_SENT;
403 %(DEFAULT_BODY)s
404   if (actx->private_data) {
405     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, true);
406     gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_LMSI;
407     gsm_map_pi->sm_rp_da_str = (const char*)actx->private_data;
408     actx->private_data = NULL;
409   }
411 #.FN_BODY SM-RP-DA/imsi
412   actx->private_data = NULL;
413   actx->pinfo->p2p_dir = P2P_DIR_SENT;
414 %(DEFAULT_BODY)s
415   if (actx->private_data) {
416     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, true);
417     gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_IMSI;
418     gsm_map_pi->sm_rp_da_str = (const char*)actx->private_data;
419     actx->private_data = NULL;
420   }
422 #.FN_BODY SM-RP-DA/lmsi
423   actx->private_data = NULL;
424   actx->pinfo->p2p_dir = P2P_DIR_SENT;
425 %(DEFAULT_BODY)s
426   if (actx->private_data) {
427     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, true);
428     gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_LMSI;
429     gsm_map_pi->sm_rp_da_str = (const char*)actx->private_data;
430     actx->private_data = NULL;
431   }
433 #.FN_BODY SM-RP-OAold/msisdn
434   actx->private_data = NULL;
435   actx->pinfo->p2p_dir = P2P_DIR_RECV;
436 %(DEFAULT_BODY)s
437   if (actx->private_data) {
438     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, true);
439     gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_MSISDN;
440     gsm_map_pi->sm_rp_oa_str = (const char*)actx->private_data;
441     actx->private_data = NULL;
442   }
444 #.FN_BODY SM-RP-OA/msisdn
445   actx->pinfo->p2p_dir = P2P_DIR_RECV;
446 %(DEFAULT_BODY)s
447   if (actx->private_data) {
448     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, true);
449     gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_MSISDN;
450     gsm_map_pi->sm_rp_oa_str = (const char*)actx->private_data;
451     actx->private_data = NULL;
452   }
454 #.FN_BODY SM-RP-DAold/serviceCentreAddressDA
455   actx->private_data = NULL;
456   actx->pinfo->p2p_dir = P2P_DIR_RECV;
457 %(DEFAULT_BODY)s
458   if (actx->private_data) {
459     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, true);
460     gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_SERVICE_CENTER_ADDRESS;
461     gsm_map_pi->sm_rp_da_str = (const char*)actx->private_data;
462     actx->private_data = NULL;
463   }
465 #.FN_BODY SM-RP-DA/serviceCentreAddressDA
466   actx->private_data = NULL;
467   actx->pinfo->p2p_dir = P2P_DIR_RECV;
468 %(DEFAULT_BODY)s
469   if (actx->private_data) {
470     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, true);
471     gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_SERVICE_CENTER_ADDRESS;
472     gsm_map_pi->sm_rp_da_str = (const char*)actx->private_data;
473     actx->private_data = NULL;
474   }
476 #.FN_BODY SM-RP-OAold/noSM-RP-OA
477 %(DEFAULT_BODY)s
478   if (!PINFO_FD_VISITED(actx->pinfo)) {
479     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, false);
480     gsm_map_packet_info_t *prev_packet_info = gsm_map_get_matching_tcap_info(actx);
481     if (prev_packet_info) {
482       gsm_map_pi->sm_rp_oa_id = prev_packet_info->sm_rp_oa_id;
483       gsm_map_pi->sm_rp_oa_str = wmem_strdup(wmem_file_scope(), prev_packet_info->sm_rp_oa_str);
484     }
485   }
487 #.FN_BODY SM-RP-OA/noSM-RP-OA
488 %(DEFAULT_BODY)s
489   if (!PINFO_FD_VISITED(actx->pinfo)) {
490     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, false);
491     gsm_map_packet_info_t *prev_packet_info = gsm_map_get_matching_tcap_info(actx);
492     if (prev_packet_info) {
493       gsm_map_pi->sm_rp_oa_id = prev_packet_info->sm_rp_oa_id;
494       gsm_map_pi->sm_rp_oa_str = wmem_strdup(wmem_file_scope(), prev_packet_info->sm_rp_oa_str);
495     }
496   }
498 #.FN_BODY SM-RP-DAold/noSM-RP-DA
499 %(DEFAULT_BODY)s
500   if (!PINFO_FD_VISITED(actx->pinfo)) {
501     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, false);
502     gsm_map_packet_info_t *prev_packet_info = gsm_map_get_matching_tcap_info(actx);
503     if (prev_packet_info) {
504       gsm_map_pi->sm_rp_da_id = prev_packet_info->sm_rp_da_id;
505       gsm_map_pi->sm_rp_da_str = wmem_strdup(wmem_file_scope(), prev_packet_info->sm_rp_da_str);
506     }
507   }
509 #.FN_BODY SM-RP-DA/noSM-RP-DA
510 %(DEFAULT_BODY)s
511   if (!PINFO_FD_VISITED(actx->pinfo)) {
512     gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, false);
513     gsm_map_packet_info_t *prev_packet_info = gsm_map_get_matching_tcap_info(actx);
514     if (prev_packet_info) {
515       gsm_map_pi->sm_rp_da_id = prev_packet_info->sm_rp_da_id;
516       gsm_map_pi->sm_rp_da_str = wmem_strdup(wmem_file_scope(), prev_packet_info->sm_rp_da_str);
517     }
518   }
520 #.FN_BODY SignalInfo VAL_PTR = &parameter_tvb
521   tvbuff_t *parameter_tvb;
522   gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
524 %(DEFAULT_BODY)s
525   if (gsm_map_priv)
526         gsm_map_priv->signal_info_tvb = parameter_tvb;
529 #.FN_BODY SM-DeliveryFailureCause
530   /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
531   uint8_t oct;
532   gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
533 %(DEFAULT_BODY)s
535   if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
536     return offset;
537   /* Detailed diagnostic information contains either a SMS-SUBMIT-REPORT or a SMS-DELIVERY-REPORT */
538   oct = tvb_get_uint8(gsm_map_priv->signal_info_tvb, 0);
539   actx->pinfo->p2p_dir = ((oct & 0x03) == 0) ? P2P_DIR_RECV : P2P_DIR_SENT;
540   call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
542 #.FN_BODY ForwardSM-Arg
543   /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
544   gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
545 %(DEFAULT_BODY)s
547   if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
548     return offset;
549   if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
550     if (gsmmap_pdu_type == 1) {
551       actx->pinfo->p2p_dir = P2P_DIR_SENT;
552     } else {
553       actx->pinfo->p2p_dir = P2P_DIR_RECV;
554     }
555   }
556   call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
558 #.FN_BODY MO-ForwardSM-Arg
559   /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
560   gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
561 %(DEFAULT_BODY)s
563   if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
564     return offset;
565   if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
566     actx->pinfo->p2p_dir = P2P_DIR_RECV;
567   }
568   call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
570 #.FN_BODY MO-ForwardSM-Res
571   /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
572   gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
573 %(DEFAULT_BODY)s
575   if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
576     return offset;
577   if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
578     actx->pinfo->p2p_dir = P2P_DIR_SENT;
579   }
580   call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
582 #.FN_BODY MT-ForwardSM-Arg
583   /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
584   gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
585 %(DEFAULT_BODY)s
587   if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
588     return offset;
589   if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
590     actx->pinfo->p2p_dir = P2P_DIR_SENT;
591   }
592   call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
594 #.FN_BODY MT-ForwardSM-Res
595   /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
596   gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
597 %(DEFAULT_BODY)s
599   if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
600     return offset;
601   if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
602     actx->pinfo->p2p_dir = P2P_DIR_RECV;
603   }
604   call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
606 #.FN_BODY MT-ForwardSM-VGCS-Arg
607   /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
608   gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
609 %(DEFAULT_BODY)s
611   if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
612     return offset;
613   if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
614     actx->pinfo->p2p_dir = P2P_DIR_SENT;
615   }
616   call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
618 #.FN_BODY MT-ForwardSM-VGCS-Res
619   /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
620   gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
621 %(DEFAULT_BODY)s
623   if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
624     return offset;
625   if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
626     actx->pinfo->p2p_dir = P2P_DIR_RECV;
627   }
628   call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
630 #.FN_BODY SS-Status VAL_PTR = &parameter_tvb
632  tvbuff_t       *parameter_tvb;
633  uint8_t                octet;
635 %(DEFAULT_BODY)s
637  if (!parameter_tvb)
638         return offset;
640  octet = tvb_get_uint8(parameter_tvb,0);
642  proto_tree_add_uint(tree, hf_gsm_map_Ss_Status_unused, parameter_tvb, 0,1,octet);
643  if ((octet & 0x01)== 1)
644         proto_tree_add_boolean(tree, hf_gsm_map_Ss_Status_q_bit, parameter_tvb, 0,1,octet);
646  proto_tree_add_boolean(tree, hf_gsm_map_Ss_Status_p_bit, parameter_tvb, 0,1,octet);
647  proto_tree_add_boolean(tree, hf_gsm_map_Ss_Status_r_bit, parameter_tvb, 0,1,octet);
648  proto_tree_add_boolean(tree, hf_gsm_map_Ss_Status_a_bit, parameter_tvb, 0,1,octet);
650 #.FN_BODY Ext-SS-Status VAL_PTR = &parameter_tvb
651  /* Note Ext-SS-Status can have more than one byte */
653  tvbuff_t       *parameter_tvb;
654  uint8_t                octet;
656 %(DEFAULT_BODY)s
658  if (!parameter_tvb)
659         return offset;
661  octet = tvb_get_uint8(parameter_tvb,0);
663  proto_tree_add_uint(tree, hf_gsm_map_Ss_Status_unused, parameter_tvb, 0,1,octet);
664  if ((octet & 0x01)== 1)
665         proto_tree_add_boolean(tree, hf_gsm_map_Ss_Status_q_bit, parameter_tvb, 0,1,octet);
667  proto_tree_add_boolean(tree, hf_gsm_map_Ss_Status_p_bit, parameter_tvb, 0,1,octet);
668  proto_tree_add_boolean(tree, hf_gsm_map_Ss_Status_r_bit, parameter_tvb, 0,1,octet);
669  proto_tree_add_boolean(tree, hf_gsm_map_Ss_Status_a_bit, parameter_tvb, 0,1,octet);
671 #.END
673 #.FN_BODY USSD-DataCodingScheme VAL_PTR = &parameter_tvb
674  /*The structure of the USSD-DataCodingScheme is defined by
675   * the Cell Broadcast Data Coding Scheme as described in
676   * TS 3GPP TS 23.038
677   * TODO: Should dissect_cbs_data_coding_scheme return encoding type? - like 7bit Alphabet
678   */
679   tvbuff_t      *parameter_tvb;
680   proto_tree *subtree;
682 %(DEFAULT_BODY)s
683   if (!parameter_tvb)
684      return offset;
685   subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_cbs_data_coding);
686   dissect_cbs_data_coding_scheme(parameter_tvb, actx->pinfo, subtree, 0);
688 #.FN_BODY USSD-String VAL_PTR = &parameter_tvb
690   tvbuff_t   *parameter_tvb;
691   unsigned    length;
692   proto_tree *subtree;
694 %(DEFAULT_BODY)s
695   if (!parameter_tvb)
696      return offset;
698   length = tvb_ensure_captured_length_remaining(parameter_tvb,0);
699   subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_ussd_string);
700   switch(sms_encoding){
701     case SMS_ENCODING_7BIT:
702     case SMS_ENCODING_7BIT_LANG:
703       proto_tree_add_item(subtree, hf_gsm_map_ussd_string, parameter_tvb, 0, length, ENC_3GPP_TS_23_038_7BITS|ENC_NA);
704       break;
705     case SMS_ENCODING_8BIT:
706       /* XXX - ASCII, or some extended ASCII? */
707       proto_tree_add_item(subtree, hf_gsm_map_ussd_string, parameter_tvb, 0, length, ENC_ASCII);
708       break;
709     case SMS_ENCODING_UCS2:
710     case SMS_ENCODING_UCS2_LANG:
711       proto_tree_add_item(subtree, hf_gsm_map_ussd_string, parameter_tvb, 0, length, ENC_UCS_2|ENC_BIG_ENDIAN);
712       break;
713     default:
714       break;
715   }
717 #.FN_FTR ForwardingOptions
719         proto_tree_add_item(tree, hf_gsm_map_notification_to_forwarding_party, tvb, 0,1,ENC_BIG_ENDIAN);
720         proto_tree_add_item(tree, hf_gsm_map_redirecting_presentation, tvb, 0,1,ENC_BIG_ENDIAN);
721         proto_tree_add_item(tree, hf_gsm_map_notification_to_calling_party, tvb, 0,1,ENC_BIG_ENDIAN);
722         proto_tree_add_item(tree, hf_gsm_map_forwarding_reason, tvb, 0,1,ENC_BIG_ENDIAN);
723 #.FN_FTR Ext-ForwFeature/forwardingOptions
725         proto_tree_add_item(tree, hf_gsm_map_notification_to_forwarding_party, tvb, 0,1,ENC_BIG_ENDIAN);
726         proto_tree_add_item(tree, hf_gsm_map_redirecting_presentation, tvb, 0,1,ENC_BIG_ENDIAN);
727         proto_tree_add_item(tree, hf_gsm_map_notification_to_calling_party, tvb, 0,1,ENC_BIG_ENDIAN);
728         proto_tree_add_item(tree, hf_gsm_map_forwarding_reason, tvb, 0,1,ENC_BIG_ENDIAN);
731 #.FN_BODY PDP-Type VAL_PTR = &parameter_tvb
732         uint8_t pdp_type_org;
733         tvbuff_t        *parameter_tvb;
736 %(DEFAULT_BODY)s
738   if (!parameter_tvb)
739     return offset;
740   proto_tree_add_item(tree, hf_gsm_map_pdp_type_org, parameter_tvb, 0,1,ENC_BIG_ENDIAN);
741   pdp_type_org = tvb_get_uint8(parameter_tvb,1);
742   switch (pdp_type_org){
743     case 0: /* ETSI */
744       proto_tree_add_item(tree, hf_gsm_map_etsi_pdp_type_number, parameter_tvb, 0,1,ENC_BIG_ENDIAN);
745       break;
746     case 1: /* IETF */
747       proto_tree_add_item(tree, hf_gsm_map_ietf_pdp_type_number, parameter_tvb, 0,1,ENC_BIG_ENDIAN);
748       break;
749     default:
750       break;
751   }
753 #.FN_BODY QoS-Subscribed VAL_PTR = &parameter_tvb
756         tvbuff_t        *parameter_tvb;
758 %(DEFAULT_BODY)s
760          if (!parameter_tvb)
761                 return offset;
762         de_sm_qos(parameter_tvb, tree, actx->pinfo, 0, 3, NULL,0);
764 #.FN_BODY Ext-QoS-Subscribed VAL_PTR = &parameter_tvb
766         tvbuff_t        *parameter_tvb;
768 %(DEFAULT_BODY)s
770         if (!parameter_tvb)
771                 return offset;
772         dissect_gsm_map_ext_qos_subscribed(tvb, actx->pinfo, tree, actx);
774 #.FN_BODY Ext2-QoS-Subscribed VAL_PTR = &parameter_tvb
776         tvbuff_t        *parameter_tvb;
778 %(DEFAULT_BODY)s
780         if (!parameter_tvb)
781                 return offset;
782         dissect_gsm_map_ext2_qos_subscribed(tvb, actx->pinfo, tree, actx);
784 #.FN_BODY Ext3-QoS-Subscribed VAL_PTR = &parameter_tvb
786         tvbuff_t        *parameter_tvb;
788 %(DEFAULT_BODY)s
790         if (!parameter_tvb)
791                 return offset;
792         dissect_gsm_map_ext3_qos_subscribed(tvb, actx->pinfo, tree, actx);
794 #.FN_BODY Ext4-QoS-Subscribed VAL_PTR = &parameter_tvb
796         tvbuff_t        *parameter_tvb;
798 %(DEFAULT_BODY)s
800         if (!parameter_tvb)
801                 return offset;
802         dissect_gsm_map_ext4_qos_subscribed(tvb, actx->pinfo, tree, actx);
804 #.FN_BODY GSN-Address VAL_PTR = &parameter_tvb
806         tvbuff_t        *parameter_tvb;
807         uint8_t         octet;
808         proto_tree *subtree;
810 %(DEFAULT_BODY)s
812         if (!parameter_tvb)
813                 return offset;
814         subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_pdptypenumber);
816         octet = tvb_get_uint8(parameter_tvb,0);
817         switch(octet){
818         case 0x04: /* IPv4 */
819                 proto_tree_add_item(subtree, hf_gsm_map_GSNAddress_IPv4, parameter_tvb, 1, 4, ENC_BIG_ENDIAN);
820                 break;
821         case 0x50: /* IPv6 */
822                 proto_tree_add_item(subtree, hf_gsm_map_GSNAddress_IPv6, parameter_tvb, 1, 16, ENC_NA);
823                 break;
824         default:
825                 break;
826         }
828 #.FN_BODY RAIdentity VAL_PTR = &parameter_tvb
830         tvbuff_t        *parameter_tvb;
831         proto_tree *subtree;
833 %(DEFAULT_BODY)s
835          if (!parameter_tvb)
836                 return offset;
837         subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_RAIdentity);
838         de_gmm_rai(parameter_tvb, subtree, actx->pinfo, 0, 3, NULL,0);
840 #.FN_BODY LAIFixedLength VAL_PTR = &parameter_tvb
842         tvbuff_t        *parameter_tvb;
843         proto_tree *subtree;
845 %(DEFAULT_BODY)s
847          if (!parameter_tvb)
848                 return offset;
849         subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_LAIFixedLength);
850         dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, subtree, 0, E212_LAI, true);
852 #.FN_BODY RadioResourceInformation VAL_PTR = &parameter_tvb
853     tvbuff_t        *parameter_tvb;
854         proto_tree *subtree;
856 %(DEFAULT_BODY)s
858         if (!parameter_tvb)
859                 return offset;
861     subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_RadioResourceInformation);
862         be_chan_type(parameter_tvb, subtree, actx->pinfo, 0, tvb_reported_length_remaining(tvb,0), NULL, 0);
864 #.FN_BODY RANAP-ServiceHandover VAL_PTR = &parameter_tvb
865     tvbuff_t        *parameter_tvb;
866         asn1_ctx_t              asn1_ctx;
868 %(DEFAULT_BODY)s
870         if (!parameter_tvb)
871                 return offset;
873         asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, true, actx->pinfo);
874         dissect_ranap_Service_Handover(parameter_tvb, 0, &asn1_ctx, tree, hf_gsm_map_ranap_service_Handover);
876 #.FN_BODY IntegrityProtectionInformation VAL_PTR = &parameter_tvb
877     tvbuff_t        *parameter_tvb;
878         asn1_ctx_t              asn1_ctx;
880 %(DEFAULT_BODY)s
882         if (!parameter_tvb)
883                 return offset;
885         asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, true, actx->pinfo);
886         dissect_ranap_IntegrityProtectionInformation(parameter_tvb, 0, &asn1_ctx, tree, hf_gsm_map_IntegrityProtectionInformation);
888 #.FN_BODY EncryptionInformation VAL_PTR = &parameter_tvb
889     tvbuff_t        *parameter_tvb;
890         asn1_ctx_t              asn1_ctx;
892 %(DEFAULT_BODY)s
894         if (!parameter_tvb)
895                 return offset;
897         asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, true, actx->pinfo);
898         dissect_ranap_EncryptionInformation(parameter_tvb, 0, &asn1_ctx, tree, hf_gsm_map_EncryptionInformation);
900 #.FN_PARS ProtocolId VAL_PTR = &ProtocolId
901 #.FN_BODY Bss-APDU
902  uint8_t                octet;
903  uint8_t                length;
904  tvbuff_t       *next_tvb;
905  proto_tree *subtree;
907 ETS 300 599: December 2000 (GSM 09.02 version 4.19.1)
908 5.6.9.1 BSS-apdu
909 This parameter includes one or two concatenated complete 08.06 messages, as described in GSM 03.09
910 and GSM 09.10. The Protocol ID indicates that the message or messages are according to GSM 08.06.
911 For the coding of the messages see GSM 08.06 and GSM 08.08.
913  ProtocolId = 0xffffffff;
914  gsm_map_private_info_t *gsm_map_priv;
915 %(DEFAULT_BODY)s
916  gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
917 if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
918         return offset;
919  subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_externalsignalinfo);
920  switch (ProtocolId){
921         case 1:
922         /* gsm-0408 */
923                 /* As per comment abowe Individual IE:(s) will be found here in TLV format
924                  * Unfortunately a branch for each IE must be made to call the appropriate
925                  * function
926                  */
927                  /* Get tag */
928                  octet = tvb_get_uint8(gsm_map_priv->signal_info_tvb,0);
929                  proto_tree_add_item(subtree, hf_gsm_map_ie_tag, gsm_map_priv->signal_info_tvb, 0,1,ENC_BIG_ENDIAN);
930                  /* get length */
931                  length = tvb_get_uint8(gsm_map_priv->signal_info_tvb,1);
932                  proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN);
933                  /* Branch on tag */
934                  switch(octet){
935                  case 4:
936                         /* Dissect the data part */
937                         de_bearer_cap(gsm_map_priv->signal_info_tvb, subtree, actx->pinfo, 2, length, NULL, 0);
938                         /* TODO: There may be more than one IE */
939                         break;
940                  default:
941                         proto_tree_add_expert(subtree, actx->pinfo, &ei_gsm_map_undecoded, gsm_map_priv->signal_info_tvb, 0, length);
942                         break;
943                 }/* switch(octet) */
944                 break;
945         case 2:
946                 /* gsm-0806 */
947                 octet = tvb_get_uint8(gsm_map_priv->signal_info_tvb,0);
948                 /* Discrimination parameter */
949                 proto_tree_add_item(subtree, hf_gsm_map_disc_par, gsm_map_priv->signal_info_tvb, 0,1,ENC_BIG_ENDIAN);
950                 if ( octet == 0) {/* DISCRIMINATION TS 48 006(GSM 08.06 version 5.3.0) */
951                         /* Strip off discrimination and length */
952                         proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN);
953                         next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2);
954                         call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info);
955                 }else if(octet==1){
956                         proto_tree_add_item(subtree, hf_gsm_map_dlci, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN);
957                         proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 2,1,ENC_BIG_ENDIAN);
958                         next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 3);
959                         call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree);
960                 }
961                 break;
962         case 3:
963         /* gsm-BSSMAP -- Value 3 is reserved and must not be used*/
964                 octet = tvb_get_uint8(gsm_map_priv->signal_info_tvb,0);
965                 if ( octet == 0) {/* DISCRIMINATION TS 48 006 */
966                         next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2);
967                         call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info);
968                 }
969                 break;
970         /* ets-300102-1 (~Q.931 ) */
971         case 4:
972                 octet = tvb_get_uint8(gsm_map_priv->signal_info_tvb,0);
973                 length = tvb_get_uint8(gsm_map_priv->signal_info_tvb,1);
974                 if ( octet == 4 )
975                         dissect_q931_bearer_capability_ie(gsm_map_priv->signal_info_tvb, 2, length, subtree);
976                 break;
977         default:
978                 break;
979         }/*switch (ProtocolId)*/
981 #.FN_BODY ExternalSignalInfo
983 -- Information about the internal structure is given in
984 -- clause 7.6.9.
985 7.6.9.4 External Signal Information
986 This parameter contains concatenated information elements (including tag and length) which are defined by a common
987 protocol version, preceded by the associated protocol ID. It is used to transport information of the indicated protocol via
988 MAP interfaces
990  uint8_t                octet;
991  uint8_t                length;
992  tvbuff_t       *next_tvb;
993  proto_tree *subtree;
994  gsm_map_private_info_t *gsm_map_priv;
996  ProtocolId = 0xffffffff;
997 %(DEFAULT_BODY)s
998  gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
999  if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
1000         return offset;
1001  subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_externalsignalinfo);
1002  switch (ProtocolId){
1003         case 1:
1004         /* gsm-0408 */
1005                 /* As per comment abowe Individual IE:(s) will be found here in TLV format
1006                  * Unfortunately a branch for each IE must be made to call the appropriate
1007                  * function
1008                  */
1009                  /* Get tag */
1010                  octet = tvb_get_uint8(gsm_map_priv->signal_info_tvb,0);
1011                  proto_tree_add_item(subtree, hf_gsm_map_ie_tag, gsm_map_priv->signal_info_tvb, 0,1,ENC_BIG_ENDIAN);
1012                  /* get length */
1013                  length = tvb_get_uint8(gsm_map_priv->signal_info_tvb,1);
1014                  proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN);
1015                  /* Branch on tag */
1016                  switch(octet){
1017                  case 4:
1018                         /* Dissect the data part */
1019                         de_bearer_cap(gsm_map_priv->signal_info_tvb, subtree, actx->pinfo, 2, length, NULL, 0);
1020                         /* TODO: There may be more than one IE */
1021                         break;
1022                  default:
1023                         proto_tree_add_expert(subtree, actx->pinfo, &ei_gsm_map_undecoded, gsm_map_priv->signal_info_tvb, 0, length);
1024                         break;
1025                 }/* switch(octet) */
1026                 break;
1027         case 2:
1028                 /* gsm-0806 */
1029                 octet = tvb_get_uint8(gsm_map_priv->signal_info_tvb,0);
1030                 /* Discrimination parameter */
1031                 proto_tree_add_item(subtree, hf_gsm_map_disc_par, gsm_map_priv->signal_info_tvb, 0,1,ENC_BIG_ENDIAN);
1032                 if ( octet == 0) {/* DISCRIMINATION TS 48 006(GSM 08.06 version 5.3.0) */
1033                         /* Strip off discrimination and length */
1034                         proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN);
1035                         next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2);
1036                         call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info);
1037                 }else if(octet==1){
1038                         proto_tree_add_item(subtree, hf_gsm_map_dlci, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN);
1039                         proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 2,1,ENC_BIG_ENDIAN);
1040                         next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 3);
1041                         call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree);
1042                 }
1043                 break;
1044         case 3:
1045         /* gsm-BSSMAP TODO Is it correct to stripp off two first octets here?*/
1046                 octet = tvb_get_uint8(gsm_map_priv->signal_info_tvb,0);
1047                 if ( octet == 0) {/* DISCRIMINATION TS 48 006 */
1048                         next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2);
1049                         call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info);
1050                 }
1051                 break;
1052         /* ets-300102-1 (~Q.931 ) */
1053         case 4:
1054                 octet = tvb_get_uint8(gsm_map_priv->signal_info_tvb,0);
1055                 length = tvb_get_uint8(gsm_map_priv->signal_info_tvb,1);
1056                 if ( octet == 4 )
1057                         dissect_q931_bearer_capability_ie(gsm_map_priv->signal_info_tvb, 2, length, subtree);
1058                 break;
1059         default:
1060                 break;
1061         }/*switch (ProtocolId)*/
1063 #.FN_BODY GlobalCellId VAL_PTR = &parameter_tvb
1064     tvbuff_t    *parameter_tvb;
1065         proto_tree      *subtree;
1067 %(DEFAULT_BODY)s
1069         if (!parameter_tvb)
1070                 return offset;
1072     subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_GlobalCellId);
1073         be_cell_id_aux(parameter_tvb, subtree, actx->pinfo, 0, tvb_reported_length_remaining(tvb,0), NULL, 0, 0);
1075 #.FN_BODY Ext-GeographicalInformation VAL_PTR = &parameter_tvb
1076     tvbuff_t    *parameter_tvb;
1077         proto_tree      *subtree;
1079 %(DEFAULT_BODY)s
1081         if (!parameter_tvb)
1082                 return offset;
1084     subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_GeographicalInformation);
1085         dissect_geographical_description(parameter_tvb, actx->pinfo, subtree);
1088 # APN ::=  OCTET STRING (SIZE (2..63))
1089 # Octets are coded according to TS 3GPP TS 23.003
1090 # 9.1 Structure of APN
1091 # :
1092 # The APN consists of one or more labels. Each label is coded as a one octet length field followed by that number of
1093 # octets coded as 8 bit ASCII characters. Following RFC 1035 [19] the labels shall consist only of the alphabetic
1094 # characters (A-Z and a-z), digits (0-9) and the hyphen (-). Following RFC 1123 [20], the label shall begin and end with
1095 # either an alphabetic character or a digit. The case of alphabetic characters is not significant. The APN is not terminated
1096 # by a length byte of zero.
1097 #.FN_BODY APN VAL_PTR = &parameter_tvb
1098     tvbuff_t    *parameter_tvb;
1099     proto_tree  *subtree;
1100     const uint8_t               *apn_str = NULL;
1102 %(DEFAULT_BODY)s
1103         if (!parameter_tvb)
1104                 return offset;
1106         subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_apn_str);
1107         proto_tree_add_item_ret_string(subtree, hf_gsm_apn_str, parameter_tvb, 0, -1, ENC_APN_STR | ENC_NA, actx->pinfo->pool, &apn_str);
1108         proto_item_append_text(actx->created_item, " - %%s", apn_str);
1111 #.FN_BODY LocationNumber VAL_PTR = &parameter_tvb
1112  tvbuff_t       *parameter_tvb;
1113  proto_tree     *subtree;
1114 %(DEFAULT_BODY)s
1115   if (!parameter_tvb)
1116       return offset;
1118   subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_LocationNumber);
1119   dissect_isup_location_number_parameter(parameter_tvb, actx->pinfo, subtree, NULL);
1121 #.FN_BODY EnhancedCheckIMEI-Arg/locationInformation VAL_PTR = &parameter_tvb
1122   tvbuff_t *parameter_tvb;
1123   proto_tree *subtree;
1124   uint8_t rat;
1125 %(DEFAULT_BODY)s
1126   if (parameter_tvb) {
1127     subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_ericsson_locationInformation);
1128     rat = tvb_get_uint8(parameter_tvb, 0);
1129     proto_tree_add_uint(subtree, hf_gsm_map_ericsson_locationInformation_rat, parameter_tvb, 0, 1, rat);
1130     switch (rat) {
1131       case 0:
1132         /* GSM */
1133         proto_tree_add_item(subtree, hf_gsm_map_ericsson_locationInformation_lac, parameter_tvb, 1, 2, ENC_BIG_ENDIAN);
1134         proto_tree_add_item(subtree, hf_gsm_map_ericsson_locationInformation_ci, parameter_tvb, 3, 2, ENC_BIG_ENDIAN);
1135         break;
1136       case 1:
1137         /* UMTS */
1138         proto_tree_add_item(subtree, hf_gsm_map_ericsson_locationInformation_lac, parameter_tvb, 1, 2, ENC_BIG_ENDIAN);
1139         proto_tree_add_item(subtree, hf_gsm_map_ericsson_locationInformation_sac, parameter_tvb, 3, 2, ENC_BIG_ENDIAN);
1140         break;
1141       default:
1142         break;
1143     }
1144   }
1146 #.FN_BODY SM-RP-SMEA VAL_PTR=&payload_tvb
1147   tvbuff_t *payload_tvb;
1148 %(DEFAULT_BODY)s
1149   if (payload_tvb) {
1150     uint32_t tvb_offset = 0;
1151     proto_item_set_hidden(actx->created_item);
1152     dis_field_addr(payload_tvb, actx->pinfo, tree, &tvb_offset, "SM-RP-SMEA");
1153   }
1156 #.FN_BODY E-UTRAN-CGI VAL_PTR=&parameter_tvb
1157   tvbuff_t *parameter_tvb;
1158   proto_tree *subtree;
1159 %(DEFAULT_BODY)s
1160   if (!parameter_tvb)
1161     return offset;
1163   subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_e_utranCellGlobalIdentity);
1164   de_sgsap_ecgi(parameter_tvb, subtree, actx->pinfo, 0, tvb_reported_length(tvb), NULL, 0);
1166 #.FN_BODY TA-Id VAL_PTR=&parameter_tvb
1167   tvbuff_t *parameter_tvb;
1168   proto_tree *subtree;
1169 %(DEFAULT_BODY)s
1170   if (!parameter_tvb)
1171     return offset;
1173   subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_TA_id);
1174   de_emm_trac_area_id(parameter_tvb, subtree, actx->pinfo, 0, tvb_reported_length(tvb), NULL, 0);
1176 #.FN_BODY GeographicalInformation VAL_PTR = &parameter_tvb
1177   tvbuff_t      *parameter_tvb;
1178   proto_tree    *subtree;
1179 %(DEFAULT_BODY)s
1180   if (!parameter_tvb)
1181     return offset;
1183   subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_GeographicalInformation);
1184   dissect_geographical_description(parameter_tvb, actx->pinfo, subtree);
1186 #.FN_BODY GeodeticInformation VAL_PTR=&parameter_tvb
1187   tvbuff_t *parameter_tvb;
1188   proto_tree *subtree;
1189 %(DEFAULT_BODY)s
1190   if (!parameter_tvb)
1191     return offset;
1193   subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_GeodeticInformation);
1194   dissect_isup_calling_geodetic_location_parameter(parameter_tvb, actx->pinfo, subtree, NULL);
1196 #.TYPE_ATTR
1197 LAC TYPE = FT_UINT16 DISPLAY = BASE_DEC_HEX
1198 #.FN_BODY LAC VAL_PTR = &parameter_tvb HF_INDEX = -1
1199   tvbuff_t *parameter_tvb = NULL;
1200 %(DEFAULT_BODY)s
1201   if (parameter_tvb) {
1202     actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 2, ENC_BIG_ENDIAN);
1203   }
1205 # Make dissector table for V3 messages
1206 #.REGISTER
1208 SendAuthenticationInfoArg                                               N gsm_map.v3.arg.opcode 56
1209 SendAuthenticationInfoRes                                               N gsm_map.v3.res.opcode 56
1211 #----------------------------------------------------------------------------------------
1212 #.TYPE_ATTR
1213 SS-Code  TYPE = FT_UINT8  DISPLAY = BASE_DEC  STRINGS = VALS(ssCode_vals)
1214 Teleservice  TYPE = FT_UINT8  DISPLAY = BASE_DEC  STRINGS = VALS(Teleservice_vals)
1215 Bearerservice  TYPE = FT_UINT8  DISPLAY = BASE_DEC  STRINGS = VALS(Bearerservice_vals)
1216 TeleserviceCode  TYPE = FT_UINT8  DISPLAY = BASE_DEC  STRINGS = VALS(Teleservice_vals)
1217 BearerServiceCode  TYPE = FT_UINT8  DISPLAY = BASE_DEC  STRINGS = VALS(Bearerservice_vals)
1218 Ext-TeleserviceCode TYPE = FT_UINT8  DISPLAY = BASE_DEC  STRINGS = VALS(Teleservice_vals)
1219 Ext-BearerServiceCode  TYPE = FT_UINT8  DISPLAY = BASE_DEC  STRINGS = VALS(Bearerservice_vals)
1220 ChargingCharacteristics  TYPE = FT_UINT16  DISPLAY = BASE_DEC  BITMASK = 0x0f00 STRINGS = VALS(chargingcharacteristics_values)
1221 RoutingInfo TYPE = FT_UINT32  DISPLAY = BASE_DEC  STRINGS = VALS(gsm_map_ch_RoutingInfo_vals)
1222 DiameterIdentity TYPE = FT_STRING  DISPLAY = BASE_NONE
1224 #----------------------------------------------------------------------------------------
1225 #.FIELD_ATTR
1226 RequestedInfo/imei ABBREV = imei_null
1228 #.END