LinuxQuestions.org
Visit Jeremy's Blog.
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 08-30-2010, 11:50 PM   #1
ehsanen77
LQ Newbie
 
Registered: Aug 2010
Posts: 18

Rep: Reputation: 0
TCP/IP packet classification in C


hi, i need to write a program in c that can sniff packets from Ethernet and distinguish RTP packets from Non-RTP packets, i have no idea what should i do, plz help
 
Old 08-31-2010, 12:23 AM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by ehsanen77 View Post
hi, i need to write a program in c that can sniff packets from Ethernet and distinguish RTP packets from Non-RTP packets, i have no idea what should i do, plz help
http://www.wireshark.org/ -> pcap library: http://www.tcpdump.org/ .
 
Old 08-31-2010, 01:33 AM   #3
ehsanen77
LQ Newbie
 
Registered: Aug 2010
Posts: 18

Original Poster
Rep: Reputation: 0
RE: Wireshark

These are just packet sniffing tools, i need sth that can do some action on the packets as i said i want to write a C program to do it not using these kind of softwares
 
Old 08-31-2010, 02:50 AM   #4
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by ehsanen77 View Post
These are just packet sniffing tools, i need sth that can do some action on the packets as i said i want to write a C program to do it not using these kind of softwares
'wireshark' does distinguish the packets - as you said you wanted.
 
Old 08-31-2010, 03:39 AM   #5
ehsanen77
LQ Newbie
 
Registered: Aug 2010
Posts: 18

Original Poster
Rep: Reputation: 0
RE: help

I need the answer, it's so important for me. No body knows the asnwer really? It is not normal
 
Old 08-31-2010, 04:53 AM   #6
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
As Sergei already said: "pcap"!

Quote:
I need the answer, it's so important for me.
it's not important for us...

Quote:
It is not normal
? it sounds rude ?

This is a help forum, if it doesn't fit your needs:
-search and do it yourself (and in your case i'm sure you can find some solution in less than a hour of google'ing).
-pay somebody to do the job for you.
 
Old 08-31-2010, 11:57 AM   #7
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by ehsanen77 View Post
I need the answer, it's so important for me. No body knows the asnwer really? It is not normal
Start working. I gave you pointers to source code, so start studying it.
 
Old 08-31-2010, 12:29 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
man pcap
--- rod.
 
Old 08-31-2010, 03:23 PM   #9
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You can use pcap to sniff Ethernet packet. Then, in the processing, you may apply a filter and get RTP packets. Or you may analyze every packet on your own.
 
Old 09-02-2010, 01:26 PM   #10
mrlinux11
LQ Newbie
 
Registered: Aug 2007
Posts: 12

Rep: Reputation: 0
Sounds like a college student who needs help with his homework Well actually someone to do it for him
 
Old 06-29-2012, 11:37 AM   #11
tacorama
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 39

Rep: Reputation: 16
use this tool

use netfilter tools, ie iptables or ebtables
 
  


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 tell if a packet is reaching TCP? AustinMarton Linux - Kernel 8 05-12-2009 07:22 PM
LXer: Email Classification (Incl. Spam Classification) With POPFile On Ubuntu Feisty Fawn LXer Syndicated Linux News 0 08-02-2007 04:46 PM
TCP Packet Size ajkannan83 General 3 11-03-2005 06:46 AM
problem in TCP packet live_dont_exist Programming 3 05-16-2005 06:00 AM
tcp packet size dellcom1800 Linux - Networking 2 07-28-2004 07:49 AM

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

All times are GMT -5. The time now is 07:05 PM.

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