Commit ea5d7006 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Add function header for AMF N2

parent ef3b798f
......@@ -2168,7 +2168,8 @@ std::shared_ptr<ue_ngap_context> amf_n2::ran_ue_id_2_ue_ngap_context(
//------------------------------------------------------------------------------
void amf_n2::set_ran_ue_ngap_id_2_ue_ngap_context(
const uint32_t& ran_ue_ngap_id, std::shared_ptr<ue_ngap_context> unc) {
const uint32_t& ran_ue_ngap_id,
const std::shared_ptr<ue_ngap_context>& unc) {
std::unique_lock lock(m_ranid2uecontext);
ranid2uecontext[ran_ue_ngap_id] = unc;
}
......@@ -2285,30 +2286,10 @@ void amf_n2::remove_ue_context_with_amf_ue_ngap_id(
remove_amf_ue_ngap_id_2_ue_ngap_context(amf_ue_ngap_id);
}
//------------------------------------------------------------------------------
bool amf_n2::verifyPlmn(vector<SupportedItem_t> list) {
for (int i = 0; i < amf_cfg.plmn_list.size(); i++) {
for (int j = 0; j < list.size(); j++) {
Logger::amf_n2().debug(
"TAC configured %d, TAC received %d", amf_cfg.plmn_list[i].tac,
list[j].tac);
if (amf_cfg.plmn_list[i].tac != list[j].tac) {
continue;
}
for (int k = 0; k < list[j].b_plmn_list.size(); k++) {
if (!(list[j].b_plmn_list[k].mcc.compare(amf_cfg.plmn_list[i].mcc)) &&
!(list[j].b_plmn_list[k].mnc.compare(amf_cfg.plmn_list[i].mnc))) {
return true;
}
}
}
}
return false;
}
//------------------------------------------------------------------------------
bool amf_n2::get_common_plmn(
std::vector<SupportedItem_t> list, std::vector<SupportedItem_t>& result) {
const std::vector<SupportedItem_t>& list,
std::vector<SupportedItem_t>& result) {
std::vector<SupportedItem_t> plmn_list = {};
bool found_common_plmn = false;
for (int i = 0; i < amf_cfg.plmn_list.size(); i++) {
......
......@@ -191,44 +191,118 @@ class amf_n2 : public ngap::ngap_app {
*/
void handle_itti_message(itti_paging& itti_msg);
// TODO
/*
* Send Handover Preparaton Failure message
* @param [const unsigned long] amf_ue_ngap_id: AMF UE NGAP ID
* @param [const uint32_t] ran_ue_ngap_id: RAN UE NGAP ID
* @param [const sctp_assoc_id_t&] gnb_assoc_id: gNB Association ID
* @return void
*/
void send_handover_preparation_failure(
const unsigned long amf_ue_ngap_id, const uint32_t ran_ue_ngap_id,
const sctp_assoc_id_t& gnb_assoc_id);
// TODO
bool verifyPlmn(std::vector<SupportedItem_t> list);
// TODO
/*
* Get list of common PLMN between AMF and gNB
* @param [const std::vector<SupportedItem_t>&] list: Supported TA list from
* gNB
* @param [std::vector<SupportedItem_t>&] result: list of common TA
* @return true if there's at least 1 common TA, otherwise return false
*/
bool get_common_plmn(
std::vector<SupportedItem_t> list, std::vector<SupportedItem_t>& result);
// TODO
const std::vector<SupportedItem_t>& list,
std::vector<SupportedItem_t>& result);
/*
* Get UE NGAP context associated with a RAN UE NGAP ID
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @return shared pointer to the UE NGAP context
*/
std::shared_ptr<ue_ngap_context> ran_ue_id_2_ue_ngap_context(
const uint32_t& ran_ue_ngap_id) const;
// TODO
/*
* Verify whether a UE NGAP context associated with a RAN UE NGAP ID exist
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @return true if exist, otherwise return false
*/
bool is_ran_ue_id_2_ue_ngap_context(const uint32_t& ran_ue_ngap_id) const;
// TODO
/*
* Store UE NGAP context associated with a RAN UE NGAP ID
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @param [const std::shared_ptr<ue_ngap_context>&] unc: pointer to UE NGAP
* context
* @return void
*/
void set_ran_ue_ngap_id_2_ue_ngap_context(
const uint32_t& ran_ue_ngap_id, std::shared_ptr<ue_ngap_context> unc);
const uint32_t& ran_ue_ngap_id,
const std::shared_ptr<ue_ngap_context>& unc);
/*
* Remove UE NGAP context associated with a RAN UE NGAP ID
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @return void
*/
void remove_ran_ue_ngap_id_2_ngap_context(const uint32_t& ran_ue_ngap_id);
// TODO:
/*
* Remove UE Context associated with a RAN UE NGAP ID
* @param [const uint32_t&] ran_ue_ngap_id: RAN UE NGAP ID
* @return void
*/
void remove_ue_context_with_ran_ue_ngap_id(const uint32_t& ran_ue_ngap_id);
// TODO
/*
* Get UE NGAP context associated with a AMF UE NGAP ID
* @param [const unsigned long&] amf_ue_ngap_id: AMF UE NGAP ID
* @return shared pointer to the UE NGAP context
*/
std::shared_ptr<ue_ngap_context> amf_ue_id_2_ue_ngap_context(
const unsigned long& amf_ue_ngap_id) const;
// TODO
/*
* Verify whether a UE NGAP context associated with a AMF UE NGAP ID exist
* @param [const unsigned long&] amf_ue_ngap_id: AMF UE NGAP ID
* @return true if exist, otherwise return false
*/
bool is_amf_ue_id_2_ue_ngap_context(
const unsigned long& amf_ue_ngap_id) const;
// TODO
/*
* Store UE NGAP context associated with a AMF UE NGAP ID
* @param [const unsigned long&] amf_ue_ngap_id: AMF UE NGAP ID
* @param [const std::shared_ptr<ue_ngap_context>&] unc: pointer to UE NGAP
* context
* @return void
*/
void set_amf_ue_ngap_id_2_ue_ngap_context(
const unsigned long& amf_ue_ngap_id,
std::shared_ptr<ue_ngap_context> unc);
/*
* Remove UE NGAP context associated with a AMF UE NGAP ID
* @param [const unsigned long&] amf_ue_ngap_id: AMF UE NGAP ID
* @return void
*/
void remove_amf_ue_ngap_id_2_ue_ngap_context(
const unsigned long& amf_ue_ngap_id);
/*
* Remove UE Context associated with a AMF UE NGAP ID
* @param [const unsigned long&] amf_ue_ngap_id: AMF UE NGAP ID
* @return void
*/
void remove_ue_context_with_amf_ue_ngap_id(
const unsigned long& amf_ue_ngap_id);
/*
* Get list of UE Context associated with a gNB
* @param [const sctp_assoc_id_t&] gnb_assoc_id: gNB Association ID
* @param [std::vector<std::shared_ptr<ue_ngap_context>>&] ue_contexts: vector
* of UE Context
* @return void
*/
void get_ue_ngap_contexts(
const sctp_assoc_id_t& gnb_assoc_id,
std::vector<std::shared_ptr<ue_ngap_context>>& ue_contexts);
......
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