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
da971243
Commit
da971243
authored
Jul 13, 2021
by
liuyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change for UERANSIM(UERANSIM service response is not enough, can't establish new n3 turnel)
parent
1d4bc491
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
231 additions
and
112 deletions
+231
-112
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+8
-4
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+3
-2
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+6
-4
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+206
-95
src/amf-app/amf_n2.hpp
src/amf-app/amf_n2.hpp
+1
-1
src/contexts/pdu_session_context.cpp
src/contexts/pdu_session_context.cpp
+1
-1
src/nas/ies/5GSMobilityIdentity.cpp
src/nas/ies/5GSMobilityIdentity.cpp
+4
-4
src/nas/msgs/ServiceRequest.cpp
src/nas/msgs/ServiceRequest.cpp
+1
-0
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
.../amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
+1
-1
No files found.
src/amf-app/amf_app.cpp
View file @
da971243
...
...
@@ -96,6 +96,11 @@ void amf_app::allRegistredModulesInit(const amf_modules& modules) {
void
amf_app_task
(
void
*
)
{
const
task_id_t
task_id
=
TASK_AMF_APP
;
itti_inst
->
notify_task_ready
(
task_id
);
// nlohmann::json udsf_response2;
// std::string record_id = "RECORD_ID=\'" + to_string(1221) + "\'";
// std::string udsf_url = "http://10.112.202.24:7123/nudsf-dr/v1/amfdata/"+ std::string("nas_context/records/") + record_id;
// while(1)
// {amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response2);}
do
{
std
::
shared_ptr
<
itti_msg
>
shared_msg
=
itti_inst
->
receive_msg
(
task_id
);
auto
*
msg
=
shared_msg
.
get
();
...
...
@@ -424,7 +429,7 @@ bool amf_app::generate_5g_guti(
// }
// std::shared_ptr<ue_context> uc;
// uc = ran_amf_id_2_ue_context(ue_context_key);
ue_context
*
uc1
=
new
ue_context
(
);
std
::
shared_ptr
<
ue_context
>
uc
=
std
::
shared_ptr
<
ue_context
>
(
new
ue_context
()
);
nlohmann
::
json
udsf_response
;
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
;
...
...
@@ -433,9 +438,8 @@ bool amf_app::generate_5g_guti(
return
false
;
}
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
uc1
->
ue_context_from_json
(
udsf_response
);
std
::
shared_ptr
<
ue_context
>
uc
;
uc
=
std
::
shared_ptr
<
ue_context
>
(
uc1
);
uc
.
get
()
->
ue_context_from_json
(
udsf_response
);
mcc
=
uc
.
get
()
->
tai
.
mcc
;
...
...
src/amf-app/amf_n1.cpp
View file @
da971243
...
...
@@ -68,7 +68,8 @@
#include "ConfirmationDataResponse.h"
#include "UEAuthenticationCtx.h"
#include <curl/curl.h>
#include <nlohmann/json.hpp>
#include "Record.h"
extern
"C"
{
#include "bstrlib.h"
#include "dynamic_memory_check.h"
...
...
@@ -122,7 +123,7 @@ void amf_n1_task(void *) {
default:
Logger
::
amf_n1
().
error
(
"No handler for msg type %d"
,
msg
->
msg_type
);
}
}
while
(
true
);
}
while
(
true
);
}
//------------------------------------------------------------------------------
...
...
src/amf-app/amf_n11.cpp
View file @
da971243
...
...
@@ -273,9 +273,11 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
Logger
::
amf_n2
().
error
(
"No existing pdu_session_context with assoc_id "
);
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
}
if
(
udsf_response
.
dump
().
c_str
()
==
nullptr
)
else
if
(
udsf_response
.
dump
().
length
()
<
8
)
{
Logger
::
amf_n2
().
error
(
"No existing pdu_session_context with assoc_id "
);
Logger
::
amf_n2
().
error
(
"No existing pdu_session_context with assoc_id----length = %d "
,
udsf_response
.
dump
().
length
());
Logger
::
amf_n2
().
error
(
"No existing pdu_session_context with assoc_id 2222"
);
psc
=
std
::
shared_ptr
<
pdu_session_context
>
(
new
pdu_session_context
());
}
else
{
Logger
::
amf_n2
().
debug
(
"udsf_response: %s"
,
udsf_response
.
dump
().
c_str
());
...
...
@@ -292,7 +294,7 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
// set_supi_to_pdu_ctx(supi, psc);
// }
pduid2supi
[
smf
.
pdu_sess_id
]
=
supi
;
//
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
;
psc
.
get
()
->
req_type
=
smf
.
req_type
;
...
...
@@ -811,7 +813,7 @@ void amf_n11::curl_http_client(
{{
"Content-ID"
,
"smf_context_location"
},{
"Content-Type"
,
"varchar(128)"
},{
"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
))
);
amf_n2_inst
->
curl_http_client_udsf
(
udsf_put_url
,
json_part
,
"PUT"
,
udsf_response
);
}
}
...
...
src/amf-app/amf_n2.cpp
View file @
da971243
This diff is collapsed.
Click to expand it.
src/amf-app/amf_n2.hpp
View file @
da971243
...
...
@@ -42,7 +42,7 @@
namespace
amf_application
{
#define UDSF_CURL_TIMEOUT_MS
1
00L
#define UDSF_CURL_TIMEOUT_MS
20
00L
class
amf_n2
:
public
ngap
::
ngap_app
{
public:
...
...
src/contexts/pdu_session_context.cpp
View file @
da971243
...
...
@@ -360,7 +360,7 @@ void pdu_session_context::pdu_session_context_n1sm_from_json(nlohmann::json j)
if
(
it_block
->
at
(
"Content-ID"
)
==
"n1sm"
)
{
string
s
=
it_block
->
at
(
"content"
);
s
=
s
.
substr
(
0
,
s
.
length
()
-
2
);
// s= s.substr(0, s.length()
);
// msg_str_2_msg_hex(s.substr(0, s.length()),n1sm);
unsigned
int
msg_len
=
s
.
length
();
char
*
data
=
(
char
*
)
malloc
(
msg_len
+
1
);
...
...
src/nas/ies/5GSMobilityIdentity.cpp
View file @
da971243
...
...
@@ -101,25 +101,25 @@ int _5GSMobilityIdentity::_5g_s_tmsi_decodefrombuffer(uint8_t* buf, int len) {
decoded_size
++
;
Logger
::
nas_mm
().
debug
(
"Octet 0x%x"
,
octet
);
digit
[
0
]
=
octet
;
tmsi
|=
octet
;
tmsi
|=
octet
<<
24
;
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"fourth octet 0x%x"
,
octet
);
decoded_size
++
;
Logger
::
nas_mm
().
debug
(
"Octet 0x%x"
,
octet
);
digit
[
1
]
=
octet
;
tmsi
|=
octet
<<
8
;
tmsi
|=
octet
<<
16
;
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"fifth octet 0x%x"
,
octet
);
decoded_size
++
;
Logger
::
nas_mm
().
debug
(
"Octet 0x%x"
,
octet
);
digit
[
2
]
=
octet
;
tmsi
|=
octet
<<
16
;
tmsi
|=
octet
<<
8
;
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"sixth octet 0x%x"
,
octet
);
decoded_size
++
;
Logger
::
nas_mm
().
debug
(
"Octet 0x%x"
,
octet
);
digit
[
3
]
=
octet
;
tmsi
|=
octet
<<
24
;
tmsi
|=
octet
;
_5g_s_tmsi
->
_5g_tmsi
=
(
const
string
)(
std
::
to_string
(
tmsi
));
return
decoded_size
;
}
...
...
src/nas/msgs/ServiceRequest.cpp
View file @
da971243
...
...
@@ -231,6 +231,7 @@ int ServiceRequest::decodefrombuffer(
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI (0x%x)"
,
octet
);
}
break
;
default:
octet
=
0
;
break
;
}
}
Logger
::
nas_mm
().
debug
(
...
...
src/sbi/amf_server/impl/N1N2MessageCollectionDocumentApiImpl.cpp
View file @
da971243
...
...
@@ -90,7 +90,7 @@ 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
sleep
(
1
);
nlohmann
::
json
udsf_response
;
std
::
string
record_id
=
"RECORD_ID=
\'
"
+
supi
+
"
\'
"
;
...
...
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