···
(assertValueOneOf "Kind" [
"bond" "bridge" "dummy" "gre" "gretap" "ip6gre" "ip6tnl" "ip6gretap" "ipip"
"ipvlan" "macvlan" "macvtap" "sit" "tap" "tun" "veth" "vlan" "vti" "vti6"
52
-
"vxlan" "geneve" "vrf" "vcan" "vxcan" "wireguard" "netdevsim"
52
+
"vxlan" "geneve" "vrf" "vcan" "vxcan" "wireguard" "netdevsim" "xfrm"
(assertByteFormat "MTUBytes")
(assertMacAddress "MACAddress")
···
(assertValueOneOf "AllSlavesActive" boolValues)
175
+
checkXfrm = checkUnitConfig "Xfrm" [
176
+
(assertOnlyFields [
177
+
"InterfaceId" "Independent"
179
+
(assertRange "InterfaceId" 1 4294967295)
180
+
(assertValueOneOf "Independent" boolValues)
checkNetwork = checkUnitConfig "Network" [
"Description" "DHCP" "DHCPServer" "LinkLocalAddressing" "IPv4LLRoute"
···
"IPv6HopLimit" "IPv4ProxyARP" "IPv6ProxyNDP" "IPv6ProxyNDPAddress"
"IPv6PrefixDelegation" "IPv6MTUBytes" "Bridge" "Bond" "VRF" "VLAN"
"IPVLAN" "MACVLAN" "VXLAN" "Tunnel" "ActiveSlave" "PrimarySlave"
185
-
"ConfigureWithoutCarrier"
193
+
"ConfigureWithoutCarrier" "Xfrm"
# Note: For DHCP the values both, none, v4, v6 are deprecated
(assertValueOneOf "DHCP" ["yes" "no" "ipv4" "ipv6" "both" "none" "v4" "v6"])
···
488
+
xfrmConfig = mkOption {
490
+
example = { InterfaceId = 1; };
491
+
type = types.addCheck (types.attrsOf unitOption) checkXfrm;
493
+
Each attribute in this set specifies an option in the
494
+
<literal>[Xfrm]</literal> section of the unit. See
495
+
<citerefentry><refentrytitle>systemd.netdev</refentrytitle>
496
+
<manvolnum>5</manvolnum></citerefentry> for details.
···
737
+
type = types.listOf types.str;
739
+
A list of xfrm interfaces to be added to the network section of the
740
+
unit. See <citerefentry><refentrytitle>systemd.network</refentrytitle>
741
+
<manvolnum>5</manvolnum></citerefentry> for details.
type = with types; listOf (submodule addressOptions);
···
${attrsToSection def.bondConfig}
843
+
${optionalString (def.xfrmConfig != { }) ''
845
+
${attrsToSection def.xfrmConfig}
${optionalString (def.wireguardConfig != { }) ''
${attrsToSection def.wireguardConfig}
···
${concatStringsSep "\n" (map (s: "MACVLAN=${s}") def.macvlan)}
${concatStringsSep "\n" (map (s: "VXLAN=${s}") def.vxlan)}
${concatStringsSep "\n" (map (s: "Tunnel=${s}") def.tunnel)}
885
+
${concatStringsSep "\n" (map (s: "Xfrm=${s}") def.xfrm)}
${optionalString (def.dhcpConfig != { }) ''