Debian Bug report logs - #629260
ns_initparse(3), ns_msg_count(3), etc: please document resolver library routines

version graph

Package: manpages-dev; Maintainer for manpages-dev is Dr. Tobias Quathamer <[email protected]>; Source for manpages-dev is src:manpages (PTS, buildd, popcon).

Reported by: Jonathan Nieder <[email protected]>

Date: Sun, 5 Jun 2011 00:51:02 UTC

Severity: wishlist

Tags: upstream

Found in version manpages/3.27-1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], [email protected], [email protected], Martin Schulze <[email protected]>:
Bug#629260; Package manpages-dev. (Sun, 05 Jun 2011 00:51:05 GMT) (full text, mbox, link).


Acknowledgement sent to Jonathan Nieder <[email protected]>:
New Bug report received and forwarded. Copy sent to [email protected], [email protected], Martin Schulze <[email protected]>. (Sun, 05 Jun 2011 00:51:05 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Jonathan Nieder <[email protected]>
To: [email protected]
Subject: [WANTED] ns_initparse(3), ns_msg_count(3), etc (please document resolver library routines)
Date: Sat, 4 Jun 2011 19:47:47 -0500
Package: manpages-dev
Version: 3.27-1
Severity: wishlist
Tags: upstream

Martin Ferrari wrote[1]:

> I'm using functions defined in arpa/nameser.h, undocumented in libc, but
> explained in chapter 12 of O'Reilly's DNS & BIND (ISBN: 0-596-00158-4).
> I do think that this lack of documentation is also a bug.

He's right --- these functions are useful and a longstanding API, and
it is not very rare to find programs that use them.

They became part of the libresolv ABI in glibc 2.9, which provides us
with a convenient list[2]:

	ns_msg_getflag
	ns_get16, ns_get32, ns_put16, ns_put32
	ns_initparse, ns_skiprr, ns_parserr
	ns_sprintrr, ns_sprintrrf
	ns_format_ttl, ns_parse_ttl
	ns_datetosecs
	ns_name_ntol, ns_name_ntop, ns_name_pton
	ns_name_unpack, ns_name_pack
	ns_name_uncompress, ns_name_compress
	ns_name_skip, ns_name_rollback
	ns_samedomain, ns_subdomain, ns_makecanon, ns_samename

The code comes from Bind 8.2.2-P5 originally.  The BIND documentation
says[3]:

	As of this writing, there is no formal "manual" of the
	libraries, except this document, header files (some of them
	provide pretty detailed explanations), and sample application
	programs.

Alas.  But we can be trailblazers; filing to coordinate.  Pointers to
relevant references (such as mailing list archives or source trees
from the time these functions were invented, which could help document
their rationale) would be especially helpful.

Thanks.
Jonathan

[1] http://bugs.debian.org/291609
[2] from resolv/Versions
[3] http://ftp.isc.org/isc/bind9/cur/9.8/doc/arm/Bv9ARM.ch09.html#id2609111




Information forwarded to [email protected], Martin Schulze <[email protected]>:
Bug#629260; Package manpages-dev. (Sun, 05 Jun 2011 01:39:03 GMT) (full text, mbox, link).


Acknowledgement sent to Robert Edmonds <[email protected]>:
Extra info received and forwarded to list. Copy sent to Martin Schulze <[email protected]>. (Sun, 05 Jun 2011 01:39:03 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Robert Edmonds <[email protected]>
To: Jonathan Nieder <[email protected]>, [email protected]
Subject: Re: Bug#629260: [WANTED] ns_initparse(3), ns_msg_count(3), etc (please document resolver library routines)
Date: Sat, 4 Jun 2011 21:26:19 -0400
Jonathan Nieder wrote:
> Package: manpages-dev
> Version: 3.27-1
> Severity: wishlist
> Tags: upstream
> 
> Martin Ferrari wrote[1]:
> 
> > I'm using functions defined in arpa/nameser.h, undocumented in libc, but
> > explained in chapter 12 of O'Reilly's DNS & BIND (ISBN: 0-596-00158-4).
> > I do think that this lack of documentation is also a bug.
> 
> He's right --- these functions are useful and a longstanding API, and
> it is not very rare to find programs that use them.
> 
> They became part of the libresolv ABI in glibc 2.9, which provides us
> with a convenient list[2]:
> 
> 	ns_msg_getflag
> 	ns_get16, ns_get32, ns_put16, ns_put32
> 	ns_initparse, ns_skiprr, ns_parserr
> 	ns_sprintrr, ns_sprintrrf
> 	ns_format_ttl, ns_parse_ttl
> 	ns_datetosecs
> 	ns_name_ntol, ns_name_ntop, ns_name_pton
> 	ns_name_unpack, ns_name_pack
> 	ns_name_uncompress, ns_name_compress
> 	ns_name_skip, ns_name_rollback
> 	ns_samedomain, ns_subdomain, ns_makecanon, ns_samename

the only documentation i know of for some of these functions is in the
DNS & BIND book starting around p. 447 (5th edition).

it would probably be best if documentation for these functions were not
readily available in order to discourage their use in new projects, as
there are much better modern DNS message parsing libraries available.

> The code comes from Bind 8.2.2-P5 originally.  The BIND documentation
> says[3]:
> [3] http://ftp.isc.org/isc/bind9/cur/9.8/doc/arm/Bv9ARM.ch09.html#id2609111

the BIND9 9.8 documentation is totally irrelevant in this case, as BIND9
9.8 lacks the BIND4/BIND8 resolver library.  the relevant ISC product
would be libbind, but i don't believe those functions are documented in
libbind either.

(side note: i will probably request the removal of the libbind package
from debian before the next stable release, now that glibc's libresolv
has finally been fixed.)

-- 
Robert Edmonds
[email protected]




Information stored :
Bug#629260; Package manpages-dev. (Sun, 19 Jun 2011 12:24:46 GMT) (full text, mbox, link).


Acknowledgement sent to Jonathan Nieder <[email protected]>:
Extra info received and filed, but not forwarded. (Sun, 19 Jun 2011 12:24:47 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Jonathan Nieder <[email protected]>
To: [email protected]
Subject: Re: [WANTED] ns_initparse(3), ns_msg_count(3), etc (please document resolver library routines)
Date: Sun, 19 Jun 2011 07:14:53 -0500
Robert Edmonds wrote:

> the only documentation i know of for some of these functions is in the
> DNS & BIND book starting around p. 447 (5th edition).

Here's a good starting point:

https://lists.isc.org/pipermail/bind-users/2008-July/070847.html
(message-id <[email protected]>, "Developing against libbind",
2008-07-06)

The resolv.h API (res_init, dn_expand, etc) seems to have been
introduced in Net/2 and slowly expanded from there.  The ns_ functions
did not appear until BIND 8.




Changed Bug title to 'ns_initparse(3), ns_msg_count(3), etc: please document resolver library routines' from '[WANTED] ns_initparse(3), ns_msg_count(3), etc (please document resolver library routines)' Request was from Stéphane Aulery <[email protected]> to [email protected]. (Sun, 08 Mar 2015 19:45:26 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Sun Sep 22 03:25:14 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.