networking: add Linux-specific TAP mode to network interface

This addition was motivated by my lack of knowledge of VDE and my
familiarity with the Linux networking stack. The driver automatically
manages the creation of TAP devices and their association with bridges,
such that configurations which specify the same bridge will be connected
together. It also automatically handles the creation of bridge devices for
convenience's sake.
This commit is contained in:
Doug Johnson
2023-08-06 20:11:36 -06:00
parent 80f5c47221
commit 45bcbc75fd
8 changed files with 463 additions and 18 deletions

View File

@@ -480,6 +480,12 @@ network_attach(void *card_drv, uint8_t *mac, NETRXCB rx, NETSETLINKSTATE set_lin
card->host_drv = net_vde_drv;
card->host_drv.priv = card->host_drv.init(card, mac, net_cards_conf[net_card_current].host_dev_name, net_drv_error);
break;
#endif
#ifdef HAS_TAP
case NET_TYPE_TAP:
card->host_drv = net_tap_drv;
card->host_drv.priv = card->host_drv.init(card, mac, net_cards_conf[net_card_current].host_dev_name, net_drv_error);
break;
#endif
default:
card->host_drv.priv = NULL;