1 #ifndef _ots_NetworkDevice_h_
2 #define _ots_NetworkDevice_h_
6 #include <netinet/in.h>
19 int initSocket (std::string socketPort=
"");
20 int initSocket (
unsigned int socketPort);
22 int ping (
int socketDescriptor);
23 int send (
int socketDescriptor,
const std::string& msg);
24 int receive (
int socketDescriptor, std::string& msg);
25 int listen (
int socketDescriptor, std::string& msg);
26 std::string getFullIPAddress(std::string partialIpAddress);
27 std::string getInterfaceName(std::string ipAddress);
28 std::string getMacAddress (std::string interfaceName);
31 enum {maxSocketSize=65536};
33 struct sockaddr_in deviceAddress_;
35 std::map<int,int> openSockets_;
38 enum{FirstSocketPort=10000,LastSocketPort=15000};
40 int getInterface(std::string partialIpAddress);
42 struct ifaddrs* communicationInterface_;