From owner-freebsd-hackers Sat Jul 28 13:50:53 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id C2CFF37B405 for ; Sat, 28 Jul 2001 13:50:44 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (dialup-209.247.137.129.Dial1.SanJose1.Level3.net [209.247.137.129]) by albatross.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id NAA03045; Sat, 28 Jul 2001 13:50:25 -0700 (PDT) Message-ID: <3B6325B7.D6CBC67A@mindspring.com> Date: Sat, 28 Jul 2001 13:51:03 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Anjali Kulkarni Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: inet_aton References: <002d01c11728$d34723b0$0a00a8c0@indranet> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Anjali Kulkarni wrote: > > Hi, > > I want to use the function inet_aton() in the kernel code. > However, I found no kernel equivalent of this function int > the freebsd sources. I could find inet_ntoa(), but not > inet_aton(). Is it named by some other name or how can I > locate it? The kernel is not linked against the resolver library, which is where the network address manipulation functions come from (in FreeBSD, the resolver library has been rolled into libc; this is traditional, but makes it very hard to upgrade to newer versions when needed. In FreeBSD, the kernel isn't linked against the C library, either). You should pass in sockaddr structures, not strings, to the kernel, if you wish to pass network addresses to the kernel. As a general policy issue, I think that passing strings into the kernel for any reason is a bad idea. We tolerate it where we must (path name lookups), but any place else that takes a string is bad news (e.g. we will eventually get around to fixing mount at some point in the future). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message