12#ifndef INCLUDED_LIBCYBERRADIO_DRIVER_DATAPORT_H
13#define INCLUDED_LIBCYBERRADIO_DRIVER_DATAPORT_H
15#include "LibCyberRadio/Driver/Configurable.h"
16#include "LibCyberRadio/Common/BasicDict.h"
17#include "LibCyberRadio/Common/BasicList.h"
59 DataPort(
const std::string& name =
"DATAPORT",
63 const std::string& sourceIP =
"0.0.0.0",
64 int numDataPortDipEntries = 0,
65 int dataPortDipEntryIndexBase = 0);
114 virtual bool setSourceIP(
const std::string& ipAddr);
154 const std::string& ipAddr,
155 const std::string& macAddr,
156 unsigned int sourcePort,
157 unsigned int destPort);
258 std::string& macAddr,
259 unsigned int& sourcePort,
260 unsigned int& destPort);
274 std::string& macAddr,
275 unsigned int& sourcePort,
276 unsigned int& destPort);
312 std::string _sourceIP;
316 int _dipEntryIndexBase;
320 bool _flowControlEnabled;
virtual int debug(const char *format,...)
Outputs debug information.
Configurable(const std::string &name="<unknown>", bool debug=false)
Constructs a Configurable object.
A configuration dictionary.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this object.
virtual bool executeFlowControlEnabledCommand(int index, bool &enabled)
Executes the flow control enabled command.
virtual bool executeErrorEnabledQuery(int index, bool &enabled)
Executes the error enabled query.
virtual int getNumDestEntries() const
Gets the number of destination IP table entries.
virtual bool executeDestIPCommand(int index, int dipIndex, std::string &ipAddr, std::string &macAddr, unsigned int &sourcePort, unsigned int &destPort)
Executes the destination IP set command.
virtual bool executeDestIPQuery(int index, int dipIndex, std::string &ipAddr, std::string &macAddr, unsigned int &sourcePort, unsigned int &destPort)
Executes the destination IP query command.
virtual BasicIntList getDestEntryIndexRange() const
Gets the list of destination IP table entry indices.
virtual bool setDestInfo(int dipIndex, const std::string &ipAddr, const std::string &macAddr, unsigned int sourcePort, unsigned int destPort)
Sets the destination table information for a given entry in the DIP table.
virtual bool setSourceIP(const std::string &ipAddr)
Sets the source IP address.
DataPort(const std::string &name="DATAPORT", int index=0, RadioHandler *parent=NULL, bool debug=false, const std::string &sourceIP="0.0.0.0", int numDataPortDipEntries=0, int dataPortDipEntryIndexBase=0)
Constructs a DataPort object.
virtual bool setDestMACAddress(int dipIndex, const std::string &macAddr)
Sets the MAC address for a given entry in the destination IP table.
virtual DataPort & operator=(const DataPort &other)
Assignment operator for DataPort objects.
virtual std::string getSourceIP() const
Gets the source IP address.
virtual std::string getDestIPAddress(int dipIndex) const
Gets the IP address for a given entry in the destination IP table.
virtual std::string getDestMACAddress(int dipIndex) const
Gets the MAC address for a given entry in the destination IP table.
virtual ~DataPort()
Destroys a DataPort object.
virtual unsigned int getDestSourcePort(int dipIndex) const
Gets the source UDP port number for a given entry in the destination IP table.
virtual bool executeSourceIPCommand(int index, std::string &ipAddr)
Executes the source IP set command.
virtual bool disableErrors()
Disables errors on the data port.
virtual void queryConfiguration()
Tells the object to create its configuration dictionary.
virtual void updateConfigurationDict()
Updates the configuration dictionary from object settings.
virtual bool setDestIPAddress(int dipIndex, const std::string &ipAddr)
Sets the IP address for a given entry in the destination IP table.
virtual bool enableErrors(bool enabled=true)
Enables errors on the data port.
virtual bool executeSourceIPQuery(int index, std::string &ipAddr)
Executes the source IP query command.
virtual bool executeErrorEnabledCommand(int index, bool &enabled)
Executes the error enabled command.
virtual bool setDestDestPort(int dipIndex, unsigned int destPort)
Sets the destination UDP port number for a given entry in the destination IP table.
virtual bool disableFlowControl()
Disables flow control on the data port.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual bool enableFlowControl(bool enabled=true)
Enables flow control on the data port.
virtual bool setDestSourcePort(int dipIndex, unsigned int sourcePort)
Sets the source UDP port number for a given entry in the destination IP table.
virtual unsigned int getDestDestPort(int dipIndex) const
Gets the destination UDP port number for a given entry in the destination IP table.
virtual bool executeFlowControlEnabledQuery(int index, bool &enabled)
Executes the flow control enabled query.
Generic radio handler class.
Provides programming elements for driving CRS NDR-class radios.
BASIC_DICT_CONTAINER< int, DataPort * > DataPortDict
A dictionary of data ports, keyed by index.
Defines functionality for LibCyberRadio applications.
BASIC_LIST_CONTAINER< int > BasicIntList
Type representing a list of integers.
BASIC_DICT_CONTAINER< int, std::string > BasicIntStringDict
Type representing a dictionary of strings, keyed by integer values.
BASIC_DICT_CONTAINER< int, unsigned int > BasicIntUIntDict
Type representing a dictionary of unsigned integers, keyed by integer values.