C++
-
template<class T>
class fftw::allocator - #include <FFTW.hh>
Allocator for FFTW-aligned memory.
- tparam T
type of objects to allocate.
Public Types
-
using void_pointer = void*
-
using const_void_pointer = const void*
-
using size_type = size_t
-
using difference_type = ptrdiff_t
-
struct ARQEventEntry
Log entry for LLC events.
Public Members
-
double timestamp
Event timestamp.
-
double mono_timestamp
Monotonic clock timestamp.
-
uint8_t type
Type of LLC entry.
-
uint16_t seq
Sequence number.
-
hvl_t sacks
Selective ACKs.
A selective ACK sequence is a list of tuples [start,end) representing selective ACKs from start (inclusive) to end (non-inclusive).
-
double timestamp
-
struct AutoGain
- #include <AutoGain.hh>
PHY TX parameters.
Public Functions
-
inline AutoGain()
-
inline float getAutoSoftTXGainClipFrac(void) const
Get the fraction of unclipped IQ values. Defaults to 0.999.
-
inline void setAutoSoftTXGainClipFrac(float frac)
Set the fraction of unclipped IQ values. Defaults to 0.999.
This sets the fraction of values guaranteed to be unclipped when the 0dBFS soft TX gain is automatically determined. For example, a value of 0.99 ensures that 99% of the values will fall below 1, i.e., the 99th percentile is unclipped.
-
inline float getSoftTXGain(void) const
Get soft TX gain (multiplicative factor).
-
inline void setSoftTXGain(float g)
Set soft TX gain (multiplicative factor).
- Parameters
g – The soft gain (multiplicative factor).
-
inline float getSoftTXGain0dBFS(void) const
Get soft TX gain (dB).
-
inline void setSoftTXGain0dBFS(float dB)
Set soft TX gain (dBFS).
- Parameters
dB – The soft gain (dBFS).
-
inline void recalc0dBFSEstimate(unsigned nsamples)
Recalculate the 0dBFS estimate.
- Parameters
nsamples – The number of samples used to estimate 0dBFS
-
inline bool needCalcAutoSoftGain0dBFS(void) const
Do we need to calculate auto-gain?
Calculate soft TX gain necessary for 0 dBFS.
- Parameters
g – Gain applied to buf.
buf – The IQ buffer for which we are calculating soft gain.
Private Members
-
std::atomic<float> g_0dBFS_
Multiplicative TX gain necessary for 0dBFS.
-
std::atomic<float> auto_soft_tx_gain_clip_frac_
Fraction of unclipped IQ values. Defaults to 0.999.
-
mutable std::shared_mutex mutex_
Mutex protecting private members.
-
unsigned nestimates_0dBFS_
Number of samples to take to estimate g_0dBFS.
-
inline AutoGain()
-
class barrier
-
class liquid::BaseNCO : public NCO
Subclassed by liquid::NCO, liquid::VCO
Public Functions
-
inline BaseNCO(liquid_ncotype type, double dtheta)
-
BaseNCO() = delete
-
inline virtual ~BaseNCO()
-
inline virtual void reset(double dtheta) final override
Reset NCO state with given frequency in radians per sample.
-
inline virtual double getFrequency(void) final override
Get frequency in radians per sample.
-
inline virtual void setFrequency(double dtheta) final override
Set frequency in radians per sample.
-
inline virtual double getPhase(void) final override
Get phase in radians.
-
inline virtual void setPhase(double theta) final override
Set phase in radians.
-
inline virtual std::complex<float> mix_up(const std::complex<float> in) final override
Mix a single sample up.
-
inline virtual std::complex<float> mix_down(const std::complex<float> in) final override
Mix a single sample down.
-
inline virtual void mix_up(const std::complex<float> *in, std::complex<float> *out, size_t count) final override
Mix a signal up.
-
inline virtual void mix_down(const std::complex<float> *in, std::complex<float> *out, size_t count) final override
Mix a signal down.
Private Members
-
nco_crcf nco_
-
inline BaseNCO(liquid_ncotype type, double dtheta)
-
template<class D, class P, class T>
class BasePort - #include <Element.hh>
Base class representing a port attached to an Element.
Public Functions
-
inline BasePort(Element &element, std::function<void(void)> connected, std::function<void(void)> disconnected)
-
virtual ~BasePort() = default
Protected Functions
-
inline void connected(void)
Safely indicate that the port was connected.
-
inline void disconnected(void)
Safely indicate that the port was disconnected.
Protected Attributes
-
std::function<void(void)> connected_
Called when the port is connected.
-
std::function<void(void)> disconnected_
Called when the port is disconnected.
Friends
- friend class Port< typename D::Flip, P, T >
- friend class BasePort< typename D::Flip, P, T >
-
inline BasePort(Element &element, std::function<void(void)> connected, std::function<void(void)> disconnected)
-
class BlockSignal
- #include <threads.hh>
Atomically block a signal.
Public Functions
-
explicit BlockSignal(int sig)
Save current signal mask and block a signal.
- Parameters
sig – The signal to block
-
BlockSignal() = delete
-
~BlockSignal()
Restore original signal mask.
-
void unblockAndPause(void)
Atomically unblock signal and pause until we receive a signal.
Protected Attributes
-
sigset_t orig_mask_
Original signal mask before we blocked a signal.
-
explicit BlockSignal(int sig)
-
template<typename T>
class buffer Public Types
-
using size_type = std::size_t
-
using difference_type = std::ptrdiff_t
-
using reference = value_type&
-
using const_reference = const value_type&
-
using pointer = value_type*
-
using const_pointer = const value_type*
-
using iterator = value_type*
-
using const_iterator = const value_type*
Public Functions
-
inline buffer()
-
inline ~buffer()
-
inline const_reference at(size_type pos) const
-
inline const_reference operator[](size_type pos) const
-
inline const_reference front(void) const
-
inline const_reference back(void) const
-
inline value_type *data() noexcept
-
inline const value_type *data() const noexcept
-
inline const_iterator begin(void) const noexcept
-
inline const_iterator cbegin(void) const noexcept
-
inline const_iterator end(void) const noexcept
-
inline const_iterator cend(void) const noexcept
-
inline bool empty(void) const noexcept
-
inline void shrink_to_fit(void)
-
inline void clear(void) noexcept
-
inline void pop_back(void)
-
using size_type = std::size_t
-
class BufferDecoder : public FLACMemoryDecoder
-
class BufferEncoder : public FLACMemoryEncoder
-
class Caps
Public Functions
-
inline Caps()
-
inline Caps(cap_t caps)
-
inline ~Caps()
-
inline void set_proc()
-
inline void clear()
-
inline cap_flag_value_t get_flag(cap_value_t cap, cap_flag_t flag)
-
inline void set_flag(cap_flag_t flag, const std::vector<cap_value_t> &caps)
-
inline void clear_flag(cap_flag_t flag)
-
inline void clear_flag(cap_flag_t flag, const std::vector<cap_value_t> &caps)
Protected Attributes
-
cap_t caps_
-
inline Caps()
-
struct Channel
-
class ChannelDemodulator
- #include <Channelizer.hh>
Demodulate packets from a channel.
Public Types
-
using callback_type = PHY::PacketDemodulator::callback_type
Public Functions
-
inline ChannelDemodulator(PHY &phy, const Channel &channel, const std::vector<C> &taps, double rx_rate)
-
ChannelDemodulator() = delete
-
virtual ~ChannelDemodulator() = default
-
inline void setCallback(callback_type callback)
Set demodulation callback.
-
virtual void reset(void) = 0
Reset internal state.
-
virtual void timestamp(const MonoClock::time_point ×tamp, std::optional<ssize_t> snapshot_off, ssize_t offset, float rx_rate) = 0
Set timestamp for demodulation.
- Parameters
timestamp – The timestamp for future samples.
snapshot_off – The snapshot offset associated with the given timestamp.
offset – The offset of the first sample that will be demodulated. Can be negative!
rx_rate – RX rate (Hz)
-
virtual void demodulate(const std::complex<float> *data, size_t count) = 0
Demodulate data with given parameters.
-
using callback_type = PHY::PacketDemodulator::callback_type
-
class Channelizer : public Element
- #include <Channelizer.hh>
Base class for channelizers.
Subclassed by FDChannelizer, OverlapTDChannelizer, TDChannelizer
Public Functions
-
virtual ~Channelizer() = default
-
inline virtual double getRXRate(void)
Get the RX sample rate.
-
inline virtual void setRXRate(double rate)
Set the RX sample rate.
- Parameters
rate – The rate.
Add an IQ buffer to demodulate.
- Parameters
buf – The IQ samples to demodulate
-
virtual void reconfigure(void) = 0
Reconfigure for new RX parameters.
-
virtual ~Channelizer() = default
-
class ChannelModulator
- #include <Synthesizer.hh>
Modulate packets for a channel.
This class is responsible for modulating packets and synthesizing a channel from the modulated packet.
Subclassed by FDChannelModulator, TDChannelModulator
-
class ChannelSynthesizer : public Synthesizer
- #include <ChannelSynthesizer.hh>
A single-channel synthesizer.
Subclassed by ParallelChannelSynthesizer< ChannelModulator >
Public Types
-
using container_type = ModPacketQueue<>::container_type
Public Functions
-
virtual ~ChannelSynthesizer() = default
-
inline std::optional<size_t> getHighWaterMark(void) const
Get high-water mark.
-
inline void setHighWaterMark(std::optional<size_t> mark)
Set high-water mark.
-
inline size_t try_pop(container_type &mpkts, size_t max_samples, bool overfill)
Pop modulated packets.
-
inline size_t try_pop(container_type &mpkts)
Pop all modulated packets.
-
inline size_t pop(container_type &mpkts)
Pop all modulated packets.
Protected Attributes
-
std::optional<size_t> chanidx_
Index of channel we should synthesize.
-
ModPacketQueue queue_
-
using container_type = ModPacketQueue<>::container_type
-
class Clock
- #include <Clock.hh>
A clock.
Subclassed by MonoClock, WallClock
Public Static Functions
-
class Controller : public Element
- #include <Controller.hh>
A MAC controller.
Subclassed by DummyController, SmartController
Public Functions
-
virtual ~Controller() = default
-
Controller() = delete
Set the controller’s network queue.
-
inline size_t getMTU() const
Get MTU.
-
inline virtual void setMinChannelBandwidth(double min_bw)
Set minimum channel bandwidth.
Pull a packet from the network to be sent next over the radio.
This function is automatically called when a packet is requested from the net_out port.
-
inline virtual void kick(void)
Kick the controller.
Process demodulated packets.
This function is automatically called to process packets received on on the radio_in port.
-
inline virtual void disconnect(void)
Called when net_out is disconnected. By default, this disconnects net_in so that any pending pulls will terminate.
Notify controller that a packet missed its transmission slot.
This function is called by the MAC when a packet has missed its transmission slot.
Public Members
-
virtual ~Controller() = default
-
struct ControlMsg
- #include <Packet.hh>
A Control message.
Public Types
Public Members
-
struct ControlMsg::TimestampSent PACKED
-
struct ControlMsg::TimestampRecv PACKED
-
uint8_t type
-
TimestampSent timestamp_sent
-
TimestampRecv timestamp_recv
-
ReceiverStats receiver_stats
-
SelectiveAck ack
-
union ControlMsg::[anonymous] [anonymous]
-
struct ControlMsg::TimestampSent PACKED
-
struct darpa_mgenhdr
- #include <mgen.h>
A DARPA-variant MGEN packet header.
Public Members
-
uint16_t messageSize
-
uint8_t version
-
uint8_t flags
-
uint32_t mgenFlowId
-
uint32_t sequenceNumber
-
uint32_t reserved
-
mgen_secs_t txTimeSeconds
-
mgen_usecs_t txTimeMicroseconds
-
uint16_t messageSize
-
struct darpa_mgenrest
-
class DecompressionBuffer : public buffer<unsigned char>
Public Functions
-
DecompressionBuffer() = delete
-
inline DecompressionBuffer(RadioPacket &pkt_)
-
inline void copyBytesOut(size_t count)
-
inline void flush(void)
-
DecompressionBuffer() = delete
-
class Demodulator
Subclassed by liquid::Demodulator
Public Types
Public Functions
-
Demodulator() = default
-
virtual ~Demodulator() = default
-
inline virtual unsigned getOversampleRate(void)
-
virtual bool isFrameOpen(void) = 0
Is a frame currently being demodulated?
- Returns
true if a frame is currently being demodulated, false otherwise.
-
virtual void print(void) = 0
Print description of demodulator to stdout.
-
virtual void reset(void) = 0
Reset demodulator state.
-
virtual void demodulate(const std::complex<float> *in, const size_t n, callback_t cb) = 0
Demodulate IQ data.
- Parameters
in – Pointer to IQ data to demodulate
n – Number of IQ samples to demodulate
cb – Demodulation callback
-
Demodulator() = default
-
class liquid::Demodulator : public Demodulator
Subclassed by liquid::FlexFrameDemodulator, liquid::NewFlexFrameDemodulator, liquid::OFDMDemodulator, liquid::PHY::PacketDemodulator
Public Functions
-
Demodulator() = delete
-
virtual ~Demodulator() = default
-
inline bool getSoftHeader() const
-
inline void setSoftHeader(bool soft)
-
inline bool getSoftPayload() const
-
inline void setSoftPayload(bool soft)
-
virtual void demodulate(const std::complex<float> *in, const size_t n, callback_t cb) override
Demodulate IQ data.
- Parameters
in – Pointer to IQ data to demodulate
n – Number of IQ samples to demodulate
cb – Demodulation callback
Protected Functions
-
virtual void demodulateSamples(const std::complex<float> *in, const size_t n) = 0
Demodulate samples.
-
virtual int callback(unsigned char *header_, int header_valid_, int header_test_, unsigned char *payload_, unsigned int payload_len_, int payload_valid_, framesyncstats_s stats_)
Callback function for liquid demodulator.
-
virtual void reconfigureHeader(void) = 0
Reconfigure demodulator based on new header parameters.
-
virtual void reconfigureSoftDecode(void) = 0
Reconfigure demodulator based on new soft decoding parameters.
Protected Attributes
-
bool soft_header_
Flag indicating whether or not to use soft decoding for header.
-
bool soft_payload_
Flag indicating whether or not to use soft decoding for payload.
-
callback_t cb_
Demodulation callback.
Protected Static Functions
-
static int liquid_callback(unsigned char *header_, int header_valid_, int header_test_, unsigned char *payload_, unsigned int payload_len_, int payload_valid_, framesyncstats_s stats_, void *userdata_)
Callback function for liquid demodulator.
-
Demodulator() = delete
-
template<class T, class C>
class dragonradio::signal::Downsampler : public dragonradio::signal::Pfb<T, C>, public Resampler<T, T> - #include <Polyphase.hh>
A downsampler that uses a polyphase filter bank.
Public Functions
-
inline Downsampler(unsigned m, const std::vector<C> &taps)
Construct a downsampler.
- Parameters
m – The downsampling rate
taps – The taps for the prototype FIR filter, which should have unity gain.
-
Downsampler() = delete
-
virtual ~Downsampler() = default
-
inline virtual double getRate(void) const override
-
inline virtual double getDelay(void) const override
-
inline virtual size_t neededOut(size_t count) const override
-
inline virtual void reset(void) override
Protected Functions
-
inline virtual void reconfigure(void) override
Reconfigure filter bank for current number of channels and taps.
-
inline Downsampler(unsigned m, const std::vector<C> &taps)
-
class DummyController : public Controller
- #include <DummyController.hh>
A Dummy MAC controller that just passes packets.
Public Functions
-
virtual ~DummyController() = default
Pull a packet from the network to be sent next over the radio.
This function is automatically called when a packet is requested from the net_out port.
Process demodulated packets.
This function is automatically called to process packets received on on the radio_in port.
-
virtual ~DummyController() = default
-
class heap::element
Subclassed by TimerQueue::Timer
Public Members
-
size_type heap_index
-
size_type heap_index
-
class Element
- #include <Element.hh>
A packet processing element.
Subclassed by Channelizer, Controller, FlowPerformance, PacketCompressor, Processor< T >, Processor< std::shared_ptr< NetPacket > >, Queue< T >, Synthesizer, TunTap
-
template<class T>
class EMA : public Estimator<T> - #include <Estimator.hh>
Estimate a value by calculating an exponential moving average.
The EMA
estimator updates an exponetially weighted moving average with a weight alpha. Optionally, it can make an estimate using an average until mean_until samples have been collected. As a guideline, choosing alpha to be 2/(n+1) means the first n data points “will represent about 86% of the total
weight in the calculation EMA.”
See: https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average
-
struct SendWindow::Entry : public TimerQueue::Timer
Public Functions
-
inline Entry(SendWindow &sendw)
-
virtual ~Entry() = default
-
inline bool pending()
Does this entry have a pending packet to be sent?
Set packet in send window entry.
- Parameters
p – The packet.
-
inline void reset(void)
Release packet.
-
inline bool mayDrop(const std::optional<size_t> &max_retransmissions)
Return true if we MAY drop this window entry.
We MAY drop an entry if: 1) It is NOT a SYN packet, because in that case it is needed to initiate a connection. We always retransmit SYN packets.
-
inline bool shouldDrop(const std::optional<size_t> &max_retransmissions)
Return true if we SHOULD drop this window entry.
We SHOULD drop an entry if: 1) It is NOT a SYN packet, because in that case it is needed to initiate a connection. We always retransmit SYN packets. AND 2) It has exceeded the maximum number of allowed retransmissions. 3) OR it has passed its deadline.
-
virtual void operator()() override
Public Members
-
SendWindow &sendw
The send window.
-
MonoClock::time_point timestamp
Timestamp of last transmission of this packet.
This is the time at which the packet was queued for transmission, not the actual time at which it was transmitted, which is instead recorded in the packet itself.
-
inline Entry(SendWindow &sendw)
-
struct RecvWindow::Entry
Public Functions
-
inline Entry()
Set packet in receive window entry.
- Parameters
p – The packet.
-
inline void alreadyDelivered(void)
-
inline void reset(void)
Public Members
-
bool received
Was this entry in the window received?
-
bool delivered
Was this entry in the window delivered?
-
std::shared_ptr<RadioPacket> pkt
The packet received in this window entry.
-
inline Entry()
-
template<class T>
class Estimator - #include <Estimator.hh>
A statistical estimator.
Subclassed by EMA< T >, Mean< T >, TimeWindowEstimator< Clock, T >, WindowedMean< T >
-
struct EventEntry
Generic event.
-
struct ExtendedHeader
- #include <Header.hh>
Extended header that appears in radio payload.
-
class ExtensibleDataSet
-
class FDChannelizer::FDChannelDemodulator : public ChannelDemodulator
Channel state for time-domain demodulation.
Public Functions
-
virtual ~FDChannelDemodulator() = default
-
void updateSeq(unsigned seq)
Update IQ buffer sequence number.
-
void reset(void) override
-
void timestamp(const MonoClock::time_point ×tamp, std::optional<ssize_t> snapshot_off, ssize_t offset, float rx_rate) override
-
void demodulate(const std::complex<float> *data, size_t count) override
-
virtual ~FDChannelDemodulator() = default
-
class FDChannelizer : public Channelizer
- #include <FDChannelizer.hh>
A frequency-domain channelizer.
Public Functions
-
virtual ~FDChannelizer()
Add an IQ buffer to demodulate.
- Parameters
buf – The IQ samples to demodulate
-
virtual void reconfigure(void) override
Reconfigure for new RX parameters.
-
void stop(void)
Stop demodulating.
Public Static Attributes
-
static constexpr unsigned P = 25 * 512 + 1
Filter length.
We need two factors of 5 because we need to support 25MHz bandwidth. The remaining factors of 2 get us to a filter of order 12800, which is about how many taps we need for a 50kHz passband transition in 80MHz of bandwidth.
-
static constexpr unsigned V = 4
Overlap factor.
Private Functions
-
void fftWorker(void)
Worker that converts packets from time domain to frequency domain.
-
void demodWorker(unsigned tid)
A demodulation worker.
Private Members
-
unsigned nthreads_
Number of demodulation threads.
-
bool done_
Flag that is true when we should finish processing.
-
std::atomic<bool> reconfigure_
Flag that is true when we are reconfiguring.
-
std::mutex wake_mutex_
Mutex for waking demodulators.
-
std::condition_variable wake_cond_
Condition variable for waking demodulators.
-
std::mutex demod_mutex_
Mutex for demodulation state.
-
std::vector<std::unique_ptr<FDChannelDemodulator>> demods_
Channel state for demodulation.
-
std::thread fft_thread_
FFT worker thread.
-
std::vector<std::thread> demod_threads_
Demodulation worker threads.
Private Static Attributes
-
static constexpr unsigned LOGR = 4
Log of size of ring buffers.
-
virtual ~FDChannelizer()
-
class FDChannelModulator : public ChannelModulator
- #include <FDChannelModulator.hh>
Channel state for frequency-domain modulation.
Public Functions
-
inline FDChannelModulator(PHY &phy, unsigned chanidx, const Channel &channel, const std::vector<C> &taps, double tx_rate)
-
FDChannelModulator() = delete
-
virtual ~FDChannelModulator() = default
-
inline FDChannelModulator(PHY &phy, unsigned chanidx, const Channel &channel, const std::vector<C> &taps, double tx_rate)
-
class FDMA : public MAC
- #include <FDMA.hh>
Public Functions
-
virtual ~FDMA()
-
inline bool getAccurateTXTimestamps(void) const
-
inline void setAccurateTXTimestamps(bool accurate)
-
inline double getTimedTXDelay(void) const
-
inline void setTimedTXDelay(double t)
-
virtual void stop(void) override
Stop processing packets.
Private Functions
-
void txWorker(void)
Worker preparing slots for transmission.
Private Members
-
double premod_
Amount of data to pre-modulate (sec)
-
bool accurate_tx_timestamps_
Provide more accurate TX timestamps.
Providing more accurate TX timestamps may increase latency.
-
double timed_tx_delay_
Delay for timed TX (sec)
-
std::shared_ptr<ChannelSynthesizer> channel_synthesizer_
Out channel synthesizer.
-
std::thread rx_thread_
Thread running rxWorker.
-
std::thread tx_thread_
Thread running txWorker.
-
std::thread tx_notifier_thread_
Thread running txNotifier.
-
virtual ~FDMA()
-
template<typename T, unsigned P, unsigned V>
class FDUpsampler Public Functions
-
inline FDUpsampler(unsigned X_, unsigned I_, int Nrot_)
-
FDUpsampler() = delete
-
inline void reset(size_t npartial = 0)
-
inline size_t upsample(const T *in, size_t count, T *out, const float g, bool flush, size_t &nsamples, size_t max_nsamples, size_t &fdnsamples)
-
inline size_t npending(void)
Return number of pending output samples in buffer.
-
inline FDUpsampler(unsigned X_, unsigned I_, int Nrot_)
-
template<class I, class O>
class Filter Subclassed by FIR< I, O, C >, IIR< I, O, C >
-
template<class I, class O, class C>
class FIR : public Filter<I, O> Subclassed by liquid::FIR< I, O, C >
-
template<class T, class C>
class dragonradio::signal::FIR : public FIR<T, T, C> Public Functions
-
FIR() = delete
-
virtual ~FIR() = default
-
inline virtual float getGroupDelay(float fc) const final override
Get filter group delay.
-
inline virtual void reset(void) final override
Reset filter state.
-
inline virtual float getDelay(void) const final override
Get filter delay.
Protected Functions
-
FIR() = delete
-
template<class I, class O, class C>
class liquid::FIR : public FIR<I, O, C> - #include <Filter.hh>
An FIR filter.
Public Functions
-
FIR() = delete
-
inline virtual ~FIR()
-
inline virtual float getGroupDelay(float fc) const final override
Get filter group delay.
-
inline virtual void reset(void) final override
Reset filter state.
-
inline virtual float getDelay(void) const final override
Get filter delay.
-
inline C getScale() const
Get output scaling for filter.
- Returns
Scaling factor applied to each output sample
-
inline void setScale(C scale)
Set output scaling for filter.
- Parameters
scale – Scaling factor applied to each output sample
-
inline void print(void) const
Print filter object information to stdout.
-
FIR() = delete
-
template<>
class liquid::FIR<C, C, C> : public FIR<C, C, C> Public Functions
-
FIR() = delete
-
inline virtual ~FIR()
-
inline virtual float getGroupDelay(float fc) const final override
Get filter group delay.
-
inline virtual void reset(void) final override
Reset filter state.
-
inline virtual float getDelay(void) const final override
Get filter delay.
-
inline void print(void) const
-
FIR() = delete
-
template<class T, class Set = std::unordered_set<uint16_t>>
class Firewall : public Processor<T> - #include <Firewall.hh>
A flow processor.
Public Functions
-
inline Firewall()
-
virtual ~Firewall() = default
-
inline bool getEnabled(void)
Get enabled flagd.
-
inline void setEnabled(bool enabled)
Set enabled flag.
-
inline bool getAllowBroadcasts(void)
Get flag indicating whether or not bradcast packets are allowed.
-
inline void setAllowBroadcasts(bool allowed)
Set flag indicating whether or not bradcast packets are allowed.
-
inline Firewall()
-
class FLACException : public exception
Public Functions
-
inline FLACException(const char *msg)
-
virtual ~FLACException() = default
-
inline const char *what() const
Protected Attributes
-
const char *msg_
The FLAC error message.
-
inline FLACException(const char *msg)
-
class FLACMemoryDecoder : public Stream
Subclassed by BufferDecoder, PyArrayDecoder
Public Functions
-
FLACMemoryDecoder()
-
virtual ~FLACMemoryDecoder() = default
-
virtual void decode(const char *encoded, size_t n)
Protected Functions
-
virtual size_t size(void) = 0
Get size of buffer holding decoded data.
-
virtual void resize(size_t size) = 0
Resize buffer holding decoded data.
-
inline void check(bool ok)
-
inline void checkInit(FLAC__StreamDecoderInitStatus status)
-
FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes) override
-
FLAC__StreamDecoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset) override
-
FLAC__StreamDecoderTellStatus tell_callback(FLAC__uint64 *absolute_byte_offset) override
-
FLAC__StreamDecoderLengthStatus length_callback(FLAC__uint64 *stream_length) override
-
bool eof_callback() override
-
FLAC__StreamDecoderWriteStatus write_callback(const FLAC__Frame *frame, const FLAC__int32 *const buffer[]) override
-
void metadata_callback(const FLAC__StreamMetadata *metadata) override
-
void error_callback(FLAC__StreamDecoderErrorStatus status) override
-
FLACMemoryDecoder()
-
class FLACMemoryEncoder : public Stream
Subclassed by BufferEncoder, PyArrayEncoder
Protected Functions
-
virtual size_t size(void) = 0
Get size of buffer holding encoded.
-
virtual char *data(void) = 0
Get pointer to buffer holding encoded.
-
virtual void resize(size_t size) = 0
Resize buffer holding encoded data.
-
inline void check(bool ok)
-
inline void checkInit(FLAC__StreamEncoderInitStatus status)
-
FLAC__StreamEncoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes) override
-
FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame) override
-
FLAC__StreamEncoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset) override
-
FLAC__StreamEncoderTellStatus tell_callback(FLAC__uint64 *absolute_byte_offset) override
-
void metadata_callback(const FLAC__StreamMetadata *metadata) override
Protected Attributes
-
size_t off_
Offset into buffer at which to write data.
-
virtual size_t size(void) = 0
-
struct Header::Flags
- #include <Header.hh>
Packet flags.
Public Members
-
uint8_t syn
Set if the packet is the first in a new connection.
-
uint8_t ack
Set if the packet is ACKing.
-
uint8_t has_seq
Set if the packet is sequenced.
-
uint8_t has_control
Set if the packet has control data.
-
uint8_t compressed
Set if the packet is compressed.
-
uint8_t team
Unused flags.
-
uint8_t syn
-
class liquid::FlexFrame : public liquid::PHY
- #include <FlexFrame.hh>
A PHY thats uses the liquid-usrp flexframegen code.
Public Functions
-
inline FlexFrame(const MCS &header_mcs, const std::vector<std::pair<MCS, AutoGain>> &mcs_table, bool soft_header, bool soft_payload)
-
virtual ~FlexFrame() = default
Protected Functions
-
inline virtual std::shared_ptr<::PHY::PacketDemodulator> mkPacketDemodulator(void) override
Create a Demodulator for this PHY.
-
inline virtual std::shared_ptr<::PHY::PacketModulator> mkPacketModulator(void) override
Create a Modulator for this PHY.
-
inline FlexFrame(const MCS &header_mcs, const std::vector<std::pair<MCS, AutoGain>> &mcs_table, bool soft_header, bool soft_payload)
-
class liquid::FlexFrameDemodulator : public virtual liquid::Demodulator
Subclassed by liquid::FlexFrame::PacketDemodulator
Public Functions
-
inline virtual ~FlexFrameDemodulator()
-
FlexFrameDemodulator() = delete
-
FlexFrameDemodulator(const FlexFrameDemodulator&) = delete
-
FlexFrameDemodulator(FlexFrameDemodulator&&) = delete
-
FlexFrameDemodulator &operator==(const FlexFrameDemodulator&) = delete
-
FlexFrameDemodulator &operator!=(const FlexFrameDemodulator&) = delete
-
inline virtual unsigned getOversampleRate(void) override
-
inline virtual bool isFrameOpen(void) override
Is a frame currently being demodulated?
- Returns
true if a frame is currently being demodulated, false otherwise.
-
inline virtual void print(void) override
Print description of demodulator to stdout.
-
inline virtual void reset(void) override
Reset demodulator state.
-
inline virtual void demodulateSamples(const std::complex<float> *buf, const size_t n) override
Demodulate samples.
Protected Functions
-
inline virtual void reconfigureHeader(void) override
Reconfigure demodulator based on new header parameters.
-
inline virtual void reconfigureSoftDecode(void) override
Reconfigure demodulator based on new soft decoding parameters.
Protected Attributes
-
origflexframesync fs_
-
inline virtual ~FlexFrameDemodulator()
-
class liquid::FlexFrameModulator : public virtual liquid::Modulator
Subclassed by liquid::FlexFrame::PacketModulator
Public Functions
-
inline virtual ~FlexFrameModulator()
-
FlexFrameModulator() = delete
-
FlexFrameModulator(const FlexFrameModulator&) = delete
-
FlexFrameModulator(FlexFrameModulator&&) = delete
-
FlexFrameModulator &operator=(const FlexFrameModulator&) = delete
-
FlexFrameModulator &operator=(FlexFrameModulator&&) = delete
-
inline virtual void print(void) override
Print description of modulator to stdout.
-
inline virtual void assemble(const Header *header, const void *payload, const size_t payload_len) override
Assemble data for modulation.
- Parameters
header – Pointer to header
payload – Pointer to payload
payload_len – Number of bytes in payload
-
inline virtual unsigned getOversampleRate(void) override
-
inline virtual size_t assembledSize(void) override
Return size of assembled data.
-
inline virtual size_t maxModulatedSamples(void) override
Return maximum number of modulated samples that will be produced.
-
inline virtual bool modulateSamples(std::complex<float> *buf, size_t &nw) override
Modulate assembled packet.
- Parameters
out – Pointer to output buffer for IQ data
n – Reference to variable that will hold number of samples produced
Public Static Attributes
-
static constexpr size_t NGEN = 2
Protected Functions
-
inline virtual void reconfigureHeader(void) override
Reconfigure modulator based on new header parameters.
-
inline virtual void reconfigurePayload(void) override
Reconfigure modulator based on new payload parameters.
Protected Attributes
-
origflexframegen fg_
-
inline virtual ~FlexFrameModulator()
-
class FlowPerformance : public Element
- #include <FlowPerformance.hh>
A flow performance measurement element.
Public Functions
-
explicit FlowPerformance(double mp)
-
FlowPerformance() = delete
-
virtual ~FlowPerformance() = default
-
inline double getMeasurementPeriod(void) const
Get measurement period.
-
inline std::optional<double> getStart(void) const
Get start time.
-
inline void setStart(std::optional<double> &start)
Set start time.
-
inline FlowStatsMap getSources(bool reset)
Return flow source statistics.
-
inline FlowStatsMap getSinks(bool reset)
Return flow sink statistics.
-
inline MandateMap getMandates(void)
Get mandates.
-
void setMandates(const MandateMap &mandates)
Set mandates.
Public Members
Protected Functions
Handle a network packet.
Handle a radio packet.
-
FlowStatsMap getFlowStatsMap(FlowStatsMap &stats, std::mutex &mutex, bool reset)
Return a copy of a FlowStatsMap, resetting it if necessary.
-
FlowStats &findFlow(FlowStatsMap &stats, Packet &pkt)
Find a flow’s entry in statistics map.
Protected Attributes
-
double mp_
Measurement period.
-
std::optional<double> start_
Start time.
-
std::mutex sources_mutex_
Mutex for sources.
-
FlowStatsMap sources_
Flow source info.
-
std::mutex sinks_mutex_
Mutex for sinks.
-
FlowStatsMap sinks_
Flow sink info.
-
std::mutex mandates_mutex_
Mandates mutex.
-
MandateMap mandates_
Mandates.
-
explicit FlowPerformance(double mp)
-
struct FlowStats
- #include <FlowPerformance.hh>
Statistics for a single flow.
Public Functions
-
FlowStats() = delete
-
FlowStats() = delete
-
class Gain
Public Functions
-
inline Gain(void)
-
~Gain() = default
-
inline float getLinearGain(void) const
-
inline void setLinearGain(float g)
-
inline float getDbGain(void) const
-
inline void setDbGain(float dB)
Protected Attributes
-
std::atomic<float> g_
-
inline Gain(void)
-
struct Header
- #include <Header.hh>
PHY packet header.
-
template<class T, class Container = std::vector<std::reference_wrapper<T>>, class Compare = std::less<T>>
class heap Public Types
-
struct ControlMsg::Hello
Public Members
-
bool is_gateway
Set to true if this is the gateway node.
-
bool is_gateway
-
template<class I, class O, class C>
class IIR : public Filter<I, O> Subclassed by liquid::IIR< I, O, C >
-
template<class I, class O, class C>
class liquid::IIR : public IIR<I, O, C> - #include <Filter.hh>
An IIR filter.
Public Functions
-
IIR() = delete
-
inline IIR(const C *b, unsigned Nb, const C *a, unsigned Na)
Initialize filter with feedforward and feedback constants.
-
inline virtual ~IIR()
-
inline virtual float getGroupDelay(float fc) const final override
Get filter group delay.
-
inline virtual void reset(void) final override
Reset filter state.
-
inline void print(void) const
Print filter object information to stdout.
-
IIR() = delete
-
template<>
class liquid::IIR<C, C, C> : public IIR<C, C, C> Public Functions
-
IIR() = delete
-
inline virtual ~IIR()
-
inline virtual float getGroupDelay(float fc) const final override
Get filter group delay.
-
inline virtual void reset(void) final override
Reset filter state.
-
inline void print(void) const
Print filter object information to stdout.
Protected Attributes
-
iirfilt_cccf q_
-
IIR() = delete
-
struct In
- #include <Element.hh>
Type tag for input ports.
-
struct Packet::InternalFlags
- #include <Packet.hh>
Internal flags.
Public Members
-
uint8_t invalid_header
Set if the packet had invalid header.
-
uint8_t invalid_payload
Set if the packet had invalid payload.
-
uint8_t retransmission
Set if the packet is a retransmission.
-
uint8_t assigned_seq
Set if the packet has an assigned sequence number.
-
uint8_t need_selective_ack
Set if the packet needs a selective ACK.
-
uint8_t has_selective_ack
Set if the packet contains a selective ACK.
-
uint8_t invalid_header
-
struct IQBuf : public buffer<std::complex<float>>
- #include <IQBuffer.hh>
A buffer of IQ samples.
Public Functions
-
inline IQBuf(size_t sz)
-
inline IQBuf(const std::complex<float> *data, size_t n)
-
inline ~IQBuf() noexcept
-
inline void waitToStartFilling(void)
Wait for the buffer to start filling.
-
inline void zero(void)
Zero all data in the buffer.
-
inline void gain(const float g)
Apply a gain.
- Parameters
g – The multiplicative gain.
-
inline void power(float &peak_power, float &avg_power)
Compute peak and average power.
Public Members
-
std::optional<MonoClock::time_point> timestamp
Timestamp of the first sample.
-
unsigned seq
Sequence number of current slot.
-
float fc
Sample center frequency.
-
float fs
Sample rate.
-
size_t delay
Signal delay.
-
std::atomic<size_t> nsamples
Number of samples received so far.
This value is valid untile the buffer is marked complete.
-
std::atomic<bool> complete
Flag that is true when receive is completed.
-
std::optional<ssize_t> snapshot_off
Offset from beginning of the current snapshot.
-
size_t undersample
Number of undersamples at the beginning of the buffer. That is, this is how many samples we missed relative to the requested RX start time at the beginning of the RX.
-
size_t oversample
Number oversamples at the end of buffer. That is, this is how many samples we missed relative to the requested RX end time at the end of the RX.
-
inline IQBuf(size_t sz)
-
class Packet::iterator : public std::iterator<std::input_iterator_tag, ControlMsg>
Public Functions
-
~iterator() = default
-
iterator() = delete
-
const ControlMsg &operator*()
-
const ControlMsg *operator->()
-
~iterator() = default
-
struct MAC::Load
- #include <MAC.hh>
MAC load, measured as samples transmitted over time.
Public Functions
-
inline void reset(size_t nchannels)
Public Members
-
WallClock::time_point start
Start of load measurement period.
-
WallClock::time_point end
End of load measurement period.
-
inline void reset(size_t nchannels)
-
class Logger
Public Types
Public Functions
-
Logger(const WallClock::time_point &t_start, const MonoClock::time_point &mono_t_start)
-
~Logger()
-
Logger() = delete
-
void open(const std::string &filename)
-
void stop(void)
-
void close(void)
-
void setAttribute(const std::string &name, const std::string &val)
-
void setAttribute(const std::string &name, uint8_t val)
-
void setAttribute(const std::string &name, uint32_t val)
-
void setAttribute(const std::string &name, int64_t val)
-
void setAttribute(const std::string &name, uint64_t val)
-
void setAttribute(const std::string &name, double val)
-
inline void logTXRecord(const std::optional<MonoClock::time_point> &t, size_t nsamples, double fs)
-
inline void logEvent(const MonoClock::time_point &t, const std::string &event)
-
inline void logEvent(const MonoClock::time_point &t, std::unique_ptr<char[]> event)
-
inline void logNAK(const MonoClock::time_point &t, NodeId node, Seq seq)
-
inline void logRetransmissionNAK(const MonoClock::time_point &t, NodeId node, Seq seq)
-
inline void logSNAK(const MonoClock::time_point &t, NodeId node, Seq seq)
-
inline void logACKTimeout(const MonoClock::time_point &t, NodeId node, Seq seq)
Private Types
Private Functions
-
void worker(void)
Log worker.
-
H5::Attribute createOrOpenAttribute(const std::string &name, const H5::DataType &data_type, const H5::DataSpace &data_space)
-
void logTXRecord_(const std::optional<MonoClock::time_point> &t, size_t nsamples, double fs)
-
void logRecv_(RadioPacket &pkt)
-
void logSend_(const MonoClock::time_point &t, DropType dropped, NetPacket &pkt)
-
void logEvent_(const MonoClock::time_point &t, char *event)
-
void logARQEvent_(const MonoClock::time_point &t, ARQEventType type, NodeId node, Seq seq)
-
void logARQSACKEvent_(Packet &pkt, ARQEventType type, NodeId node, Seq unack)
Private Members
-
bool is_open_
-
H5::H5File file_
-
std::unique_ptr<ExtensibleDataSet> slots_
-
std::unique_ptr<ExtensibleDataSet> tx_records_
-
std::unique_ptr<ExtensibleDataSet> snapshots_
-
std::unique_ptr<ExtensibleDataSet> selftx_
-
std::unique_ptr<ExtensibleDataSet> recv_
-
std::unique_ptr<ExtensibleDataSet> send_
-
std::unique_ptr<ExtensibleDataSet> event_
-
std::unique_ptr<ExtensibleDataSet> arq_event_
-
WallClock::time_point t_start_
-
MonoClock::time_point mono_t_start_
-
MonoClock::time_point t_last_slot_
-
uint32_t sources_
Data sources we collect.
-
bool done_
Flag indicating we should terminate the logger.
-
std::thread worker_thread_
Log worker thread.
-
Logger(const WallClock::time_point &t_start, const MonoClock::time_point &mono_t_start)
-
class MAC
- #include <MAC.hh>
A MAC protocol.
Subclassed by FDMA, SlottedMAC
Public Functions
-
virtual ~MAC() = default
-
MAC() = delete
-
inline const std::shared_ptr<Channelizer> &getChannelizer(void)
Get the MAC’s channelizer.
-
inline const std::shared_ptr<Synthesizer> &getSynthesizer(void)
Get the MAC’s synthesizer.
-
inline virtual bool canTransmit(void) const
Can this MAC transmit.
- Returns
true if we can transmit, false otherwise
-
inline virtual void setSchedule(const Schedule::sched_type &schedule)
Set MAC schedule.
-
inline virtual void setMinChannelBandwidth(double min_bw)
Set minimum channel bandwidth.
-
virtual void stop(void) = 0
Stop processing packets.
Protected Functions
-
void rxWorker(void)
Worker receiving packets.
-
void txNotifier(void)
Worker handling notification for transmitted slots.
Protected Attributes
-
std::shared_ptr<Controller> controller_
Our controller.
-
std::shared_ptr<SnapshotCollector> snapshot_collector_
Our snapshot collector.
-
std::shared_ptr<Channelizer> channelizer_
Our channelizer.
-
std::shared_ptr<Synthesizer> synthesizer_
Our synthesizer.
-
bool done_
Flag indicating if we should stop processing packets.
-
bool can_transmit_
Flag indicating whether or not we can transmit.
This is used, in particular, for the TDMA MAC, which may not have a slot
-
double rx_rate_
RX rate.
-
double tx_rate_
TX rate.
-
double rx_period_
Length of RX period (sec)
-
size_t rx_period_samps_
Number of RX samples in an RX period.
-
size_t rx_bufsize_
RX buffer size.
-
double min_chan_bw_
The minimum channel bandwidth (Hz)
-
std::optional<double> tx_fc_off_
TX center frequency offset from RX center frequency.
If the TX and RX rates are different, this is non-empty and contains the frequency of the channel we transmit on.
-
std::mutex load_mutex_
Mutex for load.
-
std::mutex tx_records_mutex_
Mutex for transmission records.
-
std::condition_variable tx_records_cond_
Condition variable protecting transmission records.
-
virtual ~MAC() = default
-
struct Mandate
Public Functions
-
Mandate() = delete
-
inline Mandate(FlowUID flow_uid_, double hold_period_, int point_value_, std::optional<double> max_latency_s_, std::optional<double> min_throughput_bps_, std::optional<double> file_transfer_deadline_s_)
-
~Mandate() = default
-
inline bool isThroughput() const
Is this a throughput mandate?
-
inline bool isFileTransfer() const
Is this a file transfer mandate?
Public Members
-
double hold_period
Period over which to measure outcome metrics (sec)
-
int point_value
Point value.
-
std::optional<double> max_latency_s
Maximum latency allowed for a packet (sec)
-
std::optional<double> min_throughput_bps
Minimum throughput (bps)
-
std::optional<double> file_transfer_deadline_s
File transfer delivery deadline (sec)
-
unsigned achieved_duration
Achieved duration.
-
double scalar_performace
Scalar performance.
-
std::optional<double> mandated_latency
Flow mandated latency.
-
Mandate() = delete
-
template<class T>
class MandateQueue : public Queue<T> - #include <MandateQueue.hh>
A queue that obeys mandates.
Public Types
-
using Priority = std::pair<int, double>
Priority value.
A priority is a pair, with the first number representing the priority of the “category” to which a queue belongs, and the second number representing the relative priority within the given category of queues. The second number is meant to reflect the “value” of a flow.
Public Functions
-
inline MandateQueue()
-
inline virtual ~MandateQueue()
-
inline virtual void setSendWindowStatus(NodeId id, bool isOpen) override
Set whether or not a node’s send window is open.
-
inline bool getBonusPhase(void) const
Get flag indicating whether or not to have a bonus phase.
-
inline void setBonusPhase(bool bonus_phase)
Set flag indicating whether or not to have a bonus phase.
-
inline void setFlowQueuePriority(FlowUID flow_uid, const Priority &priority)
Set flow queue priority.
-
inline MandateMap getMandates(void)
Get mandates.
-
inline void setMandates(const MandateMap &mandates)
Set mandates.
-
inline QueuePriorities getQueuePriorities(void)
Get queue priorities.
-
inline virtual void reset(void) override
Reset queue to empty state.
-
inline virtual void kick(void) override
Kick the queue.
-
inline virtual void stop(void) override
Stop processing queue elements.
-
inline virtual void setTransmissionDelay(double t) override
Set transmission delay.
-
inline virtual double getTransmissionDelay(void) const override
Get transmission delay.
Public Static Attributes
-
static constexpr Priority kDefaultFlowQueuePriority = Priority(1, 0.0)
Default priority for per-flow queue.
-
static constexpr double kMaxTokenFactor = 2.0
Factor specifying maximum tokens in token bucket relative to throughput requirement.
-
static constexpr double kTokenFactor = 1.1
Factor specifying tokens added to token bucket relative to throughput requirement.
Protected Types
-
using Queues = std::vector<std::reference_wrapper<SubQueue>>
Protected Functions
-
inline void add_queue(SubQueue &subq)
Add a new queue.
-
inline void sort_queues(void)
Protected Attributes
-
bool done_
Flag indicating that processing of the queue should stop.
-
std::atomic<bool> kicked_
Is the queue being kicked?
-
bool bonus_phase_
Flag indicating whether or not to have a bonus phase.
-
mutable std::mutex m_
Mutex protecting the queues.
-
std::condition_variable cond_
Condition variable protecting the queue.
-
MandateMap mandates_
Mandates.
-
SubQueue hiq_
The high-priority queue.
-
SubQueue defaultq_
The default queue.
-
unsigned nitems_
Number of enqueued items.
-
TimerQueue timer_queue_
Timer queue.
-
bool need_sort_
Does the list of queues need to be sorted?
-
unsigned bonus_idx_
Position of last-served queue during bonus time.
-
using Priority = std::pair<int, double>
-
struct MCS
- #include <Modem.hh>
A modulation and coding scheme.
Subclassed by liquid::MCS
-
template<class T>
class Mean : public Estimator<T> - #include <Estimator.hh>
Estimate a value by calculating a mean.
Public Functions
-
inline Mean()
-
inline virtual operator bool() const override
Does the estimator have a value?
-
inline virtual T value_or(T &&default_value) const override
Return the value of the estimator or a default.
-
inline virtual size_t size(void) const override
Return the number of samples used in the estimate.
-
inline Mean()
-
struct mgenaddr
-
struct mgenhdr
- #include <mgen.h>
An MGEN packet header.
See: https://downloads.pf.itd.nrl.navy.mil/docs/mgen/mgen.html
Public Functions
-
inline uint16_t getMessageSize(void) const
-
inline uint32_t getFlowId(void) const
-
inline uint32_t getSequenceNumber(void) const
-
inline WallClock::time_point getTimestamp(void) const
Public Members
-
uint16_t messageSize
-
uint8_t version
-
uint8_t flags
-
uint32_t mgenFlowId
-
uint32_t sequenceNumber
-
mgen_secs_t txTimeSeconds
-
mgen_usecs_t txTimeMicroseconds
-
inline uint16_t getMessageSize(void) const
-
struct mgenrest
-
struct mgenstdaddr
-
template<class T, class C>
class dragonradio::signal::MixingRationalResampler : public dragonradio::signal::RationalResampler<T, C> - #include <Polyphase.hh>
A rational resampler that uses a polyphase filter bank and performs mixing.
Public Functions
-
inline MixingRationalResampler(unsigned l, unsigned m, double rad, const std::vector<C> &taps)
Construct a polyphase rational resampler.
- Parameters
l – The upsampling rate
m – The downsampling rate
rad – The frequency shift (radians)
taps – The taps for the prototype FIR filter. The filter must be designed to run at the upsampler rater.
-
inline MixingRationalResampler(double r, double rad, const std::vector<C> &taps)
Construct a polyphase rational resampler.
- Parameters
r – The resampler rate
rad – Frequency shift (radians)
taps – The taps for the prototype FIR filter. The filter must be designed to run at the upsampler rater.
-
MixingRationalResampler() = delete
-
virtual ~MixingRationalResampler() = default
-
inline double getFreqShift(void)
Get frequency shift in radians.
-
inline void setFreqShift(double rad)
Set frequency shift in radians.
- Parameters
rad – Frequency shift with respect to the highest sample rate out of the input and output rates. The resampler will internally compensate for non-unity upsampler and downsampler rates.
-
inline const std::vector<C> &getBandpassTaps(void) const
Get mixed (bandpass) prototype filter taps.
-
inline virtual void reset(void) override
Protected Functions
-
inline virtual void reconfigure(void) override
Reconfigure filter bank for current number of channels and taps.
-
inline MixingRationalResampler(unsigned l, unsigned m, double rad, const std::vector<C> &taps)
-
struct ModPacket
- #include <PHY.hh>
A modulated data packet to be sent over the radio.
-
template<class T = std::unique_ptr<ModPacket>, class Container = std::list<T>>
class ModPacketQueue - #include <ModPacketQueue.hh>
A queue of modulated packets.
Public Functions
-
inline ModPacketQueue()
-
~ModPacketQueue() = default
-
inline std::optional<size_t> getHighWaterMark(void) const
-
inline void setHighWaterMark(std::optional<size_t> high_water_mark)
-
inline void stop(void)
-
inline size_t try_pop(container_type &mpkts, size_t max_samples, bool overfill)
-
inline size_t try_pop(container_type &mpkts)
-
inline size_t pop(container_type &mpkts)
-
inline void kick(void)
Kick the queue to force progress.
Protected Attributes
-
std::atomic<bool> done_
Are we done with the queue?
-
std::atomic<bool> kicked_
Is the queue being kicked?
-
std::optional<size_t> high_water_mark_
Maximum number of IQ samples the queue may contain.
-
size_t nsamples_
Number of IQ samples the queue contains.
-
std::mutex mutex_
Mutex protecting the queue.
-
std::condition_variable producer_cond_
Producer condition variable.
-
std::condition_variable consumer_cond_
Consumer condition variable.
-
container_type queue_
Queue of modulated packets.
-
inline ModPacketQueue()
-
class Modulator
Subclassed by liquid::Modulator
Public Functions
-
Modulator() = default
-
virtual ~Modulator() = default
-
inline virtual unsigned getOversampleRate(void)
-
virtual void print(void) = 0
Print description of modulator to stdout.
-
virtual void assemble(const Header *header, const void *payload, const size_t payload_len) = 0
Assemble data for modulation.
- Parameters
header – Pointer to header
payload – Pointer to payload
payload_len – Number of bytes in payload
-
virtual size_t assembledSize(void) = 0
Return size of assembled data.
-
virtual size_t maxModulatedSamples(void) = 0
Return maximum number of modulated samples that will be produced.
-
virtual bool modulateSamples(std::complex<float> *out, size_t &n) = 0
Modulate assembled packet.
- Parameters
out – Pointer to output buffer for IQ data
n – Reference to variable that will hold number of samples produced
-
Modulator() = default
-
class liquid::Modulator : public Modulator
Subclassed by liquid::FlexFrameModulator, liquid::NewFlexFrameModulator, liquid::OFDMModulator, liquid::PHY::PacketModulator
-
class MonoClock : public Clock
- #include <Clock.hh>
A monotonic clock.
Public Static Functions
-
static inline time_point now() noexcept
Get the current time. Guaranteed to be monotonic.
Public Static Attributes
-
static const bool is_steady = true
-
static inline time_point now() noexcept
-
struct MPStats
- #include <FlowPerformance.hh>
Statistics for a single measurement period.
Public Functions
-
inline MPStats()
-
inline MPStats()
-
struct MandateQueue::SubQueue::MPStats
- #include <MandateQueue.hh>
Statistics for a single measurement period.
Public Functions
-
inline MPStats()
-
inline MPStats()
-
class MultichannelSynthesizer::MultichannelModulator : public ChannelModulator, private FDUpsampler<C, P, V>
Channel modulator for multichannel modulation.
Public Functions
-
MultichannelModulator(PHY &phy, unsigned chanidx, const Channel &channel, const std::vector<C> &taps, double tx_rate)
-
MultichannelModulator() = delete
-
~MultichannelModulator() = default
-
void nextSlot(const Slot *prev_slot, Slot &slot, const bool overfill)
Specify the next slot to modulate.
- Parameters
prev_slot – The previous slot
slot – The new slot
overfill – true if this slot can be overfilled
-
bool fits(ModPacket &mpkt, const bool overfill)
Determine whether or not a modulated packet will fit in the current frequency domain buffer.
- Parameters
mpkt – The modulated packet
overfill – Flag that is true if the slot can be overfilled
- Returns
true if the packet will fit in the slot, false otherwise If the packet will fit in the slot, nsamples is updated appropriately.
Set current IQ buffer to be upsampled.
- Parameters
iqbuf –
-
inline size_t upsampledSize(size_t n)
Calculate how many samples will be in upsampled signal. @param n Number of samples in original signal.
- Returns
Number of samples in upsampled signal.
-
size_t upsample(void)
Perform frequency-domain upsampling on current IQ buffer.
- Returns
Number of samples read from the input buffer.
Public Members
-
std::mutex mutex
Mutex for channel state.
-
size_t iqbufoff
Offset of unmodulated data in IQ buffer.
-
size_t delay
Number of time domain samples in the frequency domain buffer to delay.
-
size_t nsamples
Number of valid time-domain samples represented by data in the frequency domain buffer.
This represents the number of valid UN-overlapped time-domain samples represented by the FFT blocks in the frequency domain buffer.
-
size_t max_samples
Maximum number of time-domain samples.
-
size_t npartial
Number of time-domain samples represented by final FFT block that are included in nsamples.
-
std::optional<size_t> partial_fftoff
FFT buffer offset before flush of partial block.
-
size_t fdnsamples
Number of valid samples in the frequency-domain buffer.
This will be a multiple of N
-
MultichannelModulator(PHY &phy, unsigned chanidx, const Channel &channel, const std::vector<C> &taps, double tx_rate)
-
class MultichannelSynthesizer : public SlotSynthesizer
- #include <MultichannelSynthesizer.hh>
A frequency-domain, per-channel synthesizer.
Public Types
-
using Upsampler = FDUpsampler<C, P, V>
Public Functions
-
virtual ~MultichannelSynthesizer()
Modulate a slot.
-
virtual void finalize(Slot &slot) override
Finalize a slot.
This should be called after a slot is closed in order to finish any final computations necessary. It does not need to acquire teh slot’s mutex.
-
virtual void stop(void) override
Stop modulating.
-
virtual void reconfigure(void) override
Reconfigure for new TX parameters.
Public Static Attributes
-
static constexpr unsigned P = 25 * 64 + 1
Filter length.
We need two factors of 5 because we need to support 25MHz bandwidth. The rest of the factors of 2 are for good measure.
-
static constexpr unsigned V = 4
Overlap factor.
Private Functions
-
void modWorker(unsigned tid)
Thread modulating packets.
Private Members
-
unsigned nthreads_
Number of synthesizer threads.
-
std::atomic<bool> done_
Flag indicating if we should stop processing packets.
-
std::atomic<bool> reconfigure_
Flag that is true when we are reconfiguring.
-
std::mutex wake_mutex_
Mutex for waking demodulators.
-
std::condition_variable wake_cond_
Condition variable for waking demodulators.
-
std::mutex mods_mutex_
Mutex for demodulation state.
-
std::vector<std::unique_ptr<MultichannelModulator>> mods_
Channel state for demodulation.
-
std::vector<std::thread> mod_threads_
Threads running modWorker.
-
double tx_rate_copy_
TX sample rate.
-
using Upsampler = FDUpsampler<C, P, V>
-
template<class I, class O, class C>
class liquid::MultiStageResampler : public Resampler<I, O> Public Functions
-
inline MultiStageResampler(float rate, unsigned m, float fc, float As, unsigned npfb)
Create a liquid multi-stage resampler.
- Parameters
rate – Resampling rate
m – Prototype filter semi-length
fc – Prototype filter cutoff frequency, in range (0, 0.5)
As – Stop-band attenuation
npfb – Number of filters in polyphase filterbank
-
inline MultiStageResampler(MultiStageResampler &&resamp)
-
inline virtual ~MultiStageResampler()
-
inline virtual double getRate(void) const final override
-
inline virtual double getDelay(void) const final override
-
inline virtual size_t neededOut(size_t count) const final override
-
inline virtual void reset(void) final override
-
inline size_t resample(const std::complex<float> *in, size_t count, std::complex<float> *out) final override
-
inline void print(void)
-
inline MultiStageResampler(float rate, unsigned m, float fc, float As, unsigned npfb)
-
template<>
class liquid::MultiStageResampler<C, C, F> : public Resampler<C, C> Public Functions
-
inline MultiStageResampler(float rate, unsigned m, float fc, float As, unsigned npfb)
Create a liquid multi-stage resampler.
- Parameters
rate – Resampling rate
m – Prototype filter semi-length
fc – Prototype filter cutoff frequency, in range (0, 0.5)
As – Stop-band attenuation
npfb – Number of filters in polyphase filterbank
-
MultiStageResampler(const MultiStageResampler&) = delete
-
inline MultiStageResampler(MultiStageResampler &&resamp)
-
inline virtual ~MultiStageResampler()
-
MultiStageResampler &operator=(const MultiStageResampler&) = delete
-
inline MultiStageResampler &operator=(MultiStageResampler &&resamp)
-
inline virtual double getRate(void) const final override
-
inline virtual double getDelay(void) const final override
-
inline virtual size_t neededOut(size_t count) const final override
-
inline virtual void reset(void) final override
-
virtual size_t resample(const std::complex<float> *in, size_t count, std::complex<float> *out) final override
-
inline void print(void)
-
size_t resample(const I *in, size_t count, O *out) = 0
-
inline MultiStageResampler(float rate, unsigned m, float fc, float As, unsigned npfb)
-
class NCO
Subclassed by liquid::BaseNCO, TableNCO
Public Functions
-
NCO() = default
-
virtual ~NCO() = default
-
virtual double getFrequency(void) = 0
Get frequency in radians per sample.
-
virtual void setFrequency(double dtheta) = 0
Set frequency in radians per sample.
-
virtual double getPhase(void) = 0
Get phase in radians.
-
virtual void setPhase(double theta) = 0
Set phase in radians.
-
virtual std::complex<float> mix_up(const std::complex<float> in) = 0
Mix a single sample up.
-
virtual std::complex<float> mix_down(const std::complex<float> in) = 0
Mix a single sample down.
-
virtual void mix_up(const std::complex<float> *in, std::complex<float> *out, size_t count) = 0
Mix a signal up.
-
virtual void mix_down(const std::complex<float> *in, std::complex<float> *out, size_t count) = 0
Mix a signal down.
-
NCO() = default
-
class liquid::NCO : public liquid::BaseNCO
- #include <NCO.hh>
A numerically-controlled oscillator (fast)
-
class NetFilter : public Processor<std::shared_ptr<NetPacket>>
-
Protected Functions
Private Members
-
in_addr_t int_net_
Internal IP network.
-
in_addr_t int_netmask_
Internal IP network mask.
-
in_addr_t int_broadcast_
Internal IP broadcast address.
-
in_addr_t ext_net_
External IP network.
-
in_addr_t ext_netmask_
External IP network mask.
-
in_addr_t ext_broadcast_
External IP broadcast address.
-
in_addr_t int_net_
-
struct NetPacket : public Packet
- #include <Packet.hh>
A packet received from the network.
Public Functions
-
NetPacket() = delete
-
inline explicit NetPacket(size_t n)
-
inline bool deadlinePassed(const MonoClock::time_point &now)
Return true if the packet’s deadline has passed, false otherwise.
-
inline bool shouldDrop(const MonoClock::time_point &now)
Return true if this packet should be dropped, false otherwise.
-
void appendTimestamp(TimestampSeq tseq)
Append a Timestamp control message to a packet.
Public Members
-
std::optional<MonoClock::time_point> deadline
Packet delivery deadline.
-
float g
Multiplicative TX gain.
-
float fc
Center frequency (Hz)
-
float bw
Bandwidth (Hz)
-
unsigned nretrans
Number of retransmissions.
-
std::optional<unsigned> mp
Measurement period to which this packet belongs.
-
std::optional<TimestampSeq> timestamp_seq
Packet timestamp.
-
size_t offset
Offset of start of packet from beginning of sample buffer.
-
size_t nsamples
Number of modulated samples.
-
WallClock::time_point tuntap_timestamp
Wall-clock time when packet was read from tun/tap.
-
MonoClock::time_point enqueue_timestamp
Time when packet was enqueued.
-
MonoClock::time_point dequeue_start_timestamp
Dequeue start timestamp.
-
MonoClock::time_point dequeue_end_timestamp
Dequeue end timestamp.
-
MonoClock::time_point llc_timestamp
Time when packet exited LLC.
-
MonoClock::time_point mod_start_timestamp
Modulation start timestamp.
-
MonoClock::time_point mod_end_timestamp
Modulation end timestamp.
-
MonoClock::time_point tx_timestamp
Packet transmission timestamp.
-
NetPacket() = delete
-
class liquid::NewFlexFrame : public liquid::PHY
- #include <NewFlexFrame.hh>
A PHY thats uses the liquid-usrp flexframegen code.
Public Functions
-
inline NewFlexFrame(const MCS &header_mcs, const std::vector<std::pair<MCS, AutoGain>> &mcs_table, bool soft_header, bool soft_payload)
-
virtual ~NewFlexFrame() = default
Protected Functions
-
inline virtual std::shared_ptr<::PHY::PacketDemodulator> mkPacketDemodulator(void) override
Create a Demodulator for this PHY.
-
inline virtual std::shared_ptr<::PHY::PacketModulator> mkPacketModulator(void) override
Create a Modulator for this PHY.
-
inline NewFlexFrame(const MCS &header_mcs, const std::vector<std::pair<MCS, AutoGain>> &mcs_table, bool soft_header, bool soft_payload)
-
class liquid::NewFlexFrameDemodulator : public virtual liquid::Demodulator
Subclassed by liquid::NewFlexFrame::PacketDemodulator
Public Functions
-
inline virtual ~NewFlexFrameDemodulator()
-
NewFlexFrameDemodulator() = delete
-
NewFlexFrameDemodulator(const NewFlexFrameDemodulator&) = delete
-
NewFlexFrameDemodulator(NewFlexFrameDemodulator&&) = delete
-
NewFlexFrameDemodulator &operator==(const NewFlexFrameDemodulator&) = delete
-
NewFlexFrameDemodulator &operator!=(const NewFlexFrameDemodulator&) = delete
-
inline virtual unsigned getOversampleRate(void) override
-
inline virtual bool isFrameOpen(void) override
Is a frame currently being demodulated?
- Returns
true if a frame is currently being demodulated, false otherwise.
-
inline virtual void print(void) override
Print description of demodulator to stdout.
-
inline virtual void reset(void) override
Reset demodulator state.
-
inline virtual void demodulateSamples(const std::complex<float> *buf, const size_t n) override
Demodulate samples.
Protected Functions
-
inline virtual void reconfigureHeader(void) override
Reconfigure demodulator based on new header parameters.
-
inline virtual void reconfigureSoftDecode(void) override
Reconfigure demodulator based on new soft decoding parameters.
Protected Attributes
-
flexframesync fs_
-
inline virtual ~NewFlexFrameDemodulator()
-
class liquid::NewFlexFrameModulator : public virtual liquid::Modulator
Subclassed by liquid::NewFlexFrame::PacketModulator
Public Functions
-
inline virtual ~NewFlexFrameModulator()
-
NewFlexFrameModulator() = delete
-
NewFlexFrameModulator(const NewFlexFrameModulator&) = delete
-
NewFlexFrameModulator(NewFlexFrameModulator&&) = delete
-
NewFlexFrameModulator &operator=(const NewFlexFrameModulator&) = delete
-
NewFlexFrameModulator &operator=(NewFlexFrameModulator&&) = delete
-
inline virtual void print(void) override
Print description of modulator to stdout.
-
inline virtual void assemble(const Header *header, const void *payload, const size_t payload_len) override
Assemble data for modulation.
- Parameters
header – Pointer to header
payload – Pointer to payload
payload_len – Number of bytes in payload
-
inline virtual unsigned getOversampleRate(void) override
-
inline virtual size_t assembledSize(void) override
Return size of assembled data.
-
inline virtual size_t maxModulatedSamples(void) override
Return maximum number of modulated samples that will be produced.
-
inline virtual bool modulateSamples(std::complex<float> *buf, size_t &nw) override
Modulate assembled packet.
- Parameters
out – Pointer to output buffer for IQ data
n – Reference to variable that will hold number of samples produced
Public Static Attributes
-
static constexpr size_t NGEN = 2
Protected Functions
-
inline virtual void reconfigureHeader(void) override
Reconfigure modulator based on new header parameters.
-
inline virtual void reconfigurePayload(void) override
Reconfigure modulator based on new payload parameters.
Protected Attributes
-
flexframegen fg_
-
inline virtual ~NewFlexFrameModulator()
-
struct Node
Public Functions
-
Node() = delete
-
~Node() = default
-
inline void setSoftTXGain(float dB)
Set soft TX gain.
- Parameters
dB – The soft gain (dBFS).
-
inline float getSoftTXGain(void) const
Get soft TX gain (dBFS).
Public Members
-
GPSLocation loc
Location.
-
bool is_gateway
Flag indicating whether or not this node is the gateway.
-
bool can_transmit
Flag indicating whether or not this node can transmit.
-
float g
Multiplicative TX gain as measured against 0 dBFS.
-
std::mutex timestamps_mutex
Mutex protecting timestamps.
-
timestamp_map timestamps_sent
Timestamp sequences sent by this node.
-
timestamp_map timestamps_recv
Timestamp sequences received from this node.
-
timestampseq_set timestamps_echoed
Echoed timestamp sequences.
-
timestamps_map timestamps
Timestamps received from this node.
-
Node() = delete
-
class liquid::OFDM : public liquid::PHY
- #include <OFDM.hh>
A PHY thats uses the liquid-usrp ofdmflexframegen code.
Public Functions
-
inline OFDM(const MCS &header_mcs, const std::vector<std::pair<MCS, AutoGain>> &mcs_table, bool soft_header, bool soft_payload, unsigned int M, unsigned int cp_len, unsigned int taper_len, const std::optional<std::string> &p)
-
- Parameters
header_mcs – The MCS used to the packet header
mcs_table – The MCS table
soft_header – True if soft decoding should be used for header
soft_payload – True if soft decoding should be used for payload
M – The number of subcarriers.
cp_len – The cyclic prefix length
taper_len – The taper length (OFDM symbol overlap)
p – The subcarrier allocation (null, pilot, data). Should have M entries.
-
virtual ~OFDM() = default
-
inline virtual unsigned getMinRXRateOversample(void) const override
Return the minimum oversample rate (with respect to PHY bandwidth) needed for demodulation.
- Returns
The minimum RX oversample rate
-
inline virtual unsigned getMinTXRateOversample(void) const override
Return the minimum oversample rate (with respect to PHY bandwidth) needed for modulation.
- Returns
The minimum TX oversample rate
-
inline liquid::OFDMSubcarriers getSubcarriers(void) const
Protected Functions
-
inline virtual std::shared_ptr<::PHY::PacketDemodulator> mkPacketDemodulator(void) override
Create a Demodulator for this PHY.
-
inline virtual std::shared_ptr<::PHY::PacketModulator> mkPacketModulator(void) override
Create a Modulator for this PHY.
-
inline OFDM(const MCS &header_mcs, const std::vector<std::pair<MCS, AutoGain>> &mcs_table, bool soft_header, bool soft_payload, unsigned int M, unsigned int cp_len, unsigned int taper_len, const std::optional<std::string> &p)
-
class liquid::OFDMDemodulator : public virtual liquid::Demodulator
Subclassed by liquid::OFDM::PacketDemodulator
Public Functions
-
inline OFDMDemodulator(const MCS &header_mcs, bool soft_header, bool soft_payload, unsigned M, unsigned cp_len, unsigned taper_len, const std::optional<OFDMSubcarriers> &p)
-
inline virtual ~OFDMDemodulator()
-
OFDMDemodulator() = delete
-
OFDMDemodulator(const OFDMDemodulator&) = delete
-
OFDMDemodulator(OFDMDemodulator&&) = delete
-
OFDMDemodulator &operator==(const OFDMDemodulator&) = delete
-
OFDMDemodulator &operator!=(const OFDMDemodulator&) = delete
-
inline virtual bool isFrameOpen(void) override
Is a frame currently being demodulated?
- Returns
true if a frame is currently being demodulated, false otherwise.
-
inline virtual void print(void) override
Print description of demodulator to stdout.
-
inline virtual void reset(void) override
Reset demodulator state.
-
inline virtual void demodulateSamples(const std::complex<float> *buf, const size_t n) override
Demodulate samples.
-
inline OFDMDemodulator(const MCS &header_mcs, bool soft_header, bool soft_payload, unsigned M, unsigned cp_len, unsigned taper_len, const std::optional<OFDMSubcarriers> &p)
-
class liquid::OFDMModulator : public virtual liquid::Modulator
Subclassed by liquid::OFDM::PacketModulator
Public Functions
-
inline OFDMModulator(const MCS &header_mcs, unsigned M, unsigned cp_len, unsigned taper_len, const std::optional<OFDMSubcarriers> &p)
-
inline virtual ~OFDMModulator()
-
OFDMModulator() = delete
-
OFDMModulator(const OFDMModulator&) = delete
-
OFDMModulator(OFDMModulator&&) = delete
-
OFDMModulator &operator=(const OFDMModulator&) = delete
-
OFDMModulator &operator=(OFDMModulator&&) = delete
-
inline virtual void print(void) override
Print description of modulator to stdout.
-
inline virtual void assemble(const Header *header, const void *payload, const size_t payload_len) override
Assemble data for modulation.
- Parameters
header – Pointer to header
payload – Pointer to payload
payload_len – Number of bytes in payload
-
inline virtual size_t assembledSize(void) override
Return size of assembled data.
-
inline virtual size_t maxModulatedSamples(void) override
Return maximum number of modulated samples that will be produced.
-
inline virtual bool modulateSamples(std::complex<float> *buf, size_t &nw) override
Modulate assembled packet.
- Parameters
out – Pointer to output buffer for IQ data
n – Reference to variable that will hold number of samples produced
-
inline OFDMModulator(const MCS &header_mcs, unsigned M, unsigned cp_len, unsigned taper_len, const std::optional<OFDMSubcarriers> &p)
-
struct Out
- #include <Element.hh>
Type tag for output ports.
-
class OverlapTDChannelizer::OverlapTDChannelDemodulator : public ChannelDemodulator
Channel state for time-domain demodulation.
Public Functions
-
inline OverlapTDChannelDemodulator(PHY &phy, const Channel &channel, const std::vector<C> &taps, double rx_rate)
-
virtual ~OverlapTDChannelDemodulator() = default
-
void reset(void) override
-
void timestamp(const MonoClock::time_point ×tamp, std::optional<ssize_t> snapshot_off, ssize_t offset, float rx_rate) override
-
void demodulate(const std::complex<float> *data, size_t count) override
-
inline OverlapTDChannelDemodulator(PHY &phy, const Channel &channel, const std::vector<C> &taps, double rx_rate)
-
class OverlapTDChannelizer : public Channelizer
- #include <OverlapTDChannelizer.hh>
A time-domain channelizer that demodulates overlapping pairs of slots. This duplicates work (and leads to duplicate packets), but it allows us to parallelize demodulation of a single channel. We have to do this when demodulation is slow, such as when we use liquid’s resamplers.
Public Types
-
using C = std::complex<float>
Public Functions
-
virtual ~OverlapTDChannelizer()
Add an IQ buffer to demodulate.
- Parameters
buf – The IQ samples to demodulate
-
virtual void reconfigure(void) override
Reconfigure for new RX parameters.
-
inline double getPrevDemod(void)
Return the portion of the end of the previous slot that we demodulate.
-
inline void setPrevDemod(double sec)
Set the portion of the end of the previous slot that we demodulate.
-
inline double getCurDemod(void)
Return the portion of the current slot that we demodulate.
-
inline void setCurDemod(double sec)
Set the portion of the current slot that we demodulate.
-
inline bool getEnforceOrdering(void)
Return flag indicating whether or not demodulation queue enforces packet order.
-
inline void setEnforceOrdering(bool enforce)
Set whether or not demodulation queue enforces packet order.
-
void stop(void)
Stop demodulating.
Private Functions
-
inline double getRXDownsampleRate(const Channel &channel)
Get RX downsample rate for given channel.
-
void demodWorker(std::atomic<bool> &reconfig)
A demodulation worker.
-
void netWorker(void)
The network send worker.
Get two slot’s worth of IQ data.
- Parameters
b – The barrier before which network packets should be inserted.
channel – The channel to demodulate.
buf1 – The buffer holding the previous slot’s IQ data.
buf2 – The buffer holding the current slot’s IQ data.
- Returns
Return true if pop was successful, false otherwise. Return two slot’s worth of IQ datathe previous slot, and the current slot. The previous slot is removed from the queue, whereas the current slot is kept in the queue because it becomes the new “previous” slot.
-
void nextWindow(void)
Move to the next demodulation window.
Private Members
-
double prev_demod_
What portion of the end of the previous slot should we demodulate (sec)?
-
size_t prev_demod_samps_
How many samples from the end of the previous slot should we demodulate?
-
double cur_demod_
What portion of the current slot should we demodulate (sec)?
-
size_t cur_demod_samps_
How many samples from the current slot should we demodulate?
-
bool enforce_ordering_
Should packets be output in the order they were actually received? Setting this to true increases latency!
-
bool done_
Flag that is true when we should finish processing.
-
RadioPacketQueue radio_q_
Queue of radio packets.
-
std::mutex iq_mutex_
Mutex protecting the queue of IQ buffers.
-
std::condition_variable iq_cond_
Condition variable protecting the queue of IQ buffers.
-
size_t iq_size_
The number of items in the queue of IQ buffers.
-
std::vector<std::atomic<bool>> demod_reconfigure_
Reconfiguration flags.
-
std::vector<std::thread> demod_threads_
Demodulation worker threads.
-
std::thread net_thread_
Network send thread.
-
using C = std::complex<float>
-
struct Packet : public buffer<unsigned char>
- #include <Packet.hh>
A packet.
Subclassed by NetPacket, RadioPacket
Public Functions
-
Packet() = delete
-
inline explicit Packet(size_t n)
-
inline ExtendedHeader &ehdr(void)
Get extended header.
-
inline const ExtendedHeader &ehdr(void) const
Get extended header.
-
inline bool integrityIntact(void) const
Check packet integrity.
-
uint16_t getControlLen(void) const
Get length of control info.
-
void setControlLen(uint16_t ctrl_len)
Set length of control info.
-
inline void clearControl(void)
Clear control messages contained in packet.
-
void appendControl(const ControlMsg &ctrl)
Append a control message to a packet.
-
void removeLastControl(ControlMsg::Type type)
Remove last control message from a packet.
Blindly remove the last control message from a packet, assuming in has type type.
-
void appendHello(const ControlMsg::Hello &hello)
Append a Hello control message to a packet.
-
void appendPing(const ControlMsg::Ping &ping)
Append a Ping control message to a packet.
-
void appendTimestampSent(TimestampSeq tseq, const MonoClock::time_point &t_recv)
Append a Timestamp Sent control message to a packet.
-
void appendTimestampRecv(NodeId node_id, TimestampSeq tseq, const MonoClock::time_point &t_recv)
Append a Timestamp Received control message to a packet.
-
void appendShortTermReceiverStats(float short_evm, float short_rssi)
Append short-term receiver statistics control message to a packet.
-
void appendLongTermReceiverStats(float long_evm, float long_rssi)
Append long-term receiver statistics control message to a packet.
-
void appendSelectiveAck(const Seq &begin, const Seq &end)
Append a selective ACK control message to a packet.
-
inline const struct ether_header *getEthernetHdr(void) const
Get Ethernet header.
- Returns
A pointer to the Ethernet header or nullptr if this is not an Ethernet packet
-
inline const struct ip *getIPHdr(void) const
Get IP header.
- Returns
A pointer to the IP header or nullptr if this is not an IP packet
-
inline struct ip *getIPHdr(void)
Get IP header.
- Returns
A pointer to the IP header or nullptr if this is not an IP packet
-
inline const struct udphdr *getUDPHdr(void) const
Get UDP header.
- Returns
A pointer to the UDP header or nullptr if this is not a UDP packet
-
inline struct udphdr *getUDPHdr(void)
Get UDP header.
- Returns
A pointer to the UDP header or nullptr if this is not a UDP packet
-
inline const struct tcphdr *getTCPHdr(void) const
Get TCP header.
- Returns
A pointer to the TCP header or nullptr if this is not a TCP packet
-
inline struct tcphdr *getTCPHdr(void)
Get TCP header.
- Returns
A pointer to the TCP header or nullptr if this is not a TCP packet
-
const struct mgenhdr *getMGENHdr(void) const
Get MGEN header.
- Returns
A pointer to the MGEN header or nullptr if this is not a MGEN packet
-
inline struct mgenhdr *getMGENHdr(void)
Get MGEN header.
- Returns
A pointer to the MGEN header or nullptr if this is not a MGEN packet
-
size_t getPayloadSize(void) const
Get payload size.
- Returns
The size of the data portion of a UDP or TCP packet.
-
inline bool isIP(void) const
Return true if this is an IP packet, false otherwise.
-
inline bool isIPProto(uint8_t proto) const
Return true if this is an IP packet of the specified IP protocol, false otherwise.
-
inline bool isTCP(void) const
Return true if this is a TCP packet, false otherwise.
-
inline bool isUDP(void) const
Return true if this is a UDP packet, false otherwise.
-
void initMGENInfo(void)
Initialize MGEN info.
Initialize flow and MGEN sequence number info
Public Members
-
std::optional<uint32_t> mgen_flow_uid
MGEN flow UID.
-
std::optional<uint32_t> mgen_seqno
MGEN sequence number.
-
MonoClock::time_point timestamp
Packet timestamp.
This timestamp is the (monotonic) time at which the packet entered the system. For network packets, it is the time the packet was read from the tun/tap interface, and for radio packets, it is the time at which the packet’s IQ data was read by the radio.
-
std::optional<WallClock::time_point> wall_timestamp
Wall-clock packet timestamp.
This timestamp is the wall-clock time at which the packet was created. Unlike the timestamp field, this field represents the time at which the packet was originally sent.
-
size_t payload_size
Payload size.
- Returns
The size of the data portion of a UDP or TCP packet.
-
struct Packet::InternalFlags internal_flags
-
Packet() = delete
-
class PacketCompressor : public Element
- #include <PacketCompressor.hh>
A packet compression element.
Public Functions
-
PacketCompressor() = delete
-
inline PacketCompressor(bool enabled, in_addr_t int_net, in_addr_t int_netmask, in_addr_t ext_net, in_addr_t ext_netmask)
-
virtual ~PacketCompressor() = default
-
inline bool getEnabled(void)
Get enabled flag.
-
inline void setEnabled(bool enabled)
Set enabled flag.
Public Members
Protected Functions
Process a network packet.
Process a radio packet.
-
void decompress(RadioPacket &pkt)
Decompress a radio packet.
-
PacketCompressor() = delete
-
class liquid::OFDM::PacketDemodulator : public liquid::PHY::PacketDemodulator, protected liquid::OFDMDemodulator
- #include <OFDM.hh>
Demodulate IQ data using a liquid-usrp flexframe.
-
class liquid::FlexFrame::PacketDemodulator : public liquid::PHY::PacketDemodulator, protected liquid::FlexFrameDemodulator
- #include <FlexFrame.hh>
Demodulate IQ data using a liquid-usrp flexframe.
-
class liquid::NewFlexFrame::PacketDemodulator : public liquid::PHY::PacketDemodulator, protected liquid::NewFlexFrameDemodulator
- #include <NewFlexFrame.hh>
Demodulate IQ data using a liquid-usrp flexframe.
Public Functions
-
inline PacketDemodulator(NewFlexFrame &phy)
-
virtual ~PacketDemodulator() = default
-
inline virtual bool isFrameOpen(void) final override
Is a frame currently being demodulated?
- Returns
true if a frame is currently being demodulated, false otherwise.
-
inline PacketDemodulator(NewFlexFrame &phy)
-
class PHY::PacketDemodulator
- #include <PHY.hh>
Demodulate packets.
Subclassed by liquid::PHY::PacketDemodulator, PyPacketDemodulator
Public Types
-
using callback_type = std::function<void(std::shared_ptr<RadioPacket>&&)>
Public Functions
-
virtual ~PacketDemodulator() = default
-
inline void setCallback(callback_type callback)
Set demodulation callback.
-
virtual bool isFrameOpen(void) = 0
Is a frame currently being demodulated?
- Returns
true if a frame is currently being demodulated, false otherwise.
-
virtual void reset(const Channel &channel) = 0
Reset the internal state of the demodulator.
- Parameters
channel – The channel being demodulated.
-
virtual void timestamp(const MonoClock::time_point ×tamp, std::optional<ssize_t> snapshot_off, ssize_t offset, size_t delay, float rate, float rx_rate) = 0
Set timestamp for demodulation.
- Parameters
timestamp – The timestamp for future samples.
snapshot_off – The snapshot offset associated with the given timestamp.
offset – The offset of the first sample that will be demodulated. Can be negative!
delay – Filter delay
rate – The rate of the resampler applied before data is passed to the demodulator.
rx_rate – The RX rate (Hz).
-
virtual void demodulate(const std::complex<float> *data, size_t count) = 0
Demodulate IQ samples.
- Parameters
data – The IQ data to demodulate
count – The number of samples to demodulate
-
using callback_type = std::function<void(std::shared_ptr<RadioPacket>&&)>
-
class liquid::PHY::PacketDemodulator : public PHY::PacketDemodulator, protected virtual liquid::Demodulator
Subclassed by liquid::FlexFrame::PacketDemodulator, liquid::NewFlexFrame::PacketDemodulator, liquid::OFDM::PacketDemodulator
Public Functions
-
virtual ~PacketDemodulator() = default
-
PacketDemodulator(const PacketDemodulator&) = delete
-
PacketDemodulator(PacketDemodulator&&) = delete
-
PacketDemodulator &operator=(const PacketDemodulator&) = delete
-
PacketDemodulator &operator=(PacketDemodulator&&) = delete
-
virtual void reset(const Channel &channel) final override
Reset the internal state of the demodulator.
- Parameters
channel – The channel being demodulated.
-
virtual void timestamp(const MonoClock::time_point ×tamp, std::optional<ssize_t> snapshot_off, ssize_t offset, size_t delay, float rate, float rx_rate) final override
Set timestamp for demodulation.
- Parameters
timestamp – The timestamp for future samples.
snapshot_off – The snapshot offset associated with the given timestamp.
offset – The offset of the first sample that will be demodulated. Can be negative!
delay – Filter delay
rate – The rate of the resampler applied before data is passed to the demodulator.
rx_rate – The RX rate (Hz).
-
inline virtual void demodulate(const std::complex<float> *data, size_t count) final override
Demodulate IQ samples.
- Parameters
data – The IQ data to demodulate
count – The number of samples to demodulate
Protected Functions
-
virtual int callback(unsigned char *header_, int header_valid_, int header_test_, unsigned char *payload_, unsigned int payload_len_, int payload_valid_, framesyncstats_s stats_) override
Callback function for liquid demodulator.
Protected Attributes
-
double resamp_rate_
Rate conversion from samples to full RX rate.
This is used internally purely to properly timestamp packets.
-
double rx_rate_
RX rate (Hz)
-
unsigned int internal_oversample_fact_
Internal resampling factor.
This is the factor by which the PHY internally oversamples, i.e., the samples seen by the Liquid demodulator are decimated by this amount. We need this quantity in order to properly track demod_off_ and friends.
-
MonoClock::time_point timestamp_
Timestamp of current slot.
-
ssize_t offset_
Sample offset of first provided sample from slot.
-
unsigned sample_start_
The sample number of the sample at offset in current slot.
-
unsigned sample_end_
The sample number of the last sample in current slot.
-
unsigned sample_
The sample counter.
-
virtual ~PacketDemodulator() = default
-
class liquid::FlexFrame::PacketModulator : public liquid::PHY::PacketModulator, protected liquid::FlexFrameModulator
- #include <FlexFrame.hh>
Modulate IQ data using a liquid-usrp flexframe.
-
class liquid::OFDM::PacketModulator : public liquid::PHY::PacketModulator, protected liquid::OFDMModulator
- #include <OFDM.hh>
Modulate IQ data using a liquid-usrp ofdmflexframegen.
-
class PHY::PacketModulator
- #include <PHY.hh>
Modulate packets.
Subclassed by liquid::PHY::PacketModulator, PyPacketModulator
Public Functions
-
virtual ~PacketModulator() = default
-
virtual ~PacketModulator() = default
-
class liquid::NewFlexFrame::PacketModulator : public liquid::PHY::PacketModulator, protected liquid::NewFlexFrameModulator
- #include <NewFlexFrame.hh>
Modulate IQ data using a liquid-usrp flexframe.
-
class liquid::PHY::PacketModulator : public PHY::PacketModulator, protected virtual liquid::Modulator
Subclassed by liquid::FlexFrame::PacketModulator, liquid::NewFlexFrame::PacketModulator, liquid::OFDM::PacketModulator
Public Functions
-
virtual ~PacketModulator() = default
-
PacketModulator(const PacketModulator&) = delete
-
PacketModulator(PacketModulator&&) = delete
-
PacketModulator &operator=(const PacketModulator&) = delete
-
PacketModulator &operator=(PacketModulator&&) = delete
-
virtual ~PacketModulator() = default
-
struct PacketRecvEntry
Log entry for received packets.
Public Members
-
double slot_timestamp
Timestamp of the slot in which the packet occurred.
If the packet spans two slots, this is the timestamp of the first slot.
-
double timestamp
Timestamp of packet reception.
-
double mono_timestamp
Monotonic clock timestamp of packet reception.
-
int32_t start_samples
Offset (in samples) from timestamp slot to start of frame.
-
int32_t end_samples
Offset (in samples) from timestamp slot to end of frame.
-
uint8_t header_valid
Was header valid?
-
uint8_t payload_valid
Was payload valid?
-
uint16_t ack
ACK’ed sequence number.
-
uint16_t data_len
Size of data portion of packet (bytes).
-
uint32_t mgen_flow_uid
MGEN flow UID.
-
uint32_t mgen_seqno
MGEN sequence number.
-
float evm
EVM [dB].
-
float rssi
RSSI [dB].
-
float cfo
CFO [f/Fs].
-
float fc
Center frequency [Hz].
-
float bw
Bandwidth [Hz].
-
double demod_latency
Demodulation latency (sec)
-
double tuntap_latency
Latency between packet reception and write to tun/tap [sec].
-
uint32_t size
Size of packet (bytes).
-
hvl_t symbols
Raw IQ data.
-
double slot_timestamp
-
struct PacketSendEntry
Log entry for sent packets.
Public Members
-
double timestamp
Timestamp of packet transmission.
-
double mono_timestamp
Monotonic clock timestamp of packet transmission.
-
double net_timestamp
Timestamp of packet reception from network.
-
uint8_t dropped
Was this packet dropped, and if so, why was it dropped?
-
uint16_t nretrans
Number of packet retransmissions.
-
uint16_t ack
ACK’ed sequence number.
-
uint16_t data_len
Size of data portion of packet (bytes).
-
uint32_t mgen_flow_uid
MGEN flow UID.
-
uint32_t mgen_seqno
MGEN sequence number.
-
float fc
Center frequency [Hz].
-
float bw
Bandwidth [Hz].
-
double tuntap_latency
Latency between packet creation and tun/tap read [sec].
-
double enqueue_latency
Enqueue latency [sec].
-
double dequeue_latency
Latency of just dequeue [sec].
-
double llc_latency
LLC latency [sec].
-
double mod_latency
Latency of just modulation [sec].
-
double synth_latency
Latency from network read to modulation [sec].
-
uint32_t size
Size of packet (bytes).
-
int32_t nsamples
Number of IQ samples.
-
hvl_t iq_data
Raw IQ data.
-
double timestamp
-
template<class ChannelModulator>
class ParallelChannelSynthesizer : public ChannelSynthesizer - #include <ParallelChannelSynthesizer.hh>
A single-channel synthesizer.
Public Functions
-
virtual ~ParallelChannelSynthesizer()
-
virtual void stop(void) override
Stop modulating.
-
virtual void reconfigure(void) override
Reconfigure for new TX parameters.
Protected Functions
-
void modWorker(unsigned tid)
Thread modulating packets.
Protected Attributes
-
unsigned nthreads_
Number of synthesizer threads.
-
std::atomic<bool> done_
Flag indicating if we should stop processing packets.
-
std::atomic<bool> reconfigure_
Flag that is true when we are reconfiguring.
-
std::mutex wake_mutex_
Mutex for waking demodulators.
-
std::condition_variable wake_cond_
Condition variable for waking demodulators.
-
std::vector<std::thread> mod_threads_
Threads running modWorker.
-
virtual ~ParallelChannelSynthesizer()
-
template<class T, class C>
class dragonradio::signal::Pfb - #include <Polyphase.hh>
A polyphase filter bank.
Subclassed by dragonradio::signal::Downsampler< T, C >, dragonradio::signal::RationalResampler< T, C >, dragonradio::signal::Upsampler< T, C >
Public Functions
-
inline Pfb(unsigned l, const std::vector<C> &taps)
Construct a polyphase filter bank.
- Parameters
l – The number of channels
taps – The taps for the prototype FIR filter, which should have unity gain.
-
Pfb() = delete
-
virtual ~Pfb() = default
-
inline unsigned getNumChannels(void) const
Get the number of channels.
-
inline void setNumChannels(unsigned l)
Set the number of channels.
Protected Functions
-
inline virtual void reconfigure(void)
Reconfigure filter bank for current number of channels and taps.
-
inline Pfb(unsigned l, const std::vector<C> &taps)
-
class PHY
- #include <PHY.hh>
A physical layer protocol that can provide a modulator and demodulator.
Subclassed by liquid::PHY, PyPHY
Public Functions
-
PHY() = default
-
virtual ~PHY() = default
-
virtual unsigned getMinRXRateOversample(void) const = 0
Return the minimum oversample rate (with respect to PHY bandwidth) needed for demodulation.
- Returns
The minimum RX oversample rate
-
virtual unsigned getMinTXRateOversample(void) const = 0
Return the minimum oversample rate (with respect to PHY bandwidth) needed for modulation.
- Returns
The minimum TX oversample rate
-
virtual std::shared_ptr<PacketModulator> mkPacketModulator(void) = 0
Create a Modulator for this PHY.
-
virtual std::shared_ptr<PacketDemodulator> mkPacketDemodulator(void) = 0
Create a Demodulator for this PHY.
Public Static Functions
-
static inline bool wantPacket(bool header_valid, const Header *h)
Return flag indicating whether or not we want the given packet.
We only demodulate packets destined for us unless we are collecting snapshots, in which case we demodulate everything so we can correctly record all known transmissions.
-
static inline std::shared_ptr<RadioPacket> mkRadioPacket(bool header_valid, bool payload_valid, const Header &h, size_t payload_len, unsigned char *payload_data)
Create a radio packet from a header and payload.
-
static inline void setTeam(uint8_t team)
Set this node’s ID.
-
static inline bool getLogInvalidHeaders()
Get whether or not invalid headers should be logged.
-
static inline void setLogInvalidHeaders(bool log)
Set whether or not invalid headers should be logged.
Set snapshot collector.
-
static inline void resetSnapshotCollector(void)
Reset snapshot collector.
-
PHY() = default
-
class liquid::PHY : public PHY
Subclassed by liquid::FlexFrame, liquid::NewFlexFrame, liquid::OFDM
Public Functions
-
PHY(const MCS &header_mcs, const std::vector<std::pair<MCS, AutoGain>> &mcs_table, bool soft_header, bool soft_payload)
-
virtual ~PHY() = default
-
PHY() = delete
-
inline bool getSoftHeader() const
Return flag indicating whether or not to use soft-decoding for headers.
-
inline bool getSoftPayload() const
Return flag indicating whether or not to use soft-decoding for payload.
Protected Functions
-
PHY(const MCS &header_mcs, const std::vector<std::pair<MCS, AutoGain>> &mcs_table, bool soft_header, bool soft_payload)
-
struct Ping
-
template<class T>
class Port<In, Pull, T> : public BasePort<In, Pull, T> - #include <Element.hh>
A pull input port.
Public Functions
-
Port() = delete
-
inline Port(Element &element, std::function<void(void)> connected, std::function<void(void)> disconnected)
-
inline virtual ~Port()
-
inline void kick(void)
Kick the port.
Connect the port to an upstream pull port.
-
inline void disconnect(void)
Disconnect the port from its upstream pull port.
-
Port() = delete
-
template<class T>
class Port<In, Push, T> : public BasePort<In, Push, T> - #include <Element.hh>
A push input port.
Public Functions
-
Port() = delete
-
inline Port(Element &element, std::function<void(void)> connected, std::function<void(void)> disconnected, std::function<void(T&&)> send)
-
virtual ~Port() = default
Friends
- friend class Port< Out, Push, T >
-
Port() = delete
-
template<class T>
class Port<Out, Pull, T> : public BasePort<Out, Pull, T> - #include <Element.hh>
A pull output port.
Public Functions
-
Port() = delete
-
inline Port(Element &element, std::function<void(void)> connected, std::function<void(void)> disconnected, std::function<bool(T&)> recv, std::function<void(void)> kick)
-
virtual ~Port() = default
-
inline void kick(void)
Kick the port.
Protected Attributes
-
std::function<void(void)> kick_
Called to kick.
Friends
- friend class Port< In, Pull, T >
-
Port() = delete
-
template<class T>
class Port<Out, Push, T> : public BasePort<Out, Push, T> - #include <Element.hh>
A push output port.
-
template<class D, class P, class T>
struct PortWrapper
-
template<class T>
class Processor : public Element - #include <Processor.hh>
Packet-processor.
Subclassed by Firewall< T, Set >, Noop< T >
Public Members
-
struct Pull
- #include <Element.hh>
Type tag for pull ports.
-
struct Push
- #include <Element.hh>
Type tag for push ports.
-
class PyArrayDecoder : public FLACMemoryDecoder
-
class PyArrayEncoder : public FLACMemoryEncoder
-
Public Members
-
py::array_t<char> encoded
-
py::array_t<char> encoded
-
class PyPacketDemodulator : public PHY::PacketDemodulator
Public Functions
-
inline virtual bool isFrameOpen(void) override
Is a frame currently being demodulated?
- Returns
true if a frame is currently being demodulated, false otherwise.
-
inline virtual void reset(const Channel &channel) override
Reset the internal state of the demodulator.
- Parameters
channel – The channel being demodulated.
-
inline virtual void timestamp(const MonoClock::time_point ×tamp, std::optional<ssize_t> snapshot_off, ssize_t offset, size_t delay, float rate, float rx_rate) override
Set timestamp for demodulation.
- Parameters
timestamp – The timestamp for future samples.
snapshot_off – The snapshot offset associated with the given timestamp.
offset – The offset of the first sample that will be demodulated. Can be negative!
delay – Filter delay
rate – The rate of the resampler applied before data is passed to the demodulator.
rx_rate – The RX rate (Hz).
-
inline virtual void demodulate(const std::complex<float> *data, size_t count) override
Demodulate IQ samples.
- Parameters
data – The IQ data to demodulate
count – The number of samples to demodulate
-
inline virtual bool isFrameOpen(void) override
-
class PyPacketModulator : public PHY::PacketModulator
-
class PyPHY : public PHY
Public Functions
-
inline virtual unsigned getMinRXRateOversample(void) const override
Return the minimum oversample rate (with respect to PHY bandwidth) needed for demodulation.
- Returns
The minimum RX oversample rate
-
inline virtual unsigned getMinTXRateOversample(void) const override
Return the minimum oversample rate (with respect to PHY bandwidth) needed for modulation.
- Returns
The minimum TX oversample rate
-
inline virtual size_t getModulatedSize(mcsidx_t mcsidx, size_t n) override
Calculate size of modulated data.
-
inline virtual std::shared_ptr<PacketModulator> mkPacketModulator(void) override
Create a Modulator for this PHY.
-
inline virtual std::shared_ptr<PacketDemodulator> mkPacketDemodulator(void) override
Create a Demodulator for this PHY.
-
PHY() = default
-
inline virtual unsigned getMinRXRateOversample(void) const override
-
template<class T>
class Queue : public Element - #include <Queue.hh>
A queue Element that has a separate high-priority queue that is always serviced first.
Subclassed by MandateQueue< T >, SimpleQueue< T >, SizedQueue< T >
Public Functions
-
inline Queue()
-
virtual ~Queue() = default
-
virtual void reset(void) = 0
Reset queue to empty state.
-
virtual void kick(void) = 0
Kick the queue.
-
virtual void stop(void) = 0
Stop processing queue elements.
-
inline virtual void setTransmissionDelay(double t)
Set transmission delay.
-
inline virtual double getTransmissionDelay(void) const
Get transmission delay.
Public Members
-
inline Queue()
-
class RadioNet
Public Types
Public Functions
-
RadioNet() = delete
-
~RadioNet() = default
-
inline std::shared_ptr<Node> getNode(NodeId node_id)
Get the entry for a particular node in the network.
-
inline void setNewNodeCallback(const new_node_callback_t &cb)
Set new node callback.
Private Members
-
new_node_callback_t new_node_callback_
New node callback.
-
std::mutex nodes_mutex_
Mutex protecting nodes in the network.
-
RadioNet() = delete
-
struct RadioPacket : public Packet
- #include <Packet.hh>
A packet received from the radio.
Public Functions
-
RadioPacket() = delete
Public Members
-
float evm
Error vector magnitude [dB].
-
float rssi
Received signal strength indicator [dB].
-
float cfo
Carrier frequency offset (f/Fs)
-
float bw
Bandwidth (Hz) of entire received signal.
-
MonoClock::time_point slot_timestamp
Timestamp of MAC slot containing this packet.
-
double demod_latency
Demodulation latency.
-
MonoClock::time_point tuntap_timestamp
Wall-clock time when packet was written to tun/tap.
-
size_t payload_len
Size of received payload, including controll information.
-
std::unique_ptr<std::vector<std::complex<float>>> symbols
Symbols.
-
RadioPacket() = delete
-
class RadioPacketQueue
- #include <RadioPacketQueue.hh>
A thread-safe queue of network packets. Handles barriers.
This is a specialized queue for RadioPackets that handles barrier packets. A barrier packet is a special packet that will not be removed from a queue seeing a barrier packet is like seeing the end of the queue. Barriers allow proper ordering: a producer can insert a barrier, insert packets before the barrier, then remove the barrier when it is done producing, thereby guaranteeing that packets inserted after the barrier will not be read from the queue until the barrier has been removed.
Public Types
-
using entry = std::variant<std::monostate, std::shared_ptr<RadioPacket>>
A queue entry.
Public Functions
-
RadioPacketQueue()
-
~RadioPacketQueue()
-
RadioPacketQueue(const RadioPacketQueue&) = delete
-
RadioPacketQueue(RadioPacketQueue&&) = delete
-
RadioPacketQueue &operator=(const RadioPacketQueue&) = delete
-
RadioPacketQueue &operator=(RadioPacketQueue&&) = delete
Add a RadioPacket to the queue.
- Parameters
pkt – The packet to push onto the queue.
Add a RadioPacket to the queue before a barrier.
- Parameters
b – The barrier.
pkt – The packet to push onto the queue.
Get a RadioPacket from the queue.
- Parameters
pkt – The popped packet.
- Returns
Return true if pop was successful, false otherwise.
-
void stop(void)
Stop processing this queue.
-
using entry = std::variant<std::monostate, std::shared_ptr<RadioPacket>>
-
class RaiseCaps
-
template<class T, class C>
class dragonradio::signal::RationalResampler : public dragonradio::signal::Pfb<T, C>, public Resampler<T, T> - #include <Polyphase.hh>
A rational resampler that uses a polyphase filter bank.
Subclassed by dragonradio::signal::MixingRationalResampler< T, C >
Public Functions
-
inline RationalResampler(unsigned l, unsigned m, const std::vector<C> &taps)
Construct a polyphase rational resampler.
- Parameters
l – The upsampling rate
m – The downsampling rate
taps – The taps for the prototype FIR filter
-
inline RationalResampler(double r, const std::vector<C> &taps = {1.0})
Construct a polyphase rational resampler.
- Parameters
r – The resampler rate
taps – The taps for the prototype FIR filter
-
RationalResampler() = delete
-
virtual ~RationalResampler() = default
-
inline virtual double getRate(void) const override
-
inline unsigned getUpRate(void) const
-
inline unsigned getDownRate(void) const
-
inline void setRate(unsigned l, unsigned m)
-
inline void setRate(double rate)
-
inline virtual double getDelay(void) const override
-
inline virtual size_t neededOut(size_t count) const override
-
inline virtual void reset(void) override
Protected Functions
-
inline virtual void reconfigure(void) override
Reconfigure filter bank for current number of channels and taps.
-
inline RationalResampler(unsigned l, unsigned m, const std::vector<C> &taps)
-
struct ControlMsg::ReceiverStats
-
class ReceiveWindowProxy
- #include <proxies.hh>
A proxy object for a SmartController receive window.
Public Functions
-
inline std::optional<double> getShortEVM(void)
-
inline std::optional<double> getLongEVM(void)
-
inline std::optional<double> getShortRSSI(void)
-
inline std::optional<double> getLongRSSI(void)
Private Members
-
std::shared_ptr<SmartController> controller_
This send window’s SmartController.
-
inline std::optional<double> getShortEVM(void)
-
class ReceiveWindowsProxy
- #include <proxies.hh>
A proxy object for SmartController’s receive windows.
Public Functions
-
ReceiveWindowsProxy() = delete
-
~ReceiveWindowsProxy() = default
-
inline ReceiveWindowProxy operator[](NodeId node)
Private Members
-
std::shared_ptr<SmartController> controller_
This object’s SmartController.
-
ReceiveWindowsProxy() = delete
-
struct RecvWindow : public TimerQueue::Timer
-
Public Functions
-
RecvWindow(Node &n, SmartController &controller, Seq::uint_type win, size_t nak_win)
-
virtual void operator()() override
Public Members
-
SmartController &controller
Our controller.
-
std::mutex mutex
Mutex for the receive window.
-
TimeWindowMean<MonoClock, float> short_evm
Short-term packet EVM.
-
TimeWindowMean<MonoClock, float> long_evm
Long-term packet EVM.
-
TimeWindowMean<MonoClock, float> short_rssi
Short-term packet RSSI.
-
TimeWindowMean<MonoClock, float> long_rssi
Long-term packet RSSI.
-
bool active
True when this is an active window that has received a packet.
-
Seq ack
Next sequence number we should ACK.
We have received (or given up) on all packets with sequence numbers < this number. INVARIANT: The smallest sequence number in our receive window must be STRICTLY > ack because we have already received the packet with sequence number ack - 1, and if we received the packet with sequence number ack, we should have updated ack to ack + 1.
-
Seq max
Maximum sequence number we have received.
INVARIANT: ack <= max < ack + win. When max == ack, we have no holes in our receive window, which should therefore be empty.
-
MonoClock::time_point max_timestamp
Timestamp of packet with the maximum sequence number we have sent.
-
bool need_selective_ack
Flag indicating whether or not we need a selective ACK.
-
bool timer_for_ack
Flag indicating whether or not the timer is for an ACK or a selective ACK.
-
std::vector<MonoClock::time_point> explicit_nak_win
Explicit NAK window.
-
size_t explicit_nak_idx
Explicit NAK window index.
Private Members
-
vector_type entries_
All packets with sequence numbers N such that ack <= N <= max < ack + win.
-
RecvWindow(Node &n, SmartController &controller, Seq::uint_type win, size_t nak_win)
-
template<class T>
class REDQueue : public SizedQueue<T> - #include <REDQueue.hh>
An Adaptive RED queue.
See the paper Random Early Detection Gateways for Congestion Avoidance
Public Functions
-
inline REDQueue(bool gentle, size_t min_thresh, size_t max_thresh, double max_p, double w_q)
-
REDQueue() = delete
-
inline virtual ~REDQueue()
-
inline bool getGentle(void) const
Get flag indicating whether or not to be gentle.
-
inline void setGentle(bool gentle)
Set flag indicating whether or not to be gentle.
-
inline size_t getMinThresh(void) const
Get minimum threshold.
-
inline void setMinThresh(size_t min_thresh)
Set minimum threshold.
-
inline size_t getMaxThresh(void) const
Get maximum threshold.
-
inline void setMaxThresh(size_t max_thresh)
Set maximum threshold.
-
inline double getMaxP(void) const
Get maximum drop probability.
-
inline void setMaxP(double max_p)
Set maximum drop probability.
-
inline double getQueueWeight(void) const
Get queue qeight.
-
inline void setQueueWeight(double w_q)
Set queue qeight.
-
inline virtual void reset(void) override
Reset queue to empty state.
Protected Attributes
-
bool gentle_
Gentle flag.
-
size_t min_thresh_
Minimum threshold.
-
size_t max_thresh_
Maximum threshold.
-
double max_p_
Maximum drop probability.
-
int count_
Packets since last marked packet.
-
double avg_
Average size of queue (bytes).
-
std::mt19937 gen_
Random number generator.
-
std::uniform_real_distribution<double> dist_
Uniform 0-1 real distribution.
-
inline REDQueue(bool gentle, size_t min_thresh, size_t max_thresh, double max_p, double w_q)
-
template<class I, class O>
class Resampler Subclassed by liquid::MultiStageResampler< I, O, C >
-
template<>
class Resampler<C, C> Subclassed by liquid::MultiStageResampler< C, C, F >, dragonradio::signal::RationalResampler< C, C >
-
template<typename T, class Container = std::deque<T>>
class SafeQueue - #include <SafeQueue.hh>
A thread-safe queue.
A SafeQueue is a thread-safe FIFO queue. Any call to pop will block until an element is inserted until the queue is stopped by a call to stop. Once stop has been invoked, elements can still be inserted, but any call to pop will immediately return.
Public Types
-
using iterator = typename container_type::iterator
-
using const_iterator = typename container_type::const_iterator
Public Functions
-
inline SafeQueue()
-
inline ~SafeQueue()
-
inline size_t size(void)
Get queue size.
-
inline void clear(void)
Clear queue contents.
-
inline bool empty(void) const
Return true if the queue is empty.
-
template<class ...Args>
inline void emplace(Args&&... args) Construct an element in-place on the end of the queue.
-
inline bool pop(T &val)
Access the first element of the queue and pop it.
- Parameters
val – Reference to location where popped value should be copied.
- Returns
true if a value was popped, false otherwise.
-
inline bool try_pop(T &val)
Access the first element of the queue and pop it without waiting.
- Parameters
val – Reference to location where popped value should be copied.
- Returns
true if a value was popped, false otherwise.
-
inline void stop(void)
Mark the queue as stopped.
Private Members
-
bool done_
Flag indicating that processing of the queue should stop.
-
mutable std::mutex m_
Mutex protecting the queue.
-
std::condition_variable cond_
Condition variable protecting the queue.
-
container_type q_
The queue itself.
-
using iterator = typename container_type::iterator
-
class Schedule
- #include <Schedule.hh>
A schedule specifying the channels on which a node may transmit in a given slot.
Public Functions
-
Schedule() = default
-
inline Schedule &operator=(const sched_type &schedule)
-
inline sched_type::size_type size(void) const
-
inline sched_type::const_reference operator[](slot_type::size_type i) const
-
inline bool canTransmitInSlot(size_t slot) const
Return true if we can transmit in given slot.
-
inline bool canTransmitOnChannel(size_t chan) const
Return true if we can transmit on given channel (in any slot)
-
inline bool firstChannelIdx(size_t slot, size_t &chan_) const
Find the first channel index in which we can transmit in the given slot.
Private Members
-
sched_type schedule_
The slot schedule.
-
Schedule() = default
-
struct Score
- #include <Scorer.hh>
Scoring a single measurement period.
Public Functions
-
inline Score()
Public Members
-
size_t npackets_sent
Number of packets sent.
-
size_t nbytes_sent
Number of bytes sent.
-
double update_timestamp_sent
Timestamp of last update for sent statistics.
-
size_t npackets_recv
Number of packets received.
-
size_t nbytes_recv
Number of bytes received.
-
double update_timestamp_recv
Timestamp of last update for receive statistics.
-
bool goal
True if goal met in MP.
-
bool goal_stable
True if goal stable in MP.
-
unsigned achieved_duration
Number of consecutive MP’s in which goal has been met.
-
inline Score()
-
class Scorer
Public Functions
-
Scorer()
-
virtual ~Scorer()
-
inline MandateMap getMandates(void)
Get mandates.
-
void setMandates(const MandateMap &mandates)
Set mandates.
-
void updateSentStatistics(FlowUID flow, double timestamp, unsigned first_mp, std::vector<size_t> npackets, std::vector<size_t> nbytes)
-
void updateReceivedStatistics(FlowUID flow, double timestamp, unsigned first_mp, std::vector<size_t> npackets, std::vector<size_t> nbytes)
-
void updateScore(unsigned final_mp)
-
Scorer()
-
struct Scores : public std::vector<Score>
Public Functions
-
inline Scores()
Public Members
-
unsigned invalid_mp
First invalid MP.
MP’s from this MP on have been invalidated and need to be scored
-
inline Scores()
-
struct ControlMsg::SelectiveAck
-
struct SelfTX
- #include <Snapshot.hh>
A self transmission event within a snapshot.
-
struct SelfTXEntry
Log entry for self-transmission events.
Public Members
-
double timestamp
Timestamp of snapshot this self-transmission belongs to.
-
double mono_timestamp
Monotonic clock timestamp.
-
uint8_t is_local
Is this TX local, i.e., produced by this node?
-
int32_t start
Offset of start of packet.
-
int32_t end
Offset of end of packet.
-
float fc
Center frequency [Hz].
-
float fs
Sampling frequency [Hz].
-
double timestamp
-
struct SendWindow
-
Public Functions
-
SendWindow(Node &n, SmartController &controller, Seq::uint_type maxwin, double retransmission_delay_)
-
void setSendWindowStatus(bool open)
Set send window status.
-
void ack(const MonoClock::time_point &tx_time)
Record a packet ACK.
-
void txSuccess(void)
Update PER as a result of successful packet transmission.
-
void txFailure(void)
Update PER as a result of unsuccessful packet transmission.
-
void resetPEREstimates(void)
Reconfigure a node’s PER estimates.
Public Members
-
SmartController &controller
Our controller.
-
std::mutex mutex
Mutex for the send window.
-
size_t mcsidx
Modulation index.
-
std::optional<float> short_evm
Short-term EVM, as reported by receiver.
-
std::optional<float> long_evm
Long-term EVM, as reported by receiver.
-
std::optional<float> short_rssi
Short-term RSSI, as reported by receiver.
-
std::optional<float> long_rssi
Long-term RSSI, as reported by receiver.
-
bool new_window
Is this a new window?
-
bool window_open
Is the window open?
-
bool send_set_unack
Do we need to send a set unack control message?
-
Seq per_cutoff
First sequence that can possibly be used to calculate PER.
The packet with this sequence number is the first that can possibly be used to calculate PER. We use this when the environment has changed and previously-sent packets should not be used to calculate PER in the new environment.
-
Seq per_end
End of the current PER window PER.
Every packet up to, but not including, this sequence number has already been used to calculate the current PER
-
double prev_short_per
Previous short-term packet error rate.
-
double prev_long_per
Previous long-term packet error rate.
-
WindowedMean<double> short_per
Short-term packet error rate.
-
WindowedMean<double> long_per
Long-term packet error rate.
-
double retransmission_delay
Duration of retransmission timer.
-
TimeWindowMax<MonoClock, double> ack_delay
ACK delay estimator.
Private Members
-
vector_type entries_
Unacknowledged packets in our send window.
INVARIANT: unack <= N <= max < unack + win
-
SendWindow(Node &n, SmartController &controller, Seq::uint_type maxwin, double retransmission_delay_)
-
class SendWindowProxy
- #include <proxies.hh>
A proxy object for a SmartController send window.
Public Functions
-
inline std::optional<double> getShortPER(void)
-
inline std::optional<double> getLongPER(void)
-
inline std::optional<double> getShortEVM(void)
-
inline std::optional<double> getLongEVM(void)
-
inline std::optional<double> getShortRSSI(void)
-
inline std::optional<double> getLongRSSI(void)
Private Members
-
std::shared_ptr<SmartController> controller_
This send window’s SmartController.
-
inline std::optional<double> getShortPER(void)
-
class SendWindowsProxy
- #include <proxies.hh>
A proxy object for SmartController’s send windows.
Public Functions
-
SendWindowsProxy() = delete
-
~SendWindowsProxy() = default
-
inline SendWindowProxy operator[](NodeId node)
Private Members
-
std::shared_ptr<SmartController> controller_
This object’s SmartController.
-
SendWindowsProxy() = delete
-
struct ControlMsg::SetUnack
-
template<class T>
class SimpleQueue : public Queue<T> - #include <SimpleQueue.hh>
A simple queue Element.
Public Types
Public Functions
-
SimpleQueue() = delete
-
inline virtual ~SimpleQueue()
-
inline virtual void reset(void) override
Reset queue to empty state.
-
inline virtual void kick(void) override
Kick the queue.
-
inline virtual void stop(void) override
Stop processing queue elements.
-
SimpleQueue() = delete
-
template<int INTBITS>
class sintab Public Types
-
using brad_t = uint32_t
A binary radian.
A binary radian (brad) is a fractional value, where 1 brad is 2 pi radians.
Public Static Functions
Public Static Attributes
-
static constexpr int FRACBITS = BRADBITS - INTBITS
Number of bits used to represent fractional part of table index.
-
static constexpr brad_t ONE = static_cast<brad_t>(1) << sintab::FRACBITS
Number of brad’s per table entry.
-
using brad_t = uint32_t
-
template<class T>
class SizedQueue : public Queue<T> - #include <SizedQueue.hh>
A queue that tracks its size.
Subclassed by REDQueue< T >, TailDropQueue< T >
Public Functions
-
inline SizedQueue()
-
inline virtual ~SizedQueue()
-
inline std::set<FlowUID> getHiPriorityFlows(void) const
Get flag indicating whether or not to be gentle.
-
inline void setHiPriorityFlows(const std::set<FlowUID> &flows)
Set flag indicating whether or not to be gentle.
-
inline virtual void reset(void) override
Reset queue to empty state.
-
inline virtual void kick(void) override
Kick the queue.
-
inline virtual void stop(void) override
Stop processing queue elements.
Protected Functions
-
inline bool pop_queue(std::list<T> &q, const MonoClock::time_point &now, T &val)
Attempt to pop packet from given queue.
Indicate that a packet has been dropped.
Protected Attributes
-
bool done_
Flag indicating that processing of the queue should stop.
-
std::atomic<bool> kicked_
Is the queue being kicked?
-
size_t size_
Size of queue (bytes).
-
mutable std::mutex m_
Mutex protecting the queues.
-
std::condition_variable cond_
Condition variable protecting the queue.
-
inline SizedQueue()
-
struct FDChannelizer::Slot
A demodulation slot.
Public Members
-
ssize_t fd_offset
Offset of frequency-domain samples from time-domain samples (in samples)
This is used to account for the fact that the frequency-domain buffer may hold some samples from the previous slot’s time-domain buffer that didn’t fit in a full size N FFT.
-
ssize_t fd_offset
-
struct SlotSynthesizer::Slot
- #include <SlotSynthesizer.hh>
A time slot that needs to be synthesized.
Public Functions
-
inline Slot(const WallClock::time_point &deadline_, size_t deadline_delay_, size_t max_samples_, size_t full_slot_samples_, size_t slotidx_, size_t nchannels)
-
Slot() = delete
-
~Slot() = default
-
inline size_t length(void)
The length of the slot, in samples.
Return the length of the slot, in samples. This does not include delayed samples.
-
inline bool push(std::unique_ptr<ModPacket> &mpkt, bool overfill)
Push a modulated packet onto the slot.
- Parameters
mpkt – A reference to a modulated packet
overfill – true if the slot can be overfilled
- Returns
true if the packet was pushed, false if it didn’t fit The slot’s mutex must be held by the caller. If pushed, the slot takes ownership of the ModPacket.
Public Members
-
const WallClock::time_point deadline
Synthesis deadline. Slot must be ready at this time!
-
const size_t deadline_delay
Number of samples to delay the deadline.
-
const size_t full_slot_samples
Number of samples in a full slot including any guard.
-
const size_t slotidx
The schedule slot this slot represents.
-
std::atomic<bool> closed
When true, indicates that the slot is closed for further samples.
-
std::mutex mutex
Mutex protecting slot info.
-
size_t max_samples
Maximum number of samples in this slot.
-
size_t delay
Number of samples to delay.
-
size_t nsamples
Number of samples in slot.
-
std::atomic<unsigned> nfinished
Number of threads who have finished with this slot.
-
size_t fdnsamples
Number of valid samples in the frequency-domain buffer.
-
size_t npartial
Number of samples represented by final FFT block that were part of the slot.
-
inline Slot(const WallClock::time_point &deadline_, size_t deadline_delay_, size_t max_samples_, size_t full_slot_samples_, size_t slotidx_, size_t nchannels)
-
struct SlotEntry
Log entry for slots.
-
class SlotSynthesizer : public Synthesizer
- #include <SlotSynthesizer.hh>
Base class for synthesizers.
Subclassed by MultichannelSynthesizer, UnichannelSynthesizer< ChannelModulator >
Public Functions
-
virtual ~SlotSynthesizer() = default
-
inline bool getSuperslots(void) const
Get superslots flag.
-
inline void setSuperslots(bool superslots)
Set superslots flag.
Modulate a slot.
Protected Attributes
-
std::atomic<bool> superslots_
Use superslots.
-
virtual ~SlotSynthesizer() = default
-
class SlottedALOHA : public SlottedMAC
- #include <SlottedALOHA.hh>
A Slotted ALOHA MAC.
Public Functions
-
virtual ~SlottedALOHA()
-
SlottedALOHA(const SlottedALOHA&) = delete
-
SlottedALOHA(SlottedALOHA&&) = delete
-
SlottedALOHA &operator=(const SlottedALOHA&) = delete
-
SlottedALOHA &operator=(SlottedALOHA&&) = delete
-
inline size_t getSlotIndex(void) const
Get slot index to transmit on.
-
inline void setSlotIndex(size_t slotidx)
Set slot to transmit on.
-
inline double getTXProb(void) const
Get probability of transmission.
-
inline void setTXProb(double p)
Set probability of transmission.
- Parameters
p – The probability of transmitting in a given slot
-
virtual void stop(void) override
Stop processing packets.
Private Functions
-
void txSlotWorker(void)
Worker preparing slots for transmission.
Private Members
-
size_t slotidx_
Slot index to use.
-
double p_
Probability of transmission.
-
std::mt19937 gen_
Random number generator.
-
std::uniform_real_distribution<double> dist_
Uniform 0-1 real distribution.
-
std::exponential_distribution<double> arrival_dist_
Exponential distribution for inter-arrival times.
-
std::thread rx_thread_
Thread running rxWorker.
-
std::thread tx_thread_
Thread running txWorker.
-
std::thread tx_slot_thread_
Thread running txSlotWorker.
-
std::thread tx_notifier_thread_
Thread running txNotifier.
-
virtual ~SlottedALOHA()
-
class SlottedMAC : public MAC
- #include <SlottedMAC.hh>
A slotted MAC.
Subclassed by SlottedALOHA, TDMA
Public Types
-
using Slot = SlotSynthesizer::Slot
Public Functions
-
virtual ~SlottedMAC()
-
SlottedMAC(const SlottedMAC&) = delete
-
SlottedMAC(SlottedMAC&&) = delete
-
SlottedMAC &operator=(const SlottedMAC&) = delete
-
SlottedMAC &operator=(SlottedMAC&&) = delete
-
inline virtual double getSlotSize(void)
Get slot size, including guard interval.
-
inline virtual void setSlotSize(double t)
Set slot size, including guard interval.
- Parameters
t – Slot size in seconds
-
inline virtual double getGuardSize(void)
Get guard interval size.
-
inline virtual void setGuardSize(double t)
Set guard interval size.
- Parameters
t – Guard interval size in seconds
-
inline virtual size_t getSlotSendLeadTime(void)
-
inline virtual void setSlotSendLeadTime(size_t t)
-
virtual void stop(void) override
Stop processing packets.
Protected Functions
-
void txWorker(void)
Worker transmitting slots.
-
void modulateSlot(slot_queue &q, WallClock::time_point when, size_t prev_overfill, size_t slotidx)
Schedule modulation of a slot.
- Parameters
q – The slot queue
when – Start time of slot
prev_overfill – Number of overfill samples from previous slot.
slotidx – Index of the slot to modulated
-
std::shared_ptr<Slot> finalizeSlot(slot_queue &q, WallClock::time_point when)
Finalize the next TX slot.
- Parameters
q – The slot queue
when – Start time of slot
- Returns
The slot After finalizeSlot returns, the caller has exclusive access to the slot. That is, it does not need to acquire the slot’s lock to modify it, because it is guaranteed exclusive access.
Transmit a slot.
- Parameters
slot – The slot
-
void missedRemainingSlots(slot_queue &q)
Mark all remaining slots in qeueue as missed.
- Parameters
q – The slot queue
Protected Attributes
-
std::shared_ptr<SlotSynthesizer> slot_synthesizer_
Our slot synthesizer.
-
double guard_size_
Length of inter-slot guard (sec)
-
double slot_send_lead_time_
Lead time needed to send a slot’s worth of data.
-
size_t tx_slot_samps_
Number of TX samples in the non-guard portion of a slot.
-
size_t tx_full_slot_samps_
Number of TX samples in the entire slot, including the guard.
-
std::atomic<bool> stop_burst_
Do we need to stop the current burst?
-
using Slot = SlotSynthesizer::Slot
-
class SmartController : public Controller
- #include <SmartController.hh>
A MAC controller that implements ARQ.
Public Types
-
using evm_thresh_t = std::optional<double>
Public Functions
-
virtual ~SmartController()
-
inline double getShortPERWindow(void)
Get short time window over which to calculate PER (sec)
-
inline void setShortPERWindow(double window)
Set short time window over which to calculate PER (sec)
-
inline double getLongPERWindow(void)
Get long time window over which to calculate PER (sec)
-
inline void setLongPERWindow(double window)
Set long time window over which to calculate PER (sec)
-
inline double getShortStatsWindow(void)
Get time window for statistics collection (sec)
-
inline void setShortStatsWindow(double window)
Set time window for statistics collection (sec)
-
inline double getLongStatsWindow(void)
Get time window for statistics collection (sec)
-
inline void setLongStatsWindow(double window)
Set time window for statistics collection (sec)
-
inline double getUpPERThreshold(void)
Get PER threshold for increasing modulation level.
-
inline void setUpPERThreshold(double thresh)
Set PER threshold for increasing modulation level.
-
inline double getDownPERThreshold(void)
Get PER threshold for decreasing modulation level.
-
inline void setDownPERThreshold(double thresh)
Set PER threshold for decreasing modulation level.
-
void environmentDiscontinuity(void)
Inform the controller that an environmental discontinuity has occurred.
-
inline double getACKDelay(void)
Get ACK delay.
-
inline void setACKDelay(double t)
Set ACK delay.
-
inline double getACKDelayEstimationWindow(void) const
Get ACK delay estimation window (sec).
-
inline void setACKDelayEstimationWindow(double t)
Set ACK delay estimation window (sec).
-
inline double getRetransmissionDelay(void)
Get retransmission delay.
-
inline void setRetransmissionDelay(double t)
Set retransmission delay.
-
inline double getMinRetransmissionDelay(void)
Get minimum retransmission delay.
-
inline void setMinRetransmissionDelay(double t)
Set minimum retransmission delay.
-
inline double getRetransmissionDelaySlop(void)
Get retransmission delay safety factor.
-
inline void setRetransmissionDelaySlop(double k)
Set retransmission delay safety factor.
-
inline double getSACKDelay(void)
Get SACK delay.
-
inline void setSACKDelay(double t)
Set SACK delay.
-
inline std::optional<size_t> getMaxSACKs(void) const
Get maximum number of SACKs in a packet.
-
inline void setMaxSACKs(std::optional<size_t> max_sacks)
Set maximum number of SACKs in a packet.
-
inline bool getExplicitNAKWindow(void)
Return explicit NAK window size.
-
inline void setExplicitNAKWindow(size_t n)
Set explicit NAK window size.
-
inline double getExplicitNAKWindowDuration(void)
Return explicit NAK window duration.
-
inline void setExplicitNAKWindowDuration(double t)
Set explicit NAK window duration.
-
inline bool getSelectiveACK(void)
Return whether or not we should send selective ACKs.
-
inline void setSelectiveACK(bool ack)
Set whether or not we should send selective ACKs.
-
inline double getSelectiveACKFeedbackDelay(void)
Return selective ACK feedback delay.
-
inline void setSelectiveACKFeedbackDelay(double delay)
Set selective ACK feedback delay.
-
inline std::optional<size_t> getMaxRetransmissions(void)
Return maximum number of retransmission attempts.
-
inline void setMaxRetransmissions(std::optional<size_t> max_retransmissions)
Set maximum number of retransmission attempts.
-
inline bool getDemodAlwaysOrdered(void)
Return flag indicating whether or not packets are always demodulated in order.
-
inline void setDemodAlwaysOrdered(bool always_ordered)
Set flag indicating whether or not packets are always demodulated in order.
-
inline bool getEnforceOrdering(void)
Return flag indicating whether or not demodulation queue enforces packet order.
-
inline void setEnforceOrdering(bool enforce)
Set whether or not demodulation queue enforces packet order.
-
inline size_t getMCU(void)
Get maximum number of extra control bytes beyond MTU.
-
inline void setMCU(size_t mcu)
Set maximum number of extra control bytes beyond MTU.
-
inline bool getMoveAlong(void)
Get whether or not we always move the send windwo along.
-
inline void setMoveAlong(bool move_along)
Set whether or not to always move the send windwo along.
-
inline bool getDecreaseRetransMCSIdx(void)
Get whether or not we decrease the MCS index of retransmitted packets with a deadline.
-
inline void setDecreaseRetransMCSIdx(bool decrease_retrans_mcsidx)
Set whether or not we decrease the MCS index of retransmitted packets with a deadline.
Pull a packet from the network to be sent next over the radio.
This function is automatically called when a packet is requested from the net_out port.
Process demodulated packets.
This function is automatically called to process packets received on on the radio_in port.
-
virtual void transmitted(std::list<std::unique_ptr<ModPacket>> &mpkts) override
Notify controller of transmitted packets.
-
void retransmitOnTimeout(SendWindow::Entry &entry)
Retransmit a send window entry on timeout.
-
void ack(RecvWindow &recvw)
Send an ACK to the given receiver.
The caller MUST hold the lock on recvw.
-
void nak(RecvWindow &recvw, Seq seq)
Send a NAK to the given receiver.
-
void broadcastHello(void)
Broadcast a HELLO packet.
Protected Functions
-
void retransmitOrDrop(SendWindow::Entry &entry)
Re-transmit or drop a send window entry.
-
void retransmit(SendWindow::Entry &entry)
Re-transmit a send window entry.
NOTE: The lock on the send window to which entry belongs MUST be held before calling retransmit.
-
void drop(SendWindow::Entry &entry)
Drop a send window entry.
-
void advanceSendWindow(SendWindow &sendw)
Advance the send window.
- Parameters
sendw – The send window to advance
-
void advanceRecvWindow(Seq seq, RecvWindow &recv)
Advance the receive window.
- Parameters
seq – The sequence number received
recv – The receive window to advance
-
void startRetransmissionTimer(SendWindow::Entry &entry)
Start the re-transmission timer if it is not set.
-
void startSACKTimer(RecvWindow &recvw)
Start the selective ACK timer if it is not set.
-
void handleCtrlHelloAndPing(RadioPacket &pkt, Node &node)
Handle HELLO and ping control messages.
-
void handleCtrlTimestamp(RadioPacket &pkt, Node &node)
Handle timestamp control messages.
Append control messages for feedback to sender.
This method appends feedback to the receiver in the form of both statistics and selective ACKs .
-
void handleReceiverStats(RadioPacket &pkt, SendWindow &sendw)
Handle receiver statistics.
-
void handleACK(SendWindow &sendw, const Seq &seq)
Handle an ACK.
-
std::optional<Seq> handleNAK(RadioPacket &pkt, SendWindow &sendw)
Handle a NAK.
- Parameters
sendw – The sender’s window
pkt – The packet potentially containing NAK’s
- Returns
The NAK with the highest sequence number, if there is a NAK
Handle select ACK messages.
-
void handleSetUnack(RadioPacket &pkt, RecvWindow &recvw)
Handle sender setting unack.
Get a packet that is elligible to be sent.
-
SendWindow &getSendWindow(NodeId node_id)
Get a node’s send window.
-
RecvWindow &getReceiveWindow(NodeId node_id)
Get a node’s receive window.
- Parameters
node_id – The node whose window to get
- Returns
The receive window
Protected Attributes
-
std::mutex net_mutex_
Mutex to serialize access to the network.
-
double slot_size_
Slot size (sec)
-
std::optional<MonoClock::time_point> env_timestamp_
Latest environment discontinuity.
-
std::mutex send_mutex_
Mutex for the send windows.
-
std::map<NodeId, SendWindow> send_
Send windows.
-
std::mutex recv_mutex_
Mutex for the receive windows.
-
std::map<NodeId, RecvWindow> recv_
Receive windows.
-
TimerQueue timer_queue_
Timer queue.
-
std::vector<evm_thresh_t> evm_thresholds_
EVM thresholds.
-
double mcsidx_up_per_threshold_
PER threshold for increasing modulation level.
-
double mcsidx_down_per_threshold_
PER threshold for decreasing modulation level.
-
double ack_delay_
ACK delay in seconds.
-
double ack_delay_estimation_window_
ACK delay estimation window (sec)
-
double min_retransmission_delay_
Minimum packet re-transmission delay in seconds.
-
double retransmission_delay_slop_
Safety factor for retransmission timer estimator.
-
double sack_delay_
SACK delay (sec)
Amount of time we wait for a regular packet to have a SACK attached.
-
std::optional<size_t> max_sacks_
Maximum number of SACKs in a packet.
-
size_t explicit_nak_win_
Explicit NAK window.
-
double explicit_nak_win_duration_
Explicit NAK window duration.
-
bool selective_ack_
Should we send selective ACK packets?
-
double selective_ack_feedback_delay_
Amount of time we wait to accept selective ACK feedback about a packet.
-
std::optional<size_t> max_retransmissions_
Maximum number of retransmission attempts.
-
bool demod_always_ordered_
Are packets always demodulated in order?
-
bool enforce_ordering_
Should packets always be output in the order they were actually received?
-
size_t mcu_
Maximum extra control bytes, in contrast to MTU.
-
bool move_along_
Always move the send window along, even if it’s full.
-
std::atomic<TimestampSeq> timestamp_seq_
Current timestamp sequence number.
-
std::mutex gen_mutex_
Mutex for random number generator.
-
std::mt19937 gen_
Random number generator.
-
std::uniform_real_distribution<double> dist_
Uniform 0-1 real distribution.
Friends
- friend struct SendWindow
- friend struct RecvWindow
- friend class SendWindowsProxy
- friend class SendWindowProxy
- friend class ReceiveWindowsProxy
- friend class ReceiveWindowProxy
-
using evm_thresh_t = std::optional<double>
-
struct Snapshot
- #include <Snapshot.hh>
A snapshot of received spectrum.
Public Functions
-
class SnapshotCollector
- #include <Snapshot.hh>
A snapshot collector.
Public Functions
-
SnapshotCollector()
-
virtual ~SnapshotCollector() = default
-
void start(void)
Start snapshot collection.
-
void stop(void)
Stop snapshot collection.
-
std::shared_ptr<Snapshot> finalize(void)
Finalize snapshot collection.
Snapshot collection should be stopped before finalize is called. Waiting for a small amount of time between stopping snapshot collection and finalizing a snapshot allows pending packets demodulation to finish, which provides more complete information about self-transmissions during the snapshot.
Add IQ buffer to the snapshot.
- Returns
true if snapshots are being collected The IQ buffer should not yet have been filled with received data. This will initialize the snapshot_off field of the IQ buffer.
-
void finalizePush(void)
Finalize a snapshotted IQ buffer.
Call this after the IQ buffer has been filled. This will update the snapshot offset counter.
-
void selfTX(ssize_t start, ssize_t end, float fc, float fs)
Add a self-transmission event based on a received packet.
- Parameters
start – Sample offset of start of self-transmission
end – Sample offset of end of self-transmission
fc – Center frequency of self-transmission
fs – Bandwidth of self-transmission
-
void selfTX(MonoClock::time_point when, float fs_rx, float fs_tx, float fs_chan, unsigned nsamples, float fc)
Add a local self-transmission event (we transmitted something)
- Parameters
when – Timestamp of start of self-transmission
fs_rx – RX sampling rate
fs_tx – TX sampling rate
fs_chan – TX channel sampling rate
nsamples – Number of samples of self-transmission
fc – Center frequency of self-transmission
-
inline bool active(void)
Return true if a snapshot is being collected.
Protected Functions
-
void newSnapshot(void)
Start a new snapshot.
-
void fixSnapshotTimestamps(void)
Fix timestamps in current snapshot.
Protected Attributes
-
std::mutex mutex_
Mutex protecting access to the snapshot.
-
bool snapshot_collect_
Should we collect new slots?
-
size_t snapshot_off_
Current offset from the beginning of the first collected slot.
-
MonoClock::time_point last_local_tx_start_
Timestamp of ast local TX.
-
float last_local_tx_fs_rx_
RX sampling frequency during last local TX
-
SnapshotCollector()
-
struct SnapshotEntry
Log entry for snapshots.
-
class Socket
Public Functions
-
inline Socket()
-
inline explicit Socket(int fd)
-
inline Socket(int domain, int type, int protocol)
-
inline ~Socket()
-
inline operator int()
Protected Attributes
-
int fd_
-
inline Socket()
-
struct MandateQueue::SubQueue : public TimerQueue::Timer
Public Types
-
using container_type = std::deque<T>
Public Functions
-
SubQueue() = delete
-
inline SubQueue(MandateQueue<T> &mqueue_, const Priority &priority_, QueueType qtype_)
-
inline SubQueue(MandateQueue<T> &mqueue_, const Priority &priority_, QueueType qtype_, const Mandate &mandate_)
-
inline virtual ~SubQueue()
-
inline virtual void operator()() override
-
inline void activate(void)
Activate the queue.
INVARIANT: The MandateQueue lock must be held before calling this method
-
inline void deactivate(void)
Deactivate the queue.
INVARIANT: The MandateQueue lock must be held before calling this method
-
inline bool isThroughput() const
Return true if this queue handles a throughput mandate flow.
-
inline bool isFileTransfer() const
Return true if this queue handles a file transfer mandate flow.
-
inline void updateRate(double rate_)
-
inline void updatePriority(void)
-
inline void fillBucket(const MonoClock::time_point &now)
-
inline void setFillBucketTimer(void)
-
inline bool pop(T &pkt, MandateQueue<T> &mqueue, const MonoClock::time_point &now, bool bonus)
-
inline container_type::iterator begin(void)
-
inline container_type::iterator end(void)
-
inline container_type::reverse_iterator rbegin(void)
-
inline container_type::reverse_iterator rend(void)
-
inline container_type::iterator erase(typename container_type::const_iterator pos)
-
inline container_type::iterator erase(const T &pkt, typename container_type::const_iterator pos)
-
inline void emplace_front(T &&pkt)
-
inline void emplace_back(T &&pkt)
-
inline container_type::size_type size() const
-
inline void clear()
Public Members
-
bool active
Is this queue active?
-
std::optional<double> rate
Encoding rate.
-
std::optional<double> min_throughput
Minimum throughput (bytes per second)
-
std::optional<TokenBucket> bucket
Token bucket.
-
size_t nbytes
Bytes in queue.
Protected Functions
-
inline void preEmplace(const T &pkt)
-
inline void postEmplace()
-
inline bool shouldSend(const T &pkt, bool bonus)
Indicate that a packet has been dropped.
-
inline void updateFileTransferThroughput(void)
-
inline void setFileTransferThroughput(double new_min_throughput)
-
using container_type = std::deque<T>
-
class Synthesizer : public Element
- #include <Synthesizer.hh>
Base class for synthesizers.
Subclassed by ChannelSynthesizer, SlotSynthesizer
Public Functions
-
virtual ~Synthesizer() = default
-
inline virtual double getTXRate(void)
Get the TX sample rate.
-
inline virtual void setTXRate(double rate)
Set the TX sample rate.
- Parameters
rate – The rate.
-
inline virtual void setSchedule(const Schedule::sched_type &schedule)
Set schedule.
-
virtual void stop(void) = 0
Stop modulating.
-
virtual void reconfigure(void) = 0
Reconfigure for new TX parameters.
-
virtual ~Synthesizer() = default
-
class TableNCO : public NCO
Public Functions
-
inline explicit TableNCO(double dtheta)
-
TableNCO() = default
-
virtual ~TableNCO() = default
-
inline virtual double getFrequency(void) final override
Get frequency in radians per sample.
-
inline virtual void setFrequency(double dtheta) final override
Set frequency in radians per sample.
-
inline virtual double getPhase(void) final override
Get phase in radians.
-
inline virtual void setPhase(double theta) final override
Set phase in radians.
-
inline virtual void reset(double dtheta) final override
Reset NCO state with given frequency in radians per sample.
-
inline virtual std::complex<float> mix_up(const std::complex<float> in) final override
Mix a single sample up.
-
inline virtual std::complex<float> mix_down(const std::complex<float> in) final override
Mix a single sample down.
-
inline virtual void mix_up(const std::complex<float> *in, std::complex<float> *out, size_t count) final override
Mix a signal up.
-
inline virtual void mix_down(const std::complex<float> *in, std::complex<float> *out, size_t count) final override
Mix a signal down.
-
inline explicit TableNCO(double dtheta)
-
template<class T>
class TailDropQueue : public SizedQueue<T> - #include <TailDropQueue.hh>
A tail dropD queue.
Public Functions
-
inline TailDropQueue(size_t max_size)
-
TailDropQueue() = delete
-
inline virtual ~TailDropQueue()
-
inline size_t getMaxSize(void) const
Get maximum size.
-
inline void setMaxSize(size_t max_size)
Set maximum size.
Protected Attributes
-
size_t max_size_
Maximum size.
-
inline TailDropQueue(size_t max_size)
-
class TDChannelizer::TDChannelDemodulator : public ChannelDemodulator
Channel state for time-domain demodulation.
Public Functions
-
inline TDChannelDemodulator(PHY &phy, const Channel &channel, const std::vector<C> &taps, double rx_rate)
-
virtual ~TDChannelDemodulator() = default
-
void updateSeq(unsigned seq)
Update IQ buffer sequence number.
-
void reset(void) override
-
void timestamp(const MonoClock::time_point ×tamp, std::optional<ssize_t> snapshot_off, ssize_t offset, float rx_rate) override
-
void demodulate(const std::complex<float> *data, size_t count) override
-
inline TDChannelDemodulator(PHY &phy, const Channel &channel, const std::vector<C> &taps, double rx_rate)
-
class TDChannelizer : public Channelizer
- #include <TDChannelizer.hh>
A time-domain channelizer.
Public Functions
-
virtual ~TDChannelizer()
Add an IQ buffer to demodulate.
- Parameters
buf – The IQ samples to demodulate
-
virtual void reconfigure(void) override
Reconfigure for new RX parameters.
-
void stop(void)
Stop demodulating.
Private Functions
-
void demodWorker(unsigned tid)
A demodulation worker.
Private Members
-
unsigned nthreads_
Number of demodulation threads.
-
bool done_
Flag that is true when we should finish processing.
-
std::atomic<bool> reconfigure_
Flag that is true when we are reconfiguring.
-
std::mutex wake_mutex_
Mutex for waking demodulators.
-
std::condition_variable wake_cond_
Condition variable for waking demodulators.
-
std::mutex demod_mutex_
Mutex for demodulation state.
-
std::vector<std::unique_ptr<TDChannelDemodulator>> demods_
Channel state for demodulation.
-
std::vector<std::thread> demod_threads_
Demodulation worker threads.
Private Static Attributes
-
static const unsigned LOGN = 4
-
virtual ~TDChannelizer()
-
class TDChannelModulator : public ChannelModulator
- #include <TDChannelModulator.hh>
Channel state for time-domain modulation.
Public Types
-
using C = std::complex<float>
-
using Upsampler = dragonradio::signal::MixingRationalResampler<C, C>
-
using C = std::complex<float>
-
class TDMA : public SlottedMAC
- #include <TDMA.hh>
Public Types
-
using TDMASchedule = std::vector<bool>
Public Functions
-
virtual ~TDMA()
-
virtual void stop(void) override
Stop processing packets.
-
inline size_t getNSlots(void)
Get number of slots.
Private Functions
-
void txSlotWorker(void)
Worker preparing slots for transmission.
-
bool findNextSlot(WallClock::time_point t, WallClock::time_point &t_next, size_t &next_slotidx)
Find next TX slot.
- Parameters
t – Time at which to start looking for a TX slot
t_next – The beginning of the next TX slot
next_slotidx – Slot index of next slot
- Returns
True if a slot was found, false otherwise
-
using TDMASchedule = std::vector<bool>
-
struct Time
- #include <Packet.hh>
A time.
Public Functions
-
inline void from_mono_time(MonoClock::time_point t)
-
inline MonoClock::time_point to_mono_time(void) const
-
inline void from_mono_time(MonoClock::time_point t)
-
template<class T>
struct time_point_t Public Functions
-
inline explicit time_point_t(double secs = 0)
-
inline explicit time_point_t(int64_t full_secs, double frac_secs = 0)
-
inline explicit time_point_t(const uhd::time_spec_t &t0)
-
time_point_t(const time_point_t&) = default
-
time_point_t(time_point_t&&) = default
-
time_point_t &operator=(const time_point_t&) = default
-
time_point_t &operator=(time_point_t&&) = default
-
inline time_point_t operator+(const time_point_t &other) const
-
inline time_point_t operator+(double delta) const
-
inline time_point_t operator-(const time_point_t &other) const
-
inline time_point_t operator-(double delta) const
-
inline time_point_t &operator+=(double delta)
-
inline bool operator>(const time_point_t &other) const
-
inline bool operator<(const time_point_t &other) const
-
inline double get_real_secs(void) const
-
inline int64_t get_full_secs(void) const
-
inline double get_frac_secs(void) const
Public Members
-
uhd::time_spec_t t
-
inline explicit time_point_t(double secs = 0)
-
struct TimerQueue::Timer : public heap<T, Container, Compare>::element
Subclassed by MandateQueue< T >::SubQueue, RecvWindow, SendWindow::Entry
-
class TimerQueue
Public Types
-
using time_type = MonoClock::time_point
Public Functions
-
TimerQueue()
-
~TimerQueue()
-
TimerQueue(const TimerQueue&) = delete
-
TimerQueue(TimerQueue&&) = delete
-
TimerQueue &operator=(const TimerQueue&) = delete
-
TimerQueue &operator=(TimerQueue&&) = delete
-
void run(void)
Execute timer events.
-
void start(void)
Start a thread to process timers.
-
void stop(void)
Stop the thread processing timers.
-
using time_type = MonoClock::time_point
-
struct ControlMsg::Timestamp
Public Members
-
TimestampSeq tseq
Timestamp sequence of transmitted packet.
-
TimestampSeq tseq
-
struct ControlMsg::TimestampRecv
-
struct ControlMsg::TimestampSent
Public Members
-
TimestampSeq tseq
Timestamp sequence of transmitted packet.
-
TimestampSeq tseq
-
template<class Clock, class T>
class TimeWindowEstimator : public Estimator<T> - #include <TimeWindowEstimator.hh>
A statistical estimator over a time window.
Subclassed by TimeWindowMax< Clock, T >, TimeWindowMean< Clock, T >, TimeWindowMin< Clock, T >
Public Functions
-
inline explicit TimeWindowEstimator(double twindow = 1.0)
-
virtual ~TimeWindowEstimator() = default
-
inline virtual double getTimeWindow(void) const
Get the current time window.
-
inline virtual void setTimeWindow(double twindow)
Set the current time window.
-
inline virtual std::optional<typename Clock::time_point> getTimeWindowStart() const
Get start of window.
-
inline virtual std::optional<typename Clock::time_point> getTimeWindowEnd() const
Get end of window.
-
inline virtual operator bool() const override
Does the estimator have a value?
-
inline virtual T value_or(T &&default_value) const override
Return the value of the estimator or a default.
-
inline virtual size_t size(void) const override
Return the number of samples used in the estimate.
-
inline virtual void reset()
Protected Functions
-
inline explicit TimeWindowEstimator(double twindow = 1.0)
-
template<class Clock, class T>
class TimeWindowMax : public TimeWindowEstimator<Clock, T> - #include <TimeWindowEstimator.hh>
Compute maximum over a time window.
Public Functions
-
inline explicit TimeWindowMax(double twindow = 1.0)
-
virtual ~TimeWindowMax() = default
Protected Functions
-
inline explicit TimeWindowMax(double twindow = 1.0)
-
template<class Clock, class T>
class TimeWindowMean : public TimeWindowEstimator<Clock, T> - #include <TimeWindowEstimator.hh>
Compute mean over a time window.
Subclassed by TimeWindowMeanRate< Clock, T >
Public Functions
-
inline explicit TimeWindowMean(double twindow = 1.0)
-
virtual ~TimeWindowMean() = default
-
inline virtual void reset(void) override
Protected Functions
-
inline explicit TimeWindowMean(double twindow = 1.0)
-
template<class Clock, class T>
class TimeWindowMeanRate : public TimeWindowMean<Clock, T> - #include <TimeWindowEstimator.hh>
Compute mean value per second over a time window.
-
template<class Clock, class T>
class TimeWindowMin : public TimeWindowEstimator<Clock, T> - #include <TimeWindowEstimator.hh>
Compute minimum over a time window.
Public Functions
-
inline explicit TimeWindowMin(double twindow = 1.0)
-
virtual ~TimeWindowMin() = default
Protected Functions
-
inline explicit TimeWindowMin(double twindow = 1.0)
-
struct MandateQueue::TokenBucket
Public Members
-
MonoClock::time_point last_fill
Timestamp of last time bucket was filled.
-
double tokens
Number of tokens (bytes) in bucket.
-
double max_tokens
Maximum number of tokens (bytes) allowed in bucket.
-
MonoClock::time_point last_fill
-
class FDUpsampler::ToTimeDomain
-
class TunTap : public Element
Public Functions
-
TunTap(const std::string &tap_iface, const std::string &tap_ipaddr, const std::string &tap_ipnetmask, const std::string &tap_macaddr, bool persistent, size_t mtu, uint8_t node_id)
Create a tun/tap device.
- Parameters
tap_iface – The name of the tun/tap device to create.
tap_ipaddr – IP address for tap interface.
tap_ipnetmask – Netmask for tap interface
tap_macaddr – MAC address for tap interface.
persistent – Is this device persistent, or should we create it now and destroy it when we are destructed?
mtu – MTU size for interface.
node_id – Node ID
-
virtual ~TunTap()
-
size_t getMTU(void)
Return the MTU of this interface.
-
void addARPEntry(uint8_t node_id)
Add a static ARP table entry to tap device for node.
-
void deleteARPEntry(uint8_t node_id)
Delete ARP table entryfrom tap device for node.
Public Members
Private Functions
-
void openTap(std::string &dev, int flags)
Create and open a tun/tap device.
- Parameters
dev – The name of the device to open; may be the empty string. This string will be assigned the actual device’s name once it is created.
flags – Flags to pass in the ifr_flags field of the ifreq given to ioctl.
-
void closeTap(void)
Close the tun/tap device.
-
std::string nodeIPAddress(uint8_t node_id)
Get IP address for node.
Send a packet to the tun/tap device.
-
void start(void)
Start the receive worker.
-
void stop(void)
Stop the receive worker.
-
void worker(void)
Receive worker.
Private Members
-
bool persistent_
Flag indicating whether or not the interface is persistent.
-
std::string tap_iface_
The name of the tun/tap device.
-
std::string tap_ipaddr_
The name of the tun/tap device.
-
std::string tap_ipnetmask_
The name of the tun/tap device.
-
std::string tap_macaddr_
The name of the tun/tap device.
-
size_t mtu_
MTU of the interface.
-
int fd_
File descriptor for tun/tap device.
-
struct ifreq ifr_
ifreq for configuring tap interface
-
bool done_
Flag indicating whether or not we are done receiving.
-
std::thread worker_thread_
Receive worker thread.
-
TunTap(const std::string &tap_iface, const std::string &tap_ipaddr, const std::string &tap_ipnetmask, const std::string &tap_macaddr, bool persistent, size_t mtu, uint8_t node_id)
-
struct MAC::TXRecord
- #include <MAC.hh>
A transmission record.
Public Members
-
std::optional<MonoClock::time_point> timestamp
TX deadline.
-
size_t delay
Number of samples from timestamp transmission was delayed.
-
size_t nsamples
Number of samples transmitted.
-
std::optional<MonoClock::time_point> timestamp
-
struct TXRecordEntry
Log entry for TX records.
Public Types
Public Functions
Public Static Functions
-
union u_flags
-
template<class ChannelModulator>
class UnichannelSynthesizer : public SlotSynthesizer - #include <UnichannelSynthesizer.hh>
A single-channel synthesizer.
Public Functions
-
virtual ~UnichannelSynthesizer()
Modulate a slot.
-
virtual void reconfigure(void) override
Reconfigure for new TX parameters.
-
virtual void stop(void) override
Stop modulating.
Protected Functions
-
void modWorker(std::atomic<bool> &reconfig, unsigned tid)
Thread modulating packets.
Protected Attributes
-
std::atomic<bool> done_
Flag indicating if we should stop processing packets.
-
std::vector<std::atomic<bool>> mod_reconfigure_
Reconfiguration flags.
-
std::mutex curslot_mutex_
Lock for current slot.
-
std::condition_variable curslot_cond_
Condition variable for current slot.
-
std::vector<std::thread> mod_threads_
Threads running modWorker.
-
virtual ~UnichannelSynthesizer()
-
template<class T, class C>
class dragonradio::signal::Upsampler : public dragonradio::signal::Pfb<T, C>, public Resampler<T, T> - #include <Polyphase.hh>
An upsampler that uses a polyphase filter bank.
Public Functions
-
inline Upsampler(unsigned l, const std::vector<C> &taps)
Construct a polyphase upsampler.
- Parameters
l – The upsampling rate
taps – The taps for the prototype FIR filter, which should have unity gain.
-
Upsampler() = delete
-
virtual ~Upsampler() = default
-
inline virtual double getRate(void) const override
-
inline virtual double getDelay(void) const override
-
inline virtual size_t neededOut(size_t count) const override
-
inline virtual void reset(void) override
Protected Functions
-
inline virtual void reconfigure(void) override
Reconfigure filter bank for current number of channels and taps.
-
inline Upsampler(unsigned l, const std::vector<C> &taps)
-
class USRP
- #include <USRP.hh>
A USRP.
Public Types
Public Functions
-
USRP(const std::string &addr, const std::optional<std::string> &tx_subdev, const std::optional<std::string> &rx_subdev, double freq, const std::string &tx_ant, const std::string &rx_ant, float tx_gain, float rx_gain)
-
~USRP()
-
USRP() = delete
-
inline DeviceType getDeviceType(void)
Get type of this device.
-
inline std::vector<std::string> getClockSources(const size_t mboard = 0)
Get clock sources.
-
inline std::string getClockSource(const size_t mboard = 0)
Get clock source.
-
inline void setClockSource(const std::string clock_source, const size_t mboard = uhd::usrp::multi_usrp::ALL_MBOARDS)
Set clock source.
-
inline std::vector<std::string> getTimeSources(const size_t mboard = 0)
Get time sources.
-
inline std::string getTimeSource(const size_t mboard = 0)
Get time source.
-
inline void setTimeSource(const std::string &time_source, const size_t mboard = uhd::usrp::multi_usrp::ALL_MBOARDS)
Set time source.
-
inline double getMasterClockRate(void)
Get master clock rate.
-
inline double getTXFrequency(void)
Get TX frequency.
-
void setTXFrequency(double freq)
Set TX frequency.
- Parameters
freq – The center frequency
-
inline double getRXFrequency(void)
Get RX frequency.
-
void setRXFrequency(double freq)
Set RX frequency.
- Parameters
freq – The center frequency
-
inline double getTXRate(void)
Get TX rate.
-
inline void setTXRate(double rate)
Set TX rate.
-
inline double getRXRate(void)
Get RX rate.
-
inline void setRXRate(double rate)
Set RX rate.
-
inline double getTXGain(void)
Get TX gain (dB).
-
inline void setTXGain(float db)
Set TX gain (dB).
-
inline double getRXGain(void)
Get RX gain (dB).
-
inline void setRXGain(float db)
Set RX gain (dB).
-
inline bool getAutoDCOffset(bool enable)
Get automatic DC offset correction.
-
inline std::optional<MonoClock::time_point> getNextTXTime()
Get time at which next transmission will occur.
-
inline void setAutoDCOffset(bool enable)
Set automatic DC offset correction.
Transmit a burst of IQ buffers at the given time.
-
void stopTXBurst(void)
Stop TX burst.
-
void startRXStream(MonoClock::time_point when)
Start streaming read.
-
void stopRXStream(void)
Stop streaming read.
-
bool burstRX(MonoClock::time_point when, size_t nsamps, IQBuf &buf)
Receive specified number of samples at the given time.
- Parameters
when – The time at which to start receiving.
nsamps – The number of samples to receive.
buf – The IQBuf to hold received IQ samples. The buffer should be at least getRecommendedBurstRXSize(nsamps) bytes.
- Returns
Returns true if the burst was successfully received, false otherwise.
-
inline size_t getMaxRXSamps(void)
Return the maximum number of samples we will read at a time during burstRX.
-
inline void setMaxRXSamps(size_t count)
Set the maximum number of samples we will read at a time during burstRX.
-
inline void setMaxRXSampsFactor(unsigned n)
Set the multiplier for the maximum number of samples we will read at a time during burstRX.
-
inline size_t getMaxTXSamps(void)
Return the maximum number of samples we will write at a time during burstTX.
-
inline void setMaxTXSamps(size_t count)
Set the maximum number of samples we will write at a time during burstTX.
-
inline void setMaxTXSampsFactor(unsigned n)
Set the multiplier for the maximum number of samples we will read at a time during burstTX.
-
inline size_t getRecommendedBurstRXSize(size_t nsamps)
Return the recommended buffer size during burstRX.
- Parameters
nsamps – Number of samples to read during burst
- Returns
Recommended buffer size
-
inline uint64_t getTXUnderflowCount(void)
Get the TX underflow count.
- Returns
The number of TX underflow errors Return the number of TX underflow errors and reset the counter
-
inline uint64_t getTXLateCount(void)
Get the TX late count.
- Returns
The number of late TX packet errors Return the number of TX late packet errors and reset the counter
-
void stop(void)
Stop processing data.
Private Functions
-
void determineDeviceType(void)
Determine the type of the main device.
-
void txErrorWorker(void)
Worker that receives TX errors.
Private Members
-
DeviceType device_type_
The DeviceType of the main device.
-
double tx_rate_
Current TX rate.
-
double rx_rate_
Current RX rate.
-
double tx_freq_
Current TX frequency.
-
double rx_freq_
Current RX frequency.
-
size_t tx_max_samps_
Maximum number of samples we will send at a time during burstTX.
-
size_t rx_max_samps_
Maximum number of samples we will read at a time during burstRX.
-
std::optional<MonoClock::time_point> t_next_tx_
Time at which next transmission will occur.
-
bool auto_dc_offset_
Flag indicating whether or not to enable automatic DC offset correction.
-
bool done_
Flag indicating the we should stop processing data.
-
std::atomic<uint64_t> tx_underflow_count_
TX underflow count.
-
std::atomic<uint64_t> tx_late_count_
TX late count.
-
std::thread tx_error_thread_
Thread that receives TX errors.
-
USRP(const std::string &addr, const std::optional<std::string> &tx_subdev, const std::optional<std::string> &rx_subdev, double freq, const std::string &tx_ant, const std::string &rx_ant, float tx_gain, float rx_gain)
-
class liquid::VCO : public liquid::BaseNCO
- #include <NCO.hh>
A “voltage”-controlled oscillator (precise)
-
class WallClock : public Clock
- #include <Clock.hh>
A wall-clock clock.
Public Functions
-
inline MonoClock::time_point getTimeZero(void)
Get time 0 for purposes of linear fit.
-
inline MonoClock::time_point getTimeOffset(void)
Get time offset.
-
inline void setTimeOffset(const MonoClock::time_point &offset)
Set time offset.
-
inline double getSkew(void)
Get skew.
-
inline void setSkew(double skew)
set skew.
Public Static Functions
-
static inline time_point now() noexcept
Get the current wall-clock time.
-
static inline MonoClock::time_point to_mono_time(const time_point &t) noexcept
Return the monotonic time corresponding to wall-clock time.
-
static inline time_point to_wall_time(const MonoClock::time_point &t) noexcept
Return the wall-clock time corresponding to monotonic time.
Public Static Attributes
-
static const bool is_steady = false
-
inline MonoClock::time_point getTimeZero(void)
-
template<class T>
class Window -
Public Functions
-
Window() = delete
-
~Window() = default
-
inline void reset(void)
Reset window elements to 0.
-
template<class C, class Tag>
inline T dotprod(const C *ys, Tag _tag) Compute dot product of window.
- Parameters
ys – The second argument to the dot product
_tag – An xsimd alignment tag indicating the alignment of ys. The array
ys
must have an integral multiple ofxsimd::simd_type<C>
elements. Any elements inys
beyond the firstn
, wheren
is the window size, must be zero. These invariants allow us to implement the dot product very efficiently with vector instructions.
-
Window() = delete
-
template<class T>
class WindowedMean : public Estimator<T> - #include <Estimator.hh>
Estimate a value by calculating a mean over a window of values.
Public Functions
-
inline virtual operator bool() const override
Does the estimator have a value?
-
inline virtual T value_or(T &&default_value) const override
Return the value of the estimator or a default.
-
inline virtual size_t size(void) const override
Return the number of samples used in the estimate.
-
inline void reset(void)
-
inline virtual operator bool() const override
-
class WorkQueue
- #include <WorkQueue.hh>
A work queue.
Public Functions
-
explicit WorkQueue(unsigned int nthreads = 0)
-
~WorkQueue()
-
void addThreads(unsigned int nthreads)
-
void stop(void)
-
void submit(const std::function<void(void)> &item)
-
void submit(std::function<void(void)> &&item)
Private Functions
-
void run_worker(void)
-
explicit WorkQueue(unsigned int nthreads = 0)
-
namespace dragonradio
-
namespace dragonradio::signal
Functions
-
PMOutput firpm(std::size_t N, std::vector<double> const &f0, std::vector<double> const &a, std::vector<double> const &w, double fs, double epsT, int Nmax)
-
PMOutput firpmf(std::size_t N, std::vector<double> const &f0, std::vector<double> const &a, std::vector<double> const &w, std::function<double(double, double, double, double, double, double)> g, double fs, double eps, int Nmax)
-
PMOutput firpm1f(std::size_t N, std::vector<double> const &f, std::vector<double> const &a, std::vector<double> const &w, double fs, double eps, int Nmax)
-
PMOutput firpm1f2(std::size_t N, std::vector<double> const &f, std::vector<double> const &a, std::vector<double> const &w, double fs, double eps, int Nmax)
-
PMOutput firpm(std::size_t N, std::vector<double> const &f0, std::vector<double> const &a, std::vector<double> const &w, double fs, double epsT, int Nmax)
-
namespace fftw
-
Variables
-
std::mutex mutex
Creation of FFTW plans is not re-rentrant, so we need to protect access with a mutex.
-
std::mutex mutex
-
namespace liquid
-
Functions
-
std::vector<float> parks_mcclellan(unsigned int n, float fc, float As)
-
std::vector<float> kaiser(unsigned int n, float fc, float As)
-
std::tuple<std::vector<float>, std::vector<float>> butter_lowpass(unsigned int N, float fc, float f0, float Ap, float As)
-
std::vector<float> parks_mcclellan(unsigned n, float fc, float As)
Construct a lowpass filter using Liquid’s Parks-McClellan implementation.
-
std::vector<float> kaiser(unsigned n, float fc, float As)
Construct a lowpass filter using Liquid’s Kaiser window implementation.
-
std::vector<float> parks_mcclellan(unsigned int n, float fc, float As)
-
namespace pybind11
-
namespace detail
-
namespace literals
-
namespace complex_literals
-
namespace placeholders
- file barrier.hh
- #include <atomic>#include <thread>
- file buffer.hh
- #include <algorithm>#include <cstring>#include <cstdlib>#include <limits>#include <new>#include <stdexcept>#include <type_traits>
Functions
- file CIL.hh
- #include <optional>#include <unordered_map>#include “RadioNet.hh”
- file Scorer.cc
- #include “cil/CIL.hh”#include “cil/Scorer.hh”
Variables
-
const double kFTSuccessMandate = 0.9
-
const double kFTSuccessMandate = 0.9
- file Scorer.hh
- file Clock.cc
- #include <stdio.h>#include <string.h>#include <time.h>#include “Clock.hh”
- file Clock.cc
- #include <pybind11/pybind11.h>#include “Clock.hh”#include “python/PyModules.hh”
- file Clock.hh
- #include <chrono>#include <memory>#include <uhd/usrp/multi_usrp.hpp>
Functions
-
template<class T>
double fmod(const time_point_t<T> &t, double x)
-
template<class T>
bool approx(const time_point_t<T> &t1, const time_point_t<T> &t2)
-
template<class T>
- file FDResample.hh
- #include <assert.h>#include <complex>#include <xsimd/xsimd.hpp>#include <xsimd/stl/algorithms.hpp>#include “dsp/FFTW.hh”
- file FFTW.cc
- #include “dsp/FFTW.hh”
- file FFTW.hh
- #include <complex>#include <memory>#include <mutex>#include <vector>#include <fftw3.h>
- file Filter.hh
- #include <vector>
- file Filter.hh
- #include <complex>#include <tuple>#include <vector>#include <liquid/liquid.h>#include “dsp/Filter.hh”
Defines
-
final
-
final
- file FIR.hh
- #include <vector>#include <xsimd/xsimd.hpp>#include “dsp/Filter.hh”#include “dsp/Window.hh”
Defines
-
final
-
final
- file FIRDesign.cc
- #include <firpm/pm.h>#include “FIRDesign.hh”
- file FIRDesign.hh
- #include <complex>#include <vector>
- file NCO.hh
- #include <sys/types.h>#include <complex>#include <memory>#include <liquid/liquid.h>
- file NCO.hh
- #include <complex>#include <liquid/liquid.h>#include “dsp/NCO.hh”
Defines
-
final
-
final
- file Polyphase.hh
- #include <assert.h>#include <vector>#include <xsimd/xsimd.hpp>#include “Math.hh”#include “dsp/Filter.hh”#include “dsp/Resample.hh”#include “dsp/TableNCO.hh”#include “dsp/Window.hh”
Defines
-
final
-
final
- file Resample.hh
- #include <complex>#include “IQBuffer.hh”
Typedefs
-
using C = std::complex<float>
-
using C = std::complex<float>
- file Resample.hh
- #include <complex>#include <functional>#include <memory>#include <liquid/liquid.h>#include “IQBuffer.hh”#include “dsp/Resample.hh”
Defines
-
final
-
final
- file sintab.hh
- #include <complex>
- file TableNCO.cc
- #include <math.h>#include “dsp/TableNCO.hh”
- file TableNCO.hh
- #include “dsp/sintab.hh”#include “dsp/NCO.hh”
Defines
-
final
Variables
-
constexpr int INTBITS = 12
-
final
- file Window.hh
- #include <vector>#include <xsimd/xsimd.hpp>
Functions
-
inline uint32_t nextPowerOfTwo(uint32_t x)
-
inline uint32_t nextPowerOfTwo(uint32_t x)
- file ExtensibleDataSet.cc
- #include “ExtensibleDataSet.hh”
Variables
-
constexpr size_t kBlockSize = 4 * 1024
File block size(-ish)
-
constexpr size_t kAllocGranularity = 1024 * kBlockSize
We allocate capacity in multiples of this.
-
constexpr size_t kChunkGranularity = 32 * kBlockSize
We chunk in multiples of this.
-
constexpr size_t kBlockSize = 4 * 1024
- file ExtensibleDataSet.hh
- #include <string>#include <H5Cpp.h>
Typedefs
-
using Group = H5::CommonFG
-
using Group = H5::CommonFG
- file Header.hh
- #include <sys/types.h>#include <stdint.h>#include <string.h>#include <netinet/in.h>#include <complex>#include <cstddef>#include <iterator>#include <vector>#include <liquid/liquid.h>#include “Seq.hh”
Defines
-
PACKED
Typedefs
-
typedef uint8_t NodeId
-
PACKED
- file heap.hh
- #include <functional>#include <limits>#include <utility>#include <vector>
- file IQBuffer.hh
- #include <atomic>#include <complex>#include <deque>#include <memory>#include <optional>#include <thread>#include <vector>#include <xsimd/xsimd.hpp>#include <xsimd/stl/algorithms.hpp>#include <uhd/types/time_spec.hpp>#include “buffer.hh”#include “Clock.hh”
- file IQCompression.cc
- #include “IQCompression.hh”#include “IQCompression/FLAC.hh”
Functions
- file IQCompression.cc
- #include <pybind11/pybind11.h>#include <pybind11/numpy.h>#include <FLAC++/decoder.h>#include <FLAC++/encoder.h>#include “IQBuffer.hh”#include “IQCompression.hh”#include “IQCompression/FLAC.hh”#include “python/PyModules.hh”
Defines
-
HIDDEN
Functions
-
void exportIQCompression(py::module &m)
-
HIDDEN
- file IQCompression.hh
- #include <atomic>#include <complex>#include <deque>#include <memory>#include <vector>#include <FLAC++/decoder.h>#include <FLAC++/encoder.h>#include “IQBuffer.hh”
Typedefs
-
typedef std::complex<int16_t> sc16_t
-
typedef std::complex<float> fc32_t
-
typedef std::complex<double> fc64_t
Functions
-
typedef std::complex<int16_t> sc16_t
- file FLAC.cc
- #include <xsimd/xsimd.hpp>#include “IQCompression.hh”#include “IQCompression/FLAC.hh”
Functions
-
void convert2int32(const fc32_t *in_, const size_t n, int32_t *out)
Convert fc32_t IQ data to interleaved int32 format.
-
template<>
void interleave<float>(const float &x, const float &y, float *res)
-
template<>
void interleave<xsimd::simd_type<float>>(const xsimd::simd_type<float> &x, const xsimd::simd_type<float> &y, xsimd::simd_type<float> *res_)
-
void convert2fc32(const int32_t *const in[], const size_t size, fc32_t *out_)
Convert non-interleaved int32 format to fc32.
Variables
-
constexpr unsigned kBits = 14
-
void convert2int32(const fc32_t *in_, const size_t n, int32_t *out)
- file FLAC.hh
- #include <atomic>#include <complex>#include <deque>#include <memory>#include <vector>#include <FLAC++/decoder.h>#include <FLAC++/encoder.h>
- file Filter.cc
- #include <assert.h>#include “liquid/Filter.hh”
- file Filter.cc
- #include <pybind11/pybind11.h>#include <pybind11/numpy.h>#include <pybind11/stl.h>#include <firpm/pm.h>#include “dsp/FIR.hh”#include “dsp/FIRDesign.hh”#include “dsp/Filter.hh”#include “dsp/Window.hh”#include “liquid/Filter.hh”#include “python/PyModules.hh”
Functions
-
template<class I, class O>
void exportFilter(py::module &m, const char *name)
-
template<class I, class O, class C>
void exportLiquidFIR(py::module &m, const char *name)
-
template<class I, class O, class C>
void exportLiquidIIR(py::module &m, const char *name)
-
template<class T, class C>
void exportDragonFIR(py::module &m, const char *name)
-
template<class T>
void exportWindow(py::module &m, const char *name)
-
void exportFilters(py::module &m)
-
template<class I, class O>
- file FlexFrame.hh
- #include <complex>#include <functional>#include <liquid/liquid.h>#include “dsp/FFTW.hh”#include “liquid/Modem.hh”
- file FlexFrame.hh
- #include “liquid/FlexFrame.hh”#include “liquid/PHY.hh”
Defines
-
final
-
final
- file Modem.cc
- #include “liquid/Modem.hh”
- file Modem.cc
- #include <pybind11/pybind11.h>#include <pybind11/numpy.h>#include <pybind11/stl.h>#include “phy/Modem.hh”#include “python/PyModules.hh”
Functions
-
std::vector<Demod> demodulate(Demodulator &demod, py::array_t<std::complex<float>, py::array::c_style | py::array::forcecast> sig)
-
void exportModem(py::module &m)
Variables
-
const size_t kInitialModbufSize = 16384
-
std::vector<Demod> demodulate(Demodulator &demod, py::array_t<std::complex<float>, py::array::c_style | py::array::forcecast> sig)
- file Modem.hh
- #include <complex>#include <functional>#include <liquid/liquid.h>#include “Header.hh”#include “liquid/Mutex.hh”#include “phy/Modem.hh”
- file Modem.hh
- #include <functional>#include <Header.hh>#include <liquid/liquid.h>
- file Mutex.cc
- #include “liquid/Mutex.hh”
- file Mutex.hh
- #include <mutex>
- file NewFlexFrame.hh
- #include <complex>#include <functional>#include <liquid/liquid.h>#include “dsp/FFTW.hh”#include “liquid/Modem.hh”
- file NewFlexFrame.hh
- #include “liquid/NewFlexFrame.hh”#include “liquid/PHY.hh”
Defines
-
final
-
final
- file OFDM.cc
- #include “liquid/OFDM.hh”
- file OFDM.hh
- #include <complex>#include <functional>#include <optional>#include <liquid/liquid.h>#include “dsp/FFTW.hh”#include “liquid/Modem.hh”
- file OFDM.hh
- #include “liquid/OFDM.hh”#include “liquid/PHY.hh”
Defines
-
final
-
final
- file PHY.cc
- #include <xsimd/xsimd.hpp>#include <xsimd/stl/algorithms.hpp>#include “Logger.hh”#include “WorkQueue.hh”#include “dsp/NCO.hh”#include “liquid/PHY.hh”
- file PHY.cc
- #include “PHY.hh”
- file PHY.cc
- #include <pybind11/pybind11.h>#include <pybind11/numpy.h>#include <pybind11/stl.h>#include “WorkQueue.hh”#include “phy/FlexFrame.hh”#include “phy/Gain.hh”#include “phy/NewFlexFrame.hh”#include “phy/OFDM.hh”#include “phy/PHY.hh”#include “python/PyModules.hh”#include “python/py_shared_ptr.hh”
Typedefs
-
using fc32 = std::complex<float>
-
using PacketDemodulator = PHY::PacketDemodulator
-
using PacketModulator = PHY::PacketModulator
-
using fc32 = std::complex<float>
- file PHY.hh
- #include <complex>#include <functional>#include <type_traits>#include <liquid/liquid.h>#include “Clock.hh”#include “Logger.hh”#include “Packet.hh”#include “dsp/TableNCO.hh”#include “liquid/Modem.hh”#include “liquid/Resample.hh”#include “phy/PHY.hh”
Defines
-
final
-
final
- file PHY.hh
- #include <atomic>#include <functional>#include <list>#include “logging.hh”#include “IQBuffer.hh”#include “Packet.hh”#include “RadioNet.hh”#include “mac/Snapshot.hh”#include “phy/AutoGain.hh”
- file Resample.cc
- #include <assert.h>#include “liquid/Resample.hh”
- file Resample.cc
- #include <pybind11/pybind11.h>#include <pybind11/complex.h>#include <pybind11/numpy.h>#include <pybind11/stl.h>#include “dsp/Polyphase.hh”#include “dsp/Resample.hh”#include “liquid/Resample.hh”#include “python/PyModules.hh”
Functions
-
template<class I, class O>
void exportResampler(py::module &m, const char *name)
-
template<class I, class O, class C>
void exportLiquidMSResamp(py::module &m, const char *name)
-
template<class T, class C>
void exportDragonPfb(py::module &m, const char *name)
-
template<class T, class C>
void exportDragonUpsampler(py::module &m, const char *name)
-
template<class T, class C>
void exportDragonDownsampler(py::module &m, const char *name)
-
template<class T, class C>
void exportDragonRationalResampler(py::module &m, const char *name)
-
template<class T, class C>
void exportDragonMixingRationalResampler(py::module &m, const char *name)
-
void exportResamplers(py::module &m)
-
template<class I, class O>
- file Controller.hh
- #include <functional>#include <list>#include “RadioNet.hh”#include “net/Element.hh”#include “net/Queue.hh”#include “phy/PHY.hh”#include “phy/Synthesizer.hh”
- file DummyController.cc
- #include “llc/DummyController.hh”
- file DummyController.hh
- #include <mutex>#include <unordered_map>#include “llc/Controller.hh”
- file SmartController.cc
- #include “Logger.hh”#include “llc/SmartController.hh”
Functions
- file SmartController.hh
- #include <sys/types.h>#include <netinet/if_ether.h>#include <list>#include <map>#include <random>#include “heap.hh”#include “Clock.hh”#include “TimerQueue.hh”#include “llc/Controller.hh”#include “mac/MAC.hh”#include “phy/Gain.hh”#include “phy/PHY.hh”#include “stats/Estimator.hh”#include “stats/TimeWindowEstimator.hh”
- file proxies.hh
- #include “llc/SmartController.hh”
- file Logger.cc
- #include <stdint.h>#include <complex>#include <H5Cpp.h>#include “Clock.hh”#include “IQCompression.hh”#include “Logger.hh”
Variables
-
constexpr size_t kBlockSize = 4 * 1024
File block size(-ish)
-
constexpr int kMDCNumElements = 512
Number of elements in the meta data cache.
-
constexpr size_t kRDCCNumElements = 512
Number of elements in the raw data chunk cache.
-
constexpr size_t kRDCCNumBytes = 16 * 1024 * kBlockSize
Total size of the raw data chunk cache, in bytes.
-
constexpr double kRDCCW0 = 0.0
Preemption policy.
-
constexpr size_t kBlockSize = 4 * 1024
- file Logger.cc
- #include <pybind11/pybind11.h>#include <pybind11/stl.h>#include “logging.hh”#include “Clock.hh”#include “Logger.hh”#include “python/PyModules.hh”
- file Logger.hh
- #include <time.h>#include <memory>#include <mutex>#include <string>#include <thread>#include <uhd/usrp/multi_usrp.hpp>#include <H5Cpp.h>#include “buffer.hh”#include “Clock.hh”#include “ExtensibleDataSet.hh”#include “IQBuffer.hh”#include “Packet.hh”#include “SafeQueue.hh”#include “mac/Snapshot.hh”
Variables
-
std::shared_ptr<Logger> logger
The global logger.
-
std::shared_ptr<Logger> logger
- file logging.cc
- #include <cassert>#include “logging.hh”#include “Logger.hh”
Functions
-
bool isLogLevelEnabled(EventCategory cat, loglevel lvl)
Return true if logging is enabled for level.
-
void setLogLevel(EventCategory cat, loglevel lvl)
Set log level.
-
bool isPrintLogLevelEnabled(EventCategory cat, loglevel lvl)
Return true if printing is enabled for level.
-
void setPrintLogLevel(EventCategory cat, loglevel lvl)
Set printing log level.
-
std::string eventCategory2string(EventCategory cat)
Return the string name of an event category.
-
EventCategory string2EventCategory(const std::string &s)
Return the named event category.
-
void vlogEvent(const MonoClock::time_point &t, EventCategory cat, loglevel lvl, const char *fmt, va_list ap)
Log an event.
-
bool isLogLevelEnabled(EventCategory cat, loglevel lvl)
- file logging.hh
- #include <stdarg.h>#include “Clock.hh”#include “Logger.hh”
Defines
-
logSystem(lvl, ...)
-
logScheduler(lvl, ...)
-
logNet(lvl, ...)
-
logTunTap(lvl, ...)
-
logTimeSync(lvl, ...)
-
logAMC(lvl, ...)
-
logARQ(lvl, ...)
-
logMAC(lvl, ...)
-
logPHY(lvl, ...)
-
logUSRP(lvl, ...)
-
logUSRPAt(t, lvl, ...)
Typedefs
-
using loglevel = unsigned
Enums
-
enum EventCategory
Event categories.
Values:
-
enumerator kEventSystem
-
enumerator kEventScheduler
-
enumerator kEventNet
-
enumerator kEventTunTap
-
enumerator kEventTimeSync
-
enumerator kEventAMC
-
enumerator kEventARQ
-
enumerator kEventMAC
-
enumerator kEventPHY
-
enumerator kEventUSRP
-
enumerator kNumEvents
-
enumerator kEventSystem
Functions
-
std::string eventCategory2string(EventCategory cat)
Return the string name of an event category.
-
EventCategory string2EventCategory(const std::string &s)
Return the named event category.
-
bool isLogLevelEnabled(EventCategory, loglevel)
Return true if logging is enabled for level.
-
void setLogLevel(EventCategory, loglevel)
Set log level.
-
bool isPrintLogLevelEnabled(EventCategory, loglevel)
Return true if printing is enabled for level.
-
void setPrintLogLevel(EventCategory, loglevel)
Set printing log level.
-
void vlogEvent(const MonoClock::time_point &t, EventCategory cat, loglevel lvl, const char *fmt, va_list ap)
Log an event.
-
inline void logEvent(EventCategory cat, loglevel lvl, const char *fmt, ...)
Log an event using current time.
-
inline void logEventAt(const MonoClock::time_point &t, EventCategory cat, loglevel lvl, const char *fmt, ...)
Log an event at specific time.
-
logSystem(lvl, ...)
- file FDMA.cc
- #include “Clock.hh”#include “USRP.hh”#include “mac/FDMA.hh”
- file FDMA.hh
- #include <vector>#include “USRP.hh”#include “phy/Channelizer.hh”#include “phy/PHY.hh”#include “phy/ChannelSynthesizer.hh”#include “mac/MAC.hh”
- file MAC.cc
- #include “mac/MAC.hh”#include “util/threads.hh”
- file MAC.cc
- #include <time.h>#include <pybind11/pybind11.h>#include <pybind11/numpy.h>#include <pybind11/stl.h>#include “mac/FDMA.hh”#include “mac/SlottedALOHA.hh”#include “mac/SlottedMAC.hh”#include “mac/TDMA.hh”#include “python/PyModules.hh”
Functions
-
void exportMACs(py::module &m)
-
void exportMACs(py::module &m)
- file MAC.hh
- #include <deque>#include <memory>#include “USRP.hh”#include “llc/Controller.hh”#include “mac/MAC.hh”#include “mac/Snapshot.hh”#include “phy/Channel.hh”#include “phy/Channelizer.hh”#include “phy/PHY.hh”#include “phy/Synthesizer.hh”
- file Schedule.hh
- #include <vector>
- file SlottedALOHA.cc
- #include “Clock.hh”#include “USRP.hh”#include “mac/SlottedALOHA.hh”#include “util/threads.hh”
- file SlottedALOHA.hh
- #include <random>#include <vector>#include “RadioNet.hh”#include “USRP.hh”#include “phy/Channelizer.hh”#include “phy/PHY.hh”#include “phy/Synthesizer.hh”#include “mac/MAC.hh”#include “mac/SlottedMAC.hh”
- file SlottedMAC.cc
- #include “Logger.hh”#include “SlottedMAC.hh”#include “liquid/Modem.hh”#include “util/threads.hh”
Typedefs
-
using Slot = SlotSynthesizer::Slot
-
using Slot = SlotSynthesizer::Slot
- file SlottedMAC.hh
- #include <atomic>#include <mutex>#include <optional>#include <queue>#include “Clock.hh”#include “Logger.hh”#include “RadioNet.hh”#include “SafeQueue.hh”#include “USRP.hh”#include “phy/Channelizer.hh”#include “phy/PHY.hh”#include “phy/SlotSynthesizer.hh”#include “mac/MAC.hh”#include “mac/Schedule.hh”
- file Snapshot.cc
- #include <mutex>#include “mac/Snapshot.hh”
- file Snapshot.cc
- #include <pybind11/pybind11.h>#include <pybind11/stl.h>#include “mac/Snapshot.hh”#include “python/PyModules.hh”
Functions
-
void exportSnapshot(py::module &m)
-
void exportSnapshot(py::module &m)
- file Snapshot.hh
- #include <atomic>#include <memory>#include <mutex>#include “IQBuffer.hh”
- file TDMA.cc
- #include “Clock.hh”#include “USRP.hh”#include “mac/TDMA.hh”#include “util/threads.hh”
- file TDMA.hh
- #include <vector>#include “RadioNet.hh”#include “USRP.hh”#include “phy/Channelizer.hh”#include “phy/PHY.hh”#include “phy/Synthesizer.hh”#include “mac/MAC.hh”#include “mac/SlottedMAC.hh”
- file main.cc
- #include <stdio.h>#include <stdlib.h>#include <execinfo.h>#include <signal.h>#include <pybind11/embed.h>#include “Logger.hh”#include “util/capabilities.hh”#include “phy/PHY.hh”
Defines
-
MAXFRAMES
Functions
-
void backtraceHandler(int signum, siginfo_t *si, void *ptr)
A signal handler that prints a backtrace.
-
void activateVirtualenv(void)
Activate Python virtual environment.
If the environmement variable VIRTUAL_ENV is set, use the associated virtualenv. This allows us to use the virtualenv even through the dragonradio binary is not located in the virtual environment’s bin directory.
-
void setPythonArgv(int argc, char **argv)
Set Python sys.argv.
-
int main(int argc, char **argv)
-
MAXFRAMES
- file Math.cc
- #include <math.h>#include “Math.hh”
Functions
-
void frap(double x, long maxden, long &num, long &den)
Convert a floating-point number to a fractional number.
See: https://www.ics.uci.edu/~eppstein/numth/frap.c https://stackoverflow.com/questions/95727/how-to-convert-floats-to-human-readable-fractions https://stackoverflow.com/questions/2076290/implementation-limitations-of-float-as-integer-ratio https://groups.google.com/forum/#!msg/sci.math/8nqj1x7xmWg/umKDlL4N8xgJ
-
void frap(double x, long maxden, long &num, long &den)
- file Math.hh
- #include <limits>
Functions
-
void frap(double x, long maxden, long &num, long &den)
Convert a floating-point number to a fractional number.
See: https://www.ics.uci.edu/~eppstein/numth/frap.c https://stackoverflow.com/questions/95727/how-to-convert-floats-to-human-readable-fractions https://stackoverflow.com/questions/2076290/implementation-limitations-of-float-as-integer-ratio https://groups.google.com/forum/#!msg/sci.math/8nqj1x7xmWg/umKDlL4N8xgJ
-
void frap(double x, long maxden, long &num, long &den)
- file Element.hh
- #include <functional>#include <memory>#include “Packet.hh”
This modules contains a Click-inspired, modern C++ implementation of push-pull elements.
Typedefs
-
template<typename D>
using RadioIn = Port<In, D, std::shared_ptr<RadioPacket>>
-
template<typename D>
using RadioOut = Port<Out, D, std::shared_ptr<RadioPacket>>
-
template<typename D>
- file Firewall.hh
- #include <sys/types.h>#include <sys/socket.h>#include <netinet/if_ether.h>#include <netinet/in.h>#include <netinet/ip.h>#include <netinet/udp.h>#include <netinet/tcp.h>#include <arpa/inet.h>#include <mutex>#include <unordered_set>#include “logging.hh”#include “Clock.hh”#include “Packet.hh”#include “cil/CIL.hh”#include “net/Processor.hh”#include “stats/TimeWindowEstimator.hh”
- file FlowPerformance.cc
- #include <sys/types.h>#include <sys/socket.h>#include <netinet/if_ether.h>#include <netinet/in.h>#include <netinet/ip.h>#include <netinet/udp.h>#include <netinet/tcp.h>#include <arpa/inet.h>#include <sys/time.h>#include “Logger.hh”#include “net/FlowPerformance.hh”
- file FlowPerformance.hh
- #include <mutex>#include <optional>#include <unordered_map>#include “Clock.hh”#include “Packet.hh”#include “cil/CIL.hh”#include “net/Processor.hh”#include “stats/TimeWindowEstimator.hh”
- file MandateQueue.hh
- #include <condition_variable>#include <deque>#include <mutex>#include <optional>#include <set>#include <unordered_map>#include “Logger.hh”#include “TimerQueue.hh”#include “cil/CIL.hh”#include “net/Queue.hh”
Typedefs
-
using MandateNetQueue = MandateQueue<std::shared_ptr<NetPacket>>
-
using MandateNetQueue = MandateQueue<std::shared_ptr<NetPacket>>
- file mgen.h
- #include <sys/types.h>#include <arpa/inet.h>#include <byteswap.h>#include “Clock.hh”
Defines
-
PACKED
Enums
-
enum [anonymous]
Values:
-
enumerator MGEN_VERSION
MGEN version number.
-
enumerator DARPA_MGEN_VERSION
DARPA MGEN version number.
-
enumerator MGEN_VERSION
-
enum [anonymous]
Values:
-
enumerator MGEN_INVALID_ADDRESS
-
enumerator MGEN_IPv4
-
enumerator MGEN_IPv6
-
enumerator MGEN_INVALID_ADDRESS
-
PACKED
- file NetFilter.cc
- #include <sys/types.h>#include <sys/socket.h>#include <netinet/if_ether.h>#include <netinet/in.h>#include <netinet/ip.h>#include <arpa/inet.h>#include <cstddef>#include “logging.hh”#include “net/NetFilter.hh”#include “util/net.hh”
- file NetFilter.hh
- #include <functional>#include “RadioNet.hh”#include “net/Processor.hh”
- file Noop.hh
- #include “net/Processor.hh”
- file PacketCompressor.cc
- #include <sys/types.h>#include <sys/socket.h>#include <netinet/if_ether.h>#include <netinet/in.h>#include <netinet/ip.h>#include <netinet/udp.h>#include <netinet/tcp.h>#include <arpa/inet.h>#include <sys/time.h>#include <functional>#include “Logger.hh”#include “RadioNet.hh”#include “net/PacketCompressor.hh”
Functions
-
uint16_t ip_checksum_update(uint16_t cksum, const void *data_, size_t count)
-
uint16_t ip_checksum(const void *data, size_t count)
-
uint16_t udp_checksum(const struct ip *iph, const struct udphdr *udph, size_t udp_len)
-
uint32_t crc32(const void *data_, size_t count)
Variables
-
const uint32_t CRC32_TABLE[256]
-
const uint32_t CRC32_XINIT = 0xFFFFFFFFL
Initial value.
-
const uint32_t CRC32_XOROT = 0xFFFFFFFFL
Final xor value.
-
const u_int8_t kExpectedTTL = 254
-
const int32_t kExpectedLatitude = htonl((999 + 180) * 60000)
-
const int32_t kExpectedLongitude = htonl((999 + 180) * 60000)
-
const int32_t kExpectedAltitude = htonl(static_cast<int32_t>(-999))
-
uint16_t ip_checksum_update(uint16_t cksum, const void *data_, size_t count)
- file PacketCompressor.hh
- #include <sys/types.h>#include <arpa/inet.h>#include “Packet.hh”#include “net/Element.hh”
- file Processor.hh
- #include <functional>#include “net/Element.hh”
- file Queue.hh
- #include <functional>#include <mutex>#include “Header.hh”#include “net/Element.hh”
- file REDQueue.hh
- #include <list>#include <random>#include “logging.hh”#include “Clock.hh”#include “net/Queue.hh”#include “net/SizedQueue.hh”
- file SimpleQueue.hh
- #include <condition_variable>#include <mutex>#include “net/Queue.hh”
Typedefs
-
using SimpleNetQueue = SimpleQueue<std::shared_ptr<NetPacket>>
-
using SimpleNetQueue = SimpleQueue<std::shared_ptr<NetPacket>>
- file SizedQueue.hh
- #include <list>#include <random>#include “logging.hh”#include “Clock.hh”#include “net/Queue.hh”
Typedefs
-
using SizedNetQueue = SizedQueue<std::shared_ptr<NetPacket>>
-
using SizedNetQueue = SizedQueue<std::shared_ptr<NetPacket>>
- file TailDropQueue.hh
- #include <list>#include “Clock.hh”#include “net/Queue.hh”#include “net/SizedQueue.hh”
Typedefs
-
using TailDropNetQueue = TailDropQueue<std::shared_ptr<NetPacket>>
-
using TailDropNetQueue = TailDropQueue<std::shared_ptr<NetPacket>>
- file TunTap.cc
- #include <sys/types.h>#include <sys/ioctl.h>#include <netinet/if_ether.h>#include <linux/if_tun.h>#include <fcntl.h>#include <string.h>#include <unistd.h>#include <functional>#include “logging.hh”#include “RadioNet.hh”#include “net/TunTap.hh”#include “util/capabilities.hh”#include “util/net.hh”#include “util/sprintf.hh”#include “util/threads.hh”
This code has been heavily modified from the version included in the reference SC2 radio. That code appears to have been taken from this Tun/Tap interface tutorial without attribution.
Variables
-
static const char *clonedev =
"/dev/net/tun"
-
static const char *clonedev =
- file TunTap.hh
- #include <sys/ioctl.h>#include <net/if.h>#include <string>#include <thread>#include <vector>#include “Logger.hh”#include “net/Element.hh”
- file Packet.cc
- #include “Packet.hh”
- file Packet.cc
- #include <pybind11/pybind11.h>#include <pybind11/numpy.h>#include <pybind11/stl.h>#include “Header.hh”#include “Packet.hh”#include “python/PyModules.hh”
Typedefs
-
using fc32 = std::complex<float>
Functions
-
void exportPacket(py::module &m)
-
using fc32 = std::complex<float>
- file Packet.hh
- #include <sys/types.h>#include <netinet/if_ether.h>#include <netinet/ip.h>#include <netinet/udp.h>#include <netinet/tcp.h>#include <complex>#include <cstddef>#include <iterator>#include <optional>#include <vector>#include <liquid/liquid.h>#include “buffer.hh”#include “Clock.hh”#include “Header.hh”#include “IQBuffer.hh”#include “net/mgen.h”#include “phy/Channel.hh”#include “phy/Modem.hh”
Defines
-
PACKED
Typedefs
-
using TimestampSeq = uint16_t
Timestamp sequence number.
-
typedef uint16_t FlowUID
A flow UID.
Enums
-
enum CompressionType
Values:
-
enumerator kUncompressed
Uncompressed packet.
-
enumerator kEthernet
Compressed Ethernet packet.
-
enumerator kIP
Compressed IP packet.
-
enumerator kUDP
Compressed UDP packet.
-
enumerator kMGEN
Compressed (UDP) MGEN version 2 packet.
-
enumerator kDARPAMGEN
Compressed (UDP) DARPA MGEN version 4 packet.
-
enumerator kUncompressed
Functions
-
constexpr size_t ctrlsize(uint8_t ty)
Compute the size of the specified control message.
Variables
-
struct ControlMsg PACKED
-
PACKED
- file AutoGain.cc
- #include “logging.hh”#include “phy/AutoGain.hh”
- file AutoGain.hh
- #include <complex>#include <mutex>#include <shared_mutex>#include <liquid/liquid.h>#include “IQBuffer.hh”#include “phy/Modem.hh”#include “stats/Estimator.hh”
- file Channel.hh
- #include <complex>#include <vector>#include <boost/functional/hash.hpp>
- file Channelizer.hh
- #include “IQBuffer.hh”#include “RadioNet.hh”#include “phy/Channel.hh”#include “phy/PHY.hh”
- file ChannelSynthesizer.hh
- #include <atomic>#include <list>#include <memory>#include <mutex>#include “phy/Channel.hh”#include “phy/ModPacketQueue.hh”#include “phy/PHY.hh”#include “phy/Synthesizer.hh”
- file FDChannelizer.cc
- #include <math.h>#include <functional>#include <xsimd/xsimd.hpp>#include <xsimd/stl/algorithms.hpp>#include <pybind11/pybind11.h>#include “phy/FDChannelizer.hh”#include “phy/PHY.hh”
- file FDChannelizer.hh
- #include <condition_variable>#include <functional>#include <list>#include <mutex>#include “barrier.hh”#include “Logger.hh”#include “SafeQueue.hh”#include “dsp/FFTW.hh”#include “dsp/Polyphase.hh”#include “dsp/TableNCO.hh”#include “phy/Channel.hh”#include “phy/Channelizer.hh”
- file FDChannelModulator.cc
- #include “phy/FDChannelModulator.hh”
- file FDChannelModulator.hh
- #include “dsp/FDResample.hh”#include “phy/Synthesizer.hh”
Defines
-
final
-
final
- file Gain.hh
- #include <math.h>#include <atomic>
- file ModPacketQueue.hh
- #include <atomic>#include <list>#include <memory>#include <mutex>#include “phy/PHY.hh”
- file MultichannelSynthesizer.cc
- #include <xsimd/xsimd.hpp>#include <xsimd/stl/algorithms.hpp>#include <pybind11/pybind11.h>#include “phy/MultichannelSynthesizer.hh”#include “phy/PHY.hh”#include “stats/Estimator.hh”
- file MultichannelSynthesizer.hh
- #include <atomic>#include <mutex>#include “barrier.hh”#include “dsp/FDResample.hh”#include “dsp/FFTW.hh”#include “phy/PHY.hh”#include “phy/SlotSynthesizer.hh”
- file OverlapTDChannelizer.cc
- #include <functional>#include “phy/PHY.hh”#include “phy/OverlapTDChannelizer.hh”
- file OverlapTDChannelizer.hh
- #include <math.h>#include <condition_variable>#include <functional>#include <list>#include <mutex>#include “Logger.hh”#include “RadioPacketQueue.hh”#include “dsp/Polyphase.hh”#include “dsp/TableNCO.hh”#include “phy/Channel.hh”#include “phy/Channelizer.hh”
- file ParallelChannelSynthesizer.hh
- #include <atomic>#include <list>#include <memory>#include <mutex>#include “barrier.hh”#include “phy/Channel.hh”#include “phy/ChannelSynthesizer.hh”#include “phy/PHY.hh”
- file ParallelChannelSynthesizer.inl
- #include “ParallelChannelSynthesizer.hh”#include <pybind11/pybind11.h>
- file RadioPacketQueue.cc
- #include “phy/RadioPacketQueue.hh”
- file RadioPacketQueue.hh
- #include <condition_variable>#include <list>#include <memory>#include <mutex>#include <variant>#include “IQBuffer.hh”#include “Packet.hh”
- file SlotSynthesizer.hh
- #include “phy/Synthesizer.hh”
- file Synthesizer.hh
- #include <atomic>#include <mutex>#include “Logger.hh”#include “RadioNet.hh”#include “mac/Schedule.hh”#include “phy/PHY.hh”
- file TDChannelizer.cc
- #include <functional>#include <pybind11/pybind11.h>#include “Logger.hh”#include “phy/PHY.hh”#include “phy/TDChannelizer.hh”
- file TDChannelizer.hh
- #include <math.h>#include <condition_variable>#include <functional>#include <list>#include <mutex>#include “barrier.hh”#include “SafeQueue.hh”#include “dsp/Polyphase.hh”#include “dsp/TableNCO.hh”#include “phy/Channel.hh”#include “phy/Channelizer.hh”
- file TDChannelModulator.cc
- #include “phy/TDChannelModulator.hh”
- file TDChannelModulator.hh
- #include “dsp/Polyphase.hh”#include “phy/Synthesizer.hh”
Defines
-
final
-
final
- file UnichannelSynthesizer.hh
- #include <atomic>#include <mutex>#include “phy/Channel.hh”#include “phy/PHY.hh”#include “phy/SlotSynthesizer.hh”
- file UnichannelSynthesizer.inl
- #include “UnichannelSynthesizer.hh”#include <pybind11/pybind11.h>
- file capsule.hh
- #include <pybind11/pybind11.h>
Functions
Save a shared_ptr in a capsule.
- file Channelizer.cc
- #include <pybind11/pybind11.h>#include <pybind11/complex.h>#include <pybind11/numpy.h>#include <pybind11/stl.h>#include “phy/Channel.hh”#include “phy/Channelizer.hh”#include “phy/FDChannelizer.hh”#include “phy/OverlapTDChannelizer.hh”#include “phy/TDChannelizer.hh”#include “python/PyModules.hh”
Functions
-
void exportChannelizers(py::module &m)
-
void exportChannelizers(py::module &m)
- file Channels.cc
- #include <pybind11/pybind11.h>#include <pybind11/complex.h>#include <pybind11/numpy.h>#include <pybind11/operators.h>#include <pybind11/stl.h>#include “python/PyModules.hh”
Functions
-
void exportChannels(py::module &m)
-
void exportChannels(py::module &m)
- file CIL.cc
- #include <pybind11/pybind11.h>#include <pybind11/stl.h>#include “cil/CIL.hh”#include “cil/Scorer.hh”#include “python/PyModules.hh”
Functions
-
void exportCIL(py::module &m)
-
void exportCIL(py::module &m)
- file Controller.cc
- #include <pybind11/pybind11.h>#include <pybind11/stl.h>#include “llc/Controller.hh”#include “llc/DummyController.hh”#include “llc/SmartController.hh”#include “llc/SmartController/proxies.hh”#include “python/PyModules.hh”
Functions
-
void exportControllers(py::module &m)
-
void exportControllers(py::module &m)
- file Estimator.cc
- #include “Clock.hh”#include “python/PyModules.hh”#include “stats/Estimator.hh”#include “stats/TimeWindowEstimator.hh”
Functions
-
template<class T>
void exportEstimator(py::module &m, const char *name)
-
template<class T>
void exportMeanEstimator(py::module &m, const char *name)
-
template<class T>
void exportWindowedMeanEstimator(py::module &m, const char *name)
-
template<class Clock, class T>
void exportTimeWindowEstimator(py::module &m, const char *name)
-
template<class Clock, class T>
void exportTimeWindowMeanEstimator(py::module &m, const char *name)
-
template<class Clock, class T>
void exportTimeWindowMeanRateEstimator(py::module &m, const char *name)
-
template<class Clock, class T>
void exportTimeWindowMinEstimator(py::module &m, const char *name)
-
template<class Clock, class T>
void exportTimeWindowMaxEstimator(py::module &m, const char *name)
-
void exportEstimators(py::module &m)
-
template<class T>
- file Flow.cc
- #include <pybind11/pybind11.h>#include <pybind11/stl.h>#include “net/Firewall.hh”#include “net/FlowPerformance.hh”#include “python/PyModules.hh”
Functions
-
void exportFlow(py::module &m)
-
void exportFlow(py::module &m)
- file Header.cc
- #include <pybind11/pybind11.h>#include “Header.hh”#include “python/PyModules.hh”
Functions
-
void exportHeader(py::module &m)
-
void exportHeader(py::module &m)
- file IQBuffer.cc
- #include <pybind11/pybind11.h>#include <pybind11/numpy.h>#include “IQBuffer.hh”#include “python/PyModules.hh”
Typedefs
-
using fc32 = std::complex<float>
Functions
-
void exportIQBuffer(py::module &m)
-
using fc32 = std::complex<float>
- file Liquid.cc
- #include <pybind11/pybind11.h>#include <pybind11/numpy.h>#include <pybind11/stl.h>#include “liquid/FlexFrame.hh”#include “liquid/NewFlexFrame.hh”#include “liquid/OFDM.hh”#include “python/PyModules.hh”
Typedefs
-
using FrameStats = framesyncstats_s
-
using Demod = std::tuple<std::optional<Header>, std::optional<py::bytes>, FrameStats>
Functions
-
std::vector<Demod> demodulate(liquid::Demodulator &demod, py::array_t<std::complex<float>, py::array::c_style | py::array::forcecast> sig)
-
void exportLiquid(py::module &m)
-
using FrameStats = framesyncstats_s
- file NCO.cc
- #include <pybind11/pybind11.h>#include <pybind11/numpy.h>#include “dsp/NCO.hh”#include “dsp/TableNCO.hh”#include “liquid/NCO.hh”#include “python/PyModules.hh”
Functions
-
void exportNCOs(py::module &m)
-
void exportNCOs(py::module &m)
- file Net.cc
- #include <pybind11/pybind11.h>#include <pybind11/stl.h>#include “RadioNet.hh”#include “net/MandateQueue.hh”#include “net/NetFilter.hh”#include “net/Noop.hh”#include “net/PacketCompressor.hh”#include “net/REDQueue.hh”#include “net/SimpleQueue.hh”#include “net/SizedQueue.hh”#include “net/TailDropQueue.hh”#include “net/Queue.hh”#include “python/PyModules.hh”#include “util/net.hh”
- file py_shared_ptr.hh
- file PyModules.hh
- #include <pybind11/pybind11.h>#include <pybind11/stl_bind.h>#include “phy/Channel.hh”#include “python/capsule.hh”#include “net/Element.hh”
Typedefs
-
template<typename D>
using NetInWrapper = PortWrapper<In, D, std::shared_ptr<NetPacket>>
-
template<typename D>
using NetOutWrapper = PortWrapper<Out, D, std::shared_ptr<NetPacket>>
-
using NetInPush = NetInWrapper<Push>
-
using NetInPull = NetInWrapper<Pull>
-
using NetOutPush = NetOutWrapper<Push>
-
using NetOutPull = NetOutWrapper<Pull>
-
template<typename D>
using RadioInWrapper = PortWrapper<In, D, std::shared_ptr<RadioPacket>>
-
template<typename D>
using RadioOutWrapper = PortWrapper<Out, D, std::shared_ptr<RadioPacket>>
-
using RadioInPush = RadioInWrapper<Push>
-
using RadioInPull = RadioInWrapper<Pull>
-
using RadioOutPush = RadioOutWrapper<Push>
-
using RadioOutPull = RadioOutWrapper<Pull>
Functions
-
void exportClock(py::module &m)
-
void exportLogger(py::module &m)
-
void exportWorkQueue(py::module &m)
-
void exportUSRP(py::module &m)
-
void exportEstimators(py::module &m)
-
void exportNet(py::module &m)
-
void exportNetUtil(py::module &m)
-
void exportCIL(py::module &m)
-
void exportFlow(py::module &m)
-
void exportRadioNet(py::module &m)
-
void exportHeader(py::module &m)
-
void exportPacket(py::module &m)
-
void exportModem(py::module &m)
-
void exportLiquid(py::module &m)
-
void exportPHYs(py::module &m)
-
void exportLiquidPHYs(py::module &m)
-
void exportChannels(py::module &m)
-
void exportChannelizers(py::module &m)
-
void exportSynthesizers(py::module &m)
-
void exportControllers(py::module &m)
-
void exportMACs(py::module &m)
-
void exportResamplers(py::module &m)
-
void exportNCOs(py::module &m)
-
void exportFilters(py::module &m)
-
void exportIQBuffer(py::module &m)
-
void exportIQCompression(py::module &m)
-
void exportSnapshot(py::module &m)
-
template<typename D>
- file Python.cc
- #include <pybind11/embed.h>#include “python/PyModules.hh”
Functions
-
PYBIND11_EMBEDDED_MODULE(_dragonradio, m)
-
PYBIND11_EMBEDDED_MODULE(_dragonradio, m)
- file RadioNet.cc
- #include <pybind11/pybind11.h>#include <pybind11/functional.h>#include <pybind11/stl.h>#include “RadioNet.hh”#include “python/PyModules.hh”
Functions
-
void exportRadioNet(py::module &m)
-
void exportRadioNet(py::module &m)
- file RadioNet.cc
- #include <sys/types.h>#include <netinet/if_ether.h>#include <netinet/in.h>#include <netinet/ip.h>#include <cstddef>#include <cstring>#include <functional>#include “RadioNet.hh”
- file Synthesizer.cc
- #include <pybind11/pybind11.h>#include <pybind11/complex.h>#include <pybind11/numpy.h>#include <pybind11/stl.h>#include “phy/Channel.hh”#include “phy/FDChannelModulator.hh”#include “phy/MultichannelSynthesizer.hh”#include “phy/ParallelChannelSynthesizer.inl”#include “phy/SlotSynthesizer.hh”#include “phy/Synthesizer.hh”#include “phy/TDChannelModulator.hh”#include “phy/UnichannelSynthesizer.inl”#include “python/PyModules.hh”
Functions
-
void exportSynthesizers(py::module &m)
-
void exportSynthesizers(py::module &m)
- file USRP.cc
- #include <pybind11/stl.h>#include “USRP.hh”#include “python/PyModules.hh”
Functions
-
void exportUSRP(py::module &m)
-
void exportUSRP(py::module &m)
- file USRP.cc
- #include <sys/types.h>#include <sys/time.h>#include <atomic>#include “logging.hh”#include “Clock.hh”#include “USRP.hh”#include “util/capabilities.hh”
Variables
-
const int kMaxLOLockCount = 100
-
const int kMaxLOLockCount = 100
- file WorkQueue.cc
- #include “WorkQueue.hh”#include “python/PyModules.hh”
Functions
-
void exportWorkQueue(py::module &m)
-
void exportWorkQueue(py::module &m)
- file WorkQueue.cc
- #include “WorkQueue.hh”
- file RadioNet.hh
- #include <math.h>#include <functional>#include <map>#include <mutex>#include <unordered_map>#include <unordered_set>#include <optional>#include <queue>#include <thread>#include <vector>#include “Packet.hh”#include “net/TunTap.hh”
Typedefs
-
using timestamp_map = std::unordered_map<TimestampSeq, MonoClock::time_point>
Map from timestamp sequence number to timestamp.
-
using timestamps_map = std::unordered_map<TimestampSeq, std::pair<MonoClock::time_point, MonoClock::time_point>>
Map from timestamp sequence number to pair of sent, received timestamps.
-
using timestampseq_set = std::unordered_set<TimestampSeq>
Vector of pairs of timestamps.
-
using timestamp_map = std::unordered_map<TimestampSeq, MonoClock::time_point>
- file SafeQueue.hh
- #include <condition_variable>#include <deque>#include <mutex>
- file Seq.hh
- #include <sys/types.h>#include <limits>
- file Estimator.hh
- #include <assert.h>#include <vector>
- file TimeWindowEstimator.hh
- #include <deque>#include <limits>#include “Estimator.hh”
- file TimerQueue.cc
- #include <algorithm>#include “TimerQueue.hh”#include “util/threads.hh”
- file TimerQueue.hh
- #include <chrono>#include <functional>#include <mutex>#include <queue>#include <thread>#include <unordered_map>#include “heap.hh”#include “Clock.hh”
- file USRP.hh
- #include <atomic>#include <deque>#include <string>#include <thread>#include <uhd/usrp/multi_usrp.hpp>#include “logging.hh”#include “Clock.hh”#include “IQBuffer.hh”
- file capabilities.hh
- #include <sys/capability.h>
- file exec.cc
- #include <sys/types.h>#include <sys/wait.h>#include <unistd.h>#include “logging.hh”#include “util/exec.hh”
Functions
-
int exec(const std::vector<std::string> &args)
Exec a command.
-
int exec(const std::vector<std::string> &args)
- file exec.hh
- #include <string>#include <vector>
Functions
-
int exec(const std::vector<std::string>&)
Exec a command.
-
int exec(const std::vector<std::string>&)
- file net.cc
- #include “logging.hh”#include “util/capabilities.hh”#include “util/net.hh”#include <sys/types.h>#include <sys/ioctl.h>#include <net/route.h>#include <netinet/if_ether.h>
Functions
-
struct sockaddr parseIP(const std::string &s)
Parse an IP address.
-
void addStaticARPEntry(const std::optional<std::string> &dev, const std::string &ipaddr, const std::string &macaddr)
Add a static ARP table entry.
-
void deleteARPEntry(const std::optional<std::string> &dev, const std::string &ipaddr)
Delete a static ARP table entry.
-
void addRoute(const std::string &dst, const std::string &mask, const std::string &gateway)
Add an IP route.
-
void deleteRoute(const std::string &dst, const std::string &mask)
Delete an IP route.
-
struct sockaddr parseIP(const std::string &s)
- file net.hh
- #include <sys/types.h>#include <string.h>#include “Packet.hh”
Functions
-
inline uint32_t mkBroadcastAddress(uint32_t addr, uint32_t netmask)
Compute broadcast address from address and netmask
-
inline bool isEthernetBroadcast(const u_char *host)
Determine whether or not an Ethernet address is a broadcast address.
-
struct sockaddr parseMAC(const std::string &s)
Parse a MAC address.
-
struct sockaddr parseIP(const std::string &s)
Parse an IP address.
-
void addStaticARPEntry(const std::optional<std::string> &dev, const std::string &ipaddr, const std::string &macaddr)
Add a static ARP table entry.
-
void deleteARPEntry(const std::optional<std::string> &dev, const std::string &ipaddr)
Delete a static ARP table entry.
-
void addRoute(const std::string &dst, const std::string &mask, const std::string &gateway)
Add an IP route.
-
void deleteRoute(const std::string &dst, const std::string &mask)
Delete an IP route.
-
inline uint32_t mkBroadcastAddress(uint32_t addr, uint32_t netmask)
- file sprintf.cc
- #include <stdarg.h>#include <memory>#include “util/sprintf.hh”
Functions
-
std::string sprintf(const char *fmt, ...)
sprintf to a std::string.
-
std::string sprintf(const char *fmt, ...)
- file sprintf.hh
- #include <string>
Functions
-
std::string sprintf(const char *fmt, ...)
sprintf to a std::string.
-
std::string sprintf(const char *fmt, ...)
- file threads.cc
- #include <math.h>#include <atomic>#include <uhd/utils/thread_priority.hpp>#include “logging.hh”#include “util/capabilities.hh”#include “util/threads.hh”
Functions
-
void setRealtimePriority(pthread_t t)
-
void makeThisThreadHighPriority(void)
Make current thread high-priority.
-
void pinThreadToCPU(pthread_t t, int cpu_num)
Pin thread to given CPU.
-
void pinThisThread(void)
Pin this thread to a CPU.
-
int doze(double sec)
Sleep for the specified number of seconds. sleep, usleep, and nanosleep were already taken, so this function is named “doze.”.
- Parameters
sec – The number of seconds to sleep.
- Returns
-1 if interrupted.
-
static void dummySignalHandler(int)
-
void makeThreadWakeable(void)
Make the current thread wakeable.
This function installs a signal handler for SIGUSR1 so that the thread can be woken from a blocking sycall via wakeThread.
-
void wakeThread(std::thread &t)
Wake the given thread.
This function sends a SIGUSR1 signal to the given thread to wake it from any blocking syscalls.
-
void setRealtimePriority(pthread_t t)
- file threads.hh
- #include <signal.h>#include <unistd.h>#include <thread>
Functions
-
void setRealtimePriority(void)
Make thread have real-time priority.
-
void makeThisThreadHighPriority(void)
Make current thread high-priority.
-
void pinThreadToCPU(pthread_t t, int cpu_num)
Pin thread to given CPU.
-
void pinThisThread(void)
Pin this thread to a CPU.
-
int doze(double sec)
Sleep for the specified number of seconds. sleep, usleep, and nanosleep were already taken, so this function is named “doze.”.
- Parameters
sec – The number of seconds to sleep.
- Returns
-1 if interrupted.
-
void makeThreadWakeable(void)
Make the current thread wakeable.
This function installs a signal handler for SIGUSR1 so that the thread can be woken from a blocking sycall via wakeThread.
-
void wakeThread(std::thread &t)
Wake the given thread.
This function sends a SIGUSR1 signal to the given thread to wake it from any blocking syscalls.
Variables
-
const int SIGWAKE = SIGUSR1
The signal we use to wake a thread.
-
void setRealtimePriority(void)
- file WorkQueue.hh
- #include <functional>#include <thread>#include <vector>#include “SafeQueue.hh”
Variables
-
WorkQueue work_queue
The global work queue.
-
WorkQueue work_queue
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/cil
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/dsp
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/IQCompression
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/liquid
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/llc
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/mac
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/net
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/phy
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/python
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/llc/SmartController
- dir /home/mainland/projects/dragonradio/dragonradio-local/src
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/stats
- dir /home/mainland/projects/dragonradio/dragonradio-local/src/util