|
ReactOS 0.4.16-dev-1946-g52006dd
|
#include "config.h"#include <stdarg.h>#include <assert.h>#include <unistd.h>#include <signal.h>#include <errno.h>#include <string.h>#include <sys/time.h>#include "adns.h"#include "dlist.h"

Go to the source code of this file.
Classes | |
| union | rr_align |
| struct | vbuf |
| struct | parseinfo |
| struct | typeinfo |
| struct | allocnode |
| union | maxalign |
| struct | qcontext |
| struct | adns__query |
| struct | query_queue |
| struct | adns__state |
| struct | adns__state::server |
| struct | adns__state::sortlist |
| struct | findlabel_state |
Macros | |
| #define | MAXSERVERS 5 |
| #define | MAXSORTLIST 15 |
| #define | UDPMAXRETRIES 15 |
| #define | UDPRETRYMS 2000 |
| #define | TCPWAITMS 30000 |
| #define | TCPCONNMS 14000 |
| #define | TCPIDLEMS 30000 |
| #define | MAXTTLBELIEVE (7*86400) /* any TTL > 7 days is capped */ |
| #define | DNS_PORT 53 |
| #define | DNS_MAXUDP 512 |
| #define | DNS_MAXLABEL 63 |
| #define | DNS_MAXDOMAIN 255 |
| #define | DNS_HDRSIZE 12 |
| #define | DNS_IDOFFSET 0 |
| #define | DNS_CLASS_IN 1 |
| #define | DNS_INADDR_ARPA "in-addr", "arpa" |
| #define | MAX_POLLFDS ADNS_POLLFDS_RECOMMENDED |
| #define | MEM_ROUND(sz) |
| #define | GETIL_B(cb) (((dgram)[(cb)++]) & 0x0ff) |
| #define | GET_B(cb, tv) ((tv)= GETIL_B((cb))) |
| #define | GET_W(cb, tv) ((tv)=0, (tv)|=(GETIL_B((cb))<<8), (tv)|=GETIL_B(cb), (tv)) |
| #define | GET_L(cb, tv) |
Typedefs | |
| typedef unsigned char | byte |
| typedef struct allocnode | allocnode |
Enumerations | |
| enum | consistency_checks { cc_user , cc_entex , cc_freq } |
| enum | dns_rcode { rcode_noerror , rcode_formaterror , rcode_servfail , rcode_nxdomain , rcode_notimp , rcode_refused } |
| enum | parsedomain_flags { pdf_quoteok = 0x001 } |
| #define DNS_CLASS_IN 1 |
Definition at line 78 of file internal.h.
| #define DNS_HDRSIZE 12 |
Definition at line 76 of file internal.h.
| #define DNS_IDOFFSET 0 |
Definition at line 77 of file internal.h.
| #define DNS_INADDR_ARPA "in-addr", "arpa" |
Definition at line 80 of file internal.h.
| #define DNS_MAXDOMAIN 255 |
Definition at line 75 of file internal.h.
| #define DNS_MAXLABEL 63 |
Definition at line 74 of file internal.h.
| #define DNS_MAXUDP 512 |
Definition at line 73 of file internal.h.
| #define DNS_PORT 53 |
Definition at line 72 of file internal.h.
Definition at line 718 of file internal.h.
Definition at line 717 of file internal.h.
Definition at line 715 of file internal.h.
| #define MAX_POLLFDS ADNS_POLLFDS_RECOMMENDED |
Definition at line 82 of file internal.h.
| #define MAXSERVERS 5 |
Definition at line 63 of file internal.h.
| #define MAXSORTLIST 15 |
Definition at line 64 of file internal.h.
| #define MAXTTLBELIEVE (7*86400) /* any TTL > 7 days is capped */ |
Definition at line 70 of file internal.h.
| #define MEM_ROUND | ( | sz | ) |
Definition at line 711 of file internal.h.
| #define TCPCONNMS 14000 |
Definition at line 68 of file internal.h.
| #define TCPIDLEMS 30000 |
Definition at line 69 of file internal.h.
| #define TCPWAITMS 30000 |
Definition at line 67 of file internal.h.
| #define UDPMAXRETRIES 15 |
Definition at line 65 of file internal.h.
| #define UDPRETRYMS 2000 |
Definition at line 66 of file internal.h.
Definition at line 36 of file internal.h.
| Enumerator | |
|---|---|
| cc_user | |
| cc_entex | |
| cc_freq | |
Definition at line 84 of file internal.h.
| Enumerator | |
|---|---|
| rcode_noerror | |
| rcode_formaterror | |
| rcode_servfail | |
| rcode_nxdomain | |
| rcode_notimp | |
| rcode_refused | |
Definition at line 90 of file internal.h.
| Enumerator | |
|---|---|
| pdf_quoteok | |
Definition at line 577 of file internal.h.
| void * adns__alloc_final | ( | adns_query | qu, |
| size_t | sz | ||
| ) |
Definition at line 385 of file query.c.
Referenced by adns__makefinal_block(), and adns__makefinal_str().
| void * adns__alloc_interim | ( | adns_query | qu, |
| size_t | sz | ||
| ) |
Definition at line 342 of file query.c.
Referenced by adns__alloc_preserved(), adns__procdgram(), pa_txt(), pap_domain(), pap_findaddrs(), pap_mailbox822(), and pap_qstring().
| void * adns__alloc_mine | ( | adns_query | qu, |
| size_t | sz | ||
| ) |
Definition at line 362 of file query.c.
Referenced by adns__procdgram().
| void * adns__alloc_preserved | ( | adns_query | qu, |
| size_t | sz | ||
| ) |
Definition at line 352 of file query.c.
Referenced by adns__procdgram(), and save_owner().
| void adns__autosys | ( | adns_state | ads, |
| struct timeval | now | ||
| ) |
| void adns__consistency | ( | adns_state | ads, |
| adns_query | qu, | ||
| consistency_checks | cc | ||
| ) |
Definition at line 185 of file check.c.
Referenced by adns_afterselect(), adns_beforeselect(), adns_cancel(), adns_check(), adns_checkconsistency(), adns_finish(), adns_firsttimeout(), adns_forallqueries_begin(), adns_forallqueries_next(), adns_globalsystemfailure(), adns_init(), adns_init_strcfg(), adns_processany(), adns_processexceptional(), adns_processreadable(), adns_processtimeouts(), adns_processwriteable(), adns_submit(), and adns_wait().
| void adns__debug | ( | adns_state | ads, |
| int | serv, | ||
| adns_query | qu, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
| void void void adns__diag | ( | adns_state | ads, |
| int | serv, | ||
| adns_query | qu, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
| const char * adns__diag_domain | ( | adns_state | ads, |
| int | serv, | ||
| adns_query | qu, | ||
| vbuf * | vb, | ||
| const byte * | dgram, | ||
| int | dglen, | ||
| int | cbyte | ||
| ) |
Definition at line 162 of file general.c.
Referenced by adns__procdgram(), and adns__vdiag().
| void adns__fdevents | ( | adns_state | ads, |
| const struct pollfd * | pollfds, | ||
| int | npollfds, | ||
| int | maxfd, | ||
| const fd_set * | readfds, | ||
| const fd_set * | writefds, | ||
| const fd_set * | exceptfds, | ||
| struct timeval | now, | ||
| int * | r_r | ||
| ) |
Definition at line 542 of file event.c.
Referenced by adns_afterselect(), and adns_processany().
| adns_status adns__findlabel_next | ( | findlabel_state * | fls, |
| int * | lablen_r, | ||
| int * | labstart_r | ||
| ) |
Definition at line 74 of file parse.c.
Referenced by adns__findrr_anychk(), adns__mkquery_frdgram(), adns__parse_domain_more(), pa_ptr(), and pap_mailbox822().
| void adns__findlabel_start | ( | findlabel_state * | fls, |
| adns_state | ads, | ||
| int | serv, | ||
| adns_query | qu, | ||
| const byte * | dgram, | ||
| int | dglen, | ||
| int | max, | ||
| int | dmbegin, | ||
| int * | dmend_rlater | ||
| ) |
Definition at line 59 of file parse.c.
Referenced by adns__findrr_anychk(), adns__mkquery_frdgram(), adns__parse_domain(), pa_ptr(), and pap_mailbox822().
| adns_status adns__findrr | ( | adns_query | qu, |
| int | serv, | ||
| const byte * | dgram, | ||
| int | dglen, | ||
| int * | cbyte_io, | ||
| int * | type_r, | ||
| int * | class_r, | ||
| unsigned long * | ttl_r, | ||
| int * | rdlen_r, | ||
| int * | rdstart_r, | ||
| int * | ownermatchedquery_r | ||
| ) |
Definition at line 227 of file parse.c.
Referenced by adns__procdgram().
| adns_status adns__findrr_anychk | ( | adns_query | qu, |
| int | serv, | ||
| const byte * | dgram, | ||
| int | dglen, | ||
| int * | cbyte_io, | ||
| int * | type_r, | ||
| int * | class_r, | ||
| unsigned long * | ttl_r, | ||
| int * | rdlen_r, | ||
| int * | rdstart_r, | ||
| const byte * | eo_dgram, | ||
| int | eo_dglen, | ||
| int | eo_cbyte, | ||
| int * | eo_matched_r | ||
| ) |
Definition at line 163 of file parse.c.
Referenced by adns__findrr(), and pap_findaddrs().
| const typeinfo * adns__findtype | ( | adns_rrtype | type | ) |
Definition at line 1025 of file types.c.
Referenced by adns_rr_info(), adns_submit(), pa_ptr(), and pap_hostaddr().
| int adns__internal_check | ( | adns_state | ads, |
| adns_query * | query_io, | ||
| adns_answer ** | answer, | ||
| void ** | context_r | ||
| ) |
Definition at line 670 of file event.c.
Referenced by adns_check(), and adns_wait().
| adns_status adns__internal_submit | ( | adns_state | ads, |
| adns_query * | query_r, | ||
| const typeinfo * | typei, | ||
| vbuf * | qumsg_vb, | ||
| int | id, | ||
| adns_queryflags | flags, | ||
| struct timeval | now, | ||
| const qcontext * | ctx | ||
| ) |
Definition at line 111 of file query.c.
Referenced by pa_ptr(), and pap_hostaddr().
| void adns__isort | ( | void * | array, |
| int | nobjs, | ||
| int | sz, | ||
| void * | tempbuf, | ||
| int(*)(void *context, const void *a, const void *b) | needswap, | ||
| void * | context | ||
| ) |
Definition at line 319 of file general.c.
Referenced by adns__query_done(), and pap_findaddrs().
| void adns__makefinal_block | ( | adns_query | qu, |
| void ** | blpp, | ||
| size_t | sz | ||
| ) |
Definition at line 565 of file query.c.
Referenced by makefinal_query(), mf_manyistr(), and mfp_hostaddr().
| void adns__makefinal_str | ( | adns_query | qu, |
| char ** | strp | ||
| ) |
Definition at line 553 of file query.c.
Referenced by makefinal_query(), mf_intstr(), mf_intstrpair(), mf_manyistr(), mf_soa(), mf_str(), mf_strpair(), and mfp_hostaddr().
| adns_status adns__mkquery | ( | adns_state | ads, |
| vbuf * | vb, | ||
| int * | id_r, | ||
| const char * | owner, | ||
| int | ol, | ||
| const typeinfo * | typei, | ||
| adns_queryflags | flags | ||
| ) |
Definition at line 81 of file transmit.c.
Referenced by query_simple().
| adns_status adns__mkquery_frdgram | ( | adns_state | ads, |
| vbuf * | vb, | ||
| int * | id_r, | ||
| const byte * | qd_dgram, | ||
| int | qd_dglen, | ||
| int | qd_begin, | ||
| adns_rrtype | type, | ||
| adns_queryflags | flags | ||
| ) |
Definition at line 138 of file transmit.c.
Referenced by adns__procdgram(), pa_ptr(), and pap_hostaddr().
| void adns__must_gettimeofday | ( | adns_state | ads, |
| const struct timeval ** | now_io, | ||
| struct timeval * | tv_buf | ||
| ) |
Definition at line 149 of file event.c.
Referenced by adns_afterselect(), adns_beforeselect(), and adns_processtimeouts().
| adns_status adns__parse_domain | ( | adns_state | ads, |
| int | serv, | ||
| adns_query | qu, | ||
| vbuf * | vb, | ||
| adns_queryflags | flags, | ||
| const byte * | dgram, | ||
| int | dglen, | ||
| int * | cbyte_io, | ||
| int | max | ||
| ) |
Definition at line 117 of file parse.c.
Referenced by adns__diag_domain(), adns__procdgram(), and pap_domain().
| adns_status adns__parse_domain_more | ( | findlabel_state * | fls, |
| adns_state | ads, | ||
| adns_query | qu, | ||
| vbuf * | vb, | ||
| parsedomain_flags | flags, | ||
| const byte * | dgram | ||
| ) |
Definition at line 127 of file parse.c.
Referenced by adns__parse_domain(), and pap_mailbox822().
| int adns__pollfds | ( | adns_state | ads, |
| struct pollfd | pollfds_buf[MAX_POLLFDS] | ||
| ) |
Definition at line 312 of file event.c.
Referenced by adns_afterselect(), adns_beforeselect(), and adns_processany().
| void adns__procdgram | ( | adns_state | ads, |
| const byte * | dgram, | ||
| int | len, | ||
| int | serv, | ||
| int | viatcp, | ||
| struct timeval | now | ||
| ) |
Definition at line 36 of file reply.c.
Referenced by adns_processreadable().
| void adns__query_done | ( | adns_query | qu | ) |
Definition at line 503 of file query.c.
Referenced by adns__procdgram(), adns__query_fail(), icb_hostaddr(), and icb_ptr().
| void adns__query_fail | ( | adns_query | qu, |
| adns_status | stat | ||
| ) |
Definition at line 547 of file query.c.
Referenced by adns__procdgram(), adns__query_done(), adns__query_send(), adns__search_next(), adns_globalsystemfailure(), adns_submit(), icb_ptr(), query_simple(), query_submit(), tcp_events(), and timeouts_queue().
| void adns__query_send | ( | adns_query | qu, |
| struct timeval | now | ||
| ) |
Definition at line 232 of file transmit.c.
Referenced by adns__procdgram(), query_submit(), and timeouts_queue().
| void adns__querysend_tcp | ( | adns_query | qu, |
| struct timeval | now | ||
| ) |
Definition at line 168 of file transmit.c.
Referenced by query_usetcp(), and tcp_connected().
| void adns__reset_preserved | ( | adns_query | qu | ) |
Definition at line 410 of file query.c.
Referenced by adns__procdgram(), adns__query_fail(), and makefinal_query().
| void adns__search_next | ( | adns_state | ads, |
| adns_query | qu, | ||
| struct timeval | now | ||
| ) |
Definition at line 151 of file query.c.
Referenced by adns__procdgram(), adns_submit(), and query_simple().
| int adns__setnonblock | ( | adns_state | ads, |
| ADNS_SOCKET | fd | ||
| ) |
Definition at line 457 of file setup.c.
Referenced by adns__tcp_tryconnect(), and init_finish().
| void adns__sigpipe_protect | ( | adns_state | ads | ) |
Definition at line 340 of file general.c.
Referenced by adns__querysend_tcp(), and adns_processwriteable().
| void adns__sigpipe_unprotect | ( | adns_state | ads | ) |
Definition at line 360 of file general.c.
Referenced by adns__querysend_tcp(), and adns_processwriteable().
Definition at line 59 of file event.c.
Referenced by adns__querysend_tcp(), adns__tcp_tryconnect(), adns_globalsystemfailure(), adns_processexceptional(), adns_processreadable(), adns_processwriteable(), and tcp_events().
| void adns__tcp_tryconnect | ( | adns_state | ads, |
| struct timeval | now | ||
| ) |
Definition at line 90 of file event.c.
Referenced by query_usetcp(), and tcp_events().
| void adns__timeouts | ( | adns_state | ads, |
| int | act, | ||
| struct timeval ** | tv_io, | ||
| struct timeval * | tvbuf, | ||
| struct timeval | now | ||
| ) |
Definition at line 283 of file event.c.
Referenced by adns_beforeselect(), adns_firsttimeout(), and adns_processtimeouts().
| void adns__transfer_interim | ( | adns_query | from, |
| adns_query | to, | ||
| void * | block, | ||
| size_t | sz | ||
| ) |
Definition at line 366 of file query.c.
Referenced by icb_hostaddr().
Definition at line 458 of file query.c.
Referenced by adns__procdgram(), and pap_findaddrs().
Definition at line 131 of file general.c.
Referenced by adns__diag_domain(), adns__parse_domain_more(), adns__querysend_tcp(), adns__search_next(), adns__vbuf_appendstr(), adns_rr_info(), adns_submit(), csp_qstring(), pap_mailbox822(), and vbuf__append_quoted1035().
Definition at line 149 of file general.c.
Referenced by adns__diag_domain(), adns__search_next(), and pap_mailbox822().
Definition at line 116 of file general.c.
Referenced by adns__query_done(), adns__querysend_tcp(), adns_processreadable(), adns_processwriteable(), mkquery_header(), pap_findaddrs(), and pap_mailbox822().
Definition at line 155 of file general.c.
Referenced by adns__internal_submit(), adns__procdgram(), adns__vdiag(), adns_finish(), adns_rr_info(), and free_query_allocs().
Definition at line 112 of file general.c.
Referenced by adns__procdgram(), adns__vbuf_free(), adns__vdiag(), adns_rr_info(), init_begin(), query_alloc(), query_simple(), and query_submit().
| void adns__vdiag | ( | adns_state | ads, |
| const char * | pfx, | ||
| adns_initflags | prevent, | ||
| int | serv, | ||
| adns_query | qu, | ||
| const char * | fmt, | ||
| va_list | al | ||
| ) |
Definition at line 45 of file general.c.
Referenced by adns__debug(), adns__diag(), and adns__warn().
| void void adns__warn | ( | adns_state | ads, |
| int | serv, | ||
| adns_query | qu, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 699 of file internal.h.
Referenced by adns__findrr_anychk(), adns__mkquery(), adns__parse_domain_more(), and ctype_domainunquoted().
Definition at line 698 of file internal.h.
Referenced by adns__mkquery(), adns__parse_domain_more(), and ctype_domainunquoted().
Definition at line 703 of file internal.h.
Referenced by vbuf__append_quoted1035().
Definition at line 697 of file internal.h.
Referenced by nextword(), and readconfiggeneric().
Definition at line 707 of file internal.h.
Referenced by adns_processreadable(), and adns_processwriteable().
Definition at line 34 of file parse.c.
Referenced by adns__parse_domain_more().