....
finalize(char *hdrs, sendip_data *headers[], int index,
sendip_data *data, sendip_data *pack)
{
........
For debugging purposes I want a hex dump of the data and pack structures, which are of type sendip_data, a really complex structure. Actually they contain some binary information so I am not sure whether output of my project is correct or not. So for debugging purposes, I want to write the data into a file so that I can use hexdump as follows –
$hexdump -C file.txt
Also as this is a run time generation of a n/w packet so I am also not sure about the length of data and pack structure which I think fread / fwrite will require ..So please suggest me something.
The following code will give you a hex dump of arbitrary memory from within your code.
You pass into
hexDumpa description, memory address, length, and how many bytes you want on each line.It will output a hex dump (including character data) for examination. When you run it with the included
main, the output is: