Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenadnshost.h
Go to the documentation of this file.
00001 /* 00002 * adnshost.h 00003 * - useful general-purpose resolver client program, header file 00004 */ 00005 /* 00006 * This file is 00007 * Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk> 00008 * 00009 * It is part of adns, which is 00010 * Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk> 00011 * Copyright (C) 1999-2000 Tony Finch <dot@dotat.at> 00012 * 00013 * This program is free software; you can redistribute it and/or modify 00014 * it under the terms of the GNU General Public License as published by 00015 * the Free Software Foundation; either version 2, or (at your option) 00016 * any later version. 00017 * 00018 * This program is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU General Public License 00024 * along with this program; if not, write to the Free Software Foundation, 00025 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00026 */ 00027 00028 #ifndef ADNSHOST_H_INCLUDED 00029 #define ADNSHOST_H_INCLUDED 00030 00031 #include <stdlib.h> 00032 #include <stdio.h> 00033 #include <string.h> 00034 #include <errno.h> 00035 #include <signal.h> 00036 #include <stdarg.h> 00037 #include <stdlib.h> 00038 #include <assert.h> 00039 #include <time.h> 00040 00041 #ifndef ADNS_JGAA_WIN32 00042 # include <sys/types.h> 00043 # include <sys/socket.h> 00044 # include <netinet/in.h> 00045 # include <arpa/inet.h> 00046 #endif 00047 00048 #include "config.h" 00049 #include "adns.h" 00050 #include "dlist.h" 00051 #include "client.h" 00052 00053 #ifdef ADNS_REGRESS_TEST 00054 # include "hredirect.h" 00055 #endif 00056 00057 /* declarations related to option processing */ 00058 00059 struct optioninfo; 00060 typedef void optfunc(const struct optioninfo *oi, const char *arg, const char *arg2); 00061 00062 struct optioninfo { 00063 enum oi_type { 00064 ot_end, ot_desconly, 00065 ot_flag, ot_value, ot_func, ot_funcarg, ot_funcarg2 00066 } type; 00067 const char *desc; 00068 const char *sopt, *lopt; 00069 int *storep, value; 00070 optfunc *func; 00071 const char *argdesc, *argdesc2; 00072 }; 00073 00074 enum ttlmode { tm_none, tm_rel, tm_abs }; 00075 enum outputformat { fmt_default, fmt_simple, fmt_inline, fmt_asynch }; 00076 00077 struct perqueryflags_remember { 00078 int show_owner, show_type, show_cname; 00079 int ttl; 00080 }; 00081 00082 extern int ov_env, ov_pipe, ov_asynch; 00083 extern int ov_verbose; 00084 extern adns_rrtype ov_type; 00085 extern int ov_search, ov_qc_query, ov_qc_anshost, ov_qc_cname; 00086 extern int ov_tcp, ov_cname, ov_format; 00087 extern char *ov_id; 00088 extern struct perqueryflags_remember ov_pqfr; 00089 00090 extern optfunc of_config, of_version, of_help, of_type, of_ptr, of_reverse; 00091 extern optfunc of_asynch_id, of_cancel_id; 00092 00093 const struct optioninfo *opt_findl(const char *opt); 00094 const struct optioninfo *opt_finds(const char **optp); 00095 void opt_do(const struct optioninfo *oip, int invert, const char *arg, const char *arg2); 00096 00097 /* declarations related to query processing */ 00098 00099 struct query_node { 00100 struct query_node *next, *back; 00101 struct perqueryflags_remember pqfr; 00102 char *id, *owner; 00103 adns_query qu; 00104 }; 00105 00106 extern adns_state ads; 00107 extern struct outstanding_list { struct query_node *head, *tail; } outstanding; 00108 00109 void ensure_adns_init(void); 00110 void query_do(const char *domain); 00111 void query_done(struct query_node *qun, adns_answer *answer); 00112 00113 /* declarations related to main program and useful utility functions */ 00114 00115 void sysfail(const char *what, int errnoval) NONRETURNING; 00116 void usageerr(const char *what, ...) NONRETURNPRINTFFORMAT(1,2); 00117 void outerr(void) NONRETURNING; 00118 00119 void *xmalloc(size_t sz); 00120 char *xstrsave(const char *str); 00121 00122 extern int rcode; 00123 extern const char *config_text; /* 0 => use defaults */ 00124 00125 #endif Generated on Sat May 26 2012 04:32:16 for ReactOS by
1.7.6.1
|