ReactOS 0.4.15-dev-8100-g1887773
adnsresfilter.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <search.h>
#include <assert.h>
#include <ctype.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include "config.h"
#include "adns.h"
#include "dlist.h"
#include "tvarith.h"
#include "client.h"
Include dependency graph for adnsresfilter.c:

Go to the source code of this file.

Classes

struct  outqueuenode
 
struct  treething
 

Functions

static int nonblock (int fd, int isnonblock)
 
void quitnow (int exitstatus)
 
static void sysfail (const char *what) NONRETURNING
 
static voidxmalloc (size_t sz)
 
static void outputerr (void)
 
static void usage (void)
 
static void usageerr (const char *why) NONRETURNING
 
static void adnsfail (const char *what, int e) NONRETURNING
 
static void settimeout (const char *arg)
 
static void parseargs (const char *const *argv)
 
static void queueoutchar (int c)
 
static void queueoutstr (const char *str, int len)
 
static void writestdout (struct outqueuenode *entry)
 
static void replacetextwithname (struct outqueuenode *entry)
 
static void checkadnsqueries (void)
 
static void restartbuf (void)
 
static int comparer (const void *a, const void *b)
 
static void procaddr (void)
 
static void startaddr (void)
 
static void readstdin (void)
 
static void startup (void)
 
int main (int argc, const char *const *argv)
 

Variables

static int bracket
 
static int forever
 
static int address
 
static unsigned long timeout = 1000
 
static adns_rrtype rrt = adns_r_ptr
 
static adns_initflags initflags = 0
 
static const charconfig_text
 
static int outblocked
 
static int inputeof
 
struct {
   struct outqueuenode *   head
 
   struct outqueuenode *   tail
 
outqueue
 
static int peroutqueuenode
 
static int outqueuelen
 
static struct sockaddr_in sa
 
static adns_state ads
 
static char addrtextbuf [14]
 
static int cbyte
 
static int inbyte
 
static int inbuf
 
static unsigned char bytes [4]
 
static struct timeval printbefore
 
static struct treethingnewthing
 
static voidtreeroot
 

Function Documentation

◆ adnsfail()

static void adnsfail ( const char what,
int  e 
)
static

Definition at line 141 of file adnsresfilter.c.

141 {
142 fprintf(stderr,"adnsresfilter: adns call failed: %s: %s\n",what,strerror(e));
143 quitnow(2);
144}
void quitnow(int exitstatus)
Definition: adnsresfilter.c:96
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define e
Definition: ke_i.h:82
const char * strerror(int err)
Definition: compat_str.c:23

Referenced by procaddr(), and startup().

◆ checkadnsqueries()

static void checkadnsqueries ( void  )
static

Definition at line 281 of file adnsresfilter.c.

281 {
282 adns_query qu;
283 adns_answer *ans;
284 void *context;
285 struct treething *foundthing;
286 int r;
287
288 for (;;) {
289 qu= 0; context= 0; ans= 0;
291 if (r == ESRCH || r == EAGAIN) break;
292 assert(!r);
293 foundthing= context;
294 foundthing->ans= ans;
295 foundthing->qu= 0;
296 }
297}
#define EAGAIN
Definition: acclib.h:83
ADNS_API int adns_check(adns_state ads, adns_query *query_io, adns_answer **answer_r, void **context_r)
Definition: event.c:731
static adns_state ads
Definition: adnsresfilter.c:70
#define assert(x)
Definition: debug.h:53
#define ESRCH
Definition: errno.h:9
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
Definition: http.c:7252
adns_query qu
Definition: adnsresfilter.c:79
adns_answer * ans
Definition: adnsresfilter.c:80

Referenced by main().

◆ comparer()

static int comparer ( const void a,
const void b 
)
static

Definition at line 304 of file adnsresfilter.c.

304 {
305 return memcmp(a,b,4);
306}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by find(), find1(), and procaddr().

◆ main()

int main ( int argc  ,
const char *const argv 
)

Definition at line 411 of file adnsresfilter.c.

411 {
412 int r, maxfd;
413 fd_set readfds, writefds, exceptfds;
414 struct outqueuenode *entry;
415 struct timeval *tv, tvbuf, now;
416
418 startup();
419
420 while (!inputeof || outqueue.head) {
421 maxfd= 2;
422 tv= 0;
423 FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds);
424 if ((entry= outqueue.head) && !outblocked) {
425 if (!entry->addr) {
427 continue;
428 }
429 if (entry->addr->ans) {
430 if (entry->addr->ans->nrrs)
432 entry->addr= 0;
433 continue;
434 }
435 r= gettimeofday(&now,0); if (r) sysfail("gettimeofday");
436 if (forever) {
437 tv= 0;
438 } else if (!timercmp(&now,&entry->printbefore,<)) {
439 entry->addr= 0;
440 continue;
441 } else {
442 tvbuf.tv_sec= entry->printbefore.tv_sec - now.tv_sec - 1;
443 tvbuf.tv_usec= entry->printbefore.tv_usec - now.tv_usec + 1000000;
444 tvbuf.tv_sec += tvbuf.tv_usec / 1000000;
445 tvbuf.tv_usec %= 1000000;
446 tv= &tvbuf;
447 }
448 adns_beforeselect(ads,&maxfd,&readfds,&writefds,&exceptfds,
449 &tv,&tvbuf,&now);
450 }
451 if (outblocked) FD_SET(1,&writefds);
452 if (!inputeof && outqueuelen<1024) FD_SET(0,&readfds);
453
455 r= select(maxfd,&readfds,&writefds,&exceptfds,tv);
457 if (r < 0) { if (r == EINTR) continue; else sysfail("select"); }
458
459 r= gettimeofday(&now,0); if (r) sysfail("gettimeofday");
460 adns_afterselect(ads,maxfd,&readfds,&writefds,&exceptfds,&now);
462
463 if (FD_ISSET(0,&readfds)) {
464 if (!forever) {
467 }
468 readstdin();
469 } else if (FD_ISSET(1,&writefds)) {
470 outblocked= 0;
471 }
472 }
473 if (nonblock(0,0)) sysfail("un-nonblock stdin");
474 if (nonblock(1,0)) sysfail("un-nonblock stdout");
476 exit(0);
477}
#define EINTR
Definition: acclib.h:80
ADNS_API void adns_finish(adns_state ads)
Definition: setup.c:650
ADNS_API void adns_beforeselect(adns_state ads, int *maxfd, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval **tv_mod, struct timeval *tv_buf, const struct timeval *now)
Definition: event.c:562
ADNS_API void adns_afterselect(adns_state ads, int maxfd, const fd_set *readfds, const fd_set *writefds, const fd_set *exceptfds, const struct timeval *now)
Definition: event.c:595
#define ADNS_CLEAR_ERRNO
Definition: adns_win32.h:108
#define gettimeofday(tv, tz)
Definition: adns_win32.h:159
#define ADNS_CAPTURE_ERRNO
Definition: adns_win32.h:107
static void writestdout(struct outqueuenode *entry)
static int nonblock(int fd, int isnonblock)
Definition: adnsresfilter.c:86
static struct timeval printbefore
Definition: adnsresfilter.c:75
static void parseargs(const char *const *argv)
static void replacetextwithname(struct outqueuenode *entry)
static int inputeof
Definition: adnsresfilter.c:65
static int outblocked
Definition: adnsresfilter.c:65
static void sysfail(const char *what) NONRETURNING
static void startup(void)
static void readstdin(void)
static int forever
Definition: adnsresfilter.c:59
static void checkadnsqueries(void)
static int outqueuelen
Definition: adnsresfilter.c:67
static struct @4227 outqueue
#define timercmp(tvp, uvp, cmp)
Definition: rdesktop.h:184
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
Definition: select.c:41
time_t now
Definition: finger.c:65
uint32_t entry
Definition: isohybrid.c:63
#define argv
Definition: mplay32.c:18
#define exit(n)
Definition: config.h:202
Definition: winsock.h:66
Definition: dhcpd.h:245
unsigned long tv_sec
Definition: linux.h:1738
unsigned long tv_usec
Definition: linux.h:1739
static void timevaladd(struct timeval *tv_io, long ms)
Definition: tvarith.h:31
#define FD_ISSET(fd, set)
Definition: winsock.h:100
#define FD_ZERO(set)
Definition: winsock.h:96
#define FD_SET(fd, set)
Definition: winsock.h:89

◆ nonblock()

static int nonblock ( int  fd,
int  isnonblock 
)
static

Definition at line 86 of file adnsresfilter.c.

86 {
87 int r;
88
89 r= fcntl(fd,F_GETFL);
90 if (r==-1) return -1;
91 r= fcntl(fd,F_SETFL, isnonblock ? r|O_NONBLOCK : r&~O_NONBLOCK);
92 if (r==-1) return -1;
93 return 0;
94}
#define O_NONBLOCK
Definition: port.h:158
static int fd
Definition: io.c:51

Referenced by main(), quitnow(), and startup().

◆ outputerr()

static void outputerr ( void  )
static

Definition at line 114 of file adnsresfilter.c.

115 { sysfail("write to stdout"); }

Referenced by usage().

◆ parseargs()

static void parseargs ( const char *const argv)
static

Definition at line 152 of file adnsresfilter.c.

152 {
153 const char *arg;
154 int c;
155
156 while ((arg= *++argv)) {
157 if (arg[0] != '-') usageerr("no non-option arguments are allowed");
158 if (arg[1] == '-') {
159 if (!strcmp(arg,"--timeout")) {
160 if (!(arg= *++argv)) usageerr("--timeout needs a value");
162 forever= 0;
163 } else if (!strcmp(arg,"--wait")) {
164 forever= 1;
165 } else if (!strcmp(arg,"--brackets")) {
166 bracket= 1;
167 } else if (!strcmp(arg,"--address")) {
168 address= 1;
169 } else if (!strcmp(arg,"--unchecked")) {
171 } else if (!strcmp(arg,"--config")) {
172 if (!(arg= *++argv)) usageerr("--config needs a value");
174 } else if (!strcmp(arg,"--debug")) {
176 } else if (!strcmp(arg,"--help")) {
177 usage(); quitnow(0);
178 } else if (!strcmp(arg,"--version")) {
179 VERSION_PRINT_QUIT("adnsresfilter"); quitnow(0);
180 } else {
181 usageerr("unknown long option");
182 }
183 } else {
184 while ((c= *++arg)) {
185 switch (c) {
186 case 't':
187 if (*++arg) settimeout(arg);
188 else if ((arg= *++argv)) settimeout(arg);
189 else usageerr("-t needs a value");
190 forever= 0;
191 arg= "\0";
192 break;
193 case 'w':
194 forever= 1;
195 break;
196 case 'b':
197 bracket= 1;
198 break;
199 case 'a':
200 address= 1;
201 break;
202 case 'u':
204 break;
205 case 'h':
206 usage();
207 quitnow(0);
208 default:
209 usageerr("unknown short option");
210 }
211 }
212 }
213 }
214}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
@ adns_r_ptr_raw
Definition: adns.h:130
@ adns_if_debug
Definition: adns.h:91
static adns_initflags initflags
Definition: adnsresfilter.c:62
static void usageerr(const char *why) NONRETURNING
static const char * config_text
Definition: adnsresfilter.c:63
static int bracket
Definition: adnsresfilter.c:59
static void settimeout(const char *arg)
static void usage(void)
static adns_rrtype rrt
Definition: adnsresfilter.c:61
#define VERSION_PRINT_QUIT(program)
Definition: client.h:42
GLuint address
Definition: glext.h:9393
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
void * arg
Definition: msvc.h:10

Referenced by main().

◆ procaddr()

static void procaddr ( void  )
static

Definition at line 308 of file adnsresfilter.c.

308 {
309 struct treething *foundthing;
310 void **searchfound;
311 struct outqueuenode *entry;
312 int r;
313
314 if (!newthing) {
315 newthing= xmalloc(sizeof(struct treething));
316 newthing->qu= 0;
317 newthing->ans= 0;
318 }
319
320 memcpy(newthing->bytes,bytes,4);
321 searchfound= tsearch(newthing,&treeroot,comparer);
322 if (!searchfound) sysfail("tsearch");
323 foundthing= *searchfound;
324
325 if (foundthing == newthing) {
326 newthing= 0;
327 memcpy(&sa.sin_addr,bytes,4);
328 r= adns_submit_reverse(ads, (const struct sockaddr*)&sa,
329 rrt,0,foundthing,&foundthing->qu);
330 if (r) adnsfail("submit",r);
331 }
332 entry= xmalloc(sizeof(*entry));
333 entry->buffer= xmalloc(inbuf);
334 entry->textp= entry->buffer;
336 entry->textlen= inbuf;
337 entry->addr= foundthing;
338 entry->printbefore= printbefore;
340 outqueuelen++;
341 inbuf= 0;
342 cbyte= -1;
343}
ADNS_API int adns_submit_reverse(adns_state ads, const struct sockaddr *addr, adns_rrtype type, adns_queryflags flags, void *context, adns_query *query_r)
Definition: query.c:304
static void * xmalloc(size_t sz)
static struct treething * newthing
Definition: adnsresfilter.c:83
static int comparer(const void *a, const void *b)
static int inbuf
Definition: adnsresfilter.c:73
static char addrtextbuf[14]
Definition: adnsresfilter.c:72
static void * treeroot
Definition: adnsresfilter.c:84
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
static void adnsfail(const char *what, int e) NONRETURNING
static int cbyte
Definition: adnsresfilter.c:73
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define LIST_LINK_TAIL(list, node)
Definition: dlist.h:51

Referenced by readstdin().

◆ queueoutchar()

static void queueoutchar ( int  c)
static

Definition at line 216 of file adnsresfilter.c.

216 {
217 struct outqueuenode *entry;
218
219 entry= outqueue.tail;
220 if (!entry || entry->addr || entry->textlen >= peroutqueuenode) {
221 peroutqueuenode= !peroutqueuenode || !entry || entry->addr ? 128 :
222 peroutqueuenode >= 1024 ? 4096 : peroutqueuenode<<2;
223 entry= xmalloc(sizeof(*entry));
224 entry->buffer= xmalloc(peroutqueuenode);
225 entry->textp= entry->buffer;
226 entry->textlen= 0;
227 entry->addr= 0;
229 outqueuelen++;
230 }
231 entry->textp[entry->textlen++]= c;
232}
static int peroutqueuenode
Definition: adnsresfilter.c:67

Referenced by queueoutstr(), and readstdin().

◆ queueoutstr()

static void queueoutstr ( const char str,
int  len 
)
static

Definition at line 234 of file adnsresfilter.c.

234 {
235 while (len-- > 0) queueoutchar(*str++);
236}
static void queueoutchar(int c)
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * str

Referenced by restartbuf().

◆ quitnow()

void quitnow ( int  exitstatus)

Definition at line 96 of file adnsresfilter.c.

96 {
97 nonblock(0,0);
98 nonblock(1,0);
99 exit(exitstatus);
100}

Referenced by adnsfail(), parseargs(), sysfail(), and usageerr().

◆ readstdin()

static void readstdin ( void  )
static

Definition at line 350 of file adnsresfilter.c.

350 {
351 char readbuf[512], *p;
352 int r, c, nbyte;
353
354 while ((r= read(0,readbuf,sizeof(readbuf))) <= 0) {
355 if (r == 0) { inputeof= 1; return; }
356 if (r == EAGAIN) return;
357 if (r != EINTR) sysfail("read stdin");
358 }
359 for (p=readbuf; r>0; r--,p++) {
360 c= *p;
361 if (cbyte==-1 && bracket && c=='[') {
362 addrtextbuf[inbuf++]= c;
363 startaddr();
364 } else if (cbyte==-1 && !bracket && !isalnum(c)) {
366 startaddr();
367 } else if (cbyte>=0 && inbyte<3 && c>='0' && c<='9' &&
368 (nbyte= bytes[cbyte]*10 + (c-'0')) <= 255) {
369 bytes[cbyte]= nbyte;
370 addrtextbuf[inbuf++]= c;
371 inbyte++;
372 } else if (cbyte>=0 && cbyte<3 && inbyte>0 && c=='.') {
373 bytes[++cbyte]= 0;
374 addrtextbuf[inbuf++]= c;
375 inbyte= 0;
376 } else if (cbyte==3 && inbyte>0 && bracket && c==']') {
377 addrtextbuf[inbuf++]= c;
378 procaddr();
379 } else if (cbyte==3 && inbyte>0 && !bracket && !isalnum(c)) {
380 procaddr();
382 startaddr();
383 } else {
384 restartbuf();
386 cbyte= -1;
387 if (!bracket && !isalnum(c)) startaddr();
388 }
389 }
390}
#define read
Definition: acwin.h:96
static void startaddr(void)
static void procaddr(void)
static void restartbuf(void)
static int inbyte
Definition: adnsresfilter.c:73
GLfloat GLfloat p
Definition: glext.h:8902
_Check_return_ _CRTIMP int __cdecl isalnum(_In_ int _C)

Referenced by main().

◆ replacetextwithname()

static void replacetextwithname ( struct outqueuenode entry)
static

Definition at line 260 of file adnsresfilter.c.

260 {
261 char *name, *newbuf;
262 int namelen, newlen;
263
264 name= entry->addr->ans->rrs.str[0];
266 if (!address) {
267 free(entry->buffer);
268 entry->buffer= 0;
269 entry->textp= name;
270 entry->textlen= namelen;
271 } else {
272 newlen= entry->textlen + namelen + (bracket ? 0 : 2);
273 newbuf= xmalloc(newlen + 1);
274 sprintf(newbuf, bracket ? "%s%.*s" : "%s[%.*s]", name, entry->textlen, entry->textp);
275 free(entry->buffer);
276 entry->buffer= entry->textp= newbuf;
277 entry->textlen= newlen;
278 }
279}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define free
Definition: debug_ros.c:5
GLint namelen
Definition: glext.h:7232
#define sprintf(buf, format,...)
Definition: sprintf.c:55
Definition: name.c:39

Referenced by main().

◆ restartbuf()

static void restartbuf ( void  )
static

Definition at line 299 of file adnsresfilter.c.

299 {
301 inbuf= 0;
302}
static void queueoutstr(const char *str, int len)

Referenced by readstdin().

◆ settimeout()

static void settimeout ( const char arg)
static

Definition at line 146 of file adnsresfilter.c.

146 {
147 char *ep;
148 timeout= strtoul(arg,&ep,0);
149 if (*ep) usageerr("invalid timeout");
150}
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
Definition: utclib.c:696

Referenced by parseargs().

◆ startaddr()

static void startaddr ( void  )
static

Definition at line 345 of file adnsresfilter.c.

345 {
346 bytes[cbyte=0]= 0;
347 inbyte= 0;
348}

Referenced by add_checksum_entry(), readstdin(), and startup().

◆ startup()

static void startup ( void  )
static

Definition at line 392 of file adnsresfilter.c.

392 {
393 int r;
394
395 if (nonblock(0,1)) sysfail("set stdin to nonblocking mode");
396 if (nonblock(1,1)) sysfail("set stdout to nonblocking mode");
397 memset(&sa,0,sizeof(sa));
398 sa.sin_family= AF_INET;
399 if (config_text) {
401 } else {
403 }
404 if (r) adnsfail("init",r);
405 cbyte= -1;
406 inbyte= -1;
407 inbuf= 0;
408 if (!bracket) startaddr();
409}
ADNS_API int adns_init(adns_state *newstate_r, adns_initflags flags, FILE *diagfile)
Definition: setup.c:568
ADNS_API int adns_init_strcfg(adns_state *newstate_r, adns_initflags flags, FILE *diagfile, const char *configtext)
Definition: setup.c:629
#define AF_INET
Definition: tcpip.h:117
#define memset(x, y, z)
Definition: compat.h:39

Referenced by _tWinMain(), ConfigFileHandler_startElement(), crash_and_debug(), crash_and_winedbg(), create_io_inherit_block(), create_server_process(), do_parent(), do_register_dll(), main(), run_child(), run_client(), run_process(), SHELL_ExecuteW(), START_TEST(), test___getmainargs_parent(), test_comctl32_classes(), test_CommandLine(), test_Console(), test_CreateProcessWithDesktop(), test_debug_heap(), test_DebuggingFlag(), test_DetachConsoleHandles(), test_DetachStdHandles(), test_Directory(), test_Environment(), test_ExitCode(), test_file_inherit(), test_invalid_stdin(), test_LresultFromObject(), test_NonExistentPath(), test_NtSuspendProcess(), test_process_security(), test_Startup(), test_StartupNoConsole(), test_stdout_handle(), test_SuspendFlag(), test_token_security_descriptor(), test_Toolhelp(), test_WaitForInputIdle(), test_window_from_point(), and test_winproc_handles().

◆ sysfail()

static void sysfail ( const char what)
static

Definition at line 103 of file adnsresfilter.c.

103 {
104 fprintf(stderr,"adnsresfilter: system call failed: %s: %s\n",what,strerror(errno));
105 quitnow(2);
106}
#define errno
Definition: errno.h:18

Referenced by main(), outputerr(), procaddr(), readstdin(), startup(), usage(), writestdout(), and xmalloc().

◆ usage()

static void usage ( void  )
static

Definition at line 117 of file adnsresfilter.c.

117 {
118 if (printf("usage: adnsresfilter [<options ...>]\n"
119 " adnsresfilter -h|--help | --version\n"
120 "options: -t<milliseconds>|--timeout <milliseconds>\n"
121 " -w|--wait (always wait for queries to time out or fail)\n"
122 " -b|--brackets (require [...] around IP addresses)\n"
123 " -a|--address (always include [address] in output)\n"
124 " -u|--unchecked (do not forward map for checking)\n"
125 " --config <text> (use this instead of resolv.conf)\n"
126 " --debug (turn on adns resolver debugging)\n"
127 "Timeout is the maximum amount to delay any particular bit of output for.\n"
128 "Lookups will go on in the background. Default timeout = 1000 (ms).\n")
129 == EOF) outputerr();
130 if (fflush(stdout)) sysfail("flush stdout");
131}
static void outputerr(void)
#define printf
Definition: freeldr.h:97
#define stdout
Definition: stdio.h:99
#define EOF
Definition: stdio.h:24
_Check_return_opt_ _CRTIMP int __cdecl fflush(_Inout_opt_ FILE *_File)

Referenced by parseargs(), and usageerr().

◆ usageerr()

static void usageerr ( const char why)
static

Definition at line 134 of file adnsresfilter.c.

134 {
135 fprintf(stderr,"adnsresfilter: bad usage: %s\n",why);
136 usage();
137 quitnow(1);
138}

Referenced by parseargs(), and settimeout().

◆ writestdout()

static void writestdout ( struct outqueuenode entry)
static

Definition at line 238 of file adnsresfilter.c.

238 {
239 int r;
240
241 while (entry->textlen) {
242 r= write(1, entry->textp, entry->textlen);
243 if (r < 0) {
244 if (errno == EINTR) continue;
245 if (errno == EAGAIN) { outblocked= 1; break; }
246 sysfail("write stdout");
247 }
248 assert(r <= entry->textlen);
249 entry->textp += r;
250 entry->textlen -= r;
251 }
252 if (!entry->textlen) {
254 free(entry->buffer);
255 free(entry);
256 outqueuelen--;
257 }
258}
#define write
Definition: acwin.h:97
#define LIST_UNLINK(list, node)
Definition: dlist.h:50

Referenced by main().

◆ xmalloc()

static void * xmalloc ( size_t  sz)
static

Definition at line 108 of file adnsresfilter.c.

108 {
109 void *r;
110 r= malloc(sz); if (r) return r;
111 sysfail("malloc");
112}
#define malloc
Definition: debug_ros.c:4

Referenced by procaddr(), queueoutchar(), and replacetextwithname().

Variable Documentation

◆ address

int address
static

Definition at line 59 of file adnsresfilter.c.

◆ addrtextbuf

char addrtextbuf[14]
static

Definition at line 72 of file adnsresfilter.c.

Referenced by procaddr(), readstdin(), and restartbuf().

◆ ads

adns_state ads
static

Definition at line 70 of file adnsresfilter.c.

Referenced by checkadnsqueries(), main(), procaddr(), and startup().

◆ bracket

int bracket
static

◆ bytes

unsigned char bytes[4]
static

Definition at line 74 of file adnsresfilter.c.

Referenced by _bdf_readstream(), _enumerateProvidersW(), _setmbcp_l(), advance_stream(), audio_membuffer::alloc_bytes(), audio_membuffer::alloc_mem_(), audio_membuffer::audio_membuffer(), audio_producer::backward(), bytes_to_ms(), bytes_to_samples(), cert_find_alt_name_entry(), cert_get_name_from_rdn_attr(), cert_name_to_str_with_indent(), CertGetNameStringW(), CertNameToStrA(), cff_index_get_name(), check_native_ie(), check_position(), check_storage_contents(), checksum(), cicCreateDitherBrush(), create_test_file(), customWordBreakProc(), d3dx9_texture_shader_SetValue(), d3dx_effect_GetValue(), d3dx_effect_SetValue(), d3dx_include_from_file_open(), d3dxinclude_open(), DECLARE_INTERFACE(), DECLARE_INTERFACE_(), do_process_key(), EMFDC_GdiComment(), EMFDRV_GdiComment(), encodeBase64(), encodeBase64A(), encodeBase64W(), exec_tests(), fdi_decomp(), feed_back_bytes(), format_hash(), format_size(), audio_producer::forward(), free_parameter_object_data(), gl_alloc_alpha_buffers(), gl_unpack_image(), gl_unpack_pixels(), ID3DXConstantTableImpl_SetValue(), ID3DXEffectCompilerImpl_GetValue(), ID3DXEffectCompilerImpl_SetValue(), IDirectPlay4AImpl_GetMessageQueue(), IDirectPlay4Impl_GetMessageQueue(), local_server_thread(), main(), mpg123_decode_frame(), mpg123_framebyframe_decode(), MSRLE32_CompressRLE4Line(), MSVCRT_calloc(), param_get_data_and_dirtify(), ParseStringSecurityDescriptorToSecurityDescriptor(), PCF_Glyph_Load(), procaddr(), propset_private_tests(), ps_hints_t2counter(), ps_hints_t2mask(), ps_parser_to_bytes(), ptransfer(), audio_membuffer::read(), read_backing_store(), read_clipformat(), read_raw_int(), read_table_int(), readstdin(), record_parameter(), TCPSocketObject::recv(), recvrequest(), audio_membuffer::resize_bytes(), audio_format::samples_in_bytes(), TCPSocketObject::send(), sendrequest(), serial_get_event(), set_value(), setByteArray(), SetupCreateDiskSpaceListW(), startaddr(), stream_back_bytes(), subtract_bytes(), test_async_read(), test_file_access(), test_file_security(), test_FlushFileBuffers(), test_GetDIBits(), test_LoadIconWithScaleDown(), test_no_stop(), test_nodeTypedValue(), test_read_write(), test_ReadConsole(), test_registrar(), test_select_object(), test_service(), test_WaitCommEvent(), test_waittxempty(), testD3DInclude_open(), testD3DXInclude_open(), TestMessageHandler(), testNotifyAddrChange(), thunk_PSecPkgInfoWToA(), token_to_str(), TV1_GetDependants(), unintr_read(), unintr_write(), UserInitHandleTable(), virtio_cread_many(), virtio_cwrite_many(), W8_16(), write_backing_store(), ZSTD_cwksp_reserve_aligned(), ZSTD_cwksp_reserve_buffer(), ZSTD_cwksp_reserve_internal(), ZSTD_cwksp_reserve_object(), and ZSTD_cwksp_reserve_table().

◆ cbyte

◆ config_text

const char* config_text
static

Definition at line 63 of file adnsresfilter.c.

Referenced by parseargs(), and startup().

◆ forever

int forever
static

Definition at line 59 of file adnsresfilter.c.

Referenced by main(), and parseargs().

◆ head

Definition at line 66 of file adnsresfilter.c.

Referenced by __add_wait_queue(), __add_wait_queue_tail(), __list_splice(), acpi_extract_package(), add_keyitem_pair(), add_undo(), AtaCommand(), Subdivider::check_s(), create_automatic_entry(), CRYPT_ExportKeyTrans(), deflateSetHeader(), dictNewDict(), DSoundAdviseThread(), EnumTfDocumentMgr_Constructor(), Ext2QueryUnusedBH(), free_resource_directory(), FT_Raccess_Get_HeaderInfo(), generic_head_shift(), get_keyitem_pair(), get_static_entry(), GetExpandedNameA(), FxVerifierLock::GetThreadTableEntry(), gl_PushAttrib(), gl_PushClientAttrib(), GPOS_get_value_record_offsets(), guess_freeformat_framesize(), head_check(), HTMLTable_createTHead(), HTTP_GetHeader(), inflateGetHeader(), IPropData_fnRelease(), l_to_a(), list_add(), list_add_head(), list_add_tail(), list_empty(), list_empty_careful(), list_init(), list_move(), list_move_tail(), list_search(), list_splice(), list_splice_init(), FxVerifierLock::Lock(), LZInit(), ME_CommitCoalescingUndo(), ME_CommitUndo(), ME_ContinueCoalescingTransaction(), ME_Redo(), ME_Undo(), monoPolyPart(), pmap_getmaps(), proclog(), read_header(), FxVerifierLock::ReleaseOrReplaceThreadTableEntry(), remove_marked_para(), rpcb_getmaps(), RtlSetEnvironmentVariable(), seamless_get_token(), send_file(), set_head_text(), set_print_template(), sfnt_load_face(), FxIoTarget::Start(), FxUsbDevice::Start(), FxIoTarget::Stop(), FxUsbDevice::Stop(), test_BasicCases(), FxSystemThread::Thread(), USBFlopFormatTracks(), virtqueue_add_buf_packed(), wined3d_cs_queue_require_space(), and xprintf().

◆ inbuf

◆ inbyte

int inbyte
static

Definition at line 73 of file adnsresfilter.c.

Referenced by readstdin(), startaddr(), and startup().

