119 lines
2.3 KiB
C
119 lines
2.3 KiB
C
|
/*
|
||
|
* Written by Carsten Larsen.
|
||
|
* Public domain.
|
||
|
*/
|
||
|
|
||
|
#ifndef _DNSTRACER_H
|
||
|
#define _DNSTRACER_H
|
||
|
|
||
|
#include <clib/dos_protos.h>
|
||
|
#include <clib/exec_protos.h>
|
||
|
#include <clib/alib_protos.h>
|
||
|
#include <clib/timer_protos.h>
|
||
|
#include <clib/utility_protos.h>
|
||
|
#include <utility/date.h>
|
||
|
#include <devices/timer.h>
|
||
|
|
||
|
#include <sys/types.h>
|
||
|
#include <sys/socket.h>
|
||
|
#include <netinet/in.h>
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
#include <stddef.h>
|
||
|
#include <unistd.h>
|
||
|
#include <errno.h>
|
||
|
#include <signal.h>
|
||
|
#include <stdarg.h>
|
||
|
|
||
|
#include "mem.h"
|
||
|
#define calloc(x, y) allocmem(x*y)
|
||
|
#define malloc(x) allocmem(x)
|
||
|
#define free(x) freemem(x)
|
||
|
|
||
|
unsigned int debugging;
|
||
|
|
||
|
#ifdef AOS3
|
||
|
# include <clib/amitcp_protos.h>
|
||
|
# include <amitcp/socketbasetags.h>
|
||
|
# include <machine/types.h>
|
||
|
# define uint16_t u_int16_t
|
||
|
# define gettimeofday(x, y) getsystime(x)
|
||
|
# define srandom(x) srand(x)
|
||
|
# define random() rand()
|
||
|
# define ANSI_CONSOLE 1
|
||
|
# define IPTR ULONG
|
||
|
typedef unsigned int socklen_t;
|
||
|
typedef unsigned int sa_family_t;
|
||
|
#endif
|
||
|
|
||
|
typedef u_int16_t in_port_t;
|
||
|
|
||
|
#ifdef AROS
|
||
|
# include <inttypes.h>
|
||
|
# include <sys/time.h>
|
||
|
# define Socket(a,b,c) socket(a,b,c)
|
||
|
# define Bind(a,b,c) bind(a,b,c)
|
||
|
# define Recv(a,b,c,d) recv(a,b,c,d)
|
||
|
# define RecvFrom(a,b,c,d,e,f) recvfrom(a,b,c,d,e,f)
|
||
|
# define SendTo(a,b,c,d,e,f) sendto(a,b,c,d,e,f)
|
||
|
#endif
|
||
|
|
||
|
#ifdef AOS3
|
||
|
/*
|
||
|
* struct addrinfo.
|
||
|
*/
|
||
|
struct addrinfo {
|
||
|
int ai_flags;
|
||
|
int ai_family;
|
||
|
int ai_socktype;
|
||
|
int ai_protocol;
|
||
|
socklen_t ai_addrlen;
|
||
|
char *ai_canonname;
|
||
|
struct sockaddr *ai_addr;
|
||
|
struct addrinfo *ai_next;
|
||
|
};
|
||
|
#endif
|
||
|
|
||
|
#define PACKAGE_NAME "DNS Tracer"
|
||
|
#define PACKAGE_VERSION "1.9"
|
||
|
#define PACKAGE_DATE "21.02.2016"
|
||
|
|
||
|
#define WORDS_BIGENDIAN 1
|
||
|
#define NOIPV6 1
|
||
|
struct sockaddr_in6;
|
||
|
|
||
|
#ifndef PF_INET6
|
||
|
#define PF_INET6 10
|
||
|
#endif
|
||
|
|
||
|
#ifndef AF_INET6
|
||
|
#define AF_INET6 PF_INET6
|
||
|
#endif
|
||
|
|
||
|
#define DEFAULT_RETRIES 3
|
||
|
#define DEFAULT_CACHING 1
|
||
|
#define DEFAULT_NEGATIVE_CACHING 0
|
||
|
#define DEFAULT_OVERVIEW 0
|
||
|
#define DEFAULT_QUERYTYPE ns_t_a
|
||
|
#define DEFAULT_NOIPV6 0
|
||
|
|
||
|
#if defined( DEBUG ) || defined( _DEBUG )
|
||
|
# define DEBUG_TEXT "b"
|
||
|
#else
|
||
|
# define DEBUG_TEXT ""
|
||
|
#endif
|
||
|
|
||
|
/* dnstracer.c */
|
||
|
char *prog;
|
||
|
|
||
|
/* dnstracer_amiga.c */
|
||
|
int open_libs();
|
||
|
int getsystime(struct timeval *tv);
|
||
|
|
||
|
extern struct Library *SocketBase;
|
||
|
extern int errno;
|
||
|
|
||
|
#endif
|