OBECA Receive Process
Gw.h
1 // OBECA - Open Broadcast Edge Cache Appliance
2 // Receive Process
3 //
4 // Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU Affero General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU Affero General Public License for more details.
15 //
16 // You should have received a copy of the GNU Affero General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 //
19 
20 #pragma once
21 #include <string>
22 #include <libconfig.h++>
23 #include "srslte/srslte.h"
24 #include "srslte/upper/rlc.h"
25 #include "srslte/asn1/rrc_asn1.h"
26 
27 #include "Phy.h"
28 
34 class Gw : public srsue::gw_interface_stack {
35  public:
42  Gw(const libconfig::Config& cfg, Phy& phy)
43  : _cfg(cfg)
44  , _phy(phy)
45  {}
46 
50  virtual ~Gw();
51 
55  void init();
56 
61  void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) override;
62 
63  // Unused interface methods
64  void add_mch_port(uint32_t lcid, uint32_t port) override {};
65  void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu) override {};
66  int setup_if_addr(uint32_t lcid, uint8_t pdn_type, uint32_t ip_addr, uint8_t* ipv6_if_id, char* err_str) override { return -1; };
67  int apply_traffic_flow_template(const uint8_t& eps_bearer_id, const uint8_t& lcid, const LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft) override { return -1; };
68  void set_test_loop_mode(const test_loop_mode_state_t mode, const uint32_t ip_pdu_delay_ms = 0) override {};
69 
70  private:
71  const libconfig::Config& _cfg;
72 
73  std::mutex _wr_mutex;
74  int32_t _tun_fd = -1;
75  Phy& _phy;
76 };
Gw
Network gateway component.
Definition: Gw.h:34
Phy
The PHY component.
Definition: Phy.h:43
Gw::~Gw
virtual ~Gw()
Default destructor.
Definition: Gw.cpp:93
Gw::write_pdu_mch
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) override
Handle a MCH PDU.
Definition: Gw.cpp:36
Gw::Gw
Gw(const libconfig::Config &cfg, Phy &phy)
Default constructor.
Definition: Gw.h:42
Gw::init
void init()
Creates the TUN interface according to params from Cfg.
Definition: Gw.cpp:99