Network Switch support

Co-Authored-By: Alexander Babikov <2708460+lemondrops@users.noreply.github.com>
Co-Authored-By: cold-brewed <47337035+cold-brewed@users.noreply.github.com>
This commit is contained in:
Jasmine Iwanek
2025-06-26 20:53:17 -04:00
parent be8dc5f488
commit 2dc28d39b1
20 changed files with 6846 additions and 5 deletions

View File

@@ -48,11 +48,13 @@
#include <stdint.h>
/* Network provider types. */
#define NET_TYPE_NONE 0 /* use the null network driver */
#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_TYPE_NONE 0 /* use the null network driver */
#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_TYPE_NMSWITCH 5 /* use the network multicast switch provider */
#define NET_TYPE_NRSWITCH 6 /* use the network remote switch provider */
#define NET_MAX_FRAME 1518
/* Queue size must be a power of 2 */
@@ -96,6 +98,9 @@ typedef struct netcard_conf_t {
int net_type;
char host_dev_name[128];
uint32_t link_state;
uint8_t switch_group;
uint8_t promisc_mode;
char nrs_hostname[128];
} netcard_conf_t;
extern netcard_conf_t net_cards_conf[NET_CARD_MAX];
@@ -129,6 +134,7 @@ 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;
extern const netdrv_t net_netswitch_drv;
struct _netcard_t {
const device_t *device;
@@ -194,6 +200,7 @@ extern int network_dev_available(int);
extern int network_dev_to_id(char *);
extern int network_card_available(int);
extern int network_card_has_config(int);
extern int network_type_has_config(int);
extern const char *network_card_get_internal_name(int);
extern int network_card_get_from_internal_name(char *);
#ifdef EMU_DEVICE_H