Merge remote-tracking branch 'origin/itti-enhancement' into integration_2021_wk04_b
This commit is contained in:
@@ -135,7 +135,7 @@ static int gtpv1u_eNB_send_init_udp(const Gtpv1uS1Req *req) {
|
||||
// Create and alloc new message
|
||||
MessageDef *message_p;
|
||||
struct in_addr addr= {0};
|
||||
message_p = itti_alloc_new_message(TASK_GTPV1_U, UDP_INIT);
|
||||
message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, UDP_INIT);
|
||||
|
||||
if (message_p == NULL) {
|
||||
return -1;
|
||||
@@ -184,7 +184,7 @@ NwGtpv1uRcT gtpv1u_eNB_send_udp_msg(
|
||||
// Create and alloc new message
|
||||
MessageDef *message_p = NULL;
|
||||
udp_data_req_t *udp_data_req_p = NULL;
|
||||
message_p = itti_alloc_new_message(TASK_GTPV1_U, UDP_DATA_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, UDP_DATA_REQ);
|
||||
|
||||
if (message_p) {
|
||||
#if defined(LOG_GTPU) && LOG_GTPU > 0
|
||||
@@ -285,7 +285,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
|
||||
//ue_context_p->ue_context.handover_info->state = HO_END_MARKER;
|
||||
MessageDef *msg;
|
||||
// Configure end marker
|
||||
msg = itti_alloc_new_message(TASK_GTPV1_U, GTPV1U_ENB_END_MARKER_REQ);
|
||||
msg = itti_alloc_new_message(TASK_GTPV1_U, 0, GTPV1U_ENB_END_MARKER_REQ);
|
||||
GTPV1U_ENB_END_MARKER_REQ(msg).buffer = itti_malloc(TASK_GTPV1_U, TASK_GTPV1_U, GTPU_HEADER_OVERHEAD_MAX + buffer_len);
|
||||
memcpy(>PV1U_ENB_END_MARKER_REQ(msg).buffer[GTPU_HEADER_OVERHEAD_MAX], buffer, buffer_len);
|
||||
GTPV1U_ENB_END_MARKER_REQ(msg).length = buffer_len;
|
||||
@@ -358,7 +358,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
|
||||
if (ue_context_p->ue_context.handover_info->state == HO_COMPLETE) {
|
||||
MessageDef *msg;
|
||||
// Configure target
|
||||
msg = itti_alloc_new_message(TASK_GTPV1_U, GTPV1U_ENB_DATA_FORWARDING_REQ);
|
||||
msg = itti_alloc_new_message(TASK_GTPV1_U, 0, GTPV1U_ENB_DATA_FORWARDING_REQ);
|
||||
GTPV1U_ENB_DATA_FORWARDING_REQ(msg).buffer = itti_malloc(TASK_GTPV1_U, TASK_GTPV1_U, GTPU_HEADER_OVERHEAD_MAX + buffer_len);
|
||||
memcpy(>PV1U_ENB_DATA_FORWARDING_REQ(msg).buffer[GTPU_HEADER_OVERHEAD_MAX], buffer, buffer_len);
|
||||
GTPV1U_ENB_DATA_FORWARDING_REQ(msg).length = buffer_len;
|
||||
@@ -1122,7 +1122,7 @@ int gtpv1u_delete_s1u_tunnel(
|
||||
hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS;
|
||||
teid_t teid_eNB = 0;
|
||||
int erab_index = 0;
|
||||
message_p = itti_alloc_new_message(TASK_GTPV1_U, GTPV1U_ENB_DELETE_TUNNEL_RESP);
|
||||
message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, GTPV1U_ENB_DELETE_TUNNEL_RESP);
|
||||
GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti = req_pP->rnti;
|
||||
GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).status = 0;
|
||||
hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, req_pP->rnti, (void **)>pv1u_ue_data_p);
|
||||
@@ -1289,7 +1289,7 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) {
|
||||
itti_receive_msg(TASK_GTPV1_U, &received_message_p);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_IN);
|
||||
DevAssert(received_message_p != NULL);
|
||||
instance = ITTI_MSG_INSTANCE(received_message_p);
|
||||
instance = ITTI_MSG_DESTINATION_INSTANCE(received_message_p);
|
||||
//msg_name_p = ITTI_MSG_NAME(received_message_p);
|
||||
|
||||
switch (ITTI_MSG_ID(received_message_p)) {
|
||||
|
||||
+20
-20
@@ -136,7 +136,7 @@ void m3ap_MCE_handle_sctp_association_resp(instance_t instance, sctp_new_associa
|
||||
//dump_trees_m3();
|
||||
|
||||
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
|
||||
M3AP_WARN("Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
|
||||
M3AP_WARN("Received unsuccessful result for SCTP association (%u), instance %ld, cnx_id %u\n",
|
||||
sctp_new_association_resp->sctp_state,
|
||||
instance,
|
||||
sctp_new_association_resp->ulp_cnx_id);
|
||||
@@ -229,7 +229,7 @@ int m3ap_MCE_init_sctp (m3ap_MCE_instance_t *instance_p,
|
||||
sctp_init_t *sctp_init = NULL;
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(local_ip_addr != NULL);
|
||||
message = itti_alloc_new_message (TASK_M3AP_MCE, SCTP_INIT_MSG_MULTI_REQ);
|
||||
message = itti_alloc_new_message (TASK_M3AP_MCE, 0, SCTP_INIT_MSG_MULTI_REQ);
|
||||
sctp_init = &message->ittiMsg.sctp_init_multi;
|
||||
sctp_init->port = mce_port_for_M3C;
|
||||
sctp_init->ppid = M3AP_SCTP_PPID;
|
||||
@@ -263,7 +263,7 @@ static void m3ap_MCE_register_MCE(m3ap_MCE_instance_t *instance_p,
|
||||
m3ap_MCE_data_t *m3ap_mce_data = NULL;
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(target_MCE_ip_address != NULL);
|
||||
message = itti_alloc_new_message(TASK_M3AP_MCE, SCTP_NEW_ASSOCIATION_REQ_MULTI);
|
||||
message = itti_alloc_new_message(TASK_M3AP_MCE, 0, SCTP_NEW_ASSOCIATION_REQ_MULTI);
|
||||
sctp_new_association_req = &message->ittiMsg.sctp_new_association_req_multi;
|
||||
sctp_new_association_req->port = mce_port_for_M3C;
|
||||
sctp_new_association_req->ppid = M3AP_SCTP_PPID;
|
||||
@@ -313,7 +313,7 @@ void m3ap_MCE_handle_register_MCE(instance_t instance,
|
||||
DevCheck(new_instance->tac == m3ap_register_MCE->tac, new_instance->tac, m3ap_register_MCE->tac, 0);
|
||||
DevCheck(new_instance->mcc == m3ap_register_MCE->mcc, new_instance->mcc, m3ap_register_MCE->mcc, 0);
|
||||
DevCheck(new_instance->mnc == m3ap_register_MCE->mnc, new_instance->mnc, m3ap_register_MCE->mnc, 0);
|
||||
M3AP_WARN("MCE[%d] already registered\n", instance);
|
||||
M3AP_WARN("MCE[%ld] already registered\n", instance);
|
||||
} else {
|
||||
new_instance = calloc(1, sizeof(m3ap_MCE_instance_t));
|
||||
DevAssert(new_instance != NULL);
|
||||
@@ -357,7 +357,7 @@ void m3ap_MCE_handle_register_MCE(instance_t instance,
|
||||
new_instance->mce_port_for_M3C = m3ap_register_MCE->mme_port_for_M3C;
|
||||
/* Add the new instance to the list of MCE (meaningfull in virtual mode) */
|
||||
m3ap_MCE_insert_new_instance(new_instance);
|
||||
M3AP_INFO("Registered new MCE[%d] and %s MCE id %u\n",
|
||||
M3AP_INFO("Registered new MCE[%ld] and %s MCE id %u\n",
|
||||
instance,
|
||||
m3ap_register_MCE->cell_type == CELL_MACRO_ENB ? "macro" : "home",
|
||||
m3ap_register_MCE->MCE_id);
|
||||
@@ -370,7 +370,7 @@ void m3ap_MCE_handle_register_MCE(instance_t instance,
|
||||
return;
|
||||
}
|
||||
|
||||
M3AP_INFO("MCE[%d] MCE id %u acting as a listner (server)\n",
|
||||
M3AP_INFO("MCE[%ld] MCE id %u acting as a listner (server)\n",
|
||||
instance, m3ap_register_MCE->MCE_id);
|
||||
}
|
||||
}
|
||||
@@ -397,7 +397,7 @@ void m3ap_MCE_handle_sctp_init_msg_multi_cnf(
|
||||
/* Trying to connect to the provided list of MCE ip address */
|
||||
|
||||
for (index = 0; index < instance->nb_m3; index++) {
|
||||
M3AP_INFO("MCE[%d] MCE id %u acting as an initiator (client)\n",
|
||||
M3AP_INFO("MCE[%ld] MCE id %u acting as an initiator (client)\n",
|
||||
instance_id, instance->MCE_id);
|
||||
m3ap_MCE_register_MCE(instance,
|
||||
&instance->target_mme_m3_ip_address[index],
|
||||
@@ -537,7 +537,7 @@ void *m3ap_MCE_task(void *arg) {
|
||||
switch (ITTI_MSG_ID(received_msg)) {
|
||||
case MESSAGE_TEST:
|
||||
// LOG_W(M3AP,"MCE Received Test Message ... TODO\n");
|
||||
// //MessageDef * message_p = itti_alloc_new_message(TASK_M3AP, MESSAGE_TEST);
|
||||
// //MessageDef * message_p = itti_alloc_new_message(TASK_M3AP, 0, MESSAGE_TEST);
|
||||
// //itti_send_msg_to_task(TASK_M2AP_ENB, 1/*ctxt_pP->module_id*/, message_p);
|
||||
//
|
||||
// asn_dec_rval_t dec_ret;
|
||||
@@ -577,78 +577,78 @@ void *m3ap_MCE_task(void *arg) {
|
||||
break;
|
||||
|
||||
case M3AP_SUBFRAME_PROCESS:
|
||||
m3ap_check_timers(ITTI_MESSAGE_GET_INSTANCE(received_msg));
|
||||
m3ap_check_timers(ITTI_MSG_DESTINATION_INSTANCE(received_msg));
|
||||
break;
|
||||
|
||||
case M3AP_REGISTER_MCE_REQ:
|
||||
LOG_I(M3AP,"MCE Received M3AP_REGISTER_MCE_REQ Message\n");
|
||||
|
||||
m3ap_MCE_handle_register_MCE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
m3ap_MCE_handle_register_MCE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&M3AP_REGISTER_MCE_REQ(received_msg));
|
||||
break;
|
||||
|
||||
case M3AP_MBMS_SESSION_START_RESP:
|
||||
LOG_I(M3AP,"MCE M3AP_MBMS_SESSION_START_RESP Message\n");
|
||||
MCE_send_MBMS_SESSION_START_RESPONSE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
MCE_send_MBMS_SESSION_START_RESPONSE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&M3AP_MBMS_SESSION_START_RESP(received_msg));
|
||||
|
||||
break;
|
||||
|
||||
case M3AP_MBMS_SESSION_STOP_RESP:
|
||||
LOG_I(M3AP,"MCE M3AP_MBMS_SESSION_STOP_RESP Message\n");
|
||||
MCE_send_MBMS_SESSION_STOP_RESPONSE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
MCE_send_MBMS_SESSION_STOP_RESPONSE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&M3AP_MBMS_SESSION_START_RESP(received_msg));
|
||||
|
||||
break;
|
||||
|
||||
case M3AP_MBMS_SESSION_UPDATE_RESP:
|
||||
LOG_I(M3AP,"MCE M3AP_MBMS_SESSION_UPDATE_RESP Message\n");
|
||||
//MCE_send_MBMS_SESSION_UPDATE_RESPONSE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
//MCE_send_MBMS_SESSION_UPDATE_RESPONSE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
//&M3AP_MBMS_SESSION_START_RESP(received_msg));
|
||||
|
||||
break;
|
||||
|
||||
|
||||
// case M3AP_HANDOVER_REQ:
|
||||
// m3ap_eNB_handle_handover_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// m3ap_eNB_handle_handover_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_HANDOVER_REQ(received_msg));
|
||||
// break;
|
||||
//
|
||||
// case M3AP_HANDOVER_REQ_ACK:
|
||||
// m3ap_eNB_handle_handover_req_ack(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// m3ap_eNB_handle_handover_req_ack(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_HANDOVER_REQ_ACK(received_msg));
|
||||
// break;
|
||||
//
|
||||
// case M3AP_UE_CONTEXT_RELEASE:
|
||||
// m3ap_eNB_ue_context_release(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// m3ap_eNB_ue_context_release(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_UE_CONTEXT_RELEASE(received_msg));
|
||||
// break;
|
||||
//
|
||||
case SCTP_INIT_MSG_MULTI_CNF:
|
||||
LOG_D(M3AP,"MCE Received SCTP_INIT_MSG_MULTI_CNF Message\n");
|
||||
|
||||
m3ap_MCE_handle_sctp_init_msg_multi_cnf(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
m3ap_MCE_handle_sctp_init_msg_multi_cnf(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_init_msg_multi_cnf);
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_RESP:
|
||||
LOG_D(M3AP,"MCE Received SCTP_NEW_ASSOCIATION_RESP Message\n");
|
||||
|
||||
m3ap_MCE_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
m3ap_MCE_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_resp);
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_IND:
|
||||
LOG_D(M3AP,"MCE Received SCTP_NEW_ASSOCIATION Message\n");
|
||||
|
||||
m3ap_MCE_handle_sctp_association_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
m3ap_MCE_handle_sctp_association_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_ind);
|
||||
break;
|
||||
|
||||
case SCTP_DATA_IND:
|
||||
LOG_D(M3AP,"MCE Received SCTP_DATA_IND Message\n");
|
||||
|
||||
m3ap_MCE_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
m3ap_MCE_handle_sctp_data_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_data_ind);
|
||||
break;
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ int m3ap_MCE_handle_message(instance_t instance, uint32_t assoc_id, int32_t stre
|
||||
}
|
||||
|
||||
/* Calling the right handler */
|
||||
LOG_I(M3AP, "Calling handler with instance %d\n",instance);
|
||||
LOG_I(M3AP, "Calling handler with instance %ld\n",instance);
|
||||
ret = (*m3ap_MCE_messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1])
|
||||
(instance, assoc_id, stream, &pdu);
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_M3AP_M3AP_PDU, &pdu);
|
||||
|
||||
@@ -74,7 +74,7 @@ int MCE_handle_MBMS_SESSION_START_REQUEST(instance_t instance,
|
||||
//
|
||||
// container = &pdu->choice.initiatingMessage.value.choice.SessionStartRequest;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MCE, M3AP_MBMS_SESSION_START_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MCE, 0, M3AP_MBMS_SESSION_START_REQ);
|
||||
|
||||
//
|
||||
// /* M3 Setup Request == Non UE-related procedure -> stream 0 */
|
||||
@@ -248,7 +248,7 @@ int MCE_handle_MBMS_SESSION_STOP_REQUEST(instance_t instance,
|
||||
//MCE_send_MBMS_SESSION_STOP_RESPONSE(instance,assoc_id);
|
||||
//}else
|
||||
//MCE_send_MBMS_SESSION_STOP_FAILURE(instance,assoc_id);
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MCE, M3AP_MBMS_SESSION_STOP_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MCE, 0, M3AP_MBMS_SESSION_STOP_REQ);
|
||||
|
||||
//
|
||||
// /* M3 Setup Request == Non UE-related procedure -> stream 0 */
|
||||
@@ -361,7 +361,7 @@ int MCE_handle_MBMS_SESSION_UPDATE_REQUEST(instance_t instance,
|
||||
//MCE_send_MBMS_SESSION_STOP_RESPONSE(instance,assoc_id);
|
||||
//}else
|
||||
//MCE_send_MBMS_SESSION_STOP_FAILURE(instance,assoc_id);
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MCE, M3AP_MBMS_SESSION_UPDATE_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MCE, 0, M3AP_MBMS_SESSION_UPDATE_REQ);
|
||||
|
||||
//
|
||||
// /* M3 Setup Request == Non UE-related procedure -> stream 0 */
|
||||
@@ -711,7 +711,7 @@ int MCE_handle_M3_SETUP_RESPONSE(instance_t instance,
|
||||
//int num_cells_to_activate = 0;
|
||||
//M3AP_Cells_to_be_Activated_List_Item_t *cell;
|
||||
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_M3AP_MCE, M3AP_SETUP_RESP);
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_M3AP_MCE, 0, M3AP_SETUP_RESP);
|
||||
|
||||
// LOG_D(M3AP, "M3AP: M3Setup-Resp: protocolIEs.list.count %d\n",
|
||||
// in->protocolIEs.list.count);
|
||||
|
||||
@@ -116,7 +116,7 @@ void dump_trees_m3(void)
|
||||
m3ap_MCE_instance_t *zz;
|
||||
STAILQ_FOREACH(zz, &m3ap_MCE_internal_data.m3ap_MCE_instances_head,
|
||||
m3ap_MCE_entries) {
|
||||
printf("here comes the tree (instance %d):\n---------------------------------------------\n", zz->instance);
|
||||
printf("here comes the tree (instance %ld):\n---------------------------------------------\n", zz->instance);
|
||||
dump_tree_m3(zz->m3ap_mce_head.rbh_root);
|
||||
printf("---------------------------------------------\n");
|
||||
}
|
||||
|
||||
+25
-25
@@ -105,7 +105,7 @@ void m3ap_MME_handle_sctp_association_resp(instance_t instance, sctp_new_associa
|
||||
DevAssert(sctp_new_association_resp != NULL);
|
||||
|
||||
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
|
||||
LOG_W(M3AP, "Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
|
||||
LOG_W(M3AP, "Received unsuccessful result for SCTP association (%u), instance %ld, cnx_id %u\n",
|
||||
sctp_new_association_resp->sctp_state,
|
||||
instance,
|
||||
sctp_new_association_resp->ulp_cnx_id);
|
||||
@@ -233,7 +233,7 @@ int m3ap_MME_init_sctp (m3ap_MME_instance_t *instance_p,
|
||||
sctp_init_t *sctp_init = NULL;
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(local_ip_addr != NULL);
|
||||
message = itti_alloc_new_message (TASK_M3AP_MME, SCTP_INIT_MSG_MULTI_REQ);
|
||||
message = itti_alloc_new_message (TASK_M3AP_MME, 0, SCTP_INIT_MSG_MULTI_REQ);
|
||||
sctp_init = &message->ittiMsg.sctp_init_multi;
|
||||
sctp_init->port = mme_port_for_M3C;
|
||||
sctp_init->ppid = M3AP_SCTP_PPID;
|
||||
@@ -267,7 +267,7 @@ static void m3ap_MME_register_MME(m3ap_MME_instance_t *instance_p,
|
||||
// m3ap_MME_data_t *m3ap_mme_data = NULL;
|
||||
// DevAssert(instance_p != NULL);
|
||||
// DevAssert(target_MME_ip_address != NULL);
|
||||
// message = itti_alloc_new_message(TASK_M3AP_MME, SCTP_NEW_ASSOCIATION_REQ_MULTI);
|
||||
// message = itti_alloc_new_message(TASK_M3AP_MME, 0, SCTP_NEW_ASSOCIATION_REQ_MULTI);
|
||||
// sctp_new_association_req = &message->ittiMsg.sctp_new_association_req_multi;
|
||||
// sctp_new_association_req->port = mme_port_for_M3C;
|
||||
// sctp_new_association_req->ppid = M3AP_SCTP_PPID;
|
||||
@@ -394,7 +394,7 @@ void m3ap_MME_handle_sctp_init_msg_multi_cnf(
|
||||
/* Trying to connect to the provided list of MME ip address */
|
||||
|
||||
for (index = 0; index < instance->nb_m3; index++) {
|
||||
M3AP_INFO("MME[%d] MME id %u acting as an initiator (client)\n",
|
||||
M3AP_INFO("MME[%ld] MME id %u acting as an initiator (client)\n",
|
||||
instance_id, instance->MME_id);
|
||||
m3ap_MME_register_MME(instance,
|
||||
&instance->target_mme_m3_ip_address[index],
|
||||
@@ -506,7 +506,7 @@ void MME_task_send_sctp_init_req(instance_t enb_id, m3ap_mme_sctp_req_t * m3ap_m
|
||||
|
||||
MessageDef *message_p = NULL;
|
||||
|
||||
message_p = itti_alloc_new_message (TASK_M3AP_MME, SCTP_INIT_MSG);
|
||||
message_p = itti_alloc_new_message (TASK_M3AP_MME, 0, SCTP_INIT_MSG);
|
||||
if(m3ap_mme_sctp_req==NULL) {
|
||||
LOG_I(M3AP, "M3AP_SCTP_REQ(create socket)\n");
|
||||
message_p->ittiMsg.sctp_init.port = M3AP_PORT_NUMBER;
|
||||
@@ -555,7 +555,7 @@ void *m3ap_MME_task(void *arg) {
|
||||
switch (ITTI_MSG_ID(received_msg)) {
|
||||
case MESSAGE_TEST:
|
||||
LOG_W(M3AP,"MME Received MESSAGE_TEST Message\n");
|
||||
//MessageDef * message_p = itti_alloc_new_message(TASK_M3AP_MME, MESSAGE_TEST);
|
||||
//MessageDef * message_p = itti_alloc_new_message(TASK_M3AP_MME, 0, MESSAGE_TEST);
|
||||
//itti_send_msg_to_task(TASK_M3AP, 1/*ctxt_pP->module_id*/, message_p);
|
||||
break;
|
||||
case TERMINATE_MESSAGE:
|
||||
@@ -564,31 +564,31 @@ void *m3ap_MME_task(void *arg) {
|
||||
break;
|
||||
|
||||
// case M3AP_SUBFRAME_PROCESS:
|
||||
// m3ap_check_timers(ITTI_MESSAGE_GET_INSTANCE(received_msg));
|
||||
// m3ap_check_timers(ITTI_MSG_DESTINATION_INSTANCE(received_msg));
|
||||
// break;
|
||||
//
|
||||
// case M3AP_REGISTER_MME_REQ:
|
||||
// LOG_W(M3AP,"MME Received M3AP_REGISTER_MME_REQ Message\n");
|
||||
// m3ap_MME_handle_register_MME(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// m3ap_MME_handle_register_MME(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_REGISTER_MME_REQ(received_msg));
|
||||
// break;
|
||||
//
|
||||
|
||||
case M3AP_MME_SCTP_REQ:
|
||||
MME_task_send_sctp_init_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
MME_task_send_sctp_init_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&M3AP_MME_SCTP_REQ(received_msg));
|
||||
break;
|
||||
|
||||
case M3AP_SETUP_RESP:
|
||||
LOG_I(M3AP,"MME Received M3AP_SETUP_RESP Message\n");
|
||||
MME_send_M3_SETUP_RESPONSE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
MME_send_M3_SETUP_RESPONSE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&M3AP_SETUP_RESP(received_msg));
|
||||
break;
|
||||
// break;
|
||||
//
|
||||
// case M3AP_SETUP_FAILURE:
|
||||
// LOG_W(M3AP,"MME Received M3AP_SETUP_FAILURE Message\n");
|
||||
// MME_send_M2_SETUP_FAILURE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// MME_send_M2_SETUP_FAILURE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_SETUP_FAILURE(received_msg));
|
||||
// break;
|
||||
//
|
||||
@@ -599,83 +599,83 @@ void *m3ap_MME_task(void *arg) {
|
||||
//
|
||||
case M3AP_MBMS_SESSION_START_REQ:
|
||||
LOG_I(M3AP,"MME Received M3AP_MBMS_SESSION_START_REQ Message\n");
|
||||
MME_send_MBMS_SESSION_START_REQUEST(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
MME_send_MBMS_SESSION_START_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&M3AP_MBMS_SESSION_START_REQ(received_msg));
|
||||
break;
|
||||
//
|
||||
case M3AP_MBMS_SESSION_STOP_REQ:
|
||||
LOG_I(M3AP,"MME Received M3AP_MBMS_SESSION_STOP_REQ Message\n");
|
||||
MME_send_MBMS_SESSION_STOP_REQUEST(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
MME_send_MBMS_SESSION_STOP_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&M3AP_MBMS_SESSION_STOP_REQ(received_msg));
|
||||
break;
|
||||
//
|
||||
case M3AP_MBMS_SESSION_UPDATE_REQ:
|
||||
LOG_I(M3AP,"MME Received M3AP_MBMS_SESSION_UPDATE_REQ Message\n");
|
||||
// MME_send_MBMS_SESSION_UPDATE_REQUEST(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// MME_send_MBMS_SESSION_UPDATE_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_MBMS_SESSION_UPDATE_REQ(received_msg));
|
||||
break;
|
||||
//
|
||||
// case M3AP_RESET:
|
||||
// LOG_W(M3AP,"MME Received M3AP_RESET Message\n");
|
||||
// MME_send_RESET(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// MME_send_RESET(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_RESET(received_msg));
|
||||
// break;
|
||||
//
|
||||
// case M3AP_ENB_CONFIGURATION_UPDATE_ACK:
|
||||
// LOG_W(M3AP,"MME Received M3AP_ENB_CONFIGURATION_UPDATE_ACK Message\n");
|
||||
// MME_send_ENB_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// MME_send_ENB_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_ENB_CONFIGURATION_UPDATE_ACK(received_msg));
|
||||
// break;
|
||||
//
|
||||
// case M3AP_ENB_CONFIGURATION_UPDATE_FAILURE:
|
||||
// LOG_W(M3AP,"MME Received M3AP_ENB_CONFIGURATION_UPDATE_FAILURE Message\n");
|
||||
// MME_send_ENB_CONFIGURATION_UPDATE_FAILURE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// MME_send_ENB_CONFIGURATION_UPDATE_FAILURE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_ENB_CONFIGURATION_UPDATE_FAILURE(received_msg))// break;
|
||||
//
|
||||
//
|
||||
// case M3AP_MME_CONFIGURATION_UPDATE:
|
||||
// LOG_W(M3AP,"MME Received M3AP_MME_CONFIGURATION_UPDATE Message\n");
|
||||
// MME_send_MME_CONFIGURATION_UPDATE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// MME_send_MME_CONFIGURATION_UPDATE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_MME_CONFIGURATION_UPDATE(received_msg));
|
||||
// break;
|
||||
//
|
||||
|
||||
// case M3AP_HANDOVER_REQ:
|
||||
// m3ap_MME_handle_handover_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// m3ap_MME_handle_handover_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_HANDOVER_REQ(received_msg));
|
||||
// break;
|
||||
//
|
||||
// case M3AP_HANDOVER_REQ_ACK:
|
||||
// m3ap_MME_handle_handover_req_ack(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// m3ap_MME_handle_handover_req_ack(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_HANDOVER_REQ_ACK(received_msg));
|
||||
// break;
|
||||
//
|
||||
// case M3AP_UE_CONTEXT_RELEASE:
|
||||
// m3ap_MME_ue_context_release(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// m3ap_MME_ue_context_release(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
// &M3AP_UE_CONTEXT_RELEASE(received_msg));
|
||||
// break;
|
||||
//
|
||||
case SCTP_INIT_MSG_MULTI_CNF:
|
||||
LOG_E(M3AP,"MME Received SCTP_INIT_MSG_MULTI_CNF Message ... shoudn't be happening ... it doesn't at leaast with M2AP_MCEC\n");
|
||||
m3ap_MME_handle_sctp_init_msg_multi_cnf(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
m3ap_MME_handle_sctp_init_msg_multi_cnf(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_init_msg_multi_cnf);
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_RESP:
|
||||
LOG_D(M3AP,"MME Received SCTP_NEW_ASSOCIATION_RESP Message\n");
|
||||
m3ap_MME_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
m3ap_MME_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_resp);
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_IND:
|
||||
LOG_D(M3AP,"MME Received SCTP_NEW_ASSOCIATION Message\n");
|
||||
m3ap_MME_handle_sctp_association_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
m3ap_MME_handle_sctp_association_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_ind);
|
||||
break;
|
||||
|
||||
case SCTP_DATA_IND:
|
||||
LOG_D(M3AP,"MME Received SCTP_DATA_IND Message\n");
|
||||
m3ap_MME_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
m3ap_MME_handle_sctp_data_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_data_ind);
|
||||
break;
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ int m3ap_MME_handle_message(instance_t instance, uint32_t assoc_id, int32_t stre
|
||||
}
|
||||
|
||||
/* Calling the right handler */
|
||||
LOG_I(M3AP, "Calling handler with instance %d\n",instance);
|
||||
LOG_I(M3AP, "Calling handler with instance %ld\n",instance);
|
||||
ret = (*m3ap_MME_messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1])
|
||||
(instance, assoc_id, stream, &pdu);
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_M3AP_M3AP_PDU, &pdu);
|
||||
|
||||
@@ -265,7 +265,7 @@ int MME_handle_MBMS_SESSION_START_RESPONSE(instance_t instance,
|
||||
int MCE_MBMS_M3AP_ID=-1;
|
||||
|
||||
|
||||
MessageDef *msg_g = itti_alloc_new_message(TASK_M3AP_MME,M3AP_MBMS_SESSION_START_RESP); //TODO
|
||||
MessageDef *msg_g = itti_alloc_new_message(TASK_M3AP_MME, 0,M3AP_MBMS_SESSION_START_RESP); //TODO
|
||||
|
||||
LOG_D(M3AP, "M3AP: SessionStart-Resp: protocolIEs.list.count %d\n",
|
||||
in->protocolIEs.list.count);
|
||||
@@ -403,7 +403,7 @@ int MME_handle_MBMS_SESSION_STOP_RESPONSE(instance_t instance,
|
||||
int MCE_MBMS_M3AP_ID=-1;
|
||||
|
||||
|
||||
MessageDef *msg_g = itti_alloc_new_message(TASK_M3AP_MME,M3AP_MBMS_SESSION_STOP_RESP); //TODO
|
||||
MessageDef *msg_g = itti_alloc_new_message(TASK_M3AP_MME, 0,M3AP_MBMS_SESSION_STOP_RESP); //TODO
|
||||
|
||||
LOG_D(M3AP, "M3AP: MBMSSessionStop-Resp: protocolIEs.list.count %d\n",
|
||||
in->protocolIEs.list.count);
|
||||
@@ -522,7 +522,7 @@ int MME_handle_M3_SETUP_REQUEST(instance_t instance,
|
||||
// assoc_id, stream);
|
||||
// }
|
||||
//
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MME, M3AP_SETUP_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MME, 0, M3AP_SETUP_REQ);
|
||||
//printf("M3AP_SETUP_REQ(message_p).assoc_id %d\n",M3AP_SETUP_REQ(message_p).assoc_id);
|
||||
//
|
||||
// /* assoc_id */
|
||||
@@ -1055,7 +1055,7 @@ int MME_handle_MBMS_SESSION_UPDATE_RESPONSE(instance_t instance,
|
||||
int MCE_MBMS_M3AP_ID=-1;
|
||||
|
||||
|
||||
MessageDef *msg_g = itti_alloc_new_message(TASK_M3AP_MME,M3AP_MBMS_SESSION_UPDATE_RESP); //TODO
|
||||
MessageDef *msg_g = itti_alloc_new_message(TASK_M3AP_MME, 0,M3AP_MBMS_SESSION_UPDATE_RESP); //TODO
|
||||
|
||||
LOG_D(M3AP, "M3AP: SessionUpdate-Resp: protocolIEs.list.count %d\n",
|
||||
in->protocolIEs.list.count);
|
||||
|
||||
@@ -116,7 +116,7 @@ void dump_mme_trees_m2(void)
|
||||
m3ap_MME_instance_t *zz;
|
||||
STAILQ_FOREACH(zz, &m3ap_MME_internal_data.m3ap_MME_instances_head,
|
||||
m3ap_MME_entries) {
|
||||
printf("here comes the tree (instance %d):\n---------------------------------------------\n", zz->instance);
|
||||
printf("here comes the tree (instance %ld):\n---------------------------------------------\n", zz->instance);
|
||||
dump_mme_tree_m2(zz->m3ap_mme_head.rbh_root);
|
||||
printf("---------------------------------------------\n");
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ void m3ap_MCE_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uin
|
||||
MessageDef *message_p;
|
||||
sctp_data_req_t *sctp_data_req;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MCE, SCTP_DATA_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MCE, 0, SCTP_DATA_REQ);
|
||||
|
||||
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
|
||||
|
||||
@@ -56,7 +56,7 @@ void m3ap_MCE_itti_send_sctp_close_association(instance_t instance, int32_t asso
|
||||
MessageDef *message_p = NULL;
|
||||
sctp_close_association_t *sctp_close_association_p = NULL;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MCE, SCTP_CLOSE_ASSOCIATION);
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MCE, 0, SCTP_CLOSE_ASSOCIATION);
|
||||
sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
|
||||
sctp_close_association_p->assoc_id = assoc_id;
|
||||
|
||||
@@ -70,7 +70,7 @@ void m3ap_MME_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uin
|
||||
MessageDef *message_p;
|
||||
sctp_data_req_t *sctp_data_req;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MME, SCTP_DATA_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MME, 0, SCTP_DATA_REQ);
|
||||
|
||||
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
|
||||
|
||||
@@ -88,7 +88,7 @@ void m3ap_MME_itti_send_sctp_close_association(instance_t instance, int32_t asso
|
||||
MessageDef *message_p = NULL;
|
||||
sctp_close_association_t *sctp_close_association_p = NULL;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MME, SCTP_CLOSE_ASSOCIATION);
|
||||
message_p = itti_alloc_new_message(TASK_M3AP_MME, 0, SCTP_CLOSE_ASSOCIATION);
|
||||
sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
|
||||
sctp_close_association_p->assoc_id = assoc_id;
|
||||
|
||||
|
||||
+14
-14
@@ -76,7 +76,7 @@ extern RAN_CONTEXT_t RC;
|
||||
// {
|
||||
// // M3AP registration
|
||||
// /* note: there is an implicit relationship between the data structure and the message name */
|
||||
// msg_p = itti_alloc_new_message (TASK_MME_APP, M3AP_REGISTER_MCE_REQ);
|
||||
// msg_p = itti_alloc_new_message (TASK_MME_APP, 0, M3AP_REGISTER_MCE_REQ);
|
||||
// //RCconfig_S1(msg_p, mce_id);
|
||||
//
|
||||
// //if (mce_id == 0)
|
||||
@@ -90,7 +90,7 @@ extern RAN_CONTEXT_t RC;
|
||||
// //if (NODE_IS_DU(node_type)) { // F1AP registration
|
||||
// // // configure F1AP here for F1C
|
||||
// // LOG_I(ENB_APP,"ngran_eNB_DU: Allocating ITTI message for F1AP_SETUP_REQ\n");
|
||||
// // msg_p = itti_alloc_new_message (TASK_ENB_APP, F1AP_SETUP_REQ);
|
||||
// // msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, F1AP_SETUP_REQ);
|
||||
// // RCconfig_DU_F1(msg_p, enb_id);
|
||||
//
|
||||
// // LOG_I(ENB_APP,"[eNB %d] eNB_app_register via F1AP for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
|
||||
@@ -99,7 +99,7 @@ extern RAN_CONTEXT_t RC;
|
||||
// //}
|
||||
// //else { // S1AP registration
|
||||
// // /* note: there is an implicit relationship between the data structure and the message name */
|
||||
// // msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ);
|
||||
// // msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, S1AP_REGISTER_ENB_REQ);
|
||||
// // RCconfig_S1(msg_p, enb_id);
|
||||
//
|
||||
// // if (enb_id == 0) RCconfig_gtpu();
|
||||
@@ -126,7 +126,7 @@ extern RAN_CONTEXT_t RC;
|
||||
//
|
||||
// for (mce_id = mce_id_start; (mce_id < mce_id_end) ; mce_id++) {
|
||||
// {
|
||||
// msg_p = itti_alloc_new_message (TASK_ENB_APP, X2AP_REGISTER_ENB_REQ);
|
||||
// msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, X2AP_REGISTER_ENB_REQ);
|
||||
// RCconfig_X2(msg_p, mce_id);
|
||||
// itti_send_msg_to_task (TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(mce_id), msg_p);
|
||||
// register_mce_x2_pending++;
|
||||
@@ -146,7 +146,7 @@ extern RAN_CONTEXT_t RC;
|
||||
// for (mce_id = mce_id_start; (mce_id < mce_id_end) ; mce_id++) {
|
||||
// {
|
||||
// // LOG_W(MME_APP,"Register commes inside ...\n");
|
||||
// msg_p = itti_alloc_new_message (TASK_MME_APP, M2AP_REGISTER_MCE_REQ);
|
||||
// msg_p = itti_alloc_new_message (TASK_MME_APP, 0, M2AP_REGISTER_MCE_REQ);
|
||||
// //RCconfig_M2_MCE(msg_p, mce_id);
|
||||
// itti_send_msg_to_task (TASK_M2AP_MCE, ENB_MODULE_ID_TO_INSTANCE(mce_id), msg_p);
|
||||
// // LOG_W(MME_APP,"Register sent ...\n");
|
||||
@@ -163,7 +163,7 @@ static uint32_t MME_app_handle_m3ap_setup_req(instance_t instance){
|
||||
|
||||
//uint32_t mce_id=0;
|
||||
MessageDef *msg_p;
|
||||
msg_p = itti_alloc_new_message (TASK_MME_APP, M3AP_SETUP_RESP);
|
||||
msg_p = itti_alloc_new_message (TASK_MME_APP, 0, M3AP_SETUP_RESP);
|
||||
itti_send_msg_to_task (TASK_M3AP_MME, ENB_MODULE_ID_TO_INSTANCE(instance), msg_p);
|
||||
|
||||
return 0;
|
||||
@@ -187,7 +187,7 @@ static uint32_t MME_app_handle_m3ap_session_start_resp(instance_t instance){
|
||||
//
|
||||
// uint32_t mce_id=0;
|
||||
// MessageDef *msg_p;
|
||||
// msg_p = itti_alloc_new_message (TASK_MME_APP, M2AP_MBMS_SCHEDULING_INFORMATION);
|
||||
// msg_p = itti_alloc_new_message (TASK_MME_APP, 0, M2AP_MBMS_SCHEDULING_INFORMATION);
|
||||
// itti_send_msg_to_task (TASK_M2AP_MCE, ENB_MODULE_ID_TO_INSTANCE(instance), msg_p);
|
||||
//
|
||||
// return 0;
|
||||
@@ -197,7 +197,7 @@ static uint32_t MME_app_send_m3ap_session_start_req(instance_t instance){
|
||||
|
||||
//uint32_t mce_id=0;
|
||||
MessageDef *msg_p;
|
||||
msg_p = itti_alloc_new_message (TASK_MME_APP, M3AP_MBMS_SESSION_START_REQ);
|
||||
msg_p = itti_alloc_new_message (TASK_MME_APP, 0, M3AP_MBMS_SESSION_START_REQ);
|
||||
itti_send_msg_to_task (TASK_M3AP_MME, ENB_MODULE_ID_TO_INSTANCE(instance), msg_p);
|
||||
|
||||
return 0;
|
||||
@@ -206,7 +206,7 @@ static uint32_t MME_app_send_m3ap_session_start_req(instance_t instance){
|
||||
//
|
||||
// //uint32_t mce_id=0;
|
||||
// MessageDef *msg_p;
|
||||
// msg_p = itti_alloc_new_message (TASK_MME_APP, M3AP_MBMS_SESSION_STOP_REQ);
|
||||
// msg_p = itti_alloc_new_message (TASK_MME_APP, 0, M3AP_MBMS_SESSION_STOP_REQ);
|
||||
// itti_send_msg_to_task (TASK_M3AP_MME, ENB_MODULE_ID_TO_INSTANCE(instance), msg_p);
|
||||
//
|
||||
// return 0;
|
||||
@@ -215,7 +215,7 @@ static uint32_t MME_app_send_m3ap_session_update_req(instance_t instance){
|
||||
|
||||
//uint32_t mce_id=0;
|
||||
MessageDef *msg_p;
|
||||
msg_p = itti_alloc_new_message (TASK_MME_APP, M3AP_MBMS_SESSION_UPDATE_REQ);
|
||||
msg_p = itti_alloc_new_message (TASK_MME_APP, 0, M3AP_MBMS_SESSION_UPDATE_REQ);
|
||||
itti_send_msg_to_task (TASK_M3AP_MME, ENB_MODULE_ID_TO_INSTANCE(instance), msg_p);
|
||||
|
||||
return 0;
|
||||
@@ -263,7 +263,7 @@ void *MME_app_task(void *args_p) {
|
||||
do {
|
||||
// Wait for a message
|
||||
itti_receive_msg (TASK_MME_APP, &msg_p);
|
||||
instance = ITTI_MSG_INSTANCE (msg_p);
|
||||
instance = ITTI_MSG_DESTINATION_INSTANCE (msg_p);
|
||||
|
||||
switch (ITTI_MSG_ID(msg_p)) {
|
||||
case TERMINATE_MESSAGE:
|
||||
@@ -297,7 +297,7 @@ void *MME_app_task(void *args_p) {
|
||||
// if (registered_mce == mce_nb) {
|
||||
// /* If all MCE are registered, start L2L1 task */
|
||||
// // MessageDef *msg_init_p;
|
||||
// // msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
|
||||
// // msg_init_p = itti_alloc_new_message (TASK_ENB_APP, 0, INITIALIZE_MESSAGE);
|
||||
// // itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
|
||||
// } else {
|
||||
// LOG_W(MME_APP, " %d MCE not associated with a MME, retrying registration in %d seconds ...\n",
|
||||
@@ -341,7 +341,7 @@ void *MME_app_task(void *args_p) {
|
||||
// /* If all MCE cells are registered, start L2L1 task */
|
||||
// MessageDef *msg_init_p;
|
||||
|
||||
// //msg_init_p = itti_alloc_new_message (TASK_MME_APP, INITIALIZE_MESSAGE);
|
||||
// //msg_init_p = itti_alloc_new_message (TASK_MME_APP, 0, INITIALIZE_MESSAGE);
|
||||
// //itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
|
||||
|
||||
// } else {
|
||||
@@ -365,7 +365,7 @@ void *MME_app_task(void *args_p) {
|
||||
|
||||
case M3AP_DEREGISTERED_MCE_IND: //M3AP_DEREGISTERED_MCE_IND debería
|
||||
if (EPC_MODE_ENABLED) {
|
||||
LOG_W(MME_APP, "[MCE %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
|
||||
LOG_W(MME_APP, "[MCE %ld] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
|
||||
M3AP_DEREGISTERED_MCE_IND(msg_p).nb_mme);
|
||||
/* TODO handle recovering of registration */
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ int RCconfig_MME(void ) {
|
||||
|
||||
if (address) {
|
||||
MessageDef *message;
|
||||
AssertFatal((message = itti_alloc_new_message(TASK_MME_APP, M3AP_MME_SCTP_REQ))!=NULL,"");
|
||||
AssertFatal((message = itti_alloc_new_message(TASK_MME_APP, 0, M3AP_MME_SCTP_REQ))!=NULL,"");
|
||||
M3AP_MME_SCTP_REQ (message).mme_m3_ip_address.ipv6 = 0;
|
||||
M3AP_MME_SCTP_REQ (message).mme_m3_ip_address.ipv4 = 1;
|
||||
strcpy( M3AP_MME_SCTP_REQ (message).mme_m3_ip_address.ipv4_address, address);
|
||||
|
||||
@@ -102,7 +102,7 @@ extern unsigned char NB_eNB_INST;
|
||||
|
||||
int nas_itti_kenb_refresh_req(const Byte_t kenb[32], int user_id) {
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_KENB_REFRESH_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_KENB_REFRESH_REQ);
|
||||
memcpy(NAS_KENB_REFRESH_REQ(message_p).kenb, kenb, sizeof(NAS_KENB_REFRESH_REQ(message_p).kenb));
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_NAS_UE,
|
||||
@@ -130,7 +130,7 @@ int nas_itti_kenb_refresh_req(const Byte_t kenb[32], int user_id) {
|
||||
|
||||
int nas_itti_cell_info_req(const plmn_t plmnID, const Byte_t rat, int user_id) {
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_CELL_SELECTION_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_CELL_SELECTION_REQ);
|
||||
NAS_CELL_SELECTION_REQ(message_p).plmnID = plmnID;
|
||||
NAS_CELL_SELECTION_REQ(message_p).rat = rat;
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
@@ -145,7 +145,7 @@ int nas_itti_cell_info_req(const plmn_t plmnID, const Byte_t rat, int user_id) {
|
||||
|
||||
int nas_itti_nas_establish_req(as_cause_t cause, as_call_type_t type, as_stmsi_t s_tmsi, plmn_t plmnID, Byte_t *data, uint32_t length, int user_id) {
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_CONN_ESTABLI_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_CONN_ESTABLI_REQ);
|
||||
NAS_CONN_ESTABLI_REQ(message_p).cause = cause;
|
||||
NAS_CONN_ESTABLI_REQ(message_p).type = type;
|
||||
NAS_CONN_ESTABLI_REQ(message_p).s_tmsi = s_tmsi;
|
||||
@@ -165,7 +165,7 @@ int nas_itti_nas_establish_req(as_cause_t cause, as_call_type_t type, as_stmsi_t
|
||||
|
||||
int nas_itti_ul_data_req(const uint32_t ue_id, void *const data, const uint32_t length, int user_id) {
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_UPLINK_DATA_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_UPLINK_DATA_REQ);
|
||||
NAS_UPLINK_DATA_REQ(message_p).UEid = ue_id;
|
||||
NAS_UPLINK_DATA_REQ(message_p).nasMsg.data = data;
|
||||
NAS_UPLINK_DATA_REQ(message_p).nasMsg.length = length;
|
||||
@@ -174,7 +174,7 @@ int nas_itti_ul_data_req(const uint32_t ue_id, void *const data, const uint32_t
|
||||
|
||||
int nas_itti_rab_establish_rsp(const as_stmsi_t s_tmsi, const as_rab_id_t rabID, const nas_error_code_t errCode, int user_id) {
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_RAB_ESTABLI_RSP);
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_RAB_ESTABLI_RSP);
|
||||
NAS_RAB_ESTABLI_RSP(message_p).s_tmsi = s_tmsi;
|
||||
NAS_RAB_ESTABLI_RSP(message_p).rabID = rabID;
|
||||
NAS_RAB_ESTABLI_RSP(message_p).errCode = errCode;
|
||||
|
||||
@@ -136,7 +136,7 @@ void *nas_ue_task(void *args_p)
|
||||
for (instance = NB_eNB_INST; instance < (NB_eNB_INST + NB_UE_INST); instance++) {
|
||||
MessageDef *message_p;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, DEACTIVATE_MESSAGE);
|
||||
message_p = itti_alloc_new_message(TASK_NAS_UE, 0, DEACTIVATE_MESSAGE);
|
||||
itti_send_msg_to_task(TASK_L2L1, instance, message_p);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ void *nas_ue_task(void *args_p)
|
||||
itti_receive_msg (TASK_NAS_UE, &msg_p);
|
||||
|
||||
if (msg_p != NULL) {
|
||||
instance = ITTI_MSG_INSTANCE (msg_p);
|
||||
instance = ITTI_MSG_DESTINATION_INSTANCE (msg_p);
|
||||
Mod_id = instance - NB_eNB_INST;
|
||||
if (instance == INSTANCE_DEFAULT) {
|
||||
printf("%s:%d: FATAL: instance is INSTANCE_DEFAULT, should not happen.\n",
|
||||
|
||||
+19
-19
@@ -97,7 +97,7 @@ static void ngap_gNB_register_amf(ngap_gNB_instance_t *instance_p,
|
||||
ngap_gNB_amf_data_t *ngap_amf_data_p = NULL;
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(amf_ip_address != NULL);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, SCTP_NEW_ASSOCIATION_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, SCTP_NEW_ASSOCIATION_REQ);
|
||||
sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req;
|
||||
sctp_new_association_req_p->port = NGAP_PORT_NUMBER;
|
||||
sctp_new_association_req_p->ppid = NGAP_SCTP_PPID;
|
||||
@@ -109,7 +109,7 @@ static void ngap_gNB_register_amf(ngap_gNB_instance_t *instance_p,
|
||||
memcpy(&sctp_new_association_req_p->local_address,
|
||||
local_ip_addr,
|
||||
sizeof(*local_ip_addr));
|
||||
NGAP_INFO("[gNB %d] check the amf registration state\n",instance_p->instance);
|
||||
NGAP_INFO("[gNB %ld] check the amf registration state\n",instance_p->instance);
|
||||
|
||||
/* Create new AMF descriptor */
|
||||
ngap_amf_data_p = calloc(1, sizeof(*ngap_amf_data_p));
|
||||
@@ -190,7 +190,7 @@ void ngap_gNB_handle_register_gNB(instance_t instance, ngap_register_gnb_req_t *
|
||||
|
||||
/* Add the new instance to the list of gNB (meaningfull in virtual mode) */
|
||||
ngap_gNB_insert_new_instance(new_instance);
|
||||
NGAP_INFO("Registered new gNB[%d] and %s gNB id %u\n",
|
||||
NGAP_INFO("Registered new gNB[%ld] and %s gNB id %u\n",
|
||||
instance,
|
||||
ngap_register_gNB->cell_type == CELL_MACRO_GNB ? "macro" : "home",
|
||||
ngap_register_gNB->gNB_id);
|
||||
@@ -235,7 +235,7 @@ void ngap_gNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
|
||||
DevAssert(ngap_amf_data_p != NULL);
|
||||
|
||||
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
|
||||
NGAP_WARN("Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
|
||||
NGAP_WARN("Received unsuccessful result for SCTP association (%u), instance %ld, cnx_id %u\n",
|
||||
sctp_new_association_resp->sctp_state,
|
||||
instance,
|
||||
sctp_new_association_resp->ulp_cnx_id);
|
||||
@@ -287,13 +287,13 @@ void *ngap_gNB_process_itti_msg(void *notUsed) {
|
||||
* Each gNB has to send an NGAP_REGISTER_GNB message with its
|
||||
* own parameters.
|
||||
*/
|
||||
ngap_gNB_handle_register_gNB(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_handle_register_gNB(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_REGISTER_GNB_REQ(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_RESP: {
|
||||
ngap_gNB_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_resp);
|
||||
}
|
||||
break;
|
||||
@@ -304,61 +304,61 @@ void *ngap_gNB_process_itti_msg(void *notUsed) {
|
||||
break;
|
||||
|
||||
case NGAP_NAS_FIRST_REQ: {
|
||||
ngap_gNB_handle_nas_first_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_handle_nas_first_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_NAS_FIRST_REQ(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case NGAP_UPLINK_NAS: {
|
||||
ngap_gNB_nas_uplink(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_nas_uplink(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_UPLINK_NAS(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case NGAP_UE_CAPABILITIES_IND: {
|
||||
ngap_gNB_ue_capabilities(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_ue_capabilities(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_UE_CAPABILITIES_IND(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case NGAP_INITIAL_CONTEXT_SETUP_RESP: {
|
||||
ngap_gNB_initial_ctxt_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_initial_ctxt_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_INITIAL_CONTEXT_SETUP_RESP(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case NGAP_PDUSESSION_SETUP_RESP: {
|
||||
ngap_gNB_pdusession_setup_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_pdusession_setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_PDUSESSION_SETUP_RESP(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case NGAP_PDUSESSION_MODIFY_RESP: {
|
||||
ngap_gNB_pdusession_modify_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_pdusession_modify_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_PDUSESSION_MODIFY_RESP(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case NGAP_NAS_NON_DELIVERY_IND: {
|
||||
ngap_gNB_nas_non_delivery_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_nas_non_delivery_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_NAS_NON_DELIVERY_IND(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case NGAP_PATH_SWITCH_REQ: {
|
||||
ngap_gNB_path_switch_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_path_switch_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_PATH_SWITCH_REQ(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case NGAP_PDUSESSION_MODIFICATION_IND: {
|
||||
ngap_gNB_generate_PDUSESSION_Modification_Indication(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_generate_PDUSESSION_Modification_Indication(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_PDUSESSION_MODIFICATION_IND(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case NGAP_UE_CONTEXT_RELEASE_COMPLETE: {
|
||||
ngap_ue_context_release_complete(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_ue_context_release_complete(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_UE_CONTEXT_RELEASE_COMPLETE(received_msg));
|
||||
}
|
||||
break;
|
||||
@@ -366,9 +366,9 @@ void *ngap_gNB_process_itti_msg(void *notUsed) {
|
||||
case NGAP_UE_CONTEXT_RELEASE_REQ: {
|
||||
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL; // test
|
||||
struct ngap_gNB_ue_context_s *ue_context_p = NULL; // test
|
||||
ngap_ue_context_release_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_ue_context_release_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_UE_CONTEXT_RELEASE_REQ(received_msg));
|
||||
ngap_gNB_instance_p = ngap_gNB_get_instance(ITTI_MESSAGE_GET_INSTANCE(received_msg)); // test
|
||||
ngap_gNB_instance_p = ngap_gNB_get_instance(ITTI_MSG_DESTINATION_INSTANCE(received_msg)); // test
|
||||
DevAssert(ngap_gNB_instance_p != NULL); // test
|
||||
|
||||
if ((ue_context_p = ngap_gNB_get_ue_context(ngap_gNB_instance_p,
|
||||
@@ -381,7 +381,7 @@ void *ngap_gNB_process_itti_msg(void *notUsed) {
|
||||
break;
|
||||
|
||||
case NGAP_PDUSESSION_RELEASE_RESPONSE: {
|
||||
ngap_gNB_pdusession_release_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ngap_gNB_pdusession_release_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&NGAP_PDUSESSION_RELEASE_RESPONSE(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -191,7 +191,7 @@ void ngap_handle_ng_setup_message(ngap_gNB_amf_data_t *amf_desc_p, int sctp_shut
|
||||
/* If there are no more associated AMF, inform gNB app */
|
||||
if (amf_desc_p->ngap_gNB_instance->ngap_amf_associated_nb == 0) {
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_DEREGISTERED_GNB_IND);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, NGAP_DEREGISTERED_GNB_IND);
|
||||
NGAP_DEREGISTERED_GNB_IND(message_p).nb_amf = 0;
|
||||
itti_send_msg_to_task(TASK_GNB_APP, amf_desc_p->ngap_gNB_instance->instance, message_p);
|
||||
}
|
||||
@@ -209,7 +209,7 @@ void ngap_handle_ng_setup_message(ngap_gNB_amf_data_t *amf_desc_p, int sctp_shut
|
||||
/* If there are no more pending messages, inform gNB app */
|
||||
if (amf_desc_p->ngap_gNB_instance->ngap_amf_pending_nb == 0) {
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_REGISTER_GNB_CNF);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, NGAP_REGISTER_GNB_CNF);
|
||||
NGAP_REGISTER_GNB_CNF(message_p).nb_amf = amf_desc_p->ngap_gNB_instance->ngap_amf_associated_nb;
|
||||
itti_send_msg_to_task(TASK_GNB_APP, amf_desc_p->ngap_gNB_instance->instance, message_p);
|
||||
}
|
||||
@@ -891,7 +891,7 @@ int ngap_gNB_handle_initial_context_request(uint32_t assoc_id,
|
||||
ue_desc_p->rx_stream = stream;
|
||||
ue_desc_p->amf_ue_ngap_id = amf_ue_ngap_id;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_INITIAL_CONTEXT_SETUP_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, NGAP_INITIAL_CONTEXT_SETUP_REQ);
|
||||
NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
||||
ue_desc_p->ue_initial_id = 0;
|
||||
NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).gNB_ue_ngap_id = ue_desc_p->gNB_ue_ngap_id;
|
||||
@@ -1203,7 +1203,7 @@ int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id,
|
||||
NULL,0,
|
||||
"0 NGAP_UE_CONTEXT_RELEASE_COMMAND/%d gNB_ue_ngap_id "NGAP_UE_ID_FMT" ",
|
||||
gnb_ue_ngap_id);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_UE_CONTEXT_RELEASE_COMMAND);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, NGAP_UE_CONTEXT_RELEASE_COMMAND);
|
||||
|
||||
if (ue_desc_p->amf_ue_ngap_id == 0) { // case of Detach Request and switch off from RRC_IDLE mode
|
||||
ue_desc_p->amf_ue_ngap_id = amf_ue_ngap_id;
|
||||
@@ -1302,7 +1302,7 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
|
||||
(uint64_t)ue_desc_p->amf_ue_ngap_id, amf_ue_ngap_id);
|
||||
}
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_PDUSESSION_SETUP_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, NGAP_PDUSESSION_SETUP_REQ);
|
||||
NGAP_PDUSESSION_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
||||
ue_desc_p->ue_initial_id = 0;
|
||||
NGAP_PDUSESSION_SETUP_REQ(message_p).gNB_ue_ngap_id = ue_desc_p->gNB_ue_ngap_id;
|
||||
@@ -1474,7 +1474,7 @@ int ngap_gNB_handle_paging(uint32_t assoc_id,
|
||||
return -1;
|
||||
}
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_PAGING_IND);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, NGAP_PAGING_IND);
|
||||
/* convert NGAP_PagingIEs_t to ngap_paging_ind_t */
|
||||
/* id-UEIdentityIndexValue : convert UE Identity Index value */
|
||||
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_PagingIEs_t, ie, container,
|
||||
@@ -1608,7 +1608,7 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
|
||||
if (ue_desc_p->amf_ue_ngap_id != amf_ue_ngap_id) {
|
||||
NGAP_WARN("UE context amf_ue_ngap_id is different form that of the message (%ld != %ld)",
|
||||
(uint64_t)ue_desc_p->amf_ue_ngap_id, amf_ue_ngap_id);
|
||||
message_p = itti_alloc_new_message (TASK_RRC_GNB, NGAP_PDUSESSION_MODIFY_RESP);
|
||||
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, NGAP_PDUSESSION_MODIFY_RESP);
|
||||
NGAP_PDUSESSION_MODIFY_RESP (message_p).gNB_ue_ngap_id = gnb_ue_ngap_id;
|
||||
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_PDUSessionResourceModifyRequestIEs_t, ie, container,
|
||||
NGAP_ProtocolIE_ID_id_PDUSessionResourceModifyListModReq, true);
|
||||
@@ -1634,7 +1634,7 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
|
||||
return -1;
|
||||
}
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_PDUSESSION_MODIFY_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, NGAP_PDUSESSION_MODIFY_REQ);
|
||||
NGAP_PDUSESSION_MODIFY_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
||||
NGAP_PDUSESSION_MODIFY_REQ(message_p).amf_ue_ngap_id = amf_ue_ngap_id;
|
||||
NGAP_PDUSESSION_MODIFY_REQ(message_p).gNB_ue_ngap_id = gnb_ue_ngap_id;
|
||||
@@ -1814,7 +1814,7 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
|
||||
|
||||
NGAP_DEBUG("[SCTP %d] Received E-RAB release command for gNB_UE_NGAP_ID %lu amf_ue_ngap_id %lu\n",
|
||||
assoc_id, gnb_ue_ngap_id, amf_ue_ngap_id);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_PDUSESSION_RELEASE_COMMAND);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, NGAP_PDUSESSION_RELEASE_COMMAND);
|
||||
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).gNB_ue_ngap_id = gnb_ue_ngap_id;
|
||||
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).amf_ue_ngap_id = amf_ue_ngap_id;
|
||||
/* id-NAS-PDU */
|
||||
|
||||
@@ -37,7 +37,7 @@ void ngap_gNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uin
|
||||
MessageDef *message_p;
|
||||
sctp_data_req_t *sctp_data_req;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, SCTP_DATA_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, SCTP_DATA_REQ);
|
||||
|
||||
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
|
||||
|
||||
@@ -58,7 +58,7 @@ void ngap_gNB_itti_send_nas_downlink_ind(instance_t instance,
|
||||
MessageDef *message_p;
|
||||
ngap_downlink_nas_t *ngap_downlink_nas;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_DOWNLINK_NAS);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, NGAP_DOWNLINK_NAS);
|
||||
|
||||
ngap_downlink_nas = &message_p->ittiMsg.ngap_downlink_nas;
|
||||
|
||||
@@ -76,7 +76,7 @@ void ngap_gNB_itti_send_sctp_close_association(instance_t instance, int32_t asso
|
||||
MessageDef *message_p = NULL;
|
||||
sctp_close_association_t *sctp_close_association_p = NULL;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, SCTP_CLOSE_ASSOCIATION);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, 0, SCTP_CLOSE_ASSOCIATION);
|
||||
sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
|
||||
sctp_close_association_p->assoc_id = assoc_id;
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ int ngap_gNB_handle_nas_first_req(
|
||||
ngap_nas_first_req_p->ue_identity.guami);
|
||||
|
||||
if (amf_desc_p) {
|
||||
NGAP_INFO("[gNB %d] Chose AMF '%s' (assoc_id %d) through GUAMI MCC %d MNC %d AMFRI %d AMFSI %d AMFPT %d\n",
|
||||
NGAP_INFO("[gNB %ld] Chose AMF '%s' (assoc_id %d) through GUAMI MCC %d MNC %d AMFRI %d AMFSI %d AMFPT %d\n",
|
||||
instance,
|
||||
amf_desc_p->amf_name,
|
||||
amf_desc_p->assoc_id,
|
||||
@@ -108,7 +108,7 @@ int ngap_gNB_handle_nas_first_req(
|
||||
ngap_nas_first_req_p->ue_identity.s_tmsi.amf_set_id);
|
||||
|
||||
if (amf_desc_p) {
|
||||
NGAP_INFO("[gNB %d] Chose AMF '%s' (assoc_id %d) through S-TMSI AMFSI %d and selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||
NGAP_INFO("[gNB %ld] Chose AMF '%s' (assoc_id %d) through S-TMSI AMFSI %d and selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||
instance,
|
||||
amf_desc_p->amf_name,
|
||||
amf_desc_p->assoc_id,
|
||||
@@ -130,7 +130,7 @@ int ngap_gNB_handle_nas_first_req(
|
||||
ngap_nas_first_req_p->selected_plmn_identity);
|
||||
|
||||
if (amf_desc_p) {
|
||||
NGAP_INFO("[gNB %d] Chose AMF '%s' (assoc_id %d) through selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||
NGAP_INFO("[gNB %ld] Chose AMF '%s' (assoc_id %d) through selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||
instance,
|
||||
amf_desc_p->amf_name,
|
||||
amf_desc_p->assoc_id,
|
||||
@@ -151,7 +151,7 @@ int ngap_gNB_handle_nas_first_req(
|
||||
ngap_nas_first_req_p->establishment_cause);
|
||||
|
||||
if (amf_desc_p) {
|
||||
NGAP_INFO("[gNB %d] Chose AMF '%s' (assoc_id %d) through highest relative capacity\n",
|
||||
NGAP_INFO("[gNB %ld] Chose AMF '%s' (assoc_id %d) through highest relative capacity\n",
|
||||
instance,
|
||||
amf_desc_p->amf_name,
|
||||
amf_desc_p->assoc_id);
|
||||
|
||||
+21
-21
@@ -101,7 +101,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
|
||||
struct s1ap_eNB_mme_data_s *mme = NULL;
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(mme_ip_address != NULL);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, SCTP_NEW_ASSOCIATION_REQ);
|
||||
sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req;
|
||||
sctp_new_association_req_p->port = mme_port;
|
||||
sctp_new_association_req_p->ppid = S1AP_SCTP_PPID;
|
||||
@@ -113,7 +113,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
|
||||
memcpy(&sctp_new_association_req_p->local_address,
|
||||
local_ip_addr,
|
||||
sizeof(*local_ip_addr));
|
||||
S1AP_INFO("[eNB %d] check the mme registration state\n",instance_p->instance);
|
||||
S1AP_INFO("[eNB %ld] check the mme registration state\n",instance_p->instance);
|
||||
mme = NULL;
|
||||
|
||||
if ( mme == NULL ) {
|
||||
@@ -143,7 +143,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
|
||||
} else if (mme->state == S1AP_ENB_STATE_WAITING) {
|
||||
instance_p->s1ap_mme_pending_nb ++;
|
||||
sctp_new_association_req_p->ulp_cnx_id = mme->cnx_id;
|
||||
S1AP_INFO("[eNB %d] MME already registered, retrive the data (state %d, cnx %d, mme_nb %d, mme_pending_nb %d)\n",
|
||||
S1AP_INFO("[eNB %ld] MME already registered, retrive the data (state %d, cnx %d, mme_nb %d, mme_pending_nb %d)\n",
|
||||
instance_p->instance,
|
||||
mme->state, mme->cnx_id,
|
||||
instance_p->s1ap_mme_nb, instance_p->s1ap_mme_pending_nb);
|
||||
@@ -154,7 +154,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
|
||||
s1ap_mme_data_p->s1ap_eNB_instance = instance_p;
|
||||
*/
|
||||
} else {
|
||||
S1AP_WARN("[eNB %d] MME already registered but not in the waiting state, retrive the data (state %d, cnx %d, mme_nb %d, mme_pending_nb %d)\n",
|
||||
S1AP_WARN("[eNB %ld] MME already registered but not in the waiting state, retrive the data (state %d, cnx %d, mme_nb %d, mme_pending_nb %d)\n",
|
||||
instance_p->instance,
|
||||
mme->state, mme->cnx_id,
|
||||
instance_p->s1ap_mme_nb, instance_p->s1ap_mme_pending_nb);
|
||||
@@ -211,7 +211,7 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
|
||||
new_instance->default_drx = s1ap_register_eNB->default_drx;
|
||||
/* Add the new instance to the list of eNB (meaningfull in virtual mode) */
|
||||
s1ap_eNB_insert_new_instance(new_instance);
|
||||
S1AP_INFO("Registered new eNB[%d] and %s eNB id %u\n",
|
||||
S1AP_INFO("Registered new eNB[%ld] and %s eNB id %u\n",
|
||||
instance,
|
||||
s1ap_register_eNB->cell_type == CELL_MACRO_ENB ? "macro" : "home",
|
||||
s1ap_register_eNB->eNB_id);
|
||||
@@ -258,7 +258,7 @@ void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
|
||||
DevAssert(s1ap_mme_data_p != NULL);
|
||||
|
||||
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
|
||||
S1AP_WARN("Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
|
||||
S1AP_WARN("Received unsuccessful result for SCTP association (%u), instance %ld, cnx_id %u\n",
|
||||
sctp_new_association_resp->sctp_state,
|
||||
instance,
|
||||
sctp_new_association_resp->ulp_cnx_id);
|
||||
@@ -313,13 +313,13 @@ void *s1ap_eNB_process_itti_msg(void *notUsed) {
|
||||
* Each eNB has to send an S1AP_REGISTER_ENB message with its
|
||||
* own parameters.
|
||||
*/
|
||||
s1ap_eNB_handle_register_eNB(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_handle_register_eNB(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_REGISTER_ENB_REQ(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_RESP: {
|
||||
s1ap_eNB_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_resp);
|
||||
}
|
||||
break;
|
||||
@@ -330,61 +330,61 @@ void *s1ap_eNB_process_itti_msg(void *notUsed) {
|
||||
break;
|
||||
|
||||
case S1AP_NAS_FIRST_REQ: {
|
||||
s1ap_eNB_handle_nas_first_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_handle_nas_first_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_NAS_FIRST_REQ(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case S1AP_UPLINK_NAS: {
|
||||
s1ap_eNB_nas_uplink(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_nas_uplink(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_UPLINK_NAS(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case S1AP_UE_CAPABILITIES_IND: {
|
||||
s1ap_eNB_ue_capabilities(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_ue_capabilities(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_UE_CAPABILITIES_IND(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case S1AP_INITIAL_CONTEXT_SETUP_RESP: {
|
||||
s1ap_eNB_initial_ctxt_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_initial_ctxt_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_INITIAL_CONTEXT_SETUP_RESP(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case S1AP_E_RAB_SETUP_RESP: {
|
||||
s1ap_eNB_e_rab_setup_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_e_rab_setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_E_RAB_SETUP_RESP(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case S1AP_E_RAB_MODIFY_RESP: {
|
||||
s1ap_eNB_e_rab_modify_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_e_rab_modify_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_E_RAB_MODIFY_RESP(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case S1AP_NAS_NON_DELIVERY_IND: {
|
||||
s1ap_eNB_nas_non_delivery_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_nas_non_delivery_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_NAS_NON_DELIVERY_IND(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case S1AP_PATH_SWITCH_REQ: {
|
||||
s1ap_eNB_path_switch_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_path_switch_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_PATH_SWITCH_REQ(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case S1AP_E_RAB_MODIFICATION_IND: {
|
||||
s1ap_eNB_generate_E_RAB_Modification_Indication(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_generate_E_RAB_Modification_Indication(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_E_RAB_MODIFICATION_IND(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case S1AP_UE_CONTEXT_RELEASE_COMPLETE: {
|
||||
s1ap_ue_context_release_complete(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_ue_context_release_complete(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_UE_CONTEXT_RELEASE_COMPLETE(received_msg));
|
||||
}
|
||||
break;
|
||||
@@ -392,9 +392,9 @@ void *s1ap_eNB_process_itti_msg(void *notUsed) {
|
||||
case S1AP_UE_CONTEXT_RELEASE_REQ: {
|
||||
s1ap_eNB_instance_t *s1ap_eNB_instance_p = NULL; // test
|
||||
struct s1ap_eNB_ue_context_s *ue_context_p = NULL; // test
|
||||
s1ap_ue_context_release_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_ue_context_release_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_UE_CONTEXT_RELEASE_REQ(received_msg));
|
||||
s1ap_eNB_instance_p = s1ap_eNB_get_instance(ITTI_MESSAGE_GET_INSTANCE(received_msg)); // test
|
||||
s1ap_eNB_instance_p = s1ap_eNB_get_instance(ITTI_MSG_DESTINATION_INSTANCE(received_msg)); // test
|
||||
DevAssert(s1ap_eNB_instance_p != NULL); // test
|
||||
|
||||
if ((ue_context_p = s1ap_eNB_get_ue_context(s1ap_eNB_instance_p,
|
||||
@@ -407,7 +407,7 @@ void *s1ap_eNB_process_itti_msg(void *notUsed) {
|
||||
break;
|
||||
|
||||
case S1AP_E_RAB_RELEASE_RESPONSE: {
|
||||
s1ap_eNB_e_rab_release_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_e_rab_release_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_E_RAB_RELEASE_RESPONSE(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -188,7 +188,7 @@ void s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shut
|
||||
/* If there are no more associated MME, inform eNB app */
|
||||
if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb == 0) {
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_DEREGISTERED_ENB_IND);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_DEREGISTERED_ENB_IND);
|
||||
S1AP_DEREGISTERED_ENB_IND(message_p).nb_mme = 0;
|
||||
itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p);
|
||||
}
|
||||
@@ -206,7 +206,7 @@ void s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shut
|
||||
/* If there are no more pending messages, inform eNB app */
|
||||
if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb == 0) {
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_REGISTER_ENB_CNF);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_REGISTER_ENB_CNF);
|
||||
S1AP_REGISTER_ENB_CNF(message_p).nb_mme = mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb;
|
||||
itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p);
|
||||
}
|
||||
@@ -791,7 +791,7 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
|
||||
|
||||
ue_desc_p->rx_stream = stream;
|
||||
ue_desc_p->mme_ue_s1ap_id = mme_ue_s1ap_id;
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_INITIAL_CONTEXT_SETUP_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_INITIAL_CONTEXT_SETUP_REQ);
|
||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
||||
ue_desc_p->ue_initial_id = 0;
|
||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).eNB_ue_s1ap_id = ue_desc_p->eNB_ue_s1ap_id;
|
||||
@@ -935,7 +935,7 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
|
||||
NULL,0,
|
||||
"0 S1AP_UE_CONTEXT_RELEASE_COMMAND/%d eNB_ue_s1ap_id "S1AP_UE_ID_FMT" ",
|
||||
enb_ue_s1ap_id);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_UE_CONTEXT_RELEASE_COMMAND);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_UE_CONTEXT_RELEASE_COMMAND);
|
||||
|
||||
if (ue_desc_p->mme_ue_s1ap_id == 0) { // case of Detach Request and switch off from RRC_IDLE mode
|
||||
ue_desc_p->mme_ue_s1ap_id = mme_ue_s1ap_id;
|
||||
@@ -1032,7 +1032,7 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
|
||||
ue_desc_p->mme_ue_s1ap_id, mme_ue_s1ap_id);
|
||||
}
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_E_RAB_SETUP_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_E_RAB_SETUP_REQ);
|
||||
S1AP_E_RAB_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
||||
S1AP_E_RAB_SETUP_REQ(message_p).mme_ue_s1ap_id = mme_ue_s1ap_id;
|
||||
S1AP_E_RAB_SETUP_REQ(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
||||
@@ -1126,7 +1126,7 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
||||
return -1;
|
||||
}
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_PAGING_IND);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_PAGING_IND);
|
||||
/* convert S1AP_PagingIEs_t to s1ap_paging_ind_t */
|
||||
/* id-UEIdentityIndexValue : convert UE Identity Index value */
|
||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PagingIEs_t, ie, container,
|
||||
@@ -1322,7 +1322,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
|
||||
if (ue_desc_p->mme_ue_s1ap_id != mme_ue_s1ap_id) {
|
||||
S1AP_WARN("UE context mme_ue_s1ap_id is different form that of the message (%d != %ld)",
|
||||
ue_desc_p->mme_ue_s1ap_id, mme_ue_s1ap_id);
|
||||
message_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_E_RAB_MODIFY_RESP);
|
||||
message_p = itti_alloc_new_message (TASK_RRC_ENB, 0, S1AP_E_RAB_MODIFY_RESP);
|
||||
S1AP_E_RAB_MODIFY_RESP (message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABModifyRequestIEs_t, ie, container,
|
||||
S1AP_ProtocolIE_ID_id_E_RABToBeModifiedListBearerModReq, true);
|
||||
@@ -1348,7 +1348,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
|
||||
return -1;
|
||||
}
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_E_RAB_MODIFY_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_E_RAB_MODIFY_REQ);
|
||||
S1AP_E_RAB_MODIFY_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
||||
S1AP_E_RAB_MODIFY_REQ(message_p).mme_ue_s1ap_id = mme_ue_s1ap_id;
|
||||
S1AP_E_RAB_MODIFY_REQ(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
||||
@@ -1459,7 +1459,7 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
|
||||
|
||||
S1AP_DEBUG("[SCTP %d] Received E-RAB release command for eNB_UE_S1AP_ID %ld mme_ue_s1ap_id %ld\n",
|
||||
assoc_id, enb_ue_s1ap_id, mme_ue_s1ap_id);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_E_RAB_RELEASE_COMMAND);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_E_RAB_RELEASE_COMMAND);
|
||||
S1AP_E_RAB_RELEASE_COMMAND(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
||||
S1AP_E_RAB_RELEASE_COMMAND(message_p).mme_ue_s1ap_id = mme_ue_s1ap_id;
|
||||
/* id-NAS-PDU */
|
||||
@@ -1529,7 +1529,7 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
|
||||
}
|
||||
|
||||
// send a message to RRC
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_PATH_SWITCH_REQ_ACK);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_PATH_SWITCH_REQ_ACK);
|
||||
/* mandatory */
|
||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
|
||||
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
|
||||
|
||||
@@ -29,7 +29,7 @@ void s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uin
|
||||
MessageDef *message_p;
|
||||
sctp_data_req_t *sctp_data_req;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, SCTP_DATA_REQ);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, SCTP_DATA_REQ);
|
||||
|
||||
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
|
||||
|
||||
@@ -50,7 +50,7 @@ void s1ap_eNB_itti_send_nas_downlink_ind(instance_t instance,
|
||||
MessageDef *message_p;
|
||||
s1ap_downlink_nas_t *s1ap_downlink_nas;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_DOWNLINK_NAS);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_DOWNLINK_NAS);
|
||||
|
||||
s1ap_downlink_nas = &message_p->ittiMsg.s1ap_downlink_nas;
|
||||
|
||||
@@ -68,7 +68,7 @@ void s1ap_eNB_itti_send_sctp_close_association(instance_t instance, int32_t asso
|
||||
MessageDef *message_p = NULL;
|
||||
sctp_close_association_t *sctp_close_association_p = NULL;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, SCTP_CLOSE_ASSOCIATION);
|
||||
message_p = itti_alloc_new_message(TASK_S1AP, 0, SCTP_CLOSE_ASSOCIATION);
|
||||
sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
|
||||
sctp_close_association_p->assoc_id = assoc_id;
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ int s1ap_eNB_handle_nas_first_req(
|
||||
s1ap_nas_first_req_p->ue_identity.gummei);
|
||||
|
||||
if (mme_desc_p) {
|
||||
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through GUMMEI MCC %d MNC %d MMEGI %d MMEC %d\n",
|
||||
S1AP_INFO("[eNB %ld] Chose MME '%s' (assoc_id %d) through GUMMEI MCC %d MNC %d MMEGI %d MMEC %d\n",
|
||||
instance,
|
||||
mme_desc_p->mme_name,
|
||||
mme_desc_p->assoc_id,
|
||||
@@ -101,7 +101,7 @@ int s1ap_eNB_handle_nas_first_req(
|
||||
s1ap_nas_first_req_p->ue_identity.s_tmsi.mme_code);
|
||||
|
||||
if (mme_desc_p) {
|
||||
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through S-TMSI MMEC %d and selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||
S1AP_INFO("[eNB %ld] Chose MME '%s' (assoc_id %d) through S-TMSI MMEC %d and selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||
instance,
|
||||
mme_desc_p->mme_name,
|
||||
mme_desc_p->assoc_id,
|
||||
@@ -122,7 +122,7 @@ int s1ap_eNB_handle_nas_first_req(
|
||||
s1ap_nas_first_req_p->selected_plmn_identity);
|
||||
|
||||
if (mme_desc_p) {
|
||||
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||
S1AP_INFO("[eNB %ld] Chose MME '%s' (assoc_id %d) through selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||
instance,
|
||||
mme_desc_p->mme_name,
|
||||
mme_desc_p->assoc_id,
|
||||
@@ -142,7 +142,7 @@ int s1ap_eNB_handle_nas_first_req(
|
||||
s1ap_nas_first_req_p->establishment_cause);
|
||||
|
||||
if (mme_desc_p) {
|
||||
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through highest relative capacity\n",
|
||||
S1AP_INFO("[eNB %ld] Chose MME '%s' (assoc_id %d) through highest relative capacity\n",
|
||||
instance,
|
||||
mme_desc_p->mme_name,
|
||||
mme_desc_p->assoc_id);
|
||||
|
||||
@@ -29,7 +29,7 @@ int sctp_itti_send_init_msg_multi_cnf(task_id_t task_id, instance_t instance, in
|
||||
MessageDef *message_p;
|
||||
sctp_init_msg_multi_cnf_t *sctp_init_msg_multi_cnf_p;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_INIT_MSG_MULTI_CNF);
|
||||
message_p = itti_alloc_new_message(TASK_SCTP, 0, SCTP_INIT_MSG_MULTI_CNF);
|
||||
|
||||
sctp_init_msg_multi_cnf_p = &message_p->ittiMsg.sctp_init_msg_multi_cnf;
|
||||
|
||||
@@ -45,7 +45,7 @@ int sctp_itti_send_new_message_ind(task_id_t task_id, instance_t instance,
|
||||
MessageDef *message_p;
|
||||
sctp_data_ind_t *sctp_data_ind_p;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_DATA_IND);
|
||||
message_p = itti_alloc_new_message(TASK_SCTP, 0, SCTP_DATA_IND);
|
||||
|
||||
sctp_data_ind_p = &message_p->ittiMsg.sctp_data_ind;
|
||||
|
||||
@@ -69,7 +69,7 @@ int sctp_itti_send_association_resp(task_id_t task_id, instance_t instance,
|
||||
MessageDef *message_p;
|
||||
sctp_new_association_resp_t *sctp_new_association_resp_p;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_NEW_ASSOCIATION_RESP);
|
||||
message_p = itti_alloc_new_message(TASK_SCTP, 0, SCTP_NEW_ASSOCIATION_RESP);
|
||||
|
||||
sctp_new_association_resp_p = &message_p->ittiMsg.sctp_new_association_resp;
|
||||
|
||||
@@ -89,7 +89,7 @@ int sctp_itti_send_association_ind(task_id_t task_id, instance_t instance,
|
||||
MessageDef *message_p;
|
||||
sctp_new_association_ind_t *sctp_new_association_ind_p;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_SCTP, SCTP_NEW_ASSOCIATION_IND);
|
||||
message_p = itti_alloc_new_message(TASK_SCTP, 0, SCTP_NEW_ASSOCIATION_IND);
|
||||
|
||||
sctp_new_association_ind_p = &message_p->ittiMsg.sctp_new_association_ind;
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ sctp_handle_new_association_req(
|
||||
int sd = 0;
|
||||
int32_t assoc_id = 0;
|
||||
|
||||
struct sctp_event_subscribe events;
|
||||
struct sctp_event_subscribe events={0};
|
||||
|
||||
struct sctp_cnx_list_elm_s *sctp_cnx = NULL;
|
||||
enum sctp_connection_type_e connection_type = SCTP_TYPE_CLIENT;
|
||||
@@ -1116,7 +1116,7 @@ void *sctp_eNB_process_itti_msg(void *notUsed)
|
||||
|
||||
/* We received a new connection request */
|
||||
if (sctp_create_new_listener(
|
||||
ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
ITTI_MSG_ORIGIN_ID(received_msg),
|
||||
&received_msg->ittiMsg.sctp_init,0) < 0) {
|
||||
/* SCTP socket creation or bind failed... */
|
||||
@@ -1131,7 +1131,7 @@ void *sctp_eNB_process_itti_msg(void *notUsed)
|
||||
SCTP_DEBUG("Received SCTP_INIT_MSG_MULTI_REQ\n");
|
||||
|
||||
multi_sd = sctp_create_new_listener(
|
||||
ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
ITTI_MSG_ORIGIN_ID(received_msg),
|
||||
&received_msg->ittiMsg.sctp_init_multi,1);
|
||||
/* We received a new connection request */
|
||||
@@ -1141,27 +1141,27 @@ void *sctp_eNB_process_itti_msg(void *notUsed)
|
||||
}
|
||||
sctp_itti_send_init_msg_multi_cnf(
|
||||
ITTI_MSG_ORIGIN_ID(received_msg),
|
||||
ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
multi_sd);
|
||||
}
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_REQ: {
|
||||
sctp_handle_new_association_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
sctp_handle_new_association_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
ITTI_MSG_ORIGIN_ID(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_req);
|
||||
}
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_REQ_MULTI: {
|
||||
sctp_handle_new_association_req_multi(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
sctp_handle_new_association_req_multi(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
ITTI_MSG_ORIGIN_ID(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_req_multi);
|
||||
}
|
||||
break;
|
||||
|
||||
case SCTP_CLOSE_ASSOCIATION:
|
||||
sctp_close_association(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
sctp_close_association(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
ITTI_MSG_ORIGIN_ID(received_msg),
|
||||
&received_msg->ittiMsg.sctp_close_association);
|
||||
break;
|
||||
@@ -1172,7 +1172,7 @@ void *sctp_eNB_process_itti_msg(void *notUsed)
|
||||
break;
|
||||
|
||||
case SCTP_DATA_REQ: {
|
||||
sctp_send_data(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
sctp_send_data(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
ITTI_MSG_ORIGIN_ID(received_msg),
|
||||
&received_msg->ittiMsg.sctp_data_req);
|
||||
}
|
||||
|
||||
@@ -1,307 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <poll.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
//WARNING: sctp requires libsctp-dev and -lsctp as linker option
|
||||
#include <netinet/sctp.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "assertions.h"
|
||||
#include "sctp_eNB_defs.h"
|
||||
#include "sctp_common.h"
|
||||
|
||||
#include "sctp_primitives_client.h"
|
||||
|
||||
#if defined(ENB_MODE)
|
||||
# include "eNB_default_values.h"
|
||||
#else
|
||||
# include "mme_default_values.h"
|
||||
#endif
|
||||
|
||||
/* Send buffer to SCTP association */
|
||||
int sctp_send_msg(sctp_data_t *sctp_data_p, uint16_t ppid, uint16_t stream,
|
||||
const uint8_t *buffer, const uint32_t length)
|
||||
{
|
||||
DevAssert(buffer != NULL);
|
||||
DevAssert(sctp_data_p != NULL);
|
||||
|
||||
/* Send message on specified stream of the sd association
|
||||
* NOTE: PPID should be defined in network order
|
||||
*/
|
||||
if (sctp_sendmsg(sctp_data_p->sd, (const void *)buffer, length, NULL, 0,
|
||||
htonl(ppid), 0, stream, 0, 0) < 0) {
|
||||
SCTP_ERROR("Sctp_sendmsg failed: %s\n", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
SCTP_DEBUG("Successfully sent %d bytes to port %d on stream %d\n",
|
||||
length, sctp_data_p->remote_port, stream);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
int sctp_handle_notifications(union sctp_notification *snp)
|
||||
{
|
||||
if (SCTP_SHUTDOWN_EVENT == snp->sn_header.sn_type) {
|
||||
/* Client deconnection */
|
||||
SCTP_DEBUG("Notification received: server deconnected\n");
|
||||
} else if (SCTP_ASSOC_CHANGE == snp->sn_header.sn_type) {
|
||||
/* Association has changed */
|
||||
SCTP_DEBUG("Notification received: server association changed\n");
|
||||
} else {
|
||||
SCTP_DEBUG("Notification received: %d TODO\n", snp->sn_header.sn_type);
|
||||
}
|
||||
|
||||
/* TODO: handle more notif here */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sctp_run(sctp_data_t *sctp_data_p)
|
||||
{
|
||||
int ret, repeat = 1;
|
||||
int total_size = 0;
|
||||
int sd;
|
||||
struct pollfd fds;
|
||||
|
||||
DevAssert(sctp_data_p != NULL);
|
||||
|
||||
sd = sctp_data_p->sd;
|
||||
|
||||
memset(&fds, 0, sizeof(struct pollfd));
|
||||
|
||||
fds.fd = sd;
|
||||
fds.events = POLLIN;
|
||||
|
||||
while (repeat == 1) {
|
||||
ret = poll(&fds, 1, 0);
|
||||
|
||||
if (ret < 0) {
|
||||
SCTP_ERROR("[SD %d] Poll has failed (%d:%s)\n",
|
||||
sd, errno, strerror(errno));
|
||||
return errno;
|
||||
} else if (ret == 0) {
|
||||
/* No data to read, just leave the loop */
|
||||
SCTP_DEBUG("[SD %d] Poll: no data available\n", sd);
|
||||
repeat = 0;
|
||||
} else {
|
||||
/* Socket has some data to read */
|
||||
uint8_t buffer[SCTP_RECV_BUFFER_SIZE];
|
||||
int flags = 0;
|
||||
int n;
|
||||
struct sockaddr_in addr;
|
||||
struct sctp_sndrcvinfo sinfo;
|
||||
|
||||
socklen_t from_len;
|
||||
memset((void *)&addr, 0, sizeof(struct sockaddr_in));
|
||||
from_len = (socklen_t)sizeof(struct sockaddr_in);
|
||||
memset((void *)&sinfo, 0, sizeof(struct sctp_sndrcvinfo));
|
||||
|
||||
n = sctp_recvmsg(sd, (void *)buffer, SCTP_RECV_BUFFER_SIZE,
|
||||
(struct sockaddr *)&addr, &from_len,
|
||||
&sinfo, &flags);
|
||||
|
||||
if (n < 0) {
|
||||
/* Other peer is deconnected */
|
||||
SCTP_ERROR("[SD %d] An error occured during read (%d:%s)\n",
|
||||
sd, errno, strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (flags & MSG_NOTIFICATION) {
|
||||
sctp_handle_notifications((union sctp_notification *)buffer);
|
||||
} else {
|
||||
struct sctp_queue_item_s *new_item_p;
|
||||
|
||||
new_item_p = calloc(1, sizeof(struct sctp_queue_item_s));
|
||||
/* Normal data received */
|
||||
SCTP_DEBUG("[SD %d] Msg of length %d received from %s:%u on "
|
||||
"stream %d, PPID %d, assoc_id %d\n",
|
||||
sd, n, inet_ntoa(addr.sin_addr),
|
||||
ntohs(addr.sin_port), sinfo.sinfo_stream,
|
||||
sinfo.sinfo_ppid, sinfo.sinfo_assoc_id);
|
||||
|
||||
new_item_p->local_stream = sinfo.sinfo_stream;
|
||||
new_item_p->remote_port = ntohs(addr.sin_port);
|
||||
new_item_p->remote_addr = addr.sin_addr.s_addr;
|
||||
new_item_p->ppid = sinfo.sinfo_ppid;
|
||||
new_item_p->assoc_id = sinfo.sinfo_assoc_id;
|
||||
new_item_p->length = n;
|
||||
new_item_p->buffer = malloc(sizeof(uint8_t) * n);
|
||||
|
||||
memcpy(new_item_p->buffer, buffer, n);
|
||||
|
||||
/* Insert the new packet at the tail of queue. */
|
||||
TAILQ_INSERT_TAIL(&sctp_data_p->sctp_queue, new_item_p, entry);
|
||||
|
||||
/* Update queue related data */
|
||||
sctp_data_p->queue_size += n;
|
||||
sctp_data_p->queue_length++;
|
||||
total_size += n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return total_size;
|
||||
}
|
||||
|
||||
int sctp_connect_to_remote_host(char *local_ip_addr[],
|
||||
int nb_local_addr,
|
||||
char *remote_ip_addr,
|
||||
uint16_t port,
|
||||
int socket_type,
|
||||
sctp_data_t *sctp_data_p)
|
||||
{
|
||||
int sd = -1;
|
||||
socklen_t i = 0;
|
||||
|
||||
struct sctp_initmsg init;
|
||||
struct sctp_event_subscribe events;
|
||||
struct sockaddr *bindx_add_addr;
|
||||
|
||||
DevAssert(sctp_data_p != NULL);
|
||||
DevAssert(remote_ip_addr != NULL);
|
||||
DevAssert(local_ip_addr != NULL);
|
||||
DevCheck((socket_type == SOCK_STREAM), socket_type, 0, 0);
|
||||
|
||||
SCTP_DEBUG("Creating socket type %d\n", socket_type);
|
||||
|
||||
/* Create new socket */
|
||||
if ((sd = socket(AF_INET6, SOCK_STREAM, IPPROTO_SCTP)) < 0) {
|
||||
SCTP_ERROR("Socket creation failed: %s\n", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Bind to provided IP adresses */
|
||||
bindx_add_addr = calloc(nb_local_addr, sizeof(struct sockaddr));
|
||||
|
||||
for (i = 0; i < nb_local_addr; i++) {
|
||||
if (inet_pton(AF_INET, local_ip_addr[i], &((struct sockaddr_in*)&bindx_add_addr[i])->sin_addr.s_addr) != 1) {
|
||||
if (inet_pton(AF_INET6, local_ip_addr[i], &((struct sockaddr_in6*)&bindx_add_addr[i])->sin6_addr.s6_addr) != 1) {
|
||||
continue;
|
||||
} else {
|
||||
((struct sockaddr_in6*)&bindx_add_addr[i])->sin6_port = 0;
|
||||
bindx_add_addr[i].sa_family = AF_INET6;
|
||||
}
|
||||
} else {
|
||||
((struct sockaddr_in*)&bindx_add_addr[i])->sin_port = 0;
|
||||
bindx_add_addr[i].sa_family = AF_INET;
|
||||
}
|
||||
}
|
||||
|
||||
if (sctp_bindx(sd, bindx_add_addr, nb_local_addr, SCTP_BINDX_ADD_ADDR) < 0) {
|
||||
SCTP_ERROR("Socket bind failed: %s\n", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset((void *)&init, 0, sizeof(struct sctp_initmsg));
|
||||
|
||||
/* Request a number of in/out streams */
|
||||
init.sinit_num_ostreams = SCTP_OUT_STREAMS;
|
||||
init.sinit_max_instreams = SCTP_IN_STREAMS;
|
||||
init.sinit_max_attempts = SCTP_MAX_ATTEMPTS;
|
||||
|
||||
SCTP_DEBUG("Requesting (%d %d) (in out) streams\n", init.sinit_num_ostreams,
|
||||
init.sinit_max_instreams);
|
||||
|
||||
if (setsockopt(sd, IPPROTO_SCTP, SCTP_INITMSG,
|
||||
&init, (socklen_t)sizeof(struct sctp_initmsg)) < 0) {
|
||||
SCTP_ERROR("Setsockopt IPPROTO_SCTP_INITMSG failed: %s\n",
|
||||
strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Subscribe to all events */
|
||||
events.sctp_data_io_event = 1;
|
||||
events.sctp_association_event = 1;
|
||||
events.sctp_address_event = 1;
|
||||
events.sctp_send_failure_event = 1;
|
||||
events.sctp_peer_error_event = 1;
|
||||
events.sctp_shutdown_event = 1;
|
||||
events.sctp_partial_delivery_event = 1;
|
||||
|
||||
if (setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &events,
|
||||
8) < 0) {
|
||||
SCTP_ERROR("Setsockopt IPPROTO_SCTP_EVENTS failed: %s\n",
|
||||
strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* SOCK_STREAM socket type requires an explicit connect to the remote host
|
||||
* address and port.
|
||||
* Only use IPv4 for the first connection attempt
|
||||
*/
|
||||
{
|
||||
struct sockaddr_in addr;
|
||||
|
||||
memset(&addr, 0, sizeof(struct sockaddr_in));
|
||||
|
||||
if (inet_pton(AF_INET, remote_ip_addr, &addr.sin_addr.s_addr) != 1) {
|
||||
SCTP_ERROR("Failed to convert ip address %s to network type\n", remote_ip_addr);
|
||||
goto err;
|
||||
}
|
||||
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(port);
|
||||
|
||||
SCTP_DEBUG("[%d] Sending explicit connect to %s:%u\n", sd, remote_ip_addr,
|
||||
port);
|
||||
|
||||
/* Connect to remote host and port */
|
||||
if (sctp_connectx(sd, (struct sockaddr *)&addr, 1, NULL) < 0) {
|
||||
SCTP_ERROR("Connect to %s:%u failed: %s\n", remote_ip_addr,
|
||||
port, strerror(errno));
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get SCTP status */
|
||||
sctp_get_sockinfo(sd, &sctp_data_p->instreams, &sctp_data_p->outstreams,
|
||||
&sctp_data_p->assoc_id);
|
||||
|
||||
sctp_data_p->sd = sd;
|
||||
|
||||
sctp_get_peeraddresses(sd, &sctp_data_p->remote_ip_addresses, &sctp_data_p->nb_remote_addresses);
|
||||
sctp_get_localaddresses(sd, NULL, NULL);
|
||||
|
||||
TAILQ_INIT(&sctp_data_p->sctp_queue);
|
||||
|
||||
return sd;
|
||||
|
||||
err:
|
||||
|
||||
if (sd != 0) {
|
||||
close(sd);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "sctp_eNB_defs.h"
|
||||
|
||||
#ifndef SCTP_PRIMITIVES_CLIENT_H_
|
||||
#define SCTP_PRIMITIVES_CLIENT_H_
|
||||
|
||||
/** @defgroup _sctp_impl_ SCTP Layer Reference Implementation
|
||||
* @ingroup _ref_implementation_
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** \brief SCTP recv callback prototype. Will be called every time a message is
|
||||
* received on socket.
|
||||
* \param assocId SCTP association ID
|
||||
* \param stream SCTP stream on which data had been received
|
||||
* \param buffer Pointer to data (should be freed by user)
|
||||
* \param length Length of message received
|
||||
* @return Execution result
|
||||
*/
|
||||
typedef int (*sctp_recv_callback)(uint32_t assocId,
|
||||
uint32_t stream,
|
||||
uint8_t *buffer,
|
||||
uint32_t length);
|
||||
|
||||
/** \brief SCTP connected callback prototype. Will be called once the
|
||||
* association is ready.
|
||||
* \param args argument provided by upper layer
|
||||
* \param assocId SCTP association ID
|
||||
* \param instreams Number of input streams negotiated with remote peer
|
||||
* \param outstreams Number of output streams negotiated with remote peer
|
||||
* @return Execution result
|
||||
*/
|
||||
typedef int (*sctp_connected_callback)(void *args,
|
||||
uint32_t assocId,
|
||||
uint32_t instreams,
|
||||
uint32_t outstreams);
|
||||
|
||||
/** \brief Perform association to a remote peer
|
||||
* \param ip_addr Peer IPv4 address
|
||||
* \param port Remote port to connect to
|
||||
* \param args Upper layer args that will be provided to connected callback
|
||||
* \param connected_callback Connected callback
|
||||
* \param recv_callback Data received callback
|
||||
* @return < 0 in case of failure
|
||||
*/
|
||||
int sctp_connect_to_remote_host(char *local_ip_addr[],
|
||||
int nb_local_addr,
|
||||
char *remote_ip_addr,
|
||||
uint16_t port,
|
||||
int socket_type,
|
||||
sctp_data_t *sctp_data_p);
|
||||
|
||||
/** \brief Send message over SCTP
|
||||
* \param sctp_data_p Pointer to the SCTP desc
|
||||
* \param ppid Payload Protocol Identifier
|
||||
* \param stream SCTP stream on which data will be sent
|
||||
* \param buffer Pointer to buffer
|
||||
* \param length Buffer length
|
||||
* @return < 0 in case of failure
|
||||
*/
|
||||
int sctp_send_msg(sctp_data_t *sctp_data_p, uint16_t ppid, uint16_t stream,
|
||||
const uint8_t *buffer, const uint32_t length);
|
||||
|
||||
/** \brief Flush the FIFO of messages from the socket
|
||||
* \param sctp_data_p
|
||||
* @return < 0 in case of failure
|
||||
*/
|
||||
int sctp_run(sctp_data_t *sctp_data_p);
|
||||
|
||||
/** \brief Properly disconnect the peer
|
||||
* \param assoc_id The SCTP association ID
|
||||
* @return < 0 in case of failure
|
||||
*/
|
||||
void sctp_disconnect(uint32_t assoc_id);
|
||||
|
||||
void sctp_terminate(void);
|
||||
|
||||
/* @} */
|
||||
#endif /* SCTP_PRIMITIVES_CLIENT_H_ */
|
||||
@@ -729,7 +729,7 @@ void *et_eNB_app_task(void *args_p)
|
||||
itti_receive_msg (TASK_ENB_APP, &msg_p);
|
||||
|
||||
msg_name = ITTI_MSG_NAME (msg_p);
|
||||
instance = ITTI_MSG_INSTANCE (msg_p);
|
||||
instance = ITTI_MSG_DESTINATION_INSTANCE (msg_p);
|
||||
|
||||
switch (ITTI_MSG_ID(msg_p)) {
|
||||
case TERMINATE_MESSAGE:
|
||||
@@ -1204,7 +1204,7 @@ int main( int argc, char **argv )
|
||||
logInit();
|
||||
set_glog(LOG_TRACE, LOG_MED);
|
||||
|
||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
|
||||
itti_init(TASK_MAX, tasks_info);
|
||||
|
||||
set_comp_log(ENB_APP, LOG_TRACE, LOG_MED, 1);
|
||||
set_comp_log(S1AP, LOG_TRACE, LOG_MED, 1);
|
||||
|
||||
@@ -1101,13 +1101,13 @@ void *et_s1ap_eNB_task(void *arg)
|
||||
* Each eNB has to send an S1AP_REGISTER_ENB message with its
|
||||
* own parameters.
|
||||
*/
|
||||
et_s1ap_eNB_handle_register_eNB(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
et_s1ap_eNB_handle_register_eNB(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_REGISTER_ENB_REQ(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_RESP: {
|
||||
et_s1ap_eNB_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
et_s1ap_eNB_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_resp);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* Calling each layer init function */
|
||||
log_init(&mme_config);
|
||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
|
||||
itti_init(TASK_MAX, tasks_info);
|
||||
sctp_init(&mme_config);
|
||||
udp_init(&mme_config);
|
||||
s1ap_mme_init(&mme_config);
|
||||
|
||||
@@ -193,7 +193,7 @@ static void *eNB_app_task(void *args_p)
|
||||
itti_receive_msg (TASK_ENB_APP, &msg_p);
|
||||
|
||||
msg_name = ITTI_MSG_NAME (msg_p);
|
||||
instance = ITTI_MSG_INSTANCE (msg_p);
|
||||
instance = ITTI_MSG_DESTINATION_INSTANCE (msg_p);
|
||||
|
||||
switch (ITTI_MSG_ID(msg_p)) {
|
||||
case TERMINATE_MESSAGE:
|
||||
@@ -309,7 +309,7 @@ int main( int argc, char **argv )
|
||||
/* Read eNB configuration file */
|
||||
enb_properties = enb_config_init(conf_config_file_name);
|
||||
|
||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
|
||||
itti_init(TASK_MAX, tasks_info);
|
||||
|
||||
itti_wait_ready(1);
|
||||
|
||||
|
||||
@@ -260,13 +260,13 @@ void *s1ap_eNB_task(void *arg)
|
||||
* Each eNB has to send an S1AP_REGISTER_ENB message with its
|
||||
* own parameters.
|
||||
*/
|
||||
s1ap_eNB_handle_register_eNB(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_handle_register_eNB(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&S1AP_REGISTER_ENB_REQ(received_msg));
|
||||
}
|
||||
break;
|
||||
|
||||
case SCTP_NEW_ASSOCIATION_RESP: {
|
||||
s1ap_eNB_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
s1ap_eNB_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_new_association_resp);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -257,7 +257,7 @@ void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP)
|
||||
forwarded_buffer = itti_malloc(TASK_UDP, udp_sock_pP->task_id, n*sizeof(uint8_t));
|
||||
DevAssert(forwarded_buffer != NULL);
|
||||
memcpy(forwarded_buffer, l_buffer, n);
|
||||
message_p = itti_alloc_new_message(TASK_UDP, UDP_DATA_IND);
|
||||
message_p = itti_alloc_new_message(TASK_UDP, 0, UDP_DATA_IND);
|
||||
DevAssert(message_p != NULL);
|
||||
udp_data_ind_p = &message_p->ittiMsg.udp_data_ind;
|
||||
udp_data_ind_p->buffer = forwarded_buffer;
|
||||
@@ -318,7 +318,7 @@ void *udp_eNB_task(void *args_p)
|
||||
if (received_message_p != NULL) {
|
||||
|
||||
//msg_name = ITTI_MSG_NAME (received_message_p);
|
||||
//instance = ITTI_MSG_INSTANCE (received_message_p);
|
||||
//instance = ITTI_MSG_DESTINATION_INSTANCE (received_message_p);
|
||||
|
||||
switch (ITTI_MSG_ID(received_message_p)) {
|
||||
case UDP_INIT: {
|
||||
|
||||
Reference in New Issue
Block a user