chiark / gitweb /
New poll(2) stuff etc. Does not work yet, but compiles.
authorian <ian>
Mon, 5 Jul 1999 01:50:58 +0000 (01:50 +0000)
committerian <ian>
Mon, 5 Jul 1999 01:50:58 +0000 (01:50 +0000)
91 files changed:
.cvsignore
COPYING [new file with mode: 0644]
INSTALL [new file with mode: 0644]
Makefile.in
README [new file with mode: 0644]
TODO [new file with mode: 0644]
acconfig.h
aclocal.m4
changelog
client/.cvsignore
client/Makefile.in
client/adnstest.c
configure
configure.in
dynamic/Makefile.in
regress/Makefile.in
regress/addcases
regress/case-abbrev.err [new file with mode: 0644]
regress/case-abbrev.out [new file with mode: 0644]
regress/case-abbrev.sys [new file with mode: 0644]
regress/case-abbrevto.err [new file with mode: 0644]
regress/case-abbrevto.out [new file with mode: 0644]
regress/case-abbrevto.sys [new file with mode: 0644]
regress/case-child.err [new file with mode: 0644]
regress/case-child.out [new file with mode: 0644]
regress/case-child.sys [new file with mode: 0644]
regress/case-flags10.err [new file with mode: 0644]
regress/case-flags10.out [new file with mode: 0644]
regress/case-flags10.sys [new file with mode: 0644]
regress/case-flags9.err [new file with mode: 0644]
regress/case-flags9.out [new file with mode: 0644]
regress/case-flags9.sys [new file with mode: 0644]
regress/case-mailboxes.err [new file with mode: 0644]
regress/case-mailboxes.out [new file with mode: 0644]
regress/case-mailboxes.sys [new file with mode: 0644]
regress/case-manya.out
regress/case-manya.sys
regress/case-ndots.err [new file with mode: 0644]
regress/case-ndots.out [new file with mode: 0644]
regress/case-ndots.sys [new file with mode: 0644]
regress/case-ndotsbad.err [new file with mode: 0644]
regress/case-ndotsbad.out [new file with mode: 0644]
regress/case-ndotsbad.sys [new file with mode: 0644]
regress/case-norm.out
regress/case-norm.sys
regress/case-owner.err [new file with mode: 0644]
regress/case-owner.out [new file with mode: 0644]
regress/case-owner.sys [new file with mode: 0644]
regress/case-rootquery.err [new file with mode: 0644]
regress/case-rootquery.out [new file with mode: 0644]
regress/case-rootquery.sys [new file with mode: 0644]
regress/case-rootqueryall.err [new file with mode: 0644]
regress/case-rootqueryall.out [new file with mode: 0644]
regress/case-rootqueryall.sys [new file with mode: 0644]
regress/case-search.err [new file with mode: 0644]
regress/case-search.out [new file with mode: 0644]
regress/case-search.sys [new file with mode: 0644]
regress/case-searchabs.err [new file with mode: 0644]
regress/case-searchabs.out [new file with mode: 0644]
regress/case-searchabs.sys [new file with mode: 0644]
regress/case-sillyrp.err [new file with mode: 0644]
regress/case-sillyrp.out [new file with mode: 0644]
regress/case-sillyrp.sys [new file with mode: 0644]
regress/case-timeout.out
regress/case-timeout.sys
regress/case-trunc.out
regress/case-trunc.sys
regress/checkall
regress/hcommon.c.m4
regress/hplayback.c.m4
regress/hrecord.c.m4
regress/hsyscalls.i4
regress/init-default.text
regress/init-ndots.text [new file with mode: 0644]
regress/init-ndotsbad.text [new file with mode: 0644]
regress/m1test
regress/r1test
settings.make.in
src/adns.h
src/adns.make
src/config.h.in
src/event.c
src/general.c
src/internal.h
src/parse.c
src/poll.c [new file with mode: 0644]
src/query.c
src/reply.c
src/setup.c
src/transmit.c
src/types.c

index c355865eea06c63c099a5133a431488b617a427d..439a8fd40c04e6843eeff0d54076d1ee87ee98e2 100644 (file)
@@ -5,3 +5,4 @@ config.status
 dist_tmp
 adns-*.tar.gz
 settings.make
+*.tmp*
diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..60549be
--- /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.
+\f
+                   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.)
+\f
+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.
+\f
+  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.
+\f
+  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
+\f
+           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/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..64075d0
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,44 @@
+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.
+
+You may find that GNU Make is required.
+
+
+COPYRIGHT
+
+This file, INSTALL, contains installation instructions and other
+details for adns.
+
+adns is Copyright (C)1997-9 Ian Jackson <ian@davenant.greenend.org.uk>.
+
+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.
index a26911547f0a5cece911719f85ea817fe1ca6065..d69eef4c1a208bfcffbfbaf64ac6b5d469ed99bb 100644 (file)
@@ -16,7 +16,7 @@
 #  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.1
+DISTVERSION=   0.2
 
 srcdir=                @srcdir@
 VPATH=         @srcdir@
@@ -27,7 +27,7 @@ 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:
+all-here install-here uninstall-here distprep-here:    README
 
 clean-here mostlyclean-here:
                rm -f *~ ./#*# core *.orig *.rej Makefile adns-*.tar.gz
@@ -54,5 +54,10 @@ dist:                        distprep
 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/README b/README
new file mode 100644 (file)
index 0000000..791a564
--- /dev/null
+++ b/README
@@ -0,0 +1,137 @@
+
+                                     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 will be useable by threads in a multithreaded program
+       in a natural way. It will multiplex many threads' queries through
+       a single query socket.
+     * Limited caching behaviour.
+     * IPv6 support.
+       
+   (Technical note: adns requires a real nameserver like BIND or [1]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 [2]adns.h
+   header file (from version 0.1).
+   
+Feedback
+
+   If you are subscribed to adns-discuss please send bug reports there;
+   otherwise mail them to adns-bugreports@chiark.greenend.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 [3]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 [4]chiark.greenend.org.uk are:
+     * The [5]current pre-release version as a gzipped tarfile.
+     * [6]adns.h API header file with comments (currently there is no
+       manual, sorry).
+     * All versions released so far are also available via [7]anonymous
+       FTP.
+       
+   adns is also available from the [8]GNU Project FTP servers and their
+   [9]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
+   [10]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 [11]Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA, or email adns-maint@chiark.greenend.org.uk.
+     _________________________________________________________________
+   
+   [12]Ian Jackson / [13]adns-maint@chiark.greenend.org.uk; more [14]free
+   software by me.
+   
+   [15]GNU home page; [16]chiark home page; [17]site or mirror home page
+   
+   This web page is Copyright (C)1996-1999 Ian Jackson. See the
+   [18]Copyright/acknowledgements.
+   
+   Use any browser - [19]Campaign for a non-browser-specific WWW
+
+References
+
+   1. http://www.dents.org/
+   2. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.0.1.txt
+   3. http://www.chiark.greenend.org.uk/mailman/listinfo
+   4. http://www.chiark.greenend.org.uk/~ian/adns/
+   5. http://www.chiark.greenend.org.uk/~ian/adns/adns.tar.gz
+   6. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.0.1.txt
+   7. ftp://ftp.chiark.greenend.org.uk/users/ian/adns/
+   8. http://www.gnu.org/
+   9. http://www.gnu.org/order/ftp.html
+  10. http://www.chiark.greenend.org.uk/~ian/COPYING.txt
+  11. http://www.fsf.org/
+  12. http://www.chiark.greenend.org.uk/
+  13. mailto:adns-maint@chiark.greenend.org.uk
+  14. http://www.chiark.greenend.org.uk/~ian/software/
+  15. http://www.gnu.org/
+  16. http://www.chiark.greenend.org.uk/
+  17. http://www.chiark.greenend.org.uk/
+  18. http://www.chiark.greenend.org.uk/~ian/sw-www-copy.html
+  19. http://www.anybrowser.org/campaign/
diff --git a/TODO b/TODO
new file mode 100644 (file)
index 0000000..758c66a
--- /dev/null
+++ b/TODO
@@ -0,0 +1,7 @@
+DNSSEC compatibility
+ - be able to retreive KEY and SIG RRs
+
+DNSSEC functionality
+ - provide security
+
+Easy-to-use query tool
index 73a7fe372fe7083dd2c36724e62d0bc2dcacdeb2..16672a6689bb91e564fb3828201e8332f2c21b43 100644 (file)
 
 /* Use the definitions: */
 
+#ifdef HAVE_POLL
+#include <sys/poll.h>
+#else
+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
index cdc58030ae02a8e8ee747118bfb9de0e46ca471f..b2d9e9f2a56f29a8dfb4636eeb9d7dfdb33fbb26 100644 (file)
@@ -53,3 +53,11 @@ define(ADNS_C_GCCATTRIB,[
     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])
+  ])
+ ])
+])
index e1fa705259536a2d5c319c1ea9f43aa0bf7f36bf..207c322f1d0f1277c81f4ff8624a0538456bf43d 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,8 +1,52 @@
+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.
+  
+  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.
+
+ --
+
+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
index 777b57ab092ad5e42bea34b52278cf374d04e31f..e6b4fa8098f8dda3227dbebc599feaf82f7db8f0 100644 (file)
@@ -1,2 +1,3 @@
 Makefile
 adnstest
+adnstest_s
index 24a8a6e8e4a6a8fbe578dfe633a1d6d9fd834b51..67acef447a69f843a8dd2cab573d41dd2d65259c 100644 (file)
 srcdir=                @srcdir@
 VPATH=         @srcdir@
 
-TARGETS=       adnstest
+TARG_LOCAL=    adnstest_s
+TARG_INSTALL=  adnstest
+TARGETS=       $(TARG_LOCAL) $(TARG_INSTALL)
 include                $(srcdir)/../settings.make
 
 DIRCFLAGS=     -I$(srcdir)/../src
 
-install:       $(TARGETS)
+all:           $(TARGETS)
+
+install:       $(TARG_INSTALL)
                set -xe; for f in $(TARGETS); \
                        do $(INSTALL_PROGRAM) $$f $(bin_dir)/$$f; done
 
@@ -32,3 +36,6 @@ uninstall:
                for f in $(TARGETS); do rm -f $(bin_dir)/$$f; done
 
 adnstest:      adnstest.o $(srcdir)/../dynamic/$(SHLIBFILE)
+
+adnstest_s:    adnstest.o $(srcdir)/../src/libadns.a
+               $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)
index 98caf2fd78de31db789a3b6e6e48cd6251703e24..52344d1475a5a4c0118049022bdb2bbc433ada4e 100644 (file)
@@ -25,6 +25,7 @@
 #include <unistd.h>
 #include <assert.h>
 #include <stdlib.h>
+#include <string.h>
 
 #ifndef OUTPUTSTREAM
 # define OUTPUTSTREAM stdout
 
 #include "adns.h"
 
