comparison gsm-fw/g23m-gsm/cc/cc_cfk.c @ 689:8b1121359341

cc_cfk.c compiles
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 30 Sep 2014 01:20:27 +0000
parents 2f7df7a314f8
children
comparison
equal deleted inserted replaced
688:75488f27acdd 689:8b1121359341
20 */ 20 */
21 21
22 #ifndef CC_CFK_C 22 #ifndef CC_CFK_C
23 #define CC_CFK_C 23 #define CC_CFK_C
24 24
25 #include "config.h"
26 #include "fixedconf.h"
27 #include "condat-features.h"
28
25 #define ENTITY_CC 29 #define ENTITY_CC
26 /*==== INCLUDES ===================================================*/ 30 /*==== INCLUDES ===================================================*/
27 31
28 #include <string.h> 32 #include <string.h>
29 #include "typedefs.h" 33 #include "typedefs.h"
353 return FALSE; 357 return FALSE;
354 /*(subject to negotiation)*/ 358 /*(subject to negotiation)*/
355 if (bc1->v_fnur != bc2->v_fnur) 359 if (bc1->v_fnur != bc2->v_fnur)
356 return FALSE; 360 return FALSE;
357 361
358
359 if(bc1->v_fnur) 362 if(bc1->v_fnur)
360 { 363 {
361 /* 364 /*
362 * Octet 6e, Compare Existence and contents 365 * Octet 6e, Compare Existence and contents
363 */ 366 */
387 return FALSE; 390 return FALSE;
388 if (bc1->v_waiur AND (bc1->waiur != bc2->waiur)) 391 if (bc1->v_waiur AND (bc1->waiur != bc2->waiur))
389 return FALSE; 392 return FALSE;
390 } 393 }
391 394
392
393
394 /* 395 /*
395 * Octet 6g, Compare Existence and contents 396 * Octet 6g, Compare Existence and contents
396 */ 397 */
397 if (bc1->v_acc_ext_288 != bc2->v_acc_ext_288) 398 if (bc1->v_acc_ext_288 != bc2->v_acc_ext_288)
398 return FALSE; 399 return FALSE;
399 if (bc1->v_acc_ext_288 AND (bc1->acc_ext_288 != bc2->acc_ext_288)) 400 if (bc1->v_acc_ext_288 AND (bc1->acc_ext_288 != bc2->acc_ext_288))
400 return FALSE; 401 return FALSE;
401 if (bc1->v_acc_ext_320 != bc2->v_acc_ext_320) 402 if (bc1->v_acc_ext_320 != bc2->v_acc_ext_320)
402 return FALSE; 403 return FALSE;
403 if (bc1->v_acc_ext_320 AND (bc1->acc_ext_320 != bc2->acc_ext_320)) 404 if (bc1->v_acc_ext_320 AND (bc1->acc_ext_320 != bc2->acc_ext_320))
404 return FALSE; 405 return FALSE;
405 if (bc1->v_acc_ext_432 != bc2->v_acc_ext_432) 406 if (bc1->v_acc_ext_432 != bc2->v_acc_ext_432)
406 return FALSE; 407 return FALSE;
407 if (bc1->v_acc_ext_432 AND (bc1->acc_ext_432 != bc2->acc_ext_432)) 408 if (bc1->v_acc_ext_432 AND (bc1->acc_ext_432 != bc2->acc_ext_432))
408 return FALSE; 409 return FALSE;
409 410
410 if (bc1->v_ch_cod_asym != bc2->v_ch_cod_asym) 411 if (bc1->v_ch_cod_asym != bc2->v_ch_cod_asym)
411 return FALSE; 412 return FALSE;
412 if (bc1->v_ch_cod_asym AND (bc1->ch_cod_asym != bc2->ch_cod_asym)) 413 if (bc1->v_ch_cod_asym AND (bc1->ch_cod_asym != bc2->ch_cod_asym))
413 return FALSE; 414 return FALSE;
414 } 415 }
415 416
416 #endif 417 #endif
417 418
418 /* 419 /*
428 (bc1->user_inf_l2_prot NEQ bc2->user_inf_l2_prot)) 429 (bc1->user_inf_l2_prot NEQ bc2->user_inf_l2_prot))
429 return FALSE; 430 return FALSE;
430 431
431 return TRUE; 432 return TRUE;
432 } 433 }
433
434 434
435 435
436 /* 436 /*
437 +--------------------------------------------------------------------+ 437 +--------------------------------------------------------------------+
438 | PROJECT : GSM-PS (6147) MODULE : CC_CFK | 438 | PROJECT : GSM-PS (6147) MODULE : CC_CFK |
506 default: 506 default:
507 TRACE_ERROR ("Unexpected bearer_serv"); 507 TRACE_ERROR ("Unexpected bearer_serv");
508 break; 508 break;
509 } 509 }
510 } 510 }
511
512 511
513 512
514 /* 513 /*
515 +--------------------------------------------------------------------+ 514 +--------------------------------------------------------------------+
516 | PROJECT : GSM-PS (6147) MODULE : CC_CFK | 515 | PROJECT : GSM-PS (6147) MODULE : CC_CFK |
1604 if (cc_data->active_service EQ cc_data->neg_serv1) 1603 if (cc_data->active_service EQ cc_data->neg_serv1)
1605 modify_com->bearer_cap = cc_data->neg_bc1; 1604 modify_com->bearer_cap = cc_data->neg_bc1;
1606 else 1605 else
1607 modify_com->bearer_cap = cc_data->neg_bc2; 1606 modify_com->bearer_cap = cc_data->neg_bc2;
1608 1607
1609
1610 if (cc_data->call_type [cc_data->index_ti] EQ CALL_TYPE_MTC) 1608 if (cc_data->call_type [cc_data->index_ti] EQ CALL_TYPE_MTC)
1611 { 1609 {
1612 modify_com->v_reverse_call = TRUE; 1610 modify_com->v_reverse_call = TRUE;
1613 modify_com->v_low_layer_comp = FALSE; 1611 modify_com->v_low_layer_comp = FALSE;
1614 } 1612 }
1685 GLOBAL void cc_build_release (T_U_RELEASE * release, 1683 GLOBAL void cc_build_release (T_U_RELEASE * release,
1686 USHORT cause, 1684 USHORT cause,
1687 const T_NAS_fac_inf * fac_inf, 1685 const T_NAS_fac_inf * fac_inf,
1688 UBYTE ss_ver) 1686 UBYTE ss_ver)
1689 { 1687 {
1690 1688
1691 TRACE_FUNCTION ("cc_build_release()"); 1689 TRACE_FUNCTION ("cc_build_release()");
1692 1690
1693 release->msg_type = U_RELEASE; 1691 release->msg_type = U_RELEASE;
1694 if (IS_CAUSE_INVALID(cause)) 1692 if (IS_CAUSE_INVALID(cause))
1695 { 1693 {
2240 } /* switch (repeat) */ 2238 } /* switch (repeat) */
2241 2239
2242 }/* cc_check_ms_cap_repeat_indicator_support */ 2240 }/* cc_check_ms_cap_repeat_indicator_support */
2243 2241
2244 2242
2245
2246 /* 2243 /*
2247 +--------------------------------------------------------------------+ 2244 +--------------------------------------------------------------------+
2248 | PROJECT : GSM-PS (6147) MODULE : CC_CFK | 2245 | PROJECT : GSM-PS (6147) MODULE : CC_CFK |
2249 | STATE : code ROUTINE : cc_compatibility_check | 2246 | STATE : code ROUTINE : cc_compatibility_check |
2250 +--------------------------------------------------------------------+ 2247 +--------------------------------------------------------------------+
2269 2266
2270 cc_data->neg_serv2 = NOT_PRESENT_8BIT; 2267 cc_data->neg_serv2 = NOT_PRESENT_8BIT;
2271 memset (&cc_data->neg_bcpara2, 0, sizeof (T_MNCC_bcpara)); 2268 memset (&cc_data->neg_bcpara2, 0, sizeof (T_MNCC_bcpara));
2272 cc_data->neg_bcpara2.bearer_serv = NOT_PRESENT_8BIT; 2269 cc_data->neg_bcpara2.bearer_serv = NOT_PRESENT_8BIT;
2273 cc_data->neg_ri = NOT_PRESENT_8BIT; 2270 cc_data->neg_ri = NOT_PRESENT_8BIT;
2274
2275
2276 2271
2277 if (setup->v_bearer_cap) 2272 if (setup->v_bearer_cap)
2278 { 2273 {
2279 if (cc_check_bc (&setup->bearer_cap, 2274 if (cc_check_bc (&setup->bearer_cap,
2280 &cc_data->neg_bc1, 2275 &cc_data->neg_bc1,
2563 if (cc_check_bc (&setup->bearer_cap, 2558 if (cc_check_bc (&setup->bearer_cap,
2564 &cc_data->bc1, /* Not used */ 2559 &cc_data->bc1, /* Not used */
2565 &cc_data->bcpara1, 2560 &cc_data->bcpara1,
2566 &cc_data->serv1, /* Not used */ 2561 &cc_data->serv1, /* Not used */
2567 &cc_data->negotiation) /* Not used */ 2562 &cc_data->negotiation) /* Not used */
2568 EQ ERROR) 2563 EQ ERROR)
2569 return ERROR; /* Not expected to catch */ 2564 return ERROR; /* Not expected to catch */
2570 2565
2571 if (!cc_check_capabilities (&cc_data->bcpara1)) 2566 if (!cc_check_capabilities (&cc_data->bcpara1))
2572 return ERROR; /* Not expected to catch */ 2567 return ERROR; /* Not expected to catch */
2573 2568
2574 cc_build_bc (&cc_data->bc1, &cc_data->serv1, &cc_data->bcpara1); 2569 cc_build_bc (&cc_data->bc1, &cc_data->serv1, &cc_data->bcpara1);
2575 setup->bearer_cap = cc_data->bc1; /* Struct copy */ 2570 setup->bearer_cap = cc_data->bc1; /* Struct copy */
2583 if (cc_check_bc ((T_M_CC_bearer_cap *)&setup->bearer_cap_2, 2578 if (cc_check_bc ((T_M_CC_bearer_cap *)&setup->bearer_cap_2,
2584 &cc_data->bc2, /* Not used */ 2579 &cc_data->bc2, /* Not used */
2585 &cc_data->bcpara2, 2580 &cc_data->bcpara2,
2586 &cc_data->serv2, /* Not used */ 2581 &cc_data->serv2, /* Not used */
2587 &cc_data->negotiation) 2582 &cc_data->negotiation)
2588 EQ ERROR) 2583 EQ ERROR)
2589 return ERROR; /* Bearer caps 2 incompatible */ 2584 return ERROR; /* Bearer caps 2 incompatible */
2590 if (!cc_check_capabilities (&cc_data->bcpara2)) 2585 if (!cc_check_capabilities (&cc_data->bcpara2))
2591 return ERROR; /* Not expected to catch */ 2586 return ERROR; /* Not expected to catch */
2592 2587
2593 cc_build_bc (&cc_data->bc2, &cc_data->serv2, &cc_data->bcpara2); 2588 cc_build_bc (&cc_data->bc2, &cc_data->serv2, &cc_data->bcpara2);
2865 bcpara->bearer_serv = MNCC_BEARER_SERV_SPEECH; 2860 bcpara->bearer_serv = MNCC_BEARER_SERV_SPEECH;
2866 2861
2867 break; 2862 break;
2868 } 2863 }
2869 case M_CC_ITC_AUXILIARY_SPEECH: 2864 case M_CC_ITC_AUXILIARY_SPEECH:
2870 /* 2865 /*
2871 * Speech bearer capability for alternate line service 2866 * Speech bearer capability for alternate line service
2872 */ 2867 */
2873 { 2868 {
2874 bcpara->bearer_serv = MNCC_BEARER_SERV_AUX_SPEECH; 2869 bcpara->bearer_serv = MNCC_BEARER_SERV_AUX_SPEECH;
2875 2870
2876 break; 2871 break;
2877 } 2872 }
3105 cc_data->active_service = cc_data->serv1; 3100 cc_data->active_service = cc_data->serv1;
3106 return OKAY; 3101 return OKAY;
3107 } 3102 }
3108 3103
3109 3104
3110
3111 #ifndef NTRACE 3105 #ifndef NTRACE
3112 /* 3106 /*
3113 +--------------------------------------------------------------------+ 3107 +--------------------------------------------------------------------+
3114 | PROJECT : GSM-PS (6147) MODULE : CC_CFK | 3108 | PROJECT : GSM-PS (6147) MODULE : CC_CFK |
3115 | STATE : code ROUTINE : cc_trace_state | 3109 | STATE : code ROUTINE : cc_trace_state |
3356 { 3350 {
3357 /* 3351 /*
3358 * check only if transparent M_CC_ASYNCHRONOUS data services are supported 3352 * check only if transparent M_CC_ASYNCHRONOUS data services are supported
3359 */ 3353 */
3360 if (bearer_cap->sync_async NEQ M_CC_ASYNCHRONOUS OR 3354 if (bearer_cap->sync_async NEQ M_CC_ASYNCHRONOUS OR
3361 bearer_cap->sig_access_prot NEQ M_CC_SIAP_I440) /* no async service */ 3355 bearer_cap->sig_access_prot NEQ M_CC_SIAP_I440) /* no async service */
3362 return; 3356 return;
3363 switch (bearer_cap->conn_elem) 3357 switch (bearer_cap->conn_elem)
3364 { 3358 {
3365 case M_CC_CE_TRANSPA: 3359 case M_CC_CE_TRANSPA:
3366 neg_bearer_cap->compress = M_CC_COMP_NO; 3360 neg_bearer_cap->compress = M_CC_COMP_NO;
3367 break; 3361 break;
3368 case M_CC_CE_TRANSPA_PREF: /* set to trans async */ 3362 case M_CC_CE_TRANSPA_PREF: /* set to trans async */
3369 case M_CC_CE_RLP_PREF: 3363 case M_CC_CE_RLP_PREF:
3370 *negotiation = TRUE; 3364 *negotiation = TRUE;
3371 neg_bearer_cap->conn_elem = M_CC_CE_TRANSPA; 3365 neg_bearer_cap->conn_elem = M_CC_CE_TRANSPA;
3372 neg_bearer_cap->structure = M_CC_STRC_UNSTRUCTURED; 3366 neg_bearer_cap->structure = M_CC_STRC_UNSTRUCTURED;
3373 neg_bearer_cap->compress = M_CC_COMP_NO; 3367 neg_bearer_cap->compress = M_CC_COMP_NO;
3461 { 3455 {
3462 /* 3456 /*
3463 * check only if non-transparent M_CC_ASYNCHRONOUS data services are supported 3457 * check only if non-transparent M_CC_ASYNCHRONOUS data services are supported
3464 */ 3458 */
3465 if (bearer_cap->sync_async NEQ M_CC_ASYNCHRONOUS OR 3459 if (bearer_cap->sync_async NEQ M_CC_ASYNCHRONOUS OR
3466 bearer_cap->sig_access_prot NEQ M_CC_SIAP_I440) /* no async service */ 3460 bearer_cap->sig_access_prot NEQ M_CC_SIAP_I440) /* no async service */
3467 return; 3461 return;
3468 switch (bearer_cap->conn_elem) 3462 switch (bearer_cap->conn_elem)
3469 { 3463 {
3470 case M_CC_CE_RLP: 3464 case M_CC_CE_RLP:
3471 break; 3465 break;
3472 3466
3473 case M_CC_CE_RLP_PREF: /* set to non-trans async */ 3467 case M_CC_CE_RLP_PREF: /* set to non-trans async */
3474 case M_CC_CE_TRANSPA_PREF: 3468 case M_CC_CE_TRANSPA_PREF:
3475 *negotiation = TRUE; 3469 *negotiation = TRUE;
3476 neg_bearer_cap->conn_elem = M_CC_CE_RLP; 3470 neg_bearer_cap->conn_elem = M_CC_CE_RLP;
3477 neg_bearer_cap->structure = M_CC_STRC_SERV_DATA_INTEG; 3471 neg_bearer_cap->structure = M_CC_STRC_SERV_DATA_INTEG;
3478 /* 3472 /*
3483 neg_bearer_cap->intermed_rate = M_CC_IR_8_KBIT; 3477 neg_bearer_cap->intermed_rate = M_CC_IR_8_KBIT;
3484 else 3478 else
3485 neg_bearer_cap->intermed_rate = M_CC_IR_16_KBIT; 3479 neg_bearer_cap->intermed_rate = M_CC_IR_16_KBIT;
3486 break; 3480 break;
3487 3481
3488 case M_CC_CE_TRANSPA: /* transparent service */ 3482 case M_CC_CE_TRANSPA: /* transparent service */
3489 return; 3483 return;
3490 3484
3491 default: 3485 default:
3492 return; 3486 return;
3493 } 3487 }
3551 /* 3545 /*
3552 * check only if transparent fax services are supported 3546 * check only if transparent fax services are supported
3553 */ 3547 */
3554 3548
3555 if (bearer_cap->sync_async NEQ M_CC_SYNCHRONOUS OR 3549 if (bearer_cap->sync_async NEQ M_CC_SYNCHRONOUS OR
3556 bearer_cap->sig_access_prot NEQ M_CC_SIAP_I440) /* no async service */ 3550 bearer_cap->sig_access_prot NEQ M_CC_SIAP_I440) /* no async service */
3557 return FALSE; 3551 return FALSE;
3558 3552
3559 switch (bearer_cap->conn_elem) 3553 switch (bearer_cap->conn_elem)
3560 { 3554 {
3561 case M_CC_CE_TRANSPA: 3555 case M_CC_CE_TRANSPA:
3562 break; 3556 break;
3563 3557
3564 case M_CC_CE_TRANSPA_PREF: /* set to trans async */ 3558 case M_CC_CE_TRANSPA_PREF: /* set to trans async */
3565 case M_CC_CE_RLP_PREF: 3559 case M_CC_CE_RLP_PREF:
3566 *negotiation = TRUE; 3560 *negotiation = TRUE;
3567 neg_bearer_cap->conn_elem = M_CC_CE_TRANSPA; 3561 neg_bearer_cap->conn_elem = M_CC_CE_TRANSPA;
3568 neg_bearer_cap->structure = M_CC_STRC_UNSTRUCTURED; 3562 neg_bearer_cap->structure = M_CC_STRC_UNSTRUCTURED;
3569 if ((bearer_cap->user_rate EQ M_CC_UR_9_6_KBIT) OR 3563 if ((bearer_cap->user_rate EQ M_CC_UR_9_6_KBIT) OR
3574 neg_bearer_cap->v_l2_ident = FALSE; 3568 neg_bearer_cap->v_l2_ident = FALSE;
3575 neg_bearer_cap->v_user_inf_l2_prot = FALSE; 3569 neg_bearer_cap->v_user_inf_l2_prot = FALSE;
3576 break; 3570 break;
3577 3571
3578 3572
3579 case M_CC_CE_RLP: /* non-transparent service */ 3573 case M_CC_CE_RLP: /* non-transparent service */
3580 default: 3574 default:
3581 return FALSE; 3575 return FALSE;
3582 } 3576 }
3583 3577
3584 /* 3578 /*
3633 PURPOSE : Forwards a facility information element to the upper layer 3627 PURPOSE : Forwards a facility information element to the upper layer
3634 if available. 3628 if available.
3635 3629
3636 */ 3630 */
3637 3631
3638
3639
3640 GLOBAL void cc_build_facility_ind (UBYTE context, 3632 GLOBAL void cc_build_facility_ind (UBYTE context,
3641 UBYTE valid, 3633 UBYTE valid,
3642 const T_M_CC_facility * facility ) 3634 const T_M_CC_facility * facility )
3643 { 3635 {
3644 GET_INSTANCE_DATA; 3636 GET_INSTANCE_DATA;
3668 3660
3669 PURPOSE : Forwards a user user information element to the upper layer 3661 PURPOSE : Forwards a user user information element to the upper layer
3670 if available. 3662 if available.
3671 3663
3672 */ 3664 */
3673
3674 3665
3675 GLOBAL void cc_build_user_user_ind (UBYTE context, 3666 GLOBAL void cc_build_user_user_ind (UBYTE context,
3676 UBYTE valid, 3667 UBYTE valid,
3677 T_M_CC_user_user * user_user ) 3668 T_M_CC_user_user * user_user )
3678 { 3669 {
3801 * Check requested upper layer capabilities 3792 * Check requested upper layer capabilities
3802 * against mobile station capabilities 3793 * against mobile station capabilities
3803 */ 3794 */
3804 if (cc_check_capabilities (bcpara) EQ FALSE) 3795 if (cc_check_capabilities (bcpara) EQ FALSE)
3805 { 3796 {
3806 /* MS doesn´t support the requested services */ 3797 /* MS doesn't support the requested services */
3807 return ERROR; 3798 return ERROR;
3808 } 3799 }
3809 3800
3810 cc_build_bc (&bearer_cap, 3801 cc_build_bc (&bearer_cap,
3811 &dummy_service, /* Not used */ 3802 &dummy_service, /* Not used */
4129 UBYTE ss_diag = MNCC_SS_DIAG_NOT_PROVIDED; /* holds the ss diagnostic */ 4120 UBYTE ss_diag = MNCC_SS_DIAG_NOT_PROVIDED; /* holds the ss diagnostic */
4130 4121
4131 TRACE_FUNCTION ("cc_get_ss_diag()"); 4122 TRACE_FUNCTION ("cc_get_ss_diag()");
4132 4123
4133 /* 4124 /*
4134 * Only the following causes may also provide a supplementary diagnostic value 4125 * Only the following causes may also provide a supplementary diagnostic value
4135 * - cause 17: User busy - MNCC_CAUSE_USER_BUSY 4126 * - cause 17: User busy - MNCC_CAUSE_USER_BUSY
4136 * - cause 29: Facility rejected - MNCC_CAUSE_FACILITY_REJECT 4127 * - cause 29: Facility rejected - MNCC_CAUSE_FACILITY_REJECT
4137 * - cause 34: No circuit/channel available - MNCC_CAUSE_NO_CHAN_AVAIL 4128 * - cause 34: No circuit/channel available - MNCC_CAUSE_NO_CHAN_AVAIL
4138 * - cause 50: Requested facility not subscribed - MNCC_CAUSE_FACILITY_UNSUBSCRIB 4129 * - cause 50: Requested facility not subscribed - MNCC_CAUSE_FACILITY_UNSUBSCRIB
4139 * - cause 55: Incoming call barred within the CUG - MNCC_CAUSE_BARRED_IN_CUG 4130 * - cause 55: Incoming call barred within the CUG - MNCC_CAUSE_BARRED_IN_CUG
4167 /* force MNCC_SS_DIAG_NOT_PROVIDED return */ 4158 /* force MNCC_SS_DIAG_NOT_PROVIDED return */
4168 break; 4159 break;
4169 } /* end of switch (curr_cause) */ 4160 } /* end of switch (curr_cause) */
4170 4161
4171 return ss_diag; 4162 return ss_diag;
4172 4163 }
4173 } 4164
4174 /* 4165 /*
4175 +--------------------------------------------------------------------+ 4166 +--------------------------------------------------------------------+
4176 | PROJECT : GSM-PS (6147) MODULE : CC_CFK | 4167 | PROJECT : GSM-PS (6147) MODULE : CC_CFK |
4177 | STATE : code ROUTINE : cc_build_cause | 4168 | STATE : code ROUTINE : cc_build_cause |
4178 +--------------------------------------------------------------------+ 4169 +--------------------------------------------------------------------+