LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-11-2007, 02:22 AM   #1
raklo
Member
 
Registered: Apr 2006
Posts: 143

Rep: Reputation: 15
wanna write c code for packet capture??wotz the approach


hello all,
i wanna write a small c code,which captures the incoming packet and prints the protocol,i.e TCP/UDP.

i dont want to use pcap and libpcap libraries,
is there any alternate approach to it???

regards
rakesh
 
Old 06-11-2007, 03:11 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
why would you not want to use libpcap? that's exactly what they're for, and if you don't use them, you're just going to have to replicate what they already do.
 
Old 06-11-2007, 04:21 AM   #3
raklo
Member
 
Registered: Apr 2006
Posts: 143

Original Poster
Rep: Reputation: 15
actually this is an exercise that im supposed to do,and the main restriction
is that i have to retrieve the protocol info of each incoming pcket dynamically
without using libpcap.

so i just wanna know if there is an approach??
i jst saw somwhere that this can be done using recvfrom()
is that approach proper??will it lead to somewhhere?
regards and thanx
rakesh
 
  


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
LXer: MySQL and Google approach code deal LXer Syndicated Linux News 0 04-30-2007 07:01 PM
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
packet fragmentation in packet forwarding code cranium2004 Linux - Networking 0 05-16-2005 04:05 AM
ICMP Packet capture SaTaN Programming 1 01-19-2004 11:38 PM
Network packet capture avaya Linux - Newbie 2 10-14-2002 09:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:02 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