Merge pull request #3521 from dougvj/net-add-tap-backend

networking: add Linux-specific TAP mode to network devices
This commit is contained in:
Jasmine Iwanek
2025-06-27 19:33:42 -04:00
committed by GitHub
9 changed files with 468 additions and 13 deletions

View File

@@ -52,6 +52,7 @@
#define NET_TYPE_SLIRP 1 /* use the SLiRP port forwarder */
#define NET_TYPE_PCAP 2 /* use the (Win)Pcap API */
#define NET_TYPE_VDE 3 /* use the VDE plug API */
#define NET_TYPE_TAP 4 /* use a linux TAP device */
#define NET_MAX_FRAME 1518
/* Queue size must be a power of 2 */
@@ -126,6 +127,7 @@ typedef struct netdrv_t {
extern const netdrv_t net_pcap_drv;
extern const netdrv_t net_slirp_drv;
extern const netdrv_t net_vde_drv;
extern const netdrv_t net_tap_drv;
extern const netdrv_t net_null_drv;
struct _netcard_t {
@@ -155,10 +157,11 @@ typedef struct {
int has_slirp;
int has_pcap;
int has_vde;
int has_tap;
} network_devmap_t;
#define HAS_NOSLIRP_NET(x) (x.has_pcap || x.has_vde)
#define HAS_NOSLIRP_NET(x) (x.has_pcap || x.has_vde || x.has_tap)
#ifdef __cplusplus
extern "C" {