path: root/capture-pcap-util-int.h
diff options
authorGuy Harris <guy@alum.mit.edu>2007-01-21 23:45:36 +0000
committerGuy Harris <guy@alum.mit.edu>2007-01-21 23:45:36 +0000
commitcc2274816903f4ef20b406e687dfa3d4de1ac488 (patch)
tree5512510787af52895ceb934713d75bf182fa3033 /capture-pcap-util-int.h
parent62c148c1d58c84791033da807db32c5a5752c4b8 (diff)
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
Diffstat (limited to 'capture-pcap-util-int.h')
1 files changed, 8 insertions, 1 deletions
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);
-extern GList *get_interface_list_findalldevs(int *err, char *err_str);
+extern GList *get_interface_list_findalldevs(int *err, char **err_str);
+ * 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__ */