Browse code

수정 내용 저장

Ikseon Kang authored on05/05/2019 08:46:49
Showing1 changed files
... ...
@@ -10,6 +10,8 @@
10 10
 #include <netinet/in.h>
11 11
 #include <arpa/inet.h>
12 12
 
13
+#define WOL_LEN 102
14
+
13 15
 #ifndef __linux__
14 16
   #pragma pack(push, 1)
15 17
 #endif
Browse code

기본 파일 추가

Ikseon Kang authored on05/05/2019 08:21:13
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,31 @@
1
+#include <stdio.h>
2
+#include <string.h>
3
+#include <unistd.h>
4
+#include <sys/types.h>
5
+#include <sys/socket.h>
6
+#include <sys/ioctl.h>
7
+#include <linux/if.h>
8
+#include <linux/if_packet.h>
9
+#include <linux/if_ether.h>
10
+#include <netinet/in.h>
11
+#include <arpa/inet.h>
12
+
13
+#ifndef __linux__
14
+  #pragma pack(push, 1)
15
+#endif
16
+struct ether_header
17
+{
18
+  uint8_t  ether_dhost[6];    /* destination eth addr */
19
+  uint8_t  ether_shost[6];    /* source ether addr  */
20
+  uint16_t ether_type;    /* packet type ID field */
21
+}
22
+#ifndef __linux__
23
+  ;
24
+  #pragma pack(pop)
25
+#else
26
+__attribute__ ((__packed__));
27
+#endif
28
+
29
+int send_wol(const char *interface, unsigned char *buf, int len);
30
+void make_wol_packet(char *buf, const char *dstmac);
31
+void make_ether_packet(char *buf, const char *dstmac);