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.
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.