diff --git a/pcap-npf.c b/pcap-npf.c index ba9a58beec..3fa08801c9 100644 --- a/pcap-npf.c +++ b/pcap-npf.c @@ -55,6 +55,8 @@ #include #endif /* HAVE_DAG_API */ +#include "diag-control.h" + static int pcap_setfilter_npf(pcap_t *, struct bpf_program *); static int pcap_setfilter_win32_dag(pcap_t *, struct bpf_program *); static int pcap_getnonblock_npf(pcap_t *); @@ -246,7 +248,7 @@ pcap_stats_npf(pcap_t *p, struct pcap_stat *ps) * statistics we are and are *not* providing, rather than having to provide * possibly-bogus values for statistics we can't provide. */ -struct pcap_stat * +static struct pcap_stat * pcap_stats_ex_npf(pcap_t *p, int *pcap_stat_size) { struct pcap_win *pw = p->priv; @@ -1872,10 +1874,10 @@ pcap_lookupdev(char *errbuf) DWORD dwVersion; DWORD dwWindowsMajorVersion; -#pragma warning (push) -#pragma warning (disable: 4996) /* disable MSVC's GetVersion() deprecated warning here */ +/* disable MSVC's GetVersion() deprecated warning here */ +DIAG_OFF_DEPRECATION dwVersion = GetVersion(); /* get the OS version */ -#pragma warning (pop) +DIAG_ON_DEPRECATION dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); if (dwVersion >= 0x80000000 && dwWindowsMajorVersion >= 4) { diff --git a/pcap.c b/pcap.c index fa44c71f11..fd83dec590 100644 --- a/pcap.c +++ b/pcap.c @@ -128,9 +128,9 @@ struct rtentry; /* declarations in */ * DllMain(), required when built as a Windows DLL. */ BOOL WINAPI DllMain( - HANDLE hinstDLL, - DWORD dwReason, - LPVOID lpvReserved + HANDLE hinstDLL _U_, + DWORD dwReason _U_, + LPVOID lpvReserved _U_ ) { return (TRUE); @@ -257,7 +257,7 @@ pcap_stats_not_initialized(pcap_t *pcap, struct pcap_stat *ps _U_) } #ifdef _WIN32 -struct pcap_stat * +static struct pcap_stat * pcap_stats_ex_not_initialized(pcap_t *pcap, int *pcap_stat_size _U_) { pcap_set_not_initialized_message(pcap); @@ -312,7 +312,8 @@ pcap_oid_set_request_not_initialized(pcap_t *pcap, bpf_u_int32 oid _U_, } static u_int -pcap_sendqueue_transmit_not_initialized(pcap_t *pcap, pcap_send_queue* queue, int sync) +pcap_sendqueue_transmit_not_initialized(pcap_t *pcap, pcap_send_queue* queue _U_, + int sync _U_) { pcap_set_not_initialized_message(pcap); return (0); @@ -3966,7 +3967,7 @@ pcap_stats_dead(pcap_t *p, struct pcap_stat *ps _U_) } #ifdef _WIN32 -struct pcap_stat * +static struct pcap_stat * pcap_stats_ex_dead(pcap_t *p, int *pcap_stat_size _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, @@ -3975,7 +3976,7 @@ pcap_stats_ex_dead(pcap_t *p, int *pcap_stat_size _U_) } static int -pcap_setbuff_dead(pcap_t *p, int dim) +pcap_setbuff_dead(pcap_t *p, int dim _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "The kernel buffer size cannot be set on a pcap_open_dead pcap_t"); @@ -3983,7 +3984,7 @@ pcap_setbuff_dead(pcap_t *p, int dim) } static int -pcap_setmode_dead(pcap_t *p, int mode) +pcap_setmode_dead(pcap_t *p, int mode _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "impossible to set mode on a pcap_open_dead pcap_t"); @@ -3991,7 +3992,7 @@ pcap_setmode_dead(pcap_t *p, int mode) } static int -pcap_setmintocopy_dead(pcap_t *p, int size) +pcap_setmintocopy_dead(pcap_t *p, int size _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "The mintocopy parameter cannot be set on a pcap_open_dead pcap_t"); @@ -4025,7 +4026,7 @@ pcap_oid_set_request_dead(pcap_t *p, bpf_u_int32 oid _U_, const void *data _U_, } static u_int -pcap_sendqueue_transmit_dead(pcap_t *p, pcap_send_queue *queue, int sync) +pcap_sendqueue_transmit_dead(pcap_t *p, pcap_send_queue *queue, int sync _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Packets cannot be transmitted on a pcap_open_dead pcap_t"); @@ -4033,7 +4034,7 @@ pcap_sendqueue_transmit_dead(pcap_t *p, pcap_send_queue *queue, int sync) } static int -pcap_setuserbuffer_dead(pcap_t *p, int size) +pcap_setuserbuffer_dead(pcap_t *p, int size _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "The user buffer cannot be set on a pcap_open_dead pcap_t"); @@ -4041,7 +4042,8 @@ pcap_setuserbuffer_dead(pcap_t *p, int size) } static int -pcap_live_dump_dead(pcap_t *p, char *filename, int maxsize, int maxpacks) +pcap_live_dump_dead(pcap_t *p, char *filename _U_, int maxsize _U_, + int maxpacks _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Live packet dumping cannot be performed on a pcap_open_dead pcap_t"); @@ -4049,7 +4051,7 @@ pcap_live_dump_dead(pcap_t *p, char *filename, int maxsize, int maxpacks) } static int -pcap_live_dump_ended_dead(pcap_t *p, int sync) +pcap_live_dump_ended_dead(pcap_t *p, int sync _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Live packet dumping cannot be performed on a pcap_open_dead pcap_t"); @@ -4057,7 +4059,7 @@ pcap_live_dump_ended_dead(pcap_t *p, int sync) } static PAirpcapHandle -pcap_get_airpcap_handle_dead(pcap_t *p) +pcap_get_airpcap_handle_dead(pcap_t *p _U_) { return (NULL); } diff --git a/savefile.c b/savefile.c index aae9882e4c..3db99b3236 100644 --- a/savefile.c +++ b/savefile.c @@ -121,7 +121,7 @@ sf_stats(pcap_t *p, struct pcap_stat *ps _U_) #ifdef _WIN32 static struct pcap_stat * -sf_stats_ex(pcap_t *p, int *size) +sf_stats_ex(pcap_t *p, int *size _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Statistics aren't available from savefiles"); @@ -129,7 +129,7 @@ sf_stats_ex(pcap_t *p, int *size) } static int -sf_setbuff(pcap_t *p, int dim) +sf_setbuff(pcap_t *p, int dim _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "The kernel buffer size cannot be set while reading from a file"); @@ -137,7 +137,7 @@ sf_setbuff(pcap_t *p, int dim) } static int -sf_setmode(pcap_t *p, int mode) +sf_setmode(pcap_t *p, int mode _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "impossible to set mode while reading from a file"); @@ -145,7 +145,7 @@ sf_setmode(pcap_t *p, int mode) } static int -sf_setmintocopy(pcap_t *p, int size) +sf_setmintocopy(pcap_t *p, int size _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "The mintocopy parameter cannot be set while reading from a file"); @@ -179,7 +179,7 @@ sf_oid_set_request(pcap_t *p, bpf_u_int32 oid _U_, const void *data _U_, } static u_int -sf_sendqueue_transmit(pcap_t *p, pcap_send_queue *queue, int sync) +sf_sendqueue_transmit(pcap_t *p, pcap_send_queue *queue _U_, int sync _U_) { pcap_strlcpy(p->errbuf, "Sending packets isn't supported on savefiles", PCAP_ERRBUF_SIZE); @@ -187,7 +187,7 @@ sf_sendqueue_transmit(pcap_t *p, pcap_send_queue *queue, int sync) } static int -sf_setuserbuffer(pcap_t *p, int size) +sf_setuserbuffer(pcap_t *p, int size _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "The user buffer cannot be set when reading from a file"); @@ -195,7 +195,7 @@ sf_setuserbuffer(pcap_t *p, int size) } static int -sf_live_dump(pcap_t *p, char *filename, int maxsize, int maxpacks) +sf_live_dump(pcap_t *p, char *filename _U_, int maxsize _U_, int maxpacks _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Live packet dumping cannot be performed when reading from a file"); @@ -203,7 +203,7 @@ sf_live_dump(pcap_t *p, char *filename, int maxsize, int maxpacks) } static int -sf_live_dump_ended(pcap_t *p, int sync) +sf_live_dump_ended(pcap_t *p, int sync _U_) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Live packet dumping cannot be performed on a pcap_open_dead pcap_t"); @@ -211,7 +211,7 @@ sf_live_dump_ended(pcap_t *p, int sync) } static PAirpcapHandle -sf_get_airpcap_handle(pcap_t *pcap) +sf_get_airpcap_handle(pcap_t *pcap _U_) { return (NULL); }