Ethereal-dev: Re: [Ethereal-dev] Newbie : How to pass my self generated packets to ethereal

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Thu, 23 May 2002 03:55:32 -0700
On Thu, May 23, 2002 at 12:35:31PM +0530, Prasenjit Chakraborty wrote:
>     I just downloaded the ethereal source code.
> I have a packet capture application to which I want the ethereal to 
> connect so that dynamically I can see the type of the packets in the 
> network.

If your packet capture application can write packets in libpcap format
to a UNIX named pipe file, then all you need to do with the Ethereal
source code on a UNIX system is to compile it.  If you create a named
pipe file:

	mknod p /tmp/ethereal-pipe

and run your program and make it write to the "/tmp/ethereal-pipe" file,
and then start an Ethereal capture and specify that the "Interface" is
"/tmp/ethereal-pipe", Ethereal should read from that pipe, reading
packets as your program writes them to that pipe.

Unfortunately, this won't work on Windows, as far as I know, unless
Windows named pipes have pathnames *and* can be opened with the standard
Windows APIs for opening files (which are presumably the API's used by
"fopen()" and the like, that being what Ethereal uses to open the pipe).