]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
ethernet: add TAP and TUN backend slots
authorStefan Reinauer <stefan.reinauer@coreboot.org>
Fri, 22 May 2026 23:00:32 +0000 (16:00 -0700)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Tue, 2 Jun 2026 23:01:53 +0000 (16:01 -0700)
Extend the shared Ethernet backend enumeration with TAP and TUN slots
that Unix targets can implement.

ethernet.cpp
include/ethernet.h

index 55f6e618d41f5f1bf3f93e73dc9bdb1365a0c54f..83ceda3300c7817cd9a02a595822d05b22c61ce6 100644 (file)
@@ -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
        }
index 03488737935dbe4687dfff7e6c36a496d690fb27..927dc53b3ff9c361f9b2c6660f95644e8459b2cc 100644 (file)
@@ -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
 {