Commit 2817ad4d authored by Cedric Roux's avatar Cedric Roux

- Added upper layer support for NAS MME

	* Correctly fetch user authentication vector from HSS
	* Trigger authentication procedure based on the returned vector
- Removed unused security types

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4608 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent ae4b3650
......@@ -32,6 +32,8 @@
#include "commonDef.h"
#include "security_types.h"
#include "queue.h"
#ifndef COMMON_TYPES_H_
......@@ -215,9 +217,9 @@ typedef struct {
rau_tau_timer_t rau_tau_timer;
} subscription_data_t;
typedef struct {
uint8_t nb_of_vectors;
STAILQ_HEAD(e_utran_vector_list, eutran_vector_s) e_utran_vectors;
typedef struct authentication_info_s {
uint8_t nb_of_vectors;
eutran_vector_t eutran_vector;
} authentication_info_t;
typedef enum {
......
......@@ -10,6 +10,8 @@
#include "timer_messages_types.h"
#include "security_types.h"
#include "gtpv1_u_messages_types.h"
#include "ip_forward_messages_types.h"
#include "mme_app_messages_types.h"
......
......@@ -13,14 +13,16 @@ MESSAGE_DEF(NAS_RAB_ESTABLISHMENT_RESP, MESSAGE_PRIORITY_MED, nas_rab_est_
MESSAGE_DEF(NAS_RAB_RELEASE_REQ, MESSAGE_PRIORITY_MED, nas_rab_rel_req_t, nas_rab_rel_req)
/* NAS layer -> MME app messages */
MESSAGE_DEF(NAS_AUTHENTICATION_REQ, MESSAGE_PRIORITY_MED, nas_auth_req_t, nas_auth_req)
MESSAGE_DEF(NAS_AUTHENTICATION_PARAM_REQ, MESSAGE_PRIORITY_MED, nas_auth_param_req_t, nas_auth_param_req)
/* MME app -> NAS layer messages */
MESSAGE_DEF(NAS_BEARER_PARAM, MESSAGE_PRIORITY_MED, nas_bearer_param_t, nas_bearer_param)
MESSAGE_DEF(NAS_AUTHENTICATION_RESP, MESSAGE_PRIORITY_MED, nas_auth_resp_t, nas_auth_resp)
MESSAGE_DEF(NAS_BEARER_PARAM, MESSAGE_PRIORITY_MED, nas_bearer_param_t, nas_bearer_param)
MESSAGE_DEF(NAS_AUTHENTICATION_PARAM_RSP, MESSAGE_PRIORITY_MED, nas_auth_param_rsp_t, nas_auth_param_rsp)
MESSAGE_DEF(NAS_AUTHENTICATION_PARAM_FAIL, MESSAGE_PRIORITY_MED, nas_auth_param_fail_t, nas_auth_param_fail)
#if defined(DISABLE_USE_NAS)
MESSAGE_DEF(NAS_ATTACH_REQ, MESSAGE_PRIORITY_MED, nas_attach_req_t, nas_attach_req)
MESSAGE_DEF(NAS_ATTACH_ACCEPT, MESSAGE_PRIORITY_MED, nas_attach_accept_t, nas_attach_accept)
MESSAGE_DEF(NAS_AUTHENTICATION_RESP, MESSAGE_PRIORITY_MED, nas_auth_resp_t, nas_auth_resp)
MESSAGE_DEF(NAS_AUTHENTICATION_REQ, MESSAGE_PRIORITY_MED, nas_auth_req_t, nas_auth_req)
#endif
\ No newline at end of file
......@@ -11,6 +11,8 @@
#define NAS_BEARER_PARAM(mSGpTR) (mSGpTR)->ittiMsg.nas_bearer_param
#define NAS_AUTHENTICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_auth_req
#define NAS_AUTHENTICATION_PARAM_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_auth_param_req
#define NAS_AUTHENTICATION_PARAM_RSP(mSGpTR) (mSGpTR)->ittiMsg.nas_auth_param_rsp
#define NAS_AUTHENTICATION_PARAM_FAIL(mSGpTR) (mSGpTR)->ittiMsg.nas_auth_param_fail
typedef struct {
......@@ -25,6 +27,8 @@ typedef struct {
s1ap_initial_ue_message_t transparent;
} nas_conn_est_ind_t;
typedef nas_establish_rsp_t nas_conn_est_rej_t;
typedef struct nas_conn_est_cnf_s {
uint32_t ue_id;
......@@ -107,12 +111,36 @@ typedef struct {
} nas_auth_resp_t;
typedef struct nas_auth_param_req_s {
uint8_t imsi_length;
char imsi[15];
/* UE identifier */
uint32_t ue_id;
/* Imsi of the UE (In case of initial request) */
char imsi[16];
uint8_t imsi_length;
uint8_t initial_req:1;
/* Indicates whether the procedure corresponds to a new connection or not */
uint8_t initial_req:1;
} nas_auth_param_req_t;
typedef struct nas_auth_param_rsp_s {
/* UE identifier */
uint32_t ue_id;
/* For future use: nb of vectors provided */
uint8_t nb_vectors;
/* Consider only one E-UTRAN vector for the moment... */
eutran_vector_t vector;
} nas_auth_param_rsp_t;
typedef struct nas_auth_param_fail_s {
/* UE identifier */
uint32_t ue_id;
/* S6A mapped to NAS cause */
nas_cause_t cause;
} nas_auth_param_fail_t;
typedef struct nas_attach_accept_s {
} nas_attach_accept_t;
......
......@@ -35,65 +35,6 @@
sscanf(sTRING, "%" SCNu64, cONTAINER)
*/
/* GCC supports 128 bits integers on certain architectures */
#if defined(ENABLE_GMP_TYPES)
/* Use gmplib in case GCC doesn't support 128 bits integers natively */
typedef mpz_t rand_t;
typedef mpz_t auth_key_t;
typedef mpz_t auth_res_t;
typedef mpz_t kasme_t;
typedef mpz_t autn_t;
/* RES amd XRES can have a variable length of 4-16 octets */
typedef struct {
ssize_t size;
auth_res_t data;
} res_t;
/* Converts a string to 128 bits gmplib integer holder */
# define STRING_TO_XBITS(sTRING, lENGTH, cONTAINER, rET) \
do { \
char temp[129]; \
if (lENGTH > 64) { \
rET = -1; \
} else { \
hexa_to_ascii(sTRING, temp, lENGTH); \
temp[2 * lENGTH] = '\0'; \
rET = mpz_init_set_str (cONTAINER, temp, 16); \
} \
} while(0)
# define STRING_TO_128BITS(sTRING, cONTAINER, rET) \
STRING_TO_XBITS(sTRING, 16, cONTAINER, rET)
# define STRING_TO_256BITS(sTRING, cONTAINER, rET) \
STRING_TO_XBITS(sTRING, 32, cONTAINER, rET)
# define STRING_TO_RAND STRING_TO_128BITS
# define STRING_TO_AUTH_KEY STRING_TO_128BITS
# define STRING_TO_AUTH_RES STRING_TO_128BITS
# define STRING_TO_AUTN STRING_TO_128BITS
# define STRING_TO_KASME STRING_TO_256BITS
# define STRING_TO_XRES(sTRING, lENGTH, cONTAINER, rET) \
do { \
STRING_TO_XBITS(sTRING, lENGTH, (cONTAINER)->data, rET); \
if (rET != -1) \
(cONTAINER)->size = mpz_sizeinbase((cONTAINER)->data, 16); \
} while(0)
/* Holds an E-UTRAN authentication vector */
typedef struct eutran_vector_s {
rand_t rand;
res_t xres;
autn_t autn;
kasme_t kasme;
/* one UE can have multiple vectors so use STAILQ lists for easy management */
STAILQ_ENTRY(eutran_vector_s) entries;
} eutran_vector_t;
#else /* defined(ENABLE_GMP_TYPES) */
/* Converts a string to 128 bits gmplib integer holder */
# define STRING_TO_XBITS(sTRING, lENGTH, cONTAINER, rET) \
do { \
......@@ -121,7 +62,7 @@ do { \
/* RES amd XRES can have a variable length of 4-16 octets */
typedef struct {
ssize_t size;
uint8_t size;
uint8_t data[XRES_LENGTH_MAX];
} res_t;
......@@ -151,11 +92,11 @@ typedef struct eutran_vector_s {
uint8_t kasme[KASME_LENGTH_OCTETS];
/* one UE can have multiple vectors so use STAILQ lists for easy management */
#if 0
STAILQ_ENTRY(eutran_vector_s) entries;
#endif
} eutran_vector_t;
#endif /* defined(ENABLE_GMP_TYPES) */
#define FC_KASME (0x10)
#define FC_KENB (0x11)
#define FC_NH (0x12)
......
......@@ -20,4 +20,5 @@ libmmeapp_la_SOURCES = \
mme_app_authentication.c \
mme_app_statistics.c mme_app_statistics.h \
mme_app_defs.h mme_app_extern.h \
mme_app_itti_messaging.h \
s6a_2_nas_cause.c
......@@ -31,8 +31,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "intertask_interface.h"
#include "mme_app_itti_messaging.h"
#include "mme_config.h"
......@@ -56,8 +58,6 @@ int mme_app_request_authentication_info(const mme_app_imsi_t imsi,
message_p = itti_alloc_new_message(TASK_MME_APP, S6A_AUTH_INFO_REQ);
if (message_p == NULL) return -1;
auth_info_req = &message_p->ittiMsg.s6a_auth_info_req;
MME_APP_IMSI_TO_STRING(imsi, auth_info_req->imsi);
memcpy(&auth_info_req->visited_plmn, plmn, sizeof(plmn_t));
......@@ -77,7 +77,8 @@ int mme_app_handle_nas_auth_resp(nas_auth_resp_t *nas_auth_resp_p)
MME_APP_DEBUG("Handling imsi %"IMSI_FORMAT"\n", imsi);
if ((ue_context = mme_ue_context_exists_imsi(&mme_app_desc.mme_ue_contexts, imsi)) == NULL) {
if ((ue_context = mme_ue_context_exists_imsi(&mme_app_desc.mme_ue_contexts,
imsi)) == NULL) {
MME_APP_ERROR("That's embarrassing as we don't know this IMSI\n");
return -1;
}
......@@ -111,39 +112,26 @@ int mme_app_handle_nas_auth_resp(nas_auth_resp_t *nas_auth_resp_p)
return -1;
}
int mme_app_handle_authentication_info_answer(s6a_auth_info_ans_t *s6a_auth_info_ans_p)
int mme_app_handle_authentication_info_answer(s6a_auth_info_ans_t
*s6a_auth_info_ans_p)
{
struct ue_context_s *ue_context;
uint64_t imsi;
nas_auth_req_t *nas_auth_req_p;
MessageDef *message_p = NULL;
DevAssert(s6a_auth_info_ans_p != NULL);
message_p = itti_alloc_new_message(TASK_MME_APP, NAS_AUTHENTICATION_REQ);
if (message_p == NULL) {
return -1;
}
nas_auth_req_p = &message_p->ittiMsg.nas_auth_req;
MME_APP_STRING_TO_IMSI((char *)s6a_auth_info_ans_p->imsi, &imsi);
MME_APP_DEBUG("Handling imsi %"IMSI_FORMAT"\n", imsi);
memcpy(nas_auth_req_p->imsi, s6a_auth_info_ans_p->imsi, 16);
if ((ue_context = mme_ue_context_exists_imsi(&mme_app_desc.mme_ue_contexts, imsi)) == NULL) {
if ((ue_context = mme_ue_context_exists_imsi(&mme_app_desc.mme_ue_contexts,
imsi)) == NULL) {
MME_APP_ERROR("That's embarrassing as we don't know this IMSI\n");
free(message_p);
return -1;
}
if ((s6a_auth_info_ans_p->result.present == S6A_RESULT_BASE) &&
(s6a_auth_info_ans_p->result.choice.base == DIAMETER_SUCCESS))
{
(s6a_auth_info_ans_p->result.choice.base == DIAMETER_SUCCESS)) {
/* S6A procedure has succeeded.
* We have to request UE authentication.
*/
......@@ -151,28 +139,37 @@ int mme_app_handle_authentication_info_answer(s6a_auth_info_ans_t *s6a_auth_info
/* Check that list is not empty and contain only one element */
DevCheck(s6a_auth_info_ans_p->auth_info.nb_of_vectors == 1,
s6a_auth_info_ans_p->auth_info.nb_of_vectors, 1, 0);
DevAssert(!STAILQ_EMPTY(&s6a_auth_info_ans_p->auth_info.e_utran_vectors));
/* Concat both lists */
STAILQ_CONCAT(&ue_context->vector_list,
&s6a_auth_info_ans_p->auth_info.e_utran_vectors);
ue_context->nb_of_vectors += s6a_auth_info_ans_p->auth_info.nb_of_vectors;
if (ue_context->vector_list == NULL) {
ue_context->vector_list = malloc(sizeof(eutran_vector_t));
DevAssert(ue_context->vector_list != NULL);
} else {
/* Some vector already exist */
ue_context->vector_list = realloc(ue_context->vector_list,
(ue_context->nb_of_vectors + 1) * sizeof(eutran_vector_t));
DevAssert(ue_context->vector_list != NULL);
}
memcpy(&ue_context->vector_list[ue_context->nb_of_vectors],
&s6a_auth_info_ans_p->auth_info.eutran_vector, sizeof(eutran_vector_t));
nas_auth_req_p->failure = NAS_FAILURE_OK;
ue_context->vector_in_use = &ue_context->vector_list[ue_context->nb_of_vectors];
ue_context->vector_in_use = STAILQ_FIRST(&ue_context->vector_list);
ue_context->nb_of_vectors += s6a_auth_info_ans_p->auth_info.nb_of_vectors;
// mme_app_dump_ue_contexts();
mme_app_itti_auth_rsp(ue_context->ue_id, 1,
&s6a_auth_info_ans_p->auth_info.eutran_vector);
} else {
// nas_auth_req_p->failure = NAS_FAILURE_IND;
// nas_auth_req_p->cause = s6a_error_2_nas_cause(
// s6a_auth_info_ans_p->result.choice.base, 0);
DevMessage("TODO: Handle s6a_auth_info_ans_p->result.present "
"!= S6A_RESULT_BASE");
/* Inform NAS layer with the right failure */
if (s6a_auth_info_ans_p->result.present == S6A_RESULT_BASE) {
mme_app_itti_auth_fail(ue_context->ue_id, s6a_error_2_nas_cause(
s6a_auth_info_ans_p->result.choice.base, 0));
} else {
mme_app_itti_auth_fail(ue_context->ue_id, s6a_error_2_nas_cause(
s6a_auth_info_ans_p->result.choice.experimental, 1));
}
}
return itti_send_msg_to_task(TASK_NAS, INSTANCE_DEFAULT, message_p);
return 0;
}
#if defined(DISABLE_USE_NAS)
......@@ -227,16 +224,14 @@ int mme_app_handle_attach_req(nas_attach_req_t *attach_req_p)
ue_context->mme_ue_s1ap_id = attach_req_p->transparent.mme_ue_s1ap_id;
if ((ue_context->imsi_auth == IMSI_AUTHENTICATED) &&
(attach_req_p->initial != INITIAL_REQUEST))
{
(attach_req_p->initial != INITIAL_REQUEST)) {
/* We have to send an update location request to the HSS */
MME_APP_DEBUG("UE is authenticated\n");
} else {
MME_APP_DEBUG("UE is not authenticated\n");
/* UE is not authenticated or an initial request */
if (STAILQ_EMPTY(&ue_context->vector_list))
request_auth:
{
request_auth: {
/* We have no vector for this UE, send an authentication request
* to the HSS.
*/
......@@ -250,7 +245,7 @@ request_auth:
};
memcpy(&ue_context->e_utran_cgi, &attach_req_p->transparent.e_utran_cgi,
sizeof(cgi_t));
sizeof(cgi_t));
/* Acquire the current time */
time(&ue_context->cell_age);
......@@ -270,8 +265,8 @@ request_auth:
MessageDef *message_p;
/* We have a vector... USE it */
MME_APP_DEBUG("but we have an auth. vector for it, request"
" authentication from NAS\n");
message_p = itti_alloc_new_message(TASK_MME_APP, NAS_AUTHENTICATION_REQ);
" authentication from NAS\n");
message_p = itti_alloc_new_message(TASK_MME_APP, NAS_AUTHENTICATION_PARAM_FAIL);
nas_auth_req_p = &message_p->ittiMsg.nas_auth_req;
......@@ -284,4 +279,60 @@ request_auth:
}
return 0;
}
#else
void mme_app_handle_nas_auth_param_req(nas_auth_param_req_t
*nas_auth_param_req_p)
{
struct ue_context_s *ue_context;
uint64_t imsi = 0;
DevAssert(nas_auth_param_req_p != NULL);
MME_APP_STRING_TO_IMSI(nas_auth_param_req_p->imsi, &imsi);
MME_APP_DEBUG("Handling imsi %"IMSI_FORMAT"\n", imsi);
/* Fetch the context associated with this IMSI */
ue_context = mme_ue_context_exists_imsi(&mme_app_desc.mme_ue_contexts, imsi);
if (ue_context == NULL) {
/* Currently no context available -> trigger an authentication request
* to the HSS.
*/
MME_APP_DEBUG("UE context doesn't exist -> create one\n");
if ((ue_context = mme_create_new_ue_context()) == NULL) {
/* Error during ue context malloc */
/* TODO */
DevMessage("mme_create_new_ue_context");
return;
}
ue_context->imsi = imsi;
ue_context->ue_id = nas_auth_param_req_p->ue_id;
DevAssert(mme_insert_ue_context(&mme_app_desc.mme_ue_contexts, ue_context) == 0);
/* We have no vector for this UE, send an authentication request
* to the HSS.
*/
plmn_t plmn = {
.MCCdigit2 = 0,
.MCCdigit1 = 8,
.MCCdigit3 = 2,
.MNCdigit1 = 0,
.MNCdigit2 = 4,
.MNCdigit3 = 3,
};
/* Acquire the current time */
time(&ue_context->cell_age);
memcpy(&ue_context->guti.gummei.plmn, &plmn, sizeof(plmn_t));
MME_APP_DEBUG("and we have no auth. vector for it, request"
" authentication information\n");
mme_app_request_authentication_info(imsi, 1, &plmn);
} else {
DevMessage("not handled\n");
}
}
#endif
......@@ -190,7 +190,6 @@ void mme_app_dump_ue_contexts(mme_ue_context_t *mme_ue_context)
MME_APP_DEBUG("-----------------------UE contexts-----------------------\n");
RB_FOREACH(context_p, ue_context_map, &mme_ue_context->ue_context_tree)
{
struct eutran_vector_s *vector_p;
uint8_t j;
MME_APP_DEBUG(" - IMSI ...........: %"SCNu64"\n", context_p->imsi);
......@@ -252,10 +251,13 @@ void mme_app_dump_ue_contexts(mme_ue_context_t *mme_ue_context)
MME_APP_DEBUG(" Allocated ....: (%010"PRIu64"|%010"PRIu64")\n",
context_p->used_ambr.br_dl, context_p->used_ambr.br_ul);
MME_APP_DEBUG(" - Known vectors ..: %u\n", context_p->nb_of_vectors);
STAILQ_FOREACH(vector_p, &context_p->vector_list, entries)
for (j = 0; j < context_p->nb_of_vectors; j++)
{
int k;
char xres_string[3 * XRES_LENGTH_MAX + 1];
eutran_vector_t *vector_p;
vector_p = &context_p->vector_list[j];
MME_APP_DEBUG(" - RAND ..: "RAND_FORMAT"\n",
RAND_DISPLAY(vector_p->rand));
......
......@@ -33,6 +33,7 @@
* Use mme_app_extern.h to expose mme applicative layer procedures/data.
*/
#include "intertask_interface.h"
#include "mme_app_ue_context.h"
#ifndef MME_APP_DEFS_H_
......@@ -69,6 +70,8 @@ int mme_app_handle_authentication_info_answer(s6a_auth_info_ans_t *s6a_auth_info
int mme_app_handle_nas_auth_resp(nas_auth_resp_t *nas_auth_resp_p);
int s6a_error_2_nas_cause(uint32_t s6a_error, int experimental);
nas_cause_t s6a_error_2_nas_cause(uint32_t s6a_error, int experimental);
void mme_app_handle_nas_auth_param_req(nas_auth_param_req_t *nas_auth_param_req);
#endif /* MME_APP_DEFS_H_ */
......@@ -78,14 +78,18 @@ void *mme_app_thread(void *args)
mme_app_handle_create_sess_resp(&received_message_p->ittiMsg.sgwCreateSessionResponse);
} break;
case NAS_AUTHENTICATION_RESP: {
mme_app_handle_nas_auth_resp(&received_message_p->ittiMsg.nas_auth_resp);
case NAS_AUTHENTICATION_PARAM_REQ: {
mme_app_handle_nas_auth_param_req(&received_message_p->ittiMsg.nas_auth_param_req);
} break;
#if defined(DISABLE_USE_NAS)
case NAS_ATTACH_REQ: {
mme_app_handle_attach_req(&received_message_p->ittiMsg.nas_attach_req);
} break;
case NAS_AUTHENTICATION_RESP: {
mme_app_handle_nas_auth_resp(&received_message_p->ittiMsg.nas_auth_resp);
} break;
#endif
case TIMER_HAS_EXPIRED: {
......
......@@ -92,6 +92,9 @@ typedef struct bearer_context_s {
* according to 3GPP TS.23.401 #5.7.2
*/
typedef struct ue_context_s {
/* Tree entry */
RB_ENTRY(ue_context_s) rb_entry;
/* Basic identifier for ue. IMSI is encoded on maximum of 15 digits of 4 bits,
* so usage of an unsigned integer on 64 bits is necessary.
*/
......@@ -104,11 +107,14 @@ typedef struct ue_context_s {
unsigned eNB_ue_s1ap_id:24;
uint32_t mme_ue_s1ap_id;
/* ue_id is equal to mme_ue_s1ap_id */
uint32_t ue_id;
uint8_t nb_of_vectors;
struct eutran_vector_s *vector_in_use;
/* List of authentication vectors for E-UTRAN */
STAILQ_HEAD(auth_vectors, eutran_vector_s) vector_list;
eutran_vector_t *vector_list;
eutran_vector_t *vector_in_use;
#define SUBSCRIPTION_UNKNOWN 0x0
#define SUBSCRIPTION_KNOWN 0x1
......@@ -160,10 +166,6 @@ typedef struct ue_context_s {
uint32_t sgw_s11_teid;
bearer_context_t eps_bearers[BEARERS_PER_UE];
/* Tree entry */
RB_ENTRY(ue_context_s) rb_entry;
} ue_context_t;
typedef struct {
......
......@@ -31,18 +31,9 @@
#include "as_message.h"
#include "common_types.h"
#include "s6a_defs.h"
#include "mme_app_defs.h"
// int send_nas_failure(uint32_t nas_cause)
// {
// MessageDef *message_p;
//
// message_p = itti_alloc_new_message(TASK_MME_APP, TASK_NAS,
// SGW_CREATE_SESSION_REQUEST);
//
// return itti_send_msg_to_task(TASK_NAS, message_p);
// }
int s6a_error_2_nas_cause(uint32_t s6a_error, int experimental)
nas_cause_t s6a_error_2_nas_cause(uint32_t s6a_error, int experimental)
{
if (experimental == 0) {
/* Base protocol errors */
......@@ -53,7 +44,7 @@ int s6a_error_2_nas_cause(uint32_t s6a_error, int experimental)
case ER_DIAMETER_REALM_NOT_SERVED: /* Fall through */
/* 5003 */
case ER_DIAMETER_AUTHORIZATION_REJECTED:
return NO_SUITABLE_CELLS_IN_TRACKING_AREA;
return NAS_CAUSE_NO_SUITABLE_CELLS_IN_TRACKING_AREA;
/* 5012 */
case ER_DIAMETER_UNABLE_TO_COMPLY: /* Fall through */
/* 5004 */
......@@ -66,11 +57,11 @@ int s6a_error_2_nas_cause(uint32_t s6a_error, int experimental)
switch (s6a_error) {
/* 5001 */
case DIAMETER_ERROR_USER_UNKNOWN:
return EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED;
return NAS_CAUSE_EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED;
/* TODO: distinguish GPRS_DATA_SUBSCRIPTION */
/* 5420 */
case DIAMETER_ERROR_UNKNOWN_EPS_SUBSCRIPTION:
return NO_SUITABLE_CELLS_IN_TRACKING_AREA;
return NAS_CAUSE_NO_SUITABLE_CELLS_IN_TRACKING_AREA;
/* 5421 */
case DIAMETER_ERROR_RAT_NOT_ALLOWED:
/* One of the following parameter can be sent depending on
......@@ -79,10 +70,10 @@ int s6a_error_2_nas_cause(uint32_t s6a_error, int experimental)
* TRACKING_AREA_NOT_ALLOWED
* NO_SUITABLE_CELLS_IN_TRACKING_AREA
*/
return TRACKING_AREA_NOT_ALLOWED;
return NAS_CAUSE_TRACKING_AREA_NOT_ALLOWED;
/* 5004 without error diagnostic */
case DIAMETER_ERROR_ROAMING_NOT_ALLOWED:
return PLMN_NOT_ALLOWED;
return NAS_CAUSE_PLMN_NOT_ALLOWED;
/* TODO: 5004 with error diagnostic of ODB_HPLMN_APN or
* ODB_VPLMN_APN
*/
......@@ -91,5 +82,5 @@ int s6a_error_2_nas_cause(uint32_t s6a_error, int experimental)
break;
}
}
return NETWORK_FAILURE;
return NAS_CAUSE_NETWORK_FAILURE;
}
......@@ -42,7 +42,7 @@ messages.xml: $(top_srcdir)/INTERTASK_INTERFACE/intertask_interface_types.h $(me
messages_xml.h: messages.xml
@echo "Generating $<"
@sed -e 's/[ ]*//' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/"/' messages.xml > messages_xml.h
@sed -e 's/[ ]*//' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' messages.xml > messages_xml.h
clean-local:
@rm -rf -v messages.xml messages_xml.h
......
......@@ -1143,21 +1143,21 @@ int emm_proc_attach_request(unsigned int ueid, emm_proc_attach_type_t type,
/****************************************************************************
** **
** Name: emm_proc_attach_reject() **
** Name: emm_proc_attach_reject() **
** **
** Description: Performs the protocol error abnormal case **
** **
** 3GPP TS 24.301, section 5.5.1.2.7, case b **
** If the ATTACH REQUEST message is received with a protocol **
** error, the network shall return an ATTACH REJECT message. **
** If the ATTACH REQUEST message is received with a protocol **
** error, the network shall return an ATTACH REJECT message. **
** **
** Inputs: ueid: UE lower layer identifier **
** emm_cause: EMM cause code to be reported **
** Others: None **
** Inputs: ueid: UE lower layer identifier **
** emm_cause: EMM cause code to be reported **
** Others: None **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: _emm_data **
** Return: RETURNok, RETURNerror **
** Others: _emm_data **
** **
***************************************************************************/
int emm_proc_attach_reject(unsigned int ueid, int emm_cause)
......@@ -1174,7 +1174,7 @@ int emm_proc_attach_reject(unsigned int ueid, int emm_cause)
/* Update the EMM cause code */
#if defined(EPC_BUILD)
if (ueid == 0)