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
5d1a394d
Commit
5d1a394d
authored
Apr 08, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the same QoS class for created/updated flow
parent
8d1322cc
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
243 additions
and
153 deletions
+243
-153
src/smf_app/smf_msg.cpp
src/smf_app/smf_msg.cpp
+30
-34
src/smf_app/smf_msg.hpp
src/smf_app/smf_msg.hpp
+24
-43
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+184
-65
src/smf_app/smf_procedure.hpp
src/smf_app/smf_procedure.hpp
+5
-11
No files found.
src/smf_app/smf_msg.cpp
View file @
5d1a394d
...
...
@@ -28,58 +28,47 @@
*/
#include "smf_msg.hpp"
using
namespace
smf
;
//-----------------------------------------------------------------------------
void
qos_flow_context_
cre
ated
::
set_cause
(
const
uint8_t
cause
)
void
qos_flow_context_
upd
ated
::
set_cause
(
const
uint8_t
cause
)
{
cause_value
=
cause
;
}
//-----------------------------------------------------------------------------
void
qos_flow_context_
cre
ated
::
set_qfi
(
const
pfcp
::
qfi_t
&
q
)
void
qos_flow_context_
upd
ated
::
set_qfi
(
const
pfcp
::
qfi_t
&
q
)
{
qfi
=
q
;
}
//-----------------------------------------------------------------------------
void
qos_flow_context_
cre
ated
::
set_ul_fteid
(
const
fteid_t
&
teid
)
void
qos_flow_context_
upd
ated
::
set_ul_fteid
(
const
fteid_t
&
teid
)
{
ul_fteid
=
teid
;
}
//-----------------------------------------------------------------------------
void
qos_flow_context_
created
::
set_arp
(
const
arp_5gc_t
&
a
)
void
qos_flow_context_
updated
::
set_dl_fteid
(
const
fteid_t
&
teid
)
{
arp
=
a
;
dl_fteid
=
teid
;
}
//-----------------------------------------------------------------------------
void
qos_flow_context_created
::
set_priority_level
(
uint8_t
p
)
{
priority_level
=
p
;
}
//-----------------------------------------------------------------------------
void
qos_flow_context_created
::
set_qos_rule
(
const
QOSRulesIE
&
rule
)
void
qos_flow_context_updated
::
set_qos_rule
(
const
QOSRulesIE
&
rule
)
{
qos_rule
=
rule
;
}
//-----------------------------------------------------------------------------
void
qos_flow_context_modified
::
set_cause
(
const
uint8_t
cause
)
{
cause_value
=
cause
;
}
//-----------------------------------------------------------------------------
void
qos_flow_context_modified
::
set_qfi
(
const
pfcp
::
qfi_t
&
q
)
void
qos_flow_context_updated
::
set_qos_profile
(
const
qos_profile_t
&
profile
)
{
q
fi
=
q
;
q
os_profile
=
profile
;
}
//-----------------------------------------------------------------------------
void
qos_flow_context_
modified
::
set_ul_fteid
(
const
fteid_t
&
teid
)
void
qos_flow_context_
updated
::
set_priority_level
(
uint8_t
p
)
{
ul_fteid
=
teid
;
//priority_level = p;
qos_profile
.
priority_level
=
p
;
}
//-----------------------------------------------------------------------------
...
...
@@ -166,17 +155,18 @@ std::string pdu_session_msg::get_api_root() const
}
//-----------------------------------------------------------------------------
uint8_t
pdu_session_
create_sm_context
::
get_pdu_session_type
()
const
uint8_t
pdu_session_
msg
::
get_pdu_session_type
()
const
{
return
m_pdu_session_type
;
}
//-----------------------------------------------------------------------------
void
pdu_session_
create_sm_context
::
set_pdu_session_type
(
uint8_t
const
&
pdu_session_type
)
void
pdu_session_
msg
::
set_pdu_session_type
(
uint8_t
const
&
pdu_session_type
)
{
m_pdu_session_type
=
pdu_session_type
;
}
//-----------------------------------------------------------------------------
extended_protocol_discriminator_t
pdu_session_create_sm_context
::
get_epd
()
const
{
...
...
@@ -306,13 +296,13 @@ Pistache::Http::Code pdu_session_create_sm_context_response::get_http_code()
}
//-----------------------------------------------------------------------------
void
pdu_session_create_sm_context_response
::
set_qos_flow_context
(
const
qos_flow_context_
cre
ated
&
qos_flow
)
void
pdu_session_create_sm_context_response
::
set_qos_flow_context
(
const
qos_flow_context_
upd
ated
&
qos_flow
)
{
qos_flow_context
=
qos_flow
;
}
//-----------------------------------------------------------------------------
qos_flow_context_
cre
ated
pdu_session_create_sm_context_response
::
get_qos_flow_context
()
const
qos_flow_context_
upd
ated
pdu_session_create_sm_context_response
::
get_qos_flow_context
()
const
{
return
qos_flow_context
;
}
...
...
@@ -544,11 +534,11 @@ bool pdu_session_update_sm_context_response::n2_sm_info_is_set() const
}
//-----------------------------------------------------------------------------
void
pdu_session_update_sm_context_response
::
add_qos_flow_context_
modified
(
const
qos_flow_context_modifi
ed
&
flow
)
void
pdu_session_update_sm_context_response
::
add_qos_flow_context_
updated
(
const
qos_flow_context_updat
ed
&
flow
)
{
if
((
flow
.
qfi
.
qfi
>=
QOS_FLOW_IDENTIFIER_FIRST
)
and
(
flow
.
qfi
.
qfi
<=
QOS_FLOW_IDENTIFIER_LAST
))
{
qos_flow_context_
modifi
eds
.
erase
(
flow
.
qfi
.
qfi
);
qos_flow_context_
modifieds
.
insert
(
std
::
pair
<
uint8_t
,
qos_flow_context_modifi
ed
>
((
uint8_t
)
flow
.
qfi
.
qfi
,
flow
));
qos_flow_context_
updat
eds
.
erase
(
flow
.
qfi
.
qfi
);
qos_flow_context_
updateds
.
insert
(
std
::
pair
<
uint8_t
,
qos_flow_context_updat
ed
>
((
uint8_t
)
flow
.
qfi
.
qfi
,
flow
));
Logger
::
smf_app
().
trace
(
"pdu_session_update_sm_context_response::add_qos_flow_context(%d) success"
,
flow
.
qfi
.
qfi
);
}
else
{
Logger
::
smf_app
().
error
(
"pdu_session_update_sm_context_response::add_qos_flow_context(%d) failed, invalid QFI"
,
flow
.
qfi
.
qfi
);
...
...
@@ -556,9 +546,9 @@ void pdu_session_update_sm_context_response::add_qos_flow_context_modified(const
}
//-----------------------------------------------------------------------------
bool
pdu_session_update_sm_context_response
::
get_qos_flow_context_
modified
(
const
pfcp
::
qfi_t
&
qfi
,
qos_flow_context_modifi
ed
&
flow
)
bool
pdu_session_update_sm_context_response
::
get_qos_flow_context_
updated
(
const
pfcp
::
qfi_t
&
qfi
,
qos_flow_context_updat
ed
&
flow
)
{
for
(
auto
it
:
qos_flow_context_
modifi
eds
)
{
for
(
auto
it
:
qos_flow_context_
updat
eds
)
{
if
(
it
.
second
.
qfi
==
qfi
)
{
flow
=
it
.
second
;
return
true
;
...
...
@@ -569,13 +559,19 @@ bool pdu_session_update_sm_context_response::get_qos_flow_context_modified (cons
//-----------------------------------------------------------------------------
void
pdu_session_update_sm_context_response
::
get_all_qos_flow_context_
modifieds
(
std
::
map
<
uint8_t
,
qos_flow_context_modifi
ed
>&
all_flows
)
void
pdu_session_update_sm_context_response
::
get_all_qos_flow_context_
updateds
(
std
::
map
<
uint8_t
,
qos_flow_context_updat
ed
>&
all_flows
)
{
for
(
auto
it
:
qos_flow_context_
modifi
eds
)
{
all_flows
.
insert
(
std
::
pair
<
uint8_t
,
qos_flow_context_
modifi
ed
>
((
uint8_t
)
it
.
first
,
it
.
second
));
for
(
auto
it
:
qos_flow_context_
updat
eds
)
{
all_flows
.
insert
(
std
::
pair
<
uint8_t
,
qos_flow_context_
updat
ed
>
((
uint8_t
)
it
.
first
,
it
.
second
));
}
}
//-----------------------------------------------------------------------------
void
pdu_session_update_sm_context_response
::
remove_all_qos_flow_context_updateds
()
{
qos_flow_context_updateds
.
clear
();
}
src/smf_app/smf_msg.hpp
View file @
5d1a394d
...
...
@@ -29,8 +29,8 @@
#ifndef FILE_SMF_MSG_HPP_SEEN
#define FILE_SMF_MSG_HPP_SEEN
#include "smf.h"
#include "pistache/http.h"
#include "smf.h"
#include "3gpp_29.274.h"
#include "3gpp_29.244.h"
#include "3gpp_24.007.h"
...
...
@@ -57,41 +57,31 @@ typedef enum {
namespace
smf
{
class
qos_flow_context_created
{
//QoS flow created or modified
class
qos_flow_context_updated
{
public:
void
set_cause
(
const
uint8_t
cause
);
void
set_qfi
(
const
pfcp
::
qfi_t
&
q
);
void
set_ul_fteid
(
const
fteid_t
&
teid
);
void
set_arp
(
const
arp_5gc_t
&
a
);
void
set_priority_level
(
uint8_t
p
);
void
set_dl_fteid
(
const
fteid_t
&
teid
);
void
set_qos_rule
(
const
QOSRulesIE
&
rule
);
void
set_qos_profile
(
const
qos_profile_t
&
profile
);
void
set_priority_level
(
uint8_t
p
);
uint8_t
cause_value
;
pfcp
::
qfi_t
qfi
;
fteid_t
ul_fteid
;
arp_5gc_t
arp
;
uint8_t
priority_level
;
//1-127
fteid_t
dl_fteid
;
QOSRulesIE
qos_rule
;
qos_profile_t
qos_profile
;
};
//---------------------------------------------------------------------------------------
class
qos_flow_context_modified
{
public:
void
set_cause
(
const
uint8_t
cause
);
void
set_qfi
(
const
pfcp
::
qfi_t
&
q
);
void
set_ul_fteid
(
const
fteid_t
&
teid
);
uint8_t
cause_value
;
pfcp
::
qfi_t
qfi
;
fteid_t
ul_fteid
;
};
//---------------------------------------------------------------------------------------
class
pdu_session_msg
{
public:
pdu_session_msg
()
:
m_msg_type
(),
m_supi
(),
m_pdu_session_id
(),
m_dnn
(),
m_snssai
(){};
pdu_session_msg
(
pdu_session_msg_type_t
msg_type
)
:
m_msg_type
(
msg_type
),
m_supi
(),
m_pdu_session_id
(),
m_dnn
(),
m_snssai
(){};
pdu_session_msg
(
pdu_session_msg_type_t
msg_type
,
supi_t
supi
,
pdu_session_id_t
pdi
,
std
::
string
dnn
,
snssai_t
snssai
)
:
m_msg_type
(
msg_type
),
m_supi
(
supi
),
m_pdu_session_id
(
pdi
),
m_dnn
(
dnn
),
m_snssai
(
snssai
)
{
}
pdu_session_msg
()
:
m_msg_type
(),
m_supi
(),
m_pdu_session_id
(),
m_dnn
(),
m_snssai
()
,
m_pdu_session_type
(
0
)
{};
pdu_session_msg
(
pdu_session_msg_type_t
msg_type
)
:
m_msg_type
(
msg_type
),
m_supi
(),
m_pdu_session_id
(),
m_dnn
(),
m_snssai
()
,
m_pdu_session_type
(
0
)
{};
pdu_session_msg
(
pdu_session_msg_type_t
msg_type
,
supi_t
supi
,
pdu_session_id_t
pdi
,
std
::
string
dnn
,
snssai_t
snssai
)
:
m_msg_type
(
msg_type
),
m_supi
(
supi
),
m_pdu_session_id
(
pdi
),
m_dnn
(
dnn
),
m_snssai
(
snssai
)
,
m_pdu_session_type
(
0
)
{
}
virtual
~
pdu_session_msg
()
=
default
;
pdu_session_msg_type_t
get_msg_type
()
const
;
...
...
@@ -115,6 +105,9 @@ public:
void
set_api_root
(
std
::
string
const
&
value
);
std
::
string
get_api_root
()
const
;
uint8_t
get_pdu_session_type
()
const
;
void
set_pdu_session_type
(
uint8_t
const
&
pdu_session_type
);
private:
pdu_session_msg_type_t
m_msg_type
;
std
::
string
m_api_root
;
...
...
@@ -123,6 +116,7 @@ private:
pdu_session_id_t
m_pdu_session_id
;
std
::
string
m_dnn
;
snssai_t
m_snssai
;
uint8_t
m_pdu_session_type
;
};
//---------------------------------------------------------------------------------------
...
...
@@ -132,17 +126,14 @@ public:
pdu_session_create_sm_context
()
:
pdu_session_msg
(){
m_epd
=
EPD_5GS_SESSION_MANAGEMENT_MESSAGES
;
m_message_type
=
PDU_SESSION_MESSAGE_TYPE_UNKNOWN
;
m_pdu_session_type
=
PDU_SESSION_TYPE_E_UNKNOWN
;
};
pdu_session_create_sm_context
(
pdu_session_msg_type_t
msg_type
)
:
pdu_session_msg
(
msg_type
){
m_epd
=
EPD_5GS_SESSION_MANAGEMENT_MESSAGES
;
m_message_type
=
PDU_SESSION_MESSAGE_TYPE_UNKNOWN
;
m_pdu_session_type
=
PDU_SESSION_TYPE_E_UNKNOWN
;
};
pdu_session_create_sm_context
(
pdu_session_msg_type_t
msg_type
,
supi_t
supi
,
pdu_session_id_t
pdi
,
std
::
string
dnn
,
snssai_t
snssai
)
:
pdu_session_msg
(
msg_type
,
supi
,
pdi
,
dnn
,
snssai
)
{
m_epd
=
EPD_5GS_SESSION_MANAGEMENT_MESSAGES
;
m_message_type
=
PDU_SESSION_MESSAGE_TYPE_UNKNOWN
;
m_pdu_session_type
=
PDU_SESSION_TYPE_E_UNKNOWN
;
}
extended_protocol_discriminator_t
get_epd
()
const
;
...
...
@@ -151,16 +142,12 @@ public:
procedure_transaction_id_t
get_pti
()
const
;
void
set_pti
(
procedure_transaction_id_t
const
&
pti
);
uint8_t
get_pdu_session_type
()
const
;
void
set_pdu_session_type
(
uint8_t
const
&
pdu_session_type
);
uint8_t
get_message_type
()
const
;
void
set_message_type
(
uint8_t
const
&
message_type
);
private:
extended_protocol_discriminator_t
m_epd
;
procedure_transaction_id_t
m_pti
;
uint8_t
m_pdu_session_type
;
uint8_t
m_message_type
;
};
...
...
@@ -170,7 +157,6 @@ class pdu_session_create_sm_context_request: public pdu_session_create_sm_contex
public:
pdu_session_create_sm_context_request
()
:
pdu_session_create_sm_context
(
PDU_SESSION_CREATE_SM_CONTEXT_REQUEST
),
m_unauthenticated_supi
(
true
)
{
}
pdu_session_create_sm_context_request
(
supi_t
supi
,
pdu_session_id_t
pdi
,
std
::
string
dnn
,
snssai_t
snssai
)
:
pdu_session_create_sm_context
(
PDU_SESSION_CREATE_SM_CONTEXT_REQUEST
,
supi
,
pdi
,
dnn
,
snssai
),
m_unauthenticated_supi
(
true
)
{
//m_epd = EPD_5GS_SESSION_MANAGEMENT_MESSAGES;
}
std
::
string
get_n1_sm_message
()
const
;
...
...
@@ -285,8 +271,8 @@ public:
paa_t
get_paa
();
void
set_http_code
(
Pistache
::
Http
::
Code
code
);
Pistache
::
Http
::
Code
get_http_code
();
void
set_qos_flow_context
(
const
qos_flow_context_
cre
ated
&
qos_flow
);
qos_flow_context_
cre
ated
get_qos_flow_context
()
const
;
void
set_qos_flow_context
(
const
qos_flow_context_
upd
ated
&
qos_flow
);
qos_flow_context_
upd
ated
get_qos_flow_context
()
const
;
std
::
string
get_n2_sm_information
()
const
;
void
set_n2_sm_information
(
std
::
string
const
&
value
);
std
::
string
get_n1_sm_message
()
const
;
...
...
@@ -305,7 +291,7 @@ private:
uint8_t
m_cause
;
paa_t
m_paa
;
Pistache
::
Http
::
Code
m_code
;
qos_flow_context_
cre
ated
qos_flow_context
;
qos_flow_context_
upd
ated
qos_flow_context
;
supi_t
m_supi
;
std
::
string
m_supi_prefix
;
std
::
string
amf_url
;
...
...
@@ -436,30 +422,25 @@ public:
m_cause
=
0
;
m_n1_sm_msg_is_set
=
false
;
m_n2_sm_info_is_set
=
false
;
qos_flow_context_
modifi
eds
=
{};
qos_flow_context_
updat
eds
=
{};
};
void
set_cause
(
uint8_t
cause
);
uint8_t
get_cause
();
std
::
string
get_n2_sm_information
()
const
;
void
set_n2_sm_information
(
std
::
string
const
&
value
);
std
::
string
get_n2_sm_info_type
()
const
;
void
set_n2_sm_info_type
(
std
::
string
const
&
value
);
std
::
string
get_n1_sm_message
()
const
;
void
set_n1_sm_message
(
std
::
string
const
&
value
);
std
::
string
get_n1_sm_msg_type
()
const
;
void
set_n1_sm_msg_type
(
std
::
string
const
&
value
);
bool
n1_sm_msg_is_set
()
const
;
bool
n2_sm_info_is_set
()
const
;
void
add_qos_flow_context_modified
(
const
qos_flow_context_modifi
ed
&
qos_flow
);
bool
get_qos_flow_context_modified
(
const
pfcp
::
qfi_t
&
qfi
,
qos_flow_context_modified
&
qos_flow
);
void
get_all_qos_flow_context_modifieds
(
std
::
map
<
uint8_t
,
qos_flow_context_modified
>&
all_flows
);
void
add_qos_flow_context_updated
(
const
qos_flow_context_updated
&
qos_flow
);
bool
get_qos_flow_context_updated
(
const
pfcp
::
qfi_t
&
qfi
,
qos_flow_context_updat
ed
&
qos_flow
);
void
get_all_qos_flow_context_updateds
(
std
::
map
<
uint8_t
,
qos_flow_context_updated
>&
all_flows
);
void
remove_all_qos_flow_context_updateds
(
);
nlohmann
::
json
sm_context_updated_data
;
//N1N2MessageTransferReqData from oai::amf::model
procedure_transaction_id_t
get_pti
()
const
;
void
set_pti
(
procedure_transaction_id_t
const
&
pti
);
...
...
@@ -473,7 +454,7 @@ private:
std
::
string
m_n2_sm_information
;
//N2 SM after decoding
bool
m_n2_sm_info_is_set
;
std
::
string
n2_sm_info_type
;
std
::
map
<
uint8_t
,
qos_flow_context_
modified
>
qos_flow_context_modifi
eds
;
std
::
map
<
uint8_t
,
qos_flow_context_
updated
>
qos_flow_context_updat
eds
;
};
...
...
src/smf_app/smf_procedure.cpp
100755 → 100644
View file @
5d1a394d
This diff is collapsed.
Click to expand it.
src/smf_app/smf_procedure.hpp
View file @
5d1a394d
...
...
@@ -29,6 +29,10 @@
#ifndef FILE_SMF_PROCEDURE_HPP_SEEN
#define FILE_SMF_PROCEDURE_HPP_SEEN
#include <memory>
#include <mutex>
#include <set>
#include "3gpp_29.244.hpp"
#include "3gpp_29.274.hpp"
#include "itti_msg_n11.hpp"
...
...
@@ -39,10 +43,6 @@
#include "uint_generator.hpp"
#include "smf_msg.hpp"
#include <memory>
#include <mutex>
#include <set>
namespace
smf
{
class
smf_context
;
...
...
@@ -67,7 +67,7 @@ public:
virtual
void
handle_itti_msg
(
itti_n4_session_establishment_response
&
resp
,
std
::
shared_ptr
<
smf
::
smf_context
>
pc
)
{}
virtual
void
handle_itti_msg
(
itti_n4_session_modification_response
&
resp
,
std
::
shared_ptr
<
smf
::
smf_context
>
pc
)
{}
virtual
void
handle_itti_msg
(
itti_n4_session_deletion_response
&
resp
,
std
::
shared_ptr
<
smf
::
smf_context
>
pc
)
{}
//tual void handle_itti_msg (itti_s5s8_downlink_data_notification_acknowledge& resp) {}
//
vir
tual void handle_itti_msg (itti_s5s8_downlink_data_notification_acknowledge& resp) {}
};
...
...
@@ -98,9 +98,6 @@ public:
explicit
session_create_sm_context_procedure
(
std
::
shared_ptr
<
smf_pdu_session
>&
sppc
)
:
smf_procedure
(),
ppc
(
sppc
),
n4_triggered
(),
n11_triggered_pending
(),
n11_trigger
()
{}
/*
*
*/
int
run
(
std
::
shared_ptr
<
itti_n11_create_sm_context_request
>
req
,
std
::
shared_ptr
<
itti_n11_create_sm_context_response
>
resp
,
std
::
shared_ptr
<
smf
::
smf_context
>
pc
);
...
...
@@ -121,9 +118,6 @@ public:
explicit
session_update_sm_context_procedure
(
std
::
shared_ptr
<
smf_pdu_session
>&
sppc
)
:
smf_procedure
(),
ppc
(
sppc
),
n4_triggered
(),
n11_triggered_pending
(),
n11_trigger
()
{}
/*
*
*/
int
run
(
std
::
shared_ptr
<
itti_n11_update_sm_context_request
>
req
,
std
::
shared_ptr
<
itti_n11_update_sm_context_response
>
resp
,
std
::
shared_ptr
<
smf
::
smf_context
>
sc
);
...
...
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