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
a91ed1ef
Commit
a91ed1ef
authored
Jan 13, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decode N2 SM info
parent
35a96ac9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
8 deletions
+57
-8
src/api-server/impl/IndividualSMContextApiImpl.cpp
src/api-server/impl/IndividualSMContextApiImpl.cpp
+14
-2
src/api-server/model/SmContextUpdateData.cpp
src/api-server/model/SmContextUpdateData.cpp
+13
-0
src/api-server/model/SmContextUpdateData.h
src/api-server/model/SmContextUpdateData.h
+7
-3
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+20
-0
src/smf_app/smf_msg.hpp
src/smf_app/smf_msg.hpp
+3
-3
No files found.
src/api-server/impl/IndividualSMContextApiImpl.cpp
View file @
a91ed1ef
...
...
@@ -52,13 +52,25 @@ void IndividualSMContextApiImpl::update_sm_context(const std::string &smContextR
m_smf_app
->
convert_string_2_hex
(
n2_sm_information
,
n2_sm_msg_hex
);
Logger
::
smf_api_server
().
debug
(
"smContextMessage, n2 sm information %s"
,
n2_sm_information
.
c_str
());
//Step1. Decode N2 SM information into decoded ngap msg
std
::
string
n2_sm_info_type
=
smContextUpdateData
.
getN2SmInfoType
();
if
(
n2_sm_info_type
.
compare
(
"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
,
&
asn_DEF_Ngap_PDUSessionResourceSetupRequestTransfer
,
(
void
**
)
&
decoded_msg
,
n2_sm_msg_hex
,
n2_sm_msg_hex
.
length
());
if
(
rc
.
code
!=
RC_OK
)
{
Logger
::
smf_api_server
().
warn
(
"asn_decode failed %d...
\n
"
,
rc
.
code
);
}
}
/*
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/api-server/model/SmContextUpdateData.cpp
View file @
a91ed1ef
...
...
@@ -648,6 +648,18 @@ void SmContextUpdateData::unsetN2SmInfo()
{
m_N2SmInfoIsSet
=
false
;
}
std
::
string
SmContextUpdateData
::
getN2SmInfoType
()
const
{
return
m_N2SmInfoType
;
}
void
SmContextUpdateData
::
setN2SmInfoType
(
std
::
string
const
&
value
)
{
m_N2SmInfoType
=
value
;
m_N2SmInfoTypeIsSet
=
true
;
}
/*
N2SmInfoType SmContextUpdateData::getN2SmInfoType() const
{
return m_N2SmInfoType;
...
...
@@ -657,6 +669,7 @@ void SmContextUpdateData::setN2SmInfoType(N2SmInfoType const& value)
m_N2SmInfoType = value;
m_N2SmInfoTypeIsSet = true;
}
*/
bool
SmContextUpdateData
::
n2SmInfoTypeIsSet
()
const
{
return
m_N2SmInfoTypeIsSet
;
...
...
src/api-server/model/SmContextUpdateData.h
View file @
a91ed1ef
...
...
@@ -188,8 +188,11 @@ public:
/// <summary>
///
/// </summary>
N2SmInfoType
getN2SmInfoType
()
const
;
void
setN2SmInfoType
(
N2SmInfoType
const
&
value
);
//N2SmInfoType getN2SmInfoType() const;
//void setN2SmInfoType(N2SmInfoType const& value);
std
::
string
getN2SmInfoType
()
const
;
void
setN2SmInfoType
(
std
::
string
const
&
value
);
bool
n2SmInfoTypeIsSet
()
const
;
void
unsetN2SmInfoType
();
/// <summary>
...
...
@@ -356,7 +359,8 @@ protected:
bool
m_N1SmMsgIsSet
;
RefToBinaryData
m_N2SmInfo
;
bool
m_N2SmInfoIsSet
;
N2SmInfoType
m_N2SmInfoType
;
//N2SmInfoType m_N2SmInfoType;
std
::
string
m_N2SmInfoType
;
bool
m_N2SmInfoTypeIsSet
;
NgRanTargetId
m_TargetId
;
bool
m_TargetIdIsSet
;
...
...
src/smf_app/smf_app.cpp
View file @
a91ed1ef
...
...
@@ -494,6 +494,10 @@ void smf_app::handle_amf_msg (std::shared_ptr<itti_n11_update_sm_context_request
pdu_session_id_t
pdu_session_id
=
std
::
get
<
2
>
(
sm_context
);
supi64_t
supi64
=
smf_supi_to_u64
(
supi
);
//store in itti_n11_update_sm_context_request to be processed later on
smreq
->
set_supi
(
supi
);
smreq
->
set_dnn
(
dnn
);
smreq
->
set_pdu_session_id
(
pdu_session_id
);
//Step 1. get necessary information (N2 SM information)
...
...
@@ -519,6 +523,15 @@ void smf_app::handle_amf_msg (std::shared_ptr<itti_n11_update_sm_context_request
return
;
}
//get dnn context
std
::
shared_ptr
<
dnn_context
>
sd
;
if
(
!
sc
.
get
()
->
find_dnn_context
(
dnn
,
sd
))
{
if
(
nullptr
==
sd
.
get
()){
//TODO: Error, DNN context doesn't exist
}
}
//Step 3. Verify AMF??
//TODO: based on AMF ID > get the fteid -> get the SMF context (we should also verify AMF_ID)
...
...
@@ -3046,6 +3059,13 @@ int smf_app::decode_ngap_message(Ngap_NGAP_PDU_t& ngap_msg, std::string& n2_sm_i
//step 1. Decode NGAP message (for instance, ... only served as an example)
int
decoder_rc
=
RETURNok
;
//Ngap_PDUSessionResourceSetupRequestTransfer_t
// Ngap_PDUSessionResourceSetupRequestTransfer_t *decoded_msg = null;
// std::string n2_sm_info_hex; //store the n2_sm_info from AMF
//Decode N2 SM info into decoded nas msg
// asn_dec_rval_t rc = asn_decode(NULL,&asn_DEF_Ngap_PDUSessionResourceSetupRequestTransfer, (void **)&decoded_msg, n2_sm_info_hex, n2_sm_info_hex.length());
return
decoder_rc
;
}
...
...
src/smf_app/smf_msg.hpp
View file @
a91ed1ef
...
...
@@ -82,11 +82,11 @@ private:
//---------------------------------------------------------------------------------------
//for PDU session update
//see SmContextUpdateData (TS29502_Nsmf_PDUSession.yaml)
class
pdu_session_update_sm_context_request
:
public
pdu_session_msg
{
public:
pdu_session_update_sm_context_request
()
:
pdu_session_msg
(){
};
private:
//
//std::string m_Ppei;
std
::
string
m_nf_instanceId
;
oai
::
smf_server
::
model
::
Guami
m_guami
;
...
...
@@ -118,8 +118,7 @@ private:
$ref: '../TS29571_CommonData.yaml#/components/schemas/TimeZone'
addUeLocation:
$ref: '../TS29571_CommonData.yaml#/components/schemas/UserLocation'
upCnxState:
$ref: '#/components/schemas/UpCnxState'
hoState:
$ref: '#/components/schemas/HoState'
toBeSwitched:
...
...
@@ -128,6 +127,7 @@ private:
failedToBeSwitched:
type: boolean
*/
std
::
string
m_upCnx_state
;
//'#/components/schemas/UpCnxState'
oai
::
smf_server
::
model
::
RefToBinaryData
m_n1_sm_msg
;
//n1SmMsg
oai
::
smf_server
::
model
::
RefToBinaryData
m_n2_sm_info
;
//n2SmInfo
...
...
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