UE/EMM: add nas_user_t parameter to emm_sap_send

Surprisingly, it touches every part of openair3, and most of the prototype.
Moreover, a special attention have been put to callback review.
However, there are still places to fix or review indicated by FIXME
This commit is contained in:
Frédéric Leroy
2017-01-25 13:08:19 +01:00
parent 4742178aee
commit 223247ceb0
46 changed files with 380 additions and 349 deletions
+2 -2
View File
@@ -86,7 +86,7 @@ Description Implements the EPS Mobility Management procedures executed
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregistered(const emm_reg_t *evt)
int EmmDeregistered(nas_user_t *user, const emm_reg_t *evt)
{
LOG_FUNC_IN;
@@ -149,7 +149,7 @@ int EmmDeregistered(const emm_reg_t *evt)
if (rc != RETURNerror) {
/* Restart the attach procedure */
rc = emm_proc_attach_restart();
rc = emm_proc_attach_restart(user);
}
break;
@@ -79,7 +79,7 @@ Description Implements the EPS Mobility Management procedures executed
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredAttemptingToAttach(const emm_reg_t *evt)
int EmmDeregisteredAttemptingToAttach(nas_user_t *user, const emm_reg_t *evt)
{
LOG_FUNC_IN;
@@ -104,7 +104,7 @@ int EmmDeregisteredAttemptingToAttach(const emm_reg_t *evt)
if (rc != RETURNerror) {
/* Restart the attach procedure */
rc = emm_proc_attach_restart();
rc = emm_proc_attach_restart(user);
}
break;
@@ -83,7 +83,7 @@ Description Implements the EPS Mobility Management procedures executed
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredLimitedService(const emm_reg_t *evt)
int EmmDeregisteredLimitedService(nas_user_t *user, const emm_reg_t *evt)
{
LOG_FUNC_IN;
@@ -109,7 +109,7 @@ int EmmDeregisteredLimitedService(const emm_reg_t *evt)
/*
* Initiate attach procedure for emergency bearer services
*/
rc = emm_proc_attach(EMM_ATTACH_TYPE_EMERGENCY);
rc = emm_proc_attach(user, EMM_ATTACH_TYPE_EMERGENCY);
break;
case _EMMREG_ATTACH_REQ:
@@ -84,7 +84,7 @@ Description Implements the EPS Mobility Management procedures executed
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredNoCellAvailable(const emm_reg_t *evt)
int EmmDeregisteredNoCellAvailable(nas_user_t *user, const emm_reg_t *evt)
{
LOG_FUNC_IN;
@@ -118,7 +118,7 @@ int EmmDeregisteredNoCellAvailable(const emm_reg_t *evt)
/*
* Perform network re-selection procedure
*/
rc = emm_proc_plmn_selection(evt->u.regist.index);
rc = emm_proc_plmn_selection(user, evt->u.regist.index);
}
break;
@@ -84,7 +84,7 @@ extern uint8_t usim_test;
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredNormalService(const emm_reg_t *evt)
int EmmDeregisteredNormalService(nas_user_t *user, const emm_reg_t *evt)
{
LOG_FUNC_IN;
@@ -112,11 +112,11 @@ int EmmDeregisteredNormalService(const emm_reg_t *evt)
*/
if(usim_test == 0)
{
rc = emm_proc_attach(EMM_ATTACH_TYPE_EPS);
rc = emm_proc_attach(user, EMM_ATTACH_TYPE_EPS);
}
else
{
rc = emm_proc_attach(EMM_ATTACH_TYPE_IMSI); // CMW500 IMSI initial attach expected
rc = emm_proc_attach(user, EMM_ATTACH_TYPE_IMSI); // CMW500 IMSI initial attach expected
}
break;
@@ -82,7 +82,7 @@ Description Implements the EPS Mobility Management procedures executed
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmDeregisteredPlmnSearch(const emm_reg_t *evt)
int EmmDeregisteredPlmnSearch(nas_user_t *user, const emm_reg_t *evt)
{
LOG_FUNC_IN;
@@ -122,7 +122,7 @@ int EmmDeregisteredPlmnSearch(const emm_reg_t *evt)
/*
* Perform network selection procedure
*/
rc = emm_proc_plmn_selection(evt->u.regist.index);
rc = emm_proc_plmn_selection(user, evt->u.regist.index);
break;
case _EMMREG_REGISTER_REJ:
+2 -2
View File
@@ -76,7 +76,7 @@ Description Implements the EPS Mobility Management procedures executed
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmNull(const emm_reg_t *evt)
int EmmNull(nas_user_t *user, const emm_reg_t *evt)
{
LOG_FUNC_IN;
@@ -104,7 +104,7 @@ int EmmNull(const emm_reg_t *evt)
* establish an EMM context and make the UE reachable by an MME.
*/
if (rc != RETURNerror) {
rc = emm_proc_initialize();
rc = emm_proc_initialize(user);
}
break;
+2 -2
View File
@@ -81,7 +81,7 @@ Description Implements the EPS Mobility Management procedures executed
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegistered(const emm_reg_t *evt)
int EmmRegistered(nas_user_t *user, const emm_reg_t *evt)
{
LOG_FUNC_IN;
@@ -96,7 +96,7 @@ int EmmRegistered(const emm_reg_t *evt)
/*
* Initiate detach procedure for EPS services
*/
rc = emm_proc_detach(EMM_DETACH_TYPE_EPS, evt->u.detach.switch_off);
rc = emm_proc_detach(user, EMM_DETACH_TYPE_EPS, evt->u.detach.switch_off);
break;
case _EMMREG_DETACH_REQ:
@@ -78,7 +78,7 @@ Description Implements the EPS Mobility Management procedures executed
** Others: emm_fsm_status **
** **
***************************************************************************/
int EmmRegisteredInitiated(const emm_reg_t *evt)
int EmmRegisteredInitiated(nas_user_t *user, const emm_reg_t *evt)
{
LOG_FUNC_IN;
@@ -103,7 +103,7 @@ int EmmRegisteredInitiated(const emm_reg_t *evt)
if (rc != RETURNerror) {
/* Restart the attach procedure */
rc = emm_proc_attach_restart();
rc = emm_proc_attach_restart(user);
}
break;
@@ -209,7 +209,7 @@ int EmmRegisteredInitiated(const emm_reg_t *evt)
/*
* Initiate detach procedure for EPS services
*/
rc = emm_proc_detach(EMM_DETACH_TYPE_EPS, evt->u.detach.switch_off);
rc = emm_proc_detach(user, EMM_DETACH_TYPE_EPS, evt->u.detach.switch_off);
break;
case _EMMREG_DETACH_REQ:
+35 -35
View File
@@ -99,19 +99,19 @@ static const char *_emm_as_primitive_str[] = {
* Functions executed to process EMM procedures upon receiving
* data from the network
*/
static int _emm_as_recv(unsigned int ueid, const char *msg, int len,
static int _emm_as_recv(nas_user_t *user, unsigned int ueid, const char *msg, int len,
int *emm_cause);
static int _emm_as_establish_cnf(const emm_as_establish_t *msg, int *emm_cause);
static int _emm_as_establish_rej(void);
static int _emm_as_release_ind(const emm_as_release_t *msg);
static int _emm_as_establish_cnf(nas_user_t *user, const emm_as_establish_t *msg, int *emm_cause);
static int _emm_as_establish_rej(nas_user_t *user);
static int _emm_as_release_ind(nas_user_t *user, const emm_as_release_t *msg);
static int _emm_as_page_ind(const emm_as_page_t *msg);
static int _emm_as_cell_info_res(const emm_as_cell_info_t *msg);
static int _emm_as_cell_info_ind(const emm_as_cell_info_t *msg);
static int _emm_as_data_ind(const emm_as_data_t *msg, int *emm_cause);
static int _emm_as_data_ind(nas_user_t *user, const emm_as_data_t *msg, int *emm_cause);
/*
* Functions executed to send data to the network when requested
@@ -133,7 +133,7 @@ static int _emm_as_encrypt(
int length,
emm_security_context_t *emm_security_context);
static int _emm_as_send(const emm_as_t *msg);
static int _emm_as_send(const nas_user_t *user, const emm_as_t *msg);
static int _emm_as_security_res(const emm_as_security_t *,
ul_info_transfer_req_t *);
@@ -143,7 +143,7 @@ static int _emm_as_establish_req(const emm_as_establish_t *,
static int _emm_as_cell_info_req(const emm_as_cell_info_t *, cell_info_req_t *);
static int _emm_as_data_req(const emm_as_data_t *, ul_info_transfer_req_t *);
static int _emm_as_data_req(const emm_as_data_t *msg, ul_info_transfer_req_t *);
static int _emm_as_status_ind(const emm_as_status_t *, ul_info_transfer_req_t *);
static int _emm_as_release_req(const emm_as_release_t *, nas_release_req_t *);
@@ -165,7 +165,7 @@ static int _emm_as_release_req(const emm_as_release_t *, nas_release_req_t *);
** Others: NONE **
** **
***************************************************************************/
void emm_as_initialize(void)
void emm_as_initialize(nas_user_t *user)
{
LOG_FUNC_IN;
@@ -188,7 +188,7 @@ void emm_as_initialize(void)
** Others: None **
** **
***************************************************************************/
int emm_as_send(const emm_as_t *msg)
int emm_as_send(nas_user_t *user, const emm_as_t *msg)
{
LOG_FUNC_IN;
@@ -203,21 +203,21 @@ int emm_as_send(const emm_as_t *msg)
switch (primitive) {
case _EMMAS_DATA_IND:
rc = _emm_as_data_ind(&msg->u.data, &emm_cause);
rc = _emm_as_data_ind(user, &msg->u.data, &emm_cause);
ueid = msg->u.data.ueid;
break;
case _EMMAS_ESTABLISH_CNF:
rc = _emm_as_establish_cnf(&msg->u.establish, &emm_cause);
rc = _emm_as_establish_cnf(user, &msg->u.establish, &emm_cause);
break;
case _EMMAS_ESTABLISH_REJ:
rc = _emm_as_establish_rej();
rc = _emm_as_establish_rej(user);
break;
case _EMMAS_RELEASE_IND:
rc = _emm_as_release_ind(&msg->u.release);
rc = _emm_as_release_ind(user, &msg->u.release);
break;
case _EMMAS_PAGE_IND:
@@ -234,7 +234,7 @@ int emm_as_send(const emm_as_t *msg)
default:
/* Other primitives are forwarded to the Access Stratum */
rc = _emm_as_send(msg);
rc = _emm_as_send(user, msg);
if (rc != RETURNok) {
LOG_TRACE(ERROR, "EMMAS-SAP - "
@@ -306,7 +306,7 @@ int emm_as_send(const emm_as_t *msg)
** Others: None **
** **
***************************************************************************/
static int _emm_as_recv(unsigned int ueid, const char *msg, int len,
static int _emm_as_recv(nas_user_t *user, unsigned int ueid, const char *msg, int len,
int *emm_cause)
{
LOG_FUNC_IN;
@@ -342,30 +342,30 @@ static int _emm_as_recv(unsigned int ueid, const char *msg, int len,
break;
case IDENTITY_REQUEST:
rc = emm_recv_identity_request(&emm_msg->identity_request,
rc = emm_recv_identity_request(user, &emm_msg->identity_request,
emm_cause);
break;
case AUTHENTICATION_REQUEST:
rc = emm_recv_authentication_request(
rc = emm_recv_authentication_request(user,
&emm_msg->authentication_request,
emm_cause);
break;
case AUTHENTICATION_REJECT:
rc = emm_recv_authentication_reject(
rc = emm_recv_authentication_reject(user,
&emm_msg->authentication_reject,
emm_cause);
break;
case SECURITY_MODE_COMMAND:
rc = emm_recv_security_mode_command(
rc = emm_recv_security_mode_command(user,
&emm_msg->security_mode_command,
emm_cause);
break;
case DETACH_ACCEPT:
rc = emm_recv_detach_accept(&emm_msg->detach_accept, emm_cause);
rc = emm_recv_detach_accept(user, &emm_msg->detach_accept, emm_cause);
break;
@@ -406,7 +406,7 @@ static int _emm_as_recv(unsigned int ueid, const char *msg, int len,
** Others: None **
** **
***************************************************************************/
static int _emm_as_data_ind(const emm_as_data_t *msg, int *emm_cause)
static int _emm_as_data_ind(nas_user_t *user, const emm_as_data_t *msg, int *emm_cause)
{
LOG_FUNC_IN;
@@ -443,23 +443,23 @@ static int _emm_as_data_ind(const emm_as_data_t *msg, int *emm_cause)
} else if (header.protocol_discriminator ==
EPS_MOBILITY_MANAGEMENT_MESSAGE) {
/* Process EMM data */
rc = _emm_as_recv(msg->ueid, plain_msg, bytes, emm_cause);
rc = _emm_as_recv(user, msg->ueid, plain_msg, bytes, emm_cause);
} else if (header.protocol_discriminator ==
EPS_SESSION_MANAGEMENT_MESSAGE) {
const OctetString data = {bytes, (uint8_t *)plain_msg};
/* Foward ESM data to EPS session management */
rc = lowerlayer_data_ind(msg->ueid, &data);
rc = lowerlayer_data_ind(user, msg->ueid, &data);
}
free(plain_msg);
}
} else {
/* Process successfull lower layer transfer indication */
rc = lowerlayer_success(msg->ueid);
rc = lowerlayer_success(user, msg->ueid);
}
} else {
/* Process lower layer transmission failure of NAS message */
rc = lowerlayer_failure(msg->ueid);
rc = lowerlayer_failure(user, msg->ueid);
}
LOG_FUNC_RETURN (rc);
@@ -482,7 +482,7 @@ static int _emm_as_data_ind(const emm_as_data_t *msg, int *emm_cause)
** Others: None **
** **
***************************************************************************/
static int _emm_as_establish_cnf(const emm_as_establish_t *msg,
static int _emm_as_establish_cnf(nas_user_t *user, const emm_as_establish_t *msg,
int *emm_cause)
{
LOG_FUNC_IN;
@@ -494,11 +494,11 @@ static int _emm_as_establish_cnf(const emm_as_establish_t *msg,
if (msg->NASmsg.length > 0) {
/* The NAS signalling connection is established */
(void) lowerlayer_establish();
(void) lowerlayer_establish(user);
} else {
/* The initial NAS message has been successfully delivered to
* lower layers */
rc = lowerlayer_success(0);
rc = lowerlayer_success(user, 0);
LOG_FUNC_RETURN (rc);
}
@@ -523,11 +523,11 @@ static int _emm_as_establish_cnf(const emm_as_establish_t *msg,
switch (emm_msg->header.message_type) {
case ATTACH_ACCEPT:
rc = emm_recv_attach_accept(&emm_msg->attach_accept, emm_cause);
rc = emm_recv_attach_accept(user, &emm_msg->attach_accept, emm_cause);
break;
case ATTACH_REJECT:
rc = emm_recv_attach_reject(&emm_msg->attach_reject, emm_cause);
rc = emm_recv_attach_reject(user, &emm_msg->attach_reject, emm_cause);
break;
case DETACH_ACCEPT:
@@ -563,7 +563,7 @@ static int _emm_as_establish_cnf(const emm_as_establish_t *msg,
** Others: None **
** **
***************************************************************************/
static int _emm_as_establish_rej(void)
static int _emm_as_establish_rej(nas_user_t *user)
{
LOG_FUNC_IN;
@@ -573,7 +573,7 @@ static int _emm_as_establish_rej(void)
"failure");
/* Process lower layer transmission failure of initial NAS message */
rc = lowerlayer_failure(0);
rc = lowerlayer_failure(user, 0);
LOG_FUNC_RETURN (rc);
}
@@ -595,7 +595,7 @@ static int _emm_as_establish_rej(void)
** Others: None **
** **
***************************************************************************/
static int _emm_as_release_ind(const emm_as_release_t *msg)
static int _emm_as_release_ind(nas_user_t *user, const emm_as_release_t *msg)
{
LOG_FUNC_IN;
@@ -605,7 +605,7 @@ static int _emm_as_release_ind(const emm_as_release_t *msg)
"(cause=%d)", msg->cause);
/* Process NAS signalling connection release indication */
rc = lowerlayer_release(msg->cause);
rc = lowerlayer_release(user, msg->cause);
LOG_FUNC_RETURN (rc);
}
@@ -928,7 +928,7 @@ _emm_as_encrypt(
** Others: None **
** **
***************************************************************************/
static int _emm_as_send(const emm_as_t *msg)
static int _emm_as_send(const nas_user_t *user, const emm_as_t *msg)
{
LOG_FUNC_IN;
+3 -2
View File
@@ -41,6 +41,7 @@ Description Defines the EMMAS Service Access Point that provides
#define __EMM_AS_H__
#include "emm_asDef.h"
#include "user_defs.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
@@ -58,8 +59,8 @@ Description Defines the EMMAS Service Access Point that provides
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
void emm_as_initialize(void);
void emm_as_initialize(nas_user_t *user);
int emm_as_send(const emm_as_t *msg);
int emm_as_send(nas_user_t *user, const emm_as_t *msg);
#endif /* __EMM_AS_H__*/
+4 -4
View File
@@ -108,7 +108,7 @@ void emm_esm_initialize(void)
** Others: None **
** **
***************************************************************************/
int emm_esm_send(const emm_esm_t *msg)
int emm_esm_send(nas_user_t *user, const emm_esm_t *msg)
{
LOG_FUNC_IN;
@@ -123,7 +123,7 @@ int emm_esm_send(const emm_esm_t *msg)
case _EMMESM_ESTABLISH_REQ:
/* ESM requests EMM to initiate an attach procedure before
* requesting subsequent connectivity to additional PDNs */
rc = emm_proc_attach_restart();
rc = emm_proc_attach_restart(user);
break;
case _EMMESM_ESTABLISH_CNF:
@@ -138,7 +138,7 @@ int emm_esm_send(const emm_esm_t *msg)
}
} else {
/* Consider the UE locally detached from the network */
rc = emm_proc_attach_set_detach();
rc = emm_proc_attach_set_detach(user);
}
break;
@@ -149,7 +149,7 @@ int emm_esm_send(const emm_esm_t *msg)
case _EMMESM_UNITDATA_REQ:
/* ESM requests EMM to transfer ESM data unit to lower layer */
rc = lowerlayer_data_req(msg->ueid, &msg->u.data.msg);
rc = lowerlayer_data_req(user, msg->ueid, &msg->u.data.msg);
break;
default:
+2 -1
View File
@@ -42,6 +42,7 @@ Description Defines the EMMESM Service Access Point that provides
#define __EMM_ESM_H__
#include "emm_esmDef.h"
#include "user_defs.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
@@ -61,6 +62,6 @@ Description Defines the EMMESM Service Access Point that provides
void emm_esm_initialize(void);
int emm_esm_send(const emm_esm_t *msg);
int emm_esm_send(nas_user_t *user, const emm_esm_t *msg);
#endif /* __EMM_ESM_H__*/
+15 -15
View File
@@ -125,7 +125,7 @@ int emm_recv_status(unsigned int ueid, emm_status_msg *msg, int *emm_cause)
** Others: None **
** **
***************************************************************************/
int emm_recv_attach_accept(attach_accept_msg *msg, int *emm_cause)
int emm_recv_attach_accept(nas_user_t *user, attach_accept_msg *msg, int *emm_cause)
{
LOG_FUNC_IN;
@@ -224,7 +224,7 @@ int emm_recv_attach_accept(attach_accept_msg *msg, int *emm_cause)
}
/* Execute attach procedure accepted by the network */
rc = emm_proc_attach_accept(T3412, T3402, T3423, n_tais, tai, pguti,
rc = emm_proc_attach_accept(user, T3412, T3402, T3423, n_tais, tai, pguti,
n_eplmns, &eplmn,
&msg->esmmessagecontainer.esmmessagecontainercontents);
@@ -245,7 +245,7 @@ int emm_recv_attach_accept(attach_accept_msg *msg, int *emm_cause)
** Others: None **
** **
***************************************************************************/
int emm_recv_attach_reject(attach_reject_msg *msg, int *emm_cause)
int emm_recv_attach_reject(nas_user_t *user, attach_reject_msg *msg, int *emm_cause)
{
LOG_FUNC_IN;
@@ -275,11 +275,11 @@ int emm_recv_attach_reject(attach_reject_msg *msg, int *emm_cause)
*/
if (msg->presencemask & ATTACH_REJECT_ESM_MESSAGE_CONTAINER_PRESENT) {
/* Execute attach procedure rejected by the network */
rc = emm_proc_attach_reject(msg->emmcause,
rc = emm_proc_attach_reject(user, msg->emmcause,
&msg->esmmessagecontainer.esmmessagecontainercontents);
} else {
/* Execute attach procedure rejected by the network */
rc = emm_proc_attach_reject(msg->emmcause, NULL);
rc = emm_proc_attach_reject(user, msg->emmcause, NULL);
}
LOG_FUNC_RETURN (rc);
@@ -299,7 +299,7 @@ int emm_recv_attach_reject(attach_reject_msg *msg, int *emm_cause)
** Others: None **
** **
***************************************************************************/
int emm_recv_detach_accept(detach_accept_msg *msg, int *emm_cause)
int emm_recv_detach_accept(nas_user_t *user, detach_accept_msg *msg, int *emm_cause)
{
LOG_FUNC_IN;
@@ -311,7 +311,7 @@ int emm_recv_detach_accept(detach_accept_msg *msg, int *emm_cause)
* Message processing
*/
/* Execute the UE initiated detach procedure completion by the UE */
rc = emm_proc_detach_accept();
rc = emm_proc_detach_accept(user);
LOG_FUNC_RETURN (rc);
}
@@ -330,7 +330,7 @@ int emm_recv_detach_accept(detach_accept_msg *msg, int *emm_cause)
** Others: None **
** **
***************************************************************************/
int emm_recv_identity_request(identity_request_msg *msg, int *emm_cause)
int emm_recv_identity_request(nas_user_t *user, identity_request_msg *msg, int *emm_cause)
{
LOG_FUNC_IN;
@@ -358,7 +358,7 @@ int emm_recv_identity_request(identity_request_msg *msg, int *emm_cause)
}
/* Execute the identification procedure initiated by the network */
rc = emm_proc_identification_request(type);
rc = emm_proc_identification_request(user, type);
LOG_FUNC_RETURN (rc);
}
@@ -377,7 +377,7 @@ int emm_recv_identity_request(identity_request_msg *msg, int *emm_cause)
** Others: None **
** **
***************************************************************************/
int emm_recv_authentication_request(authentication_request_msg *msg,
int emm_recv_authentication_request(nas_user_t *user, authentication_request_msg *msg,
int *emm_cause)
{
LOG_FUNC_IN;
@@ -404,7 +404,7 @@ int emm_recv_authentication_request(authentication_request_msg *msg,
* Message processing
*/
/* Execute the authentication procedure initiated by the network */
rc = emm_proc_authentication_request(
rc = emm_proc_authentication_request(user,
msg->naskeysetidentifierasme.tsc != NAS_KEY_SET_IDENTIFIER_MAPPED,
msg->naskeysetidentifierasme.naskeysetidentifier,
&msg->authenticationparameterrand.rand,
@@ -427,7 +427,7 @@ int emm_recv_authentication_request(authentication_request_msg *msg,
** Others: None **
** **
***************************************************************************/
int emm_recv_authentication_reject(authentication_reject_msg *msg,
int emm_recv_authentication_reject(nas_user_t *user, authentication_reject_msg *msg,
int *emm_cause)
{
LOG_FUNC_IN;
@@ -440,7 +440,7 @@ int emm_recv_authentication_reject(authentication_reject_msg *msg,
* Message processing
*/
/* Execute the authentication procedure not accepted by the network */
rc = emm_proc_authentication_reject();
rc = emm_proc_authentication_reject(user);
LOG_FUNC_RETURN (rc);
}
@@ -459,7 +459,7 @@ int emm_recv_authentication_reject(authentication_reject_msg *msg,
** Others: None **
** **
***************************************************************************/
int emm_recv_security_mode_command(security_mode_command_msg *msg,
int emm_recv_security_mode_command(nas_user_t *user, security_mode_command_msg *msg,
int *emm_cause)
{
LOG_FUNC_IN;
@@ -473,7 +473,7 @@ int emm_recv_security_mode_command(security_mode_command_msg *msg,
*/
/* Execute the security mode control procedure initiated by the network */
LOG_TRACE(INFO,"Execute the security mode control procedure initiated by the network: imeisvrequest %d\n",msg->imeisvrequest);
rc = emm_proc_security_mode_command(
rc = emm_proc_security_mode_command(user,
msg->naskeysetidentifier.tsc != NAS_KEY_SET_IDENTIFIER_MAPPED,
msg->naskeysetidentifier.naskeysetidentifier,
msg->selectednassecurityalgorithms.typeofcipheringalgorithm,
+8 -8
View File
@@ -59,7 +59,7 @@ Description Defines functions executed at the EMMAS Service Access
#include "EmmInformation.h"
#include "DownlinkNasTransport.h"
#include "CsServiceNotification.h"
#include "user_defs.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
@@ -88,17 +88,17 @@ int emm_recv_status(unsigned int ueid, emm_status_msg *msg, int *emm_cause);
* Functions executed by the UE upon receiving EMM message from the network
* --------------------------------------------------------------------------
*/
int emm_recv_attach_accept(attach_accept_msg *msg, int *emm_cause);
int emm_recv_attach_reject(attach_reject_msg *msg, int *emm_cause);
int emm_recv_attach_accept(nas_user_t *user, attach_accept_msg *msg, int *emm_cause);
int emm_recv_attach_reject(nas_user_t *user, attach_reject_msg *msg, int *emm_cause);
int emm_recv_detach_accept(detach_accept_msg *msg, int *emm_cause);
int emm_recv_detach_accept(nas_user_t *user, detach_accept_msg *msg, int *emm_cause);
int emm_recv_identity_request(identity_request_msg *msg, int *emm_cause);
int emm_recv_authentication_request(authentication_request_msg *msg,
int emm_recv_identity_request(nas_user_t *user, identity_request_msg *msg, int *emm_cause);
int emm_recv_authentication_request(nas_user_t *user, authentication_request_msg *msg,
int *emm_cause);
int emm_recv_authentication_reject(authentication_reject_msg *msg,
int emm_recv_authentication_reject(nas_user_t *user, authentication_reject_msg *msg,
int *emm_cause);
int emm_recv_security_mode_command(security_mode_command_msg *msg,
int emm_recv_security_mode_command(nas_user_t *user, security_mode_command_msg *msg,
int *emm_cause);
#endif /* __EMM_RECV_H__*/
+6 -5
View File
@@ -46,6 +46,7 @@ Description Defines the EMM Service Access Points at which the EPS
#include "emm_reg.h"
#include "emm_esm.h"
#include "emm_as.h"
#include "user_defs.h"
/****************************************************************************/
/**************** E X T E R N A L D E F I N I T I O N S ****************/
@@ -73,13 +74,13 @@ Description Defines the EMM Service Access Points at which the EPS
** Others: NONE **
** **
***************************************************************************/
void emm_sap_initialize(void)
void emm_sap_initialize(nas_user_t *user)
{
LOG_FUNC_IN;
emm_reg_initialize();
emm_esm_initialize();
emm_as_initialize();
emm_as_initialize(user);
LOG_FUNC_OUT;
}
@@ -98,7 +99,7 @@ void emm_sap_initialize(void)
** Others: None **
** **
***************************************************************************/
int emm_sap_send(emm_sap_t *msg)
int emm_sap_send(nas_user_t *user, emm_sap_t *msg)
{
int rc = RETURNerror;
@@ -116,12 +117,12 @@ int emm_sap_send(emm_sap_t *msg)
(primitive < (emm_primitive_t)EMMESM_PRIMITIVE_MAX) ) {
/* Forward to the EMMESM-SAP */
msg->u.emm_esm.primitive = primitive;
rc = emm_esm_send(&msg->u.emm_esm);
rc = emm_esm_send(user, &msg->u.emm_esm);
} else if ( (primitive > (emm_primitive_t)EMMAS_PRIMITIVE_MIN) &&
(primitive < (emm_primitive_t)EMMAS_PRIMITIVE_MAX) ) {
/* Forward to the EMMAS-SAP */
msg->u.emm_as.primitive = primitive;
rc = emm_as_send(&msg->u.emm_as);
rc = emm_as_send(user, &msg->u.emm_as);
}
else {
LOG_TRACE(WARNING, "EMM-SAP - Out of range primitive (%d)", primitive);
+3 -2
View File
@@ -46,6 +46,7 @@ Description Defines the EMM Service Access Points at which the EPS
#include "emm_regDef.h"
#include "emm_esmDef.h"
#include "emm_asDef.h"
#include "user_defs.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
@@ -156,8 +157,8 @@ typedef struct emm_sap_s {
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
void emm_sap_initialize(void);
void emm_sap_initialize(nas_user_t *user);
int emm_sap_send(emm_sap_t *msg);
int emm_sap_send(nas_user_t *user, emm_sap_t *msg);
#endif /* __EMM_SAP_H__*/