From owner-freebsd-arch Sat Aug 10 13:41:50 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8C0E437B400 for ; Sat, 10 Aug 2002 13:41:48 -0700 (PDT) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C36943E5E for ; Sat, 10 Aug 2002 13:41:48 -0700 (PDT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id C23DD72FBC; Sat, 10 Aug 2002 13:39:02 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id BE8BB72D9E; Sat, 10 Aug 2002 13:39:02 -0700 (PDT) Date: Sat, 10 Aug 2002 13:39:02 -0700 (PDT) From: Doug White To: Antoine Beaupre Cc: freebsd-arch@freebsd.org Subject: Re: implementation differences between inet_aton() and inet_pton() In-Reply-To: <3A565436-ABC5-11D6-BAC6-0050E4A0BB3F@anarcat.ath.cx> Message-ID: <20020810132127.O38270-100000@carver.gumbysoft.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 9 Aug 2002, Antoine Beaupre wrote: > I just stumbled upon some differences between the results given by > inet_aton() and inet_pton(). [...] > Is this difference there by design or accident? Reading the manpage, it appears to be by design. The API makes a distinction between a "presentation address" vs a standard address. A standard address can be multiple formats (assumably to allow for flexibility in a program's internal representation of an address), but a presentation address is assumed to be a dotted decimal quad in AF_INET since it will be printed or passed externally. The man page also mentions that addr2ascii(3) should be used in preference to the inet_Xton functions. Don't know how well thats been followed :) > In either case it should be documented how each function parses the > numbers, because it is rather important. A couple of sentences of clarification between the presentation & normal addresses would be useful, yes. -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message