From owner-freebsd-hackers Sat Jul 28 17:12:10 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id 24B0537B403; Sat, 28 Jul 2001 17:12:07 -0700 (PDT) (envelope-from julian@elischer.org) Received: from elischer.org (InterJet.elischer.org [192.168.1.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id TAA21605; Sat, 28 Jul 2001 19:03:45 -0700 (PDT) Message-ID: <3B63502A.29275980@elischer.org> Date: Sat, 28 Jul 2001 16:52:10 -0700 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: Mike Smith Cc: Anjali Kulkarni , freebsd-hackers@freebsd.org Subject: Re: inet_aton References: <200107282022.f6SKMhJ01990@mass.dis.org> Content-Type: text/plain; charset=iso-8859-2 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 Mike Smith wrote: > > > 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? > > If you are trying to parse an ascii internet address in the kernel, > you're quite possibly making a bad design mistake - why is it still in > text format? If you're passing it in from another program, you should be > passing a sockaddr struct. > > Failing that, you'll just have to steal the code from libc and bring it > in yourself. netgraph has a full ascii command parser built into it to allow arbitrary decoding of command messages to as-yet unbuilt modules. New modules supply a grammar to parser for commands they want to accept. It's proved invaluable. it's possible to load a new module, and immediatly control it from the command line using the ngctl program, even though the ngctl program knows nothing about the module. It also knows about several special types including IP addresses and MAC addresses. > > -- > ... every activity meets with opposition, everyone who acts has his > rivals and unfortunately opponents also. But not because people want > to be opponents, rather because the tasks and relationships force > people to take different points of view. [Dr. Fritz Todt] > V I C T O R Y N O T V E N G E A N C E > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- +------------------------------------+ ______ _ __ | __--_|\ Julian Elischer | \ U \/ / hard at work in | / \ julian@elischer.org +------>x USA \ a very strange | ( OZ ) \___ ___ | country ! +- X_.---._/ presently in San Francisco \_/ \\ v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message