diff --git a/.gitignore b/.gitignore
index ff947966a2..b2913b82ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,8 @@ GPATH
GRTAGS
GTAGS
tags
+
+# others
+nfapi_nr_interface_scf
+*.log
+*.out
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 243518f81e..250adbbb54 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -9,14 +9,17 @@
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
- "program": "enter program name, for example ${workspaceFolder}/a.exe",
- "args": [],
+ "program": "${workspaceFolder}/cmake_targets/ran_build/build/lte-softmodem",
+ "args": [
+ "-O", "../ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf",
+ "--noS1"
+ ],
"stopAtEntry": false,
- "cwd": "${workspaceFolder}",
+ "cwd": "${workspaceFolder}/cmake_targets",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
- "miDebuggerPath": "/path/to/gdb",
+ "miDebuggerPath": "${workspaceFolder}/cmake_targets/sudo-gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
diff --git a/README.md b/README.md
index 62f8576e81..4f38f77e4e 100644
--- a/README.md
+++ b/README.md
@@ -21,16 +21,28 @@
# OpenAirInterface License #
-OpenAirInterface is under OpenAirInterface Software Alliance license.
+### Included Fixes: ###
+- Ease of use of gprof and address sanitizer for debugging purposes
+- Updated json files to allow for GDB, real-time debugging capabilities
+- Updated logging features to minimally log only key connection milestones. This imroves scalability of multiple UEs.
+- Updated logging to include time stamp for timing analysis
+- Updated memory allocation procedures to correct size requirements
+- Added debugging features to handle signal terminations
+- nfapi.c pullarray8 fix invalid pointer math
+- Overlapping destination and source memory in memcpy, so updated to memmove to check for this bug
+- Advanced error checking mechanisms in critical pack and unpack functions
+- Created option for CPU assignment to UE to improve scalability
+- Added EPC integration to allow multiple individual UE entities to each have their USIM information parced by the executables
+- Updated random value seeds to minimize probability of error in generation of random values
+- Enables capability round robin scheduler if desired
+- Enables capability real time scheduler if desired
+- Added new standalone functions to the UE phy-layer (phy_stub_ue.c) to incorporate individual UE entities
+- Updated sending and packing functions in UE (lte_ue.c) to incorporate new standalone changes
+- Incorporated semaphores to control timing of incoming downlink packets
+- Implemented new queuing system to handle message exchange from UE to eNB and vice versa
+- Updated global value in nFAPI for size of subframe
+- Updated global value to increase scalability in system
- * [OAI License Model](http://www.openairinterface.org/?page_id=101)
- * [OAI License v1.1 on our website](http://www.openairinterface.org/?page_id=698)
-
-It is distributed under **OAI Public License V1.1**.
-
-The license information is distributed under [LICENSE](LICENSE) file in the same directory.
-
-Please see [NOTICE](NOTICE.md) file for third party software that is included in the sources.
# Where to Start #
diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container
index 654ad23230..9ff0371ae5 100644
--- a/ci-scripts/Jenkinsfile-GitLab-Container
+++ b/ci-scripts/Jenkinsfile-GitLab-Container
@@ -238,6 +238,26 @@ pipeline {
}
}
}
+ stage ("Test OAI NR UE - OAI gNB - TDD - Band 78 - N300") {
+ when { expression {doMandatoryTests} }
+ steps {
+ script {
+ triggerSlaveJob ('RAN-gNB-nrUE-MONO-TDD-Band78-N300', 'Test-TDD-Band78-gNB-NR-UE')
+ }
+ }
+ post {
+ always {
+ script {
+ finalizeSlaveJob('RAN-gNB-nrUE-MONO-TDD-Band78-N300')
+ }
+ }
+ failure {
+ script {
+ currentBuild.result = 'FAILURE'
+ }
+ }
+ }
+ }
}
}
stage ("Images Push to Registries") {
diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab
index a0284edb71..df816c12a7 100644
--- a/ci-scripts/Jenkinsfile-gitlab
+++ b/ci-scripts/Jenkinsfile-gitlab
@@ -404,26 +404,6 @@ pipeline {
}
}
}
- stage ("Test L2 simulator") {
- when {
- expression {doFullTestsuite}
- }
- steps {
- lock (vmResource) {
- script {
- timeout (time: 30, unit: 'MINUTES') {
- try {
- gitlabCommitStatus(name: "Test L2-sim") {
- sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant l2-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
- }
- } catch (Exception e) {
- currentBuild.result = 'FAILURE'
- }
- }
- }
- }
- }
- }
stage ("Destroy all Virtual Machines") {
when {
expression {doMandatoryTests}
@@ -663,28 +643,6 @@ pipeline {
}
}
}
- stage ("Test OAI NR UE - OAI gNB - TDD - Band 78 - N300") {
- when {
- expression {doMandatoryTests}
- }
- steps {
- script {
- triggerSlaveJob ('gNB-nrUE-MONO-TDD-Band78-N300', 'Test-TDD-Band78-gNB-NR-UE')
- }
- }
- post {
- always {
- script {
- finalizeSlaveJob('gNB-nrUE-MONO-TDD-Band78-N300')
- }
- }
- failure {
- script {
- currentBuild.result = 'FAILURE'
- }
- }
- }
- }
stage ("Test OAI OCP-eNB - FDD - Band 7 - B210") {
when {
expression {doFullTestsuite}
diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py
index 41747f1bc2..ffd93d79cf 100644
--- a/ci-scripts/cls_containerize.py
+++ b/ci-scripts/cls_containerize.py
@@ -93,6 +93,7 @@ class Containerize():
self.allImagesSize = {}
self.collectInfo = {}
+ self.tsharkStarted = False
self.pingContName = ''
self.pingOptions = ''
self.pingLossThreshold = ''
@@ -670,6 +671,10 @@ class Containerize():
time.sleep(10)
if count == 100 and healthy == self.nb_healthy[0]:
+ if self.tsharkStarted == False:
+ logging.debug('Starting tshark on public network')
+ self.CaptureOnDockerNetworks()
+ self.tsharkStarted = True
HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK)
logging.info('\u001B[1m Deploying OAI Object(s) PASS\u001B[0m')
else:
@@ -677,8 +682,24 @@ class Containerize():
HTML.CreateHtmlTestRow('Could not deploy in time', 'KO', CONST.ALL_PROCESSES_OK)
logging.error('\u001B[1m Deploying OAI Object(s) FAILED\u001B[0m')
+ def CaptureOnDockerNetworks(self):
+ cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"'
+ networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
+ cmd = 'sudo nohup tshark -f "not tcp and not arp and not port 53 and not host archive.ubuntu.com and not host security.ubuntu.com"'
+ for name in networkNames.split('\n'):
+ res = re.search('rfsim', name)
+ if res is not None:
+ cmd += ' -i ' + name
+ cmd += ' -w /tmp/capture_'
+ ymlPath = self.yamlPath[0].split('/')
+ cmd += ymlPath[1] + '.pcap > /tmp/tshark.log 2>&1 &'
+ logging.debug(cmd)
+ networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
+
def UndeployGenObject(self, HTML):
self.exitStatus = 0
+ ymlPath = self.yamlPath[0].split('/')
+ logPath = '../cmake_targets/log/' + ymlPath[1]
if (self.ranAllowMerge):
cmd = 'cd ' + self.yamlPath[0] + ' && sed -e "s@develop@ci-temp@" docker-compose.y*ml > docker-compose-ci.yml'
@@ -706,9 +727,21 @@ class Containerize():
logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
if anyLogs:
- cmd = 'mkdir -p ../cmake_targets/log && mv ' + self.yamlPath[0] + '/*.log ../cmake_targets/log'
+ cmd = 'mkdir -p '+ logPath + ' && mv ' + self.yamlPath[0] + '/*.log ' + logPath
logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
+ if self.tsharkStarted:
+ self.tsharkStarted = True
+ ymlPath = self.yamlPath[0].split('/')
+ cmd = 'sudo chmod 666 /tmp/capture_' + ymlPath[1] + '.pcap'
+ logging.debug(cmd)
+ copyStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
+ cmd = 'cp /tmp/capture_' + ymlPath[1] + '.pcap ' + logPath
+ logging.debug(cmd)
+ copyStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
+ cmd = 'sudo rm /tmp/capture_' + ymlPath[1] + '.pcap'
+ logging.debug(cmd)
+ copyStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml down'
logging.debug(cmd)
@@ -726,10 +759,13 @@ class Containerize():
def PingFromContainer(self, HTML):
self.exitStatus = 0
- cmd = 'mkdir -p ../cmake_targets/log'
+ ymlPath = self.yamlPath[0].split('/')
+ logPath = '../cmake_targets/log/' + ymlPath[1]
+ cmd = 'mkdir -p ' + logPath
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
- cmd = 'docker exec ' + self.pingContName + ' /bin/bash -c "ping ' + self.pingOptions + '" 2>&1 | tee ../cmake_targets/log/ping_' + HTML.testCase_id + '.log || true'
+ cmd = 'docker exec ' + self.pingContName + ' /bin/bash -c "ping ' + self.pingOptions + '" 2>&1 | tee ' + logPath + '/ping_' + HTML.testCase_id + '.log || true'
+
logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=100)
@@ -784,14 +820,23 @@ class Containerize():
if status:
HTML.CreateHtmlTestRowQueue(self.pingOptions, 'OK', 1, html_queue)
else:
- self.exitStatus = 1
- logging.error('\u001B[1;37;41m ' + message + ' \u001B[0m')
+ logging.error('\u001B[1;37;41m ping test FAIL -- ' + message + ' \u001B[0m')
HTML.CreateHtmlTestRowQueue(self.pingOptions, 'KO', 1, html_queue)
+ # Automatic undeployment
+ logging.debug('----------------------------------------')
+ logging.debug('\u001B[1m Starting Automatic undeployment \u001B[0m')
+ logging.debug('----------------------------------------')
+ HTML.testCase_id = 'AUTO-UNDEPLOY'
+ HTML.desc = 'Automatic Un-Deployment'
+ self.UndeployGenObject(HTML)
+ self.exitStatus = 1
def IperfFromContainer(self, HTML):
self.exitStatus = 0
- cmd = 'mkdir -p ../cmake_targets/log'
+ ymlPath = self.yamlPath[0].split('/')
+ logPath = '../cmake_targets/log/' + ymlPath[1]
+ cmd = 'mkdir -p ' + logPath
logStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
# Start the server process
@@ -801,7 +846,8 @@ class Containerize():
time.sleep(5)
# Start the client process
- cmd = 'docker exec ' + self.cliContName + ' /bin/bash -c "iperf ' + self.cliOptions + '" 2>&1 | tee ../cmake_targets/log/iperf_client_' + HTML.testCase_id + '.log || true'
+
+ cmd = 'docker exec ' + self.cliContName + ' /bin/bash -c "iperf ' + self.cliOptions + '" 2>&1 | tee '+ logPath + '/iperf_client_' + HTML.testCase_id + '.log || true'
logging.debug(cmd)
clientStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=100)
@@ -810,7 +856,7 @@ class Containerize():
logging.debug(cmd)
serverStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
time.sleep(5)
- cmd = 'docker cp ' + self.svrContName + ':/tmp/iperf_server.log ../cmake_targets/log/iperf_server_' + HTML.testCase_id + '.log'
+ cmd = 'docker cp ' + self.svrContName + ':/tmp/iperf_server.log '+ logPath + '/iperf_server_' + HTML.testCase_id + '.log'
logging.debug(cmd)
serverStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
@@ -906,9 +952,10 @@ class Containerize():
if status:
HTML.CreateHtmlTestRowQueue(self.cliOptions, 'OK', 1, html_queue)
else:
- self.exitStatus = 1
+ logging.error('\u001B[1m Iperf Test FAIL -- ' + message + ' \u001B[0m')
HTML.CreateHtmlTestRowQueue(self.cliOptions, 'KO', 1, html_queue)
+
def CheckAndAddRoute(self, svrName, ipAddr, userName, password):
logging.debug('Checking IP routing on ' + svrName)
mySSH = SSH.SSHConnection()
@@ -1019,3 +1066,4 @@ class Containerize():
if result is None:
mySSH.command('echo ' + password + ' | sudo -S iptables -P FORWARD ACCEPT', '\$', 10)
mySSH.close()
+
diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py
index b8b99a053b..9d2c75363d 100644
--- a/ci-scripts/cls_oaicitest.py
+++ b/ci-scripts/cls_oaicitest.py
@@ -57,12 +57,15 @@ import sshconnection
import cls_module_ue
import cls_ci_ueinfra #class defining the multi Ue infrastrucure
+logging.getLogger("matplotlib").setLevel(logging.WARNING)
+import matplotlib.pyplot as plt
+import numpy as np
#-----------------------------------------------------------
# Utility functions
#-----------------------------------------------------------
-def GetPingTimeAnalysis(ping_log_file):
+def GetPingTimeAnalysis(RAN,ping_log_file,ping_rttavg_threshold):
#ping time values read from file
t_ping=[]
#ping stats (dictionary) to be returned by the function
@@ -86,17 +89,46 @@ def GetPingTimeAnalysis(ping_log_file):
max_loc=t_ping.index(max(t_ping))
ping_stat['max_loc']=max_loc
#remove it
- t_ping.pop(max_loc)
+ t_ping_post=t_ping.copy()
+ t_ping_post.pop(max_loc)
#new stats after removing max value
- ping_stat['min_1']=min(t_ping)
- ping_stat['mean_1']=stat.mean(t_ping)
- ping_stat['median_1']=stat.median(t_ping)
- ping_stat['max_1']=max(t_ping)
+ ping_stat['min_1']=min(t_ping_post)
+ ping_stat['mean_1']=stat.mean(t_ping_post)
+ ping_stat['median_1']=stat.median(t_ping_post)
+ ping_stat['max_1']=max(t_ping_post)
+
+ #plot ping over time and save png for artifacts
+ ticks = np.arange(0, len(t_ping), 1)
+ figure, axis = plt.subplots(figsize=(10, 10))
+ axis.plot(ticks,t_ping,marker='o')
+ axis.set_xlabel('Ping Events')
+ axis.set_ylabel("Ping RTT (in ms)")
+ axis.set_title(ping_log_file)
+ axis.set_xticks(ticks)
+ axis.set_xticklabels([])
+ YMAX=20 #base scale
+ if max(t_ping) > YMAX:
+ y_max=max(t_ping)+1
+ else:
+ y_max=YMAX+1
+ plt.ylim(0,y_max)
+ if ping_rttavg_threshold != '':
+ th_label="AVG Ping Fail Threshold="+ping_rttavg_threshold
+ plt.axhline(y=float(ping_rttavg_threshold), color='r', linestyle='-',label=th_label)
+ axis.legend()
+ plt.savefig(ping_log_file+'.png')
+
+ #copy the png file already to enb to move it move it later into the artifacts
+ try:
+ mySSH = sshconnection.SSHConnection()
+ mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file+'.png', RAN.eNBSourceCodePath + '/cmake_targets/')
+ except:
+ logging.debug('\u001B[1;37;41m Ping PNG SCP to eNB FAILED\u001B[0m')
return ping_stat
else:
- logging.error("Ping log file does not exist")
+ logging.error("GetPingTimeAnalysis : Ping log file does not exist")
return -1
@@ -129,6 +161,7 @@ class OaiCiTest():
self.ping_rttavg_threshold =''
self.iperf_args = ''
self.iperf_packetloss_threshold = ''
+ self.iperf_bitrate_threshold = ''
self.iperf_profile = ''
self.iperf_options = ''
self.iperf_direction = ''
@@ -1531,7 +1564,7 @@ class OaiCiTest():
statusQueue.put(message)
lock.release()
- def Ping_common(self, lock, UE_IPAddress, device_id, statusQueue,EPC, Module_UE):
+ def Ping_common(self, lock, UE_IPAddress, device_id, statusQueue,EPC, Module_UE,RAN):
try:
SSH = sshconnection.SSHConnection()
# Launch ping on the EPC side (true for ltebox and old open-air-cn)
@@ -1559,6 +1592,7 @@ class OaiCiTest():
ping_status = SSH.command('docker exec -it prod-trf-gen /bin/bash -c "ping ' + self.ping_args + ' ' + UE_IPAddress + '" 2>&1 | tee ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5)
else:
ping_status = SSH.command('stdbuf -o0 ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 | stdbuf -o0 tee ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5)
+ ping_log_file='ping_' + self.testCase_id + '_' + device_id + '.log'
#copy the ping log file to have it locally for analysis (ping stats)
SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/scripts/ping_' + self.testCase_id + '_' + device_id + '.log', '.')
else:
@@ -1578,6 +1612,7 @@ class OaiCiTest():
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
#cat is executed on EPC
SSH.command('cat ' + EPC.SourceCodePath + '/scripts/ping_' + self.testCase_id + '_' + device_id + '.log', '\$', 5)
+ ping_log_file='/scripts/ping_' + self.testCase_id + '_' + device_id + '.log'
else: #launch from Module
SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
#target address is different depending on EPC type
@@ -1595,6 +1630,7 @@ class OaiCiTest():
#cat is executed locally
SSH.command('cat ping_' + self.testCase_id + '_' + self.ue_id + '.log', '\$', 5)
+ ping_log_file='ping_' + self.testCase_id + '_' + self.ue_id + '.log'
ping_status=0
# TIMEOUT CASE
@@ -1642,9 +1678,9 @@ class OaiCiTest():
logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m')
#adding extra ping stats from local file
- ping_log_file='ping_' + self.testCase_id + '_' + device_id + '.log'
+ #ping_log_file variable is defined above in this function, depending on device/ue
logging.debug('Analyzing Ping log file : ' + os.getcwd() + '/' + ping_log_file)
- ping_stat=GetPingTimeAnalysis(ping_log_file)
+ ping_stat=GetPingTimeAnalysis(RAN,ping_log_file,self.ping_rttavg_threshold)
ping_stat_msg=''
if (ping_stat!=-1) and (len(ping_stat)!=0):
ping_stat_msg+='Ping stats before removing largest value : \n'
@@ -1834,7 +1870,7 @@ class OaiCiTest():
device_id = self.UEDevices[i]
else:
device_id = Module_UE.ID + "-" + Module_UE.Kind
- p = Process(target = self.Ping_common, args = (lock,UE_IPAddress,device_id,status_queue,EPC,Module_UE,))
+ p = Process(target = self.Ping_common, args = (lock,UE_IPAddress,device_id,status_queue,EPC,Module_UE,RAN,))
p.daemon = True
p.start()
multi_jobs.append(p)
@@ -2085,12 +2121,20 @@ class OaiCiTest():
pl = float(100 * pl_sum / ps_sum)
packetloss = '%2.1f ' % (pl)
packetloss += '%'
+ #checking packet loss compliance
if float(pl) > float(self.iperf_packetloss_threshold):
- pal_too_high_msg = 'Packet Loss too high : actual = '+packetloss+', target = '+self.iperf_packetloss_threshold+'%\n'
+ pal_too_high_msg = 'Packet Loss too high : tested = '+packetloss+', target = '+self.iperf_packetloss_threshold+'%'
else:
- pal_too_high_msg=''
+ pal_too_high_msg='Packet Loss value is within acceptance range'
+ #checking bitrate perf compliance
+ if float(br_loss) < float(self.iperf_bitrate_threshold):
+ bit_too_low_msg = 'Bitrate too low : tested = '+bitperf+', target = '+self.iperf_bitrate_threshold+'%'
+ else:
+ bit_too_low_msg='Bitrate perf value is within acceptance range'
lock.acquire()
- if (br_loss < 90) or (float(pl) > float(self.iperf_packetloss_threshold)):
+ if (float(br_loss) < float(self.iperf_bitrate_threshold)) and (float(pl) > float(self.iperf_packetloss_threshold)):
+ statusQueue.put(-1)
+ elif (float(br_loss) < float(self.iperf_bitrate_threshold)) or (float(pl) > float(self.iperf_packetloss_threshold)):
statusQueue.put(1)
else:
statusQueue.put(0)
@@ -2101,7 +2145,7 @@ class OaiCiTest():
brl_msg = 'Bitrate Perf: ' + bitperf
jit_msg = 'Jitter : ' + jitter
pal_msg = 'Packet Loss : ' + packetloss
- statusQueue.put(req_msg + '\n' + bir_msg + '\n' + brl_msg + '\n' + jit_msg + '\n' + pal_msg + '\n' + pal_too_high_msg + '\n')
+ statusQueue.put(req_msg + '\n' + bir_msg + '\n' + brl_msg + '\n' + jit_msg + '\n' + pal_msg + '\n' + pal_too_high_msg + '\n' + bit_too_low_msg + '\n')
logging.debug('\u001B[1;37;45m iperf result (' + UE_IPAddress + ') \u001B[0m')
logging.debug('\u001B[1;35m ' + req_msg + '\u001B[0m')
logging.debug('\u001B[1;35m ' + bir_msg + '\u001B[0m')
@@ -2109,6 +2153,7 @@ class OaiCiTest():
logging.debug('\u001B[1;35m ' + jit_msg + '\u001B[0m')
logging.debug('\u001B[1;35m ' + pal_msg + '\u001B[0m')
logging.debug('\u001B[1;35m ' + pal_too_high_msg + '\u001B[0m')
+ logging.debug('\u001B[1;35m ' + bit_too_low_msg + '\u001B[0m')
lock.release()
else:
self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Could not analyze from server log')
@@ -3012,9 +3057,6 @@ class OaiCiTest():
if result is not None and not exitSignalReceived:
foundSegFault = True
result = re.search('[Cc]ore [dD]ump', str(line))
- if result is not None and not exitSignalReceived:
- foundSegFault = True
- result = re.search('./lte-uesoftmodem', str(line))
if result is not None and not exitSignalReceived:
foundSegFault = True
result = re.search('[Aa]ssertion', str(line))
@@ -3394,6 +3436,41 @@ class OaiCiTest():
CONTAINERS.UndeployObject(HTML,RAN)
RAN.prematureExit=True
+ #this function is called only if eNB/gNB fails to start
+ #RH to be re-factored
+ def AutoTerminateeNB(self,HTML,RAN,EPC,CONTAINERS):
+ if (RAN.Initialize_eNB_args != ''):
+ self.testCase_id = 'AUTO-KILL-RAN'
+ HTML.testCase_id = self.testCase_id
+ self.desc = 'Automatic Termination of all RAN nodes'
+ HTML.desc = self.desc
+ self.ShowTestID()
+ #terminate all RAN nodes eNB/gNB/OCP
+ for instance in range(0, len(RAN.air_interface)):
+ if RAN.air_interface[instance]!='':
+ logging.debug('Auto Termination of Instance ' + str(instance) + ' : ' + RAN.air_interface[instance])
+ RAN.eNB_instance=instance
+ RAN.TerminateeNB(HTML,EPC)
+ if RAN.flexranCtrlInstalled and RAN.flexranCtrlStarted:
+ self.testCase_id = 'AUTO-KILL-flexran-ctl'
+ HTML.testCase_id = self.testCase_id
+ self.desc = 'Automatic Termination of FlexRan CTL'
+ HTML.desc = self.desc
+ self.ShowTestID()
+ self.TerminateFlexranCtrl(HTML,RAN,EPC)
+ if CONTAINERS.yamlPath[0] != '':
+ self.testCase_id = 'AUTO-KILL-CONTAINERS'
+ HTML.testCase_id = self.testCase_id
+ self.desc = 'Automatic Termination of all RAN containers'
+ HTML.desc = self.desc
+ self.ShowTestID()
+ for instance in range(0, len(CONTAINERS.yamlPath)):
+ if CONTAINERS.yamlPath[instance]!='':
+ CONTAINERS.eNB_instance=instance
+ CONTAINERS.UndeployObject(HTML,RAN)
+ RAN.prematureExit=True
+
+
def IdleSleep(self,HTML):
time.sleep(self.idle_sleep_time)
HTML.CreateHtmlTestRow(str(self.idle_sleep_time) + ' sec', 'OK', CONST.ALL_PROCESSES_OK)
diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf
index 758bb44879..d2e91fb872 100644
--- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf
@@ -237,7 +237,7 @@ RUs = (
max_pdschReferenceSignalPower = -27;
max_rxgain = 75;
eNB_instances = [0];
- sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.10.2";
+ sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2";
}
);
diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf
index d1d32e2b58..6c8d5ba6f0 100644
--- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf
@@ -237,7 +237,7 @@ RUs = (
max_pdschReferenceSignalPower = -27;
max_rxgain = 75;
eNB_instances = [0];
- sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.10.2";
+ sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2";
}
);
diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf
new file mode 100644
index 0000000000..01add06e3a
--- /dev/null
+++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf
@@ -0,0 +1,325 @@
+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 = 40960;
+ plmn_list = ({
+ mcc = 208;
+ mnc = 95;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x1; // 0 false, else true
+ },
+ {
+ sst = 1;
+ sd = 0x112233; // 0 false, else true
+ }
+ );
+
+ });
+
+ nr_cellid = 12345678L;
+
+ ////////// Physical parameters:
+
+ ssb_SubcarrierOffset = 0;
+ pdsch_AntennaPorts = 1;
+ pusch_AntennaPorts = 1;
+ ul_prbblacklist = "51,52,53,54"
+ min_rxtxtime_pdsch = 6;
+ pdcch_ConfigSIB1 = (
+ {
+ controlResourceSetZero = 12;
+ searchSpaceZero = 0;
+ }
+ );
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
+ absoluteFrequencySSB = 641280;
+ dl_frequencyBand = 78;
+ # this is 3600 MHz
+ dl_absoluteFrequencyPointA = 640008;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 106;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=27,L=48 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 12;
+ initialDLBWPsearchSpaceZero = 0;
+ #pdsch-ConfigCommon
+ #pdschTimeDomainAllocationList (up to 16 entries)
+ initialDLBWPk0_0 = 0; #for DL slot
+ initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
+ initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
+
+ initialDLBWPk0_1 = 0; #for mixed slot
+ initialDLBWPmappingType_1 = 0;
+ initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 106;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 12952;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 13;
+ preambleReceivedTargetPower = -96;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 4;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
+ #
+ msg1_SubcarrierSpacing = 1,
+# restrictedSetConfig
+# 0=unrestricted, 1=restricted type A, 2=restricted type B
+ restrictedSetConfig = 0,
+
+ # pusch-ConfigCommon (up to 16 elements)
+ initialULBWPk2_0 = 6; # used for UL slot
+ initialULBWPmappingType_0 = 1
+ initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
+
+ initialULBWPk2_1 = 6; # used for mixed slot
+ initialULBWPmappingType_1 = 1;
+ initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
+
+ initialULBWPk2_2 = 7; # used for Msg.3 during RA
+ initialULBWPmappingType_2 = 1;
+ initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
+
+ msg3_DeltaPreamble = 1;
+ p0_NominalWithGrant =-90;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -90;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = -25;
+ }
+
+ );
+
+
+ # ------- 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";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+
+ NETWORK_INTERFACES :
+ {
+ GNB_INTERFACE_NAME_FOR_NG_AMF = "ctrl0";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.16.0.1";
+ GNB_INTERFACE_NAME_FOR_NGU = "ctrl0";
+ GNB_IPV4_ADDRESS_FOR_NGU = "172.16.0.1";
+ GNB_PORT_FOR_NGU = 2152; # Spec 2152
+ };
+
+ }
+);
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ local_s_if_name = "lo:";
+ remote_s_address = "127.0.0.1"; // pnf addr [!]
+ local_s_address = "127.0.0.2"; // vnf addr
+ local_s_portc = 50601; // vnf p5 port
+ remote_s_portc = 50600; // pnf p5 port [!]
+ local_s_portd = 50611; // vnf p7 port [!]
+ remote_s_portd = 50610; // pnf p7 port [!]
+ tr_s_preference = "nfapi";
+ tr_n_preference = "local_RRC";
+ }
+);
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 8;
+ prach_dtx_threshold = 120;
+ pucch0_dtx_threshold = 150;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 0
+ att_rx = 0;
+ bands = [78];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 75;
+ eNB_instances = [0];
+ #beamforming 1x4 matrix:
+ bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
+ #clock_src = "external";
+ sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
+ }
+);
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_SINGLE_THREAD";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+rfsimulator :
+{
+ serveraddr = "server";
+ serverport = "4043";
+ options = (); #("saviq"); or/and "chanmod"
+ modelname = "AWGN";
+ IQfile = "/tmp/rfsimulator.iqs";
+};
+
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
+ log_config :
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ ngap_log_level ="debug";
+ ngap_log_verbosity ="medium";
+ };
+
diff --git a/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf
new file mode 100644
index 0000000000..f5563ecc02
--- /dev/null
+++ b/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf
@@ -0,0 +1,52 @@
+log_config = {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="medium";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="full";
+};
+
+uicc0 = {
+imsi = "208950000000031";
+key = "0c0a34601d4f07677303652c0462535b";
+opc= "63bfa50ee6523365ff14c1f45f88737d";
+dnn= "oai";
+nssai_sst=222;
+nssai_sd=123;
+}
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "nfapi";
+ local_n_if_name = "ens3";
+ remote_n_address = "127.0.0.1"; //Proxy IP
+ local_n_address = "127.0.0.1";
+ local_n_portc = 50600;
+ remote_n_portc = 50601;
+ local_n_portd = 50610;
+ remote_n_portd = 50611;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 90
+ att_rx = 0;
+ bands = [7,38,42,43];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 125;
+ }
+);
diff --git a/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf
new file mode 100644
index 0000000000..f5563ecc02
--- /dev/null
+++ b/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf
@@ -0,0 +1,52 @@
+log_config = {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="medium";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="full";
+};
+
+uicc0 = {
+imsi = "208950000000031";
+key = "0c0a34601d4f07677303652c0462535b";
+opc= "63bfa50ee6523365ff14c1f45f88737d";
+dnn= "oai";
+nssai_sst=222;
+nssai_sd=123;
+}
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "nfapi";
+ local_n_if_name = "ens3";
+ remote_n_address = "127.0.0.1"; //Proxy IP
+ local_n_address = "127.0.0.1";
+ local_n_portc = 50600;
+ remote_n_portc = 50601;
+ local_n_portd = 50610;
+ remote_n_portd = 50611;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 90
+ att_rx = 0;
+ bands = [7,38,42,43];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 125;
+ }
+);
diff --git a/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf
new file mode 100644
index 0000000000..5df3ccf6cc
--- /dev/null
+++ b/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf
@@ -0,0 +1,52 @@
+log_config = {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="medium";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="full";
+};
+
+uicc0 = {
+imsi = "208950000000032";
+key = "0c0a34601d4f07677303652c0462535b";
+opc= "63bfa50ee6523365ff14c1f45f88737d";
+dnn= "oai";
+nssai_sst=222;
+nssai_sd=123;
+}
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "nfapi";
+ local_n_if_name = "ens3";
+ remote_n_address = "127.0.0.1"; //Proxy IP
+ local_n_address = "127.0.0.1";
+ local_n_portc = 50600;
+ remote_n_portc = 50601;
+ local_n_portd = 50610;
+ remote_n_portd = 50611;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 90
+ att_rx = 0;
+ bands = [7,38,42,43];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 125;
+ }
+);
diff --git a/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf
new file mode 100644
index 0000000000..b1ce5fee8d
--- /dev/null
+++ b/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf
@@ -0,0 +1,52 @@
+log_config = {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="medium";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="full";
+};
+
+uicc0 = {
+imsi = "208950000000033";
+key = "0c0a34601d4f07677303652c0462535b";
+opc= "63bfa50ee6523365ff14c1f45f88737d";
+dnn= "oai";
+nssai_sst=222;
+nssai_sd=123;
+}
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "nfapi";
+ local_n_if_name = "ens3";
+ remote_n_address = "127.0.0.1"; //Proxy IP
+ local_n_address = "127.0.0.1";
+ local_n_portc = 50600;
+ remote_n_portc = 50601;
+ local_n_portd = 50610;
+ remote_n_portd = 50611;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 90
+ att_rx = 0;
+ bands = [7,38,42,43];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 125;
+ }
+);
diff --git a/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf
new file mode 100644
index 0000000000..aea5104f1c
--- /dev/null
+++ b/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf
@@ -0,0 +1,52 @@
+log_config = {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="medium";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="full";
+};
+
+uicc0 = {
+imsi = "208950000000034";
+key = "0c0a34601d4f07677303652c0462535b";
+opc= "63bfa50ee6523365ff14c1f45f88737d";
+dnn= "oai";
+nssai_sst=222;
+nssai_sd=123;
+}
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "nfapi";
+ local_n_if_name = "ens3";
+ remote_n_address = "127.0.0.1"; //Proxy IP
+ local_n_address = "127.0.0.1";
+ local_n_portc = 50600;
+ remote_n_portc = 50601;
+ local_n_portd = 50610;
+ remote_n_portd = 50611;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 90
+ att_rx = 0;
+ bands = [7,38,42,43];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 125;
+ }
+);
diff --git a/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf
new file mode 100644
index 0000000000..4e596f81b5
--- /dev/null
+++ b/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf
@@ -0,0 +1,247 @@
+Active_eNBs = ( "eNB-Eurecom-LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+ ////////// Identification parameters:
+ eNB_ID = 0xe00;
+
+ cell_type = "CELL_MACRO_ENB";
+
+ eNB_name = "eNB-Eurecom-LTEBox";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 5;
+
+ plmn_list = ( { mcc = 320; mnc = 230; mnc_length = 3; } );
+
+ tr_s_preference = "local_mac"
+
+ ////////// Physical parameters:
+
+ component_carriers = (
+ {
+ node_function = "3GPP_eNODEB";
+ node_timing = "synch_to_ext_device";
+ node_synch_ref = 0;
+ frame_type = "FDD";
+ tdd_config = 3;
+ tdd_config_s = 0;
+ prefix_type = "NORMAL";
+ eutra_band = 7;
+ downlink_frequency = 2685000000L;
+ uplink_frequency_offset = -120000000;
+ Nid_cell = 0;
+ N_RB_DL = 50;
+ Nid_cell_mbsfn = 0;
+ nb_antenna_ports = 1;
+ nb_antennas_tx = 1;
+ nb_antennas_rx = 1;
+ tx_gain = 90;
+ rx_gain = 125;
+ pbch_repetition = "FALSE";
+ prach_root = 0;
+ prach_config_index = 0;
+ prach_high_speed = "DISABLE";
+ prach_zero_correlation = 1;
+ prach_freq_offset = 2;
+ pucch_delta_shift = 1;
+ pucch_nRB_CQI = 0;
+ pucch_nCS_AN = 0;
+ pucch_n1_AN = 0;
+ pdsch_referenceSignalPower = -27;
+ pdsch_p_b = 0;
+ pusch_n_SB = 1;
+ pusch_enable64QAM = "DISABLE";
+ pusch_hoppingMode = "interSubFrame";
+ pusch_hoppingOffset = 0;
+ pusch_groupHoppingEnabled = "ENABLE";
+ pusch_groupAssignment = 0;
+ pusch_sequenceHoppingEnabled = "DISABLE";
+ pusch_nDMRS1 = 1;
+ phich_duration = "NORMAL";
+ phich_resource = "ONESIXTH";
+ srs_enable = "DISABLE";
+ /* srs_BandwidthConfig =;
+ srs_SubframeConfig =;
+ srs_ackNackST =;
+ srs_MaxUpPts =;*/
+
+ pusch_p0_Nominal = -96;
+ pusch_alpha = "AL1";
+ pucch_p0_Nominal = -104;
+ msg3_delta_Preamble = 6;
+ pucch_deltaF_Format1 = "deltaF2";
+ pucch_deltaF_Format1b = "deltaF3";
+ pucch_deltaF_Format2 = "deltaF0";
+ pucch_deltaF_Format2a = "deltaF0";
+ pucch_deltaF_Format2b = "deltaF0";
+
+ rach_numberOfRA_Preambles = 64;
+ rach_preamblesGroupAConfig = "DISABLE";
+ /*
+ rach_sizeOfRA_PreamblesGroupA = ;
+ rach_messageSizeGroupA = ;
+ rach_messagePowerOffsetGroupB = ;
+ */
+ rach_powerRampingStep = 4;
+ rach_preambleInitialReceivedTargetPower = -108;
+ rach_preambleTransMax = 10;
+ rach_raResponseWindowSize = 10;
+ rach_macContentionResolutionTimer = 48;
+ rach_maxHARQ_Msg3Tx = 4;
+
+ pcch_default_PagingCycle = 128;
+ pcch_nB = "oneT";
+ bcch_modificationPeriodCoeff = 2;
+ ue_TimersAndConstants_t300 = 1000;
+ ue_TimersAndConstants_t301 = 1000;
+ ue_TimersAndConstants_t310 = 1000;
+ ue_TimersAndConstants_t311 = 10000;
+ ue_TimersAndConstants_n310 = 20;
+ ue_TimersAndConstants_n311 = 1;
+ ue_TransmissionMode = 1;
+
+ //Parameters for SIB18
+ rxPool_sc_CP_Len = "normal";
+ rxPool_sc_Period = "sf40";
+ rxPool_data_CP_Len = "normal";
+ rxPool_ResourceConfig_prb_Num = 20;
+ rxPool_ResourceConfig_prb_Start = 5;
+ rxPool_ResourceConfig_prb_End = 44;
+ rxPool_ResourceConfig_offsetIndicator_present = "prSmall";
+ rxPool_ResourceConfig_offsetIndicator_choice = 0;
+ rxPool_ResourceConfig_subframeBitmap_present = "prBs40";
+ rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000";
+ rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
+ rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
+/* rxPool_dataHoppingConfig_hoppingParameter = 0;
+ rxPool_dataHoppingConfig_numSubbands = "ns1";
+ rxPool_dataHoppingConfig_rbOffset = 0;
+ rxPool_commTxResourceUC-ReqAllowed = "TRUE";
+*/
+ // Parameters for SIB19
+ discRxPool_cp_Len = "normal"
+ discRxPool_discPeriod = "rf32"
+ discRxPool_numRetx = 1;
+ discRxPool_numRepetition = 2;
+ discRxPool_ResourceConfig_prb_Num = 5;
+ discRxPool_ResourceConfig_prb_Start = 3;
+ discRxPool_ResourceConfig_prb_End = 21;
+ discRxPool_ResourceConfig_offsetIndicator_present = "prSmall";
+ discRxPool_ResourceConfig_offsetIndicator_choice = 0;
+ discRxPool_ResourceConfig_subframeBitmap_present = "prBs40";
+ discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff";
+ discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
+ discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
+
+ }
+ );
+
+
+ srb1_parameters :
+ {
+ # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
+ timer_poll_retransmit = 80;
+
+ # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+ timer_reordering = 35;
+
+ # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+ timer_status_prohibit = 0;
+
+ # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+ poll_pdu = 4;
+
+ # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+ poll_byte = 99999;
+
+ # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+ max_retx_threshold = 4;
+ }
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+
+ ////////// MME parameters:
+ mme_ip_address = ( { ipv4 = "192.168.61.195";
+ ipv6 = "192:168:30::17";
+ port = 36412 ;
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+ enable_measurement_reports = "yes";
+
+ ///X2
+ enable_x2 = "yes";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+ t_dc_prep = 1000; /* unit: millisecond */
+ t_dc_overall = 2000; /* unit: millisecond */
+
+ NETWORK_INTERFACES :
+ {
+ ENB_INTERFACE_NAME_FOR_S1_MME = "ctrl0";
+ ENB_IPV4_ADDRESS_FOR_S1_MME = "172.16.0.1";
+ ENB_INTERFACE_NAME_FOR_S1U = "ctrl0";
+ ENB_IPV4_ADDRESS_FOR_S1U = "172.16.0.1";
+ ENB_PORT_FOR_S1U = 2152; # Spec 2152
+ ENB_IPV4_ADDRESS_FOR_X2C = "172.16.0.1";
+ ENB_PORT_FOR_X2C = 36422; # Spec 36422
+
+ };
+ }
+);
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ local_s_if_name = "lo";
+ remote_s_address = "127.0.0.1";
+ local_s_address = "127.0.0.1";
+ local_s_portc = 50001;
+ remote_s_portc = 50000;
+ local_s_portd = 50011;
+ remote_s_portd = 50010;
+ tr_s_preference = "nfapi";
+ tr_n_preference = "local_RRC";
+ scheduler_mode = "fairRR";
+ }
+);
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_RU_L1_SPLIT";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+log_config =
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ };
diff --git a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf
new file mode 100644
index 0000000000..b64b88ddea
--- /dev/null
+++ b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf
@@ -0,0 +1,265 @@
+Active_gNBs = ( "gNB-Eurecom-5GNRBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+gNBs =
+(
+ {
+ ////////// Identification parameters:
+ gNB_ID = 0xe00;
+
+ cell_type = "CELL_MACRO_GNB";
+
+ gNB_name = "gNB-Eurecom-5GNRBox";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 5;
+
+ plmn_list = ({mcc = 320; mnc = 230; mnc_length = 3;});
+
+ tr_s_preference = "local_mac"
+
+ ////////// Physical parameters:
+
+ ssb_SubcarrierOffset = 31; //0;
+ pdsch_AntennaPorts = 1;
+ pusch_AntennaPorts = 1;
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3600 MHz + 84 PRBs@30kHz SCS (same as initial BWP)
+ absoluteFrequencySSB = 641272; //641032; #641968; 641968=start of ssb at 3600MHz + 82 RBs 641032=center of SSB at center of cell
+ dl_frequencyBand = 78;
+ # this is 3600 MHz
+ dl_absoluteFrequencyPointA = 640000;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 106;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=84,L=13 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 6368;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 0;
+ initialDLBWPsearchSpaceZero = 0;
+ #pdsch-ConfigCommon
+ #pdschTimeDomainAllocationList (up to 16 entries)
+ initialDLBWPk0_0 = 0; #for DL slot
+ initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
+ initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
+
+ initialDLBWPk0_1 = 0; #for mixed slot
+ initialDLBWPmappingType_1 = 0;
+ initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 106;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 6368;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 13;
+ preambleReceivedTargetPower = -100;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 5;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; //15;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
+ #
+ msg1_SubcarrierSpacing = 1,
+
+# restrictedSetConfig
+# 0=unrestricted, 1=restricted type A, 2=restricted type B
+ restrictedSetConfig = 0,
+ # pusch-ConfigCommon (up to 16 elements)
+ initialULBWPk2_0 = 6; # used for UL slot
+ initialULBWPmappingType_0 = 1
+ initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
+
+ initialULBWPk2_1 = 6; # used for mixed slot
+ initialULBWPmappingType_1 = 1;
+ initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
+
+ initialULBWPk2_2 = 7; # used for Msg.3 during RA
+ initialULBWPmappingType_2 = 1;
+ initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
+
+ msg3_DeltaPreamble = 1;
+ p0_NominalWithGrant =-90;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -90;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1; #0x80;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7; //8; //7;
+ nrofDownlinkSymbols = 6; //0; //6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4; //0; //4;
+
+ ssPBCH_BlockPower = -25;
+ }
+
+ );
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+
+ ////////// MME parameters:
+ mme_ip_address = ( { ipv4 = "192.168.61.195";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+ ///X2
+ enable_x2 = "yes";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+ t_dc_prep = 1000; /* unit: millisecond */
+ t_dc_overall = 2000; /* unit: millisecond */
+ target_enb_x2_ip_address = (
+ { ipv4 = "172.16.0.1"; # rrc.band7.tm1.nfapi.conf:line 201
+ ipv6 = "192:168:30::17";
+ preference = "ipv4";
+ }
+ );
+
+ NETWORK_INTERFACES :
+ { # All of these have to be IP addr of gNB
+ # if in CORE container, make it 172.16.0.X
+ # if not launched in CORE, can set to lo (127.0.0.2)
+ GNB_INTERFACE_NAME_FOR_S1_MME = "ctrl0";
+ GNB_IPV4_ADDRESS_FOR_S1_MME = "172.16.0.2";
+ GNB_INTERFACE_NAME_FOR_S1U = "ctrl0";
+ GNB_IPV4_ADDRESS_FOR_S1U = "172.16.0.2";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ GNB_IPV4_ADDRESS_FOR_X2C = "172.16.0.2";
+ GNB_PORT_FOR_X2C = 36422; # Spec 36422
+ };
+ }
+);
+
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ local_s_if_name = "lo:";
+ remote_s_address = "127.0.0.1"; // pnf addr [!]
+ local_s_address = "127.0.0.2"; // vnf addr
+ local_s_portc = 50601; // vnf p5 port
+ remote_s_portc = 50600; // pnf p5 port [!]
+ local_s_portd = 50611; // vnf p7 port [!]
+ remote_s_portd = 50610; // pnf p7 port [!]
+ tr_s_preference = "nfapi";
+ tr_n_preference = "local_RRC";
+ }
+)
+
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+log_config =
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ };
+
diff --git a/ci-scripts/conf_files/episci/episci_ue.nfapi.conf b/ci-scripts/conf_files/episci/episci_ue.nfapi.conf
new file mode 100644
index 0000000000..0170a46655
--- /dev/null
+++ b/ci-scripts/conf_files/episci/episci_ue.nfapi.conf
@@ -0,0 +1,44 @@
+log_config = {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="medium";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="full";
+};
+
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "nfapi";
+ local_n_if_name = "ens3";
+ remote_n_address = "127.0.0.1"; //Proxy IP
+ local_n_address = "127.0.0.1";
+ local_n_portc = 50000;
+ remote_n_portc = 50001;
+ local_n_portd = 50010;
+ remote_n_portd = 50011;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 90
+ att_rx = 0;
+ bands = [7,38,42,43];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 125;
+ }
+);
diff --git a/ci-scripts/conf_files/episci/episci_ue_test_sfr.conf b/ci-scripts/conf_files/episci/episci_ue_test_sfr.conf
new file mode 100644
index 0000000000..e98e1b92f1
--- /dev/null
+++ b/ci-scripts/conf_files/episci/episci_ue_test_sfr.conf
@@ -0,0 +1,786 @@
+# List of known PLMNS
+PLMN: {
+ PLMN0: {
+ FULLNAME="Test network";
+ SHORTNAME="OAI4G";
+ MNC="01";
+ MCC="001";
+
+ };
+ PLMN1: {
+ FULLNAME="SFR France";
+ SHORTNAME="SFR";
+ MNC="10";
+ MCC="208";
+
+ };
+ PLMN2: {
+ FULLNAME="SFR France";
+ SHORTNAME="SFR";
+ MNC="11";
+ MCC="208";
+ };
+ PLMN3: {
+ FULLNAME="SFR France";
+ SHORTNAME="SFR";
+ MNC="13";
+ MCC="208";
+ };
+ PLMN4: {
+ FULLNAME="OAI LTEBOX";
+ SHORTNAME="OAIALU";
+ MNC="95";
+ MCC="208";
+ };
+ PLMN5: {
+ FULLNAME="T-Mobile USA";
+ SHORTNAME="T-Mobile";
+ MNC="280";
+ MCC="310";
+ };
+ PLMN6: {
+ FULLNAME="FICTITIOUS USA";
+ SHORTNAME="FICTITIO";
+ MNC="028";
+ MCC="310";
+ };
+ PLMN7: {
+ FULLNAME="Vodafone Italia";
+ SHORTNAME="VODAFONE";
+ MNC="10";
+ MCC="222";
+ };
+ PLMN8: {
+ FULLNAME="Vodafone Spain";
+ SHORTNAME="VODAFONE";
+ MNC="01";
+ MCC="214";
+ };
+ PLMN9: {
+ FULLNAME="Vodafone Spain";
+ SHORTNAME="VODAFONE";
+ MNC="06";
+ MCC="214";
+ };
+ PLMN10: {
+ FULLNAME="Vodafone Germ";
+ SHORTNAME="VODAFONE";
+ MNC="02";
+ MCC="262";
+ };
+ PLMN11: {
+ FULLNAME="Vodafone Germ";
+ SHORTNAME="VODAFONE";
+ MNC="04";
+ MCC="262";
+ };
+ PLMN12: {
+ FULLNAME="Vodafone Germ";
+ SHORTNAME="VODAFONE";
+ MNC="230";
+ MCC="320";
+ };
+};
+
+UE0:
+{
+ USER: {
+ IMEI="356113022094148";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000025";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561024";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE1:
+{
+ USER: {
+ IMEI="356113022094149";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000166";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561165";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE2:
+{
+ USER: {
+ IMEI="356113022094150";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000012";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561011";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE3:
+{
+ USER: {
+ IMEI="356113022094151";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000064";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561063";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE4:
+{
+ USER: {
+ IMEI="356113022094152";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000082";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561081";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE5:
+{
+ USER: {
+ IMEI="356113022094153";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000011";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561010";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE6:
+{
+ USER: {
+ IMEI="356113022094154";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000093";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561092";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE7:
+{
+ USER: {
+ IMEI="356113022094155";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000188";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561187";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE8:
+{
+ USER: {
+ IMEI="356113022094158";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000017";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561016";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE9:
+{
+ USER: {
+ IMEI="356113022094159";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000071";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561070";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE10:
+{
+ USER: {
+ IMEI="356113022094110";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000125";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561124";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE11:
+{
+ USER: {
+ IMEI="356113022094111";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000067";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561066";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE12:
+{
+ USER: {
+ IMEI="356113022094112";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000152";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561151";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE13:
+{
+ USER: {
+ IMEI="356113022094113";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000083";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561082";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE14:
+{
+ USER: {
+ IMEI="356113022094114";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000086";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561085";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE15:
+{
+ USER: {
+ IMEI="356113022094115";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000026";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561025";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE16:
+{
+ USER: {
+ IMEI="356113022094116";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000114";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561113";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE17:
+{
+ USER: {
+ IMEI="356113022094117";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000159";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561158";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
+
+UE18:
+{
+ USER: {
+ IMEI="356113022094118";
+ MANUFACTURER="EURECOM";
+ MODEL="LTE Android PC";
+ PIN="0000";
+ };
+
+ SIM: {
+ MSIN="100000113";
+ USIM_API_K="0c0a34601d4f07677303652c0462535b";
+ OPC="ba05688178e398bedc100674071002cb";
+ MSISDN="1011234561112";
+ };
+
+ # Home PLMN Selector with Access Technology
+ HPLMN= "320230";
+
+ # User controlled PLMN Selector with Access Technology
+ UCPLMN_LIST = ();
+
+ # Operator PLMN List
+ OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230");
+
+ # Operator controlled PLMN Selector with Access Technology
+ OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+ # Forbidden plmns
+ FPLMN_LIST = ();
+
+ # List of Equivalent HPLMNs
+#TODO: UE does not connect if set, to be fixed in the UE
+# EHPLMN_LIST= ("20811", "20813");
+ EHPLMN_LIST= ();
+};
\ No newline at end of file
diff --git a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf
new file mode 100644
index 0000000000..ab0cf5f469
--- /dev/null
+++ b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf
@@ -0,0 +1,326 @@
+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 = 208;
+ mnc = 99;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x1; // 0 false, else true
+ },
+ {
+ sst = 1;
+ sd = 0x112233; // 0 false, else true
+ }
+ );
+
+ });
+
+ nr_cellid = 12345678L;
+
+ ////////// Physical parameters:
+
+ ssb_SubcarrierOffset = 0;
+ pdsch_AntennaPorts = 1;
+ pusch_AntennaPorts = 1;
+ ul_prbblacklist = "51,52,53,54"
+ min_rxtxtime_pdsch = 6;
+
+ pdcch_ConfigSIB1 = (
+ {
+ controlResourceSetZero = 12;
+ searchSpaceZero = 0;
+ }
+ );
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
+ absoluteFrequencySSB = 641280;
+ dl_frequencyBand = 78;
+ # this is 3600 MHz
+ dl_absoluteFrequencyPointA = 640008;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 106;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=27,L=48 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 12;
+ initialDLBWPsearchSpaceZero = 0;
+ #pdsch-ConfigCommon
+ #pdschTimeDomainAllocationList (up to 16 entries)
+ initialDLBWPk0_0 = 0; #for DL slot
+ initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
+ initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
+
+ initialDLBWPk0_1 = 0; #for mixed slot
+ initialDLBWPmappingType_1 = 0;
+ initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 106;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 12952;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 13;
+ preambleReceivedTargetPower = -96;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 4;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
+ #
+ msg1_SubcarrierSpacing = 1,
+# restrictedSetConfig
+# 0=unrestricted, 1=restricted type A, 2=restricted type B
+ restrictedSetConfig = 0,
+
+ # pusch-ConfigCommon (up to 16 elements)
+ initialULBWPk2_0 = 6; # used for UL slot
+ initialULBWPmappingType_0 = 1
+ initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
+
+ initialULBWPk2_1 = 6; # used for mixed slot
+ initialULBWPmappingType_1 = 1;
+ initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
+
+ initialULBWPk2_2 = 7; # used for Msg.3 during RA
+ initialULBWPmappingType_2 = 1;
+ initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
+
+ msg3_DeltaPreamble = 1;
+ p0_NominalWithGrant =-90;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -90;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = -25;
+ }
+
+ );
+
+
+ # ------- 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.61.195";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+
+ NETWORK_INTERFACES :
+ {
+ GNB_INTERFACE_NAME_FOR_NG_AMF = "lo:";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "127.0.0.2";
+ GNB_INTERFACE_NAME_FOR_NGU = "lo:";
+ GNB_IPV4_ADDRESS_FOR_NGU = "127.0.0.2";
+ GNB_PORT_FOR_NGU = 2152; # Spec 2152
+ };
+
+ }
+);
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ local_s_if_name = "lo:";
+ remote_s_address = "127.0.0.1"; // pnf addr [!]
+ local_s_address = "127.0.0.2"; // vnf addr
+ local_s_portc = 50601; // vnf p5 port
+ remote_s_portc = 50600; // pnf p5 port [!]
+ local_s_portd = 50611; // vnf p7 port [!]
+ remote_s_portd = 50610; // pnf p7 port [!]
+ tr_s_preference = "nfapi";
+ tr_n_preference = "local_RRC";
+ }
+);
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 8;
+ prach_dtx_threshold = 120;
+ pucch0_dtx_threshold = 150;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 0
+ att_rx = 0;
+ bands = [78];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 75;
+ eNB_instances = [0];
+ #beamforming 1x4 matrix:
+ bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
+ #clock_src = "external";
+ sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
+ }
+);
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_SINGLE_THREAD";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+rfsimulator :
+{
+ serveraddr = "server";
+ serverport = "4043";
+ options = (); #("saviq"); or/and "chanmod"
+ modelname = "AWGN";
+ IQfile = "/tmp/rfsimulator.iqs";
+};
+
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
+ log_config :
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ ngap_log_level ="debug";
+ ngap_log_verbosity ="medium";
+ };
+
diff --git a/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf
new file mode 100644
index 0000000000..8411ed8fc6
--- /dev/null
+++ b/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf
@@ -0,0 +1,52 @@
+log_config = {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="medium";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="full";
+};
+
+uicc0 = {
+imsi = "2089900007487";
+key = "fec86ba6eb707ed08905757b1bb44b8f";
+opc= "C42449363BBAD02B66D16BC975D77CC1";
+dnn= "oai";
+nssai_sst=1;
+nssai_sd=1;
+}
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "nfapi";
+ local_n_if_name = "lo:";
+ remote_n_address = "127.0.0.1"; //Proxy IP
+ local_n_address = "127.0.0.1";
+ local_n_portc = 50600;
+ remote_n_portc = 50601;
+ local_n_portd = 50610;
+ remote_n_portd = 50611;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 90
+ att_rx = 0;
+ bands = [7,38,42,43];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 125;
+ }
+);
diff --git a/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf
new file mode 100644
index 0000000000..d4c72d6c14
--- /dev/null
+++ b/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf
@@ -0,0 +1,247 @@
+Active_eNBs = ( "eNB-Eurecom-LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+ ////////// Identification parameters:
+ eNB_ID = 0xe00;
+
+ cell_type = "CELL_MACRO_ENB";
+
+ eNB_name = "eNB-Eurecom-LTEBox";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 5;
+
+ plmn_list = ( { mcc = 320; mnc = 230; mnc_length = 3; } );
+
+ tr_s_preference = "local_mac"
+
+ ////////// Physical parameters:
+
+ component_carriers = (
+ {
+ node_function = "3GPP_eNODEB";
+ node_timing = "synch_to_ext_device";
+ node_synch_ref = 0;
+ frame_type = "FDD";
+ tdd_config = 3;
+ tdd_config_s = 0;
+ prefix_type = "NORMAL";
+ eutra_band = 7;
+ downlink_frequency = 2685000000L;
+ uplink_frequency_offset = -120000000;
+ Nid_cell = 0;
+ N_RB_DL = 50;
+ Nid_cell_mbsfn = 0;
+ nb_antenna_ports = 1;
+ nb_antennas_tx = 1;
+ nb_antennas_rx = 1;
+ tx_gain = 90;
+ rx_gain = 125;
+ pbch_repetition = "FALSE";
+ prach_root = 0;
+ prach_config_index = 0;
+ prach_high_speed = "DISABLE";
+ prach_zero_correlation = 1;
+ prach_freq_offset = 2;
+ pucch_delta_shift = 1;
+ pucch_nRB_CQI = 0;
+ pucch_nCS_AN = 0;
+ pucch_n1_AN = 0;
+ pdsch_referenceSignalPower = -27;
+ pdsch_p_b = 0;
+ pusch_n_SB = 1;
+ pusch_enable64QAM = "DISABLE";
+ pusch_hoppingMode = "interSubFrame";
+ pusch_hoppingOffset = 0;
+ pusch_groupHoppingEnabled = "ENABLE";
+ pusch_groupAssignment = 0;
+ pusch_sequenceHoppingEnabled = "DISABLE";
+ pusch_nDMRS1 = 1;
+ phich_duration = "NORMAL";
+ phich_resource = "ONESIXTH";
+ srs_enable = "DISABLE";
+ /* srs_BandwidthConfig =;
+ srs_SubframeConfig =;
+ srs_ackNackST =;
+ srs_MaxUpPts =;*/
+
+ pusch_p0_Nominal = -96;
+ pusch_alpha = "AL1";
+ pucch_p0_Nominal = -104;
+ msg3_delta_Preamble = 6;
+ pucch_deltaF_Format1 = "deltaF2";
+ pucch_deltaF_Format1b = "deltaF3";
+ pucch_deltaF_Format2 = "deltaF0";
+ pucch_deltaF_Format2a = "deltaF0";
+ pucch_deltaF_Format2b = "deltaF0";
+
+ rach_numberOfRA_Preambles = 64;
+ rach_preamblesGroupAConfig = "DISABLE";
+ /*
+ rach_sizeOfRA_PreamblesGroupA = ;
+ rach_messageSizeGroupA = ;
+ rach_messagePowerOffsetGroupB = ;
+ */
+ rach_powerRampingStep = 4;
+ rach_preambleInitialReceivedTargetPower = -108;
+ rach_preambleTransMax = 10;
+ rach_raResponseWindowSize = 10;
+ rach_macContentionResolutionTimer = 48;
+ rach_maxHARQ_Msg3Tx = 4;
+
+ pcch_default_PagingCycle = 128;
+ pcch_nB = "oneT";
+ bcch_modificationPeriodCoeff = 2;
+ ue_TimersAndConstants_t300 = 1000;
+ ue_TimersAndConstants_t301 = 1000;
+ ue_TimersAndConstants_t310 = 1000;
+ ue_TimersAndConstants_t311 = 10000;
+ ue_TimersAndConstants_n310 = 20;
+ ue_TimersAndConstants_n311 = 1;
+ ue_TransmissionMode = 1;
+
+ //Parameters for SIB18
+ rxPool_sc_CP_Len = "normal";
+ rxPool_sc_Period = "sf40";
+ rxPool_data_CP_Len = "normal";
+ rxPool_ResourceConfig_prb_Num = 20;
+ rxPool_ResourceConfig_prb_Start = 5;
+ rxPool_ResourceConfig_prb_End = 44;
+ rxPool_ResourceConfig_offsetIndicator_present = "prSmall";
+ rxPool_ResourceConfig_offsetIndicator_choice = 0;
+ rxPool_ResourceConfig_subframeBitmap_present = "prBs40";
+ rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000";
+ rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
+ rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
+/* rxPool_dataHoppingConfig_hoppingParameter = 0;
+ rxPool_dataHoppingConfig_numSubbands = "ns1";
+ rxPool_dataHoppingConfig_rbOffset = 0;
+ rxPool_commTxResourceUC-ReqAllowed = "TRUE";
+*/
+ // Parameters for SIB19
+ discRxPool_cp_Len = "normal"
+ discRxPool_discPeriod = "rf32"
+ discRxPool_numRetx = 1;
+ discRxPool_numRepetition = 2;
+ discRxPool_ResourceConfig_prb_Num = 5;
+ discRxPool_ResourceConfig_prb_Start = 3;
+ discRxPool_ResourceConfig_prb_End = 21;
+ discRxPool_ResourceConfig_offsetIndicator_present = "prSmall";
+ discRxPool_ResourceConfig_offsetIndicator_choice = 0;
+ discRxPool_ResourceConfig_subframeBitmap_present = "prBs40";
+ discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff";
+ discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
+ discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
+
+ }
+ );
+
+
+ srb1_parameters :
+ {
+ # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
+ timer_poll_retransmit = 80;
+
+ # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+ timer_reordering = 35;
+
+ # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+ timer_status_prohibit = 0;
+
+ # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+ poll_pdu = 4;
+
+ # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+ poll_byte = 99999;
+
+ # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+ max_retx_threshold = 4;
+ }
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+
+ ////////// MME parameters:
+ mme_ip_address = ( { ipv4 = "192.168.61.3";
+ ipv6 = "192:168:30::17";
+ port = 36412 ;
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+ enable_measurement_reports = "no";
+
+ ///X2
+ enable_x2 = "yes";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+ t_dc_prep = 1000; /* unit: millisecond */
+ t_dc_overall = 2000; /* unit: millisecond */
+
+ NETWORK_INTERFACES :
+ {
+ ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
+ ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.1";
+ ENB_INTERFACE_NAME_FOR_S1U = "lo";
+ ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.1";
+ ENB_PORT_FOR_S1U = 2152; # Spec 2152
+ ENB_IPV4_ADDRESS_FOR_X2C = "127.0.0.1";
+ ENB_PORT_FOR_X2C = 36422; # Spec 36422
+
+ };
+ }
+);
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ local_s_if_name = "lo";
+ remote_s_address = "127.0.0.1";
+ local_s_address = "127.0.0.1";
+ local_s_portc = 50001;
+ remote_s_portc = 50000;
+ local_s_portd = 50011;
+ remote_s_portd = 50010;
+ tr_s_preference = "nfapi";
+ tr_n_preference = "local_RRC";
+ scheduler_mode = "fairRR";
+ }
+);
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_RU_L1_SPLIT";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+log_config =
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ };
diff --git a/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf
new file mode 100644
index 0000000000..0ef317d63e
--- /dev/null
+++ b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf
@@ -0,0 +1,305 @@
+Active_gNBs = ( "gNB-Eurecom-5GNRBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+gNBs =
+(
+ {
+ ////////// Identification parameters:
+ gNB_ID = 0xe00;
+
+ cell_type = "CELL_MACRO_GNB";
+
+ gNB_name = "gNB-Eurecom-5GNRBox";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 5;
+
+ plmn_list = ({mcc = 320; mnc = 230; mnc_length = 3;});
+
+ tr_s_preference = "local_mac"
+
+ ////////// Physical parameters:
+
+ ssb_SubcarrierOffset = 0;
+ pdsch_AntennaPorts = 1;
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
+ absoluteFrequencySSB = 641032;
+ dl_frequencyBand = 78;
+ # this is 3600 MHz
+ dl_absoluteFrequencyPointA = 640000;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 106;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=41,L=24 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 6366;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 12;
+ initialDLBWPsearchSpaceZero = 0;
+ #pdsch-ConfigCommon
+ #pdschTimeDomainAllocationList (up to 16 entries)
+ initialDLBWPk0_0 = 0;
+ #initialULBWPmappingType
+ #0=typeA,1=typeB
+ initialDLBWPmappingType_0 = 0;
+ #this is SS=1,L=13
+ initialDLBWPstartSymbolAndLength_0 = 40;
+
+ initialDLBWPk0_1 = 0;
+ initialDLBWPmappingType_1 = 0;
+ #this is SS=2,L=12
+ initialDLBWPstartSymbolAndLength_1 = 53;
+
+ initialDLBWPk0_2 = 0;
+ initialDLBWPmappingType_2 = 0;
+ #this is SS=1,L=12
+ initialDLBWPstartSymbolAndLength_2 = 54;
+
+ initialDLBWPk0_3 = 0;
+ initialDLBWPmappingType_3 = 0;
+ #this is SS=1,L=5
+ initialDLBWPstartSymbolAndLength_3 = 57;
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 106;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 6366;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 13;
+ preambleReceivedTargetPower = -118;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 4;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
+ #
+ msg1_SubcarrierSpacing = 1,
+# restrictedSetConfig
+# 0=unrestricted, 1=restricted type A, 2=restricted type B
+ restrictedSetConfig = 0,
+
+ # pusch-ConfigCommon (up to 16 elements)
+ initialULBWPk2_0 = 6;
+ initialULBWPmappingType_0 = 1
+ # this is SS=0 L=11
+ initialULBWPstartSymbolAndLength_0 = 55;
+
+ initialULBWPk2_1 = 6;
+ initialULBWPmappingType_1 = 1;
+ # this is SS=0 L=12
+ initialULBWPstartSymbolAndLength_1 = 69;
+
+ initialULBWPk2_2 = 7;
+ initialULBWPmappingType_2 = 1;
+ # this is SS=10 L=4
+ initialULBWPstartSymbolAndLength_2 = 52;
+
+ msg3_DeltaPreamble = 1;
+ p0_NominalWithGrant =-90;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -90;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = 10;
+ }
+
+
+ );
+
+
+
+ srb1_parameters :
+ {
+ # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
+ timer_poll_retransmit = 80;
+
+ # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+ timer_reordering = 35;
+
+ # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+ timer_status_prohibit = 0;
+
+ # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+ poll_pdu = 4;
+
+ # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+ poll_byte = 99999;
+
+ # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+ max_retx_threshold = 4;
+ }
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+
+ ////////// MME parameters:
+ mme_ip_address = ( { ipv4 = "192.168.61.3";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+ ///X2
+ enable_x2 = "yes";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+ t_dc_prep = 1000; /* unit: millisecond */
+ t_dc_overall = 2000; /* unit: millisecond */
+ target_enb_x2_ip_address = (
+ { ipv4 = "127.0.0.1"; # rrc.band7.tm1.nfapi.conf:line 201
+ ipv6 = "192:168:30::17";
+ preference = "ipv4";
+ }
+ );
+
+ NETWORK_INTERFACES :
+ { # All of these have to be IP addr of gNB
+ # if in CORE container, make it 172.16.0.X
+ # if not launched in CORE, can set to lo (127.0.0.2)
+ GNB_INTERFACE_NAME_FOR_S1_MME = "lo:";
+ GNB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2";
+ GNB_INTERFACE_NAME_FOR_S1U = "lo:";
+ GNB_IPV4_ADDRESS_FOR_S1U = "127.0.0.2";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ GNB_IPV4_ADDRESS_FOR_X2C = "127.0.0.2";
+ GNB_PORT_FOR_X2C = 36422; # Spec 36422
+ };
+ }
+);
+
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ local_s_if_name = "lo:";
+ remote_s_address = "127.0.0.1"; // pnf addr [!]
+ local_s_address = "127.0.0.2"; // vnf addr
+ local_s_portc = 50601; // vnf p5 port
+ remote_s_portc = 50600; // pnf p5 port [!]
+ local_s_portd = 50611; // vnf p7 port [!]
+ remote_s_portd = 50610; // pnf p7 port [!]
+ tr_s_preference = "nfapi";
+ tr_n_preference = "local_RRC";
+ }
+)
+
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+log_config =
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ };
+
diff --git a/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf b/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf
new file mode 100644
index 0000000000..3f227d573c
--- /dev/null
+++ b/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf
@@ -0,0 +1,44 @@
+log_config = {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="medium";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="full";
+};
+
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "nfapi";
+ local_n_if_name = "lo";
+ remote_n_address = "127.0.0.1";
+ local_n_address = "127.0.0.1";
+ local_n_portc = 50000;
+ remote_n_portc = 50001;
+ local_n_portd = 50010;
+ remote_n_portd = 50011;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 90
+ att_rx = 0;
+ bands = [7,38,42,43];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 125;
+ }
+);
diff --git a/ci-scripts/conf_files/gNB_SA_CU.conf b/ci-scripts/conf_files/gNB_SA_CU.conf
new file mode 100644
index 0000000000..d3cfbfc973
--- /dev/null
+++ b/ci-scripts/conf_files/gNB_SA_CU.conf
@@ -0,0 +1,275 @@
+Active_gNBs = ( "gNB-Eurecom-CU");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+Num_Threads_PUSCH = 8;
+
+gNBs =
+(
+ {
+ ////////// Identification parameters:
+ gNB_CU_ID = 0xe00;
+
+# cell_type = "CELL_MACRO_GNB";
+
+ gNB_name = "gNB-Eurecom-CU";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+ plmn_list = ({
+ mcc = 208;
+ mnc = 99;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x010203; // 0 false, else true
+ },
+ {
+ sst = 1;
+ sd = 0x112233; // 0 false, else true
+ }
+ );
+
+ });
+
+
+ nr_cellid = 12345678L;
+
+ tr_s_preference = "f1";
+
+ local_s_if_name = "lo";
+ local_s_address = "127.0.0.4";
+ remote_s_address = "127.0.0.3";
+ local_s_portc = 501;
+ local_s_portd = 2152;
+ remote_s_portc = 500;
+ remote_s_portd = 2152;
+ ssb_SubcarrierOffset = 0;
+ pdsch_AntennaPorts = 1;
+ pusch_AntennaPorts = 1;
+ min_rxtxtime = 6;
+ sib1_tda = 0;
+
+ pdcch_ConfigSIB1 = (
+ {
+ controlResourceSetZero = 12;
+ searchSpaceZero = 0;
+ }
+ );
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
+ absoluteFrequencySSB = 641280;
+ dl_frequencyBand = 78;
+ # this is 3600 MHz
+ dl_absoluteFrequencyPointA = 640008;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 106;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=27,L=48 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 12;
+ initialDLBWPsearchSpaceZero = 0;
+ #pdsch-ConfigCommon
+ #pdschTimeDomainAllocationList (up to 16 entries)
+ initialDLBWPk0_0 = 0; #for DL slot
+ initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
+ initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
+
+ initialDLBWPk0_1 = 0; #for mixed slot
+ initialDLBWPmappingType_1 = 0;
+ initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 106;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 28875;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 13;
+ preambleReceivedTargetPower = -96;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 4;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
+ #
+ msg1_SubcarrierSpacing = 1,
+# restrictedSetConfig
+# 0=unrestricted, 1=restricted type A, 2=restricted type B
+ restrictedSetConfig = 0,
+
+ # pusch-ConfigCommon (up to 16 elements)
+ initialULBWPk2_0 = 6; # used for UL slot
+ initialULBWPmappingType_0 = 1
+ initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
+
+ initialULBWPk2_1 = 6; # used for mixed slot
+ initialULBWPmappingType_1 = 1;
+ initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
+
+ initialULBWPk2_2 = 7; # used for Msg.3 during RA
+ initialULBWPmappingType_2 = 1;
+ initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
+
+ msg3_DeltaPreamble = 1;
+ p0_NominalWithGrant =-90;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -90;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = -25;
+ }
+
+ );
+ # ------- 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.5.233";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+ NETWORK_INTERFACES :
+ {
+
+ GNB_INTERFACE_NAME_FOR_NG_AMF = "eth0";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR";
+ GNB_INTERFACE_NAME_FOR_NGU = "eth0";
+ GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+ }
+);
+
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+ log_config :
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="debug";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ f1ap_log_level ="debug";
+ f1ap_log_verbosity ="medium";
+ ngap_log_level ="debug";
+ ngap_log_verbosity ="medium";
+ };
+
diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf
new file mode 100644
index 0000000000..b03758a006
--- /dev/null
+++ b/ci-scripts/conf_files/gNB_SA_DU.conf
@@ -0,0 +1,294 @@
+Active_gNBs = ( "gNB-Eurecom-DU");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+gNBs =
+(
+ {
+ ////////// Identification parameters:
+ gNB_CU_ID = 0xe00;
+
+# cell_type = "CELL_MACRO_GNB";
+
+ gNB_name = "gNB-Eurecom-DU";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+ plmn_list = ({
+ mcc = 208;
+ mnc = 99;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x010203; // 0 false, else true
+ },
+ {
+ sst = 1;
+ sd = 0x112233; // 0 false, else true
+ }
+ );
+
+ });
+
+
+ nr_cellid = 12345678L;
+
+ ////////// Physical parameters:
+
+ ssb_SubcarrierOffset = 0;
+ pdsch_AntennaPorts = 1;
+ pusch_AntennaPorts = 1;
+ min_rxtxtime = 6;
+ sib1_tda = 0;
+
+ pdcch_ConfigSIB1 = (
+ {
+ controlResourceSetZero = 12;
+ searchSpaceZero = 0;
+ }
+ );
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
+ absoluteFrequencySSB = 641280;
+ dl_frequencyBand = 78;
+ # this is 3600 MHz
+ dl_absoluteFrequencyPointA = 640008;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 106;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=27,L=48 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 12;
+ initialDLBWPsearchSpaceZero = 0;
+ #pdsch-ConfigCommon
+ #pdschTimeDomainAllocationList (up to 16 entries)
+ initialDLBWPk0_0 = 0; #for DL slot
+ initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
+ initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
+
+ initialDLBWPk0_1 = 0; #for mixed slot
+ initialDLBWPmappingType_1 = 0;
+ initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 106;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 28875;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 13;
+ preambleReceivedTargetPower = -96;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 4;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
+ #
+ msg1_SubcarrierSpacing = 1,
+# restrictedSetConfig
+# 0=unrestricted, 1=restricted type A, 2=restricted type B
+ restrictedSetConfig = 0,
+
+ # pusch-ConfigCommon (up to 16 elements)
+ initialULBWPk2_0 = 6; # used for UL slot
+ initialULBWPmappingType_0 = 1
+ initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
+
+ initialULBWPk2_1 = 6; # used for mixed slot
+ initialULBWPmappingType_1 = 1;
+ initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
+
+ initialULBWPk2_2 = 7; # used for Msg.3 during RA
+ initialULBWPmappingType_2 = 1;
+ initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
+
+ msg3_DeltaPreamble = 1;
+ p0_NominalWithGrant =-90;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -90;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = -25;
+ }
+
+ );
+
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+ }
+);
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "f1";
+ local_n_if_name = "lo";
+ local_n_address = "127.0.0.3";
+ remote_n_address = "127.0.0.4";
+ local_n_portc = 500;
+ local_n_portd = 2152;
+ remote_n_portc = 501;
+ remote_n_portd = 2152;
+
+ }
+);
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 8;
+ prach_dtx_threshold = 120;
+ pucch0_dtx_threshold = 150;
+ ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 0
+ att_rx = 0;
+ bands = [78];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 114;
+ eNB_instances = [0];
+ #beamforming 1x4 matrix:
+ bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
+ clock_src = "internal";
+ }
+);
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_SINGLE_THREAD";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+rfsimulator: {
+serveraddr = "server";
+ serverport = "4043";
+ options = (); #("saviq"); or/and "chanmod"
+ modelname = "AWGN";
+ IQfile = "/tmp/rfsimulator.iqs"
+}
+
+ log_config :
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="debug";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ f1ap_log_level ="debug";
+ f1ap_log_verbosity ="medium";
+ ngap_log_level ="debug";
+ ngap_log_verbosity ="medium";
+ };
+
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
index 9bf8bd20cd..70892930c9 100644
--- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
@@ -11,7 +11,6 @@ gNBs =
# cell_type = "CELL_MACRO_GNB";
gNB_name = "gNB-OAI";
- min_rxtxtime = 6;
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
@@ -44,6 +43,7 @@ gNBs =
#pusch_TargetSNRx10 = 200;
#pucch_TargetSNRx10 = 200;
ul_prbblacklist = "51,52,53,54"
+ min_rxtxtime = 6;
pdcch_ConfigSIB1 = (
{
@@ -239,6 +239,7 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
+ pusch_proc_threads = 4;
prach_dtx_threshold = 120;
# pucch0_dtx_threshold = 150;
}
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf
similarity index 99%
rename from ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf
rename to ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf
index 9bf8bd20cd..70892930c9 100644
--- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf
@@ -11,7 +11,6 @@ gNBs =
# cell_type = "CELL_MACRO_GNB";
gNB_name = "gNB-OAI";
- min_rxtxtime = 6;
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
@@ -44,6 +43,7 @@ gNBs =
#pusch_TargetSNRx10 = 200;
#pucch_TargetSNRx10 = 200;
ul_prbblacklist = "51,52,53,54"
+ min_rxtxtime = 6;
pdcch_ConfigSIB1 = (
{
@@ -239,6 +239,7 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
+ pusch_proc_threads = 4;
prach_dtx_threshold = 120;
# pucch0_dtx_threshold = 150;
}
diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
index 5a5f0e9aa6..f232106d56 100644
--- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
@@ -23,6 +23,7 @@ gNBs =
ssb_SubcarrierOffset = 31; //0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
+ min_rxtxtime = 6;
servingCellConfigCommon = (
{
diff --git a/ci-scripts/conf_files/nr-ue.nfapi.conf b/ci-scripts/conf_files/nr-ue.nfapi.conf
new file mode 100644
index 0000000000..b12e0c8d05
--- /dev/null
+++ b/ci-scripts/conf_files/nr-ue.nfapi.conf
@@ -0,0 +1,44 @@
+log_config = {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="medium";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="full";
+};
+
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "nfapi";
+ local_n_if_name = "ens3";
+ remote_n_address = "127.0.0.1"; //Proxy IP
+ local_n_address = "127.0.0.1";
+ local_n_portc = 50600;
+ remote_n_portc = 50601;
+ local_n_portd = 50610;
+ remote_n_portd = 50611;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 90
+ att_rx = 0;
+ bands = [7,38,42,43];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 125;
+ }
+);
diff --git a/ci-scripts/main.py b/ci-scripts/main.py
index ddf9bb531e..3a5a69573d 100644
--- a/ci-scripts/main.py
+++ b/ci-scripts/main.py
@@ -310,6 +310,13 @@ def GetParametersFromXML(action):
CiTestObj.ue_id = ue_id
CiTestObj.iperf_direction = test.findtext('direction')#used for modules only
CiTestObj.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold')
+ iperf_bitrate_threshold = test.findtext('iperf_bitrate_threshold')
+ if (iperf_bitrate_threshold is None):
+ CiTestObj.iperf_bitrate_threshold = "90" #if no threshold is specified, default will be 90%
+ else:
+ CiTestObj.iperf_bitrate_threshold = iperf_bitrate_threshold
+
+
CiTestObj.iperf_profile = test.findtext('iperf_profile')
if (CiTestObj.iperf_profile is None):
CiTestObj.iperf_profile = 'balanced'
@@ -811,6 +818,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
check_OAI_UE = False
RAN.pStatus=CiTestObj.CheckProcessExist(check_eNB, check_OAI_UE,RAN,EPC)
RAN.InitializeeNB(HTML, EPC)
+ if RAN.prematureExit:
+ CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS)
elif action == 'Terminate_eNB':
RAN.TerminateeNB(HTML, EPC)
elif action == 'Initialize_UE':
diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py
index 95066d168d..f01b85015b 100644
--- a/ci-scripts/ran.py
+++ b/ci-scripts/ran.py
@@ -474,7 +474,7 @@ class RANManagement():
mySSH.command('echo ' + lPassWord + ' | echo "ulimit -c unlimited && sudo UHD_RFNOC_DIR=/usr/local/share/uhd/rfnoc ./ran_build/build/' + self.air_interface[self.eNB_instance] + ' -O ' + lSourcePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
#otherwise the regular command is ok
else:
- mySSH.command('echo "ulimit -c unlimited && ./ran_build/build/' + self.air_interface[self.eNB_instance] + ' -O ' + lSourcePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
+ mySSH.command('echo "ulimit -c unlimited && catchsegv ./ran_build/build/' + self.air_interface[self.eNB_instance] + ' -O ' + lSourcePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
mySSH.command('chmod 775 ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
mySSH.command('echo ' + lPassWord + ' | sudo -S rm -Rf enb_' + self.testCase_id + '.log', '\$', 5)
@@ -738,8 +738,8 @@ class RANManagement():
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/enb_*.pcap .','\$',20)
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/gnb_*.pcap .','\$',20)
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm -f enb.log.zip', '\$', 5)
- mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png log/*/*.log log/*/*.pcap', '\$', 60)
- mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png log/*/*.log log/*/*.pcap', '\$', 15)
+ mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 60)
+ mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 15)
mySSH.close()
def AnalyzeLogFile_eNB(self, eNBlogFile, HTML):
@@ -880,9 +880,6 @@ class RANManagement():
if result is not None and not exitSignalReceived:
foundSegFault = True
result = re.search('[Cc]ore [dD]ump', str(line))
- if result is not None and not exitSignalReceived:
- foundSegFault = True
- result = re.search('./ran_build/build/lte-softmodem', str(line))
if result is not None and not exitSignalReceived:
foundSegFault = True
result = re.search('[Aa]ssertion', str(line))
diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh
index 19fac7fd78..6ef6b2e254 100755
--- a/ci-scripts/reportTestLocally.sh
+++ b/ci-scripts/reportTestLocally.sh
@@ -1033,116 +1033,6 @@ function report_test {
echo " " >> ./test_simulator_results.html
fi
- ARCHIVES_LOC=archives/l2_sim/test
- if [ -d $ARCHIVES_LOC ]
- then
- echo "
4G LTE L2-NFAPI Simulator Check " >> ./test_simulator_results.html
-
- if [ -f $ARCHIVES_LOC/test_final_status.log ]
- then
- if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ]
- then
- echo " " >> ./test_simulator_results.html
- echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html
- echo "
" >> ./test_simulator_results.html
- else
- echo " " >> ./test_simulator_results.html
- echo " TEST was a FAILURE! " >> ./test_simulator_results.html
- echo "
" >> ./test_simulator_results.html
- fi
- else
- echo " " >> ./test_simulator_results.html
- echo " COULD NOT DETERMINE TEST FINAL STATUS! " >> ./test_simulator_results.html
- echo "
" >> ./test_simulator_results.html
- fi
-
- echo " More details on L2-NFAPI Simulator test results " >> ./test_simulator_results.html
- echo " " >> ./test_simulator_results.html
- echo "
" >> ./test_simulator_results.html
- echo " " >> ./test_simulator_results.html
- echo " Log File Name " >> ./test_simulator_results.html
- echo " Command " >> ./test_simulator_results.html
- echo " Status " >> ./test_simulator_results.html
- echo " Statistics " >> ./test_simulator_results.html
- echo " " >> ./test_simulator_results.html
-
- EPC_CONFIGS=("wS1" "noS1")
- TRANS_MODES=("fdd")
- BW_CASES=(05)
- NB_USERS=(01 04)
- for CN_CONFIG in ${EPC_CONFIGS[@]}
- do
- for TMODE in ${TRANS_MODES[@]}
- do
- for BW in ${BW_CASES[@]}
- do
- for UES in ${NB_USERS[@]}
- do
- echo " " >> ./test_simulator_results.html
- if [[ $CN_CONFIG =~ .*wS1.* ]]
- then
- echo " Test with EPC (aka withS1): ${TMODE} -- ${BW}MHz -- ${UES} user(s) " >> ./test_simulator_results.html
- else
- echo " Test without EPC (aka noS1): ${TMODE} -- ${BW}MHz -- ${UES} user(s) " >> ./test_simulator_results.html
- fi
- echo " " >> ./test_simulator_results.html
- ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_enb.log
- UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"`
- if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
- then
- NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
- NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
- echo " " >> ./test_simulator_results.html
- echo " $NAME_ENB --- $NAME_UE " >> ./test_simulator_results.html
- echo " N/A " >> ./test_simulator_results.html
- NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
- NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG`
- NB_ENB_SYNCED_WITH_UE=`egrep -c "Sending NFAPI_START_RESPONSE" $UE_LOG`
- if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 2 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
- then
- echo " OK " >> ./test_simulator_results.html
- else
- echo " KO " >> ./test_simulator_results.html
- fi
- echo " " >> ./test_simulator_results.html
- if [ $NB_ENB_GOT_SYNC -gt 0 ]
- then
- echo "- eNB --> got sync " >> ./test_simulator_results.html
- else
- echo "- eNB NEVER got sync " >> ./test_simulator_results.html
- fi
- if [ $NB_UE_GOT_SYNC -gt 2 ]
- then
- echo "- UE --> got sync " >> ./test_simulator_results.html
- else
- echo "- UE NEVER got sync " >> ./test_simulator_results.html
- fi
- if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
- then
- echo "- UE attached to eNB " >> ./test_simulator_results.html
- else
- echo "- UE NEVER attached to eNB " >> ./test_simulator_results.html
- fi
- echo " " >> ./test_simulator_results.html
- echo " " >> ./test_simulator_results.html
- fi
- PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping*.log 2> /dev/null`
- analyzePingFiles
-
- IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_dl*client*txt 2> /dev/null`
- analyzeIperfFiles
-
- IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_ul*client*txt 2> /dev/null`
- analyzeIperfFiles
- done
- done
- done
- done
-
- echo "
" >> ./test_simulator_results.html
- echo "
" >> ./test_simulator_results.html
- fi
-
ARCHIVES_LOC=archives/phy_sim/test
if [ -d $ARCHIVES_LOC ]
then
diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh
index de696cdc64..8be4a47bfa 100755
--- a/ci-scripts/runTestOnVM.sh
+++ b/ci-scripts/runTestOnVM.sh
@@ -65,7 +65,7 @@ function start_basic_sim_enb {
echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/" >> $1
echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
- echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --basicsim\" > ./my-lte-softmodem-run.sh " >> $1
+ echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --basicsim\" > ./my-lte-softmodem-run.sh " >> $1
echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1
echo "cat ./my-lte-softmodem-run.sh" >> $1
echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1
@@ -110,7 +110,7 @@ function start_basic_sim_ue {
echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" > $1
echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build" >> $1
- echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --log_config.global_log_options nocolor,level --basicsim\" > ./my-lte-uesoftmodem-run.sh" >> $1
+ echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --log_config.global_log_options nocolor,line_num,level --basicsim\" > ./my-lte-uesoftmodem-run.sh" >> $1
echo "chmod 775 ./my-lte-uesoftmodem-run.sh" >> $1
echo "cat ./my-lte-uesoftmodem-run.sh" >> $1
echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE; fi" >> $1
@@ -818,9 +818,9 @@ function start_l2_sim_enb {
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
if [ $LOC_S1_CONFIGURATION -eq 0 ]
then
- echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1
+ echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --noS1\" > ./my-lte-softmodem-run.sh " >> $1
else
- echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor \" > ./my-lte-softmodem-run.sh " >> $1
+ echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time \" > ./my-lte-softmodem-run.sh " >> $1
fi
echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1
echo "cat ./my-lte-softmodem-run.sh" >> $1
@@ -929,9 +929,9 @@ function start_l2_sim_ue {
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
if [ $LOC_S1_CONFIGURATION -eq 0 ]
then
- echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nums_ue_thread 1 --nokrnmod 1 --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1
+ echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nums_ue_thread 1 --nokrnmod 1 --log_config.global_log_options level,nocolor,time --noS1\" > ./my-lte-softmodem-run.sh " >> $1
else
- echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nums_ue_thread 1 --nokrnmod 1 --log_config.global_log_options level,nocolor\" > ./my-lte-softmodem-run.sh " >> $1
+ echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --nums_ue_thread 1 --nokrnmod 1 --log_config.global_log_options level,nocolor,time\" > ./my-lte-softmodem-run.sh " >> $1
fi
echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1
echo "cat ./my-lte-softmodem-run.sh" >> $1
@@ -1051,9 +1051,9 @@ function start_rf_sim_enb {
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
if [ $LOC_S1_CONFIGURATION -eq 0 ]
then
- echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --log_config.global_log_options level,nocolor --noS1 --eNBs.[0].rrc_inactivity_threshold 0\" > ./my-lte-softmodem-run.sh " >> $1
+ echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --log_config.global_log_options level,nocolor,time --noS1 --eNBs.[0].rrc_inactivity_threshold 0\" > ./my-lte-softmodem-run.sh " >> $1
else
- echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --log_config.global_log_options level,nocolor --eNBs.[0].rrc_inactivity_threshold 0 --eNBs.[0].plmn_list.[0].mnc 93\" > ./my-lte-softmodem-run.sh " >> $1
+ echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --rfsim --log_config.global_log_options level,nocolor,time --eNBs.[0].rrc_inactivity_threshold 0 --eNBs.[0].plmn_list.[0].mnc 93\" > ./my-lte-softmodem-run.sh " >> $1
fi
echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1
echo "cat ./my-lte-softmodem-run.sh" >> $1
@@ -1159,9 +1159,9 @@ function start_rf_sim_ue {
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
if [ $LOC_S1_CONFIGURATION -eq 0 ]
then
- echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1
+ echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor,time --noS1\" > ./my-lte-softmodem-run.sh " >> $1
else
- echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor\" > ./my-lte-softmodem-run.sh " >> $1
+ echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor,time\" > ./my-lte-softmodem-run.sh " >> $1
fi
echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1
echo "cat ./my-lte-softmodem-run.sh" >> $1
@@ -1281,12 +1281,12 @@ function start_rf_sim_gnb {
then
if [ $LOC_RA_SA_TEST -eq 0 ] #no RA test => use --phy-test option
then
- echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test --lowmem --noS1\" > ./my-nr-softmodem-run.sh " >> $1
+ echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test --lowmem --noS1\" > ./my-nr-softmodem-run.sh " >> $1
elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option
then
- echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra --lowmem --noS1\" > ./my-nr-softmodem-run.sh " >> $1
+ echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra --lowmem --noS1\" > ./my-nr-softmodem-run.sh " >> $1
else #SA test => use --sa option
- echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --sa --lowmem \" > ./my-nr-softmodem-run.sh " >> $1
+ echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --rfsim --sa --lowmem \" > ./my-nr-softmodem-run.sh " >> $1
fi
fi
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
@@ -1397,12 +1397,12 @@ function start_rf_sim_nr_ue {
then
if [ $LOC_RA_SA_TEST -eq 0 ] #no RA test => use --phy-test option
then
- echo "echo \"./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
+ echo "echo \"./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor,time --noS1\" > ./my-nr-softmodem-run.sh " >> $1
elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option
then
- echo "echo \"./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/\" > ./my-nr-softmodem-run.sh " >> $1
+ echo "echo \"./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor,time --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/\" > ./my-nr-softmodem-run.sh " >> $1
else #SA test => use --sa option
- echo "echo \"./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor\" > ./my-nr-softmodem-run.sh " >> $1
+ echo "echo \"./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1
fi
fi
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
@@ -1472,13 +1472,18 @@ function run_test_on_vm {
echo "############################################################"
echo "OAI CI VM script"
echo "############################################################"
- if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-l2-sim.* )) ]] || [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]]
+ if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-l2-sim.* )) ]]
then
- ENB_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#enb-ethernet#" -e "s#rf-sim#enb-ethernet#"`
+ echo "This VM test type is no longer supported in the pipeline framework"
+ return
+ fi
+ if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]]
+ then
+ ENB_VM_NAME=`echo $VM_NAME | sed -e "s#rf-sim#enb-ethernet#"`
ENB_VM_CMDS=${ENB_VM_NAME}_cmds.txt
echo "ENB_VM_NAME = $ENB_VM_NAME"
echo "ENB_VM_CMD_FILE = $ENB_VM_CMDS"
- UE_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#ue-ethernet#" -e "s#rf-sim#ue-ethernet#"`
+ UE_VM_NAME=`echo $VM_NAME | sed -e "s#rf-sim#ue-ethernet#"`
UE_VM_CMDS=${UE_VM_NAME}_cmds.txt
echo "UE_VM_NAME = $UE_VM_NAME"
echo "UE_VM_CMD_FILE = $UE_VM_CMDS"
@@ -1499,7 +1504,7 @@ function run_test_on_vm {
echo "JENKINS_WKSP = $JENKINS_WKSP"
echo "ARCHIVES_LOC = $ARCHIVES_LOC"
- if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-l2-sim.* )) ]] || [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]]
+ if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]]
then
echo "############################################################"
echo "Waiting for ENB VM to be started"
diff --git a/ci-scripts/xml_files/benetel_nsa_quectel.xml b/ci-scripts/xml_files/benetel_nsa_quectel.xml
index ed93f59e81..8c284b6673 100644
--- a/ci-scripts/xml_files/benetel_nsa_quectel.xml
+++ b/ci-scripts/xml_files/benetel_nsa_quectel.xml
@@ -61,7 +61,7 @@
Initialize_eNB
Initialize eNB
- -O ci-scripts/conf_files/benetel-4g.conf
+ -O ci-scripts/conf_files/benetel-4g.conf --log_config.global_log_options level,nocolor,time,line_num,function
0
0
lte
@@ -71,7 +71,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/benetel-5g.conf -q
+ -O ci-scripts/conf_files/benetel-5g.conf -q --log_config.global_log_options level,nocolor,time,line_num,function
1
1
nr
diff --git a/ci-scripts/xml_files/benetel_nsa_quectel_longrun.xml b/ci-scripts/xml_files/benetel_nsa_quectel_longrun.xml
index 93c0c5a00a..2e4494c819 100644
--- a/ci-scripts/xml_files/benetel_nsa_quectel_longrun.xml
+++ b/ci-scripts/xml_files/benetel_nsa_quectel_longrun.xml
@@ -63,7 +63,7 @@
Initialize_eNB
Initialize eNB
- -O ci-scripts/conf_files/benetel-4g.conf
+ -O ci-scripts/conf_files/benetel-4g.conf --log_config.global_log_options level,nocolor,time,line_num,function
0
0
lte
@@ -73,7 +73,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/benetel-5g.conf -q
+ -O ci-scripts/conf_files/benetel-5g.conf -q --log_config.global_log_options level,nocolor,time,line_num,function
1
1
nr
diff --git a/ci-scripts/xml_files/container_4g_rfsim.xml b/ci-scripts/xml_files/container_4g_rfsim.xml
index 7f13d599b8..2466f55800 100644
--- a/ci-scripts/xml_files/container_4g_rfsim.xml
+++ b/ci-scripts/xml_files/container_4g_rfsim.xml
@@ -22,7 +22,7 @@
-->
rfsim-4glte
- Testing 4G LTE RF sim in containers
+ Testing 4G LTE RF sim - Monolithic eNB
wrench
2
diff --git a/ci-scripts/xml_files/container_4g_rfsim_down.xml b/ci-scripts/xml_files/container_4g_rfsim_down.xml
index dee516d924..651447a9ca 100644
--- a/ci-scripts/xml_files/container_4g_rfsim_down.xml
+++ b/ci-scripts/xml_files/container_4g_rfsim_down.xml
@@ -22,7 +22,7 @@
-->
rfsim-4glte-down
- CleanUp 4G RF
+ CleanUp 4G RF - Monolithic eNB
trash
100011
diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim.xml b/ci-scripts/xml_files/container_5g_f1_rfsim.xml
new file mode 100644
index 0000000000..501f2fe46f
--- /dev/null
+++ b/ci-scripts/xml_files/container_5g_f1_rfsim.xml
@@ -0,0 +1,121 @@
+
+
+ rfsim-5gnr-f1
+ Testing 5G NR RF sim in containers - CU-DU F1 split
+ wrench
+
+ 100021
+ 000020
+ 000021
+ 000022
+ 000023
+ 000024
+ 020021
+ 020022
+ 030021
+ 100021
+
+
+
+
+ DeployGenObject
+ Deploy MySql Database
+ yaml_files/5g_f1_rfsimulator
+ mysql
+ 1
+
+
+
+ DeployGenObject
+ Deploy OAI 5G CoreNetwork
+ yaml_files/5g_f1_rfsimulator
+ oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn
+ 6
+
+
+
+ DeployGenObject
+ Deploy OAI 5G CU RF sim SA
+ yaml_files/5g_f1_rfsimulator
+ oai-cu
+ 7
+
+
+
+ DeployGenObject
+ Deploy OAI 5G DU RF sim SA
+ yaml_files/5g_f1_rfsimulator
+ oai-du
+ 8
+
+
+
+ DeployGenObject
+ Deploy OAI 5G NR-UE RF sim SA
+ yaml_files/5g_f1_rfsimulator
+ oai-nr-ue
+ 9
+
+
+
+ PingFromContainer
+ Ping ext-dn from NR-UE
+ rfsim5g-oai-nr-ue
+ -I oaitun_ue1 -c 20 192.168.72.135
+ 5
+
+
+
+ PingFromContainer
+ Ping NR-UE from ext-dn
+ rfsim5g-oai-ext-dn
+ -c 20 12.1.1.2
+ 5
+
+
+
+ IperfFromContainer
+ Iperf UDP Downlink
+ rfsim5g-oai-nr-ue
+ rfsim5g-oai-ext-dn
+ -B 12.1.1.2 -u -i 1 -s
+ -c 12.1.1.2 -u -i 1 -t 30 -b 200K
+
+
+
+ IperfFromContainer
+ Iperf UDP Uplink
+ rfsim5g-oai-ext-dn
+ rfsim5g-oai-nr-ue
+ -u -i 1 -s
+ -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 5K
+
+
+
+ UndeployGenObject
+ Undeploy all OAI 5G stack
+ yaml_files/5g_f1_rfsimulator
+
+
+
diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim_down.xml b/ci-scripts/xml_files/container_5g_f1_rfsim_down.xml
new file mode 100644
index 0000000000..ac3f7347ba
--- /dev/null
+++ b/ci-scripts/xml_files/container_5g_f1_rfsim_down.xml
@@ -0,0 +1,38 @@
+
+
+ rfsim-5gnr-down-f1
+ CleanUp 5G RF - CU-DU F1 split
+ trash
+
+ 100022
+
+
+
+
+ UndeployGenObject
+ Undeploy all OAI 5G stack
+ yaml_files/5g_f1_rfsimulator
+
+
+
diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml
index 11f85688ec..d930886d0b 100644
--- a/ci-scripts/xml_files/container_5g_rfsim.xml
+++ b/ci-scripts/xml_files/container_5g_rfsim.xml
@@ -22,11 +22,12 @@
-->
rfsim-5gnr
- Testing 5G NR RF sim in containers
+ Testing 5G NR RF sim - Monolithic gNB
wrench
4
100001
+ 000000
000001
000002
000003
@@ -38,11 +39,19 @@
+
+ DeployGenObject
+ Deploy MySql Database
+ yaml_files/5g_rfsimulator
+ mysql
+ 1
+
+
DeployGenObject
Deploy OAI 5G CoreNetwork
yaml_files/5g_rfsimulator
- mysql oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn
+ oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn
6
diff --git a/ci-scripts/xml_files/container_5g_rfsim_down.xml b/ci-scripts/xml_files/container_5g_rfsim_down.xml
index 57b0f67a21..9acc3f85a1 100644
--- a/ci-scripts/xml_files/container_5g_rfsim_down.xml
+++ b/ci-scripts/xml_files/container_5g_rfsim_down.xml
@@ -22,7 +22,7 @@
-->
rfsim-5gnr-down
- CleanUp 5G RF
+ CleanUp 5G RF - Monolithic gNB
trash
100002
diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml
index 0af0d9bd70..3cac13dad4 100644
--- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml
+++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml
@@ -124,6 +124,7 @@
DL
idefix
3
+ 95
single-ue
@@ -134,6 +135,7 @@
UL
idefix
1
+ 95
single-ue
diff --git a/ci-scripts/xml_files/enb_ocp_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_ocp_usrp210_band7_test_05mhz_tm1.xml
index a4caa77075..d330d826bf 100644
--- a/ci-scripts/xml_files/enb_ocp_usrp210_band7_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_ocp_usrp210_band7_test_05mhz_tm1.xml
@@ -35,7 +35,7 @@
Initialize_eNB
Initialize OCP-eNB (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
ocp
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
index 581858e44e..48ce2f298f 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml
@@ -52,7 +52,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --noS1 --eNBs.[0].rrc_inactivity_threshold 0
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --noS1 --eNBs.[0].rrc_inactivity_threshold 0 --log_config.global_log_options level,nocolor,time
@@ -63,7 +63,7 @@
Initialize_OAI_UE
Initialize OAI UE (FDD/Band7/5MHz)
- -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1
+ -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_fembms_no_s1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_fembms_no_s1.xml
index 775ef2e023..fb66ce0c66 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_fembms_no_s1.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_fembms_no_s1.xml
@@ -52,7 +52,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/5MHz/MBMS)
- -O ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf --noS1 --eNBs.[0].rrc_inactivity_threshold 0 --nokrnmod 1 --eNBs.[0].component_carriers.[0].eutra_band 7 --eNBs.[0].component_carriers.[0].downlink_frequency 2680000000 --eNBs.[0].component_carriers.[0].uplink_frequency_offset -120000000 --eNBs.[0].component_carriers.[0].mbms_dedicated_serving_cell ENABLE --MCEs.[0].mbms_sched_info.mbms_area_config_list.[0].pmch_config_list.[0].allocated_sf_end 512
+ -O ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf --noS1 --eNBs.[0].rrc_inactivity_threshold 0 --nokrnmod 1 --eNBs.[0].component_carriers.[0].eutra_band 7 --eNBs.[0].component_carriers.[0].downlink_frequency 2680000000 --eNBs.[0].component_carriers.[0].uplink_frequency_offset -120000000 --eNBs.[0].component_carriers.[0].mbms_dedicated_serving_cell ENABLE --MCEs.[0].mbms_sched_info.mbms_area_config_list.[0].pmch_config_list.[0].allocated_sf_end 512 --log_config.global_log_options level,nocolor,time
@@ -63,7 +63,7 @@
Initialize_OAI_UE
Initialize OAI UE (FDD/Band7/5MHz/MBMS)
- -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1
+ -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_mbms_no_s1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_mbms_no_s1.xml
index b841d3bab4..234f6639ce 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_mbms_no_s1.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_mbms_no_s1.xml
@@ -52,7 +52,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/5MHz/MBMS)
- -O ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf --noS1 --eNBs.[0].rrc_inactivity_threshold 0 --nokrnmod 1 --eNBs.[0].component_carriers.[0].eutra_band 7 --eNBs.[0].component_carriers.[0].downlink_frequency 2680000000 --eNBs.[0].component_carriers.[0].uplink_frequency_offset -120000000
+ -O ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf --noS1 --eNBs.[0].rrc_inactivity_threshold 0 --nokrnmod 1 --eNBs.[0].component_carriers.[0].eutra_band 7 --eNBs.[0].component_carriers.[0].downlink_frequency 2680000000 --eNBs.[0].component_carriers.[0].uplink_frequency_offset -120000000 --log_config.global_log_options level,nocolor,time
@@ -63,7 +63,7 @@
Initialize_OAI_UE
Initialize OAI UE (FDD/Band7/5MHz/MBMS)
- -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1
+ -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
index 2336f8e614..791d32eec0 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1_s1.xml
@@ -46,7 +46,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0 --log_config.global_log_options level,nocolor,time
@@ -57,7 +57,7 @@
Initialize_OAI_UE
Initialize OAI UE (FDD/Band7/5MHz)
- -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1
+ -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml
index cdba0723df..c050b38b12 100644
--- a/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band13_test_10mhz_tm1.xml
@@ -43,7 +43,7 @@
Initialize_eNB
Initialize eNB (FDD/Band13/10MHz)
- -O ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf
+ -O ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml
index 6cf5634fcf..f1a2ad2ea3 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml
@@ -34,7 +34,7 @@
Initialize_eNB
Initialize eNB (TDD/Band40/5MHz)
- -O ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml
index 5ece10d37e..2e7da714b0 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml
@@ -38,7 +38,7 @@
Initialize_eNB
Initialize eNB (TDD/Band40/5MHz)
- -O ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf --MACRLCs.[0].scheduler_mode default
+ -O ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf --MACRLCs.[0].scheduler_mode default --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml
index b1d87e598e..d2877fc01e 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml
@@ -36,7 +36,7 @@
Initialize_eNB
Initialize eNB (TDD/Band40/10MHz/info)
- -O ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml
index d75704aceb..ef9fee0dca 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml
@@ -37,7 +37,7 @@
Initialize_eNB
Initialize eNB (TDD/Band40/20MHz/info)
- -O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml
index a6530a920c..adf03d802a 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml
@@ -36,7 +36,7 @@
Initialize_eNB
Initialize eNB (TDD/Band40/20MHz/info)
- -O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf --MACRLCs.[0].scheduler_mode default
+ -O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf --MACRLCs.[0].scheduler_mode default --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml b/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml
index 08cef07c8c..d8793b63e6 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_tracer.xml
@@ -33,7 +33,7 @@
Initialize_eNB
Initialize eNB (TDD/Band40/5MHz) with T Tracer on
- -O ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf --T_stdout 0
+ -O ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf --T_stdout 0 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml
index ec6090c00c..2fe0e17611 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml
@@ -34,7 +34,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xml
index 73d1216199..aedd980c34 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xml
@@ -71,7 +71,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/5MHz) for RRC Inactivity Timer testing -- no FlexRan Ctl
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_w_flexran.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_w_flexran.xml
index 6ee9247ef3..b488637483 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_w_flexran.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_w_flexran.xml
@@ -83,7 +83,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/5MHz) for RRC Inactivity Timer testing -- with FlexRan Ctl
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml
index 1ee223d1c7..5b3a23dbfb 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml
@@ -34,7 +34,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/10MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf --eNBs.[0].component_carriers.[0].drx_Config_present prRelease
+ -O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf --eNBs.[0].component_carriers.[0].drx_Config_present prRelease --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1_cdrx.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1_cdrx.xml
index a76f188bc4..82e0a32f6a 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1_cdrx.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1_cdrx.xml
@@ -35,7 +35,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/10MHz) with CDRX
- -O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf --eNBs.[0].component_carriers.[0].drx_Config_present prSetup
+ -O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf --eNBs.[0].component_carriers.[0].drx_Config_present prSetup --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml
index adde118128..b25f75d2d3 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml
@@ -34,7 +34,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/20MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml
index c2a48037ba..68aca3a26d 100644
--- a/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml
+++ b/ci-scripts/xml_files/f1_usrp210_band7_test_05mhz.xml
@@ -42,14 +42,14 @@
Initialize_eNB
Initialize DU (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
1
Initialize_eNB
Initialize CU (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/cu.band7.tm1.25PRB.conf
+ -O ci-scripts/conf_files/cu.band7.tm1.25PRB.conf --log_config.global_log_options level,nocolor,time
0
diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml
index 8d028df433..4e8fe45c36 100644
--- a/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml
+++ b/ci-scripts/xml_files/f1_usrp210_band7_test_10mhz.xml
@@ -42,14 +42,14 @@
Initialize_eNB
Initialize DU (FDD/Band7/10MHz)
- -O ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf
+ -O ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
1
Initialize_eNB
Initialize CU (FDD/Band7/10MHz)
- -O ci-scripts/conf_files/cu.band7.tm1.50PRB.conf
+ -O ci-scripts/conf_files/cu.band7.tm1.50PRB.conf --log_config.global_log_options level,nocolor,time
0
diff --git a/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml b/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml
index 061b87294b..22e2aed34c 100644
--- a/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml
+++ b/ci-scripts/xml_files/f1_usrp210_band7_test_20mhz.xml
@@ -42,14 +42,14 @@
Initialize_eNB
Initialize DU (FDD/Band7/20MHz)
- -O ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf
+ -O ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
1
Initialize_eNB
Initialize CU (FDD/Band7/20MHz)
- -O ci-scripts/conf_files/cu.band7.tm1.100PRB.conf
+ -O ci-scripts/conf_files/cu.band7.tm1.100PRB.conf --log_config.global_log_options level,nocolor,time
0
diff --git a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml
index ae7a4c92be..57a66ece76 100644
--- a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml
+++ b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml
@@ -59,7 +59,7 @@
Initialize_eNB
Initialize eNB
- -O ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6
+ -O ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 --log_config.global_log_options level,nocolor,time
0
0
lte
@@ -107,6 +107,7 @@
DL
nrmodule2_quectel
5
+ 95
single-ue
@@ -117,6 +118,7 @@
UL
nrmodule2_quectel
5
+ 95
single-ue
diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
index 2516af9429..045466a8ad 100644
--- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
+++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
@@ -61,7 +61,7 @@
Initialize_eNB
Initialize eNB
- -O ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6
+ -O ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 --log_config.global_log_options level,nocolor,time,line_num,function
0
0
lte
@@ -74,7 +74,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1
+ -O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time,line_num,function
1
1
nr
diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml
index 52cf1ec6e8..6fe23e022b 100644
--- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml
+++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml
@@ -81,7 +81,7 @@
Initialize_eNB
Initialize eNB
- -O ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6
+ -O ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 --log_config.global_log_options level,nocolor,time,line_num,function
0
0
lte
@@ -94,7 +94,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1
+ -O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time,line_num,function
1
1
nr
diff --git a/ci-scripts/xml_files/fr1_nsa_base.xml b/ci-scripts/xml_files/fr1_nsa_base.xml
index 96bdc79f0f..dec24f7d93 100644
--- a/ci-scripts/xml_files/fr1_nsa_base.xml
+++ b/ci-scripts/xml_files/fr1_nsa_base.xml
@@ -70,7 +70,7 @@
Initialize_eNB
Initialize eNB
- -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time,line_num,function
0
0
lte
@@ -80,7 +80,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E
+ -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E --log_config.global_log_options level,nocolor,time,line_num,function
1
1
nr
diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml
index 6414f09b6b..5e5853ab7f 100644
--- a/ci-scripts/xml_files/fr1_nsa_quectel.xml
+++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml
@@ -64,7 +64,7 @@
Initialize_eNB
Initialize eNB
- -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time,line_num,function
0
0
lte
@@ -75,7 +75,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q --RUs.[0].sdr_addrs "serial=30C51D4"
+ -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q --RUs.[0].sdr_addrs "serial=30C51D4" --log_config.global_log_options level,nocolor,time,line_num,function
1
1
nr
@@ -119,6 +119,7 @@
DL
idefix
3
+ 95
single-ue
@@ -129,6 +130,7 @@
UL
idefix
1
+ 95
single-ue
diff --git a/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml
index 2263f731c5..68d2f94af9 100644
--- a/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml
+++ b/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml
@@ -81,7 +81,7 @@
Initialize_eNB
Initialize eNB
- -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time,line_num,function
0
0
lte
@@ -92,7 +92,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q
+ -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q --log_config.global_log_options level,nocolor,time,line_num,function
1
1
nr
diff --git a/ci-scripts/xml_files/fr1_nsa_quectel_long.xml b/ci-scripts/xml_files/fr1_nsa_quectel_long.xml
index 21ff7a63c5..c3801068a9 100644
--- a/ci-scripts/xml_files/fr1_nsa_quectel_long.xml
+++ b/ci-scripts/xml_files/fr1_nsa_quectel_long.xml
@@ -61,7 +61,7 @@
Initialize_eNB
Initialize eNB
- -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time,line_num,function
0
0
lte
@@ -72,7 +72,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q
+ -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q --log_config.global_log_options level,nocolor,time,line_num,function
1
1
nr
diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml b/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml
index 6c359abb8d..774d5751c5 100644
--- a/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml
+++ b/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml
@@ -42,7 +42,7 @@
Initialize_OAI_UE
Initialize OAI UE
nr
- --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "serial=30C51D1" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 -E
+ --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "serial=30C51D1" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 -E --log_config.global_log_options level,nocolor,time
@@ -54,7 +54,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa -q --usrp-tx-thread-config 1
+ -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time
0
0
nr
diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml
index cd79e49f2c..55852ad79b 100644
--- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml
+++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml
@@ -42,7 +42,7 @@
Initialize_OAI_UE
Initialize OAI UE (N310)
nr
- --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation
+ --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation --log_config.global_log_options level,nocolor,time
@@ -54,7 +54,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa --usrp-tx-thread-config 1
+ -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time
0
0
nr
diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml
index d527737b3c..509fef9e8a 100644
--- a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml
+++ b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml
@@ -42,7 +42,7 @@
Initialize_OAI_UE
Initialize OAI UE (X300)
nr
- --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "addr=192.168.60.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation
+ --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "addr=192.168.60.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation --log_config.global_log_options level,nocolor,time
@@ -54,7 +54,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa --usrp-tx-thread-config 1
+ -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time
0
0
nr
diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml
index 4db5bb64a5..72b4c0a273 100644
--- a/ci-scripts/xml_files/fr1_sa_quectel.xml
+++ b/ci-scripts/xml_files/fr1_sa_quectel.xml
@@ -58,7 +58,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1
+ -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time
0
0
nr
@@ -84,9 +84,9 @@
Ping
Ping: 20pings in 20sec
nrmodule2_quectel
- -c 20
+ -c 40
1
- 15
+ 20
@@ -95,7 +95,7 @@
nrmodule2_quectel
-c 100 -i 0,2
1
- 15
+ 20
@@ -105,6 +105,7 @@
DL
nrmodule2_quectel
5
+ 95
single-ue
@@ -115,6 +116,7 @@
UL
nrmodule2_quectel
5
+ 95
single-ue
diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml
index 2088678707..f465b320b6 100644
--- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml
+++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml
@@ -58,7 +58,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1
+ -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time
0
0
nr
diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml
index a9922bec52..dabe53f233 100644
--- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml
+++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml
@@ -65,7 +65,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1
+ -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time
0
0
nr
@@ -91,9 +91,9 @@
Ping
Ping: 20pings in 20sec
nrmodule2_quectel
- -c 20
+ -c 40
1
- 15
+ 20
@@ -104,6 +104,7 @@
DL
nrmodule2_quectel
5
+ 95
single-ue
@@ -113,6 +114,7 @@
DL
nrmodule2_quectel
5
+ 95
single-ue
@@ -122,6 +124,7 @@
DL
nrmodule2_quectel
5
+ 95
single-ue
@@ -131,6 +134,7 @@
DL
nrmodule2_quectel
5
+ 95
single-ue
@@ -140,6 +144,7 @@
DL
nrmodule2_quectel
5
+ 95
single-ue
diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml
index 4b2400a4ac..c28791e555 100644
--- a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml
+++ b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml
@@ -67,7 +67,7 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1
+ -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time
0
0
nr
diff --git a/ci-scripts/xml_files/fr1_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/fr1_usrp210_band7_test_05mhz_tm1.xml
index ea25d5b694..4d78b5b0a9 100644
--- a/ci-scripts/xml_files/fr1_usrp210_band7_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/fr1_usrp210_band7_test_05mhz_tm1.xml
@@ -41,7 +41,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].plmn_list.[0].mcc 311 --eNBs.[0].plmn_list.[0].mnc 480 --eNBs.[0].plmn_list.[0].mnc_length 3 --eNBs.[0].component_carriers.[0].Nid_cell 10
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].plmn_list.[0].mcc 311 --eNBs.[0].plmn_list.[0].mnc 480 --eNBs.[0].plmn_list.[0].mnc_length 3 --eNBs.[0].component_carriers.[0].Nid_cell 10 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml b/ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml
index b1e9697be2..a74dd26137 100644
--- a/ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml
+++ b/ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml
@@ -33,7 +33,7 @@
Initialize_eNB
Initialize gNB USRP
- -O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test
+ -O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test --log_config.global_log_options level,nocolor,time
NR
@@ -52,7 +52,7 @@
Initialize_OAI_UE
Initialize NR UE USRP
- --phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 50 --rrc_config_path . --dlsch-parallel 4
+ --phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 50 --rrc_config_path . --dlsch-parallel 4 --log_config.global_log_options level,nocolor,time
NR
diff --git a/ci-scripts/xml_files/gnb_nr_ue_usrp_run_multi_thread.xml b/ci-scripts/xml_files/gnb_nr_ue_usrp_run_multi_thread.xml
index 2c44ead8ea..f91077aacf 100644
--- a/ci-scripts/xml_files/gnb_nr_ue_usrp_run_multi_thread.xml
+++ b/ci-scripts/xml_files/gnb_nr_ue_usrp_run_multi_thread.xml
@@ -33,7 +33,7 @@
Initialize_eNB
Initialize gNB USRP (Tx-Write-Threading enabled)
- -O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test --usrp-tx-thread-config 1
+ -O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time
NR
@@ -52,7 +52,7 @@
Initialize_OAI_UE
Initialize NR UE USRP
- --phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 75 --rrc_config_path . --dlsch-parallel 4
+ --phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 75 --rrc_config_path . --dlsch-parallel 4 --log_config.global_log_options level,nocolor,time
NR
diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml
index 9e798afdc4..9365d7f12e 100644
--- a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml
+++ b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml
@@ -33,7 +33,7 @@
Initialize_eNB
Initialize gNB USRP
- -O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test -q -U 787200 -T 106 -t 28 -D 130175 -m 28 -M 106
+ -O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test -q -U 787200 -T 106 -t 28 -D 130175 -m 28 -M 106 --log_config.global_log_options level,nocolor,time
NR
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml
index 06763aa995..715dc0e315 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_05mhz.xml
@@ -35,14 +35,14 @@
Initialize_eNB
Initialize RRU (TDD/Band40)
- -O ci-scripts/conf_files/rru.tdd.band40.conf --RUs.[0].max_rxgain 125
+ -O ci-scripts/conf_files/rru.tdd.band40.conf --RUs.[0].max_rxgain 125 --log_config.global_log_options level,nocolor,time
0
Initialize_eNB
Initialize RCC (TDD/Band40/5MHz)
- -O ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf
+ -O ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf --log_config.global_log_options level,nocolor,time
1
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml
index 9224c67fe7..f755a7ec96 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_10mhz.xml
@@ -38,14 +38,14 @@
Initialize_eNB
Initialize RRU (TDD/Band40)
- -O ci-scripts/conf_files/rru.tdd.band40.conf --RUs.[0].max_rxgain 120
+ -O ci-scripts/conf_files/rru.tdd.band40.conf --RUs.[0].max_rxgain 120 --log_config.global_log_options level,nocolor,time
0
Initialize_eNB
Initialize RCC (TDD/Band40/10MHz/info)
- -O ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf
+ -O ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf --log_config.global_log_options level,nocolor,time
1
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml
index cb54ba31ee..4e84c47faf 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_test_20mhz.xml
@@ -36,14 +36,14 @@
Initialize_eNB
Initialize RRU (TDD/Band40)
- -O ci-scripts/conf_files/rru.tdd.band40.conf
+ -O ci-scripts/conf_files/rru.tdd.band40.conf --log_config.global_log_options level,nocolor,time
0
Initialize_eNB
Initialize RCC (TDD/Band40/20MHz/info)
- -O ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf --MACRLCs.[0].scheduler_mode default
+ -O ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf --MACRLCs.[0].scheduler_mode default --log_config.global_log_options level,nocolor,time
1
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml
index d72633159d..fc3fe29992 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_05mhz.xml
@@ -35,14 +35,14 @@
Initialize_eNB
Initialize RRU (FDD/Band7)
- -O ci-scripts/conf_files/rru.fdd.band7.conf --RUs.[0].max_rxgain 125
+ -O ci-scripts/conf_files/rru.fdd.band7.conf --RUs.[0].max_rxgain 125 --log_config.global_log_options level,nocolor,time
1
Initialize_eNB
Initialize RCC (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
0
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml
index 98e1aed575..8aa07a1c43 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_10mhz.xml
@@ -35,14 +35,14 @@
Initialize_eNB
Initialize RRU (FDD/Band7)
- -O ci-scripts/conf_files/rru.fdd.band7.conf --RUs.[0].max_rxgain 120
+ -O ci-scripts/conf_files/rru.fdd.band7.conf --RUs.[0].max_rxgain 120 --log_config.global_log_options level,nocolor,time
1
Initialize_eNB
Initialize RCC (FDD/Band7/10MHz)
- -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf
+ -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
0
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml
index 2cf4e0fbf5..01f26bdf0f 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band7_test_20mhz.xml
@@ -35,14 +35,14 @@
Initialize_eNB
Initialize RRU (FDD/Band7)
- -O ci-scripts/conf_files/rru.fdd.band7.conf
+ -O ci-scripts/conf_files/rru.fdd.band7.conf --log_config.global_log_options level,nocolor,time
1
Initialize_eNB
Initialize RCC (FDD/Band7/20MHz)
- -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf
+ -O ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
0
diff --git a/ci-scripts/xml_files/inria/enb_ue_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/inria/enb_ue_usrp210_band7_test_05mhz_tm1.xml
index ae348b6b25..c2fb2e8e2e 100644
--- a/ci-scripts/xml_files/inria/enb_ue_usrp210_band7_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/inria/enb_ue_usrp210_band7_test_05mhz_tm1.xml
@@ -46,7 +46,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0 --RUs.[0].max_rxgain 120 --eNBs.[0].component_carriers.[0].pusch_p0_Nominal -90 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96 --eNBs.[0].tracking_area_code 600 --eNBs.[0].plmn_list.[0].mnc 95
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0 --RUs.[0].max_rxgain 120 --eNBs.[0].component_carriers.[0].pusch_p0_Nominal -90 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96 --eNBs.[0].tracking_area_code 600 --eNBs.[0].plmn_list.[0].mnc 95 --log_config.global_log_options level,nocolor,time
@@ -57,7 +57,7 @@
Initialize_OAI_UE
Initialize OAI UE (FDD/Band7/5MHz)
- -C 2680000000 -r 25 --ue-rxgain 130 --ue-txgain 1 --ue-max-power -6 --ue-scan-carrier --nokrnmod 1
+ -C 2680000000 -r 25 --ue-rxgain 130 --ue-txgain 1 --ue-max-power -6 --ue-scan-carrier --nokrnmod 1 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/inria/enb_ue_usrp210_band7_test_05mhz_tm1_nos1.xml b/ci-scripts/xml_files/inria/enb_ue_usrp210_band7_test_05mhz_tm1_nos1.xml
index b77c6273e6..d5bdc5a42d 100644
--- a/ci-scripts/xml_files/inria/enb_ue_usrp210_band7_test_05mhz_tm1_nos1.xml
+++ b/ci-scripts/xml_files/inria/enb_ue_usrp210_band7_test_05mhz_tm1_nos1.xml
@@ -52,7 +52,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --noS1 --eNBs.[0].rrc_inactivity_threshold 0 --RUs.[0].max_rxgain 120 --eNBs.[0].component_carriers.[0].pusch_p0_Nominal -90 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96 --eNBs.[0].tracking_area_code 600 --eNBs.[0].plmn_list.[0].mnc 95
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --noS1 --eNBs.[0].rrc_inactivity_threshold 0 --RUs.[0].max_rxgain 120 --eNBs.[0].component_carriers.[0].pusch_p0_Nominal -90 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96 --eNBs.[0].tracking_area_code 600 --eNBs.[0].plmn_list.[0].mnc 95 --log_config.global_log_options level,nocolor,time
@@ -63,7 +63,7 @@
Initialize_OAI_UE
Initialize OAI UE (FDD/Band7/5MHz)
- -C 2680000000 -r 25 --ue-rxgain 130 --ue-txgain 1 --ue-max-power -6 --ue-scan-carrier --nokrnmod 1 --noS1
+ -C 2680000000 -r 25 --ue-rxgain 130 --ue-txgain 1 --ue-max-power -6 --ue-scan-carrier --nokrnmod 1 --noS1 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/inria/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/inria/enb_usrp210_band7_test_05mhz_tm1.xml
index df41385f83..d0f94dc560 100644
--- a/ci-scripts/xml_files/inria/enb_usrp210_band7_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/inria/enb_usrp210_band7_test_05mhz_tm1.xml
@@ -93,7 +93,7 @@
Initialize_eNB
Initialize eNB (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0 --RUs.[0].max_rxgain 120 --eNBs.[0].component_carriers.[0].pusch_p0_Nominal -90 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96 --eNBs.[0].tracking_area_code 600 --eNBs.[0].plmn_list.[0].mnc 95
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0 --RUs.[0].max_rxgain 120 --eNBs.[0].component_carriers.[0].pusch_p0_Nominal -90 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96 --eNBs.[0].tracking_area_code 600 --eNBs.[0].plmn_list.[0].mnc 95 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/inria/enb_usrp210_band7_x2_ho_test_05Mhz_tm1.xml b/ci-scripts/xml_files/inria/enb_usrp210_band7_x2_ho_test_05Mhz_tm1.xml
index 852f48c370..b4b20c1239 100644
--- a/ci-scripts/xml_files/inria/enb_usrp210_band7_x2_ho_test_05Mhz_tm1.xml
+++ b/ci-scripts/xml_files/inria/enb_usrp210_band7_x2_ho_test_05Mhz_tm1.xml
@@ -64,7 +64,7 @@
Initialize_eNB
Initialize eNB #0 (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0 --RUs.[0].max_rxgain 120 --eNBs.[0].component_carriers.[0].pusch_p0_Nominal -90 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96 --eNBs.[0].tracking_area_code 600 --eNBs.[0].plmn_list.[0].mnc 95 --eNBs.[0].enable_measurement_reports yes --eNBs.[0].enable_x2 yes --eNBs.[0].nr_cellid 123456
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0 --RUs.[0].max_rxgain 120 --eNBs.[0].component_carriers.[0].pusch_p0_Nominal -90 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96 --eNBs.[0].tracking_area_code 600 --eNBs.[0].plmn_list.[0].mnc 95 --eNBs.[0].enable_measurement_reports yes --eNBs.[0].enable_x2 yes --eNBs.[0].nr_cellid 123456 --log_config.global_log_options level,nocolor,time
0
0
@@ -72,7 +72,7 @@
Initialize_eNB
Initialize eNB #1 (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0 --RUs.[0].max_rxgain 120 --eNBs.[0].component_carriers.[0].pusch_p0_Nominal -90 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96 --eNBs.[0].tracking_area_code 600 --eNBs.[0].plmn_list.[0].mnc 95 --eNBs.[0].enable_measurement_reports yes --eNBs.[0].enable_x2 yes --eNBs.[0].nr_cellid 98765
+ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf --eNBs.[0].rrc_inactivity_threshold 0 --RUs.[0].max_rxgain 120 --eNBs.[0].component_carriers.[0].pusch_p0_Nominal -90 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96 --eNBs.[0].tracking_area_code 600 --eNBs.[0].plmn_list.[0].mnc 95 --eNBs.[0].enable_measurement_reports yes --eNBs.[0].enable_x2 yes --eNBs.[0].nr_cellid 98765 --log_config.global_log_options level,nocolor,time
1
1
diff --git a/ci-scripts/xml_files/multi_rru_band38_test_10mhz_tm1.xml b/ci-scripts/xml_files/multi_rru_band38_test_10mhz_tm1.xml
index cca14c0696..3875a3df03 100644
--- a/ci-scripts/xml_files/multi_rru_band38_test_10mhz_tm1.xml
+++ b/ci-scripts/xml_files/multi_rru_band38_test_10mhz_tm1.xml
@@ -42,7 +42,7 @@
Initialize_eNB
Initialize RCC (TDD/Band38/10MHz)
- -O ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf --noS1
+ -O ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf --noS1 --log_config.global_log_options level,nocolor,time
0
0
@@ -50,7 +50,7 @@
Initialize_eNB
Initialize Master RRU (TDD/Band38/10MHz)
- -O ci-scripts/conf_files/rru.band38.tm1.master.conf --noS1
+ -O ci-scripts/conf_files/rru.band38.tm1.master.conf --noS1 --log_config.global_log_options level,nocolor,time
1
1
@@ -58,7 +58,7 @@
Initialize_eNB
Initialize Slave RRU (TDD/Band38/10MHz)
- -O ci-scripts/conf_files/rru.band38.tm1.slave.conf --noS1
+ -O ci-scripts/conf_files/rru.band38.tm1.slave.conf --noS1 --log_config.global_log_options level,nocolor,time
2
2
diff --git a/ci-scripts/xml_files/test_case_list_template.xml b/ci-scripts/xml_files/test_case_list_template.xml
index 69024805be..1a8871c037 100644
--- a/ci-scripts/xml_files/test_case_list_template.xml
+++ b/ci-scripts/xml_files/test_case_list_template.xml
@@ -42,37 +42,37 @@
Initialize_eNB
Initialize eNB (FDD/Band1/5MHz/info)
- -O enb.band7.tm1.50PRB.usrpb210.conf
+ -O enb.band7.tm1.50PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
Initialize_eNB
Initialize eNB (FDD/Band1/10MHz/info)
- -O 10M.band1.FDD.info.conf
+ -O 10M.band1.FDD.info.conf --log_config.global_log_options level,nocolor,time
Initialize_eNB
Initialize eNB (FDD/Band1/20MHz/info)
- -O 20M.band1.FDD.info.conf
+ -O 20M.band1.FDD.info.conf --log_config.global_log_options level,nocolor,time
Initialize_eNB
Initialize eNB (TDD/Band38/5MHz/info)
- -O 5M.band38.TDD.info.conf
+ -O 5M.band38.TDD.info.conf --log_config.global_log_options level,nocolor,time
Initialize_eNB
Initialize eNB (TDD/Band38/10MHz/info)
- -O 10M.band38.TDD.info.conf
+ -O 10M.band38.TDD.info.conf --log_config.global_log_options level,nocolor,time
Initialize_eNB
Initialize eNB (TDD/Band38/20MHz/info)
- -O 20M.band38.TDD.info.conf
+ -O 20M.band38.TDD.info.conf --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml
index d3e36f603e..49ccfbca14 100644
--- a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml
+++ b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml
@@ -34,7 +34,7 @@
Initialize_OAI_UE
Initialize OAI UE -- sniffing Orange frequency
- -C 816000000 -r 50 --ue-rxgain 135 --ue-scan-carrier --no-L2-connect --nokrnmod 1
+ -C 816000000 -r 50 --ue-rxgain 135 --ue-scan-carrier --no-L2-connect --nokrnmod 1 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml
index 3f6441e06e..fdc70a9bdd 100644
--- a/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml
+++ b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml
@@ -34,7 +34,7 @@
Initialize_OAI_UE
Initialize OAI UE -- sniffing SFR frequency
- -C 806000000 -r 50 --ue-rxgain 130 --ue-scan-carrier --no-L2-connect --nokrnmod 1
+ -C 806000000 -r 50 --ue-rxgain 130 --ue-scan-carrier --no-L2-connect --nokrnmod 1 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/xml_files/x2ho_enb_usrp210_band13_test_05mhz_tm1.xml b/ci-scripts/xml_files/x2ho_enb_usrp210_band13_test_05mhz_tm1.xml
index 7256c985c5..14872c9f8f 100644
--- a/ci-scripts/xml_files/x2ho_enb_usrp210_band13_test_05mhz_tm1.xml
+++ b/ci-scripts/xml_files/x2ho_enb_usrp210_band13_test_05mhz_tm1.xml
@@ -61,7 +61,7 @@
Initialize_eNB
Initialize Master eNB (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
0
0
@@ -69,7 +69,7 @@
Initialize_eNB
Initialize Slave eNB (FDD/Band7/5MHz)
- -O ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf
+ -O ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time
1
1
diff --git a/ci-scripts/yaml_files/4g_rfsimulator/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator/docker-compose.yml
index 32e4bd41e8..e852643ab9 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator/docker-compose.yml
@@ -221,7 +221,7 @@ services:
FLEXRAN_ENABLED: 'no'
FLEXRAN_INTERFACE_NAME: eth0
FLEXRAN_IPV4_ADDRESS: 192.168.61.10
- USE_ADDITIONAL_OPTIONS: --rfsim
+ USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
healthcheck:
test: /bin/bash -c "pgrep lte-softmodem"
interval: 10s
@@ -248,7 +248,7 @@ services:
OPC: 'c42449363bbad02b66d16bc975d77cc1'
MSISDN: '001011234561010'
HPLMN: 20896
- USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1
+ USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --log_config.global_log_options level,nocolor,time
healthcheck:
test: /bin/bash -c "pgrep lte-uesoftmodem"
interval: 10s
diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/amf-healthcheck.sh b/ci-scripts/yaml_files/5g_f1_rfsimulator/amf-healthcheck.sh
new file mode 100755
index 0000000000..8bfdee2aac
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/amf-healthcheck.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+set -eo pipefail
+
+STATUS=0
+AMF_PORT_FOR_NGAP=38412
+AMF_PORT_FOR_N11_HTTP=80
+AMF_IP_NGAP_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_NGAP | grep inet | awk {'print $2'})
+AMF_IP_N11_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_N11 | grep inet | awk {'print $2'})
+N2_PORT_STATUS=$(netstat -Snpl | grep -o "$AMF_IP_NGAP_INTERFACE:$AMF_PORT_FOR_NGAP")
+N11_PORT_STATUS=$(netstat -tnpl | grep -o "$AMF_IP_N11_INTERFACE:$AMF_PORT_FOR_N11_HTTP")
+#Check if entrypoint properly configured the conf file and no parameter is unset (optional)
+NB_UNREPLACED_AT=`cat /openair-amf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
+
+if [ $NB_UNREPLACED_AT -ne 0 ]; then
+ STATUS=1
+ echo "Healthcheck error: configuration file is not configured properly"
+fi
+
+if [[ -z $N2_PORT_STATUS ]]; then
+ STATUS=1
+ echo "Healthcheck error: N2 SCTP port $AMF_PORT_FOR_NGAP is not listening"
+fi
+
+if [[ -z $N11_PORT_STATUS ]]; then
+ STATUS=1
+ echo "Healthcheck error: N11/SBI TCP/HTTP port $AMF_PORT_FOR_N11_HTTP is not listening"
+fi
+
+#host="${MYSQL_SERVER}"
+#user="${MYSQL_USER:-root}"
+#export MYSQL_PWD="${MYSQL_PASS}"
+
+#args=(
+# -h"$host"
+# -u"$user"
+# --silent
+#)
+
+#if ! command -v mysql &> /dev/null; then
+# echo "Installing mysql command"
+# apt update
+# apt-get -y install mysql-client
+#else
+# if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then
+# database_check=$(mysql -h$host -u$user -D oai_db --silent -e "SELECT * FROM users;")
+# if [[ -z $database_check ]]; then
+# echo "Healthcheck error: oai_db not populated"
+# STATUS=1
+# fi
+# STATUS=0
+# else
+# echo "Healthcheck error: Mysql port inactive"
+# STATUS=1
+# fi
+#fi
+
+exit $STATUS
diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml
new file mode 100644
index 0000000000..eb15aef0d8
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml
@@ -0,0 +1,339 @@
+version: '3.8'
+services:
+ oai-nrf:
+ container_name: "rfsim5g-oai-nrf"
+ image: oai-nrf:latest
+ environment:
+ - NRF_INTERFACE_NAME_FOR_SBI=eth0
+ - NRF_INTERFACE_PORT_FOR_SBI=80
+ - NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
+ - NRF_API_VERSION=v1
+ - INSTANCE=0
+ - PID_DIRECTORY=/var/run
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.130
+ volumes:
+ - ./nrf-healthcheck.sh:/openair-nrf/bin/nrf-healthcheck.sh
+ healthcheck:
+ test: /bin/bash -c "/openair-nrf/bin/nrf-healthcheck.sh"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ mysql:
+ container_name: "rfsim5g-mysql"
+ image: mysql:5.7
+ volumes:
+ - ./oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
+ - ./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: 10s
+ timeout: 5s
+ retries: 5
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.131
+ oai-amf:
+ container_name: "rfsim5g-oai-amf"
+ image: oai-amf:latest
+ environment:
+ - TZ=Europe/paris
+ - INSTANCE=0
+ - PID_DIRECTORY=/var/run
+ - MCC=208
+ - MNC=99
+ - REGION_ID=128
+ - AMF_SET_ID=1
+ - SERVED_GUAMI_MCC_0=208
+ - SERVED_GUAMI_MNC_0=99
+ - SERVED_GUAMI_REGION_ID_0=128
+ - SERVED_GUAMI_AMF_SET_ID_0=1
+ - SERVED_GUAMI_MCC_1=460
+ - SERVED_GUAMI_MNC_1=11
+ - SERVED_GUAMI_REGION_ID_1=10
+ - SERVED_GUAMI_AMF_SET_ID_1=1
+ - PLMN_SUPPORT_MCC=208
+ - PLMN_SUPPORT_MNC=99
+ - PLMN_SUPPORT_TAC=0x0001
+ - SST_0=1
+ - SD_0=1
+ - SST_1=1
+ - SD_1=12
+ - AMF_INTERFACE_NAME_FOR_NGAP=eth0
+ - AMF_INTERFACE_NAME_FOR_N11=eth0
+ - SMF_INSTANCE_ID_0=1
+ - SMF_FQDN_0=oai-smf
+ - SMF_IPV4_ADDR_0=0.0.0.0
+ - SMF_HTTP_VERSION_0=v1
+ - SELECTED_0=true
+ - SMF_INSTANCE_ID_1=2
+ - SMF_FQDN_1=oai-smf
+ - SMF_IPV4_ADDR_1=0.0.0.0
+ - SMF_HTTP_VERSION_1=v1
+ - SELECTED_1=false
+ - MYSQL_SERVER=192.168.71.131
+ - MYSQL_USER=root
+ - MYSQL_PASS=linux
+ - MYSQL_DB=oai_db
+ - OPERATOR_KEY=c42449363bbad02b66d16bc975d77cc1
+ - NRF_IPV4_ADDRESS=192.168.71.130
+ - NRF_PORT=80
+ - NF_REGISTRATION=yes
+ - SMF_SELECTION=yes
+ - USE_FQDN_DNS=yes
+ - NRF_API_VERSION=v1
+ - NRF_FQDN=oai-nrf
+ - EXTERNAL_AUSF=no
+ - AUSF_IPV4_ADDRESS=0.0.0.0
+ - AUSF_PORT=80
+ - AUSF_API_VERSION=v1
+ - AUSF_FQDN=localhost
+ depends_on:
+ - oai-nrf
+ - mysql
+ volumes:
+ - ./amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh
+ healthcheck:
+ test: /bin/bash -c "/openair-amf/bin/amf-healthcheck.sh"
+ interval: 10s
+ timeout: 15s
+ retries: 5
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.132
+ oai-smf:
+ container_name: "rfsim5g-oai-smf"
+ image: oai-smf:latest
+ entrypoint: /bin/bash -c "/openair-smf/bin/oai_smf -c /openair-smf/bin/oai-smf.conf -o"
+ environment:
+ - TZ=Europe/Paris
+ - INSTANCE=0
+ - PID_DIRECTORY=/var/run
+ - SMF_INTERFACE_NAME_FOR_N4=eth0
+ - SMF_INTERFACE_NAME_FOR_SBI=eth0
+ - SMF_INTERFACE_PORT_FOR_SBI=80
+ - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
+ - SMF_API_VERSION=v1
+ - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129
+ - DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4
+ - AMF_IPV4_ADDRESS=0.0.0.0
+ - AMF_PORT=80
+ - AMF_API_VERSION=v1
+ - AMF_FQDN=oai-amf
+ - UDM_IPV4_ADDRESS=127.0.0.1
+ - UDM_PORT=80
+ - UDM_API_VERSION=v1
+ - UDM_FQDN=localhost
+ - UPF_IPV4_ADDRESS=192.168.71.134
+ - UPF_FQDN_0=oai-spgwu
+ - NRF_IPV4_ADDRESS=192.168.71.130
+ - NRF_PORT=80
+ - NRF_API_VERSION=v1
+ - NRF_FQDN=oai-nrf
+ - REGISTER_NRF=yes
+ - DISCOVER_UPF=yes
+ - USE_FQDN_DNS=yes
+ depends_on:
+ - oai-nrf
+ - oai-amf
+ volumes:
+ - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh
+ - ./oai-smf.conf:/openair-smf/bin/oai-smf.conf
+ healthcheck:
+ test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.133
+ oai-spgwu:
+ container_name: "rfsim5g-oai-spgwu"
+ image: oai-spgwu-tiny:latest
+ environment:
+ - TZ=Europe/Paris
+ - PID_DIRECTORY=/var/run
+ - SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP=eth0
+ - SGW_INTERFACE_NAME_FOR_SX=eth0
+ - PGW_INTERFACE_NAME_FOR_SGI=eth0
+ - NETWORK_UE_NAT_OPTION=yes
+ - NETWORK_UE_IP=12.1.1.0/24
+ - SPGWC0_IP_ADDRESS=192.168.71.133
+ - BYPASS_UL_PFCP_RULES=no
+ - MCC=208
+ - MNC=99
+ - MNC03=099
+ - TAC=1
+ - GTP_EXTENSION_HEADER_PRESENT=yes
+ - GW_ID=1
+ - REALM=openairinterface.org
+ - ENABLE_5G_FEATURES=yes
+ - REGISTER_NRF=yes
+ - USE_FQDN_NRF=yes
+ - UPF_FQDN_5G=oai-spgwu
+ - NRF_IPV4_ADDRESS=192.168.71.130
+ - NRF_PORT=80
+ - NRF_API_VERSION=v1
+ - NRF_FQDN=oai-nrf
+ - NSSAI_SST_0=1
+ - NSSAI_SD_0=1
+ - DNN_0=oai
+ depends_on:
+ - oai-nrf
+ - oai-smf
+ cap_add:
+ - NET_ADMIN
+ - SYS_ADMIN
+ cap_drop:
+ - ALL
+ privileged: true
+ volumes:
+ - ./spgwu-healthcheck.sh:/openair-spgwu-tiny/bin/spgwu-healthcheck.sh
+ healthcheck:
+ test: /bin/bash -c "/openair-spgwu-tiny/bin/spgwu-healthcheck.sh"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.134
+ traffic_net:
+ ipv4_address: 192.168.72.134
+ oai-ext-dn:
+ image: ubuntu:bionic
+ privileged: true
+ container_name: rfsim5g-oai-ext-dn
+ entrypoint: /bin/bash -c \
+ "apt update; apt install -y procps iptables iproute2 iperf iputils-ping;"\
+ "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
+ "ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
+ depends_on:
+ - oai-spgwu
+ networks:
+ traffic_net:
+ ipv4_address: 192.168.72.135
+ healthcheck:
+ test: /bin/bash -c "ping -c 2 192.168.72.134"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ oai-cu:
+ image: oai-gnb:develop
+ privileged: true
+ container_name: rfsim5g-oai-cu
+ environment:
+ RFSIMULATOR: server
+ USE_SA_CU: 'yes'
+ GNB_NAME: cu-rfsim
+ TAC: 1
+ MCC: '208'
+ MNC: '99'
+ MNC_LENGTH: 2
+ NSSAI_SST: 1
+ NSSAI_SD0: 1
+ NSSAI_SD1: 112233
+ AMF_IP_ADDRESS: 192.168.71.132
+ GNB_NGA_IF_NAME: eth0
+ GNB_NGA_IP_ADDRESS: 192.168.71.136
+ GNB_NGU_IF_NAME: eth0
+ GNB_NGU_IP_ADDRESS: 192.168.71.136
+ F1_IF_NAME: eth0
+ F1_CU_IP_ADDRESS: 192.168.71.136
+ F1_DU_IP_ADDRESS: 192.168.71.138
+ F1_CU_D_PORT: 2153
+ F1_DU_D_PORT: 2153
+ USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
+ depends_on:
+ - oai-ext-dn
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.136
+ healthcheck:
+ test: /bin/bash -c "pgrep nr-softmodem"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ oai-du:
+ image: oai-gnb:develop
+ privileged: true
+ container_name: rfsim5g-oai-du
+ environment:
+ RFSIMULATOR: server
+ USE_SA_TDD_CU: 'yes'
+ GNB_NAME: du-rfsim
+ TAC: 1
+ MCC: '208'
+ MNC: '99'
+ MNC_LENGTH: 2
+ NSSAI_SST: 1
+ NSSAI_SD0: 1
+ NSSAI_SD1: 112233
+ AMF_IP_ADDRESS: 192.168.71.132
+ GNB_NGA_IF_NAME: eth0
+ GNB_NGA_IP_ADDRESS: 192.168.71.138
+ GNB_NGU_IF_NAME: eth0
+ GNB_NGU_IP_ADDRESS: 192.168.71.138
+ F1_IF_NAME: eth0
+ F1_CU_IP_ADDRESS: 192.168.71.136
+ F1_DU_IP_ADDRESS: 192.168.71.138
+ F1_CU_D_PORT: 2153
+ F1_DU_D_PORT: 2153
+ USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
+ depends_on:
+ - oai-cu
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.138
+ healthcheck:
+ test: /bin/bash -c "pgrep nr-softmodem"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ oai-nr-ue:
+ image: oai-nr-ue:develop
+ privileged: true
+ container_name: rfsim5g-oai-nr-ue
+ environment:
+ RFSIMULATOR: 192.168.71.138
+ FULL_IMSI: '208990100001100'
+ FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
+ OPC: 'C42449363BBAD02B66D16BC975D77CC1'
+ DNN: oai
+ NSSAI_SST: 1
+ NSSAI_SD: 1
+ USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time
+ depends_on:
+ - oai-du
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.137
+ healthcheck:
+ test: /bin/bash -c "pgrep nr-uesoftmodem"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+
+networks:
+ public_net:
+ driver: bridge
+ name: rfsim5g-oai-public-net
+ ipam:
+ config:
+ - subnet: 192.168.71.128/26
+ driver_opts:
+ com.docker.network.bridge.name: "rfsim5g-public"
+ traffic_net:
+ driver: bridge
+ name: rfsim5g-oai-traffic_net-net
+ ipam:
+ config:
+ - subnet: 192.168.72.128/26
+ driver_opts:
+ com.docker.network.bridge.name: "rfsim5g-traffic"
diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/mysql-healthcheck.sh b/ci-scripts/yaml_files/5g_f1_rfsimulator/mysql-healthcheck.sh
new file mode 100755
index 0000000000..c92efb9f00
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/mysql-healthcheck.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+set -eo pipefail
+
+if [ "$MYSQL_ROOT_PASSWORD" ] && [ -z "$MYSQL_USER" ] && [ -z "$MYSQL_PASSWORD" ]; then
+ echo >&2 'Healthcheck error: cannot determine root password (and MYSQL_USER and MYSQL_PASSWORD were not set)'
+ exit 0
+fi
+
+host="$(hostname --ip-address || echo '127.0.0.1')"
+user="${MYSQL_USER:-root}"
+export MYSQL_PWD="${MYSQL_PASSWORD:-$MYSQL_ROOT_PASSWORD}"
+
+args=(
+ # force mysql to not use the local "mysqld.sock" (test "external" connectivity)
+ -h"$host"
+ -u"$user"
+ --silent
+)
+
+STATUS=0
+if command -v mysqladmin &> /dev/null; then
+ if mysqladmin "${args[@]}" ping > /dev/null; then
+ database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;")
+ if [[ -z $database_check ]]; then
+ echo "Healthcheck error: oai_db not populated"
+ STATUS=1
+ fi
+ STATUS=0
+ else
+ echo "Healthcheck error: Mysql port inactive"
+ STATUS=1
+ fi
+else
+ if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then
+ database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;")
+ if [[ -z $database_check ]]; then
+ echo "Healthcheck error: oai_db not populated"
+ STATUS=1
+ fi
+ STATUS=0
+ else
+ echo "Healthcheck error: Mysql port inactive"
+ STATUS=1
+ fi
+fi
+exit $STATUS
diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/nrf-healthcheck.sh b/ci-scripts/yaml_files/5g_f1_rfsimulator/nrf-healthcheck.sh
new file mode 100755
index 0000000000..3479c092e8
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/nrf-healthcheck.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -eo pipefail
+
+STATUS=0
+NRF_IP_SBI_INTERFACE=$(ifconfig $NRF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'})
+NRF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$NRF_IP_SBI_INTERFACE:$NRF_INTERFACE_PORT_FOR_SBI")
+#Check if entrypoint properly configured the conf file and no parameter is unset(optional)
+NB_UNREPLACED_AT=`cat /openair-nrf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
+
+if [ $NB_UNREPLACED_AT -ne 0 ]; then
+ STATUS=1
+ echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
+fi
+
+if [[ -z $NRF_SBI_PORT_STATUS ]]; then
+ STATUS=1
+ echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $NRF_INTERFACE_PORT_FOR_SBI is not listening."
+fi
+
+exit $STATUS
\ No newline at end of file
diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/oai-smf.conf b/ci-scripts/yaml_files/5g_f1_rfsimulator/oai-smf.conf
new file mode 100644
index 0000000000..0c83ab8be9
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/oai-smf.conf
@@ -0,0 +1,133 @@
+################################################################################
+# 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
+################################################################################
+
+SMF =
+{
+ FQDN = "oai-smf-svc";
+ INSTANCE = 0; # 0 is the default
+ PID_DIRECTORY = "/var/run"; # /var/run is the default
+
+ INTERFACES :
+ {
+ N4 :
+ {
+ # SMF binded interface for N4 communication (UPF)
+ INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE
+ IPV4_ADDRESS = "read";
+ };
+
+ SBI :
+ {
+ # SMF binded interface for SBI interface (e.g., communication with AMF, UDM)
+ INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE
+ IPV4_ADDRESS = "read";
+ PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80)
+ HTTP2_PORT = 9090; # YOUR NETWORK CONFIG HERE
+ API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE
+ };
+
+ };
+
+
+ # Pool of UE assigned IP addresses
+ # Do not make IP pools overlap
+ # first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF
+ IP_ADDRESS_POOL :
+ {
+ IPV4_LIST = (
+ {RANGE = "12.1.1.2 - 12.1.1.128";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
+ {RANGE = "12.1.1.129 - 12.1.1.224";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
+ {RANGE = "10.10.10.2 - 10.10.10.253";} # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE.
+
+ );
+ IPV6_LIST = (
+ {PREFIX = "2001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
+ {PREFIX = "3001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
+ {PREFIX = "4001:1:2::/64";} # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE.
+ );
+ };
+
+ DNN_LIST = (
+ # IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6}
+ {DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1},
+ {DNN_NI = "carrier.com"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1},
+ {DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 0; IPV6_POOL = -1}
+ );
+
+ # DNS address communicated to UEs
+ DEFAULT_DNS_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE
+ DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE
+ DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE
+ DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE
+
+ SUPPORT_FEATURES:
+ {
+ # STRING, {"yes", "no"},
+ REGISTER_NRF = "yes"; # Set to yes if SMF resgisters to an NRF
+ DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection
+ FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no",
+ # but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling
+ USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDM
+ USE_FQDN_DNS = "yes"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN
+ }
+
+ AMF :
+ {
+ IPV4_ADDRESS = "0.0.0.0"; # YOUR AMF CONFIG HERE
+ PORT = 80; # YOUR AMF CONFIG HERE (default: 80)
+ API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE
+ FQDN = "oai-amf" # YOUR AMF FQDN CONFIG HERE
+ };
+
+ UDM :
+ {
+ IPV4_ADDRESS = "127.0.0.1"; # YOUR UDM CONFIG HERE
+ PORT = 80; # YOUR UDM CONFIG HERE (default: 80)
+ API_VERSION = "v1"; # YOUR UDM API VERSION FOR SBI CONFIG HERE
+ FQDN = "localhost" # YOUR UDM FQDN CONFIG HERE
+ };
+
+ NRF :
+ {
+ IPV4_ADDRESS = "192.168.71.130"; # YOUR NRF CONFIG HERE
+ PORT = 80; # YOUR NRF CONFIG HERE (default: 80)
+ API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE
+ FQDN = "oai-nrf" # YOUR NRF FQDN CONFIG HERE
+ };
+
+ UPF_LIST = (
+ {IPV4_ADDRESS = "192.168.71.134" ; FQDN = "oai-spgwu"} # YOUR UPF CONFIG HERE
+ );
+
+ LOCAL_CONFIGURATION :
+ {
+ SESSION_MANAGEMENT_SUBSCRIPTION_LIST = (
+ { NSSAI_SST = 222, NSSAI_SD = "123", DNN = "default", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1,
+ QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
+ QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"},
+ { NSSAI_SST = 1; NSSAI_SD = "1", DNN = "oai", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1,
+ QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT",
+ QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"}
+ );
+ };
+
+};
+
diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/oai_db.sql b/ci-scripts/yaml_files/5g_f1_rfsimulator/oai_db.sql
new file mode 100755
index 0000000000..fbd7907a71
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/oai_db.sql
@@ -0,0 +1,217 @@
+-- MySQL dump 10.13 Distrib 5.5.46, for debian-linux-gnu (x86_64)
+--
+-- Host: localhost Database: oai_db
+-- ------------------------------------------------------
+-- Server version 5.5.46-0ubuntu0.14.04.2
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `apn`
+--
+
+DROP TABLE IF EXISTS `apn`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `apn` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `apn-name` varchar(60) NOT NULL,
+ `pdn-type` enum('IPv4','IPv6','IPv4v6','IPv4_or_IPv6') NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `apn-name` (`apn-name`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `apn`
+--
+
+LOCK TABLES `apn` WRITE;
+/*!40000 ALTER TABLE `apn` DISABLE KEYS */;
+/*!40000 ALTER TABLE `apn` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `mmeidentity`
+--
+
+DROP TABLE IF EXISTS `mmeidentity`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `mmeidentity` (
+ `idmmeidentity` int(11) NOT NULL AUTO_INCREMENT,
+ `mmehost` varchar(255) DEFAULT NULL,
+ `mmerealm` varchar(200) DEFAULT NULL,
+ `UE-Reachability` tinyint(1) NOT NULL COMMENT 'Indicates whether the MME supports UE Reachability Notifcation',
+ PRIMARY KEY (`idmmeidentity`)
+) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `mmeidentity`
+--
+
+LOCK TABLES `mmeidentity` WRITE;
+/*!40000 ALTER TABLE `mmeidentity` DISABLE KEYS */;
+INSERT INTO `mmeidentity` VALUES (2,'mme2.openair4G.eur','openair4G.eur',0),(1,'nano.openair4G.eur','openair4G.eur',0),(5,'abeille.openair4G.eur','openair4G.eur',0),(4,'yang.openair4G.eur','openair4G.eur',0),(3,'mme3.openair4G.eur','openair4G.eur',0),(6,'calisson.openair4G.eur','openair4G.eur',0);
+/*!40000 ALTER TABLE `mmeidentity` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `pdn`
+--
+
+DROP TABLE IF EXISTS `pdn`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `pdn` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `apn` varchar(60) NOT NULL,
+ `pdn_type` enum('IPv4','IPv6','IPv4v6','IPv4_or_IPv6') NOT NULL DEFAULT 'IPv4',
+ `pdn_ipv4` varchar(15) DEFAULT '0.0.0.0',
+ `pdn_ipv6` varchar(45) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT '0:0:0:0:0:0:0:0',
+ `aggregate_ambr_ul` int(10) unsigned DEFAULT '50000000',
+ `aggregate_ambr_dl` int(10) unsigned DEFAULT '100000000',
+ `pgw_id` int(11) NOT NULL,
+ `users_imsi` varchar(15) NOT NULL,
+ `qci` tinyint(3) unsigned NOT NULL DEFAULT '9',
+ `priority_level` tinyint(3) unsigned NOT NULL DEFAULT '15',
+ `pre_emp_cap` enum('ENABLED','DISABLED') DEFAULT 'DISABLED',
+ `pre_emp_vul` enum('ENABLED','DISABLED') DEFAULT 'DISABLED',
+ `LIPA-Permissions` enum('LIPA-prohibited','LIPA-only','LIPA-conditional') NOT NULL DEFAULT 'LIPA-only',
+ PRIMARY KEY (`id`,`pgw_id`,`users_imsi`),
+ KEY `fk_pdn_pgw1_idx` (`pgw_id`),
+ KEY `fk_pdn_users1_idx` (`users_imsi`)
+) ENGINE=MyISAM AUTO_INCREMENT=60 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `pdn`
+--
+
+LOCK TABLES `pdn` WRITE;
+/*!40000 ALTER TABLE `pdn` DISABLE KEYS */;
+INSERT INTO `pdn` VALUES (1,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(41,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'20834123456789',9,15,'DISABLED','ENABLED','LIPA-only'),(40,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'20810000001234',9,15,'DISABLED','ENABLED','LIPA-only'),(42,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'31002890832150',9,15,'DISABLED','ENABLED','LIPA-only'),(16,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(43,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'001010123456789',9,15,'DISABLED','ENABLED','LIPA-only'),(2,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(3,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(4,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(5,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(6,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(7,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(8,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(9,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(10,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(11,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(12,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(13,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(14,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(15,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(17,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(18,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(19,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(20,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(21,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(22,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001100',9,15,'DISABLED','ENABLED','LIPA-only'),(23,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001101',9,15,'DISABLED','ENABLED','LIPA-only'),(24,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001102',9,15,'DISABLED','ENABLED','LIPA-only'),(25,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001103',9,15,'DISABLED','ENABLED','LIPA-only'),(26,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001104',9,15,'DISABLED','ENABLED','LIPA-only'),(27,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001105',9,15,'DISABLED','ENABLED','LIPA-only'),(28,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001106',9,15,'DISABLED','ENABLED','LIPA-only'),(29,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001107',9,15,'DISABLED','ENABLED','LIPA-only'),(30,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001108',9,15,'DISABLED','ENABLED','LIPA-only'),(31,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001109',9,15,'DISABLED','ENABLED','LIPA-only'),(32,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001110',9,15,'DISABLED','ENABLED','LIPA-only'),(33,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001111',9,15,'DISABLED','ENABLED','LIPA-only'),(34,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001112',9,15,'DISABLED','ENABLED','LIPA-only'),(35,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001113',9,15,'DISABLED','ENABLED','LIPA-only'),(44,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001113',9,15,'DISABLED','ENABLED','LIPA-only'),(45,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001112',9,15,'DISABLED','ENABLED','LIPA-only'),(46,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001111',9,15,'DISABLED','ENABLED','LIPA-only'),(47,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(48,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000008',9,15,'DISABLED','ENABLED','LIPA-only'),(49,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000009',9,15,'DISABLED','ENABLED','LIPA-only'),(50,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000010',9,15,'DISABLED','ENABLED','LIPA-only'),(51,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000011',9,15,'DISABLED','ENABLED','LIPA-only'),(52,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000012',9,15,'DISABLED','ENABLED','LIPA-only'),(53,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000013',9,15,'DISABLED','ENABLED','LIPA-only'),(54,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000014',9,15,'DISABLED','ENABLED','LIPA-only'),(55,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000015',9,15,'DISABLED','ENABLED','LIPA-only'),(56,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001118',9,15,'DISABLED','ENABLED','LIPA-only'),(57,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001121',9,15,'DISABLED','ENABLED','LIPA-only'),(58,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001120',9,15,'DISABLED','ENABLED','LIPA-only'),(59,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001119',9,15,'DISABLED','ENABLED','LIPA-only');
+/*!40000 ALTER TABLE `pdn` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `pgw`
+--
+
+DROP TABLE IF EXISTS `pgw`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `pgw` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `ipv4` varchar(15) NOT NULL,
+ `ipv6` varchar(39) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `ipv4` (`ipv4`),
+ UNIQUE KEY `ipv6` (`ipv6`)
+) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `pgw`
+--
+
+LOCK TABLES `pgw` WRITE;
+/*!40000 ALTER TABLE `pgw` DISABLE KEYS */;
+INSERT INTO `pgw` VALUES (1,'127.0.0.1','0:0:0:0:0:0:0:1'),(2,'192.168.56.101',''),(3,'10.0.0.2','0');
+/*!40000 ALTER TABLE `pgw` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `terminal-info`
+--
+
+DROP TABLE IF EXISTS `terminal-info`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `terminal-info` (
+ `imei` varchar(15) NOT NULL,
+ `sv` varchar(2) NOT NULL,
+ UNIQUE KEY `imei` (`imei`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `terminal-info`
+--
+
+LOCK TABLES `terminal-info` WRITE;
+/*!40000 ALTER TABLE `terminal-info` DISABLE KEYS */;
+/*!40000 ALTER TABLE `terminal-info` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `users`
+--
+
+DROP TABLE IF EXISTS `users`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `users` (
+ `imsi` varchar(15) NOT NULL COMMENT 'IMSI is the main reference key.',
+ `msisdn` varchar(46) DEFAULT NULL COMMENT 'The basic MSISDN of the UE (Presence of MSISDN is optional).',
+ `imei` varchar(15) DEFAULT NULL COMMENT 'International Mobile Equipment Identity',
+ `imei_sv` varchar(2) DEFAULT NULL COMMENT 'International Mobile Equipment Identity Software Version Number',
+ `ms_ps_status` enum('PURGED','NOT_PURGED') DEFAULT 'PURGED' COMMENT 'Indicates that ESM and EMM status are purged from MME',
+ `rau_tau_timer` int(10) unsigned DEFAULT '120',
+ `ue_ambr_ul` bigint(20) unsigned DEFAULT '50000000' COMMENT 'The Maximum Aggregated uplink MBRs to be shared across all Non-GBR bearers according to the subscription of the user.',
+ `ue_ambr_dl` bigint(20) unsigned DEFAULT '100000000' COMMENT 'The Maximum Aggregated downlink MBRs to be shared across all Non-GBR bearers according to the subscription of the user.',
+ `access_restriction` int(10) unsigned DEFAULT '60' COMMENT 'Indicates the access restriction subscription information. 3GPP TS.29272 #7.3.31',
+ `mme_cap` int(10) unsigned zerofill DEFAULT NULL COMMENT 'Indicates the capabilities of the MME with respect to core functionality e.g. regional access restrictions.',
+ `mmeidentity_idmmeidentity` int(11) NOT NULL DEFAULT '0',
+ `key` varbinary(16) NOT NULL DEFAULT '0' COMMENT 'UE security key',
+ `RFSP-Index` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'An index to specific RRM configuration in the E-UTRAN. Possible values from 1 to 256',
+ `urrp_mme` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'UE Reachability Request Parameter indicating that UE activity notification from MME has been requested by the HSS.',
+ `sqn` bigint(20) unsigned zerofill NOT NULL,
+ `rand` varbinary(16) NOT NULL,
+ `OPc` varbinary(16) DEFAULT NULL COMMENT 'Can be computed by HSS',
+ PRIMARY KEY (`imsi`,`mmeidentity_idmmeidentity`),
+ KEY `fk_users_mmeidentity_idx1` (`mmeidentity_idmmeidentity`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `users`
+--
+
+LOCK TABLES `users` WRITE;
+/*!40000 ALTER TABLE `users` DISABLE KEYS */;
+INSERT INTO `users` VALUES ('20834123456789','380561234567','35609204079300',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,'+�E��ų\0�,IH��H',0,0,00000000000000000096,'Px�X \Z1��x��','^��K�����FeU���'),('20810000001234','33611123456','35609204079299',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000281454575616225,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','�4�s@���z��~�'),('31002890832150','33638060059','35611302209414',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012416,'`�F�݆��D��ϛ���','�4�s@���z��~�'),('001010123456789','33600101789','35609204079298',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'\0 \n\r',1,0,00000000000000000351,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','L�*\\�����^��]� '),('208930000000001','33638030001','35609204079301',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208950000000002','33638050002','35609204079502',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000020471,'\0 \n\r','�4�s@���z��~�'),('208950000000003','33638050003','35609204079503',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012343,'\0 \n\r','�4�s@���z��~�'),('208950000000004','33638050004','35609204079504',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000005','33638050005','35609204079505',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000001','33638050001','35609204079501',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208950000000006','33638050006','35609204079506',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000007','33638050007','35609204079507',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208930000000002','33638030002','35609204079302',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000003','33638030003','35609204079303',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000004','33638030004','35609204079304',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000005','33638030005','35609204079305',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000006','33638030006','35609204079306',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000007','33638030007','35609204079307',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000007','33638040007','35609204079407',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000006','33638040006','35609204079406',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000005','33638040005','35609204079405',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000004','33638040004','35609204079404',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000003','33638040003','35609204079403',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000002','33638040002','35609204079402',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000001','33638040001','35609204079401',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208920100001100','33638020001','35609204079201',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001101','33638020001','35609204079201',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204937234,'\0 \n\r','�$I6;��+f�k�u�|�'),('208920100001102','33638020002','35609204079202',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001103','33638020003','35609204079203',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001104','33638020004','35609204079204',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001105','33638020005','35609204079205',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001106','33638020006','35609204079206',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000000000000006103,'ebd07771ace8677a','�$I6;��+f�k�u�|�'),('208920100001107','33638020007','35609204079207',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001108','33638020008','35609204079208',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001109','33638020009','35609204079209',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001110','33638020010','35609204079210',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001111','33638030011','35609304079211',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001112','33638030012','35609304079212',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001113','33638030013','35609304079213',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006263,'�SNܒ�Iv��e�6','�4�s@���z��~�'),('208950000000008','33638050008','35609204079508',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000009','33638050009','35609204079509',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000010','33638050010','35609204079510',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000011','33638050011','35609204079511',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000012','33638050012','35609204079512',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000013','33638050013','35609204079513',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000014','33638050014','35609204079514',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000015','33638050015','35609204079515',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000000000,'3536663032363164','�4�s@���z��~�'),('208920100001118','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204934762,'~?03�u-%�ey�y�','�$I6;��+f�k�u�|�'),('208920100001121','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'&��@xg�]���\n��Vp','�$I6;��+f�k�u�|�'),('208920100001119','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'269482407867805d','�$I6;��+f�k�u�|�'),('208920100001120','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'3236393438323430','�$I6;��+f�k�u�|�');
+INSERT INTO `users` VALUES ('208990100001100','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1);
+INSERT INTO `users` VALUES ('208950000000031','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000032','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000033','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000034','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000035','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000036','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000037','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000038','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000039','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000040','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+/*!40000 ALTER TABLE `users` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2016-06-28 11:41:40
diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/smf-healthcheck.sh b/ci-scripts/yaml_files/5g_f1_rfsimulator/smf-healthcheck.sh
new file mode 100755
index 0000000000..d9ff7608e8
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/smf-healthcheck.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+set -eo pipefail
+
+STATUS=0
+SMF_IP_SBI_INTERFACE=$(ifconfig $SMF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'})
+SMF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$SMF_IP_SBI_INTERFACE:$SMF_INTERFACE_PORT_FOR_SBI")
+
+#Check if entrypoint properly configured the conf file and no parameter is unset(optional)
+#NB_UNREPLACED_AT=`cat /openair-smf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
+
+#if [ $NB_UNREPLACED_AT -ne 0 ]; then
+# STATUS=-1
+# echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
+#fi
+#
+if [[ -z $SMF_SBI_PORT_STATUS ]]; then
+ STATUS=-1
+ echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $SMF_INTERFACE_PORT_FOR_SBI is not listening."
+fi
+
+exit $STATUS
diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/spgwu-healthcheck.sh b/ci-scripts/yaml_files/5g_f1_rfsimulator/spgwu-healthcheck.sh
new file mode 100755
index 0000000000..0e3b67ee7e
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/spgwu-healthcheck.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -eo pipefail
+
+STATUS=0
+SGW_PORT_FOR_S1U_S12_S4_UP=2152
+SGW_PORT_FOR_SX=8805
+SGW_IP_S1U_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP | grep inet | awk {'print $2'})
+SGW_IP_SX_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_SX | grep inet | awk {'print $2'})
+S1U_S12_S4_UP_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_S1U_INTERFACE:$SGW_PORT_FOR_S1U_S12_S4_UP")
+SX_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_SX_INTERFACE:$SGW_PORT_FOR_SX")
+#Check if entrypoint properly configured the conf file and no parameter is unset (optional)
+NB_UNREPLACED_AT=`cat /openair-spgwu/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
+if [ $NB_UNREPLACED_AT -ne 0 ]; then
+ STATUS=1
+ echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
+fi
+
+if [[ -z $S1U_S12_S4_UP_PORT_STATUS ]]; then
+ STATUS=1
+ echo "Healthcheck error: UNHEALTHY S1U port $SGW_PORT_FOR_S1U_S12_S4_UP is not listening."
+fi
+
+if [[ -z $SX_PORT_STATUS ]]; then
+ STATUS=1
+ echo "Healthcheck error: UNHEALTHY SX port $SGW_PORT_FOR_SX is not listening."
+fi
+
+exit $STATUS
\ No newline at end of file
diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md
index 915b71296f..5c384b3202 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator/README.md
+++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md
@@ -88,7 +88,9 @@ $ docker logout
**Just `docker-compose up -d` WILL NOT WORK!**
-All the following commands **SHALL** be run from the `ci-scripts/yaml_files/5g_rfsimulator` folder.
+All the following commands **SHALL** be run from the `ci-scripts/yaml_files/5g_rfsimulator` folder for a deployment with monolithic gNB.
+
+For a deployment with the gNB split in CU and DU components, the following commands **SHALL** be run from the `ci-scripts/yaml_files/5g_f1_rfsimulator` folder.
## 2.1. Deploy OAI 5G Core Network ##
@@ -148,6 +150,9 @@ rfsim5g-traffic: flags=4163 mtu 1500
**CAUTION: To execute this 2nd step, the whole `CN5G` SHALL be in `healthy` state (especially the `mysql` container).**
+The gNB can be deployed either in monolithic mode, or in CU/DU split mode.
+- For a deployment with a monolithic gNB:
+
```bash
$ docker-compose up -d oai-gnb
rfsim5g-oai-nrf is up-to-date
@@ -155,7 +160,16 @@ rfsim5g-oai-spgwu is up-to-date
rfsim5g-oai-ext-dn is up-to-date
Creating rfsim5g-oai-gnb ... done
```
+- For a deployment with the gNB split in CU and DU components:
+```bash
+#Deployment of the CU
+$ docker-compose up -d oai-cu
+```
+```bash
+#Deployment of the DU
+$ docker-compose up -d oai-du
+```
Wait for a bit.
```bash
diff --git a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml
index 31d64f35dc..952da8087d 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml
@@ -244,7 +244,7 @@ services:
GNB_NGA_IP_ADDRESS: 192.168.71.136
GNB_NGU_IF_NAME: eth0
GNB_NGU_IP_ADDRESS: 192.168.71.136
- USE_ADDITIONAL_OPTIONS: --sa -E --rfsim
+ USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time
depends_on:
- oai-ext-dn
networks:
@@ -267,7 +267,7 @@ services:
DNN: oai
NSSAI_SST: 1
NSSAI_SD: 1
- USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod
+ USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
diff --git a/ci-scripts/yaml_files/fr1_enb_mono_fdd_tim/docker-compose.yml b/ci-scripts/yaml_files/fr1_enb_mono_fdd_tim/docker-compose.yml
index 2df277d78b..b7dd3d0296 100644
--- a/ci-scripts/yaml_files/fr1_enb_mono_fdd_tim/docker-compose.yml
+++ b/ci-scripts/yaml_files/fr1_enb_mono_fdd_tim/docker-compose.yml
@@ -27,7 +27,7 @@ services:
FLEXRAN_ENABLED: 'no'
FLEXRAN_INTERFACE_NAME: eth0
FLEXRAN_IPV4_ADDRESS: CI_FLEXRAN_CTL_IP_ADDR
- USE_ADDITIONAL_OPTIONS: '--RUs.[0].max_rxgain 115 --RUs.[0].max_pdschReferenceSignalPower -27 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96'
+ USE_ADDITIONAL_OPTIONS: --RUs.[0].max_rxgain 115 --RUs.[0].max_pdschReferenceSignalPower -27 --eNBs.[0].component_carriers.[0].pucch_p0_Nominal -96 --log_config.global_log_options level,nocolor,time
volumes:
- /dev:/dev
networks:
diff --git a/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml b/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml
index 9bd08aeabc..92ccdf8a0a 100644
--- a/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml
+++ b/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml
@@ -31,6 +31,7 @@ services:
FLEXRAN_INTERFACE_NAME: eth0
FLEXRAN_IPV4_ADDRESS: 192.168.18.210
THREAD_PARALLEL_CONFIG: PARALLEL_SINGLE_THREAD
+ USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,time,line_num,function
volumes:
- /dev:/dev
networks:
diff --git a/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml
index 4ae51158ac..c6096956a8 100644
--- a/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml
+++ b/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml
@@ -26,7 +26,7 @@ services:
FLEXRAN_INTERFACE_NAME: eth0
FLEXRAN_IPV4_ADDRESS: 192.168.18.210
THREAD_PARALLEL_CONFIG: PARALLEL_RU_L1_TRX_SPLIT
- USE_ADDITIONAL_OPTIONS: -E -q --RUs.[0].sdr_addrs serial=30C51D4
+ USE_ADDITIONAL_OPTIONS: -E -q --RUs.[0].sdr_addrs serial=30C51D4 --log_config.global_log_options level,nocolor,time,line_num,function
volumes:
- /dev:/dev
networks:
diff --git a/cmake_targets/.gitignore b/cmake_targets/.gitignore
new file mode 100644
index 0000000000..6d6cdd29a6
--- /dev/null
+++ b/cmake_targets/.gitignore
@@ -0,0 +1,3 @@
+.usim.*
+.ue_emm.nvram*
+.ue.nvram*
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index f513ac0563..bf3bb2b017 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -359,6 +359,10 @@ set(CMAKE_C_FLAGS_DEBUG "${debugOpt} -O0")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${debugOpt} -O2")
set(CMAKE_C_FLAGS_RELEASE "-O3")
+# Enable assert() for RelWithDebInfo builds
+string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
+string(REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+
set(GIT_BRANCH "UNKNOWN")
set(GIT_COMMIT_HASH "UNKNOWN")
set(GIT_COMMIT_DATE "UNKNOWN")
@@ -396,14 +400,13 @@ set (FIRMWARE_VERSION "No svn information")
add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"")
add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
-#add_definitions("-DEMIT_ASN_DEBUG=1")
# Debug related options
#########################################
-add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug")
-add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug")
-add_boolean_option(MSG_PRINT False "print debug messages")
+add_boolean_option(ASN_EMIT_DEBUG False "ASN1 coder/decoder Debug")
+add_boolean_option(ASN_THREAD_SAFE True "ASN1 coder/decoder Debug")
+add_boolean_option(MSG_PRINT True "print debug messages")
add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
add_boolean_option(XER_PRINT False "print XER Format")
add_boolean_option(RRC_MSG_PRINT False "print RRC messages")
@@ -600,10 +603,13 @@ set(M2AP_ASN_DIR ${M2AP_DIR}/MESSAGES/ASN1/${M2AP_RELEASE})
set(M2AP_C_DIR ${asn1_generated_dir}/M2AP_${M2AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
+
set(m2ap_cmd ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps -DEMIT_ASN_DEBUG=1" "${M2AP_C_DIR}")
+
compile_asn1("${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" "${m2ap_cmd}" m2_flag)
file(GLOB M2AP_source ${M2AP_C_DIR}/*.c)
+
add_library(M2AP_LIB
${M2AP_source}
${M2AP_DIR}/m2ap_common.c
@@ -755,6 +761,7 @@ set(F1AP_ASN_FILES
${F1AP_ASN_DIR}/F1AP-Containers.asn
)
+
set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
set(f1_cmd ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" "${F1AP_ASN_GENERATED_C_DIR}")
@@ -773,6 +780,7 @@ include_directories ("${F1AP_DIR}")
file(GLOB F1AP_C_FILES ${F1AP_DIR}/*.c)
add_library(F1AP ${F1AP_C_FILES} )
+
# Hardware dependant options
###################################
add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4")
@@ -1011,6 +1019,7 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE
##########################
#add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
#add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
+add_definitions(-DNEW_GTPU=1)
##########################
# RRC LAYER OPTIONS
@@ -1467,6 +1476,7 @@ set(NFAPI_USER_SRC
${NFAPI_USER_DIR}/nfapi.c
${NFAPI_USER_DIR}/nfapi_pnf.c
${NFAPI_USER_DIR}/nfapi_vnf.c
+ ${NFAPI_USER_DIR}/gnb_ind_vars.c
)
add_library(NFAPI_USER_LIB ${NFAPI_USER_SRC})
add_dependencies(NFAPI_USER_LIB rrc_flag)
@@ -2020,6 +2030,7 @@ set(NR_L2_SRC_UE
${NR_UE_RRC_DIR}/L2_interface_ue.c
${NR_UE_RRC_DIR}/main_ue.c
${NR_UE_RRC_DIR}/rrc_UE.c
+ ${NR_UE_RRC_DIR}/rrc_nsa.c
)
set (MAC_SRC
@@ -2064,6 +2075,7 @@ set (MAC_NR_SRC
set (MAC_SRC_UE
${PHY_INTERFACE_DIR}/phy_stub_UE.c
+ ${PHY_INTERFACE_DIR}/queue_t.c
${MAC_DIR}/main_ue.c
${MAC_DIR}/ue_procedures.c
${MAC_DIR}/ra_procedures.c
@@ -2777,6 +2789,7 @@ add_executable(lte-softmodem
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
+ ${PHY_INTERFACE_DIR}/queue_t.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${XFORMSINTERFACE_SOURCE}
@@ -2788,7 +2801,7 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer)
target_link_libraries (lte-softmodem
-Wl,--start-group
- RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
+ RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
-Wl,--end-group z dl)
@@ -2821,6 +2834,7 @@ add_executable(ocp-enb
${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
+ ${PHY_INTERFACE_DIR}/queue_t.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
@@ -2831,7 +2845,7 @@ add_dependencies(ocp-enb rrc_flag s1ap_flag x2_flag oai_iqplayer coding params_l
target_link_libraries (ocp-enb
-Wl,--start-group
- RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
+ RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
-Wl,--end-group z dl)
@@ -2926,9 +2940,8 @@ if (NOT ${NOS1})
endif()
target_link_libraries (lte-uesoftmodem
-Wl,--start-group
- RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP F1AP_LIB
-
- NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
+ RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB
+ SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
-Wl,--end-group z dl)
@@ -2962,6 +2975,7 @@ add_executable(nr-softmodem
${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
+ ${PHY_INTERFACE_DIR}/queue_t.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
@@ -3002,6 +3016,7 @@ add_executable(ocp-gnb
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
+ ${PHY_INTERFACE_DIR}/queue_t.c
${XFORMS_SOURCE_NR}
${T_SOURCE}
${CONFIG_SOURCES}
@@ -3205,14 +3220,16 @@ add_executable(nr_dlsim
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
+ ${NR_UE_RRC_DIR}/rrc_nsa.c
${NFAPI_USER_DIR}/nfapi.c
${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
+ ${PHY_INTERFACE_DIR}/queue_t.c
${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
target_link_libraries(nr_dlsim
- -Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB -Wl,--end-group
+ -Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl
)
target_compile_definitions(nr_dlsim PUBLIC -DPHYSICAL_SIMULATOR)
@@ -3225,13 +3242,15 @@ add_executable(nr_prachsim
${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_common.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
+ ${NR_UE_RRC_DIR}/rrc_nsa.c
${NFAPI_USER_DIR}/nfapi.c
${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
+ ${PHY_INTERFACE_DIR}/queue_t.c
${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES})
target_link_libraries(nr_prachsim
- -Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB -Wl,--end-group
+ -Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl)
add_executable(nr_ulschsim
@@ -3240,6 +3259,7 @@ add_executable(nr_ulschsim
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
+ ${PHY_INTERFACE_DIR}/queue_t.c
${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
@@ -3258,13 +3278,15 @@ add_executable(nr_ulsim
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
+ ${NR_UE_RRC_DIR}/rrc_nsa.c
${NFAPI_USER_DIR}/nfapi.c
+ ${PHY_INTERFACE_DIR}/queue_t.c
${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
target_link_libraries(nr_ulsim
- -Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB -Wl,--end-group
+ -Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl
)
target_compile_definitions(nr_ulsim PUBLIC -DPHYSICAL_SIMULATOR)
@@ -3302,7 +3324,7 @@ add_executable(test_epc_generate_scenario
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
)
target_link_libraries (test_epc_generate_scenario
- -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
+ -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
)
add_executable(test_epc_play_scenario
@@ -3321,7 +3343,7 @@ add_executable(test_epc_play_scenario
)
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
target_link_libraries (test_epc_play_scenario
- -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
+ -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
)
@@ -3367,7 +3389,7 @@ if (${T_TRACER})
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB
- CN_UTILS NR_GTPV1U GTPV1U_OCP SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
+ CN_UTILS GTPV1U_OCP GTPV1U_OCP SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts)
if (TARGET ${i})
add_dependencies(${i} generate_T)
diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c
index 740c6e240b..b961a5db67 100644
--- a/common/config/config_load_configmodule.c
+++ b/common/config/config_load_configmodule.c
@@ -182,8 +182,8 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
}
configmodule_interface_t *load_configmodule(int argc,
- char **argv,
- uint32_t initflags)
+ char **argv,
+ uint32_t initflags)
{
char *cfgparam=NULL;
char *modeparams=NULL;
@@ -194,6 +194,11 @@ configmodule_interface_t *load_configmodule(int argc,
int i;
int OoptIdx=-1;
+ printf("CMDLINE: ");
+ for (int i=0; i 0 && str != NULL && strlen(str) >= cfgoptions[i].numelt ) {
fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n",
cfgpath,str,cfgoptions[i].numelt);
diff --git a/common/utils/LOG/DOC/rtusage.md b/common/utils/LOG/DOC/rtusage.md
index 445f335725..d7c748952d 100644
--- a/common/utils/LOG/DOC/rtusage.md
+++ b/common/utils/LOG/DOC/rtusage.md
@@ -9,7 +9,7 @@ All logging facility parameters are defined in the log_config section. Some para
|:---:|:---:|:---:|:----|
| `global_log_level` | `pre-defined string of char` | `info` | Allows printing of messages up to the specified level. Available levels, from lower to higher are `error`,`warn`,`info`,`debug`,`trace` |
| `global_log_online` | `boolean` | 1 (=true) | If false, all console messages are discarded, whatever their level |
-| `global_log_options` | `list of pre-defined string of char` | | 3 options can be specified to trigger the information added in the header of the message: `nocolor`, disable color usage in log messages, usefull when redirecting logs to a file, where escape sequences used for color selection can be annoying, `level`, add a one letter level id in the message header (T,D,I,W,E for trace, debug, info, warning, error),`thread`, add the thread name in the message header|
+| `global_log_options` | `list of pre-defined string of char` | | 3 options can be specified to trigger the information added in the header of the message: `nocolor`, disable color usage in log messages, usefull when redirecting logs to a file, where escape sequences used for color selection can be annoying, `level`, add a one letter level id in the message header (T,D,I,W,E for trace, debug, info, warning, error),`thread`, add the thread name in the message header, `function`, adds the function name, `line_num`, adds the line number, `time` adds the time since process starts|
### Component specific parameters
| name | type | default | description |
diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c
index d0a53a755b..28134d6db1 100644
--- a/common/utils/LOG/log.c
+++ b/common/utils/LOG/log.c
@@ -43,6 +43,8 @@
#include
#include
#include "common/config/config_userapi.h"
+#include
+#include
// main log variables
@@ -73,6 +75,9 @@ mapping log_options[] = {
{"nocolor", FLAG_NOCOLOR },
{"level", FLAG_LEVEL },
{"thread", FLAG_THREAD },
+ {"line_num", FLAG_FILE_LINE },
+ {"function", FLAG_FUNCT},
+ {"time", FLAG_TIME},
{NULL,-1}
};
@@ -81,6 +86,7 @@ mapping log_maskmap[] = LOG_MASKMAP_INIT;
char *log_level_highlight_start[] = {LOG_RED, LOG_ORANGE, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */
char *log_level_highlight_end[] = {LOG_RESET,LOG_RESET,LOG_RESET, LOG_RESET,LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */
+static void log_output_memory(log_component_t *c, const char *file, const char *func, int line, int comp, int level, const char* format,va_list args);
int write_file_matlab(const char *fname,
@@ -476,6 +482,8 @@ int logInit (void)
register_log_component("NR_MAC","log",NR_MAC);
register_log_component("NR_PHY","log",NR_PHY);
register_log_component("NGAP","",NGAP);
+ register_log_component("ITTI","log",ITTI);
+ register_log_component("UTIL","log",UTIL);
for (int i=0 ; log_level_names[i].name != NULL ; i++)
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
@@ -493,84 +501,138 @@ int logInit (void)
return 0;
}
-
-char *log_getthreadname(char *threadname,
- int bufsize)
+static inline int log_header(log_component_t *c,
+ char *log_buffer,
+ int buffsize,
+ const char *file,
+ const char *func,
+ int line,
+ int level)
{
- int rt = pthread_getname_np(pthread_self(), threadname,bufsize) ;
+ int flag= g_log->flag | c->flag;
- if (rt == 0) {
- return threadname;
+ char threadname[64];
+ if (flag & FLAG_THREAD ) {
+ threadname[0]='{';
+ if ( pthread_getname_np(pthread_self(), threadname+1,61) != 0)
+ strcpy(threadname+1, "?thread?");
+ strcat(threadname,"}");
} else {
- return "thread?";
+ threadname[0]=0;
}
+
+ char l[32];
+ if (flag & FLAG_FILE_LINE && flag & FLAG_FUNCT )
+ snprintf(l, sizeof l," (%s:%d) ", func, line);
+ else if (flag & FLAG_FILE_LINE)
+ sprintf(l," (%d) ", line);
+ else
+ l[0]=0;
+
+ char timeString[32];
+ if ( flag & FLAG_TIME ) {
+ struct timespec t;
+ clock_gettime(CLOCK_MONOTONIC, &t);
+ snprintf(timeString, sizeof t,"%05.3f",t.tv_sec+t.tv_nsec/1.0e9);
+ } else {
+ timeString[0]=0;
+ }
+ return snprintf(log_buffer, buffsize, "%s%s[%s]%c%s %s ",
+ timeString,
+ flag & FLAG_NOCOLOR ? "" : log_level_highlight_start[level],
+ c->name,
+ flag & FLAG_LEVEL ? g_log->level2string[level] : ' ',
+ l,
+ threadname
+ );
}
-static int log_header(char *log_buffer,
- int buffsize,
- int comp,
- int level,
- const char *format)
+#if LOG_MINIMAL
+#include
+void logMinimal(int comp, int level, const char *format, ...)
{
- char threadname[PR_SET_NAME];
- return snprintf(log_buffer, buffsize, "%s%s[%s]%c %s %s%s",
- log_level_highlight_end[level],
- ( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
- g_log->log_component[comp].name,
- ( (g_log->flag & FLAG_LEVEL)?g_log->level2string[level]:' '),
- ( (g_log->flag & FLAG_THREAD)?log_getthreadname(threadname,PR_SET_NAME+1):""),
- format,
- log_level_highlight_end[level]);
+ struct timespec ts;
+ if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
+ abort();
+
+ char buf[MAX_LOG_TOTAL];
+ int n = snprintf(buf, sizeof(buf), "%lu.%06lu %08lx [%s] %c ",
+ ts.tv_sec,
+ ts.tv_nsec / 1000,
+ syscall(__NR_gettid),
+ g_log->log_component[comp].name,
+ level);
+ if (n < 0 || n >= sizeof(buf))
+ {
+ fprintf(stderr, "%s: n=%d\n", __func__, n);
+ return;
+ }
+
+ va_list args;
+ va_start(args, format);
+ int m = vsnprintf(buf + n, sizeof(buf) - n, format, args);
+ va_end(args);
+
+ if (m < 0)
+ {
+ fprintf(stderr, "%s: n=%d m=%d\n", __func__, n, m);
+ return;
+ }
+
+ int len = n + m;
+ if (len > sizeof(buf) - 1)
+ {
+ len = sizeof(buf) - 1;
+ }
+ if (buf[len - 1] != '\n')
+ {
+ buf[len++] = '\n';
+ }
+
+ __attribute__((unused))
+ int unused = write(STDOUT_FILENO, buf, len);
}
+#endif // LOG_MINIMAL
void logRecord_mt(const char *file,
- const char *func,
- int line,
- int comp,
- int level,
- const char *format,
- ... )
+ const char *func,
+ int line,
+ int comp,
+ int level,
+ const char *format,
+ ... )
{
- char log_buffer[MAX_LOG_TOTAL]= {0};
+ log_component_t *c = &g_log->log_component[comp];
va_list args;
va_start(args,format);
- if (log_mem_flag == 1) {
- log_output_memory(file,func,line,comp,level,format,args);
- } else {
- log_header(log_buffer,MAX_LOG_TOTAL,comp,level,format);
- g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer,args);
- fflush(g_log->log_component[comp].stream);
- }
+ log_output_memory(c, file,func,line,comp,level,format,args);
va_end(args);
}
void vlogRecord_mt(const char *file,
- const char *func,
- int line,
- int comp,
- int level,
- const char *format,
- va_list args )
+ const char *func,
+ int line,
+ int comp,
+ int level,
+ const char *format,
+ va_list args )
{
- char log_buffer[MAX_LOG_TOTAL];
- if (log_mem_flag == 1) {
- log_output_memory(file,func,line,comp,level, format,args);
- } else {
- log_header(log_buffer,MAX_LOG_TOTAL,comp, level,format);
- g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
- }
+ log_component_t *c = &g_log->log_component[comp];
+ log_output_memory(c, file,func,line,comp,level, format,args);
}
void log_dump(int component,
- void *buffer,
- int buffsize,
- int datatype,
- const char *format,
- ... )
+ void *buffer,
+ int buffsize,
+ int datatype,
+ const char *format,
+ ... )
{
va_list args;
char *wbuf;
-
+ log_component_t *c = &g_log->log_component[component];
+ int flag= g_log->flag | c->flag;
+
switch(datatype) {
case LOG_DUMP_DOUBLE:
wbuf=malloc((buffsize * 10) + 64 + MAX_LOG_TOTAL);
@@ -584,9 +646,8 @@ void log_dump(int component,
if (wbuf != NULL) {
va_start(args, format);
- int pos=log_header(wbuf,MAX_LOG_TOTAL,component, OAILOG_INFO,"");
- int pos2=vsprintf(wbuf+pos,format, args);
- pos=pos+pos2;
+ int pos=log_header(c, wbuf,MAX_LOG_TOTAL,"noFile","noFunc",0, OAILOG_INFO);
+ pos+=vsprintf(wbuf+pos,format, args);
va_end(args);
for (int i=0; ilog_component[component].print(g_log->log_component[component].stream,wbuf);
+ if ( flag & FLAG_NOCOLOR )
+ sprintf(wbuf+pos,"\n");
+ else
+ sprintf(wbuf+pos,"%s\n",log_level_highlight_end[OAILOG_INFO]);
+ c->print(c->stream,wbuf);
free(wbuf);
}
}
@@ -803,13 +866,10 @@ void flush_mem_to_file(void)
char logmem_log_level[NUM_LOG_LEVEL]={'E','W','I','D','T'};
-void log_output_memory(const char *file, const char *func, int line, int comp, int level, const char* format,va_list args)
+static void log_output_memory(log_component_t *c, const char *file, const char *func, int line, int comp, int level, const char* format,va_list args)
{
//logRecord_mt(file,func,line, pthread_self(), comp, level, format, ##args)
int len = 0;
- log_component_t *c;
- char *log_start;
- char *log_end;
/* The main difference with the version above is the use of this local log_buffer.
* The other difference is the return value of snprintf which was not used
* correctly. It was not a big problem because in practice MAX_LOG_TOTAL is
@@ -817,92 +877,17 @@ void log_output_memory(const char *file, const char *func, int line, int comp, i
*/
char log_buffer[MAX_LOG_TOTAL];
- /* for no gcc warnings */
- (void)log_start;
- (void)log_end;
-
-
- c = &g_log->log_component[comp];
-
- //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LOG_RECORD, VCD_FUNCTION_IN);
-
// make sure that for log trace the extra info is only printed once, reset when the level changes
- if (level == OAILOG_TRACE) {
- log_start = log_buffer;
- len = vsnprintf(log_buffer, MAX_LOG_TOTAL, format, args);
- if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
- log_end = log_buffer + len;
- } else {
- if ( (g_log->flag & 0x001) || (c->flag & 0x001) ) {
- len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s",
- log_level_highlight_start[level]);
- if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
- }
-
- log_start = log_buffer + len;
-
-// if ( (g_log->flag & 0x004) || (c->flag & 0x004) ) {
- len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]",
- g_log->log_component[comp].name);
- if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
-// }
-
- if ( (level >= OAILOG_ERR) && (level <= OAILOG_TRACE) ) {
- len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%c]",
- logmem_log_level[level]);
- if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
- }
-
- if ( (g_log->flag & FLAG_THREAD) || (c->flag & FLAG_THREAD) ) {
-# define THREAD_NAME_LEN 128
- char threadname[THREAD_NAME_LEN];
- if (pthread_getname_np(pthread_self(), threadname, THREAD_NAME_LEN) != 0)
- {
- perror("pthread_getname_np : ");
- } else {
- len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]", threadname);
- if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
- }
-# undef THREAD_NAME_LEN
- }
-
- if ( (g_log->flag & FLAG_FUNCT) || (c->flag & FLAG_FUNCT) ) {
- len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s] ",
- func);
- if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
- }
-
- if ( (g_log->flag & FLAG_FILE_LINE) || (c->flag & FLAG_FILE_LINE) ) {
- len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s:%d]",
- file, line);
- if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
- }
-
-/* len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%08lx]", thread_id);
- if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
-
- struct timeval gettime;
- gettimeofday(&gettime,NULL);
- len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%ld.%06ld]", gettime.tv_sec, gettime.tv_usec);
- if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
-*/
- if ( (g_log->flag & FLAG_NOCOLOR) || (c->flag & FLAG_NOCOLOR) ) {
- len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s",
- log_level_highlight_end[level]);
- if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
- }
-
- len += vsnprintf(&log_buffer[len], MAX_LOG_TOTAL - len, format, args);
- if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
- log_end = log_buffer + len;
- }
-
- //va_end(args);
-
+ if (level < OAILOG_TRACE)
+ len += log_header(c, log_buffer, MAX_LOG_TOTAL, file, func, line, level);
+ len += vsnprintf(log_buffer+len, MAX_LOG_TOTAL-len, format, args);
+ if ( !((g_log->flag | c->flag) & FLAG_NOCOLOR) )
+ len+=snprintf(log_buffer+len, MAX_LOG_TOTAL-len, "%s", log_level_highlight_end[level]);
+
// OAI printf compatibility
- if(log_mem_flag==1){
- if(log_mem_d[log_mem_side].enable_flag==1){
- int temp_index;
+ if(log_mem_flag==1){
+ if(log_mem_d[log_mem_side].enable_flag==1){
+ int temp_index;
temp_index=log_mem_d[log_mem_side].buf_index;
if(temp_index+len+1 < LOG_MEM_SIZE){
log_mem_d[log_mem_side].buf_index+=len;
@@ -933,9 +918,9 @@ void log_output_memory(const char *file, const char *func, int line, int comp, i
}
}
}
- }else{
- fwrite(log_buffer, len, 1, stdout);
- }
+ }else{
+ if (write(fileno(c->stream), log_buffer, len)) {};
+ }
}
int logInit_log_mem (void)
diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h
index fa95d5a6fe..d644445424 100644
--- a/common/utils/LOG/log.h
+++ b/common/utils/LOG/log.h
@@ -54,6 +54,12 @@
#include "T.h"
#include
/*----------------------------------------------------------------------------*/
+#include
+#ifdef NDEBUG
+#warning assert is disabled
+#endif
+#define NUM_ELEMENTS(ARRAY) (sizeof(ARRAY) / sizeof(ARRAY[0]))
+#define CHECK_INDEX(ARRAY, INDEX) assert((INDEX) < NUM_ELEMENTS(ARRAY))
#ifdef __cplusplus
extern "C" {
@@ -237,6 +243,8 @@ typedef enum {
ASN,
NFAPI_VNF,
NFAPI_PNF,
+ ITTI,
+ UTIL,
MAX_LOG_PREDEF_COMPONENTS,
}
comp_name_t;
@@ -315,7 +323,6 @@ int register_log_component(char *name, char *fext, int compidx);
#define LOG_MEM_SIZE 100*1024*1024
#define LOG_MEM_FILE "./logmem.log"
void flush_mem_to_file(void);
-void log_output_memory(const char *file, const char *func, int line, int comp, int level, const char* format,va_list args);
int logInit_log_mem(void);
void close_log_mem(void);
@@ -400,10 +407,30 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
#define LOG_DUMP_DOUBLE 1
// debugging macros
#define LOG_F LOG_I /* because LOG_F was originaly to dump a message or buffer but is also used as a regular level...., to dump use LOG_DUMPMSG */
+
+#if LOG_MINIMAL
+
+ void logMinimal(int component, int level, const char *format, ...) __attribute__((format(printf, 3, 4)));
+# define LOG_E(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'E', __VA_ARGS__); while (0)
+# define LOG_W(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'W', __VA_ARGS__); while (0)
+# define LOG_A(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'A', __VA_ARGS__); while (0) /* logs intended for analysis */
+# define LOG_I(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'I', __VA_ARGS__); while (0)
+# define LOG_D(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0)
+# define LOG_T(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'T', __VA_ARGS__); while (0)
+
+# define LOG_M(FILE, VECTOR, DATA, LEN, DEC, FORMAT) ((void) 0)
+# define LOG_DUMPFLAG(D) 0
+# define LOG_DEBUGFLAG(D) 0
+# define LOG_DUMPMSG(C, B, S, X...) ((void) 0)
+# define VLOG(C, L, F, ARGS) ((void) 0)
+
+#else // LOG_MINIMAL
+
# if T_TRACER
/* per component, level dependent macros */
# define LOG_E(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0)
# define LOG_W(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0)
+# define LOG_A LOG_I
# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
@@ -423,6 +450,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_E(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} while (0)
# define LOG_W(c, x...) do { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} while (0)
# define LOG_I(c, x...) do { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} while (0)
+# define LOG_A LOG_I
# define LOG_D(c, x...) do { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} while (0)
# define LOG_T(c, x...) do { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} while (0)
# define VLOG(c,l, f, args) do { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ; } while (0)
@@ -436,6 +464,8 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_VAR(A,B) A B
# define T_ACTIVE(a) (0)
# endif /* T_TRACER */
+#endif // LOG_MINIMAL
+
/* avoid warnings for variables only used in LOG macro's but set outside debug section */
#define GCC_NOTUSED __attribute__((unused))
#define LOG_USEDINLOG_VAR(A,B) GCC_NOTUSED A B
diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt
index 192bf8cc37..a8a4f57fcd 100644
--- a/common/utils/T/T_messages.txt
+++ b/common/utils/T/T_messages.txt
@@ -1061,6 +1061,48 @@ ID = LEGACY_NFAPI_PNF_TRACE
DESC = NFAPI_PNF legacy logs - trace level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
+
+ID = LEGACY_ITTI_INFO
+ DESC = ITTI legacy logs - info level
+ GROUP = ALL:LEGACY_ITTI:LEGACY_GROUP_INFO:LEGACY
+ FORMAT = string,log
+ID = LEGACY_ITTI_ERROR
+ DESC = ITTI legacy logs - error level
+ GROUP = ALL:LEGACY_ITTI:LEGACY_GROUP_ERROR:LEGACY
+ FORMAT = string,log
+ID = LEGACY_ITTI_WARNING
+ DESC = ITTI legacy logs - warning level
+ GROUP = ALL:LEGACY_ITTI:LEGACY_GROUP_WARNING:LEGACY
+ FORMAT = string,log
+ID = LEGACY_ITTI_DEBUG
+ DESC = ITTI legacy logs - debug level
+ GROUP = ALL:LEGACY_ITTI:LEGACY_GROUP_DEBUG:LEGACY
+ FORMAT = string,log
+ID = LEGACY_ITTI_TRACE
+ DESC = ITTI legacy logs - trace level
+ GROUP = ALL:LEGACY_ITTI:LEGACY_GROUP_TRACE:LEGACY
+ FORMAT = string,log
+
+ID = LEGACY_UTIL_INFO
+ DESC = UTIL legacy logs - info level
+ GROUP = ALL:LEGACY_UTIL:LEGACY_GROUP_INFO:LEGACY
+ FORMAT = string,log
+ID = LEGACY_UTIL_ERROR
+ DESC = UTIL legacy logs - error level
+ GROUP = ALL:LEGACY_UTIL:LEGACY_GROUP_ERROR:LEGACY
+ FORMAT = string,log
+ID = LEGACY_UTIL_WARNING
+ DESC = UTIL legacy logs - warning level
+ GROUP = ALL:LEGACY_UTIL:LEGACY_GROUP_WARNING:LEGACY
+ FORMAT = string,log
+ID = LEGACY_UTIL_DEBUG
+ DESC = UTIL legacy logs - debug level
+ GROUP = ALL:LEGACY_UTIL:LEGACY_GROUP_DEBUG:LEGACY
+ FORMAT = string,log
+ID = LEGACY_UTIL_TRACE
+ DESC = UTIL legacy logs - trace level
+ GROUP = ALL:LEGACY_UTIL:LEGACY_GROUP_TRACE:LEGACY
+ FORMAT = string,log
# this is a bad hack but I won't fix (function util_print_hex_octets
# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c
# does funky things with the LOG_x macros but we work on the C pre-processor
diff --git a/common/utils/assertions.h b/common/utils/assertions.h
index 06d43bdbfa..d85dab79a0 100644
--- a/common/utils/assertions.h
+++ b/common/utils/assertions.h
@@ -26,17 +26,10 @@
#include
#include
#include
+#include "backtrace.h"
-#if defined(ENB_MODE)
-# define display_backtrace()
-#else
-# include "backtrace.h"
-#endif
-
-void output_log_mem(void);
#define _Assert_Exit_ \
fprintf(stderr, "\nExiting execution\n"); \
- display_backtrace(); \
fflush(stdout); \
fflush(stderr); \
abort();
diff --git a/common/utils/backtrace.c b/common/utils/backtrace.c
index f61cf0349a..634bb3a834 100644
--- a/common/utils/backtrace.c
+++ b/common/utils/backtrace.c
@@ -28,7 +28,7 @@
#include
#include
-#include "backtrace.h"
+#include
/* Obtain a backtrace and print it to stdout. */
void display_backtrace(void) {
@@ -49,8 +49,3 @@ void display_backtrace(void) {
free(strings);
}
-
-void backtrace_handle_signal(siginfo_t *info) {
- display_backtrace();
- //exit(EXIT_FAILURE);
-}
diff --git a/common/utils/backtrace.h b/common/utils/backtrace.h
index 3977d0321c..9aaf718453 100644
--- a/common/utils/backtrace.h
+++ b/common/utils/backtrace.h
@@ -26,10 +26,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-
void display_backtrace(void);
-
-void backtrace_handle_signal(siginfo_t *info);
#ifdef __cplusplus
}
#endif
diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c
index 0de24bcf6d..de8a0522e0 100644
--- a/common/utils/nr/nr_common.c
+++ b/common/utils/nr/nr_common.c
@@ -42,7 +42,7 @@ const char *duplex_mode[]={"FDD","TDD"};
// - N_OFFs for bands from 80 to 89 and band 95 is referred to UL
// - Frequencies are expressed in KHz
// - col: NR_band ul_min ul_max dl_min dl_max step N_OFFs_DL deltaf_raster
-nr_bandentry_t nr_bandtable[] = {
+const nr_bandentry_t nr_bandtable[] = {
{1, 1920000, 1980000, 2110000, 2170000, 20, 422000, 100},
{2, 1850000, 1910000, 1930000, 1990000, 20, 386000, 100},
{3, 1710000, 1785000, 1805000, 1880000, 20, 361000, 100},
@@ -117,7 +117,7 @@ uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex)
uint64_t center_freq_diff_khz = 999999999999999999; // 2^64
uint16_t current_band = 0;
- for (int ind = 0; ind < nr_bandtable_size; ind++) {
+ for (int ind = 0; ind < sizeofArray(nr_bandtable); ind++) {
if (dl_freq_khz < nr_bandtable[ind].dl_min || dl_freq_khz > nr_bandtable[ind].dl_max)
continue;
@@ -143,8 +143,6 @@ uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex)
return current_band;
}
-const size_t nr_bandtable_size = sizeof(nr_bandtable) / sizeof(nr_bandentry_t);
-
int NRRIV2BW(int locationAndBandwidth,int N_RB) {
int tmp = locationAndBandwidth/N_RB;
int tmp2 = locationAndBandwidth%N_RB;
@@ -459,31 +457,27 @@ uint16_t config_bandwidth(int mu, int nb_rb, int nr_band)
// Returns the corresponding row index of the NR table
int get_nr_table_idx(int nr_bandP, uint8_t scs_index) {
- int i, j;
int scs_khz = 15 << scs_index;
int supplementary_bands[] = {29,75,76,80,81,82,83,84,86,89,95};
- size_t s = sizeof(supplementary_bands)/sizeof(supplementary_bands[0]);
-
- for(j = 0; j < s; j++){
+ for(int j = 0; j < sizeofArray(supplementary_bands); j++){
if (nr_bandP == supplementary_bands[j])
AssertFatal(0 == 1, "Band %d is a supplementary band (%d). This is not supported yet.\n", nr_bandP, supplementary_bands[j]);
}
- AssertFatal(nr_bandP <= nr_bandtable[nr_bandtable_size-1].band, "NR band %d exceeds NR bands table maximum limit %d\n", nr_bandP, nr_bandtable[nr_bandtable_size-1].band);
- for (i = 0; i < nr_bandtable_size && nr_bandtable[i].band != nr_bandP; i++);
-
- // In frequency bands with two deltaFRaster,
- // the higher deltaFRaster applies to channels using only the SCS that is equal to or larger than the higher deltaFRaster
- // and SSB SCS is equal to the higher deltaFRaster.
- while(((i+1)=0; i--)
+ if ( nr_bandtable[i].band == nr_bandP )
+ break;
+ }
+ AssertFatal(i > 0 && i < sizeofArray(nr_bandtable), "band is not existing: %d\n",nr_bandP);
LOG_D(PHY, "NR band table index %d (Band %d, dl_min %lu, ul_min %lu)\n", i, nr_bandtable[i].band, nr_bandtable[i].dl_min,nr_bandtable[i].ul_min);
return i;
diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h
index 44a6e05577..e7414c9f83 100644
--- a/common/utils/nr/nr_common.h
+++ b/common/utils/nr/nr_common.h
@@ -48,8 +48,7 @@ typedef struct nr_bandentry_s {
uint8_t deltaf_raster;
} nr_bandentry_t;
-extern const size_t nr_bandtable_size;
-extern nr_bandentry_t nr_bandtable[];
+extern const nr_bandentry_t nr_bandtable[];
static inline int get_num_dmrs(uint16_t dmrs_mask ) {
int num_dmrs=0;
diff --git a/common/utils/ocp_itti/intertask_interface.cpp b/common/utils/ocp_itti/intertask_interface.cpp
index 4e5323aec9..44fae9f788 100644
--- a/common/utils/ocp_itti/intertask_interface.cpp
+++ b/common/utils/ocp_itti/intertask_interface.cpp
@@ -136,12 +136,12 @@ extern "C" {
LOG_E(TMR,"Queue for %s task contains %ld messages\n", itti_get_task_name(destination_task_id), s );
if ( s > 50 )
- LOG_I(TMR,"Queue for %s task size: %ld (last message %s)\n",itti_get_task_name(destination_task_id), s+1,ITTI_MSG_NAME(message));
+ LOG_I(ITTI,"Queue for %s task size: %ld (last message %s)\n",itti_get_task_name(destination_task_id), s+1,ITTI_MSG_NAME(message));
t->message_queue.insert(t->message_queue.begin(), message);
eventfd_t sem_counter = 1;
AssertFatal ( sizeof(sem_counter) == write(t->sem_fd, &sem_counter, sizeof(sem_counter)), "");
- LOG_D(TMR,"sent messages id=%d to %s\n",message_id, t->admin.name);
+ LOG_D(ITTI,"sent messages id=%d to %s\n",message_id, t->admin.name);
return 0;
}
@@ -152,7 +152,7 @@ extern "C" {
while ( t->message_queue.size()>0 && t->admin.func != NULL ) {
if (t->message_queue.size()>1)
- LOG_W(TMR,"queue in no thread mode is %ld\n", t->message_queue.size());
+ LOG_W(ITTI,"queue in no thread mode is %ld\n", t->message_queue.size());
pthread_mutex_unlock (&t->queue_cond_lock);
t->admin.func(NULL);
@@ -208,7 +208,7 @@ extern "C" {
message->ittiMsg.timer_has_expired.arg=it->second.timer_arg;
if (itti_send_msg_to_task_locked(task_id, it->second.instance, message) < 0) {
- LOG_W(TMR,"Failed to send msg TIMER_HAS_EXPIRED to task %u\n", task_id);
+ LOG_W(ITTI,"Failed to send msg TIMER_HAS_EXPIRED to task %u\n", task_id);
free(message);
t->timer_map.erase(it);
return -1;
@@ -233,7 +233,7 @@ extern "C" {
epoll_timeout = t->next_timer-current_time;
pthread_mutex_unlock(&t->queue_cond_lock);
- LOG_D(TMR,"enter blocking wait for %s\n", itti_get_task_name(task_id));
+ LOG_D(ITTI,"enter blocking wait for %s, timeout: %d ms\n", itti_get_task_name(task_id), epoll_timeout);
t->nb_events = epoll_wait(t->epoll_fd,t->events,t->nb_fd_epoll, epoll_timeout);
if ( t->nb_events < 0 && (errno == EINTR || errno == EAGAIN ) )
@@ -243,7 +243,7 @@ extern "C" {
AssertFatal (t->nb_events >=0,
"epoll_wait failed for task %s, nb fds %d, timeout %lu: %s!\n",
itti_get_task_name(task_id), t->nb_fd_epoll, t->next_timer != UINT64_MAX ? t->next_timer-current_time : -1, strerror(errno));
- LOG_D(TMR,"receive on %d descriptors for %s\n", t->nb_events, itti_get_task_name(task_id));
+ LOG_D(ITTI,"receive on %d descriptors for %s\n", t->nb_events, itti_get_task_name(task_id));
if (t->nb_events == 0)
/* No data to read -> return */
@@ -292,11 +292,11 @@ extern "C" {
// in this case, *received_msg is NULL
if (t->message_queue.empty()) {
*received_msg=NULL;
- LOG_D(TMR,"task %s received even from other fd (total fds: %d), returning msg NULL\n",t->admin.name, t->nb_fd_epoll);
+ LOG_D(ITTI,"task %s received even from other fd (total fds: %d), returning msg NULL\n",t->admin.name, t->nb_fd_epoll);
} else {
*received_msg=t->message_queue.back();
t->message_queue.pop_back();
- LOG_D(TMR,"task %s received a message\n",t->admin.name);
+ LOG_D(ITTI,"task %s received a message\n",t->admin.name);
}
pthread_mutex_unlock (&t->queue_cond_lock);
@@ -308,7 +308,7 @@ extern "C" {
pthread_mutex_lock(&t->queue_cond_lock);
if (!t->message_queue.empty()) {
- LOG_D(TMR,"task %s received a message in polling mode\n",t->admin.name);
+ LOG_D(ITTI,"task %s received a message in polling mode\n",t->admin.name);
*received_msg=t->message_queue.back();
t->message_queue.pop_back();
} else
@@ -322,7 +322,7 @@ extern "C" {
void *args_p) {
task_list_t *t=tasks[task_id];
threadCreate (&t->thread, start_routine, args_p, (char *)itti_get_task_name(task_id),-1,OAI_PRIORITY_RT);
- LOG_I(TMR,"Created Posix thread %s\n", itti_get_task_name(task_id) );
+ LOG_I(ITTI,"Created Posix thread %s\n", itti_get_task_name(task_id) );
return 0;
}
@@ -344,7 +344,7 @@ extern "C" {
tasks = new_tasks;
tasks[newQueue]= new task_list_t;
pthread_mutex_unlock (&lock_nb_queues);
- LOG_I(TMR,"Starting itti queue: %s as task %d\n", taskInfo->name, newQueue);
+ LOG_I(ITTI,"Starting itti queue: %s as task %d\n", taskInfo->name, newQueue);
pthread_mutex_init(&tasks[newQueue]->queue_cond_lock, NULL);
memcpy(&tasks[newQueue]->admin, taskInfo, sizeof(task_info_t));
AssertFatal( ( tasks[newQueue]->epoll_fd = epoll_create1(0) ) >=0, "");
@@ -392,7 +392,7 @@ extern "C" {
clock_gettime(CLOCK_MONOTONIC, &tp);
if (interval_us%1000 != 0)
- LOG_W(TMR, "Can't set timer precision below 1ms, rounding it\n");
+ LOG_W(ITTI, "Can't set timer precision below 1ms, rounding it\n");
timer.duration = interval_sec*1000+interval_us/1000;
timer.timeout= ((uint64_t)tp.tv_sec*1000+tp.tv_nsec/(1000*1000)+timer.duration);
@@ -421,7 +421,7 @@ extern "C" {
if (ret==1)
return 0;
else {
- LOG_W(TMR, "tried to remove a non existing timer\n");
+ LOG_W(ITTI, "tried to remove a non existing timer\n");
return 1;
}
}
@@ -438,9 +438,22 @@ extern "C" {
void itti_send_terminate_message(task_id_t task_id) {
}
+ static volatile bool shutting_down;
+
+ static void catch_sigterm(int) {
+ static const char msg[] = "\n** Caught SIGTERM, shutting down\n";
+ __attribute__((unused))
+ int unused = write(STDOUT_FILENO, msg, sizeof(msg) - 1);
+ shutting_down = true;
+ }
+
void itti_wait_tasks_end(void) {
- while(1)
- sleep(24*3600);
+ shutting_down = false;
+ signal(SIGTERM, catch_sigterm);
+ while (! shutting_down)
+ {
+ sleep(24 * 3600);
+ }
}
void itti_update_lte_time(uint32_t frame, uint8_t slot) {}
@@ -455,4 +468,42 @@ extern "C" {
int signal_mask(void) {
return 0;
}
+
+void log_scheduler(const char* label)
+{
+ int policy = sched_getscheduler(0);
+ struct sched_param param;
+ if (sched_getparam(0, ¶m) == -1)
+ {
+ LOG_E(HW, "sched_getparam: %s\n", strerror(errno));
+ abort();
+ }
+
+ cpu_set_t cpu_set;
+ if (sched_getaffinity(0, sizeof(cpu_set), &cpu_set) == -1)
+ {
+ LOG_E(HW, "sched_getaffinity: %s\n", strerror(errno));
+ abort();
+ }
+ int num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
+ if (num_cpus < 1)
+ {
+ LOG_E(HW, "sysconf(_SC_NPROCESSORS_ONLN): %s\n", strerror(errno));
+ abort();
+ }
+ char buffer[num_cpus];
+ for (int i = 0; i < num_cpus; i++)
+ {
+ buffer[i] = CPU_ISSET(i, &cpu_set) ? 'Y' : '-';
+ }
+
+ LOG_A(HW, "Scheduler policy=%d priority=%d affinity=[%d]%.*s label=%s\n",
+ policy,
+ param.sched_priority,
+ num_cpus,
+ num_cpus,
+ buffer,
+ label);
}
+} // extern "C"
+
diff --git a/common/utils/ocp_itti/intertask_interface.h b/common/utils/ocp_itti/intertask_interface.h
index 7c17a6f3b1..3188e5889f 100644
--- a/common/utils/ocp_itti/intertask_interface.h
+++ b/common/utils/ocp_itti/intertask_interface.h
@@ -346,6 +346,8 @@ void *rrc_enb_process_msg(void *);
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_GNB_SIM, TASK_PRIORITY_MED, 200, NULL, NULL) \
+ TASK_DEF(TASK_RRC_NSA_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
+ TASK_DEF(TASK_RRC_NSA_NRUE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_NAS_NRUE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_MAX, TASK_PRIORITY_MED, 200, NULL, NULL)
@@ -362,6 +364,8 @@ typedef enum {
FOREACH_TASK(TASK_ENUM)
} task_id_t;
+extern uint16_t ue_idx_standalone;
+extern uint16_t node_number;
typedef task_id_t thread_id_t;
@@ -586,6 +590,7 @@ int timer_remove(long timer_id);
int signal_handle(int *end);
int signal_mask(void);
+void log_scheduler(const char *label);
#ifdef __cplusplus
}
#endif
diff --git a/common/utils/ocp_itti/itti.md b/common/utils/ocp_itti/itti.md
new file mode 100644
index 0000000000..89bc3ee29f
--- /dev/null
+++ b/common/utils/ocp_itti/itti.md
@@ -0,0 +1,91 @@
+# interthread interface (ITTI)
+
+A Middleware called “itti” (interthread interface) provides classical send/receive message queues between threads.
+
+A simpler thread safe message queue is available in the thread-pool, as it is a required lower level feature.
+
+ITTI is providing more feature, to be used as the thread event main loop.
+
+It is also made for strong type definition is source code.
+
+It is able to add in the managed events: external sockets, timers
+
+All queues are created in .h files, as static permanent queues, nevertheless the possibility to add queues during runtime is available.
+
+The queues are called tasks because it is often read in a single thread that have the same name.
+
+# API definition
+
+## itti_send_msg_to_task, itti_receive_msg, itti_poll_msg
+
+Standard messages queues, thread safe
+The reader is responsible of freeing the message
+
+## itti_subscribe_event_fd, itti_get_events
+
+Add external sockets to itti based main loop
+
+## timer_setup timer_remove
+
+When a timer expire, it adds a message in a itti queue
+
+## itti_terminate_tasks
+
+Calling this function push a “terminate” message on each itti queue
+
+# Example code of a thread using ITTI
+
+```
+Thread_aLayer_main(void * context) {
+ // initialize the layer data
+ // and register in itti the external sockets (like S1AP, GTP)
+ aLayer_init();
+ while (1) {
+ MessageDef * msg
+ itti_receive_msg(TASK_aLayer, &msg);
+ // itti receive released, so we have incoming data
+ // Can be a itti message
+ if ( msg != NULL) {
+ switch(ITTI_MSG_ID(msg)) {
+ case …:
+ processThisMsgType1(msg);
+ break;
+ case …:
+ processThisMsgType2(msg);
+ break;
+ }
+ Itti_free(msg);
+ }
+ // or data/event on external entries (sockets)
+ Struct eppol_events* events;
+ int nbEvents=itti_get_events(TASK_aLayer, &events);
+ if ( nbEvents > 0)
+ processLayerEvents(events, nbEvents);
+ }
+}
+
+
+```
+
+# Current usage in OpenAir
+
+## UDP, SCTP
+
+Simple threads that interface itti internal messages to Linux
+
+## GTPV1-U, S1AP
+
+Threads to implement S1AP and GTP protocols
+
+## PDCP
+
+4G Pdcp is not following itti design pattern, but it uses itti internally , 5G PDCP uses ad hoc design
+
+## RRC
+
+Implements 3GPP Rrc features
+Interfaces the layer 1 and the above itti tasks
+
+## X2, ENP_APP (configuration), L1L2
+
+Are declared itti queues with a dedicated thread, but they are almost empty
\ No newline at end of file
diff --git a/common/utils/system.c b/common/utils/system.c
index 38d1c1d7ad..93b13f03f2 100644
--- a/common/utils/system.c
+++ b/common/utils/system.c
@@ -95,53 +95,16 @@ static void read_pipe(int p, char *b, int size) {
size -= ret;
}
}
-
-static int baseRunTimeCommand(char* cmd, size_t cmdSize) {
- FILE *fp;
- size_t retSize = 0;
-
- fp = popen(cmd, "r");
- if(fp) {
- memset(cmd, 0, cmdSize);
- retSize = fread(cmd, 1, cmdSize, fp);
- fclose(fp);
- } else {
- LOG_D(HW,"%s:%d:%s: Cannot open %s\n", __FILE__, __LINE__, __FUNCTION__, cmd);
- }
-
- if (retSize == 0) {
- return 0;
- }
- return atoi(cmd);
-}
-
int checkIfFedoraDistribution(void) {
- char cmd[200];
-
- memset(cmd, 0, 200);
- sprintf(cmd, "cat /etc/os-release | grep ID_LIKE | grep -ic fedora || true");
- return baseRunTimeCommand(cmd, 200);
+ return !system("grep -iq 'ID_LIKE.*fedora' /etc/os-release ");
}
int checkIfGenericKernelOnFedora(void) {
- char cmd[200];
-
- memset(cmd, 0, 200);
- sprintf(cmd, "uname -a | grep -c rt || true");
- return (1 - baseRunTimeCommand(cmd, 200));
+ return system("uname -a | grep -q rt");
}
int checkIfInsideContainer(void) {
- char cmd[200];
- int res = 0;
-
- memset(cmd, 0, 200);
- sprintf(cmd, "cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods' || true");
- res = baseRunTimeCommand(cmd, 200);
- if (res > 0)
- return 1;
- else
- return 0;
+ return !system("egrep -q 'libpod|podman|kubepods' /proc/self/cgroup");
}
/********************************************************************/
@@ -257,21 +220,21 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
ret=pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
- ret=pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
- AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
- if (checkIfFedoraDistribution())
- if (checkIfGenericKernelOnFedora())
- if (checkIfInsideContainer())
- settingPriority = 0;
-
+
+ if (system("grep -iq 'ID_LIKE.*fedora' /etc/os-release && uname -a | grep -c rt")==0)
+ if (system("cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods'")==0)
+ settingPriority = 0;
+
if (settingPriority) {
+ ret=pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
+ AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
ret=pthread_attr_setschedpolicy(&attr, SCHED_OAI);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
- if(prioritysched_get_priority_max(SCHED_FIFO)) {
- LOG_E(TMR,"Prio not possible: %d, min is %d, max: %d, forced in the range\n",
- priority,
- sched_get_priority_min(SCHED_OAI),
- sched_get_priority_max(SCHED_OAI));
+ if(prioritysched_get_priority_max(SCHED_OAI)) {
+ LOG_E(UTIL,"Prio not possible: %d, min is %d, max: %d, forced in the range\n",
+ priority,
+ sched_get_priority_min(SCHED_OAI),
+ sched_get_priority_max(SCHED_OAI));
if(prioritysched_get_priority_max(SCHED_OAI))
@@ -283,10 +246,10 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
ret=pthread_attr_setschedparam(&attr, &sparam);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
}
-
+
ret=pthread_create(t, &attr, func, param);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
-
+
pthread_setname_np(*t, name);
if (affinity != -1 ) {
cpu_set_t cpuset;
diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h
index 1839b42f39..a8f8572cfe 100644
--- a/common/utils/threadPool/thread-pool.h
+++ b/common/utils/threadPool/thread-pool.h
@@ -142,7 +142,7 @@ static inline notifiedFIFO_elt_t *pullNotifiedFIFO_nothreadSafe(notifiedFIFO_t
notifiedFIFO_elt_t *ret=nf->outF;
if (nf->outF==nf->outF->next)
- LOG_E(TMR,"Circular list in thread pool: push several times the same buffer is forbidden\n");
+ LOG_E(UTIL,"Circular list in thread pool: push several times the same buffer is forbidden\n");
nf->outF=nf->outF->next;
diff --git a/common/utils/utils.c b/common/utils/utils.c
index 7f7aafc94a..3f32881393 100644
--- a/common/utils/utils.c
+++ b/common/utils/utils.c
@@ -2,6 +2,9 @@
#include
#include
#include
+#include
+#include
+#include
#include "utils.h"
void *calloc_or_fail(size_t size) {
@@ -22,6 +25,32 @@ void *malloc_or_fail(size_t size) {
return ptr;
}
+const char *hexdump(const void *data, size_t data_len, char *out, size_t out_len)
+{
+ char *p = out;
+ char *endp = out + out_len;
+ const uint8_t *q = data;
+ snprintf(p, endp - p, "[%zu]", data_len);
+ p += strlen(p);
+ for (size_t i = 0; i < data_len; ++i)
+ {
+ if (p >= endp)
+ {
+ static const char ellipses[] = "...";
+ char *s = endp - sizeof(ellipses);
+ if (s >= p)
+ {
+ strcpy(s, ellipses);
+ }
+ break;
+ }
+ snprintf(p, endp - p, " %02X", *q++);
+ p += strlen(p);
+ }
+ return out;
+}
+
+
/****************************************************************************
** **
** Name: hex_char_to_hex_value() **
@@ -111,3 +140,17 @@ void *memcpy1(void *dst,const void *src,size_t n) {
asm volatile("rep movsb" : "+D" (dst) : "c"(n), "S"(src) : "cc","memory");
return(ret);
}
+
+void set_priority(int priority)
+{
+ struct sched_param param =
+ {
+ .sched_priority = priority,
+ };
+ fprintf(stderr, "Calling sched_setscheduler(%d)\n", priority);
+ if (sched_setscheduler(0, SCHED_RR, ¶m) == -1)
+ {
+ fprintf(stderr, "sched_setscheduler: %s\n", strerror(errno));
+ abort();
+ }
+}
diff --git a/common/utils/utils.h b/common/utils/utils.h
index 16631586c4..d4337e71a6 100644
--- a/common/utils/utils.h
+++ b/common/utils/utils.h
@@ -10,6 +10,7 @@ extern "C" {
#define sizeofArray(a) (sizeof(a)/sizeof(*(a)))
void *calloc_or_fail(size_t size);
void *malloc_or_fail(size_t size);
+const char *hexdump(const void *data, size_t data_len, char *out, size_t out_len);
// Converts an hexadecimal ASCII coded digit into its value. **
int hex_char_to_hex_value (char c);
@@ -18,6 +19,7 @@ int hex_string_to_hex_value (uint8_t *hex_value, const char *hex_string, int siz
void *memcpy1(void *dst,const void *src,size_t n);
+void set_priority(int priority);
char *itoa(int i);
diff --git a/doc/F1-design.md b/doc/F1-design.md
new file mode 100644
index 0000000000..80417b1ae3
--- /dev/null
+++ b/doc/F1-design.md
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+
+
+
+ F1 split design
+
+
+
+# 1. Introduction
+
+We use OpenAirInterface source code, and it's regular deployment scheme.
+
+F1 specification is in 3GPP documents: TS 38.470 header document and all documents listed in chapter 2 References of TS 38.470.
+
+This document explains how the source code works.
+
+Offered features and deployment instructions are described in:
+https://gitlab.eurecom.fr/oai/openairinterface5g/-/wikis/f1-interface
+
+# 2. Common multi-threading architecture #
+
+The CU and DU interfaces are based on ITTI threads (see oai/common/utils/ocp_itti/itti.md)
+
+All OAI upper layers use the ITTI framework to run isolated threads dedicated to one feature.
+The lower layers adopt case by case specific software architecture.
+
+```mermaid
+graph TD
+Linux[configuration file] --> APP[gNB_app_task]
+Socks[Linux UDP] --> GTP[nr_gtpv1u_gNB_task]
+APP --> CU
+APP --> DU
+A[Linux SCTP] -->|sockets| SCTP(OAI itti thread TASK_SCTP)
+SCTP-->|TASK_NGAP| NG[ngap_gNB_task]
+NG-->|TASK_SCTP| SCTP
+SCTP-->|TASK_DU_F1| DU[F1AP_DU_task]
+SCTP-->|TASK_CU_F1| CU[F1AP_CU_task]
+CU-->|TASK_RRC_GNB| RRC
+RRC -->|non ITTI| PHY[OAI L1+L2]
+RRC -->|API calls to create tunnels| GTP
+PHY --> |user plane| GTP
+CU --> |TASK_GTPV1_U| GTP
+DU --> |TASK_GTPV1_U| GTP
+```
+A "task" is a Linux thread running infinite waiting loop on one ITTI queue
+
+app task manages the initial configuration
+
+sctp task mamanges the SCTP Linux sockets
+
+CU code runs in the task F1AP_CU_task. It stores it's private data context in a static variable. No mutex is used, as the single interface to CU ITTI tast in incoming ITTI messages. CU task is a single ITTI queue, but multiple CU could exist in one Linux process, using the "instance id" (called "module id" also) to create separate contextual information for each CU instance.
+
+DU code runs in the task F1AP_DU_task. The design is similar to CU task
+
+All GTP-U tunnels are managed in a Linux Thread, that have partially ITTI design:
+
+1. tunnel creation/deletion is by C API functions direct calls (a mutex protects it)
+2. outgoing packets are pushed in a ITTI queue to the gtp thread
+3. incoming packets are sent to the tunnel creator using a C callback (the callback function is given in tunnel creation order). The callback should not block
+
+
+# 3. CU F1AP messages #
+
+## startup
+
+CU thread starts when the CU starts. It opens listening socket on F1AP_PORT_NUMBER by sending the appropriate message to TASK_SCTP.
+
+It will accept the first incoming connection on this port
+
+## F1 SETUP
+
+DU has connected, and sent this message.
+
+The CU receives, decode it and send relevant information to RRC thread by message F1AP_SETUP_REQ
+
+## F1 SETUP response
+
+RRC sends two messages to CU F1 task: the information to encode the F1 setup response and a second message to encode F1AP_GNB_CU_CONFIGURATION_UPDATE
+
+Upon reception of these two messages the CU task encodes and sends the messages to the DU
+
+## UE entry
+
+When CCH channel decoding finds a new UE identity, it call rrc_gNB_generate_RRCSetup() that will send F1AP_DL_RRC_MESSAGE to the CU task.
+
+The CU encodes and sends to DU DLRRCMessageTransfer
+
+## UE attach/detach
+
+When rrc_gNB_process_RRCReconfigurationComplete() occurs, the RRC sends to CU task the message F1AP_UE_CONTEXT_SETUP_REQ. The CU task encodes the F1 message UEContextSetup and send it to the DU over F1AP.
+
+This function rrc_gNB_process_RRCReconfigurationComplete() also creates the GTP-U user plane bearers.
+
+## F1AP incoming messages
+
+SCTP tasks sends a ITTI message SCTP_DATA_IND to the CU task.
+
+A array of functions pointers and the F1AP standard identifier "procedureCode", the CU calls the appropriate function
+
+Hereafter the most significant messages processing
+
+### CU_handle_F1_SETUP_REQUEST
+
+Transcodes information to the same message toward RRC (F1AP_SETUP_REQ)
+
+### CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER
+
+Transcodes information to the same message toward RRC (NR_RRC_MAC_CCCH_DATA_IND)
+
+### CU_handle_UL_RRC_MESSAGE_TRANSFER
+
+Encode and send data to PDCP (calling pdcp_data_ind ()) for processing UL data.
+
+# DU F1 Messages
+
+## Startup
+
+The task "gNB app" after rzading the configuration file, sends a first message F1AP_SETUP_REQ to DU task
+
+Using this message, the uniq DU task (Linux Thread) creates a DU instance context memory space, calls SCTP task to create a socket to the CU.
+
+When it receives from the SCTP task the socket creation success, the DU task encodes+sends the F1 setup message to the CU.
+
+## F1AP_INITIAL_UL_RRC_MESSAGE
+
+When MAC layer push UL data to DU task, the DU sends to CU the message InitialULRRCMessageTransfer
+
+## F1AP_UL_RRC_MESSAGE
+
+In case of SRB bearer, the RLC layer use this message to push rlc bearer payload to DU task, that forward to CU
+
+## pdcp_data_ind
+
+This function call in RLC, when it is a DRB will be replaced by F1-U transport to CU
+
+## F1AP incoming messages
+
+SCTP tasks sends a ITTI message SCTP_DATA_IND to the DU task.
+
+A array of functions pointers and the F1AP standard identifier "procedureCode", the DU calls the appropriate function
+
+Hereafter the most significant messages processing
+
+### DU_send_F1_SETUP_RESPONSE
+
+Decode the CU message, then encode a message to TASK_GNB_APP. The thread "APP" extracts the system information block and reconfigure the DU with: du_extract_and_decode_SI(), configure_gnb_du_mac()
+
+### DU_handle_gNB_CU_CONFIGURATION_UPDATE
+
+No developped
+
+### DU_handle_UE_CONTEXT_SETUP_REQUEST
+
+Push data to RLC layer for transmisstion in DL (to the UE) by calling enqueue_rlc_data_req()
+
+### DU_handle_DL_RRC_MESSAGE_TRANSFER
+
+Depending on the content, adds UE context in DU low layers and/or send data to the UE with rlc_data_req()
+
+# F1-U messages
+
+The data path by itself doesn't make any difficulty:
+1. for UL, rlc calls pdcp_data_ind (DRB) or sends a message to RRC (SRB). So, we can replace pdcp_data_ind() by du_pdcp_data_ind() that will push the message in the GTP tunnel. In CU, assuming the tunnel is in place, the right call back decapsulate the transport (cu_ul_recv()), then calls pdcp_data_ind() in CU
+The SRB are sent in DU RRC tasks via itti F1AP_UL_RRC_MESSAGE (see above the processing)
+2. For DL, pdcp (in CU for DRBs) calls rlc_data_req (by a decoupling queue and thread rlc_data_req_thread, so function du_rlc_data_req() or enqueue_rlc_data_req()). in DU, assuming the gtp-u tunnel exists, a reception call back (du_dl_recv()) decapsulate the gtp-u packet and calls du_rlc_data_req()
+
+Hereafter the processing design, that doesn't require to setup a new context storage, as we can use the GTP-U internal tables: rnti+rb=>teid for outgoing gtp-u packets and teid=>rnti+rb for incoming gtp-u packets
+
+In CU case, the DRB tunnel to DU and the tunnel on N3 have the same key (rnti, rb id), but they run in two different GTP-U instances.
+Each instance binds on diffrent sockets.
+
+For F1-U, both DU and CU binds on the full quadruplet (IP source, port source, IP destination, port destination) from the configuration file parameters:
+local_s_address, remote_s_address,local_s_portd, remote_s_portd
+
+These 4 values are in:
+CU: at cell level (same level as nr_cellid parameter), they are read if tr_s_preference = "f1"; is set
+DU: in block MACRLCs, if tr_n_preference = "f1"; is set in this block
+
+## tunnels setup
+In GTP-U, TS 29.281 specifies a option header (NR RAN Container This extension header may be transmitted in a G-PDU over the X2-U, Xn-U and F1-U user plane interfaces), but it is not mandatory optional header (as is the N3 one).
+
+So, we can use this header a something reliable with other vendors implementation.
+
+In DL, we need to associate the packet with: rnti, rb (radio bearer) and "mui" (a OAI internal id that is optional and may be removed soon) to call rlc_data_req()
+
+In UL, we need also the RNTI, the rb
+
+So, we need to create a gtp-u tunnel for each rb over F1, then manage in CU and DU the association between a uniq TEid and the pair(rnti, rb). This is already what we have in existing OAI GTP-U layer interface.
+
+In F1AP, for each "DRB to Be Setup Item IEs", we have a field TNL (transport network layer) to set a specific GTP tunnel (@IP, TEid, udp port is always 2152). This is the same for each message related to DRBs. (F1AP carries the SRB payload inside F1AP).
+
+So, For each F1AP containing DRB setup/modification/deletion, the related GTP-U tunnels will be modified one to one.
+The exception is the intialisation of new tunnel: in the call to tunnel creation, we need to send the remote TEID, but we don't know yet if we are the initial source. In this case, we issue a dummy (0xFFFF) remote teid; when we receive the remote answer, we get the source teid, that we can inform GTP-U with (using update tunnel).
+
+## processing on GTP-U incoming message
+
+Du_dl_recv() or cu_ul_recv() are called because we have set this callbacks in creat/update tunnel calls to gtp-u. As gtp-u maintains a pair(rnti,rbid) associated to each tunnel, the functions can be very simple stateless callback that calls pdcp_data_ind() or rlc_data_req() to get back in normal processing path
+
+## CU/DU outgoing
+
+DU rlc north output goes to du_pdcp_data_ind() that push a outgoing packet request to gtp-u, using the rnti+rb as ids. GTP-U must have the tunnel existing, then it simply implement the same as in N3 for exemple.
+
+CU pdcp south output calls cu_rlc_data_ind() that do the same symetric processing.
+
+
diff --git a/doc/SW_archi.md b/doc/SW_archi.md
index e5856d63bc..0593863102 100644
--- a/doc/SW_archi.md
+++ b/doc/SW_archi.md
@@ -304,25 +304,36 @@ gtpv1u_create_s1u_tunnel(), delete tunnel, ... functions are called inside the o
# New GTP
## initialization
-Coexistance until full merge with legacy GTP
-cmake new option: NEW_GTPU to use the new implementation (it changes for the entire executable)
-It is possible to use both old and new GTP in same executable because the itti task and all functions names are different
-Current status of new implementation: not tested, X2 not developped, 5G new GTP option not developped, remain issues on data coming from void: muid, enb_flag, ...
ocp_gtpv1uTask(): this creates only the thread, doesn't configure anything
gtpv1Init(): creates a listening socket to Linux for a given reception and select a local IP address
-newGtpuCreateTunnel() this function will replace the xxx_create_tunnel_xxx() for various cases
-This creates a outgoing context for a teid (in input), it computes and return the incoming teid that will be used for incoming packets
-These teids and in a "instance", so in a Linux socket: same teid can co-exist for different sockets
- Remain here a lack to fill: the information given in the legacy funtions is not enough to fullfil the data needed by the callback
-stuff like enb_flag, but also mui and more important data are not given explicitly by any legacy function (gtpv1u_create_s1u_tunnel), but the legacy and the new interface to lower layer (like pdcp) require this data.
-The datamodel is still not fully understood, so this data source remain unknown
-A new parameter is the callback function: will be pdpcp_data_req() and gtpv_data_req() (x2 case) for existing implementation and later other call backs like the F1-U implementation.
+## newGtpuCreateTunnel()
+this function will replace the xxx_create_tunnel_xxx() for various cases
+The parameters are:
+1. outgoing TEid, associated with outpoing pair(rnti, id)
+2. incoming packets callback, incoming pair(rnti,id) and a callback function for incoming data
-incoming packets
-the gtp layer retrieves the data, the teid, find out the related data: rnti, bearer and quite a lot of other parameters (not clear why, because it looks like all is statefull, so the lower layer should have the context)
-if lower layers can be stateless, it is a good idea to keep the context in the gtp layer and pass it to the callback, but the design remain obfuscated.
+## outgoing packets
+
+Each call to newGtpuCreateTunnel() creates a outgoing context for a teid (given as function input), a pair(rnti,outgoing id).
+ Each outgoing packet received on GTP-U ITTI queue must match one pair(rnti,id), so the gtp-u thread can lookup the related TEid and use it to encode the outpoing GTP-U tunneled packet.
+
+## incoming packets
+
+newGtpuCreateTunnel() computes and return the incoming teid that will be used for incoming packets.
+When a incoming packet arrives on this incoming teid, the GTP-U thread calls the defined callback, with the associated pair(rnti, incoming id).
+
+stuff like enb_flag, mui and more important data are not given explicitly by any legacy function (gtpv1u_create_s1u_tunnel), but the legacy and the new interface to lower layer (like pdcp) require this data. We hardcode it in first version.
+
+## remaining work
+These teids and "instance", so in a Linux socket: same teid can co-exist for different sockets
+ Remain here a lack to fill: the information given in the legacy funtions is not enough to fullfil the data needed by the callback
+
+Coexistance until full merge with legacy GTP
+cmake new option: NEW_GTPU to use the new implementation (it changes for the entire executable)
+It is possible to use both old and new GTP in same executable because the itti task and all functions names are different
+Current status of new implementation: not tested, X2 not developped, 5G new GTP option not developped, remain issues on data coming from void: muid, enb_flag, ...
# NGAP
NGAP would be a itti thread as is S1AP (+twin thread SCTP that is almost void processing)?
diff --git a/doc/TESTING_5GSA_setup.md b/doc/TESTING_5GSA_setup.md
index 475123c990..048d8c86ff 100644
--- a/doc/TESTING_5GSA_setup.md
+++ b/doc/TESTING_5GSA_setup.md
@@ -95,7 +95,7 @@ To get the code and build the gNB executable:
./build_oai --gNB -w USRP
```
-A reference configuration file for the gNB is provided [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf).
+A reference configuration file for the **monolithic** gNB is provided [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf).
In the following, we highlight the fields of the file that have to be configured according to the configuration and interfaces of the Core Network. First, the PLMN section has to be filled with the proper values that match the configuration of the AMF and the UE USIM.
@@ -194,6 +194,8 @@ The SA setup with OAI UE has been validated with **RFSIMULATOR**. Both control p
In the following, we provide the instructions on how to build, configure and execute this SA setup.
+As another option, if you do not want to build anything and instead deploy the OAI RAN (RFSIMULATOR) and Core Network components directly using docker images and docker-compose, please have a look at [this tutorial](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/ci-scripts/yaml_files/5g_rfsimulator/README.md).
+
### NAS configuration for the OAI UE
The NAS configuration parameters of the OAI UE can be set as input parameters, configuration file or can be hardcoded. More specifically:
- SUCI (*Subscription Concealed Identifier*)
@@ -245,7 +247,6 @@ The gNB configuration can be performed according to what is described in [sectio
## 2.2 OAI 5G Core Network installation and configuration
The instructions for the installation of OAI CN components (AMF, SMF, NRF, UPF) using `docker-compose` can be found [here](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/README.md).
-In addition, if you do not want to build anything, please have a look at [this tutorial](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/ci-scripts/yaml_files/5g_rfsimulator/README.md).
## 2.3 Execution of SA scenario
diff --git a/doc/episys/Channel_Abstraction_UE_Handling_LTE.PNG b/doc/episys/Channel_Abstraction_UE_Handling_LTE.PNG
new file mode 100644
index 0000000000..5e40d6ac17
Binary files /dev/null and b/doc/episys/Channel_Abstraction_UE_Handling_LTE.PNG differ
diff --git a/doc/episys/Proxy_Interface_Diagram.PNG b/doc/episys/Proxy_Interface_Diagram.PNG
new file mode 100644
index 0000000000..a734f3d4b0
Binary files /dev/null and b/doc/episys/Proxy_Interface_Diagram.PNG differ
diff --git a/doc/episys/functional_diagram_proxy_lte.png b/doc/episys/functional_diagram_proxy_lte.png
new file mode 100644
index 0000000000..e2a3a2c868
Binary files /dev/null and b/doc/episys/functional_diagram_proxy_lte.png differ
diff --git a/doc/episys/functional_diagram_proxy_nsa.png b/doc/episys/functional_diagram_proxy_nsa.png
new file mode 100644
index 0000000000..4a555d12ea
Binary files /dev/null and b/doc/episys/functional_diagram_proxy_nsa.png differ
diff --git a/doc/episys/lte_mode_l2_emulator/README.txt b/doc/episys/lte_mode_l2_emulator/README.txt
new file mode 100644
index 0000000000..7b555b8442
--- /dev/null
+++ b/doc/episys/lte_mode_l2_emulator/README.txt
@@ -0,0 +1,49 @@
+There are fundamental changes to the L2 emulation mechanism; these changes allow the
+user to run multiple UEs in separate Linux processes/machines/VMs/etc. They use a separate
+entity between the UE(s) and eNB. The UEs use nFAPI to communicate with the eNB. The
+nFAPI interface allows us to run in an emulated layer 2 mode, meaning that we are bypassing
+the layer 1 (PHY) functionality. Because we are bypassing the PHY layer,
+channel modeling capabilties have been added in the LTE UE phy_stub_ue.c file. To understand
+the interfaces between the different components associated with LTE mode, the image
+functional_diagram_proxy_lte.png has been provided.
+
+This functionality allows the user to plug in their own channel model and emulate the packet dropping procedure
+in real time. The channel modeling has not been provided by EpiSci, but the OAI code
+base already has some BLER curves available for use. The channel modeling functionality
+that is included in the phy_stub_ue.c file only includes the downlink channel modeling.
+Any uplink channel modeling must be conducted in some sort of proxy, which would sit
+between the UEs and eNB. (A description of the downlink channel modeling is shown in the
+Channel_Abstraction_UE_Handling_LTE.PNG image).
+
+The updates to the OAI code base removed some latent bugs, added multi-UE scalability,
+and were tested with a standard bypass proxy between the UE(s) and eNB. The bypass proxy is
+publicly available on GitHub (https://github.com/EpiSci/oai-lte-multi-ue-proxy). With this package,
+various multi-UE scenarios can be tested without the overhead of PHY-layer features
+of underlying radios. The features added in the L2 Emulator Mode for LTE are:
+
+ - Ease of use of gprof and address sanitizer for debugging purposes
+ - Updated json files to allow for GDB, real-time debugging capabilities
+ - Updated logging features to minimally log only key connection milestones. This improves scalability of multiple UEs.
+The logging mechanism described here is located in the log.c and log.h files. The LOG_MINIMAL
+function allows us to remove most OAI logging and includes LOG_A(...) logs and above. The LOG_A
+logs were chosen as analysis logs to meet EpiSci's internal testing procedure. The LOG_As
+only include logs that are considered to be milestones in a given test. For example, a
+log indicating that the RACH procedure has been completed for LTE. To select full logging,
+set LOG_MINIMAL = 0 in the log.h file.
+ - Updated logging to include time stamp for timing analysis
+ - Updated memory allocation procedures to correct size requirements
+ - Added debugging features to handle signal terminations
+ - nfapi.c pullarray8 fix invalid pointer math
+ - Overlapping destination and source memory in memcpy, so updated to memmove to check for this bug
+ - Advanced error checking mechanisms in critical pack and unpack functions
+ - Created option for CPU assignment to UE to improve scalability
+ - Added EPC integration to allow multiple individual UE entities to each have their USIM information parsed by the executables
+ - Updated random value seeds to minimize probability of error in generation of random values
+ - Enables capability round robin scheduler if desired
+ - Enables capability real time scheduler if desired
+ - Added new standalone functions to the UE phy-layer (phy_stub_ue.c) to incorporate individual UE entities
+ - Updated sending and packing functions in UE (lte_ue.c) to incorporate new standalone changes
+ - Incorporated semaphores to control timing of incoming downlink packets
+ - Implemented new queuing system to handle message exchange from UE to eNB and vice versa
+ - Updated global value in nFAPI for size of subframe
+ - Updated global value to increase scalability in system
diff --git a/doc/episys/nsa_mode_l2_emulator/README.txt b/doc/episys/nsa_mode_l2_emulator/README.txt
new file mode 100644
index 0000000000..fefaf63f44
--- /dev/null
+++ b/doc/episys/nsa_mode_l2_emulator/README.txt
@@ -0,0 +1,94 @@
+There are fundamental changes to the L2 emulation mechanism; these changes allow the
+user to run multiple UEs in separate Linux processes/machines/VMs/etc. They use a separate
+entity between the UE(s) and eNB/gNB. The UEs use nFAPI to communicate with the eNB/gNB. The
+nFAPI interface allows us to run in an emulated L2 mode, meaning that we are bypassing
+the layer 1 (PHY) layer functionality. Becasue we are bypassing the PHY layer, special
+channel modeling capabilty has been added in the LTE UE phy_stub_ue.c file. To understand
+the interfaces between the different components associated with NSA mode, the image
+functional_diagram_proxy_nsa.png has been provided.
+
+This functionality allows the user to plug in their own channel model and emulate the packet dropping procedure
+in real time. The channel modeling has not been provided by EpiSci, but the OAI code
+base already has some BLER curves available for use. The chanel modeling functionality
+that is included in the phy_stub_ue.c file only includes the downlink channel modeling.
+Any uplink channel modeling must be conducted in some sort of proxy, which would sit
+between the UEs and eNB/gNB. (A description of the downlink channel modeling is shown in the
+Channel_Abstraction_UE_Handling_LTE.PNG image).
+
+The updates to the OAI code base removed some latent bugs, added multi-UE scalability,
+and were tested with a standard bypass proxy between the UE(s) and eNB/gNB. The bypass proxy is
+publicly available on GitHub (https://github.com/EpiSci/oai-lte-multi-ue-proxy). With this package,
+various multi-UE scenarios can be tested without the overhead of PHY-layer features
+of underlying radios. The added features to the OAI code base are listed below.
+
+ - Ease of use of gprof and address sanitizer for debugging purposes
+ - Updated json files to allow for GDB, real-time debugging capabilities
+ - Updated logging features to minimally log only key connection milestones. This improves scalability of multiple UEs.
+The logging mechanism described here is located in the log.c and log.h files. The LOG_MINIMAL
+function allows us to remove most logs and include LOG_A(...) logs and above. The LOG_A
+logs were chosen as analysis logs to meet EpiSci's internal testing procedure. The LOG_As
+only include logs that are considered to be milestones in a given test. For example, a
+log indicating that the CFRA procedure has been completed for NSA mode. To revert to full logging,
+set LOG_MINIMAL = 0 in the log.h file.
+ - Updated logging to include time stamp for timing analysis
+ - Updated memory allocation procedures to correct size requirements
+ - Added debugging features to handle signal terminations
+ - nfapi.c pullarray8 fix invalid pointer math
+ - Overlapping destination and source memory in memcpy, so updated to memmove to check for this bug
+ - Advanced error checking mechanisms in critical pack and unpack functions
+ - Created option for CPU assignment to UE to improve scalability
+ - Added EPC integration to allow multiple individual UE entities to each have their USIM information parsed by the executables
+ - Updated random value seeds to minimize probability of error in generation of random values
+ - Enables capability round robin scheduler if desired
+ - Enables capability real time scheduler if desired
+ - Added new standalone functions to the UE phy-layer (phy_stub_ue.c) to incorporate individual UE entities
+ - Updated sending and packing functions in UE (lte_ue.c) to incorporate new standalone changes
+ - Incorporated semaphores to control timing of incoming downlink packets
+ - Implemented new queuing system to handle message exchange from UE to eNB and vice versa
+ - Updated global value in nFAPI for size of subframe
+ - Updated global value to increase scalability in system
+
+
+Additionally, NSA mode includes the establishment between an NR UE and the gNB via the LTE UE and eNB
+connection. For NSA mode, the downlink channel abstraction has not been added to the feature set yet.
+NSA mode has been tested and is fully functional with EpiSci's public version of the nFAPI proxy
+located at https://github.com/EpiSci/oai-lte-multi-ue-proxy
+NSA mode establishment includes the following steps:
+
+ - First UE capability enquiry is sent to NR UE
+ - NR UE updates and fills first capability enquiry
+ - eNB request for a measurement report
+ - Measurement request is sent to NR UE
+ - Measurement report is filled in NR UE
+ - Measurement report is received in eNB
+ - Request for second UE capability enquiry
+ - Send second enquiry to NR UE
+ - Second capability information is filled by NR UE
+ - Second capability information is sent to eNB
+ - NR UE capability information is received in gNB
+ - Periodic measurement report received in gNB
+ - RRCReconfigurationRequest is sent to NR UE
+ - RRCReconfigurationComplete is sent from NR UE
+ - RACH is received in the gNB
+ - RAR is received in NR UE
+ - Msg 3 is generated and sent to gNB
+ - CFRA procedure is complete
+
+Please note, the current status is:
+ - A single NSA UE is able to ping an external source
+ - Up to 4 NSA UEs can complete the CFRA procedure with a single gNB
+ - UE-to-UE traffic is still in work (incomplete due to gNB crashing)
+ - The gNB is crashing regularly and is still in work
+
+Test Setup:
+For launching the multi-UE for NSA mode, there is a provided test script in the
+public EpiSci GitHub multi-ue-proxy repository. However, a brief outline of the
+test set up is included below.
+
+ If running multiple NSA UEs in a single machine, you will need to launch
+ multiple LTE and NR UE processes. For example, to launch a 2 NSA UE scenario
+ there will be a total of 7 processes running for this particular scenario.
+ These processes are LTE UE #1, LTE UE #2, NR UE #1, NR UE #2, eNB, gNB and the
+ proxy. A detailed description of the launch processes can be found at
+ https://github.com/EpiSci/oai-lte-multi-ue-proxy/blob/master/README.md
+
diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py
index cc4b72a703..3d037294e6 100644
--- a/docker/scripts/generateTemplate.py
+++ b/docker/scripts/generateTemplate.py
@@ -55,6 +55,8 @@ def main():
"rcc.band40.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"gnb.band78.tm1.fr1.106PRB.usrpb210.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"gnb.band78.sa.fr1.106PRB.usrpn310.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ "gNB_SA_CU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ "gNB_SA_DU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"ue.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"ue_sim_ci": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}'
}
@@ -77,6 +79,10 @@ def main():
templine = re.sub(r'sd = 0x1;', 'sd = 0x@NSSAI_SD0@;', line)
outputfile.write(templine)
continue
+ if re.search(r'sd = 0x010203;', line):
+ templine = re.sub(r'sd = 0x010203;', 'sd = 0x@NSSAI_SD0@;', line)
+ outputfile.write(templine)
+ continue
if re.search(r'sd = 0x112233;', line):
templine = re.sub(r'sd = 0x112233;', 'sd = 0x@NSSAI_SD1@;', line)
outputfile.write(templine)
diff --git a/docker/scripts/gnb_entrypoint.sh b/docker/scripts/gnb_entrypoint.sh
index 2fe743920e..79d6c6dc37 100755
--- a/docker/scripts/gnb_entrypoint.sh
+++ b/docker/scripts/gnb_entrypoint.sh
@@ -7,8 +7,11 @@ ENABLE_X2=${ENABLE_X2:-yes}
THREAD_PARALLEL_CONFIG=${THREAD_PARALLEL_CONFIG:-PARALLEL_SINGLE_THREAD}
# Based another env var, pick one template to use
+
if [[ -v USE_NSA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.nsa.tdd.conf $PREFIX/etc/gnb.conf; fi
if [[ -v USE_SA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.tdd.conf $PREFIX/etc/gnb.conf; fi
+if [[ -v USE_SA_CU ]]; then ln -s $PREFIX/etc/gnb.sa.cu.conf $PREFIX/etc/gnb.conf; fi
+if [[ -v USE_SA_TDD_CU ]]; then cp $PREFIX/etc/gnb.sa.du.tdd.conf $PREFIX/etc/gnb.conf; fi
# Sometimes, the templates are not enough. We mount a conf file on $PREFIX/etc. It can be a template itself.
if [[ -v USE_VOLUMED_CONF ]]; then cp $PREFIX/etc/mounted.conf $PREFIX/etc/gnb.conf; fi
diff --git a/docker/scripts/gnb_parameters.yaml b/docker/scripts/gnb_parameters.yaml
index ac5a6cb971..2f150d394a 100644
--- a/docker/scripts/gnb_parameters.yaml
+++ b/docker/scripts/gnb_parameters.yaml
@@ -94,3 +94,81 @@
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
+ - filePrefix: gNB_SA_CU.conf
+ outputfilename: "gnb.sa.cu.conf"
+ config:
+ - key: Active_gNBs
+ env: "@GNB_NAME@"
+ - key: gNB_name
+ env: "@GNB_NAME@"
+ - key: mcc
+ env: "@MCC@"
+ - key: mnc
+ env: "@MNC@"
+ - key: mnc_length
+ env: "@MNC_LENGTH@"
+ - key: tracking_area_code
+ env: "@TAC@"
+ - key: sst
+ env: "@NSSAI_SST@"
+ - key: ipv4
+ env: "@AMF_IP_ADDRESS@"
+ - key: GNB_INTERFACE_NAME_FOR_NG_AMF
+ env: "@GNB_NGA_IF_NAME@"
+ - key: GNB_IPV4_ADDRESS_FOR_NG_AMF
+ env: "@GNB_NGA_IP_ADDRESS@"
+ - key: GNB_INTERFACE_NAME_FOR_NGU
+ env: "@GNB_NGU_IF_NAME@"
+ - key: GNB_IPV4_ADDRESS_FOR_NGU
+ env: "@GNB_NGU_IP_ADDRESS@"
+ - key: local_s_if_name
+ env: "@F1_IF_NAME@"
+ - key: local_s_address
+ env: "@F1_CU_IP_ADDRESS@"
+ - key: local_s_portd
+ env: "@F1_CU_D_PORT@"
+ - key: remote_s_address
+ env: "@F1_DU_IP_ADDRESS@"
+ - key: remote_s_portd
+ env: "@F1_DU_D_PORT@"
+
+ - filePrefix: gNB_SA_DU.conf
+ outputfilename: "gnb.sa.du.tdd.conf"
+ config:
+ - key: Active_gNBs
+ env: "@GNB_NAME@"
+ - key: gNB_name
+ env: "@GNB_NAME@"
+ - key: mcc
+ env: "@MCC@"
+ - key: mnc
+ env: "@MNC@"
+ - key: mnc_length
+ env: "@MNC_LENGTH@"
+ - key: tracking_area_code
+ env: "@TAC@"
+ - key: sst
+ env: "@NSSAI_SST@"
+ - key: ipv4
+ env: "@AMF_IP_ADDRESS@"
+ - key: GNB_INTERFACE_NAME_FOR_NG_AMF
+ env: "@GNB_NGA_IF_NAME@"
+ - key: GNB_IPV4_ADDRESS_FOR_NG_AMF
+ env: "@GNB_NGA_IP_ADDRESS@"
+ - key: GNB_INTERFACE_NAME_FOR_NGU
+ env: "@GNB_NGU_IF_NAME@"
+ - key: GNB_IPV4_ADDRESS_FOR_NGU
+ env: "@GNB_NGU_IP_ADDRESS@"
+ - key: parallel_config
+ env: "@THREAD_PARALLEL_CONFIG@"
+ - key: local_n_if_name
+ env: "@F1_IF_NAME@"
+ - key: local_n_address
+ env: "@F1_DU_IP_ADDRESS@"
+ - key: local_n_portd
+ env: "@F1_DU_D_PORT@"
+ - key: remote_n_address
+ env: "@F1_CU_IP_ADDRESS@"
+ - key: remote_n_portd
+ env: "@F1_CU_D_PORT@"
+
diff --git a/executables/main-fs6.c b/executables/main-fs6.c
index 438edb4044..9e92f2e41a 100644
--- a/executables/main-fs6.c
+++ b/executables/main-fs6.c
@@ -553,7 +553,11 @@ void fill_rx_indication_from_split(uint8_t *bufferZone, PHY_VARS_eNB *eNB,int UE
pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
pdu->rx_indication_rel8.length = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3;
pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
- pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->decodedBytes;
+ AssertFatal(pdu->rx_indication_rel8.length <= NFAPI_RX_IND_DATA_MAX, "Invalid PDU len %d\n",
+ pdu->rx_indication_rel8.length);
+ memcpy(pdu->rx_ind_data,
+ eNB->ulsch[UE_id]->harq_processes[harq_pid]->decodedBytes,
+ pdu->rx_indication_rel8.length);
// estimate timing advance for MAC
timing_advance_update = ul_propa[UE_id].ta;
diff --git a/executables/main-ocp.c b/executables/main-ocp.c
index 0355582b2b..ab31eaaa4f 100644
--- a/executables/main-ocp.c
+++ b/executables/main-ocp.c
@@ -81,17 +81,16 @@ int otg_enabled;
uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
int split73;
-char * split73_config;
+char *split73_config;
int split73;
AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]= {0};
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]= {0};
-uint8_t proto_agent_flag = 0;
void flexran_agent_slice_update(mid_t module_idP) {
}
-int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p){
- return 0;
+int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p) {
+ return 0;
}
-void proto_agent_stop(mod_id_t mod_id){
+void proto_agent_stop(mod_id_t mod_id) {
}
static void *ru_thread( void *param );
@@ -112,7 +111,6 @@ void exit_function(const char *file, const char *function, const int line, const
close_log_mem();
oai_exit = 1;
-
sleep(1); //allow lte-softmodem threads to exit first
exit(1);
}
@@ -145,14 +143,16 @@ void init_RU_proc(RU_t *ru) {
pthread_t t;
switch(split73) {
- case SPLIT73_CU:
- threadCreate(&t, cu_fs6, (void *)ru, "MainCu", -1, OAI_PRIORITY_RT_MAX);
- break;
- case SPLIT73_DU:
- threadCreate(&t, du_fs6, (void *)ru, "MainDuRx", -1, OAI_PRIORITY_RT_MAX);
- break;
- default:
- threadCreate(&t, ru_thread, (void *)ru, "MainRu", -1, OAI_PRIORITY_RT_MAX);
+ case SPLIT73_CU:
+ threadCreate(&t, cu_fs6, (void *)ru, "MainCu", -1, OAI_PRIORITY_RT_MAX);
+ break;
+
+ case SPLIT73_DU:
+ threadCreate(&t, du_fs6, (void *)ru, "MainDuRx", -1, OAI_PRIORITY_RT_MAX);
+ break;
+
+ default:
+ threadCreate(&t, ru_thread, (void *)ru, "MainRu", -1, OAI_PRIORITY_RT_MAX);
}
}
@@ -161,7 +161,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
LOG_I(PHY, "Initialise transport\n");
- for (int i=0; idlsch[i][j]->rnti=0;
LOG_D(PHY,"dlsch[%d][%d] => %p rnti:%d\n",i,j,eNB->dlsch[i][j], eNB->dlsch[i][j]->rnti);
}
+ }
+ for (int i=0; iulsch[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0)) != NULL,
"Can't get eNB ulsch structures\n");
@@ -198,6 +200,9 @@ void init_transport(PHY_VARS_eNB *eNB) {
eNB->FULL_MUMIMO_transmissions = 0;
eNB->check_for_SUMIMO_transmissions = 0;
fp->pucch_config_common.deltaPUCCH_Shift = 1;
+
+ if (eNB->use_DTX == 0)
+ fill_subframe_mask(eNB);
}
void init_eNB_afterRU(void) {
@@ -228,25 +233,23 @@ void init_eNB_afterRU(void) {
for (int ce_level=0; ce_level<4; ce_level++)
eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[ru_id]->prach_rxsigF_br[ce_level][i];
-
}
}
-
AssertFatal( eNB->frame_parms.nb_antennas_rx > 0 && eNB->frame_parms.nb_antennas_rx < 5, "");
AssertFatal( eNB->frame_parms.nb_antennas_tx > 0 && eNB->frame_parms.nb_antennas_rx < 5, "");
-
phy_init_lte_eNB(eNB,0,0);
// need to copy rxdataF after L1 variables are allocated
for (int inst=0; instnum_RU; ru_id++) {
- for (int i=0; iRU_list[ru_id]->nb_rx; aa++,i++)
- eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
- }
- }
+ for (int CC_id=0; CC_idnum_RU; ru_id++) {
+ for (int i=0; iRU_list[ru_id]->nb_rx; aa++,i++)
+ eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
+ }
+ }
}
LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
@@ -300,7 +303,7 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
openair0_config_t *cfg = &ru->openair0_cfg;
//printf("////////////////numerology in config = %d\n",numerology);
- int numerology = get_softmodem_params()->numerology;
+ int numerology = 0; //get_softmodem_params()->numerology;
if(fp->N_RB_DL == 100) {
if(numerology == 0) {
@@ -347,7 +350,8 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
cfg->samples_per_frame = 19200;
cfg->tx_bw = 1.5e6;
cfg->rx_bw = 1.5e6;
- } else AssertFatal(1==0,"Unknown N_RB_DL %d\n",fp->N_RB_DL);
+ } else
+ AssertFatal(1==0,"Unknown N_RB_DL %d\n",fp->N_RB_DL);
if (fp->frame_type==TDD)
cfg->duplex_mode = duplex_mode_TDD;
@@ -468,7 +472,8 @@ void ocp_rx_prach(PHY_VARS_eNB *eNB,
((prach_mask&(1<<(i+1))) > 0)) { // check that prach CE level is active now
// if first reception in group of repetitions store frame for later (in RA-RNTI for Msg2)
- if (eNB->prach_vars_br.repetition_number[i]==0) eNB->prach_vars_br.first_frame[i]=proc->frame_prach_br;
+ if (eNB->prach_vars_br.repetition_number[i]==0)
+ eNB->prach_vars_br.first_frame[i]=proc->frame_prach_br;
// increment repetition number
eNB->prach_vars_br.repetition_number[i]++;
@@ -771,7 +776,8 @@ static void *ru_thread( void *param ) {
// Start RF device if any
if (ru->rfdevice.trx_start_func(&ru->rfdevice) != 0)
LOG_E(HW,"Could not start the RF device\n");
- else LOG_I(PHY,"RU %d rf device ready\n",ru->idx);
+ else
+ LOG_I(PHY,"RU %d rf device ready\n",ru->idx);
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
while (!oai_exit) {
@@ -815,7 +821,7 @@ int init_rf(RU_t *ru) {
pthread_setname_np(pthread_self(),name);
return ret;
}
-
+
void ocp_init_RU(RU_t *ru, char *rf_config_file, int send_dmrssync) {
PHY_VARS_eNB *eNB0= (PHY_VARS_eNB *)NULL;
int i;
@@ -831,48 +837,47 @@ void ocp_init_RU(RU_t *ru, char *rf_config_file, int send_dmrssync) {
RC.eNB[i][CC_id]->num_RU=0;
LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU);
+ ru->rf_config_file = rf_config_file;
+ ru->idx = 0;
+ ru->ts_offset = 0;
- ru->rf_config_file = rf_config_file;
- ru->idx = 0;
- ru->ts_offset = 0;
+ if (ru->is_slave == 1) {
+ ru->in_synch = 0;
+ ru->generate_dmrs_sync = 0;
+ } else {
+ ru->in_synch = 1;
+ ru->generate_dmrs_sync=send_dmrssync;
+ }
- if (ru->is_slave == 1) {
- ru->in_synch = 0;
- ru->generate_dmrs_sync = 0;
- } else {
- ru->in_synch = 1;
- ru->generate_dmrs_sync=send_dmrssync;
- }
+ ru->cmd = EMPTY;
+ ru->south_out_cnt= 0;
- ru->cmd = EMPTY;
- ru->south_out_cnt= 0;
+ // ru->generate_dmrs_sync = (ru->is_slave == 0) ? 1 : 0;
+ if (ru->generate_dmrs_sync == 1) {
+ generate_ul_ref_sigs();
+ ru->dmrssync = (int16_t *)malloc16_clear(ru->frame_parms->ofdm_symbol_size*2*sizeof(int16_t));
+ }
- // ru->generate_dmrs_sync = (ru->is_slave == 0) ? 1 : 0;
- if (ru->generate_dmrs_sync == 1) {
- generate_ul_ref_sigs();
- ru->dmrssync = (int16_t *)malloc16_clear(ru->frame_parms->ofdm_symbol_size*2*sizeof(int16_t));
- }
+ ru->wakeup_L1_sleeptime = 2000;
+ ru->wakeup_L1_sleep_cnt_max = 3;
- ru->wakeup_L1_sleeptime = 2000;
- ru->wakeup_L1_sleep_cnt_max = 3;
+ if (ru->num_eNB > 0) {
+ AssertFatal(ru->eNB_list[0], "ru->eNB_list is not initialized\n");
+ } else {
+ LOG_E(PHY,"Wrong data model, assigning eNB 0, carrier 0 to RU 0\n");
+ ru->eNB_list[0] = RC.eNB[0][0];
+ ru->num_eNB=1;
+ }
- if (ru->num_eNB > 0) {
- AssertFatal(ru->eNB_list[0], "ru->eNB_list is not initialized\n");
- } else {
- LOG_E(PHY,"Wrong data model, assigning eNB 0, carrier 0 to RU 0\n");
- ru->eNB_list[0] = RC.eNB[0][0];
- ru->num_eNB=1;
- }
+ eNB0 = ru->eNB_list[0];
+ // datamodel error in regular OAI: a RU uses one single eNB carrier parameters!
+ ru->frame_parms = &eNB0->frame_parms;
- eNB0 = ru->eNB_list[0];
- // datamodel error in regular OAI: a RU uses one single eNB carrier parameters!
- ru->frame_parms = &eNB0->frame_parms;
-
- for (i=0; inum_eNB; i++) {
- eNB0 = ru->eNB_list[i];
- int ruIndex=eNB0->num_RU++;
- eNB0->RU_list[ruIndex] = ru;
- }
+ for (i=0; inum_eNB; i++) {
+ eNB0 = ru->eNB_list[i];
+ int ruIndex=eNB0->num_RU++;
+ eNB0->RU_list[ruIndex] = ru;
+ }
}
void stop_RU(int nb_ru) {
@@ -885,7 +890,7 @@ void stop_RU(int nb_ru) {
/* --------------------------------------------------------*/
/* from here function to use configuration module */
static int DEFBFW[] = {0x00007fff};
-void ocpRCconfig_RU(RU_t* ru) {
+void ocpRCconfig_RU(RU_t *ru) {
paramdef_t RUParams[] = RUPARAMS_DESC;
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL);
@@ -915,7 +920,7 @@ void ocpRCconfig_RU(RU_t* ru) {
if (config_isparamset(vals, RU_SDR_CLK_SRC)) {
char *paramVal=*(vals[RU_SDR_CLK_SRC].strptr);
LOG_D(PHY, "RU clock source set as %s\n", paramVal);
-
+
if (strcmp(paramVal, "internal") == 0) {
ru->openair0_cfg.clock_source = internal;
} else if (strcmp(paramVal, "external") == 0) {
@@ -929,42 +934,41 @@ void ocpRCconfig_RU(RU_t* ru) {
if (strcmp(*(vals[RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
if ( !(config_isparamset(vals,RU_LOCAL_IF_NAME_IDX)) ) {
- ru->if_south = LOCAL_RF;
- ru->function = eNodeB_3GPP;
- } else {
- ru->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
- ru->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
- ru->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
- ru->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
- ru->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
- ru->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
- ru->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
- }
-
- ru->max_pdschReferenceSignalPower = *(vals[RU_MAX_RS_EPRE_IDX].uptr);;
- ru->max_rxgain = *(vals[RU_MAX_RXGAIN_IDX].uptr);
- ru->num_bands = vals[RU_BAND_LIST_IDX].numelt;
- /* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
- ru->sf_extension = *(vals[RU_SF_EXTENSION_IDX].uptr);
- ru->end_of_burst_delay = *(vals[RU_END_OF_BURST_DELAY_IDX].uptr);
-
- for (int i=0; inum_bands; i++)
- ru->band[i] = vals[RU_BAND_LIST_IDX].iptr[i];
+ ru->if_south = LOCAL_RF;
+ ru->function = eNodeB_3GPP;
} else {
- ru->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
- ru->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
- ru->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
- ru->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
- ru->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
- ru->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
- ru->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
- } /* strcmp(local_rf, "yes") != 0 */
+ ru->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
+ ru->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
+ ru->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
+ ru->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
+ ru->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
+ ru->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
+ ru->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
+ }
- ru->nb_tx = *(vals[RU_NB_TX_IDX].uptr);
- ru->nb_rx = *(vals[RU_NB_RX_IDX].uptr);
- ru->att_tx = *(vals[RU_ATT_TX_IDX].uptr);
- ru->att_rx = *(vals[RU_ATT_RX_IDX].uptr);
+ ru->max_pdschReferenceSignalPower = *(vals[RU_MAX_RS_EPRE_IDX].uptr);;
+ ru->max_rxgain = *(vals[RU_MAX_RXGAIN_IDX].uptr);
+ ru->num_bands = vals[RU_BAND_LIST_IDX].numelt;
+ /* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
+ ru->sf_extension = *(vals[RU_SF_EXTENSION_IDX].uptr);
+ ru->end_of_burst_delay = *(vals[RU_END_OF_BURST_DELAY_IDX].uptr);
+ for (int i=0; inum_bands; i++)
+ ru->band[i] = vals[RU_BAND_LIST_IDX].iptr[i];
+ } else {
+ ru->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
+ ru->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
+ ru->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
+ ru->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
+ ru->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
+ ru->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
+ ru->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
+ } /* strcmp(local_rf, "yes") != 0 */
+
+ ru->nb_tx = *(vals[RU_NB_TX_IDX].uptr);
+ ru->nb_rx = *(vals[RU_NB_RX_IDX].uptr);
+ ru->att_tx = *(vals[RU_ATT_TX_IDX].uptr);
+ ru->att_rx = *(vals[RU_ATT_RX_IDX].uptr);
return;
}
@@ -1044,28 +1048,28 @@ void init_pdcp(void) {
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_W_MBMS_BIT;
if ( split73!=SPLIT73_DU)
- pdcp_module_init(pdcp_initmask);
+ pdcp_module_init(pdcp_initmask, 0);
if (NODE_IS_CU(RC.rrc[0]->node_type)) {
- //pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
+ //pdcp_set_rlc_data_req_func(proto_agent_send_rlc_data_req);
} else {
- pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
- pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
+ pdcp_set_rlc_data_req_func(rlc_data_req);
+ pdcp_set_pdcp_data_ind_func(pdcp_data_ind);
}
} else {
- //pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
+ //pdcp_set_pdcp_data_ind_func(proto_agent_send_pdcp_data_ind);
}
}
static void wait_nfapi_init(char *thread_name) {
- printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
+ LOG_I(ENB_APP, "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
pthread_mutex_lock( &nfapi_sync_mutex );
while (nfapi_sync_var<0)
pthread_cond_wait( &nfapi_sync_cond, &nfapi_sync_mutex );
pthread_mutex_unlock(&nfapi_sync_mutex);
- printf( "NFAPI: got sync (%s)\n", thread_name);
+ LOG_I(ENB_APP, "NFAPI: got sync (%s)\n", thread_name);
}
void terminate_task(module_id_t mod_id, task_id_t from, task_id_t to) {
@@ -1078,7 +1082,6 @@ void terminate_task(module_id_t mod_id, task_id_t from, task_id_t to) {
int stop_L1L2(module_id_t enb_id) {
LOG_W(ENB_APP, "stopping lte-softmodem\n");
-
/* these tasks need to pick up new configuration */
terminate_task(enb_id, TASK_ENB_APP, TASK_RRC_ENB);
oai_exit = 1;
@@ -1109,11 +1112,9 @@ int restart_L1L2(module_id_t enb_id) {
pthread_mutex_lock(&sync_mutex);
sync_var = -1;
pthread_mutex_unlock(&sync_mutex);
-
/* copy the changed frame parameters to the RU */
/* TODO this should be done for all RUs associated to this eNB */
memcpy(&ru->frame_parms, &RC.eNB[enb_id][0]->frame_parms, sizeof(LTE_DL_FRAME_PARMS));
-
/* reset the list of connected UEs in the MAC, since in this process with
* loose all UEs (have to reconnect) */
init_UE_info(&RC.mac[enb_id]->UE_info);
@@ -1177,7 +1178,6 @@ int main ( int argc, char **argv ) {
// but RU thread deals with pre_scd and this is necessary in VNF and simulator.
// some initialization is necessary and init_ru_vnf do this.
RU_t ru;
-
/* We need to read RU configuration before FlexRAN starts so it knows what
* splits to report. Actual RU start comes later. */
@@ -1189,9 +1189,10 @@ int main ( int argc, char **argv ) {
}
if ( strlen(get_softmodem_params()->split73) > 0 ) {
- char tmp[1024]={0};
+ char tmp[1024]= {0};
strncpy(tmp,get_softmodem_params()->split73, 1023);
tmp[2]=0;
+
if ( strncasecmp(tmp,"cu", 2)==0 )
split73=SPLIT73_CU;
else if ( strncasecmp(tmp,"du", 2)==0 )
@@ -1199,13 +1200,13 @@ int main ( int argc, char **argv ) {
else
AssertFatal(false,"split73 syntax: :[:] (string found: %s) \n",get_softmodem_params()->split73);
}
-
+
if (RC.nb_inst > 0) {
/* Start the agent. If it is turned off in the configuration, it won't start */
for (i = 0; i < RC.nb_inst; i++) {
//flexran_agent_start(i);
}
-
+
/* initializes PDCP and sets correct RLC Request/PDCP Indication callbacks
* for monolithic/F1 modes */
init_pdcp();
@@ -1284,17 +1285,14 @@ int main ( int argc, char **argv ) {
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
-
if (RC.nb_RU >0 && NFAPI_MODE!=NFAPI_MODE_VNF) {
printf("Initializing RU threads\n");
ocp_init_RU(&ru,
- get_softmodem_params()->rf_config_file,
- get_softmodem_params()->send_dmrs_sync);
-
- ru.rf_map.card=0;
- ru.rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
- init_RU_proc(&ru);
-
+ get_softmodem_params()->rf_config_file,
+ get_softmodem_params()->send_dmrs_sync);
+ ru.rf_map.card=0;
+ ru.rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
+ init_RU_proc(&ru);
config_sync_var=0;
if (NFAPI_MODE==NFAPI_MODE_PNF) { // PNF
@@ -1365,7 +1363,6 @@ int main ( int argc, char **argv ) {
pthread_cond_destroy(&nfapi_sync_cond);
pthread_mutex_destroy(&nfapi_sync_mutex);
pthread_mutex_destroy(&ue_pf_po_mutex);
-
}
terminate_opt();
diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c
index 543a679714..74556838b4 100644
--- a/executables/nr-gnb.c
+++ b/executables/nr-gnb.c
@@ -240,7 +240,6 @@ void rx_func(void *param) {
// RX processing
int tx_slot_type = nr_slot_select(cfg,frame_tx,slot_tx);
int rx_slot_type = nr_slot_select(cfg,frame_rx,slot_rx);
-
if (rx_slot_type == NR_UPLINK_SLOT || rx_slot_type == NR_MIXED_SLOT) {
// UE-specific RX processing for subframe n
// TODO: check if this is correct for PARALLEL_RU_L1_TRX_SPLIT
@@ -451,7 +450,9 @@ void init_gNB_Tpool(int inst) {
msgData->next_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, 0, first_tx_slot-1);
pushNotifiedFIFO(gNB->resp_RU_tx,msgRUTx); // to unblock the process in the beginning
- threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW);
+ if (!get_softmodem_params()->emulate_l1) {
+ threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW);
+ }
}
diff --git a/executables/nr-ru.c b/executables/nr-ru.c
index 3a2589632b..a2539a3adf 100644
--- a/executables/nr-ru.c
+++ b/executables/nr-ru.c
@@ -80,7 +80,8 @@ static int DEFBFW[] = {0x00007fff};
extern volatile int oai_exit;
-
+extern struct timespec timespec_sub(struct timespec lhs, struct timespec rhs);
+extern struct timespec timespec_add(struct timespec lhs, struct timespec rhs);
extern void nr_phy_free_RU(RU_t *);
extern void nr_phy_config_request(NR_PHY_Config_t *gNB);
#include "executables/thread-common.h"
@@ -1323,9 +1324,35 @@ void *ru_thread( void *param ) {
}
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
+ struct timespec slot_start;
+ clock_gettime(CLOCK_MONOTONIC, &slot_start);
+
+ struct timespec slot_duration;
+ slot_duration.tv_sec = 0;
+ //slot_duration.tv_nsec = 0.5e6;
+ slot_duration.tv_nsec = 0.5e6;
+
+
+
while (!oai_exit) {
// these are local subframe/frame counters to check that we are in synch with the fronthaul timing.
// They are set on the first rx/tx in the underly FH routines.
+ slot_start = timespec_add(slot_start,slot_duration);
+ struct timespec curr_time;
+ clock_gettime(CLOCK_MONOTONIC, &curr_time);
+
+ struct timespec sleep_time;
+
+ if((slot_start.tv_sec > curr_time.tv_sec) || (slot_start.tv_sec == curr_time.tv_sec && slot_start.tv_nsec > curr_time.tv_nsec)){
+ sleep_time = timespec_sub(slot_start,curr_time);
+
+ usleep(sleep_time.tv_nsec * 1e-3);
+ }
+ else{//continue
+ }
+
+ // clock_gettime(CLOCK_MONOTONIC, &curr_time);
+ //printf("sfn:%d, slot:%d, start time %d.%d slot start %d.%d \n",frame,slot,curr_time.tv_sec,curr_time.tv_nsec,slot_start.tv_sec,slot_start.tv_nsec);
if (slot==(fp->slots_per_frame-1)) {
slot=0;
frame++;
diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c
index a2b5c18b6c..62bef5a34d 100644
--- a/executables/nr-softmodem.c
+++ b/executables/nr-softmodem.c
@@ -324,48 +324,36 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
}
- paramdef_t NETParams[] = GNBNETPARAMS_DESC;
- char aprefix[MAX_OPTNAME_SIZE*2 + 8];
- sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
- config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
-
- for(int i = GNB_INTERFACE_NAME_FOR_NG_AMF_IDX; i <= GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX; i++) {
- if( NETParams[i].strptr == NULL) {
- LOG_E(NGAP, "No configuration in the file.\n");
- NGAP_CONF_MODE = 0;
- } else {
- LOG_D(NGAP, "Configuration in the file: %s.\n",*NETParams[i].strptr);
- }
- }
-
if (AMF_MODE_ENABLED) {
- if (gnb_nb > 0) {
- /*
- if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
- LOG_E(SCTP, "Create task for SCTP failed\n");
- return -1;
+
+ 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;
+ paramdef_t NETParams[] = GNBNETPARAMS_DESC;
+ char aprefix[MAX_OPTNAME_SIZE*2 + 8];
+ sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
+ config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
+
+ for(int i = GNB_INTERFACE_NAME_FOR_NG_AMF_IDX; i <= GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX; i++) {
+ if( NETParams[i].strptr == NULL) {
+ LOG_E(NGAP, "No configuration in the file.\n");
+ NGAP_CONF_MODE = 0;
+ } else {
+ LOG_D(NGAP, "Configuration in the file: %s.\n",*NETParams[i].strptr);
}
- */
+ }
+
+ if (gnb_nb > 0) {
if(NGAP_CONF_MODE) {
if (itti_create_task (TASK_NGAP, ngap_gNB_task, NULL) < 0) {
LOG_E(NGAP, "Create task for NGAP failed\n");
return -1;
}
} else {
- LOG_E(NGAP, "Ngap task not created\n");
+ LOG_I(NGAP, "Ngap task not created\n");
}
- if(!emulate_rf) {
- if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
- LOG_E(UDP_, "Create task for UDP failed\n");
- return -1;
- }
- }
-
- /*if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
- LOG_E(GTPU, "Create task for GTPV1U failed\n");
- return -1;
- }*/
}
}
@@ -608,8 +596,33 @@ static void wait_nfapi_init(char *thread_name) {
}
void init_pdcp(void) {
- if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) {
- // pdcp_layer_init();
+ if (!get_softmodem_params()->nsa) {
+ if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) {
+ //pdcp_layer_init();
+ uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
+ (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
+
+ if (IS_SOFTMODEM_NOS1) {
+ printf("IS_SOFTMODEM_NOS1 option enabled \n");
+ pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
+ }
+
+ nr_pdcp_module_init(pdcp_initmask, 0);
+
+ if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
+ LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n");
+ pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
+ } else {
+ LOG_I(PDCP, "node is gNB \n");
+ pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
+ pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
+ }
+ } else {
+ LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n");
+ pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
+ }
+ } else {
+ pdcp_layer_init();
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
@@ -618,19 +631,9 @@ void init_pdcp(void) {
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
}
- pdcp_module_init(pdcp_initmask);
-
- if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
- LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n");
- pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
- } else {
- LOG_I(PDCP, "node is gNB \n");
- pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
- pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
- }
- } else {
- LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n");
- pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
+ nr_pdcp_module_init(pdcp_initmask, 0);
+ pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
+ pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
}
}
@@ -657,6 +660,8 @@ int main( int argc, char **argv ) {
printf("Reading in command-line options\n");
get_options ();
+ EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
+
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
fprintf(stderr,"Getting configuration failed\n");
exit(-1);
@@ -688,10 +693,12 @@ int main( int argc, char **argv ) {
// initialize mscgen log after ITTI
MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX);
init_opt();
- if(PDCP_USE_NETLINK)
- if(!IS_SOFTMODEM_NOS1)
- netlink_init();
-
+ if(PDCP_USE_NETLINK && !IS_SOFTMODEM_NOS1) {
+ netlink_init();
+ if (get_softmodem_params()->nsa) {
+ init_pdcp();
+ }
+ }
#ifndef PACKAGE_VERSION
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
#endif
@@ -701,7 +708,8 @@ int main( int argc, char **argv ) {
RCconfig_NR_L1();
// don't create if node doesn't connect to RRC/S1/GTP
- AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
+ int ret=create_gNB_tasks(1);
+ AssertFatal(ret==0,"cannot create ITTI tasks\n");
/* Start the agent. If it is turned off in the configuration, it won't start */
/*
RCconfig_nr_flexran();
@@ -814,7 +822,9 @@ int main( int argc, char **argv ) {
}
printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
+
// We have to set PARAMFLAG_NOFREE on right paramters before re-enabling end_configmodule()
+
//end_configmodule();
printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
// wait for end of program
diff --git a/executables/nr-ue.c b/executables/nr-ue.c
index 362ad80e9d..46c1cff491 100644
--- a/executables/nr-ue.c
+++ b/executables/nr-ue.c
@@ -29,7 +29,9 @@
#include "SCHED_NR_UE/defs.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "executables/softmodem-common.h"
+#include "LAYER2/nr_pdcp/nr_pdcp_entity.h"
#include "SCHED_NR_UE/pucch_uci_ue_nr.h"
+#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
/*
* NR SLOT PROCESSING SEQUENCE
@@ -98,6 +100,10 @@ typedef enum {
si = 2
} sync_mode_t;
+queue_t nr_rach_ind_queue;
+
+static void *NRUE_phy_stub_standalone_pnf_task(void *arg);
+
void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
uint8_t UE_id,
uint8_t abstraction_flag)
@@ -126,6 +132,382 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
init_N_TA_offset(ue);
}
+void init_nrUE_standalone_thread(int ue_idx)
+{
+ int standalone_tx_port = 3611 + ue_idx * 2;
+ int standalone_rx_port = 3612 + ue_idx * 2;
+ nrue_init_standalone_socket(standalone_tx_port, standalone_rx_port);
+
+ NR_UE_MAC_INST_t *mac = get_mac_inst(0);
+ pthread_mutex_init(&mac->mutex_dl_info, NULL);
+
+ pthread_t thread;
+ if (pthread_create(&thread, NULL, nrue_standalone_pnf_task, NULL) != 0) {
+ LOG_E(NR_MAC, "pthread_create failed for calling nrue_standalone_pnf_task");
+ }
+ pthread_setname_np(thread, "oai:nrue-stand");
+ pthread_t phy_thread;
+ if (pthread_create(&phy_thread, NULL, NRUE_phy_stub_standalone_pnf_task, NULL) != 0) {
+ LOG_E(NR_MAC, "pthread_create failed for calling NRUE_phy_stub_standalone_pnf_task");
+ }
+ pthread_setname_np(phy_thread, "oai:nrue-stand-phy");
+}
+
+static void L1_nsa_prach_procedures(frame_t frame, int slot, fapi_nr_ul_config_prach_pdu *prach_pdu)
+{
+ NR_UE_MAC_INST_t *mac = get_mac_inst(0);
+ nfapi_nr_rach_indication_t *rach_ind = CALLOC(1, sizeof(*rach_ind));
+ rach_ind->sfn = frame;
+ rach_ind->slot = slot;
+ rach_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION;
+
+ uint8_t pdu_index = 0;
+ rach_ind->pdu_list = CALLOC(1, sizeof(*rach_ind->pdu_list));
+ rach_ind->number_of_pdus = 1;
+ rach_ind->pdu_list[pdu_index].phy_cell_id = prach_pdu->phys_cell_id;
+ rach_ind->pdu_list[pdu_index].symbol_index = prach_pdu->prach_start_symbol;
+ rach_ind->pdu_list[pdu_index].slot_index = prach_pdu->prach_slot;
+ rach_ind->pdu_list[pdu_index].freq_index = prach_pdu->num_ra;
+ rach_ind->pdu_list[pdu_index].avg_rssi = 128;
+ rach_ind->pdu_list[pdu_index].avg_snr = 0xff; // invalid for now
+
+ rach_ind->pdu_list[pdu_index].num_preamble = 1;
+ const int num_p = rach_ind->pdu_list[pdu_index].num_preamble;
+ rach_ind->pdu_list[pdu_index].preamble_list = calloc(num_p, sizeof(nfapi_nr_prach_indication_preamble_t));
+ uint8_t preamble_index = get_softmodem_params()->nsa ?
+ mac->ra.rach_ConfigDedicated->cfra->resources.choice.ssb->ssb_ResourceList.list.array[0]->ra_PreambleIndex :
+ mac->ra.ra_PreambleIndex;
+ rach_ind->pdu_list[pdu_index].preamble_list[0].preamble_index = preamble_index;
+
+ rach_ind->pdu_list[pdu_index].preamble_list[0].timing_advance = 0;
+ rach_ind->pdu_list[pdu_index].preamble_list[0].preamble_pwr = 0xffffffff;
+
+ if (!put_queue(&nr_rach_ind_queue, rach_ind))
+ {
+ for (int pdu_index = 0; pdu_index < rach_ind->number_of_pdus; pdu_index++)
+ {
+ free(rach_ind->pdu_list[pdu_index].preamble_list);
+ }
+ free(rach_ind->pdu_list);
+ free(rach_ind);
+ }
+ LOG_D(NR_MAC, "We have successfully filled the rach_ind queue with the recently filled rach ind\n");
+}
+
+static bool sfn_slot_matcher(void *wanted, void *candidate)
+{
+ nfapi_p7_message_header_t *msg = candidate;
+ int sfn_sf = *(int*)wanted;
+
+ switch (msg->message_id)
+ {
+ case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
+ {
+ nfapi_nr_rach_indication_t *ind = candidate;
+ return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot;
+ }
+
+ case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
+ {
+ nfapi_nr_rx_data_indication_t *ind = candidate;
+ return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot;
+ }
+
+ case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
+ {
+ nfapi_nr_crc_indication_t *ind = candidate;
+ return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot;
+ }
+
+ case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
+ {
+ nfapi_nr_uci_indication_t *ind = candidate;
+ return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot;
+ }
+
+ case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST:
+ {
+ nfapi_nr_dl_tti_request_t *ind = candidate;
+ return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot;
+ }
+
+ case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST:
+ {
+ nfapi_nr_tx_data_request_t *ind = candidate;
+ return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot;
+ }
+
+ case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST:
+ {
+ nfapi_nr_ul_dci_request_t *ind = candidate;
+ return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot;
+ }
+
+ case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST:
+ {
+ nfapi_nr_ul_tti_request_t *ind = candidate;
+ return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot;
+ }
+
+ default:
+ LOG_E(NR_MAC, "sfn_slot_match bad ID: %d\n", msg->message_id);
+
+ }
+
+ return false;
+}
+
+static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot)
+{
+ nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
+ nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
+ nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
+ nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue);
+ nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue);
+
+ LOG_D(NR_MAC, "Try to get a ul_tti_req for sfn/slot %d %d from queue with %lu items\n",
+ NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot),NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot), nr_ul_tti_req_queue.num_items);
+ nfapi_nr_ul_tti_request_t *ul_tti_request = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.active_harq_sfn_slot);
+ if (!ul_tti_request)
+ {
+ LOG_D(NR_MAC, "Try to get a ul_tti_req from seprate queue because dl_tti_req was late\n");
+ ul_tti_request = unqueue_matching(&nr_wait_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.active_harq_sfn_slot);
+ }
+
+ if (rach_ind && rach_ind->number_of_pdus > 0)
+ {
+ NR_UL_IND_t UL_INFO = {
+ .rach_ind = *rach_ind,
+ };
+ send_nsa_standalone_msg(&UL_INFO, rach_ind->header.message_id);
+ for (int i = 0; i < rach_ind->number_of_pdus; i++)
+ {
+ free(rach_ind->pdu_list[i].preamble_list);
+ }
+ free(rach_ind->pdu_list);
+ free(rach_ind);
+ nr_Msg1_transmitted(0, 0, NFAPI_SFNSLOT2SFN(sfn_slot), 0);
+ }
+ if (crc_ind && crc_ind->number_crcs > 0)
+ {
+ NR_UL_IND_t UL_INFO = {
+ .crc_ind = *crc_ind,
+ };
+ send_nsa_standalone_msg(&UL_INFO, crc_ind->header.message_id);
+ free(crc_ind->crc_list);
+ free(crc_ind);
+ }
+ if (rx_ind && rx_ind->number_of_pdus > 0)
+ {
+ NR_UL_IND_t UL_INFO = {
+ .rx_ind = *rx_ind,
+ };
+ send_nsa_standalone_msg(&UL_INFO, rx_ind->header.message_id);
+ free(rx_ind->pdu_list);
+ free(rx_ind);
+ }
+ if (dl_tti_request)
+ {
+ int dl_tti_sfn_slot = NFAPI_SFNSLOT2HEX(dl_tti_request->SFN, dl_tti_request->Slot);
+ nfapi_nr_tx_data_request_t *tx_data_request = unqueue_matching(&nr_tx_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &dl_tti_sfn_slot);
+ if (!tx_data_request)
+ {
+ LOG_E(NR_MAC, "[%d %d] No corresponding tx_data_request for given dl_tti_request sfn/slot\n",
+ NFAPI_SFNSLOT2SFN(dl_tti_sfn_slot), NFAPI_SFNSLOT2SLOT(dl_tti_sfn_slot));
+ if (get_softmodem_params()->nsa)
+ save_nr_measurement_info(dl_tti_request);
+ free(dl_tti_request);
+ dl_tti_request = NULL;
+ }
+ else if (dl_tti_request->dl_tti_request_body.nPDUs > 0 && tx_data_request->Number_of_PDUs > 0)
+ {
+ if (get_softmodem_params()->nsa)
+ save_nr_measurement_info(dl_tti_request);
+ check_and_process_dci(dl_tti_request, tx_data_request, NULL, NULL);
+ }
+ else
+ {
+ AssertFatal(false, "We dont have PDUs in either dl_tti %d or tx_req %d\n",
+ dl_tti_request->dl_tti_request_body.nPDUs, tx_data_request->Number_of_PDUs);
+ }
+ }
+ if (ul_dci_request && ul_dci_request->numPdus > 0)
+ {
+ check_and_process_dci(NULL, NULL, ul_dci_request, NULL);
+ }
+ if (ul_tti_request && ul_tti_request->n_pdus > 0)
+ {
+ check_and_process_dci(NULL, NULL, NULL, ul_tti_request);
+ }
+}
+
+static void check_nr_prach(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info, NR_PRACH_RESOURCES_t *prach_resources)
+{
+ fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, ul_info->slot_tx);
+ if (!ul_config)
+ {
+ LOG_E(NR_MAC, "mac->ul_config is null! \n");
+ return;
+ }
+ if (mac->ra.ra_state != RA_SUCCEEDED)
+ {
+ AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]),
+ "Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus);
+ fapi_nr_ul_config_prach_pdu *prach_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu;
+ uint8_t nr_prach = nr_ue_get_rach(prach_resources,
+ prach_pdu,
+ ul_info->module_id,
+ ul_info->cc_id,
+ ul_info->frame_tx,
+ ul_info->gNB_index,
+ ul_info->slot_tx);
+ if (nr_prach == 1)
+ {
+ L1_nsa_prach_procedures(ul_info->frame_tx, ul_info->slot_tx, prach_pdu);
+ ul_config->number_pdus = 0;
+ ul_info->ue_sched_mode = SCHED_ALL;
+ }
+ else if (nr_prach == 2)
+ {
+ LOG_I(NR_PHY, "In %s: [UE %d] RA completed, setting UE mode to PUSCH\n", __FUNCTION__, ul_info->module_id);
+ }
+ else if(nr_prach == 3)
+ {
+ LOG_I(NR_PHY, "In %s: [UE %d] RA failed, setting UE mode to PRACH\n", __FUNCTION__, ul_info->module_id);
+ }
+ }
+}
+
+static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
+{
+ LOG_I(MAC, "Clearing Queues\n");
+ reset_queue(&nr_rach_ind_queue);
+ reset_queue(&nr_rx_ind_queue);
+ reset_queue(&nr_crc_ind_queue);
+ reset_queue(&nr_uci_ind_queue);
+ reset_queue(&nr_dl_tti_req_queue);
+ reset_queue(&nr_tx_req_queue);
+ reset_queue(&nr_ul_dci_req_queue);
+ reset_queue(&nr_ul_tti_req_queue);
+ reset_queue(&nr_wait_ul_tti_req_queue);
+
+ NR_PRACH_RESOURCES_t prach_resources;
+ memset(&prach_resources, 0, sizeof(prach_resources));
+ NR_UL_TIME_ALIGNMENT_t ul_time_alignment;
+ memset(&ul_time_alignment, 0, sizeof(ul_time_alignment));
+ int last_sfn_slot = -1;
+ uint16_t sfn_slot = 0;
+
+ while (!oai_exit)
+ {
+ if (sem_wait(&sfn_slot_semaphore) != 0)
+ {
+ LOG_E(NR_MAC, "sem_wait() error\n");
+ abort();
+ }
+ uint16_t *slot_ind = get_queue(&nr_sfn_slot_queue);
+ nr_phy_channel_params_t *ch_info = get_queue(&nr_chan_param_queue);
+ if (!slot_ind && !ch_info)
+ {
+ LOG_D(MAC, "get nr_sfn_slot_queue and nr_chan_param_queue == NULL!\n");
+ continue;
+ }
+ if (slot_ind) {
+ sfn_slot = *slot_ind;
+ }
+ else if (ch_info) {
+ sfn_slot = ch_info->sfn_slot;
+ }
+
+ frame_t frame = NFAPI_SFNSLOT2SFN(sfn_slot);
+ int slot = NFAPI_SFNSLOT2SLOT(sfn_slot);
+ if (sfn_slot == last_sfn_slot)
+ {
+ LOG_D(NR_MAC, "repeated sfn_sf = %d.%d\n",
+ frame, slot);
+ continue;
+ }
+ last_sfn_slot = sfn_slot;
+
+ LOG_D(NR_MAC, "The received sfn/slot [%d %d] from proxy\n",
+ frame, slot);
+
+ module_id_t mod_id = 0;
+ NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
+ if (get_softmodem_params()->sa && mac->mib == NULL)
+ {
+ LOG_D(NR_MAC, "We haven't gotten MIB. Lets see if we received it\n");
+ nr_ue_dl_indication(&mac->dl_info, &ul_time_alignment);
+ process_queued_nr_nfapi_msgs(mac, sfn_slot);
+ }
+ if (mac->scc == NULL && mac->scc_SIB == NULL)
+ {
+ LOG_D(MAC, "[NSA] mac->scc == NULL and [SA] mac->scc_SIB == NULL!\n");
+ continue;
+ }
+
+ mac->ra.generate_nr_prach = 0;
+ int CC_id = 0;
+ uint8_t gNB_id = 0;
+ nr_uplink_indication_t ul_info;
+ int slots_per_frame = 20; //30 kHZ subcarrier spacing
+ int slot_ahead = 2; // TODO: Make this dynamic
+ ul_info.cc_id = CC_id;
+ ul_info.gNB_index = gNB_id;
+ ul_info.module_id = mod_id;
+ ul_info.frame_rx = frame;
+ ul_info.slot_rx = slot;
+ ul_info.slot_tx = (slot + slot_ahead) % slots_per_frame;
+ ul_info.frame_tx = (ul_info.slot_rx + slot_ahead >= slots_per_frame) ? ul_info.frame_rx + 1 : ul_info.frame_rx;
+ ul_info.ue_sched_mode = SCHED_ALL;
+
+ if (pthread_mutex_lock(&mac->mutex_dl_info)) abort();
+
+ memset(&mac->dl_info, 0, sizeof(mac->dl_info));
+ mac->dl_info.cc_id = CC_id;
+ mac->dl_info.gNB_index = gNB_id;
+ mac->dl_info.module_id = mod_id;
+ mac->dl_info.frame = frame;
+ mac->dl_info.slot = slot;
+ mac->dl_info.thread_id = 0;
+ mac->dl_info.dci_ind = NULL;
+ mac->dl_info.rx_ind = NULL;
+
+ if (is_nr_DL_slot(get_softmodem_params()->nsa ?
+ mac->scc->tdd_UL_DL_ConfigurationCommon :
+ mac->scc_SIB->tdd_UL_DL_ConfigurationCommon,
+ ul_info.slot_rx))
+ {
+ nr_ue_dl_indication(&mac->dl_info, &ul_time_alignment);
+ }
+
+ if (pthread_mutex_unlock(&mac->mutex_dl_info)) abort();
+
+ if (is_nr_UL_slot(get_softmodem_params()->nsa ?
+ mac->scc->tdd_UL_DL_ConfigurationCommon :
+ mac->scc_SIB->tdd_UL_DL_ConfigurationCommon,
+ ul_info.slot_tx, mac->frame_type))
+ {
+ LOG_D(NR_MAC, "Slot %d. calling nr_ue_ul_ind() from %s\n", ul_info.slot_tx, __FUNCTION__);
+ nr_ue_ul_indication(&ul_info);
+ check_nr_prach(mac, &ul_info, &prach_resources);
+ }
+ if (!IS_SOFTMODEM_NOS1 && get_softmodem_params()->sa) {
+ NR_UE_MAC_INST_t *mac = get_mac_inst(0);
+ protocol_ctxt_t ctxt;
+ PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_NO, mac->crnti, frame, slot, 0);
+ pdcp_run(&ctxt);
+ }
+ process_queued_nr_nfapi_msgs(mac, sfn_slot);
+ free(slot_ind);
+ slot_ind = NULL;
+ free(ch_info);
+ ch_info = NULL;
+ }
+ return NULL;
+}
+
+
/*!
* It performs band scanning and synchonization.
* \param arg is a pointer to a \ref PHY_VARS_NR_UE structure.
diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c
index 5431fc1331..ac89bcfd4e 100644
--- a/executables/nr-uesoftmodem.c
+++ b/executables/nr-uesoftmodem.c
@@ -99,7 +99,9 @@ pthread_mutex_t sync_mutex;
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
int config_sync_var=-1;
-
+// not used in UE
+instance_t CUuniqInstance=0;
+instance_t DUuniqInstance=0;
RAN_CONTEXT_t RC;
volatile int oai_exit = 0;
@@ -155,6 +157,7 @@ char uecap_xer[1024];
*/
uint8_t abstraction_flag=0;
+
/*---------------------BMC: timespec helpers -----------------------------*/
struct timespec min_diff_time = { .tv_sec = 0, .tv_nsec = 0 };
@@ -188,10 +191,17 @@ int create_tasks_nrue(uint32_t ue_nb) {
LOG_E(NR_RRC, "Create task for RRC UE failed\n");
return -1;
}
- if (itti_create_task (TASK_NAS_NRUE, nas_nrue_task, NULL) < 0) {
- LOG_E(NR_RRC, "Create task for NAS UE failed\n");
- return -1;
- }
+ if (get_softmodem_params()->nsa) {
+ init_connections_with_lte_ue();
+ if (itti_create_task (TASK_RRC_NSA_NRUE, recv_msgs_from_lte_ue, NULL) < 0) {
+ LOG_E(NR_RRC, "Create task for RRC NSA nr-UE failed\n");
+ return -1;
+ }
+ }
+ if (itti_create_task (TASK_NAS_NRUE, nas_nrue_task, NULL) < 0) {
+ LOG_E(NR_RRC, "Create task for NAS UE failed\n");
+ return -1;
+ }
}
itti_wait_ready(0);
@@ -369,23 +379,21 @@ void init_openair0(void) {
}
}
-void init_pdcp(void) {
+static void init_pdcp(int ue_id) {
uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
/*if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) {
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
}*/
- if (IS_SOFTMODEM_NOKRNMOD)
+ if (IS_SOFTMODEM_NOKRNMOD) {
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
-
- /*if (rlc_module_init() != 0) {
+ }
+ if (get_softmodem_params()->nsa && rlc_module_init(0) != 0) {
LOG_I(RLC, "Problem at RLC initiation \n");
}
pdcp_layer_init();
- nr_DRB_preconfiguration();*/
- pdcp_layer_init();
- pdcp_module_init(pdcp_initmask);
+ nr_pdcp_module_init(pdcp_initmask, ue_id);
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
}
@@ -397,6 +405,13 @@ void *rrc_enb_process_msg(void *notUsed) {
int main( int argc, char **argv ) {
+ set_priority(79);
+ if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1)
+ {
+ fprintf(stderr, "mlockall: %s\n", strerror(errno));
+ return EXIT_FAILURE;
+ }
+
//uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
PHY_VARS_NR_UE *UE[MAX_NUM_CCs];
start_background_system();
@@ -439,13 +454,27 @@ int main( int argc, char **argv ) {
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
init_NR_UE(1,rrc_config_path);
- if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa)
- init_pdcp();
+
+ int mode_offset = get_softmodem_params()->nsa ? NUMBER_OF_UE_MAX : 1;
+ uint16_t node_number = get_softmodem_params()->node_number;
+ ue_id_g = (node_number == 0) ? 0 : node_number - 2;
+ AssertFatal(ue_id_g >= 0, "UE id is expected to be nonnegative.\n");
+ if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa || get_softmodem_params()->nsa) {
+ if(node_number == 0) {
+ init_pdcp(0);
+ }
+ else {
+ init_pdcp(mode_offset + ue_id_g);
+ }
+ }
NB_UE_INST=1;
NB_INST=1;
PHY_vars_UE_g = malloc(sizeof(PHY_VARS_NR_UE **));
PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_NR_UE *)*MAX_NUM_CCs);
+ if (get_softmodem_params()->emulate_l1) {
+ RCconfig_nr_ue_L1();
+ }
if (get_softmodem_params()->do_ra)
AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n");
@@ -453,54 +482,57 @@ int main( int argc, char **argv ) {
if (get_softmodem_params()->sa)
AssertFatal(get_softmodem_params()->phy_test == 0,"Standalone mode and phy_test are mutually exclusive\n");
- for (int CC_id=0; CC_idnsa && get_softmodem_params()->emulate_l1)
+ start_oai_nrue_threads();
- PHY_vars_UE_g[0][CC_id] = (PHY_VARS_NR_UE *)malloc(sizeof(PHY_VARS_NR_UE));
- UE[CC_id] = PHY_vars_UE_g[0][CC_id];
- memset(UE[CC_id],0,sizeof(PHY_VARS_NR_UE));
+ if (!get_softmodem_params()->emulate_l1) {
+ for (int CC_id=0; CC_idsa) {
- uint16_t nr_band = get_band(downlink_frequency[CC_id][0],uplink_frequency_offset[CC_id][0]);
- mac->nr_band = nr_band;
- nr_init_frame_parms_ue_sa(&UE[CC_id]->frame_parms,
- downlink_frequency[CC_id][0],
- uplink_frequency_offset[CC_id][0],
- get_softmodem_params()->numerology,
- nr_band);
- }
- else{
- if(mac->if_module != NULL && mac->if_module->phy_config_request != NULL)
- mac->if_module->phy_config_request(&mac->phy_config);
+ if (get_softmodem_params()->sa) { // set frame config to initial values from command line and assume that the SSB is centered on the grid
+ uint16_t nr_band = get_band(downlink_frequency[CC_id][0],uplink_frequency_offset[CC_id][0]);
+ mac->nr_band = nr_band;
+ nr_init_frame_parms_ue_sa(&UE[CC_id]->frame_parms,
+ downlink_frequency[CC_id][0],
+ uplink_frequency_offset[CC_id][0],
+ get_softmodem_params()->numerology,
+ nr_band);
+ }
+ else{
+ if(mac->if_module != NULL && mac->if_module->phy_config_request != NULL)
+ mac->if_module->phy_config_request(&mac->phy_config);
- fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
+ fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
- nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]);
+ nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config,
+ *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]);
+ }
+
+ init_symbol_rotation(&UE[CC_id]->frame_parms);
+ init_timeshift_rotation(&UE[CC_id]->frame_parms);
+ init_nr_ue_vars(UE[CC_id], 0, abstraction_flag);
}
- init_symbol_rotation(&UE[CC_id]->frame_parms);
- init_timeshift_rotation(&UE[CC_id]->frame_parms);
- init_nr_ue_vars(UE[CC_id], 0, abstraction_flag);
+ init_openair0();
+ // init UE_PF_PO and mutex lock
+ pthread_mutex_init(&ue_pf_po_mutex, NULL);
+ memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs);
+ configure_linux();
+ mlockall(MCL_CURRENT | MCL_FUTURE);
+ if(IS_SOFTMODEM_DOSCOPE) {
+ load_softscope("nr",PHY_vars_UE_g[0][0]);
+ }
+
+ init_NR_UE_threads(1);
+ printf("UE threads created by %ld\n", gettid());
}
- init_openair0();
- // init UE_PF_PO and mutex lock
- pthread_mutex_init(&ue_pf_po_mutex, NULL);
- memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs);
- configure_linux();
- mlockall(MCL_CURRENT | MCL_FUTURE);
-
- if(IS_SOFTMODEM_DOSCOPE) {
- load_softscope("nr",PHY_vars_UE_g[0][0]);
- }
-
-
- init_NR_UE_threads(1);
- printf("UE threads created by %ld\n", gettid());
-
// wait for end of program
printf("TYPE TO TERMINATE\n");
diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h
index 7f47ed5eb3..eb7175be9d 100644
--- a/executables/nr-uesoftmodem.h
+++ b/executables/nr-uesoftmodem.h
@@ -34,7 +34,8 @@
{"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:(uint32_t *)&nrUE_params.ofdm_offset_divisor, defuintval:UINT_MAX, TYPE_UINT32, 0}, \
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \
- {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \
+ {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0}, \
+ {"ue-idx-standalone", NULL, 0, u16ptr:&ue_idx_standalone, defuintval:0xFFFF, TYPE_UINT16, 0} \
}
@@ -88,7 +89,9 @@ extern void init_NR_UE(int, char*);
extern void init_NR_UE_threads(int);
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
+extern void start_oai_nrue_threads(void);
void *UE_thread(void *arg);
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id, uint8_t abstraction_flag);
+void init_nrUE_standalone_thread(int ue_idx);
#endif
diff --git a/executables/ocp-gnb.c b/executables/ocp-gnb.c
index 326f7d277f..7b4b1c6680 100644
--- a/executables/ocp-gnb.c
+++ b/executables/ocp-gnb.c
@@ -328,9 +328,9 @@ static void init_pdcp(void) {
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ;
}
- pdcp_module_init(pdcp_initmask);
- pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
- pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
+ nr_pdcp_module_init(pdcp_initmask, 0);
+ pdcp_set_rlc_data_req_func(rlc_data_req);
+ pdcp_set_pdcp_data_ind_func(pdcp_data_ind);
}
void init_main_gNB(void) {
diff --git a/executables/softmodem-common.c b/executables/softmodem-common.c
index e10515ea1a..3e20081b18 100644
--- a/executables/softmodem-common.c
+++ b/executables/softmodem-common.c
@@ -180,15 +180,18 @@ void softmodem_printresources(int sig, telnet_printfunc_t pf) {
}
void signal_handler(int sig) {
- void *array[10];
- size_t size;
+ //void *array[10];
+ //size_t size;
if (sig==SIGSEGV) {
// get void*'s for all entries on the stack
+ /* backtrace uses malloc, that is not good in signal handlers
+ * I let the code, because it would be nice to make it better
size = backtrace(array, 10);
// print out all the frames to stderr
fprintf(stderr, "Error: signal %d:\n", sig);
backtrace_symbols_fd(array, size, 2);
+ */
exit(-1);
} else {
if(sig==SIGINT ||sig==SOFTMODEM_RTSIGNAL)
@@ -208,10 +211,13 @@ void set_softmodem_sighandler(void) {
memset(&act,0,sizeof(act));
act.sa_handler=signal_handler;
sigaction(SOFTMODEM_RTSIGNAL,&act,&oldact);
+ // Disabled in order generate a core dump for analysis with gdb
+ # if 0
printf("Send signal %d to display resource usage...\n",SIGRTMIN+1);
signal(SIGSEGV, signal_handler);
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
signal(SIGABRT, signal_handler);
+ #endif
}
diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h
index 3a7022a502..9aca677473 100644
--- a/executables/softmodem-common.h
+++ b/executables/softmodem-common.h
@@ -98,6 +98,7 @@ extern "C"
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
#define CONFIG_HLP_NFAPI "Change the nFAPI mode for NR\n"
+#define CONFIG_L1_EMULATOR "Run in L1 emulated mode (disable PHY layer)\n"
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters common to eNodeB and UE */
@@ -122,7 +123,10 @@ extern "C"
#define USE_256QAM_TABLE softmodem_params.use_256qam_table
#define PRB_INTERPOLATION softmodem_params.prb_interpolation
#define NFAPI softmodem_params.nfapi
+#define NSA softmodem_params.nsa
+#define NODE_NUMBER softmodem_params.node_number
#define NON_STOP softmodem_params.non_stop
+#define EMULATE_L1 softmodem_params.emulate_l1
#define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat";
@@ -155,13 +159,16 @@ extern int usrp_tx_thread;
{"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \
{"use-256qam-table", CONFIG_HLP_256QAM, PARAMFLAG_BOOL, iptr:&USE_256QAM_TABLE, defintval:0, TYPE_INT, 0}, \
- {"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&PRB_INTERPOLATION, defintval:0, TYPE_INT, 0}, \
- {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
- {"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \
- {"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \
+ {"nsa", CONFIG_HLP_NSA, PARAMFLAG_BOOL, iptr:&NSA, defintval:0, TYPE_INT, 0}, \
+ {"node-number", NULL, 0, u16ptr:&NODE_NUMBER, defuintval:0, TYPE_UINT16, 0}, \
+ {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
+ {"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&PRB_INTERPOLATION, defintval:0, TYPE_INT, 0}, \
+ {"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \
+ {"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \
+ {"emulate-l1", CONFIG_L1_EMULATOR, PARAMFLAG_BOOL, iptr:&EMULATE_L1, defintval:0, TYPE_INT, 0}, \
}
-
+#define CONFIG_HLP_NSA "Enable NSA mode \n"
#define CONFIG_HLP_FLOG "Enable online log \n"
#define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n"
#define CONFIG_HLP_LOGV "Set the global log verbosity \n"
@@ -251,7 +258,10 @@ typedef struct {
int use_256qam_table;
int prb_interpolation;
uint8_t nfapi;
+ int nsa;
+ uint16_t node_number;
int non_stop;
+ int emulate_l1;
} softmodem_params_t;
extern uint64_t get_softmodem_optmask(void);
@@ -272,6 +282,7 @@ void tx_func(void *param);
void rx_func(void *param);
void ru_tx_func(void *param);
extern uint8_t nfapi_mode;
+extern int16_t vnf_pnf_sfnslot_delta;
#ifdef __cplusplus
}
#endif
diff --git a/nfapi/oai_integration/gnb_ind_vars.c b/nfapi/oai_integration/gnb_ind_vars.c
new file mode 100644
index 0000000000..148c28a5c4
--- /dev/null
+++ b/nfapi/oai_integration/gnb_ind_vars.c
@@ -0,0 +1,7 @@
+#include "gnb_ind_vars.h"
+
+queue_t gnb_rach_ind_queue;
+queue_t gnb_rx_ind_queue;
+queue_t gnb_crc_ind_queue;
+queue_t gnb_uci_ind_queue;
+queue_t gnb_slot_ind_queue;
diff --git a/nfapi/oai_integration/gnb_ind_vars.h b/nfapi/oai_integration/gnb_ind_vars.h
new file mode 100644
index 0000000000..8561037d3e
--- /dev/null
+++ b/nfapi/oai_integration/gnb_ind_vars.h
@@ -0,0 +1,9 @@
+#pragma once
+
+#include "openair2/PHY_INTERFACE/queue_t.h"
+
+extern queue_t gnb_rach_ind_queue;
+extern queue_t gnb_rx_ind_queue;
+extern queue_t gnb_crc_ind_queue;
+extern queue_t gnb_uci_ind_queue;
+extern queue_t gnb_slot_ind_queue;
diff --git a/nfapi/oai_integration/nfapi.c b/nfapi/oai_integration/nfapi.c
index 86d1ae3127..5e71c5e2a4 100644
--- a/nfapi/oai_integration/nfapi.c
+++ b/nfapi/oai_integration/nfapi.c
@@ -23,7 +23,15 @@
#include
#include "nfapi/oai_integration/vendor_ext.h"
#include "common/utils/LOG/log.h"
-static char nfapi_str_mode[6][24] = {"MONOLITHIC","PNF","VNF","UE_STUB_PNF","UE_STUB_OFFNET",""};
+static const char *const nfapi_str_mode[] = {
+ "MONOLITHIC",
+ "PNF",
+ "VNF",
+ "UE_STUB_PNF",
+ "UE_STUB_OFFNET",
+ "STANDALONE_PNF",
+ ""
+};
typedef struct {
nfapi_mode_t nfapi_mode;
@@ -32,15 +40,9 @@ typedef struct {
static nfapi_params_t nfapi_params = {0};
void set_thread_priority(int priority) {
- //printf("%s(priority:%d)\n", __FUNCTION__, priority);
+ set_priority(priority);
+
pthread_attr_t ptAttr;
- struct sched_param schedParam;
- schedParam.__sched_priority = priority; //79;
-
- if(sched_setscheduler(0, SCHED_RR, &schedParam) != 0) {
- printf("Failed to set scheduler to SCHED_RR\n");
- }
-
if(pthread_attr_setschedpolicy(&ptAttr, SCHED_RR) != 0) {
printf("Failed to set pthread sched policy SCHED_RR\n");
}
@@ -54,7 +56,7 @@ void set_thread_priority(int priority) {
}
}
-char *nfapi_get_strmode(void) {
+const char *nfapi_get_strmode(void) {
if (nfapi_params.nfapi_mode > NFAPI_MODE_UNKNOWN)
return nfapi_str_mode[NFAPI_MODE_UNKNOWN];
diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c
index 4edbeee342..3a59be41e9 100644
--- a/nfapi/oai_integration/nfapi_pnf.c
+++ b/nfapi/oai_integration/nfapi_pnf.c
@@ -218,14 +218,9 @@ void pnf_nfapi_trace(nfapi_trace_level_t nfapi_level, const char *message, ...)
}
void pnf_set_thread_priority(int priority) {
+ set_priority(priority);
+
pthread_attr_t ptAttr;
- struct sched_param schedParam;
- schedParam.__sched_priority = priority;
-
- if(sched_setscheduler(0, SCHED_RR, &schedParam) != 0) {
- printf("failed to set SCHED_RR\n");
- }
-
if(pthread_attr_setschedpolicy(&ptAttr, SCHED_RR) != 0) {
printf("failed to set pthread SCHED_RR %d\n", errno);
}
@@ -248,7 +243,7 @@ void *pnf_p7_thread_start(void *ptr) {
}
void *pnf_nr_p7_thread_start(void *ptr) {
- NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] P7 THREAD %s\n", __FUNCTION__);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[NR_PNF] NR P7 THREAD %s\n", __FUNCTION__);
pnf_set_thread_priority(79);
nfapi_pnf_p7_config_t *config = (nfapi_pnf_p7_config_t *)ptr;
nfapi_nr_pnf_p7_start(config);
@@ -805,7 +800,7 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
// to keep only the necessary just to keep the nfapi FSM rolling by sending a dummy response.
LTE_DL_FRAME_PARMS *fp;
- if (NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
+ if (NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
fp = &eNB->frame_parms;
} else {
@@ -967,7 +962,7 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
num_tlv++;
}
- if(NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
+ if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
printf("[PNF] CONFIG_REQUEST[num_tlv:%d] TLVs processed:%d\n", req->num_tlv, num_tlv);
printf("[PNF] Simulating PHY CONFIG - DJP\n");
PHY_Config_t phy_config;
@@ -991,7 +986,7 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
nfapi_pnf_config_resp(config, &nfapi_resp);
printf("[PNF] Sent NFAPI_CONFIG_RESPONSE phy_id:%d\n", phy_info->id);
- if(NFAPI_MODE==NFAPI_UE_STUB_PNF)
+ if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF)
free(fp);
return 0;
@@ -1226,15 +1221,15 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
proc = &gNB->proc.L1_proc;
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu_list = req->dl_tti_request_body.dl_tti_pdu_list;
- //if (req->dl_tti_request_body.nPDUs)
- // NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX:%d/%d RX:%d/%d; sfn:%d, slot:%d, nGroup:%u, nPDUs: %u, nUE: %u, PduIdx: %u,\n",
- // __FUNCTION__, proc->frame_tx, proc->slot_tx, proc->frame_rx, proc->slot_rx, // TODO: change subframes to slot
- // req->SFN,
- // req->Slot,
- // req->dl_tti_request_body.nGroup,
- // req->dl_tti_request_body.nPDUs,
- // req->dl_tti_request_body.nUe,
- // req->dl_tti_request_body.PduIdx);
+ if (req->dl_tti_request_body.nPDUs)
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX:%d/%d RX:%d/%d; sfn:%d, slot:%d, nGroup:%u, nPDUs: %u, nUE: %p, PduIdx: %p,\n",
+ __FUNCTION__, proc->frame_tx, proc->slot_tx, proc->frame_rx, proc->slot_rx, // TODO: change subframes to slot
+ req->SFN,
+ req->Slot,
+ req->dl_tti_request_body.nGroup,
+ req->dl_tti_request_body.nPDUs,
+ req->dl_tti_request_body.nUe,
+ req->dl_tti_request_body.PduIdx);
for (int i=0; idl_tti_request_body.nPDUs; i++) {
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d pdcch_vars->num_dci:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size,pdcch_vars->num_dci);
@@ -1250,10 +1245,10 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU:%d BCH: pdu_index:%u pdu_length:%d sdu_length:%d BCH_SDU:%x,%x,%x\n", __FUNCTION__, i, pdu_index, bch_pdu->bch_pdu_rel8.length, tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_length, sdu[0], sdu[1], sdu[2]);
handle_nr_nfapi_ssb_pdu(msgTx, sfn, slot, &dl_tti_pdu_list[i]);
gNB->pbch_configured=1;
- }
+ }
else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE) {
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu = &dl_tti_pdu_list[i].pdsch_pdu;
- nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15_pdu = &pdsch_pdu->pdsch_pdu_rel15;
+ nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15_pdu = &pdsch_pdu->pdsch_pdu_rel15;
nfapi_nr_pdu_t *tx_data = tx_data_request[sfn][slot][rel15_pdu->pduIndex];
if (tx_data != NULL) {
@@ -1466,6 +1461,7 @@ int pnf_phy_ul_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
switch (ul_tti_pdu_list[i].pdu_type) {
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
//LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUSCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
+ //curr_sfn = curr_sfn + 3; //Gokul
nr_fill_ulsch(gNB,curr_sfn, curr_slot, &ul_tti_pdu_list[i].pusch_pdu);
break;
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
@@ -1661,7 +1657,6 @@ nfapi_pnf_p7_subframe_buffer_t dummy_subframe;
int start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi_start_request_t *req) {
printf("[PNF] Received NFAPI_START_REQ phy_id:%d\n", req->header.phy_id);
- nfapi_set_trace_level(NFAPI_TRACE_INFO);
pnf_info *pnf = (pnf_info *)(config->user_data);
phy_info *phy_info = pnf->phys;
nfapi_pnf_p7_config_t *p7_config = nfapi_pnf_p7_config_create();
@@ -1697,11 +1692,11 @@ int start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi
p7_config->tx_req = &pnf_phy_tx_req;
p7_config->lbt_dl_config_req = &pnf_phy_lbt_dl_config_req;
p7_config->ue_release_req = &pnf_phy_ue_release_req;
- if (NFAPI_MODE==NFAPI_UE_STUB_PNF) {
- p7_config->dl_config_req = &memcpy_dl_config_req;
- p7_config->ul_config_req = &memcpy_ul_config_req;
- p7_config->hi_dci0_req = &memcpy_hi_dci0_req;
- p7_config->tx_req = &memcpy_tx_req;
+ if (NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) {
+ p7_config->dl_config_req = NULL;
+ p7_config->ul_config_req = NULL;
+ p7_config->hi_dci0_req = NULL;
+ p7_config->tx_req = NULL;
} else {
p7_config->dl_config_req = &pnf_phy_dl_config_req;
p7_config->ul_config_req = &pnf_phy_ul_config_req;
@@ -1754,7 +1749,7 @@ int start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi
//phy_init_RU(RC.ru[0]);
printf("[PNF] About to call init_eNB_afterRU()\n");
- if (NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
+ if (NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
init_eNB_afterRU();
}
@@ -1781,7 +1776,6 @@ int start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi
int nr_start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi_nr_start_request_scf_t *req) {
printf("[PNF] Received NFAPI_START_REQ phy_id:%d\n", req->header.phy_id);
- nfapi_set_trace_level(NFAPI_TRACE_INFO);
pnf_info *pnf = (pnf_info *)(config->user_data);
phy_info *phy_info = pnf->phys;
nfapi_pnf_p7_config_t *p7_config = nfapi_pnf_p7_config_create();
@@ -1827,10 +1821,10 @@ int nr_start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, n
p7_config->lbt_dl_config_req = &pnf_phy_lbt_dl_config_req;
p7_config->ue_release_req = &pnf_phy_ue_release_req;
if (NFAPI_MODE==NFAPI_UE_STUB_PNF) {
- p7_config->dl_config_req = &memcpy_dl_config_req;
- p7_config->ul_config_req = &memcpy_ul_config_req;
- p7_config->hi_dci0_req = &memcpy_hi_dci0_req;
- p7_config->tx_req = &memcpy_tx_req;
+ p7_config->dl_config_req = NULL;
+ p7_config->ul_config_req = NULL;
+ p7_config->hi_dci0_req = NULL;
+ p7_config->tx_req = NULL;
} else {
p7_config->dl_config_req = &pnf_phy_dl_config_req;
p7_config->ul_config_req = &pnf_phy_ul_config_req;
@@ -2232,7 +2226,7 @@ void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_add
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) {
printf("%s() PNF\n\n\n\n\n\n", __FUNCTION__);
- if(NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
+ if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
nfapi_setmode(NFAPI_MODE_PNF); // PNF!
}
nfapi_pnf_config_t *config = nfapi_pnf_config_create();
@@ -2286,15 +2280,13 @@ void oai_subframe_ind(uint16_t sfn, uint16_t sf) {
uint16_t sfn_sf_tx = sfn<<4 | sf;
if ((sfn % 100 == 0) && sf==0) {
- struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
- NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s %d.%d (sfn:%u sf:%u) SFN/SF(TX):%u\n", __FUNCTION__, ts.tv_sec, ts.tv_nsec, sfn, sf, NFAPI_SFNSF2DEC(sfn_sf_tx));
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] (sfn:%u sf:%u) SFN/SF(TX):%u\n", sfn, sf, NFAPI_SFNSF2DEC(sfn_sf_tx));
}
int subframe_ret = nfapi_pnf_p7_subframe_ind(p7_config_g, p7_config_g->phy_id, sfn_sf_tx);
if (subframe_ret) {
- NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s(frame:%u subframe:%u) SFN/SF(TX):%u - PROBLEM with pnf_p7_subframe_ind()\n", __FUNCTION__, sfn, sf, sfn_sf_tx, NFAPI_SFNSF2DEC(sfn_sf_tx));
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] (frame:%u subframe:%u) SFN/SF(TX):%u - PROBLEM with pnf_p7_subframe_ind()\n", sfn, sf, sfn_sf_tx);
} else {
//NFAPI_TRACE(NFAPI_TRACE_INFO, "***NFAPI subframe handler finished *** \n");
}
diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c
index d96829e127..44ee05940f 100644
--- a/nfapi/oai_integration/nfapi_vnf.c
+++ b/nfapi/oai_integration/nfapi_vnf.c
@@ -43,6 +43,8 @@
#include
#include "common/ran_context.h"
+#include "openair2/PHY_INTERFACE/queue_t.h"
+#include "gnb_ind_vars.h"
#define TEST
@@ -203,7 +205,7 @@ extern uint16_t slot_ahead;
void oai_create_enb(void) {
int bodge_counter=0;
PHY_VARS_eNB *eNB = RC.eNB[0][0];
- printf("[VNF] RC.eNB[0][0]. Mod_id:%d CC_id:%d nb_CC[0]:%d abstraction_flag:%d single_thread_flag:%d if_inst:%p\n", eNB->Mod_id, eNB->CC_id, RC.nb_CC[0], eNB->abstraction_flag,
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] RC.eNB[0][0]. Mod_id:%d CC_id:%d nb_CC[0]:%d abstraction_flag:%d single_thread_flag:%d if_inst:%p\n", eNB->Mod_id, eNB->CC_id, RC.nb_CC[0], eNB->abstraction_flag,
eNB->single_thread_flag, eNB->if_inst);
eNB->Mod_id = bodge_counter;
eNB->CC_id = bodge_counter;
@@ -219,20 +221,20 @@ void oai_create_enb(void) {
// that will result in eNB->configured being set to TRUE.
// See we need to wait for that to happen otherwise the NFAPI message exchanges won't contain the right parameter values
if (RC.eNB[0][0]->if_inst==0 || RC.eNB[0][0]->if_inst->PHY_config_req==0 || RC.eNB[0][0]->if_inst->schedule_response==0) {
- printf("RC.eNB[0][0]->if_inst->PHY_config_req is not installed - install it\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.eNB[0][0]->if_inst->PHY_config_req is not installed - install it\n");
install_schedule_handlers(RC.eNB[0][0]->if_inst);
}
do {
- printf("%s() Waiting for eNB to become configured (by RRC/PHY) - need to wait otherwise NFAPI messages won't contain correct values\n", __FUNCTION__);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() Waiting for eNB to become configured (by RRC/PHY) - need to wait otherwise NFAPI messages won't contain correct values\n", __FUNCTION__);
usleep(50000);
} while(eNB->configured != 1);
- printf("%s() eNB is now configured\n", __FUNCTION__);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() eNB is now configured\n", __FUNCTION__);
}
void oai_enb_init(void) {
- printf("%s() About to call init_eNB_afterRU()\n", __FUNCTION__);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() About to call init_eNB_afterRU()\n", __FUNCTION__);
init_eNB_afterRU();
}
@@ -253,7 +255,7 @@ void oai_create_gnb(void) {
PHY_VARS_gNB *gNB = RC.gNB[0];
RC.nb_nr_CC = (int *)malloc(sizeof(int)); // TODO: find a better function to place this in
-
+
gNB->Mod_id = bodge_counter;
gNB->CC_id = bodge_counter;
gNB->abstraction_flag = 0;
@@ -263,26 +265,26 @@ void oai_create_gnb(void) {
if (gNB->if_inst==0) {
gNB->if_inst = NR_IF_Module_init(bodge_counter);
}
-
+
// This will cause phy_config_request to be installed. That will result in RRC configuring the PHY
// that will result in gNB->configured being set to TRUE.
// See we need to wait for that to happen otherwise the NFAPI message exchanges won't contain the right parameter values
if (RC.gNB[0]->if_inst==0 || RC.gNB[0]->if_inst->NR_PHY_config_req==0 || RC.gNB[0]->if_inst->NR_Schedule_response==0) {
- printf("RC.gNB[0][0]->if_inst->NR_PHY_config_req is not installed - install it\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.gNB[0][0]->if_inst->NR_PHY_config_req is not installed - install it\n");
install_nr_schedule_handlers(RC.gNB[0]->if_inst);
}
do {
- printf("%s() Waiting for gNB to become configured (by RRC/PHY) - need to wait otherwise NFAPI messages won't contain correct values\n", __FUNCTION__);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() Waiting for gNB to become configured (by RRC/PHY) - need to wait otherwise NFAPI messages won't contain correct values\n", __FUNCTION__);
usleep(50000);
} while(gNB->configured != 1);
- printf("%s() gNB is now configured\n", __FUNCTION__);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() gNB is now configured\n", __FUNCTION__);
}
int pnf_connection_indication_cb(nfapi_vnf_config_t *config, int p5_idx) {
- printf("[VNF] pnf connection indication idx:%d\n", p5_idx);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf connection indication idx:%d\n", p5_idx);
oai_create_enb();
nfapi_pnf_param_request_t req;
memset(&req, 0, sizeof(req));
@@ -292,7 +294,7 @@ int pnf_connection_indication_cb(nfapi_vnf_config_t *config, int p5_idx) {
}
int pnf_nr_connection_indication_cb(nfapi_vnf_config_t *config, int p5_idx) {
- printf("[VNF] pnf connection indication idx:%d\n", p5_idx);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf connection indication idx:%d\n", p5_idx);
oai_create_gnb();
nfapi_nr_pnf_param_request_t req;
memset(&req, 0, sizeof(req));
@@ -302,7 +304,7 @@ int pnf_nr_connection_indication_cb(nfapi_vnf_config_t *config, int p5_idx) {
}
int pnf_disconnection_indication_cb(nfapi_vnf_config_t *config, int p5_idx) {
- printf("[VNF] pnf disconnection indication idx:%d\n", p5_idx);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf disconnection indication idx:%d\n", p5_idx);
vnf_info *vnf = (vnf_info *)(config->user_data);
pnf_info *pnf = vnf->pnfs;
phy_info *phy = pnf->phys;
@@ -312,7 +314,7 @@ int pnf_disconnection_indication_cb(nfapi_vnf_config_t *config, int p5_idx) {
}
int pnf_nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_param_response_t *resp) {
- printf("[VNF] pnf param response idx:%d error:%d\n", p5_idx, resp->error_code);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf param response idx:%d error:%d\n", p5_idx, resp->error_code);
vnf_info *vnf = (vnf_info *)(config->user_data);
pnf_info *pnf = vnf->pnfs;
@@ -320,11 +322,11 @@ int pnf_nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_pa
phy_info phy;
memset(&phy,0,sizeof(phy));
phy.index = resp->pnf_phy.phy[i].phy_config_index;
- printf("[VNF] (PHY:%d) phy_config_idx:%d\n", i, resp->pnf_phy.phy[i].phy_config_index);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] (PHY:%d) phy_config_idx:%d\n", i, resp->pnf_phy.phy[i].phy_config_index);
nfapi_vnf_allocate_phy(config, p5_idx, &(phy.id));
for(int j = 0; j < resp->pnf_phy.phy[i].number_of_rfs; ++j) {
- printf("[VNF] (PHY:%d) (RF%d) %d\n", i, j, resp->pnf_phy.phy[i].rf_config[j].rf_config_index);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] (PHY:%d) (RF%d) %d\n", i, j, resp->pnf_phy.phy[i].rf_config[j].rf_config_index);
phy.rfs[0] = resp->pnf_phy.phy[i].rf_config[j].rf_config_index;
}
@@ -335,7 +337,7 @@ int pnf_nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_pa
req.header.message_id = NFAPI_PNF_CONFIG_REQUEST;
req.pnf_phy_rf_config.tl.tag = NFAPI_PNF_PHY_RF_TAG;
req.pnf_phy_rf_config.number_phy_rf_config_info = 2; // DJP pnf.phys.size();
- printf("DJP:Hard coded num phy rf to 2\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "DJP:Hard coded num phy rf to 2\n");
for(unsigned i = 0; i < 2; ++i) {
req.pnf_phy_rf_config.phy_rf_config[i].phy_id = pnf->phys[i].id;
@@ -348,7 +350,7 @@ int pnf_nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_pa
}
int pnf_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_param_response_t *resp) {
- printf("[VNF] pnf param response idx:%d error:%d\n", p5_idx, resp->error_code);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf param response idx:%d error:%d\n", p5_idx, resp->error_code);
vnf_info *vnf = (vnf_info *)(config->user_data);
pnf_info *pnf = vnf->pnfs;
@@ -356,11 +358,11 @@ int pnf_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_param_re
phy_info phy;
memset(&phy,0,sizeof(phy));
phy.index = resp->pnf_phy.phy[i].phy_config_index;
- printf("[VNF] (PHY:%d) phy_config_idx:%d\n", i, resp->pnf_phy.phy[i].phy_config_index);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] (PHY:%d) phy_config_idx:%d\n", i, resp->pnf_phy.phy[i].phy_config_index);
nfapi_vnf_allocate_phy(config, p5_idx, &(phy.id));
for(int j = 0; j < resp->pnf_phy.phy[i].number_of_rfs; ++j) {
- printf("[VNF] (PHY:%d) (RF%d) %d\n", i, j, resp->pnf_phy.phy[i].rf_config[j].rf_config_index);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] (PHY:%d) (RF%d) %d\n", i, j, resp->pnf_phy.phy[i].rf_config[j].rf_config_index);
phy.rfs[0] = resp->pnf_phy.phy[i].rf_config[j].rf_config_index;
}
@@ -370,7 +372,7 @@ int pnf_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_param_re
rf_info rf;
memset(&rf,0,sizeof(rf));
rf.index = resp->pnf_rf.rf[i].rf_config_index;
- printf("[VNF] (RF:%d) rf_config_idx:%d\n", i, resp->pnf_rf.rf[i].rf_config_index);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] (RF:%d) rf_config_idx:%d\n", i, resp->pnf_rf.rf[i].rf_config_index);
pnf->rfs[0] = rf;
}
nfapi_pnf_config_request_t req;
@@ -378,7 +380,7 @@ int pnf_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_param_re
req.header.message_id = NFAPI_PNF_CONFIG_REQUEST;
req.pnf_phy_rf_config.tl.tag = NFAPI_PNF_PHY_RF_TAG;
req.pnf_phy_rf_config.number_phy_rf_config_info = 2; // DJP pnf.phys.size();
- printf("DJP:Hard coded num phy rf to 2\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "DJP:Hard coded num phy rf to 2\n");
for(unsigned i = 0; i < 2; ++i) {
req.pnf_phy_rf_config.phy_rf_config[i].phy_id = pnf->phys[i].id;
@@ -391,7 +393,7 @@ int pnf_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_param_re
}
int pnf_nr_config_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_config_response_t *resp) {
- printf("[VNF] pnf config response idx:%d resp[header[phy_id:%u message_id:%02x message_length:%u]]\n", p5_idx, resp->header.phy_id, resp->header.message_id, resp->header.message_length);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf config response idx:%d resp[header[phy_id:%u message_id:%02x message_length:%u]]\n", p5_idx, resp->header.phy_id, resp->header.message_id, resp->header.message_length);
if(1) {
nfapi_nr_pnf_start_request_t req;
@@ -416,7 +418,7 @@ int pnf_nr_config_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_c
}
int pnf_config_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_config_response_t *resp) {
- printf("[VNF] pnf config response idx:%d resp[header[phy_id:%u message_id:%02x message_length:%u]]\n", p5_idx, resp->header.phy_id, resp->header.message_id, resp->header.message_length);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf config response idx:%d resp[header[phy_id:%u message_id:%02x message_length:%u]]\n", p5_idx, resp->header.phy_id, resp->header.message_id, resp->header.message_length);
if(1) {
nfapi_pnf_start_request_t req;
@@ -443,12 +445,12 @@ int pnf_config_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_config_
int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) {
struct timespec curr_t;
clock_gettime(CLOCK_MONOTONIC,&curr_t);
- //printf("\n wake_gNB_rxtx before assignment sfn:%d slot:%d TIME %d.%d",sfn,slot,curr_t.tv_sec,curr_t.tv_nsec);
+ //NFAPI_TRACE(NFAPI_TRACE_INFO, "\n wake_gNB_rxtx before assignment sfn:%d slot:%d TIME %d.%d",sfn,slot,curr_t.tv_sec,curr_t.tv_nsec);
gNB_L1_proc_t *proc=&gNB->proc;
gNB_L1_rxtx_proc_t *L1_proc= (slot&1)? &proc->L1_proc : &proc->L1_proc_tx;
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
- //printf("%s(eNB:%p, sfn:%d, sf:%d)\n", __FUNCTION__, eNB, sfn, sf);
+ //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(eNB:%p, sfn:%d, sf:%d)\n", __FUNCTION__, eNB, sfn, sf);
//int i;
struct timespec wait;
clock_gettime(CLOCK_REALTIME, &wait);
@@ -471,7 +473,7 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) {
// Try to be 1 frame back
old_slot = slot;
old_sfn = sfn;
- //printf("\n wake_gNB_rxtx after assignment sfn:%d slot:%d",proc->frame_rx,proc->slot_rx);
+ //NFAPI_TRACE(NFAPI_TRACE_INFO, "\n wake_gNB_rxtx after assignment sfn:%d slot:%d",proc->frame_rx,proc->slot_rx);
if (old_slot == 0 && old_sfn % 100 == 0) LOG_W( PHY,"[gNB] sfn/slot:%d%d old_sfn/slot:%d%d proc[rx:%d%d]\n", sfn, slot, old_sfn, old_slot, proc->frame_rx, proc->slot_rx);
}
@@ -490,7 +492,7 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) {
L1_proc->slot_tx = (L1_proc->slot_rx + slot_ahead)%20;
//LOG_I(PHY, "sfn/sf:%d%d proc[rx:%d%d] rx:%d%d] About to wake rxtx thread\n\n", sfn, slot, proc->frame_rx, proc->slot_rx, L1_proc->frame_rx, L1_proc->slot_rx);
- //printf("\nEntering wake_gNB_rxtx sfn %d slot %d\n",L1_proc->frame_rx,L1_proc->slot_rx);
+ //NFAPI_TRACE(NFAPI_TRACE_INFO, "\nEntering wake_gNB_rxtx sfn %d slot %d\n",L1_proc->frame_rx,L1_proc->slot_rx);
// the thread can now be woken up
if (pthread_cond_signal(&L1_proc->cond) != 0) {
LOG_E( PHY, "[gNB] ERROR pthread_cond_signal for gNB RXn-TXnp4 thread\n");
@@ -508,7 +510,7 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) {
L1_proc_t *proc=&eNB->proc;
L1_rxtx_proc_t *L1_proc= (sf&1)? &proc->L1_proc : &proc->L1_proc_tx;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
- //printf("%s(eNB:%p, sfn:%d, sf:%d)\n", __FUNCTION__, eNB, sfn, sf);
+ //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(eNB:%p, sfn:%d, sf:%d)\n", __FUNCTION__, eNB, sfn, sf);
//int i;
struct timespec wait;
wait.tv_sec=0;
@@ -596,11 +598,11 @@ extern pthread_mutex_t nfapi_sync_mutex;
extern int nfapi_sync_var;
int phy_sync_indication(struct nfapi_vnf_p7_config *config, uint8_t sync) {
- //printf("[VNF] SYNC %s\n", sync==1 ? "ACHIEVED" : "LOST");
+ //NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] SYNC %s\n", sync==1 ? "ACHIEVED" : "LOST");
if (sync==1 && nfapi_sync_var!=0) {
-
- printf("[VNF] Signal to OAI main code that it can go\n");
+
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Signal to OAI main code that it can go\n");
pthread_mutex_lock(&nfapi_sync_mutex);
nfapi_sync_var=0;
pthread_cond_broadcast(&nfapi_sync_cond);
@@ -615,19 +617,19 @@ int phy_slot_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id, uin
static uint8_t first_time = 1;
if (first_time) {
- printf("[VNF] slot indication %d\n", NFAPI_SFNSLOT2DEC(sfn, slot));
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] slot indication %d\n", NFAPI_SFNSLOT2DEC(sfn, slot));
first_time = 0;
}
if (RC.gNB && RC.gNB[0]->configured) {
// uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf);
// uint16_t sf = NFAPI_SFNSF2SF(sfn_sf);
- LOG_D(PHY,"[VNF] slot indication sfn:%d sf:%d\n", sfn, slot);
+ LOG_D(PHY,"[VNF] slot indication sfn:%d slot:%d\n", sfn, slot);
wake_gNB_rxtx(RC.gNB[0], sfn, slot); // DONE: find NR equivalent
} else {
- printf("[VNF] %s() RC.gNB:%p\n", __FUNCTION__, RC.gNB);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() RC.gNB:%p\n", __FUNCTION__, RC.gNB);
- if (RC.gNB) printf("RC.gNB[0]->configured:%d\n", RC.gNB[0]->configured);
+ if (RC.gNB) NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.gNB[0]->configured:%d\n", RC.gNB[0]->configured);
}
return 0;
@@ -637,7 +639,7 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id,
static uint8_t first_time = 1;
if (first_time) {
- printf("[VNF] subframe indication %d\n", NFAPI_SFNSF2DEC(sfn_sf));
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] subframe indication %d\n", NFAPI_SFNSF2DEC(sfn_sf));
first_time = 0;
}
@@ -647,9 +649,9 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id,
//LOG_D(PHY,"[VNF] subframe indication sfn_sf:%d sfn:%d sf:%d\n", sfn_sf, sfn, sf);
wake_eNB_rxtx(RC.eNB[0][0], sfn, sf);
} else {
- printf("[VNF] %s() RC.eNB:%p\n", __FUNCTION__, RC.eNB);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() RC.eNB:%p\n", __FUNCTION__, RC.eNB);
- if (RC.eNB) printf("RC.eNB[0][0]->configured:%d\n", RC.eNB[0][0]->configured);
+ if (RC.eNB) NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.eNB[0][0]->configured:%d\n", RC.eNB[0][0]->configured);
}
return 0;
@@ -658,21 +660,11 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id,
int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indication_t *ind) {
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_preambles:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
- printf("[VNF] RACH_IND eNB:%p sfn_sf:%d number_of_preambles:%d\n", eNB, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
- pthread_mutex_lock(&eNB->UL_INFO_mutex);
+ LOG_D(MAC, "[VNF] RACH_IND eNB:%p sfn_sf:%d number_of_preambles:%d\n", eNB, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
+ AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
if(NFAPI_MODE == NFAPI_MODE_VNF){
- int8_t index = -1;
- for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
- if((UL_RCC_INFO.rach_ind[i].header.message_id == 0) && (index == -1)){
- index = i;
- break;
- }
- }
- if(index == -1){
- LOG_E(MAC,"phy_rach_indication : num of rach reach max \n");
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
- return 0;
- }
+ int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
+
UL_RCC_INFO.rach_ind[index] = *ind;
if (ind->rach_indication_body.number_of_preambles > 0)
@@ -681,7 +673,7 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
for (int i=0; irach_indication_body.number_of_preambles; i++) {
if (ind->rach_indication_body.preamble_list[i].preamble_rel8.tl.tag == NFAPI_PREAMBLE_REL8_TAG) {
- printf("preamble[%d]: rnti:%02x preamble:%d timing_advance:%d\n",
+ LOG_D(MAC, "preamble[%d]: rnti:%02x preamble:%d timing_advance:%d\n",
i,
ind->rach_indication_body.preamble_list[i].preamble_rel8.rnti,
ind->rach_indication_body.preamble_list[i].preamble_rel8.preamble,
@@ -689,7 +681,7 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
);
}
if(ind->rach_indication_body.preamble_list[i].preamble_rel13.tl.tag == NFAPI_PREAMBLE_REL13_TAG) {
- printf("RACH PREAMBLE REL13 present\n");
+ LOG_D(MAC, "RACH PREAMBLE REL13 present\n");
}
UL_RCC_INFO.rach_ind[index].rach_indication_body.preamble_list[i] = ind->rach_indication_body.preamble_list[i];
@@ -700,7 +692,7 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
for (int i=0; irach_indication_body.number_of_preambles; i++) {
if (ind->rach_indication_body.preamble_list[i].preamble_rel8.tl.tag == NFAPI_PREAMBLE_REL8_TAG) {
- printf("preamble[%d]: rnti:%02x preamble:%d timing_advance:%d\n",
+ LOG_D(MAC, "preamble[%d]: rnti:%02x preamble:%d timing_advance:%d\n",
i,
ind->rach_indication_body.preamble_list[i].preamble_rel8.rnti,
ind->rach_indication_body.preamble_list[i].preamble_rel8.preamble,
@@ -709,51 +701,190 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
}
if(ind->rach_indication_body.preamble_list[i].preamble_rel13.tl.tag == NFAPI_PREAMBLE_REL13_TAG) {
- printf("RACH PREAMBLE REL13 present\n");
+ LOG_D(MAC, "RACH PREAMBLE REL13 present\n");
}
eNB->preamble_list[i] = ind->rach_indication_body.preamble_list[i];
}
}
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+ AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_rach_ind(p7_vnf->mac, ind);
return 1;
}
+int phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
+{
+ if(NFAPI_MODE == NFAPI_MODE_VNF)
+ {
+ nfapi_nr_rach_indication_t *rach_ind = CALLOC(1, sizeof(*rach_ind));
+ rach_ind->header.message_id = ind->header.message_id;
+ rach_ind->number_of_pdus = ind->number_of_pdus;
+ rach_ind->sfn = ind->sfn;
+ rach_ind->slot = ind->slot;
+ rach_ind->pdu_list = CALLOC(rach_ind->number_of_pdus, sizeof(*rach_ind->pdu_list));
+ AssertFatal(rach_ind->pdu_list != NULL, "Memory not allocated for rach_ind->pdu_list in phy_nr_rach_indication.");
+ for (int i = 0; i < ind->number_of_pdus; i++)
+ {
+ rach_ind->pdu_list[i].num_preamble = ind->pdu_list[i].num_preamble;
+ rach_ind->pdu_list[i].freq_index = ind->pdu_list[i].freq_index;
+ rach_ind->pdu_list[i].symbol_index = ind->pdu_list[i].symbol_index;
+ rach_ind->pdu_list[i].preamble_list = CALLOC(ind->pdu_list[i].num_preamble, sizeof(nfapi_nr_prach_indication_preamble_t));
+ AssertFatal(rach_ind->pdu_list[i].preamble_list != NULL, "Memory not allocated for rach_ind->pdu_list[i].preamble_list in phy_nr_rach_indication.");
+ for (int j = 0; j < ind->number_of_pdus; j++)
+ {
+ rach_ind->pdu_list[i].preamble_list[j].preamble_index = ind->pdu_list[i].preamble_list[j].preamble_index;
+ rach_ind->pdu_list[i].preamble_list[j].timing_advance = ind->pdu_list[i].preamble_list[j].timing_advance;
+ }
+ }
+ if (!put_queue(&gnb_rach_ind_queue, rach_ind))
+ {
+ LOG_E(NR_MAC, "Put_queue failed for rach_ind\n");
+ for (int i = 0; i < ind->number_of_pdus; i++)
+ {
+ free(rach_ind->pdu_list[i].preamble_list);
+ }
+ free(rach_ind->pdu_list);
+ free(rach_ind);
+ }
+ }
+ else {
+ LOG_E(NR_MAC, "NFAPI_MODE = %d not NFAPI_MODE_VNF(2)\n", nfapi_getmode());
+ }
+ return 1;
+}
+
+int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind)
+{
+
+ LOG_I(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u\n",
+ __FUNCTION__,ind->sfn, ind->slot, ind->num_ucis);
+ if(NFAPI_MODE == NFAPI_MODE_VNF)
+ {
+ nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind));
+ AssertFatal(uci_ind != NULL, "Memory not allocated for uci_ind in phy_nr_uci_indication.");
+ *uci_ind = *ind;
+
+ uci_ind->uci_list = CALLOC(NFAPI_NR_UCI_IND_MAX_PDU, sizeof(nfapi_nr_uci_t));
+ AssertFatal(uci_ind->uci_list != NULL, "Memory not allocated for uci_ind->uci_list in phy_nr_uci_indication.");
+ for (int i = 0; i < ind->num_ucis; i++)
+ {
+ uci_ind->uci_list[i] = ind->uci_list[i];
+
+ switch (uci_ind->uci_list[i].pdu_type) {
+ case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
+ LOG_E(MAC, "%s(): unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE\n", __func__);
+ break;
+
+ case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
+ nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_ind_pdu = &uci_ind->uci_list[i].pucch_pdu_format_0_1;
+ nfapi_nr_uci_pucch_pdu_format_0_1_t *ind_pdu = &ind->uci_list[i].pucch_pdu_format_0_1;
+ if (ind_pdu->sr) {
+ uci_ind_pdu->sr = CALLOC(1, sizeof(*uci_ind_pdu->sr));
+ AssertFatal(uci_ind_pdu->sr != NULL, "Memory not allocated for uci_ind_pdu->harq in phy_nr_uci_indication.");
+ *uci_ind_pdu->sr = *ind_pdu->sr;
+ }
+ if (ind_pdu->harq) {
+ uci_ind_pdu->harq = CALLOC(1, sizeof(*uci_ind_pdu->harq));
+ AssertFatal(uci_ind_pdu->harq != NULL, "Memory not allocated for uci_ind_pdu->harq in phy_nr_uci_indication.");
+
+ *uci_ind_pdu->harq = *ind_pdu->harq;
+ uci_ind_pdu->harq->harq_list = CALLOC(uci_ind_pdu->harq->num_harq, sizeof(*uci_ind_pdu->harq->harq_list));
+ AssertFatal(uci_ind_pdu->harq->harq_list != NULL, "Memory not allocated for uci_ind_pdu->harq->harq_list in phy_nr_uci_indication.");
+ for (int j = 0; j < uci_ind_pdu->harq->num_harq; j++)
+ uci_ind_pdu->harq->harq_list[j].harq_value = ind_pdu->harq->harq_list[j].harq_value;
+ }
+ break;
+ }
+
+ case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
+ nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_ind_pdu = &uci_ind->uci_list[i].pucch_pdu_format_2_3_4;
+ nfapi_nr_uci_pucch_pdu_format_2_3_4_t *ind_pdu = &ind->uci_list[i].pucch_pdu_format_2_3_4;
+
+ uci_ind_pdu->harq.harq_payload = CALLOC(1, sizeof(*uci_ind_pdu->harq.harq_payload));
+ AssertFatal(uci_ind_pdu->harq.harq_payload != NULL, "Memory not allocated for uci_ind_pdu->harq.harq_payload in phy_nr_uci_indication.");
+ *uci_ind_pdu->harq.harq_payload = *ind_pdu->harq.harq_payload;
+
+
+ uci_ind_pdu->csi_part1.csi_part1_payload = CALLOC(1, sizeof(*uci_ind_pdu->csi_part1.csi_part1_payload));
+ AssertFatal(uci_ind_pdu->csi_part1.csi_part1_payload != NULL, "Memory not allocated for uci_ind_pdu->csi_part1.csi_part1_payload in phy_nr_uci_indication.");
+ *uci_ind_pdu->csi_part1.csi_part1_payload = *ind_pdu->csi_part1.csi_part1_payload;
+
+
+ uci_ind_pdu->csi_part2.csi_part2_payload = CALLOC(1, sizeof(*uci_ind_pdu->csi_part2.csi_part2_payload));
+ AssertFatal(uci_ind_pdu->csi_part2.csi_part2_payload != NULL, "Memory not allocated for uci_ind_pdu->csi_part2.csi_part2_payload in phy_nr_uci_indication.");
+ *uci_ind_pdu->csi_part2.csi_part2_payload = *ind_pdu->csi_part2.csi_part2_payload;
+
+ break;
+ }
+ }
+ }
+
+ if (!put_queue(&gnb_uci_ind_queue, uci_ind))
+ {
+ LOG_E(NR_MAC, "Put_queue failed for uci_ind\n");
+ for (int i = 0; i < ind->num_ucis; i++)
+ {
+ if (uci_ind->uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE)
+ {
+ if (uci_ind->uci_list[i].pucch_pdu_format_0_1.harq) {
+ free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list);
+ uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL;
+ free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq);
+ uci_ind->uci_list[i].pucch_pdu_format_0_1.harq = NULL;
+ }
+ if (uci_ind->uci_list[i].pucch_pdu_format_0_1.sr) {
+ free(uci_ind->uci_list[i].pucch_pdu_format_0_1.sr);
+ uci_ind->uci_list[i].pucch_pdu_format_0_1.sr = NULL;
+ }
+ }
+ if (uci_ind->uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE)
+ {
+ free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload);
+ free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload);
+ free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload);
+ }
+ }
+ free(uci_ind->uci_list);
+ uci_ind->uci_list = NULL;
+ free(uci_ind);
+ uci_ind = NULL;
+ }
+ }
+ else {
+ LOG_E(NR_MAC, "NFAPI_MODE = %d not NFAPI_MODE_VNF(2)\n", nfapi_getmode());
+ }
+ return 1;
+}
+
int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indication_t *ind) {
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_harqs:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->harq_indication_body.number_of_harqs);
- pthread_mutex_lock(&eNB->UL_INFO_mutex);
+ AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
if(NFAPI_MODE == NFAPI_MODE_VNF){
- int8_t index = -1;
- for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
- if((UL_RCC_INFO.harq_ind[i].header.message_id == 0) && (index == -1)){
- index = i;
- break;
- }
- }
- if(index == -1){
- LOG_E(MAC,"phy_harq_indication : num of harq reach max \n");
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
- return 0;
- }
+ int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
+
UL_RCC_INFO.harq_ind[index] = *ind;
- if (ind->harq_indication_body.number_of_harqs > 0)
- UL_RCC_INFO.harq_ind[index].harq_indication_body.harq_pdu_list = malloc(sizeof(nfapi_harq_indication_pdu_t)*ind->harq_indication_body.number_of_harqs );
+ assert(ind->harq_indication_body.number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU);
+ if (ind->harq_indication_body.number_of_harqs > 0) {
+ UL_RCC_INFO.harq_ind[index].harq_indication_body.harq_pdu_list = malloc(sizeof(nfapi_harq_indication_pdu_t) * NFAPI_HARQ_IND_MAX_PDU);
+ }
for (int i=0; iharq_indication_body.number_of_harqs; i++) {
memcpy(&UL_RCC_INFO.harq_ind[index].harq_indication_body.harq_pdu_list[i], &ind->harq_indication_body.harq_pdu_list[i], sizeof(nfapi_harq_indication_pdu_t));
}
}else{
- eNB->UL_INFO.harq_ind = *ind;
- eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = eNB->harq_pdu_list;
+ eNB->UL_INFO.harq_ind = *ind;
+ eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = eNB->harq_pdu_list;
- for (int i=0; iharq_indication_body.number_of_harqs; i++) {
- memcpy(&eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[i], &ind->harq_indication_body.harq_pdu_list[i], sizeof(eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[i]));
+ assert(ind->harq_indication_body.number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU);
+ for (int i=0; iharq_indication_body.number_of_harqs; i++) {
+ memcpy(&eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[i],
+ &ind->harq_indication_body.harq_pdu_list[i],
+ sizeof(eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[i]));
+ }
}
- }
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+ AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_harq_ind(p7_vnf->mac, ind);
return 1;
@@ -761,28 +892,18 @@ int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indicatio
int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_t *ind) {
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
- pthread_mutex_lock(&eNB->UL_INFO_mutex);
+ AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
if(NFAPI_MODE == NFAPI_MODE_VNF){
- int8_t index = -1;
- for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
- if((UL_RCC_INFO.crc_ind[i].header.message_id == 0) && (index == -1)){
- index = i;
- }
- if(UL_RCC_INFO.rx_ind[i].sfn_sf == ind->sfn_sf){
- index = i;
- break;
- }
- }
- if(index == -1){
- LOG_E(MAC,"phy_crc_indication : num of crc reach max \n");
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
- return 0;
- }
+ int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
+
UL_RCC_INFO.crc_ind[index] = *ind;
- if (ind->crc_indication_body.number_of_crcs > 0)
- UL_RCC_INFO.crc_ind[index].crc_indication_body.crc_pdu_list = malloc(sizeof(nfapi_crc_indication_pdu_t)*ind->crc_indication_body.number_of_crcs );
+ assert(ind->crc_indication_body.number_of_crcs <= NFAPI_CRC_IND_MAX_PDU);
+ if (ind->crc_indication_body.number_of_crcs > 0) {
+ UL_RCC_INFO.crc_ind[index].crc_indication_body.crc_pdu_list = malloc(sizeof(nfapi_crc_indication_pdu_t) * NFAPI_CRC_IND_MAX_PDU);
+ }
+ assert(ind->crc_indication_body.number_of_crcs <= NFAPI_CRC_IND_MAX_PDU);
for (int i=0; icrc_indication_body.number_of_crcs; i++) {
memcpy(&UL_RCC_INFO.crc_ind[index].crc_indication_body.crc_pdu_list[i], &ind->crc_indication_body.crc_pdu_list[i], sizeof(ind->crc_indication_body.crc_pdu_list[0]));
@@ -804,6 +925,7 @@ int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_
LOG_D(MAC, "%s() NFAPI SFN/SF:%d IND:number_of_crcs:%u UL_INFO:crcs:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->crc_indication_body.number_of_crcs,
eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs);
+ assert(ind->crc_indication_body.number_of_crcs <= NFAPI_CRC_IND_MAX_PDU);
for (int i=0; icrc_indication_body.number_of_crcs; i++) {
memcpy(&dest_ind->crc_indication_body.crc_pdu_list[i], &ind->crc_indication_body.crc_pdu_list[i], sizeof(ind->crc_indication_body.crc_pdu_list[0]));
LOG_D(MAC, "%s() NFAPI SFN/SF:%d CRC_IND:number_of_crcs:%u UL_INFO:crcs:%d PDU[%d] rnti:%04x UL_INFO:rnti:%04x\n",
@@ -814,12 +936,54 @@ int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_
eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[i].rx_ue_information.rnti);
}
}
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+ AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_crc_ind(p7_vnf->mac, ind);
return 1;
}
+int phy_nr_crc_indication(nfapi_nr_crc_indication_t *ind) {
+
+ LOG_I(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u\n",
+ __FUNCTION__,ind->sfn, ind->slot, ind->number_crcs);
+
+ if(NFAPI_MODE == NFAPI_MODE_VNF)
+ {
+ nfapi_nr_crc_indication_t *crc_ind = CALLOC(1, sizeof(*crc_ind));
+ crc_ind->header.message_id = ind->header.message_id;
+ crc_ind->number_crcs = ind->number_crcs;
+ crc_ind->sfn = ind->sfn;
+ crc_ind->slot = ind->slot;
+ if (ind->number_crcs > 0) {
+ crc_ind->crc_list = CALLOC(NFAPI_NR_CRC_IND_MAX_PDU, sizeof(nfapi_nr_crc_t));
+ AssertFatal(crc_ind->crc_list != NULL, "Memory not allocated for crc_ind->crc_list in phy_nr_crc_indication.");
+ }
+ for (int j = 0; j < ind->number_crcs; j++)
+ {
+ crc_ind->crc_list[j].handle = ind->crc_list[j].handle;
+ crc_ind->crc_list[j].harq_id = ind->crc_list[j].harq_id;
+ crc_ind->crc_list[j].num_cb = ind->crc_list[j].num_cb;
+ crc_ind->crc_list[j].rnti = ind->crc_list[j].rnti;
+ crc_ind->crc_list[j].tb_crc_status = ind->crc_list[j].tb_crc_status;
+ crc_ind->crc_list[j].timing_advance = ind->crc_list[j].timing_advance;
+ crc_ind->crc_list[j].ul_cqi = ind->crc_list[j].ul_cqi;
+ LOG_I(NR_MAC, "Received crc_ind.harq_id = %d for %d index SFN SLot %u %u with rnti %x\n",
+ ind->crc_list[j].harq_id, j, ind->sfn, ind->slot, ind->crc_list[j].rnti);
+ }
+ if (!put_queue(&gnb_crc_ind_queue, crc_ind))
+ {
+ LOG_E(NR_MAC, "Put_queue failed for crc_ind\n");
+ free(crc_ind->crc_list);
+ free(crc_ind);
+ }
+ }
+ else
+ {
+ LOG_E(NR_MAC, "NFAPI_MODE = %d not NFAPI_MODE_VNF(2)\n", nfapi_getmode());
+ }
+ return 1;
+}
+
int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t *ind) {
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
@@ -827,51 +991,40 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_pdus:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rx_indication_body.number_of_pdus);
}
- pthread_mutex_lock(&eNB->UL_INFO_mutex);
+ AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
if(NFAPI_MODE == NFAPI_MODE_VNF){
- int8_t index = -1;
- for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
- if((UL_RCC_INFO.rx_ind[i].header.message_id == 0) && (index == -1)){
- index = i;
- }
- if(UL_RCC_INFO.crc_ind[i].sfn_sf == ind->sfn_sf){
- index = i;
- break;
- }
- }
- if(index == -1){
- LOG_E(MAC,"phy_rx_indication : num of rx reach max \n");
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
- return 0;
- }
+ int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
+
UL_RCC_INFO.rx_ind[index] = *ind;
- if (ind->rx_indication_body.number_of_pdus > 0)
- UL_RCC_INFO.rx_ind[index].rx_indication_body.rx_pdu_list = malloc(sizeof(nfapi_rx_indication_pdu_t)*ind->rx_indication_body.number_of_pdus );
+ size_t number_of_pdus = ind->rx_indication_body.number_of_pdus;
+ assert(number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
- for (int i=0; irx_indication_body.number_of_pdus; i++) {
+ if (number_of_pdus > 0) {
+ UL_RCC_INFO.rx_ind[index].rx_indication_body.rx_pdu_list =
+ malloc(sizeof(nfapi_rx_indication_pdu_t) * NFAPI_RX_IND_MAX_PDU);
+ }
+
+ for (int i=0; irx_indication_body.rx_pdu_list[i];
memcpy(dest_pdu, src_pdu, sizeof(*src_pdu));
- // DJP - TODO FIXME - intentional memory leak
if(dest_pdu->rx_indication_rel8.length > 0){
- dest_pdu->data = malloc(dest_pdu->rx_indication_rel8.length);
- memcpy(dest_pdu->data, src_pdu->data, dest_pdu->rx_indication_rel8.length);
- }else{
- dest_pdu->data = NULL;
+ assert(dest_pdu->rx_indication_rel8.length <= NFAPI_RX_IND_DATA_MAX);
+ memcpy(dest_pdu->rx_ind_data, src_pdu->rx_ind_data, dest_pdu->rx_indication_rel8.length);
}
- LOG_D(PHY, "%s() NFAPI SFN/SF:%d PDUs:%d [PDU:%d] handle:%d rnti:%04x length:%d offset:%d ul_cqi:%d ta:%d data:%p\n",
+ LOG_D(PHY, "%s() NFAPI SFN/SF:%d PDUs:%zu [PDU:%d] handle:%d rnti:%04x length:%d offset:%d ul_cqi:%d ta:%d data:%p\n",
__FUNCTION__,
- NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rx_indication_body.number_of_pdus, i,
+ NFAPI_SFNSF2DEC(ind->sfn_sf), number_of_pdus, i,
dest_pdu->rx_ue_information.handle,
dest_pdu->rx_ue_information.rnti,
dest_pdu->rx_indication_rel8.length,
dest_pdu->rx_indication_rel8.offset,
dest_pdu->rx_indication_rel8.ul_cqi,
dest_pdu->rx_indication_rel8.timing_advance,
- dest_pdu->data
+ dest_pdu->rx_ind_data
);
}
}else{
@@ -880,13 +1033,15 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t
*dest_ind = *ind;
dest_ind->rx_indication_body.rx_pdu_list = dest_pdu_list;
+ assert(ind->rx_indication_body.number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
for(int i=0; irx_indication_body.number_of_pdus; i++) {
nfapi_rx_indication_pdu_t *dest_pdu = &dest_ind->rx_indication_body.rx_pdu_list[i];
nfapi_rx_indication_pdu_t *src_pdu = &ind->rx_indication_body.rx_pdu_list[i];
memcpy(dest_pdu, src_pdu, sizeof(*src_pdu));
- // DJP - TODO FIXME - intentional memory leak
- dest_pdu->data = malloc(dest_pdu->rx_indication_rel8.length);
- memcpy(dest_pdu->data, src_pdu->data, dest_pdu->rx_indication_rel8.length);
+
+ assert(dest_pdu->rx_indication_rel8.length <= NFAPI_RX_IND_DATA_MAX);
+ memcpy(dest_pdu->rx_ind_data, src_pdu->rx_ind_data, dest_pdu->rx_indication_rel8.length);
+
LOG_D(PHY, "%s() NFAPI SFN/SF:%d PDUs:%d [PDU:%d] handle:%d rnti:%04x length:%d offset:%d ul_cqi:%d ta:%d data:%p\n",
__FUNCTION__,
NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rx_indication_body.number_of_pdus, i,
@@ -896,15 +1051,57 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t
dest_pdu->rx_indication_rel8.offset,
dest_pdu->rx_indication_rel8.ul_cqi,
dest_pdu->rx_indication_rel8.timing_advance,
- dest_pdu->data
+ dest_pdu->rx_ind_data
);
}
}
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+ AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_rx_ind(p7_vnf->mac, ind);
return 1;
}
+
+int phy_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) {
+
+ LOG_I(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u, and pdu %p\n",
+ __FUNCTION__,ind->sfn, ind->slot, ind->number_of_pdus, ind->pdu_list[0].pdu);
+
+ if(NFAPI_MODE == NFAPI_MODE_VNF)
+ {
+ nfapi_nr_rx_data_indication_t *rx_ind = CALLOC(1, sizeof(*rx_ind));
+ rx_ind->header.message_id = ind->header.message_id;
+ rx_ind->sfn = ind->sfn;
+ rx_ind->slot = ind->slot;
+ rx_ind->number_of_pdus = ind->number_of_pdus;
+
+ if (ind->number_of_pdus > 0) {
+ rx_ind->pdu_list = CALLOC(NFAPI_NR_RX_DATA_IND_MAX_PDU, sizeof(nfapi_nr_rx_data_pdu_t));
+ AssertFatal(rx_ind->pdu_list != NULL, "Memory not allocated for rx_ind->pdu_list in phy_nr_rx_data_indication.");
+ }
+ for (int j = 0; j < ind->number_of_pdus; j++)
+ {
+ rx_ind->pdu_list[j].handle = ind->pdu_list[j].handle;
+ rx_ind->pdu_list[j].harq_id = ind->pdu_list[j].harq_id;
+ rx_ind->pdu_list[j].pdu = ind->pdu_list[j].pdu;
+ rx_ind->pdu_list[j].pdu_length = ind->pdu_list[j].pdu_length;
+ rx_ind->pdu_list[j].rnti = ind->pdu_list[j].rnti;
+ rx_ind->pdu_list[j].timing_advance = ind->pdu_list[j].timing_advance;
+ rx_ind->pdu_list[j].ul_cqi = ind->pdu_list[j].ul_cqi;
+ }
+ if (!put_queue(&gnb_rx_ind_queue, rx_ind))
+ {
+ LOG_E(NR_MAC, "Put_queue failed for rx_ind\n");
+ free(rx_ind->pdu_list);
+ free(rx_ind);
+ }
+ }
+ else
+ {
+ LOG_E(NR_MAC, "NFAPI_MODE = %d not NFAPI_MODE_VNF(2)\n", nfapi_getmode());
+ }
+ return 1;
+}
+
int phy_srs_indication(struct nfapi_vnf_p7_config *config, nfapi_srs_indication_t *ind) {
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_srs_ind(p7_vnf->mac, ind);
@@ -914,25 +1111,18 @@ int phy_srs_indication(struct nfapi_vnf_p7_config *config, nfapi_srs_indication_
int phy_sr_indication(struct nfapi_vnf_p7_config *config, nfapi_sr_indication_t *ind) {
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
LOG_D(MAC, "%s() NFAPI SFN/SF:%d srs:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->sr_indication_body.number_of_srs);
- pthread_mutex_lock(&eNB->UL_INFO_mutex);
+ AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
if(NFAPI_MODE == NFAPI_MODE_VNF){
- int8_t index = -1;
- for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
- if((UL_RCC_INFO.sr_ind[i].header.message_id == 0) && (index == -1)){
- index = i;
- break;
- }
- }
- if(index == -1){
- LOG_E(MAC,"phy_sr_indication : num of sr reach max \n");
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
- return 0;
- }
+ int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
+
UL_RCC_INFO.sr_ind[index] = *ind;
LOG_D(MAC,"%s() UL_INFO[%d].sr_ind.sr_indication_body.number_of_srs:%d\n", __FUNCTION__, index, eNB->UL_INFO.sr_ind.sr_indication_body.number_of_srs);
- if (ind->sr_indication_body.number_of_srs > 0)
- UL_RCC_INFO.sr_ind[index].sr_indication_body.sr_pdu_list = malloc(sizeof(nfapi_sr_indication_pdu_t)*ind->sr_indication_body.number_of_srs );
+ if (ind->sr_indication_body.number_of_srs > 0) {
+ assert(ind->sr_indication_body.number_of_srs <= NFAPI_SR_IND_MAX_PDU);
+ UL_RCC_INFO.sr_ind[index].sr_indication_body.sr_pdu_list = malloc(sizeof(nfapi_sr_indication_pdu_t) * NFAPI_SR_IND_MAX_PDU);
+ }
+ assert(ind->sr_indication_body.number_of_srs <= NFAPI_SR_IND_MAX_PDU);
for (int i=0; isr_indication_body.number_of_srs; i++) {
nfapi_sr_indication_pdu_t *dest_pdu = &UL_RCC_INFO.sr_ind[index].sr_indication_body.sr_pdu_list[i];
nfapi_sr_indication_pdu_t *src_pdu = &ind->sr_indication_body.sr_pdu_list[i];
@@ -948,6 +1138,7 @@ int phy_sr_indication(struct nfapi_vnf_p7_config *config, nfapi_sr_indication_t
dest_ind->sr_indication_body.sr_pdu_list = dest_pdu_list;
LOG_D(MAC,"%s() eNB->UL_INFO.sr_ind.sr_indication_body.number_of_srs:%d\n", __FUNCTION__, eNB->UL_INFO.sr_ind.sr_indication_body.number_of_srs);
+ assert(eNB->UL_INFO.sr_ind.sr_indication_body.number_of_srs <= NFAPI_SR_IND_MAX_PDU);
for (int i=0; iUL_INFO.sr_ind.sr_indication_body.number_of_srs; i++) {
nfapi_sr_indication_pdu_t *dest_pdu = &dest_ind->sr_indication_body.sr_pdu_list[i];
nfapi_sr_indication_pdu_t *src_pdu = &ind->sr_indication_body.sr_pdu_list[i];
@@ -955,36 +1146,63 @@ int phy_sr_indication(struct nfapi_vnf_p7_config *config, nfapi_sr_indication_t
memcpy(dest_pdu, src_pdu, sizeof(*src_pdu));
}
}
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+ AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_sr_ind(p7_vnf->mac, ind);
return 1;
}
+static bool is_ue_same(uint16_t ue_id_1, uint16_t ue_id_2)
+{
+ return (ue_id_1 == ue_id_2);
+}
+
+static void analyze_cqi_pdus_for_duplicates(nfapi_cqi_indication_t *ind)
+{
+ uint16_t num_cqis = ind->cqi_indication_body.number_of_cqis;
+ assert(num_cqis <= NFAPI_CQI_IND_MAX_PDU);
+ for (int i = 0; i < num_cqis; i++)
+ {
+ nfapi_cqi_indication_pdu_t *src_pdu = &ind->cqi_indication_body.cqi_pdu_list[i];
+
+ LOG_I(MAC, "CQI_IND[PDU:%d][rnti:%x cqi:%d channel:%d]\n", i, src_pdu->rx_ue_information.rnti,
+ src_pdu->ul_cqi_information.ul_cqi, src_pdu->ul_cqi_information.channel);
+
+ for (int j = i + 1; j < num_cqis; j++)
+ {
+ uint16_t rnti_i = ind->cqi_indication_body.cqi_pdu_list[i].rx_ue_information.rnti;
+ uint16_t rnti_j = ind->cqi_indication_body.cqi_pdu_list[j].rx_ue_information.rnti;
+ if (is_ue_same(rnti_i, rnti_j))
+ {
+ LOG_E(MAC, "Problem, two cqis received from a single UE for rnti %x\n",
+ rnti_i);
+ //abort(); This will be fixed in merge request which handles multiple CQIs.
+ }
+ }
+ }
+}
+
int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_t *ind) {
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_cqi_ind(p7_vnf->mac, ind);
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_cqis:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->cqi_indication_body.number_of_cqis);
- pthread_mutex_lock(&eNB->UL_INFO_mutex);
+ AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
if(NFAPI_MODE == NFAPI_MODE_VNF){
- int8_t index = -1;
- for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
- if((UL_RCC_INFO.cqi_ind[i].header.message_id == 0) && (index == -1)){
- index = i;
- break;
- }
- }
- if(index == -1){
- LOG_E(MAC,"phy_cqi_indication : num of cqi reach max \n");
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
- return 0;
- }
+ int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
+
UL_RCC_INFO.cqi_ind[index] = *ind;
+ assert(ind->cqi_indication_body.number_of_cqis <= NFAPI_CQI_IND_MAX_PDU);
if (ind->cqi_indication_body.number_of_cqis > 0){
- UL_RCC_INFO.cqi_ind[index].cqi_indication_body.cqi_pdu_list = malloc(sizeof(nfapi_cqi_indication_pdu_t)*ind->cqi_indication_body.number_of_cqis );
- UL_RCC_INFO.cqi_ind[index].cqi_indication_body.cqi_raw_pdu_list = malloc(sizeof(nfapi_cqi_indication_raw_pdu_t)*ind->cqi_indication_body.number_of_cqis );
+ UL_RCC_INFO.cqi_ind[index].cqi_indication_body.cqi_pdu_list =
+ malloc(sizeof(nfapi_cqi_indication_pdu_t) * NFAPI_CQI_IND_MAX_PDU);
+ UL_RCC_INFO.cqi_ind[index].cqi_indication_body.cqi_raw_pdu_list =
+ malloc(sizeof(nfapi_cqi_indication_raw_pdu_t) * NFAPI_CQI_IND_MAX_PDU);
}
+
+ analyze_cqi_pdus_for_duplicates(ind);
+
+ assert(ind->cqi_indication_body.number_of_cqis <= NFAPI_CQI_IND_MAX_PDU);
for (int i=0; icqi_indication_body.number_of_cqis; i++) {
nfapi_cqi_indication_pdu_t *src_pdu = &ind->cqi_indication_body.cqi_pdu_list[i];
LOG_D(MAC, "SR_IND[PDU:%d][rnti:%x cqi:%d channel:%d]\n", i, src_pdu->rx_ue_information.rnti,
@@ -1000,9 +1218,10 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
*dest_ind = *ind;
dest_ind->cqi_indication_body.cqi_pdu_list = ind->cqi_indication_body.cqi_pdu_list;
dest_ind->cqi_indication_body.cqi_raw_pdu_list = ind->cqi_indication_body.cqi_raw_pdu_list;
+ assert(ind->cqi_indication_body.number_of_cqis <= NFAPI_CQI_IND_MAX_PDU);
for(int i=0; icqi_indication_body.number_of_cqis; i++) {
nfapi_cqi_indication_pdu_t *src_pdu = &ind->cqi_indication_body.cqi_pdu_list[i];
- LOG_D(MAC, "SR_IND[PDU:%d][rnti:%x cqi:%d channel:%d]\n", i, src_pdu->rx_ue_information.rnti,
+ LOG_D(MAC, "CQI_IND[PDU:%d][rnti:%x cqi:%d channel:%d]\n", i, src_pdu->rx_ue_information.rnti,
src_pdu->ul_cqi_information.ul_cqi, src_pdu->ul_cqi_information.channel);
memcpy(&dest_ind->cqi_indication_body.cqi_pdu_list[i],
src_pdu, sizeof(nfapi_cqi_indication_pdu_t));
@@ -1010,79 +1229,34 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
&ind->cqi_indication_body.cqi_raw_pdu_list[i], sizeof(nfapi_cqi_indication_raw_pdu_t));
}
}
- pthread_mutex_unlock(&eNB->UL_INFO_mutex);
+ AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
return 1;
}
//NR phy indication
int phy_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind) {
-
- uint8_t vnf_slot_ahead = 2;
+
+ uint8_t vnf_slot_ahead = 0;
uint32_t vnf_sfn_slot = sfnslot_add_slot(ind->sfn, ind->slot, vnf_slot_ahead);
- uint16_t vnf_sfn = NFAPI_SFNSLOT2SFN(vnf_sfn_slot);
- uint8_t vnf_slot = NFAPI_SFNSLOT2SLOT(vnf_sfn_slot); //offsetting the vnf from pnf by vnf_slot_head slots
- struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
- pthread_mutex_lock(&gNB->UL_INFO_mutex);
- gNB->UL_INFO.frame = vnf_sfn;
- gNB->UL_INFO.slot = vnf_slot;
- pthread_mutex_unlock(&gNB->UL_INFO_mutex);
- LOG_D(MAC, "VNF SFN/Slot %d.%d \n", gNB->UL_INFO.frame, gNB->UL_INFO.slot);
+ uint16_t vnf_sfn = NFAPI_SFNSLOT2SFN(vnf_sfn_slot);
+ uint8_t vnf_slot = NFAPI_SFNSLOT2SLOT(vnf_sfn_slot);
+ LOG_D(MAC, "VNF SFN/Slot %d.%d \n", vnf_sfn, vnf_slot);
+
+ nfapi_nr_slot_indication_scf_t *nr_slot_ind = CALLOC(1, sizeof(*nr_slot_ind));
+ nr_slot_ind->header = ind->header;
+ nr_slot_ind->sfn = vnf_sfn;
+ nr_slot_ind->slot = vnf_slot;
+ if (!put_queue(&gnb_slot_ind_queue, nr_slot_ind))
+ {
+ LOG_E(NR_MAC, "Put_queue failed for slot_ind\n");
+ free(nr_slot_ind);
+ nr_slot_ind = NULL;
+ }
return 1;
}
-int phy_nr_crc_indication(nfapi_nr_crc_indication_t *ind) {
- struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
- pthread_mutex_lock(&gNB->UL_INFO_mutex);
-
- gNB->UL_INFO.crc_ind = *ind;
-
- if (ind->number_crcs > 0)
- gNB->UL_INFO.crc_ind.crc_list = malloc(sizeof(nfapi_nr_crc_t)*ind->number_crcs);
-
- for (int i=0; inumber_crcs; i++)
- memcpy(&gNB->UL_INFO.crc_ind.crc_list[i], &ind->crc_list[i], sizeof(ind->crc_list[0]));
-
- pthread_mutex_unlock(&gNB->UL_INFO_mutex);
-
- return 1;
-}
-
-int phy_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) {
- struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
- pthread_mutex_lock(&gNB->UL_INFO_mutex);
-
- gNB->UL_INFO.rx_ind = *ind;
-
- if (ind->number_of_pdus > 0)
- gNB->UL_INFO.rx_ind.pdu_list = malloc(sizeof(nfapi_nr_rx_data_pdu_t)*ind->number_of_pdus);
-
- for (int i=0; inumber_of_pdus; i++)
- memcpy(&gNB->UL_INFO.rx_ind.pdu_list[i], &ind->pdu_list[i], sizeof(ind->pdu_list[0]));
-
-
- pthread_mutex_unlock(&gNB->UL_INFO_mutex);
-
- return 1;
-}
-
-int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) {
- struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
- pthread_mutex_lock(&gNB->UL_INFO_mutex);
-
- gNB->UL_INFO.uci_ind = *ind;
-
- if (ind->num_ucis > 0)
- gNB->UL_INFO.uci_ind.uci_list = malloc(sizeof(nfapi_nr_uci_t)*ind->num_ucis);
-
- for (int i=0; inum_ucis; i++)
- memcpy(&gNB->UL_INFO.uci_ind.uci_list[i], &ind->uci_list[i], sizeof(ind->uci_list[0]));
- //printf("UCI ind written to UL_info: num_ucis: %d, PDU_type : %d. \n", ind->num_ucis, ind->uci_list[0].pdu_type);
- pthread_mutex_unlock(&gNB->UL_INFO_mutex);
-
- return 1;
-}
int phy_nr_srs_indication(nfapi_nr_srs_indication_t *ind) {
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
@@ -1106,30 +1280,6 @@ int phy_nr_srs_indication(nfapi_nr_srs_indication_t *ind) {
return 1;
}
-
-int phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind) {
- struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
- pthread_mutex_lock(&gNB->UL_INFO_mutex);
-
- gNB->UL_INFO.rach_ind = *ind;
-
- if (ind->number_of_pdus > 0)
- gNB->UL_INFO.rach_ind.pdu_list = malloc(sizeof(nfapi_nr_prach_indication_pdu_t)*ind->number_of_pdus);
-
- for (int i=0; inumber_of_pdus; i++) {
- memcpy(&gNB->UL_INFO.rach_ind.pdu_list[i], &ind->pdu_list[i], sizeof(ind->pdu_list[0]));
-
- LOG_D(MAC, "%s() NFAPI SFN/Slot:%d.%d RACH_IND:number_of_pdus:%d UL_INFO:pdus:%d\n",
- __FUNCTION__,
- ind->sfn,ind->slot, ind->number_of_pdus, gNB->UL_INFO.rach_ind.number_of_pdus
- );
- }
-
- pthread_mutex_unlock(&gNB->UL_INFO_mutex);
-
- return 1;
-}
-
//end NR phy indication
int phy_lbt_dl_indication(struct nfapi_vnf_p7_config *config, nfapi_lbt_dl_indication_t *ind) {
@@ -1171,9 +1321,9 @@ void vnf_trace(nfapi_trace_level_t nfapi_level, const char *message, ...) {
int phy_vendor_ext(struct nfapi_vnf_p7_config *config, nfapi_p7_message_header_t *msg) {
if(msg->message_id == P7_VENDOR_EXT_IND) {
//vendor_ext_p7_ind* ind = (vendor_ext_p7_ind*)msg;
- //printf("[VNF] vendor_ext (error_code:%d)\n", ind->error_code);
+ //NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] vendor_ext (error_code:%d)\n", ind->error_code);
} else {
- printf("[VNF] unknown %02x\n", msg->message_id);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] unknown %02x\n", msg->message_id);
}
return 0;
@@ -1263,7 +1413,7 @@ static pthread_t vnf_start_pthread;
static pthread_t vnf_p7_start_pthread;
void *vnf_nr_p7_start_thread(void *ptr) {
- printf("%s()\n", __FUNCTION__);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
pthread_setname_np(pthread_self(), "VNF_P7");
nfapi_vnf_p7_config_t *config = (nfapi_vnf_p7_config_t *)ptr;
nfapi_nr_vnf_p7_start(config);
@@ -1271,7 +1421,7 @@ void *vnf_nr_p7_start_thread(void *ptr) {
}
void *vnf_p7_start_thread(void *ptr) {
- printf("%s()\n", __FUNCTION__);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
pthread_setname_np(pthread_self(), "VNF_P7");
nfapi_vnf_p7_config_t *config = (nfapi_vnf_p7_config_t *)ptr;
nfapi_vnf_p7_start(config);
@@ -1282,30 +1432,31 @@ void set_thread_priority(int priority);
void *vnf_nr_p7_thread_start(void *ptr) {
set_thread_priority(79);
+ init_queue(&gnb_rach_ind_queue);
+ init_queue(&gnb_rx_ind_queue);
+ init_queue(&gnb_crc_ind_queue);
+ init_queue(&gnb_uci_ind_queue);
+ init_queue(&gnb_slot_ind_queue);
+
vnf_p7_info *p7_vnf = (vnf_p7_info *)ptr;
p7_vnf->config->port = p7_vnf->local_port;
p7_vnf->config->sync_indication = &phy_sync_indication;
p7_vnf->config->slot_indication = &phy_slot_indication;
-
p7_vnf->config->harq_indication = &phy_harq_indication;
- p7_vnf->config->crc_indication = &phy_crc_indication;
- p7_vnf->config->rx_indication = &phy_rx_indication;
- p7_vnf->config->rach_indication = &phy_rach_indication;
+ p7_vnf->config->nr_crc_indication = &phy_nr_crc_indication;
+ p7_vnf->config->nr_rx_data_indication = &phy_nr_rx_data_indication;
+ p7_vnf->config->nr_rach_indication = &phy_nr_rach_indication;
+ p7_vnf->config->nr_uci_indication = &phy_nr_uci_indication;
p7_vnf->config->srs_indication = &phy_srs_indication;
p7_vnf->config->sr_indication = &phy_sr_indication;
p7_vnf->config->cqi_indication = &phy_cqi_indication;
p7_vnf->config->lbt_dl_indication = &phy_lbt_dl_indication;
p7_vnf->config->nb_harq_indication = &phy_nb_harq_indication;
p7_vnf->config->nrach_indication = &phy_nrach_indication;
- p7_vnf->config->nr_crc_indication = &phy_nr_crc_indication;
- p7_vnf->config->nr_slot_indication = &phy_nr_slot_indication;
- p7_vnf->config->nr_rx_data_indication = &phy_nr_rx_data_indication;
- p7_vnf->config->nr_uci_indication = &phy_nr_uci_indication;
- p7_vnf->config->nr_rach_indication = &phy_nr_rach_indication;
+ p7_vnf->config->nr_slot_indication = &phy_nr_slot_indication;
p7_vnf->config->nr_srs_indication = &phy_nr_srs_indication;
p7_vnf->config->malloc = &vnf_allocate;
p7_vnf->config->free = &vnf_deallocate;
- p7_vnf->config->trace = &vnf_trace;
p7_vnf->config->vendor_ext = &phy_vendor_ext;
p7_vnf->config->user_data = p7_vnf;
p7_vnf->mac->user_data = p7_vnf;
@@ -1342,7 +1493,6 @@ void *vnf_p7_thread_start(void *ptr) {
p7_vnf->config->nrach_indication = &phy_nrach_indication;
p7_vnf->config->malloc = &vnf_allocate;
p7_vnf->config->free = &vnf_deallocate;
- p7_vnf->config->trace = &vnf_trace;
p7_vnf->config->vendor_ext = &phy_vendor_ext;
p7_vnf->config->user_data = p7_vnf;
p7_vnf->mac->user_data = p7_vnf;
@@ -1364,7 +1514,7 @@ int pnf_nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_st
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
pnf_info *pnf = vnf->pnfs;
nfapi_nr_param_request_scf_t req;
- printf("[VNF] pnf start response idx:%d config:%p user_data:%p p7_vnf[config:%p thread_started:%d]\n", p5_idx, config, config->user_data, vnf->p7_vnfs[0].config, vnf->p7_vnfs[0].thread_started);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf start response idx:%d config:%p user_data:%p p7_vnf[config:%p thread_started:%d]\n", p5_idx, config, config->user_data, vnf->p7_vnfs[0].config, vnf->p7_vnfs[0].thread_started);
if(p7_vnf->thread_started == 0) {
pthread_t vnf_p7_thread;
@@ -1375,7 +1525,7 @@ int pnf_nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_pnf_st
}
// start all the phys in the pnf.
- printf("[VNF] Sending NFAPI_VNF_PARAM_REQUEST phy_id:%d\n", pnf->phys[0].id);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Sending NFAPI_VNF_PARAM_REQUEST phy_id:%d\n", pnf->phys[0].id);
memset(&req, 0, sizeof(req));
req.header.message_id = NFAPI_NR_PHY_MSG_TYPE_PARAM_REQUEST;
req.header.phy_id = pnf->phys[0].id;
@@ -1388,7 +1538,7 @@ int pnf_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_start_re
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
pnf_info *pnf = vnf->pnfs;
nfapi_param_request_t req;
- printf("[VNF] pnf start response idx:%d config:%p user_data:%p p7_vnf[config:%p thread_started:%d]\n", p5_idx, config, config->user_data, vnf->p7_vnfs[0].config, vnf->p7_vnfs[0].thread_started);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] pnf start response idx:%d config:%p user_data:%p p7_vnf[config:%p thread_started:%d]\n", p5_idx, config, config->user_data, vnf->p7_vnfs[0].config, vnf->p7_vnfs[0].thread_started);
if(p7_vnf->thread_started == 0) {
pthread_t vnf_p7_thread;
@@ -1399,7 +1549,7 @@ int pnf_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_start_re
}
// start all the phys in the pnf.
- printf("[VNF] Sending NFAPI_VNF_PARAM_REQUEST phy_id:%d\n", pnf->phys[0].id);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Sending NFAPI_VNF_PARAM_REQUEST phy_id:%d\n", pnf->phys[0].id);
memset(&req, 0, sizeof(req));
req.header.message_id = NFAPI_PARAM_REQUEST;
req.header.phy_id = pnf->phys[0].id;
@@ -1411,37 +1561,38 @@ extern uint32_t to_earfcn(int eutra_bandP,uint32_t dl_CarrierFreq,uint32_t bw);
int nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_param_response_scf_t *resp) {
- printf("[VNF] Received NFAPI_PARAM_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_PARAM_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
vnf_info *vnf = (vnf_info *)(config->user_data);
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
pnf_info *pnf = vnf->pnfs;
phy_info *phy = pnf->phys;
struct sockaddr_in pnf_p7_sockaddr;
nfapi_nr_config_request_scf_t *req = &RC.nrmac[0]->config[0]; // check
- phy->remote_port = 32123;//resp->nfapi_config.p7_pnf_port.value;
+ phy->remote_port = 50610;//resp->nfapi_config.p7_pnf_port.value;
+ //phy->remote_port = 32123;//resp->nfapi_config.p7_pnf_port.value;
memcpy(&pnf_p7_sockaddr.sin_addr.s_addr, &(resp->nfapi_config.p7_pnf_address_ipv4.address[0]), 4);
phy->remote_addr = inet_ntoa(pnf_p7_sockaddr.sin_addr);
// for now just 1
- printf("[VNF] %d.%d pnf p7 %s:%d timing %u %u %u %u\n", p5_idx, phy->id, phy->remote_addr, phy->remote_port, p7_vnf->timing_window, p7_vnf->periodic_timing_period, p7_vnf->aperiodic_timing_enabled,
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %d.%d pnf p7 %s:%d timing %u %u %u %u\n", p5_idx, phy->id, phy->remote_addr, phy->remote_port, p7_vnf->timing_window, p7_vnf->periodic_timing_period, p7_vnf->aperiodic_timing_enabled,
p7_vnf->periodic_timing_period);
req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST;
req->header.phy_id = phy->id;
- printf("[VNF] Send NFAPI_CONFIG_REQUEST\n");
- //printf("\n NR bandP =%d\n",req->nfapi_config.rf_bands.rf_band[0]);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Send NFAPI_CONFIG_REQUEST\n");
+ //NFAPI_TRACE(NFAPI_TRACE_INFO, "\n NR bandP =%d\n",req->nfapi_config.rf_bands.rf_band[0]);
req->nfapi_config.p7_vnf_port.tl.tag = NFAPI_NR_NFAPI_P7_VNF_PORT_TAG;
req->nfapi_config.p7_vnf_port.value = p7_vnf->local_port;
req->num_tlv++;
- printf("[VNF] DJP local_port:%d\n", p7_vnf->local_port);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] DJP local_port:%d\n", p7_vnf->local_port);
req->nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
struct sockaddr_in vnf_p7_sockaddr;
vnf_p7_sockaddr.sin_addr.s_addr = inet_addr(p7_vnf->local_addr);
memcpy(&(req->nfapi_config.p7_vnf_address_ipv4.address[0]), &vnf_p7_sockaddr.sin_addr.s_addr, 4);
req->num_tlv++;
- printf("[VNF] DJP local_addr:%s\n", p7_vnf->local_addr);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] DJP local_addr:%s\n", p7_vnf->local_addr);
req->nfapi_config.timing_window.tl.tag = NFAPI_NR_NFAPI_TIMING_WINDOW_TAG;
req->nfapi_config.timing_window.value = p7_vnf->timing_window;
- printf("\n[VNF]Timing window tag : %d Timing window:%u\n",NFAPI_NR_NFAPI_TIMING_WINDOW_TAG, p7_vnf->timing_window);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "\n[VNF]Timing window tag : %d Timing window:%u\n",NFAPI_NR_NFAPI_TIMING_WINDOW_TAG, p7_vnf->timing_window);
req->num_tlv++;
if(p7_vnf->periodic_timing_enabled || p7_vnf->aperiodic_timing_enabled) {
@@ -1455,7 +1606,7 @@ int nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_param_resp
req->num_tlv++;
}
}
-//TODO: Assign tag and value for P7 message offsets
+//TODO: Assign tag and value for P7 message offsets
req->nfapi_config.dl_tti_timing_offset.tl.tag = NFAPI_NR_NFAPI_DL_TTI_TIMING_OFFSET;
req->nfapi_config.ul_tti_timing_offset.tl.tag = NFAPI_NR_NFAPI_UL_TTI_TIMING_OFFSET;
req->nfapi_config.ul_dci_timing_offset.tl.tag = NFAPI_NR_NFAPI_UL_DCI_TIMING_OFFSET;
@@ -1473,7 +1624,7 @@ req->nfapi_config.tx_data_timing_offset.tl.tag = NFAPI_NR_NFAPI_TX_DATA_TIMING_O
int param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_param_response_t *resp) {
- printf("[VNF] Received NFAPI_PARAM_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_PARAM_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
vnf_info *vnf = (vnf_info *)(config->user_data);
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
pnf_info *pnf = vnf->pnfs;
@@ -1484,24 +1635,24 @@ int param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_param_response_t
memcpy(&pnf_p7_sockaddr.sin_addr.s_addr, &(resp->nfapi_config.p7_pnf_address_ipv4.address[0]), 4);
phy->remote_addr = inet_ntoa(pnf_p7_sockaddr.sin_addr);
// for now just 1
- printf("[VNF] %d.%d pnf p7 %s:%d timing %u %u %u %u\n", p5_idx, phy->id, phy->remote_addr, phy->remote_port, p7_vnf->timing_window, p7_vnf->periodic_timing_period, p7_vnf->aperiodic_timing_enabled,
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %d.%d pnf p7 %s:%d timing %u %u %u %u\n", p5_idx, phy->id, phy->remote_addr, phy->remote_port, p7_vnf->timing_window, p7_vnf->periodic_timing_period, p7_vnf->aperiodic_timing_enabled,
p7_vnf->periodic_timing_period);
req->header.message_id = NFAPI_CONFIG_REQUEST;
req->header.phy_id = phy->id;
- printf("[VNF] Send NFAPI_CONFIG_REQUEST\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Send NFAPI_CONFIG_REQUEST\n");
req->nfapi_config.p7_vnf_port.tl.tag = NFAPI_NFAPI_P7_VNF_PORT_TAG;
req->nfapi_config.p7_vnf_port.value = p7_vnf->local_port;
req->num_tlv++;
- printf("[VNF] DJP local_port:%d\n", p7_vnf->local_port);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] DJP local_port:%d\n", p7_vnf->local_port);
req->nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
struct sockaddr_in vnf_p7_sockaddr;
vnf_p7_sockaddr.sin_addr.s_addr = inet_addr(p7_vnf->local_addr);
memcpy(&(req->nfapi_config.p7_vnf_address_ipv4.address[0]), &vnf_p7_sockaddr.sin_addr.s_addr, 4);
req->num_tlv++;
- printf("[VNF] DJP local_addr:%s\n", p7_vnf->local_addr);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] DJP local_addr:%s\n", p7_vnf->local_addr);
req->nfapi_config.timing_window.tl.tag = NFAPI_NFAPI_TIMING_WINDOW_TAG;
req->nfapi_config.timing_window.value = p7_vnf->timing_window;
- printf("[VNF] Timing window:%u\n", p7_vnf->timing_window);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Timing window:%u\n", p7_vnf->timing_window);
req->num_tlv++;
if(p7_vnf->periodic_timing_enabled || p7_vnf->aperiodic_timing_enabled) {
@@ -1528,42 +1679,41 @@ int param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_param_response_t
int nr_config_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_config_response_scf_t *resp) {
nfapi_nr_start_request_scf_t req;
- printf("[VNF] Received NFAPI_CONFIG_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
- printf("[VNF] Calling oai_enb_init()\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_CONFIG_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Calling oai_enb_init()\n");
oai_enb_init(); // TODO: change to gnb
memset(&req, 0, sizeof(req));
req.header.message_id = NFAPI_NR_PHY_MSG_TYPE_START_REQUEST;
req.header.phy_id = resp->header.phy_id;
nfapi_nr_vnf_start_req(config, p5_idx, &req);
- printf("[VNF] Send NFAPI_VNF_START_REQUEST idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
return 0;
}
int config_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_config_response_t *resp) {
nfapi_start_request_t req;
- printf("[VNF] Received NFAPI_CONFIG_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
- printf("[VNF] Calling oai_enb_init()\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_CONFIG_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Calling oai_enb_init()\n");
oai_enb_init();
memset(&req, 0, sizeof(req));
req.header.message_id = NFAPI_START_REQUEST;
req.header.phy_id = resp->header.phy_id;
nfapi_vnf_start_req(config, p5_idx, &req);
- printf("[VNF] Send NFAPI_START_REQUEST idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Send NFAPI_VNF_START_REQUEST idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
return 0;
}
int start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_start_response_t *resp) {
- printf("[VNF] Received NFAPI_START_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_START_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
vnf_info *vnf = (vnf_info *)(config->user_data);
pnf_info *pnf = vnf->pnfs;
phy_info *phy = pnf->phys;
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
- nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, phy->remote_port, phy->id);
+ nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, htons(phy->remote_port), phy->id);
return 0;
}
int nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_start_response_scf_t *resp) {
- printf("[VNF] Received NFAPI_START_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_START_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
vnf_info *vnf = (vnf_info *)(config->user_data);
pnf_info *pnf = vnf->pnfs;
phy_info *phy = pnf->phys;
@@ -1574,12 +1724,12 @@ int nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_start_resp
}
int vendor_ext_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_p4_p5_message_header_t *msg) {
- printf("[VNF] %s\n", __FUNCTION__);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s\n", __FUNCTION__);
switch(msg->message_id) {
case P5_VENDOR_EXT_RSP: {
vendor_ext_p5_rsp *rsp = (vendor_ext_p5_rsp *)msg;
- printf("[VNF] P5_VENDOR_EXT_RSP error_code:%d\n", rsp->error_code);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] P5_VENDOR_EXT_RSP error_code:%d\n", rsp->error_code);
// send the start request
nfapi_pnf_start_request_t req;
memset(&req, 0, sizeof(req));
@@ -1645,18 +1795,18 @@ void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port) {
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() vnf.p7_vnfs[0].config:%p VNF ADDRESS:%s:%d\n", __FUNCTION__, vnf.p7_vnfs[0].config, vnf_addr, vnf_p5_port);
strcpy(vnf.p7_vnfs[0].local_addr, vnf_addr);
//vnf.p7_vnfs[0].local_port = vnf.p7_vnfs[0].local_port; // 50001; // TODO: remove hardcode
- vnf.p7_vnfs[0].local_port = 50011;
+ vnf.p7_vnfs[0].local_port = 50611;
+ //vnf.p7_vnfs[0].local_port = 50011;
vnf.p7_vnfs[0].mac = (mac_t *)malloc(sizeof(mac_t));
nfapi_vnf_config_t *config = nfapi_vnf_config_create();
config->malloc = malloc;
config->free = free;
- config->trace = &vnf_trace;
config->vnf_p5_port = vnf_p5_port;
config->vnf_ipv4 = 1;
config->vnf_ipv6 = 0;
config->pnf_list = 0;
config->phy_list = 0;
-
+
config->pnf_nr_connection_indication = &pnf_nr_connection_indication_cb;
config->pnf_disconnect_indication = &pnf_disconnection_indication_cb;
@@ -1701,7 +1851,6 @@ void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port) {
nfapi_vnf_config_t *config = nfapi_vnf_config_create();
config->malloc = malloc;
config->free = free;
- config->trace = &vnf_trace;
config->vnf_p5_port = vnf_p5_port;
config->vnf_ipv4 = 1;
config->vnf_ipv6 = 0;
@@ -1738,6 +1887,23 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) {
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
dl_config_req->header.message_id = NFAPI_DL_CONFIG_REQUEST;
+ LOG_I(PHY, "[VNF] %s() DL_CONFIG_REQ sfn_sf:%d_%d number_of_pdus:%d\n", __FUNCTION__,
+ NFAPI_SFNSF2SFN(dl_config_req->sfn_sf),NFAPI_SFNSF2SF(dl_config_req->sfn_sf), dl_config_req->dl_config_request_body.number_pdu);
+ if (dl_config_req->dl_config_request_body.number_pdu > 0)
+ {
+ for (int i = 0; i < dl_config_req->dl_config_request_body.number_pdu; i++)
+ {
+ uint8_t pdu_type = dl_config_req->dl_config_request_body.dl_config_pdu_list[i].pdu_type;
+ if(pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE)
+ {
+ uint16_t dl_rnti = dl_config_req->dl_config_request_body.dl_config_pdu_list[i].dlsch_pdu.dlsch_pdu_rel8.rnti;
+ uint16_t numPDUs = dl_config_req->dl_config_request_body.number_pdu;
+ LOG_I(MAC, "(OAI eNB) Sending dl_config_req at VNF during Frame: %d and Subframe: %d,"
+ " with a RNTI value of: %x and with number of PDUs: %u\n",
+ NFAPI_SFNSF2SFN(dl_config_req->sfn_sf),NFAPI_SFNSF2SF(dl_config_req->sfn_sf), dl_rnti, numPDUs);
+ }
+ }
+ }
int retval = nfapi_vnf_p7_dl_config_req(p7_config, dl_config_req);
dl_config_req->dl_config_request_body.number_pdcch_ofdm_symbols = 1;
dl_config_req->dl_config_request_body.number_dci = 0;
@@ -1838,12 +2004,31 @@ int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) {
return retval;
}
+static void remove_ul_config_req_pdu(int index, nfapi_ul_config_request_t *ul_config_req)
+{
+ int num_pdus = ul_config_req->ul_config_request_body.number_of_pdus;
+ nfapi_ul_config_request_pdu_t *pdu_list = ul_config_req->ul_config_request_body.ul_config_pdu_list;
+
+ if (index >= num_pdus || index < 0)
+ {
+ LOG_E(MAC, "%s() Unable to drop bad ul_config_req PDU\n", __FUNCTION__);
+ abort();
+ }
+
+ for(int i = index; i + 1 < num_pdus; i++)
+ {
+ pdu_list[i] = pdu_list[i + 1];
+ }
+
+ ul_config_req->ul_config_request_body.number_of_pdus--;
+}
+
int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req) {
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
ul_tti_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
ul_tti_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST;
-
+
int retval = nfapi_vnf_p7_ul_tti_req(p7_config, ul_tti_req);
if (retval!=0) {
@@ -1864,6 +2049,44 @@ int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) {
ul_config_req->header.message_id = NFAPI_UL_CONFIG_REQUEST;
//LOG_D(PHY, "[VNF] %s() header message_id:%02x\n", __FUNCTION__, ul_config_req->header.message_id);
//LOG_D(PHY, "[VNF] %s() UL_CONFIG sfn_sf:%d PDUs:%d rach_prach_frequency_resources:%d srs_present:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ul_config_req->sfn_sf), ul_config_req->ul_config_request_body.number_of_pdus, ul_config_req->ul_config_request_body.rach_prach_frequency_resources, ul_config_req->ul_config_request_body.srs_present);
+
+ int num_pdus = ul_config_req->ul_config_request_body.number_of_pdus;
+ nfapi_ul_config_request_pdu_t *pdu_list = ul_config_req->ul_config_request_body.ul_config_pdu_list;
+ for (int i = 0; i < num_pdus; i++)
+ {
+ uint8_t pdu_type = pdu_list[i].pdu_type;
+
+ LOG_I(MAC, "ul_config_req num_pdus: %u pdu_number: %d pdu_type: %u SFN.SF: %d.%d\n",
+ num_pdus, i, pdu_type, ul_config_req->sfn_sf >> 4, ul_config_req->sfn_sf & 15);
+
+ if (pdu_type != NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)
+ {
+ continue;
+ }
+
+ for (int j = i + 1; j < num_pdus; j++)
+ {
+ uint8_t pdu_type2 = pdu_list[j].pdu_type;
+ if (pdu_type != pdu_type2)
+ {
+ continue;
+ }
+
+ uint16_t rnti_i = pdu_list[i].ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti;
+ uint16_t rnti_j = pdu_list[j].ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti;
+ if (!is_ue_same(rnti_i, rnti_j))
+ {
+ continue;
+ }
+ remove_ul_config_req_pdu(j, ul_config_req);
+ j--;
+ num_pdus--;
+
+ LOG_E(MAC, "Problem, two cqis being sent to a single UE for rnti %x dropping one\n",
+ rnti_i);
+ }
+ }
+
int retval = nfapi_vnf_p7_ul_config_req(p7_config, ul_config_req);
if (retval!=0) {
diff --git a/nfapi/oai_integration/vendor_ext.h b/nfapi/oai_integration/vendor_ext.h
index f25aa703cc..9a377dc27d 100644
--- a/nfapi/oai_integration/vendor_ext.h
+++ b/nfapi/oai_integration/vendor_ext.h
@@ -70,10 +70,11 @@ typedef enum {
NFAPI_MODE_VNF,
NFAPI_UE_STUB_PNF,
NFAPI_UE_STUB_OFFNET,
+ NFAPI_MODE_STANDALONE_PNF,
NFAPI_MODE_UNKNOWN
} nfapi_mode_t;
-char *nfapi_get_strmode(void);
+const char *nfapi_get_strmode(void);
void nfapi_logmode(void);
nfapi_mode_t nfapi_getmode(void);
void nfapi_setmode(nfapi_mode_t nfapi_mode);
diff --git a/nfapi/open-nFAPI/common/public_inc/debug.h b/nfapi/open-nFAPI/common/public_inc/debug.h
index 14f97a17f6..574b097301 100644
--- a/nfapi/open-nFAPI/common/public_inc/debug.h
+++ b/nfapi/open-nFAPI/common/public_inc/debug.h
@@ -14,38 +14,31 @@
* limitations under the License.
*/
+#pragma once
-#ifndef _DEBUG_H_
-#define _DEBUG_H_
+#include
+#include
+
+#define ERR strerror(errno)
/*! The trace levels used by the nfapi libraries */
typedef enum nfapi_trace_level
{
- NFAPI_TRACE_ERROR = 1,
- NFAPI_TRACE_WARN,
- NFAPI_TRACE_NOTE,
- NFAPI_TRACE_INFO,
-
- NFAPI_TRACE_LEVEL_MAX
+ NFAPI_TRACE_NONE,
+ NFAPI_TRACE_ERROR,
+ NFAPI_TRACE_WARN,
+ NFAPI_TRACE_NOTE,
+ NFAPI_TRACE_INFO,
+ NFAPI_TRACE_DEBUG,
} nfapi_trace_level_t;
-/*! The trace function pointer */
-typedef void (*nfapi_trace_fn_t)(nfapi_trace_level_t level, const char* format, ...);
+void nfapi_trace(nfapi_trace_level_t, char const *caller, const char *format, ...)
+ __attribute__((format(printf, 3, 4)));
-/*! Global trace function */
-extern nfapi_trace_fn_t nfapi_trace_g;
+nfapi_trace_level_t nfapi_trace_level(void);
-/*! Global trace level */
-extern nfapi_trace_level_t nfapi_trace_level_g;
+#define NFAPI_TRACE(LEVEL, FORMAT, ...) do { \
+ if (nfapi_trace_level() >= (LEVEL)) \
+ nfapi_trace(LEVEL, __func__, FORMAT, ##__VA_ARGS__); \
+} while (0)
-/*! NFAPI trace macro */
-//#define NFAPI_TRACE(level, format, ...) { if(nfapi_trace_g && ((nfapi_trace_level_t)level <= nfapi_trace_level_g)) (*nfapi_trace_g)(level, format, ##__VA_ARGS__); }
-#define NFAPI_TRACE(level, format, ...) { if (nfapi_trace_g) (*nfapi_trace_g)(level, format, ##__VA_ARGS__); }
-
-/*! Function to change the trace level
- * \param new_level The modified trace level
- */
-
-void nfapi_set_trace_level(nfapi_trace_level_t new_level);
-
-#endif /* _DEBUG_H_ */
diff --git a/nfapi/open-nFAPI/common/src/debug.c b/nfapi/open-nFAPI/common/src/debug.c
index 5d4ad8a194..628e64d947 100644
--- a/nfapi/open-nFAPI/common/src/debug.c
+++ b/nfapi/open-nFAPI/common/src/debug.c
@@ -1,75 +1,87 @@
-/*
- * Copyright 2017 Cisco Systems, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#define MAX_MSG_LENGTH 2096
-#define TRACE_HEADER_LENGTH 44
-
-void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...);
-
-// initialize the trace function to 0
-void (*nfapi_trace_g)(nfapi_trace_level_t level, const char* format, ...) = &nfapi_trace_dbg;
-
-nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_INFO;
-//nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_WARN;
-
-void nfapi_set_trace_level(nfapi_trace_level_t new_level)
-{
- nfapi_trace_level_g = new_level;
-}
-
-void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...)
-{
- char trace_buff[MAX_MSG_LENGTH + TRACE_HEADER_LENGTH];
- uint32_t num_chars;
- va_list p_args;
- struct timeval tv;
- pthread_t tid = pthread_self();
-
- (void)gettimeofday(&tv, NULL);
-
- num_chars = (uint32_t)snprintf(trace_buff, TRACE_HEADER_LENGTH, "%04u.%06u: 0x%02x: %10u: ", ((uint32_t)tv.tv_sec) & 0x1FFF, (uint32_t)tv.tv_usec, (uint32_t)level, (uint32_t)tid);
-
- if (num_chars > TRACE_HEADER_LENGTH)
- {
- printf("trace_dbg: Error, num_chars is too large: %d", num_chars);
- return;
- }
-
- va_start(p_args, format);
- if ((num_chars = (uint32_t)vsnprintf(&trace_buff[num_chars], MAX_MSG_LENGTH, format, p_args)))
- {
- if (level <= NFAPI_TRACE_WARN)
- {
- printf("%s", trace_buff);
- }
- printf("%s", trace_buff);
- }
- va_end(p_args);
-}
+/*
+ * Copyright 2017 Cisco Systems, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+#include "debug.h"
+#include
+#include
+#include
+#include
+#include
+#include
+
+static nfapi_trace_level_t trace_level = NFAPI_TRACE_WARN;
+
+static void nfapi_trace_init(void)
+{
+ static bool initialized;
+ if (initialized)
+ return;
+ initialized = true;
+
+ const char *env = getenv("NFAPI_TRACE_LEVEL");
+ if (!env)
+ return;
+ if (strcmp(env, "none") == 0)
+ trace_level = NFAPI_TRACE_NONE;
+ else if (strcmp(env, "error") == 0)
+ trace_level = NFAPI_TRACE_ERROR;
+ else if (strcmp(env, "warn") == 0)
+ trace_level = NFAPI_TRACE_WARN;
+ else if (strcmp(env, "note") == 0)
+ trace_level = NFAPI_TRACE_NOTE;
+ else if (strcmp(env, "info") == 0)
+ trace_level = NFAPI_TRACE_INFO;
+ else if (strcmp(env, "debug") == 0)
+ trace_level = NFAPI_TRACE_DEBUG;
+ else
+ {
+ nfapi_trace(NFAPI_TRACE_ERROR, __func__, "Invalid NFAPI_TRACE_LEVEL='%s'", env);
+ return;
+ }
+ nfapi_trace(trace_level, __func__, "NFAPI_TRACE_LEVEL='%s'", env);
+}
+
+nfapi_trace_level_t nfapi_trace_level()
+{
+ nfapi_trace_init();
+ return trace_level;
+}
+
+void nfapi_trace(nfapi_trace_level_t level,
+ char const *caller,
+ char const *format, ...)
+{
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ printf("%ld%06ld [%c] %10u: %s: ",
+ ts.tv_sec,
+ ts.tv_nsec / 1000,
+ "XEWNID"[level], // NFAPI_TRACE_NONE, NFAPI_TRACE_ERROR, ...
+ (unsigned) pthread_self(),
+ caller);
+
+ va_list ap;
+ va_start(ap, format);
+ vprintf(format, ap);
+ va_end(ap);
+
+ // Add a newline if the format string didn't have one
+ int len = strlen(format);
+ if (len == 0 || format[len - 1] != '\n')
+ putchar('\n');
+
+ fflush(stdout);
+}
diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
index 0e923931ad..21cbaf93c1 100644
--- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
+++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
@@ -118,11 +118,18 @@ typedef struct {
short rsrp_dBm;
} fapi_nr_ssb_pdu_t;
+typedef struct {
+ uint32_t pdu_length;
+ uint8_t* pdu;
+ uint32_t sibs_mask;
+} fapi_nr_sib_pdu_t;
+
typedef struct {
uint8_t pdu_type;
union {
fapi_nr_pdsch_pdu_t pdsch_pdu;
fapi_nr_ssb_pdu_t ssb_pdu;
+ fapi_nr_sib_pdu_t sib_pdu;
};
} fapi_nr_rx_indication_body_t;
@@ -403,8 +410,11 @@ typedef struct {
uint8_t tb2_rv;
uint8_t harq_process_nbr;
vrb_to_prb_mapping_t vrb_to_prb_mapping;
+ uint8_t dai;
double scaling_factor_S;
int8_t accumulated_delta_PUCCH;
+ uint8_t pucch_resource_id;
+ uint8_t pdsch_to_harq_feedback_time_ind;
uint8_t n_dmrs_cdm_groups;
uint8_t dmrs_ports[10];
uint8_t n_front_load_symb;
@@ -451,6 +461,437 @@ typedef struct {
} fapi_nr_dl_config_request_t;
+//
+// P5
+//
+
+
+
+typedef struct {
+ fapi_nr_coreset_t coreset;
+
+ uint8_t monitoring_slot_peridicity;
+ uint8_t monitoring_slot_offset;
+ uint16_t duration;
+ uint16_t monitoring_symbols_within_slot;
+ uint8_t number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16
+
+ uint8_t dci_2_0_number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16
+ uint8_t dci_2_3_monitorying_periodicity;
+ uint8_t dci_2_3_number_of_candidates;
+
+} fapi_nr_search_space_t;
+
+typedef struct {
+ fapi_nr_search_space_t search_space_sib1;
+ fapi_nr_search_space_t search_space_others_sib;
+ fapi_nr_search_space_t search_space_paging;
+ //fapi_nr_coreset_t coreset_ra; // common coreset
+ fapi_nr_search_space_t search_space_ra;
+} fapi_nr_pdcch_config_common_t;
+
+typedef struct {
+ uint8_t k0;
+ uint8_t mapping_type;
+ uint8_t symbol_starting;
+ uint8_t symbol_length;
+} fapi_nr_pdsch_time_domain_resource_allocation_t;
+
+typedef struct {
+ fapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_DL_ALLOCATIONS];
+} fapi_nr_pdsch_config_common_t;
+
+typedef struct {
+ uint8_t prach_configuration_index;
+ uint8_t msg1_fdm;
+ uint8_t msg1_frequency_start;
+ uint8_t zero_correlation_zone_config;
+ uint8_t preamble_received_target_power;
+ uint8_t preamble_transmission_max;
+ uint8_t power_ramping_step;
+ uint8_t ra_window_size;
+
+ uint8_t total_number_of_preamble;
+ uint8_t ssb_occasion_per_rach;
+ uint8_t cb_preamble_per_ssb;
+
+ uint8_t group_a_msg3_size;
+ uint8_t group_a_number_of_preamble;
+ uint8_t group_b_power_offset;
+ uint8_t contention_resolution_timer;
+ uint8_t rsrp_threshold_ssb;
+ uint8_t rsrp_threshold_ssb_sul;
+ uint8_t prach_length; // l839, l139
+ uint8_t prach_root_sequence_index; // 0 - 837 for l839, 0 - 137 for l139
+ uint8_t msg1_subcarrier_spacing;
+ uint8_t restrictedset_config;
+ uint8_t msg3_transform_precoding;
+} fapi_nr_rach_config_common_t;
+
+typedef struct {
+ uint8_t k2;
+ uint8_t mapping_type;
+ uint8_t symbol_starting;
+ uint8_t symbol_length;
+} fapi_nr_pusch_time_domain_resource_allocation_t;
+
+typedef struct {
+ uint8_t group_hopping_enabled_transform_precoding;
+ fapi_nr_pusch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_UL_ALLOCATIONS];
+ uint8_t msg3_delta_preamble;
+ uint8_t p0_nominal_with_grant;
+} fapi_nr_pusch_config_common_t;
+
+typedef struct {
+ uint8_t pucch_resource_common;
+ uint8_t pucch_group_hopping;
+ uint8_t hopping_id;
+ uint8_t p0_nominal;
+} fapi_nr_pucch_config_common_t;
+
+typedef struct {
+
+ fapi_nr_pdcch_config_common_t pdcch_config_common;
+ fapi_nr_pdsch_config_common_t pdsch_config_common;
+
+} fapi_nr_dl_bwp_common_config_t;
+
+
+
+typedef struct {
+ uint16_t int_rnti;
+ uint8_t time_frequency_set;
+ uint8_t dci_payload_size;
+ uint8_t serving_cell_id[FAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell
+ uint8_t position_in_dci[FAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell
+} fapi_nr_downlink_preemption_t;
+
+typedef struct {
+ uint8_t tpc_index;
+ uint8_t tpc_index_sul;
+ uint8_t target_cell;
+} fapi_nr_pusch_tpc_command_config_t;
+
+typedef struct {
+ uint8_t tpc_index_pcell;
+ uint8_t tpc_index_pucch_scell;
+} fapi_nr_pucch_tpc_command_config_t;
+
+typedef struct {
+ uint8_t starting_bit_of_format_2_3;
+ uint8_t feild_type_format_2_3;
+} fapi_nr_srs_tpc_command_config_t;
+
+typedef struct {
+ fapi_nr_downlink_preemption_t downlink_preemption;
+ fapi_nr_pusch_tpc_command_config_t tpc_pusch;
+ fapi_nr_pucch_tpc_command_config_t tpc_pucch;
+ fapi_nr_srs_tpc_command_config_t tpc_srs;
+} fapi_nr_pdcch_config_dedicated_t;
+
+typedef struct {
+ uint8_t dmrs_type;
+ uint8_t dmrs_addition_position;
+ uint8_t max_length;
+ uint16_t scrambling_id0;
+ uint16_t scrambling_id1;
+ uint8_t ptrs_frequency_density[2]; // phase tracking rs
+ uint8_t ptrs_time_density[3]; // phase tracking rs
+ uint8_t ptrs_epre_ratio; // phase tracking rs
+ uint8_t ptrs_resource_element_offset; // phase tracking rs
+} fapi_nr_dmrs_downlink_config_t;
+
+typedef struct {
+ uint8_t bwp_or_cell_level;
+ uint8_t pattern_type;
+ uint32_t resource_blocks[9]; // bitmaps type 275 bits
+ uint8_t slot_type; // bitmaps type one/two slot(s)
+ uint32_t symbols_in_resouece_block; // bitmaps type 14/28 bits
+ uint8_t periodic; // bitmaps type
+ uint32_t pattern[2]; // bitmaps type 2/4/5/8/10/20/40 bits
+
+ fapi_nr_coreset_t coreset; // coreset
+
+ uint8_t subcarrier_spacing;
+ uint8_t mode;
+} fapi_nr_rate_matching_pattern_group_t;
+
+typedef struct {
+ // resource mapping
+ uint8_t row; // row1/row2/row4/other
+ uint16_t frequency_domain_allocation; // 4/12/3/6 bits
+ uint8_t number_of_ports;
+ uint8_t first_ofdm_symbol_in_time_domain;
+ uint8_t first_ofdm_symbol_in_time_domain2;
+ uint8_t cdm_type;
+ uint8_t density; // .5/1/3
+ uint8_t density_dot5_type; // even/odd PRBs
+
+ uint8_t frequency_band_starting_rb; // freqBand
+ uint8_t frequency_band_number_of_rb; // freqBand
+
+ // periodicityAndOffset
+ uint8_t periodicity; // slot4/5/8/10/16/20/32/40/64/80/160/320/640
+ uint32_t offset; // 0..639 bits
+} fapi_nr_zp_csi_rs_resource_t;
+
+typedef struct {
+ uint16_t data_scrambling_id_pdsch;
+ fapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_a;
+ fapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_b;
+ uint8_t vrb_to_prb_interleaver;
+ uint8_t resource_allocation;
+ fapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_DL_ALLOCATIONS];
+ uint8_t pdsch_aggregation_factor;
+ fapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group1;
+ fapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group2;
+ uint8_t rbg_size;
+ uint8_t mcs_table;
+ uint8_t max_num_of_code_word_scheduled_by_dci;
+ uint8_t bundle_size; // prb_bundling static
+ uint8_t bundle_size_set1; // prb_bundling dynamic
+ uint8_t bundle_size_set2; // prb_bundling dynamic
+ fapi_nr_zp_csi_rs_resource_t periodically_zp_csi_rs_resource_set[FAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET];
+} fapi_nr_pdsch_config_dedicated_t;
+
+typedef struct {
+ uint16_t starting_prb;
+ uint8_t intra_slot_frequency_hopping;
+ uint16_t second_hop_prb;
+ uint8_t format; // pucch format 0..4
+ uint8_t initial_cyclic_shift;
+ uint8_t number_of_symbols;
+ uint8_t starting_symbol_index;
+ uint8_t time_domain_occ;
+ uint8_t number_of_prbs;
+ uint8_t occ_length;
+ uint8_t occ_index;
+} fapi_nr_pucch_resource_t;
+
+typedef struct {
+ uint8_t periodicity;
+ uint8_t number_of_harq_process;
+ fapi_nr_pucch_resource_t n1_pucch_an;
+} fapi_nr_sps_config_t;
+
+typedef struct {
+ uint8_t beam_failure_instance_max_count;
+ uint8_t beam_failure_detection_timer;
+} fapi_nr_radio_link_monitoring_config_t;
+
+typedef struct {
+ fapi_nr_pdcch_config_dedicated_t pdcch_config_dedicated;
+ fapi_nr_pdsch_config_dedicated_t pdsch_config_dedicated;
+ fapi_nr_sps_config_t sps_config;
+ fapi_nr_radio_link_monitoring_config_t radio_link_monitoring_config;
+
+} fapi_nr_dl_bwp_dedicated_config_t;
+
+typedef struct {
+ fapi_nr_rach_config_common_t rach_config_common;
+ fapi_nr_pusch_config_common_t pusch_config_common;
+ fapi_nr_pucch_config_common_t pucch_config_common;
+
+} fapi_nr_ul_bwp_common_config_t;
+
+typedef struct {
+ uint8_t inter_slot_frequency_hopping;
+ uint8_t additional_dmrs;
+ uint8_t max_code_rate;
+ uint8_t number_of_slots;
+ uint8_t pi2bpsk;
+ uint8_t simultaneous_harq_ack_csi;
+} fapi_nr_pucch_format_config_t;
+
+typedef struct {
+ fapi_nr_pucch_format_config_t format1;
+ fapi_nr_pucch_format_config_t format2;
+ fapi_nr_pucch_format_config_t format3;
+ fapi_nr_pucch_format_config_t format4;
+ fapi_nr_pucch_resource_t multi_csi_pucch_resources[2];
+ uint8_t dl_data_to_ul_ack[8];
+ // pucch power control
+ uint8_t deltaF_pucch_f0;
+ uint8_t deltaF_pucch_f1;
+ uint8_t deltaF_pucch_f2;
+ uint8_t deltaF_pucch_f3;
+ uint8_t deltaF_pucch_f4;
+ uint8_t two_pucch_pc_adjusment_states;
+} fapi_nr_pucch_config_dedicated_t;
+
+typedef struct {
+ uint8_t dmrs_type;
+ uint8_t dmrs_addition_position;
+ uint8_t ptrs_uplink_config; // to indicate if PTRS Uplink is configured of not
+ uint8_t ptrs_type; //cp-OFDM, dft-S-OFDM
+ uint16_t ptrs_frequency_density[2];
+ uint8_t ptrs_time_density[3];
+ uint8_t ptrs_max_number_of_ports;
+ uint8_t ptrs_resource_element_offset;
+ uint8_t ptrs_power;
+ uint16_t ptrs_sample_density[5];
+ uint8_t ptrs_time_density_transform_precoding;
+
+ uint8_t max_length;
+ uint16_t scrambling_id0;
+ uint16_t scrambling_id1;
+ uint8_t npusch_identity;
+ uint8_t disable_sequence_group_hopping;
+ uint8_t sequence_hopping_enable;
+} fapi_nr_dmrs_uplink_config_t;
+
+typedef struct {
+ uint8_t tpc_accmulation;
+ uint8_t msg3_alpha;
+ uint8_t p0_nominal_with_grant;
+ uint8_t two_pusch_pc_adjustments_states;
+ uint8_t delta_mcs;
+} fapi_nr_pusch_power_control_t;
+
+typedef enum {tx_config_codebook = 1, tx_config_nonCodebook = 2} tx_config_t;
+typedef enum {transform_precoder_enabled = 0, transform_precoder_disabled = 1} transform_precoder_t;
+typedef enum {
+ codebook_subset_fullyAndPartialAndNonCoherent = 1,
+ codebook_subset_partialAndNonCoherent = 2,
+ codebook_subset_nonCoherent = 3} codebook_subset_t;
+typedef struct {
+ uint16_t data_scrambling_identity;
+ tx_config_t tx_config;
+ fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_a;
+ fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_b;
+ fapi_nr_pusch_power_control_t pusch_power_control;
+ uint8_t frequency_hopping;
+ uint16_t frequency_hopping_offset_lists[4];
+ uint8_t resource_allocation;
+ fapi_nr_pusch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_UL_ALLOCATIONS];
+ uint8_t pusch_aggregation_factor;
+ uint8_t mcs_table;
+ uint8_t mcs_table_transform_precoder;
+ transform_precoder_t transform_precoder;
+ codebook_subset_t codebook_subset;
+ uint8_t max_rank;
+ uint8_t rbg_size;
+
+ //uci-OnPUSCH
+ uint8_t uci_on_pusch_type; //dynamic, semi-static
+ uint8_t beta_offset_ack_index1[4];
+ uint8_t beta_offset_ack_index2[4];
+ uint8_t beta_offset_ack_index3[4];
+ uint8_t beta_offset_csi_part1_index1[4];
+ uint8_t beta_offset_csi_part1_index2[4];
+ uint8_t beta_offset_csi_part2_index1[4];
+ uint8_t beta_offset_csi_part2_index2[4];
+
+ uint8_t tp_pi2BPSK;
+} fapi_nr_pusch_config_dedicated_t;
+
+typedef struct {
+ uint8_t frequency_hopping;
+ fapi_nr_dmrs_uplink_config_t cg_dmrs_configuration;
+ uint8_t mcs_table;
+ uint8_t mcs_table_transform_precoder;
+
+ //uci-OnPUSCH
+ uint8_t uci_on_pusch_type; //dynamic, semi-static
+ uint8_t beta_offset_ack_index1[4];
+ uint8_t beta_offset_ack_index2[4];
+ uint8_t beta_offset_ack_index3[4];
+ uint8_t beta_offset_csi_part1_index1[4];
+ uint8_t beta_offset_csi_part1_index2[4];
+ uint8_t beta_offset_csi_part2_index1[4];
+ uint8_t beta_offset_csi_part2_index2[4];
+
+ uint8_t resource_allocation;
+ // rgb-Size structure missing in spec.
+ uint8_t power_control_loop_to_use;
+ // p0-PUSCH-Alpha
+ uint8_t p0;
+ uint8_t alpha;
+
+ uint8_t transform_precoder;
+ uint8_t number_of_harq_process;
+ uint8_t rep_k;
+ uint8_t rep_k_rv;
+ uint8_t periodicity;
+ uint8_t configured_grant_timer;
+ // rrc-ConfiguredUplinkGrant
+ uint16_t time_domain_offset;
+ uint8_t time_domain_allocation;
+ uint32_t frequency_domain_allocation;
+ uint8_t antenna_ports;
+ uint8_t dmrs_seq_initialization;
+ uint8_t precoding_and_number_of_layers;
+ uint8_t srs_resource_indicator;
+ uint8_t mcs_and_tbs;
+ uint8_t frequency_hopping_offset;
+ uint8_t path_loss_reference_index;
+
+} fapi_nr_configured_grant_config_t;
+
+typedef struct {
+ uint8_t qcl_type1_serving_cell_index;
+ uint8_t qcl_type1_bwp_id;
+ uint8_t qcl_type1_rs_type; // csi-rs or ssb
+ uint8_t qcl_type1_nzp_csi_rs_resource_id;
+ uint8_t qcl_type1_ssb_index;
+ uint8_t qcl_type1_type;
+
+ uint8_t qcl_type2_serving_cell_index;
+ uint8_t qcl_type2_bwp_id;
+ uint8_t qcl_type2_rs_type; // csi-rs or ssb
+ uint8_t qcl_type2_nzp_csi_rs_resource_id;
+ uint8_t qcl_type2_ssb_index;
+ uint8_t qcl_type2_type;
+
+} fapi_nr_tci_state_t;
+
+typedef struct {
+ uint8_t root_sequence_index;
+ // rach genertic
+ uint8_t prach_configuration_index;
+ uint8_t msg1_fdm;
+ uint8_t msg1_frequency_start;
+ uint8_t zero_correlation_zone_config;
+ uint8_t preamble_received_target_power;
+ uint8_t preamble_transmission_max;
+ uint8_t power_ramping_step;
+ uint8_t ra_window_size;
+
+ uint8_t rsrp_threshold_ssb;
+ // PRACH-ResourceDedicatedBFR
+ uint8_t bfr_ssb_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
+ uint8_t bfr_ssb_ra_preamble_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
+ // NZP-CSI-RS-Resource
+ uint8_t bfr_csi_rs_nzp_resource_mapping[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
+ uint8_t bfr_csi_rs_power_control_offset[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
+ uint8_t bfr_csi_rs_power_control_offset_ss[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
+ uint16_t bfr_csi_rs_scrambling_id[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
+ uint8_t bfr_csi_rs_resource_periodicity[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
+ uint16_t bfr_csi_rs_resource_offset[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
+ fapi_nr_tci_state_t qcl_infomation_periodic_csi_rs[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
+
+ uint8_t bfr_csirs_ra_occasions[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS];
+ uint8_t bfr_csirs_ra_preamble_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS][FAPI_NR_MAX_RA_OCCASION_PER_CSIRS];
+
+ uint8_t ssb_per_rach_occasion;
+ uint8_t ra_ssb_occasion_mask_index;
+ fapi_nr_search_space_t recovery_search_space;
+ // RA-Prioritization
+ uint8_t power_ramping_step_high_priority;
+ uint8_t scaling_factor_bi;
+ uint8_t beam_failure_recovery_timer;
+} fapi_nr_beam_failure_recovery_config_t;
+
+typedef struct {
+ fapi_nr_pucch_config_dedicated_t pucch_config_dedicated;
+ fapi_nr_pusch_config_dedicated_t pusch_config_dedicated;
+ fapi_nr_configured_grant_config_t configured_grant_config;
+ // SRS-Config
+ uint8_t srs_tpc_accumulation;
+ fapi_nr_beam_failure_recovery_config_t beam_failure_recovery_config;
+
+} fapi_nr_ul_bwp_dedicated_config_t;
+
#define FAPI_NR_CONFIG_REQUEST_MASK_PBCH 0x01
#define FAPI_NR_CONFIG_REQUEST_MASK_DL_BWP_COMMON 0x02
#define FAPI_NR_CONFIG_REQUEST_MASK_UL_BWP_COMMON 0x04
diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
index ea459138e1..e1cfc26336 100644
--- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
+++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
@@ -27,6 +27,8 @@
#define NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH 3
#define NFAPI_MAX_NUM_RF_BANDS 16
+#define NFAPI_MAX_PACKED_MESSAGE_SIZE 8192
+
// The following definition control the size of arrays used in the interface.
// These may be changed if desired. They are used in the encoder to make sure
// that the user has not specified a 'count' larger than the max array, and also
@@ -122,12 +124,13 @@ typedef struct {
// Convenience methods to convert between SFN/SLOT formats
#define NFAPI_SFNSLOT2DEC(_sfn,_slot) ( _sfn*20 + _slot ) // total count of slots
-#define NFAPI_SFNSLOTDEC2SFNSLOT(_sfnslot_dec) ((((_sfnslot_dec) / 20) << 4) | (((_sfnslot_dec) - (((_sfnslot_dec) / 20) * 10)) & 0x3F))
+#define NFAPI_SFNSLOTDEC2SFNSLOT(_sfnslot_dec) ((((_sfnslot_dec) / 20) << 6) | (((_sfnslot_dec) - (((_sfnslot_dec) / 20) * 20)) & 0x3F))
#define NFAPI_SFNSLOT2SFN(_sfnslot) ((_sfnslot) >> 6)
#define NFAPI_SFNSLOT2SLOT(_sfnslot) ((_sfnslot) & 0x3F)
#define NFAPI_SFNSLOTDEC2SFN(_sfnslot_dec) ((_sfnslot_dec) / 20)
#define NFAPI_SFNSLOTDEC2SLOT(_sfnslot_dec) ((_sfnslot_dec) % 20)
+#define NFAPI_SFNSLOT2HEX(_sfn,_slot) ((_sfn << 6) | (_slot & 0x3F))
#define NFAPI_MAX_SFNSLOTDEC 1024*20 // 20 is for numerology 1
@@ -706,7 +709,6 @@ typedef struct {
#define NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG 0x0015
#define NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG 0x0016
-
typedef struct {
nfapi_uint16_tlv_t primary_synchronization_signal_epre_eprers;
nfapi_uint16_tlv_t secondary_synchronization_signal_epre_eprers;
@@ -2497,7 +2499,7 @@ typedef struct {
typedef struct {
nfapi_p7_message_header_t header;
uint32_t t1;
- int32_t delta_sfn_sf;
+ int32_t delta_sfn_sf;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_dl_node_sync_t;
@@ -2872,11 +2874,12 @@ typedef struct {
} nfapi_rx_indication_rel9_t;
#define NFAPI_RX_INDICATION_REL9_TAG 0x2025
+#define NFAPI_RX_IND_DATA_MAX 8192
typedef struct {
nfapi_rx_ue_information rx_ue_information;
nfapi_rx_indication_rel8_t rx_indication_rel8;
nfapi_rx_indication_rel9_t rx_indication_rel9;
- uint8_t* data;
+ uint8_t rx_ind_data[NFAPI_RX_IND_DATA_MAX];
} nfapi_rx_indication_pdu_t;
#define NFAPI_RX_IND_MAX_PDU 100
diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
index 9d245446c8..c124ad9fb9 100644
--- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
+++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
@@ -984,6 +984,8 @@ typedef struct {
/// A value indicating how the BCH payload is generated. This should match the PARAM/CONFIG TLVs. Value: 0: MAC generates the full PBCH payload, see Table 3-41, where bchPayload has 31 bits 1: PHY generates the timing PBCH bits, see Table 3-41, where the bchPayload has 24 bits 2: PHY generates the full PBCH payload
uint8_t bchPayloadFlag;
uint32_t bchPayload;
+ /// A value indicating the channel quality between the gNB and nrUE. Value: 0->255 dBM
+ uint8_t ssbRsrp;
nfapi_nr_tx_precoding_and_beamforming_t precoding_and_beamforming;
} nfapi_nr_dl_tti_ssb_pdu_rel15_t;
@@ -1476,7 +1478,7 @@ typedef enum {
//section 3.4.7 rx_data_indication
//table 3-61
-
+#define NFAPI_NR_RX_DATA_IND_MAX_PDU 100
typedef struct
{
uint32_t handle;
@@ -1497,12 +1499,13 @@ typedef struct
uint16_t sfn;
uint16_t slot;
uint16_t number_of_pdus;
- nfapi_nr_rx_data_pdu_t *pdu_list;
+ nfapi_nr_rx_data_pdu_t *pdu_list;
} nfapi_nr_rx_data_indication_t;
//3.4.8 crc_indication
//table 3-62
+#define NFAPI_NR_CRC_IND_MAX_PDU 100
typedef struct
{
uint32_t handle;
@@ -1642,6 +1645,7 @@ typedef enum {
NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE = 2,
} nfapi_nr_uci_pdu_type_e;
+#define NFAPI_NR_UCI_IND_MAX_PDU 100
typedef struct
{
uint16_t pdu_type; // 0 for PDU on PUSCH, 1 for PUCCH format 0 or 1, 2 for PUCCH format 2 to 4
@@ -1678,7 +1682,7 @@ typedef struct
nfapi_nr_srs_indication_reported_symbol_resource_block_t* rb_list;
}nfapi_nr_srs_indication_reported_symbol_t;
-
+#define NFAPI_NR_SRS_IND_MAX_PDU 100
typedef struct
{
uint32_t handle;
diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi.c b/nfapi/open-nFAPI/nfapi/src/nfapi.c
index 63dd8a16ae..2783781e2c 100644
--- a/nfapi/open-nFAPI/nfapi/src/nfapi.c
+++ b/nfapi/open-nFAPI/nfapi/src/nfapi.c
@@ -1,783 +1,783 @@
-/*
- * Copyright (c) 2001-2016, Cisco Systems, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * Neither the name of the Cisco Systems, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-
-// Fundamental routines
-
-uint8_t push8(uint8_t in, uint8_t **out, uint8_t *end) {
- uint8_t *pOut = *out;
-
- if((end - pOut) >= 1) {
- pOut[0] = in;
- (*out)+=1;
- return 1;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t pushs8(int8_t in, uint8_t **out, uint8_t *end) {
- uint8_t *pOut = *out;
-
- if((end - pOut) >= 1) {
- pOut[0] = in;
- (*out)+=1;
- return 1;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t push16(uint16_t in, uint8_t **out, uint8_t *end) {
- uint8_t *pOut = *out;
-
- if((end - pOut) >= 2) {
- pOut[0] = (in & 0xFF00) >> 8;
- pOut[1] = (in & 0xFF);
- (*out)+=2;
- return 2;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t pushs16(int16_t in, uint8_t **out, uint8_t *end) {
- uint8_t *pOut = *out;
-
- if((end - pOut) >= 2) {
- pOut[0] = (in & 0xFF00) >> 8;
- pOut[1] = (in & 0xFF);
- (*out)+=2;
- return 2;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t push32(uint32_t in, uint8_t **out, uint8_t *end) {
- uint8_t *pOut = *out;
-
- if((end - pOut) >= 4) {
- pOut[0] = (in & 0xFF000000) >> 24;
- pOut[1] = (in & 0xFF0000) >> 16;
- pOut[2] = (in & 0xFF00) >> 8;
- pOut[3] = (in & 0xFF);
- (*out)+=4;
- return 4;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t pushs32(int32_t in, uint8_t **out, uint8_t *end) {
- uint8_t *pOut = *out;
-
- if((end - pOut) >= 4) {
- pOut[0] = (in & 0xFF000000) >> 24;
- pOut[1] = (in & 0xFF0000) >> 16;
- pOut[2] = (in & 0xFF00) >> 8;
- pOut[3] = (in & 0xFF);
- (*out)+=4;
- return 4;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t pull8(uint8_t **in, uint8_t *out, uint8_t *end) {
- uint8_t *pIn = *in;
-
- if((end - pIn) >= 1 ) {
- *out = *pIn;
- (*in)+=1;
- return 1;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t pulls8(uint8_t **in, int8_t *out, uint8_t *end) {
- uint8_t *pIn = *in;
-
- if((end - pIn) >= 1 ) {
- *out = *pIn;
- (*in)+=1;
- return 1;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t pull16(uint8_t **in, uint16_t *out, uint8_t *end) {
- uint8_t *pIn = *in;
-
- if((end - pIn) >=2 ) {
- *out = ((pIn[0]) << 8) | pIn[1];
- (*in)+=2;
- return 2;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t pulls16(uint8_t **in, int16_t *out, uint8_t *end) {
- uint8_t *pIn = *in;
-
- if((end - pIn) >=2 ) {
- *out = ((pIn[0]) << 8) | pIn[1];
- (*in)+=2;
- return 2;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t pull32(uint8_t **in, uint32_t *out, uint8_t *end) {
- uint8_t *pIn = *in;
-
- if((end - pIn) >=4 ) {
- *out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
- (*in)+=4;
- return 4;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t pulls32(uint8_t **in, int32_t *out, uint8_t *end) {
- uint8_t *pIn = *in;
-
- if((end - pIn) >=4 ) {
- *out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
- (*in)+=4;
- return 4;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-/*
-inline void pusharray16(uint8_t **, uint16_t, uint32_t len)
-{
-}
-*/
-
-uint32_t pullarray16(uint8_t **in, uint16_t out[], uint32_t max_len, uint32_t len, uint8_t *end) {
- if(len == 0)
- return 1;
-
- if(len > max_len) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
- return 0;
- }
-
- if((end - (*in)) >= sizeof(uint16_t) * len) {
- uint32_t idx;
-
- for(idx = 0; idx < len; ++idx) {
- if(!pull16(in, &out[idx], end))
- return 0;
- }
-
- return sizeof(uint16_t) * len;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint32_t pullarrays16(uint8_t **in, int16_t out[], uint32_t max_len, uint32_t len, uint8_t *end) {
- if(len == 0)
- return 1;
-
- if(len > max_len) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
- return 0;
- }
-
- if((end - (*in)) >= sizeof(uint16_t) * len) {
- uint32_t idx;
-
- for(idx = 0; idx < len; ++idx) {
- if(!pulls16(in, &out[idx], end))
- return 0;
- }
-
- return sizeof(uint16_t) * len;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-uint32_t pusharray16(uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) {
- if(len == 0)
- return 1;
-
- if(len > max_len) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
- return 0;
- }
-
- if((end - (*out)) >= sizeof(uint16_t) * len) {
- uint32_t idx;
-
- for(idx = 0; idx < len; ++idx) {
- if(!push16(in[idx], out, end))
- return 0;
- }
-
- return sizeof(uint16_t) * len;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) {
- if(len == 0)
- return 1;
-
- if(len > max_len) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
- return 0;
- }
-
- if((end - (*out)) >= sizeof(uint16_t) * len) {
- uint32_t idx;
-
- for(idx = 0; idx < len; ++idx) {
- pushs16(in[idx], out, end);
- }
-
- return sizeof(uint16_t) * len;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-uint32_t pullarray32(uint8_t **in, uint32_t out[], uint32_t max_len, uint32_t len, uint8_t *end) {
- if(len == 0)
- return 1;
-
- if(len > max_len) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
- return 0;
- }
-
- if((end - (*in)) >= sizeof(uint32_t) * len) {
- uint32_t idx;
-
- for(idx = 0; idx < len; ++idx) {
- if(!pull32(in, &out[idx], end))
- return 0;
- }
-
- return sizeof(uint32_t) * len;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint32_t pullarrays32(uint8_t **in, int32_t out[], uint32_t max_len, uint32_t len, uint8_t *end) {
- if(len == 0)
- return 1;
-
- if(len > max_len) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
- return 0;
- }
-
- if((end - (*in)) >= sizeof(uint32_t) * len) {
- uint32_t idx;
-
- for(idx = 0; idx < len; ++idx) {
- if(!pulls32(in, &out[idx], end))
- return 0;
- }
-
- return sizeof(uint32_t) * len;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) {
- if(len == 0)
- return 1;
-
- if(len > max_len) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
- return 0;
- }
-
- if((end - (*out)) >= sizeof(uint32_t) * len) {
- uint32_t idx;
-
- for(idx = 0; idx < len; ++idx) {
- if(!push32(in[idx], out, end))
- return 0;
- }
-
- return sizeof(uint32_t) * len;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-uint32_t pusharrays32(int32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) {
- if(len == 0)
- return 1;
-
- if(len > max_len) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
- return 0;
- }
-
- if((end - (*out)) >= sizeof(uint32_t) * len) {
- uint32_t idx;
-
- for(idx = 0; idx < len; ++idx) {
- pushs32(in[idx], out, end);
- }
-
- return sizeof(uint32_t) * len;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-uint32_t pullarray8(uint8_t **in, uint8_t out[], uint32_t max_len, uint32_t len, uint8_t *end) {
- if(len == 0)
- return 1;
-
- if(len > max_len) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
- return 0;
- }
-
- if((end - (*in)) >= sizeof(uint8_t) * len) {
- memcpy(out, (*in), len);
- (*in)+=len;
- return sizeof(uint8_t) * len;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint32_t pusharray8(uint8_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) {
- if(len == 0)
- return 1;
-
- if(len > max_len) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
- return 0;
- }
-
- if((end - (*out)) >= sizeof(uint8_t) * len) {
- memcpy((*out), in, len);
- (*out)+=len;
- return sizeof(uint8_t) * len;
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
- return 0;
- }
-}
-
-uint8_t packarray(void *array, uint16_t array_element_size, uint16_t max_count, uint16_t count, uint8_t **ppwritepackedmsg, uint8_t *end, pack_array_elem_fn fn) {
- if(count > max_count) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, count, max_count);
- return 0;
- }
-
- uint16_t i = 0;
-
- for(i = 0; i < count; ++i) {
- if((fn)(array, ppwritepackedmsg, end) == 0)
- return 0;
-
- array += array_element_size;
- }
-
- return 1;
-}
-
-uint8_t unpackarray(uint8_t **ppReadPackedMsg, void *array, uint16_t array_element_size, uint16_t max_count, uint16_t count, uint8_t *end, unpack_array_elem_fn fn) {
- if(count > max_count) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, count, max_count);
- return 0;
- }
-
- uint16_t i = 0;
-
- for(i = 0; i < count; ++i) {
- if((fn)(array, ppReadPackedMsg, end) == 0)
- return 0;
-
- array += array_element_size;
- }
-
- return 1;
-}
-
-
-uint32_t pack_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) {
- if(ve != 0 && config != 0) {
- if(config->pack_vendor_extension_tlv) {
- uint8_t *pStartOfTlv = *ppWritePackedMsg;
-
- if(pack_tl(ve, ppWritePackedMsg, end) == 0)
- return 0;
-
- uint8_t *pStartOfValue = *ppWritePackedMsg;
-
- if((config->pack_vendor_extension_tlv)(ve, ppWritePackedMsg, end, config) == 0)
- return 0;
-
- ve->length = (*ppWritePackedMsg) - pStartOfValue;
- pack_tl(ve, &pStartOfTlv, end);
- return 1;
- }
- }
-
- return 1;
-}
-
-uint32_t unpack_vendor_extension_tlv(nfapi_tl_t *tl, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config, nfapi_tl_t **ve_tlv) {
- if(ve_tlv != 0 && config != 0) {
- if(config->unpack_vendor_extension_tlv) {
- return (config->unpack_vendor_extension_tlv)(tl, ppReadPackedMsg, end, (void **)ve_tlv, config);
- }
- }
-
- return 1;
-}
-
-uint32_t pack_p7_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end,nfapi_p7_codec_config_t *config) {
- if(ve != 0 && config != 0) {
- if(config->pack_vendor_extension_tlv) {
- uint8_t *pStartOfTlv = *ppWritePackedMsg;
-
- if(pack_tl(ve, ppWritePackedMsg, end) == 0)
- return 0;
-
- uint8_t *pStartOfValue = *ppWritePackedMsg;
-
- if((config->pack_vendor_extension_tlv)(ve, ppWritePackedMsg, end, config) == 0)
- return 0;
-
- ve->length = (*ppWritePackedMsg) - pStartOfValue;
- pack_tl(ve, &pStartOfTlv, end);
- return 1;
- }
- }
-
- return 1;
-}
-
-int unpack_p7_vendor_extension_tlv(nfapi_tl_t *tl, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config, nfapi_tl_t **ve_tlv) {
- if(ve_tlv != 0 && config != 0) {
- if(config->unpack_vendor_extension_tlv) {
- return (config->unpack_vendor_extension_tlv)(tl, ppReadPackedMsg, end, (void **)ve_tlv, config);
- }
- }
-
- return 1;
-}
-
-
-uint8_t pack_tl(nfapi_tl_t *tl, uint8_t **ppWritePackedMsg, uint8_t *end) {
- return (push16(tl->tag, ppWritePackedMsg, end) &&
- push16(tl->length, ppWritePackedMsg, end));
-}
-
-uint8_t unpack_tl(uint8_t **ppReadPackedMsg, nfapi_tl_t *tl, uint8_t *end) {
- return (pull16(ppReadPackedMsg, &tl->tag, end) &&
- pull16(ppReadPackedMsg, &tl->length, end));
-}
-
-int unpack_tlv_list(unpack_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config, nfapi_tl_t **ve) {
- nfapi_tl_t generic_tl;
- uint8_t numBadTags = 0;
- uint16_t idx = 0;
-
- while ((uint8_t *)(*ppReadPackedMsg) < end) {
- // unpack the tl and process the values accordingly
- if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
- return 0;
-
- uint8_t tagMatch = 0;
- uint8_t *pStartOfValue = *ppReadPackedMsg;
-
- for(idx = 0; idx < size; ++idx) {
- if(unpack_fns[idx].tag == generic_tl.tag) { // match the extracted tag value with all the tags in unpack_fn list
- tagMatch = 1;
- nfapi_tl_t *tl = (nfapi_tl_t *)(unpack_fns[idx].tlv);
- tl->tag = generic_tl.tag;
- tl->length = generic_tl.length;
- int result = (*unpack_fns[idx].unpack_func)(tl, ppReadPackedMsg, end);
-
- if(result == 0) {
- return 0;
- }
-
- // check if the length was right;
- if(tl->length != (*ppReadPackedMsg - pStartOfValue)) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning tlv tag 0x%x length %d not equal to unpack %d\n", tl->tag, tl->length, (*ppReadPackedMsg - pStartOfValue));
- }
- }
- }
-
- if(tagMatch == 0) {
- if(generic_tl.tag >= NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE &&
- generic_tl.tag <= NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE) {
- int result = unpack_vendor_extension_tlv(&generic_tl, ppReadPackedMsg, end, config, ve);
-
- if(result == 0) {
- // got tot the end.
- return 0;
- } else if(result < 0) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown VE TAG value: 0x%04x\n", generic_tl.tag);
-
- if (++numBadTags > MAX_BAD_TAG) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
- return 0;
- }
-
- if((end - *ppReadPackedMsg) >= generic_tl.length) {
- // Advance past the unknown TLV
- (*ppReadPackedMsg) += generic_tl.length;
- } else {
- // go to the end
- return 0;
- }
- }
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag);
-
- if (++numBadTags > MAX_BAD_TAG) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
- return 0;
- }
-
- if((end - *ppReadPackedMsg) >= generic_tl.length) {
- // Advance past the unknown TLV
- (*ppReadPackedMsg) += generic_tl.length;
- } else {
- // go to the end
- return 0;
- }
- }
- }
- }
-
- return 1;
-}
-int unpack_p7_tlv_list(unpack_p7_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config, nfapi_tl_t **ve) {
- nfapi_tl_t generic_tl;
- uint8_t numBadTags = 0;
- uint16_t idx = 0;
-
- while ((uint8_t *)(*ppReadPackedMsg) < end) {
- // unpack the tl and process the values accordingly
- if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
- return 0;
-
- uint8_t tagMatch = 0;
- uint8_t *pStartOfValue = *ppReadPackedMsg;
-
- for(idx = 0; idx < size; ++idx) {
- if(unpack_fns[idx].tag == generic_tl.tag) {
- tagMatch = 1;
- nfapi_tl_t *tl = (nfapi_tl_t *)(unpack_fns[idx].tlv);
- tl->tag = generic_tl.tag;
- tl->length = generic_tl.length;
- int result = (*unpack_fns[idx].unpack_func)(tl, ppReadPackedMsg, end, config);
-
- if(result == 0) {
- return 0;
- }
-
- // check if the length was right;
- if(tl->length != (*ppReadPackedMsg - pStartOfValue)) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning tlv tag 0x%x length %d not equal to unpack %d\n", tl->tag, tl->length, (*ppReadPackedMsg - pStartOfValue));
- }
- }
- }
-
- if(tagMatch == 0) {
- if(generic_tl.tag >= NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE &&
- generic_tl.tag <= NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE) {
- int result = unpack_p7_vendor_extension_tlv(&generic_tl, ppReadPackedMsg, end, config, ve);
-
- if(result == 0) {
- // got to end
- return 0;
- } else if(result < 0) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag);
-
- if (++numBadTags > MAX_BAD_TAG) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
- return -1;
- }
-
- if((end - *ppReadPackedMsg) >= generic_tl.length) {
- // Advance past the unknown TLV
- (*ppReadPackedMsg) += generic_tl.length;
- } else {
- // got ot the dn
- return 0;
- }
- }
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag);
-
- if (++numBadTags > MAX_BAD_TAG) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
- return -1;
- }
-
- if((end - *ppReadPackedMsg) >= generic_tl.length) {
- // Advance past the unknown TLV
- (*ppReadPackedMsg) += generic_tl.length;
- } else {
- // got ot the dn
- return 0;
- }
- }
- }
- }
-
- return 1;
-}
-
-// This intermediate function deals with calculating the length of the value
-// and writing into the tlv header.
-uint8_t pack_tlv(uint16_t tag, void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end, pack_tlv_fn fn) {
- nfapi_tl_t *tl = (nfapi_tl_t *)tlv;
-
- // If the tag is defined
- if(tl->tag == tag) {
- uint8_t *pStartOfTlv = *ppWritePackedMsg;
-
- // write a dumy tlv header
- if(pack_tl(tl, ppWritePackedMsg, end) == 0)
- return 0;
-
- // Record the start of the value
- uint8_t *pStartOfValue = *ppWritePackedMsg;
-
- // pack the tlv value
- if(fn(tlv, ppWritePackedMsg, end) == 0)
- return 0;
-
- // calculate the length of the value and rewrite the tl header
- tl->length = (*ppWritePackedMsg) - pStartOfValue;
- // rewrite the header with the correct length
- pack_tl(tl, &pStartOfTlv, end);
- } else {
- if(tl->tag != 0) {
- NFAPI_TRACE(NFAPI_TRACE_WARN, "Warning pack_tlv tag 0x%x does not match expected 0x%x\n", tl->tag, tag);
- } else {
- //NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning pack_tlv tag 0x%x ZERO does not match expected 0x%x\n", tl->tag, tag);
- }
- }
-
- return 1;
-}
-
-const char *nfapi_error_code_to_str(nfapi_error_code_e value) {
- switch(value) {
- case NFAPI_MSG_OK:
- return "NFAPI_MSG_OK";
-
- case NFAPI_MSG_INVALID_STATE:
- return "NFAPI_MSG_INVALID_STATE";
-
- case NFAPI_MSG_INVALID_CONFIG:
- return "NFAPI_MSG_INVALID_CONFIG";
-
- case NFAPI_SFN_OUT_OF_SYNC:
- return "NFAPI_SFN_OUT_OF_SYNC";
-
- case NFAPI_MSG_SUBFRAME_ERR:
- return "NFAPI_MSG_SUBFRAME_ERR";
-
- case NFAPI_MSG_BCH_MISSING:
- return "NFAPI_MSG_BCH_MISSING";
-
- case NFAPI_MSG_INVALID_SFN:
- return "NFAPI_MSG_INVALID_SFN";
-
- case NFAPI_MSG_HI_ERR:
- return "NFAPI_MSG_HI_ERR";
-
- case NFAPI_MSG_TX_ERR:
- return "NFAPI_MSG_TX_ERR";
-
- default:
- return "UNKNOWN";
- }
-}
+/*
+ * Copyright (c) 2001-2016, Cisco Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * Neither the name of the Cisco Systems, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+
+// Fundamental routines
+
+uint8_t push8(uint8_t in, uint8_t **out, uint8_t *end) {
+ uint8_t *pOut = *out;
+
+ if((end - pOut) >= 1) {
+ pOut[0] = in;
+ (*out)+=1;
+ return 1;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t pushs8(int8_t in, uint8_t **out, uint8_t *end) {
+ uint8_t *pOut = *out;
+
+ if((end - pOut) >= 1) {
+ pOut[0] = in;
+ (*out)+=1;
+ return 1;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t push16(uint16_t in, uint8_t **out, uint8_t *end) {
+ uint8_t *pOut = *out;
+
+ if((end - pOut) >= 2) {
+ pOut[0] = (in & 0xFF00) >> 8;
+ pOut[1] = (in & 0xFF);
+ (*out)+=2;
+ return 2;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t pushs16(int16_t in, uint8_t **out, uint8_t *end) {
+ uint8_t *pOut = *out;
+
+ if((end - pOut) >= 2) {
+ pOut[0] = (in & 0xFF00) >> 8;
+ pOut[1] = (in & 0xFF);
+ (*out)+=2;
+ return 2;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t push32(uint32_t in, uint8_t **out, uint8_t *end) {
+ uint8_t *pOut = *out;
+
+ if((end - pOut) >= 4) {
+ pOut[0] = (in & 0xFF000000) >> 24;
+ pOut[1] = (in & 0xFF0000) >> 16;
+ pOut[2] = (in & 0xFF00) >> 8;
+ pOut[3] = (in & 0xFF);
+ (*out)+=4;
+ return 4;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t pushs32(int32_t in, uint8_t **out, uint8_t *end) {
+ uint8_t *pOut = *out;
+
+ if((end - pOut) >= 4) {
+ pOut[0] = (in & 0xFF000000) >> 24;
+ pOut[1] = (in & 0xFF0000) >> 16;
+ pOut[2] = (in & 0xFF00) >> 8;
+ pOut[3] = (in & 0xFF);
+ (*out)+=4;
+ return 4;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t pull8(uint8_t **in, uint8_t *out, uint8_t *end) {
+ uint8_t *pIn = *in;
+
+ if((end - pIn) >= 1 ) {
+ *out = *pIn;
+ (*in)+=1;
+ return 1;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t pulls8(uint8_t **in, int8_t *out, uint8_t *end) {
+ uint8_t *pIn = *in;
+
+ if((end - pIn) >= 1 ) {
+ *out = *pIn;
+ (*in)+=1;
+ return 1;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t pull16(uint8_t **in, uint16_t *out, uint8_t *end) {
+ uint8_t *pIn = *in;
+
+ if((end - pIn) >=2 ) {
+ *out = ((pIn[0]) << 8) | pIn[1];
+ (*in)+=2;
+ return 2;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t pulls16(uint8_t **in, int16_t *out, uint8_t *end) {
+ uint8_t *pIn = *in;
+
+ if((end - pIn) >=2 ) {
+ *out = ((pIn[0]) << 8) | pIn[1];
+ (*in)+=2;
+ return 2;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t pull32(uint8_t **in, uint32_t *out, uint8_t *end) {
+ uint8_t *pIn = *in;
+
+ if((end - pIn) >=4 ) {
+ *out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
+ (*in)+=4;
+ return 4;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t pulls32(uint8_t **in, int32_t *out, uint8_t *end) {
+ uint8_t *pIn = *in;
+
+ if((end - pIn) >=4 ) {
+ *out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
+ (*in)+=4;
+ return 4;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+/*
+inline void pusharray16(uint8_t **, uint16_t, uint32_t len)
+{
+}
+*/
+
+uint32_t pullarray16(uint8_t **in, uint16_t out[], uint32_t max_len, uint32_t len, uint8_t *end) {
+ if(len == 0)
+ return 1;
+
+ if(len > max_len) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+ return 0;
+ }
+
+ if((end - (*in)) >= sizeof(uint16_t) * len) {
+ uint32_t idx;
+
+ for(idx = 0; idx < len; ++idx) {
+ if(!pull16(in, &out[idx], end))
+ return 0;
+ }
+
+ return sizeof(uint16_t) * len;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint32_t pullarrays16(uint8_t **in, int16_t out[], uint32_t max_len, uint32_t len, uint8_t *end) {
+ if(len == 0)
+ return 1;
+
+ if(len > max_len) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+ return 0;
+ }
+
+ if((end - (*in)) >= sizeof(uint16_t) * len) {
+ uint32_t idx;
+
+ for(idx = 0; idx < len; ++idx) {
+ if(!pulls16(in, &out[idx], end))
+ return 0;
+ }
+
+ return sizeof(uint16_t) * len;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+uint32_t pusharray16(uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) {
+ if(len == 0)
+ return 1;
+
+ if(len > max_len) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+ return 0;
+ }
+
+ if((end - (*out)) >= sizeof(uint16_t) * len) {
+ uint32_t idx;
+
+ for(idx = 0; idx < len; ++idx) {
+ if(!push16(in[idx], out, end))
+ return 0;
+ }
+
+ return sizeof(uint16_t) * len;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) {
+ if(len == 0)
+ return 1;
+
+ if(len > max_len) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+ return 0;
+ }
+
+ if((end - (*out)) >= sizeof(uint16_t) * len) {
+ uint32_t idx;
+
+ for(idx = 0; idx < len; ++idx) {
+ pushs16(in[idx], out, end);
+ }
+
+ return sizeof(uint16_t) * len;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+uint32_t pullarray32(uint8_t **in, uint32_t out[], uint32_t max_len, uint32_t len, uint8_t *end) {
+ if(len == 0)
+ return 1;
+
+ if(len > max_len) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+ return 0;
+ }
+
+ if((end - (*in)) >= sizeof(uint32_t) * len) {
+ uint32_t idx;
+
+ for(idx = 0; idx < len; ++idx) {
+ if(!pull32(in, &out[idx], end))
+ return 0;
+ }
+
+ return sizeof(uint32_t) * len;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint32_t pullarrays32(uint8_t **in, int32_t out[], uint32_t max_len, uint32_t len, uint8_t *end) {
+ if(len == 0)
+ return 1;
+
+ if(len > max_len) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+ return 0;
+ }
+
+ if((end - (*in)) >= sizeof(uint32_t) * len) {
+ uint32_t idx;
+
+ for(idx = 0; idx < len; ++idx) {
+ if(!pulls32(in, &out[idx], end))
+ return 0;
+ }
+
+ return sizeof(uint32_t) * len;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) {
+ if(len == 0)
+ return 1;
+
+ if(len > max_len) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+ return 0;
+ }
+
+ if((end - (*out)) >= sizeof(uint32_t) * len) {
+ uint32_t idx;
+
+ for(idx = 0; idx < len; ++idx) {
+ if(!push32(in[idx], out, end))
+ return 0;
+ }
+
+ return sizeof(uint32_t) * len;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+uint32_t pusharrays32(int32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) {
+ if(len == 0)
+ return 1;
+
+ if(len > max_len) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+ return 0;
+ }
+
+ if((end - (*out)) >= sizeof(uint32_t) * len) {
+ uint32_t idx;
+
+ for(idx = 0; idx < len; ++idx) {
+ pushs32(in[idx], out, end);
+ }
+
+ return sizeof(uint32_t) * len;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+uint32_t pullarray8(uint8_t **in, uint8_t out[], uint32_t max_len, uint32_t len, uint8_t *end) {
+ if(len == 0)
+ return 1;
+
+ if(len > max_len) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+ return 0;
+ }
+
+ if((end - (*in)) >= sizeof(uint8_t) * len) {
+ memcpy(out, (*in), len);
+ (*in)+=len;
+ return sizeof(uint8_t) * len;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint32_t pusharray8(uint8_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) {
+ if(len == 0)
+ return 1;
+
+ if(len > max_len) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len);
+ return 0;
+ }
+
+ if((end - (*out)) >= sizeof(uint8_t) * len) {
+ memcpy((*out), in, len);
+ (*out)+=len;
+ return sizeof(uint8_t) * len;
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__);
+ return 0;
+ }
+}
+
+uint8_t packarray(void *array, uint16_t array_element_size, uint16_t max_count, uint16_t count, uint8_t **ppwritepackedmsg, uint8_t *end, pack_array_elem_fn fn) {
+ if(count > max_count) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, count, max_count);
+ return 0;
+ }
+
+ uint16_t i = 0;
+
+ for(i = 0; i < count; ++i) {
+ if((fn)(array, ppwritepackedmsg, end) == 0)
+ return 0;
+
+ array += array_element_size;
+ }
+
+ return 1;
+}
+
+uint8_t unpackarray(uint8_t **ppReadPackedMsg, void *array, uint16_t array_element_size, uint16_t max_count, uint16_t count, uint8_t *end, unpack_array_elem_fn fn) {
+ if(count > max_count) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, count, max_count);
+ return 0;
+ }
+
+ uint16_t i = 0;
+
+ for(i = 0; i < count; ++i) {
+ if((fn)(array, ppReadPackedMsg, end) == 0)
+ return 0;
+
+ array += array_element_size;
+ }
+
+ return 1;
+}
+
+
+uint32_t pack_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) {
+ if(ve != 0 && config != 0) {
+ if(config->pack_vendor_extension_tlv) {
+ uint8_t *pStartOfTlv = *ppWritePackedMsg;
+
+ if(pack_tl(ve, ppWritePackedMsg, end) == 0)
+ return 0;
+
+ uint8_t *pStartOfValue = *ppWritePackedMsg;
+
+ if((config->pack_vendor_extension_tlv)(ve, ppWritePackedMsg, end, config) == 0)
+ return 0;
+
+ ve->length = (*ppWritePackedMsg) - pStartOfValue;
+ pack_tl(ve, &pStartOfTlv, end);
+ return 1;
+ }
+ }
+
+ return 1;
+}
+
+uint32_t unpack_vendor_extension_tlv(nfapi_tl_t *tl, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config, nfapi_tl_t **ve_tlv) {
+ if(ve_tlv != 0 && config != 0) {
+ if(config->unpack_vendor_extension_tlv) {
+ return (config->unpack_vendor_extension_tlv)(tl, ppReadPackedMsg, end, (void **)ve_tlv, config);
+ }
+ }
+
+ return 1;
+}
+
+uint32_t pack_p7_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end,nfapi_p7_codec_config_t *config) {
+ if(ve != 0 && config != 0) {
+ if(config->pack_vendor_extension_tlv) {
+ uint8_t *pStartOfTlv = *ppWritePackedMsg;
+
+ if(pack_tl(ve, ppWritePackedMsg, end) == 0)
+ return 0;
+
+ uint8_t *pStartOfValue = *ppWritePackedMsg;
+
+ if((config->pack_vendor_extension_tlv)(ve, ppWritePackedMsg, end, config) == 0)
+ return 0;
+
+ ve->length = (*ppWritePackedMsg) - pStartOfValue;
+ pack_tl(ve, &pStartOfTlv, end);
+ return 1;
+ }
+ }
+
+ return 1;
+}
+
+int unpack_p7_vendor_extension_tlv(nfapi_tl_t *tl, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config, nfapi_tl_t **ve_tlv) {
+ if(ve_tlv != 0 && config != 0) {
+ if(config->unpack_vendor_extension_tlv) {
+ return (config->unpack_vendor_extension_tlv)(tl, ppReadPackedMsg, end, (void **)ve_tlv, config);
+ }
+ }
+
+ return 1;
+}
+
+
+uint8_t pack_tl(nfapi_tl_t *tl, uint8_t **ppWritePackedMsg, uint8_t *end) {
+ return (push16(tl->tag, ppWritePackedMsg, end) &&
+ push16(tl->length, ppWritePackedMsg, end));
+}
+
+uint8_t unpack_tl(uint8_t **ppReadPackedMsg, nfapi_tl_t *tl, uint8_t *end) {
+ return (pull16(ppReadPackedMsg, &tl->tag, end) &&
+ pull16(ppReadPackedMsg, &tl->length, end));
+}
+
+int unpack_tlv_list(unpack_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config, nfapi_tl_t **ve) {
+ nfapi_tl_t generic_tl;
+ uint8_t numBadTags = 0;
+ uint16_t idx = 0;
+
+ while ((uint8_t *)(*ppReadPackedMsg) < end) {
+ // unpack the tl and process the values accordingly
+ if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
+ return 0;
+
+ uint8_t tagMatch = 0;
+ uint8_t *pStartOfValue = *ppReadPackedMsg;
+
+ for(idx = 0; idx < size; ++idx) {
+ if(unpack_fns[idx].tag == generic_tl.tag) { // match the extracted tag value with all the tags in unpack_fn list
+ tagMatch = 1;
+ nfapi_tl_t *tl = (nfapi_tl_t *)(unpack_fns[idx].tlv);
+ tl->tag = generic_tl.tag;
+ tl->length = generic_tl.length;
+ int result = (*unpack_fns[idx].unpack_func)(tl, ppReadPackedMsg, end);
+
+ if(result == 0) {
+ return 0;
+ }
+
+ // check if the length was right;
+ if(tl->length != (*ppReadPackedMsg - pStartOfValue)) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning tlv tag 0x%x length %d not equal to unpack %ld\n", tl->tag, tl->length, (*ppReadPackedMsg - pStartOfValue));
+ }
+ }
+ }
+
+ if(tagMatch == 0) {
+ if(generic_tl.tag >= NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE &&
+ generic_tl.tag <= NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE) {
+ int result = unpack_vendor_extension_tlv(&generic_tl, ppReadPackedMsg, end, config, ve);
+
+ if(result == 0) {
+ // got tot the end.
+ return 0;
+ } else if(result < 0) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown VE TAG value: 0x%04x\n", generic_tl.tag);
+
+ if (++numBadTags > MAX_BAD_TAG) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
+ return 0;
+ }
+
+ if((end - *ppReadPackedMsg) >= generic_tl.length) {
+ // Advance past the unknown TLV
+ (*ppReadPackedMsg) += generic_tl.length;
+ } else {
+ // go to the end
+ return 0;
+ }
+ }
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag);
+
+ if (++numBadTags > MAX_BAD_TAG) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
+ return 0;
+ }
+
+ if((end - *ppReadPackedMsg) >= generic_tl.length) {
+ // Advance past the unknown TLV
+ (*ppReadPackedMsg) += generic_tl.length;
+ } else {
+ // go to the end
+ return 0;
+ }
+ }
+ }
+ }
+
+ return 1;
+}
+int unpack_p7_tlv_list(unpack_p7_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config, nfapi_tl_t **ve) {
+ nfapi_tl_t generic_tl;
+ uint8_t numBadTags = 0;
+ uint16_t idx = 0;
+
+ while ((uint8_t *)(*ppReadPackedMsg) < end) {
+ // unpack the tl and process the values accordingly
+ if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
+ return 0;
+
+ uint8_t tagMatch = 0;
+ uint8_t *pStartOfValue = *ppReadPackedMsg;
+
+ for(idx = 0; idx < size; ++idx) {
+ if(unpack_fns[idx].tag == generic_tl.tag) {
+ tagMatch = 1;
+ nfapi_tl_t *tl = (nfapi_tl_t *)(unpack_fns[idx].tlv);
+ tl->tag = generic_tl.tag;
+ tl->length = generic_tl.length;
+ int result = (*unpack_fns[idx].unpack_func)(tl, ppReadPackedMsg, end, config);
+
+ if(result == 0) {
+ return 0;
+ }
+
+ // check if the length was right;
+ if(tl->length != (*ppReadPackedMsg - pStartOfValue)) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning tlv tag 0x%x length %d not equal to unpack %ld\n", tl->tag, tl->length, (*ppReadPackedMsg - pStartOfValue));
+ }
+ }
+ }
+
+ if(tagMatch == 0) {
+ if(generic_tl.tag >= NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE &&
+ generic_tl.tag <= NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE) {
+ int result = unpack_p7_vendor_extension_tlv(&generic_tl, ppReadPackedMsg, end, config, ve);
+
+ if(result == 0) {
+ // got to end
+ return 0;
+ } else if(result < 0) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag);
+
+ if (++numBadTags > MAX_BAD_TAG) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
+ return -1;
+ }
+
+ if((end - *ppReadPackedMsg) >= generic_tl.length) {
+ // Advance past the unknown TLV
+ (*ppReadPackedMsg) += generic_tl.length;
+ } else {
+ // got ot the dn
+ return 0;
+ }
+ }
+ } else {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag);
+
+ if (++numBadTags > MAX_BAD_TAG) {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n");
+ return -1;
+ }
+
+ if((end - *ppReadPackedMsg) >= generic_tl.length) {
+ // Advance past the unknown TLV
+ (*ppReadPackedMsg) += generic_tl.length;
+ } else {
+ // got ot the dn
+ return 0;
+ }
+ }
+ }
+ }
+
+ return 1;
+}
+
+// This intermediate function deals with calculating the length of the value
+// and writing into the tlv header.
+uint8_t pack_tlv(uint16_t tag, void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end, pack_tlv_fn fn) {
+ nfapi_tl_t *tl = (nfapi_tl_t *)tlv;
+
+ // If the tag is defined
+ if(tl->tag == tag) {
+ uint8_t *pStartOfTlv = *ppWritePackedMsg;
+
+ // write a dumy tlv header
+ if(pack_tl(tl, ppWritePackedMsg, end) == 0)
+ return 0;
+
+ // Record the start of the value
+ uint8_t *pStartOfValue = *ppWritePackedMsg;
+
+ // pack the tlv value
+ if(fn(tlv, ppWritePackedMsg, end) == 0)
+ return 0;
+
+ // calculate the length of the value and rewrite the tl header
+ tl->length = (*ppWritePackedMsg) - pStartOfValue;
+ // rewrite the header with the correct length
+ pack_tl(tl, &pStartOfTlv, end);
+ } else {
+ if(tl->tag != 0) {
+ NFAPI_TRACE(NFAPI_TRACE_WARN, "Warning pack_tlv tag 0x%x does not match expected 0x%x\n", tl->tag, tag);
+ } else {
+ //NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning pack_tlv tag 0x%x ZERO does not match expected 0x%x\n", tl->tag, tag);
+ }
+ }
+
+ return 1;
+}
+
+const char *nfapi_error_code_to_str(nfapi_error_code_e value) {
+ switch(value) {
+ case NFAPI_MSG_OK:
+ return "NFAPI_MSG_OK";
+
+ case NFAPI_MSG_INVALID_STATE:
+ return "NFAPI_MSG_INVALID_STATE";
+
+ case NFAPI_MSG_INVALID_CONFIG:
+ return "NFAPI_MSG_INVALID_CONFIG";
+
+ case NFAPI_SFN_OUT_OF_SYNC:
+ return "NFAPI_SFN_OUT_OF_SYNC";
+
+ case NFAPI_MSG_SUBFRAME_ERR:
+ return "NFAPI_MSG_SUBFRAME_ERR";
+
+ case NFAPI_MSG_BCH_MISSING:
+ return "NFAPI_MSG_BCH_MISSING";
+
+ case NFAPI_MSG_INVALID_SFN:
+ return "NFAPI_MSG_INVALID_SFN";
+
+ case NFAPI_MSG_HI_ERR:
+ return "NFAPI_MSG_HI_ERR";
+
+ case NFAPI_MSG_TX_ERR:
+ return "NFAPI_MSG_TX_ERR";
+
+ default:
+ return "UNKNOWN";
+ }
+}
diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p4.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p4.c
index dbaa4347d3..6e79af6348 100644
--- a/nfapi/open-nFAPI/nfapi/src/nfapi_p4.c
+++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p4.c
@@ -29,7 +29,7 @@
static uint32_t get_packed_msg_len(uintptr_t msgHead, uintptr_t msgEnd) {
if (msgEnd < msgHead) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "get_packed_msg_len: Error in pointers supplied %d, %d\n", msgHead, msgEnd);
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "get_packed_msg_len: Error in pointers supplied %lu, %lu\n", msgHead, msgEnd);
return 0;
}
diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
index 3a6d807bdd..32b87f80e0 100644
--- a/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
+++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
@@ -429,16 +429,6 @@ static uint8_t pack_embms_mbsfn_config_value(void *tlv, uint8_t **ppWritePackedM
pusharray8(value->fourframes_flag, 8,value->num_mbsfn_config,ppWritePackedMsg, end) &&
pusharrays32(value->mbsfn_subframeconfig, 8, value->num_mbsfn_config, ppWritePackedMsg, end));
}
-// static uint8_t unpack_embms_mbsfn_config_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t* end)
-// {
-// nfapi_embms_mbsfn_config_t* value = (nfapi_embms_mbsfn_config_t*)tlv;
-
-// return ( pull16(ppReadPackedMsg, &value->num_mbsfn_config, end) &&
-// pull16(ppReadPackedMsg, &value->radioframe_allocation_period, end) &&
-// pull16(ppReadPackedMsg, &value->radioframe_allocation_offset, end) &&
-// pull8(ppReadPackedMsg, &value->fourframes_flag, end) &&
-// pullarrays32(ppReadPackedMsg, value->mbsfn_subframeconfig, 8, value->num_mbsfn_config, end));
-// }
static uint8_t pack_param_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) {
nfapi_param_response_t *pNfapiMsg = (nfapi_param_response_t *)msg;
@@ -734,10 +724,10 @@ static uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uin
pack_tlv(NFAPI_NR_CONFIG_UL_K0_TAG, &(pNfapiMsg->carrier_config.ul_k0[1]), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_UPLINK_BANDWIDTH_TAG, &(pNfapiMsg->carrier_config.uplink_bandwidth), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG, &(pNfapiMsg->carrier_config.uplink_frequency), ppWritePackedMsg, end, &pack_uint32_tlv_value) &&
-
+
pack_tlv(NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG, &(pNfapiMsg->cell_config.frame_duplex_type), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, &(pNfapiMsg->cell_config.phy_cell_id), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
-
+
pack_tlv(NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG, &(pNfapiMsg->prach_config.prach_sequence_length), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_RESTRICTED_SET_CONFIG_TAG, &(pNfapiMsg->prach_config.restricted_set_config), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
@@ -1036,7 +1026,7 @@ static uint8_t pack_p5_message_body(nfapi_p4_p5_message_header_t *header, uint8_
static uint32_t get_packed_msg_len(uintptr_t msgHead, uintptr_t msgEnd) {
if (msgEnd < msgHead) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "get_packed_msg_len: Error in pointers supplied %d, %d\n", msgHead, msgEnd);
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "get_packed_msg_len: Error in pointers supplied %lu, %lu\n", msgHead, msgEnd);
return 0;
}
@@ -1351,7 +1341,6 @@ static uint8_t unpack_nr_pnf_config_request(uint8_t **ppReadPackedMsg, uint8_t *
}
-
static uint8_t unpack_pnf_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t *config) {
nfapi_pnf_config_request_t *pNfapiMsg = (nfapi_pnf_config_request_t *)msg;
unpack_tlv_t unpack_fns[] = {
@@ -1723,6 +1712,7 @@ static uint8_t unpack_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo
return ( pull8(ppReadPackedMsg, &pNfapiMsg->num_tlv, end) &&
unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
}
+
static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
{
nfapi_nr_config_request_scf_t *pNfapiMsg = (nfapi_nr_config_request_scf_t*)msg;
@@ -1786,7 +1776,7 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end,
return ( pull8(ppReadPackedMsg, &pNfapiMsg->num_tlv, end) &&
unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
-
+
}
static uint8_t unpack_config_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t *config) {
@@ -2386,3 +2376,4 @@ int nfapi_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
return result;
}
+
diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
index 7cb74f8562..adc6d6e384 100644
--- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
+++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c
@@ -223,7 +223,6 @@ static uint8_t pack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppWritePa
static uint8_t pack_dl_tti_pdcch_pdu_rel15_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) {
nfapi_nr_dl_tti_pdcch_pdu_rel15_t* value = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t*)tlv;
-
for(uint8_t i = 0; i < MAX_DCI_CORESET; ++i)
{
if(!(push16(value->dci_pdu[i].RNTI, ppWritePackedMsg, end) &&
@@ -236,7 +235,6 @@ static uint8_t pack_dl_tti_pdcch_pdu_rel15_value(void* tlv, uint8_t **ppWritePac
push16(value->dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end) &&
pusharray8(value->dci_pdu[i].Payload, value->dci_pdu[i].PayloadSizeBits, value->dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end)))
return 0;
-
}
// TODO: resolve the packaging of array (currently sending a single element)
return(
@@ -300,17 +298,21 @@ static uint8_t pack_dl_tti_pdsch_pdu_rel15_value(void *tlv, uint8_t **ppWritePac
static uint8_t pack_dl_tti_ssb_pdu_rel15_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) {
- nfapi_nr_dl_tti_ssb_pdu_rel15_t *value = (nfapi_nr_dl_tti_ssb_pdu_rel15_t *)tlv;
- return(
- push16(value->PhysCellId, ppWritePackedMsg, end) &&
- push8(value->BetaPss, ppWritePackedMsg, end) &&
- push8(value->SsbBlockIndex, ppWritePackedMsg, end) &&
- push8(value->SsbSubcarrierOffset, ppWritePackedMsg, end) &&
- push16(value->ssbOffsetPointA, ppWritePackedMsg, end) &&
- push8(value->bchPayloadFlag, ppWritePackedMsg, end) &&
- push32(value->bchPayload, ppWritePackedMsg, end)
- // TODO: pack precoding_and_beamforming too
- );
+ NFAPI_TRACE(NFAPI_TRACE_DEBUG, "Packing ssb. \n");
+ nfapi_nr_dl_tti_ssb_pdu_rel15_t* value = (nfapi_nr_dl_tti_ssb_pdu_rel15_t*)tlv;
+
+ return(
+ push16(value->PhysCellId, ppWritePackedMsg, end) &&
+ push8(value->BetaPss, ppWritePackedMsg, end) &&
+ push8(value->SsbBlockIndex, ppWritePackedMsg, end) &&
+ push8(value->SsbSubcarrierOffset, ppWritePackedMsg, end) &&
+ push16(value->ssbOffsetPointA, ppWritePackedMsg, end) &&
+ push8(value->bchPayloadFlag, ppWritePackedMsg, end) &&
+ push32(value->bchPayload, ppWritePackedMsg, end) &&
+ push8(value->ssbRsrp, ppWritePackedMsg, end)
+ // TODO: pack precoding_and_beamforming too
+ );
+
}
@@ -778,38 +780,41 @@ static uint8_t pack_dl_config_request_body_value(void *tlv, uint8_t **ppWritePac
}
-static uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) {
- nfapi_nr_dl_tti_request_t *pNfapiMsg = (nfapi_nr_dl_tti_request_t *)msg;
+static uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
+{
+ nfapi_nr_dl_tti_request_t *pNfapiMsg = (nfapi_nr_dl_tti_request_t*)msg;
- if (!(push16(pNfapiMsg->SFN, ppWritePackedMsg, end) &&
- push16(pNfapiMsg->Slot, ppWritePackedMsg, end) &&
- push8(pNfapiMsg->dl_tti_request_body.nGroup, ppWritePackedMsg, end) &&
- push8(pNfapiMsg->dl_tti_request_body.nPDUs, ppWritePackedMsg, end) &&
- pusharray8(pNfapiMsg->dl_tti_request_body.nUe,256,pNfapiMsg->dl_tti_request_body.nGroup, ppWritePackedMsg, end)
- //pusharray8(pNfapiMsg->PduIdx[0] ,256,256, ppWritePackedMsg, end)
- ))
- return 0;
+ if (!(push16(pNfapiMsg->SFN , ppWritePackedMsg, end) &&
+ push16(pNfapiMsg->Slot , ppWritePackedMsg, end) &&
+ push8(pNfapiMsg->dl_tti_request_body.nGroup , ppWritePackedMsg, end) &&
+ push8(pNfapiMsg->dl_tti_request_body.nPDUs , ppWritePackedMsg, end) &&
+ pusharray8(pNfapiMsg->dl_tti_request_body.nUe, 256, pNfapiMsg->dl_tti_request_body.nGroup, ppWritePackedMsg, end)
+ //pusharray8(pNfapiMsg->PduIdx[0] ,256,256, ppWritePackedMsg, end)
+ ))
+ return 0;
- int arr[12];
+ int arr[12];
+ for(int i=0;idl_tti_request_body.nGroup;i++)
+ {
+ for(int j=0;jdl_tti_request_body.nUe[i];j++)
+ {
+ arr[j] = pNfapiMsg->dl_tti_request_body.PduIdx[i][j];
+ }
+ if(!(pusharrays32(arr, 12, pNfapiMsg->dl_tti_request_body.nUe[i], ppWritePackedMsg, end)))
+ return 0;
+ }
- for(int i=0; idl_tti_request_body.nGroup; i++) {
- for(int j=0; jdl_tti_request_body.nUe[i]; j++) {
- arr[j] = pNfapiMsg->dl_tti_request_body.PduIdx[i][j];
- }
+ for(int i=0;idl_tti_request_body.nPDUs;i++)
+ {
+ if(!pack_dl_tti_request_body_value(&pNfapiMsg->dl_tti_request_body.dl_tti_pdu_list[i],ppWritePackedMsg,end))
+ return 0;
+ }
- if(!(pusharrays32(arr,12,pNfapiMsg->dl_tti_request_body.nUe[i],ppWritePackedMsg, end)))
- return 0;
- }
-
- for(int i=0; idl_tti_request_body.nPDUs; i++) {
- if(!pack_dl_tti_request_body_value(&pNfapiMsg->dl_tti_request_body.dl_tti_pdu_list[i],ppWritePackedMsg,end))
- return 0;
- }
-
- return 1;
+return 1;
}
+
static uint8_t pack_dl_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) {
nfapi_dl_config_request_t *pNfapiMsg = (nfapi_dl_config_request_t *)msg;
//return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) &&
@@ -902,6 +907,7 @@ static uint8_t pack_ul_tti_request_pucch_pdu(nfapi_nr_pucch_pdu_t *pucch_pdu, ui
push8(pucch_pdu->cyclic_prefix, ppWritePackedMsg, end) &&
push8(pucch_pdu->format_type, ppWritePackedMsg, end) &&
push8(pucch_pdu->multi_slot_tx_indicator, ppWritePackedMsg, end) &&
+ push8(pucch_pdu->pi_2bpsk, ppWritePackedMsg, end) &&
push16(pucch_pdu->prb_start, ppWritePackedMsg, end) &&
push16(pucch_pdu->prb_size, ppWritePackedMsg, end) &&
push8(pucch_pdu->start_symbol_index, ppWritePackedMsg, end) &&
@@ -1803,7 +1809,6 @@ static uint8_t pack_hi_dci0_request_body_value(void *tlv, uint8_t **ppWritePacke
static uint8_t pack_ul_dci_pdu_list_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_ul_dci_request_pdus_t* value = (nfapi_nr_ul_dci_request_pdus_t*)tlv;
-
for(uint8_t i = 0; i < MAX_DCI_CORESET; ++i)
{
if(!(push16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].RNTI, ppWritePackedMsg, end) &&
@@ -1816,7 +1821,6 @@ static uint8_t pack_ul_dci_pdu_list_value(void* tlv, uint8_t **ppWritePackedMsg,
push8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].powerControlOffsetSS, ppWritePackedMsg, end) &&
push16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end) &&
-
pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].Payload, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end)))
return 0;
@@ -2263,6 +2267,7 @@ static uint8_t pack_crc_indication_body_value(void *tlv, uint8_t **ppWritePacked
uint16_t i = 0;
uint16_t total_number_of_pdus = value->number_of_crcs;
+ assert(total_number_of_pdus <= NFAPI_CRC_IND_MAX_PDU);
for(; i < total_number_of_pdus; ++i) {
nfapi_crc_indication_pdu_t *pdu = &(value->crc_pdu_list[i]);
uint8_t *instance_length_p = *ppWritePackedMsg;
@@ -2304,7 +2309,7 @@ static uint8_t pack_rx_indication_rel9_value(void *tlv, uint8_t **ppWritePackedM
static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) {
nfapi_rx_indication_body_t *value = (nfapi_rx_indication_body_t *)tlv;
- //printf("RX ULSCH BODY\n");
+ //NFAPI_TRACE(NFAPI_TRACE_DEBUG, "RX ULSCH BODY\n");
if( push16(value->number_of_pdus, ppWritePackedMsg, end) == 0)
return 0;
@@ -2313,28 +2318,30 @@ static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWriteP
uint16_t i = 0;
uint16_t offset = 2; // taking into account the number_of_pdus
uint16_t total_number_of_pdus = value->number_of_pdus;
- //printf("ULSCH:pdus:%d\n", total_number_of_pdus);
+ //NFAPI_TRACE(NFAPI_TRACE_DEBUG, "ULSCH:pdus:%d\n", total_number_of_pdus);
+ assert(total_number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
for(i = 0; i < total_number_of_pdus; ++i) {
nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]);
if(pdu->rx_ue_information.tl.tag == NFAPI_RX_UE_INFORMATION_TAG) {
- //printf("NFAPI_RX_UE_INFORMATION_TAG\n");
+ //NFAPI_TRACE(NFAPI_TRACE_DEBUG, "NFAPI_RX_UE_INFORMATION_TAG\n");
offset += 4 + 6;
}
if(pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG) {
- //printf("NFAPI_RX_INDICATION_REL8_TAG\n");
+ //NFAPI_TRACE(NFAPI_TRACE_DEBUG, "NFAPI_RX_INDICATION_REL8_TAG\n");
offset += 4 + 7;
}
if(pdu->rx_indication_rel9.tl.tag == NFAPI_RX_INDICATION_REL9_TAG) {
- //printf("NFAPI_RX_INDICATION_REL9_TAG\n");
+ //NFAPI_TRACE(NFAPI_TRACE_DEBUG, "NFAPI_RX_INDICATION_REL9_TAG\n");
offset += 4 + 2;
}
}
// Now update the structure to include the offset
+ assert(total_number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
for(i =0; i < total_number_of_pdus; ++i) {
nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]);
@@ -2347,6 +2354,7 @@ static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWriteP
}
// Write out the pdu
+ assert(total_number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
for(i = 0; i < total_number_of_pdus; ++i) {
nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]);
@@ -2357,6 +2365,7 @@ static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWriteP
}
// Write out the pdu data
+ assert(total_number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
for(i = 0; i < total_number_of_pdus; ++i) {
uint16_t length = 0;
nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]);
@@ -2365,7 +2374,7 @@ static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWriteP
length = pdu->rx_indication_rel8.length;
}
- if( pusharray8(value->rx_pdu_list[i].data, length, length, ppWritePackedMsg, end) == 0)
+ if( pusharray8(value->rx_pdu_list[i].rx_ind_data, NFAPI_RX_IND_DATA_MAX, length, ppWritePackedMsg, end) == 0)
return 0;
}
@@ -2584,6 +2593,7 @@ static uint8_t pack_cqi_indication_body_value(void *tlv, uint8_t **ppWritePacked
uint16_t offset = 2; // taking into account the number_of_cqis
uint16_t total_number_of_pdus = value->number_of_cqis;
+ assert(total_number_of_pdus <= NFAPI_CQI_IND_MAX_PDU);
for(i = 0; i < total_number_of_pdus; ++i) {
nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]);
offset += 2; // for the instance length
@@ -2625,6 +2635,7 @@ static uint8_t pack_cqi_indication_body_value(void *tlv, uint8_t **ppWritePacked
}
// Write out the cqi information
+ assert(total_number_of_pdus <= NFAPI_CQI_IND_MAX_PDU);
for(i = 0; i < total_number_of_pdus; ++i) {
nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]);
uint8_t *instance_length_p = *ppWritePackedMsg;
@@ -2645,6 +2656,7 @@ static uint8_t pack_cqi_indication_body_value(void *tlv, uint8_t **ppWritePacked
}
// Write out the cqi raw data
+ assert(total_number_of_pdus <= NFAPI_CQI_IND_MAX_PDU);
for(i = 0; i < total_number_of_pdus; ++i) {
uint16_t length = 0;
nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]);
@@ -3008,7 +3020,10 @@ static uint8_t pack_nr_rx_data_indication_body(void* tlv, uint8_t **ppWritePacke
push16(value->timing_advance, ppWritePackedMsg, end) &&
push16(value->rssi, ppWritePackedMsg, end)
))
- return 0;
+ return 0;
+
+ if(pusharray8(value->pdu, value->pdu_length, value->pdu_length, ppWritePackedMsg, end) == 0)
+ return 0;
return 1;
}
@@ -3022,22 +3037,21 @@ static uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg,
push16(pNfapiMsg->slot , ppWritePackedMsg, end) &&
push16(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end)
))
- return 0;
-
- for(int i=0; inumber_of_pdus;i++)
- {
- if(!pack_nr_rx_data_indication_body(pNfapiMsg->pdu_list,ppWritePackedMsg,end))
return 0;
+
+ for (int i = 0; i < pNfapiMsg->number_of_pdus; i++)
+ {
+ if(!pack_nr_rx_data_indication_body(&(pNfapiMsg->pdu_list[i]), ppWritePackedMsg, end))
+ return 0;
}
-return 1;
+ return 1;
}
//NR CRC INDICATION
-static uint8_t pack_nr_crc_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
+static uint8_t pack_nr_crc_indication_body(nfapi_nr_crc_t* value, uint8_t **ppWritePackedMsg, uint8_t *end)
{
- nfapi_nr_crc_t* value = (nfapi_nr_crc_t*)tlv;
if(!(push32(value->handle, ppWritePackedMsg, end) &&
push16(value->rnti, ppWritePackedMsg, end) &&
@@ -3064,9 +3078,9 @@ static uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uin
))
return 0;
- for(int i=0; inumber_crcs;i++)
+ for (int i = 0; i < pNfapiMsg->number_crcs; i++)
{
- if(!pack_nr_crc_indication_body(pNfapiMsg->crc_list,ppWritePackedMsg,end))
+ if(!pack_nr_crc_indication_body(&pNfapiMsg->crc_list[i], ppWritePackedMsg, end))
return 0;
}
@@ -3133,9 +3147,9 @@ static uint8_t pack_nr_rach_indication_body(void* tlv, uint8_t **ppWritePackedMs
return 0;
for(int i = 0; i < value->num_preamble; i++)
{
- if(!(push8(value->preamble_list->preamble_index, ppWritePackedMsg, end) &&
- push16(value->preamble_list->timing_advance, ppWritePackedMsg, end) &&
- push32(value->preamble_list->preamble_pwr, ppWritePackedMsg, end)
+ if(!(push8(value->preamble_list[i].preamble_index, ppWritePackedMsg, end) &&
+ push16(value->preamble_list[i].timing_advance, ppWritePackedMsg, end) &&
+ push32(value->preamble_list[i].preamble_pwr, ppWritePackedMsg, end)
))
return 0;
}
@@ -3177,23 +3191,22 @@ static uint8_t pack_nr_uci_pucch_0_1(void* tlv, uint8_t **ppWritePackedMsg, uint
))
return 0;
if (value->pduBitmap & 0x01) { //SR
- if(!(push8(value->sr->sr_indication, ppWritePackedMsg, end) &&
- push8(value->sr->sr_confidence_level, ppWritePackedMsg, end)
+ if (!(push8(value->sr->sr_indication, ppWritePackedMsg, end) &&
+ push8(value->sr->sr_confidence_level, ppWritePackedMsg, end)
))
return 0;
}
if (((value->pduBitmap >> 1) & 0x01)) { //HARQ
- if(!(push8(value->harq->num_harq, ppWritePackedMsg, end) &&
- push8(value->harq->harq_confidence_level, ppWritePackedMsg, end)
+ if (!(push8(value->harq->num_harq, ppWritePackedMsg, end) &&
+ push8(value->harq->harq_confidence_level, ppWritePackedMsg, end)
))
return 0;
-
- for(int i=0; iharq->num_harq;i++)
+ for (int i = 0; i < value->harq->num_harq; i++)
{
- if(!(push8(value->harq->harq_list[i].harq_value, ppWritePackedMsg, end)
+ if (!(push8(value->harq->harq_list[i].harq_value, ppWritePackedMsg, end)
))
- return 0;
+ return 0;
}
}
@@ -3258,7 +3271,7 @@ static uint8_t pack_nr_uci_indication_body(void* tlv, uint8_t **ppWritePackedMsg
switch (value->pdu_type) {
case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
- printf("Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n");
+ NFAPI_TRACE(NFAPI_TRACE_WARN, "Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n");
break;
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE:
@@ -3285,8 +3298,9 @@ static uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uin
for(int i=0; inum_ucis;i++)
{
- if(!pack_nr_uci_indication_body(pNfapiMsg->uci_list,ppWritePackedMsg,end))
- return 0;
+ if (!pack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppWritePackedMsg, end))
+ return 0;
+
}
return 1;
@@ -3307,13 +3321,6 @@ int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packe
NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack supplied pointers are null\n");
return -1;
}
- /*
- printf("\n P7 MESSAGE SENT: \n");
- for(int i=0; i< packedBufLen; i++){
- printf("%d", *(uint8_t *)(pMessageBuf + i));
- }
- printf("\n");
- */
// process the header
if(!(push16(pMessageHeader->phy_id, &pWritePackedMessage, end) &&
push16(pMessageHeader->message_id, &pWritePackedMessage, end) &&
@@ -3349,7 +3356,6 @@ int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packe
case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST:
result = pack_ul_dci_request(pMessageHeader, &pWritePackedMessage, end, config);
break;
-
case NFAPI_UE_RELEASE_REQUEST:
result =pack_ue_release_request(pMessageHeader, &pWritePackedMessage, end, config);
break;
@@ -3465,13 +3471,6 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
return -1;
}
- /*
- printf("\n P7 MESSAGE SENT: \n");
- for(int i=0; i< packedBufLen; i++){
- printf("%d", *(uint8_t *)(pMessageBuf + i));
- }
- printf("\n");
- */
// process the header
if(!(push16(pMessageHeader->phy_id, &pWritePackedMessage, end) &&
push16(pMessageHeader->message_id, &pWritePackedMessage, end) &&
@@ -3651,7 +3650,6 @@ static uint8_t unpack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppReadP
static uint8_t unpack_dl_tti_pdcch_pdu_rel15_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) {
nfapi_nr_dl_tti_pdcch_pdu_rel15_t* value = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t*)tlv;
-
for(uint8_t i = 0; i < MAX_DCI_CORESET; ++i)
{
if(!(pull16(ppReadPackedMsg, &value->dci_pdu[i].RNTI, end) &&
@@ -3738,7 +3736,8 @@ static uint8_t unpack_dl_tti_ssb_pdu_rel15_value(void *tlv, uint8_t **ppReadPack
pull8(ppReadPackedMsg, &value->SsbSubcarrierOffset, end) &&
pull16(ppReadPackedMsg, &value->ssbOffsetPointA, end) &&
pull8(ppReadPackedMsg, &value->bchPayloadFlag, end) &&
- pull32(ppReadPackedMsg, &value->bchPayload, end)
+ pull32(ppReadPackedMsg, &value->bchPayload, end) &&
+ pull8(ppReadPackedMsg, &value->ssbRsrp, end)
// TODO: pack precoding_and_beamforming too
);
}
@@ -4404,6 +4403,7 @@ static uint8_t unpack_ul_tti_request_pucch_pdu(void *tlv, uint8_t **ppReadPacked
pull8(ppReadPackedMsg, &pucch_pdu->cyclic_prefix, end) &&
pull8(ppReadPackedMsg, &pucch_pdu->format_type, end) &&
pull8(ppReadPackedMsg, &pucch_pdu->multi_slot_tx_indicator, end) &&
+ pull8(ppReadPackedMsg, &pucch_pdu->pi_2bpsk, end) &&
pull16(ppReadPackedMsg, &pucch_pdu->prb_start, end) &&
pull16(ppReadPackedMsg, &pucch_pdu->prb_size, end) &&
pull8(ppReadPackedMsg, &pucch_pdu->start_symbol_index, end) &&
@@ -5364,7 +5364,7 @@ static uint8_t unpack_hi_dci0_request_body_value(void *tlv, uint8_t **ppReadPack
if(packedPduEnd > end) {
// pdu end if past buffer end
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s pdu size to big %d %d\n", __FUNCTION__, packedPduEnd, end);
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s pdu size to big %p %p\n", __FUNCTION__, packedPduEnd, end);
return 0;
}
@@ -5464,7 +5464,6 @@ static uint8_t unpack_ul_dci_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t *
pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.ShiftIndex, end) &&
pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.precoderGranularity, end) &&
pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.numDlDci, end));
-
}
static uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) {
@@ -5654,12 +5653,13 @@ static uint8_t unpack_nr_slot_indication(uint8_t **ppReadPackedMsg, uint8_t *end
return 1;
}
-//RX DATA INDICATION
+//RX DATA INDICATION
-static uint8_t unpack_nr_rx_data_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t* value,
+ uint8_t **ppReadPackedMsg,
+ uint8_t *end,
+ nfapi_p7_codec_config_t* config)
{
- nfapi_nr_rx_data_pdu_t* value = (nfapi_nr_rx_data_pdu_t*)tlv;
-
if(!(pull32(ppReadPackedMsg, &value->handle, end) &&
pull16(ppReadPackedMsg, &value->rnti, end) &&
pull8(ppReadPackedMsg, &value->harq_id, end) &&
@@ -5668,7 +5668,16 @@ static uint8_t unpack_nr_rx_data_indication_body(void* tlv, uint8_t **ppReadPack
pull16(ppReadPackedMsg, &value->timing_advance, end) &&
pull16(ppReadPackedMsg, &value->rssi, end)
))
- return 0;
+ return 0;
+
+ uint16_t length = value->pdu_length;
+ value->pdu = nfapi_p7_allocate(length, config);
+
+ if (pullarray8(ppReadPackedMsg, value->pdu, length, length, end) == 0)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s pullarray8 failure\n", __FUNCTION__);
+ return 0;
+ }
return 1;
}
@@ -5682,10 +5691,14 @@ static uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *
pull16(ppReadPackedMsg, &pNfapiMsg->number_of_pdus, end)
))
return 0;
+ if (pNfapiMsg->number_of_pdus > 0)
+ {
+ pNfapiMsg->pdu_list = nfapi_p7_allocate(sizeof(*pNfapiMsg->pdu_list) * pNfapiMsg->number_of_pdus, config);
+ }
- for(int i=0; inumber_of_pdus;i++)
+ for (int i = 0; i < pNfapiMsg->number_of_pdus; i++)
{
- if(!unpack_nr_rx_data_indication_body(pNfapiMsg->pdu_list, ppReadPackedMsg, end))
+ if(!unpack_nr_rx_data_indication_body(&pNfapiMsg->pdu_list[i], ppReadPackedMsg, end, config))
return 0;
}
@@ -5715,21 +5728,23 @@ static uint8_t unpack_nr_crc_indication_body(nfapi_nr_crc_t* value, uint8_t **pp
static uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_crc_indication_t *msg, nfapi_p7_codec_config_t* config)
{
- nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t *) msg;
- // pNfapiMsg = (nfapi_nr_crc_indication_t *) malloc(sizeof(nfapi_nr_crc_indication_t));
- // pNfapiMsg->crc_list = (nfapi_nr_crc_t *) malloc(sizeof(nfapi_nr_crc_t));
+ nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t*)msg;
- if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn, end) &&
- pull16(ppReadPackedMsg, &pNfapiMsg->slot, end) &&
+ if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) &&
+ pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) &&
pull16(ppReadPackedMsg, &pNfapiMsg->number_crcs, end)
))
- return 0;
+ return 0;
- for(int i=0; inumber_crcs;i++)
+ if (pNfapiMsg->number_crcs > 0)
+ {
+ pNfapiMsg->crc_list = nfapi_p7_allocate(sizeof(*pNfapiMsg->crc_list) * pNfapiMsg->number_crcs, config);
+ }
+
+ for (int i = 0; i < pNfapiMsg->number_crcs; i++)
{
- if(!unpack_nr_crc_indication_body(pNfapiMsg->crc_list,ppReadPackedMsg,end))
- //if(!unpack_nr_crc_indication_body(value,ppReadPackedMsg,end))
- return 0;
+ if(!unpack_nr_crc_indication_body(&pNfapiMsg->crc_list[i], ppReadPackedMsg, end))
+ return 0;
}
return 1;
@@ -5780,9 +5795,11 @@ return 1;
//NR RACH
-static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
+static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t* value,
+ uint8_t **ppReadPackedMsg,
+ uint8_t *end,
+ nfapi_p7_codec_config_t* config)
{
- nfapi_nr_prach_indication_pdu_t* value = (nfapi_nr_prach_indication_pdu_t*)tlv;
if(!(pull16(ppReadPackedMsg, &value->phy_cell_id, end) &&
pull8(ppReadPackedMsg, &value->symbol_index, end) &&
@@ -5793,15 +5810,18 @@ static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t* t
pull8(ppReadPackedMsg, &value->num_preamble, end)
))
return 0;
- value->preamble_list = (nfapi_nr_prach_indication_preamble_t*) malloc(sizeof(nfapi_nr_prach_indication_preamble_t) * value->num_preamble);
- for(int i = 0; i < value->num_preamble; i++)
- {
- if(!(pull8(ppReadPackedMsg, &value->preamble_list->preamble_index, end) &&
- pull16(ppReadPackedMsg, &value->preamble_list->timing_advance, end) &&
- pull32(ppReadPackedMsg, &value->preamble_list->preamble_pwr, end)
- ))
- return 0;
- }
+
+ if (value->num_preamble > 0) {
+ value->preamble_list = nfapi_p7_allocate(sizeof(*value->preamble_list) * value->num_preamble, config);
+ for(int i = 0; i < value->num_preamble; i++)
+ {
+ if(!(pull8(ppReadPackedMsg, &value->preamble_list[i].preamble_index, end) &&
+ pull16(ppReadPackedMsg, &value->preamble_list[i].timing_advance, end) &&
+ pull32(ppReadPackedMsg, &value->preamble_list[i].preamble_pwr, end)
+ ))
+ return 0;
+ }
+ }
return 1;
}
@@ -5812,31 +5832,27 @@ static uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end
pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) &&
pull8(ppReadPackedMsg, &pNfapiMsg->number_of_pdus, end)
))
- return 0;
- pNfapiMsg->pdu_list = (nfapi_nr_prach_indication_pdu_t*) malloc(sizeof(nfapi_nr_prach_indication_pdu_t) * pNfapiMsg->number_of_pdus);
- for(int i=0; i< pNfapiMsg->number_of_pdus;i++)
- {
- if(!unpack_nr_rach_indication_body(pNfapiMsg->pdu_list,ppReadPackedMsg,end))
return 0;
- }
-return 1;
+ if (pNfapiMsg->number_of_pdus > 0) {
+ pNfapiMsg->pdu_list = nfapi_p7_allocate(sizeof(*pNfapiMsg->pdu_list) * pNfapiMsg->number_of_pdus, config);
+ for(int i = 0; i < pNfapiMsg->number_of_pdus; i++)
+ {
+ if(!unpack_nr_rach_indication_body(&pNfapiMsg->pdu_list[i], ppReadPackedMsg, end, config))
+ return 0;
+ }
+ }
+ return 1;
}
-//NR UCI
+//NR UCI
-static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) {
- nfapi_nr_uci_pucch_pdu_format_0_1_t* value = (nfapi_nr_uci_pucch_pdu_format_0_1_t*)tlv;
+static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *value,
+ uint8_t **ppReadPackedMsg,
+ uint8_t *end,
+ nfapi_p7_codec_config_t *config) {
- // uint8_t *ptr = *ppReadPackedMsg;
- // printf("\n Read P7 message uci_0_1 indication unpack: ");
- // while(ptr < end){
- // printf(" %d ", *ptr);
- // ptr++;
- // }
- // printf("\n");
-
- if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) &&
+ if (!(pull8(ppReadPackedMsg, &value->pduBitmap, end) &&
pull32(ppReadPackedMsg, &value->handle, end) &&
pull16(ppReadPackedMsg, &value->rnti, end) &&
pull8(ppReadPackedMsg, &value->pucch_format, end) &&
@@ -5846,26 +5862,45 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t* tlv,
))
return 0;
if (value->pduBitmap & 0x01) { //SR
- value->sr = (nfapi_nr_sr_pdu_0_1_t*) malloc(sizeof(nfapi_nr_sr_pdu_0_1_t));
+ value->sr = nfapi_p7_allocate(sizeof(*value->sr), config);
+ if (value->sr == NULL)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate sr pdu\n", __FUNCTION__);
+ return 0;
+ }
if(!(pull8(ppReadPackedMsg, &value->sr->sr_indication, end) &&
- pull8(ppReadPackedMsg, &value->sr->sr_confidence_level, end)
+ pull8(ppReadPackedMsg, &value->sr->sr_confidence_level, end)
))
return 0;
}
if (((value->pduBitmap >> 1) & 0x01)) { //HARQ
- value->harq = (nfapi_nr_harq_pdu_0_1_t*) malloc(sizeof(nfapi_nr_harq_pdu_0_1_t));
- if(!(pull8(ppReadPackedMsg, &value->harq->num_harq, end) &&
- pull8(ppReadPackedMsg, &value->harq->harq_confidence_level, end)
- ))
- return 0;
- value->harq->harq_list = (nfapi_nr_harq_t*) malloc(sizeof(nfapi_nr_harq_t*) * value->harq->num_harq);
- for(int i=0; iharq->num_harq;i++)
- {
- if(!(pull8(ppReadPackedMsg, &value->harq->harq_list->harq_value, end)
- ))
- return 0;
- }
+
+ value->harq = nfapi_p7_allocate(sizeof(*value->harq), config);
+ if (value->harq == NULL)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate nr_harq pdu\n", __FUNCTION__);
+ return 0;
+ }
+ if (!(pull8(ppReadPackedMsg, &value->harq->num_harq, end) &&
+ pull8(ppReadPackedMsg, &value->harq->harq_confidence_level, end)
+ ))
+ return 0;
+ value->harq->harq_list = NULL;
+ if (value->harq->num_harq > 0) {
+ value->harq->harq_list = nfapi_p7_allocate(sizeof(*value->harq->harq_list) * value->harq->num_harq, config);
+ if (value->harq->harq_list == NULL)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate harq ind pdu list (count:%d)\n",
+ __FUNCTION__, value->harq->num_harq);
+ return 0;
+ }
+ for (int i = 0; i < value->harq->num_harq; i++) {
+ if (!pull8(ppReadPackedMsg, &value->harq->harq_list[i].harq_value, end)) {
+ return 0;
+ }
+ }
+ }
}
return 1;
@@ -5930,7 +5965,10 @@ static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t*
return 1;
}
-static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t* value, uint8_t **ppReadPackedMsg, uint8_t *end)
+static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value,
+ uint8_t **ppReadPackedMsg,
+ uint8_t *end,
+ nfapi_p7_codec_config_t *config)
{
if(!(pull16(ppReadPackedMsg, &value->pdu_type, end) &&
pull16(ppReadPackedMsg, &value->pdu_size, end)
@@ -5938,21 +5976,26 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t* value, uint8_t **pp
return 0;
switch (value->pdu_type) {
- case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
- printf("Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n");
- break;
+ case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
+ NFAPI_TRACE(NFAPI_TRACE_WARN, "Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n");
+ break;
- case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
- nfapi_nr_uci_pucch_pdu_format_0_1_t* uci_pdu = &value->pucch_pdu_format_0_1;
- unpack_nr_uci_pucch_0_1(uci_pdu, ppReadPackedMsg, end);
- break;
+ case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
+ nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &value->pucch_pdu_format_0_1;
+ if (!unpack_nr_uci_pucch_0_1(uci_pdu, ppReadPackedMsg, end, config))
+ return 0;
+ break;
+ }
+ case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
+ nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4;
+ if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end))
+ return 0;
+ break;
+ }
+ default:
+ NFAPI_TRACE(NFAPI_TRACE_WARN, "Unexpected pdu type %d\n", value->pdu_type);
+ break;
}
- case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
- nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4;
- unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end);
- break;
- }
- }
return 1;
}
@@ -5967,13 +6010,14 @@ static uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end,
))
return 0;
- for(int i=0; inum_ucis;i++)
+ pNfapiMsg->uci_list = nfapi_p7_allocate(sizeof(*pNfapiMsg->uci_list) * pNfapiMsg->num_ucis, config);
+ for (int i = 0; i < pNfapiMsg->num_ucis; i++)
{
- if(!unpack_nr_uci_indication_body(pNfapiMsg->uci_list,ppReadPackedMsg,end))
- return 0;
+ if(!unpack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppReadPackedMsg, end, config))
+ return 0;
}
-return 1;
+ return 1;
}
static uint8_t unpack_ue_release_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) {
@@ -6233,6 +6277,7 @@ static uint8_t unpack_harq_indication_body_value(void *tlv, uint8_t **ppReadPack
return 0;
}
+ assert(value->number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU);
value->harq_pdu_list = (nfapi_harq_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_harq_indication_pdu_t) * value->number_of_harqs, config);
if(value->harq_pdu_list == NULL) {
@@ -6297,7 +6342,8 @@ static uint8_t unpack_crc_indication_body_value(void *tlv, uint8_t **ppReadPacke
}
if(value->number_of_crcs > 0) {
- value->crc_pdu_list = (nfapi_crc_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_crc_indication_pdu_t) * value->number_of_crcs, config);
+ assert(value->number_of_crcs <= NFAPI_CRC_IND_MAX_PDU);
+ value->crc_pdu_list = (nfapi_crc_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_crc_indication_pdu_t) * NFAPI_CRC_IND_MAX_PDU, config);
if(value->crc_pdu_list == NULL) {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate crc ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_crcs);
@@ -6349,114 +6395,141 @@ static uint8_t unpack_rx_indication_rel9_value(void *tlv, uint8_t **ppReadPacked
return (pull16(ppReadPackedMsg, &value->timing_advance_r9, end));
}
-static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) {
- nfapi_rx_indication_body_t *value = (nfapi_rx_indication_body_t *)tlv;
- // the rxBodyEnd points to the end of the cqi PDU's
- uint8_t *rxBodyEnd = *ppReadPackedMsg + value->tl.length;
- uint8_t *rxPduEnd = rxBodyEnd;
- uint8_t *numberOfPdusAddress = *ppReadPackedMsg;
+static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
+{
+ nfapi_rx_indication_body_t *value = (nfapi_rx_indication_body_t*)tlv;
- if(rxBodyEnd > end) {
- // pdu end is past buffer end
- return 0;
- }
+ NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s value->tl.length in unpack: %u \n", __FUNCTION__,
+ value->tl.length);
+ uint8_t *rxBodyEnd = *ppReadPackedMsg + value->tl.length;
- if(pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0)
- return 0;
+ NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s rxBodyEnd: %p end: %p\n", __FUNCTION__,
+ rxBodyEnd, end);
+ if (rxBodyEnd > end)
+ {
+ // pdu end is past buffer end
+ return 0;
+ }
- if(value->number_of_pdus > NFAPI_RX_IND_MAX_PDU) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of rx ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_RX_IND_MAX_PDU);
- return 0;
- }
+ if (pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0)
+ return 0;
- if(value->number_of_pdus > 0) {
- value->rx_pdu_list = (nfapi_rx_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_rx_indication_pdu_t) * value->number_of_pdus, config);
+ if (value->number_of_pdus > NFAPI_RX_IND_MAX_PDU)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of rx ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_RX_IND_MAX_PDU);
+ return 0;
+ }
- if(value->rx_pdu_list == NULL) {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate rx ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus);
- return 0;
- }
- } else {
- value->rx_pdu_list = 0;
- }
+ if (value->number_of_pdus > 0)
+ {
+ assert(value->number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
+ value->rx_pdu_list = (nfapi_rx_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_rx_indication_pdu_t) * NFAPI_RX_IND_MAX_PDU, config);
+ if (value->rx_pdu_list == NULL)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate rx ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus);
+ return 0;
+ }
+ }
+ else
+ {
+ value->rx_pdu_list = 0;
+ }
- uint8_t i = 0;
- nfapi_rx_indication_pdu_t *pdu = 0;
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s number_of_pdus = %u\n", __FUNCTION__, value->number_of_pdus);
+ for (int i = 0; i < value->number_of_pdus; i++)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s i = %u\n", __FUNCTION__, i);
+ nfapi_tl_t generic_tl;
- while((uint8_t *)(*ppReadPackedMsg) < rxBodyEnd && (uint8_t *)(*ppReadPackedMsg) < rxPduEnd) {
- nfapi_tl_t generic_tl;
+ // NFAPI_RX_UE_INFORMATION_TAG
+ if (unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_tl failed\n", __FUNCTION__);
+ return 0;
+ }
- if( unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
- return 0;
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s generic_tl.tag = 0x%x length = %u\n", __FUNCTION__, generic_tl.tag, generic_tl.length);
- switch(generic_tl.tag) {
- case NFAPI_RX_UE_INFORMATION_TAG: {
- pdu = &(value->rx_pdu_list[i++]);
- pdu->rx_ue_information.tl = generic_tl;
+ if (generic_tl.tag != NFAPI_RX_UE_INFORMATION_TAG)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s generic_tl.tag wrong\n", __FUNCTION__);
+ return 0;
+ }
- if(unpack_rx_ue_information_value(&pdu->rx_ue_information, ppReadPackedMsg, end) == 0)
- return 0;
- }
- break;
+ assert(i < NFAPI_RX_IND_MAX_PDU);
+ nfapi_rx_indication_pdu_t *pdu = &value->rx_pdu_list[i];
- case NFAPI_RX_INDICATION_REL8_TAG: {
- if(pdu != 0) {
- pdu->rx_indication_rel8.tl = generic_tl;
+ pdu->rx_ue_information.tl = generic_tl;
+ if (unpack_rx_ue_information_value(&pdu->rx_ue_information, ppReadPackedMsg, end) == 0)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_rx_ue_info failure\n", __FUNCTION__);
+ return 0;
+ }
- if(unpack_rx_indication_rel8_value(&pdu->rx_indication_rel8, ppReadPackedMsg, end) == 0)
- return 0;
+ // NFAPI_RX_INDICATION_REL8_TAG
+ if (unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_tl failed\n", __FUNCTION__);
+ return 0;
+ }
- if(pdu->rx_indication_rel8.offset > 0) {
- // Need to check that the data is within the tlv
- if(numberOfPdusAddress + pdu->rx_indication_rel8.offset + pdu->rx_indication_rel8.length <= rxBodyEnd) {
- // If this the first pdu set the rxPduEnd
- if(numberOfPdusAddress + pdu->rx_indication_rel8.offset < rxPduEnd) {
- rxPduEnd = numberOfPdusAddress + pdu->rx_indication_rel8.offset;
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s generic_tl.tag = 0x%x length = %u\n", __FUNCTION__, generic_tl.tag, generic_tl.length);
- if(rxPduEnd > end) {
- // pdu end is past buffer end
- return 0;
- }
- }
- } else {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME: the rx data is outside of the tlv\n");
- }
- }
- }
- }
- break;
+ if (generic_tl.tag != NFAPI_RX_INDICATION_REL8_TAG)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s generic_tl.tag wrong\n", __FUNCTION__);
+ return 0;
+ }
- case NFAPI_RX_INDICATION_REL9_TAG: {
- if(pdu != 0) {
- pdu->rx_indication_rel9.tl = generic_tl;
+ pdu->rx_indication_rel8.tl = generic_tl;
+ if (unpack_rx_indication_rel8_value(&pdu->rx_indication_rel8, ppReadPackedMsg, end) == 0)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_rx_indication_rel8 failure\n", __FUNCTION__);
+ return 0;
+ }
+ //What is offset not stripping 10 bytes
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s pdu->rx_indication_rel8.offset = %u", __FUNCTION__,
+ pdu->rx_indication_rel8.offset);
- if(unpack_rx_indication_rel9_value(&pdu->rx_indication_rel9, ppReadPackedMsg, end) == 0)
- return 0;
- }
- }
- break;
+ // NFAPI_RX_INDICATION_REL9_TAG
+ if (unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_tl failed\n", __FUNCTION__);
+ return 0;
+ }
- default: {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "RX_ULSCH.indication Invalid pdu type %d \n", generic_tl.tag );
- }
- break;
- }
- }
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s generic_tl.tag = 0x%x length = %u\n", __FUNCTION__, generic_tl.tag, generic_tl.length);
- uint8_t idx = 0;
+ if (generic_tl.tag != NFAPI_RX_INDICATION_REL9_TAG)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s generic_tl.tag wrong\n", __FUNCTION__);
+ return 0;
+ }
- for(idx = 0; idx < value->number_of_pdus; ++idx) {
- if(value->rx_pdu_list[idx].rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG) {
- uint32_t length = value->rx_pdu_list[idx].rx_indication_rel8.length;
- value->rx_pdu_list[idx].data = nfapi_p7_allocate(length, config);
+ pdu->rx_indication_rel9.tl = generic_tl;
+ if (unpack_rx_indication_rel9_value(&pdu->rx_indication_rel9, ppReadPackedMsg, end) == 0)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_rx_indication_rel9 failure\n", __FUNCTION__);
+ return 0;
+ }
+ }
- if(pullarray8(ppReadPackedMsg, value->rx_pdu_list[idx].data, length, length, end) == 0) {
- return 0;
- }
- }
- }
+ assert(value->number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
+ for (int i = 0; i < value->number_of_pdus; ++i)
+ {
+ nfapi_rx_indication_pdu_t *pdu = &value->rx_pdu_list[i];
+ if (pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG)
+ {
+ uint32_t length = pdu->rx_indication_rel8.length;
+ if (pullarray8(ppReadPackedMsg, pdu->rx_ind_data, NFAPI_RX_IND_DATA_MAX, length, end) == 0)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s pullarray8 failure\n", __FUNCTION__);
+ return 0;
+ }
+ }
+ }
- return 1;
+ return 1;
}
static uint8_t unpack_rx_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) {
@@ -7414,12 +7487,10 @@ static int check_nr_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBuf
if (unpackedBufLen >= sizeof(nfapi_nr_tx_data_request_t))
retLen = sizeof(nfapi_nr_tx_data_request_t);
break;
-
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_nr_rx_data_indication_t))
retLen = sizeof(nfapi_nr_rx_data_indication_t);
break;
-
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_nr_crc_indication_t))
retLen = sizeof(nfapi_nr_crc_indication_t);
@@ -7429,17 +7500,14 @@ static int check_nr_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBuf
if (unpackedBufLen >= sizeof(nfapi_nr_rach_indication_t))
retLen = sizeof(nfapi_nr_rach_indication_t);
break;
-
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_nr_uci_indication_t))
retLen = sizeof(nfapi_nr_uci_indication_t);
break;
-
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_nr_srs_indication_t))
retLen = sizeof(nfapi_nr_srs_indication_t);
break;
-
case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC:
if (unpackedBufLen >= sizeof(nfapi_nr_dl_node_sync_t))
retLen = sizeof(nfapi_nr_dl_node_sync_t);
@@ -7758,14 +7826,6 @@ int nfapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *
return -1;
}
- // uint8_t *ptr = pMessageBuf;
- // printf("\n Read P7 message unpack: ");
- // while(ptr < end){
- // printf(" %d ", *ptr);
- // ptr++;
- // }
- // printf("\n");
-
// clean the supplied buffer for - tag value blanking
(void)memset(pUnpackedBuf, 0, unpackedBufLen);
@@ -7823,7 +7883,6 @@ int nfapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *
else
return -1;
break;
-
case NFAPI_UE_RELEASE_REQUEST:
if (check_nr_unpack_length(NFAPI_UE_RELEASE_REQUEST, unpackedBufLen))
result = unpack_ue_release_request(&pReadPackedMessage, end, pMessageHeader, config);
diff --git a/nfapi/open-nFAPI/pnf/inc/pnf_p7.h b/nfapi/open-nFAPI/pnf/inc/pnf_p7.h
index 763b5c9abe..cab2455691 100644
--- a/nfapi/open-nFAPI/pnf/inc/pnf_p7.h
+++ b/nfapi/open-nFAPI/pnf/inc/pnf_p7.h
@@ -148,6 +148,7 @@ typedef struct {
int pnf_p7_message_pump(pnf_p7_t* pnf_p7);
int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7);
int pnf_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t* msg, uint32_t msg_len);
+int pnf_nr_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t* header, uint32_t msg_len);
int pnf_p7_send_message(pnf_p7_t* pnf_p7, uint8_t* msg, uint32_t msg_len);
diff --git a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
index fc9cd66077..ca8bc8d9a4 100644
--- a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
+++ b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
@@ -800,6 +800,7 @@ int nfapi_pnf_p7_harq_ind(nfapi_pnf_p7_config_t* config, nfapi_harq_indication_t
* \return 0 means success, -1 means failure
*/
int nfapi_pnf_p7_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_crc_indication_t* ind);
+int nfapi_pnf_p7_nr_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_crc_indication_t* ind);
/*! Send the RX.indication
* \param config A pointer to a PNF P7 config
@@ -807,6 +808,7 @@ int nfapi_pnf_p7_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_crc_indication_t*
* \return 0 means success, -1 means failure
*/
int nfapi_pnf_p7_rx_ind(nfapi_pnf_p7_config_t* config, nfapi_rx_indication_t* ind);
+int nfapi_pnf_p7_nr_rx_data_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rx_data_indication_t* ind);
/*! Send the RACH.indication
* \param config A pointer to a PNF P7 config
@@ -821,6 +823,7 @@ int nfapi_pnf_p7_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_rach_indication_t
* \return 0 means success, -1 means failure
*/
int nfapi_pnf_p7_srs_ind(nfapi_pnf_p7_config_t* config, nfapi_srs_indication_t* ind);
+int nfapi_pnf_p7_nr_srs_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_srs_indication_t* ind);
/*! Send the SR.indication
* \param config A pointer to a PNF P7 config
@@ -842,6 +845,7 @@ int nfapi_pnf_p7_cqi_ind(nfapi_pnf_p7_config_t* config, nfapi_cqi_indication_t*
* \return 0 means success, -1 means failure
*/
int nfapi_pnf_p7_lbt_dl_ind(nfapi_pnf_p7_config_t* config, nfapi_lbt_dl_indication_t* ind);
+int nfapi_pnf_p7_nr_uci_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_uci_indication_t* ind);
/*! Send the NB_HARQ.indication
* \param config A pointer to a PNF P7 config
@@ -856,6 +860,7 @@ int nfapi_pnf_p7_nb_harq_ind(nfapi_pnf_p7_config_t* config, nfapi_nb_harq_indica
* \return 0 means success, -1 means failure
*/
int nfapi_pnf_p7_nrach_ind(nfapi_pnf_p7_config_t* config, nfapi_nrach_indication_t* ind);
+int nfapi_pnf_p7_nr_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rach_indication_t* ind);
/*! Send a vendor exntesion message
diff --git a/nfapi/open-nFAPI/pnf/src/pnf.c b/nfapi/open-nFAPI/pnf/src/pnf.c
index fdafd93279..b4158dbb40 100644
--- a/nfapi/open-nFAPI/pnf/src/pnf.c
+++ b/nfapi/open-nFAPI/pnf/src/pnf.c
@@ -1,12 +1,12 @@
/*
* Copyright 2017 Cisco Systems, Inc.
- *
+ *
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -93,9 +93,9 @@ void pnf_nr_handle_pnf_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
nfapi_nr_pnf_param_request_t req;
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF_PARAM.request received\n");
-
+
// unpack the message
if (nfapi_nr_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(nfapi_nr_pnf_param_request_t), &pnf->_public.codec_config) >= 0)
{
@@ -109,7 +109,7 @@ void pnf_nr_handle_pnf_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: PNF not in IDLE state\n", __FUNCTION__);
-
+
nfapi_nr_pnf_param_response_t resp;
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_NR_PHY_MSG_TYPE_PNF_PARAM_RESPONSE;
@@ -121,7 +121,7 @@ void pnf_nr_handle_pnf_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
}
@@ -137,9 +137,9 @@ void pnf_handle_pnf_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
nfapi_pnf_param_request_t req;
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF_PARAM.request received\n");
-
+
// unpack the message
if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(nfapi_pnf_param_request_t), &pnf->_public.codec_config) >= 0)
{
@@ -153,7 +153,7 @@ void pnf_handle_pnf_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: PNF not in IDLE state\n", __FUNCTION__);
-
+
nfapi_pnf_param_response_t resp;
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_PNF_PARAM_RESPONSE;
@@ -165,7 +165,7 @@ void pnf_handle_pnf_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
}
@@ -185,7 +185,7 @@ void pnf_handle_pnf_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
nfapi_pnf_config_request_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF_CONFIG.request received\n");
-
+
// unpack the message
if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &pnf->_public.codec_config) >= 0)
{
@@ -194,7 +194,7 @@ void pnf_handle_pnf_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
// delete the phy records
nfapi_pnf_phy_config_delete_all(&pnf->_public);
-
+
// create the phy records
if (req.pnf_phy_rf_config.tl.tag == NFAPI_PNF_PHY_RF_TAG)
{
@@ -203,14 +203,14 @@ void pnf_handle_pnf_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
nfapi_pnf_phy_config_t* phy = (nfapi_pnf_phy_config_t*)malloc(sizeof(nfapi_pnf_phy_config_t));
memset(phy, 0, sizeof(nfapi_pnf_phy_config_t));
-
+
phy->state = NFAPI_PNF_PHY_IDLE;
phy->phy_id = req.pnf_phy_rf_config.phy_rf_config[i].phy_id;
-
+
nfapi_pnf_phy_config_add(&(pnf->_public), phy);
}
}
-
+
if(pnf->_public.pnf_config_req)
{
(pnf->_public.pnf_config_req)(&(pnf->_public), &req);
@@ -219,7 +219,7 @@ void pnf_handle_pnf_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: PNF not in correct state: %d\n", __FUNCTION__, pnf->_public.state);
-
+
nfapi_pnf_config_response_t resp;
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_PNF_CONFIG_RESPONSE;
@@ -251,7 +251,7 @@ void pnf_nr_handle_pnf_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen
nfapi_nr_pnf_config_request_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF_CONFIG.request received\n");
-
+
// unpack the message
if (nfapi_nr_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &pnf->_public.codec_config) >= 0)
{
@@ -260,7 +260,7 @@ void pnf_nr_handle_pnf_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen
{
// delete the phy records
nfapi_pnf_phy_config_delete_all(&pnf->_public);
-
+
// create the phy records
if (req.pnf_phy_rf_config.tl.tag == NFAPI_PNF_PHY_RF_TAG)
{
@@ -269,14 +269,14 @@ void pnf_nr_handle_pnf_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen
{
nfapi_pnf_phy_config_t* phy = (nfapi_pnf_phy_config_t*)malloc(sizeof(nfapi_pnf_phy_config_t));
memset(phy, 0, sizeof(nfapi_pnf_phy_config_t));
-
+
phy->state = NFAPI_PNF_PHY_IDLE;
phy->phy_id = req.pnf_phy_rf_config.phy_rf_config[i].phy_id;
-
+
nfapi_pnf_phy_config_add(&(pnf->_public), phy);
}
}
-
+
if(pnf->_public.pnf_nr_config_req)
{
(pnf->_public.pnf_nr_config_req)(&(pnf->_public), &req);
@@ -285,7 +285,7 @@ void pnf_nr_handle_pnf_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen
else
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: PNF not in correct state: %d\n", __FUNCTION__, pnf->_public.state);
-
+
nfapi_nr_pnf_config_response_t resp;
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_PNF_CONFIG_RESPONSE;
@@ -315,7 +315,7 @@ void pnf_handle_pnf_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
nfapi_pnf_start_request_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF_START.request Received\n");
-
+
// unpack the message
if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &pnf->_public.codec_config) >= 0)
{
@@ -357,7 +357,7 @@ void pnf_nr_handle_pnf_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
nfapi_nr_pnf_start_request_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF_START.request Received\n");
-
+
// unpack the message
if (nfapi_nr_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &pnf->_public.codec_config) >= 0)
{
@@ -397,9 +397,9 @@ void pnf_handle_pnf_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
nfapi_pnf_stop_request_t req;
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF_STOP.request Received\n");
-
+
// unpack the message
if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &pnf->_public.codec_config) >= 0)
{
@@ -423,7 +423,7 @@ void pnf_handle_pnf_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
@@ -440,11 +440,11 @@ void pnf_handle_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
nfapi_param_request_t req;
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "PARAM.request received\n");
-
+
// unpack the message
if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
@@ -479,7 +479,7 @@ void pnf_handle_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
resp.error_code = NFAPI_MSG_INVALID_CONFIG;
nfapi_pnf_param_resp(config, &resp);
}
-
+
}
else
{
@@ -495,7 +495,7 @@ void pnf_handle_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
@@ -512,11 +512,11 @@ void pnf_nr_handle_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
nfapi_nr_param_request_scf_t req;
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "PARAM.request received\n");
-
+
// unpack the message
if (nfapi_nr_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
@@ -551,7 +551,7 @@ void pnf_nr_handle_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
resp.error_code = NFAPI_MSG_INVALID_CONFIG;
nfapi_nr_pnf_param_resp(config, &resp);
}
-
+
}
else
{
@@ -567,7 +567,7 @@ void pnf_nr_handle_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
@@ -587,9 +587,9 @@ void pnf_handle_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
nfapi_config_request_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "CONFIG.request received\n");
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
// unpack the message
if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
@@ -639,7 +639,7 @@ void pnf_handle_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
}
@@ -659,9 +659,9 @@ void pnf_nr_handle_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
nfapi_nr_config_request_scf_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "CONFIG.request received\n");
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
// unpack the message
if (nfapi_nr_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
@@ -681,7 +681,7 @@ void pnf_nr_handle_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
(config->nr_config_req)(config, phy, &req);
-
+
}
}
else
@@ -718,7 +718,7 @@ void pnf_nr_handle_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
}
@@ -734,11 +734,11 @@ void pnf_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
nfapi_start_request_t req;
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() START.request received state:%d\n", __FUNCTION__, config->state);
-
+
// unpack the message
if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
@@ -788,7 +788,7 @@ void pnf_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
@@ -805,11 +805,11 @@ void pnf_nr_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
nfapi_nr_start_request_scf_t req;
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() START.request received state:%d\n", __FUNCTION__, config->state);
-
+
// unpack the message
if (nfapi_nr_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
@@ -859,7 +859,7 @@ void pnf_nr_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
@@ -878,9 +878,9 @@ void pnf_handle_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
nfapi_stop_request_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "STOP.request received\n");
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
// unpack the message
if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
@@ -930,10 +930,10 @@ void pnf_handle_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
-
+
}
}
@@ -949,9 +949,9 @@ void pnf_nr_handle_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
nfapi_nr_stop_request_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "STOP.request received\n");
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
// unpack the message
if (nfapi_nr_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
@@ -1001,10 +1001,10 @@ void pnf_nr_handle_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
-
+
}
}
@@ -1020,9 +1020,9 @@ void pnf_handle_measurement_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
nfapi_measurement_request_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "MEASUREMENT.request received\n");
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
// unpack the message
if (nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
@@ -1072,7 +1072,7 @@ void pnf_handle_measurement_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
}
@@ -1087,13 +1087,13 @@ void pnf_handle_rssi_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
}
else
- {
+ {
nfapi_rssi_request_t req;
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "RSSI.request received\n");
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
// unpack the message
if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
@@ -1143,10 +1143,10 @@ void pnf_handle_rssi_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
-
+
}
}
@@ -1159,11 +1159,11 @@ void pnf_handle_cell_search_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
nfapi_cell_search_request_t req;
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "CELL_SEARCH.request received\n");
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
if(config->state == NFAPI_PNF_RUNNING)
@@ -1212,7 +1212,7 @@ void pnf_handle_cell_search_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
}
@@ -1231,9 +1231,9 @@ void pnf_handle_broadcast_detect_request(pnf_t* pnf, void *pRecvMsg, int recvMsg
nfapi_broadcast_detect_request_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "BROADCAST_DETECT.request received\n");
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
if(config->state == NFAPI_PNF_RUNNING)
@@ -1282,7 +1282,7 @@ void pnf_handle_broadcast_detect_request(pnf_t* pnf, void *pRecvMsg, int recvMsg
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
@@ -1298,11 +1298,11 @@ void pnf_handle_system_information_schedule_request(pnf_t* pnf, void *pRecvMsg,
else
{
nfapi_system_information_schedule_request_t req;
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "SYSTEM_INFORMATION_SCHEDULE.request received\n");
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
if(config->state == NFAPI_PNF_RUNNING)
@@ -1351,7 +1351,7 @@ void pnf_handle_system_information_schedule_request(pnf_t* pnf, void *pRecvMsg,
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
}
@@ -1368,9 +1368,9 @@ void pnf_handle_system_information_request(pnf_t* pnf, void *pRecvMsg, int recvM
nfapi_system_information_request_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "SYSTEM_INFORMATION.request received\n");
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
if(config->state == NFAPI_PNF_RUNNING)
@@ -1419,7 +1419,7 @@ void pnf_handle_system_information_request(pnf_t* pnf, void *pRecvMsg, int recvM
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
}
@@ -1435,11 +1435,11 @@ void pnf_handle_nmm_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
else
{
nfapi_nmm_stop_request_t req;
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "NMM_STOP.request received\n");
-
+
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
if (nfapi_p4_message_unpack(pRecvMsg, recvMsgLen, &req, sizeof(req), &config->codec_config) >= 0)
{
if(config->state == NFAPI_PNF_RUNNING)
@@ -1488,7 +1488,7 @@ void pnf_handle_nmm_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(req.vendor_extension)
pnf->_public.codec_config.deallocate(req.vendor_extension);
}
@@ -1504,21 +1504,21 @@ void pnf_handle_vendor_extension(void* pRecvMsg, int recvMsgLen, pnf_t* pnf, uin
else
{
nfapi_pnf_config_t* config = &(pnf->_public);
-
+
if(config->allocate_p4_p5_vendor_ext)
{
uint16_t msg_size;
nfapi_p4_p5_message_header_t* msg = config->allocate_p4_p5_vendor_ext(message_id, &msg_size);
-
+
if(msg == 0)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to allocate vendor extention structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate vendor extention structure\n");
return;
}
-
-
+
+
int unpack_result = nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, msg, msg_size, &config->codec_config);
-
+
if(unpack_result == 0)
{
if(config->vendor_ext)
@@ -1528,10 +1528,10 @@ void pnf_handle_vendor_extension(void* pRecvMsg, int recvMsgLen, pnf_t* pnf, uin
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
}
-
+
if(config->deallocate_p4_p5_vendor_ext)
config->deallocate_p4_p5_vendor_ext(msg);
-
+
}
}
}
@@ -1732,8 +1732,8 @@ void pnf_handle_p5_message(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
int pnf_nr_pack_and_send_p5_message(pnf_t* pnf, nfapi_p4_p5_message_header_t* msg, uint32_t msg_len)
{
int packed_len = nfapi_nr_p5_message_pack(msg, msg_len,
- pnf->tx_message_buffer,
- sizeof(pnf->tx_message_buffer),
+ pnf->tx_message_buffer,
+ sizeof(pnf->tx_message_buffer),
&pnf->_public.codec_config);
if (packed_len < 0)
@@ -1749,8 +1749,8 @@ int pnf_nr_pack_and_send_p5_message(pnf_t* pnf, nfapi_p4_p5_message_header_t* ms
int pnf_pack_and_send_p5_message(pnf_t* pnf, nfapi_p4_p5_message_header_t* msg, uint32_t msg_len)
{
int packed_len = nfapi_p5_message_pack(msg, msg_len,
- pnf->tx_message_buffer,
- sizeof(pnf->tx_message_buffer),
+ pnf->tx_message_buffer,
+ sizeof(pnf->tx_message_buffer),
&pnf->_public.codec_config);
if (packed_len < 0)
@@ -1765,8 +1765,8 @@ int pnf_pack_and_send_p5_message(pnf_t* pnf, nfapi_p4_p5_message_header_t* msg,
int pnf_pack_and_send_p4_message(pnf_t* pnf, nfapi_p4_p5_message_header_t* msg, uint32_t msg_len)
{
int packed_len = nfapi_p4_message_pack(msg, msg_len,
- pnf->tx_message_buffer,
- sizeof(pnf->tx_message_buffer),
+ pnf->tx_message_buffer,
+ sizeof(pnf->tx_message_buffer),
&pnf->_public.codec_config);
if (packed_len < 0)
@@ -1797,14 +1797,14 @@ int pnf_connect(pnf_t* pnf)
NFAPI_TRACE(NFAPI_TRACE_INFO, "Starting P5 PNF connection to VNF at %s:%u\n", pnf->_public.vnf_ip_addr, pnf->_public.vnf_p5_port);
// todo split the vnf address list. currently only supporting 1
-
+
struct addrinfo hints, *servinfo;
memset(&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_STREAM; // For SCTP we are only interested in SOCK_STREAM
// todo : allow the client to restrict IPV4 or IPV6
// todo : randomize which address to connect to?
-
+
char port_str[8];
snprintf(port_str, sizeof(port_str), "%d", pnf->_public.vnf_p5_port);
if(getaddrinfo(pnf->_public.vnf_ip_addr, port_str, &hints, &servinfo) != 0)
@@ -1822,7 +1822,7 @@ int pnf_connect(pnf_t* pnf)
char* family = "Unknown";
char* address = "Unknown";
char _addr[128];
-
+
if(p->ai_family == AF_INET6)
{
family = "IPV6";
@@ -1886,7 +1886,7 @@ int pnf_connect(pnf_t* pnf)
}
else
{
- // Create an IP socket point
+ // Create an IP socket point
if ((pnf->p5_sock = socket(p->ai_family, SOCK_STREAM, IPPROTO_IP)) < 0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After P5 socket errno: %d\n", errno);
@@ -1894,12 +1894,12 @@ int pnf_connect(pnf_t* pnf)
return -1;
}
}
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "P5 socket created...\n");
-
+
if (connect(pnf->p5_sock, p->ai_addr, p->ai_addrlen ) < 0)
{
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "After connect (address:%s port:%d) errno: %d\n",
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "After connect (address:%s port:%d) errno: %d\n",
pnf->_public.vnf_ip_addr, pnf->_public.vnf_p5_port, errno);
if(errno == EINVAL)
@@ -1970,14 +1970,16 @@ int pnf_connect(pnf_t* pnf)
int pnf_send_message(pnf_t* pnf, uint8_t *msg, uint32_t len, uint16_t stream)
{
-
+
if (pnf->sctp)
{
+#if 0
printf("\nPNF SENDS: \n");
for(int i=0; ip5_sock, msg, len, NULL, 0, 42/*config->sctp_stream_number*/, 0, stream/*P5_STREAM_ID*/, 0, 0) < 0)
{
@@ -2069,12 +2071,14 @@ int pnf_read_dispatch_message(pnf_t* pnf)
}
else
{
+#if 0
// print the received message
printf("\n MESSAGE RECEIVED: \n");
for(int i=0; ip5_sock+1, &rfds, NULL, NULL, &timeout);
if(selectRetval == 0)
- {
+ {
// timeout
continue;
}
@@ -2336,7 +2342,7 @@ int pnf_nr_message_pump(pnf_t* pnf)
selectRetval = select(pnf->p5_sock+1, &rfds, NULL, NULL, &timeout);
if(selectRetval == 0)
- {
+ {
// timeout
continue;
}
@@ -2376,4 +2382,3 @@ int pnf_nr_message_pump(pnf_t* pnf)
return 0;
}
-
diff --git a/nfapi/open-nFAPI/pnf/src/pnf_interface.c b/nfapi/open-nFAPI/pnf/src/pnf_interface.c
index 8c9722c13e..a53604640c 100644
--- a/nfapi/open-nFAPI/pnf/src/pnf_interface.c
+++ b/nfapi/open-nFAPI/pnf/src/pnf_interface.c
@@ -1,12 +1,12 @@
/*
* Copyright 2017 Cisco Systems, Inc.
- *
+ *
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -32,11 +32,11 @@ nfapi_pnf_config_t* nfapi_pnf_config_create()
memset(_this, 0, sizeof(pnf_t));
_this->sctp = 1; // enable sctp
-
+
_this->_public.vnf_p5_port = NFAPI_P5_SCTP_PORT;
-
+
_this->_public.malloc = &malloc;
- _this->_public.free = &free;
+ _this->_public.free = &free;
_this->_public.codec_config.allocate = &malloc;
_this->_public.codec_config.deallocate = &free;
@@ -55,10 +55,6 @@ int nfapi_pnf_start(nfapi_pnf_config_t* config)
if(config == 0)
return -1;
- // Make sure to set the defined trace function before using NFAPI_TRACE
- if(config->trace)
- nfapi_trace_g = config->trace;
-
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
pnf_t* _this = (pnf_t*)(config);
@@ -89,10 +85,6 @@ int nfapi_nr_pnf_start(nfapi_pnf_config_t* config)
if(config == 0)
return -1;
- // Make sure to set the defined trace function before using NFAPI_TRACE
- if(config->trace)
- nfapi_trace_g = config->trace;
-
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
pnf_t* _this = (pnf_t*)(config);
@@ -265,7 +257,7 @@ int nfapi_pnf_param_resp(nfapi_pnf_config_t* config, nfapi_param_response_t* res
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
return -1;
}
-
+
pnf_t* _this = (pnf_t*)(config);
return pnf_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_param_response_t));
@@ -279,7 +271,7 @@ int nfapi_nr_pnf_param_resp(nfapi_pnf_config_t* config, nfapi_nr_param_response_
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
return -1;
}
-
+
pnf_t* _this = (pnf_t*)(config);
return pnf_nr_pack_and_send_p5_message(_this, &(resp->header), sizeof(nfapi_nr_param_response_scf_t));
@@ -591,4 +583,3 @@ int nfapi_pnf_vendor_extension(nfapi_pnf_config_t* config, nfapi_p4_p5_message_h
return pnf_pack_and_send_p5_message(_this, msg, msg_len);
}
-
diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c
index 092b967189..fb1a713e56 100644
--- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c
+++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c
@@ -1060,6 +1060,23 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
(pnf_p7->_public.ul_dci_req_fn)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_slot.ul_dci_req);
}
}
+ if(tx_slot_buffer->ul_tti_req != 0)
+ {
+ if(pnf_p7->_public.ul_tti_req_fn)
+ {
+ (pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), tx_slot_buffer->ul_tti_req);
+ }
+ }
+ else
+ {
+ // send dummy
+ if(pnf_p7->_public.ul_tti_req_fn && pnf_p7->_public.dummy_slot.ul_tti_req)
+ {
+ pnf_p7->_public.dummy_slot.ul_tti_req->SFN = sfn_tx;
+ pnf_p7->_public.dummy_slot.ul_tti_req->Slot = slot_tx;
+ (pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_slot.ul_tti_req);
+ }
+ }
//deallocate slot buffers after passing down the PDUs to PHY processing
@@ -1585,7 +1602,7 @@ void pnf_handle_dl_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
if(req == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_dl_tti_request structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate nfapi_dl_tti_request structure\n");
return;
}
int unpack_result = nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, req, sizeof(nfapi_nr_dl_tti_request_t), &(pnf_p7->_public.codec_config));
@@ -1659,7 +1676,7 @@ void pnf_handle_dl_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_
if(req == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_dl_config_request structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate nfapi_dl_config_request structure\n");
return;
}
@@ -1750,7 +1767,7 @@ void pnf_handle_ul_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
if(req == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_ul_tti_request structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate nfapi_ul_tti_request structure\n");
return;
}
@@ -1825,7 +1842,7 @@ void pnf_handle_ul_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_
if(req == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_ul_config_request structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate nfapi_ul_config_request structure\n");
return;
}
@@ -1898,7 +1915,7 @@ void pnf_handle_ul_dci_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
if(req == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to allocate nfapi_ul_dci_request structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate nfapi_ul_dci_request structure\n");
return;
}
@@ -1969,7 +1986,7 @@ void pnf_handle_hi_dci0_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7
if(req == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_hi_dci0_request structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate nfapi_hi_dci0_request structure\n");
return;
}
@@ -2038,7 +2055,7 @@ void pnf_handle_tx_data_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7
if(req == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_tx_request structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate nfapi_tx_request structure\n");
return;
}
@@ -2118,7 +2135,7 @@ void pnf_handle_tx_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
if(req == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_tx_request structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate nfapi_tx_request structure\n");
return;
}
@@ -2192,7 +2209,7 @@ void pnf_handle_lbt_dl_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t*
if(req == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to alloced nfapi_lbt_dl_config_request structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate nfapi_lbt_dl_config_request structure\n");
return;
}
@@ -2255,7 +2272,7 @@ void pnf_handle_p7_vendor_extension(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pn
if(msg == 0)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to allocate vendor extention structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate vendor extention structure\n");
return;
}
@@ -2279,7 +2296,7 @@ void pnf_handle_ue_release_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf
nfapi_ue_release_request_t* req = allocate_nfapi_ue_release_request(pnf_p7);
if(req == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to alloced nfapi_ue_release_request structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "failed to allocate nfapi_ue_release_request structure\n");
return;
}
@@ -2381,7 +2398,7 @@ uint32_t calculate_nr_t2(uint32_t now_time_hr, uint16_t sfn,uint16_t slot, uint3
{
static uint32_t prev_t2 = 0;
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(now_time_hr:%u sfn:%d slot:%d slot_start_time_Hr:%u) slot_time_us:%u t2:%u prev_t2:%u diff:%u\n",
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(now_time_hr:%u sfn to slot:%d slot_start_time_Hr:%u) slot_time_us:%u t2:%u prev_t2:%u diff:%u\n",
__FUNCTION__,
now_time_hr, NFAPI_SFNSLOT2DEC(sfn, slot), slot_start_time_hr,
slot_time_us,
@@ -2656,7 +2673,7 @@ void pnf_handle_p7_message(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7, ui
// validate the input params
if(pRecvMsg == NULL || recvMsgLen < 4 || pnf_p7 == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "pnf_handle_p7_message: invalid input params (%d %d %d)\n", pRecvMsg, recvMsgLen, pnf_p7);
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "pnf_handle_p7_message: invalid input params (%p %d %p)\n", pRecvMsg, recvMsgLen, pnf_p7);
return;
}
@@ -2762,7 +2779,7 @@ void pnf_nr_handle_p7_message(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7,
// validate the input params
if(pRecvMsg == NULL || recvMsgLen < 4 || pnf_p7 == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "pnf_handle_p7_message: invalid input params (%d %d %d)\n", pRecvMsg, recvMsgLen, pnf_p7);
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "pnf_handle_p7_message: invalid input params (%p %d %p)\n", pRecvMsg, recvMsgLen, pnf_p7);
return;
}
@@ -2889,12 +2906,19 @@ void pnf_nfapi_p7_read_dispatch_message(pnf_p7_t* pnf_p7, uint32_t now_hr_time)
}
// read the segment
- recvfrom_result = recvfrom(pnf_p7->p7_sock, pnf_p7->rx_message_buffer, header.message_length, MSG_DONTWAIT, (struct sockaddr*)&remote_addr, &remote_addr_size);
+ recvfrom_result = recvfrom(pnf_p7->p7_sock, pnf_p7->rx_message_buffer, pnf_p7->rx_message_buffer_size,
+ MSG_DONTWAIT | MSG_TRUNC, (struct sockaddr*)&remote_addr, &remote_addr_size);
now_hr_time = pnf_get_current_time_hr(); //DJP - moved to here - get closer timestamp???
if(recvfrom_result > 0)
{
+ if (recvfrom_result != header.message_length)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "(%d) Received unexpected number of bytes. %d != %d",
+ __LINE__, recvfrom_result, header.message_length);
+ break;
+ }
pnf_handle_p7_message(pnf_p7->rx_message_buffer, recvfrom_result, pnf_p7, now_hr_time);
//printf("\npnf_handle_p7_message sfn=%d,slot=%d\n",pnf_p7->sfn,pnf_p7->slot);
}
@@ -3126,6 +3150,38 @@ int pnf_p7_message_pump(pnf_p7_t* pnf_p7)
return 0;
}
+struct timespec pnf_timespec_add(struct timespec lhs, struct timespec rhs)
+{
+ struct timespec result;
+
+ result.tv_sec = lhs.tv_sec + rhs.tv_sec;
+ result.tv_nsec = lhs.tv_nsec + rhs.tv_nsec;
+
+ if(result.tv_nsec > 1e9)
+ {
+ result.tv_sec++;
+ result.tv_nsec-= 1e9;
+ }
+
+ return result;
+}
+
+struct timespec pnf_timespec_sub(struct timespec lhs, struct timespec rhs)
+{
+ struct timespec result;
+ if ((lhs.tv_nsec-rhs.tv_nsec)<0)
+ {
+ result.tv_sec = lhs.tv_sec-rhs.tv_sec-1;
+ result.tv_nsec = 1000000000+lhs.tv_nsec-rhs.tv_nsec;
+ }
+ else
+ {
+ result.tv_sec = lhs.tv_sec-rhs.tv_sec;
+ result.tv_nsec = lhs.tv_nsec-rhs.tv_nsec;
+ }
+ return result;
+}
+
int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
{
@@ -3201,6 +3257,19 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
}
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF P7 bind succeeded...\n");
+ //Initializaing timing structures needed for slot ticking
+
+ struct timespec slot_start;
+ clock_gettime(CLOCK_MONOTONIC, &slot_start);
+
+ struct timespec pselect_start;
+
+ struct timespec slot_duration;
+ slot_duration.tv_sec = 0;
+ slot_duration.tv_nsec = 0.5e6;
+
+ //Infinite loop
+
while(pnf_p7->terminate == 0)
{
fd_set rfds;
@@ -3210,11 +3279,29 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
FD_ZERO(&rfds);
FD_SET(pnf_p7->p7_sock, &rfds);
- struct timeval timeout;
+ struct timespec timeout;
timeout.tv_sec = 100;
- timeout.tv_usec = 0;
+ timeout.tv_nsec = 0;
+ clock_gettime(CLOCK_MONOTONIC, &pselect_start);
- selectRetval = select(pnf_p7->p7_sock+1, &rfds, NULL, NULL, &timeout);
+ //setting the timeout
+
+ if((pselect_start.tv_sec > slot_start.tv_sec) || ((pselect_start.tv_sec == slot_start.tv_sec) && (pselect_start.tv_nsec > slot_start.tv_nsec)))
+ {
+ // overran the end of the subframe we do not want to wait
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 0;
+
+ //struct timespec overrun = pnf_timespec_sub(pselect_start, sf_start);
+ //NFAPI_TRACE(NFAPI_TRACE_INFO, "Subframe overrun detected of %d.%d running to catchup\n", overrun.tv_sec, overrun.tv_nsec);
+ }
+ else
+ {
+ // still time before the end of the subframe wait
+ timeout = pnf_timespec_sub(slot_start, pselect_start);
+ }
+
+ selectRetval = pselect(pnf_p7->p7_sock+1, &rfds, NULL, NULL, &timeout, NULL);
uint32_t now_hr_time = pnf_get_current_time_hr();
@@ -3224,6 +3311,17 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
if(selectRetval == 0)
{
// timeout
+
+ //update slot start timing
+ slot_start = pnf_timespec_add(slot_start, slot_duration);
+
+ //increment sfn/slot
+ if (++pnf_p7->slot == 20)
+ {
+ pnf_p7->slot = 0;
+ pnf_p7->sfn = (pnf_p7->sfn + 1) % 1024;
+ }
+
continue;
}
else if (selectRetval == -1 && (errno == EINTR))
@@ -3242,7 +3340,7 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
if(FD_ISSET(pnf_p7->p7_sock, &rfds))
{
- pnf_nr_nfapi_p7_read_dispatch_message(pnf_p7, now_hr_time);
+ pnf_nr_nfapi_p7_read_dispatch_message(pnf_p7, now_hr_time);
}
}
NFAPI_TRACE(NFAPI_TRACE_ERROR, "PNF_P7 Terminating..\n");
diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7_interface.c b/nfapi/open-nFAPI/pnf/src/pnf_p7_interface.c
index 0db1feb398..a1be4d0edc 100644
--- a/nfapi/open-nFAPI/pnf/src/pnf_p7_interface.c
+++ b/nfapi/open-nFAPI/pnf/src/pnf_p7_interface.c
@@ -44,6 +44,7 @@ nfapi_pnf_p7_config_t* nfapi_pnf_p7_config_create()
_this->_public.codec_config.allocate = &malloc;
_this->_public.codec_config.deallocate = &free;
+ // cppcheck-suppress memleak
return &(_this->_public);
}
@@ -63,10 +64,6 @@ int nfapi_pnf_p7_start(nfapi_pnf_p7_config_t* config)
if(config == 0)
return -1;
- // Make sure to set the defined trace function before using NFAPI_TRACE
- if(config->trace)
- nfapi_trace_g = config->trace;
-
pnf_p7_t* _this = (pnf_p7_t*)(config);
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
@@ -82,10 +79,6 @@ int nfapi_nr_pnf_p7_start(nfapi_pnf_p7_config_t* config)
if(config == 0)
return -1;
- // Make sure to set the defined trace function before using NFAPI_TRACE
- if(config->trace)
- nfapi_trace_g = config->trace;
-
pnf_p7_t* _this = (pnf_p7_t*)(config);
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
@@ -175,17 +168,7 @@ int nfapi_pnf_p7_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_rach_indication_t
pnf_p7_t* _this = (pnf_p7_t*)(config);
return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_rach_indication_t));
}
-int nfapi_pnf_p7_srs_ind(nfapi_pnf_p7_config_t* config, nfapi_srs_indication_t* ind)
-{
- if(config == NULL || ind == NULL)
- {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
- return -1;
- }
- pnf_p7_t* _this = (pnf_p7_t*)(config);
- return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_srs_indication_t));
-}
int nfapi_pnf_p7_sr_ind(nfapi_pnf_p7_config_t* config, nfapi_sr_indication_t* ind)
{
if(config == NULL || ind == NULL)
diff --git a/nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp b/nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp
index 1c2f0bef80..4fe5065cea 100644
--- a/nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp
+++ b/nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp
@@ -278,7 +278,7 @@ void *fapi_thread_start(void *ptr) {
if(instance->tick == 1000) {
if(instance->tx_byte_count > 0) {
- printf("[FAPI] Tx rate %d bytes/sec\n", instance->tx_byte_count);
+ printf("[FAPI] Tx rate %u bytes/sec\n", instance->tx_byte_count);
instance->tx_byte_count = 0;
}
@@ -319,7 +319,7 @@ void *fapi_thread_start(void *ptr) {
millisec = now_ts.tv_nsec / 1e6;
if(last_millisec != -1 && ((last_millisec + 1 ) % 1000) != millisec) {
- printf("*** missing millisec %d %d\n", last_millisec, millisec);
+ printf("*** missing millisec %u %u\n", last_millisec, millisec);
catchup = millisec - last_millisec - 1;
}
diff --git a/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h b/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
index 31328393c9..decb48e5c8 100644
--- a/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
+++ b/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
@@ -20,6 +20,7 @@
#include "nfapi_interface.h"
#include "nfapi_nr_interface_scf.h"
#include "nfapi_nr_interface.h"
+#include "openair2/PHY_INTERFACE/queue_t.h"
#include "debug.h"
@@ -86,8 +87,6 @@ typedef struct nfapi_vnf_config
void* (*malloc)(size_t size);
/*! A user define callback to override the default memory deallocation */
void (*free)(void*);
- /*! A user define callback to handle trace from the pnf */
- void (*trace)(nfapi_trace_level_t level, const char* message, ...);
/*! The port the VNF P5 SCTP connection listens on
*
@@ -662,12 +661,6 @@ typedef struct nfapi_vnf_p7_config
* If not set the vnf p7 library will use free
*/
void (*free)(void*);
-
- /*! A user define callback to handle trace from the pnf
- * \param level The trace level
- * \param message The trace string
- */
- void (*trace)(nfapi_trace_level_t level, const char* message, ...);
/*! The port the vnf p7 will receive on */
int port;
@@ -908,7 +901,7 @@ void nfapi_vnf_p7_config_destory(nfapi_vnf_p7_config_t* config);
* This function is blocking and will not return until the nfapi_vnf_p7_stop
* function is called.
*/
-
+extern queue_t gnb_slot_ind_queue;
int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config);
int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config);
diff --git a/nfapi/open-nFAPI/vnf/src/vnf.c b/nfapi/open-nFAPI/vnf/src/vnf.c
index 7fee47d6d5..e0431ced17 100644
--- a/nfapi/open-nFAPI/vnf/src/vnf.c
+++ b/nfapi/open-nFAPI/vnf/src/vnf.c
@@ -85,7 +85,7 @@ void nfapi_vnf_pnf_list_add(nfapi_vnf_config_t* config, nfapi_vnf_pnf_info_t* no
nfapi_vnf_pnf_info_t* nfapi_vnf_pnf_list_find(nfapi_vnf_config_t* config, int p5_idx)
{
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s : config->pnf_list:%p\n", __FUNCTION__, config->pnf_list);
+ NFAPI_TRACE(NFAPI_TRACE_DEBUG, "config->pnf_list:%p\n", config->pnf_list);
nfapi_vnf_pnf_info_t* curr = config->pnf_list;
while(curr != 0)
@@ -1051,7 +1051,7 @@ void vnf_handle_vendor_extension(void* pRecvMsg, int recvMsgLen, nfapi_vnf_confi
}
else
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s failed to allocate vendor extention structure\n");
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to allocate vendor extention structure\n");
}
}
}
@@ -1383,6 +1383,7 @@ int vnf_read_dispatch_message(nfapi_vnf_config_t* config, nfapi_vnf_pnf_info_t*
uint32_t header_buffer_size = NFAPI_HEADER_LENGTH;
uint8_t header_buffer[header_buffer_size];
+ memset(header_buffer, 0, header_buffer_size);
uint32_t stack_buffer_size = 32; //should it be the size of then sctp_notificatoin structure
uint8_t stack_buffer[stack_buffer_size];
@@ -1393,6 +1394,7 @@ int vnf_read_dispatch_message(nfapi_vnf_config_t* config, nfapi_vnf_pnf_info_t*
uint32_t message_size = 0;
struct sockaddr_in addr;
+ memset(&addr, 0, sizeof(addr));
socklen_t addr_len = sizeof(addr);
struct sctp_sndrcvinfo sndrcvinfo;
diff --git a/nfapi/open-nFAPI/vnf/src/vnf_interface.c b/nfapi/open-nFAPI/vnf/src/vnf_interface.c
index 084c4fa485..633dd18f24 100644
--- a/nfapi/open-nFAPI/vnf/src/vnf_interface.c
+++ b/nfapi/open-nFAPI/vnf/src/vnf_interface.c
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#include
@@ -69,10 +70,6 @@ int nfapi_nr_vnf_start(nfapi_vnf_config_t* config)
if(config == 0)
return -1;
- // Make sure to set the defined trace function before using NFAPI_TRACE
- if(config->trace)
- nfapi_trace_g = (nfapi_trace_fn_t)config->trace;
-
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
int p5ListenSock, p5Sock;
@@ -218,7 +215,7 @@ int nfapi_nr_vnf_start(nfapi_vnf_config_t* config)
initMsg.sinit_max_instreams = 5; //MAX_SCTP_STREAMS; // number of output streams can be greater
if (setsockopt(p5ListenSock, IPPROTO_SCTP, SCTP_INITMSG, &initMsg, sizeof(initMsg)) < 0)
{
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (SCTP_INITMSG) errno: %d\n", errno)
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (SCTP_INITMSG) errno: %d\n", errno);
close(p5ListenSock);
return 0;
}
@@ -477,14 +474,7 @@ int nfapi_nr_vnf_start(nfapi_vnf_config_t* config)
int nfapi_vnf_start(nfapi_vnf_config_t* config)
{
- // Verify that config is not null
- if(config == 0)
- return -1;
-
- // Make sure to set the defined trace function before using NFAPI_TRACE
- if(config->trace)
- nfapi_trace_g = (nfapi_trace_fn_t)config->trace;
-
+ assert(config != 0);
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()\n", __FUNCTION__);
int p5ListenSock, p5Sock;
@@ -630,7 +620,7 @@ int nfapi_vnf_start(nfapi_vnf_config_t* config)
initMsg.sinit_max_instreams = 5; //MAX_SCTP_STREAMS; // number of output streams can be greater
if (setsockopt(p5ListenSock, IPPROTO_SCTP, SCTP_INITMSG, &initMsg, sizeof(initMsg)) < 0)
{
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (SCTP_INITMSG) errno: %d\n", errno)
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (SCTP_INITMSG) errno: %d\n", errno);
close(p5ListenSock);
return 0;
}
@@ -1164,7 +1154,7 @@ int nfapi_vnf_allocate_phy(nfapi_vnf_config_t* config, int p5_idx, uint16_t* phy
info->timing_window = 30; // This seems to override what gets set by the user - why??? //TODO: Change in NR in terms of microsecends,what should be the value?
info->timing_info_mode = 0x03;
- info->timing_info_period = 128;
+ info->timing_info_period = 10;
nfapi_vnf_phy_info_list_add(config, info);
diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7.c b/nfapi/open-nFAPI/vnf/src/vnf_p7.c
index e390031554..2ac59dd7be 100644
--- a/nfapi/open-nFAPI/vnf/src/vnf_p7.c
+++ b/nfapi/open-nFAPI/vnf/src/vnf_p7.c
@@ -17,14 +17,21 @@
#include
+#include
#include
#include
#include
#include
#include
#include
+#include
+
#include "vnf_p7.h"
+#ifdef NDEBUG
+# warning assert is disabled
+#endif
+
#define SYNC_CYCLE_COUNT 2
void* vnf_p7_malloc(vnf_p7_t* vnf_p7, size_t size)
@@ -816,11 +823,6 @@ void vnf_handle_rx_ulsch_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vn
}
}
- uint16_t i = 0;
- for(i = 0; i < ind.rx_indication_body.number_of_pdus; ++i)
- {
- vnf_p7_codec_free(vnf_p7, ind.rx_indication_body.rx_pdu_list[i].data);
- }
vnf_p7_codec_free(vnf_p7, ind.rx_indication_body.rx_pdu_list);
vnf_p7_codec_free(vnf_p7, ind.vendor_extension);
}
@@ -1157,7 +1159,7 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
- NFAPI_TRACE(NFAPI_TRACE_INFO, "(%4d/%1d) %d.%d PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n",
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "(%4d/%1d) %ld.%ld PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n",
NFAPI_SFNSF2SFN(phy->sfn_sf), NFAPI_SFNSF2SF(phy->sfn_sf), ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
ind.t1, ind.t2, ind.t3, t4,
tx_2_rx, pnf_proc_time, latency, phy->average_latency, phy->sf_offset, phy->sf_offset_filtered,
@@ -1292,7 +1294,7 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "VNF P7 In Sync with phy (phy_id:%d)\n", phy->phy_id);
if(vnf_p7->_public.sync_indication)
- (vnf_p7->_public.sync_indication)(&(vnf_p7->_public), 1);
+ (vnf_p7->_public.sync_indication)(&(vnf_p7->_public), phy->in_sync);
}
phy->in_sync = 1;
@@ -1471,7 +1473,8 @@ void vnf_handle_nr_slot_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf
}
else
{
- if(vnf_p7->_public.nr_slot_indication)
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling NR SLOT Indication\n", __FUNCTION__);
+ if(vnf_p7->_public.nr_slot_indication)
{
(vnf_p7->_public.nr_slot_indication)(&ind);
}
@@ -1496,12 +1499,12 @@ void vnf_handle_nr_rx_data_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t*
}
else
{
- if(vnf_p7->_public.nr_rx_data_indication)
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling RX Indication\n", __FUNCTION__);
+ if(vnf_p7->_public.nr_rx_data_indication)
{
(vnf_p7->_public.nr_rx_data_indication)(&ind);
}
}
-
}
}
@@ -1522,12 +1525,12 @@ void vnf_handle_nr_crc_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_
}
else
{
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling CRC Indication\n", __FUNCTION__);
if(vnf_p7->_public.nr_crc_indication)
- {
+ {
(vnf_p7->_public.nr_crc_indication)(&ind);
}
}
-
}
}
@@ -1573,12 +1576,12 @@ void vnf_handle_nr_uci_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_
}
else
{
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling UCI Indication\n", __FUNCTION__);
if(vnf_p7->_public.nr_uci_indication)
{
(vnf_p7->_public.nr_uci_indication)(&ind);
}
}
-
}
}
@@ -1599,12 +1602,12 @@ void vnf_handle_nr_rach_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf
}
else
{
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling RACH Indication\n", __FUNCTION__);
if(vnf_p7->_public.nr_rach_indication)
{
(vnf_p7->_public.nr_rach_indication)(&ind);
}
}
-
}
}
@@ -1699,14 +1702,7 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
}
if (phy->filtered_adjust && (phy->slot_offset_filtered > 1e6 || phy->slot_offset_filtered < -1e6))
- { struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
- NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%1d) %d.%d PNF to VNF phy_id:%2d (t1/2/3/4:%8u, %8u, %8u, %8u) txrx:%4u procT:%3u latency(us):%4d(avg:%4d) offset(us):%8d filtered(us):%8d wrap[t1:%u t2:%u]\n",
- phy->sfn, phy->slot, ts.tv_sec, ts.tv_nsec, ind.header.phy_id,
- ind.t1, ind.t2, ind.t3, t4,
- tx_2_rx, pnf_proc_time, latency, phy->average_latency, phy->slot_offset, phy->slot_offset_filtered,
- (ind.t1previous_t1), (ind.t2previous_t2));
-
+ {
phy->filtered_adjust = 0;
phy->zero_count=0;
phy->min_sync_cycle_count = 2;
@@ -1738,7 +1734,7 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
sfn_slot_dec += (phy->slot_offset / 500);
- //NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF slot offset:%d sfn :%d slot:%d \n",phy->slot_offset,NFAPI_SFNSLOTDEC2SFN(sfn_slot_dec),NFAPI_SFNSLOTDEC2SLOT(sfn_slot_dec) );
+ NFAPI_TRACE(NFAPI_TRACE_NOTE, "PNF to VNF slot offset:%d sfn :%d slot:%d \n",phy->slot_offset,NFAPI_SFNSLOTDEC2SFN(sfn_slot_dec),NFAPI_SFNSLOTDEC2SLOT(sfn_slot_dec) );
}
@@ -1838,7 +1834,7 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
NFAPI_TRACE(NFAPI_TRACE_NOTE, "VNF P7 In Sync with phy (phy_id:%d)\n", phy->phy_id);
if(vnf_p7->_public.sync_indication)
- (vnf_p7->_public.sync_indication)(&(vnf_p7->_public), 1);
+ (vnf_p7->_public.sync_indication)(&(vnf_p7->_public), phy->in_sync);
}
phy->in_sync = 1;
@@ -2032,6 +2028,7 @@ void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
}
}
+int16_t vnf_pnf_sfnslot_delta;
void vnf_nr_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
{
@@ -2051,18 +2048,21 @@ void vnf_nr_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
if (vnf_p7 && vnf_p7->p7_connections)
{
//int16_t vnf_pnf_sfnsf_delta = NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf) - NFAPI_SFNSF2DEC(ind.last_sfn_sf);
- int16_t vnf_pnf_sfnslot_delta = NFAPI_SFNSLOT2DEC(vnf_p7->p7_connections[0].sfn,vnf_p7->p7_connections[0].slot) - NFAPI_SFNSLOT2DEC(ind.last_sfn,ind.last_slot);
+ vnf_pnf_sfnslot_delta = NFAPI_SFNSLOT2DEC(vnf_p7->p7_connections[0].sfn,vnf_p7->p7_connections[0].slot) - NFAPI_SFNSLOT2DEC(ind.last_sfn,ind.last_slot);
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PNF:SFN/SF:%d VNF:SFN/SF:%d deltaSFNSF:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind.last_sfn_sf), NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), vnf_pnf_sfnsf_delta);
// Panos: Careful here!!! Modification of the original nfapi-code
//if (vnf_pnf_sfnsf_delta>1 || vnf_pnf_sfnsf_delta < -1)
//printf("VNF-PNF delta - %d", vnf_pnf_sfnslot_delta);
- if (vnf_pnf_sfnslot_delta>0 || vnf_pnf_sfnslot_delta < 0)
+ if (vnf_pnf_sfnslot_delta != 0)
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF delta:%d VNF:%d PNF:%d\n\n\n\n\n\n\n\n\n", __FUNCTION__, vnf_pnf_sfnslot_delta,NFAPI_SFNSLOT2DEC(vnf_p7->p7_connections[0].sfn,vnf_p7->p7_connections[0].slot),NFAPI_SFNSLOT2DEC(ind.last_sfn,ind.last_slot)) ;
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SLOT DELTA between PNF and VNF. Delta %d. PNF:%d.%d VNF:%d.%d\n\n\n\n\n\n\n\n\n",
+ __FUNCTION__, vnf_pnf_sfnslot_delta,
+ ind.last_sfn, ind.last_slot,
+ vnf_p7->p7_connections[0].sfn, vnf_p7->p7_connections[0].slot);
// Panos: Careful here!!! Modification of the original nfapi-code
- // vnf_p7->p7_connections[0].sfn = ind.last_sfn;
- // vnf_p7->p7_connections[0].slot = ind.last_slot;
+ vnf_p7->p7_connections[0].sfn = ind.last_sfn;
+ vnf_p7->p7_connections[0].slot = ind.last_slot;
}
}
}
@@ -2248,7 +2248,7 @@ void vnf_handle_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
// validate the input params
if(pRecvMsg == NULL || recvMsgLen < 4 || vnf_p7 == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_p7_message: invalid input params (%d %d %d)\n", pRecvMsg, recvMsgLen, vnf_p7);
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_p7_message: invalid input params (%p %d %p)\n", pRecvMsg, recvMsgLen, vnf_p7);
return;
}
@@ -2366,7 +2366,7 @@ void vnf_nr_handle_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
// validate the input params
if(pRecvMsg == NULL || recvMsgLen < 4 || vnf_p7 == NULL)
{
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_p7_message: invalid input params (%d %d %d)\n", pRecvMsg, recvMsgLen, vnf_p7);
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "vnf_handle_p7_message: invalid input params (%p %d %p)\n", pRecvMsg, recvMsgLen, vnf_p7);
return;
}
@@ -2508,26 +2508,22 @@ int vnf_nr_p7_read_dispatch_message(vnf_p7_t* vnf_p7)
}
// read the segment
- recvfrom_result = recvfrom(vnf_p7->socket, vnf_p7->rx_message_buffer, header.message_length, MSG_WAITALL, (struct sockaddr*)&remote_addr, &remote_addr_size);
+ recvfrom_result = recvfrom(vnf_p7->socket, vnf_p7->rx_message_buffer, header.message_length, MSG_WAITALL | MSG_TRUNC, (struct sockaddr*)&remote_addr, &remote_addr_size);
+ NFAPI_TRACE(NFAPI_TRACE_DEBUG, "recvfrom_result = %d from %s():%d\n", recvfrom_result, __FUNCTION__, __LINE__);
// todo : how to handle incomplete readfroms, need some sort of buffer/select
- if(recvfrom_result == 0)
- {
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "recvfrom returned 0\n");
- }
- else if(recvfrom_result != header.message_length)
- {
- NFAPI_TRACE(NFAPI_TRACE_NOTE, "did not receive the entire message %d %d\n", recvfrom_result, header.message_length);
-
- recvfrom_result += recvfrom(vnf_p7->socket, &vnf_p7->rx_message_buffer[recvfrom_result], header.message_length - recvfrom_result, MSG_WAITALL, (struct sockaddr*)&remote_addr, &remote_addr_size);
-
- }
-
-
- if(recvfrom_result > 0)
+ if (recvfrom_result > 0)
{
+ if (recvfrom_result != header.message_length)
+ {
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "(%d) Received unexpected number of bytes. %d != %d",
+ __LINE__, recvfrom_result, header.message_length);
+ break;
+ }
+ NFAPI_TRACE(NFAPI_TRACE_DEBUG, "Calling vnf_nr_handle_p7_message from %d\n", __LINE__);
vnf_nr_handle_p7_message(vnf_p7->rx_message_buffer, recvfrom_result, vnf_p7);
+ return 0;
}
else
{
@@ -2592,9 +2588,9 @@ int vnf_p7_read_dispatch_message(vnf_p7_t* vnf_p7)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "recvfrom returned 0\n");
}
- else if(recvfrom_result != header.message_length)
+ else if(recvfrom_result != -1 && recvfrom_result != header.message_length)
{
- NFAPI_TRACE(NFAPI_TRACE_NOTE, "did not receive the entire message %d %d\n", recvfrom_result, header.message_length);
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "Received unexpected number of bytes %d %d\n", recvfrom_result, header.message_length);
recvfrom_result += recvfrom(vnf_p7->socket, &vnf_p7->rx_message_buffer[recvfrom_result], header.message_length - recvfrom_result, MSG_WAITALL, (struct sockaddr*)&remote_addr, &remote_addr_size);
@@ -2646,10 +2642,11 @@ void vnf_p7_release_msg(vnf_p7_t* vnf_p7, nfapi_p7_message_header_t* header)
case NFAPI_RX_ULSCH_INDICATION:
{
nfapi_rx_indication_t* rx_ind = (nfapi_rx_indication_t*)(header);
- uint16_t i = 0;
- for(i = 0; i < rx_ind->rx_indication_body.number_of_pdus; ++i)
+ size_t number_of_pdus = rx_ind->rx_indication_body.number_of_pdus;
+ assert(number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
+ for(size_t i = 0; i < number_of_pdus; ++i)
{
- vnf_p7_codec_free(vnf_p7, rx_ind->rx_indication_body.rx_pdu_list[i].data);
+ vnf_p7_codec_free(vnf_p7, rx_ind->rx_indication_body.rx_pdu_list[i].rx_ind_data);
}
vnf_p7_codec_free(vnf_p7, rx_ind->rx_indication_body.rx_pdu_list);
diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
index 8cebf2b468..852707fbbd 100644
--- a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
+++ b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c
@@ -1,12 +1,12 @@
/*
* Copyright 2017 Cisco Systems, Inc.
- *
+ *
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
+ *
* 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.
@@ -45,13 +45,13 @@ nfapi_vnf_p7_config_t* nfapi_vnf_p7_config_create()
_this->_public.segment_size = 1400;
_this->_public.max_num_segments = 8;
_this->_public.checksum_enabled = 1;
-
+
_this->_public.malloc = &malloc;
- _this->_public.free = &free;
+ _this->_public.free = &free;
_this->_public.codec_config.allocate = &malloc;
_this->_public.codec_config.deallocate = &free;
-
+
return (nfapi_vnf_p7_config_t*)_this;
}
@@ -81,12 +81,12 @@ struct timespec timespec_add(struct timespec lhs, struct timespec rhs)
struct timespec timespec_sub(struct timespec lhs, struct timespec rhs)
{
struct timespec result;
- if ((lhs.tv_nsec-rhs.tv_nsec)<0)
+ if ((lhs.tv_nsec-rhs.tv_nsec)<0)
{
result.tv_sec = lhs.tv_sec-rhs.tv_sec-1;
result.tv_nsec = 1000000000+lhs.tv_nsec-rhs.tv_nsec;
- }
- else
+ }
+ else
{
result.tv_sec = lhs.tv_sec-rhs.tv_sec;
result.tv_nsec = lhs.tv_nsec-rhs.tv_nsec;
@@ -94,7 +94,7 @@ struct timespec timespec_sub(struct timespec lhs, struct timespec rhs)
return result;
}
-// monitor the p7 endpoints and the timing loop and
+// monitor the p7 endpoints and the timing loop and
// send indications to mac
int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
{
@@ -107,9 +107,9 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
- // Create p7 receive udp port
+ // Create p7 receive udp port
// todo : this needs updating for Ipv6
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "Initialising VNF P7 port:%u\n", config->port);
// open the UDP socket
@@ -128,7 +128,7 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (IP_TOS) errno: %d\n", errno);
return -1;
}
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF P7 setsockopt succeeded...\n");
// Create the address structure
@@ -168,20 +168,34 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
// Add the p7 socket
FD_SET(vnf_p7->socket, &rfds);
maxSock = vnf_p7->socket;
-
+
struct timespec curr_time;
clock_gettime(CLOCK_MONOTONIC, &curr_time);
setup_time = curr_time.tv_sec - ref_time.tv_sec;
- if(setup_time > 10 && prev_slot != gNB->UL_INFO.slot){ //Give the VNF sufficient time to setup before starting scheduling
-
- //Call the scheduler
+ nfapi_nr_slot_indication_scf_t *slot_ind = get_queue(&gnb_slot_ind_queue);
+ NFAPI_TRACE(NFAPI_TRACE_DEBUG, "This is the slot_ind queue size %ld in %s():%d\n",
+ gnb_slot_ind_queue.num_items, __FUNCTION__, __LINE__);
+ if (slot_ind) {
pthread_mutex_lock(&gNB->UL_INFO_mutex);
- gNB->UL_INFO.module_id = gNB->Mod_id;
- gNB->UL_INFO.CC_id = gNB->CC_id;
- gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
+ gNB->UL_INFO.frame = slot_ind->sfn;
+ gNB->UL_INFO.slot = slot_ind->slot;
+
+ NFAPI_TRACE(NFAPI_TRACE_DEBUG, "gNB->UL_INFO.frame = %d and slot %d, prev_slot = %d, setup_time = %d\n",
+ gNB->UL_INFO.frame, gNB->UL_INFO.slot, prev_slot, setup_time);
+ if (setup_time > 3 && prev_slot != gNB->UL_INFO.slot) { //Give the VNF sufficient time to setup before starting scheduling && prev_slot != gNB->UL_INFO.slot
+
+ //Call the scheduler
+ gNB->UL_INFO.module_id = gNB->Mod_id;
+ gNB->UL_INFO.CC_id = gNB->CC_id;
+ NFAPI_TRACE(NFAPI_TRACE_DEBUG, "Calling NR_UL_indication for gNB->UL_INFO.frame = %d and slot %d\n",
+ gNB->UL_INFO.frame, gNB->UL_INFO.slot);
+ gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
+ prev_slot = gNB->UL_INFO.slot;
+ }
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
- prev_slot = gNB->UL_INFO.slot;
+ free(slot_ind);
+ slot_ind = NULL;
}
selectRetval = pselect(maxSock+1, &rfds, NULL, NULL, &pselect_timeout, NULL);
@@ -234,9 +248,9 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
- // Create p7 receive udp port
+ // Create p7 receive udp port
// todo : this needs updating for Ipv6
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "Initialising VNF P7 port:%u\n", config->port);
// open the UDP socket
@@ -255,7 +269,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
NFAPI_TRACE(NFAPI_TRACE_ERROR, "After setsockopt (IP_TOS) errno: %d\n", errno);
return -1;
}
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "VNF P7 setsockopt succeeded...\n");
// Create the address structure
@@ -299,7 +313,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
clock_gettime(CLOCK_MONOTONIC, &sf_start);
long millisecond = sf_start.tv_nsec / 1e6;
sf_start = timespec_add(sf_start, sf_duration);
- NFAPI_TRACE(NFAPI_TRACE_INFO, "next subframe will start at %d.%d\n", sf_start.tv_sec, sf_start.tv_nsec);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "next subframe will start at %ld.%ld\n", sf_start.tv_sec, sf_start.tv_nsec);
while(vnf_p7->terminate == 0)
{
@@ -311,7 +325,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
// Add the p7 socket
FD_SET(vnf_p7->socket, &rfds);
maxSock = vnf_p7->socket;
-
+
clock_gettime(CLOCK_MONOTONIC, &pselect_start);
//long millisecond = pselect_start.tv_nsec / 1e6;
@@ -320,7 +334,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
//NFAPI_TRACE(NFAPI_TRACE_INFO, "pselect_start:%d.%d sf_start:%d.%d\n", pselect_start.tv_sec, pselect_start.tv_nsec, sf_start.tv_sec, sf_start.tv_nsec);
- if((pselect_start.tv_sec > sf_start.tv_sec) ||
+ if((pselect_start.tv_sec > sf_start.tv_sec) ||
((pselect_start.tv_sec == sf_start.tv_sec) && (pselect_start.tv_nsec > sf_start.tv_nsec)))
{
// overran the end of the subframe we do not want to wait
@@ -343,7 +357,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
//pselect_timeout.tv_nsec = 1e6 - (pselect_start.tv_nsec % 1000000);
//uint8_t underrun_possible =0;
-
+
// if we are not sleeping until the next milisecond due to the
// insycn minor adjment flag it so we don't consider it an error
//uint8_t underrun_possible =0;
@@ -353,7 +367,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
if(phy && phy->in_sync && phy->insync_minor_adjustment != 0 && phy->insync_minor_adjustment_duration > 0 && pselect_start.tv_nsec != 0)
{
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] Subframe minor adjustment %d (%d->%d)\n", phy->insync_minor_adjustment,
- pselect_timeout.tv_nsec, pselect_timeout.tv_nsec - (phy->insync_minor_adjustment * 1000))
+ pselect_timeout.tv_nsec, pselect_timeout.tv_nsec - (phy->insync_minor_adjustment * 1000))
if(phy->insync_minor_adjustment > 0)
{
// todo check we don't go below 0
@@ -376,7 +390,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
}
}
*/
-
+
//long wraps = pselect_timeout.tv_nsec % 1e9;
@@ -389,9 +403,9 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
if (selectRetval==-1 && errno == 22)
{
- NFAPI_TRACE(NFAPI_TRACE_ERROR, "INVAL: pselect_timeout:%d.%ld adj[dur:%d adj:%d], sf_dur:%d.%ld\n",
- pselect_timeout.tv_sec, pselect_timeout.tv_nsec,
- phy->insync_minor_adjustment_duration, phy->insync_minor_adjustment,
+ NFAPI_TRACE(NFAPI_TRACE_ERROR, "INVAL: pselect_timeout:%ld.%ld adj[dur:%d adj:%d], sf_dur:%ld.%ld\n",
+ pselect_timeout.tv_sec, pselect_timeout.tv_nsec,
+ phy->insync_minor_adjustment_duration, phy->insync_minor_adjustment,
sf_duration.tv_sec, sf_duration.tv_nsec);
}
if(selectRetval == 0)
@@ -449,7 +463,7 @@ if (selectRetval==-1 && errno == 22)
//phy->insync_minor_adjustment = 0;
phy->insync_minor_adjustment_duration--;
- NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] AFTER adjustment - Subframe minor adjustment %dus sf_start.tv_nsec:%d duration:%u\n",
+ NFAPI_TRACE(NFAPI_TRACE_NOTE, "[VNF] AFTER adjustment - Subframe minor adjustment %dus sf_start.tv_nsec:%ld duration:%u\n",
phy->insync_minor_adjustment, sf_start.tv_nsec, phy->insync_minor_adjustment_duration);
if (phy->insync_minor_adjustment_duration==0)
@@ -473,7 +487,7 @@ if (selectRetval==-1 && errno == 22)
}
last_millisecond = millisecond;
*/
-
+
millisecond ++;
}
}
@@ -497,9 +511,7 @@ if (selectRetval==-1 && errno == 22)
while(curr != 0)
{
curr->sfn_sf = increment_sfn_sf(curr->sfn_sf);
-
vnf_sync(vnf_p7, curr);
-
curr = curr->next;
}
@@ -523,7 +535,7 @@ if (selectRetval==-1 && errno == 22)
}
else
{
- NFAPI_TRACE(NFAPI_TRACE_INFO, "P7 select failed result %d errno %d timeout:%d.%d orginal:%d.%d last_ms:%ld ms:%ld\n", selectRetval, errno, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, last_millisecond, millisecond);
+ NFAPI_TRACE(NFAPI_TRACE_INFO, "P7 select failed result %d errno %d timeout:%ld.%ld orginal:%ld.%ld last_ms:%ld ms:%ld\n", selectRetval, errno, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, last_millisecond, millisecond);
// should we exit now?
if (selectRetval == -1 && errno == 22) // invalid argument??? not sure about timeout duration
{
@@ -534,7 +546,7 @@ if (selectRetval==-1 && errno == 22)
}
-
+
NFAPI_TRACE(NFAPI_TRACE_INFO, "Closing p7 socket\n");
close(vnf_p7->socket);
diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c
index 1daeb72187..308a059d51 100644
--- a/openair1/PHY/INIT/lte_init.c
+++ b/openair1/PHY/INIT/lte_init.c
@@ -106,7 +106,7 @@ void phy_config_request(PHY_Config_t *phy_config) {
int Ncp = cfg->subframe_config.dl_cyclic_prefix_type.value;
int p_eNB = cfg->rf_config.tx_antenna_ports.value;
uint32_t dl_CarrierFreq = cfg->nfapi_config.earfcn.value;
- LOG_I(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d, N_RB_UL %d, Nid_cell %d,eNB_tx_antenna_ports %d,Ncp %d,DL freq %u,phich_config.resource %d, phich_config.duration %d)\n",
+ LOG_A(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d, N_RB_UL %d, Nid_cell %d,eNB_tx_antenna_ports %d,Ncp %d,DL freq %u,phich_config.resource %d, phich_config.duration %d)\n",
Mod_id, CC_id, eutra_band, dl_Bandwidth, ul_Bandwidth, Nid_cell, p_eNB,Ncp,dl_CarrierFreq,
cfg->phich_config.phich_resource.value,
cfg->phich_config.phich_duration.value);
diff --git a/openair1/PHY/INIT/lte_init_ue.c b/openair1/PHY/INIT/lte_init_ue.c
index b756735816..c3f09fa78c 100644
--- a/openair1/PHY/INIT/lte_init_ue.c
+++ b/openair1/PHY/INIT/lte_init_ue.c
@@ -548,7 +548,7 @@ void phy_config_dedicated_ue(module_id_t Mod_id,int CC_id,uint8_t eNB_id,
phy_vars_ue->decode_MIB = 0;
}
- if(NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
+ if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) {
//phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
if(phy_vars_ue->pdcch_vars[0][eNB_id]->crnti == 0x1234)
phy_vars_ue->pdcch_vars[0][eNB_id]->crnti = phy_vars_ue->pdcch_vars[1][eNB_id]->crnti;
diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c
index cd4848ea8c..9e1e472fd6 100644
--- a/openair1/PHY/INIT/nr_init.c
+++ b/openair1/PHY/INIT/nr_init.c
@@ -487,7 +487,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
LOG_I(PHY, "DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %d Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, fp->nr_band, dlul_offset);
fp->threequarter_fs = openair0_cfg[0].threequarter_fs;
- LOG_I(PHY,"Configuring MIB for instance %d, : (Nid_cell %d,DL freq %llu, UL freq %llu)\n",
+ LOG_A(PHY,"Configuring MIB for instance %d, : (Nid_cell %d,DL freq %llu, UL freq %llu)\n",
Mod_id,
gNB_config->cell_config.phy_cell_id.value,
(unsigned long long)fp->dl_CarrierFreq,
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
index aba4a464f2..c6b312cc61 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
@@ -2921,6 +2921,9 @@ int allocate_REs_in_RB_MCH_khz_1dot25(int32_t **txdataF,
uint8_t skip_dc,
LTE_DL_FRAME_PARMS *frame_parms)
{
+ if (!qam_table_s)
+ abort();
+
uint32_t tti_offset;
uint8_t re,offset;
uint8_t qam64_table_offset_re = 0;
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
index 6afd028099..a7054a44d2 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
@@ -370,7 +370,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
- LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot,symbol,
+ LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot,symbol,
ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
#endif
#if UE_TIMING_TRACE
@@ -398,7 +398,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
- LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
#endif
@@ -507,7 +507,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
#endif
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
- LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,
+ LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,
ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
#endif
@@ -731,7 +731,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
- LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,
+ LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,
ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
#endif
@@ -805,7 +805,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
- LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0));
start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]);
#endif
//printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol);
diff --git a/openair1/PHY/NR_REFSIG/ptrs_nr.c b/openair1/PHY/NR_REFSIG/ptrs_nr.c
index b50c9a7bc9..d3d4bf0faf 100644
--- a/openair1/PHY/NR_REFSIG/ptrs_nr.c
+++ b/openair1/PHY/NR_REFSIG/ptrs_nr.c
@@ -105,14 +105,19 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
uint8_t L_ptrs,
uint16_t ul_dmrs_symb_pos) {
- uint8_t i = 0, last_symbol, is_dmrs_symbol, l_ref;
- int8_t l_counter;
+ uint i = 0, last_symbol, l_ref;
+ int l_counter;
l_ref = start_symbol;
last_symbol = start_symbol + duration_in_symbols - 1;
+ if (L_ptrs==0) {
+ LOG_E(PHY,"bug: impossible L_ptrs\n");
+ *ptrs_symbols = 0;
+ return;
+ }
while ( (l_ref + i*L_ptrs) <= last_symbol) {
- is_dmrs_symbol = 0;
+ int is_dmrs_symbol = 0;
for(l_counter = l_ref + i*L_ptrs; l_counter >= max(l_ref + (i-1)*L_ptrs + 1, l_ref); l_counter--) {
@@ -259,9 +264,13 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs,
uint16_t re_cnt = 0;
uint16_t cnt = 0;
unsigned short nb_re_pdsch = NR_NB_SC_PER_RB * nb_rb;
+ if (K_ptrs==0) {
+ LOG_E(PHY,"K_ptrs == 0\n");
+ return;
+ }
uint16_t sc_per_symbol = (nb_rb + K_ptrs - 1)/K_ptrs;
- int16_t *ptrs_p = (int16_t *)malloc(sizeof(int32_t)*(sc_per_symbol));
- int16_t *dmrs_comp_p = (int16_t *)malloc(sizeof(int32_t)*(sc_per_symbol));
+ int16_t *ptrs_p = (int16_t *)malloc(sizeof(int32_t)*((1 + sc_per_symbol/4)*4));
+ int16_t *dmrs_comp_p = (int16_t *)malloc(sizeof(int32_t)*((1 + sc_per_symbol/4)*4));
double abs = 0.0;
double real = 0.0;
double imag = 0.0;
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
index 5620018b73..afd1fc6e0d 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
@@ -213,7 +213,7 @@ void ldpc8blocks( void *p) {
for (int rr=impp->macro_num*8; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++ ) {
if (impp->F>0) {
// writing into positions d[r][k-2Zc] as in clause 5.3.2 step 2) in 38.212
- memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], impp->F, NR_NULL);
+ memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], NR_NULL, impp->F);
}
#ifdef DEBUG_DLSCH_CODING
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
index 26b45eb9f7..2dc21af0c5 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
@@ -32,6 +32,7 @@
*/
#include "nr_dlsch.h"
+#include "../../../nfapi/oai_integration/vendor_ext.h"
extern void set_taus_seed(unsigned int seed_type);
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
index 8bbf569814..5286fe8780 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
@@ -111,7 +111,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint
{
NR_gNB_ULSCH_t *ulsch;
- uint8_t exit_flag = 0,i,r;
+ uint8_t i,r;
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated
if (N_RB_UL != 273) {
@@ -120,68 +120,26 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint
}
uint16_t ulsch_bytes = a_segments*1056; // allocated bytes per segment
- ulsch = (NR_gNB_ULSCH_t *)malloc16(sizeof(NR_gNB_ULSCH_t));
-
- if (ulsch) {
-
- memset(ulsch,0,sizeof(NR_gNB_ULSCH_t));
-
- ulsch->max_ldpc_iterations = max_ldpc_iterations;
- ulsch->Mlimit = 4;
-
- for (i=0; iharq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16(sizeof(NR_UL_gNB_HARQ_t));
-
- if (ulsch->harq_processes[i]) {
-
- memset(ulsch->harq_processes[i],0,sizeof(NR_UL_gNB_HARQ_t));
-
- ulsch->harq_processes[i]->b = (uint8_t*)malloc16(ulsch_bytes);
-
- if (ulsch->harq_processes[i]->b)
- memset(ulsch->harq_processes[i]->b,0,ulsch_bytes);
- else
- exit_flag=3;
-
- if (abstraction_flag == 0) {
- for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
-
- ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16(8448*sizeof(uint8_t));
-
- if (ulsch->harq_processes[i]->c[r])
- memset(ulsch->harq_processes[i]->c[r],0,8448*sizeof(uint8_t));
- else
- exit_flag=2;
-
- ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16((68*384)*sizeof(int16_t));
-
- if (ulsch->harq_processes[i]->d[r])
- memset(ulsch->harq_processes[i]->d[r],0,(68*384)*sizeof(int16_t));
- else
- exit_flag=2;
-
- ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16((3*(6144+64))*sizeof(int16_t));
-
- if (ulsch->harq_processes[i]->w[r])
- memset(ulsch->harq_processes[i]->w[r],0,(3*(6144+64))*sizeof(int16_t));
- else
- exit_flag=2;
- }
- }
- } else {
- exit_flag=1;
+ ulsch = (NR_gNB_ULSCH_t *)malloc16_clear(sizeof(NR_gNB_ULSCH_t));
+
+ ulsch->max_ldpc_iterations = max_ldpc_iterations;
+ ulsch->Mlimit = 4;
+
+ for (i=0; iharq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t));
+ ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes);
+ if (abstraction_flag == 0) {
+ for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
+ ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t));
+ ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t));
+ ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t));
}
}
-
- if (exit_flag==0)
- return(ulsch);
}
- printf("new_gNB_ulsch with size %zu: exit_flag = %hhu\n",sizeof(NR_UL_gNB_HARQ_t), exit_flag);
- free_gNB_ulsch(&ulsch,N_RB_UL);
- return(NULL);
+
+ return(ulsch);
}
void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
index b81e655817..8844a530af 100644
--- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c
+++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
@@ -47,6 +47,7 @@
#include "PHY/NR_REFSIG/nr_refsig.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
+#include "nfapi/oai_integration/vendor_ext.h"
#include "nfapi/oai_integration/vendor_ext.h"
@@ -88,7 +89,8 @@ void nr_fill_pucch(PHY_VARS_gNB *gNB,
int frame,
int slot,
nfapi_nr_pucch_pdu_t *pucch_pdu) {
-
+ if (NFAPI_MODE == NFAPI_MODE_PNF)
+ gNB->pucch[0]->active = 0; //check if ture in monolithic mode
int id = nr_find_pucch(pucch_pdu->rnti,frame,slot,gNB);
AssertFatal( (id>=0) && (idrnti,id);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
index 86c9974f68..dff347f7c0 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
@@ -601,11 +601,11 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
#endif
nr_downlink_indication_t dl_indication;
- fapi_nr_rx_indication_t rx_ind;
+ fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind));
uint16_t number_pdus = 1;
- nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
- nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus);
+ nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
+ nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc);
if (ue->if_inst && ue->if_inst->dl_indication)
ue->if_inst->dl_indication(&dl_indication, NULL);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
index 945dc51673..b2e2476670 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
@@ -258,7 +258,6 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
Ilbrm = 0;
Tbslbrm = 950984; //max tbs
Coderate = 0.0;
- trace_NRpdu(DIRECTION_UPLINK, harq_process->a, harq_process->pusch_pdu.pusch_data.tb_size, 0, WS_C_RNTI, 0, 0, 0,0, 0);
///////////
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
index 914523bc70..73615ffb6e 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
@@ -45,6 +45,7 @@
#include "executables/nr-softmodem.h"
#include "executables/softmodem-common.h"
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
+#include
//#define DEBUG_PUSCH_MAPPING
//#define DEBUG_MAC_PDU
@@ -163,9 +164,15 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl);
+ trace_NRpdu(DIRECTION_UPLINK,
+ ulsch_ue->harq_processes[harq_pid]->a,
+ ulsch_ue->harq_processes[harq_pid]->pusch_pdu.pusch_data.tb_size,
+ 0, WS_C_RNTI, rnti, frame, slot, 0, 0);
+
if (nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, G) == -1)
return;
+
///////////
////////////////////////////////////////////////////////////////////
diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c
index 303ec5121d..44adf02f57 100644
--- a/openair1/PHY/TOOLS/nr_phy_scope.c
+++ b/openair1/PHY/TOOLS/nr_phy_scope.c
@@ -240,7 +240,7 @@ static void genericWaterFall (OAIgraph_t *graph, scopeSample_t *values, const in
for (int pix=0; pixw; pix++) {
scopeSample_t *end=values+(pix+1)*samplesPerPixel;
end-=2;
- AssertFatal(end <= values+datasize,"diff : %ld", end-values+datasize);
+ AssertFatal(end <= values+datasize,"diff : %tu", end-values+datasize);
double val=0;
for (scopeSample_t *s=values+(pix)*samplesPerPixel;
diff --git a/openair1/PHY/phy_vars.h b/openair1/PHY/phy_vars.h
index 5879784827..9fd186ec4f 100644
--- a/openair1/PHY/phy_vars.h
+++ b/openair1/PHY/phy_vars.h
@@ -24,6 +24,7 @@
#include "PHY/types.h"
#include "PHY/defs_eNB.h"
+#include "PHY/defs_gNB.h"
#include "PHY/defs_UE.h"
char* namepointer_chMag ;
@@ -42,6 +43,7 @@ char* namepointer_log2;
PHY_VARS_UE ***PHY_vars_UE_g;
UL_RCC_IND_t UL_RCC_INFO;
+NR_UL_IND_t UL_INFO;
unsigned short rev[2048],rev_times4[8192],rev_half[1024];
unsigned short rev256[256],rev512[512],rev1024[1024],rev4096[4096],rev2048[2048],rev8192[8192];
@@ -81,7 +83,7 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812,
};
//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27};
-const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28};
+const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27};
//for SNR to MI conversion 7 th order Polynomial coeff
const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639};
diff --git a/openair1/PHY/phy_vars_nr_ue.h b/openair1/PHY/phy_vars_nr_ue.h
index cfdfbeb49d..303853add2 100644
--- a/openair1/PHY/phy_vars_nr_ue.h
+++ b/openair1/PHY/phy_vars_nr_ue.h
@@ -84,7 +84,7 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812,
};
//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27};
-const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28};
+const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27};
//for SNR to MI conversion 7 th order Polynomial coeff
const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639};
diff --git a/openair1/PHY/phy_vars_ue.h b/openair1/PHY/phy_vars_ue.h
index ca35ab6629..2c1334b80b 100644
--- a/openair1/PHY/phy_vars_ue.h
+++ b/openair1/PHY/phy_vars_ue.h
@@ -73,7 +73,7 @@ const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812,
};
//int cqi_to_mcs[16]={0, 0, 1, 3, 5, 7, 9, 13, 15, 16, 20, 23, 25, 27, 27, 27};
-const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28};
+const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 27};
//for SNR to MI conversion 7 th order Polynomial coeff
const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639};
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index 973c921d23..569d2a464a 100644
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -755,6 +755,7 @@ void fill_sr_indication(int UEid, PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int
pthread_mutex_lock(&eNB->UL_INFO_mutex);
nfapi_sr_indication_t *sr_ind = &eNB->UL_INFO.sr_ind;
nfapi_sr_indication_body_t *sr_ind_body = &sr_ind->sr_indication_body;
+ assert(sr_ind_body->number_of_srs <= NFAPI_SR_IND_MAX_PDU);
nfapi_sr_indication_pdu_t *pdu = &sr_ind_body->sr_pdu_list[sr_ind_body->number_of_srs];
sr_ind->sfn_sf = frame<<4|subframe;
sr_ind->header.message_id = NFAPI_RX_SR_INDICATION;
@@ -1580,6 +1581,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.rx_ind.sfn_sf = frame<<4| subframe;
eNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
+ assert(eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
pdu = &eNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
// pdu->rx_ue_information.handle = eNB->ulsch[ULSCH_id]->handle;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
@@ -1587,7 +1589,11 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
pdu->rx_indication_rel8.length = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->TBS>>3;
pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
- pdu->data = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->decodedBytes;
+ assert(pdu->rx_indication_rel8.length <= NFAPI_RX_IND_DATA_MAX);
+ memcpy(pdu->rx_ind_data,
+ eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->decodedBytes,
+ pdu->rx_indication_rel8.length);
+
// estimate timing advance for MAC
sync_pos = lte_est_timing_advance_pusch(&eNB->frame_parms, eNB->pusch_vars[ULSCH_id]->drs_ch_estimates_time);
timing_advance_update = sync_pos;
@@ -1832,6 +1838,7 @@ int getM(PHY_VARS_eNB *eNB,int frame,int subframe) {
void fill_ulsch_cqi_indication (PHY_VARS_eNB *eNB, uint16_t frame, uint8_t subframe, LTE_UL_eNB_HARQ_t *ulsch_harq, uint16_t rnti) {
pthread_mutex_lock (&eNB->UL_INFO_mutex);
+ assert(eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis <= NFAPI_CQI_IND_MAX_PDU);
nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_pdu_list[eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis];
nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis];
pdu->instance_length = 0;
@@ -1878,6 +1885,7 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har
//AssertFatal(DLSCH_id>=0,"DLSCH_id doesn't exist\n");
pthread_mutex_lock(&eNB->UL_INFO_mutex);
+ assert(eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU);
nfapi_harq_indication_pdu_t *pdu = &eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs];
int M;
int i;
@@ -1948,6 +1956,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
pthread_mutex_lock(&eNB->UL_INFO_mutex);
nfapi_harq_indication_t *ind = &eNB->UL_INFO.harq_ind;
nfapi_harq_indication_body_t *body = &ind->harq_indication_body;
+ assert(eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU);
nfapi_harq_indication_pdu_t *pdu = &body->harq_pdu_list[eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs];
ind->sfn_sf = frame<<4|subframe;
ind->header.message_id = NFAPI_HARQ_INDICATION;
@@ -2124,6 +2133,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
void fill_crc_indication (PHY_VARS_eNB *eNB, int ULSCH_id, int frame, int subframe, uint8_t crc_flag) {
pthread_mutex_lock(&eNB->UL_INFO_mutex);
+ assert(eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs <= NFAPI_CRC_IND_MAX_PDU);
nfapi_crc_indication_pdu_t *pdu = &eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
eNB->UL_INFO.crc_ind.sfn_sf = frame<<4 | subframe;
eNB->UL_INFO.crc_ind.header.message_id = NFAPI_CRC_INDICATION;
diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c
index 8f315ba214..782c707857 100644
--- a/openair1/SCHED_NR/fapi_nr_l1.c
+++ b/openair1/SCHED_NR/fapi_nr_l1.c
@@ -149,16 +149,15 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
gNB = RC.gNB[Mod_id];
- notifiedFIFO_elt_t *res;
- res = pullTpool(gNB->resp_L1_tx, gNB->threadPool);
- processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
-
uint8_t number_dl_pdu = (DL_req==NULL) ? 0 : DL_req->dl_tti_request_body.nPDUs;
uint8_t number_ul_dci_pdu = (UL_dci_req==NULL) ? 0 : UL_dci_req->numPdus;
uint8_t number_ul_tti_pdu = (UL_tti_req==NULL) ? 0 : UL_tti_req->n_pdus;
uint8_t number_tx_data_pdu = (TX_req == NULL) ? 0 : TX_req->Number_of_PDUs;
if (NFAPI_MODE == NFAPI_MONOLITHIC){
+ notifiedFIFO_elt_t *res;
+ res = pullTpool(gNB->resp_L1_tx, gNB->threadPool);
+ processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
if (DL_req != NULL && TX_req!=NULL && (number_dl_pdu > 0 || number_ul_dci_pdu > 0 || number_ul_tti_pdu > 0))
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SLOT:%04d/%d DL_req:SFN/SLO:%04d/%d:dl_pdu:%d tx_req:SFN/SLOT:%04d/%d:pdus:%d;ul_dci %d ul_tti %d\n",
frame,slot,
@@ -241,12 +240,12 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
if (number_ul_dci_pdu>0)
oai_nfapi_ul_dci_req(UL_dci_req);
- if (number_dl_pdu>0)
- oai_nfapi_dl_tti_req(DL_req);
-
if (number_tx_data_pdu>0)
oai_nfapi_tx_data_req(TX_req);
- }
+ if (number_dl_pdu>0)
+ oai_nfapi_dl_tti_req(DL_req);
+ }
+
}
diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c
index d8fa11d157..3f4c2f71fb 100644
--- a/openair1/SCHED_NR/nr_ru_procedures.c
+++ b/openair1/SCHED_NR/nr_ru_procedures.c
@@ -477,9 +477,10 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) {
memcpy((void*)ru->common.txdataF[i],
(void*)&gNB->common_vars.txdataF[i][txdataF_offset],
fp->samples_per_slot_wCP*sizeof(int32_t));
- memcpy((void*)&ru->common.beam_id[i][slot_tx*fp->symbols_per_slot],
- (void*)&gNB->common_vars.beam_id[i][slot_tx*fp->symbols_per_slot],
- fp->symbols_per_slot*sizeof(uint8_t));
+ if (ru->do_precoding == 1)
+ memcpy((void*)&ru->common.beam_id[i][slot_tx*fp->symbols_per_slot],
+ (void*)&gNB->common_vars.beam_id[i][slot_tx*fp->symbols_per_slot],
+ fp->symbols_per_slot*sizeof(uint8_t));
}
if (ru->nb_tx == 1 && ru->nb_log_antennas == 1) {
diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
index 792667d510..9e5a8a536b 100644
--- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c
+++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
@@ -456,6 +456,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
if (0/*pusch_pdu->mcs_index == 9*/) {
+ __attribute__((unused))
#ifdef __AVX2__
int off = ((pusch_pdu->rb_size&1) == 1)? 4:0;
#else
@@ -660,6 +661,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
for (int i=0;ipucch[i];
if (pucch) {
+ if (NFAPI_MODE == NFAPI_MODE_PNF)
+ pucch->frame = frame_rx;
if ((pucch->active == 1) &&
(pucch->frame == frame_rx) &&
(pucch->slot == slot_rx) ) {
diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h
index c98574ec42..b3527365a5 100644
--- a/openair1/SCHED_NR_UE/defs.h
+++ b/openair1/SCHED_NR_UE/defs.h
@@ -416,7 +416,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
PHY_VARS_NR_UE *ue,
NR_UE_DLSCH_t *dlsch0,
NR_UE_DLSCH_t *dlsch1,
- uint16_t n_pdus);
+ uint16_t n_pdus,
+ UE_nr_rxtx_proc_t *proc);
bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
index 6848101a27..f67c84a07c 100644
--- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
+++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
@@ -39,11 +39,176 @@
#include "PHY/defs_nr_UE.h"
#include "PHY/impl_defs_nr.h"
+#include "utils.h"
extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
const char *dl_pdu_type[]={"DCI", "DLSCH", "RA_DLSCH", "SI_DLSCH", "P_DLSCH"};
const char *ul_pdu_type[]={"PRACH", "PUCCH", "PUSCH", "SRS"};
+queue_t nr_rx_ind_queue;
+queue_t nr_crc_ind_queue;
+queue_t nr_uci_ind_queue;
+
+int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response) {
+
+ if(scheduled_response != NULL)
+ {
+ if (scheduled_response->ul_config != NULL)
+ {
+ fapi_nr_ul_config_request_t *ul_config = scheduled_response->ul_config;
+ AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]),
+ "Too many ul_config pdus %d", ul_config->number_pdus);
+ for (int i = 0; i < ul_config->number_pdus; ++i)
+ {
+ LOG_I(PHY, "In %s: processing type %d PDU of %d total UL PDUs (ul_config %p) \n",
+ __FUNCTION__, ul_config->ul_config_list[i].pdu_type, ul_config->number_pdus, ul_config);
+
+ uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type;
+ switch (pdu_type)
+ {
+ case (FAPI_NR_UL_CONFIG_TYPE_PUSCH):
+ {
+ nfapi_nr_rx_data_indication_t *rx_ind = CALLOC(1, sizeof(*rx_ind));
+ nfapi_nr_crc_indication_t *crc_ind = CALLOC(1, sizeof(*crc_ind));
+ nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config->ul_config_list[i].pusch_config_pdu;
+ if (scheduled_response->tx_request)
+ {
+ AssertFatal(scheduled_response->tx_request->number_of_pdus <
+ sizeof(scheduled_response->tx_request->tx_request_body) / sizeof(scheduled_response->tx_request->tx_request_body[0]),
+ "Too many tx_req pdus %d", scheduled_response->tx_request->number_of_pdus);
+ rx_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION;
+ rx_ind->sfn = scheduled_response->ul_config->sfn;
+ rx_ind->slot = scheduled_response->ul_config->slot;
+ rx_ind->number_of_pdus = scheduled_response->tx_request->number_of_pdus;
+ rx_ind->pdu_list = CALLOC(rx_ind->number_of_pdus, sizeof(*rx_ind->pdu_list));
+ for (int j = 0; j < rx_ind->number_of_pdus; j++)
+ {
+ fapi_nr_tx_request_body_t *tx_req_body = &scheduled_response->tx_request->tx_request_body[j];
+ rx_ind->pdu_list[j].handle = pusch_config_pdu->handle;
+ rx_ind->pdu_list[j].harq_id = pusch_config_pdu->pusch_data.harq_process_id;
+ rx_ind->pdu_list[j].pdu_length = tx_req_body->pdu_length;
+ rx_ind->pdu_list[j].pdu = CALLOC(tx_req_body->pdu_length, sizeof(*rx_ind->pdu_list[j].pdu));
+ memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu));
+ rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti;
+ rx_ind->pdu_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance;
+ rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi;
+ char buffer[1024];
+ hexdump(rx_ind->pdu_list[j].pdu, rx_ind->pdu_list[j].pdu_length, buffer, sizeof(buffer));
+ LOG_D(NR_MAC, "Hexdump of pdu %s before queuing rx_ind\n",
+ buffer);
+ }
+
+ crc_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION;
+ crc_ind->number_crcs = scheduled_response->ul_config->number_pdus;
+ crc_ind->sfn = scheduled_response->ul_config->sfn;
+ crc_ind->slot = scheduled_response->ul_config->slot;
+ crc_ind->crc_list = CALLOC(crc_ind->number_crcs, sizeof(*crc_ind->crc_list));
+ for (int j = 0; j < crc_ind->number_crcs; j++)
+ {
+ crc_ind->crc_list[j].handle = pusch_config_pdu->handle;
+ crc_ind->crc_list[j].harq_id = pusch_config_pdu->pusch_data.harq_process_id;
+ LOG_D(NR_MAC, "This is the harq pid %d for crc_list[%d]\n", crc_ind->crc_list[j].harq_id, j);
+ LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d]\n",
+ scheduled_response->frame, scheduled_response->slot, crc_ind->sfn, crc_ind->slot);
+ crc_ind->crc_list[j].num_cb = pusch_config_pdu->pusch_data.num_cb;
+ crc_ind->crc_list[j].rnti = pusch_config_pdu->rnti;
+ crc_ind->crc_list[j].tb_crc_status = 0;
+ crc_ind->crc_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance;
+ crc_ind->crc_list[j].ul_cqi = 255;
+ }
+
+ if (!put_queue(&nr_rx_ind_queue, rx_ind))
+ {
+ LOG_E(NR_MAC, "Put_queue failed for rx_ind\n");
+ for (int i = 0; i < rx_ind->number_of_pdus; i++)
+ {
+ free(rx_ind->pdu_list[i].pdu);
+ rx_ind->pdu_list[i].pdu = NULL;
+ }
+
+ free(rx_ind->pdu_list);
+ rx_ind->pdu_list = NULL;
+ free(rx_ind);
+ rx_ind = NULL;
+ }
+ if (!put_queue(&nr_crc_ind_queue, crc_ind))
+ {
+ LOG_E(NR_MAC, "Put_queue failed for crc_ind\n");
+ free(crc_ind->crc_list);
+ crc_ind->crc_list = NULL;
+ free(crc_ind);
+ crc_ind = NULL;
+ }
+
+ LOG_D(PHY, "In %s: Filled queue rx/crc_ind which was filled by ulconfig. \n", __FUNCTION__);
+
+ scheduled_response->tx_request->number_of_pdus = 0;
+ }
+ break;
+ }
+
+ default:
+ LOG_I(NR_MAC, "Unknown ul_config->pdu_type %d\n", pdu_type);
+ break;
+ }
+ }
+ scheduled_response->ul_config->number_pdus = 0;
+ }
+
+ if (scheduled_response->dl_config != NULL)
+ {
+ fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config;
+ AssertFatal(dl_config->number_pdus < sizeof(dl_config->dl_config_list) / sizeof(dl_config->dl_config_list[0]),
+ "Too many dl_config pdus %d", dl_config->number_pdus);
+ for (int i = 0; i < dl_config->number_pdus; ++i)
+ {
+ LOG_D(PHY, "In %s: processing %s PDU of %d total DL PDUs (dl_config %p) \n",
+ __FUNCTION__, dl_pdu_type[dl_config->dl_config_list[i].pdu_type - 1], dl_config->number_pdus, dl_config);
+
+ uint8_t pdu_type = dl_config->dl_config_list[i].pdu_type;
+ switch (pdu_type)
+ {
+ case (FAPI_NR_DL_CONFIG_TYPE_DLSCH):
+ {
+ nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind));
+ uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION;
+ uci_ind->sfn = scheduled_response->frame;
+ uci_ind->slot = scheduled_response->slot;
+ uci_ind->num_ucis = 1;
+ uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list));
+ for (int j = 0; j < uci_ind->num_ucis; j++)
+ {
+ nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1;
+ uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE;
+ uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t);
+ memset(pdu_0_1, 0, sizeof(*pdu_0_1));
+ pdu_0_1->handle = 0;
+ pdu_0_1->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti;
+ pdu_0_1->pucch_format = 1;
+ pdu_0_1->ul_cqi = 255;
+ pdu_0_1->timing_advance = 0;
+ pdu_0_1->rssi = 0;
+ }
+
+ LOG_I(NR_PHY, "In %s: Filled queue uci_ind which was filled by dlconfig.\n"
+ "uci_num %d, SFN/SLOT: [%d, %d]\n",
+ __FUNCTION__, uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot);
+
+ if (!put_queue(&nr_uci_ind_queue, uci_ind))
+ {
+ LOG_E(NR_MAC, "Put_queue failed for uci_ind\n");
+ free(uci_ind->uci_list);
+ free(uci_ind);
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ }
+ return 0;
+}
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h
index 0cd882a9b5..a0b0b805af 100755
--- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h
+++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h
@@ -34,11 +34,15 @@
#define __FAPI_NR_UE_L1_H__
#include "NR_IF_Module.h"
+#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
+#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
/**\brief NR UE FAPI-like P7 messages, scheduled response from L2 indicating L1
\param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response);
+int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response);
+
/**\brief NR UE FAPI-like P5 message, physical configuration from L2 to configure L1
\param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/
int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config);
diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
index 7e5b3decc0..fa9cb746f2 100644
--- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
@@ -121,7 +121,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
PHY_VARS_NR_UE *ue,
NR_UE_DLSCH_t *dlsch0,
NR_UE_DLSCH_t *dlsch1,
- uint16_t n_pdus){
+ uint16_t n_pdus,
+ UE_nr_rxtx_proc_t *proc ){
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
@@ -130,6 +131,16 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
LOG_E(PHY, "In %s: multiple number of DL PDUs not supported yet...\n", __FUNCTION__);
}
+ if (pdu_type != FAPI_NR_RX_PDU_TYPE_SSB)
+ trace_NRpdu(DIRECTION_DOWNLINK,
+ dlsch0->harq_processes[dlsch0->current_harq_pid]->b,
+ dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS / 8,
+ pdu_type,
+ WS_C_RNTI,
+ dlsch0->rnti,
+ proc->frame_rx,
+ proc->nr_slot_rx,
+ 0,0);
switch (pdu_type){
case FAPI_NR_RX_PDU_TYPE_SIB:
rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.harq_pid = dlsch0->current_harq_pid;
@@ -478,7 +489,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
int frame_rx = proc->frame_rx;
int nr_slot_rx = proc->nr_slot_rx;
unsigned int dci_cnt=0;
- fapi_nr_dci_indication_t dci_ind = {0};
+ fapi_nr_dci_indication_t *dci_ind = calloc(1, sizeof(*dci_ind));
nr_downlink_indication_t dl_indication;
NR_UE_PDCCH *pdcch_vars = ue->pdcch_vars[proc->thread_id][gNB_id];
@@ -677,7 +688,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
n_ss);
#endif
- dci_cnt = nr_dci_decoding_procedure(ue, proc, &dci_ind, rel15);
+ dci_cnt = nr_dci_decoding_procedure(ue, proc, dci_ind, rel15);
#ifdef NR_PDCCH_SCHED_DEBUG
LOG_I(PHY,"<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%u\n",dci_cnt);
@@ -691,12 +702,12 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
ue->Mod_id,frame_rx%1024,nr_slot_rx,nr_mode_string[ue->UE_mode[gNB_id]],
i + 1,
dci_cnt,
- dci_ind.dci_list[i].rnti,
- dci_ind.dci_list[i].dci_format);
+ dci_ind->dci_list[i].rnti,
+ dci_ind->dci_list[i].dci_format);
}
ue->pdcch_vars[proc->thread_id][gNB_id]->dci_received += dci_cnt;
- dci_ind.number_of_dcis = dci_cnt;
+ dci_ind->number_of_dcis = dci_cnt;
/*
for (int i=0; iif_inst->dl_indication(&dl_indication, NULL);
@@ -873,7 +884,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
NR_UE_PDSCH *pdsch_vars;
uint16_t dmrs_len = get_num_dmrs(dlsch0->harq_processes[dlsch0->current_harq_pid]->dlDmrsSymbPos);
nr_downlink_indication_t dl_indication;
- fapi_nr_rx_indication_t rx_ind;
+ fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind));
uint16_t number_pdus = 1;
// params for UL time alignment procedure
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &ue->ul_time_alignment[gNB_id];
@@ -1002,17 +1013,17 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
switch (pdsch) {
case RA_PDSCH:
- nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
- nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus);
+ nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
+ nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
ue->UE_mode[gNB_id] = RA_RESPONSE;
break;
case PDSCH:
- nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
- nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus);
+ nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
+ nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
break;
case SI_PDSCH:
- nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id);
- nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus);
+ nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
+ nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus, proc);
break;
default:
break;
diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c
index 5f8269c513..4635f2b741 100644
--- a/openair1/SCHED_UE/phy_procedures_lte_ue.c
+++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c
@@ -3193,7 +3193,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue,
slot = 1;
stop_meas(&ue->dlsch_llr_stats_parallelization[ue->current_thread_id[subframe_rx]][slot]);
- LOG_I(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats_parallelization[ue->current_thread_id[subframe_rx]][slot].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",proc->frame_rx,subframe_rx,m,ue->dlsch_llr_stats_parallelization[ue->current_thread_id[subframe_rx]][slot].p_time/(cpuf*1000.0));
}
if(first_symbol_flag) {
@@ -3686,6 +3686,7 @@ void *UE_thread_slot1_dl_processing(void *arg) {
if ( (proc->sub_frame_start+1)%RX_NB_TH == 1 && threads.slot1_proc_two != -1 )
CPU_SET(threads.slot1_proc_two, &cpuset);
+ // cppcheck-suppress moduloAlwaysTrueFalse
if ( (proc->sub_frame_start+1)%RX_NB_TH == 2 && threads.slot1_proc_three != -1 )
CPU_SET(threads.slot1_proc_three, &cpuset);
@@ -3825,7 +3826,7 @@ void *UE_thread_slot1_dl_processing(void *arg) {
if ( LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][1]);
- LOG_I(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0));
}
//wait until pdcch is decoded
@@ -3919,7 +3920,7 @@ void *UE_thread_slot1_dl_processing(void *arg) {
if ( LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][1]);
- LOG_I(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][1].p_time/(cpuf*1000.0));
}
if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) {
@@ -4145,7 +4146,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,subframe_rx);
if (LOG_DEBUGFLAG(UE_TIMING)) {
- LOG_I(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
}
//proc->dci_slot0_available = 1;
@@ -4155,7 +4156,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
//proc->dci_slot0_available=1;
if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]]);
- LOG_I(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %d.%d] Slot0: PDCCH %5.2f \n",frame_rx,subframe_rx,ue->pdcch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
}
}
@@ -4164,7 +4165,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
// first slot has been processed (FFTs + Channel Estimation, PCFICH/PHICH/PDCCH)
if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0]);
- LOG_I(PHY, "[AbsSFN %d.%d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",frame_rx,subframe_rx,
+ LOG_D(PHY, "[AbsSFN %d.%d] Slot0: FFT + Channel Estimate + PCFICH/PHICH/PDCCH %5.2f \n",frame_rx,subframe_rx,
ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0));
}
@@ -4178,7 +4179,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->ue_front_end_stat[ue->current_thread_id[subframe_rx]]);
- LOG_I(PHY, "[AbsSFN %d.%d] FULL FE Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %d.%d] FULL FE Processing %5.2f \n",frame_rx,subframe_rx,ue->ue_front_end_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0));
}
/**** End Subframe FE Processing ****/
@@ -4266,7 +4267,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][0]);
- LOG_I(PHY, "[AbsSFN %d.%d] Slot0: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %d.%d] Slot0: LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_per_slot_stat[ue->current_thread_id[subframe_rx]][0].p_time/(cpuf*1000.0));
}
//wait until LLR Slot1 is done
@@ -4279,7 +4280,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]]);
- LOG_I(PHY, "[AbsSFN %d.%d] Full LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %d.%d] Full LLR Computation %5.2f \n",frame_rx,subframe_rx,ue->pdsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
}
//=====================================================================//
@@ -4351,7 +4352,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,
if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]);
- LOG_I(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
+ LOG_D(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
}
// duplicate harq structure
diff --git a/openair1/SCHED_UE/pusch_pc.c b/openair1/SCHED_UE/pusch_pc.c
index 503d73005f..55c8c7c547 100644
--- a/openair1/SCHED_UE/pusch_pc.c
+++ b/openair1/SCHED_UE/pusch_pc.c
@@ -115,7 +115,7 @@ void pusch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_
}
int8_t get_PHR(uint8_t Mod_id, uint8_t CC_id,uint8_t eNB_index) {
- if(NFAPI_MODE!=NFAPI_UE_STUB_PNF)
+ if(NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF)
return PHY_vars_UE_g[Mod_id][CC_id]->ulsch[eNB_index]->PHR;
else
return 40; // l1l2 simulator => ideal conditions
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c b/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c
index 9b4aba46c3..5337447678 100644
--- a/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c
+++ b/openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c
@@ -56,7 +56,7 @@ struct nlmsghdr *nas_nlh_rx = NULL;
struct iovec nas_iov_tx;
struct iovec nas_iov_rx = {nl_rx_buf, sizeof(nl_rx_buf)};
-int nas_sock_fd[MAX_MOBILES_PER_ENB];
+int nas_sock_fd[MAX_MOBILES_PER_ENB*2]; //Allocated for both LTE UE and NR UE.
int nas_sock_mbms_fd;
@@ -70,7 +70,7 @@ static int tun_alloc(char *dev) {
int fd, err;
if( (fd = open("/dev/net/tun", O_RDWR)) < 0 ) {
- printf("[TUN] failed to open /dev/net/tun\n");
+ LOG_E(PDCP, "[TUN] failed to open /dev/net/tun\n");
return -1;
}
@@ -95,15 +95,20 @@ static int tun_alloc(char *dev) {
}
-int netlink_init_mbms_tun(char *ifprefix) {
+int netlink_init_mbms_tun(char *ifprefix, int id) {//for UE, id = 1, 2, ...,
int ret;
char ifname[64];
- sprintf(ifname, "oaitun_%.3s1",ifprefix); // added "1": for historical reasons
+ if (id > 0) {
+ sprintf(ifname, "oaitun_%.3s%d", ifprefix, id-1);
+ }
+ else {
+ sprintf(ifname, "oaitun_%.3s1", ifprefix); // added "1": for historical reasons
+ }
nas_sock_mbms_fd = tun_alloc(ifname);
if (nas_sock_mbms_fd == -1) {
- printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
+ printf("[NETLINK] Error opening mbms socket %s (%d:%s)\n",ifname,errno, strerror(errno));
exit(1);
}
@@ -123,88 +128,36 @@ int netlink_init_mbms_tun(char *ifprefix) {
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(nas_sock_mbms_fd, (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
- memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
- nas_dest_addr.nl_family = AF_NETLINK;
- nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
- nas_dest_addr.nl_groups = 0; /* unicast */
- // TX PART
- nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
- memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
- /* Fill the netlink message header */
- nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
- nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
- nas_nlh_tx->nlmsg_flags = 0;
- nas_iov_tx.iov_base = (void *)nas_nlh_tx;
- nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
- memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
- nas_msg_tx.msg_name = (void *)&nas_dest_addr;
- nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
- nas_msg_tx.msg_iov = &nas_iov_tx;
- nas_msg_tx.msg_iovlen = 1;
- // RX PART
- memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
- nas_msg_rx.msg_name = (void *)&nas_src_addr;
- nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
- nas_msg_rx.msg_iov = &nas_iov_rx;
- nas_msg_rx.msg_iovlen = 1;
return 1;
}
-int netlink_init_tun(char *ifprefix, int num_if) {
+int netlink_init_tun(char *ifprefix, int num_if, int id) {//for UE, id = 1, 2, ...,
int ret;
char ifname[64];
- for (int i = 0; i < num_if; i++) {
+ int begx = (id == 0) ? 0 : id - 1;
+ int endx = (id == 0) ? num_if : id;
+ for (int i = begx; i < endx; i++) {
sprintf(ifname, "oaitun_%.3s%d",ifprefix,i+1);
nas_sock_fd[i] = tun_alloc(ifname);
if (nas_sock_fd[i] == -1) {
- printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
+ LOG_E(PDCP, "TUN: Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
exit(1);
}
- printf("[NETLINK]Opened socket %s with fd nas_sock_fd[%d]=%d\n",
+ LOG_I(PDCP, "TUN: Opened socket %s with fd nas_sock_fd[%d]=%d\n",
ifname, i, nas_sock_fd[i]);
ret = fcntl(nas_sock_fd[i],F_SETFL,O_NONBLOCK);
if (ret == -1) {
- printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
+ LOG_E(PDCP, "TUN: Error fcntl (%d:%s)\n",errno, strerror(errno));
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
exit(1);
}
}
-
- memset(&nas_src_addr, 0, sizeof(nas_src_addr));
- nas_src_addr.nl_family = AF_NETLINK;
- nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
- nas_src_addr.nl_groups = 0; /* not in mcast groups */
- ret = bind(nas_sock_fd[i], (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
- memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
- nas_dest_addr.nl_family = AF_NETLINK;
- nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
- nas_dest_addr.nl_groups = 0; /* unicast */
- // TX PART
- nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
- memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
- /* Fill the netlink message header */
- nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
- nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
- nas_nlh_tx->nlmsg_flags = 0;
- nas_iov_tx.iov_base = (void *)nas_nlh_tx;
- nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
- memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
- nas_msg_tx.msg_name = (void *)&nas_dest_addr;
- nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
- nas_msg_tx.msg_iov = &nas_iov_tx;
- nas_msg_tx.msg_iovlen = 1;
- // RX PART
- memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
- nas_msg_rx.msg_name = (void *)&nas_src_addr;
- nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
- nas_msg_rx.msg_iov = &nas_iov_rx;
- nas_msg_rx.msg_iovlen = 1;
} /* for */
return 1;
@@ -216,7 +169,7 @@ int netlink_init(void) {
nas_sock_fd[0] = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
if (nas_sock_fd[0] == -1) {
- printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd[0],errno, strerror(errno));
+ printf("[NETLINK] Error opening GRAAL_NETLINK_ID socket %d (%d:%s)\n",nas_sock_fd[0],errno, strerror(errno));
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
exit(1);
@@ -244,6 +197,7 @@ int netlink_init(void) {
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */
// TX PART
+ free(nas_nlh_tx);
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
/* Fill the netlink message header */
@@ -266,3 +220,8 @@ int netlink_init(void) {
return(nas_sock_fd[0]);
}
+void netlink_cleanup(void)
+{
+ free(nas_nlh_tx);
+ nas_nlh_tx = NULL;
+}
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/proto.h b/openair1/SIMULATION/ETH_TRANSPORT/proto.h
index e6159199d4..bc6990ac3e 100644
--- a/openair1/SIMULATION/ETH_TRANSPORT/proto.h
+++ b/openair1/SIMULATION/ETH_TRANSPORT/proto.h
@@ -62,7 +62,8 @@ int multicast_link_read_data_from_sock(uint8_t eNB_flag);
void clear_eNB_transport_info(uint8_t);
void clear_UE_transport_info(uint8_t);
int netlink_init(void);
-int netlink_init_tun(char *ifsuffix, int num_if);
-int netlink_init_mbms_tun(char *ifsuffix);
+int netlink_init_tun(char *ifsuffix, int num_if, int id);
+int netlink_init_mbms_tun(char *ifsuffix, int id);
+void netlink_cleanup(void);
#endif /* EMU_PROTO_H_ */
diff --git a/openair1/SIMULATION/LTE_PHY/common_sim.h b/openair1/SIMULATION/LTE_PHY/common_sim.h
index 5e0be3de89..5625cf8e2f 100644
--- a/openair1/SIMULATION/LTE_PHY/common_sim.h
+++ b/openair1/SIMULATION/LTE_PHY/common_sim.h
@@ -134,16 +134,16 @@ struct option * parse_oai_options(paramdef_t *options) {
void display_options_values(paramdef_t *options, int verbose) {
for(paramdef_t * ptr=options; ptr->optname[0]!=0; ptr++) {
- char varText[256]="need specific display";
+ char varText[256]={0};
if (ptr->voidptr != NULL) {
if ( (ptr->paramflags & PARAMFLAG_BOOL) )
strcpy(varText, *(bool *)ptr->iptr ? "True": "False" );
else switch (ptr->type) {
- case TYPE_INT:
- sprintf(varText,"%d",*ptr->iptr);
- break;
-
+ case TYPE_INT:
+ sprintf(varText,"%d",*ptr->iptr);
+ break;
+
case TYPE_DOUBLE:
sprintf(varText,"%.2f",*ptr->dblptr);
break;
@@ -157,6 +157,7 @@ void display_options_values(paramdef_t *options, int verbose) {
break;
default:
+ strcpy(varText,"Need specific display");
printf("not decoded type\n");
exit(1);
}
diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c
index d4106cb29a..833207a408 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim.c
@@ -634,7 +634,7 @@ int main(int argc, char **argv) {
// num_layers = 1;
perfect_ce = 0;
static paramdef_t options[] = {
- { "awgn", "Use AWGN channel and not multipath", PARAMFLAG_BOOL, strptr:NULL, defintval:0, TYPE_INT, 0, NULL, NULL },
+ { "awgn", "Use AWGN channel and not multipath", PARAMFLAG_BOOL, iptr:&awgn_flag, defintval:0, TYPE_INT, 0, NULL, NULL },
{ "Abstx", "Turns on calibration mode for abstraction.", PARAMFLAG_BOOL, iptr:&abstx, defintval:0, TYPE_INT, 0 },
{ "bTDD", "Set the tdd configuration mode",0, iptr:&tdd_config, defintval:3, TYPE_INT, 0 },
{ "BnbRBs", "The LTE bandwith in RBs (100 is 20MHz)",0, iptr:&N_RB_DL, defintval:25, TYPE_INT, 0 },
diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c
index 3bff05a03e..b9f7b38371 100644
--- a/openair1/SIMULATION/NR_PHY/dlsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlsim.c
@@ -71,6 +71,7 @@
#include
#include
+#include
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
rlc_info_t Rlc_info_um,Rlc_info_am_config;
@@ -89,6 +90,13 @@ uint64_t downlink_frequency[MAX_NUM_CCs][4];
THREAD_STRUCT thread_struct;
nfapi_ue_release_request_body_t release_rntis;
uint32_t N_RB_DL = 106;
+//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
+instance_t DUuniqInstance=0;
+instance_t CUuniqInstance=0;
+teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
+ transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
+return 0;
+}
// dummy functions
int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); }
@@ -131,12 +139,6 @@ rrc_data_ind(
{
}
-int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
- const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
- gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
- return 0;
-}
-
int
gtpv1u_create_s1u_tunnel(
const instance_t instanceP,
diff --git a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
index 056b018504..7a47410129 100644
--- a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
+++ b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
@@ -34,4 +34,5 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
PHY_VARS_NR_UE *ue,
NR_UE_DLSCH_t *dlsch0,
NR_UE_DLSCH_t *dlsch1,
- uint16_t n_pdus) {}
+ uint16_t n_pdus,
+ UE_nr_rxtx_proc_t *proc) {}
diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c
index 1169b8ecd8..2413a86912 100644
--- a/openair1/SIMULATION/NR_PHY/pbchsim.c
+++ b/openair1/SIMULATION/NR_PHY/pbchsim.c
@@ -193,6 +193,7 @@ int main(int argc, char **argv)
int frame=0;
int frame_length_complex_samples;
+ __attribute__((unused))
int frame_length_complex_samples_no_prefix;
NR_DL_FRAME_PARMS *frame_parms;
diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c
index a33713234c..6b9512a38b 100644
--- a/openair1/SIMULATION/NR_PHY/prachsim.c
+++ b/openair1/SIMULATION/NR_PHY/prachsim.c
@@ -52,6 +52,7 @@
#include
#include
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
+#include
#define NR_PRACH_DEBUG 1
#define PRACH_WRITE_OUTPUT_DEBUG 1
@@ -88,6 +89,13 @@ int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { return(0); }
int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) { return(0); }
int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { return(0); }
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) { return(0); }
+//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
+instance_t DUuniqInstance=0;
+instance_t CUuniqInstance=0;
+teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
+ transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
+return 0;
+}
void
rrc_data_ind(
@@ -99,12 +107,6 @@ rrc_data_ind(
{
}
-int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
- const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
- gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
- return 0;
-}
-
int
gtpv1u_create_s1u_tunnel(
const instance_t instanceP,
diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c
index 97c753d455..db8d54f86d 100644
--- a/openair1/SIMULATION/NR_PHY/ulsim.c
+++ b/openair1/SIMULATION/NR_PHY/ulsim.c
@@ -65,6 +65,7 @@
#include
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
+#include
//#define DEBUG_ULSIM
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
@@ -85,6 +86,13 @@ THREAD_STRUCT thread_struct;
nfapi_ue_release_request_body_t release_rntis;
uint32_t N_RB_DL = 106;
+//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
+instance_t DUuniqInstance=0;
+instance_t CUuniqInstance=0;
+teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_bearer_id, teid_t outgoing_teid,
+ transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) {
+return 0;
+}
extern void fix_scd(NR_ServingCellConfig_t *scd);// forward declaration
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
@@ -120,11 +128,6 @@ rrc_data_ind(
{
}
-int ocp_gtpv1u_create_s1u_tunnel(instance_t instance,
- const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
- gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
- return 0;
-}
int
gtpv1u_create_s1u_tunnel(
@@ -1278,8 +1281,10 @@ int main(int argc, char **argv)
if (n_trials == 1 && round==0) {
#ifdef __AVX2__
+ __attribute__((unused))
int off = ((nb_rb&1) == 1)? 4:0;
#else
+ __attribute__((unused))
int off = 0;
#endif
diff --git a/openair1/SIMULATION/TOOLS/taus.c b/openair1/SIMULATION/TOOLS/taus.c
index cdd4aebec3..a9d2750c06 100644
--- a/openair1/SIMULATION/TOOLS/taus.c
+++ b/openair1/SIMULATION/TOOLS/taus.c
@@ -21,10 +21,12 @@
#include
#include
+#include
+#include
//#include "SIMULATION/TOOLS/sim.h"
-unsigned int s0, s1, s2, b;
+static unsigned int s0, s1, s2;
//----------------------------------------------
//
@@ -34,7 +36,7 @@ unsigned int s0, s1, s2, b;
unsigned int taus(void)
{
- b = (((s0 << 13) ^ s0) >> 19);
+ unsigned int b = (((s0 << 13) ^ s0) >> 19);
s0 = (((s0 & 0xFFFFFFFE) << 12)^ b);
b = (((s1 << 2) ^ s1) >> 25);
s1 = (((s1 & 0xFFFFFFF8) << 4)^ b);
@@ -50,9 +52,20 @@ void set_taus_seed(unsigned int seed_init)
unsigned long result = 0;
if (seed_init == 0) {
- s0 = (unsigned int)time(NULL);
- s1 = (unsigned int)time(NULL);
- s2 = (unsigned int)time(NULL);
+ unsigned int data[3];
+ int fd = open("/dev/urandom", O_RDONLY);
+ if (fd == -1)
+ {
+ abort();
+ }
+ if (read(fd, data, sizeof(data)) != sizeof(data))
+ {
+ abort();
+ }
+ close(fd);
+ s0 = data[0];
+ s1 = data[1];
+ s2 = data[2];
} else {
/* Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
srand48_r((long int)seed_init, &buffer);
diff --git a/openair2/COMMON/as_message.h b/openair2/COMMON/as_message.h
index 829c3c9e33..b0ca06daec 100644
--- a/openair2/COMMON/as_message.h
+++ b/openair2/COMMON/as_message.h
@@ -219,6 +219,10 @@ typedef struct kenb_refresh_req_s {
Byte_t kenb[32];
} kenb_refresh_req_t;
+typedef struct nsa_oai_tun_nsa_s {
+ uint8_t buffer[500];
+} nas_oai_tun_nsa_t;
+
/*
* NAS->AS - Cell Information request
* NAS request AS to search for a suitable cell belonging to the selected
diff --git a/openair2/COMMON/f1ap_messages_def.h b/openair2/COMMON/f1ap_messages_def.h
index 6b1c6d9495..0e857f3a83 100644
--- a/openair2/COMMON/f1ap_messages_def.h
+++ b/openair2/COMMON/f1ap_messages_def.h
@@ -44,7 +44,8 @@ MESSAGE_DEF(F1AP_UE_CONTEXT_RELEASE_CMD, MESSAGE_PRIORITY_MED, f1ap_ue_context_r
/* RRC -> F1AP messages */
MESSAGE_DEF(F1AP_DL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_dl_rrc_message_t , f1ap_dl_rrc_message )
//MESSAGE_DEF(F1AP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_initial_context_setup_req_t , f1ap_initial_context_setup_req )
-MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_req_t, f1ap_ue_context_setup_req)
+MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_setup_req)
+MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_RESP, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_setup_resp)
diff --git a/openair2/COMMON/f1ap_messages_types.h b/openair2/COMMON/f1ap_messages_types.h
index c2fb4a9cf7..cb1a8c9577 100644
--- a/openair2/COMMON/f1ap_messages_types.h
+++ b/openair2/COMMON/f1ap_messages_types.h
@@ -39,6 +39,7 @@
#define F1AP_INITIAL_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_initial_ul_rrc_message
#define F1AP_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ul_rrc_message
#define F1AP_UE_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_req
+#define F1AP_UE_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_resp
#define F1AP_UE_CONTEXT_RELEASE_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_resp
#define F1AP_UE_CONTEXT_MODIFICATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_resp
#define F1AP_UE_CONTEXT_MODIFICATION_FAIL(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_fail
@@ -71,6 +72,29 @@ typedef struct f1ap_cu_setup_req_s {
//
} f1ap_cu_setup_req_t;
+typedef struct cellIDs_s {
+
+ // Served Cell Information
+ /* Tracking area code */
+ uint32_t tac;
+
+ /* Mobile Country Codes
+ * Mobile Network Codes
+ */
+ uint16_t mcc;
+ uint16_t mnc;
+ uint8_t mnc_digit_length;
+
+ // NR Global Cell Id
+ uint64_t nr_cellid;
+ // NR Physical Cell Ids
+ uint16_t nr_pci;
+ // Number of slide support items (max 16, could be increased to as much as 1024)
+ uint16_t num_ssi;
+ uint8_t sst;
+ uint8_t sd;
+} cellIDs_t;
+
typedef struct f1ap_setup_req_s {
// Midhaul networking parameters
@@ -84,6 +108,8 @@ typedef struct f1ap_setup_req_s {
/* The eNB IP address to bind */
f1ap_net_ip_address_t CU_f1_ip_address;
f1ap_net_ip_address_t DU_f1_ip_address;
+ uint16_t CUport;
+ uint16_t DUport;
/* Number of SCTP streams used for a mme association */
uint16_t sctp_in_streams;
@@ -100,31 +126,12 @@ typedef struct f1ap_setup_req_s {
/// number of DU cells available
uint16_t num_cells_available; //0< num_cells_available <= 512;
-
- // Served Cell Information
- /* Tracking area code */
- uint32_t tac[F1AP_MAX_NB_CELLS];
-
- /* Mobile Country Codes
- * Mobile Network Codes
- */
- uint16_t mcc[F1AP_MAX_NB_CELLS];//[6];
- uint16_t mnc[F1AP_MAX_NB_CELLS];//[6];
- uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];//[6];
-
- // NR Global Cell Id
- uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
- // NR Physical Cell Ids
- uint16_t nr_pci[F1AP_MAX_NB_CELLS];
- // Number of slide support items (max 16, could be increased to as much as 1024)
- uint16_t num_ssi[F1AP_MAX_NB_CELLS];//[6];
- uint8_t sst[F1AP_MAX_NB_CELLS];//[16][6];
- uint8_t sd[F1AP_MAX_NB_CELLS];//[16][6];
+ cellIDs_t cell[F1AP_MAX_NB_CELLS];
// fdd_flag = 1 means FDD, 0 means TDD
int fdd_flag;
union {
- struct {
+ struct fdd_s {
uint32_t ul_nr_arfcn;
uint8_t ul_scs;
uint8_t ul_nrb;
@@ -148,7 +155,7 @@ typedef struct f1ap_setup_req_s {
uint8_t dl_num_sul_frequency_bands;
uint16_t dl_nr_sul_band[32];
} fdd;
- struct {
+ struct tdd_s {
uint32_t nr_arfcn;
uint8_t scs;
@@ -195,6 +202,7 @@ typedef struct served_cells_to_activate_s {
/// SI message containers (up to 21 messages per cell)
uint8_t *SI_container[21];
int SI_container_length[21];
+ int SI_type[21];
} served_cells_to_activate_t;
typedef struct f1ap_setup_resp_s {
@@ -299,7 +307,7 @@ typedef struct f1ap_initial_ul_rrc_message_s {
uint16_t crnti;
uint8_t *rrc_container;
int rrc_container_length;
- int8_t *du2cu_rrc_container;
+ char du2cu_rrc_container[200];
int du2cu_rrc_container_length;
} f1ap_initial_ul_rrc_message_t;
@@ -312,19 +320,32 @@ typedef struct f1ap_ul_rrc_message_s {
typedef struct f1ap_up_tnl_s {
in_addr_t tl_address; // currently only IPv4 supported
- uint32_t gtp_teid;
+ teid_t teid;
+ uint16_t port;
} f1ap_up_tnl_t;
typedef struct f1ap_drb_to_be_setup_s {
- uint8_t drb_id;
+ long drb_id;
f1ap_up_tnl_t up_ul_tnl[2];
uint8_t up_ul_tnl_length;
+ f1ap_up_tnl_t up_dl_tnl[2];
+ uint8_t up_dl_tnl_length;
rlc_mode_t rlc_mode;
} f1ap_drb_to_be_setup_t;
-typedef struct f1ap_ue_context_setup_req_s {
+typedef struct f1ap_srb_to_be_setup_s {
+ long srb_id;
+ rlc_mode_t rlc_mode;
+ uint8_t lcid;
+} f1ap_srb_to_be_setup_t;
+
+typedef struct f1ap_rb_failed_to_be_setup_s {
+ long rb_id;
+} f1ap_rb_failed_to_be_setup_t;
+
+typedef struct f1ap_ue_context_setup_s {
uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
- uint32_t *gNB_DU_ue_id;
+ uint32_t gNB_DU_ue_id;
uint16_t rnti;
// SpCell Info
uint16_t mcc;
@@ -336,13 +357,37 @@ typedef struct f1ap_ue_context_setup_req_s {
uint32_t servCellId;
uint8_t *cu_to_du_rrc_information;
uint8_t cu_to_du_rrc_information_length;
+ uint8_t *du_to_cu_rrc_information;
+ uint8_t du_to_cu_rrc_information_length;
f1ap_drb_to_be_setup_t *drbs_to_be_setup; // BK: need to replace by s1ap_initial_context_setup_req
uint8_t drbs_to_be_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
+ uint8_t drbs_failed_to_be_setup_length;
+ f1ap_rb_failed_to_be_setup_t *drbs_failed_to_be_setup;
+ f1ap_srb_to_be_setup_t *srbs_to_be_setup;
+ uint8_t srbs_to_be_setup_length;
+ uint8_t srbs_failed_to_be_setup_length;
+ f1ap_rb_failed_to_be_setup_t *srbs_failed_to_be_setup;
s1ap_initial_context_setup_req_t *s1ap_initial_context_setup_req;
// coniatner for the rrc_eNB_generate_SecurityModeCommand message
uint8_t *rrc_container;
int rrc_container_length;
-} f1ap_ue_context_setup_req_t;
+} f1ap_ue_context_setup_t;
+
+typedef struct f1ap_ue_context_setup_resp_s {
+ uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
+ uint32_t gNB_DU_ue_id;
+ uint16_t rnti;
+ uint8_t du_to_cu_rrc_information[1024 /*Arbitrarily big enough*/];
+ uint32_t du_to_cu_rrc_information_length;
+ f1ap_drb_to_be_setup_t *drbs_setup; // BK: need to replace by s1ap_initial_context_setup_req
+ uint8_t drbs_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
+ f1ap_srb_to_be_setup_t *srbs_setup;
+ uint8_t srbs_setup_length;
+ uint8_t srbs_failed_to_be_setup_length;
+ f1ap_rb_failed_to_be_setup_t *srbs_failed_to_be_setup;
+ uint8_t drbs_failed_to_be_setup_length;
+ f1ap_rb_failed_to_be_setup_t *drbs_failed_to_be_setup;
+} f1ap_ue_context_setup_resp_t;
typedef enum F1ap_Cause_e {
F1AP_CAUSE_NOTHING, /* No components present */
diff --git a/openair2/COMMON/gtpv1_u_messages_def.h b/openair2/COMMON/gtpv1_u_messages_def.h
index e5ce496701..2835d07e4a 100644
--- a/openair2/COMMON/gtpv1_u_messages_def.h
+++ b/openair2/COMMON/gtpv1_u_messages_def.h
@@ -29,9 +29,8 @@ MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_dat
MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_ind_t,Gtpv1uDataForwardingInd)
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_req_t, Gtpv1uEndMarkerReq)
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd)
-MESSAGE_DEF(GTPV1U_ENB_S1_REQ, MESSAGE_PRIORITY_MED, Gtpv1uS1Req, gtpv1uS1Req)
+MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq)
MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_req_t, NRGtpv1uDeleteTunnelReq)
MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_resp_t, NRGtpv1uDeleteTunnelResp)
-MESSAGE_DEF(GTPV1U_GNB_NG_REQ, MESSAGE_PRIORITY_MED, Gtpv1uNGReq, gtpv1uNGReq)
MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq)
diff --git a/openair2/COMMON/gtpv1_u_messages_types.h b/openair2/COMMON/gtpv1_u_messages_types.h
index 3c82076510..2dd476ab68 100644
--- a/openair2/COMMON/gtpv1_u_messages_types.h
+++ b/openair2/COMMON/gtpv1_u_messages_types.h
@@ -39,11 +39,10 @@
#define GTPV1U_ENB_END_MARKER_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerReq
#define GTPV1U_ENB_END_MARKER_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerInd
-#define GTPV1U_ENB_S1_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uS1Req
+#define GTPV1U_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uReq
#define GTPV1U_GNB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelReq
#define GTPV1U_GNB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelResp
-#define GTPV1U_GNB_NG_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uNGReq
#define GTPV1U_GNB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uTunnelDataReq
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
@@ -174,25 +173,23 @@ typedef struct gtpv1u_enb_end_marker_ind_s {
} gtpv1u_enb_end_marker_ind_t;
typedef struct {
- in_addr_t enb_ip_address_for_S1u_S12_S4_up;
- tcp_udp_port_t enb_port_for_S1u_S12_S4_up;
- char addrStr[256];
- char portStr[256];
-} Gtpv1uS1Req;
+ in_addr_t localAddr;
+ tcp_udp_port_t localPort;
+ char localAddrStr[256];
+ char localPortStr[256];
+} Gtpv1uReq;
+
-typedef struct {
- in_addr_t gnb_ip_address_for_NGu_up;
- tcp_udp_port_t gnb_port_for_NGu_up;
- char addrStr[256];
- char portStr[256];
-} Gtpv1uNGReq;
typedef struct gtpv1u_gnb_create_tunnel_req_s {
rnti_t rnti;
int num_tunnels;
- teid_t upf_NGu_teid[NR_GTPV1U_MAX_BEARERS_PER_UE]; ///< Tunnel Endpoint Identifier
+ //teid_t upf_NGu_teid[NR_GTPV1U_MAX_BEARERS_PER_UE]; ///< Tunnel Endpoint Identifier
+ teid_t outgoing_teid[NR_GTPV1U_MAX_BEARERS_PER_UE];
pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
ebi_t incoming_rb_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
- transport_layer_addr_t upf_addr[NR_GTPV1U_MAX_BEARERS_PER_UE];
+ //ebi_t outgoing_rb_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
+ //transport_layer_addr_t upf_addr[NR_GTPV1U_MAX_BEARERS_PER_UE];
+ transport_layer_addr_t dst_addr[NR_GTPV1U_MAX_BEARERS_PER_UE];
} gtpv1u_gnb_create_tunnel_req_t;
typedef struct gtpv1u_gnb_create_tunnel_resp_s {
diff --git a/openair2/COMMON/mac_messages_types.h b/openair2/COMMON/mac_messages_types.h
index a9336a58a9..cad7b9f172 100644
--- a/openair2/COMMON/mac_messages_types.h
+++ b/openair2/COMMON/mac_messages_types.h
@@ -147,6 +147,7 @@ typedef struct NRRrcMacCcchDataInd_s {
OCTET_STRING_t *du_to_cu_rrc_container;
uint8_t gnb_index;
int CC_id;
+ uint64_t nr_cellid;
} NRRrcMacCcchDataInd;
typedef struct RrcMacMcchDataReq_s {
diff --git a/openair2/COMMON/pdcp_messages_def.h b/openair2/COMMON/pdcp_messages_def.h
index 59d47eb81b..5392c9e04d 100644
--- a/openair2/COMMON/pdcp_messages_def.h
+++ b/openair2/COMMON/pdcp_messages_def.h
@@ -31,6 +31,8 @@
MESSAGE_DEF(RRC_DCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataReq, rrc_dcch_data_req)
MESSAGE_DEF(RRC_DCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataInd, rrc_dcch_data_ind)
MESSAGE_DEF(RRC_PCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcPcchDataReq, rrc_pcch_data_req)
+MESSAGE_DEF(RRC_NRUE_CAP_INFO_IND, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataInd, rrc_nrue_cap_info_ind)
+MESSAGE_DEF(RRC_DCCH_DATA_COPY_IND, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataInd, rrc_dcch_data_copy_ind)
// gNB
MESSAGE_DEF(NR_RRC_DCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, NRRrcDcchDataReq, nr_rrc_dcch_data_req)
diff --git a/openair2/COMMON/pdcp_messages_types.h b/openair2/COMMON/pdcp_messages_types.h
index 0390fd80f4..d7c84a24a1 100644
--- a/openair2/COMMON/pdcp_messages_types.h
+++ b/openair2/COMMON/pdcp_messages_types.h
@@ -34,6 +34,8 @@
#define RRC_DCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_dcch_data_req
#define RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_dcch_data_ind
#define RRC_PCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_pcch_data_req
+#define RRC_NRUE_CAP_INFO_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_nrue_cap_info_ind
+#define RRC_DCCH_DATA_COPY_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_dcch_data_copy_ind
// gNB
#define NR_RRC_DCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_dcch_data_req
@@ -65,6 +67,13 @@ typedef struct RrcDcchDataInd_s {
uint8_t eNB_index; // LG: needed in UE
} RrcDcchDataInd;
+typedef struct RrcDcchDataCopyInd_s {
+ uint8_t dcch_index;
+ uint32_t sdu_size;
+ uint8_t *sdu_p;
+ uint8_t eNB_index;
+} RrcDcchDataCopyInd;
+
typedef struct NRRrcDcchDataReq_s {
uint32_t frame;
uint8_t gnb_flag;
diff --git a/openair2/COMMON/platform_constants.h b/openair2/COMMON/platform_constants.h
index 355f56f9c9..d409650528 100644
--- a/openair2/COMMON/platform_constants.h
+++ b/openair2/COMMON/platform_constants.h
@@ -75,9 +75,9 @@
#define MAX_eNB 2
#define MAX_gNB 2
#else
- #define MAX_MOBILES_PER_ENB 4
- #define MAX_MOBILES_PER_ENB_NB_IoT 4
- #define MAX_MOBILES_PER_GNB 4//16
+ #define MAX_MOBILES_PER_ENB 40
+ #define MAX_MOBILES_PER_ENB_NB_IoT 40
+ #define MAX_MOBILES_PER_GNB 16
#define MAX_eNB 2
#define MAX_gNB 2
#endif
diff --git a/openair2/COMMON/platform_types.h b/openair2/COMMON/platform_types.h
index 23b33dd8b1..c24291de64 100644
--- a/openair2/COMMON/platform_types.h
+++ b/openair2/COMMON/platform_types.h
@@ -212,6 +212,14 @@ typedef enum config_action_e {
CONFIG_ACTION_MBMS_MODIFY = 11
} config_action_t;
+/* Maximum size of any message we might send or receive (e.g., via a socket) */
+#define MAX_MESSAGE_SIZE 8192
+
+typedef struct nsa_msg_t {
+ uint8_t msg_type;
+ uint8_t msg_buffer[MAX_MESSAGE_SIZE];
+} nsa_msg_t;
+
//-----------------------------------------------------------------------------
// GTPV1U TYPES
//-----------------------------------------------------------------------------
@@ -233,7 +241,6 @@ typedef struct protocol_ctxt_s {
frame_t frame; /*!< \brief LTE frame number.*/
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */
- boolean_t configured; /*!< \brief flag indicating whether the instance is configured or not */
boolean_t brOption;
} protocol_ctxt_t;
// warning time hardcoded
diff --git a/openair2/COMMON/rrc_messages_def.h b/openair2/COMMON/rrc_messages_def.h
index cde2497880..35caf3c342 100644
--- a/openair2/COMMON/rrc_messages_def.h
+++ b/openair2/COMMON/rrc_messages_def.h
@@ -65,6 +65,8 @@ MESSAGE_DEF(NAS_UPLINK_DATA_REQ, MESSAGE_PRIORITY_MED, NasUlDataReq
MESSAGE_DEF(NAS_RAB_ESTABLI_RSP, MESSAGE_PRIORITY_MED, NasRabEstRsp, nas_rab_est_rsp)
+MESSAGE_DEF(NAS_OAI_TUN_NSA, MESSAGE_PRIORITY_MED, NasOaiTunNsa, nas_oai_tun_nsa)
+
// UE: RRC -> NAS messages
MESSAGE_DEF(NAS_CELL_SELECTION_CNF, MESSAGE_PRIORITY_MED, NasCellSelectionCnf, nas_cell_selection_cnf)
MESSAGE_DEF(NAS_CELL_SELECTION_IND, MESSAGE_PRIORITY_MED, NasCellSelectionInd, nas_cell_selection_ind)
@@ -79,3 +81,5 @@ MESSAGE_DEF(RRC_SUBFRAME_PROCESS, MESSAGE_PRIORITY_MED, RrcSubframeP
// eNB: RLC -> RRC messages
MESSAGE_DEF(RLC_SDU_INDICATION, MESSAGE_PRIORITY_MED, RlcSduIndication, rlc_sdu_indication)
+
+MESSAGE_DEF(NR_DU_RRC_DL_INDICATION, MESSAGE_PRIORITY_MED, NRDuDlReq_t, nr_du_dl_req)
diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h
index e1886b57ff..63a581b37b 100644
--- a/openair2/COMMON/rrc_messages_types.h
+++ b/openair2/COMMON/rrc_messages_types.h
@@ -89,6 +89,9 @@
#define RRC_SUBFRAME_PROCESS(mSGpTR) (mSGpTR)->ittiMsg.rrc_subframe_process
#define RLC_SDU_INDICATION(mSGpTR) (mSGpTR)->ittiMsg.rlc_sdu_indication
+#define NRDuDlReq(mSGpTR) (mSGpTR)->ittiMsg.nr_du_dl_req
+
+#define NAS_OAI_TUN_NSA(mSGpTR) (mSGpTR)->ittiMsg.nas_oai_tun_nsa
//-------------------------------------------------------------------------------------------//
typedef struct RrcStateInd_s {
@@ -418,6 +421,11 @@ typedef struct NRRrcConfigurationReq_s {
int pucch_TargetSNRx10;
} gNB_RrcConfigurationReq;
+typedef struct NRDuDlReq_s {
+ rnti_t rnti;
+ mem_block_t * buf;
+ uint64_t srb_id;
+} NRDuDlReq_t;
// UE: NAS -> RRC messages
typedef kenb_refresh_req_t NasKenbRefreshReq;
@@ -427,6 +435,8 @@ typedef ul_info_transfer_req_t NasUlDataReq;
typedef rab_establish_rsp_t NasRabEstRsp;
+typedef nas_oai_tun_nsa_t NasOaiTunNsa;
+
// UE: RRC -> NAS messages
typedef cell_info_cnf_t NasCellSelectionCnf;
typedef cell_info_ind_t NasCellSelectionInd;
diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index 4751596931..a08bcf4baf 100644
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -1925,6 +1925,7 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
AssertFatal(ENBParamList.paramarray[i][ENB_ENB_ID_IDX].uptr != NULL,
"eNB id %u is not defined in configuration file\n",i);
F1AP_SETUP_REQ (msg_p).num_cells_available = 0;
+ F1AP_SETUP_REQ (msg_p).cell_type = CELL_MACRO_ENB;
for (k=0; k eth_params_n.remote_addr);
LOG_I(ENB_APP,"FIAP: CU_ip4_address in DU %p, strlen %d\n",F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv4_address,(int)strlen(RC.mac[k]->eth_params_n.remote_addr));
F1AP_SETUP_REQ (msg_p).CU_f1_ip_address.ipv6 = 0;
@@ -1969,8 +1970,11 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
LOG_I(ENB_APP,"FIAP: DU_ip4_address in DU %p, strlen %d\n",F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv4_address,(int)strlen(RC.mac[k]->eth_params_n.my_addr));
F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv6 = 0;
F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv4 = 1;
+
//strcpy(F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv6_address, "");
strcpy(F1AP_SETUP_REQ (msg_p).DU_f1_ip_address.ipv4_address, RC.mac[k]->eth_params_n.my_addr);
+ F1AP_SETUP_REQ (msg_p).DUport= RC.mac[k]->eth_params_n.my_portd;
+ F1AP_SETUP_REQ (msg_p).CUport= RC.mac[k]->eth_params_n.remote_portd;
//strcpy(F1AP_SETUP_REQ (msg_p).CU_ip_address[l].ipv6_address,*(F1ParamList.paramarray[l][ENB_CU_IPV6_ADDRESS_IDX].strptr));
//F1AP_SETUP_REQ (msg_p).CU_port = RC.mac[k]->eth_params_n.remote_portc; // maybe we dont need it
sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_SCTP_CONFIG);
@@ -1989,12 +1993,12 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
pthread_mutex_unlock(&rrc->cell_info_mutex);
} while (cell_info_configured ==0);
- rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).mcc[k];
- rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).mnc[k];
- rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).tac[k];
- rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).nr_cellid[k];
- F1AP_SETUP_REQ (msg_p).nr_pci[k] = rrc->carrier[0].physCellId;
- F1AP_SETUP_REQ (msg_p).num_ssi[k] = 0;
+ rrc->configuration.mcc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mcc;
+ rrc->configuration.mnc[0] = F1AP_SETUP_REQ (msg_p).cell[k].mnc;
+ rrc->configuration.tac = F1AP_SETUP_REQ (msg_p).cell[k].tac;
+ rrc->nr_cellid = F1AP_SETUP_REQ (msg_p).cell[k].nr_cellid;
+ F1AP_SETUP_REQ (msg_p).cell[k].nr_pci = rrc->carrier[0].physCellId;
+ F1AP_SETUP_REQ (msg_p).cell[k].num_ssi = 0;
if (rrc->carrier[0].sib1->tdd_Config) {
LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k);
@@ -2070,12 +2074,12 @@ int RCconfig_gtpu(void ) {
if (address) {
MessageDef *message;
- AssertFatal((message = itti_alloc_new_message(TASK_ENB_APP, 0, GTPV1U_ENB_S1_REQ))!=NULL,"");
- IPV4_STR_ADDR_TO_INT_NWBO ( address, GTPV1U_ENB_S1_REQ(message).enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
- LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,GTPV1U_ENB_S1_REQ(message).enb_ip_address_for_S1u_S12_S4_up);
- GTPV1U_ENB_S1_REQ(message).enb_port_for_S1u_S12_S4_up = enb_port_for_S1U;
- strcpy(GTPV1U_ENB_S1_REQ(message).addrStr,address);
- sprintf(GTPV1U_ENB_S1_REQ(message).portStr,"%d", enb_port_for_S1U);
+ AssertFatal((message = itti_alloc_new_message(TASK_ENB_APP, 0, GTPV1U_REQ))!=NULL,"");
+ IPV4_STR_ADDR_TO_INT_NWBO ( address, GTPV1U_REQ(message).localAddr, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
+ LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,GTPV1U_REQ(message).localAddr);
+ GTPV1U_REQ(message).localPort = enb_port_for_S1U;
+ strcpy(GTPV1U_REQ(message).localAddrStr,address);
+ sprintf(GTPV1U_REQ(message).localPortStr,"%d", enb_port_for_S1U);
itti_send_msg_to_task (TASK_VARIABLE, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
} else
LOG_E(GTPU,"invalid address for S1U\n");
@@ -3167,7 +3171,7 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
(check_plmn_identity(carrier, resp->cells_to_activate[j].mcc, resp->cells_to_activate[j].mnc, resp->cells_to_activate[j].mnc_digit_length)>0 &&
resp->cells_to_activate[j].nrpci == carrier->physCellId)) {
// copy system information and decode it
- for (si_ind=2; si_indcells_to_activate[j].num_SI + 2; si_ind++) {
+ for (si_ind=0; si_indcells_to_activate[j].num_SI; si_ind++) {
//printf("SI %d size %d: ", si_ind, resp->cells_to_activate[j].SI_container_length[si_ind]);
//for (int n=0;ncells_to_activate[j].SI_container_length[si_ind];n++)
// printf("%02x ",resp->cells_to_activate[j].SI_container[si_ind][n]);
@@ -3175,7 +3179,7 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
if (si_ind==6) si_ind=9;
if (resp->cells_to_activate[j].SI_container[si_ind] != NULL) {
extract_and_decode_SI(i,
- si_ind,
+ resp->cells_to_activate[j].SI_type[si_ind],
resp->cells_to_activate[j].SI_container[si_ind],
resp->cells_to_activate[j].SI_container_length[si_ind]);
}
diff --git a/openair2/F1AP/dummy_enb.c b/openair2/F1AP/dummy_enb.c
index fe6dfb6a06..d54f9b8df7 100644
--- a/openair2/F1AP/dummy_enb.c
+++ b/openair2/F1AP/dummy_enb.c
@@ -29,6 +29,19 @@
void apply_macrlc_config(gNB_RRC_INST *rrc,
rrc_gNB_ue_context_t *const ue_context_pP,
const protocol_ctxt_t *const ctxt_pP ) {
-abort();
+ abort();
}
+boolean_t sdap_gnb_data_req(protocol_ctxt_t *ctxt_p,
+ const srb_flag_t srb_flag,
+ const rb_id_t rb_id,
+ const mui_t mui,
+ const confirm_t confirm,
+ const sdu_size_t sdu_buffer_size,
+ unsigned char *const sdu_buffer,
+ const pdcp_transmission_mode_t pt_mode,
+ const uint32_t *sourceL2Id,
+ const uint32_t *destinationL2Id
+ ) {
+abort();
+}
diff --git a/openair2/F1AP/f1ap_common.c b/openair2/F1AP/f1ap_common.c
index 267626dd5c..338b5f0c2b 100644
--- a/openair2/F1AP/f1ap_common.c
+++ b/openair2/F1AP/f1ap_common.c
@@ -32,19 +32,22 @@
#include "f1ap_common.h"
+static f1ap_cudu_inst_t *f1_du_inst[NUMBER_OF_eNB_MAX]= {0};
+static f1ap_cudu_inst_t *f1_cu_inst[NUMBER_OF_eNB_MAX]= {0};
+
#if defined(EMIT_ASN_DEBUG_EXTERN)
int asn_debug = 0;
int asn1_xer_print = 0;
-inline void ASN_DEBUG(const char *fmt, ...)
-{
+inline void ASN_DEBUG(const char *fmt, ...) {
if (asn_debug) {
int adi = asn_debug_indent;
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "[ASN1]");
- while(adi--) fprintf(stderr, " ");
+ while(adi--)
+ fprintf(stderr, " ");
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
@@ -53,142 +56,157 @@ inline void ASN_DEBUG(const char *fmt, ...)
}
#endif
-uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP)
-{
+uint8_t F1AP_get_next_transaction_identifier(instance_t enb_mod_idP, instance_t cu_mod_idP) {
static uint8_t transaction_identifier[NUMBER_OF_eNB_MAX];
transaction_identifier[enb_mod_idP+cu_mod_idP] =
- (transaction_identifier[enb_mod_idP+cu_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER;
+ (transaction_identifier[enb_mod_idP+cu_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER;
//LOG_T(F1AP,"generated xid is %d\n",transaction_identifier[enb_mod_idP+cu_mod_idP]);
return transaction_identifier[enb_mod_idP+cu_mod_idP];
}
-int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
- module_id_t module_idP,
- int CC_idP,
- int UE_id,
+f1ap_cudu_inst_t *getCxt(F1_t isCU, instance_t instanceP) {
+ //Fixme: 4G F1 has race condtions, someone may debug it, using this test
+ /*
+ static pid_t t=-1;
+ pid_t tNew=gettid();
+ AssertFatal ( t==-1 || t==tNew, "This is not thread safe\n");
+ t=tNew;
+ */
+ AssertFatal( instanceP < sizeofArray(f1_cu_inst), "");
+ return isCU == CUtype ? f1_cu_inst[ instanceP]: f1_du_inst[ instanceP];
+}
+
+void createF1inst(F1_t isCU, instance_t instanceP, f1ap_setup_req_t *req) {
+ if (isCU == CUtype) {
+ AssertFatal(f1_cu_inst[instanceP] == NULL, "Double call to F1 CU init\n");
+ f1_cu_inst[instanceP]=( f1ap_cudu_inst_t *) calloc(1, sizeof( f1ap_cudu_inst_t));
+ //memcpy(f1_cu_inst[instanceP]->setupReq, req, sizeof(f1ap_setup_req_t) );
+ } else {
+ AssertFatal(f1_du_inst[instanceP] == NULL, "Double call to F1 DU init\n");
+ f1_du_inst[instanceP]=( f1ap_cudu_inst_t *) calloc(1, sizeof(f1ap_cudu_inst_t));
+ memcpy(&f1_du_inst[instanceP]->setupReq, req, sizeof(f1ap_setup_req_t) );
+ }
+}
+
+int f1ap_add_ue(F1_t isCu,
+ instance_t instanceP,
rnti_t rntiP) {
+ f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
+
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
f1_inst->f1ap_ue[i].f1ap_uid = i;
- f1_inst->f1ap_ue[i].mac_uid = UE_id;
- LOG_I(F1AP, "Updating the index of UE with RNTI %x and du_ue_f1ap_id %d\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
+ LOG_I(F1AP, "Updating the index of UE with RNTI %x and du_ue_f1ap_id %ld\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
return i;
}
}
+
+ // We didn't find the rnti
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == 0 ) {
f1_inst->f1ap_ue[i].rnti = rntiP;
f1_inst->f1ap_ue[i].f1ap_uid = i;
- f1_inst->f1ap_ue[i].mac_uid = UE_id;
f1_inst->f1ap_ue[i].du_ue_f1ap_id = rntiP;
f1_inst->f1ap_ue[i].cu_ue_f1ap_id = rntiP;
f1_inst->num_ues++;
- LOG_I(F1AP, "Adding a new UE with RNTI %x and cu/du ue_f1ap_id %d\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
+ LOG_I(F1AP, "Adding a new UE with RNTI %x and cu/du ue_f1ap_id %ld\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
return i;
}
}
+
return -1;
}
-int f1ap_remove_ue(f1ap_cudu_inst_t *f1_inst,
+int f1ap_remove_ue(F1_t isCu, instance_t instanceP,
rnti_t rntiP) {
+ f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
+
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
f1_inst->f1ap_ue[i].rnti = 0;
break;
}
}
+
f1_inst->num_ues--;
return 0;
}
-int f1ap_get_du_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst,
- rnti_t rntiP) {
+int f1ap_get_du_ue_f1ap_id(F1_t isCu, instance_t instanceP,
+ rnti_t rntiP) {
+ f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
+
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return f1_inst->f1ap_ue[i].du_ue_f1ap_id;
}
}
+
return -1;
}
-int f1ap_get_cu_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst,
- rnti_t rntiP) {
+int f1ap_get_cu_ue_f1ap_id(F1_t isCu, instance_t instanceP,
+ rnti_t rntiP) {
+ f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
+
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return f1_inst->f1ap_ue[i].cu_ue_f1ap_id;
}
}
+
return -1;
}
-int f1ap_get_rnti_by_du_id(f1ap_cudu_inst_t *f1_inst,
- module_id_t du_ue_f1ap_id ) {
+int f1ap_get_rnti_by_du_id(F1_t isCu, instance_t instanceP,
+ instance_t du_ue_f1ap_id ) {
+ f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
+
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) {
return f1_inst->f1ap_ue[i].rnti;
}
}
+
return -1;
}
-int f1ap_get_rnti_by_cu_id(f1ap_cudu_inst_t *f1_inst,
- module_id_t cu_ue_f1ap_id ) {
+int f1ap_get_rnti_by_cu_id(F1_t isCu, instance_t instanceP,
+ instance_t cu_ue_f1ap_id ) {
+ f1ap_cudu_inst_t *f1_inst=getCxt(isCu, instanceP);
+
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].cu_ue_f1ap_id == cu_ue_f1ap_id) {
return f1_inst->f1ap_ue[i].rnti;
}
}
+
return -1;
}
-int f1ap_get_du_uid(f1ap_cudu_inst_t *f1_inst,
- module_id_t du_ue_f1ap_id ) {
+int f1ap_du_add_cu_ue_id(instance_t instanceP,
+ instance_t du_ue_f1ap_id,
+ instance_t cu_ue_f1ap_id) {
+ f1ap_cudu_inst_t *f1_inst=getCxt(DUtype, instanceP);
+ instance_t f1ap_uid=-1;
+
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) {
- return i;
+ f1ap_uid=i;
+ break;
}
}
- return -1;
-}
-int f1ap_get_cu_uid(f1ap_cudu_inst_t *f1_inst,
- module_id_t cu_ue_f1ap_id ) {
- for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
- if (f1_inst->f1ap_ue[i].cu_ue_f1ap_id == cu_ue_f1ap_id) {
- return i;
- }
- }
- return -1;
-}
+ if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB)
+ return -1;
-int f1ap_get_uid_by_rnti(f1ap_cudu_inst_t *f1_inst,
- rnti_t rntiP ) {
- for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
- if (f1_inst->f1ap_ue[i].rnti == rntiP) {
- return i;
- }
- }
- return -1;
-}
-
-int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst,
- module_id_t du_ue_f1ap_id,
- module_id_t cu_ue_f1ap_id) {
- module_id_t f1ap_uid = f1ap_get_du_uid(f1_inst,du_ue_f1ap_id);
- if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB) return -1;
f1_inst->f1ap_ue[f1ap_uid].cu_ue_f1ap_id = cu_ue_f1ap_id;
- LOG_I(F1AP, "Adding cu_ue_f1ap_id %d for UE with RNTI %x\n", cu_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
+ LOG_I(F1AP, "Adding cu_ue_f1ap_id %ld for UE with RNTI %x\n", cu_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
return 0;
}
-int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst,
- module_id_t cu_ue_f1ap_id,
- module_id_t du_ue_f1ap_id) {
- module_id_t f1ap_uid = f1ap_get_cu_uid(f1_inst,cu_ue_f1ap_id);
- if (f1ap_uid < 0 || f1ap_uid >= MAX_MOBILES_PER_ENB) return -1;
- f1_inst->f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
- LOG_I(F1AP, "Adding du_ue_f1ap_id %d for UE with RNTI %x\n", du_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
- return 0;
+int f1ap_assoc_id(F1_t isCu, instance_t instanceP) {
+ f1ap_setup_req_t *f1_inst=f1ap_req(isCu, instanceP);
+ return f1_inst->assoc_id;
}
diff --git a/openair2/F1AP/f1ap_common.h b/openair2/F1AP/f1ap_common.h
index 7781a78412..a393930c81 100644
--- a/openair2/F1AP/f1ap_common.h
+++ b/openair2/F1AP/f1ap_common.h
@@ -31,19 +31,20 @@
*/
#if HAVE_CONFIG_H_
-# include "config.h"
+ #include "config.h"
#endif
#ifndef F1AP_COMMON_H_
#define F1AP_COMMON_H_
#include "openairinterface5g_limits.h"
+#include
#define F1AP_UE_IDENTIFIER_NUMBER 3
#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3
#if defined(EMIT_ASN_DEBUG_EXTERN)
-inline void ASN_DEBUG(const char *fmt, ...);
+ inline void ASN_DEBUG(const char *fmt, ...);
#endif
#include "F1AP_RAT-FrequencyPriorityInformation.h"
@@ -360,14 +361,14 @@ inline void ASN_DEBUG(const char *fmt, ...);
/* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
-# error "You are compiling f1ap with the wrong version of ASN1C"
+ # error "You are compiling f1ap with the wrong version of ASN1C"
#endif
#ifndef FALSE
-# define FALSE (0)
+ #define FALSE (0)
#endif
#ifndef TRUE
-# define TRUE (!FALSE)
+ #define TRUE (!FALSE)
#endif
#define F1AP_UE_ID_FMT "0x%06"PRIX32
@@ -375,20 +376,20 @@ inline void ASN_DEBUG(const char *fmt, ...);
#include "assertions.h"
#if defined(ENB_MODE)
-# include "common/utils/LOG/log.h"
-# include "f1ap_default_values.h"
-# define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args)
-# define F1AP_WARN(x, args...) LOG_W(F1AP, x, ##args)
-# define F1AP_TRAF(x, args...) LOG_I(F1AP, x, ##args)
-# define F1AP_INFO(x, args...) LOG_I(F1AP, x, ##args)
-# define F1AP_DEBUG(x, args...) LOG_I(F1AP, x, ##args)
+ #include "common/utils/LOG/log.h"
+ #include "f1ap_default_values.h"
+ #define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args)
+ #define F1AP_WARN(x, args...) LOG_W(F1AP, x, ##args)
+ #define F1AP_TRAF(x, args...) LOG_I(F1AP, x, ##args)
+ #define F1AP_INFO(x, args...) LOG_I(F1AP, x, ##args)
+ #define F1AP_DEBUG(x, args...) LOG_I(F1AP, x, ##args)
#else
-//# include "mme_default_values.h"
-# define F1AP_ERROR(x, args...) do { fprintf(stdout, "[F1AP][E]"x, ##args); } while(0)
-# define F1AP_WARN(x, args...) do { fprintf(stdout, "[F1AP][W]"x, ##args); } while(0)
-# define F1AP_TRAF(x, args...) do { fprintf(stdout, "[F1AP][T]"x, ##args); } while(0)
-# define F1AP_INFO(x, args...) do { fprintf(stdout, "[F1AP][I]"x, ##args); } while(0)
-# define F1AP_DEBUG(x, args...) do { fprintf(stdout, "[F1AP][D]"x, ##args); } while(0)
+ //# include "mme_default_values.h"
+ #define F1AP_ERROR(x, args...) do { fprintf(stdout, "[F1AP][E]"x, ##args); } while(0)
+ #define F1AP_WARN(x, args...) do { fprintf(stdout, "[F1AP][W]"x, ##args); } while(0)
+ #define F1AP_TRAF(x, args...) do { fprintf(stdout, "[F1AP][T]"x, ##args); } while(0)
+ #define F1AP_INFO(x, args...) do { fprintf(stdout, "[F1AP][I]"x, ##args); } while(0)
+ #define F1AP_DEBUG(x, args...) do { fprintf(stdout, "[F1AP][D]"x, ##args); } while(0)
#endif
//Forward declaration
@@ -407,73 +408,86 @@ inline void ASN_DEBUG(const char *fmt, ...);
if (mandatory) DevAssert(ie != NULL); \
} while(0)
-/** \brief Function callback prototype.
+/** \brief Function array prototype.
**/
-typedef int (*f1ap_message_decoded_callback)(
+typedef int (*f1ap_message_processing_t)(
instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *message_p
);
+int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
+ const uint8_t *const data, const uint32_t data_length);
typedef struct f1ap_cudu_ue_inst_s {
// used for eNB stats generation
rnti_t rnti;
- module_id_t f1ap_uid;
- module_id_t mac_uid;
- module_id_t du_ue_f1ap_id;
- module_id_t cu_ue_f1ap_id;
+ instance_t f1ap_uid;
+ instance_t du_ue_f1ap_id;
+ instance_t cu_ue_f1ap_id;
} f1ap_cudu_ue_t;
typedef struct f1ap_cudu_inst_s {
+ f1ap_setup_req_t setupReq;
+ uint16_t sctp_in_streams;
+ uint16_t sctp_out_streams;
+ uint16_t default_sctp_stream_id;
+ instance_t gtpInst;
+ uint64_t gNB_DU_id;
uint16_t num_ues;
f1ap_cudu_ue_t f1ap_ue[MAX_MOBILES_PER_ENB];
} f1ap_cudu_inst_t;
+typedef enum {
+ DUtype=0,
+ CUtype
+} F1_t;
+static const int nrb_lut[29] = {11, 18, 24, 25, 31, 32, 38, 51, 52, 65, 66, 78, 79, 93, 106, 107, 121, 132, 133, 135, 160, 162, 189, 216, 217, 245, 264, 270, 273};
-uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP);
+uint8_t F1AP_get_next_transaction_identifier(instance_t enb_mod_idP, instance_t cu_mod_idP);
+f1ap_cudu_inst_t *getCxt(F1_t isCU, instance_t instanceP);
-int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
- module_id_t module_idP,
- int CC_idP,
- int UE_id,
+void createF1inst(F1_t isCU, instance_t instanceP, f1ap_setup_req_t *req);
+int f1ap_add_ue(F1_t isCu,
+ instance_t instanceP,
rnti_t rntiP);
-int f1ap_remove_ue(f1ap_cudu_inst_t *f1_inst,
+int f1ap_remove_ue(F1_t isCu, instance_t instanceP,
rnti_t rntiP);
-int f1ap_get_du_ue_f1ap_id (f1ap_cudu_inst_t *f1_inst,
+int f1ap_get_du_ue_f1ap_id (F1_t isCu, instance_t instanceP,
rnti_t rntiP);
-int f1ap_get_cu_ue_f1ap_id (f1ap_cudu_inst_t *f1_inst,
+int f1ap_get_cu_ue_f1ap_id (F1_t isCu, instance_t instanceP,
rnti_t rntiP);
-int f1ap_get_rnti_by_du_id(f1ap_cudu_inst_t *f1_inst,
- module_id_t du_ue_f1ap_id );
+int f1ap_get_rnti_by_du_id(F1_t isCu, instance_t instanceP,
+ instance_t du_ue_f1ap_id );
-int f1ap_get_rnti_by_cu_id(f1ap_cudu_inst_t *f1_inst,
- module_id_t cu_ue_f1ap_id );
+int f1ap_get_rnti_by_cu_id(F1_t isCu, instance_t instanceP,
+ instance_t cu_ue_f1ap_id );
+int f1ap_du_add_cu_ue_id(instance_t instanceP,
+ instance_t du_ue_f1ap_id,
+ instance_t cu_ue_f1ap_id);
-int f1ap_get_du_uid(f1ap_cudu_inst_t *f1_inst,
- module_id_t du_ue_f1ap_id );
+int f1ap_assoc_id(F1_t isCu, instance_t instanceP);
-int f1ap_get_cu_uid(f1ap_cudu_inst_t *f1_inst,
- module_id_t cu_ue_f1ap_id );
+static inline f1ap_setup_req_t *f1ap_req(F1_t isCu, instance_t instanceP) {
+ return &getCxt(isCu, instanceP)->setupReq;
+}
-int f1ap_get_uid_by_rnti(f1ap_cudu_inst_t *f1_inst,
- rnti_t rntiP );
+#define TASK_F1APP f1ap_req(false, instance)->cell_type==CELL_MACRO_GNB?TASK_GNB_APP:TASK_ENB_APP
-int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst,
- module_id_t du_ue_f1ap_id,
- module_id_t cu_ue_f1ap_id);
-
-int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst,
- module_id_t cu_ue_f1ap_id,
- module_id_t du_ue_f1ap_id);
+//lts: C struct type is not homogeneous, so we need macros instead of functions
+#define addnRCGI(nRCGi, servedCelL) \
+ MCC_MNC_TO_PLMNID((servedCelL)->mcc,(servedCelL)-> mnc,(servedCelL)->mnc_digit_length, \
+ &((nRCGi).pLMN_Identity)); \
+ NR_CELL_ID_TO_BIT_STRING((servedCelL)->nr_cellid, &((nRCGi).nRCellIdentity));
+extern RAN_CONTEXT_t RC;
#endif /* F1AP_COMMON_H_ */
diff --git a/openair2/F1AP/f1ap_cu_interface_management.c b/openair2/F1AP/f1ap_cu_interface_management.c
index 057d0d97a0..fdd5f3ea3e 100644
--- a/openair2/F1AP/f1ap_cu_interface_management.c
+++ b/openair2/F1AP/f1ap_cu_interface_management.c
@@ -36,24 +36,21 @@
#include "f1ap_itti_messaging.h"
#include "f1ap_cu_interface_management.h"
-extern f1ap_setup_req_t *f1ap_du_data_from_du;
-extern RAN_CONTEXT_t RC;
-
int CU_send_RESET(instance_t instance, F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_handle_RESET_ACKKNOWLEDGE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_handle_RESET(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
@@ -66,9 +63,9 @@ int CU_send_RESET_ACKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *Rese
Error Indication
*/
int CU_handle_ERROR_INDICATION(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
@@ -83,330 +80,295 @@ int CU_send_ERROR_INDICATION(instance_t instance, F1AP_ErrorIndication_t *ErrorI
int CU_handle_F1_SETUP_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
- F1AP_F1AP_PDU_t *pdu)
-{
+ F1AP_F1AP_PDU_t *pdu) {
LOG_D(F1AP, "CU_handle_F1_SETUP_REQUEST\n");
-
MessageDef *message_p;
F1AP_F1SetupRequest_t *container;
F1AP_F1SetupRequestIEs_t *ie;
int i = 0;
-
-
DevAssert(pdu != NULL);
-
container = &pdu->choice.initiatingMessage->value.choice.F1SetupRequest;
/* F1 Setup Request == Non UE-related procedure -> stream 0 */
if (stream != 0) {
LOG_W(F1AP, "[SCTP %d] Received f1 setup request on stream != 0 (%d)\n",
- assoc_id, stream);
- }
-
- if(RC.nrrrc) {
- message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_SETUP_REQ);
- } else {
- message_p = itti_alloc_new_message(TASK_RRC_ENB, 0, F1AP_SETUP_REQ);
+ assoc_id, stream);
}
/* assoc_id */
- F1AP_SETUP_REQ(message_p).assoc_id = assoc_id;
-
+ f1ap_setup_req_t *req=&getCxt(true, instance)->setupReq;
+ req->assoc_id = assoc_id;
/* gNB_DU_id */
// this function exits if the ie is mandatory
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_ID, true);
- asn_INTEGER2ulong(&ie->value.choice.GNB_DU_ID, &F1AP_SETUP_REQ(message_p).gNB_DU_id);
- LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).gNB_DU_id %lu \n", F1AP_SETUP_REQ(message_p).gNB_DU_id);
-
+ asn_INTEGER2ulong(&ie->value.choice.GNB_DU_ID, &req->gNB_DU_id);
+ LOG_D(F1AP, "req->gNB_DU_id %lu \n", req->gNB_DU_id);
/* gNB_DU_name */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
- F1AP_ProtocolIE_ID_id_gNB_DU_Name, true);
- F1AP_SETUP_REQ(message_p).gNB_DU_name = calloc(ie->value.choice.GNB_DU_Name.size + 1, sizeof(char));
- memcpy(F1AP_SETUP_REQ(message_p).gNB_DU_name, ie->value.choice.GNB_DU_Name.buf,
+ F1AP_ProtocolIE_ID_id_gNB_DU_Name, true);
+ req->gNB_DU_name = calloc(ie->value.choice.GNB_DU_Name.size + 1, sizeof(char));
+ memcpy(req->gNB_DU_name, ie->value.choice.GNB_DU_Name.buf,
ie->value.choice.GNB_DU_Name.size);
- /* Convert the mme name to a printable string */
- F1AP_SETUP_REQ(message_p).gNB_DU_name[ie->value.choice.GNB_DU_Name.size] = '\0';
- LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).gNB_DU_name %s \n", F1AP_SETUP_REQ(message_p).gNB_DU_name);
-
+ LOG_D(F1AP, "req->gNB_DU_name %s \n", req->gNB_DU_name);
/* GNB_DU_Served_Cells_List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
- F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List, true);
- F1AP_SETUP_REQ(message_p).num_cells_available = ie->value.choice.GNB_DU_Served_Cells_List.list.count;
- LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).num_cells_available %d \n",
- F1AP_SETUP_REQ(message_p).num_cells_available);
+ F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List, true);
+ req->num_cells_available = ie->value.choice.GNB_DU_Served_Cells_List.list.count;
+ LOG_D(F1AP, "req->num_cells_available %d \n", req->num_cells_available);
- int num_cells_available = F1AP_SETUP_REQ(message_p).num_cells_available;
-
- for (i=0; ivalue.choice.GNB_DU_Served_Cells_List.list.array[i])->value.choice.GNB_DU_Served_Cells_Item);
-
+ for (i=0; inum_cells_available; i++) {
+ F1AP_GNB_DU_Served_Cells_Item_t *served_cells_item = &(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *)
+ ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])->
+ value.choice.GNB_DU_Served_Cells_Item);
+ F1AP_Served_Cell_Information_t *servedCellInformation= &served_cells_item->served_Cell_Information;
/* tac */
- if (served_cells_item_p->served_Cell_Information.fiveGS_TAC) {
- OCTET_STRING_TO_INT16(served_cells_item_p->served_Cell_Information.fiveGS_TAC, F1AP_SETUP_REQ(message_p).tac[i]);
- LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).tac[%d] %d \n", i, F1AP_SETUP_REQ(message_p).tac[i]);
+ if (servedCellInformation->fiveGS_TAC) {
+ OCTET_STRING_TO_INT16(servedCellInformation->fiveGS_TAC, req->cell[i].tac);
+ LOG_D(F1AP, "req->tac[%d] %d \n", i, req->cell[i].tac);
}
+
/* - nRCGI */
- TBCD_TO_MCC_MNC(&(served_cells_item_p->served_Cell_Information.nRCGI.pLMN_Identity), F1AP_SETUP_REQ(message_p).mcc[i],
- F1AP_SETUP_REQ(message_p).mnc[i],
- F1AP_SETUP_REQ(message_p).mnc_digit_length[i]);
-
-
+ TBCD_TO_MCC_MNC(&(servedCellInformation->nRCGI.pLMN_Identity), req->cell[i].mcc,
+ req->cell[i].mnc,req->cell[i].mnc_digit_length);
// NR cellID
- BIT_STRING_TO_NR_CELL_IDENTITY(&served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity,
- F1AP_SETUP_REQ(message_p).nr_cellid[i]);
+ BIT_STRING_TO_NR_CELL_IDENTITY(&servedCellInformation->nRCGI.nRCellIdentity,
+ req->cell[i].nr_cellid);
LOG_D(F1AP, "[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %llu\n", assoc_id,
- F1AP_SETUP_REQ(message_p).mcc[i],
- F1AP_SETUP_REQ(message_p).mnc[i],
- (long long unsigned int)F1AP_SETUP_REQ(message_p).nr_cellid[i]);
- LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
- served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[0],
- served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[1],
- served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[2],
- served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[3],
- served_cells_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[4]);
+ req->cell[i].mcc,
+ req->cell[i].mnc,
+ (long long unsigned int)req->cell[i].nr_cellid);
/* - nRPCI */
- F1AP_SETUP_REQ(message_p).nr_pci[i] = served_cells_item_p->served_Cell_Information.nRPCI;
- LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).nr_pci[%d] %d \n",
- i, F1AP_SETUP_REQ(message_p).nr_pci[i]);
-
+ req->cell[i].nr_pci = servedCellInformation->nRPCI;
+ LOG_D(F1AP, "req->nr_pci[%d] %d \n", i, req->cell[i].nr_pci);
+
+ // LTS: FIXME data model failure: we don't KNOW if we receive a 4G or a 5G cell
+ // Furthermore, cell_type is not a attribute of a cell in the data structure !!!!!!!!!!
+ if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU)
+ f1ap_req(true, instance)->cell_type=CELL_MACRO_GNB;
+ else
+ f1ap_req(true, instance)->cell_type=CELL_MACRO_ENB;
+
+ // FDD Cells
+ if (servedCellInformation->nR_Mode_Info.present==F1AP_NR_Mode_Info_PR_fDD) {
+ struct fdd_s *FDDs=&req->nr_mode_info[i].fdd;
+ F1AP_FDD_Info_t * fDD_Info=servedCellInformation->nR_Mode_Info.choice.fDD;
+ FDDs->ul_nr_arfcn=fDD_Info->uL_NRFreqInfo.nRARFCN;
+ FDDs->ul_num_frequency_bands=fDD_Info->uL_NRFreqInfo.freqBandListNr.list.count;
+ for (int f=0; f < fDD_Info->uL_NRFreqInfo.freqBandListNr.list.count; f++) {
+ F1AP_FreqBandNrItem_t * FreqItem=fDD_Info->uL_NRFreqInfo.freqBandListNr.list.array[f];
+ FDDs->ul_nr_band[f]=FreqItem->freqBandIndicatorNr;
+ int num_available_supported_SULBands=FreqItem->supportedSULBandList.list.count;
+ for (int sul=0; sul < num_available_supported_SULBands; sul ++ ) {
+ F1AP_SupportedSULFreqBandItem_t * SulItem= FreqItem->supportedSULBandList.list.array[sul];
+ FDDs->ul_nr_sul_band[sul]=SulItem->freqBandIndicatorNr;
+ }
+ }
+ FDDs->dl_nr_arfcn=fDD_Info->dL_NRFreqInfo.nRARFCN;
+ int dlBands=fDD_Info->dL_NRFreqInfo.freqBandListNr.list.count;
+ for (int dlB=0; dlB < dlBands; dlB++) {
+ F1AP_FreqBandNrItem_t * FreqItem=fDD_Info->dL_NRFreqInfo.freqBandListNr.list.array[dlB];
+ FDDs->dl_nr_band[dlB]=FreqItem->freqBandIndicatorNr;
+ int num_available_supported_SULBands = FreqItem->supportedSULBandList.list.count;
+ for (int sul=0; sul < num_available_supported_SULBands; sul ++ ) {
+ F1AP_SupportedSULFreqBandItem_t * SulItem= FreqItem->supportedSULBandList.list.array[sul];
+ FDDs->ul_nr_sul_band[sul]=SulItem->freqBandIndicatorNr;
+ }
+ }
+ FDDs->ul_scs=fDD_Info->uL_Transmission_Bandwidth.nRSCS;
+ FDDs->ul_nrb=nrb_lut[fDD_Info->uL_Transmission_Bandwidth.nRNRB];
+ FDDs->dl_scs=fDD_Info->dL_Transmission_Bandwidth.nRSCS;
+ FDDs->dl_nrb=nrb_lut[fDD_Info->dL_Transmission_Bandwidth.nRNRB];
+ }
+
+ // TDD
+ if (servedCellInformation->nR_Mode_Info.present==F1AP_NR_Mode_Info_PR_tDD) {
+ struct tdd_s *TDDs=&req->nr_mode_info[i].tdd;
+ F1AP_TDD_Info_t * tDD_Info=servedCellInformation->nR_Mode_Info.choice.tDD;
+ TDDs->nr_arfcn=tDD_Info->nRFreqInfo.nRARFCN;
+ TDDs->num_frequency_bands=tDD_Info->nRFreqInfo.freqBandListNr.list.count;
+ for (int f=0; f < tDD_Info->nRFreqInfo.freqBandListNr.list.count; f++) {
+ struct F1AP_FreqBandNrItem * FreqItem=tDD_Info->nRFreqInfo.freqBandListNr.list.array[f];
+ TDDs->nr_band[f]=FreqItem->freqBandIndicatorNr;
+ int num_available_supported_SULBands=FreqItem->supportedSULBandList.list.count;
+ for (int sul=0; sul < num_available_supported_SULBands; sul ++ ) {
+ struct F1AP_SupportedSULFreqBandItem * SulItem= FreqItem->supportedSULBandList.list.array[sul];
+ TDDs->nr_sul_band[sul]=SulItem->freqBandIndicatorNr;
+ }
+ }
+ TDDs->scs=tDD_Info->transmission_Bandwidth.nRSCS;
+ TDDs->nrb=nrb_lut[tDD_Info->transmission_Bandwidth.nRNRB];
+ }
+
+ struct F1AP_GNB_DU_System_Information * DUsi=served_cells_item->gNB_DU_System_Information;
+ LOG_I(F1AP, "Received Cell in %d context\n", f1ap_req(true, instance)->cell_type==CELL_MACRO_GNB);
// System Information
/* mib */
- F1AP_SETUP_REQ(message_p).mib[i] = calloc(served_cells_item_p->gNB_DU_System_Information->mIB_message.size + 1, sizeof(char));
- memcpy(F1AP_SETUP_REQ(message_p).mib[i], served_cells_item_p->gNB_DU_System_Information->mIB_message.buf,
- served_cells_item_p->gNB_DU_System_Information->mIB_message.size);
+ req->mib[i] = calloc(DUsi->mIB_message.size + 1, sizeof(char));
+ memcpy(req->mib[i], DUsi->mIB_message.buf, DUsi->mIB_message.size);
/* Convert the mme name to a printable string */
- F1AP_SETUP_REQ(message_p).mib[i][served_cells_item_p->gNB_DU_System_Information->mIB_message.size] = '\0';
- F1AP_SETUP_REQ(message_p).mib_length[i] = served_cells_item_p->gNB_DU_System_Information->mIB_message.size;
- LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).mib[%d] %s , len = %d \n",
- i, F1AP_SETUP_REQ(message_p).mib[i], F1AP_SETUP_REQ(message_p).mib_length[i]);
-
+ req->mib[i][DUsi->mIB_message.size] = '\0';
+ req->mib_length[i] = DUsi->mIB_message.size;
+ LOG_D(F1AP, "req->mib[%d] len = %d \n", i, req->mib_length[i]);
/* sib1 */
- F1AP_SETUP_REQ(message_p).sib1[i] = calloc(served_cells_item_p->gNB_DU_System_Information->sIB1_message.size + 1, sizeof(char));
- memcpy(F1AP_SETUP_REQ(message_p).sib1[i], served_cells_item_p->gNB_DU_System_Information->sIB1_message.buf,
- served_cells_item_p->gNB_DU_System_Information->sIB1_message.size);
+ req->sib1[i] = calloc(DUsi->sIB1_message.size + 1, sizeof(char));
+ memcpy(req->sib1[i], DUsi->sIB1_message.buf, DUsi->sIB1_message.size);
/* Convert the mme name to a printable string */
- F1AP_SETUP_REQ(message_p).sib1[i][served_cells_item_p->gNB_DU_System_Information->sIB1_message.size] = '\0';
- F1AP_SETUP_REQ(message_p).sib1_length[i] = served_cells_item_p->gNB_DU_System_Information->sIB1_message.size;
- LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).sib1[%d] %s , len = %d \n",
- i, F1AP_SETUP_REQ(message_p).sib1[i], F1AP_SETUP_REQ(message_p).sib1_length[i]);
+ req->sib1[i][DUsi->sIB1_message.size] = '\0';
+ req->sib1_length[i] = DUsi->sIB1_message.size;
+ LOG_D(F1AP, "req->sib1[%d] len = %d \n", i, req->sib1_length[i]);
}
-
- *f1ap_du_data_from_du = F1AP_SETUP_REQ(message_p);
// char *measurement_timing_information[F1AP_MAX_NB_CELLS];
// uint8_t ranac[F1AP_MAX_NB_CELLS];
-
// int fdd_flag = f1ap_setup_req->fdd_flag;
-
// union {
// struct {
// uint32_t ul_nr_arfcn;
// uint8_t ul_scs;
// uint8_t ul_nrb;
-
// uint32_t dl_nr_arfcn;
// uint8_t dl_scs;
// uint8_t dl_nrb;
-
// uint32_t sul_active;
// uint32_t sul_nr_arfcn;
// uint8_t sul_scs;
// uint8_t sul_nrb;
-
// uint8_t num_frequency_bands;
// uint16_t nr_band[32];
// uint8_t num_sul_frequency_bands;
// uint16_t nr_sul_band[32];
// } fdd;
// struct {
-
// uint32_t nr_arfcn;
// uint8_t scs;
// uint8_t nrb;
-
// uint32_t sul_active;
// uint32_t sul_nr_arfcn;
// uint8_t sul_scs;
// uint8_t sul_nrb;
-
// uint8_t num_frequency_bands;
// uint16_t nr_band[32];
// uint8_t num_sul_frequency_bands;
// uint16_t nr_sul_band[32];
-
// } tdd;
// } nr_mode_info[F1AP_MAX_NB_CELLS];
- MSC_LOG_TX_MESSAGE(
- MSC_F1AP_CU,
- MSC_RRC_ENB,
- 0,
- 0,
- MSC_AS_TIME_FMT" CU_handle_F1_SETUP_REQUEST",
- 0,0//MSC_AS_TIME_ARGS(ctxt_pP),
- );
- if (num_cells_available > 0) {
- if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU) {
+
+ // We copy and store in F1 task data, RRC will free "req" as it frees all itti received messages
+ message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_SETUP_REQ);
+ memcpy(&F1AP_SETUP_REQ(message_p), req, sizeof(f1ap_setup_req_t) );
+
+ if (req->num_cells_available > 0) {
+ if (f1ap_req(true, instance)->cell_type == CELL_MACRO_GNB) {
itti_send_msg_to_task(TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(instance), message_p);
} else {
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(instance), message_p);
}
} else {
CU_send_F1_SETUP_FAILURE(instance);
- if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU) {
- itti_free(TASK_RRC_GNB,message_p);
- } else {
- itti_free(TASK_RRC_ENB,message_p);
- }
+ itti_free(TASK_CU_F1,message_p);
return -1;
}
+
return 0;
}
int CU_send_F1_SETUP_RESPONSE(instance_t instance,
- f1ap_setup_resp_t *f1ap_setup_resp) {
-
- module_id_t enb_mod_idP;
- module_id_t cu_mod_idP;
-
+ f1ap_setup_resp_t *f1ap_setup_resp) {
+ instance_t enb_mod_idP;
+ instance_t cu_mod_idP;
// This should be fixed
- enb_mod_idP = (module_id_t)0;
- cu_mod_idP = (module_id_t)0;
-
- F1AP_F1AP_PDU_t pdu;
- F1AP_F1SetupResponse_t *out;
- F1AP_F1SetupResponseIEs_t *ie;
-
- uint8_t *buffer;
- uint32_t len;
- int i = 0;
-
+ enb_mod_idP = (instance_t)0;
+ cu_mod_idP = (instance_t)0;
+ F1AP_F1AP_PDU_t pdu= {0};
+ uint8_t *buffer=NULL;
+ uint32_t len=0;
/* Create */
/* 0. Message Type */
- memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
- pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t));
- pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup;
- pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
- pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_F1SetupResponse;
- out = &pdu.choice.successfulOutcome->value.choice.F1SetupResponse;
-
+ asn1cCalloc(pdu.choice.successfulOutcome, tmp);
+ tmp->procedureCode = F1AP_ProcedureCode_id_F1Setup;
+ tmp->criticality = F1AP_Criticality_reject;
+ tmp->value.present = F1AP_SuccessfulOutcome__value_PR_F1SetupResponse;
+ F1AP_F1SetupResponse_t *out = &pdu.choice.successfulOutcome->value.choice.F1SetupResponse;
/* mandatory */
/* c1. Transaction ID (integer value)*/
- ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_F1SetupResponseIEs__value_PR_TransactionID;
- ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupResponseIEs_t, ie1);
+ ie1->id = F1AP_ProtocolIE_ID_id_TransactionID;
+ ie1->criticality = F1AP_Criticality_reject;
+ ie1->value.present = F1AP_F1SetupResponseIEs__value_PR_TransactionID;
+ ie1->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
+
/* optional */
/* c2. GNB_CU_Name */
if (f1ap_setup_resp->gNB_CU_name != NULL) {
- ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_Name;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name;
- OCTET_STRING_fromBuf(&ie->value.choice.GNB_CU_Name, f1ap_setup_resp->gNB_CU_name,
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupResponseIEs_t, ie2);
+ ie2->id = F1AP_ProtocolIE_ID_id_gNB_CU_Name;
+ ie2->criticality = F1AP_Criticality_ignore;
+ ie2->value.present = F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name;
+ OCTET_STRING_fromBuf(&ie2->value.choice.GNB_CU_Name, f1ap_setup_resp->gNB_CU_name,
strlen(f1ap_setup_resp->gNB_CU_name));
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* mandatory */
/* c3. cells to be Activated list */
int num_cells_to_activate = f1ap_setup_resp->num_cells_to_activate;
LOG_D(F1AP, "num_cells_to_activate = %d \n", num_cells_to_activate);
+
if (num_cells_to_activate >0) {
- ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
-
- for (i=0; icells_to_activate[i].mcc,
- f1ap_setup_resp->cells_to_activate[i].mnc,
- f1ap_setup_resp->cells_to_activate[i].mnc_digit_length,
- f1ap_setup_resp->cells_to_activate[i].nr_cellid);
-
- F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
- cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
- cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
- cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
- cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupResponseIEs_t, ie3);
+ ie3->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
+ ie3->criticality = F1AP_Criticality_reject;
+ ie3->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
+ for (int i=0; ivalue.choice.Cells_to_be_Activated_List.list,
+ F1AP_Cells_to_be_Activated_List_ItemIEs_t, cells_to_be_activated_ies);
+ cells_to_be_activated_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
+ cells_to_be_activated_ies->criticality = F1AP_Criticality_reject;
+ cells_to_be_activated_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
/* 3.1 cells to be Activated list item */
- F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
- memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
-
+ F1AP_Cells_to_be_Activated_List_Item_t *cells_to_be_activated_item=
+ &cells_to_be_activated_ies->value.choice.Cells_to_be_Activated_List_Item;
/* - nRCGI */
- F1AP_NRCGI_t nRCGI;
- memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
- MCC_MNC_TO_PLMNID(f1ap_setup_resp->cells_to_activate[i].mcc, f1ap_setup_resp->cells_to_activate[i].mnc, f1ap_setup_resp->cells_to_activate[i].mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
- cells_to_be_activated_list_item.nRCGI = nRCGI;
+ addnRCGI(cells_to_be_activated_item->nRCGI, f1ap_setup_resp->cells_to_activate+i);
/* optional */
/* - nRPCI */
if (1) {
- cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
- *cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->cells_to_activate[i].nrpci; // int 0..1007
+ cells_to_be_activated_item->nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
+ *cells_to_be_activated_item->nRPCI = f1ap_setup_resp->cells_to_activate[i].nrpci; // int 0..1007
}
/* optional */
/* - gNB-CU System Information */
if (1) {
- /* 3.1.2 gNB-CUSystem Information */
- F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
- cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
- cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
- cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
- cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
+ /* 3.1.2 gNB-CUSystem Information */
+ F1AP_ProtocolExtensionContainer_154P112_t *p_154P112=calloc(1, sizeof(* p_154P112));
+ cells_to_be_activated_item->iE_Extensions = (struct F1AP_ProtocolExtensionContainer *)p_154P112;
+ asn1cSequenceAdd(p_154P112->list, F1AP_Cells_to_be_Activated_List_ItemExtIEs_t, cells_to_be_activated_itemExtIEs);
+ cells_to_be_activated_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
+ cells_to_be_activated_itemExtIEs->criticality = F1AP_Criticality_reject;
+ cells_to_be_activated_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
+ F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation =
+ &cells_to_be_activated_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
- F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
- //LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
- //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
- // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
- //printf("\n");
-
- // for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
- for (int sIBtype=2;sIBtype<21;sIBtype++) {
- if (f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
- AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
- F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
- memset((void*)sib_item,0,sizeof(*sib_item));
- sib_item->sIBtype = sIBtype;
- OCTET_STRING_fromBuf(&sib_item->sIBmessage,
- (const char*)f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype],
- f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
-
- LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
- ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
+ // for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
+ for (int sIBtype=2; sIBtype<21; sIBtype++) {
+ if (f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
+ AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
+ asn1cSequenceAdd(gNB_CUSystemInformation->sibtypetobeupdatedlist.list, F1AP_SibtypetobeupdatedListItem_t, sib_item);
+ sib_item->sIBtype = sIBtype;
+ OCTET_STRING_fromBuf(&sib_item->sIBmessage,
+ (const char *)f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype],
+ f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
+ LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
+ }
}
}
- cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
-
- F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
- memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
-
- ASN_SEQUENCE_ADD(&p_154P112_t.list, cells_to_be_activated_list_itemExtIEs);
- cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
-
- free(gNB_CUSystemInformation);
- gNB_CUSystemInformation = NULL;
- }
- /* ADD */
- cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list, cells_to_be_activated_list_item_ies);
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* encode */
@@ -415,84 +377,68 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
return -1;
}
- cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
-
+ ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
+ f1ap_itti_send_sctp_data_req(true, instance, buffer, len, 0);
return 0;
}
int CU_send_F1_SETUP_FAILURE(instance_t instance) {
LOG_D(F1AP, "CU_send_F1_SETUP_FAILURE\n");
-
- module_id_t enb_mod_idP;
- module_id_t cu_mod_idP;
-
+ instance_t enb_mod_idP=0;
+ instance_t cu_mod_idP=0;
// This should be fixed
- enb_mod_idP = (module_id_t)0;
- cu_mod_idP = (module_id_t)0;
-
- F1AP_F1AP_PDU_t pdu;
- F1AP_F1SetupFailure_t *out;
- F1AP_F1SetupFailureIEs_t *ie;
-
- uint8_t *buffer;
- uint32_t len;
-
+ F1AP_F1AP_PDU_t pdu= {0};
+ uint8_t *buffer=NULL;
+ uint32_t len=0;
/* Create */
/* 0. Message Type */
- memset(&pdu, 0, sizeof(pdu));
+ asn1cCalloc(pdu.choice.unsuccessfulOutcome, UnsuccessfulOutcome);
pdu.present = F1AP_F1AP_PDU_PR_unsuccessfulOutcome;
- pdu.choice.unsuccessfulOutcome = (F1AP_UnsuccessfulOutcome_t *)calloc(1, sizeof(F1AP_UnsuccessfulOutcome_t));
- pdu.choice.unsuccessfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup;
- pdu.choice.unsuccessfulOutcome->criticality = F1AP_Criticality_reject;
- pdu.choice.unsuccessfulOutcome->value.present = F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure;
- out = &pdu.choice.unsuccessfulOutcome->value.choice.F1SetupFailure;
-
+ UnsuccessfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup;
+ UnsuccessfulOutcome->criticality = F1AP_Criticality_reject;
+ UnsuccessfulOutcome->value.present = F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure;
+ F1AP_F1SetupFailure_t *out = &pdu.choice.unsuccessfulOutcome->value.choice.F1SetupFailure;
/* mandatory */
/* c1. Transaction ID (integer value)*/
- ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_F1SetupFailureIEs__value_PR_TransactionID;
- ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupFailureIEs_t, ie1);
+ ie1->id = F1AP_ProtocolIE_ID_id_TransactionID;
+ ie1->criticality = F1AP_Criticality_reject;
+ ie1->value.present = F1AP_F1SetupFailureIEs__value_PR_TransactionID;
+ ie1->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
/* mandatory */
/* c2. Cause */
- ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_Cause;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_F1SetupFailureIEs__value_PR_Cause;
- ie->value.choice.Cause.present = F1AP_Cause_PR_radioNetwork;
- ie->value.choice.Cause.choice.radioNetwork = F1AP_CauseRadioNetwork_unspecified;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupFailureIEs_t, ie2);
+ ie2->id = F1AP_ProtocolIE_ID_id_Cause;
+ ie2->criticality = F1AP_Criticality_ignore;
+ ie2->value.present = F1AP_F1SetupFailureIEs__value_PR_Cause;
+ ie2->value.choice.Cause.present = F1AP_Cause_PR_radioNetwork;
+ ie2->value.choice.Cause.choice.radioNetwork = F1AP_CauseRadioNetwork_unspecified;
/* optional */
/* c3. TimeToWait */
if (0) {
- ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_TimeToWait;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_F1SetupFailureIEs__value_PR_TimeToWait;
- ie->value.choice.TimeToWait = F1AP_TimeToWait_v10s;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupFailureIEs_t, ie3);
+ ie3->id = F1AP_ProtocolIE_ID_id_TimeToWait;
+ ie3->criticality = F1AP_Criticality_ignore;
+ ie3->value.present = F1AP_F1SetupFailureIEs__value_PR_TimeToWait;
+ ie3->value.choice.TimeToWait = F1AP_TimeToWait_v10s;
}
/* optional */
/* c4. CriticalityDiagnostics*/
if (0) {
- ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_F1SetupFailureIEs__value_PR_CriticalityDiagnostics;
- ie->value.choice.CriticalityDiagnostics.procedureCode = (F1AP_ProcedureCode_t *)calloc(1, sizeof(F1AP_ProcedureCode_t));
- *ie->value.choice.CriticalityDiagnostics.procedureCode = F1AP_ProcedureCode_id_UEContextSetup;
- ie->value.choice.CriticalityDiagnostics.triggeringMessage = (F1AP_TriggeringMessage_t *)calloc(1, sizeof(F1AP_TriggeringMessage_t));
- *ie->value.choice.CriticalityDiagnostics.triggeringMessage = F1AP_TriggeringMessage_initiating_message;
- ie->value.choice.CriticalityDiagnostics.procedureCriticality = (F1AP_Criticality_t *)calloc(1, sizeof(F1AP_Criticality_t));
- *ie->value.choice.CriticalityDiagnostics.procedureCriticality = F1AP_Criticality_reject;
- ie->value.choice.CriticalityDiagnostics.transactionID = (F1AP_TransactionID_t *)calloc(1, sizeof(F1AP_TransactionID_t));
- *ie->value.choice.CriticalityDiagnostics.transactionID = 0;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_F1SetupFailureIEs_t, ie4);
+ ie4->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics;
+ ie4->criticality = F1AP_Criticality_ignore;
+ ie4->value.present = F1AP_F1SetupFailureIEs__value_PR_CriticalityDiagnostics;
+ asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.procedureCode,
+ F1AP_ProcedureCode_id_UEContextSetup);
+ asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.triggeringMessage,
+ F1AP_TriggeringMessage_initiating_message);
+ asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.procedureCriticality,
+ F1AP_Criticality_reject);
+ asn1cCallocOne(ie4->value.choice.CriticalityDiagnostics.transactionID,
+ 0);
}
/* encode */
@@ -501,451 +447,306 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) {
return -1;
}
- cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
-
+ ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
+ f1ap_itti_send_sctp_data_req(true,instance, buffer, len, 0);
return 0;
}
-
-
/*
gNB-DU Configuration Update
*/
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
- F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) {
+ F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
- F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) {
+ F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
-
-
/*
gNB-CU Configuration Update
*/
//void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) {
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update) {
- F1AP_F1AP_PDU_t pdu;
- F1AP_GNBCUConfigurationUpdate_t *out;
- F1AP_GNBCUConfigurationUpdateIEs_t *ie;
-
+ F1AP_F1AP_PDU_t pdu= {0};
uint8_t *buffer;
uint32_t len;
- int i = 0;
-
-
/* Create */
/* 0. Message Type */
- memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
- pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
- pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
- pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
- pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate;
- out = &pdu.choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate;
-
+ asn1cCalloc(pdu.choice.initiatingMessage, initMsg);
+ initMsg->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
+ initMsg->criticality = F1AP_Criticality_reject;
+ initMsg->value.present = F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate;
+ F1AP_GNBCUConfigurationUpdate_t *cfgUpdate = &pdu.choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate;
/* mandatory */
/* c1. Transaction ID (integer value) */
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID;
- ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, 0);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
-
+ asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC1);
+ ieC1->id = F1AP_ProtocolIE_ID_id_TransactionID;
+ ieC1->criticality = F1AP_Criticality_reject;
+ ieC1->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID;
+ ieC1->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, 0);
// mandatory
// c2. Cells_to_be_Activated_List
if (f1ap_gnb_cu_configuration_update->num_cells_to_activate > 0) {
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List;
-
- for (i=0; inum_cells_to_activate; i++) {
-
- LOG_D(F1AP, "[c2] (cell %d) mcc = %d, mnc = %d, mnc_digit_length = %d, nr_cellid = %lu\n",
- i,
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid);
-
- F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
- cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
- cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
- cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
- cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
+ asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC3);
+ ieC3->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
+ ieC3->criticality = F1AP_Criticality_reject;
+ ieC3->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List;
+ for (int i=0; inum_cells_to_activate; i++) {
+ asn1cSequenceAdd(ieC3->value.choice.Cells_to_be_Activated_List.list,F1AP_Cells_to_be_Activated_List_ItemIEs_t,
+ cells_to_be_activated_ies);
+ cells_to_be_activated_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
+ cells_to_be_activated_ies->criticality = F1AP_Criticality_reject;
+ cells_to_be_activated_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
// 2.1 cells to be Activated list item
- F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
- memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
-
+ F1AP_Cells_to_be_Activated_List_Item_t *cells_to_be_activated_list_item=
+ &cells_to_be_activated_ies->value.choice.Cells_to_be_Activated_List_Item;
// - nRCGI
- F1AP_NRCGI_t nRCGI;
- memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
- MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid,
- &nRCGI.nRCellIdentity);
- cells_to_be_activated_list_item.nRCGI = nRCGI;
+ addnRCGI(cells_to_be_activated_list_item->nRCGI, f1ap_gnb_cu_configuration_update->cells_to_activate+i);
+ // optional
+ // -nRPCI
+ asn1cCalloc(cells_to_be_activated_list_item->nRPCI, tmp);
+ *tmp = f1ap_gnb_cu_configuration_update->cells_to_activate[i].nrpci; // int 0..1007
+ // optional
+ // 3.1.2 gNB-CUSystem Information
+ F1AP_ProtocolExtensionContainer_154P112_t *p_154P112=(F1AP_ProtocolExtensionContainer_154P112_t *) calloc(1,sizeof(*p_154P112));
+ cells_to_be_activated_list_item->iE_Extensions = (struct F1AP_ProtocolExtensionContainer *)p_154P112;
+ //F1AP_ProtocolExtensionContainer_154P112_t
+ asn1cSequenceAdd(p_154P112->list,F1AP_Cells_to_be_Activated_List_ItemExtIEs_t, cells_to_be_activated_itemExtIEs);
+ cells_to_be_activated_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
+ cells_to_be_activated_itemExtIEs->criticality = F1AP_Criticality_reject;
+ cells_to_be_activated_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
- if(RC.nrrrc) {
+ if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].num_SI > 0) {
+ F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation =
+ &cells_to_be_activated_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation;
+ //LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
+ //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
+ // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
+ //printf("\n");
- // optional
- // -nRPCI
- cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
- *cells_to_be_activated_list_item.nRPCI = f1ap_gnb_cu_configuration_update->cells_to_activate[i].nrpci; // int 0..1007
-
- // optional
- // 3.1.2 gNB-CUSystem Information
- F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
- cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
- cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
- cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
- cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
-
- if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].num_SI > 0) {
- F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
- //LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
- //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
- // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
- //printf("\n");
-
- // for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
- for (int sIBtype=2;sIBtype<21;sIBtype++) {
- if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
- AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
- F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
- memset((void*)sib_item,0,sizeof(*sib_item));
- sib_item->sIBtype = sIBtype;
- OCTET_STRING_fromBuf(&sib_item->sIBmessage,
- (const char*)f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype],
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
-
- LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
- ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
- }
+ // for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
+ for (int sIBtype=2; sIBtype<21; sIBtype++) {
+ if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
+ AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
+ asn1cSequenceAdd(gNB_CUSystemInformation->sibtypetobeupdatedlist.list, F1AP_SibtypetobeupdatedListItem_t, sib_item);
+ sib_item->sIBtype = sIBtype;
+ OCTET_STRING_fromBuf(&sib_item->sIBmessage,
+ (const char *)f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype],
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
+ LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
}
- cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
-
-
- F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
- memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
-
- ASN_SEQUENCE_ADD(&p_154P112_t.list,
- cells_to_be_activated_list_itemExtIEs);
- cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
-
- free(gNB_CUSystemInformation);
- gNB_CUSystemInformation = NULL;
}
}
-
- // ADD
- cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
- cells_to_be_activated_list_item_ies);
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
}
-
+ // c3. Cells_to_be_Deactivated_List
+ //
+ /*
if(!RC.nrrrc) {
+ // mandatory
+ // c3. Cells_to_be_Deactivated_List
+ asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC3);
+ ieC3->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List;
+ ieC3->criticality = F1AP_Criticality_reject;
+ ieC3->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Deactivated_List;
- /* mandatory */
- /* c3. Cells_to_be_Deactivated_List */
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Deactivated_List;
-
- for (i=0;
- i<1;
- i++) {
-
- F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *cells_to_be_deactivated_list_item_ies;
- cells_to_be_deactivated_list_item_ies = (F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Deactivated_List_ItemIEs_t));
- cells_to_be_deactivated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
- cells_to_be_deactivated_list_item_ies->criticality = F1AP_Criticality_reject;
- cells_to_be_deactivated_list_item_ies->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item;
-
+ for (int i=0; i<1; i++) {
+ asn1cSequenceAdd(ieC3->value.choice.Cells_to_be_Deactivated_List.list,
+ F1AP_Cells_to_be_Deactivated_List_ItemIEs_t, cells_to_be_deactivated);
+ cells_to_be_deactivated->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
+ cells_to_be_deactivated->criticality = F1AP_Criticality_reject;
+ cells_to_be_deactivated->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item;
// 3.1 cells to be Deactivated list item
- F1AP_Cells_to_be_Deactivated_List_Item_t cells_to_be_deactivated_list_item;
- memset((void *)&cells_to_be_deactivated_list_item, 0, sizeof(F1AP_Cells_to_be_Deactivated_List_Item_t));
-
-
- F1AP_NRCGI_t nRCGI;
- memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
- MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
- cells_to_be_deactivated_list_item.nRCGI = nRCGI;
-
- cells_to_be_deactivated_list_item_ies->value.choice.Cells_to_be_Deactivated_List_Item = cells_to_be_deactivated_list_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Deactivated_List.list,
- cells_to_be_deactivated_list_item_ies);
- }
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
-
- /* mandatory */
- /* c4. GNB_CU_TNL_Association_To_Add_List */
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Add_List;
-
- for (i=0;
- i<1;
- i++) {
-
- F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *gnb_cu_tnl_association_to_add_item_ies;
- gnb_cu_tnl_association_to_add_item_ies = (F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t));
- gnb_cu_tnl_association_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_Item;
- gnb_cu_tnl_association_to_add_item_ies->criticality = F1AP_Criticality_reject;
- gnb_cu_tnl_association_to_add_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item;
-
- // 4.1 GNB_CU_TNL_Association_To_Add_Item
- F1AP_GNB_CU_TNL_Association_To_Add_Item_t gnb_cu_tnl_association_to_add_item;
- memset((void *)&gnb_cu_tnl_association_to_add_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_Item_t));
-
-
- // 4.1.1 tNLAssociationTransportLayerAddress
- F1AP_CP_TransportLayerAddress_t transportLayerAddress;
- memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
- TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
-
- // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
- // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
- // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
-
- gnb_cu_tnl_association_to_add_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
-
- // 4.1.2 tNLAssociationUsage
- gnb_cu_tnl_association_to_add_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
-
-
-
- gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item = gnb_cu_tnl_association_to_add_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
- gnb_cu_tnl_association_to_add_item_ies);
- }
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
-
- /* mandatory */
- /* c5. GNB_CU_TNL_Association_To_Remove_List */
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Remove_List;
- for (i=0;
- i<1;
- i++) {
-
- F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *gnb_cu_tnl_association_to_remove_item_ies;
- gnb_cu_tnl_association_to_remove_item_ies = (F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t));
- gnb_cu_tnl_association_to_remove_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_Item;
- gnb_cu_tnl_association_to_remove_item_ies->criticality = F1AP_Criticality_reject;
- gnb_cu_tnl_association_to_remove_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item;
-
- // 4.1 GNB_CU_TNL_Association_To_Remove_Item
- F1AP_GNB_CU_TNL_Association_To_Remove_Item_t gnb_cu_tnl_association_to_remove_item;
- memset((void *)&gnb_cu_tnl_association_to_remove_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_Item_t));
-
-
- // 4.1.1 tNLAssociationTransportLayerAddress
- F1AP_CP_TransportLayerAddress_t transportLayerAddress;
- memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
- TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
-
- // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
- // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
- // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
-
- gnb_cu_tnl_association_to_remove_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
-
-
-
- gnb_cu_tnl_association_to_remove_item_ies->value.choice.GNB_CU_TNL_Association_To_Remove_Item = gnb_cu_tnl_association_to_remove_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
- gnb_cu_tnl_association_to_remove_item_ies);
- }
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
-
- /* mandatory */
- /* c6. GNB_CU_TNL_Association_To_Update_List */
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Update_List;
- for (i=0;
- i<1;
- i++) {
-
- F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *gnb_cu_tnl_association_to_update_item_ies;
- gnb_cu_tnl_association_to_update_item_ies = (F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t));
- gnb_cu_tnl_association_to_update_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_Item;
- gnb_cu_tnl_association_to_update_item_ies->criticality = F1AP_Criticality_reject;
- gnb_cu_tnl_association_to_update_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item;
-
- // 4.1 GNB_CU_TNL_Association_To_Update_Item
- F1AP_GNB_CU_TNL_Association_To_Update_Item_t gnb_cu_tnl_association_to_update_item;
- memset((void *)&gnb_cu_tnl_association_to_update_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_Item_t));
-
-
- // 4.1.1 tNLAssociationTransportLayerAddress
- F1AP_CP_TransportLayerAddress_t transportLayerAddress;
- memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
- TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
-
- // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
- // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
- // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
-
- gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
-
-
- // 4.1.2 tNLAssociationUsage
- if (1) {
- gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t));
- *gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
+ F1AP_Cells_to_be_Deactivated_List_Item_t *cells_to_be_deactivated_list=
+ cells_to_be_deactivated->value.choice.Cells_to_be_Deactivated_List_Item;
+ addnRCGI(cells_to_be_deactivated_item->nRCGI, f1ap_setup_resp->cells_to_deactivate+i);
}
-
-
- gnb_cu_tnl_association_to_update_item_ies->value.choice.GNB_CU_TNL_Association_To_Update_Item = gnb_cu_tnl_association_to_update_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
- gnb_cu_tnl_association_to_update_item_ies);
- }
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
-
- /* mandatory */
- /* c7. Cells_to_be_Barred_List */
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Barred_List;
- for (i=0;
- i<1;
- i++) {
-
- F1AP_Cells_to_be_Barred_ItemIEs_t *cells_to_be_barred_item_ies;
- cells_to_be_barred_item_ies = (F1AP_Cells_to_be_Barred_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Barred_ItemIEs_t));
- cells_to_be_barred_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
- cells_to_be_barred_item_ies->criticality = F1AP_Criticality_reject;
- cells_to_be_barred_item_ies->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item;
-
- // 7.1 cells to be Deactivated list item
- F1AP_Cells_to_be_Barred_Item_t cells_to_be_barred_item;
- memset((void *)&cells_to_be_barred_item, 0, sizeof(F1AP_Cells_to_be_Barred_Item_t));
-
- // - nRCGI
- F1AP_NRCGI_t nRCGI;
- memset(&nRCGI,0,sizeof(F1AP_NRCGI_t));
- MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
- cells_to_be_barred_item.nRCGI = nRCGI;
-
- // 7.2 cellBarred
- cells_to_be_barred_item.cellBarred = F1AP_CellBarred_not_barred;
-
- cells_to_be_barred_item_ies->value.choice.Cells_to_be_Barred_Item = cells_to_be_barred_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Barred_List.list,
- cells_to_be_barred_item_ies);
- }
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
-
- /* mandatory */
- /* c8. Protected_EUTRA_Resources_List */
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Protected_EUTRA_Resources_List;
-
- for (i=0;
- i<1;
- i++) {
-
-
- F1AP_Protected_EUTRA_Resources_ItemIEs_t *protected_eutra_resources_item_ies;
-
- // 8.1 SpectrumSharingGroupID
- protected_eutra_resources_item_ies = (F1AP_Protected_EUTRA_Resources_ItemIEs_t *)calloc(1, sizeof(F1AP_Protected_EUTRA_Resources_ItemIEs_t));
- protected_eutra_resources_item_ies->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
- protected_eutra_resources_item_ies->criticality = F1AP_Criticality_reject;
- protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_Protected_EUTRA_Resources_Item;
- ((F1AP_Protected_EUTRA_Resources_Item_t*)&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item)->spectrumSharingGroupID = 123L;
- memset(&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item,0,
- sizeof(F1AP_Protected_EUTRA_Resources_Item_t));
- ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
-
- /*
- F1AP_Served_EUTRA_Cells_Information_t served_eutra_cells_information;
- memset((void *)&served_eutra_cells_information, 0, sizeof(F1AP_Served_EUTRA_Cells_Information_t));
-
- F1AP_EUTRA_Mode_Info_t eUTRA_Mode_Info;
- memset((void *)&eUTRA_Mode_Info, 0, sizeof(F1AP_EUTRA_Mode_Info_t));
-
- // eUTRAFDD
- eUTRA_Mode_Info.present = F1AP_EUTRA_Mode_Info_PR_eUTRAFDD;
- F1AP_EUTRA_FDD_Info_t *eutra_fdd_info;
- eutra_fdd_info = (F1AP_EUTRA_FDD_Info_t *)calloc(1, sizeof(F1AP_EUTRA_FDD_Info_t));
- eutra_fdd_info->uL_offsetToPointA = 123L;
- eutra_fdd_info->dL_offsetToPointA = 456L;
- eUTRA_Mode_Info.choice.eUTRAFDD = eutra_fdd_info;
-
- // eUTRATDD
- // eUTRA_Mode_Info.present = F1AP_EUTRA_Mode_Info_PR_eUTRATDD;
- // F1AP_EUTRA_TDD_Info_t *eutra_tdd_info;
- // eutra_tdd_info = (F1AP_EUTRA_TDD_Info_t *)calloc(1, sizeof(F1AP_EUTRA_TDD_Info_t));
- // eutra_tdd_info->uL_offsetToPointA = 123L;
- // eutra_tdd_info->dL_offsetToPointA = 456L;
- // eUTRA_Mode_Info.choice.eUTRATDD = eutra_tdd_info;
-
- served_eutra_cells_information.eUTRA_Mode_Info = eUTRA_Mode_Info;
-
- OCTET_STRING_fromBuf(&served_eutra_cells_information.protectedEUTRAResourceIndication, "asdsa1d32sa1d31asd31as",
- strlen("asdsa1d32sa1d31asd31as"));
-
- ASN_SEQUENCE_ADD(&protected_eutra_resources_item_ies->value.choice.ListofEUTRACellsinGNBDUCoordination.list, &served_eutra_cells_information);
-
- ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
- */
- }
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
+ */
+ // c4. GNB_CU_TNL_Association_To_Add_List
+ /*
+ asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC4);
+ ieC4->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List;
+ ieC4->criticality = F1AP_Criticality_reject;
+ ieC4->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Add_List;
+
+ for (int i=0; i<1; i++) {
+ asn1cSequenceAdd(ieC4->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
+ F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t, gnb_cu_tnl_association_to_add;
+ gnb_cu_tnl_association_to_add->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_Item;
+ gnb_cu_tnl_association_to_add->criticality = F1AP_Criticality_reject;
+ gnb_cu_tnl_association_to_add->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item;
+
+ // 4.1 GNB_CU_TNL_Association_To_Add_Item
+ F1AP_GNB_CU_TNL_Association_To_Add_Item_t *gnb_cu_tnl_association_to_add_item=
+ &gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item;
+
+ // 4.1.1 tNLAssociationTransportLayerAddress
+ F1AP_CP_TransportLayerAddress_t *transportLayerAddress=;
+ gnb_cu_tnl_association_to_add->value.choice.GNB_CU_TNL_Association_To_Add_Item;
+
+ transportLayerAddress->present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
+ TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress->choice.endpoint_IP_address);
+
+ // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
+ // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
+ // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
+ // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
+
+ // 4.1.2 tNLAssociationUsage
+ gnb_cu_tnl_association_to_add_item->tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
+ }
+ */
+
+ /*
+ // c5. GNB_CU_TNL_Association_To_Remove_List
+ asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC5);
+ ieC5->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List;
+ ieC5->criticality = F1AP_Criticality_reject;
+ ieC5->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Remove_List;
+ for (int i=0; i<1; i++) {
+ asn1cSequenceAdd(ieC5->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
+ F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t, gnb_cu_tnl_association_to_remove);
+ gnb_cu_tnl_association_to_remove->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_Item;
+ gnb_cu_tnl_association_to_remove->criticality = F1AP_Criticality_reject;
+ gnb_cu_tnl_association_to_remove->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item;
+
+ // 4.1 GNB_CU_TNL_Association_To_Remove_Item
+ F1AP_GNB_CU_TNL_Association_To_Remove_Item_t *gnb_cu_tnl_association_to_remove_item=
+ &gnb_cu_tnl_association_to_remove->value.choice.GNB_CU_TNL_Association_To_Remove_Item;
+
+ // 4.1.1 tNLAssociationTransportLayerAddress
+ F1AP_CP_TransportLayerAddress_t *transportLayerAddress=
+ &gnb_cu_tnl_association_to_remove_item->tNLAssociationTransportLayerAddress;
+ transportLayerAddress->present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
+ TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress->choice.endpoint_IP_address);
+
+ // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
+ // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
+ // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
+ // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
+ }
+ */
+
+ /*
+ //mandatory
+ // c6. GNB_CU_TNL_Association_To_Update_List
+ asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC6);
+ ieC6->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List;
+ ieC6->criticality = F1AP_Criticality_reject;
+ ieC6->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Update_List;
+
+ for (int i=0; i<1; i++) {
+ asn1cSequenceAdd(ieC3->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
+ F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t, gnb_cu_tnl_association_to_update);
+ gnb_cu_tnl_association_to_update->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_Item;
+ gnb_cu_tnl_association_to_update->criticality = F1AP_Criticality_reject;
+ gnb_cu_tnl_association_to_update->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item;
+ // 4.1 GNB_CU_TNL_Association_To_Update_Item
+ F1AP_GNB_CU_TNL_Association_To_Update_Item_t *gnb_cu_tnl_association_to_update_item=
+ &gnb_cu_tnl_association_to_update->value.choice.GNB_CU_TNL_Association_To_Update_Item;
+ // 4.1.1 tNLAssociationTransportLayerAddress
+ F1AP_CP_TransportLayerAddress_t *transportLayerAddress=
+ &gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress;
+ transportLayerAddress->present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
+ TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress->choice.endpoint_IP_address);
+ // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
+ // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
+ // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
+ // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
+ // 4.1.2 tNLAssociationUsage
+ if (1) {
+ gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t));
+ *gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
+ }
+ }
+ */
+
+ /*
+ // c7. Cells_to_be_Barred_List
+ asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC7);
+ ieC7->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List;
+ ieC7->criticality = F1AP_Criticality_reject;
+ ieC7->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Barred_List;
+
+ for (int i=0; i<1; i++) {
+ asn1cSequenceAdd(ieC7->value.choice.Cells_to_be_Barred_List.list,
+ F1AP_Cells_to_be_Barred_ItemIEs_t,cells_to_be_barred);
+ cells_to_be_barred->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
+ cells_to_be_barred->criticality = F1AP_Criticality_reject;
+ cells_to_be_barred->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item;
+ // 7.1 cells to be Deactivated list item
+ F1AP_Cells_to_be_Barred_Item_t *cells_to_be_barred_item=
+ &cells_to_be_barred_item_ies->value.choice.Cells_to_be_Barred_Item;
+ // - nRCGI
+ addnRCGI(cells_to_be_barred_item->nRCGI, f1ap_gnb_cu_configuration_update->cells_to_activate+i);
+ // 7.2 cellBarred
+ cells_to_be_barred_item->cellBarred = F1AP_CellBarred_not_barred;
+ }
+ */
+
+ /*
+ // c8. Protected_EUTRA_Resources_List
+ asn1cSequenceAdd(cfgUpdate->protocolIEs.list, F1AP_GNBCUConfigurationUpdateIEs_t, ieC8);
+ ieC8->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
+ ieC8->criticality = F1AP_Criticality_reject;
+ ieC8->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Protected_EUTRA_Resources_List;
+
+ for (int i=0; i<1; i++) {
+ asn1cSequenceAdd(ieC8->value.choice.Protected_EUTRA_Resources_List.list,
+ F1AP_Protected_EUTRA_Resources_ItemIEs_t, protected_eutra_resources);
+ // 8.1 SpectrumSharingGroupID
+ protected_eutra_resources->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
+ protected_eutra_resources->criticality = F1AP_Criticality_reject;
+ protected_eutra_resources->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_Protected_EUTRA_Resources_Item;
+ ((F1AP_Protected_EUTRA_Resources_Item_t *)&protected_eutra_resources->value.choice.Protected_EUTRA_Resources_Item)->spectrumSharingGroupID = 123L;
+ memset(&protected_eutra_resources->value.choice.Protected_EUTRA_Resources_Item,0,
+ sizeof(F1AP_Protected_EUTRA_Resources_Item_t));
+
+ asn1cSequenceAdd(protected_eutra_resources->value.choice.ListofEUTRACellsinGNBDUCoordination.list,
+ F1AP_Served_EUTRA_Cells_Information_t, served_eutra_cells_information);
+ memset((void *)&served_eutra_cells_information, 0, sizeof(F1AP_Served_EUTRA_Cells_Information_t));
+
+ F1AP_EUTRA_Mode_Info_t *eUTRA_Mode_Info=
+ &served_eutra_cells_information.eUTRA_Mode_Info;
+
+ // eUTRAFDD
+ eUTRA_Mode_Info->present = F1AP_EUTRA_Mode_Info_PR_eUTRAFDD;
+ F1AP_EUTRA_FDD_Info_t *eutra_fdd_info = (F1AP_EUTRA_FDD_Info_t *)calloc(1, sizeof(F1AP_EUTRA_FDD_Info_t));
+ eutra_fdd_info->uL_offsetToPointA = 123L;
+ eutra_fdd_info->dL_offsetToPointA = 456L;
+ eUTRA_Mode_Info.choice.eUTRAFDD = eutra_fdd_info;
+
+ // eUTRATDD
+ // eUTRA_Mode_Info.present = F1AP_EUTRA_Mode_Info_PR_eUTRATDD;
+ // F1AP_EUTRA_TDD_Info_t *eutra_tdd_info;
+ // eutra_tdd_info = (F1AP_EUTRA_TDD_Info_t *)calloc(1, sizeof(F1AP_EUTRA_TDD_Info_t));
+ // eutra_tdd_info->uL_offsetToPointA = 123L;
+ // eutra_tdd_info->dL_offsetToPointA = 456L;
+ // eUTRA_Mode_Info.choice.eUTRATDD = eutra_tdd_info;
+
+ OCTET_STRING_fromBuf(&served_eutra_cells_information.protectedEUTRAResourceIndication, "asdsa1d32sa1d31asd31as",
+ strlen("asdsa1d32sa1d31asd31as"));
+ }
+ */
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
@@ -953,38 +754,36 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
return -1;
}
- LOG_D(F1AP, "F1AP gNB-CU CONFIGURATION UPDATE\n");
- //for (int i=0;iassoc_id, buffer, len, 0);
+ LOG_DUMPMSG(F1AP, LOG_DUMP_CHAR, buffer, len, "F1AP gNB-CU CONFIGURATION UPDATE : ");
+ ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
+ f1ap_itti_send_sctp_data_req(true,instance, buffer, len, 0);
return 0;
}
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
- LOG_D(F1AP,"Cell Configuration ok (assoc_id %d)\n",assoc_id);
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
+ LOG_I(F1AP,"Cell Configuration ok (assoc_id %d)\n",assoc_id);
return(0);
}
int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
AssertFatal(0, "Not implemented yet\n");
}
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
- F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse) {
+ F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse) {
AssertFatal(0, "Not implemented yet\n");
}
diff --git a/openair2/F1AP/f1ap_cu_interface_management.h b/openair2/F1AP/f1ap_cu_interface_management.h
index de7dcfe99b..83da037925 100644
--- a/openair2/F1AP/f1ap_cu_interface_management.h
+++ b/openair2/F1AP/f1ap_cu_interface_management.h
@@ -72,39 +72,39 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance);
* gNB-DU Configuration Update
*/
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu);
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
- F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure);
+ F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure);
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
- F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge);
+ F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge);
/*
* gNB-CU Configuration Update
*/
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu);
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu);
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu);
/*
* gNB-DU Resource Coordination
*/
int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu);
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
- F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse);
+ F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse);
#endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */
diff --git a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c
index 8a5b9785b5..62a62095b1 100644
--- a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c
+++ b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c
@@ -38,78 +38,54 @@
#include "common/ran_context.h"
#include "openair3/UTILS/conversions.h"
-// Bing Kai: create CU and DU context, and put all the information there.
-uint64_t du_ue_f1ap_id = 0;
-uint32_t f1ap_assoc_id = 0;
-uint32_t f1ap_stream = 0;
-
-
-extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
-
/*
Initial UL RRC Message Transfer
*/
-extern RAN_CONTEXT_t RC;
-
int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
-
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
LOG_D(F1AP, "CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER\n");
// decode the F1 message
- // get the rrc message from the contauiner
+ // get the rrc message from the contauiner
// call func rrc_eNB_decode_ccch: <-- needs some update here
MessageDef *message_p;
F1AP_InitialULRRCMessageTransfer_t *container;
F1AP_InitialULRRCMessageTransferIEs_t *ie;
-
rnti_t rnti;
sdu_size_t ccch_sdu_len;
int CC_id =0;
-
-
DevAssert(pdu != NULL);
-
+
if (stream != 0) {
LOG_E(F1AP, "[SCTP %d] Received F1 on stream != 0 (%d)\n",
assoc_id, stream);
return -1;
}
- // TODO: use context
- f1ap_stream = stream;
- f1ap_assoc_id = assoc_id;
container = &pdu->choice.initiatingMessage->value.choice.InitialULRRCMessageTransfer;
-
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
- du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
- LOG_D(F1AP, "du_ue_f1ap_id %lu \n", du_ue_f1ap_id);
-
- /* NRCGI
- * TODO: process NRCGI
+ /* NRCGI
+ * Fixme: process NRCGI
*/
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_NRCGI, true);
-
-
uint64_t nr_cellid;
BIT_STRING_TO_NR_CELL_IDENTITY(&ie->value.choice.NRCGI.nRCellIdentity,nr_cellid);
-
/* RNTI */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_C_RNTI, true);
rnti = ie->value.choice.C_RNTI;
-
/* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, true);
AssertFatal(ie!=NULL,"RRCContainer is missing\n");
+
// create an ITTI message and copy SDU
- if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
+ if (f1ap_req(true, instance)->cell_type==CELL_MACRO_GNB) {
message_p = itti_alloc_new_message (TASK_CU_F1, 0, NR_RRC_MAC_CCCH_DATA_IND);
memset (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
ccch_sdu_len = ie->value.choice.RRCContainer.size;
@@ -123,310 +99,212 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
ccch_sdu_len);
}
- if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
+ LOG_I(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__, ie->value.choice.RRCContainer.size);
+ /* DUtoCURRCContainer */
+ F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
+ F1AP_ProtocolIE_ID_id_DUtoCURRCContainer, false);
- LOG_D(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__, ie->value.choice.RRCContainer.size);
- //for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
- // printf("%02x ", RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
- //printf("\n");
-
- /* DUtoCURRCContainer */
- F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
- F1AP_ProtocolIE_ID_id_DUtoCURRCContainer, true);
- if (ie) {
- NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container = malloc(sizeof(OCTET_STRING_t));
- NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->size = ie->value.choice.DUtoCURRCContainer.size;
- NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf = malloc(
- ie->value.choice.DUtoCURRCContainer.size);
- memcpy(NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf,
- ie->value.choice.DUtoCURRCContainer.buf,
- ie->value.choice.DUtoCURRCContainer.size);
- }
+ if (ie) {
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container = malloc(sizeof(OCTET_STRING_t));
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->size = ie->value.choice.DUtoCURRCContainer.size;
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf = malloc(ie->value.choice.DUtoCURRCContainer.size);
+ memcpy(NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf,
+ ie->value.choice.DUtoCURRCContainer.buf,
+ ie->value.choice.DUtoCURRCContainer.size);
}
- // Find instance from nr_cellid
- int rrc_inst = -1;
- if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
- for (int i=0;inr_cellid == nr_cellid) {
- rrc_inst = i;
- break;
- }
- }
- } else {
- for (int i=0;inr_cellid == nr_cellid) {
- rrc_inst = i;
- break;
- }
- }
- }
- AssertFatal(rrc_inst>=0,"couldn't find an RRC instance for nr_cell %llu\n",(unsigned long long int)nr_cellid);
+ int f1ap_uid = f1ap_add_ue(CUtype, instance, rnti);
- int f1ap_uid = f1ap_add_ue(&f1ap_cu_inst[rrc_inst], rrc_inst, CC_id, 0, rnti);
if (f1ap_uid < 0 ) {
LOG_E(F1AP, "Failed to add UE \n");
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
- f1ap_cu_inst[rrc_inst].f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
-
- if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
- NR_RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
- NR_RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
- NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
- NR_RRC_MAC_CCCH_DATA_IND (message_p).gnb_index = rrc_inst; // CU instance
- NR_RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
- NR_RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
- itti_send_msg_to_task (TASK_RRC_GNB, instance, message_p);
- } else {
- RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
- RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
- RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
- RRC_MAC_CCCH_DATA_IND (message_p).enb_index = rrc_inst; // CU instance
- RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
- RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
- itti_send_msg_to_task (TASK_RRC_ENB, instance, message_p);
- }
+ //getCxt(true,ITTI_MSG_DESTINATION_ID(message_p))->f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).nr_cellid = nr_cellid; // CU instance
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
+ itti_send_msg_to_task (f1ap_req(true,ITTI_MSG_DESTINATION_ID(message_p))->cell_type==CELL_MACRO_GNB?TASK_RRC_GNB:TASK_RRC_ENB, instance, message_p);
return 0;
}
-
/*
DL RRC Message Transfer.
*/
-
//void CU_send_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) {
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
- f1ap_dl_rrc_message_t *f1ap_dl_rrc)
- {
-
+ f1ap_dl_rrc_message_t *f1ap_dl_rrc) {
LOG_D(F1AP, "CU send DL_RRC_MESSAGE_TRANSFER \n");
- F1AP_F1AP_PDU_t pdu;
+ F1AP_F1AP_PDU_t pdu= {0};
F1AP_DLRRCMessageTransfer_t *out;
- F1AP_DLRRCMessageTransferIEs_t *ie;
-
- uint8_t *buffer;
- uint32_t len;
-
+ uint8_t *buffer=NULL;
+ uint32_t len=0;
/* Create */
- /* 0. Message Type */
- memset(&pdu, 0, sizeof(pdu));
+ /* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
- pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
- pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_DLRRCMessageTransfer;
- pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
- pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer;
- out = &pdu.choice.initiatingMessage->value.choice.DLRRCMessageTransfer;
-
+ asn1cCalloc(pdu.choice.initiatingMessage, tmp);
+ tmp->procedureCode = F1AP_ProcedureCode_id_DLRRCMessageTransfer;
+ tmp->criticality = F1AP_Criticality_ignore;
+ tmp->value.present = F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer;
+ out = &tmp->value.choice.DLRRCMessageTransfer;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
-
- ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
- ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_cu_inst[instance], f1ap_dl_rrc->rnti);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie1);
+ ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+ ie1->criticality = F1AP_Criticality_reject;
+ ie1->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
+ ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(CUtype, instance, f1ap_dl_rrc->rnti);
LOG_I(F1AP, "Setting GNB_CU_UE_F1AP_ID %llu associated with UE RNTI %x (instance %ld)\n",
- (unsigned long long int)ie->value.choice.GNB_CU_UE_F1AP_ID, f1ap_dl_rrc->rnti, instance);
-
-
+ (unsigned long long int)ie1->value.choice.GNB_CU_UE_F1AP_ID, f1ap_dl_rrc->rnti, instance);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
- ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
- ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_cu_inst[instance], f1ap_dl_rrc->rnti);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
- LOG_I(F1AP, "GNB_DU_UE_F1AP_ID %llu associated with UE RNTI %x \n", (unsigned long long int)ie->value.choice.GNB_DU_UE_F1AP_ID, f1ap_dl_rrc->rnti);
-
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie2);
+ ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+ ie2->criticality = F1AP_Criticality_reject;
+ ie2->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
+ ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(CUtype, instance, f1ap_dl_rrc->rnti);
+ LOG_I(F1AP, "GNB_DU_UE_F1AP_ID %llu associated with UE RNTI %x \n", (unsigned long long int)ie2->value.choice.GNB_DU_UE_F1AP_ID, f1ap_dl_rrc->rnti);
/* optional */
/* c3. oldgNB_DU_UE_F1AP_ID */
- /* if (f1ap_dl_rrc->old_gNB_DU_ue_id != 0xFFFFFFFF) {
- ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_NOTHING;
- ie->value.choice.oldgNB_DU_UE_F1AP_ID = f1ap_dl_rrc->old_gNB_DU_ue_id;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
- }*/
-
+ /* if (f1ap_dl_rrc->old_gNB_DU_ue_id != 0xFFFFFFFF) {
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie3);
+ ie3->id = F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID;
+ ie3->criticality = F1AP_Criticality_reject;
+ ie3->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_NOTHING;
+ ie3->value.choice.oldgNB_DU_UE_F1AP_ID = f1ap_dl_rrc->old_gNB_DU_ue_id;
+ }*/
/* mandatory */
/* c4. SRBID */
- ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_SRBID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_SRBID;
- ie->value.choice.SRBID = f1ap_dl_rrc->srb_id;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie4);
+ ie4->id = F1AP_ProtocolIE_ID_id_SRBID;
+ ie4->criticality = F1AP_Criticality_reject;
+ ie4->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_SRBID;
+ ie4->value.choice.SRBID = f1ap_dl_rrc->srb_id;
/* optional */
/* c5. ExecuteDuplication */
if (f1ap_dl_rrc->execute_duplication) {
- ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_ExecuteDuplication;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_ExecuteDuplication;
- ie->value.choice.ExecuteDuplication = F1AP_ExecuteDuplication_true;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie5);
+ ie5->id = F1AP_ProtocolIE_ID_id_ExecuteDuplication;
+ ie5->criticality = F1AP_Criticality_ignore;
+ ie5->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_ExecuteDuplication;
+ ie5->value.choice.ExecuteDuplication = F1AP_ExecuteDuplication_true;
}
// issue in here
/* mandatory */
/* c6. RRCContainer */
- ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RRCContainer;
- OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_dl_rrc->rrc_container, f1ap_dl_rrc->rrc_container_length);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
- if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
- LOG_I(F1AP, "%s() RRCContainer size %d: ", __func__, f1ap_dl_rrc->rrc_container_length);
- for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
- printf("%02x ", f1ap_dl_rrc->rrc_container[i]);
- printf("\n");
- }
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie6);
+ ie6->id = F1AP_ProtocolIE_ID_id_RRCContainer;
+ ie6->criticality = F1AP_Criticality_reject;
+ ie6->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RRCContainer;
+ OCTET_STRING_fromBuf(&ie6->value.choice.RRCContainer,
+ (const char *)f1ap_dl_rrc->rrc_container, f1ap_dl_rrc->rrc_container_length);
/* optional */
/* c7. RAT_FrequencyPriorityInformation */
- /* TODO */
- int endc=1;
- ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RAT_FrequencyPriorityInformation;
- if (endc==1) {
- ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_eNDC;
- ie->value.choice.RAT_FrequencyPriorityInformation.choice.eNDC = 123L;
- }
- else {
- ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN;
- ie->value.choice.RAT_FrequencyPriorityInformation.choice.nGRAN = 11L;
- }
+ /* TODO */
+ if (0) {
+ int endc=1;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_DLRRCMessageTransferIEs_t, ie7);
+ ie7->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
+ ie7->criticality = F1AP_Criticality_reject;
+ ie7->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RAT_FrequencyPriorityInformation;
+
+ if (endc==1) {
+ ie7->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_eNDC;
+ ie7->value.choice.RAT_FrequencyPriorityInformation.choice.eNDC = 123L;
+ } else {
+ ie7->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN;
+ ie7->value.choice.RAT_FrequencyPriorityInformation.choice.nGRAN = 11L;
+ }
+
//ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority;
//ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority = 123L;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
+ }
+
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 DL RRC MESSAGE TRANSFER \n");
return -1;
}
- cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id /* BK: fix me*/ , buffer, len, 0 /* BK: fix me*/);
-
+ f1ap_itti_send_sctp_data_req(true, instance, buffer, len, 0 /* BK: fix me*/);
return 0;
}
/*
UL RRC Message Transfer
*/
-
int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
-
LOG_D(F1AP, "CU_handle_UL_RRC_MESSAGE_TRANSFER \n");
-
F1AP_ULRRCMessageTransfer_t *container;
F1AP_ULRRCMessageTransferIEs_t *ie;
-
uint64_t cu_ue_f1ap_id;
uint64_t du_ue_f1ap_id;
uint64_t srb_id;
-
DevAssert(pdu != NULL);
-
+
if (stream != 0) {
LOG_E(F1AP, "[SCTP %d] Received F1 on stream != 0 (%d)\n",
- assoc_id, stream);
+ assoc_id, stream);
return -1;
}
container = &pdu->choice.initiatingMessage->value.choice.ULRRCMessageTransfer;
-
-
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
- LOG_D(F1AP, "cu_ue_f1ap_id %lu associated with RNTI %x\n", cu_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id));
-
-
+ LOG_D(F1AP, "cu_ue_f1ap_id %lu associated with RNTI %x\n",
+ cu_ue_f1ap_id, f1ap_get_rnti_by_cu_id(CUtype, instance, cu_ue_f1ap_id));
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
- LOG_D(F1AP, "du_ue_f1ap_id %lu associated with RNTI %x\n", du_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], du_ue_f1ap_id));
-
-
+ LOG_D(F1AP, "du_ue_f1ap_id %lu associated with RNTI %x\n",
+ du_ue_f1ap_id, f1ap_get_rnti_by_cu_id(CUtype, instance, du_ue_f1ap_id));
/* mandatory */
/* SRBID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SRBID, true);
srb_id = ie->value.choice.SRBID;
- if (srb_id < 1 )
- LOG_E(F1AP, "Unexpected UL RRC MESSAGE for srb_id %lu \n", srb_id);
- else
- LOG_D(F1AP, "UL RRC MESSAGE for srb_id %lu in DCCH \n", srb_id);
+ if (srb_id < 1 )
+ LOG_E(F1AP, "Unexpected UL RRC MESSAGE for srb_id %lu \n", srb_id);
+ else
+ LOG_D(F1AP, "UL RRC MESSAGE for srb_id %lu in DCCH \n", srb_id);
// issue in here
/* mandatory */
/* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, true);
- // print message in debug mode
-
- // create an ITTI message and copy SDU
-
- /*
-
- message_p = itti_alloc_new_message (TASK_CU_F1, 0, RRC_DCCH_DATA_IND);
-
- RRC_DCCH_DATA_IND (message_p).sdu_p = malloc(ie->value.choice.RRCContainer.size);
-
- RRC_DCCH_DATA_IND (message_p).sdu_size = ie->value.choice.RRCContainer.size;
- memcpy(RRC_DCCH_DATA_IND (message_p).sdu_p, ie->value.choice.RRCContainer.buf,
- ie->value.choice.RRCContainer.size);
-
- RRC_DCCH_DATA_IND (message_p).dcch_index = srb_id;
- RRC_DCCH_DATA_IND (message_p).rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id);
- RRC_DCCH_DATA_IND (message_p).module_id = instance;
- RRC_DCCH_DATA_IND (message_p).eNB_index = instance; // not needed for CU
-
- itti_send_msg_to_task(TASK_RRC_ENB, instance, message_p);
- */
- protocol_ctxt_t ctxt;
- ctxt.module_id = instance;
+ protocol_ctxt_t ctxt={0};
ctxt.instance = instance;
- ctxt.rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id);
+ ctxt.module_id = instance;
+ ctxt.rnti = f1ap_get_rnti_by_cu_id(CUtype, instance, cu_ue_f1ap_id);
ctxt.enb_flag = 1;
ctxt.eNB_index = 0;
- ctxt.configured = 1;
mem_block_t *mb = get_free_mem_block(ie->value.choice.RRCContainer.size,__func__);
- memcpy((void*)mb->data,(void*)ie->value.choice.RRCContainer.buf,ie->value.choice.RRCContainer.size);
+ memcpy((void *)mb->data,(void *)ie->value.choice.RRCContainer.buf,ie->value.choice.RRCContainer.size);
LOG_I(F1AP, "Calling pdcp_data_ind for UE RNTI %x srb_id %lu with size %ld (DCCH) \n", ctxt.rnti, srb_id, ie->value.choice.RRCContainer.size);
-
//LOG_I(F1AP, "%s() RRCContainer size %lu: ", __func__, ie->value.choice.RRCContainer.size);
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", mb->data[i]);
//printf("\n");
-
pdcp_data_ind (&ctxt,
- 1, // srb_flag
- 0, // embms_flag
- srb_id,
- ie->value.choice.RRCContainer.size,
- mb);
+ 1, // srb_flag
+ 0, // embms_flag
+ srb_id,
+ ie->value.choice.RRCContainer.size,
+ mb, NULL, NULL);
return 0;
}
diff --git a/openair2/F1AP/f1ap_cu_rrc_message_transfer.h b/openair2/F1AP/f1ap_cu_rrc_message_transfer.h
index 68ebbfe41e..c8c9d3a6f9 100644
--- a/openair2/F1AP/f1ap_cu_rrc_message_transfer.h
+++ b/openair2/F1AP/f1ap_cu_rrc_message_transfer.h
@@ -34,9 +34,9 @@
#define F1AP_CU_RRC_MESSAGE_TRANSFER_H_
int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu);
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu);
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
f1ap_dl_rrc_message_t *f1ap_dl_rrc);
diff --git a/openair2/F1AP/f1ap_cu_task.c b/openair2/F1AP/f1ap_cu_task.c
index b261d8e85b..13f08b9458 100644
--- a/openair2/F1AP/f1ap_cu_task.c
+++ b/openair2/F1AP/f1ap_cu_task.c
@@ -31,150 +31,134 @@
*/
#include "f1ap_common.h"
-#include "f1ap_handlers.h"
#include "f1ap_cu_interface_management.h"
#include "f1ap_cu_rrc_message_transfer.h"
#include "f1ap_cu_ue_context_management.h"
#include "f1ap_cu_task.h"
#include "proto_agent.h"
+#include
-extern RAN_CONTEXT_t RC;
-extern uint8_t proto_agent_flag;
+//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
+instance_t CUuniqInstance=0;
-f1ap_setup_req_t *f1ap_du_data_from_du;
-f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
-
-void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind) {
- // Nothing
+static instance_t cu_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) {
+ openAddr_t tmp= {0};
+ strncpy(tmp.originHost, IPaddrs->my_addr, sizeof(tmp.originHost)-1);
+ strncpy(tmp.destinationHost, IPaddrs->remote_addr, sizeof(tmp.destinationHost)-1);
+ sprintf(tmp.originService, "%d", IPaddrs->my_portd);
+ sprintf(tmp.destinationService, "%d", IPaddrs->remote_portd);
+ return ocp_gtpv1Init(tmp);
}
-void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
+static void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind,
+ eth_params_t *IPaddrs) {
+ createF1inst(true, instance, NULL);
+ // save the assoc id
+ f1ap_setup_req_t *f1ap_cu_data=f1ap_req(true, instance);
+ f1ap_cu_data->assoc_id = sctp_new_association_ind->assoc_id;
+ f1ap_cu_data->sctp_in_streams = sctp_new_association_ind->in_streams;
+ f1ap_cu_data->sctp_out_streams = sctp_new_association_ind->out_streams;
+ f1ap_cu_data->default_sctp_stream_id = 0;
+ getCxt(CUtype, instance)->gtpInst=cu_task_create_gtpu_instance_to_du(IPaddrs);
+ AssertFatal(getCxt(CUtype, instance)->gtpInst>0,"Failed to create CU F1-U UDP listener");
+ // Fixme: fully inconsistent instances management
+ // dirty global var is a bad fix
+ CUuniqInstance=getCxt(CUtype, instance)->gtpInst;
+}
+static void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
DevAssert(sctp_new_association_resp != NULL);
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %ld, cnx_id %u\n",
- sctp_new_association_resp->sctp_state,
- instance,
- sctp_new_association_resp->ulp_cnx_id);
-
- if (sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN)
- proto_agent_stop(instance);
- //f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
- return; // exit -1 for debugging
+ sctp_new_association_resp->sctp_state,
+ instance,
+ sctp_new_association_resp->ulp_cnx_id);
+ //if (sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN)
+ //proto_agent_stop(instance);
+ //f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
+ return; // exit -1 for debugging
}
-
- // go to an init func
- f1ap_du_data_from_du = (f1ap_setup_req_t *)calloc(1, sizeof(f1ap_setup_req_t));
- // save the assoc id
- f1ap_du_data_from_du->assoc_id = sctp_new_association_resp->assoc_id;
- f1ap_du_data_from_du->sctp_in_streams = sctp_new_association_resp->in_streams;
- f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams;
-
- /* setup parameters for F1U and start the server */
- const cudu_params_t params = (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_CU) ? (cudu_params_t){
- .local_ipv4_address = RC.nrrrc[instance]->eth_params_s.my_addr,
- .local_port = RC.nrrrc[instance]->eth_params_s.my_portd,
- .remote_ipv4_address = RC.nrrrc[instance]->eth_params_s.remote_addr,
- .remote_port = RC.nrrrc[instance]->eth_params_s.remote_portd
- } : (cudu_params_t){
- .local_ipv4_address = RC.rrc[instance]->eth_params_s.my_addr,
- .local_port = RC.rrc[instance]->eth_params_s.my_portd,
- .remote_ipv4_address = RC.rrc[instance]->eth_params_s.remote_addr,
- .remote_port = RC.rrc[instance]->eth_params_s.remote_portd
- };
- AssertFatal(proto_agent_start(instance, ¶ms) == 0,
- "could not start PROTO_AGENT for F1U on instance %ld!\n", instance);
- proto_agent_flag = 1;
}
-void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
+static void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
int result;
-
DevAssert(sctp_data_ind != NULL);
-
f1ap_handle_message(instance, sctp_data_ind->assoc_id, sctp_data_ind->stream,
- sctp_data_ind->buffer, sctp_data_ind->buffer_length);
-
+ sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
-void cu_task_send_sctp_init_req(instance_t enb_id) {
+static void cu_task_send_sctp_init_req(instance_t instance, char *my_addr) {
// 1. get the itti msg, and retrive the enb_id from the message
// 2. use RC.rrc[enb_id] to fill the sctp_init_t with the ip, port
// 3. creat an itti message to init
-
LOG_I(F1AP, "F1AP_CU_SCTP_REQ(create socket)\n");
MessageDef *message_p = NULL;
-
message_p = itti_alloc_new_message (TASK_CU_F1, 0, SCTP_INIT_MSG);
message_p->ittiMsg.sctp_init.port = F1AP_PORT_NUMBER;
message_p->ittiMsg.sctp_init.ppid = F1AP_SCTP_PPID;
message_p->ittiMsg.sctp_init.ipv4 = 1;
message_p->ittiMsg.sctp_init.ipv6 = 0;
message_p->ittiMsg.sctp_init.nb_ipv4_addr = 1;
- if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU) {
- message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(RC.nrrrc[enb_id]->eth_params_s.my_addr);
- } else{
- message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(RC.rrc[enb_id]->eth_params_s.my_addr);
- }
+ message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(my_addr);
/*
* SR WARNING: ipv6 multi-homing fails sometimes for localhost.
* * * * Disable it for now.
*/
message_p->ittiMsg.sctp_init.nb_ipv6_addr = 0;
message_p->ittiMsg.sctp_init.ipv6_address[0] = "0:0:0:0:0:0:0:1";
-
- itti_send_msg_to_task(TASK_SCTP, enb_id, message_p);
+ itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
-
void *F1AP_CU_task(void *arg) {
-
MessageDef *received_msg = NULL;
int result;
-
LOG_I(F1AP, "Starting F1AP at CU\n");
-
// no RLC in CU, initialize mem pool for PDCP
pool_buffer_init();
-
itti_mark_task_ready(TASK_CU_F1);
+ eth_params_t *IPaddrs;
- cu_task_send_sctp_init_req(0);
+ // Hardcoded instance id!
+ if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU)
+ IPaddrs=&RC.nrrrc[0]->eth_params_s;
+ else
+ IPaddrs=&RC.rrc[0]->eth_params_s;
+
+ cu_task_send_sctp_init_req(0, IPaddrs->my_addr);
while (1) {
itti_receive_msg(TASK_CU_F1, &received_msg);
- switch (ITTI_MSG_ID(received_msg)) {
+ switch (ITTI_MSG_ID(received_msg)) {
case SCTP_NEW_ASSOCIATION_IND:
LOG_I(F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_IND for instance %ld\n",
ITTI_MSG_DESTINATION_INSTANCE(received_msg));
- cu_task_handle_sctp_association_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
- &received_msg->ittiMsg.sctp_new_association_ind);
+ cu_task_handle_sctp_association_ind(ITTI_MSG_ORIGIN_INSTANCE(received_msg),
+ &received_msg->ittiMsg.sctp_new_association_ind,
+ IPaddrs);
break;
case SCTP_NEW_ASSOCIATION_RESP:
LOG_I(F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_RESP for instance %ld\n",
ITTI_MSG_DESTINATION_INSTANCE(received_msg));
cu_task_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
- &received_msg->ittiMsg.sctp_new_association_resp);
+ &received_msg->ittiMsg.sctp_new_association_resp);
break;
case SCTP_DATA_IND:
LOG_I(F1AP, "CU Task Received SCTP_DATA_IND for Instance %ld\n",
ITTI_MSG_DESTINATION_INSTANCE(received_msg));
cu_task_handle_sctp_data_ind(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
- &received_msg->ittiMsg.sctp_data_ind);
+ &received_msg->ittiMsg.sctp_data_ind);
break;
case F1AP_SETUP_RESP: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_SETUP_RESP\n");
- // CU_send_f1setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
- // &F1AP_SETUP_RESP(received_msg));
CU_send_F1_SETUP_RESPONSE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
- &F1AP_SETUP_RESP(received_msg));
+ &F1AP_SETUP_RESP(received_msg));
break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE: // from rrc
@@ -182,19 +166,19 @@ void *F1AP_CU_task(void *arg) {
// CU_send_f1setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
// &F1AP_SETUP_RESP(received_msg));
CU_send_gNB_CU_CONFIGURATION_UPDATE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
- &F1AP_GNB_CU_CONFIGURATION_UPDATE(received_msg));
+ &F1AP_GNB_CU_CONFIGURATION_UPDATE(received_msg));
break;
case F1AP_DL_RRC_MESSAGE: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_DL_RRC_MESSAGE\n");
CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
- &F1AP_DL_RRC_MESSAGE(received_msg));
+ &F1AP_DL_RRC_MESSAGE(received_msg));
break;
case F1AP_UE_CONTEXT_SETUP_REQ: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_UE_CONTEXT_SETUP_REQ\n");
CU_send_UE_CONTEXT_SETUP_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
- &F1AP_UE_CONTEXT_SETUP_REQ(received_msg));
+ &F1AP_UE_CONTEXT_SETUP_REQ(received_msg));
break;
case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc
@@ -203,13 +187,13 @@ void *F1AP_CU_task(void *arg) {
&F1AP_UE_CONTEXT_RELEASE_CMD(received_msg));
break;
-// case F1AP_SETUP_RESPONSE: // This is from RRC
-// CU_send_F1_SETUP_RESPONSE(instance, *f1ap_setup_ind, &(F1AP_SETUP_RESP) f1ap_setup_resp)
-// break;
-
-// case F1AP_SETUP_FAILURE: // This is from RRC
-// CU_send_F1_SETUP_FAILURE(instance, *f1ap_setup_ind, &(F1AP_SETUP_FAILURE) f1ap_setup_failure)
-// break;
+ // case F1AP_SETUP_RESPONSE: // This is from RRC
+ // CU_send_F1_SETUP_RESPONSE(instance, *f1ap_setup_ind, &(F1AP_SETUP_RESP) f1ap_setup_resp)
+ // break;
+
+ // case F1AP_SETUP_FAILURE: // This is from RRC
+ // CU_send_F1_SETUP_FAILURE(instance, *f1ap_setup_ind, &(F1AP_SETUP_FAILURE) f1ap_setup_failure)
+ // break;
case TERMINATE_MESSAGE:
LOG_W(F1AP, " *** Exiting F1AP thread\n");
@@ -221,9 +205,9 @@ void *F1AP_CU_task(void *arg) {
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
} // switch
+
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
-
received_msg = NULL;
} // while
diff --git a/openair2/F1AP/f1ap_cu_task.h b/openair2/F1AP/f1ap_cu_task.h
index dec844accf..9048d2b157 100644
--- a/openair2/F1AP/f1ap_cu_task.h
+++ b/openair2/F1AP/f1ap_cu_task.h
@@ -22,11 +22,6 @@
#ifndef F1AP_CU_TASK_H_
#define F1AP_CU_TASK_H_
-void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind);
-void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
-void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind);
-void cu_task_send_sctp_init_req(instance_t enb_id);
-
void *F1AP_CU_task(void *arg);
#endif /* F1AP_CU_TASK_H_ */
diff --git a/openair2/F1AP/f1ap_cu_ue_context_management.c b/openair2/F1AP/f1ap_cu_ue_context_management.c
index da723ba5a3..c68bfb3852 100644
--- a/openair2/F1AP/f1ap_cu_ue_context_management.c
+++ b/openair2/F1AP/f1ap_cu_ue_context_management.c
@@ -43,752 +43,589 @@
#include "rrc_eNB_S1AP.h"
#include "rrc_eNB_GTPV1U.h"
#include "openair2/RRC/NR/rrc_gNB_NGAP.h"
+#include
-extern f1ap_setup_req_t *f1ap_du_data_from_du;
-extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
-extern RAN_CONTEXT_t RC;
-extern uint32_t f1ap_assoc_id;
+static void setQos(F1AP_NonDynamic5QIDescriptor_t *toFill) {
+ asn1cCalloc(toFill, tmp);
+ /* fiveQI */
+ tmp->fiveQI = 1L;
+
+ /* OPTIONAL */
+ /* qoSPriorityLevel */
+ if (0) {
+ asn1cCallocOne(toFill->qoSPriorityLevel, 1L);
+ }
+
+ /* OPTIONAL */
+ /* averagingWindow */
+ if (0) {
+ asn1cCallocOne(toFill->averagingWindow, 1L);
+ }
+
+ /* OPTIONAL */
+ /* maxDataBurstVolume */
+ if (0) {
+ asn1cCallocOne(toFill->maxDataBurstVolume, 1L);
+ }
+}
int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
- f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req) {
- F1AP_F1AP_PDU_t pdu;
- F1AP_UEContextSetupRequest_t *out;
- F1AP_UEContextSetupRequestIEs_t *ie;
-
- uint8_t *buffer;
- uint32_t len;
- int i = 0, j = 0;
-
+ f1ap_ue_context_setup_t *f1ap_ue_context_setup_req) {
+ F1AP_F1AP_PDU_t pdu= {0};
/* Create */
/* 0. Message Type */
- memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
- pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
- pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_UEContextSetup;
- pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
- pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_UEContextSetupRequest;
- out = &pdu.choice.initiatingMessage->value.choice.UEContextSetupRequest;
-
+ asn1cCalloc(pdu.choice.initiatingMessage, tmp);
+ tmp->procedureCode = F1AP_ProcedureCode_id_UEContextSetup;
+ tmp->criticality = F1AP_Criticality_reject;
+ tmp->value.present = F1AP_InitiatingMessage__value_PR_UEContextSetupRequest;
+ F1AP_UEContextSetupRequest_t *out = &pdu.choice.initiatingMessage->value.choice.UEContextSetupRequest;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_GNB_CU_UE_F1AP_ID;
- ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_ue_context_setup_req->gNB_CU_ue_id;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie1);
+ ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+ ie1->criticality = F1AP_Criticality_reject;
+ ie1->value.present = F1AP_UEContextSetupRequestIEs__value_PR_GNB_CU_UE_F1AP_ID;
+ ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(CUtype, instance, f1ap_ue_context_setup_req->rnti); //f1ap_ue_context_setup_req->gNB_CU_ue_id;
/* optional */
/* c2. GNB_DU_UE_F1AP_ID */
if (f1ap_ue_context_setup_req->gNB_DU_ue_id) {
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_GNB_DU_UE_F1AP_ID;
- ie->value.choice.GNB_DU_UE_F1AP_ID = *f1ap_ue_context_setup_req->gNB_DU_ue_id;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie2);
+ ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+ ie2->criticality = F1AP_Criticality_ignore;
+ ie2->value.present = F1AP_UEContextSetupRequestIEs__value_PR_GNB_DU_UE_F1AP_ID;
+ ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(CUtype, instance, f1ap_ue_context_setup_req->rnti); //*f1ap_ue_context_setup_req->gNB_DU_ue_id;
}
/* mandatory */
/* c3. SpCell_ID */
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_SpCell_ID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_NRCGI;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie3);
+ ie3->id = F1AP_ProtocolIE_ID_id_SpCell_ID;
+ ie3->criticality = F1AP_Criticality_reject;
+ ie3->value.present = F1AP_UEContextSetupRequestIEs__value_PR_NRCGI;
/* - nRCGI */
- F1AP_NRCGI_t nRCGI;
- memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
- MCC_MNC_TO_PLMNID(f1ap_ue_context_setup_req->mcc,
- f1ap_ue_context_setup_req->mnc,
- f1ap_ue_context_setup_req->mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(f1ap_ue_context_setup_req->nr_cellid, &nRCGI.nRCellIdentity);
-
- ie->value.choice.NRCGI = nRCGI;
-
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
+ addnRCGI(ie3->value.choice.NRCGI, f1ap_ue_context_setup_req);
/* mandatory */
/* c4. ServCellIndex */
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_ServCellIndex;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ServCellIndex;
- ie->value.choice.ServCellIndex = 2;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie4);
+ ie4->id = F1AP_ProtocolIE_ID_id_ServCellIndex;
+ ie4->criticality = F1AP_Criticality_reject;
+ ie4->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ServCellIndex;
+ ie4->value.choice.ServCellIndex = 0;
/* optional */
/* c5. CellULConfigured */
if (0) {
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_SpCellULConfigured;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_CellULConfigured;
- ie->value.choice.CellULConfigured = F1AP_CellULConfigured_ul;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie5);
+ ie5->id = F1AP_ProtocolIE_ID_id_SpCellULConfigured;
+ ie5->criticality = F1AP_Criticality_ignore;
+ ie5->value.present = F1AP_UEContextSetupRequestIEs__value_PR_CellULConfigured;
+ ie5->value.choice.CellULConfigured = F1AP_CellULConfigured_ul;
}
/* mandatory */
/* c6. CUtoDURRCInformation */
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_CUtoDURRCInformation;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_CUtoDURRCInformation;
-
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie6);
+ ie6->id = F1AP_ProtocolIE_ID_id_CUtoDURRCInformation;
+ ie6->criticality = F1AP_Criticality_reject;
+ ie6->value.present = F1AP_UEContextSetupRequestIEs__value_PR_CUtoDURRCInformation;
+
/* optional */
/* 6.1 cG_ConfigInfo */
- ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo = (F1AP_CG_ConfigInfo_t *)calloc(1, sizeof(F1AP_CG_ConfigInfo_t));
- OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo, "asdsa1d32sa1d31asd31as",
- strlen("asdsa1d32sa1d31asd31as"));
- /* optional */
- /* 6.2 uE_CapabilityRAT_ContainerList */
- ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList = (F1AP_UE_CapabilityRAT_ContainerList_t *)calloc(1, sizeof(F1AP_UE_CapabilityRAT_ContainerList_t));
- OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList, "asdsa1d32sa1d31asd31as",
- strlen("asdsa1d32sa1d31asd31as"));
- /* optional */
- /* 6.3 measConfig */
- ie->value.choice.CUtoDURRCInformation.measConfig = (F1AP_MeasConfig_t *)calloc(1, sizeof(F1AP_MeasConfig_t));
- OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.measConfig, "asdsa1d32sa1d31asd31as",
- strlen("asdsa1d32sa1d31asd31as"));
-
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
+ if (0) {
+ const char cG_ConfigInfoStr[]="asdsa1d32sa1d31asd31as";
+ asn1cCalloc(ie6->value.choice.CUtoDURRCInformation.cG_ConfigInfo, cG_ConfigInfo);
+ OCTET_STRING_fromBuf(cG_ConfigInfo, cG_ConfigInfoStr, strlen( cG_ConfigInfoStr )) ;
+ /* optional */
+ /* 6.2 uE_CapabilityRAT_ContainerList */
+ asn1cCalloc(ie6->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList, uE_CapabilityRAT_ContainerList );
+ OCTET_STRING_fromBuf(uE_CapabilityRAT_ContainerList, cG_ConfigInfoStr, strlen( cG_ConfigInfoStr )) ;
+ /* optional */
+ /* 6.3 measConfig */
+ asn1cCalloc(ie6->value.choice.CUtoDURRCInformation.measConfig, measConfig);
+ OCTET_STRING_fromBuf(measConfig, cG_ConfigInfoStr, strlen( cG_ConfigInfoStr )) ;
+ }
/* mandatory */
/* c7. Candidate_SpCell_List */
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_List; //90
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_Candidate_SpCell_List;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie7);
+ ie7->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_List; //90
+ ie7->criticality = F1AP_Criticality_ignore;
+ ie7->value.present = F1AP_UEContextSetupRequestIEs__value_PR_Candidate_SpCell_List;
- for (i=0;
- i<0;
- i++) {
-
- F1AP_Candidate_SpCell_ItemIEs_t *candidate_spCell_item_ies;
- candidate_spCell_item_ies = (F1AP_Candidate_SpCell_ItemIEs_t *)calloc(1, sizeof(F1AP_Candidate_SpCell_ItemIEs_t));
+ for (int i=0; i<1; i++) {
+ asn1cSequenceAdd(ie7->value.choice.Candidate_SpCell_List.list,F1AP_Candidate_SpCell_ItemIEs_t, candidate_spCell_item_ies);
candidate_spCell_item_ies->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_Item; // 91
candidate_spCell_item_ies->criticality = F1AP_Criticality_reject;
candidate_spCell_item_ies->value.present = F1AP_Candidate_SpCell_ItemIEs__value_PR_Candidate_SpCell_Item;
-
/* 7.1 Candidate_SpCell_Item */
- F1AP_Candidate_SpCell_Item_t candidate_spCell_item;
- memset((void *)&candidate_spCell_item, 0, sizeof(F1AP_Candidate_SpCell_Item_t));
-
+ F1AP_Candidate_SpCell_Item_t *candidate_spCell_item=
+ &candidate_spCell_item_ies->value.choice.Candidate_SpCell_Item;
/* - candidate_SpCell_ID */
- F1AP_NRCGI_t nRCGI;
+ //FixMe: first cell ???
+ addnRCGI(candidate_spCell_item->candidate_SpCell_ID,f1ap_ue_context_setup_req);
/* TODO add correct mcc/mnc */
- MCC_MNC_TO_PLMNID(f1ap_ue_context_setup_req->mcc,
- f1ap_ue_context_setup_req->mnc,
- f1ap_ue_context_setup_req->mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(f1ap_ue_context_setup_req->nr_cellid, &nRCGI.nRCellIdentity);
-
- candidate_spCell_item.candidate_SpCell_ID = nRCGI;
-
- /* ADD */
- candidate_spCell_item_ies->value.choice.Candidate_SpCell_Item = candidate_spCell_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.Candidate_SpCell_List.list,
- candidate_spCell_item_ies);
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c8. DRXCycle */
if (0) {
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_DRXCycle;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_DRXCycle;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie8);
+ ie8->id = F1AP_ProtocolIE_ID_id_DRXCycle;
+ ie8->criticality = F1AP_Criticality_ignore;
+ ie8->value.present = F1AP_UEContextSetupRequestIEs__value_PR_DRXCycle;
/* 8.1 longDRXCycleLength */
- ie->value.choice.DRXCycle.longDRXCycleLength = F1AP_LongDRXCycleLength_ms10; // enum
+ ie8->value.choice.DRXCycle.longDRXCycleLength = F1AP_LongDRXCycleLength_ms10; // enum
/* optional */
/* 8.2 shortDRXCycleLength */
if (0) {
- ie->value.choice.DRXCycle.shortDRXCycleLength = (F1AP_ShortDRXCycleLength_t *)calloc(1, sizeof(F1AP_ShortDRXCycleLength_t));
- *ie->value.choice.DRXCycle.shortDRXCycleLength = F1AP_ShortDRXCycleLength_ms2; // enum
+ asn1cCallocOne(ie6->value.choice.DRXCycle.shortDRXCycleLength,
+ F1AP_ShortDRXCycleLength_ms2); // enum
}
/* optional */
/* 8.3 shortDRXCycleTimer */
if (0) {
- ie->value.choice.DRXCycle.shortDRXCycleTimer = (F1AP_ShortDRXCycleTimer_t *)calloc(1, sizeof(F1AP_ShortDRXCycleTimer_t));
- *ie->value.choice.DRXCycle.shortDRXCycleTimer = 123L;
+ asn1cCallocOne(ie8->value.choice.DRXCycle.shortDRXCycleTimer,
+ 123L);
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
/* c9. ResourceCoordinationTransferContainer */
if (0) {
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ResourceCoordinationTransferContainer;
-
- ie->value.choice.ResourceCoordinationTransferContainer.buf = malloc(4);
- ie->value.choice.ResourceCoordinationTransferContainer.size = 4;
- strncpy((char *)ie->value.choice.ResourceCoordinationTransferContainer.buf, "123", 4);
-
-
- OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as",
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie9);
+ ie9->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer;
+ ie9->criticality = F1AP_Criticality_ignore;
+ ie9->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ResourceCoordinationTransferContainer;
+ ie9->value.choice.ResourceCoordinationTransferContainer.buf = malloc(4);
+ ie9->value.choice.ResourceCoordinationTransferContainer.size = 4;
+ strncpy((char *)ie9->value.choice.ResourceCoordinationTransferContainer.buf, "123", 4);
+ OCTET_STRING_fromBuf(&ie9->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
-
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* mandatory */
/* c10. SCell_ToBeSetup_List */
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_List;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SCell_ToBeSetup_List;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie10);
+ ie10->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_List;
+ ie10->criticality = F1AP_Criticality_ignore;
+ ie10->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SCell_ToBeSetup_List;
- for (i=0;
- i<0;
- i++) {
- //
- F1AP_SCell_ToBeSetup_ItemIEs_t *scell_toBeSetup_item_ies;
- scell_toBeSetup_item_ies = (F1AP_SCell_ToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_ToBeSetup_ItemIEs_t));
- scell_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_Item; //53
- scell_toBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
- scell_toBeSetup_item_ies->value.present = F1AP_SCell_ToBeSetup_ItemIEs__value_PR_SCell_ToBeSetup_Item;
+ for (int i=0; i<1; i++) {
+ //
+ asn1cSequenceAdd(ie10->value.choice.SCell_ToBeSetup_List.list, F1AP_SCell_ToBeSetup_ItemIEs_t, scell_toBeSetup_item_ies);
+ scell_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_Item; //53
+ scell_toBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
+ scell_toBeSetup_item_ies->value.present = F1AP_SCell_ToBeSetup_ItemIEs__value_PR_SCell_ToBeSetup_Item;
+ /* 10.1 SCell_ToBeSetup_Item */
+ F1AP_SCell_ToBeSetup_Item_t *scell_toBeSetup_item=&scell_toBeSetup_item_ies->value.choice.SCell_ToBeSetup_Item;
+ /* 10.1.1 sCell_ID */
+ addnRCGI(scell_toBeSetup_item->sCell_ID, f1ap_ue_context_setup_req);
+ /* TODO correct MCC/MNC */
+ /* 10.1.2 sCellIndex */
+ scell_toBeSetup_item->sCellIndex = 3; // issue here
- /* 10.1 SCell_ToBeSetup_Item */
- F1AP_SCell_ToBeSetup_Item_t scell_toBeSetup_item;
- memset((void *)&scell_toBeSetup_item, 0, sizeof(F1AP_SCell_ToBeSetup_Item_t));
-
- /* 10.1.1 sCell_ID */
- F1AP_NRCGI_t nRCGI;
- /* TODO correct MCC/MNC */
- MCC_MNC_TO_PLMNID(f1ap_ue_context_setup_req->mcc,
- f1ap_ue_context_setup_req->mnc,
- f1ap_ue_context_setup_req->mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
- scell_toBeSetup_item.sCell_ID = nRCGI;
-
- /* 10.1.2 sCellIndex */
- scell_toBeSetup_item.sCellIndex = 3; // issue here
-
- /* OPTIONAL */
- /* 10.1.3 sCellULConfigured*/
- if (0) {
- scell_toBeSetup_item.sCellULConfigured = (F1AP_CellULConfigured_t *)calloc(1, sizeof(F1AP_CellULConfigured_t));
- *scell_toBeSetup_item.sCellULConfigured = F1AP_CellULConfigured_ul_and_sul; // enum
- }
-
- /* ADD */
- scell_toBeSetup_item_ies->value.choice.SCell_ToBeSetup_Item = scell_toBeSetup_item;
-
- ASN_SEQUENCE_ADD(&ie->value.choice.SCell_ToBeSetup_List.list,
- scell_toBeSetup_item_ies);
+ /* OPTIONAL */
+ /* 10.1.3 sCellULConfigured*/
+ if (0) {
+ asn1cCallocOne(scell_toBeSetup_item->sCellULConfigured,
+ F1AP_CellULConfigured_ul_and_sul); // enum
+ }
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
/* mandatory */
/* c11. SRBs_ToBeSetup_List */
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_List;
- ie->criticality = F1AP_Criticality_reject; // ?
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SRBs_ToBeSetup_List;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie11);
+ ie11->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_List;
+ ie11->criticality = F1AP_Criticality_reject; // ?
+ ie11->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SRBs_ToBeSetup_List;
- for (i=0;
- i<0;
- i++) {
+ for (int i=0; isrbs_to_be_setup_length; i++) {
//
- F1AP_SRBs_ToBeSetup_ItemIEs_t *srbs_toBeSetup_item_ies;
- srbs_toBeSetup_item_ies = (F1AP_SRBs_ToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_ToBeSetup_ItemIEs_t));
+ asn1cSequenceAdd(ie11->value.choice.SRBs_ToBeSetup_List.list, F1AP_SRBs_ToBeSetup_ItemIEs_t, srbs_toBeSetup_item_ies);
srbs_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_Item; // 73
srbs_toBeSetup_item_ies->criticality = F1AP_Criticality_ignore;
srbs_toBeSetup_item_ies->value.present = F1AP_SRBs_ToBeSetup_ItemIEs__value_PR_SRBs_ToBeSetup_Item;
-
/* 11.1 SRBs_ToBeSetup_Item */
- F1AP_SRBs_ToBeSetup_Item_t srbs_toBeSetup_item;
- memset((void *)&srbs_toBeSetup_item, 0, sizeof(F1AP_SRBs_ToBeSetup_Item_t));
-
+ F1AP_SRBs_ToBeSetup_Item_t *srbs_toBeSetup_item=&srbs_toBeSetup_item_ies->value.choice.SRBs_ToBeSetup_Item;
/* 11.1.1 sRBID */
- srbs_toBeSetup_item.sRBID = 2L;
-
+ srbs_toBeSetup_item->sRBID = f1ap_ue_context_setup_req->srbs_to_be_setup[i].srb_id;
/* OPTIONAL */
/* 11.1.2 duplicationIndication */
- if (0) {
- srbs_toBeSetup_item.duplicationIndication = (F1AP_DuplicationIndication_t *)calloc(1, sizeof(F1AP_DuplicationIndication_t));
- srbs_toBeSetup_item.duplicationIndication = F1AP_DuplicationIndication_true; // enum
- }
-
- /* ADD */
- srbs_toBeSetup_item_ies->value.choice.SRBs_ToBeSetup_Item = srbs_toBeSetup_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_ToBeSetup_List.list,
- srbs_toBeSetup_item_ies);
+ //if (0) {
+ asn1cCallocOne(srbs_toBeSetup_item->duplicationIndication,
+ F1AP_DuplicationIndication_true); // enum
+ //}
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c12. DRBs_ToBeSetup_List */
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_DRBs_ToBeSetup_List;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie12);
+ ie12->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List;
+ ie12->criticality = F1AP_Criticality_reject;
+ ie12->value.present = F1AP_UEContextSetupRequestIEs__value_PR_DRBs_ToBeSetup_List;
+ LOG_I(F1AP, "Length of drbs_to_be_setup: %d \n", f1ap_ue_context_setup_req->drbs_to_be_setup_length);
- for (i = 0; i < f1ap_ue_context_setup_req->drbs_to_be_setup_length; i++) {
+ for (int i = 0; i < f1ap_ue_context_setup_req->drbs_to_be_setup_length; i++) {
//
- F1AP_DRBs_ToBeSetup_ItemIEs_t *drbs_toBeSetup_item_ies;
- drbs_toBeSetup_item_ies = (F1AP_DRBs_ToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeSetup_ItemIEs_t));
+ asn1cSequenceAdd(ie12->value.choice.DRBs_ToBeSetup_List.list, F1AP_DRBs_ToBeSetup_ItemIEs_t, drbs_toBeSetup_item_ies);
drbs_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_Item;
drbs_toBeSetup_item_ies->criticality = F1AP_Criticality_reject;
drbs_toBeSetup_item_ies->value.present = F1AP_DRBs_ToBeSetup_ItemIEs__value_PR_DRBs_ToBeSetup_Item;
-
/* 12.1 DRBs_ToBeSetup_Item */
- F1AP_DRBs_ToBeSetup_Item_t drbs_toBeSetup_item;
- memset((void *)&drbs_toBeSetup_item, 0, sizeof(F1AP_DRBs_ToBeSetup_Item_t));
-
+ F1AP_DRBs_ToBeSetup_Item_t *drbs_toBeSetup_item=&drbs_toBeSetup_item_ies->value.choice.DRBs_ToBeSetup_Item;
/* 12.1.1 dRBID */
- drbs_toBeSetup_item.dRBID = f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id; // 9
-
+ drbs_toBeSetup_item->dRBID = f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id; // 9
/* 12.1.2 qoSInformation */
- int some_decide_qos = 1; // BK: Need Check
+ int some_decide_qos = 0; // BK: Need Check
+
if (some_decide_qos) {
- drbs_toBeSetup_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
-
+ drbs_toBeSetup_item->qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
/* 12.1.2.1 eUTRANQoS */
- drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
-
+ asn1cCalloc(drbs_toBeSetup_item->qoSInformation.choice.eUTRANQoS, eUTRANQoS);
/* 12.1.2.1.1 qCI */
- drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->qCI = 254L;
-
+ eUTRANQoS->qCI = 254L;
/* 12.1.2.1.2 allocationAndRetentionPriority */
{
/* 12.1.2.1.2.1 priorityLevel */
- drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->allocationAndRetentionPriority.priorityLevel = F1AP_PriorityLevel_highest; // enum
-
+ eUTRANQoS->allocationAndRetentionPriority.priorityLevel = F1AP_PriorityLevel_highest; // enum
/* 12.1.2.1.2.2 pre_emptionCapability */
- drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->allocationAndRetentionPriority.pre_emptionCapability = F1AP_Pre_emptionCapability_may_trigger_pre_emption; // enum
-
+ eUTRANQoS->allocationAndRetentionPriority.pre_emptionCapability = F1AP_Pre_emptionCapability_may_trigger_pre_emption; // enum
/* 12.1.2.1.2.2 pre_emptionVulnerability */
- drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->allocationAndRetentionPriority.pre_emptionVulnerability = F1AP_Pre_emptionVulnerability_not_pre_emptable; // enum
+ eUTRANQoS->allocationAndRetentionPriority.pre_emptionVulnerability = F1AP_Pre_emptionVulnerability_not_pre_emptable; // enum
}
/* OPTIONAL */
/* 12.1.2.1.3 gbrQosInformation */
if (0) {
- drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->gbrQosInformation = (F1AP_GBR_QosInformation_t *)calloc(1, sizeof(F1AP_GBR_QosInformation_t));
- asn_long2INTEGER(&drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->gbrQosInformation->e_RAB_MaximumBitrateDL, 1L);
- asn_long2INTEGER(&drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->gbrQosInformation->e_RAB_MaximumBitrateUL, 1L);
- asn_long2INTEGER(&drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->gbrQosInformation->e_RAB_GuaranteedBitrateDL, 1L);
- asn_long2INTEGER(&drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->gbrQosInformation->e_RAB_GuaranteedBitrateUL, 1L);
+ eUTRANQoS->gbrQosInformation = (F1AP_GBR_QosInformation_t *)calloc(1, sizeof(F1AP_GBR_QosInformation_t));
+ asn_long2INTEGER(&eUTRANQoS->gbrQosInformation->e_RAB_MaximumBitrateDL, 1L);
+ asn_long2INTEGER(&eUTRANQoS->gbrQosInformation->e_RAB_MaximumBitrateUL, 1L);
+ asn_long2INTEGER(&eUTRANQoS->gbrQosInformation->e_RAB_GuaranteedBitrateDL, 1L);
+ asn_long2INTEGER(&eUTRANQoS->gbrQosInformation->e_RAB_GuaranteedBitrateUL, 1L);
}
-
- } else {
+ } else {
/* 12.1.2 DRB_Information */
- drbs_toBeSetup_item.qoSInformation.present = F1AP_QoSInformation_PR_choice_extension;
-
- F1AP_QoSInformation_ExtIEs_t *ie;
- ie = (F1AP_QoSInformation_ExtIEs_t *)calloc(1, sizeof(F1AP_QoS_Characteristics_ExtIEs_t));
+ drbs_toBeSetup_item->qoSInformation.present = F1AP_QoSInformation_PR_choice_extension;
+ F1AP_QoSInformation_ExtIEs_t *ie = (F1AP_QoSInformation_ExtIEs_t *)calloc(1, sizeof(*ie));
ie->id = F1AP_ProtocolIE_ID_id_DRB_Information;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_QoSInformation_ExtIEs__value_PR_DRB_Information;
F1AP_DRB_Information_t *DRB_Information = &ie->value.choice.DRB_Information;
-
- drbs_toBeSetup_item.qoSInformation.choice.choice_extension = (struct F1AP_ProtocolIE_SingleContainer*)ie;
-
-
+ drbs_toBeSetup_item->qoSInformation.choice.choice_extension = (struct F1AP_ProtocolIE_SingleContainer *)ie;
/* 12.1.2.1 dRB_QoS */
{
/* qoS_Characteristics */
{
- int some_decide_qoS_characteristics = 1; // BK: Need Check
+ int some_decide_qoS_characteristics = 0; // BK: Need Check
+
if (some_decide_qoS_characteristics) {
DRB_Information->dRB_QoS.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI = (F1AP_NonDynamic5QIDescriptor_t *)calloc(1, sizeof(F1AP_NonDynamic5QIDescriptor_t));
-
- /* fiveQI */
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI = 1L;
-
- /* OPTIONAL */
- /* qoSPriorityLevel */
- if (0) {
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel = (long *)calloc(1, sizeof(long));
- *DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel = 1L;
- }
-
- /* OPTIONAL */
- /* averagingWindow */
- if (0) {
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow = (F1AP_AveragingWindow_t *)calloc(1, sizeof(F1AP_AveragingWindow_t));
- *DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow = 1L;
- }
-
- /* OPTIONAL */
- /* maxDataBurstVolume */
- if (0) {
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume = (F1AP_MaxDataBurstVolume_t *)calloc(1, sizeof(F1AP_MaxDataBurstVolume_t));
- *DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume = 1L;
- }
-
+ setQos(DRB_Information->dRB_QoS.qoS_Characteristics.choice.non_Dynamic_5QI);
} else {
DRB_Information->dRB_QoS.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_dynamic_5QI;
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI = (F1AP_Dynamic5QIDescriptor_t *)calloc(1, sizeof(F1AP_Dynamic5QIDescriptor_t));
-
+ asn1cCalloc(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI, tmp);
/* qoSPriorityLevel */
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->qoSPriorityLevel = 1L;
-
+ tmp->qoSPriorityLevel = 1L;
/* packetDelayBudget */
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->packetDelayBudget = 1L;
-
+ tmp->packetDelayBudget = 1L;
/* packetErrorRate */
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate.pER_Scalar = 1L;
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate.pER_Exponent = 6L;
-
+ tmp->packetErrorRate.pER_Scalar = 1L;
+ tmp->packetErrorRate.pER_Exponent = 6L;
/* OPTIONAL */
/* delayCritical */
if (0) {
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->delayCritical = (long *)calloc(1, sizeof(long));
- *DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->delayCritical = 1L;
+ asn1cCallocOne(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->delayCritical, 1L);
}
/* OPTIONAL */
/* averagingWindow */
if (0) {
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->averagingWindow = (F1AP_AveragingWindow_t *)calloc(1, sizeof(F1AP_AveragingWindow_t));
- *DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->averagingWindow = 1L;
+ asn1cCallocOne(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->averagingWindow, 1L);
}
/* OPTIONAL */
/* maxDataBurstVolume */
if (0) {
- DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->maxDataBurstVolume = (F1AP_MaxDataBurstVolume_t *)calloc(1, sizeof(F1AP_MaxDataBurstVolume_t));
- *DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->maxDataBurstVolume = 1L;
+ asn1cCallocOne(DRB_Information->dRB_QoS.qoS_Characteristics.choice.dynamic_5QI->maxDataBurstVolume, 1L);
}
-
} // if some_decide_qoS_characteristics
-
} // qoS_Characteristics
-
/* nGRANallocationRetentionPriority */
{
- DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.priorityLevel = F1AP_PriorityLevel_highest; // enum
- DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionCapability = F1AP_Pre_emptionCapability_shall_not_trigger_pre_emption; // enum
- DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionVulnerability = F1AP_Pre_emptionVulnerability_not_pre_emptable; // enum
+ DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.priorityLevel = F1AP_PriorityLevel_highest; // enum
+ DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionCapability = F1AP_Pre_emptionCapability_shall_not_trigger_pre_emption; // enum
+ DRB_Information->dRB_QoS.nGRANallocationRetentionPriority.pre_emptionVulnerability = F1AP_Pre_emptionVulnerability_not_pre_emptable; // enum
} // nGRANallocationRetentionPriority
/* OPTIONAL */
/* gBR_QoS_Flow_Information */
if (0) {
- DRB_Information->dRB_QoS.gBR_QoS_Flow_Information = (F1AP_GBR_QoSFlowInformation_t *)calloc(1, sizeof(F1AP_GBR_QoSFlowInformation_t));
- asn_long2INTEGER(&DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxFlowBitRateDownlink, 1L);
- asn_long2INTEGER(&DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxFlowBitRateUplink, 1L);
- asn_long2INTEGER(&DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink, 1L);
- asn_long2INTEGER(&DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink, 1L);
+ asn1cCalloc(DRB_Information->dRB_QoS.gBR_QoS_Flow_Information, tmp);
+ asn_long2INTEGER(&tmp->maxFlowBitRateDownlink, 1L);
+ asn_long2INTEGER(&tmp->maxFlowBitRateUplink, 1L);
+ asn_long2INTEGER(&tmp->guaranteedFlowBitRateDownlink, 1L);
+ asn_long2INTEGER(&tmp->guaranteedFlowBitRateUplink, 1L);
/* OPTIONAL */
/* maxPacketLossRateDownlink */
if (0) {
- DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateDownlink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
- *DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateDownlink = 1L;
+ asn1cCallocOne(DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateDownlink, 1L);
}
/* OPTIONAL */
/* maxPacketLossRateUplink */
if (0) {
- DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateUplink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
- *DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateUplink = 1L;
+ asn1cCallocOne(DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateUplink, 1L);
}
-
}
/* OPTIONAL */
/* reflective_QoS_Attribute */
if (0) {
- DRB_Information->dRB_QoS.reflective_QoS_Attribute = (long *)calloc(1, sizeof(long));
- *DRB_Information->dRB_QoS.reflective_QoS_Attribute = 1L;
+ asn1cCallocOne(DRB_Information->dRB_QoS.reflective_QoS_Attribute, 1L);
}
-
} // dRB_QoS
-
/* 12.1.2.2 sNSSAI */
{
/* sST */
- OCTET_STRING_fromBuf(&DRB_Information->sNSSAI.sST, "asdsa1d32sa1d31asd31as",
- strlen("asdsa1d32sa1d31asd31as"));
+ OCTET_STRING_fromBuf(&DRB_Information->sNSSAI.sST, "1", 1);
+
/* OPTIONAL */
/* sD */
if (0) {
- DRB_Information->sNSSAI.sD = (OCTET_STRING_t *)calloc(1, sizeof(OCTET_STRING_t));
- OCTET_STRING_fromBuf(DRB_Information->sNSSAI.sD, "asdsa1d32sa1d31asd31as",
- strlen("asdsa1d32sa1d31asd31as"));
+ asn1cCalloc(DRB_Information->sNSSAI.sD, tmp);
+ OCTET_STRING_fromBuf(tmp, "asdsa1d32sa1d31asd31as",
+ strlen("asdsa1d32sa1d31asd31as"));
}
}
+
/* OPTIONAL */
/* 12.1.2.3 notificationControl */
if (0) {
- DRB_Information->notificationControl = (F1AP_NotificationControl_t *)calloc(1, sizeof(F1AP_NotificationControl_t));
- *DRB_Information->notificationControl = F1AP_NotificationControl_active; // enum
+ asn1cCallocOne(DRB_Information->notificationControl,
+ F1AP_NotificationControl_active); // enum
}
/* 12.1.2.4 flows_Mapped_To_DRB_List */ // BK: need verifiy
- int k;
- for (k = 0; k < 1; k ++) {
-
- F1AP_Flows_Mapped_To_DRB_Item_t flows_mapped_to_drb_item;
- memset((void *)&flows_mapped_to_drb_item, 0, sizeof(F1AP_Flows_Mapped_To_DRB_Item_t));
-
- /* qoSFlowIndicator */
- flows_mapped_to_drb_item.qoSFlowIdentifier = 1L;
+ for (int k = 0; k < 1; k ++) {
+ asn1cSequenceAdd(DRB_Information->flows_Mapped_To_DRB_List.list,
+ F1AP_Flows_Mapped_To_DRB_Item_t, flows_mapped_to_drb_item);
+ /* qoSFlowIndicator */
+ flows_mapped_to_drb_item->qoSFlowIdentifier = 1L;
/* qoSFlowLevelQoSParameters */
- {
+ {
/* qoS_Characteristics */
{
- int some_decide_qoS_characteristics = 1; // BK: Need Check
+ int some_decide_qoS_characteristics = 0; // BK: Need Check
+ F1AP_QoS_Characteristics_t *QosParams=&flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.qoS_Characteristics;
+
if (some_decide_qoS_characteristics) {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.non_Dynamic_5QI = (F1AP_NonDynamic5QIDescriptor_t *)calloc(1, sizeof(F1AP_NonDynamic5QIDescriptor_t));
-
- /* fiveQI */
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI = 1L;
-
- /* OPTIONAL */
- /* qoSPriorityLevel */
- if (0) {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel = (long *)calloc(1, sizeof(long));
- *flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.non_Dynamic_5QI->qoSPriorityLevel = 1L;
- }
-
- /* OPTIONAL */
- /* averagingWindow */
- if (0) {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow = (F1AP_AveragingWindow_t *)calloc(1, sizeof(F1AP_AveragingWindow_t));
- *flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.non_Dynamic_5QI->averagingWindow = 1L;
- }
-
- /* OPTIONAL */
- /* maxDataBurstVolume */
- if (0) {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume = (F1AP_MaxDataBurstVolume_t *)calloc(1, sizeof(F1AP_MaxDataBurstVolume_t));
- *flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.non_Dynamic_5QI->maxDataBurstVolume = 1L;
- }
-
+ QosParams->present = F1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
+ setQos(QosParams->choice.non_Dynamic_5QI);
} else {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_dynamic_5QI;
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI = (F1AP_Dynamic5QIDescriptor_t *)calloc(1, sizeof(F1AP_Dynamic5QIDescriptor_t));
-
+ QosParams->present = F1AP_QoS_Characteristics_PR_dynamic_5QI;
+ asn1cCalloc(QosParams->choice.dynamic_5QI, tmp);
/* qoSPriorityLevel */
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->qoSPriorityLevel = 1L;
-
+ tmp->qoSPriorityLevel = 1L;
/* packetDelayBudget */
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->packetDelayBudget = 1L;
-
+ tmp->packetDelayBudget = 1L;
/* packetErrorRate */
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate.pER_Scalar = 1L;
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate.pER_Exponent = 6L;
+ tmp->packetErrorRate.pER_Scalar = 1L;
+ tmp->packetErrorRate.pER_Exponent = 6L;
- /* OPTIONAL */
+ /* OPTIONAL */
/* delayCritical */
if (0) {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->delayCritical = (long *)calloc(1, sizeof(long));
- *flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->delayCritical = 1L;
+ asn1cCalloc(QosParams->choice.dynamic_5QI->delayCritical, tmp);
+ *tmp = 1L;
}
/* OPTIONAL */
/* averagingWindow */
if (0) {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->averagingWindow = (F1AP_AveragingWindow_t *)calloc(1, sizeof(F1AP_AveragingWindow_t));
- *flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->averagingWindow = 1L;
+ asn1cCalloc(QosParams->choice.dynamic_5QI->averagingWindow, tmp);
+ *tmp = 1L;
}
/* OPTIONAL */
/* maxDataBurstVolume */
if (0) {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->maxDataBurstVolume = (F1AP_MaxDataBurstVolume_t *)calloc(1, sizeof(F1AP_MaxDataBurstVolume_t));
- *flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->maxDataBurstVolume = 1L;
+ asn1cCalloc(QosParams->choice.dynamic_5QI->maxDataBurstVolume, tmp);
+ *tmp= 1L;
}
-
} // if some_decide_qoS_characteristics
-
} // qoS_Characteristics
-
/* nGRANallocationRetentionPriority */
{
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.priorityLevel = F1AP_PriorityLevel_highest; // enum
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.pre_emptionCapability = F1AP_Pre_emptionCapability_shall_not_trigger_pre_emption; // enum
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.pre_emptionVulnerability = F1AP_Pre_emptionVulnerability_not_pre_emptable; // enum
+ flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.priorityLevel = F1AP_PriorityLevel_highest; // enum
+ flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.pre_emptionCapability = F1AP_Pre_emptionCapability_shall_not_trigger_pre_emption; // enum
+ flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.nGRANallocationRetentionPriority.pre_emptionVulnerability = F1AP_Pre_emptionVulnerability_not_pre_emptable; // enum
} // nGRANallocationRetentionPriority
/* OPTIONAL */
/* gBR_QoS_Flow_Information */
if (0) {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information = (F1AP_GBR_QoSFlowInformation_t *)calloc(1, sizeof(F1AP_GBR_QoSFlowInformation_t));
- asn_long2INTEGER(&flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information->maxFlowBitRateDownlink, 1L);
- asn_long2INTEGER(&flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information->maxFlowBitRateUplink, 1L);
- asn_long2INTEGER(&flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink, 1L);
- asn_long2INTEGER(&flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information->guaranteedFlowBitRateUplink, 1L);
+ asn1cCalloc(flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information, tmp);
+ asn_long2INTEGER(&tmp->maxFlowBitRateDownlink, 1L);
+ asn_long2INTEGER(&tmp->maxFlowBitRateUplink, 1L);
+ asn_long2INTEGER(&tmp->guaranteedFlowBitRateDownlink, 1L);
+ asn_long2INTEGER(&tmp->guaranteedFlowBitRateUplink, 1L);
/* OPTIONAL */
/* maxPacketLossRateDownlink */
if (0) {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information->maxPacketLossRateDownlink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
- *flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information->maxPacketLossRateDownlink = 1L;
+ asn1cCallocOne(flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information->maxPacketLossRateDownlink, 1L);
}
/* OPTIONAL */
/* maxPacketLossRateUplink */
if (0) {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information->maxPacketLossRateUplink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
- *flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information->maxPacketLossRateUplink = 1L;
+ asn1cCallocOne(flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.gBR_QoS_Flow_Information->maxPacketLossRateUplink, 1L);
}
-
}
/* OPTIONAL */
/* reflective_QoS_Attribute */
if (0) {
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.reflective_QoS_Attribute = (long *)calloc(1, sizeof(long));
- *flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.reflective_QoS_Attribute = 1L;
+ asn1cCallocOne(flows_mapped_to_drb_item->qoSFlowLevelQoSParameters.reflective_QoS_Attribute, 1L);
}
-
} // qoSFlowLevelQoSParameters
- // BK: need check
- ASN_SEQUENCE_ADD(&DRB_Information->flows_Mapped_To_DRB_List.list, &flows_mapped_to_drb_item);
}
-
} // if some_decide_qos
/* 12.1.3 uLUPTNLInformation_ToBeSetup_List */
- for (j = 0; j < f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl_length; j++) {
- f1ap_up_tnl_t *up_tnl = &f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl[j];
-
+ for (int j = 0; j < f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl_length; j++) {
+ /* Here the callback function used as input is not the right one. Need to create a new one probably for F1-U, not sure
+ * if the kind of input parameters to the callback function are convenient though for gtp-u over F1-U.*/
+ //Use a dummy teid for the outgoing GTP-U tunnel (DU) which will be updated once we get the UE context setup response from the DU
+ transport_layer_addr_t addr;
+ int sz=sizeof(f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_dl_tnl[0].tl_address);
+ memcpy(addr.buffer,&f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_dl_tnl[0].tl_address, sz);
+ addr.length = sz*8;
+ f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl[j].teid=
+ newGtpuCreateTunnel(getCxt(CUtype, instance)->gtpInst,
+ f1ap_ue_context_setup_req->rnti,
+ f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id,
+ f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id,
+ 0xFFFF, // We will set the right value from DU answer
+ addr,
+ f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_dl_tnl[0].port,
+ cu_f1u_data_req);
/* 12.3.1 ULTunnels_ToBeSetup_Item */
- F1AP_ULUPTNLInformation_ToBeSetup_Item_t *uLUPTNLInformation_ToBeSetup_Item;
-
- /* 12.3.1.1 gTPTunnel */
- uLUPTNLInformation_ToBeSetup_Item = calloc(1, sizeof(F1AP_ULUPTNLInformation_ToBeSetup_Item_t));
+ asn1cSequenceAdd(drbs_toBeSetup_item->uLUPTNLInformation_ToBeSetup_List.list,
+ F1AP_ULUPTNLInformation_ToBeSetup_Item_t, uLUPTNLInformation_ToBeSetup_Item);
uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
- F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
-
+ asn1cCalloc( uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel,
+ gTPTunnel);
/* 12.3.1.1.1 transportLayerAddress */
- TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(up_tnl->tl_address, &gTPTunnel->transportLayerAddress);
-
+ TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl[j].tl_address,
+ &gTPTunnel->transportLayerAddress);
/* 12.3.1.1.2 gTP_TEID */
- INT32_TO_OCTET_STRING(up_tnl->gtp_teid, &gTPTunnel->gTP_TEID);
-
- // Add
- uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
- ASN_SEQUENCE_ADD(&drbs_toBeSetup_item.uLUPTNLInformation_ToBeSetup_List.list, uLUPTNLInformation_ToBeSetup_Item);
+ INT32_TO_OCTET_STRING(f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl[j].teid,
+ &gTPTunnel->gTP_TEID);
}
/* 12.1.4 rLCMode */
/* TODO use rlc_mode from f1ap_drb_to_be_setup */
switch (f1ap_ue_context_setup_req->drbs_to_be_setup[i].rlc_mode) {
case RLC_MODE_AM:
- drbs_toBeSetup_item.rLCMode = F1AP_RLCMode_rlc_am;
+ drbs_toBeSetup_item->rLCMode = F1AP_RLCMode_rlc_am;
break;
+
default:
- drbs_toBeSetup_item.rLCMode = F1AP_RLCMode_rlc_um_bidirectional;
+ drbs_toBeSetup_item->rLCMode = F1AP_RLCMode_rlc_um_bidirectional;
}
/* OPTIONAL */
/* 12.1.5 ULConfiguration */
if (0) {
- drbs_toBeSetup_item.uLConfiguration = (F1AP_ULConfiguration_t *)calloc(1, sizeof(F1AP_ULConfiguration_t));
- drbs_toBeSetup_item.uLConfiguration->uLUEConfiguration = F1AP_ULUEConfiguration_no_data;
+ asn1cCalloc(drbs_toBeSetup_item->uLConfiguration, tmp);
+ tmp->uLUEConfiguration = F1AP_ULUEConfiguration_no_data;
}
/* OPTIONAL */
/* 12.1.6 duplicationActivation */
if (0) {
- drbs_toBeSetup_item.duplicationActivation = (F1AP_DuplicationActivation_t *)calloc(1, sizeof(F1AP_DuplicationActivation_t));
- drbs_toBeSetup_item.duplicationActivation = F1AP_DuplicationActivation_active; // enum
+ asn1cCalloc(drbs_toBeSetup_item->duplicationActivation, tmp);
+ *tmp = F1AP_DuplicationActivation_active; // enum
}
-
- /* ADD */
- drbs_toBeSetup_item_ies->value.choice.DRBs_ToBeSetup_Item = drbs_toBeSetup_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeSetup_List.list,
- drbs_toBeSetup_item_ies);
-
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* OPTIONAL */
/* InactivityMonitoringRequest */
if (0) {
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_InactivityMonitoringRequest;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_InactivityMonitoringRequest;
- ie->value.choice.InactivityMonitoringRequest = F1AP_InactivityMonitoringRequest_true; // 0
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie12);
+ ie12->id = F1AP_ProtocolIE_ID_id_InactivityMonitoringRequest;
+ ie12->criticality = F1AP_Criticality_reject;
+ ie12->value.present = F1AP_UEContextSetupRequestIEs__value_PR_InactivityMonitoringRequest;
+ ie12->value.choice.InactivityMonitoringRequest = F1AP_InactivityMonitoringRequest_true; // 0
}
/* OPTIONAL */
/* RAT_FrequencyPriorityInformation */
if (0) {
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RAT_FrequencyPriorityInformation;
-
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie13);
+ ie13->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
+ ie13->criticality = F1AP_Criticality_reject;
+ ie13->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RAT_FrequencyPriorityInformation;
int endc = 1; // RK: Get this from somewhere ...
+
if (endc) {
- ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_eNDC;
- ie->value.choice.RAT_FrequencyPriorityInformation.choice.eNDC = 11L;
+ ie13->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_eNDC;
+ ie13->value.choice.RAT_FrequencyPriorityInformation.choice.eNDC = 11L;
} else {
- ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN;
- ie->value.choice.RAT_FrequencyPriorityInformation.choice.nGRAN = 11L;
+ ie13->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN;
+ ie13->value.choice.RAT_FrequencyPriorityInformation.choice.nGRAN = 11L;
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* OPTIONAL */
/* RRCContainer */
- if(RC.nrrrc) {
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RRCContainer;
- OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_ue_context_setup_req->rrc_container,
- f1ap_ue_context_setup_req->rrc_container_length);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ if(f1ap_ue_context_setup_req->rrc_container_length > 0) {
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie14);
+ ie14->id = F1AP_ProtocolIE_ID_id_RRCContainer;
+ ie14->criticality = F1AP_Criticality_reject;
+ ie14->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RRCContainer;
+ OCTET_STRING_fromBuf(&ie14->value.choice.RRCContainer, (const char *)f1ap_ue_context_setup_req->rrc_container,
+ f1ap_ue_context_setup_req->rrc_container_length);
}
/* OPTIONAL */
/* MaskedIMEISV */
if (0) {
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_MaskedIMEISV;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_MaskedIMEISV;
- MaskedIMEISV_TO_BIT_STRING(12340000l, &ie->value.choice.MaskedIMEISV); // size (64)
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextSetupRequestIEs_t, ie15);
+ ie15->id = F1AP_ProtocolIE_ID_id_MaskedIMEISV;
+ ie15->criticality = F1AP_Criticality_reject;
+ ie15->value.present = F1AP_UEContextSetupRequestIEs__value_PR_MaskedIMEISV;
+ MaskedIMEISV_TO_BIT_STRING(12340000l, &ie15->value.choice.MaskedIMEISV); // size (64)
}
/* encode */
+ uint8_t *buffer=NULL;
+ uint32_t len=0;
+
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 UE CONTEXT SETUP REQUEST\n");
return -1;
}
// xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, (void *)pdu);
-
// asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
// buffer = res.buffer;
// len = res.result.encoded;
-
// if (res.result.encoded <= 0) {
// LOG_E(F1AP, "ASN1 message encoding failed (%s, %lu)!\n", res.result.failed_type->name, res.result.encoded);
// return -1;
// }
-
LOG_D(F1AP,"F1AP UEContextSetupRequest Encoded %u bits\n", len);
-
- if(RC.nrrrc) {
- cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id /* BK: fix me*/ , buffer, len, 0 /* BK: fix me*/);
- }
-
+ f1ap_itti_send_sctp_data_req(true, instance, buffer, len, 0 /* BK: fix me*/);
return 0;
}
@@ -796,41 +633,133 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
+ MessageDef *msg_p;
F1AP_UEContextSetupResponse_t *container;
F1AP_UEContextSetupResponseIEs_t *ie;
-
DevAssert(pdu);
-
+ msg_p = itti_alloc_new_message(TASK_DU_F1, 0, F1AP_UE_CONTEXT_SETUP_RESP);
+ f1ap_ue_context_setup_t *f1ap_ue_context_setup_resp = &F1AP_UE_CONTEXT_SETUP_RESP(msg_p);
container = &pdu->choice.successfulOutcome->value.choice.UEContextSetupResponse;
-
+ int i;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
-
+ f1ap_ue_context_setup_resp->gNB_CU_ue_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
+ LOG_D(F1AP, "f1ap_ue_context_setup_resp->gNB_CU_ue_id is: %d \n", f1ap_ue_context_setup_resp->gNB_CU_ue_id);
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
-
- /* DUtoCURRCInformation */
+ f1ap_ue_context_setup_resp->gNB_DU_ue_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
+ LOG_D(F1AP, "f1ap_ue_context_setup_resp->gNB_DU_ue_id is: %d \n", f1ap_ue_context_setup_resp->gNB_DU_ue_id);
+ f1ap_ue_context_setup_resp->rnti =
+ f1ap_get_rnti_by_du_id(CUtype, instance, f1ap_ue_context_setup_resp->gNB_DU_ue_id);
+ // DUtoCURRCInformation
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_DUtoCURRCInformation, true);
- /* DRBs_Setup_List */
- F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
- F1AP_ProtocolIE_ID_id_DRBs_Setup_List, true);
+ if (ie == NULL) {
+ LOG_E(F1AP,"%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
+ return -1;
+ }
- /* SRBs_FailedToBeSetup_List */
+ f1ap_ue_context_setup_resp->du_to_cu_rrc_information = (uint8_t *)calloc(1,ie->value.choice.DUtoCURRCInformation.cellGroupConfig.size);
+ memcpy(f1ap_ue_context_setup_resp->du_to_cu_rrc_information, ie->value.choice.DUtoCURRCInformation.cellGroupConfig.buf, ie->value.choice.DUtoCURRCInformation.cellGroupConfig.size);
+ f1ap_ue_context_setup_resp->du_to_cu_rrc_information_length = ie->value.choice.DUtoCURRCInformation.cellGroupConfig.size;
+ // DRBs_Setup_List
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
- F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_List, true);
+ F1AP_ProtocolIE_ID_id_DRBs_Setup_List, false);
- /* DRBs_FailedToBeSetup_List */
+ if(ie!=NULL) {
+ f1ap_ue_context_setup_resp->drbs_to_be_setup_length = ie->value.choice.DRBs_Setup_List.list.count;
+ f1ap_ue_context_setup_resp->drbs_to_be_setup = calloc(f1ap_ue_context_setup_resp->drbs_to_be_setup_length,
+ sizeof(f1ap_drb_to_be_setup_t));
+ AssertFatal(f1ap_ue_context_setup_resp->drbs_to_be_setup,
+ "could not allocate memory for f1ap_ue_context_setup_resp->drbs_setup\n");
+
+ for (i = 0; i < f1ap_ue_context_setup_resp->drbs_to_be_setup_length; ++i) {
+ f1ap_drb_to_be_setup_t *drb_p = &f1ap_ue_context_setup_resp->drbs_to_be_setup[i];
+ F1AP_DRBs_Setup_Item_t *drbs_setup_item_p;
+ drbs_setup_item_p = &((F1AP_DRBs_Setup_ItemIEs_t *)ie->value.choice.DRBs_Setup_List.list.array[i])->value.choice.DRBs_Setup_Item;
+ drb_p->drb_id = drbs_setup_item_p->dRBID;
+ // TODO in the following, assume only one UP UL TNL is present.
+ // this matches/assumes OAI CU/DU implementation, can be up to 2!
+ drb_p->up_dl_tnl_length = 1;
+ AssertFatal(drbs_setup_item_p->dLUPTNLInformation_ToBeSetup_List.list.count > 0,
+ "no DL UP TNL Information in DRBs to be Setup list\n");
+ F1AP_DLUPTNLInformation_ToBeSetup_Item_t *dl_up_tnl_info_p = (F1AP_DLUPTNLInformation_ToBeSetup_Item_t *)drbs_setup_item_p->dLUPTNLInformation_ToBeSetup_List.list.array[0];
+ F1AP_GTPTunnel_t *dl_up_tnl0 = dl_up_tnl_info_p->dLUPTNLInformation.choice.gTPTunnel;
+ BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4(&dl_up_tnl0->transportLayerAddress, drb_p->up_dl_tnl[0].tl_address);
+ OCTET_STRING_TO_INT32(&dl_up_tnl0->gTP_TEID, drb_p->up_dl_tnl[0].teid);
+ GtpuUpdateTunnelOutgoingTeid(getCxt(CUtype, instance)->gtpInst,
+ f1ap_ue_context_setup_resp->rnti,
+ (ebi_t)drbs_setup_item_p->dRBID,
+ drb_p->up_dl_tnl[0].teid);
+ }
+ }
+
+ // SRBs_FailedToBeSetup_List
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
- F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_List, true);
+ F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_List, false);
- /* SCell_FailedtoSetup_List */
+ if(ie!=NULL) {
+ f1ap_ue_context_setup_resp->srbs_failed_to_be_setup_length = ie->value.choice.SRBs_FailedToBeSetup_List.list.count;
+ f1ap_ue_context_setup_resp->srbs_failed_to_be_setup = calloc(f1ap_ue_context_setup_resp->srbs_failed_to_be_setup_length,
+ sizeof(f1ap_rb_failed_to_be_setup_t));
+ AssertFatal(f1ap_ue_context_setup_resp->srbs_failed_to_be_setup,
+ "could not allocate memory for f1ap_ue_context_setup_resp->srbs_failed_to_be_setup\n");
+
+ for (i = 0; i < f1ap_ue_context_setup_resp->srbs_failed_to_be_setup_length; ++i) {
+ f1ap_rb_failed_to_be_setup_t *srb_p = &f1ap_ue_context_setup_resp->srbs_failed_to_be_setup[i];
+ srb_p->rb_id = ((F1AP_SRBs_FailedToBeSetup_Item_t *)ie->value.choice.SRBs_FailedToBeSetup_List.list.array[i])->sRBID;
+ }
+ }
+
+ // DRBs_FailedToBeSetup_List
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
- F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_List, true);
+ F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_List, false);
+ if(ie!=NULL) {
+ f1ap_ue_context_setup_resp->drbs_failed_to_be_setup_length = ie->value.choice.DRBs_FailedToBeSetup_List.list.count;
+ f1ap_ue_context_setup_resp->drbs_failed_to_be_setup = calloc(f1ap_ue_context_setup_resp->drbs_failed_to_be_setup_length,
+ sizeof(f1ap_rb_failed_to_be_setup_t));
+ AssertFatal(f1ap_ue_context_setup_resp->drbs_failed_to_be_setup,
+ "could not allocate memory for f1ap_ue_context_setup_resp->drbs_failed_to_be_setup\n");
+
+ for (i = 0; i < f1ap_ue_context_setup_resp->drbs_failed_to_be_setup_length; ++i) {
+ f1ap_rb_failed_to_be_setup_t *drb_p = &f1ap_ue_context_setup_resp->drbs_failed_to_be_setup[i];
+ drb_p->rb_id = ((F1AP_DRBs_FailedToBeSetup_Item_t *)ie->value.choice.DRBs_FailedToBeSetup_List.list.array[i])->dRBID;
+ }
+ }
+
+ // SCell_FailedtoSetup_List
+ F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
+ F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_List, false);
+
+ if(ie!=NULL) {
+ LOG_E (F1AP, "Not supporting handling of SCell_FailedtoSetup_List \n");
+ }
+
+ // SRBs_Setup_List
+ F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupResponseIEs_t, ie, container,
+ F1AP_ProtocolIE_ID_id_SRBs_Setup_List, false);
+
+ if(ie!=NULL) {
+ f1ap_ue_context_setup_resp->srbs_to_be_setup_length = ie->value.choice.SRBs_Setup_List.list.count;
+ f1ap_ue_context_setup_resp->srbs_to_be_setup = calloc(f1ap_ue_context_setup_resp->srbs_to_be_setup_length,
+ sizeof(f1ap_srb_to_be_setup_t));
+ AssertFatal(f1ap_ue_context_setup_resp->srbs_to_be_setup,
+ "could not allocate memory for f1ap_ue_context_setup_resp->drbs_setup\n");
+
+ for (i = 0; i < f1ap_ue_context_setup_resp->srbs_to_be_setup_length; ++i) {
+ f1ap_srb_to_be_setup_t *srb_p = &f1ap_ue_context_setup_resp->srbs_to_be_setup[i];
+ F1AP_SRBs_Setup_Item_t *srbs_setup_item_p;
+ srbs_setup_item_p = &((F1AP_SRBs_Setup_ItemIEs_t *)ie->value.choice.SRBs_Setup_List.list.array[i])->value.choice.SRBs_Setup_Item;
+ srb_p->srb_id = srbs_setup_item_p->sRBID;
+ srb_p->lcid = srbs_setup_item_p->lCID;
+ }
+ }
+
+ itti_send_msg_to_task(TASK_RRC_GNB, instance, msg_p);
return 0;
}
@@ -841,31 +770,26 @@ int CU_handle_UE_CONTEXT_SETUP_FAILURE(instance_t instance,
AssertFatal(1==0,"Not implemented yet\n");
}
-
int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
F1AP_UEContextReleaseRequest_t *container;
F1AP_UEContextReleaseRequestIEs_t *ie;
-
DevAssert(pdu);
-
container = &pdu->choice.initiatingMessage->value.choice.UEContextReleaseRequest;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
- const rnti_t rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance],
- ie->value.choice.GNB_CU_UE_F1AP_ID);
-
+ const rnti_t rnti = f1ap_get_rnti_by_cu_id(true, instance,
+ ie->value.choice.GNB_CU_UE_F1AP_ID);
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
- const rnti_t rnti2 = f1ap_get_rnti_by_du_id(&f1ap_cu_inst[instance],
- ie->value.choice.GNB_DU_UE_F1AP_ID);
+ const rnti_t rnti2 = f1ap_get_rnti_by_du_id(CUtype, instance,
+ ie->value.choice.GNB_DU_UE_F1AP_ID);
AssertFatal(rnti == rnti2, "RNTI obtained through DU ID (%x) is different from CU ID (%x)\n",
rnti2, rnti);
-
/* Cause */
/* We don't care for the moment
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseRequestIEs_t, ie, container,
@@ -890,15 +814,19 @@ int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
break;
}
*/
-
LOG_I(F1AP, "Received UE CONTEXT RELEASE REQUEST: Trigger RRC for RNTI %x\n", rnti);
- struct rrc_eNB_ue_context_s *ue_context_pP;
- ue_context_pP = rrc_eNB_get_ue_context(RC.rrc[instance], rnti);
- rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(
+
+ if (f1ap_req(true, instance)->cell_type==CELL_MACRO_GNB) {
+ AssertFatal(false,"must be devlopped\n");
+ } else {
+ struct rrc_eNB_ue_context_s *ue_context_pP;
+ ue_context_pP = rrc_eNB_get_ue_context(RC.rrc[instance], rnti);
+ rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(
instance,
ue_context_pP,
S1AP_CAUSE_RADIO_NETWORK,
21); // send cause 21: connection with ue lost
+ }
return 0;
}
@@ -906,82 +834,74 @@ int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
f1ap_ue_context_release_cmd_t *cmd) {
- F1AP_F1AP_PDU_t pdu;
+ F1AP_F1AP_PDU_t pdu= {0};
F1AP_UEContextReleaseCommand_t *out;
- F1AP_UEContextReleaseCommandIEs_t *ie;
-
- uint8_t *buffer;
- uint32_t len;
-
+ uint8_t *buffer=NULL;
+ uint32_t len=0;
/* Create */
/* 0. Message Type */
- memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
- pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
- pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_UEContextRelease;
- pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
- pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_UEContextReleaseCommand;
- out = &pdu.choice.initiatingMessage->value.choice.UEContextReleaseCommand;
-
+ asn1cCalloc(pdu.choice.initiatingMessage, tmp);
+ tmp->procedureCode = F1AP_ProcedureCode_id_UEContextRelease;
+ tmp->criticality = F1AP_Criticality_reject;
+ tmp->value.present = F1AP_InitiatingMessage__value_PR_UEContextReleaseCommand;
+ out = &tmp->value.choice.UEContextReleaseCommand;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
- ie = (F1AP_UEContextReleaseCommandIEs_t *)calloc(1, sizeof(F1AP_UEContextReleaseCommandIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_GNB_CU_UE_F1AP_ID;
- ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_cu_inst[instance], cmd->rnti);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextReleaseCommandIEs_t, ie1);
+ ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+ ie1->criticality = F1AP_Criticality_reject;
+ ie1->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_GNB_CU_UE_F1AP_ID;
+ ie1->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(CUtype, instance, cmd->rnti);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
- ie = (F1AP_UEContextReleaseCommandIEs_t *)calloc(1, sizeof(F1AP_UEContextReleaseCommandIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_GNB_DU_UE_F1AP_ID;
- ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_cu_inst[instance], cmd->rnti);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextReleaseCommandIEs_t, ie2);
+ ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+ ie2->criticality = F1AP_Criticality_reject;
+ ie2->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_GNB_DU_UE_F1AP_ID;
+ ie2->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(CUtype, instance, cmd->rnti);
/* mandatory */
/* c3. Cause */
- ie = (F1AP_UEContextReleaseCommandIEs_t *)calloc(1, sizeof(F1AP_UEContextReleaseCommandIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_Cause;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_Cause;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextReleaseCommandIEs_t, ie3);
+ ie3->id = F1AP_ProtocolIE_ID_id_Cause;
+ ie3->criticality = F1AP_Criticality_ignore;
+ ie3->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_Cause;
switch (cmd->cause) {
case F1AP_CAUSE_RADIO_NETWORK:
- ie->value.choice.Cause.present = F1AP_Cause_PR_radioNetwork;
- ie->value.choice.Cause.choice.radioNetwork = cmd->cause_value;
+ ie3->value.choice.Cause.present = F1AP_Cause_PR_radioNetwork;
+ ie3->value.choice.Cause.choice.radioNetwork = cmd->cause_value;
break;
+
case F1AP_CAUSE_TRANSPORT:
- ie->value.choice.Cause.present = F1AP_Cause_PR_transport;
- ie->value.choice.Cause.choice.transport = cmd->cause_value;
+ ie3->value.choice.Cause.present = F1AP_Cause_PR_transport;
+ ie3->value.choice.Cause.choice.transport = cmd->cause_value;
break;
+
case F1AP_CAUSE_PROTOCOL:
- ie->value.choice.Cause.present = F1AP_Cause_PR_protocol;
- ie->value.choice.Cause.choice.protocol = cmd->cause_value;
+ ie3->value.choice.Cause.present = F1AP_Cause_PR_protocol;
+ ie3->value.choice.Cause.choice.protocol = cmd->cause_value;
break;
+
case F1AP_CAUSE_MISC:
- ie->value.choice.Cause.present = F1AP_Cause_PR_misc;
- ie->value.choice.Cause.choice.misc = cmd->cause_value;
+ ie3->value.choice.Cause.present = F1AP_Cause_PR_misc;
+ ie3->value.choice.Cause.choice.misc = cmd->cause_value;
break;
+
case F1AP_CAUSE_NOTHING:
default:
- ie->value.choice.Cause.present = F1AP_Cause_PR_NOTHING;
+ ie3->value.choice.Cause.present = F1AP_Cause_PR_NOTHING;
break;
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c4. RRCContainer */
- ie = (F1AP_UEContextReleaseCommandIEs_t *)calloc(1, sizeof(F1AP_UEContextReleaseCommandIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_RRCContainer;
-
- OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char *)cmd->rrc_container,
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextReleaseCommandIEs_t, ie4);
+ ie4->id = F1AP_ProtocolIE_ID_id_RRCContainer;
+ ie4->criticality = F1AP_Criticality_ignore;
+ ie4->value.present = F1AP_UEContextReleaseCommandIEs__value_PR_RRCContainer;
+ OCTET_STRING_fromBuf(&ie4->value.choice.RRCContainer, (const char *)cmd->rrc_container,
cmd->rrc_container_length);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
@@ -989,91 +909,85 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
return -1;
}
- cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
-
+ f1ap_itti_send_sctp_data_req(true, instance, buffer, len, 0);
return 0;
}
-
int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
F1AP_UEContextReleaseComplete_t *container;
F1AP_UEContextReleaseCompleteIEs_t *ie;
-
DevAssert(pdu);
-
container = &pdu->choice.successfulOutcome->value.choice.UEContextReleaseComplete;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCompleteIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
- const rnti_t rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance],
- ie->value.choice.GNB_CU_UE_F1AP_ID);
-
+ const rnti_t rnti = f1ap_get_rnti_by_cu_id(CUtype, instance,
+ ie->value.choice.GNB_CU_UE_F1AP_ID);
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCompleteIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
- const rnti_t rnti2 = f1ap_get_rnti_by_du_id(&f1ap_cu_inst[instance],
- ie->value.choice.GNB_DU_UE_F1AP_ID);
+ const rnti_t rnti2 = f1ap_get_rnti_by_du_id(CUtype, instance,
+ ie->value.choice.GNB_DU_UE_F1AP_ID);
AssertFatal(rnti == rnti2, "RNTI obtained through DU ID (%x) is different from CU ID (%x)\n",
rnti2, rnti);
-
/* Optional*/
/* CriticalityDiagnostics */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextReleaseCompleteIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_CriticalityDiagnostics, false);
+
if (ie) {
// ie->value.choice.CriticalityDiagnostics.procedureCode
// ie->value.choice.CriticalityDiagnostics.triggeringMessage
// ie->value.choice.CriticalityDiagnostics.procedureCriticality
// ie->value.choice.CriticalityDiagnostics.transactionID
-
// F1AP_CriticalityDiagnostics_IE_List
}
protocol_ctxt_t ctxt;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, instance, ENB_FLAG_YES, rnti, 0, 0, instance);
- if (RC.nrrrc[instance]->node_type == ngran_gNB_CU) {
+ if (f1ap_req(true, instance)->cell_type==CELL_MACRO_GNB) {
struct rrc_gNB_ue_context_s *ue_context_p =
- rrc_gNB_get_ue_context(RC.nrrrc[instance], rnti);
+ rrc_gNB_get_ue_context(RC.nrrrc[instance], rnti);
if (ue_context_p) {
MessageDef *msg = itti_alloc_new_message(TASK_CU_F1, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE);
NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = ue_context_p->ue_context.gNB_ue_ngap_id;
itti_send_msg_to_task(TASK_NGAP, instance, msg);
-
rrc_gNB_remove_ue_context(&ctxt, RC.nrrrc[instance], ue_context_p);
} else {
LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti);
}
+
#ifdef ITTI_SIM
return 0;
#endif
-
} else {
struct rrc_eNB_ue_context_s *ue_context_p =
- rrc_eNB_get_ue_context(RC.rrc[instance], rnti);
+ rrc_eNB_get_ue_context(RC.rrc[instance], rnti);
if (ue_context_p) {
/* The following is normally done in the function rrc_rx_tx() */
rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT(instance,
ue_context_p->ue_context.eNB_ue_s1ap_id);
-
rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(instance, ue_context_p);
+
// erase data of GTP tunnels in UE context
for (int e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0;
memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab],
- 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab]));
+ 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab]));
ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0;
}
struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids =
- rrc_eNB_S1AP_get_ue_ids(RC.rrc[instance], 0,
- ue_context_p->ue_context.eNB_ue_s1ap_id);
+ rrc_eNB_S1AP_get_ue_ids(RC.rrc[instance], 0,
+ ue_context_p->ue_context.eNB_ue_s1ap_id);
+
if (rrc_ue_s1ap_ids)
- rrc_eNB_S1AP_remove_ue_ids(RC.rrc[instance], rrc_ue_s1ap_ids);
+ rrc_eNB_S1AP_remove_ue_ids(RC.rrc[instance], rrc_ue_s1ap_ids);
/* trigger UE release in RRC */
rrc_eNB_remove_ue_context(&ctxt, RC.rrc[instance], ue_context_p);
@@ -1087,477 +1001,345 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
/* notify the agent */
if (flexran_agent_get_rrc_xface(instance))
flexran_agent_get_rrc_xface(instance)->flexran_agent_notify_ue_state_change(
- instance, rnti, PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
+ instance, rnti, PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
LOG_I(F1AP, "Received UE CONTEXT RELEASE COMPLETE: Removing CU UE entry for RNTI %x\n", rnti);
- f1ap_remove_ue(&f1ap_cu_inst[instance], rnti);
+ f1ap_remove_ue(CUtype, instance, rnti);
return 0;
}
-
-
//void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(F1AP_UEContextModificationRequest_t *UEContextModificationRequest) {
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
- F1AP_F1AP_PDU_t pdu;
+ F1AP_F1AP_PDU_t pdu= {0};
F1AP_UEContextModificationRequest_t *out;
- F1AP_UEContextModificationRequestIEs_t *ie;
-
- uint8_t *buffer;
- uint32_t len;
- int i = 0;
-
+ uint8_t *buffer=NULL;
+ uint32_t len=0;
// for test
- int mcc = 208;
- int mnc = 92;
- int mnc_digit_length = 2;
-
+ cellIDs_t hardCoded= { .mcc=208, .mnc=93, .mnc_digit_length=2};
/* Create */
/* 0. Message Type */
- memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
- pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
- pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_UEContextModification;
- pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
- pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_UEContextModificationRequest;
- out = &pdu.choice.initiatingMessage->value.choice.UEContextModificationRequest;
-
+ asn1cCalloc(pdu.choice.initiatingMessage, tmp);
+ tmp->procedureCode = F1AP_ProcedureCode_id_UEContextModification;
+ tmp->criticality = F1AP_Criticality_reject;
+ tmp->value.present = F1AP_InitiatingMessage__value_PR_UEContextModificationRequest;
+ out = &tmp->value.choice.UEContextModificationRequest;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_GNB_CU_UE_F1AP_ID;
- ie->value.choice.GNB_CU_UE_F1AP_ID = 126L;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie1);
+ ie1->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+ ie1->criticality = F1AP_Criticality_reject;
+ ie1->value.present = F1AP_UEContextModificationRequestIEs__value_PR_GNB_CU_UE_F1AP_ID;
+ ie1->value.choice.GNB_CU_UE_F1AP_ID = 126L;
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_GNB_DU_UE_F1AP_ID;
- ie->value.choice.GNB_DU_UE_F1AP_ID = 651L;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie2);
+ ie2->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+ ie2->criticality = F1AP_Criticality_reject;
+ ie2->value.present = F1AP_UEContextModificationRequestIEs__value_PR_GNB_DU_UE_F1AP_ID;
+ ie2->value.choice.GNB_DU_UE_F1AP_ID = 651L;
/* optional */
/* c3. NRCGI */
if (0) {
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_SpCell_ID;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_NRCGI;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie3);
+ ie3->id = F1AP_ProtocolIE_ID_id_SpCell_ID;
+ ie3->criticality = F1AP_Criticality_ignore;
+ ie3->value.present = F1AP_UEContextModificationRequestIEs__value_PR_NRCGI;
/* - nRCGI */
- F1AP_NRCGI_t nRCGI;
- MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
- ie->value.choice.NRCGI = nRCGI;
-
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ addnRCGI(ie3->value.choice.NRCGI, &hardCoded);
}
/* mandatory */
/* c4. ServCellIndex */
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_ServCellIndex;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_ServCellIndex;
- ie->value.choice.ServCellIndex = 5L;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie4);
+ ie4->id = F1AP_ProtocolIE_ID_id_ServCellIndex;
+ ie4->criticality = F1AP_Criticality_reject;
+ ie4->value.present = F1AP_UEContextModificationRequestIEs__value_PR_ServCellIndex;
+ ie4->value.choice.ServCellIndex = 5L;
/* optional */
/* c5. DRXCycle */
if (0) {
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_DRXCycle;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRXCycle;
- ie->value.choice.DRXCycle.longDRXCycleLength = F1AP_LongDRXCycleLength_ms10; // enum
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie5);
+ ie5->id = F1AP_ProtocolIE_ID_id_DRXCycle;
+ ie5->criticality = F1AP_Criticality_ignore;
+ ie5->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRXCycle;
+ ie5->value.choice.DRXCycle.longDRXCycleLength = F1AP_LongDRXCycleLength_ms10; // enum
+
if (0) {
- ie->value.choice.DRXCycle.shortDRXCycleLength = (F1AP_ShortDRXCycleLength_t *)calloc(1, sizeof(F1AP_ShortDRXCycleLength_t));
- *ie->value.choice.DRXCycle.shortDRXCycleLength = F1AP_ShortDRXCycleLength_ms2; // enum
+ asn1cCallocOne(ie5->value.choice.DRXCycle.shortDRXCycleLength,
+ F1AP_ShortDRXCycleLength_ms2); // enum
}
+
if (0) {
- ie->value.choice.DRXCycle.shortDRXCycleTimer = (F1AP_ShortDRXCycleTimer_t *)calloc(1, sizeof(F1AP_ShortDRXCycleTimer_t));
- *ie->value.choice.DRXCycle.shortDRXCycleTimer = 123L;
+ asn1cCallocOne(ie5->value.choice.DRXCycle.shortDRXCycleTimer, 123L);
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
/* c5. CUtoDURRCInformation */
if (1) {
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_CUtoDURRCInformation;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_CUtoDURRCInformation;
- ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo = (F1AP_CG_ConfigInfo_t *)calloc(1, sizeof(F1AP_CG_ConfigInfo_t));
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie5);
+ ie5->id = F1AP_ProtocolIE_ID_id_CUtoDURRCInformation;
+ ie5->criticality = F1AP_Criticality_reject;
+ ie5->value.present = F1AP_UEContextModificationRequestIEs__value_PR_CUtoDURRCInformation;
+ asn1cCalloc(ie5->value.choice.CUtoDURRCInformation.cG_ConfigInfo, tmp);
/* optional */
- OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo, "asdsa1d32sa1d31asd31as",
+ OCTET_STRING_fromBuf(tmp, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
- ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList = (F1AP_UE_CapabilityRAT_ContainerList_t *)calloc(1, sizeof(F1AP_UE_CapabilityRAT_ContainerList_t));
+ asn1cCalloc(ie5->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList,
+ tmp2);
/* optional */
- OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList, "asdsa1d32sa1d31asd31as",
+ OCTET_STRING_fromBuf(tmp2, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
/* c6. TransmissionActionIndicator */
if (1) {
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_TransmissionActionIndicator;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_TransmissionActionIndicator;
- ie->value.choice.TransmissionActionIndicator = F1AP_TransmissionActionIndicator_stop;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie6);
+ ie6->id = F1AP_ProtocolIE_ID_id_TransmissionActionIndicator;
+ ie6->criticality = F1AP_Criticality_ignore;
+ ie6->value.present = F1AP_UEContextModificationRequestIEs__value_PR_TransmissionActionIndicator;
+ ie6->value.choice.TransmissionActionIndicator = F1AP_TransmissionActionIndicator_stop;
}
/* optional */
/* c7. ResourceCoordinationTransferContainer */
if (0) {
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_ResourceCoordinationTransferContainer;
- OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as",
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie7);
+ ie7->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer;
+ ie7->criticality = F1AP_Criticality_ignore;
+ ie7->value.present = F1AP_UEContextModificationRequestIEs__value_PR_ResourceCoordinationTransferContainer;
+ OCTET_STRING_fromBuf(&ie7->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
/* c7. RRCRconfigurationCompleteIndicator */
if (1) {
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_RRCReconfigurationCompleteIndicator;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_RRCReconfigurationCompleteIndicator;
- ie->value.choice.RRCReconfigurationCompleteIndicator = F1AP_RRCReconfigurationCompleteIndicator_true;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie71);
+ ie71->id = F1AP_ProtocolIE_ID_id_RRCReconfigurationCompleteIndicator;
+ ie71->criticality = F1AP_Criticality_ignore;
+ ie71->value.present = F1AP_UEContextModificationRequestIEs__value_PR_RRCReconfigurationCompleteIndicator;
+ ie71->value.choice.RRCReconfigurationCompleteIndicator = F1AP_RRCReconfigurationCompleteIndicator_true;
}
/* optional */
/* c8. RRCContainer */
if (1) {
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_RRCContainer;
- OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, "asdsa1d32sa1d31asd31as",
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie8);
+ ie8->id = F1AP_ProtocolIE_ID_id_RRCContainer;
+ ie8->criticality = F1AP_Criticality_ignore;
+ ie8->value.present = F1AP_UEContextModificationRequestIEs__value_PR_RRCContainer;
+ OCTET_STRING_fromBuf(&ie8->value.choice.RRCContainer, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* mandatory */
/* c9. SCell_ToBeSetupMod_List */
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetupMod_List;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SCell_ToBeSetupMod_List;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie9);
+ ie9->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetupMod_List;
+ ie9->criticality = F1AP_Criticality_ignore;
+ ie9->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SCell_ToBeSetupMod_List;
- for (i=0;
- i<1;
- i++) {
- //
- F1AP_SCell_ToBeSetupMod_ItemIEs_t *scell_toBeSetupMod_item_ies;
- scell_toBeSetupMod_item_ies = (F1AP_SCell_ToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_ToBeSetupMod_ItemIEs_t));
- //memset((void *)&scell_toBeSetupMod_item_ies, 0, sizeof(F1AP_SCell_ToBeSetupMod_ItemIEs_t));
- scell_toBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetupMod_Item;
- scell_toBeSetupMod_item_ies->criticality = F1AP_Criticality_ignore;
- scell_toBeSetupMod_item_ies->value.present = F1AP_SCell_ToBeSetupMod_ItemIEs__value_PR_SCell_ToBeSetupMod_Item;
-
- /* 8.1 SCell_ToBeSetup_Item */
- F1AP_SCell_ToBeSetupMod_Item_t scell_toBeSetupMod_item;
- memset((void *)&scell_toBeSetupMod_item, 0, sizeof(F1AP_SCell_ToBeSetupMod_Item_t));
-
- // /* - sCell_ID */
- F1AP_NRCGI_t nRCGI;
- memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
- MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
- scell_toBeSetupMod_item.sCell_ID = nRCGI;
-
- /* sCellIndex */
- scell_toBeSetupMod_item.sCellIndex = 6; // issue here
-
- // /* ADD */
- scell_toBeSetupMod_item_ies->value.choice.SCell_ToBeSetupMod_Item = scell_toBeSetupMod_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.SCell_ToBeSetupMod_List.list,
- scell_toBeSetupMod_item_ies);
+ for (int i=0; i<1; i++) {
+ //
+ asn1cSequenceAdd(ie9->value.choice.SCell_ToBeSetupMod_List.list,
+ F1AP_SCell_ToBeSetupMod_ItemIEs_t, scell_toBeSetupMod_item_ies);
+ scell_toBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetupMod_Item;
+ scell_toBeSetupMod_item_ies->criticality = F1AP_Criticality_ignore;
+ scell_toBeSetupMod_item_ies->value.present = F1AP_SCell_ToBeSetupMod_ItemIEs__value_PR_SCell_ToBeSetupMod_Item;
+ /* 8.1 SCell_ToBeSetup_Item */
+ F1AP_SCell_ToBeSetupMod_Item_t *scell_toBeSetupMod_item=
+ &scell_toBeSetupMod_item_ies->value.choice.SCell_ToBeSetupMod_Item;
+ // /* - sCell_ID */
+ addnRCGI(scell_toBeSetupMod_item->sCell_ID, &hardCoded);
+ /* sCellIndex */
+ scell_toBeSetupMod_item->sCellIndex = 6; // issue here
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c10. SCell_ToBeRemoved_List */
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_SCell_ToBeRemoved_List;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SCell_ToBeRemoved_List;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie10);
+ ie10->id = F1AP_ProtocolIE_ID_id_SCell_ToBeRemoved_List;
+ ie10->criticality = F1AP_Criticality_ignore;
+ ie10->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SCell_ToBeRemoved_List;
- for (i=0;
- i<1;
- i++) {
- //
- F1AP_SCell_ToBeRemoved_ItemIEs_t *scell_toBeRemoved_item_ies;
- scell_toBeRemoved_item_ies = (F1AP_SCell_ToBeRemoved_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_ToBeRemoved_ItemIEs_t));
- //memset((void *)&scell_toBeRemoved_item_ies, 0, sizeof(F1AP_SCell_ToBeRemoved_ItemIEs_t));
- scell_toBeRemoved_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeRemoved_Item;
- scell_toBeRemoved_item_ies->criticality = F1AP_Criticality_ignore;
- scell_toBeRemoved_item_ies->value.present = F1AP_SCell_ToBeRemoved_ItemIEs__value_PR_SCell_ToBeRemoved_Item;
-
- /* 10.1 SCell_ToBeRemoved_Item */
- F1AP_SCell_ToBeRemoved_Item_t scell_toBeRemoved_item;
- memset((void *)&scell_toBeRemoved_item, 0, sizeof(F1AP_SCell_ToBeRemoved_Item_t));
-
- /* - sCell_ID */
- F1AP_NRCGI_t nRCGI;
- memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
- MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
- scell_toBeRemoved_item.sCell_ID = nRCGI;
-
- /* ADD */
- scell_toBeRemoved_item_ies->value.choice.SCell_ToBeRemoved_Item = scell_toBeRemoved_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.SCell_ToBeRemoved_List.list,
- scell_toBeRemoved_item_ies);
+ for (int i=0; i<1; i++) {
+ //
+ asn1cSequenceAdd(ie10->value.choice.SCell_ToBeRemoved_List.list,
+ F1AP_SCell_ToBeRemoved_ItemIEs_t, scell_toBeRemoved_item_ies);
+ scell_toBeRemoved_item_ies = (F1AP_SCell_ToBeRemoved_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_ToBeRemoved_ItemIEs_t));
+ //memset((void *)&scell_toBeRemoved_item_ies, 0, sizeof(F1AP_SCell_ToBeRemoved_ItemIEs_t));
+ scell_toBeRemoved_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeRemoved_Item;
+ scell_toBeRemoved_item_ies->criticality = F1AP_Criticality_ignore;
+ scell_toBeRemoved_item_ies->value.present = F1AP_SCell_ToBeRemoved_ItemIEs__value_PR_SCell_ToBeRemoved_Item;
+ /* 10.1 SCell_ToBeRemoved_Item */
+ F1AP_SCell_ToBeRemoved_Item_t *scell_toBeRemoved_item=
+ &scell_toBeRemoved_item_ies->value.choice.SCell_ToBeRemoved_Item;
+ /* - sCell_ID */
+ addnRCGI(scell_toBeRemoved_item->sCell_ID, &hardCoded);
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c11. SRBs_ToBeSetupMod_List */
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetupMod_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SRBs_ToBeSetupMod_List;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie11);
+ ie11->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetupMod_List;
+ ie11->criticality = F1AP_Criticality_reject;
+ ie11->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SRBs_ToBeSetupMod_List;
- for (i=0;
- i<1;
- i++) {
+ for (int i=0; i<1; i++) {
//
- F1AP_SRBs_ToBeSetupMod_ItemIEs_t *srbs_toBeSetupMod_item_ies;
- srbs_toBeSetupMod_item_ies = (F1AP_SRBs_ToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_ToBeSetupMod_ItemIEs_t));
- //memset((void *)&srbs_toBeSetupMod_item_ies, 0, sizeof(F1AP_SRBs_ToBeSetupMod_ItemIEs_t));
+ asn1cSequenceAdd(ie11->value.choice.SRBs_ToBeSetupMod_List.list,
+ F1AP_SRBs_ToBeSetupMod_ItemIEs_t, srbs_toBeSetupMod_item_ies);
srbs_toBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetupMod_Item;
srbs_toBeSetupMod_item_ies->criticality = F1AP_Criticality_ignore;
srbs_toBeSetupMod_item_ies->value.present = F1AP_SRBs_ToBeSetupMod_ItemIEs__value_PR_SRBs_ToBeSetupMod_Item;
-
/* 9.1 SRBs_ToBeSetupMod_Item */
- F1AP_SRBs_ToBeSetupMod_Item_t srbs_toBeSetupMod_item;
- memset((void *)&srbs_toBeSetupMod_item, 0, sizeof(F1AP_SRBs_ToBeSetupMod_Item_t));
-
+ F1AP_SRBs_ToBeSetupMod_Item_t *srbs_toBeSetupMod_item=
+ &srbs_toBeSetupMod_item_ies->value.choice.SRBs_ToBeSetupMod_Item;
/* - sRBID */
- srbs_toBeSetupMod_item.sRBID = 3L;
-
- /* ADD */
- srbs_toBeSetupMod_item_ies->value.choice.SRBs_ToBeSetupMod_Item = srbs_toBeSetupMod_item;
-
- ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_ToBeSetupMod_List.list,
- srbs_toBeSetupMod_item_ies);
+ srbs_toBeSetupMod_item->sRBID = 3L;
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
/* mandatory */
/* c12. DRBs_ToBeSetupMod_List */
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetupMod_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie12);
+ ie12->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetupMod_List;
+ ie12->criticality = F1AP_Criticality_reject;
+ ie12->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List;
- for (i=0;
- i<1;
- i++) {
+ for (int i=0; i<1; i++) {
//
- F1AP_DRBs_ToBeSetupMod_ItemIEs_t *drbs_toBeSetupMod_item_ies;
- drbs_toBeSetupMod_item_ies = (F1AP_DRBs_ToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeSetupMod_ItemIEs_t));
+ asn1cSequenceAdd(ie12->value.choice.DRBs_ToBeSetupMod_List.list,
+ F1AP_DRBs_ToBeSetupMod_ItemIEs_t, drbs_toBeSetupMod_item_ies);
drbs_toBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetupMod_Item;
drbs_toBeSetupMod_item_ies->criticality = F1AP_Criticality_reject;
drbs_toBeSetupMod_item_ies->value.present = F1AP_DRBs_ToBeSetupMod_ItemIEs__value_PR_DRBs_ToBeSetupMod_Item;
-
/* 12.1 DRBs_ToBeSetupMod_Item */
- F1AP_DRBs_ToBeSetupMod_Item_t drbs_toBeSetupMod_item;
- memset((void *)&drbs_toBeSetupMod_item, 0, sizeof(F1AP_DRBs_ToBeSetupMod_Item_t));
-
+ F1AP_DRBs_ToBeSetupMod_Item_t *drbs_toBeSetupMod_item=
+ &drbs_toBeSetupMod_item_ies->value.choice.DRBs_ToBeSetupMod_Item;
/* dRBID */
- drbs_toBeSetupMod_item.dRBID = 30L;
-
+ drbs_toBeSetupMod_item->dRBID = 30L;
/* qoSInformation */
- drbs_toBeSetupMod_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
- drbs_toBeSetupMod_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
- drbs_toBeSetupMod_item.qoSInformation.choice.eUTRANQoS->qCI = 253L;
-
+ drbs_toBeSetupMod_item->qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
+ drbs_toBeSetupMod_item->qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
+ drbs_toBeSetupMod_item->qoSInformation.choice.eUTRANQoS->qCI = 253L;
/* uLUPTNLInformation_ToBeSetup_List */
- int j = 0;
int maxnoofULTunnels = 1; // 2;
- for (j=0;
- juLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
- F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
-
- /* transportLayerAddress */
- TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
-
- /* gTP_TEID */
- OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "4567",
- strlen("4567"));
-
- // Add
- uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
- ASN_SEQUENCE_ADD(&drbs_toBeSetupMod_item.uLUPTNLInformation_ToBeSetup_List.list, uLUPTNLInformation_ToBeSetup_Item);
+ for (int j=0; juLUPTNLInformation_ToBeSetup_List.list,
+ F1AP_ULUPTNLInformation_ToBeSetup_Item_t, uLUPTNLInformation_ToBeSetup_Item);
+ uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
+ asn1cCalloc(uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel,
+ gTPTunnel)
+ /* transportLayerAddress */
+ TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
+ /* gTP_TEID */
+ OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "4567",
+ strlen("4567"));
}
/* rLCMode */
- drbs_toBeSetupMod_item.rLCMode = F1AP_RLCMode_rlc_um_bidirectional; // enum
+ drbs_toBeSetupMod_item->rLCMode = F1AP_RLCMode_rlc_um_bidirectional; // enum
/* OPTIONAL */
/* ULConfiguration */
if (0) {
- drbs_toBeSetupMod_item.uLConfiguration = (F1AP_ULConfiguration_t *)calloc(1, sizeof(F1AP_ULConfiguration_t));
+ drbs_toBeSetupMod_item->uLConfiguration = (F1AP_ULConfiguration_t *)calloc(1, sizeof(F1AP_ULConfiguration_t));
}
-
- /* ADD */
- drbs_toBeSetupMod_item_ies->value.choice.DRBs_ToBeSetupMod_Item = drbs_toBeSetupMod_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeSetupMod_List.list,
- drbs_toBeSetupMod_item_ies);
-
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c13. DRBs_ToBeModified_List */
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeModified_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeModified_List;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie13);
+ ie13->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeModified_List;
+ ie13->criticality = F1AP_Criticality_reject;
+ ie13->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeModified_List;
- for (i=0;
- i<1;
- i++) {
+ for (int i=0; i<1; i++) {
//
- F1AP_DRBs_ToBeModified_ItemIEs_t *drbs_toBeModified_item_ies;
- drbs_toBeModified_item_ies = (F1AP_DRBs_ToBeModified_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeModified_ItemIEs_t));
+ asn1cSequenceAdd( ie13->value.choice.DRBs_ToBeModified_List.list,
+ F1AP_DRBs_ToBeModified_ItemIEs_t, drbs_toBeModified_item_ies);
drbs_toBeModified_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeModified_Item;
drbs_toBeModified_item_ies->criticality = F1AP_Criticality_reject;
drbs_toBeModified_item_ies->value.present = F1AP_DRBs_ToBeModified_ItemIEs__value_PR_DRBs_ToBeModified_Item;
-
/* 13.1 SRBs_ToBeModified_Item */
- F1AP_DRBs_ToBeModified_Item_t drbs_toBeModified_item;
- memset((void *)&drbs_toBeModified_item, 0, sizeof(F1AP_DRBs_ToBeModified_Item_t));
-
+ F1AP_DRBs_ToBeModified_Item_t *drbs_toBeModified_item=
+ &drbs_toBeModified_item_ies->value.choice.DRBs_ToBeModified_Item;
/* dRBID */
- drbs_toBeModified_item.dRBID = 30L;
-
+ drbs_toBeModified_item->dRBID = 30L;
/* qoSInformation */
- drbs_toBeModified_item.qoSInformation =calloc(1,sizeof(*drbs_toBeModified_item.qoSInformation));
- drbs_toBeModified_item.qoSInformation->present = F1AP_QoSInformation_PR_eUTRANQoS;
- drbs_toBeModified_item.qoSInformation->choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
- drbs_toBeModified_item.qoSInformation->choice.eUTRANQoS->qCI = 254L;
-
+ asn1cCalloc(drbs_toBeModified_item->qoSInformation, tmp);
+ tmp->present = F1AP_QoSInformation_PR_eUTRANQoS;
+ tmp->choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t));
+ tmp->choice.eUTRANQoS->qCI = 254L;
/* ULTunnels_ToBeModified_List */
- int j = 0;
int maxnoofULTunnels = 1; // 2;
- for (j=0;
- juLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
- F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t));
- TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
-
- OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204",
- strlen("1204"));
-
- uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel = gTPTunnel;
-
- ASN_SEQUENCE_ADD(&drbs_toBeModified_item.uLUPTNLInformation_ToBeSetup_List.list, uLUPTNLInformation_ToBeSetup_Item);
+ for (int j=0; juLUPTNLInformation_ToBeSetup_List.list,
+ F1AP_ULUPTNLInformation_ToBeSetup_Item_t, uLUPTNLInformation_ToBeSetup_Item);
+ uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel;
+ asn1cCalloc(uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel,
+ gTPTunnel);
+ TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress);
+ OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204",
+ strlen("1204"));
}
/* OPTIONAL */
/* ULConfiguration */
if (0) {
- drbs_toBeModified_item.uLConfiguration = (F1AP_ULConfiguration_t *)calloc(1, sizeof(F1AP_ULConfiguration_t));
+ drbs_toBeModified_item->uLConfiguration = (F1AP_ULConfiguration_t *)calloc(1, sizeof(F1AP_ULConfiguration_t));
}
-
- /* ADD */
- drbs_toBeModified_item_ies->value.choice.DRBs_ToBeModified_Item = drbs_toBeModified_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeModified_List.list,
- drbs_toBeModified_item_ies);
-
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c14. SRBs_ToBeReleased_List */
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeReleased_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SRBs_ToBeReleased_List;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie14);
+ ie14->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeReleased_List;
+ ie14->criticality = F1AP_Criticality_reject;
+ ie14->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SRBs_ToBeReleased_List;
- for (i=0;
- i<1;
- i++) {
+ for (int i=0; i<1; i++) {
//
- F1AP_SRBs_ToBeReleased_ItemIEs_t *srbs_toBeReleased_item_ies;
- srbs_toBeReleased_item_ies = (F1AP_SRBs_ToBeReleased_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_ToBeReleased_ItemIEs_t));
- //memset((void *)&srbs_toBeReleased_item_ies, 0, sizeof(F1AP_SRBs_ToBeReleased_ItemIEs_t));
+ asn1cSequenceAdd(ie14->value.choice.SRBs_ToBeReleased_List.list,
+ F1AP_SRBs_ToBeReleased_ItemIEs_t, srbs_toBeReleased_item_ies);
srbs_toBeReleased_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeReleased_Item;
srbs_toBeReleased_item_ies->criticality = F1AP_Criticality_ignore;
srbs_toBeReleased_item_ies->value.present = F1AP_SRBs_ToBeReleased_ItemIEs__value_PR_SRBs_ToBeReleased_Item;
-
/* 9.1 SRBs_ToBeReleased_Item */
- F1AP_SRBs_ToBeReleased_Item_t srbs_toBeReleased_item;
- memset((void *)&srbs_toBeReleased_item, 0, sizeof(F1AP_SRBs_ToBeReleased_Item_t));
-
+ F1AP_SRBs_ToBeReleased_Item_t *srbs_toBeReleased_item=
+ &srbs_toBeReleased_item_ies->value.choice.SRBs_ToBeReleased_Item;
/* - sRBID */
- srbs_toBeReleased_item.sRBID = 2L;
-
- /* ADD */
- srbs_toBeReleased_item_ies->value.choice.SRBs_ToBeReleased_Item = srbs_toBeReleased_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_ToBeReleased_List.list,
- srbs_toBeReleased_item_ies);
+ srbs_toBeReleased_item->sRBID = 2L;
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c15. DRBs_ToBeReleased_List */
- ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeReleased_List;
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie15);
+ ie15->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_List;
+ ie15->criticality = F1AP_Criticality_reject;
+ ie15->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeReleased_List;
- for (i=0;
- i<1;
- i++) {
+ for (int i=0; i<1; i++) {
//
- F1AP_DRBs_ToBeReleased_ItemIEs_t *drbs_toBeReleased_item_ies;
- drbs_toBeReleased_item_ies = (F1AP_DRBs_ToBeReleased_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeReleased_ItemIEs_t));
+ asn1cSequenceAdd(ie15->value.choice.DRBs_ToBeReleased_List.list,
+ F1AP_DRBs_ToBeReleased_ItemIEs_t, drbs_toBeReleased_item_ies);
drbs_toBeReleased_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_Item;
drbs_toBeReleased_item_ies->criticality = F1AP_Criticality_reject;
drbs_toBeReleased_item_ies->value.present = F1AP_DRBs_ToBeReleased_ItemIEs__value_PR_DRBs_ToBeReleased_Item;
-
/* 14.1 SRBs_ToBeReleased_Item */
- F1AP_DRBs_ToBeReleased_Item_t drbs_toBeReleased_item;
- memset((void *)&drbs_toBeReleased_item, 0, sizeof(F1AP_DRBs_ToBeReleased_Item_t));
-
+ F1AP_DRBs_ToBeReleased_Item_t *drbs_toBeReleased_item=
+ &drbs_toBeReleased_item_ies->value.choice.DRBs_ToBeReleased_Item;
/* dRBID */
- drbs_toBeReleased_item.dRBID = 30L;
-
- /* ADD */
- drbs_toBeReleased_item_ies->value.choice.DRBs_ToBeReleased_Item = drbs_toBeReleased_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeReleased_List.list,
- drbs_toBeReleased_item_ies);
-
+ drbs_toBeReleased_item->dRBID = 30L;
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
@@ -1569,27 +1351,27 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
}
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu) {
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
- F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t) {
+ F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t) {
AssertFatal(1==0,"Not implemented yet\n");
}
diff --git a/openair2/F1AP/f1ap_cu_ue_context_management.h b/openair2/F1AP/f1ap_cu_ue_context_management.h
index cc4ca3e35f..09af51ec54 100644
--- a/openair2/F1AP/f1ap_cu_ue_context_management.h
+++ b/openair2/F1AP/f1ap_cu_ue_context_management.h
@@ -37,7 +37,7 @@
* UE Context Setup
*/
int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
- f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req);
+ f1ap_ue_context_setup_t *f1ap_ue_context_setup_req);
int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
uint32_t assoc_id,
@@ -54,9 +54,9 @@ int CU_handle_UE_CONTEXT_SETUP_FAILURE(instance_t instance,
* UE Context Release Request (gNB-DU initiated)
*/
int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu);
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Release (gNB-CU initiated)
@@ -65,32 +65,32 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
f1ap_ue_context_release_cmd_t *cmd);
int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu);
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Modification (gNB-CU initiated)
*/
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance);
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu);
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu);
int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu);
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Modification Required (gNB-DU initiated)
*/
int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu);
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu);
int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
- F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t);
+ F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t);
/*
* UE Inactivity Notification
diff --git a/openair2/F1AP/f1ap_decoder.c b/openair2/F1AP/f1ap_decoder.c
index ac55db7fda..6ebf1cc16d 100644
--- a/openair2/F1AP/f1ap_decoder.c
+++ b/openair2/F1AP/f1ap_decoder.c
@@ -35,15 +35,13 @@
int asn1_decoder_xer_print = 0;
-static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
-{
+static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) {
//MessageDef *message_p;
//MessagesIds message_id;
//asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage->procedureCode) {
-
case F1AP_ProcedureCode_id_F1Setup:
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
@@ -68,15 +66,19 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_ULRRCMessageTransfer\n", __func__);
break;
+
case F1AP_ProcedureCode_id_UEContextRelease:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextRelease\n", __func__);
break;
+
case F1AP_ProcedureCode_id_UEContextReleaseRequest:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextReleaseRequest\n", __func__);
break;
+
case F1AP_ProcedureCode_id_UEContextSetup:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextSetup\n", __func__);
break;
+
// case F1AP_ProcedureCode_id_InitialContextSetup:
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
// message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG;
@@ -92,7 +94,7 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
// F1AP_ERROR("Unknown procedure ID (%d) for initiating message\n",
// (int)pdu->choice.initiatingMessage->procedureCode);
LOG_E(F1AP, "Unknown procedure ID (%d) for initiating message\n",
- (int)pdu->choice.initiatingMessage->procedureCode);
+ (int)pdu->choice.initiatingMessage->procedureCode);
AssertFatal( 0, "Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage->procedureCode);
return -1;
@@ -101,8 +103,7 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
return 0;
}
-static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu)
-{
+static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu) {
DevAssert(pdu != NULL);
switch(pdu->choice.successfulOutcome->procedureCode) {
@@ -118,41 +119,41 @@ static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu)
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextRelease\n", __func__);
break;
+ case F1AP_ProcedureCode_id_UEContextSetup:
+ LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextSetup\n", __func__);
+ break;
+
default:
LOG_E(F1AP,"Unknown procedure ID (%d) for successfull outcome message\n",
- (int)pdu->choice.successfulOutcome->procedureCode);
+ (int)pdu->choice.successfulOutcome->procedureCode);
return -1;
}
return 0;
}
-static int f1ap_decode_unsuccessful_outcome(F1AP_F1AP_PDU_t *pdu)
-{
+static int f1ap_decode_unsuccessful_outcome(F1AP_F1AP_PDU_t *pdu) {
DevAssert(pdu != NULL);
switch(pdu->choice.unsuccessfulOutcome->procedureCode) {
case F1AP_ProcedureCode_id_F1Setup:
- LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
- break;
+ LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
+ break;
default:
// F1AP_ERROR("Unknown procedure ID (%d) for unsuccessfull outcome message\n",
// (int)pdu->choice.unsuccessfulOutcome->procedureCode);
LOG_E(F1AP, "Unknown procedure ID (%d) for unsuccessfull outcome message\n",
- (int)pdu->choice.unsuccessfulOutcome->procedureCode);
+ (int)pdu->choice.unsuccessfulOutcome->procedureCode);
return -1;
}
return 0;
}
-int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
-{
+int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length) {
asn_dec_rval_t dec_ret;
-
DevAssert(buffer != NULL);
-
dec_ret = aper_decode(NULL,
&asn_DEF_F1AP_F1AP_PDU,
(void **)&pdu,
@@ -166,6 +167,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT END ----------------- \n");
}
+
//LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code);
if (dec_ret.code != RC_OK) {
@@ -188,6 +190,5 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
break;
}
-
return -1;
}
diff --git a/openair2/F1AP/f1ap_du_interface_management.c b/openair2/F1AP/f1ap_du_interface_management.c
index b6ece9b13f..ce54e90191 100644
--- a/openair2/F1AP/f1ap_du_interface_management.c
+++ b/openair2/F1AP/f1ap_du_interface_management.c
@@ -37,24 +37,21 @@
#include "f1ap_du_interface_management.h"
#include "assertions.h"
-extern f1ap_setup_req_t *f1ap_du_data;
-extern RAN_CONTEXT_t RC;
-
-int nrb_lut[29] = {11, 18, 24, 25, 31, 32, 38, 51, 52, 65, 66, 78, 79, 93, 106, 107, 121, 132, 133, 135, 160, 162, 189, 216, 217, 245, 264, 270, 273};
-
int to_NRNRB(int nrb) {
- if (RC.nrrrc) {
- for (int i=0;i<29;i++) if (nrb_lut[i] == nrb) return i;
- AssertFatal(1==0,"nrb %d is not in the list of possible NRNRB\n",nrb);
- } else {
- return nrb;
- }
+ for (int i=0; iprocedureCode = F1AP_ProcedureCode_id_F1Setup;
- pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
- pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_F1SetupRequest;
- out = &pdu.choice.initiatingMessage->value.choice.F1SetupRequest;
-
+ asn1cCalloc(pdu.choice.initiatingMessage, initMsg);
+ initMsg->procedureCode = F1AP_ProcedureCode_id_F1Setup;
+ initMsg->criticality = F1AP_Criticality_reject;
+ initMsg->value.present = F1AP_InitiatingMessage__value_PR_F1SetupRequest;
+ F1AP_F1SetupRequest_t *f1Setup = &initMsg->value.choice.F1SetupRequest;
/* mandatory */
/* c1. Transaction ID (integer value) */
- ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_F1SetupRequestIEs__value_PR_TransactionID;
- ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
+ asn1cSequenceAdd(f1Setup->protocolIEs.list, F1AP_F1SetupRequestIEs_t, ieC1);
+ ieC1->id = F1AP_ProtocolIE_ID_id_TransactionID;
+ ieC1->criticality = F1AP_Criticality_reject;
+ ieC1->value.present = F1AP_F1SetupRequestIEs__value_PR_TransactionID;
+ ieC1->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP);
/* mandatory */
/* c2. GNB_DU_ID (integer value) */
- ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_ID;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID;
- asn_int642INTEGER(&ie->value.choice.GNB_DU_ID, f1ap_du_data->gNB_DU_id);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ asn1cSequenceAdd(f1Setup->protocolIEs.list, F1AP_F1SetupRequestIEs_t, ieC2);
+ ieC2->id = F1AP_ProtocolIE_ID_id_gNB_DU_ID;
+ ieC2->criticality = F1AP_Criticality_reject;
+ ieC2->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID;
+ asn_int642INTEGER(&ieC2->value.choice.GNB_DU_ID, f1ap_req(false, instance)->gNB_DU_id);
/* optional */
/* c3. GNB_DU_Name */
- if (f1ap_du_data->gNB_DU_name != NULL) {
- ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_Name;
- ie->criticality = F1AP_Criticality_ignore;
- ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Name;
- OCTET_STRING_fromBuf(&ie->value.choice.GNB_DU_Name, f1ap_du_data->gNB_DU_name,
- strlen(f1ap_du_data->gNB_DU_name));
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ if (f1ap_req(false,instance)->gNB_DU_name != NULL) {
+ asn1cSequenceAdd(f1Setup->protocolIEs.list, F1AP_F1SetupRequestIEs_t, ieC3);
+ ieC3->id = F1AP_ProtocolIE_ID_id_gNB_DU_Name;
+ ieC3->criticality = F1AP_Criticality_ignore;
+ ieC3->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Name;
+ char *gNB_DU_name=f1ap_req(false, instance)->gNB_DU_name;
+ OCTET_STRING_fromBuf(&ieC3->value.choice.GNB_DU_Name, gNB_DU_name, strlen(gNB_DU_name));
}
/* mandatory */
/* c4. served cells list */
- ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List;
-
- int num_cells_available = f1ap_du_data->num_cells_available;
+ asn1cSequenceAdd(f1Setup->protocolIEs.list, F1AP_F1SetupRequestIEs_t, ieCells);
+ ieCells->id = F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List;
+ ieCells->criticality = F1AP_Criticality_reject;
+ ieCells->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List;
+ int num_cells_available = f1ap_req(false, instance)->num_cells_available;
LOG_D(F1AP, "num_cells_available = %d \n", num_cells_available);
- for (i=0;
- iid = F1AP_ProtocolIE_ID_id_GNB_DU_Served_Cells_Item;
- gnb_du_served_cell_list_item_ies->criticality = F1AP_Criticality_reject;
- gnb_du_served_cell_list_item_ies->value.present = F1AP_GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item;
-
+ for (int i=0; icell[i];
+ asn1cSequenceAdd(ieCells->value.choice.GNB_DU_Served_Cells_List.list,
+ F1AP_GNB_DU_Served_Cells_ItemIEs_t, duServedCell);
+ duServedCell->id = F1AP_ProtocolIE_ID_id_GNB_DU_Served_Cells_Item;
+ duServedCell->criticality = F1AP_Criticality_reject;
+ duServedCell->value.present = F1AP_GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item;
+ F1AP_GNB_DU_Served_Cells_Item_t *gnb_du_served_cells_item=&duServedCell->value.choice.GNB_DU_Served_Cells_Item;
+ /* 4.1.1 served cell Information */
+ F1AP_Served_Cell_Information_t *served_cell_information= &gnb_du_served_cells_item->served_Cell_Information;
+ addnRCGI(served_cell_information->nRCGI,cell);
+ /* - nRPCI */
+ served_cell_information->nRPCI = cell->nr_pci; // int 0..1007
+ /* - fiveGS_TAC */
+ uint32_t tac=htonl(cell->tac);
+ asn1cCalloc(served_cell_information->fiveGS_TAC, netOrder);
+ OCTET_STRING_fromBuf(netOrder, ((char *)&tac)+1, 3);
- F1AP_GNB_DU_Served_Cells_Item_t gnb_du_served_cells_item;
- memset((void *)&gnb_du_served_cells_item, 0, sizeof(F1AP_GNB_DU_Served_Cells_Item_t));
+ /* - Configured_EPS_TAC */
+ if(0) {
+ served_cell_information->configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
+ OCTET_STRING_fromBuf(served_cell_information->configured_EPS_TAC, "2", 2);
+ }
- /* 4.1.1 served cell Information */
- F1AP_Served_Cell_Information_t served_cell_information;
+ /* servedPLMN information */
+ asn1cSequenceAdd(served_cell_information->servedPLMNs.list, F1AP_ServedPLMNs_Item_t,servedPLMN_item);
+ MCC_MNC_TO_PLMNID(cell->mcc, cell->mnc, cell->mnc_digit_length, &servedPLMN_item->pLMN_Identity);
+ // // /* - CHOICE NR-MODE-Info */
+ F1AP_NR_Mode_Info_t *nR_Mode_Info= &served_cell_information->nR_Mode_Info;
- memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t));
+ if (f1ap_req(false, instance)->fdd_flag) { // FDD
+ nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
+ asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);
+ /* FDD.1 UL NRFreqInfo */
+ /* FDD.1.1 UL NRFreqInfo ARFCN */
+ fDD_Info->uL_NRFreqInfo.nRARFCN = f1ap_req(false,instance)->nr_mode_info[i].fdd.ul_nr_arfcn; // Integer
- /* - nRCGI */
- F1AP_NRCGI_t nRCGI;
- memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
- MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity);
- LOG_D(F1AP, "plmn: (%d,%d)\n",f1ap_du_data->mcc[i],f1ap_du_data->mnc[i]);
- //MCC_MNC_TO_PLMNID(208, 95, 2, &nRCGI.pLMN_Identity);
+ /* FDD.1.2 F1AP_SUL_Information */
+ if(0) { // Optional
+ asn1cCalloc(fDD_Info->uL_NRFreqInfo.sul_Information, fdd_sul_info);
+ fdd_sul_info->sUL_NRARFCN = 0;
+ fdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
+ fdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
+ }
- NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &nRCGI.nRCellIdentity);
- LOG_D(F1AP, "nRCellIdentity (%llx): %x.%x.%x.%x.%x\n",
- (long long unsigned int)f1ap_du_data->nr_cellid[i],
- nRCGI.nRCellIdentity.buf[0],
- nRCGI.nRCellIdentity.buf[1],
- nRCGI.nRCellIdentity.buf[2],
- nRCGI.nRCellIdentity.buf[3],
- nRCGI.nRCellIdentity.buf[4]);
+ /* FDD.1.3 freqBandListNr */
+ int fdd_ul_num_available_freq_Bands = f1ap_req(false,instance)->nr_mode_info[i].fdd.ul_num_frequency_bands;
+ LOG_D(F1AP, "fdd_ul_num_available_freq_Bands = %d \n", fdd_ul_num_available_freq_Bands);
- served_cell_information.nRCGI = nRCGI;
+ for (int fdd_ul_j=0; fdd_ul_juL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
+ /* FDD.1.3.1 freqBandIndicatorNr*/
+ nr_freqBandNrItem->freqBandIndicatorNr = f1ap_req(false,instance)->nr_mode_info[i].fdd.ul_nr_band[fdd_ul_j]; //
+ /* FDD.1.3.2 supportedSULBandList*/
+ int num_available_supported_SULBands = f1ap_req(false,instance)->nr_mode_info[i].fdd.ul_num_sul_frequency_bands;
+ LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
- /* - nRPCI */
- served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
+ for (int fdd_ul_k=0; fdd_ul_ksupportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, nr_supportedSULFreqBandItem);
+ /* FDD.1.3.2.1 freqBandIndicatorNr */
+ nr_supportedSULFreqBandItem->freqBandIndicatorNr = f1ap_req(false,instance)->nr_mode_info[i].fdd.ul_nr_sul_band[fdd_ul_k]; //
+ } // for FDD : UL supported_SULBands
+ } // for FDD : UL freq_Bands
- /* - fiveGS_TAC */
- if (RC.nrrrc) {
- uint8_t fiveGS_TAC[3];
- fiveGS_TAC[0] = ((uint8_t*)&f1ap_du_data->tac[i])[2];
- fiveGS_TAC[1] = ((uint8_t*)&f1ap_du_data->tac[i])[1];
- fiveGS_TAC[2] = ((uint8_t*)&f1ap_du_data->tac[i])[0];
- OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
- (const char *)fiveGS_TAC,
- 3);
- } else {
- OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
- (const char*)&f1ap_du_data->tac[i],
- 3);
- }
+ /* FDD.2 DL NRFreqInfo */
+ /* FDD.2.1 DL NRFreqInfo ARFCN */
+ fDD_Info->dL_NRFreqInfo.nRARFCN = f1ap_req(false,instance)->nr_mode_info[i].fdd.dl_nr_arfcn; // Integer
- /* - Configured_EPS_TAC */
- if(0){
- served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t));
- OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC,
- "2",
- 2);
- }
+ /* FDD.2.2 F1AP_SUL_Information */
+ if(0) { // Optional
+ F1AP_SUL_Information_t *fdd_sul_info=fDD_Info->dL_NRFreqInfo.sul_Information;
+ fdd_sul_info->sUL_NRARFCN = 0;
+ fdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
+ fdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
+ }
- /* servedPLMN information */
- F1AP_ServedPLMNs_Item_t *servedPLMN_item = calloc(1,sizeof(*servedPLMN_item));
- memset(servedPLMN_item,0,sizeof(*servedPLMN_item));
- MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
- ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item);
+ /* FDD.2.3 freqBandListNr */
+ int fdd_dl_num_available_freq_Bands = f1ap_req(false,instance)->nr_mode_info[i].fdd.dl_num_frequency_bands;
+ LOG_D(F1AP, "fdd_dl_num_available_freq_Bands = %d \n", fdd_dl_num_available_freq_Bands);
- // // /* - CHOICE NR-MODE-Info */
- F1AP_NR_Mode_Info_t nR_Mode_Info;
- //f1ap_du_data->fdd_flag = 1;
- if (f1ap_du_data->fdd_flag) { // FDD
- nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
- F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
+ for (int fdd_dl_j=0; fdd_dl_jdL_NRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
+ /* FDD.2.3.1 freqBandIndicatorNr*/
+ nr_freqBandNrItem->freqBandIndicatorNr = f1ap_req(false,instance)->nr_mode_info[i].fdd.dl_nr_band[fdd_dl_j]; //
+ /* FDD.2.3.2 supportedSULBandList*/
+ int num_available_supported_SULBands = f1ap_req(false,instance)->nr_mode_info[i].fdd.dl_num_sul_frequency_bands;
+ LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
- /* FDD.1 UL NRFreqInfo */
- /* FDD.1.1 UL NRFreqInfo ARFCN */
- fDD_Info->uL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_arfcn; // Integer
+ for (int fdd_dl_k=0; fdd_dl_ksupportedSULBandList.list, F1AP_SupportedSULFreqBandItem_t, nr_supportedSULFreqBandItem);
+ /* FDD.2.3.2.1 freqBandIndicatorNr */
+ nr_supportedSULFreqBandItem->freqBandIndicatorNr = f1ap_req(false,instance)->nr_mode_info[i].fdd.dl_nr_sul_band[fdd_dl_k]; //
+ } // for FDD : DL supported_SULBands
+ } // for FDD : DL freq_Bands
- /* FDD.1.2 F1AP_SUL_Information */
- if(0) { // Optional
- F1AP_SUL_Information_t *fdd_sul_info = (F1AP_SUL_Information_t *)calloc(1, sizeof(F1AP_SUL_Information_t));
- fdd_sul_info->sUL_NRARFCN = 0;
- fdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
- fdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
- fDD_Info->uL_NRFreqInfo.sul_Information = fdd_sul_info;
- }
+ /* FDD.3 UL Transmission Bandwidth */
+ fDD_Info->uL_Transmission_Bandwidth.nRSCS = f1ap_req(false,instance)->nr_mode_info[i].fdd.ul_scs;
+ fDD_Info->uL_Transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_req(false,instance)->nr_mode_info[i].fdd.ul_nrb);
+ /* FDD.4 DL Transmission Bandwidth */
+ fDD_Info->dL_Transmission_Bandwidth.nRSCS = f1ap_req(false,instance)->nr_mode_info[i].fdd.dl_scs;
+ fDD_Info->dL_Transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_req(false,instance)->nr_mode_info[i].fdd.dl_nrb);
+ } else { // TDD
+ nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_tDD;
+ asn1cCalloc(nR_Mode_Info->choice.tDD, tDD_Info);
+ /* TDD.1 nRFreqInfo */
+ /* TDD.1.1 nRFreqInfo ARFCN */
+ tDD_Info->nRFreqInfo.nRARFCN = f1ap_req(false,instance)->nr_mode_info[i].tdd.nr_arfcn; // Integer
- /* FDD.1.3 freqBandListNr */
- int fdd_ul_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.ul_num_frequency_bands;
- LOG_I(F1AP, "fdd_ul_num_available_freq_Bands = %d \n", fdd_ul_num_available_freq_Bands);
- int fdd_ul_j;
- for (fdd_ul_j=0;
- fdd_ul_jnRFreqInfo.sul_Information;
+ tdd_sul_info->sUL_NRARFCN = 0;
+ tdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
+ tdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
+ }
- F1AP_FreqBandNrItem_t nr_freqBandNrItem;
- memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
- /* FDD.1.3.1 freqBandIndicatorNr*/
- nr_freqBandNrItem.freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_band[fdd_ul_j]; //
+ /* TDD.1.3 freqBandListNr */
+ int tdd_num_available_freq_Bands = f1ap_req(false,instance)->nr_mode_info[i].tdd.num_frequency_bands;
+ LOG_D(F1AP, "tdd_num_available_freq_Bands = %d \n", tdd_num_available_freq_Bands);
- /* FDD.1.3.2 supportedSULBandList*/
- int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].fdd.ul_num_sul_frequency_bands;
- LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
- int fdd_ul_k;
- for (fdd_ul_k=0;
- fdd_ul_knr_mode_info[i].fdd.ul_nr_sul_band[fdd_ul_k]; //
- ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
- } // for FDD : UL supported_SULBands
- ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
- } // for FDD : UL freq_Bands
-
- /* FDD.2 DL NRFreqInfo */
- /* FDD.2.1 DL NRFreqInfo ARFCN */
- fDD_Info->dL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_arfcn; // Integer
+ for (int j=0; jnRFreqInfo.freqBandListNr.list, F1AP_FreqBandNrItem_t, nr_freqBandNrItem);
+ /* TDD.1.3.1 freqBandIndicatorNr*/
+ nr_freqBandNrItem->freqBandIndicatorNr = *f1ap_req(false,instance)->nr_mode_info[i].tdd.nr_band; //
+ /* TDD.1.3.2 supportedSULBandList*/
+ int num_available_supported_SULBands = f1ap_req(false,instance)->nr_mode_info[i].tdd.num_sul_frequency_bands;
+ LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
- /* FDD.2.2 F1AP_SUL_Information */
- if(0) { // Optional
- F1AP_SUL_Information_t *fdd_sul_info = (F1AP_SUL_Information_t *)calloc(1, sizeof(F1AP_SUL_Information_t));
- fdd_sul_info->sUL_NRARFCN = 0;
- fdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
- fdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
- fDD_Info->dL_NRFreqInfo.sul_Information = fdd_sul_info;
- }
+ for (int k=0; ksupportedSULBandList.list,F1AP_SupportedSULFreqBandItem_t, nr_supportedSULFreqBandItem);
+ /* TDD.1.3.2.1 freqBandIndicatorNr */
+ nr_supportedSULFreqBandItem->freqBandIndicatorNr = *f1ap_req(false,instance)->nr_mode_info[i].tdd.nr_sul_band; //
+ } // for TDD : supported_SULBands
+ } // for TDD : freq_Bands
- /* FDD.2.3 freqBandListNr */
- int fdd_dl_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.dl_num_frequency_bands;
- LOG_I(F1AP, "fdd_dl_num_available_freq_Bands = %d \n", fdd_dl_num_available_freq_Bands);
- int fdd_dl_j;
- for (fdd_dl_j=0;
- fdd_dl_jnr_mode_info[i].fdd.dl_nr_band[fdd_dl_j]; //
-
- /* FDD.2.3.2 supportedSULBandList*/
- int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].fdd.dl_num_sul_frequency_bands;
- LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
- int fdd_dl_k;
- for (fdd_dl_k=0;
- fdd_dl_knr_mode_info[i].fdd.dl_nr_sul_band[fdd_dl_k]; //
- ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
- } // for FDD : DL supported_SULBands
- ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
- } // for FDD : DL freq_Bands
-
- /* FDD.3 UL Transmission Bandwidth */
- fDD_Info->uL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.ul_scs;
- fDD_Info->uL_Transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].fdd.ul_nrb);
- /* FDD.4 DL Transmission Bandwidth */
- fDD_Info->dL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.dl_scs;
- fDD_Info->dL_Transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].fdd.dl_nrb);
-
- nR_Mode_Info.choice.fDD = fDD_Info;
- } else { // TDD
- nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD;
- F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t));
-
- /* TDD.1 nRFreqInfo */
- /* TDD.1.1 nRFreqInfo ARFCN */
- tDD_Info->nRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].tdd.nr_arfcn; // Integer
-
- /* TDD.1.2 F1AP_SUL_Information */
- if(0) { // Optional
- F1AP_SUL_Information_t *tdd_sul_info = (F1AP_SUL_Information_t *)calloc(1, sizeof(F1AP_SUL_Information_t));
- tdd_sul_info->sUL_NRARFCN = 0;
- tdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
- tdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
- tDD_Info->nRFreqInfo.sul_Information = tdd_sul_info;
- }
-
- /* TDD.1.3 freqBandListNr */
- int tdd_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].tdd.num_frequency_bands;
- LOG_I(F1AP, "tdd_num_available_freq_Bands = %d \n", tdd_num_available_freq_Bands);
- AssertFatal(tdd_num_available_freq_Bands > 0, "should have at least one TDD band available\n");
- int j;
- for (j=0;
- jnr_mode_info[i].tdd.nr_band; //
-
- /* TDD.1.3.2 supportedSULBandList*/
- int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].tdd.num_sul_frequency_bands;
- LOG_D(F1AP, "num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
- int k;
- for (k=0;
- knr_mode_info[i].tdd.nr_sul_band; //
- ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
- } // for TDD : supported_SULBands
- ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
- } // for TDD : freq_Bands
-
- /* TDD.2 transmission_Bandwidth */
- tDD_Info->transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].tdd.scs;
- tDD_Info->transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_du_data->nr_mode_info[i].tdd.nrb);
-
- nR_Mode_Info.choice.tDD = tDD_Info;
- } // if nR_Mode_Info
-
- served_cell_information.nR_Mode_Info = nR_Mode_Info;
-
- /* - measurementTimingConfiguration */
- char *measurementTimingConfiguration = f1ap_du_data->measurement_timing_information[i]; // sept. 2018
-
- OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
- measurementTimingConfiguration,
- strlen(measurementTimingConfiguration));
- gnb_du_served_cells_item.served_Cell_Information = served_cell_information; //
-
- /* 4.1.2 gNB-DU System Information */
- F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t));
-
- OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
- (const char*)f1ap_du_data->mib[i],//f1ap_du_data->mib,
- f1ap_du_data->mib_length[i]);
-
- LOG_D(F1AP,"Filling SIB1_message for cell %d, length %d\n",i,f1ap_du_data->sib1_length[i]);
- OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
- (const char*)f1ap_du_data->sib1[i],
- f1ap_du_data->sib1_length[i]);
-
- gnb_du_served_cells_item.gNB_DU_System_Information = gNB_DU_System_Information; //
-
- /* ADD */
- gnb_du_served_cell_list_item_ies->value.choice.GNB_DU_Served_Cells_Item = gnb_du_served_cells_item;
-
- ASN_SEQUENCE_ADD(&ie->value.choice.GNB_DU_Served_Cells_List.list,
- gnb_du_served_cell_list_item_ies);
+ /* TDD.2 transmission_Bandwidth */
+ tDD_Info->transmission_Bandwidth.nRSCS = f1ap_req(false,instance)->nr_mode_info[i].tdd.scs;
+ tDD_Info->transmission_Bandwidth.nRNRB = to_NRNRB(f1ap_req(false,instance)->nr_mode_info[i].tdd.nrb);
+ } // if nR_Mode_Info
+ /* - measurementTimingConfiguration */
+ char *measurementTimingConfiguration = f1ap_req(false,instance)->measurement_timing_information[i]; // sept. 2018
+ OCTET_STRING_fromBuf(&served_cell_information->measurementTimingConfiguration,
+ measurementTimingConfiguration,
+ strlen(measurementTimingConfiguration));
+ asn1cCalloc(gnb_du_served_cells_item->gNB_DU_System_Information, gNB_DU_System_Information);
+ /* 4.1.2 gNB-DU System Information */
+ OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
+ (const char *)f1ap_req(false,instance)->mib[i], //f1ap_du_data->mib,
+ f1ap_req(false,instance)->mib_length[i]);
+ OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
+ (const char *)f1ap_req(false,instance)->sib1[i],
+ f1ap_req(false,instance)->sib1_length[i]);
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c5. RRC VERSION */
- if(RC.nrrrc) {
- ie = (F1AP_F1SetupRequestIEs_t *) calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_GNB_DU_RRC_Version;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_F1SetupRequestIEs__value_PR_RRC_Version;
- ie->value.choice.RRC_Version.latest_RRC_Version.buf = calloc(1, sizeof(char));
- ie->value.choice.RRC_Version.latest_RRC_Version.buf[0] = 0xe0;
- ie->value.choice.RRC_Version.latest_RRC_Version.size = 1;
- ie->value.choice.RRC_Version.latest_RRC_Version.bits_unused = 5;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
- }
+ asn1cSequenceAdd(f1Setup->protocolIEs.list, F1AP_F1SetupRequestIEs_t, ie2);
+ ie2->id = F1AP_ProtocolIE_ID_id_GNB_DU_RRC_Version;
+ ie2->criticality = F1AP_Criticality_reject;
+ ie2->value.present = F1AP_F1SetupRequestIEs__value_PR_RRC_Version;
+ ie2->value.choice.RRC_Version.latest_RRC_Version.buf=calloc(1,sizeof(char));
+ ie2->value.choice.RRC_Version.latest_RRC_Version.buf[0] = 0xe0;
+ ie2->value.choice.RRC_Version.latest_RRC_Version.size = 1;
+ ie2->value.choice.RRC_Version.latest_RRC_Version.bits_unused = 5;
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
@@ -433,161 +315,154 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
return -1;
}
- MSC_LOG_TX_MESSAGE(
- MSC_F1AP_DU,
- MSC_F1AP_CU,
- (const char *)buffer,
- len,
- MSC_AS_TIME_FMT" F1_SETUP_REQUEST initiatingMessage gNB_DU_name %s",
- 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- f1ap_du_data->gNB_DU_name);
-
- du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, 0);
-
+ ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
+ f1ap_itti_send_sctp_data_req(false, instance, buffer, len, 0);
return 0;
}
int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
- uint32_t assoc_id,
- uint32_t stream,
- F1AP_F1AP_PDU_t *pdu)
-{
-
+ uint32_t assoc_id,
+ uint32_t stream,
+ F1AP_F1AP_PDU_t *pdu) {
LOG_D(F1AP, "DU_handle_F1_SETUP_RESPONSE\n");
-
AssertFatal(pdu->present == F1AP_F1AP_PDU_PR_successfulOutcome,
- "pdu->present != F1AP_F1AP_PDU_PR_successfulOutcome\n");
+ "pdu->present != F1AP_F1AP_PDU_PR_successfulOutcome\n");
AssertFatal(pdu->choice.successfulOutcome->procedureCode == F1AP_ProcedureCode_id_F1Setup,
- "pdu->choice.successfulOutcome->procedureCode != F1AP_ProcedureCode_id_F1Setup\n");
+ "pdu->choice.successfulOutcome->procedureCode != F1AP_ProcedureCode_id_F1Setup\n");
AssertFatal(pdu->choice.successfulOutcome->criticality == F1AP_Criticality_reject,
- "pdu->choice.successfulOutcome->criticality != F1AP_Criticality_reject\n");
+ "pdu->choice.successfulOutcome->criticality != F1AP_Criticality_reject\n");
AssertFatal(pdu->choice.successfulOutcome->value.present == F1AP_SuccessfulOutcome__value_PR_F1SetupResponse,
- "pdu->choice.successfulOutcome->value.present != F1AP_SuccessfulOutcome__value_PR_F1SetupResponse\n");
-
+ "pdu->choice.successfulOutcome->value.present != F1AP_SuccessfulOutcome__value_PR_F1SetupResponse\n");
F1AP_F1SetupResponse_t *in = &pdu->choice.successfulOutcome->value.choice.F1SetupResponse;
-
-
F1AP_F1SetupResponseIEs_t *ie;
int TransactionId = -1;
int num_cells_to_activate = 0;
F1AP_Cells_to_be_Activated_List_Item_t *cell;
-
MessageDef *msg_p = itti_alloc_new_message (TASK_DU_F1, 0, F1AP_SETUP_RESP);
-
LOG_D(F1AP, "F1AP: F1Setup-Resp: protocolIEs.list.count %d\n",
in->protocolIEs.list.count);
- for (int i=0;i < in->protocolIEs.list.count; i++) {
+
+ for (int i=0; i < in->protocolIEs.list.count; i++) {
ie = in->protocolIEs.list.array[i];
+
switch (ie->id) {
case F1AP_ProtocolIE_ID_id_TransactionID:
AssertFatal(ie->criticality == F1AP_Criticality_reject,
- "ie->criticality != F1AP_Criticality_reject\n");
+ "ie->criticality != F1AP_Criticality_reject\n");
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_TransactionID,
- "ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n");
+ "ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n");
TransactionId=ie->value.choice.TransactionID;
LOG_D(F1AP, "F1AP: F1Setup-Resp: TransactionId %d\n",
TransactionId);
break;
+
case F1AP_ProtocolIE_ID_id_gNB_CU_Name:
AssertFatal(ie->criticality == F1AP_Criticality_ignore,
- "ie->criticality != F1AP_Criticality_ignore\n");
+ "ie->criticality != F1AP_Criticality_ignore\n");
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name,
- "ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n");
+ "ie->value.present != F1AP_F1SetupResponseIEs__value_PR_TransactionID\n");
F1AP_SETUP_RESP (msg_p).gNB_CU_name = malloc(ie->value.choice.GNB_CU_Name.size+1);
memcpy(F1AP_SETUP_RESP (msg_p).gNB_CU_name,ie->value.choice.GNB_CU_Name.buf,ie->value.choice.GNB_CU_Name.size);
F1AP_SETUP_RESP (msg_p).gNB_CU_name[ie->value.choice.GNB_CU_Name.size]='\0';
LOG_D(F1AP, "F1AP: F1Setup-Resp: gNB_CU_name %s\n",
F1AP_SETUP_RESP (msg_p).gNB_CU_name);
break;
+
case F1AP_ProtocolIE_ID_id_GNB_CU_RRC_Version:
LOG_D(F1AP, "F1AP: Received GNB-CU-RRC-Version, ignoring\n");
break;
- case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List:
- {
+
+ case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List: {
AssertFatal(ie->criticality == F1AP_Criticality_reject,
- "ie->criticality != F1AP_Criticality_reject\n");
+ "ie->criticality != F1AP_Criticality_reject\n");
AssertFatal(ie->value.present == F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List,
- "ie->value.present != F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List\n");
+ "ie->value.present != F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List\n");
num_cells_to_activate = ie->value.choice.Cells_to_be_Activated_List.list.count;
LOG_D(F1AP, "F1AP: Activating %d cells\n",num_cells_to_activate);
- for (int i=0;ivalue.choice.Cells_to_be_Activated_List.list.array[i];
-
AssertFatal(cells_to_be_activated_list_item_ies->id == F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item,
- "cells_to_be_activated_list_item_ies->id != F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item");
+ "cells_to_be_activated_list_item_ies->id != F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item");
AssertFatal(cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject,
- "cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject");
+ "cells_to_be_activated_list_item_ies->criticality == F1AP_Criticality_reject");
AssertFatal(cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item,
- "cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item");
-
+ "cells_to_be_activated_list_item_ies->value.present == F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item");
cell = &cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item;
-
- TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mcc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc_digit_length);
-
+ TBCD_TO_MCC_MNC(&cell->nRCGI.pLMN_Identity, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mcc, F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc,
+ F1AP_SETUP_RESP (msg_p).cells_to_activate[i].mnc_digit_length);
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
cell->nRCGI.nRCellIdentity.buf[0],
cell->nRCGI.nRCellIdentity.buf[1],
cell->nRCGI.nRCellIdentity.buf[2],
cell->nRCGI.nRCellIdentity.buf[3],
cell->nRCGI.nRCellIdentity.buf[4]);
-
BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity,
- F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nr_cellid);
+ F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nr_cellid);
F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions;
- if (ext==NULL) continue;
+ if (ext==NULL)
+ continue;
- for (int cnt=0;cnt