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
e3bd8d23
Commit
e3bd8d23
authored
Apr 05, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove all Nas_Context after receiving Deregistration from UE
parent
e1765115
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
7 deletions
+52
-7
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+40
-7
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+12
-0
No files found.
src/amf-app/amf_n1.cpp
View file @
e3bd8d23
...
...
@@ -996,13 +996,15 @@ void amf_n1::registration_request_handle(
supi2ranId
[(
"imsi-"
+
nc
.
get
()
->
imsi
)]
=
ran_ue_ngap_id
;
// try to find old nas_context and release
std
::
shared_ptr
<
nas_context
>
old_nc
=
imsi2nas_context
[(
"imsi-"
+
nc
.
get
()
->
imsi
)];
std
::
shared_ptr
<
nas_context
>
old_nc
=
{};
old_nc
=
imsi_2_nas_context
(
"imsi-"
+
nc
.
get
()
->
imsi
);
// imsi2nas_context[("imsi-" + nc.get()->imsi)];
if
(
old_nc
.
get
())
{
// release
old_nc
.
reset
();
}
imsi2nas_context
[(
"imsi-"
+
nc
.
get
()
->
imsi
)]
=
nc
;
set_imsi_2_nas_context
(
"imsi-"
+
nc
.
get
()
->
imsi
,
nc
);
// imsi2nas_context[("imsi-" + nc.get()->imsi)] = nc;
Logger
::
amf_n1
().
info
(
"Associating IMSI (%s) with nas_context (%p)"
,
(
"imsi-"
+
nc
.
get
()
->
imsi
).
c_str
(),
nc
.
get
());
...
...
@@ -1381,20 +1383,19 @@ std::shared_ptr<nas_context> amf_n1::amf_ue_id_2_nas_context(
//------------------------------------------------------------------------------
void
amf_n1
::
set_amf_ue_ngap_id_2_nas_context
(
const
long
&
amf_ue_ngap_id
,
std
::
shared_ptr
<
nas_context
>
nc
)
{
std
::
shared
_lock
lock
(
m_amfueid2nas_context
);
std
::
unique
_lock
lock
(
m_amfueid2nas_context
);
amfueid2nas_context
[
amf_ue_ngap_id
]
=
nc
;
}
//------------------------------------------------------------------------------
void
amf_n1
::
remove_amf_ue_ngap_id_2_nas_context
(
const
long
&
amf_ue_ngap_id
)
{
std
::
shared
_lock
lock
(
m_amfueid2nas_context
);
std
::
unique
_lock
lock
(
m_amfueid2nas_context
);
amfueid2nas_context
[
amf_ue_ngap_id
]
=
nullptr
;
}
//------------------------------------------------------------------------------
bool
amf_n1
::
is_guti_2_nas_context
(
const
std
::
string
&
guti
)
const
{
std
::
shared_lock
lock
(
m_guti2nas_context
);
// return bool{guti2nas_context.count(guti) > 0};
if
(
guti2nas_context
.
count
(
guti
)
>
0
)
{
if
(
guti2nas_context
.
at
(
guti
).
get
()
!=
nullptr
)
{
return
true
;
...
...
@@ -1413,10 +1414,40 @@ std::shared_ptr<nas_context> amf_n1::guti_2_nas_context(
//------------------------------------------------------------------------------
void
amf_n1
::
set_guti_2_nas_context
(
const
std
::
string
&
guti
,
std
::
shared_ptr
<
nas_context
>
nc
)
{
std
::
shared
_lock
lock
(
m_guti2nas_context
);
std
::
unique
_lock
lock
(
m_guti2nas_context
);
guti2nas_context
[
guti
]
=
nc
;
}
//------------------------------------------------------------------------------
void
amf_n1
::
remove_guti_2_nas_context
(
const
std
::
string
&
guti
)
{
std
::
unique_lock
lock
(
m_guti2nas_context
);
guti2nas_context
[
guti
]
=
nullptr
;
}
//------------------------------------------------------------------------------
std
::
shared_ptr
<
nas_context
>
amf_n1
::
imsi_2_nas_context
(
const
std
::
string
&
imsi
)
const
{
std
::
shared_lock
lock
(
m_nas_context
);
if
(
imsi2nas_context
.
count
(
imsi
)
>
0
)
{
return
imsi2nas_context
.
at
(
imsi
);
}
else
{
return
nullptr
;
}
}
//------------------------------------------------------------------------------
void
amf_n1
::
set_imsi_2_nas_context
(
const
std
::
string
&
imsi
,
std
::
shared_ptr
<
nas_context
>
nc
)
{
std
::
unique_lock
lock
(
m_nas_context
);
imsi2nas_context
[
imsi
]
=
nc
;
}
//------------------------------------------------------------------------------
void
amf_n1
::
remove_imsi_2_nas_context
(
const
std
::
string
&
imsi
)
{
std
::
unique_lock
lock
(
m_nas_context
);
imsi2nas_context
[
imsi
]
=
nullptr
;
}
//------------------------------------------------------------------------------
void
amf_n1
::
itti_send_dl_nas_buffer_to_task_n2
(
bstring
&
b
,
uint32_t
ran_ue_ngap_id
,
long
amf_ue_ngap_id
)
{
...
...
@@ -2911,6 +2942,8 @@ void amf_n1::ue_initiate_de_registration_handle(
// Remove NC context
remove_amf_ue_ngap_id_2_nas_context
(
amf_ue_ngap_id
);
remove_imsi_2_nas_context
(
supi
);
remove_guti_2_nas_context
(
dereg_request
->
get_5g_guti
());
// TODO: AMF to AN: N2 UE Context Release Request
// AMF sends N2 UE Release command to NG-RAN with Cause set to Deregistration
...
...
src/amf-app/amf_n1.hpp
View file @
e3bd8d23
...
...
@@ -137,6 +137,9 @@ class amf_n1 {
void
set_guti_2_nas_context
(
const
std
::
string
&
guti
,
std
::
shared_ptr
<
nas_context
>
nc
);
// TODO:
void
remove_guti_2_nas_context
(
const
std
::
string
&
guti
);
// TODO
bool
is_amf_ue_id_2_nas_context
(
const
long
&
amf_ue_ngap_id
)
const
;
...
...
@@ -149,6 +152,15 @@ class amf_n1 {
const
long
&
amf_ue_ngap_id
,
std
::
shared_ptr
<
nas_context
>
nc
);
void
remove_amf_ue_ngap_id_2_nas_context
(
const
long
&
amf_ue_ngap_id
);
std
::
shared_ptr
<
nas_context
>
imsi_2_nas_context
(
const
std
::
string
&
imsi
)
const
;
void
set_imsi_2_nas_context
(
const
std
::
string
&
imsi
,
std
::
shared_ptr
<
nas_context
>
nc
);
// TODO:
void
remove_imsi_2_nas_context
(
const
std
::
string
&
imsi
);
// TODO
void
run_registration_procedure
(
std
::
shared_ptr
<
nas_context
>&
nc
);
...
...
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