tcpdump mailing list archives

Re: [PATCH] enable memory mapped access to ethernet


From: "Gianluca Varenni" <gianluca.varenni () cacetech com>
Date: Tue, 11 Dec 2007 10:43:04 -0800


----- Original Message ----- From: "Guy Harris" <guy () alum mit edu>
To: <tcpdump-workers () lists tcpdump org>
Sent: Monday, December 10, 2007 1:29 PM
Subject: Re: [tcpdump-workers] [PATCH] enable memory mapped access to ethernet


Gianluca Varenni wrote:

why not using a different return value instead of a string message which is human readable but not easily computer readable?

Probably because that's the way that other pcap APIs work. That doesn't mean it's the *right* way to work, it just means it fits in with the way the rest of the library works.

I don't want to start a flame here, but we already have pcap APIs that return a set of different values, pcap_next_ex() (which can return 1, 0, -1, -2).
In any case, at least I wouldn't call it errbuf. It's *not* an error.

Have a nice day
GV



A "next-generation" pcap API should probably work differently, as

1) that allows the application to choose how to react to the error (the reaction might be more than just "put up a dialog box");

2) that allows internationalization of the error.

(That's why Wireshark's library for reading capture files works that way, although, for some errors, it also provides an additional text string - but that's primarily for the benefit of developers, to give details about the error to help them diagnose the problem, not for the benefit of users, for whom the additional information is probably meaningless.)
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: