Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
12099a91
Commit
12099a91
authored
Apr 23, 2022
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Table Response implementation in backend
parent
9cca19e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
common/utils/telnetsrv/telnetsrv_loader.c
common/utils/telnetsrv/telnetsrv_loader.c
+1
-1
common/utils/telnetsrv/telnetsrv_proccmd.h
common/utils/telnetsrv/telnetsrv_proccmd.h
+1
-0
common/utils/websrv/websrv.c
common/utils/websrv/websrv.c
+6
-5
No files found.
common/utils/telnetsrv/telnetsrv_loader.c
View file @
12099a91
...
...
@@ -64,7 +64,7 @@ int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt)
prnt
(
" Default shared lib path:
\"
%s
\"\n
"
,
loader_data
.
shlibpath
);
prnt
(
" Max number of shared lib : %i
\n
"
,
loader_data
.
maxshlibs
);
}
else
if
(
strcasestr
(
buff
,
"modules"
)
!=
NULL
||
buff
[
0
]
==
0
)
{
else
if
(
strcasestr
(
buff
,
"modules"
)
!=
NULL
||
buff
[
0
]
==
0
||
strcasestr
(
buff
,
"show"
)
!=
NULL
)
{
prnt
(
"%i shared lib have been dynamicaly loaded by the oai loader
\n
"
,
loader_data
.
numshlibs
);
for
(
int
i
=
0
;
i
<
loader_data
.
numshlibs
;
i
++
)
{
prnt
(
" Module %i: %s
\n
"
,
i
,
loader_data
.
shlibs
[
i
].
name
);
...
...
common/utils/telnetsrv/telnetsrv_proccmd.h
View file @
12099a91
...
...
@@ -79,6 +79,7 @@ telnetshell_cmddef_t proc_cmdarray[] = {
{
"show loglvl"
,
""
,
proccmd_log
,{(
webfunc_t
)
proccmd_websrv_getdata
},
TELNETSRV_CMDFLAG_WEBSRVONLY
|
TELNETSRV_CMDFLAG_GETWEBDATA
,
NULL
},
{
"show logopt"
,
""
,
proccmd_log
,{(
webfunc_t
)
proccmd_websrv_getdata
},
TELNETSRV_CMDFLAG_WEBSRVONLY
|
TELNETSRV_CMDFLAG_GETWEBTBLDATA
,
NULL
},
{
"show dbgopt"
,
""
,
proccmd_log
,{(
webfunc_t
)
proccmd_websrv_getdata
},
TELNETSRV_CMDFLAG_WEBSRVONLY
|
TELNETSRV_CMDFLAG_GETWEBTBLDATA
,
NULL
},
{
"show config"
,
""
,
proccmd_show
,{(
webfunc_t
)
proccmd_show
},
TELNETSRV_CMDFLAG_WEBSRVONLY
,
NULL
},
{
"thread"
,
"(enter help for details)"
,
proccmd_thread
,{(
webfunc_t
)
proccmd_websrv_getdata
},
0
,
NULL
},
{
"exit"
,
""
,
proccmd_exit
,{
NULL
},
TELNETSRV_CMDFLAG_CONFEXEC
,
NULL
},
{
""
,
""
,
NULL
},
...
...
common/utils/websrv/websrv.c
View file @
12099a91
...
...
@@ -181,12 +181,13 @@ void websrv_gettbldata_response(struct _u_response * response,webdatadef_t * wda
coltype
=
"string"
;
else
coltype
=
"number"
;
json_t
*
acol
=
json_pack
(
"{
name:s,type:s,modifiable:b}"
,
wdata
->
columns
[
i
].
coltitle
,
coltype
,
(
wdata
->
columns
[
i
].
coltype
&
TELNET_CHECKVAL_RDONLY
)
?
0
:
1
);
json_t
*
acol
=
json_pack
(
"{
s:s,s:s,s:b}"
,
"name"
,
wdata
->
columns
[
i
].
coltitle
,
"type"
,
coltype
,
"modifiable"
,
(
wdata
->
columns
[
i
].
coltype
&
TELNET_CHECKVAL_RDONLY
)
?
0
:
1
);
json_array_append_new
(
jcols
,
acol
);
}
for
(
int
i
=
0
;
i
<
wdata
->
numlines
;
i
++
)
{
json_t
*
jval
;
json_t
*
jline
=
json_array
();
for
(
int
j
=
0
;
j
<
wdata
->
numcols
;
j
++
)
{
if
(
wdata
->
columns
[
j
].
coltype
&
TELNET_CHECKVAL_BOOL
)
jval
=
json_boolean
(
wdata
->
lines
[
i
].
val
[
j
]);
...
...
@@ -196,9 +197,9 @@ void websrv_gettbldata_response(struct _u_response * response,webdatadef_t * wda
// jval=json_real((double)(wdata->lines[i].val[j]));
else
jval
=
json_integer
((
long
)(
wdata
->
lines
[
i
].
val
[
j
]));
json_array_append_new
(
j
data
,
jval
);
json_array_append_new
(
j
line
,
jval
);
}
json_array_append_new
(
jdata
,
jline
);
}
json_t
*
jbody
=
json_pack
(
"{s:o,s:o}"
,
"columns"
,
jcols
,
"rows"
,
jdata
);
websrv_jbody
(
response
,
jbody
);
...
...
@@ -448,7 +449,7 @@ int websrv_processwebfunc(struct _u_response * response, cmdparser_t * modulestr
websrv_gettbldata_response
(
response
,
&
wdata
);
}
else
{
websrv_printf_start
(
response
,
16384
);
cmd
->
cmdfunc
(
""
,
websrvparams
.
dbglvl
,
websrv_printf
);
cmd
->
cmdfunc
(
cmd
->
cmdname
,
websrvparams
.
dbglvl
,
websrv_printf
);
websrv_printf_end
(
200
);
}
return
200
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment