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
b621e54d
Commit
b621e54d
authored
Jul 01, 2021
by
liuyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
can storage in udsf and cpe can software network
parent
6fd4a8a4
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
868 additions
and
137 deletions
+868
-137
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+305
-33
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+66
-50
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+25
-22
src/contexts/gNB_context.cpp
src/contexts/gNB_context.cpp
+32
-1
src/contexts/gNB_context.hpp
src/contexts/gNB_context.hpp
+1
-0
src/contexts/pdu_session_context.cpp
src/contexts/pdu_session_context.cpp
+383
-3
src/contexts/pdu_session_context.hpp
src/contexts/pdu_session_context.hpp
+21
-1
src/contexts/ue_context.cpp
src/contexts/ue_context.cpp
+7
-4
src/ngap/ngap_app/ngap_message_callback.hpp
src/ngap/ngap_app/ngap_message_callback.hpp
+8
-5
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
.../amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
+10
-9
src/sbi/amf_server/impl/TestSignallingApiImpl.cpp
src/sbi/amf_server/impl/TestSignallingApiImpl.cpp
+8
-8
src/utils/http_multi_parser.cpp
src/utils/http_multi_parser.cpp
+0
-1
src/utils/mime_parser.cpp
src/utils/mime_parser.cpp
+2
-0
No files found.
src/amf-app/amf_n1.cpp
View file @
b621e54d
This diff is collapsed.
Click to expand it.
src/amf-app/amf_n11.cpp
View file @
b621e54d
This diff is collapsed.
Click to expand it.
src/amf-app/amf_n2.cpp
View file @
b621e54d
...
...
@@ -461,7 +461,7 @@ void amf_n2::handle_itti_message(itti_ng_setup_request& itti_msg) {
{{
"Content-ID"
,
"ng_state"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
to_string
(
gc
.
get
()
->
ng_state
)}},
{{
"Content-ID"
,
"globalRanNodeId"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
to_string
(
gc
->
globalRanNodeId
)}},
{{
"Content-ID"
,
"gnb_name"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
gc
->
gnb_name
}},
{{
"Content-ID"
,
"ue_radio_cap_ind"
},{
"Content-Type"
,
"varchar(
32
)"
},{
"content"
,
ue_radio_cap_ind
}},
{{
"Content-ID"
,
"ue_radio_cap_ind"
},{
"Content-Type"
,
"varchar(
1024
)"
},{
"content"
,
ue_radio_cap_ind
}},
{{
"Content-ID"
,
"mcc"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
gnbItem
.
mcc
}},
{{
"Content-ID"
,
"mnc"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
gnbItem
.
mnc
}},
{{
"Content-ID"
,
"tac"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
to_string
(
gnbItem
.
tac
)}}
...
...
@@ -544,7 +544,7 @@ bool amf_n2::curl_http_client_udsf(std::string remoteUrl,std::string jsonData,st
udsf_response
=
nlohmann
::
json
::
parse
(
response
);
//Logger::amf_n2().debug("Get response with jsonData: %s", response_data.dump().c_str());
}
catch
(
nlohmann
::
json
::
exception
&
e
)
{
Logger
::
amf_n11
().
warn
(
"Could not get Json content from the response"
);
Logger
::
amf_n11
().
warn
(
"Could not get Json content from
usdf
the response"
);
}
curl_slist_free_all
(
headers
);
curl_easy_cleanup
(
curl
);
...
...
@@ -999,11 +999,13 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
//bstring n2sm = itti_msg.n2sm;
if
(
blength
(
itti_msg
.
n2sm
)
!=
0
)
{
Logger
::
amf_n2
().
debug
(
"*** test into itti_msg.n2sm ***"
);
item
.
pduSessionResourceSetupRequestTransfer
.
buf
=
(
uint8_t
*
)
bdata
(
itti_msg
.
n2sm
);
Logger
::
amf_n2
().
debug
(
"*** test into item.pduSessionResourceSetupRequestTransfer.buf ***"
);
item
.
pduSessionResourceSetupRequestTransfer
.
size
=
blength
(
itti_msg
.
n2sm
);
item
.
pduSessionResourceSetupRequestTransfer
.
buf
=
(
uint8_t
*
)
bdata
(
itti_msg
.
n2sm
);
Logger
::
amf_n2
().
debug
(
"*** test into item.pduSessionResourceSetupRequestTransfer.buf ***"
);
string
ssaa
;
octet_stream_2_hex_stream
((
uint8_t
*
)
bdata
(
itti_msg
.
n2sm
),
blength
(
itti_msg
.
n2sm
),
ssaa
);
printf
(
"----service accept n2sm ----------------(%s)
\n
"
,
ssaa
.
c_str
());
item
.
pduSessionResourceSetupRequestTransfer
.
size
=
blength
(
itti_msg
.
n2sm
);
}
else
{
Logger
::
amf_n2
().
error
(
"n2sm empty!"
);
}
...
...
@@ -1093,19 +1095,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
;
//
std::shared_ptr<pdu_session_context> psc;
std
::
shared_ptr
<
pdu_session_context
>
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
//***************************stateless
pdu_session_context
*
psc1
=
new
pdu_session_context
();
// nlohmann::json udsf_response;
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
supi
;
if
(
!
amf_n2_inst
->
curl_http_client_udsf
(
udsf_url
,
""
,
"GET"
,
udsf_response
)){
Logger
::
amf_n2
().
error
(
"No existing pdu_session_context with assoc_id "
);
return
;
}
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
psc1
->
pdu_session_context_from_json
(
udsf_response
);
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
psc1
);
else
{
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
psc
.
get
()
->
pdu_session_context_from_json
(
udsf_response
);
// psc = std::shared_ptr<pdu_session_context>(psc1);
}
//***************************stateless
// if (amf_n11_inst->is_supi_to_pdu_ctx(supi))
...
...
@@ -1347,10 +1350,9 @@ void amf_n2::handle_itti_message(
{
"from_nf_ID"
,
nlohmann
::
json
::
array
({
"AMF_1234"
})}
}
;
udsf_gnb_update_context
[
"blocks"
]
=
nlohmann
::
json
::
array
({
{{
"Content-ID"
,
"ue_radio_cap_ind"
},{
"Content-Type"
,
"varchar(
32
)"
},{
"content"
,
ue_radio_cap_ind
}}
{{
"Content-ID"
,
"ue_radio_cap_ind"
},{
"Content-Type"
,
"varchar(
1024
)"
},{
"content"
,
ue_radio_cap_ind
}}
});
std
::
string
json_part
=
udsf_gnb_update_context
.
dump
();
amf_n2_inst
->
curl_http_client_udsf
(
udsf_update_url
,
json_part
,
"PUT"
,
udsf_response
);
amf_n2_inst
->
curl_http_client_udsf
(
udsf_update_url
,
udsf_gnb_update_context
.
dump
(),
"PUT"
,
udsf_response
);
}
...
...
@@ -1495,21 +1497,22 @@ void amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
// handoverrequest->setSourceToTarget_TransparentContainer(sourceTotarget);
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
std
::
shared_ptr
<
pdu_session_context
>
psc
;
//
std::shared_ptr<pdu_session_context> psc;
// =
// amf_n11_inst->supi_to_pdu_ctx(supi);
std
::
shared_ptr
<
pdu_session_context
>
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
//***************************stateless
pdu_session_context
*
psc1
=
new
pdu_session_context
();
nlohmann
::
json
udsf_response
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
supi
;
if
(
!
amf_n2_inst
->
curl_http_client_udsf
(
udsf_url
,
""
,
"GET"
,
udsf_response
)){
Logger
::
amf_n2
().
error
(
"No existing pdu_session_context with assoc_id "
);
return
;
}
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
psc1
->
pdu_session_context_from_json
(
udsf_response
);
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
psc1
);
else
{
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
psc
.
get
()
->
pdu_session_context_from_json
(
udsf_response
);
// psc = std::shared_ptr<pdu_session_context>(psc1);
}
//***************************stateless
std
::
vector
<
PDUSessionResourceSetupRequestItem_t
>
list
;
...
...
src/contexts/gNB_context.cpp
View file @
b621e54d
...
...
@@ -30,8 +30,11 @@
#include <nlohmann/json.hpp>
#include "logger.hpp"
#include "Record.h"
#include "conversions.hpp"
using
namespace
std
;
using
namespace
oai
::
amf
::
model
;
extern
void
msg_str_2_msg_hex
(
std
::
string
msg
,
bstring
&
b
);
bool
get_value_string
(
const
nlohmann
::
json
&
j
,
const
string
&
nm
,
string
&
value
){
Record
record
;
...
...
@@ -181,6 +184,34 @@ sctp_stream_id_t gnb_context::gnb_context_instreams_from_json(nlohmann::json j)
}
Logger
::
amf_server
().
error
(
"get_value from json is error"
);
}
void
gnb_context
::
gnb_context_ue_radio_cap_ind_from_json
(
nlohmann
::
json
j
)
{
Record
record
;
nlohmann
::
json
::
parse
(
j
.
dump
()).
get_to
(
record
);
std
::
set
<
nlohmann
::
json
>
block_set
=
record
.
getBlocks
();
std
::
set
<
nlohmann
::
json
>::
iterator
it_block
;
for
(
it_block
=
block_set
.
begin
();
it_block
!=
block_set
.
end
();)
{
if
(
it_block
->
at
(
"Content-ID"
)
==
"ue_radio_cap_ind"
)
{
string
s
=
it_block
->
at
(
"content"
);
//msg_str_2_msg_hex(s.substr(0, s.length()),ue_radio_cap_ind);
unsigned
int
msg_len
=
s
.
length
();
char
*
data
=
(
char
*
)
malloc
(
msg_len
+
1
);
memset
(
data
,
0
,
msg_len
+
1
);
memcpy
((
void
*
)
data
,
(
void
*
)
s
.
c_str
(),
msg_len
);
//printf("data: %s\n", data);
uint8_t
*
msg_hex
=
(
uint8_t
*
)
malloc
(
msg_len
/
2
+
1
);
conv
::
ascii_to_hex
(
msg_hex
,
(
const
char
*
)
data
);
ue_radio_cap_ind
=
blk2bstr
(
msg_hex
,
(
msg_len
/
2
));
return
;
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get_value n2sm from json is error"
);
}
bool
gnb_context
::
gnb_context_from_json
(
nlohmann
::
json
j
)
{
//std::shared_ptr<gnb_context> gc1;
...
...
@@ -190,7 +221,7 @@ bool gnb_context::gnb_context_from_json(nlohmann::json j)
ng_state
=
amf_ng_gnb_state_s
(
gnb_context_ng_state_from_json
(
j
));
next_sctp_stream
=
gnb_context_next_sctp_stream_from_json
(
j
);
next_sctp_stream
=
gnb_context_instreams_from_json
(
j
);
gnb_context_ue_radio_cap_ind_from_json
(
j
);
// printf("gnbname-%s\n",gnb_name.c_str());
// printf("globalgnbid-%d\n",globalRanNodeId);
// printf("next stream-%d\n",next_sctp_stream);
...
...
src/contexts/gNB_context.hpp
View file @
b621e54d
...
...
@@ -48,6 +48,7 @@ using namespace std;
enum
amf_ng_gnb_state_s
{
NGAP_INIT
,
NGAP_RESETING
,
NGAP_READY
,
NGAP_SHUTDOWN
};
class
gnb_context
{
public:
void
gnb_context_ue_radio_cap_ind_from_json
(
nlohmann
::
json
j
);
uint32_t
gnb_context_sctp_assoc_id_from_json
(
nlohmann
::
json
j
);
long
gnb_context_globalRanNodeId_from_json
(
nlohmann
::
json
j
);
std
::
string
gnb_context_gnb_name_from_json
(
nlohmann
::
json
j
);
...
...
src/contexts/pdu_session_context.cpp
View file @
b621e54d
This diff is collapsed.
Click to expand it.
src/contexts/pdu_session_context.hpp
View file @
b621e54d
...
...
@@ -37,7 +37,28 @@ class pdu_session_context {
public:
pdu_session_context
();
~
pdu_session_context
();
void
pdu_session_context_n1sm_from_json
(
nlohmann
::
json
j
);
void
pdu_session_context_n2sm_from_json
(
nlohmann
::
json
j
);
bool
pdu_session_context_from_json
(
nlohmann
::
json
j
);
uint32_t
pdu_session_context_ran_ue_ngap_id_from_json
(
nlohmann
::
json
j
);
long
pdu_session_context_amf_ue_ngap_id_from_json
(
nlohmann
::
json
j
);
uint8_t
pdu_session_context_req_type_from_json
(
nlohmann
::
json
j
);
uint8_t
pdu_session_context_pdu_session_id_from_json
(
nlohmann
::
json
j
);
bool
pdu_session_context_isn2sm_avaliable_from_json
(
nlohmann
::
json
j
);
bool
pdu_session_context_isn1sm_avaliable_from_json
(
nlohmann
::
json
j
);
std
::
string
pdu_session_context_dnn_from_json
(
nlohmann
::
json
j
);
std
::
string
pdu_session_context_remote_smf_addr_from_json
(
nlohmann
::
json
j
);
bool
pdu_session_context_smf_available_from_json
(
nlohmann
::
json
j
);
std
::
string
pdu_session_context_location_from_json
(
nlohmann
::
json
j
);
void
pdu_session_context_snssai_from_json
(
nlohmann
::
json
j
,
snssai_t
&
snssai_json
);
void
pdu_session_context_plmn_from_json
(
nlohmann
::
json
j
,
plmn_t
&
plmn_json
);
std
::
string
pdu_session_context_smf_context_location_from_json
(
nlohmann
::
json
j
);
uint32_t
ran_ue_ngap_id
;
long
amf_ue_ngap_id
;
uint8_t
req_type
;
...
...
@@ -53,7 +74,6 @@ class pdu_session_context {
snssai_t
snssai
;
plmn_t
plmn
;
std
::
string
smf_context_location
;
//15
};
#endif
src/contexts/ue_context.cpp
View file @
b621e54d
...
...
@@ -52,7 +52,7 @@ uint32_t ue_context::ue_context_ran_ue_ngap_id_from_json(nlohmann::json j)
}
Logger
::
amf_server
().
error
(
"get_value from json is error"
);
}
void
ue_context
::
ue_context_tai_from_json
(
nlohmann
::
json
j
,
Tai_t
&
t
ai_json
)
void
ue_context
::
ue_context_tai_from_json
(
nlohmann
::
json
j
,
Tai_t
&
T
ai_json
)
{
Record
record
;
nlohmann
::
json
::
parse
(
j
.
dump
()).
get_to
(
record
);
...
...
@@ -67,10 +67,10 @@ void ue_context::ue_context_tai_from_json(nlohmann::json j,Tai_t &tai_json)
string
j
;
s
=
it_block
->
at
(
"content"
);
t
ai_json
.
mcc
=
s
.
at
(
"mcc"
);
t
ai_json
.
mnc
=
s
.
at
(
"mnc"
)
;
T
ai_json
.
mcc
=
s
.
at
(
"mcc"
);
T
ai_json
.
mnc
=
s
.
at
(
"mnc"
)
;
j
=
s
.
at
(
"tac"
);
t
ai_json
.
tac
=
atoi
(
j
.
c_str
());
T
ai_json
.
tac
=
atoi
(
j
.
c_str
());
//printf("ue_context_tai_from_json %s---mcc %s---mnc %s--\n",s.dump().c_str(),tai_json.mcc,tai_json.mnc);
return
;
// s = nlohmann::json::parse(j);
...
...
@@ -82,6 +82,9 @@ void ue_context::ue_context_tai_from_json(nlohmann::json j,Tai_t &tai_json)
}
Logger
::
amf_server
().
error
(
"get_value from json is error"
);
}
bool
ue_context
::
ue_context_from_json
(
nlohmann
::
json
j
)
{
//std::shared_ptr<gnb_context> gc1;
...
...
src/ngap/ngap_app/ngap_message_callback.hpp
View file @
b621e54d
...
...
@@ -386,8 +386,8 @@ int ngap_amf_handle_pdu_session_resource_setup_response(
std
::
shared_ptr
<
nas_context
>
nct
=
amf_n1_inst
->
amf_ue_id_2_nas_context
(
amf_ue_ngap_id
);
string
supi
=
"imsi-"
+
nct
.
get
()
->
imsi
;
std
::
shared_ptr
<
pdu_session_context
>
psc
;
//
std::shared_ptr<pdu_session_context> psc;
std
::
shared_ptr
<
pdu_session_context
>
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
//***************************stateless
pdu_session_context
*
psc1
=
new
pdu_session_context
();
nlohmann
::
json
udsf_response
;
...
...
@@ -396,9 +396,12 @@ int ngap_amf_handle_pdu_session_resource_setup_response(
Logger
::
amf_n2
().
error
(
"No existing pdu_session_context with assoc_id "
);
return
0
;
}
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
psc1
->
pdu_session_context_from_json
(
udsf_response
);
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
psc1
);
else
{
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
psc
.
get
()
->
pdu_session_context_from_json
(
udsf_response
);
//psc = std::shared_ptr<pdu_session_context>(psc1);
}
//***************************stateless
// if (amf_n11_inst->is_supi_to_pdu_ctx(supi)) {
...
...
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
View file @
b621e54d
...
...
@@ -87,19 +87,20 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(
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
;
//
std::shared_ptr<pdu_session_context> psc;
std
::
shared_ptr
<
pdu_session_context
>
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
//***************************stateless
pdu_session_context
*
psc1
=
new
pdu_session_context
();
nlohmann
::
json
udsf_response
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
supi
;
if
(
!
amf_n2_inst
->
curl_http_client_udsf
(
udsf_url
,
""
,
"GET"
,
udsf_response
)){
Logger
::
amf_n2
().
error
(
"No existing pdu_session_context with assoc_id "
);
return
;
}
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
psc1
->
pdu_session_context_from_json
(
udsf_response
);
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
psc1
);
else
{
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
psc
.
get
()
->
pdu_session_context_from_json
(
udsf_response
);
//psc = std::shared_ptr<pdu_session_context>(psc1);
}
//***************************stateless
// if (amf_n11_inst->is_supi_to_pdu_ctx(supi)) {
...
...
@@ -108,7 +109,6 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(
// 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
()),
...
...
@@ -126,6 +126,7 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(
string
n2sm_udsf
;
octet_stream_2_hex_stream
((
uint8_t
*
)
bdata
(
psc
.
get
()
->
n1sm
),
blength
(
psc
.
get
()
->
n1sm
),
n1sm_udsf
);
octet_stream_2_hex_stream
((
uint8_t
*
)
bdata
(
psc
.
get
()
->
n2sm
),
blength
(
psc
.
get
()
->
n2sm
),
n2sm_udsf
);
std
::
string
udsf_put_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
supi
;
nlohmann
::
json
udsf_put_pdu_session_context
;
//nlohmann::json udsf_response;
...
...
@@ -134,9 +135,9 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(
{
"from_nf_ID"
,
nlohmann
::
json
::
array
({
"AMF_1234"
})}
}
;
udsf_put_pdu_session_context
[
"blocks"
]
=
nlohmann
::
json
::
array
({
{{
"Content-ID"
,
"n2sm"
},{
"Content-Type"
,
"varchar(
32
)"
},{
"content"
,
n2sm_udsf
}},
{{
"Content-ID"
,
"n2sm"
},{
"Content-Type"
,
"varchar(
1024
)"
},{
"content"
,
n2sm_udsf
}},
{{
"Content-ID"
,
"isn2sm_avaliable"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
to_string
(
psc
.
get
()
->
isn2sm_avaliable
)}},
{{
"Content-ID"
,
"n1sm"
},{
"Content-Type"
,
"varchar(
32
)"
},{
"content"
,
n1sm_udsf
}},
{{
"Content-ID"
,
"n1sm"
},{
"Content-Type"
,
"varchar(
1024
)"
},{
"content"
,
n1sm_udsf
}},
{{
"Content-ID"
,
"isn1sm_avaliable"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
to_string
(
psc
.
get
()
->
isn1sm_avaliable
)}},
});
std
::
string
json_part
=
udsf_put_pdu_session_context
.
dump
();
...
...
src/sbi/amf_server/impl/TestSignallingApiImpl.cpp
View file @
b621e54d
...
...
@@ -32,16 +32,16 @@ void TestSignallingApiImpl::
std
::
string
supi
=
subscriptionId
;
Logger
::
amf_server
().
debug
(
"Key for PDU Session context: SUPI (%s)"
,
supi
.
c_str
());
std
::
shared_ptr
<
pdu_session_context
>
psc
;
//
std::shared_ptr<pdu_session_context> psc;
std
::
shared_ptr
<
pdu_session_context
>
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
//***************************stateless
pdu_session_context
*
psc1
=
new
pdu_session_context
();
nlohmann
::
json
udsf_response
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
supi
;
if
(
amf_n2_inst
->
curl_http_client_udsf
(
udsf_url
,
""
,
"GET"
,
udsf_response
)){
Logger
::
amf_server
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
psc
1
->
pdu_session_context_from_json
(
udsf_response
);
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
psc1
);
psc
.
get
()
->
pdu_session_context_from_json
(
udsf_response
);
//
psc = std::shared_ptr<pdu_session_context>(psc1);
itti_test_signalling_network_initiated_deregistration
*
itti_msg
=
new
itti_test_signalling_network_initiated_deregistration
(
AMF_SERVER
,
TASK_AMF_APP
);
...
...
@@ -97,16 +97,16 @@ void TestSignallingApiImpl::test_signalling_paging(
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
;
//
std::shared_ptr<pdu_session_context> psc;
std
::
shared_ptr
<
pdu_session_context
>
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
//***************************stateless
pdu_session_context
*
psc1
=
new
pdu_session_context
();
nlohmann
::
json
udsf_response
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
supi
;
if
(
amf_n2_inst
->
curl_http_client_udsf
(
udsf_url
,
""
,
"GET"
,
udsf_response
)){
Logger
::
amf_server
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
psc
1
->
pdu_session_context_from_json
(
udsf_response
);
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
psc1
);
psc
.
get
()
->
pdu_session_context_from_json
(
udsf_response
);
//
psc = std::shared_ptr<pdu_session_context>(psc1);
itti_test_signalling_paging
*
itti_msg
=
new
itti_test_signalling_paging
(
AMF_SERVER
,
TASK_AMF_APP
);
...
...
src/utils/http_multi_parser.cpp
View file @
b621e54d
...
...
@@ -8,7 +8,6 @@ uint8_t multipart_parser(
// simple parser
mime_parser
sp
=
{};
sp
.
parse
(
input
);
std
::
vector
<
mime_part
>
parts
=
{};
sp
.
get_mime_parts
(
parts
);
uint8_t
size
=
parts
.
size
();
...
...
src/utils/mime_parser.cpp
View file @
b621e54d
...
...
@@ -34,7 +34,9 @@ bool mime_parser::parse(const std::string& str) {
// find boundary
std
::
size_t
content_type_pos
=
str
.
find
(
"Content-Type"
);
// first part
if
((
content_type_pos
<=
4
)
or
(
content_type_pos
==
std
::
string
::
npos
))
{
return
false
;
}
std
::
string
boundary_str
=
str
.
substr
(
2
,
content_type_pos
-
4
);
// 2 for -- and 2 for CRLF
...
...
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