#include #include #include #include #include #include #include #include #include #include #include #ifndef __linux__ #pragma pack(push, 1) #endif struct ether_header { uint8_t ether_dhost[6]; /* destination eth addr */ uint8_t ether_shost[6]; /* source ether addr */ uint16_t ether_type; /* packet type ID field */ } #ifndef __linux__ ; #pragma pack(pop) #else __attribute__ ((__packed__)); #endif int send_wol(const char *interface, unsigned char *buf, int len); void make_wol_packet(char *buf, const char *dstmac); void make_ether_packet(char *buf, const char *dstmac);