From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 13 08:49:45 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC19A106566B for ; Tue, 13 Jul 2010 08:49:45 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 765D98FC27 for ; Tue, 13 Jul 2010 08:49:45 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id D8A192A28CD7; Tue, 13 Jul 2010 10:49:44 +0200 (CEST) Date: Tue, 13 Jul 2010 10:49:44 +0200 From: Ed Schouten To: Bartosz Marcin Kojak Message-ID: <20100713084944.GV1742@hoeg.nl> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Tln/wzp9jsNjmSUr" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org Subject: Re: inet_* functions in kernel? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2010 08:49:45 -0000 --Tln/wzp9jsNjmSUr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Bartosz, * Bartosz Marcin Kojak wrote: > I want to be able to write rules for module through sysctl (rule > will contain IP addresses in human-readable format, e.g. > "uid:1002:192.168.2.3") and I'm wondering how to translate addresses > to network byte order without inet_* functions. Wouldn't it be possible to do the conversion in userspace and write something like a struct sockaddr_storage/in_addr_t/etc to the kernel? That way you can avoid the string handling in kernel space entirely. --=20 Ed Schouten WWW: http://80386.nl/ --Tln/wzp9jsNjmSUr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iEYEARECAAYFAkw8KKgACgkQ52SDGA2eCwVThwCeIC9mztFeRHj08V2F1va/R8n8 Fr4An1Y1JMKHsdlTs7C3W1B4KMW6Ftyz =wn6b -----END PGP SIGNATURE----- --Tln/wzp9jsNjmSUr--