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. //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) // Messages for NAS logging
MESSAGE_DEF(NAS_CONNECTION_ESTABLISHMENT_IND, MESSAGE_PRIORITY_MED, nas_conn_est_ind_t, nas_conn_est_ind) MESSAGE_DEF(NAS_RAW_MSG, MESSAGE_PRIORITY_MED, nas_raw_msg_t, nas_raw_msg)
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_EMM_PLAIN_MSG, MESSAGE_PRIORITY_MED, nas_emm_plain_msg_t, nas_emm_plain_msg)
MESSAGE_DEF(NAS_UPLINK_DATA_IND, MESSAGE_PRIORITY_MED, nas_ul_data_ind_t, nas_ul_data_ind) MESSAGE_DEF(NAS_EMM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_emm_protected_msg_t, nas_emm_protected_msg)
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_ESM_PLAIN_MSG, MESSAGE_PRIORITY_MED, nas_esm_plain_msg_t, nas_esm_plain_msg)
MESSAGE_DEF(NAS_NON_DELIVERY_IND, MESSAGE_PRIORITY_MED, nas_non_del_ind_t, nas_non_del_ind) MESSAGE_DEF(NAS_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_protected_msg_t, nas_esm_protected_msg)
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) 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 */ /* 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 */ /* MME app -> NAS layer messages */
MESSAGE_DEF(NAS_BEARER_PARAM, MESSAGE_PRIORITY_MED, nas_bearer_param_t, nas_bearer_param) 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_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_AUTHENTICATION_PARAM_FAIL, MESSAGE_PRIORITY_MED, nas_auth_param_fail_t, nas_auth_param_fail)
#if defined(DISABLE_USE_NAS) #if defined(DISABLE_USE_NAS)
MESSAGE_DEF(NAS_ATTACH_REQ, MESSAGE_PRIORITY_MED, nas_attach_req_t, nas_attach_req) 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_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_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) MESSAGE_DEF(NAS_AUTHENTICATION_REQ, MESSAGE_PRIORITY_MED, nas_auth_req_t, nas_auth_req)
#endif #endif
\ No newline at end of file
#include "as_message.h" #include "as_message.h"
#include "nas_message.h"
#ifndef NAS_MESSAGES_TYPES_H_ #ifndef NAS_MESSAGES_TYPES_H_
#define NAS_MESSAGES_TYPES_H_ #define NAS_MESSAGES_TYPES_H_
#define NAS_UL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_ind #define NAS_RAW_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_raw_msg
#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_EMM_PROTECTED_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_emm_protected_msg
#define NAS_CONN_EST_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_est_ind #define NAS_EMM_PLAIN_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_emm_plain_msg
#define NAS_CONNECTION_ESTABLISHMENT_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_est_cnf
#define NAS_BEARER_PARAM(mSGpTR) (mSGpTR)->ittiMsg.nas_bearer_param #define NAS_ESM_PROTECTED_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_esm_protected_msg
#define NAS_AUTHENTICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_auth_req #define NAS_ESM_PLAIN_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_esm_plain_msg
#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_UL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_ind
#define NAS_AUTHENTICATION_PARAM_FAIL(mSGpTR) (mSGpTR)->ittiMsg.nas_auth_param_fail #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 { typedef struct nas_paging_ind_s {
} nas_paging_ind_t; } nas_paging_ind_t;
typedef struct nas_conn_est_ind_s { typedef struct nas_conn_est_ind_s {
......
AM_CFLAGS = @ADD_CFLAGS@ \ AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \ -I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \ -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \ -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \
......
AM_CFLAGS = \ AM_CFLAGS = \
@ADD_CFLAGS@ \ @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \ -I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/S1AP \ -I$(top_srcdir)/S1AP \
-I$(top_srcdir)/S6A \ -I$(top_srcdir)/S6A \
......
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = @ADD_CFLAGS@ \ AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \ -I$(top_srcdir)/COMMON \
-I$(top_srcdir)/UTILS \ -I$(top_srcdir)/UTILS \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 -I$(top_srcdir)/INTERTASK_INTERFACE
if HAVE_GCCXML if HAVE_GCCXML
......
...@@ -28,6 +28,10 @@ Description Defines the layer 3 messages supported by the NAS sublayer ...@@ -28,6 +28,10 @@ Description Defines the layer 3 messages supported by the NAS sublayer
#include <stdlib.h> // malloc, free #include <stdlib.h> // malloc, free
#include <string.h> // memcpy #include <string.h> // memcpy
#if (defined(EPC_BUILD) && defined(NAS_MME))
# include "nas_itti_messaging.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 ****************/
/****************************************************************************/ /****************************************************************************/
...@@ -215,7 +219,7 @@ int nas_message_decrypt(const char* inbuf, char* outbuf, ...@@ -215,7 +219,7 @@ int nas_message_decrypt(const char* inbuf, char* outbuf,
** Others: None ** ** Others: None **
** ** ** **
***************************************************************************/ ***************************************************************************/
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)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
...@@ -225,35 +229,42 @@ int nas_message_decode(const char* buffer, nas_message_t* msg, int length) ...@@ -225,35 +229,42 @@ int nas_message_decode(const char* buffer, nas_message_t* msg, int length)
int size = _nas_message_header_decode(buffer, &msg->header, length); int size = _nas_message_header_decode(buffer, &msg->header, length);
if (size < 0) { if (size < 0) {
LOG_FUNC_RETURN (TLV_DECODE_BUFFER_TOO_SHORT); LOG_FUNC_RETURN (TLV_DECODE_BUFFER_TOO_SHORT);
} }
else if (size > 1) { else if (size > 1) {
/* Compute offset of the sequence number field */ /* Compute offset of the sequence number field */
int offset = size - sizeof(UInt8_t); int offset = size - sizeof(UInt8_t);
/* Compute the NAS message authentication code */ /* Compute the NAS message authentication code */
UInt32_t mac = _nas_message_get_mac(buffer + offset, UInt32_t mac = _nas_message_get_mac(buffer + offset,
0, // TODO !!! dl counter 0, // TODO !!! dl counter
length - offset); length - offset);
/* Check NAS message integrity */ /* Check NAS message integrity */
if (mac != msg->header.message_authentication_code) { if (mac != msg->header.message_authentication_code) {
LOG_FUNC_RETURN (TLV_DECODE_MAC_MISMATCH); LOG_FUNC_RETURN (TLV_DECODE_MAC_MISMATCH);
} }
/* Decode security protected NAS message */ /* Decode security protected NAS message */
bytes = _nas_message_protected_decode(buffer + size, &msg->header, bytes = _nas_message_protected_decode(buffer + size, &msg->header,
&msg->plain, length - size); &msg->plain, length - size);
#if defined(EPC_BUILD) && defined(NAS_MME)
/* Message has been decoded and security header removed, handle it has a plain message */
nas_itti_plain_msg(buffer, msg, length, 0);
#endif
} }
else { else {
/* Decode plain NAS message */ /* Decode plain NAS message */
bytes = _nas_message_plain_decode(buffer, &msg->header, bytes = _nas_message_plain_decode(buffer, &msg->header,
&msg->plain, length); &msg->plain, length);
#if defined(EPC_BUILD) && defined(NAS_MME)
nas_itti_plain_msg(buffer, msg, length, 0);
#endif
} }
if (bytes < 0) { if (bytes < 0) {
LOG_FUNC_RETURN (bytes); LOG_FUNC_RETURN (bytes);
} }
if (size > 1) { if (size > 1) {
LOG_FUNC_RETURN (size + bytes); LOG_FUNC_RETURN (size + bytes);
} }
LOG_FUNC_RETURN (bytes); LOG_FUNC_RETURN (bytes);
} }
...@@ -275,7 +286,7 @@ int nas_message_decode(const char* buffer, nas_message_t* msg, int length) ...@@ -275,7 +286,7 @@ int nas_message_decode(const char* buffer, nas_message_t* msg, int length)
** Others: None ** ** Others: None **
** ** ** **
***************************************************************************/ ***************************************************************************/
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)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
...@@ -285,35 +296,41 @@ int nas_message_encode(char* buffer, const nas_message_t* msg, int length) ...@@ -285,35 +296,41 @@ int nas_message_encode(char* buffer, const nas_message_t* msg, int length)
int size = _nas_message_header_encode(buffer, &msg->header, length); int size = _nas_message_header_encode(buffer, &msg->header, length);
if (size < 0) { if (size < 0) {
LOG_FUNC_RETURN (TLV_ENCODE_BUFFER_TOO_SHORT); LOG_FUNC_RETURN (TLV_ENCODE_BUFFER_TOO_SHORT);
} }
else if (size > 1) { else if (size > 1) {
/* Encode security protected NAS message */ /* Encode security protected NAS message */
bytes = _nas_message_protected_encode(buffer + size, &msg->protected, bytes = _nas_message_protected_encode(buffer + size, &msg->security_protected,
length - size); length - size);
/* Integrity protect the NAS message */ /* Integrity protect the NAS message */
if (bytes > 0) { if (bytes > 0) {
/* Compute offset of the sequence number field */ /* Compute offset of the sequence number field */
int offset = size - sizeof(UInt8_t); int offset = size - sizeof(UInt8_t);
/* Compute the NAS message authentication code */ /* Compute the NAS message authentication code */
UInt32_t mac = _nas_message_get_mac(buffer + offset, UInt32_t mac = _nas_message_get_mac(buffer + offset,
0, // TODO !!! ul counter 0, // TODO !!! ul counter
length - offset); length - offset);
/* Set the message authentication code of the NAS message */ /* Set the message authentication code of the NAS message */
*(UInt32_t*)(buffer + sizeof(UInt8_t)) = mac; *(UInt32_t*)(buffer + sizeof(UInt8_t)) = mac;
} }
#if defined(EPC_BUILD) && defined(NAS_MME)
nas_itti_protected_msg(buffer, msg, length, 1);
#endif
} }
else { else {
/* Encode plain NAS message */ /* Encode plain NAS message */
bytes = _nas_message_plain_encode(buffer, &msg->header, bytes = _nas_message_plain_encode(buffer, &msg->header,
&msg->plain, length); &msg->plain, length);
#if defined(EPC_BUILD) && defined(NAS_MME)
nas_itti_plain_msg(buffer, msg, length, 1);
#endif
} }
if (bytes < 0) { if (bytes < 0) {
LOG_FUNC_RETURN (bytes); LOG_FUNC_RETURN (bytes);
} }
if (size > 1) { if (size > 1) {
LOG_FUNC_RETURN (size + bytes); LOG_FUNC_RETURN (size + bytes);
} }
LOG_FUNC_RETURN (bytes); LOG_FUNC_RETURN (bytes);
} }
...@@ -349,8 +366,8 @@ int nas_message_encode(char* buffer, const nas_message_t* msg, int length) ...@@ -349,8 +366,8 @@ int nas_message_encode(char* buffer, const nas_message_t* msg, int length)
** ** ** **
***************************************************************************/ ***************************************************************************/
static int _nas_message_header_decode(const char* buffer, static int _nas_message_header_decode(const char* buffer,
nas_message_security_header_t* header, nas_message_security_header_t* header,
int length) int length)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
...@@ -361,20 +378,20 @@ static int _nas_message_header_decode(const char* buffer, ...@@ -361,20 +378,20 @@ static int _nas_message_header_decode(const char* buffer,
DECODE_U8(buffer, *(UInt8_t*)(header), size); DECODE_U8(buffer, *(UInt8_t*)(header), size);
if (header->protocol_discriminator == EPS_MOBILITY_MANAGEMENT_MESSAGE) { if (header->protocol_discriminator == EPS_MOBILITY_MANAGEMENT_MESSAGE) {
if (header->security_header_type != SECURITY_HEADER_TYPE_NOT_PROTECTED) if (header->security_header_type != SECURITY_HEADER_TYPE_NOT_PROTECTED)
{ {
if (length < NAS_MESSAGE_SECURITY_HEADER_SIZE) { if (length < NAS_MESSAGE_SECURITY_HEADER_SIZE) {
/* The buffer is not big enough to contain security header */ /* The buffer is not big enough to contain security header */
LOG_TRACE(WARNING, "NET-API - The size of the header (%u) " LOG_TRACE(WARNING, "NET-API - The size of the header (%u) "
"exceeds the buffer length (%u)", "exceeds the buffer length (%u)",
NAS_MESSAGE_SECURITY_HEADER_SIZE, length); NAS_MESSAGE_SECURITY_HEADER_SIZE, length);
LOG_FUNC_RETURN (-1); LOG_FUNC_RETURN (-1);
} }
/* Decode the message authentication code */ /* Decode the message authentication code */
DECODE_U32(buffer+size, header->message_authentication_code, size); DECODE_U32(buffer+size, header->message_authentication_code, size);
/* Decode the sequence number */ /* Decode the sequence number */
DECODE_U8(buffer+size, header->sequence_number, size); DECODE_U8(buffer+size, header->sequence_number, size);
} }
} }
LOG_FUNC_RETURN (size); LOG_FUNC_RETURN (size);
...@@ -495,7 +512,7 @@ static int _nas_message_protected_decode(const char* buffer, ...@@ -495,7 +512,7 @@ static int _nas_message_protected_decode(const char* buffer,
** ** ** **
***************************************************************************/ ***************************************************************************/
static int _nas_message_header_encode(char* buffer, static int _nas_message_header_encode(char* buffer,
const nas_message_security_header_t* header, int length) const nas_message_security_header_t* header, int length)
{ {
LOG_FUNC_IN; LOG_FUNC_IN;
...@@ -506,20 +523,23 @@ static int _nas_message_header_encode(char* buffer, ...@@ -506,20 +523,23 @@ static int _nas_message_header_encode(char* buffer,
ENCODE_U8(buffer, *(UInt8_t*)(header), size); ENCODE_U8(buffer, *(UInt8_t*)(header), size);
if (header->protocol_discriminator == EPS_MOBILITY_MANAGEMENT_MESSAGE) { if (header->protocol_discriminator == EPS_MOBILITY_MANAGEMENT_MESSAGE) {
if (header->security_header_type != SECURITY_HEADER_TYPE_NOT_PROTECTED) if (header->security_header_type != SECURITY_HEADER_TYPE_NOT_PROTECTED)
{ {
if (length < NAS_MESSAGE_SECURITY_HEADER_SIZE) { //static uint8_t seq = 0;
/* The buffer is not big enough to contain security header */ if (length < NAS_MESSAGE_SECURITY_HEADER_SIZE) {
LOG_TRACE(WARNING, "NET-API - The size of the header (%u) " /* The buffer is not big enough to contain security header */
"exceeds the buffer length (%u)", LOG_TRACE(WARNING, "NET-API - The size of the header (%u) "
NAS_MESSAGE_SECURITY_HEADER_SIZE, length); "exceeds the buffer length (%u)",
LOG_FUNC_RETURN (-1); NAS_MESSAGE_SECURITY_HEADER_SIZE, length);
} LOG_FUNC_RETURN (-1);
/* Encode the message authentication code */ }
ENCODE_U32(buffer+size, header->message_authentication_code, size); /* Encode the message authentication code */
/* Encode the sequence number */ ENCODE_U32(buffer+size, header->message_authentication_code, size);
ENCODE_U8(buffer+size, header->sequence_number, size); /* Encode the sequence number */
} ENCODE_U8(buffer+size, header->sequence_number, size);
//ENCODE_U8(buffer+size, seq, size);
//seq++;
}
} }
LOG_FUNC_RETURN (size); LOG_FUNC_RETURN (size);
...@@ -600,11 +620,14 @@ static int _nas_message_protected_encode(char* buffer, ...@@ -600,11 +620,14 @@ static int _nas_message_protected_encode(char* buffer,
int size = _nas_message_plain_encode(plain_msg, &msg->header, int size = _nas_message_plain_encode(plain_msg, &msg->header,
&msg->plain, length); &msg->plain, length);
if (size > 0) { if (size > 0) {
//static uint8_t seq = 0;
/* Encrypt the encoded plain NAS message */ /* Encrypt the encoded plain NAS message */
bytes = _nas_message_encrypt(buffer, plain_msg, bytes = _nas_message_encrypt(buffer, plain_msg,
msg->header.security_header_type, msg->header.security_header_type,
msg->header.message_authentication_code, msg->header.message_authentication_code,
msg->header.sequence_number, size); msg->header.sequence_number, size);
//seq, size);
//seq ++;
} }
free(plain_msg); free(plain_msg);
} }
......
...@@ -38,8 +38,8 @@ Description Defines the layer 3 messages supported by the NAS sublayer ...@@ -38,8 +38,8 @@ Description Defines the layer 3 messages supported by the NAS sublayer
/* Structure of security protected header */ /* Structure of security protected header */
typedef struct { typedef struct {
#ifdef __LITTLE_ENDIAN_BITFIELD #ifdef __LITTLE_ENDIAN_BITFIELD
UInt8_t protocol_discriminator:4; eps_protocol_discriminator_t protocol_discriminator:4;
UInt8_t security_header_type:4; UInt8_t security_header_type:4;
#endif #endif
#ifdef __BIG_ENDIAN_BITFIELD #ifdef __BIG_ENDIAN_BITFIELD
UInt8_t security_header_type:4; UInt8_t security_header_type:4;
...@@ -66,7 +66,7 @@ typedef struct { ...@@ -66,7 +66,7 @@ typedef struct {
*/ */
typedef union { typedef union {
nas_message_security_header_t header; 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_plain_t plain;
} nas_message_t; } nas_message_t;
...@@ -84,8 +84,8 @@ int nas_message_encrypt(const char *inbuf, char *outbuf, ...@@ -84,8 +84,8 @@ int nas_message_encrypt(const char *inbuf, char *outbuf,
int nas_message_decrypt(const char *inbuf, char *outbuf, int nas_message_decrypt(const char *inbuf, char *outbuf,
nas_message_security_header_t *header, int length); 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__*/ #endif /* __NAS_MESSAGE_H__*/
...@@ -31,9 +31,6 @@ Description Defines identifiers of the EPS Mobility Management messages. ...@@ -31,9 +31,6 @@ Description Defines identifiers of the EPS Mobility Management messages.
#define EMM_HEADER_MINIMUM_LENGTH EMM_HEADER_LENGTH #define EMM_HEADER_MINIMUM_LENGTH EMM_HEADER_LENGTH
#define EMM_HEADER_MAXIMUM_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 */ /* EPS Mobility Management Security header type */
#define SECURITY_HEADER_TYPE_NOT_PROTECTED 0b0000 #define SECURITY_HEADER_TYPE_NOT_PROTECTED 0b0000
#define SECURITY_HEADER_TYPE_INTEGRITY_PROTECTED 0b0001 #define SECURITY_HEADER_TYPE_INTEGRITY_PROTECTED 0b0001
......
...@@ -866,7 +866,7 @@ static EMM_msg *_emm_as_set_header(nas_message_t *msg, ...@@ -866,7 +866,7 @@ static EMM_msg *_emm_as_set_header(nas_message_t *msg,
msg->header.security_header_type = msg->header.security_header_type =
SECURITY_HEADER_TYPE_INTEGRITY_PROTECTED_NEW; 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) { } else if (security->k_int) {
if (security->k_enc) { if (security->k_enc) {
...@@ -878,7 +878,11 @@ static EMM_msg *_emm_as_set_header(nas_message_t *msg, ...@@ -878,7 +878,11 @@ static EMM_msg *_emm_as_set_header(nas_message_t *msg,
msg->header.security_header_type = msg->header.security_header_type =
SECURITY_HEADER_TYPE_INTEGRITY_PROTECTED; 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 { } else {
/* No valid EPS security context exists */ /* 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) ...@@ -914,7 +918,7 @@ static int _emm_as_encode(as_nas_info_t *info, nas_message_t *msg, int length)
int bytes = 0; int bytes = 0;
if (msg->header.security_header_type != SECURITY_HEADER_TYPE_NOT_PROTECTED) { 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 */ /* Expand size of protected NAS message */
length += NAS_MESSAGE_SECURITY_HEADER_SIZE; length += NAS_MESSAGE_SECURITY_HEADER_SIZE;
/* Set header of plain NAS message */ /* Set header of plain NAS message */
......
...@@ -31,9 +31,6 @@ Description Defines identifiers of the EPS Session Management messages ...@@ -31,9 +31,6 @@ Description Defines identifiers of the EPS Session Management messages
#define ESM_HEADER_MINIMUM_LENGTH ESM_HEADER_LENGTH #define ESM_HEADER_MINIMUM_LENGTH ESM_HEADER_LENGTH
#define ESM_HEADER_MAXIMUM_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 */ /* Message identifiers for EPS Session Management */
# define ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST 0b11000001 /* 193 = 0xc1 */ # define ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST 0b11000001 /* 193 = 0xc1 */
# define ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT 0b11000010 /* 194 = 0xc2 */ # define ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT 0b11000010 /* 194 = 0xc2 */
......
...@@ -34,6 +34,80 @@ ...@@ -34,6 +34,80 @@
#include "nas_itti_messaging.h" #include "nas_itti_messaging.h"
#if defined(EPC_BUILD) && defined(NAS_MME) #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, int nas_itti_dl_data_req(const uint32_t ue_id, void *const data,
const uint32_t length) const uint32_t length)
{ {
...@@ -47,6 +121,88 @@ int nas_itti_dl_data_req(const uint32_t ue_id, void *const data, ...@@ -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); 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 #endif
#if defined(UE_BUILD) && defined(NAS_UE) #if defined(UE_BUILD) && defined(NAS_UE)
......
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
int nas_itti_dl_data_req(const uint32_t ue_id, void *const data, int nas_itti_dl_data_req(const uint32_t ue_id, void *const data,
const uint32_t length); 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, static inline void nas_itti_establish_cnf(const uint32_t ue_id,
const nas_error_code_t error_code, void *const data, const nas_error_code_t error_code, void *const data,
const uint32_t length) const uint32_t length)
......
...@@ -163,9 +163,10 @@ next_message: ...@@ -163,9 +163,10 @@ next_message:
} break; } break;
default: { 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_ID(received_message_p),
ITTI_MSG_NAME(received_message_p)); ITTI_MSG_NAME(received_message_p),
ITTI_MSG_ORIGIN_NAME(received_message_p));
} break; } break;
} }
itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p); itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p);
......
...@@ -5,8 +5,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \ ...@@ -5,8 +5,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \ -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \ -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \
-I$(top_srcdir)/SCTP \ -I$(top_srcdir)/SCTP \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/SGI \ -I$(top_srcdir)/SGI \
-I$(top_srcdir)/MME_APP \ -I$(top_srcdir)/MME_APP \
......
...@@ -5,8 +5,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \ ...@@ -5,8 +5,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \ -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \ -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \
-I$(top_srcdir)/SCTP \ -I$(top_srcdir)/SCTP \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/SGI \ -I$(top_srcdir)/SGI \
-I$(top_srcdir)/MME_APP \ -I$(top_srcdir)/MME_APP \
......
...@@ -4,8 +4,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \ ...@@ -4,8 +4,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/GTPV1-U \ -I$(top_srcdir)/GTPV1-U \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \ -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \
-I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \ -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/S11 \ -I$(top_srcdir)/S11 \
-I$(top_srcdir)/SGI \ -I$(top_srcdir)/SGI \
......
...@@ -6,8 +6,12 @@ AM_CFLAGS = \ ...@@ -6,8 +6,12 @@ AM_CFLAGS = \
@ADD_CFLAGS@ \ @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \ -I$(top_srcdir)/COMMON \
-I$(top_srcdir)/GTPV2-C/nwgtpv2c-0.11/shared \ -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/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 \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/SGW-LITE \ -I$(top_srcdir)/SGW-LITE \
-I$(top_srcdir)/UTILS -I$(top_srcdir)/UTILS
......
...@@ -5,8 +5,12 @@ AM_CFLAGS = \ ...@@ -5,8 +5,12 @@ AM_CFLAGS = \
-I$(top_srcdir)/COMMON \ -I$(top_srcdir)/COMMON \
-I$(top_builddir)/S1AP \ -I$(top_builddir)/S1AP \
-I$(top_builddir)/S1AP/MESSAGES \ -I$(top_builddir)/S1AP/MESSAGES \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/SCTP \ -I$(top_srcdir)/SCTP \
-I$(top_srcdir)/UTILS \ -I$(top_srcdir)/UTILS \
......
AM_CFLAGS = \ AM_CFLAGS = \
@ADD_CFLAGS@ \ @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \ -I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/UTILS -I$(top_srcdir)/UTILS
......
...@@ -5,8 +5,12 @@ libsctpserver_la_LDFLAGS = -all-static ...@@ -5,8 +5,12 @@ libsctpserver_la_LDFLAGS = -all-static
AM_CFLAGS = \ AM_CFLAGS = \
@ADD_CFLAGS@ \ @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \ -I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/UTILS -I$(top_srcdir)/UTILS
......
...@@ -3,8 +3,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \ ...@@ -3,8 +3,12 @@ AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/SGW-LITE \ -I$(top_srcdir)/SGW-LITE \
-I$(top_srcdir)/UTILS \ -I$(top_srcdir)/UTILS \
-I$(top_srcdir)/UTILS/HASHTABLE \ -I$(top_srcdir)/UTILS/HASHTABLE \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 -I$(top_srcdir)/INTERTASK_INTERFACE
noinst_LTLIBRARIES = libsgi.la noinst_LTLIBRARIES = libsgi.la
......
AM_CFLAGS = @ADD_CFLAGS@ \ AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \ -I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/MME_APP \ -I$(top_srcdir)/MME_APP \
-I$(top_srcdir)/UTILS \ -I$(top_srcdir)/UTILS \
......
...@@ -4,8 +4,12 @@ libudpserver_la_LDFLAGS = -all-static ...@@ -4,8 +4,12 @@ libudpserver_la_LDFLAGS = -all-static
AM_CFLAGS = \ AM_CFLAGS = \
@ADD_CFLAGS@ \ @ADD_CFLAGS@ \
-I$(top_srcdir)/COMMON \ -I$(top_srcdir)/COMMON \
-I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ -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 \ -I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/UTILS -I$(top_srcdir)/UTILS
......
...@@ -239,6 +239,14 @@ typedef struct { ...@@ -239,6 +239,14 @@ typedef struct {
typedef int (*emm_indication_callback_t) (Stat_t, tac_t, ci_t, AcT_t, typedef int (*emm_indication_callback_t) (Stat_t, tac_t, ci_t, AcT_t,
const char *, size_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 ********************/ /******************** 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