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
fcc61f82
Commit
fcc61f82
authored
Mar 25, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dotted_dnn' into 'develop'
Fix issue with dotted dnn See merge request oai/cn5g/oai-cn5g-smf!57
parents
7c5fbe3a
9e6a455c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-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
+5
-0
No files found.
src/common/utils/string.cpp
View file @
fcc61f82
...
...
@@ -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 @
fcc61f82
...
...
@@ -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 @
fcc61f82
...
...
@@ -868,6 +868,11 @@ 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
;
// update DNN
smreq
->
req
.
set_dnn
(
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