diff options
author | Guy Harris <guy@alum.mit.edu> | 2010-03-04 01:12:04 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2010-03-04 01:12:04 +0000 |
commit | 167ab3a98c4583344f8b95d81b079b7a5df7e5ff (patch) | |
tree | c2af1e714cc510427cdd87a9b63979038cfc40ac /dumpcap.c | |
parent | 98d800bae8939f6edaf4aa54f02787148da48c0f (diff) |
In Wireshark and TShark, run dumpcap to get interface lists and lists of
link-layer header types for interfaces; if special privileges are
necessary to open capture devices, Wireshark and TShark shouldn't have
those privileges, but dumpcap should.
svn path=/trunk/; revision=32104
Diffstat (limited to 'dumpcap.c')
-rw-r--r-- | dumpcap.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -90,6 +90,7 @@ #include "sync_pipe.h" #include "capture_opts.h" +#include "capture_ifinfo.h" #include "capture_sync.h" #include "conditions.h" @@ -423,6 +424,25 @@ cmdarg_err_cont(const char *fmt, ...) } } +/* + * capture_interface_list() is expected to do the right thing to get + * a list of interfaces. + * + * In most of the programs in the Wireshark suite, "the right thing" + * is to run dumpcap and ask it for the list, because dumpcap may + * be the only program in the suite with enough privileges to get + * the list. + * + * In dumpcap itself, however, we obviously can't run dumpcap to + * ask for the list. Therefore, our capture_interface_list() should + * just call get_interface_list(). + */ +GList * +capture_interface_list(int *err, char **err_str) +{ + return get_interface_list(err, err_str); +} + typedef struct { char *name; pcap_t *pch; |