mirror of https://github.com/Chizi123/dnscomp.git

Joel Grunbaum
2022-05-31 6dab04021cc1f97e5d95ca7da56e95a1fed8046a
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
26
27
28
29
30
#include <stdio.h>
#include <stdlib.h>
#include "dns.h"
#include <time.h>
#include <netinet/ip.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, "10.0.0.0");
    printf("%d\n", r);
    /* print_packet(buf + sizeof(struct ip)); */
    r = reachable(buf, "127.0.0.2");
    printf("%d\n", r);
 
    /* 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]); */
    /* } */
}