From cc2274816903f4ef20b406e687dfa3d4de1ac488 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 21 Jan 2007 23:45:36 +0000 Subject: Have the routines to get interface lists take a pointer to a "gchar *" as an argument, and, on an error, if they have an error message, have them set that "gchar *" to point to a g_malloc()ed string containing the error message, rather than taking a pointer to a buffer for that message as an argument. That's more like what's done in Wiretap, and doesn't impose an upper limit on the lengths of those error messages. If that pointer is null, don't allocate the message string and return it. Have that error message already have the "cant_get" processing applied to it, so nobody other than those routines need to call the "cant_get" routines to process the error messages. Have get_airpcap_interface_list() explicitly set "*err" to the appropriate error code. Clean up indentation. svn path=/trunk/; revision=20521 --- capture-pcap-util-int.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'capture-pcap-util-int.h') diff --git a/capture-pcap-util-int.h b/capture-pcap-util-int.h index 5eb98d9690..3ab330aedd 100644 --- a/capture-pcap-util-int.h +++ b/capture-pcap-util-int.h @@ -30,9 +30,16 @@ extern if_info_t *if_info_new(char *name, char *description); extern void if_info_add_address(if_info_t *if_info, struct sockaddr *addr); #ifdef HAVE_PCAP_FINDALLDEVS -extern GList *get_interface_list_findalldevs(int *err, char *err_str); +extern GList *get_interface_list_findalldevs(int *err, char **err_str); #endif +/* + * Get an error message string for a CANT_GET_INTERFACE_LIST error from + * "get_interface_list()". This is used to let the error message string + * be platform-dependent. + */ +extern gchar *cant_get_if_list_error_message(const char *err_str); + #endif /* HAVE_LIBPCAP */ #endif /* __PCAP_UTIL_INT_H__ */ -- cgit v1.2.3