tcpdump mailing list archives

Re: Initializing a device


From: Sam Roberts <vieuxtech () gmail com>
Date: Wed, 4 Jan 2012 16:21:40 -0800

On Wed, Jan 4, 2012 at 4:10 PM, Akos Vandra <axos88 () gmail com> wrote:
When opening a capture device, is it possible to hand off some
initialization data to the libpcap handler?

I'm not a developer of libpcap/tcpdump, but I don't think so.

For example, I have just added a handler for a canusb device. When
opening the device, it would be nice if it was possible to set the
baud rate, etc.

Isn't this the kind of thing that would be set up before hand? Kindof
like you don't setup an ethernet device with libpcap, you set it up
with ifconfig or whatever, and then use it with libpcap.

baud rate makes it sound like it should respond to the termios system
calls, or be configurable with stty, and a user would make setting
permanent use rc scripts, or a udev rule. Or if they need to use some
tool specific to your can device, then you'd provide that tool.

Would it be possible to use the BPF filter for this?

I doubt it. Filters are a mini assembly language run on packets to see
if they should be selected for capture. The tcpdump command line
filter expression is compiled into the assembly language.

Cheers,
Sam
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: