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