Given the below declaration for pcap callback:
void my_callback(u_char *args, const struct pcap_pkthdr *header, const u_char *packet)
How to ascertain the total number of bytes present in the packet? I need that value so that I can pass it to crc32() function.
according to this reference the information about the size of the packet is in the
The information is in the
Given your callback, the full packet size is given by
and the captured packet size (which might be smaller if you've set a snaplen that happens to be smaller than actual packet size) is given by