LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-05-2004, 01:28 AM   #1
sceadu
Member
 
Registered: Jan 2003
Posts: 76

Rep: Reputation: 15
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.
 
Old 11-06-2004, 02:50 PM   #2
krupa
LQ Newbie
 
Registered: Sep 2003
Posts: 6

Rep: Reputation: 0
I don't know sk_buff, but what's wrong with a for loop with a print statement?
 
Old 02-07-2006, 09:00 PM   #3
hedpe
Member
 
Registered: Jan 2005
Location: Pittsburgh
Distribution: Ubuntu
Posts: 378

Rep: Reputation: 30
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i read the data in the packet that i have captured after packet capture? gajaykrishnan Programming 23 04-19-2006 05:09 AM
How to use skbuff to scan every byte of the payload of an UDP packet? sceadu Programming 0 11-03-2004 09:34 PM
UDP packet oss dazdaz Linux - Networking 2 04-05-2004 01:30 PM
how to include my payload with packet that kernel sends to other pc cranium2004 Linux From Scratch 0 02-23-2004 02:11 AM
UDP: short packet markus1982 Linux - Security 4 08-12-2003 08:03 AM


All times are GMT -5. The time now is 05:09 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration