LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 07-22-2007, 02:25 AM   #1
ahm_irf
Member
 
Registered: Feb 2007
Posts: 37

Rep: Reputation: 15
need to extract payload from the tcp packet


Hi,

I am writing a module for tcptrace in Fedora Linux ...I want to extract payload from the tcp packet and later search few bytes in it...

I have extracted the tcpheader through follwing code..
struct tcphdr *ptcp = (struct tcphdr *) ((char *)pip + 4*IP_HL(pip));

Is there any function or anything which I can use to extract payload and also how I can search the bytes in the payload ..any linux function or any suggestions how I can do that...
 
Old 07-22-2007, 06:31 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Why not just use tcpdump and grep?
 
  


Reply



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 to read UDP packet payload ? sceadu Programming 2 02-07-2006 09:00 PM
problem in TCP packet live_dont_exist Programming 3 05-16-2005 06:00 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
tcp packet size dellcom1800 Linux - Networking 2 07-28-2004 07:49 AM
how to include my payload with packet that kernel sends to other pc cranium2004 Linux From Scratch 0 02-23-2004 02:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:53 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration