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
b3b96b04
Commit
b3b96b04
authored
Feb 03, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup for Registration Accept
parent
7d370ca2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
63 deletions
+14
-63
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+14
-54
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+0
-9
No files found.
src/amf-app/amf_n1.cpp
View file @
b3b96b04
...
@@ -2586,8 +2586,6 @@ void amf_n1::security_mode_complete_handle(
...
@@ -2586,8 +2586,6 @@ void amf_n1::security_mode_complete_handle(
conv
::
tmsi_to_string
(
tmsi
);
conv
::
tmsi_to_string
(
tmsi
);
Logger
::
amf_n1
().
debug
(
"Allocated GUTI %s"
,
guti
.
c_str
());
Logger
::
amf_n1
().
debug
(
"Allocated GUTI %s"
,
guti
.
c_str
());
// TODO: remove hardcoded values
registration_accept
->
Set5gsNetworkFeatureSupport
(
0x01
,
0x00
);
// registration_accept->SetT3512Value(0x5, T3512_TIMER_VALUE_MIN);
// registration_accept->SetT3512Value(0x5, T3512_TIMER_VALUE_MIN);
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
int
encoded_size
=
registration_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
int
encoded_size
=
registration_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
...
@@ -3422,9 +3420,7 @@ void amf_n1::run_mobility_registration_update_procedure(
...
@@ -3422,9 +3420,7 @@ void amf_n1::run_mobility_registration_update_procedure(
// Encoding REGISTRATION ACCEPT
// Encoding REGISTRATION ACCEPT
auto
reg_accept
=
std
::
make_unique
<
RegistrationAccept
>
();
auto
reg_accept
=
std
::
make_unique
<
RegistrationAccept
>
();
initialize_registration_accept
(
reg_accept
);
initialize_registration_accept
(
reg_accept
,
nc
);
reg_accept
->
Set5gsNetworkFeatureSupport
(
0x00
,
0x00
);
// TODO: remove hardcoded values
reg_accept
->
Set5gGuti
(
reg_accept
->
Set5gGuti
(
amf_cfg
.
guami
.
mcc
,
amf_cfg
.
guami
.
mnc
,
amf_cfg
.
guami
.
regionID
,
amf_cfg
.
guami
.
mcc
,
amf_cfg
.
guami
.
mnc
,
amf_cfg
.
guami
.
regionID
,
...
@@ -3495,7 +3491,7 @@ void amf_n1::run_periodic_registration_update_procedure(
...
@@ -3495,7 +3491,7 @@ void amf_n1::run_periodic_registration_update_procedure(
// Experimental procedure
// Experimental procedure
// Encoding REGISTRATION ACCEPT
// Encoding REGISTRATION ACCEPT
auto
reg_accept
=
std
::
make_unique
<
RegistrationAccept
>
();
auto
reg_accept
=
std
::
make_unique
<
RegistrationAccept
>
();
initialize_registration_accept
(
reg_accept
);
initialize_registration_accept
(
reg_accept
,
nc
);
// Get UE context
// Get UE context
std
::
shared_ptr
<
ue_context
>
uc
=
{};
std
::
shared_ptr
<
ue_context
>
uc
=
{};
...
@@ -3516,7 +3512,6 @@ void amf_n1::run_periodic_registration_update_procedure(
...
@@ -3516,7 +3512,6 @@ void amf_n1::run_periodic_registration_update_procedure(
"PDU Session Status 0x%02x"
,
htonl
(
pdu_session_status
));
"PDU Session Status 0x%02x"
,
htonl
(
pdu_session_status
));
}
}
reg_accept
->
Set5gsNetworkFeatureSupport
(
0x01
,
0x00
);
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
int
encoded_size
=
reg_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
int
encoded_size
=
reg_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
comUt
::
print_buffer
(
comUt
::
print_buffer
(
...
@@ -3563,7 +3558,7 @@ void amf_n1::run_periodic_registration_update_procedure(
...
@@ -3563,7 +3558,7 @@ void amf_n1::run_periodic_registration_update_procedure(
// Encoding REGISTRATION ACCEPT
// Encoding REGISTRATION ACCEPT
auto
reg_accept
=
std
::
make_unique
<
RegistrationAccept
>
();
auto
reg_accept
=
std
::
make_unique
<
RegistrationAccept
>
();
initialize_registration_accept
(
reg_accept
);
initialize_registration_accept
(
reg_accept
,
nc
);
// Get UE context
// Get UE context
std
::
shared_ptr
<
ue_context
>
uc
=
{};
std
::
shared_ptr
<
ue_context
>
uc
=
{};
...
@@ -3586,7 +3581,6 @@ void amf_n1::run_periodic_registration_update_procedure(
...
@@ -3586,7 +3581,6 @@ void amf_n1::run_periodic_registration_update_procedure(
"PDU Session Status 0x%02x"
,
htonl
(
pdu_session_status
));
"PDU Session Status 0x%02x"
,
htonl
(
pdu_session_status
));
}
}
reg_accept
->
Set5gsNetworkFeatureSupport
(
0x01
,
0x00
);
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
int
encoded_size
=
reg_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
int
encoded_size
=
reg_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
comUt
::
print_buffer
(
comUt
::
print_buffer
(
...
@@ -4078,56 +4072,18 @@ void amf_n1::get_pdu_session_to_be_activated(
...
@@ -4078,56 +4072,18 @@ void amf_n1::get_pdu_session_to_be_activated(
}
}
}
}
//------------------------------------------------------------------------------
void
amf_n1
::
initialize_registration_accept
(
std
::
unique_ptr
<
nas
::
RegistrationAccept
>&
registration_accept
)
{
// TODO: to be updated with the function below
registration_accept
->
SetHeader
(
PLAIN_5GS_MSG
);
registration_accept
->
Set5gsRegistrationResult
(
false
,
false
,
false
,
0x01
);
// 3GPP Access
registration_accept
->
SetT3512Value
(
0x5
,
T3512_TIMER_VALUE_MIN
);
std
::
vector
<
p_tai_t
>
tai_list
;
for
(
auto
p
:
amf_cfg
.
plmn_list
)
{
p_tai_t
item
=
{};
item
.
type
=
0x00
;
nas_plmn_t
plmn
=
{};
plmn
.
mcc
=
p
.
mcc
;
plmn
.
mnc
=
p
.
mnc
;
item
.
plmn_list
.
push_back
(
plmn
);
item
.
tac_list
.
push_back
(
p
.
tac
);
tai_list
.
push_back
(
item
);
}
registration_accept
->
setTaiList
(
tai_list
);
// TODO: get the list of common SST, SD between UE/gNB and AMF
std
::
vector
<
struct
SNSSAI_s
>
nssai
;
for
(
auto
p
:
amf_cfg
.
plmn_list
)
{
for
(
auto
s
:
p
.
slice_list
)
{
SNSSAI_t
snssai
=
{};
snssai
.
sst
=
s
.
sst
;
snssai
.
sd
=
s
.
sd
;
if
(
snssai
.
sd
==
SD_NO_VALUE
)
{
snssai
.
length
=
SST_LENGTH
;
}
else
{
snssai
.
length
=
SST_LENGTH
+
SD_LENGTH
;
}
nssai
.
push_back
(
snssai
);
}
}
registration_accept
->
SetAllowedNssai
(
nssai
);
return
;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
amf_n1
::
initialize_registration_accept
(
void
amf_n1
::
initialize_registration_accept
(
std
::
unique_ptr
<
nas
::
RegistrationAccept
>&
registration_accept
,
std
::
unique_ptr
<
nas
::
RegistrationAccept
>&
registration_accept
,
const
std
::
shared_ptr
<
nas_context
>&
nc
)
{
const
std
::
shared_ptr
<
nas_context
>&
nc
)
{
registration_accept
->
SetHeader
(
PLAIN_5GS_MSG
);
registration_accept
->
SetHeader
(
PLAIN_5GS_MSG
);
// Registration Result
registration_accept
->
Set5gsRegistrationResult
(
registration_accept
->
Set5gsRegistrationResult
(
false
,
false
,
false
,
false
,
false
,
false
,
0x01
);
// 3GPP Access
0x01
);
// 3GPP Access
// Timer T3512
registration_accept
->
SetT3512Value
(
0x5
,
T3512_TIMER_VALUE_MIN
);
registration_accept
->
SetT3512Value
(
0x5
,
T3512_TIMER_VALUE_MIN
);
// Find UE Context
// Find UE Context
...
@@ -4137,6 +4093,7 @@ void amf_n1::initialize_registration_accept(
...
@@ -4137,6 +4093,7 @@ void amf_n1::initialize_registration_accept(
return
;
return
;
}
}
// TAI List
std
::
vector
<
p_tai_t
>
tai_list
;
std
::
vector
<
p_tai_t
>
tai_list
;
for
(
auto
p
:
amf_cfg
.
plmn_list
)
{
for
(
auto
p
:
amf_cfg
.
plmn_list
)
{
p_tai_t
item
=
{};
p_tai_t
item
=
{};
...
@@ -4150,6 +4107,12 @@ void amf_n1::initialize_registration_accept(
...
@@ -4150,6 +4107,12 @@ void amf_n1::initialize_registration_accept(
}
}
registration_accept
->
setTaiList
(
tai_list
);
registration_accept
->
setTaiList
(
tai_list
);
// Network Feature Support
// TODO: remove hardcoded values
registration_accept
->
Set5gsNetworkFeatureSupport
(
0x01
,
0x00
);
// 0x00, 0x00 to disable IMS
// Allowed/Rejected/Configured NSSAI
// Get the list of common SST, SD between UE and AMF
// Get the list of common SST, SD between UE and AMF
std
::
vector
<
struct
SNSSAI_s
>
common_nssais
;
std
::
vector
<
struct
SNSSAI_s
>
common_nssais
;
amf_n2_inst
->
get_common_NSSAI
(
nc
->
ran_ue_ngap_id
,
common_nssais
);
amf_n2_inst
->
get_common_NSSAI
(
nc
->
ran_ue_ngap_id
,
common_nssais
);
...
@@ -4197,9 +4160,6 @@ void amf_n1::initialize_registration_accept(
...
@@ -4197,9 +4160,6 @@ void amf_n1::initialize_registration_accept(
}
else
{
}
else
{
snssai
.
length
=
SST_LENGTH
+
SD_LENGTH
;
snssai
.
length
=
SST_LENGTH
+
SD_LENGTH
;
}
}
// Logger::amf_n1().debug(
// "Allowed S-NSSAI (SST 0x%x, SD 0x%x)", s.sst, s.sd);
// allowed_nssais.push_back(snssai);
found
=
true
;
found
=
true
;
break
;
break
;
}
else
{
}
else
{
...
...
src/amf-app/amf_n1.hpp
View file @
b3b96b04
...
@@ -487,15 +487,6 @@ class amf_n1 {
...
@@ -487,15 +487,6 @@ class amf_n1 {
const
uint16_t
pdu_session_status
,
const
uint16_t
pdu_session_status
,
std
::
vector
<
uint8_t
>&
pdu_session_to_be_activated
);
std
::
vector
<
uint8_t
>&
pdu_session_to_be_activated
);
/*
* Initialize Registration Accept with default parameters
* @param [std::unique_ptr<nas::RegistrationAccept>&] registration_accept:
* Pointer to the Registration Accept message
* @return void
*/
void
initialize_registration_accept
(
std
::
unique_ptr
<
nas
::
RegistrationAccept
>&
registration_accept
);
/*
/*
* Initialize Registration Accept with the parameters from NAS context
* Initialize Registration Accept with the parameters from NAS context
* @param [std::unique_ptr<nas::RegistrationAccept>&] registration_accept:
* @param [std::unique_ptr<nas::RegistrationAccept>&] registration_accept:
...
...
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