#include <stdio.h>#include <sys/types.h>#include <arpa/nameser.h>#include <netdb.h>#include <sys/socket.h>#include <netinet/in.h>#include <resolv.h>#include <sys/param.h>#include <strings.h>#include <ctype.h>Include dependency graph for host.c:

Go to the source code of this file.
Data Structures | |
| union | querybuf |
Defines | |
| #define | NUMMX 50 |
| #define | SUCCESS 0 |
| #define | TIME_OUT -1 |
| #define | NO_INFO -2 |
| #define | ERROR -3 |
| #define | NONAUTH -4 |
| #define | NAME_LEN 256 |
| #define | T_TXT 16 |
| #define | NO_DATA NO_ADDRESS |
| #define | C_HS 4 |
| #define | NUMNS 8 |
| #define | IPADDRSIZE 4 |
| #define | NUMNSADDR 16 |
Typedefs | |
| typedef querybuf | querybuf_t |
Functions | |
| int main | _ARGS ((int c, char *v[])) |
| static int parsetype | _ARGS ((char *s)) |
| static void hperror | _ARGS ((int errno)) |
| static void printanswer | _ARGS ((struct hostent *hp)) |
| static int ListHosts | _ARGS ((char *namePtr, int queryType)) |
| static int gethostinfo | _ARGS ((char *name)) |
| static int getdomaininfo | _ARGS ((char *name, char *domain)) |
| static int getinfo | _ARGS ((char *name, char *domain, int type)) |
| static int printinfo | _ARGS ((union querybuf *answer, u8_t *eom, int filter, int isls)) |
| static char *DecodeError | _ARGS ((int result)) |
| static u8_t *pr_rr | _ARGS ((u8_t *cp, u8_t *msg, FILE *file, int filter)) |
| static u8_t *pr_cdname | _ARGS ((u8_t *cp, u8_t *msg, u8_t *name, int namelen)) |
| static char *pr_class | _ARGS ((int class)) |
| static char *pr_type | _ARGS ((int type)) |
| static int tcpip_writeall | _ARGS ((int fd, char *buf, unsigned siz)) |
| int | main (c, char **v) |
| static int | parsetype (char *s) |
| static int | parseclass (char *s) |
| static void | printanswer (struct hostent *hp) |
| static void | hperror (int errno) |
| static int | gethostinfo (char *name) |
| static int | getdomaininfo (char *name, char *domain) |
| static int | getinfo (char *name, char *domain, type) |
| static int | printinfo (querybuf_t *answer, u8_t *eom, int filter, int isls) |
| static u8_t * | pr_rr (u8_t *cp, u8_t *msg, FILE *file, int filter) |
| static char * | pr_type (int type) |
| static char * | pr_class (int class) |
| static u8_t * | pr_cdname (u8_t *cp, u8_t *msg, u8_t *name, int namelen) |
| static int | ListHosts (char *namePtr, int queryType) |
| static char * | DecodeError (int result) |
| static int | tcpip_writeall (int fd, char *buf, unsigned siz) |
Variables | |
| int | h_errno |
| FILE * | filePtr |
| state | orig |
| state | _res |
| static u8_t * | cname = NULL |
| int | getclass = C_IN |
| int | gettype |
| int | getdeftype = T_A |
| int | verbose = 0 |
| int | list = 0 |
| int | server_specified = 0 |
| static u8_t | hostbuf [BUFSIZ+1] |
| static u8_t | cnamebuf [MAXDNAME] |
| static char | nbuf [20] |
| char * | resultcodes [] |
|
|
Definition at line 74 of file host.c. Referenced by parseclass(), and pr_class(). |
|
|
|
|
|
Referenced by ListHosts(). |
|
|
Definition at line 65 of file host.c. Referenced by ListHosts(). |
|
|
Definition at line 71 of file host.c. Referenced by printinfo(), and res_query(). |
|
|
Definition at line 61 of file host.c. Referenced by DecodeError(). |
|
|
Definition at line 63 of file host.c. Referenced by DecodeError(). |
|
|
|
|
|
Referenced by ListHosts(). |
|
|
Referenced by ListHosts(). |
|
|
|
|
|
Definition at line 68 of file host.c. Referenced by parsetype(), pr_rr(), pr_type(), and query_chaos(). |
|
|
Definition at line 60 of file host.c. Referenced by DecodeError(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 1369 of file host.c. References ERROR, FORMERR, NO_INFO, NOCHANGE, NOERROR, NONAUTH, NOTIMP, NXDOMAIN, REFUSED, SERVFAIL, and TIME_OUT. Referenced by ListHosts(), and printinfo(). |
|
||||||||||||
|
Definition at line 442 of file host.c. References getdeftype, getinfo(), and gettype. Referenced by gethostinfo(). |
|
|
Definition at line 385 of file host.c. References cp, getdomaininfo(), n, NULL, and strcmp. Referenced by main(). |
|
||||||||||||||||
|
Definition at line 449 of file host.c. References _res, answer, bp, buf, buflen, cp, getclass, h_errno, host, i, j, MAXDNAME, n, NO_RECOVERY, NULL, state::options, printf, printinfo(), QUERY, RES_DEBUG, res_mkquery(), res_send(), sprintf(), T_ANY, TRY_AGAIN, and type. Referenced by getdomaininfo(). |
|
|
Definition at line 356 of file host.c. References fprintf(), HOST_NOT_FOUND, NO_ADDRESS, NO_RECOVERY, stderr, and TRY_AGAIN. Referenced by main(). |
|
||||||||||||
|
Definition at line 961 of file host.c. References _res, answer, bcopy, buf, C_IN, cp, DecodeError(), DHF_AA, DHF_RCODE, dlen, dn_expand(), dn_skipname(), ERROR, error, FORMERR, i, IPADDRSIZE, NAME_LEN, NOERROR, NOTIMP, ntohs, NUMNS, NUMNSADDR, NXDOMAIN, state::options, printf, QFIXEDSZ, QUERY, REFUSED, RES_DEBUG, res_mkquery(), res_send(), result, server_specified, SERVFAIL, strcasecmp, strlen(), strncpy(), T_A, T_NS, type, and verbose. Referenced by main(). |
|
||||||||||||
|
Definition at line 110 of file host.c. References _res, addr, atoi, c, exit(), fprintf(), getclass, getdeftype, gethostbyname, gethostinfo(), gettype, h_errno, hperror(), htons, inet_aton(), inet_ntoa(), list, ListHosts(), NAMESERVER_PORT, state::nsaddr_list, state::nsport_list, NULL, state::options, p, parseclass(), parsetype(), printanswer(), printf, RES_DEBUG, RES_DEFNAMES, res_init(), RES_RECURSE, RES_USEVC, state::retrans, state::retry, s, server_specified, sprintf(), stderr, strchr, strcmp, strncmp(), T_ANY, T_PTR, TRY_AGAIN, and verbose. |
|
|
Definition at line 321 of file host.c. References atoi, C_ANY, C_CHAOS, C_HS, C_IN, exit(), fprintf(), stderr, and strcmp. Referenced by main(). |
|
|
Definition at line 267 of file host.c. References atoi, exit(), fprintf(), stderr, strcmp, and T_TXT. Referenced by main(). |
|
||||||||||||||||||||
|
Definition at line 905 of file host.c. References dn_expand(), n, and NULL. Referenced by pr_rr(). |
|
|
Definition at line 886 of file host.c. References C_ANY, C_CHAOS, C_HS, C_IN, EOF, NULL, sprintf(), and verbose. Referenced by pr_rr(). |
|
||||||||||||||||||||
|
Definition at line 594 of file host.c. References bcopy, c, C_IN, dlen, dn_expand(), doprint(), file, fprintf(), getprotobynumber(), getservbyport(), gettype, htons, inet_ntoa(), int(), MAXDNAME, n, NULL, pr_cdname(), pr_class(), pr_type(), proto, strcat(), T_A, T_ANY, T_CNAME, T_GID, T_HINFO, T_MB, T_MD, T_MF, T_MG, T_MINFO, T_MR, T_MX, T_NS, T_PTR, T_SOA, T_TXT, T_UID, T_UINFO, T_WKS, type, and verbose. Referenced by printinfo(). |
|
|
Definition at line 823 of file host.c. References EOF, NULL, sprintf(), T_A, T_ANY, T_AXFR, T_CNAME, T_GID, T_HINFO, T_MAILA, T_MAILB, T_MB, T_MD, T_MF, T_MG, T_MINFO, T_MR, T_MX, T_NS, T_NULL, T_PTR, T_SOA, T_TXT, T_UID, T_UINFO, T_WKS, and verbose. Referenced by pr_rr(). |
|
|
Definition at line 339 of file host.c. References cp, inet_ntoa(), and printf. Referenced by main(). |
|
||||||||||||||||||||
|
Definition at line 485 of file host.c. References _res, bp, buflen, cp, DecodeError(), dns_hdr::dh_ancount, dns_hdr::dh_arcount, dns_hdr::dh_flag1, dns_hdr::dh_flag2, dns_hdr::dh_nscount, dns_hdr::dh_qdcount, DHF_AA, DHF_RCODE, dn_skipname(), FORMERR, h_errno, HOST_NOT_FOUND, i, j, n, NO_DATA, NO_RECOVERY, NOERROR, NOTIMP, ntohs, NXDOMAIN, state::options, pr_rr(), printf, QFIXEDSZ, REFUSED, RES_DEBUG, SERVFAIL, stdout, TRY_AGAIN, and verbose. Referenced by getinfo(). |
|
||||||||||||||||
|
|
|
|
Definition at line 52 of file res_init.c. Referenced by endhostent(), getanswer(), gethostbyaddr(), getinfo(), ListHosts(), main(), printinfo(), res_init(), res_mkquery(), res_query(), res_querydomain(), res_search(), res_send(), and sethostent(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 82 of file host.c. Referenced by getanswer(), getinfo(), and main(). |
|
|
Definition at line 83 of file host.c. Referenced by getdomaininfo(), and main(). |
|
|
Definition at line 83 of file host.c. Referenced by getdomaininfo(), main(), and pr_rr(). |
|
|
Definition at line 69 of file res_query.c. Referenced by getanswer(), gethostbyname(), getinfo(), main(), printinfo(), res_init(), res_query(), and res_search(). |
|
|
|
|
|
Definition at line 85 of file host.c. Referenced by addtomach(), c_list(), caselist(), cleandir(), command(), delete_config(), descendtree(), dogroup(), m_paragraph(), main(), parsecmd(), push_attr(), restore_attr(), and shorten(). |
|
|
Definition at line 817 of file host.c. Referenced by chg_buf(), do_file(), dumpopts(), main(), and res_querydomain(). |
|
|
Definition at line 79 of file host.c. Referenced by main(). |
|
|
Initial value: {
"NOERROR",
"FORMERR",
"SERVFAIL",
"NXDOMAIN",
"NOTIMP",
"REFUSED",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"NOCHANGE",
}
|
|
|
Definition at line 86 of file host.c. Referenced by ListHosts(), and main(). |
|
|
|
1.4.6