1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,30 @@ |
1 |
+/*! |
|
2 |
+ * @file main.c |
|
3 |
+ * @author Kang IkSeon (ikseon1026@gmail.com) |
|
4 |
+ * |
|
5 |
+ * @internal |
|
6 |
+ * Created: 2018년 01월 30일 |
|
7 |
+ * Copyright: Copyright (c) 2018, Kang IkSeon |
|
8 |
+ */ |
|
9 |
+ |
|
10 |
+#include <stdio.h> |
|
11 |
+#include <stdint.h> |
|
12 |
+ |
|
13 |
+#include "src/lib.h" |
|
14 |
+ |
|
15 |
+#define PACKET_LEN 116 |
|
16 |
+ |
|
17 |
+int main() { |
|
18 |
+ int n, len; |
|
19 |
+ unsigned char packet[PACKET_LEN]; |
|
20 |
+ char dmac[] = {0x08, 0x62, 0x66, 0x7c, 0xed, 0x6c}; |
|
21 |
+ |
|
22 |
+ printf ("ether size : %zu\n", sizeof(struct ether_header)); |
|
23 |
+ |
|
24 |
+ make_ether_packet(packet, dmac); |
|
25 |
+ make_wol_packet(packet + sizeof(struct ether_header), dmac); |
|
26 |
+ |
|
27 |
+ send_wol("enp0s25", packet, PACKET_LEN); |
|
28 |
+ |
|
29 |
+ return 0; |
|
30 |
+} |