Commit ca98864c authored by winckel's avatar winckel

Added NAS ITTI log message.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4841 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 0f42c092
//WARNING: Do not include this header directly. Use intertask_interface.h instead.
MESSAGE_DEF(NAS_PAGING_IND, MESSAGE_PRIORITY_MED, nas_paging_ind_t, nas_paging_ind)
MESSAGE_DEF(NAS_CONNECTION_ESTABLISHMENT_IND, MESSAGE_PRIORITY_MED, nas_conn_est_ind_t, nas_conn_est_ind)
MESSAGE_DEF(NAS_CONNECTION_ESTABLISHMENT_CNF, MESSAGE_PRIORITY_MED, nas_conn_est_cnf_t, nas_conn_est_cnf)
MESSAGE_DEF(NAS_CONNECTION_RELEASE_IND, MESSAGE_PRIORITY_MED, nas_conn_rel_ind_t, nas_conn_rel_ind)
MESSAGE_DEF(NAS_UPLINK_DATA_IND, MESSAGE_PRIORITY_MED, nas_ul_data_ind_t, nas_ul_data_ind)
MESSAGE_DEF(NAS_DOWNLINK_DATA_REQ, MESSAGE_PRIORITY_MED, nas_dl_data_req_t, nas_dl_data_req)
MESSAGE_DEF(NAS_DOWNLINK_DATA_CNF, MESSAGE_PRIORITY_MED, nas_dl_data_cnf_t, nas_dl_data_cnf)
MESSAGE_DEF(NAS_NON_DELIVERY_IND, MESSAGE_PRIORITY_MED, nas_non_del_ind_t, nas_non_del_ind)
MESSAGE_DEF(NAS_RAB_ESTABLISHMENT_REQ, MESSAGE_PRIORITY_MED, nas_rab_est_req_t, nas_rab_est_req)
MESSAGE_DEF(NAS_RAB_ESTABLISHMENT_RESP, MESSAGE_PRIORITY_MED, nas_rab_est_rsp_t, nas_rab_est_rsp)
MESSAGE_DEF(NAS_RAB_RELEASE_REQ, MESSAGE_PRIORITY_MED, nas_rab_rel_req_t, nas_rab_rel_req)
// Messages for NAS logging
MESSAGE_DEF(NAS_RAW_MSG, MESSAGE_PRIORITY_MED, nas_raw_msg_t, nas_raw_msg)
MESSAGE_DEF(NAS_EMM_PLAIN_MSG, MESSAGE_PRIORITY_MED, nas_emm_plain_msg_t, nas_emm_plain_msg)
MESSAGE_DEF(NAS_EMM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_emm_protected_msg_t, nas_emm_protected_msg)
MESSAGE_DEF(NAS_ESM_PLAIN_MSG, MESSAGE_PRIORITY_MED, nas_esm_plain_msg_t, nas_esm_plain_msg)
MESSAGE_DEF(NAS_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_protected_msg_t, nas_esm_protected_msg)
/* */
MESSAGE_DEF(NAS_PAGING_IND, MESSAGE_PRIORITY_MED, nas_paging_ind_t, nas_paging_ind)
MESSAGE_DEF(NAS_CONNECTION_ESTABLISHMENT_IND, MESSAGE_PRIORITY_MED, nas_conn_est_ind_t, nas_conn_est_ind)
MESSAGE_DEF(NAS_CONNECTION_ESTABLISHMENT_CNF, MESSAGE_PRIORITY_MED, nas_conn_est_cnf_t, nas_conn_est_cnf)
MESSAGE_DEF(NAS_CONNECTION_RELEASE_IND, MESSAGE_PRIORITY_MED, nas_conn_rel_ind_t, nas_conn_rel_ind)
MESSAGE_DEF(NAS_UPLINK_DATA_IND, MESSAGE_PRIORITY_MED, nas_ul_data_ind_t, nas_ul_data_ind)
MESSAGE_DEF(NAS_DOWNLINK_DATA_REQ, MESSAGE_PRIORITY_MED, nas_dl_data_req_t, nas_dl_data_req)
MESSAGE_DEF(NAS_DOWNLINK_DATA_CNF, MESSAGE_PRIORITY_MED, nas_dl_data_cnf_t, nas_dl_data_cnf)
MESSAGE_DEF(NAS_NON_DELIVERY_IND, MESSAGE_PRIORITY_MED, nas_non_del_ind_t, nas_non_del_ind)
MESSAGE_DEF(NAS_RAB_ESTABLISHMENT_REQ, MESSAGE_PRIORITY_MED, nas_rab_est_req_t, nas_rab_est_req)
MESSAGE_DEF(NAS_RAB_ESTABLISHMENT_RESP, MESSAGE_PRIORITY_MED, nas_rab_est_rsp_t, nas_rab_est_rsp)
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_PARAM_REQ, MESSAGE_PRIORITY_MED, nas_auth_param_req_t, nas_auth_param_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_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)
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
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
#include "as_message.h"
#include "nas_message.h"
#ifndef NAS_MESSAGES_TYPES_H_
#define NAS_MESSAGES_TYPES_H_
#define NAS_UL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_ind
#define NAS_DL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_req
#define NAS_DL_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_cnf
#define NAS_CONN_EST_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_est_ind
#define NAS_CONNECTION_ESTABLISHMENT_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_est_cnf
#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
#define NAS_RAW_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_raw_msg
#define NAS_EMM_PROTECTED_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_emm_protected_msg
#define NAS_EMM_PLAIN_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_emm_plain_msg
#define NAS_ESM_PROTECTED_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_esm_protected_msg
#define NAS_ESM_PLAIN_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_esm_plain_msg
#define NAS_UL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_ind
#define NAS_DL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_req
#define NAS_DL_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_cnf
#define NAS_CONN_EST_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_est_ind
#define NAS_CONNECTION_ESTABLISHMENT_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_est_cnf
#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
#define NAS_DATA_LENGHT_MAX 256
typedef enum {
EMM_MSG_HEADER = 1,
EMM_MSG_ATTACH_REQUEST,
EMM_MSG_ATTACH_ACCEPT,
EMM_MSG_ATTACH_COMPLETE,
EMM_MSG_ATTACH_REJECT,
EMM_MSG_DETACH_REQUEST,
EMM_MSG_DETACH_ACCEPT,
EMM_MSG_TRACKING_AREA_UPDATE_REQUEST,
EMM_MSG_TRACKING_AREA_UPDATE_ACCEPT,
EMM_MSG_TRACKING_AREA_UPDATE_COMPLETE,
EMM_MSG_TRACKING_AREA_UPDATE_REJECT,
EMM_MSG_EXTENDED_SERVICE_REQUEST,
EMM_MSG_SERVICE_REQUEST,
EMM_MSG_SERVICE_REJECT,
EMM_MSG_GUTI_REALLOCATION_COMMAND,
EMM_MSG_GUTI_REALLOCATION_COMPLETE,
EMM_MSG_AUTHENTICATION_REQUEST,
EMM_MSG_AUTHENTICATION_RESPONSE,
EMM_MSG_AUTHENTICATION_REJECT,
EMM_MSG_AUTHENTICATION_FAILURE,
EMM_MSG_IDENTITY_REQUEST,
EMM_MSG_IDENTITY_RESPONSE,
EMM_MSG_SECURITY_MODE_COMMAND,
EMM_MSG_SECURITY_MODE_COMPLETE,
EMM_MSG_SECURITY_MODE_REJECT,
EMM_MSG_EMM_STATUS,
EMM_MSG_EMM_INFORMATION,
EMM_MSG_DOWNLINK_NAS_TRANSPORT,
EMM_MSG_UPLINK_NAS_TRANSPORT,
EMM_MSG_CS_SERVICE_NOTIFICATION,
} emm_message_ids_t;
typedef enum {
ESM_MSG_HEADER = 1,
ESM_MSG_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST,
ESM_MSG_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT,
ESM_MSG_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT,
ESM_MSG_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST,
ESM_MSG_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT,
ESM_MSG_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT,
ESM_MSG_MODIFY_EPS_BEARER_CONTEXT_REQUEST,
ESM_MSG_MODIFY_EPS_BEARER_CONTEXT_ACCEPT,
ESM_MSG_MODIFY_EPS_BEARER_CONTEXT_REJECT,
ESM_MSG_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST,
ESM_MSG_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT,
ESM_MSG_PDN_CONNECTIVITY_REQUEST,
ESM_MSG_PDN_CONNECTIVITY_REJECT,
ESM_MSG_PDN_DISCONNECT_REQUEST,
ESM_MSG_PDN_DISCONNECT_REJECT,
ESM_MSG_BEARER_RESOURCE_ALLOCATION_REQUEST,
ESM_MSG_BEARER_RESOURCE_ALLOCATION_REJECT,
ESM_MSG_BEARER_RESOURCE_MODIFICATION_REQUEST,
ESM_MSG_BEARER_RESOURCE_MODIFICATION_REJECT,
ESM_MSG_ESM_INFORMATION_REQUEST,
ESM_MSG_ESM_INFORMATION_RESPONSE,
ESM_MSG_ESM_STATUS,
} esm_message_ids_t;
typedef struct nas_raw_msg_s {
uint32_t lenght;
uint8_t data[NAS_DATA_LENGHT_MAX];
} nas_raw_msg_t;
typedef struct nas_emm_plain_msg_s {
emm_message_ids_t present;
EMM_msg choice;
} nas_emm_plain_msg_t;
typedef struct nas_emm_protected_msg_s {
nas_message_security_header_t header;
emm_message_ids_t present;
EMM_msg choice;
} nas_emm_protected_msg_t;
typedef struct nas_esm_plain_msg_s {
esm_message_ids_t present;
ESM_msg choice;
} nas_esm_plain_msg_t;
typedef struct nas_esm_protected_msg_s {
nas_message_security_header_t header;
esm_message_ids_t present;
ESM_msg choice;
} nas_esm_protected_msg_t;
typedef struct nas_paging_ind_s {
} nas_paging_ind_t;
typedef struct nas_conn_est_ind_s {
......
AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \
......
AM_CFLAGS = \
@ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/S1AP \
-I$(top_srcdir)/S6A \
......
ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \
-I$(top_srcdir)/UTILS \
AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \
-I$(top_srcdir)/UTILS \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE
if HAVE_GCCXML
......
......@@ -38,8 +38,8 @@ Description Defines the layer 3 messages supported by the NAS sublayer
/* Structure of security protected header */
typedef struct {
#ifdef __LITTLE_ENDIAN_BITFIELD
UInt8_t protocol_discriminator:4;
UInt8_t security_header_type:4;
eps_protocol_discriminator_t protocol_discriminator:4;
UInt8_t security_header_type:4;
#endif
#ifdef __BIG_ENDIAN_BITFIELD
UInt8_t security_header_type:4;
......@@ -66,7 +66,7 @@ typedef struct {
*/
typedef union {
nas_message_security_header_t header;
nas_message_security_protected_t protected;
nas_message_security_protected_t security_protected;
nas_message_plain_t plain;
} nas_message_t;
......@@ -84,8 +84,8 @@ int nas_message_encrypt(const char *inbuf, char *outbuf,
int nas_message_decrypt(const char *inbuf, char *outbuf,
nas_message_security_header_t *header, int length);
int nas_message_decode(const char *buffer, nas_message_t *msg, int length);
int nas_message_decode(const char * const buffer, nas_message_t *msg, int length);
int nas_message_encode(char *buffer, const nas_message_t *msg, int length);
int nas_message_encode(char *buffer, const nas_message_t * const msg, int length);
#endif /* __NAS_MESSAGE_H__*/
......@@ -31,9 +31,6 @@ Description Defines identifiers of the EPS Mobility Management messages.
#define EMM_HEADER_MINIMUM_LENGTH EMM_HEADER_LENGTH
#define EMM_HEADER_MAXIMUM_LENGTH EMM_HEADER_LENGTH
/* Protocol discriminator identifier for EPS Mobility Management */
#define EPS_MOBILITY_MANAGEMENT_MESSAGE 0x7
/* EPS Mobility Management Security header type */
#define SECURITY_HEADER_TYPE_NOT_PROTECTED 0b0000
#define SECURITY_HEADER_TYPE_INTEGRITY_PROTECTED 0b0001
......
......@@ -866,7 +866,7 @@ static EMM_msg *_emm_as_set_header(nas_message_t *msg,
msg->header.security_header_type =
SECURITY_HEADER_TYPE_INTEGRITY_PROTECTED_NEW;
}
LOG_FUNC_RETURN (&msg->protected.plain.emm);
LOG_FUNC_RETURN (&msg->security_protected.plain.emm);
}
} else if (security->k_int) {
if (security->k_enc) {
......@@ -878,7 +878,11 @@ static EMM_msg *_emm_as_set_header(nas_message_t *msg,
msg->header.security_header_type =
SECURITY_HEADER_TYPE_INTEGRITY_PROTECTED;
}
LOG_FUNC_RETURN (&msg->protected.plain.emm);
LOG_FUNC_RETURN (&msg->security_protected.plain.emm);
} else {
/* No valid EPS security context exists */
msg->header.security_header_type = SECURITY_HEADER_TYPE_NOT_PROTECTED;
LOG_FUNC_RETURN (&msg->plain.emm);
}
} else {
/* No valid EPS security context exists */
......@@ -914,7 +918,7 @@ static int _emm_as_encode(as_nas_info_t *info, nas_message_t *msg, int length)
int bytes = 0;
if (msg->header.security_header_type != SECURITY_HEADER_TYPE_NOT_PROTECTED) {
emm_msg_header_t *header = &msg->protected.plain.emm.header;
emm_msg_header_t *header = &msg->security_protected.plain.emm.header;
/* Expand size of protected NAS message */
length += NAS_MESSAGE_SECURITY_HEADER_SIZE;
/* Set header of plain NAS message */
......
......@@ -31,9 +31,6 @@ Description Defines identifiers of the EPS Session Management messages
#define ESM_HEADER_MINIMUM_LENGTH ESM_HEADER_LENGTH
#define ESM_HEADER_MAXIMUM_LENGTH ESM_HEADER_LENGTH
/* Protocol discriminator identifier for EPS Session Management */
#define EPS_SESSION_MANAGEMENT_MESSAGE 0x2
/* Message identifiers for EPS Session Management */
# define ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST 0b11000001 /* 193 = 0xc1 */
# define ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT 0b11000010 /* 194 = 0xc2 */
......
......@@ -34,6 +34,80 @@
#include "nas_itti_messaging.h"
#if defined(EPC_BUILD) && defined(NAS_MME)
static const UInt8_t emm_message_ids[] =
{
ATTACH_REQUEST,
ATTACH_ACCEPT,
ATTACH_COMPLETE,
ATTACH_REJECT,
DETACH_REQUEST,
DETACH_ACCEPT,
TRACKING_AREA_UPDATE_REQUEST,
TRACKING_AREA_UPDATE_ACCEPT,
TRACKING_AREA_UPDATE_COMPLETE,
TRACKING_AREA_UPDATE_REJECT,
EXTENDED_SERVICE_REQUEST,
SERVICE_REQUEST,
SERVICE_REJECT,
GUTI_REALLOCATION_COMMAND,
GUTI_REALLOCATION_COMPLETE,
AUTHENTICATION_REQUEST,
AUTHENTICATION_RESPONSE,
AUTHENTICATION_REJECT,
AUTHENTICATION_FAILURE,
IDENTITY_REQUEST,
IDENTITY_RESPONSE,
SECURITY_MODE_COMMAND,
SECURITY_MODE_COMPLETE,
SECURITY_MODE_REJECT,
EMM_STATUS,
EMM_INFORMATION,
DOWNLINK_NAS_TRANSPORT,
UPLINK_NAS_TRANSPORT,
CS_SERVICE_NOTIFICATION,
};
static const UInt8_t esm_message_ids[] =
{
ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST,
ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT,
ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT,
ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST,
ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT,
ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT,
MODIFY_EPS_BEARER_CONTEXT_REQUEST,
MODIFY_EPS_BEARER_CONTEXT_ACCEPT,
MODIFY_EPS_BEARER_CONTEXT_REJECT,
DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST,
DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT,
PDN_CONNECTIVITY_REQUEST,
PDN_CONNECTIVITY_REJECT,
PDN_DISCONNECT_REQUEST,
PDN_DISCONNECT_REJECT,
BEARER_RESOURCE_ALLOCATION_REQUEST,
BEARER_RESOURCE_ALLOCATION_REJECT,
BEARER_RESOURCE_MODIFICATION_REQUEST,
BEARER_RESOURCE_MODIFICATION_REJECT,
ESM_INFORMATION_REQUEST,
ESM_INFORMATION_RESPONSE,
ESM_STATUS,
};
static int _nas_find_message_index(const UInt8_t message_id, const UInt8_t *message_ids, const int ids_number)
{
int i;
for(i = 0; i < ids_number; i ++)
{
if (message_id == message_ids[i])
{
return (2 + i);
}
}
return (1);
}
int nas_itti_dl_data_req(const uint32_t ue_id, void *const data,
const uint32_t length)
{
......@@ -47,6 +121,88 @@ int nas_itti_dl_data_req(const uint32_t ue_id, void *const data,
return itti_send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, message_p);
}
int nas_itti_plain_msg(const char* buffer, const nas_message_t* msg, const int length, const int instance)
{
MessageDef *message_p;
int data_length = length < NAS_DATA_LENGHT_MAX ? length : NAS_DATA_LENGHT_MAX;
{
message_p = itti_alloc_new_message(TASK_NAS, NAS_RAW_MSG);
NAS_RAW_MSG(message_p).lenght = length;
memset ((void *) &(NAS_RAW_MSG(message_p).data), 0, NAS_DATA_LENGHT_MAX);
memcpy ((void *) &(NAS_RAW_MSG(message_p).data), buffer, data_length);
itti_send_msg_to_task(TASK_UNKNOWN, instance, message_p);
message_p = NULL;
}
if (msg->header.protocol_discriminator == EPS_MOBILITY_MANAGEMENT_MESSAGE)
{
message_p = itti_alloc_new_message(TASK_NAS, NAS_EMM_PLAIN_MSG);
NAS_EMM_PLAIN_MSG(message_p).present = _nas_find_message_index(msg->plain.emm.header.message_type, emm_message_ids, sizeof(emm_message_ids) / sizeof(emm_message_ids[0]));
memcpy ((void *) &(NAS_EMM_PLAIN_MSG(message_p).choice), &msg->plain.emm, sizeof (EMM_msg));
}
else {
if (msg->header.protocol_discriminator == EPS_SESSION_MANAGEMENT_MESSAGE)
{
message_p = itti_alloc_new_message(TASK_NAS, NAS_ESM_PLAIN_MSG);
NAS_ESM_PLAIN_MSG(message_p).present = _nas_find_message_index(msg->plain.esm.header.message_type, esm_message_ids, sizeof(esm_message_ids) / sizeof(esm_message_ids[0]));
memcpy ((void *) &(NAS_ESM_PLAIN_MSG(message_p).choice), &msg->plain.emm, sizeof (ESM_msg));
}
}
if (message_p != NULL) {
return itti_send_msg_to_task(TASK_UNKNOWN, instance, message_p);
}
return EXIT_FAILURE;
}
int nas_itti_protected_msg(const char* buffer, const nas_message_t* msg, const int length, const int instance)
{
MessageDef *message_p;
int data_length = length < NAS_DATA_LENGHT_MAX ? length : NAS_DATA_LENGHT_MAX;
{
message_p = itti_alloc_new_message(TASK_NAS, NAS_RAW_MSG);
NAS_RAW_MSG(message_p).lenght = length;
memset ((void *) &(NAS_RAW_MSG(message_p).data), 0, NAS_DATA_LENGHT_MAX);
memcpy ((void *) &(NAS_RAW_MSG(message_p).data), buffer, data_length);
itti_send_msg_to_task(TASK_UNKNOWN, instance, message_p);
message_p = NULL;
}
if (msg->header.protocol_discriminator == EPS_MOBILITY_MANAGEMENT_MESSAGE)
{
message_p = itti_alloc_new_message(TASK_NAS, NAS_EMM_PROTECTED_MSG);
memcpy ((void *) &(NAS_EMM_PROTECTED_MSG(message_p).header), &msg->header, sizeof (nas_message_security_header_t));
NAS_EMM_PROTECTED_MSG(message_p).present = _nas_find_message_index(msg->security_protected.plain.emm.header.message_type, emm_message_ids, sizeof(emm_message_ids) / sizeof(emm_message_ids[0]));
memcpy ((void *) &(NAS_EMM_PROTECTED_MSG(message_p).choice), &msg->security_protected.plain.emm, sizeof (EMM_msg));
}
else {
if (msg->header.protocol_discriminator == EPS_SESSION_MANAGEMENT_MESSAGE)
{
message_p = itti_alloc_new_message(TASK_NAS, NAS_ESM_PROTECTED_MSG);
memcpy ((void *) &(NAS_ESM_PROTECTED_MSG(message_p).header), &msg->header, sizeof (nas_message_security_header_t));
NAS_ESM_PROTECTED_MSG(message_p).present = _nas_find_message_index(msg->security_protected.plain.esm.header.message_type, esm_message_ids, sizeof(esm_message_ids) / sizeof(esm_message_ids[0]));
memcpy ((void *) &(NAS_ESM_PROTECTED_MSG(message_p).choice), &msg->security_protected.plain.esm, sizeof (ESM_msg));
}
}
if (message_p != NULL) {
return itti_send_msg_to_task(TASK_UNKNOWN, instance, message_p);
}
return EXIT_FAILURE;
}
#endif
#if defined(UE_BUILD) && defined(NAS_UE)
......
......@@ -43,6 +43,10 @@
int nas_itti_dl_data_req(const uint32_t ue_id, void *const data,
const uint32_t length);
int nas_itti_plain_msg(const char* buffer, const nas_message_t* msg, const int length, const int instance);
int nas_itti_protected_msg(const char* buffer, const nas_message_t* msg, const int length, const int instance);
static inline void nas_itti_establish_cnf(const uint32_t ue_id,
const nas_error_code_t error_code, void *const data,
const uint32_t length)
......
......@@ -163,9 +163,10 @@ next_message:
} break;
default: {
NAS_DEBUG("Unkwnon message ID %d:%s\n",
NAS_DEBUG("Unkwnon message ID %d:%s from %s\n",
ITTI_MSG_ID(received_message_p),
ITTI_MSG_NAME(received_message_p));
ITTI_MSG_NAME(received_message_p),
ITTI_MSG_ORIGIN_NAME(received_message_p));
} break;
}
itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p);
......
......@@ -5,8 +5,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \
-I$(top_srcdir)/SCTP \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/SGI \
-I$(top_srcdir)/MME_APP \
......
......@@ -5,8 +5,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \
-I$(top_srcdir)/SCTP \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/SGI \
-I$(top_srcdir)/MME_APP \
......
......@@ -4,8 +4,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/GTPV1-U \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/S11 \
-I$(top_srcdir)/SGI \
......
......@@ -6,8 +6,12 @@ AM_CFLAGS = \
@ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \
-I$(top_srcdir)/GTPV2-C/nwgtpv2c-0.11/shared \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/SGW-LITE \
-I$(top_srcdir)/UTILS
......
......@@ -5,8 +5,12 @@ AM_CFLAGS = \
-I$(top_srcdir)/COMMON \
-I$(top_builddir)/S1AP \
-I$(top_builddir)/S1AP/MESSAGES \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/SCTP \
-I$(top_srcdir)/UTILS \
......
AM_CFLAGS = \
@ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/UTILS
......
......@@ -5,8 +5,12 @@ libsctpserver_la_LDFLAGS = -all-static
AM_CFLAGS = \
@ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/UTILS
......
......@@ -3,8 +3,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/SGW-LITE \
-I$(top_srcdir)/UTILS \
-I$(top_srcdir)/UTILS/HASHTABLE \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE
noinst_LTLIBRARIES = libsgi.la
......
AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/MME_APP \
-I$(top_srcdir)/UTILS \
......
......@@ -4,8 +4,12 @@ libudpserver_la_LDFLAGS = -all-static
AM_CFLAGS = \
@ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/include \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/util \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/UTILS
......
......@@ -239,6 +239,14 @@ typedef struct {
typedef int (*emm_indication_callback_t) (Stat_t, tac_t, ci_t, AcT_t,
const char *, size_t);
typedef enum eps_protocol_discriminator_e {
/* Protocol discriminator identifier for EPS Mobility Management */
EPS_MOBILITY_MANAGEMENT_MESSAGE = 0x7,
/* Protocol discriminator identifier for EPS Session Management */
EPS_SESSION_MANAGEMENT_MESSAGE = 0x2,
} eps_protocol_discriminator_t;
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
......
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