Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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-SMF
Commits
2be016a7
Commit
2be016a7
authored
Mar 09, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support DNS v6
parent
f31e6e34
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
4 deletions
+53
-4
src/common/utils/string.cpp
src/common/utils/string.cpp
+2
-2
src/smf_app/smf_app.hpp
src/smf_app/smf_app.hpp
+10
-0
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+2
-1
src/smf_app/smf_pco.cpp
src/smf_app/smf_pco.cpp
+38
-1
src/smf_app/smf_pco.hpp
src/smf_app/smf_pco.hpp
+1
-0
No files found.
src/common/utils/string.cpp
View file @
2be016a7
...
@@ -104,7 +104,7 @@ void util::ipv6_to_bstring(struct in6_addr ipv6_address, bstring str) {
...
@@ -104,7 +104,7 @@ void util::ipv6_to_bstring(struct in6_addr ipv6_address, bstring str) {
char
str_addr6
[
INET6_ADDRSTRLEN
];
char
str_addr6
[
INET6_ADDRSTRLEN
];
if
(
inet_ntop
(
AF_INET6
,
&
ipv6_address
,
str_addr6
,
sizeof
(
str_addr6
)))
{
if
(
inet_ntop
(
AF_INET6
,
&
ipv6_address
,
str_addr6
,
sizeof
(
str_addr6
)))
{
std
::
string
ipv6_addr_str
((
char
*
)
str_addr6
,
INET6_ADDRSTRLEN
);
std
::
string
ipv6_addr_str
((
char
*
)
str_addr6
,
INET6_ADDRSTRLEN
);
//Logger::smf_app().info(" Ipv6 address....: %s", ipv6_addr_str.c_str());
//
Logger::smf_app().info(" Ipv6 address....: %s", ipv6_addr_str.c_str());
unsigned
char
buf_in6_addr
[
sizeof
(
struct
in6_addr
)];
unsigned
char
buf_in6_addr
[
sizeof
(
struct
in6_addr
)];
if
(
inet_pton
(
AF_INET6
,
util
::
trim
(
ipv6_addr_str
).
c_str
(),
buf_in6_addr
)
==
if
(
inet_pton
(
AF_INET6
,
util
::
trim
(
ipv6_addr_str
).
c_str
(),
buf_in6_addr
)
==
1
)
{
1
)
{
...
@@ -121,7 +121,7 @@ void util::ipv4v6_to_pdu_address_information(
...
@@ -121,7 +121,7 @@ void util::ipv4v6_to_pdu_address_information(
if
(
inet_ntop
(
AF_INET6
,
&
ipv6_address
,
str_addr6
,
sizeof
(
str_addr6
)))
{
if
(
inet_ntop
(
AF_INET6
,
&
ipv6_address
,
str_addr6
,
sizeof
(
str_addr6
)))
{
std
::
string
ipv6_addr_str
((
char
*
)
str_addr6
,
INET6_ADDRSTRLEN
);
std
::
string
ipv6_addr_str
((
char
*
)
str_addr6
,
INET6_ADDRSTRLEN
);
//Logger::smf_app().info(" Ipv6 address....: %s", ipv6_addr_str.c_str());
//
Logger::smf_app().info(" Ipv6 address....: %s", ipv6_addr_str.c_str());
unsigned
char
buf_in6_addr
[
sizeof
(
struct
in6_addr
)];
unsigned
char
buf_in6_addr
[
sizeof
(
struct
in6_addr
)];
if
(
inet_pton
(
AF_INET6
,
util
::
trim
(
ipv6_addr_str
).
c_str
(),
buf_in6_addr
)
==
if
(
inet_pton
(
AF_INET6
,
util
::
trim
(
ipv6_addr_str
).
c_str
(),
buf_in6_addr
)
==
1
)
{
1
)
{
...
...
src/smf_app/smf_app.hpp
View file @
2be016a7
...
@@ -186,6 +186,16 @@ class smf_app {
...
@@ -186,6 +186,16 @@ class smf_app {
protocol_configuration_options_t
&
pco_resp
,
protocol_configuration_options_t
&
pco_resp
,
const
pco_protocol_or_container_id_t
*
const
poc_id
);
const
pco_protocol_or_container_id_t
*
const
poc_id
);
/*
* process_pco_dns_server_v6_request
* @param [protocol_configuration_options_t &] pco_resp
* @param [pco_protocol_or_container_id_t *const] proc_id
* @return
*/
int
process_pco_dns_server_v6_request
(
protocol_configuration_options_t
&
pco_resp
,
const
pco_protocol_or_container_id_t
*
const
poc_id
);
/*
/*
* process_pco_link_mtu_request
* process_pco_link_mtu_request
* @param [protocol_configuration_options_t &] pco_resp
* @param [protocol_configuration_options_t &] pco_resp
...
...
src/smf_app/smf_context.cpp
View file @
2be016a7
...
@@ -1328,7 +1328,8 @@ void smf_context::handle_pdu_session_create_sm_context_request(
...
@@ -1328,7 +1328,8 @@ void smf_context::handle_pdu_session_create_sm_context_request(
.
ci_dns_server_ipv4_address_request
=
0
,
.
ci_dns_server_ipv4_address_request
=
0
,
.
ci_ip_address_allocation_via_nas_signalling
=
0
,
.
ci_ip_address_allocation_via_nas_signalling
=
0
,
.
ci_ipv4_address_allocation_via_dhcpv4
=
0
,
.
ci_ipv4_address_allocation_via_dhcpv4
=
0
,
.
ci_ipv4_link_mtu_request
=
0
};
.
ci_ipv4_link_mtu_request
=
0
,
.
ci_dns_server_ipv6_address_request
=
0
};
smf_app_inst
->
process_pco_request
(
pco_req
,
pco_resp
,
pco_ids
);
smf_app_inst
->
process_pco_request
(
pco_req
,
pco_resp
,
pco_ids
);
sm_context_resp_pending
->
res
.
set_epco
(
pco_resp
);
sm_context_resp_pending
->
res
.
set_epco
(
pco_resp
);
...
...
src/smf_app/smf_pco.cpp
View file @
2be016a7
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include "rfc_1877.h"
#include "rfc_1877.h"
#include "smf_app.hpp"
#include "smf_app.hpp"
#include "smf_config.hpp"
#include "smf_config.hpp"
#include "string.hpp"
using
namespace
smf
;
using
namespace
smf
;
...
@@ -283,6 +284,38 @@ int smf_app::process_pco_dns_server_request(
...
@@ -283,6 +284,38 @@ int smf_app::process_pco_dns_server_request(
return
pco_push_protocol_or_container_id
(
pco_resp
,
&
poc_id_resp
);
return
pco_push_protocol_or_container_id
(
pco_resp
,
&
poc_id_resp
);
}
}
//------------------------------------------------------------------------------
int
smf_app
::
process_pco_dns_server_v6_request
(
protocol_configuration_options_t
&
pco_resp
,
const
pco_protocol_or_container_id_t
*
const
poc_id
)
{
in6_addr
ipcp_out_dns_prim_ipv6_addr
=
smf_cfg
.
default_dnsv6
;
pco_protocol_or_container_id_t
poc_id_resp
=
{
0
};
uint8_t
dnsv6_array
[
16
];
Logger
::
smf_app
().
debug
(
"PCO: Protocol identifier IPCP option DNS Server v6 Request"
);
poc_id_resp
.
protocol_id
=
PCO_CONTAINER_IDENTIFIER_DNS_SERVER_IPV6_ADDRESS
;
poc_id_resp
.
length_of_protocol_id_contents
=
16
;
char
str_addr6
[
INET6_ADDRSTRLEN
];
if
(
inet_ntop
(
AF_INET6
,
&
ipcp_out_dns_prim_ipv6_addr
,
str_addr6
,
sizeof
(
str_addr6
)))
{
std
::
string
ipv6_addr_str
((
char
*
)
str_addr6
,
INET6_ADDRSTRLEN
);
// Logger::smf_app().info(" Ipv6 address....: %s", ipv6_addr_str.c_str());
unsigned
char
buf_in6_addr
[
sizeof
(
struct
in6_addr
)];
if
(
inet_pton
(
AF_INET6
,
util
::
trim
(
ipv6_addr_str
).
c_str
(),
buf_in6_addr
)
==
1
)
{
for
(
int
i
=
0
;
i
<=
15
;
i
++
)
dnsv6_array
[
i
]
=
(
uint8_t
)(
buf_in6_addr
[
i
]);
}
}
std
::
string
tmp_s
((
const
char
*
)
&
dnsv6_array
[
0
],
sizeof
(
dnsv6_array
));
poc_id_resp
.
protocol_id_contents
=
tmp_s
;
return
pco_push_protocol_or_container_id
(
pco_resp
,
&
poc_id_resp
);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int
smf_app
::
process_pco_link_mtu_request
(
int
smf_app
::
process_pco_link_mtu_request
(
protocol_configuration_options_t
&
pco_resp
,
protocol_configuration_options_t
&
pco_resp
,
...
@@ -335,7 +368,11 @@ int smf_app::process_pco_request(
...
@@ -335,7 +368,11 @@ int smf_app::process_pco_request(
pco_resp
,
&
pco_req
.
protocol_or_container_ids
[
id
]);
pco_resp
,
&
pco_req
.
protocol_or_container_ids
[
id
]);
pco_ids
.
ci_dns_server_ipv4_address_request
=
true
;
pco_ids
.
ci_dns_server_ipv4_address_request
=
true
;
break
;
break
;
case
PCO_CONTAINER_IDENTIFIER_DNS_SERVER_IPV6_ADDRESS
:
process_pco_dns_server_v6_request
(
pco_resp
,
&
pco_req
.
protocol_or_container_ids
[
id
]);
pco_ids
.
ci_dns_server_ipv6_address_request
=
true
;
break
;
case
PCO_CONTAINER_IDENTIFIER_IP_ADDRESS_ALLOCATION_VIA_NAS_SIGNALLING
:
case
PCO_CONTAINER_IDENTIFIER_IP_ADDRESS_ALLOCATION_VIA_NAS_SIGNALLING
:
Logger
::
smf_app
().
debug
(
"PCO: Allocation via NAS signaling requested"
);
Logger
::
smf_app
().
debug
(
"PCO: Allocation via NAS signaling requested"
);
pco_ids
.
ci_ip_address_allocation_via_nas_signalling
=
true
;
pco_ids
.
ci_ip_address_allocation_via_nas_signalling
=
true
;
...
...
src/smf_app/smf_pco.hpp
View file @
2be016a7
...
@@ -47,6 +47,7 @@ typedef struct protocol_configuration_options_ids_s {
...
@@ -47,6 +47,7 @@ typedef struct protocol_configuration_options_ids_s {
uint8_t
ci_ip_address_allocation_via_nas_signalling
:
1
;
uint8_t
ci_ip_address_allocation_via_nas_signalling
:
1
;
uint8_t
ci_ipv4_address_allocation_via_dhcpv4
:
1
;
uint8_t
ci_ipv4_address_allocation_via_dhcpv4
:
1
;
uint8_t
ci_ipv4_link_mtu_request
:
1
;
uint8_t
ci_ipv4_link_mtu_request
:
1
;
uint8_t
ci_dns_server_ipv6_address_request
:
1
;
}
protocol_configuration_options_ids_t
;
}
protocol_configuration_options_ids_t
;
#endif
#endif
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