1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| #include <stdio.h>
| #include <stdlib.h>
| #include "dns.h"
| #include <time.h>
|
| int main(void)
| {
| char* hostname = "google.com";
| char* IP = "127.0.0.1";
| int type = T_A;
| unsigned char buf[65536];
| struct timespec ret;
| int r;
|
| r = reachable(buf, IP);
|
| /* ret = resolve(buf, hostname, IP, type); */
|
| /* printf("%ld, %ld\n", ret.tv_sec, ret.tv_nsec); */
|
| /* print_packet(buf); */
| /* for (int i = 0; i < 98; i++) { */
| /* printf("%X", buf[i]); */
| /* } */
| }
|
|