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
fcacd1fb
Commit
fcacd1fb
authored
Mar 09, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix dnn encoding
parent
2be016a7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
src/common/utils/string.cpp
src/common/utils/string.cpp
+6
-0
src/common/utils/string.hpp
src/common/utils/string.hpp
+1
-0
src/smf_app/smf_n1.cpp
src/smf_app/smf_n1.cpp
+2
-2
No files found.
src/common/utils/string.cpp
View file @
fcacd1fb
...
...
@@ -144,3 +144,9 @@ void util::string_to_bstring(const std::string& str, bstring bstr) {
bstr
->
slen
=
str
.
length
();
memcpy
((
void
*
)
bstr
->
data
,
(
void
*
)
str
.
c_str
(),
str
.
length
());
}
void
util
::
string_to_dnn
(
const
std
::
string
&
str
,
bstring
bstr
)
{
std
::
string
tmp
=
std
::
to_string
(
str
.
length
())
+
str
;
bstr
->
slen
=
tmp
.
length
();
memcpy
((
void
*
)
bstr
->
data
,
(
void
*
)
tmp
.
c_str
(),
tmp
.
length
());
}
src/common/utils/string.hpp
View file @
fcacd1fb
...
...
@@ -61,5 +61,6 @@ void ipv4v6_to_pdu_address_information(
struct
in_addr
ipv4_address
,
struct
in6_addr
ipv6_address
,
bstring
str
);
void
string_to_bstring
(
const
std
::
string
&
str
,
bstring
bstr
);
void
string_to_dnn
(
const
std
::
string
&
str
,
bstring
bstr
);
}
// namespace util
#endif
src/smf_app/smf_n1.cpp
View file @
fcacd1fb
...
...
@@ -250,8 +250,8 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
// DNN
sm_msg
->
pdu_session_establishment_accept
.
dnn
=
bfromcstralloc
(
sm_context_res
.
get_dnn
().
length
(),
"
\0
"
);
util
::
string_to_
bstring
(
bfromcstralloc
(
sm_context_res
.
get_dnn
().
length
()
+
1
,
"
\0
"
);
util
::
string_to_
dnn
(
sm_context_res
.
get_dnn
(),
sm_msg
->
pdu_session_establishment_accept
.
dnn
);
Logger
::
smf_n1
().
debug
(
"DNN %s"
,
sm_context_res
.
get_dnn
().
c_str
());
...
...
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