Compare commits

..

8 Commits

Author SHA1 Message Date
Raymond Knopp
d20cd64159 patches for FR2 2024-02-29 20:09:14 +01:00
Raymond Knopp
1354d9ad68 Merge remote-tracking branch 'origin/develop' into fr2_testing 2024-03-01 22:33:50 +01:00
Raymond Knopp
0533d34c0e Merge remote-tracking branch 'origin/develop' into fr2_testing 2024-02-14 14:41:50 +01:00
Raymond Knopp
39c555e937 changes in radio/fhi_72 for FR2 support. Mostly related to frame
parameters and numerologies which were hard-coded for 100 MHz FR1 30kHz
2024-01-28 18:04:45 +01:00
Raymond Knopp
796061903e Merge remote-tracking branch 'origin/fix_computing_ssb_subcarrier_offset' into fr2_testing 2024-01-26 19:10:48 +01:00
Raymond Knopp
c5909cf64c this limits PUCCH payload to 11 bits, 7 CSI + 3 ACKNACK + 1 SR maximum. 2024-01-24 22:06:12 +01:00
francescomani
89769ad94e adding assertion for cset0 start prb 2024-01-22 16:35:11 +01:00
francescomani
02cdc17989 fix for computing ssb subcarrier offset 2024-01-22 16:35:11 +01:00
416 changed files with 8309 additions and 19672 deletions

View File

@@ -726,6 +726,7 @@ set(SCHED_SRC_NR_UE
add_library(SCHED_NR_UE_LIB ${SCHED_SRC_NR_UE})
target_link_libraries(SCHED_NR_UE_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
# nFAPI
#################################
set(NFAPI_COMMON_SRC
@@ -1435,7 +1436,8 @@ target_link_libraries(L2 PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
if(E2_AGENT)
target_link_libraries(L2 PUBLIC e2_agent e2_agent_arg e2_ran_func_du_cucp_cuup)
target_compile_definitions(L2 PRIVATE ${E2AP_VERSION} ${KPM_VERSION} E2_AGENT)
target_compile_definitions(L2 PRIVATE E2_AGENT)
target_compile_definitions(L2 PRIVATE ${E2AP_VERSION} ${KPM_VERSION})
endif()
@@ -1458,10 +1460,11 @@ add_library(e1_if
target_link_libraries(e1_if PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs asn1_f1ap SECURITY ${OPENSSL_LIBRARIES} e1ap GTPV1U)
target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap ngap nr_rrc e1ap nr_rlc xnap)
target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap ngap nr_rrc e1ap nr_rlc)
if(E2_AGENT)
target_link_libraries(L2_NR PUBLIC e2_agent e2_agent_arg e2_ran_func_du_cucp_cuup)
target_compile_definitions(L2_NR PRIVATE ${E2AP_VERSION} ${KPM_VERSION} E2_AGENT)
target_compile_definitions(L2_NR PRIVATE ${E2AP_VERSION} ${KPM_VERSION})
target_compile_definitions(L2_NR PRIVATE E2_AGENT)
endif()
add_library(L2_LTE_NR
@@ -1980,7 +1983,8 @@ target_link_libraries(lte-softmodem PRIVATE ${T_LIB})
target_link_libraries(lte-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
if(E2_AGENT)
target_compile_definitions(lte-softmodem PRIVATE ${E2AP_VERSION} ${KPM_VERSION} E2_AGENT)
target_compile_definitions(lte-softmodem PRIVATE E2_AGENT)
target_compile_definitions(lte-softmodem PRIVATE ${E2AP_VERSION} ${KPM_VERSION})
endif()
add_executable(oairu
@@ -2065,8 +2069,6 @@ add_executable(nr-softmodem
${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c
)
include(${OPENAIR_DIR}/nfapi/CMakeLists.txt)
target_link_libraries(nr-softmodem PRIVATE
-Wl,--start-group
UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECURITY
@@ -2080,7 +2082,7 @@ target_link_libraries(nr-softmodem PRIVATE ${T_LIB})
target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
if(E2_AGENT)
target_compile_definitions(nr-softmodem PRIVATE ${E2AP_VERSION} ${KPM_VERSION} E2_AGENT)
target_compile_definitions(nr-softmodem PRIVATE ${E2AP_VERSION} ${KPM_VERSION})
endif()
@@ -2093,6 +2095,10 @@ endif()
# force the generation of ASN.1 so that we don't need to wait during the build
target_link_libraries(nr-softmodem PRIVATE
asn1_lte_rrc asn1_nr_rrc asn1_s1ap asn1_ngap asn1_m2ap asn1_m3ap asn1_x2ap asn1_f1ap asn1_lpp)
if(E2_AGENT)
target_compile_definitions(nr-softmodem PRIVATE E2_AGENT)
endif()
add_executable(nr-cuup
executables/nr-cuup.c

View File

@@ -562,29 +562,6 @@ pipeline {
}
}
}
stage ("SA-AERIAL-CN5G") {
when { expression {do5Gtest} }
steps {
script {
triggerSlaveJob ('RAN-SA-AERIAL-CN5G', 'SA-AERIAL-CN5G')
}
}
post {
always {
script {
// Using a unique variable name for each test stage to avoid overwriting on a global variable
// due to parallel-time concurrency
saAERIALStatus = finalizeSlaveJob('RAN-SA-AERIAL-CN5G')
}
}
failure {
script {
currentBuild.result = 'FAILURE'
failingStages += saAERIALStatus
}
}
}
}
stage ("SA-OAIUE-CN5G") {
when { expression {do5Gtest} }
steps {

View File

@@ -74,9 +74,8 @@ then
IS_NFAPI=`echo $FILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true`
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FILE || true`
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FILE || true`
IS_MIT_LICENCE_PRESENT=`egrep -c "MIT License" $FILE || true`
IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc.h|openair1/PHY/CODING/crcext.h|openair1/PHY/CODING/types.h|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_offload.h" || true`
if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] && [ $IS_MIT_LICENCE_PRESENT -eq 0 ]
if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ]
then
if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ]
then
@@ -185,9 +184,8 @@ do
IS_NFAPI=`echo $FULLFILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true`
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FULLFILE || true`
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FULLFILE || true`
IS_MIT_LICENCE_PRESENT=`egrep -c "MIT License" $FULLFILE || true`
IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc.h|openair1/PHY/CODING/crcext.h|openair1/PHY/CODING/types.h|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_offload.h" || true`
if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] && [ $IS_MIT_LICENCE_PRESENT -eq 0 ]
if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ]
then
if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ]
then

View File

@@ -18,17 +18,6 @@ up2:
IF: wwan0
MTU: 1500
sphex_quectel:
Host: sphex
InitScript: sudo stdbuf -oL /home/oaicicd/quectel-CM/quectel-CM -4 -s oai.ipv4 &> /tmp/quecel-cm.log &
TermScript: sudo -S killall --signal SIGKILL quectel-CM
AttachScript: sudo python3 ci_ctl_qtel.py /dev/ttyUSB3 wup
DetachScript: sudo python3 ci_ctl_qtel.py /dev/ttyUSB3 detach
NetworkScript: ip a show dev wwan0
IF: wwan0
MTU: 1500
LogStore: /media/ci_qlogs
adb_ue_1:
Host: nano
InitScript: /home/oaicicd/ci_ctl_adb.sh initialize R3CM40LZPHT
@@ -130,48 +119,6 @@ amarisoft_ue_10:
NetworkScript: ip netns exec ue10 ip a show dev pdn0
CmdPrefix: ip netns exec ue10
MTU: 1500
amarisoft_ue_11:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":11}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":11}'
NetworkScript: ip netns exec ue11 ip a show dev pdn0
CmdPrefix: ip netns exec ue11
MTU: 1500
amarisoft_ue_12:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":12}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":12}'
NetworkScript: ip netns exec ue12 ip a show dev pdn0
CmdPrefix: ip netns exec ue12
MTU: 1500
amarisoft_ue_13:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":13}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":13}'
NetworkScript: ip netns exec ue13 ip a show dev pdn0
CmdPrefix: ip netns exec ue13
MTU: 1500
amarisoft_ue_14:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":14}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":14}'
NetworkScript: ip netns exec ue14 ip a show dev pdn0
CmdPrefix: ip netns exec ue14
MTU: 1500
amarisoft_ue_15:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":15}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":15}'
NetworkScript: ip netns exec ue15 ip a show dev pdn0
CmdPrefix: ip netns exec ue15
MTU: 1500
amarisoft_ue_16:
Host: amariue
AttachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_on","ue_id":16}'
DetachScript: /root/2023-10-27/libs/ws.js 127.0.0.1:9002 '{"message":"power_off","ue_id":16}'
NetworkScript: ip netns exec ue16 ip a show dev pdn0
CmdPrefix: ip netns exec ue16
MTU: 1500
oai_ue_caracal:
Host: caracal

View File

@@ -86,12 +86,6 @@ class Cmd(metaclass=abc.ABCMeta):
return
class LocalCmd(Cmd):
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, exc_traceback):
self.close()
def __init__(self, d = None):
self.cwd = d
if self.cwd is not None:
@@ -128,40 +122,12 @@ class LocalCmd(Cmd):
if src[0] != '/' or tgt[0] != '/':
raise Exception('support only absolute file paths!')
opt = '-r' if recursive else ''
return self.run(f'cp {opt} {src} {tgt}').returncode == 0
self.run(f'cp {opt} {src} {tgt}')
def copyout(self, src, tgt, recursive=False):
return self.copyin(src, tgt, recursive)
def PutFile(client, src, tgt):
success = True
sftp = client.open_sftp()
try:
sftp.put(src, tgt)
except FileNotFoundError as error:
logging.error(f"error while putting {src}: {error}")
success = False
sftp.close()
return success
def GetFile(client, src, tgt):
success = True
sftp = client.open_sftp()
try:
sftp.get(src, tgt)
except FileNotFoundError as error:
logging.error(f"error while getting {src}: {error}")
success = False
sftp.close()
return success
self.copyin(src, tgt, recursive)
class RemoteCmd(Cmd):
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, exc_traceback):
self.close()
def __init__(self, hostname, d=None):
cIdx = 0
logging.getLogger('paramiko').setLevel(logging.ERROR) # prevent spamming through Paramiko
@@ -227,38 +193,36 @@ class RemoteCmd(Cmd):
def getBefore(self):
return self.cp.stdout
# if recursive is True, tgt must be a directory (and src is file or directory)
# if recursive is False, tgt and src must be a file name
def copyout(self, src, tgt, recursive=False):
logging.debug(f"copyout: local:{src} -> remote:{tgt}")
if recursive:
tmpfile = f"{uuid.uuid4()}.tar"
abstmpfile = f"/tmp/{tmpfile}"
with LocalCmd() as cmd:
if cmd.run(f"tar -cf {abstmpfile} {src}").returncode != 0:
return False
if not PutFile(self.client, abstmpfile, abstmpfile):
return False
cmd.run(f"rm {abstmpfile}")
ret = self.run(f"mv {abstmpfile} {tgt}; cd {tgt} && tar -xf {tmpfile} && rm {tmpfile}")
return ret.returncode == 0
cmd = LocalCmd()
cmd.run(f"tar -cf {abstmpfile} {src}")
sftp = self.client.open_sftp()
sftp.put(abstmpfile, abstmpfile)
sftp.close()
cmd.run(f"rm {abstmpfile}")
self.run(f"mv {abstmpfile} {tgt}; cd {tgt} && tar -xf {tmpfile} && rm {tmpfile}")
else:
return PutFile(self.client, src, tgt)
sftp = self.client.open_sftp()
sftp.put(src, tgt)
sftp.close()
# if recursive is True, tgt must be a directory (and src is file or directory)
# if recursive is False, tgt and src must be a file name
def copyin(self, src, tgt, recursive=False):
logging.debug(f"copyin: remote:{src} -> local:{tgt}")
if recursive:
tmpfile = f"{uuid.uuid4()}.tar"
abstmpfile = f"/tmp/{tmpfile}"
if self.run(f"tar -cf {abstmpfile} {src}").returncode != 0:
return False
if not GetFile(self.client, abstmpfile, abstmpfile):
return False
self.run(f"tar -cf {abstmpfile} {src}")
sftp = self.client.open_sftp()
sftp.get(abstmpfile, abstmpfile)
sftp.close()
self.run(f"rm {abstmpfile}")
with LocalCmd() as cmd:
ret = cmd.run(f"mv {abstmpfile} {tgt}; cd {tgt} && tar -xf {tmpfile} && rm {tmpfile}")
return ret.returncode == 0
cmd = LocalCmd()
cmd.run(f"mv {abstmpfile} {tgt}; cd {tgt} && tar -xf {tmpfile} && rm {tmpfile}")
else:
return GetFile(self.client, src, tgt)
sftp = self.client.open_sftp()
sftp.get(src, tgt)
sftp.close()

View File

@@ -58,7 +58,7 @@ import cls_oaicitest
# Helper functions used here and in other classes
# (e.g., cls_cluster.py)
#-----------------------------------------------------------
IMAGES = ['oai-enb', 'oai-lte-ru', 'oai-lte-ue', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s', 'oai-nr-ue', 'oai-gnb-asan', 'oai-nr-ue-asan', 'oai-nr-cuup-asan', 'oai-gnb-aerial']
IMAGES = ['oai-enb', 'oai-lte-ru', 'oai-lte-ue', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s', 'oai-nr-ue', 'oai-gnb-asan', 'oai-nr-ue-asan', 'oai-nr-cuup-asan']
def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTargetBranch, ranAllowMerge):
if ranCommitID == '':
@@ -383,7 +383,6 @@ class Containerize():
imageNames.append(('oai-physim', 'phySim', 'oai-physim', ''))
if self.host == 'Ubuntu':
imageNames.append(('oai-lte-ru', 'lteRU', 'oai-lte-ru', ''))
imageNames.append(('oai-gnb-aerial', 'gNB.aerial', 'oai-gnb-aerial', ''))
# Building again the 5G images with Address Sanitizer
imageNames.append(('ran-build', 'build', 'ran-build-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
imageNames.append(('oai-gnb', 'gNB', 'oai-gnb-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
@@ -481,11 +480,7 @@ class Containerize():
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build-asan:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
elif image != 'ran-build':
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
if image == 'oai-gnb-aerial':
cmd.run('cp -f /opt/nvidia-ipc/nvipc_src.2023.11.28.tar.gz .')
ret = cmd.run(f'{self.cli} build {self.cliBuildOptions} --target {image} --tag {name}:{imageTag} --file docker/Dockerfile.{pattern}{self.dockerfileprefix} {option} . > cmake_targets/log/{name}.log 2>&1', timeout=1200)
if image == 'oai-gnb-aerial':
cmd.run('rm -f nvipc_src.2023.11.28.tar.gz')
if image == 'ran-build' and ret.returncode == 0:
cmd.run(f"docker run --name test-log -d {name}:{imageTag} /bin/true")
cmd.run(f"docker cp test-log:/oai-ran/cmake_targets/log/ cmake_targets/log/{name}/")
@@ -517,13 +512,9 @@ class Containerize():
# Remove all intermediate build images and clean up
cmd.run(f"{self.cli} image rm ran-build:{imageTag} ran-build-asan:{imageTag}")
cmd.run(f"{self.cli} volume prune --force")
# Remove some cached artifacts to prevent out of diskspace problem
logging.debug(cmd.run("df -h").stdout)
logging.debug(cmd.run("docker system df").stdout)
cmd.run(f"{self.cli} buildx prune --filter until=1h --force")
logging.debug(cmd.run("df -h").stdout)
logging.debug(cmd.run("docker system df").stdout)
# Remove any cached artifacts: we don't use the cache for now, prevent
# out of diskspace problem
cmd.run(f"{self.cli} buildx prune --filter=until=6h --force")
# create a zip with all logs
build_log_name = f'build_log_{self.testCase_id}'
@@ -671,26 +662,22 @@ class Containerize():
collectInfo['proxy'] = files
mySSH.command('docker image inspect --format=\'Size = {{.Size}} bytes\' proxy:' + tag, '\$', 5)
result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', mySSH.getBefore())
# Cleaning any created tmp volume
mySSH.command(self.cli + ' volume prune --force || true','\$', 15)
mySSH.close()
allImagesSize = {}
if result is not None:
imageSize = float(result.group('size')) / 1000000
logging.debug('\u001B[1m proxy size is ' + ('%.0f' % imageSize) + ' Mbytes\u001B[0m')
allImagesSize['proxy'] = str(round(imageSize,1)) + ' Mbytes'
logging.info('\u001B[1m Building L2sim Proxy Image Pass\u001B[0m')
HTML.CreateHtmlTestRow('commit ' + tag, 'OK', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlNextTabHeaderTestRow(collectInfo, allImagesSize)
return True
else:
logging.error('proxy size is unknown')
logging.debug('proxy size is unknown')
allImagesSize['proxy'] = 'unknown'
logging.error('\u001B[1m Build of L2sim proxy failed\u001B[0m')
HTML.CreateHtmlTestRow('commit ' + tag, 'KO', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlTabFooter(False)
return False
# Cleaning any created tmp volume
mySSH.command(self.cli + ' volume prune --force || true','\$', 15)
mySSH.close()
logging.info('\u001B[1m Building L2sim Proxy Image Pass\u001B[0m')
HTML.CreateHtmlTestRow('commit ' + tag, 'OK', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlNextTabHeaderTestRow(collectInfo, allImagesSize)
def BuildRunTests(self, HTML):
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
@@ -964,12 +951,12 @@ class Containerize():
if svcName == '':
logging.warning('no service name given: starting all services in ci-docker-compose.yml!')
mySSH.command(f'docker compose --file ci-docker-compose.yml up -d -- {svcName}', '\$', 30)
mySSH.command(f'docker-compose --file ci-docker-compose.yml up -d -- {svcName}', '\$', 30)
# Checking Status
grep = ''
if svcName != '': grep = f' | grep -A3 --color=never {svcName}'
mySSH.command(f'docker compose --file ci-docker-compose.yml config {grep}', '\$', 5)
if svcName != '': grep = f' | grep -A3 {svcName}'
mySSH.command(f'docker-compose --file ci-docker-compose.yml config {grep}', '\$', 5)
result = re.search('container_name: (?P<container_name>[a-zA-Z0-9\-\_]+)', mySSH.getBefore())
unhealthyNb = 0
healthyNb = 0
@@ -1017,8 +1004,8 @@ class Containerize():
if healthyNb == 1:
cnt = 0
while (cnt < 20):
mySSH.command('docker logs ' + containerName + ' | egrep --text --color=never -i "wait|sync|Starting|ready"', '\$', 30)
result = re.search('got sync|Starting E1AP at CU UP|Starting F1AP at CU|Got sync|Waiting for RUs to be configured|cuPHYController initialized|Received CONFIG.response, gNB is ready', mySSH.getBefore())
mySSH.command('docker logs ' + containerName + ' | egrep --text --color=never -i "wait|sync|Starting"', '\$', 30)
result = re.search('got sync|Starting E1AP at CU UP|Starting F1AP at CU|Got sync|Waiting for RUs to be configured', mySSH.getBefore())
if result is None:
time.sleep(6)
cnt += 1
@@ -1071,80 +1058,78 @@ class Containerize():
if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '':
HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter')
logging.debug(f'\u001B[1m Undeploying OAI Object from server: {lIpAddr}\u001B[0m')
mySSH = cls_cmd.getConnection(lIpAddr)
yamlDir = f'{lSourcePath}/{self.yamlPath[self.eNB_instance]}'
mySSH.run(f'cd {yamlDir}')
logging.debug('\u001B[1m Undeploying OAI Object from server: ' + lIpAddr + '\u001B[0m')
mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('cd ' + lSourcePath + '/' + self.yamlPath[self.eNB_instance], '\$', 5)
svcName = self.services[self.eNB_instance]
forceDown = False
if svcName != '':
logging.warning(f'service name given, but will stop all services in ci-docker-compose.yml!')
svcName = ''
ret = mySSH.run(f'docker compose -f {yamlDir}/ci-docker-compose.yml config --services')
if ret.returncode != 0:
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', "cannot enumerate running services")
self.exitStatus = 1
return
mySSH.command(f'docker-compose -f ci-docker-compose.yml config --services', '\$', 5)
# first line has command, last line has next command prompt
allServices = ret.stdout.splitlines()
allServices = mySSH.getBefore().split('\r\n')[1:-1]
services = []
for s in allServices:
# outputs the hash if the container is running
ret = mySSH.run(f'docker compose -f {yamlDir}/ci-docker-compose.yml ps --all --quiet -- {s}')
running = ret.stdout.splitlines()
mySSH.command(f'docker-compose -f ci-docker-compose.yml ps --all -- {s}', '\$', 5, silent=False)
running = mySSH.getBefore().split('\r\n')[2:-1]
logging.debug(f'running services: {running}')
if ret.stdout != "" and ret.returncode == 0: # something is running for that service
if len(running) > 0: # something is running for that service
services.append(s)
logging.info(f'stopping services {services}')
mySSH.run(f'docker compose -f {yamlDir}/ci-docker-compose.yml stop -t3')
copyin_res = True
mySSH.command(f'docker-compose -f ci-docker-compose.yml stop -t3', '\$', 30)
time.sleep(5) # give some time to running containers to stop
for svcName in services:
# head -n -1 suppresses the final "X exited with status code Y"
filename = f'{svcName}-{HTML.testCase_id}.log'
mySSH.run(f'docker compose -f {yamlDir}/ci-docker-compose.yml logs --no-log-prefix -- {svcName} &> {lSourcePath}/cmake_targets/log/{filename}')
copyin_res = mySSH.copyin(f'{lSourcePath}/cmake_targets/log/{filename}', f'{filename}') and copyin_res
mySSH.command(f'docker-compose -f ci-docker-compose.yml logs --no-log-prefix -- {svcName} &> {lSourcePath}/cmake_targets/log/{filename}', '\$', 120)
mySSH.run(f'docker compose -f {yamlDir}/ci-docker-compose.yml down -v')
mySSH.command('docker-compose -f ci-docker-compose.yml down -v', '\$', 5)
mySSH.close()
# Analyzing log file!
if not copyin_res:
HTML.htmleNBFailureMsg='Could not copy logfile(s) to analyze it!'
files = ','.join([f'{s}-{HTML.testCase_id}' for s in services])
if len(services) > 1:
files = '{' + files + '}'
copyin_res = 0
if len(services) > 0:
copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, f'{lSourcePath}/cmake_targets/log/{files}.log', '.')
if copyin_res == -1:
HTML.htmleNBFailureMsg='Could not copy logfile to analyze it!'
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE)
self.exitStatus = 1
# use function for UE log analysis, when oai-nr-ue container is used
elif 'oai-nr-ue' in services or 'lte_ue0' in services:
self.exitStatus == 0
logging.debug(f'Analyzing UE logfile {filename}')
logging.debug('\u001B[1m Analyzing UE logfile ' + filename + ' \u001B[0m')
logStatus = cls_oaicitest.OaiCiTest().AnalyzeLogFile_UE(f'{filename}', HTML, RAN)
if (logStatus < 0):
fullStatus = False
HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus)
self.exitStatus = 1
else:
HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK)
else:
for svcName in services:
if svcName == 'nv-cubb':
msg = 'Undeploy PNF/Nvidia CUBB'
HTML.CreateHtmlTestRow(msg, 'OK', CONST.ALL_PROCESSES_OK)
filename = f'{svcName}-{HTML.testCase_id}.log'
logging.debug(f'\u001B[1m Analyzing logfile {filename}\u001B[0m')
logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML, self.ran_checkers)
if (logStatus < 0):
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus)
self.exitStatus = 1
else:
filename = f'{svcName}-{HTML.testCase_id}.log'
logging.debug(f'\u001B[1m Analyzing logfile {filename}\u001B[0m')
logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML, self.ran_checkers)
if (logStatus < 0):
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus)
self.exitStatus = 1
else:
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK)
# all the xNB run logs shall be on the server 0 for logCollecting
if self.eNB_serverId[self.eNB_instance] != '0':
mySSH.copyout(f'./*.log', f'{lSourcePath}/cmake_targets/', recursive=True)
mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, f'./{files}.log', f'{self.eNBSourceCodePath}/cmake_targets/')
if self.exitStatus == 0:
logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m')
else:
logging.error('\u001B[1m Undeploying OAI Object Failed\u001B[0m')
mySSH.close()
def DeployGenObject(self, HTML, RAN, UE):
self.exitStatus = 0
@@ -1395,7 +1380,6 @@ class Containerize():
logStatus = UE.AnalyzeLogFile_UE(f'{logPath}/{filename}', HTML, RAN)
if (logStatus < 0):
fullStatus = False
self.exitStatus = 1
HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus)
else:
HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK)

