Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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-SMF
Commits
7dcfb78e
Commit
7dcfb78e
authored
Dec 25, 2023
by
liuyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release
parent
ca1b91c0
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
189 additions
and
516 deletions
+189
-516
.gitignore
.gitignore
+2
-1
smf.log
smf.log
+0
-393
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+25
-0
src/udp/cooudp.cpp
src/udp/cooudp.cpp
+162
-122
No files found.
.gitignore
View file @
7dcfb78e
...
@@ -37,3 +37,4 @@ src/oai_rules_result*
...
@@ -37,3 +37,4 @@ src/oai_rules_result*
test_results_oai_smf.html
test_results_oai_smf.html
.vscode
.vscode
build
build
*.log
\ No newline at end of file
smf.log
deleted
100644 → 0
View file @
ca1b91c0
This diff is collapsed.
Click to expand it.
src/smf_app/smf_context.cpp
View file @
7dcfb78e
...
@@ -5009,6 +5009,8 @@ void smf_context::send_pdu_session_create_response(
...
@@ -5009,6 +5009,8 @@ void smf_context::send_pdu_session_create_response(
udpsmfcontext
[
"up_fseid"
]
=
sp
.
get
()
->
up_fseid
.
seid
;
udpsmfcontext
[
"up_fseid"
]
=
sp
.
get
()
->
up_fseid
.
seid
;
udpsmfcontext
[
"seid"
]
=
sp
.
get
()
->
seid
;
udpsmfcontext
[
"seid"
]
=
sp
.
get
()
->
seid
;
udpsmfcontext
[
"ipv4_address"
]
=
inet_ntoa
(
sp
.
get
()
->
ipv4_address
);
udpsmfcontext
[
"ipv4_address"
]
=
inet_ntoa
(
sp
.
get
()
->
ipv4_address
);
udpsmfcontext
[
"direction"
]
=
"ground_to_satellite"
;
UdpSend_smf
(
udpsmfcontext
,
"10.103.239.31"
,
20023
);
UdpSend_smf
(
udpsmfcontext
,
"10.103.239.31"
,
20023
);
resp
->
res
.
set_json_data
(
json_data
);
resp
->
res
.
set_json_data
(
json_data
);
...
@@ -5075,6 +5077,29 @@ void smf_context::send_pdu_session_update_response(
...
@@ -5075,6 +5077,29 @@ void smf_context::send_pdu_session_update_response(
trigger_ddds
(
scid
,
1
);
trigger_ddds
(
scid
,
1
);
trigger_pdusesest
(
scid
,
1
);
trigger_pdusesest
(
scid
,
1
);
trigger_flexcn_event
(
scid
,
1
);
trigger_flexcn_event
(
scid
,
1
);
Logger
::
smf_app
().
info
(
"---------------liuyu--udpsend"
,
scid
);
nlohmann
::
json
udpsmfcontext_to_ground
;
udpsmfcontext_to_ground
[
"scid"
]
=
scid
;
// udpsmfcontext_to_ground["supi"] = smf_supi_to_string(resp->res.get_supi());
// udpsmfcontext_to_ground["pdu_session_id"] = resp->res.get_pdu_session_id();
// udpsmfcontext_to_ground["dnn"] = resp->res.get_dnn();
// udpsmfcontext_to_ground["snssai"] = resp->res.get_snssai().toString();
// udpsmfcontext_to_ground["pdu_session_type"] = 1;
// supi64_t supi64 = smf_supi_to_u64(resp->res.get_supi());
// std::shared_ptr<smf_context> sc = {};
// sc = smf_app_inst->supi_2_smf_context(supi64);
// std::shared_ptr<smf_pdu_session> sp = {};
// sc.get()->find_pdu_session(resp->res.get_pdu_session_id(), sp);
// udpsmfcontext_to_ground["up_fseid"] = sp.get()->up_fseid.seid;
// udpsmfcontext_to_ground["seid"] = sp.get()->seid;
// udpsmfcontext_to_ground["ipv4_address"] = inet_ntoa(sp.get()->ipv4_address);
udpsmfcontext_to_ground
[
"direction"
]
=
"satellite_to_ground"
;
UdpSend_smf
(
udpsmfcontext_to_ground
,
"10.103.239.47"
,
20023
);
}
break
;
}
break
;
// UE-Triggered Service Request Procedure (Step 1)
// UE-Triggered Service Request Procedure (Step 1)
...
...
src/udp/cooudp.cpp
View file @
7dcfb78e
...
@@ -150,8 +150,13 @@ int udp_server_coop::udp_read_from_peer_smf() {
...
@@ -150,8 +150,13 @@ int udp_server_coop::udp_read_from_peer_smf() {
bytes_received
=
recvfrom
(
serverSocket
,
(
void
*
)
udp_recv
,
UDP_RECV_BUFFER_SIZE
,
0
,
(
struct
sockaddr
*
)
&
r_endpoint
.
addr_storage
,
&
r_endpoint
.
addr_storage_len
);
bytes_received
=
recvfrom
(
serverSocket
,
(
void
*
)
udp_recv
,
UDP_RECV_BUFFER_SIZE
,
0
,
(
struct
sockaddr
*
)
&
r_endpoint
.
addr_storage
,
&
r_endpoint
.
addr_storage_len
);
//bytes_received = recvfrom(serverSocket, udp_recv, UDP_RECV_BUFFER_SIZE , 0, (struct sockaddr*)&r_endpoint.addr_storage, &r_endpoint.addr_storage_len);
//bytes_received = recvfrom(serverSocket, udp_recv, UDP_RECV_BUFFER_SIZE , 0, (struct sockaddr*)&r_endpoint.addr_storage, &r_endpoint.addr_storage_len);
if
(
bytes_received
>
0
){
if
(
bytes_received
>
0
){
std
::
string
received_data
(
reinterpret_cast
<
char
*>
(
udp_recv
),
bytes_received
);
nlohmann
::
json
smfcontext
=
nlohmann
::
json
::
parse
(
received_data
);
if
(
smfcontext
[
"direction"
]
==
"ground_to_satellite"
)
{
printf
(
"smf receive context from ground smf
\n
"
);
Logger
::
smf_app
().
info
(
"smf receive context from ground smf
\n
"
);
std
::
string
received_data
(
reinterpret_cast
<
char
*>
(
udp_recv
),
bytes_received
);
std
::
string
received_data
(
reinterpret_cast
<
char
*>
(
udp_recv
),
bytes_received
);
nlohmann
::
json
smfcontext
=
nlohmann
::
json
::
parse
(
received_data
);
nlohmann
::
json
smfcontext
=
nlohmann
::
json
::
parse
(
received_data
);
supi_t
supi
=
{.
length
=
0
};
supi_t
supi
=
{.
length
=
0
};
...
@@ -261,19 +266,54 @@ int udp_server_coop::udp_read_from_peer_smf() {
...
@@ -261,19 +266,54 @@ int udp_server_coop::udp_read_from_peer_smf() {
smf_qos_flow
current_flow
{};
smf_qos_flow
current_flow
{};
current_flow
=
flow
;
current_flow
=
flow
;
Logger
::
smf_app
().
warn
(
"----------liuyu-------start_asynch_dfs_procedure"
);
//
Logger::smf_app().warn("----------liuyu-------start_asynch_dfs_procedure");
graph
->
start_asynch_dfs_procedure
(
true
,
flow
);
graph
->
start_asynch_dfs_procedure
(
true
,
flow
);
std
::
vector
<
edge
>
dl_edges
;
std
::
vector
<
edge
>
dl_edges
;
std
::
vector
<
edge
>
ul_edges
;
std
::
vector
<
edge
>
ul_edges
;
std
::
shared_ptr
<
pfcp_association
>
upf
=
{};
std
::
shared_ptr
<
pfcp_association
>
upf
=
{};
// Get next UPF for the first N4 session establishment
// Get next UPF for the first N4 session establishment
Logger
::
smf_app
().
warn
(
"----------liuyu-------dfs_next_upf"
);
//
Logger::smf_app().warn("----------liuyu-------dfs_next_upf");
graph
->
dfs_next_upf
(
dl_edges
,
ul_edges
,
upf
);
graph
->
dfs_next_upf
(
dl_edges
,
ul_edges
,
upf
);
}
}
else
{
else
{
Logger
::
smf_app
().
warn
(
"Could not retrieve the corresponding SMF PDU Session context!"
);
Logger
::
smf_app
().
warn
(
"Could not retrieve the corresponding SMF PDU Session context!"
);
}
}
}
}
else
{
Logger
::
smf_app
().
info
(
"ground smf receive context from satellite smf
\n
"
);
scid_t
scid
=
smfcontext
[
"scid"
];
std
::
shared_ptr
<
smf_context_ref
>
scf
=
{};
if
(
!
smf_app_inst
->
is_scid_2_smf_context
(
scid
))
{
Logger
::
smf_app
().
error
(
"Error, cooudp smf_context_ref don't exist"
SCID_FMT
" does not exit!"
,
scid
);
}
else
{
scf
=
smf_app_inst
->
scid_2_smf_context
(
scid
);
}
std
::
shared_ptr
<
smf_context
>
sc
=
{};
// supi_t supi = {.length = 0};
// std::string supiudp = smfcontext["supi"];
// smf_string_to_supi(&supi, supiudp.c_str());
supi64_t
supi64
=
smf_supi_to_u64
(
scf
.
get
()
->
supi
);
if
(
!
smf_app_inst
->
is_supi_2_smf_context
(
supi64
))
{
Logger
::
smf_app
().
error
(
"Error, cooudp smf_context don't exist"
SUPI_64_FMT
""
,
supi64
);
}
else
{
sc
=
smf_app_inst
->
supi_2_smf_context
(
supi64
);
}
std
::
shared_ptr
<
smf_pdu_session
>
sps
=
{};
if
(
!
sc
.
get
()
->
find_pdu_session
(
scf
.
get
()
->
pdu_session_id
,
sps
))
{
Logger
::
smf_app
().
error
(
"Error, cooudp PDU session don't exist"
);
}
sps
->
set_pdu_session_status
(
pdu_session_status_e
::
PDU_SESSION_ACTIVE
);
sps
->
set_upCnx_state
(
upCnx_state_e
::
UPCNX_STATE_ACTIVATED
);
}
}
}
}
return
0
;
return
0
;
}
}
...
@@ -302,15 +342,15 @@ int udp_server_coop::udp_read_from_socket_to_center() {
...
@@ -302,15 +342,15 @@ int udp_server_coop::udp_read_from_socket_to_center() {
//bytes_received = recvfrom(serverSocket, udp_recv, UDP_RECV_BUFFER_SIZE , 0, (struct sockaddr*)&r_endpoint.addr_storage, &r_endpoint.addr_storage_len);
//bytes_received = recvfrom(serverSocket, udp_recv, UDP_RECV_BUFFER_SIZE , 0, (struct sockaddr*)&r_endpoint.addr_storage, &r_endpoint.addr_storage_len);
if
(
bytes_received
>
0
){
if
(
bytes_received
>
0
){
printf
(
"smf receive udp success from satellite amf
\n
"
);
//
printf("smf receive udp success from satellite amf\n");
gettimeofday
(
&
time
,
NULL
);
//
gettimeofday(&time, NULL);
// std::cout<<"receive from plugin, ms: "<<(time.tv_sec*1000 + time.tv_usec/1000)<<std::endl;
// std::cout<<"receive from plugin, ms: "<<(time.tv_sec*1000 + time.tv_usec/1000)<<std::endl;
// cout<<"bytes"<<bytes_received<<endl;
// cout<<"bytes"<<bytes_received<<endl;
// cout<<"content:"<<udp_recv<<endl;
// cout<<"content:"<<udp_recv<<endl;
// string udp_recv_str(&udp_recv[0],&udp_recv[strlen(udp_recv)]);
// string udp_recv_str(&udp_recv[0],&udp_recv[strlen(udp_recv)]);
// cout<<"content:"<<udp_recv_str<<endl;
// cout<<"content:"<<udp_recv_str<<endl;
// handle_receive_udp(bytes_received,udp_recv);
// handle_receive_udp(bytes_received,udp_recv);
printf
(
"smf send udp to center amf
\n
"
);
//
printf("smf send udp to center amf\n");
UdpSend
(
udp_recv
,
bytes_received
,
"10.103.239.47"
,
20003
);
UdpSend
(
udp_recv
,
bytes_received
,
"10.103.239.47"
,
20003
);
// assoc_id++;
// assoc_id++;
...
@@ -344,15 +384,15 @@ int udp_server_coop::udp_read_from_socket_from_center() {
...
@@ -344,15 +384,15 @@ int udp_server_coop::udp_read_from_socket_from_center() {
//bytes_received = recvfrom(serverSocket, udp_recv, UDP_RECV_BUFFER_SIZE , 0, (struct sockaddr*)&r_endpoint.addr_storage, &r_endpoint.addr_storage_len);
//bytes_received = recvfrom(serverSocket, udp_recv, UDP_RECV_BUFFER_SIZE , 0, (struct sockaddr*)&r_endpoint.addr_storage, &r_endpoint.addr_storage_len);
if
(
bytes_received
>
0
){
if
(
bytes_received
>
0
){
printf
(
"smf receive udp success from center amf
\n
"
);
//
printf("smf receive udp success from center amf\n");
gettimeofday
(
&
time
,
NULL
);
//
gettimeofday(&time, NULL);
// std::cout<<"receive from plugin, ms: "<<(time.tv_sec*1000 + time.tv_usec/1000)<<std::endl;
// std::cout<<"receive from plugin, ms: "<<(time.tv_sec*1000 + time.tv_usec/1000)<<std::endl;
// cout<<"bytes"<<bytes_received<<endl;
// cout<<"bytes"<<bytes_received<<endl;
// cout<<"content:"<<udp_recv<<endl;
// cout<<"content:"<<udp_recv<<endl;
// string udp_recv_str(&udp_recv[0],&udp_recv[strlen(udp_recv)]);
// string udp_recv_str(&udp_recv[0],&udp_recv[strlen(udp_recv)]);
// cout<<"content:"<<udp_recv_str<<endl;
// cout<<"content:"<<udp_recv_str<<endl;
// handle_receive_udp(bytes_received,udp_recv);
// handle_receive_udp(bytes_received,udp_recv);
printf
(
"smf send udp to satellite amf
\n
"
);
//
printf("smf send udp to satellite amf\n");
UdpSend
(
udp_recv
,
bytes_received
,
"10.103.239.31"
,
20002
);
UdpSend
(
udp_recv
,
bytes_received
,
"10.103.239.31"
,
20002
);
// assoc_id++;
// assoc_id++;
...
...
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