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
cc001a5a
Unverified
Commit
cc001a5a
authored
Nov 06, 2021
by
kharade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check nssai during smf selection
parent
f9ffb813
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+24
-6
No files found.
src/amf-app/amf_n11.cpp
View file @
cc001a5a
...
@@ -1105,14 +1105,33 @@ bool amf_n11::discover_smf(
...
@@ -1105,14 +1105,33 @@ bool amf_n11::discover_smf(
nlohmann
::
json
instance_json
=
it
.
value
();
nlohmann
::
json
instance_json
=
it
.
value
();
// TODO: convert instance_json to SMF profile
// TODO: convert instance_json to SMF profile
// TODO: add SMF to the list of available SMF
// TODO: add SMF to the list of available SMF
// TODO: check with sNSSAI and DNN
// check with sNSSAI
if
(
instance_json
.
find
(
"sNssais"
)
!=
instance_json
.
end
())
{
for
(
auto
&
s
:
instance_json
[
"sNssais"
].
items
())
{
nlohmann
::
json
Snssai
=
s
.
value
();
if
(
Snssai
[
"sst"
]
==
snssai
.
sST
)
{
if
(
!
Snssai
[
"sd"
].
empty
()
&
Snssai
[
"sd"
]
!=
snssai
.
sD
)
{
Logger
::
amf_n11
().
debug
(
"SD is not matched"
);
result
=
false
;
}
Logger
::
amf_n11
().
debug
(
"Snssai is matched for SMF profile"
);
result
=
true
;
break
;
}
else
{
Logger
::
amf_n11
().
debug
(
"Snssai is not matched for SMF profile"
);
result
=
false
;
}
}
if
(
!
result
)
return
result
;
}
// TODO: check DNN
// TODO: PLMN (need to add plmnList into NRF profile, SMF profile)
// TODO: PLMN (need to add plmnList into NRF profile, SMF profile)
// for now, just IP addr of SMF of the first NF instance
// for now, just IP addr of SMF of the first NF instance
if
(
instance_json
.
find
(
"ipv4Addresses"
)
!=
instance_json
.
end
())
{
if
(
instance_json
.
find
(
"ipv4Addresses"
)
!=
instance_json
.
end
())
{
if
(
instance_json
[
"ipv4Addresses"
].
size
()
>
0
)
if
(
instance_json
[
"ipv4Addresses"
].
size
()
>
0
)
smf_addr
=
smf_addr
=
instance_json
[
"ipv4Addresses"
].
at
(
0
).
get
<
std
::
string
>
();
instance_json
[
"ipv4Addresses"
].
at
(
0
).
get
<
std
::
string
>
();
// break;
}
}
if
(
instance_json
.
find
(
"nfServices"
)
!=
instance_json
.
end
())
{
if
(
instance_json
.
find
(
"nfServices"
)
!=
instance_json
.
end
())
{
if
(
instance_json
[
"nfServices"
].
size
()
>
0
)
{
if
(
instance_json
[
"nfServices"
].
size
()
>
0
)
{
...
@@ -1129,15 +1148,14 @@ bool amf_n11::discover_smf(
...
@@ -1129,15 +1148,14 @@ bool amf_n11::discover_smf(
}
}
}
}
}
}
Logger
::
amf_n11
().
debug
(
"NFDiscovery, SMF Addr: %s, SMF Api Version: %s"
,
smf_addr
.
c_str
(),
smf_api_version
.
c_str
());
}
else
{
}
else
{
Logger
::
amf_n11
().
warn
(
"NFDiscovery, could not get response from NRF"
);
Logger
::
amf_n11
().
warn
(
"NFDiscovery, could not get response from NRF"
);
result
=
false
;
result
=
false
;
}
}
Logger
::
amf_n11
().
debug
(
"NFDiscovery, SMF Addr: %s, SMF Api Version: %s"
,
smf_addr
.
c_str
(),
smf_api_version
.
c_str
());
curl_slist_free_all
(
headers
);
curl_slist_free_all
(
headers
);
curl_easy_cleanup
(
curl
);
curl_easy_cleanup
(
curl
);
}
}
...
...
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