path: root/capture-pcap-util.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.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.h')
1 files changed, 2 insertions, 15 deletions
diff --git a/capture-pcap-util.h b/capture-pcap-util.h
index 96873ed1d8..5f824135d7 100644
--- a/capture-pcap-util.h
+++ b/capture-pcap-util.h
@@ -35,10 +35,6 @@ extern "C" {
#include <pcap.h>
-/* declaration of pcap_t here, to reduce pcap dependencies */
-/*typedef struct pcap pcap_t;*/
* XXX - this is also the traditional default snapshot size in
* tcpdump - but, if IPv6 is enabled, it defaults to 96, to get an
@@ -49,9 +45,6 @@ extern "C" {
#define MIN_PACKET_SIZE 68 /* minimum amount of packet data we can read */
-/* XXX - this must be optimized, removing the dependency!!! */
* The list of interfaces returned by "get_interface_list()" is
* a list of these structures.
@@ -74,7 +67,7 @@ typedef struct {
} ip_addr;
} if_addr_t;
-GList *get_interface_list(int *err, char *err_str);
+GList *get_interface_list(int *err, char **err_str);
/* Error values from "get_interface_list()". */
#define CANT_GET_INTERFACE_LIST 0 /* error getting list */
@@ -83,12 +76,6 @@ GList *get_interface_list(int *err, char *err_str);
void free_interface_list(GList *if_list);
- * Get an error message string for a CANT_GET_INTERFACE_LIST error from
- * "get_interface_list()".
- */
-gchar *cant_get_if_list_error_message(const char *err_str);
* The list of data link types returned by "get_pcap_linktype_list()" is
* a list of these structures.
@@ -98,7 +85,7 @@ typedef struct {
char *description; /* descriptive name from wiretap e.g. "Ethernet", NULL if unknown */
} data_link_info_t;
-GList *get_pcap_linktype_list(const char *devname, char *err_buf);
+GList *get_pcap_linktype_list(const char *devname, char **err_str);
void free_pcap_linktype_list(GList *linktype_list);
/* get/set the link type of an interface */