X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fvnet%2Fip-neighbor%2Fip_neighbor.c;h=d7450f9cd3e55a16721764484e3d2b6f3005ae92;hb=5c476e7ac31df0626694376c9a10deeb67bd09bf;hp=b2d4fa0d8bea70b1de5108da9b7c70c7abd2efcd;hpb=fd2417b2a42e34062e3d07875e5c4e11922513d5;p=vpp.git diff --git a/src/vnet/ip-neighbor/ip_neighbor.c b/src/vnet/ip-neighbor/ip_neighbor.c index b2d4fa0d8be..d7450f9cd3e 100644 --- a/src/vnet/ip-neighbor/ip_neighbor.c +++ b/src/vnet/ip-neighbor/ip_neighbor.c @@ -850,7 +850,7 @@ ip_neighbor_cmd (vlib_main_t * vm, /*? * Add or delete IPv4 ARP cache entries. * - * @note 'set ip neighbor' options (e.g. delete, static, 'fib-id ', + * @note 'set ip neighbor' options (e.g. delete, static, * 'count ', 'interface ip4_addr mac_addr') can be added in * any order and combination. * @@ -859,32 +859,37 @@ ip_neighbor_cmd (vlib_main_t * vm, * Add or delete IPv4 ARP cache entries as follows. MAC Address can be in * either aa:bb:cc:dd:ee:ff format or aabb.ccdd.eeff format. * @cliexcmd{set ip neighbor GigabitEthernet2/0/0 6.0.0.3 dead.beef.babe} - * @cliexcmd{set ip neighbor delete GigabitEthernet2/0/0 6.0.0.3 de:ad:be:ef:ba:be} + * @cliexcmd{set ip neighbor delete GigabitEthernet2/0/0 6.0.0.3 + * de:ad:be:ef:ba:be} * - * To add or delete an IPv4 ARP cache entry to or from a specific fib + * To add or delete an IPv4 ARP cache entry * table: - * @cliexcmd{set ip neighbor fib-id 1 GigabitEthernet2/0/0 6.0.0.3 dead.beef.babe} - * @cliexcmd{set ip neighbor fib-id 1 delete GigabitEthernet2/0/0 6.0.0.3 dead.beef.babe} + * @cliexcmd{set ip neighbor GigabitEthernet2/0/0 6.0.0.3 dead.beef.babe} + * @cliexcmd{set ip neighbor delete GigabitEthernet2/0/0 6.0.0.3 + * dead.beef.babe} * * Add or delete IPv4 static ARP cache entries as follows: - * @cliexcmd{set ip neighbor static GigabitEthernet2/0/0 6.0.0.3 dead.beef.babe} - * @cliexcmd{set ip neighbor static delete GigabitEthernet2/0/0 6.0.0.3 dead.beef.babe} + * @cliexcmd{set ip neighbor static GigabitEthernet2/0/0 6.0.0.3 + * dead.beef.babe} + * @cliexcmd{set ip neighbor static delete GigabitEthernet2/0/0 6.0.0.3 + * dead.beef.babe} * * For testing / debugging purposes, the 'set ip neighbor' command can add or * delete multiple entries. Supply the 'count N' parameter: - * @cliexcmd{set ip neighbor count 10 GigabitEthernet2/0/0 6.0.0.3 dead.beef.babe} + * @cliexcmd{set ip neighbor count 10 GigabitEthernet2/0/0 6.0.0.3 + * dead.beef.babe} * @endparblock ?*/ VLIB_CLI_COMMAND (ip_neighbor_command, static) = { .path = "set ip neighbor", - .short_help = - "set ip neighbor [del] [static] [no-fib-entry] [count ] [fib-id ] [proxy - ]", + .short_help = "set ip neighbor [del] " + "[static] [no-fib-entry] [count ]", .function = ip_neighbor_cmd, }; VLIB_CLI_COMMAND (ip_neighbor_command2, static) = { .path = "ip neighbor", - .short_help = - "ip neighbor [del] [static] [no-fib-entry] [count ] [fib-id ] [proxy - ]", + .short_help = "ip neighbor [del] " + "[static] [no-fib-entry] [count ]", .function = ip_neighbor_cmd, }; /* *INDENT-ON* */ @@ -1441,10 +1446,9 @@ ip_neighbor_add_del_interface_address_v4 (ip4_main_t * im, * Flush the ARP cache of all entries covered by the address * that is being removed. */ - IP_NEIGHBOR_DBG ("addr-%d: %U, %U/%d", - (is_del ? "del" : "add"), - format_vnet_sw_if_index_name, vnet_get_main (), - sw_if_index, format_ip4_address, address, address_length); + IP_NEIGHBOR_DBG ("addr-%s: %U, %U/%d", (is_del ? "del" : "add"), + format_vnet_sw_if_index_name, vnet_get_main (), sw_if_index, + format_ip4_address, address, address_length); if (is_del) { @@ -1594,8 +1598,8 @@ ip_neighbour_age_out (index_t ipni, f64 now, f64 * wait) } else { - ip_neighbor_probe_dst (ip_neighbor_get_sw_if_index (ipn), af, - vlib_get_thread_index (), + ip_neighbor_probe_dst (ip_neighbor_get_sw_if_index (ipn), + vlib_get_thread_index (), af, &ip_addr_46 (&ipn->ipn_key->ipnk_ip)); ipn->ipn_n_probes++; @@ -1755,6 +1759,17 @@ ip_neighbor_config (ip_address_family_t af, u32 limit, u32 age, bool recycle) return (0); } +int +ip_neighbor_get_config (ip_address_family_t af, u32 *limit, u32 *age, + bool *recycle) +{ + *limit = ip_neighbor_db[af].ipndb_limit; + *age = ip_neighbor_db[af].ipndb_age; + *recycle = ip_neighbor_db[af].ipndb_recycle; + + return (0); +} + static clib_error_t * ip_neighbor_config_show (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd)