nm_rs/auto/
setting_bridge.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir
3// from gtk-girs (https://github.com/gtk-rs/gir-files)
4// DO NOT EDIT
5
6#[cfg(feature = "v1_18")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
8use crate::BridgeVlan;
9use crate::{Setting, ffi};
10use glib::{
11    prelude::*,
12    signal::{SignalHandlerId, connect_raw},
13    translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18    /// Bridging Settings
19    ///
20    /// ## Properties
21    ///
22    ///
23    /// #### `ageing-time`
24    ///  The Ethernet MAC address aging time, in seconds.
25    ///
26    /// Readable | Writeable
27    ///
28    ///
29    /// #### `forward-delay`
30    ///  The Spanning Tree Protocol (STP) forwarding delay, in seconds.
31    ///
32    /// Readable | Writeable
33    ///
34    ///
35    /// #### `group-address`
36    ///  If specified, The MAC address of the multicast group this bridge uses for STP.
37    ///
38    /// The address must be a link-local address in standard Ethernet MAC address format,
39    /// ie an address of the form 01:80:C2:00:00:0X, with X in [0, 4..F].
40    /// If not specified the default value is 01:80:C2:00:00:00.
41    ///
42    /// Readable | Writeable
43    ///
44    ///
45    /// #### `group-forward-mask`
46    ///  A mask of group addresses to forward. Usually, group addresses in
47    /// the range from 01:80:C2:00:00:00 to 01:80:C2:00:00:0F are not
48    /// forwarded according to standards. This property is a mask of 16 bits,
49    /// each corresponding to a group address in that range that must be
50    /// forwarded. The mask can't have bits 0, 1 or 2 set because they are
51    /// used for STP, MAC pause frames and LACP.
52    ///
53    /// Readable | Writeable
54    ///
55    ///
56    /// #### `hello-time`
57    ///  The Spanning Tree Protocol (STP) hello time, in seconds.
58    ///
59    /// Readable | Writeable
60    ///
61    ///
62    /// #### `mac-address`
63    ///  If specified, the MAC address of bridge. When creating a new bridge, this
64    /// MAC address will be set.
65    ///
66    /// If this field is left unspecified, the "ethernet.cloned-mac-address" is
67    /// referred instead to generate the initial MAC address. Note that setting
68    /// "ethernet.cloned-mac-address" anyway overwrites the MAC address of
69    /// the bridge later while activating the bridge.
70    ///
71    /// Readable | Writeable
72    ///
73    ///
74    /// #### `max-age`
75    ///  The Spanning Tree Protocol (STP) maximum message age, in seconds.
76    ///
77    /// Readable | Writeable
78    ///
79    ///
80    /// #### `multicast-hash-max`
81    ///  Set maximum size of multicast hash table (value must be a power of 2).
82    ///
83    /// Readable | Writeable
84    ///
85    ///
86    /// #### `multicast-last-member-count`
87    ///  Set the number of queries the bridge will send before
88    /// stopping forwarding a multicast group after a "leave"
89    /// message has been received.
90    ///
91    /// Readable | Writeable
92    ///
93    ///
94    /// #### `multicast-last-member-interval`
95    ///  Set interval (in deciseconds) between queries to find remaining
96    /// members of a group, after a "leave" message is received.
97    ///
98    /// Readable | Writeable
99    ///
100    ///
101    /// #### `multicast-membership-interval`
102    ///  Set delay (in deciseconds) after which the bridge will
103    /// leave a group, if no membership reports for this
104    /// group are received.
105    ///
106    /// Readable | Writeable
107    ///
108    ///
109    /// #### `multicast-querier`
110    ///  Enable or disable sending of multicast queries by the bridge.
111    /// If not specified the option is disabled.
112    ///
113    /// Readable | Writeable
114    ///
115    ///
116    /// #### `multicast-querier-interval`
117    ///  If no queries are seen after this delay (in deciseconds) has passed,
118    /// the bridge will start to send its own queries.
119    ///
120    /// Readable | Writeable
121    ///
122    ///
123    /// #### `multicast-query-interval`
124    ///  Interval (in deciseconds) between queries sent
125    /// by the bridge after the end of the startup phase.
126    ///
127    /// Readable | Writeable
128    ///
129    ///
130    /// #### `multicast-query-response-interval`
131    ///  Set the Max Response Time/Max Response Delay
132    /// (in deciseconds) for IGMP/MLD queries sent by the bridge.
133    ///
134    /// Readable | Writeable
135    ///
136    ///
137    /// #### `multicast-query-use-ifaddr`
138    ///  If enabled the bridge's own IP address is used as
139    /// the source address for IGMP queries otherwise
140    /// the default of 0.0.0.0 is used.
141    ///
142    /// Readable | Writeable
143    ///
144    ///
145    /// #### `multicast-router`
146    ///  Sets bridge's multicast router. Multicast-snooping must be enabled
147    /// for this option to work.
148    ///
149    /// Supported values are: 'auto', 'disabled', 'enabled' to which kernel
150    /// assigns the numbers 1, 0, and 2, respectively.
151    /// If not specified the default value is 'auto' (1).
152    ///
153    /// Readable | Writeable
154    ///
155    ///
156    /// #### `multicast-snooping`
157    ///  Controls whether IGMP snooping is enabled for this bridge.
158    /// Note that if snooping was automatically disabled due to hash collisions,
159    /// the system may refuse to enable the feature until the collisions are
160    /// resolved.
161    ///
162    /// Readable | Writeable
163    ///
164    ///
165    /// #### `multicast-startup-query-count`
166    ///  Set the number of IGMP queries to send during startup phase.
167    ///
168    /// Readable | Writeable
169    ///
170    ///
171    /// #### `multicast-startup-query-interval`
172    ///  Sets the time (in deciseconds) between queries sent out
173    /// at startup to determine membership information.
174    ///
175    /// Readable | Writeable
176    ///
177    ///
178    /// #### `priority`
179    ///  Sets the Spanning Tree Protocol (STP) priority for this bridge.  Lower
180    /// values are "better"; the lowest priority bridge will be elected the root
181    /// bridge.
182    ///
183    /// Readable | Writeable
184    ///
185    ///
186    /// #### `stp`
187    ///  Controls whether Spanning Tree Protocol (STP) is enabled for this bridge.
188    ///
189    /// Readable | Writeable
190    ///
191    ///
192    /// #### `vlan-default-pvid`
193    ///  The default PVID for the ports of the bridge, that is the VLAN id
194    /// assigned to incoming untagged frames.
195    ///
196    /// Readable | Writeable
197    ///
198    ///
199    /// #### `vlan-filtering`
200    ///  Control whether VLAN filtering is enabled on the bridge.
201    ///
202    /// Readable | Writeable
203    ///
204    ///
205    /// #### `vlan-protocol`
206    ///  If specified, the protocol used for VLAN filtering.
207    ///
208    /// Supported values are: '802.1Q', '802.1ad'.
209    /// If not specified the default value is '802.1Q'.
210    ///
211    /// Readable | Writeable
212    ///
213    ///
214    /// #### `vlan-stats-enabled`
215    ///  Controls whether per-VLAN stats accounting is enabled.
216    ///
217    /// Readable | Writeable
218    ///
219    ///
220    /// #### `vlans`
221    ///  Array of bridge VLAN objects. In addition to the VLANs
222    /// specified here, the bridge will also have the default-pvid
223    /// VLAN configured  by the bridge.vlan-default-pvid property.
224    ///
225    /// In nmcli the VLAN list can be specified with the following
226    /// syntax:
227    ///
228    ///  $vid [pvid] [untagged] [, $vid [pvid] [untagged]]...
229    ///
230    /// where $vid is either a single id between 1 and 4094 or a
231    /// range, represented as a couple of ids separated by a dash.
232    ///
233    /// Readable | Writeable
234    /// <details><summary><h4>Setting</h4></summary>
235    ///
236    ///
237    /// #### `name`
238    ///  The setting's name, which uniquely identifies the setting within the
239    /// connection.  Each setting type has a name unique to that type, for
240    /// example "ppp" or "802-11-wireless" or "802-3-ethernet".
241    ///
242    /// Readable
243    /// </details>
244    ///
245    /// # Implements
246    ///
247    /// [`SettingExt`][trait@crate::prelude::SettingExt]
248    #[doc(alias = "NMSettingBridge")]
249    pub struct SettingBridge(Object<ffi::NMSettingBridge, ffi::NMSettingBridgeClass>) @extends Setting;
250
251    match fn {
252        type_ => || ffi::nm_setting_bridge_get_type(),
253    }
254}
255
256impl SettingBridge {
257    /// Creates a new #NMSettingBridge object with default values.
258    ///
259    /// # Returns
260    ///
261    /// the new empty #NMSettingBridge object
262    #[doc(alias = "nm_setting_bridge_new")]
263    pub fn new() -> SettingBridge {
264        assert_initialized_main_thread!();
265        unsafe { Setting::from_glib_full(ffi::nm_setting_bridge_new()).unsafe_cast() }
266    }
267
268    // rustdoc-stripper-ignore-next
269    /// Creates a new builder-pattern struct instance to construct [`SettingBridge`] objects.
270    ///
271    /// This method returns an instance of [`SettingBridgeBuilder`](crate::builders::SettingBridgeBuilder) which can be used to create [`SettingBridge`] objects.
272    pub fn builder() -> SettingBridgeBuilder {
273        SettingBridgeBuilder::new()
274    }
275
276    /// Appends a new vlan and associated information to the setting.  The
277    /// given vlan gets sealed and a reference to it is added.
278    /// ## `vlan`
279    /// the vlan to add
280    #[cfg(feature = "v1_18")]
281    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
282    #[doc(alias = "nm_setting_bridge_add_vlan")]
283    pub fn add_vlan(&self, vlan: &BridgeVlan) {
284        unsafe {
285            ffi::nm_setting_bridge_add_vlan(self.to_glib_none().0, vlan.to_glib_none().0);
286        }
287    }
288
289    /// Removes all configured VLANs.
290    #[cfg(feature = "v1_18")]
291    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
292    #[doc(alias = "nm_setting_bridge_clear_vlans")]
293    pub fn clear_vlans(&self) {
294        unsafe {
295            ffi::nm_setting_bridge_clear_vlans(self.to_glib_none().0);
296        }
297    }
298
299    ///
300    /// # Returns
301    ///
302    /// the #NMSettingBridge:ageing-time property of the setting
303    #[doc(alias = "nm_setting_bridge_get_ageing_time")]
304    #[doc(alias = "get_ageing_time")]
305    #[doc(alias = "ageing-time")]
306    pub fn ageing_time(&self) -> u32 {
307        unsafe { ffi::nm_setting_bridge_get_ageing_time(self.to_glib_none().0) }
308    }
309
310    ///
311    /// # Returns
312    ///
313    /// the #NMSettingBridge:forward-delay property of the setting
314    #[doc(alias = "nm_setting_bridge_get_forward_delay")]
315    #[doc(alias = "get_forward_delay")]
316    #[doc(alias = "forward-delay")]
317    pub fn forward_delay(&self) -> u16 {
318        unsafe { ffi::nm_setting_bridge_get_forward_delay(self.to_glib_none().0) }
319    }
320
321    ///
322    /// # Returns
323    ///
324    /// the #NMSettingBridge:group-address property of the setting
325    #[cfg(feature = "v1_24")]
326    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
327    #[doc(alias = "nm_setting_bridge_get_group_address")]
328    #[doc(alias = "get_group_address")]
329    #[doc(alias = "group-address")]
330    pub fn group_address(&self) -> glib::GString {
331        unsafe {
332            from_glib_none(ffi::nm_setting_bridge_get_group_address(
333                self.to_glib_none().0,
334            ))
335        }
336    }
337
338    ///
339    /// # Returns
340    ///
341    /// the #NMSettingBridge:group-forward-mask property of the setting
342    #[cfg(feature = "v1_10")]
343    #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
344    #[doc(alias = "nm_setting_bridge_get_group_forward_mask")]
345    #[doc(alias = "get_group_forward_mask")]
346    #[doc(alias = "group-forward-mask")]
347    pub fn group_forward_mask(&self) -> u16 {
348        unsafe { ffi::nm_setting_bridge_get_group_forward_mask(self.to_glib_none().0) }
349    }
350
351    ///
352    /// # Returns
353    ///
354    /// the #NMSettingBridge:hello-time property of the setting
355    #[doc(alias = "nm_setting_bridge_get_hello_time")]
356    #[doc(alias = "get_hello_time")]
357    #[doc(alias = "hello-time")]
358    pub fn hello_time(&self) -> u16 {
359        unsafe { ffi::nm_setting_bridge_get_hello_time(self.to_glib_none().0) }
360    }
361
362    ///
363    /// # Returns
364    ///
365    /// the #NMSettingBridge:mac-address property of the setting
366    #[doc(alias = "nm_setting_bridge_get_mac_address")]
367    #[doc(alias = "get_mac_address")]
368    #[doc(alias = "mac-address")]
369    pub fn mac_address(&self) -> glib::GString {
370        unsafe {
371            from_glib_none(ffi::nm_setting_bridge_get_mac_address(
372                self.to_glib_none().0,
373            ))
374        }
375    }
376
377    ///
378    /// # Returns
379    ///
380    /// the #NMSettingBridge:max-age property of the setting
381    #[doc(alias = "nm_setting_bridge_get_max_age")]
382    #[doc(alias = "get_max_age")]
383    #[doc(alias = "max-age")]
384    pub fn max_age(&self) -> u16 {
385        unsafe { ffi::nm_setting_bridge_get_max_age(self.to_glib_none().0) }
386    }
387
388    ///
389    /// # Returns
390    ///
391    /// the #NMSettingBridge:multicast-hash-max property of the setting
392    #[cfg(feature = "v1_26")]
393    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
394    #[doc(alias = "nm_setting_bridge_get_multicast_hash_max")]
395    #[doc(alias = "get_multicast_hash_max")]
396    #[doc(alias = "multicast-hash-max")]
397    pub fn multicast_hash_max(&self) -> u32 {
398        unsafe { ffi::nm_setting_bridge_get_multicast_hash_max(self.to_glib_none().0) }
399    }
400
401    ///
402    /// # Returns
403    ///
404    /// the #NMSettingBridge:multicast-last-member-count property of the setting
405    #[cfg(feature = "v1_26")]
406    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
407    #[doc(alias = "nm_setting_bridge_get_multicast_last_member_count")]
408    #[doc(alias = "get_multicast_last_member_count")]
409    #[doc(alias = "multicast-last-member-count")]
410    pub fn multicast_last_member_count(&self) -> u32 {
411        unsafe { ffi::nm_setting_bridge_get_multicast_last_member_count(self.to_glib_none().0) }
412    }
413
414    ///
415    /// # Returns
416    ///
417    /// the #NMSettingBridge:multicast-last-member-interval property of the setting
418    #[cfg(feature = "v1_26")]
419    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
420    #[doc(alias = "nm_setting_bridge_get_multicast_last_member_interval")]
421    #[doc(alias = "get_multicast_last_member_interval")]
422    #[doc(alias = "multicast-last-member-interval")]
423    pub fn multicast_last_member_interval(&self) -> u64 {
424        unsafe { ffi::nm_setting_bridge_get_multicast_last_member_interval(self.to_glib_none().0) }
425    }
426
427    ///
428    /// # Returns
429    ///
430    /// the #NMSettingBridge:multicast-membership-interval property of the setting
431    #[cfg(feature = "v1_26")]
432    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
433    #[doc(alias = "nm_setting_bridge_get_multicast_membership_interval")]
434    #[doc(alias = "get_multicast_membership_interval")]
435    #[doc(alias = "multicast-membership-interval")]
436    pub fn multicast_membership_interval(&self) -> u64 {
437        unsafe { ffi::nm_setting_bridge_get_multicast_membership_interval(self.to_glib_none().0) }
438    }
439
440    ///
441    /// # Returns
442    ///
443    /// the #NMSettingBridge:multicast-querier property of the setting
444    #[cfg(feature = "v1_24")]
445    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
446    #[doc(alias = "nm_setting_bridge_get_multicast_querier")]
447    #[doc(alias = "get_multicast_querier")]
448    #[doc(alias = "multicast-querier")]
449    pub fn is_multicast_querier(&self) -> bool {
450        unsafe {
451            from_glib(ffi::nm_setting_bridge_get_multicast_querier(
452                self.to_glib_none().0,
453            ))
454        }
455    }
456
457    ///
458    /// # Returns
459    ///
460    /// the #NMSettingBridge:multicast-querier-interval property of the setting
461    #[cfg(feature = "v1_26")]
462    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
463    #[doc(alias = "nm_setting_bridge_get_multicast_querier_interval")]
464    #[doc(alias = "get_multicast_querier_interval")]
465    #[doc(alias = "multicast-querier-interval")]
466    pub fn multicast_querier_interval(&self) -> u64 {
467        unsafe { ffi::nm_setting_bridge_get_multicast_querier_interval(self.to_glib_none().0) }
468    }
469
470    ///
471    /// # Returns
472    ///
473    /// the #NMSettingBridge:multicast-query-interval property of the setting
474    #[cfg(feature = "v1_26")]
475    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
476    #[doc(alias = "nm_setting_bridge_get_multicast_query_interval")]
477    #[doc(alias = "get_multicast_query_interval")]
478    #[doc(alias = "multicast-query-interval")]
479    pub fn multicast_query_interval(&self) -> u64 {
480        unsafe { ffi::nm_setting_bridge_get_multicast_query_interval(self.to_glib_none().0) }
481    }
482
483    ///
484    /// # Returns
485    ///
486    /// the #NMSettingBridge:multicast-query-response-interval property of the setting
487    #[cfg(feature = "v1_26")]
488    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
489    #[doc(alias = "nm_setting_bridge_get_multicast_query_response_interval")]
490    #[doc(alias = "get_multicast_query_response_interval")]
491    #[doc(alias = "multicast-query-response-interval")]
492    pub fn multicast_query_response_interval(&self) -> u64 {
493        unsafe {
494            ffi::nm_setting_bridge_get_multicast_query_response_interval(self.to_glib_none().0)
495        }
496    }
497
498    ///
499    /// # Returns
500    ///
501    /// the #NMSettingBridge:multicast-query-use-ifaddr property of the setting
502    #[cfg(feature = "v1_24")]
503    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
504    #[doc(alias = "nm_setting_bridge_get_multicast_query_use_ifaddr")]
505    #[doc(alias = "get_multicast_query_use_ifaddr")]
506    #[doc(alias = "multicast-query-use-ifaddr")]
507    pub fn is_multicast_query_use_ifaddr(&self) -> bool {
508        unsafe {
509            from_glib(ffi::nm_setting_bridge_get_multicast_query_use_ifaddr(
510                self.to_glib_none().0,
511            ))
512        }
513    }
514
515    ///
516    /// # Returns
517    ///
518    /// the #NMSettingBridge:multicast-router property of the setting
519    #[cfg(feature = "v1_24")]
520    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
521    #[doc(alias = "nm_setting_bridge_get_multicast_router")]
522    #[doc(alias = "get_multicast_router")]
523    #[doc(alias = "multicast-router")]
524    pub fn multicast_router(&self) -> glib::GString {
525        unsafe {
526            from_glib_none(ffi::nm_setting_bridge_get_multicast_router(
527                self.to_glib_none().0,
528            ))
529        }
530    }
531
532    ///
533    /// # Returns
534    ///
535    /// the #NMSettingBridge:multicast-snooping property of the setting
536    #[cfg(feature = "v1_2")]
537    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
538    #[doc(alias = "nm_setting_bridge_get_multicast_snooping")]
539    #[doc(alias = "get_multicast_snooping")]
540    #[doc(alias = "multicast-snooping")]
541    pub fn is_multicast_snooping(&self) -> bool {
542        unsafe {
543            from_glib(ffi::nm_setting_bridge_get_multicast_snooping(
544                self.to_glib_none().0,
545            ))
546        }
547    }
548
549    ///
550    /// # Returns
551    ///
552    /// the #NMSettingBridge:multicast-query-response-interval property of the setting
553    #[cfg(feature = "v1_26")]
554    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
555    #[doc(alias = "nm_setting_bridge_get_multicast_startup_query_count")]
556    #[doc(alias = "get_multicast_startup_query_count")]
557    #[doc(alias = "multicast-startup-query-count")]
558    pub fn multicast_startup_query_count(&self) -> u32 {
559        unsafe { ffi::nm_setting_bridge_get_multicast_startup_query_count(self.to_glib_none().0) }
560    }
561
562    ///
563    /// # Returns
564    ///
565    /// the #NMSettingBridge:multicast-startup-query-interval property of the setting
566    #[cfg(feature = "v1_26")]
567    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
568    #[doc(alias = "nm_setting_bridge_get_multicast_startup_query_interval")]
569    #[doc(alias = "get_multicast_startup_query_interval")]
570    #[doc(alias = "multicast-startup-query-interval")]
571    pub fn multicast_startup_query_interval(&self) -> u64 {
572        unsafe {
573            ffi::nm_setting_bridge_get_multicast_startup_query_interval(self.to_glib_none().0)
574        }
575    }
576
577    ///
578    /// # Returns
579    ///
580    /// the number of VLANs
581    #[cfg(feature = "v1_18")]
582    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
583    #[doc(alias = "nm_setting_bridge_get_num_vlans")]
584    #[doc(alias = "get_num_vlans")]
585    pub fn num_vlans(&self) -> u32 {
586        unsafe { ffi::nm_setting_bridge_get_num_vlans(self.to_glib_none().0) }
587    }
588
589    ///
590    /// # Returns
591    ///
592    /// the #NMSettingBridge:priority property of the setting
593    #[doc(alias = "nm_setting_bridge_get_priority")]
594    #[doc(alias = "get_priority")]
595    pub fn priority(&self) -> u16 {
596        unsafe { ffi::nm_setting_bridge_get_priority(self.to_glib_none().0) }
597    }
598
599    ///
600    /// # Returns
601    ///
602    /// the #NMSettingBridge:stp property of the setting
603    #[doc(alias = "nm_setting_bridge_get_stp")]
604    #[doc(alias = "get_stp")]
605    #[doc(alias = "stp")]
606    pub fn is_stp(&self) -> bool {
607        unsafe { from_glib(ffi::nm_setting_bridge_get_stp(self.to_glib_none().0)) }
608    }
609
610    /// ## `idx`
611    /// index number of the VLAN to return
612    ///
613    /// # Returns
614    ///
615    /// the VLAN at index @idx
616    #[cfg(feature = "v1_18")]
617    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
618    #[doc(alias = "nm_setting_bridge_get_vlan")]
619    #[doc(alias = "get_vlan")]
620    pub fn vlan(&self, idx: u32) -> BridgeVlan {
621        unsafe { from_glib_none(ffi::nm_setting_bridge_get_vlan(self.to_glib_none().0, idx)) }
622    }
623
624    ///
625    /// # Returns
626    ///
627    /// the #NMSettingBridge:vlan-default-pvid property of the setting
628    #[cfg(feature = "v1_18")]
629    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
630    #[doc(alias = "nm_setting_bridge_get_vlan_default_pvid")]
631    #[doc(alias = "get_vlan_default_pvid")]
632    #[doc(alias = "vlan-default-pvid")]
633    pub fn vlan_default_pvid(&self) -> u16 {
634        unsafe { ffi::nm_setting_bridge_get_vlan_default_pvid(self.to_glib_none().0) }
635    }
636
637    ///
638    /// # Returns
639    ///
640    /// the #NMSettingBridge:vlan-filtering property of the setting
641    #[cfg(feature = "v1_18")]
642    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
643    #[doc(alias = "nm_setting_bridge_get_vlan_filtering")]
644    #[doc(alias = "get_vlan_filtering")]
645    #[doc(alias = "vlan-filtering")]
646    pub fn is_vlan_filtering(&self) -> bool {
647        unsafe {
648            from_glib(ffi::nm_setting_bridge_get_vlan_filtering(
649                self.to_glib_none().0,
650            ))
651        }
652    }
653
654    ///
655    /// # Returns
656    ///
657    /// the #NMSettingBridge:vlan-protocol property of the setting
658    #[cfg(feature = "v1_24")]
659    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
660    #[doc(alias = "nm_setting_bridge_get_vlan_protocol")]
661    #[doc(alias = "get_vlan_protocol")]
662    #[doc(alias = "vlan-protocol")]
663    pub fn vlan_protocol(&self) -> glib::GString {
664        unsafe {
665            from_glib_none(ffi::nm_setting_bridge_get_vlan_protocol(
666                self.to_glib_none().0,
667            ))
668        }
669    }
670
671    ///
672    /// # Returns
673    ///
674    /// the #NMSettingBridge:vlan-stats-enabled property of the setting
675    #[cfg(feature = "v1_24")]
676    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
677    #[doc(alias = "nm_setting_bridge_get_vlan_stats_enabled")]
678    #[doc(alias = "get_vlan_stats_enabled")]
679    #[doc(alias = "vlan-stats-enabled")]
680    pub fn is_vlan_stats_enabled(&self) -> bool {
681        unsafe {
682            from_glib(ffi::nm_setting_bridge_get_vlan_stats_enabled(
683                self.to_glib_none().0,
684            ))
685        }
686    }
687
688    /// Removes the vlan at index @idx.
689    /// ## `idx`
690    /// index number of the VLAN.
691    #[cfg(feature = "v1_18")]
692    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
693    #[doc(alias = "nm_setting_bridge_remove_vlan")]
694    pub fn remove_vlan(&self, idx: u32) {
695        unsafe {
696            ffi::nm_setting_bridge_remove_vlan(self.to_glib_none().0, idx);
697        }
698    }
699
700    /// Remove the VLAN with range @vid_start to @vid_end.
701    /// If @vid_end is zero, it is assumed to be equal to @vid_start
702    /// and so the single-id VLAN with id @vid_start is removed.
703    /// ## `vid_start`
704    /// the vlan start index
705    /// ## `vid_end`
706    /// the vlan end index
707    ///
708    /// # Returns
709    ///
710    /// [`true`] if the vlan was found and removed; [`false`] otherwise
711    #[cfg(feature = "v1_18")]
712    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
713    #[doc(alias = "nm_setting_bridge_remove_vlan_by_vid")]
714    pub fn remove_vlan_by_vid(&self, vid_start: u16, vid_end: u16) -> bool {
715        unsafe {
716            from_glib(ffi::nm_setting_bridge_remove_vlan_by_vid(
717                self.to_glib_none().0,
718                vid_start,
719                vid_end,
720            ))
721        }
722    }
723
724    /// The Ethernet MAC address aging time, in seconds.
725    #[doc(alias = "ageing-time")]
726    pub fn set_ageing_time(&self, ageing_time: u32) {
727        ObjectExt::set_property(self, "ageing-time", ageing_time)
728    }
729
730    /// The Spanning Tree Protocol (STP) forwarding delay, in seconds.
731    #[doc(alias = "forward-delay")]
732    pub fn set_forward_delay(&self, forward_delay: u32) {
733        ObjectExt::set_property(self, "forward-delay", forward_delay)
734    }
735
736    /// If specified, The MAC address of the multicast group this bridge uses for STP.
737    ///
738    /// The address must be a link-local address in standard Ethernet MAC address format,
739    /// ie an address of the form 01:80:C2:00:00:0X, with X in [0, 4..F].
740    /// If not specified the default value is 01:80:C2:00:00:00.
741    #[cfg(feature = "v1_24")]
742    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
743    #[doc(alias = "group-address")]
744    pub fn set_group_address(&self, group_address: Option<&str>) {
745        ObjectExt::set_property(self, "group-address", group_address)
746    }
747
748    /// A mask of group addresses to forward. Usually, group addresses in
749    /// the range from 01:80:C2:00:00:00 to 01:80:C2:00:00:0F are not
750    /// forwarded according to standards. This property is a mask of 16 bits,
751    /// each corresponding to a group address in that range that must be
752    /// forwarded. The mask can't have bits 0, 1 or 2 set because they are
753    /// used for STP, MAC pause frames and LACP.
754    #[cfg(feature = "v1_10")]
755    #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
756    #[doc(alias = "group-forward-mask")]
757    pub fn set_group_forward_mask(&self, group_forward_mask: u32) {
758        ObjectExt::set_property(self, "group-forward-mask", group_forward_mask)
759    }
760
761    /// The Spanning Tree Protocol (STP) hello time, in seconds.
762    #[doc(alias = "hello-time")]
763    pub fn set_hello_time(&self, hello_time: u32) {
764        ObjectExt::set_property(self, "hello-time", hello_time)
765    }
766
767    /// If specified, the MAC address of bridge. When creating a new bridge, this
768    /// MAC address will be set.
769    ///
770    /// If this field is left unspecified, the "ethernet.cloned-mac-address" is
771    /// referred instead to generate the initial MAC address. Note that setting
772    /// "ethernet.cloned-mac-address" anyway overwrites the MAC address of
773    /// the bridge later while activating the bridge.
774    ///
775    /// # Deprecated since 1.12
776    ///
777    /// Use the #NMSettingWired:cloned-mac-address property instead.
778    #[cfg_attr(feature = "v1_12", deprecated = "Since 1.12")]
779    #[doc(alias = "mac-address")]
780    pub fn set_mac_address(&self, mac_address: Option<&str>) {
781        ObjectExt::set_property(self, "mac-address", mac_address)
782    }
783
784    /// The Spanning Tree Protocol (STP) maximum message age, in seconds.
785    #[doc(alias = "max-age")]
786    pub fn set_max_age(&self, max_age: u32) {
787        ObjectExt::set_property(self, "max-age", max_age)
788    }
789
790    #[cfg(not(feature = "v1_26"))]
791    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_26"))))]
792    #[doc(alias = "multicast-hash-max")]
793    pub fn multicast_hash_max(&self) -> u32 {
794        ObjectExt::property(self, "multicast-hash-max")
795    }
796
797    /// Set maximum size of multicast hash table (value must be a power of 2).
798    #[doc(alias = "multicast-hash-max")]
799    pub fn set_multicast_hash_max(&self, multicast_hash_max: u32) {
800        ObjectExt::set_property(self, "multicast-hash-max", multicast_hash_max)
801    }
802
803    #[cfg(not(feature = "v1_26"))]
804    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_26"))))]
805    #[doc(alias = "multicast-last-member-count")]
806    pub fn multicast_last_member_count(&self) -> u32 {
807        ObjectExt::property(self, "multicast-last-member-count")
808    }
809
810    /// Set the number of queries the bridge will send before
811    /// stopping forwarding a multicast group after a "leave"
812    /// message has been received.
813    #[doc(alias = "multicast-last-member-count")]
814    pub fn set_multicast_last_member_count(&self, multicast_last_member_count: u32) {
815        ObjectExt::set_property(
816            self,
817            "multicast-last-member-count",
818            multicast_last_member_count,
819        )
820    }
821
822    #[cfg(not(feature = "v1_26"))]
823    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_26"))))]
824    #[doc(alias = "multicast-last-member-interval")]
825    pub fn multicast_last_member_interval(&self) -> u64 {
826        ObjectExt::property(self, "multicast-last-member-interval")
827    }
828
829    /// Set interval (in deciseconds) between queries to find remaining
830    /// members of a group, after a "leave" message is received.
831    #[doc(alias = "multicast-last-member-interval")]
832    pub fn set_multicast_last_member_interval(&self, multicast_last_member_interval: u64) {
833        ObjectExt::set_property(
834            self,
835            "multicast-last-member-interval",
836            multicast_last_member_interval,
837        )
838    }
839
840    #[cfg(not(feature = "v1_26"))]
841    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_26"))))]
842    #[doc(alias = "multicast-membership-interval")]
843    pub fn multicast_membership_interval(&self) -> u64 {
844        ObjectExt::property(self, "multicast-membership-interval")
845    }
846
847    /// Set delay (in deciseconds) after which the bridge will
848    /// leave a group, if no membership reports for this
849    /// group are received.
850    #[doc(alias = "multicast-membership-interval")]
851    pub fn set_multicast_membership_interval(&self, multicast_membership_interval: u64) {
852        ObjectExt::set_property(
853            self,
854            "multicast-membership-interval",
855            multicast_membership_interval,
856        )
857    }
858
859    #[cfg(not(feature = "v1_24"))]
860    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_24"))))]
861    #[doc(alias = "multicast-querier")]
862    pub fn is_multicast_querier(&self) -> bool {
863        ObjectExt::property(self, "multicast-querier")
864    }
865
866    /// Enable or disable sending of multicast queries by the bridge.
867    /// If not specified the option is disabled.
868    #[doc(alias = "multicast-querier")]
869    pub fn set_multicast_querier(&self, multicast_querier: bool) {
870        ObjectExt::set_property(self, "multicast-querier", multicast_querier)
871    }
872
873    #[cfg(not(feature = "v1_26"))]
874    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_26"))))]
875    #[doc(alias = "multicast-querier-interval")]
876    pub fn multicast_querier_interval(&self) -> u64 {
877        ObjectExt::property(self, "multicast-querier-interval")
878    }
879
880    /// If no queries are seen after this delay (in deciseconds) has passed,
881    /// the bridge will start to send its own queries.
882    #[doc(alias = "multicast-querier-interval")]
883    pub fn set_multicast_querier_interval(&self, multicast_querier_interval: u64) {
884        ObjectExt::set_property(
885            self,
886            "multicast-querier-interval",
887            multicast_querier_interval,
888        )
889    }
890
891    #[cfg(not(feature = "v1_26"))]
892    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_26"))))]
893    #[doc(alias = "multicast-query-interval")]
894    pub fn multicast_query_interval(&self) -> u64 {
895        ObjectExt::property(self, "multicast-query-interval")
896    }
897
898    /// Interval (in deciseconds) between queries sent
899    /// by the bridge after the end of the startup phase.
900    #[doc(alias = "multicast-query-interval")]
901    pub fn set_multicast_query_interval(&self, multicast_query_interval: u64) {
902        ObjectExt::set_property(self, "multicast-query-interval", multicast_query_interval)
903    }
904
905    #[cfg(not(feature = "v1_26"))]
906    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_26"))))]
907    #[doc(alias = "multicast-query-response-interval")]
908    pub fn multicast_query_response_interval(&self) -> u64 {
909        ObjectExt::property(self, "multicast-query-response-interval")
910    }
911
912    /// Set the Max Response Time/Max Response Delay
913    /// (in deciseconds) for IGMP/MLD queries sent by the bridge.
914    #[doc(alias = "multicast-query-response-interval")]
915    pub fn set_multicast_query_response_interval(&self, multicast_query_response_interval: u64) {
916        ObjectExt::set_property(
917            self,
918            "multicast-query-response-interval",
919            multicast_query_response_interval,
920        )
921    }
922
923    #[cfg(not(feature = "v1_24"))]
924    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_24"))))]
925    #[doc(alias = "multicast-query-use-ifaddr")]
926    pub fn is_multicast_query_use_ifaddr(&self) -> bool {
927        ObjectExt::property(self, "multicast-query-use-ifaddr")
928    }
929
930    /// If enabled the bridge's own IP address is used as
931    /// the source address for IGMP queries otherwise
932    /// the default of 0.0.0.0 is used.
933    #[doc(alias = "multicast-query-use-ifaddr")]
934    pub fn set_multicast_query_use_ifaddr(&self, multicast_query_use_ifaddr: bool) {
935        ObjectExt::set_property(
936            self,
937            "multicast-query-use-ifaddr",
938            multicast_query_use_ifaddr,
939        )
940    }
941
942    #[cfg(not(feature = "v1_24"))]
943    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_24"))))]
944    #[doc(alias = "multicast-router")]
945    pub fn multicast_router(&self) -> Option<glib::GString> {
946        ObjectExt::property(self, "multicast-router")
947    }
948
949    /// Sets bridge's multicast router. Multicast-snooping must be enabled
950    /// for this option to work.
951    ///
952    /// Supported values are: 'auto', 'disabled', 'enabled' to which kernel
953    /// assigns the numbers 1, 0, and 2, respectively.
954    /// If not specified the default value is 'auto' (1).
955    #[doc(alias = "multicast-router")]
956    pub fn set_multicast_router(&self, multicast_router: Option<&str>) {
957        ObjectExt::set_property(self, "multicast-router", multicast_router)
958    }
959
960    /// Controls whether IGMP snooping is enabled for this bridge.
961    /// Note that if snooping was automatically disabled due to hash collisions,
962    /// the system may refuse to enable the feature until the collisions are
963    /// resolved.
964    #[cfg(feature = "v1_2")]
965    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
966    #[doc(alias = "multicast-snooping")]
967    pub fn set_multicast_snooping(&self, multicast_snooping: bool) {
968        ObjectExt::set_property(self, "multicast-snooping", multicast_snooping)
969    }
970
971    #[cfg(not(feature = "v1_26"))]
972    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_26"))))]
973    #[doc(alias = "multicast-startup-query-count")]
974    pub fn multicast_startup_query_count(&self) -> u32 {
975        ObjectExt::property(self, "multicast-startup-query-count")
976    }
977
978    /// Set the number of IGMP queries to send during startup phase.
979    #[doc(alias = "multicast-startup-query-count")]
980    pub fn set_multicast_startup_query_count(&self, multicast_startup_query_count: u32) {
981        ObjectExt::set_property(
982            self,
983            "multicast-startup-query-count",
984            multicast_startup_query_count,
985        )
986    }
987
988    #[cfg(not(feature = "v1_26"))]
989    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_26"))))]
990    #[doc(alias = "multicast-startup-query-interval")]
991    pub fn multicast_startup_query_interval(&self) -> u64 {
992        ObjectExt::property(self, "multicast-startup-query-interval")
993    }
994
995    /// Sets the time (in deciseconds) between queries sent out
996    /// at startup to determine membership information.
997    #[doc(alias = "multicast-startup-query-interval")]
998    pub fn set_multicast_startup_query_interval(&self, multicast_startup_query_interval: u64) {
999        ObjectExt::set_property(
1000            self,
1001            "multicast-startup-query-interval",
1002            multicast_startup_query_interval,
1003        )
1004    }
1005
1006    /// Sets the Spanning Tree Protocol (STP) priority for this bridge.  Lower
1007    /// values are "better"; the lowest priority bridge will be elected the root
1008    /// bridge.
1009    pub fn set_priority(&self, priority: u32) {
1010        ObjectExt::set_property(self, "priority", priority)
1011    }
1012
1013    /// Controls whether Spanning Tree Protocol (STP) is enabled for this bridge.
1014    pub fn set_stp(&self, stp: bool) {
1015        ObjectExt::set_property(self, "stp", stp)
1016    }
1017
1018    /// The default PVID for the ports of the bridge, that is the VLAN id
1019    /// assigned to incoming untagged frames.
1020    #[cfg(feature = "v1_18")]
1021    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1022    #[doc(alias = "vlan-default-pvid")]
1023    pub fn set_vlan_default_pvid(&self, vlan_default_pvid: u32) {
1024        ObjectExt::set_property(self, "vlan-default-pvid", vlan_default_pvid)
1025    }
1026
1027    /// Control whether VLAN filtering is enabled on the bridge.
1028    #[cfg(feature = "v1_18")]
1029    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1030    #[doc(alias = "vlan-filtering")]
1031    pub fn set_vlan_filtering(&self, vlan_filtering: bool) {
1032        ObjectExt::set_property(self, "vlan-filtering", vlan_filtering)
1033    }
1034
1035    /// If specified, the protocol used for VLAN filtering.
1036    ///
1037    /// Supported values are: '802.1Q', '802.1ad'.
1038    /// If not specified the default value is '802.1Q'.
1039    #[cfg(feature = "v1_24")]
1040    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1041    #[doc(alias = "vlan-protocol")]
1042    pub fn set_vlan_protocol(&self, vlan_protocol: Option<&str>) {
1043        ObjectExt::set_property(self, "vlan-protocol", vlan_protocol)
1044    }
1045
1046    #[cfg(not(feature = "v1_24"))]
1047    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_24"))))]
1048    #[doc(alias = "vlan-stats-enabled")]
1049    pub fn is_vlan_stats_enabled(&self) -> bool {
1050        ObjectExt::property(self, "vlan-stats-enabled")
1051    }
1052
1053    /// Controls whether per-VLAN stats accounting is enabled.
1054    #[doc(alias = "vlan-stats-enabled")]
1055    pub fn set_vlan_stats_enabled(&self, vlan_stats_enabled: bool) {
1056        ObjectExt::set_property(self, "vlan-stats-enabled", vlan_stats_enabled)
1057    }
1058
1059    /// Array of bridge VLAN objects. In addition to the VLANs
1060    /// specified here, the bridge will also have the default-pvid
1061    /// VLAN configured  by the bridge.vlan-default-pvid property.
1062    ///
1063    /// In nmcli the VLAN list can be specified with the following
1064    /// syntax:
1065    ///
1066    ///  $vid [pvid] [untagged] [, $vid [pvid] [untagged]]...
1067    ///
1068    /// where $vid is either a single id between 1 and 4094 or a
1069    /// range, represented as a couple of ids separated by a dash.
1070    #[cfg(feature = "v1_18")]
1071    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1072    pub fn vlans(&self) -> Vec<BridgeVlan> {
1073        let vals = ObjectExt::property::<glib::ValueArray>(self, "vlans");
1074        vals.into_iter()
1075            .map(|v| unsafe {
1076                use glib::value::FromValue;
1077
1078                BridgeVlan::from_value(v)
1079            })
1080            .collect()
1081    }
1082
1083    /// Array of bridge VLAN objects. In addition to the VLANs
1084    /// specified here, the bridge will also have the default-pvid
1085    /// VLAN configured  by the bridge.vlan-default-pvid property.
1086    ///
1087    /// In nmcli the VLAN list can be specified with the following
1088    /// syntax:
1089    ///
1090    ///  $vid [pvid] [untagged] [, $vid [pvid] [untagged]]...
1091    ///
1092    /// where $vid is either a single id between 1 and 4094 or a
1093    /// range, represented as a couple of ids separated by a dash.
1094    #[cfg(feature = "v1_18")]
1095    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1096    pub fn set_vlans(&self, vlans: &[&BridgeVlan]) {
1097        ObjectExt::set_property(
1098            self,
1099            "vlans",
1100            vlans
1101                .iter()
1102                .map(|vlan| vlan.to_value())
1103                .collect::<glib::ValueArray>(),
1104        )
1105    }
1106
1107    #[doc(alias = "ageing-time")]
1108    pub fn connect_ageing_time_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1109        unsafe extern "C" fn notify_ageing_time_trampoline<F: Fn(&SettingBridge) + 'static>(
1110            this: *mut ffi::NMSettingBridge,
1111            _param_spec: glib::ffi::gpointer,
1112            f: glib::ffi::gpointer,
1113        ) {
1114            let f: &F = &*(f as *const F);
1115            f(&from_glib_borrow(this))
1116        }
1117        unsafe {
1118            let f: Box_<F> = Box_::new(f);
1119            connect_raw(
1120                self.as_ptr() as *mut _,
1121                c"notify::ageing-time".as_ptr() as *const _,
1122                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1123                    notify_ageing_time_trampoline::<F> as *const (),
1124                )),
1125                Box_::into_raw(f),
1126            )
1127        }
1128    }
1129
1130    #[doc(alias = "forward-delay")]
1131    pub fn connect_forward_delay_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1132        unsafe extern "C" fn notify_forward_delay_trampoline<F: Fn(&SettingBridge) + 'static>(
1133            this: *mut ffi::NMSettingBridge,
1134            _param_spec: glib::ffi::gpointer,
1135            f: glib::ffi::gpointer,
1136        ) {
1137            let f: &F = &*(f as *const F);
1138            f(&from_glib_borrow(this))
1139        }
1140        unsafe {
1141            let f: Box_<F> = Box_::new(f);
1142            connect_raw(
1143                self.as_ptr() as *mut _,
1144                c"notify::forward-delay".as_ptr() as *const _,
1145                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1146                    notify_forward_delay_trampoline::<F> as *const (),
1147                )),
1148                Box_::into_raw(f),
1149            )
1150        }
1151    }
1152
1153    #[cfg(feature = "v1_24")]
1154    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1155    #[doc(alias = "group-address")]
1156    pub fn connect_group_address_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1157        unsafe extern "C" fn notify_group_address_trampoline<F: Fn(&SettingBridge) + 'static>(
1158            this: *mut ffi::NMSettingBridge,
1159            _param_spec: glib::ffi::gpointer,
1160            f: glib::ffi::gpointer,
1161        ) {
1162            let f: &F = &*(f as *const F);
1163            f(&from_glib_borrow(this))
1164        }
1165        unsafe {
1166            let f: Box_<F> = Box_::new(f);
1167            connect_raw(
1168                self.as_ptr() as *mut _,
1169                c"notify::group-address".as_ptr() as *const _,
1170                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1171                    notify_group_address_trampoline::<F> as *const (),
1172                )),
1173                Box_::into_raw(f),
1174            )
1175        }
1176    }
1177
1178    #[cfg(feature = "v1_10")]
1179    #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
1180    #[doc(alias = "group-forward-mask")]
1181    pub fn connect_group_forward_mask_notify<F: Fn(&Self) + 'static>(
1182        &self,
1183        f: F,
1184    ) -> SignalHandlerId {
1185        unsafe extern "C" fn notify_group_forward_mask_trampoline<
1186            F: Fn(&SettingBridge) + 'static,
1187        >(
1188            this: *mut ffi::NMSettingBridge,
1189            _param_spec: glib::ffi::gpointer,
1190            f: glib::ffi::gpointer,
1191        ) {
1192            let f: &F = &*(f as *const F);
1193            f(&from_glib_borrow(this))
1194        }
1195        unsafe {
1196            let f: Box_<F> = Box_::new(f);
1197            connect_raw(
1198                self.as_ptr() as *mut _,
1199                c"notify::group-forward-mask".as_ptr() as *const _,
1200                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1201                    notify_group_forward_mask_trampoline::<F> as *const (),
1202                )),
1203                Box_::into_raw(f),
1204            )
1205        }
1206    }
1207
1208    #[doc(alias = "hello-time")]
1209    pub fn connect_hello_time_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1210        unsafe extern "C" fn notify_hello_time_trampoline<F: Fn(&SettingBridge) + 'static>(
1211            this: *mut ffi::NMSettingBridge,
1212            _param_spec: glib::ffi::gpointer,
1213            f: glib::ffi::gpointer,
1214        ) {
1215            let f: &F = &*(f as *const F);
1216            f(&from_glib_borrow(this))
1217        }
1218        unsafe {
1219            let f: Box_<F> = Box_::new(f);
1220            connect_raw(
1221                self.as_ptr() as *mut _,
1222                c"notify::hello-time".as_ptr() as *const _,
1223                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1224                    notify_hello_time_trampoline::<F> as *const (),
1225                )),
1226                Box_::into_raw(f),
1227            )
1228        }
1229    }
1230
1231    #[cfg_attr(feature = "v1_12", deprecated = "Since 1.12")]
1232    #[doc(alias = "mac-address")]
1233    pub fn connect_mac_address_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1234        unsafe extern "C" fn notify_mac_address_trampoline<F: Fn(&SettingBridge) + 'static>(
1235            this: *mut ffi::NMSettingBridge,
1236            _param_spec: glib::ffi::gpointer,
1237            f: glib::ffi::gpointer,
1238        ) {
1239            let f: &F = &*(f as *const F);
1240            f(&from_glib_borrow(this))
1241        }
1242        unsafe {
1243            let f: Box_<F> = Box_::new(f);
1244            connect_raw(
1245                self.as_ptr() as *mut _,
1246                c"notify::mac-address".as_ptr() as *const _,
1247                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1248                    notify_mac_address_trampoline::<F> as *const (),
1249                )),
1250                Box_::into_raw(f),
1251            )
1252        }
1253    }
1254
1255    #[doc(alias = "max-age")]
1256    pub fn connect_max_age_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1257        unsafe extern "C" fn notify_max_age_trampoline<F: Fn(&SettingBridge) + 'static>(
1258            this: *mut ffi::NMSettingBridge,
1259            _param_spec: glib::ffi::gpointer,
1260            f: glib::ffi::gpointer,
1261        ) {
1262            let f: &F = &*(f as *const F);
1263            f(&from_glib_borrow(this))
1264        }
1265        unsafe {
1266            let f: Box_<F> = Box_::new(f);
1267            connect_raw(
1268                self.as_ptr() as *mut _,
1269                c"notify::max-age".as_ptr() as *const _,
1270                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1271                    notify_max_age_trampoline::<F> as *const (),
1272                )),
1273                Box_::into_raw(f),
1274            )
1275        }
1276    }
1277
1278    #[doc(alias = "multicast-hash-max")]
1279    pub fn connect_multicast_hash_max_notify<F: Fn(&Self) + 'static>(
1280        &self,
1281        f: F,
1282    ) -> SignalHandlerId {
1283        unsafe extern "C" fn notify_multicast_hash_max_trampoline<
1284            F: Fn(&SettingBridge) + 'static,
1285        >(
1286            this: *mut ffi::NMSettingBridge,
1287            _param_spec: glib::ffi::gpointer,
1288            f: glib::ffi::gpointer,
1289        ) {
1290            let f: &F = &*(f as *const F);
1291            f(&from_glib_borrow(this))
1292        }
1293        unsafe {
1294            let f: Box_<F> = Box_::new(f);
1295            connect_raw(
1296                self.as_ptr() as *mut _,
1297                c"notify::multicast-hash-max".as_ptr() as *const _,
1298                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1299                    notify_multicast_hash_max_trampoline::<F> as *const (),
1300                )),
1301                Box_::into_raw(f),
1302            )
1303        }
1304    }
1305
1306    #[doc(alias = "multicast-last-member-count")]
1307    pub fn connect_multicast_last_member_count_notify<F: Fn(&Self) + 'static>(
1308        &self,
1309        f: F,
1310    ) -> SignalHandlerId {
1311        unsafe extern "C" fn notify_multicast_last_member_count_trampoline<
1312            F: Fn(&SettingBridge) + 'static,
1313        >(
1314            this: *mut ffi::NMSettingBridge,
1315            _param_spec: glib::ffi::gpointer,
1316            f: glib::ffi::gpointer,
1317        ) {
1318            let f: &F = &*(f as *const F);
1319            f(&from_glib_borrow(this))
1320        }
1321        unsafe {
1322            let f: Box_<F> = Box_::new(f);
1323            connect_raw(
1324                self.as_ptr() as *mut _,
1325                c"notify::multicast-last-member-count".as_ptr() as *const _,
1326                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1327                    notify_multicast_last_member_count_trampoline::<F> as *const (),
1328                )),
1329                Box_::into_raw(f),
1330            )
1331        }
1332    }
1333
1334    #[doc(alias = "multicast-last-member-interval")]
1335    pub fn connect_multicast_last_member_interval_notify<F: Fn(&Self) + 'static>(
1336        &self,
1337        f: F,
1338    ) -> SignalHandlerId {
1339        unsafe extern "C" fn notify_multicast_last_member_interval_trampoline<
1340            F: Fn(&SettingBridge) + 'static,
1341        >(
1342            this: *mut ffi::NMSettingBridge,
1343            _param_spec: glib::ffi::gpointer,
1344            f: glib::ffi::gpointer,
1345        ) {
1346            let f: &F = &*(f as *const F);
1347            f(&from_glib_borrow(this))
1348        }
1349        unsafe {
1350            let f: Box_<F> = Box_::new(f);
1351            connect_raw(
1352                self.as_ptr() as *mut _,
1353                c"notify::multicast-last-member-interval".as_ptr() as *const _,
1354                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1355                    notify_multicast_last_member_interval_trampoline::<F> as *const (),
1356                )),
1357                Box_::into_raw(f),
1358            )
1359        }
1360    }
1361
1362    #[doc(alias = "multicast-membership-interval")]
1363    pub fn connect_multicast_membership_interval_notify<F: Fn(&Self) + 'static>(
1364        &self,
1365        f: F,
1366    ) -> SignalHandlerId {
1367        unsafe extern "C" fn notify_multicast_membership_interval_trampoline<
1368            F: Fn(&SettingBridge) + 'static,
1369        >(
1370            this: *mut ffi::NMSettingBridge,
1371            _param_spec: glib::ffi::gpointer,
1372            f: glib::ffi::gpointer,
1373        ) {
1374            let f: &F = &*(f as *const F);
1375            f(&from_glib_borrow(this))
1376        }
1377        unsafe {
1378            let f: Box_<F> = Box_::new(f);
1379            connect_raw(
1380                self.as_ptr() as *mut _,
1381                c"notify::multicast-membership-interval".as_ptr() as *const _,
1382                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1383                    notify_multicast_membership_interval_trampoline::<F> as *const (),
1384                )),
1385                Box_::into_raw(f),
1386            )
1387        }
1388    }
1389
1390    #[doc(alias = "multicast-querier")]
1391    pub fn connect_multicast_querier_notify<F: Fn(&Self) + 'static>(
1392        &self,
1393        f: F,
1394    ) -> SignalHandlerId {
1395        unsafe extern "C" fn notify_multicast_querier_trampoline<
1396            F: Fn(&SettingBridge) + 'static,
1397        >(
1398            this: *mut ffi::NMSettingBridge,
1399            _param_spec: glib::ffi::gpointer,
1400            f: glib::ffi::gpointer,
1401        ) {
1402            let f: &F = &*(f as *const F);
1403            f(&from_glib_borrow(this))
1404        }
1405        unsafe {
1406            let f: Box_<F> = Box_::new(f);
1407            connect_raw(
1408                self.as_ptr() as *mut _,
1409                c"notify::multicast-querier".as_ptr() as *const _,
1410                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1411                    notify_multicast_querier_trampoline::<F> as *const (),
1412                )),
1413                Box_::into_raw(f),
1414            )
1415        }
1416    }
1417
1418    #[doc(alias = "multicast-querier-interval")]
1419    pub fn connect_multicast_querier_interval_notify<F: Fn(&Self) + 'static>(
1420        &self,
1421        f: F,
1422    ) -> SignalHandlerId {
1423        unsafe extern "C" fn notify_multicast_querier_interval_trampoline<
1424            F: Fn(&SettingBridge) + 'static,
1425        >(
1426            this: *mut ffi::NMSettingBridge,
1427            _param_spec: glib::ffi::gpointer,
1428            f: glib::ffi::gpointer,
1429        ) {
1430            let f: &F = &*(f as *const F);
1431            f(&from_glib_borrow(this))
1432        }
1433        unsafe {
1434            let f: Box_<F> = Box_::new(f);
1435            connect_raw(
1436                self.as_ptr() as *mut _,
1437                c"notify::multicast-querier-interval".as_ptr() as *const _,
1438                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1439                    notify_multicast_querier_interval_trampoline::<F> as *const (),
1440                )),
1441                Box_::into_raw(f),
1442            )
1443        }
1444    }
1445
1446    #[doc(alias = "multicast-query-interval")]
1447    pub fn connect_multicast_query_interval_notify<F: Fn(&Self) + 'static>(
1448        &self,
1449        f: F,
1450    ) -> SignalHandlerId {
1451        unsafe extern "C" fn notify_multicast_query_interval_trampoline<
1452            F: Fn(&SettingBridge) + 'static,
1453        >(
1454            this: *mut ffi::NMSettingBridge,
1455            _param_spec: glib::ffi::gpointer,
1456            f: glib::ffi::gpointer,
1457        ) {
1458            let f: &F = &*(f as *const F);
1459            f(&from_glib_borrow(this))
1460        }
1461        unsafe {
1462            let f: Box_<F> = Box_::new(f);
1463            connect_raw(
1464                self.as_ptr() as *mut _,
1465                c"notify::multicast-query-interval".as_ptr() as *const _,
1466                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1467                    notify_multicast_query_interval_trampoline::<F> as *const (),
1468                )),
1469                Box_::into_raw(f),
1470            )
1471        }
1472    }
1473
1474    #[doc(alias = "multicast-query-response-interval")]
1475    pub fn connect_multicast_query_response_interval_notify<F: Fn(&Self) + 'static>(
1476        &self,
1477        f: F,
1478    ) -> SignalHandlerId {
1479        unsafe extern "C" fn notify_multicast_query_response_interval_trampoline<
1480            F: Fn(&SettingBridge) + 'static,
1481        >(
1482            this: *mut ffi::NMSettingBridge,
1483            _param_spec: glib::ffi::gpointer,
1484            f: glib::ffi::gpointer,
1485        ) {
1486            let f: &F = &*(f as *const F);
1487            f(&from_glib_borrow(this))
1488        }
1489        unsafe {
1490            let f: Box_<F> = Box_::new(f);
1491            connect_raw(
1492                self.as_ptr() as *mut _,
1493                c"notify::multicast-query-response-interval".as_ptr() as *const _,
1494                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1495                    notify_multicast_query_response_interval_trampoline::<F> as *const (),
1496                )),
1497                Box_::into_raw(f),
1498            )
1499        }
1500    }
1501
1502    #[doc(alias = "multicast-query-use-ifaddr")]
1503    pub fn connect_multicast_query_use_ifaddr_notify<F: Fn(&Self) + 'static>(
1504        &self,
1505        f: F,
1506    ) -> SignalHandlerId {
1507        unsafe extern "C" fn notify_multicast_query_use_ifaddr_trampoline<
1508            F: Fn(&SettingBridge) + 'static,
1509        >(
1510            this: *mut ffi::NMSettingBridge,
1511            _param_spec: glib::ffi::gpointer,
1512            f: glib::ffi::gpointer,
1513        ) {
1514            let f: &F = &*(f as *const F);
1515            f(&from_glib_borrow(this))
1516        }
1517        unsafe {
1518            let f: Box_<F> = Box_::new(f);
1519            connect_raw(
1520                self.as_ptr() as *mut _,
1521                c"notify::multicast-query-use-ifaddr".as_ptr() as *const _,
1522                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1523                    notify_multicast_query_use_ifaddr_trampoline::<F> as *const (),
1524                )),
1525                Box_::into_raw(f),
1526            )
1527        }
1528    }
1529
1530    #[doc(alias = "multicast-router")]
1531    pub fn connect_multicast_router_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1532        unsafe extern "C" fn notify_multicast_router_trampoline<F: Fn(&SettingBridge) + 'static>(
1533            this: *mut ffi::NMSettingBridge,
1534            _param_spec: glib::ffi::gpointer,
1535            f: glib::ffi::gpointer,
1536        ) {
1537            let f: &F = &*(f as *const F);
1538            f(&from_glib_borrow(this))
1539        }
1540        unsafe {
1541            let f: Box_<F> = Box_::new(f);
1542            connect_raw(
1543                self.as_ptr() as *mut _,
1544                c"notify::multicast-router".as_ptr() as *const _,
1545                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1546                    notify_multicast_router_trampoline::<F> as *const (),
1547                )),
1548                Box_::into_raw(f),
1549            )
1550        }
1551    }
1552
1553    #[cfg(feature = "v1_2")]
1554    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1555    #[doc(alias = "multicast-snooping")]
1556    pub fn connect_multicast_snooping_notify<F: Fn(&Self) + 'static>(
1557        &self,
1558        f: F,
1559    ) -> SignalHandlerId {
1560        unsafe extern "C" fn notify_multicast_snooping_trampoline<
1561            F: Fn(&SettingBridge) + 'static,
1562        >(
1563            this: *mut ffi::NMSettingBridge,
1564            _param_spec: glib::ffi::gpointer,
1565            f: glib::ffi::gpointer,
1566        ) {
1567            let f: &F = &*(f as *const F);
1568            f(&from_glib_borrow(this))
1569        }
1570        unsafe {
1571            let f: Box_<F> = Box_::new(f);
1572            connect_raw(
1573                self.as_ptr() as *mut _,
1574                c"notify::multicast-snooping".as_ptr() as *const _,
1575                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1576                    notify_multicast_snooping_trampoline::<F> as *const (),
1577                )),
1578                Box_::into_raw(f),
1579            )
1580        }
1581    }
1582
1583    #[doc(alias = "multicast-startup-query-count")]
1584    pub fn connect_multicast_startup_query_count_notify<F: Fn(&Self) + 'static>(
1585        &self,
1586        f: F,
1587    ) -> SignalHandlerId {
1588        unsafe extern "C" fn notify_multicast_startup_query_count_trampoline<
1589            F: Fn(&SettingBridge) + 'static,
1590        >(
1591            this: *mut ffi::NMSettingBridge,
1592            _param_spec: glib::ffi::gpointer,
1593            f: glib::ffi::gpointer,
1594        ) {
1595            let f: &F = &*(f as *const F);
1596            f(&from_glib_borrow(this))
1597        }
1598        unsafe {
1599            let f: Box_<F> = Box_::new(f);
1600            connect_raw(
1601                self.as_ptr() as *mut _,
1602                c"notify::multicast-startup-query-count".as_ptr() as *const _,
1603                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1604                    notify_multicast_startup_query_count_trampoline::<F> as *const (),
1605                )),
1606                Box_::into_raw(f),
1607            )
1608        }
1609    }
1610
1611    #[doc(alias = "multicast-startup-query-interval")]
1612    pub fn connect_multicast_startup_query_interval_notify<F: Fn(&Self) + 'static>(
1613        &self,
1614        f: F,
1615    ) -> SignalHandlerId {
1616        unsafe extern "C" fn notify_multicast_startup_query_interval_trampoline<
1617            F: Fn(&SettingBridge) + 'static,
1618        >(
1619            this: *mut ffi::NMSettingBridge,
1620            _param_spec: glib::ffi::gpointer,
1621            f: glib::ffi::gpointer,
1622        ) {
1623            let f: &F = &*(f as *const F);
1624            f(&from_glib_borrow(this))
1625        }
1626        unsafe {
1627            let f: Box_<F> = Box_::new(f);
1628            connect_raw(
1629                self.as_ptr() as *mut _,
1630                c"notify::multicast-startup-query-interval".as_ptr() as *const _,
1631                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1632                    notify_multicast_startup_query_interval_trampoline::<F> as *const (),
1633                )),
1634                Box_::into_raw(f),
1635            )
1636        }
1637    }
1638
1639    #[doc(alias = "priority")]
1640    pub fn connect_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1641        unsafe extern "C" fn notify_priority_trampoline<F: Fn(&SettingBridge) + 'static>(
1642            this: *mut ffi::NMSettingBridge,
1643            _param_spec: glib::ffi::gpointer,
1644            f: glib::ffi::gpointer,
1645        ) {
1646            let f: &F = &*(f as *const F);
1647            f(&from_glib_borrow(this))
1648        }
1649        unsafe {
1650            let f: Box_<F> = Box_::new(f);
1651            connect_raw(
1652                self.as_ptr() as *mut _,
1653                c"notify::priority".as_ptr() as *const _,
1654                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1655                    notify_priority_trampoline::<F> as *const (),
1656                )),
1657                Box_::into_raw(f),
1658            )
1659        }
1660    }
1661
1662    #[doc(alias = "stp")]
1663    pub fn connect_stp_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1664        unsafe extern "C" fn notify_stp_trampoline<F: Fn(&SettingBridge) + 'static>(
1665            this: *mut ffi::NMSettingBridge,
1666            _param_spec: glib::ffi::gpointer,
1667            f: glib::ffi::gpointer,
1668        ) {
1669            let f: &F = &*(f as *const F);
1670            f(&from_glib_borrow(this))
1671        }
1672        unsafe {
1673            let f: Box_<F> = Box_::new(f);
1674            connect_raw(
1675                self.as_ptr() as *mut _,
1676                c"notify::stp".as_ptr() as *const _,
1677                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1678                    notify_stp_trampoline::<F> as *const (),
1679                )),
1680                Box_::into_raw(f),
1681            )
1682        }
1683    }
1684
1685    #[cfg(feature = "v1_18")]
1686    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1687    #[doc(alias = "vlan-default-pvid")]
1688    pub fn connect_vlan_default_pvid_notify<F: Fn(&Self) + 'static>(
1689        &self,
1690        f: F,
1691    ) -> SignalHandlerId {
1692        unsafe extern "C" fn notify_vlan_default_pvid_trampoline<
1693            F: Fn(&SettingBridge) + 'static,
1694        >(
1695            this: *mut ffi::NMSettingBridge,
1696            _param_spec: glib::ffi::gpointer,
1697            f: glib::ffi::gpointer,
1698        ) {
1699            let f: &F = &*(f as *const F);
1700            f(&from_glib_borrow(this))
1701        }
1702        unsafe {
1703            let f: Box_<F> = Box_::new(f);
1704            connect_raw(
1705                self.as_ptr() as *mut _,
1706                c"notify::vlan-default-pvid".as_ptr() as *const _,
1707                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1708                    notify_vlan_default_pvid_trampoline::<F> as *const (),
1709                )),
1710                Box_::into_raw(f),
1711            )
1712        }
1713    }
1714
1715    #[cfg(feature = "v1_18")]
1716    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1717    #[doc(alias = "vlan-filtering")]
1718    pub fn connect_vlan_filtering_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1719        unsafe extern "C" fn notify_vlan_filtering_trampoline<F: Fn(&SettingBridge) + 'static>(
1720            this: *mut ffi::NMSettingBridge,
1721            _param_spec: glib::ffi::gpointer,
1722            f: glib::ffi::gpointer,
1723        ) {
1724            let f: &F = &*(f as *const F);
1725            f(&from_glib_borrow(this))
1726        }
1727        unsafe {
1728            let f: Box_<F> = Box_::new(f);
1729            connect_raw(
1730                self.as_ptr() as *mut _,
1731                c"notify::vlan-filtering".as_ptr() as *const _,
1732                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1733                    notify_vlan_filtering_trampoline::<F> as *const (),
1734                )),
1735                Box_::into_raw(f),
1736            )
1737        }
1738    }
1739
1740    #[cfg(feature = "v1_24")]
1741    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1742    #[doc(alias = "vlan-protocol")]
1743    pub fn connect_vlan_protocol_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1744        unsafe extern "C" fn notify_vlan_protocol_trampoline<F: Fn(&SettingBridge) + 'static>(
1745            this: *mut ffi::NMSettingBridge,
1746            _param_spec: glib::ffi::gpointer,
1747            f: glib::ffi::gpointer,
1748        ) {
1749            let f: &F = &*(f as *const F);
1750            f(&from_glib_borrow(this))
1751        }
1752        unsafe {
1753            let f: Box_<F> = Box_::new(f);
1754            connect_raw(
1755                self.as_ptr() as *mut _,
1756                c"notify::vlan-protocol".as_ptr() as *const _,
1757                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1758                    notify_vlan_protocol_trampoline::<F> as *const (),
1759                )),
1760                Box_::into_raw(f),
1761            )
1762        }
1763    }
1764
1765    #[doc(alias = "vlan-stats-enabled")]
1766    pub fn connect_vlan_stats_enabled_notify<F: Fn(&Self) + 'static>(
1767        &self,
1768        f: F,
1769    ) -> SignalHandlerId {
1770        unsafe extern "C" fn notify_vlan_stats_enabled_trampoline<
1771            F: Fn(&SettingBridge) + 'static,
1772        >(
1773            this: *mut ffi::NMSettingBridge,
1774            _param_spec: glib::ffi::gpointer,
1775            f: glib::ffi::gpointer,
1776        ) {
1777            let f: &F = &*(f as *const F);
1778            f(&from_glib_borrow(this))
1779        }
1780        unsafe {
1781            let f: Box_<F> = Box_::new(f);
1782            connect_raw(
1783                self.as_ptr() as *mut _,
1784                c"notify::vlan-stats-enabled".as_ptr() as *const _,
1785                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1786                    notify_vlan_stats_enabled_trampoline::<F> as *const (),
1787                )),
1788                Box_::into_raw(f),
1789            )
1790        }
1791    }
1792
1793    #[cfg(feature = "v1_18")]
1794    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1795    #[doc(alias = "vlans")]
1796    pub fn connect_vlans_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1797        unsafe extern "C" fn notify_vlans_trampoline<F: Fn(&SettingBridge) + 'static>(
1798            this: *mut ffi::NMSettingBridge,
1799            _param_spec: glib::ffi::gpointer,
1800            f: glib::ffi::gpointer,
1801        ) {
1802            let f: &F = &*(f as *const F);
1803            f(&from_glib_borrow(this))
1804        }
1805        unsafe {
1806            let f: Box_<F> = Box_::new(f);
1807            connect_raw(
1808                self.as_ptr() as *mut _,
1809                c"notify::vlans".as_ptr() as *const _,
1810                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1811                    notify_vlans_trampoline::<F> as *const (),
1812                )),
1813                Box_::into_raw(f),
1814            )
1815        }
1816    }
1817}
1818
1819impl Default for SettingBridge {
1820    fn default() -> Self {
1821        Self::new()
1822    }
1823}
1824
1825// rustdoc-stripper-ignore-next
1826/// A [builder-pattern] type to construct [`SettingBridge`] objects.
1827///
1828/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1829#[must_use = "The builder must be built to be used"]
1830pub struct SettingBridgeBuilder {
1831    builder: glib::object::ObjectBuilder<'static, SettingBridge>,
1832}
1833
1834impl SettingBridgeBuilder {
1835    fn new() -> Self {
1836        Self {
1837            builder: glib::object::Object::builder(),
1838        }
1839    }
1840
1841    /// The Ethernet MAC address aging time, in seconds.
1842    pub fn ageing_time(self, ageing_time: u32) -> Self {
1843        Self {
1844            builder: self.builder.property("ageing-time", ageing_time),
1845        }
1846    }
1847
1848    /// The Spanning Tree Protocol (STP) forwarding delay, in seconds.
1849    pub fn forward_delay(self, forward_delay: u32) -> Self {
1850        Self {
1851            builder: self.builder.property("forward-delay", forward_delay),
1852        }
1853    }
1854
1855    /// If specified, The MAC address of the multicast group this bridge uses for STP.
1856    ///
1857    /// The address must be a link-local address in standard Ethernet MAC address format,
1858    /// ie an address of the form 01:80:C2:00:00:0X, with X in [0, 4..F].
1859    /// If not specified the default value is 01:80:C2:00:00:00.
1860    #[cfg(feature = "v1_24")]
1861    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1862    pub fn group_address(self, group_address: impl Into<glib::GString>) -> Self {
1863        Self {
1864            builder: self.builder.property("group-address", group_address.into()),
1865        }
1866    }
1867
1868    /// A mask of group addresses to forward. Usually, group addresses in
1869    /// the range from 01:80:C2:00:00:00 to 01:80:C2:00:00:0F are not
1870    /// forwarded according to standards. This property is a mask of 16 bits,
1871    /// each corresponding to a group address in that range that must be
1872    /// forwarded. The mask can't have bits 0, 1 or 2 set because they are
1873    /// used for STP, MAC pause frames and LACP.
1874    #[cfg(feature = "v1_10")]
1875    #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
1876    pub fn group_forward_mask(self, group_forward_mask: u32) -> Self {
1877        Self {
1878            builder: self
1879                .builder
1880                .property("group-forward-mask", group_forward_mask),
1881        }
1882    }
1883
1884    /// The Spanning Tree Protocol (STP) hello time, in seconds.
1885    pub fn hello_time(self, hello_time: u32) -> Self {
1886        Self {
1887            builder: self.builder.property("hello-time", hello_time),
1888        }
1889    }
1890
1891    /// If specified, the MAC address of bridge. When creating a new bridge, this
1892    /// MAC address will be set.
1893    ///
1894    /// If this field is left unspecified, the "ethernet.cloned-mac-address" is
1895    /// referred instead to generate the initial MAC address. Note that setting
1896    /// "ethernet.cloned-mac-address" anyway overwrites the MAC address of
1897    /// the bridge later while activating the bridge.
1898    /// Use the #NMSettingWired:cloned-mac-address property instead.
1899    #[cfg_attr(feature = "v1_12", deprecated = "Since 1.12")]
1900    pub fn mac_address(self, mac_address: impl Into<glib::GString>) -> Self {
1901        Self {
1902            builder: self.builder.property("mac-address", mac_address.into()),
1903        }
1904    }
1905
1906    /// The Spanning Tree Protocol (STP) maximum message age, in seconds.
1907    pub fn max_age(self, max_age: u32) -> Self {
1908        Self {
1909            builder: self.builder.property("max-age", max_age),
1910        }
1911    }
1912
1913    /// Set maximum size of multicast hash table (value must be a power of 2).
1914    pub fn multicast_hash_max(self, multicast_hash_max: u32) -> Self {
1915        Self {
1916            builder: self
1917                .builder
1918                .property("multicast-hash-max", multicast_hash_max),
1919        }
1920    }
1921
1922    /// Set the number of queries the bridge will send before
1923    /// stopping forwarding a multicast group after a "leave"
1924    /// message has been received.
1925    pub fn multicast_last_member_count(self, multicast_last_member_count: u32) -> Self {
1926        Self {
1927            builder: self
1928                .builder
1929                .property("multicast-last-member-count", multicast_last_member_count),
1930        }
1931    }
1932
1933    /// Set interval (in deciseconds) between queries to find remaining
1934    /// members of a group, after a "leave" message is received.
1935    pub fn multicast_last_member_interval(self, multicast_last_member_interval: u64) -> Self {
1936        Self {
1937            builder: self.builder.property(
1938                "multicast-last-member-interval",
1939                multicast_last_member_interval,
1940            ),
1941        }
1942    }
1943
1944    /// Set delay (in deciseconds) after which the bridge will
1945    /// leave a group, if no membership reports for this
1946    /// group are received.
1947    pub fn multicast_membership_interval(self, multicast_membership_interval: u64) -> Self {
1948        Self {
1949            builder: self.builder.property(
1950                "multicast-membership-interval",
1951                multicast_membership_interval,
1952            ),
1953        }
1954    }
1955
1956    /// Enable or disable sending of multicast queries by the bridge.
1957    /// If not specified the option is disabled.
1958    pub fn multicast_querier(self, multicast_querier: bool) -> Self {
1959        Self {
1960            builder: self
1961                .builder
1962                .property("multicast-querier", multicast_querier),
1963        }
1964    }
1965
1966    /// If no queries are seen after this delay (in deciseconds) has passed,
1967    /// the bridge will start to send its own queries.
1968    pub fn multicast_querier_interval(self, multicast_querier_interval: u64) -> Self {
1969        Self {
1970            builder: self
1971                .builder
1972                .property("multicast-querier-interval", multicast_querier_interval),
1973        }
1974    }
1975
1976    /// Interval (in deciseconds) between queries sent
1977    /// by the bridge after the end of the startup phase.
1978    pub fn multicast_query_interval(self, multicast_query_interval: u64) -> Self {
1979        Self {
1980            builder: self
1981                .builder
1982                .property("multicast-query-interval", multicast_query_interval),
1983        }
1984    }
1985
1986    /// Set the Max Response Time/Max Response Delay
1987    /// (in deciseconds) for IGMP/MLD queries sent by the bridge.
1988    pub fn multicast_query_response_interval(self, multicast_query_response_interval: u64) -> Self {
1989        Self {
1990            builder: self.builder.property(
1991                "multicast-query-response-interval",
1992                multicast_query_response_interval,
1993            ),
1994        }
1995    }
1996
1997    /// If enabled the bridge's own IP address is used as
1998    /// the source address for IGMP queries otherwise
1999    /// the default of 0.0.0.0 is used.
2000    pub fn multicast_query_use_ifaddr(self, multicast_query_use_ifaddr: bool) -> Self {
2001        Self {
2002            builder: self
2003                .builder
2004                .property("multicast-query-use-ifaddr", multicast_query_use_ifaddr),
2005        }
2006    }
2007
2008    /// Sets bridge's multicast router. Multicast-snooping must be enabled
2009    /// for this option to work.
2010    ///
2011    /// Supported values are: 'auto', 'disabled', 'enabled' to which kernel
2012    /// assigns the numbers 1, 0, and 2, respectively.
2013    /// If not specified the default value is 'auto' (1).
2014    pub fn multicast_router(self, multicast_router: impl Into<glib::GString>) -> Self {
2015        Self {
2016            builder: self
2017                .builder
2018                .property("multicast-router", multicast_router.into()),
2019        }
2020    }
2021
2022    /// Controls whether IGMP snooping is enabled for this bridge.
2023    /// Note that if snooping was automatically disabled due to hash collisions,
2024    /// the system may refuse to enable the feature until the collisions are
2025    /// resolved.
2026    #[cfg(feature = "v1_2")]
2027    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2028    pub fn multicast_snooping(self, multicast_snooping: bool) -> Self {
2029        Self {
2030            builder: self
2031                .builder
2032                .property("multicast-snooping", multicast_snooping),
2033        }
2034    }
2035
2036    /// Set the number of IGMP queries to send during startup phase.
2037    pub fn multicast_startup_query_count(self, multicast_startup_query_count: u32) -> Self {
2038        Self {
2039            builder: self.builder.property(
2040                "multicast-startup-query-count",
2041                multicast_startup_query_count,
2042            ),
2043        }
2044    }
2045
2046    /// Sets the time (in deciseconds) between queries sent out
2047    /// at startup to determine membership information.
2048    pub fn multicast_startup_query_interval(self, multicast_startup_query_interval: u64) -> Self {
2049        Self {
2050            builder: self.builder.property(
2051                "multicast-startup-query-interval",
2052                multicast_startup_query_interval,
2053            ),
2054        }
2055    }
2056
2057    /// Sets the Spanning Tree Protocol (STP) priority for this bridge.  Lower
2058    /// values are "better"; the lowest priority bridge will be elected the root
2059    /// bridge.
2060    pub fn priority(self, priority: u32) -> Self {
2061        Self {
2062            builder: self.builder.property("priority", priority),
2063        }
2064    }
2065
2066    /// Controls whether Spanning Tree Protocol (STP) is enabled for this bridge.
2067    pub fn stp(self, stp: bool) -> Self {
2068        Self {
2069            builder: self.builder.property("stp", stp),
2070        }
2071    }
2072
2073    /// The default PVID for the ports of the bridge, that is the VLAN id
2074    /// assigned to incoming untagged frames.
2075    #[cfg(feature = "v1_18")]
2076    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2077    pub fn vlan_default_pvid(self, vlan_default_pvid: u32) -> Self {
2078        Self {
2079            builder: self
2080                .builder
2081                .property("vlan-default-pvid", vlan_default_pvid),
2082        }
2083    }
2084
2085    /// Control whether VLAN filtering is enabled on the bridge.
2086    #[cfg(feature = "v1_18")]
2087    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2088    pub fn vlan_filtering(self, vlan_filtering: bool) -> Self {
2089        Self {
2090            builder: self.builder.property("vlan-filtering", vlan_filtering),
2091        }
2092    }
2093
2094    /// If specified, the protocol used for VLAN filtering.
2095    ///
2096    /// Supported values are: '802.1Q', '802.1ad'.
2097    /// If not specified the default value is '802.1Q'.
2098    #[cfg(feature = "v1_24")]
2099    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
2100    pub fn vlan_protocol(self, vlan_protocol: impl Into<glib::GString>) -> Self {
2101        Self {
2102            builder: self.builder.property("vlan-protocol", vlan_protocol.into()),
2103        }
2104    }
2105
2106    /// Controls whether per-VLAN stats accounting is enabled.
2107    pub fn vlan_stats_enabled(self, vlan_stats_enabled: bool) -> Self {
2108        Self {
2109            builder: self
2110                .builder
2111                .property("vlan-stats-enabled", vlan_stats_enabled),
2112        }
2113    }
2114
2115    /// Array of bridge VLAN objects. In addition to the VLANs
2116    /// specified here, the bridge will also have the default-pvid
2117    /// VLAN configured  by the bridge.vlan-default-pvid property.
2118    ///
2119    /// In nmcli the VLAN list can be specified with the following
2120    /// syntax:
2121    ///
2122    ///  $vid [pvid] [untagged] [, $vid [pvid] [untagged]]...
2123    ///
2124    /// where $vid is either a single id between 1 and 4094 or a
2125    /// range, represented as a couple of ids separated by a dash.
2126    #[cfg(feature = "v1_18")]
2127    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
2128    pub fn vlans(self, vlans: &[&BridgeVlan]) -> Self {
2129        Self {
2130            builder: self.builder.property(
2131                "vlans",
2132                vlans
2133                    .iter()
2134                    .map(|vlan| vlan.to_value())
2135                    .collect::<glib::ValueArray>(),
2136            ),
2137        }
2138    }
2139
2140    // rustdoc-stripper-ignore-next
2141    /// Build the [`SettingBridge`].
2142    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
2143    pub fn build(self) -> SettingBridge {
2144        assert_initialized_main_thread!();
2145        self.builder.build()
2146    }
2147}