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
7fd421ee
Commit
7fd421ee
authored
Jan 14, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue for decode N2 sm info
parent
61f246d6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
19 deletions
+62
-19
build/scripts/build_helper.smf
build/scripts/build_helper.smf
+2
-2
src/api-server/api/SMContextsCollectionApi.cpp
src/api-server/api/SMContextsCollectionApi.cpp
+1
-1
src/api-server/impl/IndividualSMContextApiImpl.cpp
src/api-server/impl/IndividualSMContextApiImpl.cpp
+5
-14
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+0
-1
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+28
-1
src/smf_app/smf_msg.cpp
src/smf_app/smf_msg.cpp
+20
-0
src/smf_app/smf_msg.hpp
src/smf_app/smf_msg.hpp
+6
-0
No files found.
build/scripts/build_helper.smf
View file @
7fd421ee
...
...
@@ -320,8 +320,8 @@ check_install_smf_deps() {
ret=$?;[[ $ret -ne 0 ]] && return $ret
# Use fmt lib included in spdlog
#
install_fmt $1
#
ret=$?;[[ $ret -ne 0 ]] && return $ret
install_fmt $1
ret=$?;[[ $ret -ne 0 ]] && return $ret
install_fb_folly_from_source $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret
...
...
src/api-server/api/SMContextsCollectionApi.cpp
View file @
7fd421ee
...
...
@@ -41,7 +41,7 @@ void SMContextsCollectionApi::post_sm_contexts_handler(const Pistache::Rest::Req
// Getting the body param
std
::
cout
<<
"received a SM context create request"
<<
std
::
endl
;
std
::
cout
<<
"received a SM context create request"
<<
request
.
body
()
<<
std
::
endl
;
SmContextMessage
smContextMessage
;
try
{
...
...
src/api-server/impl/IndividualSMContextApiImpl.cpp
View file @
7fd421ee
...
...
@@ -13,7 +13,6 @@
#include "IndividualSMContextApiImpl.h"
extern
"C"
{
#include "Ngap_NGAP-PDU.h"
#include "Ngap_PDUSessionResourceSetupRequestTransfer.h"
}
namespace
oai
{
namespace
smf_server
{
...
...
@@ -55,27 +54,19 @@ void IndividualSMContextApiImpl::update_sm_context(const std::string &smContextR
std
::
string
n2_sm_info_type
=
smContextUpdateData
.
getN2SmInfoType
();
//Temps: decode Ngap_PDUSessionResourceSetupRequestTransfer
if
(
n2_sm_info_type
.
compare
(
n2_sm_info_type_e2str
[
PDU_RES_SETUP_REQ
])
==
0
){
Ngap_PDUSessionResourceSetupRequestTransfer_t
*
decoded_msg
=
NULL
;
//Decode N2 SM info into decoded nas msg
asn_dec_rval_t
rc
=
asn_decode
(
NULL
,
ATS_ALIGNED_CANONICAL_PER
,
&
asn_DEF_Ngap_PDUSessionResourceSetupRequestTransfer
,
(
void
**
)
&
decoded_msg
,
(
void
*
)
n2_sm_msg_hex
.
c_str
(),
n2_sm_msg_hex
.
length
());
if
(
rc
.
code
!=
RC_OK
)
{
Logger
::
smf_api_server
().
warn
(
"asn_decode failed %d...
\n
"
,
rc
.
code
);
//TODO: send error to AMF??
}
sm_context_req_msg
.
set_n2_sm_information
(
n2_sm_msg_hex
);
sm_context_req_msg
.
set_n2_sm_info_type
(
n2_sm_info_type
);
}
/*
/*
// do it from SMF_APP
int decoder_rc = m_smf_app->decode_ngap_message(decoded_ngap_msg, n2_sm_msg_hex);
if (decoder_rc != RETURNok) {
//TODO: error, should send reply to AMF with error code!!
}
*/
*/
//Step 2. TODO: initialize necessary values for sm context req from smContextUpdateData
//Step 3. Handle the itti_n11_update_sm_context_request message in smf_app
...
...
src/smf_app/smf_app.cpp
View file @
7fd421ee
...
...
@@ -499,7 +499,6 @@ void smf_app::handle_amf_msg (std::shared_ptr<itti_n11_update_sm_context_request
smreq
->
req
.
set_dnn
(
dnn
);
smreq
->
req
.
set_pdu_session_id
(
pdu_session_id
);
//Step 1. get necessary information (N2 SM information)
//Step 2. find the smf context
std
::
shared_ptr
<
smf_context
>
sc
;
...
...
src/smf_app/smf_context.cpp
View file @
7fd421ee
...
...
@@ -38,7 +38,9 @@
#include "3gpp_24.501.h"
#include "SmContextCreatedData.h"
#include <algorithm>
extern
"C"
{
#include "Ngap_PDUSessionResourceSetupResponseTransfer.h"
}
using
namespace
smf
;
extern
itti_mw
*
itti_inst
;
...
...
@@ -620,6 +622,31 @@ void smf_context::handle_amf_msg (std::shared_ptr<itti_n11_update_sm_context_req
Logger
::
smf_app
().
info
(
"Handle a PDU Session Update SM Context Request message from AMF"
);
pdu_session_update_sm_context_request
sm_context_req_msg
=
smreq
->
req
;
//Step 1. get necessary information (N2 SM information)
std
::
string
n2_sm_info_type
=
smreq
->
req
.
get_n2_sm_info_type
();
std
::
string
n2_sm_infomation
=
smreq
->
req
.
get_n2_sm_information
();
//decode Ngap_PDUSessionResourceSetupResponseTransfer
if
(
n2_sm_info_type
.
compare
(
n2_sm_info_type_e2str
[
PDU_RES_SETUP_RSP
])
==
0
){
Ngap_PDUSessionResourceSetupResponseTransfer_t
*
decoded_msg
=
NULL
;
//Decode N2 SM info into decoded nas msg
asn_dec_rval_t
rc
=
asn_decode
(
NULL
,
ATS_ALIGNED_CANONICAL_PER
,
&
asn_DEF_Ngap_PDUSessionResourceSetupResponseTransfer
,
(
void
**
)
&
decoded_msg
,
(
void
*
)
n2_sm_infomation
.
c_str
(),
n2_sm_infomation
.
length
());
if
(
rc
.
code
!=
RC_OK
)
{
Logger
::
smf_api_server
().
warn
(
"asn_decode failed %d...
\n
"
,
rc
.
code
);
//TODO: send error to AMF??
}
// Ngap_QosFlowPerTNLInformation_t qosFlowPerTNLInformation;
// struct Ngap_QosFlowPerTNLInformation *additionalQosFlowPerTNLInformation; /* OPTIONAL */
// struct Ngap_SecurityResult *securityResult; /* OPTIONAL */
// struct Ngap_QosFlowList *qosFlowFailedToSetupList; /* OPTIONAL */
// struct Ngap_ProtocolExtensionContainer *iE_Extensions; /* OPTIONAL */
}
//TODO:
//get dnn context
//get SMF PDU Session context
...
...
src/smf_app/smf_msg.cpp
View file @
7fd421ee
...
...
@@ -237,3 +237,23 @@ void pdu_session_create_sm_context_response::set_qos_flow_context(const qos_flow
qos_flow_context
=
qos_flow
;
}
/* pdu_session_update_sm_context_request */
std
::
string
pdu_session_update_sm_context_request
::
get_n2_sm_information
()
const
{
return
n2_sm_information
;
}
void
pdu_session_update_sm_context_request
::
set_n2_sm_information
(
std
::
string
const
&
value
){
n2_sm_information
=
value
;
}
std
::
string
pdu_session_update_sm_context_request
::
get_n2_sm_info_type
()
const
{
return
n2_sm_info_type
;
}
void
pdu_session_update_sm_context_request
::
set_n2_sm_info_type
(
std
::
string
const
&
value
){
n2_sm_info_type
=
value
;
}
src/smf_app/smf_msg.hpp
View file @
7fd421ee
...
...
@@ -86,7 +86,13 @@ private:
class
pdu_session_update_sm_context_request
:
public
pdu_session_msg
{
public:
pdu_session_update_sm_context_request
()
:
pdu_session_msg
(){
};
std
::
string
get_n2_sm_information
()
const
;
void
set_n2_sm_information
(
std
::
string
const
&
value
);
std
::
string
get_n2_sm_info_type
()
const
;
void
set_n2_sm_info_type
(
std
::
string
const
&
value
);
private:
std
::
string
n2_sm_information
;
std
::
string
n2_sm_info_type
;
//std::string m_Ppei;
std
::
string
m_nf_instanceId
;
oai
::
smf_server
::
model
::
Guami
m_guami
;
...
...
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