From ea04104e8e731adcb3def8770b0393df8ffe6b6f Mon Sep 17 00:00:00 2001 From: Francisco Date: Thu, 25 Feb 2021 16:16:40 +0000 Subject: [PATCH] move ue gw interfaces to separate interfaces header file --- .../srslte/interfaces/ue_gw_interfaces.h | 67 +++++++++++++++++++ lib/include/srslte/interfaces/ue_interfaces.h | 48 ------------- lib/include/srslte/upper/pdcp_entity_lte.h | 7 ++ lib/include/srslte/upper/pdcp_entity_nr.h | 1 + lib/src/upper/pdcp_entity_lte.cc | 1 + lib/test/upper/pdcp_base_test.h | 1 + srsenb/hdr/stack/upper/pdcp.h | 2 +- srsenb/hdr/stack/upper/pdcp_nr.h | 1 + srsenb/hdr/stack/upper/sdap.h | 2 +- srsue/hdr/stack/rrc/rrc.h | 1 + srsue/hdr/stack/upper/gw.h | 1 + srsue/hdr/stack/upper/nas.h | 1 + srsue/src/stack/rrc/rrc.cc | 3 +- srsue/src/stack/upper/nas.cc | 1 + 14 files changed, 85 insertions(+), 52 deletions(-) create mode 100644 lib/include/srslte/interfaces/ue_gw_interfaces.h diff --git a/lib/include/srslte/interfaces/ue_gw_interfaces.h b/lib/include/srslte/interfaces/ue_gw_interfaces.h new file mode 100644 index 000000000..4fedb6c9d --- /dev/null +++ b/lib/include/srslte/interfaces/ue_gw_interfaces.h @@ -0,0 +1,67 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2020 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + */ + +#ifndef SRSLTE_UE_GW_INTERFACES_H +#define SRSLTE_UE_GW_INTERFACES_H + +#include "srslte/asn1/liblte_mme.h" + +namespace srsue { + +class gw_interface_nas +{ +public: + virtual int setup_if_addr(uint32_t eps_bearer_id, + uint32_t lcid, + uint8_t pdn_type, + uint32_t ip_addr, + uint8_t* ipv6_if_id, + char* err_str) = 0; + virtual int apply_traffic_flow_template(const uint8_t& eps_bearer_id, + const uint8_t& lcid, + const LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft) = 0; + + typedef enum { + TEST_LOOP_INACTIVE = 0, + TEST_LOOP_MODE_A_ACTIVE, + TEST_LOOP_MODE_B_ACTIVE, + TEST_LOOP_MODE_C_ACTIVE + } test_loop_mode_state_t; + + /** + * Updates the test loop mode. The IP delay parameter is only valid for Mode B. + * @param mode + * @param ip_pdu_delay_ms The PDU delay in ms + */ + virtual void set_test_loop_mode(const test_loop_mode_state_t mode, const uint32_t ip_pdu_delay_ms = 0) = 0; +}; + +class gw_interface_rrc +{ +public: + virtual void add_mch_port(uint32_t lcid, uint32_t port) = 0; + virtual int update_lcid(uint32_t eps_bearer_id, uint32_t new_lcid) = 0; +}; + +class gw_interface_pdcp +{ +public: + virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0; + virtual void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0; +}; + +class gw_interface_stack : public gw_interface_nas, public gw_interface_rrc, public gw_interface_pdcp +{}; + +} // namespace srsue + +#endif // SRSLTE_UE_GW_INTERFACES_H diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index 84d1d299a..15baaafa2 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -39,51 +39,6 @@ namespace srsue { -// GW interface for NAS -class gw_interface_nas -{ -public: - virtual int setup_if_addr(uint32_t eps_bearer_id, - uint32_t lcid, - uint8_t pdn_type, - uint32_t ip_addr, - uint8_t* ipv6_if_id, - char* err_str) = 0; - virtual int apply_traffic_flow_template(const uint8_t& eps_bearer_id, - const uint8_t& lcid, - const LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft) = 0; - - typedef enum { - TEST_LOOP_INACTIVE = 0, - TEST_LOOP_MODE_A_ACTIVE, - TEST_LOOP_MODE_B_ACTIVE, - TEST_LOOP_MODE_C_ACTIVE - } test_loop_mode_state_t; - - /** - * Updates the test loop mode. The IP delay parameter is only valid for Mode B. - * @param mode - * @param ip_pdu_delay_ms The PDU delay in ms - */ - virtual void set_test_loop_mode(const test_loop_mode_state_t mode, const uint32_t ip_pdu_delay_ms = 0) = 0; -}; - -// GW interface for RRC -class gw_interface_rrc -{ -public: - virtual void add_mch_port(uint32_t lcid, uint32_t port) = 0; - virtual int update_lcid(uint32_t eps_bearer_id, uint32_t new_lcid) = 0; -}; - -// GW interface for PDCP -class gw_interface_pdcp -{ -public: - virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0; - virtual void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0; -}; - // RRC interface for MAC class rrc_interface_mac_common { @@ -626,9 +581,6 @@ public: virtual bool start_service_request() = 0; }; -class gw_interface_stack : public gw_interface_nas, public gw_interface_rrc, public gw_interface_pdcp -{}; - // STACK interface for RRC class stack_interface_rrc { diff --git a/lib/include/srslte/upper/pdcp_entity_lte.h b/lib/include/srslte/upper/pdcp_entity_lte.h index 337f90cb2..786323d43 100644 --- a/lib/include/srslte/upper/pdcp_entity_lte.h +++ b/lib/include/srslte/upper/pdcp_entity_lte.h @@ -21,6 +21,12 @@ #include "srslte/interfaces/ue_interfaces.h" #include "srslte/upper/pdcp_entity_base.h" +namespace srsue { + +class gw_interface_pdcp; + +} + namespace srslte { /**************************************************************************** @@ -34,6 +40,7 @@ namespace srslte { * LTE PDCP Entity * Class for LTE PDCP entities ***************************************************************************/ + class pdcp_entity_lte final : public pdcp_entity_base { public: diff --git a/lib/include/srslte/upper/pdcp_entity_nr.h b/lib/include/srslte/upper/pdcp_entity_nr.h index 0dd702b14..a89a94a61 100644 --- a/lib/include/srslte/upper/pdcp_entity_nr.h +++ b/lib/include/srslte/upper/pdcp_entity_nr.h @@ -21,6 +21,7 @@ #include "srslte/common/security.h" #include "srslte/common/task_scheduler.h" #include "srslte/common/threads.h" +#include "srslte/interfaces/ue_gw_interfaces.h" #include "srslte/interfaces/ue_interfaces.h" #include diff --git a/lib/src/upper/pdcp_entity_lte.cc b/lib/src/upper/pdcp_entity_lte.cc index d831bae96..85e01abad 100644 --- a/lib/src/upper/pdcp_entity_lte.cc +++ b/lib/src/upper/pdcp_entity_lte.cc @@ -13,6 +13,7 @@ #include "srslte/upper/pdcp_entity_lte.h" #include "srslte/common/int_helpers.h" #include "srslte/common/security.h" +#include "srslte/interfaces/ue_gw_interfaces.h" #include namespace srslte { diff --git a/lib/test/upper/pdcp_base_test.h b/lib/test/upper/pdcp_base_test.h index 59b9e2c4d..fd8975ca8 100644 --- a/lib/test/upper/pdcp_base_test.h +++ b/lib/test/upper/pdcp_base_test.h @@ -18,6 +18,7 @@ #include "srslte/common/security.h" #include "srslte/common/test_common.h" #include "srslte/interfaces/pdcp_interface_types.h" +#include "srslte/interfaces/ue_gw_interfaces.h" #include "srslte/interfaces/ue_interfaces.h" #include diff --git a/srsenb/hdr/stack/upper/pdcp.h b/srsenb/hdr/stack/upper/pdcp.h index 159c25e5d..17aead6f1 100644 --- a/srsenb/hdr/stack/upper/pdcp.h +++ b/srsenb/hdr/stack/upper/pdcp.h @@ -13,7 +13,7 @@ #include "srslte/common/timers.h" #include "srslte/interfaces/enb_metrics_interface.h" #include "srslte/interfaces/enb_pdcp_interfaces.h" -#include "srslte/interfaces/ue_interfaces.h" +#include "srslte/interfaces/ue_gw_interfaces.h" #include "srslte/srslog/srslog.h" #include "srslte/upper/pdcp.h" #include diff --git a/srsenb/hdr/stack/upper/pdcp_nr.h b/srsenb/hdr/stack/upper/pdcp_nr.h index 4603120c8..eb989a1bf 100644 --- a/srsenb/hdr/stack/upper/pdcp_nr.h +++ b/srsenb/hdr/stack/upper/pdcp_nr.h @@ -14,6 +14,7 @@ #include "srslte/common/log_filter.h" #include "srslte/common/logger.h" #include "srslte/interfaces/gnb_interfaces.h" +#include "srslte/interfaces/ue_gw_interfaces.h" #include "srslte/upper/pdcp.h" #include diff --git a/srsenb/hdr/stack/upper/sdap.h b/srsenb/hdr/stack/upper/sdap.h index 64c609557..0c51fa0ce 100644 --- a/srsenb/hdr/stack/upper/sdap.h +++ b/srsenb/hdr/stack/upper/sdap.h @@ -17,7 +17,7 @@ #include "srslte/common/common.h" #include "srslte/common/logmap.h" #include "srslte/interfaces/gnb_interfaces.h" -#include "srslte/interfaces/ue_interfaces.h" +#include "srslte/interfaces/ue_gw_interfaces.h" namespace srsenb { diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 20d938a3f..246f8616f 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -59,6 +59,7 @@ namespace srsue { class phy_controller; class usim_interface_rrc; +class gw_interface_rrc; class rrc : public rrc_interface_nas, public rrc_interface_phy_lte, diff --git a/srsue/hdr/stack/upper/gw.h b/srsue/hdr/stack/upper/gw.h index 251c3b3cc..34c3cbe61 100644 --- a/srsue/hdr/stack/upper/gw.h +++ b/srsue/hdr/stack/upper/gw.h @@ -20,6 +20,7 @@ #include "srslte/common/log.h" #include "srslte/common/log_filter.h" #include "srslte/common/threads.h" +#include "srslte/interfaces/ue_gw_interfaces.h" #include "srslte/interfaces/ue_interfaces.h" #include "srslte/srslog/srslog.h" #include "tft_packet_filter.h" diff --git a/srsue/hdr/stack/upper/nas.h b/srsue/hdr/stack/upper/nas.h index b0bbfd988..8cb8225c8 100644 --- a/srsue/hdr/stack/upper/nas.h +++ b/srsue/hdr/stack/upper/nas.h @@ -32,6 +32,7 @@ using srslte::byte_buffer_t; namespace srsue { class usim_interface_nas; +class gw_interface_nas; class nas : public nas_interface_rrc, public srslte::timer_callback { diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index c59666284..80eff707a 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -14,6 +14,7 @@ #include "srslte/asn1/rrc.h" #include "srslte/common/bcd_helpers.h" #include "srslte/common/security.h" +#include "srslte/interfaces/ue_gw_interfaces.h" #include "srslte/interfaces/ue_usim_interfaces.h" #include "srsue/hdr/stack/rrc/phy_controller.h" #include "srsue/hdr/stack/rrc/rrc_meas.h" @@ -24,9 +25,7 @@ #include #include #include -#include #include -#include bool simulate_rlf = false; diff --git a/srsue/src/stack/upper/nas.cc b/srsue/src/stack/upper/nas.cc index ffae2b950..d71853815 100644 --- a/srsue/src/stack/upper/nas.cc +++ b/srsue/src/stack/upper/nas.cc @@ -20,6 +20,7 @@ #include "srslte/asn1/liblte_mme.h" #include "srslte/common/logmap.h" +#include "srslte/interfaces/ue_gw_interfaces.h" #include "srslte/interfaces/ue_usim_interfaces.h" #include "srsue/hdr/stack/upper/nas.h" #include "srsue/hdr/stack/upper/nas_idle_procedures.h"