d1cff511 |
1 | /* |
2 | * adnshost.h |
3 | * - useful general-purpose resolver client program, header file |
4 | */ |
5 | /* |
6 | * This file is |
7 | * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk> |
8 | * |
9 | * It is part of adns, which is |
10 | * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk> |
11 | * Copyright (C) 1999 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 "config.h" |
32 | #include "adns.h" |
33 | |
34 | /* declarations related to option processing */ |
35 | |
36 | struct optinfo; |
37 | typedef void optfunc(const struct optinfo *oi, const char *arg); |
38 | |
39 | struct optinfo { |
40 | enum oi_type { |
41 | ot_end, ot_desconly, |
42 | ot_flag, ot_value, ot_func, ot_funcarg |
43 | } type; |
44 | const char *desc; |
45 | const char *sopt, *lopt; |
46 | int *storep, value; |
47 | optfunc *func; |
48 | const char *argdesc; |
49 | }; |
50 | |
51 | enum ttlmode { tm_none, tm_rel, tm_abs }; |
52 | |
53 | struct perqueryflags_remember { |
54 | int show_owner, show_type, show_cname; |
55 | int ttl; |
56 | }; |
57 | |
58 | extern int ov_env, ov_pipe, ov_asynch; |
59 | extern int ov_verbose; |
60 | extern int ov_search, ov_qc_query, ov_qc_anshost, ov_qc_cname; |
61 | extern int ov_tcp, ov_cname; |
62 | extern char *ov_id; |
63 | extern struct perqueryflags_remember ov_pqfr; |
64 | |
65 | extern optfunc of_help, of_type, of_asynch_id, of_cancel_id; |
66 | |
67 | /* declarations related to query processing */ |
68 | |
69 | static void of_asynch_id(const struct optinfo *oi, const char *arg) { abort(); } |
70 | static void of_cancel_id(const struct optinfo *oi, const char *arg) { abort(); } |
71 | |
72 | /* declarations related to main program and useful utility functions */ |
73 | |
74 | void sysfail(const char *what, int errnoval) NONRETURNING; |
75 | |
76 | #endif |