Commit b4aee3ca authored by ferrerod's avatar ferrerod

Add event definitions and stubs

Tested SMF build, not in CN deployment yet
parent 8e94638a
......@@ -15,7 +15,7 @@
*
* Possible values are - AC_TY_CH: Access Type Change - UP_PATH_CH: UP Path
* Change - PDU_SES_REL: PDU Session Release - PLMN_CH: PLMN Change - UE_IP_CH:
* UE IP address change - DDDS: Downlink data delivery status
* UE IP address change - DDDS: Downlink data delivery status - QOS_MON: QoS Monitoring
*/
#ifndef SmfEvent_H_
......@@ -30,7 +30,7 @@ namespace model {
/// <summary>
/// Possible values are - AC_TY_CH: Access Type Change - UP_PATH_CH: UP Path
/// Change - PDU_SES_REL: PDU Session Release - PLMN_CH: PLMN Change - UE_IP_CH:
/// UE IP address change - DDDS: Downlink data delivery status
/// UE IP address change - DDDS: Downlink data delivery status - QOS_MON: QoS Monitoring
/// </summary>
class SmfEvent {
public:
......
......@@ -31,6 +31,7 @@ typedef enum smf_event_e {
SMF_EVENT_PLMN_CH = 4,
SMF_EVENT_UE_IP_CH = 5,
SMF_EVENT_DDDS = 6,
SMF_EVENT_QOS_MON = 7,
SMF_EVENT_FLEXCN = 99
} smf_event_t;
......@@ -40,6 +41,7 @@ static std::string smf_event_from_enum(smf_event_t e) {
if (e == smf_event_t::SMF_EVENT_PDU_SES_REL) return "PDU_SES_REL";
if (e == smf_event_t::SMF_EVENT_PLMN_CH) return "PLMN_CH";
if (e == smf_event_t::SMF_EVENT_UE_IP_CH) return "UE_IP_CH";
if (e == smf_event_t::SMF_EVENT_QOS_MON) return "QOS_MON";
if (e == smf_event_t::SMF_EVENT_DDDS) return "DDDS";
if (e == smf_event_t::SMF_EVENT_FLEXCN) return "FLEXCN";
return "";
......@@ -53,6 +55,7 @@ static const std::vector<std::string> smf_event_e2str = {
"PLMN Change",
"UE IP address change",
"Downlink data delivery status",
"QoS Monitoring",
"FlexCN"};
enum class notification_method_e {
......
......@@ -538,6 +538,8 @@ void xgpp_conv::smf_event_exposure_notification_from_openapi(
event_subscription.smf_event = smf_event_e::SMF_EVENT_UE_IP_CH;
} else if (event_id.compare("DDDS") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_DDDS;
} else if (event_id.compare("QOS_MON") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_QOS_MON;
} else if (event_id.compare("FLEXCN") == 0) {
event_subscription.smf_event = smf_event_e::SMF_EVENT_FLEXCN;
} else {
......
......@@ -4049,6 +4049,22 @@ void smf_context::trigger_ue_ip_change(scid_t scid, uint8_t http_version) {
event_sub.ee_ue_ip_change(scid, http_version);
}
//------------------------------------------------------------------------------
void smf_context::handle_qos_monitoring(scid_t scid, uint8_t http_version) {
// TODO
Logger::smf_app().debug(
"Send request to N11 to trigger QoS Monitoring, "
"SMF Context ID " SCID_FMT " ",
scid);
return;
}
//------------------------------------------------------------------------------
void smf_context::trigger_qos_monitoring(scid_t scid, uint8_t http_version) {
event_sub.ee_qos_monitoring(scid, http_version);
}
//------------------------------------------------------------------------------
void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
Logger::smf_app().debug(
......
......@@ -689,6 +689,10 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
// Subscribe to DDDS event
ee_ddds_connection = event_sub.subscribe_ee_ddds(
boost::bind(&smf_context::handle_ddds, this, _1, _2));
// Subscribe to QoS Monitoring Event
ee_qos_monitoring_connection = event_sub.subscribe_ee_qos_monitoring(
boost::bind(&smf_context::handle_qos_monitoring, this, _1, _2));
// Subscribe to FlexCN event
ee_flexcn = event_sub.subscribe_ee_flexcn_event(
......@@ -708,6 +712,8 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
ee_ue_ip_change_connection.disconnect();
if (ee_plmn_change_connection.connected())
ee_plmn_change_connection.disconnect();
if (ee_qos_monitoring_connection.connected())
ee_qos_monitoring_connection.disconnect();
if (ee_ddds_connection.connected()) ee_ddds_connection.disconnect();
if (ee_flexcn.connected()) ee_flexcn.disconnect();
}
......@@ -1252,6 +1258,9 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
void trigger_ddds(scid_t scid, uint8_t http_version);
void handle_ddds(scid_t scid, uint8_t http_version);
void trigger_qos_monitoring(scid_t scid, uint8_t http_version);
void handle_qos_monitoring(scid_t scid, uint8_t http_version);
void trigger_flexcn_event(scid_t scid, uint8_t http_version);
void handle_flexcn_event(scid_t scid, uint8_t http_version);
/*
......@@ -1384,6 +1393,7 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
bs2::connection ee_ue_ip_change_connection;
bs2::connection ee_plmn_change_connection;
bs2::connection ee_ddds_connection;
bs2::connection ee_qos_monitoring_connection;
bs2::connection ee_flexcn;
};
} // namespace smf
......
......@@ -66,6 +66,12 @@ bs2::connection smf_event::subscribe_ee_ddds(
return ee_ddds.connect(sig);
}
//------------------------------------------------------------------------------
bs2::connection smf_event::subscribe_ee_qos_monitoring(
const ee_qos_monitoring_sig_t::slot_type& sig) {
return ee_qos_monitoring.connect(sig);
}
//------------------------------------------------------------------------------
bs2::connection smf_event::subscribe_ee_flexcn_event(
const ee_flexcn_sig_t::slot_type& sig) {
......
......@@ -82,6 +82,9 @@ class smf_event {
// download link data status
bs2::connection subscribe_ee_ddds(const ee_ddds_sig_t::slot_type& sig);
bs2::connection subscribe_ee_qos_monitoring(
const ee_qos_monitoring_sig_t::slot_type& sig);
bs2::connection subscribe_ee_flexcn_event(
const ee_flexcn_sig_t::slot_type& sig);
......@@ -93,6 +96,7 @@ class smf_event {
ee_ue_ip_change_sig_t ee_ue_ip_change; // Signal for UE IP Addr change
ee_plmn_change_sig_t ee_plmn_change; // Signal for UE IP Addr change
ee_ddds_sig_t ee_ddds;
ee_qos_monitoring_sig_t ee_qos_monitoring; // Signal for QoS Monitoring
ee_flexcn_sig_t ee_flexcn; // Signal for FlexCN Event
};
} // namespace smf
......
......@@ -70,6 +70,12 @@ typedef bs2::signal_type<
void(scid_t, uint8_t), bs2::keywords::mutex_type<bs2::dummy_mutex>>::type
ee_ddds_sig_t;
// Signal for Event exposure
// QoS Monitoring, SUPI, PDU SessionID, HTTP version
typedef bs2::signal_type<
void(supi64_t, uint8_t), bs2::keywords::mutex_type<bs2::dummy_mutex>>::type
ee_qos_monitoring_sig_t;
// Signal for FlexCN event (for Event Exposure)
// SCID, HTTP version
typedef bs2::signal_type<
......
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