From owner-freebsd-net@FreeBSD.ORG Thu Jul 1 14:22:17 2004 Return-Path: Delivered-To: freebsd-net@www.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A78C616A4CE for ; Thu, 1 Jul 2004 14:22:17 +0000 (GMT) Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E05843D2F for ; Thu, 1 Jul 2004 14:22:17 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 6DC9C5543F for ; Thu, 1 Jul 2004 14:21:12 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C67B16A4CE for ; Thu, 1 Jul 2004 14:21:12 +0000 (GMT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1E8443D2D for ; Thu, 1 Jul 2004 14:21:11 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i61EHJaJ027994 for freebsd-net@lists.freebsd.org.checked; (8.12.8/vak/2.1) Thu, 1 Jul 2004 18:17:19 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru with ESMTP id i61EFNDf027915; (8.12.8/vak/2.1) Thu, 1 Jul 2004 18:15:23 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <40E41C5D.6030906@cronyx.ru> Date: Thu, 01 Jul 2004 18:14:53 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Anil Madhavapeddy References: <122AE07F-CB5B-11D8-99F8-000A95DA50A6@recoil.org> <40E40839.20500@cronyx.ru> <931572E3-CB5E-11D8-99F8-000A95DA50A6@recoil.org> In-Reply-To: <931572E3-CB5E-11D8-99F8-000A95DA50A6@recoil.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@lists.freebsd.org Subject: Re: Packing netgraph structs X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jul 2004 14:22:17 -0000 Anil Madhavapeddy wrote: > On 1 Jul 2004, at 13:48, Roman Kurakin wrote: > >> If this is a problem why can't you make some wrapper that will >> pack/unpack written on C, >> which will be a lib for you? > > > Because I want to minimise the size of the foreign bindings - this > would require C code for every single Netgraph struct. If they were > packed, I could just do it all in OCaml. Packing lead to perfomance issues. So it is used only in case of packet specifications were each bit may have its own meaning and there place is fixed by protocol which is lang/arch/etc independant and we cant just add a couple of them. > Isn't this a problem for other language bindings as well, or is > everyone doing Netgraph userland hacking in C at the moment? For Unix programming I do not use other languages than C, except for scripting. And I believe I am not in minority. IMHO perfomace issue is more important than cross language interaction which is in minority. rik > > -- > Anil Madhavapeddy > http://anil.recoil.org > University of Cambridge > http://www.cl.cam.ac.uk > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > >