11 attrsToSection = systemdUtils.lib.attrsToSection;
12 commonMatchText = def:
13 optionalString (def.matchConfig != { }) ''
15 ${attrsToSection def.matchConfig}
19 commonMatchText def + ''
21 ${attrsToSection def.linkConfig}
25 commonMatchText def + ''
27 ${attrsToSection def.netdevConfig}
28 '' + optionalString (def.bridgeConfig != { }) ''
30 ${attrsToSection def.bridgeConfig}
31 '' + optionalString (def.vlanConfig != { }) ''
33 ${attrsToSection def.vlanConfig}
34 '' + optionalString (def.ipvlanConfig != { }) ''
36 ${attrsToSection def.ipvlanConfig}
37 '' + optionalString (def.ipvtapConfig != { }) ''
39 ${attrsToSection def.ipvtapConfig}
40 '' + optionalString (def.macvlanConfig != { }) ''
42 ${attrsToSection def.macvlanConfig}
43 '' + optionalString (def.vxlanConfig != { }) ''
45 ${attrsToSection def.vxlanConfig}
46 '' + optionalString (def.tunnelConfig != { }) ''
48 ${attrsToSection def.tunnelConfig}
49 '' + optionalString (def.fooOverUDPConfig != { }) ''
51 ${attrsToSection def.fooOverUDPConfig}
52 '' + optionalString (def.peerConfig != { }) ''
54 ${attrsToSection def.peerConfig}
55 '' + optionalString (def.tunConfig != { }) ''
57 ${attrsToSection def.tunConfig}
58 '' + optionalString (def.tapConfig != { }) ''
60 ${attrsToSection def.tapConfig}
61 '' + optionalString (def.l2tpConfig != { }) ''
63 ${attrsToSection def.l2tpConfig}
64 '' + flip concatMapStrings def.l2tpSessions (x: ''
67 '') + optionalString (def.wireguardConfig != { }) ''
69 ${attrsToSection def.wireguardConfig}
70 '' + flip concatMapStrings def.wireguardPeers (x: ''
73 '') + optionalString (def.bondConfig != { }) ''
75 ${attrsToSection def.bondConfig}
76 '' + optionalString (def.xfrmConfig != { }) ''
78 ${attrsToSection def.xfrmConfig}
79 '' + optionalString (def.vrfConfig != { }) ''
81 ${attrsToSection def.vrfConfig}
82 '' + optionalString (def.wlanConfig != { }) ''
84 ${attrsToSection def.wlanConfig}
85 '' + optionalString (def.batmanAdvancedConfig != { }) ''
87 ${attrsToSection def.batmanAdvancedConfig}
91 commonMatchText def + optionalString (def.linkConfig != { }) ''
93 ${attrsToSection def.linkConfig}
96 '' + attrsToSection def.networkConfig
97 + optionalString (def.address != [ ]) ''
98 ${concatStringsSep "\n" (map (s: "Address=${s}") def.address)}
99 '' + optionalString (def.gateway != [ ]) ''
100 ${concatStringsSep "\n" (map (s: "Gateway=${s}") def.gateway)}
101 '' + optionalString (def.dns != [ ]) ''
102 ${concatStringsSep "\n" (map (s: "DNS=${s}") def.dns)}
103 '' + optionalString (def.ntp != [ ]) ''
104 ${concatStringsSep "\n" (map (s: "NTP=${s}") def.ntp)}
105 '' + optionalString (def.bridge != [ ]) ''
106 ${concatStringsSep "\n" (map (s: "Bridge=${s}") def.bridge)}
107 '' + optionalString (def.bond != [ ]) ''
108 ${concatStringsSep "\n" (map (s: "Bond=${s}") def.bond)}
109 '' + optionalString (def.vrf != [ ]) ''
110 ${concatStringsSep "\n" (map (s: "VRF=${s}") def.vrf)}
111 '' + optionalString (def.vlan != [ ]) ''
112 ${concatStringsSep "\n" (map (s: "VLAN=${s}") def.vlan)}
113 '' + optionalString (def.macvlan != [ ]) ''
114 ${concatStringsSep "\n" (map (s: "MACVLAN=${s}") def.macvlan)}
115 '' + optionalString (def.macvtap != [ ]) ''
116 ${concatStringsSep "\n" (map (s: "MACVTAP=${s}") def.macvtap)}
117 '' + optionalString (def.vxlan != [ ]) ''
118 ${concatStringsSep "\n" (map (s: "VXLAN=${s}") def.vxlan)}
119 '' + optionalString (def.tunnel != [ ]) ''
120 ${concatStringsSep "\n" (map (s: "Tunnel=${s}") def.tunnel)}
121 '' + optionalString (def.xfrm != [ ]) ''
122 ${concatStringsSep "\n" (map (s: "Xfrm=${s}") def.xfrm)}
123 '' + "\n" + flip concatMapStrings def.addresses (x: ''
126 '') + flip concatMapStrings def.routingPolicyRules (x: ''
129 '') + flip concatMapStrings def.routes (x: ''
132 '') + optionalString (def.dhcpV4Config != { }) ''
134 ${attrsToSection def.dhcpV4Config}
135 '' + optionalString (def.dhcpV6Config != { }) ''
137 ${attrsToSection def.dhcpV6Config}
138 '' + optionalString (def.dhcpPrefixDelegationConfig != { }) ''
139 [DHCPPrefixDelegation]
140 ${attrsToSection def.dhcpPrefixDelegationConfig}
141 '' + optionalString (def.ipv6AcceptRAConfig != { }) ''
143 ${attrsToSection def.ipv6AcceptRAConfig}
144 '' + optionalString (def.dhcpServerConfig != { }) ''
146 ${attrsToSection def.dhcpServerConfig}
147 '' + optionalString (def.ipv6SendRAConfig != { }) ''
149 ${attrsToSection def.ipv6SendRAConfig}
150 '' + flip concatMapStrings def.ipv6PREF64Prefixes (x: ''
153 '') + flip concatMapStrings def.ipv6Prefixes (x: ''
156 '') + flip concatMapStrings def.ipv6RoutePrefixes (x: ''
159 '') + flip concatMapStrings def.dhcpServerStaticLeases (x: ''
160 [DHCPServerStaticLease]
162 '') + optionalString (def.bridgeConfig != { }) ''
164 ${attrsToSection def.bridgeConfig}
165 '' + flip concatMapStrings def.bridgeFDBs (x: ''
168 '') + flip concatMapStrings def.bridgeMDBs (x: ''
171 '') + optionalString (def.lldpConfig != { }) ''
173 ${attrsToSection def.lldpConfig}
174 '' + optionalString (def.canConfig != { }) ''
176 ${attrsToSection def.canConfig}
177 '' + optionalString (def.ipoIBConfig != { }) ''
179 ${attrsToSection def.ipoIBConfig}
180 '' + optionalString (def.qdiscConfig != { }) ''
182 ${attrsToSection def.qdiscConfig}
183 '' + optionalString (def.networkEmulatorConfig != { }) ''
185 ${attrsToSection def.networkEmulatorConfig}
186 '' + optionalString (def.tokenBucketFilterConfig != { }) ''
188 ${attrsToSection def.tokenBucketFilterConfig}
189 '' + optionalString (def.pieConfig != { }) ''
191 ${attrsToSection def.pieConfig}
192 '' + optionalString (def.flowQueuePIEConfig != { }) ''
194 ${attrsToSection def.flowQueuePIEConfig}
195 '' + optionalString (def.stochasticFairBlueConfig != { }) ''
197 ${attrsToSection def.stochasticFairBlueConfig}
198 '' + optionalString (def.stochasticFairnessQueueingConfig != { }) ''
199 [StochasticFairnessQueueing]
200 ${attrsToSection def.stochasticFairnessQueueingConfig}
201 '' + optionalString (def.bfifoConfig != { }) ''
203 ${attrsToSection def.bfifoConfig}
204 '' + optionalString (def.pfifoConfig != { }) ''
206 ${attrsToSection def.pfifoConfig}
207 '' + optionalString (def.pfifoHeadDropConfig != { }) ''
209 ${attrsToSection def.pfifoHeadDropConfig}
210 '' + optionalString (def.pfifoFastConfig != { }) ''
212 ${attrsToSection def.pfifoFastConfig}
213 '' + optionalString (def.cakeConfig != { }) ''
215 ${attrsToSection def.cakeConfig}
216 '' + optionalString (def.controlledDelayConfig != { }) ''
218 ${attrsToSection def.controlledDelayConfig}
219 '' + optionalString (def.deficitRoundRobinSchedulerConfig != { }) ''
220 [DeficitRoundRobinScheduler]
221 ${attrsToSection def.deficitRoundRobinSchedulerConfig}
222 '' + optionalString (def.deficitRoundRobinSchedulerClassConfig != { }) ''
223 [DeficitRoundRobinSchedulerClass]
224 ${attrsToSection def.deficitRoundRobinSchedulerClassConfig}
225 '' + optionalString (def.enhancedTransmissionSelectionConfig != { }) ''
226 [EnhancedTransmissionSelection]
227 ${attrsToSection def.enhancedTransmissionSelectionConfig}
228 '' + optionalString (def.genericRandomEarlyDetectionConfig != { }) ''
229 [GenericRandomEarlyDetection]
230 ${attrsToSection def.genericRandomEarlyDetectionConfig}
231 '' + optionalString (def.fairQueueingControlledDelayConfig != { }) ''
232 [FairQueueingControlledDelay]
233 ${attrsToSection def.fairQueueingControlledDelayConfig}
234 '' + optionalString (def.fairQueueingConfig != { }) ''
236 ${attrsToSection def.fairQueueingConfig}
237 '' + optionalString (def.trivialLinkEqualizerConfig != { }) ''
238 [TrivialLinkEqualizer]
239 ${attrsToSection def.trivialLinkEqualizerConfig}
240 '' + optionalString (def.hierarchyTokenBucketConfig != { }) ''
241 [HierarchyTokenBucket]
242 ${attrsToSection def.hierarchyTokenBucketConfig}
243 '' + optionalString (def.hierarchyTokenBucketClassConfig != { }) ''
244 [HierarchyTokenBucketClass]
245 ${attrsToSection def.hierarchyTokenBucketClassConfig}
246 '' + optionalString (def.heavyHitterFilterConfig != { }) ''
248 ${attrsToSection def.heavyHitterFilterConfig}
249 '' + optionalString (def.quickFairQueueingConfig != { }) ''
251 ${attrsToSection def.quickFairQueueingConfig}
252 '' + optionalString (def.quickFairQueueingConfigClass != { }) ''
253 [QuickFairQueueingClass]
254 ${attrsToSection def.quickFairQueueingConfigClass}
255 '' + flip concatMapStrings def.bridgeVLANs (x: ''
258 '') + def.extraConfig;