From 939c7c16a5add4443aebc37a55c2a33e4fccb8d0 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 3 Dec 2019 22:25:43 +0100 Subject: T1843: use include files for IPv4/IPv6 interface address configuration As 219779bc6151 ("T1843: run interface-definitions though GCC preprocessor") implemented the foundation of using the GCC preprocessor to make our XML definitions more lightweight this commit transforms the configuration of an IPv4/IPv6 address to this new style. It implementes it for the following interface types: * bond * bridge * dummy * ethernet * geneve * loopback * vxlan * wireguard * wireless --- .../include/address-ipv4-ipv6-dhcp.xml.i | 29 +++++++++++++++++++++ .../include/address-ipv4-ipv6.xml.i | 17 ++++++++++++ interface-definitions/interfaces-bonding.xml.in | 30 +--------------------- interface-definitions/interfaces-bridge.xml.in | 30 +--------------------- interface-definitions/interfaces-dummy.xml.in | 18 +------------ interface-definitions/interfaces-ethernet.xml.in | 30 +--------------------- interface-definitions/interfaces-geneve.xml.in | 18 +------------ interface-definitions/interfaces-loopback.xml.in | 15 +---------- interface-definitions/interfaces-vxlan.xml.in | 18 +------------ interface-definitions/interfaces-wireguard.xml.in | 18 +------------ interface-definitions/interfaces-wireless.xml.in | 30 +--------------------- 11 files changed, 55 insertions(+), 198 deletions(-) create mode 100644 interface-definitions/include/address-ipv4-ipv6-dhcp.xml.i create mode 100644 interface-definitions/include/address-ipv4-ipv6.xml.i diff --git a/interface-definitions/include/address-ipv4-ipv6-dhcp.xml.i b/interface-definitions/include/address-ipv4-ipv6-dhcp.xml.i new file mode 100644 index 000000000..fb46f2c09 --- /dev/null +++ b/interface-definitions/include/address-ipv4-ipv6-dhcp.xml.i @@ -0,0 +1,29 @@ + + + IP address + + dhcp dhcpv6 + + + ipv4net + IPv4 address and prefix length + + + ipv6net + IPv6 address and prefix length + + + dhcp + Dynamic Host Configuration Protocol + + + dhcpv6 + Dynamic Host Configuration Protocol for IPv6 + + + + (dhcp|dhcpv6) + + + + diff --git a/interface-definitions/include/address-ipv4-ipv6.xml.i b/interface-definitions/include/address-ipv4-ipv6.xml.i new file mode 100644 index 000000000..aa84a5640 --- /dev/null +++ b/interface-definitions/include/address-ipv4-ipv6.xml.i @@ -0,0 +1,17 @@ + + + IP address + + ipv4net + IPv4 address and prefix length + + + ipv6net + IPv6 address and prefix length + + + + + + + diff --git a/interface-definitions/interfaces-bonding.xml.in b/interface-definitions/interfaces-bonding.xml.in index 821dd15fa..12df69364 100644 --- a/interface-definitions/interfaces-bonding.xml.in +++ b/interface-definitions/interfaces-bonding.xml.in @@ -16,35 +16,7 @@ - - - IP address - - dhcp dhcpv6 - - - ipv4net - IPv4 address and prefix length - - - ipv6net - IPv6 address and prefix length - - - dhcp - Dynamic Host Configuration Protocol - - - dhcpv6 - Dynamic Host Configuration Protocol for IPv6 - - - - (dhcp|dhcpv6) - - - - + #include "include/address-ipv4-ipv6-dhcp.xml.i" ARP link monitoring parameters diff --git a/interface-definitions/interfaces-bridge.xml.in b/interface-definitions/interfaces-bridge.xml.in index 40505d7de..4dbfa7d91 100644 --- a/interface-definitions/interfaces-bridge.xml.in +++ b/interface-definitions/interfaces-bridge.xml.in @@ -16,35 +16,7 @@ - - - IP address - - dhcp dhcpv6 - - - ipv4net - IPv4 address and prefix length - - - ipv6net - IPv6 address and prefix length - - - dhcp - Dynamic Host Configuration Protocol - - - dhcpv6 - Dynamic Host Configuration Protocol for IPv6 - - - - (dhcp|dhcpv6) - - - - + #include "include/address-ipv4-ipv6-dhcp.xml.i" MAC address aging interval diff --git a/interface-definitions/interfaces-dummy.xml.in b/interface-definitions/interfaces-dummy.xml.in index 3bc4330e4..a253bfe81 100644 --- a/interface-definitions/interfaces-dummy.xml.in +++ b/interface-definitions/interfaces-dummy.xml.in @@ -16,23 +16,7 @@ - - - IP address - - ipv4net - IPv4 address and prefix length - - - ipv6net - IPv6 address and prefix length - - - - - - - + #include "include/address-ipv4-ipv6.xml.i" Interface description diff --git a/interface-definitions/interfaces-ethernet.xml.in b/interface-definitions/interfaces-ethernet.xml.in index 2c89c3604..92cfcd2c2 100644 --- a/interface-definitions/interfaces-ethernet.xml.in +++ b/interface-definitions/interfaces-ethernet.xml.in @@ -20,35 +20,7 @@ - - - IP address - - dhcp dhcpv6 - - - ipv4net - IPv4 address and prefix length - - - ipv6net - IPv6 address and prefix length - - - dhcp - Dynamic Host Configuration Protocol - - - dhcpv6 - Dynamic Host Configuration Protocol for IPv6 - - - - (dhcp|dhcpv6) - - - - + #include "include/address-ipv4-ipv6-dhcp.xml.i" Interface description diff --git a/interface-definitions/interfaces-geneve.xml.in b/interface-definitions/interfaces-geneve.xml.in index e65ce6826..7b27c46f3 100644 --- a/interface-definitions/interfaces-geneve.xml.in +++ b/interface-definitions/interfaces-geneve.xml.in @@ -16,23 +16,7 @@ - - - IP address - - ipv4net - IPv4 address and prefix length - - - ipv6net - IPv6 address and prefix length - - - - - - - + #include "include/address-ipv4-ipv6.xml.i" Interface description diff --git a/interface-definitions/interfaces-loopback.xml.in b/interface-definitions/interfaces-loopback.xml.in index 0f003bc64..074a5c7cb 100644 --- a/interface-definitions/interfaces-loopback.xml.in +++ b/interface-definitions/interfaces-loopback.xml.in @@ -16,20 +16,7 @@ - - - IP address - - ipv4net - IPv4 address and prefix length - - - ipv6net - IPv6 address and prefix length - - - - + #include "include/address-ipv4-ipv6.xml.i" Interface description diff --git a/interface-definitions/interfaces-vxlan.xml.in b/interface-definitions/interfaces-vxlan.xml.in index f93711741..7cc6cd35a 100644 --- a/interface-definitions/interfaces-vxlan.xml.in +++ b/interface-definitions/interfaces-vxlan.xml.in @@ -16,23 +16,7 @@ - - - IP address - - ipv4net - IPv4 address and prefix length - - - ipv6net - IPv6 address and prefix length - - - - - - - + #include "include/address-ipv4-ipv6.xml.i" Interface description diff --git a/interface-definitions/interfaces-wireguard.xml.in b/interface-definitions/interfaces-wireguard.xml.in index 0c32a3bc1..dd19d4ec0 100644 --- a/interface-definitions/interfaces-wireguard.xml.in +++ b/interface-definitions/interfaces-wireguard.xml.in @@ -17,23 +17,7 @@ - - - IP address - - - - - ipv4net - IPv4 address and prefix length - - - ipv6net - IPv6 address and prefix length - - - - + #include "include/address-ipv4-ipv6.xml.i" description diff --git a/interface-definitions/interfaces-wireless.xml.in b/interface-definitions/interfaces-wireless.xml.in index 6bc49dddb..d8779cf72 100644 --- a/interface-definitions/interfaces-wireless.xml.in +++ b/interface-definitions/interfaces-wireless.xml.in @@ -16,35 +16,7 @@ - - - IP address - - dhcp dhcpv6 - - - ipv4net - IPv4 address and prefix length - - - ipv6net - IPv6 address and prefix length - - - dhcp - Dynamic Host Configuration Protocol - - - dhcpv6 - Dynamic Host Configuration Protocol for IPv6 - - - - (dhcp|dhcpv6) - - - - + #include "include/address-ipv4-ipv6-dhcp.xml.i" HT and VHT capabilities for your card -- cgit v1.2.3