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
fad58ec3
Commit
fad58ec3
authored
Jan 21, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor update for handling N1 Message Notification at the target AMF
parent
c509d831
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
42 deletions
+40
-42
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+40
-42
No files found.
src/amf-app/amf_app.cpp
View file @
fad58ec3
...
...
@@ -412,7 +412,8 @@ void amf_app::handle_itti_message(
//------------------------------------------------------------------------------
void
amf_app
::
handle_itti_message
(
itti_sbi_n1_message_notification
&
itti_msg
)
{
Logger
::
amf_app
().
info
(
"Handle a N1 Message Notification from the initial AMF"
);
"Target AMF, handling a N1 Message Notification from the initial AMF"
);
// Step 1. Get UE, gNB related information
// Get NAS message (RegistrationRequest, this message included
...
...
@@ -423,34 +424,14 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) {
// get RegistrationContextContainer including gNB info
// UE context information, N1 message from UE, AN address
oai
::
amf
::
model
::
RegistrationContextContainer
registration_context
=
itti_msg
.
notification_msg
.
getRegistrationCtxtContainer
();
// UE Context
oai
::
amf
::
model
::
UeContext
ue_ctx
=
registration_context
.
getUeContext
();
std
::
string
supi
=
{};
std
::
shared_ptr
<
ue_context
>
uc
=
{};
if
(
ue_ctx
.
supiIsSet
())
{
supi
=
ue_ctx
.
getSupi
();
if
(
!
is_supi_2_ue_context
(
supi
))
{
// Create a new UE Context
Logger
::
amf_app
().
debug
(
"No existing UE Context, Create a new one with SUPI %s"
,
supi
.
c_str
());
uc
=
std
::
shared_ptr
<
ue_context
>
(
new
ue_context
());
uc
->
amf_ue_ngap_id
=
-
1
;
uc
->
supi
=
supi
;
set_supi_2_ue_context
(
supi
,
uc
);
}
else
{
// Update UE Context
uc
=
supi_2_ue_context
(
supi
);
}
}
// Step 2. Create gNB context if necessary
// TODO:
5gMmCapability
//
TODO: MmContext
// TODO: PduSessionContext
// TODO:
How to get SCTP-related information and establish a new SCTP
//
connection between the Target AMF and gNB?
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
// GlobalRAN Node ID (~in NGSetupRequest)
oai
::
amf
::
model
::
GlobalRanNodeId
ran_node_id
=
...
...
@@ -458,20 +439,6 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) {
// RAN UE NGAP ID
uint32_t
ran_ue_ngap_id
=
registration_context
.
getAnN2ApId
();
// UserLocation getUserLocation()
// std::string getAnN2IPv4Addr()
// AllowedNssai getAllowedNssai()
// std::vector<ConfiguredSnssai>& getConfiguredNssai();
// rejectedNssaiInPlmn
// rejectedNssaiInTa
// std::string getInitialAmfName()
// Step 2. Create gNB context if necessary
// How to create gNB context without SCTP association?
// TODO: How to establish SCTP connection between the Target AMF and gNB?
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
if
(
ran_node_id
.
gNbIdIsSet
())
{
oai
::
amf
::
model
::
GNbId
gnb_id_model
=
ran_node_id
.
getGNbId
();
uint32_t
gnb_id
=
{};
...
...
@@ -480,7 +447,7 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) {
gnb_id
=
std
::
stoul
(
gnb_id_model
.
getGNBValue
(),
nullptr
,
10
);
}
catch
(
const
std
::
exception
&
e
)
{
Logger
::
amf_app
().
warn
(
"Error when converting from string to
in
t for gNB Value: %s"
,
"Error when converting from string to
uint32_
t for gNB Value: %s"
,
e
.
what
());
return
;
}
...
...
@@ -492,7 +459,39 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) {
amf_n2_inst
->
set_gnb_id_2_gnb_context
(
gnb_id
,
gc
);
}
// UserLocation getUserLocation()
// std::string getAnN2IPv4Addr()
// AllowedNssai getAllowedNssai()
// std::vector<ConfiguredSnssai>& getConfiguredNssai();
// rejectedNssaiInPlmn
// rejectedNssaiInTa
// std::string getInitialAmfName()
// Step 3. Create UE Context
oai
::
amf
::
model
::
UeContext
ue_ctx
=
registration_context
.
getUeContext
();
std
::
string
supi
=
{};
std
::
shared_ptr
<
ue_context
>
uc
=
{};
if
(
ue_ctx
.
supiIsSet
())
{
supi
=
ue_ctx
.
getSupi
();
if
(
!
is_supi_2_ue_context
(
supi
))
{
// Create a new UE Context
Logger
::
amf_app
().
debug
(
"No existing UE Context, Create a new one with SUPI %s"
,
supi
.
c_str
());
uc
=
std
::
shared_ptr
<
ue_context
>
(
new
ue_context
());
uc
->
amf_ue_ngap_id
=
-
1
;
uc
->
supi
=
supi
;
set_supi_2_ue_context
(
supi
,
uc
);
}
else
{
// Update UE Context
uc
=
supi_2_ue_context
(
supi
);
}
}
// TODO: 5gMmCapability
// TODO: MmContext
// TODO: PduSessionContext
/*
if (!is_supi_2_ue_context(itti_msg.ue_id)) {
// TODO: Create a new UE Context
...
...
@@ -592,8 +591,7 @@ void amf_app::handle_itti_message(itti_sbi_n1_message_notification& itti_msg) {
itti_n1_msg
->
nas_msg
=
n1sm
;
itti_n1_msg
->
mcc
=
ran_node_id
.
getPlmnId
().
getMcc
();
itti_n1_msg
->
mnc
=
ran_node_id
.
getPlmnId
().
getMnc
();
;
itti_n1_msg
->
is_guti_valid
=
false
;
itti_n1_msg
->
is_guti_valid
=
false
;
std
::
shared_ptr
<
itti_uplink_nas_data_ind
>
i
=
std
::
shared_ptr
<
itti_uplink_nas_data_ind
>
(
itti_n1_msg
);
...
...
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