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) {
115 #.TABLE2_BODY OPERATION.&ArgumentType
116 case %(&operationCode)s: /* %(_ident)s */
117 offset= %(_argument_pdu)s(tvb, actx->pinfo , tree , NULL);
121 proto_tree_add_expert_format(tree, actx->pinfo, &ei_camel_unknown_invokeData,
122 tvb, offset, -1, "Unknown invokeData %d", opcode);
123 /* todo call the asn.1 dissector */
130 static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) {
133 #.TABLE2_BODY OPERATION.&ResultType
134 case %(&operationCode)s: /* %(_ident)s */
135 offset= %(_result_pdu)s(tvb, actx->pinfo , tree , NULL);
139 proto_tree_add_expert_format(tree, actx->pinfo, &ei_camel_unknown_returnResultData,
140 tvb, offset, -1, "Unknown returnResultData %d",opcode);
146 static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) {
149 #.TABLE2_BODY ERROR.&ParameterType
150 case %(&errorCode)s: /* %(_ident)s */
151 %(_parameter_pdu)s(tvb, actx->pinfo , tree , NULL);
155 proto_tree_add_expert_format(tree, actx->pinfo, &ei_camel_unknown_returnErrorData,
156 tvb, offset, -1, "Unknown returnErrorData %d",errorCode);
161 # ROS stuff here XXX change when TCAP is redone.
163 #.FN_BODY Code/local VAL_PTR = &opcode
165 if (is_ExtensionField){
166 hf_index = hf_camel_extension_code_local;
167 }else if (camel_opcode_type == CAMEL_OPCODE_RETURN_ERROR){
168 hf_index = hf_camel_error_code_local;
171 if (is_ExtensionField == FALSE){
172 if (camel_opcode_type == CAMEL_OPCODE_RETURN_ERROR){
174 col_append_str(actx->pinfo->cinfo, COL_INFO,
175 val_to_str(errorCode, camel_err_code_string_vals, "Unknown CAMEL error (%%u)"));
176 col_append_str(actx->pinfo->cinfo, COL_INFO, " ");
177 col_set_fence(actx->pinfo->cinfo, COL_INFO);
179 col_append_str(actx->pinfo->cinfo, COL_INFO,
180 val_to_str(opcode, camel_opr_code_strings, "Unknown CAMEL (%%u)"));
181 col_append_str(actx->pinfo->cinfo, COL_INFO, " ");
182 col_set_fence(actx->pinfo->cinfo, COL_INFO);
184 gp_camelsrt_info->opcode=opcode;
187 camel_opcode_type=CAMEL_OPCODE_INVOKE;
189 #.FN_HDR ReturnResult
190 camel_opcode_type=CAMEL_OPCODE_RETURN_RESULT;
193 camel_opcode_type=CAMEL_OPCODE_RETURN_ERROR;
196 camel_opcode_type=CAMEL_OPCODE_REJECT;
199 #.FN_BODY Invoke/argument
200 offset = dissect_invokeData(tree, tvb, offset, actx);
202 #.FN_BODY ReturnResult/result/result
203 offset = dissect_returnResultData(tree, tvb, offset, actx);
205 #.FN_BODY ReturnError/parameter
206 offset = dissect_returnErrorData(tree, tvb, offset, actx);
210 #.FN_BODY InitialDPArgExtension
212 if((camel_ver == 2)||(camel_ver == 1)){
213 return dissect_camel_InitialDPArgExtensionV2(implicit_tag, tvb, offset, actx, tree, hf_index);
218 #.FN_HDR ExtensionField
220 is_ExtensionField =TRUE;
222 #.FN_PARS Code/global FN_VARIANT = _str VAL_PTR = &camel_obj_id
224 #.FN_BODY ExtensionField/value
225 /*XXX handle local form here */
227 offset=call_ber_oid_callback(camel_obj_id, tvb, offset, actx->pinfo, tree, NULL);
229 is_ExtensionField = FALSE;
231 #----------------------------------------------------------------------------------------
232 #.FN_BODY CallingPartyNumber VAL_PTR = ¶meter_tvb
233 tvbuff_t *parameter_tvb;
241 subtree = proto_item_add_subtree(actx->created_item, ett_camel_callingpartynumber);
242 dissect_isup_calling_party_number_parameter(parameter_tvb, subtree, NULL);
245 #----------------------------------------------------------------------------------------
246 #.FN_BODY CalledPartyNumber VAL_PTR = ¶meter_tvb
247 tvbuff_t *parameter_tvb;
255 subtree = proto_item_add_subtree(actx->created_item, ett_camel_calledpartybcdnumber);
256 dissect_isup_called_party_number_parameter(parameter_tvb, subtree, NULL);
259 #----------------------------------------------------------------------------------------
260 #.FN_BODY LocationNumber VAL_PTR = ¶meter_tvb
261 tvbuff_t *parameter_tvb;
269 subtree = proto_item_add_subtree(actx->created_item, ett_camel_locationnumber);
270 dissect_isup_location_number_parameter(parameter_tvb, subtree, NULL);
273 #----------------------------------------------------------------------------------------
274 #.FN_BODY GenericNumber VAL_PTR = ¶meter_tvb
275 tvbuff_t *parameter_tvb;
282 dissect_isup_generic_number_parameter(parameter_tvb, tree, NULL);
285 #----------------------------------------------------------------------------------------
286 #.FN_BODY Cause VAL_PTR = ¶meter_tvb
288 tvbuff_t *parameter_tvb;
296 subtree = proto_item_add_subtree(actx->created_item, ett_camel_cause);
298 dissect_q931_cause_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), subtree, hf_camel_cause_indicator, &Cause_value, isup_parameter_type_value);
301 #----------------------------------------------------------------------------------------
302 #.FN_BODY RPCause VAL_PTR = ¶meter_tvb
304 tvbuff_t *parameter_tvb;
312 subtree = proto_item_add_subtree(actx->created_item, ett_camel_RPcause);
314 dissect_RP_cause_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), subtree, hf_camel_RP_Cause, &Cause_value);
317 #----------------------------------------------------------------------------------------
318 #.FN_BODY DateAndTime
322 * date_option = 1 european dd:mm:yyyy
323 * date_option = 2 american mm:dd:yyyy
327 * Output should be HH:MM:SS;dd/mm/yyyy
328 * if european is selected, and HH:MM:SS;mm/dd/yyyy
333 guint8 i = 0, curr_offset;
334 char camel_time[CAMEL_DATE_AND_TIME_LEN];
335 char c[CAMEL_DATE_AND_TIME_LEN]; /*temporary container*/
337 /* 2 digits per octet, 7 octets total + 5 delimiters */
339 for (curr_offset = 0; curr_offset < 7 ; curr_offset++)
340 /*Loop to extract date*/
342 digit_pair = tvb_get_guint8(tvb, curr_offset);
344 proto_tree_add_uint(tree,
351 proto_tree_add_uint(tree,
359 c[i] = camel_number_to_char( digit_pair & 0x0F);
361 c[i] = camel_number_to_char( digit_pair >>4);
365 /* Pretty print date */
366 /* XXX - Should we use sprintf here instead of assembling the string by
369 camel_time[0] = c[8];
370 camel_time[1] = c[9];
372 camel_time[3] = c[10];
373 camel_time[4] = c[11];
375 camel_time[6] = c[12];
376 camel_time[7] = c[13];
378 if ( EUROPEAN_DATE == date_format) /*european*/
380 camel_time[9] = c[6]; /*day*/
381 camel_time[10] = c[7];
382 camel_time[11] = '/';
383 camel_time[12] = c[4]; /*month*/
384 camel_time[13] = c[5];
388 camel_time[9] = c[4]; /*month*/
389 camel_time[10] = c[5];
390 camel_time[11] = '/';
391 camel_time[12] = c[6]; /*day*/
392 camel_time[13] = c[7];
394 camel_time[14] = '/';
395 camel_time[15] = c[0];
396 camel_time[16] = c[1];
397 camel_time[17] = c[2];
398 camel_time[18] = c[3];
400 camel_time[CAMEL_DATE_AND_TIME_LEN - 1] = '\0';
402 /*start = 0, length = 7*/
404 proto_tree_add_string(tree,
411 return 7; /* 7 octets eaten*/
414 #----------------------------------------------------------------------------------------
415 #.FN_BODY BearerCapability/bearerCap VAL_PTR = ¶meter_tvb
416 tvbuff_t *parameter_tvb;
423 dissect_q931_bearer_capability_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), tree);
426 #----------------------------------------------------------------------------------------
427 #.FN_BODY OriginalCalledPartyID VAL_PTR = ¶meter_tvb
429 tvbuff_t *parameter_tvb;
435 dissect_isup_original_called_number_parameter(parameter_tvb, tree, NULL);
438 #----------------------------------------------------------------------------------------
439 #.FN_PARS RedirectingPartyID
441 VAL_PTR = ¶meter_tvb
443 #.FN_BODY RedirectingPartyID
445 tvbuff_t *parameter_tvb;
451 dissect_isup_redirecting_number_parameter(parameter_tvb, tree, NULL);
454 #----------------------------------------------------------------------------------------
455 #.FN_PARS AccessPointName
456 VAL_PTR = ¶meter_tvb
458 #.FN_BODY AccessPointName
460 tvbuff_t *parameter_tvb;
467 subtree = proto_item_add_subtree(actx->created_item, ett_camel_AccessPointName);
468 de_sm_apn(parameter_tvb, subtree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
471 #----------------------------------------------------------------------------------------
472 #.FN_BODY EndUserAddress/pDPTypeOrganization VAL_PTR = ¶meter_tvb
474 tvbuff_t *parameter_tvb;
480 PDPTypeOrganization = (tvb_get_guint8(parameter_tvb,0) &0x0f);
483 #----------------------------------------------------------------------------------------
484 #.FN_BODY EndUserAddress/pDPTypeNumber VAL_PTR = ¶meter_tvb
486 tvbuff_t *parameter_tvb;
493 PDPTypeNumber = tvb_get_guint8(parameter_tvb,0);
494 subtree = proto_item_add_subtree(actx->created_item, ett_camel_pdptypenumber);
495 switch (PDPTypeOrganization){
497 proto_tree_add_item(subtree, hf_camel_PDPTypeNumber_etsi, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
500 proto_tree_add_item(subtree, hf_camel_PDPTypeNumber_ietf, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
508 #.FN_BODY EndUserAddress/pDPAddress VAL_PTR = ¶meter_tvb
510 tvbuff_t *parameter_tvb;
517 subtree = proto_item_add_subtree(actx->created_item, ett_camel_pdptypenumber);
518 switch (PDPTypeOrganization){
522 switch(PDPTypeNumber){
523 case 0x21: /* IPv4 */
524 proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv4, parameter_tvb, 0, tvb_length(parameter_tvb), ENC_BIG_ENDIAN);
526 case 0x57: /* IPv6 */
527 proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv6, parameter_tvb, 0, tvb_length(parameter_tvb), ENC_NA);
538 #----------------------------------------------------------------------------------------
539 #.FN_BODY LocationInformationGPRS/cellGlobalIdOrServiceAreaIdOrLAI
543 start_offset = offset;
546 subtree = proto_item_add_subtree(actx->created_item, ett_camel_pdptypenumber);
548 if (tvb_reported_length_remaining(tvb,start_offset) == 7){
549 dissect_gsm_map_CellGlobalIdOrServiceAreaIdFixedLength(TRUE, tvb, start_offset, actx, subtree, hf_camel_cellGlobalIdOrServiceAreaIdFixedLength);
551 dissect_gsm_map_LAIFixedLength(TRUE, tvb, start_offset, actx, subtree, hf_camel_locationAreaId);
555 #----------------------------------------------------------------------------------------
556 #.FN_BODY AChBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
557 tvbuff_t *parameter_tvb;
563 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_AChBillingChargingCharacteristics);
564 if((camel_ver == 2)||(camel_ver == 1)){
565 return dissect_camel_CAMEL_AChBillingChargingCharacteristicsV2(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_AChBillingChargingCharacteristics);
567 dissect_camel_CAMEL_AChBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_AChBillingChargingCharacteristics);
569 #.FN_BODY FCIBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
570 tvbuff_t *parameter_tvb;
576 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_FCIBillingChargingCharacteristics);
577 dissect_camel_CAMEL_FCIBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_FCIBillingChargingCharacteristics);
579 #.FN_BODY FCIGPRSBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
580 tvbuff_t *parameter_tvb;
586 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_FCIGPRSBillingChargingCharacteristics);
587 dissect_camel_CAMEL_FCIGPRSBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_FCIGPRSBillingChargingCharacteristics);
589 #.FN_BODY FCISMSBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
590 tvbuff_t *parameter_tvb;
596 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_FCISMSBillingChargingCharacteristics);
597 dissect_camel_CAMEL_FCISMSBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_FCISMSBillingChargingCharacteristics);
599 #.FN_BODY SCIBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
600 tvbuff_t *parameter_tvb;
606 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_SCIBillingChargingCharacteristics);
607 dissect_camel_CAMEL_SCIBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_SCIBillingChargingCharacteristics);
609 #.FN_BODY SCIGPRSBillingChargingCharacteristics VAL_PTR = ¶meter_tvb
610 tvbuff_t *parameter_tvb;
616 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_SCIGPRSBillingChargingCharacteristics);
617 dissect_camel_CAMEL_SCIGPRSBillingChargingCharacteristics(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_SCIGPRSBillingChargingCharacteristics);
619 #.FN_BODY CallResult VAL_PTR = ¶meter_tvb
620 tvbuff_t *parameter_tvb;
626 subtree = proto_item_add_subtree(actx->created_item, ett_camel_CAMEL_CallResult);
627 dissect_camel_CAMEL_CallResult(FALSE, parameter_tvb, 0, actx, subtree, hf_camel_CAMEL_CallResult);
629 # V3 and V4 incompatibillity bug #1719
630 #.FN_BODY CAMEL-AChBillingChargingCharacteristics/timeDurationCharging/audibleIndicator
631 if (tvb_length_remaining(tvb,offset) < 2)
632 offset = dissect_camel_BOOLEAN(TRUE, tvb, offset, actx , tree, hf_camel_audibleIndicatorTone);
636 #.FN_BODY CalledPartyBCDNumber VAL_PTR = ¶meter_tvb
637 /* See 3GPP TS 29.078
638 * and 3GPP TS 24.008, section 10.5.4.7
639 * Indicates the Called Party Number, including service selection information.
640 * Refer to 3GPP TS 24.008 [9] for encoding.
641 * This data type carries only the 'type of number', 'numbering plan
642 * identification' and 'number digit' fields defined in 3GPP TS 24.008 [9];
643 * it does not carry the 'called party BCD number IEI' or 'length of called
644 * party BCD number contents'.
645 * In the context of the DestinationSubscriberNumber field in ConnectSMSArg or
646 * InitialDPSMSArg, a CalledPartyBCDNumber may also contain an alphanumeric
647 * character string. In this case, type-of-number '101'B is used, in accordance
648 * with 3GPP TS 23.040 [6]. The address is coded in accordance with the
649 * GSM 7-bit default alphabet definition and the SMS packing rules
650 * as specified in 3GPP TS 23.038 [15] in this case.
652 tvbuff_t *parameter_tvb;
659 subtree = proto_item_add_subtree(actx->created_item, ett_camel_calledpartybcdnumber);
660 de_cld_party_bcd_num(parameter_tvb, subtree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
665 PDPTypeOrganization TYPE = FT_UINT8 DISPLAY = BASE_DEC BITMASK = 0x0f STRINGS = VALS(gsm_map_PDP_Type_Organisation_vals)
666 DateAndTime TYPE = FT_STRING DISPLAY = BASE_NONE
667 Code/local TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = VALS(camel_opr_code_strings)
668 ServiceInteractionIndicatorsTwo/holdTreatmentIndicator TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = VALS(camel_holdTreatmentIndicator_values)
669 ServiceInteractionIndicatorsTwo/cwTreatmentIndicator TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = VALS(camel_cwTreatmentIndicator_values)
670 ServiceInteractionIndicatorsTwo/ectTreatmentIndicator TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = VALS(camel_ectTreatmentIndicator_values)