![]() |
libcyberradio
22.01.24
|
10GigE data port class. More...
#include <DataPort.h>
Public Member Functions | |
| 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. More... | |
| virtual | ~DataPort () |
| Destroys a DataPort object. | |
| DataPort (const DataPort &other) | |
| Copies a DataPort object. More... | |
| virtual DataPort & | operator= (const DataPort &other) |
| Assignment operator for DataPort objects. More... | |
| virtual bool | setConfiguration (ConfigurationDict &cfg) |
| Sets the configuration dictionary for this object. More... | |
| virtual void | queryConfiguration () |
| Tells the object to create its configuration dictionary. | |
| virtual int | getNumDestEntries () const |
| Gets the number of destination IP table entries. More... | |
| virtual BasicIntList | getDestEntryIndexRange () const |
| Gets the list of destination IP table entry indices. More... | |
| virtual std::string | getSourceIP () const |
| Gets the source IP address. More... | |
| virtual bool | setSourceIP (const std::string &ipAddr) |
| Sets the source IP address. More... | |
| virtual std::string | getDestMACAddress (int dipIndex) const |
| Gets the MAC address for a given entry in the destination IP table. More... | |
| virtual std::string | getDestIPAddress (int dipIndex) const |
| Gets the IP address for a given entry in the destination IP table. More... | |
| virtual unsigned int | getDestSourcePort (int dipIndex) const |
| Gets the source UDP port number for a given entry in the destination IP table. More... | |
| virtual unsigned int | getDestDestPort (int dipIndex) const |
| Gets the destination UDP port number for a given entry in the destination IP table. More... | |
| 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. More... | |
| virtual bool | setDestMACAddress (int dipIndex, const std::string &macAddr) |
| Sets the MAC address for a given entry in the destination IP table. More... | |
| virtual bool | setDestIPAddress (int dipIndex, const std::string &ipAddr) |
| Sets the IP address for a given entry in the destination IP table. More... | |
| virtual bool | setDestSourcePort (int dipIndex, unsigned int sourcePort) |
| Sets the source UDP port number for a given entry in the destination IP table. More... | |
| virtual bool | setDestDestPort (int dipIndex, unsigned int destPort) |
| Sets the destination UDP port number for a given entry in the destination IP table. More... | |
| virtual bool | enableErrors (bool enabled=true) |
| Enables errors on the data port. More... | |
| virtual bool | disableErrors () |
| Disables errors on the data port. More... | |
| virtual bool | enableFlowControl (bool enabled=true) |
| Enables flow control on the data port. More... | |
| virtual bool | disableFlowControl () |
| Disables flow control on the data port. More... | |
| virtual std::string | getName () const |
| Gets the name of the configurable object. More... | |
| virtual void | setName (const std::string &name) |
| Sets the name of the configurable object. More... | |
| virtual ConfigurationDict | getConfiguration () const |
| Gets the configuration dictionary for this object. More... | |
| virtual ConfigString | getConfigurationValue (const std::string &key) const |
| Gets a named configuration value as a string. More... | |
| virtual bool | getConfigurationValueAsBool (const std::string &key) const |
| Gets a named configuration value as a Boolean. More... | |
| virtual int | getConfigurationValueAsInt (const std::string &key) const |
| Gets a named configuration value as an integer value. More... | |
| virtual unsigned int | getConfigurationValueAsUInt (const std::string &key) const |
| Gets a named configuration value as an unsigned integer value. More... | |
| virtual double | getConfigurationValueAsDbl (const std::string &key) const |
| Gets a named configuration value as a double value. More... | |
| virtual bool | setConfigurationValue (const std::string &key, const std::string &value) |
| Sets a named configuration value to a string. More... | |
| virtual bool | setConfigurationValueToBool (const std::string &key, const bool value) |
| Sets a named configuration value to a Boolean. More... | |
| virtual bool | setConfigurationValueToInt (const std::string &key, const int value) |
| Sets a named configuration value to an integer value. More... | |
| virtual bool | setConfigurationValueToUInt (const std::string &key, const unsigned int value) |
| Sets a named configuration value to an unsigned integer value. More... | |
| virtual bool | setConfigurationValueToDbl (const std::string &key, const double value) |
| Sets a named configuration value to a double value. More... | |
| virtual void | setDebugName (const std::string &debug_name) |
| Sets the debug name for this object. More... | |
| virtual void | setDebugFile (FILE *debug_fp) |
| Sets the debug file pointer for this object. More... | |
| virtual void | setDebugTimeFormat (const std::string &debug_timefmt) |
| Sets the debug time format for this object. More... | |
| virtual int | debug (const char *format,...) |
| Outputs debug information. More... | |
| virtual const char * | debugBool (bool x) |
| Gets a debug output string for a Boolean value. More... | |
| virtual bool | isDebug () const |
| Gets whether this object produces debug output. More... | |
| virtual std::string | getDebugName () const |
| Gets the debug name for this object. More... | |
| virtual std::string | rawString (const std::string &data) |
| Gets a "raw" string representation of a given data string. More... | |
Protected Member Functions | |
| virtual void | initConfigurationDict () |
| Initializes the configuration dictionary, defining the allowed keys. | |
| virtual void | updateConfigurationDict () |
| Updates the configuration dictionary from object settings. | |
| virtual bool | executeSourceIPQuery (int index, std::string &ipAddr) |
| Executes the source IP query command. More... | |
| virtual bool | executeSourceIPCommand (int index, std::string &ipAddr) |
| Executes the source IP set command. More... | |
| 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. More... | |
| 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. More... | |
| virtual bool | executeErrorEnabledQuery (int index, bool &enabled) |
| Executes the error enabled query. More... | |
| virtual bool | executeErrorEnabledCommand (int index, bool &enabled) |
| Executes the error enabled command. More... | |
| virtual bool | executeFlowControlEnabledQuery (int index, bool &enabled) |
| Executes the flow control enabled query. More... | |
| virtual bool | executeFlowControlEnabledCommand (int index, bool &enabled) |
| Executes the flow control enabled command. More... | |
| virtual ConfigurationDict | normalizedConfigurationDict (const ConfigurationDict &cfg) |
| Normalizes an incoming configuration dictionary. More... | |
| virtual std::string | normalizedBool (const std::string &val) |
| Normalizes a Boolean string value. More... | |
| virtual void | dumpConfiguration () |
| Dumps this object's configuration dictionary to debug output. | |
10GigE data port class.
A radio handler object maintains one DataPort object for each 10GigE data port on the radio.
Configuration dictionary items:
Definition at line 45 of file DataPort.h.
| 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.
| name | The name of this configurable object. |
| index | The index number of this object. |
| parent | A pointer to the RadioHandler object that "owns" this object. |
| debug | Whether the object supports debug output. |
| sourceIP | Source IP address. |
| numDataPortDipEntries | Number of entries in the DIP table. |
| dataPortDipEntryIndexBase | Where DIP entries are numbered from. |
Definition at line 25 of file DataPort.cpp.
Copies a DataPort object.
| other | The DataPort object to copy. |
Definition at line 48 of file DataPort.cpp.
|
virtualinherited |
Outputs debug information.
This method follows the same semantics as printf(). Output is preceded by a timestamp and the name of the object, if provided.
| format | The printf()-style format string. |
| ... | Comma-separated list of arguments to print. Note that these need to be arguments that can be supported natively through printf(). |
Definition at line 95 of file Debuggable.cpp.
|
virtualinherited |
Gets a debug output string for a Boolean value.
| x | Boolean value |
Definition at line 126 of file Debuggable.cpp.
|
virtual |
Disables errors on the data port.
Definition at line 276 of file DataPort.cpp.
|
virtual |
Disables flow control on the data port.
Definition at line 297 of file DataPort.cpp.
|
virtual |
Enables errors on the data port.
| enabled | Whether or not errors should be enabled. |
Definition at line 260 of file DataPort.cpp.
|
virtual |
Enables flow control on the data port.
| enabled | Whether or not errors should be enabled. |
Definition at line 281 of file DataPort.cpp.
|
protectedvirtual |
Executes the destination IP set command.
| index | Data port index. |
| dipIndex | DIP table entry index. |
| ipAddr | Destination IP address. |
| macAddr | Destination MAC address. |
| sourcePort | Source UDP port. |
| destPort | Destination UDP port. |
Reimplemented in DataPort.
Definition at line 418 of file DataPort.cpp.
|
protectedvirtual |
Executes the destination IP query command.
| index | Data port index. |
| dipIndex | DIP table entry index. |
| ipAddr | Destination IP address (return). |
| macAddr | Destination MAC address (return). |
| sourcePort | Source UDP port (return). |
| destPort | Destination UDP port (return). |
Reimplemented in DataPort.
Definition at line 367 of file DataPort.cpp.
|
protectedvirtual |
Executes the error enabled command.
| index | Data port index. |
| enabled | Error enabled. |
Definition at line 470 of file DataPort.cpp.
|
protectedvirtual |
Executes the error enabled query.
| index | Data port index. |
| enabled | Error enabled [output]. |
Definition at line 446 of file DataPort.cpp.
|
protectedvirtual |
Executes the flow control enabled command.
| index | Data port index. |
| enabled | Flow control enabled. |
Definition at line 513 of file DataPort.cpp.
|
protectedvirtual |
Executes the flow control enabled query.
| index | Data port index. |
| enabled | Flow control enabled [output]. |
Definition at line 489 of file DataPort.cpp.
|
protectedvirtual |
Executes the source IP set command.
| index | Data port index. |
| ipAddr | Source IP address (return). |
Reimplemented in DataPort.
Definition at line 348 of file DataPort.cpp.
|
protectedvirtual |
Executes the source IP query command.
| index | Data port index. |
| ipAddr | Source IP address (return). |
Reimplemented in DataPort.
Definition at line 325 of file DataPort.cpp.
|
virtualinherited |
Gets the configuration dictionary for this object.
Definition at line 93 of file Configurable.cpp.
|
virtualinherited |
Gets a named configuration value as a string.
| key | The key string in the configuration dictionary. |
Definition at line 98 of file Configurable.cpp.
|
virtualinherited |
Gets a named configuration value as a Boolean.
| key | The key string in the configuration dictionary. |
Definition at line 109 of file Configurable.cpp.
|
virtualinherited |
Gets a named configuration value as a double value.
| key | The key string in the configuration dictionary. |
Definition at line 148 of file Configurable.cpp.
|
virtualinherited |
Gets a named configuration value as an integer value.
| key | The key string in the configuration dictionary. |
Definition at line 122 of file Configurable.cpp.
|
virtualinherited |
Gets a named configuration value as an unsigned integer value.
| key | The key string in the configuration dictionary. |
Definition at line 135 of file Configurable.cpp.
|
virtualinherited |
Gets the debug name for this object.
Definition at line 138 of file Debuggable.cpp.
|
virtual |
Gets the destination UDP port number for a given entry in the destination IP table.
| dipIndex | Index number for the entry in the DIP table. |
Definition at line 193 of file DataPort.cpp.
|
virtual |
Gets the list of destination IP table entry indices.
Definition at line 136 of file DataPort.cpp.
|
virtual |
Gets the IP address for a given entry in the destination IP table.
| dipIndex | Index number for the entry in the DIP table. |
Definition at line 177 of file DataPort.cpp.
|
virtual |
Gets the MAC address for a given entry in the destination IP table.
| dipIndex | Index number for the entry in the DIP table. |
Definition at line 169 of file DataPort.cpp.
|
virtual |
Gets the source UDP port number for a given entry in the destination IP table.
| dipIndex | Index number for the entry in the DIP table. |
Definition at line 185 of file DataPort.cpp.
|
virtualinherited |
Gets the name of the configurable object.
Definition at line 83 of file Configurable.cpp.
|
virtual |
Gets the number of destination IP table entries.
Definition at line 131 of file DataPort.cpp.
|
virtual |
Gets the source IP address.
Definition at line 148 of file DataPort.cpp.
|
virtualinherited |
Gets whether this object produces debug output.
Definition at line 133 of file Debuggable.cpp.
|
protectedvirtualinherited |
Normalizes a Boolean string value.
Definition at line 241 of file Configurable.cpp.
|
protectedvirtualinherited |
Normalizes an incoming configuration dictionary.
"Normalizing" a configuration dictionary replaces certain strings representing Boolean values ("yes", "on", "true", "no", "off", and "false", case is irrelevant) with standard values ("0" and "1").
Definition at line 232 of file Configurable.cpp.
Assignment operator for DataPort objects.
| other | The DataPort object to copy. |
Definition at line 64 of file DataPort.cpp.
|
virtualinherited |
Gets a "raw" string representation of a given data string.
"Raw" string representations mimic Python string representations. Whitespace characters are denoted by backslash representations ("\\r", "\\n", "\\t", "\\v", "\\f"), while other non-printable characters are represented with hex representation ("\\x00", etc.)
| data | Data string |
Definition at line 143 of file Debuggable.cpp.
|
virtual |
Sets the configuration dictionary for this object.
| cfg | The configuration dictionary. |
Reimplemented from Configurable.
Definition at line 84 of file DataPort.cpp.
|
virtualinherited |
Sets a named configuration value to a string.
| key | The key string in the configuration dictionary. |
| value | The new value. |
Definition at line 177 of file Configurable.cpp.
|
virtualinherited |
Sets a named configuration value to a Boolean.
| key | The key string in the configuration dictionary. |
| value | The new value. |
Definition at line 193 of file Configurable.cpp.
|
virtualinherited |
Sets a named configuration value to a double value.
| key | The key string in the configuration dictionary. |
| value | The new value. |
Definition at line 211 of file Configurable.cpp.
|
virtualinherited |
Sets a named configuration value to an integer value.
| key | The key string in the configuration dictionary. |
| value | The new value. |
Definition at line 199 of file Configurable.cpp.
|
virtualinherited |
Sets a named configuration value to an unsigned integer value.
| key | The key string in the configuration dictionary. |
| value | The new value. |
Definition at line 205 of file Configurable.cpp.
|
virtualinherited |
Sets the debug file pointer for this object.
| debug_fp | File to send debug output to. |
Definition at line 81 of file Debuggable.cpp.
|
virtualinherited |
Sets the debug name for this object.
Use this method to set unique debug names for objects of the same class for easy differentiation.
| debug_name | Name for identifying this object in debug output. |
Definition at line 74 of file Debuggable.cpp.
|
virtualinherited |
Sets the debug time format for this object.
| debug_timefmt | Format string for displaying timestamp, as compatible with strftime(). If this is an empty string, don't display a timestamp. |
Definition at line 88 of file Debuggable.cpp.
|
virtual |
Sets the destination UDP port number for a given entry in the destination IP table.
| dipIndex | Index number for the entry in the DIP table. |
| destPort | The destination UDP port number. |
Definition at line 251 of file DataPort.cpp.
|
virtual |
Sets the destination table information for a given entry in the DIP table.
| dipIndex | Index number for the entry in the DIP table. |
| ipAddr | The IP address. |
| macAddr | The MAC address. |
| sourcePort | The source UDP port number. |
| destPort | The destination UDP port number. |
Definition at line 201 of file DataPort.cpp.
|
virtual |
Sets the IP address for a given entry in the destination IP table.
| dipIndex | Index number for the entry in the DIP table. |
| ipAddr | The new IP address. |
Definition at line 233 of file DataPort.cpp.
|
virtual |
Sets the MAC address for a given entry in the destination IP table.
| dipIndex | Index number for the entry in the DIP table. |
| macAddr | The new MAC address. |
Definition at line 224 of file DataPort.cpp.
|
virtual |
Sets the source UDP port number for a given entry in the destination IP table.
| dipIndex | Index number for the entry in the DIP table. |
| sourcePort | The source UDP port number. |
Definition at line 242 of file DataPort.cpp.
|
virtualinherited |
Sets the name of the configurable object.
| name | The new name. |
Definition at line 88 of file Configurable.cpp.
|
virtual |
Sets the source IP address.
| ipAddr | The new source IP address. |
Definition at line 153 of file DataPort.cpp.