Commit e1d26674 authored by Cedric Roux's avatar Cedric Roux

- Renamed msg structure in ITTI to ittiMsg to avoid confusions when parsing...

- Renamed msg structure in ITTI to ittiMsg to avoid confusions when parsing XML file if multiple structure "msg" are defined
- Fix build issue of EPC
- Enable event fd for EPC instead of pthread_cond
- Added some new S1AP messages defintions


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4506 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 5697a935
AM_CFLAGS = @ADD_CFLAGS@ \
-I$(top_srcdir)/UTILS \
-I$(top_srcdir)/COMMON
-I$(top_srcdir)/UTILS \
-I$(top_srcdir)/COMMON \
-I$(OPENAIR2_DIR)/UTIL/LFDS/liblfds6.1.1/liblfds611/inc \
-DENABLE_EVENT_FD
noinst_LTLIBRARIES = libitti.la
$(abs_builddir)/UTIL/LFDS/liblfds6.1.1/liblfds611/bin/liblfds611.a:
@if [ ! -d $(abs_builddir)/UTIL/LFDS/liblfds6.1.1/liblfds611/bin ]; then mkdir -p $(abs_builddir)/UTIL/LFDS/liblfds6.1.1/liblfds611/bin; fi;
@if [ ! -d $(abs_builddir)/UTIL/LFDS/liblfds6.1.1/liblfds611/obj ]; then mkdir -p $(abs_builddir)/UTIL/LFDS/liblfds6.1.1/liblfds611/obj; fi;
@$(MAKE) -C $(OPENAIR2_DIR)/UTIL/LFDS/liblfds6.1.1/liblfds611/ -f makefile.linux OUTDIR=$(abs_builddir)/UTIL/LFDS/liblfds6.1.1/liblfds611
libitti_la_LDFLAGS = -all-static
libitti_la_SOURCES = \
libitti_la_SOURCES = \
gtpv1_u_messages_def.h gtpv1_u_messages_types.h \
nas_messages_def.h nas_messages_types.h \
nas_messages_def.h nas_messages_types.h \
timer_messages_def.h timer_messages_types.h \
s11_messages_def.h s11_messages_types.h \
s1ap_messages_def.h s1ap_messages_types.h \
s6a_messages_def.h s6a_messages_types.h \
sgw_lite_def.h sgw_lite_messages_types.h \
sctp_messages_def.h sctp_messages_types.h \
udp_message_def.h udp_messages_types.h \
s11_messages_def.h s11_messages_types.h \
s1ap_messages_def.h s1ap_messages_types.h \
s6a_messages_def.h s6a_messages_types.h \
sgw_lite_def.h sgw_lite_messages_types.h \
sctp_messages_def.h sctp_messages_types.h \
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
intertask_interface_dump.c intertask_interface_dump.h \
assertions.h \
backtrace.c backtrace.h \
signals.c signals.h \
timer.c timer.h
......@@ -255,6 +255,7 @@ static int itti_enqueue_message(itti_queue_item_t *new, uint32_t message_size,
fwrite (&new->message_number, sizeof(new->message_number), 1, dump_file);
fwrite (new->message_name, sizeof(new->message_name), 1, dump_file);
fwrite (new->data, new->data_size, 1, dump_file);
fflush (dump_file);
}
/* Release the mutex */
......
......@@ -151,7 +151,7 @@ typedef struct MessageHeader_s
typedef struct MessageDef_s
{
MessageHeader ittiMsgHeader; /**< Message header */
msg_t msg; /**< Union of payloads as defined in x_messages_def.h headers */
msg_t ittiMsg; /**< Union of payloads as defined in x_messages_def.h headers */
} MessageDef;
#endif /* INTERTASK_INTERFACE_TYPES_H_ */
......
......@@ -95,7 +95,7 @@ int timer_handle_signal(siginfo_t *info)
instance = timer_p->instance;
message_p = itti_alloc_new_message(TASK_TIMER, TIMER_HAS_EXPIRED);
timer_expired_p = &message_p->msg.timer_has_expired;
timer_expired_p = &message_p->ittiMsg.timer_has_expired;
timer_expired_p->timer_id = (long)timer_p->timer;
timer_expired_p->arg = timer_p->timer_arg;
......
......@@ -780,7 +780,7 @@ static int xml_parse_doc(xmlDocPtr doc) {
/* Locate the header part of a message */
CHECK_FCT(locate_type("ittiMsgHeader", head, &message_header_type));
/* Locate the main message part */
CHECK_FCT(locate_type("msg", head, &message_type));
CHECK_FCT(locate_type("ittiMsg", head, &message_type));
/* Locate the origin task id field */
CHECK_FCT(locate_type("originTaskId", message_header_type, &origin_task_id_type));
......
#ifndef UDP_MESSAGES_TYPES_H_
#define UDP_MESSAGES_TYPES_H_
#define UDP_INIT(mSGpTR) (mSGpTR)->ittiMsg.udp_init
typedef struct {
uint32_t port;
char *address;
......
......@@ -82,12 +82,12 @@ static int gtpv1u_send_init_udp(uint16_t port_number)
return -1;
}
message_p->msg.udp_init.port = port_number;
//LG message_p->msg.udp_init.address = "0.0.0.0"; //ANY address
UDP_INIT(message_p).port = port_number;
//LG UDP_INIT(message_p).address = "0.0.0.0"; //ANY address
addr.s_addr = gtpv1u_sgw_data.sgw_ip_address_for_S1u_S12_S4_up;
message_p->msg.udp_init.address = inet_ntoa(addr);
GTPU_DEBUG("Tx UDP_INIT IP addr %s\n", message_p->msg.udp_init.address);
UDP_INIT(message_p).address = inet_ntoa(addr);
GTPU_DEBUG("Tx UDP_INIT IP addr %s\n", UDP_INIT(message_p).address);
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
}
......@@ -115,7 +115,7 @@ NwGtpv1uRcT gtpv1u_send_udp_msg(
message_p = itti_alloc_new_message(TASK_GTPV1_U, UDP_DATA_REQ);
udp_data_req_p = &message_p->msg.udp_data_req;
udp_data_req_p = &message_p->ittiMsg.udp_data_req;
udp_data_req_p->peer_address = peerIpAddr;
udp_data_req_p->peer_port = peerPort;
......@@ -154,7 +154,7 @@ NwGtpv1uRcT gtpv1u_process_stack_req(
if (message_p == NULL) {
return -1;
}
data_ind_p = &message_p->msg.gtpv1uTunnelDataInd;
data_ind_p = &message_p->ittiMsg.gtpv1uTunnelDataInd;
data_ind_p->buffer = malloc(sizeof(uint8_t) * buffer_len);
data_ind_p->local_S1u_teid = pUlpApi->apiInfo.recvMsgInfo.teid;
if (data_ind_p->buffer == NULL) {
......@@ -224,24 +224,24 @@ static int gtpv1u_create_s1u_tunnel(Gtpv1uCreateTunnelReq *create_tunnel_reqP)
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;
message_p->ittiMsg.gtpv1uCreateTunnelResp.S1u_teid = s1u_teid;
message_p->ittiMsg.gtpv1uCreateTunnelResp.context_teid = create_tunnel_reqP->context_teid;
message_p->ittiMsg.gtpv1uCreateTunnelResp.eps_bearer_id = create_tunnel_reqP->eps_bearer_id;
hash_rc = hashtbl_is_key_exists(gtpv1u_sgw_data.S1U_mapping, s1u_teid);
if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) {
hash_rc = hashtbl_insert(gtpv1u_sgw_data.S1U_mapping, s1u_teid, gtpv1u_teid2enb_info);
message_p->msg.gtpv1uCreateTunnelResp.status = 0;
message_p->ittiMsg.gtpv1uCreateTunnelResp.status = 0;
} else {
message_p->msg.gtpv1uCreateTunnelResp.status = 0xFF;
message_p->ittiMsg.gtpv1uCreateTunnelResp.status = 0xFF;
}
GTPU_DEBUG("Tx GTPV1U_CREATE_TUNNEL_RESP Context %u teid %u eps bearer id %u status %d\n",
message_p->msg.gtpv1uCreateTunnelResp.context_teid,
message_p->msg.gtpv1uCreateTunnelResp.S1u_teid,
message_p->msg.gtpv1uCreateTunnelResp.eps_bearer_id,
message_p->msg.gtpv1uCreateTunnelResp.status);
message_p->ittiMsg.gtpv1uCreateTunnelResp.context_teid,
message_p->ittiMsg.gtpv1uCreateTunnelResp.S1u_teid,
message_p->ittiMsg.gtpv1uCreateTunnelResp.eps_bearer_id,
message_p->ittiMsg.gtpv1uCreateTunnelResp.status);
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
......@@ -255,15 +255,15 @@ static int gtpv1u_delete_s1u_tunnel(Teid_t context_teidP, Teid_t S1U_teidP)
GTPU_DEBUG("Rx GTPV1U_DELETE_TUNNEL Context %u S1U teid %u\n", context_teidP, S1U_teidP);
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;
message_p->ittiMsg.gtpv1uDeleteTunnelResp.S1u_teid = S1U_teidP;
message_p->ittiMsg.gtpv1uDeleteTunnelResp.context_teid = context_teidP;
if (hashtbl_remove(gtpv1u_sgw_data.S1U_mapping, S1U_teidP) == HASH_TABLE_OK ) {
message_p->msg.gtpv1uDeleteTunnelResp.status = 0;
message_p->ittiMsg.gtpv1uDeleteTunnelResp.status = 0;
} else {
message_p->msg.gtpv1uDeleteTunnelResp.status = -1;
message_p->ittiMsg.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);
GTPU_DEBUG("Tx SGW_S1U_ENDPOINT_CREATED Context %u teid %u status %d\n", context_teidP, S1U_teidP, message_p->ittiMsg.gtpv1uDeleteTunnelResp.status);
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
......@@ -287,15 +287,15 @@ static int gtpv1u_update_s1u_tunnel(Gtpv1uUpdateTunnelReq *reqP)
gtpv1u_teid2enb_info->enb_ip_addr = reqP->enb_ip_address_for_S1u;
gtpv1u_teid2enb_info->state = BEARER_UP;
gtpv1u_teid2enb_info->port = GTPV1U_UDP_PORT;
message_p->msg.gtpv1uUpdateTunnelResp.status = 0; ///< Status (Failed = 0xFF or Success = 0x0)
message_p->ittiMsg.gtpv1uUpdateTunnelResp.status = 0; ///< Status (Failed = 0xFF or Success = 0x0)
} else {
GTPU_ERROR("Mapping not found\n");
message_p->msg.gtpv1uUpdateTunnelResp.status = 0xFF; ///< Status (Failed = 0xFF or Success = 0x0)
message_p->ittiMsg.gtpv1uUpdateTunnelResp.status = 0xFF; ///< Status (Failed = 0xFF or Success = 0x0)
}
message_p->msg.gtpv1uUpdateTunnelResp.context_teid = reqP->context_teid;
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;
message_p->ittiMsg.gtpv1uUpdateTunnelResp.context_teid = reqP->context_teid;
message_p->ittiMsg.gtpv1uUpdateTunnelResp.sgw_S1u_teid = reqP->sgw_S1u_teid;
message_p->ittiMsg.gtpv1uUpdateTunnelResp.enb_S1u_teid = reqP->enb_S1u_teid;
message_p->ittiMsg.gtpv1uUpdateTunnelResp.eps_bearer_id = reqP->eps_bearer_id;
return itti_send_msg_to_task(TASK_SPGW_APP, INSTANCE_DEFAULT, message_p);
}
......@@ -358,24 +358,24 @@ static void *gtpv1u_thread(void *args)
switch (ITTI_MSG_ID(received_message_p))
{
case GTPV1U_CREATE_TUNNEL_REQ: {
gtpv1u_create_s1u_tunnel(&received_message_p->msg.gtpv1uCreateTunnelReq);
gtpv1u_create_s1u_tunnel(&received_message_p->ittiMsg.gtpv1uCreateTunnelReq);
}
break;
case GTPV1U_DELETE_TUNNEL_REQ: {
gtpv1u_delete_s1u_tunnel(received_message_p->msg.gtpv1uDeleteTunnelReq.context_teid, received_message_p->msg.gtpv1uDeleteTunnelReq.S1u_teid);
gtpv1u_delete_s1u_tunnel(received_message_p->ittiMsg.gtpv1uDeleteTunnelReq.context_teid, received_message_p->ittiMsg.gtpv1uDeleteTunnelReq.S1u_teid);
}
break;
case GTPV1U_UPDATE_TUNNEL_REQ: {
gtpv1u_update_s1u_tunnel(&received_message_p->msg.gtpv1uUpdateTunnelReq);
gtpv1u_update_s1u_tunnel(&received_message_p->ittiMsg.gtpv1uUpdateTunnelReq);
}
break;
// DATA COMING FROM UDP
case UDP_DATA_IND: {
udp_data_ind_t *udp_data_ind_p;
udp_data_ind_p = &received_message_p->msg.udp_data_ind;
udp_data_ind_p = &received_message_p->ittiMsg.udp_data_ind;
nwGtpv1uProcessUdpReq(gtpv1u_sgw_data.gtpv1u_stack,
udp_data_ind_p->buffer,
udp_data_ind_p->buffer_length,
......@@ -393,7 +393,7 @@ static void *gtpv1u_thread(void *args)
hashtbl_rc_t hash_rc;
gtpv1u_teid2enb_info_t *gtpv1u_teid2enb_info;
data_req_p = &received_message_p->msg.gtpv1uTunnelDataReq;
data_req_p = &received_message_p->ittiMsg.gtpv1uTunnelDataReq;
//ipv4_send_data(ipv4_data_p->sd, data_ind_p->buffer, data_ind_p->length);
memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT));
......@@ -450,7 +450,7 @@ static void *gtpv1u_thread(void *args)
}
break;
case TIMER_HAS_EXPIRED:
nwGtpv1uProcessTimeout(&received_message_p->msg.timer_has_expired.arg);
nwGtpv1uProcessTimeout(&received_message_p->ittiMsg.timer_has_expired.arg);
break;
default: {
GTPU_ERROR("Unkwnon message ID %d:%s\n",
......
......@@ -58,7 +58,7 @@ int mme_app_request_authentication_info(const mme_app_imsi_t imsi,
if (message_p == NULL) return -1;
auth_info_req = &message_p->msg.s6a_auth_info_req;
auth_info_req = &message_p->ittiMsg.s6a_auth_info_req;
MME_APP_IMSI_TO_STRING(imsi, auth_info_req->imsi);
memcpy(&auth_info_req->visited_plmn, plmn, sizeof(plmn_t));
auth_info_req->nb_of_vectors = nb_of_vectors;
......@@ -98,7 +98,7 @@ int mme_app_handle_nas_auth_resp(nas_auth_resp_t *nas_auth_resp_p)
return -1;
}
s6a_ulr = &message_p->msg.s6a_update_location_req;
s6a_ulr = &message_p->ittiMsg.s6a_update_location_req;
memcpy(s6a_ulr->imsi, nas_auth_resp_p->imsi, 16);
s6a_ulr->initial_attach = INITIAL_ATTACH;
......@@ -127,7 +127,7 @@ int mme_app_handle_authentication_info_answer(s6a_auth_info_ans_t *s6a_auth_info
return -1;
}
nas_auth_req_p = &message_p->msg.nas_auth_req;
nas_auth_req_p = &message_p->ittiMsg.nas_auth_req;
MME_APP_STRING_TO_IMSI((char *)s6a_auth_info_ans_p->imsi, &imsi);
......@@ -272,7 +272,7 @@ request_auth:
" authentication from NAS\n");
message_p = itti_alloc_new_message(TASK_MME_APP, NAS_AUTHENTICATION_REQ);
nas_auth_req_p = &message_p->msg.nas_auth_req;
nas_auth_req_p = &message_p->ittiMsg.nas_auth_req;
MME_APP_IMSI_TO_STRING(imsi, nas_auth_req_p->imsi);
nas_auth_req_p->failure = NAS_FAILURE_OK;
......
......@@ -132,7 +132,7 @@ int mme_app_create_bearer(s6a_update_location_ans_t *ula_p)
* Set these parameters with random values for now.
*/
session_request_p = &message_p->msg.sgwCreateSessionRequest;
session_request_p = &message_p->ittiMsg.sgwCreateSessionRequest;
memset(session_request_p, 0, sizeof(SgwCreateSessionRequest));
/* As the create session request is the first exchanged message and as
......@@ -320,7 +320,7 @@ int mme_app_handle_create_sess_resp(SgwCreateSessionResponse *create_sess_resp_p
message_p = itti_alloc_new_message(TASK_MME_APP, NAS_ATTACH_ACCEPT);
attach_accept_p = &message_p->msg.nas_attach_accept;
attach_accept_p = &message_p->ittiMsg.nas_attach_accept;
derive_keNB(ue_context_p->vector_in_use->kasme, 156, &keNB);
memcpy(attach_accept_p->transparent.keNB, keNB, 32);
......
......@@ -66,24 +66,24 @@ void *mme_app_thread(void *args)
/* We received the authentication vectors from HSS, trigger a ULR
* for now. Normaly should trigger an authentication procedure with UE.
*/
mme_app_handle_authentication_info_answer(&received_message_p->msg.s6a_auth_info_ans);
mme_app_handle_authentication_info_answer(&received_message_p->ittiMsg.s6a_auth_info_ans);
} break;
case S6A_UPDATE_LOCATION_ANS: {
/* We received the update location answer message from HSS -> Handle it */
mme_app_create_bearer(&received_message_p->msg.s6a_update_location_ans);
mme_app_create_bearer(&received_message_p->ittiMsg.s6a_update_location_ans);
} break;
case SGW_CREATE_SESSION_RESPONSE: {
mme_app_handle_create_sess_resp(&received_message_p->msg.sgwCreateSessionResponse);
mme_app_handle_create_sess_resp(&received_message_p->ittiMsg.sgwCreateSessionResponse);
} break;
case NAS_AUTHENTICATION_RESP: {
mme_app_handle_nas_auth_resp(&received_message_p->msg.nas_auth_resp);
mme_app_handle_nas_auth_resp(&received_message_p->ittiMsg.nas_auth_resp);
} break;
case NAS_ATTACH_REQ: {
mme_app_handle_attach_req(&received_message_p->msg.nas_attach_req);
mme_app_handle_attach_req(&received_message_p->ittiMsg.nas_attach_req);
} break;
case TIMER_HAS_EXPIRED: {
/* Check if it is the statistic timer */
if (received_message_p->msg.timer_has_expired.timer_id ==
if (received_message_p->ittiMsg.timer_has_expired.timer_id ==
mme_app_desc.statistic_timer_id) {
mme_app_statistics_display();
}
......
......@@ -1092,7 +1092,7 @@ static int _emm_as_send(const emm_as_t* msg)
message_p = itti_alloc_new_message(TASK_NAS, NAS_DOWNLINK_DATA_IND);
memcpy(&message_p->msg.nas_dl_data_ind,
memcpy(&message_p->ittiMsg.nas_dl_data_ind,
&as_msg.msg.dl_info_transfer_req,
sizeof(nas_dl_data_ind_t));
......
......@@ -40,20 +40,20 @@ next_message:
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;
nas_req_p = &message_p->ittiMsg.nas_attach_req;
transparent = &message_p->ittiMsg.nas_attach_req.transparent;
nas_req_p->initial = INITIAL_REQUEST;
sprintf(nas_req_p->imsi, "%14llu", 20834123456789ULL);
memcpy(transparent, &received_message_p->msg.nas_conn_est_ind.transparent,
memcpy(transparent, &received_message_p->ittiMsg.nas_conn_est_ind.transparent,
sizeof(s1ap_initial_ue_message_t));
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
#else
nas_establish_ind_t *nas_est_ind_p;
nas_est_ind_p = &received_message_p->msg.nas_conn_est_ind.nas;
nas_est_ind_p = &received_message_p->ittiMsg.nas_conn_est_ind.nas;
nas_proc_establish_ind(nas_est_ind_p->UEid,
nas_est_ind_p->tac,
......@@ -73,9 +73,9 @@ next_message:
message_p = itti_alloc_new_message(TASK_NAS, NAS_AUTHENTICATION_RESP);
nas_resp_p = &message_p->msg.nas_auth_resp;
nas_resp_p = &message_p->ittiMsg.nas_auth_resp;
memcpy(nas_resp_p->imsi, received_message_p->msg.nas_auth_req.imsi, 16);
memcpy(nas_resp_p->imsi, received_message_p->ittiMsg.nas_auth_req.imsi, 16);
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
} break;
......
......@@ -33,11 +33,12 @@ oaisim_mme_LDADD = \
$(top_builddir)/MME_APP/libmmeapp.la \
$(top_builddir)/SECU/libsecu.la \
$(top_builddir)/UTILS/libutils.la \
$(top_builddir)/GTPV2-C/nwgtpv2c-0.11/src/libNwGtpv2c.a
$(top_builddir)/GTPV2-C/nwgtpv2c-0.11/src/libNwGtpv2c.a \
$(top_builddir)/INTERTASK_INTERFACE/UTIL/LFDS/liblfds6.1.1/liblfds611/bin/liblfds611.a
oaisim_mme_SOURCES = \
oai_mme_log.c \
oaisim_mme.c
bin_PROGRAMS = oaisim_mme
endif
\ No newline at end of file
endif
......@@ -35,7 +35,8 @@ oai_epc_LDADD = \
$(top_builddir)/MME_APP/libmmeapp.la \
$(top_builddir)/SECU/libsecu.la \
$(top_builddir)/UTILS/libutils.la \
$(top_builddir)/S1AP/libs1ap.la
$(top_builddir)/S1AP/libs1ap.la \
$(top_builddir)/INTERTASK_INTERFACE/UTIL/LFDS/liblfds6.1.1/liblfds611/bin/liblfds611.a
oai_epc_SOURCES = \
oai_epc_log.c \
......
......@@ -24,11 +24,12 @@ oai_sgw_LDADD = \
$(top_builddir)/UTILS/HASHTABLE/libhashtable.la \
$(top_builddir)/UDP/libudpserver.la \
$(top_builddir)/SECU/libsecu.la \
$(top_builddir)/UTILS/libutils.la
$(top_builddir)/UTILS/libutils.la \
$(top_builddir)/INTERTASK_INTERFACE/UTIL/LFDS/liblfds6.1.1/liblfds611/bin/liblfds611.a
oai_sgw_SOURCES = \
oai_sgw_log.c \
oai_sgw.c
bin_PROGRAMS = oai_sgw
endif
\ No newline at end of file
endif
......@@ -98,7 +98,7 @@ int s11_mme_handle_create_session_response(NwGtpv2cStackHandleT *stack_p,
message_p = itti_alloc_new_message(TASK_S11, SGW_CREATE_SESSION_RESPONSE);
create_session_resp_p = &message_p->msg.sgwCreateSessionResponse;
create_session_resp_p = &message_p->ittiMsg.sgwCreateSessionResponse;
/* Create a new message parser */
rc = nwGtpv2cMsgParserNew(*stack_p, NW_GTP_CREATE_SESSION_RSP,
......
......@@ -112,7 +112,7 @@ NwRcT s11_mme_send_udp_msg(
message_p = itti_alloc_new_message(TASK_S11, UDP_DATA_REQ);
udp_data_req_p = &message_p->msg.udp_data_req;
udp_data_req_p = &message_p->ittiMsg.udp_data_req;
udp_data_req_p->peer_address = peerIpAddr;
udp_data_req_p->peer_port = peerPort;
......@@ -184,14 +184,14 @@ static void *s11_mme_thread(void *args)
case SGW_CREATE_SESSION_REQUEST: {
s11_mme_create_session_request(
&s11_mme_stack_handle,
&received_message_p->msg.sgwCreateSessionRequest);
&received_message_p->ittiMsg.sgwCreateSessionRequest);
} break;
case UDP_DATA_IND: {
/* We received new data to handle from the UDP layer */
NwRcT rc;
udp_data_ind_t *udp_data_ind;
udp_data_ind = &received_message_p->msg.udp_data_ind;
udp_data_ind = &received_message_p->ittiMsg.udp_data_ind;
rc = nwGtpv2cProcessUdpReq(s11_mme_stack_handle,
udp_data_ind->buffer,
......@@ -203,10 +203,10 @@ static void *s11_mme_thread(void *args)
} break;
case TIMER_HAS_EXPIRED: {
S11_DEBUG("Processing timeout for timer_id 0x%lx and arg %p\n",
received_message_p->msg.timer_has_expired.timer_id,
received_message_p->msg.timer_has_expired.arg);
received_message_p->ittiMsg.timer_has_expired.timer_id,
received_message_p->ittiMsg.timer_has_expired.arg);
DevAssert(nwGtpv2cProcessTimeout(
received_message_p->msg.timer_has_expired.arg) == NW_OK);
received_message_p->ittiMsg.timer_has_expired.arg) == NW_OK);
} break;
default: {
S11_ERROR("Unkwnon message ID %d:%s\n",
......@@ -230,11 +230,11 @@ static int s11_send_init_udp(char *address, uint16_t port_number)
return -1;
}
message_p->msg.udp_init.port = port_number;
//LG message_p->msg.udpInit.address = "0.0.0.0"; //ANY address
message_p->msg.udp_init.address = address;
message_p->ittiMsg.udp_init.port = port_number;
//LG message_p->ittiMsg.udpInit.address = "0.0.0.0"; //ANY address
message_p->ittiMsg.udp_init.address = address;
S11_DEBUG("Tx UDP_INIT IP addr %s\n", message_p->msg.udp_init.address);
S11_DEBUG("Tx UDP_INIT IP addr %s\n", message_p->ittiMsg.udp_init.address);
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
}
......
......@@ -112,7 +112,7 @@ NwRcT s11_sgw_send_udp_msg(
message_p = itti_alloc_new_message(TASK_S11, UDP_DATA_REQ);
udp_data_req_p = &message_p->msg.udp_data_req;
udp_data_req_p = &message_p->ittiMsg.udp_data_req;
udp_data_req_p->peer_address = peerIpAddr;
udp_data_req_p->peer_port = peerPort;
......@@ -198,7 +198,7 @@ static void *s11_sgw_thread(void *args)
NwRcT rc;
udp_data_ind_t *udp_data_ind;
udp_data_ind = &received_message_p->msg.udp_data_ind;
udp_data_ind = &received_message_p->ittiMsg.udp_data_ind;
S11_DEBUG("Processing new data indication from UDP\n");
......@@ -214,25 +214,25 @@ static void *s11_sgw_thread(void *args)
S11_DEBUG("Received create session response from S-PGW APP\n");
s11_sgw_handle_create_session_response(
&s11_sgw_stack_handle,
&received_message_p->msg.sgwCreateSessionResponse);
&received_message_p->ittiMsg.sgwCreateSessionResponse);
} break;
case SGW_MODIFY_BEARER_RESPONSE: {
S11_DEBUG("Received modify bearer response from S-PGW APP\n");
s11_sgw_handle_modify_bearer_response(
&s11_sgw_stack_handle,
&received_message_p->msg.sgwModifyBearerResponse);
&received_message_p->ittiMsg.sgwModifyBearerResponse);
} break;
case SGW_DELETE_SESSION_RESPONSE: {
S11_DEBUG("Received delete session response from S-PGW APP\n");
s11_sgw_handle_delete_session_response(
&s11_sgw_stack_handle,
&received_message_p->msg.sgwDeleteSessionResponse);
&received_message_p->ittiMsg.sgwDeleteSessionResponse);
} break;
case TIMER_HAS_EXPIRED: {
S11_DEBUG("Processing timeout for timer_id 0x%lx and arg %p\n",
received_message_p->msg.timer_has_expired.timer_id,
received_message_p->msg.timer_has_expired.arg);
DevAssert(nwGtpv2cProcessTimeout(received_message_p->msg.timer_has_expired.arg) == NW_OK);
received_message_p->ittiMsg.timer_has_expired.timer_id,
received_message_p->ittiMsg.timer_has_expired.arg);
DevAssert(nwGtpv2cProcessTimeout(received_message_p->ittiMsg.timer_has_expired.arg) == NW_OK);
} break;
default: {
S11_ERROR("Unkwnon message ID %d:%s\n",
......@@ -255,11 +255,11 @@ static int s11_send_init_udp(char *address, uint16_t port_number)
return -1;
}
message_p->msg.udp_init.port = port_number;
//LG message_p->msg.udpInit.address = "0.0.0.0"; //ANY address
message_p->msg.udp_init.address = address;
message_p->ittiMsg.udp_init.port = port_number;
//LG message_p->ittiMsg.udpInit.address = "0.0.0.0"; //ANY address
message_p->ittiMsg.udp_init.address = address;
S11_DEBUG("Tx UDP_INIT IP addr %s\n", message_p->msg.udp_init.address);
S11_DEBUG("Tx UDP_INIT IP addr %s\n", message_p->ittiMsg.udp_init.address);
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
}
......
......@@ -34,7 +34,7 @@ int s11_sgw_handle_modify_bearer_request(NwGtpv2cStackHandleT *stack_p,
message_p = itti_alloc_new_message(TASK_S11, SGW_MODIFY_BEARER_REQUEST);
modify_bearer_request_p = &message_p->msg.sgwModifyBearerRequest;
modify_bearer_request_p = &message_p->ittiMsg.sgwModifyBearerRequest;
modify_bearer_request_p->trxn = (void *)pUlpApi->apiInfo.initialReqIndInfo.hTrxn;
modify_bearer_request_p->teid = nwGtpv2cMsgGetTeid(pUlpApi->hMsg);
......
......@@ -34,7 +34,7 @@ int s11_sgw_handle_create_session_request(NwGtpv2cStackHandleT *stack_p,
message_p = itti_alloc_new_message(TASK_S11, SGW_CREATE_SESSION_REQUEST);
create_session_request_p = &message_p->msg.sgwCreateSessionRequest;
create_session_request_p = &message_p->ittiMsg.sgwCreateSessionRequest;
/* Create a new message parser */
rc = nwGtpv2cMsgParserNew(*stack_p, NW_GTP_CREATE_SESSION_REQ,
......@@ -335,7 +335,7 @@ int s11_sgw_handle_delete_session_request(NwGtpv2cStackHandleT *stack_p,
message_p = itti_alloc_new_message(TASK_S11, SGW_DELETE_SESSION_REQUEST);
delete_session_request_p = &message_p->msg.sgwDeleteSessionRequest;
delete_session_request_p = &message_p->ittiMsg.sgwDeleteSessionRequest;
/* Create a new message parser */
rc = nwGtpv2cMsgParserNew(*stack_p, NW_GTP_DELETE_SESSION_REQ,
......
......@@ -102,7 +102,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ);
sctp_new_association_req_p = &message_p->msg.sctp_new_association_req;
sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req;
sctp_new_association_req_p->port = S1AP_PORT_NUMBER;
sctp_new_association_req_p->ppid = S1AP_SCTP_PPID;
......@@ -245,27 +245,30 @@ void *s1ap_eNB_task(void *arg)
* own parameters.
*/
s1ap_eNB_handle_register_eNB(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->msg.s1ap_register_eNB);
&received_msg->ittiMsg.s1ap_register_eNB);
} break;
case SCTP_NEW_ASSOCIATION_RESP: {
s1ap_eNB_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->msg.sctp_new_association_resp);
&received_msg->ittiMsg.sctp_new_association_resp);
} break;
case SCTP_DATA_IND: {
s1ap_eNB_handle_sctp_data_ind(&received_msg->msg.sctp_data_ind);
s1ap_eNB_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind);
} break;
case S1AP_NAS_FIRST_REQ: {
s1ap_eNB_handle_nas_first_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->msg.s1ap_nas_first_req);
&S1AP_NAS_FIRST_REQ(received_msg));
} break;
case S1AP_UPLINK_NAS: {
s1ap_eNB_nas_uplink(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->msg.s1ap_uplink_nas);
&S1AP_UPLINK_NAS(received_msg));
} break;
case S1AP_INITIAL_CONTEXT_SETUP_RESP: {
s1ap_eNB_initial_ctxt_resp(
ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->msg.s1ap_initial_context_setup_resp);
s1ap_eNB_initial_ctxt_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&S1AP_INITIAL_CONTEXT_SETUP_RESP(received_msg));
} break;
case S1AP_NAS_NON_DELIVERY_IND: {
s1ap_eNB_nas_non_delivery_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&S1AP_NAS_NON_DELIVERY_IND(received_msg));
} break;
default:
S1AP_ERROR("Received unhandled message: %d:%s\n",
......
......@@ -85,7 +85,7 @@ static int s1ap_eNB_decode_initiating_message(s1ap_message *message,
message_string_size = strlen(message_string);
message_p = itti_alloc_new_message_sized(TASK_S1AP, GENERIC_LOG, message_string_size);
memcpy(&message_p->msg.generic_log, message_string, message_string_size);
memcpy(&message_p->ittiMsg.generic_log, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
......@@ -128,7 +128,7 @@ static int s1ap_eNB_decode_successful_outcome(s1ap_message *message,
message_string_size = strlen(message_string);
message_p = itti_alloc_new_message_sized(TASK_S1AP, GENERIC_LOG, message_string_size);
memcpy(&message_p->msg.generic_log, message_string, message_string_size);
memcpy(&message_p->ittiMsg.generic_log, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
......
......@@ -154,7 +154,7 @@ int s1ap_eNB_encode_initiating(s1ap_message *s1ap_message_p,
message_string_size = strlen(message_string);
message_p = itti_alloc_new_message_sized(TASK_S1AP, GENERIC_LOG, message_string_size);
memcpy(&message_p->msg.generic_log, message_string, message_string_size);
memcpy(&message_p->ittiMsg.generic_log, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
......@@ -193,7 +193,7 @@ int s1ap_eNB_encode_successfull_outcome(s1ap_message *s1ap_message_p,
message_string_size = strlen(message_string);
message_p = itti_alloc_new_message_sized(TASK_S1AP, GENERIC_LOG, message_string_size);
memcpy(&message_p->msg.generic_log, message_string, message_string_size);
memcpy(&message_p->ittiMsg.generic_log, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
......@@ -220,7 +220,7 @@ int s1ap_eNB_encode_unsuccessfull_outcome(s1ap_message *s1ap_message_p,
switch(s1ap_message_p->procedureCode) {
case S1ap_ProcedureCode_id_InitialContextSetup:
// ret = s1ap_encode_s1ap_initialcontextsetupfailureies(
// &s1ap_message_p->msg.s1ap_InitialContextSetupFailureIEs, buffer, len);
// &s1ap_message_p->ittiMsg.s1ap_InitialContextSetupFailureIEs, buffer, len);
s1ap_xer_print_s1ap_initialcontextsetupfailure(s1ap_xer__print2sp, message_string, s1ap_message_p);
break;
default:
......@@ -231,7 +231,7 @@ int s1ap_eNB_encode_unsuccessfull_outcome(s1ap_message *s1ap_message_p,
message_string_size = strlen(message_string);
message_p = itti_alloc_new_message_sized(TASK_S1AP, GENERIC_LOG, message_string_size);
memcpy(&message_p->msg.generic_log, message_string, message_string_size);
memcpy(&message_p->ittiMsg.generic_log, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
......
......@@ -10,7 +10,7 @@ void s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uin
message_p = itti_alloc_new_message(TASK_S1AP, SCTP_DATA_REQ);
sctp_data_req = &message_p->msg.sctp_data_req;
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = assoc_id;
sctp_data_req->buffer = buffer;
......@@ -31,7 +31,7 @@ void s1ap_eNB_itti_send_nas_downlink_ind(instance_t instance,