From 988d199afab534ea284232893944e69b22e6d8cd Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 22 May 2026 16:00:32 -0700 Subject: [PATCH] ethernet: add TAP and TUN backend slots Extend the shared Ethernet backend enumeration with TAP and TUN slots that Unix targets can implement. --- ethernet.cpp | 10 ++++++++++ include/ethernet.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/ethernet.cpp b/ethernet.cpp index 55f6e618..83ceda33 100644 --- a/ethernet.cpp +++ b/ethernet.cpp @@ -99,6 +99,8 @@ void ethernet_trigger (struct netdriverdata *ndd, void *vsd) #endif #ifdef WITH_UAENET_PCAP case UAENET_PCAP: + case UAENET_TAP: + case UAENET_TUN: uaenet_trigger (vsd); return; #endif @@ -160,6 +162,8 @@ int ethernet_open (struct netdriverdata *ndd, void *vsd, void *user, ethernet_go #endif #ifdef WITH_UAENET_PCAP case UAENET_PCAP: + case UAENET_TAP: + case UAENET_TUN: if (uaenet_open (vsd, ndd, user, gotfunc, getfunc, promiscuous, mac)) { netmode = ndd->type; return 1; @@ -190,6 +194,8 @@ void ethernet_close (struct netdriverdata *ndd, void *vsd) #endif #ifdef WITH_UAENET_PCAP case UAENET_PCAP: + case UAENET_TAP: + case UAENET_TUN: return uaenet_close (vsd); #endif } @@ -257,6 +263,8 @@ void ethernet_close_driver (struct netdriverdata *ndd) return; #ifdef WITH_UAENET_PCAP case UAENET_PCAP: + case UAENET_TAP: + case UAENET_TUN: return uaenet_close_driver (ndd); #endif } @@ -272,6 +280,8 @@ int ethernet_getdatalenght (struct netdriverdata *ndd) return sizeof (struct ethernet_data); #ifdef WITH_UAENET_PCAP case UAENET_PCAP: + case UAENET_TAP: + case UAENET_TUN: return uaenet_getdatalenght (); #endif } diff --git a/include/ethernet.h b/include/ethernet.h index 03488737..927dc53b 100644 --- a/include/ethernet.h +++ b/include/ethernet.h @@ -7,6 +7,8 @@ #define UAENET_SLIRP 1 #define UAENET_SLIRP_INBOUND 2 #define UAENET_PCAP 3 +#define UAENET_TAP 4 +#define UAENET_TUN 5 struct netdriverdata { -- 2.47.3