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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
b4bf59c5
Commit
b4bf59c5
authored
Jun 04, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add telnet module function to trigger F1 HO
parent
b5e35077
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
19 deletions
+62
-19
common/utils/telnetsrv/telnetsrv_ci.c
common/utils/telnetsrv/telnetsrv_ci.c
+62
-19
No files found.
common/utils/telnetsrv/telnetsrv_ci.c
View file @
b4bf59c5
...
@@ -71,30 +71,41 @@ int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
...
@@ -71,30 +71,41 @@ int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
return
0
;
return
0
;
}
}
rrc_gNB_ue_context_t
*
get_single_rrc_ue
(
void
)
{
rrc_gNB_ue_context_t
*
ue
=
NULL
;
rrc_gNB_ue_context_t
*
l
=
NULL
;
int
n
=
0
;
RB_FOREACH
(
l
,
rrc_nr_ue_tree_s
,
&
RC
.
nrrrc
[
0
]
->
rrc_ue_head
)
{
if
(
ue
==
NULL
)
ue
=
l
;
n
++
;
}
if
(
!
ue
)
{
printf
(
"could not find any UE in RRC
\n
"
);
}
if
(
n
>
1
)
{
printf
(
"more than one UE in RRC present
\n
"
);
ue
=
NULL
;
}
return
ue
;
}
int
get_reestab_count
(
char
*
buf
,
int
debug
,
telnet_printfunc_t
prnt
)
int
get_reestab_count
(
char
*
buf
,
int
debug
,
telnet_printfunc_t
prnt
)
{
{
if
(
!
RC
.
nrrrc
)
if
(
!
RC
.
nrrrc
)
ERROR_MSG_RET
(
"no RRC present, cannot list counts
\n
"
);
ERROR_MSG_RET
(
"no RRC present, cannot list counts
\n
"
);
rrc_gNB_ue_context_t
*
ue
=
NULL
;
rrc_gNB_ue_context_t
*
ue
=
NULL
;
int
rnti
=
-
1
;
if
(
!
buf
)
{
if
(
!
buf
)
{
rrc_gNB_ue_context_t
*
l
=
NULL
;
ue
=
get_single_rrc_ue
();
int
n
=
0
;
RB_FOREACH
(
l
,
rrc_nr_ue_tree_s
,
&
RC
.
nrrrc
[
0
]
->
rrc_ue_head
)
{
if
(
ue
==
NULL
)
ue
=
l
;
n
++
;
}
if
(
!
ue
)
if
(
!
ue
)
ERROR_MSG_RET
(
"could not find any UE in RRC
\n
"
);
ERROR_MSG_RET
(
"no single UE in RRC present
\n
"
);
if
(
n
>
1
)
ERROR_MSG_RET
(
"more than one UE in RRC present
\n
"
);
}
else
{
}
else
{
rnti
=
strtol
(
buf
,
NULL
,
16
);
ue_id_t
ue_id
=
strtol
(
buf
,
NULL
,
10
);
if
(
rnti
<
1
||
rnti
>=
0xfffe
)
ue
=
rrc_gNB_get_ue_context
(
RC
.
nrrrc
[
0
],
ue_id
);
ERROR_MSG_RET
(
"RNTI needs to be [1,0xfffe]
\n
"
);
ue
=
rrc_gNB_get_ue_context_by_rnti_any_du
(
RC
.
nrrrc
[
0
],
rnti
);
if
(
!
ue
)
if
(
!
ue
)
ERROR_MSG_RET
(
"could not find UE with
RNTI %04x
in RRC
\n
"
);
ERROR_MSG_RET
(
"could not find UE with
ue_id %d
in RRC
\n
"
);
}
}
prnt
(
"UE RNTI %04x reestab %d reconfig %d
\n
"
,
prnt
(
"UE RNTI %04x reestab %d reconfig %d
\n
"
,
...
@@ -125,11 +136,43 @@ int trigger_reestab(char *buf, int debug, telnet_printfunc_t prnt)
...
@@ -125,11 +136,43 @@ int trigger_reestab(char *buf, int debug, telnet_printfunc_t prnt)
return
0
;
return
0
;
}
}
extern
void
nr_HO_F1_trigger_telnet
(
gNB_RRC_INST
*
rrc
,
uint32_t
rrc_ue_id
);
/**
* @brief Trigger F1 handover for UE
* @param buf: RRC UE ID or NULL for the first UE in list
* @param debug: Debug flag
* @param prnt: Print function
* @return 0 on success, -1 on failure
*/
int
rrc_gNB_trigger_f1_ho
(
char
*
buf
,
int
debug
,
telnet_printfunc_t
prnt
)
{
if
(
!
RC
.
nrrrc
)
ERROR_MSG_RET
(
"no RRC present, cannot list counts
\n
"
);
rrc_gNB_ue_context_t
*
ue
=
NULL
;
if
(
!
buf
)
{
ue
=
get_single_rrc_ue
();
if
(
!
ue
)
ERROR_MSG_RET
(
"no single UE in RRC present
\n
"
);
}
else
{
ue_id_t
ue_id
=
strtol
(
buf
,
NULL
,
10
);
ue
=
rrc_gNB_get_ue_context
(
RC
.
nrrrc
[
0
],
ue_id
);
if
(
!
ue
)
ERROR_MSG_RET
(
"could not find UE with ue_id %d in RRC
\n
"
,
ue_id
);
}
gNB_RRC_UE_t
*
UE
=
&
ue
->
ue_context
;
nr_HO_F1_trigger_telnet
(
RC
.
nrrrc
[
0
],
UE
->
rrc_ue_id
);
prnt
(
"RRC F1 handover triggered for UE %u
\n
"
,
UE
->
rrc_ue_id
);
return
0
;
}
static
telnetshell_cmddef_t
cicmds
[]
=
{
static
telnetshell_cmddef_t
cicmds
[]
=
{
{
"get_single_rnti"
,
""
,
get_single_rnti
},
{
"get_single_rnti"
,
""
,
get_single_rnti
},
{
"force_reestab"
,
"[rnti(hex,opt)]"
,
trigger_reestab
},
{
"force_reestab"
,
"[rnti(hex,opt)]"
,
trigger_reestab
},
{
"get_reestab_count"
,
"[rnti(hex,opt)]"
,
get_reestab_count
},
{
"get_reestab_count"
,
"[rnti(hex,opt)]"
,
get_reestab_count
},
{
""
,
""
,
NULL
},
{
"trigger_f1_ho"
,
"[rrc_ue_id(int,opt)]"
,
rrc_gNB_trigger_f1_ho
},
{
""
,
""
,
NULL
},
};
};
static
telnetshell_vardef_t
civars
[]
=
{
static
telnetshell_vardef_t
civars
[]
=
{
...
...
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