Commit 59c2b9eb authored by yaojie's avatar yaojie

fixed warnings and add ie for PDUSessionResourceReleaseCommandTransfer

parent 6e2f63bf
...@@ -741,6 +741,10 @@ typedef struct ngap_ue_release_command_s { ...@@ -741,6 +741,10 @@ typedef struct ngap_ue_release_command_s {
typedef struct pdusession_release_s { typedef struct pdusession_release_s {
/* Unique pdusession_id for the UE. */ /* Unique pdusession_id for the UE. */
uint8_t pdusession_id; uint8_t pdusession_id;
/* Octet string data */
uint8_t *transfer_buffer;
/* Length of the octet string */
uint32_t transfer_length;
} pdusession_release_t; } pdusession_release_t;
typedef struct ngap_ue_release_req_s { typedef struct ngap_ue_release_req_s {
......
...@@ -1270,7 +1270,6 @@ rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE( ...@@ -1270,7 +1270,6 @@ rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(
//clear release pdusessions //clear release pdusessions
ue_context_pP->ue_context.nb_release_of_pdusessions = 0; ue_context_pP->ue_context.nb_release_of_pdusessions = 0;
memset(&ue_context_pP->ue_context.pdusessions_release_failed[0], 0, sizeof(pdusession_failed_t)*NGAP_MAX_PDUSESSION); memset(&ue_context_pP->ue_context.pdusessions_release_failed[0], 0, sizeof(pdusession_failed_t)*NGAP_MAX_PDUSESSION);
return 0;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -1291,7 +1290,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( ...@@ -1291,7 +1290,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
uint8_t xid; uint8_t xid;
int i, pdusession; int i, pdusession;
uint8_t b_existed,is_existed; uint8_t b_existed,is_existed;
uint8_t pdusession_release_drb; uint8_t pdusession_release_drb = 0;
memcpy(&pdusession_release_params[0], &(NGAP_PDUSESSION_RELEASE_COMMAND (msg_p).pdusession_release_params[0]), memcpy(&pdusession_release_params[0], &(NGAP_PDUSESSION_RELEASE_COMMAND (msg_p).pdusession_release_params[0]),
sizeof(pdusession_release_t)*NGAP_MAX_PDUSESSION); sizeof(pdusession_release_t)*NGAP_MAX_PDUSESSION);
...@@ -1307,7 +1306,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( ...@@ -1307,7 +1306,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0); PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
xid = rrc_gNB_get_next_transaction_identifier(ctxt.module_id); xid = rrc_gNB_get_next_transaction_identifier(ctxt.module_id);
LOG_I(NR_RRC,"PDU Session Release Command: AMF_UE_NGAP_ID %lu GNB_UE_NGAP_ID %d release_pdusessions %d \n", LOG_I(NR_RRC,"PDU Session Release Command: AMF_UE_NGAP_ID %lu GNB_UE_NGAP_ID %d release_pdusessions %d \n",
NGAP_PDUSESSION_RELEASE_COMMAND (msg_p).amf_ue_ngap_id, gNB_ue_ngap_id, nb_pdusessions_torelease); NGAP_PDUSESSION_RELEASE_COMMAND (msg_p).amf_ue_ngap_id&0x000000FFFFFFFFFF, gNB_ue_ngap_id, nb_pdusessions_torelease);
for (pdusession = 0; pdusession < nb_pdusessions_torelease; pdusession++) { for (pdusession = 0; pdusession < nb_pdusessions_torelease; pdusession++) {
b_existed = 0; b_existed = 0;
...@@ -1385,7 +1384,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( ...@@ -1385,7 +1384,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
} }
} else { } else {
LOG_E(NR_RRC, "PDU Session Release Command: AMF_UE_NGAP_ID %lu GNB_UE_NGAP_ID %d Error ue_context_p NULL \n", LOG_E(NR_RRC, "PDU Session Release Command: AMF_UE_NGAP_ID %lu GNB_UE_NGAP_ID %d Error ue_context_p NULL \n",
NGAP_PDUSESSION_RELEASE_COMMAND (msg_p).amf_ue_ngap_id, NGAP_PDUSESSION_RELEASE_COMMAND(msg_p).gNB_ue_ngap_id); NGAP_PDUSESSION_RELEASE_COMMAND (msg_p).amf_ue_ngap_id&0x000000FFFFFFFFFF, NGAP_PDUSESSION_RELEASE_COMMAND(msg_p).gNB_ue_ngap_id);
return -1; return -1;
} }
......
...@@ -149,4 +149,11 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( ...@@ -149,4 +149,11 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
instance_t instance instance_t instance
); );
void
rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP,
uint8_t xid
);
#endif #endif
...@@ -1850,7 +1850,18 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id, ...@@ -1850,7 +1850,18 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
item_p = (NGAP_PDUSessionResourceToReleaseItemRelCmd_t *)ie->value.choice.PDUSessionResourceToReleaseListRelCmd.list.array[i]; item_p = (NGAP_PDUSessionResourceToReleaseItemRelCmd_t *)ie->value.choice.PDUSessionResourceToReleaseListRelCmd.list.array[i];
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].pdusession_id = item_p->pDUSessionID; NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].pdusession_id = item_p->pDUSessionID;
NGAP_DEBUG("[SCTP] Received pdu session release command for pDUSessionID id %ld\n", item_p->pDUSessionID); if(item_p->pDUSessionResourceReleaseCommandTransfer.size > 0) {
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].transfer_length = item_p->pDUSessionResourceReleaseCommandTransfer.size;
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].transfer_buffer = malloc(sizeof(uint8_t) * item_p->pDUSessionResourceReleaseCommandTransfer.size);
memcpy(NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].transfer_buffer,
item_p->pDUSessionResourceReleaseCommandTransfer.buf,
item_p->pDUSessionResourceReleaseCommandTransfer.size);
}else {
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].transfer_length = 0;
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].transfer_buffer = NULL;
NGAP_ERROR("[NGAP] Received pdu session release command for pDUSessionResourceReleaseCommandTransfer is NULL!\n");
}
NGAP_DEBUG("[NGAP] Received pdu session release command for pDUSessionID id %ld\n", item_p->pDUSessionID);
} }
} else { } else {
return -1; return -1;
......
...@@ -1425,6 +1425,17 @@ int ngap_gNB_pdusession_release_resp(instance_t instance, ...@@ -1425,6 +1425,17 @@ int ngap_gNB_pdusession_release_resp(instance_t instance,
item = (NGAP_PDUSessionResourceReleasedItemRelRes_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleasedItemRelRes_t)); item = (NGAP_PDUSessionResourceReleasedItemRelRes_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleasedItemRelRes_t));
item->pDUSessionID = pdusession_release_resp_p->pdusession_release[i].pdusession_id; item->pDUSessionID = pdusession_release_resp_p->pdusession_release[i].pdusession_id;
if(pdusession_release_resp_p->pdusession_release[i].transfer_length > 0){
item->pDUSessionResourceReleaseResponseTransfer.size = pdusession_release_resp_p->pdusession_release[i].transfer_length;
item->pDUSessionResourceReleaseResponseTransfer.buf = malloc(sizeof(uint8_t) * pdusession_release_resp_p->pdusession_release[i].transfer_length);
memcpy(item->pDUSessionResourceReleaseResponseTransfer.buf,
pdusession_release_resp_p->pdusession_release[i].transfer_buffer,
pdusession_release_resp_p->pdusession_release[i].transfer_length);
}else {
item->pDUSessionResourceReleaseResponseTransfer.size = 0;
item->pDUSessionResourceReleaseResponseTransfer.buf = NULL;
NGAP_DEBUG("pdusession_release_resp: transfer_buffer is NULL!\n");
}
NGAP_DEBUG("pdusession_release_resp: pdusession ID %ld\n", item->pDUSessionID); NGAP_DEBUG("pdusession_release_resp: pdusession ID %ld\n", item->pDUSessionID);
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceReleasedListRelRes.list, item); ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceReleasedListRelRes.list, item);
} }
......
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