-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnsping.h
49 lines (41 loc) · 1.16 KB
/
nsping.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef NSPING_INCLUDED
#define NSPING_INCLUDED
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "dns-lib.h"
#include "dns-rr.h"
#ifdef sys5
typedef unsigned long u_int32_t;
typedef unsigned short u_int16_t;
#define INADDR_NONE -1
#endif
#define QUERY_BACKLOG 1024
#define DNS_PORT "53"
#define DEFAULT_SECOND_INTERVAL 1
#define DEFAULT_USECOND_INTERVAL 0
int guess_zone(const char *dns_server_name);
struct timeval *set_timer(char *timearg);
void probe(int sig);
int dns_packet(u_char **qp, int id);
void handle_incoming(void);
void update(u_char *bp, int l);
void summarize(int);
double trip_time(struct timeval *send_time, struct timeval *rcv);
struct timeval *timeval_subtract(struct timeval *out, struct timeval *in);
int bind_udp_socket(char *port);
void dprintf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
void usage(void);
char *xstrdup(const char *v);
struct addrinfo *resolve(const char *name, const char *port);
#endif