nm_rs/auto/setting_ip_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#![allow(deprecated)]
6
7#[cfg(feature = "v1_22")]
8#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
9use crate::DhcpHostnameFlags;
10#[cfg(feature = "v1_18")]
11#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
12use crate::IPRoutingRule;
13#[cfg(feature = "v1_54")]
14#[cfg_attr(docsrs, doc(cfg(feature = "v1_54")))]
15use crate::SettingIPConfigForwarding;
16#[cfg(feature = "v1_52")]
17#[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
18use crate::SettingIPConfigRoutedDns;
19#[cfg(feature = "v1_42")]
20#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
21use crate::Ternary;
22use crate::{IPAddress, IPRoute, Setting, ffi};
23use glib::{
24 prelude::*,
25 signal::{SignalHandlerId, connect_raw},
26 translate::*,
27 value::FromValue,
28};
29use std::boxed::Box as Box_;
30
31glib::wrapper! {
32 ///
33 ///
34 /// This is an Abstract Base Class, you cannot instantiate it.
35 ///
36 /// ## Properties
37 ///
38 ///
39 /// #### `addresses`
40 /// Array of IP addresses.
41 ///
42 /// Readable | Writeable
43 ///
44 ///
45 /// #### `auto-route-ext-gw`
46 /// VPN connections will default to add the route automatically unless this
47 /// setting is set to [`false`].
48 ///
49 /// For other connection types, adding such an automatic route is currently
50 /// not supported and setting this to [`true`] has no effect.
51 ///
52 /// Readable | Writeable
53 ///
54 ///
55 /// #### `dad-timeout`
56 /// Maximum timeout in milliseconds used to check for the presence of duplicate
57 /// IP addresses on the network. If an address conflict is detected, the
58 /// activation will fail. The property is currently implemented only for IPv4.
59 ///
60 /// A zero value means that no duplicate address detection is performed, -1 means
61 /// the default value (either the value configured globally in NetworkManger.conf
62 /// or 200ms). A value greater than zero is a timeout in milliseconds. Note that
63 /// the time intervals are subject to randomization as per RFC 5227 and so the
64 /// actual duration can be between half and the full time specified in this
65 /// property.
66 ///
67 /// Readable | Writeable
68 ///
69 ///
70 /// #### `dhcp-dscp`
71 /// Specifies the value for the DSCP field (traffic class) of the IP header. When
72 /// empty, the global default value is used; if no global default is specified, it is
73 /// assumed to be "CS0". Allowed values are: "CS0", "CS4" and "CS6".
74 ///
75 /// The property is currently valid only for IPv4, and it is supported only by the
76 /// "internal" DHCP plugin.
77 ///
78 /// Readable | Writeable
79 ///
80 ///
81 /// #### `dhcp-hostname`
82 /// If the #NMSettingIPConfig:dhcp-send-hostname property is [`true`], then the
83 /// specified name will be sent to the DHCP server when acquiring a lease.
84 /// This property and #NMSettingIP4Config:dhcp-fqdn are mutually exclusive and
85 /// cannot be set at the same time.
86 ///
87 /// Readable | Writeable
88 ///
89 ///
90 /// #### `dhcp-hostname-flags`
91 /// Flags for the DHCP hostname and FQDN.
92 ///
93 /// Currently, this property only includes flags to control the FQDN flags
94 /// set in the DHCP FQDN option. Supported FQDN flags are
95 /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE],
96 /// [`DhcpHostnameFlags::FQDN_ENCODED`][crate::DhcpHostnameFlags::FQDN_ENCODED] and
97 /// [`DhcpHostnameFlags::FQDN_NO_UPDATE`][crate::DhcpHostnameFlags::FQDN_NO_UPDATE]. When no FQDN flag is set and
98 /// [`DhcpHostnameFlags::FQDN_CLEAR_FLAGS`][crate::DhcpHostnameFlags::FQDN_CLEAR_FLAGS] is set, the DHCP FQDN option will
99 /// contain no flag. Otherwise, if no FQDN flag is set and
100 /// [`DhcpHostnameFlags::FQDN_CLEAR_FLAGS`][crate::DhcpHostnameFlags::FQDN_CLEAR_FLAGS] is not set, the standard FQDN flags
101 /// are set in the request:
102 /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE],
103 /// [`DhcpHostnameFlags::FQDN_ENCODED`][crate::DhcpHostnameFlags::FQDN_ENCODED] for IPv4 and
104 /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE] for IPv6.
105 ///
106 /// When this property is set to the default value [`DhcpHostnameFlags::NONE`][crate::DhcpHostnameFlags::NONE],
107 /// a global default is looked up in NetworkManager configuration. If that value
108 /// is unset or also [`DhcpHostnameFlags::NONE`][crate::DhcpHostnameFlags::NONE], then the standard FQDN flags
109 /// described above are sent in the DHCP requests.
110 ///
111 /// Readable | Writeable
112 ///
113 ///
114 /// #### `dhcp-iaid`
115 /// A string containing the "Identity Association Identifier" (IAID) used by
116 /// the DHCP client. The string can be a 32-bit number (either decimal,
117 /// hexadecimal or as colon separated hexadecimal numbers). Alternatively
118 /// it can be set to the special values "mac", "perm-mac", "ifname" or
119 /// "stable". When set to "mac" (or "perm-mac"), the last 4 bytes of the
120 /// current (or permanent) MAC address are used as IAID. When set to
121 /// "ifname", the IAID is computed by hashing the interface name. The
122 /// special value "stable" can be used to generate an IAID based on the
123 /// stable-id (see connection.stable-id), a per-host key and the interface
124 /// name. When the property is unset, the value from global configuration is
125 /// used; if no global default is set then the IAID is assumed to be
126 /// "ifname".
127 ///
128 /// For DHCPv4, the IAID is only used with "ipv4.dhcp-client-id"
129 /// values "duid" and "ipv6-duid" to generate the client-id.
130 ///
131 /// For DHCPv6, note that at the moment this property is
132 /// only supported by the "internal" DHCPv6 plugin. The "dhclient" DHCPv6
133 /// plugin always derives the IAID from the MAC address.
134 ///
135 /// The actually used DHCPv6 IAID for a currently activated interface is
136 /// exposed in the lease information of the device.
137 ///
138 /// Readable | Writeable
139 ///
140 ///
141 /// #### `dhcp-reject-servers`
142 /// Array of servers from which DHCP offers must be rejected. This property
143 /// is useful to avoid getting a lease from misconfigured or rogue servers.
144 ///
145 /// For DHCPv4, each element must be an IPv4 address, optionally
146 /// followed by a slash and a prefix length (e.g. "192.168.122.0/24").
147 ///
148 /// This property is currently not implemented for DHCPv6.
149 ///
150 /// Readable | Writeable
151 ///
152 ///
153 /// #### `dhcp-send-hostname`
154 /// Since 1.52 this property is deprecated and is only used as fallback value
155 /// for #NMSettingIPConfig:dhcp-send-hostname-v2 if it's set to 'default'.
156 /// This is only done to avoid breaking existing configurations, the new
157 /// property should be used from now on.
158 ///
159 /// Readable | Writeable
160 ///
161 ///
162 /// #### `dhcp-send-hostname-v2`
163 /// If [`true`], a hostname is sent to the DHCP server when acquiring a lease.
164 /// Some DHCP servers use this hostname to update DNS databases, essentially
165 /// providing a static hostname for the computer. If the
166 /// #NMSettingIPConfig:dhcp-hostname property is [`None`] and this property is
167 /// [`true`], the current persistent hostname of the computer is sent.
168 ///
169 /// The default value is [`Ternary::Default`][crate::Ternary::Default]. In this case the global value
170 /// from NetworkManager configuration is looked up. If it's not set, the value
171 /// from #NMSettingIPConfig:dhcp-send-hostname, which defaults to [`true`], is
172 /// used for backwards compatibility. In the future this will change and, in
173 /// absence of a global default, it will always fallback to [`true`].
174 ///
175 /// Readable | Writeable
176 ///
177 ///
178 /// #### `dhcp-send-release`
179 /// Whether the DHCP client will send RELEASE message when
180 /// bringing the connection down. The default value is [`Ternary::Default`][crate::Ternary::Default].
181 /// When the default value is specified, then the global value from NetworkManager
182 /// configuration is looked up, if not set, it is considered as [`false`].
183 ///
184 /// Readable | Writeable
185 ///
186 ///
187 /// #### `dhcp-timeout`
188 /// A timeout for a DHCP transaction in seconds. If zero (the default), a
189 /// globally configured default is used. If still unspecified, a device specific
190 /// timeout is used (usually 45 seconds).
191 ///
192 /// Set to 2147483647 (MAXINT32) for infinity.
193 ///
194 /// Readable | Writeable
195 ///
196 ///
197 /// #### `dns`
198 /// Array of DNS servers.
199 ///
200 /// Each server can be specified either as a plain IP address (optionally followed
201 /// by a "#" and the SNI server name for DNS over TLS) or with a URI syntax.
202 ///
203 /// When it is specified as an URI, the following forms are supported:
204 /// dns+udp://ADDRESS[:PORT], dns+tls://ADDRESS[:PORT][#SERVERNAME] .
205 ///
206 /// When using the URI syntax, IPv6 addresses must be enclosed in square
207 /// brackets ('[', ']').
208 ///
209 /// Readable | Writeable
210 ///
211 ///
212 /// #### `dns-options`
213 /// Array of DNS options to be added to resolv.conf.
214 ///
215 /// [`None`] means that the options are unset and left at the default.
216 /// In this case NetworkManager will use default options. This is
217 /// distinct from an empty list of properties.
218 ///
219 /// The following options are directly added to resolv.conf: "attempts",
220 /// "debug", "edns0",
221 /// "inet6", "ip6-bytestring", "ip6-dotint", "ndots", "no-aaaa",
222 /// "no-check-names", "no-ip6-dotint", "no-reload", "no-tld-query",
223 /// "rotate", "single-request", "single-request-reopen", "timeout",
224 /// "trust-ad", "use-vc". See the resolv.conf(5) man page for a
225 /// detailed description of these options.
226 ///
227 /// In addition, NetworkManager supports the special options "_no-add-edns0"
228 /// and "_no-add-trust-ad". They are not added to resolv.conf, and can be
229 /// used to prevent the automatic addition of options "edns0" and "trust-ad"
230 /// when using caching DNS plugins (see below).
231 ///
232 /// The "trust-ad" setting is only honored if the profile contributes
233 /// name servers to resolv.conf, and if all contributing profiles have
234 /// "trust-ad" enabled.
235 ///
236 /// When using a caching DNS plugin (dnsmasq or systemd-resolved in
237 /// NetworkManager.conf) then "edns0" and "trust-ad" are automatically
238 /// added, unless "_no-add-edns0" and "_no-add-trust-ad" are present.
239 ///
240 /// Readable | Writeable
241 ///
242 ///
243 /// #### `dns-priority`
244 /// DNS servers priority.
245 ///
246 /// The relative priority for DNS servers specified by this setting. A lower
247 /// numerical value is better (higher priority).
248 ///
249 /// Negative values have the special effect of excluding other configurations
250 /// with a greater numerical priority value; so in presence of at least one negative
251 /// priority, only DNS servers from connections with the lowest priority value will be used.
252 /// To avoid all DNS leaks, set the priority of the profile that should be used
253 /// to the most negative value of all active connections profiles.
254 ///
255 /// Zero selects a globally configured default value. If the latter is missing
256 /// or zero too, it defaults to 50 for VPNs (including WireGuard) and 100 for
257 /// other connections.
258 ///
259 /// Note that the priority is to order DNS settings for multiple active
260 /// connections. It does not disambiguate multiple DNS servers within the
261 /// same connection profile.
262 ///
263 /// When multiple devices have configurations with the same priority, VPNs will be
264 /// considered first, then devices with the best (lowest metric) default
265 /// route and then all other devices.
266 ///
267 /// When using dns=default, servers with higher priority will be on top of
268 /// resolv.conf. To prioritize a given server over another one within the
269 /// same connection, just specify them in the desired order.
270 /// Note that commonly the resolver tries name servers in /etc/resolv.conf
271 /// in the order listed, proceeding with the next server in the list
272 /// on failure. See for example the "rotate" option of the dns-options setting.
273 /// If there are any negative DNS priorities, then only name servers from
274 /// the devices with that lowest priority will be considered.
275 ///
276 /// When using a DNS resolver that supports Conditional Forwarding or
277 /// Split DNS (with dns=dnsmasq or dns=systemd-resolved settings), each connection
278 /// is used to query domains in its search list. The search domains determine which
279 /// name servers to ask, and the DNS priority is used to prioritize
280 /// name servers based on the domain. Queries for domains not present in any
281 /// search list are routed through connections having the '~.' special wildcard
282 /// domain, which is added automatically to connections with the default route
283 /// (or can be added manually). When multiple connections specify the same domain, the
284 /// one with the best priority (lowest numerical value) wins. If a sub domain
285 /// is configured on another interface it will be accepted regardless the priority,
286 /// unless parent domain on the other interface has a negative priority, which causes
287 /// the sub domain to be shadowed.
288 /// With Split DNS one can avoid undesired DNS leaks by properly configuring
289 /// DNS priorities and the search domains, so that only name servers of the desired
290 /// interface are configured.
291 ///
292 /// Readable | Writeable
293 ///
294 ///
295 /// #### `dns-search`
296 /// List of DNS search domains. Domains starting with a tilde ('~')
297 /// are considered 'routing' domains and are used only to decide the
298 /// interface over which a query must be forwarded; they are not used
299 /// to complete unqualified host names.
300 ///
301 /// When using a DNS plugin that supports Conditional Forwarding or
302 /// Split DNS, then the search domains specify which name servers to
303 /// query. This makes the behavior different from running with plain
304 /// /etc/resolv.conf. For more information see also the dns-priority setting.
305 ///
306 /// When set on a profile that also enabled DHCP, the DNS search list
307 /// received automatically (option 119 for DHCPv4 and option 24 for DHCPv6)
308 /// gets merged with the manual list. This can be prevented by setting
309 /// "ignore-auto-dns". Note that if no DNS searches are configured, the
310 /// fallback will be derived from the domain from DHCP (option 15).
311 ///
312 /// Readable | Writeable
313 ///
314 ///
315 /// #### `forwarding`
316 /// Whether to configure sysctl interface-specific forwarding. When enabled, the interface
317 /// will act as a router to forward the packet from one interface to another. When set to
318 /// [`SettingIPConfigForwarding::Default`][crate::SettingIPConfigForwarding::Default], the value from global configuration is used;
319 /// if no global default is defined, [`SettingIPConfigForwarding::Auto`][crate::SettingIPConfigForwarding::Auto] will be used.
320 /// The #NMSettingIPConfig:forwarding property is ignored when #NMSettingIPConfig:method
321 /// is set to "shared", because forwarding is always enabled in this case.
322 /// The accepted values are:
323 /// [`SettingIPConfigForwarding::Default`][crate::SettingIPConfigForwarding::Default]: use global default.
324 /// [`SettingIPConfigForwarding::No`][crate::SettingIPConfigForwarding::No]: disabled.
325 /// [`SettingIPConfigForwarding::Yes`][crate::SettingIPConfigForwarding::Yes]: enabled.
326 /// [`SettingIPConfigForwarding::Auto`][crate::SettingIPConfigForwarding::Auto]: enable if any shared connection is active,
327 /// use kernel default otherwise.
328 ///
329 /// Readable | Writeable
330 ///
331 ///
332 /// #### `gateway`
333 /// The gateway associated with this configuration. This is only meaningful
334 /// if #NMSettingIPConfig:addresses is also set.
335 ///
336 /// Setting the gateway causes NetworkManager to configure a standard default route
337 /// with the gateway as next hop. This is ignored if #NMSettingIPConfig:never-default
338 /// is set. An alternative is to configure the default route explicitly with a manual
339 /// route and /0 as prefix length.
340 ///
341 /// Note that the gateway usually conflicts with routing that NetworkManager configures
342 /// for WireGuard interfaces, so usually it should not be set in that case. See
343 /// #NMSettingWireGuard:ip4-auto-default-route.
344 ///
345 /// Readable | Writeable
346 ///
347 ///
348 /// #### `ignore-auto-dns`
349 /// When #NMSettingIPConfig:method is set to "auto" and this property to
350 /// [`true`], automatically configured name servers and search domains are
351 /// ignored and only name servers and search domains specified in the
352 /// #NMSettingIPConfig:dns and #NMSettingIPConfig:dns-search properties, if
353 /// any, are used.
354 ///
355 /// Readable | Writeable
356 ///
357 ///
358 /// #### `ignore-auto-routes`
359 /// When #NMSettingIPConfig:method is set to "auto" and this property to
360 /// [`true`], automatically configured routes are ignored and only routes
361 /// specified in the #NMSettingIPConfig:routes property, if any, are used.
362 ///
363 /// Readable | Writeable
364 ///
365 ///
366 /// #### `may-fail`
367 /// If [`true`], allow overall network configuration to proceed even if the
368 /// configuration specified by this property times out. Note that at least
369 /// one IP configuration must succeed or overall network configuration will
370 /// still fail. For example, in IPv6-only networks, setting this property to
371 /// [`true`] on the #NMSettingIP4Config allows the overall network configuration
372 /// to succeed if IPv4 configuration fails but IPv6 configuration completes
373 /// successfully.
374 ///
375 /// Readable | Writeable
376 ///
377 ///
378 /// #### `method`
379 /// IP configuration method.
380 ///
381 /// #NMSettingIP4Config and #NMSettingIP6Config both support "disabled",
382 /// "auto", "manual", and "link-local". See the subclass-specific
383 /// documentation for other values.
384 ///
385 /// In general, for the "auto" method, properties such as
386 /// #NMSettingIPConfig:dns and #NMSettingIPConfig:routes specify information
387 /// that is added on to the information returned from automatic
388 /// configuration. The #NMSettingIPConfig:ignore-auto-routes and
389 /// #NMSettingIPConfig:ignore-auto-dns properties modify this behavior.
390 ///
391 /// For methods that imply no upstream network, such as "shared" or
392 /// "link-local", these properties must be empty.
393 ///
394 /// For IPv4 method "shared", the IP subnet can be configured by adding one
395 /// manual IPv4 address or otherwise 10.42.x.0/24 is chosen. Note that the
396 /// shared method must be configured on the interface which shares the internet
397 /// to a subnet, not on the uplink which is shared.
398 ///
399 /// Readable | Writeable
400 ///
401 ///
402 /// #### `never-default`
403 /// If [`true`], this connection will never be the default connection for this
404 /// IP type, meaning it will never be assigned the default route by
405 /// NetworkManager.
406 ///
407 /// Readable | Writeable
408 ///
409 ///
410 /// #### `replace-local-rule`
411 /// Connections will default to keep the autogenerated priority 0 local rule
412 /// unless this setting is set to [`true`].
413 ///
414 /// Readable | Writeable
415 ///
416 ///
417 /// #### `required-timeout`
418 /// The minimum time interval in milliseconds for which dynamic IP configuration
419 /// should be tried before the connection succeeds.
420 ///
421 /// This property is useful for example if both IPv4 and IPv6 are enabled and
422 /// are allowed to fail. Normally the connection succeeds as soon as one of
423 /// the two address families completes; by setting a required timeout for
424 /// e.g. IPv4, one can ensure that even if IP6 succeeds earlier than IPv4,
425 /// NetworkManager waits some time for IPv4 before the connection becomes
426 /// active.
427 ///
428 /// Note that if #NMSettingIPConfig:may-fail is FALSE for the same address
429 /// family, this property has no effect as NetworkManager needs to wait for
430 /// the full DHCP timeout.
431 ///
432 /// A zero value means that no required timeout is present, -1 means the
433 /// default value (either configuration ipvx.required-timeout override or
434 /// zero).
435 ///
436 /// Readable | Writeable
437 ///
438 ///
439 /// #### `route-metric`
440 /// The default metric for routes that don't explicitly specify a metric.
441 /// The default value -1 means that the metric is chosen automatically
442 /// based on the device type.
443 /// The metric applies to dynamic routes, manual (static) routes that
444 /// don't have an explicit metric setting, address prefix routes, and
445 /// the default route.
446 /// Note that for IPv6, the kernel accepts zero (0) but coerces it to
447 /// 1024 (user default). Hence, setting this property to zero effectively
448 /// mean setting it to 1024.
449 /// For IPv4, zero is a regular value for the metric.
450 ///
451 /// Readable | Writeable
452 ///
453 ///
454 /// #### `route-table`
455 /// Enable policy routing (source routing) and set the routing table used when adding routes.
456 ///
457 /// This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes
458 /// and static routes. But note that static routes can individually overwrite the setting
459 /// by explicitly specifying a non-zero routing table.
460 ///
461 /// If the table setting is left at zero, it is eligible to be overwritten via global
462 /// configuration. If the property is zero even after applying the global configuration
463 /// value, policy routing is disabled for the address family of this connection.
464 ///
465 /// Policy routing disabled means that NetworkManager will add all routes to the main
466 /// table (except static routes that explicitly configure a different table). Additionally,
467 /// NetworkManager will not delete any extraneous routes from tables except the main table.
468 /// This is to preserve backward compatibility for users who manage routing tables outside
469 /// of NetworkManager.
470 ///
471 /// Readable | Writeable
472 ///
473 ///
474 /// #### `routed-dns`
475 /// Whether to add routes for DNS servers. When enabled, NetworkManager adds a route
476 /// for each DNS server that is associated with this connection either statically
477 /// (defined in the connection profile) or dynamically (for example, retrieved via
478 /// DHCP). The route guarantees that the DNS server is reached via this interface. When
479 /// set to [`SettingIPConfigRoutedDns::Default`][crate::SettingIPConfigRoutedDns::Default], the value from global
480 /// configuration is used; if no global default is defined, this feature is disabled.
481 ///
482 /// Readable | Writeable
483 ///
484 ///
485 /// #### `routes`
486 /// Array of IP routes.
487 ///
488 /// Readable | Writeable
489 ///
490 ///
491 /// #### `shared-dhcp-lease-time`
492 /// This option allows you to specify a custom DHCP lease time for the shared connection
493 /// method in seconds. The value should be either a number between 120 and 31536000 (one year)
494 /// If this option is not specified, 3600 (one hour) is used.
495 ///
496 /// Special values are 0 for default value of 1 hour and 2147483647 (MAXINT32) for infinite lease time.
497 ///
498 /// Readable | Writeable
499 ///
500 ///
501 /// #### `shared-dhcp-range`
502 /// This option allows you to specify a custom DHCP range for the shared connection
503 /// method. The value is expected to be in `<START_ADDRESS>,<END_ADDRESS>` format.
504 /// The range should be part of network set by ipv4.address option and it should
505 /// not contain network address or broadcast address. If this option is not specified,
506 /// the DHCP range will be automatically determined based on the interface address.
507 /// The range will be selected to be adjacent to the interface address, either before
508 /// or after it, with the larger possible range being preferred. The range will be
509 /// adjusted to fill the available address space, except for networks with a prefix
510 /// length greater than 24, which will be treated as if they have a prefix length of 24.
511 ///
512 /// Readable | Writeable
513 /// <details><summary><h4>Setting</h4></summary>
514 ///
515 ///
516 /// #### `name`
517 /// The setting's name, which uniquely identifies the setting within the
518 /// connection. Each setting type has a name unique to that type, for
519 /// example "ppp" or "802-11-wireless" or "802-3-ethernet".
520 ///
521 /// Readable
522 /// </details>
523 ///
524 /// # Implements
525 ///
526 /// [`SettingIPConfigExt`][trait@crate::prelude::SettingIPConfigExt], [`SettingExt`][trait@crate::prelude::SettingExt]
527 #[doc(alias = "NMSettingIPConfig")]
528 pub struct SettingIPConfig(Object<ffi::NMSettingIPConfig, ffi::NMSettingIPConfigClass>) @extends Setting;
529
530 match fn {
531 type_ => || ffi::nm_setting_ip_config_get_type(),
532 }
533}
534
535impl SettingIPConfig {
536 pub const NONE: Option<&'static SettingIPConfig> = None;
537}
538
539/// Trait containing all [`struct@SettingIPConfig`] methods.
540///
541/// # Implementors
542///
543/// [`SettingIP4Config`][struct@crate::SettingIP4Config], [`SettingIP6Config`][struct@crate::SettingIP6Config], [`SettingIPConfig`][struct@crate::SettingIPConfig]
544pub trait SettingIPConfigExt: IsA<SettingIPConfig> + 'static {
545 /// Adds a new IP address and associated information to the setting. The
546 /// given address is duplicated internally and is not changed by this function.
547 /// ## `address`
548 /// the new address to add
549 ///
550 /// # Returns
551 ///
552 /// [`true`] if the address was added; [`false`] if the address was already
553 /// known.
554 #[doc(alias = "nm_setting_ip_config_add_address")]
555 fn add_address(&self, address: &IPAddress) -> bool {
556 unsafe {
557 from_glib(ffi::nm_setting_ip_config_add_address(
558 self.as_ref().to_glib_none().0,
559 address.to_glib_none().0,
560 ))
561 }
562 }
563
564 /// Adds a new DHCP reject server to the setting.
565 /// ## `server`
566 /// the DHCP reject server to add
567 #[cfg(feature = "v1_28")]
568 #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
569 #[doc(alias = "nm_setting_ip_config_add_dhcp_reject_server")]
570 fn add_dhcp_reject_server(&self, server: &str) {
571 unsafe {
572 ffi::nm_setting_ip_config_add_dhcp_reject_server(
573 self.as_ref().to_glib_none().0,
574 server.to_glib_none().0,
575 );
576 }
577 }
578
579 /// Adds a new DNS server to the setting.
580 /// ## `dns`
581 /// the IP address of the DNS server to add
582 ///
583 /// # Returns
584 ///
585 /// [`true`] if the DNS server was added; [`false`] if the server was already
586 /// known
587 ///
588 /// Before 1.42, setting @dns to an invalid string was treated as user-error.
589 /// Now, also invalid DNS values can be set, but will be rejected later during
590 /// nm_connection_verify().
591 #[doc(alias = "nm_setting_ip_config_add_dns")]
592 fn add_dns(&self, dns: &str) -> bool {
593 unsafe {
594 from_glib(ffi::nm_setting_ip_config_add_dns(
595 self.as_ref().to_glib_none().0,
596 dns.to_glib_none().0,
597 ))
598 }
599 }
600
601 /// Adds a new DNS option to the setting.
602 /// ## `dns_option`
603 /// the DNS option to add
604 ///
605 /// # Returns
606 ///
607 /// [`true`] if the DNS option was added; [`false`] otherwise
608 #[cfg(feature = "v1_2")]
609 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
610 #[doc(alias = "nm_setting_ip_config_add_dns_option")]
611 fn add_dns_option(&self, dns_option: &str) -> bool {
612 unsafe {
613 from_glib(ffi::nm_setting_ip_config_add_dns_option(
614 self.as_ref().to_glib_none().0,
615 dns_option.to_glib_none().0,
616 ))
617 }
618 }
619
620 /// Adds a new DNS search domain to the setting.
621 /// ## `dns_search`
622 /// the search domain to add
623 ///
624 /// # Returns
625 ///
626 /// [`true`] if the DNS search domain was added; [`false`] if the search
627 /// domain was already known
628 #[doc(alias = "nm_setting_ip_config_add_dns_search")]
629 fn add_dns_search(&self, dns_search: &str) -> bool {
630 unsafe {
631 from_glib(ffi::nm_setting_ip_config_add_dns_search(
632 self.as_ref().to_glib_none().0,
633 dns_search.to_glib_none().0,
634 ))
635 }
636 }
637
638 /// Appends a new route and associated information to the setting. The
639 /// given route is duplicated internally and is not changed by this function.
640 /// If an identical route (considering attributes as well) already exists, the
641 /// route is not added and the function returns [`false`].
642 ///
643 /// Note that before 1.10, this function would not consider route attributes
644 /// and not add a route that has an existing route with same dest/prefix,next_hop,metric
645 /// parameters.
646 /// ## `route`
647 /// the route to add
648 ///
649 /// # Returns
650 ///
651 /// [`true`] if the route was added; [`false`] if the route was already known.
652 #[doc(alias = "nm_setting_ip_config_add_route")]
653 fn add_route(&self, route: &IPRoute) -> bool {
654 unsafe {
655 from_glib(ffi::nm_setting_ip_config_add_route(
656 self.as_ref().to_glib_none().0,
657 route.to_glib_none().0,
658 ))
659 }
660 }
661
662 /// Appends a new routing-rule and associated information to the setting. The
663 /// given routing rules gets sealed and the reference count is incremented.
664 /// The function does not check whether an identical rule already exists
665 /// and always appends the rule to the end of the list.
666 /// ## `routing_rule`
667 /// the #NMIPRoutingRule to add. The address family
668 /// of the added rule must be compatible with the setting.
669 #[cfg(feature = "v1_18")]
670 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
671 #[doc(alias = "nm_setting_ip_config_add_routing_rule")]
672 fn add_routing_rule(&self, routing_rule: &IPRoutingRule) {
673 unsafe {
674 ffi::nm_setting_ip_config_add_routing_rule(
675 self.as_ref().to_glib_none().0,
676 routing_rule.to_glib_none().0,
677 );
678 }
679 }
680
681 /// Removes all configured addresses.
682 #[doc(alias = "nm_setting_ip_config_clear_addresses")]
683 fn clear_addresses(&self) {
684 unsafe {
685 ffi::nm_setting_ip_config_clear_addresses(self.as_ref().to_glib_none().0);
686 }
687 }
688
689 /// Removes all configured DHCP reject servers.
690 #[cfg(feature = "v1_28")]
691 #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
692 #[doc(alias = "nm_setting_ip_config_clear_dhcp_reject_servers")]
693 fn clear_dhcp_reject_servers(&self) {
694 unsafe {
695 ffi::nm_setting_ip_config_clear_dhcp_reject_servers(self.as_ref().to_glib_none().0);
696 }
697 }
698
699 /// Removes all configured DNS servers.
700 #[doc(alias = "nm_setting_ip_config_clear_dns")]
701 fn clear_dns(&self) {
702 unsafe {
703 ffi::nm_setting_ip_config_clear_dns(self.as_ref().to_glib_none().0);
704 }
705 }
706
707 /// Removes all configured DNS options.
708 /// ## `is_set`
709 /// the dns-options can be either empty or unset (default).
710 /// Specify how to clear the options.
711 #[cfg(feature = "v1_2")]
712 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
713 #[doc(alias = "nm_setting_ip_config_clear_dns_options")]
714 fn clear_dns_options(&self, is_set: bool) {
715 unsafe {
716 ffi::nm_setting_ip_config_clear_dns_options(
717 self.as_ref().to_glib_none().0,
718 is_set.into_glib(),
719 );
720 }
721 }
722
723 /// Removes all configured DNS search domains.
724 #[doc(alias = "nm_setting_ip_config_clear_dns_searches")]
725 fn clear_dns_searches(&self) {
726 unsafe {
727 ffi::nm_setting_ip_config_clear_dns_searches(self.as_ref().to_glib_none().0);
728 }
729 }
730
731 /// Removes all configured routes.
732 #[doc(alias = "nm_setting_ip_config_clear_routes")]
733 fn clear_routes(&self) {
734 unsafe {
735 ffi::nm_setting_ip_config_clear_routes(self.as_ref().to_glib_none().0);
736 }
737 }
738
739 /// Removes all configured routing rules.
740 #[cfg(feature = "v1_18")]
741 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
742 #[doc(alias = "nm_setting_ip_config_clear_routing_rules")]
743 fn clear_routing_rules(&self) {
744 unsafe {
745 ffi::nm_setting_ip_config_clear_routing_rules(self.as_ref().to_glib_none().0);
746 }
747 }
748
749 /// ## `idx`
750 /// index number of the address to return
751 ///
752 /// # Returns
753 ///
754 /// the address at index @idx
755 #[doc(alias = "nm_setting_ip_config_get_address")]
756 #[doc(alias = "get_address")]
757 fn address(&self, idx: i32) -> IPAddress {
758 unsafe {
759 from_glib_none(ffi::nm_setting_ip_config_get_address(
760 self.as_ref().to_glib_none().0,
761 idx,
762 ))
763 }
764 }
765
766 ///
767 /// # Returns
768 ///
769 /// the #NMSettingIPConfig:auto-route-ext-gw property of the setting
770 #[cfg(feature = "v1_42")]
771 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
772 #[doc(alias = "nm_setting_ip_config_get_auto_route_ext_gw")]
773 #[doc(alias = "get_auto_route_ext_gw")]
774 #[doc(alias = "auto-route-ext-gw")]
775 fn auto_route_ext_gw(&self) -> Ternary {
776 unsafe {
777 from_glib(ffi::nm_setting_ip_config_get_auto_route_ext_gw(
778 self.as_ref().to_glib_none().0,
779 ))
780 }
781 }
782
783 ///
784 /// # Returns
785 ///
786 /// the #NMSettingIPConfig:dad-timeout property.
787 #[cfg(feature = "v1_2")]
788 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
789 #[doc(alias = "nm_setting_ip_config_get_dad_timeout")]
790 #[doc(alias = "get_dad_timeout")]
791 #[doc(alias = "dad-timeout")]
792 fn dad_timeout(&self) -> i32 {
793 unsafe { ffi::nm_setting_ip_config_get_dad_timeout(self.as_ref().to_glib_none().0) }
794 }
795
796 /// Returns the value contained in the #NMSettingIPConfig:dhcp-dscp
797 /// property.
798 ///
799 /// # Returns
800 ///
801 /// the value for the DSCP field for DHCP
802 #[cfg(feature = "v1_46")]
803 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
804 #[doc(alias = "nm_setting_ip_config_get_dhcp_dscp")]
805 #[doc(alias = "get_dhcp_dscp")]
806 #[doc(alias = "dhcp-dscp")]
807 fn dhcp_dscp(&self) -> glib::GString {
808 unsafe {
809 from_glib_none(ffi::nm_setting_ip_config_get_dhcp_dscp(
810 self.as_ref().to_glib_none().0,
811 ))
812 }
813 }
814
815 /// Returns the value contained in the #NMSettingIPConfig:dhcp-hostname
816 /// property.
817 ///
818 /// # Returns
819 ///
820 /// the configured hostname to send to the DHCP server
821 #[doc(alias = "nm_setting_ip_config_get_dhcp_hostname")]
822 #[doc(alias = "get_dhcp_hostname")]
823 #[doc(alias = "dhcp-hostname")]
824 fn dhcp_hostname(&self) -> glib::GString {
825 unsafe {
826 from_glib_none(ffi::nm_setting_ip_config_get_dhcp_hostname(
827 self.as_ref().to_glib_none().0,
828 ))
829 }
830 }
831
832 /// Returns the value contained in the #NMSettingIPConfig:dhcp-hostname-flags
833 /// property.
834 ///
835 /// # Returns
836 ///
837 /// flags for the DHCP hostname and FQDN
838 #[cfg(feature = "v1_22")]
839 #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
840 #[doc(alias = "nm_setting_ip_config_get_dhcp_hostname_flags")]
841 #[doc(alias = "get_dhcp_hostname_flags")]
842 #[doc(alias = "dhcp-hostname-flags")]
843 fn dhcp_hostname_flags(&self) -> DhcpHostnameFlags {
844 unsafe {
845 from_glib(ffi::nm_setting_ip_config_get_dhcp_hostname_flags(
846 self.as_ref().to_glib_none().0,
847 ))
848 }
849 }
850
851 /// Returns the value contained in the #NMSettingIPConfig:dhcp-iaid
852 /// property.
853 ///
854 /// # Returns
855 ///
856 /// the configured DHCP IAID (Identity Association Identifier)
857 #[cfg(feature = "v1_42")]
858 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
859 #[doc(alias = "nm_setting_ip_config_get_dhcp_iaid")]
860 #[doc(alias = "get_dhcp_iaid")]
861 #[doc(alias = "dhcp-iaid")]
862 fn dhcp_iaid(&self) -> glib::GString {
863 unsafe {
864 from_glib_none(ffi::nm_setting_ip_config_get_dhcp_iaid(
865 self.as_ref().to_glib_none().0,
866 ))
867 }
868 }
869
870 ///
871 /// # Returns
872 ///
873 ///
874 /// A [`None`] terminated array of DHCP reject servers. Even if no reject
875 /// servers are configured, this always returns a non [`None`] value.
876 #[cfg(feature = "v1_28")]
877 #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
878 #[doc(alias = "nm_setting_ip_config_get_dhcp_reject_servers")]
879 #[doc(alias = "get_dhcp_reject_servers")]
880 #[doc(alias = "dhcp-reject-servers")]
881 fn dhcp_reject_servers(&self) -> Vec<glib::GString> {
882 unsafe {
883 let mut out_len = std::mem::MaybeUninit::uninit();
884 let ret = FromGlibContainer::from_glib_none_num(
885 ffi::nm_setting_ip_config_get_dhcp_reject_servers(
886 self.as_ref().to_glib_none().0,
887 out_len.as_mut_ptr(),
888 ),
889 out_len.assume_init() as _,
890 );
891 ret
892 }
893 }
894
895 /// Returns the value contained in the #NMSettingIPConfig:dhcp-send-hostname
896 /// property.
897 ///
898 /// # Deprecated since 1.52
899 ///
900 /// Use nm_setting_ip_config_get_dhcp_send_hostname_v2() instead.
901 ///
902 /// # Returns
903 ///
904 /// [`true`] if NetworkManager should send the machine hostname to the
905 /// DHCP server when requesting addresses to allow the server to automatically
906 /// update DNS information for this machine.
907 #[cfg_attr(feature = "v1_52", deprecated = "Since 1.52")]
908 #[allow(deprecated)]
909 #[doc(alias = "nm_setting_ip_config_get_dhcp_send_hostname")]
910 #[doc(alias = "get_dhcp_send_hostname")]
911 #[doc(alias = "dhcp-send-hostname")]
912 fn is_dhcp_send_hostname(&self) -> bool {
913 unsafe {
914 from_glib(ffi::nm_setting_ip_config_get_dhcp_send_hostname(
915 self.as_ref().to_glib_none().0,
916 ))
917 }
918 }
919
920 /// Returns the value contained in the #NMSettingIPConfig:dhcp-send-hostname-v2
921 /// property.
922 ///
923 /// # Returns
924 ///
925 /// the #NMSettingIPConfig:dhcp-send-hostname-v2 property of the setting
926 #[cfg(feature = "v1_52")]
927 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
928 #[doc(alias = "nm_setting_ip_config_get_dhcp_send_hostname_v2")]
929 #[doc(alias = "get_dhcp_send_hostname_v2")]
930 #[doc(alias = "dhcp-send-hostname-v2")]
931 fn dhcp_send_hostname_v2(&self) -> Ternary {
932 unsafe {
933 from_glib(ffi::nm_setting_ip_config_get_dhcp_send_hostname_v2(
934 self.as_ref().to_glib_none().0,
935 ))
936 }
937 }
938
939 ///
940 /// # Returns
941 ///
942 /// the #NMSettingIPConfig:dhcp-send-release property of the setting
943 #[cfg(feature = "v1_48")]
944 #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
945 #[doc(alias = "nm_setting_ip_config_get_dhcp_send_release")]
946 #[doc(alias = "get_dhcp_send_release")]
947 #[doc(alias = "dhcp-send-release")]
948 fn dhcp_send_release(&self) -> Ternary {
949 unsafe {
950 from_glib(ffi::nm_setting_ip_config_get_dhcp_send_release(
951 self.as_ref().to_glib_none().0,
952 ))
953 }
954 }
955
956 /// Returns the value contained in the #NMSettingIPConfig:dhcp-timeout
957 /// property.
958 ///
959 /// # Returns
960 ///
961 /// the configured DHCP timeout in seconds. 0 = default for
962 /// the particular kind of device.
963 #[cfg(feature = "v1_2")]
964 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
965 #[doc(alias = "nm_setting_ip_config_get_dhcp_timeout")]
966 #[doc(alias = "get_dhcp_timeout")]
967 #[doc(alias = "dhcp-timeout")]
968 fn dhcp_timeout(&self) -> i32 {
969 unsafe { ffi::nm_setting_ip_config_get_dhcp_timeout(self.as_ref().to_glib_none().0) }
970 }
971
972 /// ## `idx`
973 /// index number of the DNS server to return
974 ///
975 /// # Returns
976 ///
977 /// the IP address of the DNS server at index @idx
978 #[doc(alias = "nm_setting_ip_config_get_dns")]
979 #[doc(alias = "get_dns")]
980 fn dns(&self, idx: i32) -> glib::GString {
981 unsafe {
982 from_glib_none(ffi::nm_setting_ip_config_get_dns(
983 self.as_ref().to_glib_none().0,
984 idx,
985 ))
986 }
987 }
988
989 /// Since 1.46, access at index "len" is allowed and returns NULL.
990 /// ## `idx`
991 /// index number of the DNS option
992 ///
993 /// # Returns
994 ///
995 /// the DNS option at index @idx
996 #[cfg(feature = "v1_2")]
997 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
998 #[doc(alias = "nm_setting_ip_config_get_dns_option")]
999 #[doc(alias = "get_dns_option")]
1000 fn dns_option(&self, idx: u32) -> glib::GString {
1001 unsafe {
1002 from_glib_none(ffi::nm_setting_ip_config_get_dns_option(
1003 self.as_ref().to_glib_none().0,
1004 idx,
1005 ))
1006 }
1007 }
1008
1009 ///
1010 /// # Returns
1011 ///
1012 /// the priority of DNS servers
1013 #[cfg(feature = "v1_4")]
1014 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
1015 #[doc(alias = "nm_setting_ip_config_get_dns_priority")]
1016 #[doc(alias = "get_dns_priority")]
1017 #[doc(alias = "dns-priority")]
1018 fn dns_priority(&self) -> i32 {
1019 unsafe { ffi::nm_setting_ip_config_get_dns_priority(self.as_ref().to_glib_none().0) }
1020 }
1021
1022 /// Since 1.46, access at index "len" is allowed and returns NULL.
1023 /// ## `idx`
1024 /// index number of the DNS search domain to return
1025 ///
1026 /// # Returns
1027 ///
1028 /// the DNS search domain at index @idx
1029 #[doc(alias = "nm_setting_ip_config_get_dns_search")]
1030 #[doc(alias = "get_dns_search")]
1031 #[doc(alias = "dns-search")]
1032 fn dns_search(&self, idx: i32) -> glib::GString {
1033 unsafe {
1034 from_glib_none(ffi::nm_setting_ip_config_get_dns_search(
1035 self.as_ref().to_glib_none().0,
1036 idx,
1037 ))
1038 }
1039 }
1040
1041 ///
1042 /// # Returns
1043 ///
1044 /// the #NMSettingIPConfig:forwarding property of the setting
1045 #[cfg(feature = "v1_54")]
1046 #[cfg_attr(docsrs, doc(cfg(feature = "v1_54")))]
1047 #[doc(alias = "nm_setting_ip_config_get_forwarding")]
1048 #[doc(alias = "get_forwarding")]
1049 fn forwarding(&self) -> SettingIPConfigForwarding {
1050 unsafe {
1051 from_glib(ffi::nm_setting_ip_config_get_forwarding(
1052 self.as_ref().to_glib_none().0,
1053 ))
1054 }
1055 }
1056
1057 ///
1058 /// # Returns
1059 ///
1060 /// the IP address of the gateway associated with this configuration, or
1061 /// [`None`].
1062 #[doc(alias = "nm_setting_ip_config_get_gateway")]
1063 #[doc(alias = "get_gateway")]
1064 fn gateway(&self) -> glib::GString {
1065 unsafe {
1066 from_glib_none(ffi::nm_setting_ip_config_get_gateway(
1067 self.as_ref().to_glib_none().0,
1068 ))
1069 }
1070 }
1071
1072 /// Returns the value contained in the #NMSettingIPConfig:ignore-auto-dns
1073 /// property.
1074 ///
1075 /// # Returns
1076 ///
1077 /// [`true`] if automatically configured (ie via DHCP) DNS information
1078 /// should be ignored.
1079 #[doc(alias = "nm_setting_ip_config_get_ignore_auto_dns")]
1080 #[doc(alias = "get_ignore_auto_dns")]
1081 #[doc(alias = "ignore-auto-dns")]
1082 fn ignores_auto_dns(&self) -> bool {
1083 unsafe {
1084 from_glib(ffi::nm_setting_ip_config_get_ignore_auto_dns(
1085 self.as_ref().to_glib_none().0,
1086 ))
1087 }
1088 }
1089
1090 /// Returns the value contained in the #NMSettingIPConfig:ignore-auto-routes
1091 /// property.
1092 ///
1093 /// # Returns
1094 ///
1095 /// [`true`] if automatically configured (ie via DHCP) routes should be
1096 /// ignored.
1097 #[doc(alias = "nm_setting_ip_config_get_ignore_auto_routes")]
1098 #[doc(alias = "get_ignore_auto_routes")]
1099 #[doc(alias = "ignore-auto-routes")]
1100 fn ignores_auto_routes(&self) -> bool {
1101 unsafe {
1102 from_glib(ffi::nm_setting_ip_config_get_ignore_auto_routes(
1103 self.as_ref().to_glib_none().0,
1104 ))
1105 }
1106 }
1107
1108 /// Returns the value contained in the #NMSettingIPConfig:may-fail
1109 /// property.
1110 ///
1111 /// # Returns
1112 ///
1113 /// [`true`] if this connection doesn't require this type of IP
1114 /// addressing to complete for the connection to succeed.
1115 #[doc(alias = "nm_setting_ip_config_get_may_fail")]
1116 #[doc(alias = "get_may_fail")]
1117 #[doc(alias = "may-fail")]
1118 fn is_may_fail(&self) -> bool {
1119 unsafe {
1120 from_glib(ffi::nm_setting_ip_config_get_may_fail(
1121 self.as_ref().to_glib_none().0,
1122 ))
1123 }
1124 }
1125
1126 ///
1127 /// # Returns
1128 ///
1129 /// the #NMSettingIPConfig:method property of the setting; see
1130 /// #NMSettingIP4Config and #NMSettingIP6Config for details of the
1131 /// methods available with each type.
1132 #[doc(alias = "nm_setting_ip_config_get_method")]
1133 #[doc(alias = "get_method")]
1134 fn method(&self) -> glib::GString {
1135 unsafe {
1136 from_glib_none(ffi::nm_setting_ip_config_get_method(
1137 self.as_ref().to_glib_none().0,
1138 ))
1139 }
1140 }
1141
1142 /// Returns the value contained in the #NMSettingIPConfig:never-default
1143 /// property.
1144 ///
1145 /// # Returns
1146 ///
1147 /// [`true`] if this connection should never be the default
1148 /// connection
1149 #[doc(alias = "nm_setting_ip_config_get_never_default")]
1150 #[doc(alias = "get_never_default")]
1151 #[doc(alias = "never-default")]
1152 fn is_never_default(&self) -> bool {
1153 unsafe {
1154 from_glib(ffi::nm_setting_ip_config_get_never_default(
1155 self.as_ref().to_glib_none().0,
1156 ))
1157 }
1158 }
1159
1160 ///
1161 /// # Returns
1162 ///
1163 /// the number of configured addresses
1164 #[doc(alias = "nm_setting_ip_config_get_num_addresses")]
1165 #[doc(alias = "get_num_addresses")]
1166 fn num_addresses(&self) -> u32 {
1167 unsafe { ffi::nm_setting_ip_config_get_num_addresses(self.as_ref().to_glib_none().0) }
1168 }
1169
1170 ///
1171 /// # Returns
1172 ///
1173 /// the number of configured DNS servers
1174 #[doc(alias = "nm_setting_ip_config_get_num_dns")]
1175 #[doc(alias = "get_num_dns")]
1176 fn num_dns(&self) -> u32 {
1177 unsafe { ffi::nm_setting_ip_config_get_num_dns(self.as_ref().to_glib_none().0) }
1178 }
1179
1180 ///
1181 /// # Returns
1182 ///
1183 /// the number of configured DNS options
1184 #[cfg(feature = "v1_2")]
1185 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1186 #[doc(alias = "nm_setting_ip_config_get_num_dns_options")]
1187 #[doc(alias = "get_num_dns_options")]
1188 fn num_dns_options(&self) -> u32 {
1189 unsafe { ffi::nm_setting_ip_config_get_num_dns_options(self.as_ref().to_glib_none().0) }
1190 }
1191
1192 ///
1193 /// # Returns
1194 ///
1195 /// the number of configured DNS search domains
1196 #[doc(alias = "nm_setting_ip_config_get_num_dns_searches")]
1197 #[doc(alias = "get_num_dns_searches")]
1198 fn num_dns_searches(&self) -> u32 {
1199 unsafe { ffi::nm_setting_ip_config_get_num_dns_searches(self.as_ref().to_glib_none().0) }
1200 }
1201
1202 ///
1203 /// # Returns
1204 ///
1205 /// the number of configured routes
1206 #[doc(alias = "nm_setting_ip_config_get_num_routes")]
1207 #[doc(alias = "get_num_routes")]
1208 fn num_routes(&self) -> u32 {
1209 unsafe { ffi::nm_setting_ip_config_get_num_routes(self.as_ref().to_glib_none().0) }
1210 }
1211
1212 ///
1213 /// # Returns
1214 ///
1215 /// the number of configured routing rules
1216 #[cfg(feature = "v1_18")]
1217 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1218 #[doc(alias = "nm_setting_ip_config_get_num_routing_rules")]
1219 #[doc(alias = "get_num_routing_rules")]
1220 fn num_routing_rules(&self) -> u32 {
1221 unsafe { ffi::nm_setting_ip_config_get_num_routing_rules(self.as_ref().to_glib_none().0) }
1222 }
1223
1224 ///
1225 /// # Returns
1226 ///
1227 /// the #NMSettingIPConfig:replace-local-rule property of the setting
1228 #[cfg(feature = "v1_44")]
1229 #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
1230 #[doc(alias = "nm_setting_ip_config_get_replace_local_rule")]
1231 #[doc(alias = "get_replace_local_rule")]
1232 #[doc(alias = "replace-local-rule")]
1233 fn replace_local_rule(&self) -> Ternary {
1234 unsafe {
1235 from_glib(ffi::nm_setting_ip_config_get_replace_local_rule(
1236 self.as_ref().to_glib_none().0,
1237 ))
1238 }
1239 }
1240
1241 /// Returns the value contained in the #NMSettingIPConfig:required-timeout
1242 /// property.
1243 ///
1244 /// # Returns
1245 ///
1246 /// the required timeout for the address family
1247 #[cfg(feature = "v1_34")]
1248 #[cfg_attr(docsrs, doc(cfg(feature = "v1_34")))]
1249 #[doc(alias = "nm_setting_ip_config_get_required_timeout")]
1250 #[doc(alias = "get_required_timeout")]
1251 #[doc(alias = "required-timeout")]
1252 fn required_timeout(&self) -> i32 {
1253 unsafe { ffi::nm_setting_ip_config_get_required_timeout(self.as_ref().to_glib_none().0) }
1254 }
1255
1256 /// ## `idx`
1257 /// index number of the route to return
1258 ///
1259 /// # Returns
1260 ///
1261 /// the route at index @idx
1262 #[doc(alias = "nm_setting_ip_config_get_route")]
1263 #[doc(alias = "get_route")]
1264 fn route(&self, idx: i32) -> IPRoute {
1265 unsafe {
1266 from_glib_none(ffi::nm_setting_ip_config_get_route(
1267 self.as_ref().to_glib_none().0,
1268 idx,
1269 ))
1270 }
1271 }
1272
1273 /// Returns the value contained in the #NMSettingIPConfig:route-metric
1274 /// property.
1275 ///
1276 /// # Returns
1277 ///
1278 /// the route metric that is used for routes that don't explicitly
1279 /// specify a metric. See #NMSettingIPConfig:route-metric for more details.
1280 #[doc(alias = "nm_setting_ip_config_get_route_metric")]
1281 #[doc(alias = "get_route_metric")]
1282 #[doc(alias = "route-metric")]
1283 fn route_metric(&self) -> i64 {
1284 unsafe { ffi::nm_setting_ip_config_get_route_metric(self.as_ref().to_glib_none().0) }
1285 }
1286
1287 /// Returns the value contained in the #NMSettingIPConfig:route-table
1288 /// property.
1289 ///
1290 /// # Returns
1291 ///
1292 /// the configured route-table.
1293 #[cfg(feature = "v1_10")]
1294 #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
1295 #[doc(alias = "nm_setting_ip_config_get_route_table")]
1296 #[doc(alias = "get_route_table")]
1297 #[doc(alias = "route-table")]
1298 fn route_table(&self) -> u32 {
1299 unsafe { ffi::nm_setting_ip_config_get_route_table(self.as_ref().to_glib_none().0) }
1300 }
1301
1302 ///
1303 /// # Returns
1304 ///
1305 /// the #NMSettingIPConfig:routed-dns property of the setting
1306 #[cfg(feature = "v1_52")]
1307 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1308 #[doc(alias = "nm_setting_ip_config_get_routed_dns")]
1309 #[doc(alias = "get_routed_dns")]
1310 #[doc(alias = "routed-dns")]
1311 fn routed_dns(&self) -> SettingIPConfigRoutedDns {
1312 unsafe {
1313 from_glib(ffi::nm_setting_ip_config_get_routed_dns(
1314 self.as_ref().to_glib_none().0,
1315 ))
1316 }
1317 }
1318
1319 /// ## `idx`
1320 /// index number of the routing_rule to return
1321 ///
1322 /// # Returns
1323 ///
1324 /// the routing rule at index @idx
1325 #[cfg(feature = "v1_18")]
1326 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1327 #[doc(alias = "nm_setting_ip_config_get_routing_rule")]
1328 #[doc(alias = "get_routing_rule")]
1329 fn routing_rule(&self, idx: u32) -> IPRoutingRule {
1330 unsafe {
1331 from_glib_none(ffi::nm_setting_ip_config_get_routing_rule(
1332 self.as_ref().to_glib_none().0,
1333 idx,
1334 ))
1335 }
1336 }
1337
1338 /// Returns the value contained in the #NMSettingIPConfig:shared-dhcp-lease-time
1339 /// property.
1340 ///
1341 /// # Returns
1342 ///
1343 /// the configured DHCP server lease time
1344 #[cfg(feature = "v1_52")]
1345 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1346 #[doc(alias = "nm_setting_ip_config_get_shared_dhcp_lease_time")]
1347 #[doc(alias = "get_shared_dhcp_lease_time")]
1348 #[doc(alias = "shared-dhcp-lease-time")]
1349 fn shared_dhcp_lease_time(&self) -> i32 {
1350 unsafe {
1351 ffi::nm_setting_ip_config_get_shared_dhcp_lease_time(self.as_ref().to_glib_none().0)
1352 }
1353 }
1354
1355 /// Returns the value contained in the #NMSettingIPConfig:shared-dhcp-range
1356 /// property.
1357 ///
1358 /// # Returns
1359 ///
1360 /// the configured DHCP server range
1361 #[cfg(feature = "v1_52")]
1362 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1363 #[doc(alias = "nm_setting_ip_config_get_shared_dhcp_range")]
1364 #[doc(alias = "get_shared_dhcp_range")]
1365 #[doc(alias = "shared-dhcp-range")]
1366 fn shared_dhcp_range(&self) -> glib::GString {
1367 unsafe {
1368 from_glib_none(ffi::nm_setting_ip_config_get_shared_dhcp_range(
1369 self.as_ref().to_glib_none().0,
1370 ))
1371 }
1372 }
1373
1374 /// NMSettingIPConfig can have a list of dns-options. If the list
1375 /// is empty, there are two similar (but differentiated) states.
1376 /// Either the options are explicitly set to have no values,
1377 /// or the options are left undefined. The latter means to use
1378 /// a default configuration, while the former explicitly means "no-options".
1379 ///
1380 /// # Returns
1381 ///
1382 /// whether DNS options are initialized or left unset (the default).
1383 #[cfg(feature = "v1_2")]
1384 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1385 #[doc(alias = "nm_setting_ip_config_has_dns_options")]
1386 fn has_dns_options(&self) -> bool {
1387 unsafe {
1388 from_glib(ffi::nm_setting_ip_config_has_dns_options(
1389 self.as_ref().to_glib_none().0,
1390 ))
1391 }
1392 }
1393
1394 /// Removes the address at index @idx.
1395 /// ## `idx`
1396 /// index number of the address to remove
1397 #[doc(alias = "nm_setting_ip_config_remove_address")]
1398 fn remove_address(&self, idx: i32) {
1399 unsafe {
1400 ffi::nm_setting_ip_config_remove_address(self.as_ref().to_glib_none().0, idx);
1401 }
1402 }
1403
1404 /// Removes the address @address.
1405 /// ## `address`
1406 /// the IP address to remove
1407 ///
1408 /// # Returns
1409 ///
1410 /// [`true`] if the address was found and removed; [`false`] if it was not.
1411 #[doc(alias = "nm_setting_ip_config_remove_address_by_value")]
1412 fn remove_address_by_value(&self, address: &IPAddress) -> bool {
1413 unsafe {
1414 from_glib(ffi::nm_setting_ip_config_remove_address_by_value(
1415 self.as_ref().to_glib_none().0,
1416 address.to_glib_none().0,
1417 ))
1418 }
1419 }
1420
1421 /// Removes the DHCP reject server at index @idx.
1422 /// ## `idx`
1423 /// index number of the DHCP reject server
1424 #[cfg(feature = "v1_28")]
1425 #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1426 #[doc(alias = "nm_setting_ip_config_remove_dhcp_reject_server")]
1427 fn remove_dhcp_reject_server(&self, idx: u32) {
1428 unsafe {
1429 ffi::nm_setting_ip_config_remove_dhcp_reject_server(
1430 self.as_ref().to_glib_none().0,
1431 idx,
1432 );
1433 }
1434 }
1435
1436 /// Removes the DNS server at index @idx.
1437 /// ## `idx`
1438 /// index number of the DNS server to remove
1439 #[doc(alias = "nm_setting_ip_config_remove_dns")]
1440 fn remove_dns(&self, idx: i32) {
1441 unsafe {
1442 ffi::nm_setting_ip_config_remove_dns(self.as_ref().to_glib_none().0, idx);
1443 }
1444 }
1445
1446 /// Removes the DNS server @dns.
1447 /// ## `dns`
1448 /// the DNS server to remove
1449 ///
1450 /// # Returns
1451 ///
1452 /// [`true`] if the DNS server was found and removed; [`false`] if it was not.
1453 ///
1454 /// Before 1.42, setting @dns to an invalid string was treated as user-error.
1455 #[doc(alias = "nm_setting_ip_config_remove_dns_by_value")]
1456 fn remove_dns_by_value(&self, dns: &str) -> bool {
1457 unsafe {
1458 from_glib(ffi::nm_setting_ip_config_remove_dns_by_value(
1459 self.as_ref().to_glib_none().0,
1460 dns.to_glib_none().0,
1461 ))
1462 }
1463 }
1464
1465 /// Removes the DNS option at index @idx.
1466 /// ## `idx`
1467 /// index number of the DNS option
1468 #[cfg(feature = "v1_2")]
1469 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1470 #[doc(alias = "nm_setting_ip_config_remove_dns_option")]
1471 fn remove_dns_option(&self, idx: i32) {
1472 unsafe {
1473 ffi::nm_setting_ip_config_remove_dns_option(self.as_ref().to_glib_none().0, idx);
1474 }
1475 }
1476
1477 /// Removes the DNS option @dns_option.
1478 /// ## `dns_option`
1479 /// the DNS option to remove
1480 ///
1481 /// # Returns
1482 ///
1483 /// [`true`] if the DNS option was found and removed; [`false`] if it was not.
1484 #[cfg(feature = "v1_2")]
1485 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1486 #[doc(alias = "nm_setting_ip_config_remove_dns_option_by_value")]
1487 fn remove_dns_option_by_value(&self, dns_option: &str) -> bool {
1488 unsafe {
1489 from_glib(ffi::nm_setting_ip_config_remove_dns_option_by_value(
1490 self.as_ref().to_glib_none().0,
1491 dns_option.to_glib_none().0,
1492 ))
1493 }
1494 }
1495
1496 /// Removes the DNS search domain at index @idx.
1497 /// ## `idx`
1498 /// index number of the DNS search domain
1499 #[doc(alias = "nm_setting_ip_config_remove_dns_search")]
1500 fn remove_dns_search(&self, idx: i32) {
1501 unsafe {
1502 ffi::nm_setting_ip_config_remove_dns_search(self.as_ref().to_glib_none().0, idx);
1503 }
1504 }
1505
1506 /// Removes the DNS search domain @dns_search.
1507 /// ## `dns_search`
1508 /// the search domain to remove
1509 ///
1510 /// # Returns
1511 ///
1512 /// [`true`] if the DNS search domain was found and removed; [`false`] if it was not.
1513 #[doc(alias = "nm_setting_ip_config_remove_dns_search_by_value")]
1514 fn remove_dns_search_by_value(&self, dns_search: &str) -> bool {
1515 unsafe {
1516 from_glib(ffi::nm_setting_ip_config_remove_dns_search_by_value(
1517 self.as_ref().to_glib_none().0,
1518 dns_search.to_glib_none().0,
1519 ))
1520 }
1521 }
1522
1523 /// Removes the route at index @idx.
1524 /// ## `idx`
1525 /// index number of the route
1526 #[doc(alias = "nm_setting_ip_config_remove_route")]
1527 fn remove_route(&self, idx: i32) {
1528 unsafe {
1529 ffi::nm_setting_ip_config_remove_route(self.as_ref().to_glib_none().0, idx);
1530 }
1531 }
1532
1533 /// Removes the first matching route that matches @route.
1534 /// Note that before 1.10, this function would only compare dest/prefix,next_hop,metric
1535 /// and ignore route attributes. Now, @route must match exactly.
1536 /// ## `route`
1537 /// the route to remove
1538 ///
1539 /// # Returns
1540 ///
1541 /// [`true`] if the route was found and removed; [`false`] if it was not.
1542 #[doc(alias = "nm_setting_ip_config_remove_route_by_value")]
1543 fn remove_route_by_value(&self, route: &IPRoute) -> bool {
1544 unsafe {
1545 from_glib(ffi::nm_setting_ip_config_remove_route_by_value(
1546 self.as_ref().to_glib_none().0,
1547 route.to_glib_none().0,
1548 ))
1549 }
1550 }
1551
1552 /// Removes the routing_rule at index @idx.
1553 /// ## `idx`
1554 /// index number of the routing_rule
1555 #[cfg(feature = "v1_18")]
1556 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1557 #[doc(alias = "nm_setting_ip_config_remove_routing_rule")]
1558 fn remove_routing_rule(&self, idx: u32) {
1559 unsafe {
1560 ffi::nm_setting_ip_config_remove_routing_rule(self.as_ref().to_glib_none().0, idx);
1561 }
1562 }
1563
1564 /// Array of IP addresses.
1565 fn addresses(&self) -> Vec<IPAddress> {
1566 let vals = ObjectExt::property::<glib::ValueArray>(self.as_ref(), "addresses");
1567 vals.iter()
1568 .map(|value| unsafe { IPAddress::from_value(value) })
1569 .collect()
1570 }
1571
1572 /// Array of IP addresses.
1573 fn set_addresses(&self, addresses: &[&IPAddress]) {
1574 ObjectExt::set_property(
1575 self.as_ref(),
1576 "addresses",
1577 addresses
1578 .iter()
1579 .map(|address| address.to_value())
1580 .collect::<glib::ValueArray>(),
1581 )
1582 }
1583
1584 /// VPN connections will default to add the route automatically unless this
1585 /// setting is set to [`false`].
1586 ///
1587 /// For other connection types, adding such an automatic route is currently
1588 /// not supported and setting this to [`true`] has no effect.
1589 #[cfg(feature = "v1_42")]
1590 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
1591 #[doc(alias = "auto-route-ext-gw")]
1592 fn set_auto_route_ext_gw(&self, auto_route_ext_gw: Ternary) {
1593 ObjectExt::set_property(self.as_ref(), "auto-route-ext-gw", auto_route_ext_gw)
1594 }
1595
1596 /// Maximum timeout in milliseconds used to check for the presence of duplicate
1597 /// IP addresses on the network. If an address conflict is detected, the
1598 /// activation will fail. The property is currently implemented only for IPv4.
1599 ///
1600 /// A zero value means that no duplicate address detection is performed, -1 means
1601 /// the default value (either the value configured globally in NetworkManger.conf
1602 /// or 200ms). A value greater than zero is a timeout in milliseconds. Note that
1603 /// the time intervals are subject to randomization as per RFC 5227 and so the
1604 /// actual duration can be between half and the full time specified in this
1605 /// property.
1606 #[cfg(feature = "v1_2")]
1607 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1608 #[doc(alias = "dad-timeout")]
1609 fn set_dad_timeout(&self, dad_timeout: i32) {
1610 ObjectExt::set_property(self.as_ref(), "dad-timeout", dad_timeout)
1611 }
1612
1613 /// Specifies the value for the DSCP field (traffic class) of the IP header. When
1614 /// empty, the global default value is used; if no global default is specified, it is
1615 /// assumed to be "CS0". Allowed values are: "CS0", "CS4" and "CS6".
1616 ///
1617 /// The property is currently valid only for IPv4, and it is supported only by the
1618 /// "internal" DHCP plugin.
1619 #[cfg(feature = "v1_46")]
1620 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
1621 #[doc(alias = "dhcp-dscp")]
1622 fn set_dhcp_dscp(&self, dhcp_dscp: Option<&str>) {
1623 ObjectExt::set_property(self.as_ref(), "dhcp-dscp", dhcp_dscp)
1624 }
1625
1626 /// If the #NMSettingIPConfig:dhcp-send-hostname property is [`true`], then the
1627 /// specified name will be sent to the DHCP server when acquiring a lease.
1628 /// This property and #NMSettingIP4Config:dhcp-fqdn are mutually exclusive and
1629 /// cannot be set at the same time.
1630 #[doc(alias = "dhcp-hostname")]
1631 fn set_dhcp_hostname(&self, dhcp_hostname: Option<&str>) {
1632 ObjectExt::set_property(self.as_ref(), "dhcp-hostname", dhcp_hostname)
1633 }
1634
1635 /// Flags for the DHCP hostname and FQDN.
1636 ///
1637 /// Currently, this property only includes flags to control the FQDN flags
1638 /// set in the DHCP FQDN option. Supported FQDN flags are
1639 /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE],
1640 /// [`DhcpHostnameFlags::FQDN_ENCODED`][crate::DhcpHostnameFlags::FQDN_ENCODED] and
1641 /// [`DhcpHostnameFlags::FQDN_NO_UPDATE`][crate::DhcpHostnameFlags::FQDN_NO_UPDATE]. When no FQDN flag is set and
1642 /// [`DhcpHostnameFlags::FQDN_CLEAR_FLAGS`][crate::DhcpHostnameFlags::FQDN_CLEAR_FLAGS] is set, the DHCP FQDN option will
1643 /// contain no flag. Otherwise, if no FQDN flag is set and
1644 /// [`DhcpHostnameFlags::FQDN_CLEAR_FLAGS`][crate::DhcpHostnameFlags::FQDN_CLEAR_FLAGS] is not set, the standard FQDN flags
1645 /// are set in the request:
1646 /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE],
1647 /// [`DhcpHostnameFlags::FQDN_ENCODED`][crate::DhcpHostnameFlags::FQDN_ENCODED] for IPv4 and
1648 /// [`DhcpHostnameFlags::FQDN_SERV_UPDATE`][crate::DhcpHostnameFlags::FQDN_SERV_UPDATE] for IPv6.
1649 ///
1650 /// When this property is set to the default value [`DhcpHostnameFlags::NONE`][crate::DhcpHostnameFlags::NONE],
1651 /// a global default is looked up in NetworkManager configuration. If that value
1652 /// is unset or also [`DhcpHostnameFlags::NONE`][crate::DhcpHostnameFlags::NONE], then the standard FQDN flags
1653 /// described above are sent in the DHCP requests.
1654 #[cfg(feature = "v1_22")]
1655 #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
1656 #[doc(alias = "dhcp-hostname-flags")]
1657 fn set_dhcp_hostname_flags(&self, dhcp_hostname_flags: u32) {
1658 ObjectExt::set_property(self.as_ref(), "dhcp-hostname-flags", dhcp_hostname_flags)
1659 }
1660
1661 #[cfg(not(feature = "v1_42"))]
1662 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_42"))))]
1663 #[doc(alias = "dhcp-iaid")]
1664 fn dhcp_iaid(&self) -> Option<glib::GString> {
1665 ObjectExt::property(self.as_ref(), "dhcp-iaid")
1666 }
1667
1668 /// A string containing the "Identity Association Identifier" (IAID) used by
1669 /// the DHCP client. The string can be a 32-bit number (either decimal,
1670 /// hexadecimal or as colon separated hexadecimal numbers). Alternatively
1671 /// it can be set to the special values "mac", "perm-mac", "ifname" or
1672 /// "stable". When set to "mac" (or "perm-mac"), the last 4 bytes of the
1673 /// current (or permanent) MAC address are used as IAID. When set to
1674 /// "ifname", the IAID is computed by hashing the interface name. The
1675 /// special value "stable" can be used to generate an IAID based on the
1676 /// stable-id (see connection.stable-id), a per-host key and the interface
1677 /// name. When the property is unset, the value from global configuration is
1678 /// used; if no global default is set then the IAID is assumed to be
1679 /// "ifname".
1680 ///
1681 /// For DHCPv4, the IAID is only used with "ipv4.dhcp-client-id"
1682 /// values "duid" and "ipv6-duid" to generate the client-id.
1683 ///
1684 /// For DHCPv6, note that at the moment this property is
1685 /// only supported by the "internal" DHCPv6 plugin. The "dhclient" DHCPv6
1686 /// plugin always derives the IAID from the MAC address.
1687 ///
1688 /// The actually used DHCPv6 IAID for a currently activated interface is
1689 /// exposed in the lease information of the device.
1690 #[cfg(feature = "v1_22")]
1691 #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
1692 #[doc(alias = "dhcp-iaid")]
1693 fn set_dhcp_iaid(&self, dhcp_iaid: Option<&str>) {
1694 ObjectExt::set_property(self.as_ref(), "dhcp-iaid", dhcp_iaid)
1695 }
1696
1697 /// Array of servers from which DHCP offers must be rejected. This property
1698 /// is useful to avoid getting a lease from misconfigured or rogue servers.
1699 ///
1700 /// For DHCPv4, each element must be an IPv4 address, optionally
1701 /// followed by a slash and a prefix length (e.g. "192.168.122.0/24").
1702 ///
1703 /// This property is currently not implemented for DHCPv6.
1704 #[cfg(feature = "v1_28")]
1705 #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
1706 #[doc(alias = "dhcp-reject-servers")]
1707 fn set_dhcp_reject_servers(&self, dhcp_reject_servers: &[&str]) {
1708 ObjectExt::set_property(self.as_ref(), "dhcp-reject-servers", dhcp_reject_servers)
1709 }
1710
1711 /// Since 1.52 this property is deprecated and is only used as fallback value
1712 /// for #NMSettingIPConfig:dhcp-send-hostname-v2 if it's set to 'default'.
1713 /// This is only done to avoid breaking existing configurations, the new
1714 /// property should be used from now on.
1715 ///
1716 /// # Deprecated since 1.52
1717 ///
1718 /// use the new version of dhcp-send-hostname instead.
1719 #[cfg_attr(feature = "v1_52", deprecated = "Since 1.52")]
1720 #[doc(alias = "dhcp-send-hostname")]
1721 fn set_dhcp_send_hostname(&self, dhcp_send_hostname: bool) {
1722 ObjectExt::set_property(self.as_ref(), "dhcp-send-hostname", dhcp_send_hostname)
1723 }
1724
1725 /// If [`true`], a hostname is sent to the DHCP server when acquiring a lease.
1726 /// Some DHCP servers use this hostname to update DNS databases, essentially
1727 /// providing a static hostname for the computer. If the
1728 /// #NMSettingIPConfig:dhcp-hostname property is [`None`] and this property is
1729 /// [`true`], the current persistent hostname of the computer is sent.
1730 ///
1731 /// The default value is [`Ternary::Default`][crate::Ternary::Default]. In this case the global value
1732 /// from NetworkManager configuration is looked up. If it's not set, the value
1733 /// from #NMSettingIPConfig:dhcp-send-hostname, which defaults to [`true`], is
1734 /// used for backwards compatibility. In the future this will change and, in
1735 /// absence of a global default, it will always fallback to [`true`].
1736 #[cfg(feature = "v1_52")]
1737 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1738 #[doc(alias = "dhcp-send-hostname-v2")]
1739 fn set_dhcp_send_hostname_v2(&self, dhcp_send_hostname_v2: i32) {
1740 ObjectExt::set_property(
1741 self.as_ref(),
1742 "dhcp-send-hostname-v2",
1743 dhcp_send_hostname_v2,
1744 )
1745 }
1746
1747 /// Whether the DHCP client will send RELEASE message when
1748 /// bringing the connection down. The default value is [`Ternary::Default`][crate::Ternary::Default].
1749 /// When the default value is specified, then the global value from NetworkManager
1750 /// configuration is looked up, if not set, it is considered as [`false`].
1751 #[cfg(feature = "v1_48")]
1752 #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
1753 #[doc(alias = "dhcp-send-release")]
1754 fn set_dhcp_send_release(&self, dhcp_send_release: Ternary) {
1755 ObjectExt::set_property(self.as_ref(), "dhcp-send-release", dhcp_send_release)
1756 }
1757
1758 #[cfg(not(feature = "v1_2"))]
1759 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_2"))))]
1760 #[doc(alias = "dhcp-timeout")]
1761 fn dhcp_timeout(&self) -> i32 {
1762 ObjectExt::property(self.as_ref(), "dhcp-timeout")
1763 }
1764
1765 /// A timeout for a DHCP transaction in seconds. If zero (the default), a
1766 /// globally configured default is used. If still unspecified, a device specific
1767 /// timeout is used (usually 45 seconds).
1768 ///
1769 /// Set to 2147483647 (MAXINT32) for infinity.
1770 #[doc(alias = "dhcp-timeout")]
1771 fn set_dhcp_timeout(&self, dhcp_timeout: i32) {
1772 ObjectExt::set_property(self.as_ref(), "dhcp-timeout", dhcp_timeout)
1773 }
1774
1775 /// Array of DNS servers.
1776 ///
1777 /// Each server can be specified either as a plain IP address (optionally followed
1778 /// by a "#" and the SNI server name for DNS over TLS) or with a URI syntax.
1779 ///
1780 /// When it is specified as an URI, the following forms are supported:
1781 /// dns+udp://ADDRESS[:PORT], dns+tls://ADDRESS[:PORT][#SERVERNAME] .
1782 ///
1783 /// When using the URI syntax, IPv6 addresses must be enclosed in square
1784 /// brackets ('[', ']').
1785 fn set_dns(&self, dns: &[&str]) {
1786 ObjectExt::set_property(self.as_ref(), "dns", dns)
1787 }
1788
1789 /// Array of DNS options to be added to resolv.conf.
1790 ///
1791 /// [`None`] means that the options are unset and left at the default.
1792 /// In this case NetworkManager will use default options. This is
1793 /// distinct from an empty list of properties.
1794 ///
1795 /// The following options are directly added to resolv.conf: "attempts",
1796 /// "debug", "edns0",
1797 /// "inet6", "ip6-bytestring", "ip6-dotint", "ndots", "no-aaaa",
1798 /// "no-check-names", "no-ip6-dotint", "no-reload", "no-tld-query",
1799 /// "rotate", "single-request", "single-request-reopen", "timeout",
1800 /// "trust-ad", "use-vc". See the resolv.conf(5) man page for a
1801 /// detailed description of these options.
1802 ///
1803 /// In addition, NetworkManager supports the special options "_no-add-edns0"
1804 /// and "_no-add-trust-ad". They are not added to resolv.conf, and can be
1805 /// used to prevent the automatic addition of options "edns0" and "trust-ad"
1806 /// when using caching DNS plugins (see below).
1807 ///
1808 /// The "trust-ad" setting is only honored if the profile contributes
1809 /// name servers to resolv.conf, and if all contributing profiles have
1810 /// "trust-ad" enabled.
1811 ///
1812 /// When using a caching DNS plugin (dnsmasq or systemd-resolved in
1813 /// NetworkManager.conf) then "edns0" and "trust-ad" are automatically
1814 /// added, unless "_no-add-edns0" and "_no-add-trust-ad" are present.
1815 #[cfg(feature = "v1_2")]
1816 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1817 #[doc(alias = "dns-options")]
1818 fn dns_options(&self) -> Vec<glib::GString> {
1819 ObjectExt::property(self.as_ref(), "dns-options")
1820 }
1821
1822 /// Array of DNS options to be added to resolv.conf.
1823 ///
1824 /// [`None`] means that the options are unset and left at the default.
1825 /// In this case NetworkManager will use default options. This is
1826 /// distinct from an empty list of properties.
1827 ///
1828 /// The following options are directly added to resolv.conf: "attempts",
1829 /// "debug", "edns0",
1830 /// "inet6", "ip6-bytestring", "ip6-dotint", "ndots", "no-aaaa",
1831 /// "no-check-names", "no-ip6-dotint", "no-reload", "no-tld-query",
1832 /// "rotate", "single-request", "single-request-reopen", "timeout",
1833 /// "trust-ad", "use-vc". See the resolv.conf(5) man page for a
1834 /// detailed description of these options.
1835 ///
1836 /// In addition, NetworkManager supports the special options "_no-add-edns0"
1837 /// and "_no-add-trust-ad". They are not added to resolv.conf, and can be
1838 /// used to prevent the automatic addition of options "edns0" and "trust-ad"
1839 /// when using caching DNS plugins (see below).
1840 ///
1841 /// The "trust-ad" setting is only honored if the profile contributes
1842 /// name servers to resolv.conf, and if all contributing profiles have
1843 /// "trust-ad" enabled.
1844 ///
1845 /// When using a caching DNS plugin (dnsmasq or systemd-resolved in
1846 /// NetworkManager.conf) then "edns0" and "trust-ad" are automatically
1847 /// added, unless "_no-add-edns0" and "_no-add-trust-ad" are present.
1848 #[cfg(feature = "v1_2")]
1849 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1850 #[doc(alias = "dns-options")]
1851 fn set_dns_options(&self, dns_options: &[&str]) {
1852 ObjectExt::set_property(self.as_ref(), "dns-options", dns_options)
1853 }
1854
1855 /// DNS servers priority.
1856 ///
1857 /// The relative priority for DNS servers specified by this setting. A lower
1858 /// numerical value is better (higher priority).
1859 ///
1860 /// Negative values have the special effect of excluding other configurations
1861 /// with a greater numerical priority value; so in presence of at least one negative
1862 /// priority, only DNS servers from connections with the lowest priority value will be used.
1863 /// To avoid all DNS leaks, set the priority of the profile that should be used
1864 /// to the most negative value of all active connections profiles.
1865 ///
1866 /// Zero selects a globally configured default value. If the latter is missing
1867 /// or zero too, it defaults to 50 for VPNs (including WireGuard) and 100 for
1868 /// other connections.
1869 ///
1870 /// Note that the priority is to order DNS settings for multiple active
1871 /// connections. It does not disambiguate multiple DNS servers within the
1872 /// same connection profile.
1873 ///
1874 /// When multiple devices have configurations with the same priority, VPNs will be
1875 /// considered first, then devices with the best (lowest metric) default
1876 /// route and then all other devices.
1877 ///
1878 /// When using dns=default, servers with higher priority will be on top of
1879 /// resolv.conf. To prioritize a given server over another one within the
1880 /// same connection, just specify them in the desired order.
1881 /// Note that commonly the resolver tries name servers in /etc/resolv.conf
1882 /// in the order listed, proceeding with the next server in the list
1883 /// on failure. See for example the "rotate" option of the dns-options setting.
1884 /// If there are any negative DNS priorities, then only name servers from
1885 /// the devices with that lowest priority will be considered.
1886 ///
1887 /// When using a DNS resolver that supports Conditional Forwarding or
1888 /// Split DNS (with dns=dnsmasq or dns=systemd-resolved settings), each connection
1889 /// is used to query domains in its search list. The search domains determine which
1890 /// name servers to ask, and the DNS priority is used to prioritize
1891 /// name servers based on the domain. Queries for domains not present in any
1892 /// search list are routed through connections having the '~.' special wildcard
1893 /// domain, which is added automatically to connections with the default route
1894 /// (or can be added manually). When multiple connections specify the same domain, the
1895 /// one with the best priority (lowest numerical value) wins. If a sub domain
1896 /// is configured on another interface it will be accepted regardless the priority,
1897 /// unless parent domain on the other interface has a negative priority, which causes
1898 /// the sub domain to be shadowed.
1899 /// With Split DNS one can avoid undesired DNS leaks by properly configuring
1900 /// DNS priorities and the search domains, so that only name servers of the desired
1901 /// interface are configured.
1902 #[cfg(feature = "v1_4")]
1903 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
1904 #[doc(alias = "dns-priority")]
1905 fn set_dns_priority(&self, dns_priority: i32) {
1906 ObjectExt::set_property(self.as_ref(), "dns-priority", dns_priority)
1907 }
1908
1909 /// List of DNS search domains. Domains starting with a tilde ('~')
1910 /// are considered 'routing' domains and are used only to decide the
1911 /// interface over which a query must be forwarded; they are not used
1912 /// to complete unqualified host names.
1913 ///
1914 /// When using a DNS plugin that supports Conditional Forwarding or
1915 /// Split DNS, then the search domains specify which name servers to
1916 /// query. This makes the behavior different from running with plain
1917 /// /etc/resolv.conf. For more information see also the dns-priority setting.
1918 ///
1919 /// When set on a profile that also enabled DHCP, the DNS search list
1920 /// received automatically (option 119 for DHCPv4 and option 24 for DHCPv6)
1921 /// gets merged with the manual list. This can be prevented by setting
1922 /// "ignore-auto-dns". Note that if no DNS searches are configured, the
1923 /// fallback will be derived from the domain from DHCP (option 15).
1924 #[doc(alias = "dns-search")]
1925 fn set_dns_search(&self, dns_search: &[&str]) {
1926 ObjectExt::set_property(self.as_ref(), "dns-search", dns_search)
1927 }
1928
1929 /// Whether to configure sysctl interface-specific forwarding. When enabled, the interface
1930 /// will act as a router to forward the packet from one interface to another. When set to
1931 /// [`SettingIPConfigForwarding::Default`][crate::SettingIPConfigForwarding::Default], the value from global configuration is used;
1932 /// if no global default is defined, [`SettingIPConfigForwarding::Auto`][crate::SettingIPConfigForwarding::Auto] will be used.
1933 /// The #NMSettingIPConfig:forwarding property is ignored when #NMSettingIPConfig:method
1934 /// is set to "shared", because forwarding is always enabled in this case.
1935 /// The accepted values are:
1936 /// [`SettingIPConfigForwarding::Default`][crate::SettingIPConfigForwarding::Default]: use global default.
1937 /// [`SettingIPConfigForwarding::No`][crate::SettingIPConfigForwarding::No]: disabled.
1938 /// [`SettingIPConfigForwarding::Yes`][crate::SettingIPConfigForwarding::Yes]: enabled.
1939 /// [`SettingIPConfigForwarding::Auto`][crate::SettingIPConfigForwarding::Auto]: enable if any shared connection is active,
1940 /// use kernel default otherwise.
1941 #[cfg(feature = "v1_54")]
1942 #[cfg_attr(docsrs, doc(cfg(feature = "v1_54")))]
1943 fn set_forwarding(&self, forwarding: i32) {
1944 ObjectExt::set_property(self.as_ref(), "forwarding", forwarding)
1945 }
1946
1947 /// The gateway associated with this configuration. This is only meaningful
1948 /// if #NMSettingIPConfig:addresses is also set.
1949 ///
1950 /// Setting the gateway causes NetworkManager to configure a standard default route
1951 /// with the gateway as next hop. This is ignored if #NMSettingIPConfig:never-default
1952 /// is set. An alternative is to configure the default route explicitly with a manual
1953 /// route and /0 as prefix length.
1954 ///
1955 /// Note that the gateway usually conflicts with routing that NetworkManager configures
1956 /// for WireGuard interfaces, so usually it should not be set in that case. See
1957 /// #NMSettingWireGuard:ip4-auto-default-route.
1958 fn set_gateway(&self, gateway: Option<&str>) {
1959 ObjectExt::set_property(self.as_ref(), "gateway", gateway)
1960 }
1961
1962 /// When #NMSettingIPConfig:method is set to "auto" and this property to
1963 /// [`true`], automatically configured name servers and search domains are
1964 /// ignored and only name servers and search domains specified in the
1965 /// #NMSettingIPConfig:dns and #NMSettingIPConfig:dns-search properties, if
1966 /// any, are used.
1967 #[doc(alias = "ignore-auto-dns")]
1968 fn set_ignore_auto_dns(&self, ignore_auto_dns: bool) {
1969 ObjectExt::set_property(self.as_ref(), "ignore-auto-dns", ignore_auto_dns)
1970 }
1971
1972 /// When #NMSettingIPConfig:method is set to "auto" and this property to
1973 /// [`true`], automatically configured routes are ignored and only routes
1974 /// specified in the #NMSettingIPConfig:routes property, if any, are used.
1975 #[doc(alias = "ignore-auto-routes")]
1976 fn set_ignore_auto_routes(&self, ignore_auto_routes: bool) {
1977 ObjectExt::set_property(self.as_ref(), "ignore-auto-routes", ignore_auto_routes)
1978 }
1979
1980 /// If [`true`], allow overall network configuration to proceed even if the
1981 /// configuration specified by this property times out. Note that at least
1982 /// one IP configuration must succeed or overall network configuration will
1983 /// still fail. For example, in IPv6-only networks, setting this property to
1984 /// [`true`] on the #NMSettingIP4Config allows the overall network configuration
1985 /// to succeed if IPv4 configuration fails but IPv6 configuration completes
1986 /// successfully.
1987 #[doc(alias = "may-fail")]
1988 fn set_may_fail(&self, may_fail: bool) {
1989 ObjectExt::set_property(self.as_ref(), "may-fail", may_fail)
1990 }
1991
1992 /// IP configuration method.
1993 ///
1994 /// #NMSettingIP4Config and #NMSettingIP6Config both support "disabled",
1995 /// "auto", "manual", and "link-local". See the subclass-specific
1996 /// documentation for other values.
1997 ///
1998 /// In general, for the "auto" method, properties such as
1999 /// #NMSettingIPConfig:dns and #NMSettingIPConfig:routes specify information
2000 /// that is added on to the information returned from automatic
2001 /// configuration. The #NMSettingIPConfig:ignore-auto-routes and
2002 /// #NMSettingIPConfig:ignore-auto-dns properties modify this behavior.
2003 ///
2004 /// For methods that imply no upstream network, such as "shared" or
2005 /// "link-local", these properties must be empty.
2006 ///
2007 /// For IPv4 method "shared", the IP subnet can be configured by adding one
2008 /// manual IPv4 address or otherwise 10.42.x.0/24 is chosen. Note that the
2009 /// shared method must be configured on the interface which shares the internet
2010 /// to a subnet, not on the uplink which is shared.
2011 fn set_method(&self, method: Option<&str>) {
2012 ObjectExt::set_property(self.as_ref(), "method", method)
2013 }
2014
2015 /// If [`true`], this connection will never be the default connection for this
2016 /// IP type, meaning it will never be assigned the default route by
2017 /// NetworkManager.
2018 #[doc(alias = "never-default")]
2019 fn set_never_default(&self, never_default: bool) {
2020 ObjectExt::set_property(self.as_ref(), "never-default", never_default)
2021 }
2022
2023 /// Connections will default to keep the autogenerated priority 0 local rule
2024 /// unless this setting is set to [`true`].
2025 #[cfg(feature = "v1_44")]
2026 #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
2027 #[doc(alias = "replace-local-rule")]
2028 fn set_replace_local_rule(&self, replace_local_rule: Ternary) {
2029 ObjectExt::set_property(self.as_ref(), "replace-local-rule", replace_local_rule)
2030 }
2031
2032 /// The minimum time interval in milliseconds for which dynamic IP configuration
2033 /// should be tried before the connection succeeds.
2034 ///
2035 /// This property is useful for example if both IPv4 and IPv6 are enabled and
2036 /// are allowed to fail. Normally the connection succeeds as soon as one of
2037 /// the two address families completes; by setting a required timeout for
2038 /// e.g. IPv4, one can ensure that even if IP6 succeeds earlier than IPv4,
2039 /// NetworkManager waits some time for IPv4 before the connection becomes
2040 /// active.
2041 ///
2042 /// Note that if #NMSettingIPConfig:may-fail is FALSE for the same address
2043 /// family, this property has no effect as NetworkManager needs to wait for
2044 /// the full DHCP timeout.
2045 ///
2046 /// A zero value means that no required timeout is present, -1 means the
2047 /// default value (either configuration ipvx.required-timeout override or
2048 /// zero).
2049 #[cfg(feature = "v1_34")]
2050 #[cfg_attr(docsrs, doc(cfg(feature = "v1_34")))]
2051 #[doc(alias = "required-timeout")]
2052 fn set_required_timeout(&self, required_timeout: i32) {
2053 ObjectExt::set_property(self.as_ref(), "required-timeout", required_timeout)
2054 }
2055
2056 /// The default metric for routes that don't explicitly specify a metric.
2057 /// The default value -1 means that the metric is chosen automatically
2058 /// based on the device type.
2059 /// The metric applies to dynamic routes, manual (static) routes that
2060 /// don't have an explicit metric setting, address prefix routes, and
2061 /// the default route.
2062 /// Note that for IPv6, the kernel accepts zero (0) but coerces it to
2063 /// 1024 (user default). Hence, setting this property to zero effectively
2064 /// mean setting it to 1024.
2065 /// For IPv4, zero is a regular value for the metric.
2066 #[doc(alias = "route-metric")]
2067 fn set_route_metric(&self, route_metric: i64) {
2068 ObjectExt::set_property(self.as_ref(), "route-metric", route_metric)
2069 }
2070
2071 /// Enable policy routing (source routing) and set the routing table used when adding routes.
2072 ///
2073 /// This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes
2074 /// and static routes. But note that static routes can individually overwrite the setting
2075 /// by explicitly specifying a non-zero routing table.
2076 ///
2077 /// If the table setting is left at zero, it is eligible to be overwritten via global
2078 /// configuration. If the property is zero even after applying the global configuration
2079 /// value, policy routing is disabled for the address family of this connection.
2080 ///
2081 /// Policy routing disabled means that NetworkManager will add all routes to the main
2082 /// table (except static routes that explicitly configure a different table). Additionally,
2083 /// NetworkManager will not delete any extraneous routes from tables except the main table.
2084 /// This is to preserve backward compatibility for users who manage routing tables outside
2085 /// of NetworkManager.
2086 #[cfg(feature = "v1_10")]
2087 #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
2088 #[doc(alias = "route-table")]
2089 fn set_route_table(&self, route_table: u32) {
2090 ObjectExt::set_property(self.as_ref(), "route-table", route_table)
2091 }
2092
2093 /// Whether to add routes for DNS servers. When enabled, NetworkManager adds a route
2094 /// for each DNS server that is associated with this connection either statically
2095 /// (defined in the connection profile) or dynamically (for example, retrieved via
2096 /// DHCP). The route guarantees that the DNS server is reached via this interface. When
2097 /// set to [`SettingIPConfigRoutedDns::Default`][crate::SettingIPConfigRoutedDns::Default], the value from global
2098 /// configuration is used; if no global default is defined, this feature is disabled.
2099 #[cfg(feature = "v1_52")]
2100 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2101 #[doc(alias = "routed-dns")]
2102 fn set_routed_dns(&self, routed_dns: i32) {
2103 ObjectExt::set_property(self.as_ref(), "routed-dns", routed_dns)
2104 }
2105
2106 /// Array of IP routes.
2107 fn routes(&self) -> Vec<IPRoute> {
2108 let vals = ObjectExt::property::<glib::ValueArray>(self.as_ref(), "routes");
2109 vals.iter()
2110 .map(|value| unsafe { IPRoute::from_value(value) })
2111 .collect()
2112 }
2113
2114 /// Array of IP routes.
2115 fn set_routes(&self, routes: &[&IPRoute]) {
2116 ObjectExt::set_property(
2117 self.as_ref(),
2118 "routes",
2119 routes
2120 .iter()
2121 .map(|route| route.to_value())
2122 .collect::<glib::ValueArray>(),
2123 )
2124 }
2125
2126 /// This option allows you to specify a custom DHCP lease time for the shared connection
2127 /// method in seconds. The value should be either a number between 120 and 31536000 (one year)
2128 /// If this option is not specified, 3600 (one hour) is used.
2129 ///
2130 /// Special values are 0 for default value of 1 hour and 2147483647 (MAXINT32) for infinite lease time.
2131 #[cfg(feature = "v1_52")]
2132 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2133 #[doc(alias = "shared-dhcp-lease-time")]
2134 fn set_shared_dhcp_lease_time(&self, shared_dhcp_lease_time: i32) {
2135 ObjectExt::set_property(
2136 self.as_ref(),
2137 "shared-dhcp-lease-time",
2138 shared_dhcp_lease_time,
2139 )
2140 }
2141
2142 /// This option allows you to specify a custom DHCP range for the shared connection
2143 /// method. The value is expected to be in `<START_ADDRESS>,<END_ADDRESS>` format.
2144 /// The range should be part of network set by ipv4.address option and it should
2145 /// not contain network address or broadcast address. If this option is not specified,
2146 /// the DHCP range will be automatically determined based on the interface address.
2147 /// The range will be selected to be adjacent to the interface address, either before
2148 /// or after it, with the larger possible range being preferred. The range will be
2149 /// adjusted to fill the available address space, except for networks with a prefix
2150 /// length greater than 24, which will be treated as if they have a prefix length of 24.
2151 #[cfg(feature = "v1_52")]
2152 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2153 #[doc(alias = "shared-dhcp-range")]
2154 fn set_shared_dhcp_range(&self, shared_dhcp_range: Option<&str>) {
2155 ObjectExt::set_property(self.as_ref(), "shared-dhcp-range", shared_dhcp_range)
2156 }
2157
2158 #[doc(alias = "addresses")]
2159 fn connect_addresses_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2160 unsafe extern "C" fn notify_addresses_trampoline<
2161 P: IsA<SettingIPConfig>,
2162 F: Fn(&P) + 'static,
2163 >(
2164 this: *mut ffi::NMSettingIPConfig,
2165 _param_spec: glib::ffi::gpointer,
2166 f: glib::ffi::gpointer,
2167 ) {
2168 let f: &F = &*(f as *const F);
2169 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2170 }
2171 unsafe {
2172 let f: Box_<F> = Box_::new(f);
2173 connect_raw(
2174 self.as_ptr() as *mut _,
2175 c"notify::addresses".as_ptr() as *const _,
2176 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2177 notify_addresses_trampoline::<Self, F> as *const (),
2178 )),
2179 Box_::into_raw(f),
2180 )
2181 }
2182 }
2183
2184 #[cfg(feature = "v1_42")]
2185 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
2186 #[doc(alias = "auto-route-ext-gw")]
2187 fn connect_auto_route_ext_gw_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2188 unsafe extern "C" fn notify_auto_route_ext_gw_trampoline<
2189 P: IsA<SettingIPConfig>,
2190 F: Fn(&P) + 'static,
2191 >(
2192 this: *mut ffi::NMSettingIPConfig,
2193 _param_spec: glib::ffi::gpointer,
2194 f: glib::ffi::gpointer,
2195 ) {
2196 let f: &F = &*(f as *const F);
2197 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2198 }
2199 unsafe {
2200 let f: Box_<F> = Box_::new(f);
2201 connect_raw(
2202 self.as_ptr() as *mut _,
2203 c"notify::auto-route-ext-gw".as_ptr() as *const _,
2204 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2205 notify_auto_route_ext_gw_trampoline::<Self, F> as *const (),
2206 )),
2207 Box_::into_raw(f),
2208 )
2209 }
2210 }
2211
2212 #[cfg(feature = "v1_2")]
2213 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2214 #[doc(alias = "dad-timeout")]
2215 fn connect_dad_timeout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2216 unsafe extern "C" fn notify_dad_timeout_trampoline<
2217 P: IsA<SettingIPConfig>,
2218 F: Fn(&P) + 'static,
2219 >(
2220 this: *mut ffi::NMSettingIPConfig,
2221 _param_spec: glib::ffi::gpointer,
2222 f: glib::ffi::gpointer,
2223 ) {
2224 let f: &F = &*(f as *const F);
2225 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2226 }
2227 unsafe {
2228 let f: Box_<F> = Box_::new(f);
2229 connect_raw(
2230 self.as_ptr() as *mut _,
2231 c"notify::dad-timeout".as_ptr() as *const _,
2232 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2233 notify_dad_timeout_trampoline::<Self, F> as *const (),
2234 )),
2235 Box_::into_raw(f),
2236 )
2237 }
2238 }
2239
2240 #[cfg(feature = "v1_46")]
2241 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
2242 #[doc(alias = "dhcp-dscp")]
2243 fn connect_dhcp_dscp_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2244 unsafe extern "C" fn notify_dhcp_dscp_trampoline<
2245 P: IsA<SettingIPConfig>,
2246 F: Fn(&P) + 'static,
2247 >(
2248 this: *mut ffi::NMSettingIPConfig,
2249 _param_spec: glib::ffi::gpointer,
2250 f: glib::ffi::gpointer,
2251 ) {
2252 let f: &F = &*(f as *const F);
2253 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2254 }
2255 unsafe {
2256 let f: Box_<F> = Box_::new(f);
2257 connect_raw(
2258 self.as_ptr() as *mut _,
2259 c"notify::dhcp-dscp".as_ptr() as *const _,
2260 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2261 notify_dhcp_dscp_trampoline::<Self, F> as *const (),
2262 )),
2263 Box_::into_raw(f),
2264 )
2265 }
2266 }
2267
2268 #[doc(alias = "dhcp-hostname")]
2269 fn connect_dhcp_hostname_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2270 unsafe extern "C" fn notify_dhcp_hostname_trampoline<
2271 P: IsA<SettingIPConfig>,
2272 F: Fn(&P) + 'static,
2273 >(
2274 this: *mut ffi::NMSettingIPConfig,
2275 _param_spec: glib::ffi::gpointer,
2276 f: glib::ffi::gpointer,
2277 ) {
2278 let f: &F = &*(f as *const F);
2279 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2280 }
2281 unsafe {
2282 let f: Box_<F> = Box_::new(f);
2283 connect_raw(
2284 self.as_ptr() as *mut _,
2285 c"notify::dhcp-hostname".as_ptr() as *const _,
2286 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2287 notify_dhcp_hostname_trampoline::<Self, F> as *const (),
2288 )),
2289 Box_::into_raw(f),
2290 )
2291 }
2292 }
2293
2294 #[cfg(feature = "v1_22")]
2295 #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
2296 #[doc(alias = "dhcp-hostname-flags")]
2297 fn connect_dhcp_hostname_flags_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2298 unsafe extern "C" fn notify_dhcp_hostname_flags_trampoline<
2299 P: IsA<SettingIPConfig>,
2300 F: Fn(&P) + 'static,
2301 >(
2302 this: *mut ffi::NMSettingIPConfig,
2303 _param_spec: glib::ffi::gpointer,
2304 f: glib::ffi::gpointer,
2305 ) {
2306 let f: &F = &*(f as *const F);
2307 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2308 }
2309 unsafe {
2310 let f: Box_<F> = Box_::new(f);
2311 connect_raw(
2312 self.as_ptr() as *mut _,
2313 c"notify::dhcp-hostname-flags".as_ptr() as *const _,
2314 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2315 notify_dhcp_hostname_flags_trampoline::<Self, F> as *const (),
2316 )),
2317 Box_::into_raw(f),
2318 )
2319 }
2320 }
2321
2322 #[cfg(feature = "v1_22")]
2323 #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
2324 #[doc(alias = "dhcp-iaid")]
2325 fn connect_dhcp_iaid_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2326 unsafe extern "C" fn notify_dhcp_iaid_trampoline<
2327 P: IsA<SettingIPConfig>,
2328 F: Fn(&P) + 'static,
2329 >(
2330 this: *mut ffi::NMSettingIPConfig,
2331 _param_spec: glib::ffi::gpointer,
2332 f: glib::ffi::gpointer,
2333 ) {
2334 let f: &F = &*(f as *const F);
2335 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2336 }
2337 unsafe {
2338 let f: Box_<F> = Box_::new(f);
2339 connect_raw(
2340 self.as_ptr() as *mut _,
2341 c"notify::dhcp-iaid".as_ptr() as *const _,
2342 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2343 notify_dhcp_iaid_trampoline::<Self, F> as *const (),
2344 )),
2345 Box_::into_raw(f),
2346 )
2347 }
2348 }
2349
2350 #[cfg(feature = "v1_28")]
2351 #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
2352 #[doc(alias = "dhcp-reject-servers")]
2353 fn connect_dhcp_reject_servers_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2354 unsafe extern "C" fn notify_dhcp_reject_servers_trampoline<
2355 P: IsA<SettingIPConfig>,
2356 F: Fn(&P) + 'static,
2357 >(
2358 this: *mut ffi::NMSettingIPConfig,
2359 _param_spec: glib::ffi::gpointer,
2360 f: glib::ffi::gpointer,
2361 ) {
2362 let f: &F = &*(f as *const F);
2363 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2364 }
2365 unsafe {
2366 let f: Box_<F> = Box_::new(f);
2367 connect_raw(
2368 self.as_ptr() as *mut _,
2369 c"notify::dhcp-reject-servers".as_ptr() as *const _,
2370 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2371 notify_dhcp_reject_servers_trampoline::<Self, F> as *const (),
2372 )),
2373 Box_::into_raw(f),
2374 )
2375 }
2376 }
2377
2378 #[cfg_attr(feature = "v1_52", deprecated = "Since 1.52")]
2379 #[doc(alias = "dhcp-send-hostname")]
2380 fn connect_dhcp_send_hostname_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2381 unsafe extern "C" fn notify_dhcp_send_hostname_trampoline<
2382 P: IsA<SettingIPConfig>,
2383 F: Fn(&P) + 'static,
2384 >(
2385 this: *mut ffi::NMSettingIPConfig,
2386 _param_spec: glib::ffi::gpointer,
2387 f: glib::ffi::gpointer,
2388 ) {
2389 let f: &F = &*(f as *const F);
2390 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2391 }
2392 unsafe {
2393 let f: Box_<F> = Box_::new(f);
2394 connect_raw(
2395 self.as_ptr() as *mut _,
2396 c"notify::dhcp-send-hostname".as_ptr() as *const _,
2397 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2398 notify_dhcp_send_hostname_trampoline::<Self, F> as *const (),
2399 )),
2400 Box_::into_raw(f),
2401 )
2402 }
2403 }
2404
2405 #[cfg(feature = "v1_52")]
2406 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2407 #[doc(alias = "dhcp-send-hostname-v2")]
2408 fn connect_dhcp_send_hostname_v2_notify<F: Fn(&Self) + 'static>(
2409 &self,
2410 f: F,
2411 ) -> SignalHandlerId {
2412 unsafe extern "C" fn notify_dhcp_send_hostname_v2_trampoline<
2413 P: IsA<SettingIPConfig>,
2414 F: Fn(&P) + 'static,
2415 >(
2416 this: *mut ffi::NMSettingIPConfig,
2417 _param_spec: glib::ffi::gpointer,
2418 f: glib::ffi::gpointer,
2419 ) {
2420 let f: &F = &*(f as *const F);
2421 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2422 }
2423 unsafe {
2424 let f: Box_<F> = Box_::new(f);
2425 connect_raw(
2426 self.as_ptr() as *mut _,
2427 c"notify::dhcp-send-hostname-v2".as_ptr() as *const _,
2428 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2429 notify_dhcp_send_hostname_v2_trampoline::<Self, F> as *const (),
2430 )),
2431 Box_::into_raw(f),
2432 )
2433 }
2434 }
2435
2436 #[cfg(feature = "v1_48")]
2437 #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
2438 #[doc(alias = "dhcp-send-release")]
2439 fn connect_dhcp_send_release_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2440 unsafe extern "C" fn notify_dhcp_send_release_trampoline<
2441 P: IsA<SettingIPConfig>,
2442 F: Fn(&P) + 'static,
2443 >(
2444 this: *mut ffi::NMSettingIPConfig,
2445 _param_spec: glib::ffi::gpointer,
2446 f: glib::ffi::gpointer,
2447 ) {
2448 let f: &F = &*(f as *const F);
2449 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2450 }
2451 unsafe {
2452 let f: Box_<F> = Box_::new(f);
2453 connect_raw(
2454 self.as_ptr() as *mut _,
2455 c"notify::dhcp-send-release".as_ptr() as *const _,
2456 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2457 notify_dhcp_send_release_trampoline::<Self, F> as *const (),
2458 )),
2459 Box_::into_raw(f),
2460 )
2461 }
2462 }
2463
2464 #[doc(alias = "dhcp-timeout")]
2465 fn connect_dhcp_timeout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2466 unsafe extern "C" fn notify_dhcp_timeout_trampoline<
2467 P: IsA<SettingIPConfig>,
2468 F: Fn(&P) + 'static,
2469 >(
2470 this: *mut ffi::NMSettingIPConfig,
2471 _param_spec: glib::ffi::gpointer,
2472 f: glib::ffi::gpointer,
2473 ) {
2474 let f: &F = &*(f as *const F);
2475 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2476 }
2477 unsafe {
2478 let f: Box_<F> = Box_::new(f);
2479 connect_raw(
2480 self.as_ptr() as *mut _,
2481 c"notify::dhcp-timeout".as_ptr() as *const _,
2482 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2483 notify_dhcp_timeout_trampoline::<Self, F> as *const (),
2484 )),
2485 Box_::into_raw(f),
2486 )
2487 }
2488 }
2489
2490 #[doc(alias = "dns")]
2491 fn connect_dns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2492 unsafe extern "C" fn notify_dns_trampoline<P: IsA<SettingIPConfig>, F: Fn(&P) + 'static>(
2493 this: *mut ffi::NMSettingIPConfig,
2494 _param_spec: glib::ffi::gpointer,
2495 f: glib::ffi::gpointer,
2496 ) {
2497 let f: &F = &*(f as *const F);
2498 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2499 }
2500 unsafe {
2501 let f: Box_<F> = Box_::new(f);
2502 connect_raw(
2503 self.as_ptr() as *mut _,
2504 c"notify::dns".as_ptr() as *const _,
2505 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2506 notify_dns_trampoline::<Self, F> as *const (),
2507 )),
2508 Box_::into_raw(f),
2509 )
2510 }
2511 }
2512
2513 #[cfg(feature = "v1_2")]
2514 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2515 #[doc(alias = "dns-options")]
2516 fn connect_dns_options_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2517 unsafe extern "C" fn notify_dns_options_trampoline<
2518 P: IsA<SettingIPConfig>,
2519 F: Fn(&P) + 'static,
2520 >(
2521 this: *mut ffi::NMSettingIPConfig,
2522 _param_spec: glib::ffi::gpointer,
2523 f: glib::ffi::gpointer,
2524 ) {
2525 let f: &F = &*(f as *const F);
2526 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2527 }
2528 unsafe {
2529 let f: Box_<F> = Box_::new(f);
2530 connect_raw(
2531 self.as_ptr() as *mut _,
2532 c"notify::dns-options".as_ptr() as *const _,
2533 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2534 notify_dns_options_trampoline::<Self, F> as *const (),
2535 )),
2536 Box_::into_raw(f),
2537 )
2538 }
2539 }
2540
2541 #[cfg(feature = "v1_4")]
2542 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
2543 #[doc(alias = "dns-priority")]
2544 fn connect_dns_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2545 unsafe extern "C" fn notify_dns_priority_trampoline<
2546 P: IsA<SettingIPConfig>,
2547 F: Fn(&P) + 'static,
2548 >(
2549 this: *mut ffi::NMSettingIPConfig,
2550 _param_spec: glib::ffi::gpointer,
2551 f: glib::ffi::gpointer,
2552 ) {
2553 let f: &F = &*(f as *const F);
2554 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2555 }
2556 unsafe {
2557 let f: Box_<F> = Box_::new(f);
2558 connect_raw(
2559 self.as_ptr() as *mut _,
2560 c"notify::dns-priority".as_ptr() as *const _,
2561 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2562 notify_dns_priority_trampoline::<Self, F> as *const (),
2563 )),
2564 Box_::into_raw(f),
2565 )
2566 }
2567 }
2568
2569 #[doc(alias = "dns-search")]
2570 fn connect_dns_search_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2571 unsafe extern "C" fn notify_dns_search_trampoline<
2572 P: IsA<SettingIPConfig>,
2573 F: Fn(&P) + 'static,
2574 >(
2575 this: *mut ffi::NMSettingIPConfig,
2576 _param_spec: glib::ffi::gpointer,
2577 f: glib::ffi::gpointer,
2578 ) {
2579 let f: &F = &*(f as *const F);
2580 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2581 }
2582 unsafe {
2583 let f: Box_<F> = Box_::new(f);
2584 connect_raw(
2585 self.as_ptr() as *mut _,
2586 c"notify::dns-search".as_ptr() as *const _,
2587 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2588 notify_dns_search_trampoline::<Self, F> as *const (),
2589 )),
2590 Box_::into_raw(f),
2591 )
2592 }
2593 }
2594
2595 #[cfg(feature = "v1_54")]
2596 #[cfg_attr(docsrs, doc(cfg(feature = "v1_54")))]
2597 #[doc(alias = "forwarding")]
2598 fn connect_forwarding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2599 unsafe extern "C" fn notify_forwarding_trampoline<
2600 P: IsA<SettingIPConfig>,
2601 F: Fn(&P) + 'static,
2602 >(
2603 this: *mut ffi::NMSettingIPConfig,
2604 _param_spec: glib::ffi::gpointer,
2605 f: glib::ffi::gpointer,
2606 ) {
2607 let f: &F = &*(f as *const F);
2608 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2609 }
2610 unsafe {
2611 let f: Box_<F> = Box_::new(f);
2612 connect_raw(
2613 self.as_ptr() as *mut _,
2614 c"notify::forwarding".as_ptr() as *const _,
2615 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2616 notify_forwarding_trampoline::<Self, F> as *const (),
2617 )),
2618 Box_::into_raw(f),
2619 )
2620 }
2621 }
2622
2623 #[doc(alias = "gateway")]
2624 fn connect_gateway_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2625 unsafe extern "C" fn notify_gateway_trampoline<
2626 P: IsA<SettingIPConfig>,
2627 F: Fn(&P) + 'static,
2628 >(
2629 this: *mut ffi::NMSettingIPConfig,
2630 _param_spec: glib::ffi::gpointer,
2631 f: glib::ffi::gpointer,
2632 ) {
2633 let f: &F = &*(f as *const F);
2634 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2635 }
2636 unsafe {
2637 let f: Box_<F> = Box_::new(f);
2638 connect_raw(
2639 self.as_ptr() as *mut _,
2640 c"notify::gateway".as_ptr() as *const _,
2641 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2642 notify_gateway_trampoline::<Self, F> as *const (),
2643 )),
2644 Box_::into_raw(f),
2645 )
2646 }
2647 }
2648
2649 #[doc(alias = "ignore-auto-dns")]
2650 fn connect_ignore_auto_dns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2651 unsafe extern "C" fn notify_ignore_auto_dns_trampoline<
2652 P: IsA<SettingIPConfig>,
2653 F: Fn(&P) + 'static,
2654 >(
2655 this: *mut ffi::NMSettingIPConfig,
2656 _param_spec: glib::ffi::gpointer,
2657 f: glib::ffi::gpointer,
2658 ) {
2659 let f: &F = &*(f as *const F);
2660 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2661 }
2662 unsafe {
2663 let f: Box_<F> = Box_::new(f);
2664 connect_raw(
2665 self.as_ptr() as *mut _,
2666 c"notify::ignore-auto-dns".as_ptr() as *const _,
2667 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2668 notify_ignore_auto_dns_trampoline::<Self, F> as *const (),
2669 )),
2670 Box_::into_raw(f),
2671 )
2672 }
2673 }
2674
2675 #[doc(alias = "ignore-auto-routes")]
2676 fn connect_ignore_auto_routes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2677 unsafe extern "C" fn notify_ignore_auto_routes_trampoline<
2678 P: IsA<SettingIPConfig>,
2679 F: Fn(&P) + 'static,
2680 >(
2681 this: *mut ffi::NMSettingIPConfig,
2682 _param_spec: glib::ffi::gpointer,
2683 f: glib::ffi::gpointer,
2684 ) {
2685 let f: &F = &*(f as *const F);
2686 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2687 }
2688 unsafe {
2689 let f: Box_<F> = Box_::new(f);
2690 connect_raw(
2691 self.as_ptr() as *mut _,
2692 c"notify::ignore-auto-routes".as_ptr() as *const _,
2693 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2694 notify_ignore_auto_routes_trampoline::<Self, F> as *const (),
2695 )),
2696 Box_::into_raw(f),
2697 )
2698 }
2699 }
2700
2701 #[doc(alias = "may-fail")]
2702 fn connect_may_fail_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2703 unsafe extern "C" fn notify_may_fail_trampoline<
2704 P: IsA<SettingIPConfig>,
2705 F: Fn(&P) + 'static,
2706 >(
2707 this: *mut ffi::NMSettingIPConfig,
2708 _param_spec: glib::ffi::gpointer,
2709 f: glib::ffi::gpointer,
2710 ) {
2711 let f: &F = &*(f as *const F);
2712 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2713 }
2714 unsafe {
2715 let f: Box_<F> = Box_::new(f);
2716 connect_raw(
2717 self.as_ptr() as *mut _,
2718 c"notify::may-fail".as_ptr() as *const _,
2719 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2720 notify_may_fail_trampoline::<Self, F> as *const (),
2721 )),
2722 Box_::into_raw(f),
2723 )
2724 }
2725 }
2726
2727 #[doc(alias = "method")]
2728 fn connect_method_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2729 unsafe extern "C" fn notify_method_trampoline<
2730 P: IsA<SettingIPConfig>,
2731 F: Fn(&P) + 'static,
2732 >(
2733 this: *mut ffi::NMSettingIPConfig,
2734 _param_spec: glib::ffi::gpointer,
2735 f: glib::ffi::gpointer,
2736 ) {
2737 let f: &F = &*(f as *const F);
2738 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2739 }
2740 unsafe {
2741 let f: Box_<F> = Box_::new(f);
2742 connect_raw(
2743 self.as_ptr() as *mut _,
2744 c"notify::method".as_ptr() as *const _,
2745 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2746 notify_method_trampoline::<Self, F> as *const (),
2747 )),
2748 Box_::into_raw(f),
2749 )
2750 }
2751 }
2752
2753 #[doc(alias = "never-default")]
2754 fn connect_never_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2755 unsafe extern "C" fn notify_never_default_trampoline<
2756 P: IsA<SettingIPConfig>,
2757 F: Fn(&P) + 'static,
2758 >(
2759 this: *mut ffi::NMSettingIPConfig,
2760 _param_spec: glib::ffi::gpointer,
2761 f: glib::ffi::gpointer,
2762 ) {
2763 let f: &F = &*(f as *const F);
2764 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2765 }
2766 unsafe {
2767 let f: Box_<F> = Box_::new(f);
2768 connect_raw(
2769 self.as_ptr() as *mut _,
2770 c"notify::never-default".as_ptr() as *const _,
2771 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2772 notify_never_default_trampoline::<Self, F> as *const (),
2773 )),
2774 Box_::into_raw(f),
2775 )
2776 }
2777 }
2778
2779 #[cfg(feature = "v1_44")]
2780 #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
2781 #[doc(alias = "replace-local-rule")]
2782 fn connect_replace_local_rule_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2783 unsafe extern "C" fn notify_replace_local_rule_trampoline<
2784 P: IsA<SettingIPConfig>,
2785 F: Fn(&P) + 'static,
2786 >(
2787 this: *mut ffi::NMSettingIPConfig,
2788 _param_spec: glib::ffi::gpointer,
2789 f: glib::ffi::gpointer,
2790 ) {
2791 let f: &F = &*(f as *const F);
2792 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2793 }
2794 unsafe {
2795 let f: Box_<F> = Box_::new(f);
2796 connect_raw(
2797 self.as_ptr() as *mut _,
2798 c"notify::replace-local-rule".as_ptr() as *const _,
2799 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2800 notify_replace_local_rule_trampoline::<Self, F> as *const (),
2801 )),
2802 Box_::into_raw(f),
2803 )
2804 }
2805 }
2806
2807 #[cfg(feature = "v1_34")]
2808 #[cfg_attr(docsrs, doc(cfg(feature = "v1_34")))]
2809 #[doc(alias = "required-timeout")]
2810 fn connect_required_timeout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2811 unsafe extern "C" fn notify_required_timeout_trampoline<
2812 P: IsA<SettingIPConfig>,
2813 F: Fn(&P) + 'static,
2814 >(
2815 this: *mut ffi::NMSettingIPConfig,
2816 _param_spec: glib::ffi::gpointer,
2817 f: glib::ffi::gpointer,
2818 ) {
2819 let f: &F = &*(f as *const F);
2820 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2821 }
2822 unsafe {
2823 let f: Box_<F> = Box_::new(f);
2824 connect_raw(
2825 self.as_ptr() as *mut _,
2826 c"notify::required-timeout".as_ptr() as *const _,
2827 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2828 notify_required_timeout_trampoline::<Self, F> as *const (),
2829 )),
2830 Box_::into_raw(f),
2831 )
2832 }
2833 }
2834
2835 #[doc(alias = "route-metric")]
2836 fn connect_route_metric_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2837 unsafe extern "C" fn notify_route_metric_trampoline<
2838 P: IsA<SettingIPConfig>,
2839 F: Fn(&P) + 'static,
2840 >(
2841 this: *mut ffi::NMSettingIPConfig,
2842 _param_spec: glib::ffi::gpointer,
2843 f: glib::ffi::gpointer,
2844 ) {
2845 let f: &F = &*(f as *const F);
2846 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2847 }
2848 unsafe {
2849 let f: Box_<F> = Box_::new(f);
2850 connect_raw(
2851 self.as_ptr() as *mut _,
2852 c"notify::route-metric".as_ptr() as *const _,
2853 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2854 notify_route_metric_trampoline::<Self, F> as *const (),
2855 )),
2856 Box_::into_raw(f),
2857 )
2858 }
2859 }
2860
2861 #[cfg(feature = "v1_10")]
2862 #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
2863 #[doc(alias = "route-table")]
2864 fn connect_route_table_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2865 unsafe extern "C" fn notify_route_table_trampoline<
2866 P: IsA<SettingIPConfig>,
2867 F: Fn(&P) + 'static,
2868 >(
2869 this: *mut ffi::NMSettingIPConfig,
2870 _param_spec: glib::ffi::gpointer,
2871 f: glib::ffi::gpointer,
2872 ) {
2873 let f: &F = &*(f as *const F);
2874 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2875 }
2876 unsafe {
2877 let f: Box_<F> = Box_::new(f);
2878 connect_raw(
2879 self.as_ptr() as *mut _,
2880 c"notify::route-table".as_ptr() as *const _,
2881 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2882 notify_route_table_trampoline::<Self, F> as *const (),
2883 )),
2884 Box_::into_raw(f),
2885 )
2886 }
2887 }
2888
2889 #[cfg(feature = "v1_52")]
2890 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2891 #[doc(alias = "routed-dns")]
2892 fn connect_routed_dns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2893 unsafe extern "C" fn notify_routed_dns_trampoline<
2894 P: IsA<SettingIPConfig>,
2895 F: Fn(&P) + 'static,
2896 >(
2897 this: *mut ffi::NMSettingIPConfig,
2898 _param_spec: glib::ffi::gpointer,
2899 f: glib::ffi::gpointer,
2900 ) {
2901 let f: &F = &*(f as *const F);
2902 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2903 }
2904 unsafe {
2905 let f: Box_<F> = Box_::new(f);
2906 connect_raw(
2907 self.as_ptr() as *mut _,
2908 c"notify::routed-dns".as_ptr() as *const _,
2909 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2910 notify_routed_dns_trampoline::<Self, F> as *const (),
2911 )),
2912 Box_::into_raw(f),
2913 )
2914 }
2915 }
2916
2917 #[doc(alias = "routes")]
2918 fn connect_routes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2919 unsafe extern "C" fn notify_routes_trampoline<
2920 P: IsA<SettingIPConfig>,
2921 F: Fn(&P) + 'static,
2922 >(
2923 this: *mut ffi::NMSettingIPConfig,
2924 _param_spec: glib::ffi::gpointer,
2925 f: glib::ffi::gpointer,
2926 ) {
2927 let f: &F = &*(f as *const F);
2928 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2929 }
2930 unsafe {
2931 let f: Box_<F> = Box_::new(f);
2932 connect_raw(
2933 self.as_ptr() as *mut _,
2934 c"notify::routes".as_ptr() as *const _,
2935 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2936 notify_routes_trampoline::<Self, F> as *const (),
2937 )),
2938 Box_::into_raw(f),
2939 )
2940 }
2941 }
2942
2943 #[cfg(feature = "v1_52")]
2944 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2945 #[doc(alias = "shared-dhcp-lease-time")]
2946 fn connect_shared_dhcp_lease_time_notify<F: Fn(&Self) + 'static>(
2947 &self,
2948 f: F,
2949 ) -> SignalHandlerId {
2950 unsafe extern "C" fn notify_shared_dhcp_lease_time_trampoline<
2951 P: IsA<SettingIPConfig>,
2952 F: Fn(&P) + 'static,
2953 >(
2954 this: *mut ffi::NMSettingIPConfig,
2955 _param_spec: glib::ffi::gpointer,
2956 f: glib::ffi::gpointer,
2957 ) {
2958 let f: &F = &*(f as *const F);
2959 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2960 }
2961 unsafe {
2962 let f: Box_<F> = Box_::new(f);
2963 connect_raw(
2964 self.as_ptr() as *mut _,
2965 c"notify::shared-dhcp-lease-time".as_ptr() as *const _,
2966 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2967 notify_shared_dhcp_lease_time_trampoline::<Self, F> as *const (),
2968 )),
2969 Box_::into_raw(f),
2970 )
2971 }
2972 }
2973
2974 #[cfg(feature = "v1_52")]
2975 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2976 #[doc(alias = "shared-dhcp-range")]
2977 fn connect_shared_dhcp_range_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2978 unsafe extern "C" fn notify_shared_dhcp_range_trampoline<
2979 P: IsA<SettingIPConfig>,
2980 F: Fn(&P) + 'static,
2981 >(
2982 this: *mut ffi::NMSettingIPConfig,
2983 _param_spec: glib::ffi::gpointer,
2984 f: glib::ffi::gpointer,
2985 ) {
2986 let f: &F = &*(f as *const F);
2987 f(SettingIPConfig::from_glib_borrow(this).unsafe_cast_ref())
2988 }
2989 unsafe {
2990 let f: Box_<F> = Box_::new(f);
2991 connect_raw(
2992 self.as_ptr() as *mut _,
2993 c"notify::shared-dhcp-range".as_ptr() as *const _,
2994 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2995 notify_shared_dhcp_range_trampoline::<Self, F> as *const (),
2996 )),
2997 Box_::into_raw(f),
2998 )
2999 }
3000 }
3001}
3002
3003impl<O: IsA<SettingIPConfig>> SettingIPConfigExt for O {}