On Thu, Aug 05, 2004 at 12:10:46PM +0100, David Cantrell wrote: > I'm trying to write a simple perl interface to P0fq, a tool which > examines network traffic to try to passively determine which OS hosts > are running. In the P0fq archive, there is a noddy C program to do > this, and my module lifts the guts straight out of that. > > Please note that C is *not* my forte, so I do no serious error checking in > the C code. I'm going to do all of that in perl before calling the C > function. I'm using C instead of pure perl because the interface I need > to speak to (a Unix socket) talks by passing C structs around, and so to > be portable (thinking of things like alignment) I can't just use pack > and unpack, as the alignment may vary from compiler to compiler and > platform to platform.
Have you considered Inline::Struct or C::Dynalib::Struct? -- Bring me my etherkiller; Oh clouds unfold! / Bring me the magic smoke of desire I shall not cease from mental fight / Nor shall my LART rest in my hand Till we have buried the bodies / Of all the lusers in all this land -- rpg, ASR [ My homepage is http://www.trout.me.uk/ ]