DWORD dwWindowsMajorVersion;
dwVersion = GetVersion(); /* get the OS version */
dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
-
+
if (dwVersion >= 0x80000000 && dwWindowsMajorVersion >= 4) {
/*
* Windows 95, 98, ME.
*/
ULONG NameLength = 8192;
static char AdaptersName[8192];
-
+
if (PacketGetAdapterNames(AdaptersName,&NameLength) )
return (AdaptersName);
else
free(TAdaptersName);
return (char *)(AdaptersName);
- }
+ }
}
register bpf_u_int32 *netp, *maskp;
register char *errbuf;
{
- /*
+ /*
* We need only the first IPv4 address, so we must scan the array returned by PacketGetNetInfo()
* in order to skip non IPv4 (i.e. IPv6 addresses)
*/
*netp &= *maskp;
return (0);
}
-
+
}
*netp = *maskp = 0;
#include "pcap-dbus.h"
#endif
-int
+int
pcap_not_initialized(pcap_t *pcap _U_)
{
/* this means 'not initialized' */
return (pkt);
}
-int
+int
pcap_next_ex(pcap_t *p, struct pcap_pkthdr **pkt_header,
const u_char **pkt_data)
{
/*
* Get the list of regular interfaces first.
- */
+ */
if (pcap_findalldevs_interfaces(alldevsp, errbuf) == -1)
return (-1); /* failure */
#ifndef WIN32
p->fd = -1; /* not opened yet */
p->selectable_fd = -1;
-#endif
+#endif
if (size == 0) {
/* No private data was requested. */
#ifdef WIN32
/*
- * Generate a string for the last Win32-specific error (i.e. an error generated when
+ * Generate a string for the last Win32-specific error (i.e. an error generated when
* calling a Win32 API).
* For errors occurred during standard C calls, we still use pcap_strerror()
*/
{
const struct bpf_insn *fcode = fp->bf_insns;
- if (fcode != NULL)
+ if (fcode != NULL)
return (bpf_filter(fcode, pkt, h->len, h->caplen));
else
return (0);
/*
* Macros for the value returned by pcap_datalink_ext().
- *
+ *
* If LT_FCS_LENGTH_PRESENT(x) is true, the LT_FCS_LENGTH(x) macro
* gives the FCS length of packets in the capture.
*/