aboutsummaryrefslogtreecommitdiffstats
path: root/capture-pcap-util.c
diff options
context:
space:
mode:
authorTomas Kukosa <tomas.kukosa@siemens.com>2007-12-04 11:19:29 +0000
committerTomas Kukosa <tomas.kukosa@siemens.com>2007-12-04 11:19:29 +0000
commit08bbd29c71b8068e419f95a7a8cb7332ef0a3a3d (patch)
treef0bdb59e0947e9cfeac882b6b58a4753af6511be /capture-pcap-util.c
parent48537a7a6505e68faadbed9837a4159c2758d442 (diff)
Support for RPCAP features in GUI (from Boris Misenov, see Bug 1366)
- retrieving the list of remote PCAP interfaces - password authentication support - UDP data fransfer - packet sampling (available in WinPcap 4.x) etc. fix problem if non-default rpcap port is used svn path=/trunk/; revision=23750
Diffstat (limited to 'capture-pcap-util.c')
-rw-r--r--capture-pcap-util.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/capture-pcap-util.c b/capture-pcap-util.c
index 1c24afd485..4cf7f4995d 100644
--- a/capture-pcap-util.c
+++ b/capture-pcap-util.c
@@ -249,15 +249,26 @@ if_info_ip(if_info_t *if_info, pcap_if_t *d)
}
}
+#ifdef HAVE_PCAP_REMOTE
+GList *
+get_interface_list_findalldevs_ex(const char *source,
+ struct pcap_rmtauth *auth,
+ int *err, char **err_str)
+#else
GList *
get_interface_list_findalldevs(int *err, char **err_str)
+#endif
{
GList *il = NULL;
pcap_if_t *alldevs, *dev;
if_info_t *if_info;
char errbuf[PCAP_ERRBUF_SIZE];
+#ifdef HAVE_PCAP_REMOTE
+ if (pcap_findalldevs_ex((char *)source, auth, &alldevs, errbuf) == -1) {
+#else
if (pcap_findalldevs(&alldevs, errbuf) == -1) {
+#endif
*err = CANT_GET_INTERFACE_LIST;
if (err_str != NULL)
*err_str = cant_get_if_list_error_message(errbuf);
@@ -367,7 +378,11 @@ get_pcap_linktype_list(char *devname, char **err_str)
#endif
data_link_info_t *data_link_info;
+#ifdef HAVE_PCAP_OPEN
+ pch = pcap_open(devname, MIN_PACKET_SIZE, 0, 0, NULL, errbuf);
+#else
pch = pcap_open_live(devname, MIN_PACKET_SIZE, 0, 0, errbuf);
+#endif
if (pch == NULL) {
if (err_str != NULL)
*err_str = g_strdup(errbuf);