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

2011-12-29 Thread Fernando Gont
On 12/29/2011 09:27 PM, Guy Harris wrote: >> While there exist functions such as pcap_geterr() to print an >> error-specific message, I'm rather interested in obtaining an error >> code such that my program can act differently depending on the >> specific return error. >> >> If that's possible? >

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

2011-12-29 Thread Guy Harris
On Dec 29, 2011, at 1:58 PM, Fernando Gont wrote: > I was trying to check for specific errors in libpcap I/O functions such > as pcap_next_ex() and pcap_inject(). > > However, the relevant manpages indicate that these functions return -1 > on error, and don't mention the setting of any "errno-li

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

2011-12-29 Thread Fernando Gont
Folks, I was trying to check for specific errors in libpcap I/O functions such as pcap_next_ex() and pcap_inject(). However, the relevant manpages indicate that these functions return -1 on error, and don't mention the setting of any "errno-like" variable that specifies the specific error that oc

[tcpdump-workers] Exception conditions on pcap descriptors?

2011-12-29 Thread Fernando Gont
Folks, I'm doing I/O multiplexing by obtaining the underlying file descriptor for the pcap_t "socket", with pcap_fileno(). I was wondering whether I should check for exceptions on such descriptor (in addition to readability and writeability), and whether such exceptions could possibly occur (and