Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Commit

Permalink
Add bond support
Browse files Browse the repository at this point in the history
Add initial support for managing bond links. Example:

  $ ./target/debug/examples/create_bond
  $ ip -d link show my-bond
  34: my-bond: <NO-CARRIER,BROADCAST,MULTICAST,MASTER,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
      link/ether 56:2b:f4:82:a2:a4 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
      bond mode active-backup miimon 100 updelay 100 downdelay 100 peer_notify_delay 0 use_carrier 1 arp_interval 0 arp_missed_max 2 arp_ip_target 6.6.7.7,8.8.9.10 ns_ip6_target fd01::1,fd02::2 arp_validate none arp_all_targets any primary_reselect always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1 num_grat_arp 1 all_slaves_active 0 min_links 2 lp_interval 1 packets_per_slave 1 lacp_active on lacp_rate slow ad_select stable tlb_dynamic_lb 1 addrgenmode eui64 numtxqueues 16 numrxqueues 16 gso_max_size 65536 gso_max_segs 65535 gro_max_size 65536
  • Loading branch information
bengal authored and cathay4t committed Jul 7, 2022
1 parent 1532492 commit 99b5765
Show file tree
Hide file tree
Showing 6 changed files with 887 additions and 43 deletions.
78 changes: 41 additions & 37 deletions netlink-packet-route/src/rtnl/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -978,43 +978,47 @@ pub const __IFLA_VXLAN_MAX: u16 = 30;
// pub const IFLA_GTP_FD1: int = 2;
// pub const IFLA_GTP_PDP_HASHSIZE: int = 3;
// pub const IFLA_GTP_ROLE: int = 4;
//
// pub const IFLA_BOND_UNSPEC: int = 0;
// pub const IFLA_BOND_MODE: int = 1;
// pub const IFLA_BOND_ACTIVE_SLAVE: int = 2;
// pub const IFLA_BOND_MIIMON: int = 3;
// pub const IFLA_BOND_UPDELAY: int = 4;
// pub const IFLA_BOND_DOWNDELAY: int = 5;
// pub const IFLA_BOND_USE_CARRIER: int = 6;
// pub const IFLA_BOND_ARP_INTERVAL: int = 7;
// pub const IFLA_BOND_ARP_IP_TARGET: int = 8;
// pub const IFLA_BOND_ARP_VALIDATE: int = 9;
// pub const IFLA_BOND_ARP_ALL_TARGETS: int = 10;
// pub const IFLA_BOND_PRIMARY: int = 11;
// pub const IFLA_BOND_PRIMARY_RESELECT: int = 12;
// pub const IFLA_BOND_FAIL_OVER_MAC: int = 13;
// pub const IFLA_BOND_XMIT_HASH_POLICY: int = 14;
// pub const IFLA_BOND_RESEND_IGMP: int = 15;
// pub const IFLA_BOND_NUM_PEER_NOTIF: int = 16;
// pub const IFLA_BOND_ALL_SLAVES_ACTIVE: int = 17;
// pub const IFLA_BOND_MIN_LINKS: int = 18;
// pub const IFLA_BOND_LP_INTERVAL: int = 19;
// pub const IFLA_BOND_PACKETS_PER_SLAVE: int = 20;
// pub const IFLA_BOND_AD_LACP_RATE: int = 21;
// pub const IFLA_BOND_AD_SELECT: int = 22;
// pub const IFLA_BOND_AD_INFO: int = 23;
// pub const IFLA_BOND_AD_ACTOR_SYS_PRIO: int = 24;
// pub const IFLA_BOND_AD_USER_PORT_KEY: int = 25;
// pub const IFLA_BOND_AD_ACTOR_SYSTEM: int = 26;
// pub const IFLA_BOND_TLB_DYNAMIC_LB: int = 27;
//
// pub const IFLA_BOND_AD_INFO_UNSPEC: int = 0;
// pub const IFLA_BOND_AD_INFO_AGGREGATOR: int = 1;
// pub const IFLA_BOND_AD_INFO_NUM_PORTS: int = 2;
// pub const IFLA_BOND_AD_INFO_ACTOR_KEY: int = 3;
// pub const IFLA_BOND_AD_INFO_PARTNER_KEY: int = 4;
// pub const IFLA_BOND_AD_INFO_PARTNER_MAC: int = 5;
//

pub const IFLA_BOND_UNSPEC: u16 = 0;
pub const IFLA_BOND_MODE: u16 = 1;
pub const IFLA_BOND_ACTIVE_SLAVE: u16 = 2;
pub const IFLA_BOND_MIIMON: u16 = 3;
pub const IFLA_BOND_UPDELAY: u16 = 4;
pub const IFLA_BOND_DOWNDELAY: u16 = 5;
pub const IFLA_BOND_USE_CARRIER: u16 = 6;
pub const IFLA_BOND_ARP_INTERVAL: u16 = 7;
pub const IFLA_BOND_ARP_IP_TARGET: u16 = 8;
pub const IFLA_BOND_ARP_VALIDATE: u16 = 9;
pub const IFLA_BOND_ARP_ALL_TARGETS: u16 = 10;
pub const IFLA_BOND_PRIMARY: u16 = 11;
pub const IFLA_BOND_PRIMARY_RESELECT: u16 = 12;
pub const IFLA_BOND_FAIL_OVER_MAC: u16 = 13;
pub const IFLA_BOND_XMIT_HASH_POLICY: u16 = 14;
pub const IFLA_BOND_RESEND_IGMP: u16 = 15;
pub const IFLA_BOND_NUM_PEER_NOTIF: u16 = 16;
pub const IFLA_BOND_ALL_SLAVES_ACTIVE: u16 = 17;
pub const IFLA_BOND_MIN_LINKS: u16 = 18;
pub const IFLA_BOND_LP_INTERVAL: u16 = 19;
pub const IFLA_BOND_PACKETS_PER_SLAVE: u16 = 20;
pub const IFLA_BOND_AD_LACP_RATE: u16 = 21;
pub const IFLA_BOND_AD_SELECT: u16 = 22;
pub const IFLA_BOND_AD_INFO: u16 = 23;
pub const IFLA_BOND_AD_ACTOR_SYS_PRIO: u16 = 24;
pub const IFLA_BOND_AD_USER_PORT_KEY: u16 = 25;
pub const IFLA_BOND_AD_ACTOR_SYSTEM: u16 = 26;
pub const IFLA_BOND_TLB_DYNAMIC_LB: u16 = 27;
pub const IFLA_BOND_PEER_NOTIF_DELAY: u16 = 28;
pub const IFLA_BOND_AD_LACP_ACTIVE: u16 = 29;
pub const IFLA_BOND_MISSED_MAX: u16 = 30;
pub const IFLA_BOND_NS_IP6_TARGET: u16 = 31;

pub const IFLA_BOND_AD_INFO_UNSPEC: u16 = 0;
pub const IFLA_BOND_AD_INFO_AGGREGATOR: u16 = 1;
pub const IFLA_BOND_AD_INFO_NUM_PORTS: u16 = 2;
pub const IFLA_BOND_AD_INFO_ACTOR_KEY: u16 = 3;
pub const IFLA_BOND_AD_INFO_PARTNER_KEY: u16 = 4;
pub const IFLA_BOND_AD_INFO_PARTNER_MAC: u16 = 5;

// pub const IFLA_BOND_SLAVE_UNSPEC: int = 0;
// pub const IFLA_BOND_SLAVE_STATE: int = 1;
// pub const IFLA_BOND_SLAVE_MII_STATUS: int = 2;
Expand Down
Loading

0 comments on commit 99b5765

Please sign in to comment.