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
efd3bff2
Commit
efd3bff2
authored
Mar 25, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for dnn with dot
parent
7c5fbe3a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
src/common/utils/string.cpp
src/common/utils/string.cpp
+24
-0
src/common/utils/string.hpp
src/common/utils/string.hpp
+1
-0
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+3
-0
No files found.
src/common/utils/string.cpp
View file @
efd3bff2
...
...
@@ -173,6 +173,30 @@ bool util::string_to_dotted(const std::string& str, std::string& dotted) {
return
true
;
};
bool
util
::
dotted_to_string
(
const
std
::
string
&
dot
,
std
::
string
&
no_dot
)
{
// uint8_t should be enough, but uint16 if length > 255.
uint16_t
offset
=
0
;
bool
result
=
true
;
no_dot
=
{};
while
(
offset
<
dot
.
length
())
{
if
(
dot
[
offset
]
<
64
)
{
if
((
offset
+
dot
[
offset
])
<=
dot
.
length
())
{
if
(
offset
)
{
no_dot
.
push_back
(
'.'
);
}
no_dot
.
append
(
&
dot
[
offset
+
1
],
dot
[
offset
]);
}
offset
=
offset
+
1
+
dot
[
offset
];
}
else
{
// should not happen, consume bytes
no_dot
.
push_back
(
dot
[
offset
++
]);
result
=
false
;
}
}
return
result
;
};
void
util
::
string_to_dnn
(
const
std
::
string
&
str
,
bstring
bstr
)
{
bstr
->
slen
=
str
.
length
();
memcpy
((
void
*
)
bstr
->
data
,
(
void
*
)
str
.
c_str
(),
str
.
length
());
...
...
src/common/utils/string.hpp
View file @
efd3bff2
...
...
@@ -62,6 +62,7 @@ void ipv4v6_to_pdu_address_information(
void
string_to_bstring
(
const
std
::
string
&
str
,
bstring
bstr
);
bool
string_to_dotted
(
const
std
::
string
&
str
,
std
::
string
&
dotted
);
bool
dotted_to_string
(
const
std
::
string
&
dot
,
std
::
string
&
no_dot
);
void
string_to_dnn
(
const
std
::
string
&
str
,
bstring
bstr
);
}
// namespace util
#endif
src/smf_app/smf_app.cpp
View file @
efd3bff2
...
...
@@ -868,6 +868,9 @@ void smf_app::handle_pdu_session_create_sm_context_request(
// authorization by the external DN
// Step 3. check if the DNN requested is valid
std
::
string
nd_dnn
;
util
::
dotted_to_string
(
dnn
,
nd_dnn
);
dnn
=
nd_dnn
;
if
(
not
smf_cfg
.
is_dotted_dnn_handled
(
dnn
,
pdu_session_type
))
{
// Not a valid request...
Logger
::
smf_app
().
warn
(
...
...
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