Use (CU-initiated) F1 Reset Acknowledgement in stack
This commit is contained in:
@@ -117,35 +117,21 @@ int DU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream,
|
||||
|
||||
int DU_send_RESET_ACKNOWLEDGE(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack)
|
||||
{
|
||||
F1AP_F1AP_PDU_t pdu= {0};
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
/* Create */
|
||||
/* 0. pdu Type */
|
||||
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
|
||||
asn1cCalloc(pdu.choice.successfulOutcome, successMsg);
|
||||
successMsg->procedureCode = F1AP_ProcedureCode_id_Reset;
|
||||
successMsg->criticality = F1AP_Criticality_reject;
|
||||
successMsg->value.present = F1AP_SuccessfulOutcome__value_PR_ResetAcknowledge;
|
||||
F1AP_ResetAcknowledge_t *f1ResetAcknowledge = &successMsg->value.choice.ResetAcknowledge;
|
||||
/* mandatory */
|
||||
/* c1. Transaction ID (integer value) */
|
||||
asn1cSequenceAdd(f1ResetAcknowledge->protocolIEs.list, F1AP_ResetAcknowledgeIEs_t, ieC1);
|
||||
ieC1->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
||||
ieC1->criticality = F1AP_Criticality_reject;
|
||||
ieC1->value.present = F1AP_ResetAcknowledgeIEs__value_PR_TransactionID;
|
||||
ieC1->value.choice.TransactionID = ack->transaction_id;
|
||||
|
||||
/* TODO: (Optional) partialF1Interface, criticality diagnostics */
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1ResetAcknowledge\n");
|
||||
F1AP_F1AP_PDU_t *pdu = encode_f1ap_reset_ack(ack);
|
||||
if (!pdu) {
|
||||
LOG_E(F1AP, "failed to create ASN.1 message for reset acknowledge\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* send */
|
||||
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
|
||||
/* encode */
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int encoded = f1ap_encode_pdu(pdu, &buffer, &len);
|
||||
ASN_STRUCT_FREE(asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
if (encoded <= 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1ResetAcknowledge\n");
|
||||
return -1;
|
||||
}
|
||||
f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user