21 #ifndef INCLUDE_OLA_NETWORK_NETWORKUTILS_H_
22 #define INCLUDE_OLA_NETWORK_NETWORKUTILS_H_
27 #include <arpa/inet.h>
30 #include <ola/network/Interface.h>
37 bool StringToAddress(
const std::string &address,
struct in_addr &addr);
38 std::string AddressToString(
const struct in_addr &addr);
40 std::string HardwareAddressToString(uint8_t hw_address[MAC_LENGTH]);
45 uint8_t NetworkToHost(uint8_t value);
46 uint16_t NetworkToHost(uint16_t value);
47 uint32_t NetworkToHost(uint32_t value);
48 int8_t NetworkToHost(int8_t value);
49 int16_t NetworkToHost(int16_t value);
50 int32_t NetworkToHost(int32_t value);
51 uint8_t HostToNetwork(uint8_t value);
52 uint16_t HostToNetwork(uint16_t value);
53 uint32_t HostToNetwork(uint32_t value);
54 int8_t HostToNetwork(int8_t value);
55 int16_t HostToNetwork(int16_t value);
56 int32_t HostToNetwork(int32_t value);
58 uint8_t HostToLittleEndian(uint8_t value);
59 uint16_t HostToLittleEndian(uint16_t value);
60 uint32_t HostToLittleEndian(uint32_t value);
61 int8_t HostToLittleEndian(int8_t value);
62 int16_t HostToLittleEndian(int16_t value);
63 int32_t HostToLittleEndian(int32_t value);
64 uint8_t LittleEndianToHost(uint8_t value);
65 uint16_t LittleEndianToHost(uint16_t value);
66 uint32_t LittleEndianToHost(uint32_t value);
67 int8_t LittleEndianToHost(int8_t value);
68 int16_t LittleEndianToHost(int16_t value);
69 int32_t LittleEndianToHost(int32_t value);
71 std::string FullHostname();
72 std::string Hostname();
75 #endif // INCLUDE_OLA_NETWORK_NETWORKUTILS_H_