pub struct LinkMessageBuilder<T> { /* private fields */ }Expand description
Helper struct for building LinkMessage. The LinkMessageBuilder is designed for advanced user, wrapper structs/functions are created
Implementations§
Source§impl LinkMessageBuilder<LinkBond>
impl LinkMessageBuilder<LinkBond>
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create LinkMessageBuilder for bond
pub fn append_info_data(self, info: InfoBond) -> Self
Sourcepub fn mode(self, mode: BondMode) -> Self
pub fn mode(self, mode: BondMode) -> Self
Adds the mode attribute to the bond
This is equivalent to ip link add name NAME type bond mode MODE.
Sourcepub fn active_port(self, active_port: u32) -> Self
pub fn active_port(self, active_port: u32) -> Self
Adds the active_port attribute to the bond, where active_port
is the ifindex of an interface attached to the bond.
This is equivalent to ip link add name NAME type bond active_slave ACTIVE_PORT_NAME.
Sourcepub fn miimon(self, miimon: u32) -> Self
pub fn miimon(self, miimon: u32) -> Self
Adds the miimon attribute to the bond
This is equivalent to ip link add name NAME type bond miimon MIIMON.
Sourcepub fn updelay(self, updelay: u32) -> Self
pub fn updelay(self, updelay: u32) -> Self
Adds the updelay attribute to the bond
This is equivalent to ip link add name NAME type bond updelay UPDELAY.
Sourcepub fn downdelay(self, downdelay: u32) -> Self
pub fn downdelay(self, downdelay: u32) -> Self
Adds the downdelay attribute to the bond
This is equivalent to ip link add name NAME type bond downdelay DOWNDELAY.
Sourcepub fn use_carrier(self, use_carrier: bool) -> Self
pub fn use_carrier(self, use_carrier: bool) -> Self
Adds the use_carrier attribute to the bond
This is equivalent to ip link add name NAME type bond use_carrier USE_CARRIER.
Sourcepub fn arp_interval(self, arp_interval: u32) -> Self
pub fn arp_interval(self, arp_interval: u32) -> Self
Adds the arp_interval attribute to the bond
This is equivalent to ip link add name NAME type bond arp_interval ARP_INTERVAL.
Sourcepub fn arp_validate(self, arp_validate: BondArpValidate) -> Self
pub fn arp_validate(self, arp_validate: BondArpValidate) -> Self
Adds the arp_validate attribute to the bond
This is equivalent to ip link add name NAME type bond arp_validate ARP_VALIDATE.
Sourcepub fn arp_all_targets(self, arp_all_targets: BondArpAllTargets) -> Self
pub fn arp_all_targets(self, arp_all_targets: BondArpAllTargets) -> Self
Adds the arp_all_targets attribute to the bond
This is equivalent to ip link add name NAME type bond arp_all_targets ARP_ALL_TARGETS
Sourcepub fn primary(self, primary: u32) -> Self
pub fn primary(self, primary: u32) -> Self
Adds the primary attribute to the bond, where primary is the ifindex
of an interface.
This is equivalent to ip link add name NAME type bond primary PRIMARY_NAME
Sourcepub fn primary_reselect(self, primary_reselect: BondPrimaryReselect) -> Self
pub fn primary_reselect(self, primary_reselect: BondPrimaryReselect) -> Self
Adds the primary_reselect attribute to the bond
This is equivalent to ip link add name NAME type bond primary_reselect PRIMARY_RESELECT.
Sourcepub fn fail_over_mac(self, fail_over_mac: BondFailOverMac) -> Self
pub fn fail_over_mac(self, fail_over_mac: BondFailOverMac) -> Self
Adds the fail_over_mac attribute to the bond
This is equivalent to ip link add name NAME type bond fail_over_mac FAIL_OVER_MAC.
Sourcepub fn xmit_hash_policy(self, xmit_hash_policy: BondXmitHashPolicy) -> Self
pub fn xmit_hash_policy(self, xmit_hash_policy: BondXmitHashPolicy) -> Self
Adds the xmit_hash_policy attribute to the bond
This is equivalent to ip link add name NAME type bond xmit_hash_policy XMIT_HASH_POLICY.
Sourcepub fn resend_igmp(self, resend_igmp: u32) -> Self
pub fn resend_igmp(self, resend_igmp: u32) -> Self
Adds the resend_igmp attribute to the bond
This is equivalent to ip link add name NAME type bond resend_igmp RESEND_IGMP.
Sourcepub fn num_peer_notif(self, num_peer_notif: u8) -> Self
pub fn num_peer_notif(self, num_peer_notif: u8) -> Self
Adds the num_peer_notif attribute to the bond
This is equivalent to ip link add name NAME type bond num_peer_notif NUM_PEER_NOTIF.
Sourcepub fn all_ports_active(self, all_ports_active: BondAllPortActive) -> Self
pub fn all_ports_active(self, all_ports_active: BondAllPortActive) -> Self
Adds the all_ports_active attribute to the bond
This is equivalent to ip link add name NAME type bond all_slaves_active ALL_PORTS_ACTIVE.
Sourcepub fn min_links(self, min_links: u32) -> Self
pub fn min_links(self, min_links: u32) -> Self
Adds the min_links attribute to the bond
This is equivalent to ip link add name NAME type bond min_links MIN_LINKS.
Sourcepub fn lp_interval(self, lp_interval: u32) -> Self
pub fn lp_interval(self, lp_interval: u32) -> Self
Adds the lp_interval attribute to the bond
This is equivalent to ip link add name NAME type bond lp_interval LP_INTERVAL.
Sourcepub fn packets_per_port(self, packets_per_port: u32) -> Self
pub fn packets_per_port(self, packets_per_port: u32) -> Self
Adds the packets_per_port attribute to the bond
This is equivalent to ip link add name NAME type bond packets_per_slave PACKETS_PER_PORT.
Sourcepub fn ad_lacp_rate(self, ad_lacp_rate: BondLacpRate) -> Self
pub fn ad_lacp_rate(self, ad_lacp_rate: BondLacpRate) -> Self
Adds the ad_lacp_rate attribute to the bond
This is equivalent to ip link add name NAME type bond ad_lacp_rate AD_LACP_RATE.
Sourcepub fn ad_select(self, ad_select: u8) -> Self
pub fn ad_select(self, ad_select: u8) -> Self
Adds the ad_select attribute to the bond
This is equivalent to ip link add name NAME type bond ad_select AD_SELECT.
Sourcepub fn ad_actor_sys_prio(self, ad_actor_sys_prio: u16) -> Self
pub fn ad_actor_sys_prio(self, ad_actor_sys_prio: u16) -> Self
Adds the ad_actor_sys_prio attribute to the bond
This is equivalent to ip link add name NAME type bond ad_actor_sys_prio AD_ACTOR_SYS_PRIO.
Sourcepub fn ad_user_port_key(self, ad_user_port_key: u16) -> Self
pub fn ad_user_port_key(self, ad_user_port_key: u16) -> Self
Adds the ad_user_port_key attribute to the bond
This is equivalent to ip link add name NAME type bond ad_user_port_key AD_USER_PORT_KEY.
Sourcepub fn ad_actor_system(self, ad_actor_system: [u8; 6]) -> Self
pub fn ad_actor_system(self, ad_actor_system: [u8; 6]) -> Self
Adds the ad_actor_system attribute to the bond
This is equivalent to ip link add name NAME type bond ad_actor_system AD_ACTOR_SYSTEM.
Sourcepub fn tlb_dynamic_lb(self, tlb_dynamic_lb: bool) -> Self
pub fn tlb_dynamic_lb(self, tlb_dynamic_lb: bool) -> Self
Adds the tlb_dynamic_lb attribute to the bond
This is equivalent to ip link add name NAME type bond tlb_dynamic_lb TLB_DYNAMIC_LB.
Sourcepub fn peer_notif_delay(self, peer_notif_delay: u32) -> Self
pub fn peer_notif_delay(self, peer_notif_delay: u32) -> Self
Adds the peer_notif_delay attribute to the bond
This is equivalent to ip link add name NAME type bond peer_notif_delay PEER_NOTIF_DELAY.
Sourcepub fn ad_lacp_active(self, ad_lacp_active: bool) -> Self
pub fn ad_lacp_active(self, ad_lacp_active: bool) -> Self
Adds the ad_lacp_active attribute to the bond
This is equivalent to ip link add name NAME type bond ad_lacp_active AD_LACP_ACTIVE.
Sourcepub fn missed_max(self, missed_max: u8) -> Self
pub fn missed_max(self, missed_max: u8) -> Self
Adds the missed_max attribute to the bond
This is equivalent to ip link add name NAME type bond missed_max MISSED_MAX.
Sourcepub fn arp_ip_target(self, arp_ip_target: Vec<Ipv4Addr>) -> Self
pub fn arp_ip_target(self, arp_ip_target: Vec<Ipv4Addr>) -> Self
Adds the arp_ip_target attribute to the bond
This is equivalent to ip link add name NAME type bond arp_ip_target LIST.
Sourcepub fn ns_ip6_target(self, ns_ip6_target: Vec<Ipv6Addr>) -> Self
pub fn ns_ip6_target(self, ns_ip6_target: Vec<Ipv6Addr>) -> Self
Adds the ns_ip6_target attribute to the bond
This is equivalent to ip link add name NAME type bond ns_ip6_target LIST.
Source§impl LinkMessageBuilder<LinkBondPort>
impl LinkMessageBuilder<LinkBondPort>
Sourcepub fn append_info_data(self, info: InfoBondPort) -> Self
pub fn append_info_data(self, info: InfoBondPort) -> Self
Append arbitrary InfoBondPort
Source§impl LinkMessageBuilder<LinkBridge>
impl LinkMessageBuilder<LinkBridge>
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create LinkMessageBuilder for linux bridge
pub fn append_info_data(self, info: InfoBridge) -> Self
pub fn set_boolean_opt(self, opt: BridgeBooleanOptionFlags, value: bool) -> Self
pub fn ageing_time(self, value: u32) -> Self
pub fn group_fwd_mask(self, value: u16) -> Self
pub fn group_address(self, value: [u8; 6]) -> Self
pub fn forward_delay(self, value: u32) -> Self
pub fn hello_time(self, value: u32) -> Self
pub fn max_age(self, value: u32) -> Self
pub fn stp_state(self, value: BridgeStpState) -> Self
pub fn mst_enabled(self, value: bool) -> Self
pub fn priority(self, value: u16) -> Self
pub fn no_linklocal_learn(self, value: bool) -> Self
pub fn fdb_local_vlan_0(self, value: bool) -> Self
pub fn fdb_max_learned(self, value: u32) -> Self
pub fn vlan_filtering(self, value: bool) -> Self
pub fn vlan_protocol(self, value: VlanProtocol) -> Self
pub fn vlan_default_pvid(self, value: u16) -> Self
pub fn vlan_stats_enabled(self, value: bool) -> Self
pub fn vlan_stats_per_port(self, value: bool) -> Self
pub fn mcast_snooping(self, value: bool) -> Self
pub fn mcast_vlan_snooping(self, value: bool) -> Self
pub fn mcast_router(self, value: BridgeMulticastRouterType) -> Self
pub fn mcast_query_use_ifaddr(self, value: bool) -> Self
pub fn mcast_querier(self, value: bool) -> Self
pub fn mcast_hash_max(self, value: u32) -> Self
pub fn mcast_last_member_count(self, value: u32) -> Self
pub fn mcast_startup_query_count(self, value: u32) -> Self
pub fn mcast_last_member_interval(self, value: u64) -> Self
pub fn mcast_membership_interval(self, value: u64) -> Self
pub fn mcast_querier_interval(self, value: u64) -> Self
pub fn mcast_query_interval(self, value: u64) -> Self
pub fn mcast_query_response_interval(self, value: u64) -> Self
pub fn mcast_startup_query_interval(self, value: u64) -> Self
pub fn mcast_stats_enabled(self, value: bool) -> Self
pub fn mcast_igmp_version(self, value: u8) -> Self
pub fn mcast_mld_version(self, value: u8) -> Self
pub fn nf_call_iptables(self, value: bool) -> Self
pub fn nf_call_ip6tables(self, value: bool) -> Self
pub fn nf_call_arptables(self, value: bool) -> Self
pub fn mdb_offload_fail_notification(self, value: bool) -> Self
Source§impl LinkMessageBuilder<LinkBridgePort>
impl LinkMessageBuilder<LinkBridgePort>
Sourcepub fn append_info_data(self, info: InfoBridgePort) -> Self
pub fn append_info_data(self, info: InfoBridgePort) -> Self
Append arbitrary InfoBridgePort
Sourcepub fn fdb_flush(self) -> Self
pub fn fdb_flush(self) -> Self
This is equivalent to
ip link set name NAME type bridge_slave fdb_flush.
Sourcepub fn state(self, v: BridgePortState) -> Self
pub fn state(self, v: BridgePortState) -> Self
This is equivalent to
ip link set name NAME type bridge_slave state STATE.
Sourcepub fn priority(self, v: u16) -> Self
pub fn priority(self, v: u16) -> Self
This is equivalent to
ip link set name NAME type bridge_slave priority PRIO.
Sourcepub fn cost(self, v: u32) -> Self
pub fn cost(self, v: u32) -> Self
This is equivalent to
ip link set name NAME type bridge_slave cost COST.
Sourcepub fn guard(self, v: bool) -> Self
pub fn guard(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave guard { on | off }.
Sourcepub fn hairpin(self, v: bool) -> Self
pub fn hairpin(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave hairpin { on | off }.
Sourcepub fn root_block(self, v: bool) -> Self
pub fn root_block(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave root_block { on | off }.
Sourcepub fn learning(self, v: bool) -> Self
pub fn learning(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave learning { on | off }.
Sourcepub fn flood(self, v: bool) -> Self
pub fn flood(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave flood { on | off }.
Sourcepub fn proxy_arp(self, v: bool) -> Self
pub fn proxy_arp(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave proxy_arp { on | off }.
Sourcepub fn proxy_arp_wifi(self, v: bool) -> Self
pub fn proxy_arp_wifi(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave proxy_arp_wifi { on | off }.
Sourcepub fn mcast_router(self, v: BridgeMulticastRouterType) -> Self
pub fn mcast_router(self, v: BridgeMulticastRouterType) -> Self
This is equivalent to
ip link set name NAME type bridge_slave mcast_router MULTICAST_ROUTER.
Sourcepub fn mcast_fast_leave(self, v: bool) -> Self
pub fn mcast_fast_leave(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave mcast_fast_leave { on | off }.
and
ip link set name NAME type bridge_slave fastleave { on | off }.
Sourcepub fn bcast_flood(self, v: bool) -> Self
pub fn bcast_flood(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave bcast_flood { on | off }.
Sourcepub fn mcast_flood(self, v: bool) -> Self
pub fn mcast_flood(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave mcast_flood { on | off }.
Sourcepub fn mcast_to_unicast(self, v: bool) -> Self
pub fn mcast_to_unicast(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave mcast_to_unicast { on | off }.
Sourcepub fn group_fwd_mask(self, v: u16) -> Self
pub fn group_fwd_mask(self, v: u16) -> Self
This is equivalent to
ip link set name NAME type bridge_slave group_fwd_mask MASK.
Sourcepub fn neigh_suppress(self, v: bool) -> Self
pub fn neigh_suppress(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave neigh_suppress { on | off }.
Sourcepub fn neigh_vlan_suppress(self, v: bool) -> Self
pub fn neigh_vlan_suppress(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave \ neigh_vlan_suppress { on | off }.
Sourcepub fn vlan_tunnel(self, v: bool) -> Self
pub fn vlan_tunnel(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave vlan_tunnel { on | off }.
Sourcepub fn isolated(self, v: bool) -> Self
pub fn isolated(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave isolated { on | off }.
Sourcepub fn locked(self, v: bool) -> Self
pub fn locked(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave locked { on | off }.
Sourcepub fn mab(self, v: bool) -> Self
pub fn mab(self, v: bool) -> Self
This is equivalent to
ip link set name NAME type bridge_slave mab { on | off }.
Sourcepub fn backup_port(self, iface_index: u32) -> Self
pub fn backup_port(self, iface_index: u32) -> Self
This is equivalent to
ip link set name NAME type bridge_slave backup_port DEVICE
but only accept interface index. Setting to 0 equal to
Self::nobackup_port().
Sourcepub fn nobackup_port(self) -> Self
pub fn nobackup_port(self) -> Self
This is equivalent to
ip link set name NAME type bridge_slave nobackup_port
Sourcepub fn backup_nhid(self, v: u32) -> Self
pub fn backup_nhid(self, v: u32) -> Self
This is equivalent to
ip link set name NAME type bridge_slave backup_nhid NHID
Source§impl LinkMessageBuilder<LinkBridgeVlan>
impl LinkMessageBuilder<LinkBridgeVlan>
Sourcepub fn append_af_spec(self, spec: AfSpecBridge) -> Self
pub fn append_af_spec(self, spec: AfSpecBridge) -> Self
Append arbitrary LinkAttribute::AfSpecBridge
pub fn vlan(self, vid: u16, flags: BridgeVlanInfoFlags) -> Self
Sourcepub fn vlan_range_start(self, vid: u16, flags: BridgeVlanInfoFlags) -> Self
pub fn vlan_range_start(self, vid: u16, flags: BridgeVlanInfoFlags) -> Self
Helper function by adding BridgeVlanInfoFlags::RangeBegin
automatically to flags
Sourcepub fn vlan_range_end(self, vid: u16, flags: BridgeVlanInfoFlags) -> Self
pub fn vlan_range_end(self, vid: u16, flags: BridgeVlanInfoFlags) -> Self
Helper function by adding BridgeVlanInfoFlags::RangeEnd
automatically to flags
Sourcepub fn bridge_self(self) -> Self
pub fn bridge_self(self) -> Self
Change VLAN of bridge itself
Equal to the self argument in bridge vlan add dev br0 vid 11 self
Source§impl<T> LinkMessageBuilder<T>
impl<T> LinkMessageBuilder<T>
pub fn new_with_info_kind(info_kind: InfoKind) -> Self
Sourcepub fn set_header(self, header: LinkHeader) -> Self
pub fn set_header(self, header: LinkHeader) -> Self
Set arbitrary LinkHeader
Sourcepub fn append_extra_attribute(self, link_attr: LinkAttribute) -> Self
pub fn append_extra_attribute(self, link_attr: LinkAttribute) -> Self
Append arbitrary LinkAttribute
Sourcepub fn set_info_data(self, info_data: InfoData) -> Self
pub fn set_info_data(self, info_data: InfoData) -> Self
Set arbitrary InfoData
Sourcepub fn promiscuous(self, enable: bool) -> Self
pub fn promiscuous(self, enable: bool) -> Self
Enable or disable promiscious mode of the link with the given index
(equivalent to ip link set dev DEV promisc on/off)
Sourcepub fn arp(self, enable: bool) -> Self
pub fn arp(self, enable: bool) -> Self
Enable or disable the ARP protocol of the link with the given index
(equivalent to ip link set dev DEV arp on/off)
pub fn name(self, name: String) -> Self
Sourcepub fn mtu(self, mtu: u32) -> Self
pub fn mtu(self, mtu: u32) -> Self
Set the mtu of the link with the given index (equivalent to
ip link set DEV mtu MTU)
Sourcepub fn index(self, index: u32) -> Self
pub fn index(self, index: u32) -> Self
Kernel index number of interface, used for querying, modifying or deleting existing interface.
pub fn interface_family(self, family: AddressFamily) -> Self
Sourcepub fn address(self, address: Vec<u8>) -> Self
pub fn address(self, address: Vec<u8>) -> Self
Define the hardware address of the link when creating it (equivalent to
ip link add NAME address ADDRESS)
Sourcepub fn setns_by_pid(self, pid: u32) -> Self
pub fn setns_by_pid(self, pid: u32) -> Self
Move this network device into the network namespace of the process with
the given pid.
Sourcepub fn setns_by_fd(self, fd: RawFd) -> Self
pub fn setns_by_fd(self, fd: RawFd) -> Self
Move this network device into the network namespace corresponding to the given file descriptor.
Sourcepub fn link(self, index: u32) -> Self
pub fn link(self, index: u32) -> Self
The physical device to act operate on. (e.g. the parent interface of VLAN/VxLAN)
Sourcepub fn controller(self, ctrl_index: u32) -> Self
pub fn controller(self, ctrl_index: u32) -> Self
Define controller interface index (similar to ip link set NAME master CONTROLLER_NAME)
Sourcepub fn nocontroller(self) -> Self
pub fn nocontroller(self) -> Self
Detach the link from its controller. This is equivalent to ip link set LINK nomaster. To succeed, the link that is being detached must be
UP.
pub fn set_port_kind(self, port_kind: InfoPortKind) -> Self
Sourcepub fn set_port_data(self, port_data: InfoPortData) -> Self
pub fn set_port_data(self, port_data: InfoPortData) -> Self
Include port settings. The [LinkBondPort] and [LinkBridgePort] are the helper
pub fn build(self) -> LinkMessage
Source§impl LinkMessageBuilder<LinkDummy>
impl LinkMessageBuilder<LinkDummy>
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create LinkMessageBuilder for dummy interface type
Source§impl LinkMessageBuilder<LinkMacVlan>
impl LinkMessageBuilder<LinkMacVlan>
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create LinkMessageBuilder for MAC VLAN
pub fn append_info_data(self, info: InfoMacVlan) -> Self
pub fn mode(self, mode: MacVlanMode) -> Self
Source§impl LinkMessageBuilder<LinkMacVtap>
impl LinkMessageBuilder<LinkMacVtap>
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create LinkMessageBuilder for Mac VTAP interface
pub fn append_info_data(self, info: InfoMacVtap) -> Self
pub fn mode(self, mode: MacVtapMode) -> Self
Source§impl LinkMessageBuilder<LinkMacSec>
impl LinkMessageBuilder<LinkMacSec>
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create LinkMessageBuilder for MACSEC
pub fn append_info_data(self, info: InfoMacSec) -> Self
pub fn sci(self, sci: u64) -> Self
pub fn port(self, port: u16) -> Self
pub fn icv_len(self, icv_len: u8) -> Self
pub fn cipher_suite(self, cipher_suite: MacSecCipherId) -> Self
pub fn window(self, window: u32) -> Self
pub fn encoding_sa(self, encoding_sa: u8) -> Self
pub fn encrypt(self, encrypt: bool) -> Self
pub fn protect(self, protect: bool) -> Self
pub fn inc_sci(self, inc_sci: bool) -> Self
pub fn es(self, es: bool) -> Self
pub fn scb(self, scb: bool) -> Self
pub fn replay_protect(self, replay_protect: bool) -> Self
pub fn validation(self, validation: MacSecValidate) -> Self
pub fn offload(self, offload: MacSecOffload) -> Self
pub fn other(self, other: DefaultNla) -> Self
Source§impl LinkMessageBuilder<LinkNetkit>
impl LinkMessageBuilder<LinkNetkit>
Sourcepub fn new(name: &str, peer: &str, mode: NetkitMode) -> Self
pub fn new(name: &str, peer: &str, mode: NetkitMode) -> Self
Create LinkMessageBuilder for netkit
Sourcepub fn mode(self, mode: NetkitMode) -> Self
pub fn mode(self, mode: NetkitMode) -> Self
Set the netkit mode (L2 or L3)
Sourcepub fn policy(self, policy: NetkitPolicy) -> Self
pub fn policy(self, policy: NetkitPolicy) -> Self
Set the policy for the primary interface
Sourcepub fn peer_policy(self, policy: NetkitPolicy) -> Self
pub fn peer_policy(self, policy: NetkitPolicy) -> Self
Set the policy for the peer interface
Sourcepub fn scrub(self, scrub: NetkitScrub) -> Self
pub fn scrub(self, scrub: NetkitScrub) -> Self
Set the scrub settings for the primary interface
Sourcepub fn peer_scrub(self, scrub: NetkitScrub) -> Self
pub fn peer_scrub(self, scrub: NetkitScrub) -> Self
Set the scrub settings for the peer interface
Source§impl LinkMessageBuilder<LinkVlan>
impl LinkMessageBuilder<LinkVlan>
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create LinkMessageBuilder for VLAN
pub fn append_info_data(self, info: InfoVlan) -> Self
Sourcepub fn protocol(self, protocol: VlanProtocol) -> Self
pub fn protocol(self, protocol: VlanProtocol) -> Self
VLAN protocol
Source§impl LinkMessageBuilder<LinkVrf>
impl LinkMessageBuilder<LinkVrf>
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create LinkMessageBuilder for VRF
pub fn append_info_data(self, info: InfoVrf) -> Self
Source§impl LinkMessageBuilder<LinkVxlan>
impl LinkMessageBuilder<LinkVxlan>
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create LinkMessageBuilder for VLAN
pub fn append_info_data(self, info: InfoVxlan) -> Self
Sourcepub fn dev(self, index: u32) -> Self
pub fn dev(self, index: u32) -> Self
This is equivalent to devPHYS_DEV for ip link vxlan.
Adds the dev attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI dev LINK, dev LINK - specifies the physical device to use
for tunnel endpoint communication.
But instead of specifing a link name (LINK), we specify a link index.
Please be aware the LinkMessageBuilder::link() will not works for
VxLAN.
Sourcepub fn port(self, port: u16) -> Self
pub fn port(self, port: u16) -> Self
Adds the dstport attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI dstport PORT. dstport PORT - specifies the UDP destination port to
communicate to the remote VXLAN tunnel endpoint.
Sourcepub fn group(self, addr: Ipv4Addr) -> Self
pub fn group(self, addr: Ipv4Addr) -> Self
Adds the group attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI group IPADDR, group IPADDR - specifies the multicast IP address to join.
This function takes an IPv4 address
WARNING: only one between remote and group can be present.
Sourcepub fn group6(self, addr: Ipv6Addr) -> Self
pub fn group6(self, addr: Ipv6Addr) -> Self
Adds the group attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI group IPADDR, group IPADDR - specifies the multicast IP address to join.
This function takes an IPv6 address
WARNING: only one between remote and group can be present.
Sourcepub fn remote(self, addr: Ipv4Addr) -> Self
pub fn remote(self, addr: Ipv4Addr) -> Self
Adds the remote attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI remote IPADDR, remote IPADDR - specifies the unicast destination IP
address to use in outgoing packets when the
destination link layer address is not known in the
VXLAN device forwarding database.
This function takes an IPv4 address.
WARNING: only one between remote and group can be present.
Sourcepub fn remote6(self, addr: Ipv6Addr) -> Self
pub fn remote6(self, addr: Ipv6Addr) -> Self
Adds the remote attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI remote IPADDR, remote IPADDR - specifies the unicast destination IP
address to use in outgoing packets when the
destination link layer address is not known in the
VXLAN device forwarding database.
This function takes an IPv6 address.
WARNING: only one between remote and group can be present.
Sourcepub fn local(self, addr: Ipv4Addr) -> Self
pub fn local(self, addr: Ipv4Addr) -> Self
Adds the local attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI local IPADDR, local IPADDR - specifies the source IP address to use in
outgoing packets. This function takes an IPv4 address.
Sourcepub fn local6(self, addr: Ipv6Addr) -> Self
pub fn local6(self, addr: Ipv6Addr) -> Self
Adds the local attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI local IPADDR, local IPADDR - specifies the source IP address to use in
outgoing packets. This function takes an IPv6 address.
Sourcepub fn tos(self, tos: u8) -> Self
pub fn tos(self, tos: u8) -> Self
Adds the tos attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI tos TOS.
tos TOS - specifies the TOS value to use in outgoing packets.
Sourcepub fn ttl(self, ttl: u8) -> Self
pub fn ttl(self, ttl: u8) -> Self
Adds the ttl attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI ttl TTL.
ttl TTL - specifies the TTL value to use in outgoing packets.
Sourcepub fn label(self, label: u32) -> Self
pub fn label(self, label: u32) -> Self
Adds the flowlabel attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI flowlabel LABEL. flowlabel LABEL - specifies the flow label to use in
outgoing packets.
Sourcepub fn learning(self, learning: bool) -> Self
pub fn learning(self, learning: bool) -> Self
Adds the learning attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI \[no\]learning. [no]learning - specifies if unknown source link layer
addresses and IP addresses are entered into the VXLAN
device forwarding database.
Sourcepub fn ageing(self, seconds: u32) -> Self
pub fn ageing(self, seconds: u32) -> Self
Adds the ageing attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI ageing SECONDS. ageing SECONDS - specifies the lifetime in seconds of
FDB entries learnt by the kernel.
Sourcepub fn limit(self, limit: u32) -> Self
pub fn limit(self, limit: u32) -> Self
Adds the maxaddress attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI maxaddress LIMIT. maxaddress LIMIT - specifies the maximum number
of FDB entries.
Sourcepub fn port_range(self, min: u16, max: u16) -> Self
pub fn port_range(self, min: u16, max: u16) -> Self
Adds the srcport attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI srcport MIN MAX. srcport MIN MAX - specifies the range of port numbers
to use as UDP source ports to communicate to the
remote VXLAN tunnel endpoint.
Sourcepub fn proxy(self, proxy: bool) -> Self
pub fn proxy(self, proxy: bool) -> Self
Adds the proxy attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI [no]proxy. [no]proxy - specifies ARP proxy is turned on.
Sourcepub fn rsc(self, rsc: bool) -> Self
pub fn rsc(self, rsc: bool) -> Self
Adds the rsc attribute to the VXLAN This is equivalent to
ip link add name NAME type vxlan id VNI [no]rsc.
[no]rsc - specifies if route short circuit is turned on.
Sourcepub fn l2miss(self, l2miss: bool) -> Self
pub fn l2miss(self, l2miss: bool) -> Self
This is equivalent to ip link add name NAME type vxlan id VNI [no]l2miss. [no]l2miss - specifies if netlink LLADDR miss
notifications are generated.
Sourcepub fn l3miss(self, l3miss: bool) -> Self
pub fn l3miss(self, l3miss: bool) -> Self
This is equivalent to ip link add name NAME type vxlan id VNI [no]l3miss. [no]l3miss - specifies if netlink IP ADDR
miss notifications are generated.
pub fn collect_metadata(self, collect_metadata: bool) -> Self
Source§impl LinkMessageBuilder<LinkWireguard>
impl LinkMessageBuilder<LinkWireguard>
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create LinkMessageBuilder for wireguard
Source§impl LinkMessageBuilder<LinkXfrm>
impl LinkMessageBuilder<LinkXfrm>
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create LinkMessageBuilder for XFRM