Merge remote-tracking branch 'origin/nrppa_ngap_integration' into integration_2026_w10 (!3884)

Integrate NRPPA and NGAP messages required for positioning

This MR integrates NRPPA and NGAP messages required for positioning.
The following NGAP messages are integrated (3GPP 38.413 Version 16.0.0):

NGAP UPLINK UE ASSOCIATED NRPPA TRANSPORT
NGAP UPLINK NON UE ASSOCIATED NRPPA TRANSPORT
NGAP DOWNLINK UE ASSOCIATED NRPPA TRANSPORT
NGAP DOWNLINK NON UE ASSOCIATED NRPPA TRANSPORT

The following NRPPA messages are integrated (3GPP 38.455 Version 16.7.1):

TRP Information Request
TRP Information Response
Positioning Information Request
Positioning Information Response
Positioning activation request
Positioning Activation Response
Measurement Request
Measurement Response

This MR tests these messages via a standalone tester nr-cu-nrppa-test that
connects to the AMF to perform NGAP enc/dec and NRPPA enc/dec

Core Network:
To pull the docker images:

docker pull oaisoftwarealliance/ims:latest
docker pull oaisoftwarealliance/oai-amf:develop
docker pull oaisoftwarealliance/oai-nrf:develop
docker pull oaisoftwarealliance/oai-smf:develop
docker pull oaisoftwarealliance/oai-udr:develop
docker pull oaisoftwarealliance/oai-upf:develop
docker pull oaisoftwarealliance/oai-udm:develop
docker pull oaisoftwarealliance/oai-ausf:develop
docker pull oaisoftwarealliance/oai-lmf:develop

openairinterface5g$ cd doc/tutorial_resources/oai-cn5g
To deploy:
openairinterface5g/doc/tutorial_resources/oai-cn5g$ docker compose -f docker-compose-positioning.yaml up -d

To undeploy:
openairinterface5g/doc/tutorial_resources/oai-cn5g$ docker compose -f docker-compose-positioning.yaml down -t 0

RAN:
To compile:
openairinterface5g$ mkdir build
openairinterface5g$ cd build
openairinterface5g/build$ cmake .. -GNinja
openairinterface5g/build$ ninja nr-cu-nrppa-test

To run:
openairinterface5g/build$ LD_LIBRARY_PATH=. ./tests/nr-cu-nrppa/nr-cu-nrppa-test -O ../tests/nr-cu-nrppa/nr-nrppa-test.conf

To initiate positioning procedure:
openairinterface5g$ cd doc/tutorial_resources/positioning/
openairinterface5g/doc/tutorial_resources/positioning$ curl --http2-prior-knowledge -H "Content-Type: application/json" -d "@InputData.json" -X POST http://192.168.70.141:8080/nlmf-loc/v1/determine-location
This commit is contained in:
Jaroslava Fiedlerova
2026-03-06 09:59:34 +01:00
52 changed files with 6530 additions and 174 deletions
+3
View File
@@ -441,6 +441,7 @@ add_library(ngap
${NGAP_DIR}/ngap_gNB_overload.c
${NGAP_DIR}/ngap_gNB_trace.c
${NGAP_DIR}/ngap_gNB_ue_context.c
${NGAP_DIR}/ngap_gNB_NRPPa_transport_procedures.c
)
target_link_libraries(ngap PUBLIC asn1_ngap)
target_link_libraries(ngap PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
@@ -1308,6 +1309,8 @@ set (GNB_APP_SRC
${OPENAIR2_DIR}/GNB_APP/gnb_app.c
${OPENAIR2_DIR}/E1AP/e1ap_setup.c
${OPENAIR2_DIR}/GNB_APP/gnb_config.c
${OPENAIR2_DIR}/GNB_APP/gnb_config_common.c
${OPENAIR2_DIR}/GNB_APP/gnb_config_ng.c
)
set (MCE_APP_SRC
+1
View File
@@ -165,6 +165,7 @@ static const char *const flag_name[] = {FOREACH_FLAG(FLAG_TEXT) ""};
COMP_DEF(M2AP, ) \
COMP_DEF(M3AP, ) \
COMP_DEF(NGAP, ) \
COMP_DEF(NRPPA, ) \
COMP_DEF(GNB_APP, log) \
COMP_DEF(NR_RRC, log) \
COMP_DEF(NR_MAC, log) \
+21
View File
@@ -586,6 +586,27 @@ ID = LEGACY_NGAP_TRACE
GROUP = ALL:LEGACY_NGAP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_NRPPA_INFO
DESC = NRPPA legacy logs - info level
GROUP = ALL:LEGACY_NRPPA:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NRPPA_ERROR
DESC = NRPPA legacy logs - error level
GROUP = ALL:LEGACY_NRPPA:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NRPPA_WARNING
DESC = NRPPA legacy logs - warning level
GROUP = ALL:LEGACY_NRPPA:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NRPPA_DEBUG
DESC = NRPPA legacy logs - debug level
GROUP = ALL:LEGACY_NRPPA:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NRPPA_TRACE
DESC = NRPPA legacy logs - trace level
GROUP = ALL:LEGACY_NRPPA:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_X2AP_INFO
DESC = X2AP legacy logs - info level
GROUP = ALL:LEGACY_X2AP:LEGACY_GROUP_INFO:LEGACY
+1 -1
View File
@@ -14,4 +14,4 @@
#include "openair2/COMMON/f1ap_messages_def.h"
#include "openair2/COMMON/e1ap_messages_def.h"
#include "openair2/COMMON/ngap_messages_def.h"
#include "openair2/COMMON/nrppa_messages_def.h"
@@ -230,6 +230,7 @@ typedef struct IttiMsgText_s {
#include <openair2/COMMON/udp_messages_types.h>
#include <openair2/COMMON/gtpv1_u_messages_types.h>
#include <openair2/COMMON/ngap_messages_types.h>
#include <openair2/COMMON/nrppa_messages_types.h>
#include <openair3/SCTP/sctp_eNB_task.h>
#include <openair3/NAS/UE/nas_proc_defs.h>
#include <openair3/NAS/UE/ESM/esmData.h>
@@ -294,6 +295,7 @@ typedef struct {
TASK_DEF(TASK_RAL_ENB, 200) \
TASK_DEF(TASK_S1AP, 200) \
TASK_DEF(TASK_NGAP, 200) \
TASK_DEF(TASK_NRPPA, 200) \
TASK_DEF(TASK_X2AP, 200) \
TASK_DEF(TASK_M2AP_ENB, 200) \
TASK_DEF(TASK_M2AP_MCE, 200) \
+3 -2
View File
@@ -121,8 +121,9 @@ The other SDRs (AW2S, LimeSDR, ...) have no READMEs.
## Testing
- [UnitTests.md](./UnitTests.md) explains the unit testing setup
- Component tests are under `tests/`. Currently, there is a simple CU-UP
tester, see the corresponding [README.md](../tests/nr-cuup/README.md).
- Component tests are under `tests/`. Currently, the following component tests are supported
- A simple CU-UP tester, see the corresponding [README.md](../tests/nr-cuup/README.md).
- A CU-NRPPA tester, see the corresponding [README.md](../tests/nr-cu-nrppa/README.md).
- [TESTBenches.md](./TESTBenches.md) lists the CI setup and links to pipelines
- The CI setup uses a [custom framework](../ci-scripts/README.md) to run
end-to-end tests.
@@ -100,6 +100,12 @@ nfs:
port: 8080
api_version: v1
interface_name: eth0
lmf:
host: oai-lmf
sbi:
port: 8080
api_version: v1
interface_name: eth0
#### Common for UDR and AMF
database:
@@ -220,6 +226,20 @@ upf:
- dnn: "ims"
- dnn: "default"
lmf:
http_threads_count: 8
gnb_id_bits_count: 28
num_gnb: 1
trp_info_wait_ms: 500
positioning_wait_ms: 500
measurement_wait_ms: 500
support_features:
request_trp_info: no
determine_num_gnb: yes
use_http2: yes
use_fqdn_dns: no
register_nrf: yes
## DNN configuration
dnns:
- dnn: "oai"
@@ -0,0 +1,195 @@
services:
mysql:
container_name: "mysql"
image: mysql:8.0
volumes:
- ./database/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
- ./healthscripts/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
environment:
- TZ=Europe/Paris
- MYSQL_DATABASE=oai_db
- MYSQL_USER=test
- MYSQL_PASSWORD=test
- MYSQL_ROOT_PASSWORD=linux
healthcheck:
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
interval: 5s
timeout: 2s
retries: 10
networks:
public_net:
ipv4_address: 192.168.70.131
ims:
container_name: "ims"
image: oaisoftwarealliance/ims:latest
volumes:
- ./conf/sip.conf:/etc/asterisk/sip.conf
- ./conf/users.conf:/etc/asterisk/users.conf
healthcheck:
test: /bin/bash -c "pgrep asterisk"
interval: 5s
timeout: 2s
retries: 10
networks:
public_net:
ipv4_address: 192.168.70.139
oai-udr:
container_name: "oai-udr"
image: oaisoftwarealliance/oai-udr:develop
expose:
- 80/tcp
- 8080/tcp
volumes:
- ./conf/config.yaml:/openair-udr/etc/config.yaml
environment:
- TZ=Europe/Paris
depends_on:
- mysql
- oai-nrf
networks:
public_net:
ipv4_address: 192.168.70.136
oai-udm:
container_name: "oai-udm"
image: oaisoftwarealliance/oai-udm:develop
expose:
- 80/tcp
- 8080/tcp
volumes:
- ./conf/config.yaml:/openair-udm/etc/config.yaml
environment:
- TZ=Europe/Paris
depends_on:
- oai-udr
networks:
public_net:
ipv4_address: 192.168.70.137
oai-ausf:
container_name: "oai-ausf"
image: oaisoftwarealliance/oai-ausf:develop
expose:
- 80/tcp
- 8080/tcp
volumes:
- ./conf/config.yaml:/openair-ausf/etc/config.yaml
environment:
- TZ=Europe/Paris
depends_on:
- oai-udm
networks:
public_net:
ipv4_address: 192.168.70.138
oai-nrf:
container_name: "oai-nrf"
image: oaisoftwarealliance/oai-nrf:develop
expose:
- 80/tcp
- 8080/tcp
volumes:
- ./conf/config.yaml:/openair-nrf/etc/config.yaml
environment:
- TZ=Europe/Paris
networks:
public_net:
ipv4_address: 192.168.70.130
oai-amf:
container_name: "oai-amf"
image: oaisoftwarealliance/oai-amf:develop
expose:
- 80/tcp
- 8080/tcp
- 38412/sctp
volumes:
- ./conf/config.yaml:/openair-amf/etc/config.yaml
environment:
- TZ=Europe/Paris
depends_on:
- mysql
- oai-nrf
- oai-ausf
networks:
public_net:
ipv4_address: 192.168.70.132
oai-lmf:
container_name: "oai-lmf"
image: oaisoftwarealliance/oai-lmf:develop
#image: oai-lmf:psoElementwiseTdoAmeanVarTDoAfilter
expose:
- 80/tcp
- 8080/tcp
volumes:
- ./conf/config.yaml:/openair-lmf/etc/config.yaml
environment:
- TZ=Europe/Paris
depends_on:
- mysql
- oai-nrf
- oai-amf
networks:
public_net:
ipv4_address: 192.168.70.141
oai-smf:
container_name: "oai-smf"
image: oaisoftwarealliance/oai-smf:develop
expose:
- 80/tcp
- 8080/tcp
- 8805/udp
volumes:
- ./conf/config.yaml:/openair-smf/etc/config.yaml
environment:
- TZ=Europe/Paris
depends_on:
- oai-nrf
- oai-amf
networks:
public_net:
ipv4_address: 192.168.70.133
oai-upf:
container_name: "oai-upf"
image: oaisoftwarealliance/oai-upf:develop
expose:
- 2152/udp
- 8805/udp
volumes:
- ./conf/config.yaml:/openair-upf/etc/config.yaml
environment:
- TZ=Europe/Paris
depends_on:
- oai-nrf
- oai-smf
cap_add:
- NET_ADMIN
- SYS_ADMIN
cap_drop:
- ALL
privileged: true
networks:
public_net:
ipv4_address: 192.168.70.134
oai-ext-dn:
privileged: true
init: true
container_name: oai-ext-dn
image: oaisoftwarealliance/trf-gen-cn5g:jammy
entrypoint: /bin/bash -c \
"ip route add 10.0.0.0/16 via 192.168.70.134 dev eth0; ip route; sleep infinity"
command: ["/bin/bash", "-c", "trap : SIGTERM SIGINT; sleep infinity & wait"]
healthcheck:
test: /bin/bash -c "ip r | grep 10.0.0"
interval: 5s
timeout: 2s
retries: 10
networks:
public_net:
ipv4_address: 192.168.70.135
networks:
public_net:
driver: bridge
name: oai-cn5g-public-net
ipam:
config:
- subnet: 192.168.70.128/26
driver_opts:
com.docker.network.bridge.name: "oai-cn5g"
@@ -0,0 +1,43 @@
{
"externalClientType": "VALUE_ADDED_SERVICES",
"amfId": "128:1:1",
"locationQoS": {
"hAccuracy": 1.5,
"vAccuracy": 1.5,
"verticalRequested": true,
"responseTime": "LOW_DELAY",
"lcsQosClass": "BEST_EFFORT"
},
"supportedGADShapes": [
"POINT",
"POINT_UNCERTAINTY_CIRCLE"
],
"supi": "imsi-001010000000001",
"ncgi": {
"plmnId": {
"mcc": "001",
"mnc": "01"
},
"nrCellId": "14680064",
"nid": "0"
},
"priority": "HIGHEST_PRIORITY",
"velocityRequested": "VELOCITY_IS_NOT_REQUESTED",
"lcsServiceType": 127,
"ldrType": "UE_AVAILABLE",
"hgmlcCallBackURI": "198.168.70.129",
"ldrReference": "11",
"lirReference": "1",
"periodicEventInfo": {
"reportingAmount": 10,
"reportingInterval": 60
},
"reportingAccessTypes": [
"NR",
"NON_3GPP_CONNECTED_TO_5GC"
],
"ueConnectivityStates": {
"accessType": "3GPP_ACCESS",
"connectivitystate": "IDLE"
}
}
+23
View File
@@ -305,6 +305,29 @@ typedef struct {
int32_t reserved;
} prs_meas_t;
// Configuration parameters required for 5G Positioning
// TRP Cartesian Coordinate information
typedef struct trp_s {
// TRP id
uint32_t id;
// TRP x-axis value
uint32_t x_axis;
// TRP y-axis value
uint32_t y_axis;
// TRP z-axis value
uint32_t z_axis;
// 0 = mm, 1 = cm, 2 = dm
uint8_t unit;
} trp_t;
#define MAX_NUM_TRPs 8
typedef struct {
trp_t trps[MAX_NUM_TRPs];
uint8_t num_trp;
// Serving gNB indicator
bool is_serving_gNB;
} positioning_config_t;
// rel16 prs k_prime table as per ts138.211 sec.7.4.1.7.2
#define K_PRIME_TABLE_ROW_SIZE 4
#define K_PRIME_TABLE_COL_SIZE 12
+15
View File
@@ -88,3 +88,18 @@ MESSAGE_DEF(NGAP_HANDOVER_CANCEL_ACK, MESSAGE_PRIORITY_MED, ngap_handover_cancel
/* NGAP <-> RRC messages (can be initiated either by MME or gNB) */
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_REQ , MESSAGE_PRIORITY_MED, ngap_ue_release_req_t , ngap_ue_release_req)
/* NGAP -> NRPPA messages*/
MESSAGE_DEF(NGAP_DOWNLINKUEASSOCIATEDNRPPA,
MESSAGE_PRIORITY_MED,
ngap_downlink_ue_associated_nrppa_t,
ngap_downlink_ue_associated_nrppa)
MESSAGE_DEF(NGAP_DOWNLINKNONUEASSOCIATEDNRPPA,
MESSAGE_PRIORITY_MED,
ngap_downlink_non_ue_associated_nrppa_t,
ngap_downlink_non_ue_associated_nrppa)
MESSAGE_DEF(NGAP_UPLINKUEASSOCIATEDNRPPA, MESSAGE_PRIORITY_MED, ngap_uplink_ue_associated_nrppa_t, ngap_uplink_ue_associated_nrppa)
MESSAGE_DEF(NGAP_UPLINKNONUEASSOCIATEDNRPPA,
MESSAGE_PRIORITY_MED,
ngap_uplink_non_ue_associated_nrppa_t,
ngap_uplink_non_ue_associated_nrppa)
+45
View File
@@ -79,6 +79,11 @@
#define NGAP_UL_RAN_STATUS_TRANSFER(mSGpTR) (mSGpTR)->ittiMsg.ngap_ul_ran_status_transfer
#define NGAP_DL_RAN_STATUS_TRANSFER(mSGpTR) (mSGpTR)->ittiMsg.ngap_dl_ran_status_transfer
#define NGAP_DOWNLINKUEASSOCIATEDNRPPA(mSGpTR) (mSGpTR)->ittiMsg.ngap_downlink_ue_associated_nrppa
#define NGAP_DOWNLINKNONUEASSOCIATEDNRPPA(mSGpTR) (mSGpTR)->ittiMsg.ngap_downlink_non_ue_associated_nrppa
#define NGAP_UPLINKUEASSOCIATEDNRPPA(mSGpTR) (mSGpTR)->ittiMsg.ngap_uplink_ue_associated_nrppa
#define NGAP_UPLINKNONUEASSOCIATEDNRPPA(mSGpTR) (mSGpTR)->ittiMsg.ngap_uplink_non_ue_associated_nrppa
//-------------------------------------------------------------------------------------------//
/* Length of the transport layer address string
@@ -1007,4 +1012,44 @@ typedef struct {
ngap_ran_status_container_t ran_status;
} ngap_ran_status_transfer_t;
// Uplink UE Associated NRPPA Transport message (9.2.9.2 3GPP 38.413 v16.0.0)
typedef struct {
// AMF UE NGAP ID (Mandatory)
uint64_t amf_ue_ngap_id;
// RAN UE NGAP ID (Mandatory)
uint32_t gNB_ue_ngap_id;
// Routing ID (Mandatory)
byte_array_t routing_id;
// NRPPa pdu (Mandatory)
byte_array_t nrppa_pdu;
} ngap_uplink_ue_associated_nrppa_t;
// Uplink NON UE Associated NRPPA Transport message (9.2.9.4 3GPP 38.413 v16.0.0)
typedef struct {
// Routing ID (Mandatory)
byte_array_t routing_id;
// NRPPa pdu (Mandatory)
byte_array_t nrppa_pdu;
} ngap_uplink_non_ue_associated_nrppa_t;
// Downlink UE Associated NRPPA Transport message (9.2.9.1 3GPP 38.413 v16.0.0)
typedef struct {
// AMF UE NGAP ID (Mandatory)
uint64_t amf_ue_ngap_id;
// RAN UE NGAP ID (Mandatory)
uint32_t gNB_ue_ngap_id;
// Routing ID (Mandatory)
byte_array_t routing_id;
// NRPPa pdu (Mandatory)
byte_array_t nrppa_pdu;
} ngap_downlink_ue_associated_nrppa_t;
// Downlink NON UE Associated NRPPA Transport message (9.2.9.3 3GPP 38.413 v16.0.0)
typedef struct {
// Routing ID (Mandatory)
byte_array_t routing_id;
// NRPPa pdu (Mandatory)
byte_array_t nrppa_pdu;
} ngap_downlink_non_ue_associated_nrppa_t;
#endif /* NGAP_MESSAGES_TYPES_H_ */
+44
View File
@@ -0,0 +1,44 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "openair2/COMMON/nrppa_messages_types.h"
// LMF -> CU
MESSAGE_DEF(NRPPA_TRP_INFORMATION_REQ, MESSAGE_PRIORITY_MED, nrppa_trp_information_req_t, nrppa_trp_information_req)
MESSAGE_DEF(NRPPA_TRP_INFORMATION_RESP, MESSAGE_PRIORITY_MED, nrppa_trp_information_resp_t, nrppa_trp_information_resp)
MESSAGE_DEF(NRPPA_POSITIONING_INFORMATION_REQ,
MESSAGE_PRIORITY_MED,
nrppa_positioning_information_req_t,
nrppa_positioning_information_req)
MESSAGE_DEF(NRPPA_POSITIONING_INFORMATION_RESP,
MESSAGE_PRIORITY_MED,
nrppa_positioning_information_resp_t,
nrppa_positioning_information_resp)
MESSAGE_DEF(NRPPA_POSITIONING_ACTIVATION_REQ,
MESSAGE_PRIORITY_MED,
nrppa_positioning_activation_req_t,
nrppa_positioning_activation_req)
MESSAGE_DEF(NRPPA_POSITIONING_ACTIVATION_RESP,
MESSAGE_PRIORITY_MED,
nrppa_positioning_activation_resp_t,
nrppa_positioning_activation_resp)
MESSAGE_DEF(NRPPA_MEASUREMENT_REQ, MESSAGE_PRIORITY_MED, nrppa_measurement_req_t, nrppa_measurement_req)
MESSAGE_DEF(NRPPA_MEASUREMENT_RESP, MESSAGE_PRIORITY_MED, nrppa_measurement_resp_t, nrppa_measurement_resp)
+824
View File
@@ -0,0 +1,824 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef NRPPA_MESSAGES_TYPES_H_
#define NRPPA_MESSAGES_TYPES_H_
// Defines to access message fields.
#define NRPPA_TRP_INFORMATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nrppa_trp_information_req
#define NRPPA_TRP_INFORMATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.nrppa_trp_information_resp
#define NRPPA_POSITIONING_INFORMATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nrppa_positioning_information_req
#define NRPPA_POSITIONING_INFORMATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.nrppa_positioning_information_resp
#define NRPPA_POSITIONING_ACTIVATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nrppa_positioning_activation_req
#define NRPPA_POSITIONING_ACTIVATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.nrppa_positioning_activation_resp
#define NRPPA_MEASUREMENT_REQ(mSGpTR) (mSGpTR)->ittiMsg.nrppa_measurement_req
#define NRPPA_MEASUREMENT_RESP(mSGpTR) (mSGpTR)->ittiMsg.nrppa_measurement_resp
/* Structure of Positioning related NRPPA messages */
/* IE structures for Positioning related messages as per TS 38.455 V16.7.1*/
typedef enum nrppa_trp_information_type_item_e {
NRPPA_TRP_INFORMATION_TYPE_ITEM_NR_PCI,
NRPPA_TRP_INFORMATION_TYPE_ITEM_NG_RAN_CGI,
NRPPA_TRP_INFORMATION_TYPE_ITEM_NR_ARFCN,
NRPPA_TRP_INFORMATION_TYPE_ITEM_PRS_CONFIG,
NRPPA_TRP_INFORMATION_TYPE_ITEM_SSB_CONFIG,
NRPPA_TRP_INFORMATION_TYPE_ITEM_SFN_INIT_TIME,
NRPPA_TRP_INFORMATION_TYPE_ITEM_SPATIAL_DIRECTION_INFO,
NRPPA_TRP_INFORMATION_TYPE_ITEM_GEO_COORDINATES
} nrppa_trp_information_type_item_pr;
typedef struct nrppa_trp_information_type_list_s {
nrppa_trp_information_type_item_pr *trp_information_type_item;
uint8_t trp_information_type_list_length;
} nrppa_trp_information_type_list_t;
typedef struct nrppa_trp_list_item_s {
uint32_t trp_id;
} nrppa_trp_list_item_t;
typedef struct nrppa_trp_list_s {
nrppa_trp_list_item_t *trp_list_item;
uint32_t trp_list_length;
} nrppa_trp_list_t;
typedef struct nrppa_access_point_position_s {
long latitude_sign;
long latitude;
long longitude;
long direction_of_altitude;
long altitude;
long uncertainty_semi_major;
long uncertainty_semi_minor;
long orientation_of_major_axis;
long uncertainty_altitude;
long confidence;
} nrppa_access_point_position_t;
typedef struct nrppa_ngran_high_accuracy_access_point_position_s {
long latitude;
long longitude;
long altitude;
long uncertainty_semi_major;
long uncertainty_semi_minor;
long orientation_of_major_axis;
long horizontal_confidence;
long uncertainty_altitude;
long vertical_confidence;
} nrppa_ngran_high_accuracy_access_point_position_t;
typedef union nrppa_trp_position_direct_accuracy_c {
nrppa_access_point_position_t trp_position;
nrppa_ngran_high_accuracy_access_point_position_t trp_HAposition;
} nrppa_trp_position_direct_accuracy_u;
typedef enum nrppa_trp_position_direct_accuracy_e {
NRPPA_TRP_POSITION_DIRECT_ACCURACY_PR_NOTHING,
NRPPA_TRP_POSITION_DIRECT_ACCURACY_PR_TRPPOSITION,
NRPPA_TRP_POSITION_DIRECT_ACCURACY_PR_TRPHAPOSITION
} nrppa_trp_position_direct_accuracy_pr;
typedef struct nrppa_trp_position_direct_accuracy_s {
nrppa_trp_position_direct_accuracy_pr present;
nrppa_trp_position_direct_accuracy_u choice;
} nrppa_trp_position_direct_accuracy_t;
typedef struct nrppa_trp_position_direct_s {
nrppa_trp_position_direct_accuracy_t accuracy;
} nrppa_trp_position_direct_t;
typedef enum nrppa_reference_point_e {
NRPPA_REFERENCE_POINT_PR_NOTHING,
NRPPA_REFERENCE_POINT_PR_COORDINATEID,
NRPPA_REFERENCE_POINT_PR_REFERENCEPOINTCOORDINATE,
NRPPA_REFERENCE_POINT_PR_REFERENCEPOINTCOORDINATEHA
} nrppa_reference_point_pr;
typedef union nrppa_reference_point_c {
long coordinate_id;
nrppa_access_point_position_t reference_point_coordinate;
nrppa_ngran_high_accuracy_access_point_position_t reference_point_coordinateHA;
} nrppa_reference_point_u;
typedef struct nrppa_reference_point_s {
nrppa_reference_point_pr present;
nrppa_reference_point_u choice;
} nrppa_reference_point_t;
typedef struct nrppa_location_uncertainty_s {
long horizontal_uncertainty;
long horizontal_confidence;
long vertical_uncertainty;
long vertical_confidence;
} nrppa_location_uncertainty_t;
typedef struct nrppa_relative_geodetic_location_s {
long milli_arc_second_units;
long height_units;
long delta_latitude;
long delta_longitude;
long delta_height;
nrppa_location_uncertainty_t location_uncertainty;
} nrppa_relative_geodetic_location_t;
typedef struct nrppa_relative_cartesian_location_s {
long xyz_unit;
long xvalue;
long yvalue;
long zvalue;
nrppa_location_uncertainty_t location_uncertainty;
} nrppa_relative_cartesian_location_t;
typedef union nrppa_trp_reference_point_type_c {
nrppa_relative_geodetic_location_t trp_position_relative_geodetic;
nrppa_relative_cartesian_location_t trp_position_relative_cartesian;
} nrppa_trp_reference_point_type_u;
typedef enum nrppa_trp_reference_point_type_e {
NRPPA_TRP_REFERENCE_POINT_TYPE_PR_NOTHING,
NRPPA_TRP_REFERENCE_POINT_TYPE_PR_TRPPOSITION_RELATIVE_GEODETIC,
NRPPA_TRP_REFERENCE_POINT_TYPE_PR_TRPPOSITION_RELATIVE_CARTESIAN
} nrppa_trp_reference_point_type_pr;
typedef struct nrppa_trp_reference_point_type_t {
nrppa_trp_reference_point_type_pr present;
nrppa_trp_reference_point_type_u choice;
} nrppa_trp_reference_point_type_t;
typedef struct nrppa_trp_position_referenced_t {
nrppa_reference_point_t reference_point;
nrppa_trp_reference_point_type_t reference_point_type;
} nrppa_trp_position_referenced_t;
typedef union nrppa_trp_position_definition_type_c {
nrppa_trp_position_direct_t direct;
nrppa_trp_position_referenced_t referenced;
} nrppa_trp_position_definition_type_u;
typedef enum nrppa_trp_position_definition_type_e {
NRPPA_TRP_POSITION_DEFINITION_TYPE_PR_NOTHING,
NRPPA_TRP_POSITION_DEFINITION_TYPE_PR_DIRECT,
NRPPA_TRP_POSITION_DEFINITION_TYPE_PR_REFERENCED
} nrppa_trp_position_definition_type_pr;
typedef struct nrppa_trp_position_definition_type_s {
nrppa_trp_position_definition_type_u choice;
nrppa_trp_position_definition_type_pr present;
} nrppa_trp_position_definition_type_t;
typedef struct nrppa_geographical_coordinates_s {
nrppa_trp_position_definition_type_t trp_position_definition_type;
} nrppa_geographical_coordinates_t;
typedef struct nrppa_ng_ran_cgi_s {
plmn_id_t plmn;
uint64_t nr_cellid;
} nrppa_ng_ran_cgi_t;
typedef union nrppa_trp_information_type_response_item_c {
uint16_t pci_nr;
nrppa_ng_ran_cgi_t ng_ran_cgi;
uint32_t nr_arfcn;
nrppa_geographical_coordinates_t geographical_coordinates;
} nrppa_trp_information_type_response_item_u;
typedef enum nrppa_trp_information_type_response_item_e {
NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_NOTHING,
NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_PCI_NR,
NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_NG_RAN_CGI,
NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_NRARFCN,
NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_PRSCONFIGURATION,
NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_SSBINFORMATION,
NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_SFNINITIALISATIONTIME,
NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_SPATIALDIRECTIONINFORMATION,
NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_GEOGRAPHICALCOORDINATES
} nrppa_trp_information_type_response_item_pr;
typedef struct nrppa_trp_information_type_response_item_s {
nrppa_trp_information_type_response_item_pr present;
nrppa_trp_information_type_response_item_u choice;
} nrppa_trp_information_type_response_item_t;
typedef struct nrppa_trp_information_type_response_list_s {
nrppa_trp_information_type_response_item_t *trp_information_type_response_item;
uint8_t trp_information_type_response_item_length;
} nrppa_trp_information_type_response_list_t;
typedef struct nrppa_trp_information_s {
uint32_t trp_id;
nrppa_trp_information_type_response_list_t trp_information_type_response_list;
} nrppa_trp_information_t;
typedef enum nrppa_subcarrier_spacing_e {
NRPPA_SUBCARRIER_SPACING_15KHZ,
NRPPA_SUBCARRIER_SPACING_30KHZ,
NRPPA_SUBCARRIER_SPACING_60KHZ,
NRPPA_SUBCARRIER_SPACING_120KHZ
} nrppa_subcarrier_spacing_pr;
typedef struct nrppa_scs_specific_carrier_s {
uint32_t offset_to_carrier;
nrppa_subcarrier_spacing_pr subcarrier_spacing;
uint16_t carrier_bandwidth;
} nrppa_scs_specific_carrier_t;
typedef struct nrppa_uplink_channel_bw_per_scs_list_s {
nrppa_scs_specific_carrier_t *scs_specific_carrier;
uint32_t scs_specific_carrier_list_length;
} nrppa_uplink_channel_bw_per_scs_list_t;
typedef enum nrppa_transmission_comb_e {
NRPPA_TRANSMISSION_COMB_PR_NOTHING,
NRPPA_TRANSMISSION_COMB_PR_N2,
NRPPA_TRANSMISSION_COMB_PR_N4
} nrppa_transmission_comb_pr;
typedef struct nrppa_transmission_comb_n2_s {
uint8_t comb_offset_n2;
uint8_t cyclic_shift_n2;
} nrppa_transmission_comb_n2_t, nrppa_transmission_comb_pos_n2_t;
typedef struct nrppa_transmission_comb_n4_s {
uint8_t comb_offset_n4;
uint8_t cyclic_shift_n4;
} nrppa_transmission_comb_n4_t, nrppa_transmission_comb_pos_n4_t;
typedef union nrppa_transmission_comb_c {
nrppa_transmission_comb_n2_t n2;
nrppa_transmission_comb_n4_t n4;
} nrppa_transmission_comb_u;
typedef struct nrppa_transmission_comb_s {
nrppa_transmission_comb_pr present;
nrppa_transmission_comb_u choice;
} nrppa_transmission_comb_t;
typedef enum nrppa_srs_resource_type_periodicity_e {
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT1 = 0,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT2,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT4,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT5,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT8,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT10,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT16,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT20,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT32,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT40,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT64,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT80,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT160,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT320,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT640,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT1280,
NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT2560
} nrppa_srs_resource_type_periodicity_pr;
typedef struct nrppa_resource_type_periodic_s {
nrppa_srs_resource_type_periodicity_pr periodicity;
uint16_t offset;
} nrppa_resource_type_periodic_t, nrppa_resource_type_semi_persistent_t;
typedef union nrppa_resource_type_c {
nrppa_resource_type_periodic_t periodic;
nrppa_resource_type_semi_persistent_t semi_persistent;
bool aperiodic;
} nrppa_resource_type_u;
typedef enum nrppa_resource_type_e {
NRPPA_RESOURCE_TYPE_PR_NOTHING,
NRPPA_RESOURCE_TYPE_PR_PERIODIC,
NRPPA_RESOURCE_TYPE_PR_SEMI_PERSISTENT,
NRPPA_RESOURCE_TYPE_PR_APERIODIC
} nrppa_resource_type_pr;
typedef struct nrppa_resource_type_s {
nrppa_resource_type_pr present;
nrppa_resource_type_u choice;
} nrppa_resource_type_t;
typedef struct nrppa_transmission_comb_n8_s {
uint8_t comb_offset_n8;
uint8_t cyclic_shift_n8;
} nrppa_transmission_comb_pos_n8_t;
typedef union nrppa_transmission_comb_pos_c {
nrppa_transmission_comb_pos_n2_t n2;
nrppa_transmission_comb_pos_n4_t n4;
nrppa_transmission_comb_pos_n8_t n8;
} nrppa_transmission_comb_pos_u;
typedef enum nrppa_transmission_comb_pos_e {
NRPPA_TRANSMISSION_COMB_POS_PR_NOTHING,
NRPPA_TRANSMISSION_COMB_POS_PR_N2,
NRPPA_TRANSMISSION_COMB_POS_PR_N4,
NRPPA_TRANSMISSION_COMB_POS_PR_N8
} nrppa_transmission_comb_pos_pr;
typedef struct nrppa_transmission_comb_pos_s {
nrppa_transmission_comb_pos_pr present;
nrppa_transmission_comb_pos_u choice;
} nrppa_transmission_comb_pos_t;
typedef enum nrppa_srs_resource_type_pos_periodicity_e {
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT1 = 0,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT2,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT4,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT5,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT8,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT10,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT16,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT20,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT32,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT40,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT64,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT80,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT160,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT320,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT640,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT1280,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT2560,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT5120,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT10240,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT20480,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT40960,
NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT81920
} nrppa_srs_resource_type_pos_periodicity_pr;
typedef struct nrppa_resource_type_periodic_pos_s {
nrppa_srs_resource_type_pos_periodicity_pr periodicity;
uint16_t offset;
} nrppa_resource_type_periodic_pos_t, nrppa_resource_type_semi_persistent_pos_t;
typedef struct nrppa_resource_type_aperiodic_pos_s {
uint8_t slot_offset;
} nrppa_resource_type_aperiodic_pos_t;
typedef union nrppa_resource_type_pos_c {
nrppa_resource_type_periodic_pos_t periodic;
nrppa_resource_type_semi_persistent_pos_t semi_persistent;
nrppa_resource_type_aperiodic_pos_t aperiodic;
} nrppa_resource_type_pos_u;
typedef enum nrppa_resource_type_pos_e {
NRPPA_RESOURCE_TYPE_POS_PR_NOTHING,
NRPPA_RESOURCE_TYPE_POS_PR_PERIODIC,
NRPPA_RESOURCE_TYPE_POS_PR_SEMI_PERSISTENT,
NRPPA_RESOURCE_TYPE_POS_PR_APERIODIC
} nrppa_resource_type_pos_pr;
typedef struct nrppa_resource_type_pos_s {
nrppa_resource_type_pos_pr present;
nrppa_resource_type_pos_u choice;
} nrppa_resource_type_pos_t;
typedef struct nrppa_srs_resource_id_list_s {
long *srs_resource_id;
uint8_t srs_resource_id_list_length;
} nrppa_srs_resource_id_list_t;
typedef struct nrppa_resource_set_type_aperiodic_s {
uint8_t srs_resource_trigger;
long slot_offset;
} nrppa_resource_set_type_aperiodic_t;
typedef union nrppa_resource_set_type_c {
bool periodic;
bool semi_persistent;
nrppa_resource_set_type_aperiodic_t aperiodic;
} nrppa_resource_set_type_u;
typedef enum nrppa_resource_set_type_e {
NRPPA_RESOURCE_SET_TYPE_PR_NOTHING,
NRPPA_RESOURCE_SET_TYPE_PR_PERIODIC,
NRPPA_RESOURCE_SET_TYPE_PR_SEMI_PERSISTENT,
NRPPA_RESOURCE_SET_TYPE_PR_APERIODIC
} nrppa_resource_set_type_pr;
typedef struct nrppa_resource_set_type_s {
nrppa_resource_set_type_pr present;
nrppa_resource_set_type_u choice;
} nrppa_resource_set_type_t;
typedef struct nrppa_pos_srs_resource_id_list_s {
long *srs_pos_resource_id;
uint32_t pos_srs_resource_id_list_length;
} nrppa_pos_srs_resource_id_list_t;
typedef union nrppa_pos_resource_set_type_c {
bool periodic;
bool semi_persistent;
uint8_t srs_resource;
} nrppa_pos_resource_set_type_u;
typedef enum nrppa_pos_resource_set_type_e {
NRPPA_POS_RESOURCE_SET_TYPE_PR_NOTHING,
NRPPA_POS_RESOURCE_SET_TYPE_PR_PERIODIC,
NRPPA_POS_RESOURCE_SET_TYPE_PR_SEMI_PERSISTENT,
NRPPA_POS_RESOURCE_SET_TYPE_PR_APERIODIC
} nrppa_pos_resource_set_type_pr;
typedef struct nrppa_pos_resource_set_type_s {
nrppa_pos_resource_set_type_pr present;
nrppa_pos_resource_set_type_u choice;
} nrppa_pos_resource_set_type_t;
typedef enum nrppa_srs_resource_number_of_ports_e {
NRPPA_SRS_NUMBER_OF_PORTS_N1,
NRPPA_SRS_NUMBER_OF_PORTS_N2,
NRPPA_SRS_NUMBER_OF_PORTS_N4
} nrppa_srs_resource_number_of_ports_pr;
typedef enum nrppa_srs_resource_number_of_symbols_e {
NRPPA_SRS_NUMBER_OF_SYMBOLS_N1,
NRPPA_SRS_NUMBER_OF_SYMBOLS_N2,
NRPPA_SRS_NUMBER_OF_SYMBOLS_N4
} nrppa_srs_resource_number_of_symbols_pr;
typedef enum nrppa_srs_repetition_factor_e {
NRPPA_SRS_REPETITION_FACTOR_RF1,
NRPPA_SRS_REPETITION_FACTOR_RF2,
NRPPA_SRS_REPETITION_FACTOR_RF4
} nrppa_srs_repetition_factor_pr;
typedef enum nrppa_srs_group_or_sequencehopping_e {
NRPPA_GROUPORSEQUENCEHOPPING_NOTHING,
NRPPA_GROUPORSEQUENCEHOPPING_GROUPHOPPING,
NRPPA_GROUPORSEQUENCEHOPPING_SEQUENCEHOPPING
} nrppa_srs_group_or_sequencehopping_pr;
typedef struct nrppa_srs_resource_s {
uint32_t srs_resource_id;
nrppa_srs_resource_number_of_ports_pr nr_of_srs_ports;
nrppa_transmission_comb_t transmission_comb;
uint8_t start_position;
nrppa_srs_resource_number_of_symbols_pr nr_of_symbols;
nrppa_srs_repetition_factor_pr repetition_factor;
uint8_t freq_domain_position;
uint16_t freq_domain_shift;
uint8_t c_srs;
uint8_t b_srs;
uint8_t b_hop;
nrppa_srs_group_or_sequencehopping_pr group_or_sequence_hopping;
nrppa_resource_type_t resource_type;
uint16_t sequence_id;
} nrppa_srs_resource_t;
typedef enum nrppa_srs_resource_item_number_of_symbols_e {
NRPPA_SRS_RESOURCE_ITEM_NUMBER_OF_SYMBOLS_N1,
NRPPA_SRS_RESOURCE_ITEM_NUMBER_OF_SYMBOLS_N2,
NRPPA_SRS_RESOURCE_ITEM_NUMBER_OF_SYMBOLS_N4,
NRPPA_SRS_RESOURCE_ITEM_NUMBER_OF_SYMBOLS_N8,
NRPPA_SRS_RESOURCE_ITEM_NUMBER_OF_SYMBOLS_N12
} nrppa_srs_resource_item_number_of_symbols_pr;
typedef struct nrppa_pos_srs_resource_item_s {
uint32_t srs_pos_resource_id;
nrppa_transmission_comb_pos_t transmission_comb_pos;
uint8_t start_position;
nrppa_srs_resource_item_number_of_symbols_pr nr_of_symbols;
uint16_t freq_domain_shift;
uint8_t c_srs;
nrppa_srs_group_or_sequencehopping_pr group_or_sequence_hopping;
nrppa_resource_type_pos_t resource_type_pos;
uint32_t sequence_id;
} nrppa_pos_srs_resource_item_t;
typedef struct nrppa_srs_resource_set_s {
uint8_t srs_resource_set_id;
nrppa_srs_resource_id_list_t srs_resource_id_list;
nrppa_resource_set_type_t resource_set_type;
} nrppa_srs_resource_set_t;
typedef struct nrppa_pos_srs_resource_set_item_s {
uint8_t pos_srs_resource_set_id;
nrppa_pos_srs_resource_id_list_t pos_srs_resource_id_list;
nrppa_pos_resource_set_type_t pos_resource_set_type;
} nrppa_pos_srs_resource_set_item_t;
typedef struct nrppa_srs_resource_list_s {
nrppa_srs_resource_t *srs_resource;
uint32_t srs_resource_list_length;
} nrppa_srs_resource_list_t;
typedef struct nrppa_pos_srs_resource_list_s {
nrppa_pos_srs_resource_item_t *pos_srs_resource_item;
uint32_t pos_srs_resource_list_length;
} nrppa_pos_srs_resource_list_t;
typedef struct nrppa_srs_resource_set_list_s {
nrppa_srs_resource_set_t *srs_resource_set;
uint32_t srs_resource_set_list_length;
} nrppa_srs_resource_set_list_t;
typedef struct nrppa_pos_srs_resource_set_list_s {
nrppa_pos_srs_resource_set_item_t *pos_srs_resource_set_item;
uint32_t pos_srs_resource_set_list_length;
} nrppa_pos_srs_resource_set_list_t;
typedef struct nrppa_srs_config_s {
nrppa_srs_resource_list_t *srs_resource_list;
nrppa_pos_srs_resource_list_t *pos_srs_resource_list;
nrppa_srs_resource_set_list_t *srs_resource_set_list;
nrppa_pos_srs_resource_set_list_t *pos_srs_resource_set_list;
} nrppa_srs_config_t;
typedef enum nrppa_cp_type_e { NRPPA_CP_TYPE_NORMAL, NRPPA_CP_TYPE_EXTENDED } nrppa_cp_type_pr;
typedef struct nrppa_active_ul_bwp_s {
uint32_t location_and_bandwidth;
nrppa_subcarrier_spacing_pr subcarrier_spacing;
nrppa_cp_type_pr cyclic_prefix;
uint32_t tx_direct_current_location;
uint8_t shift_7_dot_5kHz;
nrppa_srs_config_t srs_config;
} nrppa_active_ul_bwp_t;
typedef struct nrppa_srs_carrier_list_item_s {
uint32_t pointA;
nrppa_uplink_channel_bw_per_scs_list_t uplink_channel_bw_per_scs_list;
nrppa_active_ul_bwp_t active_ul_bwp;
uint16_t pci;
} nrppa_srs_carrier_list_item_t;
typedef struct nrppa_srs_carrier_list_s {
nrppa_srs_carrier_list_item_t *srs_carrier_list_item;
uint32_t srs_carrier_list_length;
} nrppa_srs_carrier_list_t;
typedef struct nrppa_srs_configuration_s {
nrppa_srs_carrier_list_t srs_carrier_list;
} nrppa_srs_configuration_t;
// IE 9.3.1.176 (TS 38.473 V16.21.0)
typedef struct nrppa_trp_information_list_s {
nrppa_trp_information_t *trp_information_item;
uint32_t trp_information_item_length;
} nrppa_trp_information_list_t;
typedef union nrppa_srs_type_c {
uint8_t *srs_resource_set_id;
bool *aperiodic;
} nrppa_srs_type_u;
typedef enum nrppa_srs_type_e {
NRPPA_SRS_TYPE_PR_NOTHING,
NRPPA_SRS_TYPE_PR_SEMIPERSISTENTSRS,
NRPPA_SRS_TYPE_PR_APERIODICSRS
} nrppa_srs_type_pr;
typedef struct nrppa_srs_type_s {
nrppa_srs_type_pr present;
nrppa_srs_type_u choice;
} nrppa_srs_type_t;
typedef struct nrppa_trp_measurement_request_item_s {
uint32_t trp_id;
} nrppa_trp_measurement_request_item_t;
typedef struct nrppa_trp_measurement_request_list_s {
nrppa_trp_measurement_request_item_t *trp_measurement_request_item;
uint32_t trp_measurement_request_list_length;
} nrppa_trp_measurement_request_list_t;
typedef enum nrppa_pos_report_characteristics_e {
NRPPA_POSREPORTCHARACTERISTICS_ONDEMAND = 0,
NRPPA_POSREPORTCHARACTERISTICS_PERIODIC = 1
} nrppa_report_characteristics_pr;
typedef enum nrppa_pos_measurement_periodicity_e {
NRPPA_POSMEASUREMENTPERIODICITY_MS120 = 0,
NRPPA_POSMEASUREMENTPERIODICITY_MS240 = 1,
NRPPA_POSMEASUREMENTPERIODICITY_MS480 = 2,
NRPPA_POSMEASUREMENTPERIODICITY_MS640 = 3,
NRPPA_POSMEASUREMENTPERIODICITY_MS1024 = 4,
NRPPA_POSMEASUREMENTPERIODICITY_MS2048 = 5,
NRPPA_POSMEASUREMENTPERIODICITY_MS5120 = 6,
NRPPA_POSMEASUREMENTPERIODICITY_MS10240 = 7,
NRPPA_POSMEASUREMENTPERIODICITY_MIN1 = 8,
NRPPA_POSMEASUREMENTPERIODICITY_MIN6 = 9,
NRPPA_POSMEASUREMENTPERIODICITY_MIN12 = 10,
NRPPA_POSMEASUREMENTPERIODICITY_MIN30 = 11,
NRPPA_POSMEASUREMENTPERIODICITY_MIN60 = 12
} nrppa_measurement_periodicity_pr;
typedef enum nrppa_pos_measurement_type_e {
NRPPA_POSMEASUREMENTTYPE_GNB_RX_TX = 0,
NRPPA_POSMEASUREMENTTYPE_UL_SRS_RSRP = 1,
NRPPA_POSMEASUREMENTTYPE_UL_AOA = 2,
NRPPA_POSMEASUREMENTTYPE_UL_RTOA = 3
} nrppa_measurement_type_pr;
typedef struct nrppa_pos_measurement_quantities_item_s {
nrppa_measurement_type_pr measurement_type;
} nrppa_measurement_quantities_item_t;
typedef struct nrppa_pos_measurement_quantities_s {
nrppa_measurement_quantities_item_t *measurement_quantities_item;
uint32_t measurement_quantities_length;
} nrppa_measurement_quantities_t;
typedef struct nrppa_lcs_to_gcs_translationaoa_c {
uint16_t alpha;
uint16_t beta;
uint16_t gamma;
} nrppa_lcs_to_gcs_translationaoa_t;
typedef struct nrppa_ul_aoa_s {
uint16_t azimuth_aoa;
uint16_t *zenith_aoa;
nrppa_lcs_to_gcs_translationaoa_t *lcs_to_gcs_translation_aoa;
} nrppa_ul_aoa_t;
typedef union nrppa_relative_path_delay_c {
uint32_t k0;
uint32_t k1;
uint32_t k2;
uint32_t k3;
uint32_t k4;
uint32_t k5;
} nrppa_relative_path_delay_u, nrppa_ul_rtoa_measurement_u, nrppa_gnb_rx_tx_time_diff_u;
typedef enum nrppa_gnb_rx_tx_time_diff_meas_e {
NRPPA_GNBRXTXTIMEDIFFMEAS_PR_NOTHING,
NRPPA_GNBRXTXTIMEDIFFMEAS_PR_K0,
NRPPA_GNBRXTXTIMEDIFFMEAS_PR_K1,
NRPPA_GNBRXTXTIMEDIFFMEAS_PR_K2,
NRPPA_GNBRXTXTIMEDIFFMEAS_PR_K3,
NRPPA_GNBRXTXTIMEDIFFMEAS_PR_K4,
NRPPA_GNBRXTXTIMEDIFFMEAS_PR_K5
} nrppa_gnb_rx_tx_time_diff_pr;
typedef struct nrppa_gnb_rx_tx_time_diff_s {
nrppa_gnb_rx_tx_time_diff_pr present;
nrppa_gnb_rx_tx_time_diff_u choice;
} nrppa_gnb_rx_tx_time_diff_t;
typedef enum nrppa_ul_rtoa_measurement_e {
NRPPA_ULRTOAMEAS_PR_NOTHING,
NRPPA_ULRTOAMEAS_PR_K0,
NRPPA_ULRTOAMEAS_PR_K1,
NRPPA_ULRTOAMEAS_PR_K2,
NRPPA_ULRTOAMEAS_PR_K3,
NRPPA_ULRTOAMEAS_PR_K4,
NRPPA_ULRTOAMEAS_PR_K5
} nrppa_ul_rtoa_measurement_pr;
typedef struct nrppa_ul_rtoa_measurement_s {
nrppa_ul_rtoa_measurement_pr present;
nrppa_ul_rtoa_measurement_u choice;
} nrppa_ul_rtoa_measurement_t;
typedef union nrppa_measured_results_value_c {
nrppa_ul_aoa_t ul_angle_of_arrival;
uint8_t ul_srs_rsrp;
nrppa_ul_rtoa_measurement_t ul_rtoa;
nrppa_gnb_rx_tx_time_diff_t gnb_rx_tx_time_diff;
} nrppa_measured_results_value_u;
typedef enum nrppa_measured_results_value_e {
NRPPA_MEASURED_RESULTS_VALUE_PR_NOTHING,
NRPPA_MEASURED_RESULTS_VALUE_PR_UL_ANGLEOFARRIVAL,
NRPPA_MEASURED_RESULTS_VALUE_PR_UL_SRS_RSRP,
NRPPA_MEASURED_RESULTS_VALUE_PR_UL_RTOA,
NRPPA_MEASURED_RESULTS_VALUE_PR_GNB_RXTXTIMEDIFF
} nrppa_measured_results_value_pr;
typedef struct nrppa_measured_results_value_s {
nrppa_measured_results_value_pr present;
nrppa_measured_results_value_u choice;
} nrppa_measured_results_value_t;
typedef union nrppa_time_stamp_slot_index_c {
uint8_t scs_15;
uint8_t scs_30;
uint8_t scs_60;
uint8_t scs_120;
} nrppa_time_stamp_slot_index_u;
typedef enum nrppa_time_stamp_slot_index_e {
NRPPA_TIME_STAMP_SLOT_INDEX_PR_NOTHING,
NRPPA_TIME_STAMP_SLOT_INDEX_PR_SCS_15,
NRPPA_TIME_STAMP_SLOT_INDEX_PR_SCS_30,
NRPPA_TIME_STAMP_SLOT_INDEX_PR_SCS_60,
NRPPA_TIME_STAMP_SLOT_INDEX_PR_SCS_120
} nrppa_time_stamp_slot_index_pr;
typedef struct nrppa_time_stamp_slot_index_s {
nrppa_time_stamp_slot_index_pr present;
nrppa_time_stamp_slot_index_u choice;
} nrppa_time_stamp_slot_index_t;
typedef struct nrppa_time_stamp_s {
uint16_t system_frame_number;
nrppa_time_stamp_slot_index_t slot_index;
} nrppa_time_stamp_t;
typedef struct nrppa_measurement_result_item_s {
nrppa_measured_results_value_t measured_results_value;
nrppa_time_stamp_t time_stamp;
} nrppa_measurement_result_item_t;
typedef struct nrppa_measurement_result_s {
nrppa_measurement_result_item_t *measurement_result_item;
uint32_t measurement_result_item_length;
} nrppa_measurement_result_t;
typedef struct nrppa_measurement_response_item_s {
nrppa_measurement_result_t measurement_result;
uint32_t trp_id;
} nrppa_measurement_response_item_t;
typedef struct nrppa_measurement_response_list_s {
nrppa_measurement_response_item_t *measurement_response_item;
uint32_t measurement_response_list_length;
} nrppa_measurement_response_list_t;
typedef struct nrppa_trp_information_req_s {
// IE 9.2.4 (mandatory)
uint16_t transaction_id;
bool has_trp_list;
// mandatory
nrppa_trp_list_t trp_list;
// mandatory
nrppa_trp_information_type_list_t trp_information_type_list;
} nrppa_trp_information_req_t;
typedef struct nrppa_trp_information_resp_s {
// IE 9.2.4 (mandatory)
uint16_t transaction_id;
// mandatory
nrppa_trp_information_list_t trp_information_list;
} nrppa_trp_information_resp_t;
typedef struct nrppa_positioning_information_req_s {
// IE 9.2.4 (mandatory)
uint16_t transaction_id;
} nrppa_positioning_information_req_t;
typedef struct nrppa_positioning_information_resp_s {
// IE 9.2.4 (mandatory)
uint16_t transaction_id;
// IE 9.2.28 (optional)
nrppa_srs_configuration_t *srs_configuration;
} nrppa_positioning_information_resp_t;
typedef struct nrppa_positioning_activation_req_s {
// IE 9.2.4 (mandatory)
uint16_t transaction_id;
// (mandatory)
nrppa_srs_type_t srs_type;
} nrppa_positioning_activation_req_t;
typedef struct nrppa_positioning_activation_resp_s {
// IE 9.2.4 (mandatory)
uint16_t transaction_id;
} nrppa_positioning_activation_resp_t;
typedef struct nrppa_measurement_req_s {
// IE 9.2.4 (mandatory)
uint16_t transaction_id;
// (mandatory)
uint32_t lmf_measurement_id;
// (mandatory)
nrppa_trp_measurement_request_list_t trp_measurement_request_list;
// (mandatory) ondemand = 0, periodic = 1
nrppa_report_characteristics_pr report_characteristics;
// if report characteristics periodic
nrppa_measurement_periodicity_pr measurement_periodicity;
// (mandatory)
nrppa_measurement_quantities_t measurement_quantities;
// IE 9.2.28 (optional)
nrppa_srs_configuration_t *srs_configuration;
} nrppa_measurement_req_t;
typedef struct nrppa_measurement_resp_s {
// IE 9.2.4 (mandatory)
uint16_t transaction_id;
// (mandatory)
uint32_t lmf_measurement_id;
// (mandatory)
uint32_t ran_measurement_id;
// (optional)
nrppa_measurement_response_list_t *measurement_response_list;
} nrppa_measurement_resp_t;
#endif // NRPPA_MESSAGES_TYPES_H_
+62
View File
@@ -0,0 +1,62 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef __POSITIONING_NR_PARAMDEF__H__
#define __POSITIONING_NR_PARAMDEF__H__
/* Positioning configuration section names */
#define CONFIG_STRING_POSITIONING_CONFIG "positioning_config"
/* Global parameters */
/* TRP configuration parameters names */
#define CONFIG_STRING_POSITIONING_NUM_TRPS "NumTRPs"
#define CONFIG_STRING_POSITIONING_TRP_IDS_LIST "TRPIDs"
#define CONFIG_STRING_POSITIONING_TRP_X_AXIS_LIST "TRPxAxis"
#define CONFIG_STRING_POSITIONING_TRP_Y_AXIS_LIST "TRPyAxis"
#define CONFIG_STRING_POSITIONING_TRP_Z_AXIS_LIST "TRPzAxis"
#define CONFIG_STRING_POSITIONING_TRP_UNIT_LIST "Units"
/* Help string for Positioning parameters */
#define HELP_STRING_POSITIONING_NUM_TRPS "Number of TRPs connected with gNB(max 4)\n"
#define HELP_STRING_POSITIONING_TRP_IDS_LIST "User defined IDs for each TRP \n"
#define HELP_STRING_POSITIONING_TRP_X_AXIS_LIST "x-axis value of each TRP \n"
#define HELP_STRING_POSITIONING_TRP_Y_AXIS_LIST "y-axis value of each TRP \n"
#define HELP_STRING_POSITIONING_TRP_Z_AXIS_LIST "z-axis value of each TRP \n"
#define HELP_STRING_POSITIONING_TRP_UNIT_LIST "XYZ unit value of each TRP \n"
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* TRP configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type
* numelt */
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
// clang-format off
#define POSITIONING_PARAMS_DESC { \
{CONFIG_STRING_POSITIONING_NUM_TRPS, HELP_STRING_POSITIONING_NUM_TRPS, 0, .uptr=NULL, .defuintval=0, TYPE_UINT, 0}, \
{CONFIG_STRING_POSITIONING_TRP_IDS_LIST, HELP_STRING_POSITIONING_TRP_IDS_LIST, 0, .uptr=NULL, .defintarrayval=0, TYPE_UINTARRAY, 0}, \
{CONFIG_STRING_POSITIONING_TRP_X_AXIS_LIST, HELP_STRING_POSITIONING_TRP_X_AXIS_LIST, 0, .uptr=NULL, .defintarrayval=0, TYPE_UINTARRAY, 0}, \
{CONFIG_STRING_POSITIONING_TRP_Y_AXIS_LIST, HELP_STRING_POSITIONING_TRP_Y_AXIS_LIST, 0, .uptr=NULL, .defintarrayval=0, TYPE_UINTARRAY, 0}, \
{CONFIG_STRING_POSITIONING_TRP_Z_AXIS_LIST, HELP_STRING_POSITIONING_TRP_Z_AXIS_LIST, 0, .uptr=NULL, .defintarrayval=0, TYPE_UINTARRAY, 0}, \
{CONFIG_STRING_POSITIONING_TRP_UNIT_LIST, HELP_STRING_POSITIONING_TRP_UNIT_LIST, 0, .uptr=NULL, .defintarrayval=0, TYPE_UINTARRAY, 0}, \
}
// clang-format on
#endif
+1
View File
@@ -53,6 +53,7 @@
#include "openair2/E1AP/e1ap.h"
#include "gnb_config.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/GNB_APP/gnb_config_ng.h"
extern RAN_CONTEXT_t RC;
/*------------------------------------------------------------------------------*/
+2 -164
View File
@@ -79,7 +79,8 @@
#include "uper_encoder.h"
#include "utils.h"
#include "x2ap_messages_types.h"
#include "gnb_config_common.h"
#include "positioning_nr_paramdef.h"
static int DEFBANDS[] = {7};
static int DEFENBS[] = {0};
@@ -96,45 +97,6 @@ static int DEFRUTPCORES[] = {-1,-1,-1,-1};
(element)->choice.setup = CALLOC(1, sizeof(*((element)->choice.setup))); \
} while (0)
static uint16_t set_snssai_config(nssai_t *nssai, const int max_num_ssi, uint8_t k, uint8_t l)
{
char snssaistr[MAX_OPTNAME_SIZE * 2 + 8];
snprintf(snssaistr, sizeof(snssaistr), "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, k, GNB_CONFIG_STRING_PLMN_LIST, l);
GET_PARAMS_LIST(SNSSAIParamList,
SNSSAIParams,
GNBSNSSAIPARAMS_DESC,
GNB_CONFIG_STRING_SNSSAI_LIST,
snssaistr,
SNSSAIPARAMS_CHECK);
uint16_t num_ssi = SNSSAIParamList.numelt;
AssertFatal(num_ssi < max_num_ssi, "S-NSSAI size %d exceeds the max array size %d", num_ssi, max_num_ssi);
for (int s = 0; s < num_ssi; ++s) {
nssai[s].sst = *SNSSAIParamList.paramarray[s][GNB_SLICE_SERVICE_TYPE_IDX].uptr;
// SD is optional
// 0xffffff is "no SD", see 23.003 Sec 28.4.2
nssai[s].sd = *SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr;
AssertFatal(nssai[s].sd <= 0xffffff, "SD cannot be bigger than 0xffffff, but is %d\n", nssai[s].sd);
}
return num_ssi;
}
static uint8_t set_plmn_config(plmn_id_t *p, uint8_t idx)
{
char gnbpath[MAX_OPTNAME_SIZE * 2 + 8];
snprintf(gnbpath, sizeof(gnbpath), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, idx);
GET_PARAMS_LIST(PLMNParamList, PLMNParams, GNBPLMNPARAMS_DESC, GNB_CONFIG_STRING_PLMN_LIST, gnbpath, PLMNPARAMS_CHECK);
uint8_t num_plmn = PLMNParamList.numelt;
AssertFatal(num_plmn >= 1 && num_plmn <= 6, "The number of PLMN IDs must be in [1,6], but is %d\n", num_plmn);
for (int l = 0; l < num_plmn; ++l) {
plmn_id_t *plmn = &p[l];
plmn->mcc = *PLMNParamList.paramarray[l][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
plmn->mnc = *PLMNParamList.paramarray[l][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
plmn->mnc_digit_length = *PLMNParamList.paramarray[l][GNB_MNC_DIGIT_LENGTH].u8ptr;
AssertFatal((plmn->mnc_digit_length == 2) || (plmn->mnc_digit_length == 3), "BAD MNC DIGIT LENGTH %d", plmn->mnc_digit_length);
}
return num_plmn;
}
/**
* Allocate memory and initialize ServingCellConfigCommon struct members
*/
@@ -2131,130 +2093,6 @@ gNB_RRC_INST *RCconfig_NRRRC()
return rrc;
}
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i)
{
int j,k = 0;
int gnb_id;
char* gnb_ipv4_address_for_NGU = NULL;
uint32_t gnb_port_for_NGU = 0;
char* gnb_ipv4_address_for_S1U = NULL;
uint32_t gnb_port_for_S1U = 0;
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
AssertFatal (i<GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt,
"Failed to parse config file %s, %uth attribute %s \n",
RC.config_file_name, i, GNB_CONFIG_STRING_ACTIVE_GNBS);
if (GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt>0) {
// Output a list of all gNBs.
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL);
if (GNBParamList.numelt > 0) {
for (k = 0; k < GNBParamList.numelt; k++) {
if (GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr == NULL) {
// Calculate a default gNB ID
if (IS_SA_MODE(get_softmodem_params())) {
uint32_t hash;
hash = ngap_generate_gNB_id ();
gnb_id = k + (hash & 0xFFFFFF8);
} else {
gnb_id = k;
}
} else {
gnb_id = *(GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr);
}
// search if in active list
for (j=0; j < GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; j++) {
if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[j], *(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr)) == 0) {
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
NGAP_REGISTER_GNB_REQ (msg_p).gNB_id = gnb_id;
if (strcmp(*(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr), "CELL_MACRO_GNB") == 0) {
NGAP_REGISTER_GNB_REQ (msg_p).cell_type = CELL_MACRO_GNB;
} else if (strcmp(*(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr), "CELL_HOME_GNB") == 0) {
NGAP_REGISTER_GNB_REQ (msg_p).cell_type = CELL_HOME_ENB;
} else {
AssertFatal (0,
"Failed to parse gNB configuration file %s, gnb %u unknown value \"%s\" for cell_type choice: CELL_MACRO_GNB or CELL_HOME_GNB !\n",
RC.config_file_name, i, *(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr));
}
NGAP_REGISTER_GNB_REQ (msg_p).gNB_name = strdup(*(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr));
NGAP_REGISTER_GNB_REQ (msg_p).tac = *GNBParamList.paramarray[k][GNB_TRACKING_AREA_CODE_IDX].uptr;
AssertFatal(!GNBParamList.paramarray[k][GNB_MOBILE_COUNTRY_CODE_IDX_OLD].strptr
&& !GNBParamList.paramarray[k][GNB_MOBILE_NETWORK_CODE_IDX_OLD].strptr,
"It seems that you use an old configuration file. Please change the existing\n"
" tracking_area_code = \"1\";\n"
" mobile_country_code = \"208\";\n"
" mobile_network_code = \"93\";\n"
"to\n"
" tracking_area_code = 1; // no string!!\n"
" plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2; } )\n");
// PLMN
plmn_id_t p[PLMN_LIST_MAX_SIZE] = {0};
NGAP_REGISTER_GNB_REQ(msg_p).num_plmn = set_plmn_config(p, 0);
for (int l = 0; l < NGAP_REGISTER_GNB_REQ(msg_p).num_plmn; ++l) {
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].plmn = p[l];
// SNSSAI
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].num_nssai = set_snssai_config(NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].s_nssai, 8, k, l);
}
NGAP_REGISTER_GNB_REQ(msg_p).default_drx = 0;
// NG
snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, k);
GET_PARAMS_LIST(NGParamList, NGParams, GNBNGPARAMS_DESC, GNB_CONFIG_STRING_AMF_IP_ADDRESS, aprefix);
NGAP_REGISTER_GNB_REQ (msg_p).nb_amf = 0;
for (int l = 0; l < NGParamList.numelt; l++) {
NGAP_REGISTER_GNB_REQ (msg_p).nb_amf += 1;
strcpy(NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[l].ipv4_address,*(NGParamList.paramarray[l][GNB_AMF_IPV4_ADDRESS_IDX].strptr));
NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[j].ipv4 = 1;
NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[j].ipv6 = 0;
/* if no broadcasst_plmn array is defined, fill default values */
if (NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] == 0) {
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] = NGAP_REGISTER_GNB_REQ(msg_p).num_plmn;
for (int el = 0; el < NGAP_REGISTER_GNB_REQ(msg_p).num_plmn; ++el)
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_index[l][el] = el;
}
}
// SCTP SETTING
NGAP_REGISTER_GNB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS;
if (IS_SA_MODE(get_softmodem_params())) {
snprintf(aprefix, sizeof(aprefix), "%s.[%d].%s", GNB_CONFIG_STRING_GNB_LIST, k, GNB_CONFIG_STRING_SCTP_CONFIG);
GET_PARAMS(SCTPParams, GNBSCTPPARAMS_DESC, aprefix);
NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
NGAP_REGISTER_GNB_REQ (msg_p).sctp_out_streams = (uint16_t)*(SCTPParams[GNB_SCTP_OUTSTREAMS_IDX].uptr);
}
// NETWORK_INTERFACES
snprintf(aprefix, sizeof(aprefix), "%s.[%d].%s", GNB_CONFIG_STRING_GNB_LIST, k, GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
GET_PARAMS(NETParams, GNBNETPARAMS_DESC, aprefix);
if (NETParams[GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX].strptr != NULL) {
char *cidr = *(NETParams[GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX].strptr);
char *save = NULL;
char *address = strtok_r(cidr, "/", &save);
strcpy(NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv4_address, address);
LOG_I(GNB_APP, "Parsed IPv4 address for NG AMF: %s\n", address);
}
NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv6 = 0;
NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv4 = 1;
break;
}
}
}
}
}
return 0;
}
static pthread_mutex_t rc_mutex = PTHREAD_MUTEX_INITIALIZER;
static bool rc_done = false;
-1
View File
@@ -44,7 +44,6 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg);
void NRRCConfig(void);
gNB_RRC_INST *RCconfig_NRRRC();
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i);
int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i);
void wait_f1_setup_response(void);
f1ap_tdd_info_t read_tdd_config(const NR_ServingCellConfigCommon_t *scc);
+66
View File
@@ -0,0 +1,66 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "openair2/GNB_APP/gnb_config_common.h"
#include "common/config/config_paramdesc.h"
#include "common/config/config_userapi.h"
#include "RRC_nr_paramsvalues.h"
#include "gnb_paramdef.h"
#include "sctp_default_values.h"
uint16_t set_snssai_config(nssai_t *nssai, const int max_num_ssi, uint8_t k, uint8_t l)
{
char snssaistr[MAX_OPTNAME_SIZE * 2 + 8];
snprintf(snssaistr, sizeof(snssaistr), "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, k, GNB_CONFIG_STRING_PLMN_LIST, l);
GET_PARAMS_LIST(SNSSAIParamList,
SNSSAIParams,
GNBSNSSAIPARAMS_DESC,
GNB_CONFIG_STRING_SNSSAI_LIST,
snssaistr,
SNSSAIPARAMS_CHECK);
uint16_t num_ssi = SNSSAIParamList.numelt;
AssertFatal(num_ssi < max_num_ssi, "S-NSSAI size %d exceeds the max array size %d", num_ssi, max_num_ssi);
for (int s = 0; s < num_ssi; ++s) {
nssai[s].sst = *SNSSAIParamList.paramarray[s][GNB_SLICE_SERVICE_TYPE_IDX].uptr;
// SD is optional
// 0xffffff is "no SD", see 23.003 Sec 28.4.2
nssai[s].sd = *SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr;
AssertFatal(nssai[s].sd <= 0xffffff, "SD cannot be bigger than 0xffffff, but is %d\n", nssai[s].sd);
}
return num_ssi;
}
uint8_t set_plmn_config(plmn_id_t *p, uint8_t idx)
{
char gnbpath[MAX_OPTNAME_SIZE * 2 + 8];
snprintf(gnbpath, sizeof(gnbpath), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, idx);
GET_PARAMS_LIST(PLMNParamList, PLMNParams, GNBPLMNPARAMS_DESC, GNB_CONFIG_STRING_PLMN_LIST, gnbpath, PLMNPARAMS_CHECK);
uint8_t num_plmn = PLMNParamList.numelt;
AssertFatal(num_plmn >= 1 && num_plmn <= 6, "The number of PLMN IDs must be in [1,6], but is %d\n", num_plmn);
for (int l = 0; l < num_plmn; ++l) {
plmn_id_t *plmn = &p[l];
plmn->mcc = *PLMNParamList.paramarray[l][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
plmn->mnc = *PLMNParamList.paramarray[l][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
plmn->mnc_digit_length = *PLMNParamList.paramarray[l][GNB_MNC_DIGIT_LENGTH].u8ptr;
AssertFatal((plmn->mnc_digit_length == 2) || (plmn->mnc_digit_length == 3), "BAD MNC DIGIT LENGTH %d", plmn->mnc_digit_length);
}
return num_plmn;
}
+26
View File
@@ -0,0 +1,26 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <assert.h>
#include "common/5g_platform_types.h"
uint16_t set_snssai_config(nssai_t *nssai, const int max_num_ssi, uint8_t k, uint8_t l);
uint8_t set_plmn_config(plmn_id_t *p, uint8_t idx);
+162
View File
@@ -0,0 +1,162 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "gnb_config_ng.h"
#include <stdint.h>
#include "assertions.h"
#include "common/ran_context.h"
#include "openair2/GNB_APP/gnb_config_common.h"
#include "common/config/config_paramdesc.h"
#include "sctp_default_values.h"
#include "gnb_paramdef.h"
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i)
{
int j, k = 0;
int gnb_id;
char *gnb_ipv4_address_for_NGU = NULL;
uint32_t gnb_port_for_NGU = 0;
char *gnb_ipv4_address_for_S1U = NULL;
uint32_t gnb_port_for_S1U = 0;
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
AssertFatal(i < GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt,
"Failed to parse config file %s, %uth attribute %s \n",
RC.config_file_name,
i,
GNB_CONFIG_STRING_ACTIVE_GNBS);
if (GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt > 0) {
// Output a list of all gNBs.
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL);
if (GNBParamList.numelt > 0) {
for (k = 0; k < GNBParamList.numelt; k++) {
if (GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr == NULL) {
// Calculate a default gNB ID
if (IS_SA_MODE(get_softmodem_params())) {
uint32_t hash;
hash = ngap_generate_gNB_id();
gnb_id = k + (hash & 0xFFFFFF8);
} else {
gnb_id = k;
}
} else {
gnb_id = *(GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr);
}
// search if in active list
for (j = 0; j < GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; j++) {
if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[j], *(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr)) == 0) {
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
NGAP_REGISTER_GNB_REQ(msg_p).gNB_id = gnb_id;
if (strcmp(*(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr), "CELL_MACRO_GNB") == 0) {
NGAP_REGISTER_GNB_REQ(msg_p).cell_type = CELL_MACRO_GNB;
} else if (strcmp(*(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr), "CELL_HOME_GNB") == 0) {
NGAP_REGISTER_GNB_REQ(msg_p).cell_type = CELL_HOME_ENB;
} else {
AssertFatal(0,
"Failed to parse gNB configuration file %s, gnb %u unknown value \"%s\" for cell_type choice: "
"CELL_MACRO_GNB or CELL_HOME_GNB !\n",
RC.config_file_name,
i,
*(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr));
}
NGAP_REGISTER_GNB_REQ(msg_p).gNB_name = strdup(*(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr));
NGAP_REGISTER_GNB_REQ(msg_p).tac = *GNBParamList.paramarray[k][GNB_TRACKING_AREA_CODE_IDX].uptr;
AssertFatal(!GNBParamList.paramarray[k][GNB_MOBILE_COUNTRY_CODE_IDX_OLD].strptr
&& !GNBParamList.paramarray[k][GNB_MOBILE_NETWORK_CODE_IDX_OLD].strptr,
"It seems that you use an old configuration file. Please change the existing\n"
" tracking_area_code = \"1\";\n"
" mobile_country_code = \"208\";\n"
" mobile_network_code = \"93\";\n"
"to\n"
" tracking_area_code = 1; // no string!!\n"
" plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2; } )\n");
// PLMN
plmn_id_t p[PLMN_LIST_MAX_SIZE] = {0};
NGAP_REGISTER_GNB_REQ(msg_p).num_plmn = set_plmn_config(p, 0);
for (int l = 0; l < NGAP_REGISTER_GNB_REQ(msg_p).num_plmn; ++l) {
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].plmn = p[l];
// SNSSAI
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].num_nssai =
set_snssai_config(NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].s_nssai, 8, k, l);
}
NGAP_REGISTER_GNB_REQ(msg_p).default_drx = 0;
// NG
snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, k);
GET_PARAMS_LIST(NGParamList, NGParams, GNBNGPARAMS_DESC, GNB_CONFIG_STRING_AMF_IP_ADDRESS, aprefix);
NGAP_REGISTER_GNB_REQ(msg_p).nb_amf = 0;
for (int l = 0; l < NGParamList.numelt; l++) {
NGAP_REGISTER_GNB_REQ(msg_p).nb_amf += 1;
strcpy(NGAP_REGISTER_GNB_REQ(msg_p).amf_ip_address[l].ipv4_address,
*(NGParamList.paramarray[l][GNB_AMF_IPV4_ADDRESS_IDX].strptr));
NGAP_REGISTER_GNB_REQ(msg_p).amf_ip_address[l].ipv4 = 1;
NGAP_REGISTER_GNB_REQ(msg_p).amf_ip_address[l].ipv6 = 0;
/* if no broadcasst_plmn array is defined, fill default values */
if (NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] == 0) {
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] = NGAP_REGISTER_GNB_REQ(msg_p).num_plmn;
for (int el = 0; el < NGAP_REGISTER_GNB_REQ(msg_p).num_plmn; ++el)
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_index[l][el] = el;
}
}
// SCTP SETTING
NGAP_REGISTER_GNB_REQ(msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
NGAP_REGISTER_GNB_REQ(msg_p).sctp_in_streams = SCTP_IN_STREAMS;
if (IS_SA_MODE(get_softmodem_params())) {
snprintf(aprefix, sizeof(aprefix), "%s.[%d].%s", GNB_CONFIG_STRING_GNB_LIST, k, GNB_CONFIG_STRING_SCTP_CONFIG);
GET_PARAMS(SCTPParams, GNBSCTPPARAMS_DESC, aprefix);
NGAP_REGISTER_GNB_REQ(msg_p).sctp_in_streams = (uint16_t) * (SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
NGAP_REGISTER_GNB_REQ(msg_p).sctp_out_streams = (uint16_t) * (SCTPParams[GNB_SCTP_OUTSTREAMS_IDX].uptr);
}
// NETWORK_INTERFACES
snprintf(aprefix,
sizeof(aprefix),
"%s.[%d].%s",
GNB_CONFIG_STRING_GNB_LIST,
k,
GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
GET_PARAMS(NETParams, GNBNETPARAMS_DESC, aprefix);
if (NETParams[GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX].strptr != NULL) {
char *cidr = *(NETParams[GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX].strptr);
char *save = NULL;
char *address = strtok_r(cidr, "/", &save);
strcpy(NGAP_REGISTER_GNB_REQ(msg_p).gnb_ip_address.ipv4_address, address);
LOG_I(GNB_APP, "Parsed IPv4 address for NG AMF: %s\n", address);
}
NGAP_REGISTER_GNB_REQ(msg_p).gnb_ip_address.ipv6 = 0;
NGAP_REGISTER_GNB_REQ(msg_p).gnb_ip_address.ipv4 = 1;
break;
}
}
}
}
}
return 0;
}
+29
View File
@@ -0,0 +1,29 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef NGAP_GNB_CONFIG_H_
#define NGAP_GNB_CONFIG_H_
#include <stdint.h>
#include "intertask_interface.h"
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i);
#endif /* NGAP_GNB_CONFIG_H_ */
+9
View File
@@ -58,6 +58,7 @@
#include "ngap_gNB_mobility_management.h"
#include "ngap_gNB_ue_context.h"
#include "ngap_gNB_pdu_session_management.h"
#include "ngap_gNB_NRPPa_transport_procedures.h"
#include "oai_asn1.h"
#include "openair3/SECU/kdf.h"
#include "queue.h"
@@ -626,6 +627,14 @@ void *ngap_gNB_process_itti_msg(void *notUsed) {
ngap_gNB_handle_ul_ran_status_transfer(instance, &NGAP_UL_RAN_STATUS_TRANSFER(received_msg));
break;
case NGAP_UPLINKUEASSOCIATEDNRPPA:
ngap_gNB_uplink_ue_associated_nrppa_transport(instance, &NGAP_UPLINKUEASSOCIATEDNRPPA(received_msg));
break;
case NGAP_UPLINKNONUEASSOCIATEDNRPPA:
ngap_gNB_uplink_non_ue_associated_nrppa_transport(instance, &NGAP_UPLINKNONUEASSOCIATEDNRPPA(received_msg));
break;
default:
NGAP_ERROR("Received unhandled message: %d:%s\n", ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
@@ -0,0 +1,314 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "assertions.h"
#include "conversions.h"
#include "intertask_interface.h"
#include "ngap_common.h"
#include "ngap_gNB_defs.h"
#include "ngap_gNB_itti_messaging.h"
#include "ngap_gNB_encoder.h"
#include "ngap_gNB_nnsf.h"
#include "ngap_gNB_ue_context.h"
#include "ngap_gNB_management_procedures.h"
#include "ngap_gNB_NRPPa_transport_procedures.h"
// UPLINK UE ASSOCIATED NRPPA TRANSPORT (9.2.9.2 of TS 38.413 Version 16.0.0)
int ngap_gNB_uplink_ue_associated_nrppa_transport(instance_t instance, const ngap_uplink_ue_associated_nrppa_t *msg)
{
LOG_I(NGAP, "Initiating ngap_gNB_uplink_ue_associated_nrppa_transport \n");
DevAssert(msg != NULL);
DevAssert(msg->routing_id.buf);
DevAssert(msg->routing_id.len);
DevAssert(msg->nrppa_pdu.buf);
DevAssert(msg->nrppa_pdu.len);
struct ngap_gNB_ue_context_s *ue_context_p = NULL;
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
// Retrieve the NGAP gNB instance associated with Mod_id
ngap_gNB_instance_p = ngap_gNB_get_instance(instance);
DevAssert(ngap_gNB_instance_p != NULL);
if ((ue_context_p = ngap_get_ue_context(msg->gNB_ue_ngap_id)) == NULL) {
// The context for this gNB ue ngap id doesn't exist in the map of gNB UEs
LOG_E(NGAP, "Failed to find ue context associated with gNB ue ngap id: %08x\n", msg->gNB_ue_ngap_id);
return -1;
}
/* Prepare the NGAP message to encode */
NGAP_NGAP_PDU_t pdu = {0};
// IE: 9.3.1.1 Message Type UplinkUEAssociatedNRPPaTransport
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
asn1cCalloc(pdu.choice.initiatingMessage, head);
head->procedureCode = NGAP_ProcedureCode_id_UplinkUEAssociatedNRPPaTransport;
head->criticality = NGAP_Criticality_ignore;
head->value.present = NGAP_InitiatingMessage__value_PR_UplinkUEAssociatedNRPPaTransport;
NGAP_UplinkUEAssociatedNRPPaTransport_t *out = &head->value.choice.UplinkUEAssociatedNRPPaTransport;
// IE: 9.3.3.1 AMF UE NGAP ID (mandatory)
{
asn1cSequenceAdd(out->protocolIEs.list, NGAP_UplinkUEAssociatedNRPPaTransportIEs_t, ie);
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_UplinkUEAssociatedNRPPaTransportIEs__value_PR_AMF_UE_NGAP_ID;
asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, msg->amf_ue_ngap_id);
}
// IE: 9.3.3.2 RAN UE NGAP ID (mandatory)
{
asn1cSequenceAdd(out->protocolIEs.list, NGAP_UplinkUEAssociatedNRPPaTransportIEs_t, ie);
ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_UplinkUEAssociatedNRPPaTransportIEs__value_PR_RAN_UE_NGAP_ID;
ie->value.choice.RAN_UE_NGAP_ID = msg->gNB_ue_ngap_id;
}
// IE: 9.3.3.13 Routing ID (mandatory)
{
asn1cSequenceAdd(out->protocolIEs.list, NGAP_UplinkUEAssociatedNRPPaTransportIEs_t, ie);
ie->id = NGAP_ProtocolIE_ID_id_RoutingID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_UplinkUEAssociatedNRPPaTransportIEs__value_PR_RoutingID;
ie->value.choice.RoutingID.buf = msg->routing_id.buf;
ie->value.choice.RoutingID.size = msg->routing_id.len;
}
// IE: 9.3.3.14 NRPPa-PDU (mandatory)
{
asn1cSequenceAdd(out->protocolIEs.list, NGAP_UplinkUEAssociatedNRPPaTransportIEs_t, ie);
ie->id = NGAP_ProtocolIE_ID_id_NRPPa_PDU;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_UplinkUEAssociatedNRPPaTransportIEs__value_PR_NRPPa_PDU;
ie->value.choice.NRPPa_PDU.buf = msg->nrppa_pdu.buf;
ie->value.choice.NRPPa_PDU.size = msg->nrppa_pdu.len;
}
// Encode NGAP message
uint8_t *buffer = NULL;
uint32_t length = 0;
if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) {
LOG_E(NGAP, "Failed to encode Uplink UE Associated NRPPa Transport\n");
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, &pdu);
return -1;
}
LOG_I(NGAP, "Sending ngap_gNB_uplink_ue_associated_nrppa_transport over SCTP\n");
// UE associated signalling -> use the allocated stream
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id,
buffer,
length,
ue_context_p->tx_stream);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, &pdu);
return 0;
}
// UPLINK NON UE ASSOCIATED NRPPA TRANSPORT (9.2.9.4 of TS 38.413 Version 16.0.0)
int ngap_gNB_uplink_non_ue_associated_nrppa_transport(instance_t instance, const ngap_uplink_non_ue_associated_nrppa_t *msg)
{
LOG_I(NGAP, "ngap_gNB_uplink_non_ue_associated_nrppa_transport\n");
DevAssert(msg != NULL);
DevAssert(msg->routing_id.buf);
DevAssert(msg->routing_id.len);
DevAssert(msg->nrppa_pdu.buf);
DevAssert(msg->nrppa_pdu.len);
// Retrieve the NGAP gNB instance associated with Mod_id
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
ngap_gNB_instance_p = ngap_gNB_get_instance(instance);
DevAssert(ngap_gNB_instance_p != NULL);
// Retrieve the NGAP gNB amf data
ngap_gNB_amf_data_t *amf_desc_p = NULL;
amf_desc_p = ngap_gNB_get_AMF_from_instance(ngap_gNB_instance_p);
DevAssert(amf_desc_p != NULL);
// Prepare the NGAP message to encode
NGAP_NGAP_PDU_t pdu = {0};
// IE: 9.3.1.1 Message Type UplinkNonUEAssociatedNRPPaTransport
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
asn1cCalloc(pdu.choice.initiatingMessage, head);
head->procedureCode = NGAP_ProcedureCode_id_UplinkNonUEAssociatedNRPPaTransport;
head->criticality = NGAP_Criticality_ignore;
head->value.present = NGAP_InitiatingMessage__value_PR_UplinkNonUEAssociatedNRPPaTransport;
NGAP_UplinkNonUEAssociatedNRPPaTransport_t *out = &head->value.choice.UplinkNonUEAssociatedNRPPaTransport;
// IE: 9.3.3.13 Routing ID (mandatory)
{
asn1cSequenceAdd(out->protocolIEs.list, NGAP_UplinkNonUEAssociatedNRPPaTransportIEs_t, ie);
ie->id = NGAP_ProtocolIE_ID_id_RoutingID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_UplinkNonUEAssociatedNRPPaTransportIEs__value_PR_RoutingID;
ie->value.choice.RoutingID.buf = msg->routing_id.buf;
ie->value.choice.RoutingID.size = msg->routing_id.len;
}
// IE: 9.3.3.14 NRPPa-PDU (mandatory)
{
asn1cSequenceAdd(out->protocolIEs.list, NGAP_UplinkNonUEAssociatedNRPPaTransportIEs_t, ie);
ie->id = NGAP_ProtocolIE_ID_id_NRPPa_PDU;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_UplinkNonUEAssociatedNRPPaTransportIEs__value_PR_NRPPa_PDU;
ie->value.choice.NRPPa_PDU.buf = msg->nrppa_pdu.buf;
ie->value.choice.NRPPa_PDU.size = msg->nrppa_pdu.len;
}
// Encode NGAP message
uint8_t *buffer = NULL;
uint32_t length = 0;
if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) {
LOG_E(NGAP, "Failed to encode Uplink Non UE Associated NRPPa Transport\n");
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, &pdu);
return -1;
}
// Non UE-Associated signalling -> stream = 0
LOG_I(NGAP, "Sending ngap_gNB_uplink_non_ue_associated_nrppa_transport over SCTP (assoc_id %d)\n", amf_desc_p->assoc_id);
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, amf_desc_p->assoc_id, buffer, length, 0);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, &pdu);
return 0;
}
// handle DOWNLINK UE ASSOCIATED NRPPA TRANSPORT (9.2.9.1 of TS 38.413 Version 16.0.0)
int ngap_gNB_handle_downlink_ue_associated_nrppa_transport(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu)
{
DevAssert(pdu != NULL);
ngap_gNB_amf_data_t *amf_desc_p = NULL;
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
NGAP_ERROR("[SCTP %d] Received NRPPa downlink message for non existing AMF context\n", assoc_id);
return -1;
}
ngap_gNB_instance_t *ngap_gNB_instance = NULL;
ngap_gNB_instance = amf_desc_p->ngap_gNB_instance;
// Prepare the NGAP message for NRPPA
NGAP_DownlinkUEAssociatedNRPPaTransport_t *container = NULL;
NGAP_DownlinkUEAssociatedNRPPaTransportIEs_t *ie = NULL;
// IE: 9.3.1.1 Message Type
container = &pdu->choice.initiatingMessage->value.choice.DownlinkUEAssociatedNRPPaTransport;
// IE: 9.3.3.1 AMF UE NGAP ID
uint64_t amf_ue_ngap_id;
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_DownlinkUEAssociatedNRPPaTransportIEs_t,
ie,
container,
NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID,
true);
asn_INTEGER2ulong(&(ie->value.choice.AMF_UE_NGAP_ID), &amf_ue_ngap_id);
// IE: 9.3.3.2 RAN UE NGAP ID
NGAP_RAN_UE_NGAP_ID_t gnb_ue_ngap_id;
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_DownlinkUEAssociatedNRPPaTransportIEs_t,
ie,
container,
NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID,
true);
gnb_ue_ngap_id = ie->value.choice.RAN_UE_NGAP_ID;
ngap_gNB_ue_context_t *ue_desc_p = NULL;
if ((ue_desc_p = ngap_get_ue_context(gnb_ue_ngap_id)) == NULL) {
NGAP_ERROR("[SCTP %d] Received NRPPa downlink message for non existing UE context gNB_UE_NGAP_ID: 0x%lx\n",
assoc_id,
gnb_ue_ngap_id);
return -1;
}
// Is it the first outcome of the AMF for this UE ? If so store the amf UE ngap id
if (ue_desc_p->amf_ue_ngap_id == 0) {
ue_desc_p->amf_ue_ngap_id = amf_ue_ngap_id;
} else {
// We already have a amf ue ngap id check the received is the same
if (ue_desc_p->amf_ue_ngap_id != amf_ue_ngap_id) {
NGAP_ERROR("[SCTP %d] Mismatch in AMF UE NGAP ID (0x%lx != 0x%" PRIx64 "\n",
assoc_id,
amf_ue_ngap_id,
(uint64_t)ue_desc_p->amf_ue_ngap_id);
return -1;
}
}
MessageDef *msg = itti_alloc_new_message(TASK_NGAP, 0, NGAP_DOWNLINKUEASSOCIATEDNRPPA);
ngap_downlink_ue_associated_nrppa_t *dl_ue_assoc_nrppa = &NGAP_DOWNLINKUEASSOCIATEDNRPPA(msg);
dl_ue_assoc_nrppa->amf_ue_ngap_id = amf_ue_ngap_id;
dl_ue_assoc_nrppa->gNB_ue_ngap_id = gnb_ue_ngap_id;
// IE: 9.3.3.13 Routing ID
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_DownlinkUEAssociatedNRPPaTransportIEs_t, ie, container, NGAP_ProtocolIE_ID_id_RoutingID, true);
dl_ue_assoc_nrppa->routing_id = create_byte_array(ie->value.choice.RoutingID.size, ie->value.choice.RoutingID.buf);
// IE: 9.3.3.14 NRPPa-PDU
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_DownlinkUEAssociatedNRPPaTransportIEs_t, ie, container, NGAP_ProtocolIE_ID_id_NRPPa_PDU, true);
dl_ue_assoc_nrppa->nrppa_pdu = create_byte_array(ie->value.choice.NRPPa_PDU.size, ie->value.choice.NRPPa_PDU.buf);
// Forward the NRPPA PDU to NRPPA
itti_send_msg_to_task(TASK_NRPPA, ngap_gNB_instance->instance, msg);
return 0;
}
// handle DOWNLINK NON UE ASSOCIATED NRPPA TRANSPORT (9.2.9.3 of TS 38.413 Version 16.0.0)
int ngap_gNB_handle_downlink_non_ue_associated_nrppa_transport(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu)
{
DevAssert(pdu != NULL);
ngap_gNB_amf_data_t *amf_desc_p = NULL;
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
NGAP_ERROR("[SCTP %d] Received NRPPa downlink message for non existing AMF context\n", assoc_id);
return -1;
}
ngap_gNB_instance_t *ngap_gNB_instance = NULL;
ngap_gNB_instance = amf_desc_p->ngap_gNB_instance;
MessageDef *msg = itti_alloc_new_message(TASK_NGAP, 0, NGAP_DOWNLINKNONUEASSOCIATEDNRPPA);
ngap_downlink_non_ue_associated_nrppa_t *dl_non_ue_assoc_nrppa = &NGAP_DOWNLINKNONUEASSOCIATEDNRPPA(msg);
// Prepare the NGAP message to forward to NRPPA
NGAP_DownlinkNonUEAssociatedNRPPaTransport_t *container;
NGAP_DownlinkNonUEAssociatedNRPPaTransportIEs_t *ie;
// IE: 9.3.1.1 Message Type
container = &pdu->choice.initiatingMessage->value.choice.DownlinkNonUEAssociatedNRPPaTransport;
// IE: 9.3.3.13 Routing ID
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_DownlinkNonUEAssociatedNRPPaTransportIEs_t, ie, container, NGAP_ProtocolIE_ID_id_RoutingID, true);
dl_non_ue_assoc_nrppa->routing_id = create_byte_array(ie->value.choice.RoutingID.size, ie->value.choice.RoutingID.buf);
// IE: 9.3.3.14 NRPPa-PDU
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_DownlinkNonUEAssociatedNRPPaTransportIEs_t, ie, container, NGAP_ProtocolIE_ID_id_NRPPa_PDU, true);
dl_non_ue_assoc_nrppa->nrppa_pdu = create_byte_array(ie->value.choice.NRPPa_PDU.size, ie->value.choice.NRPPa_PDU.buf);
itti_send_msg_to_task(TASK_NRPPA, ngap_gNB_instance->instance, msg);
return 0;
}
@@ -0,0 +1,37 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef NGAP_GNB_NRPPA_PROCEDURES_H_
#define NGAP_GNB_NRPPA_PROCEDURES_H_
// UPLINK UE ASSOCIATED NRPPA TRANSPORT (9.2.9.2 of TS 38.413 Version 16.0.0)
int ngap_gNB_uplink_ue_associated_nrppa_transport(instance_t instance, const ngap_uplink_ue_associated_nrppa_t *msg);
// UPLINK NON UE ASSOCIATED NRPPA TRANSPORT (9.2.9.4 of TS 38.413 Version 16.0.0)
int ngap_gNB_uplink_non_ue_associated_nrppa_transport(instance_t instance, const ngap_uplink_non_ue_associated_nrppa_t *msg);
// DOWNLINK UE ASSOCIATED NRPPA TRANSPORT (9.2.9.1 of TS 38.413 Version 16.0.0)
int ngap_gNB_handle_downlink_ue_associated_nrppa_transport(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu);
// DOWNLINK UE ASSOCIATED NRPPA TRANSPORT (9.2.9.3 of TS 38.413 Version 16.0.0)
int ngap_gNB_handle_downlink_non_ue_associated_nrppa_transport(sctp_assoc_t assoc_id, uint32_t stream, NGAP_NGAP_PDU_t *pdu);
#endif /* NGAP_GNB_NRPPA_PROCEDURES_H_ */
+12
View File
@@ -112,6 +112,18 @@ static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) {
NGAP_INFO("DL RAN Status Transfer initiating message\n");
break;
case NGAP_ProcedureCode_id_DownlinkUEAssociatedNRPPaTransport:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
NGAP_INFO("DL UE Associated NRPPA Transport initiating message\n");
break;
case NGAP_ProcedureCode_id_DownlinkNonUEAssociatedNRPPaTransport:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
NGAP_INFO("DL NON UE Associated NRPPA Transport initiating message\n");
break;
default:
NGAP_ERROR("Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage->procedureCode);
+3 -1
View File
@@ -56,7 +56,9 @@ static inline int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu, uint8_t **buf
NGAP_ProcedureCode_id_UplinkRANStatusTransfer,
NGAP_ProcedureCode_id_HandoverPreparation,
NGAP_ProcedureCode_id_HandoverCancel,
NGAP_ProcedureCode_id_HandoverNotification};
NGAP_ProcedureCode_id_HandoverNotification,
NGAP_ProcedureCode_id_UplinkUEAssociatedNRPPaTransport,
NGAP_ProcedureCode_id_UplinkNonUEAssociatedNRPPaTransport};
int i;
for (i = 0; i < sizeofArray(tmp); i++)
if (pdu->choice.initiatingMessage->procedureCode == tmp[i])
+3 -2
View File
@@ -50,6 +50,7 @@
#include "ngap_gNB_pdu_session_management.h"
#include "ngap_gNB_nas_procedures.h"
#include "ngap_gNB_paging.h"
#include "ngap_gNB_NRPPa_transport_procedures.h"
#include "ngap_gNB_trace.h"
#include "ngap_gNB_ue_context.h"
#include "ngap_messages_types.h"
@@ -1499,10 +1500,10 @@ const ngap_message_decoded_callback ngap_messages_callback[][3] = {
{0, 0, 0}, /* CellTrafficTrace */
{ngap_gNB_handle_deactivate_trace, 0, 0}, /* DeactivateTrace */
{ngap_gNB_handle_nas_downlink, 0, 0}, /* DownlinkNASTransport */
{0, 0, 0}, /* DownlinkNonUEAssociatedNRPPaTransport */
{ngap_gNB_handle_downlink_non_ue_associated_nrppa_transport, 0, 0}, /* DownlinkNonUEAssociatedNRPPaTransport */
{0, 0, 0}, /* DownlinkRANConfigurationTransfer */
{ngap_gNB_handle_dl_ran_status_transfer, 0, 0}, /* DownlinkRANStatusTransfer */
{0, 0, 0}, /* DownlinkUEAssociatedNRPPaTransport */
{ngap_gNB_handle_downlink_ue_associated_nrppa_transport, 0, 0}, /* DownlinkUEAssociatedNRPPaTransport */
{ngap_gNB_handle_error_indication, 0, 0}, /* ErrorIndication */
{0, ngap_gNB_handle_handover_cancel_ack, 0}, /* HandoverCancel */
{0, 0, 0}, /* HandoverNotification */
+13 -3
View File
@@ -1,5 +1,15 @@
add_subdirectory(MESSAGES)
add_executable(test_nrppa ${OPENAIR3_DIR}/NRPPA/test_nrppa.c )
target_link_libraries(test_nrppa asn1_nrppa)
add_library(nrppa
nrppa_gNB.c
nrppa_gNB_config.c
nrppa_gNB_handlers.c
nrppa_gNB_decoder.c
nrppa_gNB_ue_context.c
nrppa_gNB_location_information_transfer.c
nrppa_gNB_encoder.c
nrppa_gNB_measurement_information_transfer.c
)
target_link_libraries(nrppa PUBLIC asn1_nrppa)
target_link_libraries(nrppa PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
+62
View File
@@ -0,0 +1,62 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef NRPPA_COMMON_H_
#define NRPPA_COMMON_H_
#include "oai_asn1.h"
#include "common/utils/LOG/log.h"
#include "ds/byte_array.h"
#include "nrppa_includes.h"
#define NRPPA_FIND_PROTOCOLIE_BY_ID(IE_TYPE, ie, container, IE_ID, mandatory) \
do { \
IE_TYPE **ptr; \
ie = NULL; \
for (ptr = container->protocolIEs.list.array; ptr < &container->protocolIEs.list.array[container->protocolIEs.list.count]; \
ptr++) { \
if ((*ptr)->id == IE_ID) { \
ie = *ptr; \
break; \
} \
} \
if (ie == NULL) { \
if (mandatory) { \
AssertFatal(false, "NRPPA_FIND_PROTOCOLIE_BY_ID ie is NULL (searching for ie: %ld)\n", IE_ID); \
} else { \
LOG_I(NRPPA, "NRPPA_FIND_PROTOCOLIE_BY_ID ie is NULL (searching for ie: %ld)\n", IE_ID); \
} \
} \
} while (0); \
if (mandatory && !ie) \
return -1
// gnb and ue related info in NRPPA message
typedef struct nrppa_gnb_ue_info_s {
instance_t instance;
int32_t gNB_ue_ngap_id;
int64_t amf_ue_ngap_id;
byte_array_t routing_id;
} nrppa_gnb_ue_info_t;
typedef int (*nrppa_message_decoded_callback)(nrppa_gnb_ue_info_t *nrppa_msg_info, const NRPPA_NRPPA_PDU_t *pdu);
#endif /* NRPPA_COMMON_H_ */
+92
View File
@@ -0,0 +1,92 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "tree.h"
#include "queue.h"
#include "intertask_interface.h"
#include "assertions.h"
#include "conversions.h"
#include "nrppa_gNB.h"
#include "nrppa_common.h"
#include "nrppa_gNB_handlers.h"
#include "nrppa_gNB_location_information_transfer.h"
#include "nrppa_gNB_measurement_information_transfer.h"
void nrppa_gNB_init(void)
{
LOG_I(NRPPA, "Starting NRPPA layer\n");
itti_mark_task_ready(TASK_NRPPA);
}
void *nrppa_gNB_process_itti_msg(void *notUsed)
{
MessageDef *received_msg = NULL;
int result;
itti_receive_msg(TASK_NRPPA, &received_msg);
if (received_msg) {
instance_t instance = ITTI_MSG_DESTINATION_INSTANCE(received_msg);
LOG_I(NRPPA, "Received message %s\n", ITTI_MSG_NAME(received_msg));
switch (ITTI_MSG_ID(received_msg)) {
case TERMINATE_MESSAGE:
LOG_W(NRPPA, " *** Exiting NRPPA thread\n");
itti_exit_task();
break;
case NGAP_DOWNLINKUEASSOCIATEDNRPPA:
nrppa_handle_downlink_ue_associated_nrppa_transport(instance, &NGAP_DOWNLINKUEASSOCIATEDNRPPA(received_msg));
break;
case NGAP_DOWNLINKNONUEASSOCIATEDNRPPA:
nrppa_handle_downlink_non_ue_associated_nrppa_transport(instance, &NGAP_DOWNLINKNONUEASSOCIATEDNRPPA(received_msg));
break;
case NRPPA_TRP_INFORMATION_RESP:
nrppa_gNB_trp_information_response(instance, received_msg);
break;
case NRPPA_POSITIONING_INFORMATION_RESP:
nrppa_gNB_positioning_information_response(instance, received_msg);
break;
case NRPPA_POSITIONING_ACTIVATION_RESP:
nrppa_gNB_positioning_activation_response(instance, received_msg);
break;
case NRPPA_MEASUREMENT_RESP:
nrppa_gNB_measurement_response(instance, received_msg);
break;
default:
LOG_E(NRPPA, "Received unhandled message: %d:%s\n", ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
}
result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal(result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
return NULL;
}
void *nrppa_gNB_task(void *arg)
{
nrppa_gNB_init();
while (1) {
(void)nrppa_gNB_process_itti_msg(NULL);
}
return NULL;
}
+32
View File
@@ -0,0 +1,32 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdio.h>
#include <stdint.h>
#ifndef NRPPA_GNB_H_
#define NRPPA_GNB_H_
void nrppa_gNB_init(void);
void *nrppa_gNB_process_itti_msg(void *notUsed);
void *nrppa_gNB_task(void *arg);
#endif /* NRPPA_GNB_H_ */
+84
View File
@@ -0,0 +1,84 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "nrppa_gNB_config.h"
#include "assertions.h"
#include "openair1/PHY/defs_nr_common.h"
#include "openair1/PHY/defs_gNB.h"
#include "common/ran_context.h"
#include "positioning_nr_paramdef.h"
positioning_config_t RCconfig_nr_positioning(void)
{
positioning_config_t positioning_config = {0};
paramdef_t positioning_params_desc[] = POSITIONING_PARAMS_DESC;
int num_params = sizeofArray(positioning_params_desc);
GET_PARAMS_LIST(POSITIONING_ParamList, POSITIONING_Params, POSITIONING_PARAMS_DESC, CONFIG_STRING_POSITIONING_CONFIG, NULL);
if (POSITIONING_ParamList.numelt > 0) {
paramdef_t *params = POSITIONING_ParamList.paramarray[0];
uint8_t num_trp = *gpd(params, num_params, CONFIG_STRING_POSITIONING_NUM_TRPS)->uptr;
if (num_trp == 0) {
LOG_E(NR_PHY, "No TRP configuration found..!!!\n");
return positioning_config;
} else if (num_trp > MAX_NUM_TRPs) {
AssertFatal(false, "Exceeded MAX number of TRPs\n");
}
uint8_t num_ids = gpd(params, num_params, CONFIG_STRING_POSITIONING_TRP_IDS_LIST)->numelt;
uint8_t num_x = gpd(params, num_params, CONFIG_STRING_POSITIONING_TRP_X_AXIS_LIST)->numelt;
uint8_t num_y = gpd(params, num_params, CONFIG_STRING_POSITIONING_TRP_Y_AXIS_LIST)->numelt;
uint8_t num_z = gpd(params, num_params, CONFIG_STRING_POSITIONING_TRP_Z_AXIS_LIST)->numelt;
uint8_t num_unit = gpd(params, num_params, CONFIG_STRING_POSITIONING_TRP_UNIT_LIST)->numelt;
if (num_trp != num_ids || num_trp != num_x || num_trp != num_y || num_trp != num_z || num_trp != num_unit) {
AssertFatal(false, "Mismatch in the number of TRPs with the number of ids, x-axis, y-axis, z-axis, units\n");
}
positioning_config.num_trp = num_trp;
for (int l = 0; l < num_trp; l++) {
positioning_config.trps[l].id = gpd(params, num_params, CONFIG_STRING_POSITIONING_TRP_IDS_LIST)->uptr[l];
positioning_config.trps[l].x_axis = gpd(params, num_params, CONFIG_STRING_POSITIONING_TRP_X_AXIS_LIST)->uptr[l];
positioning_config.trps[l].y_axis = gpd(params, num_params, CONFIG_STRING_POSITIONING_TRP_Y_AXIS_LIST)->uptr[l];
positioning_config.trps[l].z_axis = gpd(params, num_params, CONFIG_STRING_POSITIONING_TRP_Z_AXIS_LIST)->uptr[l];
positioning_config.trps[l].unit = gpd(params, num_params, CONFIG_STRING_POSITIONING_TRP_UNIT_LIST)->uptr[l];
}
} else {
LOG_I(NR_PHY, "No " CONFIG_STRING_POSITIONING_CONFIG " configuration found..!!\n");
}
return positioning_config;
}
void dump_positioning_config(const positioning_config_t *positioning_config)
{
uint8_t num_trp = positioning_config->num_trp;
LOG_I(NR_PHY, "-----------------------------------------\n");
LOG_I(NR_PHY, "Positioning Config\n");
LOG_I(NR_PHY, "-----------------------------------------\n");
LOG_I(NR_PHY, "Number of TRPs \t\t%d\n", num_trp);
for (int i = 0; i < num_trp; i++) {
LOG_I(NR_PHY, "X-axis of TRP ID %d \t\t%d\n", positioning_config->trps[i].id, positioning_config->trps[i].x_axis);
LOG_I(NR_PHY, "Y-axis of TRP ID %d \t\t%d\n", positioning_config->trps[i].id, positioning_config->trps[i].y_axis);
LOG_I(NR_PHY, "Z-axis of TRP ID %d \t\t%d\n", positioning_config->trps[i].id, positioning_config->trps[i].z_axis);
}
LOG_I(NR_PHY, "-----------------------------------------\n");
}
+30
View File
@@ -0,0 +1,30 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef GNB_CONFIG_POSITIONING_H_
#define GNB_CONFIG_POSITIONING_H_
#include "openair1/PHY/defs_nr_common.h"
positioning_config_t RCconfig_nr_positioning(void);
void dump_positioning_config(const positioning_config_t *positioning_config);
#endif /* GNB_CONFIG_POSITIONING_H_ */
+130
View File
@@ -0,0 +1,130 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "assertions.h"
#include "intertask_interface.h"
#include "nrppa_common.h"
#include "nrppa_gNB_decoder.h"
static int nrppa_gNB_decode_initiating_message(NRPPA_NRPPA_PDU_t *pdu)
{
asn_encode_to_new_buffer_result_t res = {NULL, {0, NULL, NULL}};
DevAssert(pdu != NULL);
switch (pdu->choice.initiatingMessage->procedureCode) {
case NRPPA_ProcedureCode_id_tRPInformationExchange: // TRPInformationRequest
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NRPPA_NRPPA_PDU, pdu);
LOG_I(NRPPA, "TRP Information Request initiating message\n");
free(res.buffer);
break;
case NRPPA_ProcedureCode_id_positioningInformationExchange: // PositioningInformationRequest
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NRPPA_NRPPA_PDU, pdu);
LOG_I(NRPPA, "Positioning Information Request initiating message\n");
free(res.buffer);
break;
case NRPPA_ProcedureCode_id_positioningActivation:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NRPPA_NRPPA_PDU, pdu);
LOG_I(NRPPA, "Positioning Activation initiating message\n");
free(res.buffer);
break;
case NRPPA_ProcedureCode_id_Measurement:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NRPPA_NRPPA_PDU, pdu);
LOG_I(NRPPA, "Positioning Measurement initiating message\n");
free(res.buffer);
break;
default:
AssertFatal(false, "Unknown procedure ID (%d) for initiating message\n", (int)pdu->choice.initiatingMessage->procedureCode);
return -1;
}
return 0;
}
static int nrppa_gNB_decode_successful_outcome(NRPPA_NRPPA_PDU_t *pdu)
{
asn_encode_to_new_buffer_result_t res = {NULL, {0, NULL, NULL}};
DevAssert(pdu != NULL);
switch (pdu->choice.successfulOutcome->procedureCode) {
case NRPPA_ProcedureCode_id_tRPInformationExchange:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NRPPA_NRPPA_PDU, pdu);
LOG_I(NRPPA, "TRP Information Response successfull outcome message\n");
free(res.buffer);
break;
default:
AssertFatal(false,
"Unknown procedure ID (%d) for successfull outcome message\n",
(int)pdu->choice.initiatingMessage->procedureCode);
return -1;
}
return 0;
}
static int nrppa_gNB_decode_unsuccessful_outcome(NRPPA_NRPPA_PDU_t *pdu)
{
asn_encode_to_new_buffer_result_t res = {NULL, {0, NULL, NULL}};
DevAssert(pdu != NULL);
switch (pdu->choice.unsuccessfulOutcome->procedureCode) {
case NRPPA_ProcedureCode_id_tRPInformationExchange:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NRPPA_NRPPA_PDU, pdu);
LOG_I(NRPPA, "TRP Information Failure unsuccessfull outcome message\n");
free(res.buffer);
break;
default:
AssertFatal(false,
"Unknown procedure ID (%d) for unsuccessfull outcome message\n",
(int)pdu->choice.initiatingMessage->procedureCode);
return -1;
}
return 0;
}
int nrppa_gNB_decode_pdu(NRPPA_NRPPA_PDU_t *pdu, const uint8_t *const buffer, const uint32_t length)
{
asn_dec_rval_t dec_ret;
DevAssert(pdu != NULL);
DevAssert(buffer != NULL);
asn_codec_ctx_t st = {.max_stack_size = 100 * 1000}; // if we enable asn1c debug the stack size become large
dec_ret = aper_decode(&st, &asn_DEF_NRPPA_NRPPA_PDU, (void **)&pdu, buffer, length, 0, 0);
if (dec_ret.code != RC_OK) {
LOG_E(NRPPA, "Failed to decode pdu\n");
return -1;
}
switch (pdu->present) {
case NRPPA_NRPPA_PDU_PR_initiatingMessage:
return nrppa_gNB_decode_initiating_message(pdu);
case NRPPA_NRPPA_PDU_PR_successfulOutcome:
return nrppa_gNB_decode_successful_outcome(pdu);
case NRPPA_NRPPA_PDU_PR_unsuccessfulOutcome:
return nrppa_gNB_decode_unsuccessful_outcome(pdu);
default:
LOG_I(NRPPA, "Unknown presence (%d) or not implemented\n", (int)pdu->present);
break;
}
return -1;
}
+30
View File
@@ -0,0 +1,30 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "nrppa_common.h"
#ifndef NRPPA_GNB_DECODER_H_
#define NRPPA_GNB_DECODER_H_
int nrppa_gNB_decode_pdu(NRPPA_NRPPA_PDU_t *pdu, const uint8_t *const buffer, const uint32_t length)
__attribute__((warn_unused_result));
#endif /* NRPPA_GNB_DECODER_H_ */
+135
View File
@@ -0,0 +1,135 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include "nrppa_common.h"
#include "nrppa_gNB_encoder.h"
static inline int nrppa_gNB_encode_initiating(NRPPA_NRPPA_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
{
DevAssert(pdu != NULL);
const NRPPA_ProcedureCode_t tmp[] = {NRPPA_ProcedureCode_id_positioningInformationExchange,
NRPPA_ProcedureCode_id_positioningActivation,
NRPPA_ProcedureCode_id_positioningInformationUpdate,
NRPPA_ProcedureCode_id_positioningDeactivation,
NRPPA_ProcedureCode_id_tRPInformationExchange,
NRPPA_ProcedureCode_id_Measurement,
NRPPA_ProcedureCode_id_MeasurementReport,
NRPPA_ProcedureCode_id_MeasurementFailureIndication,
NRPPA_ProcedureCode_id_MeasurementAbort,
NRPPA_ProcedureCode_id_MeasurementUpdate};
int i;
for (i = 0; i < sizeofArray(tmp); i++)
if (pdu->choice.initiatingMessage->procedureCode == tmp[i])
break;
if (i == sizeofArray(tmp)) {
LOG_E(NRPPA, "Unknown procedure ID (%d) for initiating message\n", (int)pdu->choice.initiatingMessage->procedureCode);
return -1;
}
asn_encode_to_new_buffer_result_t res = asn_encode_to_new_buffer(NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_NRPPA_NRPPA_PDU, pdu);
AssertFatal(res.result.encoded > 0, "failed to encode NRPPA msg\n");
*buffer = res.buffer;
*len = res.result.encoded;
return 0;
}
static inline int nrppa_gNB_encode_successfull_outcome(NRPPA_NRPPA_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
{
DevAssert(pdu != NULL);
const NRPPA_ProcedureCode_t tmp[] = {NRPPA_ProcedureCode_id_positioningInformationExchange,
NRPPA_ProcedureCode_id_positioningActivation,
NRPPA_ProcedureCode_id_tRPInformationExchange,
NRPPA_ProcedureCode_id_Measurement};
int i;
for (i = 0; i < sizeofArray(tmp); i++)
if (pdu->choice.successfulOutcome->procedureCode == tmp[i])
break;
if (i == sizeofArray(tmp)) {
LOG_E(NRPPA, "Unknown procedure ID (%ld) for successfull outcome message\n", pdu->choice.successfulOutcome->procedureCode);
return -1;
}
// xer_fprint(stdout, &asn_DEF_NRPPA_NRPPA_PDU, pdu);
asn_encode_to_new_buffer_result_t res = asn_encode_to_new_buffer(NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_NRPPA_NRPPA_PDU, pdu);
AssertFatal(res.result.encoded > 0, "failed to encode NRPPA msg\n");
*buffer = res.buffer;
*len = res.result.encoded;
return 0;
}
static inline int nrppa_gNB_encode_unsuccessfull_outcome(NRPPA_NRPPA_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
{
DevAssert(pdu != NULL);
const NRPPA_ProcedureCode_t tmp[] = {NRPPA_ProcedureCode_id_positioningInformationExchange,
NRPPA_ProcedureCode_id_positioningActivation,
NRPPA_ProcedureCode_id_tRPInformationExchange,
NRPPA_ProcedureCode_id_Measurement};
int i;
for (i = 0; i < sizeofArray(tmp); i++)
if (pdu->choice.unsuccessfulOutcome->procedureCode == tmp[i])
break;
if (i == sizeofArray(tmp)) {
LOG_W(NRPPA, "Unknown procedure ID (%ld) for unsuccessfull outcome message\n", pdu->choice.unsuccessfulOutcome->procedureCode);
return -1;
}
asn_encode_to_new_buffer_result_t res = asn_encode_to_new_buffer(NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_NRPPA_NRPPA_PDU, pdu);
AssertFatal(res.result.encoded > 0, "failed to encode NRPPA msg\n");
*buffer = res.buffer;
*len = res.result.encoded;
return 0;
}
int nrppa_gNB_encode_pdu(NRPPA_NRPPA_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
{
int ret = -1;
DevAssert(pdu != NULL);
DevAssert(buffer != NULL);
DevAssert(len != NULL);
// xer_fprint(stdout, &asn_DEF_NRPPA_NRPPA_PDU, (void *)pdu);
switch (pdu->present) {
case NRPPA_NRPPA_PDU_PR_initiatingMessage:
ret = nrppa_gNB_encode_initiating(pdu, buffer, len);
break;
case NRPPA_NRPPA_PDU_PR_successfulOutcome:
ret = nrppa_gNB_encode_successfull_outcome(pdu, buffer, len);
break;
case NRPPA_NRPPA_PDU_PR_unsuccessfulOutcome:
ret = nrppa_gNB_encode_unsuccessfull_outcome(pdu, buffer, len);
break;
default:
LOG_E(NRPPA, "Unknown message outcome (%d) or not implemented", (int)pdu->present);
return -1;
}
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NRPPA_NRPPA_PDU, pdu);
return ret;
}
+27
View File
@@ -0,0 +1,27 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef NRPPA_GNB_ENCODER_H_
#define NRPPA_GNB_ENCODER_H_
int nrppa_gNB_encode_pdu(NRPPA_NRPPA_PDU_t *pdu, uint8_t **buffer, uint32_t *len) __attribute__((warn_unused_result));
#endif /* NRPPA_GNB_ENCODER_H_ */
+184
View File
@@ -0,0 +1,184 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "intertask_interface.h"
#include "nrppa_gNB_handlers.h"
#include "nrppa_gNB_decoder.h"
#include "nrppa_common.h"
#include "nrppa_gNB_location_information_transfer.h"
#include "nrppa_gNB_measurement_information_transfer.h"
char *nrppa_direction2String(int nrppa_dir)
{
static char *nrppa_direction_String[] = {
"", /* Nothing */
"Originating message", /* originating message */
"Successfull outcome", /* successfull outcome */
"UnSuccessfull outcome", /* successfull outcome */
};
return (nrppa_direction_String[nrppa_dir]);
}
/* Handlers matrix. Only gNB related procedure present here */
nrppa_message_decoded_callback nrppa_messages_callback[][3] = {
{0, 0, 0}, // NRPPA_ProcedureCode_id_errorIndication ((NRPPA_ProcedureCode_t)0)
{0, 0, 0}, // NRPPA_ProcedureCode_id_privateMessage ((NRPPA_ProcedureCode_t)1)
{0, 0, 0}, // NRPPA_ProcedureCode_id_e_CIDMeasurementInitiation ((NRPPA_ProcedureCode_t)2)
{0, 0, 0}, // NRPPA_ProcedureCode_id_e_CIDMeasurementFailureIndication ((NRPPA_ProcedureCode_t)3)
{0, 0, 0}, // NRPPA_ProcedureCode_id_e_CIDMeasurementReport ((NRPPA_ProcedureCode_t)4)
{0, 0, 0}, // NRPPA_ProcedureCode_id_e_CIDMeasurementTermination ((NRPPA_ProcedureCode_t)5)
{0, 0, 0}, // NRPPA_ProcedureCode_id_oTDOAInformationExchange ((NRPPA_ProcedureCode_t)6)
{0, 0, 0}, // NRPPA_ProcedureCode_id_assistanceInformationControl ((NRPPA_ProcedureCode_t)7)
{0, 0, 0}, // NRPPA_ProcedureCode_id_assistanceInformationFeedback ((NRPPA_ProcedureCode_t)8)
{nrppa_gNB_handle_positioning_information_request,
0,
0}, // NRPPA_ProcedureCode_id_positioningInformationExchange ((NRPPA_ProcedureCode_t)9)
{0, 0, 0}, // NRPPA_ProcedureCode_id_positioningInformationUpdate ((NRPPA_ProcedureCode_t)10)
{nrppa_gNB_handle_measurement_request, 0, 0}, // NRPPA_ProcedureCode_id_Measurement ((NRPPA_ProcedureCode_t)11)
{0, 0, 0}, // NRPPA_ProcedureCode_id_MeasurementReport ((NRPPA_ProcedureCode_t)12)
{0, 0, 0}, // NRPPA_ProcedureCode_id_MeasurementUpdate ((NRPPA_ProcedureCode_t)13)
{0, 0, 0}, // NRPPA_ProcedureCode_id_MeasurementAbort ((NRPPA_ProcedureCode_t)14)
{0, 0, 0}, // NRPPA_ProcedureCode_id_MeasurementFailureIndication ((NRPPA_ProcedureCode_t)15)
{nrppa_gNB_handle_trp_information_request, 0, 0}, // NRPPA_ProcedureCode_id_tRPInformationExchange ((NRPPA_ProcedureCode_t)16)
{nrppa_gNB_handle_positioning_activation_request,
0,
0}, // NRPPA_ProcedureCode_id_positioningActivation ((NRPPA_ProcedureCode_t)17)
{0, 0, 0}, // NRPPA_ProcedureCode_id_positioningDeactivation ((NRPPA_ProcedureCode_t)18)
};
// Processing DOWNLINK UE ASSOCIATED NRPPA TRANSPORT (9.2.9.1 of TS 38.413 Version 16.0.0)
int nrppa_handle_downlink_ue_associated_nrppa_transport(instance_t instance, const ngap_downlink_ue_associated_nrppa_t *msg)
{
LOG_I(NRPPA, "Handling DOWNLINKUEASSOCIATEDNRPPA TRANSPORT\n");
uint8_t *const data = msg->nrppa_pdu.buf;
const uint32_t data_length = msg->nrppa_pdu.len;
NRPPA_NRPPA_PDU_t pdu;
int ret;
DevAssert(data != NULL);
memset(&pdu, 0, sizeof(pdu));
if (nrppa_gNB_decode_pdu(&pdu, data, data_length) < 0) {
LOG_E(NRPPA, "Failed to decode PDU\n");
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NRPPA_NRPPA_PDU, &pdu);
return -1;
}
/* Checking procedure Code and direction of message*/
if (pdu.choice.initiatingMessage->procedureCode >= sizeof(nrppa_messages_callback) / (3 * sizeof(nrppa_message_decoded_callback))
|| (pdu.present > NRPPA_NRPPA_PDU_PR_unsuccessfulOutcome)) {
LOG_E(NRPPA,
"Either procedureCode %ld or direction %d exceed expected\n",
pdu.choice.initiatingMessage->procedureCode,
pdu.present);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NRPPA_NRPPA_PDU, &pdu);
return -1;
}
/* No handler present.
* This can mean not implemented or no procedure for gNB (wrong direction).*/
if (nrppa_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1] == NULL) {
LOG_E(NRPPA,
"No handler for procedureCode %ld in %s\n",
pdu.choice.initiatingMessage->procedureCode,
nrppa_direction2String(pdu.present - 1));
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NRPPA_NRPPA_PDU, &pdu);
return -1;
}
/* Calling the right handler*/
nrppa_gnb_ue_info_t nrppa_msg_info;
nrppa_msg_info.instance = instance;
nrppa_msg_info.gNB_ue_ngap_id = msg->gNB_ue_ngap_id;
nrppa_msg_info.amf_ue_ngap_id = msg->amf_ue_ngap_id;
nrppa_msg_info.routing_id.buf = msg->routing_id.buf;
nrppa_msg_info.routing_id.len = msg->routing_id.len;
ret = (*nrppa_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1])(&nrppa_msg_info, &pdu);
if (msg->routing_id.buf) {
free(msg->routing_id.buf);
}
if (msg->nrppa_pdu.buf) {
free(msg->nrppa_pdu.buf);
}
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NRPPA_NRPPA_PDU, &pdu);
return ret;
}
// Processing DOWNLINK NON UE ASSOCIATED NRPPA TRANSPORT (9.2.9.3 of TS 38.413 Version 16.0.0)
int nrppa_handle_downlink_non_ue_associated_nrppa_transport(instance_t instance, const ngap_downlink_non_ue_associated_nrppa_t *msg)
{
LOG_I(NRPPA, "Handling DOWNLINKNONUEASSOCIATEDNRPPA TRANSPORT\n");
uint8_t *const data = msg->nrppa_pdu.buf;
const uint32_t data_length = msg->nrppa_pdu.len;
NRPPA_NRPPA_PDU_t pdu;
int ret;
DevAssert(data != NULL);
memset(&pdu, 0, sizeof(pdu));
if (nrppa_gNB_decode_pdu(&pdu, data, data_length) < 0) {
LOG_E(NRPPA, "Failed to decode Downlink Non UE Associated NRPPa PDU\n");
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NRPPA_NRPPA_PDU, &pdu);
return -1;
}
/* Checking procedure Code and direction of message*/
if (pdu.choice.initiatingMessage->procedureCode >= sizeof(nrppa_messages_callback) / (3 * sizeof(nrppa_message_decoded_callback))
|| (pdu.present > NRPPA_NRPPA_PDU_PR_unsuccessfulOutcome)) {
LOG_E(NRPPA,
"Either procedureCode %ld or direction %d exceed expected\n",
pdu.choice.initiatingMessage->procedureCode,
pdu.present);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NRPPA_NRPPA_PDU, &pdu);
return -1;
}
/* No handler present.
* This can mean not implemented or no procedure for gNB (wrong direction).*/
if (nrppa_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1] == NULL) {
LOG_E(NRPPA,
"No handler for procedureCode %ld in %s\n",
pdu.choice.initiatingMessage->procedureCode,
nrppa_direction2String(pdu.present - 1));
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NRPPA_NRPPA_PDU, &pdu);
return -1;
}
/* Calling the right handler*/
nrppa_gnb_ue_info_t nrppa_msg_info;
nrppa_msg_info.instance = instance;
nrppa_msg_info.gNB_ue_ngap_id = 0; // non-ue associated
nrppa_msg_info.amf_ue_ngap_id = 0; // non-ue associated
nrppa_msg_info.routing_id.buf = msg->routing_id.buf;
nrppa_msg_info.routing_id.len = msg->routing_id.len;
ret = (*nrppa_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1])(&nrppa_msg_info, &pdu);
if (msg->routing_id.buf) {
free(msg->routing_id.buf);
}
if (msg->nrppa_pdu.buf) {
free(msg->nrppa_pdu.buf);
}
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NRPPA_NRPPA_PDU, &pdu);
return ret;
}
+28
View File
@@ -0,0 +1,28 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef NRPPA_GNB_HANDLERS_H_
#define NRPPA_GNB_HANDLERS_H_
int nrppa_handle_downlink_ue_associated_nrppa_transport(instance_t instance, const ngap_downlink_ue_associated_nrppa_t *msg);
int nrppa_handle_downlink_non_ue_associated_nrppa_transport(instance_t instance,
const ngap_downlink_non_ue_associated_nrppa_t *msg);
#endif /* NRPPA_GNB_HANDLERS_H_ */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,41 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef NRPPA_GNB_POSITIONING_PROCEDURES_H_
#define NRPPA_GNB_POSITIONING_PROCEDURES_H_
int nrppa_gNB_handle_trp_information_request(nrppa_gnb_ue_info_t *nrppa_msg_info, const NRPPA_NRPPA_PDU_t *pdu);
void free_trp_information_request(nrppa_trp_information_req_t *msg);
int nrppa_gNB_trp_information_response(instance_t instance, MessageDef *msg_p);
void free_trp_information_request(nrppa_trp_information_req_t *msg);
NRPPA_TRPInformationItem_t encode_trp_info_type_response_item_nrppa(nrppa_trp_information_type_response_item_t *in);
void free_trp_information_response(nrppa_trp_information_resp_t *msg);
int nrppa_gNB_handle_positioning_information_request(nrppa_gnb_ue_info_t *nrppa_msg_info, const NRPPA_NRPPA_PDU_t *pdu);
int nrppa_gNB_positioning_information_response(instance_t instance, MessageDef *msg_p);
NRPPA_SRSCarrier_List_t encode_srs_carrier_list_nrppa(const nrppa_srs_carrier_list_t *in_list);
void free_srs_carrier_list(nrppa_srs_carrier_list_t *srs_carrier_list);
void free_positioning_information_response(nrppa_positioning_information_resp_t *msg);
int nrppa_gNB_handle_positioning_activation_request(nrppa_gnb_ue_info_t *nrppa_msg_info, const NRPPA_NRPPA_PDU_t *pdu);
void decode_nrppa_srstype(NRPPA_SRSType_t *srs_type, nrppa_srs_type_t *out);
void free_positioning_activation_request(nrppa_positioning_activation_req_t *msg);
int nrppa_gNB_positioning_activation_response(instance_t instance, MessageDef *msg_p);
#endif /* NRPPA_GNB_POSITIONING_PROCEDURES_H_ */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,32 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef NRPPA_GNB_MEASUREMENT_INFORMATION_TRANSFER_H_
#define NRPPA_GNB_MEASUREMENT_INFORMATION_TRANSFER_H_
int nrppa_gNB_handle_measurement_request(nrppa_gnb_ue_info_t *nrppa_msg_info, const NRPPA_NRPPA_PDU_t *pdu);
void decode_srs_carrier_list(nrppa_srs_carrier_list_t *out_list, const NRPPA_SRSCarrier_List_t *in_list);
void free_measurement_request(nrppa_measurement_req_t *msg);
int nrppa_gNB_measurement_response(instance_t instance, MessageDef *msg_p);
NRPPA_TRP_MeasurementResponseList_t encode_trp_measurement_reponse_list(nrppa_measurement_response_list_t *in_list);
void free_measurement_resp(nrppa_measurement_resp_t *msg);
#endif /* NRPPA_GNB_MEASUREMENT_INFORMATION_TRANSFER_H_ */
+96
View File
@@ -0,0 +1,96 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "nrppa_gNB_ue_context.h"
#include "tree.h"
#include "T.h"
#include "common/utils/T/T.h"
#include "common/utils/utils.h"
#include "common/utils/LOG/log.h"
static RB_HEAD(nrppa_ue_map, nrppa_gNB_ue_context_s) nrppa_ue_head = RB_INITIALIZER(&nrppa_ue_head);
/* Generate the tree management functions prototypes */
RB_PROTOTYPE(nrppa_ue_map, nrppa_gNB_ue_context_s, entries, nrppa_gNB_compare_transaction_id);
static int nrppa_gNB_compare_transaction_id(struct nrppa_gNB_ue_context_s *p1, struct nrppa_gNB_ue_context_s *p2)
{
if (p1->transaction_id > p2->transaction_id) {
return 1;
}
if (p1->transaction_id < p2->transaction_id) {
return -1;
}
return 0;
}
/* Generate the tree management functions */
RB_GENERATE(nrppa_ue_map, nrppa_gNB_ue_context_s, entries, nrppa_gNB_compare_transaction_id);
void nrppa_store_ue_context(const nrppa_gnb_ue_info_t *info, const uint16_t transaction_id)
{
LOG_I(NRPPA, "Create NRPPa UE context (gNB UE ID %u) for transaction ID : %u\n", info->gNB_ue_ngap_id, transaction_id);
nrppa_gNB_ue_context_t *ue_info_p = calloc_or_fail(1, sizeof(*ue_info_p));
ue_info_p->transaction_id = transaction_id;
ue_info_p->gNB_ue_ngap_id = info->gNB_ue_ngap_id;
ue_info_p->amf_ue_ngap_id = info->amf_ue_ngap_id;
if (info->routing_id.len > 0 && info->routing_id.buf != NULL) {
ue_info_p->routing_id.len = info->routing_id.len;
ue_info_p->routing_id.buf = calloc_or_fail(1, info->routing_id.len);
memcpy(ue_info_p->routing_id.buf, info->routing_id.buf, info->routing_id.len);
} else {
ue_info_p->routing_id.len = 0;
ue_info_p->routing_id.buf = NULL;
}
if (RB_INSERT(nrppa_ue_map, &nrppa_ue_head, ue_info_p))
LOG_E(NRPPA, "Bug in UE uniq number allocation %u, we try to add a existing UE\n", ue_info_p->gNB_ue_ngap_id);
return;
}
struct nrppa_gNB_ue_context_s *nrppa_get_ue_context(uint16_t transaction_id)
{
nrppa_gNB_ue_context_t temp = {.transaction_id = transaction_id};
return RB_FIND(nrppa_ue_map, &nrppa_ue_head, &temp);
}
struct nrppa_gNB_ue_context_s *nrppa_detach_ue_context(uint16_t transaction_id)
{
struct nrppa_gNB_ue_context_s *tmp = nrppa_get_ue_context(transaction_id);
if (tmp == NULL) {
LOG_E(NRPPA, "Trying to free a NULL UE context, %u\n", transaction_id);
return NULL;
}
RB_REMOVE(nrppa_ue_map, &nrppa_ue_head, tmp);
return tmp;
}
void nrppa_free_ue_context(nrppa_gNB_ue_context_t *ue_info)
{
if (!ue_info)
return;
if (ue_info->routing_id.buf) {
free(ue_info->routing_id.buf);
}
free(ue_info);
}
+44
View File
@@ -0,0 +1,44 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdint.h>
#include "tree.h"
#include "ds/byte_array.h"
#include "nrppa_common.h"
#ifndef NRPPA_GNB_UE_CONTEXT_H_
#define NRPPA_GNB_UE_CONTEXT_H_
typedef struct nrppa_gNB_ue_context_s {
/* Tree related data */
RB_ENTRY(nrppa_gNB_ue_context_s) entries;
uint16_t transaction_id;
uint32_t gNB_ue_ngap_id;
uint64_t amf_ue_ngap_id;
byte_array_t routing_id;
} nrppa_gNB_ue_context_t;
void nrppa_store_ue_context(const nrppa_gnb_ue_info_t *info, const uint16_t transaction_id);
nrppa_gNB_ue_context_t *nrppa_get_ue_context(uint16_t transaction_id);
nrppa_gNB_ue_context_t *nrppa_detach_ue_context(uint16_t transaction_id);
void nrppa_free_ue_context(nrppa_gNB_ue_context_t *ue_info);
#endif /* NRPPA_GNB_UE_CONTEXT_H_ */
+83
View File
@@ -0,0 +1,83 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef NRPPA_INCLUDE_H_
#define NRPPA_INCLUDE_H_
#include "NRPPA_NRPPA-PDU.h"
#include "NRPPA_InitiatingMessage.h"
#include "NRPPA_SuccessfulOutcome.h"
#include "NRPPA_UnsuccessfulOutcome.h"
#include "NRPPA_ProtocolIE-ID.h"
#include "NRPPA_ProtocolIE-Field.h"
#include "NRPPA_ProtocolIE-Container.h"
#include "NRPPA_ProtocolExtensionField.h"
#include "NRPPA_ProtocolIE-ContainerList.h"
#include "NRPPA_ProtocolExtensionContainer.h"
#include "NRPPA_ProtocolIE-Single-Container.h"
#include "NRPPA_asn_constant.h"
#include "NRPPA_TRPInformationRequest.h"
#include "NRPPA_TRPInformationItem.h"
#include "NRPPA_TRPPositionDirect.h"
#include "NRPPA_NG-RANAccessPointPosition.h"
#include "NRPPA_NGRANHighAccuracyAccessPointPosition.h"
#include "NRPPA_TRPPositionReferenced.h"
#include "NRPPA_RelativeGeodeticLocation.h"
#include "NRPPA_RelativeCartesianLocation.h"
#include "NRPPA_SRSCarrier-List-Item.h"
#include "NRPPA_SCS-SpecificCarrier.h"
#include "NRPPA_SRSConfig.h"
#include "NRPPA_SRSResource-List.h"
#include "NRPPA_SRSResource.h"
#include "NRPPA_ResourceType.h"
#include "NRPPA_ResourceTypePeriodic.h"
#include "NRPPA_ResourceTypeSemi-persistent.h"
#include "NRPPA_ResourceTypeAperiodic.h"
#include "NRPPA_PosSRSResource-List.h"
#include "NRPPA_ResourceTypePos.h"
#include "NRPPA_ResourceTypePeriodicPos.h"
#include "NRPPA_ResourceTypeSemi-persistentPos.h"
#include "NRPPA_ResourceTypeAperiodicPos.h"
#include "NRPPA_SRSResourceSet-List.h"
#include "NRPPA_SRSResourceSet.h"
#include "NRPPA_PosSRSResource-List.h"
#include "NRPPA_PosSRSResourceSet-Item.h"
#include "NRPPA_PosSRSResource-List.h"
#include "NRPPA_PosSRSResource-Item.h"
#include "NRPPA_ResourceSetTypePeriodic.h"
#include "NRPPA_ResourceSetTypeSemi-persistent.h"
#include "NRPPA_ResourceSetTypeAperiodic.h"
#include "NRPPA_PosSRSResourceSet-List.h"
#include "NRPPA_PosResourceSetTypePeriodic.h"
#include "NRPPA_PosResourceSetTypeSemi-persistent.h"
#include "NRPPA_PosResourceSetTypeAperiodic.h"
#include "NRPPA_SemipersistentSRS.h"
#include "NRPPA_AperiodicSRS.h"
#include "NRPPA_TRP-MeasurementRequestItem.h"
#include "NRPPA_TRPMeasurementQuantities-Item.h"
#include "NRPPA_TRPMeasurementQuantitiesList-Item.h"
#include "NRPPA_TRP-MeasurementResponseList.h"
#include "NRPPA_TRP-MeasurementResponseItem.h"
#include "NRPPA_TrpMeasurementResultItem.h"
#include "NRPPA_UL-RTOAMeasurement.h"
#include "NRPPA_GNB-RxTxTimeDiff.h"
#endif /* NRPPA_INCLUDE_H_ */
+1
View File
@@ -1 +1,2 @@
add_subdirectory(nr-cuup)
add_subdirectory(nr-cu-nrppa)
+11
View File
@@ -0,0 +1,11 @@
add_executable(nr-cu-nrppa-test nr-cu-nrppa.c
${OPENAIR2_DIR}/GNB_APP/gnb_config_common.c
${OPENAIR2_DIR}/GNB_APP/gnb_config_ng.c)
target_link_libraries(nr-cu-nrppa-test PRIVATE nr_nas nr_common lib_uicc usim_lib)
target_link_libraries(nr-cu-nrppa-test PRIVATE
CONFIG_LIB ITTI SCTP_CLIENT
f1ap ngap SECURITY
UTIL softmodem_common nrppa)
target_link_libraries(nr-cu-nrppa-test PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
add_dependencies(nr-cu-nrppa-test params_libconfig)
+81
View File
@@ -0,0 +1,81 @@
This is a simple standalone tester for NRPPA and NGAP positioning messages. It connects to the AMF to perform NGAP and NRPPA encoding/decoding and validates the exchange of positioning data.
[[_TOC_]]
# Overview
From a schematic point of view, the tester and Core Network interaction looks like this:
```
+-------+ +-------+
| LMF |<--- HTTP POST---| User |
+-------+ +-------+
|
| Nlmf
|
+-------+
| AMF |
+-------+
|
NGAP/NRPPA |
|
+-------+
|tester | (nr-cu-nrppa-test)
+-------+
```
The tester is designed to validate the integration of NRPPA and NGAP messages required for 5G positioning (*3GPP 38.413 V16.0.0* and *3GPP 38.455 V16.7.1*). It acts as a simulated RAN node (like a CU) connecting to the 5G Core Network's AMF.
The following messages are integrated and tested:
* **NGAP:** Uplink/Downlink UE Associated NRPPA Transport, Uplink/Downlink Non-UE Associated NRPPA Transport.
* **NRPPA:** TRP Information Request/Response, Positioning Information Request/Response, Positioning Activation Request/Response, Measurement Request/Response.
A test scenario is fixed to these steps:
1. The 5G Core Network, specifically including the Location Management Function (LMF), is deployed via Docker.
2. The tester connects to the AMF and establishes the NGAP connection.
3. The user initiates a positioning procedure via a API call to the LMF.
4. The AMF and the tester exchange the required NGAP and NRPPA messages to determine location.
# Usage
To run this test, you need to set up the Core Network and build the tester.
**1. Core Network Deployment**
Pull the required Docker images for the OAI 5G Core:
docker pull oaisoftwarealliance/ims:latest
docker pull oaisoftwarealliance/oai-amf:develop
docker pull oaisoftwarealliance/oai-nrf:develop
docker pull oaisoftwarealliance/oai-smf:develop
docker pull oaisoftwarealliance/oai-udr:develop
docker pull oaisoftwarealliance/oai-upf:develop
docker pull oaisoftwarealliance/oai-udm:develop
docker pull oaisoftwarealliance/oai-ausf:develop
docker pull oaisoftwarealliance/oai-lmf:develop
Deploy the network using the positioning compose file:
cd doc/tutorial_resources/oai-cn5g
docker compose -f docker-compose-positioning.yaml up -d
*(To undeploy later, run `docker compose -f docker-compose-positioning.yaml down -t 0`)*
**2. Building the Tester**
You can build the NRPPA tester like so:
cd ~/openairinterface5g
mkdir build && cd build && cmake .. -GNinja && ninja nr-cu-nrppa-test
**3. Running the Tester**
Start the tester with the dedicated configuration file:
LD_LIBRARY_PATH=. ./tests/nr-cu-nrppa/nr-cu-nrppa-test -O ../tests/nr-cu-nrppa/nr-nrppa-test.conf
**4. Initiating the Procedure**
Trigger the location determination by sending an HTTP POST request to the LMF:
cd ~/openairinterface5g/doc/tutorial_resources/positioning/
curl --http2-prior-knowledge -H "Content-Type: application/json" -d "@InputData.json" -X POST http://192.168.70.141:8080/nlmf-loc/v1/determine-location
# Limitations
- The tester is a standalone validation tool (`nr-cu-nrppa-test`) and does not represent a fully integrated, end-to-end gNB positioning setup.
+733
View File
@@ -0,0 +1,733 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "executables/softmodem-common.h"
#include "common/utils/ocp_itti/intertask_interface.h"
#include "common/ran_context.h"
#include "nfapi/oai_integration/vendor_ext.h"
#include "openair2/GNB_APP/gnb_config_common.h"
#include "openair2/GNB_APP/gnb_config_ng.h"
#include "openair2/GNB_APP/gnb_paramdef.h"
#include "openair3/SCTP/sctp_default_values.h"
#include "openair3/NRPPA/nrppa_gNB_config.h"
#include "openair3/NRPPA/nrppa_gNB.h"
#include "openair3/NAS/NR_UE/nr_nas_msg.h"
#include "executables/nr-uesoftmodem.h"
#include "openair3/NRPPA/nrppa_gNB_location_information_transfer.c"
#include "openair3/NRPPA/nrppa_gNB_measurement_information_transfer.h"
RAN_CONTEXT_t RC;
THREAD_STRUCT thread_struct;
uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
int oai_exit = 0;
int gnb_id;
int NB_UE_INST = 1;
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
{
if (assert) {
abort();
} else {
sleep(1); // allow other threads to exit first
exit(EXIT_SUCCESS);
}
}
nfapi_mode_t nfapi_mod = -1;
void nfapi_setmode(nfapi_mode_t nfapi_mode)
{
nfapi_mod = nfapi_mode;
}
nfapi_mode_t nfapi_getmode(void)
{
return nfapi_mod;
}
ngran_node_t get_node_type()
{
return ngran_gNB_CUUP;
}
nrUE_params_t *get_nrUE_params(void)
{
static nrUE_params_t params = {0};
params.extra_pdu_id = -1;
return &params;
}
void create_ue_ip_if(void)
{
}
void create_ue_eth_if(void)
{
}
void set_qfi(void)
{
}
configmodule_interface_t *uniqCfg = NULL;
static nrppa_trp_information_resp_t fill_trp_resp(uint8_t transaction_id)
{
positioning_config_t positioning_config = RCconfig_nr_positioning();
dump_positioning_config(&positioning_config);
nrppa_trp_information_resp_t resp = {0};
resp.transaction_id = transaction_id;
nrppa_trp_information_list_t *list = &resp.trp_information_list;
uint32_t trp_info_item_len = positioning_config.num_trp;
list->trp_information_item_length = trp_info_item_len;
list->trp_information_item = calloc_or_fail(trp_info_item_len, sizeof(*list->trp_information_item));
uint8_t resp_item_len = 3;
for (int i = 0; i < trp_info_item_len; i++) {
nrppa_trp_information_t *tRPInformation = &list->trp_information_item[i];
tRPInformation->trp_id = positioning_config.trps[i].id;
nrppa_trp_information_type_response_list_t *resp_list = &tRPInformation->trp_information_type_response_list;
resp_list->trp_information_type_response_item_length = resp_item_len;
nrppa_trp_information_type_response_item_t *resp_item = calloc_or_fail(resp_item_len, sizeof(*resp_item));
resp_list->trp_information_type_response_item = resp_item;
// nrPCI
resp_item[0].present = NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_PCI_NR;
resp_item[0].choice.pci_nr = 123 + i;
// nG_RAN_CGI
resp_item[1].present = NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_NG_RAN_CGI;
resp_item[1].choice.ng_ran_cgi.plmn.mcc = 001;
resp_item[1].choice.ng_ran_cgi.plmn.mnc = 01;
resp_item[1].choice.ng_ran_cgi.plmn.mnc_digit_length = 2;
resp_item[1].choice.ng_ran_cgi.nr_cellid = gnb_id << 8; // HACK: Made to work with lmf
// geographicalCoordinates
resp_item[2].present = NRPPA_TRP_INFORMATION_TYPE_RESPONSE_ITEM_PR_GEOGRAPHICALCOORDINATES;
nrppa_geographical_coordinates_t *geographicalCoordinates = &resp_item[2].choice.geographical_coordinates;
nrppa_trp_position_definition_type_t *tRPPositionDefinitionType = &geographicalCoordinates->trp_position_definition_type;
// referenced
tRPPositionDefinitionType->present = NRPPA_TRP_POSITION_DEFINITION_TYPE_PR_REFERENCED;
nrppa_trp_position_referenced_t *referenced = &tRPPositionDefinitionType->choice.referenced;
// coordinate ID
referenced->reference_point.present = NRPPA_REFERENCE_POINT_PR_COORDINATEID;
referenced->reference_point.choice.coordinate_id = 2;
nrppa_trp_reference_point_type_t *referencePointType = &referenced->reference_point_type;
// relative cartesian
referencePointType->present = NRPPA_TRP_REFERENCE_POINT_TYPE_PR_TRPPOSITION_RELATIVE_CARTESIAN;
nrppa_relative_cartesian_location_t *trp_pos_cart = &referencePointType->choice.trp_position_relative_cartesian;
// 0 = millimeter
trp_pos_cart->xyz_unit = positioning_config.trps[i].unit;
// random reference cartesian coordinates in millimeter
trp_pos_cart->xvalue = positioning_config.trps[i].x_axis;
trp_pos_cart->yvalue = positioning_config.trps[i].y_axis;
trp_pos_cart->zvalue = positioning_config.trps[i].z_axis;
// testing random values for uncertainity and confidence
trp_pos_cart->location_uncertainty.horizontal_uncertainty = i + 1;
trp_pos_cart->location_uncertainty.horizontal_confidence = i + 2;
trp_pos_cart->location_uncertainty.vertical_uncertainty = i + 3;
trp_pos_cart->location_uncertainty.vertical_confidence = i + 4;
}
return resp;
}
static nrppa_positioning_information_resp_t fill_position_information_resp(uint16_t transaction_id)
{
nrppa_positioning_information_resp_t resp = {0};
resp.transaction_id = transaction_id;
resp.srs_configuration = calloc_or_fail(1, sizeof(*resp.srs_configuration));
nrppa_srs_carrier_list_t *srs_carrier_list = &resp.srs_configuration->srs_carrier_list;
uint32_t srs_carrier_list_len = 2;
srs_carrier_list->srs_carrier_list_length = srs_carrier_list_len;
srs_carrier_list->srs_carrier_list_item = calloc_or_fail(srs_carrier_list_len, sizeof(*srs_carrier_list->srs_carrier_list_item));
for (int i = 0; i < srs_carrier_list_len; i++) {
nrppa_srs_carrier_list_item_t *srs_carrier_list_item = &srs_carrier_list->srs_carrier_list_item[i];
// pointA
srs_carrier_list_item->pointA = 87641 + i;
// Uplink Channel BW-PerSCS-List
nrppa_uplink_channel_bw_per_scs_list_t *uplink_channel_bw_per_scs_list = &srs_carrier_list_item->uplink_channel_bw_per_scs_list;
uint32_t scs_specific_carrier_list_length = 3;
uplink_channel_bw_per_scs_list->scs_specific_carrier_list_length = scs_specific_carrier_list_length;
uplink_channel_bw_per_scs_list->scs_specific_carrier =
calloc_or_fail(scs_specific_carrier_list_length, sizeof(*uplink_channel_bw_per_scs_list->scs_specific_carrier));
for (int j = 0; j < scs_specific_carrier_list_length; j++) {
nrppa_scs_specific_carrier_t *scs_specific_carrier = &uplink_channel_bw_per_scs_list->scs_specific_carrier[j];
// offset to carrier
scs_specific_carrier->offset_to_carrier = 100 + i + j;
// subcarrier spacing
scs_specific_carrier->subcarrier_spacing = NRPPA_SUBCARRIER_SPACING_30KHZ;
// carrier bandwidth
scs_specific_carrier->carrier_bandwidth = 106 + i + j;
}
// Active UL BWP
nrppa_active_ul_bwp_t *active_ul_bwp = &srs_carrier_list_item->active_ul_bwp;
// location and bandwidth
active_ul_bwp->location_and_bandwidth = 2775 + i;
// subcarrier spacing
active_ul_bwp->subcarrier_spacing = NRPPA_SUBCARRIER_SPACING_30KHZ;
// cyclic prefix
active_ul_bwp->cyclic_prefix = NRPPA_CP_TYPE_NORMAL;
// Tx Direct Current Location
active_ul_bwp->tx_direct_current_location = 10 + i;
// SRS Config
nrppa_srs_config_t *sRSConfig = &active_ul_bwp->srs_config;
// srs_resource_list
sRSConfig->srs_resource_list = calloc_or_fail(1, sizeof(*sRSConfig->srs_resource_list));
nrppa_srs_resource_list_t *srs_resource_list = sRSConfig->srs_resource_list;
uint32_t srs_resource_list_length = 3;
srs_resource_list->srs_resource_list_length = srs_resource_list_length;
srs_resource_list->srs_resource = calloc_or_fail(srs_resource_list_length, sizeof(*srs_resource_list->srs_resource));
// SRS resource config 1 : periodic
nrppa_srs_resource_t *srs_resource = &srs_resource_list->srs_resource[0];
srs_resource->srs_resource_id = 22;
srs_resource->nr_of_srs_ports = NRPPA_SRS_NUMBER_OF_PORTS_N2;
srs_resource->transmission_comb.present = NRPPA_TRANSMISSION_COMB_PR_N2;
srs_resource->transmission_comb.choice.n2.comb_offset_n2 = 1;
srs_resource->transmission_comb.choice.n2.cyclic_shift_n2 = 3;
srs_resource->start_position = 8;
srs_resource->nr_of_symbols = NRPPA_SRS_NUMBER_OF_SYMBOLS_N4;
srs_resource->repetition_factor = NRPPA_SRS_REPETITION_FACTOR_RF2;
srs_resource->freq_domain_position = 32;
srs_resource->freq_domain_shift = 108;
srs_resource->c_srs = 31;
srs_resource->b_srs = 1;
srs_resource->b_hop = 3;
srs_resource->group_or_sequence_hopping = NRPPA_GROUPORSEQUENCEHOPPING_GROUPHOPPING;
srs_resource->resource_type.present = NRPPA_RESOURCE_TYPE_PR_PERIODIC;
nrppa_resource_type_periodic_t *periodic = &srs_resource->resource_type.choice.periodic;
periodic->periodicity = NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT16;
periodic->offset = 1000;
srs_resource->sequence_id = 18;
// SRS resource config 2 : semi-persistent
srs_resource = &srs_resource_list->srs_resource[1];
srs_resource->srs_resource_id = 24;
srs_resource->nr_of_srs_ports = NRPPA_SRS_NUMBER_OF_PORTS_N4;
srs_resource->transmission_comb.present = NRPPA_TRANSMISSION_COMB_PR_N4;
srs_resource->transmission_comb.choice.n2.comb_offset_n2 = 3;
srs_resource->transmission_comb.choice.n2.cyclic_shift_n2 = 5;
srs_resource->start_position = 8;
srs_resource->nr_of_symbols = NRPPA_SRS_NUMBER_OF_SYMBOLS_N2;
srs_resource->repetition_factor = NRPPA_SRS_REPETITION_FACTOR_RF2;
srs_resource->freq_domain_position = 32;
srs_resource->freq_domain_shift = 108;
srs_resource->c_srs = 31;
srs_resource->b_srs = 1;
srs_resource->b_hop = 3;
srs_resource->group_or_sequence_hopping = NRPPA_GROUPORSEQUENCEHOPPING_GROUPHOPPING;
srs_resource->resource_type.present = NRPPA_RESOURCE_TYPE_PR_SEMI_PERSISTENT;
srs_resource->resource_type.present = NRPPA_RESOURCE_TYPE_PR_SEMI_PERSISTENT;
nrppa_resource_type_semi_persistent_t *semi_persistent = &srs_resource->resource_type.choice.semi_persistent;
semi_persistent->periodicity = NRPPA_SRS_RESOURCE_TYPE_PERIODICITY_SLOT40;
semi_persistent->offset = 1000;
srs_resource->sequence_id = 12;
// SRS resource config 2 : aperiodic
srs_resource = &srs_resource_list->srs_resource[2];
srs_resource->srs_resource_id = 26;
srs_resource->nr_of_srs_ports = NRPPA_SRS_NUMBER_OF_PORTS_N2;
srs_resource->transmission_comb.present = NRPPA_TRANSMISSION_COMB_PR_N2;
srs_resource->transmission_comb.choice.n2.comb_offset_n2 = 1;
srs_resource->transmission_comb.choice.n2.cyclic_shift_n2 = 3;
srs_resource->start_position = 8;
srs_resource->nr_of_symbols = NRPPA_SRS_NUMBER_OF_SYMBOLS_N4;
srs_resource->repetition_factor = NRPPA_SRS_REPETITION_FACTOR_RF2;
srs_resource->freq_domain_position = 32;
srs_resource->freq_domain_shift = 108;
srs_resource->c_srs = 31;
srs_resource->b_srs = 1;
srs_resource->b_hop = 3;
srs_resource->group_or_sequence_hopping = NRPPA_GROUPORSEQUENCEHOPPING_SEQUENCEHOPPING;
srs_resource->resource_type.present = NRPPA_RESOURCE_TYPE_PR_APERIODIC;
// set aperiodic = 0 to enable
srs_resource->resource_type.choice.aperiodic = 0;
srs_resource->sequence_id = 10;
// optional: pos_srs_resource_list
sRSConfig->pos_srs_resource_list = calloc_or_fail(1, sizeof(*sRSConfig->pos_srs_resource_list));
nrppa_pos_srs_resource_list_t *pos_srs_resource_list = sRSConfig->pos_srs_resource_list;
uint32_t pos_srs_resource_list_length = 3;
pos_srs_resource_list->pos_srs_resource_list_length = pos_srs_resource_list_length;
pos_srs_resource_list->pos_srs_resource_item =
calloc_or_fail(pos_srs_resource_list_length, sizeof(*pos_srs_resource_list->pos_srs_resource_item));
// periodic
nrppa_pos_srs_resource_item_t *pos_srs_resource = &pos_srs_resource_list->pos_srs_resource_item[0];
pos_srs_resource->srs_pos_resource_id = 12;
pos_srs_resource->transmission_comb_pos.present = NRPPA_TRANSMISSION_COMB_POS_PR_N2;
pos_srs_resource->transmission_comb_pos.choice.n2.comb_offset_n2 = 1;
pos_srs_resource->transmission_comb_pos.choice.n2.cyclic_shift_n2 = 4;
pos_srs_resource->start_position = 9;
pos_srs_resource->nr_of_symbols = NRPPA_SRS_RESOURCE_ITEM_NUMBER_OF_SYMBOLS_N8;
pos_srs_resource->freq_domain_shift = 100;
pos_srs_resource->c_srs = 20;
pos_srs_resource->group_or_sequence_hopping = NRPPA_GROUPORSEQUENCEHOPPING_GROUPHOPPING;
pos_srs_resource->resource_type_pos.present = NRPPA_RESOURCE_TYPE_POS_PR_PERIODIC;
pos_srs_resource->resource_type_pos.choice.periodic.periodicity = NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT5;
pos_srs_resource->resource_type_pos.choice.periodic.offset = 10;
pos_srs_resource->sequence_id = 1;
// semi-persistent
pos_srs_resource = &pos_srs_resource_list->pos_srs_resource_item[1];
pos_srs_resource->srs_pos_resource_id = 13;
pos_srs_resource->transmission_comb_pos.present = NRPPA_TRANSMISSION_COMB_POS_PR_N4;
pos_srs_resource->transmission_comb_pos.choice.n4.comb_offset_n4 = 3;
pos_srs_resource->transmission_comb_pos.choice.n4.cyclic_shift_n4 = 5;
pos_srs_resource->start_position = 12;
pos_srs_resource->nr_of_symbols = NRPPA_SRS_RESOURCE_ITEM_NUMBER_OF_SYMBOLS_N12;
pos_srs_resource->freq_domain_shift = 100;
pos_srs_resource->c_srs = 20;
pos_srs_resource->group_or_sequence_hopping = NRPPA_GROUPORSEQUENCEHOPPING_GROUPHOPPING;
pos_srs_resource->resource_type_pos.present = NRPPA_RESOURCE_TYPE_POS_PR_SEMI_PERSISTENT;
pos_srs_resource->resource_type_pos.choice.semi_persistent.periodicity = NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT32;
pos_srs_resource->resource_type_pos.choice.semi_persistent.offset = 5;
pos_srs_resource->sequence_id = 2;
// aperiodic
pos_srs_resource = &pos_srs_resource_list->pos_srs_resource_item[2];
pos_srs_resource->srs_pos_resource_id = 14;
pos_srs_resource->transmission_comb_pos.present = NRPPA_TRANSMISSION_COMB_POS_PR_N8;
pos_srs_resource->transmission_comb_pos.choice.n8.comb_offset_n8 = 5;
pos_srs_resource->transmission_comb_pos.choice.n8.cyclic_shift_n8 = 2;
pos_srs_resource->start_position = 9;
pos_srs_resource->nr_of_symbols = NRPPA_SRS_RESOURCE_ITEM_NUMBER_OF_SYMBOLS_N4;
pos_srs_resource->freq_domain_shift = 100;
pos_srs_resource->c_srs = 20;
pos_srs_resource->group_or_sequence_hopping = NRPPA_GROUPORSEQUENCEHOPPING_SEQUENCEHOPPING;
pos_srs_resource->resource_type_pos.present = NRPPA_RESOURCE_TYPE_POS_PR_APERIODIC;
pos_srs_resource->resource_type_pos.choice.periodic.periodicity = NRPPA_SRS_RESOURCE_TYPE_POS_PERIODICITY_SLOT5;
pos_srs_resource->resource_type_pos.choice.aperiodic.slot_offset = 31;
pos_srs_resource->sequence_id = 3;
// optional: srs_resource_set_list
sRSConfig->srs_resource_set_list = calloc_or_fail(1, sizeof(*sRSConfig->srs_resource_set_list));
nrppa_srs_resource_set_list_t *srs_resource_set_list = sRSConfig->srs_resource_set_list;
uint32_t srs_resource_set_list_length = 3;
srs_resource_set_list->srs_resource_set_list_length = srs_resource_set_list_length;
srs_resource_set_list->srs_resource_set =
calloc_or_fail(srs_resource_set_list_length, sizeof(*srs_resource_set_list->srs_resource_set));
// periodic
nrppa_srs_resource_set_t *srs_resource_set = &srs_resource_set_list->srs_resource_set[0];
srs_resource_set->srs_resource_set_id = 0;
uint8_t srs_resource_id_list_length = 5;
srs_resource_set->srs_resource_id_list.srs_resource_id_list_length = srs_resource_id_list_length;
srs_resource_set->srs_resource_id_list.srs_resource_id =
calloc_or_fail(srs_resource_id_list_length, sizeof(*srs_resource_set->srs_resource_id_list.srs_resource_id));
for (int k = 0; k < srs_resource_id_list_length; k++) {
srs_resource_set->srs_resource_id_list.srs_resource_id[k] = k;
}
srs_resource_set->resource_set_type.present = NRPPA_RESOURCE_SET_TYPE_PR_PERIODIC;
// set periodic = 0 to enable
srs_resource_set->resource_set_type.choice.periodic = 0;
// semi-persistent
srs_resource_set = &srs_resource_set_list->srs_resource_set[1];
srs_resource_set->srs_resource_set_id = 1;
srs_resource_id_list_length = 5;
srs_resource_set->srs_resource_id_list.srs_resource_id_list_length = srs_resource_id_list_length;
srs_resource_set->srs_resource_id_list.srs_resource_id =
calloc_or_fail(srs_resource_id_list_length, sizeof(srs_resource_set->srs_resource_id_list.srs_resource_id));
for (int k = 0; k < srs_resource_id_list_length; k++) {
srs_resource_set->srs_resource_id_list.srs_resource_id[k] = k;
}
srs_resource_set->resource_set_type.present = NRPPA_RESOURCE_SET_TYPE_PR_SEMI_PERSISTENT;
// set semi_persistent = 0 to enable
srs_resource_set->resource_set_type.choice.semi_persistent = 0;
// aperiodic
srs_resource_set = &srs_resource_set_list->srs_resource_set[2];
srs_resource_set->srs_resource_set_id = 2;
srs_resource_id_list_length = 5;
srs_resource_set->srs_resource_id_list.srs_resource_id_list_length = srs_resource_id_list_length;
srs_resource_set->srs_resource_id_list.srs_resource_id =
calloc_or_fail(srs_resource_id_list_length, sizeof(*srs_resource_set->srs_resource_id_list.srs_resource_id));
for (int k = 0; k < srs_resource_id_list_length; k++) {
srs_resource_set->srs_resource_id_list.srs_resource_id[k] = k;
}
srs_resource_set->resource_set_type.present = NRPPA_RESOURCE_SET_TYPE_PR_APERIODIC;
srs_resource_set->resource_set_type.choice.aperiodic.srs_resource_trigger = 2;
srs_resource_set->resource_set_type.choice.aperiodic.slot_offset = 20;
// optional: pos_srs_resource_set_list
sRSConfig->pos_srs_resource_set_list = calloc_or_fail(1, sizeof(*sRSConfig->pos_srs_resource_set_list));
nrppa_pos_srs_resource_set_list_t *pos_srs_resource_set_list = sRSConfig->pos_srs_resource_set_list;
uint32_t pos_srs_resource_set_list_length = 3;
pos_srs_resource_set_list->pos_srs_resource_set_list_length = pos_srs_resource_set_list_length;
pos_srs_resource_set_list->pos_srs_resource_set_item =
calloc_or_fail(pos_srs_resource_set_list_length, sizeof(*pos_srs_resource_set_list->pos_srs_resource_set_item));
// periodic
nrppa_pos_srs_resource_set_item_t *pos_srs_resource_set = &pos_srs_resource_set_list->pos_srs_resource_set_item[0];
pos_srs_resource_set->pos_srs_resource_set_id = 0;
uint8_t pos_srs_resource_id_list_length = 5;
pos_srs_resource_set->pos_srs_resource_id_list.pos_srs_resource_id_list_length = pos_srs_resource_id_list_length;
pos_srs_resource_set->pos_srs_resource_id_list.srs_pos_resource_id =
calloc_or_fail(pos_srs_resource_id_list_length,
sizeof(*pos_srs_resource_set->pos_srs_resource_id_list.srs_pos_resource_id));
for (int k = 0; k < pos_srs_resource_id_list_length; k++) {
pos_srs_resource_set->pos_srs_resource_id_list.srs_pos_resource_id[k] = k;
}
pos_srs_resource_set->pos_resource_set_type.present = NRPPA_POS_RESOURCE_SET_TYPE_PR_PERIODIC;
// set periodic = 0 to enable
pos_srs_resource_set->pos_resource_set_type.choice.periodic = 0;
// semi-persistent
pos_srs_resource_set = &pos_srs_resource_set_list->pos_srs_resource_set_item[1];
pos_srs_resource_set->pos_srs_resource_set_id = 1;
pos_srs_resource_id_list_length = 5;
pos_srs_resource_set->pos_srs_resource_id_list.pos_srs_resource_id_list_length = pos_srs_resource_id_list_length;
pos_srs_resource_set->pos_srs_resource_id_list.srs_pos_resource_id =
calloc_or_fail(pos_srs_resource_id_list_length,
sizeof(*pos_srs_resource_set->pos_srs_resource_id_list.srs_pos_resource_id));
for (int k = 0; k < pos_srs_resource_id_list_length; k++) {
pos_srs_resource_set->pos_srs_resource_id_list.srs_pos_resource_id[k] = k;
}
pos_srs_resource_set->pos_resource_set_type.present = NRPPA_POS_RESOURCE_SET_TYPE_PR_SEMI_PERSISTENT;
// set semi_persistent = 0 to enable
pos_srs_resource_set->pos_resource_set_type.choice.semi_persistent = 0;
// aperiodic
pos_srs_resource_set = &pos_srs_resource_set_list->pos_srs_resource_set_item[2];
pos_srs_resource_set->pos_srs_resource_set_id = 2;
pos_srs_resource_id_list_length = 5;
pos_srs_resource_set->pos_srs_resource_id_list.pos_srs_resource_id_list_length = pos_srs_resource_id_list_length;
pos_srs_resource_set->pos_srs_resource_id_list.srs_pos_resource_id =
calloc_or_fail(pos_srs_resource_id_list_length,
sizeof(*pos_srs_resource_set->pos_srs_resource_id_list.srs_pos_resource_id));
for (int k = 0; k < pos_srs_resource_id_list_length; k++) {
pos_srs_resource_set->pos_srs_resource_id_list.srs_pos_resource_id[k] = k;
}
pos_srs_resource_set->pos_resource_set_type.present = NRPPA_POS_RESOURCE_SET_TYPE_PR_APERIODIC;
pos_srs_resource_set->pos_resource_set_type.choice.srs_resource = 3;
}
return resp;
}
static nrppa_measurement_resp_t fill_measurement_response(uint16_t transaction_id, uint32_t lmf_measurement_id)
{
positioning_config_t positioning_config = RCconfig_nr_positioning();
nrppa_measurement_resp_t resp = {0};
resp.transaction_id = transaction_id;
resp.lmf_measurement_id = lmf_measurement_id;
resp.ran_measurement_id = 1;
resp.measurement_response_list = calloc_or_fail(1, sizeof(*resp.measurement_response_list));
uint32_t meas_response_list_len = positioning_config.num_trp;
resp.measurement_response_list->measurement_response_list_length = meas_response_list_len;
resp.measurement_response_list->measurement_response_item =
calloc_or_fail(meas_response_list_len, sizeof(*resp.measurement_response_list->measurement_response_item));
for (int i = 0; i < meas_response_list_len; i++) {
nrppa_measurement_response_item_t *meas_response_item = &resp.measurement_response_list->measurement_response_item[i];
meas_response_item->trp_id = positioning_config.trps[i].id;
nrppa_measurement_result_t *MeasurementResult = &meas_response_item->measurement_result;
uint32_t meas_result_length = 4;
MeasurementResult->measurement_result_item_length = meas_result_length;
MeasurementResult->measurement_result_item =
calloc_or_fail(meas_result_length, sizeof(*MeasurementResult->measurement_result_item));
// Angle of arrival
nrppa_measurement_result_item_t *measurement_result_item = &MeasurementResult->measurement_result_item[0];
nrppa_measured_results_value_t *measuredResultsValue = &measurement_result_item->measured_results_value;
measuredResultsValue->present = NRPPA_MEASURED_RESULTS_VALUE_PR_UL_ANGLEOFARRIVAL;
nrppa_ul_aoa_t *uL_AngleOfArrival = &measuredResultsValue->choice.ul_angle_of_arrival;
uL_AngleOfArrival->azimuth_aoa = 700 + i;
uL_AngleOfArrival->zenith_aoa = calloc_or_fail(1, sizeof(*uL_AngleOfArrival->zenith_aoa));
*uL_AngleOfArrival->zenith_aoa = 450 + i;
nrppa_time_stamp_t *timeStamp = &measurement_result_item->time_stamp;
timeStamp->system_frame_number = 100;
timeStamp->slot_index.present = NRPPA_TIME_STAMP_SLOT_INDEX_PR_SCS_30;
timeStamp->slot_index.choice.scs_30 = 15;
// UL SRS RSRP
measurement_result_item = &MeasurementResult->measurement_result_item[1];
measuredResultsValue = &measurement_result_item->measured_results_value;
measuredResultsValue->present = NRPPA_MEASURED_RESULTS_VALUE_PR_UL_SRS_RSRP;
measuredResultsValue->choice.ul_srs_rsrp = 100 + i;
timeStamp = &measurement_result_item->time_stamp;
timeStamp->system_frame_number = 101;
timeStamp->slot_index.present = NRPPA_TIME_STAMP_SLOT_INDEX_PR_SCS_15;
timeStamp->slot_index.choice.scs_15 = 8;
// UL RToA
measurement_result_item = &MeasurementResult->measurement_result_item[2];
measuredResultsValue = &measurement_result_item->measured_results_value;
measuredResultsValue->present = NRPPA_MEASURED_RESULTS_VALUE_PR_UL_RTOA;
nrppa_ul_rtoa_measurement_t *uL_RTOA = &measuredResultsValue->choice.ul_rtoa;
uL_RTOA->present = NRPPA_ULRTOAMEAS_PR_K1;
uL_RTOA->choice.k1 = 98500 + i;
timeStamp = &measurement_result_item->time_stamp;
timeStamp->system_frame_number = 102;
timeStamp->slot_index.present = NRPPA_TIME_STAMP_SLOT_INDEX_PR_SCS_60;
timeStamp->slot_index.choice.scs_60 = 31;
// gNB RX-TX Time Diff
measurement_result_item = &MeasurementResult->measurement_result_item[3];
measuredResultsValue = &measurement_result_item->measured_results_value;
measuredResultsValue->present = NRPPA_MEASURED_RESULTS_VALUE_PR_GNB_RXTXTIMEDIFF;
nrppa_gnb_rx_tx_time_diff_t *gNB_RxTxTimeDiff = &measuredResultsValue->choice.gnb_rx_tx_time_diff;
gNB_RxTxTimeDiff->present = NRPPA_GNBRXTXTIMEDIFFMEAS_PR_K3;
gNB_RxTxTimeDiff->choice.k3 = 98412 + i;
timeStamp = &measurement_result_item->time_stamp;
timeStamp->system_frame_number = 103;
timeStamp->slot_index.present = NRPPA_TIME_STAMP_SLOT_INDEX_PR_SCS_120;
timeStamp->slot_index.choice.scs_120 = 70;
}
return resp;
}
// Initializing UE NAS Context with simulated SIM data
nr_ue_nas_t *simulated_ue_nas = NULL;
void init_ue_nas_context(void)
{
simulated_ue_nas = calloc_or_fail(1, sizeof(nr_ue_nas_t));
simulated_ue_nas->UE_id = 1;
simulated_ue_nas->security_container = calloc_or_fail(1, sizeof(stream_security_container_t));
// Allocation and simulation of UICC data
simulated_ue_nas->uicc = calloc_or_fail(1, sizeof(uicc_t));
// IMSI : 001010000000001
simulated_ue_nas->uicc->imsiStr = calloc_or_fail(1, 16 * sizeof(char));
strcpy(simulated_ue_nas->uicc->imsiStr, "001010000000001");
simulated_ue_nas->uicc->nmc_size = 2;
// DNN : oai
simulated_ue_nas->uicc->dnnStr = calloc_or_fail(1, 32 * sizeof(char));
strcpy(simulated_ue_nas->uicc->dnnStr, "oai");
// IMEISV : 6754567890123413
simulated_ue_nas->uicc->imeisvStr = calloc_or_fail(1, 17 * sizeof(char));
strcpy(simulated_ue_nas->uicc->imeisvStr, "6754567890123413");
// NSSAI: sst = 1, sd = 0xffffff
simulated_ue_nas->uicc->nssai_sst = 1;
simulated_ue_nas->uicc->nssai_sd = 0xffffff;
// Ki: fec86ba6eb707ed08905757b1bb44b8f
static const uint8_t TEST_K[16] =
{0xfe, 0xc8, 0x6b, 0xa6, 0xeb, 0x70, 0x7e, 0xd0, 0x89, 0x05, 0x75, 0x7b, 0x1b, 0xb4, 0x4b, 0x8f};
memcpy(simulated_ue_nas->uicc->key, TEST_K, 16);
// OPc: c42449363bbad02b66d16bc975d77cc1
static const uint8_t TEST_OPC[16] =
{0xc4, 0x24, 0x49, 0x36, 0x3b, 0xba, 0xd0, 0x2b, 0x66, 0xd1, 0x6b, 0xc9, 0x75, 0xd7, 0x7c, 0xc1};
memcpy(simulated_ue_nas->uicc->opc, TEST_OPC, 16);
simulated_ue_nas->security.nas_count_ul = 0;
simulated_ue_nas->security.nas_count_dl = 0;
simulated_ue_nas->fiveGMM_state = FGS_DEREGISTERED;
}
// Emulate registration request to register UE in the AMF (required for positioning)
void send_initial_ue_message(instance_t instance)
{
MessageDef *msg_p = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_NAS_FIRST_REQ);
NGAP_NAS_FIRST_REQ(msg_p).gNB_ue_ngap_id = 1; // Simulated UE ID
NGAP_NAS_FIRST_REQ(msg_p).plmn.mcc = 1;
NGAP_NAS_FIRST_REQ(msg_p).plmn.mnc = 1;
NGAP_NAS_FIRST_REQ(msg_p).plmn.mnc_digit_length = 2;
NGAP_NAS_FIRST_REQ(msg_p).nr_cell_id = gnb_id;
NGAP_NAS_FIRST_REQ(msg_p).establishment_cause = NGAP_RRC_CAUSE_MO_SIGNALLING;
as_nas_info_t initialNasMsg = {0};
generateRegistrationRequest(&initialNasMsg, simulated_ue_nas, false);
NGAP_NAS_FIRST_REQ(msg_p).nas_pdu.buf = initialNasMsg.nas_data;
NGAP_NAS_FIRST_REQ(msg_p).nas_pdu.len = initialNasMsg.length;
NGAP_NAS_FIRST_REQ(msg_p).ue_identity.presenceMask = 0;
itti_send_msg_to_task(TASK_NGAP, instance, msg_p);
}
void *gNB_app_task(void *args_p)
{
MessageDef *msg_p = NULL;
const char *msg_name = NULL;
instance_t instance;
int result;
/* for no gcc warnings */
(void)instance;
itti_mark_task_ready(TASK_GNB_APP);
do {
// Wait for a message
itti_receive_msg(TASK_GNB_APP, &msg_p);
msg_name = ITTI_MSG_NAME(msg_p);
instance = ITTI_MSG_DESTINATION_INSTANCE(msg_p);
switch (ITTI_MSG_ID(msg_p)) {
case TERMINATE_MESSAGE:
LOG_W(GNB_APP, " *** Exiting GNB_APP thread\n");
itti_exit_task();
break;
case NGAP_REGISTER_GNB_CNF:
LOG_I(GNB_APP, "[gNB %ld] Received %s: associated AMF %d\n", instance, msg_name, NGAP_REGISTER_GNB_CNF(msg_p).nb_amf);
send_initial_ue_message(instance);
break;
default:
LOG_E(GNB_APP, "Received unexpected message %s\n", msg_name);
break;
}
result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
AssertFatal(result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} while (1);
return NULL;
}
void *rrc_gnb_task(void *args_p)
{
MessageDef *msg_p;
MessageDef *msg_p_resp;
instance_t instance;
int result;
itti_mark_task_ready(TASK_RRC_GNB);
LOG_I(NR_RRC, "Entering main loop of NR_RRC message task\n");
while (1) {
// Wait for a message
itti_receive_msg(TASK_RRC_GNB, &msg_p);
const char *msg_name_p = ITTI_MSG_NAME(msg_p);
instance = ITTI_MSG_DESTINATION_INSTANCE(msg_p);
LOG_D(NR_RRC,
"RRC GNB Task Received %s for instance %ld from task %s\n",
ITTI_MSG_NAME(msg_p),
ITTI_MSG_DESTINATION_INSTANCE(msg_p),
ITTI_MSG_ORIGIN_NAME(msg_p));
switch (ITTI_MSG_ID(msg_p)) {
case TERMINATE_MESSAGE:
LOG_W(NR_RRC, " *** Exiting NR_RRC thread\n");
itti_exit_task();
break;
case NGAP_DOWNLINK_NAS:
LOG_I(NR_RRC, "Ignore NGAP_DOWNLINK_NAS: dont have to handle");
ngap_downlink_nas_t *nas = &NGAP_DOWNLINK_NAS(msg_p);
if (nas->nas_pdu.buf) {
free(nas->nas_pdu.buf);
}
break;
case NRPPA_TRP_INFORMATION_REQ:
nrppa_trp_information_req_t *trp_req = &NRPPA_TRP_INFORMATION_REQ(msg_p);
LOG_I(NR_RRC, "Received NRPPA_TRP_INFORMATION_REQ transaction_id %d\n", trp_req->transaction_id);
msg_p_resp = itti_alloc_new_message(TASK_RRC_GNB, 0, NRPPA_TRP_INFORMATION_RESP);
NRPPA_TRP_INFORMATION_RESP(msg_p_resp) = fill_trp_resp(trp_req->transaction_id);
LOG_I(NR_RRC, "Sending NRPPA_TRP_INFORMATION_RESP to TASK_NRPPA\n");
itti_send_msg_to_task(TASK_NRPPA, 0, msg_p_resp);
break;
case NRPPA_POSITIONING_INFORMATION_REQ:
nrppa_positioning_information_req_t *pos_req = &NRPPA_POSITIONING_INFORMATION_REQ(msg_p);
LOG_I(NR_RRC, "Received NRPPA_POSITIONING_INFORMATION_REQ transaction_id %d\n", pos_req->transaction_id);
msg_p_resp = itti_alloc_new_message(TASK_RRC_GNB, 0, NRPPA_POSITIONING_INFORMATION_RESP);
NRPPA_POSITIONING_INFORMATION_RESP(msg_p_resp) = fill_position_information_resp(pos_req->transaction_id);
LOG_I(NR_RRC, "Sending NRPPA_POSITIONING_INFORMATION_RESP to TASK_NRPPA\n");
itti_send_msg_to_task(TASK_NRPPA, 0, msg_p_resp);
break;
case NRPPA_POSITIONING_ACTIVATION_REQ:
nrppa_positioning_activation_req_t *req = &NRPPA_POSITIONING_ACTIVATION_REQ(msg_p);
LOG_I(NR_RRC, "Received NRPPA_POSITIONING_ACTIVATION_REQ transaction_id %d\n", req->transaction_id);
msg_p_resp = itti_alloc_new_message(TASK_RRC_GNB, 0, NRPPA_POSITIONING_ACTIVATION_RESP);
NRPPA_POSITIONING_ACTIVATION_RESP(msg_p_resp).transaction_id = req->transaction_id;
LOG_I(NR_RRC, "Sending NRPPA_POSITIONING_ACTIVATION_RESP to TASK_NRPPA\n");
itti_send_msg_to_task(TASK_NRPPA, 0, msg_p_resp);
free_positioning_activation_request(req);
break;
case NRPPA_MEASUREMENT_REQ:
nrppa_measurement_req_t *m_req = &NRPPA_MEASUREMENT_REQ(msg_p);
LOG_I(NR_RRC, "Received NRPPA_MEASUREMENT_REQ transaction_id %d\n", m_req->transaction_id);
msg_p_resp = itti_alloc_new_message(TASK_RRC_GNB, 0, NRPPA_MEASUREMENT_RESP);
NRPPA_MEASUREMENT_RESP(msg_p_resp) = fill_measurement_response(m_req->transaction_id, m_req->lmf_measurement_id);
LOG_I(NR_RRC, "Sending NRPPA_MEASUREMENT_RESP to TASK_NRPPA\n");
itti_send_msg_to_task(TASK_NRPPA, 0, msg_p_resp);
free_measurement_request(m_req);
break;
default:
LOG_E(NR_RRC, "[gNB %ld] Received unexpected message %s\n", instance, msg_name_p);
break;
}
result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
AssertFatal(result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
msg_p = NULL;
}
}
int main(int argc, char **argv)
{
// load the config file
if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == NULL) {
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
}
logInit();
init_ue_nas_context();
set_softmodem_sighandler();
// Initialize ITTI tasks
itti_init(TASK_MAX, tasks_info);
int rc;
rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for SCTP failed\n");
rc = itti_create_task(TASK_NGAP, ngap_gNB_task, NULL);
AssertFatal(rc >= 0, "Create task for NGAP failed\n");
rc = itti_create_task(TASK_NRPPA, nrppa_gNB_task, NULL);
AssertFatal(rc >= 0, "Create task for NRPPA failed\n");
rc = itti_create_task(TASK_RRC_GNB, rrc_gnb_task, NULL);
AssertFatal(rc >= 0, "Create task for RRC failed\n");
rc = itti_create_task(TASK_GNB_APP, gNB_app_task, NULL);
AssertFatal(rc >= 0, "Create task for RRC failed\n");
MessageDef *msg_p;
msg_p = itti_alloc_new_message(TASK_GNB_APP, 0, NGAP_REGISTER_GNB_REQ);
RCconfig_NR_NG(msg_p, 0);
gnb_id = NGAP_REGISTER_GNB_REQ(msg_p).gNB_id;
LOG_I(GNB_APP, "Sending NGAP_REGISTER_GNB_REQ to TASK_NGAP\n");
itti_send_msg_to_task(TASK_NGAP, 0, msg_p);
printf("TYPE <CTRL-C> TO TERMINATE\n");
itti_wait_tasks_end(NULL);
logClean();
printf("Bye.\n");
return 0;
}
+73
View File
@@ -0,0 +1,73 @@
Active_gNBs = ( "gNB-OAI");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
gNBs =
(
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_name = "gNB-OAI";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
plmn_list = ({ mcc = 001; mnc = 01; mnc_length = 2; snssaiList = ({ sst = 1; }) });
nr_cellid = 12345678L;
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// AMF parameters:
amf_ip_address = ({ ipv4 = "192.168.70.132"; });
NETWORK_INTERFACES :
{
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
}
);
positioning_config = (
{
NumTRPs = 4; # number of TRPs
TRPIDs = [1,2,3,4]; # userdefined distinct IDs
TRPxAxis = [71,21,10,45]; # X-axis value of each TRP
TRPyAxis = [11,22,62,14]; # Y-axis value of each TRP
TRPzAxis = [41,22,33,42]; # Z-axis value of each TRP
Units = [0, 0, 0, 0]; # 0 = mm, 1 = cm, 2 = dm
}
);
L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
prach_dtx_threshold = 120;
pucch0_dtx_threshold = 150;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
);
log_config :
{
global_log_level ="info";
hw_log_level ="info";
phy_log_level ="info";
mac_log_level ="info";
rlc_log_level ="info";
pdcp_log_level ="info";
rrc_log_level ="info";
ngap_log_level ="debug";
f1ap_log_level ="debug";
};