Hi
I have a C data structure being outputted to a Unix socket that I need
to convert into a form Perl can use. I am using IO::Socket to connect
to the socket and I can receive the data fine.
I am using the Perl unpack function to convert the data. I've read the
documentation and all the examples and now I just need some help
mapping data types between C and Perl. My C data structure looks like:
u_int8_t alert
u_int32_t var1
u_int32_t var2
u_int32_t var3
u_int32_t var4
u_int8_t var5
u_int32_t var6
bpf_u_int32 var7
bpf_u_int32 var8
My template looks like:
$template = "C L4 C L ? ?"
Unfortunately the data unpacked does not match the expected data. Have
I got the right data type conversations taking place?
BTW ignore the ?'s they indicate the bpf_u_int32 data type as I don't
know what Perl data type to put here. I have been excluding these for
now. Anyone know what data type to use?
Can anyone provide any hints about how I should do this?
Thanks in advance
James Turnbull
--
James Turnbull <[EMAIL PROTECTED]>
---
Author of Hardening Linux from Apress
(http://www.amazon.com/exec/obidos/tg/detail/-/1590594444/)
---
PGP Key (http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x0C42DF40)
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>