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
1c0a44e5
Commit
1c0a44e5
authored
Jan 25, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for bstring
parent
c3107524
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
src/common/utils/string.cpp
src/common/utils/string.cpp
+2
-8
src/nas/ies/PDUAddress.c
src/nas/ies/PDUAddress.c
+3
-1
src/smf_app/smf_n1.cpp
src/smf_app/smf_n1.cpp
+4
-1
No files found.
src/common/utils/string.cpp
View file @
1c0a44e5
...
...
@@ -94,19 +94,13 @@ void util::ipv4_to_bstring(struct in_addr ipv4_address, bstring str) {
bitstream_addr
[
2
]
=
(
uint8_t
)(((
ipv4_address
.
s_addr
)
&
0x00ff0000
)
>>
16
);
bitstream_addr
[
3
]
=
(
uint8_t
)(((
ipv4_address
.
s_addr
)
&
0xff000000
)
>>
24
);
str
=
bfromcstralloc
(
4
,
"
\0
"
);
//
str = bfromcstralloc(4, "\0");
str
->
slen
=
4
;
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 = bfromcstralloc(str.length(), "\0");
bstr
->
slen
=
str
.
length
();
memcpy
((
void
*
)
bstr
->
data
,
(
void
*
)
str
.
c_str
(),
str
.
length
());
/*
std::string s(
(char *)bstr->data,
bstr->slen);
Logger::nrf_app().debug("Str %s", s.c_str());
*/
}
src/nas/ies/PDUAddress.c
View file @
1c0a44e5
...
...
@@ -59,7 +59,9 @@ int encode_pdu_address(
encoded
+=
encode_result
;
// set length
*
(
uint8_t
*
)
(
lenPtr
)
=
encoded
-
len_pos
;
uint16_t
temp
=
0
;
//*(uint8_t*) (lenPtr) = encoded - len_pos;
ENCODE_U8
(
lenPtr
,
encoded
-
len_pos
,
temp
);
return
encoded
;
}
...
...
src/smf_app/smf_n1.cpp
View file @
1c0a44e5
...
...
@@ -152,7 +152,7 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
return
false
;
}
sm_msg
->
pdu_session_establishment_accept
.
presence
=
0x
018b
;
sm_msg
->
pdu_session_establishment_accept
.
presence
=
0x
ff
;
sm_msg
->
pdu_session_establishment_accept
.
_5gsmcause
=
static_cast
<
uint8_t
>
(
sm_cause
);
Logger
::
smf_n1
().
debug
(
...
...
@@ -160,6 +160,8 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
// PDUAddress
paa_t
paa
=
sm_context_res
.
get_paa
();
sm_msg
->
pdu_session_establishment_accept
.
pduaddress
.
pdu_address_information
=
bfromcstralloc
(
4
,
"
\0
"
);
util
::
ipv4_to_bstring
(
paa
.
ipv4_address
,
sm_msg
->
pdu_session_establishment_accept
.
pduaddress
.
pdu_address_information
);
...
...
@@ -226,6 +228,7 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
.
extendedprotocolconfigurationoptions
);
// DNN
sm_msg
->
pdu_session_establishment_accept
.
dnn
=
bfromcstralloc
(
sm_context_res
.
get_dnn
().
length
(),
"
\0
"
);
util
::
string_to_bstring
(
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