From owner-freebsd-hackers Tue Jul 31 1:41:35 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ip.eth.net (mail.ip.eth.net [202.9.128.18]) by hub.freebsd.org (Postfix) with ESMTP id 5579037B401 for ; Tue, 31 Jul 2001 01:41:27 -0700 (PDT) (envelope-from anjali@indranetworks.com) Received: (apparently) from anjali ([61.11.16.239]) by ip.eth.net with Microsoft SMTPSVC(5.5.1877.467.46); Tue, 31 Jul 2001 14:11:23 +0530 Message-ID: <008701c1199c$98684f50$0a00a8c0@indranet> From: "Anjali Kulkarni" To: Cc: References: <002d01c11728$d34723b0$0a00a8c0@indranet> <3B6325B7.D6CBC67A@mindspring.com> Subject: Re: inet_aton Date: Tue, 31 Jul 2001 14:11:27 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 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 Hi Terry, Thanks for your response. I am new to kernel programming, and so cud u tell me why it is a bad idea to pass strings to the kernel? Is it due to static memory is used etc.? Actually, I am not passing strings to the kernel, I am writing code in kernel which has a remote server's ip-address string, and I need to connect to the remote server, so I need to use inet_aton..... Anjali ----- Original Message ----- From: Terry Lambert To: Anjali Kulkarni Cc: Sent: Sunday, July 29, 2001 2:21 AM Subject: Re: inet_aton > > 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