◆ initflags

adns_initflags initflags = 0
static

Definition at line 62 of file adnsresfilter.c.

Referenced by ensure_adns_init(), main(), parseargs(), proclog(), and startup().

◆ inputeof

int inputeof
static

Definition at line 65 of file adnsresfilter.c.

Referenced by main(), and readstdin().

◆ newthing

struct treething* newthing
static

Definition at line 83 of file adnsresfilter.c.

Referenced by procaddr().

◆ outblocked

int outblocked
static

Definition at line 65 of file adnsresfilter.c.

Referenced by main(), and writestdout().

◆ 

struct { ... } outqueue

◆ outqueuelen

int outqueuelen
static

Definition at line 67 of file adnsresfilter.c.

Referenced by main(), procaddr(), queueoutchar(), and writestdout().

◆ peroutqueuenode

int peroutqueuenode
static

Definition at line 67 of file adnsresfilter.c.

Referenced by queueoutchar().

◆ printbefore

struct timeval printbefore
static

Definition at line 75 of file adnsresfilter.c.

Referenced by main(), and procaddr().

◆ rrt

adns_rrtype rrt = adns_r_ptr
static

Definition at line 61 of file adnsresfilter.c.

Referenced by parseargs(), and procaddr().

◆ sa

struct sockaddr_in sa
static

Definition at line 69 of file adnsresfilter.c.

Referenced by __rpc_get_local_uid(), _pipe(), _tpopen(), _wsopen_s(), AddrStrToAddr(), adns__sigpipe_protect(), Subdivider::bbox(), bindresvport_sa(), check_safearray(), ClOleCommandTarget_Exec(), ConnectToReactOSWebsite(), create_safearray_iter(), create_vbarray(), CreateClientProcess(), CreateHiddenConsoleProcess(), CreateInheritableDesktop(), CreateInheritableWinsta(), CreateSocket(), dictionary_Items(), dictionary_Keys(), doc_complex_write(), doc_write(), find_prop(), FT_MulFix(), get_dnshostname(), get_properties(), get_safearray_size(), getnameinfo(), Global_Array(), Global_UBound(), handle_navigation_error(), TMapLoader::LookForPart(), main(), make_listening_socket(), make_safearray(), mp_add(), mp_sub(), of_ptr(), of_reverse(), OleCommandTarget_Exec(), open_http(), piaddr(), PrepareForRedirect(), procaddr(), read_reg_output_(), request_send(), resolve_hostname(), rpcrt4_protseq_ncacn_ip_tcp_open_endpoint(), run_cmd(), sc_cb_open(), ScriptApplyLogicalWidth(), ScriptBreak(), ScriptGetLogicalWidths(), server_thread(), sparse_array_add(), sparse_array_find(), sparse_array_init(), sparse_array_length(), sparse_array_lookup(), start_server(), START_TEST(), startup(), test_AddMandatoryAce(), test_Console(), test_copy(), test_CreateDirectoryA(), test_CreateFileW(), test_default_dacl_owner_sid(), test_event(), test_file_inherit(), test_GetProp(), test_invalid_stdin(), test_LockUnlock(), test_maximum_allowed(), test_PropVariantToBuffer(), test_safearray_layout(), test_SafeArrayAllocDestroyDescriptor(), test_SafeArrayChangeTypeEx(), test_SafeArrayClear(), test_SafeArrayCopy(), test_SafeArrayCopyData(), test_SafeArrayCreateEx(), test_SafeArrayCreateLockDestroy(), test_SafeArrayDestroyData(), test_SafeArrayGetPutElement(), test_SafeArrayGetPutElement_BSTR(), test_SafeArrayGetPutElement_IUnknown(), test_SafeArrayGetPutElement_VARIANT(), test_SafeArrayRedim_IUnknown(), test_saxreader(), test_ScriptGetLogicalWidths(), test_ScriptXtoX(), test_stdout_handle(), test_token_security_descriptor(), test_VectorCreateLockDestroy(), to_bstr_array(), to_byte_array(), to_i4_array(), WaitForConnect(), winhttp_request_get_ResponseBody(), word_break(), WshShell3_RegRead(), and WspiapiGetNameInfo().

◆ tail

◆ timeout

unsigned long timeout = 1000
static

Definition at line 60 of file adnsresfilter.c.

◆ treeroot

void* treeroot
static

Definition at line 84 of file adnsresfilter.c.

Referenced by procaddr().