Commit 82fbb356 authored by Arina Prostakova's avatar Arina Prostakova

add RAN UE NGAP ID and AMF UE NGAP ID fields to Loss of Conn Report

parent d74c4230
......@@ -70,9 +70,10 @@ typedef bs2::signal_type<
ue_connectivity_state_sig_t;
// Signal for Loss of Connectivity
// SUPI, status, HTTP version
// SUPI, status, HTTP version,
// RAN UE NGAP ID, AMF UE NGAP ID
typedef bs2::signal_type<
void(std::string, uint8_t, uint8_t),
void(std::string, uint8_t, uint8_t, uint32_t, long),
bs2::keywords::mutex_type<bs2::dummy_mutex>>::type
ue_loss_of_connectivity_sig_t;
......
......@@ -174,7 +174,7 @@ amf_n1::amf_n1() {
// EventExposure: subscribe to UE Loss of Connectivity change
ee_ue_loss_of_connectivity_connection =
event_sub.subscribe_ue_loss_of_connectivity(boost::bind(
&amf_n1::handle_ue_loss_of_connectivity_change, this, _1, _2, _3));
&amf_n1::handle_ue_loss_of_connectivity_change, this, _1, _2, _3, _4, _5));
}
//------------------------------------------------------------------------------
......@@ -3092,13 +3092,13 @@ void amf_n1::ue_initiate_de_registration_handle(
Logger::amf_n1().debug(
"Signal the UE Loss of Connectivity Event notification for SUPI %s",
supi.c_str());
event_sub.ue_loss_of_connectivity(supi, DEREGISTERED, 1);
event_sub.ue_loss_of_connectivity(supi, DEREGISTERED, 1, ran_ue_ngap_id, amf_ue_ngap_id);
// Trigger UE Loss of Connectivity Status Notify
Logger::amf_n1().debug(
"Signal the UE Loss of Connectivity Event notification for SUPI %s",
supi.c_str());
event_sub.ue_loss_of_connectivity(supi, PURGED, 1);
event_sub.ue_loss_of_connectivity(supi, PURGED, 1, ran_ue_ngap_id, amf_ue_ngap_id);
if (nc.get()->is_stacs_available) {
stacs.update_5gmm_state(nc.get()->imsi, "5GMM-DEREGISTERED");
......@@ -3763,7 +3763,8 @@ void amf_n1::handle_ue_connectivity_state_change(
//------------------------------------------------------------------------------
void amf_n1::handle_ue_loss_of_connectivity_change(
std::string supi, uint8_t status, uint8_t http_version) {
std::string supi, uint8_t status, uint8_t http_version,
uint32_t ran_ue_ngap_id, long amf_ue_ngap_id) {
Logger::amf_n1().debug(
"Send request to SBI to trigger UE Loss of Connectivity (SUPI "
"%s )",
......@@ -3808,6 +3809,8 @@ void amf_n1::handle_ue_loss_of_connectivity_change(
ue_loss_of_connectivity_reason.set_value("PURGED");
event_report.setLossOfConnectReason(ue_loss_of_connectivity_reason);
event_report.setRanUeNgapId(ran_ue_ngap_id);
event_report.setAmfUeNgapId(amf_ue_ngap_id);
event_report.setSupi(supi);
ev_notif.add_report(event_report);
......@@ -4007,7 +4010,7 @@ void amf_n1::mobile_reachable_timer_timeout(
Logger::amf_n1().debug(
"Signal the UE Loss of Connectivity Event notification for SUPI %s",
supi.c_str());
event_sub.ue_loss_of_connectivity(supi, MAX_DETECTION_TIME_EXPIRED, 1);
event_sub.ue_loss_of_connectivity(supi, MAX_DETECTION_TIME_EXPIRED, 1, nc.get()->ran_ue_ngap_id, amf_ue_ngap_id);
// TODO: Start the implicit de-registration timer
timer_id_t tid = itti_inst->timer_setup(
......
......@@ -819,10 +819,13 @@ class amf_n1 {
* @param [std::string] supi: SUPI
* @param [uint8_t] status: UE Loss of Connectivity status
* @param [uint8_t] http_version: HTTP version (for the notification)
* @param [uint32_t] ran_ue_ngap_id: RAN UE NGAP ID
* @param [long] amf_ue_ngap_id: AMF UE NGAP ID
* @return void
*/
void handle_ue_loss_of_connectivity_change(
std::string supi, uint8_t status, uint8_t http_version);
std::string supi, uint8_t status, uint8_t http_version,
uint32_t ran_ue_ngap_id, long amf_ue_ngap_id);
// for Event Handling
amf_event event_sub;
......
......@@ -629,6 +629,12 @@ void amf_n11::handle_itti_message(itti_sbi_notify_subscribed_event& itti_msg) {
if (r.lossOfConnectReasonIsSet()) {
report["lossOfConnectReason"] = r.getLossOfConnectReason().get_value();
}
if (r.ranUeNgapIdIsSet()) {
report["ranUeNgapId"] = r.getRanUeNgapId();
}
if (r.amfUeNgapIdIsSet()) {
report["amfUeNgapId"] = r.getAmfUeNgapId();
}
// timestamp
std::time_t time_epoch_ntp = std::time(nullptr);
......
......@@ -2202,7 +2202,7 @@ void amf_n2::remove_ue_context_with_ran_ue_ngap_id(
Logger::amf_n1().debug(
"Signal the UE Loss of Connectivity Event notification for SUPI %s",
supi.c_str());
amf_n1_inst->event_sub.ue_loss_of_connectivity(supi, DEREGISTERED, 1);
amf_n1_inst->event_sub.ue_loss_of_connectivity(supi, DEREGISTERED, 1, ran_ue_ngap_id, unc.get()->amf_ue_ngap_id);
amf_n1_inst->remove_imsi_2_nas_context(supi);
......@@ -2284,7 +2284,7 @@ void amf_n2::remove_ue_context_with_amf_ue_ngap_id(
Logger::amf_n1().debug(
"Signal the UE Loss of Connectivity Event notification for SUPI %s",
supi.c_str());
amf_n1_inst->event_sub.ue_loss_of_connectivity(supi, DEREGISTERED, 1);
amf_n1_inst->event_sub.ue_loss_of_connectivity(supi, DEREGISTERED, 1, nc.get()->ran_ue_ngap_id, amf_ue_ngap_id);
amf_n1_inst->remove_imsi_2_nas_context(supi);
// TODO: remove_guti_2_nas_context(guti);
......
......@@ -42,6 +42,8 @@ AmfEventReport::AmfEventReport() {
m_ReachabilityIsSet = false;
m_CommFailureIsSet = false;
m_LossOfConnectReasonIsSet = false;
m_RanUeNgapIdIsSet = false;
m_AmfUeNgapIdIsSet = false;
m_NumberOfUes = 0;
m_NumberOfUesIsSet = false;
m_r_5gsUserStateListIsSet = false;
......@@ -261,6 +263,14 @@ bool AmfEventReport::operator==(const AmfEventReport& rhs) const {
(lossOfConnectReasonIsSet() && rhs.lossOfConnectReasonIsSet() &&
getLossOfConnectReason() == rhs.getLossOfConnectReason())) &&
((!ranUeNgapIdIsSet() && !rhs.ranUeNgapIdIsSet()) ||
(ranUeNgapIdIsSet() && rhs.ranUeNgapIdIsSet() &&
getRanUeNgapId() == rhs.getRanUeNgapId())) &&
((!amfUeNgapIdIsSet() && !rhs.amfUeNgapIdIsSet()) ||
(amfUeNgapIdIsSet() && rhs.amfUeNgapIdIsSet() &&
getAmfUeNgapId() == rhs.getAmfUeNgapId())) &&
((!numberOfUesIsSet() && !rhs.numberOfUesIsSet()) ||
(numberOfUesIsSet() && rhs.numberOfUesIsSet() &&
getNumberOfUes() == rhs.getNumberOfUes())) &&
......@@ -299,6 +309,8 @@ void to_json(nlohmann::json& j, const AmfEventReport& o) {
if (o.reachabilityIsSet()) j["reachability"] = o.m_Reachability;
if (o.commFailureIsSet()) j["commFailure"] = o.m_CommFailure;
if (o.lossOfConnectReasonIsSet()) j["lossOfConnectReason"] = o.m_LossOfConnectReason;
if (o.ranUeNgapIdIsSet()) j["ranUeNgapId"] = o.m_RanUeNgapId;
if (o.amfUeNgapIdIsSet()) j["amfUeNgapId"] = o.m_AmfUeNgapId;
if (o.numberOfUesIsSet()) j["numberOfUes"] = o.m_NumberOfUes;
if (o.r5gsUserStateListIsSet() || !o.m_r_5gsUserStateList.empty())
j["5gsUserStateList"] = o.m_r_5gsUserStateList;
......@@ -368,6 +380,14 @@ void from_json(const nlohmann::json& j, AmfEventReport& o) {
j.at("lossOfConnectReason").get_to(o.m_LossOfConnectReason);
o.m_LossOfConnectReasonIsSet = true;
}
if (j.find("ranUeNgapId") != j.end()) {
j.at("ranUeNgapId").get_to(o.m_RanUeNgapId);
o.m_RanUeNgapIdIsSet = true;
}
if (j.find("amfUeNgapId") != j.end()) {
j.at("amfUeNgapId").get_to(o.m_AmfUeNgapId);
o.m_AmfUeNgapIdIsSet = true;
}
if (j.find("numberOfUes") != j.end()) {
j.at("numberOfUes").get_to(o.m_NumberOfUes);
o.m_NumberOfUesIsSet = true;
......@@ -591,6 +611,32 @@ bool AmfEventReport::lossOfConnectReasonIsSet() const {
void AmfEventReport::unsetLossOfConnectReason() {
m_LossOfConnectReasonIsSet = false;
}
uint32_t AmfEventReport::getRanUeNgapId() const {
return m_RanUeNgapId;
}
void AmfEventReport::setRanUeNgapId(uint32_t const value) {
m_RanUeNgapId = value;
m_RanUeNgapIdIsSet = true;
}
bool AmfEventReport::ranUeNgapIdIsSet() const {
return m_RanUeNgapIdIsSet;
}
void AmfEventReport::unsetRanUeNgapId() {
m_RanUeNgapIdIsSet = false;
}
long AmfEventReport::getAmfUeNgapId() const {
return m_AmfUeNgapId;
}
void AmfEventReport::setAmfUeNgapId(long const value) {
m_AmfUeNgapId = value;
m_AmfUeNgapIdIsSet = true;
}
bool AmfEventReport::amfUeNgapIdIsSet() const {
return m_AmfUeNgapIdIsSet;
}
void AmfEventReport::unsetAmfUeNgapId() {
m_AmfUeNgapIdIsSet = false;
}
int32_t AmfEventReport::getNumberOfUes() const {
return m_NumberOfUes;
}
......
......@@ -185,6 +185,20 @@ class AmfEventReport {
/// <summary>
///
/// </summary>
uint32_t getRanUeNgapId() const;
void setRanUeNgapId(uint32_t const value);
bool ranUeNgapIdIsSet() const;
void unsetRanUeNgapId();
/// <summary>
///
/// </summary>
long getAmfUeNgapId() const;
void setAmfUeNgapId(long const value);
bool amfUeNgapIdIsSet() const;
void unsetAmfUeNgapId();
/// <summary>
///
/// </summary>
int32_t getNumberOfUes() const;
void setNumberOfUes(int32_t const value);
bool numberOfUesIsSet() const;
......@@ -240,6 +254,10 @@ class AmfEventReport {
bool m_CommFailureIsSet;
LossOfConnectivityReason m_LossOfConnectReason;
bool m_LossOfConnectReasonIsSet;
uint32_t m_RanUeNgapId;
bool m_RanUeNgapIdIsSet;
long m_AmfUeNgapId;
bool m_AmfUeNgapIdIsSet;
int32_t m_NumberOfUes;
bool m_NumberOfUesIsSet;
std::vector<_5GsUserStateInfo> m_r_5gsUserStateList;
......
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