20 sockets_(
SocketType::createAndBindForAllInterfaces(3956))
24 socket.enableBroadcast();
25 socket.enableNonBlocking();
30 const uint32_t subnet,
const uint32_t gateway)
32 std::vector<std::uint8_t> force_ip_command(64);
33 force_ip_command[0] = 0x42;
34 force_ip_command[1] = 0x00;
35 force_ip_command[2] = 0x00;
36 force_ip_command[3] = 0x04;
37 force_ip_command[4] = 0x00;
38 force_ip_command[5] = 64 - 8;
40 force_ip_command[10] =
static_cast<std::uint8_t
>(mac >> 40);
41 force_ip_command[11] =
static_cast<std::uint8_t
>(mac >> 32);
42 force_ip_command[12] =
static_cast<std::uint8_t
>(mac >> 24);
43 force_ip_command[13] =
static_cast<std::uint8_t
>(mac >> 16);
44 force_ip_command[14] =
static_cast<std::uint8_t
>(mac >> 8);
45 force_ip_command[15] =
static_cast<std::uint8_t
>(mac >> 0);
47 force_ip_command[28] =
static_cast<std::uint8_t
>(ip >> 24);
48 force_ip_command[29] =
static_cast<std::uint8_t
>(ip >> 16);
49 force_ip_command[30] =
static_cast<std::uint8_t
>(ip >> 8);
50 force_ip_command[31] =
static_cast<std::uint8_t
>(ip >> 0);
52 force_ip_command[44] =
static_cast<std::uint8_t
>(subnet >> 24);
53 force_ip_command[45] =
static_cast<std::uint8_t
>(subnet >> 16);
54 force_ip_command[46] =
static_cast<std::uint8_t
>(subnet >> 8);
55 force_ip_command[47] =
static_cast<std::uint8_t
>(subnet >> 0);
57 force_ip_command[60] =
static_cast<std::uint8_t
>(gateway >> 24);
58 force_ip_command[61] =
static_cast<std::uint8_t
>(gateway >> 16);
59 force_ip_command[62] =
static_cast<std::uint8_t
>(gateway >> 8);
60 force_ip_command[63] =
static_cast<std::uint8_t
>(gateway >> 0);
64 std::tie(force_ip_command[6], force_ip_command[7]) =
69 socket.send(force_ip_command);
void sendCommand(std::uint64_t mac, std::uint32_t ip, std::uint32_t subnet, std::uint32_t gateway)
Send FORCEIP_CMD.
std::vector< SocketType > sockets_
Exception representing a Network Unreachable error (code 101 on Unix).
Socket implementation for Linux.
static std::tuple< uint8_t, uint8_t > getNext()
Returns the next request number.