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-Simple
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
CommunityXG
OpenXG-SMF-Simple
Commits
e3362e99
Commit
e3362e99
authored
Mar 09, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Temp: Use hardcoded IPv6 Addr
parent
f92c1a86
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
src/common/utils/string.cpp
src/common/utils/string.cpp
+19
-0
src/common/utils/string.hpp
src/common/utils/string.hpp
+2
-0
src/smf_app/smf_paa_dynamic.hpp
src/smf_app/smf_paa_dynamic.hpp
+11
-1
No files found.
src/common/utils/string.cpp
View file @
e3362e99
...
...
@@ -120,6 +120,25 @@ void util::ipv4v6_to_bstring(
memcpy
(
str
->
data
,
bitstream_addr
,
sizeof
(
bitstream_addr
));
}
void
util
::
ipv4v6_to_bstring
(
struct
in_addr
ipv4_address
,
std
::
string
ipv6_address
,
bstring
str
)
{
unsigned
char
bitstream_addr
[
12
];
bitstream_addr
[
0
]
=
(
uint8_t
)((
ipv4_address
.
s_addr
)
&
0x000000ff
);
bitstream_addr
[
1
]
=
(
uint8_t
)(((
ipv4_address
.
s_addr
)
&
0x0000ff00
)
>>
8
);
bitstream_addr
[
2
]
=
(
uint8_t
)(((
ipv4_address
.
s_addr
)
&
0x00ff0000
)
>>
16
);
bitstream_addr
[
3
]
=
(
uint8_t
)(((
ipv4_address
.
s_addr
)
&
0xff000000
)
>>
24
);
std
::
string
ipv6_addr
=
"2001:4860:4860::2"
;
unsigned
char
buf_in6_addr
[
sizeof
(
struct
in6_addr
)];
if
(
inet_pton
(
AF_INET6
,
util
::
trim
(
ipv6_addr
).
c_str
(),
buf_in6_addr
)
==
1
)
{
// memcpy(&p, buf_in6_addr, sizeof(struct in6_addr));
for
(
int
i
=
0
;
i
<=
7
;
i
++
)
bitstream_addr
[
i
+
4
]
=
(
uint8_t
)(
buf_in6_addr
[
i
]);
}
str
->
slen
=
12
;
memcpy
(
str
->
data
,
bitstream_addr
,
sizeof
(
bitstream_addr
));
}
void
util
::
string_to_bstring
(
const
std
::
string
&
str
,
bstring
bstr
)
{
// bstr = bfromcstralloc(str.length(), "\0");
bstr
->
slen
=
str
.
length
();
...
...
src/common/utils/string.hpp
View file @
e3362e99
...
...
@@ -49,6 +49,8 @@ void ipv4_to_bstring(struct in_addr ipv4_address, bstring str);
void
ipv6_to_bstring
(
struct
in6_addr
ipv6_address
,
bstring
str
);
void
ipv4v6_to_bstring
(
struct
in_addr
ipv4_address
,
struct
in6_addr
ipv6_address
,
bstring
str
);
void
ipv4v6_to_bstring
(
struct
in_addr
ipv4_address
,
std
::
string
ipv6_address
,
bstring
str
);
void
string_to_bstring
(
const
std
::
string
&
str
,
bstring
bstr
);
}
// namespace util
...
...
src/smf_app/smf_paa_dynamic.hpp
View file @
e3362e99
...
...
@@ -33,6 +33,8 @@
#include <map>
#include "logger.hpp"
#include "string.hpp"
#include <boost/algorithm/string.hpp>
class
ipv6_pool
{
public:
...
...
@@ -239,7 +241,15 @@ class paa_dynamic {
return
true
;
}
}
ipv4_pools
[
*
it4
].
free_address
(
paa
.
ipv4_address
);
// ipv4_pools[*it4].free_address(paa.ipv4_address);
// TODO: To be fixed the error for IPv6 addr allocation, so assign a
// fixed IPv6 addr here!
std
::
string
ipv6_addr
=
"2001:4860:4860::2"
;
unsigned
char
buf_in6_addr
[
sizeof
(
struct
in6_addr
)];
if
(
inet_pton
(
AF_INET6
,
util
::
trim
(
ipv6_addr
).
c_str
(),
buf_in6_addr
)
==
1
)
{
memcpy
(
&
paa
.
ipv6_address
,
buf_in6_addr
,
sizeof
(
struct
in6_addr
));
}
}
Logger
::
smf_app
().
warn
(
"Could not get PAA PDU_SESSION_TYPE_E_IPV4V6 for DNN %s"
,
...
...
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