mirror of
https://github.com/simh/simh.git
synced 2026-01-25 19:56:25 +00:00
Added pcap_fileno to the dynamically loaded libpcap entry points since it is needed by OS X.
This commit is contained in:
10
sim_ether.c
10
sim_ether.c
@@ -863,6 +863,7 @@ 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 *);
|
||||
static int (*p_pcap_fileno) (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 *);
|
||||
@@ -933,6 +934,7 @@ int load_pcap(void) {
|
||||
load_function("pcap_getevent", (void**) &p_pcap_getevent);
|
||||
#else
|
||||
load_function("pcap_get_selectable_fd", (void**) &p_pcap_get_selectable_fd);
|
||||
load_function("pcap_fileno", (void**) &p_pcap_fileno);
|
||||
#endif
|
||||
load_function("pcap_sendpacket", (void**) &p_pcap_sendpacket);
|
||||
load_function("pcap_setfilter", (void**) &p_pcap_setfilter);
|
||||
@@ -1054,6 +1056,14 @@ int pcap_get_selectable_fd(pcap_t* a) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int pcap_fileno(pcap_t * a) {
|
||||
if (load_pcap() != 0) {
|
||||
return p_pcap_fileno(a);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int pcap_sendpacket(pcap_t* a, const u_char* b, int c) {
|
||||
|
||||
Reference in New Issue
Block a user