#define UDPRETRYMS 2000
#define TCPMS 30000
#define LOCALRESOURCEMS 20
+#define UDPMAXDGRAM 512
+#define NSPORT 53
/* Shared data structures */
struct adns__state {
/* FIXME: make sure this is all init'd properly */
adns_initflags iflags;
+ FILE *diagfile;
struct { adns_query head, tail; } tosend, timew, childw, output;
int nextid, udpsocket;
adns_vbuf rqbuf, tcpsend, tcprecv;
/* From setup.c: */
-void adns__debug(adns_state ads, const char *fmt, ...) PRINTFFORMAT(2,3);
-void adns__diag(adns_state ads, const char *fmt, ...) PRINTFFORMAT(2,3);
+void adns__vdiag(adns_state ads, adns_initflags prevent, const char *pfx,
+ int serv, const char *fmt, va_list al);
+void adns__debug(adns_state ads, int serv, const char *fmt, ...) PRINTFFORMAT(2,3);
+void adns__warn(adns_state ads, int serv, const char *fmt, ...) PRINTFFORMAT(2,3);
+void adns__diag(adns_state ads, int serv, const char *fmt, ...) PRINTFFORMAT(2,3);
/* From submit.c: */
*tv_io= tmp;
}
+static inline int ctype_whitespace(int c) { return c==' ' || c=='\n' || c=='\t'; }
+static inline int ctype_digit(int c) { return c>='0' && c<='9'; }
+
/* Useful macros */
#define LIST_UNLINK_PART(list,node,part) \