Commit df59e39c authored by kharade's avatar kharade

Handle create pdr for DL in session establishment

Signed-off-by: default avatarkharade <rohan.kharade@openairinterface.org>
parent 5c7fbfd7
......@@ -125,6 +125,10 @@ SMF =
HTTP_VERSION = {{ env["HTTP_VERSION"] if "HTTP_VERSION" in env.keys() else '1' }};
# Set yes if UE USAGE REPORTING is to be done at UPF
ENABLE_USAGE_REPORTING = "{{ env["ENABLE_USAGE_REPORTING"] if "ENABLE_USAGE_REPORTING" in env.keys() else 'no' }}"
# Set yes if Downlink PDR is to be included in PFCP session establishment message
ENABLE_DL_PDR_IN_PFCP_SESS_ESTAB = "{{ env["ENABLE_DL_PDR_IN_PFCP_SESS_ESTAB"] if "ENABLE_DL_PDR_IN_PFCP_SESS_ESTAB" in env.keys() else 'no' }}"
# Set N3_LOCAL_IPV4_ADDRESS for SD-Fabric UPF
N3_LOCAL_IPV4_ADDRESS = "{{ env["N3_LOCAL_IPV4_ADDRESS"] if "N3_LOCAL_IPV4_ADDRESS" in env.keys() else '0.0.0.0' }}";
}
AMF :
......
......@@ -9373,6 +9373,11 @@ class pfcp_update_pdr_ie : public pfcp_grouped_ie {
std::shared_ptr<pfcp_pdi_ie> sie(new pfcp_pdi_ie(b.pdi.second));
add_ie(sie);
}
if (b.precedence.first) {
std::shared_ptr<pfcp_precedence_ie> sie(
new pfcp_precedence_ie(b.precedence.second));
add_ie(sie);
}
}
//--------
pfcp_update_pdr_ie() : pfcp_grouped_ie(PFCP_IE_UPDATE_PDR) {}
......
......@@ -573,6 +573,17 @@ int smf_config::load(const string& config_file) {
} else {
enable_ur = false;
}
support_features.lookupValue(
SMF_CONFIG_STRING_SUPPORT_FEATURES_enable_dl_pdr_in_pfcp_sess_estab,
opt);
if (boost::iequals(opt, "yes")) {
enable_dl_pdr_in_pfcp_sess_estab = true;
} else {
enable_dl_pdr_in_pfcp_sess_estab = false;
}
support_features.lookupValue(
SMF_CONFIG_STRING_N3_LOCAL_IPV4_ADDRESS, local_n3_addr);
} catch (const SettingNotFoundException& nfex) {
Logger::smf_app().error(
......@@ -1068,6 +1079,11 @@ void smf_config::display() {
Logger::smf_app().info(
" Use FQDN ...........................: %s",
use_fqdn_dns ? "Yes" : "No");
Logger::smf_app().info(
" ENABLE DL PDR IN PFCP SESSION ESTAB.: %s",
enable_dl_pdr_in_pfcp_sess_estab ? "Yes" : "No");
Logger::smf_app().info(
" UPF N3 LOCAL ADDRESS ...............: %s", local_n3_addr.c_str());
Logger::smf_app().info("- DNN configurations:");
......
......@@ -160,6 +160,9 @@
#define SMF_CONFIG_STRING_SUPPORT_FEATURES_SBI_HTTP_VERSION "HTTP_VERSION"
#define SMF_CONFIG_STRING_SUPPORT_FEATURES_ENABLE_USAGE_REPORTING \
"ENABLE_USAGE_REPORTING"
#define SMF_CONFIG_STRING_SUPPORT_FEATURES_enable_dl_pdr_in_pfcp_sess_estab \
"ENABLE_DL_PDR_IN_PFCP_SESS_ESTAB"
#define SMF_CONFIG_STRING_N3_LOCAL_IPV4_ADDRESS "N3_LOCAL_IPV4_ADDRESS"
#define SMF_MAX_ALLOCATED_PDN_ADDRESSES 1024
......@@ -245,6 +248,8 @@ class smf_config {
bool use_fqdn_dns;
unsigned int http_version;
bool enable_ur;
bool enable_dl_pdr_in_pfcp_sess_estab;
std::string local_n3_addr;
std::vector<pfcp::node_id_t> upfs;
......@@ -332,12 +337,14 @@ class smf_config {
sbi_api_version = "v1";
http_version = 1;
use_local_subscription_info = false;
use_local_pcc_rules = false;
register_nrf = false;
discover_upf = false;
discover_pcf = false;
use_fqdn_dns = false;
use_local_subscription_info = false;
use_local_pcc_rules = false;
register_nrf = false;
discover_upf = false;
discover_pcf = false;
use_fqdn_dns = false;
enable_ur = false;
enable_dl_pdr_in_pfcp_sess_estab = false;
};
~smf_config();
void lock() { m_rw_lock.lock(); };
......
......@@ -316,6 +316,11 @@ void smf_pdu_session::set_seid(const uint64_t& s) {
seid = s;
}
//------------------------------------------------------------------------------
void smf_pdu_session::generate_teid(pfcp::fteid_t& local_fteid) {
local_fteid.teid = teid_generator.get_uid();
}
//------------------------------------------------------------------------------
// TODO check if urr_id should be unique in the UPF or in the context of a pdn
// connection
......
......@@ -286,6 +286,12 @@ class smf_pdu_session : public std::enable_shared_from_this<smf_pdu_session> {
*/
void set_seid(const uint64_t& seid);
/*
* Generate a value for TEID
* @return uint32_t
*/
void generate_teid(pfcp::fteid_t& local_fteid);
/*
* Generate a PDR ID
* @param [pfcp::pdr_id_t &]: pdr_id: PDR ID generated
......@@ -539,6 +545,7 @@ class smf_pdu_session : public std::enable_shared_from_this<smf_pdu_session> {
util::uint_generator<uint32_t> far_id_generator;
util::uint_generator<uint32_t> urr_id_generator;
util::uint_generator<uint32_t> teid_generator;
// Shared lock
mutable std::shared_mutex m_pdu_session_mutex;
......
This diff is collapsed.
......@@ -94,17 +94,24 @@ class smf_session_procedure : public smf_procedure {
pfcp::create_far pfcp_create_far(edge& edge, const pfcp::qfi_t& qfi);
pfcp::create_pdr pfcp_create_pdr(edge& edge, const pfcp::qfi_t& qfi);
pfcp::create_pdr pfcp_create_pdr(
edge& edge, const pfcp::qfi_t& qfi,
pfcp::up_function_features_s up_features);
pfcp::create_urr pfcp_create_urr(edge& edge, const pfcp::qfi_t& qfi);
pfcp::create_pdr pfcp_create_pdr_dl(edge& edge, const pfcp::qfi_t& qfi);
pfcp::create_far pfcp_create_far_dl(edge& edge, const pfcp::qfi_t& qfi);
// TODO eventuell if used more than once
private:
// pfcp::destination_interface_value_e get_interface_value(const edge& edge);
pfcp::ue_ip_address_t pfcp_ue_ip_address(const edge& edge);
static pfcp::fteid_t pfcp_prepare_fteid(const pfcp::fteid_t& fteid);
pfcp::fteid_t pfcp_prepare_fteid(
pfcp::fteid_t& fteid, const bool& ftup_supported);
protected:
void synch_ul_dl_edges(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment