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
1d4bc491
Commit
1d4bc491
authored
Jul 07, 2021
by
liuyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amfn11
parent
aa2e7616
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
277 additions
and
20 deletions
+277
-20
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+5
-1
src/contexts/nas_context.cpp
src/contexts/nas_context.cpp
+272
-19
No files found.
src/amf-app/amf_n11.cpp
View file @
1d4bc491
...
@@ -269,10 +269,14 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
...
@@ -269,10 +269,14 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
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
;
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
)
||
udsf_response
==
nullptr
){
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 "
);
Logger
::
amf_n2
().
error
(
"No existing pdu_session_context with assoc_id "
);
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
}
}
if
(
udsf_response
.
dump
().
c_str
()
==
nullptr
)
{
Logger
::
amf_n2
().
error
(
"No existing pdu_session_context with assoc_id "
);
}
else
{
else
{
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
psc
.
get
()
->
pdu_session_context_from_json
(
udsf_response
);
psc
.
get
()
->
pdu_session_context_from_json
(
udsf_response
);
...
...
src/contexts/nas_context.cpp
View file @
1d4bc491
...
@@ -556,24 +556,277 @@ bool nas_context::nas_context_is_specific_procedure_for_deregistration_running_f
...
@@ -556,24 +556,277 @@ bool nas_context::nas_context_is_specific_procedure_for_deregistration_running_f
Logger
::
amf_server
().
error
(
"get value from json is error"
);
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
}
// bool nas_context::nas_context_is_specific_procedure_for_deregistration
_running_from_json(nlohmann::json j)
bool
nas_context
::
nas_context_is_specific_procedure_for_eCell_inactivity
_running_from_json
(
nlohmann
::
json
j
)
//
{
{
//
Record record;
Record
record
;
//
nlohmann::json::parse(j.dump()).get_to(record);
nlohmann
::
json
::
parse
(
j
.
dump
()).
get_to
(
record
);
//
std::set<nlohmann::json> block_set = record.getBlocks();
std
::
set
<
nlohmann
::
json
>
block_set
=
record
.
getBlocks
();
//
std::set<nlohmann::json>::iterator it_block;
std
::
set
<
nlohmann
::
json
>::
iterator
it_block
;
//
for(it_block=block_set.begin();it_block!=block_set.end();)
for
(
it_block
=
block_set
.
begin
();
it_block
!=
block_set
.
end
();)
//
{
{
// if(it_block->at("Content-ID") == "is_specific_procedure_for_deregistration_running")
if
(
it_block
->
at
(
"Content-ID"
)
==
"is_specific_procedure_for_eCell_inactivity_running"
)
// {
{
// string s = it_block->at("content");
string
s
=
it_block
->
at
(
"content"
);
// return atoi(s.c_str());
return
atoi
(
s
.
c_str
());
// }
}
// block_set.erase(it_block++);
block_set
.
erase
(
it_block
++
);
// }
}
// Logger::amf_server().error("get value from json is error");
Logger
::
amf_server
().
error
(
"get value from json is error"
);
// }
}
bool
nas_context
::
nas_context_is_common_procedure_for_authentication_running_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"
)
==
"is_common_procedure_for_authentication_running"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
atoi
(
s
.
c_str
());
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
bool
nas_context
::
nas_context_is_common_procedure_for_identification_running_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"
)
==
"is_common_procedure_for_identification_running"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
atoi
(
s
.
c_str
());
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
bool
nas_context
::
nas_context_is_common_procedure_for_security_mode_control_running_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"
)
==
"is_common_procedure_for_security_mode_control_running"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
atoi
(
s
.
c_str
());
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
bool
nas_context
::
nas_context_is_common_procedure_for_nas_transport_running_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"
)
==
"is_common_procedure_for_nas_transport_running"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
atoi
(
s
.
c_str
());
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
std
::
string
nas_context
::
nas_context_Href_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"
)
==
"Href"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
s
;
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
bool
nas_context
::
nas_context_is_current_security_available_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"
)
==
"is_current_security_available"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
atoi
(
s
.
c_str
());
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
int
nas_context
::
nas_context_registration_attempt_counter_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"
)
==
"registration_attempt_counter"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
atoi
(
s
.
c_str
());
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
bool
nas_context
::
nas_context_is_imsi_present_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"
)
==
"is_imsi_present"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
atoi
(
s
.
c_str
());
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
bool
nas_context
::
nas_context_is_5g_guti_present_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"
)
==
"is_5g_guti_present"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
atoi
(
s
.
c_str
());
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
bool
nas_context
::
nas_context_is_auth_vectors_present_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"
)
==
"is_auth_vectors_present"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
atoi
(
s
.
c_str
());
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
bool
nas_context
::
nas_context_to_be_register_by_new_suci_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"
)
==
"to_be_register_by_new_suci"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
atoi
(
s
.
c_str
());
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
std
::
string
nas_context
::
nas_context_guti_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"
)
==
"guti"
)
{
string
s
=
it_block
->
at
(
"content"
);
return
s
;
}
block_set
.
erase
(
it_block
++
);
}
Logger
::
amf_server
().
error
(
"get value from json is error"
);
}
// 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);
// void nas_context__security_from_json(nlohmann::json j);
// void nas_context_security_ctx_from_json(nlohmann::json j);
// void nas_context_requestedNssai_from_json(nlohmann::json j);
...
@@ -594,7 +847,7 @@ bool nas_context::nas_context_from_json(nlohmann::json j)
...
@@ -594,7 +847,7 @@ bool nas_context::nas_context_from_json(nlohmann::json j)
//serving_network = nas_context_serving_network_from_json(j);
//serving_network = nas_context_serving_network_from_json(j);
//nas_context_auts_from_json(j);
//nas_context_auts_from_json(j);
// is_specific_procedure_for_registration_running = nas_context_is_specific_procedure_for_registration_running_from_json(j);
// is_specific_procedure_for_registration_running = nas_context_is_specific_procedure_for_registration_running_from_json(j);
// is_specific_procedure_for_deregistration_running = nas_context_is_specific_procedure_for_deregistration_running_from_json(j);
// is_specific_procedure_for_deregistration_running = nas_context_is_specific_procedure_for_deregistration_running_from_json(j);
// is_specific_procedure_for_eCell_inactivity_running = nas_context_is_specific_procedure_for_eCell_inactivity_running_from_json(j);
// is_specific_procedure_for_eCell_inactivity_running = nas_context_is_specific_procedure_for_eCell_inactivity_running_from_json(j);
// is_common_procedure_for_authentication_running = nas_context_is_common_procedure_for_authentication_running_from_json(j);
// is_common_procedure_for_authentication_running = nas_context_is_common_procedure_for_authentication_running_from_json(j);
...
@@ -604,7 +857,7 @@ bool nas_context::nas_context_from_json(nlohmann::json j)
...
@@ -604,7 +857,7 @@ bool nas_context::nas_context_from_json(nlohmann::json j)
//Href = nas_context_Href_from_json(j);
//Href = nas_context_Href_from_json(j);
//kamf = nas_context_kamf_from_json(j);
//kamf = nas_context_kamf_from_json(j);
//is_current_security_available = nas_context_is_current_security_available_from_json(j);
//is_current_security_available = nas_context_is_current_security_available_from_json(j);
nas_context_security_ctx_from_json
(
j
);
nas_context_security_ctx_from_json
(
j
);
...
...
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