summaryrefslogtreecommitdiff
path: root/whois.h
blob: 0da289f729f461f32c525ce38af4a79a0cc64432 (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* Size of the buffer where the query is built */
#define QUERYBUFSIZE 1024

/* Protocol data which could change */
/* First and last lines of the Internic disclaimer */
#define DISCL_BEGIN	"The Data in"
#define DISCL_END	"this query"

/* 6bone referto: extension */
#define REFERTO_FORMAT	"%% referto: whois -h %255s -p %15s %1023[^\n\r]"


/* system features */
#ifdef linux
# define ENABLE_NLS
# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
#  define HAVE_GETADDRINFO
# endif
#endif

#ifdef ENABLE_NLS
# define NLS_CAT_NAME   "whois"
# ifndef LOCALEDIR
#  define LOCALEDIR     "/usr/share/locale"
# endif
#endif


/* NLS stuff */
#ifdef ENABLE_NLS
# include <libintl.h>
# include <locale.h>
# define _(a) (gettext (a))
# ifdef gettext_noop
#  define N_(a) gettext_noop (a)
# else
#  define N_(a) (a)
# endif
#else
# define _(a) (a)
# define N_(a) a
#endif


/* prototypes */
const char *whichwhois(const char *);
const char *whereas(unsigned short, struct as_del []);
char *queryformat(const char *, const char *, const char *);
void do_query(const int, const char *);
const char *query_crsnic(const int, const char *);
int openconn(const char *, const char *);
void closeconn(const int);
void usage(void);
void sighandler(int);
unsigned long myinet_aton(const char *);
int domcmp(const char *, const char *);
int domfind(const char *, const char *[]);

void err_quit(const char *,...);
void err_sys(const char *,...);


/* flags for RIPE-like servers */
const char *ripeflags="acFLmMrRS";
const char *ripeflagsp="gisTtv";