From owner-freebsd-net@FreeBSD.ORG Thu Jul 1 20:12:22 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 5C69416A4CE for ; Thu, 1 Jul 2004 20:12:22 +0000 (GMT) Received: from quick.recoil.org (quick.recoil.org [194.70.3.133]) by mx1.FreeBSD.org (Postfix) with SMTP id 80DDB43D2F for ; Thu, 1 Jul 2004 20:12:21 +0000 (GMT) (envelope-from anil@recoil.org) Received: (qmail 5395 invoked from network); 1 Jul 2004 20:11:51 -0000 Received: from localhost (HELO ?IPv6:::1?) (127.0.0.1) by quick.recoil.org with SMTP; 1 Jul 2004 20:11:51 -0000 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Anil Madhavapeddy Date: Thu, 1 Jul 2004 21:12:00 +0100 To: Julian Elischer X-Mailer: Apple Mail (2.618) 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 20:12:22 -0000 On 1 Jul 2004, at 20:47, Julian Elischer wrote: > > I think that nearly all languages these day shave to take into account > "what C does" and they need to have packing etc taken explicitly into > account when they do syscalls etc. so I don't think that you will have > too many problems and there should be some facility available to you to > do the right packing if it's needed. > > The C packing is done to maximise the efficiency of the structure given > that particular platform. I don't think that packing it would be useful > as the messages are never supposed to leave the machine, and if we pack > netgraph messages, then where do we stop? Should we pack all ioctl > structures too? > > (sorry to make life more difficult for you but...) No problem, I just wanted to make sure I wasn't missing something - I'm just writing a small program to create C structs and ML definitions at the moment, shouldn't be too bad. > > julian > > BTW what IS OCaml? I've seen it mentionned a few times now.. A modern functional language - statically typed, generates pretty tight native code on a number of architectures. Extremely nice for speedy networking code without the hassle of memory leaks and overflows, or the portability and speed issues of Java. -anil