nm_rs/auto/
device_macsec.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
7use crate::{ffi,Device,Object};
8use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*};
9use std::{boxed::Box as Box_};
10
11glib::wrapper! {
12    ///
13    ///
14    /// ## Properties
15    ///
16    ///
17    /// #### `cipher-suite`
18    ///  The set of cryptographic algorithms in use.
19    ///
20    /// Readable
21    ///
22    ///
23    /// #### `encoding-sa`
24    ///  The value of the Association Number (0..3) for the Security
25    /// Association in use.
26    ///
27    /// Readable
28    ///
29    ///
30    /// #### `encrypt`
31    ///  Whether encryption of transmitted frames is enabled.
32    ///
33    /// Readable
34    ///
35    ///
36    /// #### `es`
37    ///  Whether the ES (End station) bit is enabled in SecTAG for
38    /// transmitted frames.
39    ///
40    /// Readable
41    ///
42    ///
43    /// #### `icv-length`
44    ///  The length of ICV (Integrity Check Value).
45    ///
46    /// Readable
47    ///
48    ///
49    /// #### `include-sci`
50    ///  Whether the SCI is always included in SecTAG for transmitted
51    /// frames.
52    ///
53    /// Readable
54    ///
55    ///
56    /// #### `parent`
57    ///  The devices's parent device.
58    ///
59    /// Readable
60    ///
61    ///
62    /// #### `protect`
63    ///  Whether protection of transmitted frames is enabled.
64    ///
65    /// Readable
66    ///
67    ///
68    /// #### `replay-protect`
69    ///  Whether replay protection is enabled.
70    ///
71    /// Readable
72    ///
73    ///
74    /// #### `scb`
75    ///  Whether the SCB (Single Copy Broadcast) bit is enabled in
76    /// SecTAG for transmitted frames.
77    ///
78    /// Readable
79    ///
80    ///
81    /// #### `sci`
82    ///  The Secure Channel Identifier in use.
83    ///
84    /// Readable
85    ///
86    ///
87    /// #### `validation`
88    ///  The validation mode for incoming packets (strict, check,
89    /// disabled).
90    ///
91    /// Readable
92    ///
93    ///
94    /// #### `window`
95    ///  The size of the replay window.
96    ///
97    /// Readable
98    /// <details><summary><h4>Device</h4></summary>
99    ///
100    ///
101    /// #### `active-connection`
102    ///  The #NMActiveConnection object that "owns" this device during activation.
103    ///
104    /// Readable
105    ///
106    ///
107    /// #### `autoconnect`
108    ///  Whether the device can auto-activate a connection.
109    ///
110    /// The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
111    ///
112    /// Readable | Writeable
113    ///
114    ///
115    /// #### `available-connections`
116    ///  The available connections of the device
117    ///
118    /// Readable
119    ///
120    ///
121    /// #### `capabilities`
122    ///  The capabilities of the device.
123    ///
124    /// Readable
125    ///
126    ///
127    /// #### `device-type`
128    ///  The numeric type of the device.
129    ///
130    /// Readable
131    ///
132    ///
133    /// #### `dhcp4-config`
134    ///  The IPv4 #NMDhcpConfig of the device.
135    ///
136    /// Readable
137    ///
138    ///
139    /// #### `dhcp6-config`
140    ///  The IPv6 #NMDhcpConfig of the device.
141    ///
142    /// Readable
143    ///
144    ///
145    /// #### `driver`
146    ///  The driver of the device.
147    ///
148    /// Readable
149    ///
150    ///
151    /// #### `driver-version`
152    ///  The version of the device driver.
153    ///
154    /// Readable
155    ///
156    ///
157    /// #### `firmware-missing`
158    ///  When [`true`] indicates the device is likely missing firmware required
159    /// for its operation.
160    ///
161    /// Readable
162    ///
163    ///
164    /// #### `firmware-version`
165    ///  The firmware version of the device.
166    ///
167    /// Readable
168    ///
169    ///
170    /// #### `hw-address`
171    ///  The hardware address of the device.
172    ///
173    /// Readable
174    ///
175    ///
176    /// #### `interface`
177    ///  The interface of the device.
178    ///
179    /// Readable
180    ///
181    ///
182    /// #### `interface-flags`
183    ///  The interface flags.
184    ///
185    /// Readable
186    ///
187    ///
188    /// #### `ip-interface`
189    ///  The IP interface of the device which should be used for all IP-related
190    /// operations like addressing and routing.
191    ///
192    /// Readable
193    ///
194    ///
195    /// #### `ip4-config`
196    ///  The #NMIP4Config of the device.
197    ///
198    /// Readable
199    ///
200    ///
201    /// #### `ip4-connectivity`
202    ///  The IPv4 connectivity state of the device.
203    ///
204    /// Readable
205    ///
206    ///
207    /// #### `ip6-config`
208    ///  The IPv6 #NMIPConfig of the device.
209    ///
210    /// Readable
211    ///
212    ///
213    /// #### `ip6-connectivity`
214    ///  The IPv6 connectivity state of the device.
215    ///
216    /// Readable
217    ///
218    ///
219    /// #### `lldp-neighbors`
220    ///  The LLDP neighbors.
221    ///
222    /// Readable
223    ///
224    ///
225    /// #### `managed`
226    ///  Whether the device is managed by NetworkManager.
227    ///
228    /// Readable
229    ///
230    ///
231    /// #### `metered`
232    ///  Whether the device is metered.
233    ///
234    /// Readable
235    ///
236    ///
237    /// #### `mtu`
238    ///  The MTU of the device.
239    ///
240    /// Readable
241    ///
242    ///
243    /// #### `nm-plugin-missing`
244    ///  When [`true`] indicates that the NetworkManager plugin for the device
245    /// is not installed.
246    ///
247    /// Readable
248    ///
249    ///
250    /// #### `path`
251    ///  The device path as exposed by the udev property ID_PATH.
252    ///
253    /// The string is backslash escaped (C escaping) for invalid
254    /// characters. The escaping can be reverted with g_strcompress(),
255    /// however the result may not be valid UTF-8.
256    ///
257    /// Readable
258    ///
259    ///
260    /// #### `physical-port-id`
261    ///  The physical port ID of the device. (See
262    /// nm_device_get_physical_port_id().)
263    ///
264    /// Readable
265    ///
266    ///
267    /// #### `ports`
268    ///  The port devices of the controller device. For devices that cannot be
269    /// controllers this is likely to be always empty.
270    ///
271    /// Readable
272    ///
273    ///
274    /// #### `product`
275    ///  The product string of the device.
276    ///
277    /// Readable
278    ///
279    ///
280    /// #### `real`
281    ///  Whether the device is real or is a placeholder device that could
282    /// be created automatically by NetworkManager if one of its
283    /// #NMDevice:available-connections was activated.
284    ///
285    /// Readable
286    ///
287    ///
288    /// #### `state`
289    ///  The state of the device.
290    ///
291    /// Readable
292    ///
293    ///
294    /// #### `state-reason`
295    ///  The reason for the device state.
296    ///
297    /// Readable
298    ///
299    ///
300    /// #### `udi`
301    ///  An operating-system specific device hardware identifier; this is not
302    /// unique to a specific hardware device across reboots or hotplugs.  It
303    /// is an opaque string which for some device types (Bluetooth, Modem)
304    /// contains an identifier provided by the underlying hardware service daemon
305    /// such as Bluez or ModemManager, and clients can use this property to
306    /// request more information about the device from those services.
307    ///
308    /// Readable
309    ///
310    ///
311    /// #### `vendor`
312    ///  The vendor string of the device.
313    ///
314    /// Readable
315    /// </details>
316    /// <details><summary><h4>Object</h4></summary>
317    ///
318    ///
319    /// #### `client`
320    ///  The NMClient instance as returned by nm_object_get_client().
321    ///
322    /// When an NMObject gets removed from the NMClient cache,
323    /// the NMObject:path property stays unchanged, but this client
324    /// instance gets reset to [`None`]. You can use this property to
325    /// track removal of the object from the cache.
326    ///
327    /// Readable
328    ///
329    ///
330    /// #### `path`
331    ///  The D-Bus object path.
332    ///
333    /// The D-Bus path of an object instance never changes, even if the object
334    /// gets removed from the cache. To see whether the object is still in the
335    /// cache, check NMObject:client.
336    ///
337    /// Readable
338    /// </details>
339    ///
340    /// # Implements
341    ///
342    /// [`DeviceExt`][trait@crate::prelude::DeviceExt], [`ObjectExt`][trait@crate::prelude::ObjectExt]
343    #[doc(alias = "NMDeviceMacsec")]
344    pub struct DeviceMacsec(Object<ffi::NMDeviceMacsec, ffi::NMDeviceMacsecClass>) @extends Device, Object;
345
346    match fn {
347        type_ => || ffi::nm_device_macsec_get_type(),
348    }
349}
350
351impl DeviceMacsec {
352            // rustdoc-stripper-ignore-next
353            /// Creates a new builder-pattern struct instance to construct [`DeviceMacsec`] objects.
354            ///
355            /// This method returns an instance of [`DeviceMacsecBuilder`](crate::builders::DeviceMacsecBuilder) which can be used to create [`DeviceMacsec`] objects.
356            pub fn builder() -> DeviceMacsecBuilder {
357                DeviceMacsecBuilder::new()
358            }
359        
360
361    /// Gets the set of cryptographic algorithms in use
362    ///
363    /// # Returns
364    ///
365    /// the set of cryptographic algorithms in use
366    #[doc(alias = "nm_device_macsec_get_cipher_suite")]
367    #[doc(alias = "get_cipher_suite")]
368    #[doc(alias = "cipher-suite")]
369    pub fn cipher_suite(&self) -> u64 {
370        unsafe {
371            ffi::nm_device_macsec_get_cipher_suite(self.to_glib_none().0)
372        }
373    }
374
375    /// Gets the value of the Association Number (0..3) for the Security
376    /// Association in use.
377    ///
378    /// # Returns
379    ///
380    /// the current Security Association
381    #[doc(alias = "nm_device_macsec_get_encoding_sa")]
382    #[doc(alias = "get_encoding_sa")]
383    #[doc(alias = "encoding-sa")]
384    pub fn encoding_sa(&self) -> u8 {
385        unsafe {
386            ffi::nm_device_macsec_get_encoding_sa(self.to_glib_none().0)
387        }
388    }
389
390    /// Gets whether encryption of transmitted frames is enabled
391    ///
392    /// # Returns
393    ///
394    /// whether encryption is enabled
395    #[doc(alias = "nm_device_macsec_get_encrypt")]
396    #[doc(alias = "get_encrypt")]
397    #[doc(alias = "encrypt")]
398    pub fn is_encrypt(&self) -> bool {
399        unsafe {
400            from_glib(ffi::nm_device_macsec_get_encrypt(self.to_glib_none().0))
401        }
402    }
403
404    /// Gets whether the ES (End station) bit is enabled in SecTAG for
405    /// transmitted frames
406    ///
407    /// # Returns
408    ///
409    /// whether the ES (End station) bit is enabled
410    #[doc(alias = "nm_device_macsec_get_es")]
411    #[doc(alias = "get_es")]
412    #[doc(alias = "es")]
413    pub fn is_es(&self) -> bool {
414        unsafe {
415            from_glib(ffi::nm_device_macsec_get_es(self.to_glib_none().0))
416        }
417    }
418
419    /// Gets the hardware (MAC) address of the #NMDeviceMacsec
420    ///
421    /// # Deprecated since 1.24
422    ///
423    /// Use nm_device_get_hw_address() instead.
424    ///
425    /// # Returns
426    ///
427    /// the hardware address. This is the internal string used by the
428    /// device, and must not be modified.
429    #[cfg_attr(feature = "v1_24", deprecated = "Since 1.24")]
430    #[allow(deprecated)]
431    #[doc(alias = "nm_device_macsec_get_hw_address")]
432    #[doc(alias = "get_hw_address")]
433    pub fn hw_address(&self) -> glib::GString {
434        unsafe {
435            from_glib_none(ffi::nm_device_macsec_get_hw_address(self.to_glib_none().0))
436        }
437    }
438
439    /// Gets the length of ICV (Integrity Check Value)
440    ///
441    /// # Returns
442    ///
443    /// the length of ICV
444    #[doc(alias = "nm_device_macsec_get_icv_length")]
445    #[doc(alias = "get_icv_length")]
446    #[doc(alias = "icv-length")]
447    pub fn icv_length(&self) -> u8 {
448        unsafe {
449            ffi::nm_device_macsec_get_icv_length(self.to_glib_none().0)
450        }
451    }
452
453    /// Gets whether the SCI is always included in SecTAG for transmitted
454    /// frames
455    ///
456    /// # Returns
457    ///
458    /// whether the SCI is always included
459    #[doc(alias = "nm_device_macsec_get_include_sci")]
460    #[doc(alias = "get_include_sci")]
461    #[doc(alias = "include-sci")]
462    pub fn is_include_sci(&self) -> bool {
463        unsafe {
464            from_glib(ffi::nm_device_macsec_get_include_sci(self.to_glib_none().0))
465        }
466    }
467
468    ///
469    /// # Returns
470    ///
471    /// the device's parent device
472    #[cfg(feature = "v1_42")]
473    #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
474    #[doc(alias = "nm_device_macsec_get_parent")]
475    #[doc(alias = "get_parent")]
476    pub fn parent(&self) -> Device {
477        unsafe {
478            from_glib_none(ffi::nm_device_macsec_get_parent(self.to_glib_none().0))
479        }
480    }
481
482    /// Gets whether protection of transmitted frames is enabled
483    ///
484    /// # Returns
485    ///
486    /// whether protection is enabled
487    #[doc(alias = "nm_device_macsec_get_protect")]
488    #[doc(alias = "get_protect")]
489    #[doc(alias = "protect")]
490    pub fn is_protect(&self) -> bool {
491        unsafe {
492            from_glib(ffi::nm_device_macsec_get_protect(self.to_glib_none().0))
493        }
494    }
495
496    /// Gets whether replay protection is enabled
497    ///
498    /// # Returns
499    ///
500    /// whether replay protection is enabled
501    #[doc(alias = "nm_device_macsec_get_replay_protect")]
502    #[doc(alias = "get_replay_protect")]
503    #[doc(alias = "replay-protect")]
504    pub fn is_replay_protect(&self) -> bool {
505        unsafe {
506            from_glib(ffi::nm_device_macsec_get_replay_protect(self.to_glib_none().0))
507        }
508    }
509
510    /// Gets whether the SCB (Single Copy Broadcast) bit is enabled in
511    /// SecTAG for transmitted frames
512    ///
513    /// # Returns
514    ///
515    /// whether the SCB (Single Copy Broadcast) bit is enabled
516    #[doc(alias = "nm_device_macsec_get_scb")]
517    #[doc(alias = "get_scb")]
518    #[doc(alias = "scb")]
519    pub fn is_scb(&self) -> bool {
520        unsafe {
521            from_glib(ffi::nm_device_macsec_get_scb(self.to_glib_none().0))
522        }
523    }
524
525    /// Gets the Secure Channel Identifier in use
526    ///
527    /// # Returns
528    ///
529    /// the SCI
530    #[doc(alias = "nm_device_macsec_get_sci")]
531    #[doc(alias = "get_sci")]
532    pub fn sci(&self) -> u64 {
533        unsafe {
534            ffi::nm_device_macsec_get_sci(self.to_glib_none().0)
535        }
536    }
537
538    /// Gets the validation mode for incoming packets (strict, check,
539    /// disabled)
540    ///
541    /// # Returns
542    ///
543    /// the validation mode
544    #[doc(alias = "nm_device_macsec_get_validation")]
545    #[doc(alias = "get_validation")]
546    pub fn validation(&self) -> glib::GString {
547        unsafe {
548            from_glib_none(ffi::nm_device_macsec_get_validation(self.to_glib_none().0))
549        }
550    }
551
552    /// Gets the size of the replay window
553    ///
554    /// # Returns
555    ///
556    /// size of the replay window
557    #[doc(alias = "nm_device_macsec_get_window")]
558    #[doc(alias = "get_window")]
559    pub fn window(&self) -> u32 {
560        unsafe {
561            ffi::nm_device_macsec_get_window(self.to_glib_none().0)
562        }
563    }
564
565    #[cfg(not(feature = "v1_42"))]
566    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_42"))))]
567    pub fn parent(&self) -> Option<Device> {
568        ObjectExt::property(self, "parent")
569    }
570
571    #[cfg(feature = "v1_6")]
572    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
573    #[doc(alias = "cipher-suite")]
574    pub fn connect_cipher_suite_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
575        unsafe extern "C" fn notify_cipher_suite_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
576            let f: &F = &*(f as *const F);
577            f(&from_glib_borrow(this))
578        }
579        unsafe {
580            let f: Box_<F> = Box_::new(f);
581            connect_raw(self.as_ptr() as *mut _, c"notify::cipher-suite".as_ptr() as *const _,
582                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_cipher_suite_trampoline::<F> as *const ())), Box_::into_raw(f))
583        }
584    }
585
586    #[cfg(feature = "v1_6")]
587    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
588    #[doc(alias = "encoding-sa")]
589    pub fn connect_encoding_sa_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
590        unsafe extern "C" fn notify_encoding_sa_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
591            let f: &F = &*(f as *const F);
592            f(&from_glib_borrow(this))
593        }
594        unsafe {
595            let f: Box_<F> = Box_::new(f);
596            connect_raw(self.as_ptr() as *mut _, c"notify::encoding-sa".as_ptr() as *const _,
597                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_encoding_sa_trampoline::<F> as *const ())), Box_::into_raw(f))
598        }
599    }
600
601    #[cfg(feature = "v1_6")]
602    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
603    #[doc(alias = "encrypt")]
604    pub fn connect_encrypt_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
605        unsafe extern "C" fn notify_encrypt_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
606            let f: &F = &*(f as *const F);
607            f(&from_glib_borrow(this))
608        }
609        unsafe {
610            let f: Box_<F> = Box_::new(f);
611            connect_raw(self.as_ptr() as *mut _, c"notify::encrypt".as_ptr() as *const _,
612                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_encrypt_trampoline::<F> as *const ())), Box_::into_raw(f))
613        }
614    }
615
616    #[cfg(feature = "v1_6")]
617    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
618    #[doc(alias = "es")]
619    pub fn connect_es_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
620        unsafe extern "C" fn notify_es_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
621            let f: &F = &*(f as *const F);
622            f(&from_glib_borrow(this))
623        }
624        unsafe {
625            let f: Box_<F> = Box_::new(f);
626            connect_raw(self.as_ptr() as *mut _, c"notify::es".as_ptr() as *const _,
627                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_es_trampoline::<F> as *const ())), Box_::into_raw(f))
628        }
629    }
630
631    #[cfg(feature = "v1_6")]
632    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
633    #[doc(alias = "icv-length")]
634    pub fn connect_icv_length_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
635        unsafe extern "C" fn notify_icv_length_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
636            let f: &F = &*(f as *const F);
637            f(&from_glib_borrow(this))
638        }
639        unsafe {
640            let f: Box_<F> = Box_::new(f);
641            connect_raw(self.as_ptr() as *mut _, c"notify::icv-length".as_ptr() as *const _,
642                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_icv_length_trampoline::<F> as *const ())), Box_::into_raw(f))
643        }
644    }
645
646    #[cfg(feature = "v1_6")]
647    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
648    #[doc(alias = "include-sci")]
649    pub fn connect_include_sci_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
650        unsafe extern "C" fn notify_include_sci_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
651            let f: &F = &*(f as *const F);
652            f(&from_glib_borrow(this))
653        }
654        unsafe {
655            let f: Box_<F> = Box_::new(f);
656            connect_raw(self.as_ptr() as *mut _, c"notify::include-sci".as_ptr() as *const _,
657                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_include_sci_trampoline::<F> as *const ())), Box_::into_raw(f))
658        }
659    }
660
661    #[cfg(feature = "v1_6")]
662    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
663    #[doc(alias = "parent")]
664    pub fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
665        unsafe extern "C" fn notify_parent_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
666            let f: &F = &*(f as *const F);
667            f(&from_glib_borrow(this))
668        }
669        unsafe {
670            let f: Box_<F> = Box_::new(f);
671            connect_raw(self.as_ptr() as *mut _, c"notify::parent".as_ptr() as *const _,
672                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_parent_trampoline::<F> as *const ())), Box_::into_raw(f))
673        }
674    }
675
676    #[cfg(feature = "v1_6")]
677    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
678    #[doc(alias = "protect")]
679    pub fn connect_protect_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
680        unsafe extern "C" fn notify_protect_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
681            let f: &F = &*(f as *const F);
682            f(&from_glib_borrow(this))
683        }
684        unsafe {
685            let f: Box_<F> = Box_::new(f);
686            connect_raw(self.as_ptr() as *mut _, c"notify::protect".as_ptr() as *const _,
687                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_protect_trampoline::<F> as *const ())), Box_::into_raw(f))
688        }
689    }
690
691    #[cfg(feature = "v1_6")]
692    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
693    #[doc(alias = "replay-protect")]
694    pub fn connect_replay_protect_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
695        unsafe extern "C" fn notify_replay_protect_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
696            let f: &F = &*(f as *const F);
697            f(&from_glib_borrow(this))
698        }
699        unsafe {
700            let f: Box_<F> = Box_::new(f);
701            connect_raw(self.as_ptr() as *mut _, c"notify::replay-protect".as_ptr() as *const _,
702                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_replay_protect_trampoline::<F> as *const ())), Box_::into_raw(f))
703        }
704    }
705
706    #[cfg(feature = "v1_6")]
707    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
708    #[doc(alias = "scb")]
709    pub fn connect_scb_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
710        unsafe extern "C" fn notify_scb_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
711            let f: &F = &*(f as *const F);
712            f(&from_glib_borrow(this))
713        }
714        unsafe {
715            let f: Box_<F> = Box_::new(f);
716            connect_raw(self.as_ptr() as *mut _, c"notify::scb".as_ptr() as *const _,
717                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_scb_trampoline::<F> as *const ())), Box_::into_raw(f))
718        }
719    }
720
721    #[cfg(feature = "v1_6")]
722    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
723    #[doc(alias = "sci")]
724    pub fn connect_sci_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
725        unsafe extern "C" fn notify_sci_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
726            let f: &F = &*(f as *const F);
727            f(&from_glib_borrow(this))
728        }
729        unsafe {
730            let f: Box_<F> = Box_::new(f);
731            connect_raw(self.as_ptr() as *mut _, c"notify::sci".as_ptr() as *const _,
732                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_sci_trampoline::<F> as *const ())), Box_::into_raw(f))
733        }
734    }
735
736    #[cfg(feature = "v1_6")]
737    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
738    #[doc(alias = "validation")]
739    pub fn connect_validation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
740        unsafe extern "C" fn notify_validation_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
741            let f: &F = &*(f as *const F);
742            f(&from_glib_borrow(this))
743        }
744        unsafe {
745            let f: Box_<F> = Box_::new(f);
746            connect_raw(self.as_ptr() as *mut _, c"notify::validation".as_ptr() as *const _,
747                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_validation_trampoline::<F> as *const ())), Box_::into_raw(f))
748        }
749    }
750
751    #[cfg(feature = "v1_6")]
752    #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
753    #[doc(alias = "window")]
754    pub fn connect_window_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
755        unsafe extern "C" fn notify_window_trampoline<F: Fn(&DeviceMacsec) + 'static>(this: *mut ffi::NMDeviceMacsec, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
756            let f: &F = &*(f as *const F);
757            f(&from_glib_borrow(this))
758        }
759        unsafe {
760            let f: Box_<F> = Box_::new(f);
761            connect_raw(self.as_ptr() as *mut _, c"notify::window".as_ptr() as *const _,
762                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_window_trampoline::<F> as *const ())), Box_::into_raw(f))
763        }
764    }
765}
766
767// rustdoc-stripper-ignore-next
768        /// A [builder-pattern] type to construct [`DeviceMacsec`] objects.
769        ///
770        /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
771#[must_use = "The builder must be built to be used"]
772pub struct DeviceMacsecBuilder {
773            builder: glib::object::ObjectBuilder<'static, DeviceMacsec>,
774        }
775
776        impl DeviceMacsecBuilder {
777        fn new() -> Self {
778            Self { builder: glib::object::Object::builder() }
779        }
780
781                            /// Whether the device can auto-activate a connection.
782                            ///
783                            /// The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
784                            pub fn autoconnect(self, autoconnect: bool) -> Self {
785                            Self { builder: self.builder.property("autoconnect", autoconnect), }
786                        }
787
788    // rustdoc-stripper-ignore-next
789    /// Build the [`DeviceMacsec`].
790    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
791    pub fn build(self) -> DeviceMacsec {
792assert_initialized_main_thread!();
793    self.builder.build() }
794}