I have the TCPdump file uploaded to this link so that you can see it.
TCPdump
Notice that the first line of the file is the size of the package in bytes!
The package comes thereafter.
So I guess we can't use rewind() since it goes to the beginning of the file,
right? Since the package begins at the second line of the file.
So I tried doing:
Code:
int k;
while (fgets(buffer, SIZE_BUFFER, file) != NULL) {
//if (fgets(buffer, SIZE_BUFFER, file))
//fgets(buffer, SIZE_BUFFER, file);
printf("%s\n", buffer);
k++;
}
But it is not
only printing the
sentences (strings).
It is also printing some data that I don't want it to
print. I tried your version and it did something
similar.