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
ca1b91c0
Commit
ca1b91c0
authored
Dec 19, 2023
by
liuyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
concourrence is ok
parent
c4c3269b
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
414 additions
and
10 deletions
+414
-10
smf.log
smf.log
+393
-0
src/common/smf.h
src/common/smf.h
+2
-2
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+2
-2
src/smf_app/smf_context.hpp
src/smf_app/smf_context.hpp
+0
-1
src/udp/cooudp.cpp
src/udp/cooudp.cpp
+17
-5
No files found.
smf.log
0 → 100644
View file @
ca1b91c0
This diff is collapsed.
Click to expand it.
src/common/smf.h
View file @
ca1b91c0
...
@@ -288,7 +288,7 @@ typedef struct qos_profile_s {
...
@@ -288,7 +288,7 @@ typedef struct qos_profile_s {
#define NNRF_NF_STATUS_NOTIFY_BASE "/nsmf-nfstatus-notify/"
#define NNRF_NF_STATUS_NOTIFY_BASE "/nsmf-nfstatus-notify/"
// for CURL
// for CURL
#define NF_CURL_TIMEOUT_MS 100L
#define NF_CURL_TIMEOUT_MS 100
0
L
#define MAX_WAIT_MSECS 10000 // 1 second
#define MAX_WAIT_MSECS 10000 // 1 second
#define AMF_NUMBER_RETRIES 3
#define AMF_NUMBER_RETRIES 3
#define UDM_NUMBER_RETRIES 3
#define UDM_NUMBER_RETRIES 3
...
@@ -298,7 +298,7 @@ constexpr auto CURL_MIME_BOUNDARY = "----Boundary";
...
@@ -298,7 +298,7 @@ constexpr auto CURL_MIME_BOUNDARY = "----Boundary";
#define BUF_LEN 512
#define BUF_LEN 512
// FOR FUTURE PROMISE
// FOR FUTURE PROMISE
#define FUTURE_STATUS_TIMEOUT_MS 100
#define FUTURE_STATUS_TIMEOUT_MS 100
0
// for PFCP
// for PFCP
constexpr
uint64_t
SECONDS_SINCE_FIRST_EPOCH
=
2208988800
;
constexpr
uint64_t
SECONDS_SINCE_FIRST_EPOCH
=
2208988800
;
...
...
src/smf_app/smf_context.cpp
View file @
ca1b91c0
...
@@ -3850,13 +3850,13 @@ bool smf_context::find_pdu_session(
...
@@ -3850,13 +3850,13 @@ bool smf_context::find_pdu_session(
const
pdu_session_id_t
&
psi
,
std
::
shared_ptr
<
smf_pdu_session
>&
sp
)
const
{
const
pdu_session_id_t
&
psi
,
std
::
shared_ptr
<
smf_pdu_session
>&
sp
)
const
{
Logger
::
smf_app
().
info
(
"Find PDU Session with ID %d"
,
psi
);
Logger
::
smf_app
().
info
(
"Find PDU Session with ID %d"
,
psi
);
std
::
shared_lock
lock
(
m_pdu_sessions_mutex
);
std
::
shared_lock
lock
(
m_pdu_sessions_mutex
);
Logger
::
smf_app
().
warn
(
"---liuyu----pdu_sessions.count %d------------"
,
pdu_sessions
.
count
(
psi
));
if
(
pdu_sessions
.
count
(
psi
)
>
0
)
{
if
(
pdu_sessions
.
count
(
psi
)
>
0
)
{
sp
=
pdu_sessions
.
at
(
psi
);
sp
=
pdu_sessions
.
at
(
psi
);
if
(
sp
)
return
true
;
if
(
sp
)
return
true
;
}
}
return
false
;
return
false
;
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
bool
smf_context
::
find_pdu_session
(
bool
smf_context
::
find_pdu_session
(
const
pfcp
::
pdr_id_t
&
pdr_id
,
pfcp
::
qfi_t
&
qfi
,
const
pfcp
::
pdr_id_t
&
pdr_id
,
pfcp
::
qfi_t
&
qfi
,
...
@@ -3893,6 +3893,7 @@ bool smf_context::add_pdu_session(
...
@@ -3893,6 +3893,7 @@ bool smf_context::add_pdu_session(
pdu_sessions
.
insert
(
pdu_sessions
.
insert
(
std
::
pair
<
pdu_session_id_t
,
std
::
shared_ptr
<
smf_pdu_session
>>
(
std
::
pair
<
pdu_session_id_t
,
std
::
shared_ptr
<
smf_pdu_session
>>
(
psi
,
sp
));
psi
,
sp
));
Logger
::
smf_app
().
debug
(
Logger
::
smf_app
().
debug
(
"PDU Session Id (%d) has been added successfully"
,
psi
);
"PDU Session Id (%d) has been added successfully"
,
psi
);
return
true
;
return
true
;
...
@@ -5009,7 +5010,6 @@ void smf_context::send_pdu_session_create_response(
...
@@ -5009,7 +5010,6 @@ void smf_context::send_pdu_session_create_response(
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
);
UdpSend_smf
(
udpsmfcontext
,
"10.103.239.31"
,
20023
);
UdpSend_smf
(
udpsmfcontext
,
"10.103.239.31"
,
20023
);
// json_data["smfcontext"] = udpsmfcontext.dump();
resp
->
res
.
set_json_data
(
json_data
);
resp
->
res
.
set_json_data
(
json_data
);
...
...
src/smf_app/smf_context.hpp
View file @
ca1b91c0
...
@@ -59,7 +59,6 @@ extern "C" {
...
@@ -59,7 +59,6 @@ extern "C" {
}
}
using
namespace
boost
::
placeholders
;
using
namespace
boost
::
placeholders
;
namespace
smf
{
namespace
smf
{
class
smf_pdu_session
:
public
std
::
enable_shared_from_this
<
smf_pdu_session
>
{
class
smf_pdu_session
:
public
std
::
enable_shared_from_this
<
smf_pdu_session
>
{
...
...
src/udp/cooudp.cpp
View file @
ca1b91c0
...
@@ -166,8 +166,13 @@ int udp_server_coop::udp_read_from_peer_smf() {
...
@@ -166,8 +166,13 @@ int udp_server_coop::udp_read_from_peer_smf() {
scf
.
get
()
->
pdu_session_id
=
smfcontext
[
"pdu_session_id"
];
scf
.
get
()
->
pdu_session_id
=
smfcontext
[
"pdu_session_id"
];
smf_app_inst
->
set_scid_2_smf_context
(
scid
,
scf
);
smf_app_inst
->
set_scid_2_smf_context
(
scid
,
scf
);
}
}
else
{
scf
=
smf_app_inst
->
scid_2_smf_context
(
scid
);
}
supi64_t
supi64
=
smf_supi_to_u64
(
supi
);
supi64_t
supi64
=
smf_supi_to_u64
(
supi
);
uint64_t
seid
=
smfcontext
[
"seid"
];
std
::
shared_ptr
<
smf_context
>
sc
=
{};
std
::
shared_ptr
<
smf_context
>
sc
=
{};
if
(
!
smf_app_inst
->
is_supi_2_smf_context
(
supi64
))
{
if
(
!
smf_app_inst
->
is_supi_2_smf_context
(
supi64
))
{
Logger
::
smf_app
().
debug
(
"Create a new SMF context with SUPI "
SUPI_64_FMT
""
,
supi64
);
Logger
::
smf_app
().
debug
(
"Create a new SMF context with SUPI "
SUPI_64_FMT
""
,
supi64
);
...
@@ -176,9 +181,13 @@ int udp_server_coop::udp_read_from_peer_smf() {
...
@@ -176,9 +181,13 @@ int udp_server_coop::udp_read_from_peer_smf() {
// sc.get()->set_supi_prefix(supi_prefix);
// sc.get()->set_supi_prefix(supi_prefix);
smf_app_inst
->
set_supi_2_smf_context
(
supi64
,
sc
);
smf_app_inst
->
set_supi_2_smf_context
(
supi64
,
sc
);
// sc.get()->set_plmn(smreq->req.get_plmn()); // PLMN
// sc.get()->set_plmn(smreq->req.get_plmn()); // PLMN
}
uint64_t
seid
=
smfcontext
[
"seid"
];
smf_app_inst
->
set_seid_2_smf_context
(
seid
,
sc
);
smf_app_inst
->
set_seid_2_smf_context
(
seid
,
sc
);
}
else
{
sc
=
smf_app_inst
->
supi_2_smf_context
(
supi64
);
}
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
...
@@ -187,7 +196,7 @@ int udp_server_coop::udp_read_from_peer_smf() {
...
@@ -187,7 +196,7 @@ int udp_server_coop::udp_read_from_peer_smf() {
sp
=
std
::
shared_ptr
<
smf_pdu_session
>
(
new
smf_pdu_session
(
scf
.
get
()
->
pdu_session_id
));
sp
=
std
::
shared_ptr
<
smf_pdu_session
>
(
new
smf_pdu_session
(
scf
.
get
()
->
pdu_session_id
));
sp
.
get
()
->
pdu_session_type
.
pdu_session_type
=
smfcontext
[
"pdu_session_type"
];
sp
.
get
()
->
pdu_session_type
.
pdu_session_type
=
smfcontext
[
"pdu_session_type"
];
sc
.
get
()
->
add_pdu_session
(
scf
.
get
()
->
pdu_session_id
,
sp
);
sc
.
get
()
->
add_pdu_session
(
scf
.
get
()
->
pdu_session_id
,
sp
);
}
std
::
string
dnn
=
smfcontext
[
"dnn"
];
std
::
string
dnn
=
smfcontext
[
"dnn"
];
snssai_t
snssai
=
{};
snssai_t
snssai
=
{};
...
@@ -260,7 +269,10 @@ int udp_server_coop::udp_read_from_peer_smf() {
...
@@ -260,7 +269,10 @@ int udp_server_coop::udp_read_from_peer_smf() {
// 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
{
Logger
::
smf_app
().
warn
(
"Could not retrieve the corresponding SMF PDU Session context!"
);
}
}
}
}
}
return
0
;
return
0
;
...
...
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