aboutsummaryrefslogtreecommitdiffstats
path: root/lib/trx
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-08-10 00:01:26 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-08-10 16:38:59 +0700
commit5394c6012d05d6565d1374e1c7a67b3f5f2decc6 (patch)
tree1371ea16a810e05d204a2dc64c02ac79ebabae98 /lib/trx
parent0e246372bc692f2f12198b61010c4ea156056428 (diff)
gsm_trx_burst_if: allow to customize the bind address
Pleviously remote address for DATA interface was also used as the bind address, what is definitely wrong. Let's change the API a bit in order to allow one to specify a custom bind address. Change-Id: I6e5f7b7119ac454217b8dd04f9ee0dd3b23972b6
Diffstat (limited to 'lib/trx')
-rw-r--r--lib/trx/trx_burst_if_impl.cc9
-rw-r--r--lib/trx/trx_burst_if_impl.h3
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/trx/trx_burst_if_impl.cc b/lib/trx/trx_burst_if_impl.cc
index e3fcc89..f72eecd 100644
--- a/lib/trx/trx_burst_if_impl.cc
+++ b/lib/trx/trx_burst_if_impl.cc
@@ -48,19 +48,22 @@ namespace gr {
trx_burst_if::sptr
trx_burst_if::make(
+ const std::string &bind_addr,
const std::string &remote_addr,
const std::string &base_port)
{
int base_port_int = boost::lexical_cast<int> (base_port);
return gnuradio::get_initial_sptr
- (new trx_burst_if_impl(remote_addr, base_port_int));
+ (new trx_burst_if_impl(bind_addr, remote_addr,
+ base_port_int));
}
/*
* The private constructor
*/
trx_burst_if_impl::trx_burst_if_impl(
+ const std::string &bind_addr,
const std::string &remote_addr,
int base_port
) : gr::block("trx_burst_if",
@@ -79,8 +82,8 @@ namespace gr {
std::string data_dst_port = boost::lexical_cast<std::string> (base_port + 102);
// Init DATA interface
- d_data_sock = new udp_socket(remote_addr,
- data_src_port, data_dst_port, DATA_IF_MTU);
+ d_data_sock = new udp_socket(bind_addr, data_src_port,
+ remote_addr, data_dst_port, DATA_IF_MTU);
// Bind DATA interface handler
d_data_sock->udp_rx_handler = boost::bind(
diff --git a/lib/trx/trx_burst_if_impl.h b/lib/trx/trx_burst_if_impl.h
index 27ec259..fdb49f2 100644
--- a/lib/trx/trx_burst_if_impl.h
+++ b/lib/trx/trx_burst_if_impl.h
@@ -40,7 +40,8 @@ namespace gr {
void burst_pack(pmt::pmt_t msg, uint8_t *buf);
public:
- trx_burst_if_impl(const std::string &remote_addr, int base_port);
+ trx_burst_if_impl(const std::string &bind_addr,
+ const std::string &remote_addr, int base_port);
~trx_burst_if_impl();
void handle_dl_burst(pmt::pmt_t msg);