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
9d4eb446
Commit
9d4eb446
authored
Feb 01, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for SMF API Version
parent
8ee1e3e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
18 deletions
+22
-18
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+2
-0
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+2
-2
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+15
-13
src/amf-app/amf_n11.hpp
src/amf-app/amf_n11.hpp
+3
-3
No files found.
src/amf-app/amf_n1.cpp
View file @
9d4eb446
...
...
@@ -378,6 +378,7 @@ void amf_n1::nas_signalling_establishment_request_handle(
}
}
/*
//------------------------------------------------------------------------------
void amf_n1::uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id,
bstring plain_msg) {
...
...
@@ -428,6 +429,7 @@ void amf_n1::uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id,
}
}
}
*/
//------------------------------------------------------------------------------
void
amf_n1
::
uplink_nas_msg_handle
(
uint32_t
ran_ue_ngap_id
,
long
amf_ue_ngap_id
,
...
...
src/amf-app/amf_n1.hpp
View file @
9d4eb446
...
...
@@ -68,8 +68,8 @@ class amf_n1 {
SecurityHeaderType
type
,
std
::
shared_ptr
<
nas_context
>
nc
,
uint32_t
ran_ue_ngap_id
,
long
amf_ue_ngap_id
,
bstring
plain_msg
,
std
::
string
snn
,
uint8_t
ulCount
);
void
uplink_nas_msg_handle
(
uint32_t
ran_ue_ngap_id
,
long
amf_ue_ngap_id
,
bstring
plain_msg
);
//
void uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id,
//
bstring plain_msg);
void
uplink_nas_msg_handle
(
uint32_t
ran_ue_ngap_id
,
long
amf_ue_ngap_id
,
bstring
plain_msg
,
plmn_t
plmn
);
bool
check_security_header_type
(
SecurityHeaderType
&
type
,
uint8_t
*
buffer
);
...
...
src/amf-app/amf_n11.cpp
View file @
9d4eb446
...
...
@@ -169,8 +169,9 @@ void amf_n11::handle_itti_message(
return
;
}
std
::
string
smf_addr
;
std
::
string
smf_api_version
;
if
(
!
psc
.
get
()
->
smf_available
)
{
if
(
!
smf_selection_from_configuration
(
smf_addr
))
{
if
(
!
smf_selection_from_configuration
(
smf_addr
,
smf_api_version
))
{
// use NRF to find suitable SMF based on snssai, plmn and dnn
if
(
!
discover_smf
(
smf_addr
,
psc
.
get
()
->
snssai
,
psc
.
get
()
->
plmn
,
psc
.
get
()
->
dnn
))
{
...
...
@@ -179,7 +180,7 @@ void amf_n11::handle_itti_message(
}
}
}
else
{
smf_selection_from_context
(
smf_addr
);
smf_selection_from_context
(
smf_addr
,
smf_api_version
);
}
std
::
string
smf_ip_addr
,
remote_uri
;
...
...
@@ -248,13 +249,14 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
psc
.
get
()
->
dnn
=
dnn
;
std
::
string
smf_addr
;
std
::
string
smf_api_version
;
if
(
!
psc
.
get
()
->
smf_available
)
{
if
(
!
smf_selection_from_configuration
(
smf_addr
))
{
if
(
!
smf_selection_from_configuration
(
smf_addr
,
smf_api_version
))
{
Logger
::
amf_n11
().
error
(
"No candidate for SMF is available"
);
return
;
}
}
else
{
smf_selection_from_context
(
smf_addr
);
smf_selection_from_context
(
smf_addr
,
smf_api_version
);
}
switch
(
smf
.
req_type
&
0x07
)
{
...
...
@@ -290,7 +292,7 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
}
else
{
psc
.
get
()
->
isn2sm_avaliable
=
false
;
handle_pdu_session_initial_request
(
supi
,
psc
,
smf_addr
,
smf
.
sm_msg
,
dnn
);
supi
,
psc
,
smf_addr
,
smf
_api_version
,
smf
.
sm_msg
,
dnn
);
}
}
break
;
case
EXISTING_PDU_SESSION
:
{
...
...
@@ -346,14 +348,14 @@ void amf_n11::send_pdu_session_update_sm_context_request(
//------------------------------------------------------------------------------
void
amf_n11
::
handle_pdu_session_initial_request
(
std
::
string
supi
,
std
::
shared_ptr
<
pdu_session_context
>
psc
,
std
::
string
smf_addr
,
bstring
sm_msg
,
std
::
string
dnn
)
{
std
::
string
smf_addr
,
std
::
string
smf_api_version
,
bstring
sm_msg
,
std
::
string
dnn
)
{
Logger
::
amf_n11
().
debug
(
"Handle PDU Session Establishment Request (SUPI %s, PDU Session ID %d)"
,
supi
.
c_str
(),
psc
.
get
()
->
pdu_session_id
);
// TODO: Remove hardcoded values
std
::
string
remote_uri
=
smf_addr
+
"/nsmf-pdusession/
v2/sm-contexts"
;
// TODO
smf_addr
+
"/nsmf-pdusession/
"
+
smf_api_version
+
"/sm-contexts"
;
nlohmann
::
json
pdu_session_establishment_request
;
pdu_session_establishment_request
[
"supi"
]
=
supi
.
c_str
();
pdu_session_establishment_request
[
"pei"
]
=
"imei-200000000000001"
;
...
...
@@ -390,13 +392,14 @@ void amf_n11::handle_itti_message(
itti_nsmf_pdusession_release_sm_context
&
itti_msg
)
{
std
::
shared_ptr
<
pdu_session_context
>
psc
=
supi_to_pdu_ctx
(
itti_msg
.
supi
);
string
smf_addr
;
std
::
string
smf_api_version
;
if
(
!
psc
.
get
()
->
smf_available
)
{
if
(
!
smf_selection_from_configuration
(
smf_addr
))
{
if
(
!
smf_selection_from_configuration
(
smf_addr
,
smf_api_version
))
{
Logger
::
amf_n11
().
error
(
"No candidate smf is avaliable"
);
return
;
}
}
else
{
smf_selection_from_context
(
smf_addr
);
smf_selection_from_context
(
smf_addr
,
smf_api_version
);
}
string
remote_uri
=
psc
.
get
()
->
location
+
"release"
;
nlohmann
::
json
pdu_session_release_request
;
...
...
@@ -434,12 +437,11 @@ void amf_n11::set_supi_to_pdu_ctx(
// SMF selection
//------------------------------------------------------------------------------
bool
amf_n11
::
smf_selection_from_configuration
(
std
::
string
&
smf_addr
)
{
bool
amf_n11
::
smf_selection_from_configuration
(
std
::
string
&
smf_addr
,
std
::
string
&
smf_api_version
)
{
for
(
int
i
=
0
;
i
<
amf_cfg
.
smf_pool
.
size
();
i
++
)
{
if
(
amf_cfg
.
smf_pool
[
i
].
selected
)
{
// smf_addr = "http://" + amf_cfg.smf_pool[i].ipv4 + ":" +
// amf_cfg.smf_pool[i].port;
smf_addr
=
amf_cfg
.
smf_pool
[
i
].
ipv4
+
":"
+
amf_cfg
.
smf_pool
[
i
].
port
;
smf_api_version
=
amf_cfg
.
smf_pool
[
i
].
version
;
return
true
;
}
}
...
...
@@ -447,7 +449,7 @@ bool amf_n11::smf_selection_from_configuration(std::string& smf_addr) {
}
//------------------------------------------------------------------------------
bool
amf_n11
::
smf_selection_from_context
(
std
::
string
&
smf_addr
)
{
bool
amf_n11
::
smf_selection_from_context
(
std
::
string
&
smf_addr
,
std
::
string
&
smf_api_version
)
{
// TODO:
}
...
...
src/amf-app/amf_n11.hpp
View file @
9d4eb446
...
...
@@ -46,7 +46,7 @@ class amf_n11 {
void
handle_itti_message
(
itti_smf_services_consumer
&
);
void
handle_pdu_session_initial_request
(
std
::
string
supi
,
std
::
shared_ptr
<
pdu_session_context
>
psc
,
std
::
string
smf_addr
,
bstring
sm_msg
,
std
::
string
dnn
);
std
::
string
smf_addr
,
std
::
string
smf_api_version
,
bstring
sm_msg
,
std
::
string
dnn
);
void
handle_itti_message
(
itti_nsmf_pdusession_update_sm_context
&
itti_msg
);
void
handle_itti_message
(
itti_nsmf_pdusession_release_sm_context
&
itti_msg
);
void
handle_itti_message
(
itti_pdu_session_resource_setup_response
&
itti_msg
);
...
...
@@ -64,8 +64,8 @@ class amf_n11 {
const
std
::
string
&
supi
,
std
::
shared_ptr
<
pdu_session_context
>
psc
);
std
::
map
<
uint8_t
,
std
::
string
>
pduid2supi
;
bool
smf_selection_from_configuration
(
std
::
string
&
smf_addr
);
bool
smf_selection_from_context
(
std
::
string
&
smf_addr
);
bool
smf_selection_from_configuration
(
std
::
string
&
smf_addr
,
std
::
string
&
smf_api_version
);
bool
smf_selection_from_context
(
std
::
string
&
smf_addr
,
std
::
string
&
smf_api_version
);
void
handle_post_sm_context_response_error_400
();
void
handle_post_sm_context_response_error
(
long
code
,
std
::
string
cause
,
bstring
n1sm
,
std
::
string
supi
,
...
...
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