Commit b45af4a3 authored by winckel's avatar winckel

Moved files related to assertions, backtrace and signals handling into ITTI directory.

Renamed all ITTI functions, to make them start with module name ("itti_").
Added generic signals handling support in ITTI.
Changed ITTI log port for oaisim to 10006.
Introduce an option to use ITTI in oaisim and reoragized code.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4267 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 228aa778
......@@ -2,6 +2,8 @@ ITTI_DIR = $(COMMON_UTILS_DIR)/itti
ITTI_OBJS = $(ITTI_DIR)/intertask_interface.o
ITTI_OBJS += $(ITTI_DIR)/intertask_interface_dump.o
ITTI_OBJS += $(ITTI_DIR)/backtrace.o
ITTI_OBJS += $(ITTI_DIR)/signals.o
ITTI_OBJS += $(ITTI_DIR)/timer.o
UTILS_OBJS = $(ITTI_OBJS)
......
......@@ -17,4 +17,7 @@ libitti_la_SOURCES = \
udp_message_def.h udp_messages_types.h \
intertask_interface.c intertask_interface.h \
intertask_interface_dump.c intertask_interface_dump.h \
assertions.h \
backtrace.c backtrace.h \
signals.c signals.h \
timer.c timer.h
\ No newline at end of file
This diff is collapsed.
......@@ -81,7 +81,7 @@ enum task_priorities {
\param message_p Pointer to the message to send
@returns < 0 on failure, 0 otherwise
**/
int send_broadcast_message(MessageDef *message_p);
int itti_send_broadcast_message(MessageDef *message_p);
/** \brief Send a message to a task (could be itself)
\param task_id Task ID
......@@ -89,21 +89,21 @@ int send_broadcast_message(MessageDef *message_p);
\param message Pointer to the message to send
@returns -1 on failure, 0 otherwise
**/
int send_msg_to_task(task_id_t task_id, instance_t instance, MessageDef *message);
int itti_send_msg_to_task(task_id_t task_id, instance_t instance, MessageDef *message);
/** \brief Retrieves a message in the queue associated to task_id.
* If the queue is empty, the thread is blocked till a new message arrives.
\param task_id Task ID of the receiving task
\param received_msg Pointer to the allocated message
**/
void receive_msg(task_id_t task_id, MessageDef **received_msg);
void itti_receive_msg(task_id_t task_id, MessageDef **received_msg);
/** \brief Try to retrieves a message in the queue associated to task_id and matching requested instance.
\param task_id Task ID of the receiving task
\param instance Instance of the task used for virtualization
\param received_msg Pointer to the allocated message
**/
void poll_msg(task_id_t task_id, instance_t instance, MessageDef **received_msg);
void itti_poll_msg(task_id_t task_id, instance_t instance, MessageDef **received_msg);
/** \brief Start thread associated to the task
* \param task_id task to start
......@@ -111,30 +111,43 @@ void poll_msg(task_id_t task_id, instance_t instance, MessageDef **received_msg)
* \param args_p Optional argument to pass to the start routine
* @returns -1 on failure, 0 otherwise
**/
int intertask_interface_create_task(task_id_t task_id,
int itti_create_task(task_id_t task_id,
void *(*start_routine) (void *),
void *args_p);
/** \brief Mark the task as in ready state
* \param task_id task to mark as ready
**/
void intertask_interface_mark_task_ready(task_id_t task_id);
void itti_mark_task_ready(task_id_t task_id);
/** \brief Indicate that the task is completed and initiate termination of all tasks.
* \param task_id task that is completed
**/
void itti_terminate_tasks(task_id_t task_id);
/** \brief Return the printable string associated with the message
* \param message_id Id of the message
**/
char *get_message_name(MessagesIds message_id);
char *itti_get_message_name(MessagesIds message_id);
/** \brief Alloc and memset(0) a new itti message.
\param origin_task_id Task ID of the sending task
\param message_id Message ID
@returns NULL in case of failure or newly allocated mesage ref
* \param origin_task_id Task ID of the sending task
* \param message_id Message ID
* @returns NULL in case of failure or newly allocated mesage ref
**/
inline MessageDef *alloc_new_message(
inline MessageDef *itti_alloc_new_message(
task_id_t origin_task_id,
MessagesIds message_id);
void intertask_interface_send_quit_signal(void);
/** \brief handle signals and wait for all threads to join when the process complete.
* This function should be called from the main thread after having created all ITTI tasks.
**/
void itti_wait_tasks_end(void);
/** \brief Send a termination message to all tasks.
* \param task_id task that is broadcasting the message.
**/
void itti_send_terminate_message(task_id_t task_id);
#endif /* INTERTASK_INTERFACE_H_ */
/* @} */
......@@ -79,7 +79,7 @@ const message_info_t messages_info[] = {
* \param threads_name Pointer on the threads name information as created by this include file
* \param messages_info Pointer on messages information as created by this include file
**/
int intertask_interface_init(thread_id_t thread_max, MessagesIds messages_id_max,
int itti_init(thread_id_t thread_max, MessagesIds messages_id_max,
const char * const *threads_name, const message_info_t *messages_info,
const char * const messages_definition_xml);
......
......@@ -43,13 +43,13 @@
#include <errno.h>
#include "intertask_interface.h"
#include "assertions.h"
#include "timer.h"
#include "backtrace.h"
#include "assertions.h"
#include "signals.h"
sigset_t set;
static sigset_t set;
int signal_init(void)
{
......@@ -74,7 +74,7 @@ int signal_init(void)
extern int timer_handle_signal(siginfo_t *info);
int signal_handle(void)
int signal_handle(int *end)
{
int ret;
siginfo_t info;
......@@ -82,6 +82,7 @@ int signal_handle(void)
sigemptyset(&set);
sigaddset (&set, SIGTIMER);
sigaddset (&set, SIGUSR1);
sigaddset (&set, SIGABRT);
sigaddset (&set, SIGSEGV);
sigaddset (&set, SIGINT);
......@@ -110,6 +111,10 @@ int signal_handle(void)
} else {
/* Dispatch the signal to sub-handlers */
switch(info.si_signo) {
case SIGUSR1:
printf("Received SIGUSR1\n");
*end = 1;
break;
case SIGSEGV: /* Fall through */
case SIGABRT:
printf("Received SIGABORT\n");
......@@ -118,7 +123,7 @@ int signal_handle(void)
case SIGQUIT:
case SIGINT:
printf("Received SIGINT\n");
intertask_interface_send_quit_signal();
itti_send_terminate_message(TASK_UNKNOWN);
printf("All tasks terminated -> exiting '"PACKAGE_NAME"'\n");
exit(0);
break;
......
......@@ -3,6 +3,6 @@
int signal_init(void);
int signal_handle(void);
int signal_handle(int *end);
#endif /* SIGNALS_H_ */
......@@ -93,7 +93,7 @@ int timer_handle_signal(siginfo_t *info)
task_id = timer_p->task_id;
instance = timer_p->instance;
message_p = alloc_new_message(TASK_TIMER, TIMER_HAS_EXPIRED);
message_p = itti_alloc_new_message(TASK_TIMER, TIMER_HAS_EXPIRED);
timer_expired_p = &message_p->msg.timer_has_expired;
......@@ -116,7 +116,7 @@ int timer_handle_signal(siginfo_t *info)
}
}
/* Notify task of timer expiry */
if (send_msg_to_task(task_id, instance, message_p) < 0) {
if (itti_send_msg_to_task(task_id, instance, message_p) < 0) {
TMR_DEBUG("Failed to send msg TIMER_HAS_EXPIRED to task %u\n", task_id);
free(message_p);
return -1;
......
......@@ -77,7 +77,7 @@ static int gtpv1u_send_init_udp(uint16_t port_number)
MessageDef *message_p;
struct in_addr addr;
message_p = alloc_new_message(TASK_GTPV1_U, UDP_INIT);
message_p = itti_alloc_new_message(TASK_GTPV1_U, UDP_INIT);
if (message_p == NULL) {
return -1;
}
......@@ -89,7 +89,7 @@ static int gtpv1u_send_init_udp(uint16_t port_number)
message_p->msg.udp_init.address = inet_ntoa(addr);
GTPU_DEBUG("Tx UDP_INIT IP addr %s\n", message_p->msg.udp_init.address);
return send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
}
NwGtpv1uRcT gtpv1u_log_request(NwGtpv1uLogMgrHandleT hLogMgr,
......@@ -113,7 +113,7 @@ NwGtpv1uRcT gtpv1u_send_udp_msg(
MessageDef *message_p;
udp_data_req_t *udp_data_req_p;
message_p = alloc_new_message(TASK_GTPV1_U, UDP_DATA_REQ);
message_p = itti_alloc_new_message(TASK_GTPV1_U, UDP_DATA_REQ);
udp_data_req_p = &message_p->msg.udp_data_req;
......@@ -122,7 +122,7 @@ NwGtpv1uRcT gtpv1u_send_udp_msg(
udp_data_req_p->buffer = buffer;
udp_data_req_p->buffer_length = buffer_len;
return send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
}
/* Callback called when a gtpv1u message arrived on UDP interface */
......@@ -150,7 +150,7 @@ NwGtpv1uRcT gtpv1u_process_stack_req(
}
GTPU_DEBUG("Received TPDU from gtpv1u stack %u with size %d", pUlpApi->apiInfo.recvMsgInfo.teid, buffer_len);
message_p = alloc_new_message(TASK_GTPV1_U, GTPV1U_TUNNEL_DATA_IND);
message_p = itti_alloc_new_message(TASK_GTPV1_U, GTPV1U_TUNNEL_DATA_IND);
if (message_p == NULL) {
return -1;
}
......@@ -163,7 +163,7 @@ NwGtpv1uRcT gtpv1u_process_stack_req(
} else {
memcpy(data_ind_p->buffer, buffer, buffer_len);
data_ind_p->length = buffer_len;
if (send_msg_to_task(TASK_FW_IP, INSTANCE_DEFAULT, message_p) < 0) {
if (itti_send_msg_to_task(TASK_FW_IP, INSTANCE_DEFAULT, message_p) < 0) {
GTPU_ERROR("Failed to send message to task\n");
free(message_p);
}
......@@ -223,7 +223,7 @@ static int gtpv1u_create_s1u_tunnel(Gtpv1uCreateTunnelReq *create_tunnel_reqP)
gtpv1u_teid2enb_info->state = BEARER_IN_CONFIG;
message_p = alloc_new_message(TASK_GTPV1_U, GTPV1U_CREATE_TUNNEL_RESP);
message_p = itti_alloc_new_message(TASK_GTPV1_U, GTPV1U_CREATE_TUNNEL_RESP);
message_p->msg.gtpv1uCreateTunnelResp.S1u_teid = s1u_teid;
message_p->msg.gtpv1uCreateTunnelResp.context_teid = create_tunnel_reqP->context_teid;
message_p->msg.gtpv1uCreateTunnelResp.eps_bearer_id = create_tunnel_reqP->eps_bearer_id;
......@@ -242,7 +242,7 @@ static int gtpv1u_create_s1u_tunnel(Gtpv1uCreateTunnelReq *create_tunnel_reqP)
message_p->msg.gtpv1uCreateTunnelResp.S1u_teid,
message_p->msg.gtpv1uCreateTunnelResp.eps_bearer_id,
message_p->msg.gtpv1uCreateTunnelResp.status);
return send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
......@@ -253,7 +253,7 @@ static int gtpv1u_delete_s1u_tunnel(Teid_t context_teidP, Teid_t S1U_teidP)
MessageDef *message_p;
GTPU_DEBUG("Rx GTPV1U_DELETE_TUNNEL Context %u S1U teid %u\n", context_teidP, S1U_teidP);
message_p = alloc_new_message(TASK_GTPV1_U, GTPV1U_DELETE_TUNNEL_RESP);
message_p = itti_alloc_new_message(TASK_GTPV1_U, GTPV1U_DELETE_TUNNEL_RESP);
message_p->msg.gtpv1uDeleteTunnelResp.S1u_teid = S1U_teidP;
message_p->msg.gtpv1uDeleteTunnelResp.context_teid = context_teidP;
......@@ -264,7 +264,7 @@ static int gtpv1u_delete_s1u_tunnel(Teid_t context_teidP, Teid_t S1U_teidP)
message_p->msg.gtpv1uDeleteTunnelResp.status = -1;
}
GTPU_DEBUG("Tx SGW_S1U_ENDPOINT_CREATED Context %u teid %u status %d\n", context_teidP, S1U_teidP, message_p->msg.gtpv1uDeleteTunnelResp.status);
return send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
......@@ -278,7 +278,7 @@ static int gtpv1u_update_s1u_tunnel(Gtpv1uUpdateTunnelReq *reqP)
reqP->context_teid,
reqP->sgw_S1u_teid,
reqP->enb_S1u_teid);
message_p = alloc_new_message(TASK_GTPV1_U, GTPV1U_UPDATE_TUNNEL_RESP);
message_p = itti_alloc_new_message(TASK_GTPV1_U, GTPV1U_UPDATE_TUNNEL_RESP);
hash_rc = hashtbl_get(gtpv1u_sgw_data.S1U_mapping, reqP->sgw_S1u_teid, (void**)&gtpv1u_teid2enb_info);
......@@ -296,7 +296,7 @@ static int gtpv1u_update_s1u_tunnel(Gtpv1uUpdateTunnelReq *reqP)
message_p->msg.gtpv1uUpdateTunnelResp.sgw_S1u_teid = reqP->sgw_S1u_teid;
message_p->msg.gtpv1uUpdateTunnelResp.enb_S1u_teid = reqP->enb_S1u_teid;
message_p->msg.gtpv1uUpdateTunnelResp.eps_bearer_id = reqP->eps_bearer_id;
return send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
......@@ -345,14 +345,14 @@ static NwGtpv1uRcT gtpv1u_stop_timer_wrapper(
static void *gtpv1u_thread(void *args)
{
intertask_interface_mark_task_ready(TASK_GTPV1_U);
itti_mark_task_ready(TASK_GTPV1_U);
while(1) {
/* Trying to fetch a message from the message queue.
* If the queue is empty, this function will block till a
* message is sent to the task.
*/
MessageDef *received_message_p = NULL;
receive_msg(TASK_GTPV1_U, &received_message_p);
itti_receive_msg(TASK_GTPV1_U, &received_message_p);
DevAssert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
......@@ -453,7 +453,7 @@ static void *gtpv1u_thread(void *args)
break;
default: {
GTPU_ERROR("Unkwnon message ID %s:%d\n",
get_message_name(received_message_p->header.messageId),
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
}
break;
......@@ -537,7 +537,7 @@ int gtpv1u_init(const mme_config_t *mme_config_p)
return -1;
}
if (intertask_interface_create_task(TASK_GTPV1_U, &gtpv1u_thread, NULL) < 0) {
if (itti_create_task(TASK_GTPV1_U, &gtpv1u_thread, NULL) < 0) {
GTPU_ERROR("gtpv1u phtread_create: %s", strerror(errno));
return -1;
}
......
......@@ -54,7 +54,7 @@ int mme_app_request_authentication_info(const mme_app_imsi_t imsi,
DevAssert(plmn != NULL);
message_p = alloc_new_message(TASK_MME_APP, S6A_AUTH_INFO_REQ);
message_p = itti_alloc_new_message(TASK_MME_APP, S6A_AUTH_INFO_REQ);
if (message_p == NULL) return -1;
......@@ -63,7 +63,7 @@ int mme_app_request_authentication_info(const mme_app_imsi_t imsi,
memcpy(&auth_info_req->visited_plmn, plmn, sizeof(plmn_t));
auth_info_req->nb_of_vectors = nb_of_vectors;
return send_msg_to_task(TASK_S6A, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_S6A, INSTANCE_DEFAULT, message_p);
}
int mme_app_handle_nas_auth_resp(nas_auth_resp_t *nas_auth_resp_p)
......@@ -92,7 +92,7 @@ int mme_app_handle_nas_auth_resp(nas_auth_resp_t *nas_auth_resp_p)
MessageDef *message_p;
s6a_update_location_req_t *s6a_ulr;
message_p = alloc_new_message(TASK_MME_APP, S6A_UPDATE_LOCATION_REQ);
message_p = itti_alloc_new_message(TASK_MME_APP, S6A_UPDATE_LOCATION_REQ);
if (message_p == NULL) {
return -1;
......@@ -106,7 +106,7 @@ int mme_app_handle_nas_auth_resp(nas_auth_resp_t *nas_auth_resp_p)
/* Check if we already have UE data */
s6a_ulr->skip_subsriber_data = 0;
return send_msg_to_task(TASK_S6A, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_S6A, INSTANCE_DEFAULT, message_p);
}
return -1;
}
......@@ -121,7 +121,7 @@ int mme_app_handle_authentication_info_answer(s6a_auth_info_ans_t *s6a_auth_info
DevAssert(s6a_auth_info_ans_p != NULL);
message_p = alloc_new_message(TASK_MME_APP, NAS_AUTHENTICATION_REQ);
message_p = itti_alloc_new_message(TASK_MME_APP, NAS_AUTHENTICATION_REQ);
if (message_p == NULL) {
return -1;
......@@ -172,7 +172,7 @@ int mme_app_handle_authentication_info_answer(s6a_auth_info_ans_t *s6a_auth_info
"!= S6A_RESULT_BASE");
}
return send_msg_to_task(TASK_NAS, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_NAS, INSTANCE_DEFAULT, message_p);
}
int mme_app_handle_attach_req(nas_attach_req_t *attach_req_p)
......@@ -270,14 +270,14 @@ request_auth:
/* We have a vector... USE it */
MME_APP_DEBUG("but we have an auth. vector for it, request"
" authentication from NAS\n");
message_p = alloc_new_message(TASK_MME_APP, NAS_AUTHENTICATION_REQ);
message_p = itti_alloc_new_message(TASK_MME_APP, NAS_AUTHENTICATION_REQ);
nas_auth_req_p = &message_p->msg.nas_auth_req;
MME_APP_IMSI_TO_STRING(imsi, nas_auth_req_p->imsi);
nas_auth_req_p->failure = NAS_FAILURE_OK;
return send_msg_to_task(TASK_NAS, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_NAS, INSTANCE_DEFAULT, message_p);
}
}
}
......
......@@ -115,7 +115,7 @@ int mme_app_create_bearer(s6a_update_location_ans_t *ula_p)
DevMessage("Not implemented: ACCESS NOT GRANTED, send ESM Failure to NAS\n");
}
message_p = alloc_new_message(TASK_MME_APP, SGW_CREATE_SESSION_REQUEST);
message_p = itti_alloc_new_message(TASK_MME_APP, SGW_CREATE_SESSION_REQUEST);
/* WARNING:
* Some parameters should be provided by NAS Layer:
......@@ -237,7 +237,7 @@ int mme_app_create_bearer(s6a_update_location_ans_t *ula_p)
session_request_p->serving_network.mnc[2] = ue_context->e_utran_cgi.plmn.MNCdigit3;
session_request_p->selection_mode = MS_O_N_P_APN_S_V;
return send_msg_to_task(to_task, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(to_task, INSTANCE_DEFAULT, message_p);
}
int mme_app_handle_create_sess_resp(SgwCreateSessionResponse *create_sess_resp_p)
......@@ -318,7 +318,7 @@ int mme_app_handle_create_sess_resp(SgwCreateSessionResponse *create_sess_resp_p
MessageDef *message_p;
nas_attach_accept_t *attach_accept_p;
message_p = alloc_new_message(TASK_MME_APP, NAS_ATTACH_ACCEPT);
message_p = itti_alloc_new_message(TASK_MME_APP, NAS_ATTACH_ACCEPT);
attach_accept_p = &message_p->msg.nas_attach_accept;
......@@ -344,7 +344,7 @@ int mme_app_handle_create_sess_resp(SgwCreateSessionResponse *create_sess_resp_p
memcpy(&attach_accept_p->transparent.ambr, &ue_context_p->subscribed_ambr,
sizeof(ambr_t));
return send_msg_to_task(TASK_NAS, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_NAS, INSTANCE_DEFAULT, message_p);
}
return 0;
......
......@@ -49,7 +49,7 @@ void *mme_app_thread(void *args);
void *mme_app_thread(void *args)
{
intertask_interface_mark_task_ready(TASK_MME_APP);
itti_mark_task_ready(TASK_MME_APP);
while(1) {
MessageDef *received_message_p = NULL;
......@@ -57,7 +57,7 @@ void *mme_app_thread(void *args)
* If the queue is empty, this function will block till a
* message is sent to the task.
*/
receive_msg(TASK_MME_APP, &received_message_p);
itti_receive_msg(TASK_MME_APP, &received_message_p);
DevAssert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
case S6A_AUTH_INFO_ANS: {
......@@ -92,7 +92,7 @@ void *mme_app_thread(void *args)
} break;
default: {
MME_APP_DEBUG("Unkwnon message ID %s:%d\n",
get_message_name(received_message_p->header.messageId),
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
} break;
}
......@@ -109,7 +109,7 @@ int mme_app_init(const mme_config_t *mme_config_p)
memset(&mme_app_desc, 0, sizeof(mme_app_desc));
/* Create the thread associated with MME applicative layer */
if (intertask_interface_create_task(TASK_MME_APP, &mme_app_thread, NULL) < 0) {
if (itti_create_task(TASK_MME_APP, &mme_app_thread, NULL) < 0) {
MME_APP_ERROR("MME APP create task failed\n");
return -1;
}
......
......@@ -36,10 +36,10 @@
// {
// MessageDef *message_p;
//
// message_p = alloc_new_message(TASK_MME_APP, TASK_NAS,
// message_p = itti_alloc_new_message(TASK_MME_APP, TASK_NAS,
// SGW_CREATE_SESSION_REQUEST);
//
// return send_msg_to_task(TASK_NAS, message_p);
// return itti_send_msg_to_task(TASK_NAS, message_p);
// }
int s6a_error_2_nas_cause(uint32_t s6a_error, int experimental)
......
......@@ -1090,13 +1090,13 @@ static int _emm_as_send(const emm_as_t* msg)
case AS_DL_INFO_TRANSFER_REQ: {
int ret;
message_p = alloc_new_message(TASK_NAS, NAS_DOWNLINK_DATA_IND);
message_p = itti_alloc_new_message(TASK_NAS, NAS_DOWNLINK_DATA_IND);
memcpy(&message_p->msg.nas_dl_data_ind,
&as_msg.msg.dl_info_transfer_req,
sizeof(nas_dl_data_ind_t));
ret = send_msg_to_task(TASK_S1AP, 0, message_p);
ret = itti_send_msg_to_task(TASK_S1AP, 0, message_p);
if (ret != -1) {
LOG_FUNC_RETURN (RETURNok);
......
......@@ -21,13 +21,13 @@
static void *nas_intertask_interface(void *args_p)
{
intertask_interface_mark_task_ready(TASK_NAS);
itti_mark_task_ready(TASK_NAS);
while(1) {
MessageDef *received_message_p;
next_message:
receive_msg(TASK_NAS, &received_message_p);
itti_receive_msg(TASK_NAS, &received_message_p);
switch(received_message_p->header.messageId) {
case NAS_CONNECTION_ESTABLISHMENT_IND: {
#if defined(DISABLE_USE_NAS)
......@@ -37,7 +37,7 @@ next_message:
NAS_DEBUG("NAS abstraction: Generating NAS ATTACH REQ\n");
message_p = alloc_new_message(TASK_NAS, NAS_ATTACH_REQ);
message_p = itti_alloc_new_message(TASK_NAS, NAS_ATTACH_REQ);
nas_req_p = &message_p->msg.nas_attach_req;
transparent = &message_p->msg.nas_attach_req.transparent;
......@@ -48,7 +48,7 @@ next_message:
memcpy(transparent, &received_message_p->msg.nas_conn_est_ind.transparent,
sizeof(s1ap_initial_ue_message_t));
send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
#else
nas_establish_ind_t *nas_est_ind_p;
......@@ -61,7 +61,7 @@ next_message:
#endif
} break;
case NAS_ATTACH_ACCEPT: {
send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, received_message_p);
itti_send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, received_message_p);
goto next_message;
} break;
case NAS_AUTHENTICATION_REQ: {
......@@ -70,17 +70,17 @@ next_message:
NAS_DEBUG("NAS abstraction: Generating NAS AUTHENTICATION RESPONSE\n");
message_p = alloc_new_message(TASK_NAS, NAS_AUTHENTICATION_RESP);
message_p = itti_alloc_new_message(TASK_NAS, NAS_AUTHENTICATION_RESP);
nas_resp_p = &message_p->msg.nas_auth_resp;
memcpy(nas_resp_p->imsi, received_message_p->msg.nas_auth_req.imsi, 16);
send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
} break;
default: {
NAS_DEBUG("Unkwnon message ID %s:%d\n",
get_message_name(received_message_p->header.messageId),
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
} break;
}
......@@ -98,7 +98,7 @@ int nas_init(const mme_config_t *mme_config_p)
emm_main_initialize();
#endif
if (intertask_interface_create_task(TASK_NAS, &nas_intertask_interface,
if (itti_create_task(TASK_NAS, &nas_intertask_interface,
NULL) < 0) {
NAS_ERROR("Create task failed");
NAS_DEBUG("Initializing NAS task interface: FAILED\n");
......
......@@ -41,8 +41,6 @@
#include "mme_config.h"
#include "gtpv1u_sgw_defs.h"
#include "signals.h"
#include "intertask_interface_init.h"
#include "sctp_primitives_server.h"
......@@ -65,18 +63,12 @@
int main(int argc, char *argv[])
{
/* Initialize signals */
CHECK_INIT_RETURN(signal_init());
/* Parse the command line for options and set the mme_config accordingly. */
CHECK_INIT_RETURN(config_parse_opt_line(argc, argv, &mme_config));
/* Calling each layer init function */
CHECK_INIT_RETURN(log_init(&mme_config, oai_mme_log_specific));
CHECK_INIT_RETURN(intertask_interface_init(THREAD_MAX,
MESSAGES_ID_MAX, threads_name,
messages_info,
messages_definition_xml));
CHECK_INIT_RETURN(itti_init(THREAD_MAX, MESSAGES_ID_MAX, threads_name, messages_info, messages_definition_xml));
CHECK_INIT_RETURN(nas_init(&mme_config));
CHECK_INIT_RETURN(sctp_init(&mme_config));
......@@ -91,9 +83,7 @@ int main(int argc, char *argv[])
// if (sgw_lite_init(&mme_config) < 0) return -1;
/* Handle signals here */
while(1) {
signal_handle();
}
itti_wait_tasks_end();
return 0;
}
......@@ -47,7 +47,6 @@
#include "gtpv1u_sgw_defs.h"
#include "assertions.h"
#include "signals.h"
#include "intertask_interface_init.h"
......@@ -70,19 +69,12 @@
int main(int argc, char *argv[])
{
/* Initialize signals. Note that signals should be initialized before
* other threads are created as it will block signals for child threads.
*/
CHECK_INIT_RETURN(signal_init());
/* Parse the command line for options and set the mme_config accordingly. */
CHECK_INIT_RETURN(config_parse_opt_line(argc, argv, &mme_config) < 0);
/* Calling each layer init function */
CHECK_INIT_RETURN(log_init(&mme_config, oai_epc_log_specific));
CHECK_INIT_RETURN(intertask_interface_init(THREAD_MAX, MESSAGES_ID_MAX,
threads_name, messages_info,
messages_definition_xml));
CHECK_INIT_RETURN(itti_init(THREAD_MAX, MESSAGES_ID_MAX, threads_name, messages_info, messages_definition_xml));
CHECK_INIT_RETURN(nas_init(&mme_config));
CHECK_INIT_RETURN(sctp_init(&mme_config));
......@@ -97,9 +89,7 @@ int main(int argc, char *argv[])
CHECK_INIT_RETURN(sgw_lite_init(&mme_config));
/* Handle signals here */
while(1) {
signal_handle();
}
itti_wait_tasks_end();
return 0;
}
......@@ -41,8 +41,6 @@
#include "assertions.h"
#include "mme_config.h"
#include "signals.h"
#include "intertask_interface_init.h"
#include "udp_primitives_server.h"
......@@ -57,17 +55,12 @@
int main(int argc, char *argv[])
{
/* Initialize signals */
CHECK_INIT_RETURN(signal_init());
/* Parse the command line for options and set the mme_config accordingly. */
CHECK_INIT_RETURN(config_parse_opt_line(argc, argv, &mme_config));
/* Calling each layer init function */
CHECK_INIT_RETURN(log_init(&mme_config, oai_sgw_log_specific));
CHECK_INIT_RETURN(intertask_interface_init(THREAD_MAX, MESSAGES_ID_MAX,
threads_name, messages_info,
messages_definition_xml));
CHECK_INIT_RETURN(itti_init(THREAD_MAX, MESSAGES_ID_MAX, threads_name, messages_info, messages_definition_xml));
CHECK_INIT_RETURN(udp_init(&mme_config));
CHECK_INIT_RETURN(s11_sgw_init(&mme_config));
......@@ -77,9 +70,7 @@ int main(int argc, char *argv[])
CHECK_INIT_RETURN(sgw_lite_init(&mme_config));
/* Handle signals here */
while(1) {
signal_handle();
}
itti_wait_tasks_end();
return 0;
}
......@@ -96,7 +96,7 @@ int s11_mme_handle_create_session_response(NwGtpv2cStackHandleT *stack_p,
DevAssert(stack_p != NULL);
message_p = alloc_new_message(TASK_S11, SGW_CREATE_SESSION_RESPONSE);
message_p = itti_alloc_new_message(TASK_S11, SGW_CREATE_SESSION_RESPONSE);
create_session_resp_p = &message_p->msg.sgwCreateSessionResponse;
......@@ -173,5 +173,5 @@ int s11_mme_handle_create_session_response(NwGtpv2cStackHandleT *stack_p,
rc = nwGtpv2cMsgDelete(*stack_p, (pUlpApi->hMsg));
DevAssert(NW_OK == rc);
return send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
}
......@@ -110,7 +110,7 @@ NwRcT s11_mme_send_udp_msg(
udp_data_req_t *udp_data_req_p;
int ret = 0;
message_p = alloc_new_message(TASK_S11, UDP_DATA_REQ);
message_p = itti_alloc_new_message(TASK_S11, UDP_DATA_REQ);
udp_data_req_p = &message_p->msg.udp_data_req;
......@@ -119,7 +119,7 @@ NwRcT s11_mme_send_udp_msg(
udp_data_req_p->buffer = buffer;
udp_data_req_p->buffer_length = buffer_len;
ret = send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
ret = itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
return ((ret == 0) ? NW_OK : NW_FAILURE);
}
......@@ -173,10 +173,10 @@ NwRcT s11_mme_stop_timer_wrapper(
static void *s11_mme_thread(void *args)
{
intertask_interface_mark_task_ready(TASK_S11);
itti_mark_task_ready(TASK_S11);
while(1) {
MessageDef *received_message_p = NULL;
receive_msg(TASK_S11, &received_message_p);
itti_receive_msg(TASK_S11, &received_message_p);
assert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
......@@ -209,7 +209,7 @@ static void *s11_mme_thread(void *args)
} break;
default: {
S11_ERROR("Unkwnon message ID %s:%d\n",
get_message_name(received_message_p->header.messageId),
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
}
break;
......@@ -224,7 +224,7 @@ static int s11_send_init_udp(char *address, uint16_t port_number)
{
MessageDef *message_p;
message_p = alloc_new_message(TASK_S11, UDP_INIT);
message_p = itti_alloc_new_message(TASK_S11, UDP_INIT);
if (message_p == NULL) {
return -1;
}
......@@ -235,7 +235,7 @@ static int s11_send_init_udp(char *address, uint16_t port_number)
S11_DEBUG("Tx UDP_INIT IP addr %s\n", message_p->msg.udp_init.address);
return send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
}
int s11_mme_init(const mme_config_t *mme_config_p)
......@@ -276,7 +276,7 @@ int s11_mme_init(const mme_config_t *mme_config_p)
logMgr.logReqCallback = s11_mme_log_wrapper;
DevAssert(NW_OK == nwGtpv2cSetLogMgrEntity(s11_mme_stack_handle, &logMgr));
if (intertask_interface_create_task(TASK_S11, &s11_mme_thread, NULL) < 0) {
if (itti_create_task(TASK_S11, &s11_mme_thread, NULL) < 0) {
S11_ERROR("gtpv1u phtread_create: %s\n", strerror(errno));
goto fail;
}
......
......@@ -110,7 +110,7 @@ NwRcT s11_sgw_send_udp_msg(
udp_data_req_t *udp_data_req_p;
int ret = 0;
message_p = alloc_new_message(TASK_S11, UDP_DATA_REQ);
message_p = itti_alloc_new_message(TASK_S11, UDP_DATA_REQ);
udp_data_req_p = &message_p->msg.udp_data_req;
......@@ -119,7 +119,7 @@ NwRcT s11_sgw_send_udp_msg(
udp_data_req_p->buffer = buffer;
udp_data_req_p->buffer_length = buffer_len;
ret = send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
ret = itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
return ret == 0 ? NW_OK : NW_FAILURE;
}
......@@ -185,10 +185,10 @@ NwRcT s11_sgw_stop_timer_wrapper(
static void *s11_sgw_thread(void *args)
{
intertask_interface_mark_task_ready(TASK_S11);
itti_mark_task_ready(TASK_S11);
while(1) {
MessageDef *received_message_p = NULL;
receive_msg(TASK_S11, &received_message_p);
itti_receive_msg(TASK_S11, &received_message_p);
assert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
......@@ -235,7 +235,7 @@ static void *s11_sgw_thread(void *args)
} break;
default: {
S11_ERROR("Unkwnon message ID %s:%d\n",
get_message_name(received_message_p->header.messageId),
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
}
break;
......@@ -250,7 +250,7 @@ static int s11_send_init_udp(char *address, uint16_t port_number)
{
MessageDef *message_p;
message_p = alloc_new_message(TASK_S11, UDP_INIT);
message_p = itti_alloc_new_message(TASK_S11, UDP_INIT);
if (message_p == NULL) {
return -1;
}
......@@ -261,7 +261,7 @@ static int s11_send_init_udp(char *address, uint16_t port_number)
S11_DEBUG("Tx UDP_INIT IP addr %s\n", message_p->msg.udp_init.address);
return send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
}
int s11_sgw_init(const mme_config_t *mme_config_p)
......@@ -302,7 +302,7 @@ int s11_sgw_init(const mme_config_t *mme_config_p)
DevAssert(NW_OK == nwGtpv2cSetLogMgrEntity(s11_sgw_stack_handle, &logMgr));
if (intertask_interface_create_task(TASK_S11, &s11_sgw_thread, NULL) < 0) {
if (itti_create_task(TASK_S11, &s11_sgw_thread, NULL) < 0) {
S11_ERROR("gtpv1u phtread_create: %s\n", strerror(errno));
goto fail;
}
......
......@@ -32,7 +32,7 @@ int s11_sgw_handle_modify_bearer_request(NwGtpv2cStackHandleT *stack_p,
DevAssert(stack_p != NULL);
message_p = alloc_new_message(TASK_S11, SGW_MODIFY_BEARER_REQUEST);
message_p = itti_alloc_new_message(TASK_S11, SGW_MODIFY_BEARER_REQUEST);
modify_bearer_request_p = &message_p->msg.sgwModifyBearerRequest;
......@@ -159,7 +159,7 @@ int s11_sgw_handle_modify_bearer_request(NwGtpv2cStackHandleT *stack_p,
rc = nwGtpv2cMsgDelete(*stack_p, (pUlpApi->hMsg));
DevAssert(NW_OK == rc);
return send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
int s11_sgw_handle_modify_bearer_response(
......
......@@ -32,7 +32,7 @@ int s11_sgw_handle_create_session_request(NwGtpv2cStackHandleT *stack_p,
DevAssert(stack_p != NULL);
message_p = alloc_new_message(TASK_S11, SGW_CREATE_SESSION_REQUEST);
message_p = itti_alloc_new_message(TASK_S11, SGW_CREATE_SESSION_REQUEST);
create_session_request_p = &message_p->msg.sgwCreateSessionRequest;
......@@ -244,7 +244,7 @@ int s11_sgw_handle_create_session_request(NwGtpv2cStackHandleT *stack_p,
rc = nwGtpv2cMsgDelete(*stack_p, (pUlpApi->hMsg));
DevAssert(NW_OK == rc);
return send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
int s11_sgw_handle_create_session_response(
......@@ -333,7 +333,7 @@ int s11_sgw_handle_delete_session_request(NwGtpv2cStackHandleT *stack_p,
DevAssert(stack_p != NULL);
message_p = alloc_new_message(TASK_S11, SGW_DELETE_SESSION_REQUEST);
message_p = itti_alloc_new_message(TASK_S11, SGW_DELETE_SESSION_REQUEST);
delete_session_request_p = &message_p->msg.sgwDeleteSessionRequest;
......@@ -444,7 +444,7 @@ int s11_sgw_handle_delete_session_request(NwGtpv2cStackHandleT *stack_p,
rc = nwGtpv2cMsgDelete(*stack_p, (pUlpApi->hMsg));
DevAssert(NW_OK == rc);
return send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
int s11_sgw_handle_delete_session_response(
......
......@@ -68,7 +68,7 @@ void *s1ap_mme_thread(void *args);
static int s1ap_send_init_sctp(void) {
// Create and alloc new message
MessageDef *message_p;
message_p = alloc_new_message(TASK_S1AP, SCTP_INIT_MSG);
message_p = itti_alloc_new_message(TASK_S1AP, SCTP_INIT_MSG);
message_p->msg.sctpInit.port = S1AP_PORT_NUMBER;
message_p->msg.sctpInit.ppid = S1AP_SCTP_PPID;
message_p->msg.sctpInit.ipv4 = 1;
......@@ -81,20 +81,20 @@ static int s1ap_send_init_sctp(void) {
message_p->msg.sctpInit.nb_ipv6_addr = 0;
message_p->msg.sctpInit.ipv6_address[0] = "0:0:0:0:0:0:0:1";
return send_msg_to_task(TASK_SCTP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_SCTP, INSTANCE_DEFAULT, message_p);
}
void *s1ap_mme_thread(void *args)
{
MessageDef *received_message_p;
intertask_interface_mark_task_ready(TASK_S1AP);
itti_mark_task_ready(TASK_S1AP);
while(1) {
/* Trying to fetch a message from the message queue.
* If the queue is empty, this function will block till a
* message is sent to the task.
*/
receive_msg(TASK_S1AP, &received_message_p);
itti_receive_msg(TASK_S1AP, &received_message_p);
assert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
case S1AP_SCTP_NEW_MESSAGE_IND: {
......@@ -140,7 +140,7 @@ void *s1ap_mme_thread(void *args)
} break;
default: {
S1AP_DEBUG("Unkwnon message ID %s:%d\n",
get_message_name(received_message_p->header.messageId),
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
} break;
}
......@@ -170,7 +170,7 @@ int s1ap_mme_init(const mme_config_t *mme_config_p) {
# endif
#endif
if (intertask_interface_create_task(TASK_S1AP, &s1ap_mme_thread, NULL) < 0) {
if (itti_create_task(TASK_S1AP, &s1ap_mme_thread, NULL) < 0) {
S1AP_ERROR("Error while creating S1AP task\n");
return -1;
}
......
......@@ -445,7 +445,7 @@ int s1ap_mme_handle_ue_cap_indication(uint32_t assoc_id, uint32_t stream,
MessageDef *message_p;
s1ap_ue_cap_ind_t *ue_cap_ind_p;
message_p = alloc_new_message(TASK_S1AP, S1AP_UE_CAPABILITIES_IND);
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_UE_CAPABILITIES_IND);
DevAssert(message_p != NULL);
......@@ -461,7 +461,7 @@ int s1ap_mme_handle_ue_cap_indication(uint32_t assoc_id, uint32_t stream,
ue_cap_ind_p->radio_capabilities_length = ue_cap_p->ueRadioCapability.size;
return send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
}
return 0;
}
......@@ -506,7 +506,7 @@ int s1ap_mme_handle_initial_context_setup_response(
ue_ref->s1_ue_state = S1AP_UE_CONNECTED;
message_p = alloc_new_message(TASK_SPGW_APP, SGW_MODIFY_BEARER_REQUEST);
message_p = itti_alloc_new_message(TASK_SPGW_APP, SGW_MODIFY_BEARER_REQUEST);
if (message_p == NULL) {
return -1;
......@@ -525,7 +525,7 @@ int s1ap_mme_handle_initial_context_setup_response(
memcpy(&modify_request_p->bearer_context_to_modify.s1_eNB_fteid.ipv4_address,
eRABSetupItemCtxtSURes_p->transportLayerAddress.buf, 4);
return send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
int s1ap_mme_handle_ue_context_release_request(uint32_t assoc_id,
......
......@@ -36,7 +36,7 @@ int s1ap_mme_itti_send_sctp_request(uint8_t *buffer, uint32_t length,
MessageDef *message_p;
SctpNewDataReq *sctpNewDataReq_p;
message_p = alloc_new_message(TASK_SCTP, SCTP_NEW_DATA_REQ);
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_NEW_DATA_REQ);
sctpNewDataReq_p = &message_p->msg.sctpNewDataReq;
......@@ -45,7 +45,7 @@ int s1ap_mme_itti_send_sctp_request(uint8_t *buffer, uint32_t length,
sctpNewDataReq_p->assocId = assoc_id;
sctpNewDataReq_p->stream = stream;
return send_msg_to_task(TASK_SCTP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_SCTP, INSTANCE_DEFAULT, message_p);
}
int s1ap_mme_itti_forward_nas_uplink(uint8_t *buffer, uint32_t length)
......
......@@ -127,7 +127,7 @@ int s1ap_mme_handle_initial_ue_message(uint32_t assoc_id, uint32_t stream,
s1ap_initial_ue_message_t *s1ap_p;
message_p = alloc_new_message(TASK_S1AP, NAS_CONNECTION_ESTABLISHMENT_IND);
message_p = itti_alloc_new_message(TASK_S1AP, NAS_CONNECTION_ESTABLISHMENT_IND);
/* We failed to allocate a new message... */
if (message_p == NULL) {
return -1;
......@@ -164,7 +164,7 @@ int s1ap_mme_handle_initial_ue_message(uint32_t assoc_id, uint32_t stream,
memcpy(con_ind_p->initialNasMsg.data, initialUEMessage_p->nas_pdu.buf,
initialUEMessage_p->nas_pdu.size);
return send_msg_to_task(TASK_NAS, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_NAS, INSTANCE_DEFAULT, message_p);
}
}
return 0;
......
......@@ -200,7 +200,7 @@ int s6a_aia_cb(struct msg **msg, struct avp *paramavp,
DevAssert(qry != NULL);
message_p = alloc_new_message(TASK_S6A, S6A_AUTH_INFO_ANS);
message_p = itti_alloc_new_message(TASK_S6A, S6A_AUTH_INFO_ANS);
s6a_auth_info_ans_p = &message_p->msg.s6a_auth_info_ans;
S6A_DEBUG("Received S6A Authentication Information Answer (AIA)\n");
......@@ -257,7 +257,7 @@ int s6a_aia_cb(struct msg **msg, struct avp *paramavp,
DevMessage("We requested E-UTRAN vectors with an immediate response...\n");
}
send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
err:
return 0;
}
......
......@@ -67,7 +67,7 @@ static void fd_gnutls_debug(int level, const char *str)
void *s6a_thread(void *args)
{
intertask_interface_mark_task_ready(TASK_S6A);
itti_mark_task_ready(TASK_S6A);
while(1) {
MessageDef *received_message_p = NULL;
......@@ -75,7 +75,7 @@ void *s6a_thread(void *args)
* If the queue is empty, this function will block till a
* message is sent to the task.
*/
receive_msg(TASK_S6A, &received_message_p);
itti_receive_msg(TASK_S6A, &received_message_p);
DevAssert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
case S6A_UPDATE_LOCATION_REQ: {
......@@ -86,7 +86,7 @@ void *s6a_thread(void *args)
} break;
default: {
S6A_DEBUG("Unkwnon message ID %s:%d\n",
get_message_name(received_message_p->header.messageId),
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
} break;
}
......@@ -156,7 +156,7 @@ int s6a_init(const mme_config_t *mme_config_p)
/* Trying to connect to peers */
CHECK_FCT(s6a_fd_new_peer());
if (intertask_interface_create_task(TASK_S6A, &s6a_thread, NULL) < 0) {
if (itti_create_task(TASK_S6A, &s6a_thread, NULL) < 0) {
S6A_ERROR("s6a create task\n");
return -1;
}
......
......@@ -60,7 +60,7 @@ int s6a_ula_cb(struct msg **msg, struct avp *paramavp,
DevAssert(qry != NULL);
message_p = alloc_new_message(TASK_S6A, S6A_UPDATE_LOCATION_ANS);
message_p = itti_alloc_new_message(TASK_S6A, S6A_UPDATE_LOCATION_ANS);
s6a_update_location_ans_p = &message_p->msg.s6a_update_location_ans;
......@@ -152,7 +152,7 @@ err:
ans = NULL;
send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
S6A_DEBUG("Sending S6A_UPDATE_LOCATION_ANS to task MME_APP\n");
......
......@@ -10,7 +10,7 @@ int sctp_itti_send_new_association(uint32_t assoc_id, uint16_t instreams,
MessageDef *message_p;
sctp_new_peer_t *sctp_new_peer_p;
message_p = alloc_new_message(TASK_SCTP, SCTP_NEW_ASSOCIATION);
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_NEW_ASSOCIATION);
sctp_new_peer_p = &message_p->msg.sctp_new_peer;
......@@ -18,7 +18,7 @@ int sctp_itti_send_new_association(uint32_t assoc_id, uint16_t instreams,
sctp_new_peer_p->instreams = instreams;
sctp_new_peer_p->outstreams = outstreams;
return send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, message_p);
}
int sctp_itti_send_new_message_ind(int n, uint8_t *buffer, uint32_t assoc_id,
......@@ -28,7 +28,7 @@ int sctp_itti_send_new_message_ind(int n, uint8_t *buffer, uint32_t assoc_id,
MessageDef *message_p;
s1ap_sctp_new_msg_ind_t *sctp_new_msg_ind_p;
message_p = alloc_new_message(TASK_SCTP, S1AP_SCTP_NEW_MESSAGE_IND);
message_p = itti_alloc_new_message(TASK_SCTP, S1AP_SCTP_NEW_MESSAGE_IND);
sctp_new_msg_ind_p = &message_p->msg.s1ap_sctp_new_msg_ind;
......@@ -42,7 +42,7 @@ int sctp_itti_send_new_message_ind(int n, uint8_t *buffer, uint32_t assoc_id,
sctp_new_msg_ind_p->instreams = instreams;
sctp_new_msg_ind_p->outstreams = outstreams;
return send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, message_p);
}
int sctp_itti_send_com_down_ind(uint32_t assoc_id)
......@@ -50,11 +50,11 @@ int sctp_itti_send_com_down_ind(uint32_t assoc_id)
MessageDef *message_p;
sctp_close_association_t *sctp_close_association_p;
message_p = alloc_new_message(TASK_SCTP, SCTP_CLOSE_ASSOCIATION);
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_CLOSE_ASSOCIATION);
sctp_close_association_p = &message_p->msg.sctp_close_association;
sctp_close_association_p->assoc_id = assoc_id;
return send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, message_p);
}
......@@ -583,11 +583,11 @@ void *sctp_receiver_thread(void *args_p)
static void *sctp_intertask_interface(void *args_p)
{
intertask_interface_mark_task_ready(TASK_SCTP);
itti_mark_task_ready(TASK_SCTP);
while(1) {
MessageDef *received_message_p;
receive_msg(TASK_SCTP, &received_message_p);
itti_receive_msg(TASK_SCTP, &received_message_p);
switch(received_message_p->header.messageId) {
case SCTP_INIT_MSG: {
SCTP_DEBUG("Received SCTP_INIT_MSG\n");
......@@ -616,7 +616,7 @@ static void *sctp_intertask_interface(void *args_p)
} break;
default: {
SCTP_DEBUG("Unkwnon message ID %s:%d\n",
get_message_name(received_message_p->header.messageId),
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
} break;
}
......@@ -636,7 +636,7 @@ int sctp_init(const mme_config_t *mme_config_p)
sctp_desc.nb_instreams = mme_config_p->sctp_config.in_streams;
sctp_desc.nb_outstreams = mme_config_p->sctp_config.out_streams;
if (intertask_interface_create_task(TASK_SCTP, &sctp_intertask_interface,
if (itti_create_task(TASK_SCTP, &sctp_intertask_interface,
NULL) < 0) {
SCTP_ERROR("create task failed");
SCTP_DEBUG("Initializing SCTP task interface: FAILED\n");
......
AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/UTILS \
-I$(top_srcdir)/INTERTASK_INTERFACE \
-I$(top_srcdir)/COMMON
noinst_LTLIBRARIES = libsecu.la
......
......@@ -146,7 +146,7 @@ void sgi_process_raw_packet(sgi_data_t *sgi_data_pP, unsigned char* data_pP, int
return;
}
message_p = alloc_new_message(TASK_FW_IP, GTPV1U_TUNNEL_DATA_REQ);
message_p = itti_alloc_new_message(TASK_FW_IP, GTPV1U_TUNNEL_DATA_REQ);
if (message_p == NULL) {
SGI_IF_ERROR("%s OUT OF MEMORY DROP EGRESS PACKET\n", __FUNCTION__);
return;
......@@ -167,7 +167,7 @@ void sgi_process_raw_packet(sgi_data_t *sgi_data_pP, unsigned char* data_pP, int
gtpv1u_tunnel_data_req_p->buffer = message_payload_p;
SGI_IF_DEBUG("%s send GTPV1U_TUNNEL_DATA_REQ to GTPV1U S1u_enb_teid %u local_S1u_teid %u size %u\n", __FUNCTION__, gtpv1u_tunnel_data_req_p->S1u_enb_teid, gtpv1u_tunnel_data_req_p->local_S1u_teid, packet_sizeP);
send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
}
#else
......@@ -279,7 +279,7 @@ void sgi_process_raw_packet(sgi_data_t *sgi_data_pP, unsigned char* data_pP, int
return;
}
message_p = alloc_new_message(TASK_FW_IP, GTPV1U_TUNNEL_DATA_REQ);
message_p = itti_alloc_new_message(TASK_FW_IP, GTPV1U_TUNNEL_DATA_REQ);
if (message_p == NULL) {
SGI_IF_ERROR("%s OUT OF MEMORY DROP EGRESS PACKET\n", __FUNCTION__);
return;
......@@ -300,7 +300,7 @@ void sgi_process_raw_packet(sgi_data_t *sgi_data_pP, unsigned char* data_pP, int
gtpv1u_tunnel_data_req_p->buffer = message_payload_p;
SGI_IF_DEBUG("%s send GTPV1U_TUNNEL_DATA_REQ to GTPV1U S1u_enb_teid %u local_S1u_teid %u size %u\n", __FUNCTION__, gtpv1u_tunnel_data_req_p->S1u_enb_teid, gtpv1u_tunnel_data_req_p->local_S1u_teid, packet_sizeP);
send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
}
#endif
......
......@@ -211,7 +211,7 @@ static int sgi_nfqueue_callback(struct nfq_q_handle *myQueue, struct nfgenmsg *m
//sgi_print_hex_octets((unsigned char *)pktData, len);
message_p = alloc_new_message(TASK_FW_IP, GTPV1U_TUNNEL_DATA_REQ);
message_p = itti_alloc_new_message(TASK_FW_IP, GTPV1U_TUNNEL_DATA_REQ);
if (message_p == NULL) {
return -1;
}
......@@ -233,7 +233,7 @@ static int sgi_nfqueue_callback(struct nfq_q_handle *myQueue, struct nfgenmsg *m
memcpy(data_req_p->buffer, pktData, len);
data_req_p->length = len;
if (send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p) < 0) {
if (itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p) < 0) {
SGI_IF_ERROR("Failed to send message to task\n");
free(message_p);
}
......
......@@ -61,7 +61,7 @@ static void* sgi_task_thread(void *args_p)
return NULL;
}
intertask_interface_mark_task_ready(TASK_FW_IP);
itti_mark_task_ready(TASK_FW_IP);
sgi_data_p = (sgi_data_t *)args_p;
......@@ -72,7 +72,7 @@ static void* sgi_task_thread(void *args_p)
* message is sent to the task.
*/
MessageDef *received_message_p;
receive_msg(TASK_FW_IP, &received_message_p);
itti_receive_msg(TASK_FW_IP, &received_message_p);
assert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
case GTPV1U_TUNNEL_DATA_IND: {
......@@ -126,7 +126,7 @@ static int sgi_create_endpoint_request(sgi_data_t *sgi_dataP, SGICreateEndpointR
SGI_IF_DEBUG("Rx IP_FW_CREATE_SGI_ENDPOINT_REQUEST, Context: S-GW S11 teid %u, S-GW S1U teid %u EPS bearer id %u\n",
req_p->context_teid, req_p->sgw_S1u_teid, req_p->eps_bearer_id);
message_p = alloc_new_message(TASK_FW_IP, SGI_CREATE_ENDPOINT_RESPONSE);
message_p = itti_alloc_new_message(TASK_FW_IP, SGI_CREATE_ENDPOINT_RESPONSE);
if (message_p == NULL) {
return -1;
}
......@@ -161,7 +161,7 @@ static int sgi_create_endpoint_request(sgi_data_t *sgi_dataP, SGICreateEndpointR
}
}
}
return send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
//------------------------------------------------------
......@@ -175,7 +175,7 @@ static int sgi_update_endpoint_request(sgi_data_t *sgi_dataP, SGIUpdateEndpointR
SGI_IF_DEBUG("Rx IP_FW_UPDATE_SGI_ENDPOINT_REQUEST, Context: S-GW S11 teid %u, S-GW S1U teid %u EPS bearer id %u\n",
req_p->context_teid, req_p->sgw_S1u_teid, req_p->eps_bearer_id);
message_p = alloc_new_message(TASK_FW_IP, SGI_UPDATE_ENDPOINT_RESPONSE);
message_p = itti_alloc_new_message(TASK_FW_IP, SGI_UPDATE_ENDPOINT_RESPONSE);
if (message_p == NULL) {
return -1;
}
......@@ -193,7 +193,7 @@ static int sgi_update_endpoint_request(sgi_data_t *sgi_dataP, SGIUpdateEndpointR
SGI_IF_ERROR("SGI_STATUS_ERROR_CONTEXT_NOT_FOUND Context: S11 teid %u\n", req_p->context_teid);
sgi_update_endpoint_resp_p->status = SGI_STATUS_ERROR_CONTEXT_NOT_FOUND;
}
return send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
//-----------------------------------------------------------------------------
......
This diff is collapsed.
......@@ -45,10 +45,10 @@ sgw_app_t sgw_app;
static void *sgw_lite_intertask_interface(void *args_p)
{
intertask_interface_mark_task_ready(TASK_SPGW_APP);
itti_mark_task_ready(TASK_SPGW_APP);
while(1) {
MessageDef *received_message_p;
receive_msg(TASK_SPGW_APP, &received_message_p);
itti_receive_msg(TASK_SPGW_APP, &received_message_p);
switch(received_message_p->header.messageId) {
case SGW_CREATE_SESSION_REQUEST: {
/* We received a create session request from MME (with GTP abstraction here)
......@@ -89,7 +89,7 @@ static void *sgw_lite_intertask_interface(void *args_p)
default: {
SPGW_APP_DEBUG("Unkwnon message ID %s:%d\n",
get_message_name(received_message_p->header.messageId),
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
} break;
}
......@@ -102,7 +102,7 @@ static void *sgw_lite_intertask_interface(void *args_p)
int sgw_lite_init(const mme_config_t *mme_config_p)
{
SPGW_APP_DEBUG("Initializing SPGW-APP task interface\n");
if (intertask_interface_create_task(TASK_SPGW_APP,
if (itti_create_task(TASK_SPGW_APP,
&sgw_lite_intertask_interface, NULL) < 0) {
perror("pthread_create");
SPGW_APP_DEBUG("Initializing SPGW-APP task interface: ERROR\n");
......
......@@ -78,7 +78,7 @@ int main(int argc, char *argv[])
/* Calling each layer init function */
log_init(&mme_config);
intertask_interface_init(THREAD_MAX, MESSAGES_ID_MAX, threads_name, messages_info, messages_definition_xml);
itti_init(THREAD_MAX, MESSAGES_ID_MAX, threads_name, messages_info, messages_definition_xml);
sctp_init(&mme_config);
udp_init(&mme_config);
s1ap_mme_init(&mme_config);
......@@ -87,7 +87,7 @@ int main(int argc, char *argv[])
sgw_lite_init(&mme_config);
message_p = alloc_new_message(TASK_S1AP, MESSAGE_TEST);
message_p = itti_alloc_new_message(TASK_S1AP, MESSAGE_TEST);
while(i < (1 << 15)) {
if (send_broadcast_message(message_p) < 0) {
......
......@@ -164,7 +164,7 @@ void *udp_receiver_thread(void *arg_p)
memcpy(forwarded_buffer, buffer, n);
message_p = alloc_new_message(TASK_UDP, UDP_DATA_IND);
message_p = itti_alloc_new_message(TASK_UDP, UDP_DATA_IND);
DevAssert(message_p != NULL);
......@@ -177,7 +177,7 @@ void *udp_receiver_thread(void *arg_p)
UDP_DEBUG("Msg of length %d received from %s:%u\n",
n, inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
if (send_msg_to_task(udp_sock_p->task_id, INSTANCE_DEFAULT, message_p) < 0) {
if (itti_send_msg_to_task(udp_sock_p->task_id, INSTANCE_DEFAULT, message_p) < 0) {
UDP_DEBUG("Failed to send message %d to task %d\n",
UDP_DATA_IND, udp_sock_p->task_id);
break;
......@@ -196,10 +196,10 @@ void *udp_receiver_thread(void *arg_p)
static void *udp_intertask_interface(void *args_p)
{
intertask_interface_mark_task_ready(TASK_UDP);
itti_mark_task_ready(TASK_UDP);
while(1) {
MessageDef *received_message_p = NULL;
receive_msg(TASK_UDP, &received_message_p);
itti_receive_msg(TASK_UDP, &received_message_p);
DevAssert(received_message_p != NULL);
switch (received_message_p->header.messageId) {
......@@ -259,7 +259,7 @@ static void *udp_intertask_interface(void *args_p)
} break;
default: {
UDP_DEBUG("Unkwnon message ID %s:%d\n",
get_message_name(received_message_p->header.messageId),
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
} break;
}
......@@ -276,7 +276,7 @@ int udp_init(const mme_config_t *mme_config_p)
STAILQ_INIT(&udp_socket_list);
if (intertask_interface_create_task(TASK_UDP, &udp_intertask_interface,
if (itti_create_task(TASK_UDP, &udp_intertask_interface,
NULL) < 0) {
UDP_ERROR("udp pthread_create (%s)\n", strerror(errno));
return -1;
......
......@@ -9,13 +9,10 @@ AM_YFLAGS = -d
noinst_LTLIBRARIES = libutils.la
libutils_la_LDFLAGS = -all-static
libutils_la_SOURCES = \
assertions.h \
backtrace.c backtrace.h \
conversions.h conversions.c \
enum_string.h enum_string.c \
log.c log.h \
mme_parser.y mme_scanner.l \
mme_config.c mme_config.h \
mme_default_values.h \
queue.h tree.h \
signals.c signals.h
queue.h tree.h
......@@ -43,7 +43,7 @@
******************************************************************************/
#define ITTI_QUEUE_SIZE_PER_TASK (5 * 1024 * 1024) /* Limit the queue size to 5M */
#define ITTI_PORT (10007)
#define ITTI_PORT (10006)
/* This is the queue size for signal dumper */
#define ITTI_QUEUE_SIZE_MAX (1 * 1024 * 1024) /* 1 MBytes */
#define ITTI_DUMP_MAX_CON (5) /* Max connections in parallel */
......
......@@ -73,7 +73,7 @@ static int s1ap_send_init_sctp(void) {
message_p->msg.sctpS1APInit.ppid = S1AP_SCTP_PPID;
message_p->msg.sctpS1APInit.address = "0.0.0.0"; //ANY address
return send_msg_to_task(TASK_SCTP, message_p);
return itti_send_msg_to_task(TASK_SCTP, message_p);
}
void* s1ap_mme_thread(void *args) {
......@@ -82,7 +82,7 @@ void* s1ap_mme_thread(void *args) {
* If the queue is empty, this function will block till a
* message is sent to the task.
*/
receive_msg(TASK_S1AP, &receivedMessage);
itti_receive_msg(TASK_S1AP, &receivedMessage);
assert(receivedMessage != NULL);
switch(receivedMessage->messageId) {
case S1AP_SCTP_NEW_MESSAGE_IND:
......
......@@ -72,7 +72,7 @@ int s1ap_mme_encode_s1setupresponse(S1SetupResponseIEs_t *s1SetupResponseIEs, ui
return -1;
}
return send_msg_to_task(TASK_SCTP, message_p);
return itti_send_msg_to_task(TASK_SCTP, message_p);
}
int s1ap_mme_encode_s1setupfailure(S1SetupFailureIEs_t *s1SetupFailureIEs, uint32_t assocId) {
......@@ -105,7 +105,7 @@ int s1ap_mme_encode_s1setupfailure(S1SetupFailureIEs_t *s1SetupFailureIEs, uint3
return -1;
}
return send_msg_to_task(TASK_SCTP, message_p);
return itti_send_msg_to_task(TASK_SCTP, message_p);
}
int s1ap_mme_encode_initial_context_setup_request(InitialContextSetupRequestIEs_t *initialContextSetupRequestIEs,
......@@ -139,7 +139,7 @@ int s1ap_mme_encode_initial_context_setup_request(InitialContextSetupRequestIEs_
return -1;
}
return send_msg_to_task(TASK_SCTP, message_p);
return itti_send_msg_to_task(TASK_SCTP, message_p);
}
int s1ap_mme_encode_downlink_nas_transport(DownlinkNASTransportIEs_t *downlinkNasTransportIEs,
......@@ -174,7 +174,7 @@ int s1ap_mme_encode_downlink_nas_transport(DownlinkNASTransportIEs_t *downlinkNa
return -1;
}
return send_msg_to_task(TASK_SCTP, message_p);
return itti_send_msg_to_task(TASK_SCTP, message_p);
}
int s1ap_mme_encode_ue_context_release_command(UEContextReleaseCommandIEs_t *ueContextReleaseCommandIEs,
......@@ -206,7 +206,7 @@ int s1ap_mme_encode_ue_context_release_command(UEContextReleaseCommandIEs_t *ueC
ueContextReleaseCommand_p) < 0)
goto error;
return send_msg_to_task(TASK_SCTP, message_p);
return itti_send_msg_to_task(TASK_SCTP, message_p);
error:
free(message_p);
return -1;
......
......@@ -350,7 +350,7 @@ int s1ap_mme_handle_initial_ue_message(uint32_t assocId, uint32_t stream, struct
MessageDef *message_p;
SgwCreateSessionRequest *session_request_p;
message_p = alloc_new_message(TASK_S1AP, TASK_SGW_LITE, SGW_CREATE_SESSION_REQUEST);
message_p = itti_alloc_new_message(TASK_S1AP, TASK_SGW_LITE, SGW_CREATE_SESSION_REQUEST);
if (message_p == NULL) return -1;
/* WARNING:
......@@ -400,7 +400,7 @@ int s1ap_mme_handle_initial_ue_message(uint32_t assocId, uint32_t stream, struct
session_request_p->paa.ipv4_address = 0x00000000;
session_request_p->selection_mode = MS_O_N_P_APN_S_V;
return send_msg_to_task(TASK_SGW_LITE, message_p);
return itti_send_msg_to_task(TASK_SGW_LITE, message_p);
}
}
return 0;
......@@ -485,7 +485,7 @@ int s1ap_mme_handle_initial_context_setup_response(
ue_ref->s1_ue_state = S1AP_UE_CONNECTED;
message_p = alloc_new_message(TASK_SGW_LITE, TASK_S1AP, SGW_MODIFY_BEARER_REQUEST);
message_p = itti_alloc_new_message(TASK_SGW_LITE, TASK_S1AP, SGW_MODIFY_BEARER_REQUEST);
if (message_p == NULL) {
return -1;
......@@ -500,7 +500,7 @@ int s1ap_mme_handle_initial_context_setup_response(
modify_request_p->bearer_context_to_modify.s1_eNB_fteid.ipv4 = 1;
memcpy(&modify_request_p->bearer_context_to_modify.s1_eNB_fteid.ipv4_address, eRABSetupItemCtxtSURes_p->transportLayerAddress.buf, 4);
return send_msg_to_task(TASK_SGW_LITE, message_p);
return itti_send_msg_to_task(TASK_SGW_LITE, message_p);
}
int s1ap_mme_handle_ue_context_release_request(uint32_t assocId, uint32_t stream, struct s1ap_message_s *message) {
......
......@@ -34,7 +34,7 @@ CFLAGS += -DOPENAIR_LTE -DPUCCH #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
CFLAGS += -DMAC_CONTEXT=1 -DPHY_CONTEXT=1 -DPHY_ABSTRACTION #-DPHY_ABSTRACTION_UL #-DRLC_UM_TEST_TRAFFIC=1
CFLAGS += -DNEW_FFT
#CFLAGS += -DLLR8
CFLAGS += -DPACKAGE_NAME='"oaisim"'
ifndef OPENAIR2
OPENAIR2=1
endif
......
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