Commit 175fb176 authored by Cedric Roux's avatar Cedric Roux Committed by magounak

dual connectivity: preparatory work

- basic version of x2ap_eNB_generate_senb_addition_request with dumb values
- skeleton functions:
    - x2ap_eNB_handle_senb_addition_request
    - x2ap_eNB_handle_senb_addition_request_acknowledge
    - x2ap_eNB_handle_senb_addition_request_reject
parent 920c1452
......@@ -993,3 +993,101 @@ int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_
return ret;
}
int x2ap_eNB_generate_senb_addition_request (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p
/* TODO: pass needed parameters */)
{
X2AP_X2AP_PDU_t pdu;
X2AP_SeNBAdditionRequest_t *out;
X2AP_SeNBAdditionRequest_IEs_t *ie;
uint8_t *buffer;
uint32_t len;
int ret = 0;
DevAssert(instance_p != NULL);
DevAssert(x2ap_eNB_data_p != NULL);
/* Prepare the X2AP SeNB Addition Request message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = X2AP_X2AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = X2AP_ProcedureCode_id_seNBAdditionPreparation;
pdu.choice.initiatingMessage.criticality = X2AP_Criticality_reject;
pdu.choice.initiatingMessage.value.present = X2AP_InitiatingMessage__value_PR_SeNBAdditionRequest;
out = &pdu.choice.initiatingMessage.value.choice.SeNBAdditionRequest;
/* id-MeNB-UE-X2AP-ID - mandatory - criticality reject */
ie = (X2AP_SeNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SeNBAdditionRequest_IEs_t));
ie->id = X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID;
ie->criticality = X2AP_Criticality_reject;
ie->value.present = X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID;
ie->value.choice.UE_X2AP_ID = 0; /* TODO */
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* id-UE-SecurityCapabilities - conditional - criticality reject */
/* TODO */
/* id-SeNBSecurityKey - conditional - criticality reject */
/* TODO */
/* id-SeNBUEAggregateMaximumBitRate - mandatory - criticality reject */
ie = (X2AP_SeNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SeNBAdditionRequest_IEs_t));
ie->id = X2AP_ProtocolIE_ID_id_SeNBUEAggregateMaximumBitRate;
ie->criticality = X2AP_Criticality_reject;
ie->value.present = X2AP_ProtocolIE_ID_id_SeNBUEAggregateMaximumBitRate;
if (asn_imax2INTEGER(&ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateDownlink, 0) != 0) { /* TODO: right value */
LOG_E(X2AP, "%s:%d:%s: fatal asn1 error\n", __FILE__, __LINE__, __FUNCTION__);
exit(1);
}
if (asn_imax2INTEGER(&ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateUplink, 0) != 0) { /* TODO: right value */
LOG_E(X2AP, "%s:%d:%s: fatal asn1 error\n", __FILE__, __LINE__, __FUNCTION__);
exit(1);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* id-ServingPLMN - optional - criticality ignore */
/* TODO */
/* id-E-RABs-ToBeAdded-List - mandatory - criticality reject */
ie = (X2AP_SeNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SeNBAdditionRequest_IEs_t));
ie->id = X2AP_ProtocolIE_ID_id_SeNBUEAggregateMaximumBitRate;
ie->criticality = X2AP_Criticality_reject;
ie->value.present = X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_List;
/* TODO: set value of ie->value.choice.E_RABs_ToBeAdded_List.list */
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* id-MeNBtoSeNBContainer - mandatory - criticality reject */
ie = (X2AP_SeNBAdditionRequest_IEs_t *)calloc(1, sizeof(X2AP_SeNBAdditionRequest_IEs_t));
ie->id = X2AP_ProtocolIE_ID_id_MeNBtoSeNBContainer;
ie->criticality = X2AP_Criticality_reject;
ie->value.present = X2AP_ProtocolIE_ID_id_MeNBtoSeNBContainer;
/* TODO: set value of ie->value.choice.MeNBtoSeNBContainer */
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* id-CSGMembershipStatus - optional - criticality reject */
/* TODO */
/* id-SeNB-UE-X2AP-ID - optional - criticality reject */
/* TODO */
/* id-SeNB-UE-X2AP-ID-Extension - optional - criticality reject */
/* TODO */
/* id-ExpectedUEBehaviour - optional - criticality ignore */
/* TODO */
/* id-MeNB-UE-X2AP-ID-Extension - optional - criticality reject */
/* TODO */
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
X2AP_ERROR("Failed to encode X2AP SeNB Addition Request\n");
abort();
return -1;
}
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2SeNBAdditionRequest/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1);
return ret;
}
......@@ -60,4 +60,7 @@ int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_
int x2_ue_id,
x2ap_handover_cancel_cause_t cause);
int x2ap_eNB_generate_senb_addition_request (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p
/* TODO: pass needed parameters */);
#endif /* X2AP_ENB_GENERATE_MESSAGES_H_ */
......@@ -84,6 +84,24 @@ int x2ap_eNB_handle_handover_cancel (instance_t instance,
uint32_t stream,
X2AP_X2AP_PDU_t *pdu);
static
int x2ap_eNB_handle_senb_addition_request (instance_t instance,
uint32_t assoc_id,
uint32_t stream,
X2AP_X2AP_PDU_t *pdu);
static
int x2ap_eNB_handle_senb_addition_request_acknowledge (instance_t instance,
uint32_t assoc_id,
uint32_t stream,
X2AP_X2AP_PDU_t *pdu);
static
int x2ap_eNB_handle_senb_addition_request_reject (instance_t instance,
uint32_t assoc_id,
uint32_t stream,
X2AP_X2AP_PDU_t *pdu);
/* Handlers matrix. Only eNB related procedure present here */
x2ap_message_decoded_callback x2ap_messages_callback[][3] = {
{ x2ap_eNB_handle_handover_preparation, x2ap_eNB_handle_handover_response, 0 }, /* handoverPreparation */
......@@ -105,7 +123,7 @@ x2ap_message_decoded_callback x2ap_messages_callback[][3] = {
{ 0, 0, 0 }, /* x2Release */
{ 0, 0, 0 }, /* x2APMessageTransfer */
{ 0, 0, 0 }, /* x2Removal */
{ 0, 0, 0 }, /* seNBAdditionPreparation */
{ x2ap_eNB_handle_senb_addition_request, x2ap_eNB_handle_senb_addition_request_acknowledge, x2ap_eNB_handle_senb_addition_request_reject }, /* seNBAdditionPreparation */
{ 0, 0, 0 }, /* seNBReconfigurationCompletion */
{ 0, 0, 0 }, /* meNBinitiatedSeNBModificationPreparation */
{ 0, 0, 0 }, /* seNBinitiatedSeNBModification */
......@@ -1073,3 +1091,33 @@ int x2ap_eNB_handle_handover_cancel (instance_t instance,
return 0;
}
static
int x2ap_eNB_handle_senb_addition_request (instance_t instance,
uint32_t assoc_id,
uint32_t stream,
X2AP_X2AP_PDU_t *pdu)
{
printf("%s:%d:%s:TODO\n", __FILE__, __LINE__, __FUNCTION__);
return 0;
}
static
int x2ap_eNB_handle_senb_addition_request_acknowledge (instance_t instance,
uint32_t assoc_id,
uint32_t stream,
X2AP_X2AP_PDU_t *pdu)
{
printf("%s:%d:%s:TODO\n", __FILE__, __LINE__, __FUNCTION__);
return 0;
}
static
int x2ap_eNB_handle_senb_addition_request_reject (instance_t instance,
uint32_t assoc_id,
uint32_t stream,
X2AP_X2AP_PDU_t *pdu)
{
printf("%s:%d:%s:TODO\n", __FILE__, __LINE__, __FUNCTION__);
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