tcpdump mailing list archives
Re: libpcap linux direction
From: "David H. Lynch Jr." <dhlii () dlasys net>
Date: Sat, 28 Mar 2009 06:46:29 -0400
Thanks; How does one use pcap to transmit to both the net and the local host ? This seems to work with winpcap in colinux. Aaron Turner wrote:
On Thu, Mar 26, 2009 at 7:35 AM, David H. Lynch Jr. <dhlii () dlasys net> wrote:I am using libpcap under linux as a pseudo NIC for an embeded system emulator. I have no difficulty trapping a linux interface and sending and receiving packets to the outside net. However, I am unable to send/receive packets to the IP of the interface I am trapping. I have tried adding a pcap_setdirection(pd, PCAP_D_INOUT) which succeeds but changes nothing.Correct. You can't send traffic out an interface and expect it to be delivered to the same host. It doesn't work that way. pcap_setdirection() is for limiting what packets are *read* by libpcap and has nothing with packet injection.
-- Dave Lynch DLA Systems Software Development: Embedded Linux 717.627.3770 dhlii () dlasys net http://www.dlasys.net fax: 1.253.369.9244 Cell: 1.717.587.7774 Over 25 years' experience in platforms, languages, and technologies too numerous to list. "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction." Albert Einstein - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- libpcap linux direction David H. Lynch Jr. (Mar 26)
- Re: libpcap linux direction Aaron Turner (Mar 27)
- Re: libpcap linux direction David H. Lynch Jr. (Mar 28)
- Re: libpcap linux direction Aaron Turner (Mar 30)
- Re: libpcap linux direction David H. Lynch Jr. (Mar 28)
- Re: libpcap linux direction Aaron Turner (Mar 27)