aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/Transceiver.cpp
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-08-16 16:53:23 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-08-16 17:06:54 +0200
commit8c80095017f693a9e96b9118e33786f8887ffe0c (patch)
tree88a879b9daea3cb71c29f983eca65d6b92910d6e /Transceiver52M/Transceiver.cpp
parentd49a6aa136efcb9106abfa432e148e643db7ac1e (diff)
Add -j option to bind to specific address
Before this patch, the binding of the listening sockets was hardcoded to a local IP. Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec
Diffstat (limited to 'Transceiver52M/Transceiver.cpp')
-rw-r--r--Transceiver52M/Transceiver.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index bf2dd6e..d9c231d 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -112,13 +112,14 @@ bool TransceiverState::init(int filler, size_t sps, float scale, size_t rtsc, un
}
Transceiver::Transceiver(int wBasePort,
- const char *wTRXAddress,
+ const char *TRXAddress,
+ const char *GSMcoreAddress,
size_t tx_sps, size_t rx_sps, size_t chans,
GSM::Time wTransmitLatency,
RadioInterface *wRadioInterface,
double wRssiOffset)
- : mBasePort(wBasePort), mAddr(wTRXAddress),
- mClockSocket(wBasePort, wTRXAddress, mBasePort + 100),
+ : mBasePort(wBasePort), mLocalAddr(TRXAddress), mRemoteAddr(GSMcoreAddress),
+ mClockSocket(TRXAddress, wBasePort, GSMcoreAddress, wBasePort + 100),
mTransmitLatency(wTransmitLatency), mRadioInterface(wRadioInterface),
rssiOffset(wRssiOffset),
mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mEdge(false), mOn(false), mForceClockInterface(false),
@@ -197,8 +198,8 @@ bool Transceiver::init(int filler, size_t rtsc, unsigned rach_delay, bool edge)
d_srcport = mBasePort + 2 * i + 2;
d_dstport = mBasePort + 2 * i + 102;
- mCtrlSockets[i] = new UDPSocket(c_srcport, mAddr.c_str(), c_dstport);
- mDataSockets[i] = new UDPSocket(d_srcport, mAddr.c_str(), d_dstport);
+ mCtrlSockets[i] = new UDPSocket(mLocalAddr.c_str(), c_srcport, mRemoteAddr.c_str(), c_dstport);
+ mDataSockets[i] = new UDPSocket(mLocalAddr.c_str(), d_srcport, mRemoteAddr.c_str(), d_dstport);
}
/* Randomize the central clock */