Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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-AMF
Commits
91453941
Commit
91453941
authored
Aug 24, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check gNB-UE association
parent
0f90231e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
2 deletions
+84
-2
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+79
-1
src/ngap/ngap_app/ngap_app.cpp
src/ngap/ngap_app/ngap_app.cpp
+5
-1
No files found.
src/amf-app/amf_n2.cpp
View file @
91453941
...
@@ -287,6 +287,11 @@ void amf_n2::handle_itti_message(itti_ng_setup_request& itti_msg) {
...
@@ -287,6 +287,11 @@ void amf_n2::handle_itti_message(itti_ng_setup_request& itti_msg) {
return
;
return
;
}
}
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
if
(
!
gc
.
get
())
{
Logger
::
amf_n2
().
error
(
"No existed gNB context with assoc_id(%d)"
,
itti_msg
.
assoc_id
);
return
;
}
if
(
gc
.
get
()
->
ng_state
==
NGAP_RESETING
||
if
(
gc
.
get
()
->
ng_state
==
NGAP_RESETING
||
gc
.
get
()
->
ng_state
==
NGAP_SHUTDOWN
)
{
gc
.
get
()
->
ng_state
==
NGAP_SHUTDOWN
)
{
Logger
::
amf_n2
().
warn
(
Logger
::
amf_n2
().
warn
(
...
@@ -429,6 +434,12 @@ void amf_n2::handle_itti_message(itti_ng_reset& itti_msg) {
...
@@ -429,6 +434,12 @@ void amf_n2::handle_itti_message(itti_ng_reset& itti_msg) {
}
}
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
if
(
!
gc
.
get
())
{
Logger
::
amf_n2
().
error
(
"No existed gNB context with assoc_id(%d)"
,
itti_msg
.
assoc_id
);
return
;
}
gc
.
get
()
->
ng_state
=
NGAP_RESETING
;
gc
.
get
()
->
ng_state
=
NGAP_RESETING
;
// TODO: (8.7.4.2.2, NG Reset initiated by the NG-RAN node @3GPP TS 38.413
// TODO: (8.7.4.2.2, NG Reset initiated by the NG-RAN node @3GPP TS 38.413
// V16.0.0) the AMF shall release all allocated resources on NG related to the
// V16.0.0) the AMF shall release all allocated resources on NG related to the
...
@@ -475,6 +486,12 @@ void amf_n2::handle_itti_message(itti_ng_shutdown& itti_msg) {
...
@@ -475,6 +486,12 @@ void amf_n2::handle_itti_message(itti_ng_shutdown& itti_msg) {
}
}
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
if
(
!
gc
.
get
())
{
Logger
::
amf_n2
().
error
(
"No existed gNB context with assoc_id(%d)"
,
itti_msg
.
assoc_id
);
return
;
}
gc
.
get
()
->
ng_state
=
NGAP_SHUTDOWN
;
gc
.
get
()
->
ng_state
=
NGAP_SHUTDOWN
;
// Release all the resources related to this interface
// Release all the resources related to this interface
...
@@ -530,6 +547,12 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) {
...
@@ -530,6 +547,12 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) {
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
gc
=
assoc_id_2_gnb_context
(
init_ue_msg
.
assoc_id
);
gc
=
assoc_id_2_gnb_context
(
init_ue_msg
.
assoc_id
);
if
(
!
gc
.
get
())
{
Logger
::
amf_n2
().
error
(
"No existed gNB context with assoc_id(%d)"
,
init_ue_msg
.
assoc_id
);
return
;
}
if
(
gc
.
get
()
->
ng_state
==
NGAP_RESETING
||
if
(
gc
.
get
()
->
ng_state
==
NGAP_RESETING
||
gc
.
get
()
->
ng_state
==
NGAP_SHUTDOWN
)
{
gc
.
get
()
->
ng_state
==
NGAP_SHUTDOWN
)
{
Logger
::
amf_n2
().
warn
(
Logger
::
amf_n2
().
warn
(
...
@@ -648,6 +671,13 @@ void amf_n2::handle_itti_message(itti_ul_nas_transport& ul_nas_transport) {
...
@@ -648,6 +671,13 @@ void amf_n2::handle_itti_message(itti_ul_nas_transport& ul_nas_transport) {
return
;
return
;
}
}
gc
=
assoc_id_2_gnb_context
(
ul_nas_transport
.
assoc_id
);
gc
=
assoc_id_2_gnb_context
(
ul_nas_transport
.
assoc_id
);
if
(
!
gc
.
get
())
{
Logger
::
amf_n2
().
error
(
"No existed gNB context with assoc_id(%d)"
,
ul_nas_transport
.
assoc_id
);
return
;
}
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
{};
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
{};
if
(
!
is_ran_ue_id_2_ue_ngap_context
(
ran_ue_ngap_id
))
{
if
(
!
is_ran_ue_id_2_ue_ngap_context
(
ran_ue_ngap_id
))
{
Logger
::
amf_n2
().
error
(
Logger
::
amf_n2
().
error
(
...
@@ -728,6 +758,12 @@ void amf_n2::handle_itti_message(itti_dl_nas_transport& dl_nas_transport) {
...
@@ -728,6 +758,12 @@ void amf_n2::handle_itti_message(itti_dl_nas_transport& dl_nas_transport) {
return
;
return
;
}
}
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
if
(
!
is_assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
))
{
Logger
::
amf_n2
().
error
(
"No existing gNG context with assoc_id (%d)"
,
unc
.
get
()
->
gnb_assoc_id
);
return
;
}
gc
=
assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
);
gc
=
assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
);
if
(
gc
.
get
()
==
nullptr
)
{
if
(
gc
.
get
()
==
nullptr
)
{
Logger
::
amf_n2
().
error
(
Logger
::
amf_n2
().
error
(
...
@@ -769,6 +805,11 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
...
@@ -769,6 +805,11 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
}
}
unc
.
get
()
->
ncc
=
1
;
unc
.
get
()
->
ncc
=
1
;
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
if
(
!
is_assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
))
{
Logger
::
amf_n2
().
error
(
"No existing gNG context with assoc_id (%d)"
,
unc
.
get
()
->
gnb_assoc_id
);
return
;
}
gc
=
assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
);
gc
=
assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
);
if
(
gc
.
get
()
==
nullptr
)
{
if
(
gc
.
get
()
==
nullptr
)
{
Logger
::
amf_n2
().
error
(
Logger
::
amf_n2
().
error
(
...
@@ -907,6 +948,11 @@ void amf_n2::handle_itti_message(
...
@@ -907,6 +948,11 @@ void amf_n2::handle_itti_message(
return
;
return
;
}
}
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
if
(
!
is_assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
))
{
Logger
::
amf_n2
().
error
(
"No existing gNG context with assoc_id (%d)"
,
unc
.
get
()
->
gnb_assoc_id
);
return
;
}
gc
=
assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
);
gc
=
assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
);
if
(
gc
.
get
()
==
nullptr
)
{
if
(
gc
.
get
()
==
nullptr
)
{
Logger
::
amf_n2
().
error
(
Logger
::
amf_n2
().
error
(
...
@@ -1001,6 +1047,11 @@ void amf_n2::handle_itti_message(
...
@@ -1001,6 +1047,11 @@ void amf_n2::handle_itti_message(
return
;
return
;
}
}
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
if
(
!
is_assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
))
{
Logger
::
amf_n2
().
error
(
"No existing gNG context with assoc_id (%d)"
,
unc
.
get
()
->
gnb_assoc_id
);
return
;
}
gc
=
assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
);
gc
=
assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
);
if
(
gc
.
get
()
==
nullptr
)
{
if
(
gc
.
get
()
==
nullptr
)
{
Logger
::
amf_n2
().
error
(
Logger
::
amf_n2
().
error
(
...
@@ -1083,6 +1134,11 @@ void amf_n2::handle_itti_message(itti_ue_context_release_command& itti_msg) {
...
@@ -1083,6 +1134,11 @@ void amf_n2::handle_itti_message(itti_ue_context_release_command& itti_msg) {
return
;
return
;
}
}
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
if
(
!
is_assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
))
{
Logger
::
amf_n2
().
error
(
"No existing gNG context with assoc_id (%d)"
,
unc
.
get
()
->
gnb_assoc_id
);
return
;
}
gc
=
assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
);
gc
=
assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
);
if
(
gc
.
get
()
==
nullptr
)
{
if
(
gc
.
get
()
==
nullptr
)
{
Logger
::
amf_n2
().
error
(
Logger
::
amf_n2
().
error
(
...
@@ -1136,6 +1192,12 @@ void amf_n2::handle_itti_message(
...
@@ -1136,6 +1192,12 @@ void amf_n2::handle_itti_message(
return
;
return
;
}
}
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
if
(
gc
.
get
()
==
nullptr
)
{
Logger
::
amf_n2
().
error
(
"Illegal gNB with assoc id (0x%x)"
,
itti_msg
.
assoc_id
);
return
;
}
unsigned
long
amf_ue_ngap_id
=
{
0
};
unsigned
long
amf_ue_ngap_id
=
{
0
};
itti_msg
.
ueRadioCap
->
getAmfUeNgapId
(
amf_ue_ngap_id
);
itti_msg
.
ueRadioCap
->
getAmfUeNgapId
(
amf_ue_ngap_id
);
uint32_t
ran_ue_ngap_id
=
{
0
};
uint32_t
ran_ue_ngap_id
=
{
0
};
...
@@ -1162,6 +1224,12 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
...
@@ -1162,6 +1224,12 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
}
}
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
if
(
gc
.
get
()
==
nullptr
)
{
Logger
::
amf_n2
().
error
(
"Illegal gNB with assoc id (0x%x)"
,
itti_msg
.
assoc_id
);
return
false
;
}
Logger
::
amf_n2
().
debug
(
Logger
::
amf_n2
().
debug
(
"Handover Required, gNB info (gNB Name %s, globalRanNodeId 0x%x)"
,
"Handover Required, gNB info (gNB Name %s, globalRanNodeId 0x%x)"
,
gc
.
get
()
->
gnb_name
.
c_str
(),
gc
.
get
()
->
globalRanNodeId
);
gc
.
get
()
->
gnb_name
.
c_str
(),
gc
.
get
()
->
globalRanNodeId
);
...
@@ -1444,6 +1512,11 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
...
@@ -1444,6 +1512,11 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
return
;
return
;
}
}
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
if
(
gc
.
get
()
==
nullptr
)
{
Logger
::
amf_n2
().
error
(
"Illegal gNB with assoc id (0x%x)"
,
itti_msg
.
assoc_id
);
return
;
}
Logger
::
amf_n2
().
debug
(
Logger
::
amf_n2
().
debug
(
"Handover Request Ack, gNB info (gNB Name %s, globalRanNodeId 0x%x)"
,
"Handover Request Ack, gNB info (gNB Name %s, globalRanNodeId 0x%x)"
,
gc
.
get
()
->
gnb_name
.
c_str
(),
gc
.
get
()
->
globalRanNodeId
);
gc
.
get
()
->
gnb_name
.
c_str
(),
gc
.
get
()
->
globalRanNodeId
);
...
@@ -1598,6 +1671,11 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) {
...
@@ -1598,6 +1671,11 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) {
return
;
return
;
}
}
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
if
(
gc
.
get
()
==
nullptr
)
{
Logger
::
amf_n2
().
error
(
"Illegal gNB with assoc id (0x%x)"
,
itti_msg
.
assoc_id
);
return
;
}
Logger
::
amf_n2
().
debug
(
Logger
::
amf_n2
().
debug
(
"Handover Notify, gNB info (gNB Name: %s, globalRanNodeId 0x%x)"
,
"Handover Notify, gNB info (gNB Name: %s, globalRanNodeId 0x%x)"
,
gc
.
get
()
->
gnb_name
.
c_str
(),
gc
.
get
()
->
globalRanNodeId
);
gc
.
get
()
->
gnb_name
.
c_str
(),
gc
.
get
()
->
globalRanNodeId
);
...
...
src/ngap/ngap_app/ngap_app.cpp
View file @
91453941
...
@@ -85,7 +85,7 @@ void ngap_app::handle_sctp_new_association(
...
@@ -85,7 +85,7 @@ void ngap_app::handle_sctp_new_association(
sctp_stream_id_t
outstreams
)
{
sctp_stream_id_t
outstreams
)
{
Logger
::
ngap
().
debug
(
Logger
::
ngap
().
debug
(
"Ready to handle new NGAP SCTP association (id: %d) request"
,
assoc_id
);
"Ready to handle new NGAP SCTP association (id: %d) request"
,
assoc_id
);
std
::
shared_ptr
<
gnb_context
>
gc
;
std
::
shared_ptr
<
gnb_context
>
gc
=
{}
;
if
(
!
is_assoc_id_2_gnb_context
(
assoc_id
))
{
if
(
!
is_assoc_id_2_gnb_context
(
assoc_id
))
{
Logger
::
ngap
().
debug
(
Logger
::
ngap
().
debug
(
"Create a new gNB context with assoc_id (%d)"
,
assoc_id
);
"Create a new gNB context with assoc_id (%d)"
,
assoc_id
);
...
@@ -93,6 +93,10 @@ void ngap_app::handle_sctp_new_association(
...
@@ -93,6 +93,10 @@ void ngap_app::handle_sctp_new_association(
set_assoc_id_2_gnb_context
(
assoc_id
,
gc
);
set_assoc_id_2_gnb_context
(
assoc_id
,
gc
);
}
else
{
}
else
{
gc
=
assoc_id_2_gnb_context
(
assoc_id
);
gc
=
assoc_id_2_gnb_context
(
assoc_id
);
if
(
gc
.
get
()
==
nullptr
)
{
Logger
::
amf_n2
().
error
(
"Illegal gNB with assoc id (0x%x)"
,
assoc_id
);
return
;
}
if
(
gc
.
get
()
->
ng_state
==
NGAP_RESETING
||
if
(
gc
.
get
()
->
ng_state
==
NGAP_RESETING
||
gc
.
get
()
->
ng_state
==
NGAP_SHUTDOWN
)
{
gc
.
get
()
->
ng_state
==
NGAP_SHUTDOWN
)
{
Logger
::
ngap
().
warn
(
Logger
::
ngap
().
warn
(
...
...
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