Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a pcap-dbus.h header and include it in pcap-dbus.c and pcap.c.

That way, we ensure that the same function prototypes are seen when
dbus_create() and dbus_findalldevs() are defined and when they're used.

Also, add pcap-dbus.c to the list of "extra" files in Makefile.in, so it
goes into the release tarball.
  • Loading branch information...
commit de111152d951bee96deb6ac608b812937db9c433 1 parent c585721
@guyharris guyharris authored
Showing with 11 additions and 6 deletions.
  1. +2 −0  Makefile.in
  2. +6 −4 pcap-dbus.c
  3. +2 −0  pcap-dbus.h
  4. +1 −2  pcap.c
View
2  Makefile.in
@@ -296,6 +296,8 @@ EXTRA_DIST = \
pcap-config.in \
pcap-dag.c \
pcap-dag.h \
+ pcap-dbus.c \
+ pcap-dbus.h \
pcap-dlpi.c \
pcap-dos.c \
pcap-dos.h \
View
10 pcap-dbus.c
@@ -32,8 +32,6 @@
#include "config.h"
#endif
-#include "pcap-int.h"
-
#include <string.h>
#include <time.h>
@@ -41,6 +39,9 @@
#include <dbus/dbus.h>
+#include "pcap-dbus.h"
+#include "pcap-int.h"
+
static int
dbus_read(pcap_t *handle, int max_packets, pcap_handler callback, u_char *user)
{
@@ -81,9 +82,10 @@ dbus_read(pcap_t *handle, int max_packets, pcap_handler callback, u_char *user)
/* pkth.caplen = min (payload_len, handle->snapshot); */
gettimeofday(&pkth.ts, NULL);
- if (handle->fcode.bf_insns == NULL || bpf_filter(handle->fcode.bf_insns, raw_msg, pkth.len, pkth.caplen)) {
+ if (handle->fcode.bf_insns == NULL ||
+ bpf_filter(handle->fcode.bf_insns, (u_char *)raw_msg, pkth.len, pkth.caplen)) {
handle->md.packets_read++;
- callback(user, &pkth, raw_msg);
+ callback(user, &pkth, (u_char *)raw_msg);
count++;
}
View
2  pcap-dbus.h
@@ -0,0 +1,2 @@
+pcap_t *dbus_create(const char *, char *, int *);
+int dbus_findalldevs(pcap_if_t **devlistp, char *errbuf);
View
3  pcap.c
@@ -106,8 +106,7 @@ static const char rcsid[] _U_ =
#endif
#ifdef PCAP_SUPPORT_DBUS
-int dbus_findalldevs(pcap_if_t **alldevsp, char *err_str);
-pcap_t *dbus_create(const char *device, char *ebuf, int *is_ours);
+#include "pcap-dbus.h"
#endif
int
Please sign in to comment.
Something went wrong with that request. Please try again.