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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
|
/*
** Declaration of functions.
**
** @(#)defs.h e07@nikhef.nl (Eric Wassenaar) 991529
*/
/*
** Internal modules of the host utility
** ------------------------------------
*/
/* main.c */
int main PROTO((int, char **));
void set_defaults PROTO((char *, int, char **));
int getval PROTO((char *, char *, int, int));
char *cvtopt PROTO((char *));
int process_argv PROTO((int, char **));
int process_file PROTO((FILE *));
int process_name PROTO((char *));
int execute_name PROTO((char *));
bool execute PROTO((char *, ipaddr_t));
bool host_query PROTO((char *, ipaddr_t));
char *myhostname PROTO((void));
void set_server PROTO((char *));
void set_logfile PROTO((char *));
void set_cachedir PROTO((char *));
void fatal PROTO((char *, ...));
void errmsg PROTO((char *, ...));
/* info.c */
bool get_hostinfo PROTO((char *, bool));
bool get_domaininfo PROTO((char *, char *));
int get_info PROTO((querybuf *, char *, int, int));
bool print_info PROTO((querybuf *, int, char *, int, int, bool));
void print_data PROTO((char *, ...));
u_char *print_rrec PROTO((char *, int, int, u_char *, u_char *, u_char *, bool));
void dump_rrec PROTO((u_char *, int, char *));
u_char *skip_qrec PROTO((char *, int, int, u_char *, u_char *, u_char *));
bool get_recursive PROTO((char **));
/* list.c */
bool list_zone PROTO((char *));
bool find_servers PROTO((char *));
bool get_servers PROTO((char *));
bool get_nsinfo PROTO((querybuf *, int, char *, int, int));
void sort_servers PROTO((void));
bool skip_transfer PROTO((char *));
void do_check PROTO((char *));
void do_soa PROTO((char *, struct in_addr, char *));
bool do_transfer PROTO((char *));
bool transfer_zone PROTO((char *, struct in_addr, char *));
bool get_zone PROTO((char *, struct in_addr, char *));
void update_zone PROTO((char *));
bool get_mxrec PROTO((char *));
char *get_primary PROTO((char *));
bool check_zone PROTO((char *, char *));
bool check_cache PROTO((char *, char *));
bool compare_soa PROTO((char *));
bool get_soainfo PROTO((querybuf *, int, char *, int, int));
int load_soa PROTO((querybuf *, char *));
void check_soa PROTO((querybuf *, char *, char *));
bool check_dupl PROTO((ipaddr_t));
bool check_ttl PROTO((char *, int, int, int));
void clear_ttltab PROTO((void));
int host_index PROTO((char *, bool));
void clear_hosttab PROTO((void));
int zone_index PROTO((char *, bool));
void clear_zonetab PROTO((void));
int check_canon PROTO((char *));
/* addr.c */
bool check_addr PROTO((char *));
bool check_addr_name PROTO((struct in_addr, char *));
bool check_name PROTO((ipaddr_t));
bool check_name_addr PROTO((char *, ipaddr_t));
/* geth.c */
struct hostent *geth_byname PROTO((CONST char *));
struct hostent *geth_byaddr PROTO((CONST char *, int, int));
/* util.c */
int parse_type PROTO((char *));
int parse_class PROTO((char *));
char *in_addr_arpa PROTO((char *));
char *nsap_int PROTO((char *));
void print_host PROTO((char *, struct hostent *));
void show_res PROTO((void));
void print_stats PROTO((int *, int, char *, int, int));
void clear_stats PROTO((int *));
void show_types PROTO((char *, int, int));
void ns_error PROTO((char *, int, int, char *));
char *decode_error PROTO((int));
void print_answer PROTO((querybuf *, int));
void pr_error PROTO((char *, ...));
void pr_warning PROTO((char *, ...));
void pr_timestamp PROTO((char *, ...));
bool want_type PROTO((int, int));
bool want_class PROTO((int, int));
bool indomain PROTO((char *, char *, bool));
bool samedomain PROTO((char *, char *, bool));
bool gluerecord PROTO((char *, char *, char **, int));
int matchlabels PROTO((char *, char *));
char *pr_domain PROTO((char *, bool));
char *pr_dotname PROTO((char *));
char *pr_nsap PROTO((char *));
char *pr_type PROTO((int));
char *pr_class PROTO((int));
int expand_name PROTO((char *, int, u_char *, u_char *, u_char *, char *));
int check_size PROTO((char *, int, u_char *, u_char *, u_char *, int));
bool valid_name PROTO((char *, bool, bool, bool));
int canonical PROTO((char *));
char *mapreverse PROTO((char *, struct in_addr));
int anyrecord PROTO((char *));
int compare_name Proto((const ptr_t *, const ptr_t *));
/* misc.c */
ptr_t *xalloc PROTO((ptr_t *, siz_t));
char *dtoa PROTO((int));
char *utoa PROTO((int));
char *xtoa PROTO((int));
char *stoa PROTO((u_char *, int, bool));
char *base_ntoa PROTO((u_char *, int));
char *nsap_ntoa PROTO((u_char *, int));
char *ipng_ntoa PROTO((u_char *));
char *pr_date PROTO((int));
char *pr_time PROTO((int, bool));
char *pr_spherical PROTO((int, char *, char *));
char *pr_vertical PROTO((int, char *, char *));
char *pr_precision PROTO((int));
int convtime PROTO((char *, char));
/* test.c */
bool test PROTO((char *, ipaddr_t));
/* file.c */
char *cachename PROTO((char *, char *, char));
int cache_open PROTO((char *, bool));
int cache_close PROTO((bool));
int cache_write PROTO((char *, int));
int cache_read PROTO((char *, int));
void cache_perror PROTO((char *, char *));
/* send.c */
#ifdef HOST_RES_SEND
int res_send PROTO((CONST qbuf_t *, int, qbuf_t *, int));
void _res_close PROTO((void));
static bool check_from PROTO((void));
static int send_stream PROTO((struct sockaddr_in *, qbuf_t *, int, qbuf_t *, int));
static int send_dgram PROTO((struct sockaddr_in *, qbuf_t *, int, qbuf_t *, int));
#endif /*HOST_RES_SEND*/
int _res_socket PROTO((int, int, int));
int _res_blocking PROTO((int, bool));
static sigtype_t timer PROTO((int));
int _res_connect PROTO((int, struct sockaddr_in *, int));
int _res_write PROTO((int, struct sockaddr_in *, char *, char *, int));
int _res_read PROTO((int, struct sockaddr_in *, char *, char *, int));
static int recv_sock PROTO((int, char *, int));
void _res_perror PROTO((struct sockaddr_in *, char *, char *));
/*
** External library functions
** --------------------------
*/
/* extern */
time_t time PROTO((time_t *));
#if !defined(NO_INET_H)
#include <arpa/inet.h>
#else
ipaddr_t inet_addr PROTO((CONST char *));
char *inet_ntoa PROTO((struct in_addr));
#endif
#if defined(BIND_48)
char *hostalias PROTO((CONST char *));
#endif
/* avoid <strings.h> */
#if !defined(index)
char *index PROTO((const char *, int));
char *rindex PROTO((const char *, int));
#endif
/* <string.h> */
#if !defined(NO_STRING_H)
#include <string.h>
#else
char *strcpy PROTO((char *, const char *));
char *strncpy PROTO((char *, const char *, siz_t));
#endif
/* <stdlib.h> */
#if defined(__STDC__) && !defined(apollo)
#include <stdlib.h>
#else
char *getenv PROTO((const char *));
ptr_t *malloc PROTO((siz_t));
ptr_t *realloc PROTO((ptr_t *, siz_t));
free_t free PROTO((ptr_t *));
void exit PROTO((int));
void qsort PROTO((ptr_t *, siz_t, siz_t, int (*)(const ptr_t *, const ptr_t *)));
#endif
/* <unistd.h> */
#if defined(__STDC__) && !defined(apollo) && !defined(WINNT)
#include <unistd.h>
#else
unsigned int alarm PROTO((unsigned int));
#endif
|