summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Young <sdyoung@users.sourceforge.net>2000-02-16 17:32:49 +0000
committerSteven Young <sdyoung@users.sourceforge.net>2000-02-16 17:32:49 +0000
commit37e63909c09359ddd5baf7a237387ee5f7219c2d (patch)
tree118da48d4b5ed947bc4cb9c004d7e10a976be57a
parenta094587fb0e92c5638808d7bff91ef802e200112 (diff)
downloadtinyproxy-37e63909c09359ddd5baf7a237387ee5f7219c2d.tar.gz
tinyproxy-37e63909c09359ddd5baf7a237387ee5f7219c2d.zip
This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to '')
-rw-r--r--AUTHORS6
-rw-r--r--BUGS9
-rw-r--r--COPYING340
-rw-r--r--ChangeLog122
-rw-r--r--INSTALL24
-rw-r--r--INSTALL.configure182
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.in354
-rw-r--r--NEWS41
-rw-r--r--README99
-rw-r--r--THANKS42
-rw-r--r--acconfig.h20
-rw-r--r--aclocal.m4129
-rw-r--r--adns-0.6/.cvsignore8
-rw-r--r--adns-0.6/COPYING340
-rw-r--r--adns-0.6/INSTALL58
-rw-r--r--adns-0.6/Makefile.in68
-rw-r--r--adns-0.6/README148
-rw-r--r--adns-0.6/TODO15
-rw-r--r--adns-0.6/acconfig.h109
-rw-r--r--adns-0.6/aclocal.m470
-rw-r--r--adns-0.6/changelog164
-rw-r--r--adns-0.6/client/.cvsignore11
-rw-r--r--adns-0.6/client/Makefile.in74
-rw-r--r--adns-0.6/client/adh-main.c243
-rw-r--r--adns-0.6/client/adh-opts.c337
-rw-r--r--adns-0.6/client/adh-query.c274
-rw-r--r--adns-0.6/client/adnshost.h118
-rw-r--r--adns-0.6/client/adnslogres.c239
-rw-r--r--adns-0.6/client/adnsresfilter.c454
-rw-r--r--adns-0.6/client/adnstest.c337
-rw-r--r--adns-0.6/client/fanftest.c85
-rw-r--r--adns-0.6/client/x.gdb2
-rwxr-xr-xadns-0.6/configure1826
-rw-r--r--adns-0.6/configure.in101
-rw-r--r--adns-0.6/dynamic/.cvsignore2
-rw-r--r--adns-0.6/dynamic/Makefile.in54
-rw-r--r--adns-0.6/regress/.cvsignore8
-rw-r--r--adns-0.6/regress/Makefile.in65
-rwxr-xr-xadns-0.6/regress/addcases9
-rw-r--r--adns-0.6/regress/case-1stservbroken.err0
-rw-r--r--adns-0.6/regress/case-1stservbroken.out39
-rw-r--r--adns-0.6/regress/case-1stservbroken.sys180
-rw-r--r--adns-0.6/regress/case-1stservtotcp.err0
-rw-r--r--adns-0.6/regress/case-1stservtotcp.out37
-rw-r--r--adns-0.6/regress/case-1stservtotcp.sys159
-rw-r--r--adns-0.6/regress/case-2ndservok.err0
-rw-r--r--adns-0.6/regress/case-2ndservok.out6
-rw-r--r--adns-0.6/regress/case-2ndservok.sys47
-rw-r--r--adns-0.6/regress/case-2ndservtcp.err0
-rw-r--r--adns-0.6/regress/case-2ndservtcp.out37
-rw-r--r--adns-0.6/regress/case-2ndservtcp.sys165
-rw-r--r--adns-0.6/regress/case-abbrev.err0
-rw-r--r--adns-0.6/regress/case-abbrev.out40
-rw-r--r--adns-0.6/regress/case-abbrev.sys282
-rw-r--r--adns-0.6/regress/case-abbrevto.err0
-rw-r--r--adns-0.6/regress/case-abbrevto.out32
-rw-r--r--adns-0.6/regress/case-abbrevto.sys1236
-rw-r--r--adns-0.6/regress/case-brokenmail.err0
-rw-r--r--adns-0.6/regress/case-brokenmail.out38
-rw-r--r--adns-0.6/regress/case-brokenmail.sys516
-rw-r--r--adns-0.6/regress/case-child.err0
-rw-r--r--adns-0.6/regress/case-child.out5
-rw-r--r--adns-0.6/regress/case-child.sys58
-rw-r--r--adns-0.6/regress/case-cnametocname.err0
-rw-r--r--adns-0.6/regress/case-cnametocname.out5
-rw-r--r--adns-0.6/regress/case-cnametocname.sys39
-rw-r--r--adns-0.6/regress/case-datapluscname.err0
-rw-r--r--adns-0.6/regress/case-datapluscname.out39
-rw-r--r--adns-0.6/regress/case-datapluscname.sys233
-rw-r--r--adns-0.6/regress/case-datapluscnamewait.err0
-rw-r--r--adns-0.6/regress/case-datapluscnamewait.out78
-rw-r--r--adns-0.6/regress/case-datapluscnamewait.sys1480
-rw-r--r--adns-0.6/regress/case-flags10.err1
-rw-r--r--adns-0.6/regress/case-flags10.out2
-rw-r--r--adns-0.6/regress/case-flags10.sys15
-rw-r--r--adns-0.6/regress/case-flags9.err0
-rw-r--r--adns-0.6/regress/case-flags9.out5
-rw-r--r--adns-0.6/regress/case-flags9.sys34
-rw-r--r--adns-0.6/regress/case-mailboxes.err0
-rw-r--r--adns-0.6/regress/case-mailboxes.out10
-rw-r--r--adns-0.6/regress/case-mailboxes.sys35
-rw-r--r--adns-0.6/regress/case-manya.err0
-rw-r--r--adns-0.6/regress/case-manya.out8
-rw-r--r--adns-0.6/regress/case-manya.sys36
-rw-r--r--adns-0.6/regress/case-manyptrwrong.err0
-rw-r--r--adns-0.6/regress/case-manyptrwrong.out153
-rw-r--r--adns-0.6/regress/case-manyptrwrong.sys1287
-rw-r--r--adns-0.6/regress/case-manyptrwrongrem.err0
-rw-r--r--adns-0.6/regress/case-manyptrwrongrem.out127
-rw-r--r--adns-0.6/regress/case-manyptrwrongrem.sys1145
-rw-r--r--adns-0.6/regress/case-manyptrwrongrst.err0
-rw-r--r--adns-0.6/regress/case-manyptrwrongrst.out132
-rw-r--r--adns-0.6/regress/case-manyptrwrongrst.sys1209
-rw-r--r--adns-0.6/regress/case-manyptrwrongrty.err0
-rw-r--r--adns-0.6/regress/case-manyptrwrongrty.out164
-rw-r--r--adns-0.6/regress/case-manyptrwrongrty.sys1436
-rw-r--r--adns-0.6/regress/case-ndots-as.err0
-rw-r--r--adns-0.6/regress/case-ndots-as.out16
-rw-r--r--adns-0.6/regress/case-ndots-as.sys316
-rw-r--r--adns-0.6/regress/case-ndots.err0
-rw-r--r--adns-0.6/regress/case-ndots.out16
-rw-r--r--adns-0.6/regress/case-ndots.sys277
-rw-r--r--adns-0.6/regress/case-ndotsbad.err1
-rw-r--r--adns-0.6/regress/case-ndotsbad.out3
-rw-r--r--adns-0.6/regress/case-ndotsbad.sys2
-rw-r--r--adns-0.6/regress/case-noinfto.err0
-rw-r--r--adns-0.6/regress/case-noinfto.out4
-rw-r--r--adns-0.6/regress/case-noinfto.sys123
-rw-r--r--adns-0.6/regress/case-norecurse.err0
-rw-r--r--adns-0.6/regress/case-norecurse.out62
-rw-r--r--adns-0.6/regress/case-norecurse.sys633
-rw-r--r--adns-0.6/regress/case-norecurse2.err0
-rw-r--r--adns-0.6/regress/case-norecurse2.out60
-rw-r--r--adns-0.6/regress/case-norecurse2.sys1212
-rw-r--r--adns-0.6/regress/case-norecurse3.err0
-rw-r--r--adns-0.6/regress/case-norecurse3.out32
-rw-r--r--adns-0.6/regress/case-norecurse3.sys504
-rw-r--r--adns-0.6/regress/case-norm.err0
-rw-r--r--adns-0.6/regress/case-norm.out5
-rw-r--r--adns-0.6/regress/case-norm.sys34
-rw-r--r--adns-0.6/regress/case-owner.err0
-rw-r--r--adns-0.6/regress/case-owner.out36
-rw-r--r--adns-0.6/regress/case-owner.sys285
-rw-r--r--adns-0.6/regress/case-poll.err0
-rw-r--r--adns-0.6/regress/case-poll.out5
-rw-r--r--adns-0.6/regress/case-poll.sys34
-rw-r--r--adns-0.6/regress/case-polltimeout.err0
-rw-r--r--adns-0.6/regress/case-polltimeout.out4
-rw-r--r--adns-0.6/regress/case-polltimeout.sys135
-rw-r--r--adns-0.6/regress/case-rootquery.err0
-rw-r--r--adns-0.6/regress/case-rootquery.out8
-rw-r--r--adns-0.6/regress/case-rootquery.sys73
-rw-r--r--adns-0.6/regress/case-rootqueryall-as.err0
-rw-r--r--adns-0.6/regress/case-rootqueryall-as.out118
-rw-r--r--adns-0.6/regress/case-rootqueryall-as.sys579
-rw-r--r--adns-0.6/regress/case-rootqueryall.err0
-rw-r--r--adns-0.6/regress/case-rootqueryall.out127
-rw-r--r--adns-0.6/regress/case-rootqueryall.sys972
-rw-r--r--adns-0.6/regress/case-search-as.err0
-rw-r--r--adns-0.6/regress/case-search-as.out14
-rw-r--r--adns-0.6/regress/case-search-as.sys131
-rw-r--r--adns-0.6/regress/case-search.err0
-rw-r--r--adns-0.6/regress/case-search.out14
-rw-r--r--adns-0.6/regress/case-search.sys133
-rw-r--r--adns-0.6/regress/case-searchabs.err0
-rw-r--r--adns-0.6/regress/case-searchabs.out5
-rw-r--r--adns-0.6/regress/case-searchabs.sys72
-rw-r--r--adns-0.6/regress/case-sillyrp.err0
-rw-r--r--adns-0.6/regress/case-sillyrp.out22
-rw-r--r--adns-0.6/regress/case-sillyrp.sys183
-rw-r--r--adns-0.6/regress/case-tcpmultipart.err0
-rw-r--r--adns-0.6/regress/case-tcpmultipart.out71
-rw-r--r--adns-0.6/regress/case-tcpmultipart.sys248
-rw-r--r--adns-0.6/regress/case-timeout.err0
-rw-r--r--adns-0.6/regress/case-timeout.out4
-rw-r--r--adns-0.6/regress/case-timeout.sys135
-rw-r--r--adns-0.6/regress/case-trunc.err0
-rw-r--r--adns-0.6/regress/case-trunc.out4
-rw-r--r--adns-0.6/regress/case-trunc.sys34
-rw-r--r--adns-0.6/regress/case-unknownq.err0
-rw-r--r--adns-0.6/regress/case-unknownq.out3
-rw-r--r--adns-0.6/regress/case-unknownq.sys15
-rwxr-xr-xadns-0.6/regress/checkall47
-rw-r--r--adns-0.6/regress/harness.h.m493
-rw-r--r--adns-0.6/regress/hcommon.c.m4308
-rw-r--r--adns-0.6/regress/hmacros.i4136
-rw-r--r--adns-0.6/regress/hplayback.c.m4366
-rw-r--r--adns-0.6/regress/hrecord.c.m4154
-rw-r--r--adns-0.6/regress/hsyscalls.i4122
-rw-r--r--adns-0.6/regress/init-1stservbroken.text3
-rw-r--r--adns-0.6/regress/init-1stservto.text3
-rw-r--r--adns-0.6/regress/init-2ndserver.text3
-rw-r--r--adns-0.6/regress/init-default.text3
-rw-r--r--adns-0.6/regress/init-manyptrwrong.text1
-rw-r--r--adns-0.6/regress/init-ncipher.text3
-rw-r--r--adns-0.6/regress/init-ndots.text4
-rw-r--r--adns-0.6/regress/init-ndotsbad.text4
-rw-r--r--adns-0.6/regress/init-noserver.text2
-rw-r--r--adns-0.6/regress/init-tunnel.text3
-rwxr-xr-xadns-0.6/regress/m1test38
-rwxr-xr-xadns-0.6/regress/r1test57
-rw-r--r--adns-0.6/settings.make.in68
-rw-r--r--adns-0.6/src/.cvsignore2
-rw-r--r--adns-0.6/src/Makefile.in48
-rw-r--r--adns-0.6/src/adns.h818
-rw-r--r--adns-0.6/src/adns.make25
-rw-r--r--adns-0.6/src/check.c199
-rw-r--r--adns-0.6/src/config.h.in91
-rw-r--r--adns-0.6/src/dlist.h53
-rw-r--r--adns-0.6/src/event.c699
-rw-r--r--adns-0.6/src/general.c360
-rw-r--r--adns-0.6/src/internal.h705
-rw-r--r--adns-0.6/src/parse.c253
-rw-r--r--adns-0.6/src/poll.c131
-rw-r--r--adns-0.6/src/query.c540
-rw-r--r--adns-0.6/src/reply.c357
-rw-r--r--adns-0.6/src/setup.c643
-rw-r--r--adns-0.6/src/transmit.c257
-rw-r--r--adns-0.6/src/tvarith.h41
-rw-r--r--adns-0.6/src/types.c1034
-rwxr-xr-xconfigure2706
-rw-r--r--configure.in171
-rw-r--r--doc/CONFIG11
-rw-r--r--doc/HTTP_ERROR_CODES61
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/Makefile.in216
-rw-r--r--doc/RFC_INFO23
-rw-r--r--doc/TODO27
-rwxr-xr-xdoc/report.sh14
-rw-r--r--doc/tinyproxy.8121
-rwxr-xr-xinstall-sh251
-rwxr-xr-xmissing190
-rwxr-xr-xmkinstalldirs40
-rwxr-xr-xreconf11
-rw-r--r--src/Makefile.am19
-rw-r--r--src/Makefile.in340
-rw-r--r--src/buffer.c308
-rw-r--r--src/buffer.h62
-rw-r--r--src/config.h101
-rw-r--r--src/conns.c187
-rw-r--r--src/conns.h59
-rw-r--r--src/defines.h.in89
-rw-r--r--src/dnscache.c198
-rw-r--r--src/dnscache.h38
-rw-r--r--src/filter.c150
-rw-r--r--src/filter.h25
-rw-r--r--src/gnuregex.c5880
-rw-r--r--src/gnuregex.h542
-rw-r--r--src/log.c90
-rw-r--r--src/log.h24
-rw-r--r--src/regexp.h24
-rw-r--r--src/reqs.c832
-rw-r--r--src/reqs.h24
-rw-r--r--src/sock.c362
-rw-r--r--src/sock.h40
-rw-r--r--src/stamp-h.in1
-rw-r--r--src/tinyproxy.c478
-rw-r--r--src/tinyproxy.h87
-rw-r--r--src/uri.c124
-rw-r--r--src/uri.h32
-rw-r--r--src/utils.c264
-rw-r--r--src/utils.h38
243 files changed, 45839 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..e8a67c7
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,6 @@
+ tinyproxy is a collaborative work between Steven Young
+ <sdyoung@well.com> and Robert James Kaes <rjkaes@flarenet.com>.
+
+ From versions 0-1.1, Steven Young was the primary maintainer.
+ From 1.2 to 1.3.0, Robert James Kaes was the primary maintainer.
+ As of 1.3.1, Steven Young will once again be the primary maintainer.
diff --git a/BUGS b/BUGS
new file mode 100644
index 0000000..10c7473
--- /dev/null
+++ b/BUGS
@@ -0,0 +1,9 @@
+ KNOWN BUGS
+ ==========
+
+ There is exactly one known bug at the time of 1.3.2's release - when compiling
+under some Linux distributions (notably, Debian), the compile process will
+generate a number of warnings regarding __underflow. However, tinyproxy still
+compiles and runs perfectly.
+
+ Patches welcome!
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..d60c31a
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..65214a5
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,122 @@
+1.3.2 2000/02/15
+ - Fixed null requests bug.
+ - Fixed fd leak bug.
+ - Fixed connptr bug.
+ - Updated docs.
+
+1.3.1 1999/12/21
+ - made the dns cache hashing algorithm case-insensitive.
+ - fixed a bug in log() that would cause it to dump garbage to
+ the log file when in unrestricted mode.
+ - this is an interim release to fix the above log() bug.
+
+1.3.0 1999/12/01
+ - autoconf enabled the source tree and moved some of the
+ documentation files into the proper locations. Also, added any
+ files which were needed to conform with the GNU autoconf directory
+ structure.
+ - Changed the debugging code to use asserts(). I don't know if I'm
+ completely happy with this. One the one hand it shrinks the size
+ of the executable, but on the other, it doesn't handle weird
+ situations in production code. It's still a toss up.
+ - Did a major reorganization of the source tree. The biggest
+ change is moving a lot of code from reqs.c into more appropriate
+ files.
+ - ANON mode is now always compiled in (since it doesn't take up
+ that much space) and is enabled from the command line.
+ - Changed the states a connection can be in, and also merged both
+ sockets (server/client) into one structure. Makes the code a lot
+ cleaner.
+ - Added a DNS caching mechanism. What happens it that a hash of
+ previously looked up names is maintained, so additional host names
+ will not need to be fetched from the DNS server again. Helps on
+ most web pages, which have a lot of images from the same server.
+ - Removed the global error variable (tinyerr) by making the
+ functions more consistent with what they return for an error.
+ - Removed the global.* files and merged them back into the
+ tinyproxy.* source.
+ - Added bug fixes in reqs.c to handle bad servers, which do not
+ follow the basic RFC protocol (i.e. using just a LF instead of a
+ CRLF).
+ - Most of reqs.c has been changed to use the readline
+ function. Also, it has been organized around the new connection
+ states and connection structure.
+ - xstrstr can now be both case sensitive or insensitive. Also,
+ added a check to make sure the haystack is longer than the needle.
+
+1.2.10 1999/08/20
+ - Found a memory free bug in the buffer code, and also, a bug in
+ allocating memory for the buffer. Both could be fatal. One leaked
+ memory, and the other could allow all memory to be exhausted. Both
+ are now fixed.
+ - Reorganized some of the code. Moved global variables into the
+ proper files. Should help to eliminate them altogether someday.
+ - Shaun Johnson fixed a problem with compiling with syslog enabled
+ on a SunOS box.
+
+1.2.9 1999/08/17
+ - Changed the writebuff to more explicitly be designed to write
+ from the other connection's buffer. A connection reads into it's
+ own buffer, but write's the other connection's buffer.
+ - You can now specify a particular IP address to listen on. By
+ default, tinyproxy listens on all IP addresses.
+
+1.2.8.1 1999/08/13 (Internal release)
+ - Improved the portability by removing the daemon call and
+ removing the calls to index().
+ - added the buffer.* source into the CVS tree.
+
+1.2.8 1999/08/06
+ - Better logging of incoming connections. Now both the IP address
+ and the requested URL are logged.
+ - You can now specify that only a certain subnet is allowed to
+ access tinyproxy. Currently it only supports one subnet with
+ matching against a string with the IP address.
+ - a bunch of just general code clean up. Mostly stylistic stuff.
+
+1.2.7 1999/07/28
+ - Incoming connections are now logged to the log file/syslog
+ - An "XTinyproxy" header can now sent with each request which
+ includes the IP address of the client.
+ - Fixed some of the size of the members in the structures.
+ - Fixed an argument problem in listen_sock which was using the
+ size of the wrong variable.
+
+1.2.6 1999/06/05
+ - Added the ability to send the HTTP requests to a proxy
+ server running on a different machine (or even the same
+ machine if you like)
+ - Fixed a bug in the clientreq() routine which would choke on
+ requests in the form of GET http://www.url.com HTTP/1.0 (thanks
+ to Bruno Viaris <viaris@galilee.univ-paris13.fr> for pointing
+ out the bug and providing the initial fix.)
+
+1.2.5 1999/05/21
+ - Now maintained by Robert James Kaes (rjkaes@flarenet.com)
+ - Non-blocking sockets
+ - Cleaned up the style, and code. Compiles cleanly with -Wall
+ - Logs to syslogd with -S command line argument
+ - Rewrote the clientreq routine to remove tonnes of code
+ - Removed unused routines (rstrtolower, xstrndup, readline, etc.)
+ - Moved the user configurable options into config.h
+
+1.1 1998/09/15
+ - Load average monitoring added
+ - Remote proxy monitoring added
+ - Added -u (change user).
+
+1.0d
+ - ANON mode now supports -a to let user-specified headers
+ through
+ - various bug fixes in readline()
+
+1.0c
+ - Support for ANON mode
+
+1.0b
+ - Cleaned up exit codes (now uses sysexits.h)
+ - Uses daemon() from -lbsf instead of daemonize()
+ - Now supports ports other than 80
+
+1.0a
+ - Created by Steven Young (sdyoung@well.com)
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..3355ae4
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,24 @@
+Installing tinyproxy 1.3.2
+==========================
+
+ As of 1.3.2, tinyproxy uses Ian Jackson's adns library to perform non-blocking
+DNS lookups. As such, before you can do anything to install tinyproxy, you must
+go into the adns-0.6/ subdirectory off the root tinyproxy distribution directory
+and follow the INSTALL directions therein. Once you have libadns installed,
+follow these steps:
+
+ (1) Run the tinyproxy 'configure' script, found in the root distribution
+ directory. If you're unsure of exactly what arguments to use, please
+ consult the output of 'configure --help'. Additional documentation can
+ be found for configure in the text file INSTALL.configure.
+ (2) Run 'make install'. This will build all of tinyproxy and install it
+ in the default directory. You may also wish to peruse src/config.h
+ to be sure everything is configured to your liking.
+ (3) Read the tinyproxy manpage - it will explain what commandline arguments
+ and parameters are available. More experienced users will probably
+ be able to get all the information they need from the output of
+ 'tinyproxy -h'.
+
+ Enjoy! Please read the documentation carefully, especially the COPYING
+file which should have been included in this archive explaining the licensing
+terms of tinyproxy.
diff --git a/INSTALL.configure b/INSTALL.configure
new file mode 100644
index 0000000..b42a17a
--- /dev/null
+++ b/INSTALL.configure
@@ -0,0 +1,182 @@
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..ea8d4c1
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,2 @@
+EXTRA_DIST = configure acconfig.h reconf
+SUBDIRS = src doc
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..d621b00
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,354 @@
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+EXTRA_DIST = configure acconfig.h reconf
+SUBDIRS = src doc
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ./src/defines.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
+Makefile.in NEWS THANKS acconfig.h aclocal.m4 configure configure.in \
+install-sh missing mkinstalldirs src/defines.h.in src/stamp-h.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): configure.in
+ cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+src/defines.h: src/stamp-h
+ @if test ! -f $@; then \
+ rm -f src/stamp-h; \
+ $(MAKE) src/stamp-h; \
+ else :; fi
+src/stamp-h: $(srcdir)/src/defines.h.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=src/defines.h \
+ $(SHELL) ./config.status
+ @echo timestamp > src/stamp-h 2> /dev/null
+$(srcdir)/src/defines.h.in: $(srcdir)/src/stamp-h.in
+ @if test ! -f $@; then \
+ rm -f $(srcdir)/src/stamp-h.in; \
+ $(MAKE) $(srcdir)/src/stamp-h.in; \
+ else :; fi
+$(srcdir)/src/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/src/stamp-h.in 2> /dev/null
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f src/defines.h
+
+maintainer-clean-hdr:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
+ -rm -rf $(distdir)
+ @banner="$(distdir).tar.gz is ready for distribution"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+install-exec-am:
+install-exec: install-exec-recursive
+
+install-data-am:
+install-data: install-data-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am:
+uninstall: uninstall-recursive
+all-am: Makefile
+all-redirect: all-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
+
+distclean: distclean-recursive
+ -rm -f config.status
+
+maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
+ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f config.status
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..d40281f
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,41 @@
+
+ NEWS
+ ====
+
+ This is another interim release of tinyproxy that fixes a few more bugs,
+and adds a feature or two (notably: non-blocking DNS lookups). It was
+decided to move back what was previously going to be released as 1.3.2 and
+release it as 1.4.0, as these bug fixes and patches were determined to be
+too high-priority to wait on.
+
+ In this version of 1.3.2, the are the following new features:
+
+ - Non-blocking DNS lookups.
+
+ And the following bug fixes:
+
+ - A bug where connptr was not correctly being set before httperr was being
+called in reqs.c.
+ - A bug where the system would crash if an empty request was received.
+ - A file descriptor leak where an fd would not be properly closed in
+event of a bad HTTP request.
+
+ Here is some information on the upcoming 1.4.0 release:
+
+ 1.4.0
+ =====
+
+ 1.4.0 is in the works. Some features you can expect:
+
+ - Ability to listen on >1 port.
+ - Ability to set up more than one access list for the allowed
+ IP subnets.
+ - Ability to listen on multiple interfaces specified on the command-line.
+ - Simple caching.
+
+ Under the hood, 1.4.0 should be a bit more modular than 1.3.2. This
+will hopefully lend itself towards making it easier for third parties to
+develop new features for tinyproxy.
+
+ Please note that as of 1.3.1, Steven Young <sdyoung@well.com> is once
+again the primary maintainer of tinyproxy.
diff --git a/README b/README
new file mode 100644
index 0000000..64d2bd4
--- /dev/null
+++ b/README
@@ -0,0 +1,99 @@
+ This is tinyproxy-adns, tinyproxy with support for GNU adns asynchronous
+ resolver library.
+
+ DESCRIPTION
+ -----------
+
+ tinyproxy is a small, efficient HTTP proxy daemon. tinyproxy is very
+ useful in a small network setting, where a larger proxy like Squid
+ would either be too resource intensive, or a security risk. One of
+ the key features of tinyproxy is the buffering connection concept.
+ In effect, tinyproxy will buffer a high speed response from a server,
+ and then relay it to a client at the highest speed the client will
+ accept. This feature greatly reduces the problems with sluggishness
+ on the Internet. If you are sharing an Internet connection with a
+ small network, and you only want to allow HTTP requests to be
+ allowed, then tinyproxy is a great tool for the network
+ administrator.
+
+ This version of tinyproxy must be compiled with GNU adns, available from
+ http://www.chiark.greenend.org.uk/~ian/adns/.
+
+ INSTALLATION
+ ------------
+
+ To install this package under a Unix derivative, read the INSTALL
+ file. tinyproxy uses a standard GNU configure script. There are
+ additional command line arguments you can supply to configure. They
+ include:
+
+ --enable-debug If you would like to turn on full
+ debugging support
+ --enable-socks This turns on SOCKS support for using
+ tinyproxy across a fire wall.
+ --enable-xtinyproxy Compile in support for the XTinyproxy
+ header, which is sent to any web
+ server in your domain.
+
+ Options for GNU adns
+ --with-adns-include=DIR Set the directory in which adns.h has
+ been installed. Required if this is in
+ a non-standard location.
+ --with-adns-lib=DIR Set the directory in which libadns.* have
+ been installed. Required if this is in
+ a non-standard location.
+
+ Options for file locations etc.
+ --with-port=PORT Set the port on which tinyproxy listens,
+ by default 8080.
+ --with-log-file=FILE Set the default logfile location.
+ --with-user=USER Set the default user to which tinyproxy
+ will setuid() upon startup.
+
+ Once you have completed your installation, if you would like to
+ report your success please execute the report.sh script in the doc
+ directory. This will send an email to the authors reporting your
+ version, and a few bits of information concerning the memory usage of
+ tinyproxy. Alternatively, you could just send an email stating the
+ version. Which ever you prefer.
+
+ SUPPORT
+ -------
+
+ If you are having problems with tinyproxy, please report the problem
+ to:
+
+ Steven Young <sdyoung@well.com>
+ Robert James Kaes <rjkaes@flarenet.com>
+
+ If the problem seems to be to do with GNU adns support (or if I've done
+ something obviously wrong), please email
+
+ Chris Lightfoot <chris@ex-parrot.com>
+
+ Please recompile tinyproxy with full debug support (--enable-debug)
+ and include a copy of the log file, and any assert errors reported by
+ tinyproxy. Also, if you feel up to it, try running tinyproxy under
+ your debugger and report the error your received and a context
+ listing of the location. Under gdb you would run tinyproxy like so:
+
+ gdb tinyproxy
+
+ (gdb) set args -p port_num -l log_file -d
+ (gdb) run
+
+ Now access the port tinyproxy is on until you receive a break in the
+ gdb. You can now type:
+
+ (gbd) l
+
+ to produce a context listing of the location of the error. Send a
+ copy to the authors.
+
+ HOW TO CONTRIBUTE TO tinyproxy
+ ------------------------------
+
+ If you would like to contribute a feature, or a bug fix to the
+ tinyproxy source, please send a diff (preferable a unified
+ diff. i.e. "diff -u") against the latest release of tinyproxy. Also,
+ if you could include a brief description of what your patch does.
diff --git a/THANKS b/THANKS
new file mode 100644
index 0000000..80d112a
--- /dev/null
+++ b/THANKS
@@ -0,0 +1,42 @@
+Tinyproxy wouldn't be possible in its current form without the help of
+the following people. Thanks a lot, guys (sorted in no particular
+order). Note that in the case of entries listed under 'numerous others',
+only the first person to report it is listed.
+
+
+ Steven Young - Wrote version 1.0 - 1.1
+ Robert James Kaes - Wrote versions from 1.2 to 1.3 and
+ autoconf enabled the source tree.
+ Albert Ragnarsson - Made an RPM out of the 1.0d .tar.gz archive.
+ Alan W Black - Misc. bug reports and fixes.
+ Ed Boraas - Various suggestions, helped beta test 1.0d.
+ Abhijit Menon-Sen - Beta tested 1.1, numerous bugs fixed
+ and features improved. Also helped
+ establish world peace and eliminate
+ hunger and poverty. Generally
+ credited with the singlehanded
+ abolition of all crime and dishonesty.
+ Jay Kominek - Made the 1.1 DEB.
+ Eran Tromer - Provided webspace at attacca.com.
+ Bruno Viaris - Found and provided initial fix for
+ bug in the clientreq() routine when
+ dealing with broken requests from clients.
+ Alexander Loehr - Found and provided fix for a bug in
+ the listen_sock routine.
+ Bob Grabau - Added additional logging of URLs to
+ incoming connections.
+ Mitsuru Yoshida - Made the FreeBSD port
+ Ian Holsman - Suggested the selective listening option
+ Peter Meerwald - Portability suggests and improvements
+ Shaun Johnson - Fixed a problem with compiling with
+ syslog enabled on a SunOS box. Should
+ help other systems too.
+ Timothy E. Newsome - SOCKS firewall enabled tinyproxy
+ George Talusan - Bug testing
+ Chris Lightfoot - Provided patches to give tinyproxy adns
+ support.
+ Michael Pearson,
+ numerous others - Reported connptr bug with patch.
+ Raja Subramanian - Reported fd leak bug, with patch.
+ Raja Subramanian,
+ numerous others - Reported null requests bug.
diff --git a/acconfig.h b/acconfig.h
new file mode 100644
index 0000000..79bced0
--- /dev/null
+++ b/acconfig.h
@@ -0,0 +1,20 @@
+/*
+ * Define if you want to have the peer's IP address to be included in a
+ * XTinyproxy header sent to the server.
+ */
+#undef XTINYPROXY
+
+/* chris - undef'd here so that they can be set up in the configure script */
+#undef DEFAULT_LOG
+#undef DEFAULT_PORT
+#undef DEFAULT_USER
+
+/*
+ * Define if you would like to include filtering code.
+ */
+#undef FILTER_ENABLE
+
+/*
+ * Define if you want to use the included GNU regex routine
+ */
+#undef USE_GNU_REGEX
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..a2143ce
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,129 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4a
+
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AC_PROG_INSTALL])
+dnl We require 2.13 because we rely on SHELL being computed by configure.
+AC_PREREQ([2.13])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated. We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+ case " <<$>>CONFIG_HEADERS " in
+ *" <<$>>am_file "*<<)>>
+ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+ ;;
+ esac
+ am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
diff --git a/adns-0.6/.cvsignore b/adns-0.6/.cvsignore
new file mode 100644
index 0000000..439a8fd
--- /dev/null
+++ b/adns-0.6/.cvsignore
@@ -0,0 +1,8 @@
+Makefile
+config.log
+config.cache
+config.status
+dist_tmp
+adns-*.tar.gz
+settings.make
+*.tmp*
diff --git a/adns-0.6/COPYING b/adns-0.6/COPYING
new file mode 100644
index 0000000..60549be
--- /dev/null
+++ b/adns-0.6/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/adns-0.6/INSTALL b/adns-0.6/INSTALL
new file mode 100644
index 0000000..cbf164a
--- /dev/null
+++ b/adns-0.6/INSTALL
@@ -0,0 +1,58 @@
+INSTALLATION INSTRUCTIONS for ADNS
+
+ $ ./configure
+ $ make
+ # make install
+
+Unfortunately, since this is a beta, there is no good documentation
+yet. For now, use the comments in the public header file adns.h.
+
+
+You will find that adns requires a reasonably standard and up to date
+system.
+
+In particular, the build system assumes that you have ELF shared
+libraries. If you don't then please don't send me patches to support
+your kind of shared libraries, and don't send me patches to use
+libtool. I'm not interested in supporting non-ELF shared libraries.
+However, if you send me an appropriate patch I'd be willing to make it
+easy or automatic to disable the ELF shared library arrangements.
+
+The adnsresfilter utility uses `tsearch' from the C library (a la SVID
+and X/Open). If your C library doesn't have tsearch you will find
+that configure arranges for adnsresfilter not to be built. To rectify
+this, install a C library containing tsearch, such as the GNU C
+library. It is best if tsearch uses an automatically-balancing tree
+algorithm, like the glibc version does. Simple binary trees may
+perform badly.
+
+You will probably find that GNU Make is required.
+
+
+COPYRIGHT
+
+This file, INSTALL, contains installation instructions and other
+details for adns.
+
+adns is
+ Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ Copyright (C) 1999 Tony Finch <dot@dotat.at>
+
+adns is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your
+option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with userv as the file COPYING; if not, email me at the address
+above or write to the Free Software Foundation, 59 Temple Place -
+Suite 330, Boston, MA 02111-1307, USA.
+
+# Local variables:
+# mode: text
+# End:
diff --git a/adns-0.6/Makefile.in b/adns-0.6/Makefile.in
new file mode 100644
index 0000000..0877244
--- /dev/null
+++ b/adns-0.6/Makefile.in
@@ -0,0 +1,68 @@
+# Makefile - top-level Makefile
+#
+# This file is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+# It is part of adns, which is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+# Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+DISTVERSION= 0.6
+srcdir= @srcdir@
+VPATH= @srcdir@
+
+SUBDIRS= src dynamic client regress
+
+all install uninstall clean distclean mostlyclean maintainer-clean distprep:
+ set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
+ $(MAKE) $@-here
+
+all-here install-here uninstall-here distprep-here: README
+
+clean-here mostlyclean-here:
+ rm -f *~ ./#*# core *.orig *.rej adns-*.tar.gz
+ rm -rf dist_tmp
+
+distclean-here maintainer-clean-here: clean-here
+ rm -f settings.make config.h config.cache config.log config.status
+
+install-strip:
+ $(MAKE) INSTALL_PROGRAM_FLAGS=-s
+
+dist_tmp=dist_tmp/adns-$(DISTVERSION)
+dist: distprep
+ rm -rf dist_tmp*
+ mkdir dist_tmp $(dist_tmp)
+ find \( -name CVS -o -name dist_tmp* \) -prune -o -type d -print | \
+ sed -e 's#.*#mkdir -p $(dist_tmp)/&#' | sh
+ find \( -name CVS -o -name dist_tmp* \) -prune -o -type f -print | \
+ sed -e 's#.*#ln & $(dist_tmp)/&#' | sh
+ $(MAKE) -C dist_tmp/adns-$(DISTVERSION) distclean
+ cd dist_tmp && tar cf ../$(dist_tmp).tar `basename $(dist_tmp)`
+ gzip -9 $(dist_tmp).tar
+ mv $(dist_tmp).tar.gz .
+
+check: all
+ $(MAKE) -C regress check
+
+README README-update:
+ lynx -dump -number_links -cfg=/dev/null \
+ http://www.chiark.greenend.org.uk/~ian/adns/ >README.tmp
+ mv -f README.tmp README
+
+TAGS info dvi:
+ # do nothing
diff --git a/adns-0.6/README b/adns-0.6/README
new file mode 100644
index 0000000..43d0df2
--- /dev/null
+++ b/adns-0.6/README
@@ -0,0 +1,148 @@
+
+ GNU adns
+
+ Advanced, easy to use, asynchronous-capable DNS client library.
+
+ adns is a resolver library for C (and C++) programs. In contrast with
+ the existing interfaces, gethostbyname et al and libresolv, it has the
+ following features:
+ * It is reasonably easy to use for simple programs which just want
+ to translate names to addresses, look up MX records, etc.
+ * It can be used in an asynchronous, non-blocking, manner. Many
+ queries can be handled simultaneously.
+ * Responses are decoded automatically into a natural representation
+ for a C program - there is no need to deal with DNS packet
+ formats.
+ * Sanity checking (eg, name syntax checking, reverse/forward
+ correspondence, CNAME pointing to CNAME) is performed
+ automatically.
+ * Time-to-live, CNAME and other similar information is returned in
+ an easy-to-use form, without getting in the way.
+ * There is no global state in the library; resolver state is an
+ opaque data structure which the client creates explicitly. A
+ program can have several instances of the resolver.
+ * Errors are reported to the application in a way that distinguishes
+ the various causes of failure properly.
+ * Understands conventional resolv.conf, but this can overridden by
+ environment variables.
+ * Flexibility. For example, the application can tell adns to: ignore
+ environment variables (for setuid programs), disable sanity checks
+ eg to return arbitrary data, override or ignore resolv.conf in
+ favour of supplied configuration, etc.
+ * Believed to be correct ! For example, will correctly back off to
+ TCP in case of long replies or queries, or to other nameservers if
+ several are available. It has sensible handling of bad responses
+ etc.
+
+Forthcoming:
+
+ I hope that future versions may also have the following features:
+ * The library should be useable by threads in a multithreaded
+ program in a natural way. It should multiplex many threads'
+ queries through a single query socket.
+ * IPv6 support.
+ * Some kind of awareness of DNSSEC.
+ * Possibly some very limited caching behaviour.
+
+ (Technical note: adns requires a real nameserver like [1]BIND or
+ [2]Dents running on the same system or a nearby one, which must be
+ willing to provide `recursive service'. I.e., adns is a `stub
+ resolver'. All properly configured UN*X and GNU systems will already
+ have such nameserver(s); they are usually listed in /etc/resolv.conf.)
+
+Documentation
+
+ I'm afraid there is no manual yet. However, competent C programmers
+ should be able to use the library based on the commented [3]adns.h
+ header file (from version 0.4).
+
+Feedback
+
+ I'd be pleased if you would let me know if you're using my library in
+ your project, and what you think of it.
+
+ If you are subscribed to adns-discuss please send feedback, including
+ bug reports, there; otherwise send mail to
+ adns-bugreports@chiark.greenend.org.uk. If you'd prefer that your
+ message wasn't forwarded to the adns-bugreports list, send it to
+ adns-maint@chiark.greendend.org.uk.
+
+Mailinglists
+
+ I have set up mailinglists adns-announce and adns-discuss. The
+ announcements list is moderated and will contain only announcements of
+ important bugs, new versions, &c. The bug reports address mentioned
+ above is also a mailing list; feel free to subscribe to it.
+
+ There are [4]archives and subscription web pages, or you can subscribe
+ by sending mail containing the word `subscribe' to
+ adns-announce-REQUEST@chiark.greenend.org.uk or
+ adns-discuss-REQUEST@chiark.greenend.org.uk.
+
+Download
+
+ Available for download from [5]chiark.greenend.org.uk are:
+ * The [6]current pre-release version as a gzipped tarfile.
+ * [7]adns.h API header file with comments (currently there is no
+ manual, sorry).
+ * All versions released so far are also available via [8]anonymous
+ FTP.
+ * A mirror of my CVS repository is available via rsync from
+ rsync.chiark.greenend.org.uk::ftp/users/ian/cvs-pub/adns (use FTP
+ first to find your way around).
+
+ adns is also available from the [9]GNU Project FTP servers and their
+ [10]mirrors.
+
+Copyright and licensing
+
+ adns is Copyright 1997-1999 Ian Jackson.
+
+ adns is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ This program and documentation is distributed in the hope that it will
+ be useful, but without any warranty; without even the implied warranty
+ of merchantability or fitness for a particular purpose. See the
+ [11]GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with adns, or one should be available above; if not, write to
+ the [12]Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA, or email adns-maint@chiark.greenend.org.uk.
+ _________________________________________________________________
+
+ [13]Ian Jackson / [14]adns-maint@chiark.greenend.org.uk; more [15]free
+ software by me.
+
+ [16]GNU home page; [17]chiark home page; [18]site or mirror home page
+
+ This web page is Copyright (C)1996-1999 Ian Jackson. See the
+ [19]Copyright/acknowledgements.
+
+ Use any browser - [20]Campaign for a non-browser-specific WWW
+
+References
+
+ 1. http://www.isc.org/view.cgi?/products/BIND/index.phtml
+ 2. http://www.dents.org/
+ 3. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.0.4.txt
+ 4. http://www.chiark.greenend.org.uk/mailman/listinfo
+ 5. http://www.chiark.greenend.org.uk/~ian/adns/
+ 6. http://www.chiark.greenend.org.uk/~ian/adns/adns.tar.gz
+ 7. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.0.5.txt
+ 8. ftp://ftp.chiark.greenend.org.uk/users/ian/adns/
+ 9. http://www.gnu.org/
+ 10. http://www.gnu.org/order/ftp.html
+ 11. http://www.chiark.greenend.org.uk/~ian/COPYING.txt
+ 12. http://www.fsf.org/
+ 13. http://www.chiark.greenend.org.uk/
+ 14. mailto:adns-maint@chiark.greenend.org.uk
+ 15. http://www.chiark.greenend.org.uk/~ian/software/
+ 16. http://www.gnu.org/
+ 17. http://www.chiark.greenend.org.uk/
+ 18. http://www.chiark.greenend.org.uk/
+ 19. http://www.chiark.greenend.org.uk/~ian/sw-www-copy.html
+ 20. http://www.anybrowser.org/campaign/
diff --git a/adns-0.6/TODO b/adns-0.6/TODO
new file mode 100644
index 0000000..8077c55
--- /dev/null
+++ b/adns-0.6/TODO
@@ -0,0 +1,15 @@
+INVESTIGATE:
+* coredump in adnstest_s
+
+BUGS:
+* adns_qf_quoteok_cname should be the default.
+
+WISHLIST:
+* Easy way to make a reverse query.
+* Make timeouts configurable.
+* `fake' reverse queries (give nnn.nnn.nnn.nnn either always or on error)
+* `fake' forward queries (allow nnn.nnn.nnn.nnn -> A)
+* DNSSEC compatibility - be able to retreive KEY and SIG RRs
+* DNSSEC minimum functionality - ignore Additional when AD set.
+* DNSSEC functionality - provide security ?
+* Easy-to-use scripting query tool
diff --git a/adns-0.6/acconfig.h b/adns-0.6/acconfig.h
new file mode 100644
index 0000000..748d10b
--- /dev/null
+++ b/adns-0.6/acconfig.h
@@ -0,0 +1,109 @@
+/*
+ * acconfig.h
+ * input file for autoheader/autoconf/configure: extra stuff for config.h
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/* Define if function attributes a la GCC 2.5 and higher are available. */
+#undef HAVE_GNUC25_ATTRIB
+
+/* Define if constant functions a la GCC 2.5 and higher are available. */
+#undef HAVE_GNUC25_CONST
+
+/* Define if nonreturning functions a la GCC 2.5 and higher are available. */
+#undef HAVE_GNUC25_NORETURN
+
+/* Define if printf-format argument lists a la GCC are available. */
+#undef HAVE_GNUC25_PRINTFFORMAT
+
+/* Define if we want to include rpc/types.h. Crap BSDs put INADDR_LOOPBACK there. */
+#undef HAVEUSE_RPCTYPES_H
+
+@BOTTOM@
+
+/* Use the definitions: */
+
+#ifdef HAVE_POLL
+#include <sys/poll.h>
+#else
+/* kludge it up */
+struct pollfd { int fd; short events; short revents; };
+#define POLLIN 1
+#define POLLPRI 2
+#define POLLOUT 4
+#endif
+
+/* GNU C attributes. */
+#ifndef FUNCATTR
+#ifdef HAVE_GNUC25_ATTRIB
+#define FUNCATTR(x) __attribute__(x)
+#else
+#define FUNCATTR(x)
+#endif
+#endif
+
+/* GNU C printf formats, or null. */
+#ifndef ATTRPRINTF
+#ifdef HAVE_GNUC25_PRINTFFORMAT
+#define ATTRPRINTF(si,tc) format(printf,si,tc)
+#else
+#define ATTRPRINTF(si,tc)
+#endif
+#endif
+#ifndef PRINTFFORMAT
+#define PRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc)))
+#endif
+
+/* GNU C nonreturning functions, or null. */
+#ifndef ATTRNORETURN
+#ifdef HAVE_GNUC25_NORETURN
+#define ATTRNORETURN noreturn
+#else
+#define ATTRNORETURN
+#endif
+#endif
+#ifndef NONRETURNING
+#define NONRETURNING FUNCATTR((ATTRNORETURN))
+#endif
+
+/* Combination of both the above. */
+#ifndef NONRETURNPRINTFFORMAT
+#define NONRETURNPRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc),ATTRNORETURN))
+#endif
+
+/* GNU C constant functions, or null. */
+#ifndef ATTRCONST
+#ifdef HAVE_GNUC25_CONST
+#define ATTRCONST const
+#else
+#define ATTRCONST
+#endif
+#endif
+#ifndef CONSTANT
+#define CONSTANT FUNCATTR((ATTRCONST))
+#endif
+
+#ifdef HAVEUSE_RPCTYPES_H
+#include <rpc/types.h>
+#endif
diff --git a/adns-0.6/aclocal.m4 b/adns-0.6/aclocal.m4
new file mode 100644
index 0000000..d5f21c8
--- /dev/null
+++ b/adns-0.6/aclocal.m4
@@ -0,0 +1,70 @@
+# aclocal.m4 - package-specific macros for autoconf
+#
+# This file is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+# It is part of adns, which is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+# Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#
+# This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+dnl DPKG_CACHED_TRY_COMPILE(<description>,<cachevar>,<include>,<program>,<ifyes>,<ifno>)
+define(DPKG_CACHED_TRY_COMPILE,[
+ AC_MSG_CHECKING($1)
+ AC_CACHE_VAL($2,[
+ AC_TRY_COMPILE([$3],[$4],[$2=yes],[$2=no])
+ ])
+ if test "x$$2" = xyes; then
+ true
+ $5
+ else
+ true
+ $6
+ fi
+])
+
+define(ADNS_C_GCCATTRIB,[
+ DPKG_CACHED_TRY_COMPILE(__attribute__((,,)),adns_cv_c_attribute_supported,,
+ [extern int testfunction(int x) __attribute__((,,))],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GNUC25_ATTRIB)
+ DPKG_CACHED_TRY_COMPILE(__attribute__((noreturn)),adns_cv_c_attribute_noreturn,,
+ [extern int testfunction(int x) __attribute__((noreturn))],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GNUC25_NORETURN),
+ AC_MSG_RESULT(no))
+ DPKG_CACHED_TRY_COMPILE(__attribute__((const)),adns_cv_c_attribute_const,,
+ [extern int testfunction(int x) __attribute__((const))],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GNUC25_CONST),
+ AC_MSG_RESULT(no))
+ DPKG_CACHED_TRY_COMPILE(__attribute__((format...)),adns_cv_attribute_format,,
+ [extern int testfunction(char *y, ...) __attribute__((format(printf,1,2)))],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GNUC25_PRINTFFORMAT),
+ AC_MSG_RESULT(no)),
+ AC_MSG_RESULT(no))
+])
+
+define(ADNS_C_GETFUNC,[
+ AC_CHECK_FUNC([$1],,[
+ AC_CHECK_LIB([$2],[$1],[$3],[
+ AC_MSG_ERROR([cannot find library function $1])
+ ])
+ ])
+])
diff --git a/adns-0.6/changelog b/adns-0.6/changelog
new file mode 100644
index 0000000..0e4cbe1
--- /dev/null
+++ b/adns-0.6/changelog
@@ -0,0 +1,164 @@
+adns (0.6) BETA; urgency=high
+
+ Core library bugfixes:
+ * Avoid infinite timeouts, causing lockup, when they should be zero !
+ * TCP handling revamped (avoids undefined behaviour due to reentrancy).
+ * Do not fail assertion if _qf_owner, _qf_search, domain ends in `.'.
+ * Many memory leaks fixed.
+
+ Cool new utility:
+ * adnsresfilter is like `cat' but converts addresses to names without
+ delaying the output. Pipe `netstat -n', `tcpdump -ln', etc. into it.
+
+ Test and client program bug and portability fixes:
+ * Dynamic library building works properly.
+ * adnshost prints somewhat better messages about some wrong usages.
+ * Include <stdlib.h> and <sys/types.h> in adnshost.h.
+ * adnslogres: parsing and error checking improved (Tony Finch).
+ * Regression tests can cope with zero-length reads.
+ * Regression tests check for memory leaks.
+ * adnstest copes with empty query type list.
+ * adnstest uninitialised memory bug fixed.
+
+ General improvements
+ * Better control of adnshost output and error messages (new -F options).
+ * New adns_if_logpid option (functionality suggested by Tony Finch).
+ * New fanftest test program from Tony Finch (ignored by `make install').
+ * Reads /etc/resolv-adns.conf if it exists.
+ * Declare flags parameters as enums again, not ints.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk> Wed, 24 Nov 1999 17:13:03 +0000
+
+adns (0.5) unstable; urgency=high
+
+ New features:
+ * adnslogres, ~100x faster replacement for Apache logresolve;
+ Thanks to Tony Finch for the program and the performance figure.
+ * Internal consistency checking with assert if right options set.
+ * adns_wait_poll function like adns_wait but uses poll, not select.
+ * adns_reverse_submit function for easy in-addr queries.
+ * adns_errtypeabbrev funcion for getting eg "permfail" from _s_nodata.
+ * adnshost utility for scripts and the like (rather alpha).
+
+ Incompatible changes:
+ * RRs with mailboxes never rejected due to strange chars if _raw.
+ * Lack of a mailbox produces `.' not `<>'.
+ * Better usage messages (and no default query domain) for adnstest.
+ * Return EAGAIN from _check instead of EWOULDBLOCK.
+ * adns_rr_info on _r_mx etc. shows status type abbrev and status number.
+
+ Bugfixes:
+ * Do not invoke __autosys indirectly from __procdgram (result: coredump
+ usually in memmove, unless adns_if_noautosys was used).
+ * Do not scramble innards when a query on the output queue is cancelled.
+ * Do not close tcp socket twice.
+ * Mailboxes containing spaces in their names are quoted.
+ * Give ESRCH, not EAGAIN, if _check called with no queries outstanding.
+ * adns_rr_hostaddr naddrs is -1 on temporary failure (as documented).
+ * Reject TXT RRs with no strings.
+ * Correct error messages for qname CNAME foo, foo CNAME bar.
+ * adns_processany actually does something.
+ * Fixed typos in adns.h.
+
+ General improvements:
+ * Promise not to change fds in adns_beforepoll (if now is specified).
+ * Improved textual error string for _s_prohibitedcname.
+ * New comment in adns_processany and return 0 (not r which is 0).
+ * Documentation of resolv.conf directives and options, and of environment
+ variables understood, in adns.h
+ * Regression test scripts set EF_DISABLE_BANNER (for Electric Fence).
+
+ Portability and build improvements:
+ * Give install the '-c' flag (otherwise some delete the original !).
+ * Do not remove top-level Makefile on `make clean'.
+ * Don't complain so much about poll(2) tests if not available.
+ * Do not give -u 0 -g 0 options to install.
+ * Remove trailing , from some enums in adns.h.
+ * Dynamically linked clients now made with -l, so as to avoid rpath.
+ * Do not use $^ in make rules (should help with non-GNU make).
+ * Declare flags parameters as ints not enums because C++ is crap.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk> Wed, 13 Oct 1999 02:24:35 +0100
+
+adns (0.4) unstable; urgency=high
+
+ General important bugfixes:
+ * make _qf_owner work if _qf_search not specified, and test it (oops!)
+ * ads->configerrno now initialised (in setup.c).
+ * timercmp(,,<=) doesn't work - use !timercmp(,,>).
+ * Changed memory semantics of internal queries to fix bugs.
+ * Restarting a TCP-using query (eg due to CNAME) doesn't abort.
+
+ Fixes for handling of broken kinds of reply:
+ * Only accept a reply from the subset of servers we sent the query.
+ * Ignore CNAME(s) in answer after RR(s) (and test).
+
+ Other bugfixes and improvements:
+ * adns_s_systemfail is in table of errors (for eg adns_strerror).
+ * Do not ship config.cache, Makefile, etc.
+ * Improvements to install instructions, TODO, etc.
+ * Regression tests compile on systems without poll(2).
+ * Do not install adnstest_s.
+ * _submit returns ENOSYS, not adns_s_unknownquery; documented, tested.
+ * <adns.h> includes <sys/types.h>, <sys/time.h>, <unistd.h>.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk> Thu, 5 Aug 1999 01:17:38 +0100
+
+adns (0.3) unstable; urgency=low
+
+ Incompatible changes:
+ * Low adns_status values (below adns_s_max_tempfail) renumbered to make
+ room for future locally-induced and locally-detected errors.
+ * Event loop functions for use by select(2) renamed and tidied up.
+
+ Features / improvements:
+ * New adns_errabbrev() for getting status abbreviation strings.
+ * regress/checkall prints summary list of failed tests, if any.
+ * Event loop functions for poll(2), and some raw variants.
+ * adnstest has ability to use poll(2), and user can set initflags.
+ * checkall prints passed list as well as failed list, if any failed.
+ * You can iterate over outstanding queries (but only once at a time).
+
+ Bugfixes:
+ * Non-RFC822 mailbox `domain' formatting now works, and clarified.
+ * Rejection of bad characters in domains (without quoteok) works.
+ * Clean up parents from adns->childw (otherwise would abort/segfault).
+ * In adnstest, allocate enough space for, and terminate, query types.
+ * In adnstest, don't print errno values as adns_status values.
+
+ * Added TODO file.
+ * Made adnstest.c test context pointers.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk> Thu, 15 Jul 1999 00:23:12 +0100
+
+adns (0.2) experimental; urgency=low
+
+ Portability fixes for compilation on various platforms:
+ * Include <sys/socket.h> and <netinet/in.h> in files with <arpa/inet.h>.
+ * Don't use GCC union assignment feature (.rrs=0 => .rrs.untyped=0).
+ * Explictly cast things to [const] struct sockaddr* in syscall args.
+ * Check whether we need -lsocket.
+ * Include <sys/times.h> in a few more files.
+ * Include <unistd.h> and <sys/time.h> for select.
+ * Look for inet_aton and inet_ntoa (in -lnsl and -lsocket).
+ * LDLIBS removed from dependency lists (some makes don't support this).
+ * An `ambiguous else' warning from some compilers in types.c is removed.
+
+ Other changes:
+ * Added COPYING (copy of the GPL).
+ * Regression test failure output improved.
+ * Missing targets in regress/Makefile.in added.
+ * Regression test doesn't rely on value of fcntl flags eg O_NONBLOCK.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk> Thu, 20 May 1999 00:27:32 +0100
+
+adns (0.1) experimental; urgency=low
+
+ * Initial public alpha release.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk> Sat, 17 April 1999 17:42:19
+
+Local variables:
+mode: debian-changelog
+fill-column: 75
+End:
diff --git a/adns-0.6/client/.cvsignore b/adns-0.6/client/.cvsignore
new file mode 100644
index 0000000..45bcf1e
--- /dev/null
+++ b/adns-0.6/client/.cvsignore
@@ -0,0 +1,11 @@
+Makefile
+adnstest
+adnstest_s
+adnslogres
+adnslogres_s
+adnshost
+adnshost_s
+adnsresfilter
+adnsresfilter_s
+fanftest
+fanftest_s
diff --git a/adns-0.6/client/Makefile.in b/adns-0.6/client/Makefile.in
new file mode 100644
index 0000000..a7b3aaa
--- /dev/null
+++ b/adns-0.6/client/Makefile.in
@@ -0,0 +1,74 @@
+# client/Makefile - client program(s) Makefile
+#
+# This file is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+# It is part of adns, which is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+# Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+srcdir= @srcdir@
+VPATH= @srcdir@
+
+PROGS_SYSDEP= @PROGS_HAVE_TSEARCH@
+
+PROGRAMS= adnstest adnslogres adnshost $(PROGS_SYSDEP)
+PROGRAMS_LOCAL= fanftest
+PROGRAMS_ALL= $(PROGRAMS) $(PROGRAMS_LOCAL)
+
+TARG_INSTALL= $(PROGRAMS)
+TARG_LOCAL= $(addsuffix _s, $(PROGRAMS_ALL))
+TARGETS= $(TARG_LOCAL) $(TARG_INSTALL)
+include $(srcdir)/../settings.make
+
+DIRCFLAGS= -I$(srcdir)/../src
+
+TARG_OBJS= $(addsuffix .o, $(PROGRAMS_ALL))
+ADH_OBJS= adh-main.o adh-opts.o adh-query.o
+ALL_OBJS= $(ADH_OBJS) $(TARG_OBJS)
+
+ADNSDIR= $(srcdir)/../src/
+
+STATIC_LIB= $(ADNSDIR)/libadns.a
+DYNAMIC_DEP= $(srcdir)/../dynamic/$(SHLIBFILE)
+DYNAMIC_LINK= -L$(srcdir)/../dynamic -ladns
+
+all: $(TARGETS)
+
+install: $(TARG_INSTALL)
+ set -xe; for f in $(TARG_INSTALL); \
+ do $(INSTALL_PROGRAM) $$f $(bin_dir)/$$f; done
+
+uninstall:
+ for f in $(TARGETS); do rm -f $(bin_dir)/$$f; done
+
+adnshost: $(ADH_OBJS) $(DYNAMIC_DEP)
+ $(CC) $(LDFLAGS) $(ADH_OBJS) $(DYNAMIC_LINK) -o $@ $(LDLIBS)
+
+adnshost_s: $(ADH_OBJS) $(STATIC_LIB)
+ $(CC) $(LDFLAGS) $(ADH_OBJS) $(STATIC_LIB) -o $@ $(LDLIBS)
+
+$(ADH_OBJS): adnshost.h
+$(ALL_OBJS): $(ADNSDIR)/adns.h $(ADNSDIR)/config.h
+adnsresfilter.o: $(ADNSDIR)/tvarith.h
+
+%: %.o $(DYNAMIC_DEP)
+ $(CC) $(LDFLAGS) $< $(DYNAMIC_LINK) -o $@ $(LDLIBS)
+
+%_s: %.o $(STATIC_LIB)
+ $(CC) $(LDFLAGS) $< $(STATIC_LIB) -o $@ $(LDLIBS)
+
diff --git a/adns-0.6/client/adh-main.c b/adns-0.6/client/adh-main.c
new file mode 100644
index 0000000..81cff54
--- /dev/null
+++ b/adns-0.6/client/adh-main.c
@@ -0,0 +1,243 @@
+/*
+ * adh-main.c
+ * - useful general-purpose resolver client program
+ * main program and useful subroutines
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "adnshost.h"
+
+void sysfail(const char *what, int errnoval) {
+ fprintf(stderr,"adnshost failed: %s: %s\n",what,strerror(errnoval));
+ exit(10);
+}
+
+void usageerr(const char *fmt, ...) {
+ va_list al;
+ fputs("adnshost usage error: ",stderr);
+ va_start(al,fmt);
+ vfprintf(stderr,fmt,al);
+ va_end(al);
+ putc('\n',stderr);
+ exit(11);
+}
+
+void outerr(void) {
+ sysfail("write to stdout",errno);
+}
+
+void *xmalloc(size_t sz) {
+ void *p;
+
+ p= malloc(sz); if (!p) sysfail("malloc",sz);
+ return p;
+}
+
+char *xstrsave(const char *str) {
+ char *p;
+
+ p= xmalloc(strlen(str)+1);
+ strcpy(p,str);
+ return p;
+}
+
+void of_type(const struct optioninfo *oi, const char *arg) {
+ static const struct typename {
+ adns_rrtype type;
+ const char *desc;
+ } typenames[]= {
+ /* enhanced versions */
+ { adns_r_ns, "ns" },
+ { adns_r_soa, "soa" },
+ { adns_r_ptr, "ptr" },
+ { adns_r_mx, "mx" },
+ { adns_r_rp, "rp" },
+ { adns_r_addr, "addr" },
+
+ /* types with only one version */
+ { adns_r_cname, "cname" },
+ { adns_r_hinfo, "hinfo" },
+ { adns_r_txt, "txt" },
+
+ /* raw versions */
+ { adns_r_a, "a" },
+ { adns_r_ns_raw, "ns-" },
+ { adns_r_soa_raw, "soa-" },
+ { adns_r_ptr_raw, "ptr-" },
+ { adns_r_mx_raw, "mx-" },
+ { adns_r_rp_raw, "rp-" },
+
+ { adns_r_none, 0 }
+ };
+
+ const struct typename *tnp;
+
+ for (tnp=typenames;
+ tnp->type && strcmp(arg,tnp->desc);
+ tnp++);
+ if (!tnp->type) usageerr("unknown RR type %s",arg);
+ ov_type= tnp->type;
+}
+
+int rcode;
+
+static void process_optarg(const char *arg,
+ const char *const **argv_p,
+ const char *value) {
+ const struct optioninfo *oip;
+ int invert;
+
+ if (arg[0] == '-' || arg[0] == '+') {
+ if (arg[0] == '-' && arg[1] == '-') {
+ if (!strncmp(arg,"--no-",5)) {
+ invert= 1;
+ oip= opt_findl(arg+5);
+ } else {
+ invert= 0;
+ oip= opt_findl(arg+2);
+ }
+ if (oip->type == ot_funcarg) {
+ arg= argv_p ? *++(*argv_p) : value;
+ if (!arg) usageerr("option --%s requires a value argument",oip->lopt);
+ } else {
+ if (value) usageerr("option --%s does not take a value",oip->lopt);
+ arg= 0;
+ }
+ opt_do(oip,arg,invert);
+ } else if (arg[0] == '-' && arg[1] == 0) {
+ arg= argv_p ? *++(*argv_p) : value;
+ if (!arg) usageerr("option `-' must be followed by a domain");
+ query_do(arg);
+ } else { /* arg[1] != '-', != '\0' */
+ invert= (arg[0] == '+');
+ ++arg;
+ while (*arg) {
+ oip= opt_finds(&arg);
+ if (oip->type == ot_funcarg) {
+ if (!*arg) {
+ arg= argv_p ? *++(*argv_p) : value;
+ if (!arg) usageerr("option -%s requires a value argument",oip->sopt);
+ } else {
+ if (value) usageerr("two values for option -%s given !",oip->sopt);
+ }
+ opt_do(oip,arg,invert);
+ arg= "";
+ } else {
+ if (value) usageerr("option -%s does not take a value",oip->sopt);
+ opt_do(oip,0,invert);
+ }
+ }
+ }
+ } else { /* arg[0] != '-' */
+ query_do(arg);
+ }
+}
+
+static void read_stdin(void) {
+ static int used, avail;
+ static char *buf;
+
+ int anydone, r;
+ char *newline, *space;
+
+ anydone= 0;
+ while (!anydone || used) {
+ while (!(newline= memchr(buf,'\n',used))) {
+ if (used == avail) {
+ avail += 20; avail <<= 1;
+ buf= realloc(buf,avail);
+ if (!buf) sysfail("realloc stdin buffer",errno);
+ }
+ do {
+ r= read(0,buf+used,avail-used);
+ } while (r < 0 && errno == EINTR);
+ if (r == 0) {
+ if (used) {
+ /* fake up final newline */
+ buf[used++]= '\n';
+ r= 1;
+ } else {
+ ov_pipe= 0;
+ return;
+ }
+ }
+ if (r < 0) sysfail("read stdin",errno);
+ used += r;
+ }
+ *newline++= 0;
+ space= strchr(buf,' ');
+ if (space) *space++= 0;
+ process_optarg(buf,0,space);
+ used -= (newline-buf);
+ memmove(buf,newline,used);
+ anydone= 1;
+ }
+}
+
+int main(int argc, const char *const *argv) {
+ struct timeval *tv, tvbuf;
+ adns_query qu;
+ void *qun_v;
+ adns_answer *answer;
+ int r, maxfd;
+ fd_set readfds, writefds, exceptfds;
+ const char *arg;
+
+ while ((arg= *++argv)) process_optarg(arg,&argv,0);
+
+ if (!ov_pipe && !ads) usageerr("no domains given, and -f/--pipe not used; try --help");
+
+ ensure_adns_init();
+
+ for (;;) {
+ for (;;) {
+ qu= ov_asynch ? 0 : outstanding.head ? outstanding.head->qu : 0;
+ r= adns_check(ads,&qu,&answer,&qun_v);
+ if (r == EAGAIN) break;
+ if (r == ESRCH) { if (!ov_pipe) goto x_quit; else break; }
+ assert(!r);
+ query_done(qun_v,answer);
+ }
+ maxfd= 0;
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_ZERO(&exceptfds);
+ if (ov_pipe) {
+ maxfd= 1;
+ FD_SET(0,&readfds);
+ }
+ tv= 0;
+ adns_beforeselect(ads, &maxfd, &readfds,&writefds,&exceptfds, &tv,&tvbuf,0);
+ r= select(maxfd, &readfds,&writefds,&exceptfds, tv);
+ if (r == -1) {
+ if (errno == EINTR) continue;
+ sysfail("select",errno);
+ }
+ adns_afterselect(ads, maxfd, &readfds,&writefds,&exceptfds, 0);
+ if (ov_pipe && FD_ISSET(0,&readfds)) read_stdin();
+ }
+x_quit:
+ if (fclose(stdout)) outerr();
+ exit(rcode);
+}
diff --git a/adns-0.6/client/adh-opts.c b/adns-0.6/client/adh-opts.c
new file mode 100644
index 0000000..46d5606
--- /dev/null
+++ b/adns-0.6/client/adh-opts.c
@@ -0,0 +1,337 @@
+/*
+ * adh-opts.c
+ * - useful general-purpose resolver client program
+ * option handling tables etc.
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "adnshost.h"
+
+int ov_env=1, ov_pipe=0, ov_asynch=0;
+int ov_verbose= 0;
+adns_rrtype ov_type= adns_r_none;
+int ov_search=0, ov_qc_query=0, ov_qc_anshost=0, ov_qc_cname=1;
+int ov_tcp=0, ov_cname=0, ov_format=fmt_default;
+char *ov_id= 0;
+struct perqueryflags_remember ov_pqfr = { 1,1,1, tm_none };
+
+static const struct optioninfo global_options[]= {
+ { ot_desconly, "global binary options:" },
+ { ot_flag, "Do not look at environment variables at all",
+ "e", "env", &ov_env, 0 },
+ { ot_flag, "Read queries on stdin instead of using args",
+ "f", "pipe", &ov_pipe, 1 },
+ { ot_flag, "Allow answers to be reordered",
+ "a", "asynch", &ov_asynch, 1 },
+
+ { ot_desconly, "answer/error output format and destination (see below):" },
+ { ot_value, "Answers to stdout, errors as messages to stderr (default)",
+ "Fs", "fmt-simple", &ov_format, fmt_simple },
+ { ot_value, "Answers and errors both to stdout in parseable format",
+ "Fi", "fmt-inline", &ov_format, fmt_inline },
+ { ot_value, "Fully-parseable output format (default for --asynch)",
+ "Fa", "fmt-asynch", &ov_format, fmt_asynch },
+
+ { ot_desconly, "global verbosity level:" },
+ { ot_value, "Do not print anything to stderr",
+ "Vq", "quiet", &ov_verbose, adns_if_noerrprint },
+ { ot_value, "Report unexpected kinds of problem only (default)",
+ "Vn", "no-quiet", &ov_verbose, 0 },
+ { ot_value, "Debugging mode",
+ "Vd", "debug", &ov_verbose, adns_if_debug },
+
+ { ot_desconly, "other global options:" },
+ { ot_func, "Print usage information",
+ 0, "help", 0,0, of_help },
+
+ { ot_end }
+};
+
+static const struct optioninfo perquery_options[]= {
+ { ot_desconly, "per-query options:" },
+ { ot_funcarg, "Query type (see below)",
+ "t", "type", 0,0, &of_type, "type" },
+ { ot_funcarg, "Do reverse query (address -> name lookup)",
+ "i", "ptr", 0,0, &of_ptr, "addr" },
+
+ { ot_desconly, "per-query binary options:" },
+ { ot_flag, "Use the search list",
+ "s", "search", &ov_search, 1 },
+ { ot_flag, "Let query domains contain quote-requiring chars",
+ "Qq", "qc-query", &ov_qc_query, 1 },
+ { ot_flag, "Let hostnames in answers contain ...",
+ "Qa", "qc-anshost", &ov_qc_anshost, 1 },
+ { ot_flag, "Prevent CNAME target domains from containing ...",
+ "Qc", "qc-cname", &ov_qc_cname, 0 },
+ { ot_flag, "Force use of a virtual circuit",
+ "u", "tcp", &ov_tcp, 1 },
+ { ot_flag, "Do not display owner name in output",
+ "Do", "show-owner", &ov_pqfr.show_owner, 0 },
+ { ot_flag, "Do not display RR type in output",
+ "Dt", "show-type", &ov_pqfr.show_type, 0 },
+ { ot_flag, "Do not display CNAME target in output",
+ "Dc", "show-cname", &ov_pqfr.show_cname, 0 },
+
+ { ot_desconly, "per-query TTL mode (NB TTL is minimum across all info in reply):" },
+ { ot_value, "Show the TTL as a TTL",
+ "Tt", "ttl-ttl", &ov_pqfr.ttl, tm_rel },
+ { ot_value, "Show the TTL as a time_t when the data might expire",
+ "Ta", "ttl-abs", &ov_pqfr.ttl, tm_abs },
+ { ot_value, "Do not show the TTL (default)",
+ "Tn", "no-ttl", &ov_pqfr.ttl, tm_none },
+
+ { ot_desconly, "per-query CNAME handling mode:" },
+ { ot_value, "Call it an error if a CNAME is found",
+ "Cf", "cname-reject", &ov_cname, adns_qf_cname_forbid },
+ { ot_value, "Allow references to CNAMEs in other RRs",
+ "Cl", "cname-loose", &ov_cname, adns_qf_cname_loose },
+ { ot_value, "CNAME ok for query domain, but not in RRs (default)",
+ "Cs", "cname-ok", &ov_cname, 0 },
+
+ { ot_desconly, "asynchronous/pipe mode options:" },
+ { ot_funcarg, "Set <id>, default is decimal sequence starting 0",
+ 0, "asynch-id", 0,0, &of_asynch_id, "id" },
+ { ot_funcarg, "Cancel the query with id <id> (no error if not found)",
+ 0, "cancel-id", 0,0, &of_cancel_id, "id" },
+
+ { ot_end }
+};
+
+static void printusage(void) {
+ static const struct optioninfo *const all_optiontables[]= {
+ global_options, perquery_options, 0
+ };
+
+ const struct optioninfo *const *oiap, *oip=0;
+ int maxsopt, maxlopt, l;
+
+ maxsopt= maxlopt= 0;
+
+ for (oiap=all_optiontables; *oiap; oiap++) {
+ for (oip=*oiap; oip->type != ot_end; oip++) {
+ if (oip->type == ot_funcarg) continue;
+ if (oip->sopt) { l= strlen(oip->sopt); if (l>maxsopt) maxsopt= l; }
+ if (oip->lopt) {
+ l= strlen(oip->lopt);
+ if (oip->type == ot_flag && !oip->value) l+= 3;
+ if (l>maxlopt) maxlopt= l;
+ }
+ }
+ }
+
+ fputs("usage: adnshost [global-opts] [query-opts] query-domain\n"
+ " [[query-opts] query-domain ...]\n"
+ " adnshost [global-opts] [query-opts] -f|--pipe\n",
+ stdout);
+
+ for (oiap=all_optiontables; *oiap; oiap++) {
+ putchar('\n');
+ for (oip=*oiap; oip->type != ot_end; oip++) {
+ switch (oip->type) {
+ case ot_flag:
+ if (!oip->value) {
+ if (oip->sopt) {
+ printf(" +%-*s --no-%-*s %s\n",
+ maxsopt, oip->sopt,
+ maxlopt-2, oip->lopt,
+ oip->desc);
+ } else {
+ printf(" --no-%-*s %s\n",
+ maxlopt+maxsopt+1, oip->lopt,
+ oip->desc);
+ }
+ break;
+ }
+ case ot_value: case ot_func: /* fall through */
+ if (oip->sopt) {
+ printf(" -%-*s --%-*s %s\n",
+ maxsopt, oip->sopt,
+ maxlopt+1, oip->lopt,
+ oip->desc);
+ } else {
+ printf(" --%-*s %s\n",
+ maxlopt+maxsopt+3, oip->lopt,
+ oip->desc);
+ }
+ break;
+ case ot_funcarg:
+ if (oip->sopt) {
+ l= (maxlopt + maxsopt - 9 -
+ (strlen(oip->sopt) + strlen(oip->lopt) + 2*strlen(oip->argdesc)));
+ printf(" -%s<%s> / --%s <%s>%*s%s\n",
+ oip->sopt, oip->argdesc, oip->lopt, oip->argdesc,
+ l>2 ? l : 2, "",
+ oip->desc);
+ } else {
+ l= (maxlopt + maxsopt + 1 -
+ (strlen(oip->lopt) + strlen(oip->argdesc)));
+ printf(" --%s <%s>%*s%s\n",
+ oip->lopt, oip->argdesc,
+ l>2 ? l : 2, "",
+ oip->desc);
+ }
+ break;
+ case ot_desconly:
+ printf("%s\n", oip->desc);
+ break;
+ default:
+ abort();
+ }
+ }
+ }
+
+ printf("\nEscaping domains which might start with `-':\n"
+ " - %-*s Next argument is a domain, but more options may follow\n",
+ maxlopt+maxsopt+3, "<domain>");
+
+ fputs("\n"
+ "Query domains should always be quoted according to master file format.\n"
+ "\n"
+ "For binary options, --FOO and --no-FOO are opposites, as are\n"
+ "-X and +X. In each case the default is the one not listed.\n"
+ "Per query options stay set a particular way until they are reset,\n"
+ "whether they appear on the command line or on stdin.\n"
+ "All global options must preceed the first query domain.\n"
+ "\n"
+ "With -f, the input should be lines with either an option, possibly\n"
+ "with a value argument (separated from the option by a space if it's a long\n"
+ "option), or a domain (possibly preceded by a hyphen and a space to\n"
+ "distinguish it from an option).\n"
+ "\n"
+ "Output format is master file format without class or TTL by default:\n"
+ " [<owner>] [<ttl>] [<type>] <data>\n"
+ "or if the <owner> domain refers to a CNAME and --show-cname is on\n"
+ " [<owner>] [<ttl>] CNAME <cname>\n"
+ " [<cname>] [<ttl>] <type> <data>\n"
+ "When a query fails you get an error message to stderr (with --fmt-simple).\n"
+ "Specify --fmt-inline for lines like this (broken here for readability):\n"
+ " ; failed <statustype> <statusnum> <statusabbrev> \\\n"
+ " [<owner>] [<ttl>] [<cname>] \"<status string>\"\n"
+ "If you use --fmt-asynch, which is the default for --asynch,\n"
+ "each answer (success or failure) is preceded by a line\n"
+ " <id> <nrrs> <statustype> <statusnum> <statusabbrev> \\\n"
+ " [<owner>] [<ttl>] [<cname>] \"<status string>\"\n"
+ "where <nrrs> is the number of RRs that follow and <cname> will be `$' or\n"
+ "the CNAME target; the CNAME indirection and error formats above are not used.\n"
+ "\n"
+ "Exit status:\n"
+ " 0 all went well\n"
+ " 1-6 at least one query failed with statustype:\n"
+ " 1 localfail )\n"
+ " 2 remotefail ) temporary errors\n"
+ " 3 tempfail __)_________________\n"
+ " 4 misconfig )\n"
+ " 5 misquery ) permanent errors\n"
+ " 6 permfail )\n"
+ " 10 system trouble\n"
+ " 11 usage problems\n"
+ "\n"
+ "Query types (see adns.h; default is addr):\n"
+ " ns soa ptr mx rp addr - enhanced versions\n"
+ " cname hinfo txt - types with only one version\n"
+ " a ns- soa- ptr- mx- rp- - _raw versions\n"
+ "Default is addr, or ptr for -i/--ptr queries\n",
+ stdout);
+ if (ferror(stdout)) sysfail("write usage message",errno);
+}
+
+void of_help(const struct optioninfo *oi, const char *arg) {
+ printusage();
+ if (fclose(stdout)) sysfail("finish writing output",errno);
+ exit(0);
+}
+
+typedef int comparer_type(const char **optp, const struct optioninfo *entry);
+
+static int oc_long(const char **optp, const struct optioninfo *entry) {
+ return entry->lopt && !strcmp(*optp,entry->lopt);
+}
+
+static int oc_short(const char **optp, const struct optioninfo *entry) {
+ const char *sopt;
+ int l;
+
+ sopt= entry->sopt;
+ if (!sopt) return 0;
+ l= strlen(sopt);
+ if (memcmp(*optp,sopt,l)) return 0;
+ (*optp) += l;
+ return 1;
+}
+
+static const struct optioninfo *find1(const char **optp,
+ const struct optioninfo *table,
+ comparer_type *comparer) {
+ for (;;) {
+ if (table->type == ot_end) return 0;
+ if (comparer(optp,table)) return table;
+ table++;
+ }
+}
+
+static const struct optioninfo *find(const char **optp,
+ const char *prefix,
+ comparer_type *comparer) {
+ const struct optioninfo *oip;
+ const char *opt;
+
+ opt= *optp;
+ oip= find1(optp,perquery_options,comparer);
+ if (oip) return oip;
+ oip= find1(optp,global_options,comparer);
+ if (!oip) usageerr("unknown option %s%s",prefix,opt);
+ if (ads) usageerr("global option %s%s specified after query domain(s)",prefix,opt);
+ return oip;
+}
+
+const struct optioninfo *opt_findl(const char *opt) { return find(&opt,"--",oc_long); }
+const struct optioninfo *opt_finds(const char **optp) { return find(optp,"-",oc_short); }
+
+static void noninvert(const struct optioninfo *oip) NONRETURNING;
+static void noninvert(const struct optioninfo *oip) {
+ usageerr("option %s%s%s%s%s may not be inverted",
+ oip->sopt ? "-" : "", oip->sopt ? oip->sopt : "",
+ oip->lopt && oip->sopt ? " / " : "",
+ oip->lopt ? "--" : "", oip->lopt ? oip->lopt : "");
+}
+
+void opt_do(const struct optioninfo *oip, const char *arg, int invert) {
+ switch (oip->type) {
+ case ot_flag:
+ assert(!arg);
+ *oip->storep= !invert;
+ return;
+ case ot_value:
+ assert(!arg);
+ if (invert) noninvert(oip);
+ *oip->storep= oip->value;
+ return;
+ case ot_func: case ot_funcarg:
+ if (invert) noninvert(oip);
+ oip->func(oip,arg);
+ return;
+ default:
+ abort();
+ }
+}
diff --git a/adns-0.6/client/adh-query.c b/adns-0.6/client/adh-query.c
new file mode 100644
index 0000000..bae71f4
--- /dev/null
+++ b/adns-0.6/client/adh-query.c
@@ -0,0 +1,274 @@
+/*
+ * adh-query.c
+ * - useful general-purpose resolver client program
+ * make queries and print answers
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "adnshost.h"
+
+adns_state ads;
+struct outstanding_list outstanding;
+
+static unsigned long idcounter;
+
+void ensure_adns_init(void) {
+ int r;
+
+ if (ads) return;
+
+ if (signal(SIGPIPE,SIG_IGN) == SIG_ERR) sysfail("ignore SIGPIPE",errno);
+ r= adns_init(&ads,
+ adns_if_noautosys|adns_if_nosigpipe |
+ (ov_env ? 0 : adns_if_noenv) |
+ ov_verbose,
+ 0);
+ if (r) sysfail("adns_init",r);
+
+ if (ov_format == fmt_default)
+ ov_format= ov_asynch ? fmt_asynch : fmt_simple;
+}
+
+static void prep_query(struct query_node **qun_r, int *quflags_r) {
+ struct query_node *qun;
+ char idbuf[20];
+
+ if (ov_pipe && !ads) usageerr("-f/--pipe not consistent with domains on command line");
+ ensure_adns_init();
+
+ qun= malloc(sizeof(*qun));
+ qun->pqfr= ov_pqfr;
+ if (ov_id) {
+ qun->id= xstrsave(ov_id);
+ } else {
+ sprintf(idbuf,"%lu",idcounter++);
+ idcounter &= 0x0fffffffflu;
+ qun->id= xstrsave(idbuf);
+ }
+
+ *quflags_r=
+ (ov_search ? adns_qf_search : 0) |
+ (ov_tcp ? adns_qf_usevc : 0) |
+ ((ov_pqfr.show_owner || ov_format == fmt_simple) ? adns_qf_owner : 0) |
+ (ov_qc_query ? adns_qf_quoteok_query : 0) |
+ (ov_qc_anshost ? adns_qf_quoteok_anshost : 0) |
+ (ov_qc_cname ? 0 : adns_qf_quoteok_cname) |
+ ov_cname,
+
+ *qun_r= qun;
+}
+
+void of_ptr(const struct optioninfo *oi, const char *arg) {
+ struct query_node *qun;
+ int quflags, r;
+ struct sockaddr_in sa;
+
+ memset(&sa,0,sizeof(sa));
+ sa.sin_family= AF_INET;
+ if (!inet_aton(arg,&sa.sin_addr)) usageerr("invalid IP address %s",arg);
+
+ prep_query(&qun,&quflags);
+ r= adns_submit_reverse(ads,
+ (struct sockaddr*)&sa,
+ ov_type == adns_r_none ? adns_r_ptr : ov_type,
+ quflags,
+ qun,
+ &qun->qu);
+ if (r) sysfail("adns_submit_reverse",r);
+
+ LIST_LINK_TAIL(outstanding,qun);
+}
+
+void query_do(const char *domain) {
+ struct query_node *qun;
+ int quflags, r;
+
+ prep_query(&qun,&quflags);
+ r= adns_submit(ads, domain,
+ ov_type == adns_r_none ? adns_r_addr : ov_type,
+ quflags,
+ qun,
+ &qun->qu);
+ if (r) sysfail("adns_submit",r);
+
+ LIST_LINK_TAIL(outstanding,qun);
+}
+
+static void dequeue_query(struct query_node *qun) {
+ LIST_UNLINK(outstanding,qun);
+ free(qun->id);
+ free(qun);
+}
+
+static void print_withspace(const char *str) {
+ if (printf("%s ", str) == EOF) outerr();
+}
+
+static void print_ttl(struct query_node *qun, adns_answer *answer) {
+ unsigned long ttl;
+ time_t now;
+
+ switch (qun->pqfr.ttl) {
+ case tm_none:
+ return;
+ case tm_rel:
+ if (time(&now) == (time_t)-1) sysfail("get current time",errno);
+ ttl= answer->expires < now ? 0 : answer->expires - now;
+ break;
+ case tm_abs:
+ ttl= answer->expires;
+ break;
+ default:
+ abort();
+ }
+ if (printf("%lu ",ttl) == EOF) outerr();
+}
+
+static void print_owner_ttl(struct query_node *qun, adns_answer *answer) {
+ if (qun->pqfr.show_owner) print_withspace(answer->owner);
+ print_ttl(qun,answer);
+}
+
+static void check_status(adns_status st) {
+ static const adns_status statuspoints[]= {
+ adns_s_ok,
+ adns_s_max_localfail, adns_s_max_remotefail, adns_s_max_tempfail,
+ adns_s_max_misconfig, adns_s_max_misquery
+ };
+
+ const adns_status *spp;
+ int minrcode;
+
+ for (minrcode=0, spp=statuspoints;
+ spp < statuspoints + (sizeof(statuspoints)/sizeof(statuspoints[0]));
+ spp++)
+ if (st > *spp) minrcode++;
+ if (rcode < minrcode) rcode= minrcode;
+}
+
+static void print_status(adns_status st, struct query_node *qun, adns_answer *answer) {
+ const char *statustypeabbrev, *statusabbrev, *statusstring;
+
+ statustypeabbrev= adns_errtypeabbrev(st);
+ statusabbrev= adns_errabbrev(st);
+ statusstring= adns_strerror(st);
+ assert(!strchr(statusstring,'"'));
+
+ if (printf("%s %d %s ", statustypeabbrev, st, statusabbrev)
+ == EOF) outerr();
+ print_owner_ttl(qun,answer);
+ if (qun->pqfr.show_cname)
+ print_withspace(answer->cname ? answer->cname : "$");
+ if (printf("\"%s\"\n", statusstring) == EOF) outerr();
+}
+
+static void print_dnsfail(adns_status st, struct query_node *qun, adns_answer *answer) {
+ int r;
+ const char *typename, *statusstring;
+ adns_status ist;
+
+ if (ov_format == fmt_inline) {
+ if (fputs("; failed ",stdout) == EOF) outerr();
+ print_status(st,qun,answer);
+ return;
+ }
+ assert(ov_format == fmt_simple);
+ if (st == adns_s_nxdomain) {
+ r= fprintf(stderr,"%s does not exist\n", answer->owner);
+ } else {
+ ist= adns_rr_info(answer->type, &typename, 0,0,0,0);
+ if (st == adns_s_nodata) {
+ r= fprintf(stderr,"%s has no %s record\n", answer->owner, typename);
+ } else {
+ statusstring= adns_strerror(st);
+ r= fprintf(stderr,"Error during DNS %s lookup for %s: %s\n",
+ typename, answer->owner, statusstring);
+ }
+ }
+ if (r == EOF) sysfail("write error message to stderr",errno);
+}
+
+void query_done(struct query_node *qun, adns_answer *answer) {
+ adns_status st, ist;
+ int rrn, nrrs;
+ const char *rrp, *realowner, *typename;
+ char *datastr;
+
+ st= answer->status;
+ nrrs= answer->nrrs;
+ if (ov_format == fmt_asynch) {
+ check_status(st);
+ if (printf("%s %d ", qun->id, nrrs) == EOF) outerr();
+ print_status(st,qun,answer);
+ } else {
+ if (qun->pqfr.show_cname && answer->cname) {
+ print_owner_ttl(qun,answer);
+ if (qun->pqfr.show_type) print_withspace("CNAME");
+ if (printf("%s\n", answer->cname) == EOF) outerr();
+ }
+ if (st) {
+ check_status(st);
+ print_dnsfail(st,qun,answer);
+ }
+ }
+ if (qun->pqfr.show_owner) {
+ realowner= answer->cname ? answer->cname : answer->owner;
+ assert(realowner);
+ } else {
+ realowner= 0;
+ }
+ if (nrrs) {
+ for (rrn=0, rrp = answer->rrs.untyped;
+ rrn < nrrs;
+ rrn++, rrp += answer->rrsz) {
+ if (realowner) print_withspace(realowner);
+ print_ttl(qun,answer);
+ ist= adns_rr_info(answer->type, &typename, 0, 0, rrp, &datastr);
+ if (ist == adns_s_nomemory) sysfail("adns_rr_info failed",ENOMEM);
+ assert(!ist);
+ if (qun->pqfr.show_type) print_withspace(typename);
+ if (printf("%s\n",datastr) == EOF) outerr();
+ free(datastr);
+ }
+ }
+ if (fflush(stdout)) outerr();
+ free(answer);
+ dequeue_query(qun);
+}
+
+void of_asynch_id(const struct optioninfo *oi, const char *arg) {
+ free(ov_id);
+ ov_id= xstrsave(arg);
+}
+
+void of_cancel_id(const struct optioninfo *oi, const char *arg) {
+ struct query_node *qun;
+
+ for (qun= outstanding.head;
+ qun && strcmp(qun->id,arg);
+ qun= qun->next);
+ if (!qun) return;
+ adns_cancel(qun->qu);
+ dequeue_query(qun);
+}
diff --git a/adns-0.6/client/adnshost.h b/adns-0.6/client/adnshost.h
new file mode 100644
index 0000000..8b459b3
--- /dev/null
+++ b/adns-0.6/client/adnshost.h
@@ -0,0 +1,118 @@
+/*
+ * adnshost.h
+ * - useful general-purpose resolver client program, header file
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef ADNSHOST_H_INCLUDED
+#define ADNSHOST_H_INCLUDED
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "config.h"
+#include "adns.h"
+#include "dlist.h"
+
+/* declarations related to option processing */
+
+struct optioninfo;
+typedef void optfunc(const struct optioninfo *oi, const char *arg);
+
+struct optioninfo {
+ enum oi_type {
+ ot_end, ot_desconly,
+ ot_flag, ot_value, ot_func, ot_funcarg
+ } type;
+ const char *desc;
+ const char *sopt, *lopt;
+ int *storep, value;
+ optfunc *func;
+ const char *argdesc;
+};
+
+enum ttlmode { tm_none, tm_rel, tm_abs };
+enum outputformat { fmt_default, fmt_simple, fmt_inline, fmt_asynch };
+
+struct perqueryflags_remember {
+ int show_owner, show_type, show_cname;
+ int ttl;
+};
+
+extern int ov_env, ov_pipe, ov_asynch;
+extern int ov_verbose;
+extern adns_rrtype ov_type;
+extern int ov_search, ov_qc_query, ov_qc_anshost, ov_qc_cname;
+extern int ov_tcp, ov_cname, ov_format;
+extern char *ov_id;
+extern struct perqueryflags_remember ov_pqfr;
+
+extern optfunc of_help, of_type, of_ptr, of_asynch_id, of_cancel_id;
+
+const struct optioninfo *opt_findl(const char *opt);
+const struct optioninfo *opt_finds(const char **optp);
+void opt_do(const struct optioninfo *oip, const char *arg, int invert);
+
+/* declarations related to query processing */
+
+struct query_node {
+ struct query_node *next, *back;
+ struct perqueryflags_remember pqfr;
+ char *id;
+ adns_query qu;
+};
+
+extern adns_state ads;
+extern struct outstanding_list { struct query_node *head, *tail; } outstanding;
+
+void ensure_adns_init(void);
+void query_do(const char *domain);
+void query_done(struct query_node *qun, adns_answer *answer);
+
+void of_asynch_id(const struct optioninfo *oi, const char *arg);
+void of_cancel_id(const struct optioninfo *oi, const char *arg);
+
+/* declarations related to main program and useful utility functions */
+
+void sysfail(const char *what, int errnoval) NONRETURNING;
+void usageerr(const char *what, ...) NONRETURNPRINTFFORMAT(1,2);
+void outerr(void) NONRETURNING;
+
+void *xmalloc(size_t sz);
+char *xstrsave(const char *str);
+
+extern int rcode;
+
+#endif
diff --git a/adns-0.6/client/adnslogres.c b/adns-0.6/client/adnslogres.c
new file mode 100644
index 0000000..c732823
--- /dev/null
+++ b/adns-0.6/client/adnslogres.c
@@ -0,0 +1,239 @@
+/*
+ * adnslogres.c
+ * - a replacement for the Apache logresolve program using adns
+ */
+/*
+ * This file is
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ * Copyright (C) 1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * This version was originally supplied by Tony Finch, but has been
+ * modified by Ian Jackson as it was incorporated into adns.
+ */
+
+static const char * const cvsid =
+ "$Id: adnslogres.c,v 1.1.1.1 2000-02-16 17:32:28 sdyoung Exp $";
+
+#include <sys/types.h>
+#include <sys/time.h>
+
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+
+#include "adns.h"
+
+/* maximum number of concurrent DNS queries */
+#define MAXPENDING 1000
+
+/* maximum length of a line */
+#define MAXLINE 1024
+
+/* option flags */
+#define OPT_DEBUG 1
+#define OPT_POLL 2
+
+static const char *progname;
+
+#define msg(fmt, args...) fprintf(stderr, "%s: " fmt "\n", progname, ##args)
+
+static void aargh(const char *cause) {
+ const char *why = strerror(errno);
+ if (!why) why = "Unknown error";
+ msg("%s: %s (%d)", cause, why, errno);
+ exit(1);
+}
+
+/*
+ * Parse the IP address and convert to a reverse domain name.
+ */
+static char *ipaddr2domain(char *start, char **addr, char **rest) {
+ static char buf[30]; /* "123.123.123.123.in-addr.arpa.\0" */
+ char *ptrs[5];
+ int i;
+
+ ptrs[0]= start;
+retry:
+ while (!isdigit(*ptrs[0]))
+ if (!*ptrs[0]++) {
+ strcpy(buf, "invalid.");
+ *addr= *rest= NULL;
+ return buf;
+ }
+ for (i= 1; i < 5; i++) {
+ ptrs[i]= ptrs[i-1];
+ while (isdigit(*ptrs[i]++));
+ if ((i == 4 && !isspace(ptrs[i][-1])) ||
+ (i != 4 && ptrs[i][-1] != '.') ||
+ (ptrs[i]-ptrs[i-1] > 4)) {
+ ptrs[0]= ptrs[i]-1;
+ goto retry;
+ }
+ }
+ sprintf(buf, "%.*s.%.*s.%.*s.%.*s.in-addr.arpa.",
+ ptrs[4]-ptrs[3]-1, ptrs[3],
+ ptrs[3]-ptrs[2]-1, ptrs[2],
+ ptrs[2]-ptrs[1]-1, ptrs[1],
+ ptrs[1]-ptrs[0]-1, ptrs[0]);
+ *addr= ptrs[0];
+ *rest= ptrs[4]-1;
+ return buf;
+}
+
+static void printline(FILE *outf, char *start, char *addr, char *rest, char *domain) {
+ if (domain)
+ fprintf(outf, "%.*s%s%s", addr - start, start, domain, rest);
+ else
+ fputs(start, outf);
+ if (ferror(outf)) aargh("write output");
+}
+
+typedef struct logline {
+ struct logline *next;
+ char *start, *addr, *rest;
+ adns_query query;
+} logline;
+
+static logline *readline(FILE *inf, adns_state adns, int opts) {
+ static char buf[MAXLINE];
+ char *str;
+ logline *line;
+
+ if (fgets(buf, MAXLINE, inf)) {
+ str= malloc(sizeof(*line) + strlen(buf) + 1);
+ if (!str) aargh("malloc");
+ line= (logline*)str;
+ line->next= NULL;
+ line->start= str+sizeof(logline);
+ strcpy(line->start, buf);
+ str= ipaddr2domain(line->start, &line->addr, &line->rest);
+ if (opts & OPT_DEBUG)
+ msg("submitting %.*s -> %s", line->rest-line->addr, line->addr, str);
+ if (adns_submit(adns, str, adns_r_ptr,
+ adns_qf_quoteok_cname|adns_qf_cname_loose,
+ NULL, &line->query))
+ aargh("adns_submit");
+ return line;
+ }
+ if (!feof(inf))
+ aargh("fgets");
+ return NULL;
+}
+
+static void proclog(FILE *inf, FILE *outf, int opts) {
+ int eof, err, len;
+ adns_state adns;
+ adns_answer *answer;
+ logline *head, *tail, *line;
+
+ errno= adns_init(&adns, (opts & OPT_DEBUG) ? adns_if_debug : 0, 0);
+ if (errno) aargh("adns_init");
+ head= tail= readline(inf, adns, opts);
+ len= 1; eof= 0;
+ while (head) {
+ if (opts & OPT_DEBUG)
+ msg("%d in queue; checking %.*s", len,
+ head->rest-head->addr, head->addr);
+ if (eof || len > MAXPENDING)
+ if (opts & OPT_POLL)
+ err= adns_wait_poll(adns, &head->query, &answer, NULL);
+ else
+ err= adns_wait(adns, &head->query, &answer, NULL);
+ else
+ err= adns_check(adns, &head->query, &answer, NULL);
+ if (err != EAGAIN) {
+ printline(outf, head->start, head->addr, head->rest,
+ answer->status == adns_s_ok ? *answer->rrs.str : NULL);
+ line= head; head= head->next;
+ free(line); free(answer);
+ len--;
+ }
+ if (!eof) {
+ line= readline(inf, adns, opts);
+ if (!line)
+ eof= 1;
+ else {
+ if (!head)
+ head= line;
+ else
+ tail->next= line;
+ tail= line;
+ len++;
+ }
+ }
+ }
+ adns_finish(adns);
+}
+
+static void usage(void) {
+ fprintf(stderr, "usage: %s [-d] [-p] [logfile]\n", progname);
+ exit(1);
+}
+
+int main(int argc, char *argv[]) {
+ int c, opts;
+ FILE *inf;
+
+ progname= strrchr(*argv, '/');
+ if (progname)
+ progname++;
+ else
+ progname= *argv;
+ opts= 0;
+
+ while ((c= getopt(argc, argv, "dp")) != -1)
+ switch (c) {
+ case 'd':
+ opts|= OPT_DEBUG;
+ break;
+ case 'p':
+ opts|= OPT_POLL;
+ break;
+ default:
+ usage();
+ }
+
+ argc-= optind;
+ argv+= optind;
+
+ inf= NULL;
+ if (argc == 0)
+ inf= stdin;
+ else if (argc == 1)
+ inf= fopen(*argv, "r");
+ else
+ usage();
+
+ if (!inf)
+ aargh("couldn't open input");
+
+ proclog(inf, stdout, opts);
+
+ if (fclose(inf))
+ aargh("fclose input");
+ if (fclose(stdout))
+ aargh("fclose output");
+
+ return 0;
+}
diff --git a/adns-0.6/client/adnsresfilter.c b/adns-0.6/client/adnsresfilter.c
new file mode 100644
index 0000000..f265773
--- /dev/null
+++ b/adns-0.6/client/adnsresfilter.c
@@ -0,0 +1,454 @@
+/*
+ * adnsresfilter.c
+ * - filter which does resolving, not part of the library
+ */
+/*
+ * This file is
+ * Copyright (C) 1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <search.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <sys/fcntl.h>
+
+#include "adns.h"
+#include "config.h"
+#include "dlist.h"
+#include "tvarith.h"
+
+struct outqueuenode {
+ struct outqueuenode *next, *back;
+ void *buffer;
+ char *textp;
+ int textlen;
+ struct timeval printbefore;
+ struct treething *addr;
+};
+
+static int bracket, forever, address;
+static unsigned long timeout=100;
+static adns_rrtype rrt= adns_r_ptr;
+
+static int outblocked, inputeof;
+static struct { struct outqueuenode *head, *tail; } outqueue;
+static int peroutqueuenode, outqueuelen;
+
+static struct sockaddr_in sa;
+static adns_state ads;
+
+static char addrtextbuf[14];
+static int cbyte, inbyte, inbuf;
+static unsigned char bytes[4];
+static struct timeval printbefore;
+
+struct treething {
+ unsigned char bytes[4];
+ adns_query qu;
+ adns_answer *ans;
+};
+
+static struct treething *newthing;
+static void *treeroot;
+
+static int nonblock(int fd, int isnonblock) {
+ int r;
+
+ r= fcntl(fd,F_GETFL);
+ if (r==-1) return -1;
+ r= fcntl(fd,F_SETFL, isnonblock ? r|O_NONBLOCK : r&~O_NONBLOCK);
+ if (r==-1) return -1;
+ return 0;
+}
+
+static void quit(int exitstatus) NONRETURNING;
+static void quit(int exitstatus) {
+ nonblock(0,0);
+ nonblock(1,0);
+ exit(exitstatus);
+}
+
+static void sysfail(const char *what) NONRETURNING;
+static void sysfail(const char *what) {
+ fprintf(stderr,"adnsresfilter: system call failed: %s: %s\n",what,strerror(errno));
+ quit(2);
+}
+
+static void *xmalloc(size_t sz) {
+ void *r;
+ r= malloc(sz); if (r) return r;
+ sysfail("malloc");
+}
+
+static void outputerr(void) NONRETURNING;
+static void outputerr(void) { sysfail("write to stdout"); }
+
+static void usage(void) {
+ if (printf("usage: adnsresfilter [<options ...>]\n"
+ " adnsresfilter -h|--help\n"
+ "options: -t<milliseconds>|--timeout <milliseconds>\n"
+ " -w|--wait (always wait for queries to time out or fail)\n"
+ " -b|--brackets (require [...] around IP addresses)\n"
+ " -a|--address (always include [address] in output)\n"
+ " -u|--unchecked (do not forward map for checking)\n"
+ "Timeout is the maximum amount to delay any particular bit of output for.\n"
+ "Lookups will go on in the background. Default timeout = 100 (ms).\n")
+ == EOF) outputerr();
+}
+
+static void usageerr(const char *why) NONRETURNING;
+static void usageerr(const char *why) {
+ fprintf(stderr,"adnsresfilter: bad usage: %s\n",why);
+ usage();
+ quit(1);
+}
+
+static void adnsfail(const char *what, int e) NONRETURNING;
+static void adnsfail(const char *what, int e) {
+ fprintf(stderr,"adnsresfilter: adns call failed: %s: %s\n",what,strerror(e));
+ quit(2);
+}
+
+static void settimeout(const char *arg) {
+ char *ep;
+ timeout= strtoul(arg,&ep,0);
+ if (*ep) usageerr("invalid timeout");
+}
+
+static void parseargs(const char *const *argv) {
+ const char *arg;
+ int c;
+
+ while ((arg= *++argv)) {
+ if (arg[0] != '-') usageerr("no non-option arguments are allowed");
+ if (arg[1] == '-') {
+ if (!strcmp(arg,"--brackets")) {
+ bracket= 1;
+ } else if (!strcmp(arg,"--unchecked")) {
+ rrt= adns_r_ptr_raw;
+ } else if (!strcmp(arg,"--wait")) {
+ forever= 1;
+ } else if (!strcmp(arg,"--address")) {
+ address= 1;
+ } else if (!strcmp(arg,"--help")) {
+ usage(); quit(0);
+ } else if (!strcmp(arg,"--timeout")) {
+ if (!(arg= *++argv)) usageerr("--timeout needs a value");
+ settimeout(arg);
+ forever= 0;
+ } else {
+ usageerr("unknown long option");
+ }
+ } else {
+ while ((c= *++arg)) {
+ switch (c) {
+ case 'b':
+ bracket= 1;
+ break;
+ case 'u':
+ rrt= adns_r_ptr_raw;
+ break;
+ case 'w':
+ forever= 1;
+ break;
+ case 'a':
+ address= 1;
+ break;
+ case 'h':
+ usage();
+ quit(0);
+ case 't':
+ if (*++arg) settimeout(arg);
+ else if ((arg= *++argv)) settimeout(arg);
+ else usageerr("-t needs a value");
+ forever= 0;
+ arg= "\0";
+ break;
+ default:
+ usageerr("unknown short option");
+ }
+ }
+ }
+ }
+}
+
+static void queueoutchar(int c) {
+ struct outqueuenode *entry;
+
+ entry= outqueue.tail;
+ if (!entry || entry->addr || entry->textlen >= peroutqueuenode) {
+ peroutqueuenode= !peroutqueuenode || !entry || entry->addr ? 128 :
+ peroutqueuenode >= 1024 ? 4096 : peroutqueuenode<<2;
+ entry= xmalloc(sizeof(*entry));
+ entry->buffer= xmalloc(peroutqueuenode);
+ entry->textp= entry->buffer;
+ entry->textlen= 0;
+ entry->addr= 0;
+ LIST_LINK_TAIL(outqueue,entry);
+ outqueuelen++;
+ }
+ entry->textp[entry->textlen++]= c;
+}
+
+static void queueoutstr(const char *str, int len) {
+ while (len-- > 0) queueoutchar(*str++);
+}
+
+static void writestdout(struct outqueuenode *entry) {
+ int r;
+
+ while (entry->textlen) {
+ r= write(1, entry->textp, entry->textlen);
+ if (r < 0) {
+ if (errno == EINTR) continue;
+ if (errno == EAGAIN) { outblocked= 1; break; }
+ sysfail("write stdout");
+ }
+ assert(r <= entry->textlen);
+ entry->textp += r;
+ entry->textlen -= r;
+ }
+ if (!entry->textlen) {
+ LIST_UNLINK(outqueue,entry);
+ free(entry->buffer);
+ free(entry);
+ outqueuelen--;
+ }
+}
+
+static void replacetextwithname(struct outqueuenode *entry) {
+ char *name, *newbuf;
+ int namelen, newlen;
+
+ name= entry->addr->ans->rrs.str[0];
+ namelen= strlen(name);
+ if (!address) {
+ free(entry->buffer);
+ entry->buffer= 0;
+ entry->textp= name;
+ entry->textlen= namelen;
+ } else {
+ newlen= entry->textlen + namelen + (bracket ? 0 : 2);
+ newbuf= xmalloc(newlen + 1);
+ sprintf(newbuf, bracket ? "%s%.*s" : "%s[%.*s]", name, entry->textlen, entry->textp);
+ free(entry->buffer);
+ entry->buffer= entry->textp= newbuf;
+ entry->textlen= newlen;
+ }
+}
+
+static void checkadnsqueries(void) {
+ adns_query qu;
+ adns_answer *ans;
+ void *context;
+ struct treething *foundthing;
+ int r;
+
+ for (;;) {
+ qu= 0; context= 0; ans= 0;
+ r= adns_check(ads,&qu,&ans,&context);
+ if (r == ESRCH || r == EAGAIN) break;
+ assert(!r);
+ foundthing= context;
+ foundthing->ans= ans;
+ foundthing->qu= 0;
+ }
+}
+
+static void restartbuf(void) {
+ if (inbuf>0) queueoutstr(addrtextbuf,inbuf);
+ inbuf= 0;
+}
+
+static int comparer(const void *a, const void *b) {
+ return memcmp(a,b,4);
+}
+
+static void procaddr(void) {
+ struct treething *foundthing;
+ void **searchfound;
+ struct outqueuenode *entry;
+ int r;
+
+ if (!newthing) {
+ newthing= xmalloc(sizeof(struct treething));
+ newthing->qu= 0;
+ newthing->ans= 0;
+ }
+
+ memcpy(newthing->bytes,bytes,4);
+ searchfound= tsearch(newthing,&treeroot,comparer);
+ if (!searchfound) sysfail("tsearch");
+ foundthing= *searchfound;
+
+ if (foundthing == newthing) {
+ newthing= 0;
+ memcpy(&sa.sin_addr,bytes,4);
+ r= adns_submit_reverse(ads, (const struct sockaddr*)&sa,
+ rrt,0,foundthing,&foundthing->qu);
+ if (r) adnsfail("submit",r);
+ }
+ entry= xmalloc(sizeof(*entry));
+ entry->buffer= xmalloc(inbuf);
+ entry->textp= entry->buffer;
+ memcpy(entry->textp,addrtextbuf,inbuf);
+ entry->textlen= inbuf;
+ entry->addr= foundthing;
+ entry->printbefore= printbefore;
+ LIST_LINK_TAIL(outqueue,entry);
+ outqueuelen++;
+ inbuf= 0;
+ cbyte= -1;
+}
+
+static void startaddr(void) {
+ bytes[cbyte=0]= 0;
+ inbyte= 0;
+}
+
+static void readstdin(void) {
+ char readbuf[512], *p;
+ int r, c, nbyte;
+
+ while ((r= read(0,readbuf,sizeof(readbuf))) <= 0) {
+ if (r == 0) { inputeof= 1; return; }
+ if (r == EAGAIN) return;
+ if (r != EINTR) sysfail("read stdin");
+ }
+ for (p=readbuf; r>0; r--,p++) {
+ c= *p;
+ if (cbyte==-1 && bracket && c=='[') {
+ addrtextbuf[inbuf++]= c;
+ startaddr();
+ } else if (cbyte==-1 && !bracket && !isalnum(c)) {
+ queueoutchar(c);
+ startaddr();
+ } else if (cbyte>=0 && inbyte<3 && c>='0' && c<='9' &&
+ (nbyte= bytes[cbyte]*10 + (c-'0')) <= 255) {
+ bytes[cbyte]= nbyte;
+ addrtextbuf[inbuf++]= c;
+ inbyte++;
+ } else if (cbyte>=0 && cbyte<3 && inbyte>0 && c=='.') {
+ bytes[++cbyte]= 0;
+ addrtextbuf[inbuf++]= c;
+ inbyte= 0;
+ } else if (cbyte==3 && inbyte>0 && bracket && c==']') {
+ addrtextbuf[inbuf++]= c;
+ procaddr();
+ } else if (cbyte==3 && inbyte>0 && !bracket && !isalnum(c)) {
+ procaddr();
+ queueoutchar(c);
+ startaddr();
+ } else {
+ restartbuf();
+ queueoutchar(c);
+ cbyte= -1;
+ if (!bracket && !isalnum(c)) startaddr();
+ }
+ }
+ if (cbyte==3 && inbyte>0 && !bracket) procaddr();
+}
+
+static void startup(void) {
+ int r;
+
+ if (nonblock(0,1)) sysfail("set stdin to nonblocking mode");
+ if (nonblock(1,1)) sysfail("set stdout to nonblocking mode");
+ memset(&sa,0,sizeof(sa));
+ sa.sin_family= AF_INET;
+ r= adns_init(&ads,0,0); if (r) adnsfail("init",r);
+ cbyte= -1;
+ inbyte= -1;
+ inbuf= 0;
+ if (!bracket) startaddr();
+}
+
+int main(int argc, const char *const *argv) {
+ int r, maxfd;
+ fd_set readfds, writefds, exceptfds;
+ struct outqueuenode *entry;
+ struct timeval *tv, tvbuf, now;
+
+ parseargs(argv);
+ startup();
+
+ while (!inputeof || outqueue.head) {
+ maxfd= 2;
+ tv= 0;
+ FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds);
+ if ((entry= outqueue.head) && !outblocked) {
+ if (!entry->addr) {
+ writestdout(entry);
+ continue;
+ }
+ if (entry->addr->ans) {
+ if (entry->addr->ans->nrrs)
+ replacetextwithname(entry);
+ entry->addr= 0;
+ continue;
+ }
+ r= gettimeofday(&now,0); if (r) sysfail("gettimeofday");
+ if (forever) {
+ tv= 0;
+ } else if (!timercmp(&now,&entry->printbefore,<)) {
+ entry->addr= 0;
+ continue;
+ } else {
+ tvbuf.tv_sec= entry->printbefore.tv_sec - now.tv_sec - 1;
+ tvbuf.tv_usec= entry->printbefore.tv_usec - now.tv_usec + 1000000;
+ tvbuf.tv_sec += tvbuf.tv_usec / 1000000;
+ tvbuf.tv_usec %= 1000000;
+ tv= &tvbuf;
+ }
+ adns_beforeselect(ads,&maxfd,&readfds,&writefds,&exceptfds,
+ &tv,&tvbuf,&now);
+ }
+ if (outblocked) FD_SET(1,&writefds);
+ if (!inputeof && outqueuelen<1024) FD_SET(0,&readfds);
+
+ r= select(maxfd,&readfds,&writefds,&exceptfds,tv);
+ if (r < 0) { if (r == EINTR) continue; else sysfail("select"); }
+
+ r= gettimeofday(&now,0); if (r) sysfail("gettimeofday");
+ adns_afterselect(ads,maxfd,&readfds,&writefds,&exceptfds,&now);
+ checkadnsqueries();
+
+ if (FD_ISSET(0,&readfds)) {
+ if (!forever) {
+ printbefore= now;
+ timevaladd(&printbefore,timeout);
+ }
+ readstdin();
+ } else if (FD_ISSET(1,&writefds)) {
+ outblocked= 0;
+ }
+ }
+ if (nonblock(0,0)) sysfail("un-nonblock stdin");
+ if (nonblock(1,0)) sysfail("un-nonblock stdout");
+ if (ferror(stdin) || fclose(stdin)) sysfail("read stdin");
+ if (fclose(stdout)) sysfail("close stdout");
+ exit(0);
+}
diff --git a/adns-0.6/client/adnstest.c b/adns-0.6/client/adnstest.c
new file mode 100644
index 0000000..2460dbf
--- /dev/null
+++ b/adns-0.6/client/adnstest.c
@@ -0,0 +1,337 @@
+/*
+ * adnstest.c
+ * - simple test program, not part of the library
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <stdio.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include "adns.h"
+
+#include "config.h"
+
+#ifndef OUTPUTSTREAM
+# define OUTPUTSTREAM stdout
+#endif
+
+struct myctx {
+ adns_query qu;
+ int doneyet, found;
+ const char *fdom;
+};
+
+static struct myctx *mcs;
+static adns_state ads;
+static adns_rrtype *types_a;
+
+static void quitnow(int rc) NONRETURNING;
+static void quitnow(int rc) {
+ free(mcs);
+ free(types_a);
+ if (ads) adns_finish(ads);
+
+ exit(rc);
+}
+
+#ifndef HAVE_POLL
+#undef poll
+int poll(struct pollfd *ufds, int nfds, int timeout) {
+ fputs("poll(2) not supported on this system\n",stderr);
+ quitnow(5);
+}
+#define adns_beforepoll(a,b,c,d,e) 0
+#define adns_afterpoll(a,b,c,d) 0
+#endif
+
+static void failure_status(const char *what, adns_status st) NONRETURNING;
+static void failure_status(const char *what, adns_status st) {
+ fprintf(stderr,"adns failure: %s: %s\n",what,adns_strerror(st));
+ quitnow(2);
+}
+
+static void failure_errno(const char *what, int errnoval) NONRETURNING;
+static void failure_errno(const char *what, int errnoval) {
+ fprintf(stderr,"adns failure: %s: errno=%d\n",what,errnoval);
+ quitnow(2);
+}
+
+static void usageerr(const char *why) NONRETURNING;
+static void usageerr(const char *why) {
+ fprintf(stderr,
+ "bad usage: %s\n"
+ "usage: adnstest [-<initflagsnum>[,<owninitflags>]] [/<initstring>]\n"
+ " [ :<typenum>,... ]\n"
+ " [ [<queryflagsnum>[,<ownqueryflags>]/]<domain> ... ]\n"
+ "initflags: p use poll(2) instead of select(2)\n"
+ " s use adns_wait with specified query, instead of 0\n"
+ "queryflags: a print status abbrevs instead of strings\n"
+ "exit status: 0 ok (though some queries may have failed)\n"
+ " 1 used by test harness to indicate test failed\n"
+ " 2 unable to submit or init or some such\n"
+ " 3 unexpected failure\n"
+ " 4 usage error\n"
+ " 5 operation not supported on this system\n",
+ why);
+ quitnow(4);
+}
+
+static const adns_rrtype defaulttypes[]= {
+ adns_r_a,
+ adns_r_ns_raw,
+ adns_r_cname,
+ adns_r_soa_raw,
+ adns_r_ptr_raw,
+ adns_r_hinfo,
+ adns_r_mx_raw,
+ adns_r_txt,
+ adns_r_rp_raw,
+
+ adns_r_addr,
+ adns_r_ns,
+ adns_r_ptr,
+ adns_r_mx,
+
+ adns_r_soa,
+ adns_r_rp,
+
+ adns_r_none
+};
+
+static void dumptype(adns_status ri, const char *rrtn, const char *fmtn) {
+ fprintf(stdout, "%s(%s)%s%s",
+ ri ? "?" : rrtn, ri ? "?" : fmtn ? fmtn : "-",
+ ri ? " " : "", ri ? adns_strerror(ri) : "");
+}
+
+static void fdom_split(const char *fdom, const char **dom_r, int *qf_r,
+ char *ownflags, int ownflags_l) {
+ int qf;
+ char *ep;
+
+ qf= strtoul(fdom,&ep,0);
+ if (*ep == ',' && strchr(ep,'/')) {
+ ep++;
+ while (*ep != '/') {
+ if (--ownflags_l <= 0) { fputs("too many flags\n",stderr); quitnow(3); }
+ *ownflags++= *ep++;
+ }
+ }
+ if (*ep != '/') { *dom_r= fdom; *qf_r= 0; }
+ else { *dom_r= ep+1; *qf_r= qf; }
+ *ownflags= 0;
+}
+
+static int consistsof(const char *string, const char *accept) {
+ return strspn(string,accept) == strlen(string);
+}
+
+int main(int argc, char *const *argv) {
+ adns_query qu;
+ struct myctx *mc, *mcw;
+ void *mcr;
+ adns_answer *ans;
+ const char *initstring, *rrtn, *fmtn;
+ const char *const *fdomlist, *domain;
+ char *show, *cp;
+ int len, i, qc, qi, tc, ti, ch, qflags, initflagsnum;
+ adns_status ri;
+ int r;
+ const adns_rrtype *types;
+ struct timeval now;
+ char ownflags[10];
+ char *ep;
+ const char *initflags, *owninitflags;
+
+ if (argv[0] && argv[1] && argv[1][0] == '-') {
+ initflags= argv[1]+1;
+ argv++;
+ } else {
+ initflags= "";
+ }
+ if (argv[0] && argv[1] && argv[1][0] == '/') {
+ initstring= argv[1]+1;
+ argv++;
+ } else {
+ initstring= 0;
+ }
+
+ initflagsnum= strtoul(initflags,&ep,0);
+ if (*ep == ',') {
+ owninitflags= ep+1;
+ if (!consistsof(owninitflags,"ps")) usageerr("unknown owninitflag");
+ } else if (!*ep) {
+ owninitflags= "";
+ } else {
+ usageerr("bad <initflagsnum>[,<owninitflags>]");
+ }
+
+ if (argv[0] && argv[1] && argv[1][0] == ':') {
+ for (cp= argv[1]+1, tc=1; (ch= *cp); cp++)
+ if (ch==',') tc++;
+ types_a= malloc(sizeof(*types_a)*(tc+1));
+ if (!types_a) { perror("malloc types"); quitnow(3); }
+ for (cp= argv[1]+1, ti=0; ti<tc; ti++) {
+ types_a[ti]= strtoul(cp,&cp,10);
+ if ((ch= *cp)) {
+ if (ch != ',') usageerr("unexpected char (not comma) in or between types");
+ cp++;
+ }
+ }
+ types_a[ti]= adns_r_none;
+ types= types_a;
+ argv++;
+ } else {
+ types_a= 0;
+ types= defaulttypes;
+ }
+
+ if (!(argv[0] && argv[1])) usageerr("no query domains supplied");
+ fdomlist= (const char *const*)argv+1;
+
+ for (qc=0; fdomlist[qc]; qc++);
+ for (tc=0; types[tc] != adns_r_none; tc++);
+ mcs= malloc(tc ? sizeof(*mcs)*qc*tc : 1);
+ if (!mcs) { perror("malloc mcs"); quitnow(3); }
+
+ if (initstring) {
+ r= adns_init_strcfg(&ads,
+ (adns_if_debug|adns_if_noautosys|adns_if_checkc_freq)
+ ^initflagsnum,
+ stdout,initstring);
+ } else {
+ r= adns_init(&ads,
+ (adns_if_debug|adns_if_noautosys)^initflagsnum,
+ 0);
+ }
+ if (r) failure_errno("init",r);
+
+ for (qi=0; qi<qc; qi++) {
+ fdom_split(fdomlist[qi],&domain,&qflags,ownflags,sizeof(ownflags));
+ if (!consistsof(ownflags,"a")) usageerr("unknown ownqueryflag");
+ for (ti=0; ti<tc; ti++) {
+ mc= &mcs[qi*tc+ti];
+ mc->doneyet= 0;
+ mc->fdom= fdomlist[qi];
+
+ fprintf(stdout,"%s flags %d type %d",domain,qflags,types[ti]);
+ r= adns_submit(ads,domain,types[ti],qflags,mc,&mc->qu);
+ if (r == ENOSYS) {
+ fprintf(stdout," not implemented\n");
+ mc->qu= 0;
+ mc->doneyet= 1;
+ } else if (r) {
+ failure_errno("submit",r);
+ } else {
+ ri= adns_rr_info(types[ti], &rrtn,&fmtn,0, 0,0);
+ putc(' ',stdout);
+ dumptype(ri,rrtn,fmtn);
+ fprintf(stdout," submitted\n");
+ }
+ }
+ }
+
+ for (;;) {
+ for (qi=0; qi<qc; qi++) {
+ for (ti=0; ti<tc; ti++) {
+ mc= &mcs[qi*tc+ti];
+ mc->found= 0;
+ }
+ }
+ for (adns_forallqueries_begin(ads);
+ (qu= adns_forallqueries_next(ads,&mcr));
+ ) {
+ mc= mcr;
+ assert(qu == mc->qu);
+ assert(!mc->doneyet);
+ mc->found= 1;
+ }
+ mcw= 0;
+ for (qi=0; qi<qc; qi++) {
+ for (ti=0; ti<tc; ti++) {
+ mc= &mcs[qi*tc+ti];
+ if (mc->doneyet) continue;
+ assert(mc->found);
+ if (!mcw) mcw= mc;
+ }
+ }
+ if (!mcw) break;
+
+ if (strchr(owninitflags,'s')) {
+ qu= mcw->qu;
+ mc= mcw;
+ } else {
+ qu= 0;
+ mc= 0;
+ }
+
+ if (strchr(owninitflags,'p')) {
+ r= adns_wait_poll(ads,&qu,&ans,&mcr);
+ } else {
+ r= adns_wait(ads,&qu,&ans,&mcr);
+ }
+ if (r) failure_errno("wait/check",r);
+
+ if (mc) assert(mcr==mc);
+ else mc= mcr;
+ assert(qu==mc->qu);
+ assert(!mc->doneyet);
+
+ fdom_split(mc->fdom,&domain,&qflags,ownflags,sizeof(ownflags));
+
+ if (gettimeofday(&now,0)) { perror("gettimeofday"); quitnow(3); }
+
+ ri= adns_rr_info(ans->type, &rrtn,&fmtn,&len, 0,0);
+ fprintf(stdout, "%s flags %d type ",domain,qflags);
+ dumptype(ri,rrtn,fmtn);
+ fprintf(stdout, "%s%s: %s; nrrs=%d; cname=%s; owner=%s; ttl=%ld\n",
+ ownflags[0] ? " ownflags=" : "", ownflags,
+ strchr(ownflags,'a')
+ ? adns_errabbrev(ans->status)
+ : adns_strerror(ans->status),
+ ans->nrrs,
+ ans->cname ? ans->cname : "$",
+ ans->owner ? ans->owner : "$",
+ (long)ans->expires - (long)now.tv_sec);
+ if (ans->nrrs) {
+ assert(!ri);
+ for (i=0; i<ans->nrrs; i++) {
+ ri= adns_rr_info(ans->type, 0,0,0, ans->rrs.bytes + i*len, &show);
+ if (ri) failure_status("info",ri);
+ fprintf(stdout," %s\n",show);
+ free(show);
+ }
+ }
+ free(ans);
+
+ mc->doneyet= 1;
+ }
+
+ quitnow(0);
+}
diff --git a/adns-0.6/client/fanftest.c b/adns-0.6/client/fanftest.c
new file mode 100644
index 0000000..2051f28
--- /dev/null
+++ b/adns-0.6/client/fanftest.c
@@ -0,0 +1,85 @@
+/*
+ * fanftest.c
+ * - a small test program from Tony Finch
+ */
+/*
+ * This file is
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ * Copyright (C) 1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * This version was originally supplied by Tony Finch, but has been
+ * modified by Ian Jackson as it was incorporated into adns.
+ */
+
+static const char * const cvsid =
+ "$Id: fanftest.c,v 1.1.1.1 2000-02-16 17:32:29 sdyoung Exp $";
+
+#include <sys/types.h>
+#include <sys/time.h>
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+
+#include "adns.h"
+
+static const char *progname;
+
+static void aargh(const char *msg) {
+ fprintf(stderr, "%s: %s: %s (%d)\n", progname, msg,
+ strerror(errno) ? strerror(errno) : "Unknown error", errno);
+ exit(1);
+}
+
+int main(int argc, char *argv[]) {
+ adns_state adns;
+ adns_query query;
+ adns_answer *answer;
+
+ progname= strrchr(*argv, '/');
+ if (progname)
+ progname++;
+ else
+ progname= *argv;
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: %s <domain>\n", progname);
+ exit(1);
+ }
+
+ errno= adns_init(&adns, adns_if_debug, 0);
+ if (errno) aargh("adns_init");
+
+ errno= adns_submit(adns, argv[1], adns_r_ptr,
+ adns_qf_quoteok_cname|adns_qf_cname_loose,
+ NULL, &query);
+ if (errno) aargh("adns_submit");
+
+ errno= adns_wait(adns, &query, &answer, NULL);
+ if (errno) aargh("adns_init");
+
+ printf("%s\n", answer->status == adns_s_ok ? *answer->rrs.str : "dunno");
+
+ adns_finish(adns);
+
+ return 0;
+}
diff --git a/adns-0.6/client/x.gdb b/adns-0.6/client/x.gdb
new file mode 100644
index 0000000..2ee7597
--- /dev/null
+++ b/adns-0.6/client/x.gdb
@@ -0,0 +1,2 @@
+file adnsresfilter_s
+set args <testinput -t2000
diff --git a/adns-0.6/configure b/adns-0.6/configure
new file mode 100755
index 0000000..64ce5f2
--- /dev/null
+++ b/adns-0.6/configure
@@ -0,0 +1,1826 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=src/adns.h
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:526: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:555: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ ac_prog_rejected=no
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:603: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 613 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:637: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:642: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:666: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ elif test $ac_cv_prog_cc_g = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-O2"
+ fi
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:694: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 709 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 726 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:757: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+for ac_func in poll
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:787: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 792 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+ echo $ac_n "checking for socket""... $ac_c" 1>&6
+echo "configure:841: checking for socket" >&5
+if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 846 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char socket(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char socket();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_socket) || defined (__stub___socket)
+choke me
+#else
+socket();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_socket=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_socket=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+
+ echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
+echo "configure:888: checking for socket in -lsocket" >&5
+ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsocket $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 896 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char socket();
+
+int main() {
+socket()
+; return 0; }
+EOF
+if { (eval echo configure:907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lsocket $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+
+ { echo "configure: error: cannot find library function socket" 1>&2; exit 1; }
+
+fi
+
+
+fi
+
+
+
+ echo $ac_n "checking for inet_ntoa""... $ac_c" 1>&6
+echo "configure:943: checking for inet_ntoa" >&5
+if eval "test \"`echo '$''{'ac_cv_func_inet_ntoa'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 948 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char inet_ntoa(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char inet_ntoa();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_inet_ntoa) || defined (__stub___inet_ntoa)
+choke me
+#else
+inet_ntoa();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_inet_ntoa=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_inet_ntoa=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'inet_ntoa`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+
+ echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6
+echo "configure:990: checking for inet_ntoa in -lnsl" >&5
+ac_lib_var=`echo nsl'_'inet_ntoa | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lnsl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 998 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char inet_ntoa();
+
+int main() {
+inet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:1009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lnsl $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+
+ { echo "configure: error: cannot find library function inet_ntoa" 1>&2; exit 1; }
+
+fi
+
+
+fi
+
+
+
+PROGS_IF_TSEARCH=adnsresfilter
+
+echo $ac_n "checking for tsearch""... $ac_c" 1>&6
+echo "configure:1047: checking for tsearch" >&5
+if eval "test \"`echo '$''{'ac_cv_func_tsearch'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1052 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char tsearch(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char tsearch();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_tsearch) || defined (__stub___tsearch)
+choke me
+#else
+tsearch();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_tsearch=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_tsearch=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'tsearch`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ PROGS_HAVE_TSEARCH=$PROGS_IF_TSEARCH
+
+else
+ echo "$ac_t""no" 1>&6
+
+ PROGS_HAVE_TSEARCH='';
+ echo "configure: warning: tsearch missing - not building client program(s) $PROGS_IF_TSEARCH" 1>&2
+
+fi
+
+
+echo $ac_n "checking for INADDR_LOOPBACK""... $ac_c" 1>&6
+echo "configure:1102: checking for INADDR_LOOPBACK" >&5
+if eval "test \"`echo '$''{'adns_cv_decl_inaddrloopback'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 1108 "configure"
+#include "confdefs.h"
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+int main() {
+
+ INADDR_LOOPBACK;
+
+; return 0; }
+EOF
+if { (eval echo configure:1121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ adns_cv_decl_inaddrloopback=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ adns_cv_decl_inaddrloopback=no
+fi
+rm -f conftest*
+fi
+
+if test "$adns_cv_decl_inaddrloopback" = yes; then
+ echo "$ac_t""found" 1>&6
+else
+ echo "$ac_t""not in standard headers, urgh..." 1>&6
+ ac_safe=`echo "rpc/types.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for rpc/types.h""... $ac_c" 1>&6
+echo "configure:1139: checking for rpc/types.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1144 "configure"
+#include "confdefs.h"
+#include <rpc/types.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ cat >> confdefs.h <<\EOF
+#define HAVEUSE_RPCTYPES_H 1
+EOF
+
+
+else
+ echo "$ac_t""no" 1>&6
+
+ { echo "configure: error: cannot find INADDR_LOOPBACK or rpc/types.h" 1>&2; exit 1; }
+
+fi
+
+fi
+
+
+ echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
+echo "configure:1182: checking for inet_aton" >&5
+if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1187 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char inet_aton(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char inet_aton();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_inet_aton) || defined (__stub___inet_aton)
+choke me
+#else
+inet_aton();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_inet_aton=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_inet_aton=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'inet_aton`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+
+ echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
+echo "configure:1229: checking for inet_aton in -lresolv" >&5
+ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lresolv $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1237 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char inet_aton();
+
+int main() {
+inet_aton()
+; return 0; }
+EOF
+if { (eval echo configure:1248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ LIBS="-lresolv $LIBS";
+ echo "configure: warning: inet_aton is in libresolv, urgh. Must use -lresolv." 1>&2
+
+else
+ echo "$ac_t""no" 1>&6
+
+ { echo "configure: error: cannot find library function inet_aton" 1>&2; exit 1; }
+
+fi
+
+
+fi
+
+
+
+
+
+ echo $ac_n "checking __attribute__((,,))""... $ac_c" 1>&6
+echo "configure:1282: checking __attribute__((,,))" >&5
+ if eval "test \"`echo '$''{'adns_cv_c_attribute_supported'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 1288 "configure"
+#include "confdefs.h"
+
+int main() {
+extern int testfunction(int x) __attribute__((,,))
+; return 0; }
+EOF
+if { (eval echo configure:1295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ adns_cv_c_attribute_supported=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ adns_cv_c_attribute_supported=no
+fi
+rm -f conftest*
+
+fi
+
+ if test "x$adns_cv_c_attribute_supported" = xyes; then
+ true
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_GNUC25_ATTRIB 1
+EOF
+
+
+ echo $ac_n "checking __attribute__((noreturn))""... $ac_c" 1>&6
+echo "configure:1317: checking __attribute__((noreturn))" >&5
+ if eval "test \"`echo '$''{'adns_cv_c_attribute_noreturn'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 1323 "configure"
+#include "confdefs.h"
+
+int main() {
+extern int testfunction(int x) __attribute__((noreturn))
+; return 0; }
+EOF
+if { (eval echo configure:1330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ adns_cv_c_attribute_noreturn=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ adns_cv_c_attribute_noreturn=no
+fi
+rm -f conftest*
+
+fi
+
+ if test "x$adns_cv_c_attribute_noreturn" = xyes; then
+ true
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_GNUC25_NORETURN 1
+EOF
+
+ else
+ true
+ echo "$ac_t""no" 1>&6
+ fi
+
+
+ echo $ac_n "checking __attribute__((const))""... $ac_c" 1>&6
+echo "configure:1357: checking __attribute__((const))" >&5
+ if eval "test \"`echo '$''{'adns_cv_c_attribute_const'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 1363 "configure"
+#include "confdefs.h"
+
+int main() {
+extern int testfunction(int x) __attribute__((const))
+; return 0; }
+EOF
+if { (eval echo configure:1370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ adns_cv_c_attribute_const=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ adns_cv_c_attribute_const=no
+fi
+rm -f conftest*
+
+fi
+
+ if test "x$adns_cv_c_attribute_const" = xyes; then
+ true
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_GNUC25_CONST 1
+EOF
+
+ else
+ true
+ echo "$ac_t""no" 1>&6
+ fi
+
+
+ echo $ac_n "checking __attribute__((format...))""... $ac_c" 1>&6
+echo "configure:1397: checking __attribute__((format...))" >&5
+ if eval "test \"`echo '$''{'adns_cv_attribute_format'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 1403 "configure"
+#include "confdefs.h"
+
+int main() {
+extern int testfunction(char *y, ...) __attribute__((format(printf,1,2)))
+; return 0; }
+EOF
+if { (eval echo configure:1410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ adns_cv_attribute_format=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ adns_cv_attribute_format=no
+fi
+rm -f conftest*
+
+fi
+
+ if test "x$adns_cv_attribute_format" = xyes; then
+ true
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_GNUC25_PRINTFFORMAT 1
+EOF
+
+ else
+ true
+ echo "$ac_t""no" 1>&6
+ fi
+
+ else
+ true
+ echo "$ac_t""no" 1>&6
+ fi
+
+
+
+
+
+if test "${GCC-no}" = yes; then
+ WARNS="-Wall -Wmissing-prototypes -Wwrite-strings -Wstrict-prototypes -Wcast-qual -Wpointer-arith"
+else
+ WARNS=
+fi
+
+
+
+
+
+
+
+
+
+
+SHLIBFORLINK='libadns.so'
+SHLIBSONAME='$(SHLIBFORLINK).$(MAJOR)'
+SHLIBFILE='$(SHLIBSONAME).$(MINOR)'
+
+SHLIBCC='$(CC) $(CFLAGS) -fpic'
+MKSHLIB_1='$(CC) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME) -o'
+MKSHLIB_2=''
+MKSHLIB_3='-lc'
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "settings.make Makefile
+ src/Makefile client/Makefile dynamic/Makefile regress/Makefile
+ src/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@CPP@%$CPP%g
+s%@RANLIB@%$RANLIB%g
+s%@PROGS_HAVE_TSEARCH@%$PROGS_HAVE_TSEARCH%g
+s%@WARNS@%$WARNS%g
+s%@SHLIBCC@%$SHLIBCC%g
+s%@MKSHLIB_1@%$MKSHLIB_1%g
+s%@MKSHLIB_2@%$MKSHLIB_2%g
+s%@MKSHLIB_3@%$MKSHLIB_3%g
+s%@SHLIBFORLINK@%$SHLIBFORLINK%g
+s%@SHLIBFILE@%$SHLIBFILE%g
+s%@SHLIBSONAME@%$SHLIBSONAME%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"settings.make Makefile
+ src/Makefile client/Makefile dynamic/Makefile regress/Makefile
+"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="src/config.h"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/adns-0.6/configure.in b/adns-0.6/configure.in
new file mode 100644
index 0000000..a007af3
--- /dev/null
+++ b/adns-0.6/configure.in
@@ -0,0 +1,101 @@
+# configure.in - input to autoconf
+#
+# This file is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+# It is part of adns, which is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+# Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+AC_INIT(src/adns.h)
+AC_CONFIG_HEADER(src/config.h)
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_RANLIB
+
+AC_CHECK_FUNCS(poll)
+ADNS_C_GETFUNC(socket,socket)
+ADNS_C_GETFUNC(inet_ntoa,nsl)
+
+PROGS_IF_TSEARCH=adnsresfilter
+AC_SUBST(PROGS_HAVE_TSEARCH)
+AC_CHECK_FUNC(tsearch,[
+ PROGS_HAVE_TSEARCH=$PROGS_IF_TSEARCH
+],[
+ PROGS_HAVE_TSEARCH='';
+ AC_MSG_WARN([tsearch missing - not building client program(s) $PROGS_IF_TSEARCH])
+])
+
+AC_MSG_CHECKING(for INADDR_LOOPBACK)
+AC_CACHE_VAL(adns_cv_decl_inaddrloopback,[
+ AC_TRY_COMPILE([
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+ ],[
+ INADDR_LOOPBACK;
+ ],
+ adns_cv_decl_inaddrloopback=yes,
+ adns_cv_decl_inaddrloopback=no)])
+if test "$adns_cv_decl_inaddrloopback" = yes; then
+ AC_MSG_RESULT(found)
+else
+ AC_MSG_RESULT([not in standard headers, urgh...])
+ AC_CHECK_HEADER(rpc/types.h,[
+ AC_DEFINE(HAVEUSE_RPCTYPES_H)
+ ],[
+ AC_MSG_ERROR([cannot find INADDR_LOOPBACK or rpc/types.h])
+ ])
+fi
+
+ADNS_C_GETFUNC(inet_aton,resolv,[
+ LIBS="-lresolv $LIBS";
+ AC_MSG_WARN([inet_aton is in libresolv, urgh. Must use -lresolv.])
+])
+
+ADNS_C_GCCATTRIB
+
+AC_SUBST(WARNS)
+
+if test "${GCC-no}" = yes; then
+ WARNS="-Wall -Wmissing-prototypes -Wwrite-strings -Wstrict-prototypes -Wcast-qual -Wpointer-arith"
+else
+ WARNS=
+fi
+
+AC_SUBST(SHLIBCC)
+AC_SUBST(MKSHLIB_1)
+AC_SUBST(MKSHLIB_2)
+AC_SUBST(MKSHLIB_3)
+
+AC_SUBST(SHLIBFORLINK)
+AC_SUBST(SHLIBFILE)
+AC_SUBST(SHLIBSONAME)
+
+SHLIBFORLINK='libadns.so'
+SHLIBSONAME='$(SHLIBFORLINK).$(MAJOR)'
+SHLIBFILE='$(SHLIBSONAME).$(MINOR)'
+
+SHLIBCC='$(CC) $(CFLAGS) -fpic'
+MKSHLIB_1='$(CC) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME) -o'
+MKSHLIB_2=''
+MKSHLIB_3='-lc'
+
+AC_OUTPUT(
+ settings.make Makefile
+ src/Makefile client/Makefile dynamic/Makefile regress/Makefile
+)
diff --git a/adns-0.6/dynamic/.cvsignore b/adns-0.6/dynamic/.cvsignore
new file mode 100644
index 0000000..ed7bf53
--- /dev/null
+++ b/adns-0.6/dynamic/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+libadns.so.*
diff --git a/adns-0.6/dynamic/Makefile.in b/adns-0.6/dynamic/Makefile.in
new file mode 100644
index 0000000..e6f785f
--- /dev/null
+++ b/adns-0.6/dynamic/Makefile.in
@@ -0,0 +1,54 @@
+# dynamic/Makefile - dynamic library Makefile
+#
+# This file is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+# It is part of adns, which is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+# Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+srcdir= @srcdir@
+VPATH= @srcdir@
+
+TARGETS= $(SHLIBFILE) $(SHLIBSONAME) $(SHLIBFORLINK)
+include $(srcdir)/../settings.make
+include $(srcdir)/../src/adns.make
+
+ALLOBJS= $(addsuffix _p.o, $(basename $(LIBOBJS)))
+
+install: $(SHLIBFILE)
+ $(INSTALL_PROGRAM) $(SHLIBFILE) $(lib_dir)/$(SHLIBFILE)
+ ln -sf $(SHLIBFILE) $(lib_dir)/$(SHLIBSONAME)
+
+uninstall:
+ rm -f $(lib_dir)/$(SHLIBFILE) $(lib_dir)/$(SHLIBSONAME)
+
+$(SHLIBFORLINK):
+ ln -s $(SHLIBSONAME) $(SHLIBFORLINK)
+
+$(SHLIBSONAME):
+ ln -s $(SHLIBFILE) $(SHLIBSONAME)
+
+$(SHLIBFILE): $(ALLOBJS)
+ rm -f $@
+ $(MKSHLIB_1) $@ $(MKSHLIB_2) $(ALLOBJS) $(LDLIBS) $(MKSHLIB_3)
+
+%_p.o: $(srcdir)/../src/%.c $(srcdir)/../src/adns.h \
+ $(srcdir)/../src/internal.h $(srcdir)/../src/config.h
+ $(SHLIBCC) -I$(srcdir)/../src -c -o $@ $<
+
+$(LIBOBJS):
diff --git a/adns-0.6/regress/.cvsignore b/adns-0.6/regress/.cvsignore
new file mode 100644
index 0000000..154e5a9
--- /dev/null
+++ b/adns-0.6/regress/.cvsignore
@@ -0,0 +1,8 @@
+Makefile
+harness.h
+hcommon.c
+hrecord
+hrecord.c
+hplayback
+hplayback.c
+output-*.*
diff --git a/adns-0.6/regress/Makefile.in b/adns-0.6/regress/Makefile.in
new file mode 100644
index 0000000..2945c8b
--- /dev/null
+++ b/adns-0.6/regress/Makefile.in
@@ -0,0 +1,65 @@
+# regress/Makefile - regression test Makefile
+#
+# This file is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+# It is part of adns, which is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+# Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+srcdir= @srcdir@
+VPATH= @srcdir@
+
+TARGETS= hplayback hrecord
+AUTOCSRCS= harness.h hrecord.c hplayback.c hcommon.c
+include $(srcdir)/../settings.make
+include $(srcdir)/../src/adns.make
+
+DIRCFLAGS= -I$(srcdir)/../src
+
+HCPPFLAGS:= $(foreach F, \
+ gettimeofday select poll \
+ socket fcntl connect close \
+ sendto recvfrom read write writev \
+ malloc realloc free exit \
+, -D$F=H$F)
+
+HARNLOBJS= $(addsuffix _d.o, $(basename $(LIBOBJS)))
+ALLOBJS= $(HARNLOBJS) dtest.o hrecord.o hplayback.o hcommon.o
+
+.PRECIOUS: $(AUTOCSRCS)
+
+check: $(TARGETS)
+ ./checkall
+
+all install uninstall:
+
+hrecord: adnstest_c.o hrecord.o hcommon.o $(HARNLOBJS)
+hplayback: adnstest_c.o hplayback.o hcommon.o $(HARNLOBJS)
+
+%_d.o: $(srcdir)/../src/%.c
+ $(CC) $(HCPPFLAGS) -c -g -o $@ $<
+
+%_c.o: $(srcdir)/../client/%.c
+ $(CC) $(HCPPFLAGS) -I $(srcdir)/../src -c -g -o $@ $<
+
+$(ALLOBJS): $(srcdir)/../src/adns.h $(srcdir)/../src/internal.h harness.h
+
+%:: %.m4 hmacros.i4 hsyscalls.i4
+ $(M4) -P $< >$@-a.new
+ sed -e 's/hm_comma/,/g; s/hm_squote/'\''/g; /^[ ]*$$/d' <$@-a.new >$@-b.new
+ @mv -f $@-b.new $@; rm -f $@-a.new
diff --git a/adns-0.6/regress/addcases b/adns-0.6/regress/addcases
new file mode 100755
index 0000000..3c3138c
--- /dev/null
+++ b/adns-0.6/regress/addcases
@@ -0,0 +1,9 @@
+#!/bin/sh
+# usage: ./addcases <casename> ...
+
+set -e
+
+for f in "$@"
+do
+ cvs add "case-$f".{sys,out,err}
+done
diff --git a/adns-0.6/regress/case-1stservbroken.err b/adns-0.6/regress/case-1stservbroken.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-1stservbroken.err
diff --git a/adns-0.6/regress/case-1stservbroken.out b/adns-0.6/regress/case-1stservbroken.out
new file mode 100644
index 0000000..8a1790c
--- /dev/null
+++ b/adns-0.6/regress/case-1stservbroken.out
@@ -0,0 +1,39 @@
+adns debug: using nameserver 172.18.45.2
+adns debug: using nameserver 172.18.45.6
+trunc.test.iwj.relativity.greenend.org.uk flags 0 type 12 PTR(raw) submitted
+adns warning: datagram receive error: Connection refused
+adns debug: TCP connected (NS=172.18.45.2)
+adns warning: TCP connection failed: read: Broken pipe (NS=172.18.45.2)
+adns debug: TCP connected (NS=172.18.45.6)
+trunc.test.iwj.relativity.greenend.org.uk flags 0 type PTR(raw): OK; nrrs=30; cname=$; owner=$; ttl=60
+ long.domain.to.force.truncation.0.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.1.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.2.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.3.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.4.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.5.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.6.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.7.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.8.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.9.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.10.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.11.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.12.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.13.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.14.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.15.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.16.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.17.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.18.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.19.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.20.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.21.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.22.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.23.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.24.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.25.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.26.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.27.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.28.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.29.test.iwj.relativity.greenend.org.uk
+rc=0
diff --git a/adns-0.6/regress/case-1stservbroken.sys b/adns-0.6/regress/case-1stservbroken.sys
new file mode 100644
index 0000000..36c7837
--- /dev/null
+++ b/adns-0.6/regress/case-1stservbroken.sys
@@ -0,0 +1,180 @@
+1stservbroken
+:12 trunc.test.iwj.relativity.greenend.org.uk
+ start 940102940.701451
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000612
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000605
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000573
+ sendto fd=4 addr=172.18.45.2:53
+ 311f0100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ sendto=59
+ +0.006374
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.993626
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001402
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=ECONNREFUSED
+ +0.000666
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.991558
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-02914
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ sendto=59
+ +0.002262
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997738
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000973
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8380 00010008 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001c0 0c000c00
+ 01000000 3c004704 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275
+ 6e636174 696f6e01 30047465 73740369 776a0a72 656c6174 69766974 79086772
+ 65656e65 6e64036f 72670275 6b00c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0131 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0132 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0133 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0134 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0135 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0136 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0137 c069.
+ +0.004340
+ socket type=SOCK_STREAM
+ socket=5
+ +0.005126
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000742
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000604
+ connect fd=5 addr=172.18.45.2:53
+ connect=EINPROGRESS
+ +0.000797
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000829
+ select max=6 rfds=[4] wfds=[5] efds=[] to=13.987562
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.001172
+ read fd=5 buflen=1
+ read=OK
+ .
+ +0.001161
+ write fd=5
+ 003b311f 01000001 00000000 00000574 72756e63 04746573 74036977 6a0a7265
+ 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000c00 01.
+ write=61
+ +0.003598
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.981631
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.001370
+ read fd=5 buflen=2
+ read=EPIPE
+ +0.001699
+ close fd=5
+ close=OK
+ +0.000687
+ socket type=SOCK_STREAM
+ socket=5
+ +0.004866
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000611
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000574
+ connect fd=5 addr=172.18.45.6:53
+ connect=EINPROGRESS
+ +0.001082
+ select max=6 rfds=[4] wfds=[5] efds=[] to=14.000000
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.001011
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000595
+ write fd=5
+ 003b311f 01000001 00000000 00000574 72756e63 04746573 74036977 6a0a7265
+ 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000c00 01.
+ write=61
+ +0.005087
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.964049
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.001295
+ read fd=5 buflen=2
+ read=OK
+ 0638.
+ +0.000649
+ read fd=5 buflen=1592
+ read=OK
+ 311f8580 0001001e 00010001 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001c0 0c000c00
+ 01000000 3c004704 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275
+ 6e636174 696f6e01 30047465 73740369 776a0a72 656c6174 69766974 79086772
+ 65656e65 6e64036f 72670275 6b00c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0131 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0132 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0133 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0134 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0135 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0136 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0137 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0138 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0139 c069c00c
+ 000c0001 0000003c 0025046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0231 30c069c0 0c000c00 01000000 3c002504 6c6f6e67
+ 06646f6d 61696e02 746f0566 6f726365 0a747275 6e636174 696f6e02 3131c069
+ c00c000c 00010000 003c0025 046c6f6e 6706646f 6d61696e 02746f05 666f7263
+ 650a7472 756e6361 74696f6e 023132c0 69c00c00 0c000100 00003c00 25046c6f
+ 6e670664 6f6d6169 6e02746f 05666f72 63650a74 72756e63 6174696f 6e023133
+ c069c00c 000c0001 0000003c 0025046c 6f6e6706 646f6d61 696e0274 6f05666f
+ 7263650a 7472756e 63617469 6f6e0231 34c069c0 0c000c00 01000000 3c002504
+ 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275 6e636174 696f6e02
+ 3135c069 c00c000c 00010000 003c0025 046c6f6e 6706646f 6d61696e 02746f05
+ 666f7263 650a7472 756e6361 74696f6e 023136c0 69c00c00 0c000100 00003c00
+ 25046c6f 6e670664 6f6d6169 6e02746f 05666f72 63650a74 72756e63 6174696f
+ 6e023137 c069c00c 000c0001 0000003c 0025046c 6f6e6706 646f6d61 696e0274
+ 6f05666f 7263650a 7472756e 63617469 6f6e0231 38c069c0 0c000c00 01000000
+ 3c002504 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275 6e636174
+ 696f6e02 3139c069 c00c000c 00010000 003c0025 046c6f6e 6706646f 6d61696e
+ 02746f05 666f7263 650a7472 756e6361 74696f6e 023230c0 69c00c00 0c000100
+ 00003c00 25046c6f 6e670664 6f6d6169 6e02746f 05666f72 63650a74 72756e63
+ 6174696f 6e023231 c069c00c 000c0001 0000003c 0025046c 6f6e6706 646f6d61
+ 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0232 32c069c0 0c000c00
+ 01000000 3c002504 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275
+ 6e636174 696f6e02 3233c069 c00c000c 00010000 003c0025 046c6f6e 6706646f
+ 6d61696e 02746f05 666f7263 650a7472 756e6361 74696f6e 023234c0 69c00c00
+ 0c000100 00003c00 25046c6f 6e670664 6f6d6169 6e02746f 05666f72 63650a74
+ 72756e63 6174696f 6e023235 c069c00c 000c0001 0000003c 0025046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0232 36c069c0
+ 0c000c00 01000000 3c002504 6c6f6e67 06646f6d 61696e02 746f0566 6f726365
+ 0a747275 6e636174 696f6e02 3237c069 c00c000c 00010000 003c0025 046c6f6e
+ 6706646f 6d61696e 02746f05 666f7263 650a7472 756e6361 74696f6e 023238c0
+ 69c00c00 0c000100 00003c00 25046c6f 6e670664 6f6d6169 6e02746f 05666f72
+ 63650a74 72756e63 6174696f 6e023239 c069c069 00020001 0000003c 0006036e
+ 7330c072 036e7330 c0720001 00010001 51800004 ac122d06.
+ +0.009426
+ read fd=5 buflen=1594
+ read=EAGAIN
+ +0.033394
+ close fd=4
+ close=OK
+ +0.054384
+ close fd=5
+ close=OK
+ +0.000977
diff --git a/adns-0.6/regress/case-1stservtotcp.err b/adns-0.6/regress/case-1stservtotcp.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-1stservtotcp.err
diff --git a/adns-0.6/regress/case-1stservtotcp.out b/adns-0.6/regress/case-1stservtotcp.out
new file mode 100644
index 0000000..fe2f632
--- /dev/null
+++ b/adns-0.6/regress/case-1stservtotcp.out
@@ -0,0 +1,37 @@
+adns debug: using nameserver 10.0.0.1
+adns debug: using nameserver 172.18.45.6
+trunc.test.iwj.relativity.greenend.org.uk flags 0 type 12 PTR(raw) submitted
+adns warning: TCP connection failed: unable to make connection: timed out (NS=10.0.0.1)
+adns debug: TCP connected (NS=172.18.45.6)
+trunc.test.iwj.relativity.greenend.org.uk flags 0 type PTR(raw): OK; nrrs=30; cname=$; owner=$; ttl=59
+ long.domain.to.force.truncation.0.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.1.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.2.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.3.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.4.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.5.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.6.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.7.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.8.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.9.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.10.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.11.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.12.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.13.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.14.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.15.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.16.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.17.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.18.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.19.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.20.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.21.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.22.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.23.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.24.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.25.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.26.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.27.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.28.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.29.test.iwj.relativity.greenend.org.uk
+rc=0
diff --git a/adns-0.6/regress/case-1stservtotcp.sys b/adns-0.6/regress/case-1stservtotcp.sys
new file mode 100644
index 0000000..84a851c
--- /dev/null
+++ b/adns-0.6/regress/case-1stservtotcp.sys
@@ -0,0 +1,159 @@
+1stservto
+:12 trunc.test.iwj.relativity.greenend.org.uk
+ start 940100259.965940
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000698
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000611
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000582
+ sendto fd=4 addr=10.0.0.1:53
+ 311f0100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ sendto=59
+ +0.006634
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.993366
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-05507
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ sendto=59
+ +0.002310
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997690
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000996
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8380 00010008 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001c0 0c000c00
+ 01000000 3c004704 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275
+ 6e636174 696f6e01 30047465 73740369 776a0a72 656c6174 69766974 79086772
+ 65656e65 6e64036f 72670275 6b00c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0131 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0132 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0133 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0134 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0135 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0136 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0137 c069.
+ +0.004379
+ socket type=SOCK_STREAM
+ socket=5
+ +0.009970
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000612
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000602
+ connect fd=5 addr=10.0.0.1:53
+ connect=EINPROGRESS
+ +0.000850
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000646
+ select max=6 rfds=[4] wfds=[5] efds=[] to=13.982941
+ select=0 rfds=[] wfds=[] efds=[]
+ +14.-10600
+ close fd=5
+ close=OK
+ +0.000750
+ socket type=SOCK_STREAM
+ socket=5
+ +0.004957
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000593
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000582
+ connect fd=5 addr=172.18.45.6:53
+ connect=EINPROGRESS
+ +0.001140
+ select max=6 rfds=[4] wfds=[5] efds=[] to=13.991978
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.001038
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.001203
+ write fd=5
+ 003b311f 01000001 00000000 00000574 72756e63 04746573 74036977 6a0a7265
+ 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000c00 01.
+ write=61
+ +0.007301
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=15.975977
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.001431
+ read fd=5 buflen=2
+ read=OK
+ 0638.
+ +0.001841
+ read fd=5 buflen=1592
+ read=OK
+ 311f8580 0001001e 00010001 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001c0 0c000c00
+ 01000000 3c004704 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275
+ 6e636174 696f6e01 30047465 73740369 776a0a72 656c6174 69766974 79086772
+ 65656e65 6e64036f 72670275 6b00c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0131 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0132 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0133 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0134 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0135 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0136 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0137 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0138 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0139 c069c00c
+ 000c0001 0000003c 0025046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0231 30c069c0 0c000c00 01000000 3c002504 6c6f6e67
+ 06646f6d 61696e02 746f0566 6f726365 0a747275 6e636174 696f6e02 3131c069
+ c00c000c 00010000 003c0025 046c6f6e 6706646f 6d61696e 02746f05 666f7263
+ 650a7472 756e6361 74696f6e 023132c0 69c00c00 0c000100 00003c00 25046c6f
+ 6e670664 6f6d6169 6e02746f 05666f72 63650a74 72756e63 6174696f 6e023133
+ c069c00c 000c0001 0000003c 0025046c 6f6e6706 646f6d61 696e0274 6f05666f
+ 7263650a 7472756e 63617469 6f6e0231 34c069c0 0c000c00 01000000 3c002504
+ 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275 6e636174 696f6e02
+ 3135c069 c00c000c 00010000 003c0025 046c6f6e 6706646f 6d61696e 02746f05
+ 666f7263 650a7472 756e6361 74696f6e 023136c0 69c00c00 0c000100 00003c00
+ 25046c6f 6e670664 6f6d6169 6e02746f 05666f72 63650a74 72756e63 6174696f
+ 6e023137 c069c00c 000c0001 0000003c 0025046c 6f6e6706 646f6d61 696e0274
+ 6f05666f 7263650a 7472756e 63617469 6f6e0231 38c069c0 0c000c00 01000000
+ 3c002504 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275 6e636174
+ 696f6e02 3139c069 c00c000c 00010000 003c0025 046c6f6e 6706646f 6d61696e
+ 02746f05 666f7263 650a7472 756e6361 74696f6e 023230c0 69c00c00 0c000100
+ 00003c00 25046c6f 6e670664 6f6d6169 6e02746f 05666f72 63650a74 72756e63
+ 6174696f 6e023231 c069c00c 000c0001 0000003c 0025046c 6f6e6706 646f6d61
+ 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0232 32c069c0 0c000c00
+ 01000000 3c002504 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275
+ 6e636174 696f6e02 3233c069 c00c000c 00010000 003c0025 046c6f6e 6706646f
+ 6d61696e 02746f05 666f7263 650a7472 756e6361 74696f6e 023234c0 69c00c00
+ 0c000100 00003c00 25046c6f 6e670664 6f6d6169 6e02746f 05666f72 63650a74
+ 72756e63 6174696f 6e023235 c069c00c 000c0001 0000003c 0025046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0232 36c069c0
+ 0c000c00 01000000 3c002504 6c6f6e67 06646f6d 61696e02 746f0566 6f726365
+ 0a747275 6e636174 696f6e02 3237c069 c00c000c 00010000 003c0025 046c6f6e
+ 6706646f 6d61696e 02746f05 666f7263 650a7472 756e6361 74696f6e 023238c0
+ 69c00c00 0c000100 00003c00 25046c6f 6e670664 6f6d6169 6e02746f 05666f72
+ 63650a74 72756e63 6174696f 6e023239 c069c069 00020001 0000003c 0006036e
+ 7330c072 036e7330 c0720001 00010001 51800004 ac122d06.
+ +1.-990207
+ read fd=5 buflen=1594
+ read=EAGAIN
+ +0.040526
+ close fd=4
+ close=OK
+ +0.065240
+ close fd=5
+ close=OK
+ +0.000982
diff --git a/adns-0.6/regress/case-2ndservok.err b/adns-0.6/regress/case-2ndservok.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-2ndservok.err
diff --git a/adns-0.6/regress/case-2ndservok.out b/adns-0.6/regress/case-2ndservok.out
new file mode 100644
index 0000000..2c72438
--- /dev/null
+++ b/adns-0.6/regress/case-2ndservok.out
@@ -0,0 +1,6 @@
+adns debug: using nameserver 172.18.45.36
+adns debug: using nameserver 172.18.45.6
+davenant.relativity.greenend.org.uk flags 0 type 1 A(-) submitted
+davenant.relativity.greenend.org.uk flags 0 type A(-): OK; nrrs=1; cname=$; owner=$; ttl=86400
+ 172.18.45.6
+rc=0
diff --git a/adns-0.6/regress/case-2ndservok.sys b/adns-0.6/regress/case-2ndservok.sys
new file mode 100644
index 0000000..8ca8f83
--- /dev/null
+++ b/adns-0.6/regress/case-2ndservok.sys
@@ -0,0 +1,47 @@
+2ndserver
+:1 davenant.relativity.greenend.org.uk
+ start 940100095.012145
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000173
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000053
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000042
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08646176 656e616e 740a7265 6c617469 76697479
+ 08677265 656e656e 64036f72 6702756b 00000100 01.
+ sendto=53
+ +0.001041
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998959
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04931
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.003890
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009910
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 08646176 656e616e 740a7265 6c617469 76697479
+ 08677265 656e656e 64036f72 6702756b 00000100 01.
+ sendto=53
+ +0.000863
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999137
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000126
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010001 00030003 08646176 656e616e 740a7265 6c617469 76697479
+ 08677265 656e656e 64036f72 6702756b 00000100 01c00c00 01000100 01518000
+ 04ac122d 060a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b
+ 00000200 01000151 80000603 6e7330c0 45c04500 02000100 01518000 06036e73
+ 31c045c0 45000200 01000151 80000603 6e7332c0 45c06b00 01000100 01518000
+ 04ac122d 06c07d00 01000100 01518000 04ac122d 41c08f00 01000100 01518000
+ 04ac122d 01.
+ +0.001026
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000423
+ close fd=4
+ close=OK
+ +0.000435
diff --git a/adns-0.6/regress/case-2ndservtcp.err b/adns-0.6/regress/case-2ndservtcp.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-2ndservtcp.err
diff --git a/adns-0.6/regress/case-2ndservtcp.out b/adns-0.6/regress/case-2ndservtcp.out
new file mode 100644
index 0000000..857176d
--- /dev/null
+++ b/adns-0.6/regress/case-2ndservtcp.out
@@ -0,0 +1,37 @@
+adns debug: using nameserver 172.18.45.36
+adns debug: using nameserver 172.18.45.6
+trunc.test.iwj.relativity.greenend.org.uk flags 0 type 12 PTR(raw) submitted
+adns warning: TCP connection failed: connect/read: No route to host (NS=172.18.45.36)
+adns debug: TCP connected (NS=172.18.45.6)
+trunc.test.iwj.relativity.greenend.org.uk flags 0 type PTR(raw): OK; nrrs=30; cname=$; owner=$; ttl=60
+ long.domain.to.force.truncation.0.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.1.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.2.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.3.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.4.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.5.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.6.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.7.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.8.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.9.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.10.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.11.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.12.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.13.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.14.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.15.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.16.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.17.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.18.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.19.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.20.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.21.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.22.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.23.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.24.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.25.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.26.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.27.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.28.test.iwj.relativity.greenend.org.uk
+ long.domain.to.force.truncation.29.test.iwj.relativity.greenend.org.uk
+rc=0
diff --git a/adns-0.6/regress/case-2ndservtcp.sys b/adns-0.6/regress/case-2ndservtcp.sys
new file mode 100644
index 0000000..5267730
--- /dev/null
+++ b/adns-0.6/regress/case-2ndservtcp.sys
@@ -0,0 +1,165 @@
+2ndserver
+:12 trunc.test.iwj.relativity.greenend.org.uk
+ start 940100083.268555
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000169
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000053
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000040
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ sendto=59
+ +0.001167
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998833
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-01463
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000296
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009912
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001.
+ sendto=59
+ +0.001357
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998643
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000126
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8380 00010008 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001c0 0c000c00
+ 01000000 3c004704 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275
+ 6e636174 696f6e01 30047465 73740369 776a0a72 656c6174 69766974 79086772
+ 65656e65 6e64036f 72670275 6b00c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0131 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0132 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0133 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0134 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0135 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0136 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0137 c069.
+ +0.002022
+ socket type=SOCK_STREAM
+ socket=5
+ +0.000905
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000041
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000038
+ connect fd=5 addr=172.18.45.36:53
+ connect=EINPROGRESS
+ +0.000162
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000062
+ select max=6 rfds=[4] wfds=[5] efds=[] to=13.996770
+ select=1 rfds=[] wfds=[5] efds=[]
+ +1.-14443
+ read fd=5 buflen=1
+ read=EHOSTUNREACH
+ +0.000193
+ close fd=5
+ close=OK
+ +0.000146
+ socket type=SOCK_STREAM
+ socket=5
+ +0.000678
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000042
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000039
+ connect fd=5 addr=172.18.45.6:53
+ connect=EINPROGRESS
+ +0.000455
+ select max=6 rfds=[4] wfds=[5] efds=[] to=14.000000
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.000135
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000062
+ write fd=5
+ 003b311f 01000001 00000000 00000574 72756e63 04746573 74036977 6a0a7265
+ 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000c00 01.
+ write=61
+ +0.004082
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.005381
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.000149
+ read fd=5 buflen=2
+ read=OK
+ 0638.
+ +0.000210
+ read fd=5 buflen=1592
+ read=OK
+ 311f8580 0001001e 00010001 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 0c0001c0 0c000c00
+ 01000000 3c004704 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275
+ 6e636174 696f6e01 30047465 73740369 776a0a72 656c6174 69766974 79086772
+ 65656e65 6e64036f 72670275 6b00c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0131 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0132 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0133 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0134 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0135 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0136 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0137 c069c00c
+ 000c0001 0000003c 0024046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0138 c069c00c 000c0001 0000003c 0024046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0139 c069c00c
+ 000c0001 0000003c 0025046c 6f6e6706 646f6d61 696e0274 6f05666f 7263650a
+ 7472756e 63617469 6f6e0231 30c069c0 0c000c00 01000000 3c002504 6c6f6e67
+ 06646f6d 61696e02 746f0566 6f726365 0a747275 6e636174 696f6e02 3131c069
+ c00c000c 00010000 003c0025 046c6f6e 6706646f 6d61696e 02746f05 666f7263
+ 650a7472 756e6361 74696f6e 023132c0 69c00c00 0c000100 00003c00 25046c6f
+ 6e670664 6f6d6169 6e02746f 05666f72 63650a74 72756e63 6174696f 6e023133
+ c069c00c 000c0001 0000003c 0025046c 6f6e6706 646f6d61 696e0274 6f05666f
+ 7263650a 7472756e 63617469 6f6e0231 34c069c0 0c000c00 01000000 3c002504
+ 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275 6e636174 696f6e02
+ 3135c069 c00c000c 00010000 003c0025 046c6f6e 6706646f 6d61696e 02746f05
+ 666f7263 650a7472 756e6361 74696f6e 023136c0 69c00c00 0c000100 00003c00
+ 25046c6f 6e670664 6f6d6169 6e02746f 05666f72 63650a74 72756e63 6174696f
+ 6e023137 c069c00c 000c0001 0000003c 0025046c 6f6e6706 646f6d61 696e0274
+ 6f05666f 7263650a 7472756e 63617469 6f6e0231 38c069c0 0c000c00 01000000
+ 3c002504 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275 6e636174
+ 696f6e02 3139c069 c00c000c 00010000 003c0025 046c6f6e 6706646f 6d61696e
+ 02746f05 666f7263 650a7472 756e6361 74696f6e 023230c0 69c00c00 0c000100
+ 00003c00 25046c6f 6e670664 6f6d6169 6e02746f 05666f72 63650a74 72756e63
+ 6174696f 6e023231 c069c00c 000c0001 0000003c 0025046c 6f6e6706 646f6d61
+ 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0232 32c069c0 0c000c00
+ 01000000 3c002504 6c6f6e67 06646f6d 61696e02 746f0566 6f726365 0a747275
+ 6e636174 696f6e02 3233c069 c00c000c 00010000 003c0025 046c6f6e 6706646f
+ 6d61696e 02746f05 666f7263 650a7472 756e6361 74696f6e 023234c0 69c00c00
+ 0c000100 00003c00 25046c6f 6e670664 6f6d6169 6e02746f 05666f72 63650a74
+ 72756e63 6174696f 6e023235 c069c00c 000c0001 0000003c 0025046c 6f6e6706
+ 646f6d61 696e0274 6f05666f 7263650a 7472756e 63617469 6f6e0232 36c069c0
+ 0c000c00 01000000 3c002504 6c6f6e67 06646f6d 61696e02 746f0566 6f726365
+ 0a747275 6e636174 696f6e02 3237c069 c00c000c 00010000 003c0025 046c6f6e
+ 6706646f 6d61696e 02746f05 666f7263 650a7472 756e6361 74696f6e 023238c0
+ 69c00c00 0c000100 00003c00 25046c6f 6e670664 6f6d6169 6e02746f 05666f72
+ 63650a74 72756e63 6174696f 6e023239 c069c069 00020001 0000003c 0006036e
+ 7330c072 036e7330 c0720001 00010001 51800004 ac122d06.
+ +0.006071
+ read fd=5 buflen=1594
+ read=EAGAIN
+ +0.005347
+ close fd=4
+ close=OK
+ +0.004675
+ close fd=5
+ close=OK
+ +0.000433
diff --git a/adns-0.6/regress/case-abbrev.err b/adns-0.6/regress/case-abbrev.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-abbrev.err
diff --git a/adns-0.6/regress/case-abbrev.out b/adns-0.6/regress/case-abbrev.out
new file mode 100644
index 0000000..1f786ef
--- /dev/null
+++ b/adns-0.6/regress/case-abbrev.out
@@ -0,0 +1,40 @@
+adns debug: using nameserver 172.18.45.6
+greenend.org.uk flags 0 type 1 A(-) submitted
+greenend.org.uk flags 0 type 2 NS(raw) submitted
+greenend.org.uk flags 0 type 5 CNAME(-) submitted
+greenend.org.uk flags 0 type 6 SOA(raw) submitted
+greenend.org.uk flags 0 type 12 PTR(raw) submitted
+greenend.org.uk flags 0 type 13 HINFO(-) submitted
+greenend.org.uk flags 0 type 15 MX(raw) submitted
+greenend.org.uk flags 0 type 16 TXT(-) submitted
+greenend.org.uk flags 0 type 17 RP(raw) submitted
+greenend.org.uk flags 0 type 65537 A(addr) submitted
+greenend.org.uk flags 0 type 65538 NS(+addr) submitted
+greenend.org.uk flags 0 type 65548 PTR(checked) submitted
+greenend.org.uk flags 0 type 65551 MX(+addr) submitted
+greenend.org.uk flags 0 type 131078 SOA(822) submitted
+greenend.org.uk flags 0 type 131089 RP(822) submitted
+greenend.org.uk flags 0 type A(-) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
+greenend.org.uk flags 0 type NS(raw) ownflags=a: ok; nrrs=2; cname=$; owner=$; ttl=86400
+ ns1.relativity.greenend.org.uk
+ ns0.relativity.greenend.org.uk
+greenend.org.uk flags 0 type CNAME(-) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
+greenend.org.uk flags 0 type SOA(raw) ownflags=a: ok; nrrs=1; cname=$; owner=$; ttl=86400
+ ns.chiark.greenend.org.uk hostmaster.greenend.org.uk 1999061300 28800 7200 604800 86400
+greenend.org.uk flags 0 type PTR(raw) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
+greenend.org.uk flags 0 type HINFO(-) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
+greenend.org.uk flags 0 type MX(raw) ownflags=a: ok; nrrs=1; cname=$; owner=$; ttl=86400
+ 10 chiark.greenend.org.uk
+greenend.org.uk flags 0 type TXT(-) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
+greenend.org.uk flags 0 type RP(raw) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
+greenend.org.uk flags 0 type A(addr) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
+greenend.org.uk flags 0 type NS(+addr) ownflags=a: ok; nrrs=2; cname=$; owner=$; ttl=86400
+ ns0.relativity.greenend.org.uk ok 0 ok "OK" ( INET 172.18.45.6 )
+ ns1.relativity.greenend.org.uk ok 0 ok "OK" ( INET 172.18.45.65 )
+greenend.org.uk flags 0 type PTR(checked) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
+greenend.org.uk flags 0 type MX(+addr) ownflags=a: ok; nrrs=1; cname=$; owner=$; ttl=86400
+ 10 chiark.greenend.org.uk ok 0 ok "OK" ( INET 195.224.76.132 )
+greenend.org.uk flags 0 type SOA(822) ownflags=a: ok; nrrs=1; cname=$; owner=$; ttl=86400
+ ns.chiark.greenend.org.uk hostmaster@greenend.org.uk 1999061300 28800 7200 604800 86400
+greenend.org.uk flags 0 type RP(822) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
+rc=0
diff --git a/adns-0.6/regress/case-abbrev.sys b/adns-0.6/regress/case-abbrev.sys
new file mode 100644
index 0000000..f98d716
--- /dev/null
+++ b/adns-0.6/regress/case-abbrev.sys
@@ -0,0 +1,282 @@
+default
+,a/greenend.org.uk
+ start 929580078.542974
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000202
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000086
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000061
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000623
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000425
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000371
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000369
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000369
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000414
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000371
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000368
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000368
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000367
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000367
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000366
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000378
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000391
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000467
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.993986
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005183
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010000 00010000 08677265 656e656e 64036f72 6702756b 00000100
+ 01c00c00 06000100 01518000 2d026e73 06636869 61726bc0 0c0a686f 73746d61
+ 73746572 c00c7727 41340000 70800000 1c200009 3a800001 5180.
+ +0.000588
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000147
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.988691
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004348
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208580 00010002 00000002 08677265 656e656e 64036f72 6702756b 00000200
+ 01c00c00 02000100 01518000 11036e73 310a7265 6c617469 76697479 c00cc00c
+ 00020001 00015180 0006036e 7330c031 c02d0001 00010001 51800004 ac122d41
+ c04a0001 00010001 51800004 ac122d06.
+ +0.000642
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000247
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.983879
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002737
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010000 00010000 08677265 656e656e 64036f72 6702756b 00000500
+ 01c00c00 06000100 01518000 2d026e73 06636869 61726bc0 0c0a686f 73746d61
+ 73746572 c00c7727 41340000 70800000 1c200009 3a800001 5180.
+ +0.000541
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000099
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.980873
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005000
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228580 00010001 00020002 08677265 656e656e 64036f72 6702756b 00000600
+ 01c00c00 06000100 01518000 2d026e73 06636869 61726bc0 0c0a686f 73746d61
+ 73746572 c00c7727 41340000 70800000 1c200009 3a800001 5180c00c 00020001
+ 00015180 0011036e 73310a72 656c6174 69766974 79c00cc0 0c000200 01000151
+ 80000603 6e7330c0 6ac06600 01000100 01518000 04ac122d 41c08300 01000100
+ 01518000 04ac122d 06.
+ +0.000913
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000195
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.975134
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002529
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238580 00010000 00010000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01c00c00 06000100 01518000 2d026e73 06636869 61726bc0 0c0a686f 73746d61
+ 73746572 c00c7727 41340000 70800000 1c200009 3a800001 5180.
+ +0.000541
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000100
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.972333
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003175
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248580 00010000 00010000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01c00c00 06000100 01518000 2d026e73 06636869 61726bc0 0c0a686f 73746d61
+ 73746572 c00c7727 41340000 70800000 1c200009 3a800001 5180.
+ +0.000538
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000122
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.968912
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005109
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258580 00010001 00020003 08677265 656e656e 64036f72 6702756b 00000f00
+ 01c00c00 0f000100 01518000 0b000a06 63686961 726bc00c c00c0002 00010001
+ 51800011 036e7331 0a72656c 61746976 697479c0 0cc00c00 02000100 01518000
+ 06036e73 30c048c0 2f000100 01000151 800004c3 e04c84c0 44000100 01000151
+ 800004ac 122d41c0 61000100 01000151 800004ac 122d06.
+ +0.000826
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000173
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.963175
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002746
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268580 00010000 00010000 08677265 656e656e 64036f72 6702756b 00001000
+ 01c00c00 06000100 01518000 2d026e73 06636869 61726bc0 0c0a686f 73746d61
+ 73746572 c00c7727 41340000 70800000 1c200009 3a800001 5180.
+ +0.000539
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000127
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.960131
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003161
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278580 00010000 00010000 08677265 656e656e 64036f72 6702756b 00001100
+ 01c00c00 06000100 01518000 2d026e73 06636869 61726bc0 0c0a686f 73746d61
+ 73746572 c00c7727 41340000 70800000 1c200009 3a800001 5180.
+ +0.000537
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000098
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.956703
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003055
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288580 00010000 00010000 08677265 656e656e 64036f72 6702756b 00000100
+ 01c00c00 06000100 01518000 2d026e73 06636869 61726bc0 0c0a686f 73746d61
+ 73746572 c00c7727 41340000 70800000 1c200009 3a800001 5180.
+ +0.000537
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000126
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.953352
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004322
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298580 00010002 00000002 08677265 656e656e 64036f72 6702756b 00000200
+ 01c00c00 02000100 01518000 11036e73 300a7265 6c617469 76697479 c00cc00c
+ 00020001 00015180 0006036e 7331c031 c02d0001 00010001 51800004 ac122d06
+ c04a0001 00010001 51800004 ac122d41.
+ +0.000638
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000268
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.948491
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002741
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8580 00010000 00010000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01c00c00 06000100 01518000 2d026e73 06636869 61726bc0 0c0a686f 73746d61
+ 73746572 c00c7727 41340000 70800000 1c200009 3a800001 5180.
+ +0.000540
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000129
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.945447
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005215
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8580 00010001 00020003 08677265 656e656e 64036f72 6702756b 00000f00
+ 01c00c00 0f000100 01518000 0b000a06 63686961 726bc00c c00c0002 00010001
+ 51800011 036e7330 0a72656c 61746976 697479c0 0cc00c00 02000100 01518000
+ 06036e73 31c048c0 2f000100 01000151 800004c3 e04c84c0 44000100 01000151
+ 800004ac 122d06c0 61000100 01000151 800004ac 122d41.
+ +0.000822
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000197
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.939591
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004484
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8580 00010001 00020002 08677265 656e656e 64036f72 6702756b 00000600
+ 01c00c00 06000100 01518000 2d026e73 06636869 61726bc0 0c0a686f 73746d61
+ 73746572 c00c7727 41340000 70800000 1c200009 3a800001 5180c00c 00020001
+ 00015180 0011036e 73300a72 656c6174 69766974 79c00cc0 0c000200 01000151
+ 80000603 6e7331c0 6ac06600 01000100 01518000 04ac122d 06c08300 01000100
+ 01518000 04ac122d 41.
+ +0.000910
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000223
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.934365
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002704
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8580 00010000 00010000 08677265 656e656e 64036f72 6702756b 00001100
+ 01c00c00 06000100 01518000 2d026e73 06636869 61726bc0 0c0a686f 73746d61
+ 73746572 c00c7727 41340000 70800000 1c200009 3a800001 5180.
+ +0.000537
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000099
+ close fd=4
+ close=OK
+ +0.000153
diff --git a/adns-0.6/regress/case-abbrevto.err b/adns-0.6/regress/case-abbrevto.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-abbrevto.err
diff --git a/adns-0.6/regress/case-abbrevto.out b/adns-0.6/regress/case-abbrevto.out
new file mode 100644
index 0000000..bfda79c
--- /dev/null
+++ b/adns-0.6/regress/case-abbrevto.out
@@ -0,0 +1,32 @@
+adns debug: using nameserver 172.18.45.36
+greenend.org.uk flags 0 type 1 A(-) submitted
+greenend.org.uk flags 0 type 2 NS(raw) submitted
+greenend.org.uk flags 0 type 5 CNAME(-) submitted
+greenend.org.uk flags 0 type 6 SOA(raw) submitted
+greenend.org.uk flags 0 type 12 PTR(raw) submitted
+greenend.org.uk flags 0 type 13 HINFO(-) submitted
+greenend.org.uk flags 0 type 15 MX(raw) submitted
+greenend.org.uk flags 0 type 16 TXT(-) submitted
+greenend.org.uk flags 0 type 17 RP(raw) submitted
+greenend.org.uk flags 0 type 65537 A(addr) submitted
+greenend.org.uk flags 0 type 65538 NS(+addr) submitted
+greenend.org.uk flags 0 type 65548 PTR(checked) submitted
+greenend.org.uk flags 0 type 65551 MX(+addr) submitted
+greenend.org.uk flags 0 type 131078 SOA(822) submitted
+greenend.org.uk flags 0 type 131089 RP(822) submitted
+greenend.org.uk flags 0 type A(-) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type NS(raw) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type CNAME(-) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type SOA(raw) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type PTR(raw) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type HINFO(-) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type MX(raw) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type TXT(-) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type RP(raw) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type A(addr) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type NS(+addr) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type PTR(checked) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type MX(+addr) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type SOA(822) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+greenend.org.uk flags 0 type RP(822) ownflags=a: timeout; nrrs=0; cname=$; owner=$; ttl=604770
+rc=0
diff --git a/adns-0.6/regress/case-abbrevto.sys b/adns-0.6/regress/case-abbrevto.sys
new file mode 100644
index 0000000..3cfbcbf
--- /dev/null
+++ b/adns-0.6/regress/case-abbrevto.sys
@@ -0,0 +1,1236 @@
+noserver
+,a/greenend.org.uk
+ start 929580082.699581
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000192
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000084
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000062
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.014155
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000420
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000322
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000322
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000320
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000366
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000324
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000318
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000319
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000319
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000319
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000319
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000319
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000343
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000399
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.981116
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-18933
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000049
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010028
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000363
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.003813
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009575
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000291
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000277
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000302
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000271
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000270
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000271
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000270
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000293
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000271
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000271
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.986185
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-14326
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000511
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009965
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000386
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000098
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009616
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000285
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000279
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000271
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000298
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000271
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000275
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.986134
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-14145
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000279
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009905
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000427
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000318
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000283
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000280
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000278
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000315
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000277
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000276
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000318
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000274
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999573
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04960
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000541
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009952
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000430
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000310
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000309
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000278
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000276
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000294
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000277
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000275
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.995632
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04751
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000383
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009901
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000339
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000280
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000323
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000317
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000274
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.995734
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04720
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000454
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009970
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000393
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000303
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000276
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000297
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000297
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.995695
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04679
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000374
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009892
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000323
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000280
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000276
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000307
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000301
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000273
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.995776
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04674
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000450
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009968
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000368
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000305
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000307
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000314
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000321
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000279
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000276
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000277
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000274
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.995636
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04747
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000383
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009901
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000324
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000306
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000276
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000297
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000273
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.995790
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04665
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000455
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009985
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000387
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000305
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000277
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000300
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000278
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000276
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000301
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.995681
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04719
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000400
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009906
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000320
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000279
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000319
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000277
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000278
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000300
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000275
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.995757
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04698
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000455
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009982
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000385
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000304
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000306
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000281
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000276
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000294
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000274
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.995688
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04700
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000388
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009990
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000328
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000309
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000277
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000302
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000277
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000273
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.995768
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04700
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000468
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009893
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000368
+ sendto fd=4 addr=172.18.45.36:53
+ 31200100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000302
+ sendto fd=4 addr=172.18.45.36:53
+ 31210100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000500
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 31220100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000276
+ sendto fd=4 addr=172.18.45.36:53
+ 31230100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31240100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000d00
+ 01.
+ sendto=33
+ +0.000275
+ sendto fd=4 addr=172.18.45.36:53
+ 31250100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000321
+ sendto fd=4 addr=172.18.45.36:53
+ 31260100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001000
+ 01.
+ sendto=33
+ +0.000276
+ sendto fd=4 addr=172.18.45.36:53
+ 31270100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31280100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000100
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 31290100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000200
+ 01.
+ sendto=33
+ +0.000273
+ sendto fd=4 addr=172.18.45.36:53
+ 312a0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000c00
+ 01.
+ sendto=33
+ +0.000272
+ sendto fd=4 addr=172.18.45.36:53
+ 312b0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=33
+ +0.000274
+ sendto fd=4 addr=172.18.45.36:53
+ 312c0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00000600
+ 01.
+ sendto=33
+ +0.000296
+ sendto fd=4 addr=172.18.45.36:53
+ 312d0100 00010000 00000000 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=33
+ +0.000277
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.995699
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04687
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000386
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009894
+ close fd=4
+ close=OK
+ +0.000779
diff --git a/adns-0.6/regress/case-brokenmail.err b/adns-0.6/regress/case-brokenmail.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-brokenmail.err
diff --git a/adns-0.6/regress/case-brokenmail.out b/adns-0.6/regress/case-brokenmail.out
new file mode 100644
index 0000000..14757ba
--- /dev/null
+++ b/adns-0.6/regress/case-brokenmail.out
@@ -0,0 +1,38 @@
+adns debug: using nameserver 172.18.45.6
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 0 type 15 MX(raw) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 0 type 65551 MX(+addr) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 256 type 15 MX(raw) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 256 type 65551 MX(+addr) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 260 type 15 MX(raw) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 260 type 65551 MX(+addr) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 0 type MX(raw): OK; nrrs=4; cname=$; owner=$; ttl=60
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk
+ 30 172.18.45.36
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 256 type MX(raw): OK; nrrs=4; cname=$; owner=$; ttl=60
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk
+ 30 172.18.45.36
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 260 type MX(raw): OK; nrrs=4; cname=$; owner=broken-mail.test.iwj.relativity.greenend.org.uk; ttl=60
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk
+ 30 172.18.45.36
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 0 type MX(+addr): OK; nrrs=4; cname=$; owner=$; ttl=30
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk ok 0 ok "OK" ( INET 127.0.0.1 INET 172.18.45.6 INET 172.18.45.1 INET 172.18.45.35 )
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk remotefail 30 timeout "DNS query timed out" ?
+ 30 172.18.45.36 permfail 300 nxdomain "No such domain" ( )
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk misconfig 101 prohibitedcname "DNS alias found where canonical name wanted" ( )
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 256 type MX(+addr): OK; nrrs=4; cname=$; owner=$; ttl=30
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk ok 0 ok "OK" ( INET 127.0.0.1 INET 172.18.45.6 INET 172.18.45.1 INET 172.18.45.35 )
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk remotefail 30 timeout "DNS query timed out" ?
+ 30 172.18.45.36 permfail 300 nxdomain "No such domain" ( )
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk ok 0 ok "OK" ( INET 172.18.45.37 )
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 260 type MX(+addr): OK; nrrs=4; cname=$; owner=broken-mail.test.iwj.relativity.greenend.org.uk; ttl=30
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk ok 0 ok "OK" ( INET 127.0.0.1 INET 172.18.45.6 INET 172.18.45.1 INET 172.18.45.35 )
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk remotefail 30 timeout "DNS query timed out" ?
+ 30 172.18.45.36 permfail 300 nxdomain "No such domain" ( )
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk ok 0 ok "OK" ( INET 172.18.45.37 )
+rc=0
diff --git a/adns-0.6/regress/case-brokenmail.sys b/adns-0.6/regress/case-brokenmail.sys
new file mode 100644
index 0000000..9514d6b
--- /dev/null
+++ b/adns-0.6/regress/case-brokenmail.sys
@@ -0,0 +1,516 @@
+default
+:15,65551 broken-mail.test.iwj.relativity.greenend.org.uk. 256/broken-mail.test.iwj.relativity.greenend.org.uk. 0x104/broken-mail.test.iwj.relativity.greenend.org.uk.
+ start 934726868.117908
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000425
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000059
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000043
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=65
+ +0.001836
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=65
+ +0.002502
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=65
+ +0.001986
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=65
+ +0.002269
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=65
+ +0.001950
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01.
+ sendto=65
+ +0.001914
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.987543
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000654
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01c00c00 0f000100 00003c00 38001404 686f7374 0b62726f 6b656e2d 64656c67
+ 04746573 74036977 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72
+ 6702756b 00c00c00 0f000100 00003c00 10001e03 31373202 31380234 35023336
+ 00c00c00 0f000100 00003c00 0e002809 636e616d 652d7074 72c060c0 0c000f00
+ 01000000 3c000e00 0a096d61 6e796164 647273c0 60c06000 02000100 00003c00
+ 06036e73 30c069c0 c9000100 01000000 3c0004ac 122d23c0 c9000100 01000000
+ 3c0004ac 122d06c0 c9000100 01000000 3c0004ac 122d01c0 c9000100 01000000
+ 3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001320
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01c00c00 0f000100 00003c00 10001e03 31373202 31380234 35023336 00c00c00
+ 0f000100 00003c00 31002809 636e616d 652d7074 72047465 73740369 776a0a72
+ 656c6174 69766974 79086772 65656e65 6e64036f 72670275 6b00c00c 000f0001
+ 0000003c 000e000a 096d616e 79616464 7273c075 c00c000f 00010000 003c0015
+ 00140468 6f73740b 62726f6b 656e2d64 656c67c0 75c07500 02000100 00003c00
+ 06036e73 30c07ec0 a8000100 01000000 3c0004ac 122d23c0 a8000100 01000000
+ 3c0004ac 122d06c0 a8000100 01000000 3c0004ac 122d01c0 a8000100 01000000
+ 3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001688
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ sendto=30
+ +0.000653
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 09636e61 6d652d70 74720474 65737403 69776a0a
+ 72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=63
+ +0.000825
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.001147
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01c00c00 0f000100 00003c00 31002809 636e616d 652d7074 72047465 73740369
+ 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275 6b00c00c
+ 000f0001 0000003c 000e000a 096d616e 79616464 7273c059 c00c000f 00010000
+ 003c0015 00140468 6f73740b 62726f6b 656e2d64 656c67c0 59c00c00 0f000100
+ 00003c00 10001e03 31373202 31380234 35023336 00c05900 02000100 00003c00
+ 06036e73 30c062c0 8c000100 01000000 3c0004ac 122d23c0 8c000100 01000000
+ 3c0004ac 122d06c0 8c000100 01000000 3c0004ac 122d01c0 8c000100 01000000
+ 3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001330
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01c00c00 0f000100 00003c00 31000a09 6d616e79 61646472 73047465 73740369
+ 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275 6b00c00c
+ 000f0001 0000003c 00150014 04686f73 740b6272 6f6b656e 2d64656c 67c059c0
+ 0c000f00 01000000 3c001000 1e033137 32023138 02343502 333600c0 0c000f00
+ 01000000 3c000e00 2809636e 616d652d 707472c0 59c05900 02000100 00003c00
+ 06036e73 30c062c0 4f000100 01000000 3c0004ac 122d23c0 4f000100 01000000
+ 3c0004ac 122d06c0 4f000100 01000000 3c0004ac 122d01c0 4f000100 01000000
+ 3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001524
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.001003
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ sendto=30
+ +0.000569
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 09636e61 6d652d70 74720474 65737403 69776a0a
+ 72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=63
+ +0.000842
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01c00c00 0f000100 00003c00 38001404 686f7374 0b62726f 6b656e2d 64656c67
+ 04746573 74036977 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72
+ 6702756b 00c00c00 0f000100 00003c00 10001e03 31373202 31380234 35023336
+ 00c00c00 0f000100 00003c00 0e002809 636e616d 652d7074 72c060c0 0c000f00
+ 01000000 3c000e00 0a096d61 6e796164 647273c0 60c06000 02000100 00003c00
+ 06036e73 30c069c0 c9000100 01000000 3c0004ac 122d23c0 c9000100 01000000
+ 3c0004ac 122d06c0 c9000100 01000000 3c0004ac 122d01c0 c9000100 01000000
+ 3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001306
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+ 01c00c00 0f000100 00003c00 10001e03 31373202 31380234 35023336 00c00c00
+ 0f000100 00003c00 31002809 636e616d 652d7074 72047465 73740369 776a0a72
+ 656c6174 69766974 79086772 65656e65 6e64036f 72670275 6b00c00c 000f0001
+ 0000003c 000e000a 096d616e 79616464 7273c075 c00c000f 00010000 003c0015
+ 00140468 6f73740b 62726f6b 656e2d64 656c67c0 75c07500 02000100 00003c00
+ 06036e73 30c07ec0 a8000100 01000000 3c0004ac 122d23c0 a8000100 01000000
+ 3c0004ac 122d06c0 a8000100 01000000 3c0004ac 122d01c0 a8000100 01000000
+ 3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001507
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ sendto=30
+ +0.000637
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 09636e61 6d652d70 74720474 65737403 69776a0a
+ 72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=63
+ +0.000932
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000931
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258583 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ +0.000242
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268580 00010002 00010001 09636e61 6d652d70 74720474 65737403 69776a0a
+ 72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001c0
+ 0c000500 01000000 3c002903 70747204 74657374 0369776a 0a72656c 61746976
+ 69747908 67726565 6e656e64 036f7267 02756b00 c04b0001 00010000 003c0004
+ ac122d25 c04f0002 00010000 003c0006 036e7330 c058c090 00010001 00015180
+ 0004ac12 2d06.
+ +0.000737
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298583 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ +0.000223
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8580 00010002 00010001 09636e61 6d652d70 74720474 65737403 69776a0a
+ 72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001c0
+ 0c000500 01000000 3c002903 70747204 74657374 0369776a 0a72656c 61746976
+ 69747908 67726565 6e656e64 036f7267 02756b00 c04b0001 00010000 003c0004
+ ac122d25 c04f0002 00010000 003c0006 036e7330 c058c090 00010001 00015180
+ 0004ac12 2d06.
+ +0.000756
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8583 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ +0.000291
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8580 00010002 00010001 09636e61 6d652d70 74720474 65737403 69776a0a
+ 72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001c0
+ 0c000500 01000000 3c002903 70747204 74657374 0369776a 0a72656c 61746976
+ 69747908 67726565 6e656e64 036f7267 02756b00 c04b0001 00010000 003c0004
+ ac122d25 c04f0002 00010000 003c0006 036e7330 c058c090 00010001 00015180
+ 0004ac12 2d06.
+ +0.000726
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000162
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.980649
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04341
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000794
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000608
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000695
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997903
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007910
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000823
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000611
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000571
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997995
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007991
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000694
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000579
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000571
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998156
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008157
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000655
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000749
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000606
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997990
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007995
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000836
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000612
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000631
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997921
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007925
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000699
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000725
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000606
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997970
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007965
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000739
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000582
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000570
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998109
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008104
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000641
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000598
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000716
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998045
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008043
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000646
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000576
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000594
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998184
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008190
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000673
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000578
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000572
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998177
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008168
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000659
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000577
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000571
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998193
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008199
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000653
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000604
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000573
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998170
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008181
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000699
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000589
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000758
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997954
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008126
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000684
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000582
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+ 73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+ 6b000001 0001.
+ sendto=70
+ +0.000578
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998156
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007969
+ close fd=4
+ close=OK
+ +0.000812
diff --git a/adns-0.6/regress/case-child.err b/adns-0.6/regress/case-child.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-child.err
diff --git a/adns-0.6/regress/case-child.out b/adns-0.6/regress/case-child.out
new file mode 100644
index 0000000..6c0b673
--- /dev/null
+++ b/adns-0.6/regress/case-child.out
@@ -0,0 +1,5 @@
+adns debug: using nameserver 172.18.45.6
+134.76.224.195.in-addr.arpa flags 0 type 65548 PTR(checked) submitted
+134.76.224.195.in-addr.arpa flags 0 type PTR(checked): OK; nrrs=1; cname=$; owner=$; ttl=78694
+ permutation-city.greenend.org.uk
+rc=0
diff --git a/adns-0.6/regress/case-child.sys b/adns-0.6/regress/case-child.sys
new file mode 100644
index 0000000..0cd1079
--- /dev/null
+++ b/adns-0.6/regress/case-child.sys
@@ -0,0 +1,58 @@
+default
+:65548 134.76.224.195.in-addr.arpa
+ start 929574747.401802
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000189
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000080
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000058
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 03313334 02373603 32323403 31393507 696e2d61
+ 64647204 61727061 00000c00 01.
+ sendto=45
+ +0.000595
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999405
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.008975
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010001 00050005 03313334 02373603 32323403 31393507 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 01336600 22107065 726d7574
+ 6174696f 6e2d6369 74790867 7265656e 656e6403 6f726702 756b0002 37360332
+ 32340331 39350769 6e2d6164 64720461 72706100 00020001 00013366 00110464
+ 6e733006 656c6d61 696c0263 6fc057c0 5b000200 01000133 66000704 646e7331
+ c083c05b 00020001 00013366 00070464 6e7332c0 83c05b00 02000100 01336600
+ 0e036e73 32047861 7261036e 657400c0 5b000200 01000133 66000603 6e7333c0
+ c5c07e00 01000100 00149d00 04c17ae9 11c09b00 01000100 00149d00 04c17ae9
+ 01c0ae00 01000100 00149d00 04c3e04c c1c0c100 01000100 0284e500 04c28fa1
+ 6bc0db00 01000100 0284e500 04c28fa3 19.
+ +0.001671
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 10706572 6d757461 74696f6e 2d636974 79086772
+ 65656e65 6e64036f 72670275 6b000001 0001.
+ sendto=50
+ +0.000683
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000108
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997538
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005811
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208580 00010001 00020002 10706572 6d757461 74696f6e 2d636974 79086772
+ 65656e65 6e64036f 72670275 6b000001 0001c00c 00010001 00015180 0004c3e0
+ 4c860867 7265656e 656e6403 6f726702 756b0000 02000100 01518000 11036e73
+ 300a7265 6c617469 76697479 c042c042 00020001 00015180 0006036e 7331c061
+ c05d0001 00010001 51800004 ac122d06 c07a0001 00010001 51800004 ac122d41.
+ +0.000862
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000193
+ close fd=4
+ close=OK
+ +0.000207
diff --git a/adns-0.6/regress/case-cnametocname.err b/adns-0.6/regress/case-cnametocname.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-cnametocname.err
diff --git a/adns-0.6/regress/case-cnametocname.out b/adns-0.6/regress/case-cnametocname.out
new file mode 100644
index 0000000..6d60fb2
--- /dev/null
+++ b/adns-0.6/regress/case-cnametocname.out
@@ -0,0 +1,5 @@
+adns debug: using nameserver 172.18.45.6
+intel.ugcs.caltech.edu. flags 0 type 1 A(-) submitted
+adns debug: allegedly canonical name ugintel.best.ugcs.caltech.edu is actually alias for drachma.ugcs.caltech.edu (QNAME=intel.ugcs.caltech.edu, QTYPE=A, NS=172.18.45.6)
+intel.ugcs.caltech.edu. flags 0 type A(-): DNS alias found where canonical name wanted; nrrs=0; cname=ugintel.best.ugcs.caltech.edu; owner=$; ttl=497758
+rc=0
diff --git a/adns-0.6/regress/case-cnametocname.sys b/adns-0.6/regress/case-cnametocname.sys
new file mode 100644
index 0000000..97f2156
--- /dev/null
+++ b/adns-0.6/regress/case-cnametocname.sys
@@ -0,0 +1,39 @@
+default
+:1 intel.ugcs.caltech.edu.
+ start 938369896.279735
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000179
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000054
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000041
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 05696e74 656c0475 67637307 63616c74 65636803
+ 65647500 00010001.
+ sendto=40
+ +0.001628
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998372
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.586476
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010003 00050005 05696e74 656c0475 67637307 63616c74 65636803
+ 65647500 00010001 05696e74 656c0475 67637307 63616c74 65636803 65647500
+ 00050001 0007985e 000f0775 67696e74 656c0462 657374c0 2ec04a00 05000100
+ 00000a00 0a076472 6163686d 61c02ec0 65000100 01000798 83000483 d72bacc0
+ 2e000200 01000935 be000b08 70757263 68617365 c02ec02e 00020001 000935be
+ 00070465 6e7679c0 2ec02e00 02000100 0935be00 09036f66 62036e65 7400c02e
+ 00020001 000935be 00090674 7962616c 74c033c0 2e000200 01000935 be000e08
+ 6d657263 7574696f 026e69c0 33c08b00 01000100 0935be00 0483d72b a7c0a200
+ 01000100 0935be00 0483d72b 87c0b500 01000100 001ef800 04c6b4b6 07c0ca00
+ 01000100 0100d700 0483d78b 64c0df00 01000100 0100d700 0483d7fe 63.
+ +0.001423
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000646
+ close fd=4
+ close=OK
+ +0.000242
diff --git a/adns-0.6/regress/case-datapluscname.err b/adns-0.6/regress/case-datapluscname.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-datapluscname.err
diff --git a/adns-0.6/regress/case-datapluscname.out b/adns-0.6/regress/case-datapluscname.out
new file mode 100644
index 0000000..d5b36af
--- /dev/null
+++ b/adns-0.6/regress/case-datapluscname.out
@@ -0,0 +1,39 @@
+adns debug: using nameserver 172.18.45.6
+170.99.219.194.in-addr.arpa flags 292 type 1 A(-) submitted
+170.99.219.194.in-addr.arpa flags 292 type 2 NS(raw) submitted
+170.99.219.194.in-addr.arpa flags 292 type 5 CNAME(-) submitted
+170.99.219.194.in-addr.arpa flags 292 type 6 SOA(raw) submitted
+170.99.219.194.in-addr.arpa flags 292 type 12 PTR(raw) submitted
+170.99.219.194.in-addr.arpa flags 292 type 13 HINFO(-) submitted
+170.99.219.194.in-addr.arpa flags 292 type 15 MX(raw) submitted
+170.99.219.194.in-addr.arpa flags 292 type 16 TXT(-) submitted
+170.99.219.194.in-addr.arpa flags 292 type 17 RP(raw) submitted
+170.99.219.194.in-addr.arpa flags 292 type 65537 A(addr) submitted
+170.99.219.194.in-addr.arpa flags 292 type 65538 NS(+addr) submitted
+170.99.219.194.in-addr.arpa flags 292 type 65548 PTR(checked) submitted
+170.99.219.194.in-addr.arpa flags 292 type 65551 MX(+addr) submitted
+170.99.219.194.in-addr.arpa flags 292 type 131078 SOA(822) submitted
+170.99.219.194.in-addr.arpa flags 292 type 131089 RP(822) submitted
+adns debug: ignoring CNAME (to 170.168.99.219.194.in-addr.arpa) coexisting with RR (QNAME=170.99.219.194.in-addr.arpa, QTYPE=PTR(raw), NS=172.18.45.6)
+adns debug: ignoring RR with an unexpected owner 170.168.99.219.194.in-addr.arpa (QNAME=170.99.219.194.in-addr.arpa, QTYPE=PTR(raw), NS=172.18.45.6)
+adns debug: ignoring CNAME (to 170.168.99.219.194.in-addr.arpa) coexisting with RR (QNAME=170.99.219.194.in-addr.arpa, QTYPE=PTR(checked), NS=172.18.45.6)
+adns debug: ignoring RR with an unexpected owner 170.168.99.219.194.in-addr.arpa (QNAME=170.99.219.194.in-addr.arpa, QTYPE=PTR(checked), NS=172.18.45.6)
+170.99.219.194.in-addr.arpa flags 292 type A(-): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type NS(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type SOA(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type PTR(raw): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=171727
+ proxy.scoplife.gr
+170.99.219.194.in-addr.arpa flags 292 type HINFO(-): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type MX(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type TXT(-): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type RP(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type A(addr): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type NS(+addr): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type MX(+addr): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type SOA(822): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type RP(822): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type PTR(checked): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=171727
+ proxy.scoplife.gr
+170.99.219.194.in-addr.arpa flags 292 type CNAME(-): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=171726
+ 170.168.99.219.194.in-addr.arpa
+rc=0
diff --git a/adns-0.6/regress/case-datapluscname.sys b/adns-0.6/regress/case-datapluscname.sys
new file mode 100644
index 0000000..e164b53
--- /dev/null
+++ b/adns-0.6/regress/case-datapluscname.sys
@@ -0,0 +1,233 @@
+default
+292/170.99.219.194.in-addr.arpa
+ start 933809668.543946
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000199
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000081
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000063
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.003027
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.002832
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.004403
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.004763
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000c00 01.
+ sendto=45
+ +0.002558
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000d00 01.
+ sendto=45
+ +0.004339
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.002664
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001000 01.
+ sendto=45
+ +0.004889
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.002642
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.002552
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.007571
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000c00 01.
+ sendto=45
+ +0.004820
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.004771
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.004879
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.004728
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.938562
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000329
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000688
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.003135
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000762
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238180 00010003 00040004 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 029ecf00 13057072 6f787908
+ 73636f70 6c696665 02677200 c00c0005 00010002 a2ec0021 03313730 03313638
+ 02393903 32313903 31393407 696e2d61 64647204 61727061 00c05800 0c000100
+ 029ecf00 02c039c0 5c000200 0100029e cf001004 696e666f 08666f72 74686e65
+ 74c048c0 5c000200 0100029e cf000805 6e736865 72c098c0 5c000200 0100029e
+ cf000805 6e737468 65c098c0 5c000200 0100029e cf000c09 74656972 65736961
+ 73c098c0 93000100 010004be 3900048b 5b0111c0 af000100 01000542 ba0004c1
+ 5c1e13c0 c3000100 01000542 800004c1 5c6e01c0 d7000100 01000542 800004c2
+ dbe302.
+ +0.001873
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000d00 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000969
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000699
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001000 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000717
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.003514
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000783
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.003279
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8180 00010003 00040004 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 029ecf00 13057072 6f787908
+ 73636f70 6c696665 02677200 c00c0005 00010002 a2ec0021 03313730 03313638
+ 02393903 32313903 31393407 696e2d61 64647204 61727061 00c05800 0c000100
+ 029ecf00 02c039c0 5c000200 0100029e cf001004 696e666f 08666f72 74686e65
+ 74c048c0 5c000200 0100029e cf000805 6e736865 72c098c0 5c000200 0100029e
+ cf000805 6e737468 65c098c0 5c000200 0100029e cf000c09 74656972 65736961
+ 73c098c0 93000100 010004be 3900048b 5b0111c0 af000100 01000542 ba0004c1
+ 5c1e13c0 c3000100 01000542 800004c1 5c6e01c0 d7000100 01000542 800004c2
+ dbe302.
+ +0.001960
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 0570726f 78790873 636f706c 69666502 67720000
+ 010001.
+ sendto=35
+ +0.005061
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.003253
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000782
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01c00c00 05000100 02a2ec00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000698
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000173
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.915746
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.014046
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312e8180 00010001 00040004 0570726f 78790873 636f706c 69666502 67720000
+ 010001c0 0c000100 01000288 220004c2 db63aa08 73636f70 6c696665 02677200
+ 00020001 000542ba 0011056e 73617468 08666f72 74686e65 74c03cc0 33000200
+ 01000542 ba000805 6e736865 72c050c0 33000200 01000542 ba000805 6e737468
+ 65c050c0 33000200 01000542 ba000c09 74656972 65736961 73c050c0 4a000100
+ 01000542 800004c1 5c9603c0 67000100 01000542 ba0004c1 5c1e13c0 7b000100
+ 01000542 800004c1 5c6e01c0 8f000100 01000542 800004c2 dbe302.
+ +0.001422
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000197
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.900081
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.203705
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218180 00010001 00050005 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01c00c00 05000100 029ece00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100c041 00020001
+ 00029ece 00120469 6e666f08 666f7274 686e6574 02677200 c0410002 00010002
+ 9ece0008 056e7368 6572c06b c0410002 00010002 9ece0008 056e7374 6865c06b
+ c0410002 00010002 9ece0008 056e7361 7468c06b c0410002 00010002 9ece000c
+ 09746569 72657369 6173c06b c0660001 00010005 41ce0004 8b5b0111 c0840001
+ 00010005 42b90004 c15c1e13 c0980001 00010005 427f0004 c15c6e01 c0ac0001
+ 00010005 427f0004 c15c9603 c0c00001 00010005 427f0004 c2dbe302.
+ +0.001798
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000249
+ close fd=4
+ close=OK
+ +0.000219
diff --git a/adns-0.6/regress/case-datapluscnamewait.err b/adns-0.6/regress/case-datapluscnamewait.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-datapluscnamewait.err
diff --git a/adns-0.6/regress/case-datapluscnamewait.out b/adns-0.6/regress/case-datapluscnamewait.out
new file mode 100644
index 0000000..18508a2
--- /dev/null
+++ b/adns-0.6/regress/case-datapluscnamewait.out
@@ -0,0 +1,78 @@
+adns debug: using nameserver 172.18.45.6
+170.99.219.194.in-addr.arpa flags 292 type 1 A(-) submitted
+170.99.219.194.in-addr.arpa flags 292 type 2 NS(raw) submitted
+170.99.219.194.in-addr.arpa flags 292 type 5 CNAME(-) submitted
+170.99.219.194.in-addr.arpa flags 292 type 6 SOA(raw) submitted
+170.99.219.194.in-addr.arpa flags 292 type 12 PTR(raw) submitted
+170.99.219.194.in-addr.arpa flags 292 type 13 HINFO(-) submitted
+170.99.219.194.in-addr.arpa flags 292 type 15 MX(raw) submitted
+170.99.219.194.in-addr.arpa flags 292 type 16 TXT(-) submitted
+170.99.219.194.in-addr.arpa flags 292 type 17 RP(raw) submitted
+170.99.219.194.in-addr.arpa flags 292 type 65537 A(addr) submitted
+170.99.219.194.in-addr.arpa flags 292 type 65538 NS(+addr) submitted
+170.99.219.194.in-addr.arpa flags 292 type 65548 PTR(checked) submitted
+170.99.219.194.in-addr.arpa flags 292 type 65551 MX(+addr) submitted
+170.99.219.194.in-addr.arpa flags 292 type 131078 SOA(822) submitted
+170.99.219.194.in-addr.arpa flags 292 type 131089 RP(822) submitted
+adns debug: ignoring CNAME (to 170.168.99.219.194.in-addr.arpa) coexisting with RR (QNAME=170.99.219.194.in-addr.arpa, QTYPE=PTR(raw), NS=172.18.45.6)
+adns debug: ignoring RR with an unexpected owner 170.168.99.219.194.in-addr.arpa (QNAME=170.99.219.194.in-addr.arpa, QTYPE=PTR(raw), NS=172.18.45.6)
+adns debug: ignoring CNAME (to 170.168.99.219.194.in-addr.arpa) coexisting with RR (QNAME=170.99.219.194.in-addr.arpa, QTYPE=PTR(checked), NS=172.18.45.6)
+adns debug: ignoring RR with an unexpected owner 170.168.99.219.194.in-addr.arpa (QNAME=170.99.219.194.in-addr.arpa, QTYPE=PTR(checked), NS=172.18.45.6)
+170.99.219.194.in-addr.arpa flags 292 type PTR(raw): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=171763
+ proxy.scoplife.gr
+170.99.219.194.in-addr.arpa flags 292 type PTR(checked): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=171763
+ proxy.scoplife.gr
+170.99.219.194.in-addr.arpa flags 292 type A(-): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=600
+170.99.219.194.in-addr.arpa flags 292 type MX(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type RP(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type A(addr): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=600
+170.99.219.194.in-addr.arpa flags 292 type NS(+addr): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type MX(+addr): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+170.99.219.194.in-addr.arpa flags 292 type RP(822): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
+adns debug: reply not found, id 3120, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3122, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3124, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3126, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+170.99.219.194.in-addr.arpa flags 292 type NS(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=600
+170.99.219.194.in-addr.arpa flags 292 type SOA(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=600
+170.99.219.194.in-addr.arpa flags 292 type HINFO(-): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=600
+170.99.219.194.in-addr.arpa flags 292 type TXT(-): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=600
+170.99.219.194.in-addr.arpa flags 292 type SOA(822): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=599
+adns debug: reply not found, id 312d, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 312c, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 312b, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3129, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3128, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3127, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3126, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3125, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3124, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3122, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3120, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 311f, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 312d, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 312c, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 312b, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3129, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3128, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3127, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3126, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3125, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3124, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3122, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3120, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 311f, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 312b, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3129, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3128, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3127, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3126, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3125, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3124, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3122, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3120, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 311f, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 312c, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
+170.99.219.194.in-addr.arpa flags 292 type CNAME(-): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=110056
+ 170.168.99.219.194.in-addr.arpa
+rc=0
diff --git a/adns-0.6/regress/case-datapluscnamewait.sys b/adns-0.6/regress/case-datapluscnamewait.sys
new file mode 100644
index 0000000..9051916
--- /dev/null
+++ b/adns-0.6/regress/case-datapluscnamewait.sys
@@ -0,0 +1,1480 @@
+default
+292/170.99.219.194.in-addr.arpa
+ start 933809632.795174
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000201
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000083
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000062
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.005997
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.016139
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.006108
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.015626
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000c00 01.
+ sendto=45
+ +0.006041
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000d00 01.
+ sendto=45
+ +0.016937
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.005443
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001000 01.
+ sendto=45
+ +0.015782
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.006303
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.015591
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.006039
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000c00 01.
+ sendto=45
+ +0.017765
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.006116
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.015294
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.006158
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.838661
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000324
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238180 00010003 00040004 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 029ef300 13057072 6f787908
+ 73636f70 6c696665 02677200 c00c0005 00010002 9ef50021 03313730 03313638
+ 02393903 32313903 31393407 696e2d61 64647204 61727061 00c05800 0c000100
+ 029ef300 02c039c0 5c000200 0100029e f3001004 696e666f 08666f72 74686e65
+ 74c048c0 5c000200 0100029e f3000805 6e736865 72c098c0 5c000200 0100029e
+ f3000805 6e737468 65c098c0 5c000200 0100029e f3000c09 74656972 65736961
+ 73c098c0 93000100 010004be 5d00048b 5b0111c0 af000100 01000542 de0004c1
+ 5c1e13c0 c3000100 01000542 a40004c1 5c6e01c0 d7000100 01000542 a40004c2
+ dbe302.
+ +0.007330
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8180 00010003 00040004 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 029ef300 13057072 6f787908
+ 73636f70 6c696665 02677200 c00c0005 00010002 9ef50021 03313730 03313638
+ 02393903 32313903 31393407 696e2d61 64647204 61727061 00c05800 0c000100
+ 029ef300 02c039c0 5c000200 0100029e f3001004 696e666f 08666f72 74686e65
+ 74c048c0 5c000200 0100029e f3000805 6e736865 72c098c0 5c000200 0100029e
+ f3000805 6e737468 65c098c0 5c000200 0100029e f3000c09 74656972 65736961
+ 73c098c0 93000100 010004be 5d00048b 5b0111c0 af000100 01000542 de0004c1
+ 5c1e13c0 c3000100 01000542 a40004c1 5c6e01c0 d7000100 01000542 a40004c2
+ dbe302.
+ +0.002315
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 0570726f 78790873 636f706c 69666502 67720000
+ 010001.
+ sendto=35
+ +0.005642
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000159
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.822891
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.007207
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312e8180 00010001 00040004 0570726f 78790873 636f706c 69666502 67720000
+ 010001c0 0c000100 01000288 460004c2 db63aa08 73636f70 6c696665 02677200
+ 00020001 000542de 0011056e 73617468 08666f72 74686e65 74c03cc0 33000200
+ 01000542 de000805 6e736865 72c050c0 33000200 01000542 de000805 6e737468
+ 65c050c0 33000200 01000542 de000c09 74656972 65736961 73c050c0 4a000100
+ 01000542 a40004c1 5c9603c0 67000100 01000542 de0004c1 5c1e13c0 7b000100
+ 01000542 a40004c1 5c6e01c0 8f000100 01000542 a40004c2 dbe302.
+ +0.001427
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000219
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.814038
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-185431
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.001281
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.004185
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008703
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.001091
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.010530
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.018894
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.001185
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.001033
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.017193
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.017773
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000d00 01.
+ sendto=45
+ +0.001148
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.015209
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.018840
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.001149
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000663
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008852
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001000 01.
+ sendto=45
+ +0.001085
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.006508
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009065
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.001094
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.002652
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009275
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.001088
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.007880
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008377
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.001077
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.022230
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.028895
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.001155
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.001072
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.012518
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.017777
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.001095
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.838996
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-161506
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000502
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009962
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.001211
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.001067
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.019298
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.017752
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000479
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009982
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.001151
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.001038
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.008299
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008021
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000278
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009792
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000d00 01.
+ sendto=45
+ +0.001143
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009331
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008852
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000479
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009985
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.001184
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001000 01.
+ sendto=45
+ +0.001061
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009461
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.007976
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000424
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009931
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.001097
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.000765
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009230
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008502
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.000787
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.029148
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.028673
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000475
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009961
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.001131
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.001027
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.008360
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.007873
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000487
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009998
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.001092
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.838948
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-161498
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000446
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009968
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.001172
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.001037
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.018281
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.017811
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000470
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009988
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.001156
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.001034
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.008294
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.007805
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000489
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010003
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000d00 01.
+ sendto=45
+ +0.001162
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009304
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008831
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000473
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009990
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.001153
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001000 01.
+ sendto=45
+ +0.001036
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.008446
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.007809
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000637
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010143
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.001092
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.000740
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.000707
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.038447
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.037284
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000456
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009974
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.001135
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.001077
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.008299
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.007902
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000397
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010170
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.000771
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.839018
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-161432
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000450
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009951
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.000533
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.000467
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.019507
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.019027
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000480
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009995
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.000505
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.000453
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009525
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009036
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000489
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009993
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000d00 01.
+ sendto=45
+ +0.000504
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009975
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009493
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000482
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009994
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.000528
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001000 01.
+ sendto=45
+ +0.000454
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009647
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009014
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000633
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010175
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.000499
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.000450
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.000447
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.038859
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.038404
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000455
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009958
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.000474
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.000453
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009854
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009107
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000747
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010102
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.000502
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.839433
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-161012
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000445
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010011
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.000502
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.000455
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.019499
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.019014
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000485
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009983
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.000498
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.000458
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009533
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009049
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000484
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009996
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000d00 01.
+ sendto=45
+ +0.000500
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009979
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009494
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000485
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009996
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.000564
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001000 01.
+ sendto=45
+ +0.000452
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009644
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008982
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000662
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010145
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.000527
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.000453
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.000449
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.038846
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.038396
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000450
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009997
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.000504
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.000454
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009631
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009036
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000595
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010011
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.000494
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.839591
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-160907
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000498
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009988
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.000516
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.000455
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.019493
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005671
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010001 00010000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01c00c00 05000100 029ee900 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100c03d 00060001
+ 00000258 00380974 65697265 73696173 08666f72 74686e65 74026772 000a686f
+ 73746d61 73746572 c0707709 a5220000 54600000 0e100036 ee800002 a300.
+ +0.001103
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000252
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.012467
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.011997
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000470
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009991
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.000503
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.000454
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009523
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009039
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000484
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009993
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000d00 01.
+ sendto=45
+ +0.000596
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009885
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009400
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000485
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009995
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.000496
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001000 01.
+ sendto=45
+ +0.000452
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009685
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005326
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01c00c00 05000100 029ee900 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000679
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000223
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.003457
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.002820
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000637
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010141
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.000502
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01.
+ sendto=45
+ +0.000452
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.000445
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.038919
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004982
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01c00c00 05000100 029ee900 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000678
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000193
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.033066
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003845
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288180 00010001 00010000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000100 01c00c00 05000100 029ee900 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100c03d 00060001
+ 00000258 00380974 65697265 73696173 08666f72 74686e65 74026772 000a686f
+ 73746d61 73746572 c0707709 a5220000 54600000 0e100036 ee800002 a300.
+ +0.001064
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000234
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.027923
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002680
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01c00c00 05000100 029ee900 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000678
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000187
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.024378
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.023895
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000483
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009993
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01.
+ sendto=45
+ +0.000504
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.000448
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009543
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.008307
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000f00 01c00c00 05000100 029ee900 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000709
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000195
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000332
+ select=0 rfds=[] wfds=[] efds=[]
+ +1.-990116
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01.
+ sendto=45
+ +0.000501
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.839522
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.055562
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8180 00010001 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001100 01c00c00 05000100 029ee800 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100.
+ +0.000679
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000223
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.783058
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.111990
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000200 01.
+ +0.000458
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000171
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.670439
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.084620
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000600 01.
+ +0.000444
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000167
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.585208
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.105188
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000d00 01.
+ +0.000511
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000168
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.479341
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004276
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00001000 01.
+ +0.000441
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000162
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.474462
+ select=0 rfds=[] wfds=[] efds=[]
+ +1.473985
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000477
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009985
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01.
+ sendto=45
+ +0.000545
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.019932
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.019448
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000484
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004980
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.000489
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.000454
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 00010001 00010000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000200 01c00c00 05000100 02a30000 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100c03d 00060001
+ 00000258 00380974 65697265 73696173 08666f72 74686e65 74026772 000a686f
+ 73746d61 73746572 c0707709 a5220000 54600000 0e100036 ee800002 a300.
+ +0.001060
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000249
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.013241
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.007284
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228180 00010001 00010000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01c00c00 05000100 02a30000 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100c03d 00060001
+ 00000258 00380974 65697265 73696173 08666f72 74686e65 74026772 000a686f
+ 73746d61 73746572 c0707709 a5220000 54600000 0e100036 ee800002 a300.
+ +0.001134
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000207
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.004616
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.004131
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000485
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009996
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000d00 01.
+ sendto=45
+ +0.000510
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009970
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005957
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248180 00010001 00010000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000d00 01c00c00 05000100 02a30000 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100c03d 00060001
+ 00000258 00380974 65697265 73696173 08666f72 74686e65 74026772 000a686f
+ 73746d61 73746572 c0707709 a5220000 54600000 0e100036 ee800002 a300.
+ +0.001093
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000200
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.002720
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.002235
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000485
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009985
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001000 01.
+ sendto=45
+ +0.000495
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.059970
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.007581
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268180 00010001 00010000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00001000 01c00c00 05000100 02a30000 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100c03d 00060001
+ 00000258 00380974 65697265 73696173 08666f72 74686e65 74026772 000a686f
+ 73746d61 73746572 c0707709 a5220000 54600000 0e100036 ee800002 a300.
+ +0.001095
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000204
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.051090
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.050594
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000496
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010020
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01.
+ sendto=45
+ +0.000510
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.884517
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-971134
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010001 00010000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000600 01c00c00 05000100 02a2ff00 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100c03d 00060001
+ 00000257 00380974 65697265 73696173 08666f72 74686e65 74026772 000a686f
+ 73746d61 73746572 c0707709 a5220000 54600000 0e100036 ee800002 a300.
+ +0.001129
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000209
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.854313
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.294993
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00001100 01.
+ +0.000451
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000174
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.558695
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.012449
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000600 01.
+ +0.000443
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000195
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.545608
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.033254
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000f00 01.
+ +0.000442
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000165
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.511747
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.033698
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000200 01.
+ +0.000445
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000165
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.477439
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.087089
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000100 01.
+ +0.000475
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000165
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.389710
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.013746
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00001100 01.
+ +0.000440
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000165
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.375359
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019341
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00001000 01.
+ +0.000440
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000165
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.355413
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.027349
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000f00 01.
+ +0.000442
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000167
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.327455
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-481849
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000d00 01.
+ +0.000476
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000178
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.808650
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004046
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000600 01.
+ +0.000443
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000223
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.803938
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003854
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000200 01.
+ +0.000442
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000169
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.799473
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004099
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000100 01.
+ +0.000431
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000159
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.794784
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.799306
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.000587
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999413
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.089275
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00001100 01.
+ +0.000477
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000179
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.909482
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-954601
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000600 01.
+ +0.000444
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000166
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.863473
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.176995
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000f00 01.
+ +0.000520
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000236
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.685722
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.009094
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000200 01.
+ +0.000441
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000165
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.676022
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004004
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000100 01.
+ +0.000437
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000160
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.671421
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003792
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00001100 01.
+ +0.000441
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000189
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.666999
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.108860
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00001000 01.
+ +0.000450
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000164
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.557525
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.378539
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000f00 01.
+ +0.000446
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000165
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.178375
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.021040
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000d00 01.
+ +0.000485
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000162
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.156688
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004025
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000600 01.
+ +0.000434
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000160
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.152069
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003840
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000200 01.
+ +0.000436
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000160
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.147633
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.135825
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000100 01.
+ +0.000442
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000164
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.011202
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010716
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000486
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009980
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.000496
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999504
+ select=1 rfds=[4] wfds=[] efds=[]
+ +2.-383424
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000f00 01.
+ +0.000484
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000222
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.382222
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004359
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000200 01.
+ +0.000454
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000163
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.377246
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003697
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000100 01.
+ +0.000440
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000161
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.372948
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003846
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00001100 01.
+ +0.000439
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000191
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.368472
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.101004
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00001000 01.
+ +0.000442
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000163
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.266863
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004860
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000f00 01.
+ +0.000458
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000162
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.261383
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003486
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000d00 01.
+ +0.000436
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000207
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.257254
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005999
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000600 01.
+ +0.000444
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000163
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.250648
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003548
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000200 01.
+ +0.000437
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000159
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.246504
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003713
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000100 01.
+ +0.000464
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000161
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.242166
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.241706
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000460
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009972
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.000493
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999507
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-00956
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000463
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009960
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01.
+ sendto=45
+ +0.000477
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999523
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-273409
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010000 00000000 03313730 03313638 02393903 32313903 31393407
+ 696e2d61 64647204 61727061 00000600 01.
+ +0.000463
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000177
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.272292
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.110798
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218180 00010001 00050005 03313730 02393903 32313903 31393407 696e2d61
+ 64647204 61727061 00000500 01c00c00 05000100 01ade800 21033137 30033136
+ 38023939 03323139 03313934 07696e2d 61646472 04617270 6100c044 00020001
+ 0000bc71 00170974 65697265 73696173 08666f72 74686e65 74026772 00c04400
+ 02000100 00bc7100 0d026e73 04726970 65036e65 7400c044 00020001 0000bc71
+ 0008056e 73617468 c070c044 00020001 0000bc71 0008056e 73746865 c070c044
+ 00020001 0000bc71 0008056e 73686572 c070c066 00010001 00054576 0004c2db
+ e302c089 00010001 00029904 0004c100 00c1c0a2 00010001 0004c1d7 0004c15c
+ 9603c0b6 00010001 000484f0 0004c15c 6e01c0ca 00010001 00054600 0004c15c
+ 1e13.
+ +0.001965
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000301
+ close fd=4
+ close=OK
+ +0.000256
diff --git a/adns-0.6/regress/case-flags10.err b/adns-0.6/regress/case-flags10.err
new file mode 100644
index 0000000..e6c1c99
--- /dev/null
+++ b/adns-0.6/regress/case-flags10.err
@@ -0,0 +1 @@
+too many flags
diff --git a/adns-0.6/regress/case-flags10.out b/adns-0.6/regress/case-flags10.out
new file mode 100644
index 0000000..2f93975
--- /dev/null
+++ b/adns-0.6/regress/case-flags10.out
@@ -0,0 +1,2 @@
+adns debug: using nameserver 172.18.45.6
+rc=3
diff --git a/adns-0.6/regress/case-flags10.sys b/adns-0.6/regress/case-flags10.sys
new file mode 100644
index 0000000..c535edd
--- /dev/null
+++ b/adns-0.6/regress/case-flags10.sys
@@ -0,0 +1,15 @@
+default
+:1 ,aaaaaaaaaa/chiark.greenend.org.uk
+ start 929580072.670441
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000191
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000084
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000061
+ close fd=4
+ close=OK
+ +0.000001
diff --git a/adns-0.6/regress/case-flags9.err b/adns-0.6/regress/case-flags9.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-flags9.err
diff --git a/adns-0.6/regress/case-flags9.out b/adns-0.6/regress/case-flags9.out
new file mode 100644
index 0000000..679ba0d
--- /dev/null
+++ b/adns-0.6/regress/case-flags9.out
@@ -0,0 +1,5 @@
+adns debug: using nameserver 172.18.45.6
+chiark.greenend.org.uk flags 0 type 1 A(-) submitted
+chiark.greenend.org.uk flags 0 type A(-) ownflags=aaaaaaaaa: ok; nrrs=1; cname=$; owner=$; ttl=86400
+ 195.224.76.132
+rc=0
diff --git a/adns-0.6/regress/case-flags9.sys b/adns-0.6/regress/case-flags9.sys
new file mode 100644
index 0000000..94ac969
--- /dev/null
+++ b/adns-0.6/regress/case-flags9.sys
@@ -0,0 +1,34 @@
+default
+:1 ,aaaaaaaaa/chiark.greenend.org.uk
+ start 929580075.263215
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000212
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000083
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000060
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000625
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999375
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.007374
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+ 64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+ 7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+ 0004ac12 2d06c070 00010001 00015180 0004ac12 2d41.
+ +0.001238
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000228
+ close fd=4
+ close=OK
+ +0.000205
diff --git a/adns-0.6/regress/case-mailboxes.err b/adns-0.6/regress/case-mailboxes.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-mailboxes.err
diff --git a/adns-0.6/regress/case-mailboxes.out b/adns-0.6/regress/case-mailboxes.out
new file mode 100644
index 0000000..61d1757
--- /dev/null
+++ b/adns-0.6/regress/case-mailboxes.out
@@ -0,0 +1,10 @@
+adns debug: using nameserver 172.18.45.6
+silly-rp.test.iwj.relativity.greenend.org.uk flags 0 type 131089 RP(822) submitted
+silly-rp.test.iwj.relativity.greenend.org.uk flags 0 type RP(822): OK; nrrs=6; cname=$; owner=$; ttl=60
+ . .
+ i@ucam.org .
+ i.j@ucam.org .
+ "i..j"@ucam.org .
+ ".i"@ucam.org .
+ "i."@ucam.org .
+rc=0
diff --git a/adns-0.6/regress/case-mailboxes.sys b/adns-0.6/regress/case-mailboxes.sys
new file mode 100644
index 0000000..2144c05
--- /dev/null
+++ b/adns-0.6/regress/case-mailboxes.sys
@@ -0,0 +1,35 @@
+default
+:131089 silly-rp.test.iwj.relativity.greenend.org.uk
+ start 923859567.899146
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000411
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000094
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000073
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 0873696c 6c792d72 70047465 73740369 776a0a72
+ 656c6174 69766974 79086772 65656e65 6e64036f 72670275 6b000011 0001.
+ sendto=62
+ +0.000670
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999330
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.008169
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010006 00000000 0873696c 6c792d72 70047465 73740369 776a0a72
+ 656c6174 69766974 79086772 65656e65 6e64036f 72670275 6b000011 0001c00c
+ 00110001 0000003c 00020000 c00c0011 00010000 003c000d 01690475 63616d03
+ 6f726700 00c00c00 11000100 00003c00 0703692e 6ac05a00 c00c0011 00010000
+ 003c0008 04692e2e 6ac05a00 c00c0011 00010000 003c0006 022e69c0 5a00c00c
+ 00110001 0000003c 00060269 2ec05a00.
+ +0.000992
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000604
+ close fd=4
+ close=OK
+ +0.000359
diff --git a/adns-0.6/regress/case-manya.err b/adns-0.6/regress/case-manya.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-manya.err
diff --git a/adns-0.6/regress/case-manya.out b/adns-0.6/regress/case-manya.out
new file mode 100644
index 0000000..08cee50
--- /dev/null
+++ b/adns-0.6/regress/case-manya.out
@@ -0,0 +1,8 @@
+adns debug: using nameserver 172.18.45.6
+manyaddrs.test.iwj.relativity.greenend.org.uk flags 0 type 1 A(-) submitted
+manyaddrs.test.iwj.relativity.greenend.org.uk flags 0 type A(-): OK; nrrs=4; cname=$; owner=$; ttl=60
+ 127.0.0.1
+ 172.18.45.6
+ 172.18.45.1
+ 172.18.45.35
+rc=0
diff --git a/adns-0.6/regress/case-manya.sys b/adns-0.6/regress/case-manya.sys
new file mode 100644
index 0000000..8b560fa
--- /dev/null
+++ b/adns-0.6/regress/case-manya.sys
@@ -0,0 +1,36 @@
+default
+:1 manyaddrs.test.iwj.relativity.greenend.org.uk
+ start 912888920.123769
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000245
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000705
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000073
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 096d616e 79616464 72730474 65737403 69776a0a
+ 72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=63
+ +0.000698
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999302
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.006236
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010004 00010001 096d616e 79616464 72730474 65737403 69776a0a
+ 72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001c0
+ 0c000100 01000000 3c0004ac 122d23c0 0c000100 01000000 3c0004ac 122d06c0
+ 0c000100 01000000 3c0004ac 122d01c0 0c000100 01000000 3c00047f 00000104
+ 74657374 0369776a 0a72656c 61746976 69747908 67726565 6e656e64 036f7267
+ 02756b00 00020001 0000003c 0006036e 7330c088 c0ae0001 00010001 51800004
+ ac122d06.
+ +0.001078
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000329
+ close fd=4
+ close=OK
+ +0.000240
diff --git a/adns-0.6/regress/case-manyptrwrong.err b/adns-0.6/regress/case-manyptrwrong.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrong.err
diff --git a/adns-0.6/regress/case-manyptrwrong.out b/adns-0.6/regress/case-manyptrwrong.out
new file mode 100644
index 0000000..819a929
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrong.out
@@ -0,0 +1,153 @@
+adns debug: using nameserver 195.224.55.129
+254.0.99.203.in-addr.arpa flags 0 type 1 A(-) submitted
+254.0.99.203.in-addr.arpa flags 0 type 2 NS(raw) submitted
+254.0.99.203.in-addr.arpa flags 0 type 5 CNAME(-) submitted
+254.0.99.203.in-addr.arpa flags 0 type 6 SOA(raw) submitted
+254.0.99.203.in-addr.arpa flags 0 type 12 PTR(raw) submitted
+254.0.99.203.in-addr.arpa flags 0 type 13 HINFO(-) submitted
+254.0.99.203.in-addr.arpa flags 0 type 15 MX(raw) submitted
+254.0.99.203.in-addr.arpa flags 0 type 16 TXT(-) submitted
+254.0.99.203.in-addr.arpa flags 0 type 17 RP(raw) submitted
+254.0.99.203.in-addr.arpa flags 0 type 65537 A(addr) submitted
+254.0.99.203.in-addr.arpa flags 0 type 65538 NS(+addr) submitted
+254.0.99.203.in-addr.arpa flags 0 type 65548 PTR(checked) submitted
+254.0.99.203.in-addr.arpa flags 0 type 65551 MX(+addr) submitted
+254.0.99.203.in-addr.arpa flags 0 type 131078 SOA(822) submitted
+254.0.99.203.in-addr.arpa flags 0 type 131089 RP(822) submitted
+adns debug: TCP connected (NS=195.224.55.129)
+254.0.99.203.in-addr.arpa flags 0 type PTR(raw): OK; nrrs=94; cname=$; owner=$; ttl=80790
+ ns.security.co.nz
+ tetra.co.nz
+ mail.agate.co.nz
+ ns.agate.co.nz
+ securitytraining.co.nz
+ ns.giftbasket.co.nz
+ ns.security.gen.nz
+ bouquet.co.nz
+ investigation.co.nz
+ ns.nzipi.org.nz
+ mail.neru.co.nz
+ security.co.nz
+ ns.storewatch.co.nz
+ security.gen.nz
+ ns.tetra.co.nz
+ mail.tetra.co.nz
+ ns.securicard.co.nz
+ ns.underhour.co.nz
+ bcc.co.nz
+ security.org.nz
+ burglaralarms.co.nz
+ ns.safes.co.nz
+ ns.security.org.nz
+ couperconsulting.co.nz
+ securityguards.co.nz
+ ns.guards.co.nz
+ asis.org.nz
+ neru.co.nz
+ giftbasket.co.nz
+ magic.co.nz
+ mail.bcc.co.nz
+ ns.investigation.co.nz
+ nzipi.org.nz
+ ns.bouquet.co.nz
+ mail.safes.co.nz
+ ns.bcc.co.nz
+ ns.burglaralarms.co.nz
+ ns.securityguards.co.nz
+ covertcameras.co.nz
+ ns.neru.co.nz
+ ns.covertcameras.co.nz
+ bouquets.co.nz
+ concentric.co.nz
+ ns.securitytraining.co.nz
+ mail.couperconsulting.co.nz
+ retailsecurity.co.nz
+ ns.concentric.co.nz
+ mail.magic.co.nz
+ nzangling.co.nz
+ ns.couperconsulting.co.nz
+ ns.nzangling.co.nz
+ mail.storewatch.co.nz
+ swift.co.nz
+ mail.selective.co.nz
+ ns.forefront.co.nz
+ mail.nzangling.co.nz
+ guards.co.nz
+ mail.nzdesigns.co.nz
+ storewatch.co.nz
+ ns.securitymanagement.co.nz
+ mail.woolworths.co.nz
+ mail.concentric.co.nz
+ selective.co.nz
+ specialinvestigations.co.nz
+ ns.swift.co.nz
+ mail.swift.co.nz
+ ns.securenet.net.nz
+ privateinvestigation.co.nz
+ ns.privateinvestigation.co.nz
+ etrade.co.nz
+ ns.specialinvestigations.co.nz
+ mail.ansett.co.nz
+ ftp.warrent.co.nz
+ ns.retailsecurity.co.nz
+ mail.securitymanagement.co.nz
+ ns.magic.co.nz
+ mail.forefront.co.nz
+ mail.securicard.co.nz
+ securicard.co.nz
+ ns.nzdesigns.co.nz
+ safes.co.nz
+ ns.selective.co.nz
+ forefront.co.nz
+ securitymanagement.co.nz
+ underhour.co.nz
+ securenet.net.nz
+ mail.specialinvestigations.co.nz
+ nzdesigns.co.nz
+ ns.etrade.co.nz
+ mail.nzipi.org.nz
+ mail.underhour.co.nz
+ ns.asis.org.nz
+ ns.bouquets.co.nz
+ agate.co.nz
+adns debug: reply not found, id 313b, query owner security.gen.nz (NS=195.224.55.129)
+adns debug: reply not found, id 313c, query owner ns.tetra.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 313d, query owner mail.tetra.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 313e, query owner ns.securicard.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 313f, query owner ns.underhour.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3140, query owner bcc.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3141, query owner security.org.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3142, query owner burglaralarms.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3143, query owner ns.safes.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3144, query owner ns.security.org.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3145, query owner couperconsulting.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3146, query owner securityguards.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3147, query owner ns.guards.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3148, query owner asis.org.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3149, query owner neru.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 314a, query owner giftbasket.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 314b, query owner magic.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 314c, query owner mail.bcc.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 314d, query owner ns.investigation.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 314e, query owner nzipi.org.nz (NS=195.224.55.129)
+adns debug: reply not found, id 314f, query owner ns.bouquet.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3150, query owner mail.safes.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3151, query owner ns.bcc.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3152, query owner ns.burglaralarms.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 3153, query owner ns.securityguards.co.nz (NS=195.224.55.129)
+adns debug: reply not found, id 318b, query owner agate.co.nz (NS=195.224.55.129)
+254.0.99.203.in-addr.arpa flags 0 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=$; ttl=80790
+254.0.99.203.in-addr.arpa flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type NS(raw): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type SOA(raw): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type NS(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type SOA(822): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+254.0.99.203.in-addr.arpa flags 0 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+rc=0
diff --git a/adns-0.6/regress/case-manyptrwrong.sys b/adns-0.6/regress/case-manyptrwrong.sys
new file mode 100644
index 0000000..d5ef49b
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrong.sys
@@ -0,0 +1,1287 @@
+ncipher
+254.0.99.203.in-addr.arpa
+ start 933269010.293417
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000166
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000063
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000049
+ sendto fd=4 addr=195.224.55.129:53
+ 311f0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.000861
+ sendto fd=4 addr=195.224.55.129:53
+ 31200100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.000518
+ sendto fd=4 addr=195.224.55.129:53
+ 31210100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 050001.
+ sendto=43
+ +0.000511
+ sendto fd=4 addr=195.224.55.129:53
+ 31220100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.000533
+ sendto fd=4 addr=195.224.55.129:53
+ 31230100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000573
+ sendto fd=4 addr=195.224.55.129:53
+ 31240100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0d0001.
+ sendto=43
+ +0.000523
+ sendto fd=4 addr=195.224.55.129:53
+ 31250100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.000518
+ sendto fd=4 addr=195.224.55.129:53
+ 31260100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 100001.
+ sendto=43
+ +0.000544
+ sendto fd=4 addr=195.224.55.129:53
+ 31270100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.000509
+ sendto fd=4 addr=195.224.55.129:53
+ 31280100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.000543
+ sendto fd=4 addr=195.224.55.129:53
+ 31290100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.000528
+ sendto fd=4 addr=195.224.55.129:53
+ 312a0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000576
+ sendto fd=4 addr=195.224.55.129:53
+ 312b0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.000515
+ sendto fd=4 addr=195.224.55.129:53
+ 312c0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.000635
+ sendto fd=4 addr=195.224.55.129:53
+ 312d0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.000525
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.991588
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001474
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31238380 00010013 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 0100013b 96001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 00013b96 00080574 65747261 c043c00c
+ 000c0001 00013b96 000d046d 61696c05 61676174 65c043c0 0c000c00 0100013b
+ 96000502 6e73c06f c00c000c 00010001 3b960013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 0100013b 96001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 0100013b 96001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 013b9600 0a07626f 75717565 74c043c0 0c000c00 0100013b
+ 9600100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 0100013b 96000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 00013b96 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 00013b96 0002c03a c00c000c 00010001 3b960010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010001 3b960002 c0d2c00c
+ 000c0001 00013b96 0005026e 73c056c0 0c000c00 0100013b 96000704 6d61696c
+ c056c00c 000c0001 00013b96 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 00013b96 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 013b9600 06036263 63c043.
+ +0.001498
+ socket type=SOCK_STREAM
+ socket=5
+ +0.000954
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000053
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000047
+ connect fd=5 addr=195.224.55.129:53
+ connect=EINPROGRESS
+ +0.000195
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000071
+ select max=6 rfds=[4] wfds=[5] efds=[] to=1.987296
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.000949
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000147
+ write fd=5
+ 002b3123 01000001 00000000 00000332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.000532
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.985668
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.011715
+ read fd=5 buflen=2
+ read=OK
+ 097f.
+ +0.000186
+ read fd=5 buflen=2431
+ read=OK
+ 31238180 0001005e 00020002 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 0100013b 96001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 00013b96 00080574 65747261 c043c00c
+ 000c0001 00013b96 000d046d 61696c05 61676174 65c043c0 0c000c00 0100013b
+ 96000502 6e73c06f c00c000c 00010001 3b960013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 0100013b 96001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 0100013b 96001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 013b9600 0a07626f 75717565 74c043c0 0c000c00 0100013b
+ 9600100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 0100013b 96000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 00013b96 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 00013b96 0002c03a c00c000c 00010001 3b960010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010001 3b960002 c0d2c00c
+ 000c0001 00013b96 0005026e 73c056c0 0c000c00 0100013b 96000704 6d61696c
+ c056c00c 000c0001 00013b96 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 00013b96 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 013b9600 06036263 63c043c0 0c000c00 0100013b 96000b08 73656375 72697479
+ c128c00c 000c0001 00013b96 00100d62 7572676c 6172616c 61726d73 c043c00c
+ 000c0001 00013b96 000b026e 73057361 666573c0 43c00c00 0c000100 013b9600
+ 05026e73 c1f7c00c 000c0001 00013b96 00131063 6f757065 72636f6e 73756c74
+ 696e67c0 43c00c00 0c000100 013b9600 110e7365 63757269 74796775 61726473
+ c043c00c 000c0001 00013b96 000c026e 73066775 61726473 c043c00c 000c0001
+ 00013b96 00070461 736973c1 28c00c00 0c000100 013b9600 02c13fc0 0c000c00
+ 0100013b 960002c0 b6c00c00 0c000100 013b9600 08056d61 676963c0 43c00c00
+ 0c000100 013b9600 07046d61 696cc1e5 c00c000c 00010001 3b960005 026e73c1
+ 03c00c00 0c000100 013b9600 02c122c0 0c000c00 0100013b 96000502 6e73c0ed
+ c00c000c 00010001 3b960007 046d6169 6cc22dc0 0c000c00 0100013b 96000502
+ 6e73c1e5 c00c000c 00010001 3b960005 026e73c2 0ec00c00 0c000100 013b9600
+ 05026e73 c271c00c 000c0001 00013b96 00100d63 6f766572 7463616d 65726173
+ c043c00c 000c0001 00013b96 0005026e 73c13fc0 0c000c00 0100013b 96001302
+ 6e730d63 6f766572 7463616d 65726173 c043c00c 000c0001 00013b96 000b0862
+ 6f757175 657473c0 43c00c00 0c000100 013b9600 0d0a636f 6e63656e 74726963
+ c043c00c 000c0001 00013b96 0005026e 73c094c0 0c000c00 0100013b 96000704
+ 6d61696c c252c00c 000c0001 00013b96 00110e72 65746169 6c736563 75726974
+ 79c043c0 0c000c00 0100013b 96001002 6e730a63 6f6e6365 6e747269 63c043c0
+ 0c000c00 0100013b 96000d04 6d61696c 056d6167 6963c043 c00c000c 00010001
+ 3b96000c 096e7a61 6e676c69 6e67c043 c00c000c 00010001 3b960005 026e73c2
+ 52c00c00 0c000100 013b9600 0f026e73 096e7a61 6e676c69 6e67c043 c00c000c
+ 00010001 3b960007 046d6169 6cc163c0 0c000c00 0100013b 96000805 73776966
+ 74c043c0 0c000c00 0100013b 96001104 6d61696c 0973656c 65637469 7665c043
+ c00c000c 00010001 3b96000f 026e7309 666f7265 66726f6e 74c043c0 0c000c00
+ 0100013b 96001104 6d61696c 096e7a61 6e676c69 6e67c043 c00c000c 00010001
+ 3b960009 06677561 726473c0 43c00c00 0c000100 013b9600 11046d61 696c096e
+ 7a646573 69676e73 c043c00c 000c0001 00013b96 0002c163 c00c000c 00010001
+ 3b960018 026e7312 73656375 72697479 6d616e61 67656d65 6e74c043 c00c000c
+ 00010001 3b960012 046d6169 6c0a776f 6f6c776f 72746873 c043c00c 000c0001
+ 00013b96 0012046d 61696c0a 636f6e63 656e.
+ +0.003706
+ read fd=5 buflen=973
+ read=EAGAIN
+ +0.000190
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.969871
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000115
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 312a8380 00010013 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 0100013b 96001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 00013b96 00080574 65747261 c043c00c
+ 000c0001 00013b96 000d046d 61696c05 61676174 65c043c0 0c000c00 0100013b
+ 96000502 6e73c06f c00c000c 00010001 3b960013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 0100013b 96001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 0100013b 96001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 013b9600 0a07626f 75717565 74c043c0 0c000c00 0100013b
+ 9600100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 0100013b 96000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 00013b96 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 00013b96 0002c03a c00c000c 00010001 3b960010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010001 3b960002 c0d2c00c
+ 000c0001 00013b96 0005026e 73c056c0 0c000c00 0100013b 96000704 6d61696c
+ c056c00c 000c0001 00013b96 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 00013b96 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 013b9600 06036263 63c043.
+ +0.001180
+ write fd=5
+ 002b312a 01000001 00000000 00000332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.000444
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000085
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.968047
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.000311
+ read fd=5 buflen=973
+ read=OK
+ 74726963 c043c00c 000c0001 00013b96 000c0973 656c6563 74697665 c043c00c
+ 000c0001 00013b96 00181573 70656369 616c696e 76657374 69676174 696f6e73
+ c043c00c 000c0001 00013b96 000b026e 73057377 696674c0 43c00c00 0c000100
+ 013b9600 0d046d61 696c0573 77696674 c043c00c 000c0001 00013b96 0013026e
+ 73097365 63757265 6e657403 6e6574c0 46c00c00 0c000100 013b9600 17147072
+ 69766174 65696e76 65737469 67617469 6f6ec043 c00c000c 00010001 3b96001a
+ 026e7314 70726976 61746569 6e766573 74696761 74696f6e c043c00c 000c0001
+ 00013b96 00090665 74726164 65c043c0 0c000c00 0100013b 96001b02 6e731573
+ 70656369 616c696e 76657374 69676174 696f6e73 c043c00c 000c0001 00013b96
+ 000e046d 61696c06 616e7365 7474c043 c00c000c 00010001 3b96000e 03667470
+ 07776172 72656e74 c043c00c 000c0001 00013b96 0014026e 730e7265 7461696c
+ 73656375 72697479 c043c00c 000c0001 00013b96 001a046d 61696c12 73656375
+ 72697479 6d616e61 67656d65 6e74c043 c00c000c 00010001 3b96000b 026e7305
+ 6d616769 63c043c0 0c000c00 0100013b 96001104 6d61696c 09666f72 6566726f
+ 6e74c043 c00c000c 00010001 3b960007 046d6169 6cc1b1c0 0c000c00 0100013b
+ 960002c1 b1c00c00 0c000100 013b9600 0f026e73 096e7a64 65736967 6e73c043
+ c00c000c 00010001 3b960002 c22dc00c 000c0001 00013b96 000f026e 73097365
+ 6c656374 697665c0 43c00c00 0c000100 013b9600 0c09666f 72656672 6f6e74c0
+ 43c00c00 0c000100 013b9600 15127365 63757269 74796d61 6e616765 6d656e74
+ c043c00c 000c0001 00013b96 0002c1cd c00c000c 00010001 3b960010 09736563
+ 7572656e 6574036e 6574c046 c00c000c 00010001 3b96001d 046d6169 6c157370
+ 65636961 6c696e76 65737469 67617469 6f6e73c0 43c00c00 0c000100 013b9600
+ 0c096e7a 64657369 676e73c0 43c00c00 0c000100 013b9600 0c026e73 06657472
+ 616465c0 43c00c00 0c000100 013b9600 07046d61 696cc122 c00c000c 00010001
+ 3b960007 046d6169 6cc1cdc0 0c000c00 0100013b 96000a02 6e730461 736973c1
+ 28c00c00 0c000100 013b9600 0e026e73 08626f75 71756574 73c043c0 0c000c00
+ 0100013b 960002c0 6f013002 39390332 30330749 4e2d4144 44520441 52504100
+ 00020001 00053014 0002c037 01300239 39033230 3307494e 2d414444 52044152
+ 50410000 02000100 05301400 11036e73 31077761 696b6174 6f026163 c046c037
+ 00010001 00013c19 0004cb63 00fe036e 73310777 61696b61 746f0261 63c04600
+ 01000100 013d0200 048cc880 0d.
+ +0.002240
+ read fd=5 buflen=2433
+ read=EAGAIN
+ +0.012290
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.953206
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.014898
+ read fd=5 buflen=2433
+ read=OK
+ 097f312a 81800001 005e0002 00020332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 013b9600 13026e73 08736563
+ 75726974 7902636f 026e7a00 c00c000c 00010001 3b960008 05746574 7261c043
+ c00c000c 00010001 3b96000d 046d6169 6c056167 617465c0 43c00c00 0c000100
+ 013b9600 05026e73 c06fc00c 000c0001 00013b96 00131073 65637572 69747974
+ 7261696e 696e67c0 43c00c00 0c000100 013b9600 10026e73 0a676966 74626173
+ 6b6574c0 43c00c00 0c000100 013b9600 12026e73 08736563 75726974 79036765
+ 6ec046c0 0c000c00 0100013b 96000a07 626f7571 756574c0 43c00c00 0c000100
+ 013b9600 100d696e 76657374 69676174 696f6ec0 43c00c00 0c000100 013b9600
+ 0f026e73 056e7a69 7069036f 7267c046 c00c000c 00010001 3b96000c 046d6169
+ 6c046e65 7275c043 c00c000c 00010001 3b960002 c03ac00c 000c0001 00013b96
+ 0010026e 730a7374 6f726577 61746368 c043c00c 000c0001 00013b96 0002c0d2
+ c00c000c 00010001 3b960005 026e73c0 56c00c00 0c000100 013b9600 07046d61
+ 696cc056 c00c000c 00010001 3b960010 026e730a 73656375 72696361 7264c043
+ c00c000c 00010001 3b96000f 026e7309 756e6465 72686f75 72c043c0 0c000c00
+ 0100013b 96000603 626363c0 43c00c00 0c000100 013b9600 0b087365 63757269
+ 7479c128 c00c000c 00010001 3b960010 0d627572 676c6172 616c6172 6d73c043
+ c00c000c 00010001 3b96000b 026e7305 73616665 73c043c0 0c000c00 0100013b
+ 96000502 6e73c1f7 c00c000c 00010001 3b960013 10636f75 70657263 6f6e7375
+ 6c74696e 67c043c0 0c000c00 0100013b 9600110e 73656375 72697479 67756172
+ 6473c043 c00c000c 00010001 3b96000c 026e7306 67756172 6473c043 c00c000c
+ 00010001 3b960007 04617369 73c128c0 0c000c00 0100013b 960002c1 3fc00c00
+ 0c000100 013b9600 02c0b6c0 0c000c00 0100013b 96000805 6d616769 63c043c0
+ 0c000c00 0100013b 96000704 6d61696c c1e5c00c 000c0001 00013b96 0005026e
+ 73c103c0 0c000c00 0100013b 960002c1 22c00c00 0c000100 013b9600 05026e73
+ c0edc00c 000c0001 00013b96 0007046d 61696cc2 2dc00c00 0c000100 013b9600
+ 05026e73 c1e5c00c 000c0001 00013b96 0005026e 73c20ec0 0c000c00 0100013b
+ 96000502 6e73c271 c00c000c 00010001 3b960010 0d636f76 65727463 616d6572
+ 6173c043 c00c000c 00010001 3b960005 026e73c1 3fc00c00 0c000100 013b9600
+ 13026e73 0d636f76 65727463 616d6572 6173c043 c00c000c 00010001 3b96000b
+ 08626f75 71756574 73c043c0 0c000c00 0100013b 96000d0a 636f6e63 656e7472
+ 6963c043 c00c000c 00010001 3b960005 026e73c0 94c00c00 0c000100 013b9600
+ 07046d61 696cc252 c00c000c 00010001 3b960011 0e726574 61696c73 65637572
+ 697479c0 43c00c00 0c000100 013b9600 10026e73 0a636f6e 63656e74 726963c0
+ 43c00c00 0c000100 013b9600 0d046d61 696c056d 61676963 c043c00c 000c0001
+ 00013b96 000c096e 7a616e67 6c696e67 c043c00c 000c0001 00013b96 0005026e
+ 73c252c0 0c000c00 0100013b 96000f02 6e73096e 7a616e67 6c696e67 c043c00c
+ 000c0001 00013b96 0007046d 61696cc1 63c00c00 0c000100 013b9600 08057377
+ 696674c0 43c00c00 0c000100 013b9600 11046d61 696c0973 656c6563 74697665
+ c043c00c 000c0001 00013b96 000f026e 7309666f 72656672 6f6e74c0 43c00c00
+ 0c000100 013b9600 11046d61 696c096e 7a616e67 6c696e67 c043c00c 000c0001
+ 00013b96 00090667 75617264 73c043c0 0c000c00 0100013b 96001104 6d61696c
+ 096e7a64 65736967 6e73c043 c00c000c 00010001 3b960002 c163c00c 000c0001
+ 00013b96 0018026e 73127365 63757269 74796d61 6e616765 6d656e74 c043c00c
+ 000c0001 00013b96 0012046d 61696c0a 776f6f6c 776f7274 6873c043 c00c000c
+ 00010001 3b960012 046d6169 6c0a636f 6e63656e.
+ +0.003337
+ read fd=5 buflen=973
+ read=EAGAIN
+ +0.000189
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.934782
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.102926
+ read fd=5 buflen=973
+ read=OK
+ 74726963 c043c00c 000c0001 00013b96 000c0973 656c6563 74697665 c043c00c
+ 000c0001 00013b96 00181573 70656369 616c696e 76657374 69676174 696f6e73
+ c043c00c 000c0001 00013b96 000b026e 73057377 696674c0 43c00c00 0c000100
+ 013b9600 0d046d61 696c0573 77696674 c043c00c 000c0001 00013b96 0013026e
+ 73097365 63757265 6e657403 6e6574c0 46c00c00 0c000100 013b9600 17147072
+ 69766174 65696e76 65737469 67617469 6f6ec043 c00c000c 00010001 3b96001a
+ 026e7314 70726976 61746569 6e766573 74696761 74696f6e c043c00c 000c0001
+ 00013b96 00090665 74726164 65c043c0 0c000c00 0100013b 96001b02 6e731573
+ 70656369 616c696e 76657374 69676174 696f6e73 c043c00c 000c0001 00013b96
+ 000e046d 61696c06 616e7365 7474c043 c00c000c 00010001 3b96000e 03667470
+ 07776172 72656e74 c043c00c 000c0001 00013b96 0014026e 730e7265 7461696c
+ 73656375 72697479 c043c00c 000c0001 00013b96 001a046d 61696c12 73656375
+ 72697479 6d616e61 67656d65 6e74c043 c00c000c 00010001 3b96000b 026e7305
+ 6d616769 63c043c0 0c000c00 0100013b 96001104 6d61696c 09666f72 6566726f
+ 6e74c043 c00c000c 00010001 3b960007 046d6169 6cc1b1c0 0c000c00 0100013b
+ 960002c1 b1c00c00 0c000100 013b9600 0f026e73 096e7a64 65736967 6e73c043
+ c00c000c 00010001 3b960002 c22dc00c 000c0001 00013b96 000f026e 73097365
+ 6c656374 697665c0 43c00c00 0c000100 013b9600 0c09666f 72656672 6f6e74c0
+ 43c00c00 0c000100 013b9600 15127365 63757269 74796d61 6e616765 6d656e74
+ c043c00c 000c0001 00013b96 0002c1cd c00c000c 00010001 3b960010 09736563
+ 7572656e 6574036e 6574c046 c00c000c 00010001 3b96001d 046d6169 6c157370
+ 65636961 6c696e76 65737469 67617469 6f6e73c0 43c00c00 0c000100 013b9600
+ 0c096e7a 64657369 676e73c0 43c00c00 0c000100 013b9600 0c026e73 06657472
+ 616465c0 43c00c00 0c000100 013b9600 07046d61 696cc122 c00c000c 00010001
+ 3b960007 046d6169 6cc1cdc0 0c000c00 0100013b 96000a02 6e730461 736973c1
+ 28c00c00 0c000100 013b9600 0e026e73 08626f75 71756574 73c043c0 0c000c00
+ 0100013b 960002c0 6f013002 39390332 30330749 4e2d4144 44520441 52504100
+ 00020001 00053014 0002c037 01300239 39033230 3307494e 2d414444 52044152
+ 50410000 02000100 05301400 11036e73 31077761 696b6174 6f026163 c046c037
+ 00010001 00013c19 0004cb63 00fe036e 73310777 61696b61 746f0261 63c04600
+ 01000100 013d0200 048cc880 0d.
+ +0.002246
+ sendto fd=4 addr=195.224.55.129:53
+ 312e0100 00010000 00000000 026e7308 73656375 72697479 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.001645
+ sendto fd=4 addr=195.224.55.129:53
+ 312f0100 00010000 00000000 05746574 72610263 6f026e7a 00000100 01.
+ sendto=29
+ +0.000578
+ sendto fd=4 addr=195.224.55.129:53
+ 31300100 00010000 00000000 046d6169 6c056167 61746502 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000605
+ sendto fd=4 addr=195.224.55.129:53
+ 31310100 00010000 00000000 026e7305 61676174 6502636f 026e7a00 00010001.
+ sendto=32
+ +0.000624
+ sendto fd=4 addr=195.224.55.129:53
+ 31320100 00010000 00000000 10736563 75726974 79747261 696e696e 6702636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.000624
+ sendto fd=4 addr=195.224.55.129:53
+ 31330100 00010000 00000000 026e730a 67696674 6261736b 65740263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.000647
+ sendto fd=4 addr=195.224.55.129:53
+ 31340100 00010000 00000000 026e7308 73656375 72697479 0367656e 026e7a00
+ 00010001.
+ sendto=36
+ +0.000624
+ sendto fd=4 addr=195.224.55.129:53
+ 31350100 00010000 00000000 07626f75 71756574 02636f02 6e7a0000 010001.
+ sendto=31
+ +0.000606
+ sendto fd=4 addr=195.224.55.129:53
+ 31360100 00010000 00000000 0d696e76 65737469 67617469 6f6e0263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.000591
+ sendto fd=4 addr=195.224.55.129:53
+ 31370100 00010000 00000000 026e7305 6e7a6970 69036f72 67026e7a 00000100
+ 01.
+ sendto=33
+ +0.000617
+ sendto fd=4 addr=195.224.55.129:53
+ 31380100 00010000 00000000 046d6169 6c046e65 72750263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.000622
+ sendto fd=4 addr=195.224.55.129:53
+ 31390100 00010000 00000000 08736563 75726974 7902636f 026e7a00 00010001.
+ sendto=32
+ +0.000608
+ sendto fd=4 addr=195.224.55.129:53
+ 313a0100 00010000 00000000 026e730a 73746f72 65776174 63680263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.000655
+ sendto fd=4 addr=195.224.55.129:53
+ 313b0100 00010000 00000000 08736563 75726974 79036765 6e026e7a 00000100
+ 01.
+ sendto=33
+ +0.000617
+ sendto fd=4 addr=195.224.55.129:53
+ 313c0100 00010000 00000000 026e7305 74657472 6102636f 026e7a00 00010001.
+ sendto=32
+ +0.000622
+ sendto fd=4 addr=195.224.55.129:53
+ 313d0100 00010000 00000000 046d6169 6c057465 74726102 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000638
+ sendto fd=4 addr=195.224.55.129:53
+ 313e0100 00010000 00000000 026e730a 73656375 72696361 72640263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.000645
+ sendto fd=4 addr=195.224.55.129:53
+ 313f0100 00010000 00000000 026e7309 756e6465 72686f75 7202636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.000621
+ sendto fd=4 addr=195.224.55.129:53
+ 31400100 00010000 00000000 03626363 02636f02 6e7a0000 010001.
+ sendto=27
+ +0.000634
+ sendto fd=4 addr=195.224.55.129:53
+ 31410100 00010000 00000000 08736563 75726974 79036f72 67026e7a 00000100
+ 01.
+ sendto=33
+ +0.000669
+ sendto fd=4 addr=195.224.55.129:53
+ 31420100 00010000 00000000 0d627572 676c6172 616c6172 6d730263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.000788
+ sendto fd=4 addr=195.224.55.129:53
+ 31430100 00010000 00000000 026e7305 73616665 7302636f 026e7a00 00010001.
+ sendto=32
+ +0.000784
+ sendto fd=4 addr=195.224.55.129:53
+ 31440100 00010000 00000000 026e7308 73656375 72697479 036f7267 026e7a00
+ 00010001.
+ sendto=36
+ +0.000824
+ sendto fd=4 addr=195.224.55.129:53
+ 31450100 00010000 00000000 10636f75 70657263 6f6e7375 6c74696e 6702636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.000796
+ sendto fd=4 addr=195.224.55.129:53
+ 31460100 00010000 00000000 0e736563 75726974 79677561 72647302 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.000849
+ sendto fd=4 addr=195.224.55.129:53
+ 31470100 00010000 00000000 026e7306 67756172 64730263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.000819
+ sendto fd=4 addr=195.224.55.129:53
+ 31480100 00010000 00000000 04617369 73036f72 67026e7a 00000100 01.
+ sendto=29
+ +0.000730
+ sendto fd=4 addr=195.224.55.129:53
+ 31490100 00010000 00000000 046e6572 7502636f 026e7a00 00010001.
+ sendto=28
+ +0.000761
+ sendto fd=4 addr=195.224.55.129:53
+ 314a0100 00010000 00000000 0a676966 74626173 6b657402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000781
+ sendto fd=4 addr=195.224.55.129:53
+ 314b0100 00010000 00000000 056d6167 69630263 6f026e7a 00000100 01.
+ sendto=29
+ +0.000760
+ sendto fd=4 addr=195.224.55.129:53
+ 314c0100 00010000 00000000 046d6169 6c036263 6302636f 026e7a00 00010001.
+ sendto=32
+ +0.000770
+ sendto fd=4 addr=195.224.55.129:53
+ 314d0100 00010000 00000000 026e730d 696e7665 73746967 6174696f 6e02636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.000825
+ sendto fd=4 addr=195.224.55.129:53
+ 314e0100 00010000 00000000 056e7a69 7069036f 7267026e 7a000001 0001.
+ sendto=30
+ +0.000781
+ sendto fd=4 addr=195.224.55.129:53
+ 314f0100 00010000 00000000 026e7307 626f7571 75657402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000816
+ sendto fd=4 addr=195.224.55.129:53
+ 31500100 00010000 00000000 046d6169 6c057361 66657302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000796
+ sendto fd=4 addr=195.224.55.129:53
+ 31510100 00010000 00000000 026e7303 62636302 636f026e 7a000001 0001.
+ sendto=30
+ +0.000785
+ sendto fd=4 addr=195.224.55.129:53
+ 31520100 00010000 00000000 026e730d 62757267 6c617261 6c61726d 7302636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.000780
+ sendto fd=4 addr=195.224.55.129:53
+ 31530100 00010000 00000000 026e730e 73656375 72697479 67756172 64730263
+ 6f026e7a 00000100 01.
+ sendto=41
+ +0.000840
+ sendto fd=4 addr=195.224.55.129:53
+ 31540100 00010000 00000000 0d636f76 65727463 616d6572 61730263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.000816
+ sendto fd=4 addr=195.224.55.129:53
+ 31550100 00010000 00000000 026e7304 6e657275 02636f02 6e7a0000 010001.
+ sendto=31
+ +0.000778
+ sendto fd=4 addr=195.224.55.129:53
+ 31560100 00010000 00000000 026e730d 636f7665 72746361 6d657261 7302636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.000840
+ sendto fd=4 addr=195.224.55.129:53
+ 31570100 00010000 00000000 08626f75 71756574 7302636f 026e7a00 00010001.
+ sendto=32
+ +0.000765
+ sendto fd=4 addr=195.224.55.129:53
+ 31580100 00010000 00000000 0a636f6e 63656e74 72696302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000829
+ sendto fd=4 addr=195.224.55.129:53
+ 31590100 00010000 00000000 026e7310 73656375 72697479 74726169 6e696e67
+ 02636f02 6e7a0000 010001.
+ sendto=43
+ +0.000815
+ sendto fd=4 addr=195.224.55.129:53
+ 315a0100 00010000 00000000 046d6169 6c10636f 75706572 636f6e73 756c7469
+ 6e670263 6f026e7a 00000100 01.
+ sendto=45
+ +0.000857
+ sendto fd=4 addr=195.224.55.129:53
+ 315b0100 00010000 00000000 0e726574 61696c73 65637572 69747902 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.000827
+ sendto fd=4 addr=195.224.55.129:53
+ 315c0100 00010000 00000000 026e730a 636f6e63 656e7472 69630263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.000807
+ sendto fd=4 addr=195.224.55.129:53
+ 315d0100 00010000 00000000 046d6169 6c056d61 67696302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000830
+ sendto fd=4 addr=195.224.55.129:53
+ 315e0100 00010000 00000000 096e7a61 6e676c69 6e670263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.000809
+ sendto fd=4 addr=195.224.55.129:53
+ 315f0100 00010000 00000000 026e7310 636f7570 6572636f 6e73756c 74696e67
+ 02636f02 6e7a0000 010001.
+ sendto=43
+ +0.000864
+ sendto fd=4 addr=195.224.55.129:53
+ 31600100 00010000 00000000 026e7309 6e7a616e 676c696e 6702636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.000806
+ sendto fd=4 addr=195.224.55.129:53
+ 31610100 00010000 00000000 046d6169 6c0a7374 6f726577 61746368 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001021
+ sendto fd=4 addr=195.224.55.129:53
+ 31620100 00010000 00000000 05737769 66740263 6f026e7a 00000100 01.
+ sendto=29
+ +0.000910
+ sendto fd=4 addr=195.224.55.129:53
+ 31630100 00010000 00000000 046d6169 6c097365 6c656374 69766502 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.000882
+ sendto fd=4 addr=195.224.55.129:53
+ 31640100 00010000 00000000 026e7309 666f7265 66726f6e 7402636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.000888
+ sendto fd=4 addr=195.224.55.129:53
+ 31650100 00010000 00000000 046d6169 6c096e7a 616e676c 696e6702 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.000941
+ sendto fd=4 addr=195.224.55.129:53
+ 31660100 00010000 00000000 06677561 72647302 636f026e 7a000001 0001.
+ sendto=30
+ +0.000901
+ sendto fd=4 addr=195.224.55.129:53
+ 31670100 00010000 00000000 046d6169 6c096e7a 64657369 676e7302 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.000952
+ sendto fd=4 addr=195.224.55.129:53
+ 31680100 00010000 00000000 0a73746f 72657761 74636802 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000922
+ sendto fd=4 addr=195.224.55.129:53
+ 31690100 00010000 00000000 026e7312 73656375 72697479 6d616e61 67656d65
+ 6e740263 6f026e7a 00000100 01.
+ sendto=45
+ +0.000921
+ sendto fd=4 addr=195.224.55.129:53
+ 316a0100 00010000 00000000 046d6169 6c0a776f 6f6c776f 72746873 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.000970
+ sendto fd=4 addr=195.224.55.129:53
+ 316b0100 00010000 00000000 046d6169 6c0a636f 6e63656e 74726963 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.000911
+ sendto fd=4 addr=195.224.55.129:53
+ 316c0100 00010000 00000000 0973656c 65637469 76650263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.000909
+ sendto fd=4 addr=195.224.55.129:53
+ 316d0100 00010000 00000000 15737065 6369616c 696e7665 73746967 6174696f
+ 6e730263 6f026e7a 00000100 01.
+ sendto=45
+ +0.000952
+ sendto fd=4 addr=195.224.55.129:53
+ 316e0100 00010000 00000000 026e7305 73776966 7402636f 026e7a00 00010001.
+ sendto=32
+ +0.000912
+ sendto fd=4 addr=195.224.55.129:53
+ 316f0100 00010000 00000000 046d6169 6c057377 69667402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000910
+ sendto fd=4 addr=195.224.55.129:53
+ 31700100 00010000 00000000 026e7309 73656375 72656e65 74036e65 74026e7a
+ 00000100 01.
+ sendto=37
+ +0.000937
+ sendto fd=4 addr=195.224.55.129:53
+ 31710100 00010000 00000000 14707269 76617465 696e7665 73746967 6174696f
+ 6e02636f 026e7a00 00010001.
+ sendto=44
+ +0.000955
+ sendto fd=4 addr=195.224.55.129:53
+ 31720100 00010000 00000000 026e7314 70726976 61746569 6e766573 74696761
+ 74696f6e 02636f02 6e7a0000 010001.
+ sendto=47
+ +0.000949
+ sendto fd=4 addr=195.224.55.129:53
+ 31730100 00010000 00000000 06657472 61646502 636f026e 7a000001 0001.
+ sendto=30
+ +0.000929
+ sendto fd=4 addr=195.224.55.129:53
+ 31740100 00010000 00000000 026e7315 73706563 69616c69 6e766573 74696761
+ 74696f6e 7302636f 026e7a00 00010001.
+ sendto=48
+ +0.000948
+ sendto fd=4 addr=195.224.55.129:53
+ 31750100 00010000 00000000 046d6169 6c06616e 73657474 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.000956
+ sendto fd=4 addr=195.224.55.129:53
+ 31760100 00010000 00000000 03667470 07776172 72656e74 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.000882
+ sendto fd=4 addr=195.224.55.129:53
+ 31770100 00010000 00000000 026e730e 72657461 696c7365 63757269 74790263
+ 6f026e7a 00000100 01.
+ sendto=41
+ +0.001013
+ sendto fd=4 addr=195.224.55.129:53
+ 31780100 00010000 00000000 046d6169 6c127365 63757269 74796d61 6e616765
+ 6d656e74 02636f02 6e7a0000 010001.
+ sendto=47
+ +0.000970
+ sendto fd=4 addr=195.224.55.129:53
+ 31790100 00010000 00000000 026e7305 6d616769 6302636f 026e7a00 00010001.
+ sendto=32
+ +0.000945
+ sendto fd=4 addr=195.224.55.129:53
+ 317a0100 00010000 00000000 046d6169 6c09666f 72656672 6f6e7402 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.000971
+ sendto fd=4 addr=195.224.55.129:53
+ 317b0100 00010000 00000000 046d6169 6c0a7365 63757269 63617264 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.000947
+ sendto fd=4 addr=195.224.55.129:53
+ 317c0100 00010000 00000000 0a736563 75726963 61726402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000933
+ sendto fd=4 addr=195.224.55.129:53
+ 317d0100 00010000 00000000 026e7309 6e7a6465 7369676e 7302636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.000952
+ sendto fd=4 addr=195.224.55.129:53
+ 317e0100 00010000 00000000 05736166 65730263 6f026e7a 00000100 01.
+ sendto=29
+ +0.000954
+ sendto fd=4 addr=195.224.55.129:53
+ 317f0100 00010000 00000000 026e7309 73656c65 63746976 6502636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.000964
+ sendto fd=4 addr=195.224.55.129:53
+ 31800100 00010000 00000000 09666f72 6566726f 6e740263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.000967
+ sendto fd=4 addr=195.224.55.129:53
+ 31810100 00010000 00000000 12736563 75726974 796d616e 6167656d 656e7402
+ 636f026e 7a000001 0001.
+ sendto=42
+ +0.000966
+ sendto fd=4 addr=195.224.55.129:53
+ 31820100 00010000 00000000 09756e64 6572686f 75720263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.000942
+ sendto fd=4 addr=195.224.55.129:53
+ 31830100 00010000 00000000 09736563 7572656e 6574036e 6574026e 7a000001
+ 0001.
+ sendto=34
+ +0.000972
+ sendto fd=4 addr=195.224.55.129:53
+ 31840100 00010000 00000000 046d6169 6c157370 65636961 6c696e76 65737469
+ 67617469 6f6e7302 636f026e 7a000001 0001.
+ sendto=50
+ +0.000939
+ sendto fd=4 addr=195.224.55.129:53
+ 31850100 00010000 00000000 096e7a64 65736967 6e730263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.000978
+ sendto fd=4 addr=195.224.55.129:53
+ 31860100 00010000 00000000 026e7306 65747261 64650263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.000980
+ sendto fd=4 addr=195.224.55.129:53
+ 31870100 00010000 00000000 046d6169 6c056e7a 69706903 6f726702 6e7a0000
+ 010001.
+ sendto=35
+ +0.001012
+ sendto fd=4 addr=195.224.55.129:53
+ 31880100 00010000 00000000 046d6169 6c09756e 64657268 6f757202 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.000973
+ sendto fd=4 addr=195.224.55.129:53
+ 31890100 00010000 00000000 026e7304 61736973 036f7267 026e7a00 00010001.
+ sendto=32
+ +0.000972
+ sendto fd=4 addr=195.224.55.129:53
+ 318a0100 00010000 00000000 026e7308 626f7571 75657473 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.001216
+ sendto fd=4 addr=195.224.55.129:53
+ 318b0100 00010000 00000000 05616761 74650263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001028
+ read fd=5 buflen=2433
+ read=EAGAIN
+ +0.000212
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.749926
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000262
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 312e8180 00010001 00020002 026e7308 73656375 72697479 02636f02 6e7a0000
+ 010001c0 0c000100 0100013c 190004cb 6300fe08 73656375 72697479 02636f02
+ 6e7a0000 02000100 013c1900 02c00cc0 33000200 0100013c 19001103 6e733107
+ 7761696b 61746f02 6163c03f c00c0001 00010001 3c190004 cb6300fe c05b0001
+ 00010001 3d020004 8cc8800d.
+ +0.000482
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 312f8180 00010001 00020002 05746574 72610263 6f026e7a 00000100 01c00c00
+ 01000100 013c1400 04cb6300 fec00c00 02000100 013c1400 05026e73 c00cc00c
+ 00020001 00013c14 0013036e 73310777 61696b61 746f0261 63026e7a 00c03900
+ 01000100 013c1400 04cb6300 fec04a00 01000100 013d0200 048cc880 0d.
+ +0.001031
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31308180 00010001 00020002 046d6169 6c056167 61746502 636f026e 7a000001
+ 0001c00c 00010001 00013c11 0004cb63 00fe0561 67617465 02636f02 6e7a0000
+ 02000100 013d0100 11036e73 31077761 696b6174 6f026163 c03bc032 00020001
+ 00013d01 0005026e 73c032c0 49000100 0100013d 0200048c c8800dc0 66000100
+ 0100013d 010004cb 6300fe.
+ +0.000920
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31318180 00010001 00020002 026e7305 61676174 6502636f 026e7a00 00010001
+ c00c0001 00010001 3d010004 cb6300fe 05616761 74650263 6f026e7a 00000200
+ 0100013d 01001103 6e733107 7761696b 61746f02 6163c039 c0300002 00010001
+ 3d010002 c00cc047 00010001 00013d02 00048cc8 800dc00c 00010001 00013d01
+ 0004cb63 00fe.
+ +0.000909
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31328180 00010001 00020002 10736563 75726974 79747261 696e696e 6702636f
+ 026e7a00 00010001 c00c0001 00010001 3c150004 cb6300fe c00c0002 00010001
+ 3c150005 026e73c0 0cc00c00 02000100 013c1500 13036e73 31077761 696b6174
+ 6f026163 026e7a00 c0440001 00010000 6ada0004 cb6300fe c0550001 00010001
+ 3d020004 8cc8800d.
+ +0.000890
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31338180 00010001 00020002 026e730a 67696674 6261736b 65740263 6f026e7a
+ 00000100 01c00c00 01000100 013c1800 04cb6300 fe0a6769 66746261 736b6574
+ 02636f02 6e7a0000 02000100 013c1800 02c00cc0 35000200 0100013c 18001103
+ 6e733107 7761696b 61746f02 6163c043 c00c0001 00010001 3c180004 cb6300fe
+ c05f0001 00010001 3d020004 8cc8800d.
+ +0.000922
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31348180 00010001 00020002 026e7308 73656375 72697479 0367656e 026e7a00
+ 00010001 c00c0001 00010000 5a4d0004 cb6300fe 08736563 75726974 79036765
+ 6e026e7a 00000200 0100013c 11001103 6e733107 7761696b 61746f02 6163c041
+ c0340002 00010001 3c110002 c00cc04f 00010001 00013d02 00048cc8 800dc00c
+ 00010001 00005a4d 0004cb63 00fe.
+ +0.000900
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31358180 00010001 00020002 07626f75 71756574 02636f02 6e7a0000 010001c0
+ 0c000100 0100013c 150004cb 6300fec0 0c000200 0100013c 15000502 6e73c00c
+ c00c0002 00010001 3c150013 036e7331 07776169 6b61746f 02616302 6e7a00c0
+ 3b000100 01000064 ce0004cb 6300fec0 4c000100 0100013d 0200048c c8800d.
+ +0.000863
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31368180 00010001 00020002 0d696e76 65737469 67617469 6f6e0263 6f026e7a
+ 00000100 01c00c00 01000100 013c1100 04cb6300 fec00c00 02000100 013c1100
+ 05026e73 c00cc00c 00020001 00013c11 0013036e 73310777 61696b61 746f0261
+ 63024e5a 00c04100 01000100 012b3100 04cb6300 fec05200 01000100 013d0200
+ 048cc880 0d.
+ +0.000907
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31378180 00010001 00020002 026e7305 6e7a6970 69036f72 67026e7a 00000100
+ 01c00c00 01000100 013d0100 04cb6300 fe056e7a 69706903 6f726702 6e7a0000
+ 02000100 013d0100 02c00cc0 31000200 0100013d 01001103 6e733107 7761696b
+ 61746f02 6163c03b c00c0001 00010001 3d010004 cb6300fe c0570001 00010001
+ 3d020004 8cc8800d.
+ +0.000880
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31388180 00010001 00020002 046d6169 6c046e65 72750263 6f026e7a 00000100
+ 01c00c00 01000100 013c1100 04cb6300 fe046e65 72750263 6f026e7a 00000200
+ 0100013c 12001103 6e733107 7761696b 61746f02 6163c039 c0310002 00010001
+ 3c120005 026e73c0 31c04700 01000100 013d0200 048cc880 0dc06400 01000100
+ 0064cc00 04cb6300 fe.
+ +0.000898
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31398180 00010001 00020002 08736563 75726974 7902636f 026e7a00 00010001
+ c00c0001 00010001 3c190004 cb6300fe c00c0002 00010001 3c190005 026e73c0
+ 0cc00c00 02000100 013c1900 13036e73 31077761 696b6174 6f026163 024e5a00
+ c03c0001 00010001 3c190004 cb6300fe c04d0001 00010001 3d020004 8cc8800d.
+ +0.000858
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 313a8583 00010000 00010000 026e730a 73746f72 65776174 63680263 6f026e7a
+ 00000100 0102636f 026e7a00 00060001 0000014b 002c046e 73393907 7761696b
+ 61746f02 6163c028 03736f61 c03b7727 6ec50000 0e100000 07080027 8d000001
+ 5180.
+ +0.000799
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 313b8180 00010001 00020002 08736563 75726974 79036765 6e026e7a 00000100
+ 01c00c00 01000100 013c1100 04cb6300 fec00c00 02000100 013c1100 13036e73
+ 31077761 696b6174 6f026163 026e7a00 c00c0002 00010001 3c110005 026e73c0
+ 0cc03d00 01000100 013d0200 048cc880 0dc05c00 01000100 005a4d00 04cb6300
+ fe.
+ +0.015730
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 313c8180 00010001 00020002 026e7305 74657472 6102636f 026e7a00 00010001
+ c00c0001 00010001 3c140004 cb6300fe 05746574 72610263 6f026e7a 00000200
+ 0100013c 140002c0 0cc03000 02000100 013c1400 11036e73 31077761 696b6174
+ 6f026163 c039c00c 00010001 00013c14 0004cb63 00fec055 00010001 00013d02
+ 00048cc8 800d.
+ +0.000552
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 313d8180 00010001 00020002 046d6169 6c057465 74726102 636f026e 7a000001
+ 0001c00c 00010001 00013c12 0004cb63 00fe0574 65747261 02636f02 6e7a0000
+ 02000100 013c1400 05026e73 c032c032 00020001 00013c14 0011036e 73310777
+ 61696b61 746f0261 63c03bc0 49000100 0100013c 140004cb 6300fec0 5a000100
+ 0100013d 0200048c c8800d.
+ +0.000560
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 313e8180 00010001 00020002 026e730a 73656375 72696361 72640263 6f026e7a
+ 00000100 01c00c00 01000100 013d0100 04cb6300 fe0a7365 63757269 63617264
+ 02636f02 6e7a0000 02000100 013d0100 02c00cc0 35000200 0100013d 01001103
+ 6e733107 7761696b 61746f02 6163c043 c00c0001 00010001 3d010004 cb6300fe
+ c05f0001 00010001 3d020004 8cc8800d.
+ +0.000545
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 313f8180 00010001 00020002 026e7309 756e6465 72686f75 7202636f 026e7a00
+ 00010001 c00c0001 00010001 3d010004 cb6300fe 09756e64 6572686f 75720263
+ 6f026e7a 00000200 0100013d 010002c0 0cc03400 02000100 013d0100 11036e73
+ 31077761 696b6174 6f026163 c041c00c 00010001 00013d01 0004cb63 00fec05d
+ 00010001 00013d02 00048cc8 800d.
+ +0.000542
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31408180 00010001 00020002 03626363 02636f02 6e7a0000 010001c0 0c000100
+ 0100013c 120004cb 6300fec0 0c000200 0100013c 18000502 6e73c00c c00c0002
+ 00010001 3c180013 036e7331 07776169 6b61746f 02616302 6e7a00c0 37000100
+ 0100006a dc0004cb 6300fec0 48000100 0100013d 0200048c c8800d.
+ +0.000518
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31418180 00010001 00020002 08736563 75726974 79036f72 67026e7a 00000100
+ 01c00c00 01000100 013c1200 04cb6300 fec00c00 02000100 013c1200 05026e73
+ c00cc00c 00020001 00013c12 0013036e 73310777 61696b61 746f0261 63026e7a
+ 00c03d00 01000100 013c1200 04cb6300 fec04e00 01000100 013d0200 048cc880
+ 0d.
+ +0.000512
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31428180 00010001 00020002 0d627572 676c6172 616c6172 6d730263 6f026e7a
+ 00000100 01c00c00 01000100 013c1200 04cb6300 fec00c00 02000100 013c1200
+ 05026e73 c00cc00c 00020001 00013c12 0013036e 73310777 61696b61 746f0261
+ 63026e7a 00c04100 01000100 0064cc00 04cb6300 fec05200 01000100 013d0200
+ 048cc880 0d.
+ +0.000548
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31438583 00010000 00010000 026e7305 73616665 7302636f 026e7a00 00010001
+ 05736166 65730263 6f026e7a 00000600 01000001 4c002e03 6e733104 69687567
+ 036e6574 c0290373 6f610469 687567c0 26772768 a9000151 8000002a 30001275
+ 000002a3 00.
+ +0.000452
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31448180 00010001 00020002 026e7308 73656375 72697479 036f7267 026e7a00
+ 00010001 c00c0001 00010001 3c120004 cb6300fe 08736563 75726974 79036f72
+ 67026e7a 00000200 0100013c 120002c0 0cc03400 02000100 013c1200 11036e73
+ 31077761 696b6174 6f026163 c041c00c 00010001 00013c12 0004cb63 00fec05d
+ 00010001 00013d02 00048cc8 800d.
+ +0.000539
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31458180 00010001 00020002 10636f75 70657263 6f6e7375 6c74696e 6702636f
+ 026e7a00 00010001 c00c0001 00010001 3c120004 cb6300fe c00c0002 00010001
+ 3d010013 036e7331 07776169 6b61746f 02616302 6e7a00c0 0c000200 0100013d
+ 01000502 6e73c00c c0440001 00010001 3d020004 8cc8800d c0630001 00010000
+ 718c0004 cb6300fe.
+ +0.000547
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31468180 00010001 00020002 0e736563 75726974 79677561 72647302 636f026e
+ 7a000001 0001c00c 00010001 00013c12 0004cb63 00fec00c 00020001 00013c12
+ 0005026e 73c00cc0 0c000200 0100013c 12001303 6e733107 7761696b 61746f02
+ 6163026e 7a00c042 00010001 000064cc 0004cb63 00fec053 00010001 00013d02
+ 00048cc8 800d.
+ +0.000649
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31478180 00010001 00020002 026e7306 67756172 64730263 6f026e7a 00000100
+ 01c00c00 01000100 013cfa00 04cb6300 fe066775 61726473 02636f02 6e7a0000
+ 02000100 013cfa00 02c00cc0 31000200 0100013c fa001103 6e733107 7761696b
+ 61746f02 6163c03b c00c0001 00010001 3cfa0004 cb6300fe c0570001 00010001
+ 3d020004 8cc8800d.
+ +0.000551
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31488180 00010001 00020002 04617369 73036f72 67026e7a 00000100 01c00c00
+ 01000100 013c1200 04cb6300 fec00c00 02000100 013c1200 05026e73 c00cc00c
+ 00020001 00013c12 0013036e 73310777 61696b61 746f0261 63026e7a 00c03900
+ 01000100 006ad900 04cb6300 fec04a00 01000100 013d0200 048cc880 0d.
+ +0.000503
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31498180 00010001 00020002 046e6572 7502636f 026e7a00 00010001 c00c0001
+ 00010001 3c120004 cb6300fe c00c0002 00010001 3c120013 036e7331 07776169
+ 6b61746f 02616302 6e7a00c0 0c000200 0100013c 12000502 6e73c00c c0380001
+ 00010001 3d020004 8cc8800d c0570001 00010000 64cc0004 cb6300fe.
+ +0.000499
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 314a8180 00010001 00020002 0a676966 74626173 6b657402 636f026e 7a000001
+ 0001c00c 00010001 00013c18 0004cb63 00fec00c 00020001 00013c18 0005026e
+ 73c00cc0 0c000200 0100013c 18001303 6e733107 7761696b 61746f02 6163024e
+ 5a00c03e 00010001 00013c18 0004cb63 00fec04f 00010001 00013d02 00048cc8
+ 800d.
+ +0.000529
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 314b8180 00010001 00020002 056d6167 69630263 6f026e7a 00000100 01c00c00
+ 01000100 013c1c00 04cb6300 fec00c00 02000100 013d0100 05026e73 c00cc00c
+ 00020001 00013d01 0013036e 73310777 61696b61 746f0261 63026e7a 00c03900
+ 01000100 00718c00 04cb6300 fec04a00 01000100 013d0200 048cc880 0d.
+ +0.000503
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 314c8180 00010001 00020002 046d6169 6c036263 6302636f 026e7a00 00010001
+ c00c0001 00010001 3c180004 cb6300fe 03626363 02636f02 6e7a0000 02000100
+ 013c1800 05026e73 c030c030 00020001 00013c18 0011036e 73310777 61696b61
+ 746f0261 63c037c0 45000100 0100006a dc0004cb 6300fec0 56000100 0100013d
+ 0200048c c8800d.
+ +0.000544
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 314d8180 00010001 00020002 026e730d 696e7665 73746967 6174696f 6e02636f
+ 026e7a00 00010001 c00c0001 00010001 2b310004 cb6300fe 0d696e76 65737469
+ 67617469 6f6e0263 6f026e7a 00000200 0100013c 110002c0 0cc03800 02000100
+ 013c1100 11036e73 31077761 696b6174 6f026163 c049c00c 00010001 00012b31
+ 0004cb63 00fec065 00010001 00013d02 00048cc8 800d.
+ +0.000562
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 314e8180 00010001 00020002 056e7a69 7069036f 7267026e 7a000001 0001c00c
+ 00010001 00013c18 0004cb63 00fec00c 00020001 00013d01 0005026e 73c00cc0
+ 0c000200 0100013d 01001303 6e733107 7761696b 61746f02 6163024e 5a00c03a
+ 00010001 00013d01 0004cb63 00fec04b 00010001 00013d02 00048cc8 800d.
+ +0.000505
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 314f8180 00010001 00020002 026e7307 626f7571 75657402 636f026e 7a000001
+ 0001c00c 00010001 00005fc3 0004cb63 00fe0762 6f757175 65740263 6f026e7a
+ 00000200 0100013c 150002c0 0cc03200 02000100 013c1500 11036e73 31077761
+ 696b6174 6f026163 c03dc00c 00010001 00005fc3 0004cb63 00fec059 00010001
+ 00013d02 00048cc8 800d.
+ +0.000561
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31508583 00010000 00010000 046d6169 6c057361 66657302 636f026e 7a000001
+ 00010573 61666573 02636f02 6e7a0000 06000100 00014c00 2e036e73 31046968
+ 7567036e 6574c02b 03736f61 04696875 67c02877 2768a900 01518000 002a3000
+ 12750000 02a300.
+ +0.000456
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31518180 00010001 00020002 026e7303 62636302 636f026e 7a000001 0001c00c
+ 00010001 00006584 0004cb63 00fe0362 63630263 6f026e7a 00000200 0100013c
+ 180002c0 0cc02e00 02000100 013c1800 11036e73 31077761 696b6174 6f026163
+ c035c00c 00010001 00006584 0004cb63 00fec051 00010001 00013d02 00048cc8
+ 800d.
+ +0.000510
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31528180 00010001 00020002 026e730d 62757267 6c617261 6c61726d 7302636f
+ 026e7a00 00010001 c00c0001 00010000 5fc10004 cb6300fe 0d627572 676c6172
+ 616c6172 6d730263 6f026e7a 00000200 0100013c 120002c0 0cc03800 02000100
+ 013c1200 11036e73 31077761 696b6174 6f026163 c049c00c 00010001 00005fc1
+ 0004cb63 00fec065 00010001 00013d02 00048cc8 800d.
+ +0.000695
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31538180 00010001 00020002 026e730e 73656375 72697479 67756172 64730263
+ 6f026e7a 00000100 01c00c00 01000100 005fc100 04cb6300 fe0e7365 63757269
+ 74796775 61726473 02636f02 6e7a0000 02000100 013c1200 02c00cc0 39000200
+ 0100013c 12001103 6e733107 7761696b 61746f02 6163c04b c00c0001 00010000
+ 5fc10004 cb6300fe c0670001 00010001 3d020004 8cc8800d.
+ +0.000563
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 318b8180 00010001 00020002 05616761 74650263 6f026e7a 00000100 01c00c00
+ 01000100 013d0100 04cb6300 fec00c00 02000100 013d0100 13036e73 31077761
+ 696b6174 6f026163 024e5a00 c00c0002 00010001 3d010005 026e73c0 0cc03900
+ 01000100 013d0200 048cc880 0dc05800 01000100 013d0100 04cb6300 fe.
+ +0.000525
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000199
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.709006
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.182313
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 311f8580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 01000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000371
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000183
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.527000
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.008955
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31208580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 02000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000371
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000153
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.518039
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.009375
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31218580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 05000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000369
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000166
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.508640
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019379
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31228580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 06000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000372
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000151
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.489844
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.031580
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31248580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0d000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000386
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000181
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.458220
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.031691
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31258580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000369
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000150
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.426528
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.028650
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31268580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 10000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000370
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000159
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.397893
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.029986
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31278580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 11000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000369
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000145
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.367902
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.029845
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31288580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 01000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000384
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000148
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.338068
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.033093
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 31298580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 02000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000368
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000145
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.305566
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-780664
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 312b8580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000375
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000147
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.086223
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000393
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 312c8580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 06000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000367
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000152
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.085946
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000401
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=195.224.55.129:53
+ 312d8580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 11000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000367
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000142
+ close fd=4
+ close=OK
+ +0.000250
+ close fd=5
+ close=OK
+ +0.000095
diff --git a/adns-0.6/regress/case-manyptrwrongrem.err b/adns-0.6/regress/case-manyptrwrongrem.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrongrem.err
diff --git a/adns-0.6/regress/case-manyptrwrongrem.out b/adns-0.6/regress/case-manyptrwrongrem.out
new file mode 100644
index 0000000..6d0370c
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrongrem.out
@@ -0,0 +1,127 @@
+adns debug: using nameserver 140.200.128.13
+254.0.99.203.in-addr.arpa flags 292 type 1 A(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 2 NS(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 5 CNAME(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 6 SOA(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 12 PTR(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 13 HINFO(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 15 MX(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 16 TXT(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 17 RP(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65537 A(addr) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65538 NS(+addr) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65548 PTR(checked) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65551 MX(+addr) submitted
+254.0.99.203.in-addr.arpa flags 292 type 131078 SOA(822) submitted
+254.0.99.203.in-addr.arpa flags 292 type 131089 RP(822) submitted
+254.0.99.203.in-addr.arpa flags 292 type A(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type CNAME(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type SOA(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type NS(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type HINFO(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type TXT(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type MX(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type RP(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type A(addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type MX(+addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type NS(+addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type SOA(822): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type RP(822): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+adns debug: TCP connected (NS=140.200.128.13)
+254.0.99.203.in-addr.arpa flags 292 type PTR(raw): OK; nrrs=94; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+ ns.security.co.nz
+ tetra.co.nz
+ mail.agate.co.nz
+ ns.agate.co.nz
+ securitytraining.co.nz
+ ns.giftbasket.co.nz
+ ns.security.gen.nz
+ bouquet.co.nz
+ investigation.co.nz
+ ns.nzipi.org.nz
+ mail.neru.co.nz
+ security.co.nz
+ ns.storewatch.co.nz
+ security.gen.nz
+ ns.tetra.co.nz
+ mail.tetra.co.nz
+ ns.securicard.co.nz
+ ns.underhour.co.nz
+ bcc.co.nz
+ security.org.nz
+ burglaralarms.co.nz
+ ns.safes.co.nz
+ ns.security.org.nz
+ couperconsulting.co.nz
+ securityguards.co.nz
+ ns.guards.co.nz
+ asis.org.nz
+ neru.co.nz
+ giftbasket.co.nz
+ magic.co.nz
+ mail.bcc.co.nz
+ ns.investigation.co.nz
+ nzipi.org.nz
+ ns.bouquet.co.nz
+ mail.safes.co.nz
+ ns.bcc.co.nz
+ ns.burglaralarms.co.nz
+ ns.securityguards.co.nz
+ covertcameras.co.nz
+ ns.neru.co.nz
+ ns.covertcameras.co.nz
+ bouquets.co.nz
+ concentric.co.nz
+ ns.securitytraining.co.nz
+ mail.couperconsulting.co.nz
+ retailsecurity.co.nz
+ ns.concentric.co.nz
+ mail.magic.co.nz
+ nzangling.co.nz
+ ns.couperconsulting.co.nz
+ ns.nzangling.co.nz
+ mail.storewatch.co.nz
+ swift.co.nz
+ mail.selective.co.nz
+ ns.forefront.co.nz
+ mail.nzangling.co.nz
+ guards.co.nz
+ mail.nzdesigns.co.nz
+ storewatch.co.nz
+ ns.securitymanagement.co.nz
+ mail.woolworths.co.nz
+ mail.concentric.co.nz
+ selective.co.nz
+ specialinvestigations.co.nz
+ ns.swift.co.nz
+ mail.swift.co.nz
+ ns.securenet.net.nz
+ privateinvestigation.co.nz
+ ns.privateinvestigation.co.nz
+ etrade.co.nz
+ ns.specialinvestigations.co.nz
+ mail.ansett.co.nz
+ ftp.warrent.co.nz
+ ns.retailsecurity.co.nz
+ mail.securitymanagement.co.nz
+ ns.magic.co.nz
+ mail.forefront.co.nz
+ mail.securicard.co.nz
+ securicard.co.nz
+ ns.nzdesigns.co.nz
+ safes.co.nz
+ ns.selective.co.nz
+ forefront.co.nz
+ securitymanagement.co.nz
+ underhour.co.nz
+ securenet.net.nz
+ mail.specialinvestigations.co.nz
+ nzdesigns.co.nz
+ ns.etrade.co.nz
+ mail.nzipi.org.nz
+ mail.underhour.co.nz
+ ns.asis.org.nz
+ ns.bouquets.co.nz
+ agate.co.nz
+254.0.99.203.in-addr.arpa flags 292 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86399
+rc=0
diff --git a/adns-0.6/regress/case-manyptrwrongrem.sys b/adns-0.6/regress/case-manyptrwrongrem.sys
new file mode 100644
index 0000000..3b90e59
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrongrem.sys
@@ -0,0 +1,1145 @@
+manyptrwrong
+292/254.0.99.203.in-addr.arpa
+ start 933286859.476326
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000271
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000083
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000062
+ sendto fd=4 addr=140.200.128.13:53
+ 311f0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.001694
+ sendto fd=4 addr=140.200.128.13:53
+ 31200100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.001119
+ sendto fd=4 addr=140.200.128.13:53
+ 31210100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 050001.
+ sendto=43
+ +0.001130
+ sendto fd=4 addr=140.200.128.13:53
+ 31220100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.001150
+ sendto fd=4 addr=140.200.128.13:53
+ 31230100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.001229
+ sendto fd=4 addr=140.200.128.13:53
+ 31240100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0d0001.
+ sendto=43
+ +0.001161
+ sendto fd=4 addr=140.200.128.13:53
+ 31250100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.001179
+ sendto fd=4 addr=140.200.128.13:53
+ 31260100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 100001.
+ sendto=43
+ +0.001152
+ sendto fd=4 addr=140.200.128.13:53
+ 31270100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.001143
+ sendto fd=4 addr=140.200.128.13:53
+ 31280100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.001191
+ sendto fd=4 addr=140.200.128.13:53
+ 31290100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.001150
+ sendto fd=4 addr=140.200.128.13:53
+ 312a0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.001220
+ sendto fd=4 addr=140.200.128.13:53
+ 312b0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.001148
+ sendto fd=4 addr=140.200.128.13:53
+ 312c0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.001183
+ sendto fd=4 addr=140.200.128.13:53
+ 312d0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.001193
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.981958
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.502250
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 311f8500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 01000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.001383
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000487
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.479532
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-892259
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31218500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 05000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000890
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000419
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.370482
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038604
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31228500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 06000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000852
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000399
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.330627
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038734
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31208500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 02000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000835
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000354
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.294103
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038824
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31248500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0d000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000863
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000406
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.254010
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.129111
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31238300 00010013 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000151 80001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 00015180 00080574 65747261 c043c00c
+ 000c0001 00015180 000d046d 61696c05 61676174 65c043c0 0c000c00 01000151
+ 80000502 6e73c06f c00c000c 00010001 51800013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 01000151 80001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 01000151 80001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 01518000 0a07626f 75717565 74c043c0 0c000c00 01000151
+ 8000100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 01000151 80000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 00015180 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 00015180 0002c03a c00c000c 00010001 51800010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010001 51800002 c0d2c00c
+ 000c0001 00015180 0005026e 73c056c0 0c000c00 01000151 80000704 6d61696c
+ c056c00c 000c0001 00015180 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 00015180 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 01518000 06036263 63c043.
+ +0.003324
+ socket type=SOCK_STREAM
+ socket=5
+ +0.001351
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000068
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000060
+ connect fd=5 addr=140.200.128.13:53
+ connect=EINPROGRESS
+ +0.000280
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000124
+ select max=6 rfds=[4] wfds=[5] efds=[] to=1.122082
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.034396
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31268500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 10000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000862
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000377
+ select max=6 rfds=[4] wfds=[5] efds=[] to=1.086447
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038752
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31258500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000842
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000365
+ select max=6 rfds=[4] wfds=[5] efds=[] to=1.048819
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038761
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31278500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 11000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000834
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000362
+ select max=6 rfds=[4] wfds=[5] efds=[] to=1.010005
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038783
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31288500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 01000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000832
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000411
+ select max=6 rfds=[4] wfds=[5] efds=[] to=0.971170
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.139078
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 312a8300 00010013 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000151 80001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 00015180 00080574 65747261 c043c00c
+ 000c0001 00015180 000d046d 61696c05 61676174 65c043c0 0c000c00 01000151
+ 80000502 6e73c06f c00c000c 00010001 51800013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 01000151 80001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 01000151 80001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 01518000 0a07626f 75717565 74c043c0 0c000c00 01000151
+ 8000100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 01000151 80000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 00015180 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 00015180 0002c03a c00c000c 00010001 51800010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010001 51800002 c0d2c00c
+ 000c0001 00015180 0005026e 73c056c0 0c000c00 01000151 80000704 6d61696c
+ c056c00c 000c0001 00015180 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 00015180 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 01518000 06036263 63c043.
+ +0.002995
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000416
+ select max=6 rfds=[4] wfds=[5] efds=[] to=0.828681
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.036200
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 312b8500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000832
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000371
+ select max=6 rfds=[4] wfds=[5] efds=[] to=0.791278
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038747
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31298500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 02000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000836
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000364
+ select max=6 rfds=[4] wfds=[5] efds=[] to=0.754849
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038774
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 312c8500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 06000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000832
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000430
+ select max=6 rfds=[4] wfds=[5] efds=[] to=0.715996
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038729
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 312d8500 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 11000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000837
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000373
+ select max=6 rfds=[4] wfds=[5] efds=[] to=13.539402
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.008807
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000213
+ write fd=5
+ 002b3123 01000001 00000000 00000332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.000894
+ write fd=5
+ 002b312a 01000001 00000000 00000332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.000449
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.529039
+ select=1 rfds=[5] wfds=[] efds=[]
+ +1.-90216
+ read fd=5 buflen=2
+ read=OK
+ 097f.
+ +0.000334
+ read fd=5 buflen=2431
+ read=OK
+ 31238500 0001005e 00020002 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000151 80001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 00015180 00080574 65747261 c043c00c
+ 000c0001 00015180 000d046d 61696c05 61676174 65c043c0 0c000c00 01000151
+ 80000502 6e73c06f c00c000c 00010001 51800013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 01000151 80001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 01000151 80001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 01518000 0a07626f 75717565 74c043c0 0c000c00 01000151
+ 8000100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 01000151 80000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 00015180 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 00015180 0002c03a c00c000c 00010001 51800010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010001 51800002 c0d2c00c
+ 000c0001 00015180 0005026e 73c056c0 0c000c00 01000151 80000704 6d61696c
+ c056c00c 000c0001 00015180 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 00015180 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 01518000 06036263 63c043c0 0c000c00 01000151 80000b08 73656375 72697479
+ c128c00c 000c0001 00015180 00100d62 7572676c 6172616c 61726d73 c043c00c
+ 000c0001 00015180 000b026e 73057361 666573c0 43c00c00 0c000100 01518000
+ 05026e73 c1f7c00c 000c0001 00015180 00131063 6f757065 72636f6e 73756c74
+ 696e67c0 43c00c00 0c000100 01518000 110e7365 63757269 74796775 61726473
+ c043c00c 000c0001 00015180 000c026e 73066775 61726473 c043c00c 000c0001
+ 00015180 00070461 736973c1 28c00c00 0c000100 01518000 02c13fc0 0c000c00
+ 01000151 800002c0 b6c00c00 0c000100 01518000 08056d61 676963c0 43c00c00
+ 0c000100 01518000 07046d61 696cc1e5 c00c000c 00010001 51800005 026e73c1
+ 03c00c00 0c000100 01518000 02c122c0 0c000c00 01000151 80000502 6e73c0ed
+ c00c000c 00010001 51800007 046d6169 6cc22dc0 0c000c00 01000151 80000502
+ 6e73c1e5 c00c000c 00010001 51800005 026e73c2 0ec00c00 0c000100 01518000
+ 05026e73 c271c00c 000c0001 00015180 00100d63 6f766572 7463616d 65726173
+ c043c00c 000c0001 00015180 0005026e 73c13fc0 0c000c00 01000151 80001302
+ 6e730d63 6f766572 7463616d 65726173 c043c00c 000c0001 00015180 000b0862
+ 6f757175 657473c0 43c00c00 0c000100 01518000 0d0a636f 6e63656e 74726963
+ c043c00c 000c0001 00015180 0005026e 73c094c0 0c000c00 01000151 80000704
+ 6d61696c c252c00c 000c0001 00015180 00110e72 65746169 6c736563 75726974
+ 79c043c0 0c000c00 01000151 80001002 6e730a63 6f6e6365 6e747269 63c043c0
+ 0c000c00 01000151 80000d04 6d61696c 056d6167 6963c043 c00c000c 00010001
+ 5180000c 096e7a61 6e676c69 6e67c043 c00c000c 00010001 51800005 026e73c2
+ 52c00c00 0c000100 01518000 0f026e73 096e7a61 6e676c69 6e67c043 c00c000c
+ 00010001 51800007 046d6169 6cc163c0 0c000c00 01000151 80000805 73776966
+ 74c043c0 0c000c00 01000151 80001104 6d61696c 0973656c 65637469 7665c043
+ c00c000c 00010001 5180000f 026e7309 666f7265 66726f6e 74c043c0 0c000c00
+ 01000151 80001104 6d61696c 096e7a61 6e676c69 6e67c043 c00c000c 00010001
+ 51800009 06677561 726473c0 43c00c00 0c000100 01518000 11046d61 696c096e
+ 7a646573 69676e73 c043c00c 000c0001 00015180 0002c163 c00c000c 00010001
+ 51800018 026e7312 73656375 72697479 6d616e61 67656d65 6e74c043 c00c000c
+ 00010001 51800012 046d6169 6c0a776f 6f6c776f 72746873 c043c00c 000c0001
+ 00015180 0012046d 61696c0a 636f6e63 656e.
+ +0.009121
+ read fd=5 buflen=973
+ read=EAGAIN
+ +0.000255
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=28.609545
+ select=1 rfds=[5] wfds=[] efds=[]
+ +1.-260444
+ read fd=5 buflen=973
+ read=OK
+ 74726963 c043c00c 000c0001 00015180 000c0973 656c6563 74697665 c043c00c
+ 000c0001 00015180 00181573 70656369 616c696e 76657374 69676174 696f6e73
+ c043c00c 000c0001 00015180 000b026e 73057377 696674c0 43c00c00 0c000100
+ 01518000 0d046d61 696c0573 77696674 c043c00c 000c0001 00015180 0013026e
+ 73097365 63757265 6e657403 6e6574c0 46c00c00 0c000100 01518000 17147072
+ 69766174 65696e76 65737469 67617469 6f6ec043 c00c000c 00010001 5180001a
+ 026e7314 70726976 61746569 6e766573 74696761 74696f6e c043c00c 000c0001
+ 00015180 00090665 74726164 65c043c0 0c000c00 01000151 80001b02 6e731573
+ 70656369 616c696e 76657374 69676174 696f6e73 c043c00c 000c0001 00015180
+ 000e046d 61696c06 616e7365 7474c043 c00c000c 00010001 5180000e 03667470
+ 07776172 72656e74 c043c00c 000c0001 00015180 0014026e 730e7265 7461696c
+ 73656375 72697479 c043c00c 000c0001 00015180 001a046d 61696c12 73656375
+ 72697479 6d616e61 67656d65 6e74c043 c00c000c 00010001 5180000b 026e7305
+ 6d616769 63c043c0 0c000c00 01000151 80001104 6d61696c 09666f72 6566726f
+ 6e74c043 c00c000c 00010001 51800007 046d6169 6cc1b1c0 0c000c00 01000151
+ 800002c1 b1c00c00 0c000100 01518000 0f026e73 096e7a64 65736967 6e73c043
+ c00c000c 00010001 51800002 c22dc00c 000c0001 00015180 000f026e 73097365
+ 6c656374 697665c0 43c00c00 0c000100 01518000 0c09666f 72656672 6f6e74c0
+ 43c00c00 0c000100 01518000 15127365 63757269 74796d61 6e616765 6d656e74
+ c043c00c 000c0001 00015180 0002c1cd c00c000c 00010001 51800010 09736563
+ 7572656e 6574036e 6574c046 c00c000c 00010001 5180001d 046d6169 6c157370
+ 65636961 6c696e76 65737469 67617469 6f6e73c0 43c00c00 0c000100 01518000
+ 0c096e7a 64657369 676e73c0 43c00c00 0c000100 01518000 0c026e73 06657472
+ 616465c0 43c00c00 0c000100 01518000 07046d61 696cc122 c00c000c 00010001
+ 51800007 046d6169 6cc1cdc0 0c000c00 01000151 80000a02 6e730461 736973c1
+ 28c00c00 0c000100 01518000 0e026e73 08626f75 71756574 73c043c0 0c000c00
+ 01000151 800002c0 6f013002 39390332 30330769 6e2d6164 64720461 72706100
+ 00020001 00015180 0002c037 01300239 39033230 3307696e 2d616464 72046172
+ 70610000 02000100 01518000 11036e73 31077761 696b6174 6f026163 c046c037
+ 00010001 00015180 0004cb63 00fe036e 73310777 61696b61 746f0261 63c04600
+ 01000100 01518000 048cc880 0d.
+ +0.005825
+ read fd=5 buflen=2433
+ read=EAGAIN
+ +0.018754
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=28.145272
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.355726
+ read fd=5 buflen=2433
+ read=OK
+ 097f312a 85000001 005e0002 00020332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 01518000 13026e73 08736563
+ 75726974 7902636f 026e7a00 c00c000c 00010001 51800008 05746574 7261c043
+ c00c000c 00010001 5180000d 046d6169 6c056167 617465c0 43c00c00 0c000100
+ 01518000 05026e73 c06fc00c 000c0001 00015180 00131073 65637572 69747974
+ 7261696e 696e67c0 43c00c00 0c000100 01518000 10026e73 0a676966 74626173
+ 6b6574c0 43c00c00 0c000100 01518000 12026e73 08736563 75726974 79036765
+ 6ec046c0 0c000c00 01000151 80000a07 626f7571 756574c0 43c00c00 0c000100
+ 01518000 100d696e 76657374 69676174 696f6ec0 43c00c00 0c000100 01518000
+ 0f026e73 056e7a69 7069036f 7267c046 c00c000c 00010001 5180000c 046d6169
+ 6c046e65 7275c043 c00c000c 00010001 51800002 c03ac00c 000c0001 00015180
+ 0010026e 730a7374 6f726577 61746368 c043c00c 000c0001 00015180 0002c0d2
+ c00c000c 00010001 51800005 026e73c0 56c00c00 0c000100 01518000 07046d61
+ 696cc056 c00c000c 00010001 51800010 026e730a 73656375 72696361 7264c043
+ c00c000c 00010001 5180000f 026e7309 756e6465 72686f75 72c043c0 0c000c00
+ 01000151 80000603 626363c0 43c00c00 0c000100 01518000 0b087365 63757269
+ 7479c128 c00c000c 00010001 51800010 0d627572 676c6172 616c6172 6d73c043
+ c00c000c 00010001 5180000b 026e7305 73616665 73c043c0 0c000c00 01000151
+ 80000502 6e73c1f7 c00c000c 00010001 51800013 10636f75 70657263 6f6e7375
+ 6c74696e 67c043c0 0c000c00 01000151 8000110e 73656375 72697479 67756172
+ 6473c043 c00c000c 00010001 5180000c 026e7306 67756172 6473c043 c00c000c
+ 00010001 51800007 04617369 73c128c0 0c000c00 01000151 800002c1 3fc00c00
+ 0c000100 01518000 02c0b6c0 0c000c00 01000151 80000805 6d616769 63c043c0
+ 0c000c00 01000151 80000704 6d61696c c1e5c00c 000c0001 00015180 0005026e
+ 73c103c0 0c000c00 01000151 800002c1 22c00c00 0c000100 01518000 05026e73
+ c0edc00c 000c0001 00015180 0007046d 61696cc2 2dc00c00 0c000100 01518000
+ 05026e73 c1e5c00c 000c0001 00015180 0005026e 73c20ec0 0c000c00 01000151
+ 80000502 6e73c271 c00c000c 00010001 51800010 0d636f76 65727463 616d6572
+ 6173c043 c00c000c 00010001 51800005 026e73c1 3fc00c00 0c000100 01518000
+ 13026e73 0d636f76 65727463 616d6572 6173c043 c00c000c 00010001 5180000b
+ 08626f75 71756574 73c043c0 0c000c00 01000151 80000d0a 636f6e63 656e7472
+ 6963c043 c00c000c 00010001 51800005 026e73c0 94c00c00 0c000100 01518000
+ 07046d61 696cc252 c00c000c 00010001 51800011 0e726574 61696c73 65637572
+ 697479c0 43c00c00 0c000100 01518000 10026e73 0a636f6e 63656e74 726963c0
+ 43c00c00 0c000100 01518000 0d046d61 696c056d 61676963 c043c00c 000c0001
+ 00015180 000c096e 7a616e67 6c696e67 c043c00c 000c0001 00015180 0005026e
+ 73c252c0 0c000c00 01000151 80000f02 6e73096e 7a616e67 6c696e67 c043c00c
+ 000c0001 00015180 0007046d 61696cc1 63c00c00 0c000100 01518000 08057377
+ 696674c0 43c00c00 0c000100 01518000 11046d61 696c0973 656c6563 74697665
+ c043c00c 000c0001 00015180 000f026e 7309666f 72656672 6f6e74c0 43c00c00
+ 0c000100 01518000 11046d61 696c096e 7a616e67 6c696e67 c043c00c 000c0001
+ 00015180 00090667 75617264 73c043c0 0c000c00 01000151 80001104 6d61696c
+ 096e7a64 65736967 6e73c043 c00c000c 00010001 51800002 c163c00c 000c0001
+ 00015180 0018026e 73127365 63757269 74796d61 6e616765 6d656e74 c043c00c
+ 000c0001 00015180 0012046d 61696c0a 776f6f6c 776f7274 6873c043 c00c000c
+ 00010001 51800012 046d6169 6c0a636f 6e63656e.
+ +0.008610
+ read fd=5 buflen=973
+ read=EAGAIN
+ +0.000242
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=27.780694
+ select=1 rfds=[5] wfds=[] efds=[]
+ +1.-129629
+ read fd=5 buflen=973
+ read=OK
+ 74726963 c043c00c 000c0001 00015180 000c0973 656c6563 74697665 c043c00c
+ 000c0001 00015180 00181573 70656369 616c696e 76657374 69676174 696f6e73
+ c043c00c 000c0001 00015180 000b026e 73057377 696674c0 43c00c00 0c000100
+ 01518000 0d046d61 696c0573 77696674 c043c00c 000c0001 00015180 0013026e
+ 73097365 63757265 6e657403 6e6574c0 46c00c00 0c000100 01518000 17147072
+ 69766174 65696e76 65737469 67617469 6f6ec043 c00c000c 00010001 5180001a
+ 026e7314 70726976 61746569 6e766573 74696761 74696f6e c043c00c 000c0001
+ 00015180 00090665 74726164 65c043c0 0c000c00 01000151 80001b02 6e731573
+ 70656369 616c696e 76657374 69676174 696f6e73 c043c00c 000c0001 00015180
+ 000e046d 61696c06 616e7365 7474c043 c00c000c 00010001 5180000e 03667470
+ 07776172 72656e74 c043c00c 000c0001 00015180 0014026e 730e7265 7461696c
+ 73656375 72697479 c043c00c 000c0001 00015180 001a046d 61696c12 73656375
+ 72697479 6d616e61 67656d65 6e74c043 c00c000c 00010001 5180000b 026e7305
+ 6d616769 63c043c0 0c000c00 01000151 80001104 6d61696c 09666f72 6566726f
+ 6e74c043 c00c000c 00010001 51800007 046d6169 6cc1b1c0 0c000c00 01000151
+ 800002c1 b1c00c00 0c000100 01518000 0f026e73 096e7a64 65736967 6e73c043
+ c00c000c 00010001 51800002 c22dc00c 000c0001 00015180 000f026e 73097365
+ 6c656374 697665c0 43c00c00 0c000100 01518000 0c09666f 72656672 6f6e74c0
+ 43c00c00 0c000100 01518000 15127365 63757269 74796d61 6e616765 6d656e74
+ c043c00c 000c0001 00015180 0002c1cd c00c000c 00010001 51800010 09736563
+ 7572656e 6574036e 6574c046 c00c000c 00010001 5180001d 046d6169 6c157370
+ 65636961 6c696e76 65737469 67617469 6f6e73c0 43c00c00 0c000100 01518000
+ 0c096e7a 64657369 676e73c0 43c00c00 0c000100 01518000 0c026e73 06657472
+ 616465c0 43c00c00 0c000100 01518000 07046d61 696cc122 c00c000c 00010001
+ 51800007 046d6169 6cc1cdc0 0c000c00 01000151 80000a02 6e730461 736973c1
+ 28c00c00 0c000100 01518000 0e026e73 08626f75 71756574 73c043c0 0c000c00
+ 01000151 800002c0 6f013002 39390332 30330769 6e2d6164 64720461 72706100
+ 00020001 00015180 0002c037 01300239 39033230 3307696e 2d616464 72046172
+ 70610000 02000100 01518000 11036e73 31077761 696b6174 6f026163 c046c037
+ 00010001 00015180 0004cb63 00fe036e 73310777 61696b61 746f0261 63c04600
+ 01000100 01518000 048cc880 0d.
+ +0.005848
+ sendto fd=4 addr=140.200.128.13:53
+ 312e0100 00010000 00000000 026e7308 73656375 72697479 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.002592
+ sendto fd=4 addr=140.200.128.13:53
+ 312f0100 00010000 00000000 05746574 72610263 6f026e7a 00000100 01.
+ sendto=29
+ +0.000963
+ sendto fd=4 addr=140.200.128.13:53
+ 31300100 00010000 00000000 046d6169 6c056167 61746502 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000973
+ sendto fd=4 addr=140.200.128.13:53
+ 31310100 00010000 00000000 026e7305 61676174 6502636f 026e7a00 00010001.
+ sendto=32
+ +0.000977
+ sendto fd=4 addr=140.200.128.13:53
+ 31320100 00010000 00000000 10736563 75726974 79747261 696e696e 6702636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001007
+ sendto fd=4 addr=140.200.128.13:53
+ 31330100 00010000 00000000 026e730a 67696674 6261736b 65740263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001027
+ sendto fd=4 addr=140.200.128.13:53
+ 31340100 00010000 00000000 026e7308 73656375 72697479 0367656e 026e7a00
+ 00010001.
+ sendto=36
+ +0.000989
+ sendto fd=4 addr=140.200.128.13:53
+ 31350100 00010000 00000000 07626f75 71756574 02636f02 6e7a0000 010001.
+ sendto=31
+ +0.000946
+ sendto fd=4 addr=140.200.128.13:53
+ 31360100 00010000 00000000 0d696e76 65737469 67617469 6f6e0263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.000996
+ sendto fd=4 addr=140.200.128.13:53
+ 31370100 00010000 00000000 026e7305 6e7a6970 69036f72 67026e7a 00000100
+ 01.
+ sendto=33
+ +0.000972
+ sendto fd=4 addr=140.200.128.13:53
+ 31380100 00010000 00000000 046d6169 6c046e65 72750263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.000980
+ sendto fd=4 addr=140.200.128.13:53
+ 31390100 00010000 00000000 08736563 75726974 7902636f 026e7a00 00010001.
+ sendto=32
+ +0.000958
+ sendto fd=4 addr=140.200.128.13:53
+ 313a0100 00010000 00000000 026e730a 73746f72 65776174 63680263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001038
+ sendto fd=4 addr=140.200.128.13:53
+ 313b0100 00010000 00000000 08736563 75726974 79036765 6e026e7a 00000100
+ 01.
+ sendto=33
+ +0.001003
+ sendto fd=4 addr=140.200.128.13:53
+ 313c0100 00010000 00000000 026e7305 74657472 6102636f 026e7a00 00010001.
+ sendto=32
+ +0.000972
+ sendto fd=4 addr=140.200.128.13:53
+ 313d0100 00010000 00000000 046d6169 6c057465 74726102 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.000983
+ sendto fd=4 addr=140.200.128.13:53
+ 313e0100 00010000 00000000 026e730a 73656375 72696361 72640263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.000996
+ sendto fd=4 addr=140.200.128.13:53
+ 313f0100 00010000 00000000 026e7309 756e6465 72686f75 7202636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.000989
+ sendto fd=4 addr=140.200.128.13:53
+ 31400100 00010000 00000000 03626363 02636f02 6e7a0000 010001.
+ sendto=27
+ +0.000944
+ sendto fd=4 addr=140.200.128.13:53
+ 31410100 00010000 00000000 08736563 75726974 79036f72 67026e7a 00000100
+ 01.
+ sendto=33
+ +0.001001
+ sendto fd=4 addr=140.200.128.13:53
+ 31420100 00010000 00000000 0d627572 676c6172 616c6172 6d730263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001213
+ sendto fd=4 addr=140.200.128.13:53
+ 31430100 00010000 00000000 026e7305 73616665 7302636f 026e7a00 00010001.
+ sendto=32
+ +0.001241
+ sendto fd=4 addr=140.200.128.13:53
+ 31440100 00010000 00000000 026e7308 73656375 72697479 036f7267 026e7a00
+ 00010001.
+ sendto=36
+ +0.001489
+ sendto fd=4 addr=140.200.128.13:53
+ 31450100 00010000 00000000 10636f75 70657263 6f6e7375 6c74696e 6702636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001355
+ sendto fd=4 addr=140.200.128.13:53
+ 31460100 00010000 00000000 0e736563 75726974 79677561 72647302 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001389
+ sendto fd=4 addr=140.200.128.13:53
+ 31470100 00010000 00000000 026e7306 67756172 64730263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001299
+ sendto fd=4 addr=140.200.128.13:53
+ 31480100 00010000 00000000 04617369 73036f72 67026e7a 00000100 01.
+ sendto=29
+ +0.001325
+ sendto fd=4 addr=140.200.128.13:53
+ 31490100 00010000 00000000 046e6572 7502636f 026e7a00 00010001.
+ sendto=28
+ +0.001328
+ sendto fd=4 addr=140.200.128.13:53
+ 314a0100 00010000 00000000 0a676966 74626173 6b657402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001356
+ sendto fd=4 addr=140.200.128.13:53
+ 314b0100 00010000 00000000 056d6167 69630263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001307
+ sendto fd=4 addr=140.200.128.13:53
+ 314c0100 00010000 00000000 046d6169 6c036263 6302636f 026e7a00 00010001.
+ sendto=32
+ +0.001375
+ sendto fd=4 addr=140.200.128.13:53
+ 314d0100 00010000 00000000 026e730d 696e7665 73746967 6174696f 6e02636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001386
+ sendto fd=4 addr=140.200.128.13:53
+ 314e0100 00010000 00000000 056e7a69 7069036f 7267026e 7a000001 0001.
+ sendto=30
+ +0.001327
+ sendto fd=4 addr=140.200.128.13:53
+ 314f0100 00010000 00000000 026e7307 626f7571 75657402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001327
+ sendto fd=4 addr=140.200.128.13:53
+ 31500100 00010000 00000000 046d6169 6c057361 66657302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001405
+ sendto fd=4 addr=140.200.128.13:53
+ 31510100 00010000 00000000 026e7303 62636302 636f026e 7a000001 0001.
+ sendto=30
+ +0.001360
+ sendto fd=4 addr=140.200.128.13:53
+ 31520100 00010000 00000000 026e730d 62757267 6c617261 6c61726d 7302636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001401
+ sendto fd=4 addr=140.200.128.13:53
+ 31530100 00010000 00000000 026e730e 73656375 72697479 67756172 64730263
+ 6f026e7a 00000100 01.
+ sendto=41
+ +0.001460
+ sendto fd=4 addr=140.200.128.13:53
+ 31540100 00010000 00000000 0d636f76 65727463 616d6572 61730263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001355
+ sendto fd=4 addr=140.200.128.13:53
+ 31550100 00010000 00000000 026e7304 6e657275 02636f02 6e7a0000 010001.
+ sendto=31
+ +0.001384
+ sendto fd=4 addr=140.200.128.13:53
+ 31560100 00010000 00000000 026e730d 636f7665 72746361 6d657261 7302636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001389
+ sendto fd=4 addr=140.200.128.13:53
+ 31570100 00010000 00000000 08626f75 71756574 7302636f 026e7a00 00010001.
+ sendto=32
+ +0.001386
+ sendto fd=4 addr=140.200.128.13:53
+ 31580100 00010000 00000000 0a636f6e 63656e74 72696302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001352
+ sendto fd=4 addr=140.200.128.13:53
+ 31590100 00010000 00000000 026e7310 73656375 72697479 74726169 6e696e67
+ 02636f02 6e7a0000 010001.
+ sendto=43
+ +0.001418
+ sendto fd=4 addr=140.200.128.13:53
+ 315a0100 00010000 00000000 046d6169 6c10636f 75706572 636f6e73 756c7469
+ 6e670263 6f026e7a 00000100 01.
+ sendto=45
+ +0.001422
+ sendto fd=4 addr=140.200.128.13:53
+ 315b0100 00010000 00000000 0e726574 61696c73 65637572 69747902 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001320
+ sendto fd=4 addr=140.200.128.13:53
+ 315c0100 00010000 00000000 026e730a 636f6e63 656e7472 69630263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001391
+ sendto fd=4 addr=140.200.128.13:53
+ 315d0100 00010000 00000000 046d6169 6c056d61 67696302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001430
+ sendto fd=4 addr=140.200.128.13:53
+ 315e0100 00010000 00000000 096e7a61 6e676c69 6e670263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001373
+ sendto fd=4 addr=140.200.128.13:53
+ 315f0100 00010000 00000000 026e7310 636f7570 6572636f 6e73756c 74696e67
+ 02636f02 6e7a0000 010001.
+ sendto=43
+ +0.001399
+ sendto fd=4 addr=140.200.128.13:53
+ 31600100 00010000 00000000 026e7309 6e7a616e 676c696e 6702636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001403
+ sendto fd=4 addr=140.200.128.13:53
+ 31610100 00010000 00000000 046d6169 6c0a7374 6f726577 61746368 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001431
+ sendto fd=4 addr=140.200.128.13:53
+ 31620100 00010000 00000000 05737769 66740263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001341
+ sendto fd=4 addr=140.200.128.13:53
+ 31630100 00010000 00000000 046d6169 6c097365 6c656374 69766502 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001383
+ sendto fd=4 addr=140.200.128.13:53
+ 31640100 00010000 00000000 026e7309 666f7265 66726f6e 7402636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001398
+ sendto fd=4 addr=140.200.128.13:53
+ 31650100 00010000 00000000 046d6169 6c096e7a 616e676c 696e6702 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001396
+ sendto fd=4 addr=140.200.128.13:53
+ 31660100 00010000 00000000 06677561 72647302 636f026e 7a000001 0001.
+ sendto=30
+ +0.001338
+ sendto fd=4 addr=140.200.128.13:53
+ 31670100 00010000 00000000 046d6169 6c096e7a 64657369 676e7302 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001383
+ sendto fd=4 addr=140.200.128.13:53
+ 31680100 00010000 00000000 0a73746f 72657761 74636802 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001411
+ sendto fd=4 addr=140.200.128.13:53
+ 31690100 00010000 00000000 026e7312 73656375 72697479 6d616e61 67656d65
+ 6e740263 6f026e7a 00000100 01.
+ sendto=45
+ +0.001441
+ sendto fd=4 addr=140.200.128.13:53
+ 316a0100 00010000 00000000 046d6169 6c0a776f 6f6c776f 72746873 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001416
+ sendto fd=4 addr=140.200.128.13:53
+ 316b0100 00010000 00000000 046d6169 6c0a636f 6e63656e 74726963 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001440
+ sendto fd=4 addr=140.200.128.13:53
+ 316c0100 00010000 00000000 0973656c 65637469 76650263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001390
+ sendto fd=4 addr=140.200.128.13:53
+ 316d0100 00010000 00000000 15737065 6369616c 696e7665 73746967 6174696f
+ 6e730263 6f026e7a 00000100 01.
+ sendto=45
+ +0.001803
+ sendto fd=4 addr=140.200.128.13:53
+ 316e0100 00010000 00000000 026e7305 73776966 7402636f 026e7a00 00010001.
+ sendto=32
+ +0.001450
+ sendto fd=4 addr=140.200.128.13:53
+ 316f0100 00010000 00000000 046d6169 6c057377 69667402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001516
+ sendto fd=4 addr=140.200.128.13:53
+ 31700100 00010000 00000000 026e7309 73656375 72656e65 74036e65 74026e7a
+ 00000100 01.
+ sendto=37
+ +0.001511
+ sendto fd=4 addr=140.200.128.13:53
+ 31710100 00010000 00000000 14707269 76617465 696e7665 73746967 6174696f
+ 6e02636f 026e7a00 00010001.
+ sendto=44
+ +0.001585
+ sendto fd=4 addr=140.200.128.13:53
+ 31720100 00010000 00000000 026e7314 70726976 61746569 6e766573 74696761
+ 74696f6e 02636f02 6e7a0000 010001.
+ sendto=47
+ +0.001571
+ sendto fd=4 addr=140.200.128.13:53
+ 31730100 00010000 00000000 06657472 61646502 636f026e 7a000001 0001.
+ sendto=30
+ +0.001459
+ sendto fd=4 addr=140.200.128.13:53
+ 31740100 00010000 00000000 026e7315 73706563 69616c69 6e766573 74696761
+ 74696f6e 7302636f 026e7a00 00010001.
+ sendto=48
+ +0.001537
+ sendto fd=4 addr=140.200.128.13:53
+ 31750100 00010000 00000000 046d6169 6c06616e 73657474 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.001466
+ sendto fd=4 addr=140.200.128.13:53
+ 31760100 00010000 00000000 03667470 07776172 72656e74 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.001485
+ sendto fd=4 addr=140.200.128.13:53
+ 31770100 00010000 00000000 026e730e 72657461 696c7365 63757269 74790263
+ 6f026e7a 00000100 01.
+ sendto=41
+ +0.001528
+ sendto fd=4 addr=140.200.128.13:53
+ 31780100 00010000 00000000 046d6169 6c127365 63757269 74796d61 6e616765
+ 6d656e74 02636f02 6e7a0000 010001.
+ sendto=47
+ +0.001593
+ sendto fd=4 addr=140.200.128.13:53
+ 31790100 00010000 00000000 026e7305 6d616769 6302636f 026e7a00 00010001.
+ sendto=32
+ +0.001465
+ sendto fd=4 addr=140.200.128.13:53
+ 317a0100 00010000 00000000 046d6169 6c09666f 72656672 6f6e7402 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001473
+ sendto fd=4 addr=140.200.128.13:53
+ 317b0100 00010000 00000000 046d6169 6c0a7365 63757269 63617264 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001525
+ sendto fd=4 addr=140.200.128.13:53
+ 317c0100 00010000 00000000 0a736563 75726963 61726402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001499
+ sendto fd=4 addr=140.200.128.13:53
+ 317d0100 00010000 00000000 026e7309 6e7a6465 7369676e 7302636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001489
+ sendto fd=4 addr=140.200.128.13:53
+ 317e0100 00010000 00000000 05736166 65730263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001441
+ sendto fd=4 addr=140.200.128.13:53
+ 317f0100 00010000 00000000 026e7309 73656c65 63746976 6502636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001542
+ sendto fd=4 addr=140.200.128.13:53
+ 31800100 00010000 00000000 09666f72 6566726f 6e740263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001473
+ sendto fd=4 addr=140.200.128.13:53
+ 31810100 00010000 00000000 12736563 75726974 796d616e 6167656d 656e7402
+ 636f026e 7a000001 0001.
+ sendto=42
+ +0.001525
+ sendto fd=4 addr=140.200.128.13:53
+ 31820100 00010000 00000000 09756e64 6572686f 75720263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001469
+ sendto fd=4 addr=140.200.128.13:53
+ 31830100 00010000 00000000 09736563 7572656e 6574036e 6574026e 7a000001
+ 0001.
+ sendto=34
+ +0.001535
+ sendto fd=4 addr=140.200.128.13:53
+ 31840100 00010000 00000000 046d6169 6c157370 65636961 6c696e76 65737469
+ 67617469 6f6e7302 636f026e 7a000001 0001.
+ sendto=50
+ +0.001597
+ sendto fd=4 addr=140.200.128.13:53
+ 31850100 00010000 00000000 096e7a64 65736967 6e730263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001526
+ sendto fd=4 addr=140.200.128.13:53
+ 31860100 00010000 00000000 026e7306 65747261 64650263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001451
+ sendto fd=4 addr=140.200.128.13:53
+ 31870100 00010000 00000000 046d6169 6c056e7a 69706903 6f726702 6e7a0000
+ 010001.
+ sendto=35
+ +0.001513
+ sendto fd=4 addr=140.200.128.13:53
+ 31880100 00010000 00000000 046d6169 6c09756e 64657268 6f757202 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001508
+ sendto fd=4 addr=140.200.128.13:53
+ 31890100 00010000 00000000 026e7304 61736973 036f7267 026e7a00 00010001.
+ sendto=32
+ +0.001491
+ sendto fd=4 addr=140.200.128.13:53
+ 318a0100 00010000 00000000 026e7308 626f7571 75657473 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.001507
+ sendto fd=4 addr=140.200.128.13:53
+ 318b0100 00010000 00000000 05616761 74650263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001445
+ read fd=5 buflen=2433
+ read=EAGAIN
+ +0.000151
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.866584
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-544428
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 312f8500 00010001 00020002 05746574 72610263 6f026e7a 00000100 01c00c00
+ 01000100 01518000 04cb6300 fec00c00 02000100 01518000 05026e73 c00cc00c
+ 00020001 00015180 0013036e 73310777 61696b61 746f0261 63026e7a 00c03900
+ 01000100 01518000 04cb6300 fec04a00 01000100 01518000 048cc880 0d.
+ +0.000996
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000668
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.409348
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038307
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31308500 00010001 00020002 046d6169 6c056167 61746502 636f026e 7a000001
+ 0001c00c 00010001 00015180 0004cb63 00fe0561 67617465 02636f02 6e7a0000
+ 02000100 01518000 11036e73 31077761 696b6174 6f026163 c03bc032 00020001
+ 00015180 0005026e 73c032c0 49000100 01000151 8000048c c8800dc0 66000100
+ 01000151 800004cb 6300fe.
+ +0.000984
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000506
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.369551
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.048503
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 312e8500 00010001 00020002 026e7308 73656375 72697479 02636f02 6e7a0000
+ 010001c0 0c000100 01000151 800004cb 6300fe08 73656375 72697479 02636f02
+ 6e7a0000 02000100 01518000 11036e73 31077761 696b6174 6f026163 c03fc033
+ 00020001 00015180 0002c00c c04d0001 00010001 51800004 8cc8800d c00c0001
+ 00010001 51800004 cb6300fe.
+ +0.000997
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000452
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.319599
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038521
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31338500 00010001 00020002 026e730a 67696674 6261736b 65740263 6f026e7a
+ 00000100 01c00c00 01000100 01518000 04cb6300 fe0a6769 66746261 736b6574
+ 02636f02 6e7a0000 02000100 01518000 11036e73 31077761 696b6174 6f026163
+ c043c035 00020001 00015180 0002c00c c0510001 00010001 51800004 8cc8800d
+ c00c0001 00010001 51800004 cb6300fe.
+ +0.001008
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000490
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.279580
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.048476
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31348500 00010001 00020002 026e7308 73656375 72697479 0367656e 026e7a00
+ 00010001 c00c0001 00010001 51800004 cb6300fe 08736563 75726974 79036765
+ 6e026e7a 00000200 01000151 80001103 6e733107 7761696b 61746f02 6163c041
+ c0340002 00010001 51800002 c00cc04f 00010001 00015180 00048cc8 800dc00c
+ 00010001 00015180 0004cb63 00fe.
+ +0.000998
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000439
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.229667
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038524
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31358500 00010001 00020002 07626f75 71756574 02636f02 6e7a0000 010001c0
+ 0c000100 01000151 800004cb 6300fec0 0c000200 01000151 80000502 6e73c00c
+ c00c0002 00010001 51800013 036e7331 07776169 6b61746f 02616302 6e7a00c0
+ 3b000100 01000151 800004cb 6300fec0 4c000100 01000151 8000048c c8800d.
+ +0.000911
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000464
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.189768
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038708
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31318500 00010001 00020002 026e7305 61676174 6502636f 026e7a00 00010001
+ c00c0001 00010001 51800004 cb6300fe 05616761 74650263 6f026e7a 00000200
+ 01000151 80001103 6e733107 7761696b 61746f02 6163c039 c0300002 00010001
+ 51800002 c00cc047 00010001 00015180 00048cc8 800dc00c 00010001 00015180
+ 0004cb63 00fe.
+ +0.000951
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000436
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.149673
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.048494
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31328500 00010001 00020002 10736563 75726974 79747261 696e696e 6702636f
+ 026e7a00 00010001 c00c0001 00010001 51800004 cb6300fe c00c0002 00010001
+ 51800005 026e73c0 0cc00c00 02000100 01518000 13036e73 31077761 696b6174
+ 6f026163 026e7a00 c0440001 00010001 51800004 cb6300fe c0550001 00010001
+ 51800004 8cc8800d.
+ +0.000991
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000442
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.099746
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038540
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31368500 00010001 00020002 0d696e76 65737469 67617469 6f6e0263 6f026e7a
+ 00000100 01c00c00 01000100 01518000 04cb6300 fec00c00 02000100 01518000
+ 05026e73 c00cc00c 00020001 00015180 0013036e 73310777 61696b61 746f0261
+ 63026e7a 00c04100 01000100 01518000 04cb6300 fec05200 01000100 01518000
+ 048cc880 0d.
+ +0.000944
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000437
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.059825
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038599
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31378500 00010001 00020002 026e7305 6e7a6970 69036f72 67026e7a 00000100
+ 01c00c00 01000100 01518000 04cb6300 fe056e7a 69706903 6f726702 6e7a0000
+ 02000100 01518000 11036e73 31077761 696b6174 6f026163 c03bc031 00020001
+ 00015180 0002c00c c0490001 00010001 51800004 8cc8800d c00c0001 00010001
+ 51800004 cb6300fe.
+ +0.000960
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000445
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.019821
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.048560
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 31398500 00010001 00020002 08736563 75726974 7902636f 026e7a00 00010001
+ c00c0001 00010001 51800004 cb6300fe c00c0002 00010001 51800013 036e7331
+ 07776169 6b61746f 02616302 6e7a00c0 0c000200 01000151 80000502 6e73c00c
+ c03c0001 00010001 51800004 8cc8800d c05b0001 00010001 51800004 cb6300fe.
+ +0.000913
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000471
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.969877
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.028575
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=140.200.128.13:53
+ 313a8503 00010000 00010000 026e730a 73746f72 65776174 63680263 6f026e7a
+ 00000100 0102636f 026e7a00 00060001 00015180 002c046e 73393907 7761696b
+ 61746f02 6163c028 03736f61 c03b7727 6ec50000 0e100000 07080027 8d000001
+ 5180.
+ +0.000739
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.023574
+ close fd=4
+ close=OK
+ +0.000464
+ close fd=5
+ close=OK
+ +0.000179
diff --git a/adns-0.6/regress/case-manyptrwrongrst.err b/adns-0.6/regress/case-manyptrwrongrst.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrongrst.err
diff --git a/adns-0.6/regress/case-manyptrwrongrst.out b/adns-0.6/regress/case-manyptrwrongrst.out
new file mode 100644
index 0000000..e48321d
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrongrst.out
@@ -0,0 +1,132 @@
+adns debug: using nameserver 172.18.45.6
+254.0.99.203.in-addr.arpa flags 292 type 1 A(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 2 NS(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 5 CNAME(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 6 SOA(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 12 PTR(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 13 HINFO(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 15 MX(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 16 TXT(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 17 RP(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65537 A(addr) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65538 NS(+addr) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65548 PTR(checked) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65551 MX(+addr) submitted
+254.0.99.203.in-addr.arpa flags 292 type 131078 SOA(822) submitted
+254.0.99.203.in-addr.arpa flags 292 type 131089 RP(822) submitted
+254.0.99.203.in-addr.arpa flags 292 type A(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=162
+254.0.99.203.in-addr.arpa flags 292 type NS(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type CNAME(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type HINFO(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type A(addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=162
+254.0.99.203.in-addr.arpa flags 292 type TXT(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=162
+254.0.99.203.in-addr.arpa flags 292 type SOA(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+254.0.99.203.in-addr.arpa flags 292 type MX(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+adns debug: reply not found, id 3129, query owner 254.0.99.203.in-addr.arpa (NS=172.18.45.6)
+254.0.99.203.in-addr.arpa flags 292 type NS(+addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=600
+254.0.99.203.in-addr.arpa flags 292 type MX(+addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=600
+254.0.99.203.in-addr.arpa flags 292 type SOA(822): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=600
+adns debug: reply not found, id 312b, query owner 254.0.99.203.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 312c, query owner 254.0.99.203.in-addr.arpa (NS=172.18.45.6)
+254.0.99.203.in-addr.arpa flags 292 type RP(822): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+adns debug: reply not found, id 312d, query owner 254.0.99.203.in-addr.arpa (NS=172.18.45.6)
+254.0.99.203.in-addr.arpa flags 292 type RP(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=598
+adns debug: TCP connected (NS=172.18.45.6)
+adns debug: reply not found, id 312a, query owner 254.0.99.203.in-addr.arpa (NS=172.18.45.6)
+254.0.99.203.in-addr.arpa flags 292 type PTR(raw): OK; nrrs=94; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=20169
+ ns.security.co.nz
+ tetra.co.nz
+ mail.agate.co.nz
+ ns.agate.co.nz
+ securitytraining.co.nz
+ ns.giftbasket.co.nz
+ ns.security.gen.nz
+ bouquet.co.nz
+ investigation.co.nz
+ ns.nzipi.org.nz
+ mail.neru.co.nz
+ security.co.nz
+ ns.storewatch.co.nz
+ security.gen.nz
+ ns.tetra.co.nz
+ mail.tetra.co.nz
+ ns.securicard.co.nz
+ ns.underhour.co.nz
+ bcc.co.nz
+ security.org.nz
+ burglaralarms.co.nz
+ ns.safes.co.nz
+ ns.security.org.nz
+ couperconsulting.co.nz
+ securityguards.co.nz
+ ns.guards.co.nz
+ asis.org.nz
+ neru.co.nz
+ giftbasket.co.nz
+ magic.co.nz
+ mail.bcc.co.nz
+ ns.investigation.co.nz
+ nzipi.org.nz
+ ns.bouquet.co.nz
+ mail.safes.co.nz
+ ns.bcc.co.nz
+ ns.burglaralarms.co.nz
+ ns.securityguards.co.nz
+ covertcameras.co.nz
+ ns.neru.co.nz
+ ns.covertcameras.co.nz
+ bouquets.co.nz
+ concentric.co.nz
+ ns.securitytraining.co.nz
+ mail.couperconsulting.co.nz
+ retailsecurity.co.nz
+ ns.concentric.co.nz
+ mail.magic.co.nz
+ nzangling.co.nz
+ ns.couperconsulting.co.nz
+ ns.nzangling.co.nz
+ mail.storewatch.co.nz
+ swift.co.nz
+ mail.selective.co.nz
+ ns.forefront.co.nz
+ mail.nzangling.co.nz
+ guards.co.nz
+ mail.nzdesigns.co.nz
+ storewatch.co.nz
+ ns.securitymanagement.co.nz
+ mail.woolworths.co.nz
+ mail.concentric.co.nz
+ selective.co.nz
+ specialinvestigations.co.nz
+ ns.swift.co.nz
+ mail.swift.co.nz
+ ns.securenet.net.nz
+ privateinvestigation.co.nz
+ ns.privateinvestigation.co.nz
+ etrade.co.nz
+ ns.specialinvestigations.co.nz
+ mail.ansett.co.nz
+ ftp.warrent.co.nz
+ ns.retailsecurity.co.nz
+ mail.securitymanagement.co.nz
+ ns.magic.co.nz
+ mail.forefront.co.nz
+ mail.securicard.co.nz
+ securicard.co.nz
+ ns.nzdesigns.co.nz
+ safes.co.nz
+ ns.selective.co.nz
+ forefront.co.nz
+ securitymanagement.co.nz
+ underhour.co.nz
+ securenet.net.nz
+ mail.specialinvestigations.co.nz
+ nzdesigns.co.nz
+ ns.etrade.co.nz
+ mail.nzipi.org.nz
+ mail.underhour.co.nz
+ ns.asis.org.nz
+ ns.bouquets.co.nz
+ agate.co.nz
+254.0.99.203.in-addr.arpa flags 292 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=20167
+rc=0
diff --git a/adns-0.6/regress/case-manyptrwrongrst.sys b/adns-0.6/regress/case-manyptrwrongrst.sys
new file mode 100644
index 0000000..227264f
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrongrst.sys
@@ -0,0 +1,1209 @@
+default
+292/254.0.99.203.in-addr.arpa
+ start 933289772.727140
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000265
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000089
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000067
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.004394
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.003204
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 050001.
+ sendto=43
+ +0.003203
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.003315
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.003207
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0d0001.
+ sendto=43
+ +0.003263
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.003208
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 100001.
+ sendto=43
+ +0.003221
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.003221
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.003315
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.003215
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.003247
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.003252
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.003368
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.003230
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.950137
+ select=1 rfds=[4] wfds=[] efds=[]
+ +2.-643984
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 01000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 00a2002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.001188
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000472
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.596855
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.176497
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 02000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000885
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000392
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.422285
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.049249
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 05000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.001133
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000450
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.374656
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.026086
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0d000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000914
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000411
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.347245
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.041288
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 01000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 00a2002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000882
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000437
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.304638
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.035548
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 10000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 00a2002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.001120
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000442
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.267528
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038130
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 06000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.001107
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000697
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.230909
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.088915
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000881
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000428
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.140685
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.149669
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.002605
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.001310
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.007369
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.002868
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.002428
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000824
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004373
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.002426
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.002419
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 02000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 0258002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.001124
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 02000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 0258002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.003807
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000397
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.002641
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.002667
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.970184
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003668
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 0258002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000882
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 06000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 0258002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.003257
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000436
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.956633
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.015305
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 0258002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.001159
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000349
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.939820
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038251
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 06000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 0258002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000880
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000323
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.900366
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039069
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 11000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000881
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000448
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.859968
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-420413
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 11000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 0257002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000922
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000399
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.279060
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.176624
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 11000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 0256002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000917
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000466
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.101053
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.100567
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000486
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009988
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.001186
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.008955
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008816
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000139
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009991
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.001137
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.978870
+ select=1 rfds=[4] wfds=[] efds=[]
+ +2.-569657
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238380 00010013 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 0100004e cb001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 00004ecb 00080574 65747261 c043c00c
+ 000c0001 00004ecb 000d046d 61696c05 61676174 65c043c0 0c000c00 0100004e
+ cb000502 6e73c06f c00c000c 00010000 4ecb0013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 0100004e cb001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 0100004e cb001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 004ecb00 0a07626f 75717565 74c043c0 0c000c00 0100004e
+ cb00100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 0100004e cb000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 00004ecb 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 00004ecb 0002c03a c00c000c 00010000 4ecb0010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010000 4ecb0002 c0d2c00c
+ 000c0001 00004ecb 0005026e 73c056c0 0c000c00 0100004e cb000704 6d61696c
+ c056c00c 000c0001 00004ecb 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 00004ecb 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 004ecb00 06036263 63c043.
+ +0.003463
+ socket type=SOCK_STREAM
+ socket=5
+ +0.001488
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000076
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000067
+ connect fd=5 addr=172.18.45.6:53
+ connect=EINPROGRESS
+ +0.000978
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000143
+ select max=6 rfds=[4] wfds=[5] efds=[] to=0.562305
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.001347
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000274
+ write fd=5
+ 002b3123 01000001 00000000 00000332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.001176
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.559508
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.559030
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.000478
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010029
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.001273
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.998727
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.140762
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8380 00010013 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 0100004e ca001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 00004eca 00080574 65747261 c043c00c
+ 000c0001 00004eca 000d046d 61696c05 61676174 65c043c0 0c000c00 0100004e
+ ca000502 6e73c06f c00c000c 00010000 4eca0013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 0100004e ca001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 0100004e ca001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 004eca00 0a07626f 75717565 74c043c0 0c000c00 0100004e
+ ca00100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 0100004e ca000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 00004eca 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 00004eca 0002c03a c00c000c 00010000 4eca0010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010000 4eca0002 c0d2c00c
+ 000c0001 00004eca 0005026e 73c056c0 0c000c00 0100004e ca000704 6d61696c
+ c056c00c 000c0001 00004eca 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 00004eca 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 004eca00 06036263 63c043.
+ +0.003063
+ write fd=5
+ 002b312a 01000001 00000000 00000332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.001448
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000169
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.275214
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-921124
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8380 00010013 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 0100004e ca001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 00004eca 00080574 65747261 c043c00c
+ 000c0001 00004eca 000d046d 61696c05 61676174 65c043c0 0c000c00 0100004e
+ ca000502 6e73c06f c00c000c 00010000 4eca0013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 0100004e ca001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 0100004e ca001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 004eca00 0a07626f 75717565 74c043c0 0c000c00 0100004e
+ ca00100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 0100004e ca000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 00004eca 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 00004eca 0002c03a c00c000c 00010000 4eca0010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010000 4eca0002 c0d2c00c
+ 000c0001 00004eca 0005026e 73c056c0 0c000c00 0100004e ca000704 6d61696c
+ c056c00c 000c0001 00004eca 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 00004eca 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 004eca00 06036263 63c043.
+ +0.003054
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000483
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.192801
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.817055
+ read fd=5 buflen=2
+ read=OK
+ 096f.
+ +0.000391
+ read fd=5 buflen=2415
+ read=OK
+ 31238180 0001005e 00020001 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 0100004e c9001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 00004ec9 00080574 65747261 c043c00c
+ 000c0001 00004ec9 000d046d 61696c05 61676174 65c043c0 0c000c00 0100004e
+ c9000502 6e73c06f c00c000c 00010000 4ec90013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 0100004e c9001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 0100004e c9001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 004ec900 0a07626f 75717565 74c043c0 0c000c00 0100004e
+ c900100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 0100004e c9000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 00004ec9 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 00004ec9 0002c03a c00c000c 00010000 4ec90010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010000 4ec90002 c0d2c00c
+ 000c0001 00004ec9 0005026e 73c056c0 0c000c00 0100004e c9000704 6d61696c
+ c056c00c 000c0001 00004ec9 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 00004ec9 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 004ec900 06036263 63c043c0 0c000c00 0100004e c9000b08 73656375 72697479
+ c128c00c 000c0001 00004ec9 00100d62 7572676c 6172616c 61726d73 c043c00c
+ 000c0001 00004ec9 000b026e 73057361 666573c0 43c00c00 0c000100 004ec900
+ 05026e73 c1f7c00c 000c0001 00004ec9 00131063 6f757065 72636f6e 73756c74
+ 696e67c0 43c00c00 0c000100 004ec900 110e7365 63757269 74796775 61726473
+ c043c00c 000c0001 00004ec9 000c026e 73066775 61726473 c043c00c 000c0001
+ 00004ec9 00070461 736973c1 28c00c00 0c000100 004ec900 02c13fc0 0c000c00
+ 0100004e c90002c0 b6c00c00 0c000100 004ec900 08056d61 676963c0 43c00c00
+ 0c000100 004ec900 07046d61 696cc1e5 c00c000c 00010000 4ec90005 026e73c1
+ 03c00c00 0c000100 004ec900 02c122c0 0c000c00 0100004e c9000502 6e73c0ed
+ c00c000c 00010000 4ec90007 046d6169 6cc22dc0 0c000c00 0100004e c9000502
+ 6e73c1e5 c00c000c 00010000 4ec90005 026e73c2 0ec00c00 0c000100 004ec900
+ 05026e73 c271c00c 000c0001 00004ec9 00100d63 6f766572 7463616d 65726173
+ c043c00c 000c0001 00004ec9 0005026e 73c13fc0 0c000c00 0100004e c9001302
+ 6e730d63 6f766572 7463616d 65726173 c043c00c 000c0001 00004ec9 000b0862
+ 6f757175 657473c0 43c00c00 0c000100 004ec900 0d0a636f 6e63656e 74726963
+ c043c00c 000c0001 00004ec9 0005026e 73c094c0 0c000c00 0100004e c9000704
+ 6d61696c c252c00c 000c0001 00004ec9 00110e72 65746169 6c736563 75726974
+ 79c043c0 0c000c00 0100004e c9001002 6e730a63 6f6e6365 6e747269 63c043c0
+ 0c000c00 0100004e c9000d04 6d61696c 056d6167 6963c043 c00c000c 00010000
+ 4ec9000c 096e7a61 6e676c69 6e67c043 c00c000c 00010000 4ec90005 026e73c2
+ 52c00c00 0c000100 004ec900 0f026e73 096e7a61 6e676c69 6e67c043 c00c000c
+ 00010000 4ec90007 046d6169 6cc163c0 0c000c00 0100004e c9000805 73776966
+ 74c043c0 0c000c00 0100004e c9001104 6d61696c 0973656c 65637469 7665c043
+ c00c000c 00010000 4ec9000f 026e7309 666f7265 66726f6e 74c043c0 0c000c00
+ 0100004e c9001104 6d61696c 096e7a61 6e676c69 6e67c043 c00c000c 00010000
+ 4ec90009 06677561 726473c0 43c00c00 0c000100 004ec900 11046d61 696c096e
+ 7a646573 69676e73 c043c00c 000c0001 00004ec9 0002c163 c00c000c 00010000
+ 4ec90018 026e7312 73656375 72697479 6d616e61 67656d65 6e74c043 c00c000c
+ 00010000 4ec90012 046d6169 6c0a776f 6f6c776f 72746873 c043c00c 000c0001
+ 00004ec9 0012046d 61696c0a 636f6e63 656e.
+ +0.010287
+ read fd=5 buflen=957
+ read=OK
+ 74726963 c043c00c 000c0001 00004ec9 000c0973 656c6563 74697665 c043c00c
+ 000c0001 00004ec9 00181573 70656369 616c696e 76657374 69676174 696f6e73
+ c043c00c 000c0001 00004ec9 000b026e 73057377 696674c0 43c00c00 0c000100
+ 004ec900 0d046d61 696c0573 77696674 c043c00c 000c0001 00004ec9 0013026e
+ 73097365 63757265 6e657403 6e6574c0 46c00c00 0c000100 004ec900 17147072
+ 69766174 65696e76 65737469 67617469 6f6ec043 c00c000c 00010000 4ec9001a
+ 026e7314 70726976 61746569 6e766573 74696761 74696f6e c043c00c 000c0001
+ 00004ec9 00090665 74726164 65c043c0 0c000c00 0100004e c9001b02 6e731573
+ 70656369 616c696e 76657374 69676174 696f6e73 c043c00c 000c0001 00004ec9
+ 000e046d 61696c06 616e7365 7474c043 c00c000c 00010000 4ec9000e 03667470
+ 07776172 72656e74 c043c00c 000c0001 00004ec9 0014026e 730e7265 7461696c
+ 73656375 72697479 c043c00c 000c0001 00004ec9 001a046d 61696c12 73656375
+ 72697479 6d616e61 67656d65 6e74c043 c00c000c 00010000 4ec9000b 026e7305
+ 6d616769 63c043c0 0c000c00 0100004e c9001104 6d61696c 09666f72 6566726f
+ 6e74c043 c00c000c 00010000 4ec90007 046d6169 6cc1b1c0 0c000c00 0100004e
+ c90002c1 b1c00c00 0c000100 004ec900 0f026e73 096e7a64 65736967 6e73c043
+ c00c000c 00010000 4ec90002 c22dc00c 000c0001 00004ec9 000f026e 73097365
+ 6c656374 697665c0 43c00c00 0c000100 004ec900 0c09666f 72656672 6f6e74c0
+ 43c00c00 0c000100 004ec900 15127365 63757269 74796d61 6e616765 6d656e74
+ c043c00c 000c0001 00004ec9 0002c1cd c00c000c 00010000 4ec90010 09736563
+ 7572656e 6574036e 6574c046 c00c000c 00010000 4ec9001d 046d6169 6c157370
+ 65636961 6c696e76 65737469 67617469 6f6e73c0 43c00c00 0c000100 004ec900
+ 0c096e7a 64657369 676e73c0 43c00c00 0c000100 004ec900 0c026e73 06657472
+ 616465c0 43c00c00 0c000100 004ec900 07046d61 696cc122 c00c000c 00010000
+ 4ec90007 046d6169 6cc1cdc0 0c000c00 0100004e c9000a02 6e730461 736973c1
+ 28c00c00 0c000100 004ec900 0e026e73 08626f75 71756574 73c043c0 0c000c00
+ 0100004e c90002c0 6f013002 39390332 30330769 6e2d6164 64720461 72706100
+ 00020001 000545fc 0002c037 01300239 39033230 3307696e 2d616464 72046172
+ 70610000 02000100 0545fc00 11036e73 31077761 696b6174 6f026163 c046036e
+ 73310777 61696b61 746f0261 63c04600 01000100 02a30000 048cc880 0d.
+ +0.005913
+ read fd=5 buflen=2417
+ read=EAGAIN
+ +0.019409
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.059852
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.028945
+ read fd=5 buflen=2417
+ read=OK
+ 096f312a 81800001 005e0002 00010332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 004ec900 13026e73 08736563
+ 75726974 7902636f 026e7a00 c00c000c 00010000 4ec90008 05746574 7261c043
+ c00c000c 00010000 4ec9000d 046d6169 6c056167 617465c0 43c00c00 0c000100
+ 004ec900 05026e73 c06fc00c 000c0001 00004ec9 00131073 65637572 69747974
+ 7261696e 696e67c0 43c00c00 0c000100 004ec900 10026e73 0a676966 74626173
+ 6b6574c0 43c00c00 0c000100 004ec900 12026e73 08736563 75726974 79036765
+ 6ec046c0 0c000c00 0100004e c9000a07 626f7571 756574c0 43c00c00 0c000100
+ 004ec900 100d696e 76657374 69676174 696f6ec0 43c00c00 0c000100 004ec900
+ 0f026e73 056e7a69 7069036f 7267c046 c00c000c 00010000 4ec9000c 046d6169
+ 6c046e65 7275c043 c00c000c 00010000 4ec90002 c03ac00c 000c0001 00004ec9
+ 0010026e 730a7374 6f726577 61746368 c043c00c 000c0001 00004ec9 0002c0d2
+ c00c000c 00010000 4ec90005 026e73c0 56c00c00 0c000100 004ec900 07046d61
+ 696cc056 c00c000c 00010000 4ec90010 026e730a 73656375 72696361 7264c043
+ c00c000c 00010000 4ec9000f 026e7309 756e6465 72686f75 72c043c0 0c000c00
+ 0100004e c9000603 626363c0 43c00c00 0c000100 004ec900 0b087365 63757269
+ 7479c128 c00c000c 00010000 4ec90010 0d627572 676c6172 616c6172 6d73c043
+ c00c000c 00010000 4ec9000b 026e7305 73616665 73c043c0 0c000c00 0100004e
+ c9000502 6e73c1f7 c00c000c 00010000 4ec90013 10636f75 70657263 6f6e7375
+ 6c74696e 67c043c0 0c000c00 0100004e c900110e 73656375 72697479 67756172
+ 6473c043 c00c000c 00010000 4ec9000c 026e7306 67756172 6473c043 c00c000c
+ 00010000 4ec90007 04617369 73c128c0 0c000c00 0100004e c90002c1 3fc00c00
+ 0c000100 004ec900 02c0b6c0 0c000c00 0100004e c9000805 6d616769 63c043c0
+ 0c000c00 0100004e c9000704 6d61696c c1e5c00c 000c0001 00004ec9 0005026e
+ 73c103c0 0c000c00 0100004e c90002c1 22c00c00 0c000100 004ec900 05026e73
+ c0edc00c 000c0001 00004ec9 0007046d 61696cc2 2dc00c00 0c000100 004ec900
+ 05026e73 c1e5c00c 000c0001 00004ec9 0005026e 73c20ec0 0c000c00 0100004e
+ c9000502 6e73c271 c00c000c 00010000 4ec90010 0d636f76 65727463 616d6572
+ 6173c043 c00c000c 00010000 4ec90005 026e73c1 3fc00c00 0c000100 004ec900
+ 13026e73 0d636f76 65727463 616d6572 6173c043 c00c000c 00010000 4ec9000b
+ 08626f75 71756574 73c043c0 0c000c00 0100004e c9000d0a 636f6e63 656e7472
+ 6963c043 c00c000c 00010000 4ec90005 026e73c0 94c00c00 0c000100 004ec900
+ 07046d61 696cc252 c00c000c 00010000 4ec90011 0e726574 61696c73 65637572
+ 697479c0 43c00c00 0c000100 004ec900 10026e73 0a636f6e 63656e74 726963c0
+ 43c00c00 0c000100 004ec900 0d046d61 696c056d 61676963 c043c00c 000c0001
+ 00004ec9 000c096e 7a616e67 6c696e67 c043c00c 000c0001 00004ec9 0005026e
+ 73c252c0 0c000c00 0100004e c9000f02 6e73096e 7a616e67 6c696e67 c043c00c
+ 000c0001 00004ec9 0007046d 61696cc1 63c00c00 0c000100 004ec900 08057377
+ 696674c0 43c00c00 0c000100 004ec900 11046d61 696c0973 656c6563 74697665
+ c043c00c 000c0001 00004ec9 000f026e 7309666f 72656672 6f6e74c0 43c00c00
+ 0c000100 004ec900 11046d61 696c096e 7a616e67 6c696e67 c043c00c 000c0001
+ 00004ec9 00090667 75617264 73c043c0 0c000c00 0100004e c9001104 6d61696c
+ 096e7a64 65736967 6e73c043 c00c000c 00010000 4ec90002 c163c00c 000c0001
+ 00004ec9 0018026e 73127365 63757269 74796d61 6e616765 6d656e74 c043c00c
+ 000c0001 00004ec9 0012046d 61696c0a 776f6f6c 776f7274 6873c043 c00c000c
+ 00010000 4ec90012 046d6169 6c0a636f 6e63656e.
+ +0.008722
+ read fd=5 buflen=957
+ read=EAGAIN
+ +0.000264
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.021921
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.063001
+ read fd=5 buflen=957
+ read=OK
+ 74726963 c043c00c 000c0001 00004ec9 000c0973 656c6563 74697665 c043c00c
+ 000c0001 00004ec9 00181573 70656369 616c696e 76657374 69676174 696f6e73
+ c043c00c 000c0001 00004ec9 000b026e 73057377 696674c0 43c00c00 0c000100
+ 004ec900 0d046d61 696c0573 77696674 c043c00c 000c0001 00004ec9 0013026e
+ 73097365 63757265 6e657403 6e6574c0 46c00c00 0c000100 004ec900 17147072
+ 69766174 65696e76 65737469 67617469 6f6ec043 c00c000c 00010000 4ec9001a
+ 026e7314 70726976 61746569 6e766573 74696761 74696f6e c043c00c 000c0001
+ 00004ec9 00090665 74726164 65c043c0 0c000c00 0100004e c9001b02 6e731573
+ 70656369 616c696e 76657374 69676174 696f6e73 c043c00c 000c0001 00004ec9
+ 000e046d 61696c06 616e7365 7474c043 c00c000c 00010000 4ec9000e 03667470
+ 07776172 72656e74 c043c00c 000c0001 00004ec9 0014026e 730e7265 7461696c
+ 73656375 72697479 c043c00c 000c0001 00004ec9 001a046d 61696c12 73656375
+ 72697479 6d616e61 67656d65 6e74c043 c00c000c 00010000 4ec9000b 026e7305
+ 6d616769 63c043c0 0c000c00 0100004e c9001104 6d61696c 09666f72 6566726f
+ 6e74c043 c00c000c 00010000 4ec90007 046d6169 6cc1b1c0 0c000c00 0100004e
+ c90002c1 b1c00c00 0c000100 004ec900 0f026e73 096e7a64 65736967 6e73c043
+ c00c000c 00010000 4ec90002 c22dc00c 000c0001 00004ec9 000f026e 73097365
+ 6c656374 697665c0 43c00c00 0c000100 004ec900 0c09666f 72656672 6f6e74c0
+ 43c00c00 0c000100 004ec900 15127365 63757269 74796d61 6e616765 6d656e74
+ c043c00c 000c0001 00004ec9 0002c1cd c00c000c 00010000 4ec90010 09736563
+ 7572656e 6574036e 6574c046 c00c000c 00010000 4ec9001d 046d6169 6c157370
+ 65636961 6c696e76 65737469 67617469 6f6e73c0 43c00c00 0c000100 004ec900
+ 0c096e7a 64657369 676e73c0 43c00c00 0c000100 004ec900 0c026e73 06657472
+ 616465c0 43c00c00 0c000100 004ec900 07046d61 696cc122 c00c000c 00010000
+ 4ec90007 046d6169 6cc1cdc0 0c000c00 0100004e c9000a02 6e730461 736973c1
+ 28c00c00 0c000100 004ec900 0e026e73 08626f75 71756574 73c043c0 0c000c00
+ 0100004e c90002c0 6f013002 39390332 30330769 6e2d6164 64720461 72706100
+ 00020001 000545fc 0002c037 01300239 39033230 3307696e 2d616464 72046172
+ 70610000 02000100 0545fc00 11036e73 31077761 696b6174 6f026163 c046036e
+ 73310777 61696b61 746f0261 63c04600 01000100 02a30000 048cc880 0d.
+ +0.005816
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 026e7308 73656375 72697479 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.002957
+ sendto fd=4 addr=172.18.45.6:53
+ 312f0100 00010000 00000000 05746574 72610263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001178
+ sendto fd=4 addr=172.18.45.6:53
+ 31300100 00010000 00000000 046d6169 6c056167 61746502 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001193
+ sendto fd=4 addr=172.18.45.6:53
+ 31310100 00010000 00000000 026e7305 61676174 6502636f 026e7a00 00010001.
+ sendto=32
+ +0.001166
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 10736563 75726974 79747261 696e696e 6702636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001265
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 026e730a 67696674 6261736b 65740263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001219
+ sendto fd=4 addr=172.18.45.6:53
+ 31340100 00010000 00000000 026e7308 73656375 72697479 0367656e 026e7a00
+ 00010001.
+ sendto=36
+ +0.001212
+ sendto fd=4 addr=172.18.45.6:53
+ 31350100 00010000 00000000 07626f75 71756574 02636f02 6e7a0000 010001.
+ sendto=31
+ +0.001210
+ sendto fd=4 addr=172.18.45.6:53
+ 31360100 00010000 00000000 0d696e76 65737469 67617469 6f6e0263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001220
+ sendto fd=4 addr=172.18.45.6:53
+ 31370100 00010000 00000000 026e7305 6e7a6970 69036f72 67026e7a 00000100
+ 01.
+ sendto=33
+ +0.001203
+ sendto fd=4 addr=172.18.45.6:53
+ 31380100 00010000 00000000 046d6169 6c046e65 72750263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001223
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 08736563 75726974 7902636f 026e7a00 00010001.
+ sendto=32
+ +0.001251
+ sendto fd=4 addr=172.18.45.6:53
+ 313a0100 00010000 00000000 026e730a 73746f72 65776174 63680263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001242
+ sendto fd=4 addr=172.18.45.6:53
+ 313b0100 00010000 00000000 08736563 75726974 79036765 6e026e7a 00000100
+ 01.
+ sendto=33
+ +0.001165
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 026e7305 74657472 6102636f 026e7a00 00010001.
+ sendto=32
+ +0.001208
+ sendto fd=4 addr=172.18.45.6:53
+ 313d0100 00010000 00000000 046d6169 6c057465 74726102 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001212
+ sendto fd=4 addr=172.18.45.6:53
+ 313e0100 00010000 00000000 026e730a 73656375 72696361 72640263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +1.-998781
+ sendto fd=4 addr=172.18.45.6:53
+ 313f0100 00010000 00000000 026e7309 756e6465 72686f75 7202636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001202
+ sendto fd=4 addr=172.18.45.6:53
+ 31400100 00010000 00000000 03626363 02636f02 6e7a0000 010001.
+ sendto=27
+ +0.001186
+ sendto fd=4 addr=172.18.45.6:53
+ 31410100 00010000 00000000 08736563 75726974 79036f72 67026e7a 00000100
+ 01.
+ sendto=33
+ +0.001192
+ sendto fd=4 addr=172.18.45.6:53
+ 31420100 00010000 00000000 0d627572 676c6172 616c6172 6d730263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001520
+ sendto fd=4 addr=172.18.45.6:53
+ 31430100 00010000 00000000 026e7305 73616665 7302636f 026e7a00 00010001.
+ sendto=32
+ +0.001501
+ sendto fd=4 addr=172.18.45.6:53
+ 31440100 00010000 00000000 026e7308 73656375 72697479 036f7267 026e7a00
+ 00010001.
+ sendto=36
+ +0.002041
+ sendto fd=4 addr=172.18.45.6:53
+ 31450100 00010000 00000000 10636f75 70657263 6f6e7375 6c74696e 6702636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001682
+ sendto fd=4 addr=172.18.45.6:53
+ 31460100 00010000 00000000 0e736563 75726974 79677561 72647302 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001629
+ sendto fd=4 addr=172.18.45.6:53
+ 31470100 00010000 00000000 026e7306 67756172 64730263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001671
+ sendto fd=4 addr=172.18.45.6:53
+ 31480100 00010000 00000000 04617369 73036f72 67026e7a 00000100 01.
+ sendto=29
+ +0.001592
+ sendto fd=4 addr=172.18.45.6:53
+ 31490100 00010000 00000000 046e6572 7502636f 026e7a00 00010001.
+ sendto=28
+ +0.001561
+ sendto fd=4 addr=172.18.45.6:53
+ 314a0100 00010000 00000000 0a676966 74626173 6b657402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001907
+ sendto fd=4 addr=172.18.45.6:53
+ 314b0100 00010000 00000000 056d6167 69630263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001654
+ sendto fd=4 addr=172.18.45.6:53
+ 314c0100 00010000 00000000 046d6169 6c036263 6302636f 026e7a00 00010001.
+ sendto=32
+ +0.001634
+ sendto fd=4 addr=172.18.45.6:53
+ 314d0100 00010000 00000000 026e730d 696e7665 73746967 6174696f 6e02636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001656
+ sendto fd=4 addr=172.18.45.6:53
+ 314e0100 00010000 00000000 056e7a69 7069036f 7267026e 7a000001 0001.
+ sendto=30
+ +0.001595
+ sendto fd=4 addr=172.18.45.6:53
+ 314f0100 00010000 00000000 026e7307 626f7571 75657402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001672
+ sendto fd=4 addr=172.18.45.6:53
+ 31500100 00010000 00000000 046d6169 6c057361 66657302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001801
+ sendto fd=4 addr=172.18.45.6:53
+ 31510100 00010000 00000000 026e7303 62636302 636f026e 7a000001 0001.
+ sendto=30
+ +0.001626
+ sendto fd=4 addr=172.18.45.6:53
+ 31520100 00010000 00000000 026e730d 62757267 6c617261 6c61726d 7302636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001697
+ sendto fd=4 addr=172.18.45.6:53
+ 31530100 00010000 00000000 026e730e 73656375 72697479 67756172 64730263
+ 6f026e7a 00000100 01.
+ sendto=41
+ +0.001694
+ sendto fd=4 addr=172.18.45.6:53
+ 31540100 00010000 00000000 0d636f76 65727463 616d6572 61730263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001665
+ sendto fd=4 addr=172.18.45.6:53
+ 31550100 00010000 00000000 026e7304 6e657275 02636f02 6e7a0000 010001.
+ sendto=31
+ +0.001613
+ sendto fd=4 addr=172.18.45.6:53
+ 31560100 00010000 00000000 026e730d 636f7665 72746361 6d657261 7302636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001761
+ sendto fd=4 addr=172.18.45.6:53
+ 31570100 00010000 00000000 08626f75 71756574 7302636f 026e7a00 00010001.
+ sendto=32
+ +0.001635
+ sendto fd=4 addr=172.18.45.6:53
+ 31580100 00010000 00000000 0a636f6e 63656e74 72696302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001693
+ sendto fd=4 addr=172.18.45.6:53
+ 31590100 00010000 00000000 026e7310 73656375 72697479 74726169 6e696e67
+ 02636f02 6e7a0000 010001.
+ sendto=43
+ +0.001762
+ sendto fd=4 addr=172.18.45.6:53
+ 315a0100 00010000 00000000 046d6169 6c10636f 75706572 636f6e73 756c7469
+ 6e670263 6f026e7a 00000100 01.
+ sendto=45
+ +0.001727
+ sendto fd=4 addr=172.18.45.6:53
+ 315b0100 00010000 00000000 0e726574 61696c73 65637572 69747902 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001636
+ sendto fd=4 addr=172.18.45.6:53
+ 315c0100 00010000 00000000 026e730a 636f6e63 656e7472 69630263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001667
+ sendto fd=4 addr=172.18.45.6:53
+ 315d0100 00010000 00000000 046d6169 6c056d61 67696302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001674
+ sendto fd=4 addr=172.18.45.6:53
+ 315e0100 00010000 00000000 096e7a61 6e676c69 6e670263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001676
+ sendto fd=4 addr=172.18.45.6:53
+ 315f0100 00010000 00000000 026e7310 636f7570 6572636f 6e73756c 74696e67
+ 02636f02 6e7a0000 010001.
+ sendto=43
+ +0.001709
+ sendto fd=4 addr=172.18.45.6:53
+ 31600100 00010000 00000000 026e7309 6e7a616e 676c696e 6702636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001623
+ sendto fd=4 addr=172.18.45.6:53
+ 31610100 00010000 00000000 046d6169 6c0a7374 6f726577 61746368 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001647
+ sendto fd=4 addr=172.18.45.6:53
+ 31620100 00010000 00000000 05737769 66740263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001638
+ sendto fd=4 addr=172.18.45.6:53
+ 31630100 00010000 00000000 046d6169 6c097365 6c656374 69766502 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001714
+ sendto fd=4 addr=172.18.45.6:53
+ 31640100 00010000 00000000 026e7309 666f7265 66726f6e 7402636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001705
+ sendto fd=4 addr=172.18.45.6:53
+ 31650100 00010000 00000000 046d6169 6c096e7a 616e676c 696e6702 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001701
+ sendto fd=4 addr=172.18.45.6:53
+ 31660100 00010000 00000000 06677561 72647302 636f026e 7a000001 0001.
+ sendto=30
+ +0.001623
+ sendto fd=4 addr=172.18.45.6:53
+ 31670100 00010000 00000000 046d6169 6c096e7a 64657369 676e7302 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001653
+ sendto fd=4 addr=172.18.45.6:53
+ 31680100 00010000 00000000 0a73746f 72657761 74636802 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.058123
+ sendto fd=4 addr=172.18.45.6:53
+ 31690100 00010000 00000000 026e7312 73656375 72697479 6d616e61 67656d65
+ 6e740263 6f026e7a 00000100 01.
+ sendto=45
+ +0.001825
+ sendto fd=4 addr=172.18.45.6:53
+ 316a0100 00010000 00000000 046d6169 6c0a776f 6f6c776f 72746873 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001755
+ sendto fd=4 addr=172.18.45.6:53
+ 316b0100 00010000 00000000 046d6169 6c0a636f 6e63656e 74726963 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001576
+ sendto fd=4 addr=172.18.45.6:53
+ 316c0100 00010000 00000000 0973656c 65637469 76650263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001723
+ sendto fd=4 addr=172.18.45.6:53
+ 316d0100 00010000 00000000 15737065 6369616c 696e7665 73746967 6174696f
+ 6e730263 6f026e7a 00000100 01.
+ sendto=45
+ +0.001520
+ sendto fd=4 addr=172.18.45.6:53
+ 316e0100 00010000 00000000 026e7305 73776966 7402636f 026e7a00 00010001.
+ sendto=32
+ +0.001453
+ sendto fd=4 addr=172.18.45.6:53
+ 316f0100 00010000 00000000 046d6169 6c057377 69667402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001422
+ sendto fd=4 addr=172.18.45.6:53
+ 31700100 00010000 00000000 026e7309 73656375 72656e65 74036e65 74026e7a
+ 00000100 01.
+ sendto=37
+ +0.001461
+ sendto fd=4 addr=172.18.45.6:53
+ 31710100 00010000 00000000 14707269 76617465 696e7665 73746967 6174696f
+ 6e02636f 026e7a00 00010001.
+ sendto=44
+ +0.001602
+ sendto fd=4 addr=172.18.45.6:53
+ 31720100 00010000 00000000 026e7314 70726976 61746569 6e766573 74696761
+ 74696f6e 02636f02 6e7a0000 010001.
+ sendto=47
+ +0.001625
+ sendto fd=4 addr=172.18.45.6:53
+ 31730100 00010000 00000000 06657472 61646502 636f026e 7a000001 0001.
+ sendto=30
+ +0.001427
+ sendto fd=4 addr=172.18.45.6:53
+ 31740100 00010000 00000000 026e7315 73706563 69616c69 6e766573 74696761
+ 74696f6e 7302636f 026e7a00 00010001.
+ sendto=48
+ +0.001592
+ sendto fd=4 addr=172.18.45.6:53
+ 31750100 00010000 00000000 046d6169 6c06616e 73657474 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.001410
+ sendto fd=4 addr=172.18.45.6:53
+ 31760100 00010000 00000000 03667470 07776172 72656e74 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.001429
+ sendto fd=4 addr=172.18.45.6:53
+ 31770100 00010000 00000000 026e730e 72657461 696c7365 63757269 74790263
+ 6f026e7a 00000100 01.
+ sendto=41
+ +0.001586
+ sendto fd=4 addr=172.18.45.6:53
+ 31780100 00010000 00000000 046d6169 6c127365 63757269 74796d61 6e616765
+ 6d656e74 02636f02 6e7a0000 010001.
+ sendto=47
+ +0.001654
+ sendto fd=4 addr=172.18.45.6:53
+ 31790100 00010000 00000000 026e7305 6d616769 6302636f 026e7a00 00010001.
+ sendto=32
+ +0.001470
+ sendto fd=4 addr=172.18.45.6:53
+ 317a0100 00010000 00000000 046d6169 6c09666f 72656672 6f6e7402 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001529
+ sendto fd=4 addr=172.18.45.6:53
+ 317b0100 00010000 00000000 046d6169 6c0a7365 63757269 63617264 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001536
+ sendto fd=4 addr=172.18.45.6:53
+ 317c0100 00010000 00000000 0a736563 75726963 61726402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001493
+ sendto fd=4 addr=172.18.45.6:53
+ 317d0100 00010000 00000000 026e7309 6e7a6465 7369676e 7302636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001518
+ sendto fd=4 addr=172.18.45.6:53
+ 317e0100 00010000 00000000 05736166 65730263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001536
+ sendto fd=4 addr=172.18.45.6:53
+ 317f0100 00010000 00000000 026e7309 73656c65 63746976 6502636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001634
+ sendto fd=4 addr=172.18.45.6:53
+ 31800100 00010000 00000000 09666f72 6566726f 6e740263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001549
+ sendto fd=4 addr=172.18.45.6:53
+ 31810100 00010000 00000000 12736563 75726974 796d616e 6167656d 656e7402
+ 636f026e 7a000001 0001.
+ sendto=42
+ +0.001511
+ sendto fd=4 addr=172.18.45.6:53
+ 31820100 00010000 00000000 09756e64 6572686f 75720263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001450
+ sendto fd=4 addr=172.18.45.6:53
+ 31830100 00010000 00000000 09736563 7572656e 6574036e 6574026e 7a000001
+ 0001.
+ sendto=34
+ +0.027143
+ sendto fd=4 addr=172.18.45.6:53
+ 31840100 00010000 00000000 046d6169 6c157370 65636961 6c696e76 65737469
+ 67617469 6f6e7302 636f026e 7a000001 0001.
+ sendto=50
+ +0.001627
+ sendto fd=4 addr=172.18.45.6:53
+ 31850100 00010000 00000000 096e7a64 65736967 6e730263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001455
+ sendto fd=4 addr=172.18.45.6:53
+ 31860100 00010000 00000000 026e7306 65747261 64650263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001572
+ sendto fd=4 addr=172.18.45.6:53
+ 31870100 00010000 00000000 046d6169 6c056e7a 69706903 6f726702 6e7a0000
+ 010001.
+ sendto=35
+ +0.001559
+ sendto fd=4 addr=172.18.45.6:53
+ 31880100 00010000 00000000 046d6169 6c09756e 64657268 6f757202 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001507
+ sendto fd=4 addr=172.18.45.6:53
+ 31890100 00010000 00000000 026e7304 61736973 036f7267 026e7a00 00010001.
+ sendto=32
+ +0.001428
+ sendto fd=4 addr=172.18.45.6:53
+ 318a0100 00010000 00000000 026e7308 626f7571 75657473 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.001471
+ sendto fd=4 addr=172.18.45.6:53
+ 318b0100 00010000 00000000 05616761 74650263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001457
+ read fd=5 buflen=2417
+ read=EAGAIN
+ +0.000160
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.766818
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.661618
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312e8180 00010001 00020002 026e7308 73656375 72697479 02636f02 6e7a0000
+ 010001c0 0c000100 01000151 800004cb 6300fe08 73656375 72697479 02636f02
+ 6e7a0000 02000100 01518000 02c00cc0 33000200 01000151 80001103 6e733107
+ 7761696b 61746f02 6163c03f c00c0001 00010001 51800004 cb6300fe c05b0001
+ 00010001 51800004 8cc8800d.
+ +0.001142
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000798
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.103260
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.077615
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31318180 00010001 00020002 026e7305 61676174 6502636f 026e7a00 00010001
+ c00c0001 00010001 51800004 cb6300fe 05616761 74650263 6f026e7a 00000200
+ 01000151 800002c0 0cc03000 02000100 01518000 11036e73 31077761 696b6174
+ 6f026163 c039c00c 00010001 00015180 0004cb63 00fec055 00010001 00015180
+ 00048cc8 800d.
+ +0.001006
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000520
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.024119
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-919664
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31328180 00010001 00020002 10736563 75726974 79747261 696e696e 6702636f
+ 026e7a00 00010001 c00c0001 00010001 4fd40004 cb6300fe c00c0002 00010001
+ 51800005 026e73c0 0cc00c00 02000100 01518000 13036e73 31077761 696b6174
+ 6f026163 026e7a00 c0440001 00010001 51800004 cb6300fe c0550001 00010001
+ 51800004 8cc8800d.
+ +0.001035
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000535
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.942213
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.047739
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31338180 00010001 00020002 026e730a 67696674 6261736b 65740263 6f026e7a
+ 00000100 01c00c00 01000100 01518000 04cb6300 fe0a6769 66746261 736b6574
+ 02636f02 6e7a0000 02000100 01518000 02c00cc0 35000200 01000151 80001103
+ 6e733107 7761696b 61746f02 6163c043 c00c0001 00010001 51800004 cb6300fe
+ c05f0001 00010001 51800004 8cc8800d.
+ +0.001079
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000550
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.892845
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038213
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31348180 00010001 00020002 026e7308 73656375 72697479 0367656e 026e7a00
+ 00010001 c00c0001 00010001 51800004 cb6300fe 08736563 75726974 79036765
+ 6e026e7a 00000200 01000151 800002c0 0cc03400 02000100 01518000 11036e73
+ 31077761 696b6174 6f026163 c041c00c 00010001 00015180 0004cb63 00fec05d
+ 00010001 00015180 00048cc8 800d.
+ +0.001063
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000523
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.853046
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.048278
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31378180 00010001 00020002 026e7305 6e7a6970 69036f72 67026e7a 00000100
+ 01c00c00 01000100 01518000 04cb6300 fe056e7a 69706903 6f726702 6e7a0000
+ 02000100 01518000 02c00cc0 31000200 01000151 80001103 6e733107 7761696b
+ 61746f02 6163c03b c00c0001 00010001 51800004 cb6300fe c0570001 00010001
+ 51800004 8cc8800d.
+ +0.001030
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000557
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.803181
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.146677
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313a8583 00010000 00010000 026e730a 73746f72 65776174 63680263 6f026e7a
+ 00000100 0102636f 026e7a00 00060001 00015180 002c046e 73393907 7761696b
+ 61746f02 6163c028 03736f61 c03b7727 6ec50000 0e100000 07080027 8d000001
+ 5180.
+ +0.000793
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.026541
+ close fd=4
+ close=OK
+ +0.000436
+ close fd=5
+ close=OK
+ +0.004673
diff --git a/adns-0.6/regress/case-manyptrwrongrty.err b/adns-0.6/regress/case-manyptrwrongrty.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrongrty.err
diff --git a/adns-0.6/regress/case-manyptrwrongrty.out b/adns-0.6/regress/case-manyptrwrongrty.out
new file mode 100644
index 0000000..41b13d9
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrongrty.out
@@ -0,0 +1,164 @@
+adns debug: using nameserver 172.18.45.6
+254.0.99.203.in-addr.arpa flags 292 type 1 A(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 2 NS(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 5 CNAME(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 6 SOA(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 12 PTR(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 13 HINFO(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 15 MX(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 16 TXT(-) submitted
+254.0.99.203.in-addr.arpa flags 292 type 17 RP(raw) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65537 A(addr) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65538 NS(+addr) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65548 PTR(checked) submitted
+254.0.99.203.in-addr.arpa flags 292 type 65551 MX(+addr) submitted
+254.0.99.203.in-addr.arpa flags 292 type 131078 SOA(822) submitted
+254.0.99.203.in-addr.arpa flags 292 type 131089 RP(822) submitted
+254.0.99.203.in-addr.arpa flags 292 type A(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
+254.0.99.203.in-addr.arpa flags 292 type NS(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
+254.0.99.203.in-addr.arpa flags 292 type SOA(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=540
+adns debug: TCP connected (NS=172.18.45.6)
+254.0.99.203.in-addr.arpa flags 292 type HINFO(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=540
+254.0.99.203.in-addr.arpa flags 292 type MX(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=540
+254.0.99.203.in-addr.arpa flags 292 type TXT(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
+254.0.99.203.in-addr.arpa flags 292 type RP(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
+254.0.99.203.in-addr.arpa flags 292 type PTR(raw): OK; nrrs=94; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86351
+ ns.security.co.nz
+ tetra.co.nz
+ mail.agate.co.nz
+ ns.agate.co.nz
+ securitytraining.co.nz
+ ns.giftbasket.co.nz
+ ns.security.gen.nz
+ bouquet.co.nz
+ investigation.co.nz
+ ns.nzipi.org.nz
+ mail.neru.co.nz
+ security.co.nz
+ ns.storewatch.co.nz
+ security.gen.nz
+ ns.tetra.co.nz
+ mail.tetra.co.nz
+ ns.securicard.co.nz
+ ns.underhour.co.nz
+ bcc.co.nz
+ security.org.nz
+ burglaralarms.co.nz
+ ns.safes.co.nz
+ ns.security.org.nz
+ couperconsulting.co.nz
+ securityguards.co.nz
+ ns.guards.co.nz
+ asis.org.nz
+ neru.co.nz
+ giftbasket.co.nz
+ magic.co.nz
+ mail.bcc.co.nz
+ ns.investigation.co.nz
+ nzipi.org.nz
+ ns.bouquet.co.nz
+ mail.safes.co.nz
+ ns.bcc.co.nz
+ ns.burglaralarms.co.nz
+ ns.securityguards.co.nz
+ covertcameras.co.nz
+ ns.neru.co.nz
+ ns.covertcameras.co.nz
+ bouquets.co.nz
+ concentric.co.nz
+ ns.securitytraining.co.nz
+ mail.couperconsulting.co.nz
+ retailsecurity.co.nz
+ ns.concentric.co.nz
+ mail.magic.co.nz
+ nzangling.co.nz
+ ns.couperconsulting.co.nz
+ ns.nzangling.co.nz
+ mail.storewatch.co.nz
+ swift.co.nz
+ mail.selective.co.nz
+ ns.forefront.co.nz
+ mail.nzangling.co.nz
+ guards.co.nz
+ mail.nzdesigns.co.nz
+ storewatch.co.nz
+ ns.securitymanagement.co.nz
+ mail.woolworths.co.nz
+ mail.concentric.co.nz
+ selective.co.nz
+ specialinvestigations.co.nz
+ ns.swift.co.nz
+ mail.swift.co.nz
+ ns.securenet.net.nz
+ privateinvestigation.co.nz
+ ns.privateinvestigation.co.nz
+ etrade.co.nz
+ ns.specialinvestigations.co.nz
+ mail.ansett.co.nz
+ ftp.warrent.co.nz
+ ns.retailsecurity.co.nz
+ mail.securitymanagement.co.nz
+ ns.magic.co.nz
+ mail.forefront.co.nz
+ mail.securicard.co.nz
+ securicard.co.nz
+ ns.nzdesigns.co.nz
+ safes.co.nz
+ ns.selective.co.nz
+ forefront.co.nz
+ securitymanagement.co.nz
+ underhour.co.nz
+ securenet.net.nz
+ mail.specialinvestigations.co.nz
+ nzdesigns.co.nz
+ ns.etrade.co.nz
+ mail.nzipi.org.nz
+ mail.underhour.co.nz
+ ns.asis.org.nz
+ ns.bouquets.co.nz
+ agate.co.nz
+254.0.99.203.in-addr.arpa flags 292 type A(addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
+254.0.99.203.in-addr.arpa flags 292 type NS(+addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
+254.0.99.203.in-addr.arpa flags 292 type MX(+addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=540
+254.0.99.203.in-addr.arpa flags 292 type SOA(822): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=540
+254.0.99.203.in-addr.arpa flags 292 type RP(822): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
+adns debug: reply not found, id 313b, query owner security.gen.nz (NS=172.18.45.6)
+adns debug: reply not found, id 313c, query owner ns.tetra.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 313d, query owner mail.tetra.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 313e, query owner ns.securicard.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 313f, query owner ns.underhour.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3140, query owner bcc.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3141, query owner security.org.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3142, query owner burglaralarms.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3143, query owner ns.safes.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3144, query owner ns.security.org.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3145, query owner couperconsulting.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3146, query owner securityguards.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3147, query owner ns.guards.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3148, query owner asis.org.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3149, query owner neru.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 314a, query owner giftbasket.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 314b, query owner magic.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 314c, query owner mail.bcc.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 314d, query owner ns.investigation.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 314e, query owner nzipi.org.nz (NS=172.18.45.6)
+adns debug: reply not found, id 314f, query owner ns.bouquet.co.nz (NS=172.18.45.6)
+254.0.99.203.in-addr.arpa flags 292 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86351
+adns debug: reply not found, id 3150, query owner mail.safes.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3151, query owner ns.bcc.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3152, query owner ns.burglaralarms.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3153, query owner ns.securityguards.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3154, query owner covertcameras.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3155, query owner ns.neru.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3156, query owner ns.covertcameras.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3157, query owner bouquets.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3158, query owner concentric.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 3159, query owner ns.securitytraining.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 315a, query owner mail.couperconsulting.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 315b, query owner retailsecurity.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 315c, query owner ns.concentric.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 315d, query owner mail.magic.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 315e, query owner nzangling.co.nz (NS=172.18.45.6)
+adns debug: reply not found, id 315f, query owner ns.couperconsulting.co.nz (NS=172.18.45.6)
+254.0.99.203.in-addr.arpa flags 292 type CNAME(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
+rc=0
diff --git a/adns-0.6/regress/case-manyptrwrongrty.sys b/adns-0.6/regress/case-manyptrwrongrty.sys
new file mode 100644
index 0000000..826f408
--- /dev/null
+++ b/adns-0.6/regress/case-manyptrwrongrty.sys
@@ -0,0 +1,1436 @@
+default
+292/254.0.99.203.in-addr.arpa
+ start 933286845.072950
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000253
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000085
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000063
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.001688
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.001142
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 050001.
+ sendto=43
+ +0.001140
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.001165
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.001176
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0d0001.
+ sendto=43
+ +0.001238
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.001191
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 100001.
+ sendto=43
+ +0.001128
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.001143
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.001146
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.001165
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.001178
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.001183
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.001231
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.001357
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.981729
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000351
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 01000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021b002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.001109
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000482
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.981475
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.009100
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 02000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021b002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000873
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000382
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.972262
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.016240
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 06000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021c002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000837
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000395
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.954790
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.009780
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238380 00010013 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000151 4f001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 0001514f 00080574 65747261 c043c00c
+ 000c0001 0001514f 000d046d 61696c05 61676174 65c043c0 0c000c00 01000151
+ 4f000502 6e73c06f c00c000c 00010001 514f0013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 01000151 4f001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 01000151 4f001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 01514f00 0a07626f 75717565 74c043c0 0c000c00 01000151
+ 4f00100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 01000151 4f000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 0001514f 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 0001514f 0002c03a c00c000c 00010001 514f0010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010001 514f0002 c0d2c00c
+ 000c0001 0001514f 0005026e 73c056c0 0c000c00 01000151 4f000704 6d61696c
+ c056c00c 000c0001 0001514f 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 0001514f 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 01514f00 06036263 63c043.
+ +0.003330
+ socket type=SOCK_STREAM
+ socket=5
+ +0.001365
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000066
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000058
+ connect fd=5 addr=172.18.45.6:53
+ connect=EINPROGRESS
+ +0.000257
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000121
+ select max=6 rfds=[4] wfds=[5] efds=[] to=1.939813
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.001860
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000211
+ write fd=5
+ 002b3123 01000001 00000000 00000332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.000910
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.936832
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005498
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0d000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021c002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000840
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000372
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.930122
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.011817
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021c002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000838
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000389
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.917078
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.010900
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 10000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021b002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000836
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000359
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.904983
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.057379
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 11000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021b002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000856
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000409
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.846339
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.003255
+ read fd=5 buflen=2
+ read=OK
+ 097f.
+ +0.000294
+ read fd=5 buflen=2431
+ read=OK
+ 31238180 0001005e 00020002 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000151 4f001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 0001514f 00080574 65747261 c043c00c
+ 000c0001 0001514f 000d046d 61696c05 61676174 65c043c0 0c000c00 01000151
+ 4f000502 6e73c06f c00c000c 00010001 514f0013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 01000151 4f001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 01000151 4f001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 01514f00 0a07626f 75717565 74c043c0 0c000c00 01000151
+ 4f00100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 01000151 4f000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 0001514f 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 0001514f 0002c03a c00c000c 00010001 514f0010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010001 514f0002 c0d2c00c
+ 000c0001 0001514f 0005026e 73c056c0 0c000c00 01000151 4f000704 6d61696c
+ c056c00c 000c0001 0001514f 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 0001514f 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 01514f00 06036263 63c043c0 0c000c00 01000151 4f000b08 73656375 72697479
+ c128c00c 000c0001 0001514f 00100d62 7572676c 6172616c 61726d73 c043c00c
+ 000c0001 0001514f 000b026e 73057361 666573c0 43c00c00 0c000100 01514f00
+ 05026e73 c1f7c00c 000c0001 0001514f 00131063 6f757065 72636f6e 73756c74
+ 696e67c0 43c00c00 0c000100 01514f00 110e7365 63757269 74796775 61726473
+ c043c00c 000c0001 0001514f 000c026e 73066775 61726473 c043c00c 000c0001
+ 0001514f 00070461 736973c1 28c00c00 0c000100 01514f00 02c13fc0 0c000c00
+ 01000151 4f0002c0 b6c00c00 0c000100 01514f00 08056d61 676963c0 43c00c00
+ 0c000100 01514f00 07046d61 696cc1e5 c00c000c 00010001 514f0005 026e73c1
+ 03c00c00 0c000100 01514f00 02c122c0 0c000c00 01000151 4f000502 6e73c0ed
+ c00c000c 00010001 514f0007 046d6169 6cc22dc0 0c000c00 01000151 4f000502
+ 6e73c1e5 c00c000c 00010001 514f0005 026e73c2 0ec00c00 0c000100 01514f00
+ 05026e73 c271c00c 000c0001 0001514f 00100d63 6f766572 7463616d 65726173
+ c043c00c 000c0001 0001514f 0005026e 73c13fc0 0c000c00 01000151 4f001302
+ 6e730d63 6f766572 7463616d 65726173 c043c00c 000c0001 0001514f 000b0862
+ 6f757175 657473c0 43c00c00 0c000100 01514f00 0d0a636f 6e63656e 74726963
+ c043c00c 000c0001 0001514f 0005026e 73c094c0 0c000c00 01000151 4f000704
+ 6d61696c c252c00c 000c0001 0001514f 00110e72 65746169 6c736563 75726974
+ 79c043c0 0c000c00 01000151 4f001002 6e730a63 6f6e6365 6e747269 63c043c0
+ 0c000c00 01000151 4f000d04 6d61696c 056d6167 6963c043 c00c000c 00010001
+ 514f000c 096e7a61 6e676c69 6e67c043 c00c000c 00010001 514f0005 026e73c2
+ 52c00c00 0c000100 01514f00 0f026e73 096e7a61 6e676c69 6e67c043 c00c000c
+ 00010001 514f0007 046d6169 6cc163c0 0c000c00 01000151 4f000805 73776966
+ 74c043c0 0c000c00 01000151 4f001104 6d61696c 0973656c 65637469 7665c043
+ c00c000c 00010001 514f000f 026e7309 666f7265 66726f6e 74c043c0 0c000c00
+ 01000151 4f001104 6d61696c 096e7a61 6e676c69 6e67c043 c00c000c 00010001
+ 514f0009 06677561 726473c0 43c00c00 0c000100 01514f00 11046d61 696c096e
+ 7a646573 69676e73 c043c00c 000c0001 0001514f 0002c163 c00c000c 00010001
+ 514f0018 026e7312 73656375 72697479 6d616e61 67656d65 6e74c043 c00c000c
+ 00010001 514f0012 046d6169 6c0a776f 6f6c776f 72746873 c043c00c 000c0001
+ 0001514f 0012046d 61696c0a 636f6e63 656e.
+ +0.009407
+ read fd=5 buflen=973
+ read=OK
+ 74726963 c043c00c 000c0001 0001514f 000c0973 656c6563 74697665 c043c00c
+ 000c0001 0001514f 00181573 70656369 616c696e 76657374 69676174 696f6e73
+ c043c00c 000c0001 0001514f 000b026e 73057377 696674c0 43c00c00 0c000100
+ 01514f00 0d046d61 696c0573 77696674 c043c00c 000c0001 0001514f 0013026e
+ 73097365 63757265 6e657403 6e6574c0 46c00c00 0c000100 01514f00 17147072
+ 69766174 65696e76 65737469 67617469 6f6ec043 c00c000c 00010001 514f001a
+ 026e7314 70726976 61746569 6e766573 74696761 74696f6e c043c00c 000c0001
+ 0001514f 00090665 74726164 65c043c0 0c000c00 01000151 4f001b02 6e731573
+ 70656369 616c696e 76657374 69676174 696f6e73 c043c00c 000c0001 0001514f
+ 000e046d 61696c06 616e7365 7474c043 c00c000c 00010001 514f000e 03667470
+ 07776172 72656e74 c043c00c 000c0001 0001514f 0014026e 730e7265 7461696c
+ 73656375 72697479 c043c00c 000c0001 0001514f 001a046d 61696c12 73656375
+ 72697479 6d616e61 67656d65 6e74c043 c00c000c 00010001 514f000b 026e7305
+ 6d616769 63c043c0 0c000c00 01000151 4f001104 6d61696c 09666f72 6566726f
+ 6e74c043 c00c000c 00010001 514f0007 046d6169 6cc1b1c0 0c000c00 01000151
+ 4f0002c1 b1c00c00 0c000100 01514f00 0f026e73 096e7a64 65736967 6e73c043
+ c00c000c 00010001 514f0002 c22dc00c 000c0001 0001514f 000f026e 73097365
+ 6c656374 697665c0 43c00c00 0c000100 01514f00 0c09666f 72656672 6f6e74c0
+ 43c00c00 0c000100 01514f00 15127365 63757269 74796d61 6e616765 6d656e74
+ c043c00c 000c0001 0001514f 0002c1cd c00c000c 00010001 514f0010 09736563
+ 7572656e 6574036e 6574c046 c00c000c 00010001 514f001d 046d6169 6c157370
+ 65636961 6c696e76 65737469 67617469 6f6e73c0 43c00c00 0c000100 01514f00
+ 0c096e7a 64657369 676e73c0 43c00c00 0c000100 01514f00 0c026e73 06657472
+ 616465c0 43c00c00 0c000100 01514f00 07046d61 696cc122 c00c000c 00010001
+ 514f0007 046d6169 6cc1cdc0 0c000c00 01000151 4f000a02 6e730461 736973c1
+ 28c00c00 0c000100 01514f00 0e026e73 08626f75 71756574 73c043c0 0c000c00
+ 01000151 4f0002c0 6f013002 39390332 30330769 6e2d6164 64720461 72706100
+ 00020001 000545c2 0002c037 01300239 39033230 3307696e 2d616464 72046172
+ 70610000 02000100 0545c200 11036e73 31077761 696b6174 6f026163 c046c037
+ 00010001 0001514a 0004cb63 00fe036e 73310777 61696b61 746f0261 63c04600
+ 01000100 02a2c200 048cc880 0d.
+ +0.006032
+ read fd=5 buflen=2433
+ read=EAGAIN
+ +0.020859
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.806492
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.022402
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 01000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021b002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000868
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 02000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021b002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.001114
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8380 00010013 00000000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000151 4f001302 6e730873 65637572
+ 69747902 636f026e 7a00c00c 000c0001 0001514f 00080574 65747261 c043c00c
+ 000c0001 0001514f 000d046d 61696c05 61676174 65c043c0 0c000c00 01000151
+ 4f000502 6e73c06f c00c000c 00010001 514f0013 10736563 75726974 79747261
+ 696e696e 67c043c0 0c000c00 01000151 4f001002 6e730a67 69667462 61736b65
+ 74c043c0 0c000c00 01000151 4f001202 6e730873 65637572 69747903 67656ec0
+ 46c00c00 0c000100 01514f00 0a07626f 75717565 74c043c0 0c000c00 01000151
+ 4f00100d 696e7665 73746967 6174696f 6ec043c0 0c000c00 01000151 4f000f02
+ 6e73056e 7a697069 036f7267 c046c00c 000c0001 0001514f 000c046d 61696c04
+ 6e657275 c043c00c 000c0001 0001514f 0002c03a c00c000c 00010001 514f0010
+ 026e730a 73746f72 65776174 6368c043 c00c000c 00010001 514f0002 c0d2c00c
+ 000c0001 0001514f 0005026e 73c056c0 0c000c00 01000151 4f000704 6d61696c
+ c056c00c 000c0001 0001514f 0010026e 730a7365 63757269 63617264 c043c00c
+ 000c0001 0001514f 000f026e 7309756e 64657268 6f7572c0 43c00c00 0c000100
+ 01514f00 06036263 63c043.
+ +0.003373
+ write fd=5
+ 002b312a 01000001 00000000 00000332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.000877
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 0f000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021c002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000880
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 06000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021c002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.001170
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8180 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 11000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010000 021b002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.001182
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000384
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.774242
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.050425
+ read fd=5 buflen=2433
+ read=OK
+ 097f312a 81800001 005e0002 00020332 35340130 02393903 32303307 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 01514f00 13026e73 08736563
+ 75726974 7902636f 026e7a00 c00c000c 00010001 514f0008 05746574 7261c043
+ c00c000c 00010001 514f000d 046d6169 6c056167 617465c0 43c00c00 0c000100
+ 01514f00 05026e73 c06fc00c 000c0001 0001514f 00131073 65637572 69747974
+ 7261696e 696e67c0 43c00c00 0c000100 01514f00 10026e73 0a676966 74626173
+ 6b6574c0 43c00c00 0c000100 01514f00 12026e73 08736563 75726974 79036765
+ 6ec046c0 0c000c00 01000151 4f000a07 626f7571 756574c0 43c00c00 0c000100
+ 01514f00 100d696e 76657374 69676174 696f6ec0 43c00c00 0c000100 01514f00
+ 0f026e73 056e7a69 7069036f 7267c046 c00c000c 00010001 514f000c 046d6169
+ 6c046e65 7275c043 c00c000c 00010001 514f0002 c03ac00c 000c0001 0001514f
+ 0010026e 730a7374 6f726577 61746368 c043c00c 000c0001 0001514f 0002c0d2
+ c00c000c 00010001 514f0005 026e73c0 56c00c00 0c000100 01514f00 07046d61
+ 696cc056 c00c000c 00010001 514f0010 026e730a 73656375 72696361 7264c043
+ c00c000c 00010001 514f000f 026e7309 756e6465 72686f75 72c043c0 0c000c00
+ 01000151 4f000603 626363c0 43c00c00 0c000100 01514f00 0b087365 63757269
+ 7479c128 c00c000c 00010001 514f0010 0d627572 676c6172 616c6172 6d73c043
+ c00c000c 00010001 514f000b 026e7305 73616665 73c043c0 0c000c00 01000151
+ 4f000502 6e73c1f7 c00c000c 00010001 514f0013 10636f75 70657263 6f6e7375
+ 6c74696e 67c043c0 0c000c00 01000151 4f00110e 73656375 72697479 67756172
+ 6473c043 c00c000c 00010001 514f000c 026e7306 67756172 6473c043 c00c000c
+ 00010001 514f0007 04617369 73c128c0 0c000c00 01000151 4f0002c1 3fc00c00
+ 0c000100 01514f00 02c0b6c0 0c000c00 01000151 4f000805 6d616769 63c043c0
+ 0c000c00 01000151 4f000704 6d61696c c1e5c00c 000c0001 0001514f 0005026e
+ 73c103c0 0c000c00 01000151 4f0002c1 22c00c00 0c000100 01514f00 05026e73
+ c0edc00c 000c0001 0001514f 0007046d 61696cc2 2dc00c00 0c000100 01514f00
+ 05026e73 c1e5c00c 000c0001 0001514f 0005026e 73c20ec0 0c000c00 01000151
+ 4f000502 6e73c271 c00c000c 00010001 514f0010 0d636f76 65727463 616d6572
+ 6173c043 c00c000c 00010001 514f0005 026e73c1 3fc00c00 0c000100 01514f00
+ 13026e73 0d636f76 65727463 616d6572 6173c043 c00c000c 00010001 514f000b
+ 08626f75 71756574 73c043c0 0c000c00 01000151 4f000d0a 636f6e63 656e7472
+ 6963c043 c00c000c 00010001 514f0005 026e73c0 94c00c00 0c000100 01514f00
+ 07046d61 696cc252 c00c000c 00010001 514f0011 0e726574 61696c73 65637572
+ 697479c0 43c00c00 0c000100 01514f00 10026e73 0a636f6e 63656e74 726963c0
+ 43c00c00 0c000100 01514f00 0d046d61 696c056d 61676963 c043c00c 000c0001
+ 0001514f 000c096e 7a616e67 6c696e67 c043c00c 000c0001 0001514f 0005026e
+ 73c252c0 0c000c00 01000151 4f000f02 6e73096e 7a616e67 6c696e67 c043c00c
+ 000c0001 0001514f 0007046d 61696cc1 63c00c00 0c000100 01514f00 08057377
+ 696674c0 43c00c00 0c000100 01514f00 11046d61 696c0973 656c6563 74697665
+ c043c00c 000c0001 0001514f 000f026e 7309666f 72656672 6f6e74c0 43c00c00
+ 0c000100 01514f00 11046d61 696c096e 7a616e67 6c696e67 c043c00c 000c0001
+ 0001514f 00090667 75617264 73c043c0 0c000c00 01000151 4f001104 6d61696c
+ 096e7a64 65736967 6e73c043 c00c000c 00010001 514f0002 c163c00c 000c0001
+ 0001514f 0018026e 73127365 63757269 74796d61 6e616765 6d656e74 c043c00c
+ 000c0001 0001514f 0012046d 61696c0a 776f6f6c 776f7274 6873c043 c00c000c
+ 00010001 514f0012 046d6169 6c0a636f 6e63656e.
+ +0.008599
+ read fd=5 buflen=973
+ read=EAGAIN
+ +0.000251
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.714967
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.113339
+ read fd=5 buflen=973
+ read=OK
+ 74726963 c043c00c 000c0001 0001514f 000c0973 656c6563 74697665 c043c00c
+ 000c0001 0001514f 00181573 70656369 616c696e 76657374 69676174 696f6e73
+ c043c00c 000c0001 0001514f 000b026e 73057377 696674c0 43c00c00 0c000100
+ 01514f00 0d046d61 696c0573 77696674 c043c00c 000c0001 0001514f 0013026e
+ 73097365 63757265 6e657403 6e6574c0 46c00c00 0c000100 01514f00 17147072
+ 69766174 65696e76 65737469 67617469 6f6ec043 c00c000c 00010001 514f001a
+ 026e7314 70726976 61746569 6e766573 74696761 74696f6e c043c00c 000c0001
+ 0001514f 00090665 74726164 65c043c0 0c000c00 01000151 4f001b02 6e731573
+ 70656369 616c696e 76657374 69676174 696f6e73 c043c00c 000c0001 0001514f
+ 000e046d 61696c06 616e7365 7474c043 c00c000c 00010001 514f000e 03667470
+ 07776172 72656e74 c043c00c 000c0001 0001514f 0014026e 730e7265 7461696c
+ 73656375 72697479 c043c00c 000c0001 0001514f 001a046d 61696c12 73656375
+ 72697479 6d616e61 67656d65 6e74c043 c00c000c 00010001 514f000b 026e7305
+ 6d616769 63c043c0 0c000c00 01000151 4f001104 6d61696c 09666f72 6566726f
+ 6e74c043 c00c000c 00010001 514f0007 046d6169 6cc1b1c0 0c000c00 01000151
+ 4f0002c1 b1c00c00 0c000100 01514f00 0f026e73 096e7a64 65736967 6e73c043
+ c00c000c 00010001 514f0002 c22dc00c 000c0001 0001514f 000f026e 73097365
+ 6c656374 697665c0 43c00c00 0c000100 01514f00 0c09666f 72656672 6f6e74c0
+ 43c00c00 0c000100 01514f00 15127365 63757269 74796d61 6e616765 6d656e74
+ c043c00c 000c0001 0001514f 0002c1cd c00c000c 00010001 514f0010 09736563
+ 7572656e 6574036e 6574c046 c00c000c 00010001 514f001d 046d6169 6c157370
+ 65636961 6c696e76 65737469 67617469 6f6e73c0 43c00c00 0c000100 01514f00
+ 0c096e7a 64657369 676e73c0 43c00c00 0c000100 01514f00 0c026e73 06657472
+ 616465c0 43c00c00 0c000100 01514f00 07046d61 696cc122 c00c000c 00010001
+ 514f0007 046d6169 6cc1cdc0 0c000c00 01000151 4f000a02 6e730461 736973c1
+ 28c00c00 0c000100 01514f00 0e026e73 08626f75 71756574 73c043c0 0c000c00
+ 01000151 4f0002c0 6f013002 39390332 30330769 6e2d6164 64720461 72706100
+ 00020001 000545c2 0002c037 01300239 39033230 3307696e 2d616464 72046172
+ 70610000 02000100 0545c200 11036e73 31077761 696b6174 6f026163 c046c037
+ 00010001 0001514a 0004cb63 00fe036e 73310777 61696b61 746f0261 63c04600
+ 01000100 02a2c200 048cc880 0d.
+ +0.005794
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 026e7308 73656375 72697479 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.002525
+ sendto fd=4 addr=172.18.45.6:53
+ 312f0100 00010000 00000000 05746574 72610263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001084
+ sendto fd=4 addr=172.18.45.6:53
+ 31300100 00010000 00000000 046d6169 6c056167 61746502 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001089
+ sendto fd=4 addr=172.18.45.6:53
+ 31310100 00010000 00000000 026e7305 61676174 6502636f 026e7a00 00010001.
+ sendto=32
+ +0.001018
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 10736563 75726974 79747261 696e696e 6702636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001076
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 026e730a 67696674 6261736b 65740263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001062
+ sendto fd=4 addr=172.18.45.6:53
+ 31340100 00010000 00000000 026e7308 73656375 72697479 0367656e 026e7a00
+ 00010001.
+ sendto=36
+ +0.001055
+ sendto fd=4 addr=172.18.45.6:53
+ 31350100 00010000 00000000 07626f75 71756574 02636f02 6e7a0000 010001.
+ sendto=31
+ +0.001003
+ sendto fd=4 addr=172.18.45.6:53
+ 31360100 00010000 00000000 0d696e76 65737469 67617469 6f6e0263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001169
+ sendto fd=4 addr=172.18.45.6:53
+ 31370100 00010000 00000000 026e7305 6e7a6970 69036f72 67026e7a 00000100
+ 01.
+ sendto=33
+ +0.001084
+ sendto fd=4 addr=172.18.45.6:53
+ 31380100 00010000 00000000 046d6169 6c046e65 72750263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001052
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 08736563 75726974 7902636f 026e7a00 00010001.
+ sendto=32
+ +0.001060
+ sendto fd=4 addr=172.18.45.6:53
+ 313a0100 00010000 00000000 026e730a 73746f72 65776174 63680263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001385
+ sendto fd=4 addr=172.18.45.6:53
+ 313b0100 00010000 00000000 08736563 75726974 79036765 6e026e7a 00000100
+ 01.
+ sendto=33
+ +0.001319
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 026e7305 74657472 6102636f 026e7a00 00010001.
+ sendto=32
+ +0.001428
+ sendto fd=4 addr=172.18.45.6:53
+ 313d0100 00010000 00000000 046d6169 6c057465 74726102 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001373
+ sendto fd=4 addr=172.18.45.6:53
+ 313e0100 00010000 00000000 026e730a 73656375 72696361 72640263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001407
+ sendto fd=4 addr=172.18.45.6:53
+ 313f0100 00010000 00000000 026e7309 756e6465 72686f75 7202636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001454
+ sendto fd=4 addr=172.18.45.6:53
+ 31400100 00010000 00000000 03626363 02636f02 6e7a0000 010001.
+ sendto=27
+ +0.001405
+ sendto fd=4 addr=172.18.45.6:53
+ 31410100 00010000 00000000 08736563 75726974 79036f72 67026e7a 00000100
+ 01.
+ sendto=33
+ +0.001386
+ sendto fd=4 addr=172.18.45.6:53
+ 31420100 00010000 00000000 0d627572 676c6172 616c6172 6d730263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001405
+ sendto fd=4 addr=172.18.45.6:53
+ 31430100 00010000 00000000 026e7305 73616665 7302636f 026e7a00 00010001.
+ sendto=32
+ +0.001163
+ sendto fd=4 addr=172.18.45.6:53
+ 31440100 00010000 00000000 026e7308 73656375 72697479 036f7267 026e7a00
+ 00010001.
+ sendto=36
+ +0.001110
+ sendto fd=4 addr=172.18.45.6:53
+ 31450100 00010000 00000000 10636f75 70657263 6f6e7375 6c74696e 6702636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001091
+ sendto fd=4 addr=172.18.45.6:53
+ 31460100 00010000 00000000 0e736563 75726974 79677561 72647302 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001272
+ sendto fd=4 addr=172.18.45.6:53
+ 31470100 00010000 00000000 026e7306 67756172 64730263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001067
+ sendto fd=4 addr=172.18.45.6:53
+ 31480100 00010000 00000000 04617369 73036f72 67026e7a 00000100 01.
+ sendto=29
+ +0.001036
+ sendto fd=4 addr=172.18.45.6:53
+ 31490100 00010000 00000000 046e6572 7502636f 026e7a00 00010001.
+ sendto=28
+ +0.001025
+ sendto fd=4 addr=172.18.45.6:53
+ 314a0100 00010000 00000000 0a676966 74626173 6b657402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001078
+ sendto fd=4 addr=172.18.45.6:53
+ 314b0100 00010000 00000000 056d6167 69630263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001042
+ sendto fd=4 addr=172.18.45.6:53
+ 314c0100 00010000 00000000 046d6169 6c036263 6302636f 026e7a00 00010001.
+ sendto=32
+ +0.001065
+ sendto fd=4 addr=172.18.45.6:53
+ 314d0100 00010000 00000000 026e730d 696e7665 73746967 6174696f 6e02636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001280
+ sendto fd=4 addr=172.18.45.6:53
+ 314e0100 00010000 00000000 056e7a69 7069036f 7267026e 7a000001 0001.
+ sendto=30
+ +0.001047
+ sendto fd=4 addr=172.18.45.6:53
+ 314f0100 00010000 00000000 026e7307 626f7571 75657402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001278
+ sendto fd=4 addr=172.18.45.6:53
+ 31500100 00010000 00000000 046d6169 6c057361 66657302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001384
+ sendto fd=4 addr=172.18.45.6:53
+ 31510100 00010000 00000000 026e7303 62636302 636f026e 7a000001 0001.
+ sendto=30
+ +0.001308
+ sendto fd=4 addr=172.18.45.6:53
+ 31520100 00010000 00000000 026e730d 62757267 6c617261 6c61726d 7302636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001515
+ sendto fd=4 addr=172.18.45.6:53
+ 31530100 00010000 00000000 026e730e 73656375 72697479 67756172 64730263
+ 6f026e7a 00000100 01.
+ sendto=41
+ +0.001383
+ sendto fd=4 addr=172.18.45.6:53
+ 31540100 00010000 00000000 0d636f76 65727463 616d6572 61730263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001401
+ sendto fd=4 addr=172.18.45.6:53
+ 31550100 00010000 00000000 026e7304 6e657275 02636f02 6e7a0000 010001.
+ sendto=31
+ +0.001323
+ sendto fd=4 addr=172.18.45.6:53
+ 31560100 00010000 00000000 026e730d 636f7665 72746361 6d657261 7302636f
+ 026e7a00 00010001.
+ sendto=40
+ +0.001388
+ sendto fd=4 addr=172.18.45.6:53
+ 31570100 00010000 00000000 08626f75 71756574 7302636f 026e7a00 00010001.
+ sendto=32
+ +0.001467
+ sendto fd=4 addr=172.18.45.6:53
+ 31580100 00010000 00000000 0a636f6e 63656e74 72696302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001366
+ sendto fd=4 addr=172.18.45.6:53
+ 31590100 00010000 00000000 026e7310 73656375 72697479 74726169 6e696e67
+ 02636f02 6e7a0000 010001.
+ sendto=43
+ +0.001416
+ sendto fd=4 addr=172.18.45.6:53
+ 315a0100 00010000 00000000 046d6169 6c10636f 75706572 636f6e73 756c7469
+ 6e670263 6f026e7a 00000100 01.
+ sendto=45
+ +0.001440
+ sendto fd=4 addr=172.18.45.6:53
+ 315b0100 00010000 00000000 0e726574 61696c73 65637572 69747902 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001438
+ sendto fd=4 addr=172.18.45.6:53
+ 315c0100 00010000 00000000 026e730a 636f6e63 656e7472 69630263 6f026e7a
+ 00000100 01.
+ sendto=37
+ +0.001523
+ sendto fd=4 addr=172.18.45.6:53
+ 315d0100 00010000 00000000 046d6169 6c056d61 67696302 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001394
+ sendto fd=4 addr=172.18.45.6:53
+ 315e0100 00010000 00000000 096e7a61 6e676c69 6e670263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001388
+ sendto fd=4 addr=172.18.45.6:53
+ 315f0100 00010000 00000000 026e7310 636f7570 6572636f 6e73756c 74696e67
+ 02636f02 6e7a0000 010001.
+ sendto=43
+ +0.001439
+ sendto fd=4 addr=172.18.45.6:53
+ 31600100 00010000 00000000 026e7309 6e7a616e 676c696e 6702636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001369
+ sendto fd=4 addr=172.18.45.6:53
+ 31610100 00010000 00000000 046d6169 6c0a7374 6f726577 61746368 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001556
+ sendto fd=4 addr=172.18.45.6:53
+ 31620100 00010000 00000000 05737769 66740263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001365
+ sendto fd=4 addr=172.18.45.6:53
+ 31630100 00010000 00000000 046d6169 6c097365 6c656374 69766502 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001401
+ sendto fd=4 addr=172.18.45.6:53
+ 31640100 00010000 00000000 026e7309 666f7265 66726f6e 7402636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001427
+ sendto fd=4 addr=172.18.45.6:53
+ 31650100 00010000 00000000 046d6169 6c096e7a 616e676c 696e6702 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001542
+ sendto fd=4 addr=172.18.45.6:53
+ 31660100 00010000 00000000 06677561 72647302 636f026e 7a000001 0001.
+ sendto=30
+ +0.001362
+ sendto fd=4 addr=172.18.45.6:53
+ 31670100 00010000 00000000 046d6169 6c096e7a 64657369 676e7302 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001390
+ sendto fd=4 addr=172.18.45.6:53
+ 31680100 00010000 00000000 0a73746f 72657761 74636802 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001440
+ sendto fd=4 addr=172.18.45.6:53
+ 31690100 00010000 00000000 026e7312 73656375 72697479 6d616e61 67656d65
+ 6e740263 6f026e7a 00000100 01.
+ sendto=45
+ +0.001484
+ sendto fd=4 addr=172.18.45.6:53
+ 316a0100 00010000 00000000 046d6169 6c0a776f 6f6c776f 72746873 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001522
+ sendto fd=4 addr=172.18.45.6:53
+ 316b0100 00010000 00000000 046d6169 6c0a636f 6e63656e 74726963 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001418
+ sendto fd=4 addr=172.18.45.6:53
+ 316c0100 00010000 00000000 0973656c 65637469 76650263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001842
+ sendto fd=4 addr=172.18.45.6:53
+ 316d0100 00010000 00000000 15737065 6369616c 696e7665 73746967 6174696f
+ 6e730263 6f026e7a 00000100 01.
+ sendto=45
+ +0.001742
+ sendto fd=4 addr=172.18.45.6:53
+ 316e0100 00010000 00000000 026e7305 73776966 7402636f 026e7a00 00010001.
+ sendto=32
+ +0.001516
+ sendto fd=4 addr=172.18.45.6:53
+ 316f0100 00010000 00000000 046d6169 6c057377 69667402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001513
+ sendto fd=4 addr=172.18.45.6:53
+ 31700100 00010000 00000000 026e7309 73656375 72656e65 74036e65 74026e7a
+ 00000100 01.
+ sendto=37
+ +0.001670
+ sendto fd=4 addr=172.18.45.6:53
+ 31710100 00010000 00000000 14707269 76617465 696e7665 73746967 6174696f
+ 6e02636f 026e7a00 00010001.
+ sendto=44
+ +0.001599
+ sendto fd=4 addr=172.18.45.6:53
+ 31720100 00010000 00000000 026e7314 70726976 61746569 6e766573 74696761
+ 74696f6e 02636f02 6e7a0000 010001.
+ sendto=47
+ +0.001618
+ sendto fd=4 addr=172.18.45.6:53
+ 31730100 00010000 00000000 06657472 61646502 636f026e 7a000001 0001.
+ sendto=30
+ +0.001483
+ sendto fd=4 addr=172.18.45.6:53
+ 31740100 00010000 00000000 026e7315 73706563 69616c69 6e766573 74696761
+ 74696f6e 7302636f 026e7a00 00010001.
+ sendto=48
+ +0.001612
+ sendto fd=4 addr=172.18.45.6:53
+ 31750100 00010000 00000000 046d6169 6c06616e 73657474 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.001604
+ sendto fd=4 addr=172.18.45.6:53
+ 31760100 00010000 00000000 03667470 07776172 72656e74 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.001537
+ sendto fd=4 addr=172.18.45.6:53
+ 31770100 00010000 00000000 026e730e 72657461 696c7365 63757269 74790263
+ 6f026e7a 00000100 01.
+ sendto=41
+ +0.001577
+ sendto fd=4 addr=172.18.45.6:53
+ 31780100 00010000 00000000 046d6169 6c127365 63757269 74796d61 6e616765
+ 6d656e74 02636f02 6e7a0000 010001.
+ sendto=47
+ +0.001807
+ sendto fd=4 addr=172.18.45.6:53
+ 31790100 00010000 00000000 026e7305 6d616769 6302636f 026e7a00 00010001.
+ sendto=32
+ +0.001481
+ sendto fd=4 addr=172.18.45.6:53
+ 317a0100 00010000 00000000 046d6169 6c09666f 72656672 6f6e7402 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001548
+ sendto fd=4 addr=172.18.45.6:53
+ 317b0100 00010000 00000000 046d6169 6c0a7365 63757269 63617264 02636f02
+ 6e7a0000 010001.
+ sendto=39
+ +0.001498
+ sendto fd=4 addr=172.18.45.6:53
+ 317c0100 00010000 00000000 0a736563 75726963 61726402 636f026e 7a000001
+ 0001.
+ sendto=34
+ +0.001636
+ sendto fd=4 addr=172.18.45.6:53
+ 317d0100 00010000 00000000 026e7309 6e7a6465 7369676e 7302636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001520
+ sendto fd=4 addr=172.18.45.6:53
+ 317e0100 00010000 00000000 05736166 65730263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001506
+ sendto fd=4 addr=172.18.45.6:53
+ 317f0100 00010000 00000000 026e7309 73656c65 63746976 6502636f 026e7a00
+ 00010001.
+ sendto=36
+ +0.001523
+ sendto fd=4 addr=172.18.45.6:53
+ 31800100 00010000 00000000 09666f72 6566726f 6e740263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001493
+ sendto fd=4 addr=172.18.45.6:53
+ 31810100 00010000 00000000 12736563 75726974 796d616e 6167656d 656e7402
+ 636f026e 7a000001 0001.
+ sendto=42
+ +0.001667
+ sendto fd=4 addr=172.18.45.6:53
+ 31820100 00010000 00000000 09756e64 6572686f 75720263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001533
+ sendto fd=4 addr=172.18.45.6:53
+ 31830100 00010000 00000000 09736563 7572656e 6574036e 6574026e 7a000001
+ 0001.
+ sendto=34
+ +0.001495
+ sendto fd=4 addr=172.18.45.6:53
+ 31840100 00010000 00000000 046d6169 6c157370 65636961 6c696e76 65737469
+ 67617469 6f6e7302 636f026e 7a000001 0001.
+ sendto=50
+ +0.001627
+ sendto fd=4 addr=172.18.45.6:53
+ 31850100 00010000 00000000 096e7a64 65736967 6e730263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001653
+ sendto fd=4 addr=172.18.45.6:53
+ 31860100 00010000 00000000 026e7306 65747261 64650263 6f026e7a 00000100
+ 01.
+ sendto=33
+ +0.001512
+ sendto fd=4 addr=172.18.45.6:53
+ 31870100 00010000 00000000 046d6169 6c056e7a 69706903 6f726702 6e7a0000
+ 010001.
+ sendto=35
+ +0.001512
+ sendto fd=4 addr=172.18.45.6:53
+ 31880100 00010000 00000000 046d6169 6c09756e 64657268 6f757202 636f026e
+ 7a000001 0001.
+ sendto=38
+ +0.001541
+ sendto fd=4 addr=172.18.45.6:53
+ 31890100 00010000 00000000 026e7304 61736973 036f7267 026e7a00 00010001.
+ sendto=32
+ +0.001581
+ sendto fd=4 addr=172.18.45.6:53
+ 318a0100 00010000 00000000 026e7308 626f7571 75657473 02636f02 6e7a0000
+ 010001.
+ sendto=35
+ +0.001520
+ sendto fd=4 addr=172.18.45.6:53
+ 318b0100 00010000 00000000 05616761 74650263 6f026e7a 00000100 01.
+ sendto=29
+ +0.001525
+ read fd=5 buflen=2433
+ read=EAGAIN
+ +0.000154
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.463947
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000380
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312e8180 00010001 00020002 026e7308 73656375 72697479 02636f02 6e7a0000
+ 010001c0 0c000100 01000151 4a0004cb 6300fe08 73656375 72697479 02636f02
+ 6e7a0000 02000100 01514a00 02c00cc0 33000200 01000151 4a001103 6e733107
+ 7761696b 61746f02 6163c03f c00c0001 00010001 514a0004 cb6300fe c05b0001
+ 00010002 a2c20004 8cc8800d.
+ +0.001006
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312f8180 00010001 00020002 05746574 72610263 6f026e7a 00000100 01c00c00
+ 01000100 01515100 04cb6300 fec00c00 02000100 01515100 05026e73 c00cc00c
+ 00020001 00015151 0013036e 73310777 61696b61 746f0261 63026e7a 00c03900
+ 01000100 01407100 04cb6300 fec04a00 01000100 02a2c200 048cc880 0d.
+ +0.001541
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31308180 00010001 00020002 046d6169 6c056167 61746502 636f026e 7a000001
+ 0001c00c 00010001 0001514c 0004cb63 00fe0561 67617465 02636f02 6e7a0000
+ 02000100 01514c00 05026e73 c032c032 00020001 0001514c 0011036e 73310777
+ 61696b61 746f0261 63c03bc0 49000100 01000140 6c0004cb 6300fec0 5a000100
+ 010002a2 c200048c c8800d.
+ +0.001291
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31318180 00010001 00020002 026e7305 61676174 6502636f 026e7a00 00010001
+ c00c0001 00010001 30660004 cb6300fe 05616761 74650263 6f026e7a 00000200
+ 01000151 4c0002c0 0cc03000 02000100 01514c00 11036e73 31077761 696b6174
+ 6f026163 c039c00c 00010001 00013066 0004cb63 00fec055 00010001 0002a2c2
+ 00048cc8 800d.
+ +0.001292
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31328180 00010001 00020002 10736563 75726974 79747261 696e696e 6702636f
+ 026e7a00 00010001 c00c0001 00010001 514c0004 cb6300fe c00c0002 00010001
+ 514c0005 026e73c0 0cc00c00 02000100 01514c00 13036e73 31077761 696b6174
+ 6f026163 026e7a00 c0440001 00010001 406c0004 cb6300fe c0550001 00010002
+ a2c20004 8cc8800d.
+ +0.001315
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31338180 00010001 00020002 026e730a 67696674 6261736b 65740263 6f026e7a
+ 00000100 01c00c00 01000100 01514f00 04cb6300 fe0a6769 66746261 736b6574
+ 02636f02 6e7a0000 02000100 01514f00 02c00cc0 35000200 01000151 4f001103
+ 6e733107 7761696b 61746f02 6163c043 c00c0001 00010001 514f0004 cb6300fe
+ c05f0001 00010002 a2c20004 8cc8800d.
+ +0.001316
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31348180 00010001 00020002 026e7308 73656375 72697479 0367656e 026e7a00
+ 00010001 c00c0001 00010001 514c0004 cb6300fe 08736563 75726974 79036765
+ 6e026e7a 00000200 01000151 4c0002c0 0cc03400 02000100 01514c00 11036e73
+ 31077761 696b6174 6f026163 c041c00c 00010001 0001514c 0004cb63 00fec05d
+ 00010001 0002a2c2 00048cc8 800d.
+ +0.001354
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31358180 00010001 00020002 07626f75 71756574 02636f02 6e7a0000 010001c0
+ 0c000100 01000151 4c0004cb 6300fec0 0c000200 01000151 4c000502 6e73c00c
+ c00c0002 00010001 514c0013 036e7331 07776169 6b61746f 02616302 6e7a00c0
+ 3b000100 01000140 6c0004cb 6300fec0 4c000100 010002a2 c200048c c8800d.
+ +0.001244
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31368180 00010001 00020002 0d696e76 65737469 67617469 6f6e0263 6f026e7a
+ 00000100 01c00c00 01000100 01515100 04cb6300 fec00c00 02000100 01515100
+ 05026e73 c00cc00c 00020001 00015151 0013036e 73310777 61696b61 746f0261
+ 63026e7a 00c04100 01000100 01407100 04cb6300 fec05200 01000100 02a2c200
+ 048cc880 0d.
+ +0.001200
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31378180 00010001 00020002 026e7305 6e7a6970 69036f72 67026e7a 00000100
+ 01c00c00 01000100 01515100 04cb6300 fe056e7a 69706903 6f726702 6e7a0000
+ 02000100 01515100 02c00cc0 31000200 01000151 51001103 6e733107 7761696b
+ 61746f02 6163c03b c00c0001 00010001 51510004 cb6300fe c0570001 00010002
+ a2c20004 8cc8800d.
+ +0.001223
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31388180 00010001 00020002 046d6169 6c046e65 72750263 6f026e7a 00000100
+ 01c00c00 01000100 01514c00 04cb6300 fe046e65 72750263 6f026e7a 00000200
+ 01000151 51000502 6e73c031 c0310002 00010001 51510011 036e7331 07776169
+ 6b61746f 026163c0 39c04700 01000100 01407100 04cb6300 fec05800 01000100
+ 02a2c200 048cc880 0d.
+ +0.001353
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31398180 00010001 00020002 08736563 75726974 7902636f 026e7a00 00010001
+ c00c0001 00010001 514a0004 cb6300fe c00c0002 00010001 514a0005 026e73c0
+ 0cc00c00 02000100 01514a00 13036e73 31077761 696b6174 6f026163 026e7a00
+ c03c0001 00010001 514a0004 cb6300fe c04d0001 00010002 a2c20004 8cc8800d.
+ +0.001193
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313a8583 00010000 00010000 026e730a 73746f72 65776174 63680263 6f026e7a
+ 00000100 0102636f 026e7a00 00060001 00000222 002c046e 73393907 7761696b
+ 61746f02 6163c028 03736f61 c03b7727 6ec50000 0e100000 07080027 8d000001
+ 5180.
+ +0.001027
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313b8180 00010001 00020002 08736563 75726974 79036765 6e026e7a 00000100
+ 01c00c00 01000100 01514c00 04cb6300 fec00c00 02000100 01514c00 05026e73
+ c00cc00c 00020001 0001514c 0013036e 73310777 61696b61 746f0261 63026e7a
+ 00c03d00 01000100 01514c00 04cb6300 fec04e00 01000100 02a2c200 048cc880
+ 0d.
+ +0.026055
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313c8180 00010001 00020002 026e7305 74657472 6102636f 026e7a00 00010001
+ c00c0001 00010001 306b0004 cb6300fe 05746574 72610263 6f026e7a 00000200
+ 01000151 510002c0 0cc03000 02000100 01515100 11036e73 31077761 696b6174
+ 6f026163 c039c00c 00010001 0001306b 0004cb63 00fec055 00010001 0002a2c2
+ 00048cc8 800d.
+ +0.001134
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313d8180 00010001 00020002 046d6169 6c057465 74726102 636f026e 7a000001
+ 0001c00c 00010001 00015151 0004cb63 00fe0574 65747261 02636f02 6e7a0000
+ 02000100 01515100 05026e73 c032c032 00020001 00015151 0011036e 73310777
+ 61696b61 746f0261 63c03bc0 49000100 01000130 6b0004cb 6300fec0 5a000100
+ 010002a2 c200048c c8800d.
+ +0.001247
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313e8180 00010001 00020002 026e730a 73656375 72696361 72640263 6f026e7a
+ 00000100 01c00c00 01000100 01515200 04cb6300 fe0a7365 63757269 63617264
+ 02636f02 6e7a0000 02000100 01515200 02c00cc0 35000200 01000151 52001103
+ 6e733107 7761696b 61746f02 6163c043 c00c0001 00010001 51520004 cb6300fe
+ c05f0001 00010002 a2c20004 8cc8800d.
+ +0.001158
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313f8180 00010001 00020002 026e7309 756e6465 72686f75 7202636f 026e7a00
+ 00010001 c00c0001 00010001 51510004 cb6300fe 09756e64 6572686f 75720263
+ 6f026e7a 00000200 01000151 510002c0 0cc03400 02000100 01515100 11036e73
+ 31077761 696b6174 6f026163 c041c00c 00010001 00015151 0004cb63 00fec05d
+ 00010001 0002a2c2 00048cc8 800d.
+ +0.001137
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31408180 00010001 00020002 03626363 02636f02 6e7a0000 010001c0 0c000100
+ 01000151 4c0004cb 6300fec0 0c000200 01000151 4f000502 6e73c00c c00c0002
+ 00010001 514f0013 036e7331 07776169 6b61746f 02616302 6e7a00c0 37000100
+ 01000140 6f0004cb 6300fec0 48000100 010002a2 c200048c c8800d.
+ +0.001061
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31418180 00010001 00020002 08736563 75726974 79036f72 67026e7a 00000100
+ 01c00c00 01000100 01514c00 04cb6300 fec00c00 02000100 01514c00 05026e73
+ c00cc00c 00020001 0001514c 0013036e 73310777 61696b61 746f0261 63026e7a
+ 00c03d00 01000100 01406c00 04cb6300 fec04e00 01000100 02a2c200 048cc880
+ 0d.
+ +0.001163
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31428180 00010001 00020002 0d627572 676c6172 616c6172 6d730263 6f026e7a
+ 00000100 01c00c00 01000100 01514c00 04cb6300 fec00c00 02000100 01514c00
+ 05026e73 c00cc00c 00020001 0001514c 0013036e 73310777 61696b61 746f0261
+ 63026e7a 00c04100 01000100 01406c00 04cb6300 fec05200 01000100 02a2c200
+ 048cc880 0d.
+ +0.001131
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31438583 00010000 00010000 026e7305 73616665 7302636f 026e7a00 00010001
+ 05736166 65730263 6f026e7a 00000600 01000002 27002e03 6e733104 69687567
+ 036e6574 c0290373 6f610469 687567c0 26772768 a9000151 8000002a 30001275
+ 000002a3 00.
+ +0.000894
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31448180 00010001 00020002 026e7308 73656375 72697479 036f7267 026e7a00
+ 00010001 c00c0001 00010001 30660004 cb6300fe 08736563 75726974 79036f72
+ 67026e7a 00000200 01000151 4c0002c0 0cc03400 02000100 01514c00 11036e73
+ 31077761 696b6174 6f026163 c041c00c 00010001 00013066 0004cb63 00fec05d
+ 00010001 0002a2c2 00048cc8 800d.
+ +0.001127
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31458180 00010001 00020002 10636f75 70657263 6f6e7375 6c74696e 6702636f
+ 026e7a00 00010001 c00c0001 00010001 514f0004 cb6300fe c00c0002 00010001
+ 51520005 026e73c0 0cc00c00 02000100 01515200 13036e73 31077761 696b6174
+ 6f026163 026e7a00 c0440001 00010001 40720004 cb6300fe c0550001 00010002
+ a2c20004 8cc8800d.
+ +0.001215
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31468180 00010001 00020002 0e736563 75726974 79677561 72647302 636f026e
+ 7a000001 0001c00c 00010001 0001514f 0004cb63 00fec00c 00020001 0001514f
+ 0005026e 73c00cc0 0c000200 01000151 4f001303 6e733107 7761696b 61746f02
+ 6163026e 7a00c042 00010001 0001406f 0004cb63 00fec053 00010001 0002a2c2
+ 00048cc8 800d.
+ +0.001099
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31478180 00010001 00020002 026e7306 67756172 64730263 6f026e7a 00000100
+ 01c00c00 01000100 01514f00 04cb6300 fe066775 61726473 02636f02 6e7a0000
+ 02000100 01514f00 02c00cc0 31000200 01000151 4f001103 6e733107 7761696b
+ 61746f02 6163c03b c00c0001 00010001 514f0004 cb6300fe c0570001 00010002
+ a2c20004 8cc8800d.
+ +0.001123
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31488180 00010001 00020002 04617369 73036f72 67026e7a 00000100 01c00c00
+ 01000100 01514f00 04cb6300 fec00c00 02000100 01514f00 05026e73 c00cc00c
+ 00020001 0001514f 0013036e 73310777 61696b61 746f0261 63026e7a 00c03900
+ 01000100 01406f00 04cb6300 fec04a00 01000100 02a2c200 048cc880 0d.
+ +0.001033
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31498180 00010001 00020002 046e6572 7502636f 026e7a00 00010001 c00c0001
+ 00010001 514f0004 cb6300fe c00c0002 00010001 51510005 026e73c0 0cc00c00
+ 02000100 01515100 13036e73 31077761 696b6174 6f026163 026e7a00 c0380001
+ 00010001 40710004 cb6300fe c0490001 00010002 a2c20004 8cc8800d.
+ +0.001109
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 314a8180 00010001 00020002 0a676966 74626173 6b657402 636f026e 7a000001
+ 0001c00c 00010001 0001514f 0004cb63 00fec00c 00020001 0001514f 0005026e
+ 73c00cc0 0c000200 01000151 4f001303 6e733107 7761696b 61746f02 6163026e
+ 7a00c03e 00010001 0001514f 0004cb63 00fec04f 00010001 0002a2c2 00048cc8
+ 800d.
+ +0.001126
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 314b8180 00010001 00020002 056d6167 69630263 6f026e7a 00000100 01c00c00
+ 01000100 01514f00 04cb6300 fec00c00 02000100 01515100 05026e73 c00cc00c
+ 00020001 00015151 0013036e 73310777 61696b61 746f0261 63026e7a 00c03900
+ 01000100 01407100 04cb6300 fec04a00 01000100 02a2c200 048cc880 0d.
+ +0.001034
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 314c8180 00010001 00020002 046d6169 6c036263 6302636f 026e7a00 00010001
+ c00c0001 00010001 514f0004 cb6300fe 03626363 02636f02 6e7a0000 02000100
+ 01514f00 05026e73 c030c030 00020001 0001514f 0011036e 73310777 61696b61
+ 746f0261 63c037c0 45000100 01000140 6f0004cb 6300fec0 56000100 010002a2
+ c200048c c8800d.
+ +0.001118
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 314d8180 00010001 00020002 026e730d 696e7665 73746967 6174696f 6e02636f
+ 026e7a00 00010001 c00c0001 00010001 306b0004 cb6300fe 0d696e76 65737469
+ 67617469 6f6e0263 6f026e7a 00000200 01000151 510002c0 0cc03800 02000100
+ 01515100 11036e73 31077761 696b6174 6f026163 c049c00c 00010001 0001306b
+ 0004cb63 00fec065 00010001 0002a2c2 00048cc8 800d.
+ +0.001270
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 314e8180 00010001 00020002 056e7a69 7069036f 7267026e 7a000001 0001c00c
+ 00010001 0001514f 0004cb63 00fec00c 00020001 00015151 0005026e 73c00cc0
+ 0c000200 01000151 51001303 6e733107 7761696b 61746f02 6163026e 7a00c03a
+ 00010001 00015151 0004cb63 00fec04b 00010001 0002a2c2 00048cc8 800d.
+ +0.001059
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 314f8180 00010001 00020002 026e7307 626f7571 75657402 636f026e 7a000001
+ 0001c00c 00010001 00013066 0004cb63 00fe0762 6f757175 65740263 6f026e7a
+ 00000200 01000151 4c0002c0 0cc03200 02000100 01514c00 11036e73 31077761
+ 696b6174 6f026163 c03dc00c 00010001 00013066 0004cb63 00fec059 00010001
+ 0002a2c2 00048cc8 800d.
+ +0.001142
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000280
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.398497
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000524
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31508583 00010000 00010000 046d6169 6c057361 66657302 636f026e 7a000001
+ 00010573 61666573 02636f02 6e7a0000 06000100 00022700 2e036e73 31046968
+ 7567036e 6574c02b 03736f61 04696875 67c02877 2768a900 01518000 002a3000
+ 12750000 02a300.
+ +0.000719
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000326
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.396928
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002842
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31518180 00010001 00020002 026e7303 62636302 636f026e 7a000001 0001c00c
+ 00010001 00013069 0004cb63 00fe0362 63630263 6f026e7a 00000200 01000151
+ 4f0002c0 0cc02e00 02000100 01514f00 11036e73 31077761 696b6174 6f026163
+ c035c00c 00010001 00013069 0004cb63 00fec051 00010001 0002a2c2 00048cc8
+ 800d.
+ +0.000884
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000295
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.392907
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003411
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31528180 00010001 00020002 026e730d 62757267 6c617261 6c61726d 7302636f
+ 026e7a00 00010001 c00c0001 00010001 30660004 cb6300fe 0d627572 676c6172
+ 616c6172 6d730263 6f026e7a 00000200 01000151 4c0002c0 0cc03800 02000100
+ 01514c00 11036e73 31077761 696b6174 6f026163 c049c00c 00010001 00013066
+ 0004cb63 00fec065 00010001 0002a2c2 00048cc8 800d.
+ +0.000997
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000330
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.388169
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003160
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31538180 00010001 00020002 026e730e 73656375 72697479 67756172 64730263
+ 6f026e7a 00000100 01c00c00 01000100 01306900 04cb6300 fe0e7365 63757269
+ 74796775 61726473 02636f02 6e7a0000 02000100 01514f00 02c00cc0 39000200
+ 01000151 4f001103 6e733107 7761696b 61746f02 6163c04b c00c0001 00010001
+ 30690004 cb6300fe c0670001 00010002 a2c20004 8cc8800d.
+ +0.001023
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000298
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.383688
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003221
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31548180 00010001 00020002 0d636f76 65727463 616d6572 61730263 6f026e7a
+ 00000100 01c00c00 01000100 01515200 04cb6300 fec00c00 02000100 01515200
+ 05026e73 c00cc00c 00020001 00015152 0013036e 73310777 61696b61 746f0261
+ 63026e7a 00c04100 01000100 01515200 04cb6300 fec05200 01000100 02a2c200
+ 048cc880 0d.
+ +0.000929
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000291
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.379247
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002946
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31558180 00010001 00020002 026e7304 6e657275 02636f02 6e7a0000 010001c0
+ 0c000100 01000130 6b0004cb 6300fe04 6e657275 02636f02 6e7a0000 02000100
+ 01515100 02c00cc0 2f000200 01000151 51001103 6e733107 7761696b 61746f02
+ 6163c037 c00c0001 00010001 306b0004 cb6300fe c0530001 00010002 a2c20004
+ 8cc8800d.
+ +0.000895
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000294
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.375112
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003284
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31568180 00010001 00020002 026e730d 636f7665 72746361 6d657261 7302636f
+ 026e7a00 00010001 c00c0001 00010001 51520004 cb6300fe 0d636f76 65727463
+ 616d6572 61730263 6f026e7a 00000200 01000151 520002c0 0cc03800 02000100
+ 01515200 11036e73 31077761 696b6174 6f026163 c049c00c 00010001 00015152
+ 0004cb63 00fec065 00010001 0002a2c2 00048cc8 800d.
+ +0.001002
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000295
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.370531
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003077
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31578180 00010001 00020002 08626f75 71756574 7302636f 026e7a00 00010001
+ c00c0001 00010001 51530004 cb6300fe c00c0002 00010001 51530013 036e7331
+ 07776169 6b61746f 02616302 6e7a00c0 0c000200 01000151 53000502 6e73c00c
+ c03c0001 00010002 a2c20004 8cc8800d c05b0001 00010001 51530004 cb6300fe.
+ +0.000868
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000322
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.366264
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003188
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31588180 00010001 00020002 0a636f6e 63656e74 72696302 636f026e 7a000001
+ 0001c00c 00010001 0001514f 0004cb63 00fec00c 00020001 00015152 0005026e
+ 73c00cc0 0c000200 01000151 52001303 6e733107 7761696b 61746f02 6163026e
+ 7a00c03e 00010001 00014072 0004cb63 00fec04f 00010001 0002a2c2 00048cc8
+ 800d.
+ +0.000883
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000292
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.361901
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003497
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31598180 00010001 00020002 026e7310 73656375 72697479 74726169 6e696e67
+ 02636f02 6e7a0000 010001c0 0c000100 01000130 660004cb 6300fe10 73656375
+ 72697479 74726169 6e696e67 02636f02 6e7a0000 02000100 01514c00 02c00cc0
+ 3b000200 01000151 4c001103 6e733107 7761696b 61746f02 6163c04f c00c0001
+ 00010001 30660004 cb6300fe c06b0001 00010002 a2c20004 8cc8800d.
+ +0.001031
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000343
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.357030
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003250
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 315a8180 00010001 00020002 046d6169 6c10636f 75706572 636f6e73 756c7469
+ 6e670263 6f026e7a 00000100 01c00c00 01000100 01515200 04cb6300 fe10636f
+ 75706572 636f6e73 756c7469 6e670263 6f026e7a 00000200 01000151 52000502
+ 6e73c03d c03d0002 00010001 51520011 036e7331 07776169 6b61746f 026163c0
+ 51c05f00 01000100 01407200 04cb6300 fec07000 01000100 02a2c200 048cc880
+ 0d.
+ +0.001063
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000296
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.352421
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003258
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 315b8180 00010001 00020002 0e726574 61696c73 65637572 69747902 636f026e
+ 7a000001 0001c00c 00010001 0001514f 0004cb63 00fec00c 00020001 00015151
+ 0005026e 73c00cc0 0c000200 01000151 51001303 6e733107 7761696b 61746f02
+ 6163026e 7a00c042 00010001 00014071 0004cb63 00fec053 00010001 0002a2c2
+ 00048cc8 800d.
+ +0.000908
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000289
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.347966
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003170
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 315c8180 00010001 00020002 026e730a 636f6e63 656e7472 69630263 6f026e7a
+ 00000100 01c00c00 01000100 01306c00 04cb6300 fe0a636f 6e63656e 74726963
+ 02636f02 6e7a0000 02000100 01515200 02c00cc0 35000200 01000151 52001103
+ 6e733107 7761696b 61746f02 6163c043 c00c0001 00010001 306c0004 cb6300fe
+ c05f0001 00010002 a2c20004 8cc8800d.
+ +0.000963
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000324
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.343509
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003025
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 315d8180 00010001 00020002 046d6169 6c056d61 67696302 636f026e 7a000001
+ 0001c00c 00010001 0001514f 0004cb63 00fe056d 61676963 02636f02 6e7a0000
+ 02000100 01515100 05026e73 c032c032 00020001 00015151 0011036e 73310777
+ 61696b61 746f0261 63c03bc0 49000100 01000140 710004cb 6300fec0 5a000100
+ 010002a2 c200048c c8800d.
+ +0.000934
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000292
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.339258
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003113
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 315e8180 00010001 00020002 096e7a61 6e676c69 6e670263 6f026e7a 00000100
+ 01c00c00 01000100 01514f00 04cb6300 fec00c00 02000100 01514f00 05026e73
+ c00cc00c 00020001 0001514f 0013036e 73310777 61696b61 746f0261 63026e7a
+ 00c03d00 01000100 01514f00 04cb6300 fec04e00 01000100 02a2c200 048cc880
+ 0d.
+ +0.000877
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000320
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.334948
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004222
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 315f8180 00010001 00020002 026e7310 636f7570 6572636f 6e73756c 74696e67
+ 02636f02 6e7a0000 010001c0 0c000100 01000130 6c0004cb 6300fe10 636f7570
+ 6572636f 6e73756c 74696e67 02636f02 6e7a0000 02000100 01515200 02c00cc0
+ 3b000200 01000151 52001103 6e733107 7761696b 61746f02 6163c04f c00c0001
+ 00010001 306c0004 cb6300fe c06b0001 00010002 a2c20004 8cc8800d.
+ +0.001034
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000296
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.329396
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.008279
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010000 00010000 03323534 01300239 39033230 3307696e 2d616464
+ 72046172 70610000 05000101 30023939 03323033 07696e2d 61646472 04617270
+ 61000006 00010001 5180002e 026e7308 73656375 72697479 02636f02 6e7a0004
+ 726f6f74 c04c7727 714c0000 2a300000 0e100009 3a800001 5180.
+ +0.000837
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000405
+ close fd=4
+ close=OK
+ +0.000415
+ close fd=5
+ close=OK
+ +0.000167
diff --git a/adns-0.6/regress/case-ndots-as.err b/adns-0.6/regress/case-ndots-as.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-ndots-as.err
diff --git a/adns-0.6/regress/case-ndots-as.out b/adns-0.6/regress/case-ndots-as.out
new file mode 100644
index 0000000..9c4bb87
--- /dev/null
+++ b/adns-0.6/regress/case-ndots-as.out
@@ -0,0 +1,16 @@
+adns debug: using nameserver 172.18.45.6
+newsx.davenant flags 5 type 1 A(-) submitted
+news.davenant flags 5 type 1 A(-) submitted
+news.davenant.greenend.org.uk flags 5 type 1 A(-) submitted
+trunc.test.iwj.relativity flags 5 type 1 A(-) submitted
+trunx.test.iwj.relativity flags 5 type 1 A(-) submitted
+test.iwj.relativity flags 5 type 1 A(-) submitted
+news.davenant.greenend.org.uk flags 5 type A(-): OK; nrrs=1; cname=davenant.relativity.greenend.org.uk; owner=news.davenant.greenend.org.uk; ttl=86400
+ 172.18.45.6
+newsx.davenant flags 5 type A(-): No such domain; nrrs=0; cname=$; owner=newsx.davenant.greenend.org.uk; ttl=86400
+news.davenant flags 5 type A(-): OK; nrrs=1; cname=davenant.relativity.greenend.org.uk; owner=news.davenant.greenend.org.uk; ttl=86400
+ 172.18.45.6
+trunc.test.iwj.relativity flags 5 type A(-): No such data; nrrs=0; cname=$; owner=trunc.test.iwj.relativity.greenend.org.uk; ttl=60
+trunx.test.iwj.relativity flags 5 type A(-): No such domain; nrrs=0; cname=$; owner=trunx.test.iwj.relativity.greenend.org.uk; ttl=60
+test.iwj.relativity flags 5 type A(-): No such data; nrrs=0; cname=$; owner=test.iwj.relativity.greenend.org.uk; ttl=60
+rc=0
diff --git a/adns-0.6/regress/case-ndots-as.sys b/adns-0.6/regress/case-ndots-as.sys
new file mode 100644
index 0000000..b5f6e5a
--- /dev/null
+++ b/adns-0.6/regress/case-ndots-as.sys
@@ -0,0 +1,316 @@
+default
+:1 5/newsx.davenant 5/news.davenant 5/news.davenant.greenend.org.uk 5/trunc.test.iwj.relativity 5/trunx.test.iwj.relativity 5/test.iwj.relativity
+ start 931992163.221752
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000186
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000086
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000066
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 056e6577 73780864 6176656e 616e7400 00010001.
+ sendto=32
+ +0.000567
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 046e6577 73086461 76656e61 6e740000 010001.
+ sendto=31
+ +0.000453
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001.
+ sendto=47
+ +0.000507
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790000 010001.
+ sendto=43
+ +0.000479
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790000 010001.
+ sendto=43
+ +0.000624
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 04746573 74036977 6a0a7265 6c617469 76697479
+ 00000100 01.
+ sendto=37
+ +0.000457
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.996913
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.022284
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010002 00030003 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001c0 0c000500 01000151 80002508 64617665
+ 6e616e74 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ c03b0001 00010001 51800004 ac122d06 c0440002 00010001 51800006 036e7330
+ c044c044 00020001 00015180 0006036e 7331c044 c0440002 00010001 51800006
+ 036e7332 c044c07c 00010001 00015180 0004ac12 2d06c08e 00010001 00015180
+ 0004ac12 2d41c0a0 00010001 00015180 0004ac12 2d01.
+ +0.001420
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000291
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.972918
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.387236
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8583 00010000 00010000 056e6577 73780864 6176656e 616e7400 00010001
+ 00000600 01000151 80003e01 410c524f 4f542d53 45525645 5253034e 4554000a
+ 686f7374 6d617374 65720849 4e544552 4e4943c0 3a772768 44000007 08000003
+ 8400093a 80000151 80.
+ +0.000745
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 056e6577 73780864 6176656e 616e7408 64617665
+ 6e616e74 08677265 656e656e 64036f72 6702756b 00000100 01.
+ sendto=57
+ +0.000559
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000102
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.584843
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005460
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258583 00010000 00010000 056e6577 73780864 6176656e 616e7408 64617665
+ 6e616e74 08677265 656e656e 64036f72 6702756b 00000100 01086772 65656e65
+ 6e64036f 72670275 6b000006 00010001 5180002d 026e7306 63686961 726bc039
+ 0a686f73 746d6173 746572c0 39772741 34000070 8000001c 2000093a 80000151
+ 80.
+ +0.000861
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 056e6577 73780864 6176656e 616e7408 67726565
+ 6e656e64 036f7267 02756b00 00010001.
+ sendto=48
+ +0.000511
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000100
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.577911
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003716
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268583 00010000 00010000 056e6577 73780864 6176656e 616e7408 67726565
+ 6e656e64 036f7267 02756b00 00010001 08677265 656e656e 64036f72 6702756b
+ 00000600 01000151 80002d02 6e730663 68696172 6bc0300a 686f7374 6d617374
+ 6572c030 77274134 00007080 00001c20 00093a80 00015180.
+ +0.000808
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000127
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.573260
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.075508
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208583 00010000 00010000 046e6577 73086461 76656e61 6e740000 01000100
+ 00060001 00015180 003e0141 0c524f4f 542d5345 52564552 53034e45 54000a68
+ 6f73746d 61737465 7208494e 5445524e 4943c039 77276844 00000708 00000384
+ 00093a80 00015180.
+ +0.000755
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 046e6577 73086461 76656e61 6e740864 6176656e
+ 616e7408 67726565 6e656e64 036f7267 02756b00 00010001.
+ sendto=56
+ +0.000532
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000101
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.497324
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005326
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278583 00010000 00010000 046e6577 73086461 76656e61 6e740864 6176656e
+ 616e7408 67726565 6e656e64 036f7267 02756b00 00010001 08677265 656e656e
+ 64036f72 6702756b 00000600 01000151 80002d02 6e730663 68696172 6bc0380a
+ 686f7374 6d617374 6572c038 77274134 00007080 00001c20 00093a80 00015180.
+ +0.000855
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001.
+ sendto=47
+ +0.000503
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000100
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.490540
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.007220
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288580 00010002 00030003 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001c0 0c000500 01000151 80002508 64617665
+ 6e616e74 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ c03b0001 00010001 51800004 ac122d06 c0440002 00010001 51800006 036e7330
+ c044c044 00020001 00015180 0006036e 7331c044 c0440002 00010001 51800006
+ 036e7332 c044c07c 00010001 00015180 0004ac12 2d06c08e 00010001 00015180
+ 0004ac12 2d41c0a0 00010001 00015180 0004ac12 2d01.
+ +0.001356
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000223
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.481741
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.023419
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228583 00010000 00010000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790000 01000100 00060001 00015180 003e0141 0c524f4f 542d5345
+ 52564552 53034e45 54000a68 6f73746d 61737465 7208494e 5445524e 4943c045
+ 77276844 00000708 00000384 00093a80 00015180.
+ +0.000802
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790864 6176656e 616e7408 67726565 6e656e64 036f7267 02756b00
+ 00010001.
+ sendto=68
+ +0.000607
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000101
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.457291
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005416
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298583 00010000 00010000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790864 6176656e 616e7408 67726565 6e656e64 036f7267 02756b00
+ 00010001 08677265 656e656e 64036f72 6702756b 00000600 01000151 80002d02
+ 6e730663 68696172 6bc0440a 686f7374 6d617374 6572c044 77274134 00007080
+ 00001c20 00093a80 00015180.
+ +0.000925
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=59
+ +0.000575
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000101
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.450274
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.006009
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8580 00010000 00010000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 01000104 74657374
+ 0369776a 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ 00060001 0000003c 0027036e 7330c044 0a686f73 746d6173 746572c0 44000000
+ 1800000e 10000000 780064c8 00000000 3c.
+ +0.000954
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000145
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.443166
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.014229
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238583 00010000 00010000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790000 01000100 00060001 00015180 003e0141 0c524f4f 542d5345
+ 52564552 53034e45 54000a68 6f73746d 61737465 7208494e 5445524e 4943c045
+ 77276844 00000708 00000384 00093a80 00015180.
+ +0.000805
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790864 6176656e 616e7408 67726565 6e656e64 036f7267 02756b00
+ 00010001.
+ sendto=68
+ +0.000606
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000101
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.428049
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005331
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8583 00010000 00010000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790864 6176656e 616e7408 67726565 6e656e64 036f7267 02756b00
+ 00010001 08677265 656e656e 64036f72 6702756b 00000600 01000151 80002d02
+ 6e730663 68696172 6bc0440a 686f7374 6d617374 6572c044 77274134 00007080
+ 00001c20 00093a80 00015180.
+ +0.000923
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=59
+ +0.000584
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000101
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.421110
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004042
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8583 00010000 00010000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 01000104 74657374
+ 0369776a 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ 00060001 0000003c 0027036e 7330c044 0a686f73 746d6173 746572c0 44000000
+ 1800000e 10000000 780064c8 00000000 3c.
+ +0.000951
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000153
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.415964
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.026227
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248583 00010000 00010000 04746573 74036977 6a0a7265 6c617469 76697479
+ 00000100 01000006 00010001 5180003e 01410c52 4f4f542d 53455256 45525303
+ 4e455400 0a686f73 746d6173 74657208 494e5445 524e4943 c03f7727 68440000
+ 07080000 03840009 3a800001 5180.
+ +0.000817
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 04746573 74036977 6a0a7265 6c617469 76697479
+ 08646176 656e616e 74086772 65656e65 6e64036f 72670275 6b000001 0001.
+ sendto=62
+ +0.000579
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000102
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998502
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005185
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8583 00010000 00010000 04746573 74036977 6a0a7265 6c617469 76697479
+ 08646176 656e616e 74086772 65656e65 6e64036f 72670275 6b000001 00010867
+ 7265656e 656e6403 6f726702 756b0000 06000100 01518000 2d026e73 06636869
+ 61726bc0 3e0a686f 73746d61 73746572 c03e7727 41340000 70800000 1c200009
+ 3a800001 5180.
+ +0.000918
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 04746573 74036977 6a0a7265 6c617469 76697479
+ 08677265 656e656e 64036f72 6702756b 00000100 01.
+ sendto=53
+ +0.000524
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000102
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998456
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004007
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312e8580 00010000 00010000 04746573 74036977 6a0a7265 6c617469 76697479
+ 08677265 656e656e 64036f72 6702756b 00000100 01c00c00 06000100 00003c00
+ 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b
+ 000a686f 73746d61 73746572 c0450000 00180000 0e100000 00780064 c8000000
+ 003c.
+ +0.000867
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000175
+ close fd=4
+ close=OK
+ +0.000183
diff --git a/adns-0.6/regress/case-ndots.err b/adns-0.6/regress/case-ndots.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-ndots.err
diff --git a/adns-0.6/regress/case-ndots.out b/adns-0.6/regress/case-ndots.out
new file mode 100644
index 0000000..ceef65a
--- /dev/null
+++ b/adns-0.6/regress/case-ndots.out
@@ -0,0 +1,16 @@
+adns debug: using nameserver 172.18.45.6
+newsx.davenant flags 5 type 1 A(-) submitted
+news.davenant flags 5 type 1 A(-) submitted
+news.davenant.greenend.org.uk flags 5 type 1 A(-) submitted
+trunc.test.iwj.relativity flags 5 type 1 A(-) submitted
+trunx.test.iwj.relativity flags 5 type 1 A(-) submitted
+test.iwj.relativity flags 5 type 1 A(-) submitted
+newsx.davenant flags 5 type A(-): No such domain; nrrs=0; cname=$; owner=newsx.davenant; ttl=175
+news.davenant flags 5 type A(-): OK; nrrs=1; cname=davenant.relativity.greenend.org.uk; owner=news.davenant.greenend.org.uk; ttl=86400
+ 172.18.45.6
+news.davenant.greenend.org.uk flags 5 type A(-): OK; nrrs=1; cname=davenant.relativity.greenend.org.uk; owner=news.davenant.greenend.org.uk; ttl=86400
+ 172.18.45.6
+trunc.test.iwj.relativity flags 5 type A(-): No such data; nrrs=0; cname=$; owner=trunc.test.iwj.relativity.greenend.org.uk; ttl=60
+trunx.test.iwj.relativity flags 5 type A(-): No such domain; nrrs=0; cname=$; owner=trunx.test.iwj.relativity.greenend.org.uk; ttl=60
+test.iwj.relativity flags 5 type A(-): No such data; nrrs=0; cname=$; owner=test.iwj.relativity.greenend.org.uk; ttl=60
+rc=0
diff --git a/adns-0.6/regress/case-ndots.sys b/adns-0.6/regress/case-ndots.sys
new file mode 100644
index 0000000..8367d98
--- /dev/null
+++ b/adns-0.6/regress/case-ndots.sys
@@ -0,0 +1,277 @@
+ndots -,s
+:1 5/newsx.davenant 5/news.davenant 5/news.davenant.greenend.org.uk 5/trunc.test.iwj.relativity 5/trunx.test.iwj.relativity 5/test.iwj.relativity
+ start 924365863.351594
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000212
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000087
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000069
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 056e6577 73780864 6176656e 616e7408 64617665
+ 6e616e74 08677265 656e656e 64036f72 6702756b 00000100 01.
+ sendto=57
+ +0.003433
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 046e6577 73086461 76656e61 6e740864 6176656e
+ 616e7408 67726565 6e656e64 036f7267 02756b00 00010001.
+ sendto=56
+ +0.001694
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001.
+ sendto=47
+ +0.001921
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790000 010001.
+ sendto=43
+ +0.001042
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790000 010001.
+ sendto=43
+ +0.002220
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 04746573 74036977 6a0a7265 6c617469 76697479
+ 08646176 656e616e 74086772 65656e65 6e64036f 72670275 6b000001 0001.
+ sendto=62
+ +0.001132
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.988558
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000225
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8583 00010000 00010000 056e6577 73780864 6176656e 616e7408 64617665
+ 6e616e74 08677265 656e656e 64036f72 6702756b 00000100 01086772 65656e65
+ 6e64036f 72670275 6b000006 00010001 51800037 04646e73 3006656c 6d61696c
+ 02636fc0 46087269 63686172 646b0663 68696172 6bc03977 26f0bf00 00708000
+ 001c2000 093a8000 015180.
+ +0.000801
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 056e6577 73780864 6176656e 616e7408 67726565
+ 6e656e64 036f7267 02756b00 00010001.
+ sendto=48
+ +0.001048
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208583 00010000 00010000 046e6577 73086461 76656e61 6e740864 6176656e
+ 616e7408 67726565 6e656e64 036f7267 02756b00 00010001 08677265 656e656e
+ 64036f72 6702756b 00000600 01000151 80003704 646e7330 06656c6d 61696c02
+ 636fc045 08726963 68617264 6b066368 6961726b c0387726 f0bf0000 70800000
+ 1c200009 3a800001 5180.
+ +0.000773
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001.
+ sendto=47
+ +0.000440
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000105
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.990293
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004269
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010002 00030003 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001c0 0c000500 01000151 80002508 64617665
+ 6e616e74 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ c03b0001 00010001 51800004 ac122d06 c0440002 00010001 51800006 036e7330
+ c044c044 00020001 00015180 0006036e 7331c044 c0440002 00010001 51800006
+ 036e7332 c044c07c 00010001 00015180 0004ac12 2d06c08e 00010001 00015180
+ 0004ac12 2d41c0a0 00010001 00015180 0004ac12 2d01.
+ +0.001122
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000283
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.986540
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000988
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228583 00010000 00010000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790000 01000100 00060001 000000e3 003e0141 0c524f4f 542d5345
+ 52564552 53034e45 54000a68 6f73746d 61737465 7208494e 5445524e 4943c045
+ 7726f440 00000708 00000384 00093a80 00015180.
+ +0.000665
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790864 6176656e 616e7408 67726565 6e656e64 036f7267 02756b00
+ 00010001.
+ sendto=68
+ +0.000576
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000106
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.985247
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001800
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238583 00010000 00010000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790000 01000100 00060001 0000016b 003e0141 0c524f4f 542d5345
+ 52564552 53034e45 54000a68 6f73746d 61737465 7208494e 5445524e 4943c045
+ 7726f440 00000708 00000384 00093a80 00015180.
+ +0.000671
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790864 6176656e 616e7408 67726565 6e656e64 036f7267 02756b00
+ 00010001.
+ sendto=68
+ +0.000550
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000105
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.984341
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002209
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248583 00010000 00010000 04746573 74036977 6a0a7265 6c617469 76697479
+ 08646176 656e616e 74086772 65656e65 6e64036f 72670275 6b000001 00010867
+ 7265656e 656e6403 6f726702 756b0000 06000100 01518000 3704646e 73300665
+ 6c6d6169 6c02636f c04b0872 69636861 72646b06 63686961 726bc03e 7726f0bf
+ 00007080 00001c20 00093a80 00015180.
+ +0.000817
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 04746573 74036977 6a0a7265 6c617469 76697479
+ 08677265 656e656e 64036f72 6702756b 00000100 01.
+ sendto=53
+ +0.000476
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000105
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.982091
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001955
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258583 00010000 00010000 056e6577 73780864 6176656e 616e7408 67726565
+ 6e656e64 036f7267 02756b00 00010001 08677265 656e656e 64036f72 6702756b
+ 00000600 01000151 80003704 646e7330 06656c6d 61696c02 636fc03d 08726963
+ 68617264 6b066368 6961726b c0307726 f0bf0000 70800000 1c200009 3a800001
+ 5180.
+ +0.000729
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 056e6577 73780864 6176656e 616e7400 00010001.
+ sendto=32
+ +0.000394
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000109
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.978904
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005814
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268580 00010002 00030003 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001c0 0c000500 01000151 80002508 64617665
+ 6e616e74 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ c03b0001 00010001 51800004 ac122d06 c0440002 00010001 51800006 036e7330
+ c044c044 00020001 00015180 0006036e 7331c044 c0440002 00010001 51800006
+ 036e7332 c044c07c 00010001 00015180 0004ac12 2d06c08e 00010001 00015180
+ 0004ac12 2d41c0a0 00010001 00015180 0004ac12 2d01.
+ +0.001125
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000258
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.981536
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001427
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278583 00010000 00010000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790864 6176656e 616e7408 67726565 6e656e64 036f7267 02756b00
+ 00010001 08677265 656e656e 64036f72 6702756b 00000600 01000151 80003704
+ 646e7330 06656c6d 61696c02 636fc051 08726963 68617264 6b066368 6961726b
+ c0447726 f0bf0000 70800000 1c200009 3a800001 5180.
+ +0.000823
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=59
+ +0.000507
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000106
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.981820
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002135
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288583 00010000 00010000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790864 6176656e 616e7408 67726565 6e656e64 036f7267 02756b00
+ 00010001 08677265 656e656e 64036f72 6702756b 00000600 01000151 80003704
+ 646e7330 06656c6d 61696c02 636fc051 08726963 68617264 6b066368 6961726b
+ c0447726 f0bf0000 70800000 1c200009 3a800001 5180.
+ +0.000844
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=59
+ +0.000505
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000103
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.981768
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001673
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298580 00010000 00010000 04746573 74036977 6a0a7265 6c617469 76697479
+ 08677265 656e656e 64036f72 6702756b 00000100 01c00c00 06000100 00003c00
+ 41036e73 300a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b
+ 000a686f 73746d61 73746572 c0450000 00120000 0e100000 00780064 c8000000
+ 003c.
+ +0.000726
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000167
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.982555
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001681
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8583 00010000 00010000 056e6577 73780864 6176656e 616e7400 00010001
+ 00000600 01000000 af003e01 410c524f 4f542d53 45525645 5253034e 4554000a
+ 686f7374 6d617374 65720849 4e544552 4e4943c0 3a7726f4 40000007 08000003
+ 8400093a 80000151 80.
+ +0.000598
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.990016
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004585
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8580 00010000 00010000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 01000104 74657374
+ 0369776a 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ 00060001 0000003c 0027036e 7330c044 0a686f73 746d6173 746572c0 44000000
+ 1200000e 10000000 780064c8 00000000 3c.
+ +0.000786
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000146
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.988070
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002234
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8583 00010000 00010000 05747275 6e780474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 01000104 74657374
+ 0369776a 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ 00060001 0000003c 0027036e 7330c044 0a686f73 746d6173 746572c0 44000000
+ 1200000e 10000000 780064c8 00000000 3c.
+ +0.000780
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000120
+ close fd=4
+ close=OK
+ +0.000181
diff --git a/adns-0.6/regress/case-ndotsbad.err b/adns-0.6/regress/case-ndotsbad.err
new file mode 100644
index 0000000..700201a
--- /dev/null
+++ b/adns-0.6/regress/case-ndotsbad.err
@@ -0,0 +1 @@
+adns failure: init: errno=22
diff --git a/adns-0.6/regress/case-ndotsbad.out b/adns-0.6/regress/case-ndotsbad.out
new file mode 100644
index 0000000..b980b59
--- /dev/null
+++ b/adns-0.6/regress/case-ndotsbad.out
@@ -0,0 +1,3 @@
+adns debug: using nameserver 172.18.45.6
+adns: <supplied configuration text>:4: option `ndots:X' malformed or has bad value
+rc=2
diff --git a/adns-0.6/regress/case-ndotsbad.sys b/adns-0.6/regress/case-ndotsbad.sys
new file mode 100644
index 0000000..56d5877
--- /dev/null
+++ b/adns-0.6/regress/case-ndotsbad.sys
@@ -0,0 +1,2 @@
+ndotsbad
+:1 5/news.davenant.greenend.org.uk
diff --git a/adns-0.6/regress/case-noinfto.err b/adns-0.6/regress/case-noinfto.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-noinfto.err
diff --git a/adns-0.6/regress/case-noinfto.out b/adns-0.6/regress/case-noinfto.out
new file mode 100644
index 0000000..8f0d3df
--- /dev/null
+++ b/adns-0.6/regress/case-noinfto.out
@@ -0,0 +1,4 @@
+adns debug: using nameserver 172.18.45.36
+a.b.c.d flags 0 type 1 A(-) submitted
+a.b.c.d flags 0 type A(-): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604744
+rc=0
diff --git a/adns-0.6/regress/case-noinfto.sys b/adns-0.6/regress/case-noinfto.sys
new file mode 100644
index 0000000..422b38a
--- /dev/null
+++ b/adns-0.6/regress/case-noinfto.sys
@@ -0,0 +1,123 @@
+noserver -,p
+:1 a.b.c.d
+ start 940011574.766962
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000158
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000053
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000039
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.001065
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=1999
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.010188
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000218
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009786
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000282
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009708
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000217
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009800
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000272
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009786
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000216
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009723
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000273
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=EINTR
+ +18.-37194
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=0
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +10.-89436
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000256
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.006138
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000218
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009731
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000261
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009735
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000212
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009790
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000254
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009747
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000228
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009771
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000256
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009755
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 01610162 01630164 00000100 01.
+ sendto=25
+ +0.000226
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009768
+ close fd=4
+ close=OK
+ +0.000363
diff --git a/adns-0.6/regress/case-norecurse.err b/adns-0.6/regress/case-norecurse.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-norecurse.err
diff --git a/adns-0.6/regress/case-norecurse.out b/adns-0.6/regress/case-norecurse.out
new file mode 100644
index 0000000..f0d2a0f
--- /dev/null
+++ b/adns-0.6/regress/case-norecurse.out
@@ -0,0 +1,62 @@
+adns debug: using nameserver 172.18.45.6
+4.204.50.158.in-addr.arpa flags 0 type 1 A(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 2 NS(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 5 CNAME(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 6 SOA(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 12 PTR(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 13adns debug: TCP connected (NS=172.18.45.6)
+ HINFO(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 15adns warning: TCP connection failed: poll/select: exceptional condition detected (NS=172.18.45.6)
+ MX(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 16 TXT(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 17 RP(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65537 A(addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65538 NS(+addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65548 PTR(checked) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65551adns debug: TCP connected (NS=172.18.45.6)
+ MX(+addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 131078adns warning: TCP connection failed: poll/select: exceptional condition detected (NS=172.18.45.6)
+ SOA(822) submitted
+4.204.50.158.in-addr.arpa flags 0 type 131089adns debug: reply not found, id 3141, query owner ns2.afpdoc.com (NS=172.18.45.6)
+adns debug: reply not found, id 3142, query owner ns2.afp-notes.com (NS=172.18.45.6)
+adns debug: reply not found, id 3143, query owner ns2.afp-domino.com (NS=172.18.45.6)
+ RP(822) submitted
+4.204.50.158.in-addr.arpa flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type NS(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type SOA(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type PTR(raw): OK; nrrs=23; cname=$; owner=$; ttl=77948
+ ns2.afp.com
+ ns.afp.com
+ news.afp.com
+ ns2.afp.fr
+ ns.afp.fr
+ news.afp.fr
+ ns2.agencefrancepresse.com
+ news.agencefrancepresse.com
+ ns2.agencefrancepresse.fr
+ news.agencefrancepresse.fr
+ ns2.agencefrance-presse.com
+ news.agencefrance-presse.com
+ ns2.agencefrance-presse.fr
+ news.agencefrance-presse.fr
+ ns2.imageforum.com
+ news.imageforum.com
+ ns2.imageforum.tm.fr
+ news.imageforum.tm.fr
+ ns2.ooh-lah-lah.com
+ ns2.afpsciences.com
+ ns2.afpdoc.com
+ ns2.afp-notes.com
+ ns2.afp-domino.com
+4.204.50.158.in-addr.arpa flags 0 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type NS(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type SOA(822): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=$; ttl=77948
+4.204.50.158.in-addr.arpa flags 0 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+rc=0
diff --git a/adns-0.6/regress/case-norecurse.sys b/adns-0.6/regress/case-norecurse.sys
new file mode 100644
index 0000000..3f3adf6
--- /dev/null
+++ b/adns-0.6/regress/case-norecurse.sys
@@ -0,0 +1,633 @@
+default -0x16
+4.204.50.158.in-addr.arpa
+ start 939764098.821612
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000163
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000053
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000041
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.001437
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 010001.
+ +0.000286
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000152
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.000904
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 020001.
+ +0.000247
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000144
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 050001.
+ sendto=43
+ +0.001157
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000093
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.000957
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 060001.
+ +0.000249
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000113
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.001196
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238380 00010012 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000130 7c000d03 6e733203 61667003
+ 636f6d00 c00c000c 00010001 307c0005 026e73c0 3bc00c00 0c000100 01307c00
+ 07046e65 7773c03b c00c000c 00010001 307c000c 036e7332 03616670 02667200
+ c00c000c 00010001 307c0005 026e73c0 78c00c00 0c000100 01307c00 07046e65
+ 7773c078 c00c000c 00010001 307c0019 036e7332 12616765 6e636566 72616e63
+ 65707265 737365c0 3fc00c00 0c000100 01307c00 07046e65 7773c0b4 c00c000c
+ 00010001 307c0019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+ 7cc00c00 0c000100 01307c00 07046e65 7773c0ec c00c000c 00010001 307c001a
+ 036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+ 0001307c 0007046e 657773c1 24c00c00 0c000100 01307c00 1a036e73 32136167
+ 656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000130 7c000704
+ 6e657773 c15dc00c 000c0001 0001307c 0011036e 73320a69 6d616765 666f7275
+ 6dc03fc0 0c000c00 01000130 7c000704 6e657773 c196c00c 000c0001 0001307c
+ 0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 0001307c
+ 0007046e 657773c1 c6.
+ +0.002263
+ socket type=SOCK_STREAM
+ socket=5
+ +0.000942
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000045
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000041
+ connect fd=5 addr=172.18.45.6:53
+ connect=EINPROGRESS
+ +0.000500
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000083
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0d0001.
+ sendto=43
+ +0.000925
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0d0001.
+ +0.000256
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000123
+ write fd=5
+ 002b3123 01000001 00000000 00000134 03323034 02353003 31353807 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.001681
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.001010
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0f0001.
+ +0.000266
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000117
+ read fd=5 buflen=2
+ read=OK
+ 02ac.
+ +0.000175
+ read fd=5 buflen=684
+ read=OK
+ 31238180 00010017 00010001 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000130 7c000d03 6e733203 61667003
+ 636f6d00 c00c000c 00010001 307c0005 026e73c0 3bc00c00 0c000100 01307c00
+ 07046e65 7773c03b c00c000c 00010001 307c000c 036e7332 03616670 02667200
+ c00c000c 00010001 307c0005 026e73c0 78c00c00 0c000100 01307c00 07046e65
+ 7773c078 c00c000c 00010001 307c0019 036e7332 12616765 6e636566 72616e63
+ 65707265 737365c0 3fc00c00 0c000100 01307c00 07046e65 7773c0b4 c00c000c
+ 00010001 307c0019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+ 7cc00c00 0c000100 01307c00 07046e65 7773c0ec c00c000c 00010001 307c001a
+ 036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+ 0001307c 0007046e 657773c1 24c00c00 0c000100 01307c00 1a036e73 32136167
+ 656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000130 7c000704
+ 6e657773 c15dc00c 000c0001 0001307c 0011036e 73320a69 6d616765 666f7275
+ 6dc03fc0 0c000c00 01000130 7c000704 6e657773 c196c00c 000c0001 0001307c
+ 0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 0001307c
+ 0007046e 657773c1 c6c00c00 0c000100 01307c00 12036e73 320b6f6f 682d6c61
+ 682d6c61 68c03fc0 0c000c00 01000130 7c001203 6e73320b 61667073 6369656e
+ 636573c0 3fc00c00 0c000100 01307c00 0d036e73 32066166 70646f63 c03fc00c
+ 000c0001 0001307c 0010036e 73320961 66702d6e 6f746573 c03fc00c 000c0001
+ 0001307c 0011036e 73320a61 66702d64 6f6d696e 6fc03f03 32303402 35300331
+ 35380769 6e2d6164 64720461 72706100 00020001 0001307c 0002c037 c0370001
+ 00010002 80980004 9e32cc04.
+ +0.002445
+ read fd=5 buflen=686
+ read=EAGAIN
+ +0.003282
+ close fd=5
+ close=OK
+ +0.000529
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 100001.
+ sendto=43
+ +0.000940
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 100001.
+ +0.000256
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.000928
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ +0.000259
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000113
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.000917
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 010001.
+ +0.000259
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000125
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.000899
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 020001.
+ +0.000262
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000124
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.001190
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8380 00010012 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000130 7c000d03 6e733203 61667003
+ 636f6d00 c00c000c 00010001 307c0005 026e73c0 3bc00c00 0c000100 01307c00
+ 07046e65 7773c03b c00c000c 00010001 307c000c 036e7332 03616670 02667200
+ c00c000c 00010001 307c0005 026e73c0 78c00c00 0c000100 01307c00 07046e65
+ 7773c078 c00c000c 00010001 307c0019 036e7332 12616765 6e636566 72616e63
+ 65707265 737365c0 3fc00c00 0c000100 01307c00 07046e65 7773c0b4 c00c000c
+ 00010001 307c0019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+ 7cc00c00 0c000100 01307c00 07046e65 7773c0ec c00c000c 00010001 307c001a
+ 036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+ 0001307c 0007046e 657773c1 24c00c00 0c000100 01307c00 1a036e73 32136167
+ 656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000130 7c000704
+ 6e657773 c15dc00c 000c0001 0001307c 0011036e 73320a69 6d616765 666f7275
+ 6dc03fc0 0c000c00 01000130 7c000704 6e657773 c196c00c 000c0001 0001307c
+ 0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 0001307c
+ 0007046e 657773c1 c6.
+ +0.001723
+ socket type=SOCK_STREAM
+ socket=5
+ +0.000993
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000044
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000039
+ connect fd=5 addr=172.18.45.6:53
+ connect=EINPROGRESS
+ +0.000436
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000079
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.000907
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0f0001.
+ +0.000264
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000118
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000068
+ write fd=5
+ 002b312a 01000001 00000000 00000134 03323034 02353003 31353807 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.001361
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.000875
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 060001.
+ +0.000265
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000115
+ read fd=5 buflen=686
+ read=OK
+ 02ac312a 81800001 00170001 00010134 03323034 02353003 31353807 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 01307c00 0d036e73 32036166
+ 7003636f 6d00c00c 000c0001 0001307c 0005026e 73c03bc0 0c000c00 01000130
+ 7c000704 6e657773 c03bc00c 000c0001 0001307c 000c036e 73320361 66700266
+ 7200c00c 000c0001 0001307c 0005026e 73c078c0 0c000c00 01000130 7c000704
+ 6e657773 c078c00c 000c0001 0001307c 0019036e 73321261 67656e63 65667261
+ 6e636570 72657373 65c03fc0 0c000c00 01000130 7c000704 6e657773 c0b4c00c
+ 000c0001 0001307c 0019036e 73321261 67656e63 65667261 6e636570 72657373
+ 65c07cc0 0c000c00 01000130 7c000704 6e657773 c0ecc00c 000c0001 0001307c
+ 001a036e 73321361 67656e63 65667261 6e63652d 70726573 7365c03f c00c000c
+ 00010001 307c0007 046e6577 73c124c0 0c000c00 01000130 7c001a03 6e733213
+ 6167656e 63656672 616e6365 2d707265 737365c0 7cc00c00 0c000100 01307c00
+ 07046e65 7773c15d c00c000c 00010001 307c0011 036e7332 0a696d61 6765666f
+ 72756dc0 3fc00c00 0c000100 01307c00 07046e65 7773c196 c00c000c 00010001
+ 307c0014 036e7332 0a696d61 6765666f 72756d02 746dc07c c00c000c 00010001
+ 307c0007 046e6577 73c1c6c0 0c000c00 01000130 7c001203 6e73320b 6f6f682d
+ 6c61682d 6c6168c0 3fc00c00 0c000100 01307c00 12036e73 320b6166 70736369
+ 656e6365 73c03fc0 0c000c00 01000130 7c000d03 6e733206 61667064 6f63c03f
+ c00c000c 00010001 307c0010 036e7332 09616670 2d6e6f74 6573c03f c00c000c
+ 00010001 307c0011 036e7332 0a616670 2d646f6d 696e6fc0 3f033230 34023530
+ 03313538 07696e2d 61646472 04617270 61000002 00010001 307c0002 c037c037
+ 00010001 00028098 00049e32 cc04.
+ +0.002314
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 036e7332 03616670 03636f6d 00000100 01.
+ sendto=29
+ +0.001132
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 026e7303 61667003 636f6d00 00010001.
+ sendto=28
+ +0.000872
+ sendto fd=4 addr=172.18.45.6:53
+ 312f0100 00010000 00000000 046e6577 73036166 7003636f 6d000001 0001.
+ sendto=30
+ +0.000864
+ sendto fd=4 addr=172.18.45.6:53
+ 31300100 00010000 00000000 036e7332 03616670 02667200 00010001.
+ sendto=28
+ +0.000857
+ sendto fd=4 addr=172.18.45.6:53
+ 31310100 00010000 00000000 026e7303 61667002 66720000 010001.
+ sendto=27
+ +0.001077
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 046e6577 73036166 70026672 00000100 01.
+ sendto=29
+ +0.001081
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+ 73736503 636f6d00 00010001.
+ sendto=44
+ +0.001138
+ sendto fd=4 addr=172.18.45.6:53
+ 31340100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.001216
+ sendto fd=4 addr=172.18.45.6:53
+ 31350100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+ 73736502 66720000 010001.
+ sendto=43
+ +0.001134
+ sendto fd=4 addr=172.18.45.6:53
+ 31360100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 02667200 00010001.
+ sendto=44
+ +0.001163
+ sendto fd=4 addr=172.18.45.6:53
+ 31370100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.001153
+ sendto fd=4 addr=172.18.45.6:53
+ 31380100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 6503636f 6d000001 0001.
+ sendto=46
+ +0.001167
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 02667200 00010001.
+ sendto=44
+ +0.001170
+ sendto fd=4 addr=172.18.45.6:53
+ 313a0100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 65026672 00000100 01.
+ sendto=45
+ +0.001174
+ sendto fd=4 addr=172.18.45.6:53
+ 313b0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d03 636f6d00
+ 00010001.
+ sendto=36
+ +0.001119
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.001141
+ sendto fd=4 addr=172.18.45.6:53
+ 313d0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d02 746d0266
+ 72000001 0001.
+ sendto=38
+ +0.001115
+ sendto fd=4 addr=172.18.45.6:53
+ 313e0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 02746d02
+ 66720000 010001.
+ sendto=39
+ +0.001383
+ sendto fd=4 addr=172.18.45.6:53
+ 313f0100 00010000 00000000 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.001190
+ sendto fd=4 addr=172.18.45.6:53
+ 31400100 00010000 00000000 036e7332 0b616670 73636965 6e636573 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.001178
+ sendto fd=4 addr=172.18.45.6:53
+ 31410100 00010000 00000000 036e7332 06616670 646f6303 636f6d00 00010001.
+ sendto=32
+ +0.001112
+ sendto fd=4 addr=172.18.45.6:53
+ 31420100 00010000 00000000 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+ 010001.
+ sendto=35
+ +0.001167
+ sendto fd=4 addr=172.18.45.6:53
+ 31430100 00010000 00000000 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+ 00010001.
+ sendto=36
+ +0.001187
+ read fd=5 buflen=686
+ read=EAGAIN
+ +0.000096
+ close fd=5
+ close=OK
+ +0.000598
+ sendto fd=4 addr=172.18.45.6:53
+ 31440100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.001333
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8180 00010001 00020002 036e7332 03616670 03636f6d 00000100 01c00c00
+ 01000100 02809800 049e32cc 04034146 5003636f 6d000002 00010001 4d720002
+ c00cc02d 00020001 00014d72 0006036e 7331c02d c00c0001 00010002 80980004
+ 9e32cc04 c04e0001 00010002 80980004 d0dfa603.
+ +0.000734
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312e8180 00010001 00020002 026e7303 61667003 636f6d00 00010001 c00c0001
+ 00010001 4d720004 9e32cc04 03414650 03636f6d 00000200 0100014d 72000603
+ 6e7332c0 2cc02c00 02000100 014d7200 06036e73 31c02cc0 3f000100 01000280
+ 9800049e 32cc04c0 51000100 01000280 980004d0 dfa603.
+ +0.000768
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312f8180 00010001 00020002 046e6577 73036166 7003636f 6d000001 0001c00c
+ 00010001 00013089 00049e32 cc040341 46500363 6f6d0000 02000100 014d7200
+ 06036e73 32c02ec0 2e000200 0100014d 72000603 6e7331c0 2ec04100 01000100
+ 02809800 049e32cc 04c05300 01000100 02809800 04d0dfa6 03.
+ +0.000623
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31308180 00010001 00020002 036e7332 03616670 02667200 00010001 c00c0001
+ 00010001 30850004 9e32cc04 03616670 02667200 00020001 00013085 0002c00c
+ c02c0002 00010001 30850006 036e7331 c02cc00c 00010001 00013085 00049e32
+ cc04c04c 00010001 00013085 0004d0df a603.
+ +0.000602
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31318180 00010001 00020002 026e7303 61667002 66720000 010001c0 0c000100
+ 01000130 8500049e 32cc0403 61667002 66720000 02000100 01308500 06036e73
+ 32c02bc0 2b000200 01000130 85000603 6e7331c0 2bc03d00 01000100 01308500
+ 049e32cc 04c04f00 01000100 01308500 04d0dfa6 03.
+ +0.000624
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31328180 00010001 00020002 046e6577 73036166 70026672 00000100 01c00c00
+ 01000100 012f4700 049e32cc 04036166 70026672 00000200 01000130 85000603
+ 6e7332c0 2dc02d00 02000100 01308500 06036e73 31c02dc0 3f000100 01000130
+ 8500049e 32cc04c0 51000100 01000130 850004d0 dfa603.
+ +0.000643
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31338180 00010001 00020002 036e7332 12616765 6e636566 72616e63 65707265
+ 73736503 636f6d00 00010001 c00c0001 00010001 30850004 9e32cc04 12616765
+ 6e636566 72616e63 65707265 73736503 636f6d00 00020001 00013085 0002c00c
+ c03c0002 00010001 30850006 036e7331 c03cc00c 00010001 00013085 00049e32
+ cc04c06c 00010001 00013085 0004d0df a603.
+ +0.000703
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31348180 00010001 00020002 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 03636f6d 00000100 01c00c00 01000100 01308500 049e32cc 04126167
+ 656e6365 6672616e 63657072 65737365 03636f6d 00000200 01000130 85000603
+ 6e7332c0 3dc03d00 02000100 01308500 06036e73 31c03dc0 5f000100 01000130
+ 8500049e 32cc04c0 71000100 01000130 850004d0 dfa603.
+ +0.000750
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31358180 00010001 00020002 036e7332 12616765 6e636566 72616e63 65707265
+ 73736502 66720000 010001c0 0c000100 01000130 8900049e 32cc0412 6167656e
+ 63656672 616e6365 70726573 73650266 72000002 00010001 30890002 c00cc03b
+ 00020001 00013089 0006036e 7331c03b c00c0001 00010001 30890004 9e32cc04
+ c06a0001 00010001 30890004 d0dfa603.
+ +0.000708
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31368180 00010001 00020002 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 02667200 00010001 c00c0001 00010001 30890004 9e32cc04 12616765
+ 6e636566 72616e63 65707265 73736502 66720000 02000100 01308900 06036e73
+ 32c03cc0 3c000200 01000130 89000603 6e7331c0 3cc05d00 01000100 01308900
+ 049e32cc 04c06f00 01000100 01308900 04d0dfa6 03.
+ +0.000739
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31378180 00010001 00020002 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 03636f6d 00000100 01c00c00 01000100 014dd900 049e32cc 04136167
+ 656e6365 6672616e 63652d70 72657373 6503636f 6d000002 00010001 4dd90002
+ c00cc03d 00020001 00014dd9 0006036e 7331c03d c00c0001 00010001 4dd90004
+ 9e32cc04 c06e0001 00010001 4dd90004 d0dfa603.
+ +0.000723
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31388180 00010001 00020002 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 6503636f 6d000001 0001c00c 00010001 00014dd9 00049e32 cc041361
+ 67656e63 65667261 6e63652d 70726573 73650363 6f6d0000 02000100 014dd900
+ 06036e73 32c03ec0 3e000200 0100014d d9000603 6e7331c0 3ec06100 01000100
+ 014dd900 049e32cc 04c07300 01000100 014dd900 04d0dfa6 03.
+ +0.000757
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31398180 00010001 00020002 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 02667200 00010001 c00c0001 00010001 30890004 9e32cc04 13616765
+ 6e636566 72616e63 652d7072 65737365 02667200 00020001 00013089 0002c00c
+ c03c0002 00010001 30890006 036e7331 c03cc00c 00010001 00013089 00049e32
+ cc04c06c 00010001 00013089 0004d0df a603.
+ +0.000721
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313a8180 00010001 00020002 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 65026672 00000100 01c00c00 01000100 01308900 049e32cc 04136167
+ 656e6365 6672616e 63652d70 72657373 65026672 00000200 01000130 89000603
+ 6e7332c0 3dc03d00 02000100 01308900 06036e73 31c03dc0 5f000100 01000130
+ 8900049e 32cc04c0 71000100 01000130 890004d0 dfa603.
+ +0.000732
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313b8180 00010001 00020002 036e7332 0a696d61 6765666f 72756d03 636f6d00
+ 00010001 c00c0001 00010001 30890004 9e32cc04 0a696d61 6765666f 72756d03
+ 636f6d00 00020001 00013089 0002c00c c0340002 00010001 30890006 036e7331
+ c034c00c 00010001 00013089 00049e32 cc04c05c 00010001 00013089 0004d0df
+ a603.
+ +0.000677
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313c8180 00010001 00020002 046e6577 730a696d 61676566 6f72756d 03636f6d
+ 00000100 01c00c00 01000100 01308900 049e32cc 040a696d 61676566 6f72756d
+ 03636f6d 00000200 01000130 89000603 6e7332c0 35c03500 02000100 01308900
+ 06036e73 31c035c0 4f000100 01000130 8900049e 32cc04c0 61000100 01000130
+ 890004d0 dfa603.
+ +0.000673
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313d8180 00010001 00020002 036e7332 0a696d61 6765666f 72756d02 746d0266
+ 72000001 0001c00c 00010001 000280c4 00049e32 cc040a69 6d616765 666f7275
+ 6d02746d 02667200 00020001 000280c4 0002c00c c0360002 00010002 80c40006
+ 036e7331 c036c00c 00010001 000280c4 00049e32 cc04c060 00010001 000280c4
+ 0004d0df a603.
+ +0.000687
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313e8180 00010001 00020002 046e6577 730a696d 61676566 6f72756d 02746d02
+ 66720000 010001c0 0c000100 0100012f 4500049e 32cc040a 696d6167 65666f72
+ 756d0274 6d026672 00000200 01000280 c4000603 6e7332c0 37c03700 02000100
+ 0280c400 06036e73 31c037c0 53000100 01000280 c400049e 32cc04c0 65000100
+ 01000280 c40004d0 dfa603.
+ +0.000685
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313f8180 00010001 00020002 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+ 00000100 01c00c00 01000100 014dd900 049e32cc 040b6f6f 682d6c61 682d6c61
+ 6803636f 6d000002 00010001 4dd90002 c00cc035 00020001 00014dd9 0006036e
+ 7331c035 c00c0001 00010001 4dd90004 9e32cc04 c05e0001 00010001 4dd90004
+ d0dfa603.
+ +0.000664
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31408180 00010000 00010000 036e7332 0b616670 73636965 6e636573 03636f6d
+ 00000100 010b6166 70736369 656e6365 7303636f 6d000006 00010000 0148002c
+ 03646e73 08766963 746f6972 65026672 0004726f 6f74c044 77276589 00007080
+ 00001c20 004f1a00 00015180.
+ +0.000607
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31418180 00010000 00010000 036e7332 06616670 646f6303 636f6d00 00010001
+ 06616670 646f6303 636f6d00 00060001 00000148 002c0364 6e730876 6963746f
+ 69726502 66720004 726f6f74 c03a7727 65890000 70800000 1c20004f 1a000001
+ 5180.
+ +0.001536
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31428180 00010001 00020002 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+ 010001c0 0c000100 01000130 8900049e 32cc0409 6166702d 6e6f7465 7303636f
+ 6d000002 00010001 30890002 c00cc033 00020001 00013089 0006036e 7331c033
+ c00c0001 00010001 30890004 9e32cc04 c05a0001 00010001 30890004 d0dfa603.
+ +0.000601
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31438180 00010001 00020002 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+ 00010001 c00c0001 00010001 30890004 9e32cc04 0a616670 2d646f6d 696e6f03
+ 636f6d00 00020001 00013089 0002c00c c0340002 00010001 30890006 036e7331
+ c034c00c 00010001 00013089 00049e32 cc04c05c 00010001 00013089 0004d0df
+ a603.
+ +0.000629
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31448180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ +0.000317
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.920611
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-754319
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 050001.
+ +0.000252
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000127
+ close fd=4
+ close=OK
+ +0.000208
diff --git a/adns-0.6/regress/case-norecurse2.err b/adns-0.6/regress/case-norecurse2.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-norecurse2.err
diff --git a/adns-0.6/regress/case-norecurse2.out b/adns-0.6/regress/case-norecurse2.out
new file mode 100644
index 0000000..b00974a
--- /dev/null
+++ b/adns-0.6/regress/case-norecurse2.out
@@ -0,0 +1,60 @@
+adns debug: using nameserver 172.18.45.6
+4.204.50.158.in-addr.arpa flags 0 type 1 A(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 2 NS(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 5 CNAME(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 6 SOA(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 12 PTR(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 13 HINFO(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 15 MX(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 16 TXT(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 17 RP(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65537 A(addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65538 NS(+addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65548 PTR(checked) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65551 MX(+addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 131078 SOA(822) submitted
+4.204.50.158.in-addr.arpa flags 0 type 131089 RP(822) submitted
+4.204.50.158.in-addr.arpa flags 0 type SOA(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type NS(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type NS(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type SOA(822): No such data; nrrs=0; cname=$; owner=$; ttl=0
+adns debug: reply not found, id 312c, query owner 4.204.50.158.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 311f, query owner 4.204.50.158.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3120, query owner 4.204.50.158.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 312a, query owner 4.204.50.158.in-addr.arpa (NS=172.18.45.6)
+4.204.50.158.in-addr.arpa flags 0 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+adns debug: TCP connected (NS=172.18.45.6)
+4.204.50.158.in-addr.arpa flags 0 type PTR(raw): OK; nrrs=23; cname=$; owner=$; ttl=0
+ ns2.afp.com
+ ns.afp.com
+ news.afp.com
+ ns2.afp.fr
+ ns.afp.fr
+ news.afp.fr
+ ns2.agencefrancepresse.com
+ news.agencefrancepresse.com
+ ns2.agencefrancepresse.fr
+ news.agencefrancepresse.fr
+ ns2.agencefrance-presse.com
+ news.agencefrance-presse.com
+ ns2.agencefrance-presse.fr
+ news.agencefrance-presse.fr
+ ns2.imageforum.com
+ news.imageforum.com
+ ns2.imageforum.tm.fr
+ news.imageforum.tm.fr
+ ns2.ooh-lah-lah.com
+ ns2.afpsciences.com
+ ns2.afpdoc.com
+ ns2.afp-notes.com
+ ns2.afp-domino.com
+4.204.50.158.in-addr.arpa flags 0 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=$; ttl=-6
+rc=0
diff --git a/adns-0.6/regress/case-norecurse2.sys b/adns-0.6/regress/case-norecurse2.sys
new file mode 100644
index 0000000..388543f
--- /dev/null
+++ b/adns-0.6/regress/case-norecurse2.sys
@@ -0,0 +1,1212 @@
+default -0x16
+4.204.50.158.in-addr.arpa
+ start 939764277.018636
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000162
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000052
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000042
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.001984
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000131
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.001195
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000092
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 050001.
+ sendto=43
+ +0.001175
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000096
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.001216
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000098
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.001153
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000095
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0d0001.
+ sendto=43
+ +0.001170
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000103
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.001162
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000099
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 100001.
+ sendto=43
+ +0.001193
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000104
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.001203
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000105
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.001379
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000105
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.001199
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000107
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.001196
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000111
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0f0001.
+ sendto=43
+ +0.001229
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000114
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.001187
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000115
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.001165
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.979603
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.005569
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 060001.
+ +0.000287
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000173
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.973574
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.149373
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0d0001.
+ +0.000294
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000119
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.823788
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019622
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0f0001.
+ +0.000268
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.803782
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019566
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 100001.
+ +0.000266
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.783834
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019476
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0f0001.
+ +0.000261
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000120
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.763977
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.189710
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 010001.
+ +0.000268
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000119
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.573880
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019648
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 020001.
+ +0.000260
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000119
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.553853
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019563
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ +0.000257
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000119
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.533914
+ select=0 rfds=[] wfds=[] efds=[]
+ +1.-463554
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 010001.
+ sendto=43
+ +0.000546
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 020001.
+ sendto=43
+ +0.000484
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 050001.
+ sendto=43
+ +0.000485
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.002425
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000119
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 010001.
+ +0.000255
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 020001.
+ +0.000284
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000100
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.001182
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.007693
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000479
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.000465
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.001722
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009054
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000480
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 060001.
+ sendto=43
+ +0.000488
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.980098
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000131
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 060001.
+ +0.000231
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000119
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.979617
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-21402
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.001019
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009951
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 050001.
+ sendto=43
+ +0.000505
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000530
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.000468
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009497
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008500
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000459
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.989538
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-10446
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 050001.
+ sendto=43
+ +0.000537
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000485
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.000487
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009450
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008478
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000000
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.000106
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000456
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.989451
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-10542
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 050001.
+ sendto=43
+ +0.000612
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000552
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.000564
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009474
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008252
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000106
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009994
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000467
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.979559
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.372703
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 060001.
+ +0.000261
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000225
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.606370
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039270
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 010001.
+ +0.000255
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000224
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.566621
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.149484
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 020001.
+ +0.000261
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000200
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.416676
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-583334
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000010
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010045
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 050001.
+ sendto=43
+ +0.000504
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000456
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ sendto=43
+ +0.000499
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.008480
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008495
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001.
+ sendto=43
+ +0.000644
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.989402
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.490712
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 110001.
+ +0.001892
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238380 00010012 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000000 00000d03 6e733203 61667003
+ 636f6d00 c00c000c 00010000 00000005 026e73c0 3bc00c00 0c000100 00000000
+ 07046e65 7773c03b c00c000c 00010000 0000000c 036e7332 03616670 02667200
+ c00c000c 00010000 00000005 026e73c0 78c00c00 0c000100 00000000 07046e65
+ 7773c078 c00c000c 00010000 00000019 036e7332 12616765 6e636566 72616e63
+ 65707265 737365c0 3fc00c00 0c000100 00000000 07046e65 7773c0b4 c00c000c
+ 00010000 00000019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+ 7cc00c00 0c000100 00000000 07046e65 7773c0ec c00c000c 00010000 0000001a
+ 036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+ 00000000 0007046e 657773c1 24c00c00 0c000100 00000000 1a036e73 32136167
+ 656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000000 00000704
+ 6e657773 c15dc00c 000c0001 00000000 0011036e 73320a69 6d616765 666f7275
+ 6dc03fc0 0c000c00 01000000 00000704 6e657773 c196c00c 000c0001 00000000
+ 0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 00000000
+ 0007046e 657773c1 c6.
+ +0.003281
+ socket type=SOCK_STREAM
+ socket=5
+ +0.002885
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000045
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000039
+ connect fd=5 addr=172.18.45.6:53
+ connect=EINPROGRESS
+ +0.000565
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 050001.
+ +0.000249
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8380 00010012 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000000 00000d03 6e733203 61667003
+ 636f6d00 c00c000c 00010000 00000005 026e73c0 3bc00c00 0c000100 00000000
+ 07046e65 7773c03b c00c000c 00010000 0000000c 036e7332 03616670 02667200
+ c00c000c 00010000 00000005 026e73c0 78c00c00 0c000100 00000000 07046e65
+ 7773c078 c00c000c 00010000 00000019 036e7332 12616765 6e636566 72616e63
+ 65707265 737365c0 3fc00c00 0c000100 00000000 07046e65 7773c0b4 c00c000c
+ 00010000 00000019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+ 7cc00c00 0c000100 00000000 07046e65 7773c0ec c00c000c 00010000 0000001a
+ 036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+ 00000000 0007046e 657773c1 24c00c00 0c000100 00000000 1a036e73 32136167
+ 656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000000 00000704
+ 6e657773 c15dc00c 000c0001 00000000 0011036e 73320a69 6d616765 666f7275
+ 6dc03fc0 0c000c00 01000000 00000704 6e657773 c196c00c 000c0001 00000000
+ 0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 00000000
+ 0007046e 657773c1 c6.
+ +0.001704
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8380 00010012 00000000 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000000 00000d03 6e733203 61667003
+ 636f6d00 c00c000c 00010000 00000005 026e73c0 3bc00c00 0c000100 00000000
+ 07046e65 7773c03b c00c000c 00010000 0000000c 036e7332 03616670 02667200
+ c00c000c 00010000 00000005 026e73c0 78c00c00 0c000100 00000000 07046e65
+ 7773c078 c00c000c 00010000 00000019 036e7332 12616765 6e636566 72616e63
+ 65707265 737365c0 3fc00c00 0c000100 00000000 07046e65 7773c0b4 c00c000c
+ 00010000 00000019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+ 7cc00c00 0c000100 00000000 07046e65 7773c0ec c00c000c 00010000 0000001a
+ 036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+ 00000000 0007046e 657773c1 24c00c00 0c000100 00000000 1a036e73 32136167
+ 656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000000 00000704
+ 6e657773 c15dc00c 000c0001 00000000 0011036e 73320a69 6d616765 666f7275
+ 6dc03fc0 0c000c00 01000000 00000704 6e657773 c196c00c 000c0001 00000000
+ 0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 00000000
+ 0007046e 657773c1 c6.
+ +0.001827
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000201
+ select max=6 rfds=[4] wfds=[5] efds=[] to=13.987312
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.000364
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000127
+ write fd=5
+ 002b3123 01000001 00000000 00000134 03323034 02353003 31353807 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.001692
+ write fd=5
+ 002b312a 01000001 00000000 00000134 03323034 02353003 31353807 696e2d61
+ 64647204 61727061 00000c00 01.
+ write=45
+ +0.001275
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.983854
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.000150
+ read fd=5 buflen=2
+ read=OK
+ 02e1.
+ +0.000196
+ read fd=5 buflen=737
+ read=OK
+ 31238180 00010017 00020002 01340332 30340235 30033135 3807696e 2d616464
+ 72046172 70610000 0c0001c0 0c000c00 01000000 00000d03 6e733203 61667003
+ 636f6d00 c00c000c 00010000 00000005 026e73c0 3bc00c00 0c000100 00000000
+ 07046e65 7773c03b c00c000c 00010000 0000000c 036e7332 03616670 02667200
+ c00c000c 00010000 00000005 026e73c0 78c00c00 0c000100 00000000 07046e65
+ 7773c078 c00c000c 00010000 00000019 036e7332 12616765 6e636566 72616e63
+ 65707265 737365c0 3fc00c00 0c000100 00000000 07046e65 7773c0b4 c00c000c
+ 00010000 00000019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+ 7cc00c00 0c000100 00000000 07046e65 7773c0ec c00c000c 00010000 0000001a
+ 036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+ 00000000 0007046e 657773c1 24c00c00 0c000100 00000000 1a036e73 32136167
+ 656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000000 00000704
+ 6e657773 c15dc00c 000c0001 00000000 0011036e 73320a69 6d616765 666f7275
+ 6dc03fc0 0c000c00 01000000 00000704 6e657773 c196c00c 000c0001 00000000
+ 0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 00000000
+ 0007046e 657773c1 c6c00c00 0c000100 00000000 12036e73 320b6f6f 682d6c61
+ 682d6c61 68c03fc0 0c000c00 01000000 00001203 6e73320b 61667073 6369656e
+ 636573c0 3fc00c00 0c000100 00000000 0d036e73 32066166 70646f63 c03fc00c
+ 000c0001 00000000 0010036e 73320961 66702d6e 6f746573 c03fc00c 000c0001
+ 00000000 0011036e 73320a61 66702d64 6f6d696e 6fc03f02 35300331 35380769
+ 6e2d6164 64720461 72706100 00020001 0007e8fe 0002c037 02353003 31353807
+ 696e2d61 64647204 61727061 00000200 010007e8 fe000603 4e5331c0 3bc03700
+ 01000100 02a2fe00 049e32cc 04034e53 31c03b00 01000100 02a2fe00 04d0dfa6
+ 03.
+ +0.002595
+ read fd=5 buflen=739
+ read=OK
+ 02e1312a 81800001 00170002 00020134 03323034 02353003 31353807 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 00000000 0d036e73 32036166
+ 7003636f 6d00c00c 000c0001 00000000 0005026e 73c03bc0 0c000c00 01000000
+ 00000704 6e657773 c03bc00c 000c0001 00000000 000c036e 73320361 66700266
+ 7200c00c 000c0001 00000000 0005026e 73c078c0 0c000c00 01000000 00000704
+ 6e657773 c078c00c 000c0001 00000000 0019036e 73321261 67656e63 65667261
+ 6e636570 72657373 65c03fc0 0c000c00 01000000 00000704 6e657773 c0b4c00c
+ 000c0001 00000000 0019036e 73321261 67656e63 65667261 6e636570 72657373
+ 65c07cc0 0c000c00 01000000 00000704 6e657773 c0ecc00c 000c0001 00000000
+ 001a036e 73321361 67656e63 65667261 6e63652d 70726573 7365c03f c00c000c
+ 00010000 00000007 046e6577 73c124c0 0c000c00 01000000 00001a03 6e733213
+ 6167656e 63656672 616e6365 2d707265 737365c0 7cc00c00 0c000100 00000000
+ 07046e65 7773c15d c00c000c 00010000 00000011 036e7332 0a696d61 6765666f
+ 72756dc0 3fc00c00 0c000100 00000000 07046e65 7773c196 c00c000c 00010000
+ 00000014 036e7332 0a696d61 6765666f 72756d02 746dc07c c00c000c 00010000
+ 00000007 046e6577 73c1c6c0 0c000c00 01000000 00001203 6e73320b 6f6f682d
+ 6c61682d 6c6168c0 3fc00c00 0c000100 00000000 12036e73 320b6166 70736369
+ 656e6365 73c03fc0 0c000c00 01000000 00000d03 6e733206 61667064 6f63c03f
+ c00c000c 00010000 00000010 036e7332 09616670 2d6e6f74 6573c03f c00c000c
+ 00010000 00000011 036e7332 0a616670 2d646f6d 696e6fc0 3f023530 03313538
+ 07696e2d 61646472 04617270 61000002 00010007 e8fe0002 c0370235 30033135
+ 3807696e 2d616464 72046172 70610000 02000100 07e8fe00 06034e53 31c03bc0
+ 37000100 010002a2 fe00049e 32cc0403 4e5331c0 3b000100 010002a2 fe0004d0
+ dfa603.
+ +0.004644
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 036e7332 03616670 03636f6d 00000100 01.
+ sendto=29
+ +0.001410
+ sendto fd=4 addr=172.18.45.6:53
+ 312f0100 00010000 00000000 026e7303 61667003 636f6d00 00010001.
+ sendto=28
+ +0.001075
+ sendto fd=4 addr=172.18.45.6:53
+ 31300100 00010000 00000000 046e6577 73036166 7003636f 6d000001 0001.
+ sendto=30
+ +0.001072
+ sendto fd=4 addr=172.18.45.6:53
+ 31310100 00010000 00000000 036e7332 03616670 02667200 00010001.
+ sendto=28
+ +0.001053
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 026e7303 61667002 66720000 010001.
+ sendto=27
+ +0.001065
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 046e6577 73036166 70026672 00000100 01.
+ sendto=29
+ +0.001063
+ sendto fd=4 addr=172.18.45.6:53
+ 31340100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+ 73736503 636f6d00 00010001.
+ sendto=44
+ +0.001117
+ sendto fd=4 addr=172.18.45.6:53
+ 31350100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.001230
+ sendto fd=4 addr=172.18.45.6:53
+ 31360100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+ 73736502 66720000 010001.
+ sendto=43
+ +0.001352
+ sendto fd=4 addr=172.18.45.6:53
+ 31370100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 02667200 00010001.
+ sendto=44
+ +0.001324
+ sendto fd=4 addr=172.18.45.6:53
+ 31380100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.001336
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 6503636f 6d000001 0001.
+ sendto=46
+ +0.001340
+ sendto fd=4 addr=172.18.45.6:53
+ 313a0100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 02667200 00010001.
+ sendto=44
+ +0.001322
+ sendto fd=4 addr=172.18.45.6:53
+ 313b0100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 65026672 00000100 01.
+ sendto=45
+ +0.001312
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d03 636f6d00
+ 00010001.
+ sendto=36
+ +0.001330
+ sendto fd=4 addr=172.18.45.6:53
+ 313d0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.001298
+ sendto fd=4 addr=172.18.45.6:53
+ 313e0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d02 746d0266
+ 72000001 0001.
+ sendto=38
+ +0.001326
+ sendto fd=4 addr=172.18.45.6:53
+ 313f0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 02746d02
+ 66720000 010001.
+ sendto=39
+ +0.001310
+ sendto fd=4 addr=172.18.45.6:53
+ 31400100 00010000 00000000 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.001326
+ sendto fd=4 addr=172.18.45.6:53
+ 31410100 00010000 00000000 036e7332 0b616670 73636965 6e636573 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.001329
+ sendto fd=4 addr=172.18.45.6:53
+ 31420100 00010000 00000000 036e7332 06616670 646f6303 636f6d00 00010001.
+ sendto=32
+ +0.001283
+ sendto fd=4 addr=172.18.45.6:53
+ 31430100 00010000 00000000 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+ 010001.
+ sendto=35
+ +0.001386
+ sendto fd=4 addr=172.18.45.6:53
+ 31440100 00010000 00000000 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+ 00010001.
+ sendto=36
+ +0.001512
+ read fd=5 buflen=739
+ read=EAGAIN
+ +0.000090
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.963304
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004077
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312e8180 00010001 000d000d 036e7332 03616670 03636f6d 00000100 01c00c00
+ 01000100 02813e00 049e32cc 04000002 00010007 e8df0014 014c0c52 4f4f542d
+ 53455256 45525303 4e455400 00000200 010007e8 df000401 4dc03a00 00020001
+ 0007e8df 00040149 c03a0000 02000100 07e8df00 040145c0 3a000002 00010007
+ e8df0004 0144c03a 00000200 010007e8 df000401 41c03a00 00020001 0007e8df
+ 00040148 c03a0000 02000100 07e8df00 040143c0 3a000002 00010007 e8df0004
+ 0147c03a 00000200 010007e8 df000401 46c03a00 00020001 0007e8df 00040142
+ c03a0000 02000100 07e8df00 04014ac0 3a000002 00010007 e8df0004 014bc03a
+ c0380001 00010009 3a5f0004 c620400c c0570001 00010009 3a5f0004 ca0c1b21
+ c0660001 00010009 3a5f0004 c0249411 c0750001 00010009 3a5f0004 c0cbe60a
+ c0840001 00010009 3a5f0004 80080a5a c0930001 00010009 3a5f0004 c6290004
+ c0a20001 00010009 3a5f0004 803f0235 c0b10001 00010009 3a5f0004 c021040c
+ c0c00001 00010009 3a5f0004 c0702404 c0cf0001 00010009 3a5f0004 c00505f1
+ c0de0001 00010009 3a5f0004 8009006b c0ed0001 00010009 3a5f0004 c629000a
+ c0fc0001 00010009 3a5f0004 c1000e81.
+ +0.001847
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000277
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.957103
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-40545
+ sendto fd=4 addr=172.18.45.6:53
+ 312f0100 00010000 00000000 026e7303 61667003 636f6d00 00010001.
+ sendto=28
+ +0.000601
+ sendto fd=4 addr=172.18.45.6:53
+ 31300100 00010000 00000000 046e6577 73036166 7003636f 6d000001 0001.
+ sendto=30
+ +0.000404
+ sendto fd=4 addr=172.18.45.6:53
+ 31310100 00010000 00000000 036e7332 03616670 02667200 00010001.
+ sendto=28
+ +0.000424
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 026e7303 61667002 66720000 010001.
+ sendto=27
+ +0.000383
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 046e6577 73036166 70026672 00000100 01.
+ sendto=29
+ +0.000389
+ sendto fd=4 addr=172.18.45.6:53
+ 31340100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+ 73736503 636f6d00 00010001.
+ sendto=44
+ +0.000446
+ sendto fd=4 addr=172.18.45.6:53
+ 31350100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.000449
+ sendto fd=4 addr=172.18.45.6:53
+ 31360100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+ 73736502 66720000 010001.
+ sendto=43
+ +0.000440
+ sendto fd=4 addr=172.18.45.6:53
+ 31370100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 02667200 00010001.
+ sendto=44
+ +0.000441
+ sendto fd=4 addr=172.18.45.6:53
+ 31380100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.000474
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 6503636f 6d000001 0001.
+ sendto=46
+ +0.000451
+ sendto fd=4 addr=172.18.45.6:53
+ 313a0100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 02667200 00010001.
+ sendto=44
+ +0.000440
+ sendto fd=4 addr=172.18.45.6:53
+ 313b0100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 65026672 00000100 01.
+ sendto=45
+ +0.000439
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d03 636f6d00
+ 00010001.
+ sendto=36
+ +0.000413
+ sendto fd=4 addr=172.18.45.6:53
+ 313d0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.000416
+ sendto fd=4 addr=172.18.45.6:53
+ 313e0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d02 746d0266
+ 72000001 0001.
+ sendto=38
+ +0.000442
+ sendto fd=4 addr=172.18.45.6:53
+ 313f0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 02746d02
+ 66720000 010001.
+ sendto=39
+ +0.000418
+ sendto fd=4 addr=172.18.45.6:53
+ 31400100 00010000 00000000 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.000412
+ sendto fd=4 addr=172.18.45.6:53
+ 31410100 00010000 00000000 036e7332 0b616670 73636965 6e636573 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.000413
+ sendto fd=4 addr=172.18.45.6:53
+ 31420100 00010000 00000000 036e7332 06616670 646f6303 636f6d00 00010001.
+ sendto=32
+ +0.000394
+ sendto fd=4 addr=172.18.45.6:53
+ 31430100 00010000 00000000 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+ 010001.
+ sendto=35
+ +0.000403
+ sendto fd=4 addr=172.18.45.6:53
+ 31440100 00010000 00000000 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+ 00010001.
+ sendto=36
+ +0.000407
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.990501
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-09491
+ sendto fd=4 addr=172.18.45.6:53
+ 312f0100 00010000 00000000 026e7303 61667003 636f6d00 00010001.
+ sendto=28
+ +0.000642
+ sendto fd=4 addr=172.18.45.6:53
+ 31300100 00010000 00000000 046e6577 73036166 7003636f 6d000001 0001.
+ sendto=30
+ +0.000399
+ sendto fd=4 addr=172.18.45.6:53
+ 31310100 00010000 00000000 036e7332 03616670 02667200 00010001.
+ sendto=28
+ +0.000385
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 026e7303 61667002 66720000 010001.
+ sendto=27
+ +0.000380
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 046e6577 73036166 70026672 00000100 01.
+ sendto=29
+ +0.000388
+ sendto fd=4 addr=172.18.45.6:53
+ 31340100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+ 73736503 636f6d00 00010001.
+ sendto=44
+ +0.000443
+ sendto fd=4 addr=172.18.45.6:53
+ 31350100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.000447
+ sendto fd=4 addr=172.18.45.6:53
+ 31360100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+ 73736502 66720000 010001.
+ sendto=43
+ +0.000456
+ sendto fd=4 addr=172.18.45.6:53
+ 31370100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 02667200 00010001.
+ sendto=44
+ +0.000438
+ sendto fd=4 addr=172.18.45.6:53
+ 31380100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.000445
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 6503636f 6d000001 0001.
+ sendto=46
+ +0.000447
+ sendto fd=4 addr=172.18.45.6:53
+ 313a0100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 02667200 00010001.
+ sendto=44
+ +0.000437
+ sendto fd=4 addr=172.18.45.6:53
+ 313b0100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 65026672 00000100 01.
+ sendto=45
+ +0.000438
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d03 636f6d00
+ 00010001.
+ sendto=36
+ +0.000434
+ sendto fd=4 addr=172.18.45.6:53
+ 313d0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.000416
+ sendto fd=4 addr=172.18.45.6:53
+ 313e0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d02 746d0266
+ 72000001 0001.
+ sendto=38
+ +0.000415
+ sendto fd=4 addr=172.18.45.6:53
+ 313f0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 02746d02
+ 66720000 010001.
+ sendto=39
+ +0.000416
+ sendto fd=4 addr=172.18.45.6:53
+ 31400100 00010000 00000000 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.000412
+ sendto fd=4 addr=172.18.45.6:53
+ 31410100 00010000 00000000 036e7332 0b616670 73636965 6e636573 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.000414
+ sendto fd=4 addr=172.18.45.6:53
+ 31420100 00010000 00000000 036e7332 06616670 646f6303 636f6d00 00010001.
+ sendto=32
+ +0.000392
+ sendto fd=4 addr=172.18.45.6:53
+ 31430100 00010000 00000000 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+ 010001.
+ sendto=35
+ +0.000425
+ sendto fd=4 addr=172.18.45.6:53
+ 31440100 00010000 00000000 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+ 00010001.
+ sendto=36
+ +0.000409
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.990522
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-235306
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312f8580 00010001 00020002 026e7303 61667003 636f6d00 00010001 c00c0001
+ 00010001 51800004 9e32cc04 03616670 03636f6d 00000200 01000151 80000603
+ 6e7332c0 2cc02c00 02000100 01518000 06036e73 31c02cc0 3f000100 01000151
+ 8000049e 32cc04c0 51000100 01000151 800004d0 dfa603.
+ +0.000734
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000269
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.224825
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.179062
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31448580 00010001 00020002 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+ 00010001 c00c0001 00010001 51800004 9e32cc04 0a616670 2d646f6d 696e6f03
+ 636f6d00 00020001 00015180 0002c00c c0340002 00010001 51800006 036e7331
+ c034c00c 00010001 00015180 00049e32 cc04c05c 00010001 00015180 0004d0df
+ a603.
+ +0.000758
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000284
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.044721
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038932
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31438580 00010001 00020002 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+ 010001c0 0c000100 01000151 8000049e 32cc0409 6166702d 6e6f7465 7303636f
+ 6d000002 00010001 51800002 c00cc033 00020001 00015180 0006036e 7331c033
+ c00c0001 00010001 51800004 9e32cc04 c05a0001 00010001 51800004 d0dfa603.
+ +0.000729
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000258
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.004802
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.399140
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313a8180 00010001 00020002 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 02667200 00010001 c00c0001 00010005 46000004 9e32cc04 13616765
+ 6e636566 72616e63 652d7072 65737365 02667200 00020001 00054600 0002c00c
+ c03c0002 00010005 46000006 036e7331 c03cc00c 00010001 00054600 00049e32
+ cc04c06c 00010001 00054600 0004d0df a603.
+ +0.000770
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000288
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.604604
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038862
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313d8580 00010001 00020002 046e6577 730a696d 61676566 6f72756d 03636f6d
+ 00000100 01c00c00 01000100 01518000 049e32cc 040a696d 61676566 6f72756d
+ 03636f6d 00000200 01000151 80000603 6e7332c0 35c03500 02000100 01518000
+ 06036e73 31c035c0 4f000100 01000151 8000049e 32cc04c0 61000100 01000151
+ 800004d0 dfa603.
+ +0.000714
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000248
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.564780
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-870685
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31358580 00010001 00020002 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 03636f6d 00000100 01c00c00 01000100 01518000 049e32cc 04126167
+ 656e6365 6672616e 63657072 65737365 03636f6d 00000200 01000151 80000603
+ 6e7332c0 3dc03d00 02000100 01518000 06036e73 31c03dc0 5f000100 01000151
+ 8000049e 32cc04c0 71000100 01000151 800004d0 dfa603.
+ +0.000749
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000248
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.434468
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038661
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31348580 00010001 00020002 036e7332 12616765 6e636566 72616e63 65707265
+ 73736503 636f6d00 00010001 c00c0001 00010001 51800004 9e32cc04 12616765
+ 6e636566 72616e63 65707265 73736503 636f6d00 00020001 00015180 0002c00c
+ c03c0002 00010001 51800006 036e7331 c03cc00c 00010001 00015180 00049e32
+ cc04c06c 00010001 00015180 0004d0df a603.
+ +0.000722
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000266
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.394819
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.049154
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31368180 00010001 00020002 036e7332 12616765 6e636566 72616e63 65707265
+ 73736502 66720000 010001c0 0c000100 01000546 0000049e 32cc0412 6167656e
+ 63656672 616e6365 70726573 73650266 72000002 00010005 46000002 c00cc03b
+ 00020001 00054600 0006036e 7331c03b c00c0001 00010005 46000004 9e32cc04
+ c06a0001 00010005 46000004 d0dfa603.
+ +0.000707
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000243
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.344715
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039336
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31388580 00010001 00020002 036e7332 13616765 6e636566 72616e63 652d7072
+ 65737365 03636f6d 00000100 01c00c00 01000100 01518000 049e32cc 04136167
+ 656e6365 6672616e 63652d70 72657373 6503636f 6d000002 00010001 51800002
+ c00cc03d 00020001 00015180 0006036e 7331c03d c00c0001 00010001 51800004
+ 9e32cc04 c06e0001 00010001 51800004 d0dfa603.
+ +0.000695
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000267
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.304417
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.078532
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31308580 00010001 00020002 046e6577 73036166 7003636f 6d000001 0001c00c
+ 00010001 00015180 00049e32 cc040361 66700363 6f6d0000 02000100 01518000
+ 06036e73 32c02ec0 2e000200 01000151 80000603 6e7331c0 2ec04100 01000100
+ 01518000 049e32cc 04c05300 01000100 01518000 04d0dfa6 03.
+ +0.000600
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000235
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.225050
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039210
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31318180 00010001 00020002 036e7332 03616670 02667200 00010001 c00c0001
+ 00010005 46000004 9e32cc04 03616670 02667200 00020001 00054600 0002c00c
+ c02c0002 00010005 46000006 036e7331 c02cc00c 00010001 00054600 00049e32
+ cc04c04c 00010001 00054600 0004d0df a603.
+ +0.000589
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000236
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.185015
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.159098
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31378180 00010001 00010001 046e6577 73126167 656e6365 6672616e 63657072
+ 65737365 02667200 00010001 c00c0001 00010000 00000004 9e32cc04 12616765
+ 6e636566 72616e63 65707265 73736502 66720000 02000100 00000000 06036e73
+ 31c03cc0 5d000100 01000000 000004d0 dfa603.
+ +0.000578
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000253
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.025086
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.025066
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.000020
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009997
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 026e7303 61667002 66720000 010001.
+ sendto=27
+ +0.000458
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 046e6577 73036166 70026672 00000100 01.
+ sendto=29
+ +0.000387
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 6503636f 6d000001 0001.
+ sendto=46
+ +0.000441
+ sendto fd=4 addr=172.18.45.6:53
+ 313b0100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+ 72657373 65026672 00000100 01.
+ sendto=45
+ +0.000438
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d03 636f6d00
+ 00010001.
+ sendto=36
+ +0.000561
+ sendto fd=4 addr=172.18.45.6:53
+ 313e0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d02 746d0266
+ 72000001 0001.
+ sendto=38
+ +0.000423
+ sendto fd=4 addr=172.18.45.6:53
+ 313f0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 02746d02
+ 66720000 010001.
+ sendto=39
+ +0.000446
+ sendto fd=4 addr=172.18.45.6:53
+ 31400100 00010000 00000000 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.000418
+ sendto fd=4 addr=172.18.45.6:53
+ 31410100 00010000 00000000 036e7332 0b616670 73636965 6e636573 03636f6d
+ 00000100 01.
+ sendto=37
+ +0.000584
+ sendto fd=4 addr=172.18.45.6:53
+ 31420100 00010000 00000000 036e7332 06616670 646f6303 636f6d00 00010001.
+ sendto=32
+ +0.000560
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.995284
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000226
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313c8180 00010001 00020002 036e7332 0a696d61 6765666f 72756d03 636f6d00
+ 00010001 c00c0001 00010001 409f0004 9e32cc04 0a696d61 6765666f 72756d03
+ 434f4d00 00020001 0001517f 0002c00c c0340002 00010001 517f0006 036e7331
+ c034c00c 00010001 0001409f 00049e32 cc04c05c 00010001 0001517f 0004d0df
+ a603.
+ +0.000582
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000266
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.994210
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.168328
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31328180 00010001 00010001 026e7303 61667002 66720000 010001c0 0c000100
+ 01000000 0000049e 32cc0403 61667002 66720000 02000100 00000000 06036e73
+ 31c02bc0 3d000100 01000000 000004d0 dfa603.
+ +0.000470
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000252
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.825160
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.229075
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31428580 00010000 00010000 036e7332 06616670 646f6303 636f6d00 00010001
+ 06616670 646f6303 636f6d00 00060001 00015180 002c0364 6e730876 6963746f
+ 69726502 66720004 726f6f74 c03a7727 65890000 70800000 1c20004f 1a000001
+ 5180.
+ +0.000492
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.001505
+ close fd=4
+ close=OK
+ +0.000260
+ close fd=5
+ close=OK
+ +0.000401
diff --git a/adns-0.6/regress/case-norecurse3.err b/adns-0.6/regress/case-norecurse3.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-norecurse3.err
diff --git a/adns-0.6/regress/case-norecurse3.out b/adns-0.6/regress/case-norecurse3.out
new file mode 100644
index 0000000..f59ec8b
--- /dev/null
+++ b/adns-0.6/regress/case-norecurse3.out
@@ -0,0 +1,32 @@
+adns debug: using nameserver 172.18.45.6
+2.203.156.195.in-addr.arpa1 flags 0 type 1 A(-) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 2 NS(raw) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 5 CNAME(-) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 6 SOA(raw) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 12 PTR(raw) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 13 HINFO(-) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 15 MX(raw) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 16 TXT(-) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 17 RP(raw) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 65537 A(addr) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 65538 NS(+addr) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 65548 PTR(checked) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 65551 MX(+addr) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 131078 SOA(822) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 131089 RP(822) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type A(-): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type RP(822): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type SOA(822): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type MX(+addr): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type PTR(checked): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type NS(+addr): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type A(addr): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type RP(raw): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type TXT(-): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type MX(raw): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type HINFO(-): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type PTR(raw): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type SOA(raw): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type CNAME(-): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type NS(raw): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+rc=0
diff --git a/adns-0.6/regress/case-norecurse3.sys b/adns-0.6/regress/case-norecurse3.sys
new file mode 100644
index 0000000..f1ff264
--- /dev/null
+++ b/adns-0.6/regress/case-norecurse3.sys
@@ -0,0 +1,504 @@
+default -0x16
+2.203.156.195.in-addr.arpa1
+ start 939764258.086555
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000189
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000054
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000041
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000100 01.
+ sendto=45
+ +0.002044
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000133
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000200 01.
+ sendto=45
+ +0.001173
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000092
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000500 01.
+ sendto=45
+ +0.001197
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000095
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000600 01.
+ sendto=45
+ +0.001228
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000095
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000c00 01.
+ sendto=45
+ +0.001194
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000095
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000d00 01.
+ sendto=45
+ +0.001205
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000099
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000f00 01.
+ sendto=45
+ +0.001196
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000104
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001000 01.
+ sendto=45
+ +0.001186
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000122
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001100 01.
+ sendto=45
+ +0.001225
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000104
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000100 01.
+ sendto=45
+ +0.001179
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000112
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000200 01.
+ sendto=45
+ +0.001344
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000109
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000c00 01.
+ sendto=45
+ +0.001205
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000113
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000f00 01.
+ sendto=45
+ +0.001214
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000118
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000600 01.
+ sendto=45
+ +0.001221
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000120
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001100 01.
+ sendto=45
+ +0.001203
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000129
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.979346
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-26085
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.005431
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009976
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000100 01.
+ sendto=45
+ +0.000545
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000200 01.
+ sendto=45
+ +0.000472
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000500 01.
+ sendto=45
+ +0.000438
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000600 01.
+ sendto=45
+ +0.000483
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000057
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008066
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000c00 01.
+ sendto=45
+ +0.000453
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000d00 01.
+ sendto=45
+ +0.000438
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000f00 01.
+ sendto=45
+ +0.000454
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001000 01.
+ sendto=45
+ +0.000434
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001100 01.
+ sendto=45
+ +0.000433
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000100 01.
+ sendto=45
+ +0.000435
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000200 01.
+ sendto=45
+ +0.000829
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000c00 01.
+ sendto=45
+ +0.000488
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000f00 01.
+ sendto=45
+ +0.000457
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000600 01.
+ sendto=45
+ +0.000430
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.001297
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.005148
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001100 01.
+ sendto=45
+ +0.000447
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.979550
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-20428
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000100 01.
+ sendto=45
+ +0.000564
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000200 01.
+ sendto=45
+ +0.000441
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000500 01.
+ sendto=45
+ +0.000455
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000600 01.
+ sendto=45
+ +0.000483
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.008522
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008039
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000000
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.000145
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000c00 01.
+ sendto=45
+ +0.000448
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000d00 01.
+ sendto=45
+ +0.000434
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000f00 01.
+ sendto=45
+ +0.000431
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001000 01.
+ sendto=45
+ +0.000454
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001100 01.
+ sendto=45
+ +0.000434
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000100 01.
+ sendto=45
+ +0.000434
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000200 01.
+ sendto=45
+ +0.000428
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000268
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.006792
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000c00 01.
+ sendto=45
+ +0.000445
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000f00 01.
+ sendto=45
+ +0.000431
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000600 01.
+ sendto=45
+ +0.000461
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001100 01.
+ sendto=45
+ +0.000432
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.978249
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.291904
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000100 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000689
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000167
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.685489
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038802
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001100 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000514
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000165
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.646008
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.099281
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000600 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000520
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000145
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.546062
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039368
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000f00 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000535
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000134
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.506025
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039372
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000c00 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000507
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000132
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.466014
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039305
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000200 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000538
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000132
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.426039
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039291
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000100 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000502
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000132
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.386114
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039825
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001100 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000500
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000131
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.345658
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039138
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00001000 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000498
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000132
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.305890
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039192
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000f00 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000495
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000130
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.266073
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039369
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000d00 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000494
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000149
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.226061
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039356
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000c00 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000493
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000130
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.186082
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039358
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000600 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000490
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000157
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.146077
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039772
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000500 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000496
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000131
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.105678
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-960894
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+ 64720561 72706131 00000200 01000006 00010001 5180003e 01410c52 4f4f542d
+ 53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+ c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000487
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000143
+ close fd=4
+ close=OK
+ +0.000235
diff --git a/adns-0.6/regress/case-norm.err b/adns-0.6/regress/case-norm.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-norm.err
diff --git a/adns-0.6/regress/case-norm.out b/adns-0.6/regress/case-norm.out
new file mode 100644
index 0000000..6953cea
--- /dev/null
+++ b/adns-0.6/regress/case-norm.out
@@ -0,0 +1,5 @@
+adns debug: using nameserver 172.18.45.6
+chiark.greenend.org.uk flags 0 type 1 A(-) submitted
+chiark.greenend.org.uk flags 0 type A(-): OK; nrrs=1; cname=$; owner=$; ttl=86400
+ 195.224.76.132
+rc=0
diff --git a/adns-0.6/regress/case-norm.sys b/adns-0.6/regress/case-norm.sys
new file mode 100644
index 0000000..675a9bd
--- /dev/null
+++ b/adns-0.6/regress/case-norm.sys
@@ -0,0 +1,34 @@
+default
+:1 chiark.greenend.org.uk
+ start 912888966.802483
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000204
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000670
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000072
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000579
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999421
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.006414
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+ 64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+ 7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+ 0004ac12 2d06c070 00010001 00015180 0004ac12 2d41.
+ +0.000874
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000179
+ close fd=4
+ close=OK
+ +0.000184
diff --git a/adns-0.6/regress/case-owner.err b/adns-0.6/regress/case-owner.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-owner.err
diff --git a/adns-0.6/regress/case-owner.out b/adns-0.6/regress/case-owner.out
new file mode 100644
index 0000000..9cb3358
--- /dev/null
+++ b/adns-0.6/regress/case-owner.out
@@ -0,0 +1,36 @@
+adns debug: using nameserver 172.18.45.6
+chiark.greenend.org.uk flags 4 type 1 A(-) submitted
+chiark.greenend.org.uk flags 4 type 2 NS(raw) submitted
+chiark.greenend.org.uk flags 4 type 5 CNAME(-) submitted
+chiark.greenend.org.uk flags 4 type 6 SOA(raw) submitted
+chiark.greenend.org.uk flags 4 type 12 PTR(raw) submitted
+chiark.greenend.org.uk flags 4 type 13 HINFO(-) submitted
+chiark.greenend.org.uk flags 4 type 15 MX(raw) submitted
+chiark.greenend.org.uk flags 4 type 16 TXT(-) submitted
+chiark.greenend.org.uk flags 4 type 17 RP(raw) submitted
+chiark.greenend.org.uk flags 4 type 65537 A(addr) submitted
+chiark.greenend.org.uk flags 4 type 65538 NS(+addr) submitted
+chiark.greenend.org.uk flags 4 type 65548 PTR(checked) submitted
+chiark.greenend.org.uk flags 4 type 65551 MX(+addr) submitted
+chiark.greenend.org.uk flags 4 type 131078 SOA(822) submitted
+chiark.greenend.org.uk flags 4 type 131089 RP(822) submitted
+chiark.greenend.org.uk flags 4 type A(-): OK; nrrs=1; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+ 195.224.76.132
+chiark.greenend.org.uk flags 4 type NS(raw): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+chiark.greenend.org.uk flags 4 type CNAME(-): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+chiark.greenend.org.uk flags 4 type SOA(raw): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+chiark.greenend.org.uk flags 4 type PTR(raw): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+chiark.greenend.org.uk flags 4 type HINFO(-): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+chiark.greenend.org.uk flags 4 type MX(raw): OK; nrrs=1; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+ 5 permutation-city.greenend.org.uk
+chiark.greenend.org.uk flags 4 type TXT(-): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+chiark.greenend.org.uk flags 4 type RP(raw): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+chiark.greenend.org.uk flags 4 type A(addr): OK; nrrs=1; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+ INET 195.224.76.132
+chiark.greenend.org.uk flags 4 type NS(+addr): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+chiark.greenend.org.uk flags 4 type PTR(checked): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+chiark.greenend.org.uk flags 4 type MX(+addr): OK; nrrs=1; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+ 5 permutation-city.greenend.org.uk ok 0 ok "OK" ( INET 195.224.76.134 )
+chiark.greenend.org.uk flags 4 type SOA(822): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+chiark.greenend.org.uk flags 4 type RP(822): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+rc=0
diff --git a/adns-0.6/regress/case-owner.sys b/adns-0.6/regress/case-owner.sys
new file mode 100644
index 0000000..5e2c335
--- /dev/null
+++ b/adns-0.6/regress/case-owner.sys
@@ -0,0 +1,285 @@
+default
+4/chiark.greenend.org.uk
+ start 933206012.504679
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000275
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000094
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000073
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.001715
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00020001.
+ sendto=40
+ +0.001142
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00050001.
+ sendto=40
+ +0.001143
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00060001.
+ sendto=40
+ +0.001213
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 000c0001.
+ sendto=40
+ +0.001183
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 000d0001.
+ sendto=40
+ +0.001273
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 000f0001.
+ sendto=40
+ +0.001188
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00100001.
+ sendto=40
+ +0.001185
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00110001.
+ sendto=40
+ +0.001192
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.001315
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00020001.
+ sendto=40
+ +0.001206
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 000c0001.
+ sendto=40
+ +0.001199
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 000f0001.
+ sendto=40
+ +0.001162
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00060001.
+ sendto=40
+ +0.001234
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00110001.
+ sendto=40
+ +0.001320
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.981330
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000364
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+ 64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+ 7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+ 0004ac12 2d06c070 00010001 00015180 0004ac12 2d41.
+ +0.001489
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208580 00010000 00010000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00020001 08677265 656e656e 64036f72 6702756b 00000600 01000151
+ 80002602 6e73c00c 0a686f73 746d6173 746572c0 2877276a 9c000070 8000001c
+ 2000093a 80000151 80.
+ +0.001437
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000394
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.980503
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001013
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010000 00010000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00050001 08677265 656e656e 64036f72 6702756b 00000600 01000151
+ 80002602 6e73c00c 0a686f73 746d6173 746572c0 2877276a 9c000070 8000001c
+ 2000093a 80000151 80.
+ +0.000770
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000496
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.979367
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001726
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228580 00010000 00010000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00060001 08677265 656e656e 64036f72 6702756b 00000600 01000151
+ 80002602 6e73c00c 0a686f73 746d6173 746572c0 2877276a 9c000070 8000001c
+ 2000093a 80000151 80.
+ +0.000812
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000408
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.977634
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002560
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238580 00010000 00010000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 000c0001 08677265 656e656e 64036f72 6702756b 00000600 01000151
+ 80002602 6e73c00c 0a686f73 746d6173 746572c0 2877276a 9c000070 8000001c
+ 2000093a 80000151 80.
+ +0.000777
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000403
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.975077
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002559
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248580 00010000 00010000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 000d0001 08677265 656e656e 64036f72 6702756b 00000600 01000151
+ 80002602 6e73c00c 0a686f73 746d6173 746572c0 2877276a 9c000070 8000001c
+ 2000093a 80000151 80.
+ +0.000960
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000412
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.972419
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004697
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258580 00010001 00020003 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 000f0001 c00c000f 00010001 51800024 00051070 65726d75 74617469
+ 6f6e2d63 69747908 67726565 6e656e64 036f7267 02756b00 c0470002 00010001
+ 51800011 036e7330 0a72656c 61746976 697479c0 47c04700 02000100 01518000
+ 06036e73 31c068c0 36000100 01000151 800004c3 e04c86c0 64000100 01000151
+ 800004ac 122d06c0 81000100 01000151 800004ac 122d41.
+ +0.001256
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000769
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.966885
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001768
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268580 00010000 00010000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00100001 08677265 656e656e 64036f72 6702756b 00000600 01000151
+ 80002602 6e73c00c 0a686f73 746d6173 746572c0 2877276a 9c000070 8000001c
+ 2000093a 80000151 80.
+ +0.001528
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000443
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.964331
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001739
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278580 00010000 00010000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00110001 08677265 656e656e 64036f72 6702756b 00000600 01000151
+ 80002602 6e73c00c 0a686f73 746d6173 746572c0 2877276a 9c000070 8000001c
+ 2000093a 80000151 80.
+ +0.000776
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000429
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.962579
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004212
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+ 64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+ 7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+ 0004ac12 2d06c070 00010001 00015180 0004ac12 2d41.
+ +0.001050
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000589
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.958043
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002059
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298580 00010000 00010000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00020001 08677265 656e656e 64036f72 6702756b 00000600 01000151
+ 80002602 6e73c00c 0a686f73 746d6173 746572c0 2877276a 9c000070 8000001c
+ 2000093a 80000151 80.
+ +0.000776
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000435
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.955979
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002598
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8580 00010000 00010000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 000c0001 08677265 656e656e 64036f72 6702756b 00000600 01000151
+ 80002602 6e73c00c 0a686f73 746d6173 746572c0 2877276a 9c000070 8000001c
+ 2000093a 80000151 80.
+ +0.000777
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000396
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.953407
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004872
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8580 00010001 00020003 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 000f0001 c00c000f 00010001 51800024 00051070 65726d75 74617469
+ 6f6e2d63 69747908 67726565 6e656e64 036f7267 02756b00 c0470002 00010001
+ 51800011 036e7330 0a72656c 61746976 697479c0 47c04700 02000100 01518000
+ 06036e73 31c068c0 36000100 01000151 800004c3 e04c86c0 64000100 01000151
+ 800004ac 122d06c0 81000100 01000151 800004ac 122d41.
+ +0.001252
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000950
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.947495
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001580
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8580 00010000 00010000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00060001 08677265 656e656e 64036f72 6702756b 00000600 01000151
+ 80002602 6e73c00c 0a686f73 746d6173 746572c0 2877276a 9c000070 8000001c
+ 2000093a 80000151 80.
+ +0.000780
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000401
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.945968
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002592
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8580 00010000 00010000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00110001 08677265 656e656e 64036f72 6702756b 00000600 01000151
+ 80002602 6e73c00c 0a686f73 746d6173 746572c0 2877276a 9c000070 8000001c
+ 2000093a 80000151 80.
+ +0.000794
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000441
+ close fd=4
+ close=OK
+ +0.000387
diff --git a/adns-0.6/regress/case-poll.err b/adns-0.6/regress/case-poll.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-poll.err
diff --git a/adns-0.6/regress/case-poll.out b/adns-0.6/regress/case-poll.out
new file mode 100644
index 0000000..6953cea
--- /dev/null
+++ b/adns-0.6/regress/case-poll.out
@@ -0,0 +1,5 @@
+adns debug: using nameserver 172.18.45.6
+chiark.greenend.org.uk flags 0 type 1 A(-) submitted
+chiark.greenend.org.uk flags 0 type A(-): OK; nrrs=1; cname=$; owner=$; ttl=86400
+ 195.224.76.132
+rc=0
diff --git a/adns-0.6/regress/case-poll.sys b/adns-0.6/regress/case-poll.sys
new file mode 100644
index 0000000..ba05521
--- /dev/null
+++ b/adns-0.6/regress/case-poll.sys
@@ -0,0 +1,34 @@
+default -,p
+:1 chiark.greenend.org.uk
+ start 931719947.391142
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000208
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000087
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000066
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000592
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=1 fds=[{fd=4, events=POLLIN, revents=POLLIN}]
+ +0.006530
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+ 64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+ 7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+ 0004ac12 2d06c070 00010001 00015180 0004ac12 2d41.
+ +0.001044
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000211
+ close fd=4
+ close=OK
+ +0.000248
diff --git a/adns-0.6/regress/case-polltimeout.err b/adns-0.6/regress/case-polltimeout.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-polltimeout.err
diff --git a/adns-0.6/regress/case-polltimeout.out b/adns-0.6/regress/case-polltimeout.out
new file mode 100644
index 0000000..a3f7495
--- /dev/null
+++ b/adns-0.6/regress/case-polltimeout.out
@@ -0,0 +1,4 @@
+adns debug: using nameserver 172.18.45.36
+chiark.greenend.org.uk flags 0 type 1 A(-) submitted
+chiark.greenend.org.uk flags 0 type A(-): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+rc=0
diff --git a/adns-0.6/regress/case-polltimeout.sys b/adns-0.6/regress/case-polltimeout.sys
new file mode 100644
index 0000000..4e207f0
--- /dev/null
+++ b/adns-0.6/regress/case-polltimeout.sys
@@ -0,0 +1,135 @@
+noserver -,p
+:1 chiark.greenend.org.uk
+ start 931719968.733439
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000199
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000087
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000067
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000790
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009031
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000436
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009093
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000519
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.008993
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000500
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009010
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000486
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009050
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000485
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009014
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000485
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009045
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000451
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009050
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000483
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009042
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000433
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009083
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000521
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009017
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000442
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009058
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000510
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009012
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000436
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.009085
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000514
+ poll fds=[{fd=4, events=POLLIN, revents=0}] timeout=2000
+ poll=0 fds=[{fd=4, events=POLLIN, revents=0}]
+ +2.008998
+ close fd=4
+ close=OK
+ +0.000302
diff --git a/adns-0.6/regress/case-rootquery.err b/adns-0.6/regress/case-rootquery.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-rootquery.err
diff --git a/adns-0.6/regress/case-rootquery.out b/adns-0.6/regress/case-rootquery.out
new file mode 100644
index 0000000..d78d469
--- /dev/null
+++ b/adns-0.6/regress/case-rootquery.out
@@ -0,0 +1,8 @@
+adns debug: using nameserver 172.18.45.6
+. flags 0 type 131078 SOA(822) submitted
+. flags 1 type 131078 SOA(822) submitted
+. flags 0 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=60222
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999041600 1800 900 604800 86400
+. flags 1 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=57210
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999041600 1800 900 604800 86400
+rc=0
diff --git a/adns-0.6/regress/case-rootquery.sys b/adns-0.6/regress/case-rootquery.sys
new file mode 100644
index 0000000..4cd21b8
--- /dev/null
+++ b/adns-0.6/regress/case-rootquery.sys
@@ -0,0 +1,73 @@
+default
+:131078 . 1/.
+ start 924364442.672925
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000222
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000085
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000069
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 00000600 01.
+ sendto=17
+ +0.001781
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 00000600 01.
+ sendto=17
+ +0.001194
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997025
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.012535
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010001 000d000d 00000600 01000006 00010000 eb3e003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 51800000 02000100
+ 04a9e700 040144c0 1e000002 00010004 a9e70004 0145c01e 00000200 010004a9
+ e7000401 49c01e00 00020001 0004a9e7 00040146 c01e0000 02000100 04a9e700
+ 040147c0 1e000002 00010004 a9e70004 014ac01e 00000200 010004a9 e7000401
+ 4bc01e00 00020001 0004a9e7 0004014c c01e0000 02000100 04a9e700 04014dc0
+ 1e000002 00010004 a9e70002 c01c0000 02000100 04a9e700 040148c0 1e000002
+ 00010004 a9e70004 0142c01e 00000200 010004a9 e7000401 43c01ec0 65000100
+ 01000929 a8000480 080a5ac0 74000100 01000929 a80004c0 cbe60ac0 83000100
+ 0100092c 170004c0 249411c0 92000100 01000929 a80004c0 0505f1c0 a1000100
+ 01000929 a80004c0 702404c0 b0000100 010005fb 670004c6 29000ac0 bf000100
+ 010005fb 670004c1 000e81c0 ce000100 010005fb 670004c6 20400cc0 dd000100
+ 010005fb 670004ca 0c1b21c0 1c000100 01000929 a80004c6 290004c0 f9000100
+ 01000929 a8000480 3f0235c1 08000100 01000929 a8000480 09006bc1 17000100
+ 01000929 a80004c0 21040c.
+ +0.002867
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000463
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.982941
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.008221
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 00010001 000d000d 00000600 01000006 00010000 df7a003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 51800000 02000100
+ 04a9e700 040144c0 1e000002 00010004 a9e70004 0145c01e 00000200 010004a9
+ e7000401 49c01e00 00020001 0004a9e7 00040146 c01e0000 02000100 04a9e700
+ 040147c0 1e000002 00010004 a9e70004 014ac01e 00000200 010004a9 e7000401
+ 4bc01e00 00020001 0004a9e7 0004014c c01e0000 02000100 04a9e700 04014dc0
+ 1e000002 00010004 a9e70002 c01c0000 02000100 04a9e700 040148c0 1e000002
+ 00010004 a9e70004 0142c01e 00000200 010004a9 e7000401 43c01ec0 65000100
+ 01000929 a8000480 080a5ac0 74000100 01000929 a80004c0 cbe60ac0 83000100
+ 0100092c 170004c0 249411c0 92000100 01000929 a80004c0 0505f1c0 a1000100
+ 01000929 a80004c0 702404c0 b0000100 010005fb 670004c6 29000ac0 bf000100
+ 010005fb 670004c1 000e81c0 ce000100 010005fb 670004c6 20400cc0 dd000100
+ 010005fb 670004ca 0c1b21c0 1c000100 01000929 a80004c6 290004c0 f9000100
+ 01000929 a8000480 3f0235c1 08000100 01000929 a8000480 09006bc1 17000100
+ 01000929 a80004c0 21040c.
+ +0.002425
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000260
+ close fd=4
+ close=OK
+ +0.000232
diff --git a/adns-0.6/regress/case-rootqueryall-as.err b/adns-0.6/regress/case-rootqueryall-as.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-rootqueryall-as.err
diff --git a/adns-0.6/regress/case-rootqueryall-as.out b/adns-0.6/regress/case-rootqueryall-as.out
new file mode 100644
index 0000000..dcfbc8e
--- /dev/null
+++ b/adns-0.6/regress/case-rootqueryall-as.out
@@ -0,0 +1,118 @@
+adns debug: using nameserver 172.18.45.6
+. flags 0 type 1 A(-) submitted
+. flags 0 type 2 NS(raw) submitted
+. flags 0 type 5 CNAME(-) submitted
+. flags 0 type 6 SOA(raw) submitted
+. flags 0 type 12 PTR(raw) submitted
+. flags 0 type 13 HINFO(-) submitted
+. flags 0 type 15 MX(raw) submitted
+. flags 0 type 16 TXT(-) submitted
+. flags 0 type 17 RP(raw) submitted
+. flags 0 type 65537 A(addr) submitted
+. flags 0 type 65538 NS(+addr) submitted
+. flags 0 type 65548 PTR(checked) submitted
+. flags 0 type 65551 MX(+addr) submitted
+. flags 0 type 131078 SOA(822) submitted
+. flags 0 type 131089 RP(822) submitted
+. flags 1 type 1 A(-) submitted
+. flags 1 type 2 NS(raw) submitted
+. flags 1 type 5 CNAME(-) submitted
+. flags 1 type 6 SOA(raw) submitted
+. flags 1 type 12 PTR(raw) submitted
+. flags 1 type 13 HINFO(-) submitted
+. flags 1 type 15 MX(raw) submitted
+. flags 1 type 16 TXT(-) submitted
+. flags 1 type 17 RP(raw) submitted
+. flags 1 type 65537 A(addr) submitted
+. flags 1 type 65538 NS(+addr) submitted
+. flags 1 type 65548 PTR(checked) submitted
+. flags 1 type 65551 MX(+addr) submitted
+. flags 1 type 131078 SOA(822) submitted
+. flags 1 type 131089 RP(822) submitted
+. flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type NS(raw): OK; nrrs=13; cname=$; owner=$; ttl=518399
+ E.ROOT-SERVERS.NET
+ I.ROOT-SERVERS.NET
+ F.ROOT-SERVERS.NET
+ G.ROOT-SERVERS.NET
+ J.ROOT-SERVERS.NET
+ K.ROOT-SERVERS.NET
+ L.ROOT-SERVERS.NET
+ M.ROOT-SERVERS.NET
+ A.ROOT-SERVERS.NET
+ H.ROOT-SERVERS.NET
+ B.ROOT-SERVERS.NET
+ C.ROOT-SERVERS.NET
+ D.ROOT-SERVERS.NET
+. flags 0 type SOA(raw): OK; nrrs=1; cname=$; owner=$; ttl=82079
+ A.ROOT-SERVERS.NET hostmaster.INTERNIC.NET 1999071300 1800 900 604800 86400
+. flags 0 type PTR(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type NS(+addr): OK; nrrs=13; cname=$; owner=$; ttl=518399
+ I.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.36.148.17 )
+ F.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.5.5.241 )
+ G.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.112.36.4 )
+ J.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.10 )
+ K.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 193.0.14.129 )
+ L.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.32.64.12 )
+ M.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 202.12.27.33 )
+ A.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.4 )
+ H.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.63.2.53 )
+ B.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.9.0.107 )
+ C.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.33.4.12 )
+ D.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.8.10.90 )
+ E.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.203.230.10 )
+. flags 0 type PTR(checked): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=77975
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999071300 1800 900 604800 86400
+. flags 0 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type NS(raw): OK; nrrs=13; cname=$; owner=$; ttl=518399
+ F.ROOT-SERVERS.NET
+ G.ROOT-SERVERS.NET
+ J.ROOT-SERVERS.NET
+ K.ROOT-SERVERS.NET
+ L.ROOT-SERVERS.NET
+ M.ROOT-SERVERS.NET
+ A.ROOT-SERVERS.NET
+ H.ROOT-SERVERS.NET
+ B.ROOT-SERVERS.NET
+ C.ROOT-SERVERS.NET
+ D.ROOT-SERVERS.NET
+ E.ROOT-SERVERS.NET
+ I.ROOT-SERVERS.NET
+. flags 1 type SOA(raw): OK; nrrs=1; cname=$; owner=$; ttl=74076
+ A.ROOT-SERVERS.NET hostmaster.INTERNIC.NET 1999071300 1800 900 604800 86400
+. flags 1 type PTR(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type NS(+addr): OK; nrrs=13; cname=$; owner=$; ttl=518399
+ G.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.112.36.4 )
+ J.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.10 )
+ K.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 193.0.14.129 )
+ L.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.32.64.12 )
+ M.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 202.12.27.33 )
+ A.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.4 )
+ H.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.63.2.53 )
+ B.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.9.0.107 )
+ C.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.33.4.12 )
+ D.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.8.10.90 )
+ E.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.203.230.10 )
+ I.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.36.148.17 )
+ F.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.5.5.241 )
+. flags 1 type PTR(checked): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=70372
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999071300 1800 900 604800 86400
+. flags 1 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+. flags 1 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+rc=0
diff --git a/adns-0.6/regress/case-rootqueryall-as.sys b/adns-0.6/regress/case-rootqueryall-as.sys
new file mode 100644
index 0000000..532d875
--- /dev/null
+++ b/adns-0.6/regress/case-rootqueryall-as.sys
@@ -0,0 +1,579 @@
+default
+. 1/.
+ start 931992019.753022
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000216
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000082
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000065
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000454
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 00000200 01.
+ sendto=17
+ +0.000348
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 00000500 01.
+ sendto=17
+ +0.000303
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 00000600 01.
+ sendto=17
+ +0.000298
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000298
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 00000d00 01.
+ sendto=17
+ +0.000375
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000301
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 00001000 01.
+ sendto=17
+ +0.000299
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000351
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000868
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 00000200 01.
+ sendto=17
+ +0.000318
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000299
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000299
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 00000600 01.
+ sendto=17
+ +0.000297
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000297
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000307
+ sendto fd=4 addr=172.18.45.6:53
+ 312f0100 00010000 00000000 00000200 01.
+ sendto=17
+ +0.000299
+ sendto fd=4 addr=172.18.45.6:53
+ 31300100 00010000 00000000 00000500 01.
+ sendto=17
+ +0.000298
+ sendto fd=4 addr=172.18.45.6:53
+ 31310100 00010000 00000000 00000600 01.
+ sendto=17
+ +0.000330
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000323
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 00000d00 01.
+ sendto=17
+ +0.000384
+ sendto fd=4 addr=172.18.45.6:53
+ 31340100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000302
+ sendto fd=4 addr=172.18.45.6:53
+ 31350100 00010000 00000000 00001000 01.
+ sendto=17
+ +0.000300
+ sendto fd=4 addr=172.18.45.6:53
+ 31360100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000296
+ sendto fd=4 addr=172.18.45.6:53
+ 31370100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000298
+ sendto fd=4 addr=172.18.45.6:53
+ 31380100 00010000 00000000 00000200 01.
+ sendto=17
+ +0.000298
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000297
+ sendto fd=4 addr=172.18.45.6:53
+ 313a0100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000296
+ sendto fd=4 addr=172.18.45.6:53
+ 313b0100 00010000 00000000 00000600 01.
+ sendto=17
+ +0.000326
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000303
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.989938
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.007735
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8180 00010000 00010000 00000100 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000703
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000151
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.981803
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.011771
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 0001000d 0000000d 00000200 01000002 00010007 e8ff0014 01450c52
+ 4f4f542d 53455256 45525303 4e455400 00000200 010007e8 ff000401 49c01e00
+ 00020001 0007e8ff 00040146 c01e0000 02000100 07e8ff00 040147c0 1e000002
+ 00010007 e8ff0004 014ac01e 00000200 010007e8 ff000401 4bc01e00 00020001
+ 0007e8ff 0004014c c01e0000 02000100 07e8ff00 04014dc0 1e000002 00010007
+ e8ff0004 0141c01e 00000200 010007e8 ff000401 48c01e00 00020001 0007e8ff
+ 00040142 c01e0000 02000100 07e8ff00 040143c0 1e000002 00010007 e8ff0004
+ 0144c01e c01c0001 00010009 3a7f0004 c0cbe60a c03b0001 00010009 3a7f0004
+ c0249411 c04a0001 00010009 3a7f0004 c00505f1 c0590001 00010009 3a7f0004
+ c0702404 c0680001 00010009 3a7f0004 c629000a c0770001 00010009 3a7f0004
+ c1000e81 c0860001 00010009 3a7f0004 c620400c c0950001 00010009 3a7f0004
+ ca0c1b21 c0a40001 00010009 3a7f0004 c6290004 c0b30001 00010009 3a7f0004
+ 803f0235 c0c20001 00010009 3a7f0004 8009006b c0d10001 00010009 3a7f0004
+ c021040c c0e00001 00010009 3a7f0004 80080a5a.
+ +0.002660
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000492
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.967228
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.016740
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228180 00010001 000d000d 00000600 01000006 00010001 409f003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 51800000 02000100
+ 07e8ff00 040145c0 1e000002 00010007 e8ff0004 0149c01e 00000200 010007e8
+ ff000401 46c01e00 00020001 0007e8ff 00040147 c01e0000 02000100 07e8ff00
+ 04014ac0 1e000002 00010007 e8ff0004 014bc01e 00000200 010007e8 ff000401
+ 4cc01e00 00020001 0007e8ff 0004014d c01e0000 02000100 07e8ff00 02c01c00
+ 00020001 0007e8ff 00040148 c01e0000 02000100 07e8ff00 040142c0 1e000002
+ 00010007 e8ff0004 0143c01e 00000200 010007e8 ff000401 44c01ec0 65000100
+ 0100093a 7f0004c0 cbe60ac0 74000100 0100093a 7f0004c0 249411c0 83000100
+ 0100093a 7f0004c0 0505f1c0 92000100 0100093a 7f0004c0 702404c0 a1000100
+ 0100093a 7f0004c6 29000ac0 b0000100 0100093a 7f0004c1 000e81c0 bf000100
+ 0100093a 7f0004c6 20400cc0 ce000100 0100093a 7f0004ca 0c1b21c0 1c000100
+ 0100093a 7f0004c6 290004c0 ea000100 0100093a 7f000480 3f0235c0 f9000100
+ 0100093a 7f000480 09006bc1 08000100 0100093a 7f0004c0 21040cc1 17000100
+ 0100093a 7f000480 080a5a.
+ +0.002984
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000231
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.947273
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000462
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238180 00010000 00010000 00000c00 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000634
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000101
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.946076
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003306
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248180 00010000 00010000 00000d00 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000640
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000124
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.942006
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003471
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258180 00010000 00010000 00000f00 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000640
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000101
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.937794
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003503
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268180 00010000 00010000 00001000 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000657
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000120
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.933514
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003470
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278180 00010000 00010000 00001100 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000640
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000100
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.929304
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003089
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288180 00010000 00010000 00000100 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000639
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000100
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.925476
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.011378
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298180 0001000d 0000000d 00000200 01000002 00010007 e8ff0014 01490c52
+ 4f4f542d 53455256 45525303 4e455400 00000200 010007e8 ff000401 46c01e00
+ 00020001 0007e8ff 00040147 c01e0000 02000100 07e8ff00 04014ac0 1e000002
+ 00010007 e8ff0004 014bc01e 00000200 010007e8 ff000401 4cc01e00 00020001
+ 0007e8ff 0004014d c01e0000 02000100 07e8ff00 040141c0 1e000002 00010007
+ e8ff0004 0148c01e 00000200 010007e8 ff000401 42c01e00 00020001 0007e8ff
+ 00040143 c01e0000 02000100 07e8ff00 040144c0 1e000002 00010007 e8ff0004
+ 0145c01e c01c0001 00010009 3a7f0004 c0249411 c03b0001 00010009 3a7f0004
+ c00505f1 c04a0001 00010009 3a7f0004 c0702404 c0590001 00010009 3a7f0004
+ c629000a c0680001 00010009 3a7f0004 c1000e81 c0770001 00010009 3a7f0004
+ c620400c c0860001 00010009 3a7f0004 ca0c1b21 c0950001 00010009 3a7f0004
+ c6290004 c0a40001 00010009 3a7f0004 803f0235 c0b30001 00010009 3a7f0004
+ 8009006b c0c20001 00010009 3a7f0004 c021040c c0d10001 00010009 3a7f0004
+ 80080a5a c0e00001 00010009 3a7f0004 c0cbe60a.
+ +0.002666
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8180 00010000 00010000 00000c00 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.001684
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000096
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.909652
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003338
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8180 00010000 00010000 00000f00 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000643
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000106
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.905565
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.012071
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010001 000d000d 00000600 01000006 00010001 3097003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 51800000 02000100
+ 07e8ff00 040149c0 1e000002 00010007 e8ff0004 0146c01e 00000200 010007e8
+ ff000401 47c01e00 00020001 0007e8ff 0004014a c01e0000 02000100 07e8ff00
+ 04014bc0 1e000002 00010007 e8ff0004 014cc01e 00000200 010007e8 ff000401
+ 4dc01e00 00020001 0007e8ff 0002c01c 00000200 010007e8 ff000401 48c01e00
+ 00020001 0007e8ff 00040142 c01e0000 02000100 07e8ff00 040143c0 1e000002
+ 00010007 e8ff0004 0144c01e 00000200 010007e8 ff000401 45c01ec0 65000100
+ 0100093a 7f0004c0 249411c0 74000100 0100093a 7f0004c0 0505f1c0 83000100
+ 0100093a 7f0004c0 702404c0 92000100 0100093a 7f0004c6 29000ac0 a1000100
+ 0100093a 7f0004c1 000e81c0 b0000100 0100093a 7f0004c6 20400cc0 bf000100
+ 0100093a 7f0004ca 0c1b21c0 1c000100 0100093a 7f0004c6 290004c0 db000100
+ 0100093a 7f000480 3f0235c0 ea000100 0100093a 7f000480 09006bc0 f9000100
+ 0100093a 7f0004c0 21040cc1 08000100 0100093a 7f000480 080a5ac1 17000100
+ 0100093a 7f0004c0 cbe60a.
+ +0.002963
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000237
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.890294
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000878
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8180 00010000 00010000 00001100 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000645
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000107
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.888664
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003147
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312e8180 00010000 00010000 00000100 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000643
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000141
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.884733
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.011290
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312f8180 0001000d 0000000d 00000200 01000002 00010007 e8ff0014 01460c52
+ 4f4f542d 53455256 45525303 4e455400 00000200 010007e8 ff000401 47c01e00
+ 00020001 0007e8ff 0004014a c01e0000 02000100 07e8ff00 04014bc0 1e000002
+ 00010007 e8ff0004 014cc01e 00000200 010007e8 ff000401 4dc01e00 00020001
+ 0007e8ff 00040141 c01e0000 02000100 07e8ff00 040148c0 1e000002 00010007
+ e8ff0004 0142c01e 00000200 010007e8 ff000401 43c01e00 00020001 0007e8ff
+ 00040144 c01e0000 02000100 07e8ff00 040145c0 1e000002 00010007 e8ff0004
+ 0149c01e c01c0001 00010009 3a7f0004 c00505f1 c03b0001 00010009 3a7f0004
+ c0702404 c04a0001 00010009 3a7f0004 c629000a c0590001 00010009 3a7f0004
+ c1000e81 c0680001 00010009 3a7f0004 c620400c c0770001 00010009 3a7f0004
+ ca0c1b21 c0860001 00010009 3a7f0004 c6290004 c0950001 00010009 3a7f0004
+ 803f0235 c0a40001 00010009 3a7f0004 8009006b c0b30001 00010009 3a7f0004
+ c021040c c0c20001 00010009 3a7f0004 80080a5a c0d10001 00010009 3a7f0004
+ c0cbe60a c0e00001 00010009 3a7f0004 c0249411.
+ +0.002658
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000400
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.870385
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019033
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31318180 00010001 000d000d 00000600 01000006 00010001 215c003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 51800000 02000100
+ 07e8ff00 040146c0 1e000002 00010007 e8ff0004 0147c01e 00000200 010007e8
+ ff000401 4ac01e00 00020001 0007e8ff 0004014b c01e0000 02000100 07e8ff00
+ 04014cc0 1e000002 00010007 e8ff0004 014dc01e 00000200 010007e8 ff0002c0
+ 1c000002 00010007 e8ff0004 0148c01e 00000200 010007e8 ff000401 42c01e00
+ 00020001 0007e8ff 00040143 c01e0000 02000100 07e8ff00 040144c0 1e000002
+ 00010007 e8ff0004 0145c01e 00000200 010007e8 ff000401 49c01ec0 65000100
+ 0100093a 7f0004c0 0505f1c0 74000100 0100093a 7f0004c0 702404c0 83000100
+ 0100093a 7f0004c6 29000ac0 92000100 0100093a 7f0004c1 000e81c0 a1000100
+ 0100093a 7f0004c6 20400cc0 b0000100 0100093a 7f0004ca 0c1b21c0 1c000100
+ 0100093a 7f0004c6 290004c0 cc000100 0100093a 7f000480 3f0235c0 db000100
+ 0100093a 7f000480 09006bc0 ea000100 0100093a 7f0004c0 21040cc0 f9000100
+ 0100093a 7f000480 080a5ac1 08000100 0100093a 7f0004c0 cbe60ac1 17000100
+ 0100093a 7f0004c0 249411.
+ +0.002965
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000228
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.848159
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000402
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31328180 00010000 00010000 00000c00 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000658
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000104
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.846995
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003222
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31338180 00010000 00010000 00000d00 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000645
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000107
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.843021
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003535
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31348180 00010000 00010000 00000f00 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000640
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000128
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.838718
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003396
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31358180 00010000 00010000 00001000 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000643
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000108
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.834571
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003560
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31368180 00010000 00010000 00001100 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000642
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000133
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.830236
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003060
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31378180 00010000 00010000 00000100 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000645
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000106
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.826425
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.011323
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31388180 0001000d 0000000d 00000200 01000002 00010007 e8ff0014 01470c52
+ 4f4f542d 53455256 45525303 4e455400 00000200 010007e8 ff000401 4ac01e00
+ 00020001 0007e8ff 0004014b c01e0000 02000100 07e8ff00 04014cc0 1e000002
+ 00010007 e8ff0004 014dc01e 00000200 010007e8 ff000401 41c01e00 00020001
+ 0007e8ff 00040148 c01e0000 02000100 07e8ff00 040142c0 1e000002 00010007
+ e8ff0004 0143c01e 00000200 010007e8 ff000401 44c01e00 00020001 0007e8ff
+ 00040145 c01e0000 02000100 07e8ff00 040149c0 1e000002 00010007 e8ff0004
+ 0146c01e c01c0001 00010009 3a7f0004 c0702404 c03b0001 00010009 3a7f0004
+ c629000a c04a0001 00010009 3a7f0004 c1000e81 c0590001 00010009 3a7f0004
+ c620400c c0680001 00010009 3a7f0004 ca0c1b21 c0770001 00010009 3a7f0004
+ c6290004 c0860001 00010009 3a7f0004 803f0235 c0950001 00010009 3a7f0004
+ 8009006b c0a40001 00010009 3a7f0004 c021040c c0b30001 00010009 3a7f0004
+ 80080a5a c0c20001 00010009 3a7f0004 c0cbe60a c0d10001 00010009 3a7f0004
+ c0249411 c0e00001 00010009 3a7f0004 c00505f1.
+ +0.002663
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31398180 00010000 00010000 00000c00 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.001663
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000127
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.810649
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003326
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313a8180 00010000 00010000 00000f00 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000643
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000105
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.806575
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.025669
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313b8180 00010001 000d000d 00000600 01000006 00010001 12e4003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 51800000 02000100
+ 07e8ff00 040147c0 1e000002 00010007 e8ff0004 014ac01e 00000200 010007e8
+ ff000401 4bc01e00 00020001 0007e8ff 0004014c c01e0000 02000100 07e8ff00
+ 04014dc0 1e000002 00010007 e8ff0002 c01c0000 02000100 07e8ff00 040148c0
+ 1e000002 00010007 e8ff0004 0142c01e 00000200 010007e8 ff000401 43c01e00
+ 00020001 0007e8ff 00040144 c01e0000 02000100 07e8ff00 040145c0 1e000002
+ 00010007 e8ff0004 0149c01e 00000200 010007e8 ff000401 46c01ec0 65000100
+ 0100093a 7f0004c0 702404c0 74000100 0100093a 7f0004c6 29000ac0 83000100
+ 0100093a 7f0004c1 000e81c0 92000100 0100093a 7f0004c6 20400cc0 a1000100
+ 0100093a 7f0004ca 0c1b21c0 1c000100 0100093a 7f0004c6 290004c0 bd000100
+ 0100093a 7f000480 3f0235c0 cc000100 0100093a 7f000480 09006bc0 db000100
+ 0100093a 7f0004c0 21040cc0 ea000100 0100093a 7f000480 080a5ac0 f9000100
+ 0100093a 7f0004c0 cbe60ac1 08000100 0100093a 7f0004c0 249411c1 17000100
+ 0100093a 7f0004c0 0505f1.
+ +0.002963
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000233
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.777710
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004017
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313c8180 00010000 00010000 00001100 01000006 00010000 0257003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000640
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000106
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.772947
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-752512
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010000 00010000 00000500 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000649
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000106
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.529913
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.181054
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31308580 00010000 00010000 00000500 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7727 68440000 07080000 03840009 3a800001 5180.
+ +0.000687
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000112
+ close fd=4
+ close=OK
+ +0.000197
diff --git a/adns-0.6/regress/case-rootqueryall.err b/adns-0.6/regress/case-rootqueryall.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-rootqueryall.err
diff --git a/adns-0.6/regress/case-rootqueryall.out b/adns-0.6/regress/case-rootqueryall.out
new file mode 100644
index 0000000..fed0a88
--- /dev/null
+++ b/adns-0.6/regress/case-rootqueryall.out
@@ -0,0 +1,127 @@
+adns debug: using nameserver 172.18.45.6
+. flags 0 type 1 A(-) submitted
+. flags 0 type 2 NS(raw) submitted
+. flags 0 type 5 CNAME(-) submitted
+. flags 0 type 6 SOA(raw) submitted
+. flags 0 type 12 PTR(raw) submitted
+. flags 0 type 13 HINFO(-) submitted
+. flags 0 type 15 MX(raw) submitted
+. flags 0 type 16 TXT(-) submitted
+. flags 0 type 17 RP(raw) submitted
+. flags 0 type 65537 A(addr) submitted
+. flags 0 type 65538 NS(+addr) submitted
+. flags 0 type 65548 PTR(checked) submitted
+. flags 0 type 65551 MX(+addr) submitted
+. flags 0 type 131078 SOA(822) submitted
+. flags 0 type 131089 RP(822) submitted
+. flags 1 type 1 A(-) submitted
+. flags 1 type 2 NS(raw) submitted
+. flags 1 type 5 CNAME(-) submitted
+. flags 1 type 6 SOA(raw) submitted
+. flags 1 type 12 PTR(raw) submitted
+. flags 1 type 13 HINFO(-) submitted
+. flags 1 type 15 MX(raw) submitted
+. flags 1 type 16 TXT(-) submitted
+. flags 1 type 17 RP(raw) submitted
+. flags 1 type 65537 A(addr) submitted
+. flags 1 type 65538 NS(+addr) submitted
+. flags 1 type 65548 PTR(checked) submitted
+. flags 1 type 65551 MX(+addr) submitted
+. flags 1 type 131078 SOA(822) submitted
+. flags 1 type 131089 RP(822) submitted
+. flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+. flags 0 type NS(raw): OK; nrrs=13; cname=$; owner=$; ttl=305624
+ E.ROOT-SERVERS.NET
+ I.ROOT-SERVERS.NET
+ F.ROOT-SERVERS.NET
+ G.ROOT-SERVERS.NET
+ J.ROOT-SERVERS.NET
+ K.ROOT-SERVERS.NET
+ L.ROOT-SERVERS.NET
+ M.ROOT-SERVERS.NET
+ A.ROOT-SERVERS.NET
+ H.ROOT-SERVERS.NET
+ B.ROOT-SERVERS.NET
+ C.ROOT-SERVERS.NET
+ D.ROOT-SERVERS.NET
+. flags 0 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+. flags 0 type SOA(raw): OK; nrrs=1; cname=$; owner=$; ttl=54334
+ A.ROOT-SERVERS.NET hostmaster.INTERNIC.NET 1999041600 1800 900 604800 86400
+. flags 0 type PTR(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
+adns debug: reply not found, id 3123, query owner (NS=172.18.45.6)
+. flags 0 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+adns debug: reply not found, id 3128, query owner (NS=172.18.45.6)
+adns debug: reply not found, id 312a, query owner (NS=172.18.45.6)
+adns debug: reply not found, id 312e, query owner (NS=172.18.45.6)
+. flags 0 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+. flags 0 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+. flags 0 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+. flags 0 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type NS(+addr): OK; nrrs=13; cname=$; owner=$; ttl=305624
+ I.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.36.148.17 )
+ F.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.5.5.241 )
+ G.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.112.36.4 )
+ J.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.10 )
+ K.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 193.0.14.129 )
+ L.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.32.64.12 )
+ M.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 202.12.27.33 )
+ A.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.4 )
+ H.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.63.2.53 )
+ B.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.9.0.107 )
+ C.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.33.4.12 )
+ D.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.8.10.90 )
+ E.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.203.230.10 )
+. flags 0 type PTR(checked): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 0 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+. flags 0 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=51616
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999041600 1800 900 604800 86400
+. flags 0 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+. flags 1 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type NS(raw): OK; nrrs=13; cname=$; owner=$; ttl=305624
+ F.ROOT-SERVERS.NET
+ G.ROOT-SERVERS.NET
+ J.ROOT-SERVERS.NET
+ K.ROOT-SERVERS.NET
+ L.ROOT-SERVERS.NET
+ M.ROOT-SERVERS.NET
+ A.ROOT-SERVERS.NET
+ H.ROOT-SERVERS.NET
+ B.ROOT-SERVERS.NET
+ C.ROOT-SERVERS.NET
+ D.ROOT-SERVERS.NET
+ E.ROOT-SERVERS.NET
+ I.ROOT-SERVERS.NET
+. flags 1 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+. flags 1 type SOA(raw): OK; nrrs=1; cname=$; owner=$; ttl=49034
+ A.ROOT-SERVERS.NET hostmaster.INTERNIC.NET 1999041600 1800 900 604800 86400
+. flags 1 type PTR(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
+. flags 1 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
+adns debug: reply not found, id 3132, query owner (NS=172.18.45.6)
+adns debug: reply not found, id 3123, query owner (NS=172.18.45.6)
+adns debug: reply not found, id 3133, query owner (NS=172.18.45.6)
+adns debug: reply not found, id 3137, query owner (NS=172.18.45.6)
+adns debug: reply not found, id 3139, query owner (NS=172.18.45.6)
+. flags 1 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+. flags 1 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
+. flags 1 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=86399
+. flags 1 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=598
+. flags 1 type NS(+addr): OK; nrrs=13; cname=$; owner=$; ttl=305623
+ G.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.112.36.4 )
+ J.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.10 )
+ K.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 193.0.14.129 )
+ L.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.32.64.12 )
+ M.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 202.12.27.33 )
+ A.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.4 )
+ H.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.63.2.53 )
+ B.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.9.0.107 )
+ C.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.33.4.12 )
+ D.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.8.10.90 )
+ E.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.203.230.10 )
+ I.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.36.148.17 )
+ F.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.5.5.241 )
+. flags 1 type PTR(checked): No such data; nrrs=0; cname=$; owner=$; ttl=598
+. flags 1 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=598
+. flags 1 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=46580
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999041600 1800 900 604800 86400
+. flags 1 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=598
+rc=0
diff --git a/adns-0.6/regress/case-rootqueryall.sys b/adns-0.6/regress/case-rootqueryall.sys
new file mode 100644
index 0000000..d20c073
--- /dev/null
+++ b/adns-0.6/regress/case-rootqueryall.sys
@@ -0,0 +1,972 @@
+default -,s
+. 1/.
+ start 924364450.165424
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000220
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000087
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000070
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.001746
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 00000200 01.
+ sendto=17
+ +0.001194
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 00000500 01.
+ sendto=17
+ +0.000783
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 00000600 01.
+ sendto=17
+ +0.000728
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000726
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 00000d00 01.
+ sendto=17
+ +0.001290
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000771
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 00001000 01.
+ sendto=17
+ +0.000843
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000778
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000728
+ sendto fd=4 addr=172.18.45.6:53
+ 31290100 00010000 00000000 00000200 01.
+ sendto=17
+ +0.000727
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000727
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000725
+ sendto fd=4 addr=172.18.45.6:53
+ 312c0100 00010000 00000000 00000600 01.
+ sendto=17
+ +0.000731
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000871
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000737
+ sendto fd=4 addr=172.18.45.6:53
+ 312f0100 00010000 00000000 00000200 01.
+ sendto=17
+ +0.000727
+ sendto fd=4 addr=172.18.45.6:53
+ 31300100 00010000 00000000 00000500 01.
+ sendto=17
+ +0.000732
+ sendto fd=4 addr=172.18.45.6:53
+ 31310100 00010000 00000000 00000600 01.
+ sendto=17
+ +0.000781
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000733
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 00000d00 01.
+ sendto=17
+ +0.000739
+ sendto fd=4 addr=172.18.45.6:53
+ 31340100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000736
+ sendto fd=4 addr=172.18.45.6:53
+ 31350100 00010000 00000000 00001000 01.
+ sendto=17
+ +0.000837
+ sendto fd=4 addr=172.18.45.6:53
+ 31360100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000734
+ sendto fd=4 addr=172.18.45.6:53
+ 31370100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000730
+ sendto fd=4 addr=172.18.45.6:53
+ 31380100 00010000 00000000 00000200 01.
+ sendto=17
+ +0.000732
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000733
+ sendto fd=4 addr=172.18.45.6:53
+ 313a0100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000732
+ sendto fd=4 addr=172.18.45.6:53
+ 313b0100 00010000 00000000 00000600 01.
+ sendto=17
+ +0.000734
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000764
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.975451
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.006067
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208180 0001000d 0000000d 00000200 01000002 00010004 a9df0014 01450c52
+ 4f4f542d 53455256 45525303 4e455400 00000200 010004a9 df000401 49c01e00
+ 00020001 0004a9df 00040146 c01e0000 02000100 04a9df00 040147c0 1e000002
+ 00010004 a9df0004 014ac01e 00000200 010004a9 df000401 4bc01e00 00020001
+ 0004a9df 0004014c c01e0000 02000100 04a9df00 04014dc0 1e000002 00010004
+ a9df0004 0141c01e 00000200 010004a9 df000401 48c01e00 00020001 0004a9df
+ 00040142 c01e0000 02000100 04a9df00 040143c0 1e000002 00010004 a9df0004
+ 0144c01e c01c0001 00010009 29a00004 c0cbe60a c03b0001 00010009 2c0f0004
+ c0249411 c04a0001 00010009 29a00004 c00505f1 c0590001 00010009 29a00004
+ c0702404 c0680001 00010005 fb5f0004 c629000a c0770001 00010005 fb5f0004
+ c1000e81 c0860001 00010005 fb5f0004 c620400c c0950001 00010005 fb5f0004
+ ca0c1b21 c0a40001 00010009 29a00004 c6290004 c0b30001 00010009 29a00004
+ 803f0235 c0c20001 00010009 29a00004 8009006b c0d10001 00010009 29a00004
+ c021040c c0e00001 00010009 29a00004 80080a5a.
+ +0.002235
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000583
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.966566
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.014201
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228180 00010001 000d000d 00000600 01000006 00010000 d445003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 51800000 02000100
+ 04a9df00 040145c0 1e000002 00010004 a9df0004 0149c01e 00000200 010004a9
+ df000401 46c01e00 00020001 0004a9df 00040147 c01e0000 02000100 04a9df00
+ 04014ac0 1e000002 00010004 a9df0004 014bc01e 00000200 010004a9 df000401
+ 4cc01e00 00020001 0004a9df 0004014d c01e0000 02000100 04a9df00 02c01c00
+ 00020001 0004a9df 00040148 c01e0000 02000100 04a9df00 040142c0 1e000002
+ 00010004 a9df0004 0143c01e 00000200 010004a9 df000401 44c01ec0 65000100
+ 01000929 a00004c0 cbe60ac0 74000100 0100092c 0f0004c0 249411c0 83000100
+ 01000929 a00004c0 0505f1c0 92000100 01000929 a00004c0 702404c0 a1000100
+ 010005fb 5f0004c6 29000ac0 b0000100 010005fb 5f0004c1 000e81c0 bf000100
+ 010005fb 5f0004c6 20400cc0 ce000100 010005fb 5f0004ca 0c1b21c0 1c000100
+ 01000929 a00004c6 290004c0 ea000100 01000929 a0000480 3f0235c0 f9000100
+ 01000929 a0000480 09006bc1 08000100 01000929 a00004c0 21040cc1 17000100
+ 01000929 a0000480 080a5a.
+ +0.002439
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000260
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.949666
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.048060
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31298180 0001000d 0000000d 00000200 01000002 00010004 a9df0014 01490c52
+ 4f4f542d 53455256 45525303 4e455400 00000200 010004a9 df000401 46c01e00
+ 00020001 0004a9df 00040147 c01e0000 02000100 04a9df00 04014ac0 1e000002
+ 00010004 a9df0004 014bc01e 00000200 010004a9 df000401 4cc01e00 00020001
+ 0004a9df 0004014d c01e0000 02000100 04a9df00 040141c0 1e000002 00010004
+ a9df0004 0148c01e 00000200 010004a9 df000401 42c01e00 00020001 0004a9df
+ 00040143 c01e0000 02000100 04a9df00 040144c0 1e000002 00010004 a9df0004
+ 0145c01e c01c0001 00010009 2c0f0004 c0249411 c03b0001 00010009 29a00004
+ c00505f1 c04a0001 00010009 29a00004 c0702404 c0590001 00010005 fb5f0004
+ c629000a c0680001 00010005 fb5f0004 c1000e81 c0770001 00010005 fb5f0004
+ c620400c c0860001 00010005 fb5f0004 ca0c1b21 c0950001 00010009 29a00004
+ c6290004 c0a40001 00010009 29a00004 803f0235 c0b30001 00010009 29a00004
+ 8009006b c0c20001 00010009 29a00004 c021040c c0d10001 00010009 29a00004
+ 80080a5a c0e00001 00010009 29a00004 c0cbe60a.
+ +0.008066
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.001199
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.892341
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.051265
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312c8180 00010001 000d000d 00000600 01000006 00010000 c9a7003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 51800000 02000100
+ 04a9df00 040149c0 1e000002 00010004 a9df0004 0146c01e 00000200 010004a9
+ df000401 47c01e00 00020001 0004a9df 0004014a c01e0000 02000100 04a9df00
+ 04014bc0 1e000002 00010004 a9df0004 014cc01e 00000200 010004a9 df000401
+ 4dc01e00 00020001 0004a9df 0002c01c 00000200 010004a9 df000401 48c01e00
+ 00020001 0004a9df 00040142 c01e0000 02000100 04a9df00 040143c0 1e000002
+ 00010004 a9df0004 0144c01e 00000200 010004a9 df000401 45c01ec0 65000100
+ 0100092c 0f0004c0 249411c0 74000100 01000929 a00004c0 0505f1c0 83000100
+ 01000929 a00004c0 702404c0 92000100 010005fb 5f0004c6 29000ac0 a1000100
+ 010005fb 5f0004c1 000e81c0 b0000100 010005fb 5f0004c6 20400cc0 bf000100
+ 010005fb 5f0004ca 0c1b21c0 1c000100 01000929 a00004c6 290004c0 db000100
+ 01000929 a0000480 3f0235c0 ea000100 01000929 a0000480 09006bc0 f9000100
+ 01000929 a00004c0 21040cc1 08000100 01000929 a0000480 080a5ac1 17000100
+ 01000929 a00004c0 cbe60a.
+ +0.002462
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000257
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.838357
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.022221
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312f8180 0001000d 0000000d 00000200 01000002 00010004 a9df0014 01460c52
+ 4f4f542d 53455256 45525303 4e455400 00000200 010004a9 df000401 47c01e00
+ 00020001 0004a9df 0004014a c01e0000 02000100 04a9df00 04014bc0 1e000002
+ 00010004 a9df0004 014cc01e 00000200 010004a9 df000401 4dc01e00 00020001
+ 0004a9df 00040141 c01e0000 02000100 04a9df00 040148c0 1e000002 00010004
+ a9df0004 0142c01e 00000200 010004a9 df000401 43c01e00 00020001 0004a9df
+ 00040144 c01e0000 02000100 04a9df00 040145c0 1e000002 00010004 a9df0004
+ 0149c01e c01c0001 00010009 29a00004 c00505f1 c03b0001 00010009 29a00004
+ c0702404 c04a0001 00010005 fb5f0004 c629000a c0590001 00010005 fb5f0004
+ c1000e81 c0680001 00010005 fb5f0004 c620400c c0770001 00010005 fb5f0004
+ ca0c1b21 c0860001 00010009 29a00004 c6290004 c0950001 00010009 29a00004
+ 803f0235 c0a40001 00010009 29a00004 8009006b c0b30001 00010009 29a00004
+ c021040c c0c20001 00010009 29a00004 80080a5a c0d10001 00010009 29a00004
+ c0cbe60a c0e00001 00010009 2c0f0004 c0249411.
+ +0.002373
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000502
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.813261
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.014045
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31318180 00010001 000d000d 00000600 01000006 00010000 bf91003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 51800000 02000100
+ 04a9df00 040146c0 1e000002 00010004 a9df0004 0147c01e 00000200 010004a9
+ df000401 4ac01e00 00020001 0004a9df 0004014b c01e0000 02000100 04a9df00
+ 04014cc0 1e000002 00010004 a9df0004 014dc01e 00000200 010004a9 df0002c0
+ 1c000002 00010004 a9df0004 0148c01e 00000200 010004a9 df000401 42c01e00
+ 00020001 0004a9df 00040143 c01e0000 02000100 04a9df00 040144c0 1e000002
+ 00010004 a9df0004 0145c01e 00000200 010004a9 df000401 49c01ec0 65000100
+ 01000929 a00004c0 0505f1c0 74000100 01000929 a00004c0 702404c0 83000100
+ 010005fb 5f0004c6 29000ac0 92000100 010005fb 5f0004c1 000e81c0 a1000100
+ 010005fb 5f0004c6 20400cc0 b0000100 010005fb 5f0004ca 0c1b21c0 1c000100
+ 01000929 a00004c6 290004c0 cc000100 01000929 a0000480 3f0235c0 db000100
+ 01000929 a0000480 09006bc0 ea000100 01000929 a00004c0 21040cc0 f9000100
+ 01000929 a0000480 080a5ac1 08000100 01000929 a00004c0 cbe60ac1 17000100
+ 0100092c 0f0004c0 249411.
+ +0.002429
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000266
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.796521
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.054212
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31388180 0001000d 0000000d 00000200 01000002 00010004 a9df0014 01470c52
+ 4f4f542d 53455256 45525303 4e455400 00000200 010004a9 df000401 4ac01e00
+ 00020001 0004a9df 0004014b c01e0000 02000100 04a9df00 04014cc0 1e000002
+ 00010004 a9df0004 014dc01e 00000200 010004a9 df000401 41c01e00 00020001
+ 0004a9df 00040148 c01e0000 02000100 04a9df00 040142c0 1e000002 00010004
+ a9df0004 0143c01e 00000200 010004a9 df000401 44c01e00 00020001 0004a9df
+ 00040145 c01e0000 02000100 04a9df00 040149c0 1e000002 00010004 a9df0004
+ 0146c01e c01c0001 00010009 29a00004 c0702404 c03b0001 00010005 fb5f0004
+ c629000a c04a0001 00010005 fb5f0004 c1000e81 c0590001 00010005 fb5f0004
+ c620400c c0680001 00010005 fb5f0004 ca0c1b21 c0770001 00010009 29a00004
+ c6290004 c0860001 00010009 29a00004 803f0235 c0950001 00010009 29a00004
+ 8009006b c0a40001 00010009 29a00004 c021040c c0b30001 00010009 29a00004
+ 80080a5a c0c20001 00010009 29a00004 c0cbe60a c0d10001 00010009 2c0f0004
+ c0249411 c0e00001 00010009 29a00004 c00505f1.
+ +0.002233
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.001175
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.738901
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.025228
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313b8180 00010001 000d000d 00000600 01000006 00010000 b5fc003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 51800000 02000100
+ 04a9df00 040147c0 1e000002 00010004 a9df0004 014ac01e 00000200 010004a9
+ df000401 4bc01e00 00020001 0004a9df 0004014c c01e0000 02000100 04a9df00
+ 04014dc0 1e000002 00010004 a9df0002 c01c0000 02000100 04a9df00 040148c0
+ 1e000002 00010004 a9df0004 0142c01e 00000200 010004a9 df000401 43c01e00
+ 00020001 0004a9df 00040144 c01e0000 02000100 04a9df00 040145c0 1e000002
+ 00010004 a9df0004 0149c01e 00000200 010004a9 df000401 46c01ec0 65000100
+ 01000929 a00004c0 702404c0 74000100 010005fb 5f0004c6 29000ac0 83000100
+ 010005fb 5f0004c1 000e81c0 92000100 010005fb 5f0004c6 20400cc0 a1000100
+ 010005fb 5f0004ca 0c1b21c0 1c000100 01000929 a00004c6 290004c0 bd000100
+ 01000929 a0000480 3f0235c0 cc000100 01000929 a0000480 09006bc0 db000100
+ 01000929 a00004c0 21040cc0 ea000100 01000929 a0000480 080a5ac0 f9000100
+ 01000929 a00004c0 cbe60ac1 08000100 0100092c 0f0004c0 249411c1 17000100
+ 01000929 a00004c0 0505f1.
+ +0.002484
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000259
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.710930
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-273743
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.001383
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 00000500 01.
+ sendto=17
+ +0.001121
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000743
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 00000d00 01.
+ sendto=17
+ +0.000688
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000684
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 00001000 01.
+ sendto=17
+ +0.000683
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000683
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000679
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000685
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000681
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000684
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000733
+ sendto fd=4 addr=172.18.45.6:53
+ 31300100 00010000 00000000 00000500 01.
+ sendto=17
+ +0.000710
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000724
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 00000d00 01.
+ sendto=17
+ +0.000688
+ sendto fd=4 addr=172.18.45.6:53
+ 31340100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000685
+ sendto fd=4 addr=172.18.45.6:53
+ 31350100 00010000 00000000 00001000 01.
+ sendto=17
+ +0.000685
+ sendto fd=4 addr=172.18.45.6:53
+ 31360100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000687
+ sendto fd=4 addr=172.18.45.6:53
+ 31370100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000682
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000684
+ sendto fd=4 addr=172.18.45.6:53
+ 313a0100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000825
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000681
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.989843
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-06971
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.001460
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 00000500 01.
+ sendto=17
+ +0.001113
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000732
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 00000d00 01.
+ sendto=17
+ +0.000691
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000684
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 00001000 01.
+ sendto=17
+ +0.000688
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000688
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000683
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000687
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000716
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000687
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000682
+ sendto fd=4 addr=172.18.45.6:53
+ 31300100 00010000 00000000 00000500 01.
+ sendto=17
+ +0.000709
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000721
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 00000d00 01.
+ sendto=17
+ +0.000689
+ sendto fd=4 addr=172.18.45.6:53
+ 31340100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000686
+ sendto fd=4 addr=172.18.45.6:53
+ 31350100 00010000 00000000 00001000 01.
+ sendto=17
+ +0.000683
+ sendto fd=4 addr=172.18.45.6:53
+ 31360100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000687
+ sendto fd=4 addr=172.18.45.6:53
+ 31370100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000679
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000708
+ sendto fd=4 addr=172.18.45.6:53
+ 313a0100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000683
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000682
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.989780
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-06911
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.001256
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 00000500 01.
+ sendto=17
+ +0.000762
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000685
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 00000d00 01.
+ sendto=17
+ +0.000686
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000680
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 00001000 01.
+ sendto=17
+ +0.000680
+ sendto fd=4 addr=172.18.45.6:53
+ 31270100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000680
+ sendto fd=4 addr=172.18.45.6:53
+ 31280100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000714
+ sendto fd=4 addr=172.18.45.6:53
+ 312a0100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000683
+ sendto fd=4 addr=172.18.45.6:53
+ 312b0100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000683
+ sendto fd=4 addr=172.18.45.6:53
+ 312d0100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000800
+ sendto fd=4 addr=172.18.45.6:53
+ 312e0100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000684
+ sendto fd=4 addr=172.18.45.6:53
+ 31300100 00010000 00000000 00000500 01.
+ sendto=17
+ +0.000689
+ sendto fd=4 addr=172.18.45.6:53
+ 31320100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000743
+ sendto fd=4 addr=172.18.45.6:53
+ 31330100 00010000 00000000 00000d00 01.
+ sendto=17
+ +0.000690
+ sendto fd=4 addr=172.18.45.6:53
+ 31340100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.002905
+ sendto fd=4 addr=172.18.45.6:53
+ 31350100 00010000 00000000 00001000 01.
+ sendto=17
+ +0.000746
+ sendto fd=4 addr=172.18.45.6:53
+ 31360100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000721
+ sendto fd=4 addr=172.18.45.6:53
+ 31370100 00010000 00000000 00000100 01.
+ sendto=17
+ +0.000680
+ sendto fd=4 addr=172.18.45.6:53
+ 31390100 00010000 00000000 00000c00 01.
+ sendto=17
+ +0.000681
+ sendto fd=4 addr=172.18.45.6:53
+ 313a0100 00010000 00000000 00000f00 01.
+ sendto=17
+ +0.000679
+ sendto fd=4 addr=172.18.45.6:53
+ 313c0100 00010000 00000000 00001100 01.
+ sendto=17
+ +0.000678
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.990318
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.010527
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238180 00010000 00010000 00000c00 01000006 00010000 0258003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000578
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000147
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.970543
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.014036
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288180 00010000 00010000 00000100 01000006 00010000 0258003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000625
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000126
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.955756
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002329
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8180 00010000 00010000 00000c00 01000006 00010000 0258003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000570
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000117
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.952740
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.020912
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312e8180 00010000 00010000 00000100 01000006 00010000 0258003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000572
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000147
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.931109
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004638
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31328180 00010000 00010000 00000c00 01000006 00010000 0258003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000569
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000120
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.925782
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003203
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31338180 00010000 00010000 00000d00 01000006 00010000 0258003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000598
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000341
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.921640
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.024117
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31378180 00010000 00010000 00000100 01000006 00010000 0258003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000570
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000121
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.896832
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002571
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31398180 00010000 00010000 00000c00 01000006 00010000 0258003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.002011
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000202
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.892048
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.002074
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313a8180 00010000 00010000 00000f00 01000006 00010000 0258003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000566
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000121
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.889287
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.160358
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 313c8180 00010000 00010000 00001100 01000006 00010000 0258003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000591
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000127
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.728211
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-133482
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010000 00010000 00000100 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000623
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000132
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.860938
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.028946
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010000 00010000 00000500 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000593
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000124
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.831275
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039651
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238580 00010000 00010000 00000c00 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000624
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000160
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.790840
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.029121
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248580 00010000 00010000 00000d00 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000596
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000124
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.760999
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.162355
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268580 00010000 00010000 00001000 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000596
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000155
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.597893
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.027725
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31278580 00010000 00010000 00001100 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000589
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000124
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.569455
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.027796
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31288580 00010000 00010000 00000100 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000716
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000199
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.540744
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.028676
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312b8580 00010000 00010000 00000f00 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000588
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000122
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.511358
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.029928
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312a8580 00010000 00010000 00000c00 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000588
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000211
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.480631
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039073
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312d8580 00010000 00010000 00001100 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000777
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000144
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.440637
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.028603
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31308580 00010000 00010000 00000500 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000583
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000123
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.411328
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.028684
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 312e8580 00010000 00010000 00000100 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000603
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000152
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.381889
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.029562
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258580 00010000 00010000 00000f00 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000584
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000123
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.361302
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.029558
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31328580 00010000 00010000 00000c00 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000618
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000151
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.330975
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039234
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31368580 00010000 00010000 00001100 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000585
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000124
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.291032
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.029095
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238580 00010000 00010000 00000c00 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000602
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000180
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.261155
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.029292
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31338580 00010000 00010000 00000d00 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000601
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000149
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.231113
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-967500
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31358580 00010000 00010000 00001000 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000602
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000153
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.197858
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.026021
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31378580 00010000 00010000 00000100 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000599
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000150
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.171088
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039664
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31398580 00010000 00010000 00000c00 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000600
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000172
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.130652
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.029223
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31348580 00010000 00010000 00000f00 01000006 00010001 5180003e 01410c52
+ 4f4f542d 53455256 45525303 4e455400 0a686f73 746d6173 74657208 494e5445
+ 524e4943 c02b7726 f4400000 07080000 03840009 3a800001 5180.
+ +0.000583
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000127
+ close fd=4
+ close=OK
+ +0.000982
diff --git a/adns-0.6/regress/case-search-as.err b/adns-0.6/regress/case-search-as.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-search-as.err
diff --git a/adns-0.6/regress/case-search-as.out b/adns-0.6/regress/case-search-as.out
new file mode 100644
index 0000000..95e15a5
--- /dev/null
+++ b/adns-0.6/regress/case-search-as.out
@@ -0,0 +1,14 @@
+adns debug: using nameserver 172.18.45.6
+news flags 5 type 1 A(-) submitted
+chiark flags 5 type 1 A(-) submitted
+news flags 1 type 1 A(-) submitted
+chiark flags 1 type 1 A(-) submitted
+news flags 5 type A(-): OK; nrrs=1; cname=davenant.relativity.greenend.org.uk; owner=news.davenant.greenend.org.uk; ttl=86400
+ 172.18.45.6
+news flags 1 type A(-): OK; nrrs=1; cname=davenant.relativity.greenend.org.uk; owner=$; ttl=86400
+ 172.18.45.6
+chiark flags 5 type A(-): OK; nrrs=1; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+ 195.224.76.132
+chiark flags 1 type A(-): OK; nrrs=1; cname=$; owner=$; ttl=86400
+ 195.224.76.132
+rc=0
diff --git a/adns-0.6/regress/case-search-as.sys b/adns-0.6/regress/case-search-as.sys
new file mode 100644
index 0000000..c741d41
--- /dev/null
+++ b/adns-0.6/regress/case-search-as.sys
@@ -0,0 +1,131 @@
+default
+:1 0x5/news 0x5/chiark 1/news 1/chiark
+ start 931992052.232208
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000202
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000109
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000065
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001.
+ sendto=47
+ +0.000696
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 06636869 61726b08 64617665 6e616e74 08677265
+ 656e656e 64036f72 6702756b 00000100 01.
+ sendto=49
+ +0.000559
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001.
+ sendto=47
+ +0.000991
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 06636869 61726b08 64617665 6e616e74 08677265
+ 656e656e 64036f72 6702756b 00000100 01.
+ sendto=49
+ +0.000516
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997238
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019885
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010002 00030003 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001c0 0c000500 01000151 80002508 64617665
+ 6e616e74 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ c03b0001 00010001 51800004 ac122d06 c0440002 00010001 51800006 036e7330
+ c044c044 00020001 00015180 0006036e 7331c044 c0440002 00010001 51800006
+ 036e7332 c044c07c 00010001 00015180 0004ac12 2d06c08e 00010001 00015180
+ 0004ac12 2d41c0a0 00010001 00015180 0004ac12 2d01.
+ +0.001537
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000296
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.976216
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001966
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208583 00010000 00010000 06636869 61726b08 64617665 6e616e74 08677265
+ 656e656e 64036f72 6702756b 00000100 01086772 65656e65 6e64036f 72670275
+ 6b000006 00010001 5180002d 026e7306 63686961 726bc031 0a686f73 746d6173
+ 746572c0 31772741 34000070 8000001c 2000093a 80000151 80.
+ +0.000819
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000471
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000102
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.973417
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.006224
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010002 00030003 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001c0 0c000500 01000151 80002508 64617665
+ 6e616e74 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ c03b0001 00010001 51800004 ac122d06 c0440002 00010001 51800006 036e7330
+ c044c044 00020001 00015180 0006036e 7331c044 c0440002 00010001 51800006
+ 036e7332 c044c07c 00010001 00015180 0004ac12 2d06c08e 00010001 00015180
+ 0004ac12 2d41c0a0 00010001 00015180 0004ac12 2d01.
+ +0.001353
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000239
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.966592
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001978
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228583 00010000 00010000 06636869 61726b08 64617665 6e616e74 08677265
+ 656e656e 64036f72 6702756b 00000100 01086772 65656e65 6e64036f 72670275
+ 6b000006 00010001 5180002d 026e7306 63686961 726bc031 0a686f73 746d6173
+ 746572c0 31772741 34000070 8000001c 2000093a 80000151 80.
+ +0.000817
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000436
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000101
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.987460
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004418
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+ 64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+ 7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+ 0004ac12 2d06c070 00010001 00015180 0004ac12 2d41.
+ +0.000982
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000180
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.993066
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003953
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+ 64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+ 7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+ 0004ac12 2d06c070 00010001 00015180 0004ac12 2d41.
+ +0.000986
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000143
+ close fd=4
+ close=OK
+ +0.000193
diff --git a/adns-0.6/regress/case-search.err b/adns-0.6/regress/case-search.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-search.err
diff --git a/adns-0.6/regress/case-search.out b/adns-0.6/regress/case-search.out
new file mode 100644
index 0000000..35e0367
--- /dev/null
+++ b/adns-0.6/regress/case-search.out
@@ -0,0 +1,14 @@
+adns debug: using nameserver 172.18.45.6
+news flags 5 type 1 A(-) submitted
+chiark flags 5 type 1 A(-) submitted
+news flags 1 type 1 A(-) submitted
+chiark flags 1 type 1 A(-) submitted
+news flags 5 type A(-): OK; nrrs=1; cname=davenant.relativity.greenend.org.uk; owner=news.davenant.greenend.org.uk; ttl=86400
+ 172.18.45.6
+chiark flags 5 type A(-): OK; nrrs=1; cname=$; owner=chiark.greenend.org.uk; ttl=86400
+ 195.224.76.132
+news flags 1 type A(-): OK; nrrs=1; cname=davenant.relativity.greenend.org.uk; owner=$; ttl=86400
+ 172.18.45.6
+chiark flags 1 type A(-): OK; nrrs=1; cname=$; owner=$; ttl=86400
+ 195.224.76.132
+rc=0
diff --git a/adns-0.6/regress/case-search.sys b/adns-0.6/regress/case-search.sys
new file mode 100644
index 0000000..1cbc301
--- /dev/null
+++ b/adns-0.6/regress/case-search.sys
@@ -0,0 +1,133 @@
+default -,s
+:1 0x5/news 0x5/chiark 1/news 1/chiark
+ start 924360470.478357
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000200
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000084
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000067
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001.
+ sendto=47
+ +0.001994
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 06636869 61726b08 64617665 6e616e74 08677265
+ 656e656e 64036f72 6702756b 00000100 01.
+ sendto=49
+ +0.001461
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001.
+ sendto=47
+ +0.001029
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 06636869 61726b08 64617665 6e616e74 08677265
+ 656e656e 64036f72 6702756b 00000100 01.
+ sendto=49
+ +0.000984
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.994532
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004691
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010002 00030003 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001c0 0c000500 01000151 80002508 64617665
+ 6e616e74 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ c03b0001 00010001 51800004 ac122d06 c0440002 00010001 51800006 036e7330
+ c044c044 00020001 00015180 0006036e 7331c044 c0440002 00010001 51800006
+ 036e7332 c044c07c 00010001 00015180 0004ac12 2d06c08e 00010001 00015180
+ 0004ac12 2d41c0a0 00010001 00015180 0004ac12 2d01.
+ +0.001460
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000295
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.990080
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.001032
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208583 00010000 00010000 06636869 61726b08 64617665 6e616e74 08677265
+ 656e656e 64036f72 6702756b 00000100 01086772 65656e65 6e64036f 72670275
+ 6b000006 00010001 51800037 04646e73 3006656c 6d61696c 02636fc0 3e087269
+ 63686172 646b0663 68696172 6bc03177 26f0bf00 00708000 001c2000 093a8000
+ 015180.
+ +0.000739
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000925
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000101
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.988744
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005215
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010002 00030003 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001c0 0c000500 01000151 80002508 64617665
+ 6e616e74 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ c03b0001 00010001 51800004 ac122d06 c0440002 00010001 51800006 036e7330
+ c044c044 00020001 00015180 0006036e 7331c044 c0440002 00010001 51800006
+ 036e7332 c044c07c 00010001 00015180 0004ac12 2d06c08e 00010001 00015180
+ 0004ac12 2d41c0a0 00010001 00015180 0004ac12 2d01.
+ +0.001514
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000264
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.982780
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000850
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228583 00010000 00010000 06636869 61726b08 64617665 6e616e74 08677265
+ 656e656e 64036f72 6702756b 00000100 01086772 65656e65 6e64036f 72670275
+ 6b000006 00010001 51800037 04646e73 3006656c 6d61696c 02636fc0 3e087269
+ 63686172 646b0663 68696172 6bc03177 26f0bf00 00708000 001c2000 093a8000
+ 015180.
+ +0.000739
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000884
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000101
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.988668
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003228
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+ 64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+ 7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+ 0004ac12 2d06c070 00010001 00015180 0004ac12 2d41.
+ +0.000828
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000194
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.994026
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003357
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248580 00010001 00020002 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001 c00c0001 00010001 51800004 c3e04c84 08677265 656e656e
+ 64036f72 6702756b 00000200 01000151 80001103 6e73300a 72656c61 74697669
+ 7479c038 c0380002 00010001 51800006 036e7331 c057c053 00010001 00015180
+ 0004ac12 2d06c070 00010001 00015180 0004ac12 2d41.
+ +0.000828
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000155
+ close fd=4
+ close=OK
+ +0.000171
diff --git a/adns-0.6/regress/case-searchabs.err b/adns-0.6/regress/case-searchabs.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-searchabs.err
diff --git a/adns-0.6/regress/case-searchabs.out b/adns-0.6/regress/case-searchabs.out
new file mode 100644
index 0000000..5fb6b51
--- /dev/null
+++ b/adns-0.6/regress/case-searchabs.out
@@ -0,0 +1,5 @@
+adns debug: using nameserver 172.18.45.6
+news.davenant flags 1 type 1 A(-) submitted
+news.davenant flags 1 type A(-): OK; nrrs=1; cname=davenant.relativity.greenend.org.uk; owner=$; ttl=584
+ 172.18.45.6
+rc=0
diff --git a/adns-0.6/regress/case-searchabs.sys b/adns-0.6/regress/case-searchabs.sys
new file mode 100644
index 0000000..9899ffd
--- /dev/null
+++ b/adns-0.6/regress/case-searchabs.sys
@@ -0,0 +1,72 @@
+default
+:1 1/news.davenant
+ start 924363451.882765
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000207
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000088
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000071
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 046e6577 73086461 76656e61 6e740000 010001.
+ sendto=31
+ +0.001846
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998154
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004592
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8583 00010000 00010000 046e6577 73086461 76656e61 6e740000 01000100
+ 00060001 00000248 003e0141 0c524f4f 542d5345 52564552 53034e45 54000a68
+ 6f73746d 61737465 7208494e 5445524e 4943c039 7726f440 00000708 00000384
+ 00093a80 00015180.
+ +0.000697
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 046e6577 73086461 76656e61 6e740864 6176656e
+ 616e7408 67726565 6e656e64 036f7267 02756b00 00010001.
+ sendto=56
+ +0.001073
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000105
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998125
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003727
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208583 00010000 00010000 046e6577 73086461 76656e61 6e740864 6176656e
+ 616e7408 67726565 6e656e64 036f7267 02756b00 00010001 08677265 656e656e
+ 64036f72 6702756b 00000600 01000151 80003704 646e7330 06656c6d 61696c02
+ 636fc045 08726963 68617264 6b066368 6961726b c0387726 f0bf0000 70800000
+ 1c200009 3a800001 5180.
+ +0.000972
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001.
+ sendto=47
+ +0.000965
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000105
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997958
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.007222
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010002 00030003 046e6577 73086461 76656e61 6e740867 7265656e
+ 656e6403 6f726702 756b0000 010001c0 0c000500 01000151 80002508 64617665
+ 6e616e74 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ c03b0001 00010001 51800004 ac122d06 c0440002 00010001 51800006 036e7330
+ c044c044 00020001 00015180 0006036e 7331c044 c0440002 00010001 51800006
+ 036e7332 c044c07c 00010001 00015180 0004ac12 2d06c08e 00010001 00015180
+ 0004ac12 2d41c0a0 00010001 00015180 0004ac12 2d01.
+ +0.001124
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000295
+ close fd=4
+ close=OK
+ +0.000221
diff --git a/adns-0.6/regress/case-sillyrp.err b/adns-0.6/regress/case-sillyrp.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-sillyrp.err
diff --git a/adns-0.6/regress/case-sillyrp.out b/adns-0.6/regress/case-sillyrp.out
new file mode 100644
index 0000000..f947914
--- /dev/null
+++ b/adns-0.6/regress/case-sillyrp.out
@@ -0,0 +1,22 @@
+adns debug: using nameserver 172.18.45.6
+silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 112 type 17 RP(raw) submitted
+silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 112 type 131089 RP(822) submitted
+silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 112 type 17 RP(raw) submitted
+silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 112 type 131089 RP(822) submitted
+silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 0 type 17 RP(raw) submitted
+silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 0 type 131089 RP(822) submitted
+silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 0 type 17 RP(raw) submitted
+silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 0 type 131089 RP(822) submitted
+silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 112 type RP(raw): OK; nrrs=1; cname=$; owner=$; ttl=60
+ i\..root\000null.org .
+silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 112 type RP(822): Found syntactically invalid domain name; nrrs=0; cname=$; owner=$; ttl=60
+silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 112 type RP(raw): OK; nrrs=1; cname=$; owner=$; ttl=60
+ spong\000flibble.ucam.org .
+silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 112 type RP(822): Found invalid DNS data; nrrs=0; cname=$; owner=$; ttl=60
+silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 0 type RP(raw): OK; nrrs=1; cname=$; owner=$; ttl=60
+ spong\000flibble.ucam.org .
+silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 0 type RP(822): Found invalid DNS data; nrrs=0; cname=$; owner=$; ttl=60
+silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 0 type RP(raw): OK; nrrs=1; cname=$; owner=$; ttl=60
+ i\..root\000null.org .
+silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 0 type RP(822): Found syntactically invalid domain name; nrrs=0; cname=$; owner=$; ttl=60
+rc=0
diff --git a/adns-0.6/regress/case-sillyrp.sys b/adns-0.6/regress/case-sillyrp.sys
new file mode 100644
index 0000000..2b28a49
--- /dev/null
+++ b/adns-0.6/regress/case-sillyrp.sys
@@ -0,0 +1,183 @@
+default
+:17,131089 0x70/silly-rp-dm.test.iwj.relativity.greenend.org.uk 0x70/silly-rp-lp.test.iwj.relativity.greenend.org.uk silly-rp-lp.test.iwj.relativity.greenend.org.uk silly-rp-dm.test.iwj.relativity.greenend.org.uk
+ start 929580348.131048
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000207
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000086
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000061
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 0b73696c 6c792d72 702d646d 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=65
+ +0.000768
+ sendto fd=4 addr=172.18.45.6:53
+ 31200100 00010000 00000000 0b73696c 6c792d72 702d646d 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=65
+ +0.001010
+ sendto fd=4 addr=172.18.45.6:53
+ 31210100 00010000 00000000 0b73696c 6c792d72 702d6c70 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=65
+ +0.000607
+ sendto fd=4 addr=172.18.45.6:53
+ 31220100 00010000 00000000 0b73696c 6c792d72 702d6c70 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=65
+ +0.000543
+ sendto fd=4 addr=172.18.45.6:53
+ 31230100 00010000 00000000 0b73696c 6c792d72 702d6c70 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=65
+ +0.000544
+ sendto fd=4 addr=172.18.45.6:53
+ 31240100 00010000 00000000 0b73696c 6c792d72 702d6c70 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=65
+ +0.000535
+ sendto fd=4 addr=172.18.45.6:53
+ 31250100 00010000 00000000 0b73696c 6c792d72 702d646d 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=65
+ +0.000538
+ sendto fd=4 addr=172.18.45.6:53
+ 31260100 00010000 00000000 0b73696c 6c792d72 702d646d 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01.
+ sendto=65
+ +0.000569
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.994886
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005696
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010001 00010001 0b73696c 6c792d72 702d646d 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01c00c00 11000100 00003c00 1302692e 09726f6f 74006e75 6c6c036f 72670000
+ 04746573 74036977 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72
+ 6702756b 00000200 01000000 3c000603 6e7330c0 69c08f00 01000100 01518000
+ 04ac122d 06.
+ +0.000936
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000308
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.988714
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003951
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31208580 00010001 00010001 0b73696c 6c792d72 702d646d 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01c00c00 11000100 00003c00 1302692e 09726f6f 74006e75 6c6c036f 72670000
+ 04746573 74036977 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72
+ 6702756b 00000200 01000000 3c000603 6e7330c0 69c08f00 01000100 01518000
+ 04ac122d 06.
+ +0.000891
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000192
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.984690
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003968
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31218580 00010001 00010001 0b73696c 6c792d72 702d6c70 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01c00c00 11000100 00003c00 190d7370 6f6e6700 666c6962 626c6504 7563616d
+ 036f7267 00000474 65737403 69776a0a 72656c61 74697669 74790867 7265656e
+ 656e6403 6f726702 756b0000 02000100 00003c00 06036e73 30c06fc0 95000100
+ 01000151 800004ac 122d06.
+ +0.000915
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000193
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.980221
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004041
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31228580 00010001 00010001 0b73696c 6c792d72 702d6c70 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01c00c00 11000100 00003c00 190d7370 6f6e6700 666c6962 626c6504 7563616d
+ 036f7267 00000474 65737403 69776a0a 72656c61 74697669 74790867 7265656e
+ 656e6403 6f726702 756b0000 02000100 00003c00 06036e73 30c06fc0 95000100
+ 01000151 800004ac 122d06.
+ +0.000915
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000154
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.975654
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.003970
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31238580 00010001 00010001 0b73696c 6c792d72 702d6c70 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01c00c00 11000100 00003c00 190d7370 6f6e6700 666c6962 626c6504 7563616d
+ 036f7267 00000474 65737403 69776a0a 72656c61 74697669 74790867 7265656e
+ 656e6403 6f726702 756b0000 02000100 00003c00 06036e73 30c06fc0 95000100
+ 01000151 800004ac 122d06.
+ +0.000911
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000173
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.971144
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005737
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31248580 00010001 00010001 0b73696c 6c792d72 702d6c70 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01c00c00 11000100 00003c00 190d7370 6f6e6700 666c6962 626c6504 7563616d
+ 036f7267 00000474 65737403 69776a0a 72656c61 74697669 74790867 7265656e
+ 656e6403 6f726702 756b0000 02000100 00003c00 06036e73 30c06fc0 95000100
+ 01000151 800004ac 122d06.
+ +0.000914
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000151
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.964877
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004001
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31258580 00010001 00010001 0b73696c 6c792d72 702d646d 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01c00c00 11000100 00003c00 1302692e 09726f6f 74006e75 6c6c036f 72670000
+ 04746573 74036977 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72
+ 6702756b 00000200 01000000 3c000603 6e7330c0 69c08f00 01000100 01518000
+ 04ac122d 06.
+ +0.000911
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000155
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.960348
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004043
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 31268580 00010001 00010001 0b73696c 6c792d72 702d646d 04746573 74036977
+ 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00001100
+ 01c00c00 11000100 00003c00 1302692e 09726f6f 74006e75 6c6c036f 72670000
+ 04746573 74036977 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72
+ 6702756b 00000200 01000000 3c000603 6e7330c0 69c08f00 01000100 01518000
+ 04ac122d 06.
+ +0.000886
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000191
+ close fd=4
+ close=OK
+ +0.000160
diff --git a/adns-0.6/regress/case-tcpmultipart.err b/adns-0.6/regress/case-tcpmultipart.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-tcpmultipart.err
diff --git a/adns-0.6/regress/case-tcpmultipart.out b/adns-0.6/regress/case-tcpmultipart.out
new file mode 100644
index 0000000..3a7a124
--- /dev/null
+++ b/adns-0.6/regress/case-tcpmultipart.out
@@ -0,0 +1,71 @@
+adns debug: using nameserver 172.31.80.9
+132.76.224.195.in-addr.arpa flags 2 type 12 PTR(raw) submitted
+manymorerrs.test.culture.dotat.at. flags 2 type 12 PTR(raw) submitted
+132.76.224.195.in-addr.arpa flags 2 type 12 PTR(raw) submitted
+adns debug: TCP connected (NS=172.31.80.9)
+132.76.224.195.in-addr.arpa flags 2 type PTR(raw): OK; nrrs=1; cname=$; owner=$; ttl=86400
+ chiark.greenend.org.uk
+manymorerrs.test.culture.dotat.at. flags 2 type PTR(raw): OK; nrrs=60; cname=$; owner=$; ttl=86400
+ very-long-domain.to-ensure-truncation.00.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.01.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.02.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.03.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.04.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.05.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.06.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.07.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.08.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.09.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.10.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.11.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.12.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.13.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.14.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.15.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.16.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.17.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.18.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.19.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.20.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.21.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.22.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.23.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.24.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.25.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.26.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.27.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.28.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.29.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.30.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.31.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.32.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.33.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.34.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.35.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.36.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.37.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.38.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.39.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.40.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.41.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.42.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.43.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.44.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.45.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.46.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.47.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.48.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.49.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.50.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.51.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.52.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.53.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.54.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.55.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.56.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.57.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.58.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.59.test.culture.dotat.at
+132.76.224.195.in-addr.arpa flags 2 type PTR(raw): OK; nrrs=1; cname=$; owner=$; ttl=86400
+ chiark.greenend.org.uk
+rc=0
diff --git a/adns-0.6/regress/case-tcpmultipart.sys b/adns-0.6/regress/case-tcpmultipart.sys
new file mode 100644
index 0000000..bdc3f78
--- /dev/null
+++ b/adns-0.6/regress/case-tcpmultipart.sys
@@ -0,0 +1,248 @@
+tunnel
+:12 2/132.76.224.195.in-addr.arpa 2/manymorerrs.test.culture.dotat.at. 2/132.76.224.195.in-addr.arpa
+ start 938365454.994875
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000164
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000055
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000043
+ socket type=SOCK_STREAM
+ socket=5
+ +0.001177
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000044
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000041
+ connect fd=5 addr=172.31.80.9:53
+ connect=EINPROGRESS
+ +0.000414
+ select max=6 rfds=[4] wfds=[5] efds=[] to=13.998324
+ select=1 rfds=[] wfds=[5] efds=[]
+ +1.-647444
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000176
+ write fd=5
+ 002d311f 01000001 00000000 00000331 33320237 36033232 34033139 3507696e
+ 2d616464 72046172 70610000 0c0001.
+ write=47
+ +0.000727
+ write fd=5
+ 00333120 01000001 00000000 00000b6d 616e796d 6f726572 72730474 65737407
+ 63756c74 75726505 646f7461 74026174 00000c00 01.
+ write=53
+ +0.000359
+ write fd=5
+ 002d3121 01000001 00000000 00000331 33320237 36033232 34033139 3507696e
+ 2d616464 72046172 70610000 0c0001.
+ write=47
+ +0.000273
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.644233
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.538651
+ read fd=5 buflen=2
+ read=OK
+ 0127.
+ +0.000289
+ read fd=5 buflen=295
+ read=OK
+ 311f8580 00010001 00050005 03313332 02373603 32323403 31393507 696e2d61
+ 64647204 61727061 00000c00 01c00c00 0c000100 01518000 18066368 6961726b
+ 08677265 656e656e 64036f72 6702756b 00023736 03323234 03313935 07696e2d
+ 61646472 04617270 61000002 00010001 51800011 04646e73 3006656c 6d61696c
+ 02636fc0 4dc05100 02000100 01518000 0704646e 7331c079 c0510002 00010001
+ 51800007 04646e73 32c079c0 51000200 01000151 80000e03 6e733204 78617261
+ 036e6574 00c05100 02000100 01518000 06036e73 33c0bbc0 74000100 01000055
+ c80004c1 7ae911c0 91000100 0100004f 650004c1 7ae901c0 a4000100 0100004f
+ 650004c3 e04cc1c0 b7000100 0100014c 4b0004c2 8fa16bc0 d1000100 0100014c
+ 4b0004c2 8fa319.
+ +0.001247
+ read fd=5 buflen=297
+ read=EAGAIN
+ +0.000476
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.105246
+ select=1 rfds=[5] wfds=[] efds=[]
+ +1.-401146
+ read fd=5 buflen=297
+ read=OK
+ 0dbe3120 85800001 003c0002 00020b6d 616e796d 6f726572 72730474 65737407
+ 63756c74 75726505 646f7461 74026174 00000c00 01c00c00 0c000100 01518000
+ 40107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275
+ 6e636174 696f6e02 30300474 65737407 63756c74 75726505 646f7461 74026174
+ 00c00c00 0c000100 01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474
+ 6f2d656e 73757265 2d747275 6e636174 696f6e02 3031c068 c00c000c 00010001
+ 5180002b 10766572 792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d
+ 7472756e 63617469 6f6e0230 32c068c0 0c000c00 01000151 80002b10 76657279
+ 2d6c6f6e 672d646f 6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f
+ 6e023033 c068c00c 00.
+ +0.001076
+ read fd=5 buflen=3223
+ read=OK
+ 0c000100 01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e
+ 73757265 2d747275 6e636174 696f6e02 3034c068 c00c000c 00010001 5180002b
+ 10766572 792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e
+ 63617469 6f6e0230 35c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e
+ 672d646f 6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023036
+ c068c00c 000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14
+ 746f2d65 6e737572 652d7472 756e6361 74696f6e 023037c0 68c00c00 0c000100
+ 01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265
+ 2d747275 6e636174 696f6e02 3038c068 c00c000c 00010001 5180002b 10766572
+ 792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469
+ 6f6e0230 39c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f
+ 6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023130 c068c00c
+ 000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65
+ 6e737572 652d7472 756e6361 74696f6e 023131c0 68c00c00 0c000100 01518000
+ 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275
+ 6e636174 696f6e02 3132c068 c00c000c 00010001 5180002b 10766572 792d6c6f
+ 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0231
+ 33c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e
+ 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023134 c068c00c 000c0001
+ 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572
+ 652d7472 756e6361 74696f.
+ +0.002411
+ read fd=5 buflen=2572
+ read=EAGAIN
+ +0.000101
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=28.502804
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.336462
+ read fd=5 buflen=2572
+ read=OK
+ 6e023135 c068c00c 000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d
+ 61696e14 746f2d65 6e737572 652d7472 756e6361 74696f6e 023136c0 68c00c00
+ 0c000100 01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e
+ 73757265 2d747275 6e636174 696f6e02 3137c068 c00c000c 00010001 5180002b
+ 10766572 792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e
+ 63617469 6f6e0231 38c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e
+ 672d646f 6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023139
+ c068c00c 000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14
+ 746f2d65 6e737572 652d7472 756e6361 74696f6e 023230c0 68c00c00 0c000100
+ 01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265
+ 2d747275 6e636174 696f6e02 3231c068 c00c000c 00010001 5180002b 10766572
+ 792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469
+ 6f6e0232 32c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f
+ 6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023233 c068c00c
+ 000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65
+ 6e737572 652d7472 756e6361 74696f6e 023234c0 68c00c00 0c000100 01518000
+ 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275
+ 6e636174 696f6e02 3235c068 c00c000c 00010001 5180002b 10766572 792d6c6f
+ 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0232
+ 36c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e
+ 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023237 c068c00c 000c0001
+ 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572
+ 652d7472 756e6361 74696f6e 023238c0 68c00c00 0c000100 01518000 2b107665
+ 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174
+ 696f6e02 3239c068 c00c000c 00010001 5180002b 10766572 792d6c6f 6e672d64
+ 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0233 30c068c0
+ 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e 14746f2d
+ 656e7375 72652d74 72756e63 6174696f 6e023331 c068c00c 000c0001 00015180
+ 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572 652d7472
+ 756e6361 74696f6e 023332c0 68c00c00 0c000100.
+ +0.003315
+ read fd=5 buflen=1624
+ read=EAGAIN
+ +0.000124
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=28.162903
+ select=1 rfds=[5] wfds=[] efds=[]
+ +1.-683589
+ read fd=5 buflen=1624
+ read=OK
+ 01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265
+ 2d747275 6e636174 696f6e02 3333c068 c00c000c 00010001 5180002b 10766572
+ 792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469
+ 6f6e0233 34c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f
+ 6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023335 c068c00c
+ 000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65
+ 6e737572 652d7472 756e6361 74696f6e 023336c0 68c00c00 0c000100 01518000
+ 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275
+ 6e636174 696f6e02 3337c068 c00c000c 00010001 5180002b 10766572 792d6c6f
+ 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0233
+ 38c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e
+ 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023339 c068c00c 000c0001
+ 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572
+ 652d7472 756e6361 74696f6e 023430c0 68c00c00 0c000100 01518000 2b107665
+ 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174
+ 696f6e02 3431c068 c00c000c 00010001 5180002b 10766572 792d6c6f 6e672d64
+ 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0234 32c068c0
+ 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e 14746f2d
+ 656e7375 72652d74 72756e63 6174696f 6e023433 c068c00c 000c0001 00015180
+ 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572 652d7472
+ 756e6361 74696f6e 023434c0 68c00c00 0c000100 01518000 2b107665 72792d6c
+ 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174 696f6e02
+ 3435c068 c00c000c 00010001 5180002b 10766572 792d6c6f 6e672d64 6f6d6169
+ 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0234 36c068c0 0c000c00
+ 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e 14746f2d 656e7375
+ 72652d74 72756e63 6174696f 6e023437 c068c00c 000c0001 00015180 002b1076
+ 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572 652d7472 756e6361
+ 74696f6e 023438c0 68c00c00 0c000100 01518000 2b107665 72792d6c 6f6e672d
+ 646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174 696f6e02 3439c068
+ c00c000c 00010001 5180002b 10766572 792d6c6f.
+ +0.003201
+ read fd=5 buflen=676
+ read=EAGAIN
+ +0.000114
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=27.843177
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.376863
+ read fd=5 buflen=676
+ read=OK
+ 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0235
+ 30c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e
+ 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023531 c068c00c 000c0001
+ 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572
+ 652d7472 756e6361 74696f6e 023532c0 68c00c00 0c000100 01518000 2b107665
+ 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174
+ 696f6e02 3533c068 c00c000c 00010001 5180002b 10766572 792d6c6f 6e672d64
+ 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0235 34c068c0
+ 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e 14746f2d
+ 656e7375 72652d74 72756e63 6174696f 6e023535 c068c00c 000c0001 00015180
+ 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572 652d7472
+ 756e6361 74696f6e 023536c0 68c00c00 0c000100 01518000 2b107665 72792d6c
+ 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174 696f6e02
+ 3537c068 c00c000c 00010001 5180002b 10766572 792d6c6f 6e672d64 6f6d6169
+ 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0235 38c068c0 0c000c00
+ 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e 14746f2d 656e7375
+ 72652d74 72756e63 6174696f 6e023539 c068c06d 00020001 00054600 0014076c
+ 69627261 7279066c 73706163 65036f72 6700c06d 00020001 00054600 001b026e
+ 73066368 6961726b 08677265 656e656e 64036f72 6702756b 00076c69 62726172
+ 79066c73 70616365 036f7267 00000100 01000161 890004c3 c8013a02 6e730663
+ 68696172 6b086772 65656e65 6e64036f 72670275 6b000001 00010001 51800004
+ c3e04c84.
+ +0.002355
+ read fd=5 buflen=3520
+ read=OK
+ 01273121 85800001 00010005 00050331 33320237 36033232 34033139 3507696e
+ 2d616464 72046172 70610000 0c0001c0 0c000c00 01000151 80001806 63686961
+ 726b0867 7265656e 656e6403 6f726702 756b0002 37360332 32340331 39350769
+ 6e2d6164 64720461 72706100 00020001 00015180 00110464 6e733006 656c6d61
+ 696c0263 6fc04dc0 51000200 01000151 80000704 646e7331 c079c051 00020001
+ 00015180 00070464 6e7332c0 79c05100 02000100 01518000 0e036e73 32047861
+ 7261036e 657400c0 51000200 01000151 80000603 6e7333c0 bbc07400 01000100
+ 0055c800 04c17ae9 11c09100 01000100 004f6500 04c17ae9 01c0a400 01000100
+ 004f6500 04c3e04c c1c0b700 01000100.
+ +0.009447
+ read fd=5 buflen=3248
+ read=EAGAIN
+ +0.000066
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=27.454446
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.316770
+ read fd=5 buflen=3248
+ read=OK
+ 014c4b00 04c28fa1 6bc0d100 01000100 014c4b00 04c28fa3 19.
+ +0.000195
+ read fd=5 buflen=3520
+ read=EAGAIN
+ +0.000429
+ close fd=4
+ close=OK
+ +0.000375
+ close fd=5
+ close=OK
+ +0.000226
diff --git a/adns-0.6/regress/case-timeout.err b/adns-0.6/regress/case-timeout.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-timeout.err
diff --git a/adns-0.6/regress/case-timeout.out b/adns-0.6/regress/case-timeout.out
new file mode 100644
index 0000000..a3f7495
--- /dev/null
+++ b/adns-0.6/regress/case-timeout.out
@@ -0,0 +1,4 @@
+adns debug: using nameserver 172.18.45.36
+chiark.greenend.org.uk flags 0 type 1 A(-) submitted
+chiark.greenend.org.uk flags 0 type A(-): DNS query timed out; nrrs=0; cname=$; owner=$; ttl=604770
+rc=0
diff --git a/adns-0.6/regress/case-timeout.sys b/adns-0.6/regress/case-timeout.sys
new file mode 100644
index 0000000..003d1ca
--- /dev/null
+++ b/adns-0.6/regress/case-timeout.sys
@@ -0,0 +1,135 @@
+noserver
+:1 chiark.greenend.org.uk
+ start 912889153.349504
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000193
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000088
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000072
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000617
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999383
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008683
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000406
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999594
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009544
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000428
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999572
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009567
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000449
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999551
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009551
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000381
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999619
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009614
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000383
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999617
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009622
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000387
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999613
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009603
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000404
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999596
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009607
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000468
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999532
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009526
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000431
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999569
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009564
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000429
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999571
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009586
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000479
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999521
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009511
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000430
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999570
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009571
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000440
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999560
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009564
+ sendto fd=4 addr=172.18.45.36:53
+ 311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+ 02756b00 00010001.
+ sendto=40
+ +0.000439
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999561
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.009554
+ close fd=4
+ close=OK
+ +0.000267
diff --git a/adns-0.6/regress/case-trunc.err b/adns-0.6/regress/case-trunc.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-trunc.err
diff --git a/adns-0.6/regress/case-trunc.out b/adns-0.6/regress/case-trunc.out
new file mode 100644
index 0000000..bd70e05
--- /dev/null
+++ b/adns-0.6/regress/case-trunc.out
@@ -0,0 +1,4 @@
+adns debug: using nameserver 172.18.45.6
+trunc.test.iwj.relativity.greenend.org.uk flags 0 type 1 A(-) submitted
+trunc.test.iwj.relativity.greenend.org.uk flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=60
+rc=0
diff --git a/adns-0.6/regress/case-trunc.sys b/adns-0.6/regress/case-trunc.sys
new file mode 100644
index 0000000..4288e5d
--- /dev/null
+++ b/adns-0.6/regress/case-trunc.sys
@@ -0,0 +1,34 @@
+default
+:1 trunc.test.iwj.relativity.greenend.org.uk
+ start 912888921.274801
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000207
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000321
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000443
+ sendto fd=4 addr=172.18.45.6:53
+ 311f0100 00010000 00000000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=59
+ +0.000682
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.999318
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.006406
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+ 311f8580 00010000 00010000 05747275 6e630474 65737403 69776a0a 72656c61
+ 74697669 74790867 7265656e 656e6403 6f726702 756b0000 01000104 74657374
+ 0369776a 0a72656c 61746976 69747908 67726565 6e656e64 036f7267 02756b00
+ 00060001 0000003c 0027036e 7330c044 0a686f73 746d6173 746572c0 44000000
+ 0e00000e 10000000 780064c8 00000000 3c.
+ +0.000839
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000141
+ close fd=4
+ close=OK
+ +0.000157
diff --git a/adns-0.6/regress/case-unknownq.err b/adns-0.6/regress/case-unknownq.err
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/adns-0.6/regress/case-unknownq.err
diff --git a/adns-0.6/regress/case-unknownq.out b/adns-0.6/regress/case-unknownq.out
new file mode 100644
index 0000000..c9e53e4
--- /dev/null
+++ b/adns-0.6/regress/case-unknownq.out
@@ -0,0 +1,3 @@
+adns debug: using nameserver 172.18.45.6
+davenant.relativity.greenend.org.uk. flags 0 type 32767 not implemented
+rc=0
diff --git a/adns-0.6/regress/case-unknownq.sys b/adns-0.6/regress/case-unknownq.sys
new file mode 100644
index 0000000..ba279bb
--- /dev/null
+++ b/adns-0.6/regress/case-unknownq.sys
@@ -0,0 +1,15 @@
+default
+:32767 davenant.relativity.greenend.org.uk.
+ start 933811310.565828
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000264
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000087
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000067
+ close fd=4
+ close=OK
+ +0.000307
diff --git a/adns-0.6/regress/checkall b/adns-0.6/regress/checkall
new file mode 100755
index 0000000..64bd935
--- /dev/null
+++ b/adns-0.6/regress/checkall
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+set -e
+
+failed=''
+passed=''
+skipped=''
+
+for f in case-*.sys
+do
+ case="`echo \"$f\" | sed -e 's/^case-//; s/\.sys$//'`"
+ set +e
+ ./r1test $case
+ rc=$?
+ set -e
+ case $rc in
+ 0) passed="$passed $case" ;;
+ 5) skipped="$skipped $case" ;;
+ *) echo
+ failed="$failed $case"
+ echo
+ ;;
+ esac
+done
+
+if [ "x$failed" = x ]
+then
+ echo "
+"
+ if [ "x$skipped" = x ]
+ then
+ echo "all tests passed."
+ else
+ echo "all applicable tests passed (skipped:$skipped)"
+ fi
+ echo
+ exit 0
+fi
+
+echo >&2 "
+AT LEAST ONE TEST FAILED
+passed tests:${passed:- NONE}
+skipped tests:${skipped:- NONE}
+failed tests:$failed
+"
+
+exit 1
diff --git a/adns-0.6/regress/harness.h.m4 b/adns-0.6/regress/harness.h.m4
new file mode 100644
index 0000000..35efa18
--- /dev/null
+++ b/adns-0.6/regress/harness.h.m4
@@ -0,0 +1,93 @@
+m4_dnl harness.h.m4
+m4_dnl (part of complex test harness, not of the library)
+m4_dnl - function and other declarations
+
+m4_dnl This file is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl It is part of adns, which is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl Copyright (C) 1999 Tony Finch <dot@dotat.at>
+m4_dnl
+m4_dnl This program is free software; you can redistribute it and/or modify
+m4_dnl it under the terms of the GNU General Public License as published by
+m4_dnl the Free Software Foundation; either version 2, or (at your option)
+m4_dnl any later version.
+m4_dnl
+m4_dnl This program is distributed in the hope that it will be useful,
+m4_dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+m4_dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+m4_dnl GNU General Public License for more details.
+m4_dnl
+m4_dnl You should have received a copy of the GNU General Public License
+m4_dnl along with this program; if not, write to the Free Software Foundation,
+m4_dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+m4_include(hmacros.i4)
+
+#ifndef HARNESS_H_INCLUDED
+#define HARNESS_H_INCLUDED
+
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <unistd.h>
+
+#include "internal.h"
+
+#ifdef HAVE_POLL
+#include <sys/poll.h>
+#endif
+
+/* We override several system calls with #define's */
+
+hm_create_proto_h
+m4_define(`hm_syscall', `int H$1(hm_args_massage($3,void));')
+m4_include(`hsyscalls.i4')
+
+int Hwritev(int fd, const struct iovec *vector, size_t count);
+int Hgettimeofday(struct timeval *tv, struct timezone *tz);
+
+void *Hmalloc(size_t sz);
+void Hfree(void *ptr);
+void *Hrealloc(void *op, size_t nsz);
+void Hexit(int rv);
+
+/* There is a Q function (Q for Question) for each such syscall;
+ * it constructs a string representing the call, and calls Q_str
+ * on it, or constructs it in vb and calls Q_vb;
+ */
+
+hm_create_proto_q
+m4_define(`hm_syscall', `void Q$1(hm_args_massage($3,void));')
+m4_include(`hsyscalls.i4')
+
+void Q_vb(void);
+
+extern void Tshutdown(void);
+
+/* General help functions */
+
+void Tfailed(const char *why);
+void Toutputerr(void);
+void Tnomem(void);
+void Tfsyscallr(const char *fmt, ...) PRINTFFORMAT(1,2);
+void Tensureoutputfile(void);
+void Tmust(const char *call, const char *arg, int cond);
+
+void Tvbf(const char *fmt, ...) PRINTFFORMAT(1,2);
+void Tvbvf(const char *fmt, va_list al);
+void Tvbfdset(int max, const fd_set *set);
+void Tvbpollfds(const struct pollfd *fds, int nfds);
+void Tvbaddr(const struct sockaddr *addr, int addrlen);
+void Tvbbytes(const void *buf, int len);
+void Tvberrno(int e);
+void Tvba(const char *str);
+
+/* Shared globals */
+
+extern vbuf vb;
+extern struct timeval currenttime;
+extern const struct Terrno { const char *n; int v; } Terrnos[];
+
+#endif
diff --git a/adns-0.6/regress/hcommon.c.m4 b/adns-0.6/regress/hcommon.c.m4
new file mode 100644
index 0000000..311087e
--- /dev/null
+++ b/adns-0.6/regress/hcommon.c.m4
@@ -0,0 +1,308 @@
+m4_dnl hcommon.c
+m4_dnl (part of complex test harness, not of the library)
+m4_dnl - routines used for both record and playback
+
+m4_dnl This file is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl It is part of adns, which is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl Copyright (C) 1999 Tony Finch <dot@dotat.at>
+m4_dnl
+m4_dnl This program is free software; you can redistribute it and/or modify
+m4_dnl it under the terms of the GNU General Public License as published by
+m4_dnl the Free Software Foundation; either version 2, or (at your option)
+m4_dnl any later version.
+m4_dnl
+m4_dnl This program is distributed in the hope that it will be useful,
+m4_dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+m4_dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+m4_dnl GNU General Public License for more details.
+m4_dnl
+m4_dnl You should have received a copy of the GNU General Public License
+m4_dnl along with this program; if not, write to the Free Software Foundation,
+m4_dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+m4_include(hmacros.i4)
+
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "harness.h"
+#include "internal.h"
+
+vbuf vb;
+FILE *Toutputfile= 0;
+struct timeval currenttime;
+
+const struct Terrno Terrnos[]= {
+ { "EAGAIN", EAGAIN },
+ { "EINPROGRESS", EINPROGRESS },
+ { "EINTR", EINTR },
+ { "EINVAL", EINVAL },
+ { "EMSGSIZE", EMSGSIZE },
+ { "ENOBUFS", ENOBUFS },
+ { "ENOENT", ENOENT },
+ { "ENOPROTOOPT", ENOPROTOOPT },
+ { "ENOSPC", ENOSPC },
+ { "EWOULDBLOCK", EWOULDBLOCK },
+ { "EHOSTUNREACH", EHOSTUNREACH },
+ { "ECONNREFUSED", ECONNREFUSED },
+ { "EPIPE", EPIPE },
+ { 0, 0 }
+};
+
+static vbuf vbw;
+
+int Hgettimeofday(struct timeval *tv, struct timezone *tz) {
+ Tmust("gettimeofday","tz",!tz);
+ *tv= currenttime;
+ return 0;
+}
+
+int Hwritev(int fd, const struct iovec *vector, size_t count) {
+ size_t i;
+
+ vbw.used= 0;
+ for (i=0; i<count; i++, vector++) {
+ if (!adns__vbuf_append(&vbw,vector->iov_base,vector->iov_len)) Tnomem();
+ }
+ return Hwrite(fd,vbw.buf,vbw.used);
+}
+
+m4_define(`hm_syscall', `
+ hm_create_proto_q
+void Q$1(hm_args_massage($3,void)) {
+
+ vb.used= 0;
+ Tvba("$1");
+ m4_define(`hm_na',`')
+ m4_define(`hm_arg_nullptr',`')
+ m4_define(`hm_arg_int', `Tvbf(" $'`1=%d",$'`1);')
+ m4_define(`hm_arg_fdset_io', `Tvbf(" $'`1="); Tvbfdset($'`2,$'`1);')
+ m4_define(`hm_arg_pollfds_io', `Tvbf(" $'`1="); Tvbpollfds($'`1,$'`2);')
+ m4_define(`hm_arg_timeval_in_rel_null', `
+ if ($'`1) Tvbf(" $'`1=%ld.%06ld",(long)$'`1->tv_sec,(long)$'`1->tv_usec);
+ else Tvba(" $'`1=null");')
+ m4_define(`hm_arg_must', `')
+ m4_define(`hm_arg_socktype', `
+ Tvbf($'`1==SOCK_STREAM ? " $'`1=SOCK_STREAM" : " $'`1=SOCK_DGRAM");')
+ m4_define(`hm_arg_ign', `')
+ m4_define(`hm_arg_fd', `Tvbf(" $'`1=%d",$'`1);')
+ m4_define(`hm_arg_fcntl_cmd_arg', `
+ if ($'`1 == F_SETFL) {
+ Tvbf(" $'`1=F_SETFL %s",arg & O_NONBLOCK ? "O_NONBLOCK|..." : "~O_NONBLOCK&...");
+ } else if ($'`1 == F_GETFL) {
+ Tvba(" $'`1=F_GETFL");
+ } else {
+ Tmust("$'`1","F_GETFL/F_SETFL",0);
+ }')
+ m4_define(`hm_arg_addr_in', `Tvba(" $'`1="); Tvbaddr($'`1,$'`2);')
+ m4_define(`hm_arg_bytes_in', `')
+ m4_define(`hm_arg_bytes_out', `Tvbf(" $'`4=%lu",(unsigned long)$'`4);')
+ m4_define(`hm_arg_addr_out', `Tvbf(" *$'`2=%d",$'`2);')
+ $3
+
+ hm_create_nothing
+ m4_define(`hm_arg_bytes_in', `Tvbbytes($'`2,$'`4);')
+ $3
+
+ Q_vb();
+}
+')
+
+m4_include(`hsyscalls.i4')
+
+
+void Tvbaddr(const struct sockaddr *addr, int len) {
+ const struct sockaddr_in *ai= (const struct sockaddr_in*)addr;
+
+ assert(len==sizeof(struct sockaddr_in));
+ assert(ai->sin_family==AF_INET);
+ Tvbf("%s:%u",inet_ntoa(ai->sin_addr),htons(ai->sin_port));
+}
+
+void Tvbbytes(const void *buf, int len) {
+ const byte *bp;
+ int i;
+
+ if (!len) { Tvba("\n ."); return; }
+ for (i=0, bp=buf; i<len; i++, bp++) {
+ if (!(i&31)) Tvba("\n ");
+ else if (!(i&3)) Tvba(" ");
+ Tvbf("%02x",*bp);
+ }
+ Tvba(".");
+}
+
+void Tvbfdset(int max, const fd_set *fds) {
+ int i;
+ const char *comma= "";
+
+ Tvba("[");
+ for (i=0; i<max; i++) {
+ if (!FD_ISSET(i,fds)) continue;
+ Tvba(comma);
+ Tvbf("%d",i);
+ comma= ",";
+ }
+ Tvba("]");
+}
+
+static void Tvbpollevents(int events) {
+ const char *delim= "";
+
+ events &= (POLLIN|POLLOUT|POLLPRI);
+ if (!events) { Tvba("0"); return; }
+ if (events & POLLIN) { Tvba("POLLIN"); delim= "|"; }
+ if (events & POLLOUT) { Tvba(delim); Tvba("POLLOUT"); delim= "|"; }
+ if (events & POLLPRI) { Tvba(delim); Tvba("POLLPRI"); }
+}
+
+void Tvbpollfds(const struct pollfd *fds, int nfds) {
+ const char *comma= "";
+
+ Tvba("[");
+ while (nfds>0) {
+ Tvba(comma);
+ Tvbf("{fd=%d, events=",fds->fd);
+ Tvbpollevents(fds->events);
+ Tvba(", revents=");
+ Tvbpollevents(fds->revents);
+ Tvba("}");
+ comma= ", ";
+ nfds--; fds++;
+ }
+ Tvba("]");
+}
+
+void Tvberrno(int e) {
+ const struct Terrno *te;
+
+ for (te= Terrnos; te->n && te->v != e; te++);
+ assert(te->n);
+ Tvba(te->n);
+}
+
+void Tvba(const char *str) {
+ if (!adns__vbuf_appendstr(&vb,str)) Tnomem();
+}
+
+void Tvbvf(const char *fmt, va_list al) {
+ char buf[1000];
+ buf[sizeof(buf)-2]= '\t';
+ vsnprintf(buf,sizeof(buf),fmt,al);
+ assert(buf[sizeof(buf)-2] == '\t');
+
+ Tvba(buf);
+}
+
+void Tvbf(const char *fmt, ...) {
+ va_list al;
+ va_start(al,fmt);
+ Tvbvf(fmt,al);
+ va_end(al);
+}
+
+
+void Tmust(const char *call, const char *arg, int cond) {
+ if (cond) return;
+ fprintf(stderr,"adns test harness: case not handled: system call %s, arg %s",call,arg);
+ exit(-1);
+}
+
+void Tfailed(const char *why) {
+ fprintf(stderr,"adns test harness: failure: %s: %s\n",why,strerror(errno));
+ exit(-1);
+}
+
+void Tnomem(void) {
+ Tfailed("unable to malloc/realloc");
+}
+
+void Toutputerr(void) {
+ Tfailed("write error on test harness output");
+}
+
+struct malloced {
+ struct malloced *next, *back;
+ size_t sz;
+ unsigned long count;
+ struct { double d; long ul; void *p; void (*fp)(void); } data;
+};
+
+static unsigned long malloccount, mallocfailat;
+static struct { struct malloced *head, *tail; } mallocedlist;
+
+#define MALLOCHSZ ((char*)&mallocedlist.head->data - (char*)mallocedlist.head)
+
+void *Hmalloc(size_t sz) {
+ struct malloced *newnode;
+ const char *mfavar;
+ char *ep;
+
+ assert(sz);
+
+ newnode= malloc(MALLOCHSZ + sz); if (!newnode) Tnomem();
+
+ LIST_LINK_TAIL(mallocedlist,newnode);
+ newnode->sz= sz;
+ newnode->count= ++malloccount;
+ if (!mallocfailat) {
+ mfavar= getenv("ADNS_REGRESS_MALLOCFAILAT");
+ if (mfavar) {
+ mallocfailat= strtoul(mfavar,&ep,10);
+ if (!mallocfailat || *ep) Tfailed("ADNS_REGRESS_MALLOCFAILAT bad value");
+ } else {
+ mallocfailat= ~0UL;
+ }
+ }
+ assert(newnode->count != mallocfailat);
+ memset(&newnode->data,0xc7,sz);
+ return &newnode->data;
+}
+
+void Hfree(void *ptr) {
+ struct malloced *oldnode;
+
+ if (!ptr) return;
+
+ oldnode= (void*)((char*)ptr - MALLOCHSZ);
+ LIST_UNLINK(mallocedlist,oldnode);
+ memset(&oldnode->data,0x38,oldnode->sz);
+ free(oldnode);
+}
+
+void *Hrealloc(void *op, size_t nsz) {
+ struct malloced *oldnode;
+ void *np;
+ size_t osz;
+
+ if (op) { oldnode= (void*)((char*)op - MALLOCHSZ); osz= oldnode->sz; } else { osz= 0; }
+ np= Hmalloc(nsz);
+ memcpy(np,op, osz>nsz ? nsz : osz);
+ Hfree(op);
+ return np;
+}
+
+void Hexit(int rv) {
+ struct malloced *loopnode;
+
+ Tshutdown();
+ adns__vbuf_free(&vb);
+ adns__vbuf_free(&vbw);
+ if (mallocedlist.head) {
+ fprintf(stderr,"adns test harness: memory leaked:");
+ for (loopnode=mallocedlist.head; loopnode; loopnode=loopnode->next)
+ fprintf(stderr," %lu(%lu)",loopnode->count,(unsigned long)loopnode->sz);
+ putc('\n',stderr);
+ if (ferror(stderr)) exit(-1);
+ }
+ exit(rv);
+}
diff --git a/adns-0.6/regress/hmacros.i4 b/adns-0.6/regress/hmacros.i4
new file mode 100644
index 0000000..c9c3b7a
--- /dev/null
+++ b/adns-0.6/regress/hmacros.i4
@@ -0,0 +1,136 @@
+m4_dnl hmacros.h.m4
+m4_dnl (part of complex test harness, not of the library)
+m4_dnl - common macros
+
+m4_dnl This file is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl It is part of adns, which is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl Copyright (C) 1999 Tony Finch <dot@dotat.at>
+m4_dnl
+m4_dnl This program is free software; you can redistribute it and/or modify
+m4_dnl it under the terms of the GNU General Public License as published by
+m4_dnl the Free Software Foundation; either version 2, or (at your option)
+m4_dnl any later version.
+m4_dnl
+m4_dnl This program is distributed in the hope that it will be useful,
+m4_dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+m4_dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+m4_dnl GNU General Public License for more details.
+m4_dnl
+m4_dnl You should have received a copy of the GNU General Public License
+m4_dnl along with this program; if not, write to the Free Software Foundation,
+m4_dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+m4_define(`hm_args_massage',
+ `m4_ifelse(
+ m4_patsubst(
+ $1,
+ `hm_comma\|[
+ ]+',
+ `'),
+ `',
+ `$2',
+ `
+ m4_patsubst(m4_patsubst(m4_patsubst(m4_translit($1, `
+ ',` '), `\(hm_comma *\)*$', `'), `^\( *hm_comma\)*', `'),
+ `\( *hm_comma *\)+',` hm_comma ')
+ ')')
+
+m4_define(`hm_create_nothing', `
+ m4_define(`hm_na',`')
+ m4_define(`hm_arg_nullptr', `')
+ m4_define(`hm_arg_int', `')
+ m4_define(`hm_arg_fdset_io', `')
+ m4_define(`hm_arg_pollfds_io', `')
+ m4_define(`hm_arg_timeval_in_rel_null',`')
+ m4_define(`hm_arg_must', `')
+ m4_define(`hm_arg_socktype',`')
+ m4_define(`hm_arg_ign', `')
+ m4_define(`hm_arg_fd', `')
+ m4_define(`hm_arg_fcntl_cmd_arg',`')
+ m4_define(`hm_arg_addr_in', `')
+ m4_define(`hm_arg_bytes_in', `')
+ m4_define(`hm_arg_bytes_out', `')
+ m4_define(`hm_arg_addr_out', `')
+')
+
+m4_define(`hm_create_proto_h',`
+ m4_define(`hm_na', `hm_comma')
+ m4_define(`hm_arg_nullptr', `$'`1 $'`2')
+ m4_define(`hm_arg_int', `int $'`1')
+ m4_define(`hm_arg_fdset_io', `fd_set *$'`1')
+ m4_define(`hm_arg_pollfds_io', `struct pollfd *$'`1 hm_comma int $'`2')
+ m4_define(`hm_arg_timeval_in_rel_null', `struct timeval *$'`1')
+ m4_define(`hm_arg_must', `$'`1 $'`2')
+ m4_define(`hm_arg_socktype', `int $'`1')
+ m4_define(`hm_arg_ign', `$'`1 $'`2')
+ m4_define(`hm_arg_fd', `int $'`1')
+ m4_define(`hm_arg_fcntl_cmd_arg', `int $'`1 hm_comma ...')
+ m4_define(`hm_arg_addr_in', `const struct sockaddr *$'`1 hm_comma int $'`2')
+ m4_define(`hm_arg_bytes_in', `const $'`1 *$'`2 hm_comma $'`3 $'`4')
+ m4_define(`hm_arg_bytes_out', `$'`1 *$'`2 hm_comma $'`3 $'`4')
+ m4_define(`hm_arg_addr_out', `struct sockaddr *$'`1 hm_comma int *$'`2')
+')
+
+m4_define(`hm_create_proto_q',`
+ hm_create_proto_h
+ m4_define(`hm_arg_nullptr', `')
+ m4_define(`hm_arg_fdset_io', `const fd_set *$'`1')
+ m4_define(`hm_arg_pollfds_io', `const struct pollfd *$'`1 hm_comma int $'`2')
+ m4_define(`hm_arg_must', `')
+ m4_define(`hm_arg_ign', `')
+ m4_define(`hm_arg_fcntl_cmd_arg', `int $'`1 hm_comma long $'`2')
+ m4_define(`hm_arg_bytes_out', `$'`3 $'`4')
+ m4_define(`hm_arg_addr_out', `int $'`2')
+')
+
+m4_define(`hm_create_hqcall_vars',`
+ hm_create_nothing
+ m4_define(`hm_arg_fcntl_cmd_arg',`va_list al; long $'`2;')
+')
+
+m4_define(`hm_create_hqcall_init',`
+ hm_create_nothing
+ m4_define(`hm_arg_nullptr', `Tmust("$1","$'`2",!$'`2);')
+ m4_define(`hm_arg_must', `Tmust("$1","$'`2",$'`2==$'`3);')
+ m4_define(`hm_arg_socktype',`
+ Tmust("$1","$'`1",$'`1==SOCK_STREAM || $'`1==SOCK_DGRAM);')
+ m4_define(`hm_arg_fcntl_cmd_arg',`
+ Tmust("$1","$'`1",$'`1==F_SETFL || $'`1==F_GETFL);
+ if ($'`1 == F_SETFL) {
+ va_start(al,$'`1); $'`2= va_arg(al,long); va_end(al);
+ } else {
+ $'`2= 0;
+ }')
+ m4_define(`hm_arg_addr_out',`Tmust("$1","*$'`2",*$'`2>=sizeof(struct sockaddr_in));')
+')
+
+m4_define(`hm_create_realcall_args',`
+ m4_define(`hm_na',`hm_comma')
+ m4_define(`hm_arg_nullptr', `0')
+ m4_define(`hm_arg_int', `$'`1')
+ m4_define(`hm_arg_fdset_io', `$'`1')
+ m4_define(`hm_arg_pollfds_io', `$'`1 hm_comma $'`2')
+ m4_define(`hm_arg_timeval_in_rel_null', `$'`1')
+ m4_define(`hm_arg_must', `$'`2')
+ m4_define(`hm_arg_socktype', `$'`1')
+ m4_define(`hm_arg_ign', `$'`2')
+ m4_define(`hm_arg_fd', `$'`1')
+ m4_define(`hm_arg_fcntl_cmd_arg', `$'`1 hm_comma $'`2')
+ m4_define(`hm_arg_addr_in', `$'`1 hm_comma $'`2')
+ m4_define(`hm_arg_bytes_in', `$'`2 hm_comma $'`4')
+ m4_define(`hm_arg_bytes_out', `$'`2 hm_comma $'`4')
+ m4_define(`hm_arg_addr_out', `$'`1 hm_comma $'`2')
+')
+
+m4_define(`hm_create_hqcall_args',`
+ hm_create_realcall_args
+ m4_define(`hm_arg_nullptr', `')
+ m4_define(`hm_arg_must', `')
+ m4_define(`hm_arg_ign', `')
+ m4_define(`hm_arg_bytes_in', `$'`2 hm_comma $'`4')
+ m4_define(`hm_arg_bytes_out', `$'`4')
+ m4_define(`hm_arg_addr_out', `*$'`2')
+')
diff --git a/adns-0.6/regress/hplayback.c.m4 b/adns-0.6/regress/hplayback.c.m4
new file mode 100644
index 0000000..97e951a
--- /dev/null
+++ b/adns-0.6/regress/hplayback.c.m4
@@ -0,0 +1,366 @@
+m4_dnl hplayback.c.m4
+m4_dnl (part of complex test harness, not of the library)
+m4_dnl - playback routines
+
+m4_dnl This file is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl It is part of adns, which is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl Copyright (C) 1999 Tony Finch <dot@dotat.at>
+m4_dnl
+m4_dnl This program is free software; you can redistribute it and/or modify
+m4_dnl it under the terms of the GNU General Public License as published by
+m4_dnl the Free Software Foundation; either version 2, or (at your option)
+m4_dnl any later version.
+m4_dnl
+m4_dnl This program is distributed in the hope that it will be useful,
+m4_dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+m4_dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+m4_dnl GNU General Public License for more details.
+m4_dnl
+m4_dnl You should have received a copy of the GNU General Public License
+m4_dnl along with this program; if not, write to the Free Software Foundation,
+m4_dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+m4_include(hmacros.i4)
+
+#include <assert.h>
+#include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "harness.h"
+
+static FILE *Tinputfile, *Treportfile;
+static vbuf vb2;
+
+extern void Tshutdown(void) {
+ adns__vbuf_free(&vb2);
+}
+
+static void Tensurereportfile(void) {
+ const char *fdstr;
+ int fd;
+
+ if (Treportfile) return;
+ Treportfile= stderr;
+ fdstr= getenv("ADNS_TEST_REPORT_FD"); if (!fdstr) return;
+ fd= atoi(fdstr);
+ Treportfile= fdopen(fd,"a"); if (!Treportfile) Tfailed("fdopen ADNS_TEST_REPORT_FD");
+}
+
+static void Psyntax(const char *where) {
+ fprintf(stderr,"adns test harness: syntax error in test log input file: %s\n",where);
+ exit(-1);
+}
+
+static void Pcheckinput(void) {
+ if (ferror(Tinputfile)) Tfailed("read test log input file");
+ if (feof(Tinputfile)) Psyntax("eof at syscall reply");
+}
+
+static void Tensureinputfile(void) {
+ const char *fdstr;
+ int fd;
+ int chars;
+ unsigned long sec, usec;
+
+ if (Tinputfile) return;
+ Tinputfile= stdin;
+ fdstr= getenv("ADNS_TEST_IN_FD");
+ if (fdstr) {
+ fd= atoi(fdstr);
+ Tinputfile= fdopen(fd,"r"); if (!Tinputfile) Tfailed("fdopen ADNS_TEST_IN_FD");
+ }
+
+ if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
+ fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
+ chars= -1;
+ sscanf(vb2.buf," start %lu.%lu%n",&sec,&usec,&chars);
+ if (chars==-1) Psyntax("start time invalid");
+ currenttime.tv_sec= sec;
+ currenttime.tv_usec= usec;
+ if (vb2.buf[chars] != hm_squote\nhm_squote) Psyntax("not newline after start time");
+}
+
+static void Parg(const char *argname) {
+ int l;
+
+ if (vb2.buf[vb2.used++] != hm_squote hm_squote) Psyntax("not a space before argument");
+ l= strlen(argname);
+ if (memcmp(vb2.buf+vb2.used,argname,l)) Psyntax("argument name wrong");
+ vb2.used+= l;
+ if (vb2.buf[vb2.used++] != hm_squote=hm_squote) Psyntax("not = after argument name");
+}
+
+static int Pstring_maybe(const char *string) {
+ int l;
+
+ l= strlen(string);
+ if (memcmp(vb2.buf+vb2.used,string,l)) return 0;
+ vb2.used+= l;
+ return 1;
+}
+
+static void Pstring(const char *string, const char *emsg) {
+ if (Pstring_maybe(string)) return;
+ Psyntax(emsg);
+}
+
+static int Perrno(const char *stuff) {
+ const struct Terrno *te;
+ int r;
+ char *ep;
+
+ for (te= Terrnos; te->n && strcmp(te->n,stuff); te++);
+ if (te->n) return te->v;
+ r= strtoul(stuff+2,&ep,10);
+ if (*ep) Psyntax("errno value not recognised, not numeric");
+ return r;
+}
+
+static void P_updatetime(void) {
+ int chars;
+ unsigned long sec, usec;
+
+ if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
+ fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
+ chars= -1;
+ sscanf(vb2.buf," +%lu.%lu%n",&sec,&usec,&chars);
+ if (chars==-1) Psyntax("update time invalid");
+ currenttime.tv_sec+= sec;
+ currenttime.tv_usec+= usec;
+ if (currenttime.tv_usec > 1000000) {
+ currenttime.tv_sec++;
+ currenttime.tv_usec -= 1000000;
+ }
+ if (vb2.buf[chars] != hm_squote\nhm_squote) Psyntax("not newline after update time");
+}
+
+static void Pfdset(fd_set *set, int max) {
+ int r, c;
+ char *ep;
+
+ if (vb2.buf[vb2.used++] != hm_squote[hm_squote) Psyntax("fd set start not [");
+ FD_ZERO(set);
+ for (;;) {
+ r= strtoul(vb2.buf+vb2.used,&ep,10);
+ if (r>=max) Psyntax("fd set member > max");
+ FD_SET(r,set);
+ vb2.used= ep - (char*)vb2.buf;
+ c= vb2.buf[vb2.used++];
+ if (c == hm_squote]hm_squote) break;
+ if (c != hm_squote,hm_squote) Psyntax("fd set separator not ,");
+ }
+}
+
+#ifdef HAVE_POLL
+static int Ppollfdevents(void) {
+ int events;
+
+ if (Pstring_maybe("0")) return 0;
+ events= 0;
+
+ if (Pstring_maybe("POLLIN")) {
+ events |= POLLIN;
+ if (!Pstring_maybe("|")) return events;
+ }
+
+ if (Pstring_maybe("POLLOUT")) {
+ events |= POLLOUT;
+ if (!Pstring_maybe("|")) return events;
+ }
+
+ Pstring("POLLPRI","pollfdevents PRI?");
+ return events;
+}
+
+static void Ppollfds(struct pollfd *fds, int nfds) {
+ int i;
+ char *ep;
+ const char *comma= "";
+
+ if (vb2.buf[vb2.used++] != hm_squote[hm_squote) Psyntax("pollfds start not [");
+ for (i=0; i<nfds; i++) {
+ Pstring("{fd=","{fd= in pollfds");
+ fds->fd= strtoul(vb2.buf+vb2.used,&ep,10);
+ vb2.used= ep - (char*)vb2.buf;
+ Pstring(", events=",", events= in pollfds");
+ fds->events= Ppollfdevents();
+ Pstring(", revents=",", revents= in pollfds");
+ fds->revents= Ppollfdevents();
+ Pstring("}","} in pollfds");
+ Pstring(comma,"separator in pollfds");
+ comma= ", ";
+ }
+ if (vb2.buf[vb2.used++] != hm_squote]hm_squote) Psyntax("pollfds end not ]");
+}
+#endif
+
+static void Paddr(struct sockaddr *addr, int *lenr) {
+ struct sockaddr_in *sa= (struct sockaddr_in*)addr;
+ char *p, *ep;
+ long ul;
+
+ assert(*lenr >= sizeof(*sa));
+ p= strchr(vb2.buf+vb2.used,':');
+ if (!p) Psyntax("no port on address");
+ *p++= 0;
+ memset(sa,0,sizeof(*sa));
+ sa->sin_family= AF_INET;
+ if (!inet_aton(vb2.buf+vb2.used,&sa->sin_addr)) Psyntax("invalid address");
+ ul= strtoul(p,&ep,10);
+ if (*ep && *ep != hm_squote hm_squote) Psyntax("invalid port (bad syntax)");
+ if (ul >= 65536) Psyntax("port too large");
+ sa->sin_port= htons(ul);
+ *lenr= sizeof(*sa);
+
+ vb2.used= ep - (char*)vb2.buf;
+}
+
+static int Pbytes(byte *buf, int maxlen) {
+ static const char hexdigits[]= "0123456789abcdef";
+
+ int c, v, done;
+ const char *pf;
+
+ done= 0;
+ for (;;) {
+ c= getc(Tinputfile); Pcheckinput();
+ if (c=='\n' || c==' ' || c=='\t') continue;
+ if (c=='.') break;
+ pf= strchr(hexdigits,c); if (!pf) Psyntax("invalid first hex digit");
+ v= (pf-hexdigits)<<4;
+ c= getc(Tinputfile); Pcheckinput();
+ pf= strchr(hexdigits,c); if (!pf) Psyntax("invalid second hex digit");
+ v |= (pf-hexdigits);
+ if (maxlen<=0) Psyntax("buffer overflow in bytes");
+ *buf++= v;
+ maxlen--; done++;
+ }
+ for (;;) {
+ c= getc(Tinputfile); Pcheckinput();
+ if (c=='\n') return done;
+ }
+}
+
+void Q_vb(void) {
+ int r;
+
+ Tensureinputfile();
+ if (!adns__vbuf_ensure(&vb2,vb.used+2)) Tnomem();
+ r= fread(vb2.buf,1,vb.used+2,Tinputfile);
+ if (feof(Tinputfile)) {
+ fprintf(stderr,"adns test harness: input ends prematurely; program did:\n %.*s\n",
+ vb.used,vb.buf);
+ exit(-1);
+ }
+ Pcheckinput();
+ if (vb2.buf[0] != hm_squote hm_squote) Psyntax("not space before call");
+ if (memcmp(vb.buf,vb2.buf+1,vb.used) ||
+ vb2.buf[vb.used+1] != hm_squote\nhm_squote) {
+ fprintf(stderr,
+ "adns test harness: program did unexpected:\n %.*s\n"
+ "was expecting:\n %.*s\n",
+ vb.used,vb.buf, vb.used,vb2.buf+1);
+ exit(1);
+ }
+}
+
+m4_define(`hm_syscall', `
+ hm_create_proto_h
+int H$1(hm_args_massage($3,void)) {
+ int r, amtread;
+ m4_define(`hm_rv_fd',`char *ep;')
+ m4_define(`hm_rv_any',`char *ep;')
+ m4_define(`hm_rv_len',`')
+ m4_define(`hm_rv_must',`')
+ m4_define(`hm_rv_succfail',`')
+ m4_define(`hm_rv_fcntl',`')
+ $2
+
+ hm_create_hqcall_vars
+ $3
+
+ hm_create_hqcall_init($1)
+ $3
+
+ hm_create_hqcall_args
+ Q$1(hm_args_massage($3));
+
+ m4_define(`hm_r_offset',`m4_len(` $1=')')
+ if (!adns__vbuf_ensure(&vb2,1000)) Tnomem();
+ fgets(vb2.buf,vb2.avail,Tinputfile); Pcheckinput();
+
+ Tensurereportfile();
+ fprintf(Treportfile,"syscallr %s",vb2.buf);
+ amtread= strlen(vb2.buf);
+ if (amtread<=0 || vb2.buf[--amtread]!=hm_squote\nhm_squote)
+ Psyntax("badly formed line");
+ vb2.buf[amtread]= 0;
+ if (memcmp(vb2.buf," $1=",hm_r_offset)) Psyntax("syscall reply mismatch");
+
+ if (vb2.buf[hm_r_offset] == hm_squoteEhm_squote) {
+ int e;
+ e= Perrno(vb2.buf+hm_r_offset);
+ P_updatetime();
+ errno= e;
+ return -1;
+ }
+
+ m4_define(`hm_rv_succfail',`
+ if (memcmp(vb2.buf+hm_r_offset,"OK",2)) Psyntax("success/fail not E* or OK");
+ vb2.used= hm_r_offset+2;
+ r= 0;
+ ')
+ m4_define(`hm_rv_len',`hm_rv_succfail')
+ m4_define(`hm_rv_must',`hm_rv_succfail')
+ m4_define(`hm_rv_any',`
+ r= strtoul(vb2.buf+hm_r_offset,&ep,10);
+ if (*ep && *ep!=hm_squote hm_squote) Psyntax("return value not E* or positive number");
+ vb2.used= ep - (char*)vb2.buf;
+ ')
+ m4_define(`hm_rv_fd',`hm_rv_any')
+ m4_define(`hm_rv_fcntl',`
+ r= 0;
+ if (cmd == F_GETFL) {
+ if (!memcmp(vb2.buf+hm_r_offset,"O_NONBLOCK|...",14)) {
+ r= O_NONBLOCK;
+ vb2.used= hm_r_offset+14;
+ } else if (!memcmp(vb2.buf+hm_r_offset,"~O_NONBLOCK&...",15)) {
+ vb2.used= hm_r_offset+15;
+ } else {
+ Psyntax("fcntl flags not O_NONBLOCK|... or ~O_NONBLOCK&...");
+ }
+ } else if (cmd == F_SETFL) {
+ hm_rv_succfail
+ } else {
+ Psyntax("fcntl not F_GETFL or F_SETFL");
+ }
+ ')
+ $2
+
+ hm_create_nothing
+ m4_define(`hm_arg_fdset_io',`Parg("$'`1"); Pfdset($'`1,$'`2);')
+ m4_define(`hm_arg_pollfds_io',`Parg("$'`1"); Ppollfds($'`1,$'`2);')
+ m4_define(`hm_arg_addr_out',`Parg("$'`1"); Paddr($'`1,$'`2);')
+ $3
+ assert(vb2.used <= amtread);
+ if (vb2.used != amtread) Psyntax("junk at end of line");
+
+ hm_create_nothing
+ m4_define(`hm_arg_bytes_out',`r= Pbytes($'`2,$'`4);')
+ $3
+
+ P_updatetime();
+ return r;
+}
+')
+
+m4_include(`hsyscalls.i4')
diff --git a/adns-0.6/regress/hrecord.c.m4 b/adns-0.6/regress/hrecord.c.m4
new file mode 100644
index 0000000..c6417ca
--- /dev/null
+++ b/adns-0.6/regress/hrecord.c.m4
@@ -0,0 +1,154 @@
+m4_dnl hrecord.c.m4
+m4_dnl (part of complex test harness, not of the library)
+m4_dnl - recording routines
+
+m4_dnl This file is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl It is part of adns, which is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl Copyright (C) 1999 Tony Finch <dot@dotat.at>
+m4_dnl
+m4_dnl This program is free software; you can redistribute it and/or modify
+m4_dnl it under the terms of the GNU General Public License as published by
+m4_dnl the Free Software Foundation; either version 2, or (at your option)
+m4_dnl any later version.
+m4_dnl
+m4_dnl This program is distributed in the hope that it will be useful,
+m4_dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+m4_dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+m4_dnl GNU General Public License for more details.
+m4_dnl
+m4_dnl You should have received a copy of the GNU General Public License
+m4_dnl along with this program; if not, write to the Free Software Foundation,
+m4_dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+m4_include(hmacros.i4)
+
+#include <assert.h>
+#include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#include "harness.h"
+
+static FILE *Toutputfile;
+
+void Tshutdown(void) {
+}
+
+static void R_recordtime(void) {
+ int r;
+ struct timeval tv, tvrel;
+
+ Tensureoutputfile();
+ r= gettimeofday(&tv,0); if (r) Tfailed("gettimeofday syscallbegin");
+ tvrel.tv_sec= tv.tv_sec - currenttime.tv_sec;
+ tvrel.tv_usec= tv.tv_usec - currenttime.tv_usec;
+ if (tv.tv_usec < 0) { tvrel.tv_usec += 1000000; tvrel.tv_sec--; }
+ Tvbf("\n +%ld.%06ld",(long)tvrel.tv_sec,(long)tvrel.tv_usec);
+ currenttime= tv;
+}
+
+void Tensureoutputfile(void) {
+ const char *fdstr;
+ int fd, r;
+
+ if (Toutputfile) return;
+
+ Toutputfile= stdout;
+ fdstr= getenv("ADNS_TEST_OUT_FD");
+ if (fdstr) {
+ fd= atoi(fdstr);
+ Toutputfile= fdopen(fd,"a"); if (!Toutputfile) Tfailed("fdopen ADNS_TEST_OUT_FD");
+ }
+
+ r= gettimeofday(&currenttime,0); if (r) Tfailed("gettimeofday syscallbegin");
+ if (fprintf(Toutputfile," start %ld.%06ld\n",
+ (long)currenttime.tv_sec,(long)currenttime.tv_usec) == EOF) Toutputerr();
+}
+
+void Q_vb(void) {
+ if (!adns__vbuf_append(&vb,"",1)) Tnomem();
+ Tensureoutputfile();
+ if (fprintf(Toutputfile," %s\n",vb.buf) == EOF) Toutputerr();
+ if (fflush(Toutputfile)) Toutputerr();
+}
+
+static void R_vb(void) {
+ Q_vb();
+}
+
+m4_define(`hm_syscall', `
+ hm_create_proto_h
+int H$1(hm_args_massage($3,void)) {
+ int r, e;
+
+ hm_create_hqcall_vars
+ $3
+
+ hm_create_hqcall_init($1)
+ $3
+
+ hm_create_hqcall_args
+ Q$1(hm_args_massage($3));
+
+ hm_create_realcall_args
+ r= $1(hm_args_massage($3));
+ e= errno;
+
+ vb.used= 0;
+ Tvba("$1=");
+ m4_define(`hm_rv_any',`
+ if (r==-1) { Tvberrno(e); goto x_error; }
+ Tvbf("%d",r);')
+ m4_define(`hm_rv_fd',`hm_rv_any($'`1)')
+ m4_define(`hm_rv_succfail',`
+ if (r) { Tvberrno(e); goto x_error; }
+ Tvba("OK");')
+ m4_define(`hm_rv_must',`Tmust("$1","return",!r); Tvba("OK");')
+ m4_define(`hm_rv_len',`
+ if (r==-1) { Tvberrno(e); goto x_error; }
+ Tmust("$1","return",r<=$'`1);
+ Tvba("OK");')
+ m4_define(`hm_rv_fcntl',`
+ if (r==-1) { Tvberrno(e); goto x_error; }
+ if (cmd == F_GETFL) {
+ Tvbf(r & O_NONBLOCK ? "O_NONBLOCK|..." : "~O_NONBLOCK&...");
+ } else {
+ if (cmd == F_SETFL) {
+ Tmust("$1","return",!r);
+ } else {
+ Tmust("cmd","F_GETFL/F_SETFL",0);
+ }
+ Tvba("OK");
+ }')
+ $2
+
+ hm_create_nothing
+ m4_define(`hm_arg_fdset_io',`Tvba(" $'`1="); Tvbfdset($'`2,$'`1);')
+ m4_define(`hm_arg_pollfds_io',`Tvba(" $'`1="); Tvbpollfds($'`1,$'`2);')
+ m4_define(`hm_arg_addr_out',`Tvba(" $'`1="); Tvbaddr($'`1,*$'`2);')
+ $3
+
+ hm_create_nothing
+ m4_define(`hm_arg_bytes_out',`Tvbbytes($'`2,r);')
+ $3
+
+ m4_define(`hm_rv_any',`x_error:')
+ m4_define(`hm_rv_fd',`x_error:')
+ m4_define(`hm_rv_succfail',`x_error:')
+ m4_define(`hm_rv_len',`x_error:')
+ m4_define(`hm_rv_fcntl',`x_error:')
+ m4_define(`hm_rv_must',`')
+ $2
+
+ R_recordtime();
+ R_vb();
+ errno= e;
+ return r;
+}
+')
+
+m4_include(`hsyscalls.i4')
diff --git a/adns-0.6/regress/hsyscalls.i4 b/adns-0.6/regress/hsyscalls.i4
new file mode 100644
index 0000000..9c4bdad
--- /dev/null
+++ b/adns-0.6/regress/hsyscalls.i4
@@ -0,0 +1,122 @@
+m4_dnl hsyscalls.i4
+m4_dnl (part of complex test harness, not of the library)
+m4_dnl - list of syscalls to override/log and their args
+
+m4_dnl This file is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl It is part of adns, which is
+m4_dnl Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl Copyright (C) 1999 Tony Finch <dot@dotat.at>
+m4_dnl
+m4_dnl This program is free software; you can redistribute it and/or modify
+m4_dnl it under the terms of the GNU General Public License as published by
+m4_dnl the Free Software Foundation; either version 2, or (at your option)
+m4_dnl any later version.
+m4_dnl
+m4_dnl This program is distributed in the hope that it will be useful,
+m4_dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+m4_dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+m4_dnl GNU General Public License for more details.
+m4_dnl
+m4_dnl You should have received a copy of the GNU General Public License
+m4_dnl along with this program; if not, write to the Free Software Foundation,
+m4_dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+m4_dnl each system call has
+m4_dnl hm_syscall(<name>,<returnvalue>,<args>)
+m4_dnl <returnvalue> is one of
+m4_dnl hm_rv_must must succeed and return 0
+m4_dnl hm_rv_any any nonnegative return allowed, -1 means see errno
+m4_dnl hm_rv_fd file descriptor is returned, -1 means see errno
+m4_dnl hm_rv_succfail returns 0 (ok) or -1 (see errno)
+m4_dnl hm_rv_len(<max>) returns length read/written, must be <=max, -1 => errno
+m4_dnl hm_rv_fcntl syscall is fcntl, do special processing
+m4_dnl <args> is list of macros for arguments, each followed by hm_na
+m4_dnl hm_arg_nullptr(<type>,<arg>) pointer of type type, must be null
+m4_dnl hm_arg_int(<arg>) signed integer
+m4_dnl hm_arg_fdset_io(<arg>,<max>) fd_set, max bit set is in max
+m4_dnl hm_arg_timeval_in_rel_null(<t>) struct timeval*, pass in, relative, may be null
+m4_dnl hm_arg_must(<type>,<arg>,<val>) must have correct value, or abort test
+m4_dnl hm_arg_socktype(<arg>) SOCK_STREAM or SOCK_DGRAM (an int)
+m4_dnl hm_arg_ign(<type>,<arg>) input parameter ignored
+m4_dnl hm_arg_fd(<arg>) fd
+m4_dnl hm_arg_fcntl_cmd_arg(<ca>,<aa>) syscall is fcntl, do special processing
+m4_dnl hm_arg_addr_in(<arg>,<len>) struct sockaddr*, length given by <len> (an int)
+m4_dnl hm_arg_bytes_in(<objtype>,<objarg>,<lentype>,<lenarg>)
+m4_dnl some data from caller; <objarg> is of type pointer to const <objtype>
+m4_dnl and points to <lenarg> bytes (<lenarg> is of type <lentype>)
+m4_dnl hm_arg_bytes_out(<objtype>,<objarg>,<lentype>,<buflenarg>)
+m4_dnl buffer for data from syscall; <objarg> is of type pointer to const <objtype>
+m4_dnl and points to at least <lenarg> bytes (<lenarg> is of type <lentype>)
+m4_dnl return value from syscall is supposed to be returned length
+m4_dnl hm_arg_addr_out(<arg>,<lenptr>) struct sockaddr*, length io at <lenptr> (an int*)
+
+hm_syscall(
+ select, `hm_rv_any', `
+ hm_arg_int(max) hm_na
+ hm_arg_fdset_io(rfds,max) hm_na
+ hm_arg_fdset_io(wfds,max) hm_na
+ hm_arg_fdset_io(efds,max) hm_na
+ hm_arg_timeval_in_rel_null(to) hm_na
+')
+
+#ifdef HAVE_POLL
+hm_syscall(
+ poll, `hm_rv_any', `
+ hm_arg_pollfds_io(fds,nfds) hm_na
+ hm_arg_int(timeout) hm_na
+')
+#endif
+
+hm_syscall(
+ socket, `hm_rv_fd', `
+ hm_arg_must(int,domain,AF_INET) hm_na
+ hm_arg_socktype(type) hm_na
+ hm_arg_ign(int,protocol) hm_na
+')
+
+hm_syscall(
+ fcntl, `hm_rv_fcntl', `
+ hm_arg_fd(fd) hm_na
+ hm_arg_fcntl_cmd_arg(cmd,arg) hm_na
+')
+
+hm_syscall(
+ connect, `hm_rv_succfail', `
+ hm_arg_fd(fd) hm_na
+ hm_arg_addr_in(addr,addrlen) hm_na
+')
+
+hm_syscall(
+ close, `hm_rv_succfail', `
+ hm_arg_fd(fd) hm_na
+')
+
+hm_syscall(
+ sendto, `hm_rv_any', `
+ hm_arg_fd(fd) hm_na
+ hm_arg_bytes_in(void,msg,int,msglen) hm_na
+ hm_arg_must(unsigned int,flags,0) hm_na
+ hm_arg_addr_in(addr,addrlen) hm_na
+')
+
+hm_syscall(
+ recvfrom, `hm_rv_len(buflen)', `
+ hm_arg_fd(fd) hm_na
+ hm_arg_bytes_out(void,buf,int,buflen) hm_na
+ hm_arg_must(unsigned int,flags,0) hm_na
+ hm_arg_addr_out(addr,addrlen) hm_na
+')
+
+hm_syscall(
+ read, `hm_rv_len(buflen)', `
+ hm_arg_fd(fd) hm_na
+ hm_arg_bytes_out(void,buf,size_t,buflen) hm_na
+')
+
+hm_syscall(
+ write, `hm_rv_any', `
+ hm_arg_fd(fd) hm_na
+ hm_arg_bytes_in(void,buf,size_t,len) hm_na
+')
diff --git a/adns-0.6/regress/init-1stservbroken.text b/adns-0.6/regress/init-1stservbroken.text
new file mode 100644
index 0000000..56cd423
--- /dev/null
+++ b/adns-0.6/regress/init-1stservbroken.text
@@ -0,0 +1,3 @@
+nameserver 172.18.45.2
+nameserver 172.18.45.6
+sortlist 127.0.0.1/32 172.18.45.0/28 172.18.45.0/24
diff --git a/adns-0.6/regress/init-1stservto.text b/adns-0.6/regress/init-1stservto.text
new file mode 100644
index 0000000..b70e678
--- /dev/null
+++ b/adns-0.6/regress/init-1stservto.text
@@ -0,0 +1,3 @@
+nameserver 10.0.0.1
+nameserver 172.18.45.6
+sortlist 127.0.0.1/32 172.18.45.0/28 172.18.45.0/24
diff --git a/adns-0.6/regress/init-2ndserver.text b/adns-0.6/regress/init-2ndserver.text
new file mode 100644
index 0000000..88cb0d2
--- /dev/null
+++ b/adns-0.6/regress/init-2ndserver.text
@@ -0,0 +1,3 @@
+nameserver 172.18.45.36
+nameserver 172.18.45.6
+sortlist 127.0.0.1/32 172.18.45.0/28 172.18.45.0/24
diff --git a/adns-0.6/regress/init-default.text b/adns-0.6/regress/init-default.text
new file mode 100644
index 0000000..e224ea7
--- /dev/null
+++ b/adns-0.6/regress/init-default.text
@@ -0,0 +1,3 @@
+nameserver 172.18.45.6
+sortlist 127.0.0.1/32 172.18.45.0/28 172.18.45.0/24
+search davenant.greenend.org.uk greenend.org.uk
diff --git a/adns-0.6/regress/init-manyptrwrong.text b/adns-0.6/regress/init-manyptrwrong.text
new file mode 100644
index 0000000..34b6084
--- /dev/null
+++ b/adns-0.6/regress/init-manyptrwrong.text
@@ -0,0 +1 @@
+nameserver 140.200.128.13
diff --git a/adns-0.6/regress/init-ncipher.text b/adns-0.6/regress/init-ncipher.text
new file mode 100644
index 0000000..11ef2db
--- /dev/null
+++ b/adns-0.6/regress/init-ncipher.text
@@ -0,0 +1,3 @@
+nameserver 195.224.55.129
+sortlist 127.0.0.1/32 195.224.55.128/25 195.224.55.0/24
+search ncipher.com
diff --git a/adns-0.6/regress/init-ndots.text b/adns-0.6/regress/init-ndots.text
new file mode 100644
index 0000000..099c2ee
--- /dev/null
+++ b/adns-0.6/regress/init-ndots.text
@@ -0,0 +1,4 @@
+nameserver 172.18.45.6
+sortlist 127.0.0.1/32 172.18.45.0/28 172.18.45.0/24
+search davenant.greenend.org.uk greenend.org.uk
+options ndots:3
diff --git a/adns-0.6/regress/init-ndotsbad.text b/adns-0.6/regress/init-ndotsbad.text
new file mode 100644
index 0000000..2045821
--- /dev/null
+++ b/adns-0.6/regress/init-ndotsbad.text
@@ -0,0 +1,4 @@
+nameserver 172.18.45.6
+sortlist 127.0.0.1/32 172.18.45.0/28 172.18.45.0/24
+search davenant.greenend.org.uk greenend.org.uk
+options ndots:X
diff --git a/adns-0.6/regress/init-noserver.text b/adns-0.6/regress/init-noserver.text
new file mode 100644
index 0000000..0c8450c
--- /dev/null
+++ b/adns-0.6/regress/init-noserver.text
@@ -0,0 +1,2 @@
+nameserver 172.18.45.36
+sortlist 127.0.0.1/32 172.18.45.0/28 172.18.45.0/24
diff --git a/adns-0.6/regress/init-tunnel.text b/adns-0.6/regress/init-tunnel.text
new file mode 100644
index 0000000..29c789e
--- /dev/null
+++ b/adns-0.6/regress/init-tunnel.text
@@ -0,0 +1,3 @@
+nameserver 172.31.80.9
+sortlist 127.0.0.1/32 172.18.45.0/24 172.31.80.0/28
+search davenant.greenend.org.uk greenend.org.uk
diff --git a/adns-0.6/regress/m1test b/adns-0.6/regress/m1test
new file mode 100755
index 0000000..dbd6bc5
--- /dev/null
+++ b/adns-0.6/regress/m1test
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+set -e
+
+if [ $# -lt 3 ]
+then
+ echo >&2 'usage: m1test <name> <initfile> [<initflags>] <queryargs>'
+ exit 1
+fi
+
+case="case-$1"; shift
+initfile="$1"; shift
+
+case "$1" in
+-*) initflags="$1"; shift
+esac
+
+queryargs="$*"
+
+initstring="`cat init-$initfile.text`"
+
+echo $initfile $initflags >"$case.sys"
+echo "$queryargs" >>"$case.sys"
+
+EF_DISABLE_BANNER=1
+export EF_DISABLE_BANNER
+
+echo running hrecord $initflags "/... $queryargs"
+set +e
+ADNS_TEST_OUT_FD=3 3>>"$case.sys" >"$case.out" 2>"$case.err" </dev/null \
+ ./hrecord $initflags "/$initstring" $queryargs
+rc=$?
+set -e
+
+echo "rc=$rc" >>$case.out
+
+egrep . -- "$case.err" "$case.out"
+echo "exit status: $rc"
diff --git a/adns-0.6/regress/r1test b/adns-0.6/regress/r1test
new file mode 100755
index 0000000..de8db69
--- /dev/null
+++ b/adns-0.6/regress/r1test
@@ -0,0 +1,57 @@
+#!/bin/sh
+# usage: r1test <testcasename>
+
+set -e
+mrc=1
+trap 'exit $mrc' 0
+
+casename="$1"
+case="case-$casename"
+ocase="output-$casename"
+
+exec <"$case.sys"
+read initfile initflags
+read queryargs
+
+initstring="`cat init-$initfile.text`"
+
+rm -f $ocase.*
+
+EF_DISABLE_BANNER=1
+export EF_DISABLE_BANNER
+
+set +e
+ADNS_TEST_REPORT_FD=3 3>>"$ocase.report" >"$ocase.out" 2>"$ocase.err" \
+ ./hplayback $initflags "/$initstring" $queryargs
+rc=$?
+set -e
+
+if [ "$rc" = 5 ]
+then
+ echo -n "SKIPPED-$casename "
+ mrc=5
+ exit
+fi
+
+echo "rc=$rc" >>$ocase.out
+
+failed=false
+for part in err out
+do
+ if diff -u -- "$case.$part" "$ocase.$part"
+ then
+ :
+ else
+ failed=true
+ fi
+done
+
+if $failed
+then
+ echo >&2 "FAILED $case - WRONG OUTPUT - lines of syscall remaining `wc -l`"
+ mrc=2
+ exit
+fi
+
+echo -n "$casename "
+mrc=0
diff --git a/adns-0.6/settings.make.in b/adns-0.6/settings.make.in
new file mode 100644
index 0000000..95932cb
--- /dev/null
+++ b/adns-0.6/settings.make.in
@@ -0,0 +1,68 @@
+# settings.make.in - main configuration settings for Makefiles,
+# used by autoconf/configure to generate settings.make
+#
+# This file is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+# It is part of adns, which is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+# Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+MAJOR= 0
+MINOR= 1
+SHLIBFILE= @SHLIBFILE@
+SHLIBSONAME= @SHLIBSONAME@
+SHLIBFORLINK= @SHLIBFORLINK@
+
+CC= @CC@
+CFLAGS= $(AUTOCFLAGS) $(WARNS) $(WERROR) $(DIRCFLAGS) $(XCFLAGS)
+LDLIBS= @LIBS@ $(XLIBS)
+AUTOCFLAGS= @CFLAGS@
+WARNS= @WARNS@
+#WERROR= -Werror
+
+M4= m4
+RANLIB= @RANLIB@
+
+SHLIBCC= @SHLIBCC@
+
+MKSHLIB_1= @MKSHLIB_1@
+MKSHLIB_2= @MKSHLIB_2@
+MKSHLIB_3= @MKSHLIB_3@
+
+prefix= @prefix@
+exec_prefix= @exec_prefix@
+bin_dir= $(exec_prefix)/bin
+lib_dir= $(exec_prefix)/lib
+include_dir= $(prefix)/include
+
+INSTALL= install -c
+INSTALL_PROGRAM= $(INSTALL) -m 755 $(INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA= $(INSTALL) -m 644
+
+all: $(TARGETS)
+
+clean mostlyclean:
+ rm -f *.o *.tmp*
+
+distclean: clean
+ rm -f $(TARGETS) *~ ./#*# core *.orig *.rej Makefile
+
+distprep: $(AUTOCSRCS)
+
+maintainer-clean: distclean
+ -rm -f $(AUTOCSRCS)
diff --git a/adns-0.6/src/.cvsignore b/adns-0.6/src/.cvsignore
new file mode 100644
index 0000000..547646a
--- /dev/null
+++ b/adns-0.6/src/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+config.h
diff --git a/adns-0.6/src/Makefile.in b/adns-0.6/src/Makefile.in
new file mode 100644
index 0000000..7afca95
--- /dev/null
+++ b/adns-0.6/src/Makefile.in
@@ -0,0 +1,48 @@
+# src/Makefile - library main Makefile
+#
+# This file is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+# It is part of adns, which is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+# Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+srcdir= @srcdir@
+VPATH= @srcdir@
+
+TARGETS= libadns.a
+include $(srcdir)/../settings.make
+include adns.make
+
+install: libadns.a
+ set -xe; for f in $(TARGETS); \
+ do $(INSTALL_DATA) $$f $(lib_dir)/$$f; done
+ $(INSTALL_DATA) $(srcdir)/../src/adns.h $(include_dir)/adns.h
+
+uninstall:
+ for f in $(TARGETS); do rm -f $(lib_dir)/$$f; done
+ rm -f $(include_dir)/adns.h
+
+ALLOBJS= $(LIBOBJS)
+
+libadns.a: $(LIBOBJS)
+ rm -f $@
+ $(AR) cqv $@.new $(LIBOBJS)
+ $(RANLIB) $@.new
+ mv -f $@.new $@
+
+$(LIBOBJS): adns.h internal.h config.h
diff --git a/adns-0.6/src/adns.h b/adns-0.6/src/adns.h
new file mode 100644
index 0000000..588acba
--- /dev/null
+++ b/adns-0.6/src/adns.h
@@ -0,0 +1,818 @@
+/*
+ * adns.h
+ * - adns user-visible API (single-threaded, without any locking)
+ */
+/*
+ *
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ *
+ * For the benefit of certain LGPL'd `omnibus' software which provides
+ * a uniform interface to various things including adns, I make the
+ * following additional licence. I do this because the GPL would
+ * otherwise force either the omnibus software to be GPL'd or for the
+ * adns-using part to be distributed separately.
+ *
+ * So, you may also redistribute and/or modify adns.h (but only the
+ * public header file adns.h and not any other part of adns) under the
+ * terms of the GNU Library General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * Note that adns itself is GPL'd. Authors of adns-using applications
+ * with GPL-incompatible licences, and people who distribute adns with
+ * applications where the whole distribution is not GPL'd, are still
+ * likely to be in violation of the GPL. Anyone who wants to do this
+ * should contact Ian Jackson. Please note that to avoid encouraging
+ * people to infringe the GPL as it applies the body of adns, I think
+ * that if you take advantage of the special exception to redistribute
+ * just adns.h under the LGPL, you should retain this paragraph in its
+ * place in the appropriate copyright statements.
+ *
+ *
+ * You should have received a copy of the GNU General Public License,
+ * or the GNU Library General Public License, as appropriate, along
+ * with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * $Id: adns.h,v 1.1.1.1 2000-02-16 17:32:46 sdyoung Exp $
+ */
+
+#ifndef ADNS_H_INCLUDED
+#define ADNS_H_INCLUDED
+#ifdef __cplusplus
+extern "C" { /* I really dislike this - iwj. */
+#endif
+
+#include <stdio.h>
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+/* All struct in_addr anywhere in adns are in NETWORK byte order. */
+
+typedef struct adns__state *adns_state;
+typedef struct adns__query *adns_query;
+
+typedef enum {
+ adns_if_noenv= 0x0001, /* do not look at environment */
+ adns_if_noerrprint= 0x0002, /* never print output to stderr (_debug overrides) */
+ adns_if_noserverwarn= 0x0004, /* do not warn to stderr about duff nameservers etc */
+ adns_if_debug= 0x0008, /* enable all output to stderr plus debug msgs */
+ adns_if_logpid= 0x0080, /* include pid in diagnostic output */
+ adns_if_noautosys= 0x0010, /* do not make syscalls at every opportunity */
+ adns_if_eintr= 0x0020, /* allow _wait and _synchronous to return EINTR */
+ adns_if_nosigpipe= 0x0040, /* applic has SIGPIPE set to SIG_IGN, do not protect */
+ adns_if_checkc_entex= 0x0100, /* do consistency checks on entry/exit to adns funcs */
+ adns_if_checkc_freq= 0x0300 /* do consistency checks very frequently (slow!) */
+} adns_initflags;
+
+typedef enum {
+ adns_qf_search= 0x00000001, /* use the searchlist */
+ adns_qf_usevc= 0x00000002, /* use a virtual circuit (TCP connection) */
+ adns_qf_owner= 0x00000004, /* fill in the owner field in the answer */
+ adns_qf_quoteok_query= 0x00000010, /* allow quote-requiring chars in query domain */
+ adns_qf_quoteok_cname= 0x00000000, /* allow ... in CNAME we go via - now default */
+ adns_qf_quoteok_anshost= 0x00000040, /* allow ... in things supposed to be hostnames */
+ adns_qf_quotefail_cname= 0x00000080, /* refuse if quote-req chars in CNAME we go via */
+ adns_qf_cname_loose= 0x00000100, /* allow refs to CNAMEs - without, get _s_cname */
+ adns_qf_cname_forbid= 0x00000200, /* don't follow CNAMEs, instead give _s_cname */
+ adns__qf_internalmask= 0x0ff00000
+} adns_queryflags;
+
+typedef enum {
+ adns__rrt_typemask= 0x0ffff,
+ adns__qtf_deref= 0x10000, /* dereference domains and perhaps produce extra data */
+ adns__qtf_mail822= 0x20000, /* make mailboxes be in RFC822 rcpt field format */
+
+ adns_r_none= 0,
+
+ adns_r_a= 1,
+
+ adns_r_ns_raw= 2,
+ adns_r_ns= adns_r_ns_raw|adns__qtf_deref,
+
+ adns_r_cname= 5,
+
+ adns_r_soa_raw= 6,
+ adns_r_soa= adns_r_soa_raw|adns__qtf_mail822,
+
+ adns_r_ptr_raw= 12,
+ adns_r_ptr= adns_r_ptr_raw|adns__qtf_deref,
+
+ adns_r_hinfo= 13,
+
+ adns_r_mx_raw= 15,
+ adns_r_mx= adns_r_mx_raw|adns__qtf_deref,
+
+ adns_r_txt= 16,
+
+ adns_r_rp_raw= 17,
+ adns_r_rp= adns_r_rp_raw|adns__qtf_mail822,
+
+ adns_r_addr= adns_r_a|adns__qtf_deref
+
+} adns_rrtype;
+
+/*
+ * In queries without qf_quoteok_*, all domains must have standard
+ * legal syntax, or you get adns_s_querydomainvalid (if the query
+ * domain contains bad characters) or adns_s_answerdomaininvalid (if
+ * the answer contains bad characters).
+ *
+ * In queries _with_ qf_quoteok_*, domains in the query or response
+ * may contain any characters, quoted according to RFC1035 5.1. On
+ * input to adns, the char* is a pointer to the interior of a "
+ * delimited string, except that " may appear in it, and on output,
+ * the char* is a pointer to a string which would be legal either
+ * inside or outside " delimiters, and any characters not usually
+ * legal in domain names will be quoted as \X (if the character is
+ * 33-126 except \ and ") or \DDD.
+ *
+ * If the query goes via a CNAME then the canonical name (ie, the
+ * thing that the CNAME record refers to) is usually allowed to
+ * contain any characters, which will be quoted as above. With
+ * adns_qf_quotefail_cname you get adns_s_answerdomaininvalid when
+ * this happens. (This is a change from version 0.4 and earlier, in
+ * which failing the query was the default, and you had to say
+ * adns_qf_quoteok_cname to avoid this; that flag is now deprecated.)
+ *
+ * In version 0.4 and earlier, asking for _raw records containing
+ * mailboxes without specifying _qf_quoteok_anshost was silly. This
+ * is no longer the case. In this version only parts of responses
+ * that are actually supposed to be hostnames will be refused by
+ * default if quote-requiring characters are found.
+ */
+
+/*
+ * If you ask for an RR which contains domains which are actually
+ * encoded mailboxes, and don't ask for the _raw version, then adns
+ * returns the mailbox formatted suitably for an RFC822 recipient
+ * header field. The particular format used is that if the mailbox
+ * requires quoting according to the rules in RFC822 then the
+ * local-part is quoted in double quotes, which end at the next
+ * unescaped double quote. (\ is the escape char, and is doubled, and
+ * is used to escape only \ and ".) Otherwise the local-part is
+ * presented as-is. In any case this is followed by an @ and the
+ * domain. The domain will not contain any characters not legal in
+ * hostnames. adns will protect the application from local parts
+ * containing control characters - these appear to be legal according
+ * to RFC822 but are clearly a bad idea.
+ *
+ * If you ask for the domain with _raw then _no_ checking is done
+ * (even on the host part, regardless of adns_qf_quoteok_anshost), and
+ * you just get the domain name in master file format.
+ *
+ * If no mailbox is supplied the returned string will be `.' in either
+ * caswe.
+ */
+
+typedef enum {
+ adns_s_ok,
+
+ /* locally induced errors */
+ adns_s_nomemory,
+ adns_s_unknownrrtype,
+ adns_s_systemfail,
+
+ adns_s_max_localfail= 29,
+
+ /* remotely induced errors, detected locally */
+ adns_s_timeout,
+ adns_s_allservfail,
+ adns_s_norecurse,
+ adns_s_invalidresponse,
+ adns_s_unknownformat,
+
+ adns_s_max_remotefail= 59,
+
+ /* remotely induced errors, reported by remote server to us */
+ adns_s_rcodeservfail,
+ adns_s_rcodeformaterror,
+ adns_s_rcodenotimplemented,
+ adns_s_rcoderefused,
+ adns_s_rcodeunknown,
+
+ adns_s_max_tempfail= 99,
+
+ /* remote configuration errors */
+ adns_s_inconsistent, /* PTR gives domain whose A does not exist and match */
+ adns_s_prohibitedcname, /* CNAME found where eg A expected (not if _qf_loosecname) */
+ adns_s_answerdomaininvalid,
+ adns_s_answerdomaintoolong,
+ adns_s_invaliddata,
+
+ adns_s_max_misconfig= 199,
+
+ /* permanent problems with the query */
+ adns_s_querydomainwrong,
+ adns_s_querydomaininvalid,
+ adns_s_querydomaintoolong,
+
+ adns_s_max_misquery= 299,
+
+ /* permanent errors */
+ adns_s_nxdomain,
+ adns_s_nodata,
+
+ adns_s_max_permfail= 499
+
+} adns_status;
+
+typedef struct {
+ int len;
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in inet;
+ } addr;
+} adns_rr_addr;
+
+typedef struct {
+ char *host;
+ adns_status astatus;
+ int naddrs; /* temp fail => -1, perm fail => 0, s_ok => >0 */
+ adns_rr_addr *addrs;
+} adns_rr_hostaddr;
+
+typedef struct {
+ char *(array[2]);
+} adns_rr_strpair;
+
+typedef struct {
+ int i;
+ adns_rr_hostaddr ha;
+} adns_rr_inthostaddr;
+
+typedef struct {
+ /* Used both for mx_raw, in which case i is the preference and str the domain,
+ * and for txt, in which case each entry has i for the `text' length,
+ * and str for the data (which will have had an extra nul appended
+ * so that if it was plain text it is now a null-terminated string).
+ */
+ int i;
+ char *str;
+} adns_rr_intstr;
+
+typedef struct {
+ adns_rr_intstr array[2];
+} adns_rr_intstrpair;
+
+typedef struct {
+ char *mname, *rname;
+ unsigned long serial, refresh, retry, expire, minimum;
+} adns_rr_soa;
+
+typedef struct {
+ adns_status status;
+ char *cname; /* always NULL if query was for CNAME records */
+ char *owner; /* only set if requested in query flags */
+ adns_rrtype type; /* guaranteed to be same as in query */
+ time_t expires; /* expiry time, defined only if _s_ok, nxdomain or nodata. NOT TTL! */
+ int nrrs, rrsz; /* nrrs is 0 if an error occurs */
+ union {
+ void *untyped;
+ unsigned char *bytes;
+ char *(*str); /* ns_raw, cname, ptr, ptr_raw */
+ adns_rr_intstr *(*manyistr); /* txt (list of strings ends with i=-1, str=0) */
+ adns_rr_addr *addr; /* addr */
+ struct in_addr *inaddr; /* a */
+ adns_rr_hostaddr *hostaddr; /* ns */
+ adns_rr_intstrpair *intstrpair; /* hinfo */
+ adns_rr_strpair *strpair; /* rp, rp_raw */
+ adns_rr_inthostaddr *inthostaddr; /* mx */
+ adns_rr_intstr *intstr; /* mx_raw */
+ adns_rr_soa *soa; /* soa, soa_raw */
+ } rrs;
+} adns_answer;
+
+/* Memory management:
+ * adns_state and adns_query are actually pointers to malloc'd state;
+ * On submission questions are copied, including the owner domain;
+ * Answers are malloc'd as a single piece of memory; pointers in the
+ * answer struct point into further memory in the answer.
+ * query_io:
+ * Must always be non-null pointer;
+ * If *query_io is 0 to start with then any query may be returned;
+ * If *query_io is !0 adns_query then only that query may be returned.
+ * If the call is successful, *query_io, *answer_r, and *context_r
+ * will all be set.
+ * Errors:
+ * Return values are 0 or an errno value.
+ *
+ * For _init, _init_strcfg, _submit and _synchronous, system errors
+ * (eg, failure to create sockets, malloc failure, etc.) return errno
+ * values.
+ *
+ * For _wait and _check failures are reported in the answer
+ * structure, and only 0, ESRCH or (for _check) EAGAIN is
+ * returned: if no (appropriate) requests are done adns_check returns
+ * EAGAIN; if no (appropriate) requests are outstanding both
+ * adns_query and adns_wait return ESRCH.
+ *
+ * Additionally, _wait can return EINTR if you set adns_if_eintr.
+ *
+ * All other errors (nameserver failure, timed out connections, &c)
+ * are returned in the status field of the answer. After a
+ * successful _wait or _check, if status is nonzero then nrrs will be
+ * 0, otherwise it will be >0. type will always be the type
+ * requested.
+ */
+
+int adns_init(adns_state *newstate_r, adns_initflags flags,
+ FILE *diagfile /*0=>stderr*/);
+
+int adns_init_strcfg(adns_state *newstate_r, adns_initflags flags,
+ FILE *diagfile /*0=>discard*/, const char *configtext);
+
+/* Configuration:
+ * adns_init reads /etc/resolv.conf, which is expected to be (broadly
+ * speaking) in the format expected by libresolv, and then
+ * /etc/resolv-adns.conf if it exists. adns_init_strcfg is instead
+ * passed a string which is interpreted as if it were the contents of
+ * resolv.conf or resolv-adns.conf. In general, configuration which
+ * is set later overrides any that is set earlier.
+ *
+ * Standard directives understood in resolv[-adns].conf:
+ *
+ * nameserver <address>
+ * Must be followed by the IP address of a nameserver. Several
+ * nameservers may be specified, and they will be tried in the order
+ * found. There is a compiled in limit, currently 5, on the number
+ * of nameservers. (libresolv supports only 3 nameservers.)
+ *
+ * search <domain> ...
+ * Specifies the search list for queries which specify
+ * adns_qf_search. This is a list of domains to append to the query
+ * domain. The query domain will be tried as-is either before all
+ * of these or after them, depending on the ndots option setting
+ * (see below).
+ *
+ * domain <domain>
+ * This is present only for backward compatibility with obsolete
+ * versions of libresolv. It should not be used, and is interpreted
+ * by adns as if it were `search' - note that this is subtly
+ * different to libresolv's interpretation of this directive.
+ *
+ * sortlist <addr>/<mask> ...
+ * Should be followed by a sequence of IP-address and netmask pairs,
+ * separated by spaces. They may be specified as
+ * eg. 172.30.206.0/24 or 172.30.206.0/255.255.255.0. Currently up
+ * to 15 pairs may be specified (but note that libresolv only
+ * supports up to 10).
+ *
+ * options
+ * Should followed by one or more options, separated by spaces.
+ * Each option consists of an option name, followed by optionally
+ * a colon and a value. Options are listed below.
+ *
+ * Non-standard directives understood in resolv[-adns].conf:
+ *
+ * clearnameservers
+ * Clears the list of nameservers, so that further nameserver lines
+ * start again from the beginning.
+ *
+ * include <filename>
+ * The specified file will be read.
+ *
+ * Additionally, adns will ignore lines in resolv[-adns].conf which
+ * start with a #.
+ *
+ * Standard options understood:
+ *
+ * debug
+ * Enables debugging output from the resolver, which will be written
+ * to stderr.
+ *
+ * ndots:<count>
+ * Affects whether queries with adns_qf_search will be tried first
+ * without adding domains from the searchlist, or whether the bare
+ * query domain will be tried last. Queries which contain at least
+ * <count> dots will be tried bare first. The default is 1.
+ *
+ * Non-standard options understood:
+ *
+ * adns_checkc:none
+ * adns_checkc:entex
+ * adns_checkc:freq
+ * Changes the consistency checking frequency; this overrides the
+ * setting of adns_if_check_entex, adns_if_check_freq, or neither,
+ * in the flags passed to adns_init.
+ *
+ * There are a number of environment variables which can modify the
+ * behaviour of adns. They take effect only if adns_init is used, and
+ * the caller of adns_init can disable them using adns_if_noenv. In
+ * each case there is both a FOO and an ADNS_FOO; the latter is
+ * interpreted later so that it can override the former. Unless
+ * otherwise stated, environment variables are interpreted after
+ * resolv[-adns].conf are read, in the order they are listed here.
+ *
+ * RES_CONF, ADNS_RES_CONF
+ * A filename, whose contets are in the format of resolv.conf.
+ *
+ * RES_CONF_TEXT, ADNS_RES_CONF_TEXT
+ * A string in the format of resolv.conf.
+ *
+ * RES_OPTIONS, ADNS_RES_OPTIONS
+ * These are parsed as if they appeared in the `options' line of a
+ * resolv.conf. In addition to being parsed at this point in the
+ * sequence, they are also parsed at the very beginning before
+ * resolv.conf or any other environment variables are read, so that
+ * any debug option can affect the processing of the configuration.
+ *
+ * LOCALDOMAIN, ADNS_LOCALDOMAIN
+ * These are interpreted as if their contents appeared in a `search'
+ * line in resolv.conf.
+ */
+
+int adns_synchronous(adns_state ads,
+ const char *owner,
+ adns_rrtype type,
+ adns_queryflags flags,
+ adns_answer **answer_r);
+
+/* NB: if you set adns_if_noautosys then _submit and _check do not
+ * make any system calls; you must use some of the asynch-io event
+ * processing functions to actually get things to happen.
+ */
+
+int adns_submit(adns_state ads,
+ const char *owner,
+ adns_rrtype type,
+ adns_queryflags flags,
+ void *context,
+ adns_query *query_r);
+
+/* The owner should be quoted in master file format. */
+
+int adns_check(adns_state ads,
+ adns_query *query_io,
+ adns_answer **answer_r,
+ void **context_r);
+
+int adns_wait(adns_state ads,
+ adns_query *query_io,
+ adns_answer **answer_r,
+ void **context_r);
+
+/* same as adns_wait but uses poll(2) internally */
+int adns_wait_poll(adns_state ads,
+ adns_query *query_io,
+ adns_answer **answer_r,
+ void **context_r);
+
+void adns_cancel(adns_query query);
+
+/* The adns_query you get back from _submit is valid (ie, can be
+ * legitimately passed into adns functions) until it is returned by
+ * adns_check or adns_wait, or passed to adns_cancel. After that it
+ * must not be used. You can rely on it not being reused until the
+ * first adns_submit or _transact call using the same adns_state after
+ * it became invalid, so you may compare it for equality with other
+ * query handles until you next call _query or _transact.
+ *
+ * _submit and _synchronous return ENOSYS if they don't understand the
+ * query type.
+ */
+
+int adns_submit_reverse(adns_state ads,
+ const struct sockaddr *addr,
+ adns_rrtype type,
+ adns_queryflags flags,
+ void *context,
+ adns_query *query_r);
+/* type must be _r_ptr or _r_ptr_raw. _qf_search is ignored.
+ * addr->sa_family must be AF_INET or you get ENOSYS.
+ */
+
+void adns_finish(adns_state ads);
+/* You may call this even if you have queries outstanding;
+ * they will be cancelled.
+ */
+
+
+void adns_forallqueries_begin(adns_state ads);
+adns_query adns_forallqueries_next(adns_state ads, void **context_r);
+/* Iterator functions, which you can use to loop over the outstanding
+ * (submitted but not yet successfuly checked/waited) queries.
+ *
+ * You can only have one iteration going at once. You may call _begin
+ * at any time; after that, an iteration will be in progress. You may
+ * only call _next when an iteration is in progress - anything else
+ * may coredump. The iteration remains in progress until _next
+ * returns 0, indicating that all the queries have been walked over,
+ * or ANY other adns function is called with the same adns_state (or a
+ * query in the same adns_state). There is no need to explicitly
+ * finish an iteration.
+ *
+ * context_r may be 0. *context_r may not be set when _next returns 0.
+ */
+
+void adns_checkconsistency(adns_state ads, adns_query qu);
+/* Checks the consistency of adns's internal data structures.
+ * If any error is found, the program will abort().
+ * You may pass 0 for qu; if you pass non-null then additional checks
+ * are done to make sure that qu is a valid query.
+ */
+
+/*
+ * Example expected/legal calling sequence for submit/check/wait:
+ * adns_init
+ * adns_submit 1
+ * adns_submit 2
+ * adns_submit 3
+ * adns_wait 1
+ * adns_check 3 -> EAGAIN
+ * adns_wait 2
+ * adns_wait 3
+ * ....
+ * adns_finish
+ */
+
+/*
+ * Entrypoints for generic asynch io:
+ * (these entrypoints are not very useful except in combination with *
+ * some of the other I/O model calls which can tell you which fds to
+ * be interested in):
+ *
+ * Note that any adns call may cause adns to open and close fds, so
+ * you must call beforeselect or beforepoll again just before
+ * blocking, or you may not have an up-to-date list of it's fds.
+ */
+
+int adns_processany(adns_state ads);
+/* Gives adns flow-of-control for a bit. This will never block, and
+ * can be used with any threading/asynch-io model. If some error
+ * occurred which might cause an event loop to spin then the errno
+ * value is returned.
+ */
+
+int adns_processreadable(adns_state ads, int fd, const struct timeval *now);
+int adns_processwriteable(adns_state ads, int fd, const struct timeval *now);
+int adns_processexceptional(adns_state ads, int fd, const struct timeval *now);
+/* Gives adns flow-of-control so that it can process incoming data
+ * from, or send outgoing data via, fd. Very like _processany. If it
+ * returns zero then fd will no longer be readable or writeable
+ * (unless of course more data has arrived since). adns will _only_
+ * use that fd and only in the manner specified, regardless of whether
+ * adns_if_noautosys was specified.
+ *
+ * adns_processexceptional should be called when select(2) reports an
+ * exceptional condition, or poll(2) reports POLLPRI.
+ *
+ * It is fine to call _processreabable or _processwriteable when the
+ * fd is not ready, or with an fd that doesn't belong to adns; it will
+ * then just return 0.
+ *
+ * If some error occurred which might prevent an event loop to spin
+ * then the errno value is returned.
+ */
+
+void adns_processtimeouts(adns_state ads, const struct timeval *now);
+/* Gives adns flow-of-control so that it can process any timeouts
+ * which might have happened. Very like _processreadable/writeable.
+ *
+ * now may be 0; if it isn't, *now must be the current time, recently
+ * obtained from gettimeofday.
+ */
+
+void adns_firsttimeout(adns_state ads,
+ struct timeval **tv_mod, struct timeval *tv_buf,
+ struct timeval now);
+/* Asks adns when it would first like the opportunity to time
+ * something out. now must be the current time, from gettimeofday.
+ *
+ * If tv_mod points to 0 then tv_buf must be non-null, and
+ * _firsttimeout will fill in *tv_buf with the time until the first
+ * timeout, and make *tv_mod point to tv_buf. If adns doesn't have
+ * anything that might need timing out it will leave *tv_mod as 0.
+ *
+ * If *tv_mod is not 0 then tv_buf is not used. adns will update
+ * *tv_mod if it has any earlier timeout, and leave it alone if it
+ * doesn't.
+ *
+ * This call will not actually do any I/O, or change the fds that adns
+ * is using. It always succeeds and never blocks.
+ */
+
+void adns_globalsystemfailure(adns_state ads);
+/* If serious problem(s) happen which globally affect your ability to
+ * interact properly with adns, or adns's ability to function
+ * properly, you or adns can call this function.
+ *
+ * All currently outstanding queries will be made to fail with
+ * adns_s_systemfail, and adns will close any stream sockets it has
+ * open.
+ *
+ * This is used by adns, for example, if gettimeofday() fails.
+ * Without this the program's event loop might start to spin !
+ *
+ * This call will never block.
+ */
+
+/*
+ * Entrypoints for select-loop based asynch io:
+ */
+
+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);
+/* Find out file descriptors adns is interested in, and when it would
+ * like the opportunity to time something out. If you do not plan to
+ * block then tv_mod may be 0. Otherwise, tv_mod and tv_buf are as
+ * for adns_firsttimeout. readfds, writefds, exceptfds and maxfd_io may
+ * not be 0.
+ *
+ * If *now is not 0 then this will never actually do any I/O, or
+ * change the fds that adns is using or the timeouts it wants. In any
+ * case it won't block.
+ */
+
+void adns_afterselect(adns_state ads, int maxfd, const fd_set *readfds,
+ const fd_set *writefds, const fd_set *exceptfds,
+ const struct timeval *now);
+/* Gives adns flow-of-control for a bit; intended for use after
+ * select. This is just a fancy way of calling adns_processreadable/
+ * writeable/timeouts as appropriate, as if select had returned the
+ * data being passed. Always succeeds.
+ */
+
+/*
+ * Example calling sequence:
+ *
+ * adns_init _noautosys
+ * loop {
+ * adns_beforeselect
+ * select
+ * adns_afterselect
+ * ...
+ * adns_submit / adns_check
+ * ...
+ * }
+ */
+
+/*
+ * Entrypoints for poll-loop based asynch io:
+ */
+
+struct pollfd;
+/* In case your system doesn't have it or you forgot to include
+ * <sys/poll.h>, to stop the following declarations from causing
+ * problems. If your system doesn't have poll then the following
+ * entrypoints will not be defined in libadns. Sorry !
+ */
+
+int adns_beforepoll(adns_state ads, struct pollfd *fds, int *nfds_io, int *timeout_io,
+ const struct timeval *now);
+/* Finds out which fd's adns is interested in, and when it would like
+ * to be able to time things out. This is in a form suitable for use
+ * with poll(2).
+ *
+ * On entry, usually fds should point to at least *nfds_io structs.
+ * adns will fill up to that many structs will information for poll,
+ * and record in *nfds_io how many structs it filled. If it wants to
+ * listen for more structs then *nfds_io will be set to the number
+ * required and _beforepoll will return ERANGE.
+ *
+ * You may call _beforepoll with fds==0 and *nfds_io 0, in which case
+ * adns will fill in the number of fds that it might be interested in
+ * in *nfds_io, and always return either 0 (if it is not interested in
+ * any fds) or ERANGE (if it is).
+ *
+ * NOTE that (unless now is 0) adns may acquire additional fds
+ * from one call to the next, so you must put adns_beforepoll in a
+ * loop, rather than assuming that the second call (with the buffer
+ * size requested by the first) will not return ERANGE.
+ *
+ * adns only ever sets POLLIN, POLLOUT and POLLPRI in its pollfd
+ * structs, and only ever looks at those bits. POLLPRI is required to
+ * detect TCP Urgent Data (which should not be used by a DNS server)
+ * so that adns can know that the TCP stream is now useless.
+ *
+ * In any case, *timeout_io should be a timeout value as for poll(2),
+ * which adns will modify downwards as required. If the caller does
+ * not plan to block then *timeout_io should be 0 on entry, or
+ * alternatively, timeout_io may be 0. (Alternatively, the caller may
+ * use _beforeselect with timeout_io==0 to find out about file
+ * descriptors, and use _firsttimeout is used to find out when adns
+ * might want to time something out.)
+ *
+ * adns_beforepoll will return 0 on success, and will not fail for any
+ * reason other than the fds buffer being too small (ERANGE).
+ *
+ * This call will never actually do any I/O. If you supply the
+ * current time it will not change the fds that adns is using or the
+ * timeouts it wants.
+ *
+ * In any case this call won't block.
+ */
+
+#define ADNS_POLLFDS_RECOMMENDED 2
+/* If you allocate an fds buf with at least RECOMMENDED entries then
+ * you are unlikely to need to enlarge it. You are recommended to do
+ * so if it's convenient. However, you must be prepared for adns to
+ * require more space than this.
+ */
+
+void adns_afterpoll(adns_state ads, const struct pollfd *fds, int nfds,
+ const struct timeval *now);
+/* Gives adns flow-of-control for a bit; intended for use after
+ * poll(2). fds and nfds should be the results from poll(). pollfd
+ * structs mentioning fds not belonging to adns will be ignored.
+ */
+
+
+adns_status adns_rr_info(adns_rrtype type,
+ const char **rrtname_r, const char **fmtname_r,
+ int *len_r,
+ const void *datap, char **data_r);
+/*
+ * Get information about a query type, or convert reply data to a
+ * textual form. type must be specified, and the official name of the
+ * corresponding RR type will be returned in *rrtname_r, and
+ * information about the processing style in *fmtname_r. The length
+ * of the table entry in an answer for that type will be returned in
+ * in *len_r. Any or all of rrtname_r, fmtname_r and len_r may be 0.
+ * If fmtname_r is non-null then *fmtname_r may be null on return,
+ * indicating that no special processing is involved.
+ *
+ * data_r be must be non-null iff datap is. In this case *data_r will
+ * be set to point to a string pointing to a representation of the RR
+ * data in master file format. (The owner name, timeout, class and
+ * type will not be present - only the data part of the RR.) The
+ * memory will have been obtained from malloc() and must be freed by
+ * the caller.
+ *
+ * Usually this routine will succeed. Possible errors include:
+ * adns_s_nomemory
+ * adns_s_rrtypeunknown
+ * adns_s_invaliddata (*datap contained garbage)
+ * If an error occurs then no memory has been allocated,
+ * and *rrtname_r, *fmtname_r, *len_r and *data_r are undefined.
+ *
+ * There are some adns-invented data formats which are not official
+ * master file formats. These include:
+ *
+ * Mailboxes if __qtf_mail822: these are just included as-is.
+ *
+ * Addresses (adns_rr_addr): these may be of pretty much any type.
+ * The representation is in two parts: first, a word for the address
+ * family (ie, in AF_XXX, the XXX), and then one or more items for the
+ * address itself, depending on the format. For an IPv4 address the
+ * syntax is INET followed by the dotted quad (from inet_ntoa).
+ * Currently only IPv4 is supported.
+ *
+ * Text strings (as in adns_rr_txt) appear inside double quotes, and
+ * use \" and \\ to represent " and \, and \xHH to represent
+ * characters not in the range 32-126.
+ *
+ * Hostname with addresses (adns_rr_hostaddr): this consists of the
+ * hostname, as usual, followed by the adns_status value, as an
+ * abbreviation, and then a descriptive string (encoded as if it were
+ * a piece of text), for the address lookup, followed by zero or more
+ * addresses enclosed in ( and ). If the result was a permanent
+ * failure, then a single ? appears instead of the ( ). If the
+ * result was a temporary failure then an empty pair of parentheses
+ * appears (which a space in between). For example, one of the NS
+ * records for greenend.org.uk comes out like
+ * ns.chiark.greenend.org.uk ok "OK" ( INET 195.224.76.132 )
+ * an MX referring to a nonexistent host might come out like:
+ * 50 sun2.nsfnet-relay.ac.uk nxdomain "No such domain" ( )
+ * and if nameserver information is not available you might get:
+ * dns2.spong.dyn.ml.org timeout "DNS query timed out" ?
+ */
+
+const char *adns_strerror(adns_status st);
+const char *adns_errabbrev(adns_status st);
+const char *adns_errtypeabbrev(adns_status st);
+/* Like strerror but for adns_status values. adns_errabbrev returns
+ * the abbreviation of the error - eg, for adns_s_timeout it returns
+ * "timeout". adns_errtypeabbrev returns the abbreviation of the
+ * error class: ie, for values up to adns_s_max_XXX it will return the
+ * string XXX. You MUST NOT call these functions with status values
+ * not returned by the same adns library.
+ */
+
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+#endif
diff --git a/adns-0.6/src/adns.make b/adns-0.6/src/adns.make
new file mode 100644
index 0000000..d468075
--- /dev/null
+++ b/adns-0.6/src/adns.make
@@ -0,0 +1,25 @@
+# src/adns.make - library definitions, including list of object files
+#
+# This file is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+# It is part of adns, which is
+# Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+# Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+LIBOBJS= types.o event.o query.o reply.o general.o setup.o transmit.o \
+ parse.o poll.o check.o
diff --git a/adns-0.6/src/check.c b/adns-0.6/src/check.c
new file mode 100644
index 0000000..f0f1eec
--- /dev/null
+++ b/adns-0.6/src/check.c
@@ -0,0 +1,199 @@
+/*
+ * check.c
+ * - consistency checks
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "internal.h"
+
+void adns_checkconsistency(adns_state ads, adns_query qu) {
+ adns__consistency(ads,qu,cc_user);
+}
+
+#define DLIST_CHECK(list, nodevar, part, body) \
+ if ((list).head) { \
+ assert(! (list).head->part back); \
+ for ((nodevar)= (list).head; (nodevar); (nodevar)= (nodevar)->part next) { \
+ assert((nodevar)->part next \
+ ? (nodevar) == (nodevar)->part next->part back \
+ : (nodevar) == (list).tail); \
+ body \
+ } \
+ }
+
+#define DLIST_ASSERTON(node, nodevar, list, part) \
+ do { \
+ for ((nodevar)= (list).head; \
+ (nodevar) != (node); \
+ (nodevar)= (nodevar)->part next) { \
+ assert((nodevar)); \
+ } \
+ } while(0)
+
+static void checkc_query_alloc(adns_state ads, adns_query qu) {
+ allocnode *an;
+
+ DLIST_CHECK(qu->allocations, an, , {
+ });
+}
+
+static void checkc_query(adns_state ads, adns_query qu) {
+ adns_query child;
+
+ assert(qu->udpnextserver < ads->nservers);
+ assert(!(qu->udpsent & (~0UL << ads->nservers)));
+ assert(qu->search_pos <= ads->nsearchlist);
+ if (qu->parent) DLIST_ASSERTON(qu, child, qu->parent->children, siblings.);
+}
+
+static void checkc_notcpbuf(adns_state ads) {
+ assert(!ads->tcpsend.used);
+ assert(!ads->tcprecv.used);
+ assert(!ads->tcprecv_skip);
+}
+
+static void checkc_global(adns_state ads) {
+ int i;
+
+ assert(ads->udpsocket >= 0);
+
+ for (i=0; i<ads->nsortlist; i++)
+ assert(!(ads->sortlist[i].base.s_addr & ~ads->sortlist[i].mask.s_addr));
+
+ assert(ads->tcpserver >= 0 && ads->tcpserver < ads->nservers);
+
+ switch (ads->tcpstate) {
+ case server_connecting:
+ assert(ads->tcpsocket >= 0);
+ checkc_notcpbuf(ads);
+ break;
+ case server_disconnected:
+ case server_broken:
+ assert(ads->tcpsocket == -1);
+ checkc_notcpbuf(ads);
+ break;
+ case server_ok:
+ assert(ads->tcpsocket >= 0);
+ assert(ads->tcprecv_skip <= ads->tcprecv.used);
+ break;
+ default:
+ assert(!"ads->tcpstate value");
+ }
+
+ assert(ads->searchlist || !ads->nsearchlist);
+}
+
+static void checkc_queue_udpw(adns_state ads) {
+ adns_query qu;
+
+ DLIST_CHECK(ads->udpw, qu, , {
+ assert(qu->state==query_tosend);
+ assert(qu->retries <= UDPMAXRETRIES);
+ assert(qu->udpsent);
+ assert(!qu->children.head && !qu->children.tail);
+ checkc_query(ads,qu);
+ checkc_query_alloc(ads,qu);
+ });
+}
+
+static void checkc_queue_tcpw(adns_state ads) {
+ adns_query qu;
+
+ DLIST_CHECK(ads->tcpw, qu, , {
+ assert(qu->state==query_tcpw);
+ assert(!qu->children.head && !qu->children.tail);
+ assert(qu->retries <= ads->nservers+1);
+ checkc_query(ads,qu);
+ checkc_query_alloc(ads,qu);
+ });
+}
+
+static void checkc_queue_childw(adns_state ads) {
+ adns_query parent, child;
+
+ DLIST_CHECK(ads->childw, parent, , {
+ assert(parent->state == query_childw);
+ assert(parent->children.head);
+ DLIST_CHECK(parent->children, child, siblings., {
+ assert(child->parent == parent);
+ assert(child->state != query_done);
+ });
+ checkc_query(ads,parent);
+ checkc_query_alloc(ads,parent);
+ });
+}
+
+static void checkc_queue_output(adns_state ads) {
+ adns_query qu;
+
+ DLIST_CHECK(ads->output, qu, , {
+ assert(qu->state == query_done);
+ assert(!qu->children.head && !qu->children.tail);
+ assert(!qu->parent);
+ assert(!qu->allocations.head && !qu->allocations.tail);
+ checkc_query(ads,qu);
+ });
+}
+
+void adns__consistency(adns_state ads, adns_query qu, consistency_checks cc) {
+ adns_query search;
+
+ switch (cc) {
+ case cc_user:
+ break;
+ case cc_entex:
+ if (!(ads->iflags & adns_if_checkc_entex)) return;
+ break;
+ case cc_freq:
+ if ((ads->iflags & adns_if_checkc_freq) != adns_if_checkc_freq) return;
+ break;
+ default:
+ abort();
+ }
+
+ checkc_global(ads);
+ checkc_queue_udpw(ads);
+ checkc_queue_tcpw(ads);
+ checkc_queue_childw(ads);
+ checkc_queue_output(ads);
+
+ if (qu) {
+ switch (qu->state) {
+ case query_tosend:
+ DLIST_ASSERTON(qu, search, ads->udpw, );
+ break;
+ case query_tcpw:
+ DLIST_ASSERTON(qu, search, ads->tcpw, );
+ break;
+ case query_childw:
+ DLIST_ASSERTON(qu, search, ads->childw, );
+ break;
+ case query_done:
+ DLIST_ASSERTON(qu, search, ads->output, );
+ break;
+ default:
+ assert(!"specific query state");
+ }
+ }
+}
diff --git a/adns-0.6/src/config.h.in b/adns-0.6/src/config.h.in
new file mode 100644
index 0000000..93a4ad8
--- /dev/null
+++ b/adns-0.6/src/config.h.in
@@ -0,0 +1,91 @@
+/* src/config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define if function attributes a la GCC 2.5 and higher are available. */
+#undef HAVE_GNUC25_ATTRIB
+
+/* Define if constant functions a la GCC 2.5 and higher are available. */
+#undef HAVE_GNUC25_CONST
+
+/* Define if nonreturning functions a la GCC 2.5 and higher are available. */
+#undef HAVE_GNUC25_NORETURN
+
+/* Define if printf-format argument lists a la GCC are available. */
+#undef HAVE_GNUC25_PRINTFFORMAT
+
+/* Define if we want to include rpc/types.h. Crap BSDs put INADDR_LOOPBACK there. */
+#undef HAVEUSE_RPCTYPES_H
+
+/* Define if you have the poll function. */
+#undef HAVE_POLL
+
+/* Define if you have the nsl library (-lnsl). */
+#undef HAVE_LIBNSL
+
+/* Define if you have the socket library (-lsocket). */
+#undef HAVE_LIBSOCKET
+
+/* Use the definitions: */
+
+#ifdef HAVE_POLL
+#include <sys/poll.h>
+#else
+/* kludge it up */
+struct pollfd { int fd; short events; short revents; };
+#define POLLIN 1
+#define POLLPRI 2
+#define POLLOUT 4
+#endif
+
+/* GNU C attributes. */
+#ifndef FUNCATTR
+#ifdef HAVE_GNUC25_ATTRIB
+#define FUNCATTR(x) __attribute__(x)
+#else
+#define FUNCATTR(x)
+#endif
+#endif
+
+/* GNU C printf formats, or null. */
+#ifndef ATTRPRINTF
+#ifdef HAVE_GNUC25_PRINTFFORMAT
+#define ATTRPRINTF(si,tc) format(printf,si,tc)
+#else
+#define ATTRPRINTF(si,tc)
+#endif
+#endif
+#ifndef PRINTFFORMAT
+#define PRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc)))
+#endif
+
+/* GNU C nonreturning functions, or null. */
+#ifndef ATTRNORETURN
+#ifdef HAVE_GNUC25_NORETURN
+#define ATTRNORETURN noreturn
+#else
+#define ATTRNORETURN
+#endif
+#endif
+#ifndef NONRETURNING
+#define NONRETURNING FUNCATTR((ATTRNORETURN))
+#endif
+
+/* Combination of both the above. */
+#ifndef NONRETURNPRINTFFORMAT
+#define NONRETURNPRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc),ATTRNORETURN))
+#endif
+
+/* GNU C constant functions, or null. */
+#ifndef ATTRCONST
+#ifdef HAVE_GNUC25_CONST
+#define ATTRCONST const
+#else
+#define ATTRCONST
+#endif
+#endif
+#ifndef CONSTANT
+#define CONSTANT FUNCATTR((ATTRCONST))
+#endif
+
+#ifdef HAVEUSE_RPCTYPES_H
+#include <rpc/types.h>
+#endif
diff --git a/adns-0.6/src/dlist.h b/adns-0.6/src/dlist.h
new file mode 100644
index 0000000..de0268f
--- /dev/null
+++ b/adns-0.6/src/dlist.h
@@ -0,0 +1,53 @@
+/*
+ * dlist.h
+ * - macros for handling doubly linked lists
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef ADNS_DLIST_H_INCLUDED
+#define ADNS_DLIST_H_INCLUDED
+
+#define LIST_INIT(list) ((list).head= (list).tail= 0)
+#define LINK_INIT(link) ((link).next= (link).back= 0)
+
+#define LIST_UNLINK_PART(list,node,part) \
+ do { \
+ if ((node)->part back) (node)->part back->part next= (node)->part next; \
+ else (list).head= (node)->part next; \
+ if ((node)->part next) (node)->part next->part back= (node)->part back; \
+ else (list).tail= (node)->part back; \
+ } while(0)
+
+#define LIST_LINK_TAIL_PART(list,node,part) \
+ do { \
+ (node)->part next= 0; \
+ (node)->part back= (list).tail; \
+ if ((list).tail) (list).tail->part next= (node); else (list).head= (node); \
+ (list).tail= (node); \
+ } while(0)
+
+#define LIST_UNLINK(list,node) LIST_UNLINK_PART(list,node,)
+#define LIST_LINK_TAIL(list,node) LIST_LINK_TAIL_PART(list,node,)
+
+#endif
diff --git a/adns-0.6/src/event.c b/adns-0.6/src/event.c
new file mode 100644
index 0000000..a1641c6
--- /dev/null
+++ b/adns-0.6/src/event.c
@@ -0,0 +1,699 @@
+/*
+ * event.c
+ * - event loop core
+ * - TCP connection management
+ * - user-visible check/wait and event-loop-related functions
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "internal.h"
+#include "tvarith.h"
+
+/* TCP connection management. */
+
+static void tcp_close(adns_state ads) {
+ int serv;
+
+ serv= ads->tcpserver;
+ close(ads->tcpsocket);
+ ads->tcpsocket= -1;
+ ads->tcprecv.used= ads->tcprecv_skip= ads->tcpsend.used= 0;
+}
+
+void adns__tcp_broken(adns_state ads, const char *what, const char *why) {
+ int serv;
+
+ assert(ads->tcpstate == server_connecting || ads->tcpstate == server_ok);
+ serv= ads->tcpserver;
+ if (what) adns__warn(ads,serv,0,"TCP connection failed: %s: %s",what,why);
+
+ tcp_close(ads);
+ ads->tcpstate= server_broken;
+ ads->tcpserver= (serv+1)%ads->nservers;
+}
+
+static void tcp_connected(adns_state ads, struct timeval now) {
+ adns_query qu, nqu;
+
+ adns__debug(ads,ads->tcpserver,0,"TCP connected");
+ ads->tcpstate= server_ok;
+ for (qu= ads->tcpw.head; qu && ads->tcpstate == server_ok; qu= nqu) {
+ nqu= qu->next;
+ assert(qu->state == query_tcpw);
+ adns__querysend_tcp(qu,now);
+ }
+}
+
+void adns__tcp_tryconnect(adns_state ads, struct timeval now) {
+ int r, fd, tries;
+ struct sockaddr_in addr;
+ struct protoent *proto;
+
+ for (tries=0; tries<ads->nservers; tries++) {
+ switch (ads->tcpstate) {
+ case server_connecting:
+ case server_ok:
+ case server_broken:
+ return;
+ case server_disconnected:
+ break;
+ default:
+ abort();
+ }
+
+ assert(!ads->tcpsend.used);
+ assert(!ads->tcprecv.used);
+ assert(!ads->tcprecv_skip);
+
+ proto= getprotobyname("tcp");
+ if (!proto) { adns__diag(ads,-1,0,"unable to find protocol no. for TCP !"); return; }
+ fd= socket(AF_INET,SOCK_STREAM,proto->p_proto);
+ if (fd<0) {
+ adns__diag(ads,-1,0,"cannot create TCP socket: %s",strerror(errno));
+ return;
+ }
+ r= adns__setnonblock(ads,fd);
+ if (r) {
+ adns__diag(ads,-1,0,"cannot make TCP socket nonblocking: %s",strerror(r));
+ close(fd);
+ return;
+ }
+ memset(&addr,0,sizeof(addr));
+ addr.sin_family= AF_INET;
+ addr.sin_port= htons(DNS_PORT);
+ addr.sin_addr= ads->servers[ads->tcpserver].addr;
+ r= connect(fd,(const struct sockaddr*)&addr,sizeof(addr));
+ ads->tcpsocket= fd;
+ ads->tcpstate= server_connecting;
+ if (r==0) { tcp_connected(ads,now); return; }
+ if (errno == EWOULDBLOCK || errno == EINPROGRESS) {
+ ads->tcptimeout= now;
+ timevaladd(&ads->tcptimeout,TCPCONNMS);
+ return;
+ }
+ adns__tcp_broken(ads,"connect",strerror(errno));
+ ads->tcpstate= server_disconnected;
+ }
+}
+
+/* Timeout handling functions. */
+
+void adns__must_gettimeofday(adns_state ads, const struct timeval **now_io,
+ struct timeval *tv_buf) {
+ const struct timeval *now;
+ int r;
+
+ now= *now_io;
+ if (now) return;
+ r= gettimeofday(tv_buf,0); if (!r) { *now_io= tv_buf; return; }
+ adns__diag(ads,-1,0,"gettimeofday failed: %s",strerror(errno));
+ adns_globalsystemfailure(ads);
+ return;
+}
+
+static void inter_maxto(struct timeval **tv_io, struct timeval *tvbuf,
+ struct timeval maxto) {
+ struct timeval *rbuf;
+
+ if (!tv_io) return;
+ rbuf= *tv_io;
+ if (!rbuf) {
+ *tvbuf= maxto; *tv_io= tvbuf;
+ } else {
+ if (timercmp(rbuf,&maxto,>)) *rbuf= maxto;
+ }
+/*fprintf(stderr,"inter_maxto maxto=%ld.%06ld result=%ld.%06ld\n",
+ maxto.tv_sec,maxto.tv_usec,(**tv_io).tv_sec,(**tv_io).tv_usec);*/
+}
+
+static void inter_maxtoabs(struct timeval **tv_io, struct timeval *tvbuf,
+ struct timeval now, struct timeval maxtime) {
+ /* tv_io may be 0 */
+ ldiv_t dr;
+
+/*fprintf(stderr,"inter_maxtoabs now=%ld.%06ld maxtime=%ld.%06ld\n",
+ now.tv_sec,now.tv_usec,maxtime.tv_sec,maxtime.tv_usec);*/
+ if (!tv_io) return;
+ maxtime.tv_sec -= (now.tv_sec+2);
+ maxtime.tv_usec -= (now.tv_usec-2000000);
+ dr= ldiv(maxtime.tv_usec,1000000);
+ maxtime.tv_sec += dr.quot;
+ maxtime.tv_usec -= dr.quot*1000000;
+ if (maxtime.tv_sec<0) timerclear(&maxtime);
+ inter_maxto(tv_io,tvbuf,maxtime);
+}
+
+static void timeouts_queue(adns_state ads, int act,
+ struct timeval **tv_io, struct timeval *tvbuf,
+ struct timeval now, struct query_queue *queue) {
+ adns_query qu, nqu;
+
+ for (qu= queue->head; qu; qu= nqu) {
+ nqu= qu->next;
+ if (!timercmp(&now,&qu->timeout,>)) {
+ inter_maxtoabs(tv_io,tvbuf,now,qu->timeout);
+ } else {
+ if (!act) {
+ tvbuf->tv_sec= 0;
+ tvbuf->tv_usec= 0;
+ *tv_io= tvbuf;
+ return;
+ }
+ LIST_UNLINK(*queue,qu);
+ if (qu->state != query_tosend) {
+ adns__query_fail(qu,adns_s_timeout);
+ } else {
+ adns__query_send(qu,now);
+ }
+ nqu= queue->head;
+ }
+ }
+}
+
+static void tcp_events(adns_state ads, int act,
+ struct timeval **tv_io, struct timeval *tvbuf,
+ struct timeval now) {
+ adns_query qu, nqu;
+
+ for (;;) {
+ switch (ads->tcpstate) {
+ case server_broken:
+ for (qu= ads->tcpw.head; qu; qu= nqu) {
+ nqu= qu->next;
+ assert(qu->state == query_tcpw);
+ if (qu->retries > ads->nservers) {
+ LIST_UNLINK(ads->tcpw,qu);
+ adns__query_fail(qu,adns_s_allservfail);
+ }
+ }
+ ads->tcpstate= server_disconnected;
+ case server_disconnected: /* fall through */
+ if (!ads->tcpw.head) return;
+ adns__tcp_tryconnect(ads,now);
+ break;
+ case server_ok:
+ if (ads->tcpw.head) return;
+ if (!ads->tcptimeout.tv_sec) {
+ assert(!ads->tcptimeout.tv_usec);
+ ads->tcptimeout= now;
+ timevaladd(&ads->tcptimeout,TCPIDLEMS);
+ }
+ case server_connecting: /* fall through */
+ if (!timercmp(&now,&ads->tcptimeout,>)) {
+ inter_maxtoabs(tv_io,tvbuf,now,ads->tcptimeout);
+ return;
+ } {
+ /* TCP timeout has happened */
+ switch (ads->tcpstate) {
+ case server_connecting: /* failed to connect */
+ adns__tcp_broken(ads,"unable to make connection","timed out");
+ break;
+ case server_ok: /* idle timeout */
+ tcp_close(ads);
+ ads->tcpstate= server_disconnected;
+ return;
+ default:
+ abort();
+ }
+ }
+ break;
+ default:
+ abort();
+ }
+ }
+}
+
+void adns__timeouts(adns_state ads, int act,
+ struct timeval **tv_io, struct timeval *tvbuf,
+ struct timeval now) {
+ timeouts_queue(ads,act,tv_io,tvbuf,now, &ads->udpw);
+ timeouts_queue(ads,act,tv_io,tvbuf,now, &ads->tcpw);
+ tcp_events(ads,act,tv_io,tvbuf,now);
+}
+
+void adns_firsttimeout(adns_state ads,
+ struct timeval **tv_io, struct timeval *tvbuf,
+ struct timeval now) {
+ adns__consistency(ads,0,cc_entex);
+ adns__timeouts(ads, 0, tv_io,tvbuf, now);
+ adns__consistency(ads,0,cc_entex);
+}
+
+void adns_processtimeouts(adns_state ads, const struct timeval *now) {
+ struct timeval tv_buf;
+
+ adns__consistency(ads,0,cc_entex);
+ adns__must_gettimeofday(ads,&now,&tv_buf);
+ if (now) adns__timeouts(ads, 1, 0,0, *now);
+ adns__consistency(ads,0,cc_entex);
+}
+
+/* fd handling functions. These are the top-level of the real work of
+ * reception and often transmission.
+ */
+
+int adns__pollfds(adns_state ads, struct pollfd pollfds_buf[MAX_POLLFDS]) {
+ /* Returns the number of entries filled in. Always zeroes revents. */
+
+ assert(MAX_POLLFDS==2);
+
+ pollfds_buf[0].fd= ads->udpsocket;
+ pollfds_buf[0].events= POLLIN;
+ pollfds_buf[0].revents= 0;
+
+ switch (ads->tcpstate) {
+ case server_disconnected:
+ return 1;
+ case server_connecting:
+ pollfds_buf[1].events= POLLOUT;
+ break;
+ case server_ok:
+ pollfds_buf[1].events= ads->tcpsend.used ? POLLIN|POLLOUT|POLLPRI : POLLIN|POLLPRI;
+ break;
+ default:
+ abort();
+ }
+ pollfds_buf[1].fd= ads->tcpsocket;
+ return 2;
+}
+
+int adns_processreadable(adns_state ads, int fd, const struct timeval *now) {
+ int want, dgramlen, r, udpaddrlen, serv, old_skip;
+ byte udpbuf[DNS_MAXUDP];
+ struct sockaddr_in udpaddr;
+
+ adns__consistency(ads,0,cc_entex);
+
+ switch (ads->tcpstate) {
+ case server_disconnected:
+ case server_connecting:
+ break;
+ case server_ok:
+ if (fd != ads->tcpsocket) break;
+ assert(!ads->tcprecv_skip);
+ for (;;) {
+ if (ads->tcprecv.used >= ads->tcprecv_skip+2) {
+ dgramlen= ((ads->tcprecv.buf[ads->tcprecv_skip]<<8) |
+ ads->tcprecv.buf[ads->tcprecv_skip+1]);
+ if (ads->tcprecv.used >= ads->tcprecv_skip+2+dgramlen) {
+ old_skip= ads->tcprecv_skip;
+ ads->tcprecv_skip += 2+dgramlen;
+ adns__procdgram(ads, ads->tcprecv.buf+old_skip+2,
+ dgramlen, ads->tcpserver, 1,*now);
+ continue;
+ } else {
+ want= 2+dgramlen;
+ }
+ } else {
+ want= 2;
+ }
+ ads->tcprecv.used -= ads->tcprecv_skip;
+ memmove(ads->tcprecv.buf,ads->tcprecv.buf+ads->tcprecv_skip,ads->tcprecv.used);
+ ads->tcprecv_skip= 0;
+ if (!adns__vbuf_ensure(&ads->tcprecv,want)) { r= ENOMEM; goto xit; }
+ assert(ads->tcprecv.used <= ads->tcprecv.avail);
+ if (ads->tcprecv.used == ads->tcprecv.avail) continue;
+ r= read(ads->tcpsocket,
+ ads->tcprecv.buf+ads->tcprecv.used,
+ ads->tcprecv.avail-ads->tcprecv.used);
+ if (r>0) {
+ ads->tcprecv.used+= r;
+ } else {
+ if (r) {
+ if (errno==EAGAIN || errno==EWOULDBLOCK) { r= 0; goto xit; }
+ if (errno==EINTR) continue;
+ if (errno_resources(errno)) { r= errno; goto xit; }
+ }
+ adns__tcp_broken(ads,"read",r?strerror(errno):"closed");
+ r= 0; goto xit;
+ }
+ } /* never reached */
+ default:
+ abort();
+ }
+ if (fd == ads->udpsocket) {
+ for (;;) {
+ udpaddrlen= sizeof(udpaddr);
+ r= recvfrom(ads->udpsocket,udpbuf,sizeof(udpbuf),0,
+ (struct sockaddr*)&udpaddr,&udpaddrlen);
+ if (r<0) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK) { r= 0; goto xit; }
+ if (errno == EINTR) continue;
+ if (errno_resources(errno)) { r= errno; goto xit; }
+ adns__warn(ads,-1,0,"datagram receive error: %s",strerror(errno));
+ r= 0; goto xit;
+ }
+ if (udpaddrlen != sizeof(udpaddr)) {
+ adns__diag(ads,-1,0,"datagram received with wrong address length %d"
+ " (expected %d)", udpaddrlen,sizeof(udpaddr));
+ continue;
+ }
+ if (udpaddr.sin_family != AF_INET) {
+ adns__diag(ads,-1,0,"datagram received with wrong protocol family"
+ " %u (expected %u)",udpaddr.sin_family,AF_INET);
+ continue;
+ }
+ if (ntohs(udpaddr.sin_port) != DNS_PORT) {
+ adns__diag(ads,-1,0,"datagram received from wrong port %u (expected %u)",
+ ntohs(udpaddr.sin_port),DNS_PORT);
+ continue;
+ }
+ for (serv= 0;
+ serv < ads->nservers &&
+ ads->servers[serv].addr.s_addr != udpaddr.sin_addr.s_addr;
+ serv++);
+ if (serv >= ads->nservers) {
+ adns__warn(ads,-1,0,"datagram received from unknown nameserver %s",
+ inet_ntoa(udpaddr.sin_addr));
+ continue;
+ }
+ adns__procdgram(ads,udpbuf,r,serv,0,*now);
+ }
+ }
+ r= 0;
+xit:
+ adns__consistency(ads,0,cc_entex);
+ return r;
+}
+
+int adns_processwriteable(adns_state ads, int fd, const struct timeval *now) {
+ int r;
+
+ adns__consistency(ads,0,cc_entex);
+
+ switch (ads->tcpstate) {
+ case server_disconnected:
+ break;
+ case server_connecting:
+ if (fd != ads->tcpsocket) break;
+ assert(ads->tcprecv.used==0);
+ assert(ads->tcprecv_skip==0);
+ for (;;) {
+ if (!adns__vbuf_ensure(&ads->tcprecv,1)) { r= ENOMEM; goto xit; }
+ r= read(ads->tcpsocket,&ads->tcprecv.buf,1);
+ if (r==0 || (r<0 && (errno==EAGAIN || errno==EWOULDBLOCK))) {
+ tcp_connected(ads,*now);
+ r= 0; goto xit;
+ }
+ if (r>0) {
+ adns__tcp_broken(ads,"connect/read","sent data before first request");
+ r= 0; goto xit;
+ }
+ if (errno==EINTR) continue;
+ if (errno_resources(errno)) { r= errno; goto xit; }
+ adns__tcp_broken(ads,"connect/read",strerror(errno));
+ r= 0; goto xit;
+ } /* not reached */
+ case server_ok:
+ if (!(ads->tcpsend.used && fd == ads->tcpsocket)) break;
+ for (;;) {
+ adns__sigpipe_protect(ads);
+ r= write(ads->tcpsocket,ads->tcpsend.buf,ads->tcpsend.used);
+ adns__sigpipe_unprotect(ads);
+ if (r<0) {
+ if (errno==EINTR) continue;
+ if (errno==EAGAIN || errno==EWOULDBLOCK) { r= 0; goto xit; }
+ if (errno_resources(errno)) { r= errno; goto xit; }
+ adns__tcp_broken(ads,"write",strerror(errno));
+ r= 0; goto xit;
+ } else if (r>0) {
+ ads->tcpsend.used -= r;
+ memmove(ads->tcpsend.buf,ads->tcpsend.buf+r,ads->tcpsend.used);
+ }
+ } /* not reached */
+ default:
+ abort();
+ }
+ r= 0;
+xit:
+ adns__consistency(ads,0,cc_entex);
+ return r;
+}
+
+int adns_processexceptional(adns_state ads, int fd, const struct timeval *now) {
+ adns__consistency(ads,0,cc_entex);
+ switch (ads->tcpstate) {
+ case server_disconnected:
+ break;
+ case server_connecting:
+ case server_ok:
+ if (fd != ads->tcpsocket) break;
+ adns__tcp_broken(ads,"poll/select","exceptional condition detected");
+ break;
+ default:
+ abort();
+ }
+ adns__consistency(ads,0,cc_entex);
+ return 0;
+}
+
+static void fd_event(adns_state ads, int fd,
+ int revent, int pollflag,
+ int maxfd, const fd_set *fds,
+ int (*func)(adns_state, int fd, const struct timeval *now),
+ struct timeval now, int *r_r) {
+ int r;
+
+ if (!(revent & pollflag)) return;
+ if (fds && !(fd<maxfd && FD_ISSET(fd,fds))) return;
+ r= func(ads,fd,&now);
+ if (r) {
+ if (r_r) {
+ *r_r= r;
+ } else {
+ adns__diag(ads,-1,0,"process fd failed after select: %s",strerror(errno));
+ adns_globalsystemfailure(ads);
+ }
+ }
+}
+
+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) {
+ int i, fd, revents;
+
+ for (i=0; i<npollfds; i++) {
+ fd= pollfds[i].fd;
+ if (fd >= maxfd) maxfd= fd+1;
+ revents= pollfds[i].revents;
+ fd_event(ads,fd, revents,POLLIN, maxfd,readfds, adns_processreadable,now,r_r);
+ fd_event(ads,fd, revents,POLLOUT, maxfd,writefds, adns_processwriteable,now,r_r);
+ fd_event(ads,fd, revents,POLLPRI, maxfd,exceptfds, adns_processexceptional,now,r_r);
+ }
+}
+
+/* Wrappers for select(2). */
+
+void adns_beforeselect(adns_state ads, int *maxfd_io, fd_set *readfds_io,
+ fd_set *writefds_io, fd_set *exceptfds_io,
+ struct timeval **tv_mod, struct timeval *tv_tobuf,
+ const struct timeval *now) {
+ struct timeval tv_nowbuf;
+ struct pollfd pollfds[MAX_POLLFDS];
+ int i, fd, maxfd, npollfds;
+
+ adns__consistency(ads,0,cc_entex);
+
+ if (tv_mod && (!*tv_mod || (*tv_mod)->tv_sec || (*tv_mod)->tv_usec)) {
+ /* The caller is planning to sleep. */
+ adns__must_gettimeofday(ads,&now,&tv_nowbuf);
+ if (!now) goto xit;
+ adns__timeouts(ads, 1, tv_mod,tv_tobuf, *now);
+ }
+
+ npollfds= adns__pollfds(ads,pollfds);
+ maxfd= *maxfd_io;
+ for (i=0; i<npollfds; i++) {
+ fd= pollfds[i].fd;
+ if (fd >= maxfd) maxfd= fd+1;
+ if (pollfds[i].events & POLLIN) FD_SET(fd,readfds_io);
+ if (pollfds[i].events & POLLOUT) FD_SET(fd,writefds_io);
+ if (pollfds[i].events & POLLPRI) FD_SET(fd,exceptfds_io);
+ }
+ *maxfd_io= maxfd;
+
+xit:
+ adns__consistency(ads,0,cc_entex);
+}
+
+void adns_afterselect(adns_state ads, int maxfd, const fd_set *readfds,
+ const fd_set *writefds, const fd_set *exceptfds,
+ const struct timeval *now) {
+ struct timeval tv_buf;
+ struct pollfd pollfds[MAX_POLLFDS];
+ int npollfds, i;
+
+ adns__consistency(ads,0,cc_entex);
+ adns__must_gettimeofday(ads,&now,&tv_buf);
+ if (!now) goto xit;
+ adns_processtimeouts(ads,now);
+
+ npollfds= adns__pollfds(ads,pollfds);
+ for (i=0; i<npollfds; i++) pollfds[i].revents= POLLIN|POLLOUT|POLLPRI;
+ adns__fdevents(ads,
+ pollfds,npollfds,
+ maxfd,readfds,writefds,exceptfds,
+ *now, 0);
+xit:
+ adns__consistency(ads,0,cc_entex);
+}
+
+/* General helpful functions. */
+
+void adns_globalsystemfailure(adns_state ads) {
+ adns__consistency(ads,0,cc_entex);
+
+ while (ads->udpw.head) adns__query_fail(ads->udpw.head, adns_s_systemfail);
+ while (ads->tcpw.head) adns__query_fail(ads->tcpw.head, adns_s_systemfail);
+
+ switch (ads->tcpstate) {
+ case server_connecting:
+ case server_ok:
+ adns__tcp_broken(ads,0,0);
+ break;
+ case server_disconnected:
+ break;
+ default:
+ abort();
+ }
+ adns__consistency(ads,0,cc_entex);
+}
+
+int adns_processany(adns_state ads) {
+ int r, i;
+ struct timeval now;
+ struct pollfd pollfds[MAX_POLLFDS];
+ int npollfds;
+
+ adns__consistency(ads,0,cc_entex);
+
+ r= gettimeofday(&now,0);
+ if (!r) adns_processtimeouts(ads,&now);
+
+ /* We just use adns__fdevents to loop over the fd's trying them.
+ * This seems more sensible than calling select, since we're most
+ * likely just to want to do a read on one or two fds anyway.
+ */
+ npollfds= adns__pollfds(ads,pollfds);
+ for (i=0; i<npollfds; i++) pollfds[i].revents= pollfds[i].events;
+ adns__fdevents(ads,
+ pollfds,npollfds,
+ 0,0,0,0,
+ now,&r);
+
+ adns__consistency(ads,0,cc_entex);
+ return 0;
+}
+
+void adns__autosys(adns_state ads, struct timeval now) {
+ if (ads->iflags & adns_if_noautosys) return;
+ adns_processany(ads);
+}
+
+int adns__internal_check(adns_state ads,
+ adns_query *query_io,
+ adns_answer **answer,
+ void **context_r) {
+ adns_query qu;
+
+ qu= *query_io;
+ if (!qu) {
+ if (ads->output.head) {
+ qu= ads->output.head;
+ } else if (ads->udpw.head || ads->tcpw.head) {
+ return EAGAIN;
+ } else {
+ return ESRCH;
+ }
+ } else {
+ if (qu->id>=0) return EAGAIN;
+ }
+ LIST_UNLINK(ads->output,qu);
+ *answer= qu->answer;
+ if (context_r) *context_r= qu->ctx.ext;
+ *query_io= qu;
+ free(qu);
+ return 0;
+}
+
+int adns_wait(adns_state ads,
+ adns_query *query_io,
+ adns_answer **answer_r,
+ void **context_r) {
+ int r, maxfd, rsel;
+ fd_set readfds, writefds, exceptfds;
+ struct timeval tvbuf, *tvp;
+
+ adns__consistency(ads,*query_io,cc_entex);
+ for (;;) {
+ r= adns__internal_check(ads,query_io,answer_r,context_r);
+ if (r != EAGAIN) break;
+ maxfd= 0; tvp= 0;
+ FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds);
+ adns_beforeselect(ads,&maxfd,&readfds,&writefds,&exceptfds,&tvp,&tvbuf,0);
+ rsel= select(maxfd,&readfds,&writefds,&exceptfds,tvp);
+ if (rsel==-1) {
+ if (errno == EINTR) {
+ if (ads->iflags & adns_if_eintr) { r= EINTR; break; }
+ } else {
+ adns__diag(ads,-1,0,"select failed in wait: %s",strerror(errno));
+ adns_globalsystemfailure(ads);
+ }
+ } else {
+ assert(rsel >= 0);
+ adns_afterselect(ads,maxfd,&readfds,&writefds,&exceptfds,0);
+ }
+ }
+ adns__consistency(ads,0,cc_entex);
+ return r;
+}
+
+int adns_check(adns_state ads,
+ adns_query *query_io,
+ adns_answer **answer_r,
+ void **context_r) {
+ struct timeval now;
+ int r;
+
+ adns__consistency(ads,*query_io,cc_entex);
+ r= gettimeofday(&now,0);
+ if (!r) adns__autosys(ads,now);
+
+ r= adns__internal_check(ads,query_io,answer_r,context_r);
+ adns__consistency(ads,0,cc_entex);
+ return r;
+}
diff --git a/adns-0.6/src/general.c b/adns-0.6/src/general.c
new file mode 100644
index 0000000..8793762
--- /dev/null
+++ b/adns-0.6/src/general.c
@@ -0,0 +1,360 @@
+/*
+ * general.c
+ * - diagnostic functions
+ * - vbuf handling
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "internal.h"
+
+/* Core diagnostic functions */
+
+void adns__vdiag(adns_state ads, const char *pfx, adns_initflags prevent,
+ int serv, adns_query qu, const char *fmt, va_list al) {
+ const char *bef, *aft;
+ vbuf vb;
+
+ if (!ads->diagfile ||
+ (!(ads->iflags & adns_if_debug) && (!prevent || (ads->iflags & prevent))))
+ return;
+
+ if (ads->iflags & adns_if_logpid) {
+ fprintf(ads->diagfile,"adns%s [%ld]: ",pfx,(long)getpid());
+ } else {
+ fprintf(ads->diagfile,"adns%s: ",pfx);
+ }
+
+ vfprintf(ads->diagfile,fmt,al);
+
+ bef= " (";
+ aft= "\n";
+
+ if (qu && qu->query_dgram) {
+ adns__vbuf_init(&vb);
+ fprintf(ads->diagfile,"%sQNAME=%s, QTYPE=%s",
+ bef,
+ adns__diag_domain(qu->ads,-1,0, &vb,
+ qu->query_dgram,qu->query_dglen,DNS_HDRSIZE),
+ qu->typei ? qu->typei->rrtname : "<unknown>");
+ if (qu->typei && qu->typei->fmtname)
+ fprintf(ads->diagfile,"(%s)",qu->typei->fmtname);
+ bef=", "; aft=")\n";
+ adns__vbuf_free(&vb);
+ }
+
+ if (serv>=0) {
+ fprintf(ads->diagfile,"%sNS=%s",bef,inet_ntoa(ads->servers[serv].addr));
+ bef=", "; aft=")\n";
+ }
+
+ fputs(aft,ads->diagfile);
+}
+
+void adns__debug(adns_state ads, int serv, adns_query qu, const char *fmt, ...) {
+ va_list al;
+
+ va_start(al,fmt);
+ adns__vdiag(ads," debug",0,serv,qu,fmt,al);
+ va_end(al);
+}
+
+void adns__warn(adns_state ads, int serv, adns_query qu, const char *fmt, ...) {
+ va_list al;
+
+ va_start(al,fmt);
+ adns__vdiag(ads," warning",adns_if_noerrprint|adns_if_noserverwarn,serv,qu,fmt,al);
+ va_end(al);
+}
+
+void adns__diag(adns_state ads, int serv, adns_query qu, const char *fmt, ...) {
+ va_list al;
+
+ va_start(al,fmt);
+ adns__vdiag(ads,"",adns_if_noerrprint,serv,qu,fmt,al);
+ va_end(al);
+}
+
+/* vbuf functions */
+
+void adns__vbuf_init(vbuf *vb) {
+ vb->used= vb->avail= 0; vb->buf= 0;
+}
+
+int adns__vbuf_ensure(vbuf *vb, int want) {
+ void *nb;
+
+ if (vb->avail >= want) return 1;
+ nb= realloc(vb->buf,want); if (!nb) return 0;
+ vb->buf= nb;
+ vb->avail= want;
+ return 1;
+}
+
+void adns__vbuf_appendq(vbuf *vb, const byte *data, int len) {
+ memcpy(vb->buf+vb->used,data,len);
+ vb->used+= len;
+}
+
+int adns__vbuf_append(vbuf *vb, const byte *data, int len) {
+ int newlen;
+ void *nb;
+
+ newlen= vb->used+len;
+ if (vb->avail < newlen) {
+ if (newlen<20) newlen= 20;
+ newlen <<= 1;
+ nb= realloc(vb->buf,newlen);
+ if (!nb) { newlen= vb->used+len; nb= realloc(vb->buf,newlen); }
+ if (!nb) return 0;
+ vb->buf= nb;
+ vb->avail= newlen;
+ }
+ adns__vbuf_appendq(vb,data,len);
+ return 1;
+}
+
+int adns__vbuf_appendstr(vbuf *vb, const char *data) {
+ int l;
+ l= strlen(data);
+ return adns__vbuf_append(vb,data,l);
+}
+
+void adns__vbuf_free(vbuf *vb) {
+ free(vb->buf);
+ adns__vbuf_init(vb);
+}
+
+/* Additional diagnostic functions */
+
+const char *adns__diag_domain(adns_state ads, int serv, adns_query qu,
+ vbuf *vb, const byte *dgram, int dglen, int cbyte) {
+ adns_status st;
+
+ st= adns__parse_domain(ads,serv,qu,vb, pdf_quoteok, dgram,dglen,&cbyte,dglen);
+ if (st == adns_s_nomemory) {
+ return "<cannot report domain... out of memory>";
+ }
+ if (st) {
+ vb->used= 0;
+ if (!(adns__vbuf_appendstr(vb,"<bad format... ") &&
+ adns__vbuf_appendstr(vb,adns_strerror(st)) &&
+ adns__vbuf_appendstr(vb,">") &&
+ adns__vbuf_append(vb,"",1))) {
+ return "<cannot report bad format... out of memory>";
+ }
+ }
+ if (!vb->used) {
+ adns__vbuf_appendstr(vb,"<truncated ...>");
+ adns__vbuf_append(vb,"",1);
+ }
+ return vb->buf;
+}
+
+adns_status adns_rr_info(adns_rrtype type,
+ const char **rrtname_r, const char **fmtname_r,
+ int *len_r,
+ const void *datap, char **data_r) {
+ const typeinfo *typei;
+ vbuf vb;
+ adns_status st;
+
+ typei= adns__findtype(type);
+ if (!typei) return adns_s_unknownrrtype;
+
+ if (rrtname_r) *rrtname_r= typei->rrtname;
+ if (fmtname_r) *fmtname_r= typei->fmtname;
+ if (len_r) *len_r= typei->rrsz;
+
+ if (!datap) return adns_s_ok;
+
+ adns__vbuf_init(&vb);
+ st= typei->convstring(&vb,datap);
+ if (st) goto x_freevb;
+ if (!adns__vbuf_append(&vb,"",1)) { st= adns_s_nomemory; goto x_freevb; }
+ assert(strlen(vb.buf) == vb.used-1);
+ *data_r= realloc(vb.buf,vb.used);
+ if (!*data_r) *data_r= vb.buf;
+ return adns_s_ok;
+
+ x_freevb:
+ adns__vbuf_free(&vb);
+ return st;
+}
+
+
+#define SINFO(n,s) { adns_s_##n, #n, s }
+
+static const struct sinfo {
+ adns_status st;
+ const char *abbrev;
+ const char *string;
+} sinfos[]= {
+ SINFO( ok, "OK" ),
+
+ SINFO( nomemory, "Out of memory" ),
+ SINFO( unknownrrtype, "Query not implemented in DNS library" ),
+ SINFO( systemfail, "General resolver or system failure" ),
+
+ SINFO( timeout, "DNS query timed out" ),
+ SINFO( allservfail, "All nameservers failed" ),
+ SINFO( norecurse, "Recursion denied by nameserver" ),
+ SINFO( invalidresponse, "Nameserver sent bad response" ),
+ SINFO( unknownformat, "Nameserver used unknown format" ),
+
+ SINFO( rcodeservfail, "Nameserver reports failure" ),
+ SINFO( rcodeformaterror, "Query not understood by nameserver" ),
+ SINFO( rcodenotimplemented, "Query not implemented by nameserver" ),
+ SINFO( rcoderefused, "Query refused by nameserver" ),
+ SINFO( rcodeunknown, "Nameserver sent unknown response code" ),
+
+ SINFO( inconsistent, "Inconsistent resource records in DNS" ),
+ SINFO( prohibitedcname, "DNS alias found where canonical name wanted" ),
+ SINFO( answerdomaininvalid, "Found syntactically invalid domain name" ),
+ SINFO( answerdomaintoolong, "Found overly-long domain name" ),
+ SINFO( invaliddata, "Found invalid DNS data" ),
+
+ SINFO( querydomainwrong, "Domain invalid for particular DNS query type" ),
+ SINFO( querydomaininvalid, "Domain name is syntactically invalid" ),
+ SINFO( querydomaintoolong, "Domain name is too long" ),
+
+ SINFO( nxdomain, "No such domain" ),
+ SINFO( nodata, "No such data" )
+};
+
+static int si_compar(const void *key, const void *elem) {
+ const adns_status *st= key;
+ const struct sinfo *si= elem;
+
+ return *st < si->st ? -1 : *st > si->st ? 1 : 0;
+}
+
+static const struct sinfo *findsinfo(adns_status st) {
+ return bsearch(&st,sinfos,sizeof(sinfos)/sizeof(*sinfos),sizeof(*sinfos),si_compar);
+}
+
+const char *adns_strerror(adns_status st) {
+ const struct sinfo *si;
+
+ si= findsinfo(st);
+ return si->string;
+}
+
+const char *adns_errabbrev(adns_status st) {
+ const struct sinfo *si;
+
+ si= findsinfo(st);
+ return si->abbrev;
+}
+
+
+#define STINFO(max) { adns_s_max_##max, #max }
+
+static const struct stinfo {
+ adns_status stmax;
+ const char *abbrev;
+} stinfos[]= {
+ { adns_s_ok, "ok" },
+ STINFO( localfail ),
+ STINFO( remotefail ),
+ STINFO( tempfail ),
+ STINFO( misconfig ),
+ STINFO( misquery ),
+ STINFO( permfail )
+};
+
+static int sti_compar(const void *key, const void *elem) {
+ const adns_status *st= key;
+ const struct stinfo *sti= elem;
+
+ adns_status here, min, max;
+
+ here= *st;
+ min= (sti==stinfos) ? 0 : sti[-1].stmax+1;
+ max= sti->stmax;
+
+ return here < min ? -1 : here > max ? 1 : 0;
+}
+
+const char *adns_errtypeabbrev(adns_status st) {
+ const struct stinfo *sti;
+
+ sti= bsearch(&st,stinfos,sizeof(stinfos)/sizeof(*stinfos),sizeof(*stinfos),sti_compar);
+ return sti->abbrev;
+}
+
+
+void adns__isort(void *array, int nobjs, int sz, void *tempbuf,
+ int (*needswap)(void *context, const void *a, const void *b),
+ void *context) {
+ byte *data= array;
+ int i, place;
+
+ for (i=0; i<nobjs; i++) {
+ for (place= i;
+ place>0 && needswap(context, data + (place-1)*sz, data + i*sz);
+ place--);
+ if (place != i) {
+ memcpy(tempbuf, data + i*sz, sz);
+ memmove(data + (place+1)*sz, data + place*sz, (i-place)*sz);
+ memcpy(data + place*sz, tempbuf, sz);
+ }
+ }
+}
+
+/* SIGPIPE protection. */
+
+void adns__sigpipe_protect(adns_state ads) {
+ sigset_t toblock;
+ struct sigaction sa;
+ int r;
+
+ if (ads->iflags & adns_if_nosigpipe) return;
+
+ sigfillset(&toblock);
+ sigdelset(&toblock,SIGPIPE);
+
+ sa.sa_handler= SIG_IGN;
+ sigfillset(&sa.sa_mask);
+ sa.sa_flags= 0;
+
+ r= sigprocmask(SIG_SETMASK,&toblock,&ads->stdsigmask); assert(!r);
+ r= sigaction(SIGPIPE,&sa,&ads->stdsigpipe); assert(!r);
+}
+
+void adns__sigpipe_unprotect(adns_state ads) {
+ int r;
+
+ if (ads->iflags & adns_if_nosigpipe) return;
+
+ r= sigaction(SIGPIPE,&ads->stdsigpipe,0); assert(!r);
+ r= sigprocmask(SIG_SETMASK,&ads->stdsigmask,0); assert(!r);
+}
diff --git a/adns-0.6/src/internal.h b/adns-0.6/src/internal.h
new file mode 100644
index 0000000..9e442fe
--- /dev/null
+++ b/adns-0.6/src/internal.h
@@ -0,0 +1,705 @@
+/*
+ * internal.h
+ * - declarations of private objects with external linkage (adns__*)
+ * - definitons of internal macros
+ * - comments regarding library data structures
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef ADNS_INTERNAL_H_INCLUDED
+#define ADNS_INTERNAL_H_INCLUDED
+
+#include "config.h"
+typedef unsigned char byte;
+
+#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"
+
+/* Configuration and constants */
+
+#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_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
+
+typedef enum {
+ cc_user,
+ cc_entex,
+ cc_freq
+} consistency_checks;
+
+typedef enum {
+ rcode_noerror,
+ rcode_formaterror,
+ rcode_servfail,
+ rcode_nxdomain,
+ rcode_notimp,
+ rcode_refused
+} dns_rcode;
+
+/* Shared data structures */
+
+typedef union {
+ adns_status status;
+ char *cp;
+ adns_rrtype type;
+ int i;
+ struct in_addr ia;
+ unsigned long ul;
+} rr_align;
+
+typedef struct {
+ int used, avail;
+ byte *buf;
+} vbuf;
+
+typedef struct {
+ adns_state ads;
+ adns_query qu;
+ int serv;
+ const byte *dgram;
+ int dglen, nsstart, nscount, arcount;
+ struct timeval now;
+} parseinfo;
+
+typedef struct {
+ adns_rrtype type;
+ const char *rrtname;
+ const char *fmtname;
+ int rrsz;
+
+ void (*makefinal)(adns_query qu, void *data);
+ /* Change memory management of *data.
+ * Previously, used alloc_interim, now use alloc_final.
+ */
+
+ adns_status (*convstring)(vbuf *vb, const void *data);
+ /* Converts the RR data to a string representation in vbuf.
+ * vbuf will be appended to (it must have been initialised),
+ * and will not be null-terminated by convstring.
+ */
+
+ adns_status (*parse)(const parseinfo *pai, int cbyte, int max, void *store_r);
+ /* Parse one RR, in dgram of length dglen, starting at cbyte and
+ * extending until at most max.
+ *
+ * The RR should be stored at *store_r, of length qu->typei->rrsz.
+ *
+ * If there is an overrun which might indicate truncation, it should set
+ * *rdstart to -1; otherwise it may set it to anything else positive.
+ *
+ * nsstart is the offset of the authority section.
+ */
+
+ int (*diff_needswap)(adns_state ads, const void *datap_a, const void *datap_b);
+ /* Returns !0 if RR a should be strictly after RR b in the sort order,
+ * 0 otherwise. Must not fail.
+ */
+} typeinfo;
+
+typedef struct allocnode {
+ struct allocnode *next, *back;
+} allocnode;
+
+union maxalign {
+ byte d[1];
+ struct in_addr ia;
+ long l;
+ void *p;
+ void (*fp)(void);
+ union maxalign *up;
+} data;
+
+typedef struct {
+ void *ext;
+ void (*callback)(adns_query parent, adns_query child);
+ union {
+ adns_rr_addr ptr_parent_addr;
+ adns_rr_hostaddr *hostaddr;
+ } info;
+} qcontext;
+
+struct adns__query {
+ adns_state ads;
+ enum { query_tosend, query_tcpw, query_childw, query_done } state;
+ adns_query back, next, parent;
+ struct { adns_query head, tail; } children;
+ struct { adns_query back, next; } siblings;
+ struct { allocnode *head, *tail; } allocations;
+ int interim_allocd, preserved_allocd;
+ void *final_allocspace;
+
+ const typeinfo *typei;
+ byte *query_dgram;
+ int query_dglen;
+
+ vbuf vb;
+ /* General-purpose messing-about buffer.
+ * Wherever a `big' interface is crossed, this may be corrupted/changed
+ * unless otherwise specified.
+ */
+
+ adns_answer *answer;
+ /* This is allocated when a query is submitted, to avoid being unable
+ * to relate errors to queries if we run out of memory. During
+ * query processing status, rrs is 0. cname is set if
+ * we found a cname (this corresponds to cname_dgram in the query
+ * structure). type is set from the word go. nrrs and rrs
+ * are set together, when we find how many rrs there are.
+ * owner is set during querying unless we're doing searchlist,
+ * in which case it is set only when we find an answer.
+ */
+
+ byte *cname_dgram;
+ int cname_dglen, cname_begin;
+ /* If non-0, has been allocated using . */
+
+ vbuf search_vb;
+ int search_origlen, search_pos, search_doneabs;
+ /* Used by the searching algorithm. The query domain in textual form
+ * is copied into the vbuf, and _origlen set to its length. Then
+ * we walk the searchlist, if we want to. _pos says where we are
+ * (next entry to try), and _doneabs says whether we've done the
+ * absolute query yet (0=not yet, 1=done, -1=must do straight away,
+ * but not done yet). If flags doesn't have adns_qf_search then
+ * the vbuf is initialised but empty and everything else is zero.
+ */
+
+ int id, flags, retries;
+ int udpnextserver;
+ unsigned long udpsent; /* bitmap indexed by server */
+ struct timeval timeout;
+ time_t expires; /* Earliest expiry time of any record we used. */
+
+ qcontext ctx;
+
+ /* Possible states:
+ *
+ * state Queue child id nextudpserver udpsent tcpfailed
+ *
+ * tosend NONE null >=0 0 zero zero
+ * tosend udpw null >=0 any nonzero zero
+ * tosend NONE null >=0 any nonzero zero
+ *
+ * tcpw tcpw null >=0 irrelevant any any
+ *
+ * child childw set >=0 irrelevant irrelevant irrelevant
+ * child NONE null >=0 irrelevant irrelevant irrelevant
+ * done output null -1 irrelevant irrelevant irrelevant
+ *
+ * Queries are only not on a queue when they are actually being processed.
+ * Queries in state tcpw/tcpw have been sent (or are in the to-send buffer)
+ * iff the tcp connection is in state server_ok.
+ *
+ * +------------------------+
+ * START -----> | tosend/NONE |
+ * +------------------------+
+ * / |\ \
+ * too big for UDP / UDP timeout \ \ send via UDP
+ * send via TCP / more retries \ \
+ * when conn'd / desired \ \
+ * | | |
+ * v | v
+ * +-----------+ +-------------+
+ * | tcpw/tcpw | ________ | tosend/udpw |
+ * +-----------+ \ +-------------+
+ * | | | UDP timeout | |
+ * | | | no more | |
+ * | | | retries | |
+ * \ | TCP died | desired | |
+ * \ \ no more | | |
+ * \ \ servers | TCP / |
+ * \ \ to try | timeout / |
+ * got \ \ v |_ | got
+ * reply \ _| +------------------+ / reply
+ * \ | done/output FAIL | /
+ * \ +------------------+ /
+ * \ /
+ * _| |_
+ * (..... got reply ....)
+ * / \
+ * need child query/ies / \ no child query
+ * / \
+ * |_ _|
+ * +---------------+ +----------------+
+ * | childw/childw | ----------------> | done/output OK |
+ * +---------------+ children done +----------------+
+ */
+};
+
+struct query_queue { adns_query head, tail; };
+
+struct adns__state {
+ adns_initflags iflags;
+ FILE *diagfile;
+ int configerrno;
+ struct query_queue udpw, tcpw, childw, output;
+ adns_query forallnext;
+ int nextid, udpsocket, tcpsocket;
+ vbuf tcpsend, tcprecv;
+ int nservers, nsortlist, nsearchlist, searchndots, tcpserver, tcprecv_skip;
+ enum adns__tcpstate {
+ server_disconnected, server_connecting,
+ 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.
+ */
+ struct sigaction stdsigpipe;
+ sigset_t stdsigmask;
+ struct pollfd pollfds_buf[MAX_POLLFDS];
+ struct server {
+ struct in_addr addr;
+ } servers[MAXSERVERS];
+ struct sortlist {
+ struct in_addr base, mask;
+ } sortlist[MAXSORTLIST];
+ char **searchlist;
+};
+
+/* From setup.c: */
+
+int adns__setnonblock(adns_state ads, int fd); /* => errno value */
+
+/* From general.c: */
+
+void adns__vdiag(adns_state ads, const char *pfx, adns_initflags prevent,
+ int serv, adns_query qu, const char *fmt, va_list al);
+
+void adns__debug(adns_state ads, int serv, adns_query qu,
+ const char *fmt, ...) PRINTFFORMAT(4,5);
+void adns__warn(adns_state ads, int serv, adns_query qu,
+ const char *fmt, ...) PRINTFFORMAT(4,5);
+void adns__diag(adns_state ads, int serv, adns_query qu,
+ const char *fmt, ...) PRINTFFORMAT(4,5);
+
+int adns__vbuf_ensure(vbuf *vb, int want);
+int adns__vbuf_appendstr(vbuf *vb, const char *data); /* does not include nul */
+int adns__vbuf_append(vbuf *vb, const byte *data, int len);
+/* 1=>success, 0=>realloc failed */
+void adns__vbuf_appendq(vbuf *vb, const byte *data, int len);
+void adns__vbuf_init(vbuf *vb);
+void adns__vbuf_free(vbuf *vb);
+
+const char *adns__diag_domain(adns_state ads, int serv, adns_query qu,
+ vbuf *vb, const byte *dgram, int dglen, int cbyte);
+/* Unpicks a domain in a datagram and returns a string suitable for
+ * printing it as. Never fails - if an error occurs, it will
+ * return some kind of string describing the error.
+ *
+ * serv may be -1 and qu may be 0. vb must have been initialised,
+ * and will be left in an arbitrary consistent state.
+ *
+ * Returns either vb->buf, or a pointer to a string literal. Do not modify
+ * vb before using the return value.
+ */
+
+void adns__isort(void *array, int nobjs, int sz, void *tempbuf,
+ int (*needswap)(void *context, const void *a, const void *b),
+ void *context);
+/* Does an insertion sort of array which must contain nobjs objects
+ * each sz bytes long. tempbuf must point to a buffer at least
+ * sz bytes long. needswap should return !0 if a>b (strictly, ie
+ * wrong order) 0 if a<=b (ie, order is fine).
+ */
+
+void adns__sigpipe_protect(adns_state);
+void adns__sigpipe_unprotect(adns_state);
+/* If SIGPIPE protection is not disabled, will block all signals except
+ * SIGPIPE, and set SIGPIPE's disposition to SIG_IGN. (And then restore.)
+ * Each call to _protect must be followed by a call to _unprotect before
+ * any significant amount of code gets to run, since the old signal mask
+ * is stored in the adns structure.
+ */
+
+/* From transmit.c: */
+
+adns_status adns__mkquery(adns_state ads, vbuf *vb, int *id_r,
+ const char *owner, int ol,
+ const typeinfo *typei, adns_queryflags flags);
+/* Assembles a query packet in vb. A new id is allocated and returned.
+ */
+
+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);
+/* Same as adns__mkquery, but takes the owner domain from an existing datagram.
+ * That domain must be correct and untruncated.
+ */
+
+void adns__querysend_tcp(adns_query qu, struct timeval now);
+/* Query must be in state tcpw/tcpw; it will be sent if possible and
+ * no further processing can be done on it for now. The connection
+ * might be broken, but no reconnect will be attempted.
+ */
+
+void adns__query_send(adns_query qu, struct timeval now);
+/* Query must be in state tosend/NONE; it will be moved to a new state,
+ * and no further processing can be done on it for now.
+ * (Resulting state is one of udp/timew, tcpwait/timew (if server not connected),
+ * tcpsent/timew, child/childw or done/output.)
+ * __query_send may decide to use either UDP or TCP depending whether
+ * _qf_usevc is set (or has become set) and whether the query is too
+ * large.
+ */
+
+/* From query.c: */
+
+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);
+/* Submits a query (for internal use, called during external submits).
+ *
+ * The new query is returned in *query_r, or we return adns_s_nomemory.
+ *
+ * The query datagram should already have been assembled in qumsg_vb;
+ * the memory for it is _taken over_ by this routine whether it
+ * succeeds or fails (if it succeeds, the vbuf is reused for qu->vb).
+ *
+ * *ctx is copied byte-for-byte into the query.
+ *
+ * When the child query is done, ctx->callback will be called. The
+ * child will already have been taken off both the global list of
+ * queries in ads and the list of children in the parent. The child
+ * will be freed when the callback returns. The parent will have been
+ * taken off the global childw queue.
+ *
+ * The callback should either call adns__query_done, if it is
+ * complete, or adns__query_fail, if an error has occurred, in which
+ * case the other children (if any) will be cancelled. If the parent
+ * has more unfinished children (or has just submitted more) then the
+ * callback may choose to wait for them - it must then put the parent
+ * back on the childw queue.
+ */
+
+void adns__search_next(adns_state ads, adns_query qu, struct timeval now);
+/* Walks down the searchlist for a query with adns_qf_search.
+ * The query should have just had a negative response, or not had
+ * any queries sent yet, and should not be on any queue.
+ * The query_dgram if any will be freed and forgotten and a new
+ * one constructed from the search_* members of the query.
+ *
+ * Cannot fail (in case of error, calls adns__query_fail).
+ */
+
+void *adns__alloc_interim(adns_query qu, size_t sz);
+void *adns__alloc_preserved(adns_query qu, size_t sz);
+/* Allocates some memory, and records which query it came from
+ * and how much there was.
+ *
+ * If an error occurs in the query, all the memory from _interim is
+ * simply freed. If the query succeeds, one large buffer will be made
+ * which is big enough for all these allocations, and then
+ * adns__alloc_final will get memory from this buffer.
+ *
+ * _alloc_interim can fail (and return 0).
+ * The caller must ensure that the query is failed.
+ *
+ * The memory from _preserved is is kept and transferred into the
+ * larger buffer - unless we run out of memory, in which case it too
+ * is freed. When you use _preserved you have to add code to the
+ * x_nomem error exit case in adns__makefinal_query to clear out the
+ * pointers you made to those allocations, because that's when they're
+ * thrown away; you should also make a note in the declaration of
+ * those pointer variables, to note that they are _preserved rather
+ * than _interim. If they're in the answer, note it here:
+ * answer->cname and answer->owner are _preserved.
+ */
+
+void adns__transfer_interim(adns_query from, adns_query to, void *block, size_t sz);
+/* Transfers an interim allocation from one query to another, so that
+ * the `to' query will have room for the data when we get to makefinal
+ * and so that the free will happen when the `to' query is freed
+ * rather than the `from' query.
+ *
+ * It is legal to call adns__transfer_interim with a null pointer; this
+ * has no effect.
+ *
+ * _transfer_interim also ensures that the expiry time of the `to' query
+ * is no later than that of the `from' query, so that child queries'
+ * TTLs get inherited by their parents.
+ */
+
+void *adns__alloc_mine(adns_query qu, size_t sz);
+/* Like _interim, but does not record the length for later
+ * copying into the answer. This just ensures that the memory
+ * will be freed when we're done with the query.
+ */
+
+void *adns__alloc_final(adns_query qu, size_t sz);
+/* Cannot fail, and cannot return 0.
+ */
+
+void adns__makefinal_block(adns_query qu, void **blpp, size_t sz);
+void adns__makefinal_str(adns_query qu, char **strp);
+
+void adns__reset_preserved(adns_query qu);
+/* Resets all of the memory management stuff etc. to take account of
+ * only the _preserved stuff from _alloc_preserved. Used when we find
+ * an error somewhere and want to just report the error (with perhaps
+ * CNAME, owner, etc. info), and also when we're halfway through RRs
+ * in a datagram and discover that we need to retry the query.
+ */
+
+void adns__query_done(adns_query qu);
+void adns__query_fail(adns_query qu, adns_status stat);
+
+/* From reply.c: */
+
+void adns__procdgram(adns_state ads, const byte *dgram, int len,
+ int serv, int viatcp, struct timeval now);
+/* This function is allowed to cause new datagrams to be constructed
+ * and sent, or even new queries to be started. However,
+ * query-sending functions are not allowed to call any general event
+ * loop functions in case they accidentally call this.
+ *
+ * Ie, receiving functions may call sending functions.
+ * Sending functions may NOT call receiving functions.
+ */
+
+/* From types.c: */
+
+const typeinfo *adns__findtype(adns_rrtype type);
+
+/* From parse.c: */
+
+typedef struct {
+ adns_state ads;
+ adns_query qu;
+ int serv;
+ const byte *dgram;
+ int dglen, max, cbyte, namelen;
+ int *dmend_r;
+} findlabel_state;
+
+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);
+/* Finds labels in a domain in a datagram.
+ *
+ * Call this routine first.
+ * dmend_rlater may be null. ads (and of course fls) may not be.
+ * serv may be -1, qu may be null - they are for error reporting.
+ */
+
+adns_status adns__findlabel_next(findlabel_state *fls, int *lablen_r, int *labstart_r);
+/* Then, call this one repeatedly.
+ *
+ * It will return adns_s_ok if all is well, and tell you the length
+ * and start of successive labels. labstart_r may be null, but
+ * lablen_r must not be.
+ *
+ * After the last label, it will return with *lablen_r zero.
+ * Do not then call it again; instead, just throw away the findlabel_state.
+ *
+ * *dmend_rlater will have been set to point to the next part of
+ * the datagram after the label (or after the uncompressed part,
+ * if compression was used). *namelen_rlater will have been set
+ * to the length of the domain name (total length of labels plus
+ * 1 for each intervening dot).
+ *
+ * If the datagram appears to be truncated, *lablen_r will be -1.
+ * *dmend_rlater, *labstart_r and *namelen_r may contain garbage.
+ * Do not call _next again.
+ *
+ * There may also be errors, in which case *dmend_rlater,
+ * *namelen_rlater, *lablen_r and *labstart_r may contain garbage.
+ * Do not then call findlabel_next again.
+ */
+
+typedef enum {
+ pdf_quoteok= 0x001
+} parsedomain_flags;
+
+adns_status adns__parse_domain(adns_state ads, int serv, adns_query qu,
+ vbuf *vb, parsedomain_flags flags,
+ const byte *dgram, int dglen, int *cbyte_io, int max);
+/* vb must already have been initialised; it will be reset if necessary.
+ * If there is truncation, vb->used will be set to 0; otherwise
+ * (if there is no error) vb will be null-terminated.
+ * If there is an error vb and *cbyte_io may be left indeterminate.
+ *
+ * serv may be -1 and qu may be 0 - they are used for error reporting only.
+ */
+
+adns_status adns__parse_domain_more(findlabel_state *fls, adns_state ads,
+ adns_query qu, vbuf *vb, parsedomain_flags flags,
+ const byte *dgram);
+/* Like adns__parse_domain, but you pass it a pre-initialised findlabel_state,
+ * for continuing an existing domain or some such of some kind. Also, unlike
+ * _parse_domain, the domain data will be appended to vb, rather than replacing
+ * the existing contents.
+ */
+
+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);
+/* Finds the extent and some of the contents of an RR in a datagram
+ * and does some checks. The datagram is *dgram, length dglen, and
+ * the RR starts at *cbyte_io (which is updated afterwards to point
+ * to the end of the RR).
+ *
+ * The type, class, TTL and RRdata length and start are returned iff
+ * the corresponding pointer variables are not null. type_r, class_r
+ * and ttl_r may not be null. The TTL will be capped.
+ *
+ * If ownermatchedquery_r != 0 then the owner domain of this
+ * RR will be compared with that in the query (or, if the query
+ * has gone to a CNAME lookup, with the canonical name).
+ * In this case, *ownermatchedquery_r will be set to 0 or 1.
+ * The query datagram (or CNAME datagram) MUST be valid and not truncated.
+ *
+ * If there is truncation then *type_r will be set to -1 and
+ * *cbyte_io, *class_r, *rdlen_r, *rdstart_r and *eo_matched_r will be
+ * undefined.
+ *
+ * qu must obviously be non-null.
+ *
+ * If an error is returned then *type_r will be undefined too.
+ */
+
+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);
+/* Like adns__findrr_checked, except that the datagram and
+ * owner to compare with can be specified explicitly.
+ *
+ * If the caller thinks they know what the owner of the RR ought to
+ * be they can pass in details in eo_*: this is another (or perhaps
+ * the same datagram), and a pointer to where the putative owner
+ * starts in that datagram. In this case *eo_matched_r will be set
+ * to 1 if the datagram matched or 0 if it did not. Either
+ * both eo_dgram and eo_matched_r must both be non-null, or they
+ * must both be null (in which case eo_dglen and eo_cbyte will be ignored).
+ * The eo datagram and contained owner domain MUST be valid and
+ * untruncated.
+ */
+
+void adns__update_expires(adns_query qu, unsigned long ttl, struct timeval now);
+/* Updates the `expires' field in the query, so that it doesn't exceed
+ * now + ttl.
+ */
+
+int vbuf__append_quoted1035(vbuf *vb, const byte *buf, int len);
+
+/* From event.c: */
+
+void adns__tcp_broken(adns_state ads, const char *what, const char *why);
+/* what and why may be both 0, or both non-0. */
+
+void adns__tcp_tryconnect(adns_state ads, struct timeval now);
+
+void adns__autosys(adns_state ads, struct timeval now);
+/* Make all the system calls we want to if the application wants us to.
+ * Must not be called from within adns internal processing functions,
+ * lest we end up in recursive descent !
+ */
+
+void adns__must_gettimeofday(adns_state ads, const struct timeval **now_io,
+ struct timeval *tv_buf);
+
+int adns__pollfds(adns_state ads, struct pollfd pollfds_buf[MAX_POLLFDS]);
+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);
+int adns__internal_check(adns_state ads,
+ adns_query *query_io,
+ adns_answer **answer,
+ void **context_r);
+
+void adns__timeouts(adns_state ads, int act,
+ struct timeval **tv_io, struct timeval *tvbuf,
+ struct timeval now);
+/* If act is !0, then this will also deal with the TCP connection
+ * if previous events broke it or require it to be connected.
+ */
+
+/* From check.c: */
+
+void adns__consistency(adns_state ads, adns_query qu, consistency_checks cc);
+
+/* Useful static inline functions: */
+
+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'; }
+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 errno_resources(int e) { return e==ENOMEM || e==ENOBUFS; }
+
+/* Useful macros */
+
+#define MEM_ROUND(sz) \
+ (( ((sz)+sizeof(union maxalign)-1) / sizeof(union maxalign) ) \
+ * sizeof(union maxalign) )
+
+#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) ( (tv)=0, \
+ (tv)|=(GETIL_B((cb))<<24), \
+ (tv)|=(GETIL_B((cb))<<16), \
+ (tv)|=(GETIL_B((cb))<<8), \
+ (tv)|=GETIL_B(cb), \
+ (tv) )
+
+#endif
diff --git a/adns-0.6/src/parse.c b/adns-0.6/src/parse.c
new file mode 100644
index 0000000..9a4e0c7
--- /dev/null
+++ b/adns-0.6/src/parse.c
@@ -0,0 +1,253 @@
+/*
+ * parse.c
+ * - parsing assistance functions (mainly for domains inside datagrams)
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "internal.h"
+
+int vbuf__append_quoted1035(vbuf *vb, const byte *buf, int len) {
+ char qbuf[10];
+ int i, ch;
+
+ while (len) {
+ qbuf[0]= 0;
+ for (i=0; i<len; i++) {
+ ch= buf[i];
+ if (ch == '.' || ch == '"' || ch == '(' || ch == ')' ||
+ ch == '@' || ch == ';' || ch == '$' || ch == '\\') {
+ sprintf(qbuf,"\\%c",ch);
+ break;
+ } else if (ch <= ' ' || ch >= 127) {
+ sprintf(qbuf,"\\%03o",ch);
+ break;
+ }
+ }
+ if (!adns__vbuf_append(vb,buf,i) || !adns__vbuf_append(vb,qbuf,strlen(qbuf)))
+ return 0;
+ if (i<len) i++;
+ buf+= i;
+ len-= i;
+ }
+ return 1;
+}
+
+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) {
+ fls->ads= ads;
+ fls->qu= qu;
+ fls->serv= serv;
+ fls->dgram= dgram;
+ fls->dglen= dglen;
+ fls->max= max;
+ fls->cbyte= dmbegin;
+ fls->namelen= 0;
+ fls->dmend_r= dmend_rlater;
+}
+
+adns_status adns__findlabel_next(findlabel_state *fls,
+ int *lablen_r, int *labstart_r) {
+ int lablen, jumped, jumpto;
+ const char *dgram;
+
+ jumped= 0;
+ dgram= fls->dgram;
+ for (;;) {
+ if (fls->cbyte >= fls->dglen) goto x_truncated;
+ if (fls->cbyte >= fls->max) goto x_badresponse;
+ GET_B(fls->cbyte,lablen);
+ if (!(lablen & 0x0c0)) break;
+ if ((lablen & 0x0c0) != 0x0c0) return adns_s_unknownformat;
+ if (jumped++) {
+ adns__diag(fls->ads,fls->serv,fls->qu,"compressed datagram contains loop");
+ return adns_s_invalidresponse;
+ }
+ if (fls->cbyte >= fls->dglen) goto x_truncated;
+ if (fls->cbyte >= fls->max) goto x_badresponse;
+ GET_B(fls->cbyte,jumpto);
+ jumpto |= (lablen&0x3f)<<8;
+ if (fls->dmend_r) *(fls->dmend_r)= fls->cbyte;
+ fls->cbyte= jumpto;
+ fls->dmend_r= 0; fls->max= fls->dglen+1;
+ }
+ if (labstart_r) *labstart_r= fls->cbyte;
+ if (lablen) {
+ if (fls->namelen) fls->namelen++;
+ fls->namelen+= lablen;
+ if (fls->namelen > DNS_MAXDOMAIN) return adns_s_answerdomaintoolong;
+ fls->cbyte+= lablen;
+ if (fls->cbyte > fls->dglen) goto x_truncated;
+ if (fls->cbyte > fls->max) goto x_badresponse;
+ } else {
+ if (fls->dmend_r) *(fls->dmend_r)= fls->cbyte;
+ }
+ *lablen_r= lablen;
+/*if (labstart_r) fprintf(stderr,"label %d >%.*s<\n",lablen,lablen,fls->dgram+*labstart_r);*/
+ return adns_s_ok;
+
+ x_truncated:
+ *lablen_r= -1;
+ return adns_s_ok;
+
+ x_badresponse:
+ adns__diag(fls->ads,fls->serv,fls->qu,"label in domain runs beyond end of domain");
+ return adns_s_invalidresponse;
+}
+
+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) {
+ findlabel_state fls;
+
+ adns__findlabel_start(&fls,ads, serv,qu, dgram,dglen,max, *cbyte_io,cbyte_io);
+ vb->used= 0;
+ return adns__parse_domain_more(&fls,ads,qu, vb,flags,dgram);
+}
+
+adns_status adns__parse_domain_more(findlabel_state *fls, adns_state ads,
+ adns_query qu, vbuf *vb, parsedomain_flags flags,
+ const byte *dgram) {
+ int lablen, labstart, i, ch, first;
+ adns_status st;
+
+ first= 1;
+ for (;;) {
+ st= adns__findlabel_next(fls,&lablen,&labstart);
+ if (st) return st;
+ if (lablen<0) { vb->used=0; return adns_s_ok; }
+ if (!lablen) break;
+ if (first) {
+ first= 0;
+ } else {
+ if (!adns__vbuf_append(vb,".",1)) return adns_s_nomemory;
+ }
+ if (flags & pdf_quoteok) {
+ if (!vbuf__append_quoted1035(vb,dgram+labstart,lablen))
+ return adns_s_nomemory;
+ } else {
+ ch= dgram[labstart];
+ if (!ctype_alpha(ch) && !ctype_digit(ch)) return adns_s_answerdomaininvalid;
+ for (i= labstart+1; i<labstart+lablen; i++) {
+ ch= dgram[i];
+ if (ch != '-' && !ctype_alpha(ch) && !ctype_digit(ch))
+ return adns_s_answerdomaininvalid;
+ }
+ if (!adns__vbuf_append(vb,dgram+labstart,lablen))
+ return adns_s_nomemory;
+ }
+ }
+ if (!adns__vbuf_append(vb,"",1)) return adns_s_nomemory;
+ return adns_s_ok;
+}
+
+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) {
+ findlabel_state fls, eo_fls;
+ int cbyte;
+
+ int tmp, rdlen, mismatch;
+ unsigned long ttl;
+ int lablen, labstart, ch;
+ int eo_lablen, eo_labstart, eo_ch;
+ adns_status st;
+
+ cbyte= *cbyte_io;
+
+ adns__findlabel_start(&fls,qu->ads, serv,qu, dgram,dglen,dglen,cbyte,&cbyte);
+ if (eo_dgram) {
+ adns__findlabel_start(&eo_fls,qu->ads, -1,0, eo_dgram,eo_dglen,eo_dglen,eo_cbyte,0);
+ mismatch= 0;
+ } else {
+ mismatch= 1;
+ }
+
+ for (;;) {
+ st= adns__findlabel_next(&fls,&lablen,&labstart);
+ if (st) return st;
+ if (lablen<0) goto x_truncated;
+
+ if (!mismatch) {
+ st= adns__findlabel_next(&eo_fls,&eo_lablen,&eo_labstart);
+ assert(!st); assert(eo_lablen>=0);
+ if (lablen != eo_lablen) mismatch= 1;
+ while (!mismatch && eo_lablen-- > 0) {
+ ch= dgram[labstart++]; if (ctype_alpha(ch)) ch &= ~32;
+ eo_ch= eo_dgram[eo_labstart++]; if (ctype_alpha(eo_ch)) eo_ch &= ~32;
+ if (ch != eo_ch) mismatch= 1;
+ }
+ }
+ if (!lablen) break;
+ }
+ if (eo_matched_r) *eo_matched_r= !mismatch;
+
+ if (cbyte+10>dglen) goto x_truncated;
+ GET_W(cbyte,tmp); *type_r= tmp;
+ GET_W(cbyte,tmp); *class_r= tmp;
+
+ GET_L(cbyte,ttl);
+ if (ttl > MAXTTLBELIEVE) ttl= MAXTTLBELIEVE;
+ *ttl_r= ttl;
+
+ GET_W(cbyte,rdlen); if (rdlen_r) *rdlen_r= rdlen;
+ if (rdstart_r) *rdstart_r= cbyte;
+ cbyte+= rdlen;
+ if (cbyte>dglen) goto x_truncated;
+ *cbyte_io= cbyte;
+ return adns_s_ok;
+
+ x_truncated:
+ *type_r= -1;
+ return 0;
+}
+
+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) {
+ if (!ownermatchedquery_r) {
+ return adns__findrr_anychk(qu,serv,
+ dgram,dglen,cbyte_io,
+ type_r,class_r,ttl_r,rdlen_r,rdstart_r,
+ 0,0,0, 0);
+ } else if (!qu->cname_dgram) {
+ return adns__findrr_anychk(qu,serv,
+ dgram,dglen,cbyte_io,
+ type_r,class_r,ttl_r,rdlen_r,rdstart_r,
+ qu->query_dgram,qu->query_dglen,DNS_HDRSIZE,
+ ownermatchedquery_r);
+ } else {
+ return adns__findrr_anychk(qu,serv,
+ dgram,dglen,cbyte_io,
+ type_r,class_r,ttl_r,rdlen_r,rdstart_r,
+ qu->cname_dgram,qu->cname_dglen,qu->cname_begin,
+ ownermatchedquery_r);
+ }
+}
diff --git a/adns-0.6/src/poll.c b/adns-0.6/src/poll.c
new file mode 100644
index 0000000..45dc437
--- /dev/null
+++ b/adns-0.6/src/poll.c
@@ -0,0 +1,131 @@
+/*
+ * poll.c
+ * - wrappers for poll(2)
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <limits.h>
+#include <string.h>
+
+#include "internal.h"
+
+#ifdef HAVE_POLL
+
+int adns_beforepoll(adns_state ads, struct pollfd *fds, int *nfds_io, int *timeout_io,
+ const struct timeval *now) {
+ struct timeval tv_nowbuf, tv_tobuf, *tv_to;
+ int space, found, timeout_ms, r;
+ struct pollfd fds_tmp[MAX_POLLFDS];
+
+ adns__consistency(ads,0,cc_entex);
+
+ if (timeout_io) {
+ adns__must_gettimeofday(ads,&now,&tv_nowbuf);
+ if (!now) { *nfds_io= 0; r= 0; goto xit; }
+
+ timeout_ms= *timeout_io;
+ if (timeout_ms == -1) {
+ tv_to= 0;
+ } else {
+ tv_tobuf.tv_sec= timeout_ms / 1000;
+ tv_tobuf.tv_usec= (timeout_ms % 1000)*1000;
+ tv_to= &tv_tobuf;
+ }
+
+ adns__timeouts(ads, 0, &tv_to,&tv_tobuf, *now);
+
+ if (tv_to) {
+ assert(tv_to == &tv_tobuf);
+ timeout_ms= (tv_tobuf.tv_usec+999)/1000;
+ assert(tv_tobuf.tv_sec < (INT_MAX-timeout_ms)/1000);
+ timeout_ms += tv_tobuf.tv_sec*1000;
+ } else {
+ timeout_ms= -1;
+ }
+ *timeout_io= timeout_ms;
+ }
+
+ space= *nfds_io;
+ if (space >= MAX_POLLFDS) {
+ found= adns__pollfds(ads,fds);
+ *nfds_io= found;
+ } else {
+ found= adns__pollfds(ads,fds_tmp);
+ *nfds_io= found;
+ if (space < found) { r= ERANGE; goto xit; }
+ memcpy(fds,fds_tmp,sizeof(struct pollfd)*found);
+ }
+ r= 0;
+xit:
+ adns__consistency(ads,0,cc_entex);
+ return r;
+}
+
+void adns_afterpoll(adns_state ads, const struct pollfd *fds, int nfds,
+ const struct timeval *now) {
+ struct timeval tv_buf;
+
+ adns__consistency(ads,0,cc_entex);
+ adns__must_gettimeofday(ads,&now,&tv_buf);
+ if (now) {
+ adns__timeouts(ads, 1, 0,0, *now);
+ adns__fdevents(ads, fds,nfds, 0,0,0,0, *now,0);
+ }
+ adns__consistency(ads,0,cc_entex);
+}
+
+int adns_wait_poll(adns_state ads,
+ adns_query *query_io,
+ adns_answer **answer_r,
+ void **context_r) {
+ int r, nfds, to;
+ struct pollfd fds[MAX_POLLFDS];
+
+ adns__consistency(ads,0,cc_entex);
+
+ for (;;) {
+ r= adns__internal_check(ads,query_io,answer_r,context_r);
+ if (r != EAGAIN) goto xit;
+ nfds= MAX_POLLFDS; to= -1;
+ adns_beforepoll(ads,fds,&nfds,&to,0);
+ r= poll(fds,nfds,to);
+ if (r == -1) {
+ if (errno == EINTR) {
+ if (ads->iflags & adns_if_eintr) { r= EINTR; goto xit; }
+ } else {
+ adns__diag(ads,-1,0,"poll failed in wait: %s",strerror(errno));
+ adns_globalsystemfailure(ads);
+ }
+ } else {
+ assert(r >= 0);
+ adns_afterpoll(ads,fds,nfds,0);
+ }
+ }
+
+ xit:
+ adns__consistency(ads,0,cc_entex);
+ return r;
+}
+
+#endif
diff --git a/adns-0.6/src/query.c b/adns-0.6/src/query.c
new file mode 100644
index 0000000..37306d1
--- /dev/null
+++ b/adns-0.6/src/query.c
@@ -0,0 +1,540 @@
+/*
+ * query.c
+ * - overall query management (allocation, completion)
+ * - per-query memory management
+ * - query submission and cancellation (user-visible and internal)
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "internal.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <sys/time.h>
+
+#include "internal.h"
+
+static adns_query query_alloc(adns_state ads, const typeinfo *typei,
+ adns_queryflags flags, struct timeval now) {
+ /* Allocate a virgin query and return it. */
+ adns_query qu;
+
+ qu= malloc(sizeof(*qu)); if (!qu) return 0;
+ qu->answer= malloc(sizeof(*qu->answer)); if (!qu->answer) { free(qu); return 0; }
+
+ qu->ads= ads;
+ qu->state= query_tosend;
+ qu->back= qu->next= qu->parent= 0;
+ LIST_INIT(qu->children);
+ LINK_INIT(qu->siblings);
+ LIST_INIT(qu->allocations);
+ qu->interim_allocd= 0;
+ qu->preserved_allocd= 0;
+ qu->final_allocspace= 0;
+
+ qu->typei= typei;
+ qu->query_dgram= 0;
+ qu->query_dglen= 0;
+ adns__vbuf_init(&qu->vb);
+
+ qu->cname_dgram= 0;
+ qu->cname_dglen= qu->cname_begin= 0;
+
+ adns__vbuf_init(&qu->search_vb);
+ qu->search_origlen= qu->search_pos= qu->search_doneabs= 0;
+
+ qu->id= 0;
+ qu->flags= flags;
+ qu->retries= 0;
+ qu->udpnextserver= 0;
+ qu->udpsent= 0;
+ timerclear(&qu->timeout);
+ qu->expires= now.tv_sec + MAXTTLBELIEVE;
+
+ memset(&qu->ctx,0,sizeof(qu->ctx));
+
+ qu->answer->status= adns_s_ok;
+ qu->answer->cname= qu->answer->owner= 0;
+ qu->answer->type= typei->type;
+ qu->answer->expires= -1;
+ qu->answer->nrrs= 0;
+ qu->answer->rrs.untyped= 0;
+ qu->answer->rrsz= typei->rrsz;
+
+ return qu;
+}
+
+static void query_submit(adns_state ads, adns_query qu,
+ const typeinfo *typei, vbuf *qumsg_vb, int id,
+ adns_queryflags flags, struct timeval now) {
+ /* Fills in the query message in for a previously-allocated query,
+ * and submits it. Cannot fail. Takes over the memory for qumsg_vb.
+ */
+
+ qu->vb= *qumsg_vb;
+ adns__vbuf_init(qumsg_vb);
+
+ qu->query_dgram= malloc(qu->vb.used);
+ if (!qu->query_dgram) { adns__query_fail(qu,adns_s_nomemory); return; }
+
+ qu->id= id;
+ qu->query_dglen= qu->vb.used;
+ memcpy(qu->query_dgram,qu->vb.buf,qu->vb.used);
+
+ adns__query_send(qu,now);
+}
+
+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) {
+ adns_query qu;
+
+ qu= query_alloc(ads,typei,flags,now);
+ if (!qu) { adns__vbuf_free(qumsg_vb); return adns_s_nomemory; }
+ *query_r= qu;
+
+ memcpy(&qu->ctx,ctx,sizeof(qu->ctx));
+ query_submit(ads,qu, typei,qumsg_vb,id,flags,now);
+
+ return adns_s_ok;
+}
+
+static void query_simple(adns_state ads, adns_query qu,
+ const char *owner, int ol,
+ const typeinfo *typei, adns_queryflags flags,
+ struct timeval now) {
+ vbuf vb;
+ int id;
+ adns_status stat;
+
+ vb= qu->vb;
+
+ stat= adns__mkquery(ads,&vb,&id, owner,ol, typei,flags);
+ if (stat) { adns__query_fail(qu,stat); return; }
+
+ query_submit(ads,qu, typei,&vb,id, flags,now);
+}
+
+void adns__search_next(adns_state ads, adns_query qu, struct timeval now) {
+ const char *nextentry;
+ adns_status stat;
+
+ if (qu->search_doneabs<0) {
+ nextentry= 0;
+ qu->search_doneabs= 1;
+ } else {
+ if (qu->search_pos >= ads->nsearchlist) {
+ if (qu->search_doneabs) {
+ stat= adns_s_nxdomain; goto x_fail;
+ return;
+ } else {
+ nextentry= 0;
+ qu->search_doneabs= 1;
+ }
+ } else {
+ nextentry= ads->searchlist[qu->search_pos++];
+ }
+ }
+
+ qu->search_vb.used= qu->search_origlen;
+ if (nextentry) {
+ if (!adns__vbuf_append(&qu->search_vb,".",1) ||
+ !adns__vbuf_appendstr(&qu->search_vb,nextentry)) {
+ stat= adns_s_nomemory; goto x_fail;
+ }
+ }
+
+ free(qu->query_dgram);
+ qu->query_dgram= 0; qu->query_dglen= 0;
+
+ query_simple(ads,qu, qu->search_vb.buf, qu->search_vb.used, qu->typei, qu->flags, now);
+ return;
+
+x_fail:
+ adns__query_fail(qu,stat);
+}
+
+static int save_owner(adns_query qu, const char *owner, int ol) {
+ /* Returns 1 if OK, otherwise there was no memory. */
+ adns_answer *ans;
+
+ ans= qu->answer;
+ assert(!ans->owner);
+
+ ans->owner= adns__alloc_preserved(qu,ol+1); if (!ans->owner) return 0;
+
+ memcpy(ans->owner,owner,ol);
+ ans->owner[ol]= 0;
+ return 1;
+}
+
+int adns_submit(adns_state ads,
+ const char *owner,
+ adns_rrtype type,
+ adns_queryflags flags,
+ void *context,
+ adns_query *query_r) {
+ int r, ol, ndots;
+ adns_status stat;
+ const typeinfo *typei;
+ struct timeval now;
+ adns_query qu;
+ const char *p;
+
+ adns__consistency(ads,0,cc_entex);
+
+ typei= adns__findtype(type);
+ if (!typei) return ENOSYS;
+
+ r= gettimeofday(&now,0); if (r) goto x_errno;
+ qu= query_alloc(ads,typei,flags,now); if (!qu) goto x_errno;
+
+ qu->ctx.ext= context;
+ qu->ctx.callback= 0;
+ memset(&qu->ctx.info,0,sizeof(qu->ctx.info));
+
+ *query_r= qu;
+
+ ol= strlen(owner);
+ if (!ol) { stat= adns_s_querydomaininvalid; goto x_adnsfail; }
+ if (ol>DNS_MAXDOMAIN+1) { stat= adns_s_querydomaintoolong; goto x_adnsfail; }
+
+ if (ol>=1 && owner[ol-1]=='.' && (ol<2 || owner[ol-2]!='\\')) {
+ flags &= ~adns_qf_search;
+ qu->flags= flags;
+ ol--;
+ }
+
+ if (flags & adns_qf_search) {
+ r= adns__vbuf_append(&qu->search_vb,owner,ol);
+ if (!r) { stat= adns_s_nomemory; goto x_adnsfail; }
+
+ for (ndots=0, p=owner; (p= strchr(p,'.')); p++, ndots++);
+ qu->search_doneabs= (ndots >= ads->searchndots) ? -1 : 0;
+ qu->search_origlen= ol;
+ adns__search_next(ads,qu,now);
+ } else {
+ if (flags & adns_qf_owner) {
+ if (!save_owner(qu,owner,ol)) { stat= adns_s_nomemory; goto x_adnsfail; }
+ }
+ query_simple(ads,qu, owner,ol, typei,flags, now);
+ }
+ adns__autosys(ads,now);
+ adns__consistency(ads,qu,cc_entex);
+ return 0;
+
+ x_adnsfail:
+ adns__query_fail(qu,stat);
+ adns__consistency(ads,qu,cc_entex);
+ return 0;
+
+ x_errno:
+ r= errno;
+ assert(r);
+ adns__consistency(ads,0,cc_entex);
+ return r;
+}
+
+int adns_submit_reverse(adns_state ads,
+ const struct sockaddr *addr,
+ adns_rrtype type,
+ adns_queryflags flags,
+ void *context,
+ adns_query *query_r) {
+ const unsigned char *iaddr;
+ char buf[30];
+
+ if (type != adns_r_ptr && type != adns_r_ptr_raw) return EINVAL;
+ flags &= ~adns_qf_search;
+
+ if (addr->sa_family != AF_INET) return ENOSYS;
+ iaddr= (const unsigned char*) &(((const struct sockaddr_in*)addr) -> sin_addr);
+
+ sprintf(buf, "%d.%d.%d.%d.in-addr.arpa",
+ iaddr[3], iaddr[2], iaddr[1], iaddr[0]);
+
+ return adns_submit(ads,buf,type,flags,context,query_r);
+}
+
+int adns_synchronous(adns_state ads,
+ const char *owner,
+ adns_rrtype type,
+ adns_queryflags flags,
+ adns_answer **answer_r) {
+ adns_query qu;
+ int r;
+
+ r= adns_submit(ads,owner,type,flags,0,&qu);
+ if (r) return r;
+
+ r= adns_wait(ads,&qu,answer_r,0);
+ if (r) adns_cancel(qu);
+
+ return r;
+}
+
+static void *alloc_common(adns_query qu, size_t sz) {
+ allocnode *an;
+
+ if (!sz) return qu; /* Any old pointer will do */
+ assert(!qu->final_allocspace);
+ an= malloc(MEM_ROUND(MEM_ROUND(sizeof(*an)) + sz));
+ if (!an) return 0;
+ LIST_LINK_TAIL(qu->allocations,an);
+ return (byte*)an + MEM_ROUND(sizeof(*an));
+}
+
+void *adns__alloc_interim(adns_query qu, size_t sz) {
+ void *rv;
+
+ sz= MEM_ROUND(sz);
+ rv= alloc_common(qu,sz);
+ if (!rv) return 0;
+ qu->interim_allocd += sz;
+ return rv;
+}
+
+void *adns__alloc_preserved(adns_query qu, size_t sz) {
+ void *rv;
+
+ sz= MEM_ROUND(sz);
+ rv= adns__alloc_interim(qu,sz);
+ if (!rv) return 0;
+ qu->preserved_allocd += sz;
+ return rv;
+}
+
+void *adns__alloc_mine(adns_query qu, size_t sz) {
+ return alloc_common(qu,MEM_ROUND(sz));
+}
+
+void adns__transfer_interim(adns_query from, adns_query to, void *block, size_t sz) {
+ allocnode *an;
+
+ if (!block) return;
+ an= (void*)((byte*)block - MEM_ROUND(sizeof(*an)));
+
+ assert(!to->final_allocspace);
+ assert(!from->final_allocspace);
+
+ LIST_UNLINK(from->allocations,an);
+ LIST_LINK_TAIL(to->allocations,an);
+
+ from->interim_allocd -= sz;
+ to->interim_allocd += sz;
+
+ if (to->expires > from->expires) to->expires= from->expires;
+}
+
+void *adns__alloc_final(adns_query qu, size_t sz) {
+ /* When we're in the _final stage, we _subtract_ from interim_alloc'd
+ * each allocation, and use final_allocspace to point to the next free
+ * bit.
+ */
+ void *rp;
+
+ sz= MEM_ROUND(sz);
+ rp= qu->final_allocspace;
+ assert(rp);
+ qu->interim_allocd -= sz;
+ assert(qu->interim_allocd>=0);
+ qu->final_allocspace= (byte*)rp + sz;
+ return rp;
+}
+
+static void cancel_children(adns_query qu) {
+ adns_query cqu, ncqu;
+
+ for (cqu= qu->children.head; cqu; cqu= ncqu) {
+ ncqu= cqu->siblings.next;
+ adns_cancel(cqu);
+ }
+}
+
+void adns__reset_preserved(adns_query qu) {
+ assert(!qu->final_allocspace);
+ cancel_children(qu);
+ qu->answer->nrrs= 0;
+ qu->answer->rrs.untyped= 0;
+ qu->interim_allocd= qu->preserved_allocd;
+}
+
+static void free_query_allocs(adns_query qu) {
+ allocnode *an, *ann;
+
+ cancel_children(qu);
+ for (an= qu->allocations.head; an; an= ann) { ann= an->next; free(an); }
+ LIST_INIT(qu->allocations);
+ adns__vbuf_free(&qu->vb);
+ adns__vbuf_free(&qu->search_vb);
+ free(qu->query_dgram);
+}
+
+void adns_cancel(adns_query qu) {
+ adns_state ads;
+
+ ads= qu->ads;
+ adns__consistency(ads,qu,cc_entex);
+ if (qu->parent) LIST_UNLINK_PART(qu->parent->children,qu,siblings.);
+ switch (qu->state) {
+ case query_tosend:
+ LIST_UNLINK(ads->udpw,qu);
+ break;
+ case query_tcpw:
+ LIST_UNLINK(ads->tcpw,qu);
+ break;
+ case query_childw:
+ LIST_UNLINK(ads->childw,qu);
+ break;
+ case query_done:
+ LIST_UNLINK(ads->output,qu);
+ break;
+ default:
+ abort();
+ }
+ free_query_allocs(qu);
+ free(qu->answer);
+ free(qu);
+ adns__consistency(ads,0,cc_entex);
+}
+
+void adns__update_expires(adns_query qu, unsigned long ttl, struct timeval now) {
+ time_t max;
+
+ assert(ttl <= MAXTTLBELIEVE);
+ max= now.tv_sec + ttl;
+ if (qu->expires < max) return;
+ qu->expires= max;
+}
+
+static void makefinal_query(adns_query qu) {
+ adns_answer *ans;
+ int rrn;
+
+ ans= qu->answer;
+
+ if (qu->interim_allocd) {
+ ans= realloc(qu->answer, MEM_ROUND(MEM_ROUND(sizeof(*ans)) + qu->interim_allocd));
+ if (!ans) goto x_nomem;
+ qu->answer= ans;
+ }
+
+ qu->final_allocspace= (byte*)ans + MEM_ROUND(sizeof(*ans));
+ adns__makefinal_str(qu,&ans->cname);
+ adns__makefinal_str(qu,&ans->owner);
+
+ if (ans->nrrs) {
+ adns__makefinal_block(qu, &ans->rrs.untyped, ans->nrrs*ans->rrsz);
+
+ for (rrn=0; rrn<ans->nrrs; rrn++)
+ qu->typei->makefinal(qu, ans->rrs.bytes + rrn*ans->rrsz);
+ }
+
+ free_query_allocs(qu);
+ return;
+
+ x_nomem:
+ qu->preserved_allocd= 0;
+ qu->answer->cname= 0;
+ qu->answer->owner= 0;
+ adns__reset_preserved(qu); /* (but we just threw away the preserved stuff) */
+
+ qu->answer->status= adns_s_nomemory;
+ free_query_allocs(qu);
+}
+
+void adns__query_done(adns_query qu) {
+ adns_answer *ans;
+ adns_query parent;
+
+ cancel_children(qu);
+
+ qu->id= -1;
+ ans= qu->answer;
+
+ if (qu->flags & adns_qf_owner && qu->flags & adns_qf_search &&
+ ans->status != adns_s_nomemory) {
+ if (!save_owner(qu, qu->search_vb.buf, qu->search_vb.used)) {
+ adns__query_fail(qu,adns_s_nomemory);
+ return;
+ }
+ }
+
+ if (ans->nrrs && qu->typei->diff_needswap) {
+ if (!adns__vbuf_ensure(&qu->vb,qu->typei->rrsz)) {
+ adns__query_fail(qu,adns_s_nomemory);
+ return;
+ }
+ adns__isort(ans->rrs.bytes, ans->nrrs, ans->rrsz,
+ qu->vb.buf,
+ (int(*)(void*, const void*, const void*))qu->typei->diff_needswap,
+ qu->ads);
+ }
+
+ ans->expires= qu->expires;
+ parent= qu->parent;
+ if (parent) {
+ LIST_UNLINK_PART(parent->children,qu,siblings.);
+ LIST_UNLINK(qu->ads->childw,parent);
+ qu->ctx.callback(parent,qu);
+ free_query_allocs(qu);
+ free(qu->answer);
+ free(qu);
+ } else {
+ makefinal_query(qu);
+ LIST_LINK_TAIL(qu->ads->output,qu);
+ qu->state= query_done;
+ }
+}
+
+void adns__query_fail(adns_query qu, adns_status stat) {
+ adns__reset_preserved(qu);
+ qu->answer->status= stat;
+ adns__query_done(qu);
+}
+
+void adns__makefinal_str(adns_query qu, char **strp) {
+ int l;
+ char *before, *after;
+
+ before= *strp;
+ if (!before) return;
+ l= strlen(before)+1;
+ after= adns__alloc_final(qu,l);
+ memcpy(after,before,l);
+ *strp= after;
+}
+
+void adns__makefinal_block(adns_query qu, void **blpp, size_t sz) {
+ void *before, *after;
+
+ before= *blpp;
+ if (!before) return;
+ after= adns__alloc_final(qu,sz);
+ memcpy(after,before,sz);
+ *blpp= after;
+}
diff --git a/adns-0.6/src/reply.c b/adns-0.6/src/reply.c
new file mode 100644
index 0000000..246d52d
--- /dev/null
+++ b/adns-0.6/src/reply.c
@@ -0,0 +1,357 @@
+/*
+ * reply.c
+ * - main handling and parsing routine for received datagrams
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <stdlib.h>
+
+#include "internal.h"
+
+void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
+ int serv, int viatcp, struct timeval now) {
+ int cbyte, rrstart, wantedrrs, rri, foundsoa, foundns, cname_here;
+ int id, f1, f2, qdcount, ancount, nscount, arcount;
+ int flg_ra, flg_rd, flg_tc, flg_qr, opcode;
+ int rrtype, rrclass, rdlength, rdstart;
+ int anstart, nsstart, arstart;
+ int ownermatched, l, nrrs;
+ unsigned long ttl, soattl;
+ const typeinfo *typei;
+ adns_query qu, nqu;
+ dns_rcode rcode;
+ adns_status st;
+ vbuf tempvb;
+ byte *newquery, *rrsdata;
+ parseinfo pai;
+
+ if (dglen<DNS_HDRSIZE) {
+ adns__diag(ads,serv,0,"received datagram too short for message header (%d)",dglen);
+ return;
+ }
+ cbyte= 0;
+ GET_W(cbyte,id);
+ GET_B(cbyte,f1);
+ GET_B(cbyte,f2);
+ GET_W(cbyte,qdcount);
+ GET_W(cbyte,ancount);
+ GET_W(cbyte,nscount);
+ GET_W(cbyte,arcount);
+ assert(cbyte == DNS_HDRSIZE);
+
+ flg_qr= f1&0x80;
+ opcode= (f1&0x78)>>3;
+ flg_tc= f1&0x02;
+ flg_rd= f1&0x01;
+ flg_ra= f2&0x80;
+ rcode= (f2&0x0f);
+
+ cname_here= 0;
+
+ if (!flg_qr) {
+ adns__diag(ads,serv,0,"server sent us a query, not a response");
+ return;
+ }
+ if (opcode) {
+ adns__diag(ads,serv,0,"server sent us unknown opcode %d (wanted 0=QUERY)",opcode);
+ return;
+ }
+ if (!qdcount) {
+ adns__diag(ads,serv,0,"server sent reply without quoting our question");
+ return;
+ } else if (qdcount>1) {
+ adns__diag(ads,serv,0,"server claimed to answer %d questions with one message",
+ qdcount);
+ return;
+ }
+ for (qu= viatcp ? ads->tcpw.head : ads->udpw.head; qu; qu= nqu) {
+ nqu= qu->next;
+ if (qu->id != id) continue;
+ if (dglen < qu->query_dglen) continue;
+ if (memcmp(qu->query_dgram+DNS_HDRSIZE,
+ dgram+DNS_HDRSIZE,
+ qu->query_dglen-DNS_HDRSIZE))
+ continue;
+ if (viatcp) {
+ assert(qu->state == query_tcpw);
+ } else {
+ assert(qu->state == query_tosend);
+ if (!(qu->udpsent & (1<<serv))) continue;
+ }
+ break;
+ }
+ if (!qu) {
+ if (ads->iflags & adns_if_debug) {
+ adns__vbuf_init(&tempvb);
+ adns__debug(ads,serv,0,"reply not found, id %02x, query owner %s",
+ id, adns__diag_domain(ads,serv,0,&tempvb,dgram,dglen,DNS_HDRSIZE));
+ adns__vbuf_free(&tempvb);
+ }
+ return;
+ }
+ anstart= qu->query_dglen;
+ arstart= -1;
+
+ if (viatcp) LIST_UNLINK(ads->tcpw,qu);
+ else LIST_UNLINK(ads->udpw,qu);
+ /* We're definitely going to do something with this query now */
+
+ switch (rcode) {
+ case rcode_noerror:
+ case rcode_nxdomain:
+ break;
+ case rcode_formaterror:
+ adns__warn(ads,serv,qu,"server cannot understand our query (Format Error)");
+ adns__query_fail(qu,adns_s_rcodeformaterror);
+ return;
+ case rcode_servfail:
+ adns__query_fail(qu,adns_s_rcodeservfail);
+ return;
+ case rcode_notimp:
+ adns__warn(ads,serv,qu,"server claims not to implement our query");
+ adns__query_fail(qu,adns_s_rcodenotimplemented);
+ return;
+ case rcode_refused:
+ adns__warn(ads,serv,qu,"server refused our query");
+ adns__query_fail(qu,adns_s_rcoderefused);
+ return;
+ default:
+ adns__warn(ads,serv,qu,"server gave unknown response code %d",rcode);
+ adns__query_fail(qu,adns_s_rcodeunknown);
+ return;
+ }
+
+ /* Now, take a look at the answer section, and see if it is complete.
+ * If it has any CNAMEs we stuff them in the answer.
+ */
+ wantedrrs= 0;
+ cbyte= anstart;
+ for (rri= 0; rri<ancount; rri++) {
+ rrstart= cbyte;
+ st= adns__findrr(qu,serv, dgram,dglen,&cbyte,
+ &rrtype,&rrclass,&ttl, &rdlength,&rdstart,
+ &ownermatched);
+ if (st) { adns__query_fail(qu,st); return; }
+ if (rrtype == -1) goto x_truncated;
+
+ if (rrclass != DNS_CLASS_IN) {
+ adns__diag(ads,serv,qu,"ignoring answer RR with wrong class %d (expected IN=%d)",
+ rrclass,DNS_CLASS_IN);
+ continue;
+ }
+ if (!ownermatched) {
+ if (ads->iflags & adns_if_debug) {
+ adns__debug(ads,serv,qu,"ignoring RR with an unexpected owner %s",
+ adns__diag_domain(ads,serv,qu, &qu->vb, dgram,dglen,rrstart));
+ }
+ continue;
+ }
+ if (rrtype == adns_r_cname &&
+ (qu->typei->type & adns__rrt_typemask) != adns_r_cname) {
+ if (qu->flags & adns_qf_cname_forbid) {
+ adns__query_fail(qu,adns_s_prohibitedcname);
+ return;
+ } else if (qu->cname_dgram) { /* Ignore second and subsequent CNAME(s) */
+ adns__debug(ads,serv,qu,"allegedly canonical name %s is actually alias for %s",
+ qu->answer->cname,
+ adns__diag_domain(ads,serv,qu, &qu->vb, dgram,dglen,rdstart));
+ adns__query_fail(qu,adns_s_prohibitedcname);
+ return;
+ } else if (wantedrrs) { /* Ignore CNAME(s) after RR(s). */
+ adns__debug(ads,serv,qu,"ignoring CNAME (to %s) coexisting with RR",
+ adns__diag_domain(ads,serv,qu, &qu->vb, dgram,dglen,rdstart));
+ } else {
+ qu->cname_begin= rdstart;
+ qu->cname_dglen= dglen;
+ st= adns__parse_domain(ads,serv,qu, &qu->vb,
+ qu->flags & adns_qf_quoteok_cname ? pdf_quoteok : 0,
+ dgram,dglen, &rdstart,rdstart+rdlength);
+ if (!qu->vb.used) goto x_truncated;
+ if (st) { adns__query_fail(qu,st); return; }
+ l= strlen(qu->vb.buf)+1;
+ qu->answer->cname= adns__alloc_preserved(qu,l);
+ if (!qu->answer->cname) { adns__query_fail(qu,adns_s_nomemory); return; }
+
+ qu->cname_dgram= adns__alloc_mine(qu,dglen);
+ memcpy(qu->cname_dgram,dgram,dglen);
+
+ memcpy(qu->answer->cname,qu->vb.buf,l);
+ cname_here= 1;
+ adns__update_expires(qu,ttl,now);
+ /* If we find the answer section truncated after this point we restart
+ * the query at the CNAME; if beforehand then we obviously have to use
+ * TCP. If there is no truncation we can use the whole answer if
+ * it contains the relevant info.
+ */
+ }
+ } else if (rrtype == (qu->typei->type & adns__rrt_typemask)) {
+ wantedrrs++;
+ } else {
+ adns__debug(ads,serv,qu,"ignoring answer RR with irrelevant type %d",rrtype);
+ }
+ }
+
+ /* We defer handling truncated responses here, in case there was a CNAME
+ * which we could use.
+ */
+ if (flg_tc) goto x_truncated;
+
+ nsstart= cbyte;
+
+ if (!wantedrrs) {
+ /* Oops, NODATA or NXDOMAIN or perhaps a referral (which would be a problem) */
+
+ /* RFC2308: NODATA has _either_ a SOA _or_ _no_ NS records in authority section */
+ foundsoa= 0; soattl= 0; foundns= 0;
+ for (rri= 0; rri<nscount; rri++) {
+ rrstart= cbyte;
+ st= adns__findrr(qu,serv, dgram,dglen,&cbyte,
+ &rrtype,&rrclass,&ttl, &rdlength,&rdstart, 0);
+ if (st) { adns__query_fail(qu,st); return; }
+ if (rrtype==-1) goto x_truncated;
+ if (rrclass != DNS_CLASS_IN) {
+ adns__diag(ads,serv,qu,
+ "ignoring authority RR with wrong class %d (expected IN=%d)",
+ rrclass,DNS_CLASS_IN);
+ continue;
+ }
+ if (rrtype == adns_r_soa_raw) { foundsoa= 1; soattl= ttl; break; }
+ else if (rrtype == adns_r_ns_raw) { foundns= 1; }
+ }
+
+ if (rcode == rcode_nxdomain) {
+ /* We still wanted to look for the SOA so we could find the TTL. */
+ adns__update_expires(qu,soattl,now);
+
+ if (qu->flags & adns_qf_search) {
+ adns__search_next(ads,qu,now);
+ } else {
+ adns__query_fail(qu,adns_s_nxdomain);
+ }
+ return;
+ }
+
+ if (foundsoa || !foundns) {
+ /* Aha ! A NODATA response, good. */
+ adns__update_expires(qu,soattl,now);
+ adns__query_fail(qu,adns_s_nodata);
+ return;
+ }
+
+ /* Now what ? No relevant answers, no SOA, and at least some NS's.
+ * Looks like a referral. Just one last chance ... if we came across
+ * a CNAME in this datagram then we should probably do our own CNAME
+ * lookup now in the hope that we won't get a referral again.
+ */
+ if (cname_here) goto x_restartquery;
+
+ /* Bloody hell, I thought we asked for recursion ? */
+ if (flg_rd) {
+ adns__diag(ads,serv,qu,"server thinks we didn't ask for recursive lookup");
+ }
+ if (!flg_ra) {
+ adns__diag(ads,serv,qu,"server is not willing to do recursive lookups for us");
+ adns__query_fail(qu,adns_s_norecurse);
+ } else {
+ adns__diag(ads,serv,qu,"server claims to do recursion, but gave us a referral");
+ adns__query_fail(qu,adns_s_invalidresponse);
+ }
+ return;
+ }
+
+ /* Now, we have some RRs which we wanted. */
+
+ qu->answer->rrs.untyped= adns__alloc_interim(qu,qu->typei->rrsz*wantedrrs);
+ if (!qu->answer->rrs.untyped) { adns__query_fail(qu,adns_s_nomemory); return; }
+
+ typei= qu->typei;
+ cbyte= anstart;
+ rrsdata= qu->answer->rrs.bytes;
+
+ pai.ads= qu->ads;
+ pai.qu= qu;
+ pai.serv= serv;
+ pai.dgram= dgram;
+ pai.dglen= dglen;
+ pai.nsstart= nsstart;
+ pai.nscount= nscount;
+ pai.arcount= arcount;
+ pai.now= now;
+
+ for (rri=0, nrrs=0; rri<ancount; rri++) {
+ st= adns__findrr(qu,serv, dgram,dglen,&cbyte,
+ &rrtype,&rrclass,&ttl, &rdlength,&rdstart,
+ &ownermatched);
+ assert(!st); assert(rrtype != -1);
+ if (rrclass != DNS_CLASS_IN ||
+ rrtype != (qu->typei->type & adns__rrt_typemask) ||
+ !ownermatched)
+ continue;
+ adns__update_expires(qu,ttl,now);
+ st= typei->parse(&pai, rdstart,rdstart+rdlength, rrsdata+nrrs*typei->rrsz);
+ if (st) { adns__query_fail(qu,st); return; }
+ if (rdstart==-1) goto x_truncated;
+ nrrs++;
+ }
+ assert(nrrs==wantedrrs);
+ qu->answer->nrrs= nrrs;
+
+ /* This may have generated some child queries ... */
+ if (qu->children.head) {
+ qu->state= query_childw;
+ LIST_LINK_TAIL(ads->childw,qu);
+ return;
+ }
+ adns__query_done(qu);
+ return;
+
+ x_truncated:
+
+ if (!flg_tc) {
+ adns__diag(ads,serv,qu,"server sent datagram which points outside itself");
+ adns__query_fail(qu,adns_s_invalidresponse);
+ return;
+ }
+ qu->flags |= adns_qf_usevc;
+
+ x_restartquery:
+ if (qu->cname_dgram) {
+ st= adns__mkquery_frdgram(qu->ads,&qu->vb,&qu->id,
+ qu->cname_dgram, qu->cname_dglen, qu->cname_begin,
+ qu->typei->type, qu->flags);
+ if (st) { adns__query_fail(qu,st); return; }
+
+ newquery= realloc(qu->query_dgram,qu->vb.used);
+ if (!newquery) { adns__query_fail(qu,adns_s_nomemory); return; }
+
+ qu->query_dgram= newquery;
+ qu->query_dglen= qu->vb.used;
+ memcpy(newquery,qu->vb.buf,qu->vb.used);
+ }
+
+ if (qu->state == query_tcpw) qu->state= query_tosend;
+ qu->retries= 0;
+ adns__reset_preserved(qu);
+ adns__query_send(qu,now);
+}
diff --git a/adns-0.6/src/setup.c b/adns-0.6/src/setup.c
new file mode 100644
index 0000000..ac88c33
--- /dev/null
+++ b/adns-0.6/src/setup.c
@@ -0,0 +1,643 @@
+/*
+ * setup.c
+ * - configuration file parsing
+ * - management of global state
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <stdlib.h>
+#include <errno.h>
+#include <limits.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "internal.h"
+
+static void readconfig(adns_state ads, const char *filename, int warnmissing);
+
+static void addserver(adns_state ads, struct in_addr addr) {
+ int i;
+ struct server *ss;
+
+ for (i=0; i<ads->nservers; i++) {
+ if (ads->servers[i].addr.s_addr == addr.s_addr) {
+ adns__debug(ads,-1,0,"duplicate nameserver %s ignored",inet_ntoa(addr));
+ return;
+ }
+ }
+
+ if (ads->nservers>=MAXSERVERS) {
+ adns__diag(ads,-1,0,"too many nameservers, ignoring %s",inet_ntoa(addr));
+ return;
+ }
+
+ ss= ads->servers+ads->nservers;
+ ss->addr= addr;
+ ads->nservers++;
+}
+
+static void freesearchlist(adns_state ads) {
+ if (ads->nsearchlist) free(*ads->searchlist);
+ free(ads->searchlist);
+}
+
+static void saveerr(adns_state ads, int en) {
+ if (!ads->configerrno) ads->configerrno= en;
+}
+
+static void configparseerr(adns_state ads, const char *fn, int lno,
+ const char *fmt, ...) {
+ va_list al;
+
+ saveerr(ads,EINVAL);
+ if (!ads->diagfile || (ads->iflags & adns_if_noerrprint)) return;
+
+ if (lno==-1) fprintf(ads->diagfile,"adns: %s: ",fn);
+ else fprintf(ads->diagfile,"adns: %s:%d: ",fn,lno);
+ va_start(al,fmt);
+ vfprintf(ads->diagfile,fmt,al);
+ va_end(al);
+ fputc('\n',ads->diagfile);
+}
+
+static int nextword(const char **bufp_io, const char **word_r, int *l_r) {
+ const char *p, *q;
+
+ p= *bufp_io;
+ while (ctype_whitespace(*p)) p++;
+ if (!*p) return 0;
+
+ q= p;
+ while (*q && !ctype_whitespace(*q)) q++;
+
+ *l_r= q-p;
+ *word_r= p;
+ *bufp_io= q;
+
+ return 1;
+}
+
+static void ccf_nameserver(adns_state ads, const char *fn, int lno, const char *buf) {
+ struct in_addr ia;
+
+ if (!inet_aton(buf,&ia)) {
+ configparseerr(ads,fn,lno,"invalid nameserver address `%s'",buf);
+ return;
+ }
+ adns__debug(ads,-1,0,"using nameserver %s",inet_ntoa(ia));
+ addserver(ads,ia);
+}
+
+static void ccf_search(adns_state ads, const char *fn, int lno, const char *buf) {
+ const char *bufp, *word;
+ char *newchars, **newptrs, **pp;
+ int count, tl, l;
+
+ if (!buf) return;
+
+ bufp= buf;
+ count= 0;
+ tl= 0;
+ while (nextword(&bufp,&word,&l)) { count++; tl += l+1; }
+
+ newptrs= malloc(sizeof(char*)*count); if (!newptrs) { saveerr(ads,errno); return; }
+ newchars= malloc(tl); if (!newchars) { saveerr(ads,errno); free(newptrs); return; }
+
+ bufp= buf;
+ pp= newptrs;
+ while (nextword(&bufp,&word,&l)) {
+ *pp++= newchars;
+ memcpy(newchars,word,l);
+ newchars += l;
+ *newchars++ = 0;
+ }
+
+ freesearchlist(ads);
+ ads->nsearchlist= count;
+ ads->searchlist= newptrs;
+}
+
+static void ccf_sortlist(adns_state ads, const char *fn, int lno, const char *buf) {
+ const char *word;
+ char tbuf[200], *slash, *ep;
+ struct in_addr base, mask;
+ int l;
+ unsigned long initial, baselocal;
+
+ if (!buf) return;
+
+ ads->nsortlist= 0;
+ while (nextword(&buf,&word,&l)) {
+ if (ads->nsortlist >= MAXSORTLIST) {
+ adns__diag(ads,-1,0,"too many sortlist entries, ignoring %.*s onwards",l,word);
+ return;
+ }
+
+ if (l >= sizeof(tbuf)) {
+ configparseerr(ads,fn,lno,"sortlist entry `%.*s' too long",l,word);
+ continue;
+ }
+
+ memcpy(tbuf,word,l); tbuf[l]= 0;
+ slash= strchr(tbuf,'/');
+ if (slash) *slash++= 0;
+
+ if (!inet_aton(tbuf,&base)) {
+ configparseerr(ads,fn,lno,"invalid address `%s' in sortlist",tbuf);
+ continue;
+ }
+
+ if (slash) {
+ if (strchr(slash,'.')) {
+ if (!inet_aton(slash,&mask)) {
+ configparseerr(ads,fn,lno,"invalid mask `%s' in sortlist",slash);
+ continue;
+ }
+ if (base.s_addr & ~mask.s_addr) {
+ configparseerr(ads,fn,lno,
+ "mask `%s' in sortlist overlaps address `%s'",slash,tbuf);
+ continue;
+ }
+ } else {
+ initial= strtoul(slash,&ep,10);
+ if (*ep || initial>32) {
+ configparseerr(ads,fn,lno,"mask length `%s' invalid",slash);
+ continue;
+ }
+ mask.s_addr= htonl((0x0ffffffffUL) << (32-initial));
+ }
+ } else {
+ baselocal= ntohl(base.s_addr);
+ if (!baselocal & 0x080000000UL) /* class A */
+ mask.s_addr= htonl(0x0ff000000UL);
+ else if ((baselocal & 0x0c0000000UL) == 0x080000000UL)
+ mask.s_addr= htonl(0x0ffff0000UL); /* class B */
+ else if ((baselocal & 0x0f0000000UL) == 0x0e0000000UL)
+ mask.s_addr= htonl(0x0ff000000UL); /* class C */
+ else {
+ configparseerr(ads,fn,lno,
+ "network address `%s' in sortlist is not in classed ranges,"
+ " must specify mask explicitly", tbuf);
+ continue;
+ }
+ }
+
+ ads->sortlist[ads->nsortlist].base= base;
+ ads->sortlist[ads->nsortlist].mask= mask;
+ ads->nsortlist++;
+ }
+}
+
+static void ccf_options(adns_state ads, const char *fn, int lno, const char *buf) {
+ const char *word;
+ char *ep;
+ unsigned long v;
+ int l;
+
+ if (!buf) return;
+
+ while (nextword(&buf,&word,&l)) {
+ if (l==5 && !memcmp(word,"debug",5)) {
+ ads->iflags |= adns_if_debug;
+ continue;
+ }
+ if (l>=6 && !memcmp(word,"ndots:",6)) {
+ v= strtoul(word+6,&ep,10);
+ if (l==6 || ep != word+l || v > INT_MAX) {
+ configparseerr(ads,fn,lno,"option `%.*s' malformed or has bad value",l,word);
+ continue;
+ }
+ ads->searchndots= v;
+ continue;
+ }
+ if (l>=12 && !memcmp(word,"adns_checkc:",12)) {
+ if (!strcmp(word+12,"none")) {
+ ads->iflags &= ~adns_if_checkc_freq;
+ ads->iflags |= adns_if_checkc_entex;
+ } else if (!strcmp(word+12,"entex")) {
+ ads->iflags &= ~adns_if_checkc_freq;
+ ads->iflags |= adns_if_checkc_entex;
+ } else if (!strcmp(word+12,"freq")) {
+ ads->iflags |= adns_if_checkc_freq;
+ } else {
+ configparseerr(ads,fn,lno, "option adns_checkc has bad value `%s' "
+ "(must be none, entex or freq", word+12);
+ }
+ continue;
+ }
+ adns__diag(ads,-1,0,"%s:%d: unknown option `%.*s'", fn,lno, l,word);
+ }
+}
+
+static void ccf_clearnss(adns_state ads, const char *fn, int lno, const char *buf) {
+ ads->nservers= 0;
+}
+
+static void ccf_include(adns_state ads, const char *fn, int lno, const char *buf) {
+ if (!*buf) {
+ configparseerr(ads,fn,lno,"`include' directive with no filename");
+ return;
+ }
+ readconfig(ads,buf,1);
+}
+
+static const struct configcommandinfo {
+ const char *name;
+ void (*fn)(adns_state ads, const char *fn, int lno, const char *buf);
+} configcommandinfos[]= {
+ { "nameserver", ccf_nameserver },
+ { "domain", ccf_search },
+ { "search", ccf_search },
+ { "sortlist", ccf_sortlist },
+ { "options", ccf_options },
+ { "clearnameservers", ccf_clearnss },
+ { "include", ccf_include },
+ { 0 }
+};
+
+typedef union {
+ FILE *file;
+ const char *text;
+} getline_ctx;
+
+static int gl_file(adns_state ads, getline_ctx *src_io, const char *filename,
+ int lno, char *buf, int buflen) {
+ FILE *file= src_io->file;
+ int c, i;
+ char *p;
+
+ p= buf;
+ buflen--;
+ i= 0;
+
+ for (;;) { /* loop over chars */
+ if (i == buflen) {
+ adns__diag(ads,-1,0,"%s:%d: line too long, ignored",filename,lno);
+ goto x_badline;
+ }
+ c= getc(file);
+ if (!c) {
+ adns__diag(ads,-1,0,"%s:%d: line contains nul, ignored",filename,lno);
+ goto x_badline;
+ } else if (c == '\n') {
+ break;
+ } else if (c == EOF) {
+ if (ferror(file)) {
+ saveerr(ads,errno);
+ adns__diag(ads,-1,0,"%s:%d: read error: %s",filename,lno,strerror(errno));
+ return -1;
+ }
+ if (!i) return -1;
+ break;
+ } else {
+ *p++= c;
+ i++;
+ }
+ }
+
+ *p++= 0;
+ return i;
+
+ x_badline:
+ saveerr(ads,EINVAL);
+ while ((c= getc(file)) != EOF && c != '\n');
+ return -2;
+}
+
+static int gl_text(adns_state ads, getline_ctx *src_io, const char *filename,
+ int lno, char *buf, int buflen) {
+ const char *cp= src_io->text;
+ int l;
+
+ if (!cp || !*cp) return -1;
+
+ if (*cp == ';' || *cp == '\n') cp++;
+ l= strcspn(cp,";\n");
+ src_io->text = cp+l;
+
+ if (l >= buflen) {
+ adns__diag(ads,-1,0,"%s:%d: line too long, ignored",filename,lno);
+ saveerr(ads,EINVAL);
+ return -2;
+ }
+
+ memcpy(buf,cp,l);
+ buf[l]= 0;
+ return l;
+}
+
+static void readconfiggeneric(adns_state ads, const char *filename,
+ int (*getline)(adns_state ads, getline_ctx*,
+ const char *filename, int lno,
+ char *buf, int buflen),
+ /* Returns >=0 for success, -1 for EOF or error
+ * (error will have been reported), or -2 for
+ * bad line was encountered, try again.
+ */
+ getline_ctx gl_ctx) {
+ char linebuf[2000], *p, *q;
+ int lno, l, dirl;
+ const struct configcommandinfo *ccip;
+
+ for (lno=1;
+ (l= getline(ads,&gl_ctx, filename,lno, linebuf,sizeof(linebuf))) != -1;
+ lno++) {
+ if (l == -2) continue;
+ while (l>0 && ctype_whitespace(linebuf[l-1])) l--;
+ linebuf[l]= 0;
+ p= linebuf;
+ while (ctype_whitespace(*p)) p++;
+ if (*p == '#' || !*p) continue;
+ q= p;
+ while (*q && !ctype_whitespace(*q)) q++;
+ dirl= q-p;
+ for (ccip=configcommandinfos;
+ ccip->name && !(strlen(ccip->name)==dirl && !memcmp(ccip->name,p,q-p));
+ ccip++);
+ if (!ccip->name) {
+ adns__diag(ads,-1,0,"%s:%d: unknown configuration directive `%.*s'",
+ filename,lno,q-p,p);
+ continue;
+ }
+ while (ctype_whitespace(*q)) q++;
+ ccip->fn(ads,filename,lno,q);
+ }
+}
+
+static const char *instrum_getenv(adns_state ads, const char *envvar) {
+ const char *value;
+
+ value= getenv(envvar);
+ if (!value) adns__debug(ads,-1,0,"environment variable %s not set",envvar);
+ else adns__debug(ads,-1,0,"environment variable %s set to `%s'",envvar,value);
+ return value;
+}
+
+static void readconfig(adns_state ads, const char *filename, int warnmissing) {
+ getline_ctx gl_ctx;
+
+ gl_ctx.file= fopen(filename,"r");
+ if (!gl_ctx.file) {
+ if (errno == ENOENT) {
+ if (warnmissing)
+ adns__debug(ads,-1,0,"configuration file `%s' does not exist",filename);
+ return;
+ }
+ saveerr(ads,errno);
+ adns__diag(ads,-1,0,"cannot open configuration file `%s': %s",
+ filename,strerror(errno));
+ return;
+ }
+
+ readconfiggeneric(ads,filename,gl_file,gl_ctx);
+
+ fclose(gl_ctx.file);
+}
+
+static void readconfigtext(adns_state ads, const char *text, const char *showname) {
+ getline_ctx gl_ctx;
+
+ gl_ctx.text= text;
+ readconfiggeneric(ads,showname,gl_text,gl_ctx);
+}
+
+static void readconfigenv(adns_state ads, const char *envvar) {
+ const char *filename;
+
+ if (ads->iflags & adns_if_noenv) {
+ adns__debug(ads,-1,0,"not checking environment variable `%s'",envvar);
+ return;
+ }
+ filename= instrum_getenv(ads,envvar);
+ if (filename) readconfig(ads,filename,1);
+}
+
+static void readconfigenvtext(adns_state ads, const char *envvar) {
+ const char *textdata;
+
+ if (ads->iflags & adns_if_noenv) {
+ adns__debug(ads,-1,0,"not checking environment variable `%s'",envvar);
+ return;
+ }
+ textdata= instrum_getenv(ads,envvar);
+ if (textdata) readconfigtext(ads,textdata,envvar);
+}
+
+
+int adns__setnonblock(adns_state ads, int fd) {
+ int r;
+
+ r= fcntl(fd,F_GETFL,0); if (r<0) return errno;
+ r |= O_NONBLOCK;
+ r= fcntl(fd,F_SETFL,r); if (r<0) return errno;
+ return 0;
+}
+
+static int init_begin(adns_state *ads_r, adns_initflags flags, FILE *diagfile) {
+ adns_state ads;
+
+ ads= malloc(sizeof(*ads)); if (!ads) return errno;
+
+ ads->iflags= flags;
+ ads->diagfile= diagfile;
+ ads->configerrno= 0;
+ LIST_INIT(ads->udpw);
+ LIST_INIT(ads->tcpw);
+ LIST_INIT(ads->childw);
+ LIST_INIT(ads->output);
+ ads->forallnext= 0;
+ ads->nextid= 0x311f;
+ ads->udpsocket= ads->tcpsocket= -1;
+ adns__vbuf_init(&ads->tcpsend);
+ adns__vbuf_init(&ads->tcprecv);
+ ads->tcprecv_skip= 0;
+ ads->nservers= ads->nsortlist= ads->nsearchlist= ads->tcpserver= 0;
+ ads->searchndots= 1;
+ ads->tcpstate= server_disconnected;
+ timerclear(&ads->tcptimeout);
+ ads->searchlist= 0;
+
+ *ads_r= ads;
+ return 0;
+}
+
+static int init_finish(adns_state ads) {
+ struct in_addr ia;
+ struct protoent *proto;
+ int r;
+
+ if (!ads->nservers) {
+ if (ads->diagfile && ads->iflags & adns_if_debug)
+ fprintf(ads->diagfile,"adns: no nameservers, using localhost\n");
+ ia.s_addr= htonl(INADDR_LOOPBACK);
+ addserver(ads,ia);
+ }
+
+ proto= getprotobyname("udp"); if (!proto) { r= ENOPROTOOPT; goto x_free; }
+ ads->udpsocket= socket(AF_INET,SOCK_DGRAM,proto->p_proto);
+ if (ads->udpsocket<0) { r= errno; goto x_free; }
+
+ r= adns__setnonblock(ads,ads->udpsocket);
+ if (r) { r= errno; goto x_closeudp; }
+
+ return 0;
+
+ x_closeudp:
+ close(ads->udpsocket);
+ x_free:
+ free(ads);
+ return r;
+}
+
+static void init_abort(adns_state ads) {
+ if (ads->nsearchlist) {
+ free(ads->searchlist[0]);
+ free(ads->searchlist);
+ }
+ free(ads);
+}
+
+int adns_init(adns_state *ads_r, adns_initflags flags, FILE *diagfile) {
+ adns_state ads;
+ const char *res_options, *adns_res_options;
+ int r;
+
+ r= init_begin(&ads, flags, diagfile ? diagfile : stderr);
+ if (r) return r;
+
+ res_options= instrum_getenv(ads,"RES_OPTIONS");
+ adns_res_options= instrum_getenv(ads,"ADNS_RES_OPTIONS");
+ ccf_options(ads,"RES_OPTIONS",-1,res_options);
+ ccf_options(ads,"ADNS_RES_OPTIONS",-1,adns_res_options);
+
+ readconfig(ads,"/etc/resolv.conf",1);
+ readconfig(ads,"/etc/resolv-adns.conf",0);
+ readconfigenv(ads,"RES_CONF");
+ readconfigenv(ads,"ADNS_RES_CONF");
+
+ readconfigenvtext(ads,"RES_CONF_TEXT");
+ readconfigenvtext(ads,"ADNS_RES_CONF_TEXT");
+
+ ccf_options(ads,"RES_OPTIONS",-1,res_options);
+ ccf_options(ads,"ADNS_RES_OPTIONS",-1,adns_res_options);
+
+ ccf_search(ads,"LOCALDOMAIN",-1,instrum_getenv(ads,"LOCALDOMAIN"));
+ ccf_search(ads,"ADNS_LOCALDOMAIN",-1,instrum_getenv(ads,"ADNS_LOCALDOMAIN"));
+
+ if (ads->configerrno && ads->configerrno != EINVAL) {
+ r= ads->configerrno;
+ init_abort(ads);
+ return r;
+ }
+
+ r= init_finish(ads);
+ if (r) return r;
+
+ adns__consistency(ads,0,cc_entex);
+ *ads_r= ads;
+ return 0;
+}
+
+int adns_init_strcfg(adns_state *ads_r, adns_initflags flags,
+ FILE *diagfile, const char *configtext) {
+ adns_state ads;
+ int r;
+
+ r= init_begin(&ads, flags, diagfile); if (r) return r;
+
+ readconfigtext(ads,configtext,"<supplied configuration text>");
+ if (ads->configerrno) {
+ r= ads->configerrno;
+ init_abort(ads);
+ return r;
+ }
+
+ r= init_finish(ads); if (r) return r;
+ adns__consistency(ads,0,cc_entex);
+ *ads_r= ads;
+ return 0;
+}
+
+
+void adns_finish(adns_state ads) {
+ adns__consistency(ads,0,cc_entex);
+ for (;;) {
+ if (ads->udpw.head) adns_cancel(ads->udpw.head);
+ else if (ads->tcpw.head) adns_cancel(ads->tcpw.head);
+ else if (ads->childw.head) adns_cancel(ads->childw.head);
+ else if (ads->output.head) adns_cancel(ads->output.head);
+ else break;
+ }
+ close(ads->udpsocket);
+ if (ads->tcpsocket >= 0) close(ads->tcpsocket);
+ adns__vbuf_free(&ads->tcpsend);
+ adns__vbuf_free(&ads->tcprecv);
+ freesearchlist(ads);
+ free(ads);
+}
+
+void adns_forallqueries_begin(adns_state ads) {
+ adns__consistency(ads,0,cc_entex);
+ ads->forallnext=
+ ads->udpw.head ? ads->udpw.head :
+ ads->tcpw.head ? ads->tcpw.head :
+ ads->childw.head ? ads->childw.head :
+ ads->output.head;
+}
+
+adns_query adns_forallqueries_next(adns_state ads, void **context_r) {
+ adns_query qu, nqu;
+
+ adns__consistency(ads,0,cc_entex);
+ nqu= ads->forallnext;
+ for (;;) {
+ qu= nqu;
+ if (!qu) return 0;
+ if (qu->next) {
+ nqu= qu->next;
+ } else if (qu == ads->udpw.tail) {
+ nqu=
+ ads->tcpw.head ? ads->tcpw.head :
+ ads->childw.head ? ads->childw.head :
+ ads->output.head;
+ } else if (qu == ads->tcpw.tail) {
+ nqu=
+ ads->childw.head ? ads->childw.head :
+ ads->output.head;
+ } else if (qu == ads->childw.tail) {
+ nqu= ads->output.head;
+ } else {
+ nqu= 0;
+ }
+ if (!qu->parent) break;
+ }
+ ads->forallnext= nqu;
+ if (context_r) *context_r= qu->ctx.ext;
+ return qu;
+}
diff --git a/adns-0.6/src/transmit.c b/adns-0.6/src/transmit.c
new file mode 100644
index 0000000..c669af6
--- /dev/null
+++ b/adns-0.6/src/transmit.c
@@ -0,0 +1,257 @@
+/*
+ * transmit.c
+ * - construct queries
+ * - send queries
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <errno.h>
+
+#include <sys/types.h>
+#include <sys/uio.h>
+
+#include "internal.h"
+#include "tvarith.h"
+
+#define MKQUERY_START(vb) (rqp= (vb)->buf+(vb)->used)
+#define MKQUERY_ADDB(b) *rqp++= (b)
+#define MKQUERY_ADDW(w) (MKQUERY_ADDB(((w)>>8)&0x0ff), MKQUERY_ADDB((w)&0x0ff))
+#define MKQUERY_STOP(vb) ((vb)->used= rqp-(vb)->buf)
+
+static adns_status mkquery_header(adns_state ads, vbuf *vb, int *id_r, int qdlen) {
+ int id;
+ byte *rqp;
+
+ if (!adns__vbuf_ensure(vb,DNS_HDRSIZE+qdlen+4)) return adns_s_nomemory;
+
+ vb->used= 0;
+ MKQUERY_START(vb);
+
+ *id_r= id= (ads->nextid++) & 0x0ffff;
+ MKQUERY_ADDW(id);
+ MKQUERY_ADDB(0x01); /* QR=Q(0), OPCODE=QUERY(0000), !AA, !TC, RD */
+ MKQUERY_ADDB(0x00); /* !RA, Z=000, RCODE=NOERROR(0000) */
+ MKQUERY_ADDW(1); /* QDCOUNT=1 */
+ MKQUERY_ADDW(0); /* ANCOUNT=0 */
+ MKQUERY_ADDW(0); /* NSCOUNT=0 */
+ MKQUERY_ADDW(0); /* ARCOUNT=0 */
+
+ MKQUERY_STOP(vb);
+
+ return adns_s_ok;
+}
+
+static adns_status mkquery_footer(vbuf *vb, adns_rrtype type) {
+ byte *rqp;
+
+ MKQUERY_START(vb);
+ MKQUERY_ADDW(type & adns__rrt_typemask); /* QTYPE */
+ MKQUERY_ADDW(DNS_CLASS_IN); /* QCLASS=IN */
+ MKQUERY_STOP(vb);
+ assert(vb->used <= vb->avail);
+
+ return adns_s_ok;
+}
+
+adns_status adns__mkquery(adns_state ads, vbuf *vb, int *id_r,
+ const char *owner, int ol,
+ const typeinfo *typei, adns_queryflags flags) {
+ int ll, c, nlabs;
+ byte label[255], *rqp;
+ const char *p, *pe;
+ adns_status st;
+
+ st= mkquery_header(ads,vb,id_r,ol+2); if (st) return st;
+
+ MKQUERY_START(vb);
+
+ p= owner; pe= owner+ol;
+ nlabs= 0;
+ while (p!=pe) {
+ ll= 0;
+ while (p!=pe && (c= *p++)!='.') {
+ if (c=='\\') {
+ if (!(flags & adns_qf_quoteok_query)) return adns_s_querydomaininvalid;
+ if (ctype_digit(p[0])) {
+ if (ctype_digit(p[1]) && ctype_digit(p[2])) {
+ c= (*p++ - '0')*100 + (*p++ - '0')*10 + (*p++ - '0');
+ if (c >= 256) return adns_s_querydomaininvalid;
+ } else {
+ return adns_s_querydomaininvalid;
+ }
+ } else if (!(c= *p++)) {
+ return adns_s_querydomaininvalid;
+ }
+ }
+ if (!(flags & adns_qf_quoteok_query)) {
+ if (c == '-') {
+ if (!ll) return adns_s_querydomaininvalid;
+ } else if (!ctype_alpha(c) && !ctype_digit(c)) {
+ return adns_s_querydomaininvalid;
+ }
+ }
+ if (ll == sizeof(label)) return adns_s_querydomaininvalid;
+ label[ll++]= c;
+ }
+ if (!ll) return adns_s_querydomaininvalid;
+ if (nlabs++ > 63) return adns_s_querydomaintoolong;
+ MKQUERY_ADDB(ll);
+ memcpy(rqp,label,ll); rqp+= ll;
+ }
+ MKQUERY_ADDB(0);
+
+ MKQUERY_STOP(vb);
+
+ st= mkquery_footer(vb,typei->type);
+
+ return adns_s_ok;
+}
+
+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) {
+ byte *rqp;
+ findlabel_state fls;
+ int lablen, labstart;
+ adns_status st;
+
+ st= mkquery_header(ads,vb,id_r,qd_dglen); if (st) return st;
+
+ MKQUERY_START(vb);
+
+ adns__findlabel_start(&fls,ads,-1,0,qd_dgram,qd_dglen,qd_dglen,qd_begin,0);
+ for (;;) {
+ st= adns__findlabel_next(&fls,&lablen,&labstart); assert(!st);
+ if (!lablen) break;
+ assert(lablen<255);
+ MKQUERY_ADDB(lablen);
+ memcpy(rqp,qd_dgram+labstart,lablen);
+ rqp+= lablen;
+ }
+ MKQUERY_ADDB(0);
+
+ MKQUERY_STOP(vb);
+
+ st= mkquery_footer(vb,type);
+
+ return adns_s_ok;
+}
+
+void adns__querysend_tcp(adns_query qu, struct timeval now) {
+ byte length[2];
+ struct iovec iov[2];
+ int wr, r;
+ adns_state ads;
+
+ if (qu->ads->tcpstate != server_ok) return;
+
+ assert(qu->state == query_tcpw);
+
+ length[0]= (qu->query_dglen&0x0ff00U) >>8;
+ length[1]= (qu->query_dglen&0x0ff);
+
+ ads= qu->ads;
+ if (!adns__vbuf_ensure(&ads->tcpsend,ads->tcpsend.used+qu->query_dglen+2)) return;
+
+ qu->retries++;
+
+ /* Reset idle timeout. */
+ ads->tcptimeout.tv_sec= ads->tcptimeout.tv_usec= 0;
+
+ if (ads->tcpsend.used) {
+ wr= 0;
+ } else {
+ iov[0].iov_base= length;
+ iov[0].iov_len= 2;
+ iov[1].iov_base= qu->query_dgram;
+ iov[1].iov_len= qu->query_dglen;
+ adns__sigpipe_protect(qu->ads);
+ wr= writev(qu->ads->tcpsocket,iov,2);
+ adns__sigpipe_unprotect(qu->ads);
+ if (wr < 0) {
+ if (!(errno == EAGAIN || errno == EINTR || errno == ENOSPC ||
+ errno == ENOBUFS || errno == ENOMEM)) {
+ adns__tcp_broken(ads,"write",strerror(errno));
+ return;
+ }
+ wr= 0;
+ }
+ }
+
+ if (wr<2) {
+ r= adns__vbuf_append(&ads->tcpsend,length,2-wr); assert(r);
+ wr= 0;
+ } else {
+ wr-= 2;
+ }
+ if (wr<qu->query_dglen) {
+ r= adns__vbuf_append(&ads->tcpsend,qu->query_dgram+wr,qu->query_dglen-wr); assert(r);
+ }
+}
+
+static void query_usetcp(adns_query qu, struct timeval now) {
+ qu->state= query_tcpw;
+ qu->timeout= now;
+ timevaladd(&qu->timeout,TCPWAITMS);
+ LIST_LINK_TAIL(qu->ads->tcpw,qu);
+ adns__querysend_tcp(qu,now);
+ adns__tcp_tryconnect(qu->ads,now);
+}
+
+void adns__query_send(adns_query qu, struct timeval now) {
+ struct sockaddr_in servaddr;
+ int serv, r;
+ adns_state ads;
+
+ assert(qu->state == query_tosend);
+ if ((qu->flags & adns_qf_usevc) || (qu->query_dglen > DNS_MAXUDP)) {
+ query_usetcp(qu,now);
+ return;
+ }
+
+ if (qu->retries >= UDPMAXRETRIES) {
+ adns__query_fail(qu,adns_s_timeout);
+ return;
+ }
+
+ serv= qu->udpnextserver;
+ memset(&servaddr,0,sizeof(servaddr));
+
+ ads= qu->ads;
+ servaddr.sin_family= AF_INET;
+ servaddr.sin_addr= ads->servers[serv].addr;
+ servaddr.sin_port= htons(DNS_PORT);
+
+ r= sendto(ads->udpsocket,qu->query_dgram,qu->query_dglen,0,
+ (const struct sockaddr*)&servaddr,sizeof(servaddr));
+ if (r<0 && errno == EMSGSIZE) { qu->retries= 0; query_usetcp(qu,now); return; }
+ if (r<0) adns__warn(ads,serv,0,"sendto failed: %s",strerror(errno));
+
+ qu->timeout= now;
+ timevaladd(&qu->timeout,UDPRETRYMS);
+ qu->udpsent |= (1<<serv);
+ qu->udpnextserver= (serv+1)%ads->nservers;
+ qu->retries++;
+ LIST_LINK_TAIL(ads->udpw,qu);
+}
diff --git a/adns-0.6/src/tvarith.h b/adns-0.6/src/tvarith.h
new file mode 100644
index 0000000..202da1f
--- /dev/null
+++ b/adns-0.6/src/tvarith.h
@@ -0,0 +1,41 @@
+/*
+ * tvarith.h
+ * - static inline functions for doing arithmetic on timevals
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef ADNS_TVARITH_H_INCLUDED
+#define ADNS_TVARITH_H_INCLUDED
+
+static inline void timevaladd(struct timeval *tv_io, long ms) {
+ struct timeval tmp;
+ assert(ms>=0);
+ tmp= *tv_io;
+ tmp.tv_usec += (ms%1000)*1000;
+ tmp.tv_sec += ms/1000;
+ if (tmp.tv_usec >= 1000000) { tmp.tv_sec++; tmp.tv_usec -= 1000000; }
+ *tv_io= tmp;
+}
+
+#endif
diff --git a/adns-0.6/src/types.c b/adns-0.6/src/types.c
new file mode 100644
index 0000000..668986f
--- /dev/null
+++ b/adns-0.6/src/types.c
@@ -0,0 +1,1034 @@
+/*
+ * types.c
+ * - RR-type-specific code, and the machinery to call it
+ */
+/*
+ * This file is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ * It is part of adns, which is
+ * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <stdlib.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "internal.h"
+
+#define R_NOMEM return adns_s_nomemory
+#define CSP_ADDSTR(s) do { if (!adns__vbuf_appendstr(vb,(s))) R_NOMEM; } while (0)
+
+/*
+ * order of sections:
+ *
+ * _string (pap)
+ * _textdata, _qstring (csp)
+ * _str (mf,cs)
+ * _intstr (mf,csp,cs)
+ * _manyistr (mf,cs)
+ * _txt (pa)
+ * _inaddr (pa,dip,di)
+ * _addr (pa,di,csp,cs)
+ * _domain (pap)
+ * _host_raw (pa)
+ * _hostaddr (pap,pa,dip,di,mfp,mf,csp,cs +pap_findaddrs)
+ * _mx_raw (pa,di)
+ * _mx (pa,di)
+ * _inthostaddr (mf,cs)
+ * _ptr (pa)
+ * _strpair (mf,cs)
+ * _intstrpair (mf,cs)
+ * _hinfo (pa)
+ * _mailbox (pap +pap_mailbox822)
+ * _rp (pa)
+ * _soa (pa,mf,cs)
+ * _flat (mf)
+ *
+ * within each section:
+ * pap_*
+ * pa_*
+ * dip_*
+ * di_*
+ * mfp_*
+ * mf_*
+ * csp_*
+ * cs_*
+ */
+
+/*
+ * _qstring (pap,csp)
+ */
+
+static adns_status pap_qstring(const parseinfo *pai, int *cbyte_io, int max,
+ int *len_r, char **str_r) {
+ /* Neither len_r nor str_r may be null.
+ * End of datagram (overrun) is indicated by returning adns_s_invaliddata;
+ */
+ const byte *dgram= pai->dgram;
+ int l, cbyte;
+ char *str;
+
+ cbyte= *cbyte_io;
+
+ if (cbyte >= max) return adns_s_invaliddata;
+ GET_B(cbyte,l);
+ if (cbyte+l > max) return adns_s_invaliddata;
+
+ str= adns__alloc_interim(pai->qu, l+1);
+ if (!str) R_NOMEM;
+
+ str[l]= 0;
+ memcpy(str,dgram+cbyte,l);
+
+ *len_r= l;
+ *str_r= str;
+ *cbyte_io= cbyte+l;
+
+ return adns_s_ok;
+}
+
+static adns_status csp_qstring(vbuf *vb, const char *dp, int len) {
+ unsigned char ch;
+ char buf[10];
+ int cn;
+
+ CSP_ADDSTR("\"");
+ for (cn=0; cn<len; cn++) {
+ ch= *dp++;
+ if (ch == '\\') {
+ CSP_ADDSTR("\\\\");
+ } else if (ch == '"') {
+ CSP_ADDSTR("\\\"");
+ } else if (ch >= 32 && ch <= 126) {
+ if (!adns__vbuf_append(vb,&ch,1)) R_NOMEM;
+ } else {
+ sprintf(buf,"\\x%02x",ch);
+ CSP_ADDSTR(buf);
+ }
+ }
+ CSP_ADDSTR("\"");
+
+ return adns_s_ok;
+}
+
+/*
+ * _str (mf)
+ */
+
+static void mf_str(adns_query qu, void *datap) {
+ char **rrp= datap;
+
+ adns__makefinal_str(qu,rrp);
+}
+
+/*
+ * _intstr (mf)
+ */
+
+static void mf_intstr(adns_query qu, void *datap) {
+ adns_rr_intstr *rrp= datap;
+
+ adns__makefinal_str(qu,&rrp->str);
+}
+
+/*
+ * _manyistr (mf)
+ */
+
+static void mf_manyistr(adns_query qu, void *datap) {
+ adns_rr_intstr **rrp= datap;
+ adns_rr_intstr *te, *table;
+ void *tablev;
+ int tc;
+
+ for (tc=0, te= *rrp; te->i >= 0; te++, tc++);
+ tablev= *rrp;
+ adns__makefinal_block(qu,&tablev,sizeof(*te)*(tc+1));
+ *rrp= table= tablev;
+ for (te= *rrp; te->i >= 0; te++)
+ adns__makefinal_str(qu,&te->str);
+}
+
+/*
+ * _txt (pa,cs)
+ */
+
+static adns_status pa_txt(const parseinfo *pai, int cbyte, int max, void *datap) {
+ adns_rr_intstr **rrp= datap, *table, *te;
+ const byte *dgram= pai->dgram;
+ int ti, tc, l, startbyte;
+ adns_status st;
+
+ startbyte= cbyte;
+ if (cbyte >= max) return adns_s_invaliddata;
+ tc= 0;
+ while (cbyte < max) {
+ GET_B(cbyte,l);
+ cbyte+= l;
+ tc++;
+ }
+ if (cbyte != max || !tc) return adns_s_invaliddata;
+
+ table= adns__alloc_interim(pai->qu,sizeof(*table)*(tc+1));
+ if (!table) R_NOMEM;
+
+ for (cbyte=startbyte, ti=0, te=table; ti<tc; ti++, te++) {
+ st= pap_qstring(pai, &cbyte, max, &te->i, &te->str);
+ if (st) return st;
+ }
+ assert(cbyte == max);
+
+ te->i= -1;
+ te->str= 0;
+
+ *rrp= table;
+ return adns_s_ok;
+}
+
+static adns_status cs_txt(vbuf *vb, const void *datap) {
+ const adns_rr_intstr *const *rrp= datap;
+ const adns_rr_intstr *current;
+ adns_status st;
+ int spc;
+
+ for (current= *rrp, spc=0; current->i >= 0; current++, spc=1) {
+ if (spc) CSP_ADDSTR(" ");
+ st= csp_qstring(vb,current->str,current->i); if (st) return st;
+ }
+ return adns_s_ok;
+}
+
+/*
+ * _hinfo (cs)
+ */
+
+static adns_status cs_hinfo(vbuf *vb, const void *datap) {
+ const adns_rr_intstrpair *rrp= datap;
+ adns_status st;
+
+ st= csp_qstring(vb,rrp->array[0].str,rrp->array[0].i); if (st) return st;
+ CSP_ADDSTR(" ");
+ st= csp_qstring(vb,rrp->array[1].str,rrp->array[1].i); if (st) return st;
+ return adns_s_ok;
+}
+
+/*
+ * _inaddr (pa,dip,di)
+ */
+
+static adns_status pa_inaddr(const parseinfo *pai, int cbyte, int max, void *datap) {
+ struct in_addr *storeto= datap;
+
+ if (max-cbyte != 4) return adns_s_invaliddata;
+ memcpy(storeto, pai->dgram + cbyte, 4);
+ return adns_s_ok;
+}
+
+static int search_sortlist(adns_state ads, struct in_addr ad) {
+ const struct sortlist *slp;
+ int i;
+
+ for (i=0, slp=ads->sortlist;
+ i<ads->nsortlist && !((ad.s_addr & slp->mask.s_addr) == slp->base.s_addr);
+ i++, slp++);
+ return i;
+}
+
+static int dip_inaddr(adns_state ads, struct in_addr a, struct in_addr b) {
+ int ai, bi;
+
+ if (!ads->nsortlist) return 0;
+
+ ai= search_sortlist(ads,a);
+ bi= search_sortlist(ads,b);
+ return bi<ai;
+}
+
+static int di_inaddr(adns_state ads, const void *datap_a, const void *datap_b) {
+ const struct in_addr *ap= datap_a, *bp= datap_b;
+
+ return dip_inaddr(ads,*ap,*bp);
+}
+
+static adns_status cs_inaddr(vbuf *vb, const void *datap) {
+ const struct in_addr *rrp= datap, rr= *rrp;
+ const char *ia;
+
+ ia= inet_ntoa(rr); assert(ia);
+ CSP_ADDSTR(ia);
+ return adns_s_ok;
+}
+
+/*
+ * _addr (pa,di,csp,cs)
+ */
+
+static adns_status pa_addr(const parseinfo *pai, int cbyte, int max, void *datap) {
+ adns_rr_addr *storeto= datap;
+ const byte *dgram= pai->dgram;
+
+ if (max-cbyte != 4) return adns_s_invaliddata;
+ storeto->len= sizeof(storeto->addr.inet);
+ memset(&storeto->addr,0,sizeof(storeto->addr.inet));
+ storeto->addr.inet.sin_family= AF_INET;
+ memcpy(&storeto->addr.inet.sin_addr,dgram+cbyte,4);
+ return adns_s_ok;
+}
+
+static int di_addr(adns_state ads, const void *datap_a, const void *datap_b) {
+ const adns_rr_addr *ap= datap_a, *bp= datap_b;
+
+ assert(ap->addr.sa.sa_family == AF_INET);
+ return dip_inaddr(ads, ap->addr.inet.sin_addr, bp->addr.inet.sin_addr);
+}
+
+static int div_addr(void *context, const void *datap_a, const void *datap_b) {
+ const adns_state ads= context;
+
+ return di_addr(ads, datap_a, datap_b);
+}
+
+static adns_status csp_addr(vbuf *vb, const adns_rr_addr *rrp) {
+ const char *ia;
+ static char buf[30];
+
+ switch (rrp->addr.inet.sin_family) {
+ case AF_INET:
+ CSP_ADDSTR("INET ");
+ ia= inet_ntoa(rrp->addr.inet.sin_addr); assert(ia);
+ CSP_ADDSTR(ia);
+ break;
+ default:
+ sprintf(buf,"AF=%u",rrp->addr.sa.sa_family);
+ CSP_ADDSTR(buf);
+ break;
+ }
+ return adns_s_ok;
+}
+
+static adns_status cs_addr(vbuf *vb, const void *datap) {
+ const adns_rr_addr *rrp= datap;
+
+ return csp_addr(vb,rrp);
+}
+
+/*
+ * _domain (pap,csp,cs)
+ * _dom_raw (pa)
+ */
+
+static adns_status pap_domain(const parseinfo *pai, int *cbyte_io, int max,
+ char **domain_r, parsedomain_flags flags) {
+ adns_status st;
+ char *dm;
+
+ st= adns__parse_domain(pai->qu->ads, pai->serv, pai->qu, &pai->qu->vb, flags,
+ pai->dgram,pai->dglen, cbyte_io, max);
+ if (st) return st;
+ if (!pai->qu->vb.used) return adns_s_invaliddata;
+
+ dm= adns__alloc_interim(pai->qu, pai->qu->vb.used+1);
+ if (!dm) R_NOMEM;
+
+ dm[pai->qu->vb.used]= 0;
+ memcpy(dm,pai->qu->vb.buf,pai->qu->vb.used);
+
+ *domain_r= dm;
+ return adns_s_ok;
+}
+
+static adns_status csp_domain(vbuf *vb, const char *domain) {
+ CSP_ADDSTR(domain);
+ if (!*domain) CSP_ADDSTR(".");
+ return adns_s_ok;
+}
+
+static adns_status cs_domain(vbuf *vb, const void *datap) {
+ const char *const *domainp= datap;
+ return csp_domain(vb,*domainp);
+}
+
+static adns_status pa_dom_raw(const parseinfo *pai, int cbyte, int max, void *datap) {
+ char **rrp= datap;
+ adns_status st;
+
+ st= pap_domain(pai, &cbyte, max, rrp, pdf_quoteok);
+ if (st) return st;
+
+ if (cbyte != max) return adns_s_invaliddata;
+ return adns_s_ok;
+}
+
+/*
+ * _host_raw (pa)
+ */
+
+static adns_status pa_host_raw(const parseinfo *pai, int cbyte, int max, void *datap) {
+ char **rrp= datap;
+ adns_status st;
+
+ st= pap_domain(pai, &cbyte, max, rrp,
+ pai->qu->flags & adns_qf_quoteok_anshost ? pdf_quoteok : 0);
+ if (st) return st;
+
+ if (cbyte != max) return adns_s_invaliddata;
+ return adns_s_ok;
+}
+
+/*
+ * _hostaddr (pap,pa,dip,di,mfp,mf,csp,cs +icb_hostaddr, pap_findaddrs)
+ */
+
+static adns_status pap_findaddrs(const parseinfo *pai, adns_rr_hostaddr *ha,
+ int *cbyte_io, int count, int dmstart) {
+ int rri, naddrs;
+ int type, class, rdlen, rdstart, ownermatched;
+ unsigned long ttl;
+ adns_status st;
+
+ for (rri=0, naddrs=-1; rri<count; rri++) {
+ st= adns__findrr_anychk(pai->qu, pai->serv, pai->dgram, pai->dglen, cbyte_io,
+ &type, &class, &ttl, &rdlen, &rdstart,
+ pai->dgram, pai->dglen, dmstart, &ownermatched);
+ if (st) return st;
+ if (!ownermatched || class != DNS_CLASS_IN || type != adns_r_a) {
+ if (naddrs>0) break; else continue;
+ }
+ if (naddrs == -1) {
+ naddrs= 0;
+ }
+ if (!adns__vbuf_ensure(&pai->qu->vb, (naddrs+1)*sizeof(adns_rr_addr))) R_NOMEM;
+ adns__update_expires(pai->qu,ttl,pai->now);
+ st= pa_addr(pai, rdstart,rdstart+rdlen,
+ pai->qu->vb.buf + naddrs*sizeof(adns_rr_addr));
+ if (st) return st;
+ naddrs++;
+ }
+ if (naddrs >= 0) {
+ ha->addrs= adns__alloc_interim(pai->qu, naddrs*sizeof(adns_rr_addr));
+ if (!ha->addrs) R_NOMEM;
+ memcpy(ha->addrs, pai->qu->vb.buf, naddrs*sizeof(adns_rr_addr));
+ ha->naddrs= naddrs;
+ ha->astatus= adns_s_ok;
+
+ adns__isort(ha->addrs, naddrs, sizeof(adns_rr_addr), pai->qu->vb.buf,
+ div_addr, pai->ads);
+ }
+ return adns_s_ok;
+}
+
+static void icb_hostaddr(adns_query parent, adns_query child) {
+ adns_answer *cans= child->answer;
+ adns_rr_hostaddr *rrp= child->ctx.info.hostaddr;
+ adns_state ads= parent->ads;
+ adns_status st;
+
+ st= cans->status;
+ rrp->astatus= st;
+ rrp->naddrs= (st>0 && st<=adns_s_max_tempfail) ? -1 : cans->nrrs;
+ rrp->addrs= cans->rrs.addr;
+ adns__transfer_interim(child, parent, rrp->addrs, rrp->naddrs*sizeof(adns_rr_addr));
+
+ if (parent->children.head) {
+ LIST_LINK_TAIL(ads->childw,parent);
+ } else {
+ adns__query_done(parent);
+ }
+}
+
+static adns_status pap_hostaddr(const parseinfo *pai, int *cbyte_io,
+ int max, adns_rr_hostaddr *rrp) {
+ adns_status st;
+ int dmstart, cbyte;
+ qcontext ctx;
+ int id;
+ adns_query nqu;
+ adns_queryflags nflags;
+
+ dmstart= cbyte= *cbyte_io;
+ st= pap_domain(pai, &cbyte, max, &rrp->host,
+ pai->qu->flags & adns_qf_quoteok_anshost ? pdf_quoteok : 0);
+ if (st) return st;
+ *cbyte_io= cbyte;
+
+ rrp->astatus= adns_s_ok;
+ rrp->naddrs= -1;
+ rrp->addrs= 0;
+
+ cbyte= pai->nsstart;
+
+ st= pap_findaddrs(pai, rrp, &cbyte, pai->nscount, dmstart);
+ if (st) return st;
+ if (rrp->naddrs != -1) return adns_s_ok;
+
+ st= pap_findaddrs(pai, rrp, &cbyte, pai->arcount, dmstart);
+ if (st) return st;
+ if (rrp->naddrs != -1) return adns_s_ok;
+
+ st= adns__mkquery_frdgram(pai->ads, &pai->qu->vb, &id,
+ pai->dgram, pai->dglen, dmstart,
+ adns_r_addr, adns_qf_quoteok_query);
+ if (st) return st;
+
+ ctx.ext= 0;
+ ctx.callback= icb_hostaddr;
+ ctx.info.hostaddr= rrp;
+
+ nflags= adns_qf_quoteok_query;
+ if (!(pai->qu->flags & adns_qf_cname_loose)) nflags |= adns_qf_cname_forbid;
+
+ st= adns__internal_submit(pai->ads, &nqu, adns__findtype(adns_r_addr),
+ &pai->qu->vb, id, nflags, pai->now, &ctx);
+ if (st) return st;
+
+ nqu->parent= pai->qu;
+ LIST_LINK_TAIL_PART(pai->qu->children,nqu,siblings.);
+
+ return adns_s_ok;
+}
+
+static adns_status pa_hostaddr(const parseinfo *pai, int cbyte, int max, void *datap) {
+ adns_rr_hostaddr *rrp= datap;
+ adns_status st;
+
+ st= pap_hostaddr(pai, &cbyte, max, rrp);
+ if (st) return st;
+ if (cbyte != max) return adns_s_invaliddata;
+
+ return adns_s_ok;
+}
+
+static int dip_hostaddr(adns_state ads, const adns_rr_hostaddr *ap, const adns_rr_hostaddr *bp) {
+ if (ap->astatus != bp->astatus) return ap->astatus;
+ if (ap->astatus) return 0;
+
+ assert(ap->addrs[0].addr.sa.sa_family == AF_INET);
+ assert(bp->addrs[0].addr.sa.sa_family == AF_INET);
+ return dip_inaddr(ads,
+ ap->addrs[0].addr.inet.sin_addr,
+ bp->addrs[0].addr.inet.sin_addr);
+}
+
+static int di_hostaddr(adns_state ads, const void *datap_a, const void *datap_b) {
+ const adns_rr_hostaddr *ap= datap_a, *bp= datap_b;
+
+ return dip_hostaddr(ads, ap,bp);
+}
+
+static void mfp_hostaddr(adns_query qu, adns_rr_hostaddr *rrp) {
+ void *tablev;
+
+ adns__makefinal_str(qu,&rrp->host);
+ tablev= rrp->addrs;
+ adns__makefinal_block(qu, &tablev, rrp->naddrs*sizeof(*rrp->addrs));
+ rrp->addrs= tablev;
+}
+
+static void mf_hostaddr(adns_query qu, void *datap) {
+ adns_rr_hostaddr *rrp= datap;
+
+ mfp_hostaddr(qu,rrp);
+}
+
+static adns_status csp_hostaddr(vbuf *vb, const adns_rr_hostaddr *rrp) {
+ const char *errstr;
+ adns_status st;
+ char buf[20];
+ int i;
+
+ st= csp_domain(vb,rrp->host); if (st) return st;
+
+ CSP_ADDSTR(" ");
+ CSP_ADDSTR(adns_errtypeabbrev(rrp->astatus));
+
+ sprintf(buf," %d ",rrp->astatus);
+ CSP_ADDSTR(buf);
+
+ CSP_ADDSTR(adns_errabbrev(rrp->astatus));
+ CSP_ADDSTR(" ");
+
+ errstr= adns_strerror(rrp->astatus);
+ st= csp_qstring(vb,errstr,strlen(errstr)); if (st) return st;
+
+ if (rrp->naddrs >= 0) {
+ CSP_ADDSTR(" (");
+ for (i=0; i<rrp->naddrs; i++) {
+ CSP_ADDSTR(" ");
+ st= csp_addr(vb,&rrp->addrs[i]);
+ }
+ CSP_ADDSTR(" )");
+ } else {
+ CSP_ADDSTR(" ?");
+ }
+ return adns_s_ok;
+}
+
+static adns_status cs_hostaddr(vbuf *vb, const void *datap) {
+ const adns_rr_hostaddr *rrp= datap;
+
+ return csp_hostaddr(vb,rrp);
+}
+
+/*
+ * _mx_raw (pa,di)
+ */
+
+static adns_status pa_mx_raw(const parseinfo *pai, int cbyte, int max, void *datap) {
+ const byte *dgram= pai->dgram;
+ adns_rr_intstr *rrp= datap;
+ adns_status st;
+ int pref;
+
+ if (cbyte+2 > max) return adns_s_invaliddata;
+ GET_W(cbyte,pref);
+ rrp->i= pref;
+ st= pap_domain(pai, &cbyte, max, &rrp->str,
+ pai->qu->flags & adns_qf_quoteok_anshost ? pdf_quoteok : 0);
+ if (st) return st;
+
+ if (cbyte != max) return adns_s_invaliddata;
+ return adns_s_ok;
+}
+
+static int di_mx_raw(adns_state ads, const void *datap_a, const void *datap_b) {
+ const adns_rr_intstr *ap= datap_a, *bp= datap_b;
+
+ if (ap->i < bp->i) return 0;
+ if (ap->i > bp->i) return 1;
+ return 0;
+}
+
+/*
+ * _mx (pa,di)
+ */
+
+static adns_status pa_mx(const parseinfo *pai, int cbyte, int max, void *datap) {
+ const byte *dgram= pai->dgram;
+ adns_rr_inthostaddr *rrp= datap;
+ adns_status st;
+ int pref;
+
+ if (cbyte+2 > max) return adns_s_invaliddata;
+ GET_W(cbyte,pref);
+ rrp->i= pref;
+ st= pap_hostaddr(pai, &cbyte, max, &rrp->ha);
+ if (st) return st;
+
+ if (cbyte != max) return adns_s_invaliddata;
+ return adns_s_ok;
+}
+
+static int di_mx(adns_state ads, const void *datap_a, const void *datap_b) {
+ const adns_rr_inthostaddr *ap= datap_a, *bp= datap_b;
+
+ if (ap->i < bp->i) return 0;
+ if (ap->i > bp->i) return 1;
+ return dip_hostaddr(ads, &ap->ha, &bp->ha);
+}
+
+/*
+ * _inthostaddr (mf,cs)
+ */
+
+static void mf_inthostaddr(adns_query qu, void *datap) {
+ adns_rr_inthostaddr *rrp= datap;
+
+ mfp_hostaddr(qu,&rrp->ha);
+}
+
+static adns_status cs_inthostaddr(vbuf *vb, const void *datap) {
+ const adns_rr_inthostaddr *rrp= datap;
+ char buf[10];
+
+ sprintf(buf,"%u ",rrp->i);
+ CSP_ADDSTR(buf);
+
+ return csp_hostaddr(vb,&rrp->ha);
+}
+
+/*
+ * _inthost (cs)
+ */
+
+static adns_status cs_inthost(vbuf *vb, const void *datap) {
+ const adns_rr_intstr *rrp= datap;
+ char buf[10];
+
+ sprintf(buf,"%u ",rrp->i);
+ CSP_ADDSTR(buf);
+ return csp_domain(vb,rrp->str);
+}
+
+/*
+ * _ptr (pa, +icb_ptr)
+ */
+
+static void icb_ptr(adns_query parent, adns_query child) {
+ adns_answer *cans= child->answer;
+ const adns_rr_addr *queried, *found;
+ adns_state ads= parent->ads;
+ int i;
+
+ if (cans->status == adns_s_nxdomain || cans->status == adns_s_nodata) {
+ adns__query_fail(parent,adns_s_inconsistent);
+ return;
+ } else if (cans->status) {
+ adns__query_fail(parent,cans->status);
+ return;
+ }
+
+ queried= &parent->ctx.info.ptr_parent_addr;
+ for (i=0, found=cans->rrs.addr; i<cans->nrrs; i++, found++) {
+ if (queried->len == found->len &&
+ !memcmp(&queried->addr,&found->addr,queried->len)) {
+ if (!parent->children.head) {
+ adns__query_done(parent);
+ return;
+ } else {
+ LIST_LINK_TAIL(ads->childw,parent);
+ return;
+ }
+ }
+ }
+
+ adns__query_fail(parent,adns_s_inconsistent);
+}
+
+static adns_status pa_ptr(const parseinfo *pai, int dmstart, int max, void *datap) {
+ static const char *(expectdomain[])= { DNS_INADDR_ARPA };
+
+ char **rrp= datap;
+ adns_status st;
+ adns_rr_addr *ap;
+ findlabel_state fls;
+ char *ep;
+ byte ipv[4];
+ char labbuf[4];
+ int cbyte, i, lablen, labstart, l, id;
+ adns_query nqu;
+ qcontext ctx;
+
+ cbyte= dmstart;
+ st= pap_domain(pai, &cbyte, max, rrp,
+ pai->qu->flags & adns_qf_quoteok_anshost ? pdf_quoteok : 0);
+ if (st) return st;
+ if (cbyte != max) return adns_s_invaliddata;
+
+ ap= &pai->qu->ctx.info.ptr_parent_addr;
+ if (!ap->len) {
+ adns__findlabel_start(&fls, pai->ads, -1, pai->qu,
+ pai->qu->query_dgram, pai->qu->query_dglen,
+ pai->qu->query_dglen, DNS_HDRSIZE, 0);
+ for (i=0; i<4; i++) {
+ st= adns__findlabel_next(&fls,&lablen,&labstart); assert(!st);
+ if (lablen<=0 || lablen>3) return adns_s_querydomainwrong;
+ memcpy(labbuf, pai->qu->query_dgram + labstart, lablen); labbuf[lablen]= 0;
+ ipv[3-i]= strtoul(labbuf,&ep,10); if (*ep) return adns_s_querydomainwrong;
+ if (lablen>1 && pai->qu->query_dgram[labstart]=='0')
+ return adns_s_querydomainwrong;
+ }
+ for (i=0; i<sizeof(expectdomain)/sizeof(*expectdomain); i++) {
+ st= adns__findlabel_next(&fls,&lablen,&labstart); assert(!st);
+ l= strlen(expectdomain[i]);
+ if (lablen != l || memcmp(pai->qu->query_dgram + labstart, expectdomain[i], l))
+ return adns_s_querydomainwrong;
+ }
+ st= adns__findlabel_next(&fls,&lablen,0); assert(!st);
+ if (lablen) return adns_s_querydomainwrong;
+
+ ap->len= sizeof(struct sockaddr_in);
+ memset(&ap->addr,0,sizeof(ap->addr.inet));
+ ap->addr.inet.sin_family= AF_INET;
+ ap->addr.inet.sin_addr.s_addr=
+ htonl((ipv[0]<<24) | (ipv[1]<<16) | (ipv[2]<<8) | (ipv[3]));
+ }
+
+ st= adns__mkquery_frdgram(pai->ads, &pai->qu->vb, &id,
+ pai->dgram, pai->dglen, dmstart,
+ adns_r_addr, adns_qf_quoteok_query);
+ if (st) return st;
+
+ ctx.ext= 0;
+ ctx.callback= icb_ptr;
+ memset(&ctx.info,0,sizeof(ctx.info));
+ st= adns__internal_submit(pai->ads, &nqu, adns__findtype(adns_r_addr),
+ &pai->qu->vb, id,
+ adns_qf_quoteok_query, pai->now, &ctx);
+ if (st) return st;
+
+ nqu->parent= pai->qu;
+ LIST_LINK_TAIL_PART(pai->qu->children,nqu,siblings.);
+ return adns_s_ok;
+}
+
+/*
+ * _strpair (mf)
+ */
+
+static void mf_strpair(adns_query qu, void *datap) {
+ adns_rr_strpair *rrp= datap;
+
+ adns__makefinal_str(qu,&rrp->array[0]);
+ adns__makefinal_str(qu,&rrp->array[1]);
+}
+
+/*
+ * _intstrpair (mf)
+ */
+
+static void mf_intstrpair(adns_query qu, void *datap) {
+ adns_rr_intstrpair *rrp= datap;
+
+ adns__makefinal_str(qu,&rrp->array[0].str);
+ adns__makefinal_str(qu,&rrp->array[1].str);
+}
+
+/*
+ * _hinfo (pa)
+ */
+
+static adns_status pa_hinfo(const parseinfo *pai, int cbyte, int max, void *datap) {
+ adns_rr_intstrpair *rrp= datap;
+ adns_status st;
+ int i;
+
+ for (i=0; i<2; i++) {
+ st= pap_qstring(pai, &cbyte, max, &rrp->array[i].i, &rrp->array[i].str);
+ if (st) return st;
+ }
+
+ if (cbyte != max) return adns_s_invaliddata;
+
+ return adns_s_ok;
+}
+
+/*
+ * _mailbox (pap,cs)
+ */
+
+static adns_status pap_mailbox822(const parseinfo *pai, int *cbyte_io, int max,
+ char **mb_r) {
+ int lablen, labstart, i, needquote, c, r, neednorm;
+ const unsigned char *p;
+ char *str;
+ findlabel_state fls;
+ adns_status st;
+ vbuf *vb;
+
+ vb= &pai->qu->vb;
+ vb->used= 0;
+ adns__findlabel_start(&fls, pai->ads,
+ -1, pai->qu,
+ pai->dgram, pai->dglen, max,
+ *cbyte_io, cbyte_io);
+ st= adns__findlabel_next(&fls,&lablen,&labstart);
+ if (!lablen) {
+ adns__vbuf_appendstr(vb,".");
+ goto x_ok;
+ }
+
+ neednorm= 1;
+ for (i=0, needquote=0, p= pai->dgram+labstart; i<lablen; i++) {
+ c= *p++;
+ if ((c&~128) < 32 || (c&~128) == 127) return adns_s_invaliddata;
+ if (c == '.' && !neednorm) neednorm= 1;
+ else if (c==' ' || ctype_822special(c)) needquote++;
+ else neednorm= 0;
+ }
+
+ if (needquote || neednorm) {
+ r= adns__vbuf_ensure(vb, lablen+needquote+4); if (!r) R_NOMEM;
+ adns__vbuf_appendq(vb,"\"",1);
+ for (i=0, needquote=0, p= pai->dgram+labstart; i<lablen; i++, p++) {
+ c= *p;
+ if (c == '"' || c=='\\') adns__vbuf_appendq(vb,"\\",1);
+ adns__vbuf_appendq(vb,p,1);
+ }
+ adns__vbuf_appendq(vb,"\"",1);
+ } else {
+ r= adns__vbuf_append(vb, pai->dgram+labstart, lablen); if (!r) R_NOMEM;
+ }
+
+ r= adns__vbuf_appendstr(vb,"@"); if (!r) R_NOMEM;
+
+ st= adns__parse_domain_more(&fls,pai->ads, pai->qu,vb,0, pai->dgram);
+ if (st) return st;
+
+ x_ok:
+ str= adns__alloc_interim(pai->qu, vb->used+1); if (!str) R_NOMEM;
+ memcpy(str,vb->buf,vb->used);
+ str[vb->used]= 0;
+ *mb_r= str;
+ return adns_s_ok;
+}
+
+static adns_status pap_mailbox(const parseinfo *pai, int *cbyte_io, int max,
+ char **mb_r) {
+ if (pai->qu->typei->type & adns__qtf_mail822) {
+ return pap_mailbox822(pai, cbyte_io, max, mb_r);
+ } else {
+ return pap_domain(pai, cbyte_io, max, mb_r, pdf_quoteok);
+ }
+}
+
+static adns_status csp_mailbox(vbuf *vb, const char *mailbox) {
+ return csp_domain(vb,mailbox);
+}
+
+/*
+ * _rp (pa,cs)
+ */
+
+static adns_status pa_rp(const parseinfo *pai, int cbyte, int max, void *datap) {
+ adns_rr_strpair *rrp= datap;
+ adns_status st;
+
+ st= pap_mailbox(pai, &cbyte, max, &rrp->array[0]);
+ if (st) return st;
+
+ st= pap_domain(pai, &cbyte, max, &rrp->array[1], pdf_quoteok);
+ if (st) return st;
+
+ if (cbyte != max) return adns_s_invaliddata;
+ return adns_s_ok;
+}
+
+static adns_status cs_rp(vbuf *vb, const void *datap) {
+ const adns_rr_strpair *rrp= datap;
+ adns_status st;
+
+ st= csp_mailbox(vb,rrp->array[0]); if (st) return st;
+ CSP_ADDSTR(" ");
+ st= csp_domain(vb,rrp->array[1]); if (st) return st;
+
+ return adns_s_ok;
+}
+
+/*
+ * _soa (pa,mf,cs)
+ */
+
+static adns_status pa_soa(const parseinfo *pai, int cbyte, int max, void *datap) {
+ adns_rr_soa *rrp= datap;
+ const byte *dgram= pai->dgram;
+ adns_status st;
+ int msw, lsw, i;
+
+ st= pap_domain(pai, &cbyte, max, &rrp->mname,
+ pai->qu->flags & adns_qf_quoteok_anshost ? pdf_quoteok : 0);
+ if (st) return st;
+
+ st= pap_mailbox(pai, &cbyte, max, &rrp->rname);
+ if (st) return st;
+
+ if (cbyte+20 != max) return adns_s_invaliddata;
+
+ for (i=0; i<5; i++) {
+ GET_W(cbyte,msw);
+ GET_W(cbyte,lsw);
+ (&rrp->serial)[i]= (msw<<16) | lsw;
+ }
+
+ return adns_s_ok;
+}
+
+static void mf_soa(adns_query qu, void *datap) {
+ adns_rr_soa *rrp= datap;
+
+ adns__makefinal_str(qu,&rrp->mname);
+ adns__makefinal_str(qu,&rrp->rname);
+}
+
+static adns_status cs_soa(vbuf *vb, const void *datap) {
+ const adns_rr_soa *rrp= datap;
+ char buf[20];
+ int i;
+ adns_status st;
+
+ st= csp_domain(vb,rrp->mname); if (st) return st;
+ CSP_ADDSTR(" ");
+ st= csp_mailbox(vb,rrp->rname); if (st) return st;
+
+ for (i=0; i<5; i++) {
+ sprintf(buf," %lu",(&rrp->serial)[i]);
+ CSP_ADDSTR(buf);
+ }
+
+ return adns_s_ok;
+}
+
+/*
+ * _flat (mf)
+ */
+
+static void mf_flat(adns_query qu, void *data) { }
+
+/*
+ * Now the table.
+ */
+
+#define TYPESZ_M(member) (sizeof(*((adns_answer*)0)->rrs.member))
+
+#define DEEP_MEMB(memb) TYPESZ_M(memb), mf_##memb, cs_##memb
+#define FLAT_MEMB(memb) TYPESZ_M(memb), mf_flat, cs_##memb
+
+#define DEEP_TYPE(code,rrt,fmt,memb,parser,comparer,printer) \
+ { adns_r_##code, rrt, fmt, TYPESZ_M(memb), mf_##memb, printer, parser, comparer }
+#define FLAT_TYPE(code,rrt,fmt,memb,parser,comparer,printer) \
+ { adns_r_##code, rrt, fmt, TYPESZ_M(memb), mf_flat, printer, parser, comparer }
+
+static const typeinfo typeinfos[] = {
+/* Must be in ascending order of rrtype ! */
+/* mem-mgmt code rrt fmt member parser comparer printer */
+
+FLAT_TYPE(a, "A", 0, inaddr, pa_inaddr, di_inaddr, cs_inaddr ),
+DEEP_TYPE(ns_raw, "NS", "raw", str, pa_host_raw,0, cs_domain ),
+DEEP_TYPE(cname, "CNAME", 0, str, pa_dom_raw, 0, cs_domain ),
+DEEP_TYPE(soa_raw,"SOA", "raw", soa, pa_soa, 0, cs_soa ),
+DEEP_TYPE(ptr_raw,"PTR", "raw", str, pa_host_raw,0, cs_domain ),
+DEEP_TYPE(hinfo, "HINFO", 0, intstrpair, pa_hinfo, 0, cs_hinfo ),
+DEEP_TYPE(mx_raw, "MX", "raw", intstr, pa_mx_raw, di_mx_raw, cs_inthost ),
+DEEP_TYPE(txt, "TXT", 0, manyistr, pa_txt, 0, cs_txt ),
+DEEP_TYPE(rp_raw, "RP", "raw", strpair, pa_rp, 0, cs_rp ),
+
+FLAT_TYPE(addr, "A", "addr", addr, pa_addr, di_addr, cs_addr ),
+DEEP_TYPE(ns, "NS", "+addr", hostaddr, pa_hostaddr,di_hostaddr,cs_hostaddr ),
+DEEP_TYPE(ptr, "PTR","checked",str, pa_ptr, 0, cs_domain ),
+DEEP_TYPE(mx, "MX", "+addr", inthostaddr,pa_mx, di_mx, cs_inthostaddr),
+
+DEEP_TYPE(soa, "SOA","822", soa, pa_soa, 0, cs_soa ),
+DEEP_TYPE(rp, "RP", "822", strpair, pa_rp, 0, cs_rp ),
+};
+
+const typeinfo *adns__findtype(adns_rrtype type) {
+ const typeinfo *begin, *end, *mid;
+
+ begin= typeinfos; end= typeinfos+(sizeof(typeinfos)/sizeof(typeinfo));
+
+ while (begin < end) {
+ mid= begin + ((end-begin)>>1);
+ if (mid->type == type) return mid;
+ if (type > mid->type) begin= mid+1;
+ else end= mid;
+ }
+ return 0;
+}
diff --git a/configure b/configure
new file mode 100755
index 0000000..e7efb38
--- /dev/null
+++ b/configure
@@ -0,0 +1,2706 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+\
+ --with-log-file=FILE Default logfile name"
+ac_help="$ac_help
+\
+ --with-port=PORT Default server port"
+ac_help="$ac_help
+\
+ --with-user=USER Default user to switch to on startup"
+ac_help="$ac_help
+\
+ --with-adns-include=DIR Directory containing adns.h"
+ac_help="$ac_help
+\
+ --with-adns-lib=DIR Directory containing libadns.so"
+ac_help="$ac_help
+\
+ --enable-debug turn on additional debugging code"
+ac_help="$ac_help
+\
+ --enable-socks enable SOCKS support"
+ac_help="$ac_help
+\
+ --enable-xtinyproxy enable the use of the XTinyproxy header"
+ac_help="$ac_help
+\
+ --enable-filter enable filtering of domains/URLs"
+ac_help="$ac_help
+\
+ --with-regex Use the GNU regex libary "
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:586: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:639: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+ fi
+
+ test "$2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+ program_transform_name=
+else
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+ rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:696: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+
+PACKAGE=tinyproxy
+
+VERSION=1.3.2
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:743: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+ ACLOCAL=aclocal
+ echo "$ac_t""found" 1>&6
+else
+ ACLOCAL="$missing_dir/missing aclocal"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:756: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ AUTOCONF=autoconf
+ echo "$ac_t""found" 1>&6
+else
+ AUTOCONF="$missing_dir/missing autoconf"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:769: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake
+ echo "$ac_t""found" 1>&6
+else
+ AUTOMAKE="$missing_dir/missing automake"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:782: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+ AUTOHEADER=autoheader
+ echo "$ac_t""found" 1>&6
+else
+ AUTOHEADER="$missing_dir/missing autoheader"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:795: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+ MAKEINFO=makeinfo
+ echo "$ac_t""found" 1>&6
+else
+ MAKEINFO="$missing_dir/missing makeinfo"
+ echo "$ac_t""missing" 1>&6
+fi
+
+
+
+
+
+
+iCFLAGS="$CFLAGS"
+iLIBS="$LIBS"
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:818: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:848: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:899: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:931: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 942 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:973: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:978: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1006: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:1049: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1103: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 1118 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 1135 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 1152 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:1183: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1188 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1196: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1213 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1231 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1252 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:1263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+for ac_hdr in fcntl.h sys/time.h syslog.h unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1290: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1295 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:1328: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1333 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this. */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this. */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in an arm
+ of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:1382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_const=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+ cat >> confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:1403: checking for size_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1408 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_size_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_size_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+ cat >> confdefs.h <<\EOF
+#define size_t unsigned
+EOF
+
+fi
+
+echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
+echo "configure:1436: checking whether time.h and sys/time.h may both be included" >&5
+if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1441 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+int main() {
+struct tm *tp;
+; return 0; }
+EOF
+if { (eval echo configure:1450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_header_time=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_time=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_time" 1>&6
+if test $ac_cv_header_time = yes; then
+ cat >> confdefs.h <<\EOF
+#define TIME_WITH_SYS_TIME 1
+EOF
+
+fi
+
+echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:1471: checking for inline" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat > conftest.$ac_ext <<EOF
+#line 1478 "configure"
+#include "confdefs.h"
+
+int main() {
+} $ac_kw foo() {
+; return 0; }
+EOF
+if { (eval echo configure:1485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$ac_cv_c_inline" 1>&6
+case "$ac_cv_c_inline" in
+ inline | yes) ;;
+ no) cat >> confdefs.h <<\EOF
+#define inline
+EOF
+ ;;
+ *) cat >> confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
+
+# Check whether --with-log-file or --without-log-file was given.
+if test "${with_log_file+set}" = set; then
+ withval="$with_log_file"
+ \
+ cat >> confdefs.h <<EOF
+#define DEFAULT_LOG "$withval"
+EOF
+
+fi
+
+
+# Check whether --with-port or --without-port was given.
+if test "${with_port+set}" = set; then
+ withval="$with_port"
+ \
+ cat >> confdefs.h <<EOF
+#define DEFAULT_PORT $withval
+EOF
+
+fi
+
+
+# Check whether --with-user or --without-user was given.
+if test "${with_user+set}" = set; then
+ withval="$with_user"
+ \
+ cat >> confdefs.h <<EOF
+#define DEFAULT_USER "$withval"
+EOF
+
+fi
+
+
+# Check whether --with-adns-include or --without-adns-include was given.
+if test "${with_adns_include+set}" = set; then
+ withval="$with_adns_include"
+ \
+ ADNS_INCLUDE=$withval ; CFLAGS="$CFLAGS -I$withval"
+fi
+
+# Check whether --with-adns-lib or --without-adns-lib was given.
+if test "${with_adns_lib+set}" = set; then
+ withval="$with_adns_lib"
+ \
+ CFLAGS="$CFLAGS -L$withval"
+fi
+
+
+ac_safe=`echo "adns.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for adns.h""... $ac_c" 1>&6
+echo "configure:1561: checking for adns.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1566 "configure"
+#include "confdefs.h"
+#include <adns.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+\
+ ac_safe=`echo "$ADNS_INCLUDE/adns.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ADNS_INCLUDE/adns.h""... $ac_c" 1>&6
+echo "configure:1593: checking for $ADNS_INCLUDE/adns.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1598 "configure"
+#include "confdefs.h"
+#include <$ADNS_INCLUDE/adns.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+\
+ { echo "configure: error: You must have ADNS installed" 1>&2; exit 1; }
+fi
+
+fi
+
+echo $ac_n "checking for adns_init in -ladns""... $ac_c" 1>&6
+echo "configure:1629: checking for adns_init in -ladns" >&5
+ac_lib_var=`echo adns'_'adns_init | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ladns $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1637 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char adns_init();
+
+int main() {
+adns_init()
+; return 0; }
+EOF
+if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -ladns"
+else
+ echo "$ac_t""no" 1>&6
+\
+ { echo "configure: error: You must have ADNS installed" 1>&2; exit 1; }
+fi
+
+
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:1672: checking return type of signal handlers" >&5
+if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1677 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int main() {
+int i;
+; return 0; }
+EOF
+if { (eval echo configure:1694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_type_signal=void
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_type_signal=int
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_type_signal" 1>&6
+cat >> confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
+
+
+echo $ac_n "checking for strftime""... $ac_c" 1>&6
+echo "configure:1713: checking for strftime" >&5
+if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1718 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char strftime(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strftime();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_strftime) || defined (__stub___strftime)
+choke me
+#else
+strftime();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_strftime=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_strftime=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRFTIME 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+# strftime is in -lintl on SCO UNIX.
+echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
+echo "configure:1763: checking for strftime in -lintl" >&5
+ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lintl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1771 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strftime();
+
+int main() {
+strftime()
+; return 0; }
+EOF
+if { (eval echo configure:1782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRFTIME 1
+EOF
+
+LIBS="-lintl $LIBS"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+echo $ac_n "checking for vprintf""... $ac_c" 1>&6
+echo "configure:1809: checking for vprintf" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1814 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char vprintf(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char vprintf();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_vprintf) || defined (__stub___vprintf)
+choke me
+#else
+vprintf();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_vprintf=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_vprintf=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_VPRINTF 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test "$ac_cv_func_vprintf" != yes; then
+echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
+echo "configure:1861: checking for _doprnt" >&5
+if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1866 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char _doprnt(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char _doprnt();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub__doprnt) || defined (__stub____doprnt)
+choke me
+#else
+_doprnt();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func__doprnt=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func__doprnt=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_DOPRNT 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+for ac_func in socket select strerror strdup vsyslog vsnprintf
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1916: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1921 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+rm -f conftest*
+
+case "$GCC" in
+ yes)
+ CFLAGS="$CFLAGS -Wall"
+ CFLAGS="$CFLAGS -Wshadow"
+ CFLAGS="$CFLAGS -Wcast-qual"
+ CFLAGS="$CFLAGS -Wcast-align"
+ CFLAGS="$CFLAGS -Wstrict-prototypes"
+ CFLAGS="$CFLAGS -Wmissing-prototypes"
+ CFLAGS="$CFLAGS -Wmissing-declarations"
+ CFLAGS="$CFLAGS -Wredundant-decls"
+ CFLAGS="$CFLAGS -Waggregate-return"
+ CFLAGS="$CFLAGS -Wnested-externs"
+
+ echo $ac_n "checking whether ${CC-cc} -pipe works""... $ac_c" 1>&6
+echo "configure:1985: checking whether ${CC-cc} -pipe works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_pipe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+ if test -z "`${CC-cc} -pipe -c conftest.c 2>&1`" -a -s conftest.o; then
+ ac_cv_prog_cc_pipe=yes
+ else
+ ac_cv_prog_cc_pipe=no
+ fi
+ rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_pipe" 1>&6
+
+ case "$ac_cv_prog_cc_pipe" in
+ yes)
+ CFLAGS="$CFLAGS -pipe"
+ ;;
+ esac
+ ;;
+esac
+
+echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
+echo "configure:2010: checking for gethostname in -lnsl" >&5
+ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lnsl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2018 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostname();
+
+int main() {
+gethostname()
+; return 0; }
+EOF
+if { (eval echo configure:2029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lnsl"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for setsockopt in -lsocket""... $ac_c" 1>&6
+echo "configure:2050: checking for setsockopt in -lsocket" >&5
+ac_lib_var=`echo socket'_'setsockopt | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsocket $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2058 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char setsockopt();
+
+int main() {
+setsockopt()
+; return 0; }
+EOF
+if { (eval echo configure:2069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lsocket"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+echo $ac_n "checking Include debugging code""... $ac_c" 1>&6
+echo "configure:2091: checking Include debugging code" >&5
+# Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+ enableval="$enable_debug"
+ debug_enabled=yes
+else
+ debug_enabled=no
+fi
+
+if test "$debug_enabled" = "no"; then
+ CFLAGS="$CFLAGS -DNDEBUG"
+fi
+echo "$ac_t""$debug_enabled" 1>&6
+
+echo $ac_n "checking Include support for SOCKS""... $ac_c" 1>&6
+echo "configure:2106: checking Include support for SOCKS" >&5
+# Check whether --enable-socks or --disable-socks was given.
+if test "${enable_socks+set}" = set; then
+ enableval="$enable_socks"
+ socks_enabled=yes
+else
+ socks_enabled=no
+fi
+
+if test "$socks_enabled" = "$yes"; then
+ ac_safe=`echo "socks.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for socks.h""... $ac_c" 1>&6
+echo "configure:2118: checking for socks.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2123 "configure"
+#include "confdefs.h"
+#include <socks.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ socks_header="yes"
+else
+ echo "$ac_t""no" 1>&6
+socks_header="no"
+fi
+
+ echo $ac_n "checking for main in -lsocks""... $ac_c" 1>&6
+echo "configure:2151: checking for main in -lsocks" >&5
+ac_lib_var=`echo socks'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsocks $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2159 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ socks_library="yes"
+else
+ echo "$ac_t""no" 1>&6
+socks_library="no"
+fi
+
+ if test "$socks_header" = "yes" && test "$socks_library" = "yes"; then
+ CFLAGS="$CFLAGS -I/usr/include/sock.h -DSOCKS"
+ LIBS="$LIBS -lsocks"
+ else
+ socks_enabled=no
+ fi
+fi
+echo "$ac_t""$socks_enabled" 1>&6
+
+echo $ac_n "checking Include the XTinyproxy header code""... $ac_c" 1>&6
+echo "configure:2197: checking Include the XTinyproxy header code" >&5
+# Check whether --enable-xtinyproxy or --disable-xtinyproxy was given.
+if test "${enable_xtinyproxy+set}" = set; then
+ enableval="$enable_xtinyproxy"
+ xtinyproxy_enabled=yes
+else
+ xtinyproxy_enabled=no
+fi
+
+if test "$xtinyproxy_enabled" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define XTINYPROXY 1
+EOF
+
+fi
+echo "$ac_t""$xtinyproxy_enabled" 1>&6
+
+echo $ac_n "checking Include filtering of domain/URL""... $ac_c" 1>&6
+echo "configure:2215: checking Include filtering of domain/URL" >&5
+# Check whether --enable-filter or --disable-filter was given.
+if test "${enable_filter+set}" = set; then
+ enableval="$enable_filter"
+ filter_enabled=yes
+else
+ filter_enabled=no
+fi
+
+if test "$filter_enabled" = "yes"; then
+ LIBOBJS="$LIBOBJS filter.o"
+ cat >> confdefs.h <<\EOF
+#define FILTER_ENABLE 1
+EOF
+
+fi
+echo "$ac_t""$filter_enabled" 1>&6
+
+# Check whether --with-regex or --without-regex was given.
+if test "${with_regex+set}" = set; then
+ withval="$with_regex"
+ tinyproxy_cv_regex=yes
+else
+ for ac_func in regcomp
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2241: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2246 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ tinyproxy_cv_regex=no
+else
+ echo "$ac_t""no" 1>&6
+tinyproxy_cv_regex=yes
+fi
+done
+
+fi
+
+
+if test $tinyproxy_cv_regex = no ; then
+ echo $ac_n "checking whether your system's regexp library is completely broken""... $ac_c" 1>&6
+echo "configure:2299: checking whether your system's regexp library is completely broken" >&5
+ if test "$cross_compiling" = yes; then
+ tinyproxy_cv_regex_broken=yes
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2304 "configure"
+#include "confdefs.h"
+
+#include <unistd.h>
+#include <regex.h>
+main() { regex_t blah ; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec(&blah, "foobar", 0, NULL, 0); }
+EOF
+if { (eval echo configure:2311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ tinyproxy_cv_regex_broken=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ tinyproxy_cv_regex_broken=yes
+fi
+rm -fr conftest*
+fi
+
+
+ echo "$ac_t""$tinyproxy_cv_regex_broken" 1>&6
+ if test $tinyproxy_cv_regex_broken = yes ; then
+ echo "Using the included GNU regex instead." >&6
+ tinyproxy_cv_regex = yes
+ fi
+fi
+
+if test $tinyproxy_cv_regex = yes ; then
+ cat >> confdefs.h <<\EOF
+#define USE_GNU_REGEX 1
+EOF
+
+ LIBOBJS="$LIBOBJS gnuregex.o"
+fi
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile src/Makefile doc/Makefile src/defines.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@CC@%$CC%g
+s%@CPP@%$CPP%g
+s%@LIBOBJS@%$LIBOBJS%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile src/Makefile doc/Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ case "$ac_given_INSTALL" in
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="src/defines.h"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+test -z "$CONFIG_HEADERS" || echo timestamp > src/stamp-h
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..da98155
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,171 @@
+AC_INIT()
+AM_INIT_AUTOMAKE(tinyproxy,1.3.1e)
+AM_CONFIG_HEADER(src/defines.h)
+
+dnl Grab any initial CFLAGS and LIBS so we can pick better defaults
+iCFLAGS="$CFLAGS"
+iLIBS="$LIBS"
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(fcntl.h sys/time.h syslog.h unistd.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+AC_C_INLINE
+
+dnl chris - allow user to choose log file location, port and username
+AC_ARG_WITH(log-file, \
+ [--with-log-file=FILE Default logfile name], \
+ [AC_DEFINE_UNQUOTED(DEFAULT_LOG, "$withval" )])
+
+AC_ARG_WITH(port, \
+ [--with-port=PORT Default server port], \
+ [AC_DEFINE_UNQUOTED(DEFAULT_PORT, $withval)])
+
+AC_ARG_WITH(user, \
+ [--with-user=USER Default user to switch to on startup], \
+ [AC_DEFINE_UNQUOTED(DEFAULT_USER, "$withval")])
+
+dnl enable arguments for adns lib/include
+dnl there must be a nicer way to do this, but I sure don't know what it is
+AC_ARG_WITH(adns-include, \
+ [--with-adns-include=DIR Directory containing adns.h], \
+ [ADNS_INCLUDE=$withval ; CFLAGS="$CFLAGS -I$withval"])
+AC_ARG_WITH(adns-lib, \
+ [--with-adns-lib=DIR Directory containing libadns.so], \
+ [CFLAGS="$CFLAGS -L$withval"])
+
+dnl check that adns is installed
+AC_CHECK_HEADER(adns.h, [], \
+ AC_CHECK_HEADER($ADNS_INCLUDE/adns.h, [], \
+ [AC_MSG_ERROR(You must have ADNS installed)]))
+AC_CHECK_LIB(adns, adns_init, [LIBS="$LIBS -ladns"],\
+ [AC_MSG_ERROR(You must have ADNS installed)])
+
+dnl Checks for library functions.
+AC_TYPE_SIGNAL
+AC_FUNC_STRFTIME
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(socket select strerror strdup vsyslog vsnprintf)
+
+dnl Add the warnings if we have the GCC compiler
+rm -f conftest*
+
+case "$GCC" in
+ yes)
+ CFLAGS="$CFLAGS -Wall"
+ CFLAGS="$CFLAGS -Wshadow"
+ CFLAGS="$CFLAGS -Wcast-qual"
+ CFLAGS="$CFLAGS -Wcast-align"
+ CFLAGS="$CFLAGS -Wstrict-prototypes"
+ CFLAGS="$CFLAGS -Wmissing-prototypes"
+ CFLAGS="$CFLAGS -Wmissing-declarations"
+ CFLAGS="$CFLAGS -Wredundant-decls"
+dnl CFLAGS="$CFLAGS -Wpointer-arith"
+ CFLAGS="$CFLAGS -Waggregate-return"
+ CFLAGS="$CFLAGS -Wnested-externs"
+
+ AC_CACHE_CHECK(whether ${CC-cc} -pipe works, ac_cv_prog_cc_pipe,
+ [echo 'void f(){}' > conftest.c
+ if test -z "`${CC-cc} -pipe -c conftest.c 2>&1`" -a -s conftest.o; then
+ ac_cv_prog_cc_pipe=yes
+ else
+ ac_cv_prog_cc_pipe=no
+ fi
+ rm -f conftest*
+ ])
+
+ case "$ac_cv_prog_cc_pipe" in
+ yes)
+ CFLAGS="$CFLAGS -pipe"
+ ;;
+ esac
+ ;;
+esac
+
+AC_CHECK_LIB(nsl, gethostname, [LIBS="$LIBS -lnsl"])
+AC_CHECK_LIB(socket, setsockopt, [LIBS="$LIBS -lsocket"])
+
+dnl Check to see if the debuging code is turned on
+AC_MSG_CHECKING(Include debugging code)
+AC_ARG_ENABLE(debug, \
+ [--enable-debug turn on additional debugging code],
+ [debug_enabled=yes], [debug_enabled=no])
+if test "$debug_enabled" = "no"; then
+ CFLAGS="$CFLAGS -DNDEBUG"
+fi
+AC_MSG_RESULT($debug_enabled)
+
+AC_MSG_CHECKING(Include support for SOCKS)
+AC_ARG_ENABLE(socks, \
+ [--enable-socks enable SOCKS support],
+ [socks_enabled=yes], [socks_enabled=no])
+if test "$socks_enabled" = "$yes"; then
+ AC_CHECK_HEADER(socks.h, [socks_header="yes"], [socks_header="no"])
+ AC_CHECK_LIB(socks, main, [socks_library="yes"], [socks_library="no"])
+ if test "$socks_header" = "yes" && test "$socks_library" = "yes"; then
+ CFLAGS="$CFLAGS -I/usr/include/sock.h -DSOCKS"
+ LIBS="$LIBS -lsocks"
+ else
+ socks_enabled=no
+ fi
+fi
+AC_MSG_RESULT($socks_enabled)
+
+AC_MSG_CHECKING(Include the XTinyproxy header code)
+AC_ARG_ENABLE(xtinyproxy, \
+ [--enable-xtinyproxy enable the use of the XTinyproxy header],
+ [xtinyproxy_enabled=yes], [xtinyproxy_enabled=no])
+if test "$xtinyproxy_enabled" = "yes"; then
+ AC_DEFINE(XTINYPROXY)
+fi
+AC_MSG_RESULT($xtinyproxy_enabled)
+
+AC_MSG_CHECKING(Include filtering of domain/URL)
+AC_ARG_ENABLE(filter, \
+ [--enable-filter enable filtering of domains/URLs],
+ [filter_enabled=yes], [filter_enabled=no])
+if test "$filter_enabled" = "yes"; then
+ LIBOBJS="$LIBOBJS filter.o"
+ AC_DEFINE(FILTER_ENABLE)
+fi
+AC_MSG_RESULT($filter_enabled)
+
+dnl Check for the regex library
+AC_ARG_WITH(regex, \
+ [--with-regex Use the GNU regex libary ],
+ [tinyproxy_cv_regex=yes],
+ [AC_CHECK_FUNCS(regcomp, tinyproxy_cv_regex=no, tinyproxy_cv_regex=yes)])
+
+if test $tinyproxy_cv_regex = no ; then
+ AC_MSG_CHECKING(whether your system's regexp library is completely broken)
+ AC_TRY_RUN([
+#include <unistd.h>
+#include <regex.h>
+main() { regex_t blah ; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec(&blah, "foobar", 0, NULL, 0); }],
+ tinyproxy_cv_regex_broken=no, tinyproxy_cv_regex_broken=yes, tinyproxy_cv_regex_broken=yes)
+
+ AC_MSG_RESULT([$tinyproxy_cv_regex_broken])
+ if test $tinyproxy_cv_regex_broken = yes ; then
+ echo "Using the included GNU regex instead." >&AC_FD_MSG
+ tinyproxy_cv_regex = yes
+ fi
+fi
+
+if test $tinyproxy_cv_regex = yes ; then
+ AC_DEFINE(USE_GNU_REGEX)
+ LIBOBJS="$LIBOBJS gnuregex.o"
+fi
+
+AC_SUBST(CFLAGS)dnl
+AC_SUBST(LIBS)dnl
+AC_SUBST(LIBOBJS)dnl
+
+AC_OUTPUT(Makefile src/Makefile doc/Makefile)
diff --git a/doc/CONFIG b/doc/CONFIG
new file mode 100644
index 0000000..910bc36
--- /dev/null
+++ b/doc/CONFIG
@@ -0,0 +1,11 @@
+ListenPort port number
+ListenAddress IP Address
+User user name
+LogFile name of log file (location as well)
+LoadLimit load limit
+StatHost URL of stat host
+AllowSubnet n.n.n.n/n ... (or n.n.n.* or *.domain.com)
+AllowHeader header ... (or head*)
+SendXTinyproxy yes/no
+
+* rewrite URL request (i.e. www.virtual1.com to www.domain.com/virtual1)
diff --git a/doc/HTTP_ERROR_CODES b/doc/HTTP_ERROR_CODES
new file mode 100644
index 0000000..b7fb0cd
--- /dev/null
+++ b/doc/HTTP_ERROR_CODES
@@ -0,0 +1,61 @@
+The following is a list of the response codes for the various states of
+the server. Currently I would recommend we stick to the HTTP/1.0 return
+codes for our errors. Once we start to support the distinction between
+HTTP/1.0 and HTTP/1.1 requests from the client, then we can use the
+HTTP/1.1 responses.
+ -- rjkaes
+
+[ Taken from Apache: The Definitive Guide by Ben Laurie & Peter Laurie.
+ Published by O'Reilly & Associates, Inc. pg. 146-147 ]
+
+HTTP/1.0
+200 OK
+302 Found
+304 Not Modified
+400 Bad Request
+401 Unauthorized
+403 Forbidden
+404 Not Found
+500 Server error
+501 Not Implemented
+502 Bad Gateway
+503 Out of resources
+
+HTTP/1.1
+100 Continue
+101 Switching Protocols
+200 Ok
+201 Created
+202 Accepted
+203 Non-Authoritative Information
+204 No Content
+205 Reset Content
+206 Partial Content
+300 Multiple Choices
+301 Moved Permanently
+302 Moved Temporarily
+303 See Other
+304 Not Modified
+305 Use Proxy
+400 Bad Request
+401 Unauthorized
+402 Payment Required
+403 Forbidden
+404 Not Found
+405 Method Not Allowed
+406 Not Acceptable
+407 Proxy Authentication Required
+408 Request Time-out
+409 Conflict
+410 Gone
+411 Length Required
+412 Precondition Failed
+413 Request Entity Too Large
+414 Request-URI Too Large
+415 Unsupported Media Type
+500 Internal Server Error
+501 Not Implemented
+502 Bad Gateway
+503 Service Unavailable
+504 Gateway Time-out
+505 HTTP Version not supported
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..bc3c786
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,2 @@
+EXTRA_DIST = tinyproxy.8 CONFIG HTTP_ERROR_CODES RFC_INFO TODO report.sh
+man_MANS = tinyproxy.8
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644
index 0000000..6119e98
--- /dev/null
+++ b/doc/Makefile.in
@@ -0,0 +1,216 @@
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+EXTRA_DIST = tinyproxy.8 CONFIG HTTP_ERROR_CODES RFC_INFO TODO report.sh
+man_MANS = tinyproxy.8
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../src/defines.h
+CONFIG_CLEAN_FILES =
+man8dir = $(mandir)/man8
+MANS = $(man_MANS)
+
+NROFF = nroff
+DIST_COMMON = Makefile.am Makefile.in TODO
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+install-man8:
+ $(mkinstalldirs) $(DESTDIR)$(man8dir)
+ @list='$(man8_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.8*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \
+ done
+
+uninstall-man8:
+ @list='$(man8_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.8*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \
+ rm -f $(DESTDIR)$(man8dir)/$$inst; \
+ done
+install-man: $(MANS)
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-man8
+uninstall-man:
+ @$(NORMAL_UNINSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) uninstall-man8
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = doc
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am: install-man
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-man
+uninstall: uninstall-am
+all-am: Makefile $(MANS)
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(mandir)/man8
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: install-man8 uninstall-man8 install-man uninstall-man tags \
+distdir info-am info dvi-am dvi check check-am installcheck-am \
+installcheck install-exec-am install-exec install-data-am install-data \
+install-am install uninstall-am uninstall all-redirect all-am all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/RFC_INFO b/doc/RFC_INFO
new file mode 100644
index 0000000..081d2d0
--- /dev/null
+++ b/doc/RFC_INFO
@@ -0,0 +1,23 @@
+INFO
+----
+The following files were/are useful for the proper coding of
+tinyproxy. Please note: someday tinyproxy will actually be RFC
+compliant, but today is not that day. Right now tinyproxy is pretty
+close to being HTTP/1.0 compliant, but there are probably a few
+incompatibilities kicking around.
+
+RFCs
+----
+1945 Hypertext Transfer Protocol -- HTTP/1.0
+2396 Uniform Resource Identifiers (URI): Generic Syntax
+2616 Hypertext Transfer Protocol -- HTTP/1.1
+2617 HTTP Authentication: Basic and Digest Access Authentication
+
+POSSIBLE LOCATION
+-----------------
+There are many places to obtain a copy of the RFCs, but I use
+
+ http://www.rfc-editor.org/
+
+since it provides a great search feature for finding all the RFCs for
+a particular topic.
diff --git a/doc/TODO b/doc/TODO
new file mode 100644
index 0000000..257a1d3
--- /dev/null
+++ b/doc/TODO
@@ -0,0 +1,27 @@
+The following are some features that I'd like to add to tinyproxy in the
+future. Where possible, I've listed the person who suggested it. This
+list is in no particular order. And hey, if you want to implement one of
+these, or another idea you have, go right ahead. Just mail me the diff
+against the current tree and I'll integrate it if possible.
+
+ - Include hooks so other types of proxies can be modularly added to
+ the source tree. Then people can simply choose which types of
+ proxies (ftp, www, etc) they'd like enabled in tinyproxy.h
+ Suggested: Tarun Tuli.
+ - Make the source tree autoconf-ed so people can avoid editing
+ tinyproxy.h and the like.
+ - Add some kind of access control mechanism - probably IP-based,
+ so users can choose only to let people from certain networks/ISP
+ use the proxy. This becomes more of an issue with FTP proxies
+ and the like. (Partially Done. It would be better if there was a
+ config file.)
+ - Find a more elegant solution to embedding HTML documents in the
+ source than the current method. (see httperr() and showstats() for
+ examples of how it's done right now).
+ - Include a function to rewrite the incoming requests. Should not be
+ much of a problem. Just need to modify the clientreq code to look up
+ the URL and rewrite it. If we want to go really fancy with RegEx
+ mapping this could get ugly. :)
+ - Ed Avis suggests having tinyproxy have the ability to send the data
+ from the connections through an external filtering program. I kind of
+ like this idea, but I don't really have a good way of doing it yet.
diff --git a/doc/report.sh b/doc/report.sh
new file mode 100755
index 0000000..2e6b4ee
--- /dev/null
+++ b/doc/report.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+(echo "date: "
+date
+echo "uname: "
+uname -a
+echo "ps: "
+ps -auxw | grep [t]inyproxy -
+echo "ver: "
+if [ -x /usr/local/bin/tinyproxy ]; then
+ /usr/local/bin/tinyproxy -v
+else
+ echo no ver available.
+fi;) 2>&1 | mail -s 'tinyproxy install report' sdyoung@well.com
diff --git a/doc/tinyproxy.8 b/doc/tinyproxy.8
new file mode 100644
index 0000000..bcf11d4
--- /dev/null
+++ b/doc/tinyproxy.8
@@ -0,0 +1,121 @@
+.\" -*- nroff -*-
+.\"
+.\" tinyproxy.1
+.\"
+.\" Copyright (c) 1999, Robert James Kaes, Steven Young.
+.\"
+.\" This program is distributed under the terms of the GNU General Public
+.\" License. See COPYING for additional information.
+.\"
+.TH tinyproxy 1 "December 23, 1999" "tinyproxy" "tinyproxy Manual"
+.SH NAME
+tinyproxy \- a small HTTP proxy server
+.SH SYNOPSIS
+tinyproxy [options]
+.SH DESCRIPTION
+.B tinyproxy
+is an HTTP proxy server designed to consume a minimum of system resources.
+It listens on a given TCP port and handles HTTP proxy requests.
+.SH OPTIONS
+.TP 5
+.B \-v
+Display version information and exit.
+.TP 5
+.B \-h
+Display a short help screen of command line arguments and exit.
+.TP 5
+.B \-d
+Don't daemonize; stay in the foreground.
+.TP 5
+.B "\-n ip_address"
+Allow access from only those hosts in the subnet.
+.I ip_address
+should be of a form xxx.xxx.xxx. like 192.168.0.
+.TP 5
+.BI "\-i ip_address"
+Only listen to the specific address. Useful for systems with more than one
+network connection.
+.I ip_address
+needs to be in the dotted-decimal form (e.g. 192.168.0.1)
+.TP 5
+.BI "\-p port"
+Listen to
+.I port
+instead of the default as defined in config.h.
+.TP 5
+.BI "\-l logfile"
+Log to the file
+.I logfile
+instead of the default as defined in config.h.
+.TP 5
+.BI \-r
+Restrict the log file to only logging error conditions. The hosts connecting
+and the locations being accessed are not logged.
+.TP 5
+.B \-S
+Log to the syslog daemon
+.TP 5
+.BI "\-a headername"
+Allow the header
+.I headername
+through to the server (anon mode only). It is highly recommended that you
+specify -a Host: and -a Authorization:, otherwise HTTP/1.1 virtual domains
+and basic authentication will fail. If anon mode is compiled into the
+program, but you do not provide a
+.I headername
+tinyproxy will run as if anon mode was not compiled in.
+.TP 5
+.BI "\-w loadaverage"
+Stop handling requests when the load is
+.I loadaverage
+or higher. Specifying a
+.I loadaverage
+of 0.00 will disable this feature.
+(disabled by default)
+.TP 5
+.BI "\-u username"
+Begin running as
+.I username
+after the port has been bound and the logfile has been opened. Only
+works if tinyproxy is being run as root. "" to disable.
+.SH SIGNALS
+In addition to these command line options, there are also several signals
+that can be sent to tinyproxy while it is running to generate debugging
+information and to force certain events.
+.TP 5
+.B SIGUSR1
+Dump a summary of all current connections to the logfile.
+.TP 5
+.B SIGHUP
+Force
+.B tinyproxy
+to do a garbage collection on the current connections linked list. This
+is usually done automatically after a certain number of connections have
+been handled.
+.SH FILES
+.SM /var/log/tinyproxy.log
+.SH AUTHORS
+Steven Young (sdyoung@well.com)
+.PP
+Robert James Kaes (rjkaes@flarenet.com)
+.SH BUGS
+For some reason, when sent SIGTERM,
+.B tinyproxy
+occasionally waits for the
+next incoming connection before exiting. We believe this bug has
+been corrected, but please e-mail the authors if you see this
+behaviour occurring.
+.SH COPYRIGHT
+.B tinyproxy
+is distributed under the GNU Public License (GPL). For more information
+on the GPL, please see the file COPYING which should have been included in
+the archive with tinyproxy. Failing that, http://www.fsf.org/ will
+doubtless have a copy up for you to peruse. Please don't use this
+software if you don't agree to the terms specified therein.
+.SH AVAILABILITY
+The latest version of
+.B tinyproxy
+can be acquired from:
+.PP
+http://www.flarenet.com/tinyproxy/
+http://tinyproxy.attacca.com/
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..e9de238
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/missing b/missing
new file mode 100755
index 0000000..7789652
--- /dev/null
+++ b/missing
@@ -0,0 +1,190 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+case "$1" in
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing - GNU libit 0.0"
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+ aclocal)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acinclude.m4' or \`configure.in'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`configure.in'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acconfig.h' or \`configure.in'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ fi
+ touch $file
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequirements for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 0000000..e9981d1
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,40 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id: mkinstalldirs,v 1.1.1.1 2000-02-16 17:32:17 sdyoung Exp $
+
+errstatus=0
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
diff --git a/reconf b/reconf
new file mode 100755
index 0000000..3976e3e
--- /dev/null
+++ b/reconf
@@ -0,0 +1,11 @@
+#!/bin/sh
+rm -f config.cache
+echo "- aclocal."
+aclocal
+echo "- autoconf."
+autoconf
+echo "- autoheader."
+autoheader
+echo "- automake."
+automake -a
+exit
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..63ffb6b
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,19 @@
+bin_PROGRAMS = tinyproxy
+tinyproxy_SOURCES = config.h \
+ buffer.c buffer.h \
+ conns.c conns.h \
+ dnscache.c dnscache.h \
+ log.c log.h \
+ reqs.c reqs.h \
+ sock.c sock.h \
+ tinyproxy.c tinyproxy.h \
+ uri.c uri.h \
+ utils.c utils.h \
+ regexp.h
+
+tinyproxy_LDADD = @LIBOBJS@
+
+EXTRA_DIST = gnuregex.c gnuregex.h \
+ filter.c filter.h
+
+LDADD = @LIBOBJS
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..0bc6f5c
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,340 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+CC = @CC@
+CFLAGS = @CFLAGS@ -I. -DHAVE_CONFIG_H
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+bin_PROGRAMS = tinyproxy
+tinyproxy_SOURCES = config.h buffer.c buffer.h conns.c conns.h dnscache.c dnscache.h log.c log.h reqs.c reqs.h sock.c sock.h tinyproxy.c tinyproxy.h uri.c uri.h utils.c utils.h regexp.h
+
+
+tinyproxy_LDADD = @LIBOBJS@
+
+EXTRA_DIST = gnuregex.c gnuregex.h filter.c filter.h
+
+
+LDADD = @LIBOBJS
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = defines.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(bin_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I.
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+tinyproxy_OBJECTS = buffer.o conns.o dnscache.o log.o reqs.o sock.o \
+tinyproxy.o uri.o utils.o
+tinyproxy_DEPENDENCIES = @LIBOBJS@
+tinyproxy_LDFLAGS =
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = ./stamp-h.in Makefile.am Makefile.in defines.h.in \
+filter.c gnuregex.c
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+DEP_FILES = .deps/buffer.P .deps/conns.P .deps/dnscache.P \
+.deps/filter.P .deps/gnuregex.P .deps/log.P .deps/reqs.P .deps/sock.P \
+.deps/tinyproxy.P .deps/uri.P .deps/utils.P
+SOURCES = $(tinyproxy_SOURCES)
+OBJECTS = $(tinyproxy_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .o .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+defines.h: stamp-h
+ @if test ! -f $@; then \
+ rm -f stamp-h; \
+ $(MAKE) stamp-h; \
+ else :; fi
+stamp-h: $(srcdir)/defines.h.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=src/defines.h \
+ $(SHELL) ./config.status
+ @echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/defines.h.in: $(srcdir)/stamp-h.in
+ @if test ! -f $@; then \
+ rm -f $(srcdir)/stamp-h.in; \
+ $(MAKE) $(srcdir)/stamp-h.in; \
+ else :; fi
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f defines.h
+
+maintainer-clean-hdr:
+
+mostlyclean-binPROGRAMS:
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+distclean-binPROGRAMS:
+
+maintainer-clean-binPROGRAMS:
+
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ list='$(bin_PROGRAMS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+tinyproxy: $(tinyproxy_OBJECTS) $(tinyproxy_DEPENDENCIES)
+ @rm -f tinyproxy
+ $(LINK) $(tinyproxy_LDFLAGS) $(tinyproxy_OBJECTS) $(tinyproxy_LDADD) $(LIBS)
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) defines.h.in $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)defines.h.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags defines.h.in $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = src
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu doc/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+buffer.o: buffer.c defines.h utils.h conns.h tinyproxy.h config.h log.h \
+ buffer.h
+conns.o: conns.c defines.h config.h log.h utils.h conns.h tinyproxy.h \
+ buffer.h dnscache.h
+dnscache.o: dnscache.c defines.h utils.h conns.h tinyproxy.h config.h \
+ dnscache.h
+log.o: log.c defines.h tinyproxy.h config.h log.h
+reqs.o: reqs.c defines.h config.h tinyproxy.h sock.h buffer.h utils.h \
+ conns.h log.h reqs.h filter.h uri.h regexp.h
+sock.o: sock.c defines.h tinyproxy.h config.h sock.h buffer.h log.h \
+ utils.h conns.h dnscache.h
+tinyproxy.o: tinyproxy.c defines.h config.h tinyproxy.h utils.h conns.h \
+ log.h sock.h buffer.h reqs.h filter.h
+uri.o: uri.c defines.h uri.h utils.h conns.h tinyproxy.h config.h log.h \
+ regexp.h
+utils.o: utils.c defines.h config.h tinyproxy.h utils.h conns.h log.h \
+ buffer.h
+
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+all-recursive-am: defines.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+install-exec-am: install-binPROGRAMS
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-binPROGRAMS
+uninstall: uninstall-am
+all-am: Makefile $(PROGRAMS) defines.h
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \
+ mostlyclean-compile mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \
+ clean-depend clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
+ maintainer-clean-compile maintainer-clean-tags \
+ maintainer-clean-depend maintainer-clean-generic \
+ distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/buffer.c b/src/buffer.c
new file mode 100644
index 0000000..8e76e26
--- /dev/null
+++ b/src/buffer.c
@@ -0,0 +1,308 @@
+/* $Id: buffer.c,v 1.1.1.1 2000-02-16 17:32:22 sdyoung Exp $
+ *
+ * The buffer used in each connection is a linked list of lines. As the lines
+ * are read in and written out the buffer expands and contracts. Basically,
+ * by using this method we can increase the buffer size dynamicly. However,
+ * we have a hard limit of 64 KB for the size of the buffer. The buffer can be
+ * thought of as a queue were we act on both the head and tail. The various
+ * functions act on each end (the names are taken from what Perl uses to act on
+ * the ends of an array. :)
+ *
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <assert.h>
+
+#include "utils.h"
+#include "log.h"
+#include "tinyproxy.h"
+#include "buffer.h"
+
+/*
+ * Take a string of data and a length and make a new line which can be added
+ * to the buffer
+ */
+static struct bufline_s *makenewline(unsigned char *data, unsigned int length)
+{
+ struct bufline_s *newline;
+
+ assert(data);
+ assert(length > 0);
+
+ if (!(newline = xmalloc(sizeof(struct bufline_s))))
+ return NULL;
+
+ newline->string = data;
+ newline->next = NULL;
+ newline->length = length;
+ newline->pos = 0;
+
+ return newline;
+}
+
+/*
+ * Create a new buffer
+ */
+struct buffer_s *new_buffer(void)
+{
+ struct buffer_s *buffptr;
+
+ if (!(buffptr = xmalloc(sizeof(struct buffer_s))))
+ return NULL;
+
+ buffptr->head = buffptr->tail = NULL;
+ buffptr->size = 0;
+
+ return buffptr;
+}
+
+/*
+ * Delete all the lines in the buffer and the buffer itself
+ */
+void delete_buffer(struct buffer_s *buffptr)
+{
+ struct bufline_s *next;
+
+ assert(buffptr);
+
+ while (buffer_head(buffptr)) {
+ next = buffer_head(buffptr)->next;
+ free_line(buffer_head(buffptr));
+ buffer_head(buffptr) = next;
+ }
+ buffer_head(buffptr) = NULL;
+ buffer_tail(buffptr) = NULL;
+
+ safefree(buffptr);
+}
+
+/*
+ * Free the allocated buffer line
+ */
+void free_line(struct bufline_s *line)
+{
+ if (!line)
+ return;
+
+ if (line->string) {
+ safefree(line->string);
+ }
+
+ safefree(line);
+}
+
+/*
+ * Push a new line on to the end of the buffer
+ */
+struct bufline_s *push_buffer(struct buffer_s *buffptr, unsigned char *data,
+ unsigned int length)
+{
+ struct bufline_s *newline;
+
+ assert(buffptr);
+ assert(data);
+ assert(length > 0);
+
+ if (!(newline = makenewline(data, length)))
+ return NULL;
+
+ if (!buffer_head(buffptr) && !buffer_tail(buffptr))
+ buffer_head(buffptr) = buffer_tail(buffptr) = newline;
+ else
+ buffer_tail(buffptr) = (buffer_tail(buffptr)->next = newline);
+
+ buffptr->size += length;
+
+ return newline;
+}
+
+/*
+ * Pop a buffer line off the end of the buffer
+ */
+struct bufline_s *pop_buffer(struct buffer_s *buffptr)
+{
+ struct bufline_s *line, *newend;
+
+ assert(buffptr);
+
+ if (buffer_head(buffptr) == buffer_tail(buffptr)) {
+ line = buffer_head(buffptr);
+ buffer_head(buffptr) = buffer_tail(buffptr) = NULL;
+ buffptr->size = 0;
+ return line;
+ }
+
+ line = buffer_tail(buffptr);
+ newend = buffer_head(buffptr);
+
+ while (newend->next != line && newend->next)
+ newend = newend->next;
+
+ buffer_tail(buffptr) = newend;
+ buffptr->size -= line->length;
+
+ return line;
+}
+
+/*
+ * Unshift a buffer line from the top of the buffer (meaning add a new line
+ * to the top of the buffer)
+ */
+struct bufline_s *unshift_buffer(struct buffer_s *buffptr, unsigned char *data,
+ unsigned int length)
+{
+ struct bufline_s *newline;
+
+ assert(buffptr);
+ assert(data);
+ assert(length > 0);
+
+ if (!(newline = makenewline(data, length)))
+ return NULL;
+
+ if (!buffer_head(buffptr) && buffer_tail(buffptr)) {
+ buffer_head(buffptr) = buffer_tail(buffptr) = newline;
+ } else {
+ newline->next = buffer_head(buffptr);
+ buffer_head(buffptr) = newline;
+ if (!buffer_tail(buffptr))
+ buffer_tail(buffptr) = newline;
+ }
+
+ buffptr->size += length;
+
+ return newline;
+}
+
+/*
+ * Shift a line off the top of the buffer (remove the line from the top of
+ * the buffer)
+ */
+struct bufline_s *shift_buffer(struct buffer_s *buffptr)
+{
+ struct bufline_s *line;
+
+ assert(buffptr);
+
+ if (!buffer_head(buffptr) && !buffer_tail(buffptr)) {
+ line = buffer_head(buffptr);
+ buffer_head(buffptr) = buffer_tail(buffptr) = NULL;
+ buffptr->size = 0;
+ return line;
+ }
+
+ line = buffer_head(buffptr);
+ buffer_head(buffptr) = line->next;
+
+ if (!buffer_head(buffptr))
+ buffer_tail(buffptr) = NULL;
+
+ buffptr->size -= line->length;
+
+ return line;
+}
+
+/*
+ * Reads the bytes from the socket, and adds them to the buffer.
+ * Takes a connection and returns the number of bytes read.
+ */
+int readbuff(int fd, struct buffer_s *buffptr)
+{
+ int bytesin;
+ unsigned char inbuf[BUFFER];
+ unsigned char *buffer;
+
+ assert(fd >= 0);
+ assert(buffptr);
+
+ bytesin = recv(fd, inbuf, BUFFER, 0);
+
+ if (bytesin > 0) {
+ if (!(buffer = xmalloc(bytesin)))
+ return 0;
+
+ memcpy(buffer, inbuf, bytesin);
+ push_buffer(buffptr, buffer, bytesin);
+ return bytesin;
+ } else if (bytesin == 0) {
+ /* connection was closed by client */
+ return -1;
+ } else {
+ switch (errno) {
+#ifdef EWOULDBLOCK
+ case EWOULDBLOCK:
+#else
+# ifdef EAGAIN
+ case EAGAIN:
+# endif
+#endif
+ case EINTR:
+ return 0;
+ case ECONNRESET:
+ return -1;
+ default:
+ log("ERROR readbuff: recv (%s)", strerror(errno));
+ return -1;
+ }
+ }
+}
+
+/*
+ * Write the bytes in the buffer to the socket.
+ * Takes a connection and returns the number of bytes written.
+ */
+int writebuff(int fd, struct buffer_s *buffptr)
+{
+ int bytessent;
+ struct bufline_s *line = buffer_head(buffptr);
+
+ assert(fd >= 0);
+ assert(buffptr);
+
+ bytessent = send(fd, line->string + line->pos,
+ (size_t) (line->length - line->pos), 0);
+
+ if (bytessent >= 0) {
+ /* bytes sent, adjust buffer */
+ line->pos += bytessent;
+ if (line->pos == line->length)
+ free_line(shift_buffer(buffptr));
+ return bytessent;
+ } else {
+ switch (errno) {
+#ifdef EWOULDBLOCK
+ case EWOULDBLOCK:
+#else
+# ifdef EAGAIN
+ case EAGAIN:
+# endif
+#endif
+ case ENOBUFS:
+ case EINTR:
+ case ENOMEM:
+ return 0;
+ default:
+ log("ERROR writebuff: send (%s)", strerror(errno));
+ return -1;
+ }
+ }
+}
diff --git a/src/buffer.h b/src/buffer.h
new file mode 100644
index 0000000..a1ee86c
--- /dev/null
+++ b/src/buffer.h
@@ -0,0 +1,62 @@
+/* $Id: buffer.h,v 1.1.1.1 2000-02-16 17:32:22 sdyoung Exp $
+ *
+ * See 'buffer.c' for a detailed description.
+ *
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef __BUFFER_H_
+#define __BUFFER_H_ 1
+
+#define MAXBUFFSIZE 20480
+
+struct bufline_s {
+ unsigned char *string; /* the actual string of data */
+ struct bufline_s *next; /* pointer to next in linked list */
+ unsigned int length; /* length of the string of data */
+ unsigned int pos; /* start sending from this offset */
+};
+
+struct buffer_s {
+ struct bufline_s *head; /* top of the buffer */
+ struct bufline_s *tail; /* bottom of the buffer */
+ unsigned long int size; /* total size of the buffer */
+};
+
+#define buffer_head(x) (((struct buffer_s *)(x))->head)
+#define buffer_tail(x) (((struct buffer_s *)(x))->tail)
+#define buffer_size(x) (((struct buffer_s *)(x))->size)
+
+/* Create and delete buffers */
+extern struct buffer_s *new_buffer(void);
+extern void delete_buffer(struct buffer_s *buffptr);
+
+/* Operate on the end of the list */
+extern struct bufline_s *push_buffer(struct buffer_s *buffptr,
+ unsigned char *data, unsigned int length);
+extern struct bufline_s *pop_buffer(struct buffer_s *buffptr);
+
+/* Operate on the head of the list */
+extern struct bufline_s *unshift_buffer(struct buffer_s *buffptr,
+ unsigned char *data,
+ unsigned int length);
+extern struct bufline_s *shift_buffer(struct buffer_s *buffptr);
+
+/* Free a buffer line */
+extern void free_line(struct bufline_s *line);
+
+/* Read/Write the buffer to a socket */
+extern int readbuff(int fd, struct buffer_s *buffptr);
+extern int writebuff(int fd, struct buffer_s *buffptr);
+
+#endif /* __BUFFER_H_ */
diff --git a/src/config.h b/src/config.h
new file mode 100644
index 0000000..f5f7dda
--- /dev/null
+++ b/src/config.h
@@ -0,0 +1,101 @@
+/* $Id: config.h,v 1.1.1.1 2000-02-16 17:32:22 sdyoung Exp $
+ *
+ * Contains all the tune-able variables which are used by tinyproxy.
+ * Modifications made to these variables WILL change the default behaviour
+ * of tinyproxy. Please read the comments to better understand what each
+ * variable does.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef _CONFIG_H_
+#define _CONFIG_H_ 1
+
+/* Change these if you want */
+
+/* Default log file */
+#ifndef DEFAULT_LOG
+#define DEFAULT_LOG "/usr/local/var/log/tinyproxy.log"
+#endif
+
+/* Default port tinyproxy listens on */
+#ifndef DEFAULT_PORT
+#define DEFAULT_PORT 8080
+#endif
+
+/* Default user to change to after */
+#ifndef DEFAULT_USER
+#define DEFAULT_USER "nobody"
+#endif
+
+/*
+ * Define this if you want to have all requests sent to a particular machine.
+ * This is useful if you have another proxy further upstream which you must
+ * send your HTTP requests through.
+ */
+#undef UPSTREAM
+
+#ifdef UPSTREAM
+#define UPSTREAM_PROXY_NAME "name.of.upstream.machine"
+#define UPSTREAM_PROXY_PORT 80
+#endif
+
+/*
+ * Define this if you want tinyproxy to use /proc/loadavg to determine
+ * system load (Linux only, I think)
+ */
+#define USE_PROC
+
+#ifndef USE_PROC
+/*
+ * Path to uptime to determin system load. This path doesn't have to be
+ * valid if DEFAULT_CUTOFFLOAD is 0
+ */
+#define UPTIME_PATH "/usr/bin/uptime"
+#endif /* !USE_PROC */
+
+/*
+ * The default load at which tinyproxy will start refusing connections.
+ * 0 == disabled by default
+ */
+#define DEFAULT_CUTOFFLOAD 0
+
+/*
+ * NOTE: for DEFAULT_STATHOST: this controls remote proxy stats display.
+ * for example, the default DEFAULT_STATHOST of "tinyproxy.stats" will
+ * mean that when you use the proxy to access http://tinyproxy.stats/",
+ * you will be shown the proxy stats. Set this to something obscure
+ * if you don't want random people to be able to see them, or set it to
+ * "" to disable. In the future, I figure maybe some sort of auth
+ * might be desirable, but that would involve a major simplicity
+ * sacrifice.
+ */
+
+/* The "hostname" for getting tinyproxy stats. "" = disabled by default */
+#define DEFAULT_STATHOST "tinyproxy.stats"
+
+/*
+ * NOTE: change these if you know what you're doing
+ */
+#define SOCK_TIMEOUT 5
+/* Recalculate load avery 30 seconds */
+#define LOAD_RECALCTIMER 30
+/* Default HTTP port */
+#define HTTP_PORT 80
+/* Every time conncoll is called, nuke connections idle for > 60 seconds */
+#define STALECONN_TIME (60 * 15)
+/* Every 100 times through run the garbage collection */
+#define GARBCOLL_INTERVAL 10
+
+#endif
diff --git a/src/conns.c b/src/conns.c
new file mode 100644
index 0000000..a96067f
--- /dev/null
+++ b/src/conns.c
@@ -0,0 +1,187 @@
+/* $Id: conns.c,v 1.1.1.1 2000-02-16 17:32:22 sdyoung Exp $
+ *
+ * These functions handle the various stages a connection will go through in
+ * the course of its life in tinyproxy. New connections are initialized and
+ * added to the linked list of active connections. As these connections are
+ * completed, they are closed, and the a garbage collection process removes
+ * them from the list.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <stdio.h>
+#include <time.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sysexits.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <errno.h>
+#include <assert.h>
+
+#include <adns.h>
+
+extern adns_state adns;
+
+#include "config.h"
+#include "log.h"
+#include "utils.h"
+#include "conns.h"
+#include "buffer.h"
+#include "dnscache.h"
+
+struct conn_s *connections = NULL;
+
+/*
+ * Add a new connection to the linked list
+ */
+struct conn_s *new_conn(int fd)
+{
+ struct conn_s **rpConnptr = &connections;
+ struct conn_s *connptr = connections;
+ struct conn_s *newconn;
+
+ assert(fd >= 0);
+
+ while (connptr) {
+ rpConnptr = &connptr->next;
+ connptr = connptr->next;
+ }
+
+ if (!(newconn = xmalloc(sizeof(struct conn_s)))) {
+ log("ERROR new_conn: could not allocate memory for conn");
+ return NULL;
+ }
+
+ /* Allocate the new buffer */
+ newconn->cbuffer = NULL;
+ newconn->sbuffer = NULL;
+ if (!(newconn->cbuffer = new_buffer())
+ || !(newconn->sbuffer = new_buffer())) {
+ log("ERROR new_conn: could not allocate memory for buffer");
+ safefree(newconn->cbuffer);
+ safefree(newconn->sbuffer);
+
+ newconn->next = NULL;
+ safefree(newconn);
+ return NULL;
+ }
+
+ newconn->client_fd = fd;
+ newconn->server_fd = -1;
+ newconn->type = NEWCONN;
+ newconn->inittime = newconn->actiontime = time(NULL);
+
+ newconn->clientheader = newconn->serverheader = FALSE;
+ newconn->simple_req = FALSE;
+
+ *rpConnptr = newconn;
+ newconn->next = connptr;
+
+ stats.num_cons++;
+
+ return newconn;
+}
+
+/*
+ * Delete a connection from the linked list
+ */
+int del_conn(struct conn_s *delconn)
+{
+ struct conn_s **rpConnptr = &connections;
+ struct conn_s *connptr = connections;
+
+ assert(delconn);
+
+ if (delconn->cbuffer) {
+ delete_buffer(delconn->cbuffer);
+ delconn->cbuffer = NULL;
+ }
+ if (delconn->sbuffer) {
+ delete_buffer(delconn->sbuffer);
+ delconn->sbuffer = NULL;
+ }
+
+ close(delconn->client_fd);
+ close(delconn->server_fd);
+
+ while (connptr && (connptr != delconn)) {
+ rpConnptr = &connptr->next;
+ connptr = connptr->next;
+ }
+
+ if (connptr == delconn) {
+ *rpConnptr = delconn->next;
+ safefree(delconn);
+ }
+
+ return 0;
+}
+
+/*
+ * Check for connections that have been idle too long
+ */
+void conncoll(void)
+{
+ struct conn_s *connptr = connections;
+
+ while (connptr) {
+ if (
+ (difftime(time(NULL), connptr->actiontime) >
+ STALECONN_TIME) && connptr->type != FINISHCONN) {
+ connptr->type = FINISHCONN;
+ stats.num_idles++;
+ }
+ connptr = connptr->next;
+ }
+}
+
+/*
+ * Actually remove all entries in the linked list that have been marked for
+ * deletion.
+ */
+void garbcoll(void)
+{
+ struct conn_s *connptr = connections;
+ struct conn_s *tmp;
+
+ static unsigned int dnscount = 0;
+
+#ifdef __DEBUG__
+ log("Garbage collecting (%lu)", stats.num_garbage);
+#endif
+
+ stats.num_garbage++;
+
+ while (connptr) {
+ tmp = connptr->next;
+ if (connptr->type == FINISHCONN) {
+#ifdef __DEBUG__
+ log("Deleting connection: %p", connptr);
+#endif
+ del_conn(connptr);
+ }
+ connptr = tmp;
+ }
+
+ if (dnscount++ > DNS_GARBAGE_COL) {
+ dnscount = 0;
+ dnsclean();
+ }
+}
diff --git a/src/conns.h b/src/conns.h
new file mode 100644
index 0000000..05cfdb5
--- /dev/null
+++ b/src/conns.h
@@ -0,0 +1,59 @@
+/* $Id: conns.h,v 1.1.1.1 2000-02-16 17:32:22 sdyoung Exp $
+ *
+ * See 'conns.c' for a detailed description.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef _CONN_H_
+#define _CONN_H_ 1
+
+#include "tinyproxy.h"
+
+#include <adns.h>
+
+/* Different connection types */
+enum conn_type {
+ NEWCONN,
+ WAITCONN,
+ DNS_WAITCONN,
+ RELAYCONN,
+ CLOSINGCONN,
+ FINISHCONN
+};
+
+struct conn_s {
+ struct conn_s *next;
+ int client_fd, server_fd;
+ enum conn_type type;
+ struct buffer_s *cbuffer;
+ struct buffer_s *sbuffer;
+ time_t inittime, actiontime;
+ flag clientheader, serverheader;
+ flag simple_req;
+
+ adns_query adns_qu;
+ char *domain;
+ int port_no;
+};
+
+extern struct conn_s *connections;
+
+/* Handle the creation and deletion of connections */
+extern struct conn_s *new_conn(int fd);
+extern int del_conn(struct conn_s *connptr);
+extern void conncoll(void);
+extern void garbcoll(void);
+
+#endif
diff --git a/src/defines.h.in b/src/defines.h.in
new file mode 100644
index 0000000..b7202fe
--- /dev/null
+++ b/src/defines.h.in
@@ -0,0 +1,89 @@
+/* src/defines.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define if you don't have vprintf but do have _doprnt. */
+#undef HAVE_DOPRNT
+
+/* Define if you have the strftime function. */
+#undef HAVE_STRFTIME
+
+/* Define if you have the vprintf function. */
+#undef HAVE_VPRINTF
+
+/* Define as __inline if that's what the C compiler calls it. */
+#undef inline
+
+/* Define as the return type of signal handlers (int or void). */
+#undef RETSIGTYPE
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/*
+ * Define if you want to have the peer's IP address to be included in a
+ * XTinyproxy header sent to the server.
+ */
+#undef XTINYPROXY
+
+/* chris - undef'd here so that they can be set up in the configure script */
+#undef DEFAULT_LOG
+#undef DEFAULT_PORT
+#undef DEFAULT_USER
+
+/*
+ * Define if you would like to include filtering code.
+ */
+#undef FILTER_ENABLE
+
+/*
+ * Define if you want to use the included GNU regex routine
+ */
+#undef USE_GNU_REGEX
+
+/* Define if you have the regcomp function. */
+#undef HAVE_REGCOMP
+
+/* Define if you have the select function. */
+#undef HAVE_SELECT
+
+/* Define if you have the socket function. */
+#undef HAVE_SOCKET
+
+/* Define if you have the strdup function. */
+#undef HAVE_STRDUP
+
+/* Define if you have the strerror function. */
+#undef HAVE_STRERROR
+
+/* Define if you have the vsnprintf function. */
+#undef HAVE_VSNPRINTF
+
+/* Define if you have the vsyslog function. */
+#undef HAVE_VSYSLOG
+
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define if you have the <syslog.h> header file. */
+#undef HAVE_SYSLOG_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
diff --git a/src/dnscache.c b/src/dnscache.c
new file mode 100644
index 0000000..ecd7cee
--- /dev/null
+++ b/src/dnscache.c
@@ -0,0 +1,198 @@
+/* $Id: dnscache.c,v 1.1.1.1 2000-02-16 17:32:22 sdyoung Exp $
+ *
+ * This is a caching DNS system. When a host name is needed we look it up here
+ * and see if there is already an answer for it. The domains are placed in a
+ * hashed linked list. If the name is not here, then we need to look it up and
+ * add it to the system. This really speeds up the connection to servers since
+ * the DNS name does not need to be looked up each time. It's kind of cool. :)
+ *
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ * Copyright (C) 2000 Chris Lightfoot (chris@ex-parrot.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <netdb.h>
+#include <time.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "utils.h"
+#include "dnscache.h"
+
+#define HASH_BOX 25
+#define DNSEXPIRE (5 * 60)
+
+struct dnscache_s {
+ struct in_addr ipaddr;
+ char *domain;
+ time_t expire;
+ struct dnscache_s *next;
+};
+
+struct dnscache_s *cache[HASH_BOX];
+
+static unsigned int hash(unsigned char *keystr, unsigned int box)
+{
+ unsigned long hashc = 0;
+ unsigned char ch;
+
+ assert(keystr);
+ assert(box > 0);
+
+ while ((ch = *keystr++))
+ hashc += tolower(ch);
+
+ return hashc % box;
+}
+
+int lookup(struct in_addr *addr, char *domain)
+{
+ unsigned int box = hash(domain, HASH_BOX);
+ struct dnscache_s **rptr = &cache[box];
+ struct dnscache_s *ptr = cache[box];
+
+ assert(addr);
+ assert(domain);
+
+ while (ptr && strcasecmp(ptr->domain, domain)) {
+ rptr = &ptr->next;
+ ptr = ptr->next;
+ }
+
+ if (ptr && !strcasecmp(ptr->domain, domain)) {
+ /* Woohoo... found it. Make sure it hasn't expired */
+ if (difftime(time(NULL), ptr->expire) > DNSEXPIRE) {
+ /* Oops... expired */
+ *rptr = ptr->next;
+ safefree(ptr->domain);
+ safefree(ptr);
+ return -1;
+ }
+
+ /* chris - added this so that the routine can be used to just
+ * look stuff up.
+ */
+ if (addr) *addr = ptr->ipaddr;
+ return 0;
+ }
+
+ return -1;
+}
+
+int insert(struct in_addr *addr, char *domain)
+{
+ unsigned int box = hash(domain, HASH_BOX);
+ struct dnscache_s **rptr = &cache[box];
+ struct dnscache_s *ptr = cache[box];
+ struct dnscache_s *newptr;
+
+ assert(addr);
+ assert(domain);
+
+ while (ptr) {
+ rptr = &ptr->next;
+ ptr = ptr->next;
+ }
+
+ if (!(newptr = xmalloc(sizeof(struct dnscache_s)))) {
+ return -1;
+ }
+
+ if (!(newptr->domain = xstrdup(domain))) {
+ safefree(newptr);
+ return -1;
+ }
+
+ newptr->ipaddr = *addr;
+
+ newptr->expire = time(NULL);
+
+ *rptr = newptr;
+ newptr->next = ptr;
+
+ return 0;
+}
+
+int dnscache(struct in_addr *addr, char *domain)
+{
+ struct hostent *resolv;
+
+ assert(addr);
+ assert(domain);
+
+ if (inet_aton(domain, (struct in_addr *) addr) != 0)
+ return 0;
+
+ /* Well, we're not dotted-decimal so we need to look it up */
+ if (lookup(addr, domain) == 0)
+ return 0;
+
+ /* Okay, so not in the list... need to actually look it up. */
+ if (!(resolv = gethostbyname(domain)))
+ return -1;
+
+ memcpy(addr, resolv->h_addr_list[0], resolv->h_length);
+ insert(addr, domain);
+
+ return 0;
+}
+
+static void dnsdelete(unsigned int c, struct dnscache_s *del)
+{
+ struct dnscache_s **rptr;
+ struct dnscache_s *ptr;
+
+ assert(c > 0);
+ assert(del);
+
+ rptr = &cache[c];
+ ptr = cache[c];
+
+ while (ptr && (ptr != del)) {
+ rptr = &ptr->next;
+ ptr = ptr->next;
+ }
+
+ if (ptr == del) {
+ *rptr = ptr->next;
+ safefree(ptr->domain);
+ safefree(ptr);
+ }
+}
+
+void dnsclean(void)
+{
+ unsigned int c;
+ struct dnscache_s *ptr, *tmp;
+
+ for (c = 0; c < HASH_BOX; c++) {
+ ptr = cache[c];
+
+ while (ptr) {
+ tmp = ptr->next;
+
+ if (difftime(time(NULL), ptr->expire) > DNSEXPIRE)
+ dnsdelete(c, ptr);
+
+ ptr = tmp;
+ }
+ }
+}
diff --git a/src/dnscache.h b/src/dnscache.h
new file mode 100644
index 0000000..ecb3cd6
--- /dev/null
+++ b/src/dnscache.h
@@ -0,0 +1,38 @@
+/* $Id: dnscache.h,v 1.1.1.1 2000-02-16 17:32:22 sdyoung Exp $
+ *
+ * See 'dnscache.c' for a detailed description.
+ *
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef _DNSCACHE_H_
+#define _DNSCACHE_H_ 1
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#define DNS_GARBAGE_COL 100
+
+extern int dnscache(struct in_addr *addr, char *domain);
+extern void dnsclean(void);
+
+/* chris - Access these from reqs.c because of ADNS. Ugly. */
+extern int lookup(struct in_addr *addr, char *domain);
+extern int insert(struct in_addr *addr, char *domain);
+
+#endif
diff --git a/src/filter.c b/src/filter.c
new file mode 100644
index 0000000..4571b8a
--- /dev/null
+++ b/src/filter.c
@@ -0,0 +1,150 @@
+/* $Id: filter.c,v 1.1.1.1 2000-02-16 17:32:18 sdyoung Exp $
+ *
+ * Copyright (c) 1999 George Talusan (gstalusan@uwaterloo.ca)
+ *
+ * A substring of the domain to be filtered goes into the file
+ * pointed at by DEFAULT_FILTER.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <assert.h>
+
+#include "config.h"
+#include "utils.h"
+#include "tinyproxy.h"
+#include "filter.h"
+
+#include "regexp.h"
+#include <sysexits.h>
+
+static int err;
+
+struct filter_list {
+ struct filter_list *next;
+ char *pat;
+ regex_t *cpat;
+};
+
+
+static struct filter_list *fl = NULL;
+static int already_init = 0;
+
+/* initializes a linked list of strings containing hosts to be filtered */
+void filter_init(void)
+{
+ FILE *fd;
+ struct filter_list *p;
+ char buf[255];
+ char *s;
+
+ if (!fl && !already_init) {
+ fd = fopen(config.filter, "r");
+ if (fd) {
+ p = NULL;
+
+ while (fgets(buf, 255, (FILE *) fd)) {
+ s = buf;
+ if (!p) /* head of list */
+ fl = p = (struct filter_list *)
+ xmalloc(sizeof
+ (struct filter_list));
+ else { /* next entry */
+ p->next = (struct filter_list *)
+ xmalloc(sizeof
+ (struct filter_list));
+ p = p->next;
+ }
+ /* initialize space to zero */
+ memset(p, 0, sizeof(struct filter_list));
+
+ /* replace first whitespace with \0 */
+ while (*s++)
+ if (isspace((int) *s))
+ *s = '\0';
+
+ p->pat = xstrdup(buf);
+ p->cpat = xmalloc(sizeof(regex_t));
+ if (
+ (err =
+ regcomp(p->cpat, p->pat,
+ REG_NEWLINE | REG_NOSUB)) != 0) {
+ fprintf(stderr,
+ "Bad regex in %s: %s\n",
+ config.filter, p->pat);
+ exit(EX_DATAERR);
+ }
+ }
+ already_init = 1;
+ fclose(fd);
+ }
+ }
+}
+
+/* unlink the list */
+void filter_destroy(void)
+{
+ struct filter_list *p, *q;
+
+ if (already_init) {
+ for (p = q = fl; p; p = q) {
+ regfree(p->cpat);
+ safefree(p->cpat);
+ safefree(p->pat);
+ q = p->next;
+ safefree(p);
+ }
+ fl = NULL;
+ already_init = 0;
+ }
+}
+
+/* returns 0 if host is not an element of filter list, non-zero otherwise */
+int filter_host(char *host)
+{
+ struct filter_list *p;
+ char *s, *port;
+ int result;
+
+ assert(host);
+
+ if (!fl || !already_init)
+ return (0);
+
+ /* strip off the port number */
+ s = xstrdup(host);
+ port = strchr(s, ':');
+ if (port)
+ *port = '\0';
+
+ result = 0;
+
+ for (p = fl; p; p = p->next) {
+ result = !regexec(p->cpat, s, (size_t) 0, (regmatch_t *) 0, 0);
+
+ if (result)
+ break;
+ }
+ safefree(s);
+ return (result);
+}
diff --git a/src/filter.h b/src/filter.h
new file mode 100644
index 0000000..fb08f2f
--- /dev/null
+++ b/src/filter.h
@@ -0,0 +1,25 @@
+/* $Id: filter.h,v 1.1.1.1 2000-02-16 17:32:24 sdyoung Exp $
+ *
+ * See 'filter.c' for a detailed description.
+ *
+ * Copyright (c) 1999 George Talusan (gstalusan@uwaterloo.ca)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef __FILTER_H_
+#define __FILTER_H_ 1
+
+extern void filter_init(void);
+extern void filter_destroy(void);
+extern int filter_host(char *host);
+
+#endif
diff --git a/src/gnuregex.c b/src/gnuregex.c
new file mode 100644
index 0000000..785d419
--- /dev/null
+++ b/src/gnuregex.c
@@ -0,0 +1,5880 @@
+/* Extended regular expression matching and search library,
+ version 0.12.
+ (Implements POSIX draft P1003.2/D11.2, except for some of the
+ internationalization features.)
+ Copyright (C) 1993, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* AIX requires this to be the first thing in the file. */
+#if defined _AIX && !defined REGEX_MALLOC
+ #pragma alloca
+#endif
+
+#undef _GNU_SOURCE
+#define _GNU_SOURCE
+
+#ifdef HAVE_CONFIG_H
+# include <defines.h> /* Tinyproxy uses defines.h for autoconf defs */
+#endif
+
+#ifndef PARAMS
+# if defined __GNUC__ || (defined __STDC__ && __STDC__)
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif /* GCC. */
+#endif /* Not PARAMS. */
+
+#if defined STDC_HEADERS && !defined emacs
+# include <stddef.h>
+#else
+/* We need this for `regex.h', and perhaps for the Emacs include files. */
+# include <sys/types.h>
+#endif
+
+#define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
+
+/* For platform which support the ISO C amendement 1 functionality we
+ support user defined character classes. */
+#if defined _LIBC || WIDE_CHAR_SUPPORT
+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
+# include <wchar.h>
+# include <wctype.h>
+#endif
+
+#ifdef _LIBC
+/* We have to keep the namespace clean. */
+# define regfree(preg) __regfree (preg)
+# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
+# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
+# define regerror(errcode, preg, errbuf, errbuf_size) \
+ __regerror(errcode, preg, errbuf, errbuf_size)
+# define re_set_registers(bu, re, nu, st, en) \
+ __re_set_registers (bu, re, nu, st, en)
+# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
+ __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
+# define re_match(bufp, string, size, pos, regs) \
+ __re_match (bufp, string, size, pos, regs)
+# define re_search(bufp, string, size, startpos, range, regs) \
+ __re_search (bufp, string, size, startpos, range, regs)
+# define re_compile_pattern(pattern, length, bufp) \
+ __re_compile_pattern (pattern, length, bufp)
+# define re_set_syntax(syntax) __re_set_syntax (syntax)
+# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
+ __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
+# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
+
+#define btowc __btowc
+#endif
+
+/* This is for other GNU distributions with internationalized messages. */
+#if HAVE_LIBINTL_H || defined _LIBC
+# include <libintl.h>
+#else
+# define gettext(msgid) (msgid)
+#endif
+
+#ifndef gettext_noop
+/* This define is so xgettext can find the internationalizable
+ strings. */
+# define gettext_noop(String) String
+#endif
+
+/* The `emacs' switch turns on certain matching commands
+ that make sense only in Emacs. */
+#ifdef emacs
+
+# include "lisp.h"
+# include "buffer.h"
+# include "syntax.h"
+
+#else /* not emacs */
+
+/* If we are not linking with Emacs proper,
+ we can't use the relocating allocator
+ even if config.h says that we can. */
+# undef REL_ALLOC
+
+# if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+# else
+char *malloc ();
+char *realloc ();
+# endif
+
+/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
+ If nothing else has been done, use the method below. */
+# ifdef INHIBIT_STRING_HEADER
+# if !(defined HAVE_BZERO && defined HAVE_BCOPY)
+# if !defined bzero && !defined bcopy
+# undef INHIBIT_STRING_HEADER
+# endif
+# endif
+# endif
+
+/* This is the normal way of making sure we have a bcopy and a bzero.
+ This is used in most programs--a few other programs avoid this
+ by defining INHIBIT_STRING_HEADER. */
+# ifndef INHIBIT_STRING_HEADER
+# if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC
+# include <string.h>
+# ifndef bzero
+# ifndef _LIBC
+# define bzero(s, n) (memset (s, '\0', n), (s))
+# else
+# define bzero(s, n) __bzero (s, n)
+# endif
+# endif
+# else
+# include <strings.h>
+# ifndef memcmp
+# define memcmp(s1, s2, n) bcmp (s1, s2, n)
+# endif
+# ifndef memcpy
+# define memcpy(d, s, n) (bcopy (s, d, n), (d))
+# endif
+# endif
+# endif
+
+/* Define the syntax stuff for \<, \>, etc. */
+
+/* This must be nonzero for the wordchar and notwordchar pattern
+ commands in re_match_2. */
+# ifndef Sword
+# define Sword 1
+# endif
+
+# ifdef SWITCH_ENUM_BUG
+# define SWITCH_ENUM_CAST(x) ((int)(x))
+# else
+# define SWITCH_ENUM_CAST(x) (x)
+# endif
+
+/* How many characters in the character set. */
+# define CHAR_SET_SIZE 256
+
+# ifdef SYNTAX_TABLE
+
+extern char *re_syntax_table;
+
+# else /* not SYNTAX_TABLE */
+
+static char re_syntax_table[CHAR_SET_SIZE];
+
+static void
+init_syntax_once ()
+{
+ register int c;
+ static int done;
+
+ if (done)
+ return;
+
+ bzero (re_syntax_table, sizeof re_syntax_table);
+
+ for (c = 'a'; c <= 'z'; c++)
+ re_syntax_table[c] = Sword;
+
+ for (c = 'A'; c <= 'Z'; c++)
+ re_syntax_table[c] = Sword;
+
+ for (c = '0'; c <= '9'; c++)
+ re_syntax_table[c] = Sword;
+
+ re_syntax_table['_'] = Sword;
+
+ done = 1;
+}
+
+# endif /* not SYNTAX_TABLE */
+
+# define SYNTAX(c) re_syntax_table[c]
+
+#endif /* not emacs */
+
+/* Get the interface, including the syntax bits. */
+#include "gnuregex.h"
+
+/* isalpha etc. are used for the character classes. */
+#include <ctype.h>
+
+/* Jim Meyering writes:
+
+ "... Some ctype macros are valid only for character codes that
+ isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
+ using /bin/cc or gcc but without giving an ansi option). So, all
+ ctype uses should be through macros like ISPRINT... If
+ STDC_HEADERS is defined, then autoconf has verified that the ctype
+ macros don't need to be guarded with references to isascii. ...
+ Defining isascii to 1 should let any compiler worth its salt
+ eliminate the && through constant folding."
+ Solaris defines some of these symbols so we must undefine them first. */
+
+#undef ISASCII
+#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
+# define ISASCII(c) 1
+#else
+# define ISASCII(c) isascii(c)
+#endif
+
+#ifdef isblank
+# define ISBLANK(c) (ISASCII (c) && isblank (c))
+#else
+# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
+#endif
+#ifdef isgraph
+# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
+#else
+# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
+#endif
+
+#undef ISPRINT
+#define ISPRINT(c) (ISASCII (c) && isprint (c))
+#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
+#define ISALNUM(c) (ISASCII (c) && isalnum (c))
+#define ISALPHA(c) (ISASCII (c) && isalpha (c))
+#define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
+#define ISLOWER(c) (ISASCII (c) && islower (c))
+#define ISPUNCT(c) (ISASCII (c) && ispunct (c))
+#define ISSPACE(c) (ISASCII (c) && isspace (c))
+#define ISUPPER(c) (ISASCII (c) && isupper (c))
+#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
+
+#ifdef _tolower
+# define TOLOWER(c) _tolower(c)
+#else
+# define TOLOWER(c) tolower(c)
+#endif
+
+#ifndef NULL
+# define NULL (void *)0
+#endif
+
+/* We remove any previous definition of `SIGN_EXTEND_CHAR',
+ since ours (we hope) works properly with all combinations of
+ machines, compilers, `char' and `unsigned char' argument types.
+ (Per Bothner suggested the basic approach.) */
+#undef SIGN_EXTEND_CHAR
+#if __STDC__
+# define SIGN_EXTEND_CHAR(c) ((signed char) (c))
+#else /* not __STDC__ */
+/* As in Harbison and Steele. */
+# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
+#endif
+
+/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
+ use `alloca' instead of `malloc'. This is because using malloc in
+ re_search* or re_match* could cause memory leaks when C-g is used in
+ Emacs; also, malloc is slower and causes storage fragmentation. On
+ the other hand, malloc is more portable, and easier to debug.
+
+ Because we sometimes use alloca, some routines have to be macros,
+ not functions -- `alloca'-allocated space disappears at the end of the
+ function it is called in. */
+
+#ifdef REGEX_MALLOC
+
+# define REGEX_ALLOCATE malloc
+# define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
+# define REGEX_FREE free
+
+#else /* not REGEX_MALLOC */
+
+/* Emacs already defines alloca, sometimes. */
+# ifndef alloca
+
+/* Make alloca work the best possible way. */
+# ifdef __GNUC__
+# define alloca __builtin_alloca
+# else /* not __GNUC__ */
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# endif /* HAVE_ALLOCA_H */
+# endif /* not __GNUC__ */
+
+# endif /* not alloca */
+
+# define REGEX_ALLOCATE alloca
+
+/* Assumes a `char *destination' variable. */
+# define REGEX_REALLOCATE(source, osize, nsize) \
+ (destination = (char *) alloca (nsize), \
+ memcpy (destination, source, osize))
+
+/* No need to do anything to free, after alloca. */
+# define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */
+
+#endif /* not REGEX_MALLOC */
+
+/* Define how to allocate the failure stack. */
+
+#if defined REL_ALLOC && defined REGEX_MALLOC
+
+# define REGEX_ALLOCATE_STACK(size) \
+ r_alloc (&failure_stack_ptr, (size))
+# define REGEX_REALLOCATE_STACK(source, osize, nsize) \
+ r_re_alloc (&failure_stack_ptr, (nsize))
+# define REGEX_FREE_STACK(ptr) \
+ r_alloc_free (&failure_stack_ptr)
+
+#else /* not using relocating allocator */
+
+# ifdef REGEX_MALLOC
+
+# define REGEX_ALLOCATE_STACK malloc
+# define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize)
+# define REGEX_FREE_STACK free
+
+# else /* not REGEX_MALLOC */
+
+# define REGEX_ALLOCATE_STACK alloca
+
+# define REGEX_REALLOCATE_STACK(source, osize, nsize) \
+ REGEX_REALLOCATE (source, osize, nsize)
+/* No need to explicitly free anything. */
+# define REGEX_FREE_STACK(arg)
+
+# endif /* not REGEX_MALLOC */
+#endif /* not using relocating allocator */
+
+
+/* True if `size1' is non-NULL and PTR is pointing anywhere inside
+ `string1' or just past its end. This works if PTR is NULL, which is
+ a good thing. */
+#define FIRST_STRING_P(ptr) \
+ (size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
+
+/* (Re)Allocate N items of type T using malloc, or fail. */
+#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t)))
+#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
+#define RETALLOC_IF(addr, n, t) \
+ if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t)
+#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
+
+#define BYTEWIDTH 8 /* In bits. */
+
+#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
+
+#undef MAX
+#undef MIN
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+
+typedef char boolean;
+#define false 0
+#define true 1
+
+static int re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
+ const char *string1, int size1,
+ const char *string2, int size2,
+ int pos,
+ struct re_registers *regs,
+ int stop));
+
+/* These are the command codes that appear in compiled regular
+ expressions. Some opcodes are followed by argument bytes. A
+ command code can specify any interpretation whatsoever for its
+ arguments. Zero bytes may appear in the compiled regular expression. */
+
+typedef enum
+{
+ no_op = 0,
+
+ /* Succeed right away--no more backtracking. */
+ succeed,
+
+ /* Followed by one byte giving n, then by n literal bytes. */
+ exactn,
+
+ /* Matches any (more or less) character. */
+ anychar,
+
+ /* Matches any one char belonging to specified set. First
+ following byte is number of bitmap bytes. Then come bytes
+ for a bitmap saying which chars are in. Bits in each byte
+ are ordered low-bit-first. A character is in the set if its
+ bit is 1. A character too large to have a bit in the map is
+ automatically not in the set. */
+ charset,
+
+ /* Same parameters as charset, but match any character that is
+ not one of those specified. */
+ charset_not,
+
+ /* Start remembering the text that is matched, for storing in a
+ register. Followed by one byte with the register number, in
+ the range 0 to one less than the pattern buffer's re_nsub
+ field. Then followed by one byte with the number of groups
+ inner to this one. (This last has to be part of the
+ start_memory only because we need it in the on_failure_jump
+ of re_match_2.) */
+ start_memory,
+
+ /* Stop remembering the text that is matched and store it in a
+ memory register. Followed by one byte with the register
+ number, in the range 0 to one less than `re_nsub' in the
+ pattern buffer, and one byte with the number of inner groups,
+ just like `start_memory'. (We need the number of inner
+ groups here because we don't have any easy way of finding the
+ corresponding start_memory when we're at a stop_memory.) */
+ stop_memory,
+
+ /* Match a duplicate of something remembered. Followed by one
+ byte containing the register number. */
+ duplicate,
+
+ /* Fail unless at beginning of line. */
+ begline,
+
+ /* Fail unless at end of line. */
+ endline,
+
+ /* Succeeds if at beginning of buffer (if emacs) or at beginning
+ of string to be matched (if not). */
+ begbuf,
+
+ /* Analogously, for end of buffer/string. */
+ endbuf,
+
+ /* Followed by two byte relative address to which to jump. */
+ jump,
+
+ /* Same as jump, but marks the end of an alternative. */
+ jump_past_alt,
+
+ /* Followed by two-byte relative address of place to resume at
+ in case of failure. */
+ on_failure_jump,
+
+ /* Like on_failure_jump, but pushes a placeholder instead of the
+ current string position when executed. */
+ on_failure_keep_string_jump,
+
+ /* Throw away latest failure point and then jump to following
+ two-byte relative address. */
+ pop_failure_jump,
+
+ /* Change to pop_failure_jump if know won't have to backtrack to
+ match; otherwise change to jump. This is used to jump
+ back to the beginning of a repeat. If what follows this jump
+ clearly won't match what the repeat does, such that we can be
+ sure that there is no use backtracking out of repetitions
+ already matched, then we change it to a pop_failure_jump.
+ Followed by two-byte address. */
+ maybe_pop_jump,
+
+ /* Jump to following two-byte address, and push a dummy failure
+ point. This failure point will be thrown away if an attempt
+ is made to use it for a failure. A `+' construct makes this
+ before the first repeat. Also used as an intermediary kind
+ of jump when compiling an alternative. */
+ dummy_failure_jump,
+
+ /* Push a dummy failure point and continue. Used at the end of
+ alternatives. */
+ push_dummy_failure,
+
+ /* Followed by two-byte relative address and two-byte number n.
+ After matching N times, jump to the address upon failure. */
+ succeed_n,
+
+ /* Followed by two-byte relative address, and two-byte number n.
+ Jump to the address N times, then fail. */
+ jump_n,
+
+ /* Set the following two-byte relative address to the
+ subsequent two-byte number. The address *includes* the two
+ bytes of number. */
+ set_number_at,
+
+ wordchar, /* Matches any word-constituent character. */
+ notwordchar, /* Matches any char that is not a word-constituent. */
+
+ wordbeg, /* Succeeds if at word beginning. */
+ wordend, /* Succeeds if at word end. */
+
+ wordbound, /* Succeeds if at a word boundary. */
+ notwordbound /* Succeeds if not at a word boundary. */
+
+#ifdef emacs
+ ,before_dot, /* Succeeds if before point. */
+ at_dot, /* Succeeds if at point. */
+ after_dot, /* Succeeds if after point. */
+
+ /* Matches any character whose syntax is specified. Followed by
+ a byte which contains a syntax code, e.g., Sword. */
+ syntaxspec,
+
+ /* Matches any character whose syntax is not that specified. */
+ notsyntaxspec
+#endif /* emacs */
+} re_opcode_t;
+
+/* Common operations on the compiled pattern. */
+
+/* Store NUMBER in two contiguous bytes starting at DESTINATION. */
+
+#define STORE_NUMBER(destination, number) \
+ do { \
+ (destination)[0] = (number) & 0377; \
+ (destination)[1] = (number) >> 8; \
+ } while (0)
+
+/* Same as STORE_NUMBER, except increment DESTINATION to
+ the byte after where the number is stored. Therefore, DESTINATION
+ must be an lvalue. */
+
+#define STORE_NUMBER_AND_INCR(destination, number) \
+ do { \
+ STORE_NUMBER (destination, number); \
+ (destination) += 2; \
+ } while (0)
+
+/* Put into DESTINATION a number stored in two contiguous bytes starting
+ at SOURCE. */
+
+#define EXTRACT_NUMBER(destination, source) \
+ do { \
+ (destination) = *(source) & 0377; \
+ (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \
+ } while (0)
+
+#ifdef DEBUG
+static void extract_number _RE_ARGS ((int *dest, unsigned char *source));
+static void
+extract_number (dest, source)
+ int *dest;
+ unsigned char *source;
+{
+ int temp = SIGN_EXTEND_CHAR (*(source + 1));
+ *dest = *source & 0377;
+ *dest += temp << 8;
+}
+
+# ifndef EXTRACT_MACROS /* To debug the macros. */
+# undef EXTRACT_NUMBER
+# define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
+# endif /* not EXTRACT_MACROS */
+
+#endif /* DEBUG */
+
+/* Same as EXTRACT_NUMBER, except increment SOURCE to after the number.
+ SOURCE must be an lvalue. */
+
+#define EXTRACT_NUMBER_AND_INCR(destination, source) \
+ do { \
+ EXTRACT_NUMBER (destination, source); \
+ (source) += 2; \
+ } while (0)
+
+#ifdef DEBUG
+static void extract_number_and_incr _RE_ARGS ((int *destination,
+ unsigned char **source));
+static void
+extract_number_and_incr (destination, source)
+ int *destination;
+ unsigned char **source;
+{
+ extract_number (destination, *source);
+ *source += 2;
+}
+
+# ifndef EXTRACT_MACROS
+# undef EXTRACT_NUMBER_AND_INCR
+# define EXTRACT_NUMBER_AND_INCR(dest, src) \
+ extract_number_and_incr (&dest, &src)
+# endif /* not EXTRACT_MACROS */
+
+#endif /* DEBUG */
+
+/* If DEBUG is defined, Regex prints many voluminous messages about what
+ it is doing (if the variable `debug' is nonzero). If linked with the
+ main program in `iregex.c', you can enter patterns and strings
+ interactively. And if linked with the main program in `main.c' and
+ the other test files, you can run the already-written tests. */
+
+#ifdef DEBUG
+
+/* We use standard I/O for debugging. */
+# include <stdio.h>
+
+/* It is useful to test things that ``must'' be true when debugging. */
+# include <assert.h>
+
+static int debug;
+
+# define DEBUG_STATEMENT(e) e
+# define DEBUG_PRINT1(x) if (debug) printf (x)
+# define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
+# define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
+# define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
+# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
+ if (debug) print_partial_compiled_pattern (s, e)
+# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
+ if (debug) print_double_string (w, s1, sz1, s2, sz2)
+
+
+/* Print the fastmap in human-readable form. */
+
+void
+print_fastmap (fastmap)
+ char *fastmap;
+{
+ unsigned was_a_range = 0;
+ unsigned i = 0;
+
+ while (i < (1 << BYTEWIDTH))
+ {
+ if (fastmap[i++])
+ {
+ was_a_range = 0;
+ putchar (i - 1);
+ while (i < (1 << BYTEWIDTH) && fastmap[i])
+ {
+ was_a_range = 1;
+ i++;
+ }
+ if (was_a_range)
+ {
+ printf ("-");
+ putchar (i - 1);
+ }
+ }
+ }
+ putchar ('\n');
+}
+
+
+/* Print a compiled pattern string in human-readable form, starting at
+ the START pointer into it and ending just before the pointer END. */
+
+void
+print_partial_compiled_pattern (start, end)
+ unsigned char *start;
+ unsigned char *end;
+{
+ int mcnt, mcnt2;
+ unsigned char *p1;
+ unsigned char *p = start;
+ unsigned char *pend = end;
+
+ if (start == NULL)
+ {
+ printf ("(null)\n");
+ return;
+ }
+
+ /* Loop over pattern commands. */
+ while (p < pend)
+ {
+ printf ("%d:\t", p - start);
+
+ switch ((re_opcode_t) *p++)
+ {
+ case no_op:
+ printf ("/no_op");
+ break;
+
+ case exactn:
+ mcnt = *p++;
+ printf ("/exactn/%d", mcnt);
+ do
+ {
+ putchar ('/');
+ putchar (*p++);
+ }
+ while (--mcnt);
+ break;
+
+ case start_memory:
+ mcnt = *p++;
+ printf ("/start_memory/%d/%d", mcnt, *p++);
+ break;
+
+ case stop_memory:
+ mcnt = *p++;
+ printf ("/stop_memory/%d/%d", mcnt, *p++);
+ break;
+
+ case duplicate:
+ printf ("/duplicate/%d", *p++);
+ break;
+
+ case anychar:
+ printf ("/anychar");
+ break;
+
+ case charset:
+ case charset_not:
+ {
+ register int c, last = -100;
+ register int in_range = 0;
+
+ printf ("/charset [%s",
+ (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
+
+ assert (p + *p < pend);
+
+ for (c = 0; c < 256; c++)
+ if (c / 8 < *p
+ && (p[1 + (c/8)] & (1 << (c % 8))))
+ {
+ /* Are we starting a range? */
+ if (last + 1 == c && ! in_range)
+ {
+ putchar ('-');
+ in_range = 1;
+ }
+ /* Have we broken a range? */
+ else if (last + 1 != c && in_range)
+ {
+ putchar (last);
+ in_range = 0;
+ }
+
+ if (! in_range)
+ putchar (c);
+
+ last = c;
+ }
+
+ if (in_range)
+ putchar (last);
+
+ putchar (']');
+
+ p += 1 + *p;
+ }
+ break;
+
+ case begline:
+ printf ("/begline");
+ break;
+
+ case endline:
+ printf ("/endline");
+ break;
+
+ case on_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/on_failure_jump to %d", p + mcnt - start);
+ break;
+
+ case on_failure_keep_string_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/on_failure_keep_string_jump to %d", p + mcnt - start);
+ break;
+
+ case dummy_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/dummy_failure_jump to %d", p + mcnt - start);
+ break;
+
+ case push_dummy_failure:
+ printf ("/push_dummy_failure");
+ break;
+
+ case maybe_pop_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/maybe_pop_jump to %d", p + mcnt - start);
+ break;
+
+ case pop_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/pop_failure_jump to %d", p + mcnt - start);
+ break;
+
+ case jump_past_alt:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/jump_past_alt to %d", p + mcnt - start);
+ break;
+
+ case jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/jump to %d", p + mcnt - start);
+ break;
+
+ case succeed_n:
+ extract_number_and_incr (&mcnt, &p);
+ p1 = p + mcnt;
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/succeed_n to %d, %d times", p1 - start, mcnt2);
+ break;
+
+ case jump_n:
+ extract_number_and_incr (&mcnt, &p);
+ p1 = p + mcnt;
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/jump_n to %d, %d times", p1 - start, mcnt2);
+ break;
+
+ case set_number_at:
+ extract_number_and_incr (&mcnt, &p);
+ p1 = p + mcnt;
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/set_number_at location %d to %d", p1 - start, mcnt2);
+ break;
+
+ case wordbound:
+ printf ("/wordbound");
+ break;
+
+ case notwordbound:
+ printf ("/notwordbound");
+ break;
+
+ case wordbeg:
+ printf ("/wordbeg");
+ break;
+
+ case wordend:
+ printf ("/wordend");
+
+# ifdef emacs
+ case before_dot:
+ printf ("/before_dot");
+ break;
+
+ case at_dot:
+ printf ("/at_dot");
+ break;
+
+ case after_dot:
+ printf ("/after_dot");
+ break;
+
+ case syntaxspec:
+ printf ("/syntaxspec");
+ mcnt = *p++;
+ printf ("/%d", mcnt);
+ break;
+
+ case notsyntaxspec:
+ printf ("/notsyntaxspec");
+ mcnt = *p++;
+ printf ("/%d", mcnt);
+ break;
+# endif /* emacs */
+
+ case wordchar:
+ printf ("/wordchar");
+ break;
+
+ case notwordchar:
+ printf ("/notwordchar");
+ break;
+
+ case begbuf:
+ printf ("/begbuf");
+ break;
+
+ case endbuf:
+ printf ("/endbuf");
+ break;
+
+ default:
+ printf ("?%d", *(p-1));
+ }
+
+ putchar ('\n');
+ }
+
+ printf ("%d:\tend of pattern.\n", p - start);
+}
+
+
+void
+print_compiled_pattern (bufp)
+ struct re_pattern_buffer *bufp;
+{
+ unsigned char *buffer = bufp->buffer;
+
+ print_partial_compiled_pattern (buffer, buffer + bufp->used);
+ printf ("%ld bytes used/%ld bytes allocated.\n",
+ bufp->used, bufp->allocated);
+
+ if (bufp->fastmap_accurate && bufp->fastmap)
+ {
+ printf ("fastmap: ");
+ print_fastmap (bufp->fastmap);
+ }
+
+ printf ("re_nsub: %d\t", bufp->re_nsub);
+ printf ("regs_alloc: %d\t", bufp->regs_allocated);
+ printf ("can_be_null: %d\t", bufp->can_be_null);
+ printf ("newline_anchor: %d\n", bufp->newline_anchor);
+ printf ("no_sub: %d\t", bufp->no_sub);
+ printf ("not_bol: %d\t", bufp->not_bol);
+ printf ("not_eol: %d\t", bufp->not_eol);
+ printf ("syntax: %lx\n", bufp->syntax);
+ /* Perhaps we should print the translate table? */
+}
+
+
+void
+print_double_string (where, string1, size1, string2, size2)
+ const char *where;
+ const char *string1;
+ const char *string2;
+ int size1;
+ int size2;
+{
+ int this_char;
+
+ if (where == NULL)
+ printf ("(null)");
+ else
+ {
+ if (FIRST_STRING_P (where))
+ {
+ for (this_char = where - string1; this_char < size1; this_char++)
+ putchar (string1[this_char]);
+
+ where = string2;
+ }
+
+ for (this_char = where - string2; this_char < size2; this_char++)
+ putchar (string2[this_char]);
+ }
+}
+
+void
+printchar (c)
+ int c;
+{
+ putc (c, stderr);
+}
+
+#else /* not DEBUG */
+
+# undef assert
+# define assert(e)
+
+# define DEBUG_STATEMENT(e)
+# define DEBUG_PRINT1(x)
+# define DEBUG_PRINT2(x1, x2)
+# define DEBUG_PRINT3(x1, x2, x3)
+# define DEBUG_PRINT4(x1, x2, x3, x4)
+# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
+# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
+
+#endif /* not DEBUG */
+
+/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can
+ also be assigned to arbitrarily: each pattern buffer stores its own
+ syntax, so it can be changed between regex compilations. */
+/* This has no initializer because initialized variables in Emacs
+ become read-only after dumping. */
+reg_syntax_t re_syntax_options;
+
+
+/* Specify the precise syntax of regexps for compilation. This provides
+ for compatibility for various utilities which historically have
+ different, incompatible syntaxes.
+
+ The argument SYNTAX is a bit mask comprised of the various bits
+ defined in regex.h. We return the old syntax. */
+
+reg_syntax_t
+re_set_syntax (syntax)
+ reg_syntax_t syntax;
+{
+ reg_syntax_t ret = re_syntax_options;
+
+ re_syntax_options = syntax;
+#ifdef DEBUG
+ if (syntax & RE_DEBUG)
+ debug = 1;
+ else if (debug) /* was on but now is not */
+ debug = 0;
+#endif /* DEBUG */
+ return ret;
+}
+#ifdef _LIBC
+weak_alias (__re_set_syntax, re_set_syntax)
+#endif
+
+/* This table gives an error message for each of the error codes listed
+ in regex.h. Obviously the order here has to be same as there.
+ POSIX doesn't require that we do anything for REG_NOERROR,
+ but why not be nice? */
+
+static const char re_error_msgid[] =
+ {
+#define REG_NOERROR_IDX 0
+ gettext_noop ("Success") /* REG_NOERROR */
+ "\0"
+#define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success")
+ gettext_noop ("No match") /* REG_NOMATCH */
+ "\0"
+#define REG_BADPAT_IDX (REG_NOMATCH_IDX + sizeof "No match")
+ gettext_noop ("Invalid regular expression") /* REG_BADPAT */
+ "\0"
+#define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression")
+ gettext_noop ("Invalid collation character") /* REG_ECOLLATE */
+ "\0"
+#define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character")
+ gettext_noop ("Invalid character class name") /* REG_ECTYPE */
+ "\0"
+#define REG_EESCAPE_IDX (REG_ECTYPE_IDX + sizeof "Invalid character class name")
+ gettext_noop ("Trailing backslash") /* REG_EESCAPE */
+ "\0"
+#define REG_ESUBREG_IDX (REG_EESCAPE_IDX + sizeof "Trailing backslash")
+ gettext_noop ("Invalid back reference") /* REG_ESUBREG */
+ "\0"
+#define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference")
+ gettext_noop ("Unmatched [ or [^") /* REG_EBRACK */
+ "\0"
+#define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [ or [^")
+ gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */
+ "\0"
+#define REG_EBRACE_IDX (REG_EPAREN_IDX + sizeof "Unmatched ( or \\(")
+ gettext_noop ("Unmatched \\{") /* REG_EBRACE */
+ "\0"
+#define REG_BADBR_IDX (REG_EBRACE_IDX + sizeof "Unmatched \\{")
+ gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */
+ "\0"
+#define REG_ERANGE_IDX (REG_BADBR_IDX + sizeof "Invalid content of \\{\\}")
+ gettext_noop ("Invalid range end") /* REG_ERANGE */
+ "\0"
+#define REG_ESPACE_IDX (REG_ERANGE_IDX + sizeof "Invalid range end")
+ gettext_noop ("Memory exhausted") /* REG_ESPACE */
+ "\0"
+#define REG_BADRPT_IDX (REG_ESPACE_IDX + sizeof "Memory exhausted")
+ gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */
+ "\0"
+#define REG_EEND_IDX (REG_BADRPT_IDX + sizeof "Invalid preceding regular expression")
+ gettext_noop ("Premature end of regular expression") /* REG_EEND */
+ "\0"
+#define REG_ESIZE_IDX (REG_EEND_IDX + sizeof "Premature end of regular expression")
+ gettext_noop ("Regular expression too big") /* REG_ESIZE */
+ "\0"
+#define REG_ERPAREN_IDX (REG_ESIZE_IDX + sizeof "Regular expression too big")
+ gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */
+ };
+
+static const size_t re_error_msgid_idx[] =
+ {
+ REG_NOERROR_IDX,
+ REG_NOMATCH_IDX,
+ REG_BADPAT_IDX,
+ REG_ECOLLATE_IDX,
+ REG_ECTYPE_IDX,
+ REG_EESCAPE_IDX,
+ REG_ESUBREG_IDX,
+ REG_EBRACK_IDX,
+ REG_EPAREN_IDX,
+ REG_EBRACE_IDX,
+ REG_BADBR_IDX,
+ REG_ERANGE_IDX,
+ REG_ESPACE_IDX,
+ REG_BADRPT_IDX,
+ REG_EEND_IDX,
+ REG_ESIZE_IDX,
+ REG_ERPAREN_IDX
+ };
+
+/* Avoiding alloca during matching, to placate r_alloc. */
+
+/* Define MATCH_MAY_ALLOCATE unless we need to make sure that the
+ searching and matching functions should not call alloca. On some
+ systems, alloca is implemented in terms of malloc, and if we're
+ using the relocating allocator routines, then malloc could cause a
+ relocation, which might (if the strings being searched are in the
+ ralloc heap) shift the data out from underneath the regexp
+ routines.
+
+ Here's another reason to avoid allocation: Emacs
+ processes input from X in a signal handler; processing X input may
+ call malloc; if input arrives while a matching routine is calling
+ malloc, then we're scrod. But Emacs can't just block input while
+ calling matching routines; then we don't notice interrupts when
+ they come in. So, Emacs blocks input around all regexp calls
+ except the matching calls, which it leaves unprotected, in the
+ faith that they will not malloc. */
+
+/* Normally, this is fine. */
+#define MATCH_MAY_ALLOCATE
+
+/* When using GNU C, we are not REALLY using the C alloca, no matter
+ what config.h may say. So don't take precautions for it. */
+#ifdef __GNUC__
+# undef C_ALLOCA
+#endif
+
+/* The match routines may not allocate if (1) they would do it with malloc
+ and (2) it's not safe for them to use malloc.
+ Note that if REL_ALLOC is defined, matching would not use malloc for the
+ failure stack, but we would still use it for the register vectors;
+ so REL_ALLOC should not affect this. */
+#if (defined C_ALLOCA || defined REGEX_MALLOC) && defined emacs
+# undef MATCH_MAY_ALLOCATE
+#endif
+
+
+/* Failure stack declarations and macros; both re_compile_fastmap and
+ re_match_2 use a failure stack. These have to be macros because of
+ REGEX_ALLOCATE_STACK. */
+
+
+/* Number of failure points for which to initially allocate space
+ when matching. If this number is exceeded, we allocate more
+ space, so it is not a hard limit. */
+#ifndef INIT_FAILURE_ALLOC
+# define INIT_FAILURE_ALLOC 5
+#endif
+
+/* Roughly the maximum number of failure points on the stack. Would be
+ exactly that if always used MAX_FAILURE_ITEMS items each time we failed.
+ This is a variable only so users of regex can assign to it; we never
+ change it ourselves. */
+
+#ifdef INT_IS_16BIT
+
+# if defined MATCH_MAY_ALLOCATE
+/* 4400 was enough to cause a crash on Alpha OSF/1,
+ whose default stack limit is 2mb. */
+long int re_max_failures = 4000;
+# else
+long int re_max_failures = 2000;
+# endif
+
+union fail_stack_elt
+{
+ unsigned char *pointer;
+ long int integer;
+};
+
+typedef union fail_stack_elt fail_stack_elt_t;
+
+typedef struct
+{
+ fail_stack_elt_t *stack;
+ unsigned long int size;
+ unsigned long int avail; /* Offset of next open position. */
+} fail_stack_type;
+
+#else /* not INT_IS_16BIT */
+
+# if defined MATCH_MAY_ALLOCATE
+/* 4400 was enough to cause a crash on Alpha OSF/1,
+ whose default stack limit is 2mb. */
+int re_max_failures = 20000;
+# else
+int re_max_failures = 2000;
+# endif
+
+union fail_stack_elt
+{
+ unsigned char *pointer;
+ int integer;
+};
+
+typedef union fail_stack_elt fail_stack_elt_t;
+
+typedef struct
+{
+ fail_stack_elt_t *stack;
+ unsigned size;
+ unsigned avail; /* Offset of next open position. */
+} fail_stack_type;
+
+#endif /* INT_IS_16BIT */
+
+#define FAIL_STACK_EMPTY() (fail_stack.avail == 0)
+#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0)
+#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
+
+
+/* Define macros to initialize and free the failure stack.
+ Do `return -2' if the alloc fails. */
+
+#ifdef MATCH_MAY_ALLOCATE
+# define INIT_FAIL_STACK() \
+ do { \
+ fail_stack.stack = (fail_stack_elt_t *) \
+ REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
+ \
+ if (fail_stack.stack == NULL) \
+ return -2; \
+ \
+ fail_stack.size = INIT_FAILURE_ALLOC; \
+ fail_stack.avail = 0; \
+ } while (0)
+
+# define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack)
+#else
+# define INIT_FAIL_STACK() \
+ do { \
+ fail_stack.avail = 0; \
+ } while (0)
+
+# define RESET_FAIL_STACK()
+#endif
+
+
+/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
+
+ Return 1 if succeeds, and 0 if either ran out of memory
+ allocating space for it or it was already too large.
+
+ REGEX_REALLOCATE_STACK requires `destination' be declared. */
+
+#define DOUBLE_FAIL_STACK(fail_stack) \
+ ((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS) \
+ ? 0 \
+ : ((fail_stack).stack = (fail_stack_elt_t *) \
+ REGEX_REALLOCATE_STACK ((fail_stack).stack, \
+ (fail_stack).size * sizeof (fail_stack_elt_t), \
+ ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \
+ \
+ (fail_stack).stack == NULL \
+ ? 0 \
+ : ((fail_stack).size <<= 1, \
+ 1)))
+
+
+/* Push pointer POINTER on FAIL_STACK.
+ Return 1 if was able to do so and 0 if ran out of memory allocating
+ space to do so. */
+#define PUSH_PATTERN_OP(POINTER, FAIL_STACK) \
+ ((FAIL_STACK_FULL () \
+ && !DOUBLE_FAIL_STACK (FAIL_STACK)) \
+ ? 0 \
+ : ((FAIL_STACK).stack[(FAIL_STACK).avail++].pointer = POINTER, \
+ 1))
+
+/* Push a pointer value onto the failure stack.
+ Assumes the variable `fail_stack'. Probably should only
+ be called from within `PUSH_FAILURE_POINT'. */
+#define PUSH_FAILURE_POINTER(item) \
+ fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (item)
+
+/* This pushes an integer-valued item onto the failure stack.
+ Assumes the variable `fail_stack'. Probably should only
+ be called from within `PUSH_FAILURE_POINT'. */
+#define PUSH_FAILURE_INT(item) \
+ fail_stack.stack[fail_stack.avail++].integer = (item)
+
+/* Push a fail_stack_elt_t value onto the failure stack.
+ Assumes the variable `fail_stack'. Probably should only
+ be called from within `PUSH_FAILURE_POINT'. */
+#define PUSH_FAILURE_ELT(item) \
+ fail_stack.stack[fail_stack.avail++] = (item)
+
+/* These three POP... operations complement the three PUSH... operations.
+ All assume that `fail_stack' is nonempty. */
+#define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer
+#define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer
+#define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail]
+
+/* Used to omit pushing failure point id's when we're not debugging. */
+#ifdef DEBUG
+# define DEBUG_PUSH PUSH_FAILURE_INT
+# define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT ()
+#else
+# define DEBUG_PUSH(item)
+# define DEBUG_POP(item_addr)
+#endif
+
+
+/* Push the information about the state we will need
+ if we ever fail back to it.
+
+ Requires variables fail_stack, regstart, regend, reg_info, and
+ num_regs_pushed be declared. DOUBLE_FAIL_STACK requires `destination'
+ be declared.
+
+ Does `return FAILURE_CODE' if runs out of memory. */
+
+#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \
+ do { \
+ char *destination; \
+ /* Must be int, so when we don't save any registers, the arithmetic \
+ of 0 + -1 isn't done as unsigned. */ \
+ /* Can't be int, since there is not a shred of a guarantee that int \
+ is wide enough to hold a value of something to which pointer can \
+ be assigned */ \
+ active_reg_t this_reg; \
+ \
+ DEBUG_STATEMENT (failure_id++); \
+ DEBUG_STATEMENT (nfailure_points_pushed++); \
+ DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \
+ DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\
+ DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\
+ \
+ DEBUG_PRINT2 (" slots needed: %ld\n", NUM_FAILURE_ITEMS); \
+ DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \
+ \
+ /* Ensure we have enough space allocated for what we will push. */ \
+ while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \
+ { \
+ if (!DOUBLE_FAIL_STACK (fail_stack)) \
+ return failure_code; \
+ \
+ DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \
+ (fail_stack).size); \
+ DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\
+ } \
+ \
+ /* Push the info, starting with the registers. */ \
+ DEBUG_PRINT1 ("\n"); \
+ \
+ if (1) \
+ for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \
+ this_reg++) \
+ { \
+ DEBUG_PRINT2 (" Pushing reg: %lu\n", this_reg); \
+ DEBUG_STATEMENT (num_regs_pushed++); \
+ \
+ DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \
+ PUSH_FAILURE_POINTER (regstart[this_reg]); \
+ \
+ DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \
+ PUSH_FAILURE_POINTER (regend[this_reg]); \
+ \
+ DEBUG_PRINT2 (" info: %p\n ", \
+ reg_info[this_reg].word.pointer); \
+ DEBUG_PRINT2 (" match_null=%d", \
+ REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" matched_something=%d", \
+ MATCHED_SOMETHING (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" ever_matched=%d", \
+ EVER_MATCHED_SOMETHING (reg_info[this_reg])); \
+ DEBUG_PRINT1 ("\n"); \
+ PUSH_FAILURE_ELT (reg_info[this_reg].word); \
+ } \
+ \
+ DEBUG_PRINT2 (" Pushing low active reg: %ld\n", lowest_active_reg);\
+ PUSH_FAILURE_INT (lowest_active_reg); \
+ \
+ DEBUG_PRINT2 (" Pushing high active reg: %ld\n", highest_active_reg);\
+ PUSH_FAILURE_INT (highest_active_reg); \
+ \
+ DEBUG_PRINT2 (" Pushing pattern %p:\n", pattern_place); \
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
+ PUSH_FAILURE_POINTER (pattern_place); \
+ \
+ DEBUG_PRINT2 (" Pushing string %p: `", string_place); \
+ DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \
+ size2); \
+ DEBUG_PRINT1 ("'\n"); \
+ PUSH_FAILURE_POINTER (string_place); \
+ \
+ DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \
+ DEBUG_PUSH (failure_id); \
+ } while (0)
+
+/* This is the number of items that are pushed and popped on the stack
+ for each register. */
+#define NUM_REG_ITEMS 3
+
+/* Individual items aside from the registers. */
+#ifdef DEBUG
+# define NUM_NONREG_ITEMS 5 /* Includes failure point id. */
+#else
+# define NUM_NONREG_ITEMS 4
+#endif
+
+/* We push at most this many items on the stack. */
+/* We used to use (num_regs - 1), which is the number of registers
+ this regexp will save; but that was changed to 5
+ to avoid stack overflow for a regexp with lots of parens. */
+#define MAX_FAILURE_ITEMS (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
+
+/* We actually push this many items. */
+#define NUM_FAILURE_ITEMS \
+ (((0 \
+ ? 0 : highest_active_reg - lowest_active_reg + 1) \
+ * NUM_REG_ITEMS) \
+ + NUM_NONREG_ITEMS)
+
+/* How many items can still be added to the stack without overflowing it. */
+#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail)
+
+
+/* Pops what PUSH_FAIL_STACK pushes.
+
+ We restore into the parameters, all of which should be lvalues:
+ STR -- the saved data position.
+ PAT -- the saved pattern position.
+ LOW_REG, HIGH_REG -- the highest and lowest active registers.
+ REGSTART, REGEND -- arrays of string positions.
+ REG_INFO -- array of information about each subexpression.
+
+ Also assumes the variables `fail_stack' and (if debugging), `bufp',
+ `pend', `string1', `size1', `string2', and `size2'. */
+
+#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
+{ \
+ DEBUG_STATEMENT (unsigned failure_id;) \
+ active_reg_t this_reg; \
+ const unsigned char *string_temp; \
+ \
+ assert (!FAIL_STACK_EMPTY ()); \
+ \
+ /* Remove failure points and point to how many regs pushed. */ \
+ DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \
+ DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \
+ DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \
+ \
+ assert (fail_stack.avail >= NUM_NONREG_ITEMS); \
+ \
+ DEBUG_POP (&failure_id); \
+ DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \
+ \
+ /* If the saved string location is NULL, it came from an \
+ on_failure_keep_string_jump opcode, and we want to throw away the \
+ saved NULL, thus retaining our current position in the string. */ \
+ string_temp = POP_FAILURE_POINTER (); \
+ if (string_temp != NULL) \
+ str = (const char *) string_temp; \
+ \
+ DEBUG_PRINT2 (" Popping string %p: `", str); \
+ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \
+ DEBUG_PRINT1 ("'\n"); \
+ \
+ pat = (unsigned char *) POP_FAILURE_POINTER (); \
+ DEBUG_PRINT2 (" Popping pattern %p:\n", pat); \
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
+ \
+ /* Restore register info. */ \
+ high_reg = (active_reg_t) POP_FAILURE_INT (); \
+ DEBUG_PRINT2 (" Popping high active reg: %ld\n", high_reg); \
+ \
+ low_reg = (active_reg_t) POP_FAILURE_INT (); \
+ DEBUG_PRINT2 (" Popping low active reg: %ld\n", low_reg); \
+ \
+ if (1) \
+ for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \
+ { \
+ DEBUG_PRINT2 (" Popping reg: %ld\n", this_reg); \
+ \
+ reg_info[this_reg].word = POP_FAILURE_ELT (); \
+ DEBUG_PRINT2 (" info: %p\n", \
+ reg_info[this_reg].word.pointer); \
+ \
+ regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \
+ DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \
+ \
+ regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \
+ DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \
+ } \
+ else \
+ { \
+ for (this_reg = highest_active_reg; this_reg > high_reg; this_reg--) \
+ { \
+ reg_info[this_reg].word.integer = 0; \
+ regend[this_reg] = 0; \
+ regstart[this_reg] = 0; \
+ } \
+ highest_active_reg = high_reg; \
+ } \
+ \
+ set_regs_matched_done = 0; \
+ DEBUG_STATEMENT (nfailure_points_popped++); \
+} /* POP_FAILURE_POINT */
+
+
+
+/* Structure for per-register (a.k.a. per-group) information.
+ Other register information, such as the
+ starting and ending positions (which are addresses), and the list of
+ inner groups (which is a bits list) are maintained in separate
+ variables.
+
+ We are making a (strictly speaking) nonportable assumption here: that
+ the compiler will pack our bit fields into something that fits into
+ the type of `word', i.e., is something that fits into one item on the
+ failure stack. */
+
+
+/* Declarations and macros for re_match_2. */
+
+typedef union
+{
+ fail_stack_elt_t word;
+ struct
+ {
+ /* This field is one if this group can match the empty string,
+ zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */
+#define MATCH_NULL_UNSET_VALUE 3
+ unsigned match_null_string_p : 2;
+ unsigned is_active : 1;
+ unsigned matched_something : 1;
+ unsigned ever_matched_something : 1;
+ } bits;
+} register_info_type;
+
+#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p)
+#define IS_ACTIVE(R) ((R).bits.is_active)
+#define MATCHED_SOMETHING(R) ((R).bits.matched_something)
+#define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something)
+
+
+/* Call this when have matched a real character; it sets `matched' flags
+ for the subexpressions which we are currently inside. Also records
+ that those subexprs have matched. */
+#define SET_REGS_MATCHED() \
+ do \
+ { \
+ if (!set_regs_matched_done) \
+ { \
+ active_reg_t r; \
+ set_regs_matched_done = 1; \
+ for (r = lowest_active_reg; r <= highest_active_reg; r++) \
+ { \
+ MATCHED_SOMETHING (reg_info[r]) \
+ = EVER_MATCHED_SOMETHING (reg_info[r]) \
+ = 1; \
+ } \
+ } \
+ } \
+ while (0)
+
+/* Registers are set to a sentinel when they haven't yet matched. */
+static char reg_unset_dummy;
+#define REG_UNSET_VALUE (&reg_unset_dummy)
+#define REG_UNSET(e) ((e) == REG_UNSET_VALUE)
+
+/* Subroutine declarations and macros for regex_compile. */
+
+static reg_errcode_t regex_compile _RE_ARGS ((const char *pattern, size_t size,
+ reg_syntax_t syntax,
+ struct re_pattern_buffer *bufp));
+static void store_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg));
+static void store_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
+ int arg1, int arg2));
+static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
+ int arg, unsigned char *end));
+static void insert_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
+ int arg1, int arg2, unsigned char *end));
+static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p,
+ reg_syntax_t syntax));
+static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend,
+ reg_syntax_t syntax));
+static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
+ const char *pend,
+ char *translate,
+ reg_syntax_t syntax,
+ unsigned char *b));
+
+/* Fetch the next character in the uncompiled pattern---translating it
+ if necessary. Also cast from a signed character in the constant
+ string passed to us by the user to an unsigned char that we can use
+ as an array index (in, e.g., `translate'). */
+#ifndef PATFETCH
+# define PATFETCH(c) \
+ do {if (p == pend) return REG_EEND; \
+ c = (unsigned char) *p++; \
+ if (translate) c = (unsigned char) translate[c]; \
+ } while (0)
+#endif
+
+/* Fetch the next character in the uncompiled pattern, with no
+ translation. */
+#define PATFETCH_RAW(c) \
+ do {if (p == pend) return REG_EEND; \
+ c = (unsigned char) *p++; \
+ } while (0)
+
+/* Go backwards one character in the pattern. */
+#define PATUNFETCH p--
+
+
+/* If `translate' is non-null, return translate[D], else just D. We
+ cast the subscript to translate because some data is declared as
+ `char *', to avoid warnings when a string constant is passed. But
+ when we use a character as a subscript we must make it unsigned. */
+#ifndef TRANSLATE
+# define TRANSLATE(d) \
+ (translate ? (char) translate[(unsigned char) (d)] : (d))
+#endif
+
+
+/* Macros for outputting the compiled pattern into `buffer'. */
+
+/* If the buffer isn't allocated when it comes in, use this. */
+#define INIT_BUF_SIZE 32
+
+/* Make sure we have at least N more bytes of space in buffer. */
+#define GET_BUFFER_SPACE(n) \
+ while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated) \
+ EXTEND_BUFFER ()
+
+/* Make sure we have one more byte of buffer space and then add C to it. */
+#define BUF_PUSH(c) \
+ do { \
+ GET_BUFFER_SPACE (1); \
+ *b++ = (unsigned char) (c); \
+ } while (0)
+
+
+/* Ensure we have two more bytes of buffer space and then append C1 and C2. */
+#define BUF_PUSH_2(c1, c2) \
+ do { \
+ GET_BUFFER_SPACE (2); \
+ *b++ = (unsigned char) (c1); \
+ *b++ = (unsigned char) (c2); \
+ } while (0)
+
+
+/* As with BUF_PUSH_2, except for three bytes. */
+#define BUF_PUSH_3(c1, c2, c3) \
+ do { \
+ GET_BUFFER_SPACE (3); \
+ *b++ = (unsigned char) (c1); \
+ *b++ = (unsigned char) (c2); \
+ *b++ = (unsigned char) (c3); \
+ } while (0)
+
+
+/* Store a jump with opcode OP at LOC to location TO. We store a
+ relative address offset by the three bytes the jump itself occupies. */
+#define STORE_JUMP(op, loc, to) \
+ store_op1 (op, loc, (int) ((to) - (loc) - 3))
+
+/* Likewise, for a two-argument jump. */
+#define STORE_JUMP2(op, loc, to, arg) \
+ store_op2 (op, loc, (int) ((to) - (loc) - 3), arg)
+
+/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */
+#define INSERT_JUMP(op, loc, to) \
+ insert_op1 (op, loc, (int) ((to) - (loc) - 3), b)
+
+/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */
+#define INSERT_JUMP2(op, loc, to, arg) \
+ insert_op2 (op, loc, (int) ((to) - (loc) - 3), arg, b)
+
+
+/* This is not an arbitrary limit: the arguments which represent offsets
+ into the pattern are two bytes long. So if 2^16 bytes turns out to
+ be too small, many things would have to change. */
+/* Any other compiler which, like MSC, has allocation limit below 2^16
+ bytes will have to use approach similar to what was done below for
+ MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up
+ reallocating to 0 bytes. Such thing is not going to work too well.
+ You have been warned!! */
+#if defined _MSC_VER && !defined WIN32
+/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes.
+ The REALLOC define eliminates a flurry of conversion warnings,
+ but is not required. */
+# define MAX_BUF_SIZE 65500L
+# define REALLOC(p,s) realloc ((p), (size_t) (s))
+#else
+# define MAX_BUF_SIZE (1L << 16)
+# define REALLOC(p,s) realloc ((p), (s))
+#endif
+
+/* Extend the buffer by twice its current size via realloc and
+ reset the pointers that pointed into the old block to point to the
+ correct places in the new one. If extending the buffer results in it
+ being larger than MAX_BUF_SIZE, then flag memory exhausted. */
+#define EXTEND_BUFFER() \
+ do { \
+ unsigned char *old_buffer = bufp->buffer; \
+ if (bufp->allocated == MAX_BUF_SIZE) \
+ return REG_ESIZE; \
+ bufp->allocated <<= 1; \
+ if (bufp->allocated > MAX_BUF_SIZE) \
+ bufp->allocated = MAX_BUF_SIZE; \
+ bufp->buffer = (unsigned char *) REALLOC (bufp->buffer, bufp->allocated);\
+ if (bufp->buffer == NULL) \
+ return REG_ESPACE; \
+ /* If the buffer moved, move all the pointers into it. */ \
+ if (old_buffer != bufp->buffer) \
+ { \
+ b = (b - old_buffer) + bufp->buffer; \
+ begalt = (begalt - old_buffer) + bufp->buffer; \
+ if (fixup_alt_jump) \
+ fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\
+ if (laststart) \
+ laststart = (laststart - old_buffer) + bufp->buffer; \
+ if (pending_exact) \
+ pending_exact = (pending_exact - old_buffer) + bufp->buffer; \
+ } \
+ } while (0)
+
+
+/* Since we have one byte reserved for the register number argument to
+ {start,stop}_memory, the maximum number of groups we can report
+ things about is what fits in that byte. */
+#define MAX_REGNUM 255
+
+/* But patterns can have more than `MAX_REGNUM' registers. We just
+ ignore the excess. */
+typedef unsigned regnum_t;
+
+
+/* Macros for the compile stack. */
+
+/* Since offsets can go either forwards or backwards, this type needs to
+ be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */
+/* int may be not enough when sizeof(int) == 2. */
+typedef long pattern_offset_t;
+
+typedef struct
+{
+ pattern_offset_t begalt_offset;
+ pattern_offset_t fixup_alt_jump;
+ pattern_offset_t inner_group_offset;
+ pattern_offset_t laststart_offset;
+ regnum_t regnum;
+} compile_stack_elt_t;
+
+
+typedef struct
+{
+ compile_stack_elt_t *stack;
+ unsigned size;
+ unsigned avail; /* Offset of next open position. */
+} compile_stack_type;
+
+
+#define INIT_COMPILE_STACK_SIZE 32
+
+#define COMPILE_STACK_EMPTY (compile_stack.avail == 0)
+#define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size)
+
+/* The next available element. */
+#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail])
+
+
+/* Set the bit for character C in a list. */
+#define SET_LIST_BIT(c) \
+ (b[((unsigned char) (c)) / BYTEWIDTH] \
+ |= 1 << (((unsigned char) c) % BYTEWIDTH))
+
+
+/* Get the next unsigned number in the uncompiled pattern. */
+#define GET_UNSIGNED_NUMBER(num) \
+ { if (p != pend) \
+ { \
+ PATFETCH (c); \
+ while (ISDIGIT (c)) \
+ { \
+ if (num < 0) \
+ num = 0; \
+ num = num * 10 + c - '0'; \
+ if (p == pend) \
+ break; \
+ PATFETCH (c); \
+ } \
+ } \
+ }
+
+#if defined _LIBC || WIDE_CHAR_SUPPORT
+/* The GNU C library provides support for user-defined character classes
+ and the functions from ISO C amendement 1. */
+# ifdef CHARCLASS_NAME_MAX
+# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
+# else
+/* This shouldn't happen but some implementation might still have this
+ problem. Use a reasonable default value. */
+# define CHAR_CLASS_MAX_LENGTH 256
+# endif
+
+# ifdef _LIBC
+# define IS_CHAR_CLASS(string) __wctype (string)
+# else
+# define IS_CHAR_CLASS(string) wctype (string)
+# endif
+#else
+# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
+
+# define IS_CHAR_CLASS(string) \
+ (STREQ (string, "alpha") || STREQ (string, "upper") \
+ || STREQ (string, "lower") || STREQ (string, "digit") \
+ || STREQ (string, "alnum") || STREQ (string, "xdigit") \
+ || STREQ (string, "space") || STREQ (string, "print") \
+ || STREQ (string, "punct") || STREQ (string, "graph") \
+ || STREQ (string, "cntrl") || STREQ (string, "blank"))
+#endif
+
+#ifndef MATCH_MAY_ALLOCATE
+
+/* If we cannot allocate large objects within re_match_2_internal,
+ we make the fail stack and register vectors global.
+ The fail stack, we grow to the maximum size when a regexp
+ is compiled.
+ The register vectors, we adjust in size each time we
+ compile a regexp, according to the number of registers it needs. */
+
+static fail_stack_type fail_stack;
+
+/* Size with which the following vectors are currently allocated.
+ That is so we can make them bigger as needed,
+ but never make them smaller. */
+static int regs_allocated_size;
+
+static const char ** regstart, ** regend;
+static const char ** old_regstart, ** old_regend;
+static const char **best_regstart, **best_regend;
+static register_info_type *reg_info;
+static const char **reg_dummy;
+static register_info_type *reg_info_dummy;
+
+/* Make the register vectors big enough for NUM_REGS registers,
+ but don't make them smaller. */
+
+static
+regex_grow_registers (num_regs)
+ int num_regs;
+{
+ if (num_regs > regs_allocated_size)
+ {
+ RETALLOC_IF (regstart, num_regs, const char *);
+ RETALLOC_IF (regend, num_regs, const char *);
+ RETALLOC_IF (old_regstart, num_regs, const char *);
+ RETALLOC_IF (old_regend, num_regs, const char *);
+ RETALLOC_IF (best_regstart, num_regs, const char *);
+ RETALLOC_IF (best_regend, num_regs, const char *);
+ RETALLOC_IF (reg_info, num_regs, register_info_type);
+ RETALLOC_IF (reg_dummy, num_regs, const char *);
+ RETALLOC_IF (reg_info_dummy, num_regs, register_info_type);
+
+ regs_allocated_size = num_regs;
+ }
+}
+
+#endif /* not MATCH_MAY_ALLOCATE */
+
+static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type
+ compile_stack,
+ regnum_t regnum));
+
+/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
+ Returns one of error codes defined in `regex.h', or zero for success.
+
+ Assumes the `allocated' (and perhaps `buffer') and `translate'
+ fields are set in BUFP on entry.
+
+ If it succeeds, results are put in BUFP (if it returns an error, the
+ contents of BUFP are undefined):
+ `buffer' is the compiled pattern;
+ `syntax' is set to SYNTAX;
+ `used' is set to the length of the compiled pattern;
+ `fastmap_accurate' is zero;
+ `re_nsub' is the number of subexpressions in PATTERN;
+ `not_bol' and `not_eol' are zero;
+
+ The `fastmap' and `newline_anchor' fields are neither
+ examined nor set. */
+
+/* Return, freeing storage we allocated. */
+#define FREE_STACK_RETURN(value) \
+ return (free (compile_stack.stack), value)
+
+static reg_errcode_t
+regex_compile (pattern, size, syntax, bufp)
+ const char *pattern;
+ size_t size;
+ reg_syntax_t syntax;
+ struct re_pattern_buffer *bufp;
+{
+ /* We fetch characters from PATTERN here. Even though PATTERN is
+ `char *' (i.e., signed), we declare these variables as unsigned, so
+ they can be reliably used as array indices. */
+ register unsigned char c, c1;
+
+ /* A random temporary spot in PATTERN. */
+ const char *p1;
+
+ /* Points to the end of the buffer, where we should append. */
+ register unsigned char *b;
+
+ /* Keeps track of unclosed groups. */
+ compile_stack_type compile_stack;
+
+ /* Points to the current (ending) position in the pattern. */
+ const char *p = pattern;
+ const char *pend = pattern + size;
+
+ /* How to translate the characters in the pattern. */
+ RE_TRANSLATE_TYPE translate = bufp->translate;
+
+ /* Address of the count-byte of the most recently inserted `exactn'
+ command. This makes it possible to tell if a new exact-match
+ character can be added to that command or if the character requires
+ a new `exactn' command. */
+ unsigned char *pending_exact = 0;
+
+ /* Address of start of the most recently finished expression.
+ This tells, e.g., postfix * where to find the start of its
+ operand. Reset at the beginning of groups and alternatives. */
+ unsigned char *laststart = 0;
+
+ /* Address of beginning of regexp, or inside of last group. */
+ unsigned char *begalt;
+
+ /* Place in the uncompiled pattern (i.e., the {) to
+ which to go back if the interval is invalid. */
+ const char *beg_interval;
+
+ /* Address of the place where a forward jump should go to the end of
+ the containing expression. Each alternative of an `or' -- except the
+ last -- ends with a forward jump of this sort. */
+ unsigned char *fixup_alt_jump = 0;
+
+ /* Counts open-groups as they are encountered. Remembered for the
+ matching close-group on the compile stack, so the same register
+ number is put in the stop_memory as the start_memory. */
+ regnum_t regnum = 0;
+
+#ifdef DEBUG
+ DEBUG_PRINT1 ("\nCompiling pattern: ");
+ if (debug)
+ {
+ unsigned debug_count;
+
+ for (debug_count = 0; debug_count < size; debug_count++)
+ putchar (pattern[debug_count]);
+ putchar ('\n');
+ }
+#endif /* DEBUG */
+
+ /* Initialize the compile stack. */
+ compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t);
+ if (compile_stack.stack == NULL)
+ return REG_ESPACE;
+
+ compile_stack.size = INIT_COMPILE_STACK_SIZE;
+ compile_stack.avail = 0;
+
+ /* Initialize the pattern buffer. */
+ bufp->syntax = syntax;
+ bufp->fastmap_accurate = 0;
+ bufp->not_bol = bufp->not_eol = 0;
+
+ /* Set `used' to zero, so that if we return an error, the pattern
+ printer (for debugging) will think there's no pattern. We reset it
+ at the end. */
+ bufp->used = 0;
+
+ /* Always count groups, whether or not bufp->no_sub is set. */
+ bufp->re_nsub = 0;
+
+#if !defined emacs && !defined SYNTAX_TABLE
+ /* Initialize the syntax table. */
+ init_syntax_once ();
+#endif
+
+ if (bufp->allocated == 0)
+ {
+ if (bufp->buffer)
+ { /* If zero allocated, but buffer is non-null, try to realloc
+ enough space. This loses if buffer's address is bogus, but
+ that is the user's responsibility. */
+ RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char);
+ }
+ else
+ { /* Caller did not allocate a buffer. Do it for them. */
+ bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char);
+ }
+ if (!bufp->buffer) FREE_STACK_RETURN (REG_ESPACE);
+
+ bufp->allocated = INIT_BUF_SIZE;
+ }
+
+ begalt = b = bufp->buffer;
+
+ /* Loop through the uncompiled pattern until we're at the end. */
+ while (p != pend)
+ {
+ PATFETCH (c);
+
+ switch (c)
+ {
+ case '^':
+ {
+ if ( /* If at start of pattern, it's an operator. */
+ p == pattern + 1
+ /* If context independent, it's an operator. */
+ || syntax & RE_CONTEXT_INDEP_ANCHORS
+ /* Otherwise, depends on what's come before. */
+ || at_begline_loc_p (pattern, p, syntax))
+ BUF_PUSH (begline);
+ else
+ goto normal_char;
+ }
+ break;
+
+
+ case '$':
+ {
+ if ( /* If at end of pattern, it's an operator. */
+ p == pend
+ /* If context independent, it's an operator. */
+ || syntax & RE_CONTEXT_INDEP_ANCHORS
+ /* Otherwise, depends on what's next. */
+ || at_endline_loc_p (p, pend, syntax))
+ BUF_PUSH (endline);
+ else
+ goto normal_char;
+ }
+ break;
+
+
+ case '+':
+ case '?':
+ if ((syntax & RE_BK_PLUS_QM)
+ || (syntax & RE_LIMITED_OPS))
+ goto normal_char;
+ handle_plus:
+ case '*':
+ /* If there is no previous pattern... */
+ if (!laststart)
+ {
+ if (syntax & RE_CONTEXT_INVALID_OPS)
+ FREE_STACK_RETURN (REG_BADRPT);
+ else if (!(syntax & RE_CONTEXT_INDEP_OPS))
+ goto normal_char;
+ }
+
+ {
+ /* Are we optimizing this jump? */
+ boolean keep_string_p = false;
+
+ /* 1 means zero (many) matches is allowed. */
+ char zero_times_ok = 0, many_times_ok = 0;
+
+ /* If there is a sequence of repetition chars, collapse it
+ down to just one (the right one). We can't combine
+ interval operators with these because of, e.g., `a{2}*',
+ which should only match an even number of `a's. */
+
+ for (;;)
+ {
+ zero_times_ok |= c != '+';
+ many_times_ok |= c != '?';
+
+ if (p == pend)
+ break;
+
+ PATFETCH (c);
+
+ if (c == '*'
+ || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?')))
+ ;
+
+ else if (syntax & RE_BK_PLUS_QM && c == '\\')
+ {
+ if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
+
+ PATFETCH (c1);
+ if (!(c1 == '+' || c1 == '?'))
+ {
+ PATUNFETCH;
+ PATUNFETCH;
+ break;
+ }
+
+ c = c1;
+ }
+ else
+ {
+ PATUNFETCH;
+ break;
+ }
+
+ /* If we get here, we found another repeat character. */
+ }
+
+ /* Star, etc. applied to an empty pattern is equivalent
+ to an empty pattern. */
+ if (!laststart)
+ break;
+
+ /* Now we know whether or not zero matches is allowed
+ and also whether or not two or more matches is allowed. */
+ if (many_times_ok)
+ { /* More than one repetition is allowed, so put in at the
+ end a backward relative jump from `b' to before the next
+ jump we're going to put in below (which jumps from
+ laststart to after this jump).
+
+ But if we are at the `*' in the exact sequence `.*\n',
+ insert an unconditional jump backwards to the .,
+ instead of the beginning of the loop. This way we only
+ push a failure point once, instead of every time
+ through the loop. */
+ assert (p - 1 > pattern);
+
+ /* Allocate the space for the jump. */
+ GET_BUFFER_SPACE (3);
+
+ /* We know we are not at the first character of the pattern,
+ because laststart was nonzero. And we've already
+ incremented `p', by the way, to be the character after
+ the `*'. Do we have to do something analogous here
+ for null bytes, because of RE_DOT_NOT_NULL? */
+ if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
+ && zero_times_ok
+ && p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
+ && !(syntax & RE_DOT_NEWLINE))
+ { /* We have .*\n. */
+ STORE_JUMP (jump, b, laststart);
+ keep_string_p = true;
+ }
+ else
+ /* Anything else. */
+ STORE_JUMP (maybe_pop_jump, b, laststart - 3);
+
+ /* We've added more stuff to the buffer. */
+ b += 3;
+ }
+
+ /* On failure, jump from laststart to b + 3, which will be the
+ end of the buffer after this jump is inserted. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump
+ : on_failure_jump,
+ laststart, b + 3);
+ pending_exact = 0;
+ b += 3;
+
+ if (!zero_times_ok)
+ {
+ /* At least one repetition is required, so insert a
+ `dummy_failure_jump' before the initial
+ `on_failure_jump' instruction of the loop. This
+ effects a skip over that instruction the first time
+ we hit that loop. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6);
+ b += 3;
+ }
+ }
+ break;
+
+
+ case '.':
+ laststart = b;
+ BUF_PUSH (anychar);
+ break;
+
+
+ case '[':
+ {
+ boolean had_char_class = false;
+
+ if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
+
+ /* Ensure that we have enough space to push a charset: the
+ opcode, the length count, and the bitset; 34 bytes in all. */
+ GET_BUFFER_SPACE (34);
+
+ laststart = b;
+
+ /* We test `*p == '^' twice, instead of using an if
+ statement, so we only need one BUF_PUSH. */
+ BUF_PUSH (*p == '^' ? charset_not : charset);
+ if (*p == '^')
+ p++;
+
+ /* Remember the first position in the bracket expression. */
+ p1 = p;
+
+ /* Push the number of bytes in the bitmap. */
+ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* Clear the whole map. */
+ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* charset_not matches newline according to a syntax bit. */
+ if ((re_opcode_t) b[-2] == charset_not
+ && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
+ SET_LIST_BIT ('\n');
+
+ /* Read in characters and ranges, setting map bits. */
+ for (;;)
+ {
+ if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
+
+ PATFETCH (c);
+
+ /* \ might escape characters inside [...] and [^...]. */
+ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
+ {
+ if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
+
+ PATFETCH (c1);
+ SET_LIST_BIT (c1);
+ continue;
+ }
+
+ /* Could be the end of the bracket expression. If it's
+ not (i.e., when the bracket expression is `[]' so
+ far), the ']' character bit gets set way below. */
+ if (c == ']' && p != p1 + 1)
+ break;
+
+ /* Look ahead to see if it's a range when the last thing
+ was a character class. */
+ if (had_char_class && c == '-' && *p != ']')
+ FREE_STACK_RETURN (REG_ERANGE);
+
+ /* Look ahead to see if it's a range when the last thing
+ was a character: if this is a hyphen not at the
+ beginning or the end of a list, then it's the range
+ operator. */
+ if (c == '-'
+ && !(p - 2 >= pattern && p[-2] == '[')
+ && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
+ && *p != ']')
+ {
+ reg_errcode_t ret
+ = compile_range (&p, pend, translate, syntax, b);
+ if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
+ }
+
+ else if (p[0] == '-' && p[1] != ']')
+ { /* This handles ranges made up of characters only. */
+ reg_errcode_t ret;
+
+ /* Move past the `-'. */
+ PATFETCH (c1);
+
+ ret = compile_range (&p, pend, translate, syntax, b);
+ if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
+ }
+
+ /* See if we're at the beginning of a possible character
+ class. */
+
+ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
+ { /* Leave room for the null. */
+ char str[CHAR_CLASS_MAX_LENGTH + 1];
+
+ PATFETCH (c);
+ c1 = 0;
+
+ /* If pattern is `[[:'. */
+ if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
+
+ for (;;)
+ {
+ PATFETCH (c);
+ if ((c == ':' && *p == ']') || p == pend)
+ break;
+ if (c1 < CHAR_CLASS_MAX_LENGTH)
+ str[c1++] = c;
+ else
+ /* This is in any case an invalid class name. */
+ str[0] = '\0';
+ }
+ str[c1] = '\0';
+
+ /* If isn't a word bracketed by `[:' and `:]':
+ undo the ending character, the letters, and leave
+ the leading `:' and `[' (but set bits for them). */
+ if (c == ':' && *p == ']')
+ {
+#if defined _LIBC || WIDE_CHAR_SUPPORT
+ boolean is_lower = STREQ (str, "lower");
+ boolean is_upper = STREQ (str, "upper");
+ wctype_t wt;
+ int ch;
+
+ wt = IS_CHAR_CLASS (str);
+ if (wt == 0)
+ FREE_STACK_RETURN (REG_ECTYPE);
+
+ /* Throw away the ] at the end of the character
+ class. */
+ PATFETCH (c);
+
+ if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
+ {
+# ifdef _LIBC
+ if (__iswctype (__btowc (ch), wt))
+ SET_LIST_BIT (ch);
+# else
+ if (iswctype (btowc (ch), wt))
+ SET_LIST_BIT (ch);
+# endif
+
+ if (translate && (is_upper || is_lower)
+ && (ISUPPER (ch) || ISLOWER (ch)))
+ SET_LIST_BIT (ch);
+ }
+
+ had_char_class = true;
+#else
+ int ch;
+ boolean is_alnum = STREQ (str, "alnum");
+ boolean is_alpha = STREQ (str, "alpha");
+ boolean is_blank = STREQ (str, "blank");
+ boolean is_cntrl = STREQ (str, "cntrl");
+ boolean is_digit = STREQ (str, "digit");
+ boolean is_graph = STREQ (str, "graph");
+ boolean is_lower = STREQ (str, "lower");
+ boolean is_print = STREQ (str, "print");
+ boolean is_punct = STREQ (str, "punct");
+ boolean is_space = STREQ (str, "space");
+ boolean is_upper = STREQ (str, "upper");
+ boolean is_xdigit = STREQ (str, "xdigit");
+
+ if (!IS_CHAR_CLASS (str))
+ FREE_STACK_RETURN (REG_ECTYPE);
+
+ /* Throw away the ] at the end of the character
+ class. */
+ PATFETCH (c);
+
+ if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
+ {
+ /* This was split into 3 if's to
+ avoid an arbitrary limit in some compiler. */
+ if ( (is_alnum && ISALNUM (ch))
+ || (is_alpha && ISALPHA (ch))
+ || (is_blank && ISBLANK (ch))
+ || (is_cntrl && ISCNTRL (ch)))
+ SET_LIST_BIT (ch);
+ if ( (is_digit && ISDIGIT (ch))
+ || (is_graph && ISGRAPH (ch))
+ || (is_lower && ISLOWER (ch))
+ || (is_print && ISPRINT (ch)))
+ SET_LIST_BIT (ch);
+ if ( (is_punct && ISPUNCT (ch))
+ || (is_space && ISSPACE (ch))
+ || (is_upper && ISUPPER (ch))
+ || (is_xdigit && ISXDIGIT (ch)))
+ SET_LIST_BIT (ch);
+ if ( translate && (is_upper || is_lower)
+ && (ISUPPER (ch) || ISLOWER (ch)))
+ SET_LIST_BIT (ch);
+ }
+ had_char_class = true;
+#endif /* libc || wctype.h */
+ }
+ else
+ {
+ c1++;
+ while (c1--)
+ PATUNFETCH;
+ SET_LIST_BIT ('[');
+ SET_LIST_BIT (':');
+ had_char_class = false;
+ }
+ }
+ else
+ {
+ had_char_class = false;
+ SET_LIST_BIT (c);
+ }
+ }
+
+ /* Discard any (non)matching list bytes that are all 0 at the
+ end of the map. Decrease the map-length byte too. */
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ b += b[-1];
+ }
+ break;
+
+
+ case '(':
+ if (syntax & RE_NO_BK_PARENS)
+ goto handle_open;
+ else
+ goto normal_char;
+
+
+ case ')':
+ if (syntax & RE_NO_BK_PARENS)
+ goto handle_close;
+ else
+ goto normal_char;
+
+
+ case '\n':
+ if (syntax & RE_NEWLINE_ALT)
+ goto handle_alt;
+ else
+ goto normal_char;
+
+
+ case '|':
+ if (syntax & RE_NO_BK_VBAR)
+ goto handle_alt;
+ else
+ goto normal_char;
+
+
+ case '{':
+ if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES)
+ goto handle_interval;
+ else
+ goto normal_char;
+
+
+ case '\\':
+ if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
+
+ /* Do not translate the character after the \, so that we can
+ distinguish, e.g., \B from \b, even if we normally would
+ translate, e.g., B to b. */
+ PATFETCH_RAW (c);
+
+ switch (c)
+ {
+ case '(':
+ if (syntax & RE_NO_BK_PARENS)
+ goto normal_backslash;
+
+ handle_open:
+ bufp->re_nsub++;
+ regnum++;
+
+ if (COMPILE_STACK_FULL)
+ {
+ RETALLOC (compile_stack.stack, compile_stack.size << 1,
+ compile_stack_elt_t);
+ if (compile_stack.stack == NULL) return REG_ESPACE;
+
+ compile_stack.size <<= 1;
+ }
+
+ /* These are the values to restore when we hit end of this
+ group. They are all relative offsets, so that if the
+ whole pattern moves because of realloc, they will still
+ be valid. */
+ COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
+ COMPILE_STACK_TOP.fixup_alt_jump
+ = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
+ COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
+ COMPILE_STACK_TOP.regnum = regnum;
+
+ /* We will eventually replace the 0 with the number of
+ groups inner to this one. But do not push a
+ start_memory for groups beyond the last one we can
+ represent in the compiled pattern. */
+ if (regnum <= MAX_REGNUM)
+ {
+ COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
+ BUF_PUSH_3 (start_memory, regnum, 0);
+ }
+
+ compile_stack.avail++;
+
+ fixup_alt_jump = 0;
+ laststart = 0;
+ begalt = b;
+ /* If we've reached MAX_REGNUM groups, then this open
+ won't actually generate any code, so we'll have to
+ clear pending_exact explicitly. */
+ pending_exact = 0;
+ break;
+
+
+ case ')':
+ if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
+
+ if (COMPILE_STACK_EMPTY)
+ {
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ goto normal_backslash;
+ else
+ FREE_STACK_RETURN (REG_ERPAREN);
+ }
+
+ handle_close:
+ if (fixup_alt_jump)
+ { /* Push a dummy failure point at the end of the
+ alternative for a possible future
+ `pop_failure_jump' to pop. See comments at
+ `push_dummy_failure' in `re_match_2'. */
+ BUF_PUSH (push_dummy_failure);
+
+ /* We allocated space for this jump when we assigned
+ to `fixup_alt_jump', in the `handle_alt' case below. */
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
+ }
+
+ /* See similar code for backslashed left paren above. */
+ if (COMPILE_STACK_EMPTY)
+ {
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ goto normal_char;
+ else
+ FREE_STACK_RETURN (REG_ERPAREN);
+ }
+
+ /* Since we just checked for an empty stack above, this
+ ``can't happen''. */
+ assert (compile_stack.avail != 0);
+ {
+ /* We don't just want to restore into `regnum', because
+ later groups should continue to be numbered higher,
+ as in `(ab)c(de)' -- the second group is #2. */
+ regnum_t this_group_regnum;
+
+ compile_stack.avail--;
+ begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
+ fixup_alt_jump
+ = COMPILE_STACK_TOP.fixup_alt_jump
+ ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
+ : 0;
+ laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
+ this_group_regnum = COMPILE_STACK_TOP.regnum;
+ /* If we've reached MAX_REGNUM groups, then this open
+ won't actually generate any code, so we'll have to
+ clear pending_exact explicitly. */
+ pending_exact = 0;
+
+ /* We're at the end of the group, so now we know how many
+ groups were inside this one. */
+ if (this_group_regnum <= MAX_REGNUM)
+ {
+ unsigned char *inner_group_loc
+ = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
+
+ *inner_group_loc = regnum - this_group_regnum;
+ BUF_PUSH_3 (stop_memory, this_group_regnum,
+ regnum - this_group_regnum);
+ }
+ }
+ break;
+
+
+ case '|': /* `\|'. */
+ if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR)
+ goto normal_backslash;
+ handle_alt:
+ if (syntax & RE_LIMITED_OPS)
+ goto normal_char;
+
+ /* Insert before the previous alternative a jump which
+ jumps to this alternative if the former fails. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (on_failure_jump, begalt, b + 6);
+ pending_exact = 0;
+ b += 3;
+
+ /* The alternative before this one has a jump after it
+ which gets executed if it gets matched. Adjust that
+ jump so it will jump to this alternative's analogous
+ jump (put in below, which in turn will jump to the next
+ (if any) alternative's such jump, etc.). The last such
+ jump jumps to the correct final destination. A picture:
+ _____ _____
+ | | | |
+ | v | v
+ a | b | c
+
+ If we are at `b', then fixup_alt_jump right now points to a
+ three-byte space after `a'. We'll put in the jump, set
+ fixup_alt_jump to right after `b', and leave behind three
+ bytes which we'll fill in when we get to after `c'. */
+
+ if (fixup_alt_jump)
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
+
+ /* Mark and leave space for a jump after this alternative,
+ to be filled in later either by next alternative or
+ when know we're at the end of a series of alternatives. */
+ fixup_alt_jump = b;
+ GET_BUFFER_SPACE (3);
+ b += 3;
+
+ laststart = 0;
+ begalt = b;
+ break;
+
+
+ case '{':
+ /* If \{ is a literal. */
+ if (!(syntax & RE_INTERVALS)
+ /* If we're at `\{' and it's not the open-interval
+ operator. */
+ || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+ || (p - 2 == pattern && p == pend))
+ goto normal_backslash;
+
+ handle_interval:
+ {
+ /* If got here, then the syntax allows intervals. */
+
+ /* At least (most) this many matches must be made. */
+ int lower_bound = -1, upper_bound = -1;
+
+ beg_interval = p - 1;
+
+ if (p == pend)
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ FREE_STACK_RETURN (REG_EBRACE);
+ }
+
+ GET_UNSIGNED_NUMBER (lower_bound);
+
+ if (c == ',')
+ {
+ GET_UNSIGNED_NUMBER (upper_bound);
+ if (upper_bound < 0) upper_bound = RE_DUP_MAX;
+ }
+ else
+ /* Interval such as `{1}' => match exactly once. */
+ upper_bound = lower_bound;
+
+ if (lower_bound < 0 || upper_bound > RE_DUP_MAX
+ || lower_bound > upper_bound)
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ FREE_STACK_RETURN (REG_BADBR);
+ }
+
+ if (!(syntax & RE_NO_BK_BRACES))
+ {
+ if (c != '\\') FREE_STACK_RETURN (REG_EBRACE);
+
+ PATFETCH (c);
+ }
+
+ if (c != '}')
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ FREE_STACK_RETURN (REG_BADBR);
+ }
+
+ /* We just parsed a valid interval. */
+
+ /* If it's invalid to have no preceding re. */
+ if (!laststart)
+ {
+ if (syntax & RE_CONTEXT_INVALID_OPS)
+ FREE_STACK_RETURN (REG_BADRPT);
+ else if (syntax & RE_CONTEXT_INDEP_OPS)
+ laststart = b;
+ else
+ goto unfetch_interval;
+ }
+
+ /* If the upper bound is zero, don't want to succeed at
+ all; jump from `laststart' to `b + 3', which will be
+ the end of the buffer after we insert the jump. */
+ if (upper_bound == 0)
+ {
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (jump, laststart, b + 3);
+ b += 3;
+ }
+
+ /* Otherwise, we have a nontrivial interval. When
+ we're all done, the pattern will look like:
+ set_number_at <jump count> <upper bound>
+ set_number_at <succeed_n count> <lower bound>
+ succeed_n <after jump addr> <succeed_n count>
+ <body of loop>
+ jump_n <succeed_n addr> <jump count>
+ (The upper bound and `jump_n' are omitted if
+ `upper_bound' is 1, though.) */
+ else
+ { /* If the upper bound is > 1, we need to insert
+ more at the end of the loop. */
+ unsigned nbytes = 10 + (upper_bound > 1) * 10;
+
+ GET_BUFFER_SPACE (nbytes);
+
+ /* Initialize lower bound of the `succeed_n', even
+ though it will be set during matching by its
+ attendant `set_number_at' (inserted next),
+ because `re_compile_fastmap' needs to know.
+ Jump to the `jump_n' we might insert below. */
+ INSERT_JUMP2 (succeed_n, laststart,
+ b + 5 + (upper_bound > 1) * 5,
+ lower_bound);
+ b += 5;
+
+ /* Code to initialize the lower bound. Insert
+ before the `succeed_n'. The `5' is the last two
+ bytes of this `set_number_at', plus 3 bytes of
+ the following `succeed_n'. */
+ insert_op2 (set_number_at, laststart, 5, lower_bound, b);
+ b += 5;
+
+ if (upper_bound > 1)
+ { /* More than one repetition is allowed, so
+ append a backward jump to the `succeed_n'
+ that starts this interval.
+
+ When we've reached this during matching,
+ we'll have matched the interval once, so
+ jump back only `upper_bound - 1' times. */
+ STORE_JUMP2 (jump_n, b, laststart + 5,
+ upper_bound - 1);
+ b += 5;
+
+ /* The location we want to set is the second
+ parameter of the `jump_n'; that is `b-2' as
+ an absolute address. `laststart' will be
+ the `set_number_at' we're about to insert;
+ `laststart+3' the number to set, the source
+ for the relative address. But we are
+ inserting into the middle of the pattern --
+ so everything is getting moved up by 5.
+ Conclusion: (b - 2) - (laststart + 3) + 5,
+ i.e., b - laststart.
+
+ We insert this at the beginning of the loop
+ so that if we fail during matching, we'll
+ reinitialize the bounds. */
+ insert_op2 (set_number_at, laststart, b - laststart,
+ upper_bound - 1, b);
+ b += 5;
+ }
+ }
+ pending_exact = 0;
+ beg_interval = NULL;
+ }
+ break;
+
+ unfetch_interval:
+ /* If an invalid interval, match the characters as literals. */
+ assert (beg_interval);
+ p = beg_interval;
+ beg_interval = NULL;
+
+ /* normal_char and normal_backslash need `c'. */
+ PATFETCH (c);
+
+ if (!(syntax & RE_NO_BK_BRACES))
+ {
+ if (p > pattern && p[-1] == '\\')
+ goto normal_backslash;
+ }
+ goto normal_char;
+
+#ifdef emacs
+ /* There is no way to specify the before_dot and after_dot
+ operators. rms says this is ok. --karl */
+ case '=':
+ BUF_PUSH (at_dot);
+ break;
+
+ case 's':
+ laststart = b;
+ PATFETCH (c);
+ BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
+ break;
+
+ case 'S':
+ laststart = b;
+ PATFETCH (c);
+ BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]);
+ break;
+#endif /* emacs */
+
+
+ case 'w':
+ if (syntax & RE_NO_GNU_OPS)
+ goto normal_char;
+ laststart = b;
+ BUF_PUSH (wordchar);
+ break;
+
+
+ case 'W':
+ if (syntax & RE_NO_GNU_OPS)
+ goto normal_char;
+ laststart = b;
+ BUF_PUSH (notwordchar);
+ break;
+
+
+ case '<':
+ if (syntax & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (wordbeg);
+ break;
+
+ case '>':
+ if (syntax & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (wordend);
+ break;
+
+ case 'b':
+ if (syntax & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (wordbound);
+ break;
+
+ case 'B':
+ if (syntax & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (notwordbound);
+ break;
+
+ case '`':
+ if (syntax & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (begbuf);
+ break;
+
+ case '\'':
+ if (syntax & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (endbuf);
+ break;
+
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ if (syntax & RE_NO_BK_REFS)
+ goto normal_char;
+
+ c1 = c - '0';
+
+ if (c1 > regnum)
+ FREE_STACK_RETURN (REG_ESUBREG);
+
+ /* Can't back reference to a subexpression if inside of it. */
+ if (group_in_compile_stack (compile_stack, (regnum_t) c1))
+ goto normal_char;
+
+ laststart = b;
+ BUF_PUSH_2 (duplicate, c1);
+ break;
+
+
+ case '+':
+ case '?':
+ if (syntax & RE_BK_PLUS_QM)
+ goto handle_plus;
+ else
+ goto normal_backslash;
+
+ default:
+ normal_backslash:
+ /* You might think it would be useful for \ to mean
+ not to translate; but if we don't translate it
+ it will never match anything. */
+ c = TRANSLATE (c);
+ goto normal_char;
+ }
+ break;
+
+
+ default:
+ /* Expects the character in `c'. */
+ normal_char:
+ /* If no exactn currently being built. */
+ if (!pending_exact
+
+ /* If last exactn not at current position. */
+ || pending_exact + *pending_exact + 1 != b
+
+ /* We have only one byte following the exactn for the count. */
+ || *pending_exact == (1 << BYTEWIDTH) - 1
+
+ /* If followed by a repetition operator. */
+ || *p == '*' || *p == '^'
+ || ((syntax & RE_BK_PLUS_QM)
+ ? *p == '\\' && (p[1] == '+' || p[1] == '?')
+ : (*p == '+' || *p == '?'))
+ || ((syntax & RE_INTERVALS)
+ && ((syntax & RE_NO_BK_BRACES)
+ ? *p == '{'
+ : (p[0] == '\\' && p[1] == '{'))))
+ {
+ /* Start building a new exactn. */
+
+ laststart = b;
+
+ BUF_PUSH_2 (exactn, 0);
+ pending_exact = b - 1;
+ }
+
+ BUF_PUSH (c);
+ (*pending_exact)++;
+ break;
+ } /* switch (c) */
+ } /* while p != pend */
+
+
+ /* Through the pattern now. */
+
+ if (fixup_alt_jump)
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
+
+ if (!COMPILE_STACK_EMPTY)
+ FREE_STACK_RETURN (REG_EPAREN);
+
+ /* If we don't want backtracking, force success
+ the first time we reach the end of the compiled pattern. */
+ if (syntax & RE_NO_POSIX_BACKTRACKING)
+ BUF_PUSH (succeed);
+
+ free (compile_stack.stack);
+
+ /* We have succeeded; set the length of the buffer. */
+ bufp->used = b - bufp->buffer;
+
+#ifdef DEBUG
+ if (debug)
+ {
+ DEBUG_PRINT1 ("\nCompiled pattern: \n");
+ print_compiled_pattern (bufp);
+ }
+#endif /* DEBUG */
+
+#ifndef MATCH_MAY_ALLOCATE
+ /* Initialize the failure stack to the largest possible stack. This
+ isn't necessary unless we're trying to avoid calling alloca in
+ the search and match routines. */
+ {
+ int num_regs = bufp->re_nsub + 1;
+
+ /* Since DOUBLE_FAIL_STACK refuses to double only if the current size
+ is strictly greater than re_max_failures, the largest possible stack
+ is 2 * re_max_failures failure points. */
+ if (fail_stack.size < (2 * re_max_failures * MAX_FAILURE_ITEMS))
+ {
+ fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS);
+
+# ifdef emacs
+ if (! fail_stack.stack)
+ fail_stack.stack
+ = (fail_stack_elt_t *) xmalloc (fail_stack.size
+ * sizeof (fail_stack_elt_t));
+ else
+ fail_stack.stack
+ = (fail_stack_elt_t *) xrealloc (fail_stack.stack,
+ (fail_stack.size
+ * sizeof (fail_stack_elt_t)));
+# else /* not emacs */
+ if (! fail_stack.stack)
+ fail_stack.stack
+ = (fail_stack_elt_t *) malloc (fail_stack.size
+ * sizeof (fail_stack_elt_t));
+ else
+ fail_stack.stack
+ = (fail_stack_elt_t *) realloc (fail_stack.stack,
+ (fail_stack.size
+ * sizeof (fail_stack_elt_t)));
+# endif /* not emacs */
+ }
+
+ regex_grow_registers (num_regs);
+ }
+#endif /* not MATCH_MAY_ALLOCATE */
+
+ return REG_NOERROR;
+} /* regex_compile */
+
+/* Subroutines for `regex_compile'. */
+
+/* Store OP at LOC followed by two-byte integer parameter ARG. */
+
+static void
+store_op1 (op, loc, arg)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg;
+{
+ *loc = (unsigned char) op;
+ STORE_NUMBER (loc + 1, arg);
+}
+
+
+/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */
+
+static void
+store_op2 (op, loc, arg1, arg2)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg1, arg2;
+{
+ *loc = (unsigned char) op;
+ STORE_NUMBER (loc + 1, arg1);
+ STORE_NUMBER (loc + 3, arg2);
+}
+
+
+/* Copy the bytes from LOC to END to open up three bytes of space at LOC
+ for OP followed by two-byte integer parameter ARG. */
+
+static void
+insert_op1 (op, loc, arg, end)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg;
+ unsigned char *end;
+{
+ register unsigned char *pfrom = end;
+ register unsigned char *pto = end + 3;
+
+ while (pfrom != loc)
+ *--pto = *--pfrom;
+
+ store_op1 (op, loc, arg);
+}
+
+
+/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */
+
+static void
+insert_op2 (op, loc, arg1, arg2, end)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg1, arg2;
+ unsigned char *end;
+{
+ register unsigned char *pfrom = end;
+ register unsigned char *pto = end + 5;
+
+ while (pfrom != loc)
+ *--pto = *--pfrom;
+
+ store_op2 (op, loc, arg1, arg2);
+}
+
+
+/* P points to just after a ^ in PATTERN. Return true if that ^ comes
+ after an alternative or a begin-subexpression. We assume there is at
+ least one character before the ^. */
+
+static boolean
+at_begline_loc_p (pattern, p, syntax)
+ const char *pattern, *p;
+ reg_syntax_t syntax;
+{
+ const char *prev = p - 2;
+ boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
+
+ return
+ /* After a subexpression? */
+ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
+ /* After an alternative? */
+ || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
+}
+
+
+/* The dual of at_begline_loc_p. This one is for $. We assume there is
+ at least one character after the $, i.e., `P < PEND'. */
+
+static boolean
+at_endline_loc_p (p, pend, syntax)
+ const char *p, *pend;
+ reg_syntax_t syntax;
+{
+ const char *next = p;
+ boolean next_backslash = *next == '\\';
+ const char *next_next = p + 1 < pend ? p + 1 : 0;
+
+ return
+ /* Before a subexpression? */
+ (syntax & RE_NO_BK_PARENS ? *next == ')'
+ : next_backslash && next_next && *next_next == ')')
+ /* Before an alternative? */
+ || (syntax & RE_NO_BK_VBAR ? *next == '|'
+ : next_backslash && next_next && *next_next == '|');
+}
+
+
+/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
+ false if it's not. */
+
+static boolean
+group_in_compile_stack (compile_stack, regnum)
+ compile_stack_type compile_stack;
+ regnum_t regnum;
+{
+ int this_element;
+
+ for (this_element = compile_stack.avail - 1;
+ this_element >= 0;
+ this_element--)
+ if (compile_stack.stack[this_element].regnum == regnum)
+ return true;
+
+ return false;
+}
+
+
+/* Read the ending character of a range (in a bracket expression) from the
+ uncompiled pattern *P_PTR (which ends at PEND). We assume the
+ starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
+ Then we set the translation of all bits between the starting and
+ ending characters (inclusive) in the compiled pattern B.
+
+ Return an error code.
+
+ We use these short variable names so we can use the same macros as
+ `regex_compile' itself. */
+
+static reg_errcode_t
+compile_range (p_ptr, pend, translate, syntax, b)
+ const char **p_ptr, *pend;
+ RE_TRANSLATE_TYPE translate;
+ reg_syntax_t syntax;
+ unsigned char *b;
+{
+ unsigned this_char;
+
+ const char *p = *p_ptr;
+ unsigned int range_start, range_end;
+
+ if (p == pend)
+ return REG_ERANGE;
+
+ /* Even though the pattern is a signed `char *', we need to fetch
+ with unsigned char *'s; if the high bit of the pattern character
+ is set, the range endpoints will be negative if we fetch using a
+ signed char *.
+
+ We also want to fetch the endpoints without translating them; the
+ appropriate translation is done in the bit-setting loop below. */
+ /* The SVR4 compiler on the 3B2 had trouble with unsigned const char *. */
+ range_start = ((const unsigned char *) p)[-2];
+ range_end = ((const unsigned char *) p)[0];
+
+ /* Have to increment the pointer into the pattern string, so the
+ caller isn't still at the ending character. */
+ (*p_ptr)++;
+
+ /* If the start is after the end, the range is empty. */
+ if (range_start > range_end)
+ return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
+
+ /* Here we see why `this_char' has to be larger than an `unsigned
+ char' -- the range is inclusive, so if `range_end' == 0xff
+ (assuming 8-bit characters), we would otherwise go into an infinite
+ loop, since all characters <= 0xff. */
+ for (this_char = range_start; this_char <= range_end; this_char++)
+ {
+ SET_LIST_BIT (TRANSLATE (this_char));
+ }
+
+ return REG_NOERROR;
+}
+
+/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
+ BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible
+ characters can start a string that matches the pattern. This fastmap
+ is used by re_search to skip quickly over impossible starting points.
+
+ The caller must supply the address of a (1 << BYTEWIDTH)-byte data
+ area as BUFP->fastmap.
+
+ We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
+ the pattern buffer.
+
+ Returns 0 if we succeed, -2 if an internal error. */
+
+int
+re_compile_fastmap (bufp)
+ struct re_pattern_buffer *bufp;
+{
+ int j, k;
+#ifdef MATCH_MAY_ALLOCATE
+ fail_stack_type fail_stack;
+#endif
+#ifndef REGEX_MALLOC
+ char *destination;
+#endif
+
+ register char *fastmap = bufp->fastmap;
+ unsigned char *pattern = bufp->buffer;
+ unsigned char *p = pattern;
+ register unsigned char *pend = pattern + bufp->used;
+
+#ifdef REL_ALLOC
+ /* This holds the pointer to the failure stack, when
+ it is allocated relocatably. */
+ fail_stack_elt_t *failure_stack_ptr;
+#endif
+
+ /* Assume that each path through the pattern can be null until
+ proven otherwise. We set this false at the bottom of switch
+ statement, to which we get only if a particular path doesn't
+ match the empty string. */
+ boolean path_can_be_null = true;
+
+ /* We aren't doing a `succeed_n' to begin with. */
+ boolean succeed_n_p = false;
+
+ assert (fastmap != NULL && p != NULL);
+
+ INIT_FAIL_STACK ();
+ bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
+ bufp->fastmap_accurate = 1; /* It will be when we're done. */
+ bufp->can_be_null = 0;
+
+ while (1)
+ {
+ if (p == pend || *p == succeed)
+ {
+ /* We have reached the (effective) end of pattern. */
+ if (!FAIL_STACK_EMPTY ())
+ {
+ bufp->can_be_null |= path_can_be_null;
+
+ /* Reset for next path. */
+ path_can_be_null = true;
+
+ p = fail_stack.stack[--fail_stack.avail].pointer;
+
+ continue;
+ }
+ else
+ break;
+ }
+
+ /* We should never be about to go beyond the end of the pattern. */
+ assert (p < pend);
+
+ switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
+ {
+
+ /* I guess the idea here is to simply not bother with a fastmap
+ if a backreference is used, since it's too hard to figure out
+ the fastmap for the corresponding group. Setting
+ `can_be_null' stops `re_search_2' from using the fastmap, so
+ that is all we do. */
+ case duplicate:
+ bufp->can_be_null = 1;
+ goto done;
+
+
+ /* Following are the cases which match a character. These end
+ with `break'. */
+
+ case exactn:
+ fastmap[p[1]] = 1;
+ break;
+
+
+ case charset:
+ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+ if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
+ fastmap[j] = 1;
+ break;
+
+
+ case charset_not:
+ /* Chars beyond end of map must be allowed. */
+ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
+ fastmap[j] = 1;
+
+ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+ if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
+ fastmap[j] = 1;
+ break;
+
+
+ case wordchar:
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) == Sword)
+ fastmap[j] = 1;
+ break;
+
+
+ case notwordchar:
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) != Sword)
+ fastmap[j] = 1;
+ break;
+
+
+ case anychar:
+ {
+ int fastmap_newline = fastmap['\n'];
+
+ /* `.' matches anything ... */
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ fastmap[j] = 1;
+
+ /* ... except perhaps newline. */
+ if (!(bufp->syntax & RE_DOT_NEWLINE))
+ fastmap['\n'] = fastmap_newline;
+
+ /* Return if we have already set `can_be_null'; if we have,
+ then the fastmap is irrelevant. Something's wrong here. */
+ else if (bufp->can_be_null)
+ goto done;
+
+ /* Otherwise, have to check alternative paths. */
+ break;
+ }
+
+#ifdef emacs
+ case syntaxspec:
+ k = *p++;
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) == (enum syntaxcode) k)
+ fastmap[j] = 1;
+ break;
+
+
+ case notsyntaxspec:
+ k = *p++;
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) != (enum syntaxcode) k)
+ fastmap[j] = 1;
+ break;
+
+
+ /* All cases after this match the empty string. These end with
+ `continue'. */
+
+
+ case before_dot:
+ case at_dot:
+ case after_dot:
+ continue;
+#endif /* emacs */
+
+
+ case no_op:
+ case begline:
+ case endline:
+ case begbuf:
+ case endbuf:
+ case wordbound:
+ case notwordbound:
+ case wordbeg:
+ case wordend:
+ case push_dummy_failure:
+ continue;
+
+
+ case jump_n:
+ case pop_failure_jump:
+ case maybe_pop_jump:
+ case jump:
+ case jump_past_alt:
+ case dummy_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (j, p);
+ p += j;
+ if (j > 0)
+ continue;
+
+ /* Jump backward implies we just went through the body of a
+ loop and matched nothing. Opcode jumped to should be
+ `on_failure_jump' or `succeed_n'. Just treat it like an
+ ordinary jump. For a * loop, it has pushed its failure
+ point already; if so, discard that as redundant. */
+ if ((re_opcode_t) *p != on_failure_jump
+ && (re_opcode_t) *p != succeed_n)
+ continue;
+
+ p++;
+ EXTRACT_NUMBER_AND_INCR (j, p);
+ p += j;
+
+ /* If what's on the stack is where we are now, pop it. */
+ if (!FAIL_STACK_EMPTY ()
+ && fail_stack.stack[fail_stack.avail - 1].pointer == p)
+ fail_stack.avail--;
+
+ continue;
+
+
+ case on_failure_jump:
+ case on_failure_keep_string_jump:
+ handle_on_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (j, p);
+
+ /* For some patterns, e.g., `(a?)?', `p+j' here points to the
+ end of the pattern. We don't want to push such a point,
+ since when we restore it above, entering the switch will
+ increment `p' past the end of the pattern. We don't need
+ to push such a point since we obviously won't find any more
+ fastmap entries beyond `pend'. Such a pattern can match
+ the null string, though. */
+ if (p + j < pend)
+ {
+ if (!PUSH_PATTERN_OP (p + j, fail_stack))
+ {
+ RESET_FAIL_STACK ();
+ return -2;
+ }
+ }
+ else
+ bufp->can_be_null = 1;
+
+ if (succeed_n_p)
+ {
+ EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */
+ succeed_n_p = false;
+ }
+
+ continue;
+
+
+ case succeed_n:
+ /* Get to the number of times to succeed. */
+ p += 2;
+
+ /* Increment p past the n for when k != 0. */
+ EXTRACT_NUMBER_AND_INCR (k, p);
+ if (k == 0)
+ {
+ p -= 4;
+ succeed_n_p = true; /* Spaghetti code alert. */
+ goto handle_on_failure_jump;
+ }
+ continue;
+
+
+ case set_number_at:
+ p += 4;
+ continue;
+
+
+ case start_memory:
+ case stop_memory:
+ p += 2;
+ continue;
+
+
+ default:
+ abort (); /* We have listed all the cases. */
+ } /* switch *p++ */
+
+ /* Getting here means we have found the possible starting
+ characters for one path of the pattern -- and that the empty
+ string does not match. We need not follow this path further.
+ Instead, look at the next alternative (remembered on the
+ stack), or quit if no more. The test at the top of the loop
+ does these things. */
+ path_can_be_null = false;
+ p = pend;
+ } /* while p */
+
+ /* Set `can_be_null' for the last path (also the first path, if the
+ pattern is empty). */
+ bufp->can_be_null |= path_can_be_null;
+
+ done:
+ RESET_FAIL_STACK ();
+ return 0;
+} /* re_compile_fastmap */
+#ifdef _LIBC
+weak_alias (__re_compile_fastmap, re_compile_fastmap)
+#endif
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
+ this memory for recording register information. STARTS and ENDS
+ must be allocated using the malloc library routine, and must each
+ be at least NUM_REGS * sizeof (regoff_t) bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+
+void
+re_set_registers (bufp, regs, num_regs, starts, ends)
+ struct re_pattern_buffer *bufp;
+ struct re_registers *regs;
+ unsigned num_regs;
+ regoff_t *starts, *ends;
+{
+ if (num_regs)
+ {
+ bufp->regs_allocated = REGS_REALLOCATE;
+ regs->num_regs = num_regs;
+ regs->start = starts;
+ regs->end = ends;
+ }
+ else
+ {
+ bufp->regs_allocated = REGS_UNALLOCATED;
+ regs->num_regs = 0;
+ regs->start = regs->end = (regoff_t *) 0;
+ }
+}
+#ifdef _LIBC
+weak_alias (__re_set_registers, re_set_registers)
+#endif
+
+/* Searching routines. */
+
+/* Like re_search_2, below, but only one string is specified, and
+ doesn't let you say where to stop matching. */
+
+int
+re_search (bufp, string, size, startpos, range, regs)
+ struct re_pattern_buffer *bufp;
+ const char *string;
+ int size, startpos, range;
+ struct re_registers *regs;
+{
+ return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
+ regs, size);
+}
+#ifdef _LIBC
+weak_alias (__re_search, re_search)
+#endif
+
+
+/* Using the compiled pattern in BUFP->buffer, first tries to match the
+ virtual concatenation of STRING1 and STRING2, starting first at index
+ STARTPOS, then at STARTPOS + 1, and so on.
+
+ STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
+
+ RANGE is how far to scan while trying to match. RANGE = 0 means try
+ only at STARTPOS; in general, the last start tried is STARTPOS +
+ RANGE.
+
+ In REGS, return the indices of the virtual concatenation of STRING1
+ and STRING2 that matched the entire BUFP->buffer and its contained
+ subexpressions.
+
+ Do not consider matching one past the index STOP in the virtual
+ concatenation of STRING1 and STRING2.
+
+ We return either the position in the strings at which the match was
+ found, -1 if no match, or -2 if error (such as failure
+ stack overflow). */
+
+int
+re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
+ struct re_pattern_buffer *bufp;
+ const char *string1, *string2;
+ int size1, size2;
+ int startpos;
+ int range;
+ struct re_registers *regs;
+ int stop;
+{
+ int val;
+ register char *fastmap = bufp->fastmap;
+ register RE_TRANSLATE_TYPE translate = bufp->translate;
+ int total_size = size1 + size2;
+ int endpos = startpos + range;
+
+ /* Check for out-of-range STARTPOS. */
+ if (startpos < 0 || startpos > total_size)
+ return -1;
+
+ /* Fix up RANGE if it might eventually take us outside
+ the virtual concatenation of STRING1 and STRING2.
+ Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE. */
+ if (endpos < 0)
+ range = 0 - startpos;
+ else if (endpos > total_size)
+ range = total_size - startpos;
+
+ /* If the search isn't to be a backwards one, don't waste time in a
+ search for a pattern that must be anchored. */
+ if (bufp->used > 0 && range > 0
+ && ((re_opcode_t) bufp->buffer[0] == begbuf
+ /* `begline' is like `begbuf' if it cannot match at newlines. */
+ || ((re_opcode_t) bufp->buffer[0] == begline
+ && !bufp->newline_anchor)))
+ {
+ if (startpos > 0)
+ return -1;
+ else
+ range = 1;
+ }
+
+#ifdef emacs
+ /* In a forward search for something that starts with \=.
+ don't keep searching past point. */
+ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0)
+ {
+ range = PT - startpos;
+ if (range <= 0)
+ return -1;
+ }
+#endif /* emacs */
+
+ /* Update the fastmap now if not correct already. */
+ if (fastmap && !bufp->fastmap_accurate)
+ if (re_compile_fastmap (bufp) == -2)
+ return -2;
+
+ /* Loop through the string, looking for a place to start matching. */
+ for (;;)
+ {
+ /* If a fastmap is supplied, skip quickly over characters that
+ cannot be the start of a match. If the pattern can match the
+ null string, however, we don't need to skip characters; we want
+ the first null string. */
+ if (fastmap && startpos < total_size && !bufp->can_be_null)
+ {
+ if (range > 0) /* Searching forwards. */
+ {
+ register const char *d;
+ register int lim = 0;
+ int irange = range;
+
+ if (startpos < size1 && startpos + range >= size1)
+ lim = range - (size1 - startpos);
+
+ d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
+
+ /* Written out as an if-else to avoid testing `translate'
+ inside the loop. */
+ if (translate)
+ while (range > lim
+ && !fastmap[(unsigned char)
+ translate[(unsigned char) *d++]])
+ range--;
+ else
+ while (range > lim && !fastmap[(unsigned char) *d++])
+ range--;
+
+ startpos += irange - range;
+ }
+ else /* Searching backwards. */
+ {
+ register char c = (size1 == 0 || startpos >= size1
+ ? string2[startpos - size1]
+ : string1[startpos]);
+
+ if (!fastmap[(unsigned char) TRANSLATE (c)])
+ goto advance;
+ }
+ }
+
+ /* If can't match the null string, and that's all we have left, fail. */
+ if (range >= 0 && startpos == total_size && fastmap
+ && !bufp->can_be_null)
+ return -1;
+
+ val = re_match_2_internal (bufp, string1, size1, string2, size2,
+ startpos, regs, stop);
+#ifndef REGEX_MALLOC
+# ifdef C_ALLOCA
+ alloca (0);
+# endif
+#endif
+
+ if (val >= 0)
+ return startpos;
+
+ if (val == -2)
+ return -2;
+
+ advance:
+ if (!range)
+ break;
+ else if (range > 0)
+ {
+ range--;
+ startpos++;
+ }
+ else
+ {
+ range++;
+ startpos--;
+ }
+ }
+ return -1;
+} /* re_search_2 */
+#ifdef _LIBC
+weak_alias (__re_search_2, re_search_2)
+#endif
+
+/* This converts PTR, a pointer into one of the search strings `string1'
+ and `string2' into an offset from the beginning of that string. */
+#define POINTER_TO_OFFSET(ptr) \
+ (FIRST_STRING_P (ptr) \
+ ? ((regoff_t) ((ptr) - string1)) \
+ : ((regoff_t) ((ptr) - string2 + size1)))
+
+/* Macros for dealing with the split strings in re_match_2. */
+
+#define MATCHING_IN_FIRST_STRING (dend == end_match_1)
+
+/* Call before fetching a character with *d. This switches over to
+ string2 if necessary. */
+#define PREFETCH() \
+ while (d == dend) \
+ { \
+ /* End of string2 => fail. */ \
+ if (dend == end_match_2) \
+ goto fail; \
+ /* End of string1 => advance to string2. */ \
+ d = string2; \
+ dend = end_match_2; \
+ }
+
+
+/* Test if at very beginning or at very end of the virtual concatenation
+ of `string1' and `string2'. If only one string, it's `string2'. */
+#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
+#define AT_STRINGS_END(d) ((d) == end2)
+
+
+/* Test if D points to a character which is word-constituent. We have
+ two special cases to check for: if past the end of string1, look at
+ the first character in string2; and if before the beginning of
+ string2, look at the last character in string1. */
+#define WORDCHAR_P(d) \
+ (SYNTAX ((d) == end1 ? *string2 \
+ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
+ == Sword)
+
+/* Disabled due to a compiler bug -- see comment at case wordbound */
+#if 0
+/* Test if the character before D and the one at D differ with respect
+ to being word-constituent. */
+#define AT_WORD_BOUNDARY(d) \
+ (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \
+ || WORDCHAR_P (d - 1) != WORDCHAR_P (d))
+#endif
+
+/* Free everything we malloc. */
+#ifdef MATCH_MAY_ALLOCATE
+# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
+# define FREE_VARIABLES() \
+ do { \
+ REGEX_FREE_STACK (fail_stack.stack); \
+ FREE_VAR (regstart); \
+ FREE_VAR (regend); \
+ FREE_VAR (old_regstart); \
+ FREE_VAR (old_regend); \
+ FREE_VAR (best_regstart); \
+ FREE_VAR (best_regend); \
+ FREE_VAR (reg_info); \
+ FREE_VAR (reg_dummy); \
+ FREE_VAR (reg_info_dummy); \
+ } while (0)
+#else
+# define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */
+#endif /* not MATCH_MAY_ALLOCATE */
+
+/* These values must meet several constraints. They must not be valid
+ register values; since we have a limit of 255 registers (because
+ we use only one byte in the pattern for the register number), we can
+ use numbers larger than 255. They must differ by 1, because of
+ NUM_FAILURE_ITEMS above. And the value for the lowest register must
+ be larger than the value for the highest register, so we do not try
+ to actually save any registers when none are active. */
+#define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH)
+#define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1)
+
+/* Matching routines. */
+
+#ifndef emacs /* Emacs never uses this. */
+/* re_match is like re_match_2 except it takes only a single string. */
+
+int
+re_match (bufp, string, size, pos, regs)
+ struct re_pattern_buffer *bufp;
+ const char *string;
+ int size, pos;
+ struct re_registers *regs;
+{
+ int result = re_match_2_internal (bufp, NULL, 0, string, size,
+ pos, regs, size);
+# ifndef REGEX_MALLOC
+# ifdef C_ALLOCA
+ alloca (0);
+# endif
+# endif
+ return result;
+}
+# ifdef _LIBC
+weak_alias (__re_match, re_match)
+# endif
+#endif /* not emacs */
+
+static boolean group_match_null_string_p _RE_ARGS ((unsigned char **p,
+ unsigned char *end,
+ register_info_type *reg_info));
+static boolean alt_match_null_string_p _RE_ARGS ((unsigned char *p,
+ unsigned char *end,
+ register_info_type *reg_info));
+static boolean common_op_match_null_string_p _RE_ARGS ((unsigned char **p,
+ unsigned char *end,
+ register_info_type *reg_info));
+static int bcmp_translate _RE_ARGS ((const char *s1, const char *s2,
+ int len, char *translate));
+
+/* re_match_2 matches the compiled pattern in BUFP against the
+ the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
+ and SIZE2, respectively). We start matching at POS, and stop
+ matching at STOP.
+
+ If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
+ store offsets for the substring each group matched in REGS. See the
+ documentation for exactly how many groups we fill.
+
+ We return -1 if no match, -2 if an internal error (such as the
+ failure stack overflowing). Otherwise, we return the length of the
+ matched substring. */
+
+int
+re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
+ struct re_pattern_buffer *bufp;
+ const char *string1, *string2;
+ int size1, size2;
+ int pos;
+ struct re_registers *regs;
+ int stop;
+{
+ int result = re_match_2_internal (bufp, string1, size1, string2, size2,
+ pos, regs, stop);
+#ifndef REGEX_MALLOC
+# ifdef C_ALLOCA
+ alloca (0);
+# endif
+#endif
+ return result;
+}
+#ifdef _LIBC
+weak_alias (__re_match_2, re_match_2)
+#endif
+
+/* This is a separate function so that we can force an alloca cleanup
+ afterwards. */
+static int
+re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
+ struct re_pattern_buffer *bufp;
+ const char *string1, *string2;
+ int size1, size2;
+ int pos;
+ struct re_registers *regs;
+ int stop;
+{
+ /* General temporaries. */
+ int mcnt;
+ unsigned char *p1;
+
+ /* Just past the end of the corresponding string. */
+ const char *end1, *end2;
+
+ /* Pointers into string1 and string2, just past the last characters in
+ each to consider matching. */
+ const char *end_match_1, *end_match_2;
+
+ /* Where we are in the data, and the end of the current string. */
+ const char *d, *dend;
+
+ /* Where we are in the pattern, and the end of the pattern. */
+ unsigned char *p = bufp->buffer;
+ register unsigned char *pend = p + bufp->used;
+
+ /* Mark the opcode just after a start_memory, so we can test for an
+ empty subpattern when we get to the stop_memory. */
+ unsigned char *just_past_start_mem = 0;
+
+ /* We use this to map every character in the string. */
+ RE_TRANSLATE_TYPE translate = bufp->translate;
+
+ /* Failure point stack. Each place that can handle a failure further
+ down the line pushes a failure point on this stack. It consists of
+ restart, regend, and reg_info for all registers corresponding to
+ the subexpressions we're currently inside, plus the number of such
+ registers, and, finally, two char *'s. The first char * is where
+ to resume scanning the pattern; the second one is where to resume
+ scanning the strings. If the latter is zero, the failure point is
+ a ``dummy''; if a failure happens and the failure point is a dummy,
+ it gets discarded and the next next one is tried. */
+#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */
+ fail_stack_type fail_stack;
+#endif
+#ifdef DEBUG
+ static unsigned failure_id;
+ unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
+#endif
+
+#ifdef REL_ALLOC
+ /* This holds the pointer to the failure stack, when
+ it is allocated relocatably. */
+ fail_stack_elt_t *failure_stack_ptr;
+#endif
+
+ /* We fill all the registers internally, independent of what we
+ return, for use in backreferences. The number here includes
+ an element for register zero. */
+ size_t num_regs = bufp->re_nsub + 1;
+
+ /* The currently active registers. */
+ active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+
+ /* Information on the contents of registers. These are pointers into
+ the input strings; they record just what was matched (on this
+ attempt) by a subexpression part of the pattern, that is, the
+ regnum-th regstart pointer points to where in the pattern we began
+ matching and the regnum-th regend points to right after where we
+ stopped matching the regnum-th subexpression. (The zeroth register
+ keeps track of what the whole pattern matches.) */
+#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
+ const char **regstart, **regend;
+#endif
+
+ /* If a group that's operated upon by a repetition operator fails to
+ match anything, then the register for its start will need to be
+ restored because it will have been set to wherever in the string we
+ are when we last see its open-group operator. Similarly for a
+ register's end. */
+#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
+ const char **old_regstart, **old_regend;
+#endif
+
+ /* The is_active field of reg_info helps us keep track of which (possibly
+ nested) subexpressions we are currently in. The matched_something
+ field of reg_info[reg_num] helps us tell whether or not we have
+ matched any of the pattern so far this time through the reg_num-th
+ subexpression. These two fields get reset each time through any
+ loop their register is in. */
+#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */
+ register_info_type *reg_info;
+#endif
+
+ /* The following record the register info as found in the above
+ variables when we find a match better than any we've seen before.
+ This happens as we backtrack through the failure points, which in
+ turn happens only if we have not yet matched the entire string. */
+ unsigned best_regs_set = false;
+#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
+ const char **best_regstart, **best_regend;
+#endif
+
+ /* Logically, this is `best_regend[0]'. But we don't want to have to
+ allocate space for that if we're not allocating space for anything
+ else (see below). Also, we never need info about register 0 for
+ any of the other register vectors, and it seems rather a kludge to
+ treat `best_regend' differently than the rest. So we keep track of
+ the end of the best match so far in a separate variable. We
+ initialize this to NULL so that when we backtrack the first time
+ and need to test it, it's not garbage. */
+ const char *match_end = NULL;
+
+ /* This helps SET_REGS_MATCHED avoid doing redundant work. */
+ int set_regs_matched_done = 0;
+
+ /* Used when we pop values we don't care about. */
+#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
+ const char **reg_dummy;
+ register_info_type *reg_info_dummy;
+#endif
+
+#ifdef DEBUG
+ /* Counts the total number of registers pushed. */
+ unsigned num_regs_pushed = 0;
+#endif
+
+ DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
+
+ INIT_FAIL_STACK ();
+
+#ifdef MATCH_MAY_ALLOCATE
+ /* Do not bother to initialize all the register variables if there are
+ no groups in the pattern, as it takes a fair amount of time. If
+ there are groups, we include space for register 0 (the whole
+ pattern), even though we never use it, since it simplifies the
+ array indexing. We should fix this. */
+ if (bufp->re_nsub)
+ {
+ regstart = REGEX_TALLOC (num_regs, const char *);
+ regend = REGEX_TALLOC (num_regs, const char *);
+ old_regstart = REGEX_TALLOC (num_regs, const char *);
+ old_regend = REGEX_TALLOC (num_regs, const char *);
+ best_regstart = REGEX_TALLOC (num_regs, const char *);
+ best_regend = REGEX_TALLOC (num_regs, const char *);
+ reg_info = REGEX_TALLOC (num_regs, register_info_type);
+ reg_dummy = REGEX_TALLOC (num_regs, const char *);
+ reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
+
+ if (!(regstart && regend && old_regstart && old_regend && reg_info
+ && best_regstart && best_regend && reg_dummy && reg_info_dummy))
+ {
+ FREE_VARIABLES ();
+ return -2;
+ }
+ }
+ else
+ {
+ /* We must initialize all our variables to NULL, so that
+ `FREE_VARIABLES' doesn't try to free them. */
+ regstart = regend = old_regstart = old_regend = best_regstart
+ = best_regend = reg_dummy = NULL;
+ reg_info = reg_info_dummy = (register_info_type *) NULL;
+ }
+#endif /* MATCH_MAY_ALLOCATE */
+
+ /* The starting position is bogus. */
+ if (pos < 0 || pos > size1 + size2)
+ {
+ FREE_VARIABLES ();
+ return -1;
+ }
+
+ /* Initialize subexpression text positions to -1 to mark ones that no
+ start_memory/stop_memory has been seen for. Also initialize the
+ register information struct. */
+ for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
+ {
+ regstart[mcnt] = regend[mcnt]
+ = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
+
+ REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
+ IS_ACTIVE (reg_info[mcnt]) = 0;
+ MATCHED_SOMETHING (reg_info[mcnt]) = 0;
+ EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
+ }
+
+ /* We move `string1' into `string2' if the latter's empty -- but not if
+ `string1' is null. */
+ if (size2 == 0 && string1 != NULL)
+ {
+ string2 = string1;
+ size2 = size1;
+ string1 = 0;
+ size1 = 0;
+ }
+ end1 = string1 + size1;
+ end2 = string2 + size2;
+
+ /* Compute where to stop matching, within the two strings. */
+ if (stop <= size1)
+ {
+ end_match_1 = string1 + stop;
+ end_match_2 = string2;
+ }
+ else
+ {
+ end_match_1 = end1;
+ end_match_2 = string2 + stop - size1;
+ }
+
+ /* `p' scans through the pattern as `d' scans through the data.
+ `dend' is the end of the input string that `d' points within. `d'
+ is advanced into the following input string whenever necessary, but
+ this happens before fetching; therefore, at the beginning of the
+ loop, `d' can be pointing at the end of a string, but it cannot
+ equal `string2'. */
+ if (size1 > 0 && pos <= size1)
+ {
+ d = string1 + pos;
+ dend = end_match_1;
+ }
+ else
+ {
+ d = string2 + pos - size1;
+ dend = end_match_2;
+ }
+
+ DEBUG_PRINT1 ("The compiled pattern is:\n");
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
+ DEBUG_PRINT1 ("The string to match is: `");
+ DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
+ DEBUG_PRINT1 ("'\n");
+
+ /* This loops over pattern commands. It exits by returning from the
+ function if the match is complete, or it drops through if the match
+ fails at this starting point in the input data. */
+ for (;;)
+ {
+#ifdef _LIBC
+ DEBUG_PRINT2 ("\n%p: ", p);
+#else
+ DEBUG_PRINT2 ("\n0x%x: ", p);
+#endif
+
+ if (p == pend)
+ { /* End of pattern means we might have succeeded. */
+ DEBUG_PRINT1 ("end of pattern ... ");
+
+ /* If we haven't matched the entire string, and we want the
+ longest match, try backtracking. */
+ if (d != end_match_2)
+ {
+ /* 1 if this match ends in the same string (string1 or string2)
+ as the best previous match. */
+ boolean same_str_p = (FIRST_STRING_P (match_end)
+ == MATCHING_IN_FIRST_STRING);
+ /* 1 if this match is the best seen so far. */
+ boolean best_match_p;
+
+ /* AIX compiler got confused when this was combined
+ with the previous declaration. */
+ if (same_str_p)
+ best_match_p = d > match_end;
+ else
+ best_match_p = !MATCHING_IN_FIRST_STRING;
+
+ DEBUG_PRINT1 ("backtracking.\n");
+
+ if (!FAIL_STACK_EMPTY ())
+ { /* More failure points to try. */
+
+ /* If exceeds best match so far, save it. */
+ if (!best_regs_set || best_match_p)
+ {
+ best_regs_set = true;
+ match_end = d;
+
+ DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
+
+ for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
+ {
+ best_regstart[mcnt] = regstart[mcnt];
+ best_regend[mcnt] = regend[mcnt];
+ }
+ }
+ goto fail;
+ }
+
+ /* If no failure points, don't restore garbage. And if
+ last match is real best match, don't restore second
+ best one. */
+ else if (best_regs_set && !best_match_p)
+ {
+ restore_best_regs:
+ /* Restore best match. It may happen that `dend ==
+ end_match_1' while the restored d is in string2.
+ For example, the pattern `x.*y.*z' against the
+ strings `x-' and `y-z-', if the two strings are
+ not consecutive in memory. */
+ DEBUG_PRINT1 ("Restoring best registers.\n");
+
+ d = match_end;
+ dend = ((d >= string1 && d <= end1)
+ ? end_match_1 : end_match_2);
+
+ for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
+ {
+ regstart[mcnt] = best_regstart[mcnt];
+ regend[mcnt] = best_regend[mcnt];
+ }
+ }
+ } /* d != end_match_2 */
+
+ succeed_label:
+ DEBUG_PRINT1 ("Accepting match.\n");
+
+ /* If caller wants register contents data back, do it. */
+ if (regs && !bufp->no_sub)
+ {
+ /* Have the register data arrays been allocated? */
+ if (bufp->regs_allocated == REGS_UNALLOCATED)
+ { /* No. So allocate them with malloc. We need one
+ extra element beyond `num_regs' for the `-1' marker
+ GNU code uses. */
+ regs->num_regs = MAX (RE_NREGS, num_regs + 1);
+ regs->start = TALLOC (regs->num_regs, regoff_t);
+ regs->end = TALLOC (regs->num_regs, regoff_t);
+ if (regs->start == NULL || regs->end == NULL)
+ {
+ FREE_VARIABLES ();
+ return -2;
+ }
+ bufp->regs_allocated = REGS_REALLOCATE;
+ }
+ else if (bufp->regs_allocated == REGS_REALLOCATE)
+ { /* Yes. If we need more elements than were already
+ allocated, reallocate them. If we need fewer, just
+ leave it alone. */
+ if (regs->num_regs < num_regs + 1)
+ {
+ regs->num_regs = num_regs + 1;
+ RETALLOC (regs->start, regs->num_regs, regoff_t);
+ RETALLOC (regs->end, regs->num_regs, regoff_t);
+ if (regs->start == NULL || regs->end == NULL)
+ {
+ FREE_VARIABLES ();
+ return -2;
+ }
+ }
+ }
+ else
+ {
+ /* These braces fend off a "empty body in an else-statement"
+ warning under GCC when assert expands to nothing. */
+ assert (bufp->regs_allocated == REGS_FIXED);
+ }
+
+ /* Convert the pointer data in `regstart' and `regend' to
+ indices. Register zero has to be set differently,
+ since we haven't kept track of any info for it. */
+ if (regs->num_regs > 0)
+ {
+ regs->start[0] = pos;
+ regs->end[0] = (MATCHING_IN_FIRST_STRING
+ ? ((regoff_t) (d - string1))
+ : ((regoff_t) (d - string2 + size1)));
+ }
+
+ /* Go through the first `min (num_regs, regs->num_regs)'
+ registers, since that is all we initialized. */
+ for (mcnt = 1; (unsigned) mcnt < MIN (num_regs, regs->num_regs);
+ mcnt++)
+ {
+ if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt]))
+ regs->start[mcnt] = regs->end[mcnt] = -1;
+ else
+ {
+ regs->start[mcnt]
+ = (regoff_t) POINTER_TO_OFFSET (regstart[mcnt]);
+ regs->end[mcnt]
+ = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]);
+ }
+ }
+
+ /* If the regs structure we return has more elements than
+ were in the pattern, set the extra elements to -1. If
+ we (re)allocated the registers, this is the case,
+ because we always allocate enough to have at least one
+ -1 at the end. */
+ for (mcnt = num_regs; (unsigned) mcnt < regs->num_regs; mcnt++)
+ regs->start[mcnt] = regs->end[mcnt] = -1;
+ } /* regs && !bufp->no_sub */
+
+ DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n",
+ nfailure_points_pushed, nfailure_points_popped,
+ nfailure_points_pushed - nfailure_points_popped);
+ DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
+
+ mcnt = d - pos - (MATCHING_IN_FIRST_STRING
+ ? string1
+ : string2 - size1);
+
+ DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
+
+ FREE_VARIABLES ();
+ return mcnt;
+ }
+
+ /* Otherwise match next pattern command. */
+ switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
+ {
+ /* Ignore these. Used to ignore the n of succeed_n's which
+ currently have n == 0. */
+ case no_op:
+ DEBUG_PRINT1 ("EXECUTING no_op.\n");
+ break;
+
+ case succeed:
+ DEBUG_PRINT1 ("EXECUTING succeed.\n");
+ goto succeed_label;
+
+ /* Match the next n pattern characters exactly. The following
+ byte in the pattern defines n, and the n bytes after that
+ are the characters to match. */
+ case exactn:
+ mcnt = *p++;
+ DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt);
+
+ /* This is written out as an if-else so we don't waste time
+ testing `translate' inside the loop. */
+ if (translate)
+ {
+ do
+ {
+ PREFETCH ();
+ if ((unsigned char) translate[(unsigned char) *d++]
+ != (unsigned char) *p++)
+ goto fail;
+ }
+ while (--mcnt);
+ }
+ else
+ {
+ do
+ {
+ PREFETCH ();
+ if (*d++ != (char) *p++) goto fail;
+ }
+ while (--mcnt);
+ }
+ SET_REGS_MATCHED ();
+ break;
+
+
+ /* Match any character except possibly a newline or a null. */
+ case anychar:
+ DEBUG_PRINT1 ("EXECUTING anychar.\n");
+
+ PREFETCH ();
+
+ if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n')
+ || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000'))
+ goto fail;
+
+ SET_REGS_MATCHED ();
+ DEBUG_PRINT2 (" Matched `%d'.\n", *d);
+ d++;
+ break;
+
+
+ case charset:
+ case charset_not:
+ {
+ register unsigned char c;
+ boolean not = (re_opcode_t) *(p - 1) == charset_not;
+
+ DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : "");
+
+ PREFETCH ();
+ c = TRANSLATE (*d); /* The character to match. */
+
+ /* Cast to `unsigned' instead of `unsigned char' in case the
+ bit list is a full 32 bytes long. */
+ if (c < (unsigned) (*p * BYTEWIDTH)
+ && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
+ not = !not;
+
+ p += 1 + *p;
+
+ if (!not) goto fail;
+
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+ }
+
+
+ /* The beginning of a group is represented by start_memory.
+ The arguments are the register number in the next byte, and the
+ number of groups inner to this one in the next. The text
+ matched within the group is recorded (in the internal
+ registers data structure) under the register number. */
+ case start_memory:
+ DEBUG_PRINT3 ("EXECUTING start_memory %d (%d):\n", *p, p[1]);
+
+ /* Find out if this group can match the empty string. */
+ p1 = p; /* To send to group_match_null_string_p. */
+
+ if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
+ REG_MATCH_NULL_STRING_P (reg_info[*p])
+ = group_match_null_string_p (&p1, pend, reg_info);
+
+ /* Save the position in the string where we were the last time
+ we were at this open-group operator in case the group is
+ operated upon by a repetition operator, e.g., with `(a*)*b'
+ against `ab'; then we want to ignore where we are now in
+ the string in case this attempt to match fails. */
+ old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
+ ? REG_UNSET (regstart[*p]) ? d : regstart[*p]
+ : regstart[*p];
+ DEBUG_PRINT2 (" old_regstart: %d\n",
+ POINTER_TO_OFFSET (old_regstart[*p]));
+
+ regstart[*p] = d;
+ DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p]));
+
+ IS_ACTIVE (reg_info[*p]) = 1;
+ MATCHED_SOMETHING (reg_info[*p]) = 0;
+
+ /* Clear this whenever we change the register activity status. */
+ set_regs_matched_done = 0;
+
+ /* This is the new highest active register. */
+ highest_active_reg = *p;
+
+ /* If nothing was active before, this is the new lowest active
+ register. */
+ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
+ lowest_active_reg = *p;
+
+ /* Move past the register number and inner group count. */
+ p += 2;
+ just_past_start_mem = p;
+
+ break;
+
+
+ /* The stop_memory opcode represents the end of a group. Its
+ arguments are the same as start_memory's: the register
+ number, and the number of inner groups. */
+ case stop_memory:
+ DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
+
+ /* We need to save the string position the last time we were at
+ this close-group operator in case the group is operated
+ upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
+ against `aba'; then we want to ignore where we are now in
+ the string in case this attempt to match fails. */
+ old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
+ ? REG_UNSET (regend[*p]) ? d : regend[*p]
+ : regend[*p];
+ DEBUG_PRINT2 (" old_regend: %d\n",
+ POINTER_TO_OFFSET (old_regend[*p]));
+
+ regend[*p] = d;
+ DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p]));
+
+ /* This register isn't active anymore. */
+ IS_ACTIVE (reg_info[*p]) = 0;
+
+ /* Clear this whenever we change the register activity status. */
+ set_regs_matched_done = 0;
+
+ /* If this was the only register active, nothing is active
+ anymore. */
+ if (lowest_active_reg == highest_active_reg)
+ {
+ lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+ }
+ else
+ { /* We must scan for the new highest active register, since
+ it isn't necessarily one less than now: consider
+ (a(b)c(d(e)f)g). When group 3 ends, after the f), the
+ new highest active register is 1. */
+ unsigned char r = *p - 1;
+ while (r > 0 && !IS_ACTIVE (reg_info[r]))
+ r--;
+
+ /* If we end up at register zero, that means that we saved
+ the registers as the result of an `on_failure_jump', not
+ a `start_memory', and we jumped to past the innermost
+ `stop_memory'. For example, in ((.)*) we save
+ registers 1 and 2 as a result of the *, but when we pop
+ back to the second ), we are at the stop_memory 1.
+ Thus, nothing is active. */
+ if (r == 0)
+ {
+ lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+ }
+ else
+ highest_active_reg = r;
+ }
+
+ /* If just failed to match something this time around with a
+ group that's operated on by a repetition operator, try to
+ force exit from the ``loop'', and restore the register
+ information for this group that we had before trying this
+ last match. */
+ if ((!MATCHED_SOMETHING (reg_info[*p])
+ || just_past_start_mem == p - 1)
+ && (p + 2) < pend)
+ {
+ boolean is_a_jump_n = false;
+
+ p1 = p + 2;
+ mcnt = 0;
+ switch ((re_opcode_t) *p1++)
+ {
+ case jump_n:
+ is_a_jump_n = true;
+ case pop_failure_jump:
+ case maybe_pop_jump:
+ case jump:
+ case dummy_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if (is_a_jump_n)
+ p1 += 2;
+ break;
+
+ default:
+ /* do nothing */ ;
+ }
+ p1 += mcnt;
+
+ /* If the next operation is a jump backwards in the pattern
+ to an on_failure_jump right before the start_memory
+ corresponding to this stop_memory, exit from the loop
+ by forcing a failure after pushing on the stack the
+ on_failure_jump's jump in the pattern, and d. */
+ if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump
+ && (re_opcode_t) p1[3] == start_memory && p1[4] == *p)
+ {
+ /* If this group ever matched anything, then restore
+ what its registers were before trying this last
+ failed match, e.g., with `(a*)*b' against `ab' for
+ regstart[1], and, e.g., with `((a*)*(b*)*)*'
+ against `aba' for regend[3].
+
+ Also restore the registers for inner groups for,
+ e.g., `((a*)(b*))*' against `aba' (register 3 would
+ otherwise get trashed). */
+
+ if (EVER_MATCHED_SOMETHING (reg_info[*p]))
+ {
+ unsigned r;
+
+ EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
+
+ /* Restore this and inner groups' (if any) registers. */
+ for (r = *p; r < (unsigned) *p + (unsigned) *(p + 1);
+ r++)
+ {
+ regstart[r] = old_regstart[r];
+
+ /* xx why this test? */
+ if (old_regend[r] >= regstart[r])
+ regend[r] = old_regend[r];
+ }
+ }
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ PUSH_FAILURE_POINT (p1 + mcnt, d, -2);
+
+ goto fail;
+ }
+ }
+
+ /* Move past the register number and the inner group count. */
+ p += 2;
+ break;
+
+
+ /* \<digit> has been turned into a `duplicate' command which is
+ followed by the numeric value of <digit> as the register number. */
+ case duplicate:
+ {
+ register const char *d2, *dend2;
+ int regno = *p++; /* Get which register to match against. */
+ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno);
+
+ /* Can't back reference a group which we've never matched. */
+ if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
+ goto fail;
+
+ /* Where in input to try to start matching. */
+ d2 = regstart[regno];
+
+ /* Where to stop matching; if both the place to start and
+ the place to stop matching are in the same string, then
+ set to the place to stop, otherwise, for now have to use
+ the end of the first string. */
+
+ dend2 = ((FIRST_STRING_P (regstart[regno])
+ == FIRST_STRING_P (regend[regno]))
+ ? regend[regno] : end_match_1);
+ for (;;)
+ {
+ /* If necessary, advance to next segment in register
+ contents. */
+ while (d2 == dend2)
+ {
+ if (dend2 == end_match_2) break;
+ if (dend2 == regend[regno]) break;
+
+ /* End of string1 => advance to string2. */
+ d2 = string2;
+ dend2 = regend[regno];
+ }
+ /* At end of register contents => success */
+ if (d2 == dend2) break;
+
+ /* If necessary, advance to next segment in data. */
+ PREFETCH ();
+
+ /* How many characters left in this segment to match. */
+ mcnt = dend - d;
+
+ /* Want how many consecutive characters we can match in
+ one shot, so, if necessary, adjust the count. */
+ if (mcnt > dend2 - d2)
+ mcnt = dend2 - d2;
+
+ /* Compare that many; failure if mismatch, else move
+ past them. */
+ if (translate
+ ? bcmp_translate (d, d2, mcnt, translate)
+ : memcmp (d, d2, mcnt))
+ goto fail;
+ d += mcnt, d2 += mcnt;
+
+ /* Do this because we've match some characters. */
+ SET_REGS_MATCHED ();
+ }
+ }
+ break;
+
+
+ /* begline matches the empty string at the beginning of the string
+ (unless `not_bol' is set in `bufp'), and, if
+ `newline_anchor' is set, after newlines. */
+ case begline:
+ DEBUG_PRINT1 ("EXECUTING begline.\n");
+
+ if (AT_STRINGS_BEG (d))
+ {
+ if (!bufp->not_bol) break;
+ }
+ else if (d[-1] == '\n' && bufp->newline_anchor)
+ {
+ break;
+ }
+ /* In all other cases, we fail. */
+ goto fail;
+
+
+ /* endline is the dual of begline. */
+ case endline:
+ DEBUG_PRINT1 ("EXECUTING endline.\n");
+
+ if (AT_STRINGS_END (d))
+ {
+ if (!bufp->not_eol) break;
+ }
+
+ /* We have to ``prefetch'' the next character. */
+ else if ((d == end1 ? *string2 : *d) == '\n'
+ && bufp->newline_anchor)
+ {
+ break;
+ }
+ goto fail;
+
+
+ /* Match at the very beginning of the data. */
+ case begbuf:
+ DEBUG_PRINT1 ("EXECUTING begbuf.\n");
+ if (AT_STRINGS_BEG (d))
+ break;
+ goto fail;
+
+
+ /* Match at the very end of the data. */
+ case endbuf:
+ DEBUG_PRINT1 ("EXECUTING endbuf.\n");
+ if (AT_STRINGS_END (d))
+ break;
+ goto fail;
+
+
+ /* on_failure_keep_string_jump is used to optimize `.*\n'. It
+ pushes NULL as the value for the string on the stack. Then
+ `pop_failure_point' will keep the current value for the
+ string, instead of restoring it. To see why, consider
+ matching `foo\nbar' against `.*\n'. The .* matches the foo;
+ then the . fails against the \n. But the next thing we want
+ to do is match the \n against the \n; if we restored the
+ string value, we would be back at the foo.
+
+ Because this is used only in specific cases, we don't need to
+ check all the things that `on_failure_jump' does, to make
+ sure the right things get saved on the stack. Hence we don't
+ share its code. The only reason to push anything on the
+ stack at all is that otherwise we would have to change
+ `anychar's code to do something besides goto fail in this
+ case; that seems worse than this. */
+ case on_failure_keep_string_jump:
+ DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+#ifdef _LIBC
+ DEBUG_PRINT3 (" %d (to %p):\n", mcnt, p + mcnt);
+#else
+ DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
+#endif
+
+ PUSH_FAILURE_POINT (p + mcnt, NULL, -2);
+ break;
+
+
+ /* Uses of on_failure_jump:
+
+ Each alternative starts with an on_failure_jump that points
+ to the beginning of the next alternative. Each alternative
+ except the last ends with a jump that in effect jumps past
+ the rest of the alternatives. (They really jump to the
+ ending jump of the following alternative, because tensioning
+ these jumps is a hassle.)
+
+ Repeats start with an on_failure_jump that points past both
+ the repetition text and either the following jump or
+ pop_failure_jump back to this on_failure_jump. */
+ case on_failure_jump:
+ on_failure:
+ DEBUG_PRINT1 ("EXECUTING on_failure_jump");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+#ifdef _LIBC
+ DEBUG_PRINT3 (" %d (to %p)", mcnt, p + mcnt);
+#else
+ DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt);
+#endif
+
+ /* If this on_failure_jump comes right before a group (i.e.,
+ the original * applied to a group), save the information
+ for that group and all inner ones, so that if we fail back
+ to this point, the group's information will be correct.
+ For example, in \(a*\)*\1, we need the preceding group,
+ and in \(zz\(a*\)b*\)\2, we need the inner group. */
+
+ /* We can't use `p' to check ahead because we push
+ a failure point to `p + mcnt' after we do this. */
+ p1 = p;
+
+ /* We need to skip no_op's before we look for the
+ start_memory in case this on_failure_jump is happening as
+ the result of a completed succeed_n, as in \(a\)\{1,3\}b\1
+ against aba. */
+ while (p1 < pend && (re_opcode_t) *p1 == no_op)
+ p1++;
+
+ if (p1 < pend && (re_opcode_t) *p1 == start_memory)
+ {
+ /* We have a new highest active register now. This will
+ get reset at the start_memory we are about to get to,
+ but we will have saved all the registers relevant to
+ this repetition op, as described above. */
+ highest_active_reg = *(p1 + 1) + *(p1 + 2);
+ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
+ lowest_active_reg = *(p1 + 1);
+ }
+
+ DEBUG_PRINT1 (":\n");
+ PUSH_FAILURE_POINT (p + mcnt, d, -2);
+ break;
+
+
+ /* A smart repeat ends with `maybe_pop_jump'.
+ We change it to either `pop_failure_jump' or `jump'. */
+ case maybe_pop_jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt);
+ {
+ register unsigned char *p2 = p;
+
+ /* Compare the beginning of the repeat with what in the
+ pattern follows its end. If we can establish that there
+ is nothing that they would both match, i.e., that we
+ would have to backtrack because of (as in, e.g., `a*a')
+ then we can change to pop_failure_jump, because we'll
+ never have to backtrack.
+
+ This is not true in the case of alternatives: in
+ `(a|ab)*' we do need to backtrack to the `ab' alternative
+ (e.g., if the string was `ab'). But instead of trying to
+ detect that here, the alternative has put on a dummy
+ failure point which is what we will end up popping. */
+
+ /* Skip over open/close-group commands.
+ If what follows this loop is a ...+ construct,
+ look at what begins its body, since we will have to
+ match at least one of that. */
+ while (1)
+ {
+ if (p2 + 2 < pend
+ && ((re_opcode_t) *p2 == stop_memory
+ || (re_opcode_t) *p2 == start_memory))
+ p2 += 3;
+ else if (p2 + 6 < pend
+ && (re_opcode_t) *p2 == dummy_failure_jump)
+ p2 += 6;
+ else
+ break;
+ }
+
+ p1 = p + mcnt;
+ /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
+ to the `maybe_finalize_jump' of this case. Examine what
+ follows. */
+
+ /* If we're at the end of the pattern, we can change. */
+ if (p2 == pend)
+ {
+ /* Consider what happens when matching ":\(.*\)"
+ against ":/". I don't really understand this code
+ yet. */
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1
+ (" End of pattern: change to `pop_failure_jump'.\n");
+ }
+
+ else if ((re_opcode_t) *p2 == exactn
+ || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
+ {
+ register unsigned char c
+ = *p2 == (unsigned char) endline ? '\n' : p2[2];
+
+ if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
+ c, p1[5]);
+ }
+
+ else if ((re_opcode_t) p1[3] == charset
+ || (re_opcode_t) p1[3] == charset_not)
+ {
+ int not = (re_opcode_t) p1[3] == charset_not;
+
+ if (c < (unsigned char) (p1[4] * BYTEWIDTH)
+ && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
+ not = !not;
+
+ /* `not' is equal to 1 if c would match, which means
+ that we can't change to pop_failure_jump. */
+ if (!not)
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
+ }
+ }
+ }
+ else if ((re_opcode_t) *p2 == charset)
+ {
+ /* We win if the first character of the loop is not part
+ of the charset. */
+ if ((re_opcode_t) p1[3] == exactn
+ && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
+ && (p2[2 + p1[5] / BYTEWIDTH]
+ & (1 << (p1[5] % BYTEWIDTH)))))
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
+ }
+
+ else if ((re_opcode_t) p1[3] == charset_not)
+ {
+ int idx;
+ /* We win if the charset_not inside the loop
+ lists every character listed in the charset after. */
+ for (idx = 0; idx < (int) p2[1]; idx++)
+ if (! (p2[2 + idx] == 0
+ || (idx < (int) p1[4]
+ && ((p2[2 + idx] & ~ p1[5 + idx]) == 0))))
+ break;
+
+ if (idx == p2[1])
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
+ }
+ }
+ else if ((re_opcode_t) p1[3] == charset)
+ {
+ int idx;
+ /* We win if the charset inside the loop
+ has no overlap with the one after the loop. */
+ for (idx = 0;
+ idx < (int) p2[1] && idx < (int) p1[4];
+ idx++)
+ if ((p2[2 + idx] & p1[5 + idx]) != 0)
+ break;
+
+ if (idx == p2[1] || idx == p1[4])
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
+ }
+ }
+ }
+ }
+ p -= 2; /* Point at relative address again. */
+ if ((re_opcode_t) p[-1] != pop_failure_jump)
+ {
+ p[-1] = (unsigned char) jump;
+ DEBUG_PRINT1 (" Match => jump.\n");
+ goto unconditional_jump;
+ }
+ /* Note fall through. */
+
+
+ /* The end of a simple repeat has a pop_failure_jump back to
+ its matching on_failure_jump, where the latter will push a
+ failure point. The pop_failure_jump takes off failure
+ points put on by this pop_failure_jump's matching
+ on_failure_jump; we got through the pattern to here from the
+ matching on_failure_jump, so didn't fail. */
+ case pop_failure_jump:
+ {
+ /* We need to pass separate storage for the lowest and
+ highest registers, even though we don't care about the
+ actual values. Otherwise, we will restore only one
+ register from the stack, since lowest will == highest in
+ `pop_failure_point'. */
+ active_reg_t dummy_low_reg, dummy_high_reg;
+ unsigned char *pdummy;
+ const char *sdummy;
+
+ DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n");
+ POP_FAILURE_POINT (sdummy, pdummy,
+ dummy_low_reg, dummy_high_reg,
+ reg_dummy, reg_dummy, reg_info_dummy);
+ }
+ /* Note fall through. */
+
+ unconditional_jump:
+#ifdef _LIBC
+ DEBUG_PRINT2 ("\n%p: ", p);
+#else
+ DEBUG_PRINT2 ("\n0x%x: ", p);
+#endif
+ /* Note fall through. */
+
+ /* Unconditionally jump (without popping any failure points). */
+ case jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */
+ DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
+ p += mcnt; /* Do the jump. */
+#ifdef _LIBC
+ DEBUG_PRINT2 ("(to %p).\n", p);
+#else
+ DEBUG_PRINT2 ("(to 0x%x).\n", p);
+#endif
+ break;
+
+
+ /* We need this opcode so we can detect where alternatives end
+ in `group_match_null_string_p' et al. */
+ case jump_past_alt:
+ DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n");
+ goto unconditional_jump;
+
+
+ /* Normally, the on_failure_jump pushes a failure point, which
+ then gets popped at pop_failure_jump. We will end up at
+ pop_failure_jump, also, and with a pattern of, say, `a+', we
+ are skipping over the on_failure_jump, so we have to push
+ something meaningless for pop_failure_jump to pop. */
+ case dummy_failure_jump:
+ DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
+ /* It doesn't matter what we push for the string here. What
+ the code at `fail' tests is the value for the pattern. */
+ PUSH_FAILURE_POINT (NULL, NULL, -2);
+ goto unconditional_jump;
+
+
+ /* At the end of an alternative, we need to push a dummy failure
+ point in case we are followed by a `pop_failure_jump', because
+ we don't want the failure point for the alternative to be
+ popped. For example, matching `(a|ab)*' against `aab'
+ requires that we match the `ab' alternative. */
+ case push_dummy_failure:
+ DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
+ /* See comments just above at `dummy_failure_jump' about the
+ two zeroes. */
+ PUSH_FAILURE_POINT (NULL, NULL, -2);
+ break;
+
+ /* Have to succeed matching what follows at least n times.
+ After that, handle like `on_failure_jump'. */
+ case succeed_n:
+ EXTRACT_NUMBER (mcnt, p + 2);
+ DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
+
+ assert (mcnt >= 0);
+ /* Originally, this is how many times we HAVE to succeed. */
+ if (mcnt > 0)
+ {
+ mcnt--;
+ p += 2;
+ STORE_NUMBER_AND_INCR (p, mcnt);
+#ifdef _LIBC
+ DEBUG_PRINT3 (" Setting %p to %d.\n", p - 2, mcnt);
+#else
+ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p - 2, mcnt);
+#endif
+ }
+ else if (mcnt == 0)
+ {
+#ifdef _LIBC
+ DEBUG_PRINT2 (" Setting two bytes from %p to no_op.\n", p+2);
+#else
+ DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2);
+#endif
+ p[2] = (unsigned char) no_op;
+ p[3] = (unsigned char) no_op;
+ goto on_failure;
+ }
+ break;
+
+ case jump_n:
+ EXTRACT_NUMBER (mcnt, p + 2);
+ DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
+
+ /* Originally, this is how many times we CAN jump. */
+ if (mcnt)
+ {
+ mcnt--;
+ STORE_NUMBER (p + 2, mcnt);
+#ifdef _LIBC
+ DEBUG_PRINT3 (" Setting %p to %d.\n", p + 2, mcnt);
+#else
+ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p + 2, mcnt);
+#endif
+ goto unconditional_jump;
+ }
+ /* If don't have to jump any more, skip over the rest of command. */
+ else
+ p += 4;
+ break;
+
+ case set_number_at:
+ {
+ DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ p1 = p + mcnt;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+#ifdef _LIBC
+ DEBUG_PRINT3 (" Setting %p to %d.\n", p1, mcnt);
+#else
+ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt);
+#endif
+ STORE_NUMBER (p1, mcnt);
+ break;
+ }
+
+#if 0
+ /* The DEC Alpha C compiler 3.x generates incorrect code for the
+ test WORDCHAR_P (d - 1) != WORDCHAR_P (d) in the expansion of
+ AT_WORD_BOUNDARY, so this code is disabled. Expanding the
+ macro and introducing temporary variables works around the bug. */
+
+ case wordbound:
+ DEBUG_PRINT1 ("EXECUTING wordbound.\n");
+ if (AT_WORD_BOUNDARY (d))
+ break;
+ goto fail;
+
+ case notwordbound:
+ DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
+ if (AT_WORD_BOUNDARY (d))
+ goto fail;
+ break;
+#else
+ case wordbound:
+ {
+ boolean prevchar, thischar;
+
+ DEBUG_PRINT1 ("EXECUTING wordbound.\n");
+ if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
+ break;
+
+ prevchar = WORDCHAR_P (d - 1);
+ thischar = WORDCHAR_P (d);
+ if (prevchar != thischar)
+ break;
+ goto fail;
+ }
+
+ case notwordbound:
+ {
+ boolean prevchar, thischar;
+
+ DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
+ if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
+ goto fail;
+
+ prevchar = WORDCHAR_P (d - 1);
+ thischar = WORDCHAR_P (d);
+ if (prevchar != thischar)
+ goto fail;
+ break;
+ }
+#endif
+
+ case wordbeg:
+ DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
+ if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1)))
+ break;
+ goto fail;
+
+ case wordend:
+ DEBUG_PRINT1 ("EXECUTING wordend.\n");
+ if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1)
+ && (!WORDCHAR_P (d) || AT_STRINGS_END (d)))
+ break;
+ goto fail;
+
+#ifdef emacs
+ case before_dot:
+ DEBUG_PRINT1 ("EXECUTING before_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) >= point)
+ goto fail;
+ break;
+
+ case at_dot:
+ DEBUG_PRINT1 ("EXECUTING at_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) != point)
+ goto fail;
+ break;
+
+ case after_dot:
+ DEBUG_PRINT1 ("EXECUTING after_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) <= point)
+ goto fail;
+ break;
+
+ case syntaxspec:
+ DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt);
+ mcnt = *p++;
+ goto matchsyntax;
+
+ case wordchar:
+ DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n");
+ mcnt = (int) Sword;
+ matchsyntax:
+ PREFETCH ();
+ /* Can't use *d++ here; SYNTAX may be an unsafe macro. */
+ d++;
+ if (SYNTAX (d[-1]) != (enum syntaxcode) mcnt)
+ goto fail;
+ SET_REGS_MATCHED ();
+ break;
+
+ case notsyntaxspec:
+ DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt);
+ mcnt = *p++;
+ goto matchnotsyntax;
+
+ case notwordchar:
+ DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n");
+ mcnt = (int) Sword;
+ matchnotsyntax:
+ PREFETCH ();
+ /* Can't use *d++ here; SYNTAX may be an unsafe macro. */
+ d++;
+ if (SYNTAX (d[-1]) == (enum syntaxcode) mcnt)
+ goto fail;
+ SET_REGS_MATCHED ();
+ break;
+
+#else /* not emacs */
+ case wordchar:
+ DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n");
+ PREFETCH ();
+ if (!WORDCHAR_P (d))
+ goto fail;
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+
+ case notwordchar:
+ DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
+ PREFETCH ();
+ if (WORDCHAR_P (d))
+ goto fail;
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+#endif /* not emacs */
+
+ default:
+ abort ();
+ }
+ continue; /* Successfully executed one pattern command; keep going. */
+
+
+ /* We goto here if a matching operation fails. */
+ fail:
+ if (!FAIL_STACK_EMPTY ())
+ { /* A restart point is known. Restore to that state. */
+ DEBUG_PRINT1 ("\nFAIL:\n");
+ POP_FAILURE_POINT (d, p,
+ lowest_active_reg, highest_active_reg,
+ regstart, regend, reg_info);
+
+ /* If this failure point is a dummy, try the next one. */
+ if (!p)
+ goto fail;
+
+ /* If we failed to the end of the pattern, don't examine *p. */
+ assert (p <= pend);
+ if (p < pend)
+ {
+ boolean is_a_jump_n = false;
+
+ /* If failed to a backwards jump that's part of a repetition
+ loop, need to pop this failure point and use the next one. */
+ switch ((re_opcode_t) *p)
+ {
+ case jump_n:
+ is_a_jump_n = true;
+ case maybe_pop_jump:
+ case pop_failure_jump:
+ case jump:
+ p1 = p + 1;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+
+ if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
+ || (!is_a_jump_n
+ && (re_opcode_t) *p1 == on_failure_jump))
+ goto fail;
+ break;
+ default:
+ /* do nothing */ ;
+ }
+ }
+
+ if (d >= string1 && d <= end1)
+ dend = end_match_1;
+ }
+ else
+ break; /* Matching at this starting point really fails. */
+ } /* for (;;) */
+
+ if (best_regs_set)
+ goto restore_best_regs;
+
+ FREE_VARIABLES ();
+
+ return -1; /* Failure to match. */
+} /* re_match_2 */
+
+/* Subroutine definitions for re_match_2. */
+
+
+/* We are passed P pointing to a register number after a start_memory.
+
+ Return true if the pattern up to the corresponding stop_memory can
+ match the empty string, and false otherwise.
+
+ If we find the matching stop_memory, sets P to point to one past its number.
+ Otherwise, sets P to an undefined byte less than or equal to END.
+
+ We don't handle duplicates properly (yet). */
+
+static boolean
+group_match_null_string_p (p, end, reg_info)
+ unsigned char **p, *end;
+ register_info_type *reg_info;
+{
+ int mcnt;
+ /* Point to after the args to the start_memory. */
+ unsigned char *p1 = *p + 2;
+
+ while (p1 < end)
+ {
+ /* Skip over opcodes that can match nothing, and return true or
+ false, as appropriate, when we get to one that can't, or to the
+ matching stop_memory. */
+
+ switch ((re_opcode_t) *p1)
+ {
+ /* Could be either a loop or a series of alternatives. */
+ case on_failure_jump:
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+
+ /* If the next operation is not a jump backwards in the
+ pattern. */
+
+ if (mcnt >= 0)
+ {
+ /* Go through the on_failure_jumps of the alternatives,
+ seeing if any of the alternatives cannot match nothing.
+ The last alternative starts with only a jump,
+ whereas the rest start with on_failure_jump and end
+ with a jump, e.g., here is the pattern for `a|b|c':
+
+ /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
+ /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
+ /exactn/1/c
+
+ So, we have to first go through the first (n-1)
+ alternatives and then deal with the last one separately. */
+
+
+ /* Deal with the first (n-1) alternatives, which start
+ with an on_failure_jump (see above) that jumps to right
+ past a jump_past_alt. */
+
+ while ((re_opcode_t) p1[mcnt-3] == jump_past_alt)
+ {
+ /* `mcnt' holds how many bytes long the alternative
+ is, including the ending `jump_past_alt' and
+ its number. */
+
+ if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
+ reg_info))
+ return false;
+
+ /* Move to right after this alternative, including the
+ jump_past_alt. */
+ p1 += mcnt;
+
+ /* Break if it's the beginning of an n-th alternative
+ that doesn't begin with an on_failure_jump. */
+ if ((re_opcode_t) *p1 != on_failure_jump)
+ break;
+
+ /* Still have to check that it's not an n-th
+ alternative that starts with an on_failure_jump. */
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if ((re_opcode_t) p1[mcnt-3] != jump_past_alt)
+ {
+ /* Get to the beginning of the n-th alternative. */
+ p1 -= 3;
+ break;
+ }
+ }
+
+ /* Deal with the last alternative: go back and get number
+ of the `jump_past_alt' just before it. `mcnt' contains
+ the length of the alternative. */
+ EXTRACT_NUMBER (mcnt, p1 - 2);
+
+ if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info))
+ return false;
+
+ p1 += mcnt; /* Get past the n-th alternative. */
+ } /* if mcnt > 0 */
+ break;
+
+
+ case stop_memory:
+ assert (p1[1] == **p);
+ *p = p1 + 2;
+ return true;
+
+
+ default:
+ if (!common_op_match_null_string_p (&p1, end, reg_info))
+ return false;
+ }
+ } /* while p1 < end */
+
+ return false;
+} /* group_match_null_string_p */
+
+
+/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
+ It expects P to be the first byte of a single alternative and END one
+ byte past the last. The alternative can contain groups. */
+
+static boolean
+alt_match_null_string_p (p, end, reg_info)
+ unsigned char *p, *end;
+ register_info_type *reg_info;
+{
+ int mcnt;
+ unsigned char *p1 = p;
+
+ while (p1 < end)
+ {
+ /* Skip over opcodes that can match nothing, and break when we get
+ to one that can't. */
+
+ switch ((re_opcode_t) *p1)
+ {
+ /* It's a loop. */
+ case on_failure_jump:
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+ break;
+
+ default:
+ if (!common_op_match_null_string_p (&p1, end, reg_info))
+ return false;
+ }
+ } /* while p1 < end */
+
+ return true;
+} /* alt_match_null_string_p */
+
+
+/* Deals with the ops common to group_match_null_string_p and
+ alt_match_null_string_p.
+
+ Sets P to one after the op and its arguments, if any. */
+
+static boolean
+common_op_match_null_string_p (p, end, reg_info)
+ unsigned char **p, *end;
+ register_info_type *reg_info;
+{
+ int mcnt;
+ boolean ret;
+ int reg_no;
+ unsigned char *p1 = *p;
+
+ switch ((re_opcode_t) *p1++)
+ {
+ case no_op:
+ case begline:
+ case endline:
+ case begbuf:
+ case endbuf:
+ case wordbeg:
+ case wordend:
+ case wordbound:
+ case notwordbound:
+#ifdef emacs
+ case before_dot:
+ case at_dot:
+ case after_dot:
+#endif
+ break;
+
+ case start_memory:
+ reg_no = *p1;
+ assert (reg_no > 0 && reg_no <= MAX_REGNUM);
+ ret = group_match_null_string_p (&p1, end, reg_info);
+
+ /* Have to set this here in case we're checking a group which
+ contains a group and a back reference to it. */
+
+ if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE)
+ REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret;
+
+ if (!ret)
+ return false;
+ break;
+
+ /* If this is an optimized succeed_n for zero times, make the jump. */
+ case jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if (mcnt >= 0)
+ p1 += mcnt;
+ else
+ return false;
+ break;
+
+ case succeed_n:
+ /* Get to the number of times to succeed. */
+ p1 += 2;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+
+ if (mcnt == 0)
+ {
+ p1 -= 4;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+ }
+ else
+ return false;
+ break;
+
+ case duplicate:
+ if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
+ return false;
+ break;
+
+ case set_number_at:
+ p1 += 4;
+
+ default:
+ /* All other opcodes mean we cannot match the empty string. */
+ return false;
+ }
+
+ *p = p1;
+ return true;
+} /* common_op_match_null_string_p */
+
+
+/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
+ bytes; nonzero otherwise. */
+
+static int
+bcmp_translate (s1, s2, len, translate)
+ const char *s1, *s2;
+ register int len;
+ RE_TRANSLATE_TYPE translate;
+{
+ register const unsigned char *p1 = (const unsigned char *) s1;
+ register const unsigned char *p2 = (const unsigned char *) s2;
+ while (len)
+ {
+ if (translate[*p1++] != translate[*p2++]) return 1;
+ len--;
+ }
+ return 0;
+}
+
+/* Entry points for GNU code. */
+
+/* re_compile_pattern is the GNU regular expression compiler: it
+ compiles PATTERN (of length SIZE) and puts the result in BUFP.
+ Returns 0 if the pattern was valid, otherwise an error string.
+
+ Assumes the `allocated' (and perhaps `buffer') and `translate' fields
+ are set in BUFP on entry.
+
+ We call regex_compile to do the actual compilation. */
+
+const char *
+re_compile_pattern (pattern, length, bufp)
+ const char *pattern;
+ size_t length;
+ struct re_pattern_buffer *bufp;
+{
+ reg_errcode_t ret;
+
+ /* GNU code is written to assume at least RE_NREGS registers will be set
+ (and at least one extra will be -1). */
+ bufp->regs_allocated = REGS_UNALLOCATED;
+
+ /* And GNU code determines whether or not to get register information
+ by passing null for the REGS argument to re_match, etc., not by
+ setting no_sub. */
+ bufp->no_sub = 0;
+
+ /* Match anchors at newline. */
+ bufp->newline_anchor = 1;
+
+ ret = regex_compile (pattern, length, re_syntax_options, bufp);
+
+ if (!ret)
+ return NULL;
+ return gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
+}
+#ifdef _LIBC
+weak_alias (__re_compile_pattern, re_compile_pattern)
+#endif
+
+/* Entry points compatible with 4.2 BSD regex library. We don't define
+ them unless specifically requested. */
+
+#if defined _REGEX_RE_COMP || defined _LIBC
+
+/* BSD has one and only one pattern buffer. */
+static struct re_pattern_buffer re_comp_buf;
+
+char *
+#ifdef _LIBC
+/* Make these definitions weak in libc, so POSIX programs can redefine
+ these names if they don't use our functions, and still use
+ regcomp/regexec below without link errors. */
+weak_function
+#endif
+re_comp (s)
+ const char *s;
+{
+ reg_errcode_t ret;
+
+ if (!s)
+ {
+ if (!re_comp_buf.buffer)
+ return gettext ("No previous regular expression");
+ return 0;
+ }
+
+ if (!re_comp_buf.buffer)
+ {
+ re_comp_buf.buffer = (unsigned char *) malloc (200);
+ if (re_comp_buf.buffer == NULL)
+ return (char *) gettext (re_error_msgid
+ + re_error_msgid_idx[(int) REG_ESPACE]);
+ re_comp_buf.allocated = 200;
+
+ re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
+ if (re_comp_buf.fastmap == NULL)
+ return (char *) gettext (re_error_msgid
+ + re_error_msgid_idx[(int) REG_ESPACE]);
+ }
+
+ /* Since `re_exec' always passes NULL for the `regs' argument, we
+ don't need to initialize the pattern buffer fields which affect it. */
+
+ /* Match anchors at newlines. */
+ re_comp_buf.newline_anchor = 1;
+
+ ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
+
+ if (!ret)
+ return NULL;
+
+ /* Yes, we're discarding `const' here if !HAVE_LIBINTL. */
+ return (char *) gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
+}
+
+
+int
+#ifdef _LIBC
+weak_function
+#endif
+re_exec (s)
+ const char *s;
+{
+ const int len = strlen (s);
+ return
+ 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
+}
+
+#endif /* _REGEX_RE_COMP */
+
+/* POSIX.2 functions. Don't define these for Emacs. */
+
+#ifndef emacs
+
+/* regcomp takes a regular expression as a string and compiles it.
+
+ PREG is a regex_t *. We do not expect any fields to be initialized,
+ since POSIX says we shouldn't. Thus, we set
+
+ `buffer' to the compiled pattern;
+ `used' to the length of the compiled pattern;
+ `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
+ REG_EXTENDED bit in CFLAGS is set; otherwise, to
+ RE_SYNTAX_POSIX_BASIC;
+ `newline_anchor' to REG_NEWLINE being set in CFLAGS;
+ `fastmap' to an allocated space for the fastmap;
+ `fastmap_accurate' to zero;
+ `re_nsub' to the number of subexpressions in PATTERN.
+
+ PATTERN is the address of the pattern string.
+
+ CFLAGS is a series of bits which affect compilation.
+
+ If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
+ use POSIX basic syntax.
+
+ If REG_NEWLINE is set, then . and [^...] don't match newline.
+ Also, regexec will try a match beginning after every newline.
+
+ If REG_ICASE is set, then we considers upper- and lowercase
+ versions of letters to be equivalent when matching.
+
+ If REG_NOSUB is set, then when PREG is passed to regexec, that
+ routine will report only success or failure, and nothing about the
+ registers.
+
+ It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for
+ the return codes and their meanings.) */
+
+int
+regcomp (preg, pattern, cflags)
+ regex_t *preg;
+ const char *pattern;
+ int cflags;
+{
+ reg_errcode_t ret;
+ reg_syntax_t syntax
+ = (cflags & REG_EXTENDED) ?
+ RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
+
+ /* regex_compile will allocate the space for the compiled pattern. */
+ preg->buffer = 0;
+ preg->allocated = 0;
+ preg->used = 0;
+
+ /* Try to allocate space for the fastmap. */
+ preg->fastmap = (char *) malloc (1 << BYTEWIDTH);
+
+ if (cflags & REG_ICASE)
+ {
+ unsigned i;
+
+ preg->translate
+ = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE
+ * sizeof (*(RE_TRANSLATE_TYPE)0));
+ if (preg->translate == NULL)
+ return (int) REG_ESPACE;
+
+ /* Map uppercase characters to corresponding lowercase ones. */
+ for (i = 0; i < CHAR_SET_SIZE; i++)
+ preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : i;
+ }
+ else
+ preg->translate = NULL;
+
+ /* If REG_NEWLINE is set, newlines are treated differently. */
+ if (cflags & REG_NEWLINE)
+ { /* REG_NEWLINE implies neither . nor [^...] match newline. */
+ syntax &= ~RE_DOT_NEWLINE;
+ syntax |= RE_HAT_LISTS_NOT_NEWLINE;
+ /* It also changes the matching behavior. */
+ preg->newline_anchor = 1;
+ }
+ else
+ preg->newline_anchor = 0;
+
+ preg->no_sub = !!(cflags & REG_NOSUB);
+
+ /* POSIX says a null character in the pattern terminates it, so we
+ can use strlen here in compiling the pattern. */
+ ret = regex_compile (pattern, strlen (pattern), syntax, preg);
+
+ /* POSIX doesn't distinguish between an unmatched open-group and an
+ unmatched close-group: both are REG_EPAREN. */
+ if (ret == REG_ERPAREN) ret = REG_EPAREN;
+
+ if (ret == REG_NOERROR && preg->fastmap)
+ {
+ /* Compute the fastmap now, since regexec cannot modify the pattern
+ buffer. */
+ if (re_compile_fastmap (preg) == -2)
+ {
+ /* Some error occured while computing the fastmap, just forget
+ about it. */
+ free (preg->fastmap);
+ preg->fastmap = NULL;
+ }
+ }
+
+ return (int) ret;
+}
+#ifdef _LIBC
+weak_alias (__regcomp, regcomp)
+#endif
+
+
+/* regexec searches for a given pattern, specified by PREG, in the
+ string STRING.
+
+ If NMATCH is zero or REG_NOSUB was set in the cflags argument to
+ `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
+ least NMATCH elements, and we set them to the offsets of the
+ corresponding matched substrings.
+
+ EFLAGS specifies `execution flags' which affect matching: if
+ REG_NOTBOL is set, then ^ does not match at the beginning of the
+ string; if REG_NOTEOL is set, then $ does not match at the end.
+
+ We return 0 if we find a match and REG_NOMATCH if not. */
+
+int
+regexec (preg, string, nmatch, pmatch, eflags)
+ const regex_t *preg;
+ const char *string;
+ size_t nmatch;
+ regmatch_t pmatch[];
+ int eflags;
+{
+ int ret;
+ struct re_registers regs;
+ regex_t private_preg;
+ int len = strlen (string);
+ boolean want_reg_info = !preg->no_sub && nmatch > 0;
+
+ private_preg = *preg;
+
+ private_preg.not_bol = !!(eflags & REG_NOTBOL);
+ private_preg.not_eol = !!(eflags & REG_NOTEOL);
+
+ /* The user has told us exactly how many registers to return
+ information about, via `nmatch'. We have to pass that on to the
+ matching routines. */
+ private_preg.regs_allocated = REGS_FIXED;
+
+ if (want_reg_info)
+ {
+ regs.num_regs = nmatch;
+ regs.start = TALLOC (nmatch * 2, regoff_t);
+ if (regs.start == NULL)
+ return (int) REG_NOMATCH;
+ regs.end = regs.start + nmatch;
+ }
+
+ /* Perform the searching operation. */
+ ret = re_search (&private_preg, string, len,
+ /* start: */ 0, /* range: */ len,
+ want_reg_info ? &regs : (struct re_registers *) 0);
+
+ /* Copy the register information to the POSIX structure. */
+ if (want_reg_info)
+ {
+ if (ret >= 0)
+ {
+ unsigned r;
+
+ for (r = 0; r < nmatch; r++)
+ {
+ pmatch[r].rm_so = regs.start[r];
+ pmatch[r].rm_eo = regs.end[r];
+ }
+ }
+
+ /* If we needed the temporary register info, free the space now. */
+ free (regs.start);
+ }
+
+ /* We want zero return to mean success, unlike `re_search'. */
+ return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
+}
+#ifdef _LIBC
+weak_alias (__regexec, regexec)
+#endif
+
+
+/* Returns a message corresponding to an error code, ERRCODE, returned
+ from either regcomp or regexec. We don't use PREG here. */
+
+size_t
+regerror (errcode, preg, errbuf, errbuf_size)
+ int errcode;
+ const regex_t *preg;
+ char *errbuf;
+ size_t errbuf_size;
+{
+ const char *msg;
+ size_t msg_size;
+
+ if (errcode < 0
+ || errcode >= (int) (sizeof (re_error_msgid_idx)
+ / sizeof (re_error_msgid_idx[0])))
+ /* Only error codes returned by the rest of the code should be passed
+ to this routine. If we are given anything else, or if other regex
+ code generates an invalid error code, then the program has a bug.
+ Dump core so we can fix it. */
+ abort ();
+
+ msg = gettext (re_error_msgid + re_error_msgid_idx[errcode]);
+
+ msg_size = strlen (msg) + 1; /* Includes the null. */
+
+ if (errbuf_size != 0)
+ {
+ if (msg_size > errbuf_size)
+ {
+#if defined HAVE_MEMPCPY || defined _LIBC
+ *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
+#else
+ memcpy (errbuf, msg, errbuf_size - 1);
+ errbuf[errbuf_size - 1] = 0;
+#endif
+ }
+ else
+ memcpy (errbuf, msg, msg_size);
+ }
+
+ return msg_size;
+}
+#ifdef _LIBC
+weak_alias (__regerror, regerror)
+#endif
+
+
+/* Free dynamically allocated space used by PREG. */
+
+void
+regfree (preg)
+ regex_t *preg;
+{
+ if (preg->buffer != NULL)
+ free (preg->buffer);
+ preg->buffer = NULL;
+
+ preg->allocated = 0;
+ preg->used = 0;
+
+ if (preg->fastmap != NULL)
+ free (preg->fastmap);
+ preg->fastmap = NULL;
+ preg->fastmap_accurate = 0;
+
+ if (preg->translate != NULL)
+ free (preg->translate);
+ preg->translate = NULL;
+}
+#ifdef _LIBC
+weak_alias (__regfree, regfree)
+#endif
+
+#endif /* not emacs */
diff --git a/src/gnuregex.h b/src/gnuregex.h
new file mode 100644
index 0000000..d88ab92
--- /dev/null
+++ b/src/gnuregex.h
@@ -0,0 +1,542 @@
+/* Definitions for data structures and routines for the regular
+ expression library, version 0.12.
+ Copyright (C) 1985,89,90,91,92,93,95,96,97,98 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library. Its master source is NOT part of
+ the C library, however. The master source lives in /gd/gnu/lib.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _REGEX_H
+#define _REGEX_H 1
+
+/* Allow the use in C++ code. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* POSIX says that <sys/types.h> must be included (by the caller) before
+ <regex.h>. */
+
+#if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
+/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
+ should be there. */
+# include <stddef.h>
+#endif
+
+/* The following two types have to be signed and unsigned integer type
+ wide enough to hold a value of a pointer. For most ANSI compilers
+ ptrdiff_t and size_t should be likely OK. Still size of these two
+ types is 2 for Microsoft C. Ugh... */
+typedef long int s_reg_t;
+typedef unsigned long int active_reg_t;
+
+/* The following bits are used to determine the regexp syntax we
+ recognize. The set/not-set meanings are chosen so that Emacs syntax
+ remains the value 0. The bits are given in alphabetical order, and
+ the definitions shifted by one from the previous bit; thus, when we
+ add or remove a bit, only one other definition need change. */
+typedef unsigned long int reg_syntax_t;
+
+/* If this bit is not set, then \ inside a bracket expression is literal.
+ If set, then such a \ quotes the following character. */
+#define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
+
+/* If this bit is not set, then + and ? are operators, and \+ and \? are
+ literals.
+ If set, then \+ and \? are operators and + and ? are literals. */
+#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
+
+/* If this bit is set, then character classes are supported. They are:
+ [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
+ [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
+ If not set, then character classes are not supported. */
+#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
+
+/* If this bit is set, then ^ and $ are always anchors (outside bracket
+ expressions, of course).
+ If this bit is not set, then it depends:
+ ^ is an anchor if it is at the beginning of a regular
+ expression or after an open-group or an alternation operator;
+ $ is an anchor if it is at the end of a regular expression, or
+ before a close-group or an alternation operator.
+
+ This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
+ POSIX draft 11.2 says that * etc. in leading positions is undefined.
+ We already implemented a previous draft which made those constructs
+ invalid, though, so we haven't changed the code back. */
+#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
+
+/* If this bit is set, then special characters are always special
+ regardless of where they are in the pattern.
+ If this bit is not set, then special characters are special only in
+ some contexts; otherwise they are ordinary. Specifically,
+ * + ? and intervals are only special when not after the beginning,
+ open-group, or alternation operator. */
+#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
+
+/* If this bit is set, then *, +, ?, and { cannot be first in an re or
+ immediately after an alternation or begin-group operator. */
+#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
+
+/* If this bit is set, then . matches newline.
+ If not set, then it doesn't. */
+#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
+
+/* If this bit is set, then . doesn't match NUL.
+ If not set, then it does. */
+#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
+
+/* If this bit is set, nonmatching lists [^...] do not match newline.
+ If not set, they do. */
+#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
+
+/* If this bit is set, either \{...\} or {...} defines an
+ interval, depending on RE_NO_BK_BRACES.
+ If not set, \{, \}, {, and } are literals. */
+#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+
+/* If this bit is set, +, ? and | aren't recognized as operators.
+ If not set, they are. */
+#define RE_LIMITED_OPS (RE_INTERVALS << 1)
+
+/* If this bit is set, newline is an alternation operator.
+ If not set, newline is literal. */
+#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
+
+/* If this bit is set, then `{...}' defines an interval, and \{ and \}
+ are literals.
+ If not set, then `\{...\}' defines an interval. */
+#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
+
+/* If this bit is set, (...) defines a group, and \( and \) are literals.
+ If not set, \(...\) defines a group, and ( and ) are literals. */
+#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
+
+/* If this bit is set, then \<digit> matches <digit>.
+ If not set, then \<digit> is a back-reference. */
+#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
+
+/* If this bit is set, then | is an alternation operator, and \| is literal.
+ If not set, then \| is an alternation operator, and | is literal. */
+#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
+
+/* If this bit is set, then an ending range point collating higher
+ than the starting range point, as in [z-a], is invalid.
+ If not set, then when ending range point collates higher than the
+ starting range point, the range is ignored. */
+#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
+
+/* If this bit is set, then an unmatched ) is ordinary.
+ If not set, then an unmatched ) is invalid. */
+#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
+
+/* If this bit is set, succeed as soon as we match the whole pattern,
+ without further backtracking. */
+#define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
+
+/* If this bit is set, do not process the GNU regex operators.
+ If not set, then the GNU regex operators are recognized. */
+#define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
+
+/* If this bit is set, turn on internal regex debugging.
+ If not set, and debugging was on, turn it off.
+ This only works if regex.c is compiled -DDEBUG.
+ We define this bit always, so that all that's needed to turn on
+ debugging is to recompile regex.c; the calling code can always have
+ this bit set, and it won't affect anything in the normal case. */
+#define RE_DEBUG (RE_NO_GNU_OPS << 1)
+
+/* This global variable defines the particular regexp syntax to use (for
+ some interfaces). When a regexp is compiled, the syntax used is
+ stored in the pattern buffer, so changing this does not affect
+ already-compiled regexps. */
+extern reg_syntax_t re_syntax_options;
+
+/* Define combinations of the above bits for the standard possibilities.
+ (The [[[ comments delimit what gets put into the Texinfo file, so
+ don't delete them!) */
+/* [[[begin syntaxes]]] */
+#define RE_SYNTAX_EMACS 0
+
+#define RE_SYNTAX_AWK \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
+ | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
+
+#define RE_SYNTAX_GNU_AWK \
+ ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
+ & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
+
+#define RE_SYNTAX_POSIX_AWK \
+ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
+ | RE_INTERVALS | RE_NO_GNU_OPS)
+
+#define RE_SYNTAX_GREP \
+ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
+ | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
+ | RE_NEWLINE_ALT)
+
+#define RE_SYNTAX_EGREP \
+ (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
+ | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
+ | RE_NO_BK_VBAR)
+
+#define RE_SYNTAX_POSIX_EGREP \
+ (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
+
+/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
+#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
+
+#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
+
+/* Syntax bits common to both basic and extended POSIX regex syntax. */
+#define _RE_SYNTAX_POSIX_COMMON \
+ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
+ | RE_INTERVALS | RE_NO_EMPTY_RANGES)
+
+#define RE_SYNTAX_POSIX_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
+
+/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+ RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
+ isn't minimal, since other operators, such as \`, aren't disabled. */
+#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
+
+#define RE_SYNTAX_POSIX_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
+ replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
+#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
+/* [[[end syntaxes]]] */
+
+/* Maximum number of duplicates an interval can allow. Some systems
+ (erroneously) define this in other header files, but we want our
+ value, so remove any previous define. */
+#ifdef RE_DUP_MAX
+# undef RE_DUP_MAX
+#endif
+/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
+#define RE_DUP_MAX (0x7fff)
+
+
+/* POSIX `cflags' bits (i.e., information for `regcomp'). */
+
+/* If this bit is set, then use extended regular expression syntax.
+ If not set, then use basic regular expression syntax. */
+#define REG_EXTENDED 1
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define REG_ICASE (REG_EXTENDED << 1)
+
+/* If this bit is set, then anchors do not match at newline
+ characters in the string.
+ If not set, then anchors do match at newlines. */
+#define REG_NEWLINE (REG_ICASE << 1)
+
+/* If this bit is set, then report only success or fail in regexec.
+ If not set, then returns differ between not matching and errors. */
+#define REG_NOSUB (REG_NEWLINE << 1)
+
+
+/* POSIX `eflags' bits (i.e., information for regexec). */
+
+/* If this bit is set, then the beginning-of-line operator doesn't match
+ the beginning of the string (presumably because it's not the
+ beginning of a line).
+ If not set, then the beginning-of-line operator does match the
+ beginning of the string. */
+#define REG_NOTBOL 1
+
+/* Like REG_NOTBOL, except for the end-of-line. */
+#define REG_NOTEOL (1 << 1)
+
+
+/* If any error codes are removed, changed, or added, update the
+ `re_error_msg' table in regex.c. */
+typedef enum
+{
+#ifdef _XOPEN_SOURCE
+ REG_ENOSYS = -1, /* This will never happen for this implementation. */
+#endif
+
+ REG_NOERROR = 0, /* Success. */
+ REG_NOMATCH, /* Didn't find a match (for regexec). */
+
+ /* POSIX regcomp return error codes. (In the order listed in the
+ standard.) */
+ REG_BADPAT, /* Invalid pattern. */
+ REG_ECOLLATE, /* Not implemented. */
+ REG_ECTYPE, /* Invalid character class name. */
+ REG_EESCAPE, /* Trailing backslash. */
+ REG_ESUBREG, /* Invalid back reference. */
+ REG_EBRACK, /* Unmatched left bracket. */
+ REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EBRACE, /* Unmatched \{. */
+ REG_BADBR, /* Invalid contents of \{\}. */
+ REG_ERANGE, /* Invalid range end. */
+ REG_ESPACE, /* Ran out of memory. */
+ REG_BADRPT, /* No preceding re for repetition op. */
+
+ /* Error codes we've added. */
+ REG_EEND, /* Premature end. */
+ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
+ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
+} reg_errcode_t;
+
+/* This data structure represents a compiled pattern. Before calling
+ the pattern compiler, the fields `buffer', `allocated', `fastmap',
+ `translate', and `no_sub' can be set. After the pattern has been
+ compiled, the `re_nsub' field is available. All other fields are
+ private to the regex routines. */
+
+#ifndef RE_TRANSLATE_TYPE
+# define RE_TRANSLATE_TYPE char *
+#endif
+
+struct re_pattern_buffer
+{
+/* [[[begin pattern_buffer]]] */
+ /* Space that holds the compiled pattern. It is declared as
+ `unsigned char *' because its elements are
+ sometimes used as array indexes. */
+ unsigned char *buffer;
+
+ /* Number of bytes to which `buffer' points. */
+ unsigned long int allocated;
+
+ /* Number of bytes actually used in `buffer'. */
+ unsigned long int used;
+
+ /* Syntax setting with which the pattern was compiled. */
+ reg_syntax_t syntax;
+
+ /* Pointer to a fastmap, if any, otherwise zero. re_search uses
+ the fastmap, if there is one, to skip over impossible
+ starting points for matches. */
+ char *fastmap;
+
+ /* Either a translate table to apply to all characters before
+ comparing them, or zero for no translation. The translation
+ is applied to a pattern when it is compiled and to a string
+ when it is matched. */
+ RE_TRANSLATE_TYPE translate;
+
+ /* Number of subexpressions found by the compiler. */
+ size_t re_nsub;
+
+ /* Zero if this pattern cannot match the empty string, one else.
+ Well, in truth it's used only in `re_search_2', to see
+ whether or not we should use the fastmap, so we don't set
+ this absolutely perfectly; see `re_compile_fastmap' (the
+ `duplicate' case). */
+ unsigned can_be_null : 1;
+
+ /* If REGS_UNALLOCATED, allocate space in the `regs' structure
+ for `max (RE_NREGS, re_nsub + 1)' groups.
+ If REGS_REALLOCATE, reallocate space if necessary.
+ If REGS_FIXED, use what's there. */
+#define REGS_UNALLOCATED 0
+#define REGS_REALLOCATE 1
+#define REGS_FIXED 2
+ unsigned regs_allocated : 2;
+
+ /* Set to zero when `regex_compile' compiles a pattern; set to one
+ by `re_compile_fastmap' if it updates the fastmap. */
+ unsigned fastmap_accurate : 1;
+
+ /* If set, `re_match_2' does not return information about
+ subexpressions. */
+ unsigned no_sub : 1;
+
+ /* If set, a beginning-of-line anchor doesn't match at the
+ beginning of the string. */
+ unsigned not_bol : 1;
+
+ /* Similarly for an end-of-line anchor. */
+ unsigned not_eol : 1;
+
+ /* If true, an anchor at a newline matches. */
+ unsigned newline_anchor : 1;
+
+/* [[[end pattern_buffer]]] */
+};
+
+typedef struct re_pattern_buffer regex_t;
+
+/* Type for byte offsets within the string. POSIX mandates this. */
+typedef int regoff_t;
+
+
+/* This is the structure we store register match data in. See
+ regex.texinfo for a full description of what registers match. */
+struct re_registers
+{
+ unsigned num_regs;
+ regoff_t *start;
+ regoff_t *end;
+};
+
+
+/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
+ `re_match_2' returns information about at least this many registers
+ the first time a `regs' structure is passed. */
+#ifndef RE_NREGS
+# define RE_NREGS 30
+#endif
+
+
+/* POSIX specification for registers. Aside from the different names than
+ `re_registers', POSIX uses an array of structures, instead of a
+ structure of arrays. */
+typedef struct
+{
+ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
+ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
+} regmatch_t;
+
+/* Declarations for routines. */
+
+/* To avoid duplicating every routine declaration -- once with a
+ prototype (if we are ANSI), and once without (if we aren't) -- we
+ use the following macro to declare argument types. This
+ unfortunately clutters up the declarations a bit, but I think it's
+ worth it. */
+
+#if __STDC__
+
+# define _RE_ARGS(args) args
+
+#else /* not __STDC__ */
+
+# define _RE_ARGS(args) ()
+
+#endif /* not __STDC__ */
+
+/* Sets the current default syntax to SYNTAX, and return the old syntax.
+ You can also simply assign to the `re_syntax_options' variable. */
+extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
+
+/* Compile the regular expression PATTERN, with length LENGTH
+ and syntax given by the global `re_syntax_options', into the buffer
+ BUFFER. Return NULL if successful, and an error string if not. */
+extern const char *re_compile_pattern
+ _RE_ARGS ((const char *pattern, size_t length,
+ struct re_pattern_buffer *buffer));
+
+
+/* Compile a fastmap for the compiled pattern in BUFFER; used to
+ accelerate searches. Return 0 if successful and -2 if was an
+ internal error. */
+extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
+
+
+/* Search in the string STRING (with length LENGTH) for the pattern
+ compiled into BUFFER. Start searching at position START, for RANGE
+ characters. Return the starting position of the match, -1 for no
+ match, or -2 for an internal error. Also return register
+ information in REGS (if REGS and BUFFER->no_sub are nonzero). */
+extern int re_search
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
+ int length, int start, int range, struct re_registers *regs));
+
+
+/* Like `re_search', but search in the concatenation of STRING1 and
+ STRING2. Also, stop searching at index START + STOP. */
+extern int re_search_2
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, int range, struct re_registers *regs, int stop));
+
+
+/* Like `re_search', but return how many characters in STRING the regexp
+ in BUFFER matched, starting at position START. */
+extern int re_match
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
+ int length, int start, struct re_registers *regs));
+
+
+/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
+extern int re_match_2
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, struct re_registers *regs, int stop));
+
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using BUFFER and REGS will use this memory
+ for recording register information. STARTS and ENDS must be
+ allocated with malloc, and must each be at least `NUM_REGS * sizeof
+ (regoff_t)' bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+extern void re_set_registers
+ _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
+ unsigned num_regs, regoff_t *starts, regoff_t *ends));
+
+#if defined _REGEX_RE_COMP || defined _LIBC
+# ifndef _CRAY
+/* 4.2 bsd compatibility. */
+extern char *re_comp _RE_ARGS ((const char *));
+extern int re_exec _RE_ARGS ((const char *));
+# endif
+#endif
+
+/* POSIX compatibility. */
+extern int regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
+ int __cflags));
+
+extern int regexec _RE_ARGS ((const regex_t *__preg,
+ const char *__string, size_t __nmatch,
+ regmatch_t __pmatch[], int __eflags));
+
+extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
+ char *__errbuf, size_t __errbuf_size));
+
+extern void regfree _RE_ARGS ((regex_t *__preg));
+
+
+#ifdef __cplusplus
+}
+#endif /* C++ */
+
+#endif /* regex.h */
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/src/log.c b/src/log.c
new file mode 100644
index 0000000..ca64f8e
--- /dev/null
+++ b/src/log.c
@@ -0,0 +1,90 @@
+/* $Id: log.c,v 1.1.1.1 2000-02-16 17:32:22 sdyoung Exp $
+ *
+ * Logs the various messages which tinyproxy produces to either a log file or
+ * the syslog daemon. Not much to it...
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * log.c - For the manipulation of log files.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <time.h>
+#include <syslog.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <assert.h>
+
+#include "tinyproxy.h"
+#include "log.h"
+
+#define LENGTH 16
+
+/*
+ * This routine logs messages to either the log file or the syslog function.
+ */
+void log(char *fmt, ...)
+{
+ va_list args;
+ time_t nowtime;
+ FILE *cf;
+
+#if defined(HAVE_SYSLOG_H) && !defined(HAVE_VSYSLOG_H)
+ static char str[800];
+#endif
+ static char time_string[LENGTH];
+
+ assert(fmt);
+
+ va_start(args, fmt);
+
+#ifdef HAVE_SYSLOG_H
+ if (config.syslog == FALSE) {
+#endif
+ nowtime = time(NULL);
+ /* Format is month day hour:minute:second (24 time) */
+ strftime(time_string, LENGTH, "%b %d %H:%M:%S",
+ localtime(&nowtime));
+
+ if (!(cf = config.logf))
+ cf = stderr;
+
+ fprintf(cf, "%s [%d]: ", time_string, getpid());
+ vfprintf(cf, fmt, args);
+ fprintf(cf, "\n");
+ fflush(cf);
+#ifdef HAVE_SYSLOG_H
+ } else {
+# ifdef HAVE_VSYSLOG_H
+ vsyslog(LOG_INFO, fmt, args);
+# else
+# ifdef HAVE_VSNPRINTF
+ vsnprintf(str, 800, fmt, args);
+# else
+# ifdef HAVE_VPRINTF
+ vsprintf(str, fmt, args);
+# endif
+# endif
+ syslog(LOG_INFO, str);
+# endif
+ }
+#endif
+
+ va_end(args);
+}
diff --git a/src/log.h b/src/log.h
new file mode 100644
index 0000000..e928b4c
--- /dev/null
+++ b/src/log.h
@@ -0,0 +1,24 @@
+/* $Id: log.h,v 1.1.1.1 2000-02-16 17:32:22 sdyoung Exp $
+ *
+ * See 'log.c' for a detailed description.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef _LOG_H_
+#define _LOG_H_ 1
+
+extern void log(char *fmt, ...);
+
+#endif
diff --git a/src/regexp.h b/src/regexp.h
new file mode 100644
index 0000000..1c40332
--- /dev/null
+++ b/src/regexp.h
@@ -0,0 +1,24 @@
+/* $Id: regexp.h,v 1.1.1.1 2000-02-16 17:32:24 sdyoung Exp $
+ *
+ * We need this little header to help distinguish whether to use the REGEX
+ * library installed in the system, or to include our own version (the GNU
+ * version to be exact.)
+ *
+ * Copyright (C) 2000 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifdef USE_GNU_REGEX
+# include "gnuregex.h"
+#else
+# include <regex.h>
+#endif
diff --git a/src/reqs.c b/src/reqs.c
new file mode 100644
index 0000000..7d6aa9f
--- /dev/null
+++ b/src/reqs.c
@@ -0,0 +1,832 @@
+/* $Id: reqs.c,v 1.1.1.1 2000-02-16 17:32:23 sdyoung Exp $
+ *
+ * This is where all the work in tinyproxy is actually done. Incoming
+ * connections are added to the active list of connections and then the header
+ * is processed to determine what is being requested. tinyproxy then connects
+ * to the remote server and begins to relay the bytes back and forth between
+ * the client and the remote server. Basically, we sit there and sling bytes
+ * back and forth. Optionally, we can weed out headers we do not want to send,
+ * and also add a header of our own.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ * Copyright (C) 2000 Chris Lightfoot (chris@ex-parrot.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <sys/uio.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <sysexits.h>
+#include <assert.h>
+
+#include "config.h"
+#include "tinyproxy.h"
+#include "sock.h"
+#include "utils.h"
+#include "conns.h"
+#include "log.h"
+#include "reqs.h"
+#include "buffer.h"
+#include "filter.h"
+#include "uri.h"
+#include "regexp.h"
+
+/* chris - for asynchronous DNS */
+#include "dnscache.h"
+#include <adns.h>
+extern adns_state adns;
+
+#ifdef XTINYPROXY
+
+static void Add_XTinyproxy_Header(struct conn_s *connptr)
+{
+ char *header_line;
+ char ipaddr[PEER_IP_LENGTH];
+ int length;
+
+ assert(connptr);
+
+ if (!(header_line = xmalloc(sizeof(char) * 32)))
+ return;
+
+ length = sprintf(header_line, "X-Tinyproxy: %s\r\n",
+ getpeer_ip(connptr->client_fd, ipaddr));
+
+ unshift_buffer(connptr->cbuffer, header_line, length);
+}
+
+#endif
+
+#define HTTPPATTERN "^([a-z]+)[ \t]+([^ \t]+)([ \t]+(HTTP/[0-9]+\\.[0-9]+))?"
+#define NMATCH 4
+#define METHOD_IND 1
+#define URI_IND 2
+#define VERSION_MARK 3
+#define VERSION_IND 4
+
+#define HTTP400ERROR "Unrecognizable request. Only HTTP is allowed."
+#define HTTP500ERROR "Unable to connect to remote server."
+#define HTTP503ERROR "Internal server error."
+
+/*
+ * Parse a client HTTP request and then establish connection.
+ */
+static int clientreq(struct conn_s *connptr)
+{
+ URI *uri = NULL;
+ char *inbuf, *buffer, *request, *port;
+ char *inbuf_ptr;
+
+ regex_t preg;
+ regmatch_t pmatch[NMATCH];
+
+ long len;
+ int fd, port_no;
+
+ char peer_ipaddr[PEER_IP_LENGTH];
+
+ assert(connptr);
+
+ getpeer_ip(connptr->client_fd, peer_ipaddr);
+ /* chris - getpeer_string could block, so for the moment take it out */
+
+ if ((len
+ = readline(connptr->client_fd, connptr->cbuffer, &inbuf)) <= 0) {
+ return len;
+ }
+
+ inbuf_ptr = inbuf + len - 1;
+ while (*inbuf_ptr == '\r' || *inbuf_ptr == '\n')
+ *inbuf_ptr-- = '\0';
+
+ /* Log the incoming connection */
+ if (!config.restricted) {
+ log("Connect: %s", peer_ipaddr);
+ log("Request: %s", inbuf);
+ }
+
+ if (regcomp(&preg, HTTPPATTERN, REG_EXTENDED | REG_ICASE) != 0) {
+ log("ERROR clientreq: regcomp");
+ return 0;
+ }
+ if (regexec(&preg, inbuf, NMATCH, pmatch, 0) != 0) {
+ log("ERROR clientreq: regexec");
+ regfree(&preg);
+ return -1;
+ }
+ regfree(&preg);
+
+ if (pmatch[VERSION_MARK].rm_so == -1)
+ connptr->simple_req = TRUE;
+
+ if (pmatch[METHOD_IND].rm_so == -1 || pmatch[URI_IND].rm_so == -1) {
+ log("ERROR clientreq: Incomplete line from %s (%s)",
+ peer_ipaddr, inbuf);
+ httperr(connptr, 400, HTTP400ERROR);
+ goto COMMON_EXIT;
+ }
+
+ len = pmatch[URI_IND].rm_eo - pmatch[URI_IND].rm_so;
+ if (!(buffer = xmalloc(len + 1))) {
+ log("ERROR clientreq: Cannot allocate buffer for request from %s",
+ peer_ipaddr);
+ httperr(connptr, 503, HTTP503ERROR);
+ goto COMMON_EXIT;
+ }
+ memcpy(buffer, inbuf + pmatch[URI_IND].rm_so, len);
+ buffer[len] = '\0';
+ if (!(uri = explode_uri(buffer))) {
+ safefree(buffer);
+ log("ERROR clientreq: Problem with explode_uri");
+ httperr(connptr, 503, HTTP503ERROR);
+ goto COMMON_EXIT;
+ }
+ safefree(buffer);
+
+ if (strcasecmp(uri->scheme, "http") != 0) {
+ char *error_string = xmalloc(strlen(uri->scheme) + 64);
+ sprintf(error_string, "Invalid scheme (%s). Only HTTP is allowed.",
+ uri->scheme);
+ httperr(connptr, 400, error_string);
+ safefree(error_string);
+ goto COMMON_EXIT;
+ }
+
+ if ((strlen(config.stathost) > 0) &&
+ strcasecmp(uri->authority, config.stathost) == 0) {
+ showstats(connptr);
+ goto COMMON_EXIT;
+ }
+
+ port_no = 80;
+ if ((port = strchr(uri->authority, ':'))) {
+ *port++ = '\0';
+ if (strlen(port) > 0)
+ port_no = atoi(port);
+ }
+
+ /* chris - so this can be passed on to clientreq_dnscomplete. */
+ connptr->port_no = port_no;
+
+#ifdef FILTER_ENABLE
+ /* Filter domains out */
+ if (config.filter) {
+ if (filter_host(uri->authority)) {
+ log("ERROR clientreq: Filtered connection (%s)",
+ peer_ipaddr);
+ httperr(connptr, 404,
+ "Unable to connect to filtered host.");
+ goto COMMON_EXIT;
+ }
+ }
+#endif /* FILTER_ENABLE */
+
+ /* Build a new request from the first line of the header */
+ if (!(request = xmalloc(strlen(inbuf) + 1))) {
+ log("ERROR clientreq: cannot allocate buffer for request from %s",
+ peer_ipaddr);
+ httperr(connptr, 503, HTTP503ERROR);
+ goto COMMON_EXIT;
+ }
+
+ /* We need to set the version number WE support */
+ memcpy(request, inbuf, pmatch[METHOD_IND].rm_eo);
+ request[pmatch[METHOD_IND].rm_eo] = '\0';
+ strcat(request, " ");
+ strcat(request, uri->path);
+ if (uri->query) {
+ strcat(request, "?");
+ strcat(request, uri->query);
+ }
+ strcat(request, " HTTP/1.0\r\n");
+
+ /* chris - If domain is in dotted-quad format or is already in the
+ * DNS cache, then go straight to WAITCONN.
+ */
+ if (inet_aton(uri->authority, NULL) || lookup(NULL, uri->authority) == 0) {
+ if ((fd = opensock(uri->authority, port_no)) < 0) {
+ safefree(request);
+ httperr(connptr, 500,
+ "Unable to connect to host (cannot create sock)");
+ stats.num_badcons++;
+ goto COMMON_EXIT;
+ }
+
+ connptr->server_fd = fd;
+ connptr->type = WAITCONN;
+ }
+ /* Otherwise submit a DNS request and hope for the best. */
+ else {
+ if (adns_submit(adns, uri->authority, adns_r_a, adns_qf_quoteok_cname | adns_qf_cname_loose, connptr, &(connptr->adns_qu))) {
+ safefree(request);
+ httperr(connptr, 500, "Resolver error connecting to host");
+ stats.num_badcons++;
+ goto COMMON_EXIT;
+ } else {
+#ifdef __DEBUG__
+ log("DNS request submitted");
+#endif
+ /* copy domain for later caching */
+ connptr->domain = strdup(uri->authority);
+ connptr->type = DNS_WAITCONN;
+ }
+ }
+
+#ifdef XTINYPROXY
+ /* Add a X-Tinyproxy header which contains our IP address */
+ if (config.my_domain
+ && xstrstr(uri->authority, config.my_domain,
+ strlen(uri->authority), FALSE)) {
+ Add_XTinyproxy_Header(connptr);
+ }
+#endif
+
+ /* Add the rewritten request to the buffer */
+ unshift_buffer(connptr->cbuffer, request, strlen(request));
+
+ /*
+ * HACK HACK HACK: When we're sending a POST there is no restriction
+ * on the length of the header. If we don't let all the header lines
+ * through, the POST will not work. This _definitely_ needs to be
+ * fixed. - rjkaes
+ */
+ if (!xstrstr(inbuf, "POST ", 5, FALSE)) {
+ connptr->clientheader = TRUE;
+ }
+
+ COMMON_EXIT:
+ safefree(inbuf);
+ free_uri(uri);
+ return 0;
+}
+
+/* chris - added this to move a connection from the DNS_WAITCONN state
+ * to the WAITCONN state by connecting it to the server, once the name
+ * has been resolved.
+ */
+static int clientreq_dnscomplete(struct conn_s *connptr, struct in_addr *inaddr) {
+ int fd;
+
+ fd = opensock_inaddr(inaddr, connptr->port_no);
+
+ if (fd < 0) {
+#ifdef __DEBUG__
+ log("Failed to open connection to server");
+#endif
+ httperr(connptr, 500,
+ "Unable to connect to host (cannot create sock)");
+ stats.num_badcons++;
+
+ return 0;
+ } else {
+#ifdef __DEBUG__
+ log("Connected to server");
+#endif
+ connptr->server_fd = fd;
+ connptr->type = WAITCONN;
+ }
+
+ return 0;
+}
+
+/*
+ * Finish the client request
+ */
+static int clientreq_finish(struct conn_s *connptr)
+{
+ int sockopt, len = sizeof(sockopt);
+
+ assert(connptr);
+
+ if (getsockopt
+ (connptr->server_fd, SOL_SOCKET, SO_ERROR, &sockopt, &len) < 0) {
+ log("ERROR clientreq_finish: getsockopt error (%s)",
+ strerror(errno));
+ return -1;
+ }
+
+ if (sockopt != 0) {
+ if (sockopt == EINPROGRESS)
+ return 0;
+ else if (sockopt == ETIMEDOUT) {
+ httperr(connptr, 408, "Connect Timed Out");
+ return 0;
+ } else {
+ log("ERROR clientreq_finish: could not create connection (%s)",
+ strerror(sockopt));
+ return -1;
+ }
+ }
+
+ connptr->type = RELAYCONN;
+ stats.num_opens++;
+ return 0;
+}
+
+/*
+ * Check to see if the line is allowed or not depending on the anonymous
+ * headers which are to be allowed.
+ */
+static int anonheader(char *line)
+{
+ struct allowedhdr_s *allowedptr = allowedhdrs;
+
+ assert(line);
+ assert(allowedhdrs);
+
+ if (!xstrstr(line, "GET ", 4, FALSE)
+ || !xstrstr(line, "POST ", 5, FALSE)
+ || !xstrstr(line, "HEAD ", 5, FALSE))
+ return 1;
+
+ for (allowedptr = allowedhdrs; allowedptr;
+ allowedptr = allowedptr->next) {
+ if (!strncasecmp
+ (line, allowedptr->hdrname, strlen(allowedptr->hdrname))) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/*
+ * Used to read in the lines from the header (client side) when we're doing
+ * the anonymous header reduction.
+ */
+static int readanonconn(struct conn_s *connptr)
+{
+ char *line = NULL;
+ int retv;
+
+ assert(connptr);
+
+ if ((retv = readline(connptr->client_fd, connptr->cbuffer, &line)) <=
+ 0) {
+ return retv;
+ }
+
+ if ((line[0] == '\n') || (strncmp(line, "\r\n", 2) == 0)) {
+ connptr->clientheader = TRUE;
+ } else if (!anonheader(line)) {
+ safefree(line);
+ return 0;
+ }
+
+ push_buffer(connptr->cbuffer, line, strlen(line));
+ return 0;
+}
+
+/*
+ * Read in the bytes from the socket
+ */
+static int readconn(int fd, struct buffer_s *buffptr)
+{
+ int bytesin;
+
+ assert(fd >= 0);
+ assert(buffptr);
+
+ if ((bytesin = readbuff(fd, buffptr)) < 0) {
+ return -1;
+ }
+#ifdef __DEBUG__
+ log("readconn [%d]: %d", fd, bytesin);
+#endif
+
+ stats.num_rx += bytesin;
+ return bytesin;
+}
+
+/*
+ * Write the bytes from the buffer to the socket
+ */
+static int writeconn(int fd, struct buffer_s *buffptr)
+{
+ int bytessent;
+
+ assert(fd >= 0);
+ assert(buffptr);
+
+ if ((bytessent = writebuff(fd, buffptr)) < 0) {
+ return -1;
+ }
+
+ stats.num_tx += bytessent;
+ return bytessent;
+}
+
+/*
+ * Factored out the common function to read from the client. It was used in
+ * two different places with no change, so no point in having the same code
+ * twice.
+ */
+static int read_from_client(struct conn_s *connptr, fd_set * readfds)
+{
+ assert(connptr);
+ assert(readfds);
+
+ if (FD_ISSET(connptr->client_fd, readfds)) {
+ if (config.anonymous && !connptr->clientheader) {
+ if (readanonconn(connptr) < 0) {
+ shutdown(connptr->client_fd, 2);
+ shutdown(connptr->server_fd, 2);
+ connptr->type = FINISHCONN;
+ return -1;
+ }
+ } else if (readconn(connptr->client_fd, connptr->cbuffer) < 0) {
+ shutdown(connptr->client_fd, 2);
+ shutdown(connptr->server_fd, 2);
+ connptr->type = FINISHCONN;
+ return -1;
+ }
+ connptr->actiontime = time(NULL);
+ }
+
+ return 0;
+}
+
+/*
+ * Factored out the common write to client function since, again, it was used
+ * in two different places with no changes.
+ */
+static int write_to_client(struct conn_s *connptr, fd_set * writefds)
+{
+ assert(connptr);
+ assert(writefds);
+
+ if (FD_ISSET(connptr->client_fd, writefds)) {
+ if (writeconn(connptr->client_fd, connptr->sbuffer) < 0) {
+ shutdown(connptr->client_fd, 2);
+ shutdown(connptr->server_fd, 2);
+ connptr->type = FINISHCONN;
+ return -1;
+ }
+ connptr->actiontime = time(NULL);
+ }
+
+ return 0;
+}
+
+/*
+ * All of the *_req functions handle the various stages a connection can go
+ * through. I moved them out from getreqs because they handle a lot of error
+ * code and it was indenting too far in. As you can see they are very simple,
+ * and are only called once from getreqs, hence the inlining.
+ */
+
+inline static void newconn_req(struct conn_s *connptr, fd_set * readfds)
+{
+ assert(connptr);
+ assert(readfds);
+
+ if (FD_ISSET(connptr->client_fd, readfds)) {
+ if (clientreq(connptr) < 0) {
+ shutdown(connptr->client_fd, 2);
+ connptr->type = FINISHCONN;
+ return;
+ }
+
+ if (!connptr)
+ abort();
+
+ connptr->actiontime = time(NULL);
+ }
+}
+
+inline static void waitconn_req(struct conn_s *connptr, fd_set * readfds,
+ fd_set * writefds)
+{
+ assert(connptr);
+ assert(readfds);
+ assert(writefds);
+
+ if (read_from_client(connptr, readfds) < 0)
+ return;
+
+ if (FD_ISSET(connptr->server_fd, readfds)
+ || FD_ISSET(connptr->server_fd, writefds)) {
+ if (clientreq_finish(connptr) < 0) {
+ shutdown(connptr->server_fd, 2);
+ shutdown(connptr->client_fd, 2);
+ connptr->type = FINISHCONN;
+ return;
+ }
+ connptr->actiontime = time(NULL);
+ }
+}
+
+inline static void relayconn_req(struct conn_s *connptr, fd_set * readfds,
+ fd_set * writefds)
+{
+ assert(connptr);
+ assert(readfds);
+ assert(writefds);
+
+ if (read_from_client(connptr, readfds) < 0)
+ return;
+
+ if (FD_ISSET(connptr->server_fd, readfds)) {
+ if (connptr->serverheader) {
+ if (readconn(connptr->server_fd, connptr->sbuffer) < 0) {
+ shutdown(connptr->server_fd, 2);
+ connptr->type = CLOSINGCONN;
+ return;
+ }
+ } else {
+ /*
+ * We need to read in the first line to rewrite the
+ * version back down to HTTP/1.0 (if needed)
+ */
+ char *line = NULL, *ptr, *newline;
+ int retv;
+
+ if (
+ (retv =
+ readline(connptr->server_fd, connptr->sbuffer,
+ &line)) < 0) {
+ shutdown(connptr->server_fd, 2);
+ httperr(connptr, 500, "Server Closed Early");
+ return;
+ } else if (retv == 0)
+ return;
+
+ connptr->serverheader = TRUE;
+
+ if (strncasecmp(line, "HTTP/1.0", 8)) {
+ /* Okay, we need to rewrite it then */
+ if (!(ptr = strchr(line, ' '))) {
+ shutdown(connptr->server_fd, 2);
+ httperr(connptr, 500,
+ "There was Server Error");
+ return;
+ }
+ ptr++;
+
+ if (!(newline = xmalloc(strlen(line) + 1))) {
+ shutdown(connptr->server_fd, 2);
+ httperr(connptr, 503,
+ "No Memory Available");
+ return;
+ }
+
+ sprintf(newline, "HTTP/1.0 %s", ptr);
+ safefree(line);
+ line = newline;
+ }
+
+ push_buffer(connptr->sbuffer, line, strlen(line));
+ }
+ connptr->actiontime = time(NULL);
+ }
+
+ if (write_to_client(connptr, writefds) < 0)
+ return;
+
+ if (FD_ISSET(connptr->server_fd, writefds)) {
+ if (writeconn(connptr->server_fd, connptr->cbuffer) < 0) {
+ shutdown(connptr->server_fd, 2);
+ connptr->type = CLOSINGCONN;
+ return;
+ }
+ connptr->actiontime = time(NULL);
+ }
+}
+
+inline static void closingconn_req(struct conn_s *connptr, fd_set * writefds)
+{
+ assert(connptr);
+ assert(writefds);
+
+ write_to_client(connptr, writefds);
+}
+
+/*
+ * Check against the valid subnet to see if we should allow the access
+ */
+static int validuser(int fd)
+{
+ char ipaddr[PEER_IP_LENGTH];
+
+ assert(fd >= 0);
+
+ if (config.subnet == NULL)
+ return 1;
+
+ if (!strncmp(config.subnet, getpeer_ip(fd, ipaddr),
+ strlen(config.subnet))) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+/*
+ * Loop that checks for new connections, dispatches to the correct
+ * routines if bytes are pending, checks to see if it's time for a
+ * garbage collect.
+ */
+int getreqs(void)
+{
+ static unsigned int garbc = 0;
+ fd_set readfds, writefds, exceptfds; /* chris - ADNS expects exceptfds */
+ struct conn_s *connptr;
+ int fd;
+ struct timeval tv, now; /* chris - for ADNS timeouts */
+
+ char peer_ipaddr[PEER_IP_LENGTH];
+
+ if (setup_fd < 0) {
+ log("ERROR getreqs: setup_fd not a socket");
+ return -1;
+ }
+
+ /* Garbage collect the dead connections and close any idle ones */
+ if (garbc++ >= GARBCOLL_INTERVAL) {
+ garbcoll();
+ garbc = 0;
+ }
+ conncoll();
+
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_SET(setup_fd, &readfds);
+
+ for (connptr = connections; connptr; connptr = connptr->next) {
+#ifdef __DEBUG__
+ log("Connptr: %p - %d / client %d server %d", connptr,
+ connptr->type, connptr->client_fd, connptr->server_fd);
+#endif
+ switch (connptr->type) {
+ case NEWCONN:
+ if (buffer_size(connptr->cbuffer) < MAXBUFFSIZE)
+ FD_SET(connptr->client_fd, &readfds);
+ else {
+ httperr(connptr, 414,
+ "Your Request is way too long.");
+ }
+ break;
+
+ /* no case here for DNS_WAITCONN */
+
+ case WAITCONN:
+ FD_SET(connptr->server_fd, &readfds);
+ FD_SET(connptr->server_fd, &writefds);
+
+ if (buffer_size(connptr->cbuffer) < MAXBUFFSIZE)
+ FD_SET(connptr->client_fd, &readfds);
+ break;
+
+ case RELAYCONN:
+ if (buffer_size(connptr->sbuffer) > 0)
+ FD_SET(connptr->client_fd, &writefds);
+ if (buffer_size(connptr->sbuffer) < MAXBUFFSIZE)
+ FD_SET(connptr->server_fd, &readfds);
+
+ if (buffer_size(connptr->cbuffer) > 0)
+ FD_SET(connptr->server_fd, &writefds);
+ if (buffer_size(connptr->cbuffer) < MAXBUFFSIZE)
+ FD_SET(connptr->client_fd, &readfds);
+
+ break;
+
+ case CLOSINGCONN:
+ if (buffer_size(connptr->sbuffer) > 0)
+ FD_SET(connptr->client_fd, &writefds);
+ else {
+ shutdown(connptr->client_fd, 2);
+ shutdown(connptr->server_fd, 2);
+ connptr->type = FINISHCONN;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ /* Set a 60 second time out */
+ tv.tv_sec = 1;//60;
+ tv.tv_usec = 0;
+
+ /* chris - Make ADNS do its stuff, too. */
+ {
+ struct timeval *tv_mod = &tv;
+ int foo = FD_SETSIZE;
+ gettimeofday(&now, NULL);
+ FD_ZERO(&exceptfds);
+ adns_beforeselect(adns, &foo, &readfds, &writefds, &exceptfds, &tv_mod, NULL, &now);
+ }
+
+ if (select(FD_SETSIZE, &readfds, &writefds, &exceptfds, &tv) < 0) {
+#ifdef __DEBUG__
+ log("select error: %s", strerror(errno));
+#endif
+ return 0;
+ }
+
+ /* chris - see whether any ADNS lookups have completed */
+ gettimeofday(&now, NULL);
+ adns_afterselect(adns, FD_SETSIZE, &readfds, &writefds, &exceptfds, &now);
+
+ for (connptr = connections; connptr; connptr = connptr->next) {
+ adns_answer *ans;
+
+ if (connptr->type == DNS_WAITCONN &&
+ adns_check(adns, &(connptr->adns_qu), &ans, (void**)&connptr) == 0) {
+
+ if (ans->status == adns_s_ok) {
+ if (connptr->domain) {
+ insert(ans->rrs.inaddr, connptr->domain);
+ free(connptr->domain);
+ }
+
+ clientreq_dnscomplete(connptr, ans->rrs.inaddr);
+ free(ans);
+
+ /* hack */
+ FD_SET(connptr->server_fd, &readfds);
+#ifdef __DEBUG__
+ log("DNS resolution successful");
+#endif
+ } else {
+ free(ans);
+
+ httperr(connptr, 500, "Unable to resolve hostname in URL");
+#ifdef __DEBUG__
+ log("DNS resolution failed");
+#endif
+ }
+ }
+ }
+
+ /* Check to see if there are new connections pending */
+ if (FD_ISSET(setup_fd, &readfds) && (fd = listen_sock()) >= 0) {
+ new_conn(fd); /* make a connection from the FD */
+
+ if (validuser(fd)) {
+ if (config.cutoffload && (load > config.cutoffload)) {
+ stats.num_refused++;
+ httperr(connptr, 503,
+ "tinyproxy is not accepting connections due to high system load");
+ }
+ } else {
+ httperr(connptr, 403,
+ "You are not authorized to use the service.");
+ log("AUTH Rejected connection from %s",
+ getpeer_ip(fd, peer_ipaddr));
+ }
+ }
+
+ /*
+ * Loop through the connections and dispatch them to the appropriate
+ * handler
+ */
+ for (connptr = connections; connptr; connptr = connptr->next) {
+ switch (connptr->type) {
+ case NEWCONN:
+ newconn_req(connptr, &readfds);
+ break;
+
+ case WAITCONN:
+ waitconn_req(connptr, &readfds, &writefds);
+ break;
+
+ case RELAYCONN:
+ relayconn_req(connptr, &readfds, &writefds);
+ break;
+
+ case CLOSINGCONN:
+ closingconn_req(connptr, &writefds);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return 0;
+}
diff --git a/src/reqs.h b/src/reqs.h
new file mode 100644
index 0000000..182fc20
--- /dev/null
+++ b/src/reqs.h
@@ -0,0 +1,24 @@
+/* $Id: reqs.h,v 1.1.1.1 2000-02-16 17:32:23 sdyoung Exp $
+ *
+ * See 'reqs.c' for a detailed description.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef _REQS_H_
+#define _REQS_H_ 1
+
+extern int getreqs(void);
+
+#endif
diff --git a/src/sock.c b/src/sock.c
new file mode 100644
index 0000000..dc415e5
--- /dev/null
+++ b/src/sock.c
@@ -0,0 +1,362 @@
+/* $Id: sock.c,v 1.1.1.1 2000-02-16 17:32:23 sdyoung Exp $
+ *
+ * Sockets are created and destroyed here. When a new connection comes in from
+ * a client, we need to copy the socket and the create a second socket to the
+ * remote server the client is trying to connect to. Also, the listening
+ * socket is created and destroyed here. Sounds more impressive than it
+ * actually is.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ * Copyright (C) 2000 Chris Lightfoot (chris@ex-parrot.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <errno.h>
+#include <netdb.h>
+#include <string.h>
+#include <unistd.h>
+#include <arpa/inet.h>
+#include <fcntl.h>
+#include <assert.h>
+
+#include "tinyproxy.h"
+#include "sock.h"
+#include "log.h"
+#include "utils.h"
+#include "dnscache.h"
+
+/* This routine is so old I can't even remember writing it. But I do
+ * remember that it was an .h file because I didn't know putting code in a
+ * header was bad magic yet. anyway, this routine opens a connection to a
+ * system and returns the fd.
+ */
+
+/*
+ * Cleaned up some of the code to use memory routines which are now the
+ * default. Also, the routine first checks to see if the address is in
+ * dotted-decimal form before it does a name lookup. Finally, the newly
+ * created socket is made non-blocking.
+ * - rjkaes
+ */
+int opensock(char *ip_addr, int port)
+{
+ int sock_fd, flags;
+ struct sockaddr_in port_info;
+
+ assert(ip_addr);
+ assert(port > 0);
+
+ memset((struct sockaddr *) &port_info, 0, sizeof(port_info));
+
+ port_info.sin_family = AF_INET;
+
+ /* chris - Could block; neet to ensure that this is never called
+ * before a non-blocking DNS query happens for this address. Not
+ * relevant in the code as it stands.
+ */
+ if (dnscache(&port_info.sin_addr, ip_addr) < 0) {
+ log("ERROR opensock: Could not lookup address: %s", ip_addr);
+ return -1;
+ }
+
+ port_info.sin_port = htons(port);
+
+ if ((sock_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
+ log("ERROR opensock: socket (%s)", strerror(errno));
+ return -1;
+ }
+
+ flags = fcntl(sock_fd, F_GETFL, 0);
+ fcntl(sock_fd, F_SETFL, flags | O_NONBLOCK);
+
+ if (connect
+ (sock_fd, (struct sockaddr *) &port_info, sizeof(port_info)) < 0) {
+ if (errno != EINPROGRESS) {
+ log("ERROR opensock: connect (%s)", strerror(errno));
+ return -1;
+ }
+ }
+
+ return sock_fd;
+}
+
+/* chris - added this to open a socket given a struct in_addr */
+int opensock_inaddr(struct in_addr *inaddr, int port)
+{
+ int sock_fd, flags;
+ struct sockaddr_in port_info;
+
+ assert(inaddr);
+ assert(port > 0);
+
+ memset((struct sockaddr *) &port_info, 0, sizeof(port_info));
+
+ port_info.sin_family = AF_INET;
+
+ memcpy(&port_info.sin_addr, inaddr, sizeof(struct in_addr));
+
+ port_info.sin_port = htons(port);
+
+ if ((sock_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
+ log("ERROR opensock_inaddr: socket (%s)", strerror(errno));
+ return -1;
+ }
+
+ flags = fcntl(sock_fd, F_GETFL, 0);
+ fcntl(sock_fd, F_SETFL, flags | O_NONBLOCK);
+
+ if (connect
+ (sock_fd, (struct sockaddr *) &port_info, sizeof(port_info)) < 0) {
+ if (errno != EINPROGRESS) {
+ log("ERROR opensock: connect (%s)", strerror(errno));
+ return -1;
+ }
+ }
+
+ return sock_fd;
+}
+
+int setup_fd;
+static struct sockaddr listen_sock_addr;
+
+/*
+ * Start listening to a socket.
+ */
+int init_listen_sock(int port)
+{
+ struct sockaddr_in laddr;
+ int i = 1;
+
+ assert(port > 0);
+
+ if ((setup_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
+ log("ERROR init_listen_sock: socket (%s)", strerror(errno));
+ return -1;
+ }
+
+ if (setsockopt(setup_fd, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i)) < 0) {
+ log("ERROR init_listen_sock: setsockopt (%s)",
+ strerror(errno));
+ return -1;
+ }
+
+ memset(&listen_sock_addr, 0, sizeof(listen_sock_addr));
+ memset(&laddr, 0, sizeof(laddr));
+ laddr.sin_family = AF_INET;
+ laddr.sin_port = htons(port);
+
+ if (config.ipAddr) {
+ laddr.sin_addr.s_addr = inet_addr(config.ipAddr);
+ } else {
+ laddr.sin_addr.s_addr = inet_addr("0.0.0.0");
+ }
+ if (bind(setup_fd, (struct sockaddr *) &laddr, sizeof(laddr)) < 0) {
+ log("ERROR init_listen_sock: bind (%s)", strerror(errno));
+ return -1;
+ }
+ if ((listen(setup_fd, MAXLISTEN)) != 0) {
+ log("ERROR init_listen_sock: listen (%s)", strerror(errno));
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
+ * Grab a pending connection
+ */
+int listen_sock(void)
+{
+ static int sock;
+ int sz = sizeof(listen_sock_addr);
+
+ if ((sock = accept(setup_fd, &listen_sock_addr, &sz)) < 0) {
+ if (errno != ECONNABORTED
+#ifdef EPROTO
+ && errno != EPROTO
+#endif
+#ifdef EWOULDBLOCK
+ && errno != EWOULDBLOCK
+#endif
+ && errno != EINTR)
+ log("ERROR listen_sock: accept (%s)", strerror(errno));
+ return -1;
+ }
+ stats.num_listens++;
+
+ return sock;
+}
+
+/*
+ * Stop listening on a socket.
+ */
+void de_init_listen_sock(void)
+{
+ close(setup_fd);
+}
+
+/*
+ * Takes a socket descriptor and returns the string contain the peer's
+ * IP address.
+ */
+char *getpeer_ip(int fd, char *ipaddr)
+{
+ struct sockaddr_in name;
+ int namelen = sizeof(name);
+
+ assert(fd >= 0);
+ assert(ipaddr);
+
+ memset(ipaddr, '\0', PEER_IP_LENGTH);
+
+ if (getpeername(fd, (struct sockaddr *) &name, &namelen) != 0) {
+ log("ERROR Connect: 'could not get peer name'");
+ } else {
+ strncpy(ipaddr,
+ inet_ntoa(*(struct in_addr *) &name.sin_addr.s_addr),
+ PEER_IP_LENGTH - 1);
+ }
+
+ return ipaddr;
+}
+
+/*
+ * Takes a socket descriptor and returns the string containing the peer's
+ * address.
+ */
+char *getpeer_string(int fd, char *string)
+{
+ struct sockaddr_in name;
+ int namelen = sizeof(name);
+ struct hostent *peername;
+
+ assert(fd >= 0);
+ assert(string);
+
+ memset(string, '\0', PEER_STRING_LENGTH);
+
+ if (getpeername(fd, (struct sockaddr *) &name, &namelen) != 0) {
+ log("ERROR Connect: 'could not get peer name'");
+ } else {
+ if (
+ (peername =
+ gethostbyaddr((char *) &name.sin_addr.s_addr,
+ sizeof(name.sin_addr.s_addr),
+ AF_INET)) != NULL) {
+ strncpy(string, peername->h_name,
+ PEER_STRING_LENGTH - 1);
+ }
+ }
+
+ return string;
+}
+
+
+/*
+ * Read one line of the header
+ */
+int readline(int fd, struct buffer_s *buffer, char **line)
+{
+ char inbuf[BUFFER];
+ int bytesin;
+ char *endline = NULL;
+ char *newline;
+ struct bufline_s *oldline;
+ unsigned long len = 0, length;
+
+ assert(fd >= 0);
+ assert(buffer);
+ assert(line);
+
+ *line = NULL;
+
+ if ((bytesin = recv(fd, inbuf, BUFFER - 1, MSG_PEEK)) <= 0) {
+ goto CONN_ERROR;
+ }
+
+ endline = xstrstr(inbuf, "\n", bytesin, FALSE);
+
+ if (endline) {
+ endline++;
+ *endline = '\0';
+
+ length = strlen(inbuf);
+ memset(inbuf, '\0', BUFFER);
+
+ /* Actually pull it off the queue */
+ if ((bytesin = recv(fd, inbuf, length, 0)) <= 0) {
+ goto CONN_ERROR;
+ }
+
+ *line = xstrdup(inbuf);
+
+ if (buffer_size(buffer) > 0) {
+ if (!(newline = xmalloc(buffer_size(buffer)
+ + length + 1))) {
+ return -1;
+ }
+
+ newline[0] = '\0';
+
+ while ((oldline = shift_buffer(buffer))) {
+ memcpy(newline + len, oldline->string,
+ oldline->length);
+
+ len += oldline->length;
+ free_line(oldline);
+ }
+
+ memcpy(newline + len, *line, strlen(*line) + 1);
+ safefree(*line);
+
+ *line = newline;
+ }
+
+ return strlen(*line);
+ }
+
+ /*
+ * We didn't find a '\r\n', but we've filled the buffer.. pull it off
+ * and try again later...
+ */
+ if ((bytesin = recv(fd, inbuf, bytesin, 0)) <= 0) {
+ goto CONN_ERROR;
+ }
+
+ if (!(*line = xmalloc(bytesin + 1))) {
+ return -1;
+ }
+
+ memcpy(*line, inbuf, bytesin);
+ (*line)[bytesin] = '\0';
+
+ push_buffer(buffer, *line, strlen(*line));
+
+ return 0;
+
+ CONN_ERROR:
+ if (bytesin == 0 || (errno != EAGAIN && errno != EINTR)) {
+ return -1;
+ }
+ return 0;
+}
diff --git a/src/sock.h b/src/sock.h
new file mode 100644
index 0000000..952a673
--- /dev/null
+++ b/src/sock.h
@@ -0,0 +1,40 @@
+/* $Id: sock.h,v 1.1.1.1 2000-02-16 17:32:23 sdyoung Exp $
+ *
+ * See 'sock.c' for a detailed description.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef _SOCK_H_
+#define _SOCK_H_ 1
+
+#include "buffer.h"
+
+#define PEER_IP_LENGTH 16
+#define PEER_STRING_LENGTH 256
+
+extern int setup_fd;
+
+extern int opensock(char *ip_addr, int port);
+extern int opensock_inaddr(struct in_addr *inaddr, int port);
+extern int init_listen_sock(int port);
+extern int listen_sock(void);
+extern void de_init_listen_sock(void);
+extern int setsocketopt(int *sock_fd, int options, int flip);
+
+extern char *getpeer_ip(int fd, char *ipaddr);
+extern char *getpeer_string(int fd, char *string);
+extern int readline(int fd, struct buffer_s *buffer, char **line);
+
+#endif
diff --git a/src/stamp-h.in b/src/stamp-h.in
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/src/stamp-h.in
@@ -0,0 +1 @@
+timestamp
diff --git a/src/tinyproxy.c b/src/tinyproxy.c
new file mode 100644
index 0000000..1425492
--- /dev/null
+++ b/src/tinyproxy.c
@@ -0,0 +1,478 @@
+/* $Id: tinyproxy.c,v 1.1.1.1 2000-02-16 17:32:23 sdyoung Exp $
+ *
+ * The initialize routine. Basically sets up all the initial stuff (logfile,
+ * listening socket, config options, etc.) and then sits there and loops
+ * over the new connections until the daemon is closed. Also has additional
+ * functions to handle the "user friendly" aspects of a program (usage,
+ * stats, etc.) Like any good program, most of the work is actually done
+ * elsewhere.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ * Copyright (C) 2000 Chris Lightfoot (chris@ex-parrot.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <sysexits.h>
+#include <pwd.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <time.h>
+#include <sys/time.h>
+#include <syslog.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+/* chris - need this for asynchronous DNS resolution */
+#include <adns.h>
+
+adns_state adns;
+
+#include "config.h"
+#include "tinyproxy.h"
+#include "utils.h"
+#include "log.h"
+#include "sock.h"
+#include "conns.h"
+#include "reqs.h"
+#include "buffer.h"
+#include "filter.h"
+
+void takesig(int sig);
+
+/*
+ * Global Structures
+ */
+struct config_s config = {
+ NULL, /* Log file handle */
+ DEFAULT_LOG, /* Logfile name */
+ FALSE, /* Use syslog instead? */
+ DEFAULT_CUTOFFLOAD, /* Cut off load */
+ DEFAULT_PORT, /* Listen on this port */
+ DEFAULT_STATHOST, /* URL of stats host */
+ FALSE, /* Quit? */
+ DEFAULT_USER, /* Name of user to change to */
+ FALSE, /* Run anonymous by default? */
+ NULL, /* String containing the subnet allowed */
+ NULL, /* IP address to listen on */
+#ifdef FILTER_ENABLE
+ NULL, /* Location of filter file */
+#endif /* FILTER_ENABLE */
+ FALSE, /* Restrict the log to only errors */
+#ifdef XTINYPROXY
+ NULL /* The name of this domain */
+#endif
+};
+
+struct stat_s stats;
+float load = 0.00;
+struct allowedhdr_s *allowedhdrs = NULL;
+
+/*
+ * Dump info to the logfile
+ */
+static void dumpdebug(void)
+{
+ struct conn_s *connptr = connections;
+ long clients = 0, waiting = 0, relaying = 0, closing = 0, finished = 0;
+
+ log("SIGUSR1 received, debug dump follows.");
+
+ while (connptr) {
+ switch (connptr->type) {
+ case NEWCONN:
+ clients++;
+ break;
+ case WAITCONN:
+ waiting++;
+ break;
+ case RELAYCONN:
+ relaying++;
+ break;
+ case CLOSINGCONN:
+ closing++;
+ break;
+ case FINISHCONN:
+ finished++;
+ break;
+ default:
+ break;
+ }
+ connptr = connptr->next;
+ }
+ log("clients: %d, waiting: %d, relaying: %d," \
+ "closing: %d, finished: %d",
+ clients, waiting, relaying, closing, finished);
+ log("total requests handled: %lu", stats.num_reqs);
+ log("total connections handled: %lu", stats.num_cons);
+ log("total sockets listened: %lu", stats.num_listens);
+ log("total sockets opened: %lu", stats.num_opens);
+ log("total bad opens: %lu", stats.num_badcons);
+ log("total bytes tx: %lu", stats.num_tx);
+ log("total bytes rx: %lu", stats.num_rx);
+ log("connections refused due to load: %lu", stats.num_refused);
+ log("garbage collections: %lu", stats.num_garbage);
+ log("idle connections killed: %lu", stats.num_idles);
+ log("end debug dump.");
+}
+
+/*
+ * Handle a signal
+ */
+void takesig(int sig)
+{
+ switch (sig) {
+ case SIGUSR1:
+ dumpdebug();
+ break;
+ case SIGHUP:
+ if (config.logf)
+ ftruncate(fileno(config.logf), 0);
+
+ log("SIGHUP received, cleaning up...");
+ conncoll();
+ garbcoll();
+
+#ifdef FILTER_ENABLE
+ if (config.filter) {
+ filter_destroy();
+ filter_init();
+ }
+ log("Re-reading filter file.");
+#endif /* FILTER_ENABLE */
+ log("Finished cleaning memory/connections.");
+ break;
+ case SIGTERM:
+#ifdef FILTER_ENABLE
+ if (config.filter)
+ filter_destroy();
+#endif /* FILTER_ENABLE */
+ config.quit = TRUE;
+ break;
+ case SIGALRM:
+ calcload();
+ alarm(LOAD_RECALCTIMER);
+ break;
+ }
+ if (sig != SIGTERM)
+ signal(sig, takesig);
+ signal(SIGPIPE, SIG_IGN);
+}
+
+/*
+ * Display usage to the user on stderr.
+ */
+static void usagedisp(void)
+{
+ printf("tinyproxy version " VERSION "\n");
+ printf("Copyright 1998 Steven Young (sdyoung@well.com)\n");
+ printf
+ ("Copyright 1998-1999 Robert James Kaes (rjkaes@flarenet.com)\n\n");
+ printf("Copyright 2000 Chris Lightfoot (chris@ex-parrot.com)\n");
+
+ printf
+ ("This software is licensed under the GNU General Public License (GPL).\n");
+ printf("See the file 'COPYING' included with tinyproxy source.\n\n");
+
+ printf("Compiled with Ian Jackson's adns:\n");
+ printf(" http://www.chiark.greenend.org.uk/~ian/adns/\n\n");
+
+ printf("Usage: tinyproxy [args]\n");
+ printf("Options:\n");
+ printf("\t-v\t\tdisplay version number\n");
+ printf("\t-h\t\tdisplay usage\n");
+ printf("\t-d\t\tdo not daemonize\n");
+ printf
+ ("\t-n ip_address\tallow access from only this subnet. (i.e. 192.168.0.)\n");
+ printf("\t-i ip_address\tonly listen on this address\n");
+ printf("\t-p port\t\tlisten on 'port'\n");
+ printf("\t-l logfile\tlog to 'logfile'\n");
+#ifdef HAVE_SYSLOG_H
+ printf("\t-S\t\tlog using the syslog instead\n");
+#endif
+ printf("\t-r\t\trestrict the log to only errors\n");
+ printf
+ ("\t-w load\t\tstop accepting new connections at 'load'. 0 disables\n");
+ printf("\t-s stathost\tset stathost to 'stathost'\n");
+ printf("\t-u user\t\tchange to user after startup. \"\" disables\n");
+ printf("\t-a header\tallow 'header' through the anon block\n");
+#ifdef FILTER_ENABLE
+ printf("\t-f filterfile\tblock sites specified in filterfile\n");
+#endif /* FILTER_ENABLE */
+#ifdef XTINYPROXY
+ printf
+ ("\t-x domain\tAdd a XTinyproxy header with the peer's IP address\n");
+#endif
+
+ /* Display the modes compiled into tinyproxy */
+ printf("\nFeatures Compiled In:\n");
+#ifdef XTINYPROXY
+ printf(" XTinyproxy Header\n");
+#endif /* XTINYPROXY */
+#ifdef FILTER_ENABLE
+ printf(" Filtering\n");
+ printf(" * with Regular Expression support\n");
+#endif /* FILTER_ENABLE */
+#ifndef NDEBUG
+ printf(" Debuggin code\n");
+#endif /* NDEBUG */
+}
+
+int main(int argc, char **argv)
+{
+ int optch;
+ flag usage = FALSE, godaemon = TRUE, changeid = FALSE;
+ struct passwd *thisuser = NULL;
+
+ struct allowedhdr_s **rpallowedptr = &allowedhdrs;
+ struct allowedhdr_s *allowedptr = allowedhdrs, *newallowed;
+
+ while ((optch = getopt(argc, argv, "vh?dp:l:Sa:w:s:u:n:i:rx:f:")) !=
+ EOF) {
+ switch (optch) {
+ case 'v':
+ fprintf(stderr, "tinyproxy version " VERSION "\n");
+ exit(EX_OK);
+ break;
+ case 'p':
+ if (!(config.port = atoi(optarg))) {
+ log
+ ("bad port on commandline, defaulting to %d",
+ DEFAULT_PORT);
+ config.port = DEFAULT_PORT;
+ }
+ break;
+ case 'l':
+ if (!(config.logf_name = xstrdup(optarg))) {
+ log("bad log file, defaulting to %s",
+ DEFAULT_LOG);
+ config.logf_name = DEFAULT_LOG;
+ }
+ break;
+#ifdef HAVE_SYSLOG_H
+ case 'S': /* Use the syslog function to handle logging */
+ config.syslog = TRUE;
+ break;
+#endif
+ case 'd':
+ godaemon = FALSE;
+ break;
+ case 'w':
+ sscanf(optarg, "%f", &config.cutoffload);
+ break;
+ case 's':
+ if (!(config.stathost = xstrdup(optarg))) {
+ log("bad stathost, defaulting to %s",
+ DEFAULT_STATHOST);
+ config.stathost = DEFAULT_STATHOST;
+ }
+ break;
+ case 'u':
+ if (!(config.changeuser = xstrdup(optarg))) {
+ log("bad user name, defaulting to %s",
+ DEFAULT_USER);
+ config.changeuser = DEFAULT_USER;
+ }
+ break;
+ case 'a':
+ config.anonymous = TRUE;
+
+ while (allowedptr) {
+ rpallowedptr = &allowedptr->next;
+ allowedptr = allowedptr->next;
+ }
+
+ if (!
+ (newallowed =
+ xmalloc(sizeof(struct allowedhdr_s)))) {
+ log("tinyproxy: cannot allocate headers");
+ exit(EX_SOFTWARE);
+ }
+
+ if (!(newallowed->hdrname = xstrdup(optarg))) {
+ log("tinyproxy: cannot duplicate string");
+ exit(EX_SOFTWARE);
+ }
+
+ *rpallowedptr = newallowed;
+ newallowed->next = allowedptr;
+
+ break;
+ case 'n':
+ if (!(config.subnet = xstrdup(optarg))) {
+ log("tinyproxy: could not allocate memory");
+ exit(EX_SOFTWARE);
+ }
+ break;
+ case 'i':
+ if (!(config.ipAddr = xstrdup(optarg))) {
+ log("tinyproxy: could not allocate memory");
+ exit(EX_SOFTWARE);
+ }
+ break;
+#ifdef FILTER_ENABLE
+ case 'f':
+ if (!(config.filter = xstrdup(optarg))) {
+ log("tinyproxy: could not allocate memory");
+ }
+ break;
+#endif /* FILTER_ENABLE */
+ case 'r':
+ config.restricted = TRUE;
+ break;
+#ifdef XTINYPROXY
+ case 'x':
+ if (!(config.my_domain = xstrdup(optarg))) {
+ log("tinyproxy: could not allocate memory");
+ exit(EX_SOFTWARE);
+ }
+ break;
+#endif
+ case '?':
+ case 'h':
+ default:
+ usage = TRUE;
+ break;
+ }
+ }
+
+ if (usage == TRUE) {
+ usagedisp();
+ exit(EX_OK);
+ }
+
+ /* chris - Initialise asynchronous DNS */
+ if (adns_init(&adns, 0, 0)) {
+ log("tinyproxy: could not initialise ADNS");
+ exit(EX_SOFTWARE);
+ }
+
+ /* Open the log file if not using syslog */
+ if (config.syslog == FALSE) {
+ if (!(config.logf = fopen(config.logf_name, "a"))) {
+ fprintf(stderr,
+ "Unable to open logfile %s for appending!\n",
+ config.logf_name);
+ exit(EX_CANTCREAT);
+ }
+ } else {
+ if (godaemon == TRUE)
+ openlog("tinyproxy", LOG_PID, LOG_DAEMON);
+ else
+ openlog("tinyproxy", LOG_PID, LOG_USER);
+ }
+
+ log(PACKAGE " " VERSION " starting...");
+
+ if (strlen(config.changeuser)) {
+ if ((getuid() != 0) && (geteuid() != 0)) {
+ log
+ ("not running as root, therefore not changing uid/gid.");
+ } else {
+ changeid = TRUE;
+ if (!(thisuser = getpwnam(config.changeuser))) {
+ log("unable to find user \"%s\"!",
+ config.changeuser);
+ exit(EX_NOUSER);
+ }
+ log("changing to user \"%s\" (%d/%d).",
+ config.changeuser, thisuser->pw_uid,
+ thisuser->pw_gid);
+ }
+ }
+#ifdef NDEBUG
+ if (godaemon == TRUE)
+ makedaemon();
+#else
+ printf("Debugging is enabled, so you can not go daemon.\n");
+#endif
+
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
+ fprintf(stderr, "Could not set SIGPIPE\n");
+ exit(EX_OSERR);
+ }
+ if (signal(SIGUSR1, takesig) == SIG_ERR) {
+ fprintf(stderr, "Could not set SIGUSR1\n");
+ exit(EX_OSERR);
+ }
+ if (signal(SIGTERM, takesig) == SIG_ERR) {
+ fprintf(stderr, "Could not set SIGTERM\n");
+ exit(EX_OSERR);
+ }
+ if (signal(SIGHUP, takesig) == SIG_ERR) {
+ fprintf(stderr, "Could not set SIGHUP\n");
+ exit(EX_OSERR);
+ }
+ if (signal(SIGALRM, takesig) == SIG_ERR) {
+ fprintf(stderr, "Could not set SIGALRM\n");
+ exit(EX_OSERR);
+ }
+ alarm(LOAD_RECALCTIMER);
+ calcload();
+
+ if (init_listen_sock(config.port) < 0) {
+ log("unable to bind port %d!", config.port);
+ exit(EX_UNAVAILABLE);
+ }
+ if (changeid == TRUE) {
+ setuid(thisuser->pw_uid);
+ setgid(thisuser->pw_gid);
+ }
+ log("now accepting connections.");
+
+#ifdef FILTER_ENABLE
+ if (config.filter)
+ filter_init();
+#endif /* FILTER_ENABLE */
+
+ while (config.quit == FALSE) {
+ if (getreqs() < 0)
+ break;
+ }
+
+#ifdef FILTER_ENABLE
+ if (config.filter)
+ filter_destroy();
+#endif /* FILTER_ENABLE */
+
+ log("shutting down.");
+ de_init_listen_sock();
+
+ if (config.syslog == FALSE)
+ fclose(config.logf);
+ else
+ closelog();
+
+ allowedptr = allowedhdrs;
+ while (allowedptr) {
+ struct allowedhdr_s *delptr = NULL;
+ delptr = allowedptr;
+ safefree(delptr->hdrname);
+ allowedptr = delptr->next;
+ safefree(delptr);
+ }
+
+ /* finsih up ADNS */
+ adns_finish(adns);
+
+ exit(EX_OK);
+}
diff --git a/src/tinyproxy.h b/src/tinyproxy.h
new file mode 100644
index 0000000..218d729
--- /dev/null
+++ b/src/tinyproxy.h
@@ -0,0 +1,87 @@
+/* $Id: tinyproxy.h,v 1.1.1.1 2000-02-16 17:32:23 sdyoung Exp $
+ *
+ * See 'tinyproxy.c' for a detailed description.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef _TINYPROXY_H_
+#define _TINYPROXY_H_ 1
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <stdio.h>
+#include <time.h>
+
+#include "config.h"
+
+/* Global variables for the main controls of the program */
+#define BUFFER (1024 * 2) /* Size of buffer for reading */
+#define MAXLISTEN 128 /* Max number of connections to listen for */
+
+/* Make a new type: flag */
+typedef char flag;
+
+/* Other stuff */
+#define FALSE (0)
+#define TRUE (!FALSE)
+
+struct config_s {
+ FILE *logf;
+ char *logf_name;
+ flag syslog;
+ float cutoffload;
+ int port;
+ char *stathost;
+ flag quit;
+ char *changeuser;
+ flag anonymous;
+ char *subnet;
+ char *ipAddr;
+#ifdef FILTER_ENABLE
+ char *filter;
+#endif /* FILTER_ENABLE */
+ flag restricted;
+#ifdef XTINYPROXY
+ char *my_domain;
+#endif
+};
+
+struct stat_s {
+ unsigned long int num_reqs;
+ unsigned long int num_cons;
+ unsigned long int num_badcons;
+ unsigned long int num_opens;
+ unsigned long int num_listens;
+ unsigned long int num_tx;
+ unsigned long int num_rx;
+ unsigned long int num_garbage;
+ unsigned long int num_idles;
+ unsigned long int num_refused;
+};
+
+struct allowedhdr_s {
+ char *hdrname;
+ struct allowedhdr_s *next;
+};
+
+/* Global Structures used in the program */
+extern struct config_s config;
+extern struct stat_s stats;
+extern struct allowedhdr_s *allowedhdrs;
+extern float load;
+
+#endif
diff --git a/src/uri.c b/src/uri.c
new file mode 100644
index 0000000..8a2b744
--- /dev/null
+++ b/src/uri.c
@@ -0,0 +1,124 @@
+/* $Id: uri.c,v 1.1.1.1 2000-02-16 17:32:23 sdyoung Exp $
+ *
+ * This borrows the REGEX from RFC2396 to split a URI string into the five
+ * primary components. The components are:
+ * scheme the uri method (like "http", "ftp", "gopher")
+ * authority the domain and optional ":" port
+ * path path to the document/resource
+ * query an optional query (separated with a "?")
+ * fragment an optional fragement (separated with a "#")
+ *
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "uri.h"
+#include "utils.h"
+#include "log.h"
+#include "regexp.h"
+
+#define NMATCH 10
+
+#define URIPATTERN "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"
+
+#define SCHEME 2
+#define AUTHORITY 4
+#define PATH 5
+#define QUERY_MARK 6
+#define QUERY 7
+#define FRAGMENT_MARK 8
+#define FRAGMENT 9
+
+static int extract_uri(regmatch_t pmatch[], const char *buffer, char **section,
+ int substring)
+{
+ int len = pmatch[substring].rm_eo - pmatch[substring].rm_so;
+ if ((*section = xmalloc(len + 1)) == NULL)
+ return -1;
+
+ memset(*section, '\0', len + 1);
+ memcpy(*section, buffer + pmatch[substring].rm_so, len);
+
+ return 0;
+}
+
+void free_uri(URI * uri)
+{
+ safefree(uri->scheme);
+ safefree(uri->authority);
+ safefree(uri->path);
+ safefree(uri->query);
+ safefree(uri->fragment);
+ safefree(uri);
+}
+
+URI *explode_uri(const char *string)
+{
+ URI *uri;
+ regmatch_t pmatch[NMATCH];
+ regex_t preg;
+
+ if (!(uri = xmalloc(sizeof(URI))))
+ return NULL;
+ memset(uri, 0, sizeof(URI));
+
+ if (regcomp(&preg, URIPATTERN, REG_EXTENDED) != 0) {
+ log("ERROR explode_uri: regcomp");
+ goto ERROR_EXIT;
+ }
+
+ if (regexec(&preg, string, NMATCH, pmatch, 0) != 0) {
+ log("ERROR explode_uri: regexec");
+ goto ERROR_EXIT;
+ }
+
+ regfree(&preg);
+
+ if (pmatch[SCHEME].rm_so != -1) {
+ if (extract_uri(pmatch, string, &uri->scheme, SCHEME) < 0)
+ goto ERROR_EXIT;
+ }
+
+ if (pmatch[AUTHORITY].rm_so != -1) {
+ if (extract_uri(pmatch, string, &uri->authority, AUTHORITY) <
+ 0) goto ERROR_EXIT;
+ }
+
+ if (pmatch[PATH].rm_so != -1) {
+ if (extract_uri(pmatch, string, &uri->path, PATH) < 0)
+ goto ERROR_EXIT;
+ }
+
+ if (pmatch[QUERY_MARK].rm_so != -1) {
+ if (extract_uri(pmatch, string, &uri->query, QUERY) < 0)
+ goto ERROR_EXIT;
+ }
+
+ if (pmatch[FRAGMENT_MARK].rm_so != -1) {
+ if (extract_uri(pmatch, string, &uri->fragment, FRAGMENT) < 0)
+ goto ERROR_EXIT;
+ }
+
+ return uri;
+
+ ERROR_EXIT:
+ free_uri(uri);
+ return NULL;
+}
diff --git a/src/uri.h b/src/uri.h
new file mode 100644
index 0000000..bb18d15
--- /dev/null
+++ b/src/uri.h
@@ -0,0 +1,32 @@
+/* $Id: uri.h,v 1.1.1.1 2000-02-16 17:32:24 sdyoung Exp $
+ *
+ * See 'uri.c' for a detailed description.
+ *
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef __URI_H_
+#define __URI_H_
+
+typedef struct {
+ char *scheme;
+ char *authority;
+ char *path;
+ char *query;
+ char *fragment;
+} URI;
+
+extern URI *explode_uri(const char *string);
+extern void free_uri(URI * uri);
+
+#endif
diff --git a/src/utils.c b/src/utils.c
new file mode 100644
index 0000000..1a91d7a
--- /dev/null
+++ b/src/utils.c
@@ -0,0 +1,264 @@
+/* $Id: utils.c,v 1.1.1.1 2000-02-16 17:32:24 sdyoung Exp $
+ *
+ * Misc. routines which are used by the various functions to handle strings
+ * and memory allocation and pretty much anything else we can think of. Also,
+ * the load cutoff routine is in here, along with the HTML show stats
+ * function. Could not think of a better place for it, so it's in here.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <defines.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include <ctype.h>
+#include <sysexits.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <errno.h>
+#include <signal.h>
+#include <sys/stat.h>
+#include <assert.h>
+
+#include "config.h"
+#include "tinyproxy.h"
+#include "utils.h"
+#include "log.h"
+#include "conns.h"
+#include "buffer.h"
+
+char *xstrdup(char *st)
+{
+ char *p;
+
+ assert(st);
+
+ if (!(p = strdup(st))) {
+ log("ERROR xstrdup: out of memory (%s)", strerror(errno));
+ return NULL;
+ } else {
+ return p;
+ }
+}
+
+/*
+ * Find the start of the needle in the haystack. Limits the search to less
+ * than "length" characters. Returns NULL if the needle is not found.
+ */
+char *xstrstr(char *haystack, char *needle, unsigned int length,
+ int case_sensitive)
+{
+ unsigned int i;
+ /* Used to specify which function to use... need the decl. */
+ int (*fn) (const char *s1, const char *s2, unsigned int n);
+
+ assert(haystack);
+ assert(needle);
+ assert(length > 0);
+ assert(case_sensitive == FALSE || case_sensitive == TRUE);
+
+ if (case_sensitive)
+ fn = strncmp;
+ else
+ fn = strncasecmp;
+
+ if (strlen(needle) > length)
+ return NULL;
+
+ for (i = 0; i <= length - strlen(needle); i++) {
+ if ((*fn) (haystack + i, needle, strlen(needle)) == 0)
+ return haystack + i;
+
+ }
+
+ return NULL;
+}
+
+/*
+ * for-sure malloc
+ */
+void *xmalloc(unsigned long int sz)
+{
+ void *p;
+
+ assert(sz > 0);
+
+ if (!(p = malloc((size_t) sz))) {
+ log("ERROR xmalloc: out of memory (%s)", strerror(errno));
+ return NULL;
+ }
+ return p;
+}
+
+#ifdef USE_PROC
+int calcload(void)
+{
+ char buf[BUFFER], *p;
+ FILE *f;
+
+ if (!config.cutoffload) {
+ return -1;
+ }
+
+ if (!(f = fopen("/proc/loadavg", "rt"))) {
+ log("unable to read /proc/loadavg");
+ config.cutoffload = 0.0;
+ return -1;
+ }
+ fgets(buf, BUFFER, f);
+ p = strchr(buf, ' ');
+ *p = '\0';
+ load = atof(buf);
+ fclose(f);
+ return 0;
+}
+
+#else
+int calcload(void)
+{
+ FILE *f;
+ char buf[BUFFER];
+ char *p, *y;
+
+ if (!config.cutoffload) {
+ return -1;
+ }
+
+ if (!(f = popen(UPTIME_PATH, "r"))) {
+ log("calcload: unable to exec uptime");
+ config.cutoffload = 0.0;
+ return -1;
+ }
+ fgets(buf, BUFFER, f);
+ p = strrchr(buf, ':');
+ p += 2;
+ y = strchr(p, ',');
+ *y = '\0';
+ load = atof(p);
+ pclose(f);
+ return 0;
+}
+
+#endif
+
+/*
+ * Delete the server's buffer and replace it with a premade message which will
+ * be sent to the client.
+ */
+static void update_output_buffer(struct conn_s *connptr, char *outbuf)
+{
+ assert(connptr);
+ assert(outbuf);
+
+ delete_buffer(connptr->sbuffer);
+ connptr->sbuffer = new_buffer();
+
+ push_buffer(connptr->sbuffer, outbuf, strlen(outbuf));
+ shutdown(connptr->server_fd, 2);
+ connptr->type = CLOSINGCONN;
+}
+
+/*
+ * Display the statics of the tinyproxy server.
+ */
+int showstats(struct conn_s *connptr)
+{
+ char *outbuf;
+ static char *msg = "HTTP/1.0 200 OK\r\n" \
+ "Content-type: text/html\r\n\r\n" \
+ "<html><head><title>%s stats</title></head>\r\n" \
+ "<body>\r\n" \
+ "<center><h2>%s run-time statistics</h2></center><hr>\r\n" \
+ "<blockquote>\r\n" \
+ "Number of requests: %lu<br>\r\n" \
+ "Number of connections: %lu<br>\r\n" \
+ "Number of bad connections: %lu<br>\r\n" \
+ "Number of opens: %lu<br>\r\n" \
+ "Number of listens: %lu<br>\r\n" \
+ "Number of bytes (tx): %lu<br>\r\n" \
+ "Number of bytes (rx): %lu<br>\r\n" \
+ "Number of garbage collects:%lu<br>\r\n" \
+ "Number of idle connection kills:%lu<br>\r\n" \
+ "Number of refused connections due to high load:%lu<br>\r\n" \
+ "Current system load average:%.2f" \
+ "(recalculated every % lu seconds)<br>\r\n" \
+ "</blockquote>\r\n</body></html>\r\n";
+
+ assert(connptr);
+
+ outbuf = xmalloc(BUFFER);
+
+ sprintf(outbuf, msg, VERSION, VERSION, stats.num_reqs,
+ stats.num_cons, stats.num_badcons, stats.num_opens,
+ stats.num_listens, stats.num_tx, stats.num_rx,
+ stats.num_garbage, stats.num_idles, stats.num_refused, load,
+ LOAD_RECALCTIMER);
+
+ update_output_buffer(connptr, outbuf);
+
+ return 0;
+}
+
+/*
+ * Display an error to the client.
+ */
+int httperr(struct conn_s *connptr, int err, char *msg)
+{
+ char *outbuf;
+ static char *premsg = "HTTP/1.0 %d %s\r\n" \
+ "Content-type: text/html\r\n\r\n" \
+ "<html><head><title>%s</title></head>\r\n" \
+ "<body>\r\n" \
+ "<font size=\"+2\">Cache Error!</font><br>\r\n" \
+ "An error of type %d occurred: %s\r\n" \
+ "<hr>\r\n" \
+ "<font size=\"-1\"><em>Generated by %s</em></font>\r\n" \
+ "</body></html>\r\n";
+
+ assert(connptr);
+ assert(err > 0);
+ assert(msg);
+
+ outbuf = xmalloc(BUFFER);
+ sprintf(outbuf, premsg, err, msg, msg, err, msg, VERSION);
+
+ update_output_buffer(connptr, outbuf);
+
+ return 0;
+}
+
+void makedaemon(void)
+{
+ if (fork() != 0)
+ exit(0);
+
+ setsid();
+ signal(SIGHUP, SIG_IGN);
+
+ if (fork() != 0)
+ exit(0);
+
+ chdir("/");
+ umask(0);
+
+ close(0);
+ close(1);
+ close(2);
+}
diff --git a/src/utils.h b/src/utils.h
new file mode 100644
index 0000000..76a3565
--- /dev/null
+++ b/src/utils.h
@@ -0,0 +1,38 @@
+/* $Id: utils.h,v 1.1.1.1 2000-02-16 17:32:24 sdyoung Exp $
+ *
+ * See 'utils.h' for a detailed description.
+ *
+ * Copyright (C) 1998 Steven Young
+ * Copyright (C) 1999 Robert James Kaes (rjkaes@flarenet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef __UTILS_H_
+#define __UTILS_H_ 1
+
+#include "conns.h"
+
+#define safefree(x) free(x); x = NULL
+
+extern char *xstrdup(char *st);
+extern void *xmalloc(unsigned long int sz);
+extern char *xstrstr(char *haystack, char *needle, unsigned int length,
+ int case_sensitive);
+
+extern int showstats(struct conn_s *connptr);
+extern int httperr(struct conn_s *connptr, int err, char *msg);
+
+extern int calcload(void);
+
+extern void makedaemon(void);
+
+#endif