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
+10 -10
View File
@@ -121,7 +121,7 @@ static nas_timer_database_t _nas_timer_db = {
static void _nas_timer_db_init(void);
static int _nas_timer_db_get_id(void);
static int _nas_timer_db_is_active(int id);
static bool _nas_timer_db_is_active(int id);
static nas_timer_entry_t *_nas_timer_db_create_entry(long sec,
nas_timer_callback_t cb, void *args);
static void _nas_timer_db_delete_entry(int id);
@@ -130,7 +130,7 @@ static void _nas_timer_db_insert_entry(int id, nas_timer_entry_t *te);
static int _nas_timer_db_insert(timer_queue_t *entry);
static nas_timer_entry_t *_nas_timer_db_remove_entry(int id);
static int _nas_timer_db_remove(timer_queue_t *entry);
static bool _nas_timer_db_remove(timer_queue_t *entry);
/*
* -----------------------------------------------------------------------------
@@ -408,12 +408,12 @@ static int _nas_timer_db_get_id(void)
** Others: _nas_timer_db **
** **
** Outputs: None **
** Return: TRUE if the timer entry is active; FALSE **
** Return: true if the timer entry is active; false **
** if it is not an active timer entry. **
** Others: None **
** **
***************************************************************************/
static int _nas_timer_db_is_active(int id)
static bool _nas_timer_db_is_active(int id)
{
return ( (id != NAS_TIMER_INACTIVE_ID) &&
(_nas_timer_db.tq[id].id != NAS_TIMER_INACTIVE_ID) );
@@ -562,11 +562,11 @@ static int _nas_timer_db_insert(timer_queue_t *entry)
} else {
/* The new entry is the first entry of the list */
_nas_timer_db.head = entry;
return TRUE;
return true;
}
/* The new entry is NOT the first entry of the list */
return FALSE;
return false;
}
/****************************************************************************
@@ -588,7 +588,7 @@ static int _nas_timer_db_insert(timer_queue_t *entry)
***************************************************************************/
static nas_timer_entry_t *_nas_timer_db_remove_entry(int id)
{
int restart;
bool restart;
/* The identifier of the timer is valid within the timer queue */
assert(_nas_timer_db.tq[id].id == id);
@@ -622,7 +622,7 @@ static nas_timer_entry_t *_nas_timer_db_remove_entry(int id)
return (_nas_timer_db.tq[id].entry);
}
static int _nas_timer_db_remove(timer_queue_t *entry)
static bool _nas_timer_db_remove(timer_queue_t *entry)
{
/* Update the pointer from the previous entry */
/* prev ---> entry ---> next */
@@ -644,12 +644,12 @@ static int _nas_timer_db_remove(timer_queue_t *entry)
if (_nas_timer_db.head != NULL) {
/* Other timers are scheduled to expire */
return TRUE;
return true;
}
}
/* The entry was NOT the first entry of the list */
return FALSE;
return false;
}
/*
+4 -4
View File
@@ -397,7 +397,7 @@ static int _socket_set_option(int sfd)
* and it will simply open another socket on the same port and
* continue listening.
*/
optval = TRUE;
optval = true;
if (setsockopt (sfd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) < 0) {
return RETURNerror;
@@ -405,12 +405,12 @@ static int _socket_set_option(int sfd)
/* IPV6_V6ONLY socket option
* -------------------------
* When option is set to TRUE, the socket is restricted to sending and
* When option is set to true, the socket is restricted to sending and
* receiving IPv6 packets only.
* When option is set to FALSE, the socket can be used to send and receive
* When option is set to false, the socket can be used to send and receive
* packets to and from an IPv6 address or an IPv4-mapped IPv6 address.
*/
optval = FALSE;
optval = false;
if (setsockopt (sfd, IPPROTO_IPV6, IPV6_V6ONLY, &optval, sizeof(optval)) < 0) {
return RETURNerror;
+7 -7
View File
@@ -192,7 +192,7 @@ static sttyset_t stty_params[] = {
{ NULL, 0, 0, 0 }
};
static int _stty_set_this(struct termios *term, const sttyset_t *p, int turnon);
static int _stty_set_this(struct termios *term, const sttyset_t *p, bool turnon);
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
@@ -207,7 +207,7 @@ static int _stty_set_this(struct termios *term, const sttyset_t *p, int turnon);
** **
** Inputs: p: The TTY parameters **
** turnon: Indicate whether the parameter should be **
** turned on (TRUE) or turned off (FALSE) **
** turned on (true) or turned off (false) **
** Others: None **
** **
** Outputs: term: The termios structure to fill **
@@ -223,7 +223,7 @@ int stty_set(int fd, const char *params)
register char *s;
struct termios term;
register int i;
int mode;
bool mode;
/* Get current tty attributes */
if ( tcgetattr(fd, &term) < 0 ) {
@@ -234,10 +234,10 @@ int stty_set(int fd, const char *params)
p = strtok(s," \t\n");
while (p && (rc != RETURNerror)) {
mode = 1;
mode = true;
if ( *p == '-' ) {
mode = 0;
mode = false;
p++;
}
@@ -275,7 +275,7 @@ int stty_set(int fd, const char *params)
** **
** Inputs: p: The TTY parameters **
** turnon: Indicate whether the parameter should be **
** turned on (TRUE) or turned off (FALSE) **
** turned on (true) or turned off (false) **
** Others: None **
** **
** Outputs: term: The termios structure to fill **
@@ -283,7 +283,7 @@ int stty_set(int fd, const char *params)
** Others: None **
** **
***************************************************************************/
static int _stty_set_this(struct termios *term, const sttyset_t *p, int turnon)
static int _stty_set_this(struct termios *term, const sttyset_t *p, bool turnon)
{
int rc = RETURNok;
@@ -120,12 +120,12 @@ static socket_id_t * _as_simulator_mme_sid = NULL;
/*
* UE NAS process connection manager's running indicator
*/
static int _as_simulator_ue_is_running = FALSE;
static bool _as_simulator_ue_is_running = false;
/*
* MME NAS process connection manager's running indicator
*/
static int _as_simulator_mme_is_running = FALSE;
static bool _as_simulator_mme_is_running = false;
static int _set_signal_handler(int signal, void (handler)(int));
static void _signal_handler(int signal_number);
@@ -307,8 +307,8 @@ static void _signal_handler(int signal_number)
{
printf("\nWARNING\t: %s - Signal %d received\n", __FUNCTION__,
signal_number);
_as_simulator_ue_is_running = FALSE;
_as_simulator_mme_is_running = FALSE;
_as_simulator_ue_is_running = false;
_as_simulator_mme_is_running = false;
}
/*
@@ -321,7 +321,7 @@ static void* _as_simulator_ue_mngr(void* args)
int msg_id;
as_message_t msg;
_as_simulator_ue_is_running = TRUE;
_as_simulator_ue_is_running = true;
printf("INFO\t: %s - UE connection manager started\n", __FUNCTION__);
@@ -388,7 +388,7 @@ static void* _as_simulator_ue_mngr(void* args)
}
/* Close the connection to the network sublayer */
_as_simulator_ue_is_running = FALSE;
_as_simulator_ue_is_running = false;
printf("ERROR\t: The UE connection manager exited\n");
return (NULL);
}
@@ -403,7 +403,7 @@ static void* _as_simulator_mme_mngr(void* args)
int msg_id;
as_message_t msg;
_as_simulator_mme_is_running = TRUE;
_as_simulator_mme_is_running = true;
printf("INFO\t: %s - MME connection manager started\n", __FUNCTION__);
@@ -469,7 +469,7 @@ static void* _as_simulator_mme_mngr(void* args)
}
/* Close the connection to the network sublayer */
_as_simulator_mme_is_running = FALSE;
_as_simulator_mme_is_running = false;
printf("ERROR\t: %s - The MME connection manager exited\n", __FUNCTION__);
return (NULL);
}
@@ -208,7 +208,7 @@ static const OctetString* _network_simulator_pdn[NETWORK_IP_MAX][2] = {
static int _set_signal_handler(int signal, void (handler)(int));
static void _signal_handler(int signal_number);
static int _process_message(int msgID, const as_message_t* req);
static int _assign_pdn_address(int ue_pdn_type, int is_initial, int* pdn_type, OctetString* pdn);
static int _assign_pdn_address(int ue_pdn_type, bool is_initial, int* pdn_type, OctetString* pdn);
/* Functions used to process messages received from the Access Stratum */
static int _process_cell_info_req(const cell_info_req_t* req, cell_info_cnf_t* rsp);
@@ -283,7 +283,7 @@ int main (int argc, const char* argv[])
/*
* Network simulator main loop
*/
while (TRUE) {
while (true) {
as_message_t msg;
/* Receive message from the NAS */
@@ -1072,11 +1072,11 @@ static int _process_pdn_connectivity_request(const pdn_connectivity_request_msg*
/* Assign PDN address */
if (apn.length > 0) {
request->accesspointname.accesspointnamevalue = apn;
esm_cause = _assign_pdn_address(requested_pdn_type, FALSE, &pdn_type,
esm_cause = _assign_pdn_address(requested_pdn_type, false, &pdn_type,
&request->pdnaddress.pdnaddressinformation);
} else {
request->accesspointname.accesspointnamevalue = EURECOM_APN;
esm_cause = _assign_pdn_address(requested_pdn_type, TRUE, &pdn_type,
esm_cause = _assign_pdn_address(requested_pdn_type, true, &pdn_type,
&request->pdnaddress.pdnaddressinformation);
}
+2 -2
View File
@@ -192,7 +192,7 @@ int main (int argc, const char* argv[])
/*
* User simulator main loop
*/
while (TRUE) {
while (true) {
char c;
int len;
@@ -293,7 +293,7 @@ static void _signal_handler(int signal_number)
*/
static void* _receive_thread(void* arg)
{
while (TRUE) {
while (true) {
/* Receive AT response from the NAS sublayer */
int rbytes = USER_RECV(_user_simulator_recv_buffer,
USER_SIMULATOR_BUFFER_SIZE);
+9 -9
View File
@@ -354,7 +354,7 @@ static int ParseString(char * at_str, at_command_t* at_command)
char* terminal_character_index = NULL;
int num_of_chars_to_compare = -1;
int handler_index;
int handler_found = FALSE;
bool handler_found = false;
int check_for_carriage_return_index = 0;
/*
@@ -415,7 +415,7 @@ static int ParseString(char * at_str, at_command_t* at_command)
if (strncasecmp(at_str, _at_command_handler[handler_index].command,
num_of_chars_to_compare) != 0) continue;
handler_found = TRUE;
handler_found = true;
break;
}
@@ -681,7 +681,7 @@ static unsigned int NumberOfParameters(const unsigned char* str)
** Others: None **
** **
** Outputs: None **
** Return: TRUE, FALSE **
** Return: true, false **
** Others: None **
** **
***************************************************************************/
@@ -689,11 +689,11 @@ static unsigned int IsNumeric(const char* str, size_t len)
{
while (len-- > 0) {
if (!isdigit(str[len])) {
return FALSE;
return false;
}
}
return TRUE;
return true;
}
/****************************************************************************/
@@ -719,7 +719,7 @@ static int parse_e1(const char* string, int position, at_command_t* at_command)
static int parse_q0(const char* string, int position, at_command_t* at_command)
{
/* Result code suppression Q0 */
at_error_code_suppression_q1 = FALSE;
at_error_code_suppression_q1 = false;
at_command->id = 0;
at_command->mask = AT_COMMAND_NO_PARAM;
return at_command->id;
@@ -728,7 +728,7 @@ static int parse_q0(const char* string, int position, at_command_t* at_command)
static int parse_q1(const char* string, int position, at_command_t* at_command)
{
/* Result code suppression Q1 */
at_error_code_suppression_q1 = TRUE;
at_error_code_suppression_q1 = true;
at_command->id = 0;
at_command->mask = AT_COMMAND_NO_PARAM;
return at_command->id;
@@ -738,7 +738,7 @@ static int parse_v0(const char* string, int position, at_command_t* at_command)
{
/* Response format V0 (numeric result code + limited header) */
at_error_format = AT_ERROR_NUMERIC;
at_response_format_v1 = FALSE;
at_response_format_v1 = false;
at_command->id = 0;
at_command->mask = AT_COMMAND_NO_PARAM;
return at_command->id;
@@ -748,7 +748,7 @@ static int parse_v1(const char* string, int position, at_command_t* at_command)
{
/* Response format V1 (verbose result code + full header) */
at_error_format = AT_ERROR_VERBOSE;
at_response_format_v1 = TRUE;
at_response_format_v1 = true;
at_command->id = 0;
at_command->mask = AT_COMMAND_NO_PARAM;
return at_command->id;
+3 -3
View File
@@ -55,10 +55,10 @@ extern int at_response_format_v1;
/*
* Result code suppression indicator (set by ATQ0 and ATQ1)
* -------------------------------------------------------
* FALSE - Result codes are transmitted to the user application
* TRUE - Result codes are suppressed and not transmitted
* false - Result codes are transmitted to the user application
* true - Result codes are suppressed and not transmitted
*/
int at_error_code_suppression_q1 = FALSE;
bool at_error_code_suppression_q1 = false;
/*
* Verbose mode indicator (set by ATV0, ATV1 and AT+CMEE)
+3 -3
View File
@@ -52,10 +52,10 @@ Description Defines structure of the AT command response returned after
/*
* Response format indicator (set by ATV0 and ATV1)
* -----------------------------------------------
* TRUE - <CR><LF><text><CR><LF>, <CR><LF><verbose code><CR><LF>
* FALSE - <text><CR><LF>, <numeric code><CR><LF>
* true - <CR><LF><text><CR><LF>, <CR><LF><verbose code><CR><LF>
* false - <text><CR><LF>, <numeric code><CR><LF>
*/
int at_response_format_v1 = TRUE;
bool at_response_format_v1 = true;
/****************************************************************************/
/******************* L O C A L D E F I N I T I O N S *******************/
+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);
@@ -131,7 +131,7 @@ int esm_proc_dedicated_eps_bearer_context_request(nas_user_t *user, int ebi, int
}
/* Assign dedicated EPS bearer context */
int new_ebi = esm_ebr_assign(user->esm_ebr_data, ebi, pid+1, FALSE);
int new_ebi = esm_ebr_assign(user->esm_ebr_data, ebi, pid+1, false);
if (new_ebi == ESM_EBI_UNASSIGNED) {
/* 3GPP TS 24.301, section 6.4.2.5, abnormal cases a and b
@@ -141,7 +141,7 @@ int esm_proc_dedicated_eps_bearer_context_request(nas_user_t *user, int ebi, int
int old_pid, old_bid;
/* Locally deactivate the existing EPS bearer context and proceed
* with the requested dedicated EPS bearer context activation */
rc = esm_proc_eps_bearer_context_deactivate(user, TRUE, ebi,
rc = esm_proc_eps_bearer_context_deactivate(user, true, ebi,
&old_pid, &old_bid);
if (rc != RETURNok) {
@@ -149,7 +149,7 @@ int esm_proc_dedicated_eps_bearer_context_request(nas_user_t *user, int ebi, int
*esm_cause = ESM_CAUSE_PROTOCOL_ERROR;
} else {
/* Assign new dedicated EPS bearer context */
ebi = esm_ebr_assign(user->esm_ebr_data, ebi, pid+1, FALSE);
ebi = esm_ebr_assign(user->esm_ebr_data, ebi, pid+1, false);
}
}
@@ -165,7 +165,7 @@ int esm_proc_dedicated_eps_bearer_context_request(nas_user_t *user, int ebi, int
*esm_cause = ESM_CAUSE_SYNTACTICAL_ERROR_IN_PACKET_FILTER;
} else {
/* Create new dedicated EPS bearer context */
default_ebi = esm_ebr_context_create(esm_data, user->ueid, pid, ebi, FALSE, qos, tft);
default_ebi = esm_ebr_context_create(esm_data, user->ueid, pid, ebi, false, qos, tft);
if (default_ebi != ESM_EBI_UNASSIGNED) {
/* Dedicated EPS bearer contextx successfully created */
@@ -197,7 +197,7 @@ int esm_proc_dedicated_eps_bearer_context_request(nas_user_t *user, int ebi, int
** Inputs: is_standalone: Not used **
** ebi: EPS bearer identity **
** msg: Encoded ESM message to be sent **
** ue_triggered: TRUE if the EPS bearer context procedure **
** ue_triggered: true if the EPS bearer context procedure **
** was triggered by the UE **
** Others: None **
** **
@@ -206,8 +206,8 @@ int esm_proc_dedicated_eps_bearer_context_request(nas_user_t *user, int ebi, int
** Others: None **
** **
***************************************************************************/
int esm_proc_dedicated_eps_bearer_context_accept(nas_user_t *user, int is_standalone, int ebi,
OctetString *msg, int ue_triggered)
int esm_proc_dedicated_eps_bearer_context_accept(nas_user_t *user, bool is_standalone, int ebi,
OctetString *msg, bool ue_triggered)
{
LOG_FUNC_IN;
@@ -268,8 +268,8 @@ int esm_proc_dedicated_eps_bearer_context_accept(nas_user_t *user, int is_standa
** Others: None **
** **
***************************************************************************/
int esm_proc_dedicated_eps_bearer_context_reject(nas_user_t *user, int is_standalone, int ebi,
OctetString *msg, int ue_triggered)
int esm_proc_dedicated_eps_bearer_context_reject(nas_user_t *user, bool is_standalone, int ebi,
OctetString *msg, bool ue_triggered)
{
LOG_FUNC_IN;
@@ -103,7 +103,7 @@ int esm_proc_default_eps_bearer_context_request(nas_user_t *user, int pid, int e
"requested by the network (ebi=%d)", ebi);
/* Assign default EPS bearer context */
int new_ebi = esm_ebr_assign(user->esm_ebr_data, ebi, pid+1, TRUE);
int new_ebi = esm_ebr_assign(user->esm_ebr_data, ebi, pid+1, true);
if (new_ebi == ESM_EBI_UNASSIGNED) {
/* 3GPP TS 24.301, section 6.4.1.5, abnormal cases a and b
@@ -113,7 +113,7 @@ int esm_proc_default_eps_bearer_context_request(nas_user_t *user, int pid, int e
int old_pid, old_bid;
/* Locally deactivate the existing EPS bearer context and proceed
* with the requested default EPS bearer context activation */
rc = esm_proc_eps_bearer_context_deactivate(user, TRUE, ebi,
rc = esm_proc_eps_bearer_context_deactivate(user, true, ebi,
&old_pid, &old_bid);
if (rc != RETURNok) {
@@ -121,13 +121,13 @@ int esm_proc_default_eps_bearer_context_request(nas_user_t *user, int pid, int e
*esm_cause = ESM_CAUSE_PROTOCOL_ERROR;
} else {
/* Assign new default EPS bearer context */
ebi = esm_ebr_assign(user->esm_ebr_data, ebi, pid+1, TRUE);
ebi = esm_ebr_assign(user->esm_ebr_data, ebi, pid+1, true);
}
}
if (ebi != ESM_EBI_UNASSIGNED) {
/* Create new default EPS bearer context */
ebi = esm_ebr_context_create(esm_data, user->ueid, pid, ebi, TRUE, qos, NULL);
ebi = esm_ebr_context_create(esm_data, user->ueid, pid, ebi, true, qos, NULL);
if (ebi != ESM_EBI_UNASSIGNED) {
/* Default EPS bearer contextx successfully created */
@@ -165,9 +165,9 @@ int esm_proc_default_eps_bearer_context_request(nas_user_t *user, int pid, int e
** te message **
** ebi: EPS bearer identity **
** msg: Encoded ESM message to be sent **
** ue_triggered: TRUE if the EPS bearer context procedure **
** ue_triggered: true if the EPS bearer context procedure **
** was triggered by the UE (should be always **
** TRUE) **
** true) **
** Others: None **
** **
** Outputs: None **
@@ -175,8 +175,8 @@ int esm_proc_default_eps_bearer_context_request(nas_user_t *user, int pid, int e
** Others: None **
** **
***************************************************************************/
int esm_proc_default_eps_bearer_context_accept(nas_user_t *user, int is_standalone, int ebi,
OctetString *msg, int ue_triggered)
int esm_proc_default_eps_bearer_context_accept(nas_user_t *user, bool is_standalone, int ebi,
OctetString *msg, bool ue_triggered)
{
LOG_FUNC_IN;
@@ -245,8 +245,8 @@ int esm_proc_default_eps_bearer_context_accept(nas_user_t *user, int is_standalo
** Others: None **
** **
***************************************************************************/
int esm_proc_default_eps_bearer_context_reject(nas_user_t *user, int is_standalone, int ebi,
OctetString *msg, int ue_triggered)
int esm_proc_default_eps_bearer_context_reject(nas_user_t *user, bool is_standalone, int ebi,
OctetString *msg, bool ue_triggered)
{
LOG_FUNC_IN;
@@ -344,7 +344,7 @@ int esm_proc_default_eps_bearer_context_failure(nas_user_t *user)
"ESM-PROC - Default EPS bearer context activation failure");
/* Release the default EPS bearer context and enter state INACTIVE */
int rc = esm_proc_eps_bearer_context_deactivate(user, TRUE, ebi, &pid, &bid);
int rc = esm_proc_eps_bearer_context_deactivate(user, true, ebi, &pid, &bid);
if (rc != RETURNerror) {
/* Reset default EPS bearer context internal data */
@@ -97,7 +97,7 @@ static int _eps_bearer_release(nas_user_t *user, int ebi, int *pid, int *bid);
** has an EPS bearer context with specified EPS bearer iden- **
** tity activated. **
** **
** Inputs: is local: TRUE if the EPS bearer context has to be **
** Inputs: is local: true if the EPS bearer context has to be **
** locally released without peer-to-peer si- **
** gnalling between the UE and the MME **
** ebi: EPS bearer identity of the EPS bearer con- **
@@ -111,7 +111,7 @@ static int _eps_bearer_release(nas_user_t *user, int ebi, int *pid, int *bid);
** Others: None **
** **
***************************************************************************/
int esm_proc_eps_bearer_context_deactivate(nas_user_t *user, int is_local, int ebi,
int esm_proc_eps_bearer_context_deactivate(nas_user_t *user, bool is_local, int ebi,
int *pid, int *bid)
{
LOG_FUNC_IN;
@@ -213,7 +213,7 @@ int esm_proc_eps_bearer_context_deactivate_request(nas_user_t *user, int ebi, in
* the PDN connection */
if (*esm_cause == ESM_CAUSE_REACTIVATION_REQUESTED) {
esm_sap_t esm_sap;
int active = FALSE;
bool active = false;
/* 3GPP TS 24.301, section 6.4.4.3
* The UE should re-initiate the UE requested PDN connectivity
@@ -242,8 +242,8 @@ int esm_proc_eps_bearer_context_deactivate_request(nas_user_t *user, int ebi, in
* Notify ESM to re-initiate PDN connectivity procedure
*/
esm_sap.primitive = ESM_PDN_CONNECTIVITY_REQ;
esm_sap.is_standalone = TRUE;
esm_sap.data.pdn_connect.is_defined = TRUE;
esm_sap.is_standalone = true;
esm_sap.data.pdn_connect.is_defined = true;
esm_sap.data.pdn_connect.cid = pid + 1;
rc = esm_sap_send(user, &esm_sap);
}
@@ -265,10 +265,10 @@ int esm_proc_eps_bearer_context_deactivate_request(nas_user_t *user, int ebi, in
** DEACTIVATE EPS BEARER CONTEXT ACCEPT message and entering **
** the state BEARER CONTEXT INACTIVE. **
** **
** Inputs: is_standalone: Should be always TRUE **
** Inputs: is_standalone: Should be always true **
** ebi: EPS bearer identity **
** msg: Encoded ESM message to be sent **
** ue_triggered: TRUE if the EPS bearer context procedure **
** ue_triggered: true if the EPS bearer context procedure **
** was triggered by the UE **
** Others: None **
** **
@@ -277,8 +277,8 @@ int esm_proc_eps_bearer_context_deactivate_request(nas_user_t *user, int ebi, in
** Others: None **
** **
***************************************************************************/
int esm_proc_eps_bearer_context_deactivate_accept(nas_user_t *user, int is_standalone, int ebi,
OctetString *msg, int ue_triggered)
int esm_proc_eps_bearer_context_deactivate_accept(nas_user_t *user, bool is_standalone, int ebi,
OctetString *msg, bool ue_triggered)
{
LOG_FUNC_IN;
@@ -371,7 +371,7 @@ static int _eps_bearer_release(nas_user_t *user, int ebi, int *pid, int *bid)
LOG_TRACE(WARNING, "ESM-PROC - Failed to release EPS bearer context");
} else {
/* Set the EPS bearer context state to INACTIVE */
rc = esm_ebr_set_status(user_api_id, esm_ebr_data, ebi, ESM_EBR_INACTIVE, FALSE);
rc = esm_ebr_set_status(user_api_id, esm_ebr_data, ebi, ESM_EBR_INACTIVE, false);
if (rc != RETURNok) {
/* The EPS bearer context was already in INACTIVE state */
+3 -3
View File
@@ -149,7 +149,7 @@ int esm_proc_status_ind(
** **
** Description: Initiates ESM status procedure. **
** **
** Inputs: is_standalone: Not used - Always TRUE **
** Inputs: is_standalone: Not used - Always true **
** ueid: UE lower layer identifier **
** ebi: Not used **
** msg: Encoded ESM status message to be sent **
@@ -161,9 +161,9 @@ int esm_proc_status_ind(
** Others: None **
** **
***************************************************************************/
int esm_proc_status(nas_user_t *user, int is_standalone,
int esm_proc_status(nas_user_t *user, bool is_standalone,
int ebi, OctetString *msg,
int ue_triggered)
bool ue_triggered)
{
LOG_FUNC_IN;
+14 -14
View File
@@ -80,7 +80,7 @@ Description Defines the PDN connectivity ESM procedure executed by the
* PDN connection handlers
*/
static int _pdn_connectivity_create(esm_data_t *esm_data, int pid, const OctetString *apn,
esm_proc_pdn_type_t pdn_type, int is_emergency);
esm_proc_pdn_type_t pdn_type, bool is_emergency);
static int _pdn_connectivity_update(esm_data_t *esm_data, int pid, const OctetString *apn,
esm_proc_pdn_type_t pdn_type, const OctetString *pdn_addr, int esm_cause);
static int _pdn_connectivity_delete(esm_data_t *esm_data, int pid);
@@ -121,7 +121,7 @@ static void *_pdn_connectivity_t3482_handler(void *);
** to be defined or undefined **
** pdn_type: PDN connection type (IPv4, IPv6, IPv4v6) **
** apn: Access Point logical Name to be used **
** is_emergency: TRUE if the PDN connection has to be esta- **
** is_emergency: true if the PDN connection has to be esta- **
** blished for emergency bearer services **
** Others: None **
** **
@@ -133,7 +133,7 @@ static void *_pdn_connectivity_t3482_handler(void *);
***************************************************************************/
int esm_proc_pdn_connectivity(nas_user_t *user, int cid, int is_to_define,
esm_proc_pdn_type_t pdn_type,
const OctetString *apn, int is_emergency,
const OctetString *apn, bool is_emergency,
unsigned int *pti)
{
LOG_FUNC_IN;
@@ -270,7 +270,7 @@ int esm_proc_pdn_connectivity(nas_user_t *user, int cid, int is_to_define,
** pti: Procedure transaction identity **
** msg: Encoded PDN connectivity request message **
** to be sent **
** sent_by_ue: Not used - Always TRUE **
** sent_by_ue: Not used - Always true **
** Others: None **
** **
** Outputs: None **
@@ -278,8 +278,8 @@ int esm_proc_pdn_connectivity(nas_user_t *user, int cid, int is_to_define,
** Others: None **
** **
***************************************************************************/
int esm_proc_pdn_connectivity_request(nas_user_t *user, int is_standalone, int pti,
OctetString *msg, int sent_by_ue)
int esm_proc_pdn_connectivity_request(nas_user_t *user, bool is_standalone, int pti,
OctetString *msg, bool sent_by_ue)
{
LOG_FUNC_IN;
esm_pt_data_t *esm_pt_data = user->esm_pt_data;
@@ -523,7 +523,7 @@ int esm_proc_pdn_connectivity_complete(nas_user_t *user)
** PDN connectivity procedure which is still pending in the **
** PROCEDURE TRANSACTION INACTIVE or PENDING state. **
** **
** Inputs: is_pending: TRUE if this PDN connectivity procedure **
** Inputs: is_pending: true if this PDN connectivity procedure **
** transaction is in the PENDING state **
** Others: None **
** **
@@ -679,7 +679,7 @@ static void *_pdn_connectivity_t3482_handler(void *args)
** Inputs: pid: Identifier of the PDN connection entry **
** apn: Access Point Name of the PDN connection **
** pdn_type: PDN type (IPv4, IPv6, IPv4v6) **
** is_emergency: TRUE if the PDN connection has to be esta- **
** is_emergency: true if the PDN connection has to be esta- **
** blished for emergency bearer services **
** **
** Outputs: None **
@@ -688,7 +688,7 @@ static void *_pdn_connectivity_t3482_handler(void *args)
***************************************************************************/
static int _pdn_connectivity_create(esm_data_t *esm_data, int pid, const OctetString *apn,
esm_proc_pdn_type_t pdn_type,
int is_emergency)
bool is_emergency)
{
esm_pdn_t *pdn = NULL;
@@ -720,7 +720,7 @@ static int _pdn_connectivity_create(esm_data_t *esm_data, int pid, const OctetSt
/* Set the PDN connection identifier */
esm_data->pdn[pid].pid = pid;
/* Reset the PDN connection active indicator */
esm_data->pdn[pid].is_active = FALSE;
esm_data->pdn[pid].is_active = false;
/* Setup the PDN connection data */
esm_data->pdn[pid].data = pdn;
}
@@ -744,7 +744,7 @@ static int _pdn_connectivity_create(esm_data_t *esm_data, int pid, const OctetSt
}
pdn->type = pdn_type;
pdn->addr_realloc = FALSE;
pdn->addr_realloc = false;
return (RETURNok);
}
@@ -825,7 +825,7 @@ static int _pdn_connectivity_update(esm_data_t *esm_data, int pid, const OctetSt
* the other IP version using the UE requested PDN connectivity
* procedure to the same APN with a single address PDN type
* (IPv4 or IPv6) other than the one already activated */
pdn->addr_realloc = TRUE;
pdn->addr_realloc = true;
} else if ( (esm_cause == ESM_CAUSE_PDN_TYPE_IPV4_ONLY_ALLOWED) ||
(esm_cause == ESM_CAUSE_PDN_TYPE_IPV6_ONLY_ALLOWED) ) {
/* The UE requested IPv4 or IPv6 address and the network allows
@@ -833,9 +833,9 @@ static int _pdn_connectivity_update(esm_data_t *esm_data, int pid, const OctetSt
* The UE shall not subsequently initiate another UE requested
* PDN connectivity procedure to the same APN to obtain a PDN
* type different from the one allowed by the network */
pdn->addr_realloc = FALSE;
pdn->addr_realloc = false;
} else if (pdn_type != ESM_PDN_TYPE_IPV4V6) {
pdn->addr_realloc = TRUE;
pdn->addr_realloc = true;
}
return (RETURNok);
+5 -5
View File
@@ -155,7 +155,7 @@ int esm_proc_pdn_disconnect(esm_data_t *esm_data, int cid, unsigned int *pti, un
** PDN DISCONNECT REQUEST message to the MME, starting timer **
** T3492 and entering state PROCEDURE TRANSACTION PENDING. **
** **
** Inputs: is_standalone: Should be always TRUE **
** Inputs: is_standalone: Should be always true **
** pti: Procedure transaction identity **
** msg: Encoded PDN disconnect request message to **
** be sent **
@@ -167,8 +167,8 @@ int esm_proc_pdn_disconnect(esm_data_t *esm_data, int cid, unsigned int *pti, un
** Others: None **
** **
***************************************************************************/
int esm_proc_pdn_disconnect_request(nas_user_t *user, int is_standalone, int pti,
OctetString *msg, int sent_by_ue)
int esm_proc_pdn_disconnect_request(nas_user_t *user, bool is_standalone, int pti,
OctetString *msg, bool sent_by_ue)
{
LOG_FUNC_IN;
@@ -326,7 +326,7 @@ int esm_proc_pdn_disconnect_reject(nas_user_t *user, int pti, int *esm_cause)
*/
esm_sap_t esm_sap;
esm_sap.primitive = ESM_EPS_BEARER_CONTEXT_DEACTIVATE_REQ;
esm_sap.is_standalone = TRUE;
esm_sap.is_standalone = true;
esm_sap.recv = NULL;
esm_sap.send.length = 0;
esm_sap.data.eps_bearer_context_deactivate.ebi = ebi;
@@ -444,7 +444,7 @@ static void *_pdn_disconnect_t3492_handler(void *args)
*/
esm_sap_t esm_sap;
esm_sap.primitive = ESM_EPS_BEARER_CONTEXT_DEACTIVATE_REQ;
esm_sap.is_standalone = TRUE;
esm_sap.is_standalone = true;
esm_sap.recv = NULL;
esm_sap.send.length = 0;
esm_sap.data.eps_bearer_context_deactivate.ebi = ebi;
+20 -20
View File
@@ -63,9 +63,9 @@ Description Defines the ESM Service Access Points at which the EPS
/******************* L O C A L D E F I N I T I O N S *******************/
/****************************************************************************/
static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
static int _esm_sap_recv(nas_user_t *user, int msg_type, bool is_standalone,
const OctetString *req, OctetString *rsp, esm_sap_error_t *err);
static int _esm_sap_send(nas_user_t *user, int msg_type, int is_standalone, int pti, int ebi,
static int _esm_sap_send(nas_user_t *user, int msg_type, bool is_standalone, int pti, int ebi,
const esm_sap_data_t *data, OctetString *rsp);
@@ -171,7 +171,7 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
}
/* Define new PDN context */
rc = esm_proc_pdn_connectivity(user, pdn_connect->cid, TRUE,
rc = esm_proc_pdn_connectivity(user, pdn_connect->cid, true,
pdn_connect->pdn_type, &apn,
pdn_connect->is_emergency, NULL);
@@ -183,7 +183,7 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
if (pdn_connect->is_defined) {
unsigned int pti;
/* Assign new procedure transaction identity */
rc = esm_proc_pdn_connectivity(user, pdn_connect->cid, TRUE,
rc = esm_proc_pdn_connectivity(user, pdn_connect->cid, true,
pdn_connect->pdn_type, NULL,
pdn_connect->is_emergency, &pti);
@@ -205,7 +205,7 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
if ( msg->is_standalone && pdn_connect->is_defined ) {
/* Undefine the specified PDN context */
rc = esm_proc_pdn_connectivity(user, pdn_connect->cid, FALSE,
rc = esm_proc_pdn_connectivity(user, pdn_connect->cid, false,
pdn_connect->pdn_type, NULL,
pdn_connect->is_emergency, NULL);
} else if (msg->recv != NULL) {
@@ -214,7 +214,7 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
msg->recv, &msg->send, &msg->err);
} else {
/* The PDN connectivity procedure locally failed */
rc = esm_proc_pdn_connectivity_failure(user, TRUE);
rc = esm_proc_pdn_connectivity_failure(user, true);
}
}
break;
@@ -230,7 +230,7 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
if (rc != RETURNerror) {
/* Send PDN disconnect request */
rc = _esm_sap_send(user, PDN_DISCONNECT_REQUEST, TRUE, pti, ebi,
rc = _esm_sap_send(user, PDN_DISCONNECT_REQUEST, true, pti, ebi,
&msg->data, &msg->send);
}
}
@@ -278,7 +278,7 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
rc = esm_proc_default_eps_bearer_context_failure(user);
if (rc != RETURNerror) {
rc = esm_proc_pdn_connectivity_failure(user, FALSE);
rc = esm_proc_pdn_connectivity_failure(user, false);
}
break;
@@ -306,7 +306,7 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
/*
* Locally deactivate EPS bearer context
*/
rc = esm_proc_eps_bearer_context_deactivate(user, TRUE,
rc = esm_proc_eps_bearer_context_deactivate(user, true,
msg->data.eps_bearer_context_deactivate.ebi, &pid, &bid);
}
break;
@@ -359,7 +359,7 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
** Return: RETURNok, RETURNerror **
** **
***************************************************************************/
static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
static int _esm_sap_recv(nas_user_t *user, int msg_type, bool is_standalone,
const OctetString *req, OctetString *rsp,
esm_sap_error_t *err)
{
@@ -422,7 +422,7 @@ static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
* was triggered network-internally */
int triggered_by_ue = (pti != PROCEDURE_TRANSACTION_IDENTITY_UNASSIGNED);
/* Indicate whether the received message shall be ignored */
int is_discarded = FALSE;
bool is_discarded = false;
if (esm_cause != ESM_CAUSE_SUCCESS) {
LOG_TRACE(ERROR, "ESM-SAP - Failed to decode expected ESM message "
@@ -455,7 +455,7 @@ static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
* of already accepted activate default EPS bearer context
* request message
*/
is_discarded = TRUE;
is_discarded = true;
}
} else {
/* Return reject message */
@@ -493,7 +493,7 @@ static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
* of already accepted activate dedicated EPS bearer context
* request message
*/
is_discarded = TRUE;
is_discarded = true;
}
} else {
/* Return reject message */
@@ -525,7 +525,7 @@ static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
* received with PTI reserved value, or assigned value
* that does not match any PTI in use
*/
is_discarded = TRUE;
is_discarded = true;
} else if ( (esm_cause == ESM_CAUSE_SUCCESS) ||
(esm_cause == ESM_CAUSE_INVALID_EPS_BEARER_IDENTITY) ) {
/* Return accept message */
@@ -541,7 +541,7 @@ static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
* message with the EPS bearer identity set to the received
* EPS bearer identity
*/
is_discarded = TRUE;
is_discarded = true;
}
}
@@ -565,7 +565,7 @@ static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
* Ignore PDN connectivity reject message received with
* reserved or unassigned EPS bearer identity value
*/
is_discarded = TRUE;
is_discarded = true;
}
break;
@@ -588,7 +588,7 @@ static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
* Ignore PDN disconnect reject message received with
* reserved or unassigned EPS bearer identity value
*/
is_discarded = TRUE;
is_discarded = true;
}
break;
@@ -629,7 +629,7 @@ static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
* onto the network */
esm_procedure = esm_proc_status;
/* Discard received ESM message */
is_discarded = TRUE;
is_discarded = true;
}
} else {
/* ESM message processing succeed */
@@ -687,7 +687,7 @@ static int _esm_sap_recv(nas_user_t *user, int msg_type, int is_standalone,
** Return: RETURNok, RETURNerror **
** **
***************************************************************************/
static int _esm_sap_send(nas_user_t *user, int msg_type, int is_standalone,
static int _esm_sap_send(nas_user_t *user, int msg_type, bool is_standalone,
int pti, int ebi, const esm_sap_data_t *data,
OctetString *rsp)
{
@@ -697,7 +697,7 @@ static int _esm_sap_send(nas_user_t *user, int msg_type, int is_standalone,
int rc = RETURNok;
/* Indicate whether the message is sent by the UE or the MME */
int sent_by_ue = TRUE;
bool sent_by_ue = true;
ESM_msg esm_msg;
memset(&esm_msg, 0 , sizeof(ESM_msg));
+3 -3
View File
@@ -109,11 +109,11 @@ typedef struct esm_activate_eps_default_bearer_context_s {
*/
typedef struct esm_pdn_connectivity_s {
int cid; /* PDN connection local identifier */
int is_defined; /* Indicates whether a PDN context has been defined
bool is_defined; /* Indicates whether a PDN context has been defined
* for the specified APN */
int pdn_type; /* PDN address type (IPv4, IPv6, IPv4v6) */
const char *apn; /* PDN's Access Point Name */
int is_emergency; /* Indicates whether the PDN context has been
bool is_emergency; /* Indicates whether the PDN context has been
* defined to establish connection for emergency
* bearer services */
} esm_pdn_connectivity_t;
@@ -149,7 +149,7 @@ typedef union {
typedef struct esm_sap_s {
esm_primitive_t primitive; /* ESM-SAP primitive to process */
int is_standalone; /* Indicates whether the ESM message handled
bool is_standalone; /* Indicates whether the ESM message handled
* within this primitive has to be sent/received
* standalone or together within an EMM related
* message */
+1 -1
View File
@@ -132,7 +132,7 @@ int esm_send_status(int pti, int ebi, esm_status_msg *msg, int esm_cause)
** Others: None **
** **
***************************************************************************/
int esm_send_pdn_connectivity_request(int pti, int is_emergency, int pdn_type,
int esm_send_pdn_connectivity_request(int pti, bool is_emergency, int pdn_type,
const char *apn,
pdn_connectivity_request_msg *msg)
{
+3 -1
View File
@@ -40,6 +40,8 @@ Description Defines functions executed at the ESM Service Access
#ifndef __ESM_SEND_H__
#define __ESM_SEND_H__
#include <stdbool.h>
#include "EsmStatus.h"
@@ -90,7 +92,7 @@ int esm_send_status(int pti, int ebi, esm_status_msg *msg, int esm_cause);
* Transaction related messages
* ----------------------------
*/
int esm_send_pdn_connectivity_request(int pti, int is_emergency, int pdn_type,
int esm_send_pdn_connectivity_request(int pti, bool is_emergency, int pdn_type,
const char *apn, pdn_connectivity_request_msg *msg);
int esm_send_pdn_disconnect_request(int pti, int ebi,
pdn_disconnect_request_msg *msg);
+5 -4
View File
@@ -37,6 +37,7 @@ Description Defines internal private data handled by EPS Session
*****************************************************************************/
#include <stdio.h> // sprintf
#include <stdbool.h>
#include "networkDef.h"
#include "OctetString.h"
@@ -92,7 +93,7 @@ typedef enum {
typedef struct esm_ebr_context_s {
unsigned char ebi; /* EPS bearer identity */
esm_ebr_state status; /* EPS bearer context status */
int is_default_ebr; /* TRUE if the bearer context is associated
bool is_default_ebr; /* bool if the bearer context is associated
* to a default EPS bearer */
char cid; /* Identifier of the PDN context the EPS
* bearer context has been assigned to */
@@ -137,7 +138,7 @@ typedef struct esm_bearer_s {
typedef struct esm_pdn_s {
unsigned int pti; /* Identity of the procedure transaction executed
* to activate the PDN connection entry */
int is_emergency; /* Emergency bearer services indicator */
bool is_emergency; /* Emergency bearer services indicator */
OctetString apn; /* Access Point Name currently in used */
int ambr; /* Aggregate Maximum Bit Rate of this APN */
int type; /* Address PDN type (IPv4, IPv6, IPv4v6) */
@@ -147,7 +148,7 @@ typedef struct esm_pdn_s {
ESM_DATA_IPV6_ADDRESS_SIZE)
/* IPv4 PDN address and/or IPv6 prefix */
char ip_addr[ESM_DATA_IP_ADDRESS_SIZE+1];
int addr_realloc; /* Indicates whether the UE is allowed to subsequently
bool addr_realloc; /* Indicates whether the UE is allowed to subsequently
* request another PDN connectivity to the same APN
* using an address PDN type (IPv4 or IPv6) other
* than the one already activated */
@@ -175,7 +176,7 @@ typedef struct esm_data_context_s {
#define ESM_DATA_PDN_MAX 4
struct {
int pid; /* Identifier of the PDN connection */
int is_active; /* TRUE/FALSE if the PDN connection is active/inactive
bool is_active; /* true/false if the PDN connection is active/inactive
* or the process to activate/deactivate the PDN
* connection is in progress */
esm_pdn_t *data; /* Active PDN connection data */
+8 -9
View File
@@ -153,7 +153,7 @@ void esm_ebr_register_callback(esm_indication_callback_t cb)
** ebi: Identity of the new EPS bearer context **
** cid: Identifier of the PDN context the EPS bea- **
** rer context is associated to **
** default_ebr TRUE if the new bearer context is associa- **
** default_ebr bool if the new bearer context is associa- **
** ted to a default EPS bearer **
** Others: None **
** **
@@ -163,7 +163,7 @@ void esm_ebr_register_callback(esm_indication_callback_t cb)
** the not assigned EBI (0) otherwise. **
** **
***************************************************************************/
int esm_ebr_assign(esm_ebr_data_t *esm_ebr_data, int ebi, int cid, int default_ebr)
int esm_ebr_assign(esm_ebr_data_t *esm_ebr_data, int ebi, int cid, bool default_ebr)
{
esm_ebr_context_t *ebr_ctx = NULL;
int i;
@@ -284,7 +284,7 @@ int esm_ebr_release(esm_ebr_data_t *esm_ebr_data,
** **
** ebi: The identity of the EPS bearer **
** status: The new EPS bearer context status **
** ue_requested: TRUE/FALSE if the modification of the EPS **
** ue_requested: true/false if the modification of the EPS **
** bearer context status was requested by the **
** UE/network **
** Others: None **
@@ -294,7 +294,7 @@ int esm_ebr_release(esm_ebr_data_t *esm_ebr_data,
** **
***************************************************************************/
int esm_ebr_set_status(user_api_id_t *user_api_id, esm_ebr_data_t *esm_ebr_data,
int ebi, esm_ebr_state status, int ue_requested)
int ebi, esm_ebr_state status, bool ue_requested)
{
esm_ebr_context_t *ebr_ctx;
esm_ebr_state old_status;
@@ -385,11 +385,11 @@ esm_ebr_state esm_ebr_get_status(esm_ebr_data_t *esm_ebr_data,
** Others: None **
** **
** Outputs: None **
** Return: TRUE, FALSE **
** Return: true, false **
** Others: None **
** **
***************************************************************************/
int esm_ebr_is_reserved(esm_ebr_data_t *esm_ebr_data, int ebi)
bool esm_ebr_is_reserved(esm_ebr_data_t *esm_ebr_data, int ebi)
{
return ( (ebi != ESM_EBI_UNASSIGNED) && (ebi < ESM_EBI_MIN) );
}
@@ -404,12 +404,11 @@ int esm_ebr_is_reserved(esm_ebr_data_t *esm_ebr_data, int ebi)
** ebi: The identity of the EPS bearer **
** **
** Outputs: None **
** Return: TRUE, FALSE **
** Return: true, false **
** Others: None **
** **
***************************************************************************/
int esm_ebr_is_not_in_use(esm_ebr_data_t *esm_ebr_data,
int ebi)
bool esm_ebr_is_not_in_use(esm_ebr_data_t *esm_ebr_data, int ebi)
{
return ( (ebi == ESM_EBI_UNASSIGNED) ||
+4 -4
View File
@@ -75,15 +75,15 @@ typedef int (*esm_indication_callback_t) (user_api_id_t *user_api_id, int, netwo
void esm_ebr_register_callback(esm_indication_callback_t cb);
int esm_ebr_is_reserved(esm_ebr_data_t *esm_ebr_data, int ebi);
bool esm_ebr_is_reserved(esm_ebr_data_t *esm_ebr_data, int ebi);
esm_ebr_data_t *esm_ebr_initialize(void);
int esm_ebr_assign(esm_ebr_data_t *esm_ebr_data, int ebi, int cid, int default_ebr);
int esm_ebr_assign(esm_ebr_data_t *esm_ebr_data, int ebi, int cid, bool default_ebr);
int esm_ebr_release(esm_ebr_data_t *esm_ebr_data, int ebi);
int esm_ebr_set_status(user_api_id_t *user_api_id, esm_ebr_data_t *esm_ebr_data, int ebi, esm_ebr_state status, int ue_requested);
int esm_ebr_set_status(user_api_id_t *user_api_id, esm_ebr_data_t *esm_ebr_data, int ebi, esm_ebr_state status, bool ue_requested);
esm_ebr_state esm_ebr_get_status(esm_ebr_data_t *esm_ebr_data, int ebi);
int esm_ebr_is_not_in_use(esm_ebr_data_t *esm_ebr_data, int ebi);
bool esm_ebr_is_not_in_use(esm_ebr_data_t *esm_ebr_data, int ebi);
#endif /* __ESM_EBR_H__*/
+13 -13
View File
@@ -84,7 +84,7 @@ static int _esm_ebr_context_check_precedence(const network_tft_t *,
** Inputs: **
** pid: PDN connection identifier **
** ebi: EPS bearer identity **
** is_default: TRUE if the new bearer is a default EPS **
** is_default: true if the new bearer is a default EPS **
** bearer context **
** esm_qos: EPS bearer level QoS parameters **
** tft: Traffic flow template parameters **
@@ -98,7 +98,7 @@ static int _esm_ebr_context_check_precedence(const network_tft_t *,
***************************************************************************/
int esm_ebr_context_create(
esm_data_t *esm_data, int ueid,
int pid, int ebi, int is_default,
int pid, int ebi, bool is_default,
const network_qos_t *qos, const network_tft_t *tft) {
int bid = 0;
esm_data_context_t *esm_ctx = NULL;
@@ -185,11 +185,11 @@ int esm_ebr_context_create(
if (is_default) {
/* Set the PDN connection activation indicator */
esm_ctx->pdn[pid].is_active = TRUE;
esm_ctx->pdn[pid].is_active = true;
/* Update the emergency bearer services indicator */
if (pdn->is_emergency) {
esm_ctx->emergency = TRUE;
esm_ctx->emergency = true;
}
// LG ADD TEMP
@@ -383,7 +383,7 @@ int esm_ebr_context_create(
***************************************************************************/
int esm_ebr_context_release(nas_user_t *user,
int ebi, int *pid, int *bid) {
int found = FALSE;
bool found = false;
esm_pdn_t *pdn = NULL;
esm_data_context_t *esm_ctx;
esm_ebr_data_t *esm_ebr_data = user->esm_ebr_data;
@@ -416,7 +416,7 @@ int esm_ebr_context_release(nas_user_t *user,
}
/* The EPS bearer context entry is found */
found = TRUE;
found = true;
break;
}
}
@@ -450,7 +450,7 @@ int esm_ebr_context_release(nas_user_t *user,
if (pdn->bearer[*bid] != NULL) {
ebi = pdn->bearer[*bid]->ebi;
found = TRUE;
found = true;
}
}
}
@@ -503,7 +503,7 @@ int esm_ebr_context_release(nas_user_t *user,
/* Set the EPS bearer context state to INACTIVE */
esm_ebr_set_status(user_api_id, esm_ebr_data, pdn->bearer[i]->ebi,
ESM_EBR_INACTIVE, TRUE);
ESM_EBR_INACTIVE, true);
/* Release EPS bearer data */
esm_ebr_release(esm_ebr_data, pdn->bearer[i]->ebi);
// esm_ebr_release()
@@ -519,11 +519,11 @@ int esm_ebr_context_release(nas_user_t *user,
}
/* Reset the PDN connection activation indicator */
esm_ctx->pdn[*pid].is_active = FALSE;
esm_ctx->pdn[*pid].is_active = false;
/* Update the emergency bearer services indicator */
if (pdn->is_emergency) {
esm_ctx->emergency = FALSE;
esm_ctx->emergency = false;
}
}
@@ -534,7 +534,7 @@ int esm_ebr_context_release(nas_user_t *user,
if (esm_ctx->n_ebrs == 0) {
emm_sap_t emm_sap;
emm_sap.primitive = EMMESM_ESTABLISH_CNF;
emm_sap.u.emm_esm.u.establish.is_attached = FALSE;
emm_sap.u.emm_esm.u.establish.is_attached = false;
(void) emm_sap_send(user, &emm_sap);
}
/* 3GPP TS 24.301, section 6.4.4.3, 6.4.4.6
@@ -546,8 +546,8 @@ int esm_ebr_context_release(nas_user_t *user,
else if (esm_ctx->emergency && (esm_ctx->n_ebrs == 1) ) {
emm_sap_t emm_sap;
emm_sap.primitive = EMMESM_ESTABLISH_CNF;
emm_sap.u.emm_esm.u.establish.is_attached = TRUE;
emm_sap.u.emm_esm.u.establish.is_emergency = TRUE;
emm_sap.u.emm_esm.u.establish.is_attached = true;
emm_sap.u.emm_esm.u.establish.is_emergency = true;
(void) emm_sap_send(user, &emm_sap);
}
+1 -1
View File
@@ -66,7 +66,7 @@ typedef enum {
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
int esm_ebr_context_create(esm_data_t *esm_data, int ueid, int pid, int ebi, int is_default,
int esm_ebr_context_create(esm_data_t *esm_data, int ueid, int pid, int ebi, bool is_default,
const network_qos_t *qos, const network_tft_t *tft);
int esm_ebr_context_release(nas_user_t *user, int ebi, int *pid, int *bid);
+14 -14
View File
@@ -96,12 +96,12 @@ void esm_main_initialize(nas_user_t *user, esm_indication_callback_t cb)
for (i = 0; i < ESM_DATA_PDN_MAX + 1; i++) {
esm_data->pdn[i].pid = -1;
esm_data->pdn[i].is_active = FALSE;
esm_data->pdn[i].is_active = false;
esm_data->pdn[i].data = NULL;
}
/* Emergency bearer services indicator */
esm_data->emergency = FALSE;
esm_data->emergency = false;
/* Initialize the procedure transaction identity manager */
@@ -225,12 +225,12 @@ int esm_main_get_nb_pdns(esm_data_t *esm_data)
** Inputs: None **
** **
** Outputs: None **
** Return: TRUE if a PDN connection for emergency **
** Return: true if a PDN connection for emergency **
** bearer services is established **
** Others: None **
** **
***************************************************************************/
int esm_main_has_emergency(esm_data_t *esm_data)
bool esm_main_has_emergency(esm_data_t *esm_data)
{
LOG_FUNC_IN;
@@ -245,16 +245,16 @@ int esm_main_has_emergency(esm_data_t *esm_data)
** **
** Inputs: cid: PDN connection identifier **
** **
** Outputs: state: TRUE if the current state of the PDN con- **
** nection is ACTIVE; FALSE otherwise. **
** Return: TRUE if the specified PDN connection has a **
** PDN context defined; FALSE if no any PDN **
** Outputs: state: true if the current state of the PDN con- **
** nection is ACTIVE; false otherwise. **
** Return: true if the specified PDN connection has a **
** PDN context defined; false if no any PDN **
** context has been defined for the specified **
** connection. **
** Others: None **
** **
***************************************************************************/
int esm_main_get_pdn_status(nas_user_t *user, int cid, int *state)
bool esm_main_get_pdn_status(nas_user_t *user, int cid, bool *state)
{
LOG_FUNC_IN;
@@ -263,14 +263,14 @@ int esm_main_get_pdn_status(nas_user_t *user, int cid, int *state)
esm_ebr_data_t *esm_ebr_data = user-> esm_ebr_data;
if (pid >= ESM_DATA_PDN_MAX) {
return (FALSE);
return (false);
} else if (pid != esm_data->pdn[pid].pid) {
LOG_TRACE(WARNING, "ESM-MAIN - PDN connection %d is not defined", cid);
return (FALSE);
return (false);
} else if (esm_data->pdn[pid].data == NULL) {
LOG_TRACE(ERROR, "ESM-MAIN - PDN connection %d has not been allocated",
cid);
return (FALSE);
return (false);
}
if (esm_data->pdn[pid].data->bearer[0] != NULL) {
@@ -281,7 +281,7 @@ int esm_main_get_pdn_status(nas_user_t *user, int cid, int *state)
}
/* The PDN connection has not been activated yet */
LOG_FUNC_RETURN (TRUE);
LOG_FUNC_RETURN (true);
}
/****************************************************************************
@@ -301,7 +301,7 @@ int esm_main_get_pdn_status(nas_user_t *user, int cid, int *state)
** **
***************************************************************************/
int esm_main_get_pdn(esm_data_t *esm_data, int cid, int *type, const char **apn,
int *is_emergency, int *is_active)
bool *is_emergency, bool *is_active)
{
LOG_FUNC_IN;
+3 -4
View File
@@ -69,10 +69,9 @@ void esm_main_cleanup(esm_data_t *esm_data);
/* User's getter for PDN connections and EPS bearer contexts */
int esm_main_get_nb_pdns_max(esm_data_t *esm_data);
int esm_main_get_nb_pdns(esm_data_t *esm_data);
int esm_main_has_emergency(esm_data_t *esm_data);
int esm_main_get_pdn_status(nas_user_t *user, int cid, int *state);
int esm_main_get_pdn(esm_data_t *esm_data, int cid, int *type, const char **apn, int *is_emergency,
int *is_active);
bool esm_main_has_emergency(esm_data_t *esm_data);
bool esm_main_get_pdn_status(nas_user_t *user, int cid, bool *state);
int esm_main_get_pdn(esm_data_t *esm_data, int cid, int *type, const char **apn, bool *is_emergency, bool *is_active);
int esm_main_get_pdn_addr(esm_data_t *esm_data, int cid, const char **ipv4addr, const char **ipv6addr);
+18 -19
View File
@@ -79,7 +79,7 @@ typedef enum {
* Type of the ESM procedure callback executed when requested by the UE
* or initiated by the network
*/
typedef int (*esm_proc_procedure_t) (nas_user_t *user, int, int, OctetString *, int);
typedef int (*esm_proc_procedure_t) (nas_user_t *user, bool, int, OctetString *, bool);
/* EPS bearer level QoS parameters */
typedef network_qos_t esm_proc_qos_t;
@@ -113,8 +113,7 @@ typedef struct {
* --------------------------------------------------------------------------
*/
int esm_proc_status_ind(int pti, int ebi, int *esm_cause);
int esm_proc_status(nas_user_t *user, int is_standalone, int pti, OctetString *msg,
int sent_by_ue);
int esm_proc_status(nas_user_t *user, bool is_standalone, int pti, OctetString *msg, bool sent_by_ue);
/*
@@ -123,10 +122,10 @@ int esm_proc_status(nas_user_t *user, int is_standalone, int pti, OctetString *m
* --------------------------------------------------------------------------
*/
int esm_proc_pdn_connectivity(nas_user_t *user, int cid, int to_define,
esm_proc_pdn_type_t pdn_type, const OctetString *apn, int is_emergency,
esm_proc_pdn_type_t pdn_type, const OctetString *apn, bool is_emergency,
unsigned int *pti);
int esm_proc_pdn_connectivity_request(nas_user_t *user, int is_standalone, int pti,
OctetString *msg, int sent_by_ue);
int esm_proc_pdn_connectivity_request(nas_user_t *user, bool is_standalone, int pti,
OctetString *msg, bool sent_by_ue);
int esm_proc_pdn_connectivity_accept(nas_user_t *user, int pti, esm_proc_pdn_type_t pdn_type,
const OctetString *pdn_address, const OctetString *apn, int *esm_cause);
int esm_proc_pdn_connectivity_reject(nas_user_t *user, int pti, int *esm_cause);
@@ -140,8 +139,8 @@ int esm_proc_pdn_connectivity_failure(nas_user_t *user, int is_pending);
* --------------------------------------------------------------------------
*/
int esm_proc_pdn_disconnect(esm_data_t *esm_data, int cid, unsigned int *pti, unsigned int *ebi);
int esm_proc_pdn_disconnect_request(nas_user_t *user, int is_standalone, int pti,
OctetString *msg, int sent_by_ue);
int esm_proc_pdn_disconnect_request(nas_user_t *user, bool is_standalone, int pti,
OctetString *msg, bool sent_by_ue);
int esm_proc_pdn_disconnect_accept(esm_pt_data_t *esm_pt_data, int pti, int *esm_cause);
int esm_proc_pdn_disconnect_reject(nas_user_t *user, int pti, int *esm_cause);
@@ -157,10 +156,10 @@ int esm_proc_default_eps_bearer_context_request(nas_user_t *user, int pid, int e
int esm_proc_default_eps_bearer_context_complete(default_eps_bearer_context_data_t *default_eps_bearer_context_data);
int esm_proc_default_eps_bearer_context_failure(nas_user_t *user);
int esm_proc_default_eps_bearer_context_accept(nas_user_t *user, int is_standalone, int ebi,
OctetString *msg, int ue_triggered);
int esm_proc_default_eps_bearer_context_reject(nas_user_t *user, int is_standalone, int ebi,
OctetString *msg, int ue_triggered);
int esm_proc_default_eps_bearer_context_accept(nas_user_t *user, bool is_standalone, int ebi,
OctetString *msg, bool ue_triggered);
int esm_proc_default_eps_bearer_context_reject(nas_user_t *user, bool is_standalone, int ebi,
OctetString *msg, bool ue_triggered);
/*
* --------------------------------------------------------------------------
@@ -171,10 +170,10 @@ int esm_proc_default_eps_bearer_context_reject(nas_user_t *user, int is_standalo
int esm_proc_dedicated_eps_bearer_context_request(nas_user_t *user, int ebi, int default_ebi,
const esm_proc_qos_t *qos, const esm_proc_tft_t *tft, int *esm_cause);
int esm_proc_dedicated_eps_bearer_context_accept(nas_user_t *user, int is_standalone, int ebi,
OctetString *msg, int ue_triggered);
int esm_proc_dedicated_eps_bearer_context_reject(nas_user_t *user, int is_standalone, int ebi,
OctetString *msg, int ue_triggered);
int esm_proc_dedicated_eps_bearer_context_accept(nas_user_t *user, bool is_standalone, int ebi,
OctetString *msg, bool ue_triggered);
int esm_proc_dedicated_eps_bearer_context_reject(nas_user_t *user, bool is_standalone, int ebi,
OctetString *msg, bool ue_triggered);
/*
* --------------------------------------------------------------------------
@@ -182,11 +181,11 @@ int esm_proc_dedicated_eps_bearer_context_reject(nas_user_t *user, int is_standa
* --------------------------------------------------------------------------
*/
int esm_proc_eps_bearer_context_deactivate(nas_user_t *user, int is_local, int ebi, int *pid,
int esm_proc_eps_bearer_context_deactivate(nas_user_t *user, bool is_local, int ebi, int *pid,
int *bid);
int esm_proc_eps_bearer_context_deactivate_request(nas_user_t *user, int ebi, int *esm_cause);
int esm_proc_eps_bearer_context_deactivate_accept(nas_user_t *user, int is_standalone, int ebi,
OctetString *msg, int ue_triggered);
int esm_proc_eps_bearer_context_deactivate_accept(nas_user_t *user, bool is_standalone, int ebi,
OctetString *msg, bool ue_triggered);
#endif /* __ESM_PROC_H__*/
+4 -4
View File
@@ -482,11 +482,11 @@ int esm_pt_get_pending_pti(esm_pt_data_t *esm_pt_data, esm_pt_state status)
** Inputs: pti: The identity of the procedure transaction **
** **
** Outputs: None **
** Return: TRUE, FALSE **
** Return: true, false **
** Others: None **
** **
***************************************************************************/
int esm_pt_is_not_in_use(esm_pt_data_t *esm_pt_data, int pti)
bool esm_pt_is_not_in_use(esm_pt_data_t *esm_pt_data, int pti)
{
return ( (pti == ESM_PT_UNASSIGNED) ||
(esm_pt_data->context[pti - ESM_PTI_MIN] == NULL) ||
@@ -504,11 +504,11 @@ int esm_pt_is_not_in_use(esm_pt_data_t *esm_pt_data, int pti)
** Others: None **
** **
** Outputs: None **
** Return: TRUE, FALSE **
** Return: true, false **
** Others: None **
** **
***************************************************************************/
int esm_pt_is_reserved(int pti)
bool esm_pt_is_reserved(int pti)
{
return ( (pti != ESM_PT_UNASSIGNED) && (pti > ESM_PTI_MAX) );
}
+2 -2
View File
@@ -64,7 +64,7 @@ Description Defines functions used to handle ESM procedure transactions.
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
int esm_pt_is_reserved(int pti);
bool esm_pt_is_reserved(int pti);
esm_pt_data_t *esm_pt_initialize(void);
@@ -79,6 +79,6 @@ int esm_pt_set_status(esm_pt_data_t *esm_pt_data, int pti, esm_pt_state status);
esm_pt_state esm_pt_get_status(esm_pt_data_t *esm_pt_data, int pti);
int esm_pt_get_pending_pti(esm_pt_data_t *esm_pt_data, esm_pt_state status);
int esm_pt_is_not_in_use(esm_pt_data_t *esm_pt_data, int pti);
bool esm_pt_is_not_in_use(esm_pt_data_t *esm_pt_data, int pti);
#endif /* __ESM_PT_H__*/
+2 -2
View File
@@ -205,7 +205,7 @@ static void *_nas_user_mngr(void *args)
LOG_FUNC_IN;
pthread_setname_np( pthread_self(), "nas_user_mngr");
int exit_loop = FALSE;
bool exit_loop = false;
int *fd = (int *) args;
@@ -251,7 +251,7 @@ static void *_nas_network_mngr(void *args)
LOG_TRACE (INFO, "UE-MAIN - Network connection manager started (%d)", *fd);
/* Network receiving loop */
while (TRUE) {
while (true) {
/* Read the network data message */
bytes = network_api_read_data (*fd);
+40 -40
View File
@@ -64,8 +64,8 @@ Description NAS procedure call manager
#define NAS_PROC_RSRP_UNKNOWN 255
static int _nas_proc_activate(nas_user_t *user, int cid, int apply_to_all);
static int _nas_proc_deactivate(nas_user_t *user, int cid, int apply_to_all);
static int _nas_proc_activate(nas_user_t *user, int cid, bool apply_to_all);
static int _nas_proc_deactivate(nas_user_t *user, int cid, bool apply_to_all);
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
@@ -93,7 +93,7 @@ void nas_proc_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
LOG_FUNC_IN;
/* Initialize local NAS data */
user->proc.EPS_capability_status = FALSE;
user->proc.EPS_capability_status = false;
user->proc.rsrq = NAS_PROC_RSRQ_UNKNOWN;
user->proc.rsrp = NAS_PROC_RSRP_UNKNOWN;
@@ -129,7 +129,7 @@ void nas_proc_cleanup(nas_user_t *user)
LOG_FUNC_IN;
/* Detach the UE from the EPS network */
int rc = nas_proc_detach(user, TRUE);
int rc = nas_proc_detach(user, true);
if (rc != RETURNok) {
LOG_TRACE(ERROR, "NAS-PROC - Failed to detach from the network");
@@ -176,7 +176,7 @@ int nas_proc_enable_s1_mode(nas_user_t *user)
* Notify the EMM procedure call manager that EPS capability
* of the UE is enabled
*/
user->proc.EPS_capability_status = TRUE;
user->proc.EPS_capability_status = true;
emm_sap.primitive = EMMREG_S1_ENABLED;
rc = emm_sap_send(user, &emm_sap);
@@ -209,7 +209,7 @@ int nas_proc_disable_s1_mode(nas_user_t *user)
* Notify the EMM procedure call manager that EPS capability
* of the UE is disabled
*/
user->proc.EPS_capability_status = FALSE;
user->proc.EPS_capability_status = false;
emm_sap.primitive = EMMREG_S1_DISABLED;
rc = emm_sap_send(user, &emm_sap);
@@ -231,7 +231,7 @@ int nas_proc_disable_s1_mode(nas_user_t *user)
** Others: None **
** **
***************************************************************************/
int nas_proc_get_eps(nas_user_t *user, int *stat)
int nas_proc_get_eps(nas_user_t *user, bool *stat)
{
LOG_FUNC_IN;
@@ -449,7 +449,7 @@ int nas_proc_deregister(nas_user_t *user)
** Others: None **
** **
***************************************************************************/
int nas_proc_get_reg_data(nas_user_t *user, int *mode, int *selected, int format,
int nas_proc_get_reg_data(nas_user_t *user, int *mode, bool *selected, int format,
network_plmn_t *oper, int *AcT)
{
LOG_FUNC_IN;
@@ -462,12 +462,12 @@ int nas_proc_get_reg_data(nas_user_t *user, int *mode, int *selected, int format
if (oper_name != NULL) {
/* An operator is currently selected */
*selected = TRUE;
*selected = true;
/* Get the supported Radio Access Technology */
*AcT = emm_main_get_plmn_rat(user->emm_data);
} else {
/* No any operator is selected */
*selected = FALSE;
*selected = false;
*AcT = NET_ACCESS_UNAVAILABLE;
}
@@ -558,7 +558,7 @@ int nas_proc_get_loc_info(nas_user_t *user, char *tac, char *ci, int *AcT)
** **
** Description: Initiates a detach procedure **
** **
** Inputs: switch_off: TRUE if the detach is due to UE switch-off **
** Inputs: switch_off: true if the detach is due to UE switch-off **
** Others: None **
** **
** Outputs: None **
@@ -566,7 +566,7 @@ int nas_proc_get_loc_info(nas_user_t *user, char *tac, char *ci, int *AcT)
** Others: None **
** **
***************************************************************************/
int nas_proc_detach(nas_user_t *user, int switch_off)
int nas_proc_detach(nas_user_t *user, bool switch_off)
{
LOG_FUNC_IN;
@@ -607,7 +607,7 @@ int nas_proc_attach(nas_user_t *user)
if ( !emm_main_is_attached(user->emm_data) ) {
/* Initiate an Attach procedure */
emm_sap.primitive = EMMREG_ATTACH_INIT;
emm_sap.u.emm_reg.u.attach.is_emergency = FALSE;
emm_sap.u.emm_reg.u.attach.is_emergency = false;
rc = emm_sap_send(user, &emm_sap);
}
@@ -624,16 +624,16 @@ int nas_proc_attach(nas_user_t *user)
** Others: None **
** **
** Outputs: None **
** Return: TRUE if the UE is currently attached to **
** Return: true if the UE is currently attached to **
** the network **
** Others: None **
** **
***************************************************************************/
int nas_proc_get_attach_status(nas_user_t *user)
bool nas_proc_get_attach_status(nas_user_t *user)
{
LOG_FUNC_IN;
int is_attached = emm_main_is_attached(user->emm_data);
bool is_attached = emm_main_is_attached(user->emm_data);
LOG_FUNC_RETURN (is_attached);
}
@@ -690,10 +690,10 @@ int nas_proc_get_pdn_status(nas_user_t *user, int *cids, int *states, int n_pdn_
/* For all PDN contexts */
for (cid = 1; (cid < n_pdn+1) && (n_defined_pdn < n_pdn_max); cid++) {
/* Get the status of this PDN */
int state = FALSE;
int is_defined = esm_main_get_pdn_status(user, cid, &state);
bool state = false;
bool is_defined = esm_main_get_pdn_status(user, cid, &state);
if (is_defined != FALSE) {
if (is_defined != false) {
/* This PDN has been defined */
*(cids++) = cid;
*(states++) = state;
@@ -734,7 +734,7 @@ int nas_proc_get_pdn_param(esm_data_t *esm_data, int *cids, int *types, const ch
/* For all PDN contexts */
for (cid = 1; (cid < n_pdn+1) && (n_defined_pdn < n_pdn_max); cid++) {
int emergency, active;
bool emergency, active;
/* Get PDN connection parameters */
int rc = esm_main_get_pdn(esm_data, cid, types, apns, &emergency, &active);
@@ -845,8 +845,8 @@ int nas_proc_set_pdn(nas_user_t *user, int cid, int type, const char *apn, int i
esm_sap_t esm_sap;
esm_sap.primitive = ESM_PDN_CONNECTIVITY_REQ;
esm_sap.is_standalone = TRUE;
esm_sap.data.pdn_connect.is_defined = FALSE;
esm_sap.is_standalone = true;
esm_sap.data.pdn_connect.is_defined = false;
esm_sap.data.pdn_connect.cid = cid;
esm_sap.data.pdn_connect.pdn_type = type;
esm_sap.data.pdn_connect.apn = apn;
@@ -882,8 +882,8 @@ int nas_proc_reset_pdn(nas_user_t *user, int cid)
esm_sap_t esm_sap;
esm_sap.primitive = ESM_PDN_CONNECTIVITY_REJ;
esm_sap.is_standalone = TRUE;
esm_sap.data.pdn_connect.is_defined = TRUE;
esm_sap.is_standalone = true;
esm_sap.data.pdn_connect.is_defined = true;
esm_sap.data.pdn_connect.cid = cid;
/*
* Notify ESM that the specified PDN context has to be undefined
@@ -916,7 +916,7 @@ int nas_proc_deactivate_pdn(nas_user_t *user, int cid)
if (cid > 0) {
/* Deactivate only the specified PDN context */
rc = _nas_proc_deactivate(user, cid, FALSE);
rc = _nas_proc_deactivate(user, cid, false);
} else {
/* Do not deactivate the PDN connection established during initial
* network attachment (identifier 1) */
@@ -924,7 +924,7 @@ int nas_proc_deactivate_pdn(nas_user_t *user, int cid)
/* Deactivate all active PDN contexts */
while ((rc != RETURNerror) && (cid < esm_main_get_nb_pdns_max(user->esm_data)+1)) {
rc = _nas_proc_deactivate(user, cid++, TRUE);
rc = _nas_proc_deactivate(user, cid++, true);
}
}
@@ -970,13 +970,13 @@ int nas_proc_activate_pdn(nas_user_t *user, int cid)
if (rc != RETURNerror) {
if (cid > 0) {
/* Activate only the specified PDN context */
rc = _nas_proc_activate(user, cid, FALSE);
rc = _nas_proc_activate(user, cid, false);
} else {
cid = 1;
/* Activate all defined PDN contexts */
while ((rc != RETURNerror) && (cid < esm_main_get_nb_pdns_max(user->esm_data)+1)) {
rc = _nas_proc_activate(user, cid++, TRUE);
rc = _nas_proc_activate(user, cid++, true);
}
}
}
@@ -1177,7 +1177,7 @@ int nas_proc_ul_transfer_cnf(nas_user_t *user)
*/
emm_sap.primitive = EMMAS_DATA_IND;
emm_sap.u.emm_as.u.data.ueid = user->ueid;
emm_sap.u.emm_as.u.data.delivered = TRUE;
emm_sap.u.emm_as.u.data.delivered = true;
emm_sap.u.emm_as.u.data.NASmsg.length = 0;
rc = emm_sap_send(user, &emm_sap);
@@ -1214,7 +1214,7 @@ int nas_proc_ul_transfer_rej(nas_user_t *user)
*/
emm_sap.primitive = EMMAS_DATA_IND;
emm_sap.u.emm_as.u.data.ueid = user->ueid;
emm_sap.u.emm_as.u.data.delivered = FALSE;
emm_sap.u.emm_as.u.data.delivered = false;
emm_sap.u.emm_as.u.data.NASmsg.length = 0;
rc = emm_sap_send(user, &emm_sap);
@@ -1251,7 +1251,7 @@ int nas_proc_dl_transfer_ind(nas_user_t *user, const Byte_t *data, uint32_t len)
*/
emm_sap.primitive = EMMAS_DATA_IND;
emm_sap.u.emm_as.u.data.ueid = user->ueid;
emm_sap.u.emm_as.u.data.delivered = TRUE;
emm_sap.u.emm_as.u.data.delivered = true;
emm_sap.u.emm_as.u.data.NASmsg.length = len;
emm_sap.u.emm_as.u.data.NASmsg.value = (uint8_t *)data;
rc = emm_sap_send(user, &emm_sap);
@@ -1274,7 +1274,7 @@ int nas_proc_dl_transfer_ind(nas_user_t *user, const Byte_t *data, uint32_t len)
** **
** Inputs: cid: Identifier of the PDN context used to es- **
** tablished connectivity to specified PDN **
** apply_to_all: TRUE if the PDN connectivity procedure is **
** apply_to_all: true if the PDN connectivity procedure is **
** initiated to establish connectivity to all **
** defined PDNs **
** Others: None **
@@ -1284,12 +1284,12 @@ int nas_proc_dl_transfer_ind(nas_user_t *user, const Byte_t *data, uint32_t len)
** Others: None **
** **
***************************************************************************/
static int _nas_proc_activate(nas_user_t *user, int cid, int apply_to_all)
static int _nas_proc_activate(nas_user_t *user, int cid, bool apply_to_all)
{
LOG_FUNC_IN;
int rc;
int active = FALSE;
bool active = false;
esm_sap_t esm_sap;
@@ -1332,8 +1332,8 @@ static int _nas_proc_activate(nas_user_t *user, int cid, int apply_to_all)
* for the specified PDN
*/
esm_sap.primitive = ESM_PDN_CONNECTIVITY_REQ;
esm_sap.is_standalone = TRUE;
esm_sap.data.pdn_connect.is_defined = TRUE;
esm_sap.is_standalone = true;
esm_sap.data.pdn_connect.is_defined = true;
esm_sap.data.pdn_connect.cid = cid;
rc = esm_sap_send(user, &esm_sap);
@@ -1347,7 +1347,7 @@ static int _nas_proc_activate(nas_user_t *user, int cid, int apply_to_all)
** Description: Initiates a PDN disconnect procedure **
** **
** Inputs: cid: Identifier of the PDN context **
** apply_to_all: TRUE if the PDN disconnect procedure is **
** apply_to_all: true if the PDN disconnect procedure is **
** initiated to request disconnection from **
** all active PDNs **
** Others: None **
@@ -1357,15 +1357,15 @@ static int _nas_proc_activate(nas_user_t *user, int cid, int apply_to_all)
** Others: None **
** **
***************************************************************************/
static int _nas_proc_deactivate(nas_user_t *user, int cid, int apply_to_all)
static int _nas_proc_deactivate(nas_user_t *user, int cid, bool apply_to_all)
{
LOG_FUNC_IN;
int rc;
int pdn_type;
const char *apn;
int emergency = FALSE;
int active = FALSE;
bool emergency = false;
bool active = false;
/* Get PDN context parameters */
rc = esm_main_get_pdn(user->esm_data, cid, &pdn_type, &apn, &emergency, &active);
+4 -4
View File
@@ -74,7 +74,7 @@ void nas_proc_cleanup(nas_user_t *user);
int nas_proc_enable_s1_mode(nas_user_t *user);
int nas_proc_disable_s1_mode(nas_user_t *user);
int nas_proc_get_eps(nas_user_t *user, int *stat);
int nas_proc_get_eps(nas_user_t *user, bool *stat);
int nas_proc_get_imsi(emm_data_t *emm_data, char *imsi_str);
int nas_proc_get_msisdn(nas_user_t *user, char *msisdn_str, int *ton_npi);
@@ -83,16 +83,16 @@ int nas_proc_get_signal_quality(nas_user_t *user, int *rsrq, int *rsrp);
int nas_proc_register(nas_user_t *user, int mode, int format, const network_plmn_t *oper, int AcT);
int nas_proc_deregister(nas_user_t *user);
int nas_proc_get_reg_data(nas_user_t *user, int *mode, int *selected, int format,
int nas_proc_get_reg_data(nas_user_t *user, int *mode, bool *selected, int format,
network_plmn_t *oper, int *AcT);
int nas_proc_get_oper_list(nas_user_t *user, const char **oper_list);
int nas_proc_get_reg_status(nas_user_t *user, int *stat);
int nas_proc_get_loc_info(nas_user_t *user, char *tac, char *ci, int *AcT);
int nas_proc_detach(nas_user_t *user, int switch_off);
int nas_proc_detach(nas_user_t *user, bool switch_off);
int nas_proc_attach(nas_user_t *user);
int nas_proc_get_attach_status(nas_user_t *user);
bool nas_proc_get_attach_status(nas_user_t *user);
int nas_proc_reset_pdn(nas_user_t *user, int cid);
int nas_proc_set_pdn(nas_user_t *user, int cid, int type, const char *apn, int ipv4_addr,
+3 -1
View File
@@ -1,12 +1,14 @@
#ifndef _NAS_PROC_DEFS_H
#define _NAS_PROC_DEFS_H
#include <stdbool.h>
/*
* Local NAS data
*/
typedef struct {
/* EPS capibility status */
int EPS_capability_status;
bool EPS_capability_status;
/* Reference signal received quality */
int rsrq;
/* Reference signal received power */
+3 -3
View File
@@ -43,10 +43,10 @@ uint16_t ue_idx_standalone = 0xFFFF;
char *make_port_str_from_ueid(const char *base_port_str, int ueid);
static int nas_ue_process_events(nas_user_container_t *users, struct epoll_event *events, int nb_events)
static bool nas_ue_process_events(nas_user_container_t *users, struct epoll_event *events, int nb_events)
{
int event;
int exit_loop = FALSE;
bool exit_loop = false;
LOG_I(NAS, "[UE] Received %d events\n", nb_events);
@@ -310,7 +310,7 @@ void *nas_ue_task(void *args_p)
nb_events = itti_get_events(TASK_NAS_UE, &events);
if ((nb_events > 0) && (events != NULL)) {
if (nas_ue_process_events(users, events, nb_events) == TRUE) {
if (nas_ue_process_events(users, events, nb_events) == true) {
LOG_E(NAS, "[UE] Received exit loop\n");
}
}
+11 -11
View File
@@ -187,10 +187,10 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
** from which data have been received **
** Others: None **
** **
** Outputs: Return: FALSE, TRUE **
** Outputs: Return: false, true **
** **
***************************************************************************/
int nas_user_receive_and_process(nas_user_t *user, char *message)
bool nas_user_receive_and_process(nas_user_t *user, char *message)
{
LOG_FUNC_IN;
@@ -212,13 +212,13 @@ int nas_user_receive_and_process(nas_user_t *user, char *message)
* exit from the receiving loop */
LOG_TRACE (ERROR, "UE-MAIN - "
"Failed to read data from the user application layer");
LOG_FUNC_RETURN(TRUE);
LOG_FUNC_RETURN(true);
}
}
if (bytes == 0) {
/* A signal was caught before any data were available */
LOG_FUNC_RETURN(FALSE);
LOG_FUNC_RETURN(false);
}
/* Decode the user data message */
@@ -268,12 +268,12 @@ int nas_user_receive_and_process(nas_user_t *user, char *message)
* exit from the receiving loop */
LOG_TRACE (ERROR, "UE-MAIN - "
"Failed to send data to the user application layer");
LOG_FUNC_RETURN(TRUE);
LOG_FUNC_RETURN(true);
}
}
}
LOG_FUNC_RETURN(FALSE);
LOG_FUNC_RETURN(false);
}
/****************************************************************************
@@ -989,7 +989,7 @@ static int _nas_user_proc_cops(nas_user_t *user, const at_command_t *data)
char oper_buffer[NET_FORMAT_MAX_SIZE], *oper = oper_buffer;
memset(oper, 0, NET_FORMAT_MAX_SIZE);
int oper_is_selected;
bool oper_is_selected;
at_response->id = data->id;
at_response->type = data->type;
@@ -1266,7 +1266,7 @@ static int _nas_user_proc_cgatt(nas_user_t *user, const at_command_t *data)
if (data->command.cgatt.state == AT_CGATT_ATTACHED) {
ret_code = nas_proc_attach(user);
} else if (data->command.cgatt.state == AT_CGATT_DETACHED) {
ret_code = nas_proc_detach(user, FALSE);
ret_code = nas_proc_detach(user, false);
}
if (ret_code != RETURNok) {
@@ -1284,7 +1284,7 @@ static int _nas_user_proc_cgatt(nas_user_t *user, const at_command_t *data)
/*
* Read command returns the current EPS service state.
*/
if (nas_proc_get_attach_status(user) != TRUE) {
if (nas_proc_get_attach_status(user) != true) {
cgatt->state = AT_CGATT_DETACHED;
} else {
cgatt->state = AT_CGATT_ATTACHED;
@@ -1821,7 +1821,7 @@ static int _nas_user_proc_cgdcont(nas_user_t *user, const at_command_t *data)
int emergency = AT_CGDCONT_EBS_DEFAULT;
int p_cscf = AT_CGDCONT_PCSCF_DEFAULT;
int im_cn_signalling = AT_CGDCONT_IM_CM_DEFAULT;
int reset_pdn = TRUE;
bool reset_pdn = true;
at_response->id = data->id;
at_response->type = data->type;
@@ -1870,7 +1870,7 @@ static int _nas_user_proc_cgdcont(nas_user_t *user, const at_command_t *data)
break;
}
reset_pdn = FALSE;
reset_pdn = false;
}
if (data->mask & AT_CGDCONT_APN_MASK) {
+1 -1
View File
@@ -63,7 +63,7 @@ Description NAS procedure functions triggered by the user
void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
esm_indication_callback_t esm_cb, const char *version);
int nas_user_receive_and_process(nas_user_t *user, char *message);
bool nas_user_receive_and_process(nas_user_t *user, char *message);
int nas_user_process_data(nas_user_t *user, const void *data);