nm_rs/auto/
setting_ip6_config.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir
3// from gtk-girs (https://github.com/gtk-rs/gir-files)
4// DO NOT EDIT
5
6#[cfg(feature = "v1_2")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
8use crate::SettingIP6ConfigAddrGenMode;
9#[cfg(feature = "v1_42")]
10#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
11use crate::Ternary;
12use crate::{IPAddress, IPRoute, Setting, SettingIP6ConfigPrivacy, SettingIPConfig, ffi};
13use glib::{
14    prelude::*,
15    signal::{SignalHandlerId, connect_raw},
16    translate::*,
17};
18use std::boxed::Box as Box_;
19
20glib::wrapper! {
21    /// IPv6 Settings
22    ///
23    /// ## Properties
24    ///
25    ///
26    /// #### `addr-gen-mode`
27    ///  Configure the method for creating the IPv6 interface identifier of
28    /// addresses for RFC4862 IPv6 Stateless Address Autoconfiguration and IPv6
29    /// Link Local.
30    ///
31    /// The permitted values are: [`SettingIP6ConfigAddrGenMode::Eui64`][crate::SettingIP6ConfigAddrGenMode::Eui64],
32    /// [`SettingIP6ConfigAddrGenMode::StablePrivacy`][crate::SettingIP6ConfigAddrGenMode::StablePrivacy].
33    /// [`SettingIP6ConfigAddrGenMode::DefaultOrEui64`][crate::SettingIP6ConfigAddrGenMode::DefaultOrEui64] or
34    /// [`SettingIP6ConfigAddrGenMode::Default`][crate::SettingIP6ConfigAddrGenMode::Default].
35    ///
36    /// If the property is set to "eui64", the addresses will be generated using
37    /// the interface token derived from the hardware address. This makes the
38    /// host part of the address constant, making it possible to track the
39    /// host's presence when it changes networks. The address changes when the
40    /// interface hardware is replaced. If a duplicate address is detected,
41    /// there is no fallback to generate another address. When configured, the
42    /// "ipv6.token" is used instead of the MAC address to generate addresses
43    /// for stateless autoconfiguration.
44    ///
45    /// If the property is set to "stable-privacy", the interface identifier is
46    /// generated as specified by RFC7217. This works by hashing a host specific
47    /// key (see NetworkManager(8) manual), the interface name, the connection's
48    /// "connection.stable-id" property and the address prefix.  This improves
49    /// privacy by making it harder to use the address to track the host's
50    /// presence as every prefix and network has a different identifier. Also,
51    /// the address is stable when the network interface hardware is replaced.
52    ///
53    /// The special values "default" and "default-or-eui64" will fallback to the
54    /// global connection default as documented in the NetworkManager.conf(5)
55    /// manual. If the global default is not specified, the fallback value is
56    /// "stable-privacy" or "eui64", respectively.
57    ///
58    /// For libnm, the property defaults to "default" since 1.40.  Previously it
59    /// used to default to "stable-privacy".  On D-Bus, the absence of an
60    /// addr-gen-mode setting equals "default". For keyfile plugin, the absence
61    /// of the setting on disk means "default-or-eui64" so that the property
62    /// doesn't change on upgrade from older versions.
63    ///
64    /// Note that this setting is distinct from the Privacy Extensions as
65    /// configured by "ip6-privacy" property and it does not affect the
66    /// temporary addresses configured with this option.
67    ///
68    /// Readable | Writeable
69    ///
70    ///
71    /// #### `dhcp-duid`
72    ///  A string containing the DHCPv6 Unique Identifier (DUID) used by the dhcp
73    /// client to identify itself to DHCPv6 servers (RFC 3315). The DUID is carried
74    /// in the Client Identifier option.
75    /// If the property is a hex string ('aa:bb:cc') it is interpreted as a binary
76    /// DUID and filled as an opaque value in the Client Identifier option.
77    ///
78    /// The special value "lease" will retrieve the DUID previously used from the
79    /// lease file belonging to the connection. If no DUID is found and "dhclient"
80    /// is the configured dhcp client, the DUID is searched in the system-wide
81    /// dhclient lease file. If still no DUID is found, or another dhcp client is
82    /// used, a global and permanent DUID-UUID (RFC 6355) will be generated based
83    /// on the machine-id.
84    ///
85    /// The special values "llt" and "ll" will generate a DUID of type LLT or LL
86    /// (see RFC 3315) based on the current MAC address of the device. In order to
87    /// try providing a stable DUID-LLT, the time field will contain a constant
88    /// timestamp that is used globally (for all profiles) and persisted to disk.
89    ///
90    /// The special values "stable-llt", "stable-ll" and "stable-uuid" will generate
91    /// a DUID of the corresponding type, derived from the connection's stable-id and
92    /// a per-host unique key. You may want to include the "${DEVICE}" or "${MAC}" specifier
93    /// in the stable-id, in case this profile gets activated on multiple devices.
94    /// So, the link-layer address of "stable-ll" and "stable-llt" will be a generated
95    /// address derived from the stable id. The DUID-LLT time value in the "stable-llt"
96    /// option will be picked among a static timespan of three years (the upper bound
97    /// of the interval is the same constant timestamp used in "llt").
98    ///
99    /// When the property is unset, the global value provided for "ipv6.dhcp-duid" is
100    /// used. If no global value is provided, the default "lease" value is assumed.
101    ///
102    /// Readable | Writeable
103    ///
104    ///
105    /// #### `dhcp-pd-hint`
106    ///  A IPv6 address followed by a slash and a prefix length. If set, the value is
107    /// sent to the DHCPv6 server as hint indicating the prefix delegation (IA_PD) we
108    /// want to receive.
109    /// To only hint a prefix length without prefix, set the address part to the
110    /// zero address (for example "::/60").
111    ///
112    /// Readable | Writeable
113    ///
114    ///
115    /// #### `ip6-privacy`
116    ///  Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941.  If
117    /// enabled, it makes the kernel generate a temporary IPv6 address in
118    /// addition to the public one generated from MAC address via modified
119    /// EUI-64.  This enhances privacy, but could cause problems in some
120    /// applications, on the other hand.  The permitted values are: -1: unknown,
121    /// 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary
122    /// addresses).
123    ///
124    /// Having a per-connection setting set to "-1" (default) means fallback to
125    /// global configuration "ipv6.ip6-privacy". If it's also unspecified or set
126    /// to "-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr".
127    ///
128    /// Note that this setting is distinct from the Stable Privacy addresses
129    /// that can be enabled with the "addr-gen-mode" property's "stable-privacy"
130    /// setting as another way of avoiding host tracking with IPv6 addresses.
131    ///
132    /// Readable | Writeable
133    ///
134    ///
135    /// #### `mtu`
136    ///  Maximum transmission unit size, in bytes. If zero (the default), the MTU
137    /// is set automatically from router advertisements or is left equal to the
138    /// link-layer MTU. If greater than the link-layer MTU, or greater than zero
139    /// but less than the minimum IPv6 MTU of 1280, this value has no effect.
140    ///
141    /// Readable | Writeable
142    ///
143    ///
144    /// #### `ra-timeout`
145    ///  A timeout for waiting Router Advertisements in seconds. If zero (the default), a
146    /// globally configured default is used. If still unspecified, the timeout depends on the
147    /// sysctl settings of the device.
148    ///
149    /// Set to 2147483647 (MAXINT32) for infinity.
150    ///
151    /// Readable | Writeable
152    ///
153    ///
154    /// #### `temp-preferred-lifetime`
155    ///  The preferred lifetime of autogenerated temporary addresses, in seconds.
156    ///
157    /// Having a per-connection setting set to "0" (default) means fallback to
158    /// global configuration "ipv6.temp-preferred-lifetime" setting". If it's also
159    /// unspecified or set to "0", fallback to read
160    /// "/proc/sys/net/ipv6/conf/default/temp_prefered_lft".
161    ///
162    /// Readable | Writeable
163    ///
164    ///
165    /// #### `temp-valid-lifetime`
166    ///  The valid lifetime of autogenerated temporary addresses, in seconds.
167    ///
168    /// Having a per-connection setting set to "0" (default) means fallback to
169    /// global configuration "ipv6.temp-valid-lifetime" setting". If it's also
170    /// unspecified or set to "0", fallback to read
171    /// "/proc/sys/net/ipv6/conf/default/temp_valid_lft".
172    ///
173    /// Readable | Writeable
174    ///
175    ///
176    /// #### `token`
177    ///  Configure the token for draft-chown-6man-tokenised-ipv6-identifiers-02
178    /// IPv6 tokenized interface identifiers. Useful with eui64 addr-gen-mode.
179    ///
180    /// When set, the token is used as IPv6 interface identifier instead of the
181    /// hardware address. This only applies to addresses from stateless
182    /// autoconfiguration, not to IPv6 link local addresses.
183    ///
184    /// Readable | Writeable
185    /// <details><summary><h4>SettingIPConfig</h4></summary>
186    ///
187    ///
188    /// #### `addresses`
189    ///  Array of IP addresses.
190    ///
191    /// Readable | Writeable
192    ///
193    ///
194    /// #### `auto-route-ext-gw`
195    ///  VPN connections will default to add the route automatically unless this
196    /// setting is set to [`false`].
197    ///
198    /// For other connection types, adding such an automatic route is currently
199    /// not supported and setting this to [`true`] has no effect.
200    ///
201    /// Readable | Writeable
202    ///
203    ///
204    /// #### `dad-timeout`
205    ///  Maximum timeout in milliseconds used to check for the presence of duplicate
206    /// IP addresses on the network.  If an address conflict is detected, the
207    /// activation will fail. The property is currently implemented only for IPv4.
208    ///
209    /// A zero value means that no duplicate address detection is performed, -1 means
210    /// the default value (either the value configured globally in NetworkManger.conf
211    /// or 200ms).  A value greater than zero is a timeout in milliseconds.  Note that
212    /// the time intervals are subject to randomization as per RFC 5227 and so the
213    /// actual duration can be between half and the full time specified in this
214    /// property.
215    ///
216    /// Readable | Writeable
217    ///
218    ///
219    /// #### `dhcp-dscp`
220    ///  Specifies the value for the DSCP field (traffic class) of the IP header. When
221    /// empty, the global default value is used; if no global default is specified, it is
222    /// assumed to be "CS0". Allowed values are: "CS0", "CS4" and "CS6".
223    ///
224    /// The property is currently valid only for IPv4, and it is supported only by the
225    /// "internal" DHCP plugin.
226    ///
227    /// Readable | Writeable
228    ///
229    ///
230    /// #### `dhcp-hostname`
231    ///  If the #NMSettingIPConfig:dhcp-send-hostname property is [`true`], then the
232    /// specified name will be sent to the DHCP server when acquiring a lease.
233    /// This property and #NMSettingIP4Config:dhcp-fqdn are mutually exclusive and
234    /// cannot be set at the same time.
235    ///
236    /// Readable | Writeable
237    ///
238    ///
239    /// #### `dhcp-hostname-flags`
240    ///  Flags for the DHCP hostname and FQDN.
241    ///
242    /// Currently, this property only includes flags to control the FQDN flags
243    /// set in the DHCP FQDN option. Supported FQDN flags are
244    /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE],
245    /// [`DhcpHostnameFlags::FQDN_ENCODED`][crate::DhcpHostnameFlags::FQDN_ENCODED] and
246    /// [`DhcpHostnameFlags::FQDN_NO_UPDATE`][crate::DhcpHostnameFlags::FQDN_NO_UPDATE].  When no FQDN flag is set and
247    /// [`DhcpHostnameFlags::FQDN_CLEAR_FLAGS`][crate::DhcpHostnameFlags::FQDN_CLEAR_FLAGS] is set, the DHCP FQDN option will
248    /// contain no flag. Otherwise, if no FQDN flag is set and
249    /// [`DhcpHostnameFlags::FQDN_CLEAR_FLAGS`][crate::DhcpHostnameFlags::FQDN_CLEAR_FLAGS] is not set, the standard FQDN flags
250    /// are set in the request:
251    /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE],
252    /// [`DhcpHostnameFlags::FQDN_ENCODED`][crate::DhcpHostnameFlags::FQDN_ENCODED] for IPv4 and
253    /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE] for IPv6.
254    ///
255    /// When this property is set to the default value [`DhcpHostnameFlags::NONE`][crate::DhcpHostnameFlags::NONE],
256    /// a global default is looked up in NetworkManager configuration. If that value
257    /// is unset or also [`DhcpHostnameFlags::NONE`][crate::DhcpHostnameFlags::NONE], then the standard FQDN flags
258    /// described above are sent in the DHCP requests.
259    ///
260    /// Readable | Writeable
261    ///
262    ///
263    /// #### `dhcp-iaid`
264    ///  A string containing the "Identity Association Identifier" (IAID) used by
265    /// the DHCP client. The string can be a 32-bit number (either decimal,
266    /// hexadecimal or as colon separated hexadecimal numbers). Alternatively
267    /// it can be set to the special values "mac", "perm-mac", "ifname" or
268    /// "stable". When set to "mac" (or "perm-mac"), the last 4 bytes of the
269    /// current (or permanent) MAC address are used as IAID. When set to
270    /// "ifname", the IAID is computed by hashing the interface name. The
271    /// special value "stable" can be used to generate an IAID based on the
272    /// stable-id (see connection.stable-id), a per-host key and the interface
273    /// name. When the property is unset, the value from global configuration is
274    /// used; if no global default is set then the IAID is assumed to be
275    /// "ifname".
276    ///
277    /// For DHCPv4, the IAID is only used with "ipv4.dhcp-client-id"
278    /// values "duid" and "ipv6-duid" to generate the client-id.
279    ///
280    /// For DHCPv6, note that at the moment this property is
281    /// only supported by the "internal" DHCPv6 plugin. The "dhclient" DHCPv6
282    /// plugin always derives the IAID from the MAC address.
283    ///
284    /// The actually used DHCPv6 IAID for a currently activated interface is
285    /// exposed in the lease information of the device.
286    ///
287    /// Readable | Writeable
288    ///
289    ///
290    /// #### `dhcp-reject-servers`
291    ///  Array of servers from which DHCP offers must be rejected. This property
292    /// is useful to avoid getting a lease from misconfigured or rogue servers.
293    ///
294    /// For DHCPv4, each element must be an IPv4 address, optionally
295    /// followed by a slash and a prefix length (e.g. "192.168.122.0/24").
296    ///
297    /// This property is currently not implemented for DHCPv6.
298    ///
299    /// Readable | Writeable
300    ///
301    ///
302    /// #### `dhcp-send-hostname`
303    ///  Since 1.52 this property is deprecated and is only used as fallback value
304    /// for #NMSettingIPConfig:dhcp-send-hostname-v2 if it's set to 'default'.
305    /// This is only done to avoid breaking existing configurations, the new
306    /// property should be used from now on.
307    ///
308    /// Readable | Writeable
309    ///
310    ///
311    /// #### `dhcp-send-hostname-v2`
312    ///  If [`true`], a hostname is sent to the DHCP server when acquiring a lease.
313    /// Some DHCP servers use this hostname to update DNS databases, essentially
314    /// providing a static hostname for the computer.  If the
315    /// #NMSettingIPConfig:dhcp-hostname property is [`None`] and this property is
316    /// [`true`], the current persistent hostname of the computer is sent.
317    ///
318    /// The default value is [`Ternary::Default`][crate::Ternary::Default]. In this case the global value
319    /// from NetworkManager configuration is looked up. If it's not set, the value
320    /// from #NMSettingIPConfig:dhcp-send-hostname, which defaults to [`true`], is
321    /// used for backwards compatibility. In the future this will change and, in
322    /// absence of a global default, it will always fallback to [`true`].
323    ///
324    /// Readable | Writeable
325    ///
326    ///
327    /// #### `dhcp-send-release`
328    ///  Whether the DHCP client will send RELEASE message when
329    /// bringing the connection down. The default value is [`Ternary::Default`][crate::Ternary::Default].
330    /// When the default value is specified, then the global value from NetworkManager
331    /// configuration is looked up, if not set, it is considered as [`false`].
332    ///
333    /// Readable | Writeable
334    ///
335    ///
336    /// #### `dhcp-timeout`
337    ///  A timeout for a DHCP transaction in seconds. If zero (the default), a
338    /// globally configured default is used. If still unspecified, a device specific
339    /// timeout is used (usually 45 seconds).
340    ///
341    /// Set to 2147483647 (MAXINT32) for infinity.
342    ///
343    /// Readable | Writeable
344    ///
345    ///
346    /// #### `dns`
347    ///  Array of DNS servers.
348    ///
349    /// Each server can be specified either as a plain IP address (optionally followed
350    /// by a "#" and the SNI server name for DNS over TLS) or with a URI syntax.
351    ///
352    /// When it is specified as an URI, the following forms are supported:
353    /// dns+udp://ADDRESS[:PORT], dns+tls://ADDRESS[:PORT][#SERVERNAME] .
354    ///
355    /// When using the URI syntax, IPv6 addresses must be enclosed in square
356    /// brackets ('[', ']').
357    ///
358    /// Readable | Writeable
359    ///
360    ///
361    /// #### `dns-options`
362    ///  Array of DNS options to be added to resolv.conf.
363    ///
364    /// [`None`] means that the options are unset and left at the default.
365    /// In this case NetworkManager will use default options. This is
366    /// distinct from an empty list of properties.
367    ///
368    /// The following options are directly added to resolv.conf: "attempts",
369    ///  "debug", "edns0",
370    /// "inet6", "ip6-bytestring", "ip6-dotint", "ndots", "no-aaaa",
371    /// "no-check-names", "no-ip6-dotint", "no-reload", "no-tld-query",
372    /// "rotate", "single-request", "single-request-reopen", "timeout",
373    /// "trust-ad", "use-vc". See the resolv.conf(5) man page for a
374    /// detailed description of these options.
375    ///
376    /// In addition, NetworkManager supports the special options "_no-add-edns0"
377    /// and "_no-add-trust-ad". They are not added to resolv.conf, and can be
378    /// used to prevent the automatic addition of options "edns0" and "trust-ad"
379    /// when using caching DNS plugins (see below).
380    ///
381    /// The "trust-ad" setting is only honored if the profile contributes
382    /// name servers to resolv.conf, and if all contributing profiles have
383    /// "trust-ad" enabled.
384    ///
385    /// When using a caching DNS plugin (dnsmasq or systemd-resolved in
386    /// NetworkManager.conf) then "edns0" and "trust-ad" are automatically
387    /// added, unless "_no-add-edns0" and "_no-add-trust-ad" are present.
388    ///
389    /// Readable | Writeable
390    ///
391    ///
392    /// #### `dns-priority`
393    ///  DNS servers priority.
394    ///
395    /// The relative priority for DNS servers specified by this setting.  A lower
396    /// numerical value is better (higher priority).
397    ///
398    /// Negative values have the special effect of excluding other configurations
399    /// with a greater numerical priority value; so in presence of at least one negative
400    /// priority, only DNS servers from connections with the lowest priority value will be used.
401    /// To avoid all DNS leaks, set the priority of the profile that should be used
402    /// to the most negative value of all active connections profiles.
403    ///
404    /// Zero selects a globally configured default value. If the latter is missing
405    /// or zero too, it defaults to 50 for VPNs (including WireGuard) and 100 for
406    /// other connections.
407    ///
408    /// Note that the priority is to order DNS settings for multiple active
409    /// connections.  It does not disambiguate multiple DNS servers within the
410    /// same connection profile.
411    ///
412    /// When multiple devices have configurations with the same priority, VPNs will be
413    /// considered first, then devices with the best (lowest metric) default
414    /// route and then all other devices.
415    ///
416    /// When using dns=default, servers with higher priority will be on top of
417    /// resolv.conf. To prioritize a given server over another one within the
418    /// same connection, just specify them in the desired order.
419    /// Note that commonly the resolver tries name servers in /etc/resolv.conf
420    /// in the order listed, proceeding with the next server in the list
421    /// on failure. See for example the "rotate" option of the dns-options setting.
422    /// If there are any negative DNS priorities, then only name servers from
423    /// the devices with that lowest priority will be considered.
424    ///
425    /// When using a DNS resolver that supports Conditional Forwarding or
426    /// Split DNS (with dns=dnsmasq or dns=systemd-resolved settings), each connection
427    /// is used to query domains in its search list. The search domains determine which
428    /// name servers to ask, and the DNS priority is used to prioritize
429    /// name servers based on the domain.  Queries for domains not present in any
430    /// search list are routed through connections having the '~.' special wildcard
431    /// domain, which is added automatically to connections with the default route
432    /// (or can be added manually).  When multiple connections specify the same domain, the
433    /// one with the best priority (lowest numerical value) wins.  If a sub domain
434    /// is configured on another interface it will be accepted regardless the priority,
435    /// unless parent domain on the other interface has a negative priority, which causes
436    /// the sub domain to be shadowed.
437    /// With Split DNS one can avoid undesired DNS leaks by properly configuring
438    /// DNS priorities and the search domains, so that only name servers of the desired
439    /// interface are configured.
440    ///
441    /// Readable | Writeable
442    ///
443    ///
444    /// #### `dns-search`
445    ///  List of DNS search domains. Domains starting with a tilde ('~')
446    /// are considered 'routing' domains and are used only to decide the
447    /// interface over which a query must be forwarded; they are not used
448    /// to complete unqualified host names.
449    ///
450    /// When using a DNS plugin that supports Conditional Forwarding or
451    /// Split DNS, then the search domains specify which name servers to
452    /// query. This makes the behavior different from running with plain
453    /// /etc/resolv.conf. For more information see also the dns-priority setting.
454    ///
455    /// When set on a profile that also enabled DHCP, the DNS search list
456    /// received automatically (option 119 for DHCPv4 and option 24 for DHCPv6)
457    /// gets merged with the manual list. This can be prevented by setting
458    /// "ignore-auto-dns". Note that if no DNS searches are configured, the
459    /// fallback will be derived from the domain from DHCP (option 15).
460    ///
461    /// Readable | Writeable
462    ///
463    ///
464    /// #### `forwarding`
465    ///  Whether to configure sysctl interface-specific forwarding. When enabled, the interface
466    /// will act as a router to forward the packet from one interface to another. When set to
467    /// [`SettingIPConfigForwarding::Default`][crate::SettingIPConfigForwarding::Default], the value from global configuration is used;
468    /// if no global default is defined, [`SettingIPConfigForwarding::Auto`][crate::SettingIPConfigForwarding::Auto] will be used.
469    /// The #NMSettingIPConfig:forwarding property is ignored when #NMSettingIPConfig:method
470    /// is set to "shared", because forwarding is always enabled in this case.
471    /// The accepted values are:
472    ///   [`SettingIPConfigForwarding::Default`][crate::SettingIPConfigForwarding::Default]: use global default.
473    ///   [`SettingIPConfigForwarding::No`][crate::SettingIPConfigForwarding::No]: disabled.
474    ///   [`SettingIPConfigForwarding::Yes`][crate::SettingIPConfigForwarding::Yes]: enabled.
475    ///   [`SettingIPConfigForwarding::Auto`][crate::SettingIPConfigForwarding::Auto]: enable if any shared connection is active,
476    ///        use kernel default otherwise.
477    ///
478    /// Readable | Writeable
479    ///
480    ///
481    /// #### `gateway`
482    ///  The gateway associated with this configuration. This is only meaningful
483    /// if #NMSettingIPConfig:addresses is also set.
484    ///
485    /// Setting the gateway causes NetworkManager to configure a standard default route
486    /// with the gateway as next hop. This is ignored if #NMSettingIPConfig:never-default
487    /// is set. An alternative is to configure the default route explicitly with a manual
488    /// route and /0 as prefix length.
489    ///
490    /// Note that the gateway usually conflicts with routing that NetworkManager configures
491    /// for WireGuard interfaces, so usually it should not be set in that case. See
492    /// #NMSettingWireGuard:ip4-auto-default-route.
493    ///
494    /// Readable | Writeable
495    ///
496    ///
497    /// #### `ignore-auto-dns`
498    ///  When #NMSettingIPConfig:method is set to "auto" and this property to
499    /// [`true`], automatically configured name servers and search domains are
500    /// ignored and only name servers and search domains specified in the
501    /// #NMSettingIPConfig:dns and #NMSettingIPConfig:dns-search properties, if
502    /// any, are used.
503    ///
504    /// Readable | Writeable
505    ///
506    ///
507    /// #### `ignore-auto-routes`
508    ///  When #NMSettingIPConfig:method is set to "auto" and this property to
509    /// [`true`], automatically configured routes are ignored and only routes
510    /// specified in the #NMSettingIPConfig:routes property, if any, are used.
511    ///
512    /// Readable | Writeable
513    ///
514    ///
515    /// #### `may-fail`
516    ///  If [`true`], allow overall network configuration to proceed even if the
517    /// configuration specified by this property times out.  Note that at least
518    /// one IP configuration must succeed or overall network configuration will
519    /// still fail.  For example, in IPv6-only networks, setting this property to
520    /// [`true`] on the #NMSettingIP4Config allows the overall network configuration
521    /// to succeed if IPv4 configuration fails but IPv6 configuration completes
522    /// successfully.
523    ///
524    /// Readable | Writeable
525    ///
526    ///
527    /// #### `method`
528    ///  IP configuration method.
529    ///
530    /// #NMSettingIP4Config and #NMSettingIP6Config both support "disabled",
531    /// "auto", "manual", and "link-local". See the subclass-specific
532    /// documentation for other values.
533    ///
534    /// In general, for the "auto" method, properties such as
535    /// #NMSettingIPConfig:dns and #NMSettingIPConfig:routes specify information
536    /// that is added on to the information returned from automatic
537    /// configuration.  The #NMSettingIPConfig:ignore-auto-routes and
538    /// #NMSettingIPConfig:ignore-auto-dns properties modify this behavior.
539    ///
540    /// For methods that imply no upstream network, such as "shared" or
541    /// "link-local", these properties must be empty.
542    ///
543    /// For IPv4 method "shared", the IP subnet can be configured by adding one
544    /// manual IPv4 address or otherwise 10.42.x.0/24 is chosen. Note that the
545    /// shared method must be configured on the interface which shares the internet
546    /// to a subnet, not on the uplink which is shared.
547    ///
548    /// Readable | Writeable
549    ///
550    ///
551    /// #### `never-default`
552    ///  If [`true`], this connection will never be the default connection for this
553    /// IP type, meaning it will never be assigned the default route by
554    /// NetworkManager.
555    ///
556    /// Readable | Writeable
557    ///
558    ///
559    /// #### `replace-local-rule`
560    ///  Connections will default to keep the autogenerated priority 0 local rule
561    /// unless this setting is set to [`true`].
562    ///
563    /// Readable | Writeable
564    ///
565    ///
566    /// #### `required-timeout`
567    ///  The minimum time interval in milliseconds for which dynamic IP configuration
568    /// should be tried before the connection succeeds.
569    ///
570    /// This property is useful for example if both IPv4 and IPv6 are enabled and
571    /// are allowed to fail. Normally the connection succeeds as soon as one of
572    /// the two address families completes; by setting a required timeout for
573    /// e.g. IPv4, one can ensure that even if IP6 succeeds earlier than IPv4,
574    /// NetworkManager waits some time for IPv4 before the connection becomes
575    /// active.
576    ///
577    /// Note that if #NMSettingIPConfig:may-fail is FALSE for the same address
578    /// family, this property has no effect as NetworkManager needs to wait for
579    /// the full DHCP timeout.
580    ///
581    /// A zero value means that no required timeout is present, -1 means the
582    /// default value (either configuration ipvx.required-timeout override or
583    /// zero).
584    ///
585    /// Readable | Writeable
586    ///
587    ///
588    /// #### `route-metric`
589    ///  The default metric for routes that don't explicitly specify a metric.
590    /// The default value -1 means that the metric is chosen automatically
591    /// based on the device type.
592    /// The metric applies to dynamic routes, manual (static) routes that
593    /// don't have an explicit metric setting, address prefix routes, and
594    /// the default route.
595    /// Note that for IPv6, the kernel accepts zero (0) but coerces it to
596    /// 1024 (user default). Hence, setting this property to zero effectively
597    /// mean setting it to 1024.
598    /// For IPv4, zero is a regular value for the metric.
599    ///
600    /// Readable | Writeable
601    ///
602    ///
603    /// #### `route-table`
604    ///  Enable policy routing (source routing) and set the routing table used when adding routes.
605    ///
606    /// This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes
607    /// and static routes. But note that static routes can individually overwrite the setting
608    /// by explicitly specifying a non-zero routing table.
609    ///
610    /// If the table setting is left at zero, it is eligible to be overwritten via global
611    /// configuration. If the property is zero even after applying the global configuration
612    /// value, policy routing is disabled for the address family of this connection.
613    ///
614    /// Policy routing disabled means that NetworkManager will add all routes to the main
615    /// table (except static routes that explicitly configure a different table). Additionally,
616    /// NetworkManager will not delete any extraneous routes from tables except the main table.
617    /// This is to preserve backward compatibility for users who manage routing tables outside
618    /// of NetworkManager.
619    ///
620    /// Readable | Writeable
621    ///
622    ///
623    /// #### `routed-dns`
624    ///  Whether to add routes for DNS servers. When enabled, NetworkManager adds a route
625    /// for each DNS server that is associated with this connection either statically
626    /// (defined in the connection profile) or dynamically (for example, retrieved via
627    /// DHCP). The route guarantees that the DNS server is reached via this interface. When
628    /// set to [`SettingIPConfigRoutedDns::Default`][crate::SettingIPConfigRoutedDns::Default], the value from global
629    /// configuration is used; if no global default is defined, this feature is disabled.
630    ///
631    /// Readable | Writeable
632    ///
633    ///
634    /// #### `routes`
635    ///  Array of IP routes.
636    ///
637    /// Readable | Writeable
638    ///
639    ///
640    /// #### `shared-dhcp-lease-time`
641    ///  This option allows you to specify a custom DHCP lease time for the shared connection
642    /// method in seconds. The value should be either a number between 120 and 31536000 (one year)
643    /// If this option is not specified, 3600 (one hour) is used.
644    ///
645    /// Special values are 0 for default value of 1 hour and 2147483647 (MAXINT32) for infinite lease time.
646    ///
647    /// Readable | Writeable
648    ///
649    ///
650    /// #### `shared-dhcp-range`
651    ///  This option allows you to specify a custom DHCP range for the shared connection
652    /// method. The value is expected to be in `<START_ADDRESS>,<END_ADDRESS>` format.
653    /// The range should be part of network set by ipv4.address option and it should
654    /// not contain network address or broadcast address. If this option is not specified,
655    /// the DHCP range will be automatically determined based on the interface address.
656    /// The range will be selected to be adjacent to the interface address, either before
657    /// or after it, with the larger possible range being preferred. The range will be
658    /// adjusted to fill the available address space, except for networks with a prefix
659    /// length greater than 24, which will be treated as if they have a prefix length of 24.
660    ///
661    /// Readable | Writeable
662    /// </details>
663    /// <details><summary><h4>Setting</h4></summary>
664    ///
665    ///
666    /// #### `name`
667    ///  The setting's name, which uniquely identifies the setting within the
668    /// connection.  Each setting type has a name unique to that type, for
669    /// example "ppp" or "802-11-wireless" or "802-3-ethernet".
670    ///
671    /// Readable
672    /// </details>
673    ///
674    /// # Implements
675    ///
676    /// [`SettingIPConfigExt`][trait@crate::prelude::SettingIPConfigExt], [`SettingExt`][trait@crate::prelude::SettingExt]
677    #[doc(alias = "NMSettingIP6Config")]
678    pub struct SettingIP6Config(Object<ffi::NMSettingIP6Config, ffi::NMSettingIP6ConfigClass>) @extends SettingIPConfig, Setting;
679
680    match fn {
681        type_ => || ffi::nm_setting_ip6_config_get_type(),
682    }
683}
684
685impl SettingIP6Config {
686    /// Creates a new #NMSettingIP6Config object with default values.
687    ///
688    /// # Returns
689    ///
690    /// the new empty #NMSettingIP6Config object
691    #[doc(alias = "nm_setting_ip6_config_new")]
692    pub fn new() -> SettingIP6Config {
693        assert_initialized_main_thread!();
694        unsafe { Setting::from_glib_full(ffi::nm_setting_ip6_config_new()).unsafe_cast() }
695    }
696
697    // rustdoc-stripper-ignore-next
698    /// Creates a new builder-pattern struct instance to construct [`SettingIP6Config`] objects.
699    ///
700    /// This method returns an instance of [`SettingIP6ConfigBuilder`](crate::builders::SettingIP6ConfigBuilder) which can be used to create [`SettingIP6Config`] objects.
701    pub fn builder() -> SettingIP6ConfigBuilder {
702        SettingIP6ConfigBuilder::new()
703    }
704
705    /// Returns the value contained in the #NMSettingIP6Config:addr-gen-mode
706    /// property.
707    ///
708    /// # Returns
709    ///
710    /// IPv6 Address Generation Mode.
711    #[cfg(feature = "v1_2")]
712    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
713    #[doc(alias = "nm_setting_ip6_config_get_addr_gen_mode")]
714    #[doc(alias = "get_addr_gen_mode")]
715    #[doc(alias = "addr-gen-mode")]
716    pub fn addr_gen_mode(&self) -> SettingIP6ConfigAddrGenMode {
717        unsafe {
718            from_glib(ffi::nm_setting_ip6_config_get_addr_gen_mode(
719                self.to_glib_none().0,
720            ))
721        }
722    }
723
724    /// Returns the value contained in the #NMSettingIP6Config:dhcp-duid
725    /// property.
726    ///
727    /// # Returns
728    ///
729    /// The configured DUID value to be included in the DHCPv6 requests
730    /// sent to the DHCPv6 servers.
731    #[cfg(feature = "v1_12")]
732    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
733    #[doc(alias = "nm_setting_ip6_config_get_dhcp_duid")]
734    #[doc(alias = "get_dhcp_duid")]
735    #[doc(alias = "dhcp-duid")]
736    pub fn dhcp_duid(&self) -> glib::GString {
737        unsafe {
738            from_glib_none(ffi::nm_setting_ip6_config_get_dhcp_duid(
739                self.to_glib_none().0,
740            ))
741        }
742    }
743
744    /// Returns the value contained in the #NMSettingIP6Config:dhcp-pd-hint
745    /// property.
746    ///
747    /// # Returns
748    ///
749    /// a string containing an address and prefix length to be used
750    /// as hint for DHCPv6 prefix delegation.
751    #[cfg(feature = "v1_44")]
752    #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
753    #[doc(alias = "nm_setting_ip6_config_get_dhcp_pd_hint")]
754    #[doc(alias = "get_dhcp_pd_hint")]
755    #[doc(alias = "dhcp-pd-hint")]
756    pub fn dhcp_pd_hint(&self) -> glib::GString {
757        unsafe {
758            from_glib_none(ffi::nm_setting_ip6_config_get_dhcp_pd_hint(
759                self.to_glib_none().0,
760            ))
761        }
762    }
763
764    /// Returns the value contained in the #NMSettingIP6Config:ip6-privacy
765    /// property.
766    ///
767    /// # Returns
768    ///
769    /// IPv6 Privacy Extensions configuration value (#NMSettingIP6ConfigPrivacy).
770    #[doc(alias = "nm_setting_ip6_config_get_ip6_privacy")]
771    #[doc(alias = "get_ip6_privacy")]
772    #[doc(alias = "ip6-privacy")]
773    pub fn ip6_privacy(&self) -> SettingIP6ConfigPrivacy {
774        unsafe {
775            from_glib(ffi::nm_setting_ip6_config_get_ip6_privacy(
776                self.to_glib_none().0,
777            ))
778        }
779    }
780
781    ///
782    /// # Returns
783    ///
784    /// The configured [`SETTING_IP6_CONFIG_MTU`][crate::SETTING_IP6_CONFIG_MTU] value for the maximum
785    /// transmission unit.
786    #[cfg(feature = "v1_40")]
787    #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
788    #[doc(alias = "nm_setting_ip6_config_get_mtu")]
789    #[doc(alias = "get_mtu")]
790    pub fn mtu(&self) -> u32 {
791        unsafe { ffi::nm_setting_ip6_config_get_mtu(self.to_glib_none().0) }
792    }
793
794    ///
795    /// # Returns
796    ///
797    /// The configured [`SETTING_IP6_CONFIG_RA_TIMEOUT`][crate::SETTING_IP6_CONFIG_RA_TIMEOUT] value with the
798    /// timeout for router advertisements in seconds.
799    #[cfg(feature = "v1_24")]
800    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
801    #[doc(alias = "nm_setting_ip6_config_get_ra_timeout")]
802    #[doc(alias = "get_ra_timeout")]
803    #[doc(alias = "ra-timeout")]
804    pub fn ra_timeout(&self) -> i32 {
805        unsafe { ffi::nm_setting_ip6_config_get_ra_timeout(self.to_glib_none().0) }
806    }
807
808    /// Returns the value contained in the #NMSettingIP6Config:temp-preferred-lifetime
809    /// property.
810    ///
811    /// # Returns
812    ///
813    /// The preferred lifetime of autogenerated temporary addresses.
814    #[cfg(feature = "v1_48")]
815    #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
816    #[doc(alias = "nm_setting_ip6_config_get_temp_preferred_lifetime")]
817    #[doc(alias = "get_temp_preferred_lifetime")]
818    #[doc(alias = "temp-preferred-lifetime")]
819    pub fn temp_preferred_lifetime(&self) -> i32 {
820        unsafe { ffi::nm_setting_ip6_config_get_temp_preferred_lifetime(self.to_glib_none().0) }
821    }
822
823    /// Returns the value contained in the #NMSettingIP6Config:temp-valid-lifetime
824    /// property.
825    ///
826    /// # Returns
827    ///
828    /// The valid lifetime of autogenerated temporary addresses.
829    #[cfg(feature = "v1_48")]
830    #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
831    #[doc(alias = "nm_setting_ip6_config_get_temp_valid_lifetime")]
832    #[doc(alias = "get_temp_valid_lifetime")]
833    #[doc(alias = "temp-valid-lifetime")]
834    pub fn temp_valid_lifetime(&self) -> i32 {
835        unsafe { ffi::nm_setting_ip6_config_get_temp_valid_lifetime(self.to_glib_none().0) }
836    }
837
838    /// Returns the value contained in the #NMSettingIP6Config:token
839    /// property.
840    ///
841    /// # Returns
842    ///
843    /// A string.
844    #[cfg(feature = "v1_4")]
845    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
846    #[doc(alias = "nm_setting_ip6_config_get_token")]
847    #[doc(alias = "get_token")]
848    pub fn token(&self) -> glib::GString {
849        unsafe { from_glib_none(ffi::nm_setting_ip6_config_get_token(self.to_glib_none().0)) }
850    }
851
852    /// Configure the method for creating the IPv6 interface identifier of
853    /// addresses for RFC4862 IPv6 Stateless Address Autoconfiguration and IPv6
854    /// Link Local.
855    ///
856    /// The permitted values are: [`SettingIP6ConfigAddrGenMode::Eui64`][crate::SettingIP6ConfigAddrGenMode::Eui64],
857    /// [`SettingIP6ConfigAddrGenMode::StablePrivacy`][crate::SettingIP6ConfigAddrGenMode::StablePrivacy].
858    /// [`SettingIP6ConfigAddrGenMode::DefaultOrEui64`][crate::SettingIP6ConfigAddrGenMode::DefaultOrEui64] or
859    /// [`SettingIP6ConfigAddrGenMode::Default`][crate::SettingIP6ConfigAddrGenMode::Default].
860    ///
861    /// If the property is set to "eui64", the addresses will be generated using
862    /// the interface token derived from the hardware address. This makes the
863    /// host part of the address constant, making it possible to track the
864    /// host's presence when it changes networks. The address changes when the
865    /// interface hardware is replaced. If a duplicate address is detected,
866    /// there is no fallback to generate another address. When configured, the
867    /// "ipv6.token" is used instead of the MAC address to generate addresses
868    /// for stateless autoconfiguration.
869    ///
870    /// If the property is set to "stable-privacy", the interface identifier is
871    /// generated as specified by RFC7217. This works by hashing a host specific
872    /// key (see NetworkManager(8) manual), the interface name, the connection's
873    /// "connection.stable-id" property and the address prefix.  This improves
874    /// privacy by making it harder to use the address to track the host's
875    /// presence as every prefix and network has a different identifier. Also,
876    /// the address is stable when the network interface hardware is replaced.
877    ///
878    /// The special values "default" and "default-or-eui64" will fallback to the
879    /// global connection default as documented in the NetworkManager.conf(5)
880    /// manual. If the global default is not specified, the fallback value is
881    /// "stable-privacy" or "eui64", respectively.
882    ///
883    /// For libnm, the property defaults to "default" since 1.40.  Previously it
884    /// used to default to "stable-privacy".  On D-Bus, the absence of an
885    /// addr-gen-mode setting equals "default". For keyfile plugin, the absence
886    /// of the setting on disk means "default-or-eui64" so that the property
887    /// doesn't change on upgrade from older versions.
888    ///
889    /// Note that this setting is distinct from the Privacy Extensions as
890    /// configured by "ip6-privacy" property and it does not affect the
891    /// temporary addresses configured with this option.
892    #[cfg(feature = "v1_2")]
893    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
894    #[doc(alias = "addr-gen-mode")]
895    pub fn set_addr_gen_mode(&self, addr_gen_mode: i32) {
896        ObjectExt::set_property(self, "addr-gen-mode", addr_gen_mode)
897    }
898
899    /// A string containing the DHCPv6 Unique Identifier (DUID) used by the dhcp
900    /// client to identify itself to DHCPv6 servers (RFC 3315). The DUID is carried
901    /// in the Client Identifier option.
902    /// If the property is a hex string ('aa:bb:cc') it is interpreted as a binary
903    /// DUID and filled as an opaque value in the Client Identifier option.
904    ///
905    /// The special value "lease" will retrieve the DUID previously used from the
906    /// lease file belonging to the connection. If no DUID is found and "dhclient"
907    /// is the configured dhcp client, the DUID is searched in the system-wide
908    /// dhclient lease file. If still no DUID is found, or another dhcp client is
909    /// used, a global and permanent DUID-UUID (RFC 6355) will be generated based
910    /// on the machine-id.
911    ///
912    /// The special values "llt" and "ll" will generate a DUID of type LLT or LL
913    /// (see RFC 3315) based on the current MAC address of the device. In order to
914    /// try providing a stable DUID-LLT, the time field will contain a constant
915    /// timestamp that is used globally (for all profiles) and persisted to disk.
916    ///
917    /// The special values "stable-llt", "stable-ll" and "stable-uuid" will generate
918    /// a DUID of the corresponding type, derived from the connection's stable-id and
919    /// a per-host unique key. You may want to include the "${DEVICE}" or "${MAC}" specifier
920    /// in the stable-id, in case this profile gets activated on multiple devices.
921    /// So, the link-layer address of "stable-ll" and "stable-llt" will be a generated
922    /// address derived from the stable id. The DUID-LLT time value in the "stable-llt"
923    /// option will be picked among a static timespan of three years (the upper bound
924    /// of the interval is the same constant timestamp used in "llt").
925    ///
926    /// When the property is unset, the global value provided for "ipv6.dhcp-duid" is
927    /// used. If no global value is provided, the default "lease" value is assumed.
928    #[cfg(feature = "v1_12")]
929    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
930    #[doc(alias = "dhcp-duid")]
931    pub fn set_dhcp_duid(&self, dhcp_duid: Option<&str>) {
932        ObjectExt::set_property(self, "dhcp-duid", dhcp_duid)
933    }
934
935    /// A IPv6 address followed by a slash and a prefix length. If set, the value is
936    /// sent to the DHCPv6 server as hint indicating the prefix delegation (IA_PD) we
937    /// want to receive.
938    /// To only hint a prefix length without prefix, set the address part to the
939    /// zero address (for example "::/60").
940    #[cfg(feature = "v1_44")]
941    #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
942    #[doc(alias = "dhcp-pd-hint")]
943    pub fn set_dhcp_pd_hint(&self, dhcp_pd_hint: Option<&str>) {
944        ObjectExt::set_property(self, "dhcp-pd-hint", dhcp_pd_hint)
945    }
946
947    /// Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941.  If
948    /// enabled, it makes the kernel generate a temporary IPv6 address in
949    /// addition to the public one generated from MAC address via modified
950    /// EUI-64.  This enhances privacy, but could cause problems in some
951    /// applications, on the other hand.  The permitted values are: -1: unknown,
952    /// 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary
953    /// addresses).
954    ///
955    /// Having a per-connection setting set to "-1" (default) means fallback to
956    /// global configuration "ipv6.ip6-privacy". If it's also unspecified or set
957    /// to "-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr".
958    ///
959    /// Note that this setting is distinct from the Stable Privacy addresses
960    /// that can be enabled with the "addr-gen-mode" property's "stable-privacy"
961    /// setting as another way of avoiding host tracking with IPv6 addresses.
962    #[doc(alias = "ip6-privacy")]
963    pub fn set_ip6_privacy(&self, ip6_privacy: SettingIP6ConfigPrivacy) {
964        ObjectExt::set_property(self, "ip6-privacy", ip6_privacy)
965    }
966
967    /// Maximum transmission unit size, in bytes. If zero (the default), the MTU
968    /// is set automatically from router advertisements or is left equal to the
969    /// link-layer MTU. If greater than the link-layer MTU, or greater than zero
970    /// but less than the minimum IPv6 MTU of 1280, this value has no effect.
971    #[cfg(feature = "v1_40")]
972    #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
973    pub fn set_mtu(&self, mtu: u32) {
974        ObjectExt::set_property(self, "mtu", mtu)
975    }
976
977    /// A timeout for waiting Router Advertisements in seconds. If zero (the default), a
978    /// globally configured default is used. If still unspecified, the timeout depends on the
979    /// sysctl settings of the device.
980    ///
981    /// Set to 2147483647 (MAXINT32) for infinity.
982    #[cfg(feature = "v1_24")]
983    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
984    #[doc(alias = "ra-timeout")]
985    pub fn set_ra_timeout(&self, ra_timeout: i32) {
986        ObjectExt::set_property(self, "ra-timeout", ra_timeout)
987    }
988
989    /// The preferred lifetime of autogenerated temporary addresses, in seconds.
990    ///
991    /// Having a per-connection setting set to "0" (default) means fallback to
992    /// global configuration "ipv6.temp-preferred-lifetime" setting". If it's also
993    /// unspecified or set to "0", fallback to read
994    /// "/proc/sys/net/ipv6/conf/default/temp_prefered_lft".
995    #[cfg(feature = "v1_48")]
996    #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
997    #[doc(alias = "temp-preferred-lifetime")]
998    pub fn set_temp_preferred_lifetime(&self, temp_preferred_lifetime: i32) {
999        ObjectExt::set_property(self, "temp-preferred-lifetime", temp_preferred_lifetime)
1000    }
1001
1002    /// The valid lifetime of autogenerated temporary addresses, in seconds.
1003    ///
1004    /// Having a per-connection setting set to "0" (default) means fallback to
1005    /// global configuration "ipv6.temp-valid-lifetime" setting". If it's also
1006    /// unspecified or set to "0", fallback to read
1007    /// "/proc/sys/net/ipv6/conf/default/temp_valid_lft".
1008    #[cfg(feature = "v1_48")]
1009    #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
1010    #[doc(alias = "temp-valid-lifetime")]
1011    pub fn set_temp_valid_lifetime(&self, temp_valid_lifetime: i32) {
1012        ObjectExt::set_property(self, "temp-valid-lifetime", temp_valid_lifetime)
1013    }
1014
1015    /// Configure the token for draft-chown-6man-tokenised-ipv6-identifiers-02
1016    /// IPv6 tokenized interface identifiers. Useful with eui64 addr-gen-mode.
1017    ///
1018    /// When set, the token is used as IPv6 interface identifier instead of the
1019    /// hardware address. This only applies to addresses from stateless
1020    /// autoconfiguration, not to IPv6 link local addresses.
1021    #[cfg(feature = "v1_4")]
1022    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
1023    pub fn set_token(&self, token: Option<&str>) {
1024        ObjectExt::set_property(self, "token", token)
1025    }
1026
1027    #[cfg(feature = "v1_2")]
1028    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1029    #[doc(alias = "addr-gen-mode")]
1030    pub fn connect_addr_gen_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1031        unsafe extern "C" fn notify_addr_gen_mode_trampoline<F: Fn(&SettingIP6Config) + 'static>(
1032            this: *mut ffi::NMSettingIP6Config,
1033            _param_spec: glib::ffi::gpointer,
1034            f: glib::ffi::gpointer,
1035        ) {
1036            let f: &F = &*(f as *const F);
1037            f(&from_glib_borrow(this))
1038        }
1039        unsafe {
1040            let f: Box_<F> = Box_::new(f);
1041            connect_raw(
1042                self.as_ptr() as *mut _,
1043                c"notify::addr-gen-mode".as_ptr() as *const _,
1044                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1045                    notify_addr_gen_mode_trampoline::<F> as *const (),
1046                )),
1047                Box_::into_raw(f),
1048            )
1049        }
1050    }
1051
1052    #[cfg(feature = "v1_12")]
1053    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1054    #[doc(alias = "dhcp-duid")]
1055    pub fn connect_dhcp_duid_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1056        unsafe extern "C" fn notify_dhcp_duid_trampoline<F: Fn(&SettingIP6Config) + 'static>(
1057            this: *mut ffi::NMSettingIP6Config,
1058            _param_spec: glib::ffi::gpointer,
1059            f: glib::ffi::gpointer,
1060        ) {
1061            let f: &F = &*(f as *const F);
1062            f(&from_glib_borrow(this))
1063        }
1064        unsafe {
1065            let f: Box_<F> = Box_::new(f);
1066            connect_raw(
1067                self.as_ptr() as *mut _,
1068                c"notify::dhcp-duid".as_ptr() as *const _,
1069                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1070                    notify_dhcp_duid_trampoline::<F> as *const (),
1071                )),
1072                Box_::into_raw(f),
1073            )
1074        }
1075    }
1076
1077    #[cfg(feature = "v1_44")]
1078    #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
1079    #[doc(alias = "dhcp-pd-hint")]
1080    pub fn connect_dhcp_pd_hint_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1081        unsafe extern "C" fn notify_dhcp_pd_hint_trampoline<F: Fn(&SettingIP6Config) + 'static>(
1082            this: *mut ffi::NMSettingIP6Config,
1083            _param_spec: glib::ffi::gpointer,
1084            f: glib::ffi::gpointer,
1085        ) {
1086            let f: &F = &*(f as *const F);
1087            f(&from_glib_borrow(this))
1088        }
1089        unsafe {
1090            let f: Box_<F> = Box_::new(f);
1091            connect_raw(
1092                self.as_ptr() as *mut _,
1093                c"notify::dhcp-pd-hint".as_ptr() as *const _,
1094                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1095                    notify_dhcp_pd_hint_trampoline::<F> as *const (),
1096                )),
1097                Box_::into_raw(f),
1098            )
1099        }
1100    }
1101
1102    #[doc(alias = "ip6-privacy")]
1103    pub fn connect_ip6_privacy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1104        unsafe extern "C" fn notify_ip6_privacy_trampoline<F: Fn(&SettingIP6Config) + 'static>(
1105            this: *mut ffi::NMSettingIP6Config,
1106            _param_spec: glib::ffi::gpointer,
1107            f: glib::ffi::gpointer,
1108        ) {
1109            let f: &F = &*(f as *const F);
1110            f(&from_glib_borrow(this))
1111        }
1112        unsafe {
1113            let f: Box_<F> = Box_::new(f);
1114            connect_raw(
1115                self.as_ptr() as *mut _,
1116                c"notify::ip6-privacy".as_ptr() as *const _,
1117                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1118                    notify_ip6_privacy_trampoline::<F> as *const (),
1119                )),
1120                Box_::into_raw(f),
1121            )
1122        }
1123    }
1124
1125    #[cfg(feature = "v1_40")]
1126    #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
1127    #[doc(alias = "mtu")]
1128    pub fn connect_mtu_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1129        unsafe extern "C" fn notify_mtu_trampoline<F: Fn(&SettingIP6Config) + 'static>(
1130            this: *mut ffi::NMSettingIP6Config,
1131            _param_spec: glib::ffi::gpointer,
1132            f: glib::ffi::gpointer,
1133        ) {
1134            let f: &F = &*(f as *const F);
1135            f(&from_glib_borrow(this))
1136        }
1137        unsafe {
1138            let f: Box_<F> = Box_::new(f);
1139            connect_raw(
1140                self.as_ptr() as *mut _,
1141                c"notify::mtu".as_ptr() as *const _,
1142                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1143                    notify_mtu_trampoline::<F> as *const (),
1144                )),
1145                Box_::into_raw(f),
1146            )
1147        }
1148    }
1149
1150    #[cfg(feature = "v1_24")]
1151    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1152    #[doc(alias = "ra-timeout")]
1153    pub fn connect_ra_timeout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1154        unsafe extern "C" fn notify_ra_timeout_trampoline<F: Fn(&SettingIP6Config) + 'static>(
1155            this: *mut ffi::NMSettingIP6Config,
1156            _param_spec: glib::ffi::gpointer,
1157            f: glib::ffi::gpointer,
1158        ) {
1159            let f: &F = &*(f as *const F);
1160            f(&from_glib_borrow(this))
1161        }
1162        unsafe {
1163            let f: Box_<F> = Box_::new(f);
1164            connect_raw(
1165                self.as_ptr() as *mut _,
1166                c"notify::ra-timeout".as_ptr() as *const _,
1167                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1168                    notify_ra_timeout_trampoline::<F> as *const (),
1169                )),
1170                Box_::into_raw(f),
1171            )
1172        }
1173    }
1174
1175    #[cfg(feature = "v1_48")]
1176    #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
1177    #[doc(alias = "temp-preferred-lifetime")]
1178    pub fn connect_temp_preferred_lifetime_notify<F: Fn(&Self) + 'static>(
1179        &self,
1180        f: F,
1181    ) -> SignalHandlerId {
1182        unsafe extern "C" fn notify_temp_preferred_lifetime_trampoline<
1183            F: Fn(&SettingIP6Config) + 'static,
1184        >(
1185            this: *mut ffi::NMSettingIP6Config,
1186            _param_spec: glib::ffi::gpointer,
1187            f: glib::ffi::gpointer,
1188        ) {
1189            let f: &F = &*(f as *const F);
1190            f(&from_glib_borrow(this))
1191        }
1192        unsafe {
1193            let f: Box_<F> = Box_::new(f);
1194            connect_raw(
1195                self.as_ptr() as *mut _,
1196                c"notify::temp-preferred-lifetime".as_ptr() as *const _,
1197                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1198                    notify_temp_preferred_lifetime_trampoline::<F> as *const (),
1199                )),
1200                Box_::into_raw(f),
1201            )
1202        }
1203    }
1204
1205    #[cfg(feature = "v1_48")]
1206    #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
1207    #[doc(alias = "temp-valid-lifetime")]
1208    pub fn connect_temp_valid_lifetime_notify<F: Fn(&Self) + 'static>(
1209        &self,
1210        f: F,
1211    ) -> SignalHandlerId {
1212        unsafe extern "C" fn notify_temp_valid_lifetime_trampoline<
1213            F: Fn(&SettingIP6Config) + 'static,
1214        >(
1215            this: *mut ffi::NMSettingIP6Config,
1216            _param_spec: glib::ffi::gpointer,
1217            f: glib::ffi::gpointer,
1218        ) {
1219            let f: &F = &*(f as *const F);
1220            f(&from_glib_borrow(this))
1221        }
1222        unsafe {
1223            let f: Box_<F> = Box_::new(f);
1224            connect_raw(
1225                self.as_ptr() as *mut _,
1226                c"notify::temp-valid-lifetime".as_ptr() as *const _,
1227                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1228                    notify_temp_valid_lifetime_trampoline::<F> as *const (),
1229                )),
1230                Box_::into_raw(f),
1231            )
1232        }
1233    }
1234
1235    #[cfg(feature = "v1_4")]
1236    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
1237    #[doc(alias = "token")]
1238    pub fn connect_token_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1239        unsafe extern "C" fn notify_token_trampoline<F: Fn(&SettingIP6Config) + 'static>(
1240            this: *mut ffi::NMSettingIP6Config,
1241            _param_spec: glib::ffi::gpointer,
1242            f: glib::ffi::gpointer,
1243        ) {
1244            let f: &F = &*(f as *const F);
1245            f(&from_glib_borrow(this))
1246        }
1247        unsafe {
1248            let f: Box_<F> = Box_::new(f);
1249            connect_raw(
1250                self.as_ptr() as *mut _,
1251                c"notify::token".as_ptr() as *const _,
1252                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1253                    notify_token_trampoline::<F> as *const (),
1254                )),
1255                Box_::into_raw(f),
1256            )
1257        }
1258    }
1259}
1260
1261impl Default for SettingIP6Config {
1262    fn default() -> Self {
1263        Self::new()
1264    }
1265}
1266
1267// rustdoc-stripper-ignore-next
1268/// A [builder-pattern] type to construct [`SettingIP6Config`] objects.
1269///
1270/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1271#[must_use = "The builder must be built to be used"]
1272pub struct SettingIP6ConfigBuilder {
1273    builder: glib::object::ObjectBuilder<'static, SettingIP6Config>,
1274}
1275
1276impl SettingIP6ConfigBuilder {
1277    fn new() -> Self {
1278        Self {
1279            builder: glib::object::Object::builder(),
1280        }
1281    }
1282
1283    /// Configure the method for creating the IPv6 interface identifier of
1284    /// addresses for RFC4862 IPv6 Stateless Address Autoconfiguration and IPv6
1285    /// Link Local.
1286    ///
1287    /// The permitted values are: [`SettingIP6ConfigAddrGenMode::Eui64`][crate::SettingIP6ConfigAddrGenMode::Eui64],
1288    /// [`SettingIP6ConfigAddrGenMode::StablePrivacy`][crate::SettingIP6ConfigAddrGenMode::StablePrivacy].
1289    /// [`SettingIP6ConfigAddrGenMode::DefaultOrEui64`][crate::SettingIP6ConfigAddrGenMode::DefaultOrEui64] or
1290    /// [`SettingIP6ConfigAddrGenMode::Default`][crate::SettingIP6ConfigAddrGenMode::Default].
1291    ///
1292    /// If the property is set to "eui64", the addresses will be generated using
1293    /// the interface token derived from the hardware address. This makes the
1294    /// host part of the address constant, making it possible to track the
1295    /// host's presence when it changes networks. The address changes when the
1296    /// interface hardware is replaced. If a duplicate address is detected,
1297    /// there is no fallback to generate another address. When configured, the
1298    /// "ipv6.token" is used instead of the MAC address to generate addresses
1299    /// for stateless autoconfiguration.
1300    ///
1301    /// If the property is set to "stable-privacy", the interface identifier is
1302    /// generated as specified by RFC7217. This works by hashing a host specific
1303    /// key (see NetworkManager(8) manual), the interface name, the connection's
1304    /// "connection.stable-id" property and the address prefix.  This improves
1305    /// privacy by making it harder to use the address to track the host's
1306    /// presence as every prefix and network has a different identifier. Also,
1307    /// the address is stable when the network interface hardware is replaced.
1308    ///
1309    /// The special values "default" and "default-or-eui64" will fallback to the
1310    /// global connection default as documented in the NetworkManager.conf(5)
1311    /// manual. If the global default is not specified, the fallback value is
1312    /// "stable-privacy" or "eui64", respectively.
1313    ///
1314    /// For libnm, the property defaults to "default" since 1.40.  Previously it
1315    /// used to default to "stable-privacy".  On D-Bus, the absence of an
1316    /// addr-gen-mode setting equals "default". For keyfile plugin, the absence
1317    /// of the setting on disk means "default-or-eui64" so that the property
1318    /// doesn't change on upgrade from older versions.
1319    ///
1320    /// Note that this setting is distinct from the Privacy Extensions as
1321    /// configured by "ip6-privacy" property and it does not affect the
1322    /// temporary addresses configured with this option.
1323    #[cfg(feature = "v1_2")]
1324    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1325    pub fn addr_gen_mode(self, addr_gen_mode: i32) -> Self {
1326        Self {
1327            builder: self.builder.property("addr-gen-mode", addr_gen_mode),
1328        }
1329    }
1330
1331    /// A string containing the DHCPv6 Unique Identifier (DUID) used by the dhcp
1332    /// client to identify itself to DHCPv6 servers (RFC 3315). The DUID is carried
1333    /// in the Client Identifier option.
1334    /// If the property is a hex string ('aa:bb:cc') it is interpreted as a binary
1335    /// DUID and filled as an opaque value in the Client Identifier option.
1336    ///
1337    /// The special value "lease" will retrieve the DUID previously used from the
1338    /// lease file belonging to the connection. If no DUID is found and "dhclient"
1339    /// is the configured dhcp client, the DUID is searched in the system-wide
1340    /// dhclient lease file. If still no DUID is found, or another dhcp client is
1341    /// used, a global and permanent DUID-UUID (RFC 6355) will be generated based
1342    /// on the machine-id.
1343    ///
1344    /// The special values "llt" and "ll" will generate a DUID of type LLT or LL
1345    /// (see RFC 3315) based on the current MAC address of the device. In order to
1346    /// try providing a stable DUID-LLT, the time field will contain a constant
1347    /// timestamp that is used globally (for all profiles) and persisted to disk.
1348    ///
1349    /// The special values "stable-llt", "stable-ll" and "stable-uuid" will generate
1350    /// a DUID of the corresponding type, derived from the connection's stable-id and
1351    /// a per-host unique key. You may want to include the "${DEVICE}" or "${MAC}" specifier
1352    /// in the stable-id, in case this profile gets activated on multiple devices.
1353    /// So, the link-layer address of "stable-ll" and "stable-llt" will be a generated
1354    /// address derived from the stable id. The DUID-LLT time value in the "stable-llt"
1355    /// option will be picked among a static timespan of three years (the upper bound
1356    /// of the interval is the same constant timestamp used in "llt").
1357    ///
1358    /// When the property is unset, the global value provided for "ipv6.dhcp-duid" is
1359    /// used. If no global value is provided, the default "lease" value is assumed.
1360    #[cfg(feature = "v1_12")]
1361    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1362    pub fn dhcp_duid(self, dhcp_duid: impl Into<glib::GString>) -> Self {
1363        Self {
1364            builder: self.builder.property("dhcp-duid", dhcp_duid.into()),
1365        }
1366    }
1367
1368    /// A IPv6 address followed by a slash and a prefix length. If set, the value is
1369    /// sent to the DHCPv6 server as hint indicating the prefix delegation (IA_PD) we
1370    /// want to receive.
1371    /// To only hint a prefix length without prefix, set the address part to the
1372    /// zero address (for example "::/60").
1373    #[cfg(feature = "v1_44")]
1374    #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
1375    pub fn dhcp_pd_hint(self, dhcp_pd_hint: impl Into<glib::GString>) -> Self {
1376        Self {
1377            builder: self.builder.property("dhcp-pd-hint", dhcp_pd_hint.into()),
1378        }
1379    }
1380
1381    /// Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941.  If
1382    /// enabled, it makes the kernel generate a temporary IPv6 address in
1383    /// addition to the public one generated from MAC address via modified
1384    /// EUI-64.  This enhances privacy, but could cause problems in some
1385    /// applications, on the other hand.  The permitted values are: -1: unknown,
1386    /// 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary
1387    /// addresses).
1388    ///
1389    /// Having a per-connection setting set to "-1" (default) means fallback to
1390    /// global configuration "ipv6.ip6-privacy". If it's also unspecified or set
1391    /// to "-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr".
1392    ///
1393    /// Note that this setting is distinct from the Stable Privacy addresses
1394    /// that can be enabled with the "addr-gen-mode" property's "stable-privacy"
1395    /// setting as another way of avoiding host tracking with IPv6 addresses.
1396    pub fn ip6_privacy(self, ip6_privacy: SettingIP6ConfigPrivacy) -> Self {
1397        Self {
1398            builder: self.builder.property("ip6-privacy", ip6_privacy),
1399        }
1400    }
1401
1402    /// Maximum transmission unit size, in bytes. If zero (the default), the MTU
1403    /// is set automatically from router advertisements or is left equal to the
1404    /// link-layer MTU. If greater than the link-layer MTU, or greater than zero
1405    /// but less than the minimum IPv6 MTU of 1280, this value has no effect.
1406    #[cfg(feature = "v1_40")]
1407    #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
1408    pub fn mtu(self, mtu: u32) -> Self {
1409        Self {
1410            builder: self.builder.property("mtu", mtu),
1411        }
1412    }
1413
1414    /// A timeout for waiting Router Advertisements in seconds. If zero (the default), a
1415    /// globally configured default is used. If still unspecified, the timeout depends on the
1416    /// sysctl settings of the device.
1417    ///
1418    /// Set to 2147483647 (MAXINT32) for infinity.
1419    #[cfg(feature = "v1_24")]
1420    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1421    pub fn ra_timeout(self, ra_timeout: i32) -> Self {
1422        Self {
1423            builder: self.builder.property("ra-timeout", ra_timeout),
1424        }
1425    }
1426
1427    /// The preferred lifetime of autogenerated temporary addresses, in seconds.
1428    ///
1429    /// Having a per-connection setting set to "0" (default) means fallback to
1430    /// global configuration "ipv6.temp-preferred-lifetime" setting". If it's also
1431    /// unspecified or set to "0", fallback to read
1432    /// "/proc/sys/net/ipv6/conf/default/temp_prefered_lft".
1433    #[cfg(feature = "v1_48")]
1434    #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
1435    pub fn temp_preferred_lifetime(self, temp_preferred_lifetime: i32) -> Self {
1436        Self {
1437            builder: self
1438                .builder
1439                .property("temp-preferred-lifetime", temp_preferred_lifetime),
1440        }
1441    }
1442
1443    /// The valid lifetime of autogenerated temporary addresses, in seconds.
1444    ///
1445    /// Having a per-connection setting set to "0" (default) means fallback to
1446    /// global configuration "ipv6.temp-valid-lifetime" setting". If it's also
1447    /// unspecified or set to "0", fallback to read
1448    /// "/proc/sys/net/ipv6/conf/default/temp_valid_lft".
1449    #[cfg(feature = "v1_48")]
1450    #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
1451    pub fn temp_valid_lifetime(self, temp_valid_lifetime: i32) -> Self {
1452        Self {
1453            builder: self
1454                .builder
1455                .property("temp-valid-lifetime", temp_valid_lifetime),
1456        }
1457    }
1458
1459    /// Configure the token for draft-chown-6man-tokenised-ipv6-identifiers-02
1460    /// IPv6 tokenized interface identifiers. Useful with eui64 addr-gen-mode.
1461    ///
1462    /// When set, the token is used as IPv6 interface identifier instead of the
1463    /// hardware address. This only applies to addresses from stateless
1464    /// autoconfiguration, not to IPv6 link local addresses.
1465    #[cfg(feature = "v1_4")]
1466    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
1467    pub fn token(self, token: impl Into<glib::GString>) -> Self {
1468        Self {
1469            builder: self.builder.property("token", token.into()),
1470        }
1471    }
1472
1473    /// Array of IP addresses.
1474    pub fn addresses(self, addresses: &[&IPAddress]) -> Self {
1475        Self {
1476            builder: self.builder.property(
1477                "addresses",
1478                addresses
1479                    .iter()
1480                    .map(|address| address.to_value())
1481                    .collect::<glib::ValueArray>(),
1482            ),
1483        }
1484    }
1485
1486    /// VPN connections will default to add the route automatically unless this
1487    /// setting is set to [`false`].
1488    ///
1489    /// For other connection types, adding such an automatic route is currently
1490    /// not supported and setting this to [`true`] has no effect.
1491    #[cfg(feature = "v1_42")]
1492    #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
1493    pub fn auto_route_ext_gw(self, auto_route_ext_gw: Ternary) -> Self {
1494        Self {
1495            builder: self
1496                .builder
1497                .property("auto-route-ext-gw", auto_route_ext_gw),
1498        }
1499    }
1500
1501    /// Maximum timeout in milliseconds used to check for the presence of duplicate
1502    /// IP addresses on the network.  If an address conflict is detected, the
1503    /// activation will fail. The property is currently implemented only for IPv4.
1504    ///
1505    /// A zero value means that no duplicate address detection is performed, -1 means
1506    /// the default value (either the value configured globally in NetworkManger.conf
1507    /// or 200ms).  A value greater than zero is a timeout in milliseconds.  Note that
1508    /// the time intervals are subject to randomization as per RFC 5227 and so the
1509    /// actual duration can be between half and the full time specified in this
1510    /// property.
1511    #[cfg(feature = "v1_2")]
1512    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1513    pub fn dad_timeout(self, dad_timeout: i32) -> Self {
1514        Self {
1515            builder: self.builder.property("dad-timeout", dad_timeout),
1516        }
1517    }
1518
1519    /// Specifies the value for the DSCP field (traffic class) of the IP header. When
1520    /// empty, the global default value is used; if no global default is specified, it is
1521    /// assumed to be "CS0". Allowed values are: "CS0", "CS4" and "CS6".
1522    ///
1523    /// The property is currently valid only for IPv4, and it is supported only by the
1524    /// "internal" DHCP plugin.
1525    #[cfg(feature = "v1_46")]
1526    #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
1527    pub fn dhcp_dscp(self, dhcp_dscp: impl Into<glib::GString>) -> Self {
1528        Self {
1529            builder: self.builder.property("dhcp-dscp", dhcp_dscp.into()),
1530        }
1531    }
1532
1533    /// If the #NMSettingIPConfig:dhcp-send-hostname property is [`true`], then the
1534    /// specified name will be sent to the DHCP server when acquiring a lease.
1535    /// This property and #NMSettingIP4Config:dhcp-fqdn are mutually exclusive and
1536    /// cannot be set at the same time.
1537    pub fn dhcp_hostname(self, dhcp_hostname: impl Into<glib::GString>) -> Self {
1538        Self {
1539            builder: self.builder.property("dhcp-hostname", dhcp_hostname.into()),
1540        }
1541    }
1542
1543    /// Flags for the DHCP hostname and FQDN.
1544    ///
1545    /// Currently, this property only includes flags to control the FQDN flags
1546    /// set in the DHCP FQDN option. Supported FQDN flags are
1547    /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE],
1548    /// [`DhcpHostnameFlags::FQDN_ENCODED`][crate::DhcpHostnameFlags::FQDN_ENCODED] and
1549    /// [`DhcpHostnameFlags::FQDN_NO_UPDATE`][crate::DhcpHostnameFlags::FQDN_NO_UPDATE].  When no FQDN flag is set and
1550    /// [`DhcpHostnameFlags::FQDN_CLEAR_FLAGS`][crate::DhcpHostnameFlags::FQDN_CLEAR_FLAGS] is set, the DHCP FQDN option will
1551    /// contain no flag. Otherwise, if no FQDN flag is set and
1552    /// [`DhcpHostnameFlags::FQDN_CLEAR_FLAGS`][crate::DhcpHostnameFlags::FQDN_CLEAR_FLAGS] is not set, the standard FQDN flags
1553    /// are set in the request:
1554    /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE],
1555    /// [`DhcpHostnameFlags::FQDN_ENCODED`][crate::DhcpHostnameFlags::FQDN_ENCODED] for IPv4 and
1556    /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE] for IPv6.
1557    ///
1558    /// When this property is set to the default value [`DhcpHostnameFlags::NONE`][crate::DhcpHostnameFlags::NONE],
1559    /// a global default is looked up in NetworkManager configuration. If that value
1560    /// is unset or also [`DhcpHostnameFlags::NONE`][crate::DhcpHostnameFlags::NONE], then the standard FQDN flags
1561    /// described above are sent in the DHCP requests.
1562    #[cfg(feature = "v1_22")]
1563    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
1564    pub fn dhcp_hostname_flags(self, dhcp_hostname_flags: u32) -> Self {
1565        Self {
1566            builder: self
1567                .builder
1568                .property("dhcp-hostname-flags", dhcp_hostname_flags),
1569        }
1570    }
1571
1572    /// A string containing the "Identity Association Identifier" (IAID) used by
1573    /// the DHCP client. The string can be a 32-bit number (either decimal,
1574    /// hexadecimal or as colon separated hexadecimal numbers). Alternatively
1575    /// it can be set to the special values "mac", "perm-mac", "ifname" or
1576    /// "stable". When set to "mac" (or "perm-mac"), the last 4 bytes of the
1577    /// current (or permanent) MAC address are used as IAID. When set to
1578    /// "ifname", the IAID is computed by hashing the interface name. The
1579    /// special value "stable" can be used to generate an IAID based on the
1580    /// stable-id (see connection.stable-id), a per-host key and the interface
1581    /// name. When the property is unset, the value from global configuration is
1582    /// used; if no global default is set then the IAID is assumed to be
1583    /// "ifname".
1584    ///
1585    /// For DHCPv4, the IAID is only used with "ipv4.dhcp-client-id"
1586    /// values "duid" and "ipv6-duid" to generate the client-id.
1587    ///
1588    /// For DHCPv6, note that at the moment this property is
1589    /// only supported by the "internal" DHCPv6 plugin. The "dhclient" DHCPv6
1590    /// plugin always derives the IAID from the MAC address.
1591    ///
1592    /// The actually used DHCPv6 IAID for a currently activated interface is
1593    /// exposed in the lease information of the device.
1594    #[cfg(feature = "v1_22")]
1595    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
1596    pub fn dhcp_iaid(self, dhcp_iaid: impl Into<glib::GString>) -> Self {
1597        Self {
1598            builder: self.builder.property("dhcp-iaid", dhcp_iaid.into()),
1599        }
1600    }
1601
1602    /// Array of servers from which DHCP offers must be rejected. This property
1603    /// is useful to avoid getting a lease from misconfigured or rogue servers.
1604    ///
1605    /// For DHCPv4, each element must be an IPv4 address, optionally
1606    /// followed by a slash and a prefix length (e.g. "192.168.122.0/24").
1607    ///
1608    /// This property is currently not implemented for DHCPv6.
1609    #[cfg(feature = "v1_28")]
1610    #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1611    pub fn dhcp_reject_servers(self, dhcp_reject_servers: impl Into<glib::StrV>) -> Self {
1612        Self {
1613            builder: self
1614                .builder
1615                .property("dhcp-reject-servers", dhcp_reject_servers.into()),
1616        }
1617    }
1618
1619    /// Since 1.52 this property is deprecated and is only used as fallback value
1620    /// for #NMSettingIPConfig:dhcp-send-hostname-v2 if it's set to 'default'.
1621    /// This is only done to avoid breaking existing configurations, the new
1622    /// property should be used from now on.
1623    /// use the new version of dhcp-send-hostname instead.
1624    #[cfg_attr(feature = "v1_52", deprecated = "Since 1.52")]
1625    pub fn dhcp_send_hostname(self, dhcp_send_hostname: bool) -> Self {
1626        Self {
1627            builder: self
1628                .builder
1629                .property("dhcp-send-hostname", dhcp_send_hostname),
1630        }
1631    }
1632
1633    /// If [`true`], a hostname is sent to the DHCP server when acquiring a lease.
1634    /// Some DHCP servers use this hostname to update DNS databases, essentially
1635    /// providing a static hostname for the computer.  If the
1636    /// #NMSettingIPConfig:dhcp-hostname property is [`None`] and this property is
1637    /// [`true`], the current persistent hostname of the computer is sent.
1638    ///
1639    /// The default value is [`Ternary::Default`][crate::Ternary::Default]. In this case the global value
1640    /// from NetworkManager configuration is looked up. If it's not set, the value
1641    /// from #NMSettingIPConfig:dhcp-send-hostname, which defaults to [`true`], is
1642    /// used for backwards compatibility. In the future this will change and, in
1643    /// absence of a global default, it will always fallback to [`true`].
1644    #[cfg(feature = "v1_52")]
1645    #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1646    pub fn dhcp_send_hostname_v2(self, dhcp_send_hostname_v2: i32) -> Self {
1647        Self {
1648            builder: self
1649                .builder
1650                .property("dhcp-send-hostname-v2", dhcp_send_hostname_v2),
1651        }
1652    }
1653
1654    /// Whether the DHCP client will send RELEASE message when
1655    /// bringing the connection down. The default value is [`Ternary::Default`][crate::Ternary::Default].
1656    /// When the default value is specified, then the global value from NetworkManager
1657    /// configuration is looked up, if not set, it is considered as [`false`].
1658    #[cfg(feature = "v1_48")]
1659    #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
1660    pub fn dhcp_send_release(self, dhcp_send_release: Ternary) -> Self {
1661        Self {
1662            builder: self
1663                .builder
1664                .property("dhcp-send-release", dhcp_send_release),
1665        }
1666    }
1667
1668    /// A timeout for a DHCP transaction in seconds. If zero (the default), a
1669    /// globally configured default is used. If still unspecified, a device specific
1670    /// timeout is used (usually 45 seconds).
1671    ///
1672    /// Set to 2147483647 (MAXINT32) for infinity.
1673    pub fn dhcp_timeout(self, dhcp_timeout: i32) -> Self {
1674        Self {
1675            builder: self.builder.property("dhcp-timeout", dhcp_timeout),
1676        }
1677    }
1678
1679    /// Array of DNS servers.
1680    ///
1681    /// Each server can be specified either as a plain IP address (optionally followed
1682    /// by a "#" and the SNI server name for DNS over TLS) or with a URI syntax.
1683    ///
1684    /// When it is specified as an URI, the following forms are supported:
1685    /// dns+udp://ADDRESS[:PORT], dns+tls://ADDRESS[:PORT][#SERVERNAME] .
1686    ///
1687    /// When using the URI syntax, IPv6 addresses must be enclosed in square
1688    /// brackets ('[', ']').
1689    pub fn dns(self, dns: impl Into<glib::StrV>) -> Self {
1690        Self {
1691            builder: self.builder.property("dns", dns.into()),
1692        }
1693    }
1694
1695    /// Array of DNS options to be added to resolv.conf.
1696    ///
1697    /// [`None`] means that the options are unset and left at the default.
1698    /// In this case NetworkManager will use default options. This is
1699    /// distinct from an empty list of properties.
1700    ///
1701    /// The following options are directly added to resolv.conf: "attempts",
1702    ///  "debug", "edns0",
1703    /// "inet6", "ip6-bytestring", "ip6-dotint", "ndots", "no-aaaa",
1704    /// "no-check-names", "no-ip6-dotint", "no-reload", "no-tld-query",
1705    /// "rotate", "single-request", "single-request-reopen", "timeout",
1706    /// "trust-ad", "use-vc". See the resolv.conf(5) man page for a
1707    /// detailed description of these options.
1708    ///
1709    /// In addition, NetworkManager supports the special options "_no-add-edns0"
1710    /// and "_no-add-trust-ad". They are not added to resolv.conf, and can be
1711    /// used to prevent the automatic addition of options "edns0" and "trust-ad"
1712    /// when using caching DNS plugins (see below).
1713    ///
1714    /// The "trust-ad" setting is only honored if the profile contributes
1715    /// name servers to resolv.conf, and if all contributing profiles have
1716    /// "trust-ad" enabled.
1717    ///
1718    /// When using a caching DNS plugin (dnsmasq or systemd-resolved in
1719    /// NetworkManager.conf) then "edns0" and "trust-ad" are automatically
1720    /// added, unless "_no-add-edns0" and "_no-add-trust-ad" are present.
1721    #[cfg(feature = "v1_2")]
1722    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1723    pub fn dns_options(self, dns_options: impl Into<glib::StrV>) -> Self {
1724        Self {
1725            builder: self.builder.property("dns-options", dns_options.into()),
1726        }
1727    }
1728
1729    /// DNS servers priority.
1730    ///
1731    /// The relative priority for DNS servers specified by this setting.  A lower
1732    /// numerical value is better (higher priority).
1733    ///
1734    /// Negative values have the special effect of excluding other configurations
1735    /// with a greater numerical priority value; so in presence of at least one negative
1736    /// priority, only DNS servers from connections with the lowest priority value will be used.
1737    /// To avoid all DNS leaks, set the priority of the profile that should be used
1738    /// to the most negative value of all active connections profiles.
1739    ///
1740    /// Zero selects a globally configured default value. If the latter is missing
1741    /// or zero too, it defaults to 50 for VPNs (including WireGuard) and 100 for
1742    /// other connections.
1743    ///
1744    /// Note that the priority is to order DNS settings for multiple active
1745    /// connections.  It does not disambiguate multiple DNS servers within the
1746    /// same connection profile.
1747    ///
1748    /// When multiple devices have configurations with the same priority, VPNs will be
1749    /// considered first, then devices with the best (lowest metric) default
1750    /// route and then all other devices.
1751    ///
1752    /// When using dns=default, servers with higher priority will be on top of
1753    /// resolv.conf. To prioritize a given server over another one within the
1754    /// same connection, just specify them in the desired order.
1755    /// Note that commonly the resolver tries name servers in /etc/resolv.conf
1756    /// in the order listed, proceeding with the next server in the list
1757    /// on failure. See for example the "rotate" option of the dns-options setting.
1758    /// If there are any negative DNS priorities, then only name servers from
1759    /// the devices with that lowest priority will be considered.
1760    ///
1761    /// When using a DNS resolver that supports Conditional Forwarding or
1762    /// Split DNS (with dns=dnsmasq or dns=systemd-resolved settings), each connection
1763    /// is used to query domains in its search list. The search domains determine which
1764    /// name servers to ask, and the DNS priority is used to prioritize
1765    /// name servers based on the domain.  Queries for domains not present in any
1766    /// search list are routed through connections having the '~.' special wildcard
1767    /// domain, which is added automatically to connections with the default route
1768    /// (or can be added manually).  When multiple connections specify the same domain, the
1769    /// one with the best priority (lowest numerical value) wins.  If a sub domain
1770    /// is configured on another interface it will be accepted regardless the priority,
1771    /// unless parent domain on the other interface has a negative priority, which causes
1772    /// the sub domain to be shadowed.
1773    /// With Split DNS one can avoid undesired DNS leaks by properly configuring
1774    /// DNS priorities and the search domains, so that only name servers of the desired
1775    /// interface are configured.
1776    #[cfg(feature = "v1_4")]
1777    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
1778    pub fn dns_priority(self, dns_priority: i32) -> Self {
1779        Self {
1780            builder: self.builder.property("dns-priority", dns_priority),
1781        }
1782    }
1783
1784    /// List of DNS search domains. Domains starting with a tilde ('~')
1785    /// are considered 'routing' domains and are used only to decide the
1786    /// interface over which a query must be forwarded; they are not used
1787    /// to complete unqualified host names.
1788    ///
1789    /// When using a DNS plugin that supports Conditional Forwarding or
1790    /// Split DNS, then the search domains specify which name servers to
1791    /// query. This makes the behavior different from running with plain
1792    /// /etc/resolv.conf. For more information see also the dns-priority setting.
1793    ///
1794    /// When set on a profile that also enabled DHCP, the DNS search list
1795    /// received automatically (option 119 for DHCPv4 and option 24 for DHCPv6)
1796    /// gets merged with the manual list. This can be prevented by setting
1797    /// "ignore-auto-dns". Note that if no DNS searches are configured, the
1798    /// fallback will be derived from the domain from DHCP (option 15).
1799    pub fn dns_search(self, dns_search: impl Into<glib::StrV>) -> Self {
1800        Self {
1801            builder: self.builder.property("dns-search", dns_search.into()),
1802        }
1803    }
1804
1805    /// Whether to configure sysctl interface-specific forwarding. When enabled, the interface
1806    /// will act as a router to forward the packet from one interface to another. When set to
1807    /// [`SettingIPConfigForwarding::Default`][crate::SettingIPConfigForwarding::Default], the value from global configuration is used;
1808    /// if no global default is defined, [`SettingIPConfigForwarding::Auto`][crate::SettingIPConfigForwarding::Auto] will be used.
1809    /// The #NMSettingIPConfig:forwarding property is ignored when #NMSettingIPConfig:method
1810    /// is set to "shared", because forwarding is always enabled in this case.
1811    /// The accepted values are:
1812    ///   [`SettingIPConfigForwarding::Default`][crate::SettingIPConfigForwarding::Default]: use global default.
1813    ///   [`SettingIPConfigForwarding::No`][crate::SettingIPConfigForwarding::No]: disabled.
1814    ///   [`SettingIPConfigForwarding::Yes`][crate::SettingIPConfigForwarding::Yes]: enabled.
1815    ///   [`SettingIPConfigForwarding::Auto`][crate::SettingIPConfigForwarding::Auto]: enable if any shared connection is active,
1816    ///        use kernel default otherwise.
1817    #[cfg(feature = "v1_54")]
1818    #[cfg_attr(docsrs, doc(cfg(feature = "v1_54")))]
1819    pub fn forwarding(self, forwarding: i32) -> Self {
1820        Self {
1821            builder: self.builder.property("forwarding", forwarding),
1822        }
1823    }
1824
1825    /// The gateway associated with this configuration. This is only meaningful
1826    /// if #NMSettingIPConfig:addresses is also set.
1827    ///
1828    /// Setting the gateway causes NetworkManager to configure a standard default route
1829    /// with the gateway as next hop. This is ignored if #NMSettingIPConfig:never-default
1830    /// is set. An alternative is to configure the default route explicitly with a manual
1831    /// route and /0 as prefix length.
1832    ///
1833    /// Note that the gateway usually conflicts with routing that NetworkManager configures
1834    /// for WireGuard interfaces, so usually it should not be set in that case. See
1835    /// #NMSettingWireGuard:ip4-auto-default-route.
1836    pub fn gateway(self, gateway: impl Into<glib::GString>) -> Self {
1837        Self {
1838            builder: self.builder.property("gateway", gateway.into()),
1839        }
1840    }
1841
1842    /// When #NMSettingIPConfig:method is set to "auto" and this property to
1843    /// [`true`], automatically configured name servers and search domains are
1844    /// ignored and only name servers and search domains specified in the
1845    /// #NMSettingIPConfig:dns and #NMSettingIPConfig:dns-search properties, if
1846    /// any, are used.
1847    pub fn ignore_auto_dns(self, ignore_auto_dns: bool) -> Self {
1848        Self {
1849            builder: self.builder.property("ignore-auto-dns", ignore_auto_dns),
1850        }
1851    }
1852
1853    /// When #NMSettingIPConfig:method is set to "auto" and this property to
1854    /// [`true`], automatically configured routes are ignored and only routes
1855    /// specified in the #NMSettingIPConfig:routes property, if any, are used.
1856    pub fn ignore_auto_routes(self, ignore_auto_routes: bool) -> Self {
1857        Self {
1858            builder: self
1859                .builder
1860                .property("ignore-auto-routes", ignore_auto_routes),
1861        }
1862    }
1863
1864    /// If [`true`], allow overall network configuration to proceed even if the
1865    /// configuration specified by this property times out.  Note that at least
1866    /// one IP configuration must succeed or overall network configuration will
1867    /// still fail.  For example, in IPv6-only networks, setting this property to
1868    /// [`true`] on the #NMSettingIP4Config allows the overall network configuration
1869    /// to succeed if IPv4 configuration fails but IPv6 configuration completes
1870    /// successfully.
1871    pub fn may_fail(self, may_fail: bool) -> Self {
1872        Self {
1873            builder: self.builder.property("may-fail", may_fail),
1874        }
1875    }
1876
1877    /// IP configuration method.
1878    ///
1879    /// #NMSettingIP4Config and #NMSettingIP6Config both support "disabled",
1880    /// "auto", "manual", and "link-local". See the subclass-specific
1881    /// documentation for other values.
1882    ///
1883    /// In general, for the "auto" method, properties such as
1884    /// #NMSettingIPConfig:dns and #NMSettingIPConfig:routes specify information
1885    /// that is added on to the information returned from automatic
1886    /// configuration.  The #NMSettingIPConfig:ignore-auto-routes and
1887    /// #NMSettingIPConfig:ignore-auto-dns properties modify this behavior.
1888    ///
1889    /// For methods that imply no upstream network, such as "shared" or
1890    /// "link-local", these properties must be empty.
1891    ///
1892    /// For IPv4 method "shared", the IP subnet can be configured by adding one
1893    /// manual IPv4 address or otherwise 10.42.x.0/24 is chosen. Note that the
1894    /// shared method must be configured on the interface which shares the internet
1895    /// to a subnet, not on the uplink which is shared.
1896    pub fn method(self, method: impl Into<glib::GString>) -> Self {
1897        Self {
1898            builder: self.builder.property("method", method.into()),
1899        }
1900    }
1901
1902    /// If [`true`], this connection will never be the default connection for this
1903    /// IP type, meaning it will never be assigned the default route by
1904    /// NetworkManager.
1905    pub fn never_default(self, never_default: bool) -> Self {
1906        Self {
1907            builder: self.builder.property("never-default", never_default),
1908        }
1909    }
1910
1911    /// Connections will default to keep the autogenerated priority 0 local rule
1912    /// unless this setting is set to [`true`].
1913    #[cfg(feature = "v1_44")]
1914    #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
1915    pub fn replace_local_rule(self, replace_local_rule: Ternary) -> Self {
1916        Self {
1917            builder: self
1918                .builder
1919                .property("replace-local-rule", replace_local_rule),
1920        }
1921    }
1922
1923    /// The minimum time interval in milliseconds for which dynamic IP configuration
1924    /// should be tried before the connection succeeds.
1925    ///
1926    /// This property is useful for example if both IPv4 and IPv6 are enabled and
1927    /// are allowed to fail. Normally the connection succeeds as soon as one of
1928    /// the two address families completes; by setting a required timeout for
1929    /// e.g. IPv4, one can ensure that even if IP6 succeeds earlier than IPv4,
1930    /// NetworkManager waits some time for IPv4 before the connection becomes
1931    /// active.
1932    ///
1933    /// Note that if #NMSettingIPConfig:may-fail is FALSE for the same address
1934    /// family, this property has no effect as NetworkManager needs to wait for
1935    /// the full DHCP timeout.
1936    ///
1937    /// A zero value means that no required timeout is present, -1 means the
1938    /// default value (either configuration ipvx.required-timeout override or
1939    /// zero).
1940    #[cfg(feature = "v1_34")]
1941    #[cfg_attr(docsrs, doc(cfg(feature = "v1_34")))]
1942    pub fn required_timeout(self, required_timeout: i32) -> Self {
1943        Self {
1944            builder: self.builder.property("required-timeout", required_timeout),
1945        }
1946    }
1947
1948    /// The default metric for routes that don't explicitly specify a metric.
1949    /// The default value -1 means that the metric is chosen automatically
1950    /// based on the device type.
1951    /// The metric applies to dynamic routes, manual (static) routes that
1952    /// don't have an explicit metric setting, address prefix routes, and
1953    /// the default route.
1954    /// Note that for IPv6, the kernel accepts zero (0) but coerces it to
1955    /// 1024 (user default). Hence, setting this property to zero effectively
1956    /// mean setting it to 1024.
1957    /// For IPv4, zero is a regular value for the metric.
1958    pub fn route_metric(self, route_metric: i64) -> Self {
1959        Self {
1960            builder: self.builder.property("route-metric", route_metric),
1961        }
1962    }
1963
1964    /// Enable policy routing (source routing) and set the routing table used when adding routes.
1965    ///
1966    /// This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes
1967    /// and static routes. But note that static routes can individually overwrite the setting
1968    /// by explicitly specifying a non-zero routing table.
1969    ///
1970    /// If the table setting is left at zero, it is eligible to be overwritten via global
1971    /// configuration. If the property is zero even after applying the global configuration
1972    /// value, policy routing is disabled for the address family of this connection.
1973    ///
1974    /// Policy routing disabled means that NetworkManager will add all routes to the main
1975    /// table (except static routes that explicitly configure a different table). Additionally,
1976    /// NetworkManager will not delete any extraneous routes from tables except the main table.
1977    /// This is to preserve backward compatibility for users who manage routing tables outside
1978    /// of NetworkManager.
1979    #[cfg(feature = "v1_10")]
1980    #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
1981    pub fn route_table(self, route_table: u32) -> Self {
1982        Self {
1983            builder: self.builder.property("route-table", route_table),
1984        }
1985    }
1986
1987    /// Whether to add routes for DNS servers. When enabled, NetworkManager adds a route
1988    /// for each DNS server that is associated with this connection either statically
1989    /// (defined in the connection profile) or dynamically (for example, retrieved via
1990    /// DHCP). The route guarantees that the DNS server is reached via this interface. When
1991    /// set to [`SettingIPConfigRoutedDns::Default`][crate::SettingIPConfigRoutedDns::Default], the value from global
1992    /// configuration is used; if no global default is defined, this feature is disabled.
1993    #[cfg(feature = "v1_52")]
1994    #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1995    pub fn routed_dns(self, routed_dns: i32) -> Self {
1996        Self {
1997            builder: self.builder.property("routed-dns", routed_dns),
1998        }
1999    }
2000
2001    /// Array of IP routes.
2002    pub fn routes(self, routes: &[&IPRoute]) -> Self {
2003        Self {
2004            builder: self.builder.property(
2005                "routes",
2006                routes
2007                    .iter()
2008                    .map(|route| route.to_value())
2009                    .collect::<glib::ValueArray>(),
2010            ),
2011        }
2012    }
2013
2014    /// This option allows you to specify a custom DHCP lease time for the shared connection
2015    /// method in seconds. The value should be either a number between 120 and 31536000 (one year)
2016    /// If this option is not specified, 3600 (one hour) is used.
2017    ///
2018    /// Special values are 0 for default value of 1 hour and 2147483647 (MAXINT32) for infinite lease time.
2019    #[cfg(feature = "v1_52")]
2020    #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2021    pub fn shared_dhcp_lease_time(self, shared_dhcp_lease_time: i32) -> Self {
2022        Self {
2023            builder: self
2024                .builder
2025                .property("shared-dhcp-lease-time", shared_dhcp_lease_time),
2026        }
2027    }
2028
2029    /// This option allows you to specify a custom DHCP range for the shared connection
2030    /// method. The value is expected to be in `<START_ADDRESS>,<END_ADDRESS>` format.
2031    /// The range should be part of network set by ipv4.address option and it should
2032    /// not contain network address or broadcast address. If this option is not specified,
2033    /// the DHCP range will be automatically determined based on the interface address.
2034    /// The range will be selected to be adjacent to the interface address, either before
2035    /// or after it, with the larger possible range being preferred. The range will be
2036    /// adjusted to fill the available address space, except for networks with a prefix
2037    /// length greater than 24, which will be treated as if they have a prefix length of 24.
2038    #[cfg(feature = "v1_52")]
2039    #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2040    pub fn shared_dhcp_range(self, shared_dhcp_range: impl Into<glib::GString>) -> Self {
2041        Self {
2042            builder: self
2043                .builder
2044                .property("shared-dhcp-range", shared_dhcp_range.into()),
2045        }
2046    }
2047
2048    // rustdoc-stripper-ignore-next
2049    /// Build the [`SettingIP6Config`].
2050    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
2051    pub fn build(self) -> SettingIP6Config {
2052        assert_initialized_main_thread!();
2053        self.builder.build()
2054    }
2055}