Commit 9d0c70c9 authored by frtabu's avatar frtabu

remove L1L2 task, also remove some call to send messages to UNKNOWN_TASK,...

remove L1L2 task, also remove some call to send messages to UNKNOWN_TASK, removed in new itti. Align LOG in rlc sources with new LOG code (remove DEBUG_RLC...)
parent 24bde5d6
...@@ -145,6 +145,7 @@ extern "C" { ...@@ -145,6 +145,7 @@ extern "C" {
#define DEBUG_CTRLSOCKET (1<<10) #define DEBUG_CTRLSOCKET (1<<10)
#define DEBUG_SECURITY (1<<11) #define DEBUG_SECURITY (1<<11)
#define DEBUG_NAS (1<<12) #define DEBUG_NAS (1<<12)
#define DEBUG_RLC (1<<13)
#define UE_TIMING (1<<20) #define UE_TIMING (1<<20)
...@@ -162,6 +163,7 @@ extern "C" { ...@@ -162,6 +163,7 @@ extern "C" {
{"CTRLSOCKET", DEBUG_CTRLSOCKET},\ {"CTRLSOCKET", DEBUG_CTRLSOCKET},\
{"SECURITY", DEBUG_SECURITY},\ {"SECURITY", DEBUG_SECURITY},\
{"NAS", DEBUG_NAS},\ {"NAS", DEBUG_NAS},\
{"RLC", DEBUG_RLC},\
{"UE_TIMING", UE_TIMING},\ {"UE_TIMING", UE_TIMING},\
{NULL,-1}\ {NULL,-1}\
} }
......
...@@ -25,46 +25,46 @@ ...@@ -25,46 +25,46 @@
#include <stdint.h> #include <stdint.h>
typedef enum { typedef enum {
MIN_MSC_ENV = 0, MIN_MSC_ENV = 0,
MSC_E_UTRAN = MIN_MSC_ENV, MSC_E_UTRAN = MIN_MSC_ENV,
MSC_E_UTRAN_LIPA, MSC_E_UTRAN_LIPA,
MSC_MME_GW, MSC_MME_GW,
MSC_MME, MSC_MME,
MSC_SP_GW, MSC_SP_GW,
MAX_MSC_ENV MAX_MSC_ENV
} msc_env_t; } msc_env_t;
typedef enum { typedef enum {
MIN_MSC_PROTOS = 0, MIN_MSC_PROTOS = 0,
MSC_IP_UE = MIN_MSC_PROTOS, MSC_IP_UE = MIN_MSC_PROTOS,
MSC_NAS_UE, MSC_NAS_UE,
MSC_RRC_UE, MSC_RRC_UE,
MSC_PDCP_UE, MSC_PDCP_UE,
MSC_RLC_UE, MSC_RLC_UE,
MSC_MAC_UE, MSC_MAC_UE,
MSC_PHY_UE, MSC_PHY_UE,
MSC_PHY_ENB, MSC_PHY_ENB,
MSC_MAC_ENB, MSC_MAC_ENB,
MSC_RLC_ENB, MSC_RLC_ENB,
MSC_PDCP_ENB, MSC_PDCP_ENB,
MSC_RRC_ENB, MSC_RRC_ENB,
MSC_IP_ENB, MSC_IP_ENB,
MSC_S1AP_ENB, MSC_S1AP_ENB,
MSC_GTPU_ENB, MSC_GTPU_ENB,
MSC_GTPU_SGW, MSC_GTPU_SGW,
MSC_S1AP_MME, MSC_S1AP_MME,
MSC_MMEAPP_MME, MSC_MMEAPP_MME,
MSC_NAS_MME, MSC_NAS_MME,
MSC_NAS_EMM_MME, MSC_NAS_EMM_MME,
MSC_NAS_ESM_MME, MSC_NAS_ESM_MME,
MSC_SP_GWAPP_MME, MSC_SP_GWAPP_MME,
MSC_S11_MME, MSC_S11_MME,
MSC_S6A_MME, MSC_S6A_MME,
MSC_HSS, MSC_HSS,
MAX_MSC_PROTOS, MAX_MSC_PROTOS,
MSC_X2AP_SRC_ENB, MSC_X2AP_SRC_ENB,
MSC_X2AP_TARGET_ENB, MSC_X2AP_TARGET_ENB,
} msc_proto_t; } msc_proto_t;
...@@ -73,22 +73,22 @@ typedef enum { ...@@ -73,22 +73,22 @@ typedef enum {
#define MSC_AS_TIME_FMT "%05u:%02u" #define MSC_AS_TIME_FMT "%05u:%02u"
#define MSC_AS_TIME_ARGS(CTXT_Pp) \ #define MSC_AS_TIME_ARGS(CTXT_Pp) \
(CTXT_Pp)->frame, \ (CTXT_Pp)->frame, \
(CTXT_Pp)->subframe (CTXT_Pp)->subframe
typedef int(*msc_init_t)(const msc_env_t, const int ); typedef int(*msc_init_t)(const msc_env_t, const int );
typedef void(*msc_start_use_t)(void ); typedef void(*msc_start_use_t)(void );
typedef void(*msc_end_t)(void); typedef void(*msc_end_t)(void);
typedef void(*msc_log_event_t)(const msc_proto_t,char *, ...); typedef void(*msc_log_event_t)(const msc_proto_t,char *, ...);
typedef void(*msc_log_message_t)(const char * const, const msc_proto_t, const msc_proto_t, typedef void(*msc_log_message_t)(const char *const, const msc_proto_t, const msc_proto_t,
const uint8_t* const, const unsigned int, char * , ...); const uint8_t *const, const unsigned int, char *, ...);
typedef struct msc_interface { typedef struct msc_interface {
int msc_loaded; int msc_loaded;
msc_init_t msc_init; msc_init_t msc_init;
msc_start_use_t msc_start_use; msc_start_use_t msc_start_use;
msc_end_t msc_end; msc_end_t msc_end;
msc_log_event_t msc_log_event; msc_log_event_t msc_log_event;
msc_log_message_t msc_log_message; msc_log_message_t msc_log_message;
} msc_interface_t; } msc_interface_t;
#ifdef MSC_LIBRARY #ifdef MSC_LIBRARY
...@@ -99,15 +99,17 @@ void msc_end(void); ...@@ -99,15 +99,17 @@ void msc_end(void);
void msc_log_declare_proto(const msc_proto_t protoP); void msc_log_declare_proto(const msc_proto_t protoP);
void msc_log_event(const msc_proto_t protoP,char *format, ...); void msc_log_event(const msc_proto_t protoP,char *format, ...);
void msc_log_message( void msc_log_message(
const char * const message_operationP, const char *const message_operationP,
const msc_proto_t receiverP, const msc_proto_t receiverP,
const msc_proto_t senderP, const msc_proto_t senderP,
const uint8_t* const bytesP, const uint8_t *const bytesP,
const unsigned int num_bytes, const unsigned int num_bytes,
char *format, ...); char *format, ...);
#else #else
#define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded
msc_interface_t msc_interface; msc_interface_t msc_interface;
#define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2) #define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2)
#define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use #define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use
...@@ -119,4 +121,4 @@ msc_interface_t msc_interface; ...@@ -119,4 +121,4 @@ msc_interface_t msc_interface;
#define MSC_LOG_TX_MESSAGE_FAILED(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("-x",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS) #define MSC_LOG_TX_MESSAGE_FAILED(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("-x",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS)
#endif #endif
#endif #endif
...@@ -25,18 +25,11 @@ TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10) ...@@ -25,18 +25,11 @@ TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10)
// Other possible tasks in the process // Other possible tasks in the process
// Common tasks: // Common tasks:
/// Layer 2 and Layer 1 task supporting all the synchronous processing
TASK_DEF(TASK_L2L1, TASK_PRIORITY_MAX_LEAST, 200)
/// Bearers Manager task /// Bearers Manager task
TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200) TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200)
// eNodeB tasks and sub-tasks: // eNodeB tasks and sub-tasks:
//// Layer 2 and Layer 1 sub-tasks
SUB_TASK_DEF(TASK_L2L1, TASK_PHY_ENB, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_MAC_ENB, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_RLC_ENB, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_ENB, 200)
/// Radio Resource Control task /// Radio Resource Control task
TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200) TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200)
...@@ -63,11 +56,6 @@ TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200) ...@@ -63,11 +56,6 @@ TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200) TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200)
// UE tasks and sub-tasks: // UE tasks and sub-tasks:
//// Layer 2 and Layer 1 sub-tasks
SUB_TASK_DEF(TASK_L2L1, TASK_PHY_UE, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_MAC_UE, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_RLC_UE, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_UE, 200)
/// Radio Resource Control task /// Radio Resource Control task
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200) TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -5499,37 +5499,6 @@ rrc_eNB_decode_ccch( ...@@ -5499,37 +5499,6 @@ rrc_eNB_decode_ccch(
0, 0,
0); 0);
/*
#if defined(ENABLE_ITTI)
# if defined(DISABLE_ITTI_XER_PRINT)
{
MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_RRC_ENB, RRC_UL_CCCH_MESSAGE);
memcpy(&message_p->ittiMsg, (void *)ul_ccch_msg, sizeof(RrcUlCcchMessage));
itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, message_p);
}
# else
{
char message_string[10000];
size_t message_string_size;
if ((message_string_size =
xer_sprint(message_string, sizeof(message_string), &asn_DEF_LTE_UL_CCCH_Message, (void *)ul_ccch_msg)) > 0) {
MessageDef *msg_p;
msg_p = itti_alloc_new_message_sized(TASK_RRC_ENB, RRC_UL_CCCH, message_string_size + sizeof(IttiMsgText));
msg_p->ittiMsg.rrc_ul_ccch.size = message_string_size;
memcpy(&msg_p->ittiMsg.rrc_ul_ccch.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p);
}
}
# endif
#endif
*/
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
LOG_T(RRC, "%x.", ((uint8_t *) & ul_ccch_msg)[i]); LOG_T(RRC, "%x.", ((uint8_t *) & ul_ccch_msg)[i]);
} }
...@@ -6017,12 +5986,8 @@ rrc_eNB_decode_dcch( ...@@ -6017,12 +5986,8 @@ rrc_eNB_decode_dcch(
LTE_UL_DCCH_Message_t *ul_dcch_msg = NULL; //&uldcchmsg; LTE_UL_DCCH_Message_t *ul_dcch_msg = NULL; //&uldcchmsg;
int i; int i;
struct rrc_eNB_ue_context_s *ue_context_p = NULL; struct rrc_eNB_ue_context_s *ue_context_p = NULL;
#if defined(ENABLE_ITTI)
# if defined(ENABLE_USE_MME)
MessageDef *msg_delete_tunnels_p = NULL; MessageDef *msg_delete_tunnels_p = NULL;
uint8_t xid; uint8_t xid;
#endif
#endif
int dedicated_DRB=0; int dedicated_DRB=0;
T(T_ENB_RRC_UL_DCCH_DATA_IN, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), T(T_ENB_RRC_UL_DCCH_DATA_IN, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
......
This diff is collapsed.
...@@ -85,94 +85,13 @@ static const uint8_t esm_message_ids[] = { ...@@ -85,94 +85,13 @@ static const uint8_t esm_message_ids[] = {
ESM_STATUS, 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 ++) { int nas_itti_plain_msg(const char *buffer, const nas_message_t *msg, const int length, const int down_link) {
if (message_id == message_ids[i]) { return 0;
return (2 + i);
}
}
return (1);
}
int nas_itti_plain_msg(const char *buffer, const nas_message_t *msg, const int length, const int down_link)
{
MessageDef *message_p;
int data_length = length < NAS_DATA_LENGHT_MAX ? length : NAS_DATA_LENGHT_MAX;
int message_type = -1;
MessagesIds messageId_raw = -1;
MessagesIds messageId_plain = -1;
/* Define message ids */
if (msg->header.protocol_discriminator == EPS_MOBILITY_MANAGEMENT_MESSAGE) {
message_type = 0;
messageId_raw = down_link ? NAS_DL_EMM_RAW_MSG : NAS_UL_EMM_RAW_MSG;
messageId_plain = down_link ? NAS_DL_EMM_PLAIN_MSG : NAS_UL_EMM_PLAIN_MSG;
} else {
if (msg->header.protocol_discriminator == EPS_SESSION_MANAGEMENT_MESSAGE) {
message_type = 1;
messageId_raw = down_link ? NAS_DL_ESM_RAW_MSG : NAS_UL_ESM_RAW_MSG;
messageId_plain = down_link ? NAS_DL_ESM_PLAIN_MSG : NAS_UL_ESM_PLAIN_MSG;
}
}
if (message_type >= 0) {
/* Create and send the RAW message */
message_p = itti_alloc_new_message(TASK_ORIGIN, messageId_raw);
NAS_DL_EMM_RAW_MSG(message_p).lenght = length;
memset ((void *) &(NAS_DL_EMM_RAW_MSG(message_p).data), 0, NAS_DATA_LENGHT_MAX);
memcpy ((void *) &(NAS_DL_EMM_RAW_MSG(message_p).data), buffer, data_length);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
/* Create and send the plain message */
if (message_type == 0) {
message_p = itti_alloc_new_message(TASK_ORIGIN, messageId_plain);
NAS_DL_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_DL_EMM_PLAIN_MSG(message_p).choice), &msg->plain.emm, sizeof (EMM_msg));
} else {
message_p = itti_alloc_new_message(TASK_ORIGIN, messageId_plain);
NAS_DL_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_DL_ESM_PLAIN_MSG(message_p).choice), &msg->plain.esm, sizeof (ESM_msg));
}
return itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
}
return EXIT_FAILURE;
} }
int nas_itti_protected_msg(const char *buffer, const nas_message_t *msg, const int length, const int down_link) int nas_itti_protected_msg(const char *buffer, const nas_message_t *msg, const int length, const int down_link) {
{ return 0;
MessageDef *message_p = NULL;
if (msg->header.protocol_discriminator == EPS_MOBILITY_MANAGEMENT_MESSAGE) {
message_p = itti_alloc_new_message(TASK_ORIGIN, down_link ? NAS_DL_EMM_PROTECTED_MSG : NAS_UL_EMM_PROTECTED_MSG);
memcpy ((void *) &(NAS_DL_EMM_PROTECTED_MSG(message_p).header), &msg->header, sizeof (nas_message_security_header_t));
NAS_DL_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_DL_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_ORIGIN, down_link ? NAS_DL_ESM_PROTECTED_MSG : NAS_UL_ESM_PROTECTED_MSG);
memcpy ((void *) &(NAS_DL_ESM_PROTECTED_MSG(message_p).header), &msg->header, sizeof (nas_message_security_header_t));
NAS_DL_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_DL_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_DEFAULT, message_p);
}
return EXIT_FAILURE;
} }
#endif #endif
...@@ -180,112 +99,89 @@ int nas_itti_protected_msg(const char *buffer, const nas_message_t *msg, const i ...@@ -180,112 +99,89 @@ int nas_itti_protected_msg(const char *buffer, const nas_message_t *msg, const i
extern unsigned char NB_eNB_INST; extern unsigned char NB_eNB_INST;
int nas_itti_kenb_refresh_req(const Byte_t kenb[32]) int nas_itti_kenb_refresh_req(const Byte_t kenb[32]) {
{
MessageDef *message_p; MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_KENB_REFRESH_REQ); message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_KENB_REFRESH_REQ);
memcpy(NAS_KENB_REFRESH_REQ(message_p).kenb, kenb, sizeof(NAS_KENB_REFRESH_REQ(message_p).kenb)); memcpy(NAS_KENB_REFRESH_REQ(message_p).kenb, kenb, sizeof(NAS_KENB_REFRESH_REQ(message_p).kenb));
MSC_LOG_TX_MESSAGE( MSC_LOG_TX_MESSAGE(
MSC_NAS_UE, MSC_NAS_UE,
MSC_RRC_UE, MSC_RRC_UE,
NULL,0, NULL,0,
"0 NAS_KENB_REFRESH_REQ KeNB " "0 NAS_KENB_REFRESH_REQ KeNB "
"%02x%02x%02x%02x" "%02x%02x%02x%02x"
"%02x%02x%02x%02x" "%02x%02x%02x%02x"
"%02x%02x%02x%02x" "%02x%02x%02x%02x"
"%02x%02x%02x%02x" "%02x%02x%02x%02x"
"%02x%02x%02x%02x" "%02x%02x%02x%02x"
"%02x%02x%02x%02x" "%02x%02x%02x%02x"
"%02x%02x%02x%02x" "%02x%02x%02x%02x"
"%02x%02x%02x%02x", "%02x%02x%02x%02x",
kenb[0], kenb[1], kenb[2], kenb[3], kenb[0], kenb[1], kenb[2], kenb[3],
kenb[4], kenb[5], kenb[6], kenb[7], kenb[4], kenb[5], kenb[6], kenb[7],
kenb[8], kenb[9], kenb[10], kenb[11], kenb[8], kenb[9], kenb[10], kenb[11],
kenb[12], kenb[13], kenb[14], kenb[15], kenb[12], kenb[13], kenb[14], kenb[15],
kenb[16], kenb[17], kenb[18], kenb[19], kenb[16], kenb[17], kenb[18], kenb[19],
kenb[20], kenb[21], kenb[22], kenb[23], kenb[20], kenb[21], kenb[22], kenb[23],
kenb[24], kenb[25], kenb[26], kenb[27], kenb[24], kenb[25], kenb[26], kenb[27],
kenb[28], kenb[29], kenb[30], kenb[31]); kenb[28], kenb[29], kenb[30], kenb[31]);
return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + 0 /* TODO to be virtualized */, message_p); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + 0 /* TODO to be virtualized */, message_p);
} }
int nas_itti_cell_info_req(const plmn_t plmnID, const Byte_t rat, int user_id) int nas_itti_cell_info_req(const plmn_t plmnID, const Byte_t rat, int user_id) {
{
MessageDef *message_p; MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_CELL_SELECTION_REQ); message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_CELL_SELECTION_REQ);
NAS_CELL_SELECTION_REQ(message_p).plmnID = plmnID; NAS_CELL_SELECTION_REQ(message_p).plmnID = plmnID;
NAS_CELL_SELECTION_REQ(message_p).rat = rat; NAS_CELL_SELECTION_REQ(message_p).rat = rat;
MSC_LOG_TX_MESSAGE( MSC_LOG_TX_MESSAGE(
MSC_NAS_UE, MSC_NAS_UE,
MSC_RRC_UE, MSC_RRC_UE,
NULL,0, NULL,0,
"0 NAS_CELL_SELECTION_REQ PLMN %X%X%X.%X%X%X", "0 NAS_CELL_SELECTION_REQ PLMN %X%X%X.%X%X%X",
plmnID.MCCdigit1, plmnID.MCCdigit2, plmnID.MCCdigit3, plmnID.MCCdigit1, plmnID.MCCdigit2, plmnID.MCCdigit3,
plmnID.MNCdigit1, plmnID.MNCdigit2, plmnID.MNCdigit3); plmnID.MNCdigit1, plmnID.MNCdigit2, plmnID.MNCdigit3);
return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p);
} }
int nas_itti_nas_establish_req(as_cause_t cause, as_call_type_t type, as_stmsi_t s_tmsi, plmn_t plmnID, Byte_t *data, uint32_t length, int user_id) int nas_itti_nas_establish_req(as_cause_t cause, as_call_type_t type, as_stmsi_t s_tmsi, plmn_t plmnID, Byte_t *data, uint32_t length, int user_id) {
{
MessageDef *message_p; MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_CONN_ESTABLI_REQ); message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_CONN_ESTABLI_REQ);
NAS_CONN_ESTABLI_REQ(message_p).cause = cause; NAS_CONN_ESTABLI_REQ(message_p).cause = cause;
NAS_CONN_ESTABLI_REQ(message_p).type = type; NAS_CONN_ESTABLI_REQ(message_p).type = type;
NAS_CONN_ESTABLI_REQ(message_p).s_tmsi = s_tmsi; NAS_CONN_ESTABLI_REQ(message_p).s_tmsi = s_tmsi;
NAS_CONN_ESTABLI_REQ(message_p).plmnID = plmnID; NAS_CONN_ESTABLI_REQ(message_p).plmnID = plmnID;
NAS_CONN_ESTABLI_REQ(message_p).initialNasMsg.data = data; NAS_CONN_ESTABLI_REQ(message_p).initialNasMsg.data = data;
NAS_CONN_ESTABLI_REQ(message_p).initialNasMsg.length = length; NAS_CONN_ESTABLI_REQ(message_p).initialNasMsg.length = length;
MSC_LOG_TX_MESSAGE( MSC_LOG_TX_MESSAGE(
MSC_NAS_UE, MSC_NAS_UE,
MSC_RRC_UE, MSC_RRC_UE,
NULL,0, NULL,0,
"0 NAS_CONN_ESTABLI_REQ MME code %u m-TMSI %u PLMN %X%X%X.%X%X%X", "0 NAS_CONN_ESTABLI_REQ MME code %u m-TMSI %u PLMN %X%X%X.%X%X%X",
s_tmsi.MMEcode, s_tmsi.m_tmsi, s_tmsi.MMEcode, s_tmsi.m_tmsi,
plmnID.MCCdigit1, plmnID.MCCdigit2, plmnID.MCCdigit3, plmnID.MCCdigit1, plmnID.MCCdigit2, plmnID.MCCdigit3,
plmnID.MNCdigit1, plmnID.MNCdigit2, plmnID.MNCdigit3); plmnID.MNCdigit1, plmnID.MNCdigit2, plmnID.MNCdigit3);
return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p);
} }
int nas_itti_ul_data_req(const uint32_t ue_id, void *const data, const uint32_t length, int user_id) int nas_itti_ul_data_req(const uint32_t ue_id, void *const data, const uint32_t length, int user_id) {
{
MessageDef *message_p; MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_UPLINK_DATA_REQ); message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_UPLINK_DATA_REQ);
NAS_UPLINK_DATA_REQ(message_p).UEid = ue_id; NAS_UPLINK_DATA_REQ(message_p).UEid = ue_id;
NAS_UPLINK_DATA_REQ(message_p).nasMsg.data = data; NAS_UPLINK_DATA_REQ(message_p).nasMsg.data = data;
NAS_UPLINK_DATA_REQ(message_p).nasMsg.length = length; NAS_UPLINK_DATA_REQ(message_p).nasMsg.length = length;
return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p);
} }
int nas_itti_rab_establish_rsp(const as_stmsi_t s_tmsi, const as_rab_id_t rabID, const nas_error_code_t errCode, int user_id) int nas_itti_rab_establish_rsp(const as_stmsi_t s_tmsi, const as_rab_id_t rabID, const nas_error_code_t errCode, int user_id) {
{
MessageDef *message_p; MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_RAB_ESTABLI_RSP); message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_RAB_ESTABLI_RSP);
NAS_RAB_ESTABLI_RSP(message_p).s_tmsi = s_tmsi; NAS_RAB_ESTABLI_RSP(message_p).s_tmsi = s_tmsi;
NAS_RAB_ESTABLI_RSP(message_p).rabID = rabID; NAS_RAB_ESTABLI_RSP(message_p).rabID = rabID;
NAS_RAB_ESTABLI_RSP(message_p).errCode = errCode; NAS_RAB_ESTABLI_RSP(message_p).errCode = errCode;
MSC_LOG_TX_MESSAGE( MSC_LOG_TX_MESSAGE(
MSC_NAS_UE, MSC_NAS_UE,
MSC_RRC_UE, MSC_RRC_UE,
NULL,0, NULL,0,
"0 NAS_RAB_ESTABLI_RSP MME code %u m-TMSI %u rb id %u status %u", "0 NAS_RAB_ESTABLI_RSP MME code %u m-TMSI %u rb id %u status %u",
s_tmsi.MMEcode, s_tmsi.m_tmsi,rabID, errCode ); s_tmsi.MMEcode, s_tmsi.m_tmsi,rabID, errCode );
return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p);
} }
...@@ -36,103 +36,52 @@ ...@@ -36,103 +36,52 @@
#include "s1ap_common.h" #include "s1ap_common.h"
#include "s1ap_eNB_decoder.h" #include "s1ap_eNB_decoder.h"