fix GW init procedure and set pool instance in ctor

master
Andre Puschmann 5 years ago
parent 2e1479e9d6
commit 1a7142d73f

@ -70,27 +70,27 @@ public:
private:
static const int GW_THREAD_PRIO = 7;
stack_interface_gw* stack;
srslte::byte_buffer_pool* pool;
srslte::logger* logger;
gw_args_t args;
bool running;
bool run_enable;
int32_t tun_fd;
struct ifreq ifr;
int32_t sock;
bool if_up;
stack_interface_gw* stack = nullptr;
srslte::byte_buffer_pool* pool = nullptr;
srslte::logger* logger = nullptr;
gw_args_t args = {};
bool running = false;
bool run_enable = false;
int32_t tun_fd = 0;
struct ifreq ifr = {};
int32_t sock = 0;
bool if_up = false;
uint32_t default_lcid = 0;
srslte::log_filter log;
uint32_t current_ip_addr;
uint32_t current_ip_addr = 0;
uint8_t current_if_id[8];
long ul_tput_bytes;
long dl_tput_bytes;
long ul_tput_bytes = 0;
long dl_tput_bytes = 0;
struct timeval metrics_time[3];
void run_thread();
@ -101,9 +101,9 @@ private:
void del_ipv6_addr(struct in6_addr* in6p);
// MBSFN
int mbsfn_sock_fd; // Sink UDP socket file descriptor
struct sockaddr_in mbsfn_sock_addr; // Target address
uint32_t mbsfn_ports[SRSLTE_N_MCH_LCIDS]; // Target ports for MBSFN data
int mbsfn_sock_fd = 0; // Sink UDP socket file descriptor
struct sockaddr_in mbsfn_sock_addr = {}; // Target address
uint32_t mbsfn_ports[SRSLTE_N_MCH_LCIDS] = {}; // Target ports for MBSFN data
// TFT
std::mutex tft_mutex;
@ -115,5 +115,4 @@ private:
} // namespace srsue
#endif // SRSUE_GW_H

@ -34,14 +34,10 @@
namespace srsue {
gw::gw() : if_up(false), default_lcid(0), thread("GW")
{
current_ip_addr = 0;
}
gw::gw() : thread("GW"), pool(srslte::byte_buffer_pool::get_instance()) {}
int gw::init(const gw_args_t& args_, srslte::logger* logger_, stack_interface_gw* stack_)
{
pool = srslte::byte_buffer_pool::get_instance();
stack = stack_;
logger = logger_;
args = args_;
@ -52,8 +48,6 @@ int gw::init(const gw_args_t& args_, srslte::logger* logger_, stack_interface_gw
log.set_hex_limit(args.log.gw_hex_limit);
gettimeofday(&metrics_time[1], NULL);
dl_tput_bytes = 0;
ul_tput_bytes = 0;
// MBSFN
mbsfn_sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
@ -69,8 +63,6 @@ int gw::init(const gw_args_t& args_, srslte::logger* logger_, stack_interface_gw
mbsfn_sock_addr.sin_family = AF_INET;
mbsfn_sock_addr.sin_addr.s_addr =inet_addr("127.0.0.1");
bzero(mbsfn_ports, SRSLTE_N_MCH_LCIDS*sizeof(uint32_t));
return SRSLTE_SUCCESS;
}

Loading…
Cancel
Save