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
b7ad7e84
Commit
b7ad7e84
authored
Jul 04, 2021
by
liuyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cpe can ping amf can jixufuwu
parent
b621e54d
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1193 additions
and
144 deletions
+1193
-144
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+5
-2
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+511
-77
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+6
-0
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+40
-24
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+73
-25
src/contexts/nas_context.cpp
src/contexts/nas_context.cpp
+459
-6
src/contexts/nas_context.hpp
src/contexts/nas_context.hpp
+58
-2
src/contexts/pdu_session_context.cpp
src/contexts/pdu_session_context.cpp
+19
-1
src/contexts/pdu_session_context.hpp
src/contexts/pdu_session_context.hpp
+3
-0
src/ngap/ngap_app/ngap_message_callback.hpp
src/ngap/ngap_app/ngap_message_callback.hpp
+6
-2
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
.../amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
+7
-3
src/sbi/amf_server/impl/TestSignallingApiImpl.cpp
src/sbi/amf_server/impl/TestSignallingApiImpl.cpp
+6
-2
No files found.
src/amf-app/amf_app.cpp
View file @
b7ad7e84
...
...
@@ -331,7 +331,9 @@ void amf_app::handle_itti_message(
}
/********************** hxs add *******************************/
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"ue_context/records/"
)
+
ue_context_key
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
ue_context_key
+
"
\'
"
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"ue_context/records/"
)
+
record_id
;
nlohmann
::
json
udsf_ue_context
;
nlohmann
::
json
cgi
;
cgi
[
"Content-ID"
]
=
"cgi"
;
...
...
@@ -422,7 +424,8 @@ bool amf_app::generate_5g_guti(
// uc = ran_amf_id_2_ue_context(ue_context_key);
ue_context
*
uc1
=
new
ue_context
();
nlohmann
::
json
udsf_response
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"ue_context/records/"
)
+
ue_context_key
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
ue_context_key
+
"
\'
"
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"ue_context/records/"
)
+
record_id
;
if
(
!
amf_n2_inst
->
curl_http_client_udsf
(
udsf_url
,
""
,
"GET"
,
udsf_response
)){
Logger
::
amf_n2
().
error
(
"No existing gNG context with assoc_id"
);
return
false
;
...
...
src/amf-app/amf_n1.cpp
View file @
b7ad7e84
This diff is collapsed.
Click to expand it.
src/amf-app/amf_n1.hpp
View file @
b7ad7e84
...
...
@@ -91,6 +91,12 @@ class amf_n1 {
void
set_guti_2_nas_context
(
const
std
::
string
&
guti
,
std
::
shared_ptr
<
nas_context
>
nc
);
bool
is_guti_2_nas_context_in_udsf
(
const
std
::
string
&
guti
);
std
::
shared_ptr
<
nas_context
>
guti_2_nas_context_in_udsf
(
const
std
::
string
&
guti
)
const
;
bool
is_amf_ue_id_2_nas_context_in_udsf
(
const
long
&
amf_ue_ngap_id
)
const
;
std
::
shared_ptr
<
nas_context
>
amf_ue_id_2_nas_context_in_udsf
(
const
long
&
amf_ue_ngap_id
)
const
;
mutable
std
::
shared_mutex
m_amfueid2nas_context
;
bool
is_amf_ue_id_2_nas_context
(
const
long
&
amf_ue_ngap_id
)
const
;
std
::
shared_ptr
<
nas_context
>
amf_ue_id_2_nas_context
(
...
...
src/amf-app/amf_n11.cpp
View file @
b7ad7e84
...
...
@@ -155,17 +155,20 @@ 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
);
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::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;
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
;
std
::
string
record_id
=
"pdu_session_id=
\'
"
+
to_string
(
itti_msg
.
pdu_session_id
)
+
"
\'
"
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
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
;
...
...
@@ -173,8 +176,18 @@ void amf_n11::handle_itti_message(
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);
}
// std::shared_ptr<nas_context> nc = std::shared_ptr<nas_context>(new nas_context());
// if (amf_n1_inst->is_amf_ue_id_2_nas_context_in_udsf(psc.get()->amf_ue_ngap_id))
// nc = amf_n1_inst->amf_ue_id_2_nas_context_in_udsf(psc.get()->amf_ue_ngap_id);
std
::
string
supi
=
psc
.
get
()
->
supi
;
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
);
//***************************stateless
// if (is_supi_to_pdu_ctx(supi)) {
...
...
@@ -238,7 +251,11 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
//***************************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
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
supi
+
"
\'
"
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
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 "
);
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
...
...
@@ -391,7 +408,9 @@ void amf_n11::handle_pdu_session_initial_request(
/***************************hxs add**************/
//send udsf to storage us_ngap_context recordid=ran+ue_ngap_id
std
::
string
udsf_put_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
supi
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
supi
+
"
\'
"
;
std
::
string
udsf_put_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
nlohmann
::
json
udsf_pdu_session_context
;
// nlohmann::json udsf_response;
udsf_pdu_session_context
[
"meta"
]
[
"tags"
]
=
{
...
...
@@ -403,6 +422,7 @@ void amf_n11::handle_pdu_session_initial_request(
{{
"Content-ID"
,
"amf_ue_ngap_id"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
to_string
(
psc
.
get
()
->
amf_ue_ngap_id
)}},
{{
"Content-ID"
,
"req_type"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
to_string
(
psc
.
get
()
->
req_type
)}},
{{
"Content-ID"
,
"pdu_session_id"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
to_string
(
psc
.
get
()
->
pdu_session_id
)}},
{{
"Content-ID"
,
"supi"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
supi
}},
{{
"Content-ID"
,
"dnn"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
psc
.
get
()
->
dnn
}},
{{
"Content-ID"
,
"n2sm"
},{
"Content-Type"
,
"varchar(1024)"
},{
"content"
,
" "
}},
{{
"Content-ID"
,
"isn2sm_avaliable"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
" "
}},
...
...
@@ -411,7 +431,7 @@ void amf_n11::handle_pdu_session_initial_request(
{{
"Content-ID"
,
"remote_smf_addr"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
" "
}},
{{
"Content-ID"
,
"smf_available"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
""
}},
{{
"Content-ID"
,
"location"
},{
"Content-Type"
,
"varchar(32)"
},{
"content"
,
""
}},
{{
"Content-ID"
,
"smf_context_location"
},{
"Content-Type"
,
"varchar(1
024
)"
},{
"content"
,
""
}}
{{
"Content-ID"
,
"smf_context_location"
},{
"Content-Type"
,
"varchar(1
28
)"
},{
"content"
,
""
}}
});
nlohmann
::
json
snssai
=
{};
nlohmann
::
json
plmn
=
{};
...
...
@@ -489,7 +509,9 @@ void amf_n11::handle_itti_message(
//***************************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/"
)
+
itti_msg
.
supi
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
itti_msg
.
supi
+
"
\'
"
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
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 "
);
}
...
...
@@ -599,9 +621,9 @@ void amf_n11::curl_http_client(
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
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
supi
+
"
\'
"
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
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
;
...
...
@@ -701,10 +723,8 @@ void amf_n11::curl_http_client(
// establishment request)
return
;
}
printf
(
"-----------------%d-----------response.size()
\n
"
,
response
.
size
());
if
(
response
.
size
()
>
0
)
{
number_parts
=
multipart_parser
(
response
,
json_data_response
,
n1sm
,
n2sm
);
printf
(
"-----------------%d-----------number_parts"
,
number_parts
);
}
if
((
static_cast
<
http_response_codes_e
>
(
httpCode
)
!=
...
...
@@ -754,27 +774,24 @@ void amf_n11::curl_http_client(
std
::
size_t
location_pos
=
header_response
.
find
(
"Location"
);
if
(
location_pos
!=
std
::
string
::
npos
)
{
printf
(
"----------------------------if location_pos != std::string::npos
\n
"
);
std
::
size_t
crlf_pos
=
header_response
.
find
(
CRLF
,
location_pos
);
if
(
crlf_pos
!=
std
::
string
::
npos
)
{
printf
(
"----------------------------crlf_pos != std::string::npos
\n
"
);
std
::
string
location
=
header_response
.
substr
(
location_pos
+
10
,
crlf_pos
-
(
location_pos
+
10
));
Logger
::
amf_n11
().
info
(
"Location of the created SMF context: %s"
,
location
.
c_str
());
psc
.
get
()
->
smf_context_location
=
location
;
std
::
string
udsf_put_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
supi
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
supi
+
"
\'
"
;
std
::
string
udsf_put_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
nlohmann
::
json
udsf_put_pdu_session_context
;
udsf_put_pdu_session_context
[
"meta"
]
[
"tags"
]
=
{
{
"RECORD_ID"
,
nlohmann
::
json
::
array
({
supi
})},
{
"from_nf_ID"
,
nlohmann
::
json
::
array
({
"AMF_1234"
})}
}
;
udsf_put_pdu_session_context
[
"blocks"
]
=
nlohmann
::
json
::
array
({
{{
"Content-ID"
,
"smf_context_location"
},{
"Content-Type"
,
"varchar(1
024
)"
},{
"content"
,
psc
.
get
()
->
smf_context_location
}},
{{
"Content-ID"
,
"smf_context_location"
},{
"Content-Type"
,
"varchar(1
28
)"
},{
"content"
,
psc
.
get
()
->
smf_context_location
}},
});
std
::
string
json_part
=
udsf_put_pdu_session_context
.
dump
();
while
(
!
(
amf_n2_inst
->
curl_http_client_udsf
(
udsf_put_url
,
json_part
,
"PUT"
,
udsf_response
)));
...
...
@@ -784,7 +801,6 @@ void amf_n11::curl_http_client(
// Transfer N1/N2 to gNB/UE if available
if
(
number_parts
>
1
)
{
printf
(
"-----------------%d-----------number_parts >>>>> 1"
);
try
{
response_data
=
nlohmann
::
json
::
parse
(
json_data_response
);
}
catch
(
nlohmann
::
json
::
exception
&
e
)
{
...
...
src/amf-app/amf_n2.cpp
View file @
b7ad7e84
This diff is collapsed.
Click to expand it.
src/contexts/nas_context.cpp
View file @
b7ad7e84
This diff is collapsed.
Click to expand it.
src/contexts/nas_context.hpp
View file @
b7ad7e84
...
...
@@ -65,12 +65,65 @@ class nas_context {
public:
nas_context
();
~
nas_context
();
//
//ctx_avaliability_ind = true;
// nc.get()->is_imsi_present = true;
// nc.get()->imsi = supi;
//nc.get()->imsi = supi;
bool
nas_context_from_json
(
nlohmann
::
json
j
);
uint32_t
nas_context_ran_ue_ngap_id_from_json
(
nlohmann
::
json
j
);
long
nas_context_amf_ue_ngap_id_from_json
(
nlohmann
::
json
j
);
bool
nas_context_ctx_avaliability_ind_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_stacs_available_from_json
(
nlohmann
::
json
j
);
long
nas_context_amf_ue_ngap_id_from_json
(
nlohmann
::
json
j
);
uint32_t
nas_context_ran_ue_ngap_id_from_json
(
nlohmann
::
json
j
);
std
::
string
nas_context_nas_status_from_json
(
nlohmann
::
json
j
);
int
nas_context__5gmm_state_from_json
(
nlohmann
::
json
j
);
uint8_t
nas_context_registration_type_from_json
(
nlohmann
::
json
j
);
bool
nas_context_follow_on_req_pending_ind_from_json
(
nlohmann
::
json
j
);
uint8_t
nas_context_ngKsi_from_json
(
nlohmann
::
json
j
);
std
::
string
nas_context_imsi_from_json
(
nlohmann
::
json
j
);
//ok
// uint8_t mmCapability;
// uint8_t ueSecurityCaplen;
// uint8_t ueSecurityCapEnc;
// uint8_t ueSecurityCapInt;
// uint8_t ueSecurityCapEEnc;
// uint8_t ueSecurityCapEInt;
//void nas_context_requestedNssai_from_json(nlohmann::json j);
std
::
string
nas_context_serving_network_from_json
(
nlohmann
::
json
j
);
void
nas_context_auts_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_specific_procedure_for_registration_running_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_specific_procedure_for_deregistration_running_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_specific_procedure_for_eCell_inactivity_running_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_common_procedure_for_authentication_running_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_common_procedure_for_identification_running_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_common_procedure_for_security_mode_control_running_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_common_procedure_for_nas_transport_running_from_json
(
nlohmann
::
json
j
);
void
nas_context__vector_from_json
(
nlohmann
::
json
j
);
void
nas_context__5g_he_av_from_json
(
nlohmann
::
json
j
);
void
nas_context__5g_av_from_json
(
nlohmann
::
json
j
);
std
::
string
nas_context_Href_from_json
(
nlohmann
::
json
j
);
void
nas_context_kamf_from_json
(
nlohmann
::
json
j
);
void
nas_context__security_from_json
(
nlohmann
::
json
j
);
void
nas_context_security_ctx_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_current_security_available_from_json
(
nlohmann
::
json
j
);
int
nas_context_registration_attempt_counter_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_imsi_present_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_5g_guti_present_from_json
(
nlohmann
::
json
j
);
bool
nas_context_is_auth_vectors_present_from_json
(
nlohmann
::
json
j
);
bool
nas_context_to_be_register_by_new_suci_from_json
(
nlohmann
::
json
j
);
std
::
string
nas_context_guti_from_json
(
nlohmann
::
json
j
);
bool
ctx_avaliability_ind
;
bool
is_stacs_available
;
long
amf_ue_ngap_id
;
...
...
@@ -124,6 +177,9 @@ class nas_context {
bool
is_5g_guti_present
;
bool
is_auth_vectors_present
;
bool
to_be_register_by_new_suci
;
std
::
string
guti
;
};
#endif
src/contexts/pdu_session_context.cpp
View file @
b7ad7e84
...
...
@@ -191,7 +191,24 @@ std::string pdu_session_context::pdu_session_context_dnn_from_json(nlohmann::jso
}
Logger
::
amf_server
().
error
(
"get_value dnn from json is error"
);
}
std
::
string
pdu_session_context
::
pdu_session_context_supi_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"
)
==
"supi"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
s
;
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get_value dnn from json is error"
);
}
std
::
string
pdu_session_context
::
pdu_session_context_remote_smf_addr_from_json
(
nlohmann
::
json
j
)
{
...
...
@@ -415,6 +432,7 @@ bool pdu_session_context::pdu_session_context_from_json(nlohmann::json j)
isn1sm_avaliable
=
pdu_session_context_isn1sm_avaliable_from_json
(
j
);
dnn
=
pdu_session_context_dnn_from_json
(
j
);
supi
=
pdu_session_context_supi_from_json
(
j
);
//remote_smf_addr[0] = pdu_session_context_remote_smf_addr_from_json(j);
smf_available
=
pdu_session_context_smf_available_from_json
(
j
);
location
=
pdu_session_context_location_from_json
(
j
);
...
...
src/contexts/pdu_session_context.hpp
View file @
b7ad7e84
...
...
@@ -48,6 +48,7 @@ class pdu_session_context {
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_supi_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
);
...
...
@@ -74,6 +75,8 @@ class pdu_session_context {
snssai_t
snssai
;
plmn_t
plmn
;
std
::
string
smf_context_location
;
std
::
string
supi
;
//15
};
#endif
src/ngap/ngap_app/ngap_message_callback.hpp
View file @
b7ad7e84
...
...
@@ -391,7 +391,9 @@ std::shared_ptr<pdu_session_context> psc = std::shared_ptr<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
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
supi
+
"
\'
"
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
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
0
;
...
...
@@ -413,7 +415,9 @@ std::shared_ptr<pdu_session_context> psc = std::shared_ptr<pdu_session_context>(
// }
psc
.
get
()
->
isn2sm_avaliable
=
false
;
std
::
string
udsf_put_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
supi
;
record_id
=
"RECORD_ID=
\'
"
+
supi
+
"
\'
"
;
std
::
string
udsf_put_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
nlohmann
::
json
udsf_put_pdu_session_context
;
//nlohmann::json udsf_response;
udsf_put_pdu_session_context
[
"meta"
]
[
"tags"
]
=
{
...
...
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
View file @
b7ad7e84
...
...
@@ -90,9 +90,11 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(
//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
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
supi
+
"
\'
"
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
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 "
);
}
...
...
@@ -127,7 +129,9 @@ std::shared_ptr<pdu_session_context> psc = std::shared_ptr<pdu_session_context>(
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
;
record_id
=
"RECORD_ID=
\'
"
+
supi
+
"
\'
"
;
std
::
string
udsf_put_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
nlohmann
::
json
udsf_put_pdu_session_context
;
//nlohmann::json udsf_response;
udsf_put_pdu_session_context
[
"meta"
]
[
"tags"
]
=
{
...
...
src/sbi/amf_server/impl/TestSignallingApiImpl.cpp
View file @
b7ad7e84
...
...
@@ -37,7 +37,9 @@ std::shared_ptr<pdu_session_context> psc = std::shared_ptr<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
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
supi
+
"
\'
"
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
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
.
get
()
->
pdu_session_context_from_json
(
udsf_response
);
...
...
@@ -102,7 +104,9 @@ std::shared_ptr<pdu_session_context> psc = std::shared_ptr<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
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
supi
+
"
\'
"
;
std
::
string
udsf_url
=
"http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"
+
std
::
string
(
"pdu_session_context/records/"
)
+
record_id
;
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
.
get
()
->
pdu_session_context_from_json
(
udsf_response
);
...
...
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