Merge branch 'integration_2022_wk50' into 'develop'
integration_2022_wk50 See merge request oai/openairinterface5g!1869 !1663 UL-MIMO working with 2 layers !1705 RNTI to UE ID in PDCP, SDAP, GTPU, ... !1818 Move /targets/user to /executables !1835 Improve NR SRS configuration !1837 Add Configuration File Naming Style Guide !1852 Get data from SRB 1 when generating Msg4 !1857 Use F1AP to transfer SRB1 messages in monolithic mode !1858 fix NR_LDPC_NUM_BN_GROUPS_BG2_R15 !1862 Fix for msg3 scheduling !1814 Initial web server implementation !1847 Move 5G RFsim tests from RAN-CI-develop to RAN-Container-Parent timeout for RFsim
This commit is contained in:
@@ -103,5 +103,85 @@ SpacesInParentheses: false
|
|||||||
SpacesInSquareBrackets: false
|
SpacesInSquareBrackets: false
|
||||||
TabWidth: 2
|
TabWidth: 2
|
||||||
UseTab: Never
|
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
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|||||||
+10
-9
@@ -2166,7 +2166,7 @@ set(XFORMS_SOURCE_NR
|
|||||||
${OPENAIR1_DIR}/PHY/TOOLS/nr_phy_scope.c
|
${OPENAIR1_DIR}/PHY/TOOLS/nr_phy_scope.c
|
||||||
)
|
)
|
||||||
set(XFORMS_SOURCE_SOFTMODEM
|
set(XFORMS_SOURCE_SOFTMODEM
|
||||||
${OPENAIR_TARGETS}/RT/USER/stats.c
|
${OPENAIR_DIR}/executables/stats.c
|
||||||
)
|
)
|
||||||
set(XFORMSINTERFACE_SOURCE
|
set(XFORMSINTERFACE_SOURCE
|
||||||
${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c
|
${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c
|
||||||
@@ -2273,10 +2273,10 @@ target_link_libraries (test5Gnas LIB_5GNAS_GNB CONFIG_LIB minimal_lib )
|
|||||||
###################################################
|
###################################################
|
||||||
|
|
||||||
add_executable(lte-softmodem
|
add_executable(lte-softmodem
|
||||||
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
|
${OPENAIR_DIR}/executables/lte-enb.c
|
||||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
${OPENAIR_DIR}/executables/lte-ru.c
|
||||||
${OPENAIR_TARGETS}/RT/USER/ru_control.c
|
${OPENAIR_DIR}/executables/ru_control.c
|
||||||
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
|
${OPENAIR_DIR}/executables/lte-softmodem.c
|
||||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||||
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
|
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
|
||||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||||
@@ -2349,8 +2349,8 @@ target_link_libraries (ocp-enb
|
|||||||
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})
|
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
|
add_executable(oairu
|
||||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
${OPENAIR_DIR}/executables/lte-ru.c
|
||||||
${OPENAIR_TARGETS}/RT/USER/ru_control.c
|
${OPENAIR_DIR}/executables/ru_control.c
|
||||||
${OPENAIR_DIR}/radio/COMMON/common_lib.c
|
${OPENAIR_DIR}/radio/COMMON/common_lib.c
|
||||||
${OPENAIR_DIR}/radio/COMMON/record_player.c
|
${OPENAIR_DIR}/radio/COMMON/record_player.c
|
||||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||||
@@ -2378,8 +2378,8 @@ target_link_libraries(lte-softmodem PRIVATE
|
|||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
add_executable(lte-uesoftmodem
|
add_executable(lte-uesoftmodem
|
||||||
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
|
${OPENAIR_DIR}/executables/lte-ue.c
|
||||||
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
|
${OPENAIR_DIR}/executables/lte-uesoftmodem.c
|
||||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||||
${OPENAIR_DIR}/executables/create_tasks_ue.c
|
${OPENAIR_DIR}/executables/create_tasks_ue.c
|
||||||
${OPENAIR_DIR}/radio/COMMON/common_lib.c
|
${OPENAIR_DIR}/radio/COMMON/common_lib.c
|
||||||
@@ -2855,6 +2855,7 @@ make_driver(ue_ip ${OPENAIR2_DIR}/NETWORK_DRIVER/UE_IP ${ue_ip_src})
|
|||||||
|
|
||||||
include (common/utils/telnetsrv/telnetsrv_CMakeLists.txt)
|
include (common/utils/telnetsrv/telnetsrv_CMakeLists.txt)
|
||||||
include(${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/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(doc)
|
||||||
add_subdirectory(openair2)
|
add_subdirectory(openair2)
|
||||||
|
|||||||
@@ -33,5 +33,10 @@ spec:
|
|||||||
schedulerName: default-scheduler
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml .Values.global.nodeSelector | nindent 12 }}
|
{{- 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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
schedulerName: default-scheduler
|
||||||
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
serviceAccountName: {{ .Values.global.serviceAccountName }}
|
||||||
terminationGracePeriodSeconds: 30
|
terminationGracePeriodSeconds: 30
|
||||||
|
{{- if .Values.global.nodeSelector}}
|
||||||
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
|
version: TAG
|
||||||
# pullPolicy: IfNotPresent or Never or Always
|
# pullPolicy: IfNotPresent or Never or Always
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
nodeSelector:
|
# removing the node selector
|
||||||
worker: "telco"
|
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 "ARCHIVES_LOC = $ARCHIVES_LOC"
|
||||||
echo "BUILD_OPTIONS = $BUILD_OPTIONS"
|
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
|
then
|
||||||
echo "This VM type is no longer supported in the pipeline framework"
|
echo "This VM type is no longer supported in the pipeline framework"
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -153,11 +153,11 @@ def AnalyzeBuildLogs(buildRoot, images, globalStatus):
|
|||||||
|
|
||||||
def AnalyzeIperf(cliOptions, clientReport, serverReport):
|
def AnalyzeIperf(cliOptions, clientReport, serverReport):
|
||||||
req_bw = 1.0 # default iperf throughput, in Mbps
|
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:
|
if result is not None:
|
||||||
req_bw = float(result.group('iperf_bandwidth'))
|
req_bw = float(result.group('iperf_bandwidth'))
|
||||||
magn = result.group('magnitude')
|
magn = result.group('magnitude')
|
||||||
if magn == "K":
|
if magn == "k" or magn == "K":
|
||||||
req_bw /= 1000
|
req_bw /= 1000
|
||||||
elif magn == "G":
|
elif magn == "G":
|
||||||
req_bw *= 1000
|
req_bw *= 1000
|
||||||
@@ -180,7 +180,7 @@ def AnalyzeIperf(cliOptions, clientReport, serverReport):
|
|||||||
reportLine = clientReportLines[l+1]
|
reportLine = clientReportLines[l+1]
|
||||||
logging.debug(f'found server report: "{reportLine}"')
|
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
|
# 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
|
# and use the last line which is typically close/identical to server report
|
||||||
if reportLine is None:
|
if reportLine is None:
|
||||||
@@ -201,10 +201,10 @@ def AnalyzeIperf(cliOptions, clientReport, serverReport):
|
|||||||
duration = float(result.group('duration'))
|
duration = float(result.group('duration'))
|
||||||
bitrate = float(result.group('bitrate'))
|
bitrate = float(result.group('bitrate'))
|
||||||
magn = result.group('magnitude')
|
magn = result.group('magnitude')
|
||||||
if magn == "K":
|
if magn == "k" or magn == "K":
|
||||||
bitrate *= 1000
|
|
||||||
elif magn == "G": # we assume bitrate in Mbps, therefore it must be G now
|
|
||||||
bitrate /= 1000
|
bitrate /= 1000
|
||||||
|
elif magn == "G": # we assume bitrate in Mbps, therefore it must be G now
|
||||||
|
bitrate *= 1000
|
||||||
jitter = float(result.group('jitter'))
|
jitter = float(result.group('jitter'))
|
||||||
packetloss = float(result.group('packetloss'))
|
packetloss = float(result.group('packetloss'))
|
||||||
|
|
||||||
|
|||||||
@@ -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 parameters:
|
||||||
amf_ip_address = ( { ipv4 = "192.168.70.132";
|
amf_ip_address = ( { ipv4 = "192.168.71.132";
|
||||||
ipv6 = "192:168:30::17";
|
ipv6 = "192:168:30::17";
|
||||||
active = "yes";
|
active = "yes";
|
||||||
preference = "ipv4";
|
preference = "ipv4";
|
||||||
@@ -177,9 +177,9 @@ gNBs =
|
|||||||
NETWORK_INTERFACES :
|
NETWORK_INTERFACES :
|
||||||
{
|
{
|
||||||
GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
|
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_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
|
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ function create_vm {
|
|||||||
echo "VM_CPU = $VM_CPU"
|
echo "VM_CPU = $VM_CPU"
|
||||||
echo "VM_DISK = $VM_DISK GBytes"
|
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
|
then
|
||||||
echo "This VM type is no longer supported in the pipeline framework"
|
echo "This VM type is no longer supported in the pipeline framework"
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1095,12 +1095,12 @@ function start_rf_sim_gnb {
|
|||||||
then
|
then
|
||||||
if [ $LOC_RA_SA_TEST -eq 0 ] #no RA test => use --phy-test option
|
if [ $LOC_RA_SA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||||
then
|
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
|
elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option
|
||||||
then
|
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
|
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
|
||||||
fi
|
fi
|
||||||
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
|
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
|
||||||
@@ -1305,14 +1305,8 @@ function run_test_on_vm {
|
|||||||
return
|
return
|
||||||
elif [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf5g-sim.* )) ]]
|
elif [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf5g-sim.* )) ]]
|
||||||
then
|
then
|
||||||
GNB_VM_NAME=`echo $VM_NAME | sed -e "s#rf5g-sim#gnb-usrp#"`
|
echo "This VM test type is no longer supported in the pipeline framework"
|
||||||
GNB_VM_CMDS=${GNB_VM_NAME}_cmds.txt
|
return
|
||||||
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"
|
|
||||||
else
|
else
|
||||||
echo "VM_NAME = $VM_NAME"
|
echo "VM_NAME = $VM_NAME"
|
||||||
echo "VM_CMD_FILE = $VM_CMDS"
|
echo "VM_CMD_FILE = $VM_CMDS"
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ function wait_on_vm_build {
|
|||||||
echo "ARCHIVES_LOC = $ARCHIVES_LOC"
|
echo "ARCHIVES_LOC = $ARCHIVES_LOC"
|
||||||
echo "BUILD_OPTIONS = $BUILD_OPTIONS"
|
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
|
then
|
||||||
echo "This VM type is no longer supported in the pipeline framework"
|
echo "This VM type is no longer supported in the pipeline framework"
|
||||||
return
|
return
|
||||||
@@ -93,7 +93,7 @@ function wait_on_vm_build {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function check_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
|
then
|
||||||
echo "This VM type is no longer supported in the pipeline framework"
|
echo "This VM type is no longer supported in the pipeline framework"
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
-->
|
-->
|
||||||
<testCaseList>
|
<testCaseList>
|
||||||
<htmlTabRef>rfsim-5gnr-tdd</htmlTabRef>
|
<htmlTabRef>rfsim-5gnr-tdd</htmlTabRef>
|
||||||
<htmlTabName>Monolithic TDD gNB</htmlTabName>
|
<htmlTabName>Monolithic SA TDD gNB</htmlTabName>
|
||||||
<htmlTabIcon>wrench</htmlTabIcon>
|
<htmlTabIcon>wrench</htmlTabIcon>
|
||||||
<repeatCount>1</repeatCount>
|
<repeatCount>1</repeatCount>
|
||||||
<TestCaseRequestedList>
|
<TestCaseRequestedList>
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -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>
|
<testCaseList>
|
||||||
<htmlTabRef>rfsim-5gnr-down</htmlTabRef>
|
<htmlTabRef>rfsim-5gnr-down</htmlTabRef>
|
||||||
<htmlTabName>CleanUp Monolithic TDD gNB</htmlTabName>
|
<htmlTabName>CleanUp SA Monolithic TDD gNB</htmlTabName>
|
||||||
<htmlTabIcon>trash</htmlTabIcon>
|
<htmlTabIcon>trash</htmlTabIcon>
|
||||||
<TestCaseRequestedList>
|
<TestCaseRequestedList>
|
||||||
100002
|
100002
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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"
|
||||||
@@ -399,12 +399,16 @@
|
|||||||
<testCase id="nr_ulsim.mimo">
|
<testCase id="nr_ulsim.mimo">
|
||||||
<desc>nr_ulsim Test cases. (Test1: MCS 19 50 PRBs 2 RX_Antenna),
|
<desc>nr_ulsim Test cases. (Test1: MCS 19 50 PRBs 2 RX_Antenna),
|
||||||
(Test2: MCS 9 106 PRBs MIMO 2 layers),
|
(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>nr_ulsim</main_exec>
|
||||||
<main_exec_args>-n100 -m19 -s10 -S15 -z2
|
<main_exec_args>-n100 -m19 -s10 -S15 -z2
|
||||||
-n100 -m9 -r106 -s8 -W2 -y2 -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>
|
-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_true>PUSCH test OK</search_expr_true>
|
||||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||||
<nruns>3</nruns>
|
<nruns>3</nruns>
|
||||||
|
|||||||
@@ -56,6 +56,13 @@ CMAKE_CMD="$CMAKE"
|
|||||||
BUILD_ECLIPSE=0
|
BUILD_ECLIPSE=0
|
||||||
NR="False"
|
NR="False"
|
||||||
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope"
|
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
|
RU=0
|
||||||
CMAKE_C_FLAGS=()
|
CMAKE_C_FLAGS=()
|
||||||
CMAKE_CXX_FLAGS=()
|
CMAKE_CXX_FLAGS=()
|
||||||
@@ -644,9 +651,27 @@ function main() {
|
|||||||
if [ ! -z "$BUILD_OPTLIB" ] ; then
|
if [ ! -z "$BUILD_OPTLIB" ] ; then
|
||||||
for oklib in $BUILD_OPTLIB ; do
|
for oklib in $BUILD_OPTLIB ; do
|
||||||
compilations $BUILD_DIR $oklib
|
compilations $BUILD_DIR $oklib
|
||||||
|
if [ "$oklib" == "websrv" ] ; then
|
||||||
|
BUILD_WEBSRVFRONT=1
|
||||||
|
echo_info "Build of websrv frontend enabled"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
fi
|
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 #
|
# 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 2: print memory allocation/free performed by the config module
|
||||||
* bit 3: print command line processing messages
|
* bit 3: print command line processing messages
|
||||||
* bit 4: disable execution abort when parameters checking fails
|
* 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).
|
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
|
```bash
|
||||||
$ ./lte-uesoftmodem -O cmdlineonly:dbgl1
|
$ ./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:
|
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: 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 >
|
* ---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;
|
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);
|
sprintf (fname,"config_%s_end",cfgptr->cfgmode);
|
||||||
cfgptr->end = dlsym(lib_handle,fname);
|
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",
|
printf("[CONFIG] %s %d no function %s for config mode %s\n",
|
||||||
__FILE__, __LINE__,fname, cfgptr->cfgmode);
|
__FILE__, __LINE__,fname, cfgptr->cfgmode);
|
||||||
}
|
}
|
||||||
@@ -193,6 +209,7 @@ configmodule_interface_t *load_configmodule(int argc,
|
|||||||
uint32_t tmpflags=0;
|
uint32_t tmpflags=0;
|
||||||
int i;
|
int i;
|
||||||
int OoptIdx=-1;
|
int OoptIdx=-1;
|
||||||
|
int OWoptIdx = -1;
|
||||||
|
|
||||||
printf("CMDLINE: ");
|
printf("CMDLINE: ");
|
||||||
for (int i=0; i<argc; i++)
|
for (int i=0; i<argc; i++)
|
||||||
@@ -209,6 +226,10 @@ configmodule_interface_t *load_configmodule(int argc,
|
|||||||
OoptIdx=i;
|
OoptIdx=i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *OWopt = strstr(argv[i], "OW");
|
||||||
|
if (OWopt == argv[i] + 2) {
|
||||||
|
OWoptIdx = i;
|
||||||
|
}
|
||||||
if ( strstr(argv[i], "help_config") != NULL ) {
|
if ( strstr(argv[i], "help_config") != NULL ) {
|
||||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME);
|
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME);
|
||||||
exit(0);
|
exit(0);
|
||||||
@@ -258,6 +279,11 @@ configmodule_interface_t *load_configmodule(int argc,
|
|||||||
/* argv[0] is the exec name, always Ok */
|
/* argv[0] is the exec name, always Ok */
|
||||||
cfgptr->argv_info[0] |= CONFIG_CMDLINEOPT_PROCESSED;
|
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
|
/* when OoptIdx is >0, -O option has been detected at position OoptIdx
|
||||||
* we must memorize arv[OoptIdx is Ok */
|
* we must memorize arv[OoptIdx is Ok */
|
||||||
if (OoptIdx >= 0) {
|
if (OoptIdx >= 0) {
|
||||||
@@ -294,14 +320,18 @@ configmodule_interface_t *load_configmodule(int argc,
|
|||||||
printf("%s ",cfgptr->cfgP[i]);
|
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) {
|
if (strstr(cfgparam,CONFIG_CMDLINEONLY) == NULL) {
|
||||||
i=load_config_sharedlib(cfgptr);
|
i=load_config_sharedlib(cfgptr);
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
printf("[CONFIG] config module %s loaded\n",cfgmode);
|
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 );
|
config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME );
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr,"[CONFIG] %s %d config module \"%s\" couldn't be loaded\n", __FILE__, __LINE__,cfgmode);
|
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;
|
cfgptr->end = (configmodule_endfunc_t)nooptfunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("[CONFIG] debug flags: 0x%08x\n", cfgptr->rtflags);
|
||||||
|
|
||||||
if (modeparams != NULL) free(modeparams);
|
if (modeparams != NULL) free(modeparams);
|
||||||
|
|
||||||
if (cfgmode != NULL) free(cfgmode);
|
if (cfgmode != NULL) free(cfgmode);
|
||||||
@@ -326,10 +358,28 @@ configmodule_interface_t *load_configmodule(int argc,
|
|||||||
return cfgptr;
|
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 */
|
/* free memory allocated when reading parameters */
|
||||||
/* config module could be initialized again after this call */
|
/* config module could be initialized again after this call */
|
||||||
void end_configmodule(void) {
|
void end_configmodule(void) {
|
||||||
|
write_parsedcfg();
|
||||||
if (cfgptr != NULL) {
|
if (cfgptr != NULL) {
|
||||||
if (cfgptr->end != NULL) {
|
if (cfgptr->end != NULL) {
|
||||||
printf ("[CONFIG] calling config module end function...\n");
|
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_DEBUGPTR (1<<1) // print memory allocation/free debug messages
|
||||||
#define CONFIG_DEBUGCMDLINE (1<<2) // print command line processing 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_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_NOEXITONHELP (1<<19) // do not exit after printing help
|
||||||
#define CONFIG_HELP (1<<20) // print help message
|
#define CONFIG_HELP (1<<20) // print help message
|
||||||
#define CONFIG_ABORT (1<<21) // config failed,abort execution
|
#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_initfunc_t)(char *cfgP[],int numP);
|
||||||
typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix);
|
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_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 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{
|
typedef struct oneBlock_s{
|
||||||
void *ptrs;
|
void *ptrs;
|
||||||
int sz;
|
int sz;
|
||||||
@@ -80,11 +94,15 @@ typedef struct configmodule_interface {
|
|||||||
configmodule_initfunc_t init;
|
configmodule_initfunc_t init;
|
||||||
configmodule_getfunc_t get;
|
configmodule_getfunc_t get;
|
||||||
configmodule_getlistfunc_t getlist;
|
configmodule_getlistfunc_t getlist;
|
||||||
|
configmodule_setfunc_t set;
|
||||||
configmodule_endfunc_t end;
|
configmodule_endfunc_t end;
|
||||||
pthread_mutex_t memBlocks_mutex;
|
pthread_mutex_t memBlocks_mutex;
|
||||||
|
configmodule_endfunc_t write_parsedcfg;
|
||||||
uint32_t numptrs;
|
uint32_t numptrs;
|
||||||
uint32_t rtflags;
|
uint32_t rtflags;
|
||||||
oneBlock_t oneBlock[CONFIG_MAX_ALLOCATEDPTRS];
|
oneBlock_t oneBlock[CONFIG_MAX_ALLOCATEDPTRS];
|
||||||
|
char *tmpdir;
|
||||||
|
configmodule_status_t *status; // allocated in debug mode only
|
||||||
} configmodule_interface_t;
|
} configmodule_interface_t;
|
||||||
|
|
||||||
#ifdef CONFIG_LOADCONFIG_MAIN
|
#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 \
|
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";
|
defaults is set to the path of the main config file.\n";
|
||||||
|
|
||||||
#define CONFIG_SECTIONNAME "config"
|
#define CONFIG_HELP_TMPDIR "<Repository to create temporary file>"
|
||||||
#define CONFIGPARAM_DEBUGFLAGS_IDX 0
|
|
||||||
|
|
||||||
|
#define CONFIG_SECTIONNAME "config"
|
||||||
|
#define CONFIGP_DEBUGFLAGS "debugflags"
|
||||||
|
#define CONFIGP_TMPDIR "tmpdir"
|
||||||
|
|
||||||
static paramdef_t Config_Params[] = {
|
static paramdef_t Config_Params[] = {
|
||||||
/*-----------------------------------------------------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------------------------------------------------------*/
|
||||||
/* config parameters for config module */
|
/* config parameters for config module */
|
||||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||||
/*-----------------------------------------------------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------------------------------------------------------*/
|
||||||
{"debugflags", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0},
|
{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
|
#else
|
||||||
@@ -126,6 +147,8 @@ extern configmodule_interface_t *load_configmodule(int argc, char **argv, uint32
|
|||||||
* a new config module init
|
* a new config module init
|
||||||
*/
|
*/
|
||||||
extern void end_configmodule(void);
|
extern void end_configmodule(void);
|
||||||
|
extern void write_parsedcfg(void);
|
||||||
|
|
||||||
/* free all config module memory, to be used at end of program as
|
/* 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 */
|
* it will free parameters values even those specified with the PARAMFLAG_NOFREE flag */
|
||||||
extern void free_configmodule(void);
|
extern void free_configmodule(void);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
#define PARAMFLAG_NOFREE (1 << 3) // don't free parameter in end function
|
#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_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_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*/
|
/* 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
|
#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) {
|
if (ret >= 0) {
|
||||||
config_process_cmdline(params, numparams, prefix);
|
config_process_cmdline(params, numparams, prefix);
|
||||||
|
if (cfgif->rtflags & CONFIG_SAVERUNCFG) {
|
||||||
|
config_get_if()->set(params, numparams, prefix);
|
||||||
|
}
|
||||||
config_execcheck(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?
|
// TODO config_process_cmdline?
|
||||||
sprintf(cfgpath, "%s.[%i]", newprefix, i);
|
sprintf(cfgpath, "%s.[%i]", newprefix, i);
|
||||||
config_process_cmdline(ParamList->paramarray[i],numparams,cfgpath);
|
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);
|
config_execcheck(ParamList->paramarray[i], numparams, cfgpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <time.h>
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
|
||||||
#include "config_libconfig.h"
|
#include "config_libconfig.h"
|
||||||
#include "config_libconfig_private.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;
|
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 ) {
|
int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||||
config_setting_t *setting;
|
config_setting_t *setting;
|
||||||
@@ -354,14 +567,47 @@ int config_libconfig_init(char *cfgP[], int numP) {
|
|||||||
free(tmppath);
|
free(tmppath);
|
||||||
return -1;
|
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);
|
free(tmppath);
|
||||||
return 0;
|
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 ) {
|
void config_libconfig_end(void ) {
|
||||||
config_destroy(&(libconfig_privdata.cfg));
|
config_destroy(&(libconfig_privdata.cfg));
|
||||||
|
if (cfgptr->rtflags & CONFIG_SAVERUNCFG) {
|
||||||
|
config_destroy(&(libconfig_privdata.runtcfg));
|
||||||
|
}
|
||||||
if ( libconfig_privdata.configfile != NULL ) {
|
if ( libconfig_privdata.configfile != NULL ) {
|
||||||
free(libconfig_privdata.configfile);
|
free(libconfig_privdata.configfile);
|
||||||
libconfig_privdata.configfile=NULL;
|
libconfig_privdata.configfile=NULL;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ extern "C"
|
|||||||
typedef struct libconfig_privatedata {
|
typedef struct libconfig_privatedata {
|
||||||
char *configfile;
|
char *configfile;
|
||||||
config_t cfg;
|
config_t cfg;
|
||||||
|
config_t runtcfg;
|
||||||
} libconfig_privatedata_t;
|
} libconfig_privatedata_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
#include "RRC/LTE/defs_NB_IoT.h"
|
#include "RRC/LTE/defs_NB_IoT.h"
|
||||||
#include "RRC/LTE/rrc_defs.h"
|
#include "RRC/LTE/rrc_defs.h"
|
||||||
#include "RRC/NR/nr_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 {
|
typedef struct {
|
||||||
|
|||||||
@@ -256,8 +256,6 @@ typedef struct IttiMsgText_s {
|
|||||||
#include <openair3/MME_APP/mme_app.h>
|
#include <openair3/MME_APP/mme_app.h>
|
||||||
//#include <proto.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 *);
|
void *rrc_enb_process_itti_msg(void *);
|
||||||
#include <openair3/SCTP/sctp_eNB_task.h>
|
#include <openair3/SCTP/sctp_eNB_task.h>
|
||||||
#include <openair3/NGAP/ngap_gNB.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 int coding_setmod_cmd(char *buff, int debug, telnet_printfunc_t prnt);
|
||||||
static telnetshell_cmddef_t coding_cmdarray[] = {
|
static telnetshell_cmddef_t coding_cmdarray[] = {
|
||||||
{"mode","[sse,avx2,stdc,none]",coding_setmod_cmd},
|
{"mode", "[sse,avx2,stdc,none]", coding_setmod_cmd, {NULL}, 0, NULL},
|
||||||
{"","",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 |
|
| Fields | type |Description |
|
||||||
|:-----------|:------:|:-----------------------|
|
|:-----------|:------:|:-----------------------|
|
||||||
| `cmdname` | `char[TELNET_CMD_MAXSIZE]` | command name, as tested by the telnet server to check it should call the `cmdfunc` function |
|
| `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 elp`command is received from the telnet client |
|
| `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` sub command. |
|
| `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)
|
[oai telnet server home](telnetsrv.md)
|
||||||
|
|||||||
+220
-162
@@ -80,38 +80,40 @@ paramdef_t telnetoptions[] = {
|
|||||||
{"loopdelay", "<loop command delay (ms)>\n", 0, uptr : &(telnetparams.loopdelay), defuintval : 5000, 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},
|
{"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},
|
{"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},
|
{"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_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 }
|
{TELNETSRV_OPTNAME_SHRMOD, "<dynamic modules selection>\n", 0, strlistptr : NULL, defstrlistval : NULL, TYPE_STRINGLIST, 0}};
|
||||||
};
|
|
||||||
|
|
||||||
int get_phybsize(void) {
|
int get_phybsize(void) {
|
||||||
return telnetparams.phyprntbuff_size;
|
return telnetparams.phyprntbuff_size;
|
||||||
};
|
};
|
||||||
int add_telnetcmd(char *modulename,telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd );
|
int add_telnetcmd(char *modulename,telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd );
|
||||||
int setoutput(char *buff, int debug, telnet_printfunc_t prnt);
|
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 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);
|
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt);
|
||||||
|
|
||||||
telnetshell_vardef_t telnet_vardef[] = {
|
telnetshell_vardef_t telnet_vardef[] = {{"debug", TELNET_VARTYPE_INT32, 0, &telnetparams.telnetdbg},
|
||||||
{"debug",TELNET_VARTYPE_INT32,&telnetparams.telnetdbg},
|
{"prio", TELNET_VARTYPE_INT32, 0, &telnetparams.priority},
|
||||||
{"prio",TELNET_VARTYPE_INT32,&telnetparams.priority},
|
{"loopc", TELNET_VARTYPE_INT32, 0, &telnetparams.loopcount},
|
||||||
{"loopc",TELNET_VARTYPE_INT32,&telnetparams.loopcount},
|
{"loopd", TELNET_VARTYPE_INT32, 0, &telnetparams.loopdelay},
|
||||||
{"loopd",TELNET_VARTYPE_INT32,&telnetparams.loopdelay},
|
{"phypb", TELNET_VARTYPE_INT32, 0, &telnetparams.phyprntbuff_size},
|
||||||
{"phypb",TELNET_VARTYPE_INT32,&telnetparams.phyprntbuff_size},
|
{"hsize", TELNET_VARTYPE_INT32, 0, &telnetparams.histsize},
|
||||||
{"hsize",TELNET_VARTYPE_INT32,&telnetparams.histsize},
|
{"hfile", TELNET_VARTYPE_STRING, TELNET_CHECKVAL_RDONLY, &telnetparams.histfile},
|
||||||
{"hfile",TELNET_VARTYPE_STRING,&telnetparams.histfile},
|
{"logfile", TELNET_VARTYPE_STRING, 0, &telnetparams.logfile},
|
||||||
{"",0,NULL}
|
{"", 0, 0, NULL}};
|
||||||
};
|
|
||||||
|
|
||||||
telnetshell_cmddef_t telnet_cmdarray[] = {
|
telnetshell_cmddef_t telnet_cmdarray[] = {
|
||||||
{"redirlog","[here,file,off]",setoutput},
|
{"redirlog", "[here,file,off]", setoutput, {NULL}, TELNETSRV_CMDFLAG_TELNETONLY, NULL},
|
||||||
{"param","[prio]",setparam},
|
{"redirlog file", "", setoutput, {NULL}, TELNETSRV_CMDFLAG_WEBSRVONLY, NULL},
|
||||||
{"history","[list,reset]",history_cmd},
|
{"redirlog off", "", setoutput, {NULL}, TELNETSRV_CMDFLAG_WEBSRVONLY, NULL},
|
||||||
{"","",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, ...) {
|
void client_printf(const char *message, ...) {
|
||||||
va_list va_args;
|
va_list va_args;
|
||||||
va_start(va_args, message);
|
va_start(va_args, message);
|
||||||
@@ -127,36 +129,39 @@ void client_printf(const char *message, ...) {
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NICE_MAX 19
|
|
||||||
#define NICE_MIN -20
|
|
||||||
void set_sched(pthread_t tid, int pid, int priority) {
|
void set_sched(pthread_t tid, int pid, int priority) {
|
||||||
int rt;
|
int rt;
|
||||||
struct sched_param schedp;
|
struct sched_param schedp;
|
||||||
int policy;
|
int policy;
|
||||||
char strpolicy[10];
|
char strpolicy[10];
|
||||||
|
int niceval = 0;
|
||||||
|
|
||||||
//sched_get_priority_max(SCHED_FIFO)
|
if (priority < -100 && priority > -200) { // RR priority 1 to 99 (high) mapped to oai priority -101 to -199 (high)
|
||||||
if (priority < NICE_MIN) {
|
policy = SCHED_RR;
|
||||||
|
sprintf(strpolicy, "%s", "RR");
|
||||||
|
schedp.sched_priority = -(priority + 100);
|
||||||
|
} else if (priority < 0 && priority > -100) {
|
||||||
policy=SCHED_FIFO;
|
policy=SCHED_FIFO;
|
||||||
sprintf(strpolicy,"%s","fifo");
|
sprintf(strpolicy,"%s","fifo");
|
||||||
schedp.sched_priority= NICE_MIN - priority ;
|
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
|
||||||
if ( (schedp.sched_priority < sched_get_priority_min(SCHED_FIFO)) ||
|
policy = SCHED_OTHER;
|
||||||
(schedp.sched_priority > sched_get_priority_max(SCHED_FIFO)) ) {
|
sprintf(strpolicy, "%s", "other");
|
||||||
client_printf("Error: %i invalid prio, should be %i to %i, \n",
|
schedp.sched_priority = 0;
|
||||||
priority, NICE_MIN -sched_get_priority_min(SCHED_FIFO),
|
niceval = priority + NICE_MIN;
|
||||||
NICE_MIN - sched_get_priority_max(SCHED_FIFO) );
|
} 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;
|
||||||
} else if (priority > NICE_MAX) {
|
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;
|
policy=SCHED_IDLE;
|
||||||
sprintf(strpolicy,"%s","idle");
|
sprintf(strpolicy,"%s","idle");
|
||||||
schedp.sched_priority=0;
|
schedp.sched_priority=0;
|
||||||
} else {
|
} else {
|
||||||
policy=SCHED_OTHER;
|
client_printf("Error: %i invalid priority \n", priority);
|
||||||
sprintf(strpolicy,"%s","other");
|
return;
|
||||||
schedp.sched_priority=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( tid != 0) {
|
if( tid != 0) {
|
||||||
rt = pthread_setschedparam(tid, policy, &schedp);
|
rt = pthread_setschedparam(tid, policy, &schedp);
|
||||||
} else if(pid > 0) {
|
} else if(pid > 0) {
|
||||||
@@ -172,15 +177,14 @@ void set_sched(pthread_t tid, int pid, int priority) {
|
|||||||
} else {
|
} else {
|
||||||
client_printf("policy set to %s, priority %i\n",strpolicy,schedp.sched_priority);
|
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);
|
rt = getpriority(PRIO_PROCESS,tid);
|
||||||
|
|
||||||
if (rt != -1) {
|
if (rt != -1) {
|
||||||
rt = setpriority(PRIO_PROCESS,tid,priority);
|
rt = setpriority(PRIO_PROCESS, tid, niceval);
|
||||||
|
|
||||||
if (rt < 0) {
|
if (rt < 0) {
|
||||||
client_printf("Error %i: %s trying to set nice value of thread %u to %i\n",
|
client_printf("Error %i: %s trying to set nice value of thread %u to %i\n", errno, strerror(errno), tid, niceval);
|
||||||
errno,strerror(errno),tid,priority);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
client_printf("Error %i: %s trying to get nice value of thread %u \n",
|
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()) {
|
if ( tid > 0 && tid != pthread_self()) {
|
||||||
client_printf("setting nice value using a thread id not implemented....\n");
|
client_printf("setting nice value using a thread id not implemented....\n");
|
||||||
} else if (pid > 0) {
|
} else if (pid > 0) {
|
||||||
errno=0;
|
errno=0;
|
||||||
rt = setpriority(PRIO_PROCESS,pid,priority);
|
rt = setpriority(PRIO_PROCESS, pid, niceval);
|
||||||
|
|
||||||
if (rt != 0) {
|
if (rt != 0) {
|
||||||
client_printf("Error %i: %s calling setpriority, \n",errno,strerror(errno));
|
client_printf("Error %i: %s calling setpriority, \n",errno,strerror(errno));
|
||||||
} else {
|
} 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);
|
fd=freopen(newfname, "w", stdout);
|
||||||
|
|
||||||
if (fd == NULL) {
|
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);
|
fd=freopen(newfname, "w", stderr);
|
||||||
|
|
||||||
if (fd == NULL) {
|
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) {
|
int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||||
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
|
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
|
||||||
char *logfname;
|
char *logfname;
|
||||||
char stdout_str[64];
|
char stdout_str[64];
|
||||||
#define LOGFILE "logfile.log"
|
|
||||||
memset(cmds,0,sizeof(cmds));
|
memset(cmds,0,sizeof(cmds));
|
||||||
sscanf(buff,"%9s %32s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] );
|
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 (strncasecmp(cmds[0],"file",4) == 0) {
|
||||||
if (cmds[1][0] == 0)
|
if (cmds[1][0] == 0)
|
||||||
logfname=LOGFILE;
|
logfname = telnetparams.logfile;
|
||||||
else
|
else
|
||||||
logfname=cmds[1];
|
logfname=cmds[1];
|
||||||
|
prnt("Log output redirected to (%s)\n", logfname);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
redirstd(logfname,prnt);
|
redirstd(logfname,prnt);
|
||||||
}
|
}
|
||||||
@@ -281,6 +295,11 @@ int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
|
|||||||
return CMDSTATUS_FOUND;
|
return CMDSTATUS_FOUND;
|
||||||
} /* setoutput */
|
} /* setoutput */
|
||||||
|
|
||||||
|
int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int setparam(char *buff, int debug, telnet_printfunc_t prnt) {
|
int setparam(char *buff, int debug, telnet_printfunc_t prnt) {
|
||||||
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
|
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
|
||||||
memset(cmds,0,sizeof(cmds));
|
memset(cmds,0,sizeof(cmds));
|
||||||
@@ -344,8 +363,103 @@ int history_cmd(char *buff, int debug, telnet_printfunc_t prnt) {
|
|||||||
/*
|
/*
|
||||||
generic commands available for all modules loaded by the server
|
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) {
|
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;
|
int n, i;
|
||||||
char varname[TELNET_CMD_MAXSIZE];
|
char varname[TELNET_CMD_MAXSIZE];
|
||||||
char *varval = NULL;
|
char *varval = NULL;
|
||||||
@@ -355,83 +469,14 @@ int setgetvar(int moduleindex,char getorset,char *params) {
|
|||||||
for (i = 0; telnetparams.CmdParsers[moduleindex].var[i].varvalptr != NULL; i++) {
|
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 (strncasecmp(telnetparams.CmdParsers[moduleindex].var[i].varname, varname, strlen(telnetparams.CmdParsers[moduleindex].var[i].varname)) == 0) {
|
||||||
if (n > 0 && (getorset == 'g' || getorset == 'G')) {
|
if (n > 0 && (getorset == 'g' || getorset == 'G')) {
|
||||||
client_printf("%s, %s = ", telnetparams.CmdParsers[moduleindex].module,
|
client_printf("%s, %s = ", telnetparams.CmdParsers[moduleindex].module, telnetparams.CmdParsers[moduleindex].var[i].varname);
|
||||||
telnetparams.CmdParsers[moduleindex].var[i].varname );
|
char *strval = telnet_getvarvalue(telnetparams.CmdParsers[moduleindex].var, i);
|
||||||
|
client_printf("%s\n", strval);
|
||||||
switch(telnetparams.CmdParsers[moduleindex].var[i].vartype) {
|
free(strval);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (n > 1 && (getorset == 's' || getorset == 'S')) {
|
if (n > 1 && (getorset == 's' || getorset == 'S')) {
|
||||||
client_printf("%s, %s set to \n", telnetparams.CmdParsers[moduleindex].module,
|
client_printf("%s, %s set to \n", telnetparams.CmdParsers[moduleindex].module, telnetparams.CmdParsers[moduleindex].var[i].varname);
|
||||||
telnetparams.CmdParsers[moduleindex].var[i].varname);
|
telnet_setvarvalue(&(telnetparams.CmdParsers[moduleindex].var[i]), varval, client_printf);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -442,6 +487,14 @@ int setgetvar(int moduleindex,char getorset,char *params) {
|
|||||||
|
|
||||||
return CMDSTATUS_VARNOTFOUND;
|
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) {
|
char *get_time(char *buff,int bufflen) {
|
||||||
struct tm tmstruct;
|
struct tm tmstruct;
|
||||||
@@ -449,13 +502,24 @@ char *get_time(char *buff,int bufflen) {
|
|||||||
strftime (buff, bufflen, "%Y-%m-%d %H:%M:%S.000", localtime_r(&now,&tmstruct));
|
strftime (buff, bufflen, "%Y-%m-%d %H:%M:%S.000", localtime_r(&now,&tmstruct));
|
||||||
return buff;
|
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;
|
int i,j,k;
|
||||||
char modulename[TELNET_CMD_MAXSIZE];
|
char modulename[TELNET_CMD_MAXSIZE];
|
||||||
char cmd[TELNET_CMD_MAXSIZE];
|
char cmd[TELNET_CMD_MAXSIZE];
|
||||||
char *cmdb=NULL;
|
char *cmdb=NULL;
|
||||||
char *bufbck;
|
|
||||||
int rt;
|
int rt;
|
||||||
memset(modulename,0,sizeof(modulename));
|
memset(modulename,0,sizeof(modulename));
|
||||||
memset(cmd,0,sizeof(cmd));
|
memset(cmd,0,sizeof(cmd));
|
||||||
@@ -474,6 +538,8 @@ int process_command(char *buf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(j=0; telnetparams.CmdParsers[i].cmd[j].cmdfunc != NULL ; j++) {
|
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",
|
client_printf(" %s %s %s\n",
|
||||||
telnetparams.CmdParsers[i].module,telnetparams.CmdParsers[i].cmd[j].cmdname,
|
telnetparams.CmdParsers[i].module,telnetparams.CmdParsers[i].cmd[j].cmdname,
|
||||||
telnetparams.CmdParsers[i].cmd[j].helpstr);
|
telnetparams.CmdParsers[i].cmd[j].helpstr);
|
||||||
@@ -483,13 +549,11 @@ int process_command(char *buf) {
|
|||||||
return CMDSTATUS_FOUND;
|
return CMDSTATUS_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bufbck=strdup(buf);
|
|
||||||
rt=CMDSTATUS_NOTFOUND;
|
rt=CMDSTATUS_NOTFOUND;
|
||||||
j = sscanf(buf,"%19s %19s %m[^\t\n]",modulename,cmd,&cmdb);
|
j = sscanf(buf,"%19s %19s %m[^\t\n]",modulename,cmd,&cmdb);
|
||||||
|
|
||||||
if (telnetparams.telnetdbg > 0)
|
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++) {
|
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)) {
|
if ( (strncasecmp(telnetparams.CmdParsers[i].module,modulename,strlen(telnetparams.CmdParsers[i].module)) == 0)) {
|
||||||
@@ -504,14 +568,10 @@ int process_command(char *buf) {
|
|||||||
} else {
|
} else {
|
||||||
for (k=0 ; telnetparams.CmdParsers[i].cmd[k].cmdfunc != NULL ; k++) {
|
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 (strncasecmp(cmd, telnetparams.CmdParsers[i].cmd[k].cmdname,sizeof(telnetparams.CmdParsers[i].cmd[k].cmdname)) == 0) {
|
||||||
|
if (telnetparams.CmdParsers[i].cmd[k].cmdflags & TELNETSRV_CMDFLAG_WEBSRVONLY)
|
||||||
|
continue;
|
||||||
if (telnetparams.CmdParsers[i].cmd[k].qptr != NULL) {
|
if (telnetparams.CmdParsers[i].cmd[k].qptr != NULL) {
|
||||||
notifiedFIFO_elt_t *msg =newNotifiedFIFO_elt(sizeof(telnetsrv_qmsg_t),0,NULL,NULL);
|
telnet_pushcmd(&(telnetparams.CmdParsers[i].cmd[k]), (cmdb != NULL) ? strdup(cmdb) : NULL, client_printf);
|
||||||
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 {
|
} else {
|
||||||
telnetparams.CmdParsers[i].cmd[k].cmdfunc(cmdb, telnetparams.telnetdbg, client_printf);
|
telnetparams.CmdParsers[i].cmd[k].cmdfunc(cmdb, telnetparams.telnetdbg, client_printf);
|
||||||
}
|
}
|
||||||
@@ -533,7 +593,7 @@ int process_command(char *buf) {
|
|||||||
char tbuff[64];
|
char tbuff[64];
|
||||||
client_printf(CSI "1J" CSI "1;10H " STDFMT "%s %i/%i\n",
|
client_printf(CSI "1J" CSI "1;10H " STDFMT "%s %i/%i\n",
|
||||||
get_time(tbuff,sizeof(tbuff)),lc,telnetparams.loopcount );
|
get_time(tbuff,sizeof(tbuff)),lc,telnetparams.loopcount );
|
||||||
process_command(bufbck+strlen("loop")+1);
|
process_command(buf + strlen("loop") + 1, lc);
|
||||||
errno=0;
|
errno=0;
|
||||||
int rs = read(telnetparams.new_socket,dummybuff,sizeof(dummybuff));
|
int rs = read(telnetparams.new_socket,dummybuff,sizeof(dummybuff));
|
||||||
|
|
||||||
@@ -554,7 +614,6 @@ int process_command(char *buf) {
|
|||||||
} /* loop */
|
} /* loop */
|
||||||
} /* for i */
|
} /* for i */
|
||||||
free(cmdb);
|
free(cmdb);
|
||||||
free(bufbck);
|
|
||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -645,7 +704,7 @@ void run_telnetsrv(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(buf) > 2 ) {
|
if (strlen(buf) > 2 ) {
|
||||||
status=process_command(buf);
|
status = process_command(buf, 0);
|
||||||
} else
|
} else
|
||||||
status=CMDSTATUS_NOCMD;
|
status=CMDSTATUS_NOCMD;
|
||||||
|
|
||||||
@@ -847,44 +906,35 @@ int telnetsrv_autoinit(void) {
|
|||||||
*/
|
*/
|
||||||
int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd)
|
int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd)
|
||||||
{
|
{
|
||||||
|
notifiedFIFO_t *afifo = NULL;
|
||||||
|
|
||||||
if( modulename == NULL || var == NULL || cmd == NULL) {
|
if( modulename == NULL || var == NULL || cmd == NULL) {
|
||||||
fprintf(stderr,"[TELNETSRV] Telnet server, add_telnetcmd: invalid parameters\n");
|
fprintf(stderr,"[TELNETSRV] Telnet server, add_telnetcmd: invalid parameters\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i;
|
for (int i = 0; i < TELNET_MAXCMD; i++) {
|
||||||
for (i=0; i<TELNET_MAXCMD ; i++) {
|
if (telnetparams.CmdParsers[i].var == NULL) {
|
||||||
cmdparser_t *CmdParser = &telnetparams.CmdParsers[i];
|
strncpy(telnetparams.CmdParsers[i].module, modulename, sizeof(telnetparams.CmdParsers[i].module) - 1);
|
||||||
if (CmdParser->var == NULL) {
|
telnetparams.CmdParsers[i].cmd = cmd;
|
||||||
strncpy(CmdParser->module, modulename, sizeof(CmdParser->module) - 1);
|
telnetparams.CmdParsers[i].var = var;
|
||||||
CmdParser->cmd = cmd;
|
for (int j = 0; cmd[j].cmdfunc != NULL; j++) {
|
||||||
CmdParser->var = var;
|
if (cmd[j].cmdflags & TELNETSRV_CMDFLAG_PUSHINTPOOLQ) {
|
||||||
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) {
|
if (afifo == NULL) {
|
||||||
afifo = malloc(sizeof(notifiedFIFO_t));
|
afifo = malloc(sizeof(notifiedFIFO_t));
|
||||||
initNotifiedFIFO(afifo);
|
initNotifiedFIFO(afifo);
|
||||||
}
|
}
|
||||||
cmd[k].qptr = afifo;
|
cmd[j].qptr = afifo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("[TELNETSRV] Telnet server: module %i = %s added to shell\n", i, telnetparams.CmdParsers[i].module);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* function which will be called by the shared lib loader, to check shared lib version
|
/* 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)
|
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) {
|
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].fname=TELNET_ADDCMD_FNAME;
|
||||||
(*farray)[0].fptr=(int (*)(void) )add_telnetcmd;
|
(*farray)[0].fptr=(int (*)(void) )add_telnetcmd;
|
||||||
(*farray)[1].fname=TELNET_POLLCMDQ_FNAME;
|
(*farray)[1].fname=TELNET_POLLCMDQ_FNAME;
|
||||||
(*farray)[1].fptr = (int (*)(void))poll_telnetcmdq;
|
(*farray)[1].fptr = (int (*)(void))poll_telnetcmdq;
|
||||||
return ( 2);
|
(*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_VARNOTFOUND 3
|
||||||
#define CMDSTATUS_NOTFOUND 4
|
#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 */
|
/* 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 */
|
/* 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 */
|
/* to add a set of new command to the telnet server shell */
|
||||||
typedef void(*telnet_printfunc_t)(const char* format, ...);
|
typedef void(*telnet_printfunc_t)(const char* format, ...);
|
||||||
typedef int(*cmdfunc_t)(char*, int, telnet_printfunc_t prnt);
|
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);
|
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 {
|
typedef struct cmddef {
|
||||||
char cmdname[TELNET_CMD_MAXSIZE];
|
char cmdname[TELNET_CMD_MAXSIZE];
|
||||||
char helpstr[TELNET_HELPSTR_SIZE];
|
char helpstr[TELNET_HELPSTR_SIZE];
|
||||||
cmdfunc_t cmdfunc;
|
cmdfunc_t cmdfunc;
|
||||||
|
union {
|
||||||
|
webfunc_t webfunc;
|
||||||
|
webfunc_getdata_t webfunc_getdata;
|
||||||
|
};
|
||||||
unsigned int cmdflags;
|
unsigned int cmdflags;
|
||||||
void *qptr;
|
void *qptr;
|
||||||
} telnetshell_cmddef_t;
|
} telnetshell_cmddef_t;
|
||||||
@@ -78,6 +113,8 @@ typedef struct telnetsrv_qmsg {
|
|||||||
/*structure to be used when adding a module to the telnet server */
|
/*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 */
|
/* 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 */
|
/* 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_INT32 1
|
||||||
#define TELNET_VARTYPE_INT16 2
|
#define TELNET_VARTYPE_INT16 2
|
||||||
#define TELNET_VARTYPE_INT64 3
|
#define TELNET_VARTYPE_INT64 3
|
||||||
@@ -85,9 +122,16 @@ typedef struct telnetsrv_qmsg {
|
|||||||
#define TELNET_VARTYPE_DOUBLE 5
|
#define TELNET_VARTYPE_DOUBLE 5
|
||||||
#define TELNET_VARTYPE_INT8 6
|
#define TELNET_VARTYPE_INT8 6
|
||||||
#define TELNET_VARTYPE_UINT 7
|
#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 {
|
typedef struct variabledef {
|
||||||
char varname[TELNET_CMD_MAXSIZE];
|
char varname[TELNET_CMD_MAXSIZE];
|
||||||
char vartype;
|
char vartype;
|
||||||
|
char checkval;
|
||||||
void *varvalptr;
|
void *varvalptr;
|
||||||
} telnetshell_vardef_t;
|
} telnetshell_vardef_t;
|
||||||
|
|
||||||
@@ -113,6 +157,7 @@ typedef struct {
|
|||||||
int priority; // server running priority
|
int priority; // server running priority
|
||||||
char *histfile; // command history
|
char *histfile; // command history
|
||||||
int histsize; // command history length
|
int histsize; // command history length
|
||||||
|
char *logfile; // filename to use when redirecting output to file
|
||||||
int new_socket; // socket of the client connection
|
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 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
|
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 STDFMT "\x1b[0m"
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------------------*/
|
||||||
|
#define NICE_MAX 19
|
||||||
|
#define NICE_MIN -20
|
||||||
#define TELNET_ADDCMD_FNAME "add_telnetcmd"
|
#define TELNET_ADDCMD_FNAME "add_telnetcmd"
|
||||||
#define TELNET_POLLCMDQ_FNAME "poll_telnetcmdq"
|
#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 int(*add_telnetcmd_func_t)(char *, telnetshell_vardef_t *, telnetshell_cmddef_t *);
|
||||||
typedef void(*poll_telnetcmdq_func_t)(void *qid,void *arg);
|
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
|
#ifdef TELNETSERVERCODE
|
||||||
int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd);
|
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_sched(pthread_t tid, int pid,int priority);
|
||||||
void set_affinity(pthread_t tid, int pid, int coreid);
|
void set_affinity(pthread_t tid, int pid, int coreid);
|
||||||
extern int get_phybsize(void);
|
extern int get_phybsize(void);
|
||||||
#endif
|
#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
|
#endif
|
||||||
|
|||||||
@@ -32,6 +32,6 @@ endforeach()
|
|||||||
|
|
||||||
install(TARGETS telnetsrv DESTINATION bin)
|
install(TARGETS telnetsrv DESTINATION bin)
|
||||||
|
|
||||||
if (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_BUILD_DIR}/ran_build/build)
|
install(TARGETS telnetsrv DESTINATION ${OPENAIR_CMAKE}/ran_build/build)
|
||||||
endif (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/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);
|
int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt);
|
||||||
telnetshell_cmddef_t loader_cmdarray[] = {
|
telnetshell_cmddef_t loader_cmdarray[] = {
|
||||||
{"show","[params,modules]",loader_show_cmd},
|
{"show", "[params,modules]", loader_show_cmd, {(webfunc_t)loader_show_cmd}, 0, NULL},
|
||||||
{"","",NULL},
|
{"", "", NULL, {NULL}, 0, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------------------*/
|
||||||
int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt)
|
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)
|
if (debug > 0)
|
||||||
prnt( "loader_show_cmd received %s\n",buff);
|
prnt( "loader_show_cmd received %s\n",buff);
|
||||||
|
|
||||||
@@ -58,8 +61,7 @@ int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt)
|
|||||||
prnt( " Main executable build version: \"%s\"\n", loader_data.mainexec_buildversion);
|
prnt( " Main executable build version: \"%s\"\n", loader_data.mainexec_buildversion);
|
||||||
prnt( " Default shared lib path: \"%s\"\n", loader_data.shlibpath);
|
prnt( " Default shared lib path: \"%s\"\n", loader_data.shlibpath);
|
||||||
prnt( " Max number of shared lib : %i\n", loader_data.maxshlibs);
|
prnt( " Max number of shared lib : %i\n", loader_data.maxshlibs);
|
||||||
}
|
} else if (strcasestr(buff, "modules") != NULL || buff[0] == 0 || strcasestr(buff, "show") != NULL) {
|
||||||
else if (strcasestr(buff,"modules") != NULL) {
|
|
||||||
prnt("%i shared lib have been dynamicaly loaded by the oai loader\n", loader_data.numshlibs);
|
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++) {
|
for (int i = 0; i < loader_data.numshlibs; i++) {
|
||||||
prnt(" Module %i: %s\n", i, loader_data.shlibs[i].name);
|
prnt(" Module %i: %s\n", i, loader_data.shlibs[i].name);
|
||||||
@@ -67,8 +69,7 @@ int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt)
|
|||||||
prnt(" Shared library path: \"%s\"\n", loader_data.shlibs[i].thisshlib_path);
|
prnt(" Shared library path: \"%s\"\n", loader_data.shlibs[i].thisshlib_path);
|
||||||
prnt(" %i function pointers registered:\n", loader_data.shlibs[i].numfunc);
|
prnt(" %i function pointers registered:\n", loader_data.shlibs[i].numfunc);
|
||||||
for (int j = 0; j < loader_data.shlibs[i].numfunc; j++) {
|
for (int j = 0; j < loader_data.shlibs[i].numfunc; j++) {
|
||||||
prnt( " function %i %s at %p\n",j,
|
prnt(" function %i %s at %p\n", j, loader_data.shlibs[i].funcarray[j].fname, loader_data.shlibs[i].funcarray[j].fptr);
|
||||||
loader_data.shlibs[i].funcarray[j].fname, loader_data.shlibs[i].funcarray[j].fptr);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -37,14 +37,11 @@
|
|||||||
|
|
||||||
#include "common/utils/load_module_shlib.h"
|
#include "common/utils/load_module_shlib.h"
|
||||||
|
|
||||||
|
telnetshell_vardef_t loader_globalvardef[] = {{"mainversion", TELNET_VARTYPE_STRING, TELNET_CHECKVAL_RDONLY, &(loader_data.mainexec_buildversion)},
|
||||||
telnetshell_vardef_t loader_globalvardef[] = {
|
{"defpath", TELNET_VARTYPE_STRING, TELNET_CHECKVAL_RDONLY, &(loader_data.shlibpath)},
|
||||||
{"mainversion",TELNET_VARTYPE_STRING,&(loader_data.mainexec_buildversion)},
|
{"maxshlibs", TELNET_VARTYPE_INT32, TELNET_CHECKVAL_RDONLY, &(loader_data.maxshlibs)},
|
||||||
{"defpath",TELNET_VARTYPE_STRING,&(loader_data.shlibpath)},
|
{"numshlibs", TELNET_VARTYPE_INT32, TELNET_CHECKVAL_RDONLY, &(loader_data.numshlibs)},
|
||||||
{"maxshlibs",TELNET_VARTYPE_INT32,&(loader_data.maxshlibs)},
|
{"", 0, 0, NULL}};
|
||||||
{"numshlibs",TELNET_VARTYPE_INT32,&(loader_data.numshlibs)},
|
|
||||||
{"",0,NULL}
|
|
||||||
};
|
|
||||||
telnetshell_vardef_t *loader_modulesvardef;
|
telnetshell_vardef_t *loader_modulesvardef;
|
||||||
|
|
||||||
extern void add_loader_cmds(void);
|
extern void add_loader_cmds(void);
|
||||||
|
|||||||
@@ -91,9 +91,7 @@ telnetshell_cmddef_t measur_cmdarray[] = {
|
|||||||
{"","",NULL}
|
{"","",NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
telnetshell_vardef_t measur_vardef[] = {
|
telnetshell_vardef_t measur_vardef[] = {{"", 0, 0, NULL}};
|
||||||
{"",0,NULL}
|
|
||||||
};
|
|
||||||
/* function to be implemented in any telnetsrv_xxx_measurements.c sources
|
/* function to be implemented in any telnetsrv_xxx_measurements.c sources
|
||||||
to allow common measurment code to access measurments data */
|
to allow common measurment code to access measurments data */
|
||||||
extern int get_measurgroups(telnet_measurgroupdef_t **measurgroups);
|
extern int get_measurgroups(telnet_measurgroupdef_t **measurgroups);
|
||||||
|
|||||||
@@ -44,17 +44,7 @@
|
|||||||
#define TELNETVAR_PHYCC0 0
|
#define TELNETVAR_PHYCC0 0
|
||||||
#define TELNETVAR_PHYCC1 1
|
#define TELNETVAR_PHYCC1 1
|
||||||
|
|
||||||
telnetshell_vardef_t phy_vardef[] = {
|
telnetshell_vardef_t phy_vardef[] = {{"", 0, 0, NULL}};
|
||||||
//{"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}
|
|
||||||
};
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|||||||
@@ -57,84 +57,119 @@
|
|||||||
#include "openair1/PHY/phy_extern.h"
|
#include "openair1/PHY/phy_extern.h"
|
||||||
#include "telnetsrv_proccmd.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 prntline[160];
|
||||||
char *procfile_fiels;
|
char *procfile_fields;
|
||||||
char *strtokptr;
|
char *strtokptr;
|
||||||
char *lptr;
|
char *lptr;
|
||||||
int fieldcnt;
|
int fieldcnt;
|
||||||
char toksep[2];
|
char toksep[2];
|
||||||
|
|
||||||
fieldcnt = 0;
|
fieldcnt = 0;
|
||||||
procfile_fiels =strtok_r(record," ",&strtokptr);
|
procfile_fields = strtok_r(record, " ", &strtokptr);
|
||||||
lptr = prntline;
|
lptr = prntline;
|
||||||
/*http://man7.org/linux/man-pages/man5/proc.5.html gives the structure of the stat file */
|
/*http://man7.org/linux/man-pages/man5/proc.5.html gives the structure of the stat file */
|
||||||
|
int priority = 0;
|
||||||
while( procfile_fiels != NULL && fieldcnt < 42) {
|
int nice = 0;
|
||||||
|
while (procfile_fields != NULL && fieldcnt < 42) {
|
||||||
long int policy;
|
long int policy;
|
||||||
if (strlen(procfile_fiels) == 0)
|
if (strlen(procfile_fields) == 0)
|
||||||
continue;
|
continue;
|
||||||
fieldcnt++;
|
fieldcnt++;
|
||||||
sprintf(toksep, " ");
|
sprintf(toksep, " ");
|
||||||
switch (fieldcnt) {
|
switch (fieldcnt) {
|
||||||
case 1: /* id */
|
case 1: /* id */
|
||||||
lptr+=sprintf(lptr,"%9.9s ",procfile_fiels);
|
if (tdata != NULL) {
|
||||||
|
tdata->lines[tdata->numlines].val[0] = strdup(procfile_fields);
|
||||||
|
}
|
||||||
|
lptr += sprintf(lptr, "%9.9s ", procfile_fields);
|
||||||
sprintf(toksep, ")");
|
sprintf(toksep, ")");
|
||||||
break;
|
break;
|
||||||
case 2: /* name */
|
case 2: /* name */
|
||||||
lptr+=sprintf(lptr,"%20.20s ",procfile_fiels+1);
|
if (tdata != NULL) {
|
||||||
|
tdata->lines[tdata->numlines].val[1] = strdup(procfile_fields);
|
||||||
|
}
|
||||||
|
lptr += sprintf(lptr, "%20.20s ", procfile_fields + 1);
|
||||||
break;
|
break;
|
||||||
case 3: // thread state
|
case 3: // thread state
|
||||||
lptr+=sprintf(lptr," %c ",procfile_fiels[0]);
|
lptr += sprintf(lptr, " %c ", procfile_fields[0]);
|
||||||
break;
|
break;
|
||||||
case 14: // time in user mode
|
case 14: // time in user mode
|
||||||
case 15: // time in kernel mode
|
case 15: // time in kernel mode
|
||||||
lptr+=sprintf(lptr,"%9.9s ",procfile_fiels);
|
lptr += sprintf(lptr, "%9.9s ", procfile_fields);
|
||||||
break;
|
break;
|
||||||
case 18: //priority
|
case 18: // priority column index 2 in tdata, -2 to -100 (1, min to 99, highest prio)
|
||||||
case 19: //nice
|
priority = strtol(procfile_fields, NULL, 0);
|
||||||
lptr+=sprintf(lptr,"%3.3s ",procfile_fiels);
|
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;
|
break;
|
||||||
case 23: // vsize
|
case 23: // vsize
|
||||||
lptr+=sprintf(lptr,"%9.9s ",procfile_fiels);
|
lptr += sprintf(lptr, "%9.9s ", procfile_fields);
|
||||||
break;
|
break;
|
||||||
case 39: // processor
|
case 39: // processor
|
||||||
lptr+=sprintf(lptr," %2.2s ",procfile_fiels);
|
if (tdata != NULL) {
|
||||||
|
tdata->lines[tdata->numlines].val[4] = strdup(procfile_fields);
|
||||||
|
}
|
||||||
|
lptr += sprintf(lptr, " %2.2s ", procfile_fields);
|
||||||
break;
|
break;
|
||||||
case 41: // policy
|
case 41: // policy
|
||||||
lptr+=sprintf(lptr,"%3.3s ",procfile_fiels);
|
lptr += sprintf(lptr, "%3.3s ", procfile_fields);
|
||||||
policy=strtol(procfile_fiels,NULL,0);
|
policy = strtol(procfile_fields, NULL, 0);
|
||||||
|
char strschedp[64];
|
||||||
switch (policy) {
|
switch (policy) {
|
||||||
case SCHED_FIFO:
|
case SCHED_FIFO:
|
||||||
lptr+=sprintf(lptr,"%s ","rt: 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;
|
break;
|
||||||
case SCHED_OTHER:
|
case SCHED_OTHER:
|
||||||
lptr+=sprintf(lptr,"%s ","other");
|
snprintf(strschedp, sizeof(strschedp), "%s ", "other");
|
||||||
|
priority = nice - NICE_MIN; // linux nice is -20 to 19
|
||||||
break;
|
break;
|
||||||
case SCHED_IDLE:
|
case SCHED_IDLE:
|
||||||
lptr+=sprintf(lptr,"%s ","idle");
|
snprintf(strschedp, sizeof(strschedp), "%s ", "idle");
|
||||||
|
priority = 2 * (NICE_MAX - NICE_MIN + 1);
|
||||||
break;
|
break;
|
||||||
case SCHED_BATCH:
|
case SCHED_BATCH:
|
||||||
lptr+=sprintf(lptr,"%s ","batch");
|
snprintf(strschedp, sizeof(strschedp), "%s ", "batch");
|
||||||
|
priority = (NICE_MAX - NICE_MIN + 1) + nice - NICE_MIN;
|
||||||
break;
|
break;
|
||||||
case SCHED_RR:
|
case SCHED_RR:
|
||||||
lptr+=sprintf(lptr,"%s ","rt: rr");
|
snprintf(strschedp, sizeof(strschedp), "%s ", "rt:rr");
|
||||||
|
priority = priority - 99;
|
||||||
break;
|
break;
|
||||||
|
#ifdef SCHED_DEADLINE
|
||||||
|
case SCHED_DEADLINE:
|
||||||
|
snprintf(strschedp, sizeof(strschedp), "%s ", "rt:deadline");
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
lptr+=sprintf(lptr,"%s ","????");
|
snprintf(strschedp, sizeof(strschedp), "%s ", "????");
|
||||||
break;
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
} /* switch on fieldcnr */
|
} /* switch on fieldcnr */
|
||||||
procfile_fiels =strtok_r(NULL,toksep,&strtokptr);
|
procfile_fields = strtok_r(NULL, toksep, &strtokptr);
|
||||||
} /* while on proc_fields != NULL */
|
} /* while on proc_fields != NULL */
|
||||||
prnt("%s\n", prntline);
|
prnt("%s\n", prntline);
|
||||||
|
if (tdata != NULL) {
|
||||||
|
tdata->numlines++;
|
||||||
|
}
|
||||||
} /*decode_procstat */
|
} /*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;
|
FILE *procfile;
|
||||||
char arecord[1024];
|
char arecord[1024];
|
||||||
@@ -152,44 +187,207 @@ char arecord[1024];
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fclose(procfile);
|
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];
|
char aname[256];
|
||||||
|
|
||||||
DIR *proc_dir;
|
DIR *proc_dir;
|
||||||
struct dirent *entry;
|
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");
|
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());
|
snprintf(aname, sizeof(aname), "/proc/%d/stat", getpid());
|
||||||
read_statfile(aname,debug,prnt);
|
read_statfile(aname, debug, prnt, NULL);
|
||||||
prnt("\n");
|
prnt("\n");
|
||||||
snprintf(aname, sizeof(aname), "/proc/%d/task", getpid());
|
snprintf(aname, sizeof(aname), "/proc/%d/task", getpid());
|
||||||
proc_dir = opendir(aname);
|
proc_dir = opendir(aname);
|
||||||
if (proc_dir == NULL)
|
if (proc_dir == NULL) {
|
||||||
{
|
|
||||||
prnt("Error: Couldn't open %s %i %s\n", aname, errno, strerror(errno));
|
prnt("Error: Couldn't open %s %i %s\n", aname, errno, strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((entry = readdir(proc_dir)) != NULL)
|
while ((entry = readdir(proc_dir)) != NULL) {
|
||||||
{
|
if (entry->d_name[0] != '.') {
|
||||||
if(entry->d_name[0] == '.')
|
|
||||||
continue;
|
|
||||||
snprintf(aname, sizeof(aname), "/proc/%d/task/%.*s/stat", getpid(), (int)(sizeof(aname) - 24), entry->d_name);
|
snprintf(aname, sizeof(aname), "/proc/%d/task/%.*s/stat", getpid(), (int)(sizeof(aname) - 24), entry->d_name);
|
||||||
read_statfile(aname,debug,prnt);
|
read_statfile(aname, debug, prnt, tdata);
|
||||||
|
}
|
||||||
} /* while entry != NULL */
|
} /* while entry != NULL */
|
||||||
closedir(proc_dir);
|
closedir(proc_dir);
|
||||||
} /* print_threads */
|
} /* 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)
|
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)
|
if (debug > 0)
|
||||||
prnt(" proccmd_show received %s\n",buf);
|
prnt(" proccmd_show received %s\n",buf);
|
||||||
if (strcasestr(buf,"thread") != NULL) {
|
if (strcasestr(buf,"thread") != NULL) {
|
||||||
@@ -265,6 +463,10 @@ int bv1,bv2;
|
|||||||
int res;
|
int res;
|
||||||
char sv1[64];
|
char sv1[64];
|
||||||
|
|
||||||
|
if (buf == NULL) {
|
||||||
|
prnt("ERROR wrong thread command...\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
bv1=0;
|
bv1=0;
|
||||||
bv2=0;
|
bv2=0;
|
||||||
sv1[0]=0;
|
sv1[0]=0;
|
||||||
@@ -279,7 +481,7 @@ char sv1[64];
|
|||||||
prnt(" proccmd_thread: %i params = %i,%s,%i\n",res,bv1,sv1,bv2);
|
prnt(" proccmd_thread: %i params = %i,%s,%i\n",res,bv1,sv1,bv2);
|
||||||
if(res != 3)
|
if(res != 3)
|
||||||
{
|
{
|
||||||
prnt("softmodem thread needs 3 params, %i received\n",res);
|
print_threads(buf, debug, prnt);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,11 +504,20 @@ int proccmd_exit(char *buf, int debug, telnet_printfunc_t prnt)
|
|||||||
{
|
{
|
||||||
if (debug > 0)
|
if (debug > 0)
|
||||||
prnt("process module received %s\n",buf);
|
prnt("process module received %s\n",buf);
|
||||||
|
end_configmodule();
|
||||||
exit_fun("telnet server received exit command\n");
|
exit_fun("telnet server received exit command\n");
|
||||||
return 0;
|
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)
|
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);
|
SET_LOG_DUMP(optbit);
|
||||||
else
|
else
|
||||||
CLEAR_LOG_DUMP(optbit);
|
CLEAR_LOG_DUMP(optbit);
|
||||||
proccmd_show("dbgopt",debug,prnt);
|
proccmd_show("dump", debug, prnt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (logparam != NULL) free(logparam);
|
if (logparam != NULL) free(logparam);
|
||||||
@@ -431,6 +642,7 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
|
|||||||
prnt("%s%s unknown log sub command \n",logparam, tmpstr);
|
prnt("%s%s unknown log sub command \n",logparam, tmpstr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
level = map_str_to_int(log_level_names, tmpstr);
|
||||||
prnt("%s unknown log sub command \n", logsubcmd);
|
prnt("%s unknown log sub command \n", logsubcmd);
|
||||||
}
|
}
|
||||||
if (logparam != NULL) free(logparam);
|
if (logparam != NULL) free(logparam);
|
||||||
|
|||||||
@@ -44,11 +44,12 @@
|
|||||||
extern int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt);
|
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_thread(char *buf, int debug, telnet_printfunc_t prnt);
|
||||||
extern int proccmd_exit(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);
|
extern int proccmd_log(char *buf, int debug, telnet_printfunc_t prnt);
|
||||||
telnetshell_vardef_t proc_vardef[] = {
|
extern int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfunc_t prnt);
|
||||||
{"",0,NULL}
|
telnetshell_vardef_t proc_vardef[] = {{"", 0, 0, NULL}};
|
||||||
};
|
#define PROCCMD_LOG_HELP_STRING \
|
||||||
#define PROCCMD_LOG_HELP_STRING " log sub commands: \n\
|
" log sub commands: \n\
|
||||||
show: display current log configuration \n\
|
show: display current log configuration \n\
|
||||||
online, noonline: enable or disable console logs \n\
|
online, noonline: enable or disable console logs \n\
|
||||||
enable, disable id1-id2: enable or disable logs for components index id1 to id2 \n\
|
enable, disable id1-id2: enable or disable logs for components index id1 to id2 \n\
|
||||||
@@ -62,21 +63,29 @@ telnetshell_vardef_t proc_vardef[] = {
|
|||||||
dump_<mod> debug_<mod > disable or enable the debug file generation or debug code\
|
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> aff <core> : set affinity of thread <thread id> to core <core> \n\
|
||||||
<thread id> prio <prio> : set scheduling parameters for thread <thread id> \n\
|
<thread id> prio <prio> : set scheduling parameters for thread <thread id> \n\
|
||||||
if prio < -20: linux scheduling policy set to FIFO, \n\
|
-100 < prio < 0: linux scheduling policy set to FIFO, priority -prio, \n\
|
||||||
with priority = -20 - prio \n\
|
-200 < prio < -100: linux scheduling policy set to RR, priority -(prio+100), \n\
|
||||||
if prio > 19: linux scheduling policy set to OTHER, \n\
|
0 <= prio < 40: linux scheduling policy set to NORMAL, nice value prio-20 \n\
|
||||||
with priority (nice value) = prio \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"
|
use \"softmodem show thread\" to get <thread id> \n"
|
||||||
|
|
||||||
|
|
||||||
telnetshell_cmddef_t proc_cmdarray[] = {
|
telnetshell_cmddef_t proc_cmdarray[] = {
|
||||||
{"show","loglvl|thread|config", proccmd_show},
|
{"show", "loglvl|thread|config", proccmd_show, {(webfunc_t)proccmd_websrv_getdata}, TELNETSRV_CMDFLAG_TELNETONLY, NULL},
|
||||||
{"log","(enter help for details)", proccmd_log},
|
{"log", "(enter help for details)", proccmd_log, {NULL}, TELNETSRV_CMDFLAG_TELNETONLY, NULL},
|
||||||
{"thread","(enter help for details)", proccmd_thread},
|
{"show loglvl", "", proccmd_log, {(webfunc_t)proccmd_websrv_getdata}, TELNETSRV_CMDFLAG_WEBSRVONLY | TELNETSRV_CMDFLAG_GETWEBTBLDATA, NULL},
|
||||||
{"exit","", proccmd_exit},
|
{"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},
|
{"", "", NULL},
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -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)
|
||||||
@@ -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)
|
||||||
@@ -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.
|
||||||
@@ -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
|
||||||
@@ -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": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# SoftModemNgx
|
||||||
@@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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}}));
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -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}}));
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -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));
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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"});
|
||||||
|
}
|
||||||
@@ -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 {
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
.mat-tab-group {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.mat-ink-bar{
|
||||||
|
height: 8px !important;
|
||||||
|
}
|
||||||
|
.mat-tab-label-active
|
||||||
|
{
|
||||||
|
color: #000000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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>
|
||||||
@@ -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" : "";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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!)));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<h3>{{ data.title }}</h3>
|
||||||
|
<div fxLayoutGap="10px" mat-dialog-actions fxLayout="row" fxLayoutAlign="center start">
|
||||||
|
<button mat-button [mat-dialog-close]="true" cdkFocusInitial>Ok</button>
|
||||||
|
<button mat-button (click)="onNoClick()">Cancel</button>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
|
import {Component, Inject} from "@angular/core";
|
||||||
|
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
||||||
|
|
||||||
|
@Component({selector : "app-confirm", templateUrl : "./confirm.component.html", styleUrls : [ "./confirm.component.css" ]})
|
||||||
|
export class ConfirmDialogComponent {
|
||||||
|
constructor(public dialogRef: MatDialogRef<void>, @Inject(MAT_DIALOG_DATA) public data: any)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
onNoClick()
|
||||||
|
{
|
||||||
|
this.dialogRef.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
/* icon that can be used to drag a dialog */
|
||||||
|
::ng-deep.dialogdrag-handle {
|
||||||
|
top: 1px;
|
||||||
|
left: 1px;
|
||||||
|
color: #ccc;
|
||||||
|
cursor: move;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* make dialog for command response using the display field scrollable */
|
||||||
|
::ng-deep.cmdRespDialog {
|
||||||
|
resize: both;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* make only the dialog for command response using the display field movable */
|
||||||
|
/* (hide the close button and the drag icon) */
|
||||||
|
::ng-deep.varRespDialog #dialogclose {
|
||||||
|
display:none ;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep.varRespDialog #dialogdrag {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
::ng-deep.errRespDialog #dialogclose {
|
||||||
|
display:none ;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep.errRespDialog #dialogdrag {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<div id="dialogdrag" cdkDrag cdkDragRootElement=".cdk-overlay-pane">
|
||||||
|
<div class="dialogdrag-handle" cdkDragHandle>
|
||||||
|
<svg width="24px" fill="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path
|
||||||
|
d="M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z">
|
||||||
|
</path>
|
||||||
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<h3> {{ data.title }}</h3>
|
||||||
|
<pre [innerHTML]="data.body"></pre>
|
||||||
|
<mat-dialog-actions fxLayoutAlign="end">
|
||||||
|
<button id="dialogclose" mat-button mat-dialog-close>Close</button>
|
||||||
|
<button id="dialogupdate" mat-button (click)="onUpdate(data.control)"
|
||||||
|
*ngIf="data.updatable">{{data.control.updbtnname}}</button>
|
||||||
|
</mat-dialog-actions>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import {Component, ElementRef, Inject, OnInit, ViewChild} from "@angular/core";
|
||||||
|
import {MAT_DIALOG_DATA} from "@angular/material/dialog";
|
||||||
|
import {CmdCtrl} from "src/app/controls/cmd.control";
|
||||||
|
import {DialogService} from "src/app/services/dialog.service";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector : "app-dialog",
|
||||||
|
templateUrl : "./dialog.component.html",
|
||||||
|
styleUrls : [ "./dialog.component.css" ],
|
||||||
|
})
|
||||||
|
export class DialogComponent {
|
||||||
|
constructor(@Inject(MAT_DIALOG_DATA) public data: any)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
onUpdate(control: CmdCtrl)
|
||||||
|
{
|
||||||
|
if (control.updbtnname === "Stop update") {
|
||||||
|
control.stopUpdate();
|
||||||
|
} else {
|
||||||
|
control.startUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user