Re: Packing netgraph structs

2004-07-01 Thread Anil Madhavapeddy
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

Re: Packing netgraph structs

2004-07-01 Thread Julian Elischer
On Thu, 1 Jul 2004, Anil Madhavapeddy wrote: > On 1 Jul 2004, at 18:20, Julian Elischer wrote: > > > > are syscall arguments packed? I know that they are defined rather > > strangely.. > > On OpenBSD at least, they are wrapped in unions to pad them to register > sizes. > > > > > what messages

Re: Packing netgraph structs

2004-07-01 Thread Anil Madhavapeddy
On 1 Jul 2004, at 18:20, Julian Elischer wrote: are syscall arguments packed? I know that they are defined rather strangely.. On OpenBSD at least, they are wrapped in unions to pad them to register sizes. what messages are you having troubles with? Usually, in my experience, 'packed' structures a

Re: Packing netgraph structs

2004-07-01 Thread Julian Elischer
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 pac

Re: Packing netgraph structs

2004-07-01 Thread Harti Brandt
On Thu, 1 Jul 2004, Anil Madhavapeddy wrote: AM>On 1 Jul 2004, at 13:48, Roman Kurakin wrote: AM>> AM>> If this is a problem why can't you make some wrapper that will pack/unpack AM>> written on C, AM>> which will be a lib for you? AM> AM>Because I want to minimise the size of the foreign binding

Re: Packing netgraph structs

2004-07-01 Thread Anil Madhavapeddy
On 1 Jul 2004, at 15:10, Ruslan Ermilov wrote: We use Netgraph from within Python, using the netgraph(3) library, and we pack/unpack various Netgraph related structs just happily. Speaking of "struct ng_mesg", if you pack it, it will essentially stay the same, because I believe it was created with

Re: Packing netgraph structs

2004-07-01 Thread Roman Kurakin
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 Ne

Re: Packing netgraph structs

2004-07-01 Thread Ruslan Ermilov
On Thu, Jul 01, 2004 at 02:00:06PM +0100, 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 fore

Re: Packing netgraph structs

2004-07-01 Thread Anil Madhavapeddy
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 we

Re: Packing netgraph structs

2004-07-01 Thread Roman Kurakin
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). Th

Packing netgraph structs

2004-07-01 Thread Anil Madhavapeddy
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 d