1#[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 #[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 #[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 pub fn builder() -> SettingBridgeBuilder {
273 SettingBridgeBuilder::new()
274 }
275
276 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 pub fn set_priority(&self, priority: u32) {
1010 ObjectExt::set_property(self, "priority", priority)
1011 }
1012
1013 pub fn set_stp(&self, stp: bool) {
1015 ObjectExt::set_property(self, "stp", stp)
1016 }
1017
1018 #[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 #[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 #[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 #[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 #[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 #[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#[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 pub fn ageing_time(self, ageing_time: u32) -> Self {
1843 Self {
1844 builder: self.builder.property("ageing-time", ageing_time),
1845 }
1846 }
1847
1848 pub fn forward_delay(self, forward_delay: u32) -> Self {
1850 Self {
1851 builder: self.builder.property("forward-delay", forward_delay),
1852 }
1853 }
1854
1855 #[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 #[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 pub fn hello_time(self, hello_time: u32) -> Self {
1886 Self {
1887 builder: self.builder.property("hello-time", hello_time),
1888 }
1889 }
1890
1891 #[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 pub fn max_age(self, max_age: u32) -> Self {
1908 Self {
1909 builder: self.builder.property("max-age", max_age),
1910 }
1911 }
1912
1913 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 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 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 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 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 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 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 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 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 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 #[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 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 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 pub fn priority(self, priority: u32) -> Self {
2061 Self {
2062 builder: self.builder.property("priority", priority),
2063 }
2064 }
2065
2066 pub fn stp(self, stp: bool) -> Self {
2068 Self {
2069 builder: self.builder.property("stp", stp),
2070 }
2071 }
2072
2073 #[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 #[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 #[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 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 #[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 #[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}