nm_rs/auto/
setting_vxlan.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir
3// from gtk-girs (https://github.com/gtk-rs/gir-files)
4// DO NOT EDIT
5
6use crate::{ffi,Setting};
7use glib::{prelude::*};
8#[cfg(feature = "v1_2")]
9#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
10use glib::{signal::{connect_raw, SignalHandlerId},translate::*};
11#[cfg(feature = "v1_2")]
12#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
13use std::{boxed::Box as Box_};
14
15glib::wrapper! {
16    /// VXLAN Settings
17    ///
18    /// ## Properties
19    ///
20    ///
21    /// #### `ageing`
22    ///  Specifies the lifetime in seconds of FDB entries learnt by the kernel.
23    ///
24    /// Readable | Writeable
25    ///
26    ///
27    /// #### `destination-port`
28    ///  Specifies the UDP destination port to communicate to the remote VXLAN
29    /// tunnel endpoint.
30    ///
31    /// Readable | Writeable
32    ///
33    ///
34    /// #### `id`
35    ///  Specifies the VXLAN Network Identifier (or VXLAN Segment Identifier) to
36    /// use.
37    ///
38    /// Readable | Writeable
39    ///
40    ///
41    /// #### `l2-miss`
42    ///  Specifies whether netlink LL ADDR miss notifications are generated.
43    ///
44    /// Readable | Writeable
45    ///
46    ///
47    /// #### `l3-miss`
48    ///  Specifies whether netlink IP ADDR miss notifications are generated.
49    ///
50    /// Readable | Writeable
51    ///
52    ///
53    /// #### `learning`
54    ///  Specifies whether unknown source link layer addresses and IP addresses
55    /// are entered into the VXLAN device forwarding database.
56    ///
57    /// Readable | Writeable
58    ///
59    ///
60    /// #### `limit`
61    ///  Specifies the maximum number of FDB entries. A value of zero means that
62    /// the kernel will store unlimited entries.
63    ///
64    /// Readable | Writeable
65    ///
66    ///
67    /// #### `local`
68    ///  If given, specifies the source IP address to use in outgoing packets.
69    ///
70    /// Readable | Writeable
71    ///
72    ///
73    /// #### `parent`
74    ///  If given, specifies the parent interface name or parent connection UUID.
75    ///
76    /// Readable | Writeable
77    ///
78    ///
79    /// #### `proxy`
80    ///  Specifies whether ARP proxy is turned on.
81    ///
82    /// Readable | Writeable
83    ///
84    ///
85    /// #### `remote`
86    ///  Specifies the unicast destination IP address to use in outgoing packets
87    /// when the destination link layer address is not known in the VXLAN device
88    /// forwarding database, or the multicast IP address to join.
89    ///
90    /// Readable | Writeable
91    ///
92    ///
93    /// #### `rsc`
94    ///  Specifies whether route short circuit is turned on.
95    ///
96    /// Readable | Writeable
97    ///
98    ///
99    /// #### `source-port-max`
100    ///  Specifies the maximum UDP source port to communicate to the remote VXLAN
101    /// tunnel endpoint.
102    ///
103    /// Readable | Writeable
104    ///
105    ///
106    /// #### `source-port-min`
107    ///  Specifies the minimum UDP source port to communicate to the remote VXLAN
108    /// tunnel endpoint.
109    ///
110    /// Readable | Writeable
111    ///
112    ///
113    /// #### `tos`
114    ///  Specifies the TOS value to use in outgoing packets.
115    ///
116    /// Readable | Writeable
117    ///
118    ///
119    /// #### `ttl`
120    ///  Specifies the time-to-live value to use in outgoing packets.
121    ///
122    /// Readable | Writeable
123    /// <details><summary><h4>Setting</h4></summary>
124    ///
125    ///
126    /// #### `name`
127    ///  The setting's name, which uniquely identifies the setting within the
128    /// connection.  Each setting type has a name unique to that type, for
129    /// example "ppp" or "802-11-wireless" or "802-3-ethernet".
130    ///
131    /// Readable
132    /// </details>
133    ///
134    /// # Implements
135    ///
136    /// [`SettingExt`][trait@crate::prelude::SettingExt]
137    #[doc(alias = "NMSettingVxlan")]
138    pub struct SettingVxlan(Object<ffi::NMSettingVxlan, ffi::NMSettingVxlanClass>) @extends Setting;
139
140    match fn {
141        type_ => || ffi::nm_setting_vxlan_get_type(),
142    }
143}
144
145impl SettingVxlan {
146    /// Creates a new #NMSettingVxlan object with default values.
147    ///
148    /// # Returns
149    ///
150    /// the new empty #NMSettingVxlan object
151    #[cfg(feature = "v1_2")]
152    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
153    #[doc(alias = "nm_setting_vxlan_new")]
154    pub fn new() -> SettingVxlan {
155        assert_initialized_main_thread!();
156        unsafe {
157            Setting::from_glib_full(ffi::nm_setting_vxlan_new()).unsafe_cast()
158        }
159    }
160
161            // rustdoc-stripper-ignore-next
162            /// Creates a new builder-pattern struct instance to construct [`SettingVxlan`] objects.
163            ///
164            /// This method returns an instance of [`SettingVxlanBuilder`](crate::builders::SettingVxlanBuilder) which can be used to create [`SettingVxlan`] objects.
165            pub fn builder() -> SettingVxlanBuilder {
166                SettingVxlanBuilder::new()
167            }
168        
169
170    ///
171    /// # Returns
172    ///
173    /// the #NMSettingVxlan:ageing property of the setting
174    #[cfg(feature = "v1_2")]
175    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
176    #[doc(alias = "nm_setting_vxlan_get_ageing")]
177    #[doc(alias = "get_ageing")]
178    pub fn ageing(&self) -> u32 {
179        unsafe {
180            ffi::nm_setting_vxlan_get_ageing(self.to_glib_none().0)
181        }
182    }
183
184    ///
185    /// # Returns
186    ///
187    /// the #NMSettingVxlan:destination-port property of the setting
188    #[cfg(feature = "v1_2")]
189    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
190    #[doc(alias = "nm_setting_vxlan_get_destination_port")]
191    #[doc(alias = "get_destination_port")]
192    #[doc(alias = "destination-port")]
193    pub fn destination_port(&self) -> u32 {
194        unsafe {
195            ffi::nm_setting_vxlan_get_destination_port(self.to_glib_none().0)
196        }
197    }
198
199    ///
200    /// # Returns
201    ///
202    /// the #NMSettingVxlan:id property of the setting
203    #[cfg(feature = "v1_2")]
204    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
205    #[doc(alias = "nm_setting_vxlan_get_id")]
206    #[doc(alias = "get_id")]
207    pub fn id(&self) -> u32 {
208        unsafe {
209            ffi::nm_setting_vxlan_get_id(self.to_glib_none().0)
210        }
211    }
212
213    ///
214    /// # Returns
215    ///
216    /// the #NMSettingVxlan:l2_miss property of the setting
217    #[cfg(feature = "v1_2")]
218    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
219    #[doc(alias = "nm_setting_vxlan_get_l2_miss")]
220    #[doc(alias = "get_l2_miss")]
221    #[doc(alias = "l2-miss")]
222    pub fn is_l2_miss(&self) -> bool {
223        unsafe {
224            from_glib(ffi::nm_setting_vxlan_get_l2_miss(self.to_glib_none().0))
225        }
226    }
227
228    ///
229    /// # Returns
230    ///
231    /// the #NMSettingVxlan:l3_miss property of the setting
232    #[cfg(feature = "v1_2")]
233    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
234    #[doc(alias = "nm_setting_vxlan_get_l3_miss")]
235    #[doc(alias = "get_l3_miss")]
236    #[doc(alias = "l3-miss")]
237    pub fn is_l3_miss(&self) -> bool {
238        unsafe {
239            from_glib(ffi::nm_setting_vxlan_get_l3_miss(self.to_glib_none().0))
240        }
241    }
242
243    ///
244    /// # Returns
245    ///
246    /// the #NMSettingVxlan:learning property of the setting
247    #[cfg(feature = "v1_2")]
248    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
249    #[doc(alias = "nm_setting_vxlan_get_learning")]
250    #[doc(alias = "get_learning")]
251    #[doc(alias = "learning")]
252    pub fn is_learning(&self) -> bool {
253        unsafe {
254            from_glib(ffi::nm_setting_vxlan_get_learning(self.to_glib_none().0))
255        }
256    }
257
258    ///
259    /// # Returns
260    ///
261    /// the #NMSettingVxlan:limit property of the setting
262    #[cfg(feature = "v1_2")]
263    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
264    #[doc(alias = "nm_setting_vxlan_get_limit")]
265    #[doc(alias = "get_limit")]
266    pub fn limit(&self) -> u32 {
267        unsafe {
268            ffi::nm_setting_vxlan_get_limit(self.to_glib_none().0)
269        }
270    }
271
272    ///
273    /// # Returns
274    ///
275    /// the #NMSettingVxlan:local property of the setting
276    #[cfg(feature = "v1_2")]
277    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
278    #[doc(alias = "nm_setting_vxlan_get_local")]
279    #[doc(alias = "get_local")]
280    pub fn local(&self) -> glib::GString {
281        unsafe {
282            from_glib_none(ffi::nm_setting_vxlan_get_local(self.to_glib_none().0))
283        }
284    }
285
286    ///
287    /// # Returns
288    ///
289    /// the #NMSettingVxlan:parent property of the setting
290    #[cfg(feature = "v1_2")]
291    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
292    #[doc(alias = "nm_setting_vxlan_get_parent")]
293    #[doc(alias = "get_parent")]
294    pub fn parent(&self) -> glib::GString {
295        unsafe {
296            from_glib_none(ffi::nm_setting_vxlan_get_parent(self.to_glib_none().0))
297        }
298    }
299
300    ///
301    /// # Returns
302    ///
303    /// the #NMSettingVxlan:proxy property of the setting
304    #[cfg(feature = "v1_2")]
305    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
306    #[doc(alias = "nm_setting_vxlan_get_proxy")]
307    #[doc(alias = "get_proxy")]
308    #[doc(alias = "proxy")]
309    pub fn is_proxy(&self) -> bool {
310        unsafe {
311            from_glib(ffi::nm_setting_vxlan_get_proxy(self.to_glib_none().0))
312        }
313    }
314
315    ///
316    /// # Returns
317    ///
318    /// the #NMSettingVxlan:remote property of the setting
319    #[cfg(feature = "v1_2")]
320    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
321    #[doc(alias = "nm_setting_vxlan_get_remote")]
322    #[doc(alias = "get_remote")]
323    pub fn remote(&self) -> glib::GString {
324        unsafe {
325            from_glib_none(ffi::nm_setting_vxlan_get_remote(self.to_glib_none().0))
326        }
327    }
328
329    ///
330    /// # Returns
331    ///
332    /// the #NMSettingVxlan:rsc property of the setting
333    #[cfg(feature = "v1_2")]
334    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
335    #[doc(alias = "nm_setting_vxlan_get_rsc")]
336    #[doc(alias = "get_rsc")]
337    #[doc(alias = "rsc")]
338    pub fn is_rsc(&self) -> bool {
339        unsafe {
340            from_glib(ffi::nm_setting_vxlan_get_rsc(self.to_glib_none().0))
341        }
342    }
343
344    ///
345    /// # Returns
346    ///
347    /// the #NMSettingVxlan:source-port-max property of the setting
348    #[cfg(feature = "v1_2")]
349    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
350    #[doc(alias = "nm_setting_vxlan_get_source_port_max")]
351    #[doc(alias = "get_source_port_max")]
352    #[doc(alias = "source-port-max")]
353    pub fn source_port_max(&self) -> u32 {
354        unsafe {
355            ffi::nm_setting_vxlan_get_source_port_max(self.to_glib_none().0)
356        }
357    }
358
359    ///
360    /// # Returns
361    ///
362    /// the #NMSettingVxlan:source-port-min property of the setting
363    #[cfg(feature = "v1_2")]
364    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
365    #[doc(alias = "nm_setting_vxlan_get_source_port_min")]
366    #[doc(alias = "get_source_port_min")]
367    #[doc(alias = "source-port-min")]
368    pub fn source_port_min(&self) -> u32 {
369        unsafe {
370            ffi::nm_setting_vxlan_get_source_port_min(self.to_glib_none().0)
371        }
372    }
373
374    ///
375    /// # Returns
376    ///
377    /// the #NMSettingVxlan:tos property of the setting
378    #[cfg(feature = "v1_2")]
379    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
380    #[doc(alias = "nm_setting_vxlan_get_tos")]
381    #[doc(alias = "get_tos")]
382    pub fn tos(&self) -> u32 {
383        unsafe {
384            ffi::nm_setting_vxlan_get_tos(self.to_glib_none().0)
385        }
386    }
387
388    ///
389    /// # Returns
390    ///
391    /// the #NMSettingVxlan:ttl property of the setting
392    #[cfg(feature = "v1_2")]
393    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
394    #[doc(alias = "nm_setting_vxlan_get_ttl")]
395    #[doc(alias = "get_ttl")]
396    pub fn ttl(&self) -> u32 {
397        unsafe {
398            ffi::nm_setting_vxlan_get_ttl(self.to_glib_none().0)
399        }
400    }
401
402    /// Specifies the lifetime in seconds of FDB entries learnt by the kernel.
403    #[cfg(feature = "v1_2")]
404    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
405    pub fn set_ageing(&self, ageing: u32) {
406        ObjectExt::set_property(self,"ageing", ageing)
407    }
408
409    /// Specifies the UDP destination port to communicate to the remote VXLAN
410    /// tunnel endpoint.
411    #[cfg(feature = "v1_2")]
412    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
413    #[doc(alias = "destination-port")]
414    pub fn set_destination_port(&self, destination_port: u32) {
415        ObjectExt::set_property(self,"destination-port", destination_port)
416    }
417
418    /// Specifies the VXLAN Network Identifier (or VXLAN Segment Identifier) to
419    /// use.
420    #[cfg(feature = "v1_2")]
421    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
422    pub fn set_id(&self, id: u32) {
423        ObjectExt::set_property(self,"id", id)
424    }
425
426    /// Specifies whether netlink LL ADDR miss notifications are generated.
427    #[cfg(feature = "v1_2")]
428    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
429    #[doc(alias = "l2-miss")]
430    pub fn set_l2_miss(&self, l2_miss: bool) {
431        ObjectExt::set_property(self,"l2-miss", l2_miss)
432    }
433
434    /// Specifies whether netlink IP ADDR miss notifications are generated.
435    #[cfg(feature = "v1_2")]
436    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
437    #[doc(alias = "l3-miss")]
438    pub fn set_l3_miss(&self, l3_miss: bool) {
439        ObjectExt::set_property(self,"l3-miss", l3_miss)
440    }
441
442    /// Specifies whether unknown source link layer addresses and IP addresses
443    /// are entered into the VXLAN device forwarding database.
444    #[cfg(feature = "v1_2")]
445    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
446    pub fn set_learning(&self, learning: bool) {
447        ObjectExt::set_property(self,"learning", learning)
448    }
449
450    /// Specifies the maximum number of FDB entries. A value of zero means that
451    /// the kernel will store unlimited entries.
452    #[cfg(feature = "v1_2")]
453    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
454    pub fn set_limit(&self, limit: u32) {
455        ObjectExt::set_property(self,"limit", limit)
456    }
457
458    /// If given, specifies the source IP address to use in outgoing packets.
459    #[cfg(feature = "v1_2")]
460    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
461    pub fn set_local(&self, local: Option<&str>) {
462        ObjectExt::set_property(self,"local", local)
463    }
464
465    /// If given, specifies the parent interface name or parent connection UUID.
466    #[cfg(feature = "v1_2")]
467    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
468    pub fn set_parent(&self, parent: Option<&str>) {
469        ObjectExt::set_property(self,"parent", parent)
470    }
471
472    /// Specifies whether ARP proxy is turned on.
473    #[cfg(feature = "v1_2")]
474    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
475    pub fn set_proxy(&self, proxy: bool) {
476        ObjectExt::set_property(self,"proxy", proxy)
477    }
478
479    /// Specifies the unicast destination IP address to use in outgoing packets
480    /// when the destination link layer address is not known in the VXLAN device
481    /// forwarding database, or the multicast IP address to join.
482    #[cfg(feature = "v1_2")]
483    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
484    pub fn set_remote(&self, remote: Option<&str>) {
485        ObjectExt::set_property(self,"remote", remote)
486    }
487
488    /// Specifies whether route short circuit is turned on.
489    #[cfg(feature = "v1_2")]
490    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
491    pub fn set_rsc(&self, rsc: bool) {
492        ObjectExt::set_property(self,"rsc", rsc)
493    }
494
495    /// Specifies the maximum UDP source port to communicate to the remote VXLAN
496    /// tunnel endpoint.
497    #[cfg(feature = "v1_2")]
498    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
499    #[doc(alias = "source-port-max")]
500    pub fn set_source_port_max(&self, source_port_max: u32) {
501        ObjectExt::set_property(self,"source-port-max", source_port_max)
502    }
503
504    /// Specifies the minimum UDP source port to communicate to the remote VXLAN
505    /// tunnel endpoint.
506    #[cfg(feature = "v1_2")]
507    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
508    #[doc(alias = "source-port-min")]
509    pub fn set_source_port_min(&self, source_port_min: u32) {
510        ObjectExt::set_property(self,"source-port-min", source_port_min)
511    }
512
513    /// Specifies the TOS value to use in outgoing packets.
514    #[cfg(feature = "v1_2")]
515    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
516    pub fn set_tos(&self, tos: u32) {
517        ObjectExt::set_property(self,"tos", tos)
518    }
519
520    /// Specifies the time-to-live value to use in outgoing packets.
521    #[cfg(feature = "v1_2")]
522    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
523    pub fn set_ttl(&self, ttl: u32) {
524        ObjectExt::set_property(self,"ttl", ttl)
525    }
526
527    #[cfg(feature = "v1_2")]
528    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
529    #[doc(alias = "ageing")]
530    pub fn connect_ageing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
531        unsafe extern "C" fn notify_ageing_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
532            let f: &F = &*(f as *const F);
533            f(&from_glib_borrow(this))
534        }
535        unsafe {
536            let f: Box_<F> = Box_::new(f);
537            connect_raw(self.as_ptr() as *mut _, c"notify::ageing".as_ptr() as *const _,
538                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_ageing_trampoline::<F> as *const ())), Box_::into_raw(f))
539        }
540    }
541
542    #[cfg(feature = "v1_2")]
543    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
544    #[doc(alias = "destination-port")]
545    pub fn connect_destination_port_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
546        unsafe extern "C" fn notify_destination_port_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
547            let f: &F = &*(f as *const F);
548            f(&from_glib_borrow(this))
549        }
550        unsafe {
551            let f: Box_<F> = Box_::new(f);
552            connect_raw(self.as_ptr() as *mut _, c"notify::destination-port".as_ptr() as *const _,
553                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_destination_port_trampoline::<F> as *const ())), Box_::into_raw(f))
554        }
555    }
556
557    #[cfg(feature = "v1_2")]
558    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
559    #[doc(alias = "id")]
560    pub fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
561        unsafe extern "C" fn notify_id_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
562            let f: &F = &*(f as *const F);
563            f(&from_glib_borrow(this))
564        }
565        unsafe {
566            let f: Box_<F> = Box_::new(f);
567            connect_raw(self.as_ptr() as *mut _, c"notify::id".as_ptr() as *const _,
568                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_id_trampoline::<F> as *const ())), Box_::into_raw(f))
569        }
570    }
571
572    #[cfg(feature = "v1_2")]
573    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
574    #[doc(alias = "l2-miss")]
575    pub fn connect_l2_miss_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
576        unsafe extern "C" fn notify_l2_miss_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
577            let f: &F = &*(f as *const F);
578            f(&from_glib_borrow(this))
579        }
580        unsafe {
581            let f: Box_<F> = Box_::new(f);
582            connect_raw(self.as_ptr() as *mut _, c"notify::l2-miss".as_ptr() as *const _,
583                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_l2_miss_trampoline::<F> as *const ())), Box_::into_raw(f))
584        }
585    }
586
587    #[cfg(feature = "v1_2")]
588    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
589    #[doc(alias = "l3-miss")]
590    pub fn connect_l3_miss_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
591        unsafe extern "C" fn notify_l3_miss_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
592            let f: &F = &*(f as *const F);
593            f(&from_glib_borrow(this))
594        }
595        unsafe {
596            let f: Box_<F> = Box_::new(f);
597            connect_raw(self.as_ptr() as *mut _, c"notify::l3-miss".as_ptr() as *const _,
598                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_l3_miss_trampoline::<F> as *const ())), Box_::into_raw(f))
599        }
600    }
601
602    #[cfg(feature = "v1_2")]
603    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
604    #[doc(alias = "learning")]
605    pub fn connect_learning_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
606        unsafe extern "C" fn notify_learning_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
607            let f: &F = &*(f as *const F);
608            f(&from_glib_borrow(this))
609        }
610        unsafe {
611            let f: Box_<F> = Box_::new(f);
612            connect_raw(self.as_ptr() as *mut _, c"notify::learning".as_ptr() as *const _,
613                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_learning_trampoline::<F> as *const ())), Box_::into_raw(f))
614        }
615    }
616
617    #[cfg(feature = "v1_2")]
618    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
619    #[doc(alias = "limit")]
620    pub fn connect_limit_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
621        unsafe extern "C" fn notify_limit_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
622            let f: &F = &*(f as *const F);
623            f(&from_glib_borrow(this))
624        }
625        unsafe {
626            let f: Box_<F> = Box_::new(f);
627            connect_raw(self.as_ptr() as *mut _, c"notify::limit".as_ptr() as *const _,
628                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_limit_trampoline::<F> as *const ())), Box_::into_raw(f))
629        }
630    }
631
632    #[cfg(feature = "v1_2")]
633    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
634    #[doc(alias = "local")]
635    pub fn connect_local_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
636        unsafe extern "C" fn notify_local_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
637            let f: &F = &*(f as *const F);
638            f(&from_glib_borrow(this))
639        }
640        unsafe {
641            let f: Box_<F> = Box_::new(f);
642            connect_raw(self.as_ptr() as *mut _, c"notify::local".as_ptr() as *const _,
643                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_local_trampoline::<F> as *const ())), Box_::into_raw(f))
644        }
645    }
646
647    #[cfg(feature = "v1_2")]
648    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
649    #[doc(alias = "parent")]
650    pub fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
651        unsafe extern "C" fn notify_parent_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
652            let f: &F = &*(f as *const F);
653            f(&from_glib_borrow(this))
654        }
655        unsafe {
656            let f: Box_<F> = Box_::new(f);
657            connect_raw(self.as_ptr() as *mut _, c"notify::parent".as_ptr() as *const _,
658                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_parent_trampoline::<F> as *const ())), Box_::into_raw(f))
659        }
660    }
661
662    #[cfg(feature = "v1_2")]
663    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
664    #[doc(alias = "proxy")]
665    pub fn connect_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
666        unsafe extern "C" fn notify_proxy_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
667            let f: &F = &*(f as *const F);
668            f(&from_glib_borrow(this))
669        }
670        unsafe {
671            let f: Box_<F> = Box_::new(f);
672            connect_raw(self.as_ptr() as *mut _, c"notify::proxy".as_ptr() as *const _,
673                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_proxy_trampoline::<F> as *const ())), Box_::into_raw(f))
674        }
675    }
676
677    #[cfg(feature = "v1_2")]
678    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
679    #[doc(alias = "remote")]
680    pub fn connect_remote_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
681        unsafe extern "C" fn notify_remote_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
682            let f: &F = &*(f as *const F);
683            f(&from_glib_borrow(this))
684        }
685        unsafe {
686            let f: Box_<F> = Box_::new(f);
687            connect_raw(self.as_ptr() as *mut _, c"notify::remote".as_ptr() as *const _,
688                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_remote_trampoline::<F> as *const ())), Box_::into_raw(f))
689        }
690    }
691
692    #[cfg(feature = "v1_2")]
693    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
694    #[doc(alias = "rsc")]
695    pub fn connect_rsc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
696        unsafe extern "C" fn notify_rsc_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
697            let f: &F = &*(f as *const F);
698            f(&from_glib_borrow(this))
699        }
700        unsafe {
701            let f: Box_<F> = Box_::new(f);
702            connect_raw(self.as_ptr() as *mut _, c"notify::rsc".as_ptr() as *const _,
703                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_rsc_trampoline::<F> as *const ())), Box_::into_raw(f))
704        }
705    }
706
707    #[cfg(feature = "v1_2")]
708    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
709    #[doc(alias = "source-port-max")]
710    pub fn connect_source_port_max_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
711        unsafe extern "C" fn notify_source_port_max_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
712            let f: &F = &*(f as *const F);
713            f(&from_glib_borrow(this))
714        }
715        unsafe {
716            let f: Box_<F> = Box_::new(f);
717            connect_raw(self.as_ptr() as *mut _, c"notify::source-port-max".as_ptr() as *const _,
718                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_source_port_max_trampoline::<F> as *const ())), Box_::into_raw(f))
719        }
720    }
721
722    #[cfg(feature = "v1_2")]
723    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
724    #[doc(alias = "source-port-min")]
725    pub fn connect_source_port_min_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
726        unsafe extern "C" fn notify_source_port_min_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
727            let f: &F = &*(f as *const F);
728            f(&from_glib_borrow(this))
729        }
730        unsafe {
731            let f: Box_<F> = Box_::new(f);
732            connect_raw(self.as_ptr() as *mut _, c"notify::source-port-min".as_ptr() as *const _,
733                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_source_port_min_trampoline::<F> as *const ())), Box_::into_raw(f))
734        }
735    }
736
737    #[cfg(feature = "v1_2")]
738    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
739    #[doc(alias = "tos")]
740    pub fn connect_tos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
741        unsafe extern "C" fn notify_tos_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
742            let f: &F = &*(f as *const F);
743            f(&from_glib_borrow(this))
744        }
745        unsafe {
746            let f: Box_<F> = Box_::new(f);
747            connect_raw(self.as_ptr() as *mut _, c"notify::tos".as_ptr() as *const _,
748                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_tos_trampoline::<F> as *const ())), Box_::into_raw(f))
749        }
750    }
751
752    #[cfg(feature = "v1_2")]
753    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
754    #[doc(alias = "ttl")]
755    pub fn connect_ttl_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
756        unsafe extern "C" fn notify_ttl_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
757            let f: &F = &*(f as *const F);
758            f(&from_glib_borrow(this))
759        }
760        unsafe {
761            let f: Box_<F> = Box_::new(f);
762            connect_raw(self.as_ptr() as *mut _, c"notify::ttl".as_ptr() as *const _,
763                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_ttl_trampoline::<F> as *const ())), Box_::into_raw(f))
764        }
765    }
766}
767
768#[cfg(feature = "v1_2")]
769#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
770impl Default for SettingVxlan {
771                     fn default() -> Self {
772                         Self::new()
773                     }
774                 }
775
776// rustdoc-stripper-ignore-next
777        /// A [builder-pattern] type to construct [`SettingVxlan`] objects.
778        ///
779        /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
780#[must_use = "The builder must be built to be used"]
781pub struct SettingVxlanBuilder {
782            builder: glib::object::ObjectBuilder<'static, SettingVxlan>,
783        }
784
785        impl SettingVxlanBuilder {
786        fn new() -> Self {
787            Self { builder: glib::object::Object::builder() }
788        }
789
790                            /// Specifies the lifetime in seconds of FDB entries learnt by the kernel.
791                            #[cfg(feature = "v1_2")]
792    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
793    pub fn ageing(self, ageing: u32) -> Self {
794                            Self { builder: self.builder.property("ageing", ageing), }
795                        }
796
797                            /// Specifies the UDP destination port to communicate to the remote VXLAN
798                            /// tunnel endpoint.
799                            #[cfg(feature = "v1_2")]
800    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
801    pub fn destination_port(self, destination_port: u32) -> Self {
802                            Self { builder: self.builder.property("destination-port", destination_port), }
803                        }
804
805                            /// Specifies the VXLAN Network Identifier (or VXLAN Segment Identifier) to
806                            /// use.
807                            #[cfg(feature = "v1_2")]
808    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
809    pub fn id(self, id: u32) -> Self {
810                            Self { builder: self.builder.property("id", id), }
811                        }
812
813                            /// Specifies whether netlink LL ADDR miss notifications are generated.
814                            #[cfg(feature = "v1_2")]
815    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
816    pub fn l2_miss(self, l2_miss: bool) -> Self {
817                            Self { builder: self.builder.property("l2-miss", l2_miss), }
818                        }
819
820                            /// Specifies whether netlink IP ADDR miss notifications are generated.
821                            #[cfg(feature = "v1_2")]
822    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
823    pub fn l3_miss(self, l3_miss: bool) -> Self {
824                            Self { builder: self.builder.property("l3-miss", l3_miss), }
825                        }
826
827                            /// Specifies whether unknown source link layer addresses and IP addresses
828                            /// are entered into the VXLAN device forwarding database.
829                            #[cfg(feature = "v1_2")]
830    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
831    pub fn learning(self, learning: bool) -> Self {
832                            Self { builder: self.builder.property("learning", learning), }
833                        }
834
835                            /// Specifies the maximum number of FDB entries. A value of zero means that
836                            /// the kernel will store unlimited entries.
837                            #[cfg(feature = "v1_2")]
838    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
839    pub fn limit(self, limit: u32) -> Self {
840                            Self { builder: self.builder.property("limit", limit), }
841                        }
842
843                            /// If given, specifies the source IP address to use in outgoing packets.
844                            #[cfg(feature = "v1_2")]
845    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
846    pub fn local(self, local: impl Into<glib::GString>) -> Self {
847                            Self { builder: self.builder.property("local", local.into()), }
848                        }
849
850                            /// If given, specifies the parent interface name or parent connection UUID.
851                            #[cfg(feature = "v1_2")]
852    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
853    pub fn parent(self, parent: impl Into<glib::GString>) -> Self {
854                            Self { builder: self.builder.property("parent", parent.into()), }
855                        }
856
857                            /// Specifies whether ARP proxy is turned on.
858                            #[cfg(feature = "v1_2")]
859    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
860    pub fn proxy(self, proxy: bool) -> Self {
861                            Self { builder: self.builder.property("proxy", proxy), }
862                        }
863
864                            /// Specifies the unicast destination IP address to use in outgoing packets
865                            /// when the destination link layer address is not known in the VXLAN device
866                            /// forwarding database, or the multicast IP address to join.
867                            #[cfg(feature = "v1_2")]
868    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
869    pub fn remote(self, remote: impl Into<glib::GString>) -> Self {
870                            Self { builder: self.builder.property("remote", remote.into()), }
871                        }
872
873                            /// Specifies whether route short circuit is turned on.
874                            #[cfg(feature = "v1_2")]
875    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
876    pub fn rsc(self, rsc: bool) -> Self {
877                            Self { builder: self.builder.property("rsc", rsc), }
878                        }
879
880                            /// Specifies the maximum UDP source port to communicate to the remote VXLAN
881                            /// tunnel endpoint.
882                            #[cfg(feature = "v1_2")]
883    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
884    pub fn source_port_max(self, source_port_max: u32) -> Self {
885                            Self { builder: self.builder.property("source-port-max", source_port_max), }
886                        }
887
888                            /// Specifies the minimum UDP source port to communicate to the remote VXLAN
889                            /// tunnel endpoint.
890                            #[cfg(feature = "v1_2")]
891    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
892    pub fn source_port_min(self, source_port_min: u32) -> Self {
893                            Self { builder: self.builder.property("source-port-min", source_port_min), }
894                        }
895
896                            /// Specifies the TOS value to use in outgoing packets.
897                            #[cfg(feature = "v1_2")]
898    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
899    pub fn tos(self, tos: u32) -> Self {
900                            Self { builder: self.builder.property("tos", tos), }
901                        }
902
903                            /// Specifies the time-to-live value to use in outgoing packets.
904                            #[cfg(feature = "v1_2")]
905    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
906    pub fn ttl(self, ttl: u32) -> Self {
907                            Self { builder: self.builder.property("ttl", ttl), }
908                        }
909
910    // rustdoc-stripper-ignore-next
911    /// Build the [`SettingVxlan`].
912    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
913    pub fn build(self) -> SettingVxlan {
914assert_initialized_main_thread!();
915    self.builder.build() }
916}