52#ifdef ADNS_REGRESS_TEST
53# include "hredirect.h"
57#define MAXMAXPENDING 64000
58#define DEFMAXPENDING 2000
70static const char *
const progname=
"adnslogres";
73#define guard_null(str) ((str) ? (str) : "")
75#define sensible_ctype(type,ch) (type((unsigned char)(ch)))
78static void msg(
const char *
fmt, ...) {
88static void aargh(
const char *cause) {
90 if (!why) why =
"Unknown error";
91 msg(
"%s: %s (%d)", cause, why,
errno);
111 for (
i= 1;
i < 5;
i++) {
115 (
i != 4 && ptrs[
i][-1] !=
'.') ||
116 (ptrs[
i]-ptrs[
i-1] > 4)) {
121 sprintf(
buf,
"%.*s.%.*s.%.*s.%.*s.in-addr.arpa.",
122 ptrs[4]-ptrs[3]-1, ptrs[3],
123 ptrs[3]-ptrs[2]-1, ptrs[2],
124 ptrs[2]-ptrs[1]-1, ptrs[1],
125 ptrs[1]-ptrs[0]-1, ptrs[0]);
163 aargh(
"adns_submit");
190 msg(
"%d in queue; checking %.*s",
len,
192 if (
eof ||
len >= maxpending) {
229 fputs(
"usage: adnslogres [<options>] [<logfile>]\n"
230 " adnslogres --version|--help\n"
231 "options: -c <concurrency> set max number of outstanding queries\n"
233 " -p use poll(2) instead of select(2)\n"
235 " -d turn on debugging\n"
236 " -C <config> use instead of contents of resolv.conf\n",
246 int c, opts, maxpending;
300 aargh(
"couldn't open input");
305 aargh(
"fclose input");
307 aargh(
"fclose output");
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strcpy(char *DstString, const char *SrcString)
ADNS_API void adns_finish(adns_state ads)
ADNS_API int adns_check(adns_state ads, adns_query *query_io, adns_answer **answer_r, void **context_r)
ADNS_API int adns_init(adns_state *newstate_r, adns_initflags flags, FILE *diagfile)
ADNS_API int adns_wait(adns_state ads, adns_query *query_io, adns_answer **answer_r, void **context_r)
ADNS_API int adns_wait_poll(adns_state ads, adns_query *query_io, adns_answer **answer_r, void **context_r)
ADNS_API int adns_submit(adns_state ads, const char *owner, adns_rrtype type, adns_queryflags flags, void *context, adns_query *query_r)
ADNS_API int adns_init_strcfg(adns_state *newstate_r, adns_initflags flags, FILE *diagfile, const char *configtext)
static void printhelp(FILE *file)
static const char * config_text
#define sensible_ctype(type, ch)
static const char *const progname
static void printline(FILE *outf, char *start, char *addr, char *rest, char *domain)
static char * ipaddr2domain(char *start, char **addr, char **rest)
static void aargh(const char *cause)
static logline * readline(FILE *inf, adns_state adns, int opts)
static void proclog(FILE *inf, FILE *outf, int maxpending, int opts)
static adns_initflags initflags
struct outqueuenode * tail
struct outqueuenode * head
int getopt(int nargc, char *const *nargv, const char *ostr)
#define VERSION_MESSAGE(program)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum const GLvoid * addr
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP int __cdecl ferror(_In_ FILE *_File)
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
_Check_return_ _CRTIMP int __cdecl feof(_In_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fputc(_In_ int _Ch, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
#define sprintf(buf, format,...)
const char * strerror(int err)
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)
union adns_answer::@4226 rrs