Re: [tcpdump-workers] Initializing a device

2012-01-17 Thread Akos Vandra
Hi! What's your opinions on this? If you aggree, I would start doing some initial coding sometime in the next few days, and then we can continue the debate from there - unless I missed that it was dismissed. Regards, Ákos Vandra On 12 January 2012 11:43, Akos Vandra wrote: > On 12 January 201

Re: [tcpdump-workers] Initializing a device

2012-01-12 Thread Akos Vandra
On 12 January 2012 10:38, Guy Harris wrote: > > On Jan 12, 2012, at 1:06 AM, Akos Vandra wrote: > >> We could put a limit - say 32 or 64 chars - to the max length of the >> param, and then allocate in on the stack, but it would still require >> printf. > > Where would that be done?  It's a little

Re: [tcpdump-workers] Initializing a device

2012-01-12 Thread Guy Harris
On Jan 12, 2012, at 1:06 AM, Akos Vandra wrote: > We could put a limit - say 32 or 64 chars - to the max length of the > param, and then allocate in on the stack, but it would still require > printf. Where would that be done? It's a little more convenient than using routines such as asprintf()

Re: [tcpdump-workers] Initializing a device

2012-01-12 Thread Akos Vandra
We could put a limit - say 32 or 64 chars - to the max length of the param, and then allocate in on the stack, but it would still require printf. In this form, as we are going to have a single interface function to set and read the parameter, some serialization and deserialization of the data is ne

Re: [tcpdump-workers] Initializing a device

2012-01-11 Thread Guy Harris
On Jan 6, 2012, at 2:16 PM, Akos Vandra wrote: > On 6 January 2012 17:16, Jakub Zawadzki wrote: > >> Let's have just: >> int pcap_setparam(pcap_t *p, const char *param, const char *value) >> >> If param is not understand, or value is invalid for given param (like: not >> integer) >> it shoul

Re: [tcpdump-workers] Initializing a device

2012-01-06 Thread Guy Harris
On Jan 6, 2012, at 8:16 AM, Jakub Zawadzki wrote: > On Fri, Jan 06, 2012 at 04:47:09PM +0100, Akos Vandra wrote: >> Another reason why this is not a good approach: Let's get wireshark in >> the picture. Let's say the user selected a canusb device. The only way >> for wireshark to know what parame

Re: [tcpdump-workers] Initializing a device

2012-01-06 Thread Akos Vandra
On 6 January 2012 17:16, Jakub Zawadzki wrote: > On Fri, Jan 06, 2012 at 04:47:09PM +0100, Akos Vandra wrote: >> Another reason why this is not a good approach: Let's get wireshark in >> the picture. Let's say the user selected a canusb device. The only way >> for wireshark to know what parameters

Re: [tcpdump-workers] Initializing a device

2012-01-06 Thread Jakub Zawadzki
On Fri, Jan 06, 2012 at 04:47:09PM +0100, Akos Vandra wrote: > Another reason why this is not a good approach: Let's get wireshark in > the picture. Let's say the user selected a canusb device. The only way > for wireshark to know what parameters (ex. baudrate) the canusb device > needs is if wires

Re: [tcpdump-workers] Initializing a device

2012-01-06 Thread Akos Vandra
Hi! I have read through the threads you mentioned, it's nice to see that something similar has already been suggested, I would like to present a few new arguments in favor of them. On 6 January 2012 12:15, Guy Harris wrote: > > On Jan 5, 2012, at 1:40 AM, Akos Vandra wrote: > >> I browsed throug

Re: [tcpdump-workers] Initializing a device

2012-01-06 Thread Guy Harris
On Jan 5, 2012, at 1:40 AM, Akos Vandra wrote: > I browsed through the code of pcap_open_live, and pcap_set_promisc, > and related stuff, and I think that now I understand how this works. > > However in my opinion, the way parameter passing is implemented breaks > the principle of modularity. >

Re: [tcpdump-workers] Initializing a device

2012-01-05 Thread Akos Vandra
Hi! I browsed through the code of pcap_open_live, and pcap_set_promisc, and related stuff, and I think that now I understand how this works. However in my opinion, the way parameter passing is implemented breaks the principle of modularity. iface here = pcap_canusb, pcap_usbmon, etc. What is the

Re: [tcpdump-workers] Initializing a device

2012-01-04 Thread Guy Harris
On Jan 4, 2012, at 4:10 PM, Akos Vandra wrote: > When opening a capture device, is it possible to hand off some > initialization data to the libpcap handler? Yes. The ways to do that would either be to 1) have the device name include parameters such as that or 2) add new APIs

Re: [tcpdump-workers] Initializing a device

2012-01-04 Thread Sam Roberts
On Wed, Jan 4, 2012 at 4:10 PM, Akos Vandra 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 > o

[tcpdump-workers] Initializing a device

2012-01-04 Thread Akos Vandra
Hi! When opening a capture device, is it possible to hand off some initialization data to the libpcap handler? 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. Would it be possible to use the BPF