6 attrsToSection = systemdUtils.lib.attrsToSection;
8 optionalString (def.matchConfig != { }) ''
10 ${attrsToSection def.matchConfig}
14 commonMatchText def + ''
16 ${attrsToSection def.linkConfig}
20 commonMatchText def + ''
22 ${attrsToSection def.netdevConfig}
23 '' + optionalString (def.vlanConfig != { }) ''
25 ${attrsToSection def.vlanConfig}
26 '' + optionalString (def.ipvlanConfig != { }) ''
28 ${attrsToSection def.ipvlanConfig}
29 '' + optionalString (def.ipvtapConfig != { }) ''
31 ${attrsToSection def.ipvtapConfig}
32 '' + optionalString (def.macvlanConfig != { }) ''
34 ${attrsToSection def.macvlanConfig}
35 '' + optionalString (def.vxlanConfig != { }) ''
37 ${attrsToSection def.vxlanConfig}
38 '' + optionalString (def.tunnelConfig != { }) ''
40 ${attrsToSection def.tunnelConfig}
41 '' + optionalString (def.fooOverUDPConfig != { }) ''
43 ${attrsToSection def.fooOverUDPConfig}
44 '' + optionalString (def.peerConfig != { }) ''
46 ${attrsToSection def.peerConfig}
47 '' + optionalString (def.tunConfig != { }) ''
49 ${attrsToSection def.tunConfig}
50 '' + optionalString (def.tapConfig != { }) ''
52 ${attrsToSection def.tapConfig}
53 '' + optionalString (def.l2tpConfig != { }) ''
55 ${attrsToSection def.l2tpConfig}
56 '' + flip concatMapStrings def.l2tpSessions (x: ''
58 ${attrsToSection x.l2tpSessionConfig}
59 '') + optionalString (def.wireguardConfig != { }) ''
61 ${attrsToSection def.wireguardConfig}
62 '' + flip concatMapStrings def.wireguardPeers (x: ''
64 ${attrsToSection x.wireguardPeerConfig}
65 '') + optionalString (def.bondConfig != { }) ''
67 ${attrsToSection def.bondConfig}
68 '' + optionalString (def.xfrmConfig != { }) ''
70 ${attrsToSection def.xfrmConfig}
71 '' + optionalString (def.vrfConfig != { }) ''
73 ${attrsToSection def.vrfConfig}
74 '' + optionalString (def.wlanConfig != { }) ''
76 ${attrsToSection def.wlanConfig}
77 '' + optionalString (def.batmanAdvancedConfig != { }) ''
79 ${attrsToSection def.batmanAdvancedConfig}
83 commonMatchText def + optionalString (def.linkConfig != { }) ''
85 ${attrsToSection def.linkConfig}
88 '' + attrsToSection def.networkConfig
89 + optionalString (def.address != [ ]) ''
90 ${concatStringsSep "\n" (map (s: "Address=${s}") def.address)}
91 '' + optionalString (def.gateway != [ ]) ''
92 ${concatStringsSep "\n" (map (s: "Gateway=${s}") def.gateway)}
93 '' + optionalString (def.dns != [ ]) ''
94 ${concatStringsSep "\n" (map (s: "DNS=${s}") def.dns)}
95 '' + optionalString (def.ntp != [ ]) ''
96 ${concatStringsSep "\n" (map (s: "NTP=${s}") def.ntp)}
97 '' + optionalString (def.bridge != [ ]) ''
98 ${concatStringsSep "\n" (map (s: "Bridge=${s}") def.bridge)}
99 '' + optionalString (def.bond != [ ]) ''
100 ${concatStringsSep "\n" (map (s: "Bond=${s}") def.bond)}
101 '' + optionalString (def.vrf != [ ]) ''
102 ${concatStringsSep "\n" (map (s: "VRF=${s}") def.vrf)}
103 '' + optionalString (def.vlan != [ ]) ''
104 ${concatStringsSep "\n" (map (s: "VLAN=${s}") def.vlan)}
105 '' + optionalString (def.macvlan != [ ]) ''
106 ${concatStringsSep "\n" (map (s: "MACVLAN=${s}") def.macvlan)}
107 '' + optionalString (def.macvtap != [ ]) ''
108 ${concatStringsSep "\n" (map (s: "MACVTAP=${s}") def.macvtap)}
109 '' + optionalString (def.vxlan != [ ]) ''
110 ${concatStringsSep "\n" (map (s: "VXLAN=${s}") def.vxlan)}
111 '' + optionalString (def.tunnel != [ ]) ''
112 ${concatStringsSep "\n" (map (s: "Tunnel=${s}") def.tunnel)}
113 '' + optionalString (def.xfrm != [ ]) ''
114 ${concatStringsSep "\n" (map (s: "Xfrm=${s}") def.xfrm)}
115 '' + "\n" + flip concatMapStrings def.addresses (x: ''
117 ${attrsToSection x.addressConfig}
118 '') + flip concatMapStrings def.routingPolicyRules (x: ''
120 ${attrsToSection x.routingPolicyRuleConfig}
121 '') + flip concatMapStrings def.routes (x: ''
123 ${attrsToSection x.routeConfig}
124 '') + optionalString (def.dhcpV4Config != { }) ''
126 ${attrsToSection def.dhcpV4Config}
127 '' + optionalString (def.dhcpV6Config != { }) ''
129 ${attrsToSection def.dhcpV6Config}
130 '' + optionalString (def.dhcpPrefixDelegationConfig != { }) ''
131 [DHCPPrefixDelegation]
132 ${attrsToSection def.dhcpPrefixDelegationConfig}
133 '' + optionalString (def.ipv6AcceptRAConfig != { }) ''
135 ${attrsToSection def.ipv6AcceptRAConfig}
136 '' + optionalString (def.dhcpServerConfig != { }) ''
138 ${attrsToSection def.dhcpServerConfig}
139 '' + optionalString (def.ipv6SendRAConfig != { }) ''
141 ${attrsToSection def.ipv6SendRAConfig}
142 '' + flip concatMapStrings def.ipv6Prefixes (x: ''
144 ${attrsToSection x.ipv6PrefixConfig}
145 '') + flip concatMapStrings def.ipv6RoutePrefixes (x: ''
147 ${attrsToSection x.ipv6RoutePrefixConfig}
148 '') + flip concatMapStrings def.dhcpServerStaticLeases (x: ''
149 [DHCPServerStaticLease]
150 ${attrsToSection x.dhcpServerStaticLeaseConfig}
151 '') + optionalString (def.bridgeConfig != { }) ''
153 ${attrsToSection def.bridgeConfig}
154 '' + flip concatMapStrings def.bridgeFDBs (x: ''
156 ${attrsToSection x.bridgeFDBConfig}
157 '') + flip concatMapStrings def.bridgeMDBs (x: ''
159 ${attrsToSection x.bridgeMDBConfig}
160 '') + optionalString (def.lldpConfig != { }) ''
162 ${attrsToSection def.lldpConfig}
163 '' + optionalString (def.canConfig != { }) ''
165 ${attrsToSection def.canConfig}
166 '' + optionalString (def.ipoIBConfig != { }) ''
168 ${attrsToSection def.ipoIBConfig}
169 '' + optionalString (def.qdiscConfig != { }) ''
171 ${attrsToSection def.qdiscConfig}
172 '' + optionalString (def.networkEmulatorConfig != { }) ''
174 ${attrsToSection def.networkEmulatorConfig}
175 '' + optionalString (def.tokenBucketFilterConfig != { }) ''
177 ${attrsToSection def.tokenBucketFilterConfig}
178 '' + optionalString (def.pieConfig != { }) ''
180 ${attrsToSection def.pieConfig}
181 '' + optionalString (def.flowQueuePIEConfig != { }) ''
183 ${attrsToSection def.flowQueuePIEConfig}
184 '' + optionalString (def.stochasticFairBlueConfig != { }) ''
186 ${attrsToSection def.stochasticFairBlueConfig}
187 '' + optionalString (def.stochasticFairnessQueueingConfig != { }) ''
188 [StochasticFairnessQueueing]
189 ${attrsToSection def.stochasticFairnessQueueingConfig}
190 '' + optionalString (def.bfifoConfig != { }) ''
192 ${attrsToSection def.bfifoConfig}
193 '' + optionalString (def.pfifoConfig != { }) ''
195 ${attrsToSection def.pfifoConfig}
196 '' + optionalString (def.pfifoHeadDropConfig != { }) ''
198 ${attrsToSection def.pfifoHeadDropConfig}
199 '' + optionalString (def.pfifoFastConfig != { }) ''
201 ${attrsToSection def.pfifoFastConfig}
202 '' + optionalString (def.cakeConfig != { }) ''
204 ${attrsToSection def.cakeConfig}
205 '' + optionalString (def.controlledDelayConfig != { }) ''
207 ${attrsToSection def.controlledDelayConfig}
208 '' + optionalString (def.deficitRoundRobinSchedulerConfig != { }) ''
209 [DeficitRoundRobinScheduler]
210 ${attrsToSection def.deficitRoundRobinSchedulerConfig}
211 '' + optionalString (def.deficitRoundRobinSchedulerClassConfig != { }) ''
212 [DeficitRoundRobinSchedulerClass]
213 ${attrsToSection def.deficitRoundRobinSchedulerClassConfig}
214 '' + optionalString (def.enhancedTransmissionSelectionConfig != { }) ''
215 [EnhancedTransmissionSelection]
216 ${attrsToSection def.enhancedTransmissionSelectionConfig}
217 '' + optionalString (def.genericRandomEarlyDetectionConfig != { }) ''
218 [GenericRandomEarlyDetection]
219 ${attrsToSection def.genericRandomEarlyDetectionConfig}
220 '' + optionalString (def.fairQueueingControlledDelayConfig != { }) ''
221 [FairQueueingControlledDelay]
222 ${attrsToSection def.fairQueueingControlledDelayConfig}
223 '' + optionalString (def.fairQueueingConfig != { }) ''
225 ${attrsToSection def.fairQueueingConfig}
226 '' + optionalString (def.trivialLinkEqualizerConfig != { }) ''
227 [TrivialLinkEqualizer]
228 ${attrsToSection def.trivialLinkEqualizerConfig}
229 '' + optionalString (def.hierarchyTokenBucketConfig != { }) ''
230 [HierarchyTokenBucket]
231 ${attrsToSection def.hierarchyTokenBucketConfig}
232 '' + optionalString (def.hierarchyTokenBucketClassConfig != { }) ''
233 [HierarchyTokenBucketClass]
234 ${attrsToSection def.hierarchyTokenBucketClassConfig}
235 '' + optionalString (def.heavyHitterFilterConfig != { }) ''
237 ${attrsToSection def.heavyHitterFilterConfig}
238 '' + optionalString (def.quickFairQueueingConfig != { }) ''
240 ${attrsToSection def.quickFairQueueingConfig}
241 '' + optionalString (def.quickFairQueueingConfigClass != { }) ''
242 [QuickFairQueueingClass]
243 ${attrsToSection def.quickFairQueueingConfigClass}
244 '' + flip concatMapStrings def.bridgeVLANs (x: ''
246 ${attrsToSection x.bridgeVLANConfig}
247 '') + def.extraConfig;