Lines Matching refs:b

60         Bond *b;  in netdev_bond_fill_message_create()  local
67 b = BOND(netdev); in netdev_bond_fill_message_create()
69 assert(b); in netdev_bond_fill_message_create()
71 if (b->mode != _NETDEV_BOND_MODE_INVALID) { in netdev_bond_fill_message_create()
72 r = sd_netlink_message_append_u8(m, IFLA_BOND_MODE, b->mode); in netdev_bond_fill_message_create()
77 if (b->xmit_hash_policy != _NETDEV_BOND_XMIT_HASH_POLICY_INVALID) { in netdev_bond_fill_message_create()
78 … r = sd_netlink_message_append_u8(m, IFLA_BOND_XMIT_HASH_POLICY, b->xmit_hash_policy); in netdev_bond_fill_message_create()
83 if (b->lacp_rate != _NETDEV_BOND_LACP_RATE_INVALID && in netdev_bond_fill_message_create()
84 b->mode == NETDEV_BOND_MODE_802_3AD) { in netdev_bond_fill_message_create()
85 r = sd_netlink_message_append_u8(m, IFLA_BOND_AD_LACP_RATE, b->lacp_rate); in netdev_bond_fill_message_create()
90 if (b->miimon != 0) { in netdev_bond_fill_message_create()
91 r = sd_netlink_message_append_u32(m, IFLA_BOND_MIIMON, b->miimon / USEC_PER_MSEC); in netdev_bond_fill_message_create()
96 if (b->downdelay != 0) { in netdev_bond_fill_message_create()
97 … r = sd_netlink_message_append_u32(m, IFLA_BOND_DOWNDELAY, b->downdelay / USEC_PER_MSEC); in netdev_bond_fill_message_create()
102 if (b->updelay != 0) { in netdev_bond_fill_message_create()
103 r = sd_netlink_message_append_u32(m, IFLA_BOND_UPDELAY, b->updelay / USEC_PER_MSEC); in netdev_bond_fill_message_create()
108 if (b->arp_interval != 0) { in netdev_bond_fill_message_create()
109 … r = sd_netlink_message_append_u32(m, IFLA_BOND_ARP_INTERVAL, b->arp_interval / USEC_PER_MSEC); in netdev_bond_fill_message_create()
113 if (b->lp_interval >= LEARNING_PACKETS_INTERVAL_MIN_SEC && in netdev_bond_fill_message_create()
114 b->lp_interval <= LEARNING_PACKETS_INTERVAL_MAX_SEC) { in netdev_bond_fill_message_create()
115 … r = sd_netlink_message_append_u32(m, IFLA_BOND_LP_INTERVAL, b->lp_interval / USEC_PER_SEC); in netdev_bond_fill_message_create()
121 if (b->ad_select != _NETDEV_BOND_AD_SELECT_INVALID && in netdev_bond_fill_message_create()
122 b->mode == NETDEV_BOND_MODE_802_3AD) { in netdev_bond_fill_message_create()
123 r = sd_netlink_message_append_u8(m, IFLA_BOND_AD_SELECT, b->ad_select); in netdev_bond_fill_message_create()
128 if (b->fail_over_mac != _NETDEV_BOND_FAIL_OVER_MAC_INVALID && in netdev_bond_fill_message_create()
129 b->mode == NETDEV_BOND_MODE_ACTIVE_BACKUP) { in netdev_bond_fill_message_create()
130 r = sd_netlink_message_append_u8(m, IFLA_BOND_FAIL_OVER_MAC, b->fail_over_mac); in netdev_bond_fill_message_create()
135 if (b->arp_validate != _NETDEV_BOND_ARP_VALIDATE_INVALID) { in netdev_bond_fill_message_create()
136 r = sd_netlink_message_append_u32(m, IFLA_BOND_ARP_VALIDATE, b->arp_validate); in netdev_bond_fill_message_create()
141 if (b->arp_all_targets != _NETDEV_BOND_ARP_ALL_TARGETS_INVALID) { in netdev_bond_fill_message_create()
142 r = sd_netlink_message_append_u32(m, IFLA_BOND_ARP_ALL_TARGETS, b->arp_all_targets); in netdev_bond_fill_message_create()
147 if (b->primary_reselect != _NETDEV_BOND_PRIMARY_RESELECT_INVALID) { in netdev_bond_fill_message_create()
148 … r = sd_netlink_message_append_u8(m, IFLA_BOND_PRIMARY_RESELECT, b->primary_reselect); in netdev_bond_fill_message_create()
153 if (b->resend_igmp <= RESEND_IGMP_MAX) { in netdev_bond_fill_message_create()
154 r = sd_netlink_message_append_u32(m, IFLA_BOND_RESEND_IGMP, b->resend_igmp); in netdev_bond_fill_message_create()
159 if (b->packets_per_slave <= PACKETS_PER_SLAVE_MAX && in netdev_bond_fill_message_create()
160 b->mode == NETDEV_BOND_MODE_BALANCE_RR) { in netdev_bond_fill_message_create()
161 … r = sd_netlink_message_append_u32(m, IFLA_BOND_PACKETS_PER_SLAVE, b->packets_per_slave); in netdev_bond_fill_message_create()
166 if (b->num_grat_arp <= GRATUITOUS_ARP_MAX) { in netdev_bond_fill_message_create()
167 r = sd_netlink_message_append_u8(m, IFLA_BOND_NUM_PEER_NOTIF, b->num_grat_arp); in netdev_bond_fill_message_create()
172 if (b->min_links != 0) { in netdev_bond_fill_message_create()
173 r = sd_netlink_message_append_u32(m, IFLA_BOND_MIN_LINKS, b->min_links); in netdev_bond_fill_message_create()
178 if (b->ad_actor_sys_prio != 0) { in netdev_bond_fill_message_create()
179 … r = sd_netlink_message_append_u16(m, IFLA_BOND_AD_ACTOR_SYS_PRIO, b->ad_actor_sys_prio); in netdev_bond_fill_message_create()
184 if (b->ad_user_port_key != 0) { in netdev_bond_fill_message_create()
185 … r = sd_netlink_message_append_u16(m, IFLA_BOND_AD_USER_PORT_KEY, b->ad_user_port_key); in netdev_bond_fill_message_create()
190 if (!ether_addr_is_null(&b->ad_actor_system)) { in netdev_bond_fill_message_create()
191 … r = sd_netlink_message_append_ether_addr(m, IFLA_BOND_AD_ACTOR_SYSTEM, &b->ad_actor_system); in netdev_bond_fill_message_create()
196 r = sd_netlink_message_append_u8(m, IFLA_BOND_ALL_SLAVES_ACTIVE, b->all_slaves_active); in netdev_bond_fill_message_create()
200 if (b->tlb_dynamic_lb >= 0) { in netdev_bond_fill_message_create()
201 r = sd_netlink_message_append_u8(m, IFLA_BOND_TLB_DYNAMIC_LB, b->tlb_dynamic_lb); in netdev_bond_fill_message_create()
206 if (b->arp_interval > 0 && !ordered_set_isempty(b->arp_ip_targets)) { in netdev_bond_fill_message_create()
214 ORDERED_SET_FOREACH(val, b->arp_ip_targets) { in netdev_bond_fill_message_create()
240 Bond *b = userdata; in config_parse_arp_ip_target_address() local
249 b->arp_ip_targets = ordered_set_free(b->arp_ip_targets); in config_parse_arp_ip_target_address()
276 if (ordered_set_size(b->arp_ip_targets) >= NETDEV_BOND_ARP_TARGETS_MAX) { in config_parse_arp_ip_target_address()
283 r = ordered_set_ensure_put(&b->arp_ip_targets, NULL, UINT32_TO_PTR(ip.in.s_addr)); in config_parse_arp_ip_target_address()
306 Bond *b = userdata; in config_parse_ad_actor_sys_prio() local
329 b->ad_actor_sys_prio = v; in config_parse_ad_actor_sys_prio()
345 Bond *b = userdata; in config_parse_ad_user_port_key() local
367 b->ad_user_port_key = v; in config_parse_ad_user_port_key()
383 Bond *b = userdata; in config_parse_ad_actor_system() local
406 b->ad_actor_system = n; in config_parse_ad_actor_system()
412 Bond *b; in bond_done() local
415 b = BOND(netdev); in bond_done()
416 assert(b); in bond_done()
418 ordered_set_free(b->arp_ip_targets); in bond_done()
422 Bond *b; in bond_init() local
426 b = BOND(netdev); in bond_init()
428 assert(b); in bond_init()
430 b->mode = _NETDEV_BOND_MODE_INVALID; in bond_init()
431 b->xmit_hash_policy = _NETDEV_BOND_XMIT_HASH_POLICY_INVALID; in bond_init()
432 b->lacp_rate = _NETDEV_BOND_LACP_RATE_INVALID; in bond_init()
433 b->ad_select = _NETDEV_BOND_AD_SELECT_INVALID; in bond_init()
434 b->fail_over_mac = _NETDEV_BOND_FAIL_OVER_MAC_INVALID; in bond_init()
435 b->arp_validate = _NETDEV_BOND_ARP_VALIDATE_INVALID; in bond_init()
436 b->arp_all_targets = _NETDEV_BOND_ARP_ALL_TARGETS_INVALID; in bond_init()
437 b->primary_reselect = _NETDEV_BOND_PRIMARY_RESELECT_INVALID; in bond_init()
439 b->all_slaves_active = false; in bond_init()
440 b->tlb_dynamic_lb = -1; in bond_init()
442 b->resend_igmp = RESEND_IGMP_DEFAULT; in bond_init()
443 b->packets_per_slave = PACKETS_PER_SLAVE_DEFAULT; in bond_init()
444 b->num_grat_arp = GRATUITOUS_ARP_DEFAULT; in bond_init()
445 b->lp_interval = LEARNING_PACKETS_INTERVAL_MIN_SEC; in bond_init()