use crate::{ffi,Setting};
use glib::{prelude::*};
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
use glib::{signal::{connect_raw, SignalHandlerId},translate::*};
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
use std::{boxed::Box as Box_};
glib::wrapper! {
#[doc(alias = "NMSettingVxlan")]
pub struct SettingVxlan(Object<ffi::NMSettingVxlan, ffi::NMSettingVxlanClass>) @extends Setting;
match fn {
type_ => || ffi::nm_setting_vxlan_get_type(),
}
}
impl SettingVxlan {
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_new")]
pub fn new() -> SettingVxlan {
assert_initialized_main_thread!();
unsafe {
Setting::from_glib_full(ffi::nm_setting_vxlan_new()).unsafe_cast()
}
}
pub fn builder() -> SettingVxlanBuilder {
SettingVxlanBuilder::new()
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_ageing")]
#[doc(alias = "get_ageing")]
pub fn ageing(&self) -> u32 {
unsafe {
ffi::nm_setting_vxlan_get_ageing(self.to_glib_none().0)
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_destination_port")]
#[doc(alias = "get_destination_port")]
#[doc(alias = "destination-port")]
pub fn destination_port(&self) -> u32 {
unsafe {
ffi::nm_setting_vxlan_get_destination_port(self.to_glib_none().0)
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_id")]
#[doc(alias = "get_id")]
pub fn id(&self) -> u32 {
unsafe {
ffi::nm_setting_vxlan_get_id(self.to_glib_none().0)
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_l2_miss")]
#[doc(alias = "get_l2_miss")]
#[doc(alias = "l2-miss")]
pub fn is_l2_miss(&self) -> bool {
unsafe {
from_glib(ffi::nm_setting_vxlan_get_l2_miss(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_l3_miss")]
#[doc(alias = "get_l3_miss")]
#[doc(alias = "l3-miss")]
pub fn is_l3_miss(&self) -> bool {
unsafe {
from_glib(ffi::nm_setting_vxlan_get_l3_miss(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_learning")]
#[doc(alias = "get_learning")]
#[doc(alias = "learning")]
pub fn is_learning(&self) -> bool {
unsafe {
from_glib(ffi::nm_setting_vxlan_get_learning(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_limit")]
#[doc(alias = "get_limit")]
pub fn limit(&self) -> u32 {
unsafe {
ffi::nm_setting_vxlan_get_limit(self.to_glib_none().0)
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_local")]
#[doc(alias = "get_local")]
pub fn local(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_setting_vxlan_get_local(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_parent")]
#[doc(alias = "get_parent")]
pub fn parent(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_setting_vxlan_get_parent(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_proxy")]
#[doc(alias = "get_proxy")]
#[doc(alias = "proxy")]
pub fn is_proxy(&self) -> bool {
unsafe {
from_glib(ffi::nm_setting_vxlan_get_proxy(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_remote")]
#[doc(alias = "get_remote")]
pub fn remote(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_setting_vxlan_get_remote(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_rsc")]
#[doc(alias = "get_rsc")]
#[doc(alias = "rsc")]
pub fn is_rsc(&self) -> bool {
unsafe {
from_glib(ffi::nm_setting_vxlan_get_rsc(self.to_glib_none().0))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_source_port_max")]
#[doc(alias = "get_source_port_max")]
#[doc(alias = "source-port-max")]
pub fn source_port_max(&self) -> u32 {
unsafe {
ffi::nm_setting_vxlan_get_source_port_max(self.to_glib_none().0)
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_source_port_min")]
#[doc(alias = "get_source_port_min")]
#[doc(alias = "source-port-min")]
pub fn source_port_min(&self) -> u32 {
unsafe {
ffi::nm_setting_vxlan_get_source_port_min(self.to_glib_none().0)
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_tos")]
#[doc(alias = "get_tos")]
pub fn tos(&self) -> u32 {
unsafe {
ffi::nm_setting_vxlan_get_tos(self.to_glib_none().0)
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vxlan_get_ttl")]
#[doc(alias = "get_ttl")]
pub fn ttl(&self) -> u32 {
unsafe {
ffi::nm_setting_vxlan_get_ttl(self.to_glib_none().0)
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_ageing(&self, ageing: u32) {
ObjectExt::set_property(self,"ageing", ageing)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "destination-port")]
pub fn set_destination_port(&self, destination_port: u32) {
ObjectExt::set_property(self,"destination-port", destination_port)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_id(&self, id: u32) {
ObjectExt::set_property(self,"id", id)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "l2-miss")]
pub fn set_l2_miss(&self, l2_miss: bool) {
ObjectExt::set_property(self,"l2-miss", l2_miss)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "l3-miss")]
pub fn set_l3_miss(&self, l3_miss: bool) {
ObjectExt::set_property(self,"l3-miss", l3_miss)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_learning(&self, learning: bool) {
ObjectExt::set_property(self,"learning", learning)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_limit(&self, limit: u32) {
ObjectExt::set_property(self,"limit", limit)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_local(&self, local: Option<&str>) {
ObjectExt::set_property(self,"local", local)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_parent(&self, parent: Option<&str>) {
ObjectExt::set_property(self,"parent", parent)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_proxy(&self, proxy: bool) {
ObjectExt::set_property(self,"proxy", proxy)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_remote(&self, remote: Option<&str>) {
ObjectExt::set_property(self,"remote", remote)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_rsc(&self, rsc: bool) {
ObjectExt::set_property(self,"rsc", rsc)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "source-port-max")]
pub fn set_source_port_max(&self, source_port_max: u32) {
ObjectExt::set_property(self,"source-port-max", source_port_max)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "source-port-min")]
pub fn set_source_port_min(&self, source_port_min: u32) {
ObjectExt::set_property(self,"source-port-min", source_port_min)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_tos(&self, tos: u32) {
ObjectExt::set_property(self,"tos", tos)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_ttl(&self, ttl: u32) {
ObjectExt::set_property(self,"ttl", ttl)
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "ageing")]
pub fn connect_ageing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_ageing_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::ageing".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_ageing_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "destination-port")]
pub fn connect_destination_port_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
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) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::destination-port".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_destination_port_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "id")]
pub fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_id_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::id".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_id_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "l2-miss")]
pub fn connect_l2_miss_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
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) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::l2-miss".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_l2_miss_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "l3-miss")]
pub fn connect_l3_miss_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
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) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::l3-miss".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_l3_miss_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "learning")]
pub fn connect_learning_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_learning_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::learning".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_learning_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "limit")]
pub fn connect_limit_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_limit_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::limit".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_limit_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "local")]
pub fn connect_local_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_local_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::local".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_local_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "parent")]
pub fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_parent_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::parent".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_parent_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "proxy")]
pub fn connect_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_proxy_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::proxy".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_proxy_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "remote")]
pub fn connect_remote_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_remote_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::remote".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_remote_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "rsc")]
pub fn connect_rsc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_rsc_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::rsc".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_rsc_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "source-port-max")]
pub fn connect_source_port_max_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
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) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::source-port-max".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_source_port_max_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "source-port-min")]
pub fn connect_source_port_min_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
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) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::source-port-min".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_source_port_min_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "tos")]
pub fn connect_tos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_tos_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::tos".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_tos_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "ttl")]
pub fn connect_ttl_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_ttl_trampoline<F: Fn(&SettingVxlan) + 'static>(this: *mut ffi::NMSettingVxlan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::ttl".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_ttl_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
impl Default for SettingVxlan {
fn default() -> Self {
Self::new()
}
}
#[must_use = "The builder must be built to be used"]
pub struct SettingVxlanBuilder {
builder: glib::object::ObjectBuilder<'static, SettingVxlan>,
}
impl SettingVxlanBuilder {
fn new() -> Self {
Self { builder: glib::object::Object::builder() }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn ageing(self, ageing: u32) -> Self {
Self { builder: self.builder.property("ageing", ageing), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn destination_port(self, destination_port: u32) -> Self {
Self { builder: self.builder.property("destination-port", destination_port), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn id(self, id: u32) -> Self {
Self { builder: self.builder.property("id", id), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn l2_miss(self, l2_miss: bool) -> Self {
Self { builder: self.builder.property("l2-miss", l2_miss), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn l3_miss(self, l3_miss: bool) -> Self {
Self { builder: self.builder.property("l3-miss", l3_miss), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn learning(self, learning: bool) -> Self {
Self { builder: self.builder.property("learning", learning), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn limit(self, limit: u32) -> Self {
Self { builder: self.builder.property("limit", limit), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn local(self, local: impl Into<glib::GString>) -> Self {
Self { builder: self.builder.property("local", local.into()), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn parent(self, parent: impl Into<glib::GString>) -> Self {
Self { builder: self.builder.property("parent", parent.into()), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn proxy(self, proxy: bool) -> Self {
Self { builder: self.builder.property("proxy", proxy), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn remote(self, remote: impl Into<glib::GString>) -> Self {
Self { builder: self.builder.property("remote", remote.into()), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn rsc(self, rsc: bool) -> Self {
Self { builder: self.builder.property("rsc", rsc), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn source_port_max(self, source_port_max: u32) -> Self {
Self { builder: self.builder.property("source-port-max", source_port_max), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn source_port_min(self, source_port_min: u32) -> Self {
Self { builder: self.builder.property("source-port-min", source_port_min), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn tos(self, tos: u32) -> Self {
Self { builder: self.builder.property("tos", tos), }
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn ttl(self, ttl: u32) -> Self {
Self { builder: self.builder.property("ttl", ttl), }
}
#[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
pub fn build(self) -> SettingVxlan {
assert_initialized_main_thread!();
self.builder.build() }
}