Cleanup function prototypes for consistency with newer versions of WinPcap and libpcap.
This commit is contained in:
parent
3b7492d6be
commit
2793d49bf9
2 changed files with 30 additions and 13 deletions
|
@ -1,4 +1,11 @@
|
||||||
This dirctory contains a set of Visual Studio 2008 build projects for the current simh code base. When used (with Visual Studio Express 2008 or Visual Studio Express 2010) it populates a directory tree under the BIN directory of the Simh distribution for temporary build files and produces resulting executables in the BIN/NT/Win32-Debug or BIN/NT/Win32-Release directories (depending on whether you target a Debug or Release build). It expects that a winpcap developer pack zip file is expanded in a directory parallel to the simh directory.
|
This dirctory contains a set of Visual Studio 2008 build projects for the
|
||||||
|
current simh code base. When used (with Visual Studio Express 2008 or
|
||||||
|
Visual Studio Express 2010) it populates a directory tree under the BIN
|
||||||
|
directory of the Simh distribution for temporary build files and produces
|
||||||
|
resulting executables in the BIN/NT/Win32-Debug or BIN/NT/Win32-Release
|
||||||
|
directories (depending on whether you target a Debug or Release build).
|
||||||
|
It expects that a winpcap developer pack zip file is expanded in a directory
|
||||||
|
parallel to the simh directory.
|
||||||
|
|
||||||
For Example, the directory structure should look like:
|
For Example, the directory structure should look like:
|
||||||
|
|
||||||
|
@ -13,8 +20,10 @@ For Example, the directory structure should look like:
|
||||||
The winpcap developer pack can be found at:
|
The winpcap developer pack can be found at:
|
||||||
http://www.winpcap.org/devel.htm
|
http://www.winpcap.org/devel.htm
|
||||||
|
|
||||||
|
The latest version of the WinPcap developer's pack is Version 4.1.2
|
||||||
|
|
||||||
Some features can be enabled if the pthreads API is available and contained also in a parallel place in the directory structure.
|
Some features can be enabled if the pthreads API is available and contained
|
||||||
|
also in a parallel place in the directory structure.
|
||||||
|
|
||||||
|
|
||||||
.../simh/pthreads/Pre-built.2/include/include/pthreads.h
|
.../simh/pthreads/Pre-built.2/include/include/pthreads.h
|
||||||
|
@ -24,10 +33,18 @@ To install pthreads API, create the directory:
|
||||||
|
|
||||||
.../simh/pthreads/
|
.../simh/pthreads/
|
||||||
|
|
||||||
download the file: ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe
|
download the file:
|
||||||
|
ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe
|
||||||
to that directory and execute it. Click on the Extract button.
|
to that directory and execute it. Click on the Extract button.
|
||||||
Once installed, When running a simulator with pthreads support enabled, you will need a copy of the DLL file (simh\pthreads\Pre-built.2\lib\pthreadVC2.dll) to exist in either the %windir%\System32 directory or your working directory while running a simh simulator. The default working directory for included project files is the "Visual Studio Projects" directory.
|
Once installed, When running a simulator with pthreads support enabled, you
|
||||||
|
will need a copy of the DLL file (simh\pthreads\Pre-built.2\lib\pthreadVC2.dll)
|
||||||
|
to exist in either the %windir%\System32 directory (or %windir%\SysWOW64 on
|
||||||
|
x64 Windows environments) or your working directory while running a simh
|
||||||
|
simulator. The default working directory for included project files is the
|
||||||
|
"Visual Studio Projects" directory.
|
||||||
|
|
||||||
|
|
||||||
Only network devices are capable of using pthreads to enhance their performance. Build the desire simulator with USE_READER_THREAD defined. The relevant simulators which have network support are VAX, VAX780, PDP11 and PDP10.
|
Only network devices are capable of using pthreads to enhance their
|
||||||
|
performance. Build the desire simulator with USE_READER_THREAD defined. The
|
||||||
|
relevant simulators which have network support are VAX, VAX780 and PDP11.
|
||||||
|
|
||||||
|
|
16
sim_ether.c
16
sim_ether.c
|
@ -849,7 +849,7 @@ static char* no_pcap =
|
||||||
|
|
||||||
/* define pointers to pcap functions needed */
|
/* define pointers to pcap functions needed */
|
||||||
static void (*p_pcap_close) (pcap_t *);
|
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_datalink) (pcap_t *);
|
||||||
static int (*p_pcap_dispatch) (pcap_t *, int, pcap_handler, u_char *);
|
static int (*p_pcap_dispatch) (pcap_t *, int, pcap_handler, u_char *);
|
||||||
static int (*p_pcap_findalldevs) (pcap_if_t **, 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
|
#ifdef _WIN32
|
||||||
static int (*p_pcap_setmintocopy) (pcap_t* handle, int);
|
static int (*p_pcap_setmintocopy) (pcap_t* handle, int);
|
||||||
static HANDLE (*p_pcap_getevent) (pcap_t *);
|
static HANDLE (*p_pcap_getevent) (pcap_t *);
|
||||||
#else
|
#else
|
||||||
static int (*p_pcap_get_selectable_fd) (pcap_t *);
|
static int (*p_pcap_get_selectable_fd) (pcap_t *);
|
||||||
#endif
|
#endif
|
||||||
static int (*p_pcap_sendpacket) (pcap_t* handle, const u_char* msg, int len);
|
static int (*p_pcap_sendpacket) (pcap_t* handle, const u_char* msg, int len);
|
||||||
static int (*p_pcap_setfilter) (pcap_t *, struct bpf_program *);
|
static int (*p_pcap_setfilter) (pcap_t *, struct bpf_program *);
|
||||||
|
@ -905,10 +905,10 @@ int load_pcap(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf (msg, lib_name);
|
printf (msg, lib_name);
|
||||||
printf (msg2);
|
printf ("%s", msg2);
|
||||||
if (sim_log) {
|
if (sim_log) {
|
||||||
fprintf (sim_log, msg, lib_name);
|
fprintf (sim_log, msg, lib_name);
|
||||||
fprintf (sim_log, msg2);
|
fprintf (sim_log, "%s", msg2);
|
||||||
}
|
}
|
||||||
lib_loaded = 2;
|
lib_loaded = 2;
|
||||||
break;
|
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) {
|
if (load_pcap() != 0) {
|
||||||
return p_pcap_compile(a, b, c, d, e);
|
return p_pcap_compile(a, b, c, d, e);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1047,13 +1047,13 @@ HANDLE pcap_getevent(pcap_t* a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
int pcap_get_selectable_fd(pcap_t* a) {
|
int pcap_get_selectable_fd(pcap_t* a) {
|
||||||
if (load_pcap() != 0) {
|
if (load_pcap() != 0) {
|
||||||
return p_pcap_get_selectable_fd(a);
|
return p_pcap_get_selectable_fd(a);
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int pcap_sendpacket(pcap_t* a, const u_char* b, int c) {
|
int pcap_sendpacket(pcap_t* a, const u_char* b, int c) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue