libpcap packet size

Posted by silverbandit91 on Stack Overflow See other posts from Stack Overflow or by silverbandit91
Published on 2010-04-07T17:29:12Z Indexed on 2010/04/07 17:33 UTC
Read the original article Hit count: 456

Filed under:
|
|
|

I'm working with libpcap in C on linux (centos) and I'm following this guide I want to simply print out the entire packet in ascii and i'v managed to get it working by casting it a u_char* in the "my_callback" function. But I can't figure out how to get the length of the data. strstr didn't work. the header has a len member that you can access to get the size but I can't find anything similar for the *packet being passed. Any help is appreciated.

© Stack Overflow or respective owner

Related posts about c

    Related posts about libpcap