mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-14 05:00:31 +00:00
Compare commits
113 Commits
testing-rk
...
bugfix-ldp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c9a0dea27 | ||
|
|
b038ee0af8 | ||
|
|
7fc31d9ca9 | ||
|
|
6d66049e1f | ||
|
|
1a0c0cd1c9 | ||
|
|
315caca955 | ||
|
|
8943dfa131 | ||
|
|
027a8c6f9b | ||
|
|
cc6d1ecded | ||
|
|
b6bc11635d | ||
|
|
a4e9a07d56 | ||
|
|
9e7ef62c9d | ||
|
|
bacf3537cf | ||
|
|
1af5062b6c | ||
|
|
d21f6411fc | ||
|
|
599fd419df | ||
|
|
d6a01a73d4 | ||
|
|
2c846e26a0 | ||
|
|
97bce21005 | ||
|
|
44d309a69d | ||
|
|
4d2093e765 | ||
|
|
c9f737d310 | ||
|
|
ffb2d23b18 | ||
|
|
64a65a878a | ||
|
|
d66bc22175 | ||
|
|
54641a14fd | ||
|
|
3a24b66ecf | ||
|
|
7f31659a86 | ||
|
|
8cacbb884c | ||
|
|
e99c019fb4 | ||
|
|
92d5270adf | ||
|
|
2ec0b4b8fe | ||
|
|
c1f85d4f07 | ||
|
|
fb6f9d3bf0 | ||
|
|
e695f24277 | ||
|
|
c99539a806 | ||
|
|
b375a804bf | ||
|
|
88192f1339 | ||
|
|
01369343e6 | ||
|
|
c0f03f2960 | ||
|
|
d487666995 | ||
|
|
c31fe381f8 | ||
|
|
573e7fd98a | ||
|
|
06ef311975 | ||
|
|
cfe698eb70 | ||
|
|
b80f2a2eb8 | ||
|
|
5db45c1024 | ||
|
|
fe146678ce | ||
|
|
494dad9f7a | ||
|
|
805dbe7272 | ||
|
|
b58791bee0 | ||
|
|
f8f1723b71 | ||
|
|
7bd0153079 | ||
|
|
23c92ee0ed | ||
|
|
69a1eb2f6a | ||
|
|
e9bbf624a6 | ||
|
|
7b9f610b8c | ||
|
|
cc55c4315c | ||
|
|
77eb877dec | ||
|
|
fca07aae56 | ||
|
|
6ecf3db1e5 | ||
|
|
0271ff711d | ||
|
|
0f57c8e699 | ||
|
|
1d1d8a1ef5 | ||
|
|
fab5987754 | ||
|
|
98ca29b220 | ||
|
|
9dc8eccaf4 | ||
|
|
75a18c33cd | ||
|
|
4fe3599a43 | ||
|
|
da63ee61fb | ||
|
|
dd8f280842 | ||
|
|
22e1cdfcc3 | ||
|
|
f3747a0bcf | ||
|
|
e28e026777 | ||
|
|
4fb8f83999 | ||
|
|
93756a56eb | ||
|
|
ec858d175d | ||
|
|
65bd93721d | ||
|
|
1c18f09b6e | ||
|
|
d05ff49dd0 | ||
|
|
6d0eadcac2 | ||
|
|
c3d01306de | ||
|
|
c0aea206c2 | ||
|
|
ec21db63eb | ||
|
|
9308369e28 | ||
|
|
215bb1b02c | ||
|
|
12384bbe25 | ||
|
|
d64921a24f | ||
|
|
3608f5cfb5 | ||
|
|
c4c03a48ac | ||
|
|
bb9df947eb | ||
|
|
ebd4d8d628 | ||
|
|
40f951f13d | ||
|
|
bc12d222bb | ||
|
|
8091c9f17f | ||
|
|
325e58bc10 | ||
|
|
6e43b1f12d | ||
|
|
35330baeea | ||
|
|
55455a03c0 | ||
|
|
9d564f3691 | ||
|
|
235cd40c98 | ||
|
|
f67e0e3f02 | ||
|
|
e72b6fc448 | ||
|
|
7c3b00301f | ||
|
|
bfd819c5b4 | ||
|
|
e65f13e175 | ||
|
|
e8893bccc4 | ||
|
|
df6a5fd864 | ||
|
|
644f613409 | ||
|
|
64c1b8ac93 | ||
|
|
230a6c3f45 | ||
|
|
93a6d4087d | ||
|
|
21b3484e02 |
@@ -103,5 +103,85 @@ SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
TabWidth: 2
|
||||
UseTab: Never
|
||||
---
|
||||
Language: JavaScript
|
||||
# BasedOnStyle: Google
|
||||
AccessModifierOffset: -1
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BraceWrapping:
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 200
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DisableFormat: false
|
||||
FixNamespaceComments: true
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 2
|
||||
IndentWrappedFunctionNames: false
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 1
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 200
|
||||
ReflowComments: true
|
||||
SortUsingDeclarations: false
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
DeriveLineEnding: true
|
||||
TabWidth: 2
|
||||
JavaScriptQuotes: Double
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
|
||||
@@ -1763,6 +1763,7 @@ add_library (GTPV1U
|
||||
${OPENAIR3_DIR}/ocp-gtpu/gtp_itf.cpp
|
||||
)
|
||||
target_link_libraries(GTPV1U PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
target_link_libraries(GTPV1U PRIVATE SIMU)
|
||||
include_directories(${OPENAIR3_DIR}/ocp-gtp)
|
||||
|
||||
set (MME_APP_SRC
|
||||
@@ -2109,13 +2110,6 @@ add_library(LIB_5GNAS_GNB
|
||||
target_link_libraries(LIB_5GNAS_GNB PRIVATE SECU_CN ${CRYPTO_LIBRARIES})
|
||||
target_link_libraries(LIB_5GNAS_GNB PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
|
||||
add_library(SIMU_COMMON
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/random_channel.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/rangen_double.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/phase_noise.c
|
||||
)
|
||||
target_link_libraries(SIMU_COMMON PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
|
||||
# Simulation library
|
||||
##########################
|
||||
set (SIMUSRC
|
||||
@@ -2124,15 +2118,15 @@ set (SIMUSRC
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_tv_channel.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/abstraction.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/channel_sim.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/random_channel.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/rangen_double.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/phase_noise.c
|
||||
${OPENAIR1_DIR}/SIMULATION/RF/rf.c
|
||||
${OPENAIR1_DIR}/SIMULATION/RF/dac.c
|
||||
${OPENAIR1_DIR}/SIMULATION/RF/adc.c
|
||||
#${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
)
|
||||
|
||||
# Simulation library
|
||||
##########################
|
||||
add_library(SIMU SHARED ${SIMUSRC} )
|
||||
)
|
||||
add_library(SIMU STATIC ${SIMUSRC} )
|
||||
target_include_directories(SIMU PUBLIC ${OPENAIR1_DIR}/SIMULATION/TOOLS ${OPENAIR1_DIR}/SIMULATION/RF)
|
||||
target_link_libraries(SIMU PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
|
||||
add_library(SIMU_ETH
|
||||
@@ -2166,7 +2160,7 @@ set(XFORMS_SOURCE_NR
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/nr_phy_scope.c
|
||||
)
|
||||
set(XFORMS_SOURCE_SOFTMODEM
|
||||
${OPENAIR_TARGETS}/RT/USER/stats.c
|
||||
${OPENAIR_DIR}/executables/stats.c
|
||||
)
|
||||
set(XFORMSINTERFACE_SOURCE
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c
|
||||
@@ -2190,7 +2184,7 @@ add_library(rfsimulator MODULE
|
||||
${OPENAIR_DIR}/radio/rfsimulator/apply_channelmod.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c
|
||||
)
|
||||
target_link_libraries(rfsimulator PRIVATE SIMU_COMMON ${ATLAS_LIBRARIES})
|
||||
target_link_libraries(rfsimulator PRIVATE SIMU ${ATLAS_LIBRARIES})
|
||||
target_link_libraries(rfsimulator PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
|
||||
add_library(oai_iqplayer MODULE
|
||||
@@ -2273,13 +2267,12 @@ target_link_libraries (test5Gnas LIB_5GNAS_GNB CONFIG_LIB minimal_lib )
|
||||
###################################################
|
||||
|
||||
add_executable(lte-softmodem
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
||||
${OPENAIR_TARGETS}/RT/USER/ru_control.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
|
||||
${OPENAIR_DIR}/executables/lte-enb.c
|
||||
${OPENAIR_DIR}/executables/lte-ru.c
|
||||
${OPENAIR_DIR}/executables/ru_control.c
|
||||
${OPENAIR_DIR}/executables/lte-softmodem.c
|
||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_DIR}/executables/create_tasks.c
|
||||
${OPENAIR_DIR}/executables/create_tasks_mbms.c
|
||||
${OPENAIR_DIR}/radio/COMMON/common_lib.c
|
||||
@@ -2304,7 +2297,7 @@ target_link_libraries(lte-softmodem PRIVATE
|
||||
-Wl,--start-group
|
||||
lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U f1ap SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
|
||||
PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI SIMU
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries(lte-softmodem PRIVATE ${LIBXML2_LIBRARIES})
|
||||
@@ -2320,7 +2313,6 @@ add_executable(ocp-enb
|
||||
${OPENAIR_DIR}/executables/main-fs6.c
|
||||
${OPENAIR_DIR}/executables/transport_split.c
|
||||
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_DIR}/executables/create_tasks.c
|
||||
${OPENAIR_DIR}/executables/create_tasks_mbms.c
|
||||
${OPENAIR_DIR}/radio/COMMON/common_lib.c
|
||||
@@ -2343,14 +2335,14 @@ add_dependencies(ocp-enb oai_iqplayer coding params_libconfig rfsimulator)
|
||||
target_link_libraries (ocp-enb
|
||||
-Wl,--start-group
|
||||
lte_rrc nr_rrc s1ap f1ap m2ap x2ap m3ap GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
|
||||
PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU_COMMON
|
||||
PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI
|
||||
-Wl,--end-group z dl)
|
||||
target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${CMAKE_DL_LIBS} ${LIB_LMS_LIBRARIES} ${T_LIB})
|
||||
|
||||
add_executable(oairu
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
||||
${OPENAIR_TARGETS}/RT/USER/ru_control.c
|
||||
${OPENAIR_DIR}/executables/lte-ru.c
|
||||
${OPENAIR_DIR}/executables/ru_control.c
|
||||
${OPENAIR_DIR}/radio/COMMON/common_lib.c
|
||||
${OPENAIR_DIR}/radio/COMMON/record_player.c
|
||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||
@@ -2378,8 +2370,8 @@ target_link_libraries(lte-softmodem PRIVATE
|
||||
#######################################
|
||||
|
||||
add_executable(lte-uesoftmodem
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
|
||||
${OPENAIR_DIR}/executables/lte-ue.c
|
||||
${OPENAIR_DIR}/executables/lte-uesoftmodem.c
|
||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||
${OPENAIR_DIR}/executables/create_tasks_ue.c
|
||||
${OPENAIR_DIR}/radio/COMMON/common_lib.c
|
||||
@@ -2404,7 +2396,7 @@ target_link_libraries(lte-uesoftmodem PRIVATE
|
||||
-Wl,--start-group
|
||||
lte_rrc nr_rrc s1ap x2ap m2ap m3ap
|
||||
SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
|
||||
PHY_UE PHY_RU L2_UE L2_LTE SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
|
||||
PHY_UE PHY_RU L2_UE L2_LTE SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${ATLAS_LIBRARIES}
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
@@ -2430,7 +2422,6 @@ add_executable(nr-softmodem
|
||||
${OPENAIR_DIR}/executables/nr-ru.c
|
||||
${OPENAIR_DIR}/executables/nr-softmodem.c
|
||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_DIR}/radio/COMMON/common_lib.c
|
||||
${OPENAIR_DIR}/radio/COMMON/record_player.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
@@ -2449,12 +2440,12 @@ 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 SECU_CN SECU_OSA
|
||||
ITTI ${RAL_LIB} ${NAS_UE_LIB} lte_rrc nr_rrc
|
||||
ngap s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
ngap s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU
|
||||
x2ap f1ap m2ap m3ap
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries(nr-softmodem PRIVATE ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries(nr-softmodem PRIVATE pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${CMAKE_DL_LIBS} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries(nr-softmodem PRIVATE pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${CMAKE_DL_LIBS} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries(nr-softmodem PRIVATE ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries(nr-softmodem PRIVATE ${T_LIB})
|
||||
target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
@@ -2479,7 +2470,6 @@ add_executable(nr-uesoftmodem
|
||||
${OPENAIR_DIR}/executables/nr-uesoftmodem.c
|
||||
${OPENAIR_DIR}/executables/nr-ue.c
|
||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_DIR}/radio/COMMON/common_lib.c
|
||||
${OPENAIR_DIR}/radio/COMMON/record_player.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
@@ -2498,7 +2488,7 @@ target_link_libraries(nr-uesoftmodem PRIVATE
|
||||
nr_rrc SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_NR_UE_LIB
|
||||
PHY_COMMON PHY_NR_COMMON PHY_NR_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
|
||||
NFAPI_USER_LIB MISC_NFAPI_NR_LIB
|
||||
${RAL_LIB} ITTI ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB}
|
||||
${RAL_LIB} ITTI ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} SIMU
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries(nr-uesoftmodem PRIVATE ${LIBXML2_LIBRARIES})
|
||||
@@ -2532,7 +2522,7 @@ add_executable(dlsim_tm4
|
||||
${T_SOURCE}
|
||||
)
|
||||
target_link_libraries (dlsim_tm4
|
||||
-Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY ITTI -Wl,--end-group
|
||||
-Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY ITTI -Wl,--end-group
|
||||
pthread m rt CONFIG_LIB ${ATLAS_LIBRARIES} ${T_LIB}
|
||||
)
|
||||
|
||||
@@ -2552,7 +2542,7 @@ add_executable(polartest
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(polartest PRIVATE
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR PHY_NR_COMMON PHY_NR_UE CONFIG_LIB -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_COMMON PHY_NR_UE CONFIG_LIB -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} dl
|
||||
)
|
||||
target_link_libraries(polartest PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
@@ -2565,7 +2555,7 @@ add_executable(smallblocktest
|
||||
)
|
||||
|
||||
target_link_libraries(smallblocktest PRIVATE
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_NR PHY_COMMON PHY_NR_COMMON CONFIG_LIB -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON CONFIG_LIB -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} dl
|
||||
)
|
||||
target_link_libraries(smallblocktest PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
@@ -2583,7 +2573,7 @@ if (CUDA_FOUND)
|
||||
add_dependencies( ldpctest ldpc_cuda)
|
||||
endif (CUDA_FOUND)
|
||||
target_link_libraries(ldpctest PRIVATE
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_NR PHY_COMMON PHY_NR_COMMON CONFIG_LIB -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON CONFIG_LIB -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} dl
|
||||
)
|
||||
target_link_libraries(ldpctest PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
@@ -2596,7 +2586,7 @@ add_executable(nr_dlschsim
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_dlschsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl
|
||||
)
|
||||
target_link_libraries(nr_dlschsim PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
@@ -2608,7 +2598,7 @@ add_executable(nr_pbchsim
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_pbchsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl
|
||||
)
|
||||
target_link_libraries(nr_pbchsim PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
@@ -2623,7 +2613,7 @@ add_executable(nr_pucchsim
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_pucchsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl
|
||||
)
|
||||
target_link_libraries(nr_pucchsim PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
@@ -2641,7 +2631,7 @@ add_executable(nr_dlsim
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_dlsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON lte_rrc nr_rrc CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE x2ap SECU_CN ngap NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON lte_rrc nr_rrc CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE x2ap SECU_CN ngap NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl
|
||||
)
|
||||
target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
@@ -2659,7 +2649,7 @@ add_executable(nr_prachsim
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES})
|
||||
target_link_libraries(nr_prachsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON lte_rrc nr_rrc CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE x2ap SECU_CN ngap NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON lte_rrc nr_rrc CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE x2ap SECU_CN ngap NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl)
|
||||
target_link_libraries(nr_prachsim PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
|
||||
@@ -2672,7 +2662,7 @@ add_executable(nr_ulschsim
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_ulschsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl
|
||||
)
|
||||
target_link_libraries(nr_ulschsim PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
@@ -2695,7 +2685,7 @@ add_dependencies( nr_ulsim ldpc_offload)
|
||||
endif ()
|
||||
|
||||
target_link_libraries(nr_ulsim PRIVATE
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON lte_rrc nr_rrc CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE x2ap SECU_CN ngap NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON lte_rrc nr_rrc CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE x2ap SECU_CN ngap NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl
|
||||
)
|
||||
target_compile_definitions(nr_ulsim PUBLIC -DPHYSICAL_SIMULATOR)
|
||||
@@ -2714,7 +2704,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
|
||||
${NFAPI_USER_DIR}/nfapi.c
|
||||
)
|
||||
target_link_libraries (${myExe} PRIVATE
|
||||
-Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU ITTI -Wl,--end-group
|
||||
-Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU ITTI -Wl,--end-group
|
||||
pthread m rt CONFIG_LIB ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
|
||||
)
|
||||
target_link_libraries(${myExe} PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
@@ -2762,7 +2752,7 @@ if (${T_TRACER})
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
|
||||
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
|
||||
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR ngap
|
||||
CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
|
||||
CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU SIMU_ETH OPENAIR0_LIB
|
||||
ldpc_orig ldpc_optim ldpc_optim8seg ldpc dfts)
|
||||
if (TARGET ${i})
|
||||
add_dependencies(${i} generate_T)
|
||||
@@ -2855,6 +2845,7 @@ make_driver(ue_ip ${OPENAIR2_DIR}/NETWORK_DRIVER/UE_IP ${ue_ip_src})
|
||||
|
||||
include (common/utils/telnetsrv/telnetsrv_CMakeLists.txt)
|
||||
include(${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/CMakeLists.txt)
|
||||
include (${OPENAIR_DIR}/common/utils/websrv/websrv_CMakeLists.txt)
|
||||
|
||||
add_subdirectory(doc)
|
||||
add_subdirectory(openair2)
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.dlsim100rbtm2}}
|
||||
nodeName: {{ .Values.global.nodeName.dlsim100rbtm2 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.dlsimbasic}}
|
||||
nodeName: {{ .Values.global.nodeName.dlsimbasic }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.ldpctest}}
|
||||
nodeName: {{ .Values.global.nodeName.ldpctest }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrdlschsim}}
|
||||
nodeName: {{ .Values.global.nodeName.nrdlschsim }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrdlsimbasic}}
|
||||
nodeName: {{ .Values.global.nodeName.nrdlsimbasic }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrdlsimdmrsptrs}}
|
||||
nodeName: {{ .Values.global.nodeName.nrdlsimdmrsptrs }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrdlsimmcsmimo}}
|
||||
nodeName: {{ .Values.global.nodeName.nrdlsimmcsmimo }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrdlsimoffset}}
|
||||
nodeName: {{ .Values.global.nodeName.nrdlsimoffset }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrpbschsim106rb}}
|
||||
nodeName: {{ .Values.global.nodeName.nrpbschsim106rb }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrpbchsim217rb}}
|
||||
nodeName: {{ .Values.global.nodeName.nrpbchsim217rb }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrpbchsim273rb}}
|
||||
nodeName: {{ .Values.global.nodeName.nrpbchsim273rb }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrprachsim}}
|
||||
nodeName: {{ .Values.global.nodeName.nrprachsim }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrpucchsim}}
|
||||
nodeName: {{ .Values.global.nodeName.nrpucchsim }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrulschsim}}
|
||||
nodeName: {{ .Values.global.nodeName.nrulschsim }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrulsim3gpp}}
|
||||
nodeName: {{ .Values.global.nodeName.nrulsim3gpp }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrulsimmimo}}
|
||||
nodeName: {{ .Values.global.nodeName.nrulsimmimo }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrulsimmisc}}
|
||||
nodeName: {{ .Values.global.nodeName.nrulsimmisc }}
|
||||
{{- end }}
|
||||
|
||||
@@ -35,5 +35,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.nrulsimscfdma}}
|
||||
nodeName: {{ .Values.global.nodeName.nrulsimscfdma }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.polartest}}
|
||||
nodeName: {{ .Values.global.nodeName.polartest }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.smallblocktest}}
|
||||
nodeName: {{ .Values.global.nodeName.smallblocktest }}
|
||||
{{- end }}
|
||||
|
||||
@@ -33,5 +33,10 @@ spec:
|
||||
schedulerName: default-scheduler
|
||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||
terminationGracePeriodSeconds: 30
|
||||
{{- if .Values.global.nodeSelector}}
|
||||
nodeSelector:
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.nodeName.ulsim}}
|
||||
nodeName: {{ .Values.global.nodeName.ulsim }}
|
||||
{{- end }}
|
||||
|
||||
@@ -11,6 +11,29 @@ global:
|
||||
version: TAG
|
||||
# pullPolicy: IfNotPresent or Never or Always
|
||||
pullPolicy: Always
|
||||
nodeSelector:
|
||||
worker: "telco"
|
||||
|
||||
# removing the node selector
|
||||
nodeSelector: {}
|
||||
# It is not a good way of assigning pods to the nodes: this way we bypass the scheduler. At the moment we don't provide the resource information of these pods.
|
||||
# Therefore, Openshift assigns the pods to the same node because it thinks the pods don't consume much resources. This isn't the case, they consume a lot of resources.
|
||||
nodeName:
|
||||
dlsim100rbtm2: acamas
|
||||
dlsimbasic: acamas
|
||||
ldpctest: acamas
|
||||
nrdlschsim: acamas
|
||||
nrdlsimbasic: acamas
|
||||
nrdlsimdmrsptrs: acamas
|
||||
nrdlsimmcsmimo: acamas
|
||||
nrdlsimoffset: dedale
|
||||
nrpbschsim106rb: dedale
|
||||
nrpbchsim217rb: dedale
|
||||
nrpbchsim273rb: dedale
|
||||
nrprachsim: dedale
|
||||
nrpucchsim: dedale
|
||||
nrulschsim: theseus
|
||||
nrulsim3gpp: theseus
|
||||
nrulsimmimo: theseus
|
||||
nrulsimmisc: theseus
|
||||
nrulsimscfdma: theseus
|
||||
polartest: theseus
|
||||
smallblocktest: theseus
|
||||
ulsim: theseus
|
||||
|
||||
@@ -62,7 +62,7 @@ function build_on_vm {
|
||||
echo "ARCHIVES_LOC = $ARCHIVES_LOC"
|
||||
echo "BUILD_OPTIONS = $BUILD_OPTIONS"
|
||||
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]]
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]] || [[ "$VM_NAME" == *"rf5g-sim"* ]] || [[ "$VM_NAME" == *"gnb-usrp"* ]] || [[ "$VM_NAME" == *"nr-ue-usrp"* ]]
|
||||
then
|
||||
echo "This VM type is no longer supported in the pipeline framework"
|
||||
return
|
||||
|
||||
@@ -70,7 +70,7 @@ class Cluster:
|
||||
regres2 = re.search(r"/etc/pki/entitlement/[0-9]+-key.pem", sshSession.getBefore())
|
||||
if regres1 is None or regres2 is None:
|
||||
logging.error("could not find entitlements")
|
||||
return false
|
||||
return False
|
||||
file1 = regres1.group(0)
|
||||
file2 = regres2.group(0)
|
||||
sshSession.command(f'oc create secret generic etc-pki-entitlement --from-file {file1} --from-file {file2}', '\$', 5)
|
||||
|
||||
@@ -153,11 +153,11 @@ def AnalyzeBuildLogs(buildRoot, images, globalStatus):
|
||||
|
||||
def AnalyzeIperf(cliOptions, clientReport, serverReport):
|
||||
req_bw = 1.0 # default iperf throughput, in Mbps
|
||||
result = re.search('-b *(?P<iperf_bandwidth>[0-9\.]+)(?P<magnitude>[KMG])', cliOptions)
|
||||
result = re.search('-b *(?P<iperf_bandwidth>[0-9\.]+)(?P<magnitude>[kKMG])', cliOptions)
|
||||
if result is not None:
|
||||
req_bw = float(result.group('iperf_bandwidth'))
|
||||
magn = result.group('magnitude')
|
||||
if magn == "K":
|
||||
if magn == "k" or magn == "K":
|
||||
req_bw /= 1000
|
||||
elif magn == "G":
|
||||
req_bw *= 1000
|
||||
@@ -180,7 +180,7 @@ def AnalyzeIperf(cliOptions, clientReport, serverReport):
|
||||
reportLine = clientReportLines[l+1]
|
||||
logging.debug(f'found server report: "{reportLine}"')
|
||||
|
||||
statusTemplate = '(?:|\[ *\d+\].*) +0\.0-(?P<duration>[0-9\.]+) +sec +[0-9\.]+ [KMG]Bytes +(?P<bitrate>[0-9\.]+) (?P<magnitude>[KMG])bits\/sec +(?P<jitter>[0-9\.]+) ms +(\d+\/ ..\d+) +(\((?P<packetloss>[0-9\.]+)%\))'
|
||||
statusTemplate = '(?:|\[ *\d+\].*) +0\.0-\s*(?P<duration>[0-9\.]+) +sec +[0-9\.]+ [kKMG]Bytes +(?P<bitrate>[0-9\.]+) (?P<magnitude>[kKMG])bits\/sec +(?P<jitter>[0-9\.]+) ms +(\d+\/ ..\d+) +(\((?P<packetloss>[0-9\.]+)%\))'
|
||||
# if we do not find a server report in the client logs, check the server logs
|
||||
# and use the last line which is typically close/identical to server report
|
||||
if reportLine is None:
|
||||
@@ -201,10 +201,10 @@ def AnalyzeIperf(cliOptions, clientReport, serverReport):
|
||||
duration = float(result.group('duration'))
|
||||
bitrate = float(result.group('bitrate'))
|
||||
magn = result.group('magnitude')
|
||||
if magn == "K":
|
||||
bitrate *= 1000
|
||||
elif magn == "G": # we assume bitrate in Mbps, therefore it must be G now
|
||||
if magn == "k" or magn == "K":
|
||||
bitrate /= 1000
|
||||
elif magn == "G": # we assume bitrate in Mbps, therefore it must be G now
|
||||
bitrate *= 1000
|
||||
jitter = float(result.group('jitter'))
|
||||
packetloss = float(result.group('packetloss'))
|
||||
|
||||
|
||||
36
ci-scripts/conf_files/README.md
Normal file
36
ci-scripts/conf_files/README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Configuration files: naming style guide
|
||||
|
||||
The configuration files should have the following name format:
|
||||
|
||||
```
|
||||
<type>[.<sa|nsa>][.band<num>.[u<num>.]<num>prb].<sdr>[.<opt>].conf
|
||||
```
|
||||
|
||||
Where:
|
||||
- `[]` means this field is optional
|
||||
- `<type>`: one of `gnb`, `enb`, `gnb-cu`, `gnb-du`, `nrue`, `lteue`, etc.
|
||||
- `<sa|nsa>`: in the case of 5G, notes whether this is SA or NSA
|
||||
- `<num>` for `band`/`u`/`prb`: numerical value. Note that band/PRB are only
|
||||
applicable in some cases. The numerology `u` is only to be set for 5G if it
|
||||
differs from `u1`.
|
||||
- `<sdr>`: what SDR board/split this is tailored for:
|
||||
* e.g., `usrpb210`, `usrpn310`, `rfsim`, `aw2s`
|
||||
* if there is no SDR (e.g., for a CU), use the south-bound split, e.g., `f1`, `if4p5`, etc.
|
||||
* for the L2simulator, write `l2sim`
|
||||
- `<opt>`: optional specifiers. If there are multiple, concatenated
|
||||
using a dash (`-`). Examples:
|
||||
* `2x2`
|
||||
* `prs` (positioning reference signal)
|
||||
* `ddsuu` (specific TDD pattern)
|
||||
* `tm2`: Transmission Mode 2 in 4G
|
||||
* `oaiue`: specifies usage with OAI UE and not COTS UE
|
||||
|
||||
Examples:
|
||||
- standard monolithic gNB, 2x2 configuration, with SDAP: `gnb.sa.band78.162prb.usrpn310.2x2-sdap.conf`
|
||||
- gNB-CU: `gnb-cu.sa.f1.conf`
|
||||
- monolithic gNB, L2sim: `gnb.sa.band77.106prb.l2sim.conf`
|
||||
- RCC (4G eNB with IF4.5 split): `enb.band40.25prb.if45.tm1-fairscheduler.conf`
|
||||
|
||||
Notes:
|
||||
- there is no need for TDD/FDD, this is encoded in the band number
|
||||
- there is no need for FR1/FR2, this is encoded in the band number
|
||||
@@ -166,7 +166,7 @@ gNBs =
|
||||
|
||||
|
||||
////////// AMF parameters:
|
||||
amf_ip_address = ( { ipv4 = "192.168.70.132";
|
||||
amf_ip_address = ( { ipv4 = "192.168.71.132";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
@@ -177,9 +177,9 @@ gNBs =
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.71.140/24";
|
||||
GNB_INTERFACE_NAME_FOR_NGU = "demo-oai";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.71.140/24";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ function create_vm {
|
||||
echo "VM_CPU = $VM_CPU"
|
||||
echo "VM_DISK = $VM_DISK GBytes"
|
||||
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]]
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]] || [[ "$VM_NAME" == *"rf5g-sim"* ]]
|
||||
then
|
||||
echo "This VM type is no longer supported in the pipeline framework"
|
||||
return
|
||||
|
||||
@@ -1095,12 +1095,12 @@ function start_rf_sim_gnb {
|
||||
then
|
||||
if [ $LOC_RA_SA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||
then
|
||||
echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test --lowmem --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option
|
||||
then
|
||||
echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra --lowmem --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
else #SA test => use --sa option
|
||||
echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --rfsim --sa --lowmem \" > ./my-nr-softmodem-run.sh " >> $1
|
||||
echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --parallel-config PARALLEL_SINGLE_THREAD --rfsim --sa \" > ./my-nr-softmodem-run.sh " >> $1
|
||||
fi
|
||||
fi
|
||||
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
|
||||
@@ -1305,14 +1305,8 @@ function run_test_on_vm {
|
||||
return
|
||||
elif [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf5g-sim.* )) ]]
|
||||
then
|
||||
GNB_VM_NAME=`echo $VM_NAME | sed -e "s#rf5g-sim#gnb-usrp#"`
|
||||
GNB_VM_CMDS=${GNB_VM_NAME}_cmds.txt
|
||||
echo "GNB_VM_NAME = $GNB_VM_NAME"
|
||||
echo "GNB_VM_CMD_FILE = $GNB_VM_CMDS"
|
||||
NR_UE_VM_NAME=`echo $VM_NAME | sed -e "s#rf5g-sim#nr-ue-usrp#"`
|
||||
NR_UE_VM_CMDS=${UE_VM_NAME}_cmds.txt
|
||||
echo "NR_UE_VM_NAME = $NR_UE_VM_NAME"
|
||||
echo "NR_UE_VM_CMD_FILE = $NR_UE_VM_CMDS"
|
||||
echo "This VM test type is no longer supported in the pipeline framework"
|
||||
return
|
||||
else
|
||||
echo "VM_NAME = $VM_NAME"
|
||||
echo "VM_CMD_FILE = $VM_CMDS"
|
||||
|
||||
@@ -47,7 +47,7 @@ function wait_on_vm_build {
|
||||
echo "ARCHIVES_LOC = $ARCHIVES_LOC"
|
||||
echo "BUILD_OPTIONS = $BUILD_OPTIONS"
|
||||
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]]
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]] || [[ "$VM_NAME" == *"rf5g-sim"* ]] || [[ "$VM_NAME" == *"gnb-usrp"* ]] || [[ "$VM_NAME" == *"nr-ue-usrp"* ]]
|
||||
then
|
||||
echo "This VM type is no longer supported in the pipeline framework"
|
||||
return
|
||||
@@ -93,7 +93,7 @@ function wait_on_vm_build {
|
||||
}
|
||||
|
||||
function check_on_vm_build {
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]]
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] || [[ "$VM_NAME" == *"-rf-sim"* ]] || [[ "$VM_NAME" == *"-ethernet"* ]] || [[ "$VM_NAME" == *"rf5g-sim"* ]] || [[ "$VM_NAME" == *"gnb-usrp"* ]] || [[ "$VM_NAME" == *"nr-ue-usrp"* ]]
|
||||
then
|
||||
echo "This VM type is no longer supported in the pipeline framework"
|
||||
return
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
-->
|
||||
<testCaseList>
|
||||
<htmlTabRef>rfsim-5gnr-tdd</htmlTabRef>
|
||||
<htmlTabName>Monolithic TDD gNB</htmlTabName>
|
||||
<htmlTabName>Monolithic SA TDD gNB</htmlTabName>
|
||||
<htmlTabIcon>wrench</htmlTabIcon>
|
||||
<repeatCount>1</repeatCount>
|
||||
<TestCaseRequestedList>
|
||||
|
||||
124
ci-scripts/xml_files/container_5g_rfsim_24prb.xml
Normal file
124
ci-scripts/xml_files/container_5g_rfsim_24prb.xml
Normal file
@@ -0,0 +1,124 @@
|
||||
<!--
|
||||
|
||||
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>rfsim-24prb-5gnr-tdd</htmlTabRef>
|
||||
<htmlTabName>Monolithic SA TDD gNB 24PRB</htmlTabName>
|
||||
<htmlTabIcon>wrench</htmlTabIcon>
|
||||
<repeatCount>1</repeatCount>
|
||||
<TestCaseRequestedList>
|
||||
111111
|
||||
100001
|
||||
000000
|
||||
000001
|
||||
000002
|
||||
000003
|
||||
020001
|
||||
020002
|
||||
030001
|
||||
030002
|
||||
100001
|
||||
</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 oai-nr-ue</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>oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn</services>
|
||||
<nb_healthy>6</nb_healthy>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000002">
|
||||
<class>DeployGenObject</class>
|
||||
<desc>Deploy OAI 5G gNB RF sim SA</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_24prb</yaml_path>
|
||||
<services>oai-gnb</services>
|
||||
<nb_healthy>7</nb_healthy>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000003">
|
||||
<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>8</nb_healthy>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020001">
|
||||
<class>PingFromContainer</class>
|
||||
<desc>Ping ext-dn from NR-UE</desc>
|
||||
<container_name>rfsim5g-oai-nr-ue</container_name>
|
||||
<options>-I oaitun_ue1 -c 20 -i0.2 192.168.72.135</options>
|
||||
<loss_threshold>5</loss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020002">
|
||||
<class>PingFromContainer</class>
|
||||
<desc>Ping NR-UE from ext-dn</desc>
|
||||
<container_name>rfsim5g-oai-ext-dn</container_name>
|
||||
<options>-c 20 12.1.1.2 -i0.2</options>
|
||||
<loss_threshold>5</loss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030001">
|
||||
<class>IperfFromContainer</class>
|
||||
<desc>Iperf UDP Downlink</desc>
|
||||
<server_container_name>rfsim5g-oai-nr-ue</server_container_name>
|
||||
<client_container_name>rfsim5g-oai-ext-dn</client_container_name>
|
||||
<server_options>-B 12.1.1.2 -u -i 1 -s</server_options>
|
||||
<client_options>-c 12.1.1.2 -u -i 1 -t 5 -b 3M</client_options>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030002">
|
||||
<class>IperfFromContainer</class>
|
||||
<desc>Iperf UDP Uplink</desc>
|
||||
<server_container_name>rfsim5g-oai-ext-dn</server_container_name>
|
||||
<client_container_name>rfsim5g-oai-nr-ue</client_container_name>
|
||||
<server_options>-u -i 1 -s</server_options>
|
||||
<client_options>-B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 5 -b 1M</client_options>
|
||||
</testCase>
|
||||
|
||||
<testCase id="100001">
|
||||
<class>UndeployGenObject</class>
|
||||
<desc>Undeploy all OAI 5G stack</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_24prb</yaml_path>
|
||||
<d_retx_th>1,0,0,0</d_retx_th>
|
||||
<u_retx_th>1,0,0,0</u_retx_th>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
45
ci-scripts/xml_files/container_5g_rfsim_24prb_down.xml
Normal file
45
ci-scripts/xml_files/container_5g_rfsim_24prb_down.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<!--
|
||||
|
||||
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>rfsim-24prb-5gnr-down</htmlTabRef>
|
||||
<htmlTabName>CleanUp Monolithic SA TDD gNB 24PRB</htmlTabName>
|
||||
<htmlTabIcon>trash</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
100002
|
||||
222222
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="100002">
|
||||
<class>UndeployGenObject</class>
|
||||
<desc>Undeploy all OAI 5G stack</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_24prb</yaml_path>
|
||||
</testCase>
|
||||
|
||||
<testCase id="222222">
|
||||
<class>Clean_Test_Server_Images</class>
|
||||
<desc>Clean Test Images on Test Server</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -22,7 +22,7 @@
|
||||
-->
|
||||
<testCaseList>
|
||||
<htmlTabRef>rfsim-5gnr-down</htmlTabRef>
|
||||
<htmlTabName>CleanUp Monolithic TDD gNB</htmlTabName>
|
||||
<htmlTabName>CleanUp SA Monolithic TDD gNB</htmlTabName>
|
||||
<htmlTabIcon>trash</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
100002
|
||||
|
||||
106
ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml
Normal file
106
ci-scripts/xml_files/container_5g_rfsim_fdd_phytest.xml
Normal file
@@ -0,0 +1,106 @@
|
||||
<!--
|
||||
|
||||
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>rfsim-5gnr-fdd-phytest</htmlTabRef>
|
||||
<htmlTabName>Monolithic FDD phytest gNB</htmlTabName>
|
||||
<htmlTabIcon>wrench</htmlTabIcon>
|
||||
<repeatCount>1</repeatCount>
|
||||
<TestCaseRequestedList>
|
||||
111111
|
||||
100011
|
||||
000010
|
||||
000011
|
||||
020011
|
||||
020012
|
||||
030011
|
||||
030012
|
||||
100011
|
||||
</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 oai-nr-ue</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000010">
|
||||
<class>DeployGenObject</class>
|
||||
<desc>Deploy OAI 5G gNB RF sim SA</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_fdd_phytest</yaml_path>
|
||||
<services>oai-gnb</services>
|
||||
<nb_healthy>1</nb_healthy>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000011">
|
||||
<class>DeployGenObject</class>
|
||||
<desc>Deploy OAI 5G NR-UE RF sim SA</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_fdd_phytest</yaml_path>
|
||||
<services>oai-nr-ue</services>
|
||||
<nb_healthy>2</nb_healthy>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020011">
|
||||
<class>PingFromContainer</class>
|
||||
<desc>Ping gNB from NR-UE</desc>
|
||||
<container_name>rfsim5g-oai-nr-ue</container_name>
|
||||
<options>-c20 -i0.2 10.0.1.1</options>
|
||||
<loss_threshold>0</loss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020012">
|
||||
<class>PingFromContainer</class>
|
||||
<desc>Ping NR-UE from gNB</desc>
|
||||
<container_name>rfsim5g-oai-gnb</container_name>
|
||||
<options>-c20 -i0.2 10.0.1.2</options>
|
||||
<loss_threshold>0</loss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030011">
|
||||
<class>IperfFromContainer</class>
|
||||
<desc>Iperf UDP Downlink</desc>
|
||||
<server_container_name>rfsim5g-oai-nr-ue</server_container_name>
|
||||
<client_container_name>rfsim5g-oai-gnb</client_container_name>
|
||||
<server_options>-sui1 -B10.0.1.2</server_options>
|
||||
<client_options>-uc10.0.1.2 -i1 -t10 -b30k -B10.0.1.1</client_options>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030012">
|
||||
<class>IperfFromContainer</class>
|
||||
<desc>Iperf UDP Uplink</desc>
|
||||
<server_container_name>rfsim5g-oai-gnb</server_container_name>
|
||||
<client_container_name>rfsim5g-oai-nr-ue</client_container_name>
|
||||
<server_options>-sui1 -B10.0.1.1</server_options>
|
||||
<client_options>-uc10.0.1.1 -i1 -t10 -b30k -B10.0.1.2</client_options>
|
||||
</testCase>
|
||||
|
||||
<testCase id="100011">
|
||||
<class>UndeployGenObject</class>
|
||||
<desc>Undeploy all OAI 5G stack</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_fdd_phytest</yaml_path>
|
||||
<d_retx_th>10,100,100,100</d_retx_th> <!-- phytest: will fail at start! -->
|
||||
<u_retx_th>10,100,100,100</u_retx_th> <!-- phytest: will fail at start! -->
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
45
ci-scripts/xml_files/container_5g_rfsim_fdd_phytest_down.xml
Normal file
45
ci-scripts/xml_files/container_5g_rfsim_fdd_phytest_down.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<!--
|
||||
|
||||
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>rfsim-5gnr-fdd-phytest-down</htmlTabRef>
|
||||
<htmlTabName>CleanUp Monolithic FDD phytest gNB</htmlTabName>
|
||||
<htmlTabIcon>trash</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
100012
|
||||
222222
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="100012">
|
||||
<class>UndeployGenObject</class>
|
||||
<desc>Undeploy all OAI 5G stack</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_fdd_phytest</yaml_path>
|
||||
</testCase>
|
||||
|
||||
<testCase id="222222">
|
||||
<class>Clean_Test_Server_Images</class>
|
||||
<desc>Clean Test Images on Test Server</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
86
ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml
Normal file
86
ci-scripts/xml_files/container_5g_rfsim_fr2_32prb.xml
Normal file
@@ -0,0 +1,86 @@
|
||||
<!--
|
||||
|
||||
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>rfsim-fr2-32prb-5gnr-tdd</htmlTabRef>
|
||||
<htmlTabName>Monolithic FR2 do-ra gNB</htmlTabName>
|
||||
<htmlTabIcon>wrench</htmlTabIcon>
|
||||
<repeatCount>1</repeatCount>
|
||||
<TestCaseRequestedList>
|
||||
111111
|
||||
100001
|
||||
000000
|
||||
000001
|
||||
020001
|
||||
020002
|
||||
100001
|
||||
</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 oai-nr-ue</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000000">
|
||||
<class>DeployGenObject</class>
|
||||
<desc>Deploy OAI gNB</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_fr2_32prb</yaml_path>
|
||||
<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-nr-ue</services>
|
||||
<nb_healthy>2</nb_healthy>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020001">
|
||||
<class>PingFromContainer</class>
|
||||
<desc>Ping gNB from NR-UE</desc>
|
||||
<container_name>rfsim5g-oai-nr-ue</container_name>
|
||||
<options>-c20 -i0.2 10.0.1.1</options>
|
||||
<loss_threshold>0</loss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020002">
|
||||
<class>PingFromContainer</class>
|
||||
<desc>Ping NR-UE from gNB</desc>
|
||||
<container_name>rfsim5g-oai-gnb</container_name>
|
||||
<options>-c20 -i0.2 10.0.1.2</options>
|
||||
<loss_threshold>0</loss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="100001">
|
||||
<class>UndeployGenObject</class>
|
||||
<desc>Undeploy all OAI 5G stack</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_fr2_32prb</yaml_path>
|
||||
<d_retx_th>0,0,0,0</d_retx_th>
|
||||
<u_retx_th>0,0,0,0</u_retx_th>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
45
ci-scripts/xml_files/container_5g_rfsim_fr2_32prb_down.xml
Normal file
45
ci-scripts/xml_files/container_5g_rfsim_fr2_32prb_down.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<!--
|
||||
|
||||
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>rfsim-fr2-32prb-5gnr-down</htmlTabRef>
|
||||
<htmlTabName>CleanUp Monolithic FR2 do-ra gNB</htmlTabName>
|
||||
<htmlTabIcon>trash</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
100002
|
||||
222222
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="100002">
|
||||
<class>UndeployGenObject</class>
|
||||
<desc>Undeploy all OAI 5G stack</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_fr2_32prb</yaml_path>
|
||||
</testCase>
|
||||
|
||||
<testCase id="222222">
|
||||
<class>Clean_Test_Server_Images</class>
|
||||
<desc>Clean Test Images on Test Server</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
86
ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml
Normal file
86
ci-scripts/xml_files/container_5g_rfsim_tdd_dora.xml
Normal file
@@ -0,0 +1,86 @@
|
||||
<!--
|
||||
|
||||
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>rfsim-tdd-dora-5gnr-tdd</htmlTabRef>
|
||||
<htmlTabName>Monolithic do-ra TDD gNB</htmlTabName>
|
||||
<htmlTabIcon>wrench</htmlTabIcon>
|
||||
<repeatCount>1</repeatCount>
|
||||
<TestCaseRequestedList>
|
||||
111111
|
||||
100001
|
||||
000000
|
||||
000001
|
||||
020001
|
||||
020002
|
||||
100001
|
||||
</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 oai-nr-ue</images_to_pull>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000000">
|
||||
<class>DeployGenObject</class>
|
||||
<desc>Deploy OAI gNB</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_tdd_dora</yaml_path>
|
||||
<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_tdd_dora</yaml_path>
|
||||
<services>oai-nr-ue</services>
|
||||
<nb_healthy>2</nb_healthy>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020001">
|
||||
<class>PingFromContainer</class>
|
||||
<desc>Ping gNB from NR-UE</desc>
|
||||
<container_name>rfsim5g-oai-nr-ue</container_name>
|
||||
<options>-c20 -i0.2 10.0.1.1</options>
|
||||
<loss_threshold>0</loss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="020002">
|
||||
<class>PingFromContainer</class>
|
||||
<desc>Ping NR-UE from gNB</desc>
|
||||
<container_name>rfsim5g-oai-gnb</container_name>
|
||||
<options>-c20 -i0.2 10.0.1.2</options>
|
||||
<loss_threshold>0</loss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="100001">
|
||||
<class>UndeployGenObject</class>
|
||||
<desc>Undeploy all OAI 5G stack</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_tdd_dora</yaml_path>
|
||||
<d_retx_th>0,0,0,0</d_retx_th>
|
||||
<u_retx_th>0,0,0,0</u_retx_th>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
45
ci-scripts/xml_files/container_5g_rfsim_tdd_dora_down.xml
Normal file
45
ci-scripts/xml_files/container_5g_rfsim_tdd_dora_down.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<!--
|
||||
|
||||
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>rfsim-tdd-dora-5gnr-down</htmlTabRef>
|
||||
<htmlTabName>CleanUp Monolithic do-ra TDD gNB</htmlTabName>
|
||||
<htmlTabIcon>trash</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
100002
|
||||
222222
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="100002">
|
||||
<class>UndeployGenObject</class>
|
||||
<desc>Undeploy all OAI 5G stack</desc>
|
||||
<yaml_path>yaml_files/5g_rfsimulator_tdd_dora</yaml_path>
|
||||
</testCase>
|
||||
|
||||
<testCase id="222222">
|
||||
<class>Clean_Test_Server_Images</class>
|
||||
<desc>Clean Test Images on Test Server</desc>
|
||||
<test_svr_id>0</test_svr_id>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -54,7 +54,7 @@
|
||||
<testCase id="040000">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize gNB</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa --usrp-tx-thread-config 1 --tune-offset 30000000 --thread-pool 1,3,5,7,9,11,13,15 --gNBs.[0].min_rxtxtime 5 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
|
||||
<eNB_instance>0</eNB_instance>
|
||||
<eNB_serverId>0</eNB_serverId>
|
||||
<air_interface>nr</air_interface>
|
||||
|
||||
299
ci-scripts/yaml_files/5g_rfsimulator_24prb/docker-compose.yaml
Normal file
299
ci-scripts/yaml_files/5g_rfsimulator_24prb/docker-compose.yaml
Normal file
@@ -0,0 +1,299 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
oai-nrf:
|
||||
container_name: "rfsim5g-oai-nrf"
|
||||
image: oai-nrf:august-dev
|
||||
environment:
|
||||
- NRF_INTERFACE_NAME_FOR_SBI=eth0
|
||||
- NRF_INTERFACE_PORT_FOR_SBI=80
|
||||
- NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
|
||||
- NRF_API_VERSION=v1
|
||||
- INSTANCE=0
|
||||
- PID_DIRECTORY=/var/run
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.130
|
||||
volumes:
|
||||
- ../5g_rfsimulator/nrf-healthcheck.sh:/openair-nrf/bin/nrf-healthcheck.sh
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/openair-nrf/bin/nrf-healthcheck.sh"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
mysql:
|
||||
container_name: "rfsim5g-mysql"
|
||||
image: mysql:5.7
|
||||
volumes:
|
||||
- ../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: 5
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.131
|
||||
|
||||
oai-amf:
|
||||
container_name: "rfsim5g-oai-amf"
|
||||
image: oai-amf:august-dev
|
||||
environment:
|
||||
- TZ=Europe/paris
|
||||
- INSTANCE=0
|
||||
- PID_DIRECTORY=/var/run
|
||||
- MCC=208
|
||||
- MNC=99
|
||||
- REGION_ID=128
|
||||
- AMF_SET_ID=1
|
||||
- SERVED_GUAMI_MCC_0=208
|
||||
- SERVED_GUAMI_MNC_0=99
|
||||
- SERVED_GUAMI_REGION_ID_0=128
|
||||
- SERVED_GUAMI_AMF_SET_ID_0=1
|
||||
- SERVED_GUAMI_MCC_1=460
|
||||
- SERVED_GUAMI_MNC_1=11
|
||||
- SERVED_GUAMI_REGION_ID_1=10
|
||||
- SERVED_GUAMI_AMF_SET_ID_1=1
|
||||
- PLMN_SUPPORT_MCC=208
|
||||
- PLMN_SUPPORT_MNC=99
|
||||
- PLMN_SUPPORT_TAC=0x0001
|
||||
- SST_0=1
|
||||
- SD_0=0xffffff
|
||||
- SST_1=1
|
||||
- SD_1=1
|
||||
- AMF_INTERFACE_NAME_FOR_NGAP=eth0
|
||||
- AMF_INTERFACE_NAME_FOR_N11=eth0
|
||||
- SMF_INSTANCE_ID_0=1
|
||||
- SMF_FQDN_0=oai-smf
|
||||
- SMF_IPV4_ADDR_0=0.0.0.0
|
||||
- SMF_HTTP_VERSION_0=v1
|
||||
- SELECTED_0=true
|
||||
- SMF_INSTANCE_ID_1=2
|
||||
- SMF_FQDN_1=oai-smf
|
||||
- SMF_IPV4_ADDR_1=0.0.0.0
|
||||
- SMF_HTTP_VERSION_1=v1
|
||||
- SELECTED_1=false
|
||||
- MYSQL_SERVER=192.168.71.131
|
||||
- MYSQL_USER=root
|
||||
- MYSQL_PASS=linux
|
||||
- MYSQL_DB=oai_db
|
||||
- OPERATOR_KEY=c42449363bbad02b66d16bc975d77cc1
|
||||
- NRF_IPV4_ADDRESS=192.168.71.130
|
||||
- NRF_PORT=80
|
||||
- NF_REGISTRATION=yes
|
||||
- SMF_SELECTION=yes
|
||||
- USE_FQDN_DNS=yes
|
||||
- NRF_API_VERSION=v1
|
||||
- NRF_FQDN=oai-nrf
|
||||
- EXTERNAL_AUSF=no
|
||||
- AUSF_IPV4_ADDRESS=0.0.0.0
|
||||
- AUSF_PORT=80
|
||||
- AUSF_API_VERSION=v1
|
||||
- AUSF_FQDN=localhost
|
||||
depends_on:
|
||||
- oai-nrf
|
||||
- mysql
|
||||
volumes:
|
||||
- ../5g_rfsimulator/amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/openair-amf/bin/amf-healthcheck.sh"
|
||||
interval: 10s
|
||||
timeout: 15s
|
||||
retries: 5
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.132
|
||||
|
||||
oai-smf:
|
||||
container_name: "rfsim5g-oai-smf"
|
||||
image: oai-smf:august-dev
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- INSTANCE=0
|
||||
- PID_DIRECTORY=/var/run
|
||||
- SMF_INTERFACE_NAME_FOR_N4=eth0
|
||||
- SMF_INTERFACE_NAME_FOR_SBI=eth0
|
||||
- SMF_INTERFACE_PORT_FOR_SBI=80
|
||||
- SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
|
||||
- SMF_API_VERSION=v1
|
||||
- DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100
|
||||
- DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4
|
||||
- AMF_IPV4_ADDRESS=0.0.0.0
|
||||
- AMF_PORT=80
|
||||
- AMF_API_VERSION=v1
|
||||
- AMF_FQDN=oai-amf
|
||||
- UDM_IPV4_ADDRESS=127.0.0.1
|
||||
- UDM_PORT=80
|
||||
- UDM_API_VERSION=v1
|
||||
- UDM_FQDN=localhost
|
||||
- UPF_IPV4_ADDRESS=192.168.71.134
|
||||
- UPF_FQDN_0=oai-spgwu
|
||||
- NRF_IPV4_ADDRESS=192.168.71.130
|
||||
- NRF_PORT=80
|
||||
- NRF_API_VERSION=v1
|
||||
- NRF_FQDN=oai-nrf
|
||||
- REGISTER_NRF=yes
|
||||
- DISCOVER_UPF=yes
|
||||
- USE_FQDN_DNS=yes
|
||||
- DNN_NI0=oai
|
||||
- TYPE0=IPv4
|
||||
- DNN_RANGE0=12.1.1.2 - 12.1.1.127
|
||||
- NSSAI_SST0=1
|
||||
- NSSAI_SD0=0xFFFFFF
|
||||
- SESSION_AMBR_UL0=200Mbps
|
||||
- SESSION_AMBR_DL0=400Mbps
|
||||
- DNN_NI2=oai.ipv4
|
||||
depends_on:
|
||||
- oai-nrf
|
||||
- oai-amf
|
||||
volumes:
|
||||
- ../5g_rfsimulator/smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.133
|
||||
|
||||
oai-spgwu:
|
||||
container_name: "rfsim5g-oai-spgwu"
|
||||
image: oai-spgwu-tiny:august-dev
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- PID_DIRECTORY=/var/run
|
||||
- SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP=eth0
|
||||
- SGW_INTERFACE_NAME_FOR_SX=eth0
|
||||
- PGW_INTERFACE_NAME_FOR_SGI=eth0
|
||||
- NETWORK_UE_NAT_OPTION=yes
|
||||
- NETWORK_UE_IP=12.1.1.0/24
|
||||
- SPGWC0_IP_ADDRESS=192.168.71.133
|
||||
- BYPASS_UL_PFCP_RULES=no
|
||||
- MCC=208
|
||||
- MNC=99
|
||||
- MNC03=099
|
||||
- TAC=1
|
||||
- GTP_EXTENSION_HEADER_PRESENT=yes
|
||||
- GW_ID=1
|
||||
- REALM=openairinterface.org
|
||||
- ENABLE_5G_FEATURES=yes
|
||||
- REGISTER_NRF=yes
|
||||
- USE_FQDN_NRF=yes
|
||||
- UPF_FQDN_5G=oai-spgwu
|
||||
- NRF_IPV4_ADDRESS=192.168.71.130
|
||||
- NRF_PORT=80
|
||||
- NRF_API_VERSION=v1
|
||||
- NRF_FQDN=oai-nrf
|
||||
- NSSAI_SST_0=1
|
||||
- NSSAI_SD_0=0xffffff
|
||||
- DNN_0=oai
|
||||
depends_on:
|
||||
- oai-nrf
|
||||
- oai-smf
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- SYS_ADMIN
|
||||
cap_drop:
|
||||
- ALL
|
||||
privileged: true
|
||||
volumes:
|
||||
- ../5g_rfsimulator/spgwu-healthcheck.sh:/openair-spgwu-tiny/bin/spgwu-healthcheck.sh
|
||||
healthcheck:
|
||||
test: /bin/bash -c "/openair-spgwu-tiny/bin/spgwu-healthcheck.sh"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.134
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.134
|
||||
|
||||
oai-ext-dn:
|
||||
image: ubuntu:bionic
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-ext-dn
|
||||
entrypoint: /bin/bash -c \
|
||||
"apt update; apt install -y procps iptables iproute2 iperf iputils-ping;"\
|
||||
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
|
||||
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
|
||||
depends_on:
|
||||
- oai-spgwu
|
||||
networks:
|
||||
traffic_net:
|
||||
ipv4_address: 192.168.72.135
|
||||
healthcheck:
|
||||
test: /bin/bash -c "ping -c 2 192.168.72.134"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
oai-gnb:
|
||||
image: oai-gnb:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
RFSIMULATOR: server
|
||||
USE_VOLUMED_CONF: 'yes'
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
- oai-ext-dn
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.140
|
||||
volumes:
|
||||
- ../../conf_files/gnb.sa.band78.fr1.24PRB.usrpb210.conf:/opt/oai-gnb/etc/mounted.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
oai-nr-ue:
|
||||
image: oai-nr-ue:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
RFSIMULATOR: 192.168.71.140
|
||||
FULL_IMSI: '208990100001100'
|
||||
FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
|
||||
OPC: 'C42449363BBAD02B66D16BC975D77CC1'
|
||||
DNN: oai
|
||||
NSSAI_SST: 1
|
||||
USE_ADDITIONAL_OPTIONS: --sa --rfsim -r 24 --ssb 24 --numerology 1 -C 3604320000 --nokrnmod --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.150
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
public_net:
|
||||
driver: bridge
|
||||
name: rfsim5g-oai-public-net
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 192.168.71.128/26
|
||||
driver_opts:
|
||||
com.docker.network.bridge.name: "rfsim5g-public"
|
||||
traffic_net:
|
||||
driver: bridge
|
||||
name: rfsim5g-oai-traffic-net
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 192.168.72.128/26
|
||||
driver_opts:
|
||||
com.docker.network.bridge.name: "rfsim5g-traffic"
|
||||
@@ -0,0 +1,59 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
oai-gnb:
|
||||
image: oai-gnb:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
RFSIMULATOR: server
|
||||
USE_VOLUMED_CONF: 'yes'
|
||||
USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --noS1 --nokrnmod --log_config.global_log_options level,nocolor,time
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.140
|
||||
volumes:
|
||||
- ../../conf_files/gnb.band66.tm1.106PRB.usrpn300.conf:/opt/oai-gnb/etc/mounted.conf
|
||||
- rrc.config:/opt/oai-gnb/
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
oai-nr-ue:
|
||||
image: oai-nr-ue:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
RFSIMULATOR: 192.168.71.140
|
||||
FULL_IMSI: '208930100001100'
|
||||
FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
|
||||
OPC: 'C42449363BBAD02B66D16BC975D77CC1'
|
||||
DNN: oai
|
||||
NSSAI_SST: 1
|
||||
USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --noS1 --nokrnmod --rrc_config_path etc/rrc/ --log_config.global_log_options level,nocolor,time
|
||||
volumes:
|
||||
- rrc.config:/opt/oai-nr-ue/etc/rrc/
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.150
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
rrc.config:
|
||||
|
||||
networks:
|
||||
public_net:
|
||||
driver: bridge
|
||||
name: rfsim5g-oai-public-net
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 192.168.71.128/26
|
||||
driver_opts:
|
||||
com.docker.network.bridge.name: "rfsim5g-public"
|
||||
@@ -0,0 +1,59 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
oai-gnb:
|
||||
image: oai-gnb:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
RFSIMULATOR: server
|
||||
USE_VOLUMED_CONF: 'yes'
|
||||
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --nokrnmod --log_config.global_log_options level,nocolor,time
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.140
|
||||
volumes:
|
||||
- ../../conf_files/gnb.band261.tm1.32PRB.usrpn300.conf:/opt/oai-gnb/etc/mounted.conf
|
||||
- rrc.config:/opt/oai-gnb/
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
oai-nr-ue:
|
||||
image: oai-nr-ue:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
RFSIMULATOR: 192.168.71.140
|
||||
FULL_IMSI: '311480100001100'
|
||||
FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
|
||||
OPC: 'C42449363BBAD02B66D16BC975D77CC1'
|
||||
DNN: oai
|
||||
NSSAI_SST: 1
|
||||
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --rrc_config_path etc/rrc/ --nokrnmod --log_config.global_log_options level,nocolor,time
|
||||
volumes:
|
||||
- rrc.config:/opt/oai-nr-ue/etc/rrc/
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.150
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
rrc.config:
|
||||
|
||||
networks:
|
||||
public_net:
|
||||
driver: bridge
|
||||
name: rfsim5g-oai-public-net
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 192.168.71.128/26
|
||||
driver_opts:
|
||||
com.docker.network.bridge.name: "rfsim5g-public"
|
||||
@@ -0,0 +1,59 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
oai-gnb:
|
||||
image: oai-gnb:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-gnb
|
||||
environment:
|
||||
RFSIMULATOR: server
|
||||
USE_VOLUMED_CONF: 'yes'
|
||||
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --nokrnmod --log_config.global_log_options level,nocolor,time
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.140
|
||||
volumes:
|
||||
- ../../conf_files/gnb.band78.tm1.106PRB.usrpn300.conf:/opt/oai-gnb/etc/mounted.conf
|
||||
- rrc.config:/opt/oai-gnb/
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
oai-nr-ue:
|
||||
image: oai-nr-ue:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-nr-ue
|
||||
environment:
|
||||
RFSIMULATOR: 192.168.71.140
|
||||
FULL_IMSI: '208930100001100'
|
||||
FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
|
||||
OPC: 'C42449363BBAD02B66D16BC975D77CC1'
|
||||
DNN: oai
|
||||
NSSAI_SST: 1
|
||||
USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --rrc_config_path etc/rrc/ --nokrnmod --log_config.global_log_options level,nocolor,time
|
||||
volumes:
|
||||
- rrc.config:/opt/oai-nr-ue/etc/rrc/
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.150
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
rrc.config:
|
||||
|
||||
networks:
|
||||
public_net:
|
||||
driver: bridge
|
||||
name: rfsim5g-oai-public-net
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 192.168.71.128/26
|
||||
driver_opts:
|
||||
com.docker.network.bridge.name: "rfsim5g-public"
|
||||
@@ -114,6 +114,7 @@ function test_run() {
|
||||
|
||||
for (( run_index=1; run_index <= $nruns; run_index++ ))
|
||||
do
|
||||
temp_exec_log="$log_dir/test.$test_case_name.${tags_array[$tags_array_index]}.run_$run_index"
|
||||
echo "</EXECUTION LOG Test Case = $test_case_name.${tags_array[$tags_array_index]}, Run = $run_index >" >> $temp_exec_log 2>&1
|
||||
cat "$temp_exec_log" >> "$log_file" 2>&1
|
||||
|
||||
|
||||
@@ -399,12 +399,16 @@
|
||||
<testCase id="nr_ulsim.mimo">
|
||||
<desc>nr_ulsim Test cases. (Test1: MCS 19 50 PRBs 2 RX_Antenna),
|
||||
(Test2: MCS 9 106 PRBs MIMO 2 layers),
|
||||
(Test3: MCS 9 106 PRBs MIMO 4 layers)</desc>
|
||||
(Test3: MCS 10 106 PRBs MIMO 2 layers),
|
||||
(Test4: MCS 19 106 PRBs MIMO 2 layers),
|
||||
(Test5: MCS 9 106 PRBs MIMO 4 layers)</desc>
|
||||
<main_exec>nr_ulsim</main_exec>
|
||||
<main_exec_args>-n100 -m19 -s10 -S15 -z2
|
||||
-n100 -m9 -r106 -s8 -W2 -y2 -z2
|
||||
-n100 -m10 -r106 -s12 -W2 -y2 -z2
|
||||
-n100 -m19 -r106 -s22 -W2 -y2 -z2
|
||||
-n100 -m9 -r106 -s10 -W4 -y4 -z4</main_exec_args>
|
||||
<tags>test1 test2 test3</tags>
|
||||
<tags>test1 test2 test3 test4 test5</tags>
|
||||
<search_expr_true>PUSCH test OK</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
@@ -436,30 +440,30 @@
|
||||
(Test23: 3GPP G-FR1-A5-14, PUSCH Type B, 100 MHz BW, 30 kHz SCS, 4 RX Antennas Requirements Test),
|
||||
(Test24: 3GPP G-FR1-A5-14, PUSCH Type B, 100 MHz BW, 30 kHz SCS, 8 RX Antennas Requirements Test)</desc>
|
||||
<main_exec>nr_ulsim</main_exec>
|
||||
<main_exec_args>-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 0,1,1,2 -z2 -s12.4 -S12.4
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 0,1,1,2 -z4 -s8.5 -S8.5
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 0,1,1,2 -z8 -s5.4 -S5.4
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R25 -r25 -U 1,1,1,2 -z2 -s12.5 -S12.5
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R25 -r25 -U 1,1,1,2 -z4 -s8.9 -S8.9
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R25 -r25 -U 1,1,1,2 -z8 -s5.7 -S5.7
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R52 -r52 -U 1,1,1,2 -z2 -s12.6 -S12.6
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R52 -r52 -U 1,1,1,2 -z4 -s8.9 -S8.9
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R52 -r52 -U 1,1,1,2 -z8 -s5.8 -S5.8
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R106 -r106 -U 1,1,1,2 -z2 -s12.3 -S12.3
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R106 -r106 -U 1,1,1,2 -z4 -s8.8 -S8.8
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R106 -r106 -U 1,1,1,2 -z8 -s5.7 -S5.7
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R24 -r24 -U 1,1,1,2 -z2 -s12.5 -S12.5
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R24 -r24 -U 1,1,1,2 -z4 -s8.6 -S8.6
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R24 -r24 -U 1,1,1,2 -z8 -s5.6 -S5.6
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R51 -r51 -U 1,1,1,2 -z2 -s12.5 -S12.5
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R51 -r51 -U 1,1,1,2 -z4 -s8.6 -S8.6
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R51 -r51 -U 1,1,1,2 -z8 -s5.6 -S5.6
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 1,1,1,2 -z2 -s12.5 -S12.5
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 1,1,1,2 -z4 -s8.7 -S8.7
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 1,1,1,2 -z8 -s5.5 -S5.5
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R273 -r273 -U 1,1,1,2 -z2 -s13.1 -S13.1
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R273 -r273 -U 1,1,1,2 -z4 -s9.2 -S9.2
|
||||
-n100 -b14 -I15 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R273 -r273 -U 1,1,1,2 -z8 -s5.9 -S5.9</main_exec_args>
|
||||
<main_exec_args>-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 0,1,1,2 -z2 -s12.4 -S12.4
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 0,1,1,2 -z4 -s8.5 -S8.5
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 0,1,1,2 -z8 -s5.4 -S5.4
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R25 -r25 -U 1,1,1,2 -z2 -s12.5 -S12.5
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R25 -r25 -U 1,1,1,2 -z4 -s8.9 -S8.9
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R25 -r25 -U 1,1,1,2 -z8 -s5.7 -S5.7
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R52 -r52 -U 1,1,1,2 -z2 -s12.6 -S12.6
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R52 -r52 -U 1,1,1,2 -z4 -s8.9 -S8.9
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R52 -r52 -U 1,1,1,2 -z8 -s5.8 -S5.8
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R106 -r106 -U 1,1,1,2 -z2 -s12.3 -S12.3
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R106 -r106 -U 1,1,1,2 -z4 -s8.8 -S8.8
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 0 -m20 -R106 -r106 -U 1,1,1,2 -z8 -s5.7 -S5.7
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R24 -r24 -U 1,1,1,2 -z2 -s12.5 -S12.5
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R24 -r24 -U 1,1,1,2 -z4 -s8.6 -S8.6
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R24 -r24 -U 1,1,1,2 -z8 -s5.6 -S5.6
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R51 -r51 -U 1,1,1,2 -z2 -s12.5 -S12.5
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R51 -r51 -U 1,1,1,2 -z4 -s8.6 -S8.6
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R51 -r51 -U 1,1,1,2 -z8 -s5.6 -S5.6
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 1,1,1,2 -z2 -s12.5 -S12.5
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 1,1,1,2 -z4 -s8.7 -S8.7
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R106 -r106 -U 1,1,1,2 -z8 -s5.5 -S5.5
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R273 -r273 -U 1,1,1,2 -z2 -s13.1 -S13.1
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R273 -r273 -U 1,1,1,2 -z4 -s9.2 -S9.2
|
||||
-n100 -b14 -I7 -i 0,1 -g A,l,10 -t70 -u 1 -m20 -R273 -r273 -U 1,1,1,2 -z8 -s5.9 -S5.9</main_exec_args>
|
||||
<tags>test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 test20 test21 test22 test23 test24</tags>
|
||||
<search_expr_true>PUSCH test OK</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
|
||||
@@ -56,6 +56,13 @@ CMAKE_CMD="$CMAKE"
|
||||
BUILD_ECLIPSE=0
|
||||
NR="False"
|
||||
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope"
|
||||
ulfiusdep=$(basename ./`find /usr/lib* -name libulfius.so`)
|
||||
jssondep=$(basename ./`find /usr/lib* -name libjansson.so`)
|
||||
if [ "$ulfiusdep" == "libulfius.so" -a "$jssondep" == "libjansson.so" ] ; then
|
||||
OPTIONAL_LIBRARIES+=" websrv"
|
||||
else
|
||||
echo_warning " websrv optional build not included in build-lib option as dependencies requirements not met "
|
||||
fi
|
||||
RU=0
|
||||
CMAKE_C_FLAGS=()
|
||||
CMAKE_CXX_FLAGS=()
|
||||
@@ -644,9 +651,27 @@ function main() {
|
||||
if [ ! -z "$BUILD_OPTLIB" ] ; then
|
||||
for oklib in $BUILD_OPTLIB ; do
|
||||
compilations $BUILD_DIR $oklib
|
||||
if [ "$oklib" == "websrv" ] ; then
|
||||
BUILD_WEBSRVFRONT=1
|
||||
echo_info "Build of websrv frontend enabled"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
############################################
|
||||
# Optional targets (others than libraries) #
|
||||
############################################
|
||||
if [ "$BUILD_WEBSRVFRONT" = "1" ] ; then
|
||||
npmv=`command npm -v`
|
||||
npms=$?
|
||||
nodev=`command node -v`
|
||||
nodes=$?
|
||||
if [ "$npms" == "0" -a "$nodes" == "0" ] ; then
|
||||
compilations $BUILD_DIR websrvfront
|
||||
else
|
||||
echo_warning "build of websrv front-end skipped, dependencies not met : " $npmv " " $nodev
|
||||
fi
|
||||
fi
|
||||
####################################################
|
||||
# Build RF device and transport protocol libraries #
|
||||
####################################################
|
||||
|
||||
@@ -18,6 +18,7 @@ The debug level is a mask:
|
||||
* bit 2: print memory allocation/free performed by the config module
|
||||
* bit 3: print command line processing messages
|
||||
* bit 4: disable execution abort when parameters checking fails
|
||||
* bit 5: write a config file reflecting the parameters after reading the configuration file and processing the command line
|
||||
|
||||
As a oai user, you may have to use bit 1 (dbgl1) , to check your configuration and get the full name of a parameter you would like to modify on the command line. Other bits are for developers usage, (dbgl7 will print all debug messages).
|
||||
|
||||
@@ -27,7 +28,10 @@ $ ./lte-softmodem -O libconfig:<config>:dbgl1
|
||||
```bash
|
||||
$ ./lte-uesoftmodem -O cmdlineonly:dbgl1
|
||||
```
|
||||
bit 5 (dbgl32) can be useful to detect unused parameters from a config file or to detect parameters set to their default values, and not present in the config file
|
||||
|
||||
To get help on supported parameters you can use specific options:
|
||||
|
||||
* ---help: print help for command line only parameters and for parameters not defined in a specific section
|
||||
* ---help_< prefix > : print help for parameters defined under the section < prefix >
|
||||
|
||||
|
||||
@@ -88,10 +88,26 @@ int load_config_sharedlib(configmodule_interface_t *cfgptr) {
|
||||
st = -1;
|
||||
}
|
||||
|
||||
if (cfgptr->rtflags & CONFIG_SAVERUNCFG) {
|
||||
sprintf(fname, "config_%s_set", cfgptr->cfgmode);
|
||||
cfgptr->set = dlsym(lib_handle, fname);
|
||||
|
||||
if (cfgptr->set == NULL) {
|
||||
printf("[CONFIG] %s %d no function %s for config mode %s\n", __FILE__, __LINE__, fname, cfgptr->cfgmode);
|
||||
st = -1;
|
||||
}
|
||||
sprintf(fname, "config_%s_write_parsedcfg", cfgptr->cfgmode);
|
||||
cfgptr->write_parsedcfg = dlsym(lib_handle, fname);
|
||||
|
||||
if (cfgptr->write_parsedcfg == NULL) {
|
||||
printf("[CONFIG] %s %d no function %s for config mode %s\n", __FILE__, __LINE__, fname, cfgptr->cfgmode);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf (fname,"config_%s_end",cfgptr->cfgmode);
|
||||
cfgptr->end = dlsym(lib_handle,fname);
|
||||
|
||||
if (cfgptr->getlist == NULL ) {
|
||||
if (cfgptr->end == NULL) {
|
||||
printf("[CONFIG] %s %d no function %s for config mode %s\n",
|
||||
__FILE__, __LINE__,fname, cfgptr->cfgmode);
|
||||
}
|
||||
@@ -193,6 +209,7 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
uint32_t tmpflags=0;
|
||||
int i;
|
||||
int OoptIdx=-1;
|
||||
int OWoptIdx = -1;
|
||||
|
||||
printf("CMDLINE: ");
|
||||
for (int i=0; i<argc; i++)
|
||||
@@ -209,6 +226,10 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
OoptIdx=i;
|
||||
}
|
||||
|
||||
char *OWopt = strstr(argv[i], "OW");
|
||||
if (OWopt == argv[i] + 2) {
|
||||
OWoptIdx = i;
|
||||
}
|
||||
if ( strstr(argv[i], "help_config") != NULL ) {
|
||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME);
|
||||
exit(0);
|
||||
@@ -258,6 +279,11 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
/* argv[0] is the exec name, always Ok */
|
||||
cfgptr->argv_info[0] |= CONFIG_CMDLINEOPT_PROCESSED;
|
||||
|
||||
/* When reuested _(_--OW or rtflag is 5), a file with config parameters, as defined after all processing, will be created */
|
||||
if (OWoptIdx >= 0) {
|
||||
cfgptr->argv_info[OWoptIdx] |= CONFIG_CMDLINEOPT_PROCESSED;
|
||||
cfgptr->rtflags |= CONFIG_SAVERUNCFG;
|
||||
}
|
||||
/* when OoptIdx is >0, -O option has been detected at position OoptIdx
|
||||
* we must memorize arv[OoptIdx is Ok */
|
||||
if (OoptIdx >= 0) {
|
||||
@@ -294,14 +320,18 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
printf("%s ",cfgptr->cfgP[i]);
|
||||
}
|
||||
|
||||
printf(", debug flags: 0x%08x\n",cfgptr->rtflags);
|
||||
|
||||
if (cfgptr->rtflags & CONFIG_PRINTPARAMS) {
|
||||
cfgptr->status = malloc(sizeof(configmodule_status_t));
|
||||
}
|
||||
if (strstr(cfgparam,CONFIG_CMDLINEONLY) == NULL) {
|
||||
i=load_config_sharedlib(cfgptr);
|
||||
|
||||
if (i == 0) {
|
||||
printf("[CONFIG] config module %s loaded\n",cfgmode);
|
||||
Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].uptr=&(cfgptr->rtflags);
|
||||
int idx = config_paramidx_fromname(Config_Params, CONFIG_PARAMLENGTH(Config_Params), CONFIGP_DEBUGFLAGS);
|
||||
Config_Params[idx].uptr = &(cfgptr->rtflags);
|
||||
idx = config_paramidx_fromname(Config_Params, CONFIG_PARAMLENGTH(Config_Params), CONFIGP_TMPDIR);
|
||||
Config_Params[idx].strptr = &(cfgptr->tmpdir);
|
||||
config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME );
|
||||
} else {
|
||||
fprintf(stderr,"[CONFIG] %s %d config module \"%s\" couldn't be loaded\n", __FILE__, __LINE__,cfgmode);
|
||||
@@ -314,6 +344,8 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
cfgptr->end = (configmodule_endfunc_t)nooptfunc;
|
||||
}
|
||||
|
||||
printf("[CONFIG] debug flags: 0x%08x\n", cfgptr->rtflags);
|
||||
|
||||
if (modeparams != NULL) free(modeparams);
|
||||
|
||||
if (cfgmode != NULL) free(cfgmode);
|
||||
@@ -326,10 +358,28 @@ configmodule_interface_t *load_configmodule(int argc,
|
||||
return cfgptr;
|
||||
}
|
||||
|
||||
/* Possibly write config file, with parameters which have been read and after command line parsing */
|
||||
void write_parsedcfg(void)
|
||||
{
|
||||
if (cfgptr->status && (cfgptr->rtflags & CONFIG_SAVERUNCFG)) {
|
||||
printf_params("[CONFIG] Runtime params creation status: %i null values, %i errors, %i empty list or array, %i successfull \n",
|
||||
cfgptr->status->num_err_nullvalue,
|
||||
cfgptr->status->num_err_write,
|
||||
cfgptr->status->emptyla,
|
||||
cfgptr->status->num_write);
|
||||
}
|
||||
if (cfgptr != NULL) {
|
||||
if (cfgptr->write_parsedcfg != NULL) {
|
||||
printf("[CONFIG] calling config module write_parsedcfg function...\n");
|
||||
cfgptr->write_parsedcfg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* free memory allocated when reading parameters */
|
||||
/* config module could be initialized again after this call */
|
||||
void end_configmodule(void) {
|
||||
write_parsedcfg();
|
||||
if (cfgptr != NULL) {
|
||||
if (cfgptr->end != NULL) {
|
||||
printf ("[CONFIG] calling config module end function...\n");
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#define CONFIG_DEBUGPTR (1<<1) // print memory allocation/free debug messages
|
||||
#define CONFIG_DEBUGCMDLINE (1<<2) // print command line processing messages
|
||||
#define CONFIG_NOABORTONCHKF (1<<4) // disable abort execution when parameter checking function fails
|
||||
#define CONFIG_SAVERUNCFG (1 << 5) // create config file with running values, as after cfg file + command line processing
|
||||
#define CONFIG_NOEXITONHELP (1<<19) // do not exit after printing help
|
||||
#define CONFIG_HELP (1<<20) // print help message
|
||||
#define CONFIG_ABORT (1<<21) // config failed,abort execution
|
||||
@@ -61,8 +62,21 @@
|
||||
typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP);
|
||||
typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix);
|
||||
typedef int(*configmodule_getlistfunc_t)(paramlist_def_t *, paramdef_t *,int numparams, char *prefix);
|
||||
typedef int (*configmodule_setfunc_t)(paramdef_t *cfgoptions, int numoptions, char *prefix);
|
||||
typedef void(*configmodule_endfunc_t)(void);
|
||||
|
||||
typedef struct configmodule_status {
|
||||
int num_paramgroups;
|
||||
char **paramgroups_names;
|
||||
int num_err_nullvalue;
|
||||
int emptyla;
|
||||
int num_err_read;
|
||||
int num_err_write;
|
||||
int num_read;
|
||||
int num_write;
|
||||
char *debug_cfgname;
|
||||
} configmodule_status_t;
|
||||
|
||||
typedef struct oneBlock_s{
|
||||
void *ptrs;
|
||||
int sz;
|
||||
@@ -80,11 +94,15 @@ typedef struct configmodule_interface {
|
||||
configmodule_initfunc_t init;
|
||||
configmodule_getfunc_t get;
|
||||
configmodule_getlistfunc_t getlist;
|
||||
configmodule_setfunc_t set;
|
||||
configmodule_endfunc_t end;
|
||||
pthread_mutex_t memBlocks_mutex;
|
||||
configmodule_endfunc_t write_parsedcfg;
|
||||
uint32_t numptrs;
|
||||
uint32_t rtflags;
|
||||
oneBlock_t oneBlock[CONFIG_MAX_ALLOCATEDPTRS];
|
||||
char *tmpdir;
|
||||
configmodule_status_t *status; // allocated in debug mode only
|
||||
} configmodule_interface_t;
|
||||
|
||||
#ifdef CONFIG_LOADCONFIG_MAIN
|
||||
@@ -97,16 +115,19 @@ static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugfl
|
||||
incp parameter can be used to define the include path used for config files (@include directive)\n \
|
||||
defaults is set to the path of the main config file.\n";
|
||||
|
||||
#define CONFIG_SECTIONNAME "config"
|
||||
#define CONFIGPARAM_DEBUGFLAGS_IDX 0
|
||||
#define CONFIG_HELP_TMPDIR "<Repository to create temporary file>"
|
||||
|
||||
#define CONFIG_SECTIONNAME "config"
|
||||
#define CONFIGP_DEBUGFLAGS "debugflags"
|
||||
#define CONFIGP_TMPDIR "tmpdir"
|
||||
|
||||
static paramdef_t Config_Params[] = {
|
||||
/*-----------------------------------------------------------------------------------------------------------------------*/
|
||||
/* config parameters for config module */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-----------------------------------------------------------------------------------------------------------------------*/
|
||||
{"debugflags", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0},
|
||||
/*--------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* config parameters for config module */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*--------------------------------------------------------------------------------------------------------------------------*/
|
||||
{CONFIGP_DEBUGFLAGS, config_helpstr, 0, uptr : NULL, defintval : 0, TYPE_MASK, 0},
|
||||
{CONFIGP_TMPDIR, CONFIG_HELP_TMPDIR, PARAMFLAG_NOFREE, strptr : NULL, defstrval : "/tmp", TYPE_STRING, 0},
|
||||
};
|
||||
|
||||
#else
|
||||
@@ -126,6 +147,8 @@ extern configmodule_interface_t *load_configmodule(int argc, char **argv, uint32
|
||||
* a new config module init
|
||||
*/
|
||||
extern void end_configmodule(void);
|
||||
extern void write_parsedcfg(void);
|
||||
|
||||
/* free all config module memory, to be used at end of program as
|
||||
* it will free parameters values even those specified with the PARAMFLAG_NOFREE flag */
|
||||
extern void free_configmodule(void);
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#define PARAMFLAG_NOFREE (1 << 3) // don't free parameter in end function
|
||||
#define PARAMFLAG_BOOL (1 << 4) // integer param can be 0 or 1
|
||||
#define PARAMFLAG_CMDLINE_NOPREFIXENABLED (1 << 5) // on the command line, allow a parameter to be specified without the prefix
|
||||
#define PARAMFLAG_CMDLINEONLY (1 << 6) // this parameter cannot be specified in config file
|
||||
|
||||
/* Flags used by config modules to return info to calling modules and/or to for internal usage*/
|
||||
#define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module
|
||||
|
||||
@@ -275,6 +275,9 @@ int config_get(paramdef_t *params, int numparams, char *prefix) {
|
||||
|
||||
if (ret >= 0) {
|
||||
config_process_cmdline(params, numparams, prefix);
|
||||
if (cfgif->rtflags & CONFIG_SAVERUNCFG) {
|
||||
config_get_if()->set(params, numparams, prefix);
|
||||
}
|
||||
config_execcheck(params, numparams, prefix);
|
||||
}
|
||||
|
||||
@@ -312,6 +315,9 @@ int config_getlist(paramlist_def_t *ParamList, paramdef_t *params, int numparams
|
||||
// TODO config_process_cmdline?
|
||||
sprintf(cfgpath, "%s.[%i]", newprefix, i);
|
||||
config_process_cmdline(ParamList->paramarray[i],numparams,cfgpath);
|
||||
if (config_get_if()->rtflags & CONFIG_SAVERUNCFG) {
|
||||
config_get_if()->set(ParamList->paramarray[i], numparams, cfgpath);
|
||||
}
|
||||
config_execcheck(ParamList->paramarray[i], numparams, cfgpath);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,11 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
|
||||
#include <time.h>
|
||||
#include <libgen.h>
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include "config_libconfig.h"
|
||||
#include "config_libconfig_private.h"
|
||||
@@ -91,9 +94,219 @@ int read_intarray(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpat
|
||||
|
||||
return cfgoptions->numelt;
|
||||
}
|
||||
int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_setting_t *asetting, char *prefix)
|
||||
{
|
||||
int status;
|
||||
int errors = 0;
|
||||
int notused = 0;
|
||||
int emptyla = 0;
|
||||
#define LIBCONFIG_NOTUSED_PARAMS "Not used? (NULL value ptr)"
|
||||
char *secprefix = (prefix == NULL) ? "" : prefix;
|
||||
|
||||
for (int i = 0; i < numoptions; i++) {
|
||||
if (cfgoptions[i].paramflags & PARAMFLAG_CMDLINEONLY) {
|
||||
continue;
|
||||
printf_params("[LIBCONFIG] setting %s.%s skipped (command line only) \n", secprefix, cfgoptions[i].optname);
|
||||
}
|
||||
status = CONFIG_FALSE;
|
||||
config_setting_t *psetting;
|
||||
char *spath = malloc(((prefix == NULL) ? 0 : strlen(prefix)) + strlen(cfgoptions[i].optname) + 10);
|
||||
sprintf(spath, "%s%s%s", secprefix, (prefix == NULL) ? "" : ".", cfgoptions[i].optname);
|
||||
psetting = config_lookup(&(libconfig_privdata.runtcfg), spath);
|
||||
free(spath);
|
||||
if (psetting != NULL) {
|
||||
printf_params("[LIBCONFIG] setting %s.%s already created \n", secprefix, cfgoptions[i].optname);
|
||||
continue;
|
||||
}
|
||||
switch (cfgoptions[i].type) {
|
||||
case TYPE_STRING:
|
||||
psetting = config_setting_add(asetting, cfgoptions[i].optname, CONFIG_TYPE_STRING);
|
||||
if (psetting != NULL) {
|
||||
char *value;
|
||||
if (cfgoptions[i].strptr == NULL) {
|
||||
notused++;
|
||||
value = LIBCONFIG_NOTUSED_PARAMS;
|
||||
} else {
|
||||
value = *(cfgoptions[i].strptr);
|
||||
}
|
||||
status = config_setting_set_string(psetting, value);
|
||||
}
|
||||
break;
|
||||
case TYPE_STRINGLIST:
|
||||
psetting = config_setting_add(asetting, cfgoptions[i].optname, CONFIG_TYPE_LIST);
|
||||
if (psetting != NULL) {
|
||||
if (cfgoptions[i].numelt <= 0) {
|
||||
emptyla++;
|
||||
printf_params("[LIBCONFIG], no element in list %s\n", cfgoptions[i].optname);
|
||||
status = CONFIG_TRUE;
|
||||
}
|
||||
for (int j = 0; j < cfgoptions[i].numelt; j++) {
|
||||
config_setting_t *elemsetting = config_setting_set_string_elem(psetting, -1, cfgoptions[i].strptr[j]);
|
||||
if (elemsetting == NULL) {
|
||||
fprintf(stderr, "[LIBCONFIG] Error: Creating list %s element %i value %s\n", cfgoptions[i].optname, j, cfgoptions[i].strptr[j]);
|
||||
break;
|
||||
} else
|
||||
status = CONFIG_TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPE_UINT8:
|
||||
case TYPE_INT8:
|
||||
case TYPE_UINT16:
|
||||
case TYPE_INT16:
|
||||
case TYPE_UINT32:
|
||||
case TYPE_INT32:
|
||||
case TYPE_MASK:
|
||||
psetting = config_setting_add(asetting, cfgoptions[i].optname, CONFIG_TYPE_INT);
|
||||
if (psetting != NULL)
|
||||
status = config_setting_set_int(psetting, (int)*(cfgoptions[i].iptr));
|
||||
break;
|
||||
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
psetting = config_setting_add(asetting, cfgoptions[i].optname, CONFIG_TYPE_INT64);
|
||||
if (psetting != NULL)
|
||||
status = config_setting_set_int64(psetting, (int64_t) * (cfgoptions[i].i64ptr));
|
||||
break;
|
||||
|
||||
case TYPE_UINTARRAY:
|
||||
case TYPE_INTARRAY:
|
||||
psetting = config_setting_add(asetting, cfgoptions[i].optname, CONFIG_TYPE_ARRAY);
|
||||
if (psetting != NULL) {
|
||||
if (cfgoptions[i].numelt <= 0) {
|
||||
emptyla++;
|
||||
printf_params("[LIBCONFIG], no element in array %s.%s\n", secprefix, cfgoptions[i].optname);
|
||||
status = CONFIG_TRUE;
|
||||
}
|
||||
for (int j = 0; j < cfgoptions[i].numelt; j++) {
|
||||
config_setting_t *elemsetting = config_setting_set_int_elem(psetting, -1, (int)(cfgoptions[i].iptr[j]));
|
||||
if (elemsetting == NULL) {
|
||||
fprintf(stderr, "[LIBCONFIG] Error: Creating array %s.%s, at index %i value %i\n", secprefix, cfgoptions[i].optname, j, (int)(cfgoptions[i].iptr[j]));
|
||||
break;
|
||||
} else
|
||||
status = CONFIG_TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPE_DOUBLE:
|
||||
psetting = config_setting_add(asetting, cfgoptions[i].optname, CONFIG_TYPE_FLOAT);
|
||||
if (psetting != NULL)
|
||||
status = config_setting_set_float(psetting, (double)*(cfgoptions[i].dblptr));
|
||||
break;
|
||||
|
||||
case TYPE_IPV4ADDR:
|
||||
psetting = config_setting_add(asetting, cfgoptions[i].optname, CONFIG_TYPE_STRING);
|
||||
if (psetting != NULL) {
|
||||
char ipstr[INET_ADDRSTRLEN];
|
||||
if (inet_ntop(AF_INET, cfgoptions[i].uptr, ipstr, INET_ADDRSTRLEN) == NULL) {
|
||||
notused++;
|
||||
sprintf(ipstr, "undef");
|
||||
} else {
|
||||
status = config_setting_set_string(psetting, ipstr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPE_LIST:
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "[LIBCONFIG] %s.%s type %i not supported\n", secprefix, cfgoptions[i].optname, cfgoptions[i].type);
|
||||
status = CONFIG_FALSE;
|
||||
break;
|
||||
} /* switch on param type */
|
||||
if (status != CONFIG_TRUE) {
|
||||
errors++;
|
||||
fprintf(stderr, "[LIBCONFIG] Error creating setting %i: %s.%s type %i\n", i, secprefix, cfgoptions[i].optname, cfgoptions[i].type);
|
||||
}
|
||||
}
|
||||
printf_params("[LIBCONFIG], in group \"%s\" %i settings \n", secprefix, numoptions);
|
||||
if (notused > 0)
|
||||
printf_params("[LIBCONFIG], ..... %i settings with NULL value pointer\n", notused);
|
||||
if (errors > 0)
|
||||
fprintf(stderr, "[LIBCONFIG] .....%i settings creation errors \n", errors);
|
||||
if (emptyla > 0)
|
||||
fprintf(stderr, "[LIBCONFIG] .....%i empty lists or arrays settings \n", emptyla);
|
||||
|
||||
if (cfgptr->status) {
|
||||
cfgptr->status->num_err_nullvalue += notused;
|
||||
cfgptr->status->num_err_write += errors;
|
||||
cfgptr->status->num_write += numoptions;
|
||||
cfgptr->status->emptyla += emptyla;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix)
|
||||
{
|
||||
char *tokctx1 = NULL;
|
||||
int listidx = -1;
|
||||
char *prefixbck = NULL;
|
||||
char *prefix_elem1 = NULL;
|
||||
config_setting_t *asetting = config_root_setting(&(libconfig_privdata.runtcfg));
|
||||
if (prefix != NULL) {
|
||||
prefixbck = strdup(prefix);
|
||||
prefix_elem1 = strtok_r(prefixbck, ".", &tokctx1);
|
||||
}
|
||||
printf_params("[LIBCONFIG], processing prefix %s\n", (prefix == NULL) ? "NULL" : prefix);
|
||||
|
||||
/* parse the prefix , possibly creating groups, lists and list elements */
|
||||
while (prefix_elem1 != NULL) {
|
||||
int n1 = strlen(prefix_elem1);
|
||||
char *prefix_elem2 = prefix_elem1 + n1 + 1;
|
||||
printf_params("[LIBCONFIG], processing elem1 %s elem2 %s\n", prefix_elem1, prefix_elem2);
|
||||
/* prefix (the path to the parameter name) may contain groups and elements from a list, which are specified with [] */
|
||||
if (prefix_elem2[0] != '[') { // not a list
|
||||
|
||||
config_setting_t *tmpset = config_setting_lookup(asetting, prefix_elem1);
|
||||
if (tmpset == NULL)
|
||||
asetting = config_setting_add(asetting, prefix_elem1, CONFIG_TYPE_GROUP);
|
||||
else
|
||||
asetting = tmpset;
|
||||
printf_params("[LIBCONFIG], creating or looking for group %s: %s\n", prefix_elem1, (asetting == NULL) ? "NOK" : "OK");
|
||||
} else { // a list
|
||||
listidx = (int)strtol(prefix_elem2 + 1, NULL, 10);
|
||||
if (errno == EINVAL || errno == ERANGE) {
|
||||
printf_params("[LIBCONFIG], Error %s looking for list index in %s \n", strerror(errno), prefix_elem2);
|
||||
break;
|
||||
}
|
||||
config_setting_t *tmpset = config_setting_lookup(asetting, prefix_elem1);
|
||||
if (tmpset == NULL)
|
||||
asetting = config_setting_add(asetting, prefix_elem1, CONFIG_TYPE_LIST);
|
||||
else
|
||||
asetting = tmpset;
|
||||
printf_params("[LIBCONFIG], creating or looking for list %s: %s\n", prefix_elem1, (asetting == NULL) ? "NOK" : "OK");
|
||||
if (asetting != NULL) {
|
||||
tmpset = config_setting_get_elem(asetting, listidx);
|
||||
if (tmpset == NULL)
|
||||
asetting = config_setting_add(asetting, NULL, CONFIG_TYPE_GROUP);
|
||||
else
|
||||
asetting = tmpset;
|
||||
printf_params("[LIBCONFIG], creating or looking for list element %i: %s\n", listidx, (asetting == NULL) ? "NOK" : "OK");
|
||||
}
|
||||
prefix_elem1 = strtok_r(NULL, ".", &tokctx1); // skip the [x] elements we already took care of it
|
||||
if (prefix_elem1 == NULL) {
|
||||
fprintf(stderr, "[LICONFIG] End of parsing %s \n", prefix);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (asetting == NULL) {
|
||||
fprintf(stderr, "[LIBCONFIG] Error creating setting %s %s %i\n", prefix_elem1, prefix_elem2, listidx);
|
||||
}
|
||||
prefix_elem1 = strtok_r(NULL, ".", &tokctx1);
|
||||
}
|
||||
free(prefixbck);
|
||||
if (asetting != NULL) {
|
||||
config_libconfig_setparams(cfgoptions, numoptions, asetting, prefix);
|
||||
printf_params("[LIBCONFIG] %i settings added in group %s\n", numoptions, (prefix == NULL) ? "" : prefix);
|
||||
return 0;
|
||||
} else {
|
||||
fprintf(stderr, "[LIBCONFIG] Error parsing %s params, skipped...\n", (prefix == NULL) ? "" : prefix);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||
config_setting_t *setting;
|
||||
@@ -354,14 +567,47 @@ int config_libconfig_init(char *cfgP[], int numP) {
|
||||
free(tmppath);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* possibly init a libconfig struct for saving really used params */
|
||||
if (cfgptr->rtflags & CONFIG_SAVERUNCFG) {
|
||||
config_init(&(libconfig_privdata.runtcfg));
|
||||
// config_set_options (&(libconfig_privdata.runtcfg), CONFIG_OPTION_ALLOW_OVERRIDES, CONFIG_TRUE);
|
||||
}
|
||||
free(tmppath);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void config_libconfig_write_parsedcfg(void)
|
||||
{
|
||||
if (cfgptr->rtflags & CONFIG_SAVERUNCFG) {
|
||||
char *fname = strdup(libconfig_privdata.configfile);
|
||||
int newcfgflen = strlen(libconfig_privdata.configfile) + strlen(cfgptr->tmpdir) + 20;
|
||||
cfgptr->status->debug_cfgname = realloc(cfgptr->status->debug_cfgname, newcfgflen);
|
||||
time_t t = time(NULL);
|
||||
struct tm tm = *localtime(&t);
|
||||
snprintf(cfgptr->status->debug_cfgname, newcfgflen, "%s/%s-run%d_%02d_%02d_%02d%02d", cfgptr->tmpdir, basename(fname), tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min);
|
||||
if (config_write_file(&(libconfig_privdata.runtcfg), cfgptr->status->debug_cfgname) != CONFIG_TRUE) {
|
||||
fprintf(stderr,
|
||||
"[LIBCONFIG] %s %d file %s - line %d: %s\n",
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
cfgptr->status->debug_cfgname,
|
||||
config_error_line(&(libconfig_privdata.runtcfg)),
|
||||
config_error_text(&(libconfig_privdata.runtcfg)));
|
||||
} else {
|
||||
printf("[LIBCONFIG] file %s created successfully\n", cfgptr->status->debug_cfgname);
|
||||
}
|
||||
free(fname);
|
||||
} else {
|
||||
printf("[LIBCONFIG] Cannot create config file after parsing: CONFIG_SAVERUNCFG flag not specified\n");
|
||||
}
|
||||
}
|
||||
|
||||
void config_libconfig_end(void ) {
|
||||
config_destroy(&(libconfig_privdata.cfg));
|
||||
|
||||
if (cfgptr->rtflags & CONFIG_SAVERUNCFG) {
|
||||
config_destroy(&(libconfig_privdata.runtcfg));
|
||||
}
|
||||
if ( libconfig_privdata.configfile != NULL ) {
|
||||
free(libconfig_privdata.configfile);
|
||||
libconfig_privdata.configfile=NULL;
|
||||
|
||||
@@ -46,6 +46,7 @@ extern "C"
|
||||
typedef struct libconfig_privatedata {
|
||||
char *configfile;
|
||||
config_t cfg;
|
||||
config_t runtcfg;
|
||||
} libconfig_privatedata_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
# ifndef PHYSIM
|
||||
# ifndef UE_EXPANSION
|
||||
# define NUMBER_OF_UE_MAX 40
|
||||
# define NUMBER_OF_NR_UE_MAX 4
|
||||
# define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
# define NUMBER_OF_CONNECTED_gNB_MAX 1
|
||||
# else
|
||||
@@ -37,7 +36,6 @@
|
||||
# endif
|
||||
# else
|
||||
# define NUMBER_OF_UE_MAX 4
|
||||
# define NUMBER_OF_NR_UE_MAX 4
|
||||
# define NUMBER_OF_CONNECTED_eNB_MAX 1
|
||||
# define NUMBER_OF_CONNECTED_gNB_MAX 1
|
||||
# endif
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "RRC/LTE/defs_NB_IoT.h"
|
||||
#include "RRC/LTE/rrc_defs.h"
|
||||
#include "RRC/NR/nr_rrc_defs.h"
|
||||
#include <openair3/ocp-gtpu/gtpv1u_eNB_task.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -227,7 +227,8 @@ void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) {
|
||||
*n_rb = 6*count;
|
||||
}
|
||||
|
||||
int get_nb_periods_per_frame(uint8_t tdd_period) {
|
||||
int get_nb_periods_per_frame(uint8_t tdd_period)
|
||||
{
|
||||
|
||||
int nb_periods_per_frame;
|
||||
switch(tdd_period) {
|
||||
@@ -270,7 +271,13 @@ int get_nb_periods_per_frame(uint8_t tdd_period) {
|
||||
}
|
||||
|
||||
|
||||
int get_dmrs_port(int nl, uint16_t dmrs_ports) {
|
||||
int get_first_ul_slot(int nrofDownlinkSlots, int nrofDownlinkSymbols, int nrofUplinkSymbols)
|
||||
{
|
||||
return (nrofDownlinkSlots + (nrofDownlinkSymbols != 0 && nrofUplinkSymbols == 0));
|
||||
}
|
||||
|
||||
int get_dmrs_port(int nl, uint16_t dmrs_ports)
|
||||
{
|
||||
|
||||
if (dmrs_ports == 0) return 0; // dci 1_0
|
||||
int p = -1;
|
||||
|
||||
@@ -63,6 +63,7 @@ static inline int get_num_dmrs(uint16_t dmrs_mask ) {
|
||||
return(num_dmrs);
|
||||
}
|
||||
|
||||
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);
|
||||
void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset);
|
||||
|
||||
@@ -256,8 +256,6 @@ typedef struct IttiMsgText_s {
|
||||
#include <openair3/MME_APP/mme_app.h>
|
||||
//#include <proto.h>
|
||||
|
||||
#include <openair3/ocp-gtpu/gtpv1u_eNB_task.h>
|
||||
#include <openair3/ocp-gtpu/gtpv1u_gNB_task.h>
|
||||
void *rrc_enb_process_itti_msg(void *);
|
||||
#include <openair3/SCTP/sctp_eNB_task.h>
|
||||
#include <openair3/NGAP/ngap_gNB.h>
|
||||
|
||||
@@ -19,8 +19,8 @@ in `telnetsrv.h`
|
||||
*/
|
||||
static int coding_setmod_cmd(char *buff, int debug, telnet_printfunc_t prnt);
|
||||
static telnetshell_cmddef_t coding_cmdarray[] = {
|
||||
{"mode","[sse,avx2,stdc,none]",coding_setmod_cmd},
|
||||
{"","",NULL},
|
||||
{"mode", "[sse,avx2,stdc,none]", coding_setmod_cmd, {NULL}, 0, NULL},
|
||||
{"", "", NULL, {NULL}, 0, NULL},
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -109,8 +109,24 @@ The telnet server is dynamically loaded, to use the `add_telnetcmd` function, t
|
||||
|
||||
| Fields | type |Description |
|
||||
|:-----------|:------:|:-----------------------|
|
||||
| `cmdname` | `char[TELNET_CMD_MAXSIZE]` | command name, as tested by the telnet server to check it should call the `cmdfunc` function |
|
||||
| `helpstr` | `char[TELNET_HELPSTR_SIZE]` | character string to print when the elp`command is received from the telnet client |
|
||||
| `cmdfunc` | `cmdfunc_t` | pointer to the function implementing the `cmdname` sub command. |
|
||||
| `cmdname` | `char[TELNET_CMD_MAXSIZE]` | command name, as tested by the telnet server or web server to check it should call the `cmdfunc` or `webfunc` function |
|
||||
| `helpstr` | `char[TELNET_HELPSTR_SIZE]` | character string to print when the help`command is received from the telnet client |
|
||||
| `cmdfunc` | `cmdfunc_t` | pointer to the function implementing the `cmdname` telnet or web server sub command. |
|
||||
| `webfunc` | `webfunc_t` or `webfunc_getdata_t` | pointer to the function implementing the `cmdname` web server sub command. |
|
||||
| `cmdflags` | unsigned int bit mask | possible bits are defined in the next table |
|
||||
| `qptr` | pointer to a thread pool queue | when `TELNETSRV_CMDFLAG_PUSHINTPOOLQ` bit is set in `cmdflags` , contains the queue where the command is pushed|
|
||||
|
||||
### `cmdflags ` bit definitions
|
||||
These flags possibly modify the way the `telnetshell_cmddef_t` structure is used by the telnet server and/or the web server
|
||||
|
||||
| Fields | Description |
|
||||
|:------------------------------------:|:-----------------------|
|
||||
| TELNETSRV_CMDFLAG_PUSHINTPOOLQ | function defined in `cmdfunc` field is pushed in a thread pool queue instead of beeing executed synchronously. The queue is created by the telnet server code in the `add_telnetcmd` function|
|
||||
| TELNETSRV_CMDFLAG_GETWEBTBLDATA | web server will use the `webfunc_getdata_t` version of the `webfunc` union. command results are written in a `webdatadef_t` structure instead of being printed |
|
||||
| TELNETSRV_CMDFLAG_TELNETONLY | this command definition is only for the telnet server, web server is ignoring it |
|
||||
| TELNETSRV_CMDFLAG_WEBSRVONLY | this command definition is only for the web server, telnet server is ignoring it |
|
||||
| TELNETSRV_CMDFLAG_CONFEXEC | Currently only used by the web server, command execution has to be confirmed by user |
|
||||
| TELNETSRV_CMDFLAG_NEEDPARAM | Currently only used by the web server, user must provide a parameter before command execution |
|
||||
| TELNETSRV_CMDFLAG_WEBSRV_SETRETURNTBL | Currently only used by the web server, when a parameter modification requires a new page |
|
||||
| TELNETSRV_CMDFLAG_AUTOUPDATE | Currently only used by the web server, the command can be rescheduled for result update |
|
||||
[oai telnet server home](telnetsrv.md)
|
||||
|
||||
@@ -67,51 +67,53 @@ static telnetsrv_params_t telnetparams;
|
||||
#define TELNETSRV_OPTNAME_SHRMOD "shrmod"
|
||||
|
||||
paramdef_t telnetoptions[] = {
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* configuration parameters for telnet utility */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
{"listenaddr", "<listen ip address>\n", 0, uptr:&telnetparams.listenaddr, defstrval:"0.0.0.0", TYPE_IPV4ADDR, 0 },
|
||||
{"listenport", "<local port>\n", 0, uptr:&(telnetparams.listenport), defuintval:9090, TYPE_UINT, 0 },
|
||||
{"listenstdin", "enable input from stdin\n", PARAMFLAG_BOOL, uptr:&(telnetparams.listenstdin), defuintval:0, TYPE_UINT, 0 },
|
||||
{"priority", "<scheduling policy (0-99)\n", 0, iptr:&telnetparams.priority, defuintval:0, TYPE_INT, 0 },
|
||||
{"debug", "<debug level>\n", 0, uptr:NULL, defuintval:0, TYPE_UINT, 0 },
|
||||
{"loopcount", "<loop command iterations>\n", 0, uptr:&(telnetparams.loopcount), defuintval:10, TYPE_UINT, 0 },
|
||||
{"loopdelay", "<loop command delay (ms)>\n", 0, uptr:&(telnetparams.loopdelay), defuintval:5000, TYPE_UINT, 0 },
|
||||
{"histfile", "<history file name>\n", PARAMFLAG_NOFREE, strptr:&(telnetparams.histfile), defstrval:"oaitelnet.history", TYPE_STRING, 0 },
|
||||
{"histsize", "<history sizes>\n", 0, iptr:&(telnetparams.histsize), defuintval:50, TYPE_INT, 0 },
|
||||
{"phypbsize", "<phy dump buff size (bytes)>\n",0, uptr:&(telnetparams.phyprntbuff_size),defuintval:65000, TYPE_UINT, 0 },
|
||||
{TELNETSRV_OPTNAME_STATICMOD, "<static modules selection>\n", 0, strlistptr:NULL, defstrlistval:telnet_defstatmod,TYPE_STRINGLIST,(sizeof(telnet_defstatmod)/sizeof(char *))},
|
||||
{TELNETSRV_OPTNAME_SHRMOD, "<dynamic modules selection>\n", 0, strlistptr:NULL, defstrlistval:NULL,TYPE_STRINGLIST,0 }
|
||||
};
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* configuration parameters for telnet utility */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
{"listenaddr", "<listen ip address>\n", 0, uptr : &telnetparams.listenaddr, defstrval : "0.0.0.0", TYPE_IPV4ADDR, 0},
|
||||
{"listenport", "<local port>\n", 0, uptr : &(telnetparams.listenport), defuintval : 9090, TYPE_UINT, 0},
|
||||
{"listenstdin", "enable input from stdin\n", PARAMFLAG_BOOL, uptr : &(telnetparams.listenstdin), defuintval : 0, TYPE_UINT, 0},
|
||||
{"priority", "<scheduling policy (0-99)\n", 0, iptr : &telnetparams.priority, defuintval : 0, TYPE_INT, 0},
|
||||
{"debug", "<debug level>\n", 0, uptr : NULL, defuintval : 0, TYPE_UINT, 0},
|
||||
{"loopcount", "<loop command iterations>\n", 0, uptr : &(telnetparams.loopcount), defuintval : 10, TYPE_UINT, 0},
|
||||
{"loopdelay", "<loop command delay (ms)>\n", 0, uptr : &(telnetparams.loopdelay), defuintval : 5000, TYPE_UINT, 0},
|
||||
{"histfile", "<history file name>\n", PARAMFLAG_NOFREE, strptr : &(telnetparams.histfile), defstrval : "oaitelnet.history", TYPE_STRING, 0},
|
||||
{"histsize", "<history sizes>\n", 0, iptr : &(telnetparams.histsize), defuintval : 50, TYPE_INT, 0},
|
||||
{"logfile", "log file when redirecting", PARAMFLAG_NOFREE, strptr : &(telnetparams.logfile), defstrval : "oaisoftmodem.log", TYPE_STRING, 0},
|
||||
{"phypbsize", "<phy dump buff size (bytes)>\n", 0, uptr : &(telnetparams.phyprntbuff_size), defuintval : 65000, TYPE_UINT, 0},
|
||||
{TELNETSRV_OPTNAME_STATICMOD, "<static modules selection>\n", 0, strlistptr : NULL, defstrlistval : telnet_defstatmod, TYPE_STRINGLIST, (sizeof(telnet_defstatmod) / sizeof(char *))},
|
||||
{TELNETSRV_OPTNAME_SHRMOD, "<dynamic modules selection>\n", 0, strlistptr : NULL, defstrlistval : NULL, TYPE_STRINGLIST, 0}};
|
||||
|
||||
int get_phybsize(void) {
|
||||
return telnetparams.phyprntbuff_size;
|
||||
};
|
||||
int add_telnetcmd(char *modulename,telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd );
|
||||
int setoutput(char *buff, int debug, telnet_printfunc_t prnt);
|
||||
int wsetoutput(char *buff, int debug, telnet_printfunc_t prnt, ...);
|
||||
int setparam(char *buff, int debug, telnet_printfunc_t prnt);
|
||||
int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...);
|
||||
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt);
|
||||
|
||||
telnetshell_vardef_t telnet_vardef[] = {
|
||||
{"debug",TELNET_VARTYPE_INT32,&telnetparams.telnetdbg},
|
||||
{"prio",TELNET_VARTYPE_INT32,&telnetparams.priority},
|
||||
{"loopc",TELNET_VARTYPE_INT32,&telnetparams.loopcount},
|
||||
{"loopd",TELNET_VARTYPE_INT32,&telnetparams.loopdelay},
|
||||
{"phypb",TELNET_VARTYPE_INT32,&telnetparams.phyprntbuff_size},
|
||||
{"hsize",TELNET_VARTYPE_INT32,&telnetparams.histsize},
|
||||
{"hfile",TELNET_VARTYPE_STRING,&telnetparams.histfile},
|
||||
{"",0,NULL}
|
||||
};
|
||||
telnetshell_vardef_t telnet_vardef[] = {{"debug", TELNET_VARTYPE_INT32, 0, &telnetparams.telnetdbg},
|
||||
{"prio", TELNET_VARTYPE_INT32, 0, &telnetparams.priority},
|
||||
{"loopc", TELNET_VARTYPE_INT32, 0, &telnetparams.loopcount},
|
||||
{"loopd", TELNET_VARTYPE_INT32, 0, &telnetparams.loopdelay},
|
||||
{"phypb", TELNET_VARTYPE_INT32, 0, &telnetparams.phyprntbuff_size},
|
||||
{"hsize", TELNET_VARTYPE_INT32, 0, &telnetparams.histsize},
|
||||
{"hfile", TELNET_VARTYPE_STRING, TELNET_CHECKVAL_RDONLY, &telnetparams.histfile},
|
||||
{"logfile", TELNET_VARTYPE_STRING, 0, &telnetparams.logfile},
|
||||
{"", 0, 0, NULL}};
|
||||
|
||||
telnetshell_cmddef_t telnet_cmdarray[] = {
|
||||
{"redirlog","[here,file,off]",setoutput},
|
||||
{"param","[prio]",setparam},
|
||||
{"history","[list,reset]",history_cmd},
|
||||
{"","",NULL},
|
||||
telnetshell_cmddef_t telnet_cmdarray[] = {
|
||||
{"redirlog", "[here,file,off]", setoutput, {NULL}, TELNETSRV_CMDFLAG_TELNETONLY, NULL},
|
||||
{"redirlog file", "", setoutput, {NULL}, TELNETSRV_CMDFLAG_WEBSRVONLY, NULL},
|
||||
{"redirlog off", "", setoutput, {NULL}, TELNETSRV_CMDFLAG_WEBSRVONLY, NULL},
|
||||
{"param", "[prio]", setparam, {wsetparam}, 0, NULL},
|
||||
{"history", "[list,reset]", history_cmd, {NULL}, TELNETSRV_CMDFLAG_TELNETONLY, NULL},
|
||||
{"", "", NULL, {NULL}, 0, NULL},
|
||||
};
|
||||
|
||||
|
||||
void client_printf(const char *message, ...) {
|
||||
va_list va_args;
|
||||
va_start(va_args, message);
|
||||
@@ -127,36 +129,39 @@ void client_printf(const char *message, ...) {
|
||||
return ;
|
||||
}
|
||||
|
||||
#define NICE_MAX 19
|
||||
#define NICE_MIN -20
|
||||
void set_sched(pthread_t tid, int pid, int priority) {
|
||||
int rt;
|
||||
struct sched_param schedp;
|
||||
int policy;
|
||||
char strpolicy[10];
|
||||
int niceval = 0;
|
||||
|
||||
//sched_get_priority_max(SCHED_FIFO)
|
||||
if (priority < NICE_MIN) {
|
||||
if (priority < -100 && priority > -200) { // RR priority 1 to 99 (high) mapped to oai priority -101 to -199 (high)
|
||||
policy = SCHED_RR;
|
||||
sprintf(strpolicy, "%s", "RR");
|
||||
schedp.sched_priority = -(priority + 100);
|
||||
} else if (priority < 0 && priority > -100) {
|
||||
policy=SCHED_FIFO;
|
||||
sprintf(strpolicy,"%s","fifo");
|
||||
schedp.sched_priority= NICE_MIN - priority ;
|
||||
|
||||
if ( (schedp.sched_priority < sched_get_priority_min(SCHED_FIFO)) ||
|
||||
(schedp.sched_priority > sched_get_priority_max(SCHED_FIFO)) ) {
|
||||
client_printf("Error: %i invalid prio, should be %i to %i, \n",
|
||||
priority, NICE_MIN -sched_get_priority_min(SCHED_FIFO),
|
||||
NICE_MIN - sched_get_priority_max(SCHED_FIFO) );
|
||||
}
|
||||
} else if (priority > NICE_MAX) {
|
||||
schedp.sched_priority = -priority; // fifo priority 1 to 99 (high) mapped to oai priority -1 to -99 (high)
|
||||
} else if (priority >= 0 && priority <= (NICE_MAX - NICE_MIN)) { // other (normal) nice value -20 to 19 mapped to oai priority 0 to 39
|
||||
policy = SCHED_OTHER;
|
||||
sprintf(strpolicy, "%s", "other");
|
||||
schedp.sched_priority = 0;
|
||||
niceval = priority + NICE_MIN;
|
||||
} else if (priority > NICE_MAX - NICE_MIN && priority <= (2 * (NICE_MAX - NICE_MIN) + 1)) { // batch (normal) nice value -20 to 19 mapped to oai priority 40 to 79
|
||||
policy = SCHED_BATCH;
|
||||
sprintf(strpolicy, "%s", "batch");
|
||||
niceval = priority + NICE_MIN - (NICE_MAX - NICE_MIN + 1);
|
||||
schedp.sched_priority = 0;
|
||||
} else if (priority > (2 * (NICE_MAX - NICE_MIN) + 1)) { // idle mapped to oai priority >79
|
||||
policy=SCHED_IDLE;
|
||||
sprintf(strpolicy,"%s","idle");
|
||||
schedp.sched_priority=0;
|
||||
} else {
|
||||
policy=SCHED_OTHER;
|
||||
sprintf(strpolicy,"%s","other");
|
||||
schedp.sched_priority=0;
|
||||
client_printf("Error: %i invalid priority \n", priority);
|
||||
return;
|
||||
}
|
||||
|
||||
if( tid != 0) {
|
||||
rt = pthread_setschedparam(tid, policy, &schedp);
|
||||
} else if(pid > 0) {
|
||||
@@ -172,15 +177,14 @@ void set_sched(pthread_t tid, int pid, int priority) {
|
||||
} else {
|
||||
client_printf("policy set to %s, priority %i\n",strpolicy,schedp.sched_priority);
|
||||
|
||||
if ( policy==SCHED_OTHER) {
|
||||
if (policy == SCHED_OTHER || policy == SCHED_BATCH) {
|
||||
rt = getpriority(PRIO_PROCESS,tid);
|
||||
|
||||
if (rt != -1) {
|
||||
rt = setpriority(PRIO_PROCESS,tid,priority);
|
||||
rt = setpriority(PRIO_PROCESS, tid, niceval);
|
||||
|
||||
if (rt < 0) {
|
||||
client_printf("Error %i: %s trying to set nice value of thread %u to %i\n",
|
||||
errno,strerror(errno),tid,priority);
|
||||
client_printf("Error %i: %s trying to set nice value of thread %u to %i\n", errno, strerror(errno), tid, niceval);
|
||||
}
|
||||
} else {
|
||||
client_printf("Error %i: %s trying to get nice value of thread %u \n",
|
||||
@@ -189,17 +193,17 @@ void set_sched(pthread_t tid, int pid, int priority) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( policy == SCHED_OTHER) {
|
||||
if (policy == SCHED_OTHER || policy == SCHED_BATCH) {
|
||||
if ( tid > 0 && tid != pthread_self()) {
|
||||
client_printf("setting nice value using a thread id not implemented....\n");
|
||||
} else if (pid > 0) {
|
||||
errno=0;
|
||||
rt = setpriority(PRIO_PROCESS,pid,priority);
|
||||
rt = setpriority(PRIO_PROCESS, pid, niceval);
|
||||
|
||||
if (rt != 0) {
|
||||
client_printf("Error %i: %s calling setpriority, \n",errno,strerror(errno));
|
||||
} else {
|
||||
client_printf("nice value set to %i\n",priority);
|
||||
client_printf("nice value set to %i\n", niceval);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,20 +240,30 @@ void redirstd(char *newfname,telnet_printfunc_t prnt ) {
|
||||
fd=freopen(newfname, "w", stdout);
|
||||
|
||||
if (fd == NULL) {
|
||||
prnt("ERROR: stdout redir to %s error %s",strerror(errno));
|
||||
prnt("ERROR: stdout redir to %s error %s\n", strerror(errno));
|
||||
} else {
|
||||
prnt("stdout redirected to %s\n", newfname);
|
||||
}
|
||||
|
||||
fd=freopen(newfname, "w", stderr);
|
||||
|
||||
if (fd == NULL) {
|
||||
prnt("ERROR: stderr redir to %s error %s",strerror(errno));
|
||||
prnt("ERROR: stderr redir to %s error %s\n", strerror(errno));
|
||||
} else {
|
||||
prnt("stderr redirected to %s\n", newfname);
|
||||
}
|
||||
}
|
||||
|
||||
int wsetoutput(char *buffer, int debug, telnet_printfunc_t prnt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
|
||||
char *logfname;
|
||||
char stdout_str[64];
|
||||
#define LOGFILE "logfile.log"
|
||||
|
||||
memset(cmds,0,sizeof(cmds));
|
||||
sscanf(buff,"%9s %32s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] );
|
||||
|
||||
@@ -265,10 +279,10 @@ int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||
|
||||
if (strncasecmp(cmds[0],"file",4) == 0) {
|
||||
if (cmds[1][0] == 0)
|
||||
logfname=LOGFILE;
|
||||
logfname = telnetparams.logfile;
|
||||
else
|
||||
logfname=cmds[1];
|
||||
|
||||
prnt("Log output redirected to (%s)\n", logfname);
|
||||
fflush(stdout);
|
||||
redirstd(logfname,prnt);
|
||||
}
|
||||
@@ -281,6 +295,11 @@ int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||
return CMDSTATUS_FOUND;
|
||||
} /* setoutput */
|
||||
|
||||
int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int setparam(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
|
||||
memset(cmds,0,sizeof(cmds));
|
||||
@@ -344,94 +363,120 @@ int history_cmd(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||
/*
|
||||
generic commands available for all modules loaded by the server
|
||||
*/
|
||||
char *telnet_getvarvalue(telnetshell_vardef_t *var, int varindex)
|
||||
{
|
||||
char *val;
|
||||
switch (var[varindex].vartype) {
|
||||
case TELNET_VARTYPE_INT32:
|
||||
val = malloc(64);
|
||||
snprintf(val, 64, "%i", *(int32_t *)(var[varindex].varvalptr));
|
||||
break;
|
||||
|
||||
int setgetvar(int moduleindex,char getorset,char *params) {
|
||||
int n,i;
|
||||
case TELNET_VARTYPE_INT64:
|
||||
val = malloc(128);
|
||||
snprintf(val, 128, "%lli", (long long)*(int64_t *)(var[varindex].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_INT16:
|
||||
val = malloc(16);
|
||||
snprintf(val, 16, "%hi", *(short *)(var[varindex].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_INT8:
|
||||
val = malloc(16);
|
||||
snprintf(val, 16, "%i", (int)(*(int8_t *)(var[varindex].varvalptr)));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_UINT:
|
||||
val = malloc(64);
|
||||
snprintf(val, 64, "%u", *(unsigned int *)(var[varindex].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_DOUBLE:
|
||||
val = malloc(32);
|
||||
snprintf(val, 32, "%g\n", *(double *)(var[varindex].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_STRING:
|
||||
val = strdup(*(char **)(var[varindex].varvalptr));
|
||||
break;
|
||||
|
||||
default:
|
||||
val = malloc(64);
|
||||
snprintf(val, 64, "ERR:var %i unknown type", varindex);
|
||||
break;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
int telnet_setvarvalue(telnetshell_vardef_t *var, char *strval, telnet_printfunc_t prnt)
|
||||
{
|
||||
int st = 0;
|
||||
switch (var->vartype) {
|
||||
case TELNET_VARTYPE_INT32:
|
||||
*(int *)(var->varvalptr) = (int)strtol(strval, NULL, 0);
|
||||
if (prnt != NULL)
|
||||
prnt("%i\n", *(int *)(var->varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_INT16:
|
||||
*(short *)(var->varvalptr) = (short)strtol(strval, NULL, 0);
|
||||
if (prnt != NULL)
|
||||
prnt("%hi\n", *(short *)(var->varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_INT8:
|
||||
*(char *)(var->varvalptr) = (char)strtol(strval, NULL, 0);
|
||||
if (prnt != NULL)
|
||||
prnt("%i\n", *(int *)(var->varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_UINT:
|
||||
*(unsigned int *)(var->varvalptr) = (unsigned int)strtol(strval, NULL, 0);
|
||||
if (prnt != NULL)
|
||||
prnt("%u\n", *(unsigned int *)(var->varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_DOUBLE:
|
||||
*(double *)(var->varvalptr) = strtod(strval, NULL);
|
||||
if (prnt != NULL)
|
||||
prnt("%g\n", *(double *)(var->varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_STRING:
|
||||
sprintf(*(char **)(var->varvalptr), "%s", strval);
|
||||
if (prnt != NULL)
|
||||
prnt("\"%s\"\n", *(char **)(var->varvalptr));
|
||||
break;
|
||||
|
||||
default:
|
||||
if (prnt != NULL)
|
||||
prnt("unknown type\n");
|
||||
st = -1;
|
||||
break;
|
||||
}
|
||||
return st;
|
||||
}
|
||||
|
||||
int setgetvar(int moduleindex, char getorset, char *params)
|
||||
{
|
||||
int n, i;
|
||||
char varname[TELNET_CMD_MAXSIZE];
|
||||
char *varval=NULL;
|
||||
memset(varname,0,sizeof(varname));
|
||||
n = sscanf(params,"%9s %ms",varname,&varval);
|
||||
char *varval = NULL;
|
||||
memset(varname, 0, sizeof(varname));
|
||||
n = sscanf(params, "%9s %ms", varname, &varval);
|
||||
|
||||
for ( i=0 ; telnetparams.CmdParsers[moduleindex].var[i].varvalptr != NULL ; i++) {
|
||||
if ( strncasecmp(telnetparams.CmdParsers[moduleindex].var[i].varname,varname,strlen(telnetparams.CmdParsers[moduleindex].var[i].varname)) == 0) {
|
||||
for (i = 0; telnetparams.CmdParsers[moduleindex].var[i].varvalptr != NULL; i++) {
|
||||
if (strncasecmp(telnetparams.CmdParsers[moduleindex].var[i].varname, varname, strlen(telnetparams.CmdParsers[moduleindex].var[i].varname)) == 0) {
|
||||
if (n > 0 && (getorset == 'g' || getorset == 'G')) {
|
||||
client_printf("%s, %s = ", telnetparams.CmdParsers[moduleindex].module,
|
||||
telnetparams.CmdParsers[moduleindex].var[i].varname );
|
||||
|
||||
switch(telnetparams.CmdParsers[moduleindex].var[i].vartype) {
|
||||
case TELNET_VARTYPE_INT32:
|
||||
client_printf("%i\n",*(int32_t *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_INT64:
|
||||
client_printf("%lli\n",*(int64_t *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_INT16:
|
||||
client_printf("%hi\n",*(short *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_INT8:
|
||||
client_printf("%i\n",(int)(*(int8_t *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr)));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_UINT:
|
||||
client_printf("%u\n",*(unsigned int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_DOUBLE:
|
||||
client_printf("%g\n",*(double *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_STRING:
|
||||
client_printf("\"%s\"\n",*(char **)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
default:
|
||||
client_printf("unknown type\n");
|
||||
break;
|
||||
}
|
||||
client_printf("%s, %s = ", telnetparams.CmdParsers[moduleindex].module, telnetparams.CmdParsers[moduleindex].var[i].varname);
|
||||
char *strval = telnet_getvarvalue(telnetparams.CmdParsers[moduleindex].var, i);
|
||||
client_printf("%s\n", strval);
|
||||
free(strval);
|
||||
}
|
||||
|
||||
if (n > 1 && (getorset == 's' || getorset == 'S')) {
|
||||
client_printf("%s, %s set to \n", telnetparams.CmdParsers[moduleindex].module,
|
||||
telnetparams.CmdParsers[moduleindex].var[i].varname);
|
||||
|
||||
switch(telnetparams.CmdParsers[moduleindex].var[i].vartype) {
|
||||
case TELNET_VARTYPE_INT32:
|
||||
*(int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = (int)strtol(varval,NULL,0);
|
||||
client_printf("%i\n",*(int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_INT16:
|
||||
*(short *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = (short)strtol(varval,NULL,0);
|
||||
client_printf("%hi\n",*(short *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_INT8:
|
||||
*(char *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = (char)strtol(varval,NULL,0);
|
||||
client_printf("%i\n",*(int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_UINT:
|
||||
*(unsigned int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = (unsigned int)strtol(varval,NULL,0);
|
||||
client_printf("%u\n",*(unsigned int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_DOUBLE:
|
||||
*(double *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = strtod(varval,NULL);
|
||||
client_printf("%g\n",*(double *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
case TELNET_VARTYPE_STRING:
|
||||
sprintf(*(char **)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr),"%s", varval);
|
||||
client_printf("\"%s\"\n",*(char **)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
|
||||
break;
|
||||
|
||||
default:
|
||||
client_printf("unknown type\n");
|
||||
break;
|
||||
}
|
||||
client_printf("%s, %s set to \n", telnetparams.CmdParsers[moduleindex].module, telnetparams.CmdParsers[moduleindex].var[i].varname);
|
||||
telnet_setvarvalue(&(telnetparams.CmdParsers[moduleindex].var[i]), varval, client_printf);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -442,6 +487,14 @@ int setgetvar(int moduleindex,char getorset,char *params) {
|
||||
|
||||
return CMDSTATUS_VARNOTFOUND;
|
||||
}
|
||||
|
||||
void telnetsrv_freetbldata(webdatadef_t *wdata)
|
||||
{
|
||||
for (int i = 0; i < wdata->numlines; i++)
|
||||
for (int j = 0; j < wdata->numcols; j++)
|
||||
if (wdata->columns[j].coltype & TELNET_VAR_NEEDFREE)
|
||||
free(wdata->lines[i].val[j]);
|
||||
}
|
||||
/*----------------------------------------------------------------------------------------------------*/
|
||||
char *get_time(char *buff,int bufflen) {
|
||||
struct tm tmstruct;
|
||||
@@ -449,17 +502,28 @@ char *get_time(char *buff,int bufflen) {
|
||||
strftime (buff, bufflen, "%Y-%m-%d %H:%M:%S.000", localtime_r(&now,&tmstruct));
|
||||
return buff;
|
||||
}
|
||||
void telnet_pushcmd(telnetshell_cmddef_t *cmd, char *cmdbuff, telnet_printfunc_t prnt)
|
||||
{
|
||||
notifiedFIFO_elt_t *msg = newNotifiedFIFO_elt(sizeof(telnetsrv_qmsg_t), 0, NULL, NULL);
|
||||
telnetsrv_qmsg_t *cmddata = NotifiedFifoData(msg);
|
||||
cmddata->cmdfunc = (qcmdfunc_t)cmd->cmdfunc;
|
||||
cmddata->prnt = prnt;
|
||||
cmddata->debug = telnetparams.telnetdbg;
|
||||
if (cmdbuff != NULL)
|
||||
cmddata->cmdbuff = strdup(cmdbuff);
|
||||
pushNotifiedFIFO(cmd->qptr, msg);
|
||||
}
|
||||
|
||||
int process_command(char *buf) {
|
||||
int process_command(char *buf, int iteration)
|
||||
{
|
||||
int i,j,k;
|
||||
char modulename[TELNET_CMD_MAXSIZE];
|
||||
char cmd[TELNET_CMD_MAXSIZE];
|
||||
char *cmdb=NULL;
|
||||
char *bufbck;
|
||||
int rt;
|
||||
memset(modulename,0,sizeof(modulename));
|
||||
memset(cmd,0,sizeof(cmd));
|
||||
|
||||
|
||||
|
||||
if (strncasecmp(buf,"ex",2) == 0)
|
||||
return CMDSTATUS_EXIT;
|
||||
@@ -474,6 +538,8 @@ int process_command(char *buf) {
|
||||
}
|
||||
|
||||
for(j=0; telnetparams.CmdParsers[i].cmd[j].cmdfunc != NULL ; j++) {
|
||||
if (telnetparams.CmdParsers[i].cmd[j].cmdflags & TELNETSRV_CMDFLAG_WEBSRVONLY)
|
||||
continue;
|
||||
client_printf(" %s %s %s\n",
|
||||
telnetparams.CmdParsers[i].module,telnetparams.CmdParsers[i].cmd[j].cmdname,
|
||||
telnetparams.CmdParsers[i].cmd[j].helpstr);
|
||||
@@ -483,13 +549,11 @@ int process_command(char *buf) {
|
||||
return CMDSTATUS_FOUND;
|
||||
}
|
||||
|
||||
|
||||
bufbck=strdup(buf);
|
||||
rt=CMDSTATUS_NOTFOUND;
|
||||
j = sscanf(buf,"%19s %19s %m[^\t\n]",modulename,cmd,&cmdb);
|
||||
|
||||
if (telnetparams.telnetdbg > 0)
|
||||
printf("process_command: %i words, module=%s cmd=%s, parameters= %s\n",j,modulename,cmd,cmdb);
|
||||
printf("process_command: %i words, module=%s cmd=%s, parameters= %s\n", j, modulename, cmd, (cmdb == NULL) ? "" : cmdb);
|
||||
|
||||
for (i=0; j>=2 && telnetparams.CmdParsers[i].var != NULL && telnetparams.CmdParsers[i].cmd != NULL; i++) {
|
||||
if ( (strncasecmp(telnetparams.CmdParsers[i].module,modulename,strlen(telnetparams.CmdParsers[i].module)) == 0)) {
|
||||
@@ -504,15 +568,11 @@ int process_command(char *buf) {
|
||||
} else {
|
||||
for (k=0 ; telnetparams.CmdParsers[i].cmd[k].cmdfunc != NULL ; k++) {
|
||||
if (strncasecmp(cmd, telnetparams.CmdParsers[i].cmd[k].cmdname,sizeof(telnetparams.CmdParsers[i].cmd[k].cmdname)) == 0) {
|
||||
if (telnetparams.CmdParsers[i].cmd[k].qptr != NULL) {
|
||||
notifiedFIFO_elt_t *msg =newNotifiedFIFO_elt(sizeof(telnetsrv_qmsg_t),0,NULL,NULL);
|
||||
telnetsrv_qmsg_t *cmddata=NotifiedFifoData(msg);
|
||||
cmddata->cmdfunc=(qcmdfunc_t)telnetparams.CmdParsers[i].cmd[k].cmdfunc;
|
||||
cmddata->prnt=client_printf;
|
||||
cmddata->debug=telnetparams.telnetdbg;
|
||||
cmddata->cmdbuff=cmdb ? strdup(cmdb) : NULL;
|
||||
pushNotifiedFIFO(telnetparams.CmdParsers[i].cmd[k].qptr, msg);
|
||||
} else {
|
||||
if (telnetparams.CmdParsers[i].cmd[k].cmdflags & TELNETSRV_CMDFLAG_WEBSRVONLY)
|
||||
continue;
|
||||
if (telnetparams.CmdParsers[i].cmd[k].qptr != NULL) {
|
||||
telnet_pushcmd(&(telnetparams.CmdParsers[i].cmd[k]), (cmdb != NULL) ? strdup(cmdb) : NULL, client_printf);
|
||||
} else {
|
||||
telnetparams.CmdParsers[i].cmd[k].cmdfunc(cmdb, telnetparams.telnetdbg, client_printf);
|
||||
}
|
||||
rt= CMDSTATUS_FOUND;
|
||||
@@ -533,7 +593,7 @@ int process_command(char *buf) {
|
||||
char tbuff[64];
|
||||
client_printf(CSI "1J" CSI "1;10H " STDFMT "%s %i/%i\n",
|
||||
get_time(tbuff,sizeof(tbuff)),lc,telnetparams.loopcount );
|
||||
process_command(bufbck+strlen("loop")+1);
|
||||
process_command(buf + strlen("loop") + 1, lc);
|
||||
errno=0;
|
||||
int rs = read(telnetparams.new_socket,dummybuff,sizeof(dummybuff));
|
||||
|
||||
@@ -554,7 +614,6 @@ int process_command(char *buf) {
|
||||
} /* loop */
|
||||
} /* for i */
|
||||
free(cmdb);
|
||||
free(bufbck);
|
||||
return rt;
|
||||
}
|
||||
|
||||
@@ -645,7 +704,7 @@ void run_telnetsrv(void) {
|
||||
}
|
||||
|
||||
if (strlen(buf) > 2 ) {
|
||||
status=process_command(buf);
|
||||
status = process_command(buf, 0);
|
||||
} else
|
||||
status=CMDSTATUS_NOCMD;
|
||||
|
||||
@@ -847,44 +906,35 @@ int telnetsrv_autoinit(void) {
|
||||
*/
|
||||
int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd)
|
||||
{
|
||||
notifiedFIFO_t *afifo = NULL;
|
||||
|
||||
if( modulename == NULL || var == NULL || cmd == NULL) {
|
||||
fprintf(stderr,"[TELNETSRV] Telnet server, add_telnetcmd: invalid parameters\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int i;
|
||||
for (i=0; i<TELNET_MAXCMD ; i++) {
|
||||
cmdparser_t *CmdParser = &telnetparams.CmdParsers[i];
|
||||
if (CmdParser->var == NULL) {
|
||||
strncpy(CmdParser->module, modulename, sizeof(CmdParser->module) - 1);
|
||||
CmdParser->cmd = cmd;
|
||||
CmdParser->var = var;
|
||||
printf("[TELNETSRV] Telnet server: module %i = %s added to shell\n",
|
||||
i, CmdParser->module);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == TELNET_MAXCMD) {
|
||||
fprintf(stderr, "[TELNETSRV] TELNET_MAXCMD reached, cannot add new module %s\n", modulename);
|
||||
return -1;
|
||||
}
|
||||
|
||||
notifiedFIFO_t *afifo = NULL;
|
||||
for (int k = 0; cmd[k].cmdfunc != NULL ; k++) {
|
||||
if (cmd[k].cmdflags & TELNETSRV_CMDFLAG_PUSHINTPOOLQ) {
|
||||
if (afifo == NULL) {
|
||||
afifo = malloc(sizeof(notifiedFIFO_t));
|
||||
initNotifiedFIFO(afifo);
|
||||
for (int i = 0; i < TELNET_MAXCMD; i++) {
|
||||
if (telnetparams.CmdParsers[i].var == NULL) {
|
||||
strncpy(telnetparams.CmdParsers[i].module, modulename, sizeof(telnetparams.CmdParsers[i].module) - 1);
|
||||
telnetparams.CmdParsers[i].cmd = cmd;
|
||||
telnetparams.CmdParsers[i].var = var;
|
||||
for (int j = 0; cmd[j].cmdfunc != NULL; j++) {
|
||||
if (cmd[j].cmdflags & TELNETSRV_CMDFLAG_PUSHINTPOOLQ) {
|
||||
if (afifo == NULL) {
|
||||
afifo = malloc(sizeof(notifiedFIFO_t));
|
||||
initNotifiedFIFO(afifo);
|
||||
}
|
||||
cmd[j].qptr = afifo;
|
||||
}
|
||||
}
|
||||
cmd[k].qptr = afifo;
|
||||
printf("[TELNETSRV] Telnet server: module %i = %s added to shell\n", i, telnetparams.CmdParsers[i].module);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* function which will be called by the shared lib loader, to check shared lib version
|
||||
against main exec version. version mismatch not considered as fatal (interfaces not supposed to change)
|
||||
*/
|
||||
@@ -903,10 +953,18 @@ int telnetsrv_checkbuildver(char *mainexec_buildversion, char **shlib_buildvers
|
||||
}
|
||||
|
||||
int telnetsrv_getfarray(loader_shlibfunc_t **farray) {
|
||||
*farray=malloc(sizeof(loader_shlibfunc_t)*2);
|
||||
int const num_func_tln_srv = 3;
|
||||
*farray = malloc(sizeof(loader_shlibfunc_t) * num_func_tln_srv);
|
||||
(*farray)[0].fname=TELNET_ADDCMD_FNAME;
|
||||
(*farray)[0].fptr=(int (*)(void) )add_telnetcmd;
|
||||
(*farray)[1].fname=TELNET_POLLCMDQ_FNAME;
|
||||
(*farray)[1].fptr=(int (*)(void) )poll_telnetcmdq;
|
||||
return ( 2);
|
||||
(*farray)[1].fptr = (int (*)(void))poll_telnetcmdq;
|
||||
(*farray)[2].fname = TELNET_PUSHCMD_FNAME;
|
||||
(*farray)[2].fptr = (int (*)(void))telnet_pushcmd;
|
||||
return (3);
|
||||
}
|
||||
/* for webserver interface, needs access to some telnet server paramaters */
|
||||
telnetsrv_params_t *get_telnetsrv_params(void)
|
||||
{
|
||||
return &telnetparams;
|
||||
}
|
||||
|
||||
@@ -48,19 +48,54 @@
|
||||
#define CMDSTATUS_VARNOTFOUND 3
|
||||
#define CMDSTATUS_NOTFOUND 4
|
||||
|
||||
/* definitions to store 2 dim table, used to store command results before */
|
||||
/* displaying them either on console or web page */
|
||||
#define TELNET_MAXLINE_NUM 100
|
||||
#define TELNET_MAXCOL_NUM 10
|
||||
|
||||
typedef struct col {
|
||||
char coltitle[TELNET_CMD_MAXSIZE];
|
||||
unsigned int coltype;
|
||||
} acol_t;
|
||||
|
||||
typedef struct line {
|
||||
char *val[TELNET_MAXCOL_NUM];
|
||||
} aline_t;
|
||||
|
||||
typedef struct webdatadef {
|
||||
char tblname[TELNET_HELPSTR_SIZE];
|
||||
int numlines;
|
||||
int numcols;
|
||||
acol_t columns[TELNET_MAXCOL_NUM];
|
||||
aline_t lines[TELNET_MAXLINE_NUM];
|
||||
} webdatadef_t;
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* structure to be used when adding a module to the telnet server */
|
||||
/* This is the second parameter of the add_telnetcmd function, which can be used */
|
||||
/* to add a set of new command to the telnet server shell */
|
||||
typedef void(*telnet_printfunc_t)(const char* format, ...);
|
||||
typedef int(*cmdfunc_t)(char*, int, telnet_printfunc_t prnt);
|
||||
typedef int (*webfunc_t)(char *cmdbuff, int debug, telnet_printfunc_t prnt, ...);
|
||||
typedef int (*webfunc_getdata_t)(char *cmdbuff, int debug, void *data, telnet_printfunc_t prnt);
|
||||
typedef int(*qcmdfunc_t)(char*, int, telnet_printfunc_t prnt,void *arg);
|
||||
|
||||
#define TELNETSRV_CMDFLAG_PUSHINTPOOLQ (1<<0) // ask the telnet server to push the command in a thread pool queue
|
||||
#define TELNETSRV_CMDFLAG_PUSHINTPOOLQ (1 << 0) // ask the telnet server to push the command in a thread pool queue
|
||||
#define TELNETSRV_CMDFLAG_GETWEBDATA (1 << 1) // When called from web server, use the getdata variant of the function
|
||||
#define TELNETSRV_CMDFLAG_TELNETONLY (1 << 2) // Command only for telnet client connections
|
||||
#define TELNETSRV_CMDFLAG_WEBSRVONLY (1 << 3) // Command only for web server connections
|
||||
#define TELNETSRV_CMDFLAG_CONFEXEC (1 << 4) // Ask for confirm before exec
|
||||
#define TELNETSRV_CMDFLAG_GETWEBTBLDATA (1 << 8) // When called from web server, use the get table data variant of the function
|
||||
#define TELNETSRV_CMDFLAG_NEEDPARAM (1 << 10) // websrv: The command needs a parameter
|
||||
#define TELNETSRV_CMDFLAG_WEBSRV_SETRETURNTBL (1 << 11) // websrv: set callback returns a new table
|
||||
#define TELNETSRV_CMDFLAG_AUTOUPDATE (1 << 12) // command can be re-submitted automatically for result update
|
||||
typedef struct cmddef {
|
||||
char cmdname[TELNET_CMD_MAXSIZE];
|
||||
char helpstr[TELNET_HELPSTR_SIZE];
|
||||
cmdfunc_t cmdfunc;
|
||||
cmdfunc_t cmdfunc;
|
||||
union {
|
||||
webfunc_t webfunc;
|
||||
webfunc_getdata_t webfunc_getdata;
|
||||
};
|
||||
unsigned int cmdflags;
|
||||
void *qptr;
|
||||
} telnetshell_cmddef_t;
|
||||
@@ -78,6 +113,8 @@ typedef struct telnetsrv_qmsg {
|
||||
/*structure to be used when adding a module to the telnet server */
|
||||
/* This is the first parameter of the add_telnetcmd function, which can be used */
|
||||
/* to add a set of new variables which can be got/set from the telnet server shell */
|
||||
/* var type: bits 0-3, type value (1 to 15)
|
||||
* type modifier, bits 4-31 */
|
||||
#define TELNET_VARTYPE_INT32 1
|
||||
#define TELNET_VARTYPE_INT16 2
|
||||
#define TELNET_VARTYPE_INT64 3
|
||||
@@ -85,9 +122,16 @@ typedef struct telnetsrv_qmsg {
|
||||
#define TELNET_VARTYPE_DOUBLE 5
|
||||
#define TELNET_VARTYPE_INT8 6
|
||||
#define TELNET_VARTYPE_UINT 7
|
||||
|
||||
#define TELNET_CHECKVAL_RDONLY 16
|
||||
#define TELNET_CHECKVAL_BOOL 32
|
||||
#define TELNET_VAR_NEEDFREE 64
|
||||
#define TELNET_CHECKVAL_LOGLVL 128
|
||||
#define TELNET_CHECKVAL_SIMALGO 256
|
||||
typedef struct variabledef {
|
||||
char varname[TELNET_CMD_MAXSIZE];
|
||||
char vartype;
|
||||
char checkval;
|
||||
void *varvalptr;
|
||||
} telnetshell_vardef_t;
|
||||
|
||||
@@ -113,6 +157,7 @@ typedef struct {
|
||||
int priority; // server running priority
|
||||
char *histfile; // command history
|
||||
int histsize; // command history length
|
||||
char *logfile; // filename to use when redirecting output to file
|
||||
int new_socket; // socket of the client connection
|
||||
int logfilefd; // file id of the log file when log output is redirected to a file
|
||||
int saved_stdout; // file id of the previous stdout, used to be able to restore original stdout
|
||||
@@ -145,14 +190,25 @@ VT escape sequence definition, for smarter display....
|
||||
#define STDFMT "\x1b[0m"
|
||||
|
||||
/*---------------------------------------------------------------------------------------------*/
|
||||
#define NICE_MAX 19
|
||||
#define NICE_MIN -20
|
||||
#define TELNET_ADDCMD_FNAME "add_telnetcmd"
|
||||
#define TELNET_POLLCMDQ_FNAME "poll_telnetcmdq"
|
||||
#define TELNET_PUSHCMD_FNAME "telnet_pushcmd"
|
||||
typedef int(*add_telnetcmd_func_t)(char *, telnetshell_vardef_t *, telnetshell_cmddef_t *);
|
||||
typedef void(*poll_telnetcmdq_func_t)(void *qid,void *arg);
|
||||
typedef void (*push_telnetcmd_func_t)(telnetshell_cmddef_t *cmd, char *cmdbuff, telnet_printfunc_t prnt);
|
||||
#ifdef TELNETSERVERCODE
|
||||
int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd);
|
||||
void set_sched(pthread_t tid, int pid,int priority);
|
||||
void set_affinity(pthread_t tid, int pid, int coreid);
|
||||
extern int get_phybsize(void);
|
||||
#endif
|
||||
#ifdef WEBSERVERCODE
|
||||
extern void telnet_pushcmd(telnetshell_cmddef_t *cmd, char *cmdbuff, telnet_printfunc_t prnt);
|
||||
extern telnetsrv_params_t *get_telnetsrv_params(void);
|
||||
extern char *telnet_getvarvalue(telnetshell_vardef_t *var, int varindex);
|
||||
extern int telnet_setvarvalue(telnetshell_vardef_t *var, char *strval, telnet_printfunc_t prnt);
|
||||
extern void telnetsrv_freetbldata(webdatadef_t *wdata);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -32,6 +32,6 @@ endforeach()
|
||||
|
||||
install(TARGETS telnetsrv DESTINATION bin)
|
||||
|
||||
if (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
|
||||
install(TARGETS telnetsrv DESTINATION ${OPENAIR_BUILD_DIR}/ran_build/build)
|
||||
endif (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
|
||||
if (EXISTS "${OPENAIR_CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE}/ran_build/build")
|
||||
install(TARGETS telnetsrv DESTINATION ${OPENAIR_CMAKE}/ran_build/build)
|
||||
endif (EXISTS "${OPENAIR_CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE}/ran_build/build")
|
||||
|
||||
@@ -42,14 +42,17 @@
|
||||
|
||||
int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt);
|
||||
telnetshell_cmddef_t loader_cmdarray[] = {
|
||||
{"show","[params,modules]",loader_show_cmd},
|
||||
{"","",NULL},
|
||||
{"show", "[params,modules]", loader_show_cmd, {(webfunc_t)loader_show_cmd}, 0, NULL},
|
||||
{"", "", NULL, {NULL}, 0, NULL},
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------------------*/
|
||||
int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
if (buff == NULL) {
|
||||
prnt("ERROR wrong loader SHOW command...\n");
|
||||
return 0;
|
||||
}
|
||||
if (debug > 0)
|
||||
prnt( "loader_show_cmd received %s\n",buff);
|
||||
|
||||
@@ -58,21 +61,19 @@ int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt)
|
||||
prnt( " Main executable build version: \"%s\"\n", loader_data.mainexec_buildversion);
|
||||
prnt( " Default shared lib path: \"%s\"\n", loader_data.shlibpath);
|
||||
prnt( " Max number of shared lib : %i\n", loader_data.maxshlibs);
|
||||
}
|
||||
else if (strcasestr(buff,"modules") != NULL) {
|
||||
prnt( "%i shared lib have been dynamicaly loaded by the oai loader\n", loader_data.numshlibs);
|
||||
for (int i=0 ; i<loader_data.numshlibs ; i++) {
|
||||
prnt( " Module %i: %s\n", i,loader_data.shlibs[i].name);
|
||||
prnt( " Shared library build version: \"%s\"\n",((loader_data.shlibs[i].shlib_buildversion == NULL )?"":loader_data.shlibs[i].shlib_buildversion));
|
||||
prnt( " Shared library path: \"%s\"\n", loader_data.shlibs[i].thisshlib_path);
|
||||
prnt( " %i function pointers registered:\n", loader_data.shlibs[i].numfunc);
|
||||
for(int j=0 ; j<loader_data.shlibs[i].numfunc;j++) {
|
||||
prnt( " function %i %s at %p\n",j,
|
||||
loader_data.shlibs[i].funcarray[j].fname, loader_data.shlibs[i].funcarray[j].fptr);
|
||||
}
|
||||
} else if (strcasestr(buff, "modules") != NULL || buff[0] == 0 || strcasestr(buff, "show") != NULL) {
|
||||
prnt("%i shared lib have been dynamicaly loaded by the oai loader\n", loader_data.numshlibs);
|
||||
for (int i = 0; i < loader_data.numshlibs; i++) {
|
||||
prnt(" Module %i: %s\n", i, loader_data.shlibs[i].name);
|
||||
prnt(" Shared library build version: \"%s\"\n", ((loader_data.shlibs[i].shlib_buildversion == NULL) ? "" : loader_data.shlibs[i].shlib_buildversion));
|
||||
prnt(" Shared library path: \"%s\"\n", loader_data.shlibs[i].thisshlib_path);
|
||||
prnt(" %i function pointers registered:\n", loader_data.shlibs[i].numfunc);
|
||||
for (int j = 0; j < loader_data.shlibs[i].numfunc; j++) {
|
||||
prnt(" function %i %s at %p\n", j, loader_data.shlibs[i].funcarray[j].fname, loader_data.shlibs[i].funcarray[j].fptr);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
prnt("%s: wrong loader command...\n",buff);
|
||||
prnt("%s: wrong loader command...\n", buff);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -37,14 +37,11 @@
|
||||
|
||||
#include "common/utils/load_module_shlib.h"
|
||||
|
||||
|
||||
telnetshell_vardef_t loader_globalvardef[] = {
|
||||
{"mainversion",TELNET_VARTYPE_STRING,&(loader_data.mainexec_buildversion)},
|
||||
{"defpath",TELNET_VARTYPE_STRING,&(loader_data.shlibpath)},
|
||||
{"maxshlibs",TELNET_VARTYPE_INT32,&(loader_data.maxshlibs)},
|
||||
{"numshlibs",TELNET_VARTYPE_INT32,&(loader_data.numshlibs)},
|
||||
{"",0,NULL}
|
||||
};
|
||||
telnetshell_vardef_t loader_globalvardef[] = {{"mainversion", TELNET_VARTYPE_STRING, TELNET_CHECKVAL_RDONLY, &(loader_data.mainexec_buildversion)},
|
||||
{"defpath", TELNET_VARTYPE_STRING, TELNET_CHECKVAL_RDONLY, &(loader_data.shlibpath)},
|
||||
{"maxshlibs", TELNET_VARTYPE_INT32, TELNET_CHECKVAL_RDONLY, &(loader_data.maxshlibs)},
|
||||
{"numshlibs", TELNET_VARTYPE_INT32, TELNET_CHECKVAL_RDONLY, &(loader_data.numshlibs)},
|
||||
{"", 0, 0, NULL}};
|
||||
telnetshell_vardef_t *loader_modulesvardef;
|
||||
|
||||
extern void add_loader_cmds(void);
|
||||
|
||||
@@ -91,9 +91,7 @@ telnetshell_cmddef_t measur_cmdarray[] = {
|
||||
{"","",NULL}
|
||||
};
|
||||
|
||||
telnetshell_vardef_t measur_vardef[] = {
|
||||
{"",0,NULL}
|
||||
};
|
||||
telnetshell_vardef_t measur_vardef[] = {{"", 0, 0, NULL}};
|
||||
/* function to be implemented in any telnetsrv_xxx_measurements.c sources
|
||||
to allow common measurment code to access measurments data */
|
||||
extern int get_measurgroups(telnet_measurgroupdef_t **measurgroups);
|
||||
|
||||
@@ -44,17 +44,7 @@
|
||||
#define TELNETVAR_PHYCC0 0
|
||||
#define TELNETVAR_PHYCC1 1
|
||||
|
||||
telnetshell_vardef_t phy_vardef[] = {
|
||||
//{"iqmax",TELNET_VARTYPE_INT16,NULL},
|
||||
//{"iqmin",TELNET_VARTYPE_INT16,NULL},
|
||||
//{"loglvl",TELNET_VARTYPE_INT32,NULL},
|
||||
//{"sndslp",TELNET_VARTYPE_INT32,NULL},
|
||||
//{"rxrescale",TELNET_VARTYPE_INT32,NULL},
|
||||
//{"txshift",TELNET_VARTYPE_INT32,NULL},
|
||||
//{"rachemin",TELNET_VARTYPE_INT32,NULL},
|
||||
//{"rachdmax",TELNET_VARTYPE_INT32,NULL},
|
||||
{"",0,NULL}
|
||||
};
|
||||
telnetshell_vardef_t phy_vardef[] = {{"", 0, 0, NULL}};
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -57,84 +57,119 @@
|
||||
#include "openair1/PHY/phy_extern.h"
|
||||
#include "telnetsrv_proccmd.h"
|
||||
|
||||
void decode_procstat(char *record, int debug, telnet_printfunc_t prnt)
|
||||
void decode_procstat(char *record, int debug, telnet_printfunc_t prnt, webdatadef_t *tdata)
|
||||
{
|
||||
char prntline[160];
|
||||
char *procfile_fiels;
|
||||
char *procfile_fields;
|
||||
char *strtokptr;
|
||||
char *lptr;
|
||||
int fieldcnt;
|
||||
char toksep[2];
|
||||
|
||||
fieldcnt=0;
|
||||
procfile_fiels =strtok_r(record," ",&strtokptr);
|
||||
lptr= prntline;
|
||||
fieldcnt = 0;
|
||||
procfile_fields = strtok_r(record, " ", &strtokptr);
|
||||
lptr = prntline;
|
||||
/*http://man7.org/linux/man-pages/man5/proc.5.html gives the structure of the stat file */
|
||||
|
||||
while( procfile_fiels != NULL && fieldcnt < 42) {
|
||||
long int policy;
|
||||
if (strlen(procfile_fiels) == 0)
|
||||
continue;
|
||||
fieldcnt++;
|
||||
sprintf(toksep," ");
|
||||
switch(fieldcnt) {
|
||||
case 1: /* id */
|
||||
lptr+=sprintf(lptr,"%9.9s ",procfile_fiels);
|
||||
sprintf(toksep,")");
|
||||
break;
|
||||
case 2: /* name */
|
||||
lptr+=sprintf(lptr,"%20.20s ",procfile_fiels+1);
|
||||
break;
|
||||
case 3: //thread state
|
||||
lptr+=sprintf(lptr," %c ",procfile_fiels[0]);
|
||||
break;
|
||||
case 14: //time in user mode
|
||||
case 15: //time in kernel mode
|
||||
lptr+=sprintf(lptr,"%9.9s ",procfile_fiels);
|
||||
break;
|
||||
case 18: //priority
|
||||
case 19: //nice
|
||||
lptr+=sprintf(lptr,"%3.3s ",procfile_fiels);
|
||||
break;
|
||||
case 23: //vsize
|
||||
lptr+=sprintf(lptr,"%9.9s ",procfile_fiels);
|
||||
break;
|
||||
case 39: //processor
|
||||
lptr+=sprintf(lptr," %2.2s ",procfile_fiels);
|
||||
break;
|
||||
case 41: //policy
|
||||
lptr+=sprintf(lptr,"%3.3s ",procfile_fiels);
|
||||
policy=strtol(procfile_fiels,NULL,0);
|
||||
switch(policy) {
|
||||
case SCHED_FIFO:
|
||||
lptr+=sprintf(lptr,"%s ","rt: fifo");
|
||||
break;
|
||||
case SCHED_OTHER:
|
||||
lptr+=sprintf(lptr,"%s ","other");
|
||||
break;
|
||||
case SCHED_IDLE:
|
||||
lptr+=sprintf(lptr,"%s ","idle");
|
||||
break;
|
||||
case SCHED_BATCH:
|
||||
lptr+=sprintf(lptr,"%s ","batch");
|
||||
break;
|
||||
case SCHED_RR:
|
||||
lptr+=sprintf(lptr,"%s ","rt: rr");
|
||||
break;
|
||||
default:
|
||||
lptr+=sprintf(lptr,"%s ","????");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}/* switch on fieldcnr */
|
||||
procfile_fiels =strtok_r(NULL,toksep,&strtokptr);
|
||||
} /* while on proc_fields != NULL */
|
||||
prnt("%s\n",prntline);
|
||||
int priority = 0;
|
||||
int nice = 0;
|
||||
while (procfile_fields != NULL && fieldcnt < 42) {
|
||||
long int policy;
|
||||
if (strlen(procfile_fields) == 0)
|
||||
continue;
|
||||
fieldcnt++;
|
||||
sprintf(toksep, " ");
|
||||
switch (fieldcnt) {
|
||||
case 1: /* id */
|
||||
if (tdata != NULL) {
|
||||
tdata->lines[tdata->numlines].val[0] = strdup(procfile_fields);
|
||||
}
|
||||
lptr += sprintf(lptr, "%9.9s ", procfile_fields);
|
||||
sprintf(toksep, ")");
|
||||
break;
|
||||
case 2: /* name */
|
||||
if (tdata != NULL) {
|
||||
tdata->lines[tdata->numlines].val[1] = strdup(procfile_fields);
|
||||
}
|
||||
lptr += sprintf(lptr, "%20.20s ", procfile_fields + 1);
|
||||
break;
|
||||
case 3: // thread state
|
||||
lptr += sprintf(lptr, " %c ", procfile_fields[0]);
|
||||
break;
|
||||
case 14: // time in user mode
|
||||
case 15: // time in kernel mode
|
||||
lptr += sprintf(lptr, "%9.9s ", procfile_fields);
|
||||
break;
|
||||
case 18: // priority column index 2 in tdata, -2 to -100 (1, min to 99, highest prio)
|
||||
priority = strtol(procfile_fields, NULL, 0);
|
||||
case 19: // nice column index 3 in tdata 0 to 39 (-20, highest prio, to 19)
|
||||
if (tdata != NULL) {
|
||||
tdata->lines[tdata->numlines].val[fieldcnt - 16] = strdup(procfile_fields);
|
||||
}
|
||||
lptr += sprintf(lptr, "%3.3s ", procfile_fields);
|
||||
nice = strtol(procfile_fields, NULL, 0);
|
||||
break;
|
||||
case 23: // vsize
|
||||
lptr += sprintf(lptr, "%9.9s ", procfile_fields);
|
||||
break;
|
||||
case 39: // processor
|
||||
if (tdata != NULL) {
|
||||
tdata->lines[tdata->numlines].val[4] = strdup(procfile_fields);
|
||||
}
|
||||
lptr += sprintf(lptr, " %2.2s ", procfile_fields);
|
||||
break;
|
||||
case 41: // policy
|
||||
lptr += sprintf(lptr, "%3.3s ", procfile_fields);
|
||||
policy = strtol(procfile_fields, NULL, 0);
|
||||
char strschedp[64];
|
||||
switch (policy) {
|
||||
case SCHED_FIFO:
|
||||
snprintf(strschedp, sizeof(strschedp), "%s ", "rt:fifo");
|
||||
priority = priority + 1; // in /proc file system priority 1 to 99 mapped to -2 to -100
|
||||
break;
|
||||
case SCHED_OTHER:
|
||||
snprintf(strschedp, sizeof(strschedp), "%s ", "other");
|
||||
priority = nice - NICE_MIN; // linux nice is -20 to 19
|
||||
break;
|
||||
case SCHED_IDLE:
|
||||
snprintf(strschedp, sizeof(strschedp), "%s ", "idle");
|
||||
priority = 2 * (NICE_MAX - NICE_MIN + 1);
|
||||
break;
|
||||
case SCHED_BATCH:
|
||||
snprintf(strschedp, sizeof(strschedp), "%s ", "batch");
|
||||
priority = (NICE_MAX - NICE_MIN + 1) + nice - NICE_MIN;
|
||||
break;
|
||||
case SCHED_RR:
|
||||
snprintf(strschedp, sizeof(strschedp), "%s ", "rt:rr");
|
||||
priority = priority - 99;
|
||||
break;
|
||||
#ifdef SCHED_DEADLINE
|
||||
case SCHED_DEADLINE:
|
||||
snprintf(strschedp, sizeof(strschedp), "%s ", "rt:deadline");
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
snprintf(strschedp, sizeof(strschedp), "%s ", "????");
|
||||
break;
|
||||
}
|
||||
lptr += sprintf(lptr, "%s ", strschedp);
|
||||
if (tdata != NULL) {
|
||||
tdata->lines[tdata->numlines].val[5] = strdup(strschedp);
|
||||
tdata->lines[tdata->numlines].val[6] = malloc(10);
|
||||
snprintf(tdata->lines[tdata->numlines].val[6], 9, "%i", priority);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
} /* switch on fieldcnr */
|
||||
procfile_fields = strtok_r(NULL, toksep, &strtokptr);
|
||||
} /* while on proc_fields != NULL */
|
||||
prnt("%s\n", prntline);
|
||||
if (tdata != NULL) {
|
||||
tdata->numlines++;
|
||||
}
|
||||
} /*decode_procstat */
|
||||
|
||||
void read_statfile(char *fname,int debug, telnet_printfunc_t prnt)
|
||||
void read_statfile(char *fname, int debug, telnet_printfunc_t prnt, webdatadef_t *tdata)
|
||||
{
|
||||
FILE *procfile;
|
||||
char arecord[1024];
|
||||
@@ -152,44 +187,207 @@ char arecord[1024];
|
||||
return;
|
||||
}
|
||||
fclose(procfile);
|
||||
decode_procstat(arecord, debug, prnt);
|
||||
decode_procstat(arecord, debug, prnt, tdata);
|
||||
}
|
||||
|
||||
void print_threads(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
int nullprnt(char *fmt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void proccmd_get_threaddata(char *buf, int debug, telnet_printfunc_t fprnt, webdatadef_t *tdata)
|
||||
{
|
||||
char aname[256];
|
||||
|
||||
DIR *proc_dir;
|
||||
struct dirent *entry;
|
||||
DIR *proc_dir;
|
||||
struct dirent *entry;
|
||||
telnet_printfunc_t prnt = (fprnt != NULL) ? fprnt : (telnet_printfunc_t)nullprnt;
|
||||
if (tdata != NULL) {
|
||||
tdata->numcols = 7;
|
||||
snprintf(tdata->columns[0].coltitle, sizeof(tdata->columns[0].coltitle), "thread id");
|
||||
tdata->columns[0].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_RDONLY | TELNET_VAR_NEEDFREE;
|
||||
snprintf(tdata->columns[1].coltitle, sizeof(tdata->columns[1].coltitle), "thread name");
|
||||
tdata->columns[1].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_RDONLY | TELNET_VAR_NEEDFREE;
|
||||
snprintf(tdata->columns[2].coltitle, sizeof(tdata->columns[2].coltitle), "priority");
|
||||
tdata->columns[2].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_RDONLY | TELNET_VAR_NEEDFREE;
|
||||
snprintf(tdata->columns[3].coltitle, sizeof(tdata->columns[3].coltitle), "nice");
|
||||
tdata->columns[3].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_RDONLY | TELNET_VAR_NEEDFREE;
|
||||
snprintf(tdata->columns[4].coltitle, sizeof(tdata->columns[4].coltitle), "core");
|
||||
tdata->columns[4].coltype = TELNET_VARTYPE_STRING | TELNET_VAR_NEEDFREE;
|
||||
snprintf(tdata->columns[5].coltitle, sizeof(tdata->columns[5].coltitle), "sched policy");
|
||||
tdata->columns[5].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_RDONLY | TELNET_VAR_NEEDFREE;
|
||||
snprintf(tdata->columns[5].coltitle, sizeof(tdata->columns[5].coltitle), "sched policy");
|
||||
tdata->columns[6].coltype = TELNET_VARTYPE_STRING | TELNET_VAR_NEEDFREE;
|
||||
snprintf(tdata->columns[6].coltitle, sizeof(tdata->columns[6].coltitle), "oai priority");
|
||||
tdata->numlines = 0;
|
||||
}
|
||||
|
||||
unsigned int eax = 11, ebx = 0, ecx = 1, edx = 0;
|
||||
|
||||
asm volatile("cpuid" : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) : "0"(eax), "2"(ecx) :);
|
||||
|
||||
prnt(" id name state USRmod KRNmod prio nice vsize proc pol \n\n");
|
||||
snprintf(aname, sizeof(aname), "/proc/%d/stat", getpid());
|
||||
read_statfile(aname,debug,prnt);
|
||||
prnt("\n");
|
||||
snprintf(aname, sizeof(aname), "/proc/%d/task", getpid());
|
||||
proc_dir = opendir(aname);
|
||||
if (proc_dir == NULL)
|
||||
{
|
||||
prnt("Error: Couldn't open %s %i %s\n",aname,errno,strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
while ((entry = readdir(proc_dir)) != NULL)
|
||||
{
|
||||
if(entry->d_name[0] == '.')
|
||||
continue;
|
||||
snprintf(aname, sizeof(aname), "/proc/%d/task/%.*s/stat", getpid(),(int)(sizeof(aname)-24),entry->d_name);
|
||||
read_statfile(aname,debug,prnt);
|
||||
} /* while entry != NULL */
|
||||
closedir(proc_dir);
|
||||
} /* print_threads */
|
||||
prnt("System has %d cores %d threads %d Actual threads", eax, ebx, edx);
|
||||
|
||||
prnt("\n id name state USRmod KRNmod prio nice vsize proc pol \n\n");
|
||||
snprintf(aname, sizeof(aname), "/proc/%d/stat", getpid());
|
||||
read_statfile(aname, debug, prnt, NULL);
|
||||
prnt("\n");
|
||||
snprintf(aname, sizeof(aname), "/proc/%d/task", getpid());
|
||||
proc_dir = opendir(aname);
|
||||
if (proc_dir == NULL) {
|
||||
prnt("Error: Couldn't open %s %i %s\n", aname, errno, strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
while ((entry = readdir(proc_dir)) != NULL) {
|
||||
if (entry->d_name[0] != '.') {
|
||||
snprintf(aname, sizeof(aname), "/proc/%d/task/%.*s/stat", getpid(), (int)(sizeof(aname) - 24), entry->d_name);
|
||||
read_statfile(aname, debug, prnt, tdata);
|
||||
}
|
||||
} /* while entry != NULL */
|
||||
closedir(proc_dir);
|
||||
} /* proccmd_get_threaddata */
|
||||
|
||||
void print_threads(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
proccmd_get_threaddata(buf, debug, prnt, NULL);
|
||||
}
|
||||
|
||||
int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfunc_t prnt)
|
||||
{
|
||||
webdatadef_t *logsdata = (webdatadef_t *)data;
|
||||
if (strncmp(cmdbuff, "set", 3) == 0) {
|
||||
telnet_printfunc_t printfunc = (prnt != NULL) ? prnt : (telnet_printfunc_t)printf;
|
||||
if (strcasestr(cmdbuff, "loglvl") != NULL) {
|
||||
int level = map_str_to_int(log_level_names, logsdata->lines[0].val[1]);
|
||||
int enabled = (strcmp(logsdata->lines[0].val[2], "true") == 0) ? 1 : 0;
|
||||
int loginfile = (strcmp(logsdata->lines[0].val[3], "true") == 0) ? 1 : 0;
|
||||
set_log(logsdata->numlines, level);
|
||||
if (enabled == 0)
|
||||
set_log(logsdata->numlines, OAILOG_DISABLE);
|
||||
if (loginfile == 1) {
|
||||
set_component_filelog(logsdata->numlines);
|
||||
} else {
|
||||
close_component_filelog(logsdata->numlines);
|
||||
}
|
||||
printfunc("%s log level %s is %s, output to %s\n",
|
||||
logsdata->lines[0].val[0],
|
||||
logsdata->lines[0].val[1],
|
||||
enabled ? "enabled" : "disabled",
|
||||
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]);
|
||||
if (optbit < 0) {
|
||||
printfunc("option %s unknown\n", logsdata->lines[0].val[0]);
|
||||
} else {
|
||||
if (strcmp(logsdata->lines[0].val[1], "true") == 0) {
|
||||
SET_LOG_OPTION(optbit);
|
||||
} else {
|
||||
CLEAR_LOG_OPTION(optbit);
|
||||
}
|
||||
printfunc("%s log option %s\n", logsdata->lines[0].val[0], (strcmp(logsdata->lines[0].val[1], "true") == 0) ? "enabled" : "disabled");
|
||||
}
|
||||
}
|
||||
if (strcasestr(cmdbuff, "dbgopt") != NULL) {
|
||||
int optbit = map_str_to_int(log_maskmap, logsdata->lines[0].val[0]);
|
||||
if (optbit < 0) {
|
||||
printfunc("debug option %s unknown\n", logsdata->lines[0].val[0]);
|
||||
} else {
|
||||
if (strcmp(logsdata->lines[0].val[1], "true") == 0)
|
||||
SET_LOG_DEBUG(optbit);
|
||||
else
|
||||
CLEAR_LOG_DEBUG(optbit);
|
||||
if (strcmp(logsdata->lines[0].val[2], "true") == 0)
|
||||
SET_LOG_DUMP(optbit);
|
||||
else
|
||||
CLEAR_LOG_DUMP(optbit);
|
||||
printfunc("%s debug %s dump %s\n",
|
||||
logsdata->lines[0].val[0],
|
||||
(strcmp(logsdata->lines[0].val[1], "true") == 0) ? "enabled" : "disabled",
|
||||
(strcmp(logsdata->lines[0].val[2], "true") == 0) ? "enabled" : "disabled");
|
||||
}
|
||||
}
|
||||
if (strcasestr(cmdbuff, "threadsched") != NULL) {
|
||||
unsigned int tid = strtoll(logsdata->lines[0].val[0], NULL, 0);
|
||||
unsigned int core = strtoll(logsdata->lines[0].val[4], NULL, 0);
|
||||
int priority = strtoll(logsdata->lines[0].val[6], NULL, 0);
|
||||
printfunc("Thread %s id %u set affinity to core %u\n", logsdata->lines[0].val[0], tid, core);
|
||||
set_affinity(0, (pid_t)tid, core);
|
||||
set_sched(0, (pid_t)tid, priority);
|
||||
}
|
||||
} else { /* end of set, => show */
|
||||
if (strcasestr(cmdbuff, "loglvl") != NULL) {
|
||||
logsdata->numcols = 4;
|
||||
logsdata->numlines = 0;
|
||||
snprintf(logsdata->columns[0].coltitle, TELNET_CMD_MAXSIZE, "component");
|
||||
logsdata->columns[0].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_RDONLY;
|
||||
snprintf(logsdata->columns[1].coltitle, TELNET_CMD_MAXSIZE, "level");
|
||||
logsdata->columns[1].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_LOGLVL;
|
||||
snprintf(logsdata->columns[2].coltitle, TELNET_CMD_MAXSIZE, "enabled");
|
||||
logsdata->columns[2].coltype = TELNET_CHECKVAL_BOOL;
|
||||
snprintf(logsdata->columns[3].coltitle, TELNET_CMD_MAXSIZE, "in file");
|
||||
logsdata->columns[3].coltype = TELNET_CHECKVAL_BOOL;
|
||||
|
||||
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_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";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strcasestr(cmdbuff, "dbgopt") != NULL) {
|
||||
webdatadef_t *logsdata = (webdatadef_t *)data;
|
||||
logsdata->numcols = 3;
|
||||
logsdata->numlines = 0;
|
||||
snprintf(logsdata->columns[0].coltitle, TELNET_CMD_MAXSIZE, "module");
|
||||
logsdata->columns[0].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_RDONLY;
|
||||
snprintf(logsdata->columns[1].coltitle, TELNET_CMD_MAXSIZE, "debug");
|
||||
logsdata->columns[1].coltype = TELNET_CHECKVAL_BOOL;
|
||||
snprintf(logsdata->columns[2].coltitle, TELNET_CMD_MAXSIZE, "dump");
|
||||
logsdata->columns[2].coltype = TELNET_CHECKVAL_BOOL;
|
||||
|
||||
for (int i = 0; log_maskmap[i].name != NULL; i++) {
|
||||
logsdata->numlines++;
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
||||
if (strcasestr(cmdbuff, "logopt") != NULL) {
|
||||
webdatadef_t *logsdata = (webdatadef_t *)data;
|
||||
logsdata->numcols = 2;
|
||||
logsdata->numlines = 0;
|
||||
snprintf(logsdata->columns[0].coltitle, TELNET_CMD_MAXSIZE, "option");
|
||||
logsdata->columns[0].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_RDONLY;
|
||||
snprintf(logsdata->columns[1].coltitle, TELNET_CMD_MAXSIZE, "enabled");
|
||||
logsdata->columns[1].coltype = TELNET_CHECKVAL_BOOL;
|
||||
|
||||
for (int i = 0; log_options[i].name != NULL; i++) {
|
||||
logsdata->numlines++;
|
||||
logsdata->lines[i].val[0] = log_options[i].name;
|
||||
logsdata->lines[i].val[1] = (g_log->flag & log_options[i].value) ? "true" : "false";
|
||||
}
|
||||
}
|
||||
if (strcasestr(cmdbuff, "threadsched") != NULL) {
|
||||
proccmd_get_threaddata(cmdbuff, debug, prnt, (webdatadef_t *)data);
|
||||
}
|
||||
} // show
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
|
||||
if (buf == NULL) {
|
||||
prnt("ERROR wrong softmodem SHOW command...\n");
|
||||
return 0;
|
||||
}
|
||||
if (debug > 0)
|
||||
prnt(" proccmd_show received %s\n",buf);
|
||||
if (strcasestr(buf,"thread") != NULL) {
|
||||
@@ -263,8 +461,12 @@ int proccmd_thread(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
int bv1,bv2;
|
||||
int res;
|
||||
char sv1[64];
|
||||
|
||||
char sv1[64];
|
||||
|
||||
if (buf == NULL) {
|
||||
prnt("ERROR wrong thread command...\n");
|
||||
return 0;
|
||||
}
|
||||
bv1=0;
|
||||
bv2=0;
|
||||
sv1[0]=0;
|
||||
@@ -279,7 +481,7 @@ char sv1[64];
|
||||
prnt(" proccmd_thread: %i params = %i,%s,%i\n",res,bv1,sv1,bv2);
|
||||
if(res != 3)
|
||||
{
|
||||
prnt("softmodem thread needs 3 params, %i received\n",res);
|
||||
print_threads(buf, debug, prnt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -302,11 +504,20 @@ int proccmd_exit(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
if (debug > 0)
|
||||
prnt("process module received %s\n",buf);
|
||||
|
||||
end_configmodule();
|
||||
exit_fun("telnet server received exit command\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int proccmd_restart(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
if (debug > 0)
|
||||
prnt("process module received %s\n", buf);
|
||||
end_configmodule();
|
||||
configmodule_interface_t *cfg = config_get_if();
|
||||
execvpe(cfg->argv[0], cfg->argv, environ);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int proccmd_log(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
@@ -391,7 +602,7 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
|
||||
SET_LOG_DUMP(optbit);
|
||||
else
|
||||
CLEAR_LOG_DUMP(optbit);
|
||||
proccmd_show("dbgopt",debug,prnt);
|
||||
proccmd_show("dump", debug, prnt);
|
||||
}
|
||||
}
|
||||
if (logparam != NULL) free(logparam);
|
||||
@@ -431,7 +642,8 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
|
||||
prnt("%s%s unknown log sub command \n",logparam, tmpstr);
|
||||
}
|
||||
} else {
|
||||
prnt("%s unknown log sub command \n",logsubcmd);
|
||||
level = map_str_to_int(log_level_names, tmpstr);
|
||||
prnt("%s unknown log sub command \n", logsubcmd);
|
||||
}
|
||||
if (logparam != NULL) free(logparam);
|
||||
if (tmpstr != NULL) free(tmpstr);
|
||||
|
||||
@@ -44,11 +44,12 @@
|
||||
extern int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt);
|
||||
extern int proccmd_thread(char *buf, int debug, telnet_printfunc_t prnt);
|
||||
extern int proccmd_exit(char *buf, int debug, telnet_printfunc_t prnt);
|
||||
extern int proccmd_restart(char *buf, int debug, telnet_printfunc_t prnt);
|
||||
extern int proccmd_log(char *buf, int debug, telnet_printfunc_t prnt);
|
||||
telnetshell_vardef_t proc_vardef[] = {
|
||||
{"",0,NULL}
|
||||
};
|
||||
#define PROCCMD_LOG_HELP_STRING " log sub commands: \n\
|
||||
extern int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfunc_t prnt);
|
||||
telnetshell_vardef_t proc_vardef[] = {{"", 0, 0, NULL}};
|
||||
#define PROCCMD_LOG_HELP_STRING \
|
||||
" log sub commands: \n\
|
||||
show: display current log configuration \n\
|
||||
online, noonline: enable or disable console logs \n\
|
||||
enable, disable id1-id2: enable or disable logs for components index id1 to id2 \n\
|
||||
@@ -60,24 +61,32 @@ telnetshell_vardef_t proc_vardef[] = {
|
||||
print_<opt> <0|1> disable or enable the \"opt\" log option, use the show command to get \
|
||||
the available options\n\
|
||||
dump_<mod> debug_<mod > disable or enable the debug file generation or debug code\
|
||||
for \"mod\" module. use the show command to get the available modules\n"
|
||||
for \"mod\" module. use the show command to get the available modules\n"
|
||||
|
||||
#define PROCCMD_THREAD_HELP_STRING " thread sub commands: \n\
|
||||
#define PROCCMD_THREAD_HELP_STRING \
|
||||
" thread sub commands: \n\
|
||||
<thread id> aff <core> : set affinity of thread <thread id> to core <core> \n\
|
||||
<thread id> prio <prio> : set scheduling parameters for thread <thread id> \n\
|
||||
if prio < -20: linux scheduling policy set to FIFO, \n\
|
||||
with priority = -20 - prio \n\
|
||||
if prio > 19: linux scheduling policy set to OTHER, \n\
|
||||
with priority (nice value) = prio \n\
|
||||
-100 < prio < 0: linux scheduling policy set to FIFO, priority -prio, \n\
|
||||
-200 < prio < -100: linux scheduling policy set to RR, priority -(prio+100), \n\
|
||||
0 <= prio < 40: linux scheduling policy set to NORMAL, nice value prio-20 \n\
|
||||
40 <= prio < 80: linux scheduling policy set to BATCH, nice value prio-60 \n\
|
||||
prio >=80: linux scheduling policy set to IDLE \n\
|
||||
use \"softmodem show thread\" to get <thread id> \n"
|
||||
|
||||
|
||||
telnetshell_cmddef_t proc_cmdarray[] = {
|
||||
{"show","loglvl|thread|config", proccmd_show},
|
||||
{"log","(enter help for details)", proccmd_log},
|
||||
{"thread","(enter help for details)", proccmd_thread},
|
||||
{"exit","", proccmd_exit},
|
||||
{"","",NULL},
|
||||
{"show", "loglvl|thread|config", proccmd_show, {(webfunc_t)proccmd_websrv_getdata}, TELNETSRV_CMDFLAG_TELNETONLY, NULL},
|
||||
{"log", "(enter help for details)", proccmd_log, {NULL}, TELNETSRV_CMDFLAG_TELNETONLY, NULL},
|
||||
{"show loglvl", "", proccmd_log, {(webfunc_t)proccmd_websrv_getdata}, TELNETSRV_CMDFLAG_WEBSRVONLY | TELNETSRV_CMDFLAG_GETWEBTBLDATA, NULL},
|
||||
{"show logopt", "", proccmd_log, {(webfunc_t)proccmd_websrv_getdata}, TELNETSRV_CMDFLAG_WEBSRVONLY | TELNETSRV_CMDFLAG_GETWEBTBLDATA, NULL},
|
||||
{"show dbgopt", "", proccmd_log, {(webfunc_t)proccmd_websrv_getdata}, TELNETSRV_CMDFLAG_WEBSRVONLY | TELNETSRV_CMDFLAG_GETWEBTBLDATA, NULL},
|
||||
{"show config", "", proccmd_show, {(webfunc_t)proccmd_show}, TELNETSRV_CMDFLAG_WEBSRVONLY, NULL},
|
||||
{"show thread", "", proccmd_thread, {(webfunc_t)proccmd_show}, TELNETSRV_CMDFLAG_WEBSRVONLY | TELNETSRV_CMDFLAG_AUTOUPDATE, NULL},
|
||||
{"thread", "(enter help for details)", proccmd_thread, {NULL}, TELNETSRV_CMDFLAG_TELNETONLY, NULL},
|
||||
{"show threadsched", "", proccmd_show, {(webfunc_t)proccmd_websrv_getdata}, TELNETSRV_CMDFLAG_WEBSRVONLY | TELNETSRV_CMDFLAG_GETWEBTBLDATA, NULL},
|
||||
{"exit", "", proccmd_exit, {NULL}, TELNETSRV_CMDFLAG_CONFEXEC, NULL},
|
||||
{"restart", "", proccmd_restart, {NULL}, TELNETSRV_CMDFLAG_CONFEXEC, NULL},
|
||||
{"", "", NULL},
|
||||
};
|
||||
#else
|
||||
extern void add_proccmd_cmds(void);
|
||||
|
||||
7
common/utils/websrv/DOC/websrv.md
Normal file
7
common/utils/websrv/DOC/websrv.md
Normal file
@@ -0,0 +1,7 @@
|
||||
The oai web server is an optional monitoring and debugging tool. Purpose is to give access to oai softmodems functionalities via a web interface. In this first release interface to the telnet server commands and to the softscope are delivered.
|
||||
|
||||
* [Using the web server](webserverusage.md)
|
||||
* [enhancing the webserver](webserverdevcmd.md)
|
||||
* [web server architecture ](webserverarch.md)
|
||||
|
||||
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
|
||||
21
common/utils/websrv/DOC/websrvarch.md
Normal file
21
common/utils/websrv/DOC/websrvarch.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# web server interface principles
|
||||
|
||||
The web server interface is implemented in two parts: a back-end, included in the softmodem process and a front-end which is a browser application.
|
||||
|
||||
The oai web server back-end is implemented in a shared library to be loaded by the [oai shared library loader](loader) when `--websrv` option is specified on the command line. `libwebsrv.so ` code is common to all oai softmodem executables, the current release has been tested with the nr UE and the gNB.
|
||||
|
||||
The front-end is an [angular](https://angular.io/docs) application. After being built and installed it is delivered to browsers by the back-end at connection time.
|
||||
|
||||
Front-end and back-end communicate via http request - http response transactions, including `json` body. these `json` interfaces are defined in the [frontend/src/app/api/XXXX.api.ts](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/websrv/src/frontend/src/app/api/) files. Back-end decapsulates the http requests it receives, looking for the `json`body to determine the requested information or command. Then the back-end builds a http response, with a `json`body encapsulating the requested information or the requested command result.
|
||||
|
||||
When unsolicited communication, from back-end to front-end is necessary, a [websocket](https://www.rfc-editor.org/rfc/rfc6455) link is opened. This is the case for the softscope interface.
|
||||
|
||||
# web server interface source files
|
||||
|
||||
web server source files are located in [common/utils/websrv](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/websrv)
|
||||
|
||||
1. back-end files are directly located in the `websrv` repository
|
||||
1. The [frontend/src](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/websrv/src/frontend) sub-directory contains the angular front-end source tree.
|
||||
1. [common/utils/websrv/helpfiles](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/websrv/helpfiles) contains files delivered to the front-end to respond to help requests.
|
||||
|
||||
[oai web server interface home](websrv.md)
|
||||
212
common/utils/websrv/DOC/websrvuse.md
Normal file
212
common/utils/websrv/DOC/websrvuse.md
Normal file
@@ -0,0 +1,212 @@
|
||||
|
||||
|
||||
When all dependencies are met, you can build the all the web server interface components using the build_oai script with the `--build-lib all` option . As the web interface is an optional component, if it's dependencies are not found it won't stop the build. Web interface components (back-end or front-end) which cannot be built are just skipped.
|
||||
|
||||
###### build example when missing back-end dependencies
|
||||
|
||||
```
|
||||
./build_oai --build-lib all --nrUE
|
||||
websrv optional build not included in build-lib option as dependencies requirements not met
|
||||
Enabling build of all optional shared libraries (telnetsrv enbscope uescope nrscope)
|
||||
Will compile NR UE
|
||||
RF HW set to None
|
||||
2. Setting the OAI PATHS ...
|
||||
OPENAIR_DIR = /usr/local/oai/oai-develop/openairinterface5g
|
||||
FreeDiameter prefix not found, install freeDiameter if EPC, HSS
|
||||
3. building the compilation directives ...
|
||||
running cmake ../../..
|
||||
NETTLE VERSION_INSTALLED = 3.5.1
|
||||
NETTLE_VERSION_MAJOR = 3
|
||||
NETTLE_VERSION_MINOR = 5
|
||||
cuda include /usr/include
|
||||
cuda library
|
||||
-- CMAKE_BUILD_TYPE is RelWithDebInfo
|
||||
-- CPUARCH x86_64
|
||||
-- AVX512 intrinsics are OFF
|
||||
-- AVX2 intrinsics are ON
|
||||
-- No T1 Offload support detected
|
||||
calling protoc_call=/usr/local/oai/oai-develop/openairinterface5g/cmake_targets/tools/generate_protobuf FSPT_C_DIR=/usr/local/oai/oai-develop/openairinterface5g/cmake_targets/ran_build/build/CMakeFiles/FSPT_V2 FSPT_MSG_DIR=/usr/local/oai/oai-develop/openairinterface5g/targets/COMMON/MESSAGES/V2 FSPT_MSG_FILES=/usr/local/oai/oai-develop/openairinterface5g/targets/COMMON/MESSAGES/V2/flexsplit.proto
|
||||
[libprotobuf WARNING google/protobuf/compiler/parser.cc:546] No syntax specified for the proto file: flexsplit.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
|
||||
fspt c dir is : /usr/local/oai/oai-develop/openairinterface5g/cmake_targets/ran_build/build/CMakeFiles/FSPT_V2
|
||||
gcc -Wall -I. -I.. -I../itti -I../../../openair2/COMMON -Itracer -o _check_vcd check_vcd.c tracer/database.c tracer/utils.c -lm -pthread
|
||||
./_check_vcd || (rm -f ./_check_vcd ./T_IDs.h ./T_messages.txt.h && false)
|
||||
rm -f ./_check_vcd
|
||||
Add enb specific telnet functions in libtelnetsrv_enb.so
|
||||
No specific telnet functions for gnb
|
||||
No specific telnet functions for 4Gue
|
||||
Add 5Gue specific telnet functions in libtelnetsrv_5Gue.so
|
||||
CMake Warning at common/utils/websrv/websrv_CMakeLists.txt:12 (message):
|
||||
ulfius library (https://github.com/babelouest/ulfius) not found, install
|
||||
libulfius-dev (ubuntu) if you need to build websrv back-end
|
||||
Call Stack (most recent call first):
|
||||
CMakeLists.txt:3189 (include)
|
||||
|
||||
|
||||
-- websrv backend build skipped, dependencies not found
|
||||
..........
|
||||
.............
|
||||
|
||||
```
|
||||
|
||||
###### build example when missing back-end dependencies
|
||||
|
||||
```
|
||||
./build_oai --build-lib all --nrUE
|
||||
Enabling build of all optional shared libraries (telnetsrv enbscope uescope nrscope websrv)
|
||||
Will compile NR UE
|
||||
RF HW set to None
|
||||
|
||||
2. Setting the OAI PATHS ...
|
||||
OPENAIR_DIR = /usr/local/oai/oai-develop/openairinterface5g
|
||||
FreeDiameter prefix not found, install freeDiameter if EPC, HSS
|
||||
3. building the compilation directives ...
|
||||
running cmake ../../..
|
||||
NETTLE VERSION_INSTALLED = 3.5.1
|
||||
NETTLE_VERSION_MAJOR = 3
|
||||
NETTLE_VERSION_MINOR = 5
|
||||
cuda include /usr/include
|
||||
cuda library
|
||||
-- CMAKE_BUILD_TYPE is RelWithDebInfo
|
||||
-- CPUARCH x86_64
|
||||
-- AVX512 intrinsics are OFF
|
||||
-- AVX2 intrinsics are ON
|
||||
-- No T1 Offload support detected
|
||||
calling protoc_call=/usr/local/oai/oai-develop/openairinterface5g/cmake_targets/tools/generate_protobuf FSPT_C_DIR=/usr/local/oai/oai-develop/openairinterface5g/cmake_targets/ran_build/build/CMakeFiles/FSPT_V2 FSPT_MSG_DIR=/usr/local/oai/oai-develop/openairinterface5g/targets/COMMON/MESSAGES/V2 FSPT_MSG_FILES=/usr/local/oai/oai-develop/openairinterface5g/targets/COMMON/MESSAGES/V2/flexsplit.proto
|
||||
[libprotobuf WARNING google/protobuf/compiler/parser.cc:546] No syntax specified for the proto file: flexsplit.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
|
||||
fspt c dir is : /usr/local/oai/oai-develop/openairinterface5g/cmake_targets/ran_build/build/CMakeFiles/FSPT_V2
|
||||
gcc -Wall -I. -I.. -I../itti -I../../../openair2/COMMON -Itracer -o _check_vcd check_vcd.c tracer/database.c tracer/utils.c -lm -pthread
|
||||
./_check_vcd || (rm -f ./_check_vcd ./T_IDs.h ./T_messages.txt.h && false)
|
||||
rm -f ./_check_vcd
|
||||
Add enb specific telnet functions in libtelnetsrv_enb.so
|
||||
No specific telnet functions for gnb
|
||||
No specific telnet functions for 4Gue
|
||||
Add 5Gue specific telnet functions in libtelnetsrv_5Gue.so
|
||||
-- websrv backend can be built
|
||||
-- websrv frontend can be built
|
||||
-- Configuring done
|
||||
-- Generating done
|
||||
-- Build files have been written to: /usr/local/oai/oai-develop/openairinterface5g/cmake_targets/ran_build/build
|
||||
............
|
||||
.............
|
||||
Log file for compilation is being written to: /usr/local/oai/oai-develop/openairinterface5g/cmake_targets/log/websrv.txt
|
||||
websrv compiled
|
||||
Build of websrv frontend enabled
|
||||
Log file for compilation is being written to: /usr/local/oai/oai-develop/openairinterface5g/cmake_targets/log/websrvfront.txt
|
||||
websrvfront compiled
|
||||
Compiling rfsimulator
|
||||
Log file for compilation is being written to: /usr/local/oai/oai-develop/openairinterface5g/cmake_targets/log/rfsimulator.txt
|
||||
.............
|
||||
..............
|
||||
```
|
||||
|
||||
|
||||
|
||||
# building and installing the front-end
|
||||
|
||||
Before building the front-end you need to install the npm node.js installer:
|
||||
|
||||
`apt-get install npm` for ubuntu or `dnf install npm`for fedora
|
||||
|
||||
then to build and install the frontend:
|
||||
|
||||
``` bash
|
||||
cd \<oai repository\>/openairinterface5g/cmake_targets/ran_build/build
|
||||
make websrvfront
|
||||
up to date, audited 1099 packages in 3s
|
||||
|
||||
142 packages are looking for funding
|
||||
run `npm fund` for details
|
||||
|
||||
3 moderate severity vulnerabilities
|
||||
|
||||
Some issues need review, and may require choosing
|
||||
a different dependency.
|
||||
|
||||
Run `npm audit` for details.
|
||||
Built target websrvfront_installjsdep
|
||||
|
||||
> softmodemngx@2.0.0 build
|
||||
> ng build
|
||||
|
||||
✔ Browser application bundle generation complete.
|
||||
✔ Copying assets complete.
|
||||
✔ Index html generation complete.
|
||||
|
||||
Initial Chunk Files | Names | Raw Size | Estimated Transfer Size
|
||||
main.1917944d43411293.js | main | 996.88 kB | 231.03 kB
|
||||
styles.ca83009174c6585f.css | styles | 74.33 kB | 7.70 kB
|
||||
polyfills.36a0bc8cdfe2cb81.js | polyfills | 45.10 kB | 13.82 kB
|
||||
runtime.bf8117e4a18c7212.js | runtime | 1.06 kB | 606 bytes
|
||||
|
||||
| Initial Total | 1.09 MB | 253.14 kB
|
||||
|
||||
Build at: 2022-10-17T16:52:42.517Z - Hash: 3b6b647cfcb0dac9 - Time: 8651ms
|
||||
Moving frontend files to:
|
||||
/usr/local/oai/oai-develop/openairinterface5g/cmake_targets/ran_build/build/websrv
|
||||
/usr/local/oai/oai-develop/openairinterface5g/targets/bin/websrv
|
||||
Built target websrvfront
|
||||
```
|
||||
|
||||
|
||||
|
||||
# Building and installing the web server back-end
|
||||
The back-end has two dependencies:
|
||||
|
||||
1. the [ulfius library](https://github.com/babelouest/ulfius) and the corresponding include files which are provided by the ubuntu libulfius-dev package: `sudo apt-get install -y libulfius-dev`
|
||||
2. the [jansson](https://github.com/akheron/jansson-debian) library and the corresponding include files which are provided by the ubuntu libjansson-dev package: `sudo apt-get install -y libjansson-dev`
|
||||
|
||||
Dependencies can also be installed on fedora distribution, the jansson package is `jansson-devel`, ulfius has to be installed as explained [here](https://github.com/babelouest/ulfius/blob/master/INSTALL.md#pre-compiled-packages).
|
||||
|
||||
By default the embedded web server back-end , which is implemented in a shared library, is not built. It can be built after compiling the softmodem executable using the `build_oai` script:
|
||||
|
||||
```bash
|
||||
cd \<oai repository\>/openairinterface5g
|
||||
source oaienv
|
||||
cd cmake_targets
|
||||
./build_oai --build-lib websrv
|
||||
```
|
||||
|
||||
This will create the `libwebsrv.so` file in the `targets/bin` and `cmake_targets/ran_build/build` sub directories of the oai repository.
|
||||
|
||||
When starting the softmodem, you must specify the **_\-\-websrv_** option to load and start the web server. The web server is loaded via the [oai shared library loader](loader).
|
||||
|
||||
# Testing the web server interface
|
||||
|
||||
|
||||
## web server parameters
|
||||
The web server back-end is using the [oai configuration module](Config/Rtusage). web server parameters must be specified in the websrv section.
|
||||
|
||||
| name | type | default | description |
|
||||
|:---:|:---:|:---:|:----|
|
||||
| `listenaddr` | `ipV4 address, ascii format` | "0.0.0.0" | local address the back-end is listening on |
|
||||
| `listenport` | `integer` | 8090 | port number the server is listening on |
|
||||
| debug | `integer` | 0 | When not 0, http requests headers and json objects dump are added to back-end traces |
|
||||
| fpath | character string | websrv | The path to on-disk http server resources . The default value matches the front-end installation when running the softmodem from the executables repository. |
|
||||
| cert, key, rootca | `character string` | null | certificates and key used to trigger https protocol (not tested) |
|
||||
| | | | |
|
||||
|
||||
## running the back-end
|
||||
To trigger the back-end use the `--websrv` option, possibly modifying the parameters as explained in the previous chapter. The two following commands allow starting the oai gNB and the oai 5G UE on the same computer, starting the telnet server and the web interface on both executables.
|
||||
|
||||
`./nr-softmodem -O /usr/local/oai/conf/gnb.band78.sa.fr1.106PRB.usrpb210.conf --rfsim --rfsimulator.serveraddr server --telnetsrv --telnetsrv.listenstdin --websrv --rfsimulator.options chanmod`
|
||||
|
||||
.`/nr-uesoftmodem -O /usr/local/oai/conf/nrue_sim.conf --sa --numerology 1 -r 106 -C 3649440000 --rfsim --rfsimulator.serveraddr 127.0.0.1 --websrv --telnetsrv --websrv.listenport 8092 --nokrnmod --telnetsrv.listenport 8091`
|
||||
|
||||
|
||||
|
||||
## Connecting from a browser to the oai softmodem's
|
||||
|
||||
Assuming that the previous commands run successfully and that you also run your browser on the same host, you should be able to connect to the gNB and UE web interface using respectively the following url's:
|
||||
|
||||
http://127.0.0.1:8090/websrv/index.html
|
||||
http://127.0.0.1:8092/websrv/index.html
|
||||
|
||||
The interface should be intuitive enough, keeping in mind the following restrictions:
|
||||
|
||||
- The command tab is not available if the telnet server is not enabled
|
||||
- The softscope tab is not available if the xforms scope is started `(-d` option)
|
||||
- Only one connection is supported to a back-end, especially for the scope interface
|
||||
|
||||
Some front-end objects, which usage are less intuitive provide a tooltip to help interface usage.
|
||||
|
||||
[oai web serverinterface home](websrv.md)
|
||||
17
common/utils/websrv/frontend/.browserslistrc
Normal file
17
common/utils/websrv/frontend/.browserslistrc
Normal file
@@ -0,0 +1,17 @@
|
||||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
||||
# For additional information regarding the format and rule options, please see:
|
||||
# https://github.com/browserslist/browserslist#queries
|
||||
|
||||
# For the full list of supported browsers by the Angular framework, please see:
|
||||
# https://angular.io/guide/browser-support
|
||||
|
||||
# You can see what browsers were selected by your queries by running:
|
||||
# npx browserslist
|
||||
|
||||
last 1 Chrome version
|
||||
last 1 Firefox version
|
||||
last 2 Edge major versions
|
||||
last 2 Safari major versions
|
||||
last 2 iOS major versions
|
||||
Firefox ESR
|
||||
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
|
||||
16
common/utils/websrv/frontend/.editorconfig
Normal file
16
common/utils/websrv/frontend/.editorconfig
Normal file
@@ -0,0 +1,16 @@
|
||||
# Editor configuration, see https://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.ts]
|
||||
quote_type = single
|
||||
|
||||
[*.md]
|
||||
max_line_length = off
|
||||
trim_trailing_whitespace = false
|
||||
50
common/utils/websrv/frontend/.eslintrc.json
Normal file
50
common/utils/websrv/frontend/.eslintrc.json
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"root": true,
|
||||
"ignorePatterns": [
|
||||
"projects/**/*"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.ts"
|
||||
],
|
||||
"parserOptions": {
|
||||
"project": [
|
||||
"common/utils/websrv/frontend/tsconfig.json"
|
||||
],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:@angular-eslint/recommended",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"rules": {
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "attribute",
|
||||
"prefix": "app",
|
||||
"style": "camelCase"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": "app",
|
||||
"style": "kebab-case"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.html"
|
||||
],
|
||||
"extends": [
|
||||
"plugin:@angular-eslint/template/recommended"
|
||||
],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
50
common/utils/websrv/frontend/.gitignore
vendored
Normal file
50
common/utils/websrv/frontend/.gitignore
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
/tmp
|
||||
/out-tsc
|
||||
/artifacts
|
||||
/builds
|
||||
# Only exists if Bazel was run
|
||||
/bazel-out
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
||||
# profiling files
|
||||
chrome-profiler-events*.json
|
||||
speed-measure-plugin*.json
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
.project
|
||||
.classpath
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
*.sublime-workspace
|
||||
|
||||
# IDE - VSCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
.history/*
|
||||
|
||||
# misc
|
||||
/.angular/cache
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
testem.log
|
||||
/typings
|
||||
|
||||
# System Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
config.toml
|
||||
1
common/utils/websrv/frontend/README.md
Normal file
1
common/utils/websrv/frontend/README.md
Normal file
@@ -0,0 +1 @@
|
||||
# SoftModemNgx
|
||||
108
common/utils/websrv/frontend/angular.json
Normal file
108
common/utils/websrv/frontend/angular.json
Normal file
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"cli": {
|
||||
"analytics": false,
|
||||
"schematicCollections": [
|
||||
"@angular-eslint/schematics"
|
||||
]
|
||||
},
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"softmodemngx": {
|
||||
"projectType": "application",
|
||||
"schematics": {
|
||||
"@schematics/angular:application": {
|
||||
"strict": true
|
||||
}
|
||||
},
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"prefix": "app",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"outputPath": "dist/softmodem-ngx",
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "tsconfig.app.json",
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
],
|
||||
"styles": [
|
||||
"./node_modules/@angular/material/prebuilt-themes/purple-green.css",
|
||||
"src/styles.css"
|
||||
],
|
||||
"scripts": [],
|
||||
"allowedCommonJsDependencies": [
|
||||
"@firebase/auth",
|
||||
"firebase"
|
||||
]
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "1.5mb",
|
||||
"maximumError": "2mb"
|
||||
},
|
||||
{
|
||||
"type": "anyComponentStyle",
|
||||
"maximumWarning": "2kb",
|
||||
"maximumError": "4kb"
|
||||
}
|
||||
],
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
"outputHashing": "all"
|
||||
},
|
||||
"development": {
|
||||
"buildOptimizer": false,
|
||||
"optimization": false,
|
||||
"vendorChunk": true,
|
||||
"extractLicenses": false,
|
||||
"sourceMap": true,
|
||||
"namedChunks": true
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "softmodemngx:build:production"
|
||||
},
|
||||
"development": {
|
||||
"browserTarget": "softmodemngx:build:development"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "development"
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "softmodemngx:build"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-eslint/builder:lint",
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.html"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
common/utils/websrv/frontend/e2e/protractor-ci.conf.js
Normal file
23
common/utils/websrv/frontend/e2e/protractor-ci.conf.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// @ts-check
|
||||
// Protractor configuration file, see link for more information
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||
|
||||
const {SpecReporter, StacktraceOption} = require("jasmine-spec-reporter");
|
||||
|
||||
/**
|
||||
* @type { import("protractor").Config }
|
||||
*/
|
||||
exports.config = {
|
||||
allScriptsTimeout : 11000,
|
||||
specs : [ "./src/**/*.e2e-spec.ts" ],
|
||||
capabilities : {browserName : "chrome", chromeOptions : {args : [ "--headless", "--no-sandbox" ]}},
|
||||
directConnect : true,
|
||||
SELENIUM_PROMISE_MANAGER : true,
|
||||
baseUrl : "http://localhost:4200/",
|
||||
framework : "jasmine",
|
||||
jasmineNodeOpts : {showColors : true, defaultTimeoutInterval : 30000, print : function() {}},
|
||||
onPrepare() {
|
||||
require("ts-node").register({project : require("path").join(__dirname, "./tsconfig.json")});
|
||||
jasmine.getEnv().addReporter(new SpecReporter({spec : {displayStacktrace : StacktraceOption.PRETTY}}));
|
||||
}
|
||||
};
|
||||
23
common/utils/websrv/frontend/e2e/protractor.conf.js
Normal file
23
common/utils/websrv/frontend/e2e/protractor.conf.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// @ts-check
|
||||
// Protractor configuration file, see link for more information
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||
|
||||
const {SpecReporter, StacktraceOption} = require("jasmine-spec-reporter");
|
||||
|
||||
/**
|
||||
* @type { import("protractor").Config }
|
||||
*/
|
||||
exports.config = {
|
||||
allScriptsTimeout : 11000,
|
||||
specs : [ "./src/**/*.e2e-spec.ts" ],
|
||||
capabilities : {browserName : "chrome"},
|
||||
directConnect : true,
|
||||
SELENIUM_PROMISE_MANAGER : false,
|
||||
baseUrl : "http://localhost:4200/",
|
||||
framework : "jasmine",
|
||||
jasmineNodeOpts : {showColors : true, defaultTimeoutInterval : 30000, print : function() {}},
|
||||
onPrepare() {
|
||||
require("ts-node").register({project : require("path").join(__dirname, "./tsconfig.json")});
|
||||
jasmine.getEnv().addReporter(new SpecReporter({spec : {displayStacktrace : StacktraceOption.PRETTY}}));
|
||||
}
|
||||
};
|
||||
21
common/utils/websrv/frontend/e2e/src/app.e2e-spec.ts
Normal file
21
common/utils/websrv/frontend/e2e/src/app.e2e-spec.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import {browser, logging} from "protractor";
|
||||
import {AppPage} from "./app.po";
|
||||
|
||||
describe("workspace-project App", () => {
|
||||
let page: AppPage;
|
||||
|
||||
beforeEach(() => { page = new AppPage(); });
|
||||
|
||||
// it('should display welcome message', async () => {
|
||||
// await page.navigateTo();
|
||||
// expect(await page.getTitleText()).toEqual('example app is running!');
|
||||
// });
|
||||
|
||||
afterEach(async () => {
|
||||
// Assert that there are no errors emitted from the browser
|
||||
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
|
||||
expect(logs).not.toContain(jasmine.objectContaining({
|
||||
level : logging.Level.SEVERE,
|
||||
} as logging.Entry));
|
||||
});
|
||||
});
|
||||
13
common/utils/websrv/frontend/e2e/src/app.po.ts
Normal file
13
common/utils/websrv/frontend/e2e/src/app.po.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import {browser, by, element} from "protractor";
|
||||
|
||||
export class AppPage {
|
||||
async navigateTo(): Promise<unknown>
|
||||
{
|
||||
return browser.get(browser.baseUrl);
|
||||
}
|
||||
|
||||
async getTitleText(): Promise<string>
|
||||
{
|
||||
return element(by.css("app-root .content span")).getText();
|
||||
}
|
||||
}
|
||||
10
common/utils/websrv/frontend/e2e/tsconfig.json
Normal file
10
common/utils/websrv/frontend/e2e/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/e2e",
|
||||
"module": "commonjs",
|
||||
"target": "es2018",
|
||||
"types": ["jasmine", "node"]
|
||||
}
|
||||
}
|
||||
24319
common/utils/websrv/frontend/package-lock.json
generated
Normal file
24319
common/utils/websrv/frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
65
common/utils/websrv/frontend/package.json
Normal file
65
common/utils/websrv/frontend/package.json
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "softmodemngx",
|
||||
"version": "2.0.0",
|
||||
"scripts": {
|
||||
"lint": "ng lint",
|
||||
"build": "ng build",
|
||||
"dev": "ng serve --configuration=development",
|
||||
"prod": "ng serve --configuration=production"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular-slider/ngx-slider": "^2.0.4",
|
||||
"@angular/animations": "^14.1.0",
|
||||
"@angular/cdk": "^14.1.0",
|
||||
"@angular/common": "^14.1.0",
|
||||
"@angular/compiler": "^14.1.0",
|
||||
"@angular/core": "^14.1.0",
|
||||
"@angular/flex-layout": "^14.0.0-beta.40",
|
||||
"@angular/forms": "^14.1.0",
|
||||
"@angular/material": "^14.1.0",
|
||||
"@angular/platform-browser": "^14.1.0",
|
||||
"@angular/platform-browser-dynamic": "^14.1.0",
|
||||
"@angular/router": "^14.1.0",
|
||||
"chart.js": "^3.8.2",
|
||||
"moment": "^2.29.3",
|
||||
"ng2-charts": "^4.0.0",
|
||||
"rxjs": "^6.6.6",
|
||||
"tslib": "^2.0.0",
|
||||
"zone.js": "^0.11.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/architect": "^0.1401.0",
|
||||
"@angular-devkit/build-angular": "^14.1.0",
|
||||
"@angular-eslint/builder": "14.0.2",
|
||||
"@angular-eslint/eslint-plugin": "14.0.2",
|
||||
"@angular-eslint/eslint-plugin-template": "14.0.2",
|
||||
"@angular-eslint/schematics": "14.0.2",
|
||||
"@angular-eslint/template-parser": "14.0.2",
|
||||
"@angular/cli": "^14.1.0",
|
||||
"@angular/compiler-cli": "^14.1.0",
|
||||
"@angular/language-service": "^14.1.0",
|
||||
"@types/node": "^12.20.23",
|
||||
"@typescript-eslint/eslint-plugin": "^5.29.0",
|
||||
"@typescript-eslint/parser": "^5.29.0",
|
||||
"eslint": "^8.18.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"fuzzy": "^0.1.3",
|
||||
"husky": "^5.1.3",
|
||||
"inquirer": "^6.2.2",
|
||||
"inquirer-autocomplete-prompt": "^1.0.1",
|
||||
"jasmine-core": "~3.7.1",
|
||||
"jasmine-spec-reporter": "~5.0.0",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"open": "^7.0.3",
|
||||
"ts-node": "^8.10.2",
|
||||
"tslint-angular": "^3.0.3",
|
||||
"typescript": "~4.6.4"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "pretty-quick --staged && ng lint && ng test",
|
||||
"pre-push": "ng build --aot true"
|
||||
}
|
||||
}
|
||||
}
|
||||
114
common/utils/websrv/frontend/src/app/api/commands.api.ts
Normal file
114
common/utils/websrv/frontend/src/app/api/commands.api.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {Injectable} from "@angular/core";
|
||||
import {environment} from "src/environments/environment";
|
||||
export interface IInfo {
|
||||
name: string;
|
||||
value: string;
|
||||
type: IArgType;
|
||||
modifiable: boolean; // set command ?
|
||||
}
|
||||
|
||||
export interface IModule {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export enum ILogLvl {
|
||||
error = "error",
|
||||
warn = "warn",
|
||||
analysis = "analysis",
|
||||
info = "info",
|
||||
debug = "debug",
|
||||
trace = "trace"
|
||||
}
|
||||
|
||||
export enum ILogOutput {
|
||||
stdout = "stdout",
|
||||
telnet = "telnet",
|
||||
web = "web",
|
||||
file = "/tmp/<component>.log",
|
||||
}
|
||||
|
||||
export enum IArgType {
|
||||
boolean = "boolean",
|
||||
list = "list",
|
||||
loglvl = "loglvl",
|
||||
range = "range",
|
||||
number = "number",
|
||||
string = "string",
|
||||
configfile = "configfile",
|
||||
simuTypes = "simuTypes",
|
||||
}
|
||||
|
||||
export enum ICommandOptions {
|
||||
update = "update", // result can be updated, triggers update button on result page when set
|
||||
help = "help" // help tooltip available on command buttons
|
||||
}
|
||||
|
||||
export interface IVariable {
|
||||
name: string;
|
||||
value: string;
|
||||
type: IArgType;
|
||||
modifiable: boolean; // set command ?
|
||||
}
|
||||
|
||||
export interface ICommand {
|
||||
name: string;
|
||||
confirm?: string;
|
||||
question?: IQuestion;
|
||||
param?: IVariable;
|
||||
options?: ICommandOptions[];
|
||||
}
|
||||
export interface ITable {
|
||||
columns: IColumn[];
|
||||
rows: string[];
|
||||
}
|
||||
export interface IQuestion {
|
||||
display: string;
|
||||
pname: string;
|
||||
type: IArgType;
|
||||
}
|
||||
export interface IResp {
|
||||
display: string[], table?: ITable
|
||||
}
|
||||
|
||||
export interface IParam {
|
||||
value: string, col: IColumn
|
||||
}
|
||||
|
||||
export interface IColumn { // should use IVariable ?
|
||||
name: string;
|
||||
type: IArgType;
|
||||
modifiable: boolean; // set command ?
|
||||
help: boolean; // is help available
|
||||
}
|
||||
export interface IRow {
|
||||
params: IParam[], rawIndex: number, cmdName: string,
|
||||
param?: IVariable // to transmit the initial command parameter, ex: the channel model index when modify a channel model
|
||||
}
|
||||
|
||||
export const route = "oaisoftmodem/";
|
||||
|
||||
@Injectable({
|
||||
providedIn : "root",
|
||||
})
|
||||
export class CommandsApi {
|
||||
constructor(private httpClient: HttpClient)
|
||||
{
|
||||
}
|
||||
|
||||
public readInfos$ = () => this.httpClient.get<IInfo[]>(environment.backend + route + "variables/");
|
||||
|
||||
public setInfo$ = (info: IInfo) => this.httpClient.post<IResp>(environment.backend + route + "variables/", info);
|
||||
|
||||
public readModules$ = () => this.httpClient.get<IModule[]>(environment.backend + route + "commands/");
|
||||
|
||||
public readVariables$ = (moduleName: string) => this.httpClient.get<IInfo[]>(environment.backend + route + moduleName + "/variables/");
|
||||
|
||||
public readCommands$ = (moduleName: string) => this.httpClient.get<ICommand[]>(environment.backend + route + moduleName + "/commands/");
|
||||
|
||||
public runCommand$ = (command: ICommand, moduleName: string) => this.httpClient.post<IResp>(environment.backend + route + moduleName + "/commands/", command);
|
||||
|
||||
public setCmdVariable$ = (variable: IInfo, moduleName: string) => this.httpClient.post<IResp>(environment.backend + route + moduleName + "/variables/", variable);
|
||||
|
||||
public setCmdParams$ = (row: IRow, moduleName: string) => this.httpClient.post<IResp>(environment.backend + route + moduleName + "/set/", row);
|
||||
}
|
||||
36
common/utils/websrv/frontend/src/app/api/help.api.ts
Normal file
36
common/utils/websrv/frontend/src/app/api/help.api.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {Injectable} from "@angular/core";
|
||||
import {Observable} from "rxjs";
|
||||
import {map} from "rxjs/operators";
|
||||
import {environment} from "src/environments/environment";
|
||||
|
||||
export interface HelpRequest {
|
||||
module: string;
|
||||
command: string;
|
||||
object: string;
|
||||
}
|
||||
|
||||
export interface HelpResp {
|
||||
text: string;
|
||||
}
|
||||
const hlproute = "oaisoftmodem/helpfiles/";
|
||||
|
||||
@Injectable({
|
||||
providedIn : "root",
|
||||
})
|
||||
|
||||
export class HelpApi {
|
||||
constructor(private httpClient: HttpClient)
|
||||
{
|
||||
}
|
||||
|
||||
public getHelp$ = (req: HelpRequest) => this.httpClient.get<HelpResp>(environment.backend + hlproute + req.module + "_" + req.command + "_" + req.object + ".html", {observe : "response"});
|
||||
|
||||
public getHelpText(module: string, command: string, object: string): Observable<string>
|
||||
{
|
||||
return this.getHelp$({module : module, command : command.replace(" ", "_"), object : object.replace(" ", "_")})
|
||||
.pipe(map(
|
||||
(response => { return (response.status == 201) ? response.body!.text : ""; }),
|
||||
)); // pipe
|
||||
}
|
||||
}
|
||||
49
common/utils/websrv/frontend/src/app/api/scope.api.ts
Normal file
49
common/utils/websrv/frontend/src/app/api/scope.api.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {Injectable} from "@angular/core";
|
||||
import {environment} from "src/environments/environment";
|
||||
|
||||
export enum IScopeGraphType {
|
||||
IQs = "IQs",
|
||||
LLR = "LLR",
|
||||
WF = "WF",
|
||||
TRESP = "TRESP",
|
||||
UNSUP = "UNSUP"
|
||||
}
|
||||
|
||||
export interface IGraphDesc {
|
||||
title: string;
|
||||
type: IScopeGraphType;
|
||||
id: number;
|
||||
srvidx: number;
|
||||
}
|
||||
|
||||
export interface IScopeDesc {
|
||||
title: string;
|
||||
graphs: IGraphDesc[];
|
||||
}
|
||||
|
||||
export interface IScopeCmd {
|
||||
name: string;
|
||||
graphid?: number; // the graph srvidx
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface ISigDesc {
|
||||
target_id: number;
|
||||
antenna_id: number;
|
||||
}
|
||||
|
||||
const route = "oaisoftmodem/scopectrl/";
|
||||
|
||||
@Injectable({
|
||||
providedIn : "root",
|
||||
})
|
||||
export class ScopeApi {
|
||||
constructor(private httpClient: HttpClient)
|
||||
{
|
||||
}
|
||||
|
||||
public getScopeInfos$ = () => this.httpClient.get<IScopeDesc>(environment.backend + route);
|
||||
|
||||
public setScopeParams$ = (cmd: IScopeCmd) => this.httpClient.post(environment.backend + route, cmd, {observe : "response"});
|
||||
}
|
||||
18
common/utils/websrv/frontend/src/app/app-routing.module.ts
Normal file
18
common/utils/websrv/frontend/src/app/app-routing.module.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import {NgModule} from "@angular/core";
|
||||
import {RouterModule, Routes} from "@angular/router";
|
||||
|
||||
import {AppComponent} from "./app.component";
|
||||
import {CommandsComponent} from "./components/commands/commands.component";
|
||||
|
||||
const routes: Routes = [
|
||||
{path : "", redirectTo : "/websrv", pathMatch : "full"},
|
||||
{path : "websrv", component : AppComponent},
|
||||
{path : "**", redirectTo : ""},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports : [ RouterModule.forRoot(routes, {relativeLinkResolution : "legacy"}) ],
|
||||
exports : [ RouterModule ],
|
||||
})
|
||||
export class AppRoutingModule {
|
||||
}
|
||||
11
common/utils/websrv/frontend/src/app/app.component.css
Normal file
11
common/utils/websrv/frontend/src/app/app.component.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.mat-tab-group {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.mat-ink-bar{
|
||||
height: 8px !important;
|
||||
}
|
||||
.mat-tab-label-active
|
||||
{
|
||||
color: #000000 !important;
|
||||
}
|
||||
|
||||
8
common/utils/websrv/frontend/src/app/app.component.html
Normal file
8
common/utils/websrv/frontend/src/app/app.component.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<mat-tab-group backgroundColor="primary" color="accent">
|
||||
<mat-tab label="Commands">
|
||||
<app-commands></app-commands>
|
||||
</mat-tab>
|
||||
<mat-tab label={{scopelabel}} disabled={{!isscopeavailable}}>
|
||||
<app-scope (ScopeEnabled)="onScopeEnabled($event)"></app-scope>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
24
common/utils/websrv/frontend/src/app/app.component.ts
Normal file
24
common/utils/websrv/frontend/src/app/app.component.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import {Component} from "@angular/core";
|
||||
import {MatTabsModule} from "@angular/material/tabs";
|
||||
|
||||
@Component({
|
||||
selector : "app-root",
|
||||
templateUrl : "./app.component.html",
|
||||
styleUrls : [ "./app.component.css" ],
|
||||
})
|
||||
export class AppComponent {
|
||||
title = "oai softmodem";
|
||||
isscopeavailable = false;
|
||||
scopelabel = "";
|
||||
constructor()
|
||||
{
|
||||
this.scopelabel = "";
|
||||
this.isscopeavailable = false;
|
||||
}
|
||||
|
||||
onScopeEnabled(enabled: boolean)
|
||||
{
|
||||
this.isscopeavailable = enabled;
|
||||
this.scopelabel = enabled ? "Scope" : "";
|
||||
}
|
||||
}
|
||||
59
common/utils/websrv/frontend/src/app/app.module.ts
Normal file
59
common/utils/websrv/frontend/src/app/app.module.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import {DragDropModule} from "@angular/cdk/drag-drop";
|
||||
import {HttpClientModule} from "@angular/common/http";
|
||||
import {NgModule} from "@angular/core";
|
||||
import {FlexLayoutModule} from "@angular/flex-layout";
|
||||
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
|
||||
import {MatButtonModule} from "@angular/material/button";
|
||||
import {MatCardModule} from "@angular/material/card";
|
||||
import {MatChipsModule} from "@angular/material/chips";
|
||||
import {MatDialogModule} from "@angular/material/dialog";
|
||||
import {MatFormFieldModule} from "@angular/material/form-field";
|
||||
import {MatGridListModule} from "@angular/material/grid-list";
|
||||
import {MatInputModule} from "@angular/material/input";
|
||||
import {MatListModule} from "@angular/material/list";
|
||||
import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
|
||||
import {MatSelectModule} from "@angular/material/select";
|
||||
import {MatSlideToggleModule} from "@angular/material/slide-toggle";
|
||||
import {MatSliderModule} from "@angular/material/slider";
|
||||
import {MatSnackBarModule} from "@angular/material/snack-bar";
|
||||
import {MatTableModule} from "@angular/material/table";
|
||||
import {MatTabsModule} from "@angular/material/tabs";
|
||||
import {MatToolbarModule} from "@angular/material/toolbar";
|
||||
import {MatTooltipModule} from "@angular/material/tooltip";
|
||||
import {BrowserModule} from "@angular/platform-browser";
|
||||
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
|
||||
import {NgChartsModule} from "ng2-charts";
|
||||
import {CommandsApi} from "./api/commands.api";
|
||||
import {ScopeApi} from "./api/scope.api";
|
||||
import {AppRoutingModule} from "./app-routing.module";
|
||||
import {AppComponent} from "./app.component";
|
||||
import {CommandsComponent} from "./components/commands/commands.component";
|
||||
import {ConfirmDialogComponent} from "./components/confirm/confirm.component";
|
||||
import {DialogComponent} from "./components/dialog/dialog.component";
|
||||
import {QuestionDialogComponent} from "./components/question/question.component";
|
||||
import {ScopeComponent} from "./components/scope/scope.component";
|
||||
import {InterceptorProviders} from "./interceptors/interceptors";
|
||||
import {LoadingService} from "./services/loading.service";
|
||||
import {WebSocketService} from "./services/websocket.service";
|
||||
|
||||
@NgModule({
|
||||
declarations : [ AppComponent, CommandsComponent, ConfirmDialogComponent, QuestionDialogComponent, DialogComponent, ScopeComponent ],
|
||||
imports : [
|
||||
BrowserModule, AppRoutingModule, FormsModule, ReactiveFormsModule, BrowserAnimationsModule, HttpClientModule, MatButtonModule, FlexLayoutModule, MatDialogModule, DragDropModule,
|
||||
MatSliderModule, MatFormFieldModule, MatInputModule, MatChipsModule, MatProgressSpinnerModule, MatToolbarModule, MatTableModule, MatListModule, MatSelectModule, MatSnackBarModule,
|
||||
MatSlideToggleModule, MatGridListModule, MatCardModule, MatTabsModule, MatTooltipModule, NgChartsModule,
|
||||
],
|
||||
providers : [
|
||||
// services
|
||||
LoadingService,
|
||||
WebSocketService,
|
||||
// api
|
||||
CommandsApi,
|
||||
ScopeApi,
|
||||
// interceptors
|
||||
InterceptorProviders,
|
||||
],
|
||||
bootstrap : [ AppComponent ]
|
||||
})
|
||||
export class AppModule {
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
<div class="grid-container" >
|
||||
<mat-grid-list cols="2" rowHeight="15vh" >
|
||||
<mat-grid-tile [colspan]="1" [rowspan]="2" >
|
||||
<mat-card class="dashboard-card">
|
||||
<mat-card-header >
|
||||
<mat-card-title>Connection info</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content class="dashboard-card-content">
|
||||
<div *ngIf="infos$ | async as infos">
|
||||
<div class="spaceddiv" *ngFor="let info of infos">
|
||||
<mat-form-field class="scrollablefield" >
|
||||
<mat-label>{{ info.nameFC.value }}</mat-label>
|
||||
<input matInput [formControl]="info.valueFC" [readonly]="!info.modifiableFC.value" />
|
||||
</mat-form-field>
|
||||
<button mat-raised-button color="primary" [disabled]="!info.modifiableFC.value"
|
||||
(click)="onInfoSubmit(info)">
|
||||
{{ info.btnTxtFC }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</mat-grid-tile>
|
||||
|
||||
<mat-grid-tile [colspan]="1" [rowspan]="2">
|
||||
<mat-card class="dashboard-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>Softmodem commands</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content class="dashboard-card-content">
|
||||
<div class="spaceddiv" *ngIf="modules$ | async as modules" fxLaypout="row">
|
||||
<mat-form-field>
|
||||
<mat-label>Module</mat-label>
|
||||
<mat-select (selectionChange)="onModuleSelect($event.value)" [(value)]="selectedModule">
|
||||
<mat-option *ngFor="let module of modules" [value]="module"> {{ module.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div *ngIf="cmds$ | async as cmds">
|
||||
<div *ngIf="cmds.length">
|
||||
<mat-chip-list>
|
||||
<mat-chip *ngFor="let cmd of cmds" (click)="onCmdSubmit(cmd)" [matTooltip]="cmd.hlp_cmd" > {{cmd.nameFC.value}}
|
||||
</mat-chip>
|
||||
</mat-chip-list>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</mat-grid-tile>
|
||||
|
||||
<mat-grid-tile *ngIf="vars$ | async as vars" [colspan]="1" [rowspan]="4">
|
||||
<mat-card *ngIf="vars.length" class="dashboard-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>{{ selectedModule!.name }} variables</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content class="dashboard-card-content">
|
||||
<div class="spaceddiv" *ngFor="let variable of vars">
|
||||
<mat-form-field class="scrollablefield">
|
||||
<mat-label>{{ variable.nameFC.value }}</mat-label>
|
||||
<input matInput [formControl]="variable.valueFC" [readonly]="!variable.modifiableFC.value" />
|
||||
</mat-form-field>
|
||||
<button mat-raised-button color="primary" [disabled]="!variable.modifiableFC.value"
|
||||
(click)="onVarsubmit(variable)">
|
||||
set
|
||||
</button>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</mat-grid-tile>
|
||||
|
||||
<mat-grid-tile *ngIf="(rows$ | async)?.length" [colspan]="1" [rowspan]="4">
|
||||
<mat-card class="dashboard-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>{{ selectedModule!.name }} {{ selectedCmd!.name }} {{ selectedCmd!.param?.value}}</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content class="dashboard-card-content">
|
||||
<div >
|
||||
<mat-table mat-table [dataSource]="rows$" multiTemplateDataRows class="mat-elevation-z8">
|
||||
|
||||
<div class="TableRowdiv" *ngFor="let col of columns; index as colIndex" matColumnDef="{{col.name}}">
|
||||
<mat-header-cell *matHeaderCellDef fxLayoutAlign="start center">
|
||||
<div [matTooltip]="hlp_cc[colIndex]">
|
||||
<h4>{{ col.name }}</h4>
|
||||
</div>
|
||||
</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<div [ngSwitch]="col.type" [formGroup]="row" fxLayoutAlign="start center">
|
||||
<mat-slide-toggle *ngSwitchCase="IArgType.boolean" [formControl]="row.paramsCtrls[colIndex].valueFC"
|
||||
[checked]="row.paramsCtrls[colIndex].valueFC.value">
|
||||
</mat-slide-toggle>
|
||||
<mat-list-item role="listitem">
|
||||
<mat-form-field *ngSwitchCase="IArgType.loglvl">
|
||||
<mat-select [formControl]="row.paramsCtrls[colIndex].valueFC"
|
||||
[(value)]="row.paramsCtrls[colIndex].valueFC.value">
|
||||
<mat-option *ngFor="let level of logLvlValues" [value]="level"> {{ level }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</mat-list-item>
|
||||
<div *ngSwitchDefault>
|
||||
<mat-form-field>
|
||||
<input matInput [formControl]="row.paramsCtrls[colIndex].valueFC" [readonly]="!col.modifiable" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</mat-cell>
|
||||
</div>
|
||||
|
||||
<div matColumnDef="button">
|
||||
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" fxLayoutAlign="center">
|
||||
<button class="TableBtn" mat-raised-button color="primary" (click)="onParamSubmit(row)" [disabled]="row.pristine"> set
|
||||
</button>
|
||||
</mat-cell>
|
||||
</div>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||
|
||||
</mat-table>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</mat-grid-tile>
|
||||
</mat-grid-list>
|
||||
</div>
|
||||
@@ -0,0 +1,80 @@
|
||||
.spaceddiv {
|
||||
height: 45px;
|
||||
width: 40vw;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 0 auto;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.TableRowdiv {
|
||||
height: 38px;
|
||||
display: flex;
|
||||
/* justify-content: space-between;*/
|
||||
margin: 2px;
|
||||
width: 95%;
|
||||
.item:nth-child(1n){
|
||||
width: 10%;
|
||||
}
|
||||
.item {
|
||||
width: 4%;
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
.TableBtn {
|
||||
height: 25px;
|
||||
width: 35p;
|
||||
display:flex;
|
||||
padding-bottom:8px;
|
||||
}
|
||||
|
||||
.TableText {
|
||||
display: flex;
|
||||
width: 8em;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.scrollablefield {
|
||||
width: 80%;
|
||||
height: 20px;
|
||||
.mat-input-element {
|
||||
overflow-x: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.mat-card {
|
||||
height: 95%;
|
||||
overflow-y: auto;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
|
||||
.status {
|
||||
color: green;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.ng-invalid .status {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.grid-container {
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.dashboard-card {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
left: 15px;
|
||||
right: 15px;
|
||||
bottom: 15px;
|
||||
}
|
||||
|
||||
.more-button {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.dashboard-card-content {
|
||||
text-align: center;
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
import {Component} from "@angular/core";
|
||||
import {ViewEncapsulation} from "@angular/core";
|
||||
import {UntypedFormArray} from "@angular/forms";
|
||||
import {BehaviorSubject, forkJoin, Observable, of, timer} from "rxjs";
|
||||
import {filter, map, switchMap, tap} from "rxjs/operators";
|
||||
import {CommandsApi, IArgType, IColumn, ICommand, ICommandOptions, IInfo, ILogLvl, IParam, IRow} from "src/app/api/commands.api";
|
||||
import {HelpApi, HelpRequest, HelpResp} from "src/app/api/help.api";
|
||||
import {CmdCtrl} from "src/app/controls/cmd.control";
|
||||
import {InfoCtrl} from "src/app/controls/info.control";
|
||||
import {ModuleCtrl} from "src/app/controls/module.control";
|
||||
import {RowCtrl} from "src/app/controls/row.control";
|
||||
import {VarCtrl} from "src/app/controls/var.control";
|
||||
import {DialogService} from "src/app/services/dialog.service";
|
||||
import {DownloadService} from "src/app/services/download.service";
|
||||
import {LoadingService} from "src/app/services/loading.service";
|
||||
|
||||
const CHANNEL_MOD_MODULE = "channelmod"
|
||||
const PREDEF_CMD = "show predef"
|
||||
|
||||
@Component({
|
||||
selector : "app-commands",
|
||||
templateUrl : "./commands.component.html",
|
||||
styleUrls : [ "./commands.component.scss" ],
|
||||
encapsulation : ViewEncapsulation.None,
|
||||
}) export class CommandsComponent {
|
||||
hlp_cc: string[] = [];
|
||||
hlp_cmd: string[] = [];
|
||||
IArgType = IArgType;
|
||||
logLvlValues = Object.values(ILogLvl);
|
||||
|
||||
// softmodem
|
||||
infos$: Observable<VarCtrl[]>;
|
||||
modules$: Observable<ModuleCtrl[]>;
|
||||
|
||||
// module
|
||||
selectedModule?: ModuleCtrl;
|
||||
vars$?: Observable<VarCtrl[]>;
|
||||
cmds$?: Observable<CmdCtrl[]>;
|
||||
|
||||
// command
|
||||
selectedCmd?: ICommand
|
||||
displayedColumns: string[] = [];
|
||||
rows$: BehaviorSubject<RowCtrl[]> = new BehaviorSubject<RowCtrl[]>([]);
|
||||
columns: IColumn[] = [];
|
||||
|
||||
constructor(
|
||||
public commandsApi: CommandsApi,
|
||||
public helpApi: HelpApi,
|
||||
public loadingService: LoadingService,
|
||||
public dialogService: DialogService,
|
||||
public downloadService: DownloadService,
|
||||
|
||||
)
|
||||
{
|
||||
this.infos$ = this.commandsApi.readInfos$().pipe(map((infos) => infos.map(info => new InfoCtrl(info))));
|
||||
|
||||
this.modules$ = this.commandsApi.readModules$().pipe(
|
||||
map(imodules => imodules.map(imodule => new ModuleCtrl(imodule))), filter(controls => controls.length > 0), tap(controls => this.onModuleSelect(controls[0])));
|
||||
}
|
||||
|
||||
// get types$() {
|
||||
// return this.modules$.pipe(
|
||||
// filter(modules => modules.map(module => module.name).includes(CHANNEL_MOD_MODULE)),
|
||||
// mergeMap(modules => this.commandsApi.readCommands$(modules[0]!.name)),
|
||||
// map(icmds => icmds.filter(cmd => cmd.name === PREDEF_CMD)),
|
||||
// filter(icmds => icmds.length > 0),
|
||||
// map(icmds => new CmdCtrl(icmds[0])),
|
||||
// mergeMap(control => this.commandsApi.runCommand$(control.api(), CHANNEL_MOD_MODULE)),
|
||||
// map(resp => resp.display.map(line => line.match('/\s*[0-9]*\s*(\S*)\n/gm')![0])),
|
||||
// tap(types => console.log(types.join(', ')))
|
||||
// );
|
||||
// }
|
||||
|
||||
onInfoSubmit(control: InfoCtrl)
|
||||
{
|
||||
let info: IInfo = control.api();
|
||||
|
||||
if (info.type === IArgType.configfile) {
|
||||
this.downloadService.getFile(info.value)
|
||||
} else {
|
||||
this.commandsApi.setInfo$(info).subscribe();
|
||||
}
|
||||
}
|
||||
|
||||
onModuleSelect(module: ModuleCtrl)
|
||||
{
|
||||
this.selectedModule = module
|
||||
this.selectedCmd = undefined
|
||||
|
||||
this.cmds$ = this.commandsApi.readCommands$(module.name).pipe(
|
||||
map(icmds => icmds.map(icmd => new CmdCtrl(icmd))),
|
||||
map(cmds => {
|
||||
module.cmdsFA = new UntypedFormArray(cmds)
|
||||
for (let i = 0; i < cmds.length; i++)
|
||||
{
|
||||
cmds[i].get_cmd_help(this.helpApi, module.name)
|
||||
}
|
||||
return module.cmdsFA.controls as CmdCtrl[]
|
||||
})
|
||||
)
|
||||
|
||||
this.vars$ = this.commandsApi.readVariables$(module.name).pipe(
|
||||
map(ivars => ivars.map(ivar => new VarCtrl(ivar))),
|
||||
map(vars => {
|
||||
module.varsFA = new UntypedFormArray(vars)
|
||||
return module.varsFA.controls as VarCtrl[]
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
onVarsubmit(control: VarCtrl)
|
||||
{
|
||||
this.commandsApi.setCmdVariable$(control.api(), this.selectedModule!.name).pipe(map(resp => this.dialogService.openVarRespDialog(resp))).subscribe();
|
||||
}
|
||||
|
||||
onCmdSubmit(control: CmdCtrl)
|
||||
{
|
||||
this.selectedCmd = control.api()
|
||||
|
||||
const obsparam$ = forkJoin([ control.confirm ? this.dialogService.openConfirmDialog(control.confirm)
|
||||
: control.question ? this.dialogService.openQuestionDialog(this.selectedModule! + " " + this.selectedModule!.name, control)
|
||||
: of(true) ]);
|
||||
|
||||
obsparam$
|
||||
.pipe(switchMap(results => {
|
||||
if (!results[0])
|
||||
return of(null);
|
||||
|
||||
return this.execCmd$(control);
|
||||
}))
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
private execCmd$(control: CmdCtrl)
|
||||
{
|
||||
let cmd = control!.api();
|
||||
if (this.selectedCmd!.param)
|
||||
this.selectedCmd!.param!.value = cmd.param!.value;
|
||||
this.commandsApi.runCommand$(cmd, this.selectedModule!.name)
|
||||
.subscribe(
|
||||
resp => {
|
||||
if (resp.display[0])
|
||||
this.dialogService.updateCmdDialog(control, resp, "cmd " + control.nameFC.value + " response:")
|
||||
// else return of(resp)
|
||||
|
||||
const controls: RowCtrl[] = [];
|
||||
this.displayedColumns = [];
|
||||
|
||||
if (resp.table) {
|
||||
this.columns = resp.table.columns;
|
||||
this.displayedColumns = this.columns.map(col => col.name);
|
||||
this.displayedColumns.push("button");
|
||||
// possibly load help..
|
||||
for (let i = 0; i < this.columns.length; i = i + 1) {
|
||||
if (this.columns[i].help) {
|
||||
this.helpApi.getHelp$({module : this.selectedModule!.name, command : control!.api().name.replace(" ", "_"), object : this.columns[i].name.replace(" ", "_")})
|
||||
.subscribe(
|
||||
response => {
|
||||
if (response.status == 201)
|
||||
this.hlp_cc[i] = response.body!.text;
|
||||
},
|
||||
err => { this.hlp_cc[i] = ""; },
|
||||
);
|
||||
} else {
|
||||
this.hlp_cc[i] = "";
|
||||
}
|
||||
}
|
||||
for (let rawIndex = 0; rawIndex < resp.table.rows.length; rawIndex++) {
|
||||
let params: IParam[] = [];
|
||||
for (let i = 0; i < this.columns.length; i = i + 1) {
|
||||
params.push({value : resp.table.rows[rawIndex][i], col : this.columns[i]})
|
||||
}
|
||||
|
||||
const irow: IRow = {params : params, rawIndex : rawIndex, cmdName : this.selectedCmd!.name}
|
||||
|
||||
controls[rawIndex] = new RowCtrl(irow)
|
||||
}
|
||||
}
|
||||
this.rows$.next(controls)
|
||||
},
|
||||
err => console.error("execCmd error: " + err),
|
||||
() => {
|
||||
console.log("execCmd completed: ");
|
||||
if (control.isResUpdatable()) {
|
||||
if (!(control.ResUpdTimerSubscriber) || control.ResUpdTimerSubscriber.closed) {
|
||||
if (!control.ResUpdTimer)
|
||||
control.ResUpdTimer = timer(1000, 1000);
|
||||
control.ResUpdTimerSubscriber = control.ResUpdTimer.subscribe(iteration => {
|
||||
console.log("Update timer fired" + iteration);
|
||||
if (control.updbtnname === "Stop update")
|
||||
this.execCmd$(control);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
) // map resp
|
||||
|
||||
return of(null);
|
||||
}
|
||||
|
||||
onParamSubmit(control: RowCtrl)
|
||||
{
|
||||
if (this.selectedCmd!.param)
|
||||
control.set_cmdparam(this.selectedCmd!.param);
|
||||
this.commandsApi.setCmdParams$(control.api(), this.selectedModule!.name).subscribe(() => this.execCmd$(new CmdCtrl(this.selectedCmd!)));
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user