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

Added support for VDE (Virtual Distributed Ethernet) network packet transport

Fixed filtering for non-pcap network packet transports (i.e. tun/tap, and vde) to properly filter the desired packets.
This commit is contained in:
Mark Pizzolato
2011-10-31 11:51:19 -07:00
parent bfb6e54819
commit fd5de0d005
4 changed files with 1282 additions and 1095 deletions

View File

@@ -28,6 +28,7 @@
Modification history:
30-Oct-11 MP Added support for vde (Virtual Distributed Ethernet) networking
18-Apr-11 MP Fixed race condition with self loopback packets in
multithreaded environments
09-Dec-10 MP Added support to determine if network address conflicts exist
@@ -89,13 +90,13 @@
#if defined (USE_READER_THREAD)
#if defined (USE_SETNONBLOCK)
#undef USE_SETNONBLOCK
#endif
#endif /* USE_SETNONBLOCK */
#undef PCAP_READ_TIMEOUT
#define PCAP_READ_TIMEOUT 15
#if !defined (xBSD) && !defined(_WIN32) && !defined(VMS)
#define MUST_DO_SELECT
#endif
#if (!defined (xBSD) && !defined(_WIN32) && !defined(VMS)) || defined (USE_TAP_NETWORK) || defined (USE_VDE_NETWORK)
#define MUST_DO_SELECT 1
#endif
#endif /* USE_READER_THREAD */
/*
USE_BPF is defined to let this code leverage the libpcap/OS kernel provided
@@ -175,7 +176,10 @@ struct eth_device {
char* name; /* name of ethernet device */
void* handle; /* handle of implementation-specific device */
int fd_handle; /* fd to kernel device (where needed) */
int pcap_mode; /* Flag indicating if pcap API are being used to move packets */
int eth_api; /* Designator for which API is being used to move packets */
#define ETH_API_PCAP 0 /* Pcap API in use */
#define ETH_API_TAP 1 /* tun/tap API in use */
#define ETH_API_VDE 2 /* VDE API in use */
ETH_PCALLBACK read_callback; /* read callback function */
ETH_PCALLBACK write_callback; /* write callback function */
ETH_PACK* read_packet; /* read packet */