From 443757313e0f2c4da58cf25009e2964026043957 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Thu, 27 Apr 2017 13:57:28 +1000 Subject: rc_conf: Add support for ifconfig__alias[0-9]+. The interface alias allows extra IP addresses to be set on and interface and it also allows the MAC address to be set. Examples: ifconfig_em0="inet 10.10.5.33 netmask 255.255.255.0" ifconfig_em0_alias0="ether 10:22:33:44:55:66" ifconfig_em0_alias1="inet 10.1.1.111 netmask 0xffffffff" --- testsuite/rcconf02/test_main.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'testsuite/rcconf02') diff --git a/testsuite/rcconf02/test_main.c b/testsuite/rcconf02/test_main.c index 0b7c6d17..ad177d25 100644 --- a/testsuite/rcconf02/test_main.c +++ b/testsuite/rcconf02/test_main.c @@ -75,8 +75,11 @@ #define IFACE_IPV4(iface) \ "ifconfig_" # iface "=\"inet " NET_CFG_SELF_IP " netmask " NET_CFG_NETMASK "\"\n" +#define IFACE_ALIAS(iface) \ + "ifconfig_" # iface "_alias0=\"ether 10:22:33:44:55:66\"\n" \ + "ifconfig_" # iface "_alias1=\"inet 10.1.1.111 netmask 0xffffffff\"\n" -#define RC_CONF_IFACES \ +#define RC_CONF_IFACES_IPV4 \ IFACE_IPV4(dmc0) \ IFACE_IPV4(sm0) \ IFACE_IPV4(cgem0) \ @@ -84,6 +87,18 @@ IFACE_IPV4(em0) \ IFACE_IPV4(re0) +#define RC_CONF_IFACES_ALIAS \ + IFACE_ALIAS(dmc0) \ + IFACE_ALIAS(sm0) \ + IFACE_ALIAS(cgem0) \ + IFACE_ALIAS(fec0) \ + IFACE_ALIAS(em0) \ + IFACE_ALIAS(re0) + +#define RC_CONF_IFACES \ + RC_CONF_IFACES_IPV4 \ + RC_CONF_IFACES_ALIAS + #define IFACE_VLAN(iface) \ "vlans_" # iface "=\"101 102\"\n" \ "ifconfig_" # iface "_101=\"inet 192.0.101.1/24\"\n" \ -- cgit v1.2.3