Commit 6c4ce5f9 authored by Cedric Roux's avatar Cedric Roux

- Fixed ITTI calls for EPC

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4414 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 5e258662
......@@ -355,7 +355,8 @@ static void *gtpv1u_thread(void *args)
itti_receive_msg(TASK_GTPV1_U, &received_message_p);
DevAssert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
switch (ITTI_MSG_ID(received_message_p))
{
case GTPV1U_CREATE_TUNNEL_REQ: {
gtpv1u_create_s1u_tunnel(&received_message_p->msg.gtpv1uCreateTunnelReq);
}
......@@ -452,9 +453,9 @@ static void *gtpv1u_thread(void *args)
nwGtpv1uProcessTimeout(&received_message_p->msg.timer_has_expired.arg);
break;
default: {
GTPU_ERROR("Unkwnon message ID %s:%d\n",
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
GTPU_ERROR("Unkwnon message ID %d:%s\n",
ITTI_MSG_ID(received_message_p),
ITTI_MSG_NAME(received_message_p));
}
break;
}
......
......@@ -59,7 +59,9 @@ void *mme_app_thread(void *args)
*/
itti_receive_msg(TASK_MME_APP, &received_message_p);
DevAssert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
switch (ITTI_MSG_ID(received_message_p))
{
case S6A_AUTH_INFO_ANS: {
/* We received the authentication vectors from HSS, trigger a ULR
* for now. Normaly should trigger an authentication procedure with UE.
......@@ -91,9 +93,8 @@ void *mme_app_thread(void *args)
} break;
default: {
MME_APP_DEBUG("Unkwnon message ID %s:%d\n",
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
MME_APP_DEBUG("Unkwnon message ID %d:%s\n",
ITTI_MSG_ID(received_message_p), ITTI_MSG_NAME(received_message_p));
} break;
}
free(received_message_p);
......
......@@ -28,7 +28,8 @@ static void *nas_intertask_interface(void *args_p)
next_message:
itti_receive_msg(TASK_NAS, &received_message_p);
switch(received_message_p->header.messageId) {
switch (ITTI_MSG_ID(received_message_p))
{
case NAS_CONNECTION_ESTABLISHMENT_IND: {
#if defined(DISABLE_USE_NAS)
MessageDef *message_p;
......@@ -79,9 +80,9 @@ next_message:
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
} break;
default: {
NAS_DEBUG("Unkwnon message ID %s:%d\n",
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
NAS_DEBUG("Unkwnon message ID %d:%s\n",
ITTI_MSG_ID(received_message_p),
ITTI_MSG_NAME(received_message_p));
} break;
}
free(received_message_p);
......
......@@ -69,7 +69,7 @@ static
NwRcT s11_mme_ulp_process_stack_req_cb(
NwGtpv2cUlpHandleT hUlp, NwGtpv2cUlpApiT *pUlpApi)
{
NwRcT rc = NW_OK;
// NwRcT rc = NW_OK;
int ret = 0;
DevAssert(pUlpApi != NULL);
......@@ -179,7 +179,8 @@ static void *s11_mme_thread(void *args)
itti_receive_msg(TASK_S11, &received_message_p);
assert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
switch (ITTI_MSG_ID(received_message_p))
{
case SGW_CREATE_SESSION_REQUEST: {
s11_mme_create_session_request(
&s11_mme_stack_handle,
......@@ -208,9 +209,9 @@ static void *s11_mme_thread(void *args)
received_message_p->msg.timer_has_expired.arg) == NW_OK);
} break;
default: {
S11_ERROR("Unkwnon message ID %s:%d\n",
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
S11_ERROR("Unkwnon message ID %d:%s\n",
ITTI_MSG_ID(received_message_p),
ITTI_MSG_NAME(received_message_p));
}
break;
}
......
......@@ -191,7 +191,8 @@ static void *s11_sgw_thread(void *args)
itti_receive_msg(TASK_S11, &received_message_p);
assert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
switch (ITTI_MSG_ID(received_message_p))
{
case UDP_DATA_IND: {
/* We received new data to handle from the UDP layer */
NwRcT rc;
......@@ -234,9 +235,8 @@ static void *s11_sgw_thread(void *args)
DevAssert(nwGtpv2cProcessTimeout(received_message_p->msg.timer_has_expired.arg) == NW_OK);
} break;
default: {
S11_ERROR("Unkwnon message ID %s:%d\n",
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
S11_ERROR("Unkwnon message ID %d:%s\n",
ITTI_MSG_ID(received_message_p), ITTI_MSG_NAME(received_message_p));
}
break;
}
......
......@@ -99,8 +99,10 @@ void *s1ap_mme_thread(void *args)
* message is sent to the task.
*/
itti_receive_msg(TASK_S1AP, &received_message_p);
assert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
DevAssert(received_message_p != NULL);
switch (ITTI_MSG_ID(received_message_p))
{
case S1AP_SCTP_NEW_MESSAGE_IND: {
/* New message received from SCTP layer.
* Decode and handle it.
......@@ -143,9 +145,8 @@ void *s1ap_mme_thread(void *args)
s1ap_handle_timer_expiry(&received_message_p->msg.timer_has_expired);
} break;
default: {
S1AP_DEBUG("Unkwnon message ID %s:%d\n",
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
S1AP_DEBUG("Unkwnon message ID %d:%s\n",
ITTI_MSG_ID(received_message_p), ITTI_MSG_NAME(received_message_p));
} break;
}
free(received_message_p);
......
......@@ -70,22 +70,22 @@ static int s1ap_mme_decode_initiating(
case S1ap_ProcedureCode_id_S1Setup: {
ret = s1ap_decode_s1ap_s1setuprequesties(&message->msg.s1ap_S1SetupRequestIEs,
&initiating_p->value);
s1ap_xer_print_s1ap_s1setuprequest(stdout, message);
// s1ap_xer_print_s1ap_s1setuprequest(stdout, message);
} break;
case S1ap_ProcedureCode_id_initialUEMessage: {
ret = s1ap_decode_s1ap_initialuemessageies(&message->msg.s1ap_InitialUEMessageIEs,
&initiating_p->value);
s1ap_xer_print_s1ap_initialuemessage(stdout, message);
// s1ap_xer_print_s1ap_initialuemessage(stdout, message);
} break;
case S1ap_ProcedureCode_id_UEContextReleaseRequest: {
ret = s1ap_decode_s1ap_uecontextreleaserequesties(
&message->msg.s1ap_UEContextReleaseRequestIEs, &initiating_p->value);
s1ap_xer_print_s1ap_uecontextreleaserequest(stdout, message);
// s1ap_xer_print_s1ap_uecontextreleaserequest(stdout, message);
} break;
case S1ap_ProcedureCode_id_UECapabilityInfoIndication: {
ret = s1ap_decode_s1ap_uecapabilityinfoindicationies(
&message->msg.s1ap_UECapabilityInfoIndicationIEs, &initiating_p->value);
s1ap_xer_print_s1ap_uecapabilityinfoindication(stdout, message);
// s1ap_xer_print_s1ap_uecapabilityinfoindication(stdout, message);
} break;
// case S1ap_ProcedureCode_id_InitialContextSetup:
// return s1ap_decode_initialcontextsetuprequesties(&message->msg.initialContextSetupRequestIEs, &initiating_p->value);
......
......@@ -77,7 +77,9 @@ void *s6a_thread(void *args)
*/
itti_receive_msg(TASK_S6A, &received_message_p);
DevAssert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
switch (ITTI_MSG_ID(received_message_p))
{
case S6A_UPDATE_LOCATION_REQ: {
s6a_generate_update_location(&received_message_p->msg.s6a_update_location_req);
} break;
......@@ -85,9 +87,8 @@ void *s6a_thread(void *args)
s6a_generate_authentication_info_req(&received_message_p->msg.s6a_auth_info_req);
} break;
default: {
S6A_DEBUG("Unkwnon message ID %s:%d\n",
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
S6A_DEBUG("Unkwnon message ID %d:%s\n",
ITTI_MSG_ID(received_message_p), ITTI_MSG_NAME(received_message_p));
} break;
}
free(received_message_p);
......
......@@ -588,7 +588,8 @@ static void *sctp_intertask_interface(void *args_p)
while(1) {
MessageDef *received_message_p;
itti_receive_msg(TASK_SCTP, &received_message_p);
switch(received_message_p->header.messageId) {
switch (ITTI_MSG_ID(received_message_p))
{
case SCTP_INIT_MSG: {
SCTP_DEBUG("Received SCTP_INIT_MSG\n");
/* We received a new connection request */
......@@ -615,9 +616,9 @@ static void *sctp_intertask_interface(void *args_p)
while(i--);
} break;
default: {
SCTP_DEBUG("Unkwnon message ID %s:%d\n",
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
SCTP_DEBUG("Unkwnon message ID %d:%s\n",
ITTI_MSG_ID(received_message_p),
ITTI_MSG_NAME(received_message_p));
} break;
}
free(received_message_p);
......
......@@ -20,6 +20,9 @@
#include "sgw_lite_ie_defs.h"
#include "ip_forward_messages_types.h"
# define SGI_IF_DEBUG(x, args...)
# define SGI_IF_ERROR(x, args...)
# define SGI_IF_WARNING(x, args...)
//-----------------------------------------------------------------------------
#ifndef SGI_IF_DEBUG
# define SGI_IF_DEBUG(x, args...) do { fprintf(stdout, "[SGI_IF][D]"x, ##args); } \
......@@ -30,8 +33,8 @@
while(0)
#endif
#ifndef SGI_IF_WARNING
# define SGI_IF_WARNING(x, args...) do { fprintf(stderr, "[SGI_IF][W]"x, ##args); } \
while(0)
# define SGI_IF_WARNING(x, args...) do { fprintf(stderr, "[SGI_IF][W]"x, ##args); } \
while(0)
#endif
// refer to 3GPP TS 23.203 V10.6.0 (2012-03) page 33
......
......@@ -41,6 +41,7 @@
#include <net/if.h>
//-----------------------------------------------------------------------------
#include "assertions.h"
#include "mme_config.h"
#include "intertask_interface.h"
#include "sgi.h"
......@@ -73,8 +74,11 @@ static void* sgi_task_thread(void *args_p)
*/
MessageDef *received_message_p;
itti_receive_msg(TASK_FW_IP, &received_message_p);
assert(received_message_p != NULL);
switch(received_message_p->header.messageId) {
DevAssert(received_message_p != NULL);
switch (ITTI_MSG_ID(received_message_p))
{
case GTPV1U_TUNNEL_DATA_IND: {
/* We received data from GTPV1_U incoming from an UE.
* Forward it host adapter.
......@@ -104,7 +108,8 @@ static void* sgi_task_thread(void *args_p)
}
break;
default: {
SGI_IF_ERROR("Unkwnon message ID %d\n", received_message_p->header.messageId);
SGI_IF_ERROR("Unkwnon message ID %d:%s\n",
ITTI_MSG_ID(received_message_p), ITTI_MSG_NAME(received_message_p));
}
break;
}
......
......@@ -46,10 +46,13 @@ sgw_app_t sgw_app;
static void *sgw_lite_intertask_interface(void *args_p)
{
itti_mark_task_ready(TASK_SPGW_APP);
while(1) {
MessageDef *received_message_p;
itti_receive_msg(TASK_SPGW_APP, &received_message_p);
switch(received_message_p->header.messageId) {
switch (ITTI_MSG_ID(received_message_p))
{
case SGW_CREATE_SESSION_REQUEST: {
/* We received a create session request from MME (with GTP abstraction here)
* procedures might be:
......@@ -88,9 +91,8 @@ static void *sgw_lite_intertask_interface(void *args_p)
} break;
default: {
SPGW_APP_DEBUG("Unkwnon message ID %s:%d\n",
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
SPGW_APP_DEBUG("Unkwnon message ID %d:%s\n",
ITTI_MSG_ID(received_message_p), ITTI_MSG_NAME(received_message_p));
} break;
}
free(received_message_p);
......
......@@ -202,12 +202,13 @@ static void *udp_intertask_interface(void *args_p)
itti_receive_msg(TASK_UDP, &received_message_p);
DevAssert(received_message_p != NULL);
switch (received_message_p->header.messageId) {
switch (ITTI_MSG_ID(received_message_p))
{
case UDP_INIT: {
udp_init_t *udp_init_p;
udp_init_p = &received_message_p->msg.udp_init;
udp_create_socket(udp_init_p->port, udp_init_p->address,
received_message_p->header.originTaskId);
ITTI_MSG_ORIGIN_ID(received_message_p));
} break;
case UDP_DATA_REQ: {
int udp_sd = -1;
......@@ -226,11 +227,11 @@ static void *udp_intertask_interface(void *args_p)
peer_addr.sin_addr.s_addr = udp_data_req_p->peer_address;
pthread_mutex_lock(&udp_socket_list_mutex);
udp_sock_p = udp_get_socket_desc(received_message_p->header.originTaskId);
udp_sock_p = udp_get_socket_desc(ITTI_MSG_ORIGIN_ID(received_message_p));
if (udp_sock_p == NULL) {
UDP_ERROR("Failed to retrieve the udp socket descriptor "
"associated with task %d\n", received_message_p->header.originTaskId);
"associated with task %d\n", ITTI_MSG_ORIGIN_ID(received_message_p));
pthread_mutex_unlock(&udp_socket_list_mutex);
if (udp_data_req_p->buffer) {
free(udp_data_req_p->buffer);
......@@ -258,9 +259,8 @@ static void *udp_intertask_interface(void *args_p)
case MESSAGE_TEST: {
} break;
default: {
UDP_DEBUG("Unkwnon message ID %s:%d\n",
itti_get_message_name(received_message_p->header.messageId),
received_message_p->header.messageId);
UDP_DEBUG("Unkwnon message ID %d:%s\n",
ITTI_MSG_ID(received_message_p), ITTI_MSG_NAME(received_message_p));
} break;
}
on_error:
......
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