A
adarsh.hrbr
Hi all,
I have written a socket program whose Client is in Perl and the
Server is in C. To some extent I was successful in obtaining the data
and printing the same. But my server (UDP ) has some structures . The
data pertaining to these structures are to be communicated from the
Perl client. I thought using hash in Perl could be to solution, but
what I am sceptical about is; will I be able to typecast the same in c
to obtain the data?
Below is a structure in c which I want to type cast. Can somebody
suggest a method to define this in Perl so that I can typecaste the
same in my Server to obtain the data.
typedef struct {
uint8 Reserved;
uint32 ipaddr;
uint32 netmask;
uint16 command;
} sample;
uint - unsigned int type - 8,16 and 32 bytes - in length
I have written a socket program whose Client is in Perl and the
Server is in C. To some extent I was successful in obtaining the data
and printing the same. But my server (UDP ) has some structures . The
data pertaining to these structures are to be communicated from the
Perl client. I thought using hash in Perl could be to solution, but
what I am sceptical about is; will I be able to typecast the same in c
to obtain the data?
Below is a structure in c which I want to type cast. Can somebody
suggest a method to define this in Perl so that I can typecaste the
same in my Server to obtain the data.
typedef struct {
uint8 Reserved;
uint32 ipaddr;
uint32 netmask;
uint16 command;
} sample;
uint - unsigned int type - 8,16 and 32 bytes - in length