#include <VisionaryAutoIPScan.h>
Classes | |
struct | DeviceInfo |
struct | MacAddress |
Public Types | |
enum | ProtocolType { INVALID_PROTOCOL = -1, COLA_A = 2111, COLA_B = 2112, COLA_2 = 2122 } |
Public Member Functions | |
bool | assign (const MacAddress &destinationMac, ProtocolType colaVer, const std::string &ipAddr, std::uint8_t prefixLength, const std::string &ipGateway=DEFAULT_GATEWAY, bool dhcp=DEFAULT_DHCP, unsigned int timout=DEFAULT_TIMEOUT) |
std::vector< DeviceInfo > | doScan (unsigned int timeOut, std::uint16_t port=DEFAULT_PORT) |
VisionaryAutoIPScan (const std::string &serverIP, std::uint8_t prefixLength) | |
Static Public Member Functions | |
static std::string | convertMacToString (const MacAddress &macAddress) |
static MacAddress | convertMacToStruct (const std::string &basicString) |
Static Public Attributes | |
static const std::string | DEFAULT_BROADCAST_ADDR {"255.255.255.255"} |
static constexpr bool | DEFAULT_DHCP {false} |
static const std::string | DEFAULT_GATEWAY {"0.0.0.0"} |
static const std::string | DEFAULT_IP_MASK {"255.255.255.0"} |
static constexpr std::uint16_t | DEFAULT_PORT {30718u} |
static constexpr std::uint16_t | DEFAULT_TIMEOUT {5000} |
Private Types | |
using | ByteBuffer = std::vector< std::uint8_t > |
Private Member Functions | |
DeviceInfo | parseAutoIPBinary (const ByteBuffer &receivedBuffer) |
DeviceInfo | parseAutoIPXml (std::stringstream &rStringStream) |
Static Private Member Functions | |
static std::vector< std::uint8_t > | convertIpToBinary (const std::string &address) |
static std::string | networkPrefixToMask (std::uint8_t prefixLength) |
Private Attributes | |
std::string | m_serverIP |
std::string | m_serverNetMask |
This class is intended to find devices in the network and set a new IP address
Definition at line 17 of file VisionaryAutoIPScan.h.
|
private |
Definition at line 88 of file VisionaryAutoIPScan.h.
Enumerator | |
---|---|
INVALID_PROTOCOL | |
COLA_A | |
COLA_B | |
COLA_2 |
Definition at line 27 of file VisionaryAutoIPScan.h.
visionary::VisionaryAutoIPScan::VisionaryAutoIPScan | ( | const std::string & | serverIP, |
std::uint8_t | prefixLength | ||
) |
Constructor for the AutoIP scan
serverIP | ip address of the server which is executing the search |
prefixLength | the network prefix length of the server in the CIDR manner |
Definition at line 474 of file VisionaryAutoIPScan.cpp.
bool visionary::VisionaryAutoIPScan::assign | ( | const MacAddress & | destinationMac, |
VisionaryAutoIPScan::ProtocolType | colaVer, | ||
const std::string & | ipAddr, | ||
std::uint8_t | prefixLength, | ||
const std::string & | ipGateway = DEFAULT_GATEWAY , |
||
bool | dhcp = DEFAULT_DHCP , |
||
unsigned int | timout = DEFAULT_TIMEOUT |
||
) |
Assigns a new ip configuration to a device based on the MAC address
destinationMac | MAC address of the device on to which to assign the new configuration |
colaVer | cola version of the device |
ipAddr | new ip address of the device |
prefixLength | the network prefix length of the server in the CIDR manner |
ipGateway | new gateway of the device |
dhcp | true if dhcp should be enabled |
timout | timeout in ms |
Definition at line 513 of file VisionaryAutoIPScan.cpp.
|
staticprivate |
Definition at line 499 of file VisionaryAutoIPScan.cpp.
|
static |
Definition at line 651 of file VisionaryAutoIPScan.cpp.
|
static |
Definition at line 633 of file VisionaryAutoIPScan.cpp.
std::vector< VisionaryAutoIPScan::DeviceInfo > visionary::VisionaryAutoIPScan::doScan | ( | unsigned int | timeOut, |
std::uint16_t | port = DEFAULT_PORT |
||
) |
Runs an autoIP scan and returns a list of devices
timeOut | timout of the search in ms |
broadcastAddress | broadcast address for the scan |
port | the port on which to perform the scan |
Definition at line 55 of file VisionaryAutoIPScan.cpp.
|
staticprivate |
Definition at line 479 of file VisionaryAutoIPScan.cpp.
|
private |
Definition at line 238 of file VisionaryAutoIPScan.cpp.
|
private |
Definition at line 179 of file VisionaryAutoIPScan.cpp.
|
static |
Definition at line 21 of file VisionaryAutoIPScan.h.
|
staticconstexpr |
Definition at line 24 of file VisionaryAutoIPScan.h.
|
static |
Definition at line 23 of file VisionaryAutoIPScan.h.
|
static |
Definition at line 22 of file VisionaryAutoIPScan.h.
|
staticconstexpr |
Definition at line 20 of file VisionaryAutoIPScan.h.
|
staticconstexpr |
Definition at line 25 of file VisionaryAutoIPScan.h.
|
private |
Definition at line 89 of file VisionaryAutoIPScan.h.
|
private |
Definition at line 90 of file VisionaryAutoIPScan.h.