From owner-freebsd-net@FreeBSD.ORG Thu Jul 1 17:22:08 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 ABC1E16A4CE for ; Thu, 1 Jul 2004 17:22:08 +0000 (GMT) Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by mx1.FreeBSD.org (Postfix) with ESMTP id A374843D3F for ; Thu, 1 Jul 2004 17:22:08 +0000 (GMT) (envelope-from julian@elischer.org) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id E6F185547E for ; Thu, 1 Jul 2004 17:21:30 +0000 (GMT) (envelope-from julian@elischer.org) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E4A2416A4CE for ; Thu, 1 Jul 2004 17:21:30 +0000 (GMT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80A6843D5C for ; Thu, 1 Jul 2004 17:21:30 +0000 (GMT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc13) with ESMTP id <20040701172056015007f9kee>; Thu, 1 Jul 2004 17:20:57 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id KAA91618; Thu, 1 Jul 2004 10:20:55 -0700 (PDT) Date: Thu, 1 Jul 2004 10:20:53 -0700 (PDT) From: Julian Elischer To: Anil Madhavapeddy In-Reply-To: <122AE07F-CB5B-11D8-99F8-000A95DA50A6@recoil.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 17:22:08 -0000 On Thu, 1 Jul 2004, Anil Madhavapeddy wrote: > I'm creating Netgraph bindings for OCaml in order to play around more > easily with various Bluetooth and Ethernet things I'm working on. It's > all pretty straightforward except for the problem that the netgraph > message structs aren't all packed (e.g. struct ng_mesg). This means > that it's very difficult to serialise them in a language other than C. > > Is there any reason why these aren't packed? If not, I can submit a > diff to make them so. This is a very interesting question. are syscall arguments packed? I know that they are defined rather strangely.. what messages are you having troubles with? Usually, in my experience, 'packed' structures are limitted to structures that are defined in hardware, and message structures ae defined unpacked so that they can be efficiently passed around within a single system. Can you give me better examples.. I'm also a little worried about architectures that have certain allignment restrictions on data, which is why packed and unpacked structures are different in the first place. > > thanks, > > -- > 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" >