diff --git a/src/config.c b/src/config.c index cedc617..17567c0 100644 --- a/src/config.c +++ b/src/config.c @@ -35,7 +35,8 @@ main_config_t get_main_config(void) HKEY reg = reg_open_main(false); DWORD version = reg_get_dword(reg, "config_version", 1); - config.single_iface = reg_get_dword(reg, "single_iface", true); + config.iface_mode = reg_get_dword(reg, "iface_mode", IFACE_MODE_ALL); + config.single_netnum = reg_get_addr32(reg, "single_netnum", addr32_in((unsigned char[]){0x00, 0x00, 0x00, 0x01})); config.single_nodenum = reg_get_addr48(reg, "single_nodenum", 0); @@ -90,7 +91,7 @@ bool set_main_config(const main_config_t *config) { HKEY reg = reg_open_main(true); - bool ok = reg_set_dword(reg, "single_iface", config->single_iface) + bool ok = reg_set_dword(reg, "iface_mode", config->iface_mode) && reg_set_addr32(reg, "single_netnum", config->single_netnum) && reg_set_addr48(reg, "single_nodenum", config->single_nodenum) diff --git a/src/config.h b/src/config.h index 7a53b54..3eb8a19 100644 --- a/src/config.h +++ b/src/config.h @@ -21,6 +21,26 @@ #define DEFAULT_PORT 54792 #define DEFAULT_ROUTER_PORT 54793 +/* IFACE_MODE_ALL + * + * Packets are sent/received on all interfaces and no source address filtering + * is performed. A single IPX interface is presented. + * + * IFACE_MODE_SINGLE + * + * Packets are sent/received on user-chosen interfaces. A single IPX interface + * is presented. + * + * IFACE_MODE_MULTI + * + * An IPX interface is presented for each (enabled) real interface and packets + * are sent or received on the single underlying interface of the IPX one. +*/ + +#define IFACE_MODE_ALL 1 +#define IFACE_MODE_SINGLE 2 +#define IFACE_MODE_MULTI 3 + #include "common.h" #ifdef __cplusplus @@ -37,7 +57,8 @@ typedef struct main_config { enum ipx_log_level log_level; - bool single_iface; + int iface_mode; + addr32_t single_netnum; addr48_t single_nodenum; } main_config_t;