X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Finternal.h;h=ac8de47e2c468225af4e2d868270e4e16cd00819;hb=73eb26037c46bebeaa30ba38eba887216f0e9a6e;hp=9e442fed7135ff0c87fbf896645535100e2c3bb5;hpb=2953d358511ac5d196362f6b339c010d4e9cae3e;p=adns.git diff --git a/src/internal.h b/src/internal.h index 9e442fe..ac8de47 100644 --- a/src/internal.h +++ b/src/internal.h @@ -6,10 +6,10 @@ */ /* * This file is - * Copyright (C) 1997-1999 Ian Jackson + * Copyright (C) 1997-2000 Ian Jackson * * It is part of adns, which is - * Copyright (C) 1997-1999 Ian Jackson + * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999 Tony Finch * * This program is free software; you can redistribute it and/or modify @@ -45,6 +45,10 @@ typedef unsigned char byte; #include "adns.h" #include "dlist.h" +#ifdef ADNS_REGRESS_TEST +# include "hredirect.h" +#endif + /* Configuration and constants */ #define MAXSERVERS 5 @@ -58,6 +62,7 @@ typedef unsigned char byte; #define DNS_PORT 53 #define DNS_MAXUDP 512 +#define DNS_MAXLABEL 63 #define DNS_MAXDOMAIN 255 #define DNS_HDRSIZE 12 #define DNS_IDOFFSET 0 @@ -288,10 +293,10 @@ struct adns__state { server_ok, server_broken } tcpstate; struct timeval tcptimeout; - /* This will have tv_sec==0 if it is not valid. - * It will always be valid if tcpstate _connecting. - * When _ok, it will be nonzero if we are idle - * (ie, tcpw queue is empty) and counting down. + /* This will have tv_sec==0 if it is not valid. It will always be + * valid if tcpstate _connecting. When _ok, it will be nonzero if + * we are idle (ie, tcpw queue is empty), in which case it is the + * absolute time when we will close the connection. */ struct sigaction stdsigpipe; sigset_t stdsigmask; @@ -683,6 +688,9 @@ static inline int ctype_alpha(int c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } static inline int ctype_822special(int c) { return strchr("()<>@,;:\\\".[]",c) != 0; } +static inline int ctype_domainunquoted(int c) { + return ctype_alpha(c) || ctype_digit(c) || (strchr("-_/+",c) != 0); +} static inline int errno_resources(int e) { return e==ENOMEM || e==ENOBUFS; }