Commit 64144a84 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge remote-tracking branch 'origin/issue391-removeunusedcode_L2L1task' into...

Merge remote-tracking branch 'origin/issue391-removeunusedcode_L2L1task' into develop_integration_2019_w04
Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parents 298de921 9d0c70c9
......@@ -145,6 +145,7 @@ extern "C" {
#define DEBUG_CTRLSOCKET (1<<10)
#define DEBUG_SECURITY (1<<11)
#define DEBUG_NAS (1<<12)
#define DEBUG_RLC (1<<13)
#define UE_TIMING (1<<20)
......@@ -162,6 +163,7 @@ extern "C" {
{"CTRLSOCKET", DEBUG_CTRLSOCKET},\
{"SECURITY", DEBUG_SECURITY},\
{"NAS", DEBUG_NAS},\
{"RLC", DEBUG_RLC},\
{"UE_TIMING", UE_TIMING},\
{NULL,-1}\
}
......
......@@ -80,8 +80,8 @@ typedef int(*msc_init_t)(const msc_env_t, const int );
typedef void(*msc_start_use_t)(void );
typedef void(*msc_end_t)(void);
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,
const uint8_t* const, const unsigned int, char * , ...);
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 *, ...);
typedef struct msc_interface {
int msc_loaded;
msc_init_t msc_init;
......@@ -99,15 +99,17 @@ void msc_end(void);
void msc_log_declare_proto(const msc_proto_t protoP);
void msc_log_event(const msc_proto_t protoP,char *format, ...);
void msc_log_message(
const char * const message_operationP,
const char *const message_operationP,
const msc_proto_t receiverP,
const msc_proto_t senderP,
const uint8_t* const bytesP,
const uint8_t *const bytesP,
const unsigned int num_bytes,
char *format, ...);
#else
#define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded
msc_interface_t msc_interface;
#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
......
......@@ -25,18 +25,11 @@ TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10)
// Other possible tasks in the process
// 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
TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200)
// 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
TASK_DEF(TASK_RRC_ENB, 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)
// 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
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200)
......
This diff is collapsed.
......@@ -23,9 +23,7 @@
#define RLC_AM_REASSEMBLY_C 1
#include "platform_types.h"
//-----------------------------------------------------------------------------
#if ENABLE_ITTI
# include "intertask_interface.h"
#endif
#include "assertions.h"
#include "rlc.h"
#include "rlc_am.h"
......@@ -37,19 +35,17 @@
//-----------------------------------------------------------------------------
inline void
rlc_am_clear_rx_sdu (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t * const rlc_pP)
{
const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t *const rlc_pP) {
rlc_pP->output_sdu_size_to_write = 0;
}
//-----------------------------------------------------------------------------
void
rlc_am_reassembly (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t * const rlc_pP,
uint8_t * src_pP,
const int32_t lengthP)
{
const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t *const rlc_pP,
uint8_t *src_pP,
const int32_t lengthP) {
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[REASSEMBLY PAYLOAD] reassembly() %d bytes\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
lengthP);
......@@ -57,6 +53,7 @@ rlc_am_reassembly (
if (rlc_pP->output_sdu_in_construction == NULL) {
rlc_pP->output_sdu_in_construction = get_free_mem_block (RLC_SDU_MAX_SIZE, __func__);
rlc_pP->output_sdu_size_to_write = 0;
//assert(rlc_pP->output_sdu_in_construction != NULL);
if(rlc_pP->output_sdu_in_construction == NULL) {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[REASSEMBLY PAYLOAD] output_sdu_in_construction is NULL\n",
......@@ -66,7 +63,6 @@ rlc_am_reassembly (
}
if (rlc_pP->output_sdu_in_construction != NULL) {
// check if no overflow in size
if ((rlc_pP->output_sdu_size_to_write + lengthP) <= RLC_SDU_MAX_SIZE) {
memcpy (&rlc_pP->output_sdu_in_construction->data[rlc_pP->output_sdu_size_to_write], src_pP, lengthP);
......@@ -93,18 +89,8 @@ rlc_am_reassembly (
//-----------------------------------------------------------------------------
void
rlc_am_send_sdu (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t * const rlc_pP)
{
# if TRACE_RLC_AM_PDU
char message_string[7000];
size_t message_string_size = 0;
#if ENABLE_ITTI
MessageDef *msg_p;
#endif
int octet_index, index;
#endif
const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t *const rlc_pP) {
if ((rlc_pP->output_sdu_in_construction)) {
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND_SDU] %d bytes sdu %p\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
......@@ -120,10 +106,13 @@ rlc_am_send_sdu (
rlc_pP->output_sdu_size_to_write,
rlc_pP->output_sdu_in_construction);
#else
# if TRACE_RLC_AM_PDU
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
char message_string[7000];
size_t message_string_size = 0;
int octet_index, index;
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %u\n", rlc_pP->rb_id);
message_string_size += sprintf(&message_string[message_string_size], "SDU size : %u\n", rlc_pP->output_sdu_size_to_write);
message_string_size += sprintf(&message_string[message_string_size], "\nPayload : \n");
message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
message_string_size += sprintf(&message_string[message_string_size], " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n");
......@@ -157,36 +146,22 @@ rlc_am_send_sdu (
}
message_string_size += sprintf(&message_string[message_string_size], " |\n");
# if ENABLE_ITTI
msg_p = itti_alloc_new_message_sized (ctxt_pP->enb_flag > 0 ? TASK_RLC_ENB:TASK_RLC_UE ,
RLC_AM_SDU_IND,
message_string_size + sizeof (IttiMsgText));
msg_p->ittiMsg.rlc_am_sdu_ind.size = message_string_size;
memcpy(&msg_p->ittiMsg.rlc_am_sdu_ind.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p);
# else
LOG_T(RLC, "%s", message_string);
# endif
# endif
}
#if !ENABLE_ITTI
RLC_AM_MUTEX_UNLOCK(&rlc_pP->lock_input_sdus);
#endif
MSC_LOG_TX_MESSAGE(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
(const char*)(rlc_pP->output_sdu_in_construction->data),
(const char *)(rlc_pP->output_sdu_in_construction->data),
rlc_pP->output_sdu_size_to_write,
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-IND size %u",
MSC_AS_TIME_ARGS(ctxt_pP),
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP),
rlc_pP->output_sdu_size_to_write
);
rlc_data_ind (ctxt_pP,
BOOL_NOT(rlc_pP->is_data_plane),
MBMS_FLAG_NO,
......@@ -203,16 +178,16 @@ rlc_am_send_sdu (
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
//msg("[RLC_AM][MOD %d] Freeing mem_block ...\n", rlc_pP->module_id);
//free_mem_block (rlc_pP->output_sdu_in_construction, __func__);
//Assertion(eNB)_PRAN_DesignDocument_annex No.764
//Assertion(eNB)_PRAN_DesignDocument_annex No.764
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" SEND SDU REQUESTED %d bytes\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->output_sdu_size_to_write);
/*
/*
AssertFatal(3==4,
PROTOCOL_RLC_AM_CTXT_FMT" SEND SDU REQUESTED %d bytes",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->output_sdu_size_to_write);
*/
*/
}
rlc_pP->output_sdu_size_to_write = 0;
......@@ -221,20 +196,19 @@ rlc_am_send_sdu (
//-----------------------------------------------------------------------------
void
rlc_am_reassemble_pdu(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t * const rlc_pP,
mem_block_t * const tb_pP,
boolean_t free_rlc_pdu)
{
const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t *const rlc_pP,
mem_block_t *const tb_pP,
boolean_t free_rlc_pdu) {
int i,j;
rlc_am_pdu_info_t* pdu_info = &((rlc_am_rx_pdu_management_t*)(tb_pP->data))->pdu_info;
rlc_am_pdu_info_t *pdu_info = &((rlc_am_rx_pdu_management_t *)(tb_pP->data))->pdu_info;
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[REASSEMBLY PDU] TRY REASSEMBLY PDU SN=%03d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
pdu_info->sn);
#if TRACE_RLC_AM_RX_DECODE
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
rlc_am_display_data_pdu_infos(ctxt_pP, rlc_pP, pdu_info);
#endif
}
if (pdu_info->e == RLC_E_FIXED_PART_DATA_FIELD_FOLLOW) {
switch (pdu_info->fi) {
......@@ -277,13 +251,12 @@ rlc_am_reassemble_pdu(
//} else {
// rlc_pP->reassembly_missing_sn_detected = 1; // not necessary but for readability of the code
//}
break;
default:
//Assertion(eNB)_PRAN_DesignDocument_annex No.1428
//Assertion(eNB)_PRAN_DesignDocument_annex No.1428
LOG_E(RLC, "RLC_E_FIXED_PART_DATA_FIELD_FOLLOW error pdu_info->fi[%d]\n", pdu_info->fi);
// assert(0 != 0);
// assert(0 != 0);
}
} else {
switch (pdu_info->fi) {
......@@ -399,9 +372,9 @@ rlc_am_reassemble_pdu(
break;
default:
//Assertion(eNB)_PRAN_DesignDocument_annex No.1429
//Assertion(eNB)_PRAN_DesignDocument_annex No.1429
LOG_E(RLC, "not RLC_E_FIXED_PART_DATA_FIELD_FOLLOW error pdu_info->fi[%d]\n", pdu_info->fi);
// assert(1 != 1);
// assert(1 != 1);
}
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5499,37 +5499,6 @@ rrc_eNB_decode_ccch(
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++) {
LOG_T(RRC, "%x.", ((uint8_t *) & ul_ccch_msg)[i]);
}
......@@ -6017,12 +5986,8 @@ rrc_eNB_decode_dcch(
LTE_UL_DCCH_Message_t *ul_dcch_msg = NULL; //&uldcchmsg;
int i;
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;
uint8_t xid;
#endif
#endif
int dedicated_DRB=0;
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));
......
This diff is collapsed.
......@@ -85,94 +85,13 @@ static const uint8_t esm_message_ids[] = {
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_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_plain_msg(const char *buffer, const nas_message_t *msg, const int length, const int down_link) {
return 0;
}
int nas_itti_protected_msg(const char *buffer, const nas_message_t *msg, const int length, const int down_link)
{
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;
int nas_itti_protected_msg(const char *buffer, const nas_message_t *msg, const int length, const int down_link) {
return 0;
}
#endif
......@@ -180,14 +99,10 @@ int nas_itti_protected_msg(const char *buffer, const nas_message_t *msg, const i
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;
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));
MSC_LOG_TX_MESSAGE(
MSC_NAS_UE,
MSC_RRC_UE,
......@@ -209,19 +124,14 @@ int nas_itti_kenb_refresh_req(const Byte_t kenb[32])
kenb[20], kenb[21], kenb[22], kenb[23],
kenb[24], kenb[25], kenb[26], kenb[27],
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);
}
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;
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).rat = rat;
MSC_LOG_TX_MESSAGE(
MSC_NAS_UE,
MSC_RRC_UE,
......@@ -229,23 +139,18 @@ int nas_itti_cell_info_req(const plmn_t plmnID, const Byte_t rat, int user_id)
"0 NAS_CELL_SELECTION_REQ PLMN %X%X%X.%X%X%X",
plmnID.MCCdigit1, plmnID.MCCdigit2, plmnID.MCCdigit3,
plmnID.MNCdigit1, plmnID.MNCdigit2, plmnID.MNCdigit3);
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;
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).type = type;
NAS_CONN_ESTABLI_REQ(message_p).s_tmsi = s_tmsi;
NAS_CONN_ESTABLI_REQ(message_p).plmnID = plmnID;
NAS_CONN_ESTABLI_REQ(message_p).initialNasMsg.data = data;
NAS_CONN_ESTABLI_REQ(message_p).initialNasMsg.length = length;
MSC_LOG_TX_MESSAGE(
MSC_NAS_UE,
MSC_RRC_UE,
......@@ -254,33 +159,24 @@ int nas_itti_nas_establish_req(as_cause_t cause, as_call_type_t type, as_stmsi_t
s_tmsi.MMEcode, s_tmsi.m_tmsi,
plmnID.MCCdigit1, plmnID.MCCdigit2, plmnID.MCCdigit3,
plmnID.MNCdigit1, plmnID.MNCdigit2, plmnID.MNCdigit3);
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;
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).nasMsg.data = data;
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);
}
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;
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).rabID = rabID;
NAS_RAB_ESTABLI_RSP(message_p).errCode = errCode;
MSC_LOG_TX_MESSAGE(
MSC_NAS_UE,
MSC_RRC_UE,
......
......@@ -36,103 +36,52 @@
#include "s1ap_common.h"
#include "s1ap_eNB_decoder.h"
static int s1ap_eNB_decode_initiating_message(S1AP_S1AP_PDU_t *pdu)
{
MessageDef *message_p;
MessagesIds message_id;
static int s1ap_eNB_decode_initiating_message(S1AP_S1AP_PDU_t *pdu) {
asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage.procedureCode) {
case S1AP_ProcedureCode_id_downlinkNASTransport:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_S1AP_S1AP_PDU, pdu);
message_id = S1AP_DOWNLINK_NAS_LOG;
message_p = itti_alloc_new_message_sized(TASK_S1AP, message_id,
res.result.encoded + sizeof (IttiMsgText));
message_p->ittiMsg.s1ap_downlink_nas_log.size = res.result.encoded;
memcpy(&message_p->ittiMsg.s1ap_downlink_nas_log.text, res.buffer, res.result.encoded);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(res.buffer);
break;
case S1AP_ProcedureCode_id_InitialContextSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_S1AP_S1AP_PDU, pdu);
message_id = S1AP_INITIAL_CONTEXT_SETUP_LOG;
message_p = itti_alloc_new_message_sized(TASK_S1AP, message_id,
res.result.encoded + sizeof (IttiMsgText));
message_p->ittiMsg.s1ap_initial_context_setup_log.size = res.result.encoded;
memcpy(&message_p->ittiMsg.s1ap_initial_context_setup_log.text, res.buffer, res.result.encoded);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(res.buffer);
break;
case S1AP_ProcedureCode_id_UEContextRelease:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_S1AP_S1AP_PDU, pdu);
message_id = S1AP_UE_CONTEXT_RELEASE_COMMAND_LOG;
message_p = itti_alloc_new_message_sized(TASK_S1AP, message_id,
res.result.encoded + sizeof (IttiMsgText));
message_p->ittiMsg.s1ap_ue_context_release_command_log.size = res.result.encoded;
memcpy(&message_p->ittiMsg.s1ap_ue_context_release_command_log.text, res.buffer, res.result.encoded);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(res.buffer);
break;
case S1AP_ProcedureCode_id_Paging:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_S1AP_S1AP_PDU, pdu);
message_id = S1AP_PAGING_LOG;
message_p = itti_alloc_new_message_sized(TASK_S1AP, message_id,
res.result.encoded + sizeof (IttiMsgText));
message_p->ittiMsg.s1ap_paging_log.size = res.result.encoded;
memcpy(&message_p->ittiMsg.s1ap_paging_log.text, res.buffer, res.result.encoded);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
S1AP_INFO("Paging initiating message\n");
free(res.buffer);
break;
case S1AP_ProcedureCode_id_E_RABSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_S1AP_S1AP_PDU, pdu);
message_id = S1AP_E_RAB_SETUP_REQUEST_LOG;
message_p = itti_alloc_new_message_sized(TASK_S1AP, message_id,
res.result.encoded + sizeof (IttiMsgText));
message_p->ittiMsg.s1ap_e_rab_setup_request_log.size = res.result.encoded;
memcpy(&message_p->ittiMsg.s1ap_e_rab_setup_request_log.text, res.buffer, res.result.encoded);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(res.buffer);
S1AP_INFO("E_RABSetup initiating message\n");
break;
case S1AP_ProcedureCode_id_E_RABModify:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_S1AP_S1AP_PDU, pdu);
message_id = S1AP_E_RAB_MODIFY_REQUEST_LOG;
message_p = itti_alloc_new_message_sized(TASK_S1AP, message_id,
res.result.encoded + sizeof (IttiMsgText));
message_p->ittiMsg.s1ap_e_rab_modify_request_log.size = res.result.encoded;
memcpy(&message_p->ittiMsg.s1ap_e_rab_modify_request_log.text, res.buffer, res.result.encoded);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(res.buffer);
S1AP_INFO("E_RABModify initiating message\n");
break;
case S1AP_ProcedureCode_id_E_RABRelease:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_S1AP_S1AP_PDU, pdu);
message_id = S1AP_E_RAB_RELEASE_REQUEST_LOG;
message_p = itti_alloc_new_message_sized(TASK_S1AP, message_id,
res.result.encoded + sizeof (IttiMsgText));
message_p->ittiMsg.s1ap_e_rab_release_request_log.size = res.result.encoded;
memcpy(&message_p->ittiMsg.s1ap_e_rab_release_request_log.text, res.buffer, res.result.encoded);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(res.buffer);
S1AP_INFO("TODO E_RABRelease initiating message\n");
break;
case S1AP_ProcedureCode_id_ErrorIndication:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_S1AP_S1AP_PDU, pdu);
message_id = S1AP_ERROR_INDICATION_LOG;
message_p = itti_alloc_new_message_sized(TASK_S1AP, message_id,
res.result.encoded + sizeof (IttiMsgText));
message_p->ittiMsg.s1ap_error_indication_log.size = res.result.encoded;
memcpy(&message_p->ittiMsg.s1ap_error_indication_log.text, res.buffer, res.result.encoded);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(res.buffer);
S1AP_INFO("TODO ErrorIndication initiating message\n");
break;
......@@ -148,21 +97,13 @@ static int s1ap_eNB_decode_initiating_message(S1AP_S1AP_PDU_t *pdu)
return 0;
}
static int s1ap_eNB_decode_successful_outcome(S1AP_S1AP_PDU_t *pdu)
{
MessageDef *message_p;
MessagesIds message_id;
static int s1ap_eNB_decode_successful_outcome(S1AP_S1AP_PDU_t *pdu) {
asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL);
switch(pdu->choice.successfulOutcome.procedureCode) {
case S1AP_ProcedureCode_id_S1Setup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_S1AP_S1AP_PDU, pdu);
message_id = S1AP_S1_SETUP_LOG;
message_p = itti_alloc_new_message_sized(TASK_S1AP, message_id, res.result.encoded + sizeof (IttiMsgText));
message_p->ittiMsg.s1ap_s1_setup_log.size = res.result.encoded;
memcpy(&message_p->ittiMsg.s1ap_s1_setup_log.text, res.buffer, res.result.encoded);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(res.buffer);
break;
......@@ -175,21 +116,13 @@ static int s1ap_eNB_decode_successful_outcome(S1AP_S1AP_PDU_t *pdu)
return 0;
}
static int s1ap_eNB_decode_unsuccessful_outcome(S1AP_S1AP_PDU_t *pdu)
{
MessageDef *message_p;
MessagesIds message_id;
static int s1ap_eNB_decode_unsuccessful_outcome(S1AP_S1AP_PDU_t *pdu) {
asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL);
switch(pdu->choice.unsuccessfulOutcome.procedureCode) {
case S1AP_ProcedureCode_id_S1Setup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_S1AP_S1AP_PDU, pdu);
message_id = S1AP_S1_SETUP_LOG;
message_p = itti_alloc_new_message_sized(TASK_S1AP, message_id, res.result.encoded + sizeof (IttiMsgText));
message_p->ittiMsg.s1ap_s1_setup_log.size = res.result.encoded;
memcpy(&message_p->ittiMsg.s1ap_s1_setup_log.text, res.buffer, res.result.encoded);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(res.buffer);
break;
......@@ -203,13 +136,10 @@ static int s1ap_eNB_decode_unsuccessful_outcome(S1AP_S1AP_PDU_t *pdu)
}
int s1ap_eNB_decode_pdu(S1AP_S1AP_PDU_t *pdu, const uint8_t *const buffer,
const uint32_t length)
{
const uint32_t length) {
asn_dec_rval_t dec_ret;
DevAssert(pdu != NULL);
DevAssert(buffer != NULL);
dec_ret = aper_decode(NULL,
&asn_DEF_S1AP_S1AP_PDU,
(void **)&pdu,
......
This diff is collapsed.
......@@ -25,40 +25,34 @@
# include "common/utils/LOG/log.h"
# include "targets/RT/USER/lte-softmodem.h"
# ifdef OPENAIR2
# if defined(ENABLE_USE_MME)
# include "sctp_eNB_task.h"
# include "x2ap_eNB.h"
# include "s1ap_eNB.h"
# include "nas_ue_task.h"
# include "udp_eNB_task.h"
# include "gtpv1u_eNB_task.h"
/* temporary warning removale while implementing noS1 */
/* as config option */
# else
# ifdef EPC_MODE_ENABLED
# undef EPC_MODE_ENABLED
# endif
# define EPC_MODE_ENABLED 0
# endif
# if ENABLE_RAL
# include "lteRALue.h"
# include "lteRALenb.h"
# endif
# include "RRC/LTE/rrc_defs.h"
# endif
#ifdef OPENAIR2
#if defined(ENABLE_USE_MME)
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
#include "nas_ue_task.h"
#include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
/* temporary warning removale while implementing noS1 */
/* as config option */
#else
#ifdef EPC_MODE_ENABLED
#undef EPC_MODE_ENABLED
#endif
#define EPC_MODE_ENABLED 0
#endif
#if ENABLE_RAL
#include "lteRALue.h"
#include "lteRALenb.h"
#endif
#include "RRC/LTE/rrc_defs.h"
#endif
# include "enb_app.h"
int create_tasks(uint32_t enb_nb)
{
int create_tasks(uint32_t enb_nb) {
LOG_D(ENB_APP, "%s(enb_nb:%d\n", __FUNCTION__, enb_nb);
itti_wait_ready(1);
if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) {
LOG_E(PDCP, "Create task for L2L1 failed\n");
return -1;
}
if (enb_nb > 0) {
/* Last task to create, others task must be ready before its start */
......@@ -67,7 +61,9 @@ int create_tasks(uint32_t enb_nb)
return -1;
}
}
# if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) {
if (enb_nb > 0) {
if (itti_create_task (TASK_X2AP, x2ap_task, NULL) < 0) {
......@@ -84,7 +80,8 @@ int create_tasks(uint32_t enb_nb)
LOG_E(S1AP, "Create task for S1AP failed\n");
return -1;
}
if(!(get_softmodem_params()->emulate_rf)){
if(!(get_softmodem_params()->emulate_rf)) {
if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
LOG_E(UDP_, "Create task for UDP failed\n");
return -1;
......@@ -96,9 +93,10 @@ int create_tasks(uint32_t enb_nb)
return -1;
}
}
} /* if (EPC_MODE_ENABLED) */
#endif
if (enb_nb > 0) {
LOG_I(RRC,"Creating RRC eNB Task\n");
......@@ -108,9 +106,7 @@ int create_tasks(uint32_t enb_nb)
}
}
itti_wait_ready(0);
return 0;
}
#endif
This diff is collapsed.
This diff is collapsed.
......@@ -201,6 +201,8 @@
{"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&DO_FORMS, defintval:0, TYPE_INT8, 0}, \
{"W" , CONFIG_HLP_L2MONW, 0, strptr:(char **)&in_ip, defstrval:"127.0.0.1", TYPE_STRING, sizeof(in_ip)}, \
{"P" , CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)}, \
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
{"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&NUMEROLOGY, defintval:0, TYPE_INT, 0}, \
......@@ -237,6 +239,7 @@
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
}
/***************************************************************************************************************************************/
/* */
#include "threads_t.h"
......@@ -292,14 +295,6 @@ extern int sync_var;
extern int transmission_mode;
extern double cpuf;
#if defined(ENABLE_ITTI)
extern volatile int start_eNB;
extern volatile int start_UE;
#endif
// In lte-enb.c
extern void init_eNB(int single_thread_flag,int wait_for_sync);
extern void stop_eNB(int);
......
This diff is collapsed.
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