Use (std) bool instead of custom bool types

OAI is riddled with boolean_t, FALSE, TRUE, etc. This makes no sense, as
there is a standard bool type, and could lead to nasty bugs if a
definition of a bool is non-standard (0 == false, true == !false). This
commit removes all non-standard bools in the whole project.
This commit is contained in:
Robert Schmidt
2022-06-27 10:07:48 +02:00
parent 6d030ea2fa
commit 0b91791f67
176 changed files with 1414 additions and 1573 deletions
+18 -18
View File
@@ -146,7 +146,7 @@ int emm_proc_attach(nas_user_t *user, emm_proc_attach_type_t type)
/* Update the emergency bearer service indicator */
if (type == EMM_ATTACH_TYPE_EMERGENCY) {
user->emm_data->is_emergency = TRUE;
user->emm_data->is_emergency = true;
}
/* Setup initial NAS information message to transfer */
@@ -211,7 +211,7 @@ int emm_proc_attach(nas_user_t *user, emm_proc_attach_type_t type)
}
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_as->sctx, user->emm_data->security, FALSE, FALSE);
emm_as_set_security_data(&emm_as->sctx, user->emm_data->security, false, false);
emm_as->ksi = EMM_AS_NO_KEY_AVAILABLE;
if (user->emm_data->security) {
@@ -230,8 +230,8 @@ int emm_proc_attach(nas_user_t *user, emm_proc_attach_type_t type)
* is requested to setup a default EPS bearer
*/
esm_sap.primitive = ESM_PDN_CONNECTIVITY_REQ;
esm_sap.is_standalone = FALSE;
esm_sap.data.pdn_connect.is_defined = TRUE;
esm_sap.is_standalone = false;
esm_sap.data.pdn_connect.is_defined = true;
esm_sap.data.pdn_connect.cid = 1;
/* TODO: PDN type should be set according to the IP capability of the UE */
esm_sap.data.pdn_connect.pdn_type = NET_PDN_TYPE_IPV4;
@@ -387,7 +387,7 @@ int emm_proc_attach_accept(nas_user_t *user, long t3412, long t3402, long t3423,
if (n_eplmns > 0) {
for (i = 0; (i < n_eplmns) && (i < EMM_DATA_EPLMN_MAX); i++) {
int is_forbidden = FALSE;
bool is_forbidden = false;
if (!user->emm_data->is_emergency) {
/* If the attach procedure is not for emergency bearer
@@ -395,7 +395,7 @@ int emm_proc_attach_accept(nas_user_t *user, long t3412, long t3402, long t3423,
* code that is already in the list of forbidden PLMNs */
for (j = 0; j < user->emm_data->fplmn.n_plmns; j++) {
if (PLMNS_ARE_EQUAL(eplmn[i], user->emm_data->fplmn.plmn[j])) {
is_forbidden = TRUE;
is_forbidden = true;
break;
}
}
@@ -418,7 +418,7 @@ int emm_proc_attach_accept(nas_user_t *user, long t3412, long t3402, long t3423,
* Notify ESM that a default EPS bearer has to be activated
*/
esm_sap.primitive = ESM_DEFAULT_EPS_BEARER_CONTEXT_ACTIVATE_REQ;
esm_sap.is_standalone = FALSE;
esm_sap.is_standalone = false;
esm_sap.recv = esm_msg_pP;
rc = esm_sap_send(user, &esm_sap);
@@ -445,7 +445,7 @@ int emm_proc_attach_accept(nas_user_t *user, long t3412, long t3402, long t3423,
emm_sap.u.emm_as.u.data.ueid = user->ueid;
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_sap.u.emm_as.u.data.sctx,
user->emm_data->security, FALSE, TRUE);
user->emm_data->security, false, true);
/* Get the activate default EPS bearer context accept message
* to be transfered within the ESM container of the attach
* complete message */
@@ -546,7 +546,7 @@ int emm_proc_attach_reject(nas_user_t *user, int emm_cause, const OctetString *e
case EMM_CAUSE_EPS_NOT_ALLOWED:
case EMM_CAUSE_BOTH_NOT_ALLOWED:
/* Consider the USIM as invalid for EPS services */
user->emm_data->usim_is_valid = FALSE;
user->emm_data->usim_is_valid = false;
/* Delete the list of equivalent PLMNs */
user->emm_data->nvdata.eplmn.n_plmns = 0;
break;
@@ -682,7 +682,7 @@ int emm_proc_attach_reject(nas_user_t *user, int emm_cause, const OctetString *e
if (esm_msg_pP != NULL) {
esm_sap_t esm_sap;
esm_sap.primitive = ESM_PDN_CONNECTIVITY_REJ;
esm_sap.is_standalone = FALSE;
esm_sap.is_standalone = false;
esm_sap.recv = esm_msg_pP;
rc = esm_sap_send(user, &esm_sap);
}
@@ -731,7 +731,7 @@ int emm_proc_attach_complete(void *args)
/* Set the EPS update status to EU1 UPDATED */
user->emm_data->status = EU1_UPDATED;
user->emm_data->is_attached = TRUE;
user->emm_data->is_attached = true;
/*
* Notify EMM that network attach complete message has been delivered
@@ -747,7 +747,7 @@ int emm_proc_attach_complete(void *args)
* Complete message
*/
esm_sap.primitive = ESM_DEFAULT_EPS_BEARER_CONTEXT_ACTIVATE_CNF;
esm_sap.is_standalone = FALSE;
esm_sap.is_standalone = false;
rc = esm_sap_send(user, &esm_sap);
}
@@ -766,7 +766,7 @@ int emm_proc_attach_complete(void *args)
** The UE shall restart the attach procedure when timer **
** T3411 expires. **
** **
** Inputs: is_initial: TRUE if the NAS message that failed to be **
** Inputs: is_initial: true if the NAS message that failed to be **
** transfered is an initial NAS message (ESM **
** message embedded within an Attach Request **
** message) **
@@ -778,7 +778,7 @@ int emm_proc_attach_complete(void *args)
** Others: T3410, T3411 **
** **
***************************************************************************/
int emm_proc_attach_failure(int is_initial, void *args)
int emm_proc_attach_failure(bool is_initial, void *args)
{
LOG_FUNC_IN;
int rc = RETURNok;
@@ -804,7 +804,7 @@ int emm_proc_attach_failure(int is_initial, void *args)
* to be transmitted
*/
esm_sap.primitive = ESM_PDN_CONNECTIVITY_REJ;
esm_sap.is_standalone = FALSE;
esm_sap.is_standalone = false;
esm_sap.recv = NULL;
} else {
/*
@@ -813,7 +813,7 @@ int emm_proc_attach_failure(int is_initial, void *args)
* has failed to be transmitted
*/
esm_sap.primitive = ESM_DEFAULT_EPS_BEARER_CONTEXT_ACTIVATE_REJ;
esm_sap.is_standalone = FALSE;
esm_sap.is_standalone = false;
esm_sap.recv = NULL;
}
@@ -919,7 +919,7 @@ int emm_proc_attach_set_emergency(emm_data_t *emm_data)
LOG_TRACE(WARNING, "EMM-PROC - UE is now attached to the network for "
"emergency bearer services only");
emm_data->is_emergency = TRUE;
emm_data->is_emergency = true;
LOG_FUNC_RETURN(RETURNok);
}
@@ -950,7 +950,7 @@ int emm_proc_attach_set_detach(void *nas_user)
"EMM-PROC - UE is now locally detached from the network");
/* Reset the network attachment indicator */
user->emm_data->is_attached = FALSE;
user->emm_data->is_attached = false;
/*
* Notify that the UE is locally detached from the network
*/
+6 -6
View File
@@ -129,7 +129,7 @@ static int _authentication_kasme(const OctetString *autn,
** authentication challenge data and respond with an AUTHEN- **
** TICATION RESPONSE message to the network. **
** **
** Inputs: native_ksi: TRUE if the security context is of type **
** Inputs: native_ksi: true if the security context is of type **
** native (for KSIASME) **
** ksi: The NAS ket sey identifier **
** rand: Authentication parameter RAND **
@@ -179,14 +179,14 @@ int emm_proc_authentication_request(nas_user_t *user, int native_ksi, int ksi,
OctetString res = {AUTH_RES_SIZE, authentication_data->res};
if ((memcmp(authentication_data->rand, rand->value, AUTH_CK_SIZE) != 0) ||
(authentication_data->auth_process_started == FALSE)) {
(authentication_data->auth_process_started == false)) {
/*
* There is no valid stored RAND in the ME or the stored RAND is
* different from the new received value in the AUTHENTICATION
* REQUEST message OR if this is first time UE starting the
* Authentication process
*/
authentication_data->auth_process_started = TRUE;
authentication_data->auth_process_started = true;
OctetString auts;
auts.length = 0;
auts.value = (uint8_t *)malloc(AUTH_AUTS_SIZE);
@@ -308,7 +308,7 @@ int emm_proc_authentication_request(nas_user_t *user, int native_ksi, int ksi,
emm_sap.u.emm_as.u.security.res = &res;
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_sap.u.emm_as.u.security.sctx,
user->emm_data->security, FALSE, TRUE);
user->emm_data->security, false, true);
rc = emm_sap_send(user, &emm_sap);
if (rc != RETURNerror) {
@@ -398,7 +398,7 @@ int emm_proc_authentication_reject(nas_user_t *user)
}
/* Consider the USIM invalid */
user->emm_data->usim_is_valid = FALSE;
user->emm_data->usim_is_valid = false;
/* Stop timer T3410 */
if (emm_timers->T3410.id != NAS_TIMER_INACTIVE_ID) {
@@ -652,7 +652,7 @@ static int _authentication_abnormal_cases_cde(nas_user_t *user, int emm_cause,
emm_sap.u.emm_as.u.security.auts = auts;
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_sap.u.emm_as.u.security.sctx,
user->emm_data->security, FALSE, TRUE);
user->emm_data->security, false, true);
rc = emm_sap_send(user, &emm_sap);
if (rc != RETURNerror) {
+4 -5
View File
@@ -114,7 +114,7 @@ static int _emm_detach_abort(nas_user_t *user, emm_proc_detach_type_t type);
** Return: RETURNok, RETURNerror **
** **
***************************************************************************/
int emm_proc_detach(nas_user_t *user, emm_proc_detach_type_t type, int switch_off)
int emm_proc_detach(nas_user_t *user, emm_proc_detach_type_t type, bool switch_off)
{
LOG_FUNC_IN;
@@ -154,7 +154,7 @@ int emm_proc_detach(nas_user_t *user, emm_proc_detach_type_t type, int switch_of
emm_as->guti = user->emm_data->guti;
emm_as->ueid = user->ueid;
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_as->sctx, user->emm_data->security, FALSE, TRUE);
emm_as_set_security_data(&emm_as->sctx, user->emm_data->security, false, true);
/*
* Notify EMM-AS SAP that Detach Request message has to
@@ -280,7 +280,7 @@ int emm_proc_detach_accept(void* args)
** Others: None **
** **
***************************************************************************/
int emm_proc_detach_failure(int is_initial, void *args)
int emm_proc_detach_failure(bool is_initial, void *args)
{
LOG_FUNC_IN;
@@ -405,8 +405,7 @@ void *emm_detach_t3421_handler(void *args)
emm_as->guti = user->emm_data->guti;
emm_as->ueid = user->ueid;
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_as->sctx, user->emm_data->security,
FALSE, TRUE);
emm_as_set_security_data(&emm_as->sctx, user->emm_data->security, false, true);
/*
* Notify EMM-AS SAP that Detach Request message has to
+1 -2
View File
@@ -137,8 +137,7 @@ int emm_proc_status(nas_user_t *user, int emm_cause)
emm_sap.u.emm_as.u.status.guti = user->emm_data->guti;
sctx = user->emm_data->security;
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_sap.u.emm_as.u.status.sctx, sctx,
FALSE, TRUE);
emm_as_set_security_data(&emm_sap.u.emm_as.u.status.sctx, sctx, false, true);
rc = emm_sap_send(user, &emm_sap);
+1 -2
View File
@@ -199,8 +199,7 @@ int emm_proc_identification_request(nas_user_t *user, emm_proc_identity_type_t t
emm_sap.u.emm_as.u.security.ueid = user->ueid;
emm_sap.u.emm_as.u.security.msgType = EMM_AS_MSG_TYPE_IDENT;
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_sap.u.emm_as.u.security.sctx,
user->emm_data->security, FALSE, TRUE);
emm_as_set_security_data(&emm_sap.u.emm_as.u.security.sctx, user->emm_data->security, false, true);
rc = emm_sap_send(user, &emm_sap);
LOG_FUNC_RETURN (rc);
+14 -14
View File
@@ -663,8 +663,8 @@ int emm_proc_plmn_selection(nas_user_t *user, int index)
** to camp on an acceptable cell, irrespective of its PLMN **
** identity, so that only emergency calls can be made. **
** **
** Inputs: found: TRUE if a suitable cell of the chosen **
** PLMN has been found; FALSE otherwise. **
** Inputs: found: true if a suitable cell of the chosen **
** PLMN has been found; false otherwise. **
** tac: The code of the location/tracking area the **
** chosen PLMN belongs to **
** ci: The identifier of the cell **
@@ -685,7 +685,7 @@ int emm_proc_plmn_selection_end(nas_user_t *user, int found, tac_t tac, ci_t ci,
emm_plmn_list_t *emm_plmn_list = user->emm_plmn_list;
user_api_id_t *user_api_id = user->user_api_id;
int index = emm_plmn_list->index;
int select_next_plmn = FALSE;
bool select_next_plmn = false;
LOG_TRACE(INFO, "EMM-IDLE - %s cell found for PLMN %d in %s mode",
(found)? "One" : "No", index,
@@ -694,7 +694,7 @@ int emm_proc_plmn_selection_end(nas_user_t *user, int found, tac_t tac, ci_t ci,
"Automatic/manual");
if (found) {
int is_forbidden = FALSE;
bool is_forbidden = false;
/* Select the PLMN of which a suitable cell has been found */
emm_data->splmn = *emm_plmn_list->plmn[index];
@@ -721,7 +721,7 @@ int emm_proc_plmn_selection_end(nas_user_t *user, int found, tac_t tac, ci_t ci,
/* Check if the selected PLMN is in the forbidden list */
for (i = 0; i < emm_data->fplmn.n_plmns; i++) {
if (PLMNS_ARE_EQUAL(emm_data->splmn, emm_data->fplmn.plmn[i])) {
is_forbidden = TRUE;
is_forbidden = true;
break;
}
}
@@ -730,7 +730,7 @@ int emm_proc_plmn_selection_end(nas_user_t *user, int found, tac_t tac, ci_t ci,
for (i = 0; i < emm_data->fplmn_gprs.n_plmns; i++) {
if (PLMNS_ARE_EQUAL(emm_data->splmn,
emm_data->fplmn_gprs.plmn[i])) {
is_forbidden = TRUE;
is_forbidden = true;
break;
}
}
@@ -745,7 +745,7 @@ int emm_proc_plmn_selection_end(nas_user_t *user, int found, tac_t tac, ci_t ci,
if (!is_forbidden) {
for (i = 0; i < emm_data->ftai.n_tais; i++) {
if (TAIS_ARE_EQUAL(tai, emm_data->ftai.tai[i])) {
is_forbidden = TRUE;
is_forbidden = true;
break;
}
}
@@ -754,7 +754,7 @@ int emm_proc_plmn_selection_end(nas_user_t *user, int found, tac_t tac, ci_t ci,
if (!is_forbidden) {
for (i = 0; i < emm_data->ftai_roaming.n_tais; i++) {
if (TAIS_ARE_EQUAL(tai, emm_data->ftai_roaming.tai[i])) {
is_forbidden = TRUE;
is_forbidden = true;
break;
}
}
@@ -793,7 +793,7 @@ int emm_proc_plmn_selection_end(nas_user_t *user, int found, tac_t tac, ci_t ci,
* Try to select the next PLMN in the ordered list of available PLMNs
*/
index += 1;
select_next_plmn = TRUE;
select_next_plmn = true;
/* Bypass the previously selected PLMN */
if (index == emm_plmn_list->splmn) {
@@ -809,7 +809,7 @@ int emm_proc_plmn_selection_end(nas_user_t *user, int found, tac_t tac, ci_t ci,
* registered or equivalent PLMNs is ongoing
*/
index += 1;
select_next_plmn = TRUE;
select_next_plmn = true;
}
else if (emm_data->plmn_mode == EMM_DATA_PLMN_MANUAL) {
@@ -830,7 +830,7 @@ int emm_proc_plmn_selection_end(nas_user_t *user, int found, tac_t tac, ci_t ci,
*/
emm_data->plmn_mode = EMM_DATA_PLMN_AUTO;
index = emm_plmn_list->hplmn;
select_next_plmn = TRUE;
select_next_plmn = true;
}
/*
@@ -851,7 +851,7 @@ int emm_proc_plmn_selection_end(nas_user_t *user, int found, tac_t tac, ci_t ci,
} else {
/* No suitable cell of any PLMN within the ordered list
* of available PLMNs has been found */
select_next_plmn = FALSE;
select_next_plmn = false;
emm_sap.primitive = EMMREG_NO_CELL;
}
}
@@ -892,11 +892,11 @@ int emm_proc_plmn_selection_end(nas_user_t *user, int found, tac_t tac, ci_t ci,
if (emm_plmn_list->splmn == emm_plmn_list->rplmn) {
/* The selected PLMN is the registered PLMN */
LOG_TRACE(INFO, "EMM-IDLE - The selected PLMN is the registered PLMN");
emm_data->is_rplmn = TRUE;
emm_data->is_rplmn = true;
} else if (emm_plmn_list->splmn < emm_plmn_list->hplmn) {
/* The selected PLMN is in the list of equivalent PLMNs */
LOG_TRACE(INFO, "EMM-IDLE - The selected PLMN is in the list of equivalent PLMNs");
emm_data->is_eplmn = TRUE;
emm_data->is_eplmn = true;
}
/*
+4 -4
View File
@@ -208,7 +208,7 @@ int lowerlayer_data_ind(nas_user_t *user, const OctetString *data)
LOG_FUNC_IN;
esm_sap.primitive = ESM_UNITDATA_IND;
esm_sap.is_standalone = TRUE;
esm_sap.is_standalone = true;
esm_sap.ueid = user->ueid;
esm_sap.recv = data;
@@ -250,7 +250,7 @@ int lowerlayer_data_req(nas_user_t *user, const OctetString *data)
emm_sap.u.emm_as.u.data.NASmsg.length = data->length;
emm_sap.u.emm_as.u.data.NASmsg.value = data->value;
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_sap.u.emm_as.u.data.sctx, sctx, FALSE, TRUE);
emm_as_set_security_data(&emm_sap.u.emm_as.u.data.sctx, sctx, false, true);
rc = emm_sap_send(user, &emm_sap);
LOG_FUNC_RETURN (rc);
@@ -336,7 +336,7 @@ int emm_proc_lowerlayer_success(lowerlayer_data_t *lowerlayer_data)
** Description: Handles EMM procedure to be executed upon receiving noti- **
** fication that data failed to be delivered to the network. **
** **
** Inputs: is_initial: TRUE if the NAS message that failed to be **
** Inputs: is_initial: true if the NAS message that failed to be **
** transfered is an initial NAS message **
** Others: None **
** **
@@ -345,7 +345,7 @@ int emm_proc_lowerlayer_success(lowerlayer_data_t *lowerlayer_data)
** Others: None **
** **
***************************************************************************/
int emm_proc_lowerlayer_failure(lowerlayer_data_t *lowerlayer_data, int is_initial)
int emm_proc_lowerlayer_failure(lowerlayer_data_t *lowerlayer_data, bool is_initial)
{
LOG_FUNC_IN;
+1 -1
View File
@@ -72,7 +72,7 @@ int emm_proc_lowerlayer_initialize(lowerlayer_data_t *lowerlayer_data, lowerlaye
lowerlayer_release_callback_t release,
void *args);
int emm_proc_lowerlayer_success(lowerlayer_data_t *lowerlayer_data);
int emm_proc_lowerlayer_failure(lowerlayer_data_t *lowerlayer_data, int is_initial);
int emm_proc_lowerlayer_failure(lowerlayer_data_t *lowerlayer_data, bool is_initial);
int emm_proc_lowerlayer_release(lowerlayer_data_t *lowerlayer_data);
+1 -1
View File
@@ -11,7 +11,7 @@ typedef int (*lowerlayer_success_callback_t)(void *);
* Type of EMM procedure callback function executed when data are not
* delivered to the network because a lower layer failure occurred
*/
typedef int (*lowerlayer_failure_callback_t)(int, void *);
typedef int (*lowerlayer_failure_callback_t)(bool, void *);
/*
* Type of EMM procedure callback function executed when NAS signalling
@@ -120,7 +120,7 @@ int EmmDeregisteredAttemptingToAttach(nas_user_t *user, const emm_reg_t *evt)
/*
* Data failed to be delivered to the network
*/
rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, FALSE);
rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, false);
break;
default:
@@ -133,7 +133,7 @@ int EmmDeregisteredLimitedService(nas_user_t *user, const emm_reg_t *evt)
/*
* Initial NAS message failed to be delivered to the network
*/
rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, TRUE);
rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, true);
break;
case _EMMREG_LOWERLAYER_RELEASE:
@@ -141,7 +141,7 @@ int EmmDeregisteredNormalService(nas_user_t *user, const emm_reg_t *evt)
/*
* Initial NAS message failed to be delivered to the network
*/
rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, TRUE);
rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, true);
break;
case _EMMREG_LOWERLAYER_RELEASE:
+1 -1
View File
@@ -143,7 +143,7 @@ int EmmRegistered(nas_user_t *user, const emm_reg_t *evt)
/*
* Data transfer message failed to be delivered
*/
rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, FALSE);
rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, false);
break;
case _EMMREG_LOWERLAYER_RELEASE:
@@ -240,7 +240,7 @@ int EmmRegisteredInitiated(nas_user_t *user, const emm_reg_t *evt)
* any message transfered by EMM common procedures requested
* by the network.
*/
rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, FALSE);
rc = emm_proc_lowerlayer_failure(user->lowerlayer_data, false);
break;
case _EMMREG_LOWERLAYER_RELEASE:
+3 -3
View File
@@ -679,7 +679,7 @@ static int _emm_as_cell_info_res(nas_user_t *user, const emm_as_cell_info_t *msg
int AcT = NET_ACCESS_EUTRAN;
if (msg->found == TRUE) {
if (msg->found == true) {
/* Get the first supported access technology */
while (AcT != NET_ACCESS_UNAVAILABLE) {
if (msg->rat & (1 << AcT)) {
@@ -1081,7 +1081,7 @@ static int _emm_as_data_req(const emm_data_t *emm_data, const emm_as_data_t *msg
LOG_FUNC_IN;
ul_info_transfer_req_t *as_msg = (ul_info_transfer_req_t *)ul_info_transfer_req_unaligned;
int size = 0;
int is_encoded = FALSE;
bool is_encoded = false;
LOG_TRACE(INFO, "EMMAS-SAP - Send AS data transfer request");
@@ -1114,7 +1114,7 @@ static int _emm_as_data_req(const emm_data_t *emm_data, const emm_as_data_t *msg
default:
/* Send other NAS messages as already encoded ESM messages */
size = msg->NASmsg.length;
is_encoded = TRUE;
is_encoded = true;
break;
}
+2 -2
View File
@@ -150,7 +150,7 @@ typedef struct emm_as_establish_s {
uint32_t ueid; /* UE lower layer identifier */
emm_as_EPS_identity_t UEid; /* UE's EPS mobile identity */
emm_as_security_data_t sctx;/* EPS NAS security context */
int switch_off; /* TRUE if the UE is switched off */
bool switch_off; /* true if the UE is switched off */
uint8_t type; /* Network attach/detach type */
uint8_t RRCcause; /* Connection establishment cause */
uint8_t RRCtype; /* Associated call type */
@@ -194,7 +194,7 @@ typedef struct emm_as_data_s {
uint32_t ueid; /* UE lower layer identifier */
const GUTI_t *guti; /* GUTI temporary mobile identity */
emm_as_security_data_t sctx;/* EPS NAS security context */
int switch_off; /* TRUE if the UE is switched off */
bool switch_off; /* true if the UE is switched off */
uint8_t type; /* Network detach type */
uint8_t delivered; /* Data message delivery indicator */
#define EMM_AS_NAS_DATA_ATTACH 0x01 /* Attach complete */
+2 -2
View File
@@ -71,9 +71,9 @@ typedef enum {
* ---------------------------------------------
*/
typedef struct {
int is_emergency; /* Indicates whether the PDN connection is established
bool is_emergency; /* Indicates whether the PDN connection is established
* for emergency bearer services only */
int is_attached; /* Indicates whether the UE remains attached to the
bool is_attached; /* Indicates whether the UE remains attached to the
* network */
} emm_esm_establish_t;
+2 -2
View File
@@ -100,7 +100,7 @@ typedef struct {
* -------------------------------------
*/
typedef struct {
int is_emergency; /* TRUE if the UE was attempting to register to
bool is_emergency; /* true if the UE was attempting to register to
* the network for emergency services only */
} emm_reg_attach_t;
@@ -109,7 +109,7 @@ typedef struct {
* -------------------------------------
*/
typedef struct {
int switch_off; /* TRUE if the UE is switched off */
bool switch_off; /* true if the UE is switched off */
int type; /* Network detach type */
} emm_reg_detach_t;
+4 -4
View File
@@ -124,7 +124,7 @@ static void _security_release(emm_security_context_t *ctx);
** grity algorithm and ciphered with the selected NAS ciphe- **
** ring algorithm. **
** **
** Inputs: native_ksi: TRUE if the security context is of type **
** Inputs: native_ksi: true if the security context is of type **
** native (for KSIASME) **
** ksi: The NAS ket sey identifier **
** seea: Selected EPS cyphering algorithm **
@@ -145,7 +145,7 @@ int emm_proc_security_mode_command(nas_user_t *user, int native_ksi, int ksi,
int rc = RETURNerror;
int emm_cause = EMM_CAUSE_SUCCESS;
int security_context_is_new = FALSE;
int security_context_is_new = false;
security_data_t *security_data = user->security_data;
LOG_TRACE(INFO, "EMM-PROC - Security mode control requested (ksi=%d)",
@@ -263,7 +263,7 @@ int emm_proc_security_mode_command(nas_user_t *user, int native_ksi, int ksi,
user->emm_data->security->ul_count.overflow = 0;
user->emm_data->security->ul_count.seq_num = 0;
/* Set new security context indicator */
security_context_is_new = TRUE;
security_context_is_new = true;
}
}
@@ -328,7 +328,7 @@ int emm_proc_security_mode_command(nas_user_t *user, int native_ksi, int ksi,
emm_sap.u.emm_as.u.security.emm_cause = emm_cause;
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_sap.u.emm_as.u.security.sctx,
user->emm_data->security, security_context_is_new, TRUE);
user->emm_data->security, security_context_is_new, true);
rc = emm_sap_send(user, &emm_sap);
LOG_FUNC_RETURN (rc);
+3 -3
View File
@@ -112,7 +112,7 @@ typedef struct {
#define EMM_DETACH_COUNTER_MAX 5
unsigned int count; /* Counter used to limit the number of
* subsequently detach attempts */
int switch_off; /* UE switch-off indicator */
bool switch_off; /* UE switch-off indicator */
emm_proc_detach_type_t type; /* Type of the detach procedure
* currently in progress */
} emm_detach_data_t;
@@ -249,8 +249,8 @@ typedef struct emm_data_s {
emm_eps_update_t status; /* The current EPS update status */
emm_ecm_state_t ecm_status; /* The EPS Connection Management status */
int is_attached; /* Network attachment indicator */
int is_emergency; /* Emergency bearer services indicator*/
bool is_attached; /* Network attachment indicator */
bool is_emergency; /* Emergency bearer services indicator*/
/* Tracking Areas list the UE is registered to
* Contains the list of TAIs that identify the tracking areas that
+18 -18
View File
@@ -113,7 +113,7 @@ void _emm_attach_initialize(emm_attach_data_t *emm_attach_data) {
void _emm_detach_initialize(emm_detach_data_t *emm_detach) {
emm_detach->count = 0;
emm_detach->switch_off = FALSE;
emm_detach->switch_off = false;
emm_detach->type = EMM_DETACH_TYPE_RESERVED;
}
@@ -137,7 +137,7 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c
LOG_FUNC_IN;
user->emm_data = calloc_or_fail(sizeof(emm_data_t));
/* USIM validity indicator */
user->emm_data->usim_is_valid = FALSE;
user->emm_data->usim_is_valid = false;
/* The IMEI read from the UE's non-volatile memory */
user->emm_data->imei = (imei_t *)malloc(sizeof(imei_t));
user->emm_data->imei->length = _emm_main_get_imei(user->emm_data->imei, imei);
@@ -157,14 +157,14 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c
user->emm_data->plmn_rat = NET_ACCESS_UNAVAILABLE;
/* Selected PLMN */
memset(&user->emm_data->splmn, 0xFF, sizeof(plmn_t));
user->emm_data->is_rplmn = FALSE;
user->emm_data->is_eplmn = FALSE;
user->emm_data->is_rplmn = false;
user->emm_data->is_eplmn = false;
/* Radio Access Technology of the serving cell */
user->emm_data->rat = NET_ACCESS_UNAVAILABLE;
/* Network registration status */
user->emm_data->stat = NET_REG_STATE_OFF;
user->emm_data->is_attached = FALSE;
user->emm_data->is_emergency = FALSE;
user->emm_data->is_attached = false;
user->emm_data->is_emergency = false;
/* Location/Tracking area code */
user->emm_data->tac = 0; // two byte in hexadecimal format
/* Identifier of the serving cell */
@@ -201,7 +201,7 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c
/* The USIM application is present and valid */
LOG_TRACE(INFO, "EMM-MAIN - USIM application data successfully read");
user->emm_data->usim_is_valid = TRUE;
user->emm_data->usim_is_valid = true;
/* print keys (for debugging) */
{
@@ -844,12 +844,12 @@ AcT_t emm_main_get_plmn_rat(emm_data_t *emm_data)
** Others: user->emm_data-> **
** **
** Outputs: None **
** Return: TRUE if the UE is currently attached to **
** the network; FALSE otherwise. **
** Return: true if the UE is currently attached to **
** the network; false otherwise. **
** Others: None **
** **
***************************************************************************/
int emm_main_is_attached(emm_data_t *emm_data)
bool emm_main_is_attached(emm_data_t *emm_data)
{
LOG_FUNC_IN;
LOG_FUNC_RETURN (emm_data->is_attached);
@@ -866,13 +866,13 @@ int emm_main_is_attached(emm_data_t *emm_data)
** Others: user->emm_data-> **
** **
** Outputs: None **
** Return: TRUE if the UE is currently attached or is **
** Return: true if the UE is currently attached or is **
** attempting to attach to the network for **
** emergency bearer services; FALSE otherwise **
** emergency bearer services; false otherwise **
** Others: None **
** **
***************************************************************************/
int emm_main_is_emergency(emm_data_t *emm_data)
bool emm_main_is_emergency(emm_data_t *emm_data)
{
LOG_FUNC_IN;
LOG_FUNC_RETURN (emm_data->is_attached && emm_data->is_emergency);
@@ -967,8 +967,8 @@ static int _emm_main_get_imei(imei_t *imei, const char *imei_str)
** Others: None **
** **
** Outputs: None **
** Return: TRUE if the first IMSI is found to match **
** the second; FALSE otherwise. **
** Return: true if the first IMSI is found to match **
** the second; false otherwise. **
** Others: None **
** **
***************************************************************************/
@@ -977,16 +977,16 @@ static int _emm_main_imsi_cmp(imsi_t *imsi1, imsi_t *imsi2)
int i;
if (imsi1->length != imsi2->length) {
return FALSE;
return false;
}
for (i = 0; i < imsi1->length; i++) {
if (imsi1->u.value[i] != imsi2->u.value[i]) {
return FALSE;
return false;
}
}
return TRUE;
return true;
}
/****************************************************************************
+2 -2
View File
@@ -94,8 +94,8 @@ AcT_t emm_main_get_plmn_rat(emm_data_t *emm_data);
const char *emm_main_get_registered_plmn(emm_plmn_list_t *emm_plmn_list, emm_data_t *emm_data, network_plmn_t *plmn, int format);
/* User's getter for network attachment */
int emm_main_is_attached(emm_data_t *emm_data);
int emm_main_is_emergency(emm_data_t *emm_data);
bool emm_main_is_attached(emm_data_t *emm_data);
bool emm_main_is_emergency(emm_data_t *emm_data);
#endif /* __EMM_MAIN_H__*/
+3 -3
View File
@@ -89,7 +89,7 @@ int emm_proc_attach_accept(nas_user_t *user, long T3412, long T3402, long T3423,
const OctetString *esm_msg);
int emm_proc_attach_reject(nas_user_t *user, int emm_cause, const OctetString *esm_msg);
int emm_proc_attach_complete(void *args);
int emm_proc_attach_failure(int is_initial, void *args);
int emm_proc_attach_failure(bool is_initial, void *args);
int emm_proc_attach_release(void *args);
int emm_proc_attach_restart(nas_user_t *user);
@@ -103,10 +103,10 @@ int emm_proc_attach_set_detach(void *user);
* Detach procedure
* --------------------------------------------------------------------------
*/
int emm_proc_detach(nas_user_t *user, emm_proc_detach_type_t type, int switch_off);
int emm_proc_detach(nas_user_t *user, emm_proc_detach_type_t type, bool switch_off);
int emm_proc_detach_request(void *args);
int emm_proc_detach_accept(void *args);
int emm_proc_detach_failure(int is_initial, void *args);
int emm_proc_detach_failure(bool is_initial, void *args);
int emm_proc_detach_release(void *args);