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,
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_DOWNLINK_NAS);
s1ap_downlink_nas = &message_p->msg.s1ap_downlink_nas;
s1ap_downlink_nas = &message_p->ittiMsg.s1ap_downlink_nas;
s1ap_downlink_nas->ue_initial_id = ue_initial_id;
s1ap_downlink_nas->eNB_ue_s1ap_id = eNB_ue_s1ap_id;
......
......@@ -343,6 +343,60 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
return 0;
}
void s1ap_eNB_nas_non_delivery_ind(instance_t instance,
s1ap_nas_non_delivery_ind_t *s1ap_nas_non_delivery_ind)
{
struct s1ap_eNB_ue_context_s *ue_context_p;
s1ap_eNB_instance_t *s1ap_eNB_instance_p;
S1ap_NASNonDeliveryIndication_IEs_t *nas_non_delivery_p;
s1ap_message message;
uint8_t *buffer;
uint32_t length;
DevAssert(s1ap_nas_non_delivery_ind != NULL);
/* Retrieve the S1AP eNB instance associated with Mod_id */
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
DevAssert(s1ap_eNB_instance_p != NULL);
if ((ue_context_p = s1ap_eNB_get_ue_context(s1ap_eNB_instance_p, s1ap_nas_non_delivery_ind->eNB_ue_s1ap_id)) == NULL)
{
/* The context for this eNB ue s1ap id doesn't exist in the map of eNB UEs */
S1AP_WARN("Failed to find ue context associated with eNB ue s1ap id: %06x\n",
s1ap_nas_non_delivery_ind->eNB_ue_s1ap_id);
return;
}
DevAssert(ue_context_p->ue_state == S1AP_UE_CONNECTED);
/* Prepare the S1AP message to encode */
memset(&message, 0, sizeof(s1ap_message));
message.direction = S1AP_PDU_PR_initiatingMessage;
message.procedureCode = S1ap_ProcedureCode_id_NASNonDeliveryIndication;
nas_non_delivery_p = &message.msg.s1ap_NASNonDeliveryIndication_IEs;
if (s1ap_eNB_encode_pdu(&message, &buffer, &length) < 0) {
S1AP_ERROR("Failed to encode NAS NON delivery indication\n");
/* Encode procedure has failed... */
return;
}
nas_non_delivery_p->eNB_UE_S1AP_ID = ue_context_p->eNB_ue_s1ap_id;
nas_non_delivery_p->mme_ue_s1ap_id = ue_context_p->mme_ue_s1ap_id;
nas_non_delivery_p->nas_pdu.buf = s1ap_nas_non_delivery_ind->nas_pdu.buffer;
nas_non_delivery_p->nas_pdu.size = s1ap_nas_non_delivery_ind->nas_pdu.length;
/* UE associated signalling -> use the allocated stream */
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
ue_context_p->mme_ref->assoc_id, buffer,
length, ue_context_p->stream);
}
int s1ap_eNB_initial_ctxt_resp(
instance_t instance, s1ap_initial_context_setup_resp_t *initial_ctxt_resp_p)
{
......
......@@ -37,6 +37,9 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id,
int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_p);
void s1ap_eNB_nas_non_delivery_ind(instance_t instance,
s1ap_nas_non_delivery_ind_t *s1ap_nas_non_delivery_ind);
int s1ap_eNB_handle_nas_first_req(
instance_t instance, s1ap_nas_first_req_t *s1ap_nas_first_req_p);
......
......@@ -72,17 +72,17 @@ static int s1ap_send_init_sctp(void) {
// Create and alloc new message
MessageDef *message_p;
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;
message_p->msg.sctpInit.ipv6 = 0;
message_p->msg.sctpInit.nb_ipv4_addr = 1;
message_p->msg.sctpInit.ipv4_address[0]
message_p->ittiMsg.sctpInit.port = S1AP_PORT_NUMBER;
message_p->ittiMsg.sctpInit.ppid = S1AP_SCTP_PPID;
message_p->ittiMsg.sctpInit.ipv4 = 1;
message_p->ittiMsg.sctpInit.ipv6 = 0;
message_p->ittiMsg.sctpInit.nb_ipv4_addr = 1;
message_p->ittiMsg.sctpInit.ipv4_address[0]
= mme_config.ipv4.mme_ip_address_for_S1_MME;
/* SR WARNING: ipv6 multi-homing fails sometimes for localhost.
* Disable it for now.*/
message_p->msg.sctpInit.nb_ipv6_addr = 0;
message_p->msg.sctpInit.ipv6_address[0] = "0:0:0:0:0:0:0:1";
message_p->ittiMsg.sctpInit.nb_ipv6_addr = 0;
message_p->ittiMsg.sctpInit.ipv6_address[0] = "0:0:0:0:0:0:0:1";
return itti_send_msg_to_task(TASK_SCTP, INSTANCE_DEFAULT, message_p);
}
......@@ -109,7 +109,7 @@ void *s1ap_mme_thread(void *args)
*/
s1ap_message message;
s1ap_sctp_new_msg_ind_t *s1ap_sctp_new_msg_ind_p;
s1ap_sctp_new_msg_ind_p = &received_message_p->msg.s1ap_sctp_new_msg_ind;
s1ap_sctp_new_msg_ind_p = &received_message_p->ittiMsg.s1ap_sctp_new_msg_ind;
memset((void *)&message, 0, sizeof(s1ap_message));
/* Invoke S1AP message decoder */
......@@ -125,24 +125,24 @@ void *s1ap_mme_thread(void *args)
/* SCTP layer notifies S1AP of disconnection of a peer. */
case SCTP_CLOSE_ASSOCIATION: {
sctp_close_association_t *sctp_close_association_p;
sctp_close_association_p = &received_message_p->msg.sctp_close_association;
sctp_close_association_p = &received_message_p->ittiMsg.sctp_close_association;
s1ap_handle_sctp_deconnection(sctp_close_association_p->assoc_id);
} break;
case SCTP_NEW_ASSOCIATION: {
s1ap_handle_new_association(&received_message_p->msg.sctp_new_peer);
s1ap_handle_new_association(&received_message_p->ittiMsg.sctp_new_peer);
} break;
case NAS_DOWNLINK_DATA_IND: {
/* New message received from NAS task.
* This corresponds to a S1AP downlink nas transport message.
*/
s1ap_generate_downlink_nas_transport(&received_message_p->msg.nas_dl_data_ind);
s1ap_generate_downlink_nas_transport(&received_message_p->ittiMsg.nas_dl_data_ind);
} break;
case NAS_ATTACH_ACCEPT: {
s1ap_handle_attach_accepted(&received_message_p->msg.nas_attach_accept);
s1ap_handle_attach_accepted(&received_message_p->ittiMsg.nas_attach_accept);
} break;
case TIMER_HAS_EXPIRED: {
s1ap_handle_timer_expiry(&received_message_p->msg.timer_has_expired);
s1ap_handle_timer_expiry(&received_message_p->ittiMsg.timer_has_expired);
} break;
default: {
S1AP_DEBUG("Unkwnon message ID %d:%s\n",
......
......@@ -450,7 +450,7 @@ int s1ap_mme_handle_ue_cap_indication(uint32_t assoc_id, uint32_t stream,
DevAssert(message_p != NULL);
ue_cap_ind_p = &message_p->msg.s1ap_ue_cap_ind;
ue_cap_ind_p = &message_p->ittiMsg.s1ap_ue_cap_ind;
ue_cap_ind_p->eNB_ue_s1ap_id = ue_ref->eNB_ue_s1ap_id;
ue_cap_ind_p->mme_ue_s1ap_id = ue_ref->mme_ue_s1ap_id;
......@@ -518,7 +518,7 @@ int s1ap_mme_handle_initial_context_setup_response(
eRABSetupItemCtxtSURes_p = (S1ap_E_RABSetupItemCtxtSURes_t *)
initialContextSetupResponseIEs_p->e_RABSetupListCtxtSURes.s1ap_E_RABSetupItemCtxtSURes.array[0];
modify_request_p = &message_p->msg.sgwModifyBearerRequest;
modify_request_p = &message_p->ittiMsg.sgwModifyBearerRequest;
// modify_request_p->teid = ue_ref->teid;
modify_request_p->bearer_context_to_modify.eps_bearer_id =
eRABSetupItemCtxtSURes_p->e_RAB_ID;
......
......@@ -38,7 +38,7 @@ int s1ap_mme_itti_send_sctp_request(uint8_t *buffer, uint32_t length,
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_NEW_DATA_REQ);
sctpNewDataReq_p = &message_p->msg.sctpNewDataReq;
sctpNewDataReq_p = &message_p->ittiMsg.sctpNewDataReq;
sctpNewDataReq_p->buffer = buffer;
sctpNewDataReq_p->bufLen = length;
......
......@@ -132,9 +132,9 @@ int s1ap_mme_handle_initial_ue_message(uint32_t assoc_id, uint32_t stream,
if (message_p == NULL) {
return -1;
}
con_ind_p = &message_p->msg.nas_conn_est_ind.nas;
con_ind_p = &message_p->ittiMsg.nas_conn_est_ind.nas;
s1ap_p = &message_p->msg.nas_conn_est_ind.transparent;
s1ap_p = &message_p->ittiMsg.nas_conn_est_ind.transparent;
s1ap_p->eNB_ue_s1ap_id = eNB_ue_s1ap_id;
s1ap_p->mme_ue_s1ap_id = ue_ref->mme_ue_s1ap_id;
......
......@@ -201,7 +201,7 @@ int s6a_aia_cb(struct msg **msg, struct avp *paramavp,
DevAssert(qry != NULL);
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_auth_info_ans_p = &message_p->ittiMsg.s6a_auth_info_ans;
S6A_DEBUG("Received S6A Authentication Information Answer (AIA)\n");
......
......@@ -81,10 +81,10 @@ void *s6a_thread(void *args)
switch (ITTI_MSG_ID(received_message_p))
{
case S6A_UPDATE_LOCATION_REQ: {
s6a_generate_update_location(&received_message_p->msg.s6a_update_location_req);
s6a_generate_update_location(&received_message_p->ittiMsg.s6a_update_location_req);
} break;
case S6A_AUTH_INFO_REQ: {
s6a_generate_authentication_info_req(&received_message_p->msg.s6a_auth_info_req);
s6a_generate_authentication_info_req(&received_message_p->ittiMsg.s6a_auth_info_req);
} break;
default: {
S6A_DEBUG("Unkwnon message ID %d:%s\n",
......
......@@ -62,7 +62,7 @@ int s6a_ula_cb(struct msg **msg, struct avp *paramavp,
message_p = itti_alloc_new_message(TASK_S6A, S6A_UPDATE_LOCATION_ANS);
s6a_update_location_ans_p = &message_p->msg.s6a_update_location_ans;
s6a_update_location_ans_p = &message_p->ittiMsg.s6a_update_location_ans;
CHECK_FCT(fd_msg_search_avp(qry, s6a_fd_cnf.dataobj_s6a_user_name, &avp));
if (avp) {
......
......@@ -11,7 +11,7 @@ int sctp_itti_send_new_message_ind(task_id_t task_id, uint32_t assoc_id, uint8_t
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_DATA_IND);
sctp_data_ind_p = &message_p->msg.sctp_data_ind;
sctp_data_ind_p = &message_p->ittiMsg.sctp_data_ind;
sctp_data_ind_p->buffer = malloc(sizeof(uint8_t) * buffer_length);
......@@ -35,7 +35,7 @@ int sctp_itti_send_association_resp(task_id_t task_id, instance_t instance,
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_NEW_ASSOCIATION_RESP);
sctp_new_association_resp_p = &message_p->msg.sctp_new_association_resp;
sctp_new_association_resp_p = &message_p->ittiMsg.sctp_new_association_resp;
sctp_new_association_resp_p->in_streams = in_streams;
sctp_new_association_resp_p->out_streams = out_streams;
......@@ -55,7 +55,7 @@ int sctp_itti_send_association_ind(task_id_t task_id, instance_t instance,
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_NEW_ASSOCIATION_IND);
sctp_new_association_ind_p = &message_p->msg.sctp_new_association_ind;
sctp_new_association_ind_p = &message_p->ittiMsg.sctp_new_association_ind;
sctp_new_association_ind_p->assoc_id = assoc_id;
sctp_new_association_ind_p->port = port;
......
......@@ -546,12 +546,12 @@ void *sctp_eNB_task(void *arg)
case SCTP_NEW_ASSOCIATION_REQ: {
sctp_handle_new_association_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
ITTI_MSG_ORIGIN_ID(received_msg),
&received_msg->msg.sctp_new_association_req);
&received_msg->ittiMsg.sctp_new_association_req);
} break;
case SCTP_DATA_REQ: {
sctp_send_data(ITTI_MESSAGE_GET_INSTANCE(received_msg),
ITTI_MSG_ORIGIN_ID(received_msg),
&received_msg->msg.sctp_data_req);
&received_msg->ittiMsg.sctp_data_req);
} break;
default:
SCTP_ERROR("Received unhandled message %d:%s\n",
......
......@@ -12,7 +12,7 @@ int sctp_itti_send_new_association(uint32_t assoc_id, uint16_t instreams,
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_NEW_ASSOCIATION);
sctp_new_peer_p = &message_p->msg.sctp_new_peer;
sctp_new_peer_p = &message_p->ittiMsg.sctp_new_peer;
sctp_new_peer_p->assoc_id = assoc_id;
sctp_new_peer_p->instreams = instreams;
......@@ -30,7 +30,7 @@ int sctp_itti_send_new_message_ind(int n, uint8_t *buffer, uint32_t assoc_id,
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;
sctp_new_msg_ind_p = &message_p->ittiMsg.s1ap_sctp_new_msg_ind;
sctp_new_msg_ind_p->buffer = malloc(sizeof(uint8_t) * n);
......@@ -52,7 +52,7 @@ int sctp_itti_send_com_down_ind(uint32_t assoc_id)
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 = &message_p->ittiMsg.sctp_close_association;
sctp_close_association_p->assoc_id = assoc_id;
......
......@@ -593,7 +593,7 @@ static void *sctp_intertask_interface(void *args_p)
case SCTP_INIT_MSG: {
SCTP_DEBUG("Received SCTP_INIT_MSG\n");
/* We received a new connection request */
if (sctp_create_new_listener(&received_message_p->msg.sctpInit) < 0) {
if (sctp_create_new_listener(&received_message_p->ittiMsg.sctpInit) < 0) {
/* SCTP socket creation or bind failed... */
SCTP_ERROR("Failed to create new SCTP listener\n");
}
......@@ -603,7 +603,7 @@ static void *sctp_intertask_interface(void *args_p)
} break;
case SCTP_NEW_DATA_REQ: {
SctpNewDataReq *sctpNewS1APDataReq;
sctpNewS1APDataReq = &received_message_p->msg.sctpNewDataReq;
sctpNewS1APDataReq = &received_message_p->ittiMsg.sctpNewDataReq;
if (sctp_send_msg(sctpNewS1APDataReq->assocId,
sctpNewS1APDataReq->stream,
sctpNewS1APDataReq->buffer,
......
......@@ -158,7 +158,7 @@ void sgi_process_raw_packet(sgi_data_t *sgi_data_pP, unsigned char* data_pP, int
}
memcpy(message_payload_p, data_pP, packet_sizeP);
gtpv1u_tunnel_data_req_p = &message_p->msg.gtpv1uTunnelDataReq;
gtpv1u_tunnel_data_req_p = &message_p->ittiMsg.gtpv1uTunnelDataReq;
//LG HACK gtpv1u_tunnel_data_req_p->S1u_enb_teid = addr_mapping_p->enb_S1U_teid;
#warning forced S1u_enb_teid to 1 for testing, waiting for MODIFY_BEARER REQUEST
gtpv1u_tunnel_data_req_p->S1u_enb_teid = 1;
......@@ -291,7 +291,7 @@ void sgi_process_raw_packet(sgi_data_t *sgi_data_pP, unsigned char* data_pP, int
}
memcpy(message_payload_p, data_pP+sizeof(sgi_data_pP->eh), packet_sizeP - sizeof(sgi_data_pP->eh));
gtpv1u_tunnel_data_req_p = &message_p->msg.gtpv1uTunnelDataReq;
gtpv1u_tunnel_data_req_p = &message_p->ittiMsg.gtpv1uTunnelDataReq;
gtpv1u_tunnel_data_req_p->S1u_enb_teid = addr_mapping_p->enb_S1U_teid;
//#warning forced S1u_enb_teid to 1 for testing, waiting for MODIFY_BEARER REQUEST
// gtpv1u_tunnel_data_req_p->S1u_enb_teid = 1;
......
......@@ -215,7 +215,7 @@ static int sgi_nfqueue_callback(struct nfq_q_handle *myQueue, struct nfgenmsg *m
if (message_p == NULL) {
return -1;
}
data_req_p = &message_p->msg.gtpv1uTunnelDataReq;
data_req_p = &message_p->ittiMsg.gtpv1uTunnelDataReq;
data_req_p->buffer = malloc(sizeof(uint8_t) * len);
if (data_req_p->buffer == NULL) {
SGI_IF_ERROR("Failed to allocate new buffer\n");
......
......@@ -84,7 +84,7 @@ static void* sgi_task_thread(void *args_p)
* Forward it host adapter.
*/
Gtpv1uTunnelDataInd *data_ind_p;
data_ind_p = &received_message_p->msg.gtpv1uTunnelDataInd;
data_ind_p = &received_message_p->ittiMsg.gtpv1uTunnelDataInd;
sgi_send_data(data_ind_p->buffer, data_ind_p->length, sgi_data_p, data_ind_p->local_S1u_teid);
/* Buffer is no longer needed, free it */
free(data_ind_p->buffer);
......@@ -92,7 +92,7 @@ static void* sgi_task_thread(void *args_p)
break;
case SGI_CREATE_ENDPOINT_REQUEST: {
SGICreateEndpointReq *req_p;
req_p = &received_message_p->msg.sgiCreateEndpointReq;
req_p = &received_message_p->ittiMsg.sgiCreateEndpointReq;
sgi_create_endpoint_request(sgi_data_p, req_p);
......@@ -101,7 +101,7 @@ static void* sgi_task_thread(void *args_p)
case SGI_UPDATE_ENDPOINT_REQUEST: {
SGIUpdateEndpointReq *req_p;
req_p = &received_message_p->msg.sgiUpdateEndpointReq;
req_p = &received_message_p->ittiMsg.sgiUpdateEndpointReq;
sgi_update_endpoint_request(sgi_data_p, req_p);
......@@ -135,7 +135,7 @@ static int sgi_create_endpoint_request(sgi_data_t *sgi_dataP, SGICreateEndpointR
if (message_p == NULL) {
return -1;
}
sgi_create_endpoint_resp_p = &message_p->msg.sgiCreateEndpointResp;
sgi_create_endpoint_resp_p = &message_p->ittiMsg.sgiCreateEndpointResp;
sgi_create_endpoint_resp_p->context_teid = req_p->context_teid;
sgi_create_endpoint_resp_p->sgw_S1u_teid = req_p->sgw_S1u_teid;
sgi_create_endpoint_resp_p->eps_bearer_id = req_p->eps_bearer_id;
......@@ -184,7 +184,7 @@ static int sgi_update_endpoint_request(sgi_data_t *sgi_dataP, SGIUpdateEndpointR
if (message_p == NULL) {
return -1;
}
sgi_update_endpoint_resp_p = &message_p->msg.sgiUpdateEndpointResp;
sgi_update_endpoint_resp_p = &message_p->ittiMsg.sgiUpdateEndpointResp;
sgi_update_endpoint_resp_p->context_teid = req_p->context_teid;
sgi_update_endpoint_resp_p->sgw_S1u_teid = req_p->sgw_S1u_teid;
sgi_update_endpoint_resp_p->eps_bearer_id = req_p->eps_bearer_id;
......
......@@ -170,11 +170,11 @@ int sgw_lite_handle_create_session_request(SgwCreateSessionRequest *session_req_
return -1;
}
message_p->msg.gtpv1uCreateTunnelReq.context_teid = new_endpoint->local_teid;
message_p->msg.gtpv1uCreateTunnelReq.eps_bearer_id = session_req_p->bearer_to_create.eps_bearer_id;
message_p->ittiMsg.gtpv1uCreateTunnelReq.context_teid = new_endpoint->local_teid;
message_p->ittiMsg.gtpv1uCreateTunnelReq.eps_bearer_id = session_req_p->bearer_to_create.eps_bearer_id;
SPGW_APP_DEBUG("Tx GTPV1U_CREATE_TUNNEL_REQ -> TASK_GTPV1_U, Context: S-GW S11 teid %u eps bearer id %d (from session req)\n",
message_p->msg.gtpv1uCreateTunnelReq.context_teid,
message_p->msg.gtpv1uCreateTunnelReq.eps_bearer_id);
message_p->ittiMsg.gtpv1uCreateTunnelReq.context_teid,
message_p->ittiMsg.gtpv1uCreateTunnelReq.eps_bearer_id);
return itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
} else {
SPGW_APP_WARNING("Could not create new transaction for SESSION_CREATE message\n");
......@@ -208,7 +208,7 @@ int sgw_lite_handle_sgi_endpoint_created(SGICreateEndpointResp *resp_p)
return -1;
}
create_session_response_p = &message_p->msg.sgwCreateSessionResponse;
create_session_response_p = &message_p->ittiMsg.sgwCreateSessionResponse;
if (hash_rc == HASH_TABLE_OK) {
create_session_response_p->teid = new_bearer_context_information_p->sgw_eps_bearer_context_information.mme_teid_for_S11;
......@@ -291,7 +291,7 @@ int sgw_lite_handle_gtpv1uCreateTunnelResp(Gtpv1uCreateTunnelResp *endpoint_crea
if (message_p == NULL) {
return -1;
}
sgi_create_endpoint_req_p = &message_p->msg.sgiCreateEndpointReq;
sgi_create_endpoint_req_p = &message_p->ittiMsg.sgiCreateEndpointReq;
// IP forward will forward packets to this teid
sgi_create_endpoint_req_p->context_teid = endpoint_created_p->context_teid;
sgi_create_endpoint_req_p->sgw_S1u_teid = endpoint_created_p->S1u_teid;
......@@ -306,7 +306,7 @@ int sgw_lite_handle_gtpv1uCreateTunnelResp(Gtpv1uCreateTunnelResp *endpoint_crea
if (message_p == NULL) {
return -1;
}
create_session_response_p = &message_p->msg.sgwCreateSessionResponse;
create_session_response_p = &message_p->ittiMsg.sgwCreateSessionResponse;
memset(create_session_response_p, 0, sizeof(SgwCreateSessionResponse));
create_session_response_p->cause = CONTEXT_NOT_FOUND;
create_session_response_p->bearer_context_created.cause = CONTEXT_NOT_FOUND;
......@@ -352,7 +352,7 @@ int sgw_lite_handle_gtpv1uUpdateTunnelResp(Gtpv1uUpdateTunnelResp *endpoint_upda
if (message_p == NULL) {
return -1;
}
modify_response_p = &message_p->msg.sgwModifyBearerResponse;
modify_response_p = &message_p->ittiMsg.sgwModifyBearerResponse;
memset(modify_response_p, 0, sizeof(SgwModifyBearerResponse));
modify_response_p->present = MODIFY_BEARER_RESPONSE_REM;
modify_response_p->choice.bearer_for_removal.eps_bearer_id = endpoint_updated_p->eps_bearer_id;
......@@ -367,7 +367,7 @@ int sgw_lite_handle_gtpv1uUpdateTunnelResp(Gtpv1uUpdateTunnelResp *endpoint_upda
if (message_p == NULL) {
return -1;
}
update_request_p = &message_p->msg.sgiUpdateEndpointReq;
update_request_p = &message_p->ittiMsg.sgiUpdateEndpointReq;
memset(update_request_p, 0, sizeof(SGIUpdateEndpointReq));
update_request_p->context_teid = endpoint_updated_p->context_teid;
update_request_p->sgw_S1u_teid = endpoint_updated_p->sgw_S1u_teid;
......@@ -385,7 +385,7 @@ int sgw_lite_handle_gtpv1uUpdateTunnelResp(Gtpv1uUpdateTunnelResp *endpoint_upda
if (message_p == NULL) {
return -1;
}
modify_response_p = &message_p->msg.sgwModifyBearerResponse;
modify_response_p = &message_p->ittiMsg.sgwModifyBearerResponse;
memset(modify_response_p, 0, sizeof(SgwModifyBearerResponse));
modify_response_p->present = MODIFY_BEARER_RESPONSE_REM;
......@@ -424,7 +424,7 @@ int sgw_lite_handle_sgi_endpoint_updated(SGIUpdateEndpointResp *resp_p)
if (message_p == NULL) {
return -1;
}
modify_response_p = &message_p->msg.sgwModifyBearerResponse;
modify_response_p = &message_p->ittiMsg.sgwModifyBearerResponse;
memset(modify_response_p, 0, sizeof(SgwModifyBearerResponse));
hash_rc = hashtbl_get(sgw_app.s11_bearer_context_information_hashtable, resp_p->context_teid, (void**)&new_bearer_context_information_p);
......@@ -508,7 +508,7 @@ int sgw_lite_handle_modify_bearer_request(SgwModifyBearerRequest *modify_bearer_
if (message_p == NULL) {
return -1;
}
modify_response_p = &message_p->msg.sgwModifyBearerResponse;
modify_response_p = &message_p->ittiMsg.sgwModifyBearerResponse;
memset(modify_response_p, 0, sizeof(SgwModifyBearerResponse));
modify_response_p->present = MODIFY_BEARER_RESPONSE_REM;
modify_response_p->choice.bearer_for_removal.eps_bearer_id = modify_bearer_p->bearer_context_to_modify.eps_bearer_id;
......@@ -527,7 +527,7 @@ int sgw_lite_handle_modify_bearer_request(SgwModifyBearerRequest *modify_bearer_
if (message_p == NULL) {
return -1;
}
gtpv1u_update_tunnel_req_p = &message_p->msg.gtpv1uUpdateTunnelReq;
gtpv1u_update_tunnel_req_p = &message_p->ittiMsg.gtpv1uUpdateTunnelReq;
memset(gtpv1u_update_tunnel_req_p, 0, sizeof(Gtpv1uUpdateTunnelReq));
gtpv1u_update_tunnel_req_p->context_teid = modify_bearer_p->teid;
gtpv1u_update_tunnel_req_p->sgw_S1u_teid = eps_bearer_entry_p->s_gw_teid_for_S1u_S12_S4_up; ///< SGW S1U local Tunnel Endpoint Identifier
......@@ -547,7 +547,7 @@ int sgw_lite_handle_modify_bearer_request(SgwModifyBearerRequest *modify_bearer_
if (message_p == NULL) {
return -1;
}
modify_response_p = &message_p->msg.sgwModifyBearerResponse;
modify_response_p = &message_p->ittiMsg.sgwModifyBearerResponse;
modify_response_p->present = MODIFY_BEARER_RESPONSE_REM;
modify_response_p->choice.bearer_for_removal.eps_bearer_id = modify_bearer_p->bearer_context_to_modify.eps_bearer_id;
......@@ -578,7 +578,7 @@ int sgw_lite_handle_delete_session_request(SgwDeleteSessionRequest *delete_sessi
if (message_p == NULL) {
return -1;
}
delete_session_resp_p = &message_p->msg.sgwDeleteSessionResponse;
delete_session_resp_p = &message_p->ittiMsg.sgwDeleteSessionResponse;
SPGW_APP_WARNING("Delete session handler needs to be completed...\n");
......@@ -618,7 +618,7 @@ int sgw_lite_handle_delete_session_request(SgwDeleteSessionRequest *delete_sessi
if (message_p == NULL) {
return -1;
}
delete_session_resp_p = &message_p->msg.sgwDeleteSessionResponse;
delete_session_resp_p = &message_p->ittiMsg.sgwDeleteSessionResponse;
if ((delete_session_req_p->sender_fteid_for_cp.ipv4 == 0) &&
(delete_session_req_p->sender_fteid_for_cp.ipv6 == 0)) {
......
......@@ -59,35 +59,35 @@ static void *sgw_lite_intertask_interface(void *args_p)
* E-UTRAN Initial Attach
* UE requests PDN connectivity
*/
sgw_lite_handle_create_session_request(&received_message_p->msg.sgwCreateSessionRequest);
sgw_lite_handle_create_session_request(&received_message_p->ittiMsg.sgwCreateSessionRequest);
} break;
case SGW_MODIFY_BEARER_REQUEST: {
sgw_lite_handle_modify_bearer_request(&received_message_p->msg.sgwModifyBearerRequest);
sgw_lite_handle_modify_bearer_request(&received_message_p->ittiMsg.sgwModifyBearerRequest);
} break;
case SGW_DELETE_SESSION_REQUEST: {
sgw_lite_handle_delete_session_request(&received_message_p->msg.sgwDeleteSessionRequest);
sgw_lite_handle_delete_session_request(&received_message_p->ittiMsg.sgwDeleteSessionRequest);
} break;
case GTPV1U_CREATE_TUNNEL_RESP: {
SPGW_APP_DEBUG("Received teid for S1-U: %u and status: %s\n",
received_message_p->msg.gtpv1uCreateTunnelResp.S1u_teid ,
received_message_p->msg.gtpv1uCreateTunnelResp.status == 0 ? "Success" :
received_message_p->ittiMsg.gtpv1uCreateTunnelResp.S1u_teid ,
received_message_p->ittiMsg.gtpv1uCreateTunnelResp.status == 0 ? "Success" :
"Failure");
sgw_lite_handle_gtpv1uCreateTunnelResp(&received_message_p->msg.gtpv1uCreateTunnelResp);
sgw_lite_handle_gtpv1uCreateTunnelResp(&received_message_p->ittiMsg.gtpv1uCreateTunnelResp);
} break;
case GTPV1U_UPDATE_TUNNEL_RESP: {
sgw_lite_handle_gtpv1uUpdateTunnelResp(&received_message_p->msg.gtpv1uUpdateTunnelResp);
sgw_lite_handle_gtpv1uUpdateTunnelResp(&received_message_p->ittiMsg.gtpv1uUpdateTunnelResp);
} break;
case SGI_CREATE_ENDPOINT_RESPONSE: {
sgw_lite_handle_sgi_endpoint_created(&received_message_p->msg.sgiCreateEndpointResp);
sgw_lite_handle_sgi_endpoint_created(&received_message_p->ittiMsg.sgiCreateEndpointResp);
} break;
case SGI_UPDATE_ENDPOINT_RESPONSE: {
sgw_lite_handle_sgi_endpoint_updated(&received_message_p->msg.sgiUpdateEndpointResp);
sgw_lite_handle_sgi_endpoint_updated(&received_message_p->ittiMsg.sgiUpdateEndpointResp);
} break;
default: {
......
......@@ -168,7 +168,7 @@ void *udp_receiver_thread(void *arg_p)
DevAssert(message_p != NULL);
udp_data_ind_p = &message_p->msg.udp_data_ind;
udp_data_ind_p = &message_p->ittiMsg.udp_data_ind;
udp_data_ind_p->buffer = forwarded_buffer;
udp_data_ind_p->buffer_length = n;
......@@ -206,7 +206,7 @@ static void *udp_intertask_interface(void *args_p)
{
case UDP_INIT: {
udp_init_t *udp_init_p;
udp_init_p = &received_message_p->msg.udp_init;
udp_init_p = &received_message_p->ittiMsg.udp_init;
udp_create_socket(udp_init_p->port, udp_init_p->address,
ITTI_MSG_ORIGIN_ID(received_message_p));
} break;
......@@ -218,7 +218,7 @@ static void *udp_intertask_interface(void *args_p)
udp_data_req_t *udp_data_req_p;
struct sockaddr_in peer_addr;
udp_data_req_p = &received_message_p->msg.udp_data_req;
udp_data_req_p = &received_message_p->ittiMsg.udp_data_req;
memset(&peer_addr, 0, sizeof(struct sockaddr_in));
......
......@@ -10,18 +10,18 @@
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
#define RRC_MAC_IN_SYNC_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_in_sync_ind
#define RRC_MAC_OUT_OF_SYNC_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_out_of_sync_ind
#define RRC_MAC_IN_SYNC_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_in_sync_ind
#define RRC_MAC_OUT_OF_SYNC_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_out_of_sync_ind
#define RRC_MAC_BCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_mac_bcch_data_req
#define RRC_MAC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_bcch_data_ind
#define RRC_MAC_BCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_data_req
#define RRC_MAC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_data_ind
#define RRC_MAC_CCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_mac_ccch_data_req
#define RRC_MAC_CCCH_DATA_CNF(mSGpTR) (mSGpTR)->msg.rrc_mac_ccch_data_cnf
#define RRC_MAC_CCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_ccch_data_ind
#define RRC_MAC_CCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_ccch_data_req
#define RRC_MAC_CCCH_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_ccch_data_cnf
#define RRC_MAC_CCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_ccch_data_ind
#define RRC_MAC_MCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_mac_mcch_data_req
#define RRC_MAC_MCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_mac_mcch_data_ind
#define RRC_MAC_MCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_mcch_data_req
#define RRC_MAC_MCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_mcch_data_ind
// Some constants from "LAYER2/MAC/defs.h"
#define BCCH_SDU_SIZE (128)
......
......@@ -10,8 +10,8 @@
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
#define RRC_DCCH_DATA_REQ(mSGpTR) (mSGpTR)->msg.rrc_dcch_data_req
#define RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->msg.rrc_dcch_data_ind
#define RRC_DCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_dcch_data_req
#define RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_dcch_data_ind
//-------------------------------------------------------------------------------------------//
// Messages between RRC and PDCP layers
......
......@@ -28,11 +28,11 @@ typedef UL_DCCH_Message_t RrcUlDcchMessage;
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
#define NAS_DOWNLINK_DATA_IND(mSGpTR) (mSGpTR)->msg.nas_dl_data_ind
#define NAS_DOWNLINK_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_ind
#define NAS_UPLINK_DATA_REQ(mSGpTR) (mSGpTR)->msg.nas_ul_data_req
#define NAS_UPLINK_DATA_CNF(mSGpTR) (mSGpTR)->msg.nas_ul_data_cnf
#define NAS_UPLINK_DATA_IND(mSGpTR) (mSGpTR)->msg.nas_ul_data_ind
#define NAS_UPLINK_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_req
#define NAS_UPLINK_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_cnf
#define NAS_UPLINK_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_ind
//-------------------------------------------------------------------------------------------//
// Messages between NAS and RRC layers
......
......@@ -7,7 +7,16 @@ MESSAGE_DEF(S1AP_UPLINK_NAS , MESSAGE_PRIORITY_MED, s1ap_uplink_n
MESSAGE_DEF(S1AP_UE_CAPABILITIES_IND , MESSAGE_PRIORITY_MED, s1ap_ue_cap_info_ind_t , s1ap_ue_cap_info_ind)
MESSAGE_DEF(S1AP_INITIAL_CONTEXT_SETUP_RESP, MESSAGE_PRIORITY_MED, s1ap_initial_context_setup_resp_t, s1ap_initial_context_setup_resp)
MESSAGE_DEF(S1AP_INITIAL_CONTEXT_SETUP_FAIL, MESSAGE_PRIORITY_MED, s1ap_initial_context_setup_fail_t, s1ap_initial_context_setup_fail)
MESSAGE_DEF(S1AP_NAS_NON_DELIVERY_IND , MESSAGE_PRIORITY_MED, s1ap_nas_non_delivery_ind_t , s1ap_nas_non_delivery_ind)
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_RESP , MESSAGE_PRIORITY_MED, s1ap_ue_release_resp_t , s1ap_ue_release_resp)
MESSAGE_DEF(S1AP_UE_CTXT_MODIFICATION_RESP , MESSAGE_PRIORITY_MED, s1ap_ue_ctxt_modification_resp_t , s1ap_ue_ctxt_modification_resp)
MESSAGE_DEF(S1AP_UE_CTXT_MODIFICATION_FAIL , MESSAGE_PRIORITY_MED, s1ap_ue_ctxt_modification_fail_t , s1ap_ue_ctxt_modification_fail)
/* S1AP -> RRC messages */
MESSAGE_DEF(S1AP_DOWNLINK_NAS , MESSAGE_PRIORITY_MED, s1ap_downlink_nas_t , s1ap_downlink_nas )
MESSAGE_DEF(S1AP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, s1ap_initial_context_setup_req_t , s1ap_initial_context_setup_req )
\ No newline at end of file
MESSAGE_DEF(S1AP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, s1ap_initial_context_setup_req_t , s1ap_initial_context_setup_req )
MESSAGE_DEF(S1AP_UE_CTXT_MODIFICATION_REQ , MESSAGE_PRIORITY_MED, s1ap_ue_ctxt_modification_req_t , s1ap_ue_ctxt_modification_req)
MESSAGE_DEF(S1AP_PAGING_IND , MESSAGE_PRIORITY_MED, s1ap_paging_ind_t , s1ap_paging_ind )
/* S1AP <-> RRC messages (can be initiated either by MME or eNB) */
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_REQ , MESSAGE_PRIORITY_MED, s1ap_ue_release_req_t , s1ap_ue_release_req)
......@@ -4,14 +4,20 @@
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
#define S1AP_NAS_FIRST_REQ(mSGpTR) (mSGpTR)->msg.s1ap_nas_first_req
#define S1AP_UPLINK_NAS(mSGpTR) (mSGpTR)->msg.s1ap_uplink_nas
#define S1AP_UE_CAPABILITIES_IND(mSGpTR) (mSGpTR)->msg.s1ap_ue_cap_info_ind
#define S1AP_INITIAL_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->msg.s1ap_initial_context_setup_resp
#define S1AP_INITIAL_CONTEXT_SETUP_FAIL(mSGpTR) (mSGpTR)->msg.s1ap_initial_context_setup_fail
#define S1AP_DOWNLINK_NAS(mSGpTR) (mSGpTR)->msg.s1ap_downlink_nas
#define S1AP_INITIAL_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->msg.s1ap_initial_context_setup_req
#define S1AP_NAS_FIRST_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_nas_first_req
#define S1AP_UPLINK_NAS(mSGpTR) (mSGpTR)->ittiMsg.s1ap_uplink_nas
#define S1AP_UE_CAPABILITIES_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_cap_info_ind
#define S1AP_INITIAL_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_resp
#define S1AP_INITIAL_CONTEXT_SETUP_FAIL(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_fail
#define S1AP_UE_CONTEXT_RELEASE_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_release_resp
#define S1AP_NAS_NON_DELIVERY_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_nas_non_delivery_ind
#define S1AP_UE_CTXT_MODIFICATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_resp
#define S1AP_UE_CTXT_MODIFICATION_FAIL(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_fail
#define S1AP_DOWNLINK_NAS(mSGpTR) (mSGpTR)->ittiMsg.s1ap_downlink_nas
#define S1AP_INITIAL_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_req
#define S1AP_UE_CTXT_MODIFICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_req
#define S1AP_PAGIND_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_paging_ind
//-------------------------------------------------------------------------------------------//
......@@ -24,9 +30,28 @@ typedef enum paging_drx_e {
PAGING_DRX_32 = 0x0,
PAGING_DRX_64 = 0x1,
PAGING_DRX_128 = 0x2,
PAGING_DRX_256 = 0x3,
PAGING_DRX_256 = 0x3
} paging_drx_t;
/* Lower value codepoint
* indicates higher priority.
*/
typedef enum paging_priority_s {
PAGING_PRIO_LEVEL1 = 0,
PAGING_PRIO_LEVEL2 = 1,
PAGING_PRIO_LEVEL3 = 2,
PAGING_PRIO_LEVEL4 = 3,
PAGING_PRIO_LEVEL5 = 4,
PAGING_PRIO_LEVEL6 = 5,
PAGING_PRIO_LEVEL7 = 6,
PAGING_PRIO_LEVEL8 = 7
} paging_priority_t;
typedef enum cn_domain_s {
CN_DOMAIN_PS = 1,
CN_DOMAIN_CS = 2
} cn_domain_t;
typedef struct net_ip_address_s {
unsigned ipv4:1;
unsigned ipv6:1;
......@@ -45,7 +70,7 @@ typedef enum priority_level_s {
PRIORITY_LEVEL_SPARE = 0,
PRIORITY_LEVEL_HIGHEST = 1,
PRIORITY_LEVEL_LOWEST = 14,
PRIORITY_LEVEL_NO_PRIORITY = 15,
PRIORITY_LEVEL_NO_PRIORITY = 15
} priority_level_t;
typedef enum {
......@@ -82,6 +107,7 @@ typedef struct security_capabilities_s {
#define S1AP_TRANSPORT_LAYER_ADDRESS_SIZE (160 / 8)
#define S1AP_MAX_NB_MME_IP_ADDRESS 10
#define S1AP_IMSI_LENGTH 16
/* Security key length used within eNB
* Even if only 16 bytes will be effectively used,
......@@ -95,11 +121,14 @@ typedef struct security_capabilities_s {
* 'Mobile Originating'. Defined in TS 36.331.
*/
typedef enum rrc_establishment_cause_e {
RRC_CAUSE_EMERGENCY = 0x0,
RRC_CAUSE_HIGH_PRIO_ACCESS = 0x1,
RRC_CAUSE_MT_ACCESS = 0x2,
RRC_CAUSE_MO_SIGNALLING = 0x3,
RRC_CAUSE_MO_DATA = 0x4,
RRC_CAUSE_EMERGENCY = 0x0,
RRC_CAUSE_HIGH_PRIO_ACCESS = 0x1,
RRC_CAUSE_MT_ACCESS = 0x2,
RRC_CAUSE_MO_SIGNALLING = 0x3,
RRC_CAUSE_MO_DATA = 0x4,
#if defined(UPDATE_RELEASE_10)
RRC_CAUSE_DELAY_TOLERANT_ACCESS = 0x5,
#endif
RRC_CAUSE_LAST
} rrc_establishment_cause_t;
......@@ -115,8 +144,22 @@ typedef struct s_tmsi_s {
uint32_t m_tmsi;
} s_tmsi_t;
typedef enum ue_paging_identity_presenceMask_e {
UE_PAGING_IDENTITY_NONE = 0,
UE_PAGING_IDENTITY_imsi = (1 << 1),
UE_PAGING_IDENTITY_s_tmsi = (1 << 2),
} ue_paging_identity_presenceMask_t;
typedef struct ue_paging_identity_s {
ue_paging_identity_presenceMask_t presenceMask;
union {
char imsi[S1AP_IMSI_LENGTH];
s_tmsi_t s_tmsi;
} choice;
} ue_paging_identity_t;
typedef enum ue_identities_presenceMask_e {
UE_IDENTITIES_NONE = 0,
UE_IDENTITIES_NONE = 0,
UE_IDENTITIES_s_tmsi = 1 << 1,
UE_IDENTITIES_gummei = 1 << 2,
} ue_identities_presenceMask_t;
......@@ -297,11 +340,73 @@ typedef struct s1ap_initial_context_setup_fail_s {
unsigned eNB_ue_s1ap_id:24;
/* TODO add cause */
} s1ap_initial_context_setup_fail_t;
} s1ap_initial_context_setup_fail_t, s1ap_ue_ctxt_modification_fail_t;
typedef struct s1ap_ue_cap_info_ind_s {
unsigned eNB_ue_s1ap_id:24;
ue_radio_cap_t ue_radio_cap;
} s1ap_ue_cap_info_ind_t;
typedef struct s1ap_ue_release_req_s {
unsigned eNB_ue_s1ap_id:24;
/* TODO: add cause */
} s1ap_ue_release_req_t, s1ap_ue_release_resp_t;
typedef enum s1ap_ue_ctxt_modification_present_s {
S1AP_UE_CONTEXT_MODIFICATION_SECURITY_KEY = (1 << 0),
S1AP_UE_CONTEXT_MODIFICATION_UE_AMBR = (1 << 1),
S1AP_UE_CONTEXT_MODIFICATION_UE_SECU_CAP = (1 << 2),
} s1ap_ue_ctxt_modification_present_t;
typedef struct s1ap_ue_ctxt_modification_req_s {
unsigned eNB_ue_s1ap_id:24;
/* Bit-mask of possible present parameters */
s1ap_ue_ctxt_modification_present_t present;
/* Following fields are optionnaly present */
/* Security key */
uint8_t security_key[SECURITY_KEY_LENGTH];
/* UE aggregate maximum bitrate */
ambr_t ue_ambr;
/* Security capabilities */
security_capabilities_t security_capabilities;
} s1ap_ue_ctxt_modification_req_t;
typedef struct s1ap_ue_ctxt_modification_resp_s {
unsigned eNB_ue_s1ap_id:24;
} s1ap_ue_ctxt_modification_resp_t;
typedef enum s1ap_paging_ind_present_s {
S1AP_PAGING_IND_PAGING_DRX = (1 << 0),
S1AP_PAGING_IND_PAGING_PRIORITY = (1 << 1),
} s1ap_paging_ind_present_t;
typedef struct s1ap_paging_ind_s {
/* UE identity index value.
* Specified in 3GPP TS 36.304
*/
unsigned ue_index_value:10;
/* UE paging identity */
ue_paging_identity_t ue_paging_identity;
/* Indicates origin of paging */
cn_domain_t cn_domain;
/* Optional fields */
paging_drx_t paging_drx;
paging_priority_t paging_priority;
} s1ap_paging_ind_t;
typedef struct s1ap_nas_non_delivery_ind_s {
unsigned eNB_ue_s1ap_id:24;
nas_pdu_t nas_pdu;
/* TODO: add cause */
} s1ap_nas_non_delivery_ind_t;
#endif /* S1AP_MESSAGES_TYPES_H_ */
......@@ -1987,7 +1987,7 @@ OAI_UECapability_t *fill_ue_capability() {
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_UE, RRC_UE_EUTRA_CAPABILITY);
memcpy (&message_p->msg, (void *) UE_EUTRA_Capability, sizeof(RrcUeEutraCapability));
memcpy (&message_p->ittiMsg, (void *) UE_EUTRA_Capability, sizeof(RrcUeEutraCapability));
itti_send_msg_to_task (TASK_UNKNOWN, NB_eNB_INST, message_p);
}
......
......@@ -336,7 +336,7 @@ int rrc_ue_decode_ccch(u8 Mod_id, u32 frame, SRB_INFO *Srb_info, u8 eNB_index){
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_UE, RRC_DL_CCCH_MESSAGE);
memcpy (&message_p->msg, (void *) dl_ccch_msg, sizeof(RrcDlCcchMessage));
memcpy (&message_p->ittiMsg, (void *) dl_ccch_msg, sizeof(RrcDlCcchMessage));
itti_send_msg_to_task (TASK_UNKNOWN, Mod_id + NB_eNB_INST, message_p);
}
......@@ -1341,7 +1341,7 @@ void rrc_ue_decode_dcch(u8 Mod_id,u32 frame,u8 Srb_id, u8 *Buffer,u8 eNB_index)
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_UE, RRC_DL_DCCH_MESSAGE);
memcpy (&message_p->msg, (void *) dl_dcch_msg, sizeof(RrcDlDcchMessage));
memcpy (&message_p->ittiMsg, (void *) dl_dcch_msg, sizeof(RrcDlDcchMessage));
itti_send_msg_to_task (TASK_UNKNOWN, Mod_id + NB_eNB_INST, message_p);
}
......@@ -1510,7 +1510,7 @@ int decode_BCCH_DLSCH_Message(u8 Mod_id,u32 frame,u8 eNB_index,u8 *Sdu,u8 Sdu_le
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_UE, RRC_DL_BCCH_MESSAGE);
memcpy (&message_p->msg, (void *) bcch_message, sizeof(RrcDlBcchMessage));
memcpy (&message_p->ittiMsg, (void *) bcch_message, sizeof(RrcDlBcchMessage));
itti_send_msg_to_task (TASK_UNKNOWN, Mod_id + NB_eNB_INST, message_p);
}
......
......@@ -2512,7 +2512,7 @@ int rrc_eNB_decode_ccch (u8 Mod_id, u32 frame, SRB_INFO * Srb_info)
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_UL_CCCH_MESSAGE);
memcpy (&message_p->msg, (void *) ul_ccch_msg, sizeof(RrcUlCcchMessage));
memcpy (&message_p->ittiMsg, (void *) ul_ccch_msg, sizeof(RrcUlCcchMessage));
itti_send_msg_to_task (TASK_UNKNOWN, Mod_id, message_p);
}
......@@ -2712,7 +2712,7 @@ int rrc_eNB_decode_dcch (u8 Mod_id, u32 frame, u8 Srb_id, u8 UE_index,
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_UL_DCCH_MESSAGE);
memcpy (&message_p->msg, (void *) ul_dcch_msg, sizeof(RrcUlDcchMessage));
memcpy (&message_p->ittiMsg, (void *) ul_dcch_msg, sizeof(RrcUlDcchMessage));
itti_send_msg_to_task (TASK_UNKNOWN, Mod_id, message_p);
}
......
......@@ -686,23 +686,23 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
case LOG_ALERT:
case LOG_CRIT:
case LOG_ERR:
message_msg_p = (char *) &message_p->msg.error_log;
message_msg_p = (char *) &message_p->ittiMsg.error_log;
break;
case LOG_WARNING:
message_msg_p = (char *) &message_p->msg.warning_log;
message_msg_p = (char *) &message_p->ittiMsg.warning_log;
break;
case LOG_NOTICE:
message_msg_p = (char *) &message_p->msg.notice_log;
message_msg_p = (char *) &message_p->ittiMsg.notice_log;
break;
case LOG_INFO:
message_msg_p = (char *) &message_p->msg.info_log;
message_msg_p = (char *) &message_p->ittiMsg.info_log;
break;
default:
message_msg_p = (char *) &message_p->msg.debug_log;
message_msg_p = (char *) &message_p->ittiMsg.debug_log;
break;
}
memcpy(message_msg_p, log_start, message_string_size);
......
......@@ -412,7 +412,7 @@ void *l2l1_task(void *args_p) {
/* FIXME: following parameters should be setup by eNB applicative layer ? */
message_p = itti_alloc_new_message(TASK_L2L1, S1AP_REGISTER_ENB);
s1ap_register_eNB = &message_p->msg.s1ap_register_eNB;
s1ap_register_eNB = &message_p->ittiMsg.s1ap_register_eNB;
hash = s1ap_generate_eNB_id();
......
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