libcyberradio 22.01.24
SimpleIpSetup.h
1/***************************************************************************
2 * \file SimpleIpSetup.h
3 * \brief Defines a simple 1Gig data for NDR-class radios without 10Gig
4 * ports.
5 * \author DA
6 * \author NH
7 * \author MN
8 * \copyright (c) 2017 CyberRadio Solutions, Inc. All rights reserved.
9 *
10 ***************************************************************************/
11
12#ifndef INCLUDED_LIBCYBERRADIO_DRIVER_SIMPLEIPSETUP_H
13#define INCLUDED_LIBCYBERRADIO_DRIVER_SIMPLEIPSETUP_H
14
15#include "LibCyberRadio/Driver/Configurable.h"
16#include "LibCyberRadio/Common/BasicDict.h"
17#include "LibCyberRadio/Common/BasicList.h"
18#include <string>
19
20
24namespace LibCyberRadio
25{
29 namespace Driver
30 {
31 // Forward declaration for RadioHandler object
32 class RadioHandler;
33
47 {
48 public:
59 SimpleIpSetup(const std::string& name = "SIMPLEIPSETUP",
60 RadioHandler* parent = NULL,
61 bool debug = false,
62 const std::string& sourceIP = "0.0.0.0",
63 const std::string& destIP = "0.0.0.0",
64 const std::string& destMAC = "00:00:00:00:00:00");
68 virtual ~SimpleIpSetup();
73 SimpleIpSetup(const SimpleIpSetup& other);
79 virtual SimpleIpSetup& operator=(const SimpleIpSetup& other);
80 // Configurable interface
87 virtual bool setConfiguration(ConfigurationDict& cfg);
91 virtual void queryConfiguration();
92 // SimpleIpSetup extensions
97 virtual std::string getSourceMAC() const;
102 virtual std::string getSourceIP() const;
108 virtual bool setSourceIP(const std::string& ipAddr);
113 virtual std::string getDestMACAddress() const;
118 virtual std::string getDestIPAddress() const;
124 virtual bool setDestMACAddress(const std::string& macAddr);
130 virtual bool setDestIPAddress(const std::string& ipAddr);
131
132 protected:
133 // Configurable interface
138 virtual void initConfigurationDict();
142 virtual void updateConfigurationDict();
143 // SimpleIpSetup extensions
152 virtual bool executeSourceMACQuery(std::string& macAddr);
161 virtual bool executeSourceIPQuery(std::string& ipAddr);
167 virtual bool executeSourceIPCommand(std::string& ipAddr);
176 virtual bool executeDestIPQuery(std::string& ipAddr);
182 virtual bool executeDestIPCommand(std::string& ipAddr);
191 virtual bool executeDestMACQuery(std::string& macAddr);
197 virtual bool executeDestMACCommand(std::string& macAddr);
198
199 protected:
200 // Parent radio handler object
201 RadioHandler* _parent;
202 // Source IP address
203 std::string _sourceIP;
204 // Source MAC address
205 std::string _sourceMAC;
206 // Destination IP address
207 std::string _destIP;
208 // Destination MAC address
209 std::string _destMAC;
210
211 }; /* class SimpleIpSetup */
212
216 typedef BASIC_DICT_CONTAINER<int, SimpleIpSetup*> SimpleIpSetupDict;
217
218 } /* namespace Driver */
219
220} /* namespace LibCyberRadio */
221
222#endif /* INCLUDED_LIBCYBERRADIO_DRIVER_SIMPLEIPSETUP_H */
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.
Generic radio handler class.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this object.
virtual SimpleIpSetup & operator=(const SimpleIpSetup &other)
Assignment operator for SimpleIpSetup objects.
SimpleIpSetup(const std::string &name="SIMPLEIPSETUP", RadioHandler *parent=NULL, bool debug=false, const std::string &sourceIP="0.0.0.0", const std::string &destIP="0.0.0.0", const std::string &destMAC="00:00:00:00:00:00")
Constructs a SimpleIpSetup object.
virtual bool executeDestMACQuery(std::string &macAddr)
Executes the destination MAC query command.
virtual bool setSourceIP(const std::string &ipAddr)
Sets the source IP address.
virtual std::string getSourceIP() const
Gets the source IP address.
virtual bool setDestIPAddress(const std::string &ipAddr)
Sets the destination IP address.
virtual bool executeDestMACCommand(std::string &macAddr)
Executes the destination MAC set command.
virtual std::string getSourceMAC() const
Gets the source MAC address.
virtual void queryConfiguration()
Tells the object to create its configuration dictionary.
virtual std::string getDestMACAddress() const
Gets the destination MAC address.
virtual std::string getDestIPAddress() const
Gets the destination IP address.
virtual bool executeSourceMACQuery(std::string &macAddr)
Executes the source MAC query command.
virtual bool executeDestIPQuery(std::string &ipAddr)
Executes the destination IP query command.
virtual void updateConfigurationDict()
Updates the configuration dictionary from object settings.
virtual bool executeSourceIPCommand(std::string &ipAddr)
Executes the source IP set command.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual bool setDestMACAddress(const std::string &macAddr)
Sets the destination MAC address.
virtual bool executeSourceIPQuery(std::string &ipAddr)
Executes the source IP query command.
virtual ~SimpleIpSetup()
Destroys a SimpleIpSetup object.
virtual bool executeDestIPCommand(std::string &ipAddr)
Executes the destination IP set command.
Provides programming elements for driving CRS NDR-class radios.
BASIC_DICT_CONTAINER< int, SimpleIpSetup * > SimpleIpSetupDict
A dictionary of data ports, keyed by index.
Defines functionality for LibCyberRadio applications.
Definition App.h:24