[Nagiosplug-devel] RFC: netutils.c function change

Jeremy T. Bouse Jeremy.Bouse at UnderGrid.net
Fri Dec 13 09:40:01 CET 2002


	In direct reply regarding POSIX compliance I've been digging
around this morning since I got into work... I can verify that the
IPPROTO_ prefix is in use on OpenBSD as well as FreeBSD, Linux and
Solaris as I had mentioned in an earlier post I made before leaving home
for work...

	What I found was that the IPPROTO_ prefix was in fact mentioned
in the POSIX 1003.1-2001 Draft[1] index as the document itself is not 
freely available and in RFC2133, obsoleted by RFC2553[2], which
describes the IPPROTO_ prefix use in addrinfo structure as:

   The addrinfo structure is defined as a result of including the
   <netdb.h> header.

  struct addrinfo {
    int     ai_flags;     /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
    int     ai_family;    /* PF_xxx */
    int     ai_socktype;  /* SOCK_xxx */
    int     ai_protocol;  /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
    size_t  ai_addrlen;   /* length of ai_addr */
    char   *ai_canonname; /* canonical name for nodename */
    struct sockaddr  *ai_addr; /* binary address */
    struct addrinfo  *ai_next; /* next structure in linked list */
  };

	on page 26 of the document under Section 6.4
Protocol-Independent Nodename and Service Name Translation . If you look
into the patch[3] I produced against netutils.c where these changes
would need to take place it is used with getaddrinfo() to set the hints
structure. So yes I believe this is POSIX compliant.

	The other AF-independent code changes have been modeled after
documentation available[4] by Jun-ichiro itojun Itoh of the KAME
Project.

	Jeremy

[1]http://std.dkuug.dk/jtc1/sc22/open/n3232/xshindex.pdf
[2]ftp://ftp.rfc-editor.org/in-notes/rfc2553.txt
[3]http://sourceforge.net/tracker/download.php?group_id=29880&atid=397599&file_id=37324&aid=651617
[4]http://www.kame.net/newsletter/19980604/

On Fri, Dec 13, 2002 at 07:47:46AM -0500, Karl DeBisschop wrote:
> I assume that IPPROTO_TCP and IPPROTO_UDP are POSIX-specified and have
> been for some time?
> 
> If they are in POSIX, in addition to generally available, I would
> generally strongly advocate their use. Thus a patch would be likely to
> go in quickly.
> 
> If not in POSIX, I'd want to do more investigation.
> 




More information about the Devel mailing list