nm_rs/auto/setting_connection.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_42")]
8#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
9use crate::MptcpFlags;
10#[cfg(feature = "v1_34")]
11#[cfg_attr(docsrs, doc(cfg(feature = "v1_34")))]
12use crate::SettingConnectionDnsOverTls;
13#[cfg(feature = "v1_48")]
14#[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
15use crate::SettingConnectionDownOnPoweroff;
16#[cfg(feature = "v1_12")]
17#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
18use crate::SettingConnectionMdns;
19#[cfg(feature = "v1_46")]
20#[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
21use crate::Ternary;
22#[cfg(feature = "v1_14")]
23#[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
24use crate::{ConnectionMultiConnect, SettingConnectionLlmnr};
25#[cfg(feature = "v1_2")]
26#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
27use crate::{Metered, SettingConnectionAutoconnectSlaves, SettingConnectionLldp};
28use crate::{Setting, ffi};
29use glib::{
30 prelude::*,
31 signal::{SignalHandlerId, connect_raw},
32 translate::*,
33};
34use std::boxed::Box as Box_;
35
36glib::wrapper! {
37 /// General Connection Profile Settings
38 ///
39 /// ## Properties
40 ///
41 ///
42 /// #### `auth-retries`
43 /// The number of retries for the authentication. Zero means to try indefinitely; -1 means
44 /// to use a global default. If the global default is not set, the authentication
45 /// retries for 3 times before failing the connection.
46 ///
47 /// Currently, this only applies to 802-1x authentication.
48 ///
49 /// Readable | Writeable
50 ///
51 ///
52 /// #### `autoconnect`
53 /// Whether or not the connection should be automatically connected by
54 /// NetworkManager when the resources for the connection are available.
55 /// [`true`] to automatically activate the connection, [`false`] to require manual
56 /// intervention to activate the connection.
57 ///
58 /// Autoconnect happens when the circumstances are suitable. That means for
59 /// example that the device is currently managed and not active. Autoconnect
60 /// thus never replaces or competes with an already active profile.
61 ///
62 /// Note that autoconnect is not implemented for VPN profiles. See
63 /// #NMSettingConnection:secondaries as an alternative to automatically
64 /// connect VPN profiles.
65 ///
66 /// If multiple profiles are ready to autoconnect on the same device,
67 /// the one with the better "connection.autoconnect-priority" is chosen. If
68 /// the priorities are equal, then the most recently connected profile is activated.
69 /// If the profiles were not connected earlier or their
70 /// "connection.timestamp" is identical, the choice is undefined.
71 ///
72 /// Depending on "connection.multi-connect", a profile can (auto)connect only
73 /// once at a time or multiple times.
74 ///
75 /// Readable | Writeable
76 ///
77 ///
78 /// #### `autoconnect-ports`
79 /// Whether or not ports of this connection should be automatically brought up
80 /// when NetworkManager activates this connection. This only has a real effect
81 /// for controller connections. The properties #NMSettingConnection:autoconnect,
82 /// #NMSettingConnection:autoconnect-priority and #NMSettingConnection:autoconnect-retries
83 /// are unrelated to this setting.
84 /// The permitted values are: 0: leave port connections untouched,
85 /// 1: activate all the port connections with this connection, -1: default.
86 /// If -1 (default) is set, global connection.autoconnect-ports is read to
87 /// determine the real value. If it is default as well, this fallbacks to 0.
88 ///
89 /// Readable | Writeable
90 ///
91 ///
92 /// #### `autoconnect-priority`
93 /// The autoconnect priority in range -999 to 999. If the connection is set
94 /// to autoconnect, connections with higher priority will be preferred.
95 /// The higher number means higher priority. Defaults to 0.
96 /// Note that this property only matters if there are more than one candidate
97 /// profile to select for autoconnect. In case of equal priority, the profile
98 /// used most recently is chosen.
99 ///
100 /// Readable | Writeable
101 ///
102 ///
103 /// #### `autoconnect-retries`
104 /// The number of times a connection should be tried when autoactivating before
105 /// giving up. Zero means forever, -1 means the global default (4 times if not
106 /// overridden). Setting this to 1 means to try activation only once before
107 /// blocking autoconnect. Note that after a timeout, NetworkManager will try
108 /// to autoconnect again.
109 ///
110 /// Readable | Writeable
111 ///
112 ///
113 /// #### `autoconnect-slaves`
114 /// Whether or not ports of this connection should be automatically brought up
115 /// when NetworkManager activates this connection. This only has a real effect
116 /// for controller connections. The properties #NMSettingConnection:autoconnect,
117 /// #NMSettingConnection:autoconnect-priority and #NMSettingConnection:autoconnect-retries
118 /// are unrelated to this setting.
119 /// The permitted values are: 0: leave port connections untouched,
120 /// 1: activate all the port connections with this connection, -1: default.
121 /// If -1 (default) is set, global connection.autoconnect-slaves is read to
122 /// determine the real value. If it is default as well, this fallbacks to 0.
123 ///
124 /// Deprecated 1.46. Use #NMSettingConnection:autoconnect-ports instead, this is just an alias.
125 ///
126 /// Readable | Writeable
127 ///
128 ///
129 /// #### `controller`
130 /// Interface name of the controller device or UUID of the controller connection.
131 ///
132 /// Readable | Writeable
133 ///
134 ///
135 /// #### `dns-over-tls`
136 /// Whether DNSOverTls (dns-over-tls) is enabled for the connection.
137 /// DNSOverTls is a technology which uses TLS to encrypt dns traffic.
138 ///
139 /// The permitted values are: "yes" (2) use DNSOverTls and disabled fallback,
140 /// "opportunistic" (1) use DNSOverTls but allow fallback to unencrypted resolution,
141 /// "no" (0) don't ever use DNSOverTls.
142 /// If unspecified "default" depends on the plugin used. Systemd-resolved
143 /// uses global setting.
144 ///
145 /// This feature requires a plugin which supports DNSOverTls. Otherwise, the
146 /// setting has no effect. One such plugin is dns-systemd-resolved.
147 ///
148 /// Readable | Writeable
149 ///
150 ///
151 /// #### `down-on-poweroff`
152 /// Whether the connection will be brought down before the system is powered
153 /// off. The default value is [`SettingConnectionDownOnPoweroff::Default`][crate::SettingConnectionDownOnPoweroff::Default]. When
154 /// the default value is specified, then the global value from
155 /// NetworkManager configuration is looked up, if not set, it is considered
156 /// as [`SettingConnectionDownOnPoweroff::No`][crate::SettingConnectionDownOnPoweroff::No].
157 ///
158 /// Readable | Writeable
159 ///
160 ///
161 /// #### `gateway-ping-timeout`
162 /// If greater than zero, delay success of IP addressing until either the
163 /// timeout is reached, or an IP gateway replies to a ping.
164 ///
165 /// Readable | Writeable
166 ///
167 ///
168 /// #### `id`
169 /// A human readable unique identifier for the connection, like "Work Wi-Fi"
170 /// or "T-Mobile 3G".
171 ///
172 /// Readable | Writeable
173 ///
174 ///
175 /// #### `interface-name`
176 /// The name of the network interface this connection is bound to. If not
177 /// set, then the connection can be attached to any interface of the
178 /// appropriate type (subject to restrictions imposed by other settings).
179 ///
180 /// For software devices this specifies the name of the created device.
181 ///
182 /// For connection types where interface names cannot easily be made
183 /// persistent (e.g. mobile broadband or USB Ethernet), this property should
184 /// not be used. Setting this property restricts the interfaces a connection
185 /// can be used with, and if interface names change or are reordered the
186 /// connection may be applied to the wrong interface.
187 ///
188 /// Readable | Writeable
189 ///
190 ///
191 /// #### `ip-ping-addresses`
192 /// The property specifies a list of target IP addresses for pinging.
193 /// When multiple targets are set, NetworkManager will start multiple ping processes
194 /// in parallel. This property can only be set if connection.ip-ping-timeout is
195 /// set. The ip-ping-timeout is used to delay the success of IP addressing until
196 /// either the specified timeout (in seconds) is reached, or an target IP address replies
197 /// to a ping. Configuring #NMSettingConnection:ip-ping-addresses may delay reaching the
198 /// systemd's network-online.target due to waiting for the ping operations to complete or timeout.
199 ///
200 /// Readable | Writeable
201 ///
202 ///
203 /// #### `ip-ping-addresses-require-all`
204 /// The property determines whether it is sufficient for any ping check
205 /// to succeed among #NMSettingConnection:ip-ping-addresses, or if all
206 /// ping checks must succeed for #NMSettingConnection:ip-ping-addresses.
207 ///
208 /// Readable | Writeable
209 ///
210 ///
211 /// #### `ip-ping-timeout`
212 /// If greater than zero, delay success of IP addressing until either the specified
213 /// timeout (in seconds) is reached, or a target IP address replies to a ping. The
214 /// property specifies the timeout for the #NMSettingConnection:ip-ping-addresses.
215 /// This property is incompatible with #NMSettingConnection:gateway-ping-timeout,
216 /// you cannot set these two properties at the same time.
217 ///
218 /// Readable | Writeable
219 ///
220 ///
221 /// #### `lldp`
222 /// Whether LLDP is enabled for the connection.
223 ///
224 /// Readable | Writeable
225 ///
226 ///
227 /// #### `llmnr`
228 /// Whether Link-Local Multicast Name Resolution (LLMNR) is enabled
229 /// for the connection. LLMNR is a protocol based on the Domain Name
230 /// System (DNS) packet format that allows both IPv4 and IPv6 hosts
231 /// to perform name resolution for hosts on the same local link.
232 ///
233 /// The permitted values are: "yes" (2) register hostname and resolving
234 /// for the connection, "no" (0) disable LLMNR for the interface, "resolve"
235 /// (1) do not register hostname but allow resolving of LLMNR host names
236 /// If unspecified, "default" ultimately depends on the DNS plugin (which
237 /// for systemd-resolved currently means "yes").
238 ///
239 /// This feature requires a plugin which supports LLMNR. Otherwise, the
240 /// setting has no effect. One such plugin is dns-systemd-resolved.
241 ///
242 /// Readable | Writeable
243 ///
244 ///
245 /// #### `master`
246 /// Interface name of the controller device or UUID of the controller connection.
247 ///
248 /// Deprecated 1.46. Use #NMSettingConnection:controller instead, this is just an alias.
249 ///
250 /// Readable | Writeable
251 ///
252 ///
253 /// #### `mdns`
254 /// Whether mDNS is enabled for the connection.
255 ///
256 /// The permitted values are: "yes" (2) register hostname and resolving
257 /// for the connection, "no" (0) disable mDNS for the interface, "resolve"
258 /// (1) do not register hostname but allow resolving of mDNS host names
259 /// and "default" (-1) to allow lookup of a global default in NetworkManager.conf.
260 /// If unspecified, "default" ultimately depends on the DNS plugin.
261 ///
262 /// This feature requires a plugin which supports mDNS. Otherwise, the
263 /// setting has no effect. Currently the only supported DNS plugin is
264 /// systemd-resolved. For systemd-resolved, the default is configurable via
265 /// MulticastDNS= setting in resolved.conf.
266 ///
267 /// Readable | Writeable
268 ///
269 ///
270 /// #### `metered`
271 /// Whether the connection is metered.
272 ///
273 /// When updating this property on a currently activated connection,
274 /// the change takes effect immediately.
275 ///
276 /// Readable | Writeable
277 ///
278 ///
279 /// #### `mptcp-flags`
280 /// Whether to configure MPTCP endpoints and the address flags.
281 /// If MPTCP is enabled in NetworkManager, it will configure the
282 /// addresses of the interface as MPTCP endpoints. Note that
283 /// IPv4 loopback addresses (127.0.0.0/8), IPv4 link local
284 /// addresses (169.254.0.0/16), the IPv6 loopback address (::1),
285 /// IPv6 link local addresses (fe80::/10), IPv6 unique
286 /// local addresses (ULA, fc00::/7) and IPv6 privacy extension addresses
287 /// (rfc3041, ipv6.ip6-privacy) will be excluded from being
288 /// configured as endpoints.
289 ///
290 /// If "disabled" (0x1), MPTCP handling for the interface is disabled and
291 /// no endpoints are registered.
292 ///
293 /// The "enabled" (0x2) flag means that MPTCP handling is enabled.
294 /// This flag can also be implied from the presence of other flags.
295 ///
296 /// Even when enabled, MPTCP handling will by default still be disabled
297 /// unless "/proc/sys/net/mptcp/enabled" sysctl is on. NetworkManager
298 /// does not change the sysctl and this is up to the administrator
299 /// or distribution. To configure endpoints even if the sysctl is
300 /// disabled, "also-without-sysctl" (0x4) flag can be used. In that case,
301 /// NetworkManager doesn't look at the sysctl and configures endpoints
302 /// regardless.
303 ///
304 /// Even when enabled, NetworkManager will only configure MPTCP endpoints
305 /// for a certain address family, if there is a unicast default route (0.0.0.0/0
306 /// or ::/0) in the main routing table. The flag "also-without-default-route"
307 /// (0x8) can override that.
308 ///
309 /// When MPTCP handling is enabled then endpoints are configured with
310 /// the specified address flags "signal" (0x10), "subflow" (0x20), "backup" (0x40),
311 /// "fullmesh" (0x80). See ip-mptcp(8) manual for additional information about the flags.
312 ///
313 /// If the flags are zero (0x0), the global connection default from NetworkManager.conf is
314 /// honored. If still unspecified, the fallback is "enabled,subflow".
315 /// Note that this means that MPTCP is by default done depending on the
316 /// "/proc/sys/net/mptcp/enabled" sysctl.
317 ///
318 /// NetworkManager does not change the MPTCP limits nor enable MPTCP via
319 /// "/proc/sys/net/mptcp/enabled". That is a host configuration which the
320 /// admin can change via sysctl and ip-mptcp.
321 ///
322 /// Strict reverse path filtering (rp_filter) breaks many MPTCP use cases, so when
323 /// MPTCP handling for IPv4 addresses on the interface is enabled, NetworkManager would
324 /// loosen the strict reverse path filtering (1) to the loose setting (2).
325 ///
326 /// Readable | Writeable
327 ///
328 ///
329 /// #### `mud-url`
330 /// If configured, set to a Manufacturer Usage Description (MUD) URL that points
331 /// to manufacturer-recommended network policies for IoT devices. It is transmitted
332 /// as a DHCPv4 or DHCPv6 option. The value must be a valid URL starting with "https://".
333 ///
334 /// The special value "none" is allowed to indicate that no MUD URL is used.
335 ///
336 /// If the per-profile value is unspecified (the default), a global connection default gets
337 /// consulted. If still unspecified, the ultimate default is "none".
338 ///
339 /// Readable | Writeable
340 ///
341 ///
342 /// #### `multi-connect`
343 /// Specifies whether the profile can be active multiple times at a particular
344 /// moment. The value is of type #NMConnectionMultiConnect.
345 ///
346 /// Readable | Writeable
347 ///
348 ///
349 /// #### `permissions`
350 /// An array of strings defining what access a given user has to this
351 /// connection. If this is [`None`] or empty, all users are allowed to access
352 /// this connection; otherwise users are allowed if and only if they are in
353 /// this list. When this is not empty, the connection can be active only when
354 /// one of the specified users is logged into an active session. Each entry
355 /// is of the form "[type]:[id]:[reserved]"; for example, "user:dcbw:blah".
356 ///
357 /// At this time only the "user" [type] is allowed. Any other values are
358 /// ignored and reserved for future use. [id] is the username that this
359 /// permission refers to, which may not contain the ":" character. Any
360 /// [reserved] information present must be ignored and is reserved for future
361 /// use. All of [type], [id], and [reserved] must be valid UTF-8.
362 ///
363 /// Readable | Writeable
364 ///
365 ///
366 /// #### `port-type`
367 /// Setting name of the device type of this port's controller connection (eg,
368 /// [`SETTING_BOND_SETTING_NAME`][crate::SETTING_BOND_SETTING_NAME]), or [`None`] if this connection is not a
369 /// port.
370 ///
371 /// Readable | Writeable
372 ///
373 ///
374 /// #### `read-only`
375 /// This property is deprecated and has no meaning.
376 ///
377 /// Readable | Writeable
378 ///
379 ///
380 /// #### `secondaries`
381 /// List of connection UUIDs that should be activated when the base
382 /// connection itself is activated. Currently, only VPN connections are
383 /// supported.
384 ///
385 /// Readable | Writeable
386 ///
387 ///
388 /// #### `slave-type`
389 /// Setting name of the device type of this port's controller connection (eg,
390 /// [`SETTING_BOND_SETTING_NAME`][crate::SETTING_BOND_SETTING_NAME]), or [`None`] if this connection is not a
391 /// port.
392 ///
393 /// Deprecated 1.46. Use #NMSettingConnection:port-type instead, this is just an alias.
394 ///
395 /// Readable | Writeable
396 ///
397 ///
398 /// #### `stable-id`
399 /// This represents the identity of the connection used for various purposes.
400 /// It allows configuring multiple profiles to share the identity. Also,
401 /// the stable-id can contain placeholders that are substituted dynamically and
402 /// deterministically depending on the context.
403 ///
404 /// The stable-id is used for generating IPv6 stable private addresses with
405 /// ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated
406 /// cloned MAC address for ethernet.cloned-mac-address=stable and
407 /// wifi.cloned-mac-address=stable. It is also used to derive the DHCP
408 /// client identifier with ipv4.dhcp-client-id=stable, the DHCPv6 DUID with
409 /// ipv6.dhcp-duid=stable-[llt,ll,uuid] and the DHCP IAID with
410 /// ipv4.iaid=stable and ipv6.iaid=stable.
411 ///
412 /// Note that depending on the context where it is used, other parameters are
413 /// also seeded into the generation algorithm. For example, a per-host key
414 /// is commonly also included, so that different systems end up generating
415 /// different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device's
416 /// name is included, so that different interfaces yield different addresses.
417 /// The per-host key is the identity of your machine and stored in /var/lib/NetworkManager/secret_key.
418 /// See NetworkManager(8) manual about the secret-key and the host identity.
419 ///
420 /// The '$' character is treated special to perform dynamic substitutions at
421 /// activation time. Currently, supported are "${CONNECTION}", "${DEVICE}",
422 /// "${MAC}", "${NETWORK_SSID}", "${BOOT}", "${RANDOM}". These effectively
423 /// create unique IDs per-connection, per-device, per-SSID, per-boot, or
424 /// every time. The "${CONNECTION}" uses the profile's connection.uuid, the
425 /// "${DEVICE}" uses the interface name of the device and "${MAC}" the
426 /// permanent MAC address of the device. "${NETWORK_SSID}" uses the SSID for
427 /// Wi-Fi networks and falls back to "${CONNECTION}" on other networks. Any
428 /// unrecognized patterns following '$' are treated verbatim, however are
429 /// reserved for future use. You are thus advised to avoid '$' or escape it
430 /// as "$$". For example, set it to "${CONNECTION}-${BOOT}-${DEVICE}" to
431 /// create a unique id for this connection that changes with every reboot
432 /// and differs depending on the interface where the profile activates.
433 ///
434 /// If the value is unset, a global connection default is consulted. If the
435 /// value is still unset, the default is "default${CONNECTION}" go generate
436 /// an ID unique per connection profile.
437 ///
438 /// Readable | Writeable
439 ///
440 ///
441 /// #### `timestamp`
442 /// The time, in seconds since the Unix Epoch, that the connection was last
443 /// _successfully_ fully activated.
444 ///
445 /// NetworkManager updates the connection timestamp periodically when the
446 /// connection is active to ensure that an active connection has the latest
447 /// timestamp. The property is only meant for reading (changes to this
448 /// property will not be preserved).
449 ///
450 /// Readable | Writeable
451 ///
452 ///
453 /// #### `type`
454 /// Base type of the connection. For hardware-dependent connections, should
455 /// contain the setting name of the hardware-type specific setting (ie,
456 /// "802-3-ethernet" or "802-11-wireless" or "bluetooth", etc), and for
457 /// non-hardware dependent connections like VPN or otherwise, should contain
458 /// the setting name of that setting type (ie, "vpn" or "bridge", etc).
459 ///
460 /// Readable | Writeable
461 ///
462 ///
463 /// #### `uuid`
464 /// A universally unique identifier for the connection, for example generated
465 /// with libuuid. It should be assigned when the connection is created, and
466 /// never changed as long as the connection still applies to the same
467 /// network. For example, it should not be changed when the
468 /// #NMSettingConnection:id property or #NMSettingIP4Config changes, but
469 /// might need to be re-created when the Wi-Fi SSID, mobile broadband network
470 /// provider, or #NMSettingConnection:type property changes.
471 ///
472 /// The UUID must be in the format "2815492f-7e56-435e-b2e9-246bd7cdc664"
473 /// (ie, contains only hexadecimal characters and "-"). A suitable UUID may
474 /// be generated by nm_utils_uuid_generate() or
475 /// nm_uuid_generate_from_string_str().
476 ///
477 /// Readable | Writeable
478 ///
479 ///
480 /// #### `wait-activation-delay`
481 /// Time in milliseconds to wait for connection to be considered activated.
482 /// The wait will start after the pre-up dispatcher event.
483 ///
484 /// The value 0 means no wait time. The default value is -1, which
485 /// currently has the same meaning as no wait time.
486 ///
487 /// Readable | Writeable
488 ///
489 ///
490 /// #### `wait-device-timeout`
491 /// Timeout in milliseconds to wait for device at startup.
492 /// During boot, devices may take a while to be detected by the driver.
493 /// This property will cause to delay NetworkManager-wait-online.service
494 /// and nm-online to give the device a chance to appear. This works by
495 /// waiting for the given timeout until a compatible device for the
496 /// profile is available and managed.
497 ///
498 /// The value 0 means no wait time. The default value is -1, which
499 /// currently has the same meaning as no wait time.
500 ///
501 /// Readable | Writeable
502 ///
503 ///
504 /// #### `zone`
505 /// The trust level of a the connection. Free form case-insensitive string
506 /// (for example "Home", "Work", "Public"). [`None`] or unspecified zone means
507 /// the connection will be placed in the default zone as defined by the
508 /// firewall.
509 ///
510 /// When updating this property on a currently activated connection,
511 /// the change takes effect immediately.
512 ///
513 /// Readable | Writeable
514 /// <details><summary><h4>Setting</h4></summary>
515 ///
516 ///
517 /// #### `name`
518 /// The setting's name, which uniquely identifies the setting within the
519 /// connection. Each setting type has a name unique to that type, for
520 /// example "ppp" or "802-11-wireless" or "802-3-ethernet".
521 ///
522 /// Readable
523 /// </details>
524 ///
525 /// # Implements
526 ///
527 /// [`SettingExt`][trait@crate::prelude::SettingExt]
528 #[doc(alias = "NMSettingConnection")]
529 pub struct SettingConnection(Object<ffi::NMSettingConnection, ffi::NMSettingConnectionClass>) @extends Setting;
530
531 match fn {
532 type_ => || ffi::nm_setting_connection_get_type(),
533 }
534}
535
536impl SettingConnection {
537 /// Creates a new #NMSettingConnection object with default values.
538 ///
539 /// # Returns
540 ///
541 /// the new empty #NMSettingConnection object
542 #[doc(alias = "nm_setting_connection_new")]
543 pub fn new() -> SettingConnection {
544 assert_initialized_main_thread!();
545 unsafe { Setting::from_glib_full(ffi::nm_setting_connection_new()).unsafe_cast() }
546 }
547
548 // rustdoc-stripper-ignore-next
549 /// Creates a new builder-pattern struct instance to construct [`SettingConnection`] objects.
550 ///
551 /// This method returns an instance of [`SettingConnectionBuilder`](crate::builders::SettingConnectionBuilder) which can be used to create [`SettingConnection`] objects.
552 pub fn builder() -> SettingConnectionBuilder {
553 SettingConnectionBuilder::new()
554 }
555
556 /// Adds a new IP address string to the ip-ping-addresses.
557 /// ## `address`
558 /// the IP address string to add
559 ///
560 /// # Returns
561 ///
562 /// [`true`] if the new IP address was added; [`false`] if the IP address
563 /// was already present
564 #[cfg(feature = "v1_52")]
565 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
566 #[doc(alias = "nm_setting_connection_add_ip_ping_address")]
567 pub fn add_ip_ping_address(&self, address: &str) -> bool {
568 unsafe {
569 from_glib(ffi::nm_setting_connection_add_ip_ping_address(
570 self.to_glib_none().0,
571 address.to_glib_none().0,
572 ))
573 }
574 }
575
576 /// Adds a permission to the connection's permission list. At this time, only
577 /// the "user" permission type is supported, and @pitem must be a username. See
578 /// #NMSettingConnection:permissions: for more details.
579 /// ## `ptype`
580 /// the permission type; at this time only "user" is supported
581 /// ## `pitem`
582 /// the permission item formatted as required for @ptype
583 /// ## `detail`
584 /// unused at this time; must be [`None`]
585 ///
586 /// # Returns
587 ///
588 /// [`true`] if the permission was unique and was successfully added to the
589 /// list, [`false`] if @ptype or @pitem was invalid.
590 /// If the permission was already present in the list, it will not be added
591 /// a second time but [`true`] will be returned. Note that before 1.28, in this
592 /// case [`false`] would be returned.
593 #[doc(alias = "nm_setting_connection_add_permission")]
594 pub fn add_permission(&self, ptype: &str, pitem: &str, detail: Option<&str>) -> bool {
595 unsafe {
596 from_glib(ffi::nm_setting_connection_add_permission(
597 self.to_glib_none().0,
598 ptype.to_glib_none().0,
599 pitem.to_glib_none().0,
600 detail.to_glib_none().0,
601 ))
602 }
603 }
604
605 /// Adds a new secondary connection UUID to the setting.
606 /// ## `sec_uuid`
607 /// the secondary connection UUID to add
608 ///
609 /// # Returns
610 ///
611 /// [`true`] if the secondary connection UUID was added; [`false`] if the UUID
612 /// was already present
613 #[doc(alias = "nm_setting_connection_add_secondary")]
614 pub fn add_secondary(&self, sec_uuid: &str) -> bool {
615 unsafe {
616 from_glib(ffi::nm_setting_connection_add_secondary(
617 self.to_glib_none().0,
618 sec_uuid.to_glib_none().0,
619 ))
620 }
621 }
622
623 /// Removes all configured ip-ping-addresses.
624 #[cfg(feature = "v1_52")]
625 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
626 #[doc(alias = "nm_setting_connection_clear_ip_ping_addresses")]
627 pub fn clear_ip_ping_addresses(&self) {
628 unsafe {
629 ffi::nm_setting_connection_clear_ip_ping_addresses(self.to_glib_none().0);
630 }
631 }
632
633 /// Returns the value contained in the #NMSettingConnection:auth-retries property.
634 ///
635 /// # Returns
636 ///
637 /// the configured authentication retries. Zero means
638 /// infinity and -1 means a global default value.
639 #[cfg(feature = "v1_10")]
640 #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
641 #[doc(alias = "nm_setting_connection_get_auth_retries")]
642 #[doc(alias = "get_auth_retries")]
643 #[doc(alias = "auth-retries")]
644 pub fn auth_retries(&self) -> i32 {
645 unsafe { ffi::nm_setting_connection_get_auth_retries(self.to_glib_none().0) }
646 }
647
648 /// Returns the #NMSettingConnection:autoconnect property of the connection.
649 ///
650 /// # Returns
651 ///
652 /// the connection's autoconnect behavior
653 #[doc(alias = "nm_setting_connection_get_autoconnect")]
654 #[doc(alias = "get_autoconnect")]
655 #[doc(alias = "autoconnect")]
656 pub fn is_autoconnect(&self) -> bool {
657 unsafe {
658 from_glib(ffi::nm_setting_connection_get_autoconnect(
659 self.to_glib_none().0,
660 ))
661 }
662 }
663
664 /// Returns the #NMSettingConnection:autoconnect-ports property of the connection.
665 ///
666 /// # Returns
667 ///
668 /// whether ports of the connection should be activated together
669 /// with the connection.
670 #[cfg(feature = "v1_46")]
671 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
672 #[doc(alias = "nm_setting_connection_get_autoconnect_ports")]
673 #[doc(alias = "get_autoconnect_ports")]
674 #[doc(alias = "autoconnect-ports")]
675 pub fn autoconnect_ports(&self) -> Ternary {
676 unsafe {
677 from_glib(ffi::nm_setting_connection_get_autoconnect_ports(
678 self.to_glib_none().0,
679 ))
680 }
681 }
682
683 /// Returns the #NMSettingConnection:autoconnect-priority property of the connection.
684 /// The higher number, the higher priority.
685 ///
686 /// # Returns
687 ///
688 /// the connection's autoconnect priority
689 #[doc(alias = "nm_setting_connection_get_autoconnect_priority")]
690 #[doc(alias = "get_autoconnect_priority")]
691 #[doc(alias = "autoconnect-priority")]
692 pub fn autoconnect_priority(&self) -> i32 {
693 unsafe { ffi::nm_setting_connection_get_autoconnect_priority(self.to_glib_none().0) }
694 }
695
696 /// Returns the #NMSettingConnection:autoconnect-retries property of the connection.
697 /// Zero means infinite, -1 means the global default value.
698 ///
699 /// # Returns
700 ///
701 /// the connection's autoconnect retries
702 #[cfg(feature = "v1_6")]
703 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
704 #[doc(alias = "nm_setting_connection_get_autoconnect_retries")]
705 #[doc(alias = "get_autoconnect_retries")]
706 #[doc(alias = "autoconnect-retries")]
707 pub fn autoconnect_retries(&self) -> i32 {
708 unsafe { ffi::nm_setting_connection_get_autoconnect_retries(self.to_glib_none().0) }
709 }
710
711 /// Returns the #NMSettingConnection:autoconnect-slaves property of the connection.
712 ///
713 /// # Deprecated since 1.46
714 ///
715 /// Use nm_setting_connection_get_autoconnect_ports() instead, this
716 /// is just an alias.
717 ///
718 /// # Returns
719 ///
720 /// whether ports of the connection should be activated together
721 /// with the connection.
722 #[cfg_attr(feature = "v1_46", deprecated = "Since 1.46")]
723 #[cfg(feature = "v1_2")]
724 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
725 #[allow(deprecated)]
726 #[doc(alias = "nm_setting_connection_get_autoconnect_slaves")]
727 #[doc(alias = "get_autoconnect_slaves")]
728 #[doc(alias = "autoconnect-slaves")]
729 pub fn autoconnect_slaves(&self) -> SettingConnectionAutoconnectSlaves {
730 unsafe {
731 from_glib(ffi::nm_setting_connection_get_autoconnect_slaves(
732 self.to_glib_none().0,
733 ))
734 }
735 }
736
737 /// Returns the #NMSettingConnection:type property of the connection.
738 ///
739 /// # Returns
740 ///
741 /// the connection type
742 #[doc(alias = "nm_setting_connection_get_connection_type")]
743 #[doc(alias = "get_connection_type")]
744 pub fn connection_type(&self) -> glib::GString {
745 unsafe {
746 from_glib_none(ffi::nm_setting_connection_get_connection_type(
747 self.to_glib_none().0,
748 ))
749 }
750 }
751
752 /// Returns the #NMSettingConnection:controller property of the connection.
753 ///
754 /// # Returns
755 ///
756 /// interface name of the controller device or UUID of the controller
757 /// connection.
758 #[cfg(feature = "v1_46")]
759 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
760 #[doc(alias = "nm_setting_connection_get_controller")]
761 #[doc(alias = "get_controller")]
762 pub fn controller(&self) -> glib::GString {
763 unsafe {
764 from_glib_none(ffi::nm_setting_connection_get_controller(
765 self.to_glib_none().0,
766 ))
767 }
768 }
769
770 ///
771 /// # Returns
772 ///
773 /// the #NMSettingConnection:dns-over-tls property of the setting.
774 #[cfg(feature = "v1_34")]
775 #[cfg_attr(docsrs, doc(cfg(feature = "v1_34")))]
776 #[doc(alias = "nm_setting_connection_get_dns_over_tls")]
777 #[doc(alias = "get_dns_over_tls")]
778 #[doc(alias = "dns-over-tls")]
779 pub fn dns_over_tls(&self) -> SettingConnectionDnsOverTls {
780 unsafe {
781 from_glib(ffi::nm_setting_connection_get_dns_over_tls(
782 self.to_glib_none().0,
783 ))
784 }
785 }
786
787 /// Returns the [`SETTING_CONNECTION_DOWN_ON_POWEROFF`][crate::SETTING_CONNECTION_DOWN_ON_POWEROFF] property.
788 ///
789 /// # Returns
790 ///
791 /// whether the connection will be brought down before the system
792 /// is powered off.
793 #[cfg(feature = "v1_48")]
794 #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
795 #[doc(alias = "nm_setting_connection_get_down_on_poweroff")]
796 #[doc(alias = "get_down_on_poweroff")]
797 #[doc(alias = "down-on-poweroff")]
798 pub fn down_on_poweroff(&self) -> SettingConnectionDownOnPoweroff {
799 unsafe {
800 from_glib(ffi::nm_setting_connection_get_down_on_poweroff(
801 self.to_glib_none().0,
802 ))
803 }
804 }
805
806 ///
807 /// # Returns
808 ///
809 /// the value contained in the #NMSettingConnection:gateway-ping-timeout
810 /// property.
811 #[doc(alias = "nm_setting_connection_get_gateway_ping_timeout")]
812 #[doc(alias = "get_gateway_ping_timeout")]
813 #[doc(alias = "gateway-ping-timeout")]
814 pub fn gateway_ping_timeout(&self) -> u32 {
815 unsafe { ffi::nm_setting_connection_get_gateway_ping_timeout(self.to_glib_none().0) }
816 }
817
818 /// Returns the #NMSettingConnection:id property of the connection.
819 ///
820 /// # Returns
821 ///
822 /// the connection ID
823 #[doc(alias = "nm_setting_connection_get_id")]
824 #[doc(alias = "get_id")]
825 pub fn id(&self) -> glib::GString {
826 unsafe { from_glib_none(ffi::nm_setting_connection_get_id(self.to_glib_none().0)) }
827 }
828
829 /// Returns the #NMSettingConnection:interface-name property of the connection.
830 ///
831 /// # Returns
832 ///
833 /// the connection's interface name
834 #[doc(alias = "nm_setting_connection_get_interface_name")]
835 #[doc(alias = "get_interface_name")]
836 #[doc(alias = "interface-name")]
837 pub fn interface_name(&self) -> glib::GString {
838 unsafe {
839 from_glib_none(ffi::nm_setting_connection_get_interface_name(
840 self.to_glib_none().0,
841 ))
842 }
843 }
844
845 /// ## `idx`
846 /// the zero-based index of the ip-ping-addresses entry.
847 ///
848 /// # Returns
849 ///
850 /// the ip address string at index @idx or
851 /// [`None`] if @idx is the number of ip-ping-addresses.
852 #[cfg(feature = "v1_52")]
853 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
854 #[doc(alias = "nm_setting_connection_get_ip_ping_address")]
855 #[doc(alias = "get_ip_ping_address")]
856 pub fn ip_ping_address(&self, idx: u32) -> glib::GString {
857 unsafe {
858 from_glib_none(ffi::nm_setting_connection_get_ip_ping_address(
859 self.to_glib_none().0,
860 idx,
861 ))
862 }
863 }
864
865 /// Returns the #NMSettingConnection:ip-ping-addresses-require-all property of the connection.
866 ///
867 /// # Returns
868 ///
869 /// whether all the ip ping addresses pass the connectivity check.
870 #[cfg(feature = "v1_52")]
871 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
872 #[doc(alias = "nm_setting_connection_get_ip_ping_addresses_require_all")]
873 #[doc(alias = "get_ip_ping_addresses_require_all")]
874 #[doc(alias = "ip-ping-addresses-require-all")]
875 pub fn ip_ping_addresses_require_all(&self) -> Ternary {
876 unsafe {
877 from_glib(
878 ffi::nm_setting_connection_get_ip_ping_addresses_require_all(self.to_glib_none().0),
879 )
880 }
881 }
882
883 ///
884 /// # Returns
885 ///
886 /// the value contained in the #NMSettingConnection:ip-ping-timeout
887 /// property.
888 #[cfg(feature = "v1_52")]
889 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
890 #[doc(alias = "nm_setting_connection_get_ip_ping_timeout")]
891 #[doc(alias = "get_ip_ping_timeout")]
892 #[doc(alias = "ip-ping-timeout")]
893 pub fn ip_ping_timeout(&self) -> u32 {
894 unsafe { ffi::nm_setting_connection_get_ip_ping_timeout(self.to_glib_none().0) }
895 }
896
897 /// Returns the #NMSettingConnection:lldp property of the connection.
898 ///
899 /// # Returns
900 ///
901 /// a `NMSettingConnectionLldp` which indicates whether LLDP must be
902 /// enabled for the connection.
903 #[cfg(feature = "v1_2")]
904 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
905 #[doc(alias = "nm_setting_connection_get_lldp")]
906 #[doc(alias = "get_lldp")]
907 pub fn lldp(&self) -> SettingConnectionLldp {
908 unsafe { from_glib(ffi::nm_setting_connection_get_lldp(self.to_glib_none().0)) }
909 }
910
911 ///
912 /// # Returns
913 ///
914 /// the #NMSettingConnection:llmnr property of the setting.
915 #[cfg(feature = "v1_14")]
916 #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
917 #[doc(alias = "nm_setting_connection_get_llmnr")]
918 #[doc(alias = "get_llmnr")]
919 pub fn llmnr(&self) -> SettingConnectionLlmnr {
920 unsafe { from_glib(ffi::nm_setting_connection_get_llmnr(self.to_glib_none().0)) }
921 }
922
923 /// Returns the #NMSettingConnection:master property of the connection.
924 ///
925 /// # Deprecated since 1.46
926 ///
927 /// Use nm_setting_connection_get_master() instead which
928 /// is just an alias.
929 ///
930 /// # Returns
931 ///
932 /// interface name of the controller device or UUID of the controller
933 /// connection.
934 #[cfg_attr(feature = "v1_46", deprecated = "Since 1.46")]
935 #[allow(deprecated)]
936 #[doc(alias = "nm_setting_connection_get_master")]
937 #[doc(alias = "get_master")]
938 pub fn master(&self) -> glib::GString {
939 unsafe { from_glib_none(ffi::nm_setting_connection_get_master(self.to_glib_none().0)) }
940 }
941
942 ///
943 /// # Returns
944 ///
945 /// the #NMSettingConnection:mdns property of the setting.
946 #[cfg(feature = "v1_12")]
947 #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
948 #[doc(alias = "nm_setting_connection_get_mdns")]
949 #[doc(alias = "get_mdns")]
950 pub fn mdns(&self) -> SettingConnectionMdns {
951 unsafe { from_glib(ffi::nm_setting_connection_get_mdns(self.to_glib_none().0)) }
952 }
953
954 ///
955 /// # Returns
956 ///
957 /// the #NMSettingConnection:metered property of the setting.
958 #[cfg(feature = "v1_2")]
959 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
960 #[doc(alias = "nm_setting_connection_get_metered")]
961 #[doc(alias = "get_metered")]
962 pub fn metered(&self) -> Metered {
963 unsafe {
964 from_glib(ffi::nm_setting_connection_get_metered(
965 self.to_glib_none().0,
966 ))
967 }
968 }
969
970 ///
971 /// # Returns
972 ///
973 /// the #NMSettingConnection:mptcp-flags property of the setting.
974 #[cfg(feature = "v1_42")]
975 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
976 #[doc(alias = "nm_setting_connection_get_mptcp_flags")]
977 #[doc(alias = "get_mptcp_flags")]
978 #[doc(alias = "mptcp-flags")]
979 pub fn mptcp_flags(&self) -> MptcpFlags {
980 unsafe {
981 from_glib(ffi::nm_setting_connection_get_mptcp_flags(
982 self.to_glib_none().0,
983 ))
984 }
985 }
986
987 /// Returns the value contained in the #NMSettingConnection:mud-url
988 /// property.
989 #[cfg(feature = "v1_26")]
990 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
991 #[doc(alias = "nm_setting_connection_get_mud_url")]
992 #[doc(alias = "get_mud_url")]
993 #[doc(alias = "mud-url")]
994 pub fn mud_url(&self) -> glib::GString {
995 unsafe {
996 from_glib_none(ffi::nm_setting_connection_get_mud_url(
997 self.to_glib_none().0,
998 ))
999 }
1000 }
1001
1002 ///
1003 /// # Returns
1004 ///
1005 /// the #NMSettingConnection:multi-connect property of the connection.
1006 #[cfg(feature = "v1_14")]
1007 #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
1008 #[doc(alias = "nm_setting_connection_get_multi_connect")]
1009 #[doc(alias = "get_multi_connect")]
1010 #[doc(alias = "multi-connect")]
1011 pub fn multi_connect(&self) -> ConnectionMultiConnect {
1012 unsafe {
1013 from_glib(ffi::nm_setting_connection_get_multi_connect(
1014 self.to_glib_none().0,
1015 ))
1016 }
1017 }
1018
1019 /// Returns the number of entries in the #NMSettingConnection:permissions
1020 /// property of this setting.
1021 ///
1022 /// # Returns
1023 ///
1024 /// the number of permissions entries
1025 #[doc(alias = "nm_setting_connection_get_num_permissions")]
1026 #[doc(alias = "get_num_permissions")]
1027 pub fn num_permissions(&self) -> u32 {
1028 unsafe { ffi::nm_setting_connection_get_num_permissions(self.to_glib_none().0) }
1029 }
1030
1031 ///
1032 /// # Returns
1033 ///
1034 /// the number of configured secondary connection UUIDs
1035 #[doc(alias = "nm_setting_connection_get_num_secondaries")]
1036 #[doc(alias = "get_num_secondaries")]
1037 pub fn num_secondaries(&self) -> u32 {
1038 unsafe { ffi::nm_setting_connection_get_num_secondaries(self.to_glib_none().0) }
1039 }
1040
1041 /// Retrieve one of the entries of the #NMSettingConnection:permissions property
1042 /// of this setting.
1043 /// ## `idx`
1044 /// the zero-based index of the permissions entry
1045 /// ## `out_ptype`
1046 /// on return, the permission type. This is currently always "user",
1047 /// unless the entry is invalid, in which case it returns "invalid".
1048 /// ## `out_pitem`
1049 /// on return, the permission item (formatted according to @ptype, see
1050 /// #NMSettingConnection:permissions for more detail
1051 /// ## `out_detail`
1052 /// on return, the permission detail (at this time, always [`None`])
1053 ///
1054 /// # Returns
1055 ///
1056 /// [`true`] if a permission was returned, [`false`] if @idx was invalid
1057 #[doc(alias = "nm_setting_connection_get_permission")]
1058 #[doc(alias = "get_permission")]
1059 pub fn is_permission(
1060 &self,
1061 idx: u32,
1062 out_ptype: &mut str,
1063 out_pitem: &mut str,
1064 out_detail: &mut str,
1065 ) -> bool {
1066 unsafe {
1067 from_glib(ffi::nm_setting_connection_get_permission(
1068 self.to_glib_none().0,
1069 idx,
1070 &mut out_ptype.to_glib_none().0,
1071 &mut out_pitem.to_glib_none().0,
1072 &mut out_detail.to_glib_none().0,
1073 ))
1074 }
1075 }
1076
1077 /// Returns the #NMSettingConnection:port-type property of the connection.
1078 ///
1079 /// # Returns
1080 ///
1081 /// the type of port this connection is, if any.
1082 #[cfg(feature = "v1_46")]
1083 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
1084 #[doc(alias = "nm_setting_connection_get_port_type")]
1085 #[doc(alias = "get_port_type")]
1086 #[doc(alias = "port-type")]
1087 pub fn port_type(&self) -> glib::GString {
1088 unsafe {
1089 from_glib_none(ffi::nm_setting_connection_get_port_type(
1090 self.to_glib_none().0,
1091 ))
1092 }
1093 }
1094
1095 /// Returns the #NMSettingConnection:read-only property of the connection.
1096 ///
1097 /// # Deprecated since 1.44
1098 ///
1099 /// This property is deprecated and has no meaning.
1100 ///
1101 /// # Returns
1102 ///
1103 /// [`true`] if the connection is read-only, [`false`] if it is not
1104 #[cfg_attr(feature = "v1_44", deprecated = "Since 1.44")]
1105 #[allow(deprecated)]
1106 #[doc(alias = "nm_setting_connection_get_read_only")]
1107 #[doc(alias = "get_read_only")]
1108 #[doc(alias = "read-only")]
1109 pub fn is_read_only(&self) -> bool {
1110 unsafe {
1111 from_glib(ffi::nm_setting_connection_get_read_only(
1112 self.to_glib_none().0,
1113 ))
1114 }
1115 }
1116
1117 /// ## `idx`
1118 /// the zero-based index of the secondary connection UUID entry.
1119 /// Access one past the length of secondaries is ok and will return
1120 /// [`None`]. Otherwise, it is a user error.
1121 ///
1122 /// # Returns
1123 ///
1124 /// the secondary connection UUID at index @idx or
1125 /// [`None`] if @idx is the number of secondaries.
1126 #[doc(alias = "nm_setting_connection_get_secondary")]
1127 #[doc(alias = "get_secondary")]
1128 pub fn secondary(&self, idx: u32) -> glib::GString {
1129 unsafe {
1130 from_glib_none(ffi::nm_setting_connection_get_secondary(
1131 self.to_glib_none().0,
1132 idx,
1133 ))
1134 }
1135 }
1136
1137 /// Returns the #NMSettingConnection:slave-type property of the connection.
1138 ///
1139 /// # Deprecated since 1.46
1140 ///
1141 /// Use nm_setting_connection_get_port_type() instead which
1142 /// is just an alias.
1143 ///
1144 /// # Returns
1145 ///
1146 /// the type of port this connection is, if any
1147 #[cfg_attr(feature = "v1_46", deprecated = "Since 1.46")]
1148 #[allow(deprecated)]
1149 #[doc(alias = "nm_setting_connection_get_slave_type")]
1150 #[doc(alias = "get_slave_type")]
1151 #[doc(alias = "slave-type")]
1152 pub fn slave_type(&self) -> glib::GString {
1153 unsafe {
1154 from_glib_none(ffi::nm_setting_connection_get_slave_type(
1155 self.to_glib_none().0,
1156 ))
1157 }
1158 }
1159
1160 /// Returns the #NMSettingConnection:stable_id property of the connection.
1161 ///
1162 /// # Returns
1163 ///
1164 /// the stable-id for the connection
1165 #[cfg(feature = "v1_4")]
1166 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
1167 #[doc(alias = "nm_setting_connection_get_stable_id")]
1168 #[doc(alias = "get_stable_id")]
1169 #[doc(alias = "stable-id")]
1170 pub fn stable_id(&self) -> glib::GString {
1171 unsafe {
1172 from_glib_none(ffi::nm_setting_connection_get_stable_id(
1173 self.to_glib_none().0,
1174 ))
1175 }
1176 }
1177
1178 /// Returns the #NMSettingConnection:timestamp property of the connection.
1179 ///
1180 /// # Returns
1181 ///
1182 /// the connection's timestamp
1183 #[doc(alias = "nm_setting_connection_get_timestamp")]
1184 #[doc(alias = "get_timestamp")]
1185 pub fn timestamp(&self) -> u64 {
1186 unsafe { ffi::nm_setting_connection_get_timestamp(self.to_glib_none().0) }
1187 }
1188
1189 /// Returns the #NMSettingConnection:uuid property of the connection.
1190 ///
1191 /// # Returns
1192 ///
1193 /// the connection UUID
1194 #[doc(alias = "nm_setting_connection_get_uuid")]
1195 #[doc(alias = "get_uuid")]
1196 pub fn uuid(&self) -> glib::GString {
1197 unsafe { from_glib_none(ffi::nm_setting_connection_get_uuid(self.to_glib_none().0)) }
1198 }
1199
1200 ///
1201 /// # Returns
1202 ///
1203 /// the [`SETTING_CONNECTION_WAIT_ACTIVATION_DELAY`][crate::SETTING_CONNECTION_WAIT_ACTIVATION_DELAY] property with
1204 /// the delay in milliseconds. -1 is the default.
1205 #[cfg(feature = "v1_40")]
1206 #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
1207 #[doc(alias = "nm_setting_connection_get_wait_activation_delay")]
1208 #[doc(alias = "get_wait_activation_delay")]
1209 #[doc(alias = "wait-activation-delay")]
1210 pub fn wait_activation_delay(&self) -> i32 {
1211 unsafe { ffi::nm_setting_connection_get_wait_activation_delay(self.to_glib_none().0) }
1212 }
1213
1214 ///
1215 /// # Returns
1216 ///
1217 /// the [`SETTING_CONNECTION_WAIT_DEVICE_TIMEOUT`][crate::SETTING_CONNECTION_WAIT_DEVICE_TIMEOUT] property with
1218 /// the timeout in milliseconds. -1 is the default.
1219 #[cfg(feature = "v1_20")]
1220 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1221 #[doc(alias = "nm_setting_connection_get_wait_device_timeout")]
1222 #[doc(alias = "get_wait_device_timeout")]
1223 #[doc(alias = "wait-device-timeout")]
1224 pub fn wait_device_timeout(&self) -> i32 {
1225 unsafe { ffi::nm_setting_connection_get_wait_device_timeout(self.to_glib_none().0) }
1226 }
1227
1228 /// Returns the #NMSettingConnection:zone property of the connection.
1229 ///
1230 /// # Returns
1231 ///
1232 /// the trust level of a connection
1233 #[doc(alias = "nm_setting_connection_get_zone")]
1234 #[doc(alias = "get_zone")]
1235 pub fn zone(&self) -> glib::GString {
1236 unsafe { from_glib_none(ffi::nm_setting_connection_get_zone(self.to_glib_none().0)) }
1237 }
1238
1239 ///
1240 /// # Deprecated since 1.46
1241 ///
1242 /// ## `type_`
1243 /// the setting name (ie #NM_SETTING_BOND_SETTING_NAME) to be matched
1244 /// against @self's port type
1245 ///
1246 /// # Returns
1247 ///
1248 /// [`true`] if connection is of the given port @type_
1249 #[cfg_attr(feature = "v1_46", deprecated = "Since 1.46")]
1250 #[allow(deprecated)]
1251 #[doc(alias = "nm_setting_connection_is_slave_type")]
1252 pub fn is_slave_type(&self, type_: &str) -> bool {
1253 unsafe {
1254 from_glib(ffi::nm_setting_connection_is_slave_type(
1255 self.to_glib_none().0,
1256 type_.to_glib_none().0,
1257 ))
1258 }
1259 }
1260
1261 /// Checks whether the given username is allowed to view/access this connection.
1262 /// ## `uname`
1263 /// the user name to check permissions for
1264 ///
1265 /// # Returns
1266 ///
1267 /// [`true`] if the requested user is allowed to view this connection,
1268 /// [`false`] if the given user is not allowed to view this connection
1269 #[doc(alias = "nm_setting_connection_permissions_user_allowed")]
1270 pub fn permissions_user_allowed(&self, uname: &str) -> bool {
1271 unsafe {
1272 from_glib(ffi::nm_setting_connection_permissions_user_allowed(
1273 self.to_glib_none().0,
1274 uname.to_glib_none().0,
1275 ))
1276 }
1277 }
1278
1279 /// Removes the IP address at index @idx.
1280 /// ## `idx`
1281 /// index number of the IP address
1282 #[cfg(feature = "v1_52")]
1283 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1284 #[doc(alias = "nm_setting_connection_remove_ip_ping_address")]
1285 pub fn remove_ip_ping_address(&self, idx: u32) {
1286 unsafe {
1287 ffi::nm_setting_connection_remove_ip_ping_address(self.to_glib_none().0, idx);
1288 }
1289 }
1290
1291 /// Removes the IP address @address from ip-ping-addresses.
1292 /// ## `address`
1293 /// the IP address to remove
1294 ///
1295 /// # Returns
1296 ///
1297 /// [`true`] if the IP address was found and removed; [`false`] if it was not.
1298 #[cfg(feature = "v1_52")]
1299 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1300 #[doc(alias = "nm_setting_connection_remove_ip_ping_address_by_value")]
1301 pub fn remove_ip_ping_address_by_value(&self, address: &str) -> bool {
1302 unsafe {
1303 from_glib(ffi::nm_setting_connection_remove_ip_ping_address_by_value(
1304 self.to_glib_none().0,
1305 address.to_glib_none().0,
1306 ))
1307 }
1308 }
1309
1310 /// Removes the permission at index @idx from the connection.
1311 /// ## `idx`
1312 /// the zero-based index of the permission to remove
1313 #[doc(alias = "nm_setting_connection_remove_permission")]
1314 pub fn remove_permission(&self, idx: u32) {
1315 unsafe {
1316 ffi::nm_setting_connection_remove_permission(self.to_glib_none().0, idx);
1317 }
1318 }
1319
1320 /// Removes the permission from the connection.
1321 /// At this time, only the "user" permission type is supported, and @pitem must
1322 /// be a username. See #NMSettingConnection:permissions: for more details.
1323 /// ## `ptype`
1324 /// the permission type; at this time only "user" is supported
1325 /// ## `pitem`
1326 /// the permission item formatted as required for @ptype
1327 /// ## `detail`
1328 /// unused at this time; must be [`None`]
1329 ///
1330 /// # Returns
1331 ///
1332 /// [`true`] if the permission was found and removed; [`false`] if it was not.
1333 #[doc(alias = "nm_setting_connection_remove_permission_by_value")]
1334 pub fn remove_permission_by_value(
1335 &self,
1336 ptype: &str,
1337 pitem: &str,
1338 detail: Option<&str>,
1339 ) -> bool {
1340 unsafe {
1341 from_glib(ffi::nm_setting_connection_remove_permission_by_value(
1342 self.to_glib_none().0,
1343 ptype.to_glib_none().0,
1344 pitem.to_glib_none().0,
1345 detail.to_glib_none().0,
1346 ))
1347 }
1348 }
1349
1350 /// Removes the secondary connection UUID at index @idx.
1351 /// ## `idx`
1352 /// index number of the secondary connection UUID
1353 #[doc(alias = "nm_setting_connection_remove_secondary")]
1354 pub fn remove_secondary(&self, idx: u32) {
1355 unsafe {
1356 ffi::nm_setting_connection_remove_secondary(self.to_glib_none().0, idx);
1357 }
1358 }
1359
1360 /// Removes the secondary connection UUID @sec_uuid.
1361 /// ## `sec_uuid`
1362 /// the secondary connection UUID to remove
1363 ///
1364 /// # Returns
1365 ///
1366 /// [`true`] if the secondary connection UUID was found and removed; [`false`] if it was not.
1367 #[doc(alias = "nm_setting_connection_remove_secondary_by_value")]
1368 pub fn remove_secondary_by_value(&self, sec_uuid: &str) -> bool {
1369 unsafe {
1370 from_glib(ffi::nm_setting_connection_remove_secondary_by_value(
1371 self.to_glib_none().0,
1372 sec_uuid.to_glib_none().0,
1373 ))
1374 }
1375 }
1376
1377 /// The number of retries for the authentication. Zero means to try indefinitely; -1 means
1378 /// to use a global default. If the global default is not set, the authentication
1379 /// retries for 3 times before failing the connection.
1380 ///
1381 /// Currently, this only applies to 802-1x authentication.
1382 #[cfg(feature = "v1_10")]
1383 #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
1384 #[doc(alias = "auth-retries")]
1385 pub fn set_auth_retries(&self, auth_retries: i32) {
1386 ObjectExt::set_property(self, "auth-retries", auth_retries)
1387 }
1388
1389 /// Whether or not the connection should be automatically connected by
1390 /// NetworkManager when the resources for the connection are available.
1391 /// [`true`] to automatically activate the connection, [`false`] to require manual
1392 /// intervention to activate the connection.
1393 ///
1394 /// Autoconnect happens when the circumstances are suitable. That means for
1395 /// example that the device is currently managed and not active. Autoconnect
1396 /// thus never replaces or competes with an already active profile.
1397 ///
1398 /// Note that autoconnect is not implemented for VPN profiles. See
1399 /// #NMSettingConnection:secondaries as an alternative to automatically
1400 /// connect VPN profiles.
1401 ///
1402 /// If multiple profiles are ready to autoconnect on the same device,
1403 /// the one with the better "connection.autoconnect-priority" is chosen. If
1404 /// the priorities are equal, then the most recently connected profile is activated.
1405 /// If the profiles were not connected earlier or their
1406 /// "connection.timestamp" is identical, the choice is undefined.
1407 ///
1408 /// Depending on "connection.multi-connect", a profile can (auto)connect only
1409 /// once at a time or multiple times.
1410 pub fn set_autoconnect(&self, autoconnect: bool) {
1411 ObjectExt::set_property(self, "autoconnect", autoconnect)
1412 }
1413
1414 /// Whether or not ports of this connection should be automatically brought up
1415 /// when NetworkManager activates this connection. This only has a real effect
1416 /// for controller connections. The properties #NMSettingConnection:autoconnect,
1417 /// #NMSettingConnection:autoconnect-priority and #NMSettingConnection:autoconnect-retries
1418 /// are unrelated to this setting.
1419 /// The permitted values are: 0: leave port connections untouched,
1420 /// 1: activate all the port connections with this connection, -1: default.
1421 /// If -1 (default) is set, global connection.autoconnect-ports is read to
1422 /// determine the real value. If it is default as well, this fallbacks to 0.
1423 #[cfg(feature = "v1_46")]
1424 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
1425 #[doc(alias = "autoconnect-ports")]
1426 pub fn set_autoconnect_ports(&self, autoconnect_ports: i32) {
1427 ObjectExt::set_property(self, "autoconnect-ports", autoconnect_ports)
1428 }
1429
1430 /// The autoconnect priority in range -999 to 999. If the connection is set
1431 /// to autoconnect, connections with higher priority will be preferred.
1432 /// The higher number means higher priority. Defaults to 0.
1433 /// Note that this property only matters if there are more than one candidate
1434 /// profile to select for autoconnect. In case of equal priority, the profile
1435 /// used most recently is chosen.
1436 #[doc(alias = "autoconnect-priority")]
1437 pub fn set_autoconnect_priority(&self, autoconnect_priority: i32) {
1438 ObjectExt::set_property(self, "autoconnect-priority", autoconnect_priority)
1439 }
1440
1441 #[cfg(not(feature = "v1_6"))]
1442 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_6"))))]
1443 #[doc(alias = "autoconnect-retries")]
1444 pub fn autoconnect_retries(&self) -> i32 {
1445 ObjectExt::property(self, "autoconnect-retries")
1446 }
1447
1448 /// The number of times a connection should be tried when autoactivating before
1449 /// giving up. Zero means forever, -1 means the global default (4 times if not
1450 /// overridden). Setting this to 1 means to try activation only once before
1451 /// blocking autoconnect. Note that after a timeout, NetworkManager will try
1452 /// to autoconnect again.
1453 #[doc(alias = "autoconnect-retries")]
1454 pub fn set_autoconnect_retries(&self, autoconnect_retries: i32) {
1455 ObjectExt::set_property(self, "autoconnect-retries", autoconnect_retries)
1456 }
1457
1458 /// Whether or not ports of this connection should be automatically brought up
1459 /// when NetworkManager activates this connection. This only has a real effect
1460 /// for controller connections. The properties #NMSettingConnection:autoconnect,
1461 /// #NMSettingConnection:autoconnect-priority and #NMSettingConnection:autoconnect-retries
1462 /// are unrelated to this setting.
1463 /// The permitted values are: 0: leave port connections untouched,
1464 /// 1: activate all the port connections with this connection, -1: default.
1465 /// If -1 (default) is set, global connection.autoconnect-slaves is read to
1466 /// determine the real value. If it is default as well, this fallbacks to 0.
1467 ///
1468 /// Deprecated 1.46. Use #NMSettingConnection:autoconnect-ports instead, this is just an alias.
1469 #[cfg(feature = "v1_2")]
1470 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1471 #[doc(alias = "autoconnect-slaves")]
1472 pub fn set_autoconnect_slaves(&self, autoconnect_slaves: SettingConnectionAutoconnectSlaves) {
1473 ObjectExt::set_property(self, "autoconnect-slaves", autoconnect_slaves)
1474 }
1475
1476 #[cfg(not(feature = "v1_46"))]
1477 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_46"))))]
1478 pub fn controller(&self) -> Option<glib::GString> {
1479 ObjectExt::property(self, "controller")
1480 }
1481
1482 /// Interface name of the controller device or UUID of the controller connection.
1483 pub fn set_controller(&self, controller: Option<&str>) {
1484 ObjectExt::set_property(self, "controller", controller)
1485 }
1486
1487 /// Whether DNSOverTls (dns-over-tls) is enabled for the connection.
1488 /// DNSOverTls is a technology which uses TLS to encrypt dns traffic.
1489 ///
1490 /// The permitted values are: "yes" (2) use DNSOverTls and disabled fallback,
1491 /// "opportunistic" (1) use DNSOverTls but allow fallback to unencrypted resolution,
1492 /// "no" (0) don't ever use DNSOverTls.
1493 /// If unspecified "default" depends on the plugin used. Systemd-resolved
1494 /// uses global setting.
1495 ///
1496 /// This feature requires a plugin which supports DNSOverTls. Otherwise, the
1497 /// setting has no effect. One such plugin is dns-systemd-resolved.
1498 #[cfg(feature = "v1_34")]
1499 #[cfg_attr(docsrs, doc(cfg(feature = "v1_34")))]
1500 #[doc(alias = "dns-over-tls")]
1501 pub fn set_dns_over_tls(&self, dns_over_tls: i32) {
1502 ObjectExt::set_property(self, "dns-over-tls", dns_over_tls)
1503 }
1504
1505 /// Whether the connection will be brought down before the system is powered
1506 /// off. The default value is [`SettingConnectionDownOnPoweroff::Default`][crate::SettingConnectionDownOnPoweroff::Default]. When
1507 /// the default value is specified, then the global value from
1508 /// NetworkManager configuration is looked up, if not set, it is considered
1509 /// as [`SettingConnectionDownOnPoweroff::No`][crate::SettingConnectionDownOnPoweroff::No].
1510 #[cfg(feature = "v1_48")]
1511 #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
1512 #[doc(alias = "down-on-poweroff")]
1513 pub fn set_down_on_poweroff(&self, down_on_poweroff: i32) {
1514 ObjectExt::set_property(self, "down-on-poweroff", down_on_poweroff)
1515 }
1516
1517 /// If greater than zero, delay success of IP addressing until either the
1518 /// timeout is reached, or an IP gateway replies to a ping.
1519 #[doc(alias = "gateway-ping-timeout")]
1520 pub fn set_gateway_ping_timeout(&self, gateway_ping_timeout: u32) {
1521 ObjectExt::set_property(self, "gateway-ping-timeout", gateway_ping_timeout)
1522 }
1523
1524 /// A human readable unique identifier for the connection, like "Work Wi-Fi"
1525 /// or "T-Mobile 3G".
1526 pub fn set_id(&self, id: Option<&str>) {
1527 ObjectExt::set_property(self, "id", id)
1528 }
1529
1530 /// The name of the network interface this connection is bound to. If not
1531 /// set, then the connection can be attached to any interface of the
1532 /// appropriate type (subject to restrictions imposed by other settings).
1533 ///
1534 /// For software devices this specifies the name of the created device.
1535 ///
1536 /// For connection types where interface names cannot easily be made
1537 /// persistent (e.g. mobile broadband or USB Ethernet), this property should
1538 /// not be used. Setting this property restricts the interfaces a connection
1539 /// can be used with, and if interface names change or are reordered the
1540 /// connection may be applied to the wrong interface.
1541 #[doc(alias = "interface-name")]
1542 pub fn set_interface_name(&self, interface_name: Option<&str>) {
1543 ObjectExt::set_property(self, "interface-name", interface_name)
1544 }
1545
1546 /// The property specifies a list of target IP addresses for pinging.
1547 /// When multiple targets are set, NetworkManager will start multiple ping processes
1548 /// in parallel. This property can only be set if connection.ip-ping-timeout is
1549 /// set. The ip-ping-timeout is used to delay the success of IP addressing until
1550 /// either the specified timeout (in seconds) is reached, or an target IP address replies
1551 /// to a ping. Configuring #NMSettingConnection:ip-ping-addresses may delay reaching the
1552 /// systemd's network-online.target due to waiting for the ping operations to complete or timeout.
1553 #[cfg(feature = "v1_52")]
1554 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1555 #[doc(alias = "ip-ping-addresses")]
1556 pub fn ip_ping_addresses(&self) -> Vec<glib::GString> {
1557 ObjectExt::property(self, "ip-ping-addresses")
1558 }
1559
1560 /// The property specifies a list of target IP addresses for pinging.
1561 /// When multiple targets are set, NetworkManager will start multiple ping processes
1562 /// in parallel. This property can only be set if connection.ip-ping-timeout is
1563 /// set. The ip-ping-timeout is used to delay the success of IP addressing until
1564 /// either the specified timeout (in seconds) is reached, or an target IP address replies
1565 /// to a ping. Configuring #NMSettingConnection:ip-ping-addresses may delay reaching the
1566 /// systemd's network-online.target due to waiting for the ping operations to complete or timeout.
1567 #[cfg(feature = "v1_52")]
1568 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1569 #[doc(alias = "ip-ping-addresses")]
1570 pub fn set_ip_ping_addresses(&self, ip_ping_addresses: &[&str]) {
1571 ObjectExt::set_property(self, "ip-ping-addresses", ip_ping_addresses)
1572 }
1573
1574 /// The property determines whether it is sufficient for any ping check
1575 /// to succeed among #NMSettingConnection:ip-ping-addresses, or if all
1576 /// ping checks must succeed for #NMSettingConnection:ip-ping-addresses.
1577 #[cfg(feature = "v1_52")]
1578 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1579 #[doc(alias = "ip-ping-addresses-require-all")]
1580 pub fn set_ip_ping_addresses_require_all(&self, ip_ping_addresses_require_all: i32) {
1581 ObjectExt::set_property(
1582 self,
1583 "ip-ping-addresses-require-all",
1584 ip_ping_addresses_require_all,
1585 )
1586 }
1587
1588 /// If greater than zero, delay success of IP addressing until either the specified
1589 /// timeout (in seconds) is reached, or a target IP address replies to a ping. The
1590 /// property specifies the timeout for the #NMSettingConnection:ip-ping-addresses.
1591 /// This property is incompatible with #NMSettingConnection:gateway-ping-timeout,
1592 /// you cannot set these two properties at the same time.
1593 #[cfg(feature = "v1_52")]
1594 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
1595 #[doc(alias = "ip-ping-timeout")]
1596 pub fn set_ip_ping_timeout(&self, ip_ping_timeout: u32) {
1597 ObjectExt::set_property(self, "ip-ping-timeout", ip_ping_timeout)
1598 }
1599
1600 /// Whether LLDP is enabled for the connection.
1601 #[cfg(feature = "v1_2")]
1602 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1603 pub fn set_lldp(&self, lldp: i32) {
1604 ObjectExt::set_property(self, "lldp", lldp)
1605 }
1606
1607 /// Whether Link-Local Multicast Name Resolution (LLMNR) is enabled
1608 /// for the connection. LLMNR is a protocol based on the Domain Name
1609 /// System (DNS) packet format that allows both IPv4 and IPv6 hosts
1610 /// to perform name resolution for hosts on the same local link.
1611 ///
1612 /// The permitted values are: "yes" (2) register hostname and resolving
1613 /// for the connection, "no" (0) disable LLMNR for the interface, "resolve"
1614 /// (1) do not register hostname but allow resolving of LLMNR host names
1615 /// If unspecified, "default" ultimately depends on the DNS plugin (which
1616 /// for systemd-resolved currently means "yes").
1617 ///
1618 /// This feature requires a plugin which supports LLMNR. Otherwise, the
1619 /// setting has no effect. One such plugin is dns-systemd-resolved.
1620 #[cfg(feature = "v1_14")]
1621 #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
1622 pub fn set_llmnr(&self, llmnr: i32) {
1623 ObjectExt::set_property(self, "llmnr", llmnr)
1624 }
1625
1626 /// Interface name of the controller device or UUID of the controller connection.
1627 ///
1628 /// Deprecated 1.46. Use #NMSettingConnection:controller instead, this is just an alias.
1629 pub fn set_master(&self, master: Option<&str>) {
1630 ObjectExt::set_property(self, "master", master)
1631 }
1632
1633 /// Whether mDNS is enabled for the connection.
1634 ///
1635 /// The permitted values are: "yes" (2) register hostname and resolving
1636 /// for the connection, "no" (0) disable mDNS for the interface, "resolve"
1637 /// (1) do not register hostname but allow resolving of mDNS host names
1638 /// and "default" (-1) to allow lookup of a global default in NetworkManager.conf.
1639 /// If unspecified, "default" ultimately depends on the DNS plugin.
1640 ///
1641 /// This feature requires a plugin which supports mDNS. Otherwise, the
1642 /// setting has no effect. Currently the only supported DNS plugin is
1643 /// systemd-resolved. For systemd-resolved, the default is configurable via
1644 /// MulticastDNS= setting in resolved.conf.
1645 #[cfg(feature = "v1_12")]
1646 #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1647 pub fn set_mdns(&self, mdns: i32) {
1648 ObjectExt::set_property(self, "mdns", mdns)
1649 }
1650
1651 /// Whether the connection is metered.
1652 ///
1653 /// When updating this property on a currently activated connection,
1654 /// the change takes effect immediately.
1655 #[cfg(feature = "v1_2")]
1656 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1657 pub fn set_metered(&self, metered: Metered) {
1658 ObjectExt::set_property(self, "metered", metered)
1659 }
1660
1661 #[cfg(not(feature = "v1_42"))]
1662 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_42"))))]
1663 #[doc(alias = "mptcp-flags")]
1664 pub fn mptcp_flags(&self) -> u32 {
1665 ObjectExt::property(self, "mptcp-flags")
1666 }
1667
1668 /// Whether to configure MPTCP endpoints and the address flags.
1669 /// If MPTCP is enabled in NetworkManager, it will configure the
1670 /// addresses of the interface as MPTCP endpoints. Note that
1671 /// IPv4 loopback addresses (127.0.0.0/8), IPv4 link local
1672 /// addresses (169.254.0.0/16), the IPv6 loopback address (::1),
1673 /// IPv6 link local addresses (fe80::/10), IPv6 unique
1674 /// local addresses (ULA, fc00::/7) and IPv6 privacy extension addresses
1675 /// (rfc3041, ipv6.ip6-privacy) will be excluded from being
1676 /// configured as endpoints.
1677 ///
1678 /// If "disabled" (0x1), MPTCP handling for the interface is disabled and
1679 /// no endpoints are registered.
1680 ///
1681 /// The "enabled" (0x2) flag means that MPTCP handling is enabled.
1682 /// This flag can also be implied from the presence of other flags.
1683 ///
1684 /// Even when enabled, MPTCP handling will by default still be disabled
1685 /// unless "/proc/sys/net/mptcp/enabled" sysctl is on. NetworkManager
1686 /// does not change the sysctl and this is up to the administrator
1687 /// or distribution. To configure endpoints even if the sysctl is
1688 /// disabled, "also-without-sysctl" (0x4) flag can be used. In that case,
1689 /// NetworkManager doesn't look at the sysctl and configures endpoints
1690 /// regardless.
1691 ///
1692 /// Even when enabled, NetworkManager will only configure MPTCP endpoints
1693 /// for a certain address family, if there is a unicast default route (0.0.0.0/0
1694 /// or ::/0) in the main routing table. The flag "also-without-default-route"
1695 /// (0x8) can override that.
1696 ///
1697 /// When MPTCP handling is enabled then endpoints are configured with
1698 /// the specified address flags "signal" (0x10), "subflow" (0x20), "backup" (0x40),
1699 /// "fullmesh" (0x80). See ip-mptcp(8) manual for additional information about the flags.
1700 ///
1701 /// If the flags are zero (0x0), the global connection default from NetworkManager.conf is
1702 /// honored. If still unspecified, the fallback is "enabled,subflow".
1703 /// Note that this means that MPTCP is by default done depending on the
1704 /// "/proc/sys/net/mptcp/enabled" sysctl.
1705 ///
1706 /// NetworkManager does not change the MPTCP limits nor enable MPTCP via
1707 /// "/proc/sys/net/mptcp/enabled". That is a host configuration which the
1708 /// admin can change via sysctl and ip-mptcp.
1709 ///
1710 /// Strict reverse path filtering (rp_filter) breaks many MPTCP use cases, so when
1711 /// MPTCP handling for IPv4 addresses on the interface is enabled, NetworkManager would
1712 /// loosen the strict reverse path filtering (1) to the loose setting (2).
1713 #[cfg(feature = "v1_40")]
1714 #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
1715 #[doc(alias = "mptcp-flags")]
1716 pub fn set_mptcp_flags(&self, mptcp_flags: u32) {
1717 ObjectExt::set_property(self, "mptcp-flags", mptcp_flags)
1718 }
1719
1720 /// If configured, set to a Manufacturer Usage Description (MUD) URL that points
1721 /// to manufacturer-recommended network policies for IoT devices. It is transmitted
1722 /// as a DHCPv4 or DHCPv6 option. The value must be a valid URL starting with "https://".
1723 ///
1724 /// The special value "none" is allowed to indicate that no MUD URL is used.
1725 ///
1726 /// If the per-profile value is unspecified (the default), a global connection default gets
1727 /// consulted. If still unspecified, the ultimate default is "none".
1728 #[cfg(feature = "v1_26")]
1729 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
1730 #[doc(alias = "mud-url")]
1731 pub fn set_mud_url(&self, mud_url: Option<&str>) {
1732 ObjectExt::set_property(self, "mud-url", mud_url)
1733 }
1734
1735 /// Specifies whether the profile can be active multiple times at a particular
1736 /// moment. The value is of type #NMConnectionMultiConnect.
1737 #[cfg(feature = "v1_14")]
1738 #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
1739 #[doc(alias = "multi-connect")]
1740 pub fn set_multi_connect(&self, multi_connect: i32) {
1741 ObjectExt::set_property(self, "multi-connect", multi_connect)
1742 }
1743
1744 /// An array of strings defining what access a given user has to this
1745 /// connection. If this is [`None`] or empty, all users are allowed to access
1746 /// this connection; otherwise users are allowed if and only if they are in
1747 /// this list. When this is not empty, the connection can be active only when
1748 /// one of the specified users is logged into an active session. Each entry
1749 /// is of the form "[type]:[id]:[reserved]"; for example, "user:dcbw:blah".
1750 ///
1751 /// At this time only the "user" [type] is allowed. Any other values are
1752 /// ignored and reserved for future use. [id] is the username that this
1753 /// permission refers to, which may not contain the ":" character. Any
1754 /// [reserved] information present must be ignored and is reserved for future
1755 /// use. All of [type], [id], and [reserved] must be valid UTF-8.
1756 pub fn permissions(&self) -> Vec<glib::GString> {
1757 ObjectExt::property(self, "permissions")
1758 }
1759
1760 /// An array of strings defining what access a given user has to this
1761 /// connection. If this is [`None`] or empty, all users are allowed to access
1762 /// this connection; otherwise users are allowed if and only if they are in
1763 /// this list. When this is not empty, the connection can be active only when
1764 /// one of the specified users is logged into an active session. Each entry
1765 /// is of the form "[type]:[id]:[reserved]"; for example, "user:dcbw:blah".
1766 ///
1767 /// At this time only the "user" [type] is allowed. Any other values are
1768 /// ignored and reserved for future use. [id] is the username that this
1769 /// permission refers to, which may not contain the ":" character. Any
1770 /// [reserved] information present must be ignored and is reserved for future
1771 /// use. All of [type], [id], and [reserved] must be valid UTF-8.
1772 pub fn set_permissions(&self, permissions: &[&str]) {
1773 ObjectExt::set_property(self, "permissions", permissions)
1774 }
1775
1776 /// Setting name of the device type of this port's controller connection (eg,
1777 /// [`SETTING_BOND_SETTING_NAME`][crate::SETTING_BOND_SETTING_NAME]), or [`None`] if this connection is not a
1778 /// port.
1779 #[cfg(feature = "v1_46")]
1780 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
1781 #[doc(alias = "port-type")]
1782 pub fn set_port_type(&self, port_type: Option<&str>) {
1783 ObjectExt::set_property(self, "port-type", port_type)
1784 }
1785
1786 /// This property is deprecated and has no meaning.
1787 ///
1788 /// # Deprecated since 1.44
1789 ///
1790 /// This property is deprecated and has no meaning.
1791 #[cfg_attr(feature = "v1_44", deprecated = "Since 1.44")]
1792 #[doc(alias = "read-only")]
1793 pub fn set_read_only(&self, read_only: bool) {
1794 ObjectExt::set_property(self, "read-only", read_only)
1795 }
1796
1797 /// List of connection UUIDs that should be activated when the base
1798 /// connection itself is activated. Currently, only VPN connections are
1799 /// supported.
1800 pub fn secondaries(&self) -> Vec<glib::GString> {
1801 ObjectExt::property(self, "secondaries")
1802 }
1803
1804 /// List of connection UUIDs that should be activated when the base
1805 /// connection itself is activated. Currently, only VPN connections are
1806 /// supported.
1807 pub fn set_secondaries(&self, secondaries: &[&str]) {
1808 ObjectExt::set_property(self, "secondaries", secondaries)
1809 }
1810
1811 /// Setting name of the device type of this port's controller connection (eg,
1812 /// [`SETTING_BOND_SETTING_NAME`][crate::SETTING_BOND_SETTING_NAME]), or [`None`] if this connection is not a
1813 /// port.
1814 ///
1815 /// Deprecated 1.46. Use #NMSettingConnection:port-type instead, this is just an alias.
1816 #[doc(alias = "slave-type")]
1817 pub fn set_slave_type(&self, slave_type: Option<&str>) {
1818 ObjectExt::set_property(self, "slave-type", slave_type)
1819 }
1820
1821 /// This represents the identity of the connection used for various purposes.
1822 /// It allows configuring multiple profiles to share the identity. Also,
1823 /// the stable-id can contain placeholders that are substituted dynamically and
1824 /// deterministically depending on the context.
1825 ///
1826 /// The stable-id is used for generating IPv6 stable private addresses with
1827 /// ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated
1828 /// cloned MAC address for ethernet.cloned-mac-address=stable and
1829 /// wifi.cloned-mac-address=stable. It is also used to derive the DHCP
1830 /// client identifier with ipv4.dhcp-client-id=stable, the DHCPv6 DUID with
1831 /// ipv6.dhcp-duid=stable-[llt,ll,uuid] and the DHCP IAID with
1832 /// ipv4.iaid=stable and ipv6.iaid=stable.
1833 ///
1834 /// Note that depending on the context where it is used, other parameters are
1835 /// also seeded into the generation algorithm. For example, a per-host key
1836 /// is commonly also included, so that different systems end up generating
1837 /// different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device's
1838 /// name is included, so that different interfaces yield different addresses.
1839 /// The per-host key is the identity of your machine and stored in /var/lib/NetworkManager/secret_key.
1840 /// See NetworkManager(8) manual about the secret-key and the host identity.
1841 ///
1842 /// The '$' character is treated special to perform dynamic substitutions at
1843 /// activation time. Currently, supported are "${CONNECTION}", "${DEVICE}",
1844 /// "${MAC}", "${NETWORK_SSID}", "${BOOT}", "${RANDOM}". These effectively
1845 /// create unique IDs per-connection, per-device, per-SSID, per-boot, or
1846 /// every time. The "${CONNECTION}" uses the profile's connection.uuid, the
1847 /// "${DEVICE}" uses the interface name of the device and "${MAC}" the
1848 /// permanent MAC address of the device. "${NETWORK_SSID}" uses the SSID for
1849 /// Wi-Fi networks and falls back to "${CONNECTION}" on other networks. Any
1850 /// unrecognized patterns following '$' are treated verbatim, however are
1851 /// reserved for future use. You are thus advised to avoid '$' or escape it
1852 /// as "$$". For example, set it to "${CONNECTION}-${BOOT}-${DEVICE}" to
1853 /// create a unique id for this connection that changes with every reboot
1854 /// and differs depending on the interface where the profile activates.
1855 ///
1856 /// If the value is unset, a global connection default is consulted. If the
1857 /// value is still unset, the default is "default${CONNECTION}" go generate
1858 /// an ID unique per connection profile.
1859 #[cfg(feature = "v1_4")]
1860 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
1861 #[doc(alias = "stable-id")]
1862 pub fn set_stable_id(&self, stable_id: Option<&str>) {
1863 ObjectExt::set_property(self, "stable-id", stable_id)
1864 }
1865
1866 /// The time, in seconds since the Unix Epoch, that the connection was last
1867 /// _successfully_ fully activated.
1868 ///
1869 /// NetworkManager updates the connection timestamp periodically when the
1870 /// connection is active to ensure that an active connection has the latest
1871 /// timestamp. The property is only meant for reading (changes to this
1872 /// property will not be preserved).
1873 pub fn set_timestamp(&self, timestamp: u64) {
1874 ObjectExt::set_property(self, "timestamp", timestamp)
1875 }
1876
1877 /// Base type of the connection. For hardware-dependent connections, should
1878 /// contain the setting name of the hardware-type specific setting (ie,
1879 /// "802-3-ethernet" or "802-11-wireless" or "bluetooth", etc), and for
1880 /// non-hardware dependent connections like VPN or otherwise, should contain
1881 /// the setting name of that setting type (ie, "vpn" or "bridge", etc).
1882 #[doc(alias = "type")]
1883 pub fn type_(&self) -> Option<glib::GString> {
1884 ObjectExt::property(self, "type")
1885 }
1886
1887 /// Base type of the connection. For hardware-dependent connections, should
1888 /// contain the setting name of the hardware-type specific setting (ie,
1889 /// "802-3-ethernet" or "802-11-wireless" or "bluetooth", etc), and for
1890 /// non-hardware dependent connections like VPN or otherwise, should contain
1891 /// the setting name of that setting type (ie, "vpn" or "bridge", etc).
1892 #[doc(alias = "type")]
1893 pub fn set_type(&self, type_: Option<&str>) {
1894 ObjectExt::set_property(self, "type", type_)
1895 }
1896
1897 /// A universally unique identifier for the connection, for example generated
1898 /// with libuuid. It should be assigned when the connection is created, and
1899 /// never changed as long as the connection still applies to the same
1900 /// network. For example, it should not be changed when the
1901 /// #NMSettingConnection:id property or #NMSettingIP4Config changes, but
1902 /// might need to be re-created when the Wi-Fi SSID, mobile broadband network
1903 /// provider, or #NMSettingConnection:type property changes.
1904 ///
1905 /// The UUID must be in the format "2815492f-7e56-435e-b2e9-246bd7cdc664"
1906 /// (ie, contains only hexadecimal characters and "-"). A suitable UUID may
1907 /// be generated by nm_utils_uuid_generate() or
1908 /// nm_uuid_generate_from_string_str().
1909 pub fn set_uuid(&self, uuid: Option<&str>) {
1910 ObjectExt::set_property(self, "uuid", uuid)
1911 }
1912
1913 /// Time in milliseconds to wait for connection to be considered activated.
1914 /// The wait will start after the pre-up dispatcher event.
1915 ///
1916 /// The value 0 means no wait time. The default value is -1, which
1917 /// currently has the same meaning as no wait time.
1918 #[cfg(feature = "v1_40")]
1919 #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
1920 #[doc(alias = "wait-activation-delay")]
1921 pub fn set_wait_activation_delay(&self, wait_activation_delay: i32) {
1922 ObjectExt::set_property(self, "wait-activation-delay", wait_activation_delay)
1923 }
1924
1925 /// Timeout in milliseconds to wait for device at startup.
1926 /// During boot, devices may take a while to be detected by the driver.
1927 /// This property will cause to delay NetworkManager-wait-online.service
1928 /// and nm-online to give the device a chance to appear. This works by
1929 /// waiting for the given timeout until a compatible device for the
1930 /// profile is available and managed.
1931 ///
1932 /// The value 0 means no wait time. The default value is -1, which
1933 /// currently has the same meaning as no wait time.
1934 #[cfg(feature = "v1_20")]
1935 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
1936 #[doc(alias = "wait-device-timeout")]
1937 pub fn set_wait_device_timeout(&self, wait_device_timeout: i32) {
1938 ObjectExt::set_property(self, "wait-device-timeout", wait_device_timeout)
1939 }
1940
1941 /// The trust level of a the connection. Free form case-insensitive string
1942 /// (for example "Home", "Work", "Public"). [`None`] or unspecified zone means
1943 /// the connection will be placed in the default zone as defined by the
1944 /// firewall.
1945 ///
1946 /// When updating this property on a currently activated connection,
1947 /// the change takes effect immediately.
1948 pub fn set_zone(&self, zone: Option<&str>) {
1949 ObjectExt::set_property(self, "zone", zone)
1950 }
1951
1952 #[cfg(feature = "v1_10")]
1953 #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
1954 #[doc(alias = "auth-retries")]
1955 pub fn connect_auth_retries_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1956 unsafe extern "C" fn notify_auth_retries_trampoline<F: Fn(&SettingConnection) + 'static>(
1957 this: *mut ffi::NMSettingConnection,
1958 _param_spec: glib::ffi::gpointer,
1959 f: glib::ffi::gpointer,
1960 ) {
1961 let f: &F = &*(f as *const F);
1962 f(&from_glib_borrow(this))
1963 }
1964 unsafe {
1965 let f: Box_<F> = Box_::new(f);
1966 connect_raw(
1967 self.as_ptr() as *mut _,
1968 c"notify::auth-retries".as_ptr() as *const _,
1969 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1970 notify_auth_retries_trampoline::<F> as *const (),
1971 )),
1972 Box_::into_raw(f),
1973 )
1974 }
1975 }
1976
1977 #[doc(alias = "autoconnect")]
1978 pub fn connect_autoconnect_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1979 unsafe extern "C" fn notify_autoconnect_trampoline<F: Fn(&SettingConnection) + 'static>(
1980 this: *mut ffi::NMSettingConnection,
1981 _param_spec: glib::ffi::gpointer,
1982 f: glib::ffi::gpointer,
1983 ) {
1984 let f: &F = &*(f as *const F);
1985 f(&from_glib_borrow(this))
1986 }
1987 unsafe {
1988 let f: Box_<F> = Box_::new(f);
1989 connect_raw(
1990 self.as_ptr() as *mut _,
1991 c"notify::autoconnect".as_ptr() as *const _,
1992 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1993 notify_autoconnect_trampoline::<F> as *const (),
1994 )),
1995 Box_::into_raw(f),
1996 )
1997 }
1998 }
1999
2000 #[cfg(feature = "v1_46")]
2001 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
2002 #[doc(alias = "autoconnect-ports")]
2003 pub fn connect_autoconnect_ports_notify<F: Fn(&Self) + 'static>(
2004 &self,
2005 f: F,
2006 ) -> SignalHandlerId {
2007 unsafe extern "C" fn notify_autoconnect_ports_trampoline<
2008 F: Fn(&SettingConnection) + 'static,
2009 >(
2010 this: *mut ffi::NMSettingConnection,
2011 _param_spec: glib::ffi::gpointer,
2012 f: glib::ffi::gpointer,
2013 ) {
2014 let f: &F = &*(f as *const F);
2015 f(&from_glib_borrow(this))
2016 }
2017 unsafe {
2018 let f: Box_<F> = Box_::new(f);
2019 connect_raw(
2020 self.as_ptr() as *mut _,
2021 c"notify::autoconnect-ports".as_ptr() as *const _,
2022 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2023 notify_autoconnect_ports_trampoline::<F> as *const (),
2024 )),
2025 Box_::into_raw(f),
2026 )
2027 }
2028 }
2029
2030 #[doc(alias = "autoconnect-priority")]
2031 pub fn connect_autoconnect_priority_notify<F: Fn(&Self) + 'static>(
2032 &self,
2033 f: F,
2034 ) -> SignalHandlerId {
2035 unsafe extern "C" fn notify_autoconnect_priority_trampoline<
2036 F: Fn(&SettingConnection) + 'static,
2037 >(
2038 this: *mut ffi::NMSettingConnection,
2039 _param_spec: glib::ffi::gpointer,
2040 f: glib::ffi::gpointer,
2041 ) {
2042 let f: &F = &*(f as *const F);
2043 f(&from_glib_borrow(this))
2044 }
2045 unsafe {
2046 let f: Box_<F> = Box_::new(f);
2047 connect_raw(
2048 self.as_ptr() as *mut _,
2049 c"notify::autoconnect-priority".as_ptr() as *const _,
2050 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2051 notify_autoconnect_priority_trampoline::<F> as *const (),
2052 )),
2053 Box_::into_raw(f),
2054 )
2055 }
2056 }
2057
2058 #[doc(alias = "autoconnect-retries")]
2059 pub fn connect_autoconnect_retries_notify<F: Fn(&Self) + 'static>(
2060 &self,
2061 f: F,
2062 ) -> SignalHandlerId {
2063 unsafe extern "C" fn notify_autoconnect_retries_trampoline<
2064 F: Fn(&SettingConnection) + 'static,
2065 >(
2066 this: *mut ffi::NMSettingConnection,
2067 _param_spec: glib::ffi::gpointer,
2068 f: glib::ffi::gpointer,
2069 ) {
2070 let f: &F = &*(f as *const F);
2071 f(&from_glib_borrow(this))
2072 }
2073 unsafe {
2074 let f: Box_<F> = Box_::new(f);
2075 connect_raw(
2076 self.as_ptr() as *mut _,
2077 c"notify::autoconnect-retries".as_ptr() as *const _,
2078 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2079 notify_autoconnect_retries_trampoline::<F> as *const (),
2080 )),
2081 Box_::into_raw(f),
2082 )
2083 }
2084 }
2085
2086 #[cfg(feature = "v1_2")]
2087 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2088 #[doc(alias = "autoconnect-slaves")]
2089 pub fn connect_autoconnect_slaves_notify<F: Fn(&Self) + 'static>(
2090 &self,
2091 f: F,
2092 ) -> SignalHandlerId {
2093 unsafe extern "C" fn notify_autoconnect_slaves_trampoline<
2094 F: Fn(&SettingConnection) + 'static,
2095 >(
2096 this: *mut ffi::NMSettingConnection,
2097 _param_spec: glib::ffi::gpointer,
2098 f: glib::ffi::gpointer,
2099 ) {
2100 let f: &F = &*(f as *const F);
2101 f(&from_glib_borrow(this))
2102 }
2103 unsafe {
2104 let f: Box_<F> = Box_::new(f);
2105 connect_raw(
2106 self.as_ptr() as *mut _,
2107 c"notify::autoconnect-slaves".as_ptr() as *const _,
2108 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2109 notify_autoconnect_slaves_trampoline::<F> as *const (),
2110 )),
2111 Box_::into_raw(f),
2112 )
2113 }
2114 }
2115
2116 #[doc(alias = "controller")]
2117 pub fn connect_controller_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2118 unsafe extern "C" fn notify_controller_trampoline<F: Fn(&SettingConnection) + 'static>(
2119 this: *mut ffi::NMSettingConnection,
2120 _param_spec: glib::ffi::gpointer,
2121 f: glib::ffi::gpointer,
2122 ) {
2123 let f: &F = &*(f as *const F);
2124 f(&from_glib_borrow(this))
2125 }
2126 unsafe {
2127 let f: Box_<F> = Box_::new(f);
2128 connect_raw(
2129 self.as_ptr() as *mut _,
2130 c"notify::controller".as_ptr() as *const _,
2131 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2132 notify_controller_trampoline::<F> as *const (),
2133 )),
2134 Box_::into_raw(f),
2135 )
2136 }
2137 }
2138
2139 #[cfg(feature = "v1_34")]
2140 #[cfg_attr(docsrs, doc(cfg(feature = "v1_34")))]
2141 #[doc(alias = "dns-over-tls")]
2142 pub fn connect_dns_over_tls_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2143 unsafe extern "C" fn notify_dns_over_tls_trampoline<F: Fn(&SettingConnection) + 'static>(
2144 this: *mut ffi::NMSettingConnection,
2145 _param_spec: glib::ffi::gpointer,
2146 f: glib::ffi::gpointer,
2147 ) {
2148 let f: &F = &*(f as *const F);
2149 f(&from_glib_borrow(this))
2150 }
2151 unsafe {
2152 let f: Box_<F> = Box_::new(f);
2153 connect_raw(
2154 self.as_ptr() as *mut _,
2155 c"notify::dns-over-tls".as_ptr() as *const _,
2156 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2157 notify_dns_over_tls_trampoline::<F> as *const (),
2158 )),
2159 Box_::into_raw(f),
2160 )
2161 }
2162 }
2163
2164 #[cfg(feature = "v1_48")]
2165 #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
2166 #[doc(alias = "down-on-poweroff")]
2167 pub fn connect_down_on_poweroff_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2168 unsafe extern "C" fn notify_down_on_poweroff_trampoline<
2169 F: Fn(&SettingConnection) + 'static,
2170 >(
2171 this: *mut ffi::NMSettingConnection,
2172 _param_spec: glib::ffi::gpointer,
2173 f: glib::ffi::gpointer,
2174 ) {
2175 let f: &F = &*(f as *const F);
2176 f(&from_glib_borrow(this))
2177 }
2178 unsafe {
2179 let f: Box_<F> = Box_::new(f);
2180 connect_raw(
2181 self.as_ptr() as *mut _,
2182 c"notify::down-on-poweroff".as_ptr() as *const _,
2183 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2184 notify_down_on_poweroff_trampoline::<F> as *const (),
2185 )),
2186 Box_::into_raw(f),
2187 )
2188 }
2189 }
2190
2191 #[doc(alias = "gateway-ping-timeout")]
2192 pub fn connect_gateway_ping_timeout_notify<F: Fn(&Self) + 'static>(
2193 &self,
2194 f: F,
2195 ) -> SignalHandlerId {
2196 unsafe extern "C" fn notify_gateway_ping_timeout_trampoline<
2197 F: Fn(&SettingConnection) + 'static,
2198 >(
2199 this: *mut ffi::NMSettingConnection,
2200 _param_spec: glib::ffi::gpointer,
2201 f: glib::ffi::gpointer,
2202 ) {
2203 let f: &F = &*(f as *const F);
2204 f(&from_glib_borrow(this))
2205 }
2206 unsafe {
2207 let f: Box_<F> = Box_::new(f);
2208 connect_raw(
2209 self.as_ptr() as *mut _,
2210 c"notify::gateway-ping-timeout".as_ptr() as *const _,
2211 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2212 notify_gateway_ping_timeout_trampoline::<F> as *const (),
2213 )),
2214 Box_::into_raw(f),
2215 )
2216 }
2217 }
2218
2219 #[doc(alias = "id")]
2220 pub fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2221 unsafe extern "C" fn notify_id_trampoline<F: Fn(&SettingConnection) + 'static>(
2222 this: *mut ffi::NMSettingConnection,
2223 _param_spec: glib::ffi::gpointer,
2224 f: glib::ffi::gpointer,
2225 ) {
2226 let f: &F = &*(f as *const F);
2227 f(&from_glib_borrow(this))
2228 }
2229 unsafe {
2230 let f: Box_<F> = Box_::new(f);
2231 connect_raw(
2232 self.as_ptr() as *mut _,
2233 c"notify::id".as_ptr() as *const _,
2234 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2235 notify_id_trampoline::<F> as *const (),
2236 )),
2237 Box_::into_raw(f),
2238 )
2239 }
2240 }
2241
2242 #[doc(alias = "interface-name")]
2243 pub fn connect_interface_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2244 unsafe extern "C" fn notify_interface_name_trampoline<
2245 F: Fn(&SettingConnection) + 'static,
2246 >(
2247 this: *mut ffi::NMSettingConnection,
2248 _param_spec: glib::ffi::gpointer,
2249 f: glib::ffi::gpointer,
2250 ) {
2251 let f: &F = &*(f as *const F);
2252 f(&from_glib_borrow(this))
2253 }
2254 unsafe {
2255 let f: Box_<F> = Box_::new(f);
2256 connect_raw(
2257 self.as_ptr() as *mut _,
2258 c"notify::interface-name".as_ptr() as *const _,
2259 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2260 notify_interface_name_trampoline::<F> as *const (),
2261 )),
2262 Box_::into_raw(f),
2263 )
2264 }
2265 }
2266
2267 #[cfg(feature = "v1_52")]
2268 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2269 #[doc(alias = "ip-ping-addresses")]
2270 pub fn connect_ip_ping_addresses_notify<F: Fn(&Self) + 'static>(
2271 &self,
2272 f: F,
2273 ) -> SignalHandlerId {
2274 unsafe extern "C" fn notify_ip_ping_addresses_trampoline<
2275 F: Fn(&SettingConnection) + 'static,
2276 >(
2277 this: *mut ffi::NMSettingConnection,
2278 _param_spec: glib::ffi::gpointer,
2279 f: glib::ffi::gpointer,
2280 ) {
2281 let f: &F = &*(f as *const F);
2282 f(&from_glib_borrow(this))
2283 }
2284 unsafe {
2285 let f: Box_<F> = Box_::new(f);
2286 connect_raw(
2287 self.as_ptr() as *mut _,
2288 c"notify::ip-ping-addresses".as_ptr() as *const _,
2289 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2290 notify_ip_ping_addresses_trampoline::<F> as *const (),
2291 )),
2292 Box_::into_raw(f),
2293 )
2294 }
2295 }
2296
2297 #[cfg(feature = "v1_52")]
2298 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2299 #[doc(alias = "ip-ping-addresses-require-all")]
2300 pub fn connect_ip_ping_addresses_require_all_notify<F: Fn(&Self) + 'static>(
2301 &self,
2302 f: F,
2303 ) -> SignalHandlerId {
2304 unsafe extern "C" fn notify_ip_ping_addresses_require_all_trampoline<
2305 F: Fn(&SettingConnection) + 'static,
2306 >(
2307 this: *mut ffi::NMSettingConnection,
2308 _param_spec: glib::ffi::gpointer,
2309 f: glib::ffi::gpointer,
2310 ) {
2311 let f: &F = &*(f as *const F);
2312 f(&from_glib_borrow(this))
2313 }
2314 unsafe {
2315 let f: Box_<F> = Box_::new(f);
2316 connect_raw(
2317 self.as_ptr() as *mut _,
2318 c"notify::ip-ping-addresses-require-all".as_ptr() as *const _,
2319 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2320 notify_ip_ping_addresses_require_all_trampoline::<F> as *const (),
2321 )),
2322 Box_::into_raw(f),
2323 )
2324 }
2325 }
2326
2327 #[cfg(feature = "v1_52")]
2328 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
2329 #[doc(alias = "ip-ping-timeout")]
2330 pub fn connect_ip_ping_timeout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2331 unsafe extern "C" fn notify_ip_ping_timeout_trampoline<
2332 F: Fn(&SettingConnection) + 'static,
2333 >(
2334 this: *mut ffi::NMSettingConnection,
2335 _param_spec: glib::ffi::gpointer,
2336 f: glib::ffi::gpointer,
2337 ) {
2338 let f: &F = &*(f as *const F);
2339 f(&from_glib_borrow(this))
2340 }
2341 unsafe {
2342 let f: Box_<F> = Box_::new(f);
2343 connect_raw(
2344 self.as_ptr() as *mut _,
2345 c"notify::ip-ping-timeout".as_ptr() as *const _,
2346 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2347 notify_ip_ping_timeout_trampoline::<F> as *const (),
2348 )),
2349 Box_::into_raw(f),
2350 )
2351 }
2352 }
2353
2354 #[cfg(feature = "v1_2")]
2355 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2356 #[doc(alias = "lldp")]
2357 pub fn connect_lldp_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2358 unsafe extern "C" fn notify_lldp_trampoline<F: Fn(&SettingConnection) + 'static>(
2359 this: *mut ffi::NMSettingConnection,
2360 _param_spec: glib::ffi::gpointer,
2361 f: glib::ffi::gpointer,
2362 ) {
2363 let f: &F = &*(f as *const F);
2364 f(&from_glib_borrow(this))
2365 }
2366 unsafe {
2367 let f: Box_<F> = Box_::new(f);
2368 connect_raw(
2369 self.as_ptr() as *mut _,
2370 c"notify::lldp".as_ptr() as *const _,
2371 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2372 notify_lldp_trampoline::<F> as *const (),
2373 )),
2374 Box_::into_raw(f),
2375 )
2376 }
2377 }
2378
2379 #[cfg(feature = "v1_14")]
2380 #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
2381 #[doc(alias = "llmnr")]
2382 pub fn connect_llmnr_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2383 unsafe extern "C" fn notify_llmnr_trampoline<F: Fn(&SettingConnection) + 'static>(
2384 this: *mut ffi::NMSettingConnection,
2385 _param_spec: glib::ffi::gpointer,
2386 f: glib::ffi::gpointer,
2387 ) {
2388 let f: &F = &*(f as *const F);
2389 f(&from_glib_borrow(this))
2390 }
2391 unsafe {
2392 let f: Box_<F> = Box_::new(f);
2393 connect_raw(
2394 self.as_ptr() as *mut _,
2395 c"notify::llmnr".as_ptr() as *const _,
2396 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2397 notify_llmnr_trampoline::<F> as *const (),
2398 )),
2399 Box_::into_raw(f),
2400 )
2401 }
2402 }
2403
2404 #[doc(alias = "master")]
2405 pub fn connect_master_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2406 unsafe extern "C" fn notify_master_trampoline<F: Fn(&SettingConnection) + 'static>(
2407 this: *mut ffi::NMSettingConnection,
2408 _param_spec: glib::ffi::gpointer,
2409 f: glib::ffi::gpointer,
2410 ) {
2411 let f: &F = &*(f as *const F);
2412 f(&from_glib_borrow(this))
2413 }
2414 unsafe {
2415 let f: Box_<F> = Box_::new(f);
2416 connect_raw(
2417 self.as_ptr() as *mut _,
2418 c"notify::master".as_ptr() as *const _,
2419 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2420 notify_master_trampoline::<F> as *const (),
2421 )),
2422 Box_::into_raw(f),
2423 )
2424 }
2425 }
2426
2427 #[cfg(feature = "v1_12")]
2428 #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
2429 #[doc(alias = "mdns")]
2430 pub fn connect_mdns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2431 unsafe extern "C" fn notify_mdns_trampoline<F: Fn(&SettingConnection) + 'static>(
2432 this: *mut ffi::NMSettingConnection,
2433 _param_spec: glib::ffi::gpointer,
2434 f: glib::ffi::gpointer,
2435 ) {
2436 let f: &F = &*(f as *const F);
2437 f(&from_glib_borrow(this))
2438 }
2439 unsafe {
2440 let f: Box_<F> = Box_::new(f);
2441 connect_raw(
2442 self.as_ptr() as *mut _,
2443 c"notify::mdns".as_ptr() as *const _,
2444 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2445 notify_mdns_trampoline::<F> as *const (),
2446 )),
2447 Box_::into_raw(f),
2448 )
2449 }
2450 }
2451
2452 #[cfg(feature = "v1_2")]
2453 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2454 #[doc(alias = "metered")]
2455 pub fn connect_metered_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2456 unsafe extern "C" fn notify_metered_trampoline<F: Fn(&SettingConnection) + 'static>(
2457 this: *mut ffi::NMSettingConnection,
2458 _param_spec: glib::ffi::gpointer,
2459 f: glib::ffi::gpointer,
2460 ) {
2461 let f: &F = &*(f as *const F);
2462 f(&from_glib_borrow(this))
2463 }
2464 unsafe {
2465 let f: Box_<F> = Box_::new(f);
2466 connect_raw(
2467 self.as_ptr() as *mut _,
2468 c"notify::metered".as_ptr() as *const _,
2469 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2470 notify_metered_trampoline::<F> as *const (),
2471 )),
2472 Box_::into_raw(f),
2473 )
2474 }
2475 }
2476
2477 #[cfg(feature = "v1_40")]
2478 #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
2479 #[doc(alias = "mptcp-flags")]
2480 pub fn connect_mptcp_flags_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2481 unsafe extern "C" fn notify_mptcp_flags_trampoline<F: Fn(&SettingConnection) + 'static>(
2482 this: *mut ffi::NMSettingConnection,
2483 _param_spec: glib::ffi::gpointer,
2484 f: glib::ffi::gpointer,
2485 ) {
2486 let f: &F = &*(f as *const F);
2487 f(&from_glib_borrow(this))
2488 }
2489 unsafe {
2490 let f: Box_<F> = Box_::new(f);
2491 connect_raw(
2492 self.as_ptr() as *mut _,
2493 c"notify::mptcp-flags".as_ptr() as *const _,
2494 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2495 notify_mptcp_flags_trampoline::<F> as *const (),
2496 )),
2497 Box_::into_raw(f),
2498 )
2499 }
2500 }
2501
2502 #[cfg(feature = "v1_26")]
2503 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
2504 #[doc(alias = "mud-url")]
2505 pub fn connect_mud_url_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2506 unsafe extern "C" fn notify_mud_url_trampoline<F: Fn(&SettingConnection) + 'static>(
2507 this: *mut ffi::NMSettingConnection,
2508 _param_spec: glib::ffi::gpointer,
2509 f: glib::ffi::gpointer,
2510 ) {
2511 let f: &F = &*(f as *const F);
2512 f(&from_glib_borrow(this))
2513 }
2514 unsafe {
2515 let f: Box_<F> = Box_::new(f);
2516 connect_raw(
2517 self.as_ptr() as *mut _,
2518 c"notify::mud-url".as_ptr() as *const _,
2519 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2520 notify_mud_url_trampoline::<F> as *const (),
2521 )),
2522 Box_::into_raw(f),
2523 )
2524 }
2525 }
2526
2527 #[cfg(feature = "v1_14")]
2528 #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
2529 #[doc(alias = "multi-connect")]
2530 pub fn connect_multi_connect_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2531 unsafe extern "C" fn notify_multi_connect_trampoline<
2532 F: Fn(&SettingConnection) + 'static,
2533 >(
2534 this: *mut ffi::NMSettingConnection,
2535 _param_spec: glib::ffi::gpointer,
2536 f: glib::ffi::gpointer,
2537 ) {
2538 let f: &F = &*(f as *const F);
2539 f(&from_glib_borrow(this))
2540 }
2541 unsafe {
2542 let f: Box_<F> = Box_::new(f);
2543 connect_raw(
2544 self.as_ptr() as *mut _,
2545 c"notify::multi-connect".as_ptr() as *const _,
2546 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2547 notify_multi_connect_trampoline::<F> as *const (),
2548 )),
2549 Box_::into_raw(f),
2550 )
2551 }
2552 }
2553
2554 #[doc(alias = "permissions")]
2555 pub fn connect_permissions_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2556 unsafe extern "C" fn notify_permissions_trampoline<F: Fn(&SettingConnection) + 'static>(
2557 this: *mut ffi::NMSettingConnection,
2558 _param_spec: glib::ffi::gpointer,
2559 f: glib::ffi::gpointer,
2560 ) {
2561 let f: &F = &*(f as *const F);
2562 f(&from_glib_borrow(this))
2563 }
2564 unsafe {
2565 let f: Box_<F> = Box_::new(f);
2566 connect_raw(
2567 self.as_ptr() as *mut _,
2568 c"notify::permissions".as_ptr() as *const _,
2569 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2570 notify_permissions_trampoline::<F> as *const (),
2571 )),
2572 Box_::into_raw(f),
2573 )
2574 }
2575 }
2576
2577 #[cfg(feature = "v1_46")]
2578 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
2579 #[doc(alias = "port-type")]
2580 pub fn connect_port_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2581 unsafe extern "C" fn notify_port_type_trampoline<F: Fn(&SettingConnection) + 'static>(
2582 this: *mut ffi::NMSettingConnection,
2583 _param_spec: glib::ffi::gpointer,
2584 f: glib::ffi::gpointer,
2585 ) {
2586 let f: &F = &*(f as *const F);
2587 f(&from_glib_borrow(this))
2588 }
2589 unsafe {
2590 let f: Box_<F> = Box_::new(f);
2591 connect_raw(
2592 self.as_ptr() as *mut _,
2593 c"notify::port-type".as_ptr() as *const _,
2594 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2595 notify_port_type_trampoline::<F> as *const (),
2596 )),
2597 Box_::into_raw(f),
2598 )
2599 }
2600 }
2601
2602 #[cfg_attr(feature = "v1_44", deprecated = "Since 1.44")]
2603 #[doc(alias = "read-only")]
2604 pub fn connect_read_only_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2605 unsafe extern "C" fn notify_read_only_trampoline<F: Fn(&SettingConnection) + 'static>(
2606 this: *mut ffi::NMSettingConnection,
2607 _param_spec: glib::ffi::gpointer,
2608 f: glib::ffi::gpointer,
2609 ) {
2610 let f: &F = &*(f as *const F);
2611 f(&from_glib_borrow(this))
2612 }
2613 unsafe {
2614 let f: Box_<F> = Box_::new(f);
2615 connect_raw(
2616 self.as_ptr() as *mut _,
2617 c"notify::read-only".as_ptr() as *const _,
2618 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2619 notify_read_only_trampoline::<F> as *const (),
2620 )),
2621 Box_::into_raw(f),
2622 )
2623 }
2624 }
2625
2626 #[doc(alias = "secondaries")]
2627 pub fn connect_secondaries_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2628 unsafe extern "C" fn notify_secondaries_trampoline<F: Fn(&SettingConnection) + 'static>(
2629 this: *mut ffi::NMSettingConnection,
2630 _param_spec: glib::ffi::gpointer,
2631 f: glib::ffi::gpointer,
2632 ) {
2633 let f: &F = &*(f as *const F);
2634 f(&from_glib_borrow(this))
2635 }
2636 unsafe {
2637 let f: Box_<F> = Box_::new(f);
2638 connect_raw(
2639 self.as_ptr() as *mut _,
2640 c"notify::secondaries".as_ptr() as *const _,
2641 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2642 notify_secondaries_trampoline::<F> as *const (),
2643 )),
2644 Box_::into_raw(f),
2645 )
2646 }
2647 }
2648
2649 #[doc(alias = "slave-type")]
2650 pub fn connect_slave_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2651 unsafe extern "C" fn notify_slave_type_trampoline<F: Fn(&SettingConnection) + 'static>(
2652 this: *mut ffi::NMSettingConnection,
2653 _param_spec: glib::ffi::gpointer,
2654 f: glib::ffi::gpointer,
2655 ) {
2656 let f: &F = &*(f as *const F);
2657 f(&from_glib_borrow(this))
2658 }
2659 unsafe {
2660 let f: Box_<F> = Box_::new(f);
2661 connect_raw(
2662 self.as_ptr() as *mut _,
2663 c"notify::slave-type".as_ptr() as *const _,
2664 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2665 notify_slave_type_trampoline::<F> as *const (),
2666 )),
2667 Box_::into_raw(f),
2668 )
2669 }
2670 }
2671
2672 #[cfg(feature = "v1_4")]
2673 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
2674 #[doc(alias = "stable-id")]
2675 pub fn connect_stable_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2676 unsafe extern "C" fn notify_stable_id_trampoline<F: Fn(&SettingConnection) + 'static>(
2677 this: *mut ffi::NMSettingConnection,
2678 _param_spec: glib::ffi::gpointer,
2679 f: glib::ffi::gpointer,
2680 ) {
2681 let f: &F = &*(f as *const F);
2682 f(&from_glib_borrow(this))
2683 }
2684 unsafe {
2685 let f: Box_<F> = Box_::new(f);
2686 connect_raw(
2687 self.as_ptr() as *mut _,
2688 c"notify::stable-id".as_ptr() as *const _,
2689 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2690 notify_stable_id_trampoline::<F> as *const (),
2691 )),
2692 Box_::into_raw(f),
2693 )
2694 }
2695 }
2696
2697 #[doc(alias = "timestamp")]
2698 pub fn connect_timestamp_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2699 unsafe extern "C" fn notify_timestamp_trampoline<F: Fn(&SettingConnection) + 'static>(
2700 this: *mut ffi::NMSettingConnection,
2701 _param_spec: glib::ffi::gpointer,
2702 f: glib::ffi::gpointer,
2703 ) {
2704 let f: &F = &*(f as *const F);
2705 f(&from_glib_borrow(this))
2706 }
2707 unsafe {
2708 let f: Box_<F> = Box_::new(f);
2709 connect_raw(
2710 self.as_ptr() as *mut _,
2711 c"notify::timestamp".as_ptr() as *const _,
2712 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2713 notify_timestamp_trampoline::<F> as *const (),
2714 )),
2715 Box_::into_raw(f),
2716 )
2717 }
2718 }
2719
2720 #[doc(alias = "type")]
2721 pub fn connect_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2722 unsafe extern "C" fn notify_type_trampoline<F: Fn(&SettingConnection) + 'static>(
2723 this: *mut ffi::NMSettingConnection,
2724 _param_spec: glib::ffi::gpointer,
2725 f: glib::ffi::gpointer,
2726 ) {
2727 let f: &F = &*(f as *const F);
2728 f(&from_glib_borrow(this))
2729 }
2730 unsafe {
2731 let f: Box_<F> = Box_::new(f);
2732 connect_raw(
2733 self.as_ptr() as *mut _,
2734 c"notify::type".as_ptr() as *const _,
2735 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2736 notify_type_trampoline::<F> as *const (),
2737 )),
2738 Box_::into_raw(f),
2739 )
2740 }
2741 }
2742
2743 #[doc(alias = "uuid")]
2744 pub fn connect_uuid_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2745 unsafe extern "C" fn notify_uuid_trampoline<F: Fn(&SettingConnection) + 'static>(
2746 this: *mut ffi::NMSettingConnection,
2747 _param_spec: glib::ffi::gpointer,
2748 f: glib::ffi::gpointer,
2749 ) {
2750 let f: &F = &*(f as *const F);
2751 f(&from_glib_borrow(this))
2752 }
2753 unsafe {
2754 let f: Box_<F> = Box_::new(f);
2755 connect_raw(
2756 self.as_ptr() as *mut _,
2757 c"notify::uuid".as_ptr() as *const _,
2758 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2759 notify_uuid_trampoline::<F> as *const (),
2760 )),
2761 Box_::into_raw(f),
2762 )
2763 }
2764 }
2765
2766 #[cfg(feature = "v1_40")]
2767 #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
2768 #[doc(alias = "wait-activation-delay")]
2769 pub fn connect_wait_activation_delay_notify<F: Fn(&Self) + 'static>(
2770 &self,
2771 f: F,
2772 ) -> SignalHandlerId {
2773 unsafe extern "C" fn notify_wait_activation_delay_trampoline<
2774 F: Fn(&SettingConnection) + 'static,
2775 >(
2776 this: *mut ffi::NMSettingConnection,
2777 _param_spec: glib::ffi::gpointer,
2778 f: glib::ffi::gpointer,
2779 ) {
2780 let f: &F = &*(f as *const F);
2781 f(&from_glib_borrow(this))
2782 }
2783 unsafe {
2784 let f: Box_<F> = Box_::new(f);
2785 connect_raw(
2786 self.as_ptr() as *mut _,
2787 c"notify::wait-activation-delay".as_ptr() as *const _,
2788 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2789 notify_wait_activation_delay_trampoline::<F> as *const (),
2790 )),
2791 Box_::into_raw(f),
2792 )
2793 }
2794 }
2795
2796 #[cfg(feature = "v1_20")]
2797 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
2798 #[doc(alias = "wait-device-timeout")]
2799 pub fn connect_wait_device_timeout_notify<F: Fn(&Self) + 'static>(
2800 &self,
2801 f: F,
2802 ) -> SignalHandlerId {
2803 unsafe extern "C" fn notify_wait_device_timeout_trampoline<
2804 F: Fn(&SettingConnection) + 'static,
2805 >(
2806 this: *mut ffi::NMSettingConnection,
2807 _param_spec: glib::ffi::gpointer,
2808 f: glib::ffi::gpointer,
2809 ) {
2810 let f: &F = &*(f as *const F);
2811 f(&from_glib_borrow(this))
2812 }
2813 unsafe {
2814 let f: Box_<F> = Box_::new(f);
2815 connect_raw(
2816 self.as_ptr() as *mut _,
2817 c"notify::wait-device-timeout".as_ptr() as *const _,
2818 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2819 notify_wait_device_timeout_trampoline::<F> as *const (),
2820 )),
2821 Box_::into_raw(f),
2822 )
2823 }
2824 }
2825
2826 #[doc(alias = "zone")]
2827 pub fn connect_zone_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2828 unsafe extern "C" fn notify_zone_trampoline<F: Fn(&SettingConnection) + 'static>(
2829 this: *mut ffi::NMSettingConnection,
2830 _param_spec: glib::ffi::gpointer,
2831 f: glib::ffi::gpointer,
2832 ) {
2833 let f: &F = &*(f as *const F);
2834 f(&from_glib_borrow(this))
2835 }
2836 unsafe {
2837 let f: Box_<F> = Box_::new(f);
2838 connect_raw(
2839 self.as_ptr() as *mut _,
2840 c"notify::zone".as_ptr() as *const _,
2841 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2842 notify_zone_trampoline::<F> as *const (),
2843 )),
2844 Box_::into_raw(f),
2845 )
2846 }
2847 }
2848}
2849
2850impl Default for SettingConnection {
2851 fn default() -> Self {
2852 Self::new()
2853 }
2854}
2855
2856// rustdoc-stripper-ignore-next
2857/// A [builder-pattern] type to construct [`SettingConnection`] objects.
2858///
2859/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
2860#[must_use = "The builder must be built to be used"]
2861pub struct SettingConnectionBuilder {
2862 builder: glib::object::ObjectBuilder<'static, SettingConnection>,
2863}
2864
2865impl SettingConnectionBuilder {
2866 fn new() -> Self {
2867 Self {
2868 builder: glib::object::Object::builder(),
2869 }
2870 }
2871
2872 /// The number of retries for the authentication. Zero means to try indefinitely; -1 means
2873 /// to use a global default. If the global default is not set, the authentication
2874 /// retries for 3 times before failing the connection.
2875 ///
2876 /// Currently, this only applies to 802-1x authentication.
2877 #[cfg(feature = "v1_10")]
2878 #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
2879 pub fn auth_retries(self, auth_retries: i32) -> Self {
2880 Self {
2881 builder: self.builder.property("auth-retries", auth_retries),
2882 }
2883 }
2884
2885 /// Whether or not the connection should be automatically connected by
2886 /// NetworkManager when the resources for the connection are available.
2887 /// [`true`] to automatically activate the connection, [`false`] to require manual
2888 /// intervention to activate the connection.
2889 ///
2890 /// Autoconnect happens when the circumstances are suitable. That means for
2891 /// example that the device is currently managed and not active. Autoconnect
2892 /// thus never replaces or competes with an already active profile.
2893 ///
2894 /// Note that autoconnect is not implemented for VPN profiles. See
2895 /// #NMSettingConnection:secondaries as an alternative to automatically
2896 /// connect VPN profiles.
2897 ///
2898 /// If multiple profiles are ready to autoconnect on the same device,
2899 /// the one with the better "connection.autoconnect-priority" is chosen. If
2900 /// the priorities are equal, then the most recently connected profile is activated.
2901 /// If the profiles were not connected earlier or their
2902 /// "connection.timestamp" is identical, the choice is undefined.
2903 ///
2904 /// Depending on "connection.multi-connect", a profile can (auto)connect only
2905 /// once at a time or multiple times.
2906 pub fn autoconnect(self, autoconnect: bool) -> Self {
2907 Self {
2908 builder: self.builder.property("autoconnect", autoconnect),
2909 }
2910 }
2911
2912 /// Whether or not ports of this connection should be automatically brought up
2913 /// when NetworkManager activates this connection. This only has a real effect
2914 /// for controller connections. The properties #NMSettingConnection:autoconnect,
2915 /// #NMSettingConnection:autoconnect-priority and #NMSettingConnection:autoconnect-retries
2916 /// are unrelated to this setting.
2917 /// The permitted values are: 0: leave port connections untouched,
2918 /// 1: activate all the port connections with this connection, -1: default.
2919 /// If -1 (default) is set, global connection.autoconnect-ports is read to
2920 /// determine the real value. If it is default as well, this fallbacks to 0.
2921 #[cfg(feature = "v1_46")]
2922 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
2923 pub fn autoconnect_ports(self, autoconnect_ports: i32) -> Self {
2924 Self {
2925 builder: self
2926 .builder
2927 .property("autoconnect-ports", autoconnect_ports),
2928 }
2929 }
2930
2931 /// The autoconnect priority in range -999 to 999. If the connection is set
2932 /// to autoconnect, connections with higher priority will be preferred.
2933 /// The higher number means higher priority. Defaults to 0.
2934 /// Note that this property only matters if there are more than one candidate
2935 /// profile to select for autoconnect. In case of equal priority, the profile
2936 /// used most recently is chosen.
2937 pub fn autoconnect_priority(self, autoconnect_priority: i32) -> Self {
2938 Self {
2939 builder: self
2940 .builder
2941 .property("autoconnect-priority", autoconnect_priority),
2942 }
2943 }
2944
2945 /// The number of times a connection should be tried when autoactivating before
2946 /// giving up. Zero means forever, -1 means the global default (4 times if not
2947 /// overridden). Setting this to 1 means to try activation only once before
2948 /// blocking autoconnect. Note that after a timeout, NetworkManager will try
2949 /// to autoconnect again.
2950 pub fn autoconnect_retries(self, autoconnect_retries: i32) -> Self {
2951 Self {
2952 builder: self
2953 .builder
2954 .property("autoconnect-retries", autoconnect_retries),
2955 }
2956 }
2957
2958 /// Whether or not ports of this connection should be automatically brought up
2959 /// when NetworkManager activates this connection. This only has a real effect
2960 /// for controller connections. The properties #NMSettingConnection:autoconnect,
2961 /// #NMSettingConnection:autoconnect-priority and #NMSettingConnection:autoconnect-retries
2962 /// are unrelated to this setting.
2963 /// The permitted values are: 0: leave port connections untouched,
2964 /// 1: activate all the port connections with this connection, -1: default.
2965 /// If -1 (default) is set, global connection.autoconnect-slaves is read to
2966 /// determine the real value. If it is default as well, this fallbacks to 0.
2967 ///
2968 /// Deprecated 1.46. Use #NMSettingConnection:autoconnect-ports instead, this is just an alias.
2969 #[cfg(feature = "v1_2")]
2970 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2971 pub fn autoconnect_slaves(
2972 self,
2973 autoconnect_slaves: SettingConnectionAutoconnectSlaves,
2974 ) -> Self {
2975 Self {
2976 builder: self
2977 .builder
2978 .property("autoconnect-slaves", autoconnect_slaves),
2979 }
2980 }
2981
2982 /// Interface name of the controller device or UUID of the controller connection.
2983 pub fn controller(self, controller: impl Into<glib::GString>) -> Self {
2984 Self {
2985 builder: self.builder.property("controller", controller.into()),
2986 }
2987 }
2988
2989 /// Whether DNSOverTls (dns-over-tls) is enabled for the connection.
2990 /// DNSOverTls is a technology which uses TLS to encrypt dns traffic.
2991 ///
2992 /// The permitted values are: "yes" (2) use DNSOverTls and disabled fallback,
2993 /// "opportunistic" (1) use DNSOverTls but allow fallback to unencrypted resolution,
2994 /// "no" (0) don't ever use DNSOverTls.
2995 /// If unspecified "default" depends on the plugin used. Systemd-resolved
2996 /// uses global setting.
2997 ///
2998 /// This feature requires a plugin which supports DNSOverTls. Otherwise, the
2999 /// setting has no effect. One such plugin is dns-systemd-resolved.
3000 #[cfg(feature = "v1_34")]
3001 #[cfg_attr(docsrs, doc(cfg(feature = "v1_34")))]
3002 pub fn dns_over_tls(self, dns_over_tls: i32) -> Self {
3003 Self {
3004 builder: self.builder.property("dns-over-tls", dns_over_tls),
3005 }
3006 }
3007
3008 /// Whether the connection will be brought down before the system is powered
3009 /// off. The default value is [`SettingConnectionDownOnPoweroff::Default`][crate::SettingConnectionDownOnPoweroff::Default]. When
3010 /// the default value is specified, then the global value from
3011 /// NetworkManager configuration is looked up, if not set, it is considered
3012 /// as [`SettingConnectionDownOnPoweroff::No`][crate::SettingConnectionDownOnPoweroff::No].
3013 #[cfg(feature = "v1_48")]
3014 #[cfg_attr(docsrs, doc(cfg(feature = "v1_48")))]
3015 pub fn down_on_poweroff(self, down_on_poweroff: i32) -> Self {
3016 Self {
3017 builder: self.builder.property("down-on-poweroff", down_on_poweroff),
3018 }
3019 }
3020
3021 /// If greater than zero, delay success of IP addressing until either the
3022 /// timeout is reached, or an IP gateway replies to a ping.
3023 pub fn gateway_ping_timeout(self, gateway_ping_timeout: u32) -> Self {
3024 Self {
3025 builder: self
3026 .builder
3027 .property("gateway-ping-timeout", gateway_ping_timeout),
3028 }
3029 }
3030
3031 /// A human readable unique identifier for the connection, like "Work Wi-Fi"
3032 /// or "T-Mobile 3G".
3033 pub fn id(self, id: impl Into<glib::GString>) -> Self {
3034 Self {
3035 builder: self.builder.property("id", id.into()),
3036 }
3037 }
3038
3039 /// The name of the network interface this connection is bound to. If not
3040 /// set, then the connection can be attached to any interface of the
3041 /// appropriate type (subject to restrictions imposed by other settings).
3042 ///
3043 /// For software devices this specifies the name of the created device.
3044 ///
3045 /// For connection types where interface names cannot easily be made
3046 /// persistent (e.g. mobile broadband or USB Ethernet), this property should
3047 /// not be used. Setting this property restricts the interfaces a connection
3048 /// can be used with, and if interface names change or are reordered the
3049 /// connection may be applied to the wrong interface.
3050 pub fn interface_name(self, interface_name: impl Into<glib::GString>) -> Self {
3051 Self {
3052 builder: self
3053 .builder
3054 .property("interface-name", interface_name.into()),
3055 }
3056 }
3057
3058 /// The property specifies a list of target IP addresses for pinging.
3059 /// When multiple targets are set, NetworkManager will start multiple ping processes
3060 /// in parallel. This property can only be set if connection.ip-ping-timeout is
3061 /// set. The ip-ping-timeout is used to delay the success of IP addressing until
3062 /// either the specified timeout (in seconds) is reached, or an target IP address replies
3063 /// to a ping. Configuring #NMSettingConnection:ip-ping-addresses may delay reaching the
3064 /// systemd's network-online.target due to waiting for the ping operations to complete or timeout.
3065 #[cfg(feature = "v1_52")]
3066 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
3067 pub fn ip_ping_addresses(self, ip_ping_addresses: impl Into<glib::StrV>) -> Self {
3068 Self {
3069 builder: self
3070 .builder
3071 .property("ip-ping-addresses", ip_ping_addresses.into()),
3072 }
3073 }
3074
3075 /// The property determines whether it is sufficient for any ping check
3076 /// to succeed among #NMSettingConnection:ip-ping-addresses, or if all
3077 /// ping checks must succeed for #NMSettingConnection:ip-ping-addresses.
3078 #[cfg(feature = "v1_52")]
3079 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
3080 pub fn ip_ping_addresses_require_all(self, ip_ping_addresses_require_all: i32) -> Self {
3081 Self {
3082 builder: self.builder.property(
3083 "ip-ping-addresses-require-all",
3084 ip_ping_addresses_require_all,
3085 ),
3086 }
3087 }
3088
3089 /// If greater than zero, delay success of IP addressing until either the specified
3090 /// timeout (in seconds) is reached, or a target IP address replies to a ping. The
3091 /// property specifies the timeout for the #NMSettingConnection:ip-ping-addresses.
3092 /// This property is incompatible with #NMSettingConnection:gateway-ping-timeout,
3093 /// you cannot set these two properties at the same time.
3094 #[cfg(feature = "v1_52")]
3095 #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
3096 pub fn ip_ping_timeout(self, ip_ping_timeout: u32) -> Self {
3097 Self {
3098 builder: self.builder.property("ip-ping-timeout", ip_ping_timeout),
3099 }
3100 }
3101
3102 /// Whether LLDP is enabled for the connection.
3103 #[cfg(feature = "v1_2")]
3104 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3105 pub fn lldp(self, lldp: i32) -> Self {
3106 Self {
3107 builder: self.builder.property("lldp", lldp),
3108 }
3109 }
3110
3111 /// Whether Link-Local Multicast Name Resolution (LLMNR) is enabled
3112 /// for the connection. LLMNR is a protocol based on the Domain Name
3113 /// System (DNS) packet format that allows both IPv4 and IPv6 hosts
3114 /// to perform name resolution for hosts on the same local link.
3115 ///
3116 /// The permitted values are: "yes" (2) register hostname and resolving
3117 /// for the connection, "no" (0) disable LLMNR for the interface, "resolve"
3118 /// (1) do not register hostname but allow resolving of LLMNR host names
3119 /// If unspecified, "default" ultimately depends on the DNS plugin (which
3120 /// for systemd-resolved currently means "yes").
3121 ///
3122 /// This feature requires a plugin which supports LLMNR. Otherwise, the
3123 /// setting has no effect. One such plugin is dns-systemd-resolved.
3124 #[cfg(feature = "v1_14")]
3125 #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
3126 pub fn llmnr(self, llmnr: i32) -> Self {
3127 Self {
3128 builder: self.builder.property("llmnr", llmnr),
3129 }
3130 }
3131
3132 /// Interface name of the controller device or UUID of the controller connection.
3133 ///
3134 /// Deprecated 1.46. Use #NMSettingConnection:controller instead, this is just an alias.
3135 pub fn master(self, master: impl Into<glib::GString>) -> Self {
3136 Self {
3137 builder: self.builder.property("master", master.into()),
3138 }
3139 }
3140
3141 /// Whether mDNS is enabled for the connection.
3142 ///
3143 /// The permitted values are: "yes" (2) register hostname and resolving
3144 /// for the connection, "no" (0) disable mDNS for the interface, "resolve"
3145 /// (1) do not register hostname but allow resolving of mDNS host names
3146 /// and "default" (-1) to allow lookup of a global default in NetworkManager.conf.
3147 /// If unspecified, "default" ultimately depends on the DNS plugin.
3148 ///
3149 /// This feature requires a plugin which supports mDNS. Otherwise, the
3150 /// setting has no effect. Currently the only supported DNS plugin is
3151 /// systemd-resolved. For systemd-resolved, the default is configurable via
3152 /// MulticastDNS= setting in resolved.conf.
3153 #[cfg(feature = "v1_12")]
3154 #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
3155 pub fn mdns(self, mdns: i32) -> Self {
3156 Self {
3157 builder: self.builder.property("mdns", mdns),
3158 }
3159 }
3160
3161 /// Whether the connection is metered.
3162 ///
3163 /// When updating this property on a currently activated connection,
3164 /// the change takes effect immediately.
3165 #[cfg(feature = "v1_2")]
3166 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3167 pub fn metered(self, metered: Metered) -> Self {
3168 Self {
3169 builder: self.builder.property("metered", metered),
3170 }
3171 }
3172
3173 /// Whether to configure MPTCP endpoints and the address flags.
3174 /// If MPTCP is enabled in NetworkManager, it will configure the
3175 /// addresses of the interface as MPTCP endpoints. Note that
3176 /// IPv4 loopback addresses (127.0.0.0/8), IPv4 link local
3177 /// addresses (169.254.0.0/16), the IPv6 loopback address (::1),
3178 /// IPv6 link local addresses (fe80::/10), IPv6 unique
3179 /// local addresses (ULA, fc00::/7) and IPv6 privacy extension addresses
3180 /// (rfc3041, ipv6.ip6-privacy) will be excluded from being
3181 /// configured as endpoints.
3182 ///
3183 /// If "disabled" (0x1), MPTCP handling for the interface is disabled and
3184 /// no endpoints are registered.
3185 ///
3186 /// The "enabled" (0x2) flag means that MPTCP handling is enabled.
3187 /// This flag can also be implied from the presence of other flags.
3188 ///
3189 /// Even when enabled, MPTCP handling will by default still be disabled
3190 /// unless "/proc/sys/net/mptcp/enabled" sysctl is on. NetworkManager
3191 /// does not change the sysctl and this is up to the administrator
3192 /// or distribution. To configure endpoints even if the sysctl is
3193 /// disabled, "also-without-sysctl" (0x4) flag can be used. In that case,
3194 /// NetworkManager doesn't look at the sysctl and configures endpoints
3195 /// regardless.
3196 ///
3197 /// Even when enabled, NetworkManager will only configure MPTCP endpoints
3198 /// for a certain address family, if there is a unicast default route (0.0.0.0/0
3199 /// or ::/0) in the main routing table. The flag "also-without-default-route"
3200 /// (0x8) can override that.
3201 ///
3202 /// When MPTCP handling is enabled then endpoints are configured with
3203 /// the specified address flags "signal" (0x10), "subflow" (0x20), "backup" (0x40),
3204 /// "fullmesh" (0x80). See ip-mptcp(8) manual for additional information about the flags.
3205 ///
3206 /// If the flags are zero (0x0), the global connection default from NetworkManager.conf is
3207 /// honored. If still unspecified, the fallback is "enabled,subflow".
3208 /// Note that this means that MPTCP is by default done depending on the
3209 /// "/proc/sys/net/mptcp/enabled" sysctl.
3210 ///
3211 /// NetworkManager does not change the MPTCP limits nor enable MPTCP via
3212 /// "/proc/sys/net/mptcp/enabled". That is a host configuration which the
3213 /// admin can change via sysctl and ip-mptcp.
3214 ///
3215 /// Strict reverse path filtering (rp_filter) breaks many MPTCP use cases, so when
3216 /// MPTCP handling for IPv4 addresses on the interface is enabled, NetworkManager would
3217 /// loosen the strict reverse path filtering (1) to the loose setting (2).
3218 #[cfg(feature = "v1_40")]
3219 #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
3220 pub fn mptcp_flags(self, mptcp_flags: u32) -> Self {
3221 Self {
3222 builder: self.builder.property("mptcp-flags", mptcp_flags),
3223 }
3224 }
3225
3226 /// If configured, set to a Manufacturer Usage Description (MUD) URL that points
3227 /// to manufacturer-recommended network policies for IoT devices. It is transmitted
3228 /// as a DHCPv4 or DHCPv6 option. The value must be a valid URL starting with "https://".
3229 ///
3230 /// The special value "none" is allowed to indicate that no MUD URL is used.
3231 ///
3232 /// If the per-profile value is unspecified (the default), a global connection default gets
3233 /// consulted. If still unspecified, the ultimate default is "none".
3234 #[cfg(feature = "v1_26")]
3235 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
3236 pub fn mud_url(self, mud_url: impl Into<glib::GString>) -> Self {
3237 Self {
3238 builder: self.builder.property("mud-url", mud_url.into()),
3239 }
3240 }
3241
3242 /// Specifies whether the profile can be active multiple times at a particular
3243 /// moment. The value is of type #NMConnectionMultiConnect.
3244 #[cfg(feature = "v1_14")]
3245 #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
3246 pub fn multi_connect(self, multi_connect: i32) -> Self {
3247 Self {
3248 builder: self.builder.property("multi-connect", multi_connect),
3249 }
3250 }
3251
3252 /// An array of strings defining what access a given user has to this
3253 /// connection. If this is [`None`] or empty, all users are allowed to access
3254 /// this connection; otherwise users are allowed if and only if they are in
3255 /// this list. When this is not empty, the connection can be active only when
3256 /// one of the specified users is logged into an active session. Each entry
3257 /// is of the form "[type]:[id]:[reserved]"; for example, "user:dcbw:blah".
3258 ///
3259 /// At this time only the "user" [type] is allowed. Any other values are
3260 /// ignored and reserved for future use. [id] is the username that this
3261 /// permission refers to, which may not contain the ":" character. Any
3262 /// [reserved] information present must be ignored and is reserved for future
3263 /// use. All of [type], [id], and [reserved] must be valid UTF-8.
3264 pub fn permissions(self, permissions: impl Into<glib::StrV>) -> Self {
3265 Self {
3266 builder: self.builder.property("permissions", permissions.into()),
3267 }
3268 }
3269
3270 /// Setting name of the device type of this port's controller connection (eg,
3271 /// [`SETTING_BOND_SETTING_NAME`][crate::SETTING_BOND_SETTING_NAME]), or [`None`] if this connection is not a
3272 /// port.
3273 #[cfg(feature = "v1_46")]
3274 #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
3275 pub fn port_type(self, port_type: impl Into<glib::GString>) -> Self {
3276 Self {
3277 builder: self.builder.property("port-type", port_type.into()),
3278 }
3279 }
3280
3281 /// This property is deprecated and has no meaning.
3282 /// This property is deprecated and has no meaning.
3283 #[cfg_attr(feature = "v1_44", deprecated = "Since 1.44")]
3284 pub fn read_only(self, read_only: bool) -> Self {
3285 Self {
3286 builder: self.builder.property("read-only", read_only),
3287 }
3288 }
3289
3290 /// List of connection UUIDs that should be activated when the base
3291 /// connection itself is activated. Currently, only VPN connections are
3292 /// supported.
3293 pub fn secondaries(self, secondaries: impl Into<glib::StrV>) -> Self {
3294 Self {
3295 builder: self.builder.property("secondaries", secondaries.into()),
3296 }
3297 }
3298
3299 /// Setting name of the device type of this port's controller connection (eg,
3300 /// [`SETTING_BOND_SETTING_NAME`][crate::SETTING_BOND_SETTING_NAME]), or [`None`] if this connection is not a
3301 /// port.
3302 ///
3303 /// Deprecated 1.46. Use #NMSettingConnection:port-type instead, this is just an alias.
3304 pub fn slave_type(self, slave_type: impl Into<glib::GString>) -> Self {
3305 Self {
3306 builder: self.builder.property("slave-type", slave_type.into()),
3307 }
3308 }
3309
3310 /// This represents the identity of the connection used for various purposes.
3311 /// It allows configuring multiple profiles to share the identity. Also,
3312 /// the stable-id can contain placeholders that are substituted dynamically and
3313 /// deterministically depending on the context.
3314 ///
3315 /// The stable-id is used for generating IPv6 stable private addresses with
3316 /// ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated
3317 /// cloned MAC address for ethernet.cloned-mac-address=stable and
3318 /// wifi.cloned-mac-address=stable. It is also used to derive the DHCP
3319 /// client identifier with ipv4.dhcp-client-id=stable, the DHCPv6 DUID with
3320 /// ipv6.dhcp-duid=stable-[llt,ll,uuid] and the DHCP IAID with
3321 /// ipv4.iaid=stable and ipv6.iaid=stable.
3322 ///
3323 /// Note that depending on the context where it is used, other parameters are
3324 /// also seeded into the generation algorithm. For example, a per-host key
3325 /// is commonly also included, so that different systems end up generating
3326 /// different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device's
3327 /// name is included, so that different interfaces yield different addresses.
3328 /// The per-host key is the identity of your machine and stored in /var/lib/NetworkManager/secret_key.
3329 /// See NetworkManager(8) manual about the secret-key and the host identity.
3330 ///
3331 /// The '$' character is treated special to perform dynamic substitutions at
3332 /// activation time. Currently, supported are "${CONNECTION}", "${DEVICE}",
3333 /// "${MAC}", "${NETWORK_SSID}", "${BOOT}", "${RANDOM}". These effectively
3334 /// create unique IDs per-connection, per-device, per-SSID, per-boot, or
3335 /// every time. The "${CONNECTION}" uses the profile's connection.uuid, the
3336 /// "${DEVICE}" uses the interface name of the device and "${MAC}" the
3337 /// permanent MAC address of the device. "${NETWORK_SSID}" uses the SSID for
3338 /// Wi-Fi networks and falls back to "${CONNECTION}" on other networks. Any
3339 /// unrecognized patterns following '$' are treated verbatim, however are
3340 /// reserved for future use. You are thus advised to avoid '$' or escape it
3341 /// as "$$". For example, set it to "${CONNECTION}-${BOOT}-${DEVICE}" to
3342 /// create a unique id for this connection that changes with every reboot
3343 /// and differs depending on the interface where the profile activates.
3344 ///
3345 /// If the value is unset, a global connection default is consulted. If the
3346 /// value is still unset, the default is "default${CONNECTION}" go generate
3347 /// an ID unique per connection profile.
3348 #[cfg(feature = "v1_4")]
3349 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
3350 pub fn stable_id(self, stable_id: impl Into<glib::GString>) -> Self {
3351 Self {
3352 builder: self.builder.property("stable-id", stable_id.into()),
3353 }
3354 }
3355
3356 /// The time, in seconds since the Unix Epoch, that the connection was last
3357 /// _successfully_ fully activated.
3358 ///
3359 /// NetworkManager updates the connection timestamp periodically when the
3360 /// connection is active to ensure that an active connection has the latest
3361 /// timestamp. The property is only meant for reading (changes to this
3362 /// property will not be preserved).
3363 pub fn timestamp(self, timestamp: u64) -> Self {
3364 Self {
3365 builder: self.builder.property("timestamp", timestamp),
3366 }
3367 }
3368
3369 pub fn type_(self, type_: impl Into<glib::GString>) -> Self {
3370 Self {
3371 builder: self.builder.property("type", type_.into()),
3372 }
3373 }
3374
3375 /// A universally unique identifier for the connection, for example generated
3376 /// with libuuid. It should be assigned when the connection is created, and
3377 /// never changed as long as the connection still applies to the same
3378 /// network. For example, it should not be changed when the
3379 /// #NMSettingConnection:id property or #NMSettingIP4Config changes, but
3380 /// might need to be re-created when the Wi-Fi SSID, mobile broadband network
3381 /// provider, or #NMSettingConnection:type property changes.
3382 ///
3383 /// The UUID must be in the format "2815492f-7e56-435e-b2e9-246bd7cdc664"
3384 /// (ie, contains only hexadecimal characters and "-"). A suitable UUID may
3385 /// be generated by nm_utils_uuid_generate() or
3386 /// nm_uuid_generate_from_string_str().
3387 pub fn uuid(self, uuid: impl Into<glib::GString>) -> Self {
3388 Self {
3389 builder: self.builder.property("uuid", uuid.into()),
3390 }
3391 }
3392
3393 /// Time in milliseconds to wait for connection to be considered activated.
3394 /// The wait will start after the pre-up dispatcher event.
3395 ///
3396 /// The value 0 means no wait time. The default value is -1, which
3397 /// currently has the same meaning as no wait time.
3398 #[cfg(feature = "v1_40")]
3399 #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
3400 pub fn wait_activation_delay(self, wait_activation_delay: i32) -> Self {
3401 Self {
3402 builder: self
3403 .builder
3404 .property("wait-activation-delay", wait_activation_delay),
3405 }
3406 }
3407
3408 /// Timeout in milliseconds to wait for device at startup.
3409 /// During boot, devices may take a while to be detected by the driver.
3410 /// This property will cause to delay NetworkManager-wait-online.service
3411 /// and nm-online to give the device a chance to appear. This works by
3412 /// waiting for the given timeout until a compatible device for the
3413 /// profile is available and managed.
3414 ///
3415 /// The value 0 means no wait time. The default value is -1, which
3416 /// currently has the same meaning as no wait time.
3417 #[cfg(feature = "v1_20")]
3418 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
3419 pub fn wait_device_timeout(self, wait_device_timeout: i32) -> Self {
3420 Self {
3421 builder: self
3422 .builder
3423 .property("wait-device-timeout", wait_device_timeout),
3424 }
3425 }
3426
3427 /// The trust level of a the connection. Free form case-insensitive string
3428 /// (for example "Home", "Work", "Public"). [`None`] or unspecified zone means
3429 /// the connection will be placed in the default zone as defined by the
3430 /// firewall.
3431 ///
3432 /// When updating this property on a currently activated connection,
3433 /// the change takes effect immediately.
3434 pub fn zone(self, zone: impl Into<glib::GString>) -> Self {
3435 Self {
3436 builder: self.builder.property("zone", zone.into()),
3437 }
3438 }
3439
3440 // rustdoc-stripper-ignore-next
3441 /// Build the [`SettingConnection`].
3442 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
3443 pub fn build(self) -> SettingConnection {
3444 assert_initialized_main_thread!();
3445 self.builder.build()
3446 }
3447}