Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
cn5g
oai-cn5g-smf
Commits
48243648
Commit
48243648
authored
Feb 25, 2021
by
Tien-Thinh Nguyen
Browse files
Update PFCP to work with FQDN from UPF
parent
0ad52e2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/smf_app/smf_pfcp_association.cpp
View file @
48243648
...
@@ -94,6 +94,27 @@ bool pfcp_associations::add_association(
...
@@ -94,6 +94,27 @@ bool pfcp_associations::add_association(
sa
->
recovery_time_stamp
=
recovery_time_stamp
;
sa
->
recovery_time_stamp
=
recovery_time_stamp
;
sa
->
function_features
=
{};
sa
->
function_features
=
{};
}
else
{
}
else
{
if
(
node_id
.
node_id_type
==
pfcp
::
NODE_ID_TYPE_FQDN
)
{
Logger
::
smf_app
().
info
(
"Node ID Type FQDN: %s"
,
node_id
.
fqdn
.
c_str
());
}
struct
hostent
*
record
=
gethostbyname
(
node_id
.
fqdn
.
c_str
());
if
(
record
==
NULL
)
{
Logger
::
smf_app
().
info
(
"Add association with node (FQDN) %s: cannot resolve the hostname!"
,
node_id
.
fqdn
.
c_str
());
return
false
;
}
if
(
record
->
h_addrtype
==
AF_INET
)
{
in_addr
*
address
=
(
struct
in_addr
*
)
record
->
h_addr
;
node_id
.
node_id_type
=
pfcp
::
NODE_ID_TYPE_IPV4_ADDRESS
;
node_id
.
u1
.
ipv4_address
=
*
address
;
}
else
if
(
record
->
h_addrtype
==
AF_INET6
)
{
// TODO
return
false
;
}
else
{
return
false
;
}
restore_n4_sessions
=
false
;
restore_n4_sessions
=
false
;
pfcp_association
*
association
=
pfcp_association
*
association
=
new
pfcp_association
(
node_id
,
recovery_time_stamp
);
new
pfcp_association
(
node_id
,
recovery_time_stamp
);
...
@@ -135,13 +156,12 @@ bool pfcp_associations::add_association(
...
@@ -135,13 +156,12 @@ bool pfcp_associations::add_association(
sa
->
function_features
.
second
=
function_features
;
sa
->
function_features
.
second
=
function_features
;
}
else
{
}
else
{
if
(
node_id
.
node_id_type
==
pfcp
::
NODE_ID_TYPE_FQDN
)
{
if
(
node_id
.
node_id_type
==
pfcp
::
NODE_ID_TYPE_FQDN
)
{
Logger
::
smf_app
().
info
(
"
FQDN, NODE ID
%s"
,
node_id
.
fqdn
.
c_str
());
Logger
::
smf_app
().
info
(
"
Node ID Type FQDN:
%s"
,
node_id
.
fqdn
.
c_str
());
}
}
struct
hostent
*
record
=
gethostbyname
(
node_id
.
fqdn
.
c_str
());
struct
hostent
*
record
=
gethostbyname
(
node_id
.
fqdn
.
c_str
());
if
(
record
==
NULL
)
{
if
(
record
==
NULL
)
{
Logger
::
smf_app
().
info
(
Logger
::
smf_app
().
info
(
"Add association with %s: cannot resolve,"
"Add association with node (FQDN) %s: cannot resolve the hostname!"
,
" retrying later"
,
node_id
.
fqdn
.
c_str
());
node_id
.
fqdn
.
c_str
());
return
false
;
return
false
;
}
}
...
...
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