2 # camel conformation file
6 #.IMPORT ../gsm_map/gsm_map-exp.cnf
7 #.IMPORT ../inap/inap-exp.cnf
13 #.ASSIGNED_OBJECT_IDENTIFIER classes
14 #.ASSIGNED_OBJECT_IDENTIFIER ros-InformationObjects
15 #.ASSIGNED_OBJECT_IDENTIFIER tc-Messages
16 #.ASSIGNED_OBJECT_IDENTIFIER tc-NotationExtensions
17 #.ASSIGNED_OBJECT_IDENTIFIER gprsSSF-gsmSCF-Operations
18 #.ASSIGNED_OBJECT_IDENTIFIER gsmSCF-gsmSRF-Operations
19 #.ASSIGNED_OBJECT_IDENTIFIER gsmSSF-gsmSCF-Operations
20 #.ASSIGNED_OBJECT_IDENTIFIER sms-Operations
21 #.ASSIGNED_OBJECT_IDENTIFIER gsmSSF-gsmSCF-Protocol
22 #.ASSIGNED_OBJECT_IDENTIFIER gsmSCF-gsmSRF-Protocol
23 #.ASSIGNED_OBJECT_IDENTIFIER operationcodes
24 #.ASSIGNED_OBJECT_IDENTIFIER datatypes
25 #.ASSIGNED_OBJECT_IDENTIFIER errortypes
27 #.OMIT_ASSIGNMENT Remote-Operations-Information-Objects
32 # Removed as they are giving 'defined but not used' warnings currently.
40 OPERATION.&ArgumentType
46 CAP-GPRS-ReferenceNumber B "0.4.0.0.1.1.5.2" "id-CAP-GPRS-ReferenceNumber"
47 CAP-U-ABORT-REASON B "0.4.0.0.1.1.2.2" "id-CAP-U-ABORT-Reason"
52 ReturnResult/result/result ResultArgument
55 Invoke/linkedId/present linkedIdPresent
56 Reject/problem/invoke invokeProblem
57 Reject/problem/returnError returnErrorProblem
58 ReturnResult/result/result resultArgument
59 Reject/problem/returnResult problemReturnResult
61 PAR-cancelFailed/problem par-cancelFailedProblem
62 CAMEL-FCIBillingChargingCharacteristics/fCIBCCCAMELsequence1 fci-fCIBCCCAMELsequence1
63 CAMEL-FCIGPRSBillingChargingCharacteristics/fCIBCCCAMELsequence1 fciGPRS-fCIBCCCAMELsequence1
64 CAMEL-FCISMSBillingChargingCharacteristics/fCIBCCCAMELsequence1 fciSMS-fCIBCCCAMELsequence1
65 EventSpecificInformationBCSM/oMidCallSpecificInfo/midCallEvents omidCallEvents
66 EventSpecificInformationBCSM/tMidCallSpecificInfo/midCallEvents tmidCallEvents
67 AudibleIndicator/tone audibleIndicatorTone
68 GapIndicators/duration gapIndicatorsDuration
69 InbandInfo/duration inbandInfoDuration
70 Tone/duration toneDuration
71 Burst/toneDuration burstToneDuration
73 EventSpecificInformationSMS/o-smsFailureSpecificInfo/failureCause smsfailureCause
74 EventSpecificInformationBCSM/routeSelectFailureSpecificInfo/failureCause routeSelectfailureCause
75 EventSpecificInformationSMS/t-smsFailureSpecificInfo/failureCause t-smsfailureCause
77 CAMEL-FCIBillingChargingCharacteristics/fCIBCCCAMELsequence1/partyToCharge fCIBCCCAMELsequence1partyToCharge
78 CAMEL-CallResult/timeDurationChargingResult/partyToCharge timeDurationChargingResultpartyToCharge
80 AOCSubsequent/tariffSwitchInterval aocSubsequent-tariffSwitchInterval
81 CAMEL-AChBillingChargingCharacteristics/timeDurationCharging/tariffSwitchInterval timeDurationCharging-tariffSwitchInterval
82 ApplyChargingGPRSArg/tariffSwitchInterval applyChargingGPRS-tariffSwitchInterval
83 TimeIfTariffSwitch/tariffSwitchInterval timeIfTariffSwitch-tariffSwitchInterval
85 # This table creates the value_sting to name Camel operation codes and errors
86 # in file packet-camel-table.c which is included in the template file
89 /* CAMEL OPERATIONS */
90 const value_string camel_opr_code_strings[] = {
91 #.TABLE_BODY OPERATION
92 { %(&operationCode)s, "%(_ident)s" },
100 static const value_string camel_err_code_string_vals[] = {
102 { %(&errorCode)s, "%(_ident)s" },
108 # This table creates the switch() to branch on Camel operation codes and errors
109 # in file packet-camel-table2.c which is included in the template file
112 static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) {
116 #.TABLE2_BODY OPERATION.&ArgumentType
117 case %(&operationCode)s: /* %(_ident)s */
118 offset= %(_argument_pdu)s(tvb, actx->pinfo , tree , NULL);
122 cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob");
123 proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN);
124 expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown invokeData %d",opcode);
125 /* todo call the asn.1 dissector */
132 static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) {
136 #.TABLE2_BODY OPERATION.&ResultType
137 case %(&operationCode)s: /* %(_ident)s */
138 offset= %(_result_pdu)s(tvb, actx->pinfo , tree , NULL);
142 cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob");
143 proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN);
144 expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown returnResultData %d",opcode);
150 static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) {
154 #.TABLE2_BODY ERROR.&ParameterType
155 case %(&errorCode)s: /* %(_ident)s */
156 %(_parameter_pdu)s(tvb, actx->pinfo , tree , NULL);
160 cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnErrorData blob");
161 proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN);
162 expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Unknown returnErrorData %d",errorCode);
167 # ROS stuff here XXX change when TCAP is redone.
169 #.FN_BODY Code/local VAL_PTR = &opcode
171 if (is_ExtensionField){
172 hf_index = hf_camel_extension_code_local;
173 }else if (camel_opcode_type == CAMEL_OPCODE_RETURN_ERROR){
174 hf_index = hf_camel_error_code_local;
177 if (is_ExtensionField == FALSE){
178 if (camel_opcode_type == CAMEL_OPCODE_RETURN_ERROR){
180 col_append_str(actx->pinfo->cinfo, COL_INFO,
181 val_to_str(errorCode, camel_err_code_string_vals, "Unknown CAMEL error (%%u)"));
182 col_append_str(actx->pinfo->cinfo, COL_INFO, " ");
183 col_set_fence(actx->pinfo->cinfo, COL_INFO);
185 col_append_str(actx->pinfo->cinfo, COL_INFO,
186 val_to_str(opcode, camel_opr_code_strings, "Unknown CAMEL (%%u)"));
187 col_append_str(actx->pinfo->cinfo, COL_INFO, " ");
188 col_set_fence(actx->pinfo->cinfo, COL_INFO);
190 gp_camelsrt_info->opcode=opcode;
193 camel_opcode_type=CAMEL_OPCODE_INVOKE;
195 #.FN_HDR ReturnResult
196 camel_opcode_type=CAMEL_OPCODE_RETURN_RESULT;
199 camel_opcode_type=CAMEL_OPCODE_RETURN_ERROR;
202 camel_opcode_type=CAMEL_OPCODE_REJECT;
205 #.FN_BODY Invoke/argument
206 offset = dissect_invokeData(tree, tvb, offset, actx);
208 #.FN_BODY ReturnResult/result/result
209 offset = dissect_returnResultData(tree, tvb, offset, actx);
211 #.FN_BODY ReturnError/parameter
212 offset = dissect_returnErrorData(tree, tvb, offset, actx);
216 #.FN_BODY InitialDPArgExtension
218 if((camel_ver == 2)||(camel_ver == 1)){
219 return dissect_camel_InitialDPArgExtensionV2(implicit_tag, tvb, offset, actx, tree, hf_index);
224 #.FN_HDR ExtensionField
226 is_ExtensionField =TRUE;
228 #.FN_PARS Code/global FN_VARIANT = _str VAL_PTR = &camel_obj_id
230 #.FN_BODY ExtensionField/value
231 /*XXX handle local form here */
233 offset=call_ber_oid_callback(camel_obj_id, tvb, offset, actx->pinfo, tree);
235 is_ExtensionField = FALSE;
237 #----------------------------------------------------------------------------------------
238 #.FN_BODY CallingPartyNumber VAL_PTR = ¶meter_tvb
239 tvbuff_t *parameter_tvb;
247 subtree = proto_item_add_subtree(actx->created_item, ett_camel_callingpartynumber);
248 dissect_isup_calling_party_number_parameter(parameter_tvb, subtree, NULL);
251 #----------------------------------------------------------------------------------------
252 #.FN_BODY CalledPartyNumber VAL_PTR = ¶meter_tvb
253 tvbuff_t *parameter_tvb;
261 subtree = proto_item_add_subtree(actx->created_item, ett_camel_calledpartybcdnumber);
262 dissect_isup_called_party_number_parameter(parameter_tvb, subtree, NULL);
265 #----------------------------------------------------------------------------------------
266 #.FN_BODY LocationNumber VAL_PTR = ¶meter_tvb
267 tvbuff_t *parameter_tvb;
275 subtree = proto_item_add_subtree(actx->created_item, ett_camel_locationnumber);
276 dissect_isup_location_number_parameter(parameter_tvb, subtree, NULL);
279 #----------------------------------------------------------------------------------------
280 #.FN_BODY GenericNumber VAL_PTR = ¶meter_tvb
281 tvbuff_t *parameter_tvb;
288 dissect_isup_generic_number_parameter(parameter_tvb, tree, NULL);
291 #----------------------------------------------------------------------------------------
292 #.FN_BODY Cause VAL_PTR = ¶meter_tvb
294 tvbuff_t *parameter_tvb;
302 subtree = proto_item_add_subtree(actx->created_item, ett_camel_cause);
304 dissect_q931_cause_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), subtree, hf_camel_cause_indicator, &Cause_value, isup_parameter_type_value);
307 #----------------------------------------------------------------------------------------
308 #.FN_BODY RPCause VAL_PTR = ¶meter_tvb
310 tvbuff_t *parameter_tvb;
318 subtree = proto_item_add_subtree(actx->created_item, ett_camel_RPcause);
320 dissect_RP_cause_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), subtree, hf_camel_RP_Cause, &Cause_value);
323 #----------------------------------------------------------------------------------------
324 #.FN_BODY DateAndTime
328 * date_option = 1 european dd:mm:yyyy
329 * date_option = 2 american mm:dd:yyyy
333 * Output should be HH:MM:SS;dd/mm/yyyy
334 * if european is selected, and HH:MM:SS;mm/dd/yyyy
339 guint8 i = 0, curr_offset;
340 char camel_time[CAMEL_DATE_AND_TIME_LEN];
341 char c[CAMEL_DATE_AND_TIME_LEN]; /*temporary container*/
343 /* 2 digits per octet, 7 octets total + 5 delimiters */
345 for (curr_offset = 0; curr_offset < 7 ; curr_offset++)
346 /*Loop to extract date*/
348 digit_pair = tvb_get_guint8(tvb, curr_offset);
350 proto_tree_add_uint(tree,
357 proto_tree_add_uint(tree,
365 c[i] = camel_number_to_char( digit_pair & 0x0F);
367 c[i] = camel_number_to_char( digit_pair >>4);
371 /* Pretty print date */
372 /* XXX - Should we use sprintf here instead of assembling the string by
375 camel_time[0] = c[8];
376 camel_time[1] = c[9];
378 camel_time[3] = c[10];
379 camel_time[4] = c[11];
381 camel_time[6] = c[12];
382 camel_time[7] = c[13];
384 if ( EUROPEAN_DATE == date_format) /*european*/
386 camel_time[9] = c[6]; /*day*/
387 camel_time[10] = c[7];
388 camel_time[11] = '/';
389 camel_time[12] = c[4]; /*month*/
390 camel_time[13] = c[5];
394 camel_time[9] = c[4]; /*month*/
395 camel_time[10] = c[5];
396 camel_time[11] = '/';
397 camel_time[12] = c[6]; /*day*/
398 camel_time[13] = c[7];
400 camel_time[14] = '/';
401 camel_time[15] = c[0];
402 camel_time[16] = c[1];
403 camel_time[17] = c[2];
404 camel_time[18] = c[3];
406 camel_time[CAMEL_DATE_AND_TIME_LEN - 1] = '\0';
408 /*start = 0, length = 7*/
410 proto_tree_add_string(tree,
417 return 7; /* 7 octets eaten*/
420 #----------------------------------------------------------------------------------------
421 #.FN_BODY BearerCapability/bearerCap VAL_PTR = ¶meter_tvb
422 tvbuff_t *parameter_tvb;
429 dissect_q931_bearer_capability_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), tree);
432 #----------------------------------------------------------------------------------------
433 #.FN_BODY OriginalCalledPartyID VAL_PTR = ¶meter_tvb
435 tvbuff_t *parameter_tvb;
441 dissect_isup_original_called_number_parameter(parameter_tvb, tree, NULL);
444 #----------------------------------------------------------------------------------------
445 #.FN_PARS RedirectingPartyID
447 VAL_PTR = ¶meter_tvb
449 #.FN_BODY RedirectingPartyID
451 tvbuff_t *parameter_tvb;
457 dissect_isup_redirecting_number_parameter(parameter_tvb, tree, NULL);
460 #----------------------------------------------------------------------------------------
461 #.FN_PARS AccessPointName
462 VAL_PTR = ¶meter_tvb
464 #.FN_BODY AccessPointName
466 tvbuff_t *parameter_tvb;
473 subtree = proto_item_add_subtree(actx->created_item, ett_camel_AccessPointName);
474 de_sm_apn(parameter_tvb, subtree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
477 #----------------------------------------------------------------------------------------
478 #.FN_BODY EndUserAddress/pDPTypeOrganization VAL_PTR = ¶meter_tvb
480 tvbuff_t *parameter_tvb;
486 PDPTypeOrganization = (tvb_get_guint8(parameter_tvb,0) &0x0f);
489 #----------------------------------------------------------------------------------------
490 #.FN_BODY EndUserAddress/pDPTypeNumber VAL_PTR = ¶meter_tvb
492 tvbuff_t *parameter_tvb;
499 PDPTypeNumber = tvb_get_guint8(parameter_tvb,0);
500 subtree = proto_item_add_subtree(actx->created_item, ett_camel_pdptypenumber);
501 switch (PDPTypeOrganization){
503 proto_tree_add_item(subtree, hf_camel_PDPTypeNumber_etsi, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
506 proto_tree_add_item(subtree, hf_camel_PDPTypeNumber_ietf, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
514 #.FN_BODY EndUserAddress/pDPAddress VAL_PTR = ¶meter_tvb
516 tvbuff_t *parameter_tvb;
523 subtree = proto_item_add_subtree(actx->created_item, ett_camel_pdptypenumber);
524 switch (PDPTypeOrganization){
528 switch(PDPTypeNumber){
529 case 0x21: /* IPv4 */
530 proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv4, parameter_tvb, 0, tvb_length(parameter_tvb), ENC_BIG_ENDIAN);
532 case 0x57: /* IPv6 */
533 proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv6, parameter_tvb, 0, tvb_length(parameter_tvb), ENC_NA);
544 #----------------------------------------------------------------------------------------
545 #.FN_BODY LocationInformationGPRS/cellGlobalIdOrServiceAreaIdOrLAI
549 start_offset = offset;
552 subtree = proto_item_add_subtree(actx->created_item, ett_camel_pdptypenumber);
554 if (tvb_reported_length_remaining(tvb,start_offset) == 7){
555 dissect_gsm_map_CellGlobalIdOrServiceAreaIdFixedLength(TRUE, tvb, start_offset, actx, subtree, hf_camel_cellGlobalIdOrServiceAreaIdFixedLength);
557 dissect_gsm_map_LAIFixedLength(TRUE, tvb, start_offset, actx, subtree, hf_camel_locationAreaId);
561 #----------------------------------------------------------------------------------------
562 #.FN_BODY AChBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
563 tvbuff_t *parameter_tvb;
569 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_AChBillingChargingCharacteristics);
570 if((camel_ver == 2)||(camel_ver == 1)){
571 return dissect_camel_CAMEL_AChBillingChargingCharacteristicsV2(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_AChBillingChargingCharacteristics);
573 dissect_camel_CAMEL_AChBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_AChBillingChargingCharacteristics);
575 #.FN_BODY FCIBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
576 tvbuff_t *parameter_tvb;
582 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_FCIBillingChargingCharacteristics);
583 dissect_camel_CAMEL_FCIBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_FCIBillingChargingCharacteristics);
585 #.FN_BODY FCIGPRSBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
586 tvbuff_t *parameter_tvb;
592 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_FCIGPRSBillingChargingCharacteristics);
593 dissect_camel_CAMEL_FCIGPRSBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_FCIGPRSBillingChargingCharacteristics);
595 #.FN_BODY FCISMSBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
596 tvbuff_t *parameter_tvb;
602 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_FCISMSBillingChargingCharacteristics);
603 dissect_camel_CAMEL_FCISMSBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_FCISMSBillingChargingCharacteristics);
605 #.FN_BODY SCIBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
606 tvbuff_t *parameter_tvb;
612 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_SCIBillingChargingCharacteristics);
613 dissect_camel_CAMEL_SCIBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_SCIBillingChargingCharacteristics);
615 #.FN_BODY SCIGPRSBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
616 tvbuff_t *parameter_tvb;
622 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_SCIGPRSBillingChargingCharacteristics);
623 dissect_camel_CAMEL_SCIGPRSBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_SCIGPRSBillingChargingCharacteristics);
625 #.FN_BODY CallResult VAL_PTR = ¶meter_tvb
626 tvbuff_t *parameter_tvb;
632 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_CallResult);
633 dissect_camel_CAMEL_CallResult(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_CallResult);
635 # V3 and V4 incompatibillity bug #1719
636 #.FN_BODY CAMEL-AChBillingChargingCharacteristics/timeDurationCharging/audibleIndicator
637 if (tvb_length_remaining(tvb,offset) < 2)
638 offset = dissect_camel_BOOLEAN(TRUE, tvb, offset, actx , tree, hf_camel_audibleIndicatorTone);
642 #.FN_BODY CalledPartyBCDNumber VAL_PTR = ¶meter_tvb
643 /* See 3GPP TS 29.078
644 * and 3GPP TS 24.008, section 10.5.4.7
645 * Indicates the Called Party Number, including service selection information.
646 * Refer to 3GPP TS 24.008 [9] for encoding.
647 * This data type carries only the 'type of number', 'numbering plan
648 * identification' and 'number digit' fields defined in 3GPP TS 24.008 [9];
649 * it does not carry the 'called party BCD number IEI' or 'length of called
650 * party BCD number contents'.
651 * In the context of the DestinationSubscriberNumber field in ConnectSMSArg or
652 * InitialDPSMSArg, a CalledPartyBCDNumber may also contain an alphanumeric
653 * character string. In this case, type-of-number '101'B is used, in accordance
654 * with 3GPP TS 23.040 [6]. The address is coded in accordance with the
655 * GSM 7-bit default alphabet definition and the SMS packing rules
656 * as specified in 3GPP TS 23.038 [15] in this case.
658 tvbuff_t *parameter_tvb;
665 subtree = proto_item_add_subtree(actx->created_item, ett_camel_calledpartybcdnumber);
666 de_cld_party_bcd_num(parameter_tvb, subtree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
671 PDPTypeOrganization TYPE = FT_UINT8 DISPLAY = BASE_DEC BITMASK = 0x0f STRINGS = VALS(gsm_map_PDP_Type_Organisation_vals)
672 DateAndTime TYPE = FT_STRING DISPLAY = BASE_NONE
673 Code/local TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = VALS(camel_opr_code_strings)
674 ServiceInteractionIndicatorsTwo/holdTreatmentIndicator TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = VALS(camel_holdTreatmentIndicator_values)
675 ServiceInteractionIndicatorsTwo/cwTreatmentIndicator TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = VALS(camel_cwTreatmentIndicator_values)
676 ServiceInteractionIndicatorsTwo/ectTreatmentIndicator TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = VALS(camel_ectTreatmentIndicator_values)