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
37d62bf0
Commit
37d62bf0
authored
Oct 11, 2019
by
yunshou-yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update SM src/api-server/impl/SMContextsCollectionApiImpl.cpp -- data
parent
4c4a820c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
src/api-server/impl/SMContextsCollectionApiImpl.cpp
src/api-server/impl/SMContextsCollectionApiImpl.cpp
+9
-3
No files found.
src/api-server/impl/SMContextsCollectionApiImpl.cpp
View file @
37d62bf0
...
@@ -44,16 +44,19 @@ void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smCon
...
@@ -44,16 +44,19 @@ void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smCon
nas_message_t
decoded_nas_msg
;
nas_message_t
decoded_nas_msg
;
memset
(
&
decoded_nas_msg
,
0
,
sizeof
(
nas_message_t
));
memset
(
&
decoded_nas_msg
,
0
,
sizeof
(
nas_message_t
));
int
decoder_rc
=
RETURNok
;
int
decoder_rc
=
RETURNok
;
unsigned
char
data
[
100
]
=
{
'\0'
};
//hardcoded for the moment
//
unsigned char data[100] = {'\0'}; //hardcoded for the moment
SmContextCreateData
smContextCreateData
=
smContextMessage
.
getJsonData
();
SmContextCreateData
smContextCreateData
=
smContextMessage
.
getJsonData
();
std
::
string
n1SmMessage
=
smContextMessage
.
getBinaryDataN1SmMessage
();
std
::
string
n1SmMessage
=
smContextMessage
.
getBinaryDataN1SmMessage
();
unsigned
int
n1SmMsgLen
=
strlen
(
n1SmMessage
.
c_str
());
unsigned
char
*
data
=
(
unsigned
char
*
)
malloc
(
n1SmMsgLen
+
1
);
//hardcoded for the moment
//Decode and process nas message
//Decode and process nas message
//bsafe (disable temporarily warning for strncpy)
//bsafe (disable temporarily warning for strncpy)
//std::strncpy((char *)data, n1SmMessage.c_str(), sizeof(data));
//std::strncpy((char *)data, n1SmMessage.c_str(), sizeof(data));
memcpy
((
void
*
)
data
,
(
void
*
)
n1SmMessage
.
c_str
(),
strlen
(
n1SmMessage
.
c_str
())
);
memcpy
((
void
*
)
data
,
(
void
*
)
n1SmMessage
.
c_str
(),
n1SmMsgLen
);
//establishment_request(data);
//establishment_request(data);
//use a temporary security mechanism
//use a temporary security mechanism
...
@@ -67,7 +70,10 @@ void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smCon
...
@@ -67,7 +70,10 @@ void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smCon
//decode the NAS message (using NAS lib)
//decode the NAS message (using NAS lib)
// comment to fix a unknown bug
// comment to fix a unknown bug
decoder_rc
=
nas_message_decode
(
data
,
&
decoded_nas_msg
,
sizeof
(
data
),
security
,
&
decode_status
);
decoder_rc
=
nas_message_decode
(
data
,
&
decoded_nas_msg
,
n1SmMsgLen
,
security
,
&
decode_status
);
free
(
data
);
data
=
NULL
;
Logger
::
smf_api_server
().
debug
(
"nas header decode extended_protocol_discriminator %d, security_header_type:%d,sequence_number:%d,message_authentication_code:%d
\n
"
,
Logger
::
smf_api_server
().
debug
(
"nas header decode extended_protocol_discriminator %d, security_header_type:%d,sequence_number:%d,message_authentication_code:%d
\n
"
,
decoded_nas_msg
.
header
.
extended_protocol_discriminator
,
decoded_nas_msg
.
header
.
extended_protocol_discriminator
,
...
...
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