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
spbro
OpenXG-RAN
Commits
40c06fa8
Commit
40c06fa8
authored
Mar 13, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Custom handler in NRUE to first send deregistration before stopping
parent
a6486909
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+21
-5
No files found.
executables/nr-uesoftmodem.c
View file @
40c06fa8
...
...
@@ -22,6 +22,8 @@
#define _GNU_SOURCE
/* See feature_test_macros(7) */
#include <sched.h>
#include <stdbool.h>
#include <signal.h>
#include "T.h"
#include "assertions.h"
...
...
@@ -397,10 +399,25 @@ void *rrc_enb_process_msg(void *notUsed) {
return
NULL
;
}
static
void
trigger_deregistration
(
int
signal
)
static
bool
stop_immediately
=
false
;
static
void
trigger_stop
(
int
sig
)
{
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_RRC_UE_SIM
,
0
,
NAS_DEREGISTRATION_REQ
);
itti_send_msg_to_task
(
TASK_NAS_NRUE
,
0
,
msg
);
if
(
!
oai_exit
)
itti_wait_tasks_unblock
();
}
static
void
trigger_deregistration
(
int
sig
)
{
if
(
!
stop_immediately
)
{
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_RRC_UE_SIM
,
0
,
NAS_DEREGISTRATION_REQ
);
itti_send_msg_to_task
(
TASK_NAS_NRUE
,
0
,
msg
);
stop_immediately
=
true
;
static
const
char
m
[]
=
"Press ^C again to trigger immediate shutdown
\n
"
;
__attribute__
((
unused
))
int
unused
=
write
(
STDOUT_FILENO
,
m
,
sizeof
(
m
)
-
1
);
signal
(
SIGALRM
,
trigger_stop
);
alarm
(
5
);
}
else
{
itti_wait_tasks_unblock
();
}
}
static
void
get_channel_model_mode
()
{
...
...
@@ -559,11 +576,10 @@ int main( int argc, char **argv ) {
sleep
(
2
);
config_check_unknown_cmdlineopt
(
CONFIG_CHECKALLSECTIONS
);
signal
(
SIGUSR2
,
trigger_deregistration
);
// wait for end of program
printf
(
"Entering ITTI signals handler
\n
"
);
printf
(
"TYPE <CTRL-C> TO TERMINATE
\n
"
);
itti_wait_tasks_end
(
NULL
);
itti_wait_tasks_end
(
trigger_deregistration
);
printf
(
"Returned from ITTI signal handler
\n
"
);
oai_exit
=
1
;
printf
(
"oai_exit=%d
\n
"
,
oai_exit
);
...
...
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