Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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-AMF
Commits
033c09f6
Commit
033c09f6
authored
Feb 02, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First version for suporting multiple PDU sessions
parent
008acaf7
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
225 additions
and
9 deletions
+225
-9
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+28
-0
src/amf-app/amf_app.hpp
src/amf-app/amf_app.hpp
+10
-0
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+37
-3
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+51
-5
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+11
-0
src/contexts/CMakeLists.txt
src/contexts/CMakeLists.txt
+1
-0
src/contexts/ue_context.cpp
src/contexts/ue_context.cpp
+46
-0
src/contexts/ue_context.hpp
src/contexts/ue_context.hpp
+19
-0
src/itti/msgs/itti_msg_n11.hpp
src/itti/msgs/itti_msg_n11.hpp
+2
-0
src/ngap/ngap_app/ngap_message_callback.hpp
src/ngap/ngap_app/ngap_message_callback.hpp
+11
-0
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
.../amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
+9
-1
No files found.
src/amf-app/amf_app.cpp
View file @
033c09f6
...
...
@@ -186,6 +186,34 @@ void amf_app::set_ran_amf_id_2_ue_context(
ue_ctx_key
[
ue_context_key
]
=
uc
;
}
//------------------------------------------------------------------------------
bool
amf_app
::
is_supi_2_ue_context
(
const
string
&
supi
)
const
{
std
::
shared_lock
lock
(
m_supi2ue_ctx
);
return
bool
{
supi2ue_ctx
.
count
(
supi
)
>
0
};
}
//------------------------------------------------------------------------------
std
::
shared_ptr
<
ue_context
>
amf_app
::
supi_2_ue_context
(
const
string
&
supi
)
const
{
std
::
shared_lock
lock
(
m_supi2ue_ctx
);
return
supi2ue_ctx
.
at
(
supi
);
}
//------------------------------------------------------------------------------
void
amf_app
::
set_supi_2_ue_context
(
const
string
&
supi
,
std
::
shared_ptr
<
ue_context
>&
uc
)
{
std
::
unique_lock
lock
(
m_supi2ue_ctx
);
supi2ue_ctx
[
supi
]
=
uc
;
}
bool
amf_app
::
find_pdu_session_context
(
const
string
&
supi
,
const
std
::
uint8_t
pdu_session_id
,
std
::
shared_ptr
<
pdu_session_context
>&
psc
){
if
(
!
is_supi_2_ue_context
(
supi
))
return
false
;
std
::
shared_ptr
<
ue_context
>
uc
=
{};
uc
=
supi_2_ue_context
(
supi
);
if
(
!
uc
.
get
()
->
find_pdu_session_context
(
pdu_session_id
,
psc
))
return
false
;
return
true
;
}
// ITTI handlers
//------------------------------------------------------------------------------
void
amf_app
::
handle_itti_message
(
...
...
src/amf-app/amf_app.hpp
View file @
033c09f6
...
...
@@ -68,6 +68,9 @@ class amf_app {
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
ue_context
>>
ue_ctx_key
;
mutable
std
::
shared_mutex
m_ue_ctx_key
;
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
ue_context
>>
supi2ue_ctx
;
mutable
std
::
shared_mutex
m_supi2ue_ctx
;
bool
is_amf_ue_id_2_ue_context
(
const
long
&
amf_ue_ngap_id
)
const
;
std
::
shared_ptr
<
ue_context
>
amf_ue_id_2_ue_context
(
const
long
&
amf_ue_ngap_id
)
const
;
...
...
@@ -79,6 +82,13 @@ class amf_app {
const
std
::
string
&
ue_context_key
)
const
;
void
set_ran_amf_id_2_ue_context
(
const
std
::
string
&
ue_context_key
,
std
::
shared_ptr
<
ue_context
>
uc
);
bool
is_supi_2_ue_context
(
const
string
&
supi
)
const
;
std
::
shared_ptr
<
ue_context
>
supi_2_ue_context
(
const
string
&
supi
)
const
;
void
set_supi_2_ue_context
(
const
string
&
ue_context_key
,
std
::
shared_ptr
<
ue_context
>&
uc
);
bool
find_pdu_session_context
(
const
string
&
supi
,
const
std
::
uint8_t
pdu_session_id
,
std
::
shared_ptr
<
pdu_session_context
>&
psc
);
// SMF Client response handlers
void
handle_post_sm_context_response_error_400
();
// others
...
...
src/amf-app/amf_n1.cpp
View file @
033c09f6
...
...
@@ -598,6 +598,20 @@ void amf_n1::service_request_handle(
"amf_ue_ngap_id %d, ran_ue_ngap_id %d"
,
amf_ue_ngap_id
,
ran_ue_ngap_id
);
Logger
::
amf_n1
().
debug
(
"Key for pdu session context: SUPI %s"
,
supi
.
c_str
());
std
::
shared_ptr
<
pdu_session_context
>
psc
;
/*
//TODO: get the pdu_session_context from AMF_APP based on both SUPI and PDU Session ID
string ue_context_key = "app_ue_ranid_" + to_string(ran_ue_ngap_id) +
":amfid_" + to_string(amf_ue_ngap_id);
std::shared_ptr<ue_context> uc;
uc = amf_app_inst->ran_amf_id_2_ue_context(ue_context_key);
if (uc.get() !=nullptr){
if (!uc.get()->find_pdu_session_context(pdu_session_id,psc)) {
}
}
//TO check: in which condition we should have PDU Session ID
*/
if
(
amf_n11_inst
->
is_supi_to_pdu_ctx
(
supi
))
{
psc
=
amf_n11_inst
->
supi_to_pdu_ctx
(
supi
);
if
(
!
psc
)
{
...
...
@@ -703,8 +717,7 @@ void amf_n1::registration_request_handle(
RegistrationRequest
*
regReq
=
new
RegistrationRequest
();
regReq
->
decodefrombuffer
(
nullptr
,
(
uint8_t
*
)
bdata
(
reg
),
blength
(
reg
));
bdestroy
(
reg
);
// free buffer
// Check 5gs Mobility Identity (Mandatory IE)
std
::
string
guti
;
//find UE context
string
ue_context_key
=
"app_ue_ranid_"
+
to_string
(
ran_ue_ngap_id
)
+
":amfid_"
+
to_string
(
amf_ue_ngap_id
);
std
::
shared_ptr
<
ue_context
>
uc
;
...
...
@@ -713,6 +726,8 @@ void amf_n1::registration_request_handle(
ue_context_key
.
c_str
());
uc
=
amf_app_inst
->
ran_amf_id_2_ue_context
(
ue_context_key
);
// Check 5gs Mobility Identity (Mandatory IE)
std
::
string
guti
;
uint8_t
mobility_id_type
=
regReq
->
getMobilityIdentityType
();
switch
(
mobility_id_type
)
{
case
SUCI
:
{
...
...
@@ -869,7 +884,12 @@ void amf_n1::registration_request_handle(
nc
.
get
()
->
serving_network
=
snn
;
// update UE conext
if
(
uc
.
get
()
!=
nullptr
)
uc
.
get
()
->
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
if
(
uc
.
get
()
!=
nullptr
)
{
std
::
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
uc
.
get
()
->
supi
=
supi
;
//associate SUPI with UC
amf_app_inst
->
set_supi_2_ue_context
(
supi
,
uc
);
}
// Check 5GS_Registration_type IE (Mandatory IE)
uint8_t
reg_type
;
...
...
@@ -2336,6 +2356,20 @@ void amf_n1::run_mobility_registration_update_procedure(
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n1
().
debug
(
"Key for pdu session context SUPI (%s)"
,
supi
.
c_str
());
std
::
shared_ptr
<
pdu_session_context
>
psc
;
/*
//TODO: get the pdu_session_context from AMF_APP based on both SUPI and PDU Session ID
string ue_context_key = "app_ue_ranid_" + to_string(ran_ue_ngap_id) +
":amfid_" + to_string(amf_ue_ngap_id);
std::shared_ptr<ue_context> uc;
uc = amf_app_inst->ran_amf_id_2_ue_context(ue_context_key);
if (uc.get() !=nullptr){
if (!uc.get()->find_pdu_session_context()) {
}
}
//TO check: in which condition we should have PDU Session ID
*/
if
(
amf_n11_inst
->
is_supi_to_pdu_ctx
(
supi
))
{
psc
=
amf_n11_inst
->
supi_to_pdu_ctx
(
supi
);
}
else
{
...
...
src/amf-app/amf_n11.cpp
View file @
033c09f6
...
...
@@ -33,6 +33,7 @@
#include "3gpp_ts24501.hpp"
#include "amf.hpp"
#include "amf_app.hpp"
#include "amf_config.hpp"
#include "amf_n1.hpp"
#include "itti.hpp"
...
...
@@ -44,6 +45,7 @@
#include "SMContextsCollectionApi.h"
#include "SmContextCreateData.h"
#include "mime_parser.hpp"
#include "ue_context.hpp"
extern
"C"
{
#include "dynamic_memory_check.h"
...
...
@@ -61,6 +63,7 @@ extern itti_mw* itti_inst;
extern
amf_config
amf_cfg
;
extern
amf_n11
*
amf_n11_inst
;
extern
amf_n1
*
amf_n1_inst
;
extern
amf_app
*
amf_app_inst
;
extern
void
msg_str_2_msg_hex
(
std
::
string
msg
,
bstring
&
b
);
extern
void
convert_string_2_hex
(
std
::
string
&
input
,
std
::
string
&
output
);
...
...
@@ -154,12 +157,29 @@ void amf_n11::handle_itti_message(
//------------------------------------------------------------------------------
void
amf_n11
::
handle_itti_message
(
itti_nsmf_pdusession_update_sm_context
&
itti_msg
)
{
std
::
string
supi
=
pduid2supi
.
at
(
itti_msg
.
pdu_session_id
);
string
ue_context_key
=
"app_ue_ranid_"
+
to_string
(
itti_msg
.
ran_ue_ngap_id
)
+
":amfid_"
+
to_string
(
itti_msg
.
amf_ue_ngap_id
);
std
::
shared_ptr
<
ue_context
>
uc
;
uc
=
amf_app_inst
->
ran_amf_id_2_ue_context
(
ue_context_key
);
std
::
string
supi
;
if
(
uc
.
get
()
!=
nullptr
)
{
supi
=
uc
->
supi
;
}
// std::string supi = pduid2supi.at(itti_msg.pdu_session_id);
Logger
::
amf_n11
().
debug
(
"Send PDU Session Update SM Context Request to SMF (SUPI %s, PDU Session "
"ID %d)"
,
supi
.
c_str
(),
itti_msg
.
pdu_session_id
);
std
::
shared_ptr
<
pdu_session_context
>
psc
;
if
(
!
uc
.
get
()
->
find_pdu_session_context
(
itti_msg
.
pdu_session_id
,
psc
))
{
Logger
::
amf_n11
().
error
(
"Could not find psu_session_context with SUPI %s, Failed"
,
supi
.
c_str
());
return
;
}
/*
if (is_supi_to_pdu_ctx(supi)) {
psc = supi_to_pdu_ctx(supi);
} else {
...
...
@@ -168,6 +188,8 @@ void amf_n11::handle_itti_message(
supi.c_str());
return;
}
*/
std
::
string
smf_addr
;
std
::
string
smf_api_version
;
if
(
!
psc
.
get
()
->
smf_available
)
{
...
...
@@ -219,14 +241,28 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
nc
=
amf_n1_inst
->
amf_ue_id_2_nas_context
(
smf
.
amf_ue_ngap_id
);
std
::
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
string
ue_context_key
=
"app_ue_ranid_"
+
to_string
(
nc
.
get
()
->
ran_ue_ngap_id
)
+
":amfid_"
+
to_string
(
nc
.
get
()
->
amf_ue_ngap_id
);
std
::
shared_ptr
<
ue_context
>
uc
;
Logger
::
amf_n11
().
info
(
"Find ue_context in amf_app using UE Context Key: %s"
,
ue_context_key
.
c_str
());
uc
=
amf_app_inst
->
ran_amf_id_2_ue_context
(
ue_context_key
);
std
::
shared_ptr
<
pdu_session_context
>
psc
;
if
(
is_supi_to_pdu_ctx
(
supi
))
{
psc
=
supi_to_pdu_ctx
(
supi
);
}
else
{
if
(
!
uc
.
get
()
->
find_pdu_session_context
(
smf
.
pdu_sess_id
,
psc
))
{
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
set_supi_to_pdu_ctx
(
supi
,
psc
);
uc
.
get
()
->
add_pdu_session_context
(
smf
.
pdu_sess_id
,
psc
);
}
/* //std::shared_ptr<pdu_session_context> psc;
if (is_supi_to_pdu_ctx(supi)) {
psc = supi_to_pdu_ctx(supi);
} else {
psc = std::shared_ptr<pdu_session_context>(new pdu_session_context());
set_supi_to_pdu_ctx(supi, psc);
}
*/
pduid2supi
[
smf
.
pdu_sess_id
]
=
supi
;
psc
.
get
()
->
amf_ue_ngap_id
=
nc
.
get
()
->
amf_ue_ngap_id
;
psc
.
get
()
->
ran_ue_ngap_id
=
nc
.
get
()
->
ran_ue_ngap_id
;
...
...
@@ -391,6 +427,8 @@ void amf_n11::handle_pdu_session_initial_request(
//------------------------------------------------------------------------------
void
amf_n11
::
handle_itti_message
(
itti_nsmf_pdusession_release_sm_context
&
itti_msg
)
{
//TTN: Should be replace by new mechanism to support multiple PDU sessions
//Need PDU session ID
std
::
shared_ptr
<
pdu_session_context
>
psc
=
supi_to_pdu_ctx
(
itti_msg
.
supi
);
string
smf_addr
;
std
::
string
smf_api_version
;
...
...
@@ -492,6 +530,13 @@ void amf_n11::curl_http_client(
std
::
string
body
;
std
::
shared_ptr
<
pdu_session_context
>
psc
;
//TTN: Should be replace by new mechanism to support multiple PDU sessions
if
(
!
amf_app_inst
->
find_pdu_session_context
(
supi
,
pdu_session_id
,
psc
))
{
Logger
::
amf_n11
().
warn
(
"PDU Session context for SUPI %s doesn't exit!"
,
supi
.
c_str
());
//TODO:
}
/*
if (is_supi_to_pdu_ctx(supi)) {
psc = supi_to_pdu_ctx(supi);
} else {
...
...
@@ -499,6 +544,7 @@ void amf_n11::curl_http_client(
"PDU Session context for SUPI %s doesn't exit!", supi.c_str());
// TODO:
}
*/
if
((
n1SmMsg
.
size
()
>
0
)
and
(
n2SmMsg
.
size
()
>
0
))
{
// prepare the body content for Curl
...
...
src/amf-app/amf_n2.cpp
View file @
033c09f6
...
...
@@ -687,12 +687,20 @@ void amf_n2::handle_itti_message(
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n2
().
debug
(
"SUPI (%s)"
,
supi
.
c_str
());
std
::
shared_ptr
<
pdu_session_context
>
psc
;
//TODO: REMOVE supi_to_pdu_ctx
if
(
!
amf_app_inst
->
find_pdu_session_context
(
supi
,
itti_msg
.
pdu_session_id
,
psc
)){
Logger
::
amf_n2
().
warn
(
"Cannot get pdu_session_context with SUPI (%s)"
,
supi
.
c_str
());
}
/*
if (amf_n11_inst->is_supi_to_pdu_ctx(supi)) {
psc = amf_n11_inst->supi_to_pdu_ctx(supi);
} else {
Logger::amf_n2().warn(
"Cannot get pdu_session_context with SUPI (%s)", supi.c_str());
}
*/
// item.s_nssai.sst = std::to_string(psc.get()->snssai.sST);
// item.s_nssai.sd = psc.get()->snssai.sD;
...
...
@@ -1014,8 +1022,11 @@ void amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
2
/*NCC count*/
,
(
uint8_t
*
)
bdata
(
knh_bs
));
// handoverrequest->setSourceToTarget_TransparentContainer(sourceTotarget);
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
//TODO: REMOVE supi_to_pdu_ctx (need PDU Session ID)/ list of PDU Session ID
std
::
shared_ptr
<
pdu_session_context
>
psc
=
amf_n11_inst
->
supi_to_pdu_ctx
(
supi
);
std
::
vector
<
PDUSessionResourceSetupRequestItem_t
>
list
;
PDUSessionResourceSetupRequestItem_t
item
;
item
.
pduSessionId
=
psc
.
get
()
->
pdu_session_id
;
...
...
src/contexts/CMakeLists.txt
View file @
033c09f6
...
...
@@ -40,5 +40,6 @@ add_library (CONTEXTS STATIC
${
CMAKE_CURRENT_SOURCE_DIR
}
/gNB_context.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/nas_context.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/pdu_session_context.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/ue_context.cpp
)
src/contexts/ue_context.cpp
0 → 100644
View file @
033c09f6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "ue_context.hpp"
//------------------------------------------------------------------------------
ue_context
::
ue_context
()
{}
//------------------------------------------------------------------------------
bool
ue_context
::
find_pdu_session_context
(
const
std
::
uint8_t
&
session_id
,
std
::
shared_ptr
<
pdu_session_context
>&
context
)
const
{
std
::
shared_lock
lock
(
m_pdu_session
);
if
(
pdu_sessions
.
count
(
session_id
)
>
0
)
{
context
=
pdu_sessions
.
at
(
session_id
);
return
true
;
}
else
{
return
false
;
}
}
//------------------------------------------------------------------------------
void
ue_context
::
add_pdu_session_context
(
const
std
::
uint8_t
&
session_id
,
const
std
::
shared_ptr
<
pdu_session_context
>&
context
)
{
std
::
unique_lock
lock
(
m_pdu_session
);
pdu_sessions
[
session_id
]
=
context
;
}
src/contexts/ue_context.hpp
View file @
033c09f6
...
...
@@ -30,8 +30,13 @@
#define _UE_CONTEXT_H_
#include <stdint.h>
#include <map>
#include <memory>
#include <mutex>
#include <shared_mutex>
#include "NgapIEsStruct.hpp"
#include "pdu_session_context.hpp"
extern
"C"
{
#include "Ngap_RRCEstablishmentCause.h"
...
...
@@ -40,6 +45,16 @@ extern "C" {
using
namespace
ngap
;
class
ue_context
{
public:
ue_context
();
virtual
~
ue_context
(){};
bool
find_pdu_session_context
(
const
std
::
uint8_t
&
session_id
,
std
::
shared_ptr
<
pdu_session_context
>&
context
)
const
;
void
add_pdu_session_context
(
const
std
::
uint8_t
&
session_id
,
const
std
::
shared_ptr
<
pdu_session_context
>&
context
);
public:
uint32_t
ran_ue_ngap_id
;
// 32bits
long
amf_ue_ngap_id
:
40
;
// 40bits
...
...
@@ -49,6 +64,10 @@ class ue_context {
NrCgi_t
cgi
;
Tai_t
tai
;
std
::
string
supi
;
// pdu session id <-> pdu_session_contex: map stores all pdu sessions for this
// UE
std
::
map
<
std
::
uint8_t
,
std
::
shared_ptr
<
pdu_session_context
>>
pdu_sessions
;
mutable
std
::
shared_mutex
m_pdu_session
;
};
#endif
src/itti/msgs/itti_msg_n11.hpp
View file @
033c09f6
...
...
@@ -76,6 +76,8 @@ class itti_nsmf_pdusession_update_sm_context : public itti_msg_n11 {
bstring
n2sm
;
bool
is_n2sm_set
;
std
::
string
n2sm_info_type
;
uint32_t
ran_ue_ngap_id
;
long
amf_ue_ngap_id
;
};
class
itti_nsmf_pdusession_release_sm_context
:
public
itti_msg_n11
{
...
...
src/ngap/ngap_app/ngap_message_callback.hpp
View file @
033c09f6
...
...
@@ -167,6 +167,9 @@ int ngap_amf_handle_initial_context_setup_response(
itti_msg
->
n2sm
=
n2sm
;
itti_msg
->
is_n2sm_set
=
true
;
itti_msg
->
n2sm_info_type
=
"PDU_RES_SETUP_RSP"
;
itti_msg
->
amf_ue_ngap_id
=
initCtxResp
->
getAmfUeNgapId
();
itti_msg
->
ran_ue_ngap_id
=
initCtxResp
->
getRanUeNgapId
();
std
::
shared_ptr
<
itti_nsmf_pdusession_update_sm_context
>
i
=
std
::
shared_ptr
<
itti_nsmf_pdusession_update_sm_context
>
(
itti_msg
);
int
ret
=
itti_inst
->
send_msg
(
i
);
...
...
@@ -282,6 +285,8 @@ int ngap_amf_handle_pdu_session_resource_release_response(
itti_msg
->
n2sm
=
n2sm
;
itti_msg
->
is_n2sm_set
=
true
;
itti_msg
->
n2sm_info_type
=
"PDU_RES_REL_RSP"
;
itti_msg
->
amf_ue_ngap_id
=
pduresp
->
getAmfUeNgapId
();
itti_msg
->
ran_ue_ngap_id
=
pduresp
->
getRanUeNgapId
();
std
::
shared_ptr
<
itti_nsmf_pdusession_update_sm_context
>
i
=
std
::
shared_ptr
<
itti_nsmf_pdusession_update_sm_context
>
(
itti_msg
);
...
...
@@ -312,6 +317,7 @@ int ngap_amf_handle_pdu_session_resource_setup_response(
"Decoding PduSessionResourceSetupResponseMsg getPduSessionResourceSetupResponseList IE error"
);
return
-
1
;
}
else
{
//TODO: for multiple PDU Sessions
uint8_t
transferIe
[
500
];
memcpy
(
transferIe
,
list
[
0
].
pduSessionResourceSetupResponseTransfer
.
buf
,
list
[
0
].
pduSessionResourceSetupResponseTransfer
.
size
);
...
...
@@ -327,6 +333,9 @@ int ngap_amf_handle_pdu_session_resource_setup_response(
itti_msg
->
n2sm
=
n2sm
;
itti_msg
->
is_n2sm_set
=
true
;
itti_msg
->
n2sm_info_type
=
"PDU_RES_SETUP_RSP"
;
itti_msg
->
amf_ue_ngap_id
=
pduresp
->
getAmfUeNgapId
();
itti_msg
->
ran_ue_ngap_id
=
pduresp
->
getRanUeNgapId
();
std
::
shared_ptr
<
itti_nsmf_pdusession_update_sm_context
>
i
=
std
::
shared_ptr
<
itti_nsmf_pdusession_update_sm_context
>
(
itti_msg
);
int
ret
=
itti_inst
->
send_msg
(
i
);
...
...
@@ -337,6 +346,8 @@ int ngap_amf_handle_pdu_session_resource_setup_response(
}
return
0
;
}
//TTN: Should be removed
std
::
vector
<
PDUSessionResourceFailedToSetupItem_t
>
list_fail
;
if
(
!
pduresp
->
getPduSessionResourceFailedToSetupList
(
list_fail
))
{
Logger
::
ngap
().
error
(
...
...
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
View file @
033c09f6
...
...
@@ -13,6 +13,7 @@
#include "N1N2MessageCollectionDocumentApiImpl.h"
#include "itti.hpp"
#include "amf_app.hpp"
#include "amf_n11.hpp"
#include "pdu_session_context.hpp"
using
namespace
amf_application
;
...
...
@@ -22,6 +23,7 @@ extern void msg_str_2_msg_hex(std::string msg, bstring &b);
extern
void
convert_string_2_hex
(
std
::
string
&
input
,
std
::
string
&
output
);
extern
itti_mw
*
itti_inst
;
extern
amf_n11
*
amf_n11_inst
;
extern
amf_app
*
amf_app_inst
;
extern
void
print_buffer
(
const
std
::
string
app
,
const
std
::
string
commit
,
uint8_t
*
buf
,
int
len
);
namespace
oai
{
...
...
@@ -55,12 +57,18 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(const std::str
std
::
string
supi
=
ueContextId
;
Logger
::
amf_server
().
debug
(
"Key for PDU Session context: SUPI (%s)"
,
supi
.
c_str
());
std
::
shared_ptr
<
pdu_session_context
>
psc
;
//TODO: REMOVE supi_to_pdu_ctx
if
(
!
amf_app_inst
->
find_pdu_session_context
(
supi
,
(
uint8_t
)
n1N2MessageTransferReqData
.
getPduSessionId
(),
psc
)){
Logger
::
amf_server
().
error
(
"Cannot get pdu_session_context with SUPI (%s)"
,
supi
.
c_str
());
}
/*
if(amf_n11_inst->is_supi_to_pdu_ctx(supi)){
psc = amf_n11_inst->supi_to_pdu_ctx(supi);
}else{
Logger::amf_server().error("Cannot get pdu_session_context with SUPI (%s)", supi.c_str());
}
*/
bstring
n1sm
;
msg_str_2_msg_hex
(
n1sm_str
.
substr
(
0
,
n1sm_str
.
length
()),
n1sm
);
//TODO: verify n1sm_length
...
...
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