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
99634b3b
Commit
99634b3b
authored
Jun 25, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add default value for SD
parent
a82bfecd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
33 deletions
+89
-33
src/common/smf.h
src/common/smf.h
+4
-2
src/smf_app/smf_config.cpp
src/smf_app/smf_config.cpp
+26
-15
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+49
-14
src/smf_app/smf_context.hpp
src/smf_app/smf_context.hpp
+10
-2
No files found.
src/common/smf.h
View file @
99634b3b
...
...
@@ -32,6 +32,8 @@ typedef uint64_t supi64_t;
#define SUPI_DIGITS_MAX 15
const
uint32_t
SD_NO_VALUE
=
0xFFFFFF
;
const
std
::
string
SD_NO_VALUE_STR
=
"0xFFFFFF"
;
const
uint8_t
SST_MAX_STANDARDIZED_VALUE
=
127
;
typedef
struct
{
...
...
@@ -176,8 +178,8 @@ enum class sm_context_status_e {
SM_CONTEXT_STATUS_RELEASED
=
1
};
static
const
std
::
vector
<
std
::
string
>
sm_context_status_e2str
=
{
"ACTIVE"
,
"RELEASED"
};
static
const
std
::
vector
<
std
::
string
>
sm_context_status_e2str
=
{
"ACTIVE"
,
"RELEASED"
};
typedef
struct
qos_profile_gbr_s
{
gfbr_t
gfbr
;
// Guaranteed Flow Bit Rate
...
...
src/smf_app/smf_config.cpp
View file @
99634b3b
...
...
@@ -802,7 +802,7 @@ int smf_config::load(const string& config_file) {
session_management_subscription_t
sub_item
=
{};
unsigned
int
nssai_sst
=
0
;
string
nssai_sd
=
{}
;
string
nssai_sd
=
SD_NO_VALUE_STR
;
string
dnn
=
{};
string
default_session_type
=
{};
unsigned
int
default_ssc_mode
=
0
;
...
...
@@ -1057,10 +1057,21 @@ void smf_config::display() {
for
(
auto
sub
:
session_management_subscriptions
)
{
Logger
::
smf_app
().
info
(
" Session Management Subscription Data %d:"
,
index
);
Logger
::
smf_app
().
info
(
" "
SMF_CONFIG_STRING_NSSAI_SST
": %d, "
SMF_CONFIG_STRING_NSSAI_SD
" %s"
,
sub
.
single_nssai
.
sST
,
sub
.
single_nssai
.
sD
.
c_str
());
std
::
string
nssai_str
=
{};
nssai_str
=
nssai_str
.
append
(
" "
)
.
append
(
SMF_CONFIG_STRING_NSSAI_SST
)
.
append
(
": "
)
.
append
(
std
::
to_string
(
sub
.
single_nssai
.
sST
));
if
(
!
boost
::
iequals
(
sub
.
single_nssai
.
sD
,
"0xffffff"
))
{
nssai_str
=
nssai_str
.
append
(
", "
)
.
append
(
SMF_CONFIG_STRING_NSSAI_SD
)
.
append
(
": "
)
.
append
(
sub
.
single_nssai
.
sD
);
}
Logger
::
smf_app
().
info
(
"%s"
,
nssai_str
.
c_str
());
Logger
::
smf_app
().
info
(
" "
SMF_CONFIG_STRING_DNN
": %s"
,
sub
.
dnn
.
c_str
());
Logger
::
smf_app
().
info
(
...
...
src/smf_app/smf_context.cpp
View file @
99634b3b
...
...
@@ -3558,25 +3558,50 @@ bool smf_context::handle_ho_cancellation(
return
true
;
}
//------------------------------------------------------------------------------
void
smf_context
::
get_snssai_key
(
const
snssai_t
&
snssai
,
uint32_t
&
key
)
{
uint32_t
sd
=
SD_NO_VALUE
;
try
{
sd
=
std
::
stoul
(
snssai
.
sD
,
nullptr
,
10
);
}
catch
(
const
std
::
exception
&
e
)
{
Logger
::
smf_app
().
warn
(
"Error when converting from string to int for snssai.SD, error: %s"
,
e
.
what
());
}
key
=
(
sd
<<
8
|
snssai
.
sST
);
}
//------------------------------------------------------------------------------
void
smf_context
::
insert_dnn_subscription
(
const
snssai_t
&
snssai
,
std
::
shared_ptr
<
session_management_subscription
>&
ss
)
{
// Get a unique key from S-NSSAI
uint32_t
key
=
0
;
get_snssai_key
(
snssai
,
key
);
std
::
unique_lock
<
std
::
recursive_mutex
>
lock
(
m_context
);
dnn_subscriptions
[
(
uint8_t
)
snssai
.
sST
]
=
ss
;
dnn_subscriptions
[
key
]
=
ss
;
Logger
::
smf_app
().
info
(
"Inserted DNN Subscription, key: %d"
,
(
uint8_t
)
snssai
.
sST
);
"Inserted DNN Subscription, key: %ld (SST %d, SD %s)"
,
key
,
snssai
.
sST
,
snssai
.
sD
.
c_str
());
}
//------------------------------------------------------------------------------
void
smf_context
::
insert_dnn_subscription
(
const
snssai_t
&
snssai
,
const
std
::
string
&
dnn
,
std
::
shared_ptr
<
session_management_subscription
>&
ss
)
{
// Get a unique key from S-NSSAI
uint32_t
key
=
0
;
get_snssai_key
(
snssai
,
key
);
std
::
unique_lock
<
std
::
recursive_mutex
>
lock
(
m_context
);
if
(
dnn_subscriptions
.
count
((
uint8_t
)
snssai
.
sST
)
>
0
)
{
if
(
dnn_subscriptions
.
count
(
key
)
>
0
)
{
std
::
shared_ptr
<
session_management_subscription
>
old_ss
=
dnn_subscriptions
.
at
(
(
uint8_t
)
snssai
.
sST
);
dnn_subscriptions
.
at
(
key
);
std
::
shared_ptr
<
dnn_configuration_t
>
dnn_configuration
=
{};
ss
.
get
()
->
find_dnn_configuration
(
dnn
,
dnn_configuration
);
...
...
@@ -3585,20 +3610,24 @@ void smf_context::insert_dnn_subscription(
}
}
else
{
dnn_subscriptions
[
(
uint8_t
)
snssai
.
sST
]
=
ss
;
dnn_subscriptions
[
key
]
=
ss
;
}
Logger
::
smf_app
().
info
(
"Inserted DNN Subscription, key: %
d, dnn %s"
,
(
uint8_t
)
snssai
.
sST
,
dnn
.
c_str
());
"Inserted DNN Subscription, key: %
ld (SST %d, SD %s), dnn %s"
,
key
,
snssai
.
sST
,
snssai
.
sD
.
c_str
(),
dnn
.
c_str
());
}
//------------------------------------------------------------------------------
bool
smf_context
::
is_dnn_snssai_subscription_data
(
const
std
::
string
&
dnn
,
const
snssai_t
&
snssai
)
{
// Get a unique key from S-NSSAI
uint32_t
key
=
0
;
get_snssai_key
(
snssai
,
key
);
std
::
unique_lock
<
std
::
recursive_mutex
>
lock
(
m_context
);
if
(
dnn_subscriptions
.
count
(
(
uint8_t
)
snssai
.
sST
)
>
0
)
{
if
(
dnn_subscriptions
.
count
(
key
)
>
0
)
{
std
::
shared_ptr
<
session_management_subscription
>
ss
=
dnn_subscriptions
.
at
(
(
uint8_t
)
snssai
.
sST
);
dnn_subscriptions
.
at
(
key
);
if
(
ss
.
get
()
->
dnn_configuration
(
dnn
))
return
true
;
else
...
...
@@ -3611,17 +3640,23 @@ bool smf_context::is_dnn_snssai_subscription_data(
bool
smf_context
::
find_dnn_subscription
(
const
snssai_t
&
snssai
,
std
::
shared_ptr
<
session_management_subscription
>&
ss
)
{
// Get a unique key from S-NSSAI
uint32_t
key
=
0
;
get_snssai_key
(
snssai
,
key
);
Logger
::
smf_app
().
info
(
"Find a DNN Subscription with key: %d, map size %d"
,
(
uint8_t
)
snssai
.
sST
,
dnn_subscriptions
.
size
());
"Find a DNN Subscription with key: %ld (SST %d, SD %s), map size %d"
,
(
uint8_t
)
snssai
.
sST
,
snssai
.
sD
.
c_str
(),
dnn_subscriptions
.
size
());
std
::
unique_lock
<
std
::
recursive_mutex
>
lock
(
m_context
);
if
(
dnn_subscriptions
.
count
(
(
uint8_t
)
snssai
.
sST
)
>
0
)
{
ss
=
dnn_subscriptions
.
at
(
(
uint8_t
)
snssai
.
sST
);
if
(
dnn_subscriptions
.
count
(
key
)
>
0
)
{
ss
=
dnn_subscriptions
.
at
(
key
);
return
true
;
}
Logger
::
smf_app
().
info
(
"DNN subscription (SNSSAI %d) not found"
,
(
uint8_t
)
snssai
.
sST
);
"DNN subscription (SST %d, SD %s) not found"
,
(
uint8_t
)
snssai
.
sST
,
snssai
.
sD
.
c_str
());
return
false
;
}
...
...
src/smf_app/smf_context.hpp
View file @
99634b3b
...
...
@@ -1082,6 +1082,14 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
const
snssai_t
&
snssai
,
std
::
shared_ptr
<
session_management_subscription
>&
ss
);
/*
* Get a unique key from SNSSAI
* @param [const snssai_t&] snssai
* @param [uint32_t&] key: generated key
* @return void
*/
void
get_snssai_key
(
const
snssai_t
&
snssai
,
uint32_t
&
key
);
/*
* Convert all members of this class to string for logging
* @return std::string
...
...
@@ -1350,8 +1358,8 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
private:
std
::
vector
<
std
::
shared_ptr
<
smf_procedure
>>
pending_procedures
;
// snssai
-sst
<-> session management subscription
std
::
map
<
uint
8
_t
,
std
::
shared_ptr
<
session_management_subscription
>>
// snssai <-> session management subscription
std
::
map
<
uint
32
_t
,
std
::
shared_ptr
<
session_management_subscription
>>
dnn_subscriptions
;
std
::
map
<
pdu_session_id_t
,
std
::
shared_ptr
<
smf_pdu_session
>>
pdu_sessions
;
// Store all PDU Sessions associated with this UE
...
...
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