tcpdump mailing list archives

Re: libpcap error codes?


From: Guy Harris via tcpdump-workers <tcpdump-workers () lists tcpdump org>
Date: Wed, 7 Oct 2020 14:37:41 -0700

--- Begin Message --- From: Guy Harris <gharris () sonic net>
Date: Wed, 7 Oct 2020 14:37:41 -0700
On Oct 7, 2020, at 1:30 PM, Fernando Gont via tcpdump-workers <tcpdump-workers () lists tcpdump org> wrote:

WHile using pcap_inject() in Linux, it is failing with "pcap_inject(): send: Resource temporarily unavailable". In 
principle, one would expect that for temporary problems (such as this one), one may one to wait a bit and retry.  So 
it would make sense to 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?

There isn't, other than looking at errno.

A new API could be added that returns a PCAP_ERROR_ value rather than -1 on error (so as not to break source or binary 
compatibility with code using the existing APIs).

--- End Message ---
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Current thread: