LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-27-2006, 07:14 AM   #1
escorp
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Rep: Reputation: 0
dropping and forwarding packets using libpcap


hiya..

I wrote a program in C using lipcap library, and I connected MySQL server to log all the captured packets traffic, I am running Fedora3.

But I need to DROP the packets or forwarding them, Can I do that with libpcap ? if not, how can I do it ?

note: I need a function that I can embedded in my program.

thanks for the help
 
Old 03-27-2006, 11:38 AM   #2
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
Hi,
basically, when people want to resend packets sniffed with the libpcap, they use libnet.
this lib enable you to send raw packets over the network (you build the whole packet from scratch) or, as an example, to give the DNS parameters of a DNS packet and ask libnet to build the DNS reply, the UDP trame, the IP packet and the Ethernet one.
In your case, your program would decide what to do with the packets depending on the info read from libpcap and use libnet functions to forward them.
Please also note that you can use iptables rules to do all that... chances are that the netfilter developpers have a much better implementation of all that than you'll have... (sorry, you may be a C guru as well ;o) )

Hope this helps!
 
Old 04-08-2006, 08:18 PM   #3
escorp
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks ALOT ALOT ALOT
 
  


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
Can't sniff packets using libpcap masterm Linux - Networking 0 05-17-2005 05:58 PM
how can i use libpcap to capture packets for the local loopback interface (lo) ? gajaykrishnan Programming 0 02-22-2005 04:03 AM
Dropping Network Packets Micah Linux - Networking 4 03-14-2004 09:39 PM
Packets dropping with LAN network valo Linux - Hardware 3 02-18-2004 06:19 PM
dropping packets ? jb_li Programming 7 04-14-2003 11:18 AM


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

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