1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 19:56:25 +00:00

Cleanup function prototypes for consistency with newer versions of WinPcap and libpcap.

This commit is contained in:
Mark Pizzolato
2011-11-17 11:29:13 -08:00
parent 3b7492d6be
commit 2793d49bf9
2 changed files with 30 additions and 13 deletions

View File

@@ -849,7 +849,7 @@ static char* no_pcap =
/* define pointers to pcap functions needed */
static void (*p_pcap_close) (pcap_t *);
static int (*p_pcap_compile) (pcap_t *, struct bpf_program *, char *, int, bpf_u_int32);
static int (*p_pcap_compile) (pcap_t *, struct bpf_program *, const char *, int, bpf_u_int32);
static int (*p_pcap_datalink) (pcap_t *);
static int (*p_pcap_dispatch) (pcap_t *, int, pcap_handler, u_char *);
static int (*p_pcap_findalldevs) (pcap_if_t **, char *);
@@ -861,8 +861,8 @@ static pcap_t* (*p_pcap_open_live) (const char *, int, int, int, char *);
#ifdef _WIN32
static int (*p_pcap_setmintocopy) (pcap_t* handle, int);
static HANDLE (*p_pcap_getevent) (pcap_t *);
#else
static int (*p_pcap_get_selectable_fd) (pcap_t *);
#else
static int (*p_pcap_get_selectable_fd) (pcap_t *);
#endif
static int (*p_pcap_sendpacket) (pcap_t* handle, const u_char* msg, int len);
static int (*p_pcap_setfilter) (pcap_t *, struct bpf_program *);
@@ -905,10 +905,10 @@ int load_pcap(void) {
#endif
printf (msg, lib_name);
printf (msg2);
printf ("%s", msg2);
if (sim_log) {
fprintf (sim_log, msg, lib_name);
fprintf (sim_log, msg2);
fprintf (sim_log, "%s", msg2);
}
lib_loaded = 2;
break;
@@ -959,7 +959,7 @@ void pcap_close(pcap_t* a) {
}
}
int pcap_compile(pcap_t* a, struct bpf_program* b, char* c, int d, bpf_u_int32 e) {
int pcap_compile(pcap_t* a, struct bpf_program* b, const char* c, int d, bpf_u_int32 e) {
if (load_pcap() != 0) {
return p_pcap_compile(a, b, c, d, e);
} else {
@@ -1047,13 +1047,13 @@ HANDLE pcap_getevent(pcap_t* a) {
}
#else
int pcap_get_selectable_fd(pcap_t* a) {
int pcap_get_selectable_fd(pcap_t* a) {
if (load_pcap() != 0) {
return p_pcap_get_selectable_fd(a);
} else {
return 0;
}
}
}
#endif
int pcap_sendpacket(pcap_t* a, const u_char* b, int c) {