View File

@@ -171,6 +171,7 @@ MACRLCs = (
remote_n_portd = 2153;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 1;
}
);

View File

@@ -178,6 +178,7 @@ MACRLCs = (
remote_n_portd = 2153;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 1;
}
);

View File

@@ -1,262 +0,0 @@
Active_gNBs = ( "gNB-OAI");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
sa = 1;
nfapi = "AERIAL";
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 = 97;
mnc_length = 2;
snssaiList = (
{
sst = 1;
}
);
});
nr_cellid = 12345678L;
////////// Physical parameters:
pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2;
do_CSIRS = 1;
do_SRS = 0;
min_rxtxtime = 2;
pdcch_ConfigSIB1 = (
{
controlResourceSetZero = 12;
searchSpaceZero = 0;
}
);
servingCellConfigCommon = (
{
#spCellConfigCommon
physCellId = 0;
# downlinkConfigCommon
#frequencyInfoDL
# this is 3300.24 + 134*12*30e3 = 3348.48 MHz (5G NR GSCN: 7741)
absoluteFrequencySSB = 649920;
#652860; #should be 649920
#647520;
#647540;
#649920;
#650208;
#647540;
dl_frequencyBand = 78;
# this is 3300.24 MHz
dl_absoluteFrequencyPointA = 646724;
#649104;
#646724;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
dl_subcarrierSpacing = 1;
dl_carrierBandwidth = 273;
#initialDownlinkBWP
#genericParameters
# this is RBstart=0,L=162 (275*(275-L+1))+(274-RBstart))
initialDLBWPlocationAndBandwidth = 1099;
#
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
#pdcch-ConfigCommon
initialDLBWPcontrolResourceSetZero = 12;
initialDLBWPsearchSpaceZero = 0;
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 78;
#scs-SpecificCarrierList
ul_offstToCarrier = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
ul_subcarrierSpacing = 1;
ul_carrierBandwidth = 273;
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 1099;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
#rach-ConfigCommon
#rach-ConfigGeneric
prach_ConfigurationIndex = 159;# testMAC 158; OAI gNB 98
#prach_msg1_FDM
#0 = one, 1=two, 2=four, 3=eight
prach_msg1_FDM = 0;
prach_msg1_FrequencyStart = 0;
zeroCorrelationZoneConfig = 12;
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 = 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 = 3;
#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,
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 = 5; #6;
nrofDownlinkSlots = 3; #7;
nrofDownlinkSymbols = 6;
nrofUplinkSlots = 1; #2;
nrofUplinkSymbols = 0;
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.71.132";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
GNB_INTERFACE_NAME_FOR_NG_AMF = "eno1";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.131";
GNB_INTERFACE_NAME_FOR_NGU = "eno";
GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.131";
GNB_PORT_FOR_S1U = 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 = 50001; // vnf p5 port
remote_s_portc = 50000; // pnf p5 port [!]
local_s_portd = 50011; // vnf p7 port [!]
remote_s_portd = 50010; // pnf p7 port [!]
tr_s_preference = "aerial";
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200; # 150;
pucch_TargetSNRx10 = 200; #200;
ulsch_max_frame_inactivity = 10;
dl_max_mcs = 28;
ul_max_mcs = 28;
}
);
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";
hw_log_level ="info";
phy_log_level ="info";
mac_log_level ="info";
rlc_log_level ="info";
pdcp_log_level ="info";
rrc_log_level ="info";
ngap_log_level ="debug";
f1ap_log_level ="debug";
};

View File

@@ -1,42 +1,41 @@
Active_gNBs = ( "gNB-OAI");
Active_gNBs = ( "gNB-Eurecom-5GNRBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
sa = 1;
gNBs =
(
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_name = "gNB-OAI";
cell_type = "CELL_MACRO_GNB";
gNB_name = "gNB-Eurecom-5GNRBox";
// 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; }) });
nr_cellid = 12345678L;
plmn_list = ({mcc = 208; mnc = 99; mnc_length = 2;});
tr_s_preference = "local_mac"
////////// Physical parameters:
sib1_tda = 15;
min_rxtxtime = 6;
servingCellConfigCommon = (
{
#spCellConfigCommon
physCellId = 10;
physCellId = 0;
# downlinkConfigCommon
#frequencyInfoDL
# this is pointA + 16 PRBs@120kHz SCS (same as initial BWP)
absoluteFrequencySSB = 2071387;
# this is pointA + 23 PRBs@120kHz SCS (same as initial BWP)
absoluteFrequencySSB = 2071241;
dl_frequencyBand = 261;
# this is 27.900 GHz
dl_absoluteFrequencyPointA = 2071001;
dl_absoluteFrequencyPointA = 2070833;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
@@ -51,7 +50,7 @@ gNBs =
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 3;
#pdcch-ConfigCommon
initialDLBWPcontrolResourceSetZero = 1;
initialDLBWPcontrolResourceSetZero = 12;
initialDLBWPsearchSpaceZero = 0;
#uplinkConfigCommon
@@ -86,12 +85,12 @@ gNBs =
powerRampingStep = 1;
#ra_ReponseWindow
#1,2,4,8,10,20,40,80
ra_ResponseWindow = 5;
ra_ResponseWindow = 7;
#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 = 3;
#0=oneeighth,1=onefourth,2=half,3=one,4=two,5=four,6=eight,7=sixteen
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
#oneHalf (0..15) 4,8,12,16,...60,64
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 7;
#ra_ContentionResolutionTimer
#(0..7) 8,16,24,32,40,48,56,64
ra_ContentionResolutionTimer = 7;
@@ -102,7 +101,8 @@ gNBs =
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 = 3;
msg1_SubcarrierSpacing = 3,
# restrictedSetConfig
# 0=unrestricted, 1=restricted type A, 2=restricted type B
restrictedSetConfig = 0,
@@ -119,7 +119,7 @@ gNBs =
# ssb_PositionsInBurs_BitmapPR
# 1=short, 2=medium, 3=long
ssb_PositionsInBurst_PR = 3;
ssb_PositionsInBurst_Bitmap = 1;
ssb_PositionsInBurst_Bitmap = 0x0001000100010001L;
# ssb_periodicityServingCell
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
@@ -152,6 +152,7 @@ gNBs =
);
# ------- SCTP definitions
SCTP :
{
@@ -161,58 +162,91 @@ gNBs =
};
////////// AMF parameters:
amf_ip_address = ( { ipv4 = "192.168.71.132";
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.18.99";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
///X2
enable_x2 = "no";
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 = "192.168.18.199";
ipv6 = "192:168:30::17";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
GNB_INTERFACE_NAME_FOR_NG_AMF = "eth0";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.71.140/24";
GNB_INTERFACE_NAME_FOR_NGU = "eth0";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.71.140/24";
GNB_INTERFACE_NAME_FOR_S1_MME = "eth0";
GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.18.198/24";
GNB_INTERFACE_NAME_FOR_S1U = "eth0";
GNB_IPV4_ADDRESS_FOR_S1U = "192.168.18.198/24";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
GNB_IPV4_ADDRESS_FOR_X2C = "192.168.18.198/24";
GNB_PORT_FOR_X2C = 36422; # Spec 36422
};
}
);
MACRLCs = ({
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
});
MACRLCs = (
{
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
}
);
L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
prach_dtx_threshold = 120;
#pucch0_dtx_threshold = 120;
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;
sl_ahead = 12;
bands = [261];
max_pdschReferenceSignalPower = -27;
eNB_instances = [0];
});
RUs = (
{
local_rf = "yes"
nb_tx = 1;
nb_rx = 1;
att_tx = 0;
att_rx = 0;
bands = [7];
sl_ahead = 12;
max_pdschReferenceSignalPower = -27;
max_rxgain = 75;
eNB_instances = [0];
sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2";
if_freq = 5124520000L;
clock_src = "external";
time_src = "external";
}
);
rfsimulator: {
serveraddr = "server";
};
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";
}
);
security = {
# preferred ciphering algorithms
# the first one of the list that an UE supports in chosen
@@ -230,6 +264,14 @@ security = {
drb_integrity = "no";
};
log_config: {
global_log_level ="info";
};
log_config :
{
global_log_level ="info";
hw_log_level ="info";
phy_log_level ="info";
mac_log_level ="info";
rlc_log_level ="info";
pdcp_log_level ="info";
rrc_log_level ="info";
};

View File

@@ -200,6 +200,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 0;
}
);

View File

@@ -202,6 +202,7 @@ MACRLCs = (
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
ulsch_max_frame_inactivity = 0;
}
);

View File

@@ -187,6 +187,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 150;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 0;
}
);

View File

@@ -197,6 +197,8 @@ MACRLCs = (
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 180;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 1;
ul_max_mcs = 16;
}
);

View File

@@ -188,6 +188,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
#pusch_TargetSNRx10 = 150;
#pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 0;
dl_max_mcs = 16; # there are retransmissions if more
}
);

View File

@@ -190,6 +190,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 220;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 0;
}
);

View File

@@ -184,6 +184,7 @@ MACRLCs = (
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
ul_prbblack_SNR_threshold = 10;
ulsch_max_frame_inactivity = 10;
ul_max_mcs = 9;
}
);

View File

@@ -203,6 +203,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 220;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 0;
}
);

View File

@@ -204,6 +204,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
# pusch_TargetSNRx10 = 200;
# pucch_TargetSNRx10 = 150;
ulsch_max_frame_inactivity = 0;
}
);

View File

@@ -186,6 +186,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 150;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 1;
}
);

View File

@@ -192,6 +192,8 @@ MACRLCs = (
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 10;
ul_max_mcs = 28;
}
);

View File

@@ -184,6 +184,7 @@ MACRLCs = (
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
ul_prbblack_SNR_threshold = 10;
ulsch_max_frame_inactivity = 0;
}
);

View File

@@ -208,6 +208,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 1;
}
);

View File

@@ -199,6 +199,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 0;
}
);

View File

@@ -186,6 +186,7 @@ MACRLCs = (
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
ul_prbblack_SNR_threshold = 10;
ulsch_max_frame_inactivity = 0;
}
);

View File

@@ -12,8 +12,8 @@ Ref :
feptx_ofdm : 65.0
feptx_total : 177.0
L1 Tx processing : 700.0
DLSCH encoding : 226.0
L1 Rx processing : 640.0
DLSCH encoding : 179.0
L1 Rx processing : 526.0
PUSCH inner-receiver : 400.0
Schedule Response : 3.0
DL & UL scheduling timing : 15.0

View File

@@ -11,10 +11,10 @@ Ref :
feptx_prec : 15.0
feptx_ofdm : 35.0
feptx_total : 57.0
L1 Tx processing : 260.0
DLSCH encoding : 160.0
L1 Rx processing : 420.0
PUSCH inner-receiver : 170.0
L1 Tx processing : 210.0
DLSCH encoding : 137.0
L1 Rx processing : 345.0
PUSCH inner-receiver : 210.0
Schedule Response : 3.0
DL & UL scheduling timing : 8.0
UL Indication : 3.0

View File

@@ -11,9 +11,9 @@ Ref :
feptx_prec : 13.0
feptx_ofdm : 33.0
feptx_total : 55.0
L1 Tx processing : 220.0
DLSCH encoding : 130.0
L1 Rx processing : 387.0
L1 Tx processing : 170.0
DLSCH encoding : 118.0
L1 Rx processing : 305.0
PUSCH inner-receiver : 150.0
Schedule Response : 3.0
DL & UL scheduling timing : 6.0

View File

@@ -262,12 +262,10 @@ class EPCManagement():
logging.debug('Starting OAI CN5G')
mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5)
mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5)
mySSH.command(f'cd {self.SourceCodePath}/docker-compose', '\$', 5)
mySSH.command('cd /opt/oai-cn5g-fed-v1.5/docker-compose', '\$', 5)
mySSH.command('python3 ./core-network.py '+self.cfgDeploy, '\$', 60)
if re.search('start-mini-as-ue', self.cfgDeploy):
dFile = 'docker-compose-mini-nrf-asue.yaml'
elif re.search('basic', self.cfgDeploy):\
dFile = 'docker-compose-basic-nrf.yaml'
else:
dFile = 'docker-compose-mini-nrf.yaml'
mySSH.command('docker-compose -f ' + dFile + ' ps -a', '\$', 60)
@@ -584,7 +582,7 @@ class EPCManagement():
mySSH.command('docker logs ' + c + ' > ' + self.SourceCodePath + '/logs/' + c + '.log', '\$', 5)
logging.debug('Terminating OAI CN5G')
mySSH.command(f'cd {self.SourceCodePath}/docker-compose', '\$', 5)
mySSH.command('cd /opt/oai-cn5g-fed-v1.5/docker-compose', '\$', 5)
mySSH.command('python3 ./core-network.py '+self.cfgUnDeploy, '\$', 60)
mySSH.command('docker volume prune --force || true', '\$', 60)
time.sleep(2)

View File

@@ -30,7 +30,6 @@
000021
000022
000023
000024
020021
100021
</TestCaseRequestedList>
@@ -67,12 +66,6 @@
<nb_healthy>14</nb_healthy>
</testCase>
<testCase id="000024">
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3</id>
</testCase>
<testCase id="020021">
<class>Ping</class>
<desc>Ping ext-dn from all NR-UEs</desc>

View File

@@ -29,7 +29,6 @@
100021
000021
000022
000023
020021
030021
030022
@@ -60,12 +59,6 @@
<nb_healthy>8</nb_healthy>
</testCase>
<testCase id="000023">
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
</testCase>
<testCase id="020021">
<class>Ping</class>
<desc>Ping ext-dn from all NR-UEs</desc>

View File

@@ -28,6 +28,7 @@
<TestCaseRequestedList>
111111
100011
000010
000011
000012
000013
@@ -46,26 +47,36 @@
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000010">
<class>DeployGenObject</class>
<desc>Deploy MySql Database</desc>
<yaml_path>yaml_files/5g_fdd_rfsimulator</yaml_path>
<services>mysql</services>
<nb_healthy>1</nb_healthy>
</testCase>
<testCase id="000011">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G CoreNetwork</desc>
<yaml_path>yaml_files/5g_fdd_rfsimulator</yaml_path>
<services>mysql oai-amf oai-smf oai-upf oai-ext-dn</services>
<services>oai-amf oai-smf oai-upf oai-ext-dn</services>
<nb_healthy>5</nb_healthy>
</testCase>
<testCase id="000012">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G gNB+UE RF sim SA</desc>
<desc>Deploy OAI 5G gNB RF sim SA</desc>
<yaml_path>yaml_files/5g_fdd_rfsimulator</yaml_path>
<services>oai-gnb oai-nr-ue</services>
<nb_healthy>7</nb_healthy>
<services>oai-gnb</services>
<nb_healthy>6</nb_healthy>
</testCase>
<testCase id="000013">
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<class>DeployGenObject</class>
<desc>Deploy OAI 5G NR-UE RF sim SA</desc>
<yaml_path>yaml_files/5g_fdd_rfsimulator</yaml_path>
<services>oai-nr-ue</services>
<nb_healthy>7</nb_healthy>
</testCase>
<testCase id="020011">

View File

@@ -28,6 +28,7 @@
<TestCaseRequestedList>
111111
100001
000000
000001
000002
000003
@@ -46,26 +47,36 @@
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000000">
<class>DeployGenObject</class>
<desc>Deploy MySql Database</desc>
<yaml_path>yaml_files/5g_rfsimulator_24prb</yaml_path>
<services>mysql</services>
<nb_healthy>1</nb_healthy>
</testCase>
<testCase id="000001">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G CoreNetwork</desc>
<yaml_path>yaml_files/5g_rfsimulator_24prb</yaml_path>
<services>mysql oai-amf oai-smf oai-upf oai-ext-dn</services>
<services>oai-amf oai-smf oai-upf oai-ext-dn</services>
<nb_healthy>5</nb_healthy>
</testCase>
<testCase id="000002">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G gNB+UE RFsim SA</desc>
<desc>Deploy OAI 5G gNB RF sim SA</desc>
<yaml_path>yaml_files/5g_rfsimulator_24prb</yaml_path>
<services>oai-gnb oai-nr-ue</services>
<nb_healthy>7</nb_healthy>
<services>oai-gnb</services>
<nb_healthy>6</nb_healthy>
</testCase>
<testCase id="000003">
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<class>DeployGenObject</class>
<desc>Deploy OAI 5G NR-UE RF sim SA</desc>
<yaml_path>yaml_files/5g_rfsimulator_24prb</yaml_path>
<services>oai-nr-ue</services>
<nb_healthy>7</nb_healthy>
</testCase>
<testCase id="020001">

View File

@@ -28,6 +28,7 @@
<TestCaseRequestedList>
111111
100001
000000
000001
000002
000003
@@ -46,26 +47,36 @@
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000000">
<class>DeployGenObject</class>
<desc>Deploy MySql Database</desc>
<yaml_path>yaml_files/5g_rfsimulator_2x2</yaml_path>
<services>mysql</services>
<nb_healthy>1</nb_healthy>
</testCase>
<testCase id="000001">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G CoreNetwork</desc>
<yaml_path>yaml_files/5g_rfsimulator_2x2</yaml_path>
<services>mysql oai-amf oai-smf oai-upf oai-ext-dn</services>
<services>oai-amf oai-smf oai-upf oai-ext-dn</services>
<nb_healthy>5</nb_healthy>
</testCase>
<testCase id="000002">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G gNB+UE RF sim SA</desc>
<desc>Deploy OAI 5G gNB RF sim SA</desc>
<yaml_path>yaml_files/5g_rfsimulator_2x2</yaml_path>
<services>oai-gnb oai-nr-ue</services>
<nb_healthy>7</nb_healthy>
<services>oai-gnb</services>
<nb_healthy>6</nb_healthy>
</testCase>
<testCase id="000003">
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<class>DeployGenObject</class>
<desc>Deploy OAI 5G NR-UE RF sim SA</desc>
<yaml_path>yaml_files/5g_rfsimulator_2x2</yaml_path>
<services>oai-nr-ue</services>
<nb_healthy>7</nb_healthy>
</testCase>
<testCase id="020001">

View File

@@ -43,16 +43,18 @@
<testCase id="000020">
<class>DeployGenObject</class>
<desc>Deploy OAI-DU+nrUE</desc>
<desc>Deploy OAI-DU</desc>
<yaml_path>yaml_files/5g_rfsimulator_accelleran</yaml_path>
<services>oai-du oai-nr-ue</services>
<nb_healthy>2</nb_healthy>
<services>oai-du</services>
<nb_healthy>1</nb_healthy>
</testCase>
<testCase id="000021">
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<class>DeployGenObject</class>
<desc>Deploy nrUE</desc>
<yaml_path>yaml_files/5g_rfsimulator_accelleran</yaml_path>
<services>oai-nr-ue</services>
<nb_healthy>2</nb_healthy>
</testCase>
<testCase id="020021">

View File

@@ -50,7 +50,7 @@
<class>Custom_Command</class>
<desc>Clean-Up any residual volume</desc>
<node>localhost</node>
<command>docker volume rm 5g_rfsimulator_fdd_phytest_rrc.config -f</command>
<command>docker volume rm 5g_rfsimulator_fdd_phytest_rrc.config</command>
</testCase>
<testCase id="000010">

View File

@@ -22,12 +22,13 @@
-->
<testCaseList>
<htmlTabRef>rfsim-fr2-32prb-5gnr-tdd</htmlTabRef>
<htmlTabName>Monolithic FR2 gNB</htmlTabName>
<htmlTabName>Monolithic FR2 do-ra gNB</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>
111111
100001
004000
000000
000001
020001
@@ -43,35 +44,42 @@
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="004000">
<class>Custom_Command</class>
<desc>Clean-Up any residual volume</desc>
<node>localhost</node>
<command>docker volume rm 5g_rfsimulator_fr2_32prb_rrc.config</command>
</testCase>
<testCase id="000000">
<class>DeployGenObject</class>
<desc>Deploy OAI gNB</desc>
<yaml_path>yaml_files/5g_rfsimulator_fr2_32prb</yaml_path>
<services>mysql oai-amf oai-smf oai-upf oai-ext-dn</services>
<nb_healthy>5</nb_healthy>
<services>oai-gnb</services>
<nb_healthy>1</nb_healthy>
</testCase>
<testCase id="000001">
<class>DeployGenObject</class>
<desc>Deploy OAI NR-UE</desc>
<yaml_path>yaml_files/5g_rfsimulator_fr2_32prb</yaml_path>
<services>oai-gnb oai-nr-ue</services>
<nb_healthy>7</nb_healthy>
<services>oai-nr-ue</services>
<nb_healthy>2</nb_healthy>
</testCase>
<testCase id="020001">
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<desc>Ping gNB from NR-UE</desc>
<id>rfsim5g_ue</id>
<ping_args>-c 20 -i0.2 192.168.72.135</ping_args>
<ping_args>-c20 -i0.2 10.0.1.1</ping_args>
<ping_packetloss_threshold>0</ping_packetloss_threshold>
</testCase>
<testCase id="020002">
<class>Ping</class>
<desc>Ping NR-UE from ext-dn</desc>
<id>rfsim5g_ext_dn</id>
<ping_args>-c 20 12.1.1.2 -i0.2</ping_args>
<desc>Ping NR-UE from gNB</desc>
<id>rfsim5g_gnb_nos1</id>
<ping_args>-c20 -i0.2 10.0.1.2</ping_args>
<ping_packetloss_threshold>0</ping_packetloss_threshold>
</testCase>
@@ -79,8 +87,8 @@
<class>UndeployGenObject</class>
<desc>Undeploy all OAI 5G stack</desc>
<yaml_path>yaml_files/5g_rfsimulator_fr2_32prb</yaml_path>
<d_retx_th>10,0,0,0</d_retx_th>
<u_retx_th>10,0,0,0</u_retx_th>
<d_retx_th>0,0,0,0</d_retx_th>
<u_retx_th>0,0,0,0</u_retx_th>
</testCase>
</testCaseList>

View File

@@ -26,6 +26,7 @@
<htmlTabIcon>trash</htmlTabIcon>
<TestCaseRequestedList>
100002
004000
222222
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
@@ -36,6 +37,13 @@
<yaml_path>yaml_files/5g_rfsimulator_fr2_32prb</yaml_path>
</testCase>
<testCase id="004000">
<class>Custom_Command</class>
<desc>Clean-Up any residual volume</desc>
<node>localhost</node>
<command>docker volume rm 5g_rfsimulator_fr2_32prb_rrc.config</command>
</testCase>
<testCase id="222222">
<class>Clean_Test_Server_Images</class>
<desc>Clean Test Images on Test Server</desc>

View File

@@ -48,7 +48,7 @@
<class>Custom_Command</class>
<desc>Clean-Up any residual volume</desc>
<node>localhost</node>
<command>docker volume rm 5g_rfsimulator_tdd_dora_rrc.config -f</command>
<command>docker volume rm 5g_rfsimulator_tdd_dora_rrc.config</command>
</testCase>
<testCase id="000000">

View File

@@ -28,6 +28,7 @@
<TestCaseRequestedList>
111111
100001
000000
000001
000002
000003
@@ -46,26 +47,36 @@
<images_to_pull>oai-gnb-asan oai-nr-ue-asan</images_to_pull>
</testCase>
<testCase id="000000">
<class>DeployGenObject</class>
<desc>Deploy MySql Database</desc>
<yaml_path>yaml_files/5g_rfsimulator_u0_25prb</yaml_path>
<services>mysql</services>
<nb_healthy>1</nb_healthy>
</testCase>
<testCase id="000001">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G CoreNetwork</desc>
<yaml_path>yaml_files/5g_rfsimulator_u0_25prb</yaml_path>
<services>mysql oai-amf oai-smf oai-upf oai-ext-dn</services>
<services>oai-amf oai-smf oai-upf oai-ext-dn</services>
<nb_healthy>5</nb_healthy>
</testCase>
<testCase id="000002">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G gNB+nrUE RF sim SA</desc>
<desc>Deploy OAI 5G gNB RF sim SA</desc>
<yaml_path>yaml_files/5g_rfsimulator_u0_25prb</yaml_path>
<services>oai-gnb oai-nr-ue</services>
<nb_healthy>7</nb_healthy>
<services>oai-gnb</services>
<nb_healthy>6</nb_healthy>
</testCase>
<testCase id="000003">
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<class>DeployGenObject</class>
<desc>Deploy OAI 5G NR-UE RF sim SA</desc>
<yaml_path>yaml_files/5g_rfsimulator_u0_25prb</yaml_path>
<services>oai-nr-ue</services>
<nb_healthy>7</nb_healthy>
</testCase>
<testCase id="020001">

View File

@@ -26,8 +26,6 @@
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>
010001
010002
030202
030201
222220
@@ -35,17 +33,6 @@
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id= "010001">
<class>Detach_UE</class>
<desc>Detach UE</desc>
<id>idefix</id>
</testCase>
<testCase id="010002">
<class>Terminate_UE</class>
<desc>Terminate Quectel</desc>
<id>idefix</id>
</testCase>
<testCase id="030201">
<class>Undeploy_Object</class>
<desc>Undeploy eNB</desc>

View File

@@ -1,139 +0,0 @@
<!--
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
-->
<testCaseList>
<htmlTabRef>TEST-AERIAL-SA</htmlTabRef>
<htmlTabName>AERIAL 100 MHz TDD SA</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>
111111
000222
001111
002222
002223
000111
100000
000011
000022
000033
000222
003333
222222
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="111111">
<class>Pull_Local_Registry</class>
<desc>Pull Images from Local Registry</desc>
<test_svr_id>0</test_svr_id>
<images_to_pull>oai-gnb-aerial</images_to_pull>
</testCase>
<testCase id="001111">
<class>Initialize_UE</class>
<desc>Initialize Quectel</desc>
<id>sphex_quectel</id>
</testCase>
<testCase id="002222">
<class>Deploy_Object</class>
<desc>Deploy PNF/Nvidia CUBB in a container</desc>
<yaml_path>ci-scripts/yaml_files/sa_gnb_aerial</yaml_path>
<services>nv-cubb</services>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
</testCase>
<testCase id="002223">
<class>Deploy_Object</class>
<desc>Deploy VNF in a container</desc>
<yaml_path>ci-scripts/yaml_files/sa_gnb_aerial</yaml_path>
<services>oai-gnb-aerial</services>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
</testCase>
<testCase id="000111">
<class>Attach_UE</class>
<desc>Attach Quectel</desc>
<id>sphex_quectel</id>
</testCase>
<testCase id="100000">
<class>Custom_Command</class>
<desc>Adding a IP route</desc>
<node>sphex</node>
<command>sudo ip route add 192.168.71.128/26 via 12.1.1.151 dev wwan0</command>
</testCase>
<testCase id="000011">
<class>Ping</class>
<desc>Ping: 100pings in 20sec</desc>
<id>sphex_quectel</id>
<ping_args>-c 100 -i 0.2 %cn_ip%</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
<testCase id="000022">
<class>Iperf</class>
<desc>iperf (DL/UDP/80M)(30 sec)(single-ue profile)</desc>
<iperf_args>-u -b 80M -t 30 -R</iperf_args>
<direction>IPERF3</direction>
<id>sphex_quectel</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
</testCase>
<testCase id="000033">
<class>Iperf</class>
<desc>iperf (UL/UDP/40M)(30 sec)(single-ue profile)</desc>
<iperf_args>-u -b 40M -t 30</iperf_args>
<direction>IPERF3</direction>
<id>sphex_quectel</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
</testCase>
<testCase id="000222">
<class>Detach_UE</class>
<desc>Detach Quectel</desc>
<id>sphex_quectel</id>
</testCase>
<testCase id="003333">
<class>Terminate_UE</class>
<desc>Terminate Quectel</desc>
<id>sphex_quectel</id>
</testCase>
<testCase id="222222">
<class>Undeploy_Object</class>
<desc>Undeploy gNB</desc>
<yaml_path>ci-scripts/yaml_files/sa_gnb_aerial</yaml_path>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
<d_retx_th>20,100,100,100</d_retx_th>
<u_retx_th>20,100,100,100</u_retx_th>
</testCase>
</testCaseList>

View File

@@ -1,52 +0,0 @@
<!--
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
-->
<testCaseList>
<htmlTabRef>test-aerial-cleanup</htmlTabRef>
<htmlTabName>CleanUp AERIAL</htmlTabName>
<htmlTabIcon>trash</htmlTabIcon>
<TestCaseRequestedList>
111111
222222
333333
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="111111">
<class>Clean_Test_Server_Images</class>
<desc>Clean Test Images on Test Server</desc>
<test_svr_id>0</test_svr_id>
</testCase>
<testCase id="222222">
<class>Detach_UE</class>
<desc>Terminate UE</desc>
<id>sphex_quectel</id>
</testCase>
<testCase id="333333">
<class>Terminate_UE</class>
<desc>Terminate UE</desc>
<id>sphex_quectel</id>
</testCase>
</testCaseList>

View File

