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 bool setDestSourcePort(int dipIndex, unsigned int sourcePort)
Sets the source UDP port number for a given entry in the destination IP table.
virtual bool setSourceIP(const std::string &ipAddr)
Sets the source IP address.
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.
BASIC_DICT_CONTAINER< int, std::string > BasicIntStringDict
Type representing a dictionary of strings, keyed by integer values.
virtual bool executeFlowControlEnabledQuery(int index, bool &enabled)
Executes the flow control enabled query.
BASIC_DICT_CONTAINER< int, unsigned int > BasicIntUIntDict
Type representing a dictionary of unsigned integers, keyed by integer values.
virtual unsigned int getDestSourcePort(int dipIndex) const
Gets the source UDP port number for a given entry in the destination IP table.
virtual bool executeErrorEnabledCommand(int index, bool &enabled)
Executes the error enabled command.
virtual std::string getDestIPAddress(int dipIndex) const
Gets the IP address for a given entry in the destination IP table.
virtual BasicIntList getDestEntryIndexRange() const
Gets the list of destination IP table entry indices.
virtual bool enableFlowControl(bool enabled=true)
Enables flow control on the data port.
virtual bool disableFlowControl()
Disables flow control on the data port.
virtual void updateConfigurationDict()
Updates the configuration dictionary from object settings.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this object.
virtual bool setDestMACAddress(int dipIndex, const std::string &macAddr)
Sets the MAC address for a given entry in the destination IP table.
virtual bool disableErrors()
Disables errors on the data port.
virtual std::string getSourceIP() const
Gets the source IP address.
virtual bool enableErrors(bool enabled=true)
Enables errors on the data port.
BASIC_DICT_CONTAINER< int, DataPort * > DataPortDict
A dictionary of data ports, keyed by index.
virtual unsigned int getDestDestPort(int dipIndex) const
Gets the destination UDP port number for a given entry in the destination IP table.
virtual bool executeSourceIPQuery(int index, std::string &ipAddr)
Executes the source IP query command.
Generic radio handler class.
virtual int debug(const char *format,...)
Outputs debug information.
virtual bool executeSourceIPCommand(int index, std::string &ipAddr)
Executes the source IP set command.
Defines functionality for LibCyberRadio applications.
A configuration dictionary.
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 ~DataPort()
Destroys a DataPort 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 DataPort & operator=(const DataPort &other)
Assignment operator for DataPort objects.
virtual bool setDestDestPort(int dipIndex, unsigned int destPort)
Sets the destination UDP port number for a given entry in the destination IP table.
Base configurable object class.
BASIC_LIST_CONTAINER< int > BasicIntList
Type representing a list of integers.
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 bool setDestIPAddress(int dipIndex, const std::string &ipAddr)
Sets the IP address for a given entry in the destination IP table.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
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 void queryConfiguration()
Tells the object to create its configuration dictionary.
virtual std::string getDestMACAddress(int dipIndex) const
Gets the MAC address for a given entry in the destination IP table.