libcyberradio  22.01.24
DataPort.h
1 /***************************************************************************
2  * \file DataPort.h
3  * \brief Defines the 10GigE data port interface for an NDR551.
4  * \author DA
5  * \author NH
6  * \author MN
7  * \copyright (c) 2017 CyberRadio Solutions, Inc. All rights reserved.
8  *
9  ***************************************************************************/
10 
11 #ifndef INCLUDED_LIBCYBERRADIO_DRIVER_NDR551_DATAPORT_H
12 #define INCLUDED_LIBCYBERRADIO_DRIVER_NDR551_DATAPORT_H
13 
14 #include "LibCyberRadio/Driver/DataPort.h"
15 #include <json/json.h>
16 #include <boost/lexical_cast.hpp>
17 #include <string>
18 
22 namespace LibCyberRadio
23 {
27  namespace Driver
28  {
29  // Forward declaration for RadioHandler
30  class RadioHandler;
31 
35  namespace NDR551
36  {
45  {
46  public:
55  DataPort(int index = 0,
56  ::LibCyberRadio::Driver::RadioHandler* parent = NULL,
57  bool debug = false,
58  const std::string& sourceIP = "0.0.0.0");
62  virtual ~DataPort();
67  DataPort(const DataPort& other);
73  virtual DataPort& operator=(const DataPort& other);
78  void initConfigurationDict();
82  void queryConfiguration();
83 
84  protected:
94  bool executeSourceIPQuery(int index, std::string& ipAddr);
101  bool executeSourceIPCommand(int index, std::string& ipAddr);
115  bool executeDestIPQuery(int index,
116  int dipIndex,
117  std::string& ipAddr,
118  std::string& macAddr,
119  unsigned int& sourcePort,
120  unsigned int& destPort);
131  bool executeDestIPCommand(int index,
132  int dipIndex,
133  std::string& ipAddr,
134  std::string& macAddr,
135  unsigned int& sourcePort,
136  unsigned int& destPort);
137 
138  std::string _sourceMacAddr;
139  uint16_t _sourcePort;
140 
141  }; /* class DataPort */
142 
143  } /* namespace NDR551 */
144 
145 
146  } /* namespace Driver */
147 
148 } /* namespace LibCyberRadio */
149 
150 #endif /* INCLUDED_LIBCYBERRADIO_DRIVER_NDR551_DATAPORT_H */
void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
Definition: DataPort.cpp:61
void queryConfiguration()
Updates the configuration dictionary from object settings.
Definition: DataPort.cpp:68
DataPort(int index=0, ::LibCyberRadio::Driver::RadioHandler *parent=NULL, bool debug=false, const std::string &sourceIP="0.0.0.0")
Constructs a DataPort object.
Definition: DataPort.cpp:25
10GigE data port class.
Definition: DataPort.h:45
virtual DataPort & operator=(const DataPort &other)
Assignment operator for DataPort objects.
Definition: DataPort.cpp:52
bool executeDestIPCommand(int index, int dipIndex, std::string &ipAddr, std::string &macAddr, unsigned int &sourcePort, unsigned int &destPort)
Executes the destination IP set command.
Definition: DataPort.cpp:182
bool executeDestIPQuery(int index, int dipIndex, std::string &ipAddr, std::string &macAddr, unsigned int &sourcePort, unsigned int &destPort)
Executes the destination IP query command.
Definition: DataPort.cpp:141
Generic radio handler class.
Definition: RadioHandler.h:54
virtual int debug(const char *format,...)
Outputs debug information.
Definition: Debuggable.cpp:95
Defines functionality for LibCyberRadio applications.
Definition: App.h:23
virtual ~DataPort()
Destroys a DataPort object.
Definition: DataPort.cpp:43
10GigE data port class.
Definition: DataPort.h:44
bool executeSourceIPCommand(int index, std::string &ipAddr)
Executes the source IP set command.
Definition: DataPort.cpp:120
bool executeSourceIPQuery(int index, std::string &ipAddr)
Executes the source IP query command.
Definition: DataPort.cpp:96