nm_rs/auto/
device_ip_tunnel.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
6use crate::{ffi,Device,IPTunnelMode,Object};
7#[cfg(feature = "v1_12")]
8#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
9use crate::{IPTunnelFlags};
10use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*};
11use std::{boxed::Box as Box_};
12
13glib::wrapper! {
14    ///
15    ///
16    /// ## Properties
17    ///
18    ///
19    /// #### `encapsulation-limit`
20    ///  How many additional levels of encapsulation are permitted to
21    /// be prepended to packets. This property applies only to IPv6
22    /// tunnels.
23    ///
24    /// Readable
25    ///
26    ///
27    /// #### `flags`
28    ///  Tunnel flags.
29    ///
30    /// Readable
31    ///
32    ///
33    /// #### `flow-label`
34    ///  The flow label to assign to tunnel packets. This property
35    /// applies only to IPv6 tunnels.
36    ///
37    /// Readable
38    ///
39    ///
40    /// #### `fwmark`
41    ///  The fwmark value to assign to tunnel packets. This property applies only
42    /// to VTI tunnels.
43    ///
44    /// Readable
45    ///
46    ///
47    /// #### `input-key`
48    ///  The key used for tunneled input packets, if applicable.
49    ///
50    /// Readable
51    ///
52    ///
53    /// #### `local`
54    ///  The local endpoint of the tunnel.
55    ///
56    /// Readable
57    ///
58    ///
59    /// #### `mode`
60    ///  The tunneling mode of the device.
61    ///
62    /// Readable
63    ///
64    ///
65    /// #### `output-key`
66    ///  The key used for tunneled output packets, if applicable.
67    ///
68    /// Readable
69    ///
70    ///
71    /// #### `parent`
72    ///  The devices's parent device.
73    ///
74    /// Readable
75    ///
76    ///
77    /// #### `path-mtu-discovery`
78    ///  Whether path MTU discovery is enabled on this tunnel.
79    ///
80    /// Readable
81    ///
82    ///
83    /// #### `remote`
84    ///  The remote endpoint of the tunnel.
85    ///
86    /// Readable
87    ///
88    ///
89    /// #### `tos`
90    ///  The type of service (IPv4) or traffic class (IPv6) assigned to
91    /// tunneled packets.
92    ///
93    /// Readable
94    ///
95    ///
96    /// #### `ttl`
97    ///  The TTL assigned to tunneled packets. 0 is a special value
98    ///  meaning that packets inherit the TTL value
99    ///
100    /// Readable
101    /// <details><summary><h4>Device</h4></summary>
102    ///
103    ///
104    /// #### `active-connection`
105    ///  The #NMActiveConnection object that "owns" this device during activation.
106    ///
107    /// Readable
108    ///
109    ///
110    /// #### `autoconnect`
111    ///  Whether the device can auto-activate a connection.
112    ///
113    /// The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
114    ///
115    /// Readable | Writeable
116    ///
117    ///
118    /// #### `available-connections`
119    ///  The available connections of the device
120    ///
121    /// Readable
122    ///
123    ///
124    /// #### `capabilities`
125    ///  The capabilities of the device.
126    ///
127    /// Readable
128    ///
129    ///
130    /// #### `device-type`
131    ///  The numeric type of the device.
132    ///
133    /// Readable
134    ///
135    ///
136    /// #### `dhcp4-config`
137    ///  The IPv4 #NMDhcpConfig of the device.
138    ///
139    /// Readable
140    ///
141    ///
142    /// #### `dhcp6-config`
143    ///  The IPv6 #NMDhcpConfig of the device.
144    ///
145    /// Readable
146    ///
147    ///
148    /// #### `driver`
149    ///  The driver of the device.
150    ///
151    /// Readable
152    ///
153    ///
154    /// #### `driver-version`
155    ///  The version of the device driver.
156    ///
157    /// Readable
158    ///
159    ///
160    /// #### `firmware-missing`
161    ///  When [`true`] indicates the device is likely missing firmware required
162    /// for its operation.
163    ///
164    /// Readable
165    ///
166    ///
167    /// #### `firmware-version`
168    ///  The firmware version of the device.
169    ///
170    /// Readable
171    ///
172    ///
173    /// #### `hw-address`
174    ///  The hardware address of the device.
175    ///
176    /// Readable
177    ///
178    ///
179    /// #### `interface`
180    ///  The interface of the device.
181    ///
182    /// Readable
183    ///
184    ///
185    /// #### `interface-flags`
186    ///  The interface flags.
187    ///
188    /// Readable
189    ///
190    ///
191    /// #### `ip-interface`
192    ///  The IP interface of the device which should be used for all IP-related
193    /// operations like addressing and routing.
194    ///
195    /// Readable
196    ///
197    ///
198    /// #### `ip4-config`
199    ///  The #NMIP4Config of the device.
200    ///
201    /// Readable
202    ///
203    ///
204    /// #### `ip4-connectivity`
205    ///  The IPv4 connectivity state of the device.
206    ///
207    /// Readable
208    ///
209    ///
210    /// #### `ip6-config`
211    ///  The IPv6 #NMIPConfig of the device.
212    ///
213    /// Readable
214    ///
215    ///
216    /// #### `ip6-connectivity`
217    ///  The IPv6 connectivity state of the device.
218    ///
219    /// Readable
220    ///
221    ///
222    /// #### `lldp-neighbors`
223    ///  The LLDP neighbors.
224    ///
225    /// Readable
226    ///
227    ///
228    /// #### `managed`
229    ///  Whether the device is managed by NetworkManager.
230    ///
231    /// Readable
232    ///
233    ///
234    /// #### `metered`
235    ///  Whether the device is metered.
236    ///
237    /// Readable
238    ///
239    ///
240    /// #### `mtu`
241    ///  The MTU of the device.
242    ///
243    /// Readable
244    ///
245    ///
246    /// #### `nm-plugin-missing`
247    ///  When [`true`] indicates that the NetworkManager plugin for the device
248    /// is not installed.
249    ///
250    /// Readable
251    ///
252    ///
253    /// #### `path`
254    ///  The device path as exposed by the udev property ID_PATH.
255    ///
256    /// The string is backslash escaped (C escaping) for invalid
257    /// characters. The escaping can be reverted with g_strcompress(),
258    /// however the result may not be valid UTF-8.
259    ///
260    /// Readable
261    ///
262    ///
263    /// #### `physical-port-id`
264    ///  The physical port ID of the device. (See
265    /// nm_device_get_physical_port_id().)
266    ///
267    /// Readable
268    ///
269    ///
270    /// #### `ports`
271    ///  The port devices of the controller device. For devices that cannot be
272    /// controllers this is likely to be always empty.
273    ///
274    /// Readable
275    ///
276    ///
277    /// #### `product`
278    ///  The product string of the device.
279    ///
280    /// Readable
281    ///
282    ///
283    /// #### `real`
284    ///  Whether the device is real or is a placeholder device that could
285    /// be created automatically by NetworkManager if one of its
286    /// #NMDevice:available-connections was activated.
287    ///
288    /// Readable
289    ///
290    ///
291    /// #### `state`
292    ///  The state of the device.
293    ///
294    /// Readable
295    ///
296    ///
297    /// #### `state-reason`
298    ///  The reason for the device state.
299    ///
300    /// Readable
301    ///
302    ///
303    /// #### `udi`
304    ///  An operating-system specific device hardware identifier; this is not
305    /// unique to a specific hardware device across reboots or hotplugs.  It
306    /// is an opaque string which for some device types (Bluetooth, Modem)
307    /// contains an identifier provided by the underlying hardware service daemon
308    /// such as Bluez or ModemManager, and clients can use this property to
309    /// request more information about the device from those services.
310    ///
311    /// Readable
312    ///
313    ///
314    /// #### `vendor`
315    ///  The vendor string of the device.
316    ///
317    /// Readable
318    /// </details>
319    /// <details><summary><h4>Object</h4></summary>
320    ///
321    ///
322    /// #### `client`
323    ///  The NMClient instance as returned by nm_object_get_client().
324    ///
325    /// When an NMObject gets removed from the NMClient cache,
326    /// the NMObject:path property stays unchanged, but this client
327    /// instance gets reset to [`None`]. You can use this property to
328    /// track removal of the object from the cache.
329    ///
330    /// Readable
331    ///
332    ///
333    /// #### `path`
334    ///  The D-Bus object path.
335    ///
336    /// The D-Bus path of an object instance never changes, even if the object
337    /// gets removed from the cache. To see whether the object is still in the
338    /// cache, check NMObject:client.
339    ///
340    /// Readable
341    /// </details>
342    ///
343    /// # Implements
344    ///
345    /// [`DeviceExt`][trait@crate::prelude::DeviceExt], [`ObjectExt`][trait@crate::prelude::ObjectExt]
346    #[doc(alias = "NMDeviceIPTunnel")]
347    pub struct DeviceIPTunnel(Object<ffi::NMDeviceIPTunnel, ffi::NMDeviceIPTunnelClass>) @extends Device, Object;
348
349    match fn {
350        type_ => || ffi::nm_device_ip_tunnel_get_type(),
351    }
352}
353
354impl DeviceIPTunnel {
355            // rustdoc-stripper-ignore-next
356            /// Creates a new builder-pattern struct instance to construct [`DeviceIPTunnel`] objects.
357            ///
358            /// This method returns an instance of [`DeviceIPTunnelBuilder`](crate::builders::DeviceIPTunnelBuilder) which can be used to create [`DeviceIPTunnel`] objects.
359            pub fn builder() -> DeviceIPTunnelBuilder {
360                DeviceIPTunnelBuilder::new()
361            }
362        
363
364    ///
365    /// # Returns
366    ///
367    /// the maximum permitted encapsulation level
368    #[doc(alias = "nm_device_ip_tunnel_get_encapsulation_limit")]
369    #[doc(alias = "get_encapsulation_limit")]
370    #[doc(alias = "encapsulation-limit")]
371    pub fn encapsulation_limit(&self) -> u8 {
372        unsafe {
373            ffi::nm_device_ip_tunnel_get_encapsulation_limit(self.to_glib_none().0)
374        }
375    }
376
377    ///
378    /// # Returns
379    ///
380    /// the tunnel flags
381    #[cfg(feature = "v1_12")]
382    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
383    #[doc(alias = "nm_device_ip_tunnel_get_flags")]
384    #[doc(alias = "get_flags")]
385    pub fn flags(&self) -> IPTunnelFlags {
386        unsafe {
387            from_glib(ffi::nm_device_ip_tunnel_get_flags(self.to_glib_none().0))
388        }
389    }
390
391    ///
392    /// # Returns
393    ///
394    /// the flow label assigned to tunnel packets
395    #[doc(alias = "nm_device_ip_tunnel_get_flow_label")]
396    #[doc(alias = "get_flow_label")]
397    #[doc(alias = "flow-label")]
398    pub fn flow_label(&self) -> u32 {
399        unsafe {
400            ffi::nm_device_ip_tunnel_get_flow_label(self.to_glib_none().0)
401        }
402    }
403
404    ///
405    /// # Returns
406    ///
407    /// the fwmark assigned to tunnel packets. This property applies only
408    /// to VTI tunnels.
409    #[cfg(feature = "v1_46")]
410    #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
411    #[doc(alias = "nm_device_ip_tunnel_get_fwmark")]
412    #[doc(alias = "get_fwmark")]
413    pub fn fwmark(&self) -> u32 {
414        unsafe {
415            ffi::nm_device_ip_tunnel_get_fwmark(self.to_glib_none().0)
416        }
417    }
418
419    ///
420    /// # Returns
421    ///
422    /// the key used for incoming packets
423    #[doc(alias = "nm_device_ip_tunnel_get_input_key")]
424    #[doc(alias = "get_input_key")]
425    #[doc(alias = "input-key")]
426    pub fn input_key(&self) -> glib::GString {
427        unsafe {
428            from_glib_none(ffi::nm_device_ip_tunnel_get_input_key(self.to_glib_none().0))
429        }
430    }
431
432    ///
433    /// # Returns
434    ///
435    /// the local endpoint of the tunnel
436    #[doc(alias = "nm_device_ip_tunnel_get_local")]
437    #[doc(alias = "get_local")]
438    pub fn local(&self) -> glib::GString {
439        unsafe {
440            from_glib_none(ffi::nm_device_ip_tunnel_get_local(self.to_glib_none().0))
441        }
442    }
443
444    ///
445    /// # Returns
446    ///
447    /// the tunneling mode
448    #[doc(alias = "nm_device_ip_tunnel_get_mode")]
449    #[doc(alias = "get_mode")]
450    pub fn mode(&self) -> IPTunnelMode {
451        unsafe {
452            from_glib(ffi::nm_device_ip_tunnel_get_mode(self.to_glib_none().0))
453        }
454    }
455
456    ///
457    /// # Returns
458    ///
459    /// the key used for outgoing packets
460    #[doc(alias = "nm_device_ip_tunnel_get_output_key")]
461    #[doc(alias = "get_output_key")]
462    #[doc(alias = "output-key")]
463    pub fn output_key(&self) -> glib::GString {
464        unsafe {
465            from_glib_none(ffi::nm_device_ip_tunnel_get_output_key(self.to_glib_none().0))
466        }
467    }
468
469    ///
470    /// # Returns
471    ///
472    /// the device's parent device
473    #[doc(alias = "nm_device_ip_tunnel_get_parent")]
474    #[doc(alias = "get_parent")]
475    pub fn parent(&self) -> Device {
476        unsafe {
477            from_glib_none(ffi::nm_device_ip_tunnel_get_parent(self.to_glib_none().0))
478        }
479    }
480
481    ///
482    /// # Returns
483    ///
484    /// whether path MTU discovery is enabled
485    #[doc(alias = "nm_device_ip_tunnel_get_path_mtu_discovery")]
486    #[doc(alias = "get_path_mtu_discovery")]
487    #[doc(alias = "path-mtu-discovery")]
488    pub fn is_path_mtu_discovery(&self) -> bool {
489        unsafe {
490            from_glib(ffi::nm_device_ip_tunnel_get_path_mtu_discovery(self.to_glib_none().0))
491        }
492    }
493
494    ///
495    /// # Returns
496    ///
497    /// the remote endpoint of the tunnel
498    #[doc(alias = "nm_device_ip_tunnel_get_remote")]
499    #[doc(alias = "get_remote")]
500    pub fn remote(&self) -> glib::GString {
501        unsafe {
502            from_glib_none(ffi::nm_device_ip_tunnel_get_remote(self.to_glib_none().0))
503        }
504    }
505
506    ///
507    /// # Returns
508    ///
509    /// type of service (IPv4) or traffic class (IPv6) assigned
510    /// to tunneled packets.
511    #[doc(alias = "nm_device_ip_tunnel_get_tos")]
512    #[doc(alias = "get_tos")]
513    pub fn tos(&self) -> u8 {
514        unsafe {
515            ffi::nm_device_ip_tunnel_get_tos(self.to_glib_none().0)
516        }
517    }
518
519    ///
520    /// # Returns
521    ///
522    /// the TTL assigned to tunneled packets
523    #[doc(alias = "nm_device_ip_tunnel_get_ttl")]
524    #[doc(alias = "get_ttl")]
525    pub fn ttl(&self) -> u8 {
526        unsafe {
527            ffi::nm_device_ip_tunnel_get_ttl(self.to_glib_none().0)
528        }
529    }
530
531    #[cfg(feature = "v1_2")]
532    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
533    #[doc(alias = "encapsulation-limit")]
534    pub fn connect_encapsulation_limit_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
535        unsafe extern "C" fn notify_encapsulation_limit_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
536            let f: &F = &*(f as *const F);
537            f(&from_glib_borrow(this))
538        }
539        unsafe {
540            let f: Box_<F> = Box_::new(f);
541            connect_raw(self.as_ptr() as *mut _, c"notify::encapsulation-limit".as_ptr() as *const _,
542                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_encapsulation_limit_trampoline::<F> as *const ())), Box_::into_raw(f))
543        }
544    }
545
546    #[cfg(feature = "v1_12")]
547    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
548    #[doc(alias = "flags")]
549    pub fn connect_flags_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
550        unsafe extern "C" fn notify_flags_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
551            let f: &F = &*(f as *const F);
552            f(&from_glib_borrow(this))
553        }
554        unsafe {
555            let f: Box_<F> = Box_::new(f);
556            connect_raw(self.as_ptr() as *mut _, c"notify::flags".as_ptr() as *const _,
557                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_flags_trampoline::<F> as *const ())), Box_::into_raw(f))
558        }
559    }
560
561    #[cfg(feature = "v1_2")]
562    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
563    #[doc(alias = "flow-label")]
564    pub fn connect_flow_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
565        unsafe extern "C" fn notify_flow_label_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
566            let f: &F = &*(f as *const F);
567            f(&from_glib_borrow(this))
568        }
569        unsafe {
570            let f: Box_<F> = Box_::new(f);
571            connect_raw(self.as_ptr() as *mut _, c"notify::flow-label".as_ptr() as *const _,
572                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_flow_label_trampoline::<F> as *const ())), Box_::into_raw(f))
573        }
574    }
575
576    #[cfg(feature = "v1_46")]
577    #[cfg_attr(docsrs, doc(cfg(feature = "v1_46")))]
578    #[doc(alias = "fwmark")]
579    pub fn connect_fwmark_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
580        unsafe extern "C" fn notify_fwmark_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
581            let f: &F = &*(f as *const F);
582            f(&from_glib_borrow(this))
583        }
584        unsafe {
585            let f: Box_<F> = Box_::new(f);
586            connect_raw(self.as_ptr() as *mut _, c"notify::fwmark".as_ptr() as *const _,
587                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_fwmark_trampoline::<F> as *const ())), Box_::into_raw(f))
588        }
589    }
590
591    #[cfg(feature = "v1_2")]
592    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
593    #[doc(alias = "input-key")]
594    pub fn connect_input_key_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
595        unsafe extern "C" fn notify_input_key_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
596            let f: &F = &*(f as *const F);
597            f(&from_glib_borrow(this))
598        }
599        unsafe {
600            let f: Box_<F> = Box_::new(f);
601            connect_raw(self.as_ptr() as *mut _, c"notify::input-key".as_ptr() as *const _,
602                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_input_key_trampoline::<F> as *const ())), Box_::into_raw(f))
603        }
604    }
605
606    #[cfg(feature = "v1_2")]
607    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
608    #[doc(alias = "local")]
609    pub fn connect_local_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
610        unsafe extern "C" fn notify_local_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
611            let f: &F = &*(f as *const F);
612            f(&from_glib_borrow(this))
613        }
614        unsafe {
615            let f: Box_<F> = Box_::new(f);
616            connect_raw(self.as_ptr() as *mut _, c"notify::local".as_ptr() as *const _,
617                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_local_trampoline::<F> as *const ())), Box_::into_raw(f))
618        }
619    }
620
621    #[cfg(feature = "v1_2")]
622    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
623    #[doc(alias = "mode")]
624    pub fn connect_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
625        unsafe extern "C" fn notify_mode_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
626            let f: &F = &*(f as *const F);
627            f(&from_glib_borrow(this))
628        }
629        unsafe {
630            let f: Box_<F> = Box_::new(f);
631            connect_raw(self.as_ptr() as *mut _, c"notify::mode".as_ptr() as *const _,
632                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_mode_trampoline::<F> as *const ())), Box_::into_raw(f))
633        }
634    }
635
636    #[cfg(feature = "v1_2")]
637    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
638    #[doc(alias = "output-key")]
639    pub fn connect_output_key_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
640        unsafe extern "C" fn notify_output_key_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
641            let f: &F = &*(f as *const F);
642            f(&from_glib_borrow(this))
643        }
644        unsafe {
645            let f: Box_<F> = Box_::new(f);
646            connect_raw(self.as_ptr() as *mut _, c"notify::output-key".as_ptr() as *const _,
647                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_output_key_trampoline::<F> as *const ())), Box_::into_raw(f))
648        }
649    }
650
651    #[cfg(feature = "v1_2")]
652    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
653    #[doc(alias = "parent")]
654    pub fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
655        unsafe extern "C" fn notify_parent_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
656            let f: &F = &*(f as *const F);
657            f(&from_glib_borrow(this))
658        }
659        unsafe {
660            let f: Box_<F> = Box_::new(f);
661            connect_raw(self.as_ptr() as *mut _, c"notify::parent".as_ptr() as *const _,
662                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_parent_trampoline::<F> as *const ())), Box_::into_raw(f))
663        }
664    }
665
666    #[cfg(feature = "v1_2")]
667    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
668    #[doc(alias = "path-mtu-discovery")]
669    pub fn connect_path_mtu_discovery_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
670        unsafe extern "C" fn notify_path_mtu_discovery_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
671            let f: &F = &*(f as *const F);
672            f(&from_glib_borrow(this))
673        }
674        unsafe {
675            let f: Box_<F> = Box_::new(f);
676            connect_raw(self.as_ptr() as *mut _, c"notify::path-mtu-discovery".as_ptr() as *const _,
677                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_path_mtu_discovery_trampoline::<F> as *const ())), Box_::into_raw(f))
678        }
679    }
680
681    #[cfg(feature = "v1_2")]
682    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
683    #[doc(alias = "remote")]
684    pub fn connect_remote_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
685        unsafe extern "C" fn notify_remote_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
686            let f: &F = &*(f as *const F);
687            f(&from_glib_borrow(this))
688        }
689        unsafe {
690            let f: Box_<F> = Box_::new(f);
691            connect_raw(self.as_ptr() as *mut _, c"notify::remote".as_ptr() as *const _,
692                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_remote_trampoline::<F> as *const ())), Box_::into_raw(f))
693        }
694    }
695
696    #[cfg(feature = "v1_2")]
697    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
698    #[doc(alias = "tos")]
699    pub fn connect_tos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
700        unsafe extern "C" fn notify_tos_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
701            let f: &F = &*(f as *const F);
702            f(&from_glib_borrow(this))
703        }
704        unsafe {
705            let f: Box_<F> = Box_::new(f);
706            connect_raw(self.as_ptr() as *mut _, c"notify::tos".as_ptr() as *const _,
707                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_tos_trampoline::<F> as *const ())), Box_::into_raw(f))
708        }
709    }
710
711    #[cfg(feature = "v1_2")]
712    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
713    #[doc(alias = "ttl")]
714    pub fn connect_ttl_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
715        unsafe extern "C" fn notify_ttl_trampoline<F: Fn(&DeviceIPTunnel) + 'static>(this: *mut ffi::NMDeviceIPTunnel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
716            let f: &F = &*(f as *const F);
717            f(&from_glib_borrow(this))
718        }
719        unsafe {
720            let f: Box_<F> = Box_::new(f);
721            connect_raw(self.as_ptr() as *mut _, c"notify::ttl".as_ptr() as *const _,
722                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_ttl_trampoline::<F> as *const ())), Box_::into_raw(f))
723        }
724    }
725}
726
727// rustdoc-stripper-ignore-next
728        /// A [builder-pattern] type to construct [`DeviceIPTunnel`] objects.
729        ///
730        /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
731#[must_use = "The builder must be built to be used"]
732pub struct DeviceIPTunnelBuilder {
733            builder: glib::object::ObjectBuilder<'static, DeviceIPTunnel>,
734        }
735
736        impl DeviceIPTunnelBuilder {
737        fn new() -> Self {
738            Self { builder: glib::object::Object::builder() }
739        }
740
741                            /// Whether the device can auto-activate a connection.
742                            ///
743                            /// The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
744                            pub fn autoconnect(self, autoconnect: bool) -> Self {
745                            Self { builder: self.builder.property("autoconnect", autoconnect), }
746                        }
747
748    // rustdoc-stripper-ignore-next
749    /// Build the [`DeviceIPTunnel`].
750    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
751    pub fn build(self) -> DeviceIPTunnel {
752assert_initialized_main_thread!();
753    self.builder.build() }
754}