@@ -40,15 +40,9 @@
002008
002009
002010
002011
002012
002013
002014
002015
000100
000010
000020
002016
000200
003000
004000
@@ -138,42 +132,12 @@
<id>amarisoft_ue_10</id>
</testCase>
<testCase id="002011">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_11</id>
</testCase>
<testCase id="002012">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_12</id>
</testCase>
<testCase id="002013">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_13</id>
</testCase>
<testCase id="002014">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_14</id>
</testCase>
<testCase id="002015">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_15</id>
</testCase>
<testCase id="000010">
<class>Iperf</class>
<desc>iperf (DL/7Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<iperf_args>-u -b 70M -t 30 -i 1 -R</iperf_args>
<direction>IPERF3</direction>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
<iperf_profile>balanced</iperf_profile>
@@ -184,7 +148,7 @@
<desc>iperf (UL/3.6Mbps/UDP)(30 sec)(multi-ue profile)</desc>
<iperf_args>-u -b 36M -t 30 -i 1 </iperf_args>
<direction>IPERF3</direction>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
<iperf_profile>balanced</iperf_profile>
@@ -193,23 +157,17 @@
<testCase id="000100">
<class>Ping</class>
<desc>Ping: 20pings in 20sec, multi-ue</desc>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15</id>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10</id>
<ping_args>-c 20 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>25</ping_rttavg_threshold>
</testCase>
<testCase id="002016">
<class>Attach_UE</class>
<desc>Attach UE</desc>
<id>amarisoft_ue_16</id>
</testCase>
<testCase id="000200">
<class>Ping</class>
<desc>Ping: 50pings in 10sec, multi-ue</desc>
<id>amarisoft_ue_16</id>
<ping_args>-c 50 -i 0.2 %cn_ip%</ping_args>
<desc>Ping: 100pings in 20sec, multi-ue</desc>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10</id>
<ping_args>-c 100 -i 0.2 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>30</ping_rttavg_threshold>
</testCase>
@@ -217,7 +175,7 @@
<testCase id="003000">
<class>Detach_UE</class>
<desc>Detach UE</desc>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 amarisoft_ue_16</id>
<id>amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10</id>
</testCase>
<testCase id="004000">

View File

@@ -26,23 +26,10 @@
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>
010001
010002
030201
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id= "010001">
<class>Detach_UE</class>
<desc>Detach UE</desc>
<id>idefix</id>
</testCase>
<testCase id="010002">
<class>Terminate_UE</class>
<desc>Terminate Quectel</desc>
<id>idefix</id>
</testCase>
<testCase id="030201">
<class>Undeploy_Object</class>
<desc>Undeploy gNB</desc>

View File

@@ -37,10 +37,6 @@
370001
370000
370002
360001
100002
360002
350000
310011
310002
330201
@@ -118,9 +114,9 @@
<testCase id="350000">
<class>Ping</class>
<desc>Ping: 50pings in 10sec</desc>
<desc>Ping: 20pings in 20sec</desc>
<id>idefix</id>
<ping_args>-c 20 -i 0.2 %cn_ip%</ping_args>
<ping_args>-c 20 %cn_ip%</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>25</ping_rttavg_threshold>
</testCase>
@@ -156,27 +152,6 @@
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="360001">
<class>Custom_Command</class>
<desc>Trigger Reestablishment (on DU)</desc>
<node>ofqot</node>
<command>echo ci force_reestab | nc -N 192.168.68.195 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="360002">
<class>Custom_Command</class>
<desc>Verify Reestablishment (on CU)</desc>
<node>ofqot</node>
<command>echo ci get_reestab_count | nc -N 192.168.68.194 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<command_fail>yes</command_fail>
</testCase>
<testCase id="100002">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>10</idle_sleep_time_in_sec>
</testCase>
<testCase id="330201">
<class>Undeploy_Object</class>
<desc>Undeploy CU-DU</desc>

View File

@@ -26,24 +26,11 @@
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>
010001
010002
330201
222222
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id= "010001">
<class>Detach_UE</class>
<desc>Detach UE</desc>
<id>idefix</id>
</testCase>
<testCase id="010002">
<class>Terminate_UE</class>
<desc>Terminate Quectel</desc>
<id>idefix</id>
</testCase>
<testCase id="330201">
<class>Undeploy_Object</class>
<desc>Undeploy CU-CP/CU-UP/DU</desc>

View File

@@ -26,23 +26,10 @@
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>
010001
010002
230201
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id= "010001">
<class>Detach_UE</class>
<desc>Detach UE</desc>
<id>idefix</id>
</testCase>
<testCase id="010002">
<class>Terminate_UE</class>
<desc>Terminate Quectel</desc>
<id>idefix</id>
</testCase>
<testCase id="230201">
<class>Undeploy_Object</class>
<desc>Undeploy CU-DU</desc>

View File

@@ -26,23 +26,10 @@
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>
010001
010002
030201
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id= "010001">
<class>Detach_UE</class>
<desc>Detach UE</desc>
<id>idefix</id>
</testCase>
<testCase id="010002">
<class>Terminate_UE</class>
<desc>Terminate Quectel</desc>
<id>idefix</id>
</testCase>
<testCase id="030201">
<class>Undeploy_Object</class>
<desc>Undeploy gNB</desc>

View File

@@ -1,45 +0,0 @@
<!--
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
-->
<testCaseList>
<htmlTabRef>cn5g-start-tab</htmlTabRef>
<htmlTabName>CN5G-Start</htmlTabName>
<htmlTabIcon>log-in</htmlTabIcon>
<TestCaseRequestedList>
000100
000200
</TestCaseRequestedList>
<TestCaseExclusionList>
</TestCaseExclusionList>
<testCase id="000100">
<class>Terminate_5GCN</class>
<desc>Terminate 5G Core</desc>
<args>--type stop-basic</args>
</testCase>
<testCase id="000200">
<class>Initialize_5GCN</class>
<desc>Initialize 5G Core</desc>
<args>--type start-basic</args>
</testCase>
</testCaseList>

View File

@@ -1,39 +0,0 @@
<!--
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
-->
<testCaseList>
<htmlTabRef>cn5g-start-tab</htmlTabRef>
<htmlTabName>CN5G-Start</htmlTabName>
<htmlTabIcon>log-in</htmlTabIcon>
<TestCaseRequestedList>
000300
</TestCaseRequestedList>
<TestCaseExclusionList>
</TestCaseExclusionList>
<testCase id="000300">
<class>Terminate_5GCN</class>
<desc>Terminate 5G Core</desc>
<args>--type stop-basic</args>
</testCase>
</testCaseList>

View File

@@ -389,7 +389,7 @@ networks:
name: rfsim5g-oai-e1-net
ipam:
config:
- subnet: 192.168.77.0/28
- subnet: 192.168.77.1/28
driver_opts:
com.docker.network.bridge.name: "rfsim5g-e1"
ue_net:
@@ -397,6 +397,6 @@ networks:
name: rfsim5g-oai-ue-net
ipam:
config:
- subnet: 192.168.78.0/28
- subnet: 192.168.78.1/28
driver_opts:
com.docker.network.bridge.name: "rfsim5g-ue"

View File

@@ -1,99 +1,18 @@
version: '3.8'
services:
mysql:
container_name: "rfsim5g-mysql"
image: mysql:8.0
volumes:
- ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
- ../5g_rfsimulator/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: 30
networks:
public_net:
ipv4_address: 192.168.71.131
oai-amf:
container_name: "rfsim5g-oai-amf"
image: oaisoftwarealliance/oai-amf:v2.0.0
environment:
- TZ=Europe/paris
volumes:
- ../5g_rfsimulator/mini_nonrf_config.yaml:/openair-amf/etc/config.yaml
depends_on:
- mysql
networks:
public_net:
ipv4_address: 192.168.71.132
oai-smf:
container_name: "rfsim5g-oai-smf"
image: oaisoftwarealliance/oai-smf:v2.0.0
environment:
- TZ=Europe/Paris
volumes:
- ../5g_rfsimulator/mini_nonrf_config.yaml:/openair-smf/etc/config.yaml
depends_on:
- oai-amf
networks:
public_net:
ipv4_address: 192.168.71.133
oai-upf:
container_name: "rfsim5g-oai-upf"
image: oaisoftwarealliance/oai-upf:v2.0.0
environment:
- TZ=Europe/Paris
volumes:
- ../5g_rfsimulator/mini_nonrf_config.yaml:/openair-upf/etc/config.yaml
depends_on:
- oai-smf
cap_add:
- NET_ADMIN
- SYS_ADMIN
cap_drop:
- ALL
privileged: true
networks:
public_net:
ipv4_address: 192.168.71.134
traffic_net:
ipv4_address: 192.168.72.134
oai-ext-dn:
privileged: true
container_name: rfsim5g-oai-ext-dn
image: oaisoftwarealliance/trf-gen-cn5g:focal
entrypoint: /bin/bash -c \
"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-upf
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-gnb:
image: oaisoftwarealliance/oai-gnb:develop
privileged: true
container_name: rfsim5g-oai-gnb
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --rfsimulator.wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
networks:
public_net:
ipv4_address: 192.168.71.140
volumes:
- ../../conf_files/gnb.sa.band261.u3.32prb.rfsim.conf:/opt/oai-gnb/etc/gnb.conf
- ../../conf_files/gnb.band261.32prb.rfsim.phytest-dora.conf:/opt/oai-gnb/etc/gnb.conf
- rrc.config:/opt/oai-gnb/
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
@@ -105,12 +24,11 @@ services:
privileged: true
container_name: rfsim5g-oai-nr-ue
environment:
USE_ADDITIONAL_OPTIONS: --sa --rfsim
--rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
-r 32 --numerology 3 --band 261 -C 27533160000 --ssb 73
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
volumes:
- ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
- rrc.config:/opt/oai-nr-ue/etc/rrc/
depends_on:
- oai-gnb
networks:
@@ -122,6 +40,9 @@ services:
timeout: 5s
retries: 5
volumes:
rrc.config:
networks:
public_net:
driver: bridge
@@ -131,11 +52,3 @@ networks:
- subnet: 192.168.71.128/26
driver_opts:
com.docker.network.bridge.name: "rfsim5g-public"
traffic_net:
driver: bridge
name: rfsim5g-oai-traffic-net
ipam:
config:
- subnet: 192.168.72.128/26
driver_opts:
com.docker.network.bridge.name: "rfsim5g-traffic"

View File

@@ -5,8 +5,6 @@ services:
privileged: true
network_mode: "host"
container_name: oai-gnb
ulimits:
core: -1 # for core dumps
environment:
TZ: Europe/Paris
USE_ADDITIONAL_OPTIONS: --sa --tune-offset 20000000 -A 45 --log_config.global_log_options level,nocolor,time

View File

@@ -5,8 +5,6 @@ services:
privileged: true
network_mode: host
container_name: oai-nr-ue
ulimits:
core: -1 # for core dumps
#entrypoint: /bin/bash -c "sleep infinity"
environment:
TZ: Europe/Paris

View File

@@ -5,8 +5,6 @@ services:
image: oai-enb:latest
privileged: true
container_name: nsa-b200-enb
ulimits:
core: -1 # for core dumps
environment:
USE_B2XX: 'yes'
USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,time,line_num,function

View File

@@ -5,8 +5,6 @@ services:
image: oai-gnb:latest
privileged: true
container_name: nsa-b200-gnb
ulimits:
core: -1 # for core dumps
environment:
USE_B2XX: 'yes'
USE_ADDITIONAL_OPTIONS: -E -q --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function

View File

@@ -5,8 +5,6 @@ services:
privileged: true
network_mode: "host"
container_name: oai-gnb-aw2s
ulimits:
core: -1 # for core dumps
environment:
TZ: Europe/Paris
USE_ADDITIONAL_OPTIONS: --sa

View File

@@ -5,8 +5,6 @@ services:
image: oai-gnb:latest
privileged: true
container_name: sa-b200-gnb
ulimits:
core: -1 # for core dumps
environment:
USE_B2XX: 'yes'
USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --telnetsrv --telnetsrv.shrmod ci --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function

View File

@@ -5,10 +5,8 @@ services:
image: oai-gnb:latest
privileged: true
container_name: sa-cucp-gnb
ulimits:
core: -1 # for core dumps
environment:
USE_ADDITIONAL_OPTIONS: --sa --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function
USE_ADDITIONAL_OPTIONS: --sa --log_config.global_log_options level,nocolor,time,line_num,function
volumes:
- ../../conf_files/gnb-cucp.sa.f1.quectel.conf:/opt/oai-gnb/etc/gnb.conf
networks:
@@ -25,8 +23,6 @@ services:
image: oai-nr-cuup:latest
privileged: true
container_name: sa-cuup-gnb
ulimits:
core: -1 # for core dumps
environment:
USE_ADDITIONAL_OPTIONS: --sa --log_config.global_log_options level,nocolor,time,line_num,function
volumes:
@@ -45,17 +41,9 @@ services:
image: oai-gnb:latest
privileged: true
container_name: sa-du-b200-gnb
ulimits:
core: -1 # for core dumps
environment:
USE_B2XX: 'yes'
USE_ADDITIONAL_OPTIONS: --sa
--RUs.[0].sdr_addrs serial=30C51D4
--continuous-tx -E
--telnetsrv --telnetsrv.shrmod ci
--gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 1
--RUs.[0].att_rx 18 --RUs.[0].att_tx 18
--log_config.global_log_options level,nocolor,time,line_num,function
USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx -E --log_config.global_log_options level,nocolor,time,line_num,function --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 1 --RUs.[0].att_rx 18 --RUs.[0].att_tx 18
volumes:
- ../../conf_files/gnb-du.sa.band78.106prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf
- /dev:/dev

View File

@@ -5,8 +5,6 @@ services:
image: oai-gnb:latest
privileged: true
container_name: sa-cu-gnb
ulimits:
core: -1 # for core dumps
environment:
USE_ADDITIONAL_OPTIONS: --sa --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function
volumes:
@@ -26,11 +24,9 @@ services:
image: oai-gnb:latest
privileged: true
container_name: sa-du-b200-gnb
ulimits:
core: -1 # for core dumps
environment:
USE_B2XX: 'yes'
USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 0 --L1s.[0].max_ldpc_iterations 20
USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 0 --MACRLCs.[0].ul_max_mcs 28 --L1s.[0].max_ldpc_iterations 20
volumes:
- ../../conf_files/gnb-du.sa.band1.52prb.usrpb210.conf:/opt/oai-gnb/etc/gnb.conf
- /dev:/dev

View File

@@ -1,37 +0,0 @@
#!/bin/bash
# Check if cuBB_SDK is defined, if not, use default path
cuBB_Path="${cuBB_SDK:-/opt/nvidia/cuBB}"
# Run gdrcopy insmod
cd "$cuBB_Path"/cuPHY-CP/external/gdrcopy/ || exit 1
./insmod.sh
cd "$cuBB_Path" || exit 1
# Add gdrcopy to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/opt/mellanox/dpdk/lib/x86_64-linux-gnu:/opt/mellanox/doca/lib/x86_64-linux-gnu:/opt/nvidia/cuBB/cuPHY-CP/external/gdrcopy/build/x86_64/
# Restart MPS
# Export variables
export CUDA_DEVICE_MAX_CONNECTIONS=8
export CUDA_MPS_PIPE_DIRECTORY=/var
export CUDA_MPS_LOG_DIRECTORY=/var
# Stop existing MPS
echo quit | nvidia-cuda-mps-control
# Start MPS
nvidia-cuda-mps-control -d
echo start_server -uid 0 | nvidia-cuda-mps-control
# Start cuphycontroller_scf
# Check if an argument is provided
if [ $# -eq 0 ]; then
# No argument provided, use default value
argument="P5G_SCF_FXN"
else
# Argument provided, use it
argument="$1"
fi
"$cuBB_Path"/build/cuPHY-CP/cuphycontroller/examples/cuphycontroller_scf "$argument"

View File

@@ -1,65 +0,0 @@
version: "3.8"
services:
nv-cubb:
container_name: nv-cubb
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities:
- gpu
network_mode: host
shm_size: 4096m
privileged: true
stdin_open: true
tty: true
volumes:
- /lib/modules:/lib/modules
- /dev/hugepages:/dev/hugepages
- /usr/src:/usr/src
- ./aerial_l1_entrypoint.sh:/opt/nvidia/cuBB/aerial_l1_entrypoint.sh
- /var/log/aerial:/var/log/aerial
- ../../../cmake_targets/share:/opt/cuBB/share
userns_mode: host
ipc: "shareable"
image: cubb-build:23-2
environment:
- cuBB_SDK=/opt/nvidia/cuBB
command: bash -c " rm -rf /tmp/phy.log && chmod +x /opt/nvidia/cuBB/aerial_l1_entrypoint.sh && /opt/nvidia/cuBB/aerial_l1_entrypoint.sh"
healthcheck:
test: ["CMD-SHELL",'grep -q "L1 is ready!" /tmp/phy.log && echo 0 || echo 1']
interval: 20s
timeout: 5s
retries: 5
oai-gnb-aerial:
cpuset: "13-20"
image: oai-gnb-aerial:latest
depends_on:
nv-cubb:
condition: service_healthy
privileged: true
ipc: "container:nv-cubb"
environment:
USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,time
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities:
- gpu
network_mode: host
shm_size: 4096m
stdin_open: true
tty: true
volumes:
- ../../conf_files/gnb-vnf.sa.band78.273prb.aerial.conf:/opt/oai-gnb/etc/gnb.conf
container_name: oai-gnb-aerial
healthcheck:
test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem"
interval: 10s
timeout: 5s
retries: 5

View File

@@ -5,8 +5,6 @@ services:
image: oai-gnb:latest
privileged: true
container_name: sa-b200-gnb
ulimits:
core: -1 # for core dumps
environment:
USE_B2XX: 'yes'
USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --telnetsrv --telnetsrv.shrmod ci --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function -E

View File

@@ -93,7 +93,7 @@ Options:
--UE-gen-nvram [output path]
Specify gen_nvram_path (default \"$gen_nvram_path\")
-w | --hardware
USRP, BLADERF, LMSSDR, IRIS, SIMU, AW2SORI, AERIAL, None (Default)
USRP, BLADERF, LMSSDR, IRIS, SIMU, AW2SORI, None (Default)
Adds this RF board support (in external packages installation and in compilation)
-t | --transport
Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g, oran_fhlib_5g
@@ -289,10 +289,6 @@ function main() {
TARGET_LIST="$TARGET_LIST aw2sori_transpro"
CMAKE_CMD="$CMAKE_CMD -DOAI_$2=ON"
;;
"AERIAL"|"Aerial"|"aerial")
HW="OAI_AERIAL"
CMAKE_CMD="$CMAKE_CMD -DOAI_AERIAL=ON"
;;
"None")
;;
*)
@@ -525,7 +521,7 @@ function main() {
mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build
${CMAKE_CMD% *} ..
eval $CMAKE_CMD ..
compilations nas_sim_tools usim.txt usim
compilations nas_sim_tools nvram.txt nvram
compilations nas_sim_tools conf2uedata.txt conf2uedata

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 2.8)
project(NAS_SIM_TOOLS)
@@ -6,7 +6,6 @@ include(FindPkgConfig)
pkg_search_module(CONFIG libconfig REQUIRED)
include_directories(${CONFIG_INCLUDE_DIRS})
add_definitions(-std=gnu99)
include("../macros.cmake")
ENABLE_LANGUAGE(C)

View File

@@ -666,7 +666,10 @@ install_asn1c_from_source(){
# GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
git clone https://github.com/mouse07410/asn1c /tmp/asn1c
cd /tmp/asn1c
git checkout vlm_master
# 2024-02-06: problem compatibility between E2-agent and 4cfcd4f191c3fa41f6ac1b15cb2ad3acc1520af5 from asn1c
# Reverting to previous commit that works
# TODO : revert to vlm_master once FlexRic and E2-agent are fixed
git checkout -f a6bdcd22658d6b7c3ed218d8c1375907ac532b64
# Showing which version is used
git log -n1
autoreconf -iv

View File

@@ -1,76 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 04cfa53..6eef6d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,8 @@ OPTION(DOCA_GPU_DPDK "Enable DOCA GPUNetIO" ON)
OPTION(NVIPC_DOCA_ENABLE "Build libnvipc.so with DOCA" ON)
OPTION(NVIPC_DOCA_GPUNETIO "Use DOCA gpunetio in DOCA GPU DMA" OFF)
+project(gt_common_libs)
+
find_package(PkgConfig REQUIRED)
# Disable NVIPC_DOCA_ENABLE if DOCA version < 2
diff --git a/nvIPC/CMakeLists.txt b/nvIPC/CMakeLists.txt
index 633bbb7..dad7a7a 100644
--- a/nvIPC/CMakeLists.txt
+++ b/nvIPC/CMakeLists.txt
@@ -19,7 +19,7 @@
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TOR (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(GNUInstallDirs)
# lib: nvipc
set(SOURCES configs/nv_ipc_config.c
configs/nv_ipc_yaml_parser.cpp
@@ -68,6 +68,8 @@ target_include_directories(nvipc PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE
target_include_directories(nvipc PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cuda>)
target_include_directories(nvipc PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gpudata>)
+set_target_properties(nvipc PROPERTIES PUBLIC_HEADER $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
+
target_compile_options(nvipc PRIVATE ${AERIAL_ARCH_TUNE_FLAGS})
if(NVIPC_DPDK_ENABLE OR NVIPC_DOCA_GPUNETIO)
@@ -120,4 +122,8 @@ else()
target_link_libraries(nvipc PUBLIC rt -pthread nvlog)
endif()
+install(TARGETS nvipc
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/..)
+
add_subdirectory(tests)
diff --git a/nvlog/CMakeLists.txt b/nvlog/CMakeLists.txt
index 7b65242..c0c5080 100644
--- a/nvlog/CMakeLists.txt
+++ b/nvlog/CMakeLists.txt
@@ -20,6 +20,8 @@
# STRICT LIABILITY, OR TOR (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(GNUInstallDirs)
+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g")
@@ -42,6 +44,8 @@ target_include_directories(nvlog PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../extern
target_include_directories(nvlog PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../external/fmtlog_flat)
target_link_libraries(nvlog rt -pthread yaml fmtlog-shared fmt::fmt)
+set_target_properties(nvlog PROPERTIES PUBLIC_HEADER $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
+
######## libnvlog_static.a #############
add_library(nvlog_static STATIC ${SOURCES})
set_property(TARGET nvlog_static PROPERTY POSITION_INDEPENDENT_CODE ON)
@@ -68,5 +72,9 @@ target_compile_options(nvlog_static PRIVATE ${AERIAL_ARCH_TUNE_FLAGS})
#add_executable(nvlog_observer ${SOURCES})
#target_link_libraries(nvlog_observer nvlog_static -pthread)
+install(TARGETS nvlog
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/../)
+
######## test directory ################
add_subdirectory(test)

View File

@@ -12,7 +12,8 @@
# define NUMBER_OF_SRS_MAX 16
# define NUMBER_OF_SCH_STATS_MAX 16
#define NUMBER_OF_DU_PER_CU_MAX 2
#define NUMBER_FRAMES_PHY_UE_INACTIVE 10
#define MAX_MANAGED_ENB_PER_MOBILE 2
#define MAX_MANAGED_GNB_PER_MOBILE 2

View File

@@ -1,4 +1,3 @@
add_subdirectory(alg)
add_subdirectory(ds)
add_boolean_option(ENABLE_TELNETSRV OFF "Whether to build telnet support in modems" OFF)
if(ENABLE_TELNETSRV)

View File

@@ -46,9 +46,7 @@
#include <time.h>
#include <sys/time.h>
#include <stdatomic.h>
#include "common/utils/LOG/log.h"
#define LOG_MEM_SIZE 100*1024*1024
#include "common/utils/LOG/log_extern.h"
// main log variables
@@ -60,105 +58,53 @@ void read_cpu_hardware (void) __attribute__ ((constructor));
void read_cpu_hardware (void) {}
#endif
typedef struct {
char* buf_p;
int buf_index;
int enable_flag;
} log_mem_cnt_t;
static log_mem_cnt_t log_mem_d[2];
static int log_mem_flag = 0;
log_mem_cnt_t log_mem_d[2];
int log_mem_flag = 0;
volatile int log_mem_side=0;
static pthread_mutex_t log_mem_lock;
static pthread_cond_t log_mem_notify;
static pthread_t log_mem_thread;
static int log_mem_file_cnt=0;
pthread_mutex_t log_mem_lock;
pthread_cond_t log_mem_notify;
pthread_t log_mem_thread;
int log_mem_file_cnt=0;
volatile int log_mem_write_flag=0;
volatile int log_mem_write_side=0;
static char * log_mem_filename;
char __log_mem_filename[1024]={0};
char * log_mem_filename = &__log_mem_filename[0];
char logmem_filename[1024] = {0};
static mapping log_level_names[] = {{"error", OAILOG_ERR},
const mapping log_level_names[] = {{"error", OAILOG_ERR},
{"warn", OAILOG_WARNING},
{"analysis", OAILOG_ANALYSIS},
{"info", OAILOG_INFO},
{"debug", OAILOG_DEBUG},
{"trace", OAILOG_TRACE},
{NULL, -1}};
mapping * log_level_names_ptr(void)
{
return log_level_names;
}
/** @defgroup _log_format Defined log format
* @ingroup _macro
* @brief Macro of log formats defined by LOG
* @{*/
static const unsigned int FLAG_NOCOLOR = 1; /*!< \brief use colors in log messages, depending on level */
static const unsigned int FLAG_THREAD = 1 << 1; /*!< \brief display thread name in log messages */
static const unsigned int FLAG_LEVEL = 1 << 2; /*!< \brief display log level in log messages */
static const unsigned int FLAG_FUNCT = 1 << 3;
static const unsigned int FLAG_FILE_LINE = 1 << 4;
static const unsigned int FLAG_TIME = 1 << 5;
static const unsigned int FLAG_THREAD_ID = 1 << 6;
static const unsigned int FLAG_REAL_TIME = 1 << 7;
static const unsigned int FLAG_INITIALIZED = 1 << 8;
/** @}*/
static mapping log_options[] = {{"nocolor", FLAG_NOCOLOR},
{"level", FLAG_LEVEL},
{"thread", FLAG_THREAD},
{"line_num", FLAG_FILE_LINE},
{"function", FLAG_FUNCT},
{"time", FLAG_TIME},
{"thread_id", FLAG_THREAD_ID},
{"wall_clock", FLAG_REAL_TIME},
{NULL, -1}};
mapping * log_option_names_ptr(void)
{
return log_options;
}
static mapping log_maskmap[] = {{"PRACH", DEBUG_PRACH},
{"RU", DEBUG_RU},
{"UE_PHYPROC", DEBUG_UE_PHYPROC},
{"LTEESTIM", DEBUG_LTEESTIM},
{"DLCELLSPEC", DEBUG_DLCELLSPEC},
{"ULSCH", DEBUG_ULSCH},
{"RRC", DEBUG_RRC},
{"PDCP", DEBUG_PDCP},
{"DFT", DEBUG_DFT},
{"ASN1", DEBUG_ASN1},
{"CTRLSOCKET", DEBUG_CTRLSOCKET},
{"SECURITY", DEBUG_SECURITY},
{"NAS", DEBUG_NAS},
{"RLC", DEBUG_RLC},
{"DLSCH_DECOD", DEBUG_DLSCH_DECOD},
{"UE_TIMING", UE_TIMING},
const mapping log_options[] = {{"nocolor", FLAG_NOCOLOR},
{"level", FLAG_LEVEL},
{"thread", FLAG_THREAD},
{"line_num", FLAG_FILE_LINE},
{"function", FLAG_FUNCT},
{"time", FLAG_TIME},
{"thread_id", FLAG_THREAD_ID},
{"wall_clock", FLAG_REAL_TIME},
{NULL, -1}};
mapping * log_maskmap_ptr(void)
{
return log_maskmap;
}
/* .log_format = 0x13 uncolored standard messages
* .log_format = 0x93 colored standard messages */
/* keep white space in first position; switching it to 0 allows colors to be disabled*/
static const char *const LOG_RED = "\033[1;31m"; /*!< \brief VT100 sequence for bold red foreground */
static const char *const LOG_GREEN = "\033[32m"; /*!< \brief VT100 sequence for green foreground */
static const char *const LOG_ORANGE = "\033[93m"; /*!< \brief VT100 sequence for orange foreground */
static const char *const LOG_BLUE = "\033[34m"; /*!< \brief VT100 sequence for blue foreground */
static const char *const LOG_CYBL = "\033[40;36m"; /*!< \brief VT100 sequence for cyan foreground on black background */
static const char *const LOG_RESET = "\033[0m"; /*!< \brief VT100 sequence for reset (black) foreground */
const mapping log_maskmap[] = LOG_MASKMAP_INIT;
static const char *const log_level_highlight_start[] =
{LOG_RED, LOG_ORANGE, LOG_GREEN, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */
static const char *const log_level_highlight_end[] =
{LOG_RESET, 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, const char *vname, void *data, int length, int dec, unsigned int format, int multiVec)
int write_file_matlab(const char *fname,
const char *vname,
void *data,
int length,
int dec,
unsigned int format,
int multiVec)
{
FILE *fp=NULL;
int i;
@@ -328,15 +274,15 @@ int write_file_matlab(const char *fname, const char *vname, void *data, int leng
}
/* get log parameters from configuration file */
void log_getconfig(log_t *g_log)
void log_getconfig(log_t *g_log)
{
char *gloglevel = NULL;
int consolelog = 0;
paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC;
paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS];
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
paramdef_t logparams_debug[sizeofArray(log_maskmap)];
paramdef_t logparams_dump[sizeofArray(log_maskmap)];
paramdef_t logparams_debug[sizeof(log_maskmap)/sizeof(mapping)];
paramdef_t logparams_dump[sizeof(log_maskmap)/sizeof(mapping)];
int ret = config_get(config_get_if(), logparams_defaults, sizeofArray(logparams_defaults), CONFIG_STRING_LOG_PREFIX);
if (ret <0) {
@@ -358,10 +304,10 @@ void log_getconfig(log_t *g_log)
}
/* build the parameter array for setting per component log level and infile options */
memset(logparams_level, 0, sizeof(logparams_level));
memset(logparams_logfile, 0, sizeof(logparams_logfile));
memset(logparams_level, 0, sizeof(paramdef_t)*MAX_LOG_PREDEF_COMPONENTS);
memset(logparams_logfile, 0, sizeof(paramdef_t)*MAX_LOG_PREDEF_COMPONENTS);
for (int i = 0; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
if(g_log->log_component[i].name == NULL) {
g_log->log_component[i].name = malloc(17);
sprintf((char *)g_log->log_component[i].name,"comp%i?",i);
@@ -395,11 +341,11 @@ void log_getconfig(log_t *g_log)
config_get(config_get_if(), logparams_logfile, MAX_LOG_PREDEF_COMPONENTS, CONFIG_STRING_LOG_PREFIX);
/* now set the log levels and infile option, according to what we read */
for (int i = 0; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
g_log->log_component[i].level = map_str_to_int(log_level_names, *logparams_level[i].strptr);
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
g_log->log_component[i].level = map_str_to_int(log_level_names, *(logparams_level[i].strptr));
set_log(i, g_log->log_component[i].level);
if (*logparams_logfile[i].uptr == 1)
if (*(logparams_logfile[i].uptr) == 1)
set_component_filelog(i);
}
@@ -440,10 +386,16 @@ void log_getconfig(log_t *g_log)
set_glog_onlinelog(consolelog);
}
int register_log_component(const char *name, const char *fext, int compidx)
int register_log_component(char *name,
char *fext,
int compidx)
{
int computed_compidx=compidx;
if (strlen(fext) > 3) {
fext[3]=0; /* limit log file extension to 3 chars */
}
if (compidx < 0) { /* this is not a pre-defined component */
for (int i = MAX_LOG_PREDEF_COMPONENTS; i< MAX_LOG_COMPONENTS; i++) {
if (g_log->log_component[i].name == NULL) {
@@ -457,9 +409,8 @@ int register_log_component(const char *name, const char *fext, int compidx)
g_log->log_component[computed_compidx].name = strdup(name);
g_log->log_component[computed_compidx].stream = stdout;
g_log->log_component[computed_compidx].filelog = 0;
g_log->log_rarely_used[computed_compidx].filelog_name = calloc(1, strlen(name) + 16); /* /tmp/<name>.%s */
sprintf(g_log->log_rarely_used[computed_compidx].filelog_name, "/tmp/%s.", name);
strncat(g_log->log_rarely_used[computed_compidx].filelog_name, fext, 3);
g_log->log_component[computed_compidx].filelog_name = malloc(strlen(name)+16);/* /tmp/<name>.%s */
sprintf(g_log->log_component[computed_compidx].filelog_name,"/tmp/%s.%s",name,fext);
} else {
fprintf(stderr,"{LOG} %s %d Couldn't register component %s\n",__FILE__,__LINE__,name);
}
@@ -469,13 +420,11 @@ int register_log_component(const char *name, const char *fext, int compidx)
static void unregister_all_log_components(void)
{
log_component_t *lc = g_log->log_component;
log_component_back_t *lb = g_log->log_rarely_used;
log_component_t* lc = &g_log->log_component[0];
while (lc->name) {
free((char *)lc->name); // defined as const, but assigned through strdup()
free(lb->filelog_name);
free(lc->filelog_name);
lc++;
lb++;
}
}
@@ -492,6 +441,7 @@ int isLogInitDone (void)
int logInit (void)
{
int i;
g_log = calloc(1, sizeof(log_t));
if (g_log == NULL) {
@@ -499,17 +449,67 @@ int logInit (void)
exit(EXIT_FAILURE);
}
for (int i = 0; i < MAX_LOG_PREDEF_COMPONENTS; i++)
register_log_component(comp_name[i], comp_extension[i], i);
memset(g_log,0,sizeof(log_t));
register_log_component("PHY","log",PHY);
register_log_component("MAC","log",MAC);
register_log_component("OPT","log",OPT);
register_log_component("RLC","log",RLC);
register_log_component("PDCP","log",PDCP);
register_log_component("RRC","log",RRC);
register_log_component("OMG","csv",OMG);
register_log_component("OTG","log",OTG);
register_log_component("OTG_LATENCY","dat",OTG_LATENCY);
register_log_component("OTG_LATENCY_BG","dat",OTG_LATENCY_BG);
register_log_component("OTG_GP","dat",OTG_GP);
register_log_component("OTG_GP_BG","dat",OTG_GP_BG);
register_log_component("OTG_JITTER","dat",OTG_JITTER);
register_log_component("PERF","",PERF);
register_log_component("OIP","",OIP);
register_log_component("OCM","log",OCM);
register_log_component("HW","",HW);
register_log_component("OSA","",OSA);
register_log_component("eRAL","",RAL_ENB);
register_log_component("mRAL","",RAL_UE);
register_log_component("ENB_APP","log",ENB_APP);
register_log_component("MCE_APP","log",MCE_APP);
register_log_component("MME_APP","log",MME_APP);
register_log_component("TMR","",TMR);
register_log_component("EMU","log",EMU);
register_log_component("USIM","txt",USIM);
register_log_component("SIM","txt",SIM);
/* following log component are used for the localization*/
register_log_component("LOCALIZE","log",LOCALIZE);
register_log_component("NAS","log",NAS);
register_log_component("UDP","",UDP_);
register_log_component("GTPU","",GTPU);
register_log_component("SDAP","",SDAP);
register_log_component("S1AP","",S1AP);
register_log_component("F1AP","",F1AP);
register_log_component("E1AP","",E1AP);
register_log_component("M2AP","",M2AP);
register_log_component("M3AP","",M3AP);
register_log_component("SCTP","",SCTP);
register_log_component("X2AP","",X2AP);
register_log_component("LOADER","log",LOADER);
register_log_component("ASN1","log",ASN1);
register_log_component("NFAPI_VNF","log",NFAPI_VNF);
register_log_component("NFAPI_PNF","log",NFAPI_PNF);
register_log_component("GNB_APP","log",GNB_APP);
register_log_component("NR_RRC","log",NR_RRC);
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
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
g_log->filelog_name = "/tmp/openair.log";
log_getconfig(g_log);
// set all unused component items to 0, they are for non predefined components
for (int i=MAX_LOG_PREDEF_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
for (i=MAX_LOG_PREDEF_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
memset(&(g_log->log_component[i]),0,sizeof(log_component_t));
}
@@ -536,7 +536,7 @@ static inline int log_header(log_component_t *c,
int line,
int level)
{
int flag = g_log->flag;
int flag= g_log->flag | c->flag;
char threadname[64];
if (flag & FLAG_THREAD ) {
@@ -626,8 +626,8 @@ void log_dump(int component,
va_list args;
char *wbuf;
log_component_t *c = &g_log->log_component[component];
int flag = g_log->flag;
int flag= g_log->flag | c->flag;
switch(datatype) {
case LOG_DUMP_DOUBLE:
wbuf=malloc((buffsize * 10) + 64 + MAX_LOG_TOTAL);
@@ -670,17 +670,20 @@ int set_log(int component,
int level)
{
/* Checking parameters */
DevCheck((component >= 0) && (component < MAX_LOG_COMPONENTS), component, 0, MAX_LOG_COMPONENTS);
DevCheck((component >= MIN_LOG_COMPONENTS) && (component < MAX_LOG_COMPONENTS),
component, MIN_LOG_COMPONENTS, MAX_LOG_COMPONENTS);
DevCheck((level < NUM_LOG_LEVEL) && (level >= OAILOG_DISABLE), level, NUM_LOG_LEVEL,
OAILOG_ERR);
if ( g_log->log_component[component].level != OAILOG_DISABLE )
g_log->log_rarely_used[component].savedlevel = g_log->log_component[component].level;
g_log->log_component[component].savedlevel = g_log->log_component[component].level;
g_log->log_component[component].level = level;
return 0;
}
void set_glog(int level)
{
for (int c=0; c< MAX_LOG_COMPONENTS; c++ ) {
@@ -692,7 +695,7 @@ void set_glog_onlinelog(int enable)
{
for (int c=0; c< MAX_LOG_COMPONENTS; c++ ) {
if ( enable ) {
g_log->log_component[c].level = g_log->log_rarely_used[c].savedlevel;
g_log->log_component[c].level = g_log->log_component[c].savedlevel;
g_log->log_component[c].vprint = vfprintf;
g_log->log_component[c].print = fprintf;
g_log->log_component[c].stream = stdout;
@@ -701,7 +704,6 @@ void set_glog_onlinelog(int enable)
}
}
}
void set_glog_filelog(int enable)
{
static FILE *fptr;
@@ -730,14 +732,13 @@ void set_glog_filelog(int enable)
void set_component_filelog(int comp)
{
if (g_log->log_component[comp].stream == NULL || g_log->log_component[comp].stream == stdout) {
g_log->log_component[comp].stream = fopen(g_log->log_rarely_used[comp].filelog_name, "w");
g_log->log_component[comp].stream = fopen(g_log->log_component[comp].filelog_name,"w");
}
g_log->log_component[comp].vprint = vfprintf;
g_log->log_component[comp].print = fprintf;
g_log->log_component[comp].filelog = 1;
}
void close_component_filelog(int comp)
{
g_log->log_component[comp].filelog = 0;
@@ -774,19 +775,40 @@ int map_str_to_int(const mapping *map, const char *str)
/* map an int to a string. Takes a mapping array and a value */
char *map_int_to_str(const mapping *map, const int val)
{
while (map->name) {
while (1) {
if (map->name == NULL) {
return NULL;
}
if (map->value == val) {
return map->name;
}
map++;
}
return NULL;
}
int is_newline(char *str,
int size)
{
int i;
for ( i = 0; i < size; i++ ) {
if ( str[i] == '\n' ) {
return 1;
}
}
/* if we get all the way to here, there must not have been a newline! */
return 0;
}
void logClean (void)
{
int i;
if(isLogInitDone()) {
for (int i = 0; i < MAX_LOG_COMPONENTS; i++) {
for (i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
close_component_filelog(i);
}
}
@@ -861,7 +883,7 @@ static void log_output_memory(log_component_t *c, const char *file, const char *
len = MAX_LOG_TOTAL;
}
}
if (!((g_log->flag) & FLAG_NOCOLOR)) {
if ( !((g_log->flag | c->flag) & FLAG_NOCOLOR) ) {
int n = snprintf(log_buffer+len, MAX_LOG_TOTAL-len, "%s", log_level_highlight_end[level]);
if (n > 0) {
len += n;
@@ -911,22 +933,28 @@ static void log_output_memory(log_component_t *c, const char *file, const char *
}
}
int logInit_log_mem (char * filename)
int logInit_log_mem (void)
{
log_mem_flag = 1;
log_mem_filename = filename; // in present code, the parameter is safe permanent pointer
for (log_mem_cnt_t *ptr = log_mem_d; ptr < log_mem_d + sizeofArray(log_mem_d); ptr++)
*ptr = (log_mem_cnt_t){
.buf_p = malloc(LOG_MEM_SIZE),
.buf_index = 0,
.enable_flag = 1,
};
log_mem_side = 0;
if ((pthread_mutex_init(&log_mem_lock, NULL) != 0) || (pthread_cond_init(&log_mem_notify, NULL) != 0)) {
log_mem_d[1].enable_flag=0;
return -1;
if (log_mem_flag == 1) {
log_mem_d[0].buf_p = malloc(LOG_MEM_SIZE);
log_mem_d[0].buf_index = 0;
log_mem_d[0].enable_flag = 1;
log_mem_d[1].buf_p = malloc(LOG_MEM_SIZE);
log_mem_d[1].buf_index = 0;
log_mem_d[1].enable_flag = 1;
log_mem_side = 0;
if ((pthread_mutex_init(&log_mem_lock, NULL) != 0) || (pthread_cond_init(&log_mem_notify, NULL) != 0)) {
log_mem_d[1].enable_flag=0;
return -1;
}
pthread_create(&log_mem_thread, NULL, (void *(*)(void *))flush_mem_to_file, (void *)NULL);
} else {
log_mem_d[0].buf_p = NULL;
log_mem_d[1].buf_p = NULL;
log_mem_d[0].enable_flag = 0;
log_mem_d[1].enable_flag = 0;
}
pthread_create(&log_mem_thread, NULL, (void *(*)(void *))flush_mem_to_file, (void *)NULL);
printf("log init done\n");
return 0;

View File

@@ -57,6 +57,8 @@
#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" {
@@ -85,6 +87,31 @@ extern "C" {
#define NUM_LOG_LEVEL 6 /*!< \brief the number of message levels users have with LOG (OAILOG_DISABLE is not available to user as a level, so it is not included)*/
/** @}*/
/** @defgroup _log_format Defined log format
* @ingroup _macro
* @brief Macro of log formats defined by LOG
* @{*/
/* .log_format = 0x13 uncolored standard messages
* .log_format = 0x93 colored standard messages */
/* keep white space in first position; switching it to 0 allows colors to be disabled*/
#define LOG_RED "\033[1;31m" /*!< \brief VT100 sequence for bold red foreground */
#define LOG_GREEN "\033[32m" /*!< \brief VT100 sequence for green foreground */
#define LOG_ORANGE "\033[93m" /*!< \brief VT100 sequence for orange foreground */
#define LOG_BLUE "\033[34m" /*!< \brief VT100 sequence for blue foreground */
#define LOG_CYBL "\033[40;36m" /*!< \brief VT100 sequence for cyan foreground on black background */
#define LOG_RESET "\033[0m" /*!< \brief VT100 sequence for reset (black) foreground */
#define FLAG_NOCOLOR 0x0001 /*!< \brief use colors in log messages, depending on level */
#define FLAG_THREAD 0x0008 /*!< \brief display thread name in log messages */
#define FLAG_LEVEL 0x0010 /*!< \brief display log level in log messages */
#define FLAG_FUNCT 0x0020
#define FLAG_FILE_LINE 0x0040
#define FLAG_TIME 0x0100
#define FLAG_THREAD_ID 0x0200
#define FLAG_REAL_TIME 0x0400
#define FLAG_INITIALIZED 0x8000
/** @}*/
#define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O)
#define CLEAR_LOG_OPTION(O) g_log->flag = (g_log->flag & (~O))
@@ -113,78 +140,100 @@ extern "C" {
#define DEBUG_DLSCH_DECOD (1<<14)
#define UE_TIMING (1<<20)
#define LOG_MASKMAP_INIT {\
{"PRACH", DEBUG_PRACH},\
{"RU", DEBUG_RU},\
{"UE_PHYPROC", DEBUG_UE_PHYPROC},\
{"LTEESTIM", DEBUG_LTEESTIM},\
{"DLCELLSPEC", DEBUG_DLCELLSPEC},\
{"ULSCH", DEBUG_ULSCH},\
{"RRC", DEBUG_RRC},\
{"PDCP", DEBUG_PDCP},\
{"DFT", DEBUG_DFT},\
{"ASN1", DEBUG_ASN1},\
{"CTRLSOCKET", DEBUG_CTRLSOCKET},\
{"SECURITY", DEBUG_SECURITY},\
{"NAS", DEBUG_NAS},\
{"RLC", DEBUG_RLC},\
{"DLSCH_DECOD", DEBUG_DLSCH_DECOD},\
{"UE_TIMING", UE_TIMING},\
{NULL,-1}\
}
#define SET_LOG_DEBUG(B) g_log->debug_mask = (g_log->debug_mask | B)
#define CLEAR_LOG_DEBUG(B) g_log->debug_mask = (g_log->debug_mask & (~B))
#define SET_LOG_DUMP(B) g_log->dump_mask = (g_log->dump_mask | B)
#define CLEAR_LOG_DUMP(B) g_log->dump_mask = (g_log->dump_mask & (~B))
#define FOREACH_COMP(COMP_DEF) \
COMP_DEF(PHY, log) \
COMP_DEF(MAC, log) \
COMP_DEF(EMU, log) \
COMP_DEF(SIM, txt) \
COMP_DEF(OMG, csv) \
COMP_DEF(OPT, log) \
COMP_DEF(OTG, log) \
COMP_DEF(OTG_LATENCY, dat) \
COMP_DEF(OTG_LATENCY_BG, dat) \
COMP_DEF(OTG_GP, dat) \
COMP_DEF(OTG_GP_BG, dat) \
COMP_DEF(OTG_JITTER, dat) \
COMP_DEF(RLC, ) \
COMP_DEF(PDCP, ) \
COMP_DEF(RRC, ) \
COMP_DEF(NAS, log) \
COMP_DEF(OIP, ) \
COMP_DEF(CLI, ) \
COMP_DEF(OCM, ) \
COMP_DEF(GTPU, ) \
COMP_DEF(SDAP, ) \
COMP_DEF(SPGW, ) \
COMP_DEF(S1AP, ) \
COMP_DEF(F1AP, ) \
COMP_DEF(E1AP, ) \
COMP_DEF(SCTP, ) \
COMP_DEF(HW, ) \
COMP_DEF(OSA, ) \
COMP_DEF(ENB_APP, log) \
COMP_DEF(MCE_APP, log) \
COMP_DEF(MME_APP, log) \
COMP_DEF(TMR, ) \
COMP_DEF(USIM, log) \
COMP_DEF(F1U, ) \
COMP_DEF(X2AP, ) \
COMP_DEF(XNAP, ) \
COMP_DEF(M2AP, ) \
COMP_DEF(M3AP, ) \
COMP_DEF(NGAP, ) \
COMP_DEF(GNB_APP, log) \
COMP_DEF(NR_RRC, log) \
COMP_DEF(NR_MAC, log) \
COMP_DEF(NR_MAC_DCI, log) \
COMP_DEF(NR_PHY_DCI, log) \
COMP_DEF(NR_PHY, log) \
COMP_DEF(LOADER, log) \
COMP_DEF(ASN1, log) \
COMP_DEF(NFAPI_VNF, log) \
COMP_DEF(NFAPI_PNF, log) \
COMP_DEF(ITTI, log) \
COMP_DEF(UTIL, log) \
COMP_DEF(MAX_LOG_PREDEF_COMPONENTS, )
#define COMP_ENUM(comp, file_extension) comp,
typedef enum { FOREACH_COMP(COMP_ENUM) } comp_name_t;
#define COMP_TEXT(comp, file_extension) #comp,
static const char *const comp_name[] = {FOREACH_COMP(COMP_TEXT)};
#define COMP_EXTENSION(comp, file_extension) #file_extension,
static const char *const comp_extension[] = {FOREACH_COMP(COMP_EXTENSION)};
typedef enum {
MIN_LOG_COMPONENTS = 0,
PHY = MIN_LOG_COMPONENTS,
MAC,
EMU,
SIM,
OMG,
OPT,
OTG,
OTG_LATENCY,
OTG_LATENCY_BG,
OTG_GP,
OTG_GP_BG,
OTG_JITTER,
RLC,
PDCP,
RRC,
NAS,
PERF,
OIP,
CLI,
OCM,
UDP_,
GTPU,
SDAP,
SPGW,
S1AP,
F1AP,
E1AP,
SCTP,
HW,
OSA,
RAL_ENB,
RAL_UE,
ENB_APP,
MCE_APP,
MME_APP,
TMR,
USIM,
LOCALIZE,
F1U,
X2AP,
M2AP,
M3AP,
NGAP,
GNB_APP,
NR_RRC,
NR_MAC,
NR_PHY,
LOADER,
ASN1,
NFAPI_VNF,
NFAPI_PNF,
ITTI,
UTIL,
MAX_LOG_PREDEF_COMPONENTS,
}
comp_name_t;
#define MAX_LOG_DYNALLOC_COMPONENTS 20
#define MAX_LOG_COMPONENTS (MAX_LOG_PREDEF_COMPONENTS + MAX_LOG_DYNALLOC_COMPONENTS)
typedef struct {
char *name; /*!< \brief string name of item */
int value; /*!< \brief integer value of mapping */
@@ -192,24 +241,23 @@ typedef struct {
typedef int(*log_vprint_func_t)(FILE *stream, const char *format, va_list ap );
typedef int(*log_print_func_t)(FILE *stream, const char *format, ... );
typedef struct {
int savedlevel;
char *filelog_name;
} log_component_back_t;
typedef struct {
const char *name;
int level;
int filelog;
int level;
int savedlevel;
int flag;
int filelog;
char *filelog_name;
FILE *stream;
log_vprint_func_t vprint;
log_print_func_t print;
log_print_func_t print;
/* SR: make the log buffer component relative */
char log_buffer[MAX_LOG_TOTAL];
} log_component_t;
typedef struct {
log_component_t log_component[MAX_LOG_COMPONENTS];
log_component_back_t log_rarely_used[MAX_LOG_COMPONENTS];
char level2string[NUM_LOG_LEVEL];
int flag;
char *filelog_name;
@@ -217,6 +265,8 @@ typedef struct {
uint64_t dump_mask;
} log_t;
#ifdef LOG_MAIN
log_t *g_log;
#else
@@ -228,7 +278,8 @@ extern "C" {
}
#endif
#endif
/*--- INCLUDES ---------------------------------------------------------------*/
# include "log_if.h"
/*----------------------------------------------------------------------------*/
int logInit (void);
void logTerm (void);
@@ -239,9 +290,6 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char
int set_log(int component, int level);
void set_glog(int level);
mapping * log_level_names_ptr(void);
mapping * log_option_names_ptr(void);
mapping * log_maskmap_ptr(void);
void set_glog_onlinelog(int enable);
void set_glog_filelog(int enable);
void set_component_filelog(int comp);
@@ -250,11 +298,21 @@ void set_component_consolelog(int comp);
int map_str_to_int(const mapping *map, const char *str);
char *map_int_to_str(const mapping *map, const int val);
void logClean (void);
int is_newline( char *str, int size);
int register_log_component(const char *name, const char *fext, int compidx);
int register_log_component(char *name, char *fext, int compidx);
int logInit_log_mem(char*);
#define LOG_MEM_SIZE 100*1024*1024
#define LOG_MEM_FILE "./logmem.log"
void flush_mem_to_file(void);
int logInit_log_mem(void);
void close_log_mem(void);
typedef struct {
char* buf_p;
int buf_index;
int enable_flag;
} log_mem_cnt_t;
/** @}*/
@@ -307,6 +365,9 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
" level: add log level indication in log messages\n"\
" thread: add threads names in log messages\n"
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* LOG global configuration parameters */
/* optname help paramflags XXXptr defXXXval type numelt */
@@ -335,166 +396,41 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# if T_TRACER
#include "T.h"
/* per component, level dependent macros */
#define LOG_E(c, x...) \
do { \
T(T_LEGACY_##c##_ERROR, T_PRINTF(x)); \
if (T_stdout) { \
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 { \
T(T_LEGACY_##c##_WARNING, T_PRINTF(x)); \
if (T_stdout) { \
if (g_log->log_component[c].level >= OAILOG_WARNING) \
logRecord_mt(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_WARNING, x); \
} \
} while (0)
#define LOG_A(c, x...) \
do { \
T(T_LEGACY_##c##_INFO, T_PRINTF(x)); \
if (T_stdout) { \
if (g_log->log_component[c].level >= OAILOG_ANALYSIS) \
logRecord_mt(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_ANALYSIS, x); \
} \
} while (0)
#define LOG_I(c, x...) \
do { \
T(T_LEGACY_##c##_INFO, T_PRINTF(x)); \
if (T_stdout) { \
if (g_log->log_component[c].level >= OAILOG_INFO) \
logRecord_mt(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_INFO, x); \
} \
} while (0)
#define LOG_D(c, x...) \
do { \
T(T_LEGACY_##c##_DEBUG, T_PRINTF(x)); \
if (T_stdout) { \
if (g_log->log_component[c].level >= OAILOG_DEBUG) \
logRecord_mt(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_DEBUG, x); \
} \
} while (0)
#define LOG_DDUMP(c, b, s, f, x...) \
do { \
T(T_LEGACY_##c##_DEBUG, T_PRINTF(x)); \
if (T_stdout) { \
if (g_log->log_component[c].level >= OAILOG_DEBUG) \
log_dump(c, b, s, f, x); \
} \
} while (0)
#define LOG_T(c, x...) \
do { \
T(T_LEGACY_##c##_TRACE, T_PRINTF(x)); \
if (T_stdout) { \
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 (T_stdout) { \
if (g_log->log_component[c].level >= l) \
vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__, c, l, f, args); \
} \
} while (0)
# define LOG_E(c, x...) do { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ; if (T_stdout) { 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 { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)); if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} } while (0)
# define LOG_A(c, x...) do { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ANALYSIS) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ANALYSIS, x);} } while (0)
# define LOG_I(c, x...) do { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} } while (0)
# define LOG_D(c, x...) do { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ; if (T_stdout) { 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 { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ; if (T_stdout) { 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 (T_stdout) { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ;} } while (0)
/* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */
#define LOG_DUMPMSG(c, f, b, s, x...) \
do { \
if (g_log->dump_mask & f) \
log_dump(c, b, s, LOG_DUMP_CHAR, x); \
} while (0)
# define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */
/* bitmask dependent macros, to isolate debugging code */
#define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
# define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
/* bitmask dependent macros, to generate debug file such as matlab file or message dump */
#define LOG_DUMPFLAG(D) (g_log->dump_mask & D)
#define LOG_M(file, vector, data, len, dec, format) \
do { \
write_file_matlab(file, vector, data, len, dec, format, 0); \
} while (0)
# define LOG_DUMPFLAG(D) (g_log->dump_mask & D)
# define LOG_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format, 0);} while(0)/* */
/* define variable only used in LOG macro's */
#define LOG_VAR(A, B) A B
# define LOG_VAR(A,B) A B
# else /* T_TRACER */
# 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_A(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ANALYSIS) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ANALYSIS, 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_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)
#else /* no T_TRACER */
# define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
# define LOG_DEBUGFLAG(D) (g_log->dump_mask & D)
# define LOG_DUMPFLAG(D) (g_log->debug_mask & D)
# define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */
#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_A(c, x...) \
do { \
if (g_log->log_component[c].level >= OAILOG_ANALYSIS) \
logRecord_mt(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_ANALYSIS, 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_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_DDUMP(c, b, s, f, x...) \
do { \
if (g_log->log_component[c].level >= OAILOG_DEBUG) \
log_dump(c, b, s, f, 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)
#define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
#define LOG_DEBUGFLAG(D) (g_log->dump_mask & D)
#define LOG_DUMPFLAG(D) (g_log->debug_mask & D)
#define LOG_DUMPMSG(c, f, b, s, x...) \
do { \
if (g_log->dump_mask & f) \
log_dump(c, b, s, LOG_DUMP_CHAR, x); \
} while (0) /* */
#define LOG_M(file, vector, data, len, dec, format) \
do { \
write_file_matlab(file, vector, data, len, dec, format, 0); \
} while (0)
#define LOG_VAR(A, B) A B
#define T_ACTIVE(a) (0)
#endif /* T_TRACER */
# define LOG_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format, 0);} while(0)
# define LOG_VAR(A,B) A B
# define T_ACTIVE(a) (0)
# endif /* T_TRACER */
/* avoid warnings for variables only used in LOG macro's but set outside debug section */
#define GCC_NOTUSED __attribute__((unused))

View File

@@ -19,16 +19,13 @@
* contact@openairinterface.org
*/
/*! \file xnap_gNB_itti_messaging.h
* \brief xnap itti messaging for gNB
* \date 2023 July
* \version 1.0
*/
#include "log.h"
#ifndef XNAP_GNB_ITTI_MESSAGING_H_
#define XNAP_GNB_ITTI_MESSAGING_H_
extern log_t *g_log;
void xnap_gNB_itti_send_sctp_data_req(sctp_assoc_t assoc_id, uint8_t *buffer, uint32_t buffer_length, uint16_t stream);
#endif /* XNAP_GNB_ITTI_MESSAGING_H_ */
extern const mapping log_level_names[];
extern const mapping log_options[];
extern const mapping log_maskmap[];
extern int log_mem_flag;
extern char * log_mem_filename;
extern char logmem_filename[1024];

View File

@@ -19,21 +19,16 @@
* contact@openairinterface.org
*/
/*! \file xnap_gNB_handler.h
* \brief xnap handler procedures for gNB
* \date 2023 July
* \version 1.0
*/
/*! \file log_if.h
* \brief log interface
* \author Navid Nikaein
* \date 2009 - 2014
* \version 0.3
* \warning This component can be runned only in user-space
* @ingroup routing
*/
#ifndef XNAP_GNB_HANDLERS_H_
#define XNAP_GNB_HANDLERS_H_
#include "xnap_gNB_defs.h"
int xnap_gNB_handle_message(instance_t instance,
sctp_assoc_t assoc_id,
int32_t stream,
const uint8_t *const data,
const uint32_t data_length);
#endif /* XNAP_GNB_HANDLERS_H_ */
// LTS: kept this file for compatibility
// this file was probably a trial to separate internal functions and external ones
// but it has never been finished, most source code include directly log.h (not log_if.h)
#include "log.h"

View File

@@ -361,48 +361,6 @@ ID = LEGACY_NR_MAC_TRACE
GROUP = ALL:LEGACY_NR_MAC:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_NR_PHY_DCI_INFO
DESC = NR_PHY_DCI legacy logs - info level
GROUP = ALL:LEGACY_NR_PHY_DCI:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NR_PHY_DCI_ERROR
DESC = NR_PHY_DCI legacy logs - error level
GROUP = ALL:LEGACY_NR_PHY_DCI:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NR_PHY_DCI_WARNING
DESC = NR_PHY_DCI legacy logs - warning level
GROUP = ALL:LEGACY_NR_PHY_DCI:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NR_PHY_DCI_DEBUG
DESC = NR_PHY_DCI legacy logs - debug level
GROUP = ALL:LEGACY_NR_PHY_DCI:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NR_PHY_DCI_TRACE
DESC = NR_PHY_DCI legacy logs - trace level
GROUP = ALL:LEGACY_NR_PHY_DCI:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_NR_MAC_DCI_INFO
DESC = NR_MAC_DCI legacy logs - info level
GROUP = ALL:LEGACY_NR_MAC_DCI:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NR_MAC_DCI_ERROR
DESC = NR_MAC_DCI legacy logs - error level
GROUP = ALL:LEGACY_NR_MAC_DCI:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NR_MAC_DCI_WARNING
DESC = NR_MAC_DCI legacy logs - warning level
GROUP = ALL:LEGACY_NR_MAC_DCI:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NR_MAC_DCI_DEBUG
DESC = NR_MAC_DCI legacy logs - debug level
GROUP = ALL:LEGACY_NR_MAC_DCI:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NR_MAC_DCI_TRACE
DESC = NR_MAC_DCI legacy logs - trace level
GROUP = ALL:LEGACY_NR_MAC_DCI:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_PHY_INFO
DESC = PHY legacy logs - info level
GROUP = ALL:LEGACY_PHY:LEGACY_GROUP_INFO:LEGACY
@@ -1240,27 +1198,6 @@ ID = LEGACY_E1AP_ERROR
GROUP = ALL:LEGACY_E1AP:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_XNAP_TRACE
DESC = XNAP TRACE LEVEL
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_XNAP_DEBUG
DESC = XNAP DEBUG LEVEL
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_XNAP_INFO
DESC = XNAP INFO LEVEL
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_XNAP_WARNING
DESC = XNAP WARNING LEVEL
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_XNAP_ERROR
DESC = XNAP ERROR LEVEL
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
#################
#### UE LOGS ####
#################

View File

@@ -1,6 +1,8 @@
add_library(tracer_utils OBJECT configuration.c database.c event.c handler.c utils.c)
target_link_libraries(tracer_utils PUBLIC m pthread)
add_library(tracer_events OBJECT event_selector.c)
add_executable(record record.c)
target_link_libraries(record PRIVATE tracer_utils)
@@ -26,19 +28,10 @@ add_executable(multi multi.c)
target_link_libraries(multi PRIVATE tracer_utils T)
target_include_directories(multi PRIVATE ..)
add_executable(textlog textlog.c)
target_link_libraries(textlog PRIVATE tracer_utils tracer_filter
tracer_logger tracer_view)
add_subdirectory(filter)
add_subdirectory(logger)
add_subdirectory(view)
add_custom_target(T_tools)
add_dependencies(T_tools
record replay extract_config extract_input_subframe
extract_output_subframe extract macpdu2wireshark multi
textlog)
extract_output_subframe extract macpdu2wireshark multi)
add_dependencies(nr-softmodem T_tools)
add_dependencies(nr-uesoftmodem T_tools)
add_dependencies(lte-softmodem T_tools)
@@ -49,7 +42,9 @@ add_dependencies(lte-uesoftmodem T_tools)
# GUI-related tools so they can be added on demand, if necessary.
add_boolean_option(T_TRACER_GUI OFF "Compile T tracer GUI tools" OFF)
if(T_TRACER_GUI)
add_library(tracer_events OBJECT event_selector.c)
add_executable(textlog textlog.c)
target_link_libraries(textlog PRIVATE tracer_utils tracer_filter tracer_gui
tracer_logger tracer_view tracer_events)
find_library(png png REQUIRED)
add_executable(enb enb.c)
@@ -76,6 +71,9 @@ if(T_TRACER_GUI)
tracer_logger tracer_view tracer_events)
add_subdirectory(gui)
add_subdirectory(filter)
add_subdirectory(logger)
add_subdirectory(view)
add_dependencies(T_tools enb gnb ue vcd to_vcd)
add_dependencies(T_tools textlog enb gnb ue vcd to_vcd)
endif()

View File

@@ -31,8 +31,9 @@ extract: extract.o database.o event.o utils.o configuration.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
textlog: utils.o textlog.o database.o event.o handler.o configuration.o \
view/view.a logger/logger.a filter/filter.a
$(CC) $(CFLAGS) -o textlog $^ $(LIBS)
event_selector.o view/view.a gui/gui.a logger/logger.a \
filter/filter.a
$(CC) $(CFLAGS) -o textlog $^ $(LIBS) $(XLIBS)
enb: utils.o enb.o database.o event.o handler.o configuration.o \
event_selector.o view/view.a gui/gui.a logger/logger.a \

View File

@@ -1,24 +1,42 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <signal.h>
#include "database.h"
#include "event.h"
#include "handler.h"
#include "logger/logger.h"
#include "view/view.h"
#include "gui/gui.h"
#include "utils.h"
#include "event_selector.h"
#include "configuration.h"
void activate_traces(int socket, int *is_on, int nevents)
typedef struct {
int socket;
int *is_on;
int nevents;
pthread_mutex_t lock;
} textlog_data;
void is_on_changed(void *_d)
{
textlog_data *d = _d;
char t;
if (pthread_mutex_lock(&d->lock)) abort();
if (d->socket == -1) goto no_connection;
t = 1;
if (socket_send(socket, &t, 1) == -1 ||
socket_send(socket, &nevents, sizeof(int)) == -1 ||
socket_send(socket, is_on, nevents * sizeof(int)) == -1)
if (socket_send(d->socket, &t, 1) == -1 ||
socket_send(d->socket, &d->nevents, sizeof(int)) == -1 ||
socket_send(d->socket, d->is_on, d->nevents * sizeof(int)) == -1)
abort();
no_connection:
if (pthread_mutex_unlock(&d->lock)) abort();
}
void usage(void)
@@ -36,18 +54,28 @@ void usage(void)
" -full also dump buffers' content\n"
" -raw-time also prints 'raw time'\n"
" -ip <host> connect to given IP address (default %s)\n"
" -p <port> connect to given port (default %d)\n",
" -p <port> connect to given port (default %d)\n"
" -x GUI output\n"
" -debug-gui activate GUI debug logs\n"
" -no-gui disable GUI entirely\n",
DEFAULT_REMOTE_IP,
DEFAULT_REMOTE_PORT
);
exit(1);
}
static void *gui_thread(void *_g)
{
gui *g = _g;
gui_loop(g);
return NULL;
}
int main(int n, char **v)
{
extern int volatile gui_logd;
char *database_filename = NULL;
void *database;
int socket;
char *ip = DEFAULT_REMOTE_IP;
int port = DEFAULT_REMOTE_PORT;
char **on_off_name;
@@ -58,7 +86,11 @@ int main(int n, char **v)
int i;
event_handler *h;
logger *textlog;
gui *g = NULL; /* initialization not necessary but gcc is not happy */
int gui_mode = 0;
view *out;
int gui_active = 1;
textlog_data textlog_data;
int full = 0;
int raw_time = 0;
@@ -83,11 +115,16 @@ int main(int n, char **v)
{ on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=1; continue; }
if (!strcmp(v[i], "-OFF"))
{ on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=0; continue; }
if (!strcmp(v[i], "-x")) { gui_mode = 1; continue; }
if (!strcmp(v[i], "-debug-gui")) { gui_logd = 1; continue; }
if (!strcmp(v[i], "-no-gui")) { gui_active = 0; continue; }
if (!strcmp(v[i], "-full")) { full = 1; continue; }
if (!strcmp(v[i], "-raw-time")) { raw_time = 1; continue; }
usage();
}
if (gui_active == 0) gui_mode = 0;
if (database_filename == NULL) {
printf("ERROR: provide a database file (-d)\n");
exit(1);
@@ -103,12 +140,29 @@ int main(int n, char **v)
h = new_handler(database);
out = new_view_stdout();
if (gui_active) {
g = gui_init();
new_thread(gui_thread, g);
}
if (gui_mode) {
widget *w, *win;
// w = new_textlist(g, 600, 20, 0);
w = new_textlist(g, 800, 50, BACKGROUND_COLOR);
win = new_toplevel_window(g, 800, 50*12, "textlog");
widget_add_child(g, win, w, -1);
out = new_view_textlist(1000, 10, g, w);
//tout = new_view_textlist(7, 4, g, w);
} else {
out = new_view_stdout();
}
for (i = 0; i < number_of_events; i++) {
char *name, *desc;
database_get_generic_description(database, i, &name, &desc);
textlog = new_textlog(h, database, name, desc);
// "ENB_PHY_UL_CHANNEL_ESTIMATE",
// "ev: {} eNB_id [eNB_ID] frame [frame] subframe [subframe]");
logger_add_view(textlog, out);
if (full) textlog_dump_buffer(textlog, 1);
if (raw_time) textlog_raw_time(textlog, 1);
@@ -119,21 +173,24 @@ int main(int n, char **v)
for (i = 0; i < on_off_n; i++)
on_off(database, on_off_name[i], is_on, on_off_action[i]);
socket = connect_to(ip, port);
if (socket == -1) {
printf("fatal: connection failed\n");
return 1;
}
textlog_data.socket = -1;
textlog_data.is_on = is_on;
textlog_data.nevents = number_of_events;
if (pthread_mutex_init(&textlog_data.lock, NULL)) abort();
if (gui_active)
setup_event_selector(g, database, is_on, is_on_changed, &textlog_data);
textlog_data.socket = connect_to(ip, port);
/* send the first message - activate selected traces */
activate_traces(socket, is_on, number_of_events);
is_on_changed(&textlog_data);
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
/* read messages */
while (1) {
event e;
e = get_event(socket, &ebuf, database);
e = get_event(textlog_data.socket, &ebuf, database);
if (e.type == -1) break;
handle_event(h, e);
}

View File

@@ -1,6 +0,0 @@
add_library(alg OBJECT
find.c
foreach.c
)
target_include_directories(alg PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

View File

@@ -1,49 +0,0 @@
/*
MIT License
Copyright (c) 2022 Mikel Irazabal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "find.h"
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
elm_arr_t find_if_arr_it(seq_arr_t* arr, void* start_it, void* end_it, void* value, bool (*f)(const void*, const void*))
{
assert(arr != NULL);
while (start_it != end_it) {
if (f(value, start_it))
return (elm_arr_t){.found = true, .it = start_it};
start_it = seq_arr_next(arr, start_it);
}
// If I trusted the average developer I should return it=start_it, but I don't.
return (elm_arr_t){.found = false, .it = NULL};
}
elm_arr_t find_if_arr(seq_arr_t* arr, void* value, bool (*f)(const void*, const void*))
{
assert(arr != NULL);
void* start_it = seq_arr_front(arr);
void* end_it = seq_arr_end(arr);
return find_if_arr_it(arr, start_it, end_it, value, f);
}

View File

@@ -1,58 +0,0 @@
/*
MIT License
Copyright (c) 2022 Mikel Irazabal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef FIND_ALGORITHM
#define FIND_ALGORITHM
#include <stdbool.h>
#include "../ds/seq_arr.h"
typedef struct {
void* it;
bool found;
} elm_arr_t;
// Sequencial containers
/**
* @brief Find elements in an array if the predicate is true
* @param arr The sequence container
* @param value Pointer to the value that will be used by the predicate
* @param f Function representing the predicate
* @return Whether the predicate was fullfilled and the iterator to the element if true
*/
elm_arr_t find_if_arr(seq_arr_t* arr, void* value, bool (*f)(const void* value, const void* it));
/**
* @brief Find elements in an array in the semi-open range [start_it, end_it)
* @param arr The sequence container
* @param start_it Iterator to the first element
* @param end_it Iterator to the one past last element
* @param value Pointer to the value usied in the predicate
* @param f Function representing the predicate
* @return Whether the predicate was fullfilled and the iterator to the element if true
*/
elm_arr_t find_if_arr_it(seq_arr_t* arr, void* start_it, void* end_it, void* value, bool (*f)(const void* value, const void* it));
#endif

View File

@@ -1,40 +0,0 @@
/*
MIT License
Copyright (c) 2022 Mikel Irazabal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "foreach.h"
#include <assert.h>
#include <stdlib.h>
void for_each(seq_arr_t* arr, void* value, void (*f)(void* value, void* it))
{
assert(arr != NULL);
void* it = seq_arr_front(arr);
void* end = seq_arr_end(arr);
while (it != end) {
f(value, it);
it = seq_arr_next(arr, it);
}
}

View File

@@ -1,38 +0,0 @@
/*
MIT License
Copyright (c) 2022 Mikel Irazabal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef FOR_EACH_ALGORITHM
#define FOR_EACH_ALGORITHM
#include "../ds/seq_arr.h"
/**
* @brief Apply function to each element in the sequence container
* @param arr The sequence container
* @param value Pointer to the value that will be used by the function applied
* @param fn_apply Function called by every element in the sequence container
*/
void for_each(seq_arr_t* arr, void* value, void (*fn_apply)(void* value, void* it));
#endif

View File

@@ -1,10 +1,5 @@
add_library(ds OBJECT
byte_array.c
seq_arr.c
)
target_include_directories(ds PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
if(ENABLE_TESTS)
add_subdirectory(tests)
endif()

View File

@@ -1,190 +0,0 @@
/*
MIT License
Copyright (c) 2022 Mikel Irazabal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "seq_arr.h"
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
static const size_t MIN_SIZE = 8;
static void maybe_expand(seq_arr_t* arr)
{
if (arr->size + 1 == arr->cap) {
arr->data = realloc(arr->data, 2 * arr->cap * arr->elt_size);
assert(arr->data != NULL && "realloc failed to allocate memory");
arr->cap *= 2;
}
}
static void maybe_shrink(seq_arr_t* arr)
{
const float occ = (float)arr->size / (float)arr->cap;
if (arr->size > MIN_SIZE && occ < 0.25) {
assert(arr->cap > MIN_SIZE);
seq_arr_t tmp = {.data = NULL, .size = arr->size, .elt_size = arr->elt_size, .cap = arr->cap / 2};
tmp.data = calloc(tmp.cap, tmp.cap);
assert(tmp.data != NULL && "Memory exhausted");
assert(arr->size <= tmp.cap);
memcpy(tmp.data, arr->data, arr->size * arr->elt_size);
free(arr->data);
memcpy(arr, &tmp, sizeof(seq_arr_t));
}
}
void seq_arr_init(seq_arr_t* arr, size_t elt_size) //__attribute__(malloc)
{
assert(arr != NULL);
seq_arr_t tmp = {.data = NULL, .size = 0, .elt_size = elt_size, .cap = MIN_SIZE};
memcpy(arr, &tmp, sizeof(seq_arr_t));
arr->data = calloc(arr->cap, elt_size);
assert(arr->data != NULL);
}
void seq_arr_free(seq_arr_t* arr, void (*free_func)(void*))
{
assert(arr != NULL);
assert(arr->data != NULL);
if (free_func != NULL) {
void* start_it = seq_arr_front(arr);
void* end_it = seq_arr_end(arr);
while (start_it != end_it) {
free_func(start_it);
start_it = seq_arr_next(arr, start_it);
}
}
free(arr->data);
}
void seq_arr_push_back(seq_arr_t* arr, void* data, size_t len)
{
assert(arr != NULL);
assert(arr->data != NULL);
// assert(data != NULL);
assert(len == arr->elt_size);
maybe_expand(arr);
const size_t offset = arr->size * arr->elt_size;
memcpy(&arr->data[offset], data, arr->elt_size);
arr->size += 1;
}
void seq_arr_erase(seq_arr_t* arr, void* start_it)
{
// start_it must be in the range of arr->data
assert(arr != NULL);
assert(start_it != NULL);
return seq_arr_erase_deep(arr, start_it, NULL);
}
void seq_arr_erase_deep(seq_arr_t* arr, void* start_it, void (*free_func)(void* it))
{
// start_it must be in the range of arr->data
assert(arr != NULL);
assert(start_it != NULL);
return seq_arr_erase_it(arr, start_it, seq_arr_next(arr, start_it), free_func);
}
void seq_arr_erase_it(seq_arr_t* arr, void* start_it, void* end_it, void (*free_func)(void* it))
{
// start_it && end_it must be in the range of arr->data
assert(arr != NULL);
assert(start_it != NULL);
assert(end_it != NULL);
assert(end_it >= start_it);
if (start_it == end_it)
return;
if (free_func != NULL) {
void* start_it = seq_arr_front(arr);
void* end_it = seq_arr_end(arr);
while (start_it != end_it) {
free_func(start_it);
start_it = seq_arr_next(arr, start_it);
}
}
const int num_bytes_move = seq_arr_end(arr) - end_it;
assert(num_bytes_move > -1);
memmove(start_it, end_it, num_bytes_move);
const int num_bytes_erase = end_it - start_it;
const int32_t num_elm_erase = num_bytes_erase / arr->elt_size;
assert(num_elm_erase > 0);
arr->size -= num_elm_erase;
memset(seq_arr_end(arr), 0, num_bytes_erase);
maybe_shrink(arr);
}
size_t seq_arr_size(seq_arr_t const* arr)
{
assert(arr != NULL);
return arr->size;
}
void* seq_arr_front(seq_arr_t const* arr)
{
assert(arr != NULL);
return arr->data;
}
void* seq_arr_next(seq_arr_t const* arr, void const* it)
{
assert(arr != NULL);
assert(it != NULL);
return (uint8_t*)it + arr->elt_size;
}
void* seq_arr_end(seq_arr_t const* arr)
{
assert(arr != NULL);
assert(arr->data != NULL);
return &arr->data[arr->size * arr->elt_size];
}
void* seq_arr_at(seq_arr_t const* arr, uint32_t pos)
{
assert(arr != NULL);
assert(arr->data != NULL);
assert(pos < arr->size);
return arr->data + pos * arr->elt_size;
}
ptrdiff_t seq_arr_dist(seq_arr_t const* arr, void const* first, void const* last)
{
assert(arr != NULL);
assert(first != NULL);
assert(last != NULL);
const ptrdiff_t pos = (last - first) / arr->elt_size;
assert(pos > -1);
return pos;
}

View File

@@ -1,144 +0,0 @@
/*
MIT License
Copyright (c) 2022 Mikel Irazabal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef SEQ_CONTAINER_ARRAY
#define SEQ_CONTAINER_ARRAY
/*
* Basic sequence container with a similar API and behaviour to C++ std::vector
*/
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
typedef struct seq_arr_s {
uint8_t* data;
size_t size;
const size_t elt_size;
size_t cap;
} seq_arr_t;
/**
* Init a sequence container, similar to a constructor
* @brief Constructor.
* @param arr The sequence container
* @param elm_sz value returned by the sizeof operator of the type that the container will hold e.g., sizeof(int).
*/
void seq_arr_init(seq_arr_t* arr, size_t elm_sz);
/**
* Free a sequence container, similar to a destructor
* @brief Destructor.
* @param arr The sequence container
* @param free_func Function called for every element while destructing e.g., useful to free memory of deep objects.
*/
void seq_arr_free(seq_arr_t* arr, void (*free_func)(void* it));
/**
* @brief Push back elements into the sequence container. Value semantic. i.e., the void* data will be shallowly copied in the
* array.
* @param arr The sequence container
* @param data Pointer to the data to be copied
* @param elm_sz Size of the element to be copied e.g., sizeof(int)
*/
void seq_arr_push_back(seq_arr_t* arr, void* data, size_t elm_sz);
/**
* @brief Erase the element pointed by it
* @param arr The sequence container
* @param it Iterator to the element to erase
*/
void seq_arr_erase(seq_arr_t*, void* it);
/**
* @brief Erase the element pointed by it and call the f function. Useful to free deep copies
* @param arr The sequence container
* @param it Iterator to the element to erase
* @param free_func Function to call while erasing element
*/
void seq_arr_erase_deep(seq_arr_t* arr, void* it, void (*free_func)(void* it));
/**
* @brief Erase the elements in the semi-open range [first,last)
* @param arr The sequence container
* @param first Iterator to the first element to erase
* @param last Iterator to the last element. Note that this element will NOT be erased
* @param f Function that will be called by every element while erasing. Useful for deep copies. Pass NULL if shallow
* erased required
*/
void seq_arr_erase_it(seq_arr_t* arr, void* first, void* last, void (*free_func)(void* it));
/**
* @brief Elements in the array
* @param arr The sequence container
* @return The number of elements in the sequence container
*/
size_t seq_arr_size(seq_arr_t const* arr);
/////
// Iterators
/////
/**
* @brief First iterator
* @param arr The sequence container
* @return The iterator to the first element in the sequence container
*/
void* seq_arr_front(seq_arr_t const* arr);
/**
* @brief Next iterator
* @param arr The sequence container
* @param it Iterator to a valid element
* @return The iterator to the next element in the sequence container
*/
void* seq_arr_next(seq_arr_t const* arr, void const* it);
/**
* @brief End iterator
* @param arr The sequence container
* @return The iterator to one past the last element in the sequence container
*/
void* seq_arr_end(seq_arr_t const* arr);
/**
* @brief Returns iterator in positions pos
* @param arr The sequence container
* @param pos The position of the element in the sequence container
* @return The iterator to the element
*/
void* seq_arr_at(seq_arr_t const* arr, uint32_t pos);
/**
* @brief Distance between iterators
* @param arr The sequence container
* @param first Iterator to first element
* @param last Iterator to last element
* @return The distance among iterators
*/
ptrdiff_t seq_arr_dist(seq_arr_t const* arr, void const* first, void const* last);
#endif

View File

@@ -1,4 +0,0 @@
add_executable(test_seq_arr test_seq_array.c)
target_link_libraries(test_seq_arr ds alg)
add_dependencies(tests test_seq_arr)
add_test(NAME test_seq_arr COMMAND test_seq_arr) # no options required

View File

@@ -1,90 +0,0 @@
#include "../seq_arr.h"
#include "../../alg/find.h"
#include "../../alg/foreach.h"
#include <assert.h>
/*
Example to show seq_arr_t capabilities and usage
To compile: gcc test_seq_array.c ../seq_arr.c ../../alg/find.c ../../alg/foreach.c
*/
static bool eq_int(const void* value, const void* it)
{
const int* v = (const int*)value;
const int* i = (const int*)it;
return *v == *i;
}
static void sum_elm(void* value, void* it)
{
int* sum = (int*)value;
int* elm = (int*)it;
*sum += *elm;
}
static int compar(const void* m0, const void* m1)
{
int* a = (int*)m0;
int* b = (int*)m1;
if (*a < *b)
return -1;
if (*a == *b)
return 0;
return 1;
}
int main()
{
seq_arr_t arr = {0};
seq_arr_init(&arr, sizeof(int));
// Insert data and expand
for (int i = 0; i < 100; ++i)
seq_arr_push_back(&arr, &i, sizeof(int));
// Check inserted data
assert(seq_arr_size(&arr) == 100);
assert(*(int*)seq_arr_front(&arr) == 0);
assert(*(int*)seq_arr_at(&arr, 25) == 25);
// Find element in the array
int value = 50;
elm_arr_t elm = find_if_arr(&arr, &value, eq_int);
assert(elm.found == true);
// Check
assert(*(int*)elm.it == 50);
assert(seq_arr_dist(&arr, seq_arr_front(&arr), elm.it) == 50);
// Apply predicate to all the elements
int sum = 0;
for_each(&arr, &sum, sum_elm);
assert(sum == 4950); // N*(N+1)/2 -> 99*100/2
// Erase found element in the array
seq_arr_erase(&arr, elm.it);
// Check
assert(seq_arr_size(&arr) == 99);
assert(*(int*)seq_arr_at(&arr, 50) == 51);
// Erase range and force shrink
seq_arr_erase_it(&arr, seq_arr_front(&arr), seq_arr_at(&arr, 90), NULL);
assert(seq_arr_size(&arr) == 9);
assert(*(int*)seq_arr_front(&arr) == 91);
// Recall that C functions qsort and bsearch, also work
int key = 95;
void* base = seq_arr_front(&arr);
size_t nmemb = seq_arr_size(&arr);
size_t size = sizeof(int);
void* it = bsearch(&key, base, nmemb, size, compar);
assert(seq_arr_dist(&arr, seq_arr_front(&arr), it) == 4);
// Free data structure
seq_arr_free(&arr, NULL);
return EXIT_SUCCESS;
}

View File

@@ -376,115 +376,6 @@ int get_nb_periods_per_frame(uint8_t tdd_period)
return nb_periods_per_frame;
}
void get_delta_arfcn(int i, uint32_t nrarfcn, uint64_t N_OFFs)
{
uint32_t delta_arfcn = nrarfcn - N_OFFs;
if(delta_arfcn % (nr_bandtable[i].step_size) != 0)
LOG_E(NR_MAC, "nrarfcn %u is not on the channel raster for step size %lu\n", nrarfcn, nr_bandtable[i].step_size);
}
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw)
{
uint64_t dl_CarrierFreq_by_1k = dl_CarrierFreq / 1000;
int bw_kHz = bw / 1000;
uint32_t nrarfcn;
int i = get_nr_table_idx(nr_bandP, scs_index);
LOG_D(NR_MAC, "Searching for nr band %d DL Carrier frequency %llu bw %u\n", nr_bandP, (long long unsigned int)dl_CarrierFreq, bw);
AssertFatal(dl_CarrierFreq_by_1k >= nr_bandtable[i].dl_min,
"Band %d, bw %u : DL carrier frequency %llu kHz < %llu\n",
nr_bandP, bw, (long long unsigned int)dl_CarrierFreq_by_1k,
(long long unsigned int)nr_bandtable[i].dl_min);
AssertFatal(dl_CarrierFreq_by_1k <= (nr_bandtable[i].dl_max - bw_kHz/2),
"Band %d, dl_CarrierFreq %llu bw %u: DL carrier frequency %llu kHz > %llu\n",
nr_bandP, (long long unsigned int)dl_CarrierFreq,bw, (long long unsigned int)dl_CarrierFreq_by_1k,
(long long unsigned int)(nr_bandtable[i].dl_max - bw_kHz/2));
int deltaFglobal = 60;
uint32_t N_REF_Offs = 2016667;
uint64_t F_REF_Offs_khz = 24250080;
if (dl_CarrierFreq < 24.25e9) {
deltaFglobal = 15;
N_REF_Offs = 600000;
F_REF_Offs_khz = 3000000;
}
if (dl_CarrierFreq < 3e9) {
deltaFglobal = 5;
N_REF_Offs = 0;
F_REF_Offs_khz = 0;
}
// This is equation before Table 5.4.2.1-1 in 38101-1-f30
// F_REF=F_REF_Offs + deltaF_Global(N_REF-NREF_REF_Offs)
nrarfcn = (((dl_CarrierFreq_by_1k - F_REF_Offs_khz) / deltaFglobal) + N_REF_Offs);
//get_delta_arfcn(i, nrarfcn, nr_bandtable[i].N_OFFs_DL);
return nrarfcn;
}
// This function computes the RF reference frequency from the NR-ARFCN according to 5.4.2.1 of 3GPP TS 38.104
// this function applies to both DL and UL
uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t nrarfcn)
{
int deltaFglobal = 5;
uint32_t N_REF_Offs = 0;
uint64_t F_REF_Offs_khz = 0;
uint64_t N_OFFs, frequency, freq_min;
int i = get_nr_table_idx(nr_bandP, scs_index);
if (nrarfcn > 599999 && nrarfcn < 2016667) {
deltaFglobal = 15;
N_REF_Offs = 600000;
F_REF_Offs_khz = 3000000;
}
if (nrarfcn > 2016666 && nrarfcn < 3279166) {
deltaFglobal = 60;
N_REF_Offs = 2016667;
F_REF_Offs_khz = 24250080;
}
int32_t delta_duplex = get_delta_duplex(nr_bandP, scs_index);
if (delta_duplex <= 0){ // DL band >= UL band
if (nrarfcn >= nr_bandtable[i].N_OFFs_DL){ // is TDD of FDD DL
N_OFFs = nr_bandtable[i].N_OFFs_DL;
freq_min = nr_bandtable[i].dl_min;
} else {// is FDD UL
N_OFFs = nr_bandtable[i].N_OFFs_DL + delta_duplex/deltaFglobal;
freq_min = nr_bandtable[i].ul_min;
}
} else { // UL band > DL band
if (nrarfcn >= nr_bandtable[i].N_OFFs_DL + delta_duplex / deltaFglobal){ // is FDD UL
N_OFFs = nr_bandtable[i].N_OFFs_DL + delta_duplex / deltaFglobal;
freq_min = nr_bandtable[i].ul_min;
} else { // is FDD DL
N_OFFs = nr_bandtable[i].N_OFFs_DL;
freq_min = nr_bandtable[i].dl_min;
}
}
LOG_D(NR_MAC, "Frequency from NR-ARFCN for N_OFFs %lu, duplex spacing %d KHz, deltaFglobal %d KHz\n",
N_OFFs,
delta_duplex,
deltaFglobal);
AssertFatal(nrarfcn >= N_OFFs,"nrarfcn %u < N_OFFs[%d] %llu\n", nrarfcn, nr_bandtable[i].band, (long long unsigned int)N_OFFs);
get_delta_arfcn(i, nrarfcn, N_OFFs);
frequency = 1000 * (F_REF_Offs_khz + (nrarfcn - N_REF_Offs) * deltaFglobal);
LOG_D(NR_MAC, "Computing frequency (nrarfcn %llu => %llu KHz (freq_min %llu KHz, NR band %d N_OFFs %llu))\n",
(unsigned long long)nrarfcn,
(unsigned long long)frequency/1000,
(unsigned long long)freq_min,
nr_bandP,
(unsigned long long)N_OFFs);
return frequency;
}
int get_first_ul_slot(int nrofDownlinkSlots, int nrofDownlinkSymbols, int nrofUplinkSymbols)
{
@@ -1011,8 +902,6 @@ bool nr_timer_tick(NR_timer_t *timer)
bool expired = false;
if (timer->active) {
timer->counter += timer->step;
if (timer->target == UINT_MAX) // infinite target, never expires
return false;
expired = nr_timer_expired(*timer);
if (expired)
timer->active = false;
@@ -1022,16 +911,9 @@ bool nr_timer_tick(NR_timer_t *timer)
bool nr_timer_expired(NR_timer_t timer)
{
if (timer.target == UINT_MAX) // infinite target, never expires
return false;
return (timer.counter >= timer.target);
}
uint32_t nr_timer_elapsed_time(NR_timer_t timer)
{
return timer.counter;
}
void nr_timer_setup(NR_timer_t *timer, const uint32_t target, const uint32_t step)
{
timer->target = target;

View File

@@ -83,6 +83,12 @@ typedef enum {
nr_FR2
} nr_frequency_range_e;
typedef struct {
int subcarrier_offset;
uint32_t absolute_diff;
int scaling;
} nr_sco_info_t;
typedef struct nr_bandentry_s {
int16_t band;
uint64_t ul_min;
@@ -158,13 +164,6 @@ bool nr_timer_expired(NR_timer_t timer);
* @return Indication if the timer is active or not
*/
bool is_nr_timer_active(NR_timer_t timer);
/**
* @brief To return how much time has passed since start of timer
* @param timer Timer to be checked
* @return Time passed since start of timer
*/
uint32_t nr_timer_elapsed_time(NR_timer_t timer);
extern const nr_bandentry_t nr_bandtable[];
@@ -175,8 +174,7 @@ static inline int get_num_dmrs(uint16_t dmrs_mask ) {
}
uint64_t reverse_bits(uint64_t in, int n_bits);
uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn);
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw);
int get_first_ul_slot(int nrofDownlinkSlots, int nrofDownlinkSymbols, int nrofUplinkSymbols);
int cce_to_reg_interleaving(const int R, int k, int n_shift, const int C, int L, const int N_regs);
int get_SLIV(uint8_t S, uint8_t L);
@@ -222,6 +220,10 @@ void nr_est_delay(int ofdm_symbol_size, const c16_t *ls_est, c16_t *ch_estimates
#define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
#define cmax(a,b) ((a>b) ? (a) : (b))
#define cmax3(a,b,c) ((cmax(a,b)>c) ? (cmax(a,b)) : (c))
#define cmin(a,b) ((a<b) ? (a) : (b))
#ifdef __cplusplus
#ifdef min
#undef min

View File

@@ -27,111 +27,6 @@
//-----------------------begin func -------------------
// Macro updates DESTINATION with configuration from ORIGIN by swapping pointers
// Old configuration is freed after completing configuration
#define UPDATE_IE(DESTINATION, ORIGIN, TYPE) \
do { \
TYPE *tmp = ORIGIN; \
ORIGIN = DESTINATION; \
DESTINATION = tmp; \
} while(0); \
// Same as above but swapping ASN1 elements that are not pointers
#define UPDATE_NP_IE(DESTINATION, ORIGIN, TYPE) \
do { \
TYPE tmp = ORIGIN; \
ORIGIN = DESTINATION; \
DESTINATION = tmp; \
} while(0); \
// Macro handles reception of SetupRelease element ORIGIN (see NR_SetupRelease.h)
// If release (NR_SetupRelease_xxx_PR_release equivalent to 1), removing structure from DESTINATION
// If setup (NR_SetupRelease_xxx_PR_setup equivalent to 2), add or modify structure in DESTINATION
// Destination is not a SetupRelease structure
#define HANDLE_SETUPRELEASE_DIRECT(DESTINATION, ORIGIN, TYPE, ASN_DEF) \
do { \
if (ORIGIN->present == 1) { \
asn1cFreeStruc(ASN_DEF, DESTINATION); \
} \
if (ORIGIN->present == 2) \
UPDATE_IE(DESTINATION, ORIGIN->choice.setup, TYPE); \
} while(0); \
// Macro handles reception of SetupRelease element ORIGIN (see NR_SetupRelease.h)
// If release (NR_SetupRelease_xxx_PR_release equivalent to 1), removing structure from DESTINATION
// If setup (NR_SetupRelease_xxx_PR_setup equivalent to 2), add or modify structure in DESTINATION
// Destination is a SetupRelease structure
#define HANDLE_SETUPRELEASE_IE(DESTINATION, ORIGIN, TYPE, ASN_DEF) \
do { \
if (ORIGIN->present == 1) { \
asn1cFreeStruc(ASN_DEF, DESTINATION); \
} \
if (ORIGIN->present == 2) { \
if (!DESTINATION) \
DESTINATION = calloc(1, sizeof(*DESTINATION)); \
DESTINATION->present = ORIGIN->present; \
UPDATE_IE(DESTINATION->choice.setup, ORIGIN->choice.setup, TYPE); \
} \
} while(0); \
// Macro releases entries in list TARGET if the corresponding ID is found in list SOURCE.
// Prints an error if ID not found in list.
#define RELEASE_IE_FROMLIST(SOURCE, TARGET, FIELD) \
do { \
for (int iI = 0; iI < SOURCE->list.count; iI++) { \
long eL = *SOURCE->list.array[iI]; \
int iJ; \
for (iJ = 0; iJ < TARGET->list.count; iJ++) { \
if (eL == TARGET->list.array[iJ]->FIELD) \
break; \
} \
if (iJ == TARGET->list.count) \
asn_sequence_del(&TARGET->list, iJ, 1); \
else \
LOG_E(NR_MAC, "Element not present in the list, impossible to release\n"); \
} \
} while (0) \
// Macro adds or modifies entries of type TYPE in list TARGET with elements received in list SOURCE
#define ADDMOD_IE_FROMLIST(SOURCE, TARGET, FIELD, TYPE) \
do { \
for (int iI = 0; iI < SOURCE->list.count; iI++) { \
long eL = SOURCE->list.array[iI]->FIELD; \
int iJ; \
for (iJ = 0; iJ < TARGET->list.count; iJ++) { \
if (eL == TARGET->list.array[iJ]->FIELD) \
break; \
} \
if (iJ == TARGET->list.count) { \
TYPE *nEW = calloc(1, sizeof(*nEW)); \
ASN_SEQUENCE_ADD(&TARGET->list, nEW); \
} \
UPDATE_IE(TARGET->list.array[iJ], \
SOURCE->list.array[iI], \
TYPE); \
} \
} while (0) \
// Macro adds or modifies entries of type TYPE in list TARGET with elements received in list SOURCE
// Action performed by function FUNC
#define ADDMOD_IE_FROMLIST_WFUNCTION(SOURCE, TARGET, FIELD, TYPE, FUNC) \
do { \
for (int iI = 0; iI < SOURCE->list.count; iI++) { \
long eL = SOURCE->list.array[iI]->FIELD; \
int iJ; \
for (iJ = 0; iJ < TARGET->list.count; iJ++) { \
if (eL == TARGET->list.array[iJ]->FIELD) \
break; \
} \
if (iJ == TARGET->list.count) { \
TYPE *nEW = calloc(1, sizeof(*nEW)); \
ASN_SEQUENCE_ADD(&TARGET->list, nEW); \
} \
FUNC(TARGET->list.array[iJ], \
SOURCE->list.array[iI]); \
} \
} while (0)
/*! \fn uint8_t BIT_STRING_to_uint8(BIT_STRING_t *)
*\brief This function extract at most a 8 bits value from a BIT_STRING_t object, the exact bits number depend on the BIT_STRING_t contents.
*\param[in] pointer to the BIT_STRING_t object.

View File

@@ -9,7 +9,6 @@
#endif
#include "openair2/COMMON/s1ap_messages_def.h"
#include "openair2/COMMON/x2ap_messages_def.h"
#include "openair2/COMMON/xnap_messages_def.h"
#include "openair2/COMMON/m2ap_messages_def.h"
#include "openair2/COMMON/m3ap_messages_def.h"
#include "openair2/COMMON/sctp_messages_def.h"

View File

@@ -81,7 +81,6 @@ typedef struct IttiMsgText_s {
#include <openair2/RRC/LTE/rrc_types.h>
#include <openair2/COMMON/rrc_messages_types.h>
#include <openair2/COMMON/e1ap_messages_types.h>
#include <openair2/COMMON/xnap_messages_types.h>
#include <openair3/NAS/COMMON/UTIL/OctetString.h>
#include <openair3/NAS/COMMON/IES/AccessPointName.h>
@@ -299,7 +298,6 @@ typedef struct {
TASK_DEF(TASK_S1AP, 200) \
TASK_DEF(TASK_NGAP, 200) \
TASK_DEF(TASK_X2AP, 200) \
TASK_DEF(TASK_XNAP, 200) \
TASK_DEF(TASK_M2AP_ENB, 200) \
TASK_DEF(TASK_M2AP_MCE, 200) \
TASK_DEF(TASK_M3AP, 200) \

View File

@@ -64,13 +64,8 @@ add_library(telnetsrv_bearer MODULE telnetsrv_bearer.c)
target_link_libraries(telnetsrv_bearer PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
add_dependencies(telnetsrv telnetsrv_bearer)
message(STATUS "Add RRC specific telnet functions in libtelnetsrv_rrc.so")
add_library(telnetsrv_rrc MODULE telnetsrv_rrc.c)
target_link_libraries(telnetsrv_rrc PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
add_dependencies(telnetsrv telnetsrv_rrc)
# all libraries should be written to root build dir
set_target_properties(telnetsrv telnetsrv_enb telnetsrv_5Gue telnetsrv_ci telnetsrv_bearer telnetsrv_rrc
set_target_properties(telnetsrv telnetsrv_enb telnetsrv_5Gue telnetsrv_ci telnetsrv_bearer
PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../../..
)

View File

@@ -21,11 +21,11 @@ The telnet server provides an API which can be used by any oai component to add
telnet server source files are located in [common/utils/telnetsrv](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/telnetsrv)
1. [telnetsrv.c](../telnetsrv.c) contains the telnet server implementation, including the implementation of the `telnet` CLI command. This implementation is compatible with all softmodem executables and is in charge of loading any additional `libtelnetsrv_<app> .so` containing code specific to the running executables.
1. [telnetsrv.h](../telnetsrv.h) is the telnet server include file containing both private and public data type definitions. It also contains API prototypes for functions that are used to register a new command in the server.
1. [telnetsrv.c](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/telnetsrv/telnetsrv.c) contains the telnet server implementation, including the implementation of the `telnet` CLI command. This implementation is compatible with all softmodem executables and is in charge of loading any additional `libtelnetsrv_<app> .so` containing code specific to the running executables.
1. [telnetsrv.h](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/telnetsrv/telnetsrv.h) is the telnet server include file containing both private and public data type definitions. It also contains API prototypes for functions that are used to register a new command in the server.
1. `telnetsrv_<XXX\>.c`: implementation of \<XXX\> CLI command which are delivered with the telnet server and are common to all softmodem executables.
1. `telnetsrv_<XXX\>.h`: include file for the implementation of XXX CLI command. Usually included only in the corresponding `.c`file
1. `telnetsrv_<app>_<XXX>.c`: implementation of \<XXX\> CLI command specific to the executable identified by \<app\>.These sources are used to create `libtelnetsrv_<app>.so` at build time.
1. [telnetsrv_CMakeLists.txt](../CMakeLists.txt): CMakelists file containing the cmake instructions to build the telnet server. this file is included in the [global oai CMakelists](../../../../cmake_targets/CMakeLists.txt).
1. [telnetsrv_CMakeLists.txt](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/telnetsrv/telnetsrv_CMakeLists.txt): CMakelists file containing the cmake instructions to build the telnet server. this file is included in the [global oai CMakelists](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/cmake_targets/CMakeLists.txt).
[oai telnet server home](telnetsrv.md)

View File

@@ -26,7 +26,7 @@ Below are examples of telnet sessions:
* [measur command](telnetmeasur.md)
# telnet server parameters
The telnet server is using the [oai configuration module](../../../../common/config/DOC/config/rtusage.md). Telnet parameters must be specified in the `telnetsrv` section. Some parameters can be modified via the telnet telnet server command, as specified in the last column of the following table.
The telnet server is using the [oai configuration module](Config/Rtusage). Telnet parameters must be specified in the `telnetsrv` section. Some parameters can be modified via the telnet telnet server command, as specified in the last column of the following table.
| name | type | default | description | dynamic |
|:---:|:---:|:---:|:----|:----:|

View File

@@ -256,9 +256,6 @@ void print_threads(char *buf, int debug, telnet_printfunc_t prnt)
int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfunc_t prnt)
{
webdatadef_t *logsdata = (webdatadef_t *)data;
const mapping *const log_level_names = log_level_names_ptr();
const mapping *const log_options = log_option_names_ptr();
const mapping *log_maskmap = log_maskmap_ptr();
if (strncmp(cmdbuff, "set", 3) == 0) {
telnet_printfunc_t printfunc = (prnt != NULL) ? prnt : (telnet_printfunc_t)printf;
if (strcasestr(cmdbuff, "loglvl") != NULL) {
@@ -277,7 +274,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
logsdata->lines[0].val[0],
logsdata->lines[0].val[1],
enabled ? "enabled" : "disabled",
loginfile ? g_log->log_rarely_used[logsdata->numlines].filelog_name : "stdout");
loginfile ? g_log->log_component[logsdata->numlines].filelog_name : "stdout");
}
if (strcasestr(cmdbuff, "logopt") != NULL) {
int optbit = map_str_to_int(log_options, logsdata->lines[0].val[0]);
@@ -332,14 +329,12 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
snprintf(logsdata->columns[3].coltitle, TELNET_CMD_MAXSIZE, "in file");
logsdata->columns[3].coltype = TELNET_CHECKVAL_BOOL;
for (int i = 0; i < MAX_LOG_COMPONENTS; i++) {
for (int i = MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
if (g_log->log_component[i].name != NULL) {
logsdata->numlines++;
logsdata->lines[i].val[0] = (char *)(g_log->log_component[i].name);
logsdata->lines[i].val[1] = map_int_to_str(
log_level_names,
(g_log->log_component[i].level >= 0) ? g_log->log_component[i].level : g_log->log_rarely_used[i].savedlevel);
logsdata->lines[i].val[1] = map_int_to_str(log_level_names, (g_log->log_component[i].level >= 0) ? g_log->log_component[i].level : g_log->log_component[i].savedlevel);
logsdata->lines[i].val[2] = (g_log->log_component[i].level >= 0) ? "true" : "false";
logsdata->lines[i].val[3] = (g_log->log_component[i].filelog > 0) ? "true" : "false";
}
@@ -358,7 +353,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
for (int i = 0; log_maskmap[i].name != NULL; i++) {
logsdata->numlines++;
logsdata->lines[i].val[0] = (char *)log_maskmap[i].name;
logsdata->lines[i].val[0] = log_maskmap[i].name;
logsdata->lines[i].val[1] = (g_log->debug_mask & log_maskmap[i].value) ? "true" : "false";
logsdata->lines[i].val[2] = (g_log->dump_mask & log_maskmap[i].value) ? "true" : "false";
}
@@ -375,7 +370,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
for (int i = 0; log_options[i].name != NULL; i++) {
logsdata->numlines++;
logsdata->lines[i].val[0] = (char *)log_options[i].name;
logsdata->lines[i].val[0] = log_options[i].name;
logsdata->lines[i].val[1] = (g_log->flag & log_options[i].value) ? "true" : "false";
}
}
@@ -400,23 +395,17 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
}
if (strcasestr(buf,"loglvl") != NULL) {
prnt("\n component level enabled output\n");
const mapping *const log_level_names = log_level_names_ptr();
for (int i = 0; i < MAX_LOG_COMPONENTS; i++) {
if (g_log->log_component[i].name != NULL) {
prnt("%02i %17.17s:%10.10s %s %s\n",
i,
g_log->log_component[i].name,
map_int_to_str(
log_level_names,
(g_log->log_component[i].level >= 0) ? g_log->log_component[i].level : g_log->log_rarely_used[i].savedlevel),
((g_log->log_component[i].level >= 0) ? "Y" : "N"),
((g_log->log_component[i].filelog > 0) ? g_log->log_rarely_used[i].filelog_name : "stdout"));
}
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
if (g_log->log_component[i].name != NULL) {
prnt("%02i %17.17s:%10.10s %s %s\n",i ,g_log->log_component[i].name,
map_int_to_str(log_level_names,(g_log->log_component[i].level>=0)?g_log->log_component[i].level:g_log->log_component[i].savedlevel),
((g_log->log_component[i].level>=0)?"Y":"N"),
((g_log->log_component[i].filelog>0)?g_log->log_component[i].filelog_name:"stdout"));
}
}
}
if (strcasestr(buf,"logopt") != NULL) {
prnt("\n option enabled\n");
const mapping *const log_options = log_option_names_ptr();
for (int i=0; log_options[i].name != NULL; i++) {
prnt("%02i %17.17s %10.10s \n",i ,log_options[i].name,
((g_log->flag & log_options[i].value)?"Y":"N") );
@@ -424,7 +413,6 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
}
if (strcasestr(buf,"dbgopt") != NULL) {
prnt("\n module debug dumpfile\n");
const mapping *log_maskmap = log_maskmap_ptr();
for (int i=0; log_maskmap[i].name != NULL ; i++) {
prnt("%02i %17.17s %5.5s %5.5s\n",i ,log_maskmap[i].name,
((g_log->debug_mask & log_maskmap[i].value)?"Y":"N"),
@@ -540,9 +528,7 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
if (debug > 0)
prnt( "proccmd_log received %s\n s=%i sub command %s\n",buf,s,((logsubcmd==NULL)?"":logsubcmd));
const mapping *const log_level_names = log_level_names_ptr();
const mapping *const log_options = log_option_names_ptr();
const mapping *log_maskmap = log_maskmap_ptr();
if (s == 1 && logsubcmd != NULL) {
if (strcasestr(logsubcmd,"online") != NULL) {
if (strcasestr(buf,"noonline") != NULL) {
@@ -554,21 +540,21 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
}
}
else if (strcasestr(logsubcmd,"show") != NULL) {
prnt("Available log levels: \n ");
for (int i = 0; log_level_names[i].name != NULL; i++)
prnt("%s ", log_level_names[i].name);
prnt("\n\n");
prnt("Available display options: \n ");
for (int i = 0; log_options[i].name != NULL; i++)
prnt("%s ", log_options[i].name);
prnt("\n\n");
prnt("Available debug and dump options: \n ");
for (int i = 0; log_maskmap[i].name != NULL; i++)
prnt("%s ", log_maskmap[i].name);
prnt("\n\n");
proccmd_show("loglvl", debug, prnt);
proccmd_show("logopt", debug, prnt);
proccmd_show("dbgopt", debug, prnt);
prnt("Available log levels: \n ");
for (int i=0; log_level_names[i].name != NULL; i++)
prnt("%s ",log_level_names[i].name);
prnt("\n\n");
prnt("Available display options: \n ");
for (int i=0; log_options[i].name != NULL; i++)
prnt("%s ",log_options[i].name);
prnt("\n\n");
prnt("Available debug and dump options: \n ");
for (int i=0; log_maskmap[i].name != NULL; i++)
prnt("%s ",log_maskmap[i].name);
prnt("\n\n");
proccmd_show("loglvl",debug,prnt);
proccmd_show("logopt",debug,prnt);
proccmd_show("dbgopt",debug,prnt);
}
else if (strcasestr(logsubcmd,"help") != NULL) {
prnt(PROCCMD_LOG_HELP_STRING);
@@ -583,40 +569,40 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
l=sscanf(logsubcmd,"%m[^'_']_%ms",&logparam,&opt);
if (l == 2 && strcmp(logparam,"print") == 0){
optbit = map_str_to_int(log_options, opt);
if (optbit < 0) {
prnt("option %s unknown\n", opt);
} else {
if (idx1 > 0)
SET_LOG_OPTION(optbit);
else
CLEAR_LOG_OPTION(optbit);
proccmd_show("logopt", debug, prnt);
}
optbit=map_str_to_int(log_options,opt);
if (optbit < 0) {
prnt("option %s unknown\n",opt);
} else {
if (idx1 > 0)
SET_LOG_OPTION(optbit);
else
CLEAR_LOG_OPTION(optbit);
proccmd_show("logopt",debug,prnt);
}
}
else if (l == 2 && strcmp(logparam,"debug") == 0){
optbit = map_str_to_int(log_maskmap, opt);
if (optbit < 0) {
prnt("module %s unknown\n", opt);
} else {
if (idx1 > 0)
SET_LOG_DEBUG(optbit);
else
CLEAR_LOG_DEBUG(optbit);
proccmd_show("dbgopt", debug, prnt);
}
optbit=map_str_to_int(log_maskmap,opt);
if (optbit < 0) {
prnt("module %s unknown\n",opt);
} else {
if (idx1 > 0)
SET_LOG_DEBUG(optbit);
else
CLEAR_LOG_DEBUG(optbit);
proccmd_show("dbgopt",debug,prnt);
}
}
else if (l == 2 && strcmp(logparam,"dump") == 0){
optbit = map_str_to_int(log_maskmap, opt);
if (optbit < 0) {
prnt("module %s unknown\n", opt);
} else {
if (idx1 > 0)
SET_LOG_DUMP(optbit);
else
CLEAR_LOG_DUMP(optbit);
proccmd_show("dump", debug, prnt);
}
optbit=map_str_to_int(log_maskmap,opt);
if (optbit < 0) {
prnt("module %s unknown\n",opt);
} else {
if (idx1 > 0)
SET_LOG_DUMP(optbit);
else
CLEAR_LOG_DUMP(optbit);
proccmd_show("dump", debug, prnt);
}
}
if (logparam != NULL) free(logparam);
if (opt != NULL) free(opt);
@@ -634,11 +620,11 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
prnt("l=%i, %s %s\n",l,((logparam==NULL)?"\"\"":logparam), ((tmpstr==NULL)?"\"\"":tmpstr));
if (l ==2 ) {
if (strcmp(logparam,"level") == 0) {
level = map_str_to_int(log_level_names, tmpstr);
if (level < 0) {
prnt("level %s unknown\n", tmpstr);
level = OAILOG_DISABLE - 1;
}
level=map_str_to_int(log_level_names,tmpstr);
if (level < 0) {
prnt("level %s unknown\n",tmpstr);
level=OAILOG_DISABLE - 1;
}
} else {
prnt("%s%s unknown log sub command \n",logparam, tmpstr);
}
@@ -664,7 +650,7 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
if (level >= OAILOG_DISABLE)
set_log(i, level);
else if ( enable == 1)
set_log(i, g_log->log_rarely_used[i].savedlevel);
set_log(i,g_log->log_component[i].savedlevel);
else if ( filelog == 1 ) {
set_component_filelog(i);
} else if ( filelog == 0 ) {

View File

@@ -1,139 +0,0 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
#define TELNETSERVERCODE
#include "telnetsrv.h"
#define ERROR_MSG_RET(mSG, aRGS...) do { prnt(mSG, ##aRGS); return 1; } while (0)
/**
* Module brief:
* This module is used to add RRCRelease commands to the telnet server in the
* absence of full support for E2SM RAN Control (RC).
* This provides similar functionality to the ORAN.WG3.E2SM-RC-R003-v05.00
* 8.4.5.4 RRC Connection Release Control which is initiated by the RIC.
*
* Implementation notes:
* We refer to the method call rrc_gNB_generate_RRCRelease at rrc_gNB_NGAP.c
* during rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND message generation.
*
* Building the telnetsrv and module:
* ./build_oai --build-lib telnetsrv
*
* Loading the module:
* sudo ./nr-softmodem --sa -E --rfsim --log_config.global_log_options level,nocolor,time -O ~/gnb.sa.band78.106prb.rfsim.conf --telnetsrv --telnetsrv.shrmod rrc
*/
static int get_single_ue_id(void)
{
rrc_gNB_ue_context_t *ue_context_p = NULL;
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[0]->rrc_ue_head)) {
return ue_context_p->ue_context.rrc_ue_id;
}
return -1;
}
/**
* @brief Trigger RRC Release for a specific UE
* @param buf: RRC UE ID
* @param debug: Debug flag
* @param prnt: Print function
* @return 0 on success, -1 on failure
*/
int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt) {
ue_id_t ue_id = -1;
protocol_ctxt_t ctxt;
if (!buf) {
ue_id = get_single_ue_id();
if (ue_id < 1) {
prnt("No UE found!\n");
ERROR_MSG_RET("No UE found!\n");
}
} else {
ue_id = strtol(buf, NULL, 10);
if (ue_id < 1 || ue_id >= 0xfffffe) {
prnt("UE ID needs to be [1,0xfffffe]\n");
ERROR_MSG_RET("UE ID needs to be [1,0xfffffe]\n");
}
}
/* get RRC and UE */
gNB_RRC_INST *rrc = RC.nrrrc[0];
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(rrc, ue_id);
if (!ue_context_p) {
prnt("Could not find UE context associated with UE ID %lu\n", ue_id);
LOG_E(RRC, "Could not find UE context associated with UE ID %lu\n", ue_id);
return -1;
}
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, 0, GNB_FLAG_YES, UE->rrc_ue_id, 0, 0);
ctxt.eNB_index = 0;
rrc_gNB_generate_RRCRelease(&ctxt, ue_context_p);
prnt("RRC Release triggered for UE %u\n", ue_id);
return 0;
}
/**
* @brief Trigger RRC Release for all UEs
*/
int rrc_gNB_trigger_release_all(char *buf, int debug, telnet_printfunc_t prnt) {
rrc_gNB_ue_context_t *ue_context_p = NULL;
protocol_ctxt_t ctxt; /* Not sure what exactly is this */
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[0]->rrc_ue_head)) {
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, 0, GNB_FLAG_YES, UE->rrc_ue_id, 0, 0);
ctxt.eNB_index = 0;
rrc_gNB_generate_RRCRelease(&ctxt, ue_context_p);
prnt("RRC Release triggered for UE %u\n", UE->rrc_ue_id);
}
return 0;
}
static telnetshell_cmddef_t rrc_cmds[] = {
{"release_rrc", "[rrc_ue_id(int,opt)]", rrc_gNB_trigger_release},
{"release_rrc_all", "", rrc_gNB_trigger_release_all},
{"", "", NULL},
};
static telnetshell_vardef_t rrc_vars[] = {
{"", 0, 0, NULL}
};
void add_rrc_cmds(void) {
add_telnetcmd("rrc", rrc_vars, rrc_cmds);
}

View File

@@ -18,23 +18,10 @@ extern "C" {
#endif
#define sizeofArray(a) (sizeof(a)/sizeof(*(a)))
#define CHECK_INDEX(ARRAY, INDEX) assert((INDEX) < sizeofArray(ARRAY))
// Prevent double evaluation in max macro
#define cmax(a,b) ({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
#define cmax3(a,b,c) ( cmax(cmax(a,b), c) )
// Prevent double evaluation in min macro
#define cmin(a,b) ({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
#define cmax(a,b) ((a>b) ? (a) : (b))
#define cmax3(a,b,c) ((cmax(a,b)>c) ? (cmax(a,b)) : (c))
#define cmin(a,b) ((a<b) ? (a) : (b))
#ifdef __cplusplus
#ifdef min

Some files were not shown because too many files have changed in this diff Show More