ReactOS 0.4.15-dev-7788-g1ad9096
adnshost.h
Go to the documentation of this file.
1/*
2 * adnshost.h
3 * - useful general-purpose resolver client program, header file
4 */
5/*
6 * This file is
7 * Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
8 *
9 * It is part of adns, which is
10 * Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
11 * Copyright (C) 1999-2000 Tony Finch <dot@dotat.at>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
16 * any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software Foundation,
25 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 */
27
28#ifndef ADNSHOST_H_INCLUDED
29#define ADNSHOST_H_INCLUDED
30
31#include <stdlib.h>
32#include <stdio.h>
33#include <string.h>
34#include <errno.h>
35#include <signal.h>
36#include <stdarg.h>
37#include <stdlib.h>
38#include <assert.h>
39#include <time.h>
40
41#ifndef ADNS_JGAA_WIN32
42# include <sys/types.h>
43# include <sys/socket.h>
44# include <netinet/in.h>
45# include <arpa/inet.h>
46#endif
47
48#include "config.h"
49#include "adns.h"
50#include "dlist.h"
51#include "client.h"
52
53#ifdef ADNS_REGRESS_TEST
54# include "hredirect.h"
55#endif
56
57/* declarations related to option processing */
58
59struct optioninfo;
60typedef void optfunc(const struct optioninfo *oi, const char *arg, const char *arg2);
61
62struct optioninfo {
63 enum oi_type {
67 const char *desc;
68 const char *sopt, *lopt;
71 const char *argdesc, *argdesc2;
72};
73
76
79 int ttl;
80};
81
83extern int ov_verbose;
84extern adns_rrtype ov_type;
87extern char *ov_id;
89
92
93const struct optioninfo *opt_findl(const char *opt);
94const struct optioninfo *opt_finds(const char **optp);
95void opt_do(const struct optioninfo *oip, int invert, const char *arg, const char *arg2);
96
97/* declarations related to query processing */
98
99struct query_node {
102 char *id, *owner;
104};
105
106extern adns_state ads;
107extern struct outstanding_list { struct query_node *head, *tail; } outstanding;
108
109void ensure_adns_init(void);
110void query_do(const char *domain);
111void query_done(struct query_node *qun, adns_answer *answer);
112
113/* declarations related to main program and useful utility functions */
114
115void sysfail(const char *what, int errnoval) NONRETURNING;
116void usageerr(const char *what, ...) NONRETURNPRINTFFORMAT(1,2);
117void outerr(void) NONRETURNING;
118
119void *xmalloc(size_t sz);
120char *xstrsave(const char *str);
121
122extern int rcode;
123extern const char *config_text; /* 0 => use defaults */
124
125#endif
adns_rrtype
Definition: adns.h:113
optfunc of_config
void * xmalloc(size_t sz)
Definition: util.c:27
int ov_format
Definition: adnshost.h:86
optfunc of_help
Definition: adnshost.h:90
int ov_qc_anshost
Definition: adnshost.h:85
void opt_do(const struct optioninfo *oip, int invert, const char *arg, const char *arg2)
Definition: adh-opts.c:342
char * ov_id
Definition: adh-opts.c:40
int ov_qc_cname
Definition: adnshost.h:85
adns_rrtype ov_type
Definition: adh-opts.c:37
void sysfail(const char *what, int errnoval) NONRETURNING
Definition: adh-main.c:49
int rcode
Definition: adh-main.c:36
const char * config_text
Definition: adh-main.c:37
int ov_verbose
Definition: adh-opts.c:36
struct outstanding_list outstanding
struct perqueryflags_remember ov_pqfr
Definition: adh-opts.c:41
optfunc of_version
Definition: adnshost.h:90
void ensure_adns_init(void)
Definition: adh-query.c:40
optfunc of_type
Definition: adnshost.h:90
int ov_env
Definition: adh-opts.c:35
const struct optioninfo * opt_findl(const char *opt)
Definition: adh-opts.c:331
int ov_cname
Definition: adnshost.h:86
const struct optioninfo * opt_finds(const char **optp)
Definition: adh-opts.c:332
outputformat
Definition: adnshost.h:75
@ fmt_simple
Definition: adnshost.h:75
@ fmt_asynch
Definition: adnshost.h:75
@ fmt_default
Definition: adnshost.h:75
@ fmt_inline
Definition: adnshost.h:75
int ov_asynch
Definition: adnshost.h:82
ttlmode
Definition: adnshost.h:74
@ tm_rel
Definition: adnshost.h:74
@ tm_none
Definition: adnshost.h:74
@ tm_abs
Definition: adnshost.h:74
void query_done(struct query_node *qun, adns_answer *answer)
Definition: adh-query.c:253
optfunc of_reverse
Definition: adnshost.h:90
int ov_qc_query
Definition: adnshost.h:85
void void outerr(void) NONRETURNING
Definition: adh-main.c:64
int ov_pipe
Definition: adnshost.h:82
optfunc of_asynch_id
void usageerr(const char *what,...) NONRETURNPRINTFFORMAT(1
int ov_search
Definition: adh-opts.c:38
adns_state ads
Definition: adh-query.c:35
void optfunc(const struct optioninfo *oi, const char *arg, const char *arg2)
Definition: adnshost.h:60
optfunc of_ptr
Definition: adnshost.h:90
optfunc of_cancel_id
Definition: adnshost.h:91
char * xstrsave(const char *str)
Definition: adh-main.c:75
void query_do(const char *domain)
Definition: adh-query.c:138
int ov_tcp
Definition: adh-opts.c:39
GLboolean invert
Definition: gl.h:1949
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
const WCHAR * str
#define NONRETURNING
Definition: acconfig.h:94
#define NONRETURNPRINTFFORMAT(si, tc)
Definition: acconfig.h:99
Definition: cookie.c:42
@ ot_funcarg2
Definition: adnshost.h:65
@ ot_funcarg
Definition: adnshost.h:65
@ ot_value
Definition: adnshost.h:65
@ ot_desconly
Definition: adnshost.h:64
const char * argdesc
Definition: adnshost.h:71
const char * argdesc2
Definition: adnshost.h:71
optfunc * func
Definition: adnshost.h:70
int * storep
Definition: adnshost.h:69
int value
Definition: adnshost.h:69
const char * desc
Definition: adnshost.h:67
const char * lopt
Definition: adnshost.h:68
const char * sopt
Definition: adnshost.h:68
enum optioninfo::oi_type type
struct query_node * head
Definition: adnshost.h:107
struct query_node * tail
Definition: adnshost.h:107
char * owner
Definition: adnshost.h:102
struct query_node * next
Definition: adnshost.h:100
char * id
Definition: adnshost.h:102
struct query_node * back
Definition: adnshost.h:100
adns_query qu
Definition: adnshost.h:103
struct perqueryflags_remember pqfr
Definition: adnshost.h:101
#define const
Definition: zconf.h:233