Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
oai
openairinterface5G
Commits
6b3f26f5
Commit
6b3f26f5
authored
6 months ago
by
Guido Casati
Committed by
Robert Schmidt
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Add define to printf and fflush in telnetsrv for real-time logs
parent
4f2fa739
No related branches found
No related tags found
2 merge requests
!3106
Integration: `2024.w46`
,
!2777
NR UE trigger for re-establishment
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/utils/telnetsrv/telnetsrv.c
+13
-7
13 additions, 7 deletions
common/utils/telnetsrv/telnetsrv.c
with
13 additions
and
7 deletions
common/utils/telnetsrv/telnetsrv.c
+
13
−
7
View file @
6b3f26f5
...
...
@@ -67,6 +67,12 @@ static telnetsrv_params_t telnetparams;
#define TELNETSRV_OPTNAME_STATICMOD "staticmod"
#define TELNETSRV_OPTNAME_SHRMOD "shrmod"
#define TELNET_LOG(fmt, ...) \
do { \
printf("[TELNETSRV] " fmt __VA_OPT__(, ) __VA_ARGS__); \
fflush(stdout); \
} while (0)
// clang-format off
paramdef_t
telnetoptions
[]
=
{
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
...
...
@@ -653,10 +659,10 @@ void run_telnetsrv(void) {
using_history
();
int
plen
=
sprintf
(
prompt
,
"%s_%s> "
,
TELNET_PROMPT_PREFIX
,
get_softmodem_function
(
NULL
));
printf
(
"
\n
Initializing telnet server...
\n
"
);
TELNET_LOG
(
"
\n
Initializing telnet server...
\n
"
);
while
(
(
telnetparams
.
new_socket
=
accept
(
sock
,
&
cli_addr
,
&
cli_len
))
)
{
printf
(
"[TELNETSRV]
Telnet client connected....
\n
"
);
TELNET_LOG
(
"
Telnet client connected....
\n
"
);
read_history
(
telnetparams
.
histfile
);
stifle_history
(
telnetparams
.
histsize
);
...
...
@@ -682,12 +688,12 @@ void run_telnetsrv(void) {
}
if
(
!
readc
)
{
printf
(
"[TELNETSRV]
Telnet Client disconnected.
\n
"
);
TELNET_LOG
(
"
Telnet Client disconnected.
\n
"
);
break
;
}
if
(
telnetparams
.
telnetdbg
>
0
)
printf
(
"[TELNETSRV]
Command received: readc %i filled %i
\"
%s
\"\n
"
,
readc
,
filled
,
buf
);
TELNET_LOG
(
"
Command received: readc %i filled %i
\"
%s
\"\n
"
,
readc
,
filled
,
buf
);
if
(
buf
[
0
]
==
'!'
)
{
if
(
buf
[
1
]
==
'!'
)
{
...
...
@@ -720,7 +726,7 @@ void run_telnetsrv(void) {
send
(
telnetparams
.
new_socket
,
prompt
,
strlen
(
prompt
),
MSG_NOSIGNAL
);
}
else
{
printf
(
"[TELNETSRV]
Closing telnet connection...
\n
"
);
TELNET_LOG
(
"
Closing telnet connection...
\n
"
);
break
;
}
}
...
...
@@ -728,7 +734,7 @@ void run_telnetsrv(void) {
write_history
(
telnetparams
.
histfile
);
clear_history
();
close
(
telnetparams
.
new_socket
);
printf
(
"[TELNETSRV]
Telnet server wait
t
ing for connection...
\n
"
);
TELNET_LOG
(
"
Telnet server waiting for connection...
\n
"
);
}
close
(
sock
);
...
...
@@ -927,7 +933,7 @@ int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmdde
cmd
[
j
].
qptr
=
afifo
;
}
}
printf
(
"[TELNETSRV]
Telnet server: module %i = %s added to shell
\n
"
,
i
,
telnetparams
.
CmdParsers
[
i
].
module
);
TELNET_LOG
(
"
Telnet server: module %i = %s added to shell
\n
"
,
i
,
telnetparams
.
CmdParsers
[
i
].
module
);
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment