return clib_error_return (0, "not supported");
case lldp_invalid_arg:
return clib_error_return (0, "invalid argument");
+ case lldp_internal_error:
+ return clib_error_return (0, "internal error");
}
return 0;
}
lldp_cfg_intf_set (u32 hw_if_index, u8 ** port_desc, u8 ** mgmt_ip4,
u8 ** mgmt_ip6, u8 ** mgmt_oid, int enable)
{
+ clib_error_t *error = 0;
lldp_main_t *lm = &lldp_main;
vnet_main_t *vnm = lm->vnet_main;
ethernet_main_t *em = ðernet_main;
*mgmt_oid = NULL;
}
+ error =
+ vnet_hw_interface_add_del_mac_address (lm->vnet_main, hw_if_index,
+ lldp_mac_addr,
+ 1 /* is_add */ );
+ if (error)
+ {
+ clib_error_free (error);
+ lldp_delete_intf (lm, n);
+ return lldp_internal_error;
+ }
+
const vnet_sw_interface_t *sw =
vnet_get_sw_interface (lm->vnet_main, hi->sw_if_index);
if (sw->flags & (VNET_SW_INTERFACE_FLAG_ADMIN_UP))
{
lldp_intf_t *n = lldp_get_intf (lm, hi->sw_if_index);
lldp_delete_intf (lm, n);
+ if (n)
+ {
+ error =
+ vnet_hw_interface_add_del_mac_address (lm->vnet_main, hw_if_index,
+ lldp_mac_addr,
+ 0 /* is_add */ );
+ if (error)
+ {
+ clib_error_free (error);
+ }
+ }
}
return lldp_ok;
hw = vnet_get_hw_interface(vnm, n->hw_if_index);
sw = vnet_get_sw_interface(lm->vnet_main, hw->sw_if_index);
- s = format(s, "\nLocal Interface name: %s\n"
+ s = format(s, "\nLocal Interface name: %v\n"
"Local Port Description: %s\n",
hw->name, n->port_desc);
if (n->mgmt_ip4)
continue;
if (now < n->last_heard + n->ttl)
{
- s = format(s, "%-25s %-25U %-25U %=15U %=15U %=10s\n", hw->name,
+ s = format(s, "%-25v %-25U %-25U %=15U %=15U %=10s\n", hw->name,
format_lldp_chassis_id, n->chassis_id_subtype,
n->chassis_id, vec_len(n->chassis_id), 0,
format_lldp_port_id, n->port_id_subtype, n->port_id,
}
else
{
- s = format(s, "%-25s %-25s %-25s %=15U %=15U %=10s\n", hw->name,
+ s = format(s, "%-25v %-25s %-25s %=15U %=15U %=10s\n", hw->name,
"", "", format_time_ago, n->last_heard, now,
format_time_ago, n->last_sent, now, "inactive");
}