e2ap: passing ric timer to e2ap object

master
yagoda 2 years ago committed by Justin Tallon
parent 5016e4b543
commit 868c0efe6e

@ -13,6 +13,8 @@
#include "e2sm_kpm.h" #include "e2sm_kpm.h"
#include "srsran/asn1/e2ap.h" #include "srsran/asn1/e2ap.h"
#include "srsran/common/task_scheduler.h"
#include "srsran/common/timers.h"
#include "srsran/interfaces/e2_metrics_interface.h" #include "srsran/interfaces/e2_metrics_interface.h"
#include "srsran/interfaces/enb_metrics_interface.h" #include "srsran/interfaces/enb_metrics_interface.h"
#include "srsran/srsran.h" #include "srsran/srsran.h"
@ -46,7 +48,9 @@ typedef struct {
class e2ap class e2ap
{ {
public: public:
e2ap(srslog::basic_logger& logger, srsenb::e2_interface_metrics* _gnb_metrics); e2ap(srslog::basic_logger& logger,
srsenb::e2_interface_metrics* _gnb_metrics,
srsran::task_scheduler* _task_sched_ptr);
e2_ap_pdu_c generate_setup_request(); e2_ap_pdu_c generate_setup_request();
int process_setup_response(e2setup_resp_s setup_response); int process_setup_response(e2setup_resp_s setup_response);
int process_setup_failure(); int process_setup_failure();
@ -76,6 +80,7 @@ private:
std::map<uint32_t, RANfunction_description> ran_functions; std::map<uint32_t, RANfunction_description> ran_functions;
srsenb::e2_interface_metrics* gnb_metrics = nullptr; srsenb::e2_interface_metrics* gnb_metrics = nullptr;
bool reset_response_received = false; bool reset_response_received = false;
srsran::task_scheduler* task_sched_ptr = nullptr;
int reset_transaction_id = 1; int reset_transaction_id = 1;
cause_c reset_cause = cause_c(); cause_c reset_cause = cause_c();
int reset_id = 1; int reset_id = 1;

@ -2,10 +2,12 @@
#include "srsgnb/hdr/stack/ric/e2ap.h" #include "srsgnb/hdr/stack/ric/e2ap.h"
#include "stdint.h" #include "stdint.h"
e2ap::e2ap(srslog::basic_logger& logger, srsenb::e2_interface_metrics* _gnb_metrics) : logger(logger), e2sm_(logger) e2ap::e2ap(srslog::basic_logger& logger,
srsenb::e2_interface_metrics* _gnb_metrics,
srsran::task_scheduler* _task_sched_ptr) :
logger(logger), e2sm_(logger), task_sched_ptr(_task_sched_ptr)
{ {
gnb_metrics = _gnb_metrics; gnb_metrics = _gnb_metrics;
// add SMs to map // add SMs to map
uint32_t local_ran_function_id = 147; uint32_t local_ran_function_id = 147;
RANfunction_description add_func; RANfunction_description add_func;

@ -17,7 +17,7 @@
using namespace srsenb; using namespace srsenb;
ric_client::ric_client(srslog::basic_logger& logger, e2_interface_metrics* _gnb_metrics) : ric_client::ric_client(srslog::basic_logger& logger, e2_interface_metrics* _gnb_metrics) :
task_sched(), logger(logger), rx_sockets(), thread("RIC_CLIENT_THREAD"), e2ap_(logger, _gnb_metrics) task_sched(), logger(logger), rx_sockets(), thread("RIC_CLIENT_THREAD"), e2ap_(logger, _gnb_metrics, &task_sched)
{ {
gnb_metrics = _gnb_metrics; gnb_metrics = _gnb_metrics;
} }

@ -103,7 +103,7 @@ void test_native_e2ap_setup_request()
e2_ap_pdu_c pdu, pdu2; e2_ap_pdu_c pdu, pdu2;
srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP"); srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP");
dummy_metrics_interface dummy_metrics; dummy_metrics_interface dummy_metrics;
e2ap e2ap_(logger, &dummy_metrics); e2ap e2ap_(logger, &dummy_metrics, NULL);
pdu = e2ap_.generate_setup_request(); pdu = e2ap_.generate_setup_request();
asn1::bit_ref bref(buf->msg, buf->get_tailroom()); asn1::bit_ref bref(buf->msg, buf->get_tailroom());
@ -139,7 +139,7 @@ void test_native_e2ap_subscription_response()
e2_ap_pdu_c pdu, pdu2; e2_ap_pdu_c pdu, pdu2;
srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP"); srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP");
dummy_metrics_interface dummy_metrics; dummy_metrics_interface dummy_metrics;
e2ap e2ap_(logger, &dummy_metrics); e2ap e2ap_(logger, &dummy_metrics, NULL);
ric_subscription_reponse_t ric_subscription_reponse; ric_subscription_reponse_t ric_subscription_reponse;
ric_subscription_reponse.ric_requestor_id = 1021; ric_subscription_reponse.ric_requestor_id = 1021;
@ -167,7 +167,7 @@ void test_native_e2ap_reset_request()
e2_ap_pdu_c pdu, pdu2; e2_ap_pdu_c pdu, pdu2;
srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP"); srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP");
dummy_metrics_interface dummy_metrics; dummy_metrics_interface dummy_metrics;
e2ap e2ap_(logger, &dummy_metrics); e2ap e2ap_(logger, &dummy_metrics, NULL);
pdu = e2ap_.generate_reset_request(); pdu = e2ap_.generate_reset_request();
asn1::bit_ref bref(buf->msg, buf->get_tailroom()); asn1::bit_ref bref(buf->msg, buf->get_tailroom());
@ -188,7 +188,7 @@ void test_native_e2ap_reset_response()
e2_ap_pdu_c pdu, pdu2; e2_ap_pdu_c pdu, pdu2;
srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP"); srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP");
dummy_metrics_interface dummy_metrics; dummy_metrics_interface dummy_metrics;
e2ap e2ap_(logger, &dummy_metrics); e2ap e2ap_(logger, &dummy_metrics, NULL);
pdu = e2ap_.generate_reset_response(); pdu = e2ap_.generate_reset_response();
asn1::bit_ref bref(buf->msg, buf->get_tailroom()); asn1::bit_ref bref(buf->msg, buf->get_tailroom());

Loading…
Cancel
Save