tcpdump mailing list archives

Re: libpcap & poll()


From: "Aaron Turner" <synfinatic () gmail com>
Date: Thu, 13 Nov 2008 21:25:56 -0800

On Thu, Nov 13, 2008 at 8:15 PM, Ben Greear <greearb () candelatech com> wrote:
I guess you have some way of knowing you are reading a packet you just wrote
so that you don't do this in a loop?

Yep.  Basically it's a software bridge (two interfaces, copying all
packets from one interface to the other) I track the source MAC
address so I know which direction a packet should go.

I do know that if you use a PF_PACKET socket, if you write to it you do not
read that packet back on the PF socket.  I'm not sure about using pcap to
read/write on Linux,
however.

Interesting... Right now I'm using different handles for read & write
so I see packets I send.  Obviously  not ideal, but if I could use the
same handle for read & write that would help out a lot.

-- 
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety.  -- Benjamin Franklin
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: