# not having it on UN*X.
#
if(WIN32)
- option(HAVE_REMOTE "Enable remote capture" ON)
+ option(ENABLE_REMOTE "Enable remote capture" ON)
else()
- option(HAVE_REMOTE "Enable remote capture" OFF)
+ option(ENABLE_REMOTE "Enable remote capture" OFF)
endif(WIN32)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif(NOT HAVE_STRTOK_R)
endif(WIN32)
-if(HAVE_REMOTE)
+if(ENABLE_REMOTE)
set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C}
pcap-new.c pcap-rpcap.c rpcap-protocol.c sockutils.c)
-endif(HAVE_REMOTE)
+endif(ENABLE_REMOTE)
#
# Determine the main pcap-XXX.c file to use, and the libraries with
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>../../;../../lbl/;../../bpf/;../include/;../../../../common;../../../../dag/include;../../../../dag/drv/windows;../../../Win32-Extensions;./;Win32-Extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>HAVE_VERSION_H;__STDC_VERSION__=199901L;HAVE_PACKET_IS_LOOPBACK_ADAPTER;NDEBUG;YY_NEVER_INTERACTIVE;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;HAVE_REMOTE;WIN32;_U_=;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>HAVE_VERSION_H;__STDC_VERSION__=199901L;HAVE_PACKET_IS_LOOPBACK_ADAPTER;NDEBUG;YY_NEVER_INTERACTIVE;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;ENABLE_REMOTE;WIN32;_U_=;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ResourceCompile>
<Culture>0x0409</Culture>
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>../../;../../lbl/;../../bpf/;../include/;../../../../common;../../../../dag/include;../../../../dag/drv/windows;../../../Win32-Extensions;./;Win32-Extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>HAVE_VERSION_H;__STDC_VERSION__=199901L;HAVE_PACKET_IS_LOOPBACK_ADAPTER;NDEBUG;YY_NEVER_INTERACTIVE;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;HAVE_REMOTE;WIN32;_U_=;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>HAVE_VERSION_H;__STDC_VERSION__=199901L;HAVE_PACKET_IS_LOOPBACK_ADAPTER;NDEBUG;YY_NEVER_INTERACTIVE;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;ENABLE_REMOTE;WIN32;_U_=;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ResourceCompile>
<Culture>0x0409</Culture>
<MinimalRebuild>true</MinimalRebuild>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<AdditionalIncludeDirectories>../../;../../lbl/;../../bpf/;../include/;../../../../common;../../../../dag/include;../../../../dag/drv/windows;../../../Win32-Extensions;./;Win32-Extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>HAVE_VERSION_H;__STDC_VERSION__=199901L;HAVE_PACKET_IS_LOOPBACK_ADAPTER;_DEBUG;YY_NEVER_INTERACTIVE;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;HAVE_REMOTE;WIN32;_U_=;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>HAVE_VERSION_H;__STDC_VERSION__=199901L;HAVE_PACKET_IS_LOOPBACK_ADAPTER;_DEBUG;YY_NEVER_INTERACTIVE;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;ENABLE_REMOTE;WIN32;_U_=;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<ResourceCompile>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>../../;../../lbl/;../../bpf/;../include/;../../../../common;../../../../dag/include;../../../../dag/drv/windows;../../../Win32-Extensions;./;Win32-Extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>HAVE_VERSION_H;__STDC_VERSION__=199901L;HAVE_PACKET_IS_LOOPBACK_ADAPTER;_DEBUG;YY_NEVER_INTERACTIVE;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;HAVE_REMOTE;WIN32;_U_=;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>HAVE_VERSION_H;__STDC_VERSION__=199901L;HAVE_PACKET_IS_LOOPBACK_ADAPTER;_DEBUG;YY_NEVER_INTERACTIVE;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;ENABLE_REMOTE;WIN32;_U_=;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<ResourceCompile>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
#cmakedefine HAVE_PF_NAT_THROUGH_PF_NORDR 1
/* Define to 1 if remote packet capture is to be supported */
-#cmakedefine HAVE_REMOTE 1
+#cmakedefine ENABLE_REMOTE 1
/* define if you have the Septel API */
#cmakedefine HAVE_SEPTEL_API 1
/* Enable optimizer debugging */
#undef BDEBUG
+/* Define to 1 if remote packet capture is to be supported */
+#undef ENABLE_REMOTE
+
/* define if you have the DAG API */
#undef HAVE_DAG_API
/* define if net/pfvar.h defines PF_NAT through PF_NORDR */
#undef HAVE_PF_NAT_THROUGH_PF_NORDR
-/* Define to 1 if remote packet capture is to be supported */
-#undef HAVE_REMOTE
-
/* define if you have the Septel API */
#undef HAVE_SEPTEL_API
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: to attacks by malicious remote capture servers!" >&5
$as_echo "$as_me: WARNING: to attacks by malicious remote capture servers!" >&2;}
-$as_echo "#define HAVE_REMOTE /**/" >>confdefs.h
+$as_echo "#define ENABLE_REMOTE /**/" >>confdefs.h
SSRC="$SSRC pcap-new.c pcap-rpcap.c rpcap-protocol.c sockutils.c"
RPCAPD=rpcapd
yes) AC_MSG_RESULT(yes)
AC_WARN([Remote packet capture may expose libpcap-based applications])
AC_WARN([to attacks by malicious remote capture servers!])
- AC_DEFINE(HAVE_REMOTE,,
+ AC_DEFINE(ENABLE_REMOTE,,
[Define to 1 if remote packet capture is to be supported])
SSRC="$SSRC pcap-new.c pcap-rpcap.c rpcap-protocol.c sockutils.c"
RPCAPD=rpcapd
done = 1;
#endif
-#ifdef HAVE_REMOTE
+#ifdef ENABLE_REMOTE
/*
* If the device on which we're capturing need to be notified
* that a new filter is being compiled, do so.
void *priv; /* private data for methods */
-#ifdef HAVE_REMOTE
+#ifdef ENABLE_REMOTE
struct pcap_samp rmt_samp; /* parameters related to the sampling process. */
#endif
int dag_fcs_bits; /* Number of checksum bits from link layer */
#endif
-#ifdef HAVE_REMOTE
+#ifdef ENABLE_REMOTE
int samp_npkt; /* parameter needed for sampling, with '1 out of N' method has been requested */
struct timeval samp_time; /* parameter needed for sampling, with '1 every N ms' method has been requested */
#endif
p->stat.ps_recv = bstats.bs_recv;
p->stat.ps_drop = bstats.bs_drop;
p->stat.ps_ifdrop = bstats.ps_ifdrop;
-#ifdef HAVE_REMOTE
+#ifdef ENABLE_REMOTE
p->stat.ps_capt = bstats.bs_capt;
#endif
return (&p->stat);
if (pw->filtering_in_kernel ||
p->fcode.bf_insns == NULL ||
bpf_filter(p->fcode.bf_insns, datap, bhp->bh_datalen, caplen)) {
-#ifdef HAVE_REMOTE
+#ifdef ENABLE_REMOTE
switch (p->rmt_samp.method) {
case PCAP_SAMP_1_EVERY_N:
}
}
}
-#endif /* HAVE_REMOTE */
+#endif /* ENABLE_REMOTE */
/*
* XXX A bpf_hdr matches a pcap_pkthdr.
ps->ps_drop = 0;
ps->ps_ifdrop = 0;
ps->ps_recv = 0;
-#if defined(_WIN32) && defined(HAVE_REMOTE)
+#if defined(_WIN32) && defined(ENABLE_REMOTE)
if (mode == PCAP_STATS_EX)
{
ps->ps_capt = 0;
ps->ps_sent = 0;
ps->ps_netdrop = 0;
}
-#endif /* _WIN32 && HAVE_REMOTE */
+#endif /* _WIN32 && ENABLE_REMOTE */
return ps;
}
ps->ps_drop = ntohl(netstats.krnldrop);
ps->ps_ifdrop = ntohl(netstats.ifdrop);
ps->ps_recv = ntohl(netstats.ifrecv);
-#if defined(_WIN32) && defined(HAVE_REMOTE)
+#if defined(_WIN32) && defined(ENABLE_REMOTE)
if (mode == PCAP_STATS_EX)
{
ps->ps_capt = pr->TotCapt;
ps->ps_netdrop = pr->TotNetDrops;
ps->ps_sent = ntohl(netstats.svrcapt);
}
-#endif /* _WIN32 && HAVE_REMOTE */
+#endif /* _WIN32 && ENABLE_REMOTE */
/* Checks if all the data has been read; if not, discard the data in excess */
if (totread != ntohl(header.plen))
s.ps_drop = 0xFFFFFFFF;
}
-#if defined(_WIN32) && defined(HAVE_REMOTE)
+#if defined(_WIN32) && defined(ENABLE_REMOTE)
s.ps_capt = pt->TcAcceptedCount;
#endif
*ps = s;
p->stat.ps_drop = 0xFFFFFFFF;
}
-#if defined(_WIN32) && defined(HAVE_REMOTE)
+#if defined(_WIN32) && defined(ENABLE_REMOTE)
p->stat.ps_capt = pt->TcAcceptedCount;
#endif
}
#endif /* !defined(_WIN32) && !defined(MSDOS) */
-#ifdef HAVE_REMOTE
+#ifdef ENABLE_REMOTE
#include "pcap-rpcap.h"
/*
{
pcap_t *p;
int status;
-#ifdef HAVE_REMOTE
+#ifdef ENABLE_REMOTE
char host[PCAP_BUF_SIZE + 1];
char port[PCAP_BUF_SIZE + 1];
char name[PCAP_BUF_SIZE + 1];
device += strlen(PCAP_SRC_IF_STRING);
}
}
-#endif /* HAVE_REMOTE */
+#endif /* ENABLE_REMOTE */
p = pcap_create(device, errbuf);
if (p == NULL)
bpf_u_int32 net, mask;
int exit_status = 0;
char errbuf[PCAP_ERRBUF_SIZE+1];
-#ifdef HAVE_REMOTE
+#ifdef ENABLE_REMOTE
struct pcap_rmtauth auth;
char username[128+1];
char *p;
char *password;
#endif
-#ifdef HAVE_REMOTE
+#ifdef ENABLE_REMOTE
if (argc >= 2)
{
if (pcap_findalldevs_ex(argv[1], NULL, &alldevs, errbuf) == -1)