Commit 9b143e9a authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

CI: astyle to help merge


Signed-off-by: Raphael Defosseux's avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent ee3b6509
......@@ -96,13 +96,13 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
static
int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
uint32_t stream,
S1AP_S1AP_PDU_t *pdu);
uint32_t stream,
S1AP_S1AP_PDU_t *pdu);
static
int s1ap_eNB_handle_s1_path_switch_request_failure(uint32_t assoc_id,
uint32_t stream,
S1AP_S1AP_PDU_t *pdu);
uint32_t stream,
S1AP_S1AP_PDU_t *pdu);
/* Handlers matrix. Only eNB related procedure present here */
s1ap_message_decoded_callback messages_callback[][3] = {
......@@ -781,9 +781,7 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
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;
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).mme_ue_s1ap_id = ue_desc_p->mme_ue_s1ap_id;
/* id-uEaggregateMaximumBitrate */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_uEaggregateMaximumBitrate, true);
......@@ -1387,26 +1385,20 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
static
int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
uint32_t stream,
S1AP_S1AP_PDU_t *pdu)
{
uint32_t stream,
S1AP_S1AP_PDU_t *pdu) {
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
s1ap_eNB_ue_context_t *ue_desc_p = NULL;
MessageDef *message_p = NULL;
S1AP_PathSwitchRequestAcknowledge_t *pathSwitchRequestAcknowledge;
S1AP_PathSwitchRequestAcknowledgeIEs_t *ie;
S1AP_E_RABToBeSwitchedULItemIEs_t *s1ap_E_RABToBeSwitchedULItemIEs;
S1AP_E_RABToBeSwitchedULItem_t *s1ap_E_RABToBeSwitchedULItem;
S1AP_E_RABItemIEs_t *e_RABItemIEs;
S1AP_E_RABItem_t *e_RABItem;
DevAssert(pdu != NULL);
pathSwitchRequestAcknowledge = &pdu->choice.successfulOutcome.value.choice.PathSwitchRequestAcknowledge;
/* Path Switch request == UE-related procedure -> stream !=0 */
if (stream == 0) {
S1AP_ERROR("[SCTP %d] Received s1 path switch request ack on stream (%d)\n",
......@@ -1422,11 +1414,9 @@ 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);
/* mandatory */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
S1AP_PATH_SWITCH_REQ_ACK(message_p).eNB_ue_s1ap_id = ie->value.choice.ENB_UE_S1AP_ID;
if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance,
......@@ -1438,94 +1428,79 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
}
S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
/* mandatory */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
S1AP_PATH_SWITCH_REQ_ACK(message_p).mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
if ( ue_desc_p->mme_ue_s1ap_id != ie->value.choice.MME_UE_S1AP_ID){
if ( ue_desc_p->mme_ue_s1ap_id != ie->value.choice.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, ie->value.choice.MME_UE_S1AP_ID);
}
/* mandatory */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
S1AP_ProtocolIE_ID_id_SecurityContext, true);
S1AP_PATH_SWITCH_REQ_ACK(message_p).next_hop_chain_count =
ie->value.choice.SecurityContext.nextHopChainingCount;
memcpy(&S1AP_PATH_SWITCH_REQ_ACK(message_p).next_security_key,
ie->value.choice.SecurityContext.nextHopParameter.buf,
ie->value.choice.SecurityContext.nextHopParameter.size);
ie->value.choice.SecurityContext.nextHopParameter.size);
/* optional */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
S1AP_ProtocolIE_ID_id_uEaggregateMaximumBitrate, false);
if (ie) {
OCTET_STRING_TO_INT32 (
&ie->value.choice.UEAggregateMaximumBitrate.uEaggregateMaximumBitRateUL,
S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_ambr.br_ul
);
&ie->value.choice.UEAggregateMaximumBitrate.uEaggregateMaximumBitRateUL,
S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_ambr.br_ul
);
OCTET_STRING_TO_INT32 (
&ie->value.choice.UEAggregateMaximumBitrate.uEaggregateMaximumBitRateDL,
S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_ambr.br_dl
);
&ie->value.choice.UEAggregateMaximumBitrate.uEaggregateMaximumBitRateDL,
S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_ambr.br_dl
);
} else {
S1AP_WARN("UEAggregateMaximumBitrate not supported\n");
S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_ambr.br_ul = 0;
S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_ambr.br_dl = 0;
}
/* optional */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
S1AP_ProtocolIE_ID_id_E_RABToBeSwitchedULList, false);
S1AP_ProtocolIE_ID_id_E_RABToBeSwitchedULList, false);
if (ie) {
S1AP_PATH_SWITCH_REQ_ACK(message_p).nb_e_rabs_tobeswitched = ie->value.choice.E_RABToBeSwitchedULList.list.count;
for (int i = 0; i < ie->value.choice.E_RABToBeSwitchedULList.list.count; i++) {
s1ap_E_RABToBeSwitchedULItemIEs = (S1AP_E_RABToBeSwitchedULItemIEs_t *)ie->value.choice.E_RABToBeSwitchedULList.list.array[i];
s1ap_E_RABToBeSwitchedULItem = &s1ap_E_RABToBeSwitchedULItemIEs->value.choice.E_RABToBeSwitchedULItem;
S1AP_PATH_SWITCH_REQ_ACK (message_p).e_rabs_tobeswitched[i].e_rab_id = s1ap_E_RABToBeSwitchedULItem->e_RAB_ID;
memcpy(S1AP_PATH_SWITCH_REQ_ACK (message_p).e_rabs_tobeswitched[i].sgw_addr.buffer,
s1ap_E_RABToBeSwitchedULItem->transportLayerAddress.buf, s1ap_E_RABToBeSwitchedULItem->transportLayerAddress.size);
s1ap_E_RABToBeSwitchedULItem->transportLayerAddress.buf, s1ap_E_RABToBeSwitchedULItem->transportLayerAddress.size);
S1AP_PATH_SWITCH_REQ_ACK (message_p).e_rabs_tobeswitched[i].sgw_addr.length =
s1ap_E_RABToBeSwitchedULItem->transportLayerAddress.size * 8 - s1ap_E_RABToBeSwitchedULItem->transportLayerAddress.bits_unused;
s1ap_E_RABToBeSwitchedULItem->transportLayerAddress.size * 8 - s1ap_E_RABToBeSwitchedULItem->transportLayerAddress.bits_unused;
OCTET_STRING_TO_INT32(&s1ap_E_RABToBeSwitchedULItem->gTP_TEID,
S1AP_PATH_SWITCH_REQ_ACK (message_p).e_rabs_tobeswitched[i].gtp_teid);
S1AP_PATH_SWITCH_REQ_ACK (message_p).e_rabs_tobeswitched[i].gtp_teid);
}
}
else {
} else {
S1AP_WARN("E_RABToBeSwitchedULList not supported\n");
S1AP_PATH_SWITCH_REQ_ACK(message_p).nb_e_rabs_tobeswitched = 0;
}
/* optional */
/* optional */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
S1AP_ProtocolIE_ID_id_E_RABToBeReleasedList, false);
if (ie) {
S1AP_PATH_SWITCH_REQ_ACK(message_p).nb_e_rabs_tobereleased = ie->value.choice.E_RABList.list.count;
for (int i = 0; i < ie->value.choice.E_RABList.list.count; i++) {
e_RABItemIEs = (S1AP_E_RABItemIEs_t *)ie->value.choice.E_RABList.list.array[i];
e_RABItem = &e_RABItemIEs->value.choice.E_RABItem;
S1AP_PATH_SWITCH_REQ_ACK (message_p).e_rabs_tobereleased[i].e_rab_id = e_RABItem->e_RAB_ID;
}
}
else {
} else {
S1AP_WARN("E_RABToBeReleasedList not supported\n");
S1AP_PATH_SWITCH_REQ_ACK(message_p).nb_e_rabs_tobereleased = 0;
}
......@@ -1533,6 +1508,7 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
/* optional */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
S1AP_ProtocolIE_ID_id_CriticalityDiagnostics, false);
if(!ie) {
S1AP_WARN("Critical Diagnostic not supported\n");
}
......@@ -1540,30 +1516,24 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
/* optional */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID_2, false);
if(!ie) {
S1AP_WARN("MME_UE_S1AP_ID_2 flag not supported\n");
}
// TODO continue
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
return 0;
}
static
int s1ap_eNB_handle_s1_path_switch_request_failure(uint32_t assoc_id,
uint32_t stream,
S1AP_S1AP_PDU_t *pdu)
{
uint32_t stream,
S1AP_S1AP_PDU_t *pdu) {
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
S1AP_PathSwitchRequestFailure_t *pathSwitchRequestFailure;
S1AP_PathSwitchRequestFailureIEs_t *ie;
DevAssert(pdu != NULL);
pathSwitchRequestFailure = &pdu->choice.unsuccessfulOutcome.value.choice.PathSwitchRequestFailure;
if (stream != 0) {
......@@ -1582,24 +1552,29 @@ int s1ap_eNB_handle_s1_path_switch_request_failure(uint32_t assoc_
S1AP_ProtocolIE_ID_id_Cause, true);
switch(ie->value.choice.Cause.present) {
case S1AP_Cause_PR_NOTHING:
S1AP_WARN("Received S1 Error indication cause NOTHING\n");
break;
case S1AP_Cause_PR_radioNetwork:
S1AP_WARN("Radio Network Layer Cause Failure\n");
break;
case S1AP_Cause_PR_transport:
S1AP_WARN("Transport Layer Cause Failure\n");
break;
case S1AP_Cause_PR_nas:
S1AP_WARN("NAS Cause Failure\n");
break;
case S1AP_Cause_PR_misc:
S1AP_WARN("Miscelaneous Cause Failure\n");
break;
default:
S1AP_WARN("Received an unknown S1 Error indication cause\n");
break;
case S1AP_Cause_PR_NOTHING:
S1AP_WARN("Received S1 Error indication cause NOTHING\n");
break;
case S1AP_Cause_PR_radioNetwork:
S1AP_WARN("Radio Network Layer Cause Failure\n");
break;
case S1AP_Cause_PR_transport:
S1AP_WARN("Transport Layer Cause Failure\n");
break;
case S1AP_Cause_PR_nas:
S1AP_WARN("NAS Cause Failure\n");
break;
case S1AP_Cause_PR_misc:
S1AP_WARN("Miscelaneous Cause Failure\n");
break;
default:
S1AP_WARN("Received an unknown S1 Error indication cause\n");
break;
}
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestFailureIEs_t, ie, pathSwitchRequestFailure,
......@@ -1608,8 +1583,7 @@ int s1ap_eNB_handle_s1_path_switch_request_failure(uint32_t assoc_
if(!ie) {
S1AP_WARN("Critical Diagnostic not supported\n");
}
// TODO continue
// TODO continue
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment