How to read UDP packet payload ?
Hi,
I meddling with sk_buff and I want to write a code to read the contents of a UDP packet. I know that sk_buff->data gives the data head pointer. How can I make use of this to read the contents? Please advise. :study: |
I don't know sk_buff, but what's wrong with a for loop with a print statement?
|
you will want to do something like:
for(i = 0; i < sk_buff->data_length; i++) printf("%c", sk_buff->data[i]); but sk_buff->data_length is probably not the exact variable name, you have to look for the data length in the header, i'm not sure its explicit though, data length might be packet size - header size |
All times are GMT -5. The time now is 03:32 PM. |