On Wednesday, September 3, 2003, at 12:58 PM, Lanfranco Salinari wrote:
Thank you very much for your interest, Greg.
I understand that this code can run only on Linux, but I think that
the dependency is due only to the network functions.
It's due to the current lack of a "send packet" routine in libpcap.
Eventually, I plan to add one (the biggest problem at this point is
that there should be a new routine for opening a capture device to
specify whether to open it read-only or read/write - on some OSes, you
could use standard UNIX permission mechanisms to let some users capture
but not send, and other users capture and send, and I'd prefer to let
that work; WinPcap has such an API, which is also used for opening
remote capture devices, and that will probably end up in libpcap at
some point.)
What Ethereal should do is:
use that API if and when it becomes available;
otherwise:
if libnet is available:
http://www.packetfactory.net/projects/libnet/
use its routines to send packets;
if you're using WinPcap, use its "pcap_sendpacket()" routine:
http://winpcap.polito.it/docs/man/html/group__wpcap__fn.html#a34
(that will probably become one of the APIs offered by libpcap);
if you're running on a sufficiently recent version of OpenBSD, use
its "pcap_inject()" routine:
http://www.freebsd.org/cgi/man.cgi?
query=pcap&apropos=0&sektion=0&manpath=OpenBSD+3.3&format=html
(that will probably become one of the other APIs offered by libpcap -
it'll offer both, but probably choose one as the "recommended" one);
otherwise, do the sending work itself, perhaps.