1 /* SPDX-License-Identifier: LGPL-2.1-or-later */ 2 3 #include "bond-util.h" 4 #include "string-table.h" 5 6 static const char* const bond_mode_table[_NETDEV_BOND_MODE_MAX] = { 7 [NETDEV_BOND_MODE_BALANCE_RR] = "balance-rr", 8 [NETDEV_BOND_MODE_ACTIVE_BACKUP] = "active-backup", 9 [NETDEV_BOND_MODE_BALANCE_XOR] = "balance-xor", 10 [NETDEV_BOND_MODE_BROADCAST] = "broadcast", 11 [NETDEV_BOND_MODE_802_3AD] = "802.3ad", 12 [NETDEV_BOND_MODE_BALANCE_TLB] = "balance-tlb", 13 [NETDEV_BOND_MODE_BALANCE_ALB] = "balance-alb", 14 }; 15 16 DEFINE_STRING_TABLE_LOOKUP(bond_mode, BondMode); 17 18 static const char* const bond_xmit_hash_policy_table[_NETDEV_BOND_XMIT_HASH_POLICY_MAX] = { 19 [NETDEV_BOND_XMIT_HASH_POLICY_LAYER2] = "layer2", 20 [NETDEV_BOND_XMIT_HASH_POLICY_LAYER34] = "layer3+4", 21 [NETDEV_BOND_XMIT_HASH_POLICY_LAYER23] = "layer2+3", 22 [NETDEV_BOND_XMIT_HASH_POLICY_ENCAP23] = "encap2+3", 23 [NETDEV_BOND_XMIT_HASH_POLICY_ENCAP34] = "encap3+4", 24 }; 25 26 DEFINE_STRING_TABLE_LOOKUP(bond_xmit_hash_policy, BondXmitHashPolicy); 27 28 static const char* const bond_lacp_rate_table[_NETDEV_BOND_LACP_RATE_MAX] = { 29 [NETDEV_BOND_LACP_RATE_SLOW] = "slow", 30 [NETDEV_BOND_LACP_RATE_FAST] = "fast", 31 }; 32 33 DEFINE_STRING_TABLE_LOOKUP(bond_lacp_rate, BondLacpRate); 34 35 static const char* const bond_ad_select_table[_NETDEV_BOND_AD_SELECT_MAX] = { 36 [NETDEV_BOND_AD_SELECT_STABLE] = "stable", 37 [NETDEV_BOND_AD_SELECT_BANDWIDTH] = "bandwidth", 38 [NETDEV_BOND_AD_SELECT_COUNT] = "count", 39 }; 40 41 DEFINE_STRING_TABLE_LOOKUP(bond_ad_select, BondAdSelect); 42 43 static const char* const bond_fail_over_mac_table[_NETDEV_BOND_FAIL_OVER_MAC_MAX] = { 44 [NETDEV_BOND_FAIL_OVER_MAC_NONE] = "none", 45 [NETDEV_BOND_FAIL_OVER_MAC_ACTIVE] = "active", 46 [NETDEV_BOND_FAIL_OVER_MAC_FOLLOW] = "follow", 47 }; 48 49 DEFINE_STRING_TABLE_LOOKUP(bond_fail_over_mac, BondFailOverMac); 50 51 static const char *const bond_arp_validate_table[_NETDEV_BOND_ARP_VALIDATE_MAX] = { 52 [NETDEV_BOND_ARP_VALIDATE_NONE] = "none", 53 [NETDEV_BOND_ARP_VALIDATE_ACTIVE]= "active", 54 [NETDEV_BOND_ARP_VALIDATE_BACKUP]= "backup", 55 [NETDEV_BOND_ARP_VALIDATE_ALL]= "all", 56 }; 57 58 DEFINE_STRING_TABLE_LOOKUP(bond_arp_validate, BondArpValidate); 59 60 static const char *const bond_arp_all_targets_table[_NETDEV_BOND_ARP_ALL_TARGETS_MAX] = { 61 [NETDEV_BOND_ARP_ALL_TARGETS_ANY] = "any", 62 [NETDEV_BOND_ARP_ALL_TARGETS_ALL] = "all", 63 }; 64 65 DEFINE_STRING_TABLE_LOOKUP(bond_arp_all_targets, BondArpAllTargets); 66 67 static const char *const bond_primary_reselect_table[_NETDEV_BOND_PRIMARY_RESELECT_MAX] = { 68 [NETDEV_BOND_PRIMARY_RESELECT_ALWAYS] = "always", 69 [NETDEV_BOND_PRIMARY_RESELECT_BETTER]= "better", 70 [NETDEV_BOND_PRIMARY_RESELECT_FAILURE]= "failure", 71 }; 72 73 DEFINE_STRING_TABLE_LOOKUP(bond_primary_reselect, BondPrimaryReselect); 74