Commit 295ed069 authored by Cedric Roux's avatar Cedric Roux

- Add re-synchronisation of SQN on S6A interface

- Corrected some bugs in NAS layer

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4755 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent b3bfef12
...@@ -120,6 +120,9 @@ typedef struct nas_auth_param_req_s { ...@@ -120,6 +120,9 @@ typedef struct nas_auth_param_req_s {
/* Indicates whether the procedure corresponds to a new connection or not */ /* Indicates whether the procedure corresponds to a new connection or not */
uint8_t initial_req:1; uint8_t initial_req:1;
uint8_t re_synchronization:1;
uint8_t auts[14];
} nas_auth_param_req_t; } nas_auth_param_req_t;
typedef struct nas_auth_param_rsp_s { typedef struct nas_auth_param_rsp_s {
......
#ifndef S6A_MESSAGES_TYPES_H_ #ifndef S6A_MESSAGES_TYPES_H_
#define S6A_MESSAGES_TYPES_H_ #define S6A_MESSAGES_TYPES_H_
typedef struct { #define AUTS_LENGTH 14
typedef struct s6a_update_location_req_s {
#define SKIP_SUBSCRIBER_DATA (0x1) #define SKIP_SUBSCRIBER_DATA (0x1)
unsigned skip_subsriber_data:1; unsigned skip_subsriber_data:1;
#define INITIAL_ATTACH (0x1) #define INITIAL_ATTACH (0x1)
...@@ -13,7 +15,7 @@ typedef struct { ...@@ -13,7 +15,7 @@ typedef struct {
rat_type_t rat_type; rat_type_t rat_type;
} s6a_update_location_req_t; } s6a_update_location_req_t;
typedef struct { typedef struct s6a_update_location_ans_s {
char imsi[IMSI_DIGITS_MAX + 1]; char imsi[IMSI_DIGITS_MAX + 1];
uint8_t imsi_length; uint8_t imsi_length;
...@@ -22,15 +24,22 @@ typedef struct { ...@@ -22,15 +24,22 @@ typedef struct {
subscription_data_t subscription_data; subscription_data_t subscription_data;
} s6a_update_location_ans_t; } s6a_update_location_ans_t;
typedef struct { typedef struct s6a_auth_info_req_s {
char imsi[IMSI_DIGITS_MAX + 1]; char imsi[IMSI_DIGITS_MAX + 1];
uint8_t imsi_length; uint8_t imsi_length;
plmn_t visited_plmn; plmn_t visited_plmn;
/* Number of vectors to retrieve from HSS, should be equal to one */ /* Number of vectors to retrieve from HSS, should be equal to one */
uint8_t nb_of_vectors; uint8_t nb_of_vectors;
/* Bit to indicate that USIM has requested a re-synchronization of SQN */
unsigned re_synchronization:1;
/* AUTS to provide to AUC.
* Only present and interpreted if re_synchronization == 1.
*/
uint8_t auts[AUTS_LENGTH];
} s6a_auth_info_req_t; } s6a_auth_info_req_t;
typedef struct { typedef struct s6a_auth_info_ans_s {
char imsi[IMSI_DIGITS_MAX + 1]; char imsi[IMSI_DIGITS_MAX + 1];
uint8_t imsi_length; uint8_t imsi_length;
......
...@@ -43,13 +43,17 @@ ...@@ -43,13 +43,17 @@
#include "assertions.h" #include "assertions.h"
static
int mme_app_request_authentication_info(const mme_app_imsi_t imsi, int mme_app_request_authentication_info(const mme_app_imsi_t imsi,
const uint8_t nb_of_vectors, const uint8_t nb_of_vectors,
const plmn_t *plmn); const plmn_t *plmn,
const uint8_t *auts);
static
int mme_app_request_authentication_info(const mme_app_imsi_t imsi, int mme_app_request_authentication_info(const mme_app_imsi_t imsi,
const uint8_t nb_of_vectors, const uint8_t nb_of_vectors,
const plmn_t *plmn) const plmn_t *plmn,
const uint8_t *auts)
{ {
s6a_auth_info_req_t *auth_info_req; s6a_auth_info_req_t *auth_info_req;
MessageDef *message_p; MessageDef *message_p;
...@@ -62,6 +66,13 @@ int mme_app_request_authentication_info(const mme_app_imsi_t imsi, ...@@ -62,6 +66,13 @@ int mme_app_request_authentication_info(const mme_app_imsi_t imsi,
MME_APP_IMSI_TO_STRING(imsi, auth_info_req->imsi); MME_APP_IMSI_TO_STRING(imsi, auth_info_req->imsi);
memcpy(&auth_info_req->visited_plmn, plmn, sizeof(plmn_t)); memcpy(&auth_info_req->visited_plmn, plmn, sizeof(plmn_t));
auth_info_req->nb_of_vectors = nb_of_vectors; auth_info_req->nb_of_vectors = nb_of_vectors;
if (auts != NULL) {
auth_info_req->re_synchronization = 1;
memcpy(auth_info_req->auts, auts, sizeof(auth_info_req->auts));
} else {
auth_info_req->re_synchronization = 0;
memset(auth_info_req->auts, 0, sizeof(auth_info_req->auts));
}
return itti_send_msg_to_task(TASK_S6A, INSTANCE_DEFAULT, message_p); return itti_send_msg_to_task(TASK_S6A, INSTANCE_DEFAULT, message_p);
} }
...@@ -286,6 +297,14 @@ void mme_app_handle_nas_auth_param_req(nas_auth_param_req_t ...@@ -286,6 +297,14 @@ void mme_app_handle_nas_auth_param_req(nas_auth_param_req_t
{ {
struct ue_context_s *ue_context; struct ue_context_s *ue_context;
uint64_t imsi = 0; uint64_t imsi = 0;
plmn_t visited_plmn_dongle = {
.MCCdigit3 = 2,
.MCCdigit2 = 0,
.MCCdigit1 = 8,
.MNCdigit3 = 2,
.MNCdigit2 = 9,
.MNCdigit1 = 0xF,
};
DevAssert(nas_auth_param_req_p != NULL); DevAssert(nas_auth_param_req_p != NULL);
...@@ -316,10 +335,10 @@ void mme_app_handle_nas_auth_param_req(nas_auth_param_req_t ...@@ -316,10 +335,10 @@ void mme_app_handle_nas_auth_param_req(nas_auth_param_req_t
/* We have no vector for this UE, send an authentication request /* We have no vector for this UE, send an authentication request
* to the HSS. * to the HSS.
*/ */
plmn_t plmn = { plmn_t visited_plmn_eur = {
.MCCdigit3 = 2,
.MCCdigit2 = 0, .MCCdigit2 = 0,
.MCCdigit1 = 8, .MCCdigit1 = 8,
.MCCdigit3 = 2,
.MNCdigit1 = 0, .MNCdigit1 = 0,
.MNCdigit2 = 4, .MNCdigit2 = 4,
.MNCdigit3 = 3, .MNCdigit3 = 3,
...@@ -328,12 +347,14 @@ void mme_app_handle_nas_auth_param_req(nas_auth_param_req_t ...@@ -328,12 +347,14 @@ void mme_app_handle_nas_auth_param_req(nas_auth_param_req_t
/* Acquire the current time */ /* Acquire the current time */
time(&ue_context->cell_age); time(&ue_context->cell_age);
memcpy(&ue_context->guti.gummei.plmn, &plmn, sizeof(plmn_t)); memcpy(&ue_context->guti.gummei.plmn, &visited_plmn_dongle, sizeof(plmn_t));
MME_APP_DEBUG("and we have no auth. vector for it, request" MME_APP_DEBUG("and we have no auth. vector for it, request"
" authentication information\n"); " authentication information\n");
mme_app_request_authentication_info(imsi, 1, &plmn); mme_app_request_authentication_info(imsi, 1, &visited_plmn_dongle, NULL);
} else { } else {
DevMessage("not handled\n"); memcpy(&ue_context->guti.gummei.plmn, &visited_plmn_dongle, sizeof(plmn_t));
mme_app_request_authentication_info(imsi, 1, &visited_plmn_dongle, nas_auth_param_req_p->auts);
} }
} }
#endif #endif
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
typedef enum { typedef enum {
ECM_IDLE, ECM_IDLE,
ECM_CONNECTED, ECM_CONNECTED,
EMM_DEREGISTERED, ECM_DEREGISTERED,
} mm_state_t; } mm_state_t;
typedef uint64_t mme_app_imsi_t; typedef uint64_t mme_app_imsi_t;
......
...@@ -1099,7 +1099,7 @@ int emm_proc_attach_request(unsigned int ueid, emm_proc_attach_type_t type, ...@@ -1099,7 +1099,7 @@ int emm_proc_attach_request(unsigned int ueid, emm_proc_attach_type_t type,
} }
} else { } else {
/* Create UE's EMM context */ /* Create UE's EMM context */
*emm_ctx = (emm_data_context_t *)malloc(sizeof(emm_data_context_t)); *emm_ctx = (emm_data_context_t *)calloc(1, sizeof(emm_data_context_t));
if (emm_ctx == NULL) { if (emm_ctx == NULL) {
LOG_TRACE(WARNING, "EMM-PROC - Failed to create EMM context"); LOG_TRACE(WARNING, "EMM-PROC - Failed to create EMM context");
ue_ctx.emm_cause = EMM_CAUSE_ILLEGAL_UE; ue_ctx.emm_cause = EMM_CAUSE_ILLEGAL_UE;
...@@ -1116,9 +1116,9 @@ int emm_proc_attach_request(unsigned int ueid, emm_proc_attach_type_t type, ...@@ -1116,9 +1116,9 @@ int emm_proc_attach_request(unsigned int ueid, emm_proc_attach_type_t type,
(*emm_ctx)->esm_msg.length = 0; (*emm_ctx)->esm_msg.length = 0;
(*emm_ctx)->esm_msg.value = NULL; (*emm_ctx)->esm_msg.value = NULL;
(*emm_ctx)->emm_cause = EMM_CAUSE_SUCCESS; (*emm_ctx)->emm_cause = EMM_CAUSE_SUCCESS;
(*emm_ctx)->_emm_fsm_status = EMM_INVALID;
(*emm_ctx)->_emm_fsm_status = EMM_DEREGISTERED; emm_fsm_set_status(ueid, *emm_ctx, EMM_DEREGISTERED);
#if defined(EPC_BUILD) #if defined(EPC_BUILD)
emm_data_context_add(&_emm_data, *(emm_ctx)); emm_data_context_add(&_emm_data, *(emm_ctx));
#endif #endif
...@@ -1849,7 +1849,7 @@ static int _emm_attach_identify(void *args) ...@@ -1849,7 +1849,7 @@ static int _emm_attach_identify(void *args)
#if defined(EPC_BUILD) #if defined(EPC_BUILD)
if (!emm_ctx->security) { if (!emm_ctx->security) {
/* Ask upper layer to fetch new security context */ /* Ask upper layer to fetch new security context */
nas_itti_auth_info_req(emm_ctx->ueid, emm_ctx->imsi, 1); nas_itti_auth_info_req(emm_ctx->ueid, emm_ctx->imsi, 1, NULL);
rc = RETURNok; rc = RETURNok;
} else } else
......
...@@ -32,6 +32,9 @@ Description Defines the authentication EMM procedure executed by the ...@@ -32,6 +32,9 @@ Description Defines the authentication EMM procedure executed by the
*****************************************************************************/ *****************************************************************************/
#include <stdlib.h> // malloc, free
#include <string.h> // memcpy, memcmp, memset
#include "emm_proc.h" #include "emm_proc.h"
#include "nas_log.h" #include "nas_log.h"
#include "nas_timer.h" #include "nas_timer.h"
...@@ -45,8 +48,11 @@ Description Defines the authentication EMM procedure executed by the ...@@ -45,8 +48,11 @@ Description Defines the authentication EMM procedure executed by the
#include "usim_api.h" #include "usim_api.h"
#endif #endif
#include <stdlib.h> // malloc, free #ifdef NAS_MME
#include <string.h> // memcpy, memcmp, memset # if defined(EPC_BUILD)
# include "nas_itti_messaging.h"
# endif
#endif
/****************************************************************************/ /****************************************************************************/
/**************** E X T E R N A L D E F I N I T I O N S ****************/ /**************** E X T E R N A L D E F I N I T I O N S ****************/
...@@ -534,7 +540,7 @@ int emm_proc_authentication(void *ctx, unsigned int ueid, int ksi, ...@@ -534,7 +540,7 @@ int emm_proc_authentication(void *ctx, unsigned int ueid, int ksi,
LOG_FUNC_IN; LOG_FUNC_IN;
LOG_TRACE(INFO, "EMM-PROC - Initiate authentication KSI = %d", ksi); LOG_TRACE(INFO, "EMM-PROC - Initiate authentication KSI = %d, ctx = %p", ksi, ctx);
/* Allocate parameters of the retransmission timer callback */ /* Allocate parameters of the retransmission timer callback */
data = (authentication_data_t *)malloc(sizeof(authentication_data_t)); data = (authentication_data_t *)malloc(sizeof(authentication_data_t));
...@@ -616,11 +622,11 @@ int emm_proc_authentication(void *ctx, unsigned int ueid, int ksi, ...@@ -616,11 +622,11 @@ int emm_proc_authentication(void *ctx, unsigned int ueid, int ksi,
int emm_proc_authentication_complete(unsigned int ueid, int emm_cause, int emm_proc_authentication_complete(unsigned int ueid, int emm_cause,
const OctetString *res) const OctetString *res)
{ {
LOG_FUNC_IN;
int rc; int rc;
emm_sap_t emm_sap; emm_sap_t emm_sap;
LOG_FUNC_IN;
LOG_TRACE(INFO, "EMM-PROC - Authentication complete (ueid=%u, cause=%d)", LOG_TRACE(INFO, "EMM-PROC - Authentication complete (ueid=%u, cause=%d)",
ueid, emm_cause); ueid, emm_cause);
...@@ -665,21 +671,40 @@ int emm_proc_authentication_complete(unsigned int ueid, int emm_cause, ...@@ -665,21 +671,40 @@ int emm_proc_authentication_complete(unsigned int ueid, int emm_cause,
} }
if (emm_cause != EMM_CAUSE_SUCCESS) { if (emm_cause != EMM_CAUSE_SUCCESS) {
/* The MME received an authentication failure message or the RES switch (emm_cause) {
* contained in the Authentication Response message received from
* the UE does not match the XRES parameter computed by the network */ #if defined(EPC_BUILD)
(void) _authentication_reject(ueid); case EMM_CAUSE_SYNCH_FAILURE:
/* /* USIM has detected a mismatch in SQN.
* Notify EMM that the authentication procedure failed * Ask for a new vector.
*/ */
emm_sap.primitive = EMMREG_COMMON_PROC_REJ; nas_itti_auth_info_req(ueid, emm_ctx->imsi, 0, res->value);
emm_sap.u.emm_reg.ueid = ueid;
rc = RETURNok;
LOG_FUNC_RETURN (rc);
break;
#endif
default:
/* The MME received an authentication failure message or the RES
* contained in the Authentication Response message received from
* the UE does not match the XRES parameter computed by the network */
(void) _authentication_reject(ueid);
/*
* Notify EMM that the authentication procedure failed
*/
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
break;
}
} else { } else {
/* /*
* Notify EMM that the authentication procedure successfully completed * Notify EMM that the authentication procedure successfully completed
*/ */
emm_sap.primitive = EMMREG_COMMON_PROC_CNF; emm_sap.primitive = EMMREG_COMMON_PROC_CNF;
emm_sap.u.emm_reg.ueid = ueid; emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
emm_sap.u.emm_reg.u.common.is_attached = emm_ctx->is_attached; emm_sap.u.emm_reg.u.common.is_attached = emm_ctx->is_attached;
} }
......
...@@ -233,8 +233,8 @@ int emm_proc_identification(unsigned int ueid, ...@@ -233,8 +233,8 @@ int emm_proc_identification(unsigned int ueid,
int rc = RETURNerror; int rc = RETURNerror;
LOG_TRACE(INFO, "EMM-PROC - Initiate identification type = %s (%d)", LOG_TRACE(INFO, "EMM-PROC - Initiate identification type = %s (%d), ctx = %p",
_emm_identity_type_str[type], type); _emm_identity_type_str[type], type, emm_ctx);
/* Allocate parameters of the retransmission timer callback */ /* Allocate parameters of the retransmission timer callback */
identification_data_t *data = identification_data_t *data =
...@@ -363,6 +363,7 @@ int emm_proc_identification_complete(unsigned int ueid, const imsi_t *imsi, ...@@ -363,6 +363,7 @@ int emm_proc_identification_complete(unsigned int ueid, const imsi_t *imsi,
*/ */
emm_sap.primitive = EMMREG_COMMON_PROC_CNF; emm_sap.primitive = EMMREG_COMMON_PROC_CNF;
emm_sap.u.emm_reg.ueid = ueid; emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
emm_sap.u.emm_reg.u.common.is_attached = emm_ctx->is_attached; emm_sap.u.emm_reg.u.common.is_attached = emm_ctx->is_attached;
} else { } else {
LOG_TRACE(ERROR, "EMM-PROC - No EMM context exists"); LOG_TRACE(ERROR, "EMM-PROC - No EMM context exists");
...@@ -371,6 +372,7 @@ int emm_proc_identification_complete(unsigned int ueid, const imsi_t *imsi, ...@@ -371,6 +372,7 @@ int emm_proc_identification_complete(unsigned int ueid, const imsi_t *imsi,
*/ */
emm_sap.primitive = EMMREG_COMMON_PROC_REJ; emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid; emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
} }
rc = emm_sap_send(&emm_sap); rc = emm_sap_send(&emm_sap);
......
...@@ -39,6 +39,11 @@ Description Defines the security mode control EMM procedure executed by the ...@@ -39,6 +39,11 @@ Description Defines the security mode control EMM procedure executed by the
#include <stdlib.h> // malloc, free #include <stdlib.h> // malloc, free
#include <string.h> // memcpy #include <string.h> // memcpy
#include <inttypes.h>
#if defined(ENABLE_ITTI)
# include "assertions.h"
#endif
/****************************************************************************/ /****************************************************************************/
/**************** E X T E R N A L D E F I N I T I O N S ****************/ /**************** E X T E R N A L D E F I N I T I O N S ****************/
...@@ -438,6 +443,7 @@ int emm_proc_security_mode_control(unsigned int ueid, int ksi, int eea, int eia, ...@@ -438,6 +443,7 @@ int emm_proc_security_mode_control(unsigned int ueid, int ksi, int eea, int eia,
emm_sap_t emm_sap; emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REQ; emm_sap.primitive = EMMREG_COMMON_PROC_REQ;
emm_sap.u.emm_reg.ueid = ueid; emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
rc = emm_sap_send(&emm_sap); rc = emm_sap_send(&emm_sap);
} }
} }
...@@ -568,6 +574,7 @@ int emm_proc_security_mode_reject(unsigned int ueid) ...@@ -568,6 +574,7 @@ int emm_proc_security_mode_reject(unsigned int ueid)
#if defined(EPC_BUILD) #if defined(EPC_BUILD)
if (ueid > 0) { if (ueid > 0) {
emm_ctx = emm_data_context_get(&_emm_data, ueid); emm_ctx = emm_data_context_get(&_emm_data, ueid);
DevAssert(emm_ctx != NULL);
} }
#else #else
if (ueid < EMM_DATA_NB_UE_MAX) { if (ueid < EMM_DATA_NB_UE_MAX) {
...@@ -591,6 +598,7 @@ int emm_proc_security_mode_reject(unsigned int ueid) ...@@ -591,6 +598,7 @@ int emm_proc_security_mode_reject(unsigned int ueid)
emm_sap_t emm_sap; emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REJ; emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid; emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
rc = emm_sap_send(&emm_sap); rc = emm_sap_send(&emm_sap);
LOG_FUNC_RETURN (rc); LOG_FUNC_RETURN (rc);
......
...@@ -449,7 +449,7 @@ static int _emm_as_data_ind(const emm_as_data_t *msg, int *emm_cause) ...@@ -449,7 +449,7 @@ static int _emm_as_data_ind(const emm_as_data_t *msg, int *emm_cause)
int rc = RETURNerror; int rc = RETURNerror;
LOG_TRACE(INFO, "EMMAS-SAP - Received AS data transfer indication " LOG_TRACE(INFO, "EMMAS-SAP - Received AS data transfer indication "
"(ueid=%d, delivered=%s, length=%d)", msg->ueid, "(ueid=%u, delivered=%s, length=%d)", msg->ueid,
(msg->delivered)? "TRUE" : "FALSE", msg->NASmsg.length); (msg->delivered)? "TRUE" : "FALSE", msg->NASmsg.length);
if (msg->delivered) { if (msg->delivered) {
......
...@@ -92,6 +92,7 @@ static const char *_emm_fsm_event_str[] = { ...@@ -92,6 +92,7 @@ static const char *_emm_fsm_event_str[] = {
/* String representation of EMM status */ /* String representation of EMM status */
static const char *_emm_fsm_status_str[EMM_STATE_MAX] = { static const char *_emm_fsm_status_str[EMM_STATE_MAX] = {
"INVALID",
#ifdef NAS_UE #ifdef NAS_UE
"NULL", "NULL",
#endif #endif
...@@ -164,6 +165,7 @@ int EmmCommonProcedureInitiated(const emm_reg_t *); ...@@ -164,6 +165,7 @@ int EmmCommonProcedureInitiated(const emm_reg_t *);
/* EMM state machine handlers */ /* EMM state machine handlers */
static const emm_fsm_handler_t _emm_fsm_handlers[EMM_STATE_MAX] = { static const emm_fsm_handler_t _emm_fsm_handlers[EMM_STATE_MAX] = {
NULL,
#ifdef NAS_UE #ifdef NAS_UE
EmmNull, EmmNull,
#endif #endif
...@@ -371,7 +373,7 @@ int emm_fsm_process(const emm_reg_t *evt) ...@@ -371,7 +373,7 @@ int emm_fsm_process(const emm_reg_t *evt)
DevAssert(emm_ctx != NULL); DevAssert(emm_ctx != NULL);
status = emm_ctx->_emm_fsm_status; status = emm_fsm_get_status(0, emm_ctx);
# else # else
if (evt->ueid >= EMM_FSM_NB_UE_MAX) { if (evt->ueid >= EMM_FSM_NB_UE_MAX) {
LOG_FUNC_RETURN (RETURNerror); LOG_FUNC_RETURN (RETURNerror);
...@@ -384,6 +386,8 @@ int emm_fsm_process(const emm_reg_t *evt) ...@@ -384,6 +386,8 @@ int emm_fsm_process(const emm_reg_t *evt)
_emm_fsm_event_str[primitive - _EMMREG_START - 1], primitive, _emm_fsm_event_str[primitive - _EMMREG_START - 1], primitive,
_emm_fsm_status_str[status]); _emm_fsm_status_str[status]);
DevAssert(status != EMM_INVALID);
/* Execute the EMM state machine */ /* Execute the EMM state machine */
rc = (_emm_fsm_handlers[status])(evt); rc = (_emm_fsm_handlers[status])(evt);
......
...@@ -38,6 +38,7 @@ Description Defines the EPS Mobility Management procedures executed at ...@@ -38,6 +38,7 @@ Description Defines the EPS Mobility Management procedures executed at
* different state machines. * different state machines.
*/ */
typedef enum { typedef enum {
EMM_INVALID,
#ifdef NAS_UE #ifdef NAS_UE
EMM_NULL, EMM_NULL,
#endif #endif
......
...@@ -27,14 +27,16 @@ ...@@ -27,14 +27,16 @@
06410 Biot FRANCE 06410 Biot FRANCE
*******************************************************************************/ *******************************************************************************/
#ifndef NAS_ITTI_MESSAGING_H_
#define NAS_ITTI_MESSAGING_H_
#include <string.h>
#include <stdint.h> #include <stdint.h>
#include <ctype.h> #include <ctype.h>
#include "intertask_interface.h" #include "intertask_interface.h"
#ifndef NAS_ITTI_MESSAGING_H_
#define NAS_ITTI_MESSAGING_H_
# if defined(EPC_BUILD) && defined(NAS_MME) # if defined(EPC_BUILD) && defined(NAS_MME)
#include "conversions.h" #include "conversions.h"
...@@ -45,7 +47,7 @@ void nas_itti_establish_cnf(const nas_error_code_t error_code, void *const data, ...@@ -45,7 +47,7 @@ void nas_itti_establish_cnf(const nas_error_code_t error_code, void *const data,
const uint32_t length); const uint32_t length);
static inline void nas_itti_auth_info_req(const uint32_t ue_id, static inline void nas_itti_auth_info_req(const uint32_t ue_id,
const imsi_t *const imsi, uint8_t initial_req) const imsi_t *const imsi, uint8_t initial_req, const uint8_t *auts)
{ {
MessageDef *message_p; MessageDef *message_p;
...@@ -65,6 +67,15 @@ static inline void nas_itti_auth_info_req(const uint32_t ue_id, ...@@ -65,6 +67,15 @@ static inline void nas_itti_auth_info_req(const uint32_t ue_id,
NAS_AUTHENTICATION_PARAM_REQ(message_p).initial_req = initial_req; NAS_AUTHENTICATION_PARAM_REQ(message_p).initial_req = initial_req;
NAS_AUTHENTICATION_PARAM_REQ(message_p).ue_id = ue_id; NAS_AUTHENTICATION_PARAM_REQ(message_p).ue_id = ue_id;
/* Re-synchronisation */
if (auts != NULL) {
NAS_AUTHENTICATION_PARAM_REQ(message_p).re_synchronization = 1;
memcpy(NAS_AUTHENTICATION_PARAM_REQ(message_p).auts, auts, AUTS_LENGTH);
} else {
NAS_AUTHENTICATION_PARAM_REQ(message_p).re_synchronization = 0;
memset(NAS_AUTHENTICATION_PARAM_REQ(message_p).auts, 0, AUTS_LENGTH);