Commit b0c79092 authored by yincong's avatar yincong

modify PDUSessionResourceSetupRequest

parent a02b0b40
...@@ -638,7 +638,7 @@ typedef struct ngap_pdusession_setup_req_s { ...@@ -638,7 +638,7 @@ typedef struct ngap_pdusession_setup_req_s {
} ngap_pdusession_setup_req_t; } ngap_pdusession_setup_req_t;
typedef struct ngap_pdusession_setup_resp_s { typedef struct ngap_pdusession_setup_resp_s {
unsigned gNB_ue_ngap_id:24; uint32_t gNB_ue_ngap_id:24;
/* Number of pdusession setup-ed in the list */ /* Number of pdusession setup-ed in the list */
uint8_t nb_of_pdusessions; uint8_t nb_of_pdusessions;
......
...@@ -1254,18 +1254,17 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id, ...@@ -1254,18 +1254,17 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
} }
ue_desc_p->rx_stream = stream; ue_desc_p->rx_stream = stream;
ue_desc_p->amf_ue_ngap_id = amf_ue_ngap_id;
if ( ue_desc_p->amf_ue_ngap_id != amf_ue_ngap_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 (%d != %ld)", NGAP_WARN("UE context amf_ue_ngap_id is different form that of the message (%lu != %lu)",
ue_desc_p->amf_ue_ngap_id, amf_ue_ngap_id); 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, NGAP_PDUSESSION_SETUP_REQ);
NGAP_PDUSESSION_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id; NGAP_PDUSESSION_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
ue_desc_p->ue_initial_id = 0; 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; NGAP_PDUSESSION_SETUP_REQ(message_p).gNB_ue_ngap_id = ue_desc_p->gNB_ue_ngap_id;
NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).amf_ue_ngap_id = ue_desc_p->amf_ue_ngap_id; NGAP_PDUSESSION_SETUP_REQ(message_p).amf_ue_ngap_id = ue_desc_p->amf_ue_ngap_id;
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_PDUSessionResourceSetupRequestIEs_t, ie, container, NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_PDUSessionResourceSetupRequestIEs_t, ie, container,
NGAP_ProtocolIE_ID_id_PDUSessionResourceSetupListSUReq, true); NGAP_ProtocolIE_ID_id_PDUSessionResourceSetupListSUReq, true);
...@@ -1322,10 +1321,10 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id, ...@@ -1322,10 +1321,10 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
NGAP_GTPTunnel_t *gTPTunnel_p; NGAP_GTPTunnel_t *gTPTunnel_p;
gTPTunnel_p = &pdusessionTransfer_ies->value.choice.UPTransportLayerInformation.choice.gTPTunnel; gTPTunnel_p = &pdusessionTransfer_ies->value.choice.UPTransportLayerInformation.choice.gTPTunnel;
/* The transport layer address for the IP packets */ /* The transport layer address for the IP packets */
OCTET_STRING_TO_INT32(&gTPTunnel_p->gTP_TEID, NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).pdusession_param[i].gtp_teid); OCTET_STRING_TO_INT32(&gTPTunnel_p->gTP_TEID, NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].gtp_teid);
NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).pdusession_param[i].upf_addr.length = NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].upf_addr.length =
gTPTunnel_p->transportLayerAddress.size * 8 - gTPTunnel_p->transportLayerAddress.bits_unused; gTPTunnel_p->transportLayerAddress.size * 8 - gTPTunnel_p->transportLayerAddress.bits_unused;
memcpy(NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).pdusession_param[i].upf_addr.buffer , memcpy(NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].upf_addr.buffer ,
gTPTunnel_p->transportLayerAddress.buf, gTPTunnel_p->transportLayerAddress.size); gTPTunnel_p->transportLayerAddress.buf, gTPTunnel_p->transportLayerAddress.size);
} }
break; break;
...@@ -1340,7 +1339,7 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id, ...@@ -1340,7 +1339,7 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
/* mandatory PDUSessionType */ /* mandatory PDUSessionType */
case NGAP_ProtocolIE_ID_id_PDUSessionType: case NGAP_ProtocolIE_ID_id_PDUSessionType:
NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).pdusession_param[i].upf_addr.pdu_session_type = (uint8_t)pdusessionTransfer_ies->value.choice.PDUSessionType; NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].upf_addr.pdu_session_type = (uint8_t)pdusessionTransfer_ies->value.choice.PDUSessionType;
break; break;
/* optional SecurityIndication */ /* optional SecurityIndication */
...@@ -1360,19 +1359,19 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id, ...@@ -1360,19 +1359,19 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
DevAssert(pdusessionTransfer_ies->value.choice.QosFlowSetupRequestList.list.count > 0); DevAssert(pdusessionTransfer_ies->value.choice.QosFlowSetupRequestList.list.count > 0);
DevAssert(pdusessionTransfer_ies->value.choice.QosFlowSetupRequestList.list.count <= NGAP_maxnoofQosFlows); DevAssert(pdusessionTransfer_ies->value.choice.QosFlowSetupRequestList.list.count <= NGAP_maxnoofQosFlows);
NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).pdusession_param[i].nb_qos = pdusessionTransfer_ies->value.choice.QosFlowSetupRequestList.list.count; NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].nb_qos = pdusessionTransfer_ies->value.choice.QosFlowSetupRequestList.list.count;
for(int qosIdx = 0; qosIdx < pdusessionTransfer_ies->value.choice.QosFlowSetupRequestList.list.count; qosIdx++){ for(int qosIdx = 0; qosIdx < pdusessionTransfer_ies->value.choice.QosFlowSetupRequestList.list.count; qosIdx++){
qosFlowItem_p = pdusessionTransfer_ies->value.choice.QosFlowSetupRequestList.list.array[qosIdx]; qosFlowItem_p = pdusessionTransfer_ies->value.choice.QosFlowSetupRequestList.list.array[qosIdx];
/* Set the QOS informations */ /* Set the QOS informations */
NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).pdusession_param[i].qos[qosIdx].qci = (uint8_t)qosFlowItem_p->qosFlowIdentifier; NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].qos[qosIdx].qci = (uint8_t)qosFlowItem_p->qosFlowIdentifier;
NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).pdusession_param[i].qos[qosIdx].allocation_retention_priority.priority_level = NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].qos[qosIdx].allocation_retention_priority.priority_level =
qosFlowItem_p->qosFlowLevelQosParameters.allocationAndRetentionPriority.priorityLevelARP; qosFlowItem_p->qosFlowLevelQosParameters.allocationAndRetentionPriority.priorityLevelARP;
NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).pdusession_param[i].qos[qosIdx].allocation_retention_priority.pre_emp_capability = NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].qos[qosIdx].allocation_retention_priority.pre_emp_capability =
qosFlowItem_p->qosFlowLevelQosParameters.allocationAndRetentionPriority.pre_emptionCapability; qosFlowItem_p->qosFlowLevelQosParameters.allocationAndRetentionPriority.pre_emptionCapability;
NGAP_INITIAL_CONTEXT_SETUP_REQ(message_p).pdusession_param[i].qos[qosIdx].allocation_retention_priority.pre_emp_vulnerability = NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].qos[qosIdx].allocation_retention_priority.pre_emp_vulnerability =
qosFlowItem_p->qosFlowLevelQosParameters.allocationAndRetentionPriority.pre_emptionVulnerability; qosFlowItem_p->qosFlowLevelQosParameters.allocationAndRetentionPriority.pre_emptionVulnerability;
} }
} }
......
...@@ -669,7 +669,7 @@ int ngap_gNB_initial_ctxt_resp( ...@@ -669,7 +669,7 @@ int ngap_gNB_initial_ctxt_resp(
if (!(ue_context_p->ue_state == NGAP_UE_CONNECTED || if (!(ue_context_p->ue_state == NGAP_UE_CONNECTED ||
ue_context_p->ue_state == NGAP_UE_WAITING_CSR)) { ue_context_p->ue_state == NGAP_UE_WAITING_CSR)) {
NGAP_WARN("You are attempting to send NAS data over non-connected " NGAP_WARN("You are attempting to send NAS data over non-connected "
"gNB ue ngap id: %06x, current state: %d\n", "gNB ue ngap id: %08x, current state: %d\n",
initial_ctxt_resp_p->gNB_ue_ngap_id, ue_context_p->ue_state); initial_ctxt_resp_p->gNB_ue_ngap_id, ue_context_p->ue_state);
return -1; return -1;
} }
...@@ -969,7 +969,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ...@@ -969,7 +969,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
if ((ue_context_p = ngap_gNB_get_ue_context(ngap_gNB_instance_p, if ((ue_context_p = ngap_gNB_get_ue_context(ngap_gNB_instance_p,
pdusession_setup_resp_p->gNB_ue_ngap_id)) == NULL) { pdusession_setup_resp_p->gNB_ue_ngap_id)) == NULL) {
/* The context for this gNB ue ngap id doesn't exist in the map of gNB UEs */ /* The context for this gNB ue ngap id doesn't exist in the map of gNB UEs */
NGAP_WARN("Failed to find ue context associated with gNB ue ngap id: 0x%06x\n", NGAP_WARN("Failed to find ue context associated with gNB ue ngap id: 0x%08x\n",
pdusession_setup_resp_p->gNB_ue_ngap_id); pdusession_setup_resp_p->gNB_ue_ngap_id);
return -1; return -1;
} }
...@@ -980,7 +980,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ...@@ -980,7 +980,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
if (!(ue_context_p->ue_state == NGAP_UE_CONNECTED || if (!(ue_context_p->ue_state == NGAP_UE_CONNECTED ||
ue_context_p->ue_state == NGAP_UE_WAITING_CSR)) { ue_context_p->ue_state == NGAP_UE_WAITING_CSR)) {
NGAP_WARN("You are attempting to send NAS data over non-connected " NGAP_WARN("You are attempting to send NAS data over non-connected "
"gNB ue ngap id: %06x, current state: %d\n", "gNB ue ngap id: %08x, current state: %d\n",
pdusession_setup_resp_p->gNB_ue_ngap_id, ue_context_p->ue_state); pdusession_setup_resp_p->gNB_ue_ngap_id, ue_context_p->ue_state);
return -1; return -1;
} }
...@@ -998,8 +998,6 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ...@@ -998,8 +998,6 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
ie->criticality = NGAP_Criticality_ignore; ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_PDUSessionResourceSetupResponseIEs__value_PR_AMF_UE_NGAP_ID; ie->value.present = NGAP_PDUSessionResourceSetupResponseIEs__value_PR_AMF_UE_NGAP_ID;
asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id); asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id);
//ie->value.choice.AMF_UE_NGAP_ID = ue_context_p->amf_ue_ngap_id;
asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
ie = (NGAP_PDUSessionResourceSetupResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceSetupResponseIEs_t)); ie = (NGAP_PDUSessionResourceSetupResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceSetupResponseIEs_t));
......
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