tcpdump mailing list archives
Re: [PATCH] enable memory mapped access to ethernet
From: Alexander Dupuy <alex.dupuy () mac com>
Date: Wed, 12 Dec 2007 10:52:49 -0500
Gianluca Varenni wrote:
Having a function that returns success but then spits out a human only readable warning string in a parameter called "errbuf" and not "warnbuf" (also considering that there's an errbuf in the pcap_t structure that can be retrieved with pcap_geterror() or similar) is not that elegant IMHO.
I agree. And basically echo Guy's comments about how other functions that return errors work.
I'll note that if pcap_setbufsize returns an error (-1 return) the contents of errbuf are in fact an error message and not a warning message - it's only if there is a non-empty string in errbuf on success (0 return) that this is a "warning." And, this is the same string that you would get from a call to pcap_geterror, but it's more convenient to get the value directly than to make a second call.
Not the most elegant, I agree, but it's just what I did in our private version of libpcap.
@alex -- mailto:alex.dupuy () mac com - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- Re: [PATCH] enable memory mapped access to ethernet Alexander Dupuy (Dec 12)
- Re: [PATCH] enable memory mapped access to ethernet Gianluca Varenni (Dec 12)