devscan
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Namespaces | Classes | Typedefs | Variables
hbm::devscan Namespace Reference

Namespace for the device scanning interface. More...

Namespaces

 test
 

Classes

class  ConfigureClient
 this class sends HBM scan network configuration requests, and waits for the response. More...
 
class  DeviceMonitor
 this class is being used for processing received announcements It notifies new, changed and expired announcements. More...
 
class  Receiver
 The main class for HBM Scan Clients. It receives announcements interprets them and notifies about new, changed and expired announcements. More...
 
struct  cb_t
 A container/namespace for error codes passed with the error-callback. More...
 
interface  ReceiverIf
 The interface to use by HBM Scan Clients. More...
 

Typedefs

typedef std::function< void(const
std::string uuid, const
std::string
&receivingInterfaceName, const
std::string
&sendingInterfaceAddress,
const std::string
&announcement) > 
announceCb_t
 Typedef for the user provided callback function which is called once a new device is discovered. More...
 
typedef std::function< void(const
std::string uuid, const
std::string
&receivingInterfaceName, const
std::string
&sendingInterfaceAddress) > 
expireCb_t
 Typedef for the user provided callback function which is called once a previously discovered device disappears. More...
 
typedef std::function< void(uint64_t
errorcode, const std::string
&userMessage, const
std::string &receivedData) > 
errorCb_t
 Typedef for the user provided callback function which is called on any incorrect data received via the network. More...
 

Variables

const unsigned int ANNOUNCE_UDP_PORT = 31416
 announcements will be send to this port More...
 
const unsigned int CONFIG_UDP_PORT = 31417
 configuration requests and responses go to this port More...
 
const char ANNOUNCE_IPV4_ADDRESS [] = "239.255.77.76"
 announcements will be send to this group More...
 
const char CONFIG_IPV4_ADDRESS [] = "239.255.77.77"
 configuration requests and responses go to this group More...
 
static const unsigned int ANNOUNCE_PERIOD_MS = 5000
 
static const char TAG_Announce [] = "announce"
 
static const char TAG_Configure [] = "configure"
 
static const char TAG_Services [] = "services"
 
static const char TAG_Expiration [] = "expiration"
 
static const char TAG_NetSettings [] = "netSettings"
 
static const char TAG_Interface [] = "interface"
 
static const char TAG_Name [] = "name"
 
static const char TAG_Description [] = "description"
 
static const char TAG_HardwareId [] = "hardwareId"
 
static const char TAG_Type [] = "type"
 
static const char TAG_Label [] = "label"
 
static const char TAG_FamilyType [] = "familyType"
 
static const char CONFIGURATION_METHOD [] = "configurationMethod"
 
static const char SRV [] = "services"
 
static const char SRV_HBM_PROTOCOL [] = "hbmProtocol"
 
static const char SRV_STREAM_DATA [] = "daqStream"
 
static const char SRV_HTTP [] = "http"
 
static const char SRV_SSH [] = "ssh"
 
static const char SRV_JETD [] = "jetd"
 
static const char SRV_JETWS [] = "jetws"
 
static const char NET_PATH [] = "net"
 
static const char INTERFACES [] = "interfaces"
 
static const char RESULTS [] = "results"
 
static const char REACHABLEDEVICES_PATH [] = "reachableDevices"
 
static const char ROUTEDDEVICES_PATH [] = "routedDevices"
 
static const char TAG_eth [] = "eth"
 
static const char TAG_manualAddress [] = "manualAddress"
 
static const char TAG_manualNetmask [] = "manualNetmask"
 
static const char TAG_Port [] = "port"
 
static const char TAG_ipV4 [] = "ipv4"
 
static const char TAG_ipV6 [] = "ipv6"
 
static const char TAG_address [] = "address"
 
static const char TAG_netMask [] = "netmask"
 
static const char TAG_ipV4Address [] = "ipv4Address"
 
static const char TAG_ipV6Address [] = "ipv6Address"
 
static const char TAG_prefix [] = "prefix"
 
static const char TAG_DefaultGateway [] = "defaultGateway"
 
static const char PrepareDefaultGatewayMethod [] = "prepareDefaultGateway"
 
static const char TAG_Device [] = "device"
 
static const char TAG_IsRouter [] = "isRouter"
 
static const char TAG_Router [] = "router"
 
static const char TAG_Uuid [] = "uuid"
 
static const char TAG_Ttl [] = "ttl"
 
static const char TAG_FirmwareVersion [] = "firmwareVersion"
 
static const char CONFIG_METHOD_MANUAL [] = "manual"
 configure("interface"."configuration_method"="manual") More...
 
static const char CONFIG_METHOD_DHCP [] = "dhcp"
 configure("interface"."configuration_method"="dhcp") More...
 
static const char CONFIG [] = "config"
 
static const char PREPARE [] = "prepare"
 

Detailed Description

Namespace for the device scanning interface.

All identifiers in this project are using this namespace.

Typedef Documentation

Typedef for the user provided callback function which is called once a new device is discovered.

This user-provided callback is called whenever a new device is detected on the network. When the callback is called, it is ensured that the announcement message is valid and contains all mandatory information (in other cases, the error callback is called).

Parameters
uuidthe device's unique id, as transmitted in the network message
receivingInterfaceNamethe name of the host's network adapter receiving the announcement network message, on Linux for example: eth0
sendingInterfaceAddress
announcementthe received network message, as a string
See Also
ReceiverIf::setAnnounceCb()
expireCb_t

Typedef for the user provided callback function which is called on any incorrect data received via the network.

Any packet receiving on the network passes multiple parsing and interpretation steps. This callback function serves as the reporting interface for all the "internal" processing.
Making use if this callback is basically for debugging purpose. The registration is optional.
When the application receives the error callback it does not necessarily mean, that the same message is not sent via the announce callback as well. See hbm::devscan::cb_t::DATA_DROPPED.

Parameters
errorcodea bit-coded error code, synthesized from constants in hbm::devscan::cb_t
userMessagea (english) human readable message describing the cause of the error
receivedDatathe message as it was received from the network
See Also
ReceiverIf::setErrorCb()
cb_t

Typedef for the user provided callback function which is called once a previously discovered device disappears.

This user-provided callback is called whenever no announcement messages are received from a certain device on the network for period defined in the last device's announcement message.

Parameters
uuidthe device's unique id, transmitted in the network message
receivingInterfaceNameThe name of the host's network adapter receiving the announcement network message, on Linux for example: eth0
sendingInterfaceAddress
See Also
ReceiverIf::setExpireCb()
announceCb_t

Variable Documentation

const char hbm::devscan::ANNOUNCE_IPV4_ADDRESS[] = "239.255.77.76"

announcements will be send to this group

const unsigned int hbm::devscan::ANNOUNCE_PERIOD_MS = 5000
static
const unsigned int hbm::devscan::ANNOUNCE_UDP_PORT = 31416

announcements will be send to this port

const char hbm::devscan::CONFIG[] = "config"
static
const char hbm::devscan::CONFIG_IPV4_ADDRESS[] = "239.255.77.77"

configuration requests and responses go to this group

const char hbm::devscan::CONFIG_METHOD_DHCP[] = "dhcp"
static

configure("interface"."configuration_method"="dhcp")

const char hbm::devscan::CONFIG_METHOD_MANUAL[] = "manual"
static

configure("interface"."configuration_method"="manual")

const unsigned int hbm::devscan::CONFIG_UDP_PORT = 31417

configuration requests and responses go to this port

const char hbm::devscan::CONFIGURATION_METHOD[] = "configurationMethod"
static
const char hbm::devscan::INTERFACES[] = "interfaces"
static
const char hbm::devscan::NET_PATH[] = "net"
static
const char hbm::devscan::PREPARE[] = "prepare"
static
const char hbm::devscan::PrepareDefaultGatewayMethod[] = "prepareDefaultGateway"
static
const char hbm::devscan::REACHABLEDEVICES_PATH[] = "reachableDevices"
static
const char hbm::devscan::RESULTS[] = "results"
static
const char hbm::devscan::ROUTEDDEVICES_PATH[] = "routedDevices"
static
const char hbm::devscan::SRV[] = "services"
static
const char hbm::devscan::SRV_HBM_PROTOCOL[] = "hbmProtocol"
static
const char hbm::devscan::SRV_HTTP[] = "http"
static
const char hbm::devscan::SRV_JETD[] = "jetd"
static
const char hbm::devscan::SRV_JETWS[] = "jetws"
static
const char hbm::devscan::SRV_SSH[] = "ssh"
static
const char hbm::devscan::SRV_STREAM_DATA[] = "daqStream"
static
const char hbm::devscan::TAG_address[] = "address"
static
const char hbm::devscan::TAG_Announce[] = "announce"
static
const char hbm::devscan::TAG_Configure[] = "configure"
static
const char hbm::devscan::TAG_DefaultGateway[] = "defaultGateway"
static
const char hbm::devscan::TAG_Description[] = "description"
static
const char hbm::devscan::TAG_Device[] = "device"
static
const char hbm::devscan::TAG_eth[] = "eth"
static
const char hbm::devscan::TAG_Expiration[] = "expiration"
static
const char hbm::devscan::TAG_FamilyType[] = "familyType"
static
const char hbm::devscan::TAG_FirmwareVersion[] = "firmwareVersion"
static
const char hbm::devscan::TAG_HardwareId[] = "hardwareId"
static
const char hbm::devscan::TAG_Interface[] = "interface"
static
const char hbm::devscan::TAG_ipV4[] = "ipv4"
static
const char hbm::devscan::TAG_ipV4Address[] = "ipv4Address"
static
const char hbm::devscan::TAG_ipV6[] = "ipv6"
static
const char hbm::devscan::TAG_ipV6Address[] = "ipv6Address"
static
const char hbm::devscan::TAG_IsRouter[] = "isRouter"
static
const char hbm::devscan::TAG_Label[] = "label"
static
const char hbm::devscan::TAG_manualAddress[] = "manualAddress"
static
const char hbm::devscan::TAG_manualNetmask[] = "manualNetmask"
static
const char hbm::devscan::TAG_Name[] = "name"
static
const char hbm::devscan::TAG_netMask[] = "netmask"
static
const char hbm::devscan::TAG_NetSettings[] = "netSettings"
static
const char hbm::devscan::TAG_Port[] = "port"
static
const char hbm::devscan::TAG_prefix[] = "prefix"
static
const char hbm::devscan::TAG_Router[] = "router"
static
const char hbm::devscan::TAG_Services[] = "services"
static
const char hbm::devscan::TAG_Ttl[] = "ttl"
static
const char hbm::devscan::TAG_Type[] = "type"
static
const char hbm::devscan::TAG_Uuid[] = "uuid"
static