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);
}
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p); itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
} }
......
...@@ -207,6 +207,8 @@ int s1ap_generate_downlink_nas_transport(const uint32_t ue_id, void * const data ...@@ -207,6 +207,8 @@ int s1ap_generate_downlink_nas_transport(const uint32_t ue_id, void * const data
message.procedureCode = S1ap_ProcedureCode_id_downlinkNASTransport; message.procedureCode = S1ap_ProcedureCode_id_downlinkNASTransport;
message.direction = S1AP_PDU_PR_initiatingMessage; message.direction = S1AP_PDU_PR_initiatingMessage;
ue_ref->s1_ue_state = S1AP_UE_CONNECTED;
downlinkNasTransport = &message.msg.s1ap_DownlinkNASTransportIEs; downlinkNasTransport = &message.msg.s1ap_DownlinkNASTransportIEs;
/* Setting UE informations with the ones fount in ue_ref */ /* Setting UE informations with the ones fount in ue_ref */
...@@ -224,7 +226,7 @@ int s1ap_generate_downlink_nas_transport(const uint32_t ue_id, void * const data ...@@ -224,7 +226,7 @@ int s1ap_generate_downlink_nas_transport(const uint32_t ue_id, void * const data
s1ap_mme_itti_send_sctp_request(buffer_p, length, s1ap_mme_itti_send_sctp_request(buffer_p, length,
ue_ref->eNB->sctp_assoc_id, ue_ref->eNB->sctp_assoc_id,
ue_ref->sctp_stream_send); ue_ref->sctp_stream_send);
s1ap_mme_itti_nas_downlink_cnf(ue_ref->mme_ue_s1ap_id, AS_SUCCESS); //s1ap_mme_itti_nas_downlink_cnf(ue_ref->mme_ue_s1ap_id, AS_SUCCESS);
} }
return 0; return 0;
} }
......
...@@ -340,11 +340,10 @@ int s6a_generate_authentication_info_req(s6a_auth_info_req_t *air_p) ...@@ -340,11 +340,10 @@ int s6a_generate_authentication_info_req(s6a_auth_info_req_t *air_p)
/* Adding the visited plmn id */ /* Adding the visited plmn id */
{ {
uint8_t plmn[3] = { 0, 0, 0 }; uint8_t plmn[3] = { 0x02, 0xF8, 0x29 };
CHECK_FCT(fd_msg_avp_new(s6a_fd_cnf.dataobj_s6a_visited_plmn_id, 0, &avp)); CHECK_FCT(fd_msg_avp_new(s6a_fd_cnf.dataobj_s6a_visited_plmn_id, 0, &avp));
PLMN_T_TO_TBCD(air_p->visited_plmn, plmn);
value.os.data = plmn; value.os.data = plmn;
value.os.len = 3; value.os.len = 3;
...@@ -372,6 +371,15 @@ int s6a_generate_authentication_info_req(s6a_auth_info_req_t *air_p) ...@@ -372,6 +371,15 @@ int s6a_generate_authentication_info_req(s6a_auth_info_req_t *air_p)
CHECK_FCT(fd_msg_avp_setvalue(child_avp, &value)); CHECK_FCT(fd_msg_avp_setvalue(child_avp, &value));
CHECK_FCT(fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, child_avp)); CHECK_FCT(fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, child_avp));
/* Re-synchronization information containing the AUTS computed at USIM */
if (air_p->re_synchronization) {
CHECK_FCT(fd_msg_avp_new(s6a_fd_cnf.dataobj_s6a_re_synchronization_info, 0, &child_avp));
value.os.len = AUTS_LENGTH;
value.os.data = air_p->auts;
CHECK_FCT(fd_msg_avp_setvalue(child_avp, &value));
CHECK_FCT(fd_msg_avp_add(avp, MSG_BRW_LAST_CHILD, child_avp));
}
CHECK_FCT(fd_msg_avp_add(msg, MSG_BRW_LAST_CHILD, avp)); CHECK_FCT(fd_msg_avp_add(msg, MSG_BRW_LAST_CHILD, avp));
} }
CHECK_FCT(fd_msg_send(&msg, NULL, NULL)); CHECK_FCT(fd_msg_send(&msg, NULL, NULL));
......
...@@ -117,6 +117,7 @@ typedef struct { ...@@ -117,6 +117,7 @@ typedef struct {
struct dict_object *dataobj_s6a_number_of_requested_vectors; struct dict_object *dataobj_s6a_number_of_requested_vectors;
struct dict_object *dataobj_s6a_immediate_response_pref; struct dict_object *dataobj_s6a_immediate_response_pref;
struct dict_object *dataobj_s6a_authentication_info; struct dict_object *dataobj_s6a_authentication_info;
struct dict_object *dataobj_s6a_re_synchronization_info;
struct dict_object *dataobj_s6a_ue_srvcc_cap; struct dict_object *dataobj_s6a_ue_srvcc_cap;
/* Handlers */ /* Handlers */
......
...@@ -146,6 +146,9 @@ int s6a_fd_init_dict_objs(void) ...@@ -146,6 +146,9 @@ int s6a_fd_init_dict_objs(void)
CHECK_FD_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_AVP, CHECK_FD_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_AVP,
AVP_BY_NAME_ALL_VENDORS, "Authentication-Info", AVP_BY_NAME_ALL_VENDORS, "Authentication-Info",
&s6a_fd_cnf.dataobj_s6a_authentication_info, ENOENT)); &s6a_fd_cnf.dataobj_s6a_authentication_info, ENOENT));
CHECK_FD_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_AVP,
AVP_BY_NAME_ALL_VENDORS, "Re-Synchronization-Info",
&s6a_fd_cnf.dataobj_s6a_re_synchronization_info, ENOENT));
CHECK_FD_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_AVP, CHECK_FD_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_AVP,
AVP_BY_NAME_ALL_VENDORS, "UE-SRVCC-Capability", AVP_BY_NAME_ALL_VENDORS, "UE-SRVCC-Capability",
&s6a_fd_cnf.dataobj_s6a_ue_srvcc_cap, ENOENT)); &s6a_fd_cnf.dataobj_s6a_ue_srvcc_cap, ENOENT));
......
...@@ -560,9 +560,10 @@ void *sctp_eNB_task(void *arg) ...@@ -560,9 +560,10 @@ void *sctp_eNB_task(void *arg)
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg)); ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break; break;
} }
itti_free(TASK_SCTP, received_msg);
received_msg = NULL;
} }
free(received_msg);
received_msg = NULL;
nb_events = itti_get_events(TASK_SCTP, &events); nb_events = itti_get_events(TASK_SCTP, &events);
/* Now handle notifications for other sockets */ /* Now handle notifications for other sockets */
......
...@@ -41,7 +41,7 @@ MME_GID = 3,4,5,30,8,9,50021; ...@@ -41,7 +41,7 @@ MME_GID = 3,4,5,30,8,9,50021;
# TA (mcc.mnc:tracking area code) DEFAULT = 208.34:0 # TA (mcc.mnc:tracking area code) DEFAULT = 208.34:0
# max values = 999.999:65535 # max values = 999.999:65535
# maximum of 32 values, comma separated # maximum of 32 values, comma separated
PLMN = 208.38:0,209.130:4,208.35:8; PLMN = 208.38:0,209.130:4,208.92:0;
# ------- Interfaces definitions # ------- Interfaces definitions
SGW_INTERFACE_NAME_FOR_S11 = "eth0"; SGW_INTERFACE_NAME_FOR_S11 = "eth0";
......
...@@ -1600,7 +1600,6 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) { ...@@ -1600,7 +1600,6 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) {
default: default:
LOG_E(PHY,"dci_tools.c: dump_dci, unknown format %d\n",dci->format); LOG_E(PHY,"dci_tools.c: dump_dci, unknown format %d\n",dci->format);
return(-1); return(-1);
break;
} }
return(0); return(0);
} }
......
...@@ -152,7 +152,7 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu, ...@@ -152,7 +152,7 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu,
ulsch->harq_processes[harq_pid]->rvidx = 0; ulsch->harq_processes[harq_pid]->rvidx = 0;
ulsch->harq_processes[harq_pid]->round++; ulsch->harq_processes[harq_pid]->round++;
} }
//#ifdef DEBUG_RAR #ifdef DEBUG_RAR
msg("ulsch ra (eNB): harq_pid %d\n",harq_pid); msg("ulsch ra (eNB): harq_pid %d\n",harq_pid);
msg("ulsch ra (eNB): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb); msg("ulsch ra (eNB): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb);
msg("ulsch ra (eNB): rballoc %x\n",ulsch->harq_processes[harq_pid]->first_rb); msg("ulsch ra (eNB): rballoc %x\n",ulsch->harq_processes[harq_pid]->first_rb);
...@@ -162,7 +162,7 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu, ...@@ -162,7 +162,7 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu,
msg("ulsch ra (eNB): mcs %d\n",ulsch->harq_processes[harq_pid]->mcs); msg("ulsch ra (eNB): mcs %d\n",ulsch->harq_processes[harq_pid]->mcs);
msg("ulsch ra (eNB): Or1 %d\n",ulsch->Or1); msg("ulsch ra (eNB): Or1 %d\n",ulsch->Or1);
msg("ulsch ra (eNB): ORI %d\n",ulsch->O_RI); msg("ulsch ra (eNB): ORI %d\n",ulsch->O_RI);
//#endif #endif
return(0); return(0);
} }
......
...@@ -111,7 +111,7 @@ static Enb_properties_t enb_0_properties = ...@@ -111,7 +111,7 @@ static Enb_properties_t enb_0_properties =
"eNB_Eurecom_0", "eNB_Eurecom_0",
0, 0,
208, 208,
34, 92,
PAGING_DRX_256, PAGING_DRX_256,
1, /* There are 2 addresses defined, but use only one by default */ 1, /* There are 2 addresses defined, but use only one by default */
{ {
...@@ -138,7 +138,7 @@ static Enb_properties_t enb_1_properties = ...@@ -138,7 +138,7 @@ static Enb_properties_t enb_1_properties =
"eNB_Eurecom_1", "eNB_Eurecom_1",
0, 0,
208, 208,
34, 92,
PAGING_DRX_256, PAGING_DRX_256,
1, /* There are 2 addresses defined, but use only one by default */ 1, /* There are 2 addresses defined, but use only one by default */
{ {
...@@ -165,7 +165,7 @@ static Enb_properties_t enb_2_properties = ...@@ -165,7 +165,7 @@ static Enb_properties_t enb_2_properties =
"eNB_Eurecom_2", "eNB_Eurecom_2",
0, 0,
208, 208,
34, 92,
PAGING_DRX_256, PAGING_DRX_256,
1, 1,
{ {
...@@ -186,7 +186,7 @@ static Enb_properties_t enb_3_properties = ...@@ -186,7 +186,7 @@ static Enb_properties_t enb_3_properties =
"eNB_Eurecom_3", "eNB_Eurecom_3",
0, 0,
208, 208,
34, 92,
PAGING_DRX_256, PAGING_DRX_256,
1, 1,
{ {
......
...@@ -113,6 +113,7 @@ endif ...@@ -113,6 +113,7 @@ endif
ifdef ENABLE_ITTI ifdef ENABLE_ITTI
RTAI_OBJ += $(UTILS_OBJS) RTAI_OBJ += $(UTILS_OBJS)
CFLAGS += -DEXMIMO_IOT
endif endif
CFLAGS += $(L2_incl) $(ENB_APP_incl) $(UTIL_incl) $(UTILS_incl) CFLAGS += $(L2_incl) $(ENB_APP_incl) $(UTIL_incl) $(UTILS_incl)
...@@ -335,7 +336,8 @@ run_eNB2: ...@@ -335,7 +336,8 @@ run_eNB2:
clean: common-clean clean: common-clean
@$(RM_F_V) $(OBJ) $(RTAI_OBJ) @$(RM_F_V) $(OBJ) $(RTAI_OBJ)
@$(RM_F_V) $(OBJ:.o=.d) $(RTAI_OBJ:.o=.d) @$(RM_F_V) $(OBJ:.o=.d) $(RTAI_OBJ:.o=.d)
@$(RM_F_V) $(ASN1_MSG_INC)/asn1_msg.o $(ASN1_MSG_INC)/asn1_msg.d @$(RM_F_V) $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1_msg.o $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1_msg.d
@$(RM_F_V) lte-enb.o lte-enb.d lte-softmodem.o lte-softmodem.d
cleanasn1: cleanasn1:
rm -f $(ASN1_MSG_OBJS1) rm -f $(ASN1_MSG_OBJS1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment