[tcpdump-workers] libpcap error codes?

2020-10-07 Thread Fernando Gont via tcpdump-workers
somehow be able to process the error code/condition, and act differently depending on the error type. Is there a way to get an error code (say, int value), as opposed to a text describing it? Thanks, -- Fernando Gont SI6 Networks e-mail: fg...@si6networks.com PGP Fingerprint: 31C6 D484 63B2

Re: [tcpdump-workers] select()ing on a pcap descriptor in Solaris

2014-08-18 Thread Fernando Gont
nning the BPF-based libpcap, but still the underlying descriptor is never readable or writeable... P.S.: I'm waiting for some feedback from a fellow solaris dev. I will keep you posted. Thanks! Best regards, -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6networks.com PGP Fingerprint: 78

Re: [tcpdump-workers] select()ing on a pcap descriptor in Solaris

2014-08-14 Thread Fernando Gont
Hi, Guy, On 08/14/2014 06:01 PM, Guy Harris wrote: > > On Aug 14, 2014, at 1:34 PM, Fernando Gont > wrote: > >> While trying to select() on a pcap descriptor in solaris > > Which version? Solaris 11 (in which pcap descriptors should refer to > BPF devices)

[tcpdump-workers] select()ing on a pcap descriptor in Solaris

2014-08-14 Thread Fernando Gont
st regards, -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1 ___ tcpdump-workers mailing list tcpdump-workers@lists.tcpdump.org https://lists.sandelman.ca/mailma

Re: [tcpdump-workers] pcap_inject() on loopback (FreeBSD)

2014-06-16 Thread Fernando Gont
nderstanding is that this should be filled in most (if not all) of the BSD variants? (because besides the error message one obtains, it seems that in several flavors of them, pcap_inject() fails for the same reason). Thanks! Best regards, -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6n

[tcpdump-workers] pcap_inject() on loopback (FreeBSD)

2014-06-15 Thread Fernando Gont
s? Thanks! Best regards, -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1 ___ tcpdump-workers mailing list tcpdump-workers@lists.tcpdump.org https://lists.sandelman.ca

[tcpdump-workers] pcap DLT_NULL encapsulation

2013-02-20 Thread Fernando Gont
inject() is called, it seems those bytes are being rewritten). Is this a known issue with gogoc? Am I missing something else? Thanks! Best regards, -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 9

Re: [tcpdump-workers] Portable way to "block" on pcap_next_ex()

2012-01-16 Thread Fernando Gont
urns, there's a packet to read, and it seems it never returns when there are no packets to read. FWIW, this is my test program: /* * Testing select() and pcap_next_ex() * * Please send any bug reports to Fernando Gont */ #include #include #include #include #include #include

Re: [tcpdump-workers] Portable way to "block" on pcap_next_ex()

2012-01-16 Thread Fernando Gont
elapsed since the reception > of the first packet, because "the first packet" means "the first > packet received after the getmsg() is done on the DLPI descriptor" - > i.e., it's not the first packet received ever, it's the first packet > receive

Re: [tcpdump-workers] Portable way to "block" on pcap_next_ex()

2012-01-15 Thread Fernando Gont
ch means that packets are *not* > buffered (i.e., each read() returns a single packet) and there's no > timeout. The bufmod equivalent would be to set the read timeout to > 0. There's currently no API in libpcap to request that, so turning > it on would currently have to be don

[tcpdump-workers] Portable way to "block" on pcap_next_ex()

2012-01-15 Thread Fernando Gont
rable). Any other way of doing the same without relying on select()? Thanks! Best regards, -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1 - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.

[tcpdump-workers] Fwd: Re: select()ing on the underlying descriptor of a pcap_t

2012-01-13 Thread Fernando Gont
On Tue, Jan 10, 2012 at 07:58:29PM -0800, Philip Guenther wrote: > On Tue, Jan 10, 2012 at 4:10 PM, Fernando Gont wrote: > ... > > However, in OpenBSD (and apparently NetBSD, too) the underlying > > descriptor for a pcap_t is never writeable. > > > > If anything

Re: [tcpdump-workers] pcap_t not writeable on OpenBSD

2012-01-11 Thread Fernando Gont
tricky (I still have to tackle that problem for another app). But in this case, I simply want to be able to tell whether my packet hit the wire or not (i.e., have pcap_inject() block or return an error if the packet was discarded before it hit the wire). Will run a test now, but: Is this the c

Re: [tcpdump-workers] pcap_t not writeable on OpenBSD

2012-01-10 Thread Fernando Gont
te", with > OpenBSD as an exception and DragonFly BSD as another possible > exception - poll() might be the same except that it might also fail > on Mac OS X, and kqueues will probably fail with an error on all > platforms if you try to create a EVFILT_WRITE kevent for a BPF

Re: [tcpdump-workers] pcap_t not writeable on OpenBSD

2012-01-10 Thread Fernando Gont
On 01/10/2012 05:13 PM, Sam Roberts wrote: > On Mon, Jan 9, 2012 at 8:49 PM, Fernando Gont wrote: >> I'm doing I/O multiplexing with the pcap descriptor, and it turns out >> that on OpenBSD the underlying descriptor for a pcap_t is never writeable. >> Note: No problems

[tcpdump-workers] pcap_t not writeable on OpenBSD

2012-01-10 Thread Fernando Gont
is to OpenBSD, instead? Please let me know if I can be of any help. Thanks! Best regards, -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1 - This is the tcpdump-workers list. Visit https://cod.sandelman.c

Re: [tcpdump-workers] Checking for specific return errors in libpcap

2011-12-30 Thread Fernando Gont
the aforementioned functionality (I'd be interested in doing the work if there's interest to eventually commit it). Thanks! Best regards, -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1 - Thi

Re: [tcpdump-workers] Checking for specific return errors in libpcap

2011-12-29 Thread Fernando Gont
tely, there should perhaps be different APIs, specified to > return PCAP_ERROR_ values on error, so that How about a function along the lines of pcap_geterrcode() that obtains the error code for the last error? That aside, where do pcap_geterr() and pcap_perror() look at to convert the error to a stri

[tcpdump-workers] Checking for specific return errors in libpcap I/O functions

2011-12-29 Thread Fernando Gont
/* interface isn't up */ they don't seem to be returned when the corresponding error condition occurs in pcap_next_ex() or other libpcap I/O functions. For instance, if I take an interface down with ifconfig, pcap_next_ex() returns -1, and not -9 (PCAP_ERROR_IFACE_NOT_UP). Thanks! Best

[tcpdump-workers] Exception conditions on pcap descriptors?

2011-12-29 Thread Fernando Gont
ibly occur (and if so, what the possible causes of such exceptions could be). Thanks! Best regards, -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1 - This is the tcpdump-workers list. Visit https://cod.s

Re: [tcpdump-workers] Stopping packet capture on a libpcap descriptor

2011-11-30 Thread Fernando Gont
ycase, I guess one could achive the same sort of result (albeit with a sloppy filter that rejects e.g., everything that's Ethernet when one is capturing on ethernet). Thanks! Best regards, -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1 - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.

[tcpdump-workers] Stopping packet capture on a libpcap descriptor

2011-11-27 Thread Fernando Gont
both Step 1 and step 2 above, but I don't want want libpcap to continue capturing packets while the program is in step 3. Any ideas? Thanks! -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1 - T

[tcpdump-workers] Calling pcap_compile() more than once on the same pcap_t *

2011-11-27 Thread Fernando Gont
f the calls to pcap_compile() I'm getting "snaplen of 0 rejects all packets"...) Thanks! Best regards, -- Fernando Gont e-mail: ferna...@gont.com.ar || fg...@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1 - This is the tcpdump-worke