1use 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 #[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 #[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 pub fn builder() -> SettingVxlanBuilder {
166 SettingVxlanBuilder::new()
167 }
168
169
170 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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#[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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}