-static void failure(const char *what, adns_status st) {
+static void failure_status(const char *what, adns_status st) {
   fprintf(stderr,"adns failure: %s: %s\n",what,adns_strerror(st));
   exit(2);
 }
 
+static void failure_errno(const char *what, int errnoval) {
+  fprintf(stderr,"adns failure: %s: errno=%d\n",what,errnoval);
+  exit(2);
+}
+
 static const char *defaultargv[]= { "ns.chiark.greenend.org.uk", 0 };
 
 static const adns_rrtype defaulttypes[]= {
@@ -67,18 +73,37 @@ static void dumptype(adns_status ri, const char *rrtn, const char *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); exit(3); }
+      *ownflags++= *ep++;
+    }
+  }
+  if (*ep != '/') { *dom_r= fdom; *qf_r= 0; }
+  else { *dom_r= ep+1; *qf_r= qf; }
+  *ownflags= 0;
+}
+
 int main(int argc, char *const *argv) {
   adns_state ads;
   adns_query *qus, qu;
   adns_answer *ans;
   const char *initstring, *rrtn, *fmtn;
-  const char *const *domlist;
+  const char *const *fdomlist, *domain;
   char *show, *cp;
-  int len, i, qc, qi, tc, ti, ch;
+  int len, i, qc, qi, tc, ti, ch, qflags;
   adns_status r, ri;
   const adns_rrtype *types;
   struct timeval now;
   adns_rrtype *types_a;
+  char ownflags[10];
 
   if (argv[0] && argv[1] && argv[1][0] == '/') {
     initstring= argv[1]+1;
@@ -90,7 +115,7 @@ int main(int argc, char *const *argv) {
   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);
+    types_a= malloc(sizeof(*types_a)*(tc+1));
     if (!types_a) { perror("malloc types"); exit(3); }
     for (cp= argv[1]+1, ti=0; ti<tc; ti++) {
       types_a[ti]= strtoul(cp,&cp,10);
@@ -102,16 +127,17 @@ int main(int argc, char *const *argv) {
        cp++;
       }
     }
+    *cp++= adns_r_none;
     types= types_a;
     argv++;
   } else {
     types= defaulttypes;
   }
   
-  if (argv[0] && argv[1]) domlist= (const char *const*)argv+1;
-  else domlist= defaultargv;
+  if (argv[0] && argv[1]) fdomlist= (const char *const*)argv+1;
+  else fdomlist= defaultargv;
 
-  for (qc=0; qc[domlist]; qc++);
+  for (qc=0; fdomlist[qc]; qc++);
   for (tc=0; types[tc] != adns_r_none; tc++);
   qus= malloc(sizeof(qus)*qc*tc);
   if (!qus) { perror("malloc qus"); exit(3); }
@@ -121,17 +147,18 @@ int main(int argc, char *const *argv) {
   } else {
     r= adns_init(&ads,adns_if_debug|adns_if_noautosys,0);
   }
-  if (r) failure("init",r);
+  if (r) failure_errno("init",r);
 
   for (qi=0; qi<qc; qi++) {
+    fdom_split(fdomlist[qi],&domain,&qflags,ownflags,sizeof(ownflags));
     for (ti=0; ti<tc; ti++) {
-      fprintf(stdout,"%s type %d",domlist[qi],types[ti]);
-      r= adns_submit(ads,domlist[qi],types[ti],0,0,&qus[qi*tc+ti]);
+      fprintf(stdout,"%s flags %d type %d",domain,qflags,types[ti]);
+      r= adns_submit(ads,domain,types[ti],qflags,0,&qus[qi*tc+ti]);
       if (r == adns_s_unknownrrtype) {
        fprintf(stdout," not implemented\n");
        qus[qi*tc+ti]= 0;
       } else if (r) {
-       failure("submit",r);
+       failure_errno("submit",r);
       } else {
        ri= adns_rr_info(types[ti], &rrtn,&fmtn,0, 0,0);
        putc(' ',stdout);
@@ -142,26 +169,33 @@ int main(int argc, char *const *argv) {
   }
 
   for (qi=0; qi<qc; qi++) {
+    fdom_split(fdomlist[qi],&domain,&qflags,ownflags,sizeof(ownflags));
+      
     for (ti=0; ti<tc; ti++) {
       qu= qus[qi*tc+ti];
       if (!qu) continue;
+      
       r= adns_wait(ads,&qu,&ans,0);
-      if (r) failure("wait",r);
+      if (r) failure_errno("wait",r);
 
       if (gettimeofday(&now,0)) { perror("gettimeofday"); exit(3); }
       
       ri= adns_rr_info(ans->type, &rrtn,&fmtn,&len, 0,0);
-      fprintf(stdout, "%s type ", domlist[qi]);
+      fprintf(stdout, "%s flags %d type ",domain,qflags);
       dumptype(ri,rrtn,fmtn);
-      fprintf(stdout, ": %s; nrrs=%d; cname=%s; ttl=%ld\n",
-             adns_strerror(ans->status),
-             ans->nrrs, ans->cname ? ans->cname : "$",
+      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++) {
-         r= adns_rr_info(ans->type, 0,0,0, ans->rrs.bytes+i*len,&show);
-         if (r) failure("info",r);
+         r= adns_rr_info(ans->type, 0,0,0, ans->rrs.bytes + i*len, &show);
+         if (r) failure_status("info",r);
          fprintf(stdout," %s\n",show);
          free(show);
        }
index 5cc73d5044f229722d9c478efe05337ab30ec1f9..5df8065a5dbf76f1a43f0d0990a7edaea4f0a8be 100755 (executable)
--- a/configure
+++ b/configure
@@ -719,22 +719,382 @@ else
 fi
 
 
+for ac_func in poll
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:726: 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 731 "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:754: \"$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:780: 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 785 "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:808: \"$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:827: 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 835 "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:846: \"$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:882: 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 887 "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:910: \"$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:929: 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 937 "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:948: \"$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
+
+
+
+
+ echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
+echo "configure:985: 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 990 "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:1013: \"$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:1032: 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 1040 "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:1051: \"$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:725: checking __attribute__((,,))" >&5
+echo "configure:1085: 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 731 "configure"
+#line 1091 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(int x) __attribute__((,,))
 ; return 0; }
 EOF
-if { (eval echo configure:738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_c_attribute_supported=yes
 else
@@ -756,20 +1116,20 @@ EOF
 
    
  echo $ac_n "checking __attribute__((noreturn))""... $ac_c" 1>&6
-echo "configure:760: checking __attribute__((noreturn))" >&5
+echo "configure:1120: 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 766 "configure"
+#line 1126 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(int x) __attribute__((noreturn))
 ; return 0; }
 EOF
-if { (eval echo configure:773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_c_attribute_noreturn=yes
 else
@@ -796,20 +1156,20 @@ EOF
 
    
  echo $ac_n "checking __attribute__((const))""... $ac_c" 1>&6
-echo "configure:800: checking __attribute__((const))" >&5
+echo "configure:1160: 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 806 "configure"
+#line 1166 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(int x) __attribute__((const))
 ; return 0; }
 EOF
-if { (eval echo configure:813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_c_attribute_const=yes
 else
@@ -836,20 +1196,20 @@ EOF
 
    
  echo $ac_n "checking __attribute__((format...))""... $ac_c" 1>&6
-echo "configure:840: checking __attribute__((format...))" >&5
+echo "configure:1200: 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 846 "configure"
+#line 1206 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(char *y, ...) __attribute__((format(printf,1,2)))
 ; return 0; }
 EOF
-if { (eval echo configure:853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_attribute_format=yes
 else
index 8d40cc1719d59b46f671d6226b318f3710ca7ad8..6e342c07cd35c47ad279042a5452209d12dc0294 100644 (file)
@@ -20,6 +20,16 @@ AC_INIT(src/adns.h)
 AC_CONFIG_HEADER(src/config.h)
 AC_PROG_CC
 AC_PROG_RANLIB
+
+AC_CHECK_FUNCS(poll)
+ADNS_C_GETFUNC(socket,socket)
+ADNS_C_GETFUNC(inet_ntoa,nsl)
+
+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)
index 14ec97c2eca990fbda2e0b4705778aee84740388..5a68a1a735556000cd3f2acae9f799cf538cf0f4 100644 (file)
@@ -33,7 +33,7 @@ uninstall:
 
 $(SHLIBFILE):  $(ALLOBJS)
                rm -f $@
-               $(MKSHLIB_1) $@ $(MKSHLIB_2) $(ALLOBJS) $(MKSHLIB_3)
+               $(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
index 2055f08cb2c3de45b527da49b45f5ba709d40cc9..c67c68280238bcde04b883cfd2a0b1f21ad44eac 100644 (file)
@@ -40,6 +40,8 @@ ALLOBJS=      $(HARNLOBJS) dtest.o hrecord.o hplayback.o hcommon.o
 check:         $(TARGETS)
                ./checkall
 
+all install uninstall:
+
 hrecord:       adnstest_c.o hrecord.o hcommon.o $(HARNLOBJS)
 hplayback:     adnstest_c.o hplayback.o hcommon.o $(HARNLOBJS)
 
index 7f370d181c41711be1956b85eaccdcf1d93487c5..3c3138cb67a5a0b937b17b6b82579eb624189e3f 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/sh
-# usage: ./a1test <casename> ...
+# usage: ./addcases <casename> ...
 
 set -e
 
 for f in "$@"
 do
-       cvs add "case-$f".{sys,stdout,stderr}
+       cvs add "case-$f".{sys,out,err}
 done
diff --git a/regress/case-abbrev.err b/regress/case-abbrev.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-abbrev.out b/regress/case-abbrev.out
new file mode 100644 (file)
index 0000000..ef461cd
--- /dev/null
@@ -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": AF_INET 172.18.45.6
+ "ns1.relativity.greenend.org.uk": AF_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": AF_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/regress/case-abbrev.sys b/regress/case-abbrev.sys
new file mode 100644 (file)
index 0000000..f98d716
--- /dev/null
@@ -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/regress/case-abbrevto.err b/regress/case-abbrevto.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-abbrevto.out b/regress/case-abbrevto.out
new file mode 100644 (file)
index 0000000..bfda79c
--- /dev/null
@@ -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/regress/case-abbrevto.sys b/regress/case-abbrevto.sys
new file mode 100644 (file)
index 0000000..3cfbcbf
--- /dev/null
@@ -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/regress/case-child.err b/regress/case-child.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-child.out b/regress/case-child.out
new file mode 100644 (file)
index 0000000..ab0706f
--- /dev/null
@@ -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/regress/case-child.sys b/regress/case-child.sys
new file mode 100644 (file)
index 0000000..0cd1079
--- /dev/null
@@ -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/regress/case-flags10.err b/regress/case-flags10.err
new file mode 100644 (file)
index 0000000..e6c1c99
--- /dev/null
@@ -0,0 +1 @@
+too many flags
diff --git a/regress/case-flags10.out b/regress/case-flags10.out
new file mode 100644 (file)
index 0000000..2f93975
--- /dev/null
@@ -0,0 +1,2 @@
+adns debug: using nameserver 172.18.45.6
+rc=3
diff --git a/regress/case-flags10.sys b/regress/case-flags10.sys
new file mode 100644 (file)
index 0000000..550bc22
--- /dev/null
@@ -0,0 +1,12 @@
+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
diff --git a/regress/case-flags9.err b/regress/case-flags9.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-flags9.out b/regress/case-flags9.out
new file mode 100644 (file)
index 0000000..679ba0d
--- /dev/null
@@ -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/regress/case-flags9.sys b/regress/case-flags9.sys
new file mode 100644 (file)
index 0000000..94ac969
--- /dev/null
@@ -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/regress/case-mailboxes.err b/regress/case-mailboxes.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-mailboxes.out b/regress/case-mailboxes.out
new file mode 100644 (file)
index 0000000..9bf4e87
--- /dev/null
@@ -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" ""
+ "\x22i\\.\\.j\x22@ucam.org" ""
+ "\x22\\.i\x22@ucam.org" ""
+ "\x22i\\.\x22@ucam.org" ""
+rc=0
diff --git a/regress/case-mailboxes.sys b/regress/case-mailboxes.sys
new file mode 100644 (file)
index 0000000..2144c05
--- /dev/null
@@ -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
index 6a352a0f9f9f18ee00706d965ed3578158d02f22..08cee50e8b18bdc0cb918ee2dbfd2fc0cc2904c0 100644 (file)
@@ -1,7 +1,8 @@
 adns debug: using nameserver 172.18.45.6
-manyaddrs.test.iwj.relativity.greenend.org.uk type 1 A(-) submitted
-manyaddrs.test.iwj.relativity.greenend.org.uk type A(-): OK; nrrs=4; cname=$; ttl=60
+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
index 73523b2ee830a7a5306557d6016c7534a6d226b6..8b560fabbcc11ce574b20c6e6df6744f6d3c4a1e 100644 (file)
@@ -5,10 +5,10 @@ default
  socket=4
  +0.000245
  fcntl fd=4 cmd=F_GETFL
- fcntl=2
+ fcntl=~O_NONBLOCK&...
  +0.000705
- fcntl fd=4 cmd=F_SETFL 2050
- fcntl=0
+ 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
diff --git a/regress/case-ndots.err b/regress/case-ndots.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-ndots.out b/regress/case-ndots.out
new file mode 100644 (file)
index 0000000..ceef65a
--- /dev/null
@@ -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/regress/case-ndots.sys b/regress/case-ndots.sys
new file mode 100644 (file)
index 0000000..3d1f363
--- /dev/null
@@ -0,0 +1,277 @@
+ndots
+: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/regress/case-ndotsbad.err b/regress/case-ndotsbad.err
new file mode 100644 (file)
index 0000000..700201a
--- /dev/null
@@ -0,0 +1 @@
+adns failure: init: errno=22
diff --git a/regress/case-ndotsbad.out b/regress/case-ndotsbad.out
new file mode 100644 (file)
index 0000000..b980b59
--- /dev/null
@@ -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/regress/case-ndotsbad.sys b/regress/case-ndotsbad.sys
new file mode 100644 (file)
index 0000000..56d5877
--- /dev/null
@@ -0,0 +1,2 @@
+ndotsbad
+:1 5/news.davenant.greenend.org.uk
index 9be2769fa4fc25b9bb30360cfe547fd368008ee7..6953cea6d403782eb8aaf90506c47ce7aa29439c 100644 (file)
@@ -1,4 +1,5 @@
 adns debug: using nameserver 172.18.45.6
-chiark.greenend.org.uk type 1 A(-) submitted
-chiark.greenend.org.uk type A(-): OK; nrrs=1; cname=$; ttl=86400
+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
index 7342fde630638bfd622db33c23b6c3cac6e77a52..675a9bd7de5af01406bd1363c6106f4a97d8ba0d 100644 (file)
@@ -5,10 +5,10 @@ default
  socket=4
  +0.000204
  fcntl fd=4 cmd=F_GETFL
- fcntl=2
+ fcntl=~O_NONBLOCK&...
  +0.000670
- fcntl fd=4 cmd=F_SETFL 2050
- fcntl=0
+ 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
diff --git a/regress/case-owner.err b/regress/case-owner.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-owner.out b/regress/case-owner.out
new file mode 100644 (file)
index 0000000..6953cea
--- /dev/null
@@ -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/regress/case-owner.sys b/regress/case-owner.sys
new file mode 100644 (file)
index 0000000..acc360e
--- /dev/null
@@ -0,0 +1,34 @@
+default
+:1 chiark.greenend.org.uk
+ start 924360510.895567
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000363
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000092
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000067
+ sendto fd=4 addr=172.18.45.6:53
+     311f0100 00010000 00000000 06636869 61726b08 67726565 6e656e64 036f7267
+     02756b00 00010001.
+ sendto=40
+ +0.001845
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998155
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.005511
+ 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.000881
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000441
+ close fd=4
+ close=OK
+ +0.000218
diff --git a/regress/case-rootquery.err b/regress/case-rootquery.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-rootquery.out b/regress/case-rootquery.out
new file mode 100644 (file)
index 0000000..575646d
--- /dev/null
@@ -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/regress/case-rootquery.sys b/regress/case-rootquery.sys
new file mode 100644 (file)
index 0000000..4cd21b8
--- /dev/null
@@ -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/regress/case-rootqueryall.err b/regress/case-rootqueryall.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-rootqueryall.out b/regress/case-rootqueryall.out
new file mode 100644 (file)
index 0000000..cf4c81b
--- /dev/null
@@ -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": AF_INET 192.36.148.17
+ "F.ROOT-SERVERS.NET": AF_INET 192.5.5.241
+ "G.ROOT-SERVERS.NET": AF_INET 192.112.36.4
+ "J.ROOT-SERVERS.NET": AF_INET 198.41.0.10
+ "K.ROOT-SERVERS.NET": AF_INET 193.0.14.129
+ "L.ROOT-SERVERS.NET": AF_INET 198.32.64.12
+ "M.ROOT-SERVERS.NET": AF_INET 202.12.27.33
+ "A.ROOT-SERVERS.NET": AF_INET 198.41.0.4
+ "H.ROOT-SERVERS.NET": AF_INET 128.63.2.53
+ "B.ROOT-SERVERS.NET": AF_INET 128.9.0.107
+ "C.ROOT-SERVERS.NET": AF_INET 192.33.4.12
+ "D.ROOT-SERVERS.NET": AF_INET 128.8.10.90
+ "E.ROOT-SERVERS.NET": AF_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": AF_INET 192.112.36.4
+ "J.ROOT-SERVERS.NET": AF_INET 198.41.0.10
+ "K.ROOT-SERVERS.NET": AF_INET 193.0.14.129
+ "L.ROOT-SERVERS.NET": AF_INET 198.32.64.12
+ "M.ROOT-SERVERS.NET": AF_INET 202.12.27.33
+ "A.ROOT-SERVERS.NET": AF_INET 198.41.0.4
+ "H.ROOT-SERVERS.NET": AF_INET 128.63.2.53
+ "B.ROOT-SERVERS.NET": AF_INET 128.9.0.107
+ "C.ROOT-SERVERS.NET": AF_INET 192.33.4.12
+ "D.ROOT-SERVERS.NET": AF_INET 128.8.10.90
+ "E.ROOT-SERVERS.NET": AF_INET 192.203.230.10
+ "I.ROOT-SERVERS.NET": AF_INET 192.36.148.17
+ "F.ROOT-SERVERS.NET": AF_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/regress/case-rootqueryall.sys b/regress/case-rootqueryall.sys
new file mode 100644 (file)
index 0000000..e918912
--- /dev/null
@@ -0,0 +1,972 @@
+default
+. 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/regress/case-search.err b/regress/case-search.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-search.out b/regress/case-search.out
new file mode 100644 (file)
index 0000000..35e0367
--- /dev/null
@@ -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/regress/case-search.sys b/regress/case-search.sys
new file mode 100644 (file)
index 0000000..f333d66
--- /dev/null
@@ -0,0 +1,133 @@
+default
+: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/regress/case-searchabs.err b/regress/case-searchabs.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-searchabs.out b/regress/case-searchabs.out
new file mode 100644 (file)
index 0000000..5fb6b51
--- /dev/null
@@ -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/regress/case-searchabs.sys b/regress/case-searchabs.sys
new file mode 100644 (file)
index 0000000..9899ffd
--- /dev/null
@@ -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/regress/case-sillyrp.err b/regress/case-sillyrp.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/regress/case-sillyrp.out b/regress/case-sillyrp.out
new file mode 100644 (file)
index 0000000..c8937d2
--- /dev/null
@@ -0,0 +1,20 @@
+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): Found syntactically invalid domain name; nrrs=0; cname=$; owner=$; ttl=60
+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): Found syntactically invalid domain name; nrrs=0; cname=$; owner=$; ttl=60
+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/regress/case-sillyrp.sys b/regress/case-sillyrp.sys
new file mode 100644 (file)
index 0000000..2b28a49
--- /dev/null
@@ -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
index ccbbd398b7e6c3efbea123e6878a334c66f0fb1b..a3f7495ed0b3c80b611f57be01ea3fc2dc0cfe9a 100644 (file)
@@ -1,3 +1,4 @@
 adns debug: using nameserver 172.18.45.36
-chiark.greenend.org.uk type 1 A(-) submitted
-chiark.greenend.org.uk type A(-): DNS query timed out; nrrs=0; cname=$; ttl=604770
+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
index f236a2db53f3f3f2e3b44f9bb48acfe1c7de8241..003d1ca6530eb635f42b7baa9060385230bdfddd 100644 (file)
@@ -5,10 +5,10 @@ noserver
  socket=4
  +0.000193
  fcntl fd=4 cmd=F_GETFL
- fcntl=2
+ fcntl=~O_NONBLOCK&...
  +0.000088
- fcntl fd=4 cmd=F_SETFL 2050
- fcntl=0
+ 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
index 7943119240cb40df415db5680985c6551ca8bc30..bd70e05ce74a252135090a1e3c8401592e4bed9c 100644 (file)
@@ -1,3 +1,4 @@
 adns debug: using nameserver 172.18.45.6
-trunc.test.iwj.relativity.greenend.org.uk type 1 A(-) submitted
-trunc.test.iwj.relativity.greenend.org.uk type A(-): No such data; nrrs=0; cname=$; ttl=60
+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
index 67020096c6136843eca4140e073d34e4dc7fa0fb..4288e5dc9745e720b7e8f307da3a6fccedc58897 100644 (file)
@@ -5,10 +5,10 @@ default
  socket=4
  +0.000207
  fcntl fd=4 cmd=F_GETFL
- fcntl=2
+ fcntl=~O_NONBLOCK&...
  +0.000321
- fcntl fd=4 cmd=F_SETFL 2050
- fcntl=0
+ 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
index 2191ae28cc18c30a8ce2efc6e87ed45bed2dd096..9412247dd83a6207ace66b54e7e2d3cf03de4d25 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-allok=true
+failed=''
 
 for f in case-*.sys
 do
@@ -10,20 +10,21 @@ do
                :
        else
                echo
-               allok=false
+               failed="$failed $case"
                echo
        fi
 done
 
-if $allok
+if [ "x$failed" = x ]
 then
        echo "
 all tests passed."
        exit 0
 fi
 
-echo >&2 '
+echo >&2 "
 AT LEAST ONE TEST FAILED
-'
+$failed
+"
 
 exit 1
index 4684eafc81cc3df472e7c8fac1c486e3953acacb..d1f72b793b8382fe8f8e65cb9dd715a7d059027d 100644 (file)
@@ -87,9 +87,11 @@ void Q$1(hm_args_massage($3,void)) {
  m4_define(`hm_arg_fd', `Tvbf(" $'`1=%d",$'`1);')
  m4_define(`hm_arg_fcntl_cmd_arg', `
   if ($'`1 == F_SETFL) {
-   Tvbf(" $'`1=F_SETFL %ld",arg);
-  } else {
+   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', `')
index aec03930cecd955df60ca971df275931efbb9b10..5f8b45627d51e104ae44993d9e8b9d954cbbd447 100644 (file)
@@ -215,6 +215,7 @@ int H$1(hm_args_massage($3,void)) {
  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
@@ -259,6 +260,23 @@ int H$1(hm_args_massage($3,void)) {
   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
index e383ac5cbdd3fb8c89d5a4b95a5c3c571ed7044f..98a24b7795993876ace3036dfe8c64ff6203f8bb 100644 (file)
@@ -104,6 +104,18 @@ int H$1(hm_args_massage($3,void)) {
   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
@@ -119,6 +131,7 @@ int H$1(hm_args_massage($3,void)) {
  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
 
index dc6ff403ceb854a4f20d80001950b0491781fefd..e81072ad91ef2263bd0e0cf39fff7a2dc23a59c6 100644 (file)
@@ -19,13 +19,14 @@ 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  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
@@ -63,7 +64,7 @@ hm_syscall(
 ')
 
 hm_syscall(
-       fcntl, `hm_rv_any', `
+       fcntl, `hm_rv_fcntl', `
        hm_arg_fd(fd) hm_na
        hm_arg_fcntl_cmd_arg(cmd,arg) hm_na
 ')
index 05fd9c53064cbf475dd82e2320ab7e9b1dc1c784..e224ea70d34ced596a0fee62e86cb4ab2a37c530 100644 (file)
@@ -1,2 +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/regress/init-ndots.text b/regress/init-ndots.text
new file mode 100644 (file)
index 0000000..099c2ee
--- /dev/null
@@ -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/regress/init-ndotsbad.text b/regress/init-ndotsbad.text
new file mode 100644 (file)
index 0000000..2045821
--- /dev/null
@@ -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
index 5a8bbed5e27c67480ad589a7f49d7ffc9f05ff83..81cd024fe6b6bc7e6fd2af7d95615b66aaa7af91 100755 (executable)
@@ -24,12 +24,7 @@ ADNS_TEST_OUT_FD=3 3>>"$case.sys" >"$case.out" 2>"$case.err" </dev/null \
 rc=$?
 set -e
 
+echo "rc=$rc" >>$case.out
+
 egrep . -- "$case.err" "$case.out"
 echo "exit status: $rc"
-
-if test $rc = 0
-then
-       echo "test created ok"
-fi
-
-exit $rc
index a9ec3ce627d999c43929dd5e23215111ad59509b..3b2bfdf15125a7d8f649228f22d582cd283da481 100755 (executable)
@@ -20,24 +20,25 @@ ADNS_TEST_REPORT_FD=3 3>>"$ocase.report" >"$ocase.out" 2>"$ocase.err" \
 rc=$?
 set -e
 
-if test $rc != 0
-then
-       egrep . -- "$ocase.report" "$ocase.out" "$ocase.err"
-       echo >&2 "FAILED $case - EXIT STATUS $rc"
-       exit 2
-fi
+echo "rc=$rc" >>$ocase.out
 
-for part in out err
+failed=false
+for part in err out
 do
-       if diff -- "$case.$part" "$ocase.$part"
+       if diff -u -- "$case.$part" "$ocase.$part"
        then
                :
        else
-               echo >&2 "FAILED $case - WRONG OUTPUT"
-               exit 2
+               failed=true
        fi
 done
 
+if $failed
+then
+       echo >&2 "FAILED $case - WRONG OUTPUT - lines of syscall remaining `wc -l`"
+       exit 2
+fi
+
 echo -n "$casename "
 
 exit 0
index 278538b9caa469c4bbf91449140ef0488c9e2e3c..6b705656c0a4966ef0cd130c9036d9ecd0794ff7 100644 (file)
@@ -24,6 +24,7 @@ SHLIBSONAME=  @SHLIBSONAME@
 
 CC=            @CC@
 CFLAGS=                $(AUTOCFLAGS) $(WARNS) $(WERROR) $(DIRCFLAGS) $(XCFLAGS)
+LDLIBS=                @LIBS@ $(XLIBS)
 AUTOCFLAGS=    @CFLAGS@
 WARNS=         @WARNS@
 #WERROR=       -Werror
@@ -50,7 +51,7 @@ INSTALL_DATA=         $(INSTALL) -m 644
 all:                   $(TARGETS)
 
 clean mostlyclean:
-               rm -f *.o 
+               rm -f *.o *.tmp*
 
 distclean:             clean
                rm -f $(TARGETS) *~ ./#*# core *.orig *.rej Makefile
index d3ab7eda9e9b92eb7dccbeedda306dc356a9c649..ce92c8b2d614da3ae6de048b9e9208a0e878504c 100644 (file)
@@ -42,11 +42,13 @@ typedef enum {
   adns_if_debug=        0x0008, /* enable all output to stderr plus debug msgs */
   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_initflags;
 
 typedef enum {
   adns_qf_search=          0x000001, /* use the searchlist */
   adns_qf_usevc=           0x000002, /* use a virtual circuit (TCP connection) */
+  adns_qf_owner=           0x000004, /* fill in the owner field in the answer */
   adns_qf_quoteok_query=   0x000010, /* allow quote-requiring chars in query domain */
   adns_qf_quoteok_cname=   0x000020, /* allow ... in CNAME we go via */
   adns_qf_quoteok_anshost= 0x000040, /* allow ... in answers expected to be hostnames */
@@ -89,15 +91,15 @@ typedef enum {
   
 } adns_rrtype;
 
-/* In queries without qtf_anyquote, all domains must have standard
- * legal syntax.  In queries _with_ qtf_anyquote, 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.
+/* In queries without qf_quoteok_*, all domains must have standard
+ * legal syntax.  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.
  *
  * Do not ask for _raw records containing mailboxes without
  * specifying _qf_anyquote.
@@ -109,6 +111,9 @@ typedef enum {
   /* 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,
@@ -116,6 +121,8 @@ typedef enum {
   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,
@@ -123,7 +130,7 @@ typedef enum {
   adns_s_rcodenotimplemented,
   adns_s_rcoderefused,
   adns_s_rcodeunknown,
-  
+
   adns_s_max_tempfail= 99,
 
   /* remote configuration errors */
@@ -194,6 +201,7 @@ typedef struct {
 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;
@@ -225,15 +233,25 @@ typedef struct {
  *  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;
- *  Seriously fatal system errors (eg, failure to create sockets,
- *  malloc failure, etc.) return errno values;
- *  Other errors (nameserver failure, timed out connections, &c)
- *  are returned in the status field of the answer.  If status is
- *  nonzero then nrrs will be 0, otherwise it will be >0.
- *  type will always be the type requested;
- *  If no (appropriate) requests are done adns_check returns EWOULDBLOCK;
- *  If no (appropriate) requests are outstanding adns_query and adns_wait return ESRCH;
+ *  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) EWOULDBLOCK is
+ *  returned: if no (appropriate) requests are done adns_check returns
+ *  EWOULDBLOCK; 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,
@@ -249,8 +267,8 @@ int adns_synchronous(adns_state ads,
                     adns_answer **answer_r);
 
 /* NB: if you set adns_if_noautosys then _submit and _check do not
- * make any system calls; you must use adns_callback (possibly after
- * adns_interest) to actually get things to happen.
+ * 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,
@@ -269,70 +287,40 @@ int adns_wait(adns_state ads,
              adns_query *query_io,
              adns_answer **answer_r,
              void **context_r);
-/* fixme: easy way to get lists of fd's */
-/* fixme: minor cache */
 
 void adns_cancel(adns_query query);
 
-void adns_finish(adns_state);
-/* You may call this even if you have queries outstanding;
- * they will be cancelled.
+/* 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.
  */
 
-int adns_callback(adns_state, int maxfd, const fd_set *readfds, const fd_set *writefds,
-                 const fd_set *exceptfds);
-/* Gives adns flow-of-control for a bit.  This will never block.
- * If maxfd == -1 then adns will check (make nonblocking system calls on)
- * all of its own filedescriptors; otherwise it will only use those
- * < maxfd and specified in the fd_set's, as if select had returned them.
- * Other fd's may be in the fd_sets, and will be ignored.
- * _callback returns how many adns fd's were in the various sets, so
- * you can tell if your select handling code has missed something and is going awol.
- *
- * May also return -1 if a critical syscall failed, setting errno.
+void adns_finish(adns_state ads);
+/* You may call this even if you have queries outstanding;
+ * they will be cancelled.
  */
 
-void adns_interest(adns_state, int *maxfd_io, fd_set *readfds_io,
-                  fd_set *writefds_io, fd_set *exceptfds_io,
-                  struct timeval **tv_mod, struct timeval *tv_buf);
-/* 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 may point to 0 meaning
- * you have no timeout of your own, in which case tv_buf must be non-null and
- * _interest may fill it in and set *tv_mod=tv_buf.
- * readfds, writefds, exceptfds and maxfd may not be 0.
- */
 
-struct pollfd *adns_pollfds(adns_state, struct pollfd *buf, int *len_io, int *timeout);
-/* Like adns_interest, but for use with poll(2).  The return value
- * will be a pointer to an array of struct pollfd, one for each of
- * adns's fds, and *len_io will be set to the number of file
- * descriptors.
- *
- * Each descriptor's entry will have a revents==0, and events will be
- * a combination of one or more of POLLIN, POLLOUT and POLLERR.
- *
- * *timeout will be adjusted to ensure that it is no more than the
- * desired timeout (with the usual rule for poll that <0 stands for
- * infinity).  *timeout may be 0 in which case no timeout information
- * will be returned.
- *
- * If *len_io is nonnegative then adns_pollfds will write to buffer
- * provided by the caller in buf.  If it is too small then *len_io
- * will be updated to say how large it would have needed to be and
- * adns_pollfds will fail with ENOSPC.
- *
- * If *len_io is -1 then buf should be 0, and adns_pollfds will use some
- * memory belonging to the adns_state, which may be overwritten on subsequent
- * calls.
- *
- * When you come out of poll(2), you should probably call adns_callback
- * with maxfd==-1.
+struct adns_query adns_forallqueries_begin(adns_state ads, void **context_r);
+struct adns_query adns_forallqueries_next(adns_state ads, adns_query, void **context_r);
+/* Iterator functions, which you can use to loop over the outstanding
+ * (submitted but not yet successfuly checked/waited) queries.  Each
+ * function returns a query handle and a corresponding context pointer,
+ * or returns 0 setting *context_r to 0 if there are no (more) queries.
+ * There is no need to explicitly finish an iteration.  context_r may be 0.
  *
- * On systems without poll(2) this function will return ENOSYS.
+ * IMPORTANT: you MUST NOT call ANY other adns function with the same
+ * adns_state, or with a query in the same adns_state, while you are
+ * doing one of these iterations.  After such a call the iterator
+ * value has undefined meaning and must not be used.
  */
 
-/* Example expected/legal calling sequences:
+/*
+ * Example expected/legal calling sequence for submit/check/wait:
  *  adns_init
  *  adns_submit 1
  *  adns_submit 2
@@ -343,18 +331,195 @@ struct pollfd *adns_pollfds(adns_state, struct pollfd *buf, int *len_io, int *ti
  *  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_
+ * 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_interest
+ *   adns_beforeselect
  *   select
- *   adns_callback
+ *   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.
+ *
+ * NOTE that if 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.
+ *
+ * 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 0.
+ *
+ * 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.
+ *
+ * adns_beforepoll will return 0 on success, and will not fail for any
+ * reason other than the fds buffer being too small (ERANGE).
+ *
+ * If *now is not 0 then this call 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.
+ */
+
+#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,
@@ -384,5 +549,11 @@ adns_status adns_rr_info(adns_rrtype type,
  */
 
 const char *adns_strerror(adns_status st);
+const char *adns_errabbrev(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".  You MUST NOT call these functions with status values
+ * not returned by the same adns library.
+ */
 
 #endif
index 6d3979a5b7c5255bbf600c2e910fdc57c3428c31..36b6820f74ee52cb747f38933e0d80861b12447a 100644 (file)
@@ -16,4 +16,5 @@
 #  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
+LIBOBJS=       types.o event.o query.o reply.o general.o setup.o transmit.o \
+               parse.o poll.o
index a665e34a39b6daa63b129a300b5fde949bac4c5b..80590fb617267e9ddbeed822ec2edf036886d378 100644 (file)
 /* Define if printf-format argument lists a la GCC are available.  */
 #undef HAVE_GNUC25_PRINTFFORMAT
 
+/* 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
+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
index 983e266949ef600677db2021f3a822571a206cfc..d54d8479c38151b36e914f298b99e99af1922491 100644 (file)
 #include <string.h>
 #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"
 
-/* TCP connection management */
+/* TCP connection management. */
+
+void adns__tcp_closenext(adns_state ads) {
+  int serv;
+  
+  serv= ads->tcpserver;
+  close(ads->tcpsocket);
+  ads->tcpstate= server_disconnected;
+  ads->tcprecv.used= ads->tcpsend.used= 0;
+  ads->tcpserver= (serv+1)%ads->nservers;
+}
 
 void adns__tcp_broken(adns_state ads, const char *what, const char *why) {
   int serv;
@@ -40,8 +55,7 @@ void adns__tcp_broken(adns_state ads, const char *what, const char *why) {
   assert(ads->tcpstate == server_connecting || ads->tcpstate == server_ok);
   serv= ads->tcpserver;
   adns__warn(ads,serv,0,"TCP connection lost: %s: %s",what,why);
-  close(ads->tcpsocket);
-  ads->tcpstate= server_disconnected;
+  adns__tcp_closenext(ads);
   
   for (qu= ads->timew.head; qu; qu= nqu) {
     nqu= qu->next;
@@ -54,9 +68,6 @@ void adns__tcp_broken(adns_state ads, const char *what, const char *why) {
       adns__query_fail(qu,adns_s_allservfail);
     }
   }
-
-  ads->tcprecv.used= ads->tcpsend.used= 0;
-  ads->tcpserver= (serv+1)%ads->nservers;
 }
 
 static void tcp_connected(adns_state ads, struct timeval now) {
@@ -100,7 +111,7 @@ void adns__tcp_tryconnect(adns_state ads, struct timeval now) {
     addr.sin_family= AF_INET;
     addr.sin_port= htons(DNS_PORT);
     addr.sin_addr= ads->servers[ads->tcpserver].addr;
-    r= connect(fd,&addr,sizeof(addr));
+    r= connect(fd,(const struct sockaddr*)&addr,sizeof(addr));
     ads->tcpsocket= fd;
     ads->tcpstate= server_connecting;
     if (r==0) { tcp_connected(ads,now); continue; }
@@ -109,9 +120,20 @@ void adns__tcp_tryconnect(adns_state ads, struct timeval now) {
   }
 }
 
-/* `Interest' functions - find out which fd's we might be interested in,
- * and when we want to be called back for a timeout.
- */
+/* 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) {
@@ -144,228 +166,131 @@ static void inter_maxtoabs(struct timeval **tv_io, struct timeval *tvbuf,
   inter_maxto(tv_io,tvbuf,maxtime);
 }
 
-static void inter_addfd(int *maxfd, fd_set *fds, int fd) {
-  if (!maxfd || !fds) return;
-  if (fd>=*maxfd) *maxfd= fd+1;
-  FD_SET(fd,fds);
-}
-
-static void checktimeouts(adns_state ads, struct timeval now,
-                         struct timeval **tv_io, struct timeval *tvbuf) {
+void adns__timeouts(adns_state ads, int act,
+                   struct timeval **tv_io, struct timeval *tvbuf,
+                   struct timeval now) {
   adns_query qu, nqu;
-  
+
   for (qu= ads->timew.head; qu; qu= nqu) {
     nqu= qu->next;
-    if (timercmp(&now,&qu->timeout,>)) {
+    if (timercmp(&now,&qu->timeout,<=)) {
+      if (!tv_io) continue;
+      inter_maxtoabs(tv_io,tvbuf,now,qu->timeout);
+    } else {
+      if (!act) continue;
       LIST_UNLINK(ads->timew,qu);
       if (qu->state != query_udp) {
        adns__query_fail(qu,adns_s_timeout);
       } else {
        adns__query_udp(qu,now);
       }
-    } else {
-      inter_maxtoabs(tv_io,tvbuf,now,qu->timeout);
+      nqu= ads->timew.head;
     }
   }
+}  
+
+void adns_firsttimeout(adns_state ads,
+                      struct timeval **tv_io, struct timeval *tvbuf,
+                      struct timeval now) {
+  adns__timeouts(ads, 0, tv_io,tvbuf, now);
+}
+
+void adns_processtimeouts(adns_state ads, const struct timeval *now) {
+  struct timeval tv_buf;
+
+  adns__must_gettimeofday(ads,&now,&tv_buf); if (!now) return;
+  adns__timeouts(ads, 1, 0,0, *now);
 }
 
-static void checkfds(adns_state ads, int *maxfd,
-                    fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
-                    int avail, struct pollfd *buf, int *count_r) {
-  int count;
+/* 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);
 
-  count= 0;
-  inter_addfd(ads->udpsocket,maxfd,readfds);
-  poll_addfd(ads->udpsocket,avail,buf,&count,POLLIN);
+  pollfds_buf[0].fd= ads->udpsocket;
+  pollfds_buf[0].events= POLLIN;
+  pollfds_buf[0].revents= 0;
 
   switch (ads->tcpstate) {
   case server_disconnected:
-    break;
+    return 1;
   case server_connecting:
-    inter_addfd(ads->tcpsocket,maxfd,writefds);
-    poll_addfd(ads->tcpsocket,avail,buf,&count,POLLOUT);
+    pollfds_buf[1].events= POLLOUT;
     break;
   case server_ok:
-    inter_addfd(ads->tcpsocket,maxfd,readfds);
-    inter_addfd(ads->tcpsocket,maxfd,exceptfds);
-    if (ads->tcpsend.used) inter_addfd(ads->tcpsocket,maxfd,writefds);
-    poll_addfd(ads->tcpsocket,avail,buf,&count,
-              ads->tcpsend.used ? POLLIN|POLLOUT : POLLIN);
+    pollfds_buf[1].events= ads->tcpsend.used ? POLLIN|POLLOUT|POLLPRI : POLLIN|POLLPRI;
     break;
   default:
     abort();
   }
+  pollfds_buf[1].fd= ads->tcpsocket;
+  pollfds_buf[1].revents= 0;
+  return 2;
 }
 
-struct pollfd *adns_pollfds(adns_state ads, struct pollfd *buf,
-                           int *len_io, int *timeout_io) {
-  struct timeval now, tvbuf, *tvp;
-  int timeout;
-  
-  r= gettimeofday(&now,0);
-  if (r) return 0;
-
-  timeout= *timeout_io;
-  if (timeout < 0) {
-    tvtop= 0;
-  } else {
-    tvbuf.tv_sec= now.tv_sec + (timeout/1000);
-    tvbuf.tv_usec= now.tv_usec + (timeout%1000)*1000;
-    if (tvbuf.tv_sec >= 1000000) {
-      tvbuf.tv_sec += 1;
-      tvbuf.tv_usec -= 1000000;
-    }
-    tvp= &tvbuf;
-  }
-  checktimouts(ads,now,&tvp,&tvbuf);
-
-  if (tvp) {
-    assert(tvbuf.tv_sec<INT_MAX/1000);
-    *timeout_io= (tvp->tv_sec - now.tv_sec)*1000 + (tvp->tv_usec - now.tv_usec)/1000;
-  } else {
-    *timeout_io= -1;
-  }
-
-  avail= *len_io;
-  if (avail == -1) {
-    buf= ads->pollfdsbuf;
-    avail= 2;
-    if (!buf) {
-      buf= ads->pollfdsbuf= malloc(sizeof(struct pollfd)*avail);
-      if (!buf) return 0;
-    }
-  }
-  checkfds(ads, 0,0,0,0, avail,buf,len_io);
-  if (*len_io > avail) { errno= ENOSPC; return 0; }
-
-  return buf;
-}
-void adns_interest(adns_state ads, int *maxfd,
-                  fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
-                  struct timeval **tv_io, struct timeval *tvbuf) {
-  struct timeval now;
-  struct timeval tvto_lr;
-  int r;
-  
-/*fprintf(stderr,"adns_interest\n");*/
-
-  r= gettimeofday(&now,0);
-  if (r) {
-    adns__warn(ads,-1,0,"gettimeofday failed - will sleep for a bit: %s",
-              strerror(errno));
-    timerclear(&tvto_lr); timevaladd(&tvto_lr,LOCALRESOURCEMS);
-    inter_maxto(tv_io, tvbuf, tvto_lr);
-  } else {
-    checktimeouts(ads,now,tv_io,tvbuf);
-  }
-
-  checkfds(ads, maxfd,readfds,writefds,exceptfds, 0,0,0);
-}
-
-/* Callback procedures - these do the real work of reception and timeout, etc. */
-
-static int callb_checkfd(int maxfd, const fd_set *fds, int fd) {
-  return maxfd<0 || !fds ? 1 :
-         fd<maxfd && FD_ISSET(fd,fds);
-}
-
-static int internal_callback(adns_state ads, int maxfd,
-                            const fd_set *readfds, const fd_set *writefds,
-                            const fd_set *exceptfds,
-                            struct timeval now) {
-  int skip, want, dgramlen, count, udpaddrlen, r, serv;
+int adns_processreadable(adns_state ads, int fd, const struct timeval *now) {
+  int skip, want, dgramlen, r, udpaddrlen, serv;
   byte udpbuf[DNS_MAXUDP];
   struct sockaddr_in udpaddr;
-
-  count= 0;
-
+  
   switch (ads->tcpstate) {
   case server_disconnected:
-    break;
   case server_connecting:
-    if (callb_checkfd(maxfd,writefds,ads->tcpsocket)) {
-      count++;
-      assert(ads->tcprecv.used==0);
-      if (!adns__vbuf_ensure(&ads->tcprecv,1)) return -1;
-      if (ads->tcprecv.buf) {
-       r= read(ads->tcpsocket,&ads->tcprecv.buf,1);
-       if (r==0 || (r<0 && (errno==EAGAIN || errno==EWOULDBLOCK))) {
-         tcp_connected(ads,now);
-       } else if (r>0) {
-         adns__tcp_broken(ads,"connect/read","sent data before first request");
-       } else if (errno!=EINTR) {
-         adns__tcp_broken(ads,"connect/read",strerror(errno));
-       }
-      }
-    }
     break;
   case server_ok:
-    count+= callb_checkfd(maxfd,readfds,ads->tcpsocket) +
-            callb_checkfd(maxfd,exceptfds,ads->tcpsocket) +
-      (ads->tcpsend.used && callb_checkfd(maxfd,writefds,ads->tcpsocket));
-    if (callb_checkfd(maxfd,readfds,ads->tcpsocket)) {
-      skip= 0;
-      for (;;) {
-       if (ads->tcprecv.used<skip+2) {
-         want= 2;
-       } else {
-         dgramlen= (ads->tcprecv.buf[skip]<<8) | ads->tcprecv.buf[skip+1];
-         if (ads->tcprecv.used<skip+2+dgramlen) {
-           want= 2+dgramlen;
-         } else {
-           adns__procdgram(ads,ads->tcprecv.buf+skip+2,dgramlen,ads->tcpserver,now);
-           skip+= 2+dgramlen; continue;
-         }
-       }
-       ads->tcprecv.used -= skip;
-       memmove(ads->tcprecv.buf,ads->tcprecv.buf+skip,ads->tcprecv.used);
-       skip= 0;
-       if (!adns__vbuf_ensure(&ads->tcprecv,want)) return -1;
-       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;
+    if (fd != ads->tcpsocket) break;
+    skip= 0;
+    for (;;) {
+      if (ads->tcprecv.used<skip+2) {
+       want= 2;
+      } else {
+       dgramlen= (ads->tcprecv.buf[skip]<<8) | ads->tcprecv.buf[skip+1];
+       if (ads->tcprecv.used<skip+2+dgramlen) {
+         want= 2+dgramlen;
        } else {
-         if (r<0) {
-           if (errno==EAGAIN || errno==EWOULDBLOCK || errno==ENOMEM) break;
-           if (errno==EINTR) continue;
-         }
-         adns__tcp_broken(ads,"read",r?strerror(errno):"closed");
-         break;
+         adns__procdgram(ads,ads->tcprecv.buf+skip+2,dgramlen,ads->tcpserver,*now);
+         skip+= 2+dgramlen; continue;
        }
       }
-    } else if (callb_checkfd(maxfd,exceptfds,ads->tcpsocket)) {
-      adns__tcp_broken(ads,"select","exceptional condition detected");
-    } else if (ads->tcpsend.used && callb_checkfd(maxfd,writefds,ads->tcpsocket)) {
-      r= write(ads->tcpsocket,ads->tcpsend.buf,ads->tcpsend.used);
-      if (r<0) {
-       if (errno!=EAGAIN && errno!=EWOULDBLOCK && errno!=ENOMEM && errno!=EINTR) {
-         adns__tcp_broken(ads,"write",strerror(errno));
+      ads->tcprecv.used -= skip;
+      memmove(ads->tcprecv.buf,ads->tcprecv.buf+skip,ads->tcprecv.used);
+      skip= 0;
+      if (!adns__vbuf_ensure(&ads->tcprecv,want)) return ENOMEM;
+      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) return 0;
+         if (errno==EINTR) continue;
+         if (errno_resources(errno)) return errno;
        }
-      } else if (r>0) {
-       ads->tcpsend.used -= r;
-       memmove(ads->tcpsend.buf,ads->tcpsend.buf+r,ads->tcpsend.used);
+       adns__tcp_broken(ads,"read",r?strerror(errno):"closed");
+       return 0;
       }
-    }
-    break;
+    } /* never reached */
   default:
     abort();
   }
-
-  if (callb_checkfd(maxfd,readfds,ads->udpsocket)) {
-    count++;
+  if (fd == ads->udpsocket) {
     for (;;) {
       udpaddrlen= sizeof(udpaddr);
-      r= recvfrom(ads->udpsocket,udpbuf,sizeof(udpbuf),0,&udpaddr,&udpaddrlen);
+      r= recvfrom(ads->udpsocket,udpbuf,sizeof(udpbuf),0,
+                 (struct sockaddr*)&udpaddr,&udpaddrlen);
       if (r<0) {
-       if (!(errno == EAGAIN || errno == EWOULDBLOCK ||
-             errno == EINTR || errno == ENOMEM || errno == ENOBUFS))
-         adns__warn(ads,-1,0,"datagram receive error: %s",strerror(errno));
-       break;
+       if (errno == EAGAIN || errno == EWOULDBLOCK) return 0;
+       if (errno == EINTR) continue;
+       if (errno_resources(errno)) return errno;
+       adns__warn(ads,-1,0,"datagram receive error: %s",strerror(errno));
+       return 0;
       }
       if (udpaddrlen != sizeof(udpaddr)) {
        adns__diag(ads,-1,0,"datagram received with wrong address length %d"
@@ -391,28 +316,195 @@ static int internal_callback(adns_state ads, int maxfd,
                   inet_ntoa(udpaddr.sin_addr));
        continue;
       }
-      adns__procdgram(ads,udpbuf,r,serv,now);
+      adns__procdgram(ads,udpbuf,r,serv,*now);
     }
   }
-  return count;
+  return 0;
 }
 
-int adns_callback(adns_state ads, int maxfd,
-                 const fd_set *readfds, const fd_set *writefds,
-                 const fd_set *exceptfds) {
-  struct timeval now;
+int adns_processwriteable(adns_state ads, int fd, const struct timeval *now) {
   int r;
+  
+  switch (ads->tcpstate) {
+  case server_disconnected:
+    break;
+  case server_connecting:
+    if (fd != ads->tcpsocket) break;
+    assert(ads->tcprecv.used==0);
+    for (;;) {
+      if (!adns__vbuf_ensure(&ads->tcprecv,1)) return ENOMEM;
+      r= read(ads->tcpsocket,&ads->tcprecv.buf,1);
+      if (r==0 || (r<0 && (errno==EAGAIN || errno==EWOULDBLOCK))) {
+       tcp_connected(ads,*now);
+       return 0;
+      }
+      if (r>0) {
+       adns__tcp_broken(ads,"connect/read","sent data before first request");
+       return 0;
+      }
+      if (errno==EINTR) continue;
+      if (errno_resources(errno)) return errno;
+      adns__tcp_broken(ads,"connect/read",strerror(errno));
+      return 0;
+    } /* 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) return 0;
+       if (errno_resources(errno)) return errno;
+       adns__tcp_broken(ads,"write",strerror(errno));
+       return 0;
+      } else if (r>0) {
+       ads->tcpsend.used -= r;
+       memmove(ads->tcpsend.buf,ads->tcpsend.buf+r,ads->tcpsend.used);
+      }
+    } /* not reached */
+  default:
+    abort();
+  }
+  return 0;
+}
+  
+int adns_processexceptional(adns_state ads, int fd, const struct timeval *now) {
+  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");
+    return 0;
+  default:
+    abort();
+  }
+  return 0;
+}
 
-  r= gettimeofday(&now,0); if (r) return -1;
-  checktimeouts(ads,now,0,0);
-  return internal_callback(ads,maxfd,readfds,writefds,exceptfds,now);
+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;
+  
+  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) return;
+    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;
+}
+
+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 pollfd pollfds[MAX_POLLFDS];
+  int npollfds;
+
+  adns_processtimeouts(ads,now);
+
+  npollfds= adns__pollfds(ads,pollfds);
+  adns__fdevents(ads,
+                pollfds,npollfds,
+                maxfd,readfds,writefds,exceptfds,
+                *now, 0);
+}
+
+/* General helpful functions. */
+
+void adns_globalsystemfailure(adns_state ads) {
+  while (ads->timew.head) {
+    adns__query_fail(ads->timew.head, adns_s_systemfail);
+  }
+  
+  switch (ads->tcpstate) {
+  case server_connecting:
+  case server_ok:
+    adns__tcp_closenext(ads);
+    break;
+  case server_disconnected:
+    break;
+  default:
+    abort();
+  }
 }
 
-/* User-visible functions and their implementation. */
+int adns_processany(adns_state ads) {
+  int r;
+  struct timeval now;
+  struct pollfd pollfds[MAX_POLLFDS];
+  int npollfds;
+
+  r= gettimeofday(&now,0);
+  if (!r) adns_processtimeouts(ads,&now);
+
+  npollfds= adns__pollfds(ads,pollfds);
+  adns__fdevents(ads,
+                pollfds,npollfds,
+                0,0,0,0,
+                now,&r);
+  return r;
+}
 
 void adns__autosys(adns_state ads, struct timeval now) {
   if (ads->iflags & adns_if_noautosys) return;
-  adns_callback(ads,-1,0,0,0);
+  adns_processany(ads);
 }
 
 static int internal_check(adns_state ads,
@@ -439,7 +531,7 @@ int adns_wait(adns_state ads,
              adns_query *query_io,
              adns_answer **answer_r,
              void **context_r) {
-  int r, maxfd, rsel, rcb;
+  int r, maxfd, rsel;
   fd_set readfds, writefds, exceptfds;
   struct timeval tvbuf, *tvp;
   
@@ -448,14 +540,19 @@ int adns_wait(adns_state ads,
     if (r != EWOULDBLOCK) return r;
     maxfd= 0; tvp= 0;
     FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds);
-    adns_interest(ads,&maxfd,&readfds,&writefds,&exceptfds,&tvp,&tvbuf);
+    adns_beforeselect(ads,&maxfd,&readfds,&writefds,&exceptfds,&tvp,&tvbuf,0);
     rsel= select(maxfd,&readfds,&writefds,&exceptfds,tvp);
     if (rsel==-1) {
-      if (errno == EINTR && !(ads->iflags & adns_if_eintr)) continue;
-      return errno;
+      if (errno == EINTR) {
+       if (ads->iflags & adns_if_eintr) return EINTR;
+      } 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);
     }
-    rcb= adns_callback(ads,maxfd,&readfds,&writefds,&exceptfds);
-    assert(rcb==rsel);
   }
 }
 
@@ -466,7 +563,8 @@ int adns_check(adns_state ads,
   struct timeval now;
   int r;
   
-  r= gettimeofday(&now,0); if (r) return errno;
-  adns__autosys(ads,now);
+  r= gettimeofday(&now,0);
+  if (!r) adns__autosys(ads,now);
+  
   return internal_check(ads,query_io,answer_r,context_r);
 }
index 33946ad905c53663808db3b6c2645301fa6a80c7..71009f7d674c36d22221e1708fba911c10bcccd7 100644 (file)
@@ -24,6 +24,9 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 
 #include "internal.h"
@@ -197,10 +200,11 @@ adns_status adns_rr_info(adns_rrtype type,
   return st;
 }
 
-#define SINFO(n,s) { adns_s_##n, s }
+#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"                                            ),
@@ -241,16 +245,22 @@ static int si_compar(const void *key, const void *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) {
-  static char buf[100];
+  const struct sinfo *si;
+
+  si= findsinfo(st);
+  return si->string;
+}
 
+const char *adns_errabbrev(adns_status st) {
   const struct sinfo *si;
 
-  si= bsearch(&st,sinfos,sizeof(sinfos)/sizeof(*si),sizeof(*si),si_compar);
-  if (si) return si->string;
-  
-  snprintf(buf,sizeof(buf),"code %d",st);
-  return buf;
+  si= findsinfo(st);
+  return si->abbrev;
 }
 
 void adns__isort(void *array, int nobjs, int sz, void *tempbuf,
@@ -270,3 +280,32 @@ void adns__isort(void *array, int nobjs, int sz, void *tempbuf,
     }
   }
 }
+
+/* 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);
+}
index 94b8b20a8efe01be83584006d2ac19dbe8564cd3..dadd854a88e42c05b75a88471bc446f90ba21988 100644 (file)
@@ -31,6 +31,8 @@ typedef unsigned char byte;
 #include <stdarg.h>
 #include <assert.h>
 #include <unistd.h>
+#include <signal.h>
+#include <errno.h>
 
 #include <sys/time.h>
 
@@ -43,17 +45,19 @@ typedef unsigned char byte;
 #define UDPMAXRETRIES 15
 #define UDPRETRYMS 2000
 #define TCPMS 30000
-#define LOCALRESOURCEMS 20
 #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 {
   rcode_noerror,
   rcode_formaterror,
@@ -172,11 +176,24 @@ struct adns__query {
    * 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, udpretries;
   int udpnextserver;
@@ -198,8 +215,11 @@ struct adns__query {
    *  tcpsent timew   null   >=0  irrelevant     zero        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.
+   *
    *                         +------------------------+
    *             START -----> |      udp/NONE          |
    *                         +------------------------+
@@ -246,16 +266,19 @@ struct adns__state {
   struct { adns_query head, tail; } timew, childw, output;
   int nextid, udpsocket, tcpsocket;
   vbuf tcpsend, tcprecv;
-  int nservers, nsortlist, tcpserver;
+  int nservers, nsortlist, nsearchlist, searchndots, tcpserver;
   enum adns__tcpstate { server_disconnected, server_connecting, server_ok } tcpstate;
   struct timeval tcptimeout;
-  struct pollfd *pollfdsbuf; /* fixme: init and cleanup */
+  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: */
@@ -303,13 +326,22 @@ void adns__isort(void *array, int nobjs, int sz, void *tempbuf,
  * 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.
+ */
+
 /* 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, and returns id at *id_r. */
+/* 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,
@@ -339,10 +371,10 @@ void adns__query_udp(adns_query qu, struct timeval now);
 
 /* From query.c: */
 
-int adns__internal_submit(adns_state ads, adns_query *query_r,
-                         const typeinfo *typei, vbuf *qumsg_vb, int id,
-                         adns_queryflags flags, struct timeval now,
-                         adns_status failstat, const qcontext *ctx);
+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.
@@ -351,10 +383,28 @@ int adns__internal_submit(adns_state ads, adns_query *query_r,
  * 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).
  *
- * If failstat is nonzero then if we are successful in creating the query
- * it is immediately failed with code failstat (but _submit still succeds).
- *
  * *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 iff this is the last child for
+ * that parent.  If there is no error detected in the callback, then
+ * it should call adns__query_done if and only if there are no more
+ * children (by checking parent->children.head).  If an error is
+ * detected in the callback it should call adns__query_fail and any
+ * remaining children will automatically be cancelled.
+ */
+
+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);
@@ -483,6 +533,15 @@ adns_status adns__parse_domain(adns_state ads, int serv, adns_query qu,
  * 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,
@@ -542,11 +601,24 @@ 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);
+void adns__tcp_closenext(adns_state ads);
 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. */
 
+void adns__must_gettimeofday(adns_state ads, const struct timeval **now_io,
+                            struct timeval *tv_buf);
+void adns__timeouts(adns_state ads, int act,
+                   struct timeval **tv_io, struct timeval *tvbuf,
+                   struct timeval now);
+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);
+
 /* Useful static inline functions: */
 
 static inline void timevaladd(struct timeval *tv_io, long ms) {
@@ -562,9 +634,11 @@ static inline void timevaladd(struct timeval *tv_io, long ms) {
 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');
+  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
 }
 
+static inline int errno_resources(int e) { return e==ENOMEM || e==ENOBUFS; }
+
 /* Useful macros */
 
 #define MEM_ROUND(sz) \
@@ -572,6 +646,7 @@ static inline int ctype_alpha(int c) {
    * sizeof(union maxalign) )
 
 #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 { \
index 842556a79ae55ff93a540597ecd4b7a70d4c3dc2..5c4bdaf7a9196fe9ffbc67eb52c8dbd4c21cc427 100644 (file)
@@ -117,18 +117,28 @@ adns_status adns__parse_domain(adns_state ads, int serv, adns_query qu,
                               const byte *dgram, int dglen, int *cbyte_io, int max) {
   findlabel_state fls;
   
-  int lablen, labstart, i, ch;
-  adns_status st;
-
   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);
+    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 (vb->used)
+    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;
diff --git a/src/poll.c b/src/poll.c
new file mode 100644 (file)
index 0000000..03f153a
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * poll.c
+ * - wrappers for poll(2)
+ */
+/*
+ *  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. 
+ */
+
+#include <limits.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;
+  struct pollfd fds_tmp[MAX_POLLFDS];
+
+  adns__must_gettimeofday(ads,&now,&tv_nowbuf);
+  if (!now) { *nfds_io= 0; return 0; }
+
+  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, 1, &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 (found < space) return space ? ERANGE : 0;
+    memcpy(fds,fds_tmp,sizeof(struct pollfd)*found);
+  }
+  return 0;
+}
+
+void adns_afterpoll(adns_state ads, const struct pollfd *fds, int nfds,
+                   const struct timeval *now) {
+  struct timeval tv_buf;
+
+  adns__must_gettimeofday(ads,&now,&tv_buf);
+  if (!now) return;
+
+  adns__timeouts(ads,1, 0,0, *now);
+  adns__fdevents(ads, fds,nfds, 0,0,0,0, *now,0);
+}
+
+#endif
index 666fdd705948c7714551bfb311734dc0932f0329..b9860bf0ab7d1cc295cd85915cc59382d9ce3598 100644 (file)
 
 #include "internal.h"
 
-int adns__internal_submit(adns_state ads, adns_query *query_r,
-                         const typeinfo *typei, vbuf *qumsg_vb, int id,
-                         adns_queryflags flags, struct timeval now,
-                         adns_status failstat, const qcontext *ctx) {
+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) goto x_nomemory;
-  qu->answer= malloc(sizeof(*qu->answer)); if (!qu->answer) goto x_freequ_nomemory;
-
+  
+  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_udp;
   qu->back= qu->next= qu->parent= 0;
   LIST_INIT(qu->children);
-  qu->siblings.next= qu->siblings.back= 0;
+  LINK_INIT(qu->siblings);
   LIST_INIT(qu->allocations);
   qu->interim_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;
-  
-  qu->id= id;
+
+  adns__vbuf_init(&qu->search_vb);
+  qu->search_origlen= qu->search_pos= qu->search_doneabs= 0;
+
+  qu->id= 0;
   qu->flags= flags;
   qu->udpretries= 0;
   qu->udpnextserver= 0;
   qu->udpsent= qu->tcpfailed= 0;
   timerclear(&qu->timeout);
-  memcpy(&qu->ctx,ctx,sizeof(qu->ctx));
   qu->expires= now.tv_sec + MAXTTLBELIEVE;
 
+  memset(&qu->ctx,0,sizeof(qu->ctx));
+
   qu->answer->status= adns_s_ok;
-  qu->answer->cname= 0;
+  qu->answer->cname= qu->answer->owner= 0;
   qu->answer->type= typei->type;
+  qu->answer->expires= -1;
   qu->answer->nrrs= 0;
-  qu->answer->rrs= 0;
+  qu->answer->rrs.untyped= 0;
   qu->answer->rrsz= typei->rrsz;
-  
-  *query_r= qu;
 
-  qu->query_dglen= qumsg_vb->used;
-  if (qumsg_vb->used) {
-    qu->query_dgram= malloc(qumsg_vb->used);
-    if (!qu->query_dgram) {
-      adns__query_fail(qu,adns_s_nomemory);
-      return adns_s_ok;
-    }
-    memcpy(qu->query_dgram,qumsg_vb->buf,qumsg_vb->used);
-  } else {
-    qu->query_dgram= 0;
-  }
+  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.
+   */
+
   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);
   
-  if (failstat) {
-    adns__query_fail(qu,failstat);
-    return adns_s_ok;
-  }
   adns__query_udp(qu,now);
   adns__autosys(ads,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;
+}
 
- x_freequ_nomemory:
-  free(qu);
- x_nomemory:
-  adns__vbuf_free(qumsg_vb);
-  return adns_s_nomemory;
+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;
+
+  adns__vbuf_init(&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_interim(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,
@@ -111,34 +194,58 @@ int adns_submit(adns_state ads,
                adns_queryflags flags,
                void *context,
                adns_query *query_r) {
-  qcontext ctx;
-  int id, r, ol;
-  vbuf vb;
+  int r, ol, ndots;
   adns_status stat;
   const typeinfo *typei;
   struct timeval now;
+  adns_query qu;
+  const char *p;
 
   typei= adns__findtype(type);
   if (!typei) return adns_s_unknownrrtype;
+
+  r= gettimeofday(&now,0); if (r) goto x_errno;
+  qu= query_alloc(ads,typei,flags,now); if (!qu) goto x_errno;
   
-  ctx.ext= context;
-  ctx.callback= 0;
-  memset(&ctx.info,0,sizeof(ctx.info));
-  
-  r= gettimeofday(&now,0); if (r) return errno;
-  id= 0;
+  qu->ctx.ext= context;
+  qu->ctx.callback= 0;
+  memset(&qu->ctx.info,0,sizeof(qu->ctx.info));
 
-  adns__vbuf_init(&vb);
+  *query_r= qu;
 
   ol= strlen(owner);
-  if (ol<=1 || ol>DNS_MAXDOMAIN+1) { stat= adns_s_querydomaintoolong; goto xit; }
+  if (!ol) { stat= adns_s_querydomaininvalid; goto x_adnsfail; }
+  if (ol>DNS_MAXDOMAIN+1) { stat= adns_s_querydomaintoolong; goto x_adnsfail; }
                                 
-  if (owner[ol-1]=='.' && owner[ol-2]!='\\') { flags &= ~adns_qf_search; ol--; }
+  if (ol>=1 && owner[ol-1]=='.' && (ol<2 || owner[ol-2]!='\\')) {
+    flags &= ~adns_qf_search;
+    ol--;
+  }
 
-  stat= adns__mkquery(ads,&vb,&id, owner,ol, typei,flags);
-                       
- xit:
-  return adns__internal_submit(ads,query_r, typei,&vb,id, flags,now, stat,&ctx);       
+  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);
+  }
+  return 0;
+
+ x_adnsfail:
+  adns__query_fail(qu,stat);
+  return 0;
+
+ x_errno:
+  r= errno;
+  assert(r);
+  return r;
 }
 
 int adns_synchronous(adns_state ads,
@@ -227,7 +334,7 @@ void adns__reset_cnameonly(adns_query qu) {
   assert(!qu->final_allocspace);
   cancel_children(qu);
   qu->answer->nrrs= 0;
-  qu->answer->rrs= 0;
+  qu->answer->rrs.untyped= 0;
   qu->interim_allocd= qu->answer->cname ? MEM_ROUND(strlen(qu->answer->cname)+1) : 0;
 }
 
@@ -281,6 +388,7 @@ static void makefinal_query(adns_query qu) {
 
   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);
@@ -306,6 +414,14 @@ void adns__query_done(adns_query 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);
@@ -321,6 +437,7 @@ void adns__query_done(adns_query qu) {
   parent= qu->parent;
   if (parent) {
     LIST_UNLINK_PART(parent->children,qu,siblings.);
+    if (!parent->children.head) LIST_UNLINK(qu->ads->childw,parent);
     qu->ctx.callback(parent,qu);
     free_query_allocs(qu);
     free(qu);
index 452c5f69080ad4fe4822f7e82fafe4544322335b..ab7c8ff4aadbc37c6cdb589baf43b49aa384cc88 100644 (file)
@@ -156,7 +156,7 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
       }
       continue;
     }
-    if (rrtype == adns_r_cname && /* fixme - implement adns_qf_nocname */
+    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);
@@ -227,7 +227,12 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
     if (rcode == rcode_nxdomain) {
       /* We still wanted to look for the SOA so we could find the TTL. */
       adns__update_expires(qu,soattl,now);
-      adns__query_fail(qu,adns_s_nxdomain);
+
+      if (qu->flags & adns_qf_search) {
+       adns__search_next(ads,qu,now);
+      } else {
+       adns__query_fail(qu,adns_s_nxdomain);
+      }
       return;
     }
 
index 137d22b090a616f0b11785fa667665ca612930ff..2765dc4a8d3c884fb3ccc785f38bed549216447c 100644 (file)
 #include <stdlib.h>
 #include <errno.h>
 #include <string.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"
@@ -74,6 +77,23 @@ static void configparseerr(adns_state ads, const char *fn, int lno,
   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;
   
@@ -86,42 +106,56 @@ static void ccf_nameserver(adns_state ads, const char *fn, int lno, const char *
 }
 
 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;
-  adns__diag(ads,-1,0,"warning - `search' ignored fixme");
+
+  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;
+  }
+
+  free(ads->searchlist);
+  ads->nsearchlist= count;
+  ads->searchlist= newptrs;
 }
 
-static void ccf_sortlist(adns_state ads, const char *fn, int lno, const char *bufp) {
-  const char *p, *q;
+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;
-  if (!bufp) return;
-
-  for (;;) {
-    while (ctype_whitespace(*bufp)) bufp++;
-    if (!*bufp) return;
-
-    q= bufp;
-    while (*q && !ctype_whitespace(*q)) q++;
-
-    p= bufp;
-    l= q-p;
-    bufp= q;
-
+  while (nextword(&buf,&word,&l)) {
     if (ads->nsortlist >= MAXSORTLIST) {
-      adns__diag(ads,-1,0,"too many sortlist entries, ignoring %.*s onwards",l,p);
+      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,p);
+      configparseerr(ads,fn,lno,"sortlist entry `%.*s' too long",l,word);
       continue;
     }
     
-    memcpy(tbuf,p,l);
+    memcpy(tbuf,word,l); tbuf[l]= 0;
     slash= strchr(tbuf,'/');
     if (slash) *slash++= 0;
     
@@ -172,8 +206,29 @@ static void ccf_sortlist(adns_state ads, const char *fn, int lno, const char *bu
 }
 
 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;
-  adns__diag(ads,-1,0,"warning - `options' ignored fixme");
+
+  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;
+    }
+    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) {
@@ -393,8 +448,10 @@ static int init_begin(adns_state *ads_r, adns_initflags flags, FILE *diagfile) {
   ads->udpsocket= ads->tcpsocket= -1;
   adns__vbuf_init(&ads->tcpsend);
   adns__vbuf_init(&ads->tcprecv);
-  ads->nservers= ads->nsortlist= ads->tcpserver= 0;
+  ads->nservers= ads->nsortlist= ads->nsearchlist= ads->tcpserver= 0;
   ads->tcpstate= server_disconnected;
+  ads->searchlist= 0;
+  ads->searchndots= 1;
   timerclear(&ads->tcptimeout);
 
   *ads_r= ads;
@@ -429,6 +486,14 @@ static int init_finish(adns_state 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;
@@ -455,6 +520,12 @@ int adns_init(adns_state *ads_r, adns_initflags flags, FILE *diagfile) {
   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;
 
@@ -472,7 +543,7 @@ int adns_init_strcfg(adns_state *ads_r, adns_initflags flags,
   readconfigtext(ads,configtext,"<supplied configuration text>");
   if (ads->configerrno) {
     r= ads->configerrno;
-    free(ads);
+    init_abort(ads);
     return r;
   }
 
index d3978c3f713149e77923bfa31365f5a75e9eabe1..e373b48c77bdb010f0f1ac9a451af939f98aac33 100644 (file)
@@ -24,6 +24,7 @@
 #include <errno.h>
 #include <string.h>
 
+#include <sys/types.h>
 #include <sys/uio.h>
 
 #include "internal.h"
@@ -39,11 +40,10 @@ static adns_status mkquery_header(adns_state ads, vbuf *vb, int *id_r, int qdlen
   
   if (!adns__vbuf_ensure(vb,DNS_HDRSIZE+qdlen+4)) return adns_s_nomemory;
 
-  *id_r= id= (ads->nextid++) & 0x0ffff;
-  
   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) */
@@ -83,8 +83,7 @@ adns_status adns__mkquery(adns_state ads, vbuf *vb, int *id_r,
 
   p= owner; pe= owner+ol;
   nlabs= 0;
-  if (!*p) return adns_s_querydomaininvalid;
-  do {
+  while (p!=pe) {
     ll= 0;
     while (p!=pe && (c= *p++)!='.') {
       if (c=='\\') {
@@ -114,7 +113,7 @@ adns_status adns__mkquery(adns_state ads, vbuf *vb, int *id_r,
     if (nlabs++ > 63) return adns_s_querydomaintoolong;
     MKQUERY_ADDB(ll);
     memcpy(rqp,label,ll); rqp+= ll;
-  } while (p!=pe);
+  }
   MKQUERY_ADDB(0);
 
   MKQUERY_STOP(vb);
@@ -179,7 +178,9 @@ void adns__query_tcp(adns_query qu, struct timeval now) {
     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)) {
@@ -234,7 +235,8 @@ void adns__query_udp(adns_query qu, struct timeval now) {
   servaddr.sin_addr= ads->servers[serv].addr;
   servaddr.sin_port= htons(DNS_PORT);
   
-  r= sendto(ads->udpsocket,qu->query_dgram,qu->query_dglen,0,&servaddr,sizeof(servaddr));
+  r= sendto(ads->udpsocket,qu->query_dgram,qu->query_dglen,0,
+           (const struct sockaddr*)&servaddr,sizeof(servaddr));
   if (r<0 && errno == EMSGSIZE) { query_usetcp(qu,now); return; }
   if (r<0) adns__warn(ads,serv,0,"sendto failed: %s",strerror(errno));
   
index deac6c4270498144e134e35bbea7d030b4c1a1d2..7e671fc9a98e779d5ae29fd4d9356dd0297b032c 100644 (file)
 #include <stdlib.h>
 #include <string.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)     if (!adns__vbuf_appendstr(vb,(s))) R_NOMEM; else;
+#define CSP_ADDSTR(s)     do { if (!adns__vbuf_appendstr(vb,(s))) R_NOMEM; } while (0)
 
 /*
  * order of sections:
@@ -51,7 +54,7 @@
  * _strpair                   (mf,cs)
  * _intstrpair                (mf,cs)
  * _hinfo                     (pa)
- * _mailbox                   (pap)
+ * _mailbox                   (pap +pap_mailbox822)
  * _rp                        (pa)
  * _soa                       (pa,mf,cs)
  * _flat                      (mf)
@@ -469,7 +472,7 @@ static adns_status pap_hostaddr(const parseinfo *pai, int *cbyte_io,
   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, 0, &ctx);
+                           &pai->qu->vb, id, nflags, pai->now, &ctx);
   if (st) return st;
 
   nqu->parent= pai->qu;
@@ -712,7 +715,7 @@ static adns_status pa_ptr(const parseinfo *pai, int dmstart, int max, void *data
   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, 0, &ctx);
+                           adns_qf_quoteok_query, pai->now, &ctx);
   if (st) return st;
 
   nqu->parent= pai->qu;
@@ -788,10 +791,70 @@ static adns_status pa_hinfo(const parseinfo *pai, int cbyte, int max, void *data
  * _mailbox   (pap)
  */
 
+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 (strchr("()<>@,;:\\\".[]",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 (strchr("()<>@,;:\\\".[]",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) {
-  return pap_domain(pai, cbyte_io, max, mb_r, pdf_quoteok);
-  /* fixme: mailbox quoting */
+  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,
+                     pai->qu->flags & adns_qf_quoteok_anshost ? pdf_quoteok : 0);
+  }
 }
 
 /*