64 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 72 #define foreach_ip_api_msg \ 73 _(IP_FIB_DUMP, ip_fib_dump) \ 74 _(IP6_FIB_DUMP, ip6_fib_dump) \ 75 _(IP_MFIB_DUMP, ip_mfib_dump) \ 76 _(IP6_MFIB_DUMP, ip6_mfib_dump) \ 77 _(IP_NEIGHBOR_DUMP, ip_neighbor_dump) \ 78 _(IP_MROUTE_ADD_DEL, ip_mroute_add_del) \ 79 _(MFIB_SIGNAL_DUMP, mfib_signal_dump) \ 80 _(IP_ADDRESS_DUMP, ip_address_dump) \ 81 _(IP_UNNUMBERED_DUMP, ip_unnumbered_dump) \ 83 _(IP_NEIGHBOR_ADD_DEL, ip_neighbor_add_del) \ 84 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \ 85 _(IP_PROBE_NEIGHBOR, ip_probe_neighbor) \ 86 _(IP_SCAN_NEIGHBOR_ENABLE_DISABLE, ip_scan_neighbor_enable_disable) \ 87 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \ 88 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \ 89 _(WANT_IP6_RA_EVENTS, want_ip6_ra_events) \ 90 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \ 91 _(PROXY_ARP_DUMP, proxy_arp_dump) \ 92 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \ 93 _(PROXY_ARP_INTFC_DUMP, proxy_arp_intfc_dump) \ 94 _(RESET_FIB, reset_fib) \ 95 _(IP_ADD_DEL_ROUTE, ip_add_del_route) \ 96 _(IP_TABLE_ADD_DEL, ip_table_add_del) \ 97 _(IP_PUNT_POLICE, ip_punt_police) \ 98 _(IP_PUNT_REDIRECT, ip_punt_redirect) \ 99 _(SET_IP_FLOW_HASH,set_ip_flow_hash) \ 100 _(SW_INTERFACE_IP6ND_RA_CONFIG, sw_interface_ip6nd_ra_config) \ 101 _(SW_INTERFACE_IP6ND_RA_PREFIX, sw_interface_ip6nd_ra_prefix) \ 102 _(IP6ND_PROXY_ADD_DEL, ip6nd_proxy_add_del) \ 103 _(IP6ND_PROXY_DUMP, ip6nd_proxy_dump) \ 104 _(IP6ND_SEND_ROUTER_SOLICITATION, ip6nd_send_router_solicitation) \ 105 _(SW_INTERFACE_IP6_ENABLE_DISABLE, sw_interface_ip6_enable_disable ) \ 106 _(IP_CONTAINER_PROXY_ADD_DEL, ip_container_proxy_add_del) \ 107 _(IP_CONTAINER_PROXY_DUMP, ip_container_proxy_dump) \ 108 _(IOAM_ENABLE, ioam_enable) \ 109 _(IOAM_DISABLE, ioam_disable) \ 110 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \ 111 ip_source_and_port_range_check_add_del) \ 112 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \ 113 ip_source_and_port_range_check_interface_add_del) \ 114 _(IP_SOURCE_CHECK_INTERFACE_ADD_DEL, \ 115 ip_source_check_interface_add_del) \ 116 _(IP_REASSEMBLY_SET, ip_reassembly_set) \ 117 _(IP_REASSEMBLY_GET, ip_reassembly_get) \ 118 _(IP_REASSEMBLY_ENABLE_DISABLE, ip_reassembly_enable_disable) \ 119 _(IP_PUNT_REDIRECT_DUMP, ip_punt_redirect_dump) 125 static vl_api_ip_neighbor_flags_t
135 return (clib_host_to_net_u32 (v));
149 mp->_vl_msg_id = ntohs (VL_API_IP_NEIGHBOR_DETAILS);
151 mp->
neighbor.sw_if_index = htonl (sw_if_index);
179 ip46_address_t nh = {
200 ip46_address_t nh = {
227 path_count =
vec_len (api_rpaths);
232 mp->_vl_msg_id = ntohs (VL_API_IP_FIB_DETAILS);
243 mp->
count = htonl (path_count);
291 fib_table_walk(fib_table->ft_index,
293 vl_api_ip_fib_dump_walk,
326 path_count =
vec_len (api_rpaths);
331 mp->_vl_msg_id = ntohs (VL_API_IP6_FIB_DETAILS);
342 mp->
count = htonl (path_count);
413 if (fib_table->ft_flags & FIB_TABLE_FLAG_IP6_LL)
416 api_ip6_fib_table_get_all(reg, mp, fib_table);
429 vl_api_mfib_path_t *fp;
436 path_count =
vec_len (api_rpaths);
441 mp->_vl_msg_id = ntohs (VL_API_IP_MFIB_DETAILS);
453 mp->
count = htonl (path_count);
499 ip4_mfib_table_walk(&mfib_table->v4,
500 vl_api_ip_mfib_table_dump_walk,
503 vec_sort_with_function (ctx.entries, mfib_entry_cmp_for_sort);
505 vec_foreach (mfeip, ctx.entries)
507 send_ip_mfib_details (reg, mp->context,
508 mfib_table->mft_table_id,
528 vl_api_mfib_path_t *fp;
531 path_count =
vec_len (api_rpaths);
536 mp->_vl_msg_id = ntohs (VL_API_IP6_MFIB_DETAILS);
546 mp->
count = htonl (path_count);
595 ip6_mfib_table_walk(&mfib_table->v6,
596 vl_api_ip6_mfib_table_dump_walk,
599 vec_sort_with_function (ctx.entries, mfib_entry_cmp_for_sort);
601 vec_foreach(mfeip, ctx.entries)
603 pfx = mfib_entry_get_prefix (*mfeip);
604 mfib_entry_encode (*mfeip, &api_rpaths);
605 send_ip6_mfib_details (am, reg,
606 mfib_table->mft_table_id,
624 vl_api_ip_punt_police_reply_t *rmp;
639 vl_api_ip_punt_redirect_reply_t *rmp;
645 goto bad_sw_if_index;
683 v = clib_net_to_host_u32 (v);
699 u32 stats_index = ~0;
721 flags, &stats_index);
740 u32 fib_index, mfib_index;
764 if (~0 != mfib_index)
775 vl_api_ip_table_add_del_reply_t *rmp;
801 u32 classify_table_index,
803 u8 is_resolve_attached,
812 const ip46_address_t * next_hop,
814 u32 next_hop_sw_if_index,
815 u8 next_hop_fib_index,
817 u16 next_hop_preference,
826 .frp_sw_if_index = next_hop_sw_if_index,
827 .frp_fib_index = next_hop_fib_index,
828 .frp_weight = next_hop_weight,
829 .frp_preference = next_hop_preference,
830 .frp_label_stack = next_hop_out_label_stack,
850 if (~0 != next_hop_sw_if_index)
859 if (is_resolve_attached)
865 if (is_source_lookup)
884 if (is_drop || (is_local && (~0 == next_hop_sw_if_index)) ||
885 is_classify || is_unreach || is_prohibit)
904 else if (is_prohibit)
908 else if (is_classify)
911 ntohl (classify_table_index)))
914 return VNET_API_ERROR_NO_SUCH_TABLE;
919 ntohl (classify_table_index)));
924 return VNET_API_ERROR_NO_SUCH_TABLE;
938 else if (is_multipath)
974 u32 next_hop_sw_if_index,
976 u32 next_hop_table_id,
977 u8 is_rpf_id,
u32 * fib_index,
u32 * next_hop_fib_index)
982 if (~0 == *fib_index)
985 return VNET_API_ERROR_NO_SUCH_FIB;
988 if (!is_rpf_id && ~0 != ntohl (next_hop_sw_if_index))
991 ntohl (next_hop_sw_if_index)))
993 return VNET_API_ERROR_NO_MATCHING_INTERFACE;
1007 ntohl (next_hop_table_id));
1010 ntohl (next_hop_table_id));
1012 if (~0 == *next_hop_fib_index)
1015 return VNET_API_ERROR_NO_SUCH_FIB;
1026 u32 fib_index, next_hop_fib_index;
1029 int rv, ii, n_labels;
1036 0, &fib_index, &next_hop_fib_index);
1067 for (ii = 0; ii < n_labels; ii++)
1092 fib_index, &pfx, nh_proto,
1101 if (mp->
is_add && 0 == rv)
1112 u32 fib_index, next_hop_fib_index;
1114 int rv, ii, n_labels;
1121 0, &fib_index, &next_hop_fib_index);
1152 for (ii = 0; ii < n_labels; ii++)
1177 fib_index, &pfx, nh_proto,
1185 if (mp->
is_add && 0 == rv)
1221 u32 fib_index, mfib_index;
1240 if (~0 == fib_index)
1247 if (~0 == mfib_index)
1260 u32 next_hop_sw_if_index,
u8 is_local,
u32 * fib_index)
1265 if (~0 == *fib_index)
1268 return VNET_API_ERROR_NO_SUCH_FIB;
1271 if (~0 != ntohl (next_hop_sw_if_index))
1274 ntohl (next_hop_sw_if_index)))
1276 return VNET_API_ERROR_NO_MATCHING_INTERFACE;
1291 u32 next_hop_sw_if_index,
1300 .frp_proto = nh_proto,
1312 else if (!is_local && ~0 == next_hop_sw_if_index)
1316 rpf_id, entry_flags);
1334 return (mfib_entry_index);
1396 if (~0 != mfib_entry_index)
1433 mp->_vl_msg_id = ntohs (VL_API_IP_DETAILS);
1445 u8 * ip,
u16 prefix_length,
1452 mp->_vl_msg_id = ntohs (VL_API_IP_ADDRESS_DETAILS);
1484 int rv __attribute__ ((unused)) = 0;
1535 mp->_vl_msg_id = ntohs (VL_API_IP_UNNUMBERED_DETAILS);
1549 int rv __attribute__ ((unused)) = 0;
1561 if (~0 != sw_if_index)
1580 if ((si->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED))
1582 send_ip_unnumbered_details(am, reg,
1584 si->unnumbered_sw_if_index,
1611 _vec_len (sorted_sis) = 0;
1615 vec_add1 (sorted_sis, si[0]);
1636 vl_api_set_ip_flow_hash_reply_t *rmp;
1641 table_id = ntohl (mp->
vrf_id);
1643 #define _(a,b) if (mp->a) flow_hash_config |= b; 1655 vl_api_set_ip_flow_hash_reply_t *rmp;
1660 table_id = ntohl (mp->
vrf_id);
1662 #define _(a,b) if (mp->a) flow_hash_config |= b; 1685 vl_api_sw_interface_ip6nd_ra_config_reply_t *rmp;
1688 u8 is_no, suppress, managed, other, ll_option, send_unicast, cease,
1691 is_no = mp->
is_no == 1;
1694 other = mp->
other == 1;
1697 cease = mp->
cease == 1;
1703 suppress, managed, other,
1704 ll_option, send_unicast, cease,
1705 default_router, ntohl (mp->
lifetime),
1713 REPLY_MACRO (VL_API_SW_INTERFACE_IP6ND_RA_CONFIG_REPLY);
1721 vl_api_sw_interface_ip6nd_ra_prefix_reply_t *rmp;
1724 u8 is_no, use_default, no_advertise, off_link, no_autoconfig, no_onlink;
1729 is_no = mp->
is_no == 1;
1741 off_link, no_autoconfig, no_onlink, is_no);
1744 REPLY_MACRO (VL_API_SW_INTERFACE_IP6ND_RA_PREFIX_REPLY);
1756 mp->_vl_msg_id = ntohs (VL_API_IP6ND_PROXY_DETAILS);
1802 fib_table_walk(fib_table->ft_index,
1804 api_ip6nd_proxy_fib_table_walk,
1827 vl_api_ip6nd_proxy_add_del_reply_t *rmp;
1844 vl_api_ip6nd_send_router_solicitation_reply_t *rmp;
1852 REPLY_MACRO (VL_API_IP6ND_SEND_ROUTER_SOLICITATION_REPLY);
1857 params.
irt = ntohl (mp->
irt);
1858 params.
mrt = ntohl (mp->
mrt);
1859 params.
mrc = ntohl (mp->
mrc);
1860 params.
mrd = ntohl (mp->
mrd);
1871 vl_api_sw_interface_ip6_enable_disable_reply_t *rmp;
1888 rv = VNET_API_ERROR_UNSPECIFIED;
1897 REPLY_MACRO (VL_API_SW_INTERFACE_IP6_ENABLE_DISABLE_REPLY);
1912 mp->_vl_msg_id = ntohs (VL_API_MFIB_SIGNAL_DETAILS);
1970 vl_api_ip_container_proxy_add_del_reply_t *rmp;
1979 args.sw_if_index = clib_net_to_host_u32 (mp->
sw_if_index);
1980 args.is_add = mp->
is_add;
1987 REPLY_MACRO (VL_API_IP_CONTAINER_PROXY_ADD_DEL_REPLY);
2008 mp->_vl_msg_id = ntohs (VL_API_IP_CONTAINER_PROXY_DETAILS);
2041 vl_api_ioam_enable_reply_t *rmp;
2061 vl_api_ioam_disable_reply_t *rmp;
2078 vl_api_ip_source_and_port_range_check_add_del_reply_t *rmp;
2084 u16 *high_ports = 0;
2086 u16 tmp_low, tmp_high;
2094 if (num_ranges > 32)
2096 rv = VNET_API_ERROR_EXCEEDED_NUMBER_OF_RANGES_CAPACITY;
2103 for (i = 0; i < num_ranges; i++)
2109 if (tmp_low > tmp_high || tmp_low == 0 || tmp_high > 65535)
2111 rv = VNET_API_ERROR_INVALID_VALUE;
2115 vec_add1 (high_ports, tmp_high + 1);
2118 vrf_id = ntohl (mp->
vrf_id);
2122 rv = VNET_API_ERROR_INVALID_VALUE;
2133 high_ports, is_add);
2141 high_ports, is_add);
2147 REPLY_MACRO (VL_API_IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL_REPLY);
2155 vl_api_ip_source_and_port_range_check_interface_add_del_reply_t *rmp;
2176 if (vrf_id[i] != 0 && vrf_id[i] != ~0)
2182 rv = VNET_API_ERROR_INVALID_VALUE;
2186 fib_index[
i] = p[0];
2202 REPLY_MACRO (VL_API_IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL_REPLY);
2214 vl_api_ip_source_check_interface_add_del_reply_t *rmp;
2218 char *feature_name =
2219 mp->
loose ?
"ip4-source-check-via-any" :
"ip4-source-check-via-rx";
2229 is_add, &config,
sizeof (config));
2232 REPLY_MACRO (VL_API_IP_SOURCE_CHECK_INTERFACE_ADD_DEL_REPLY);
2235 #define IP4_ARP_EVENT 3 2236 #define IP6_ND_EVENT 4 2275 event->
pid, event->
ip,
2289 static f64 last_time;
2296 clib_warning (
"arp event for %U to pid %d: queue stuffed!",
2338 event->
pid, event->
ip,
2352 static f64 last_time;
2359 clib_warning (
"ip6 nd event for %U to pid %d: queue stuffed!",
2370 volatile f64 timeout = 100.0;
2371 volatile uword *event_data = 0;
2384 for (i = 0; i <
vec_len (event_data); i++)
2389 for (i = 0; i <
vec_len (event_data); i++)
2406 .name =
"ip-route-resolver-process",
2428 event->sw_if_index = htonl (sw_if_index);
2460 for (i = 0; i <
vec_len (arp_events); i++)
2465 &arp_events[i].
mac) &&
2467 (now - last_arp) < 10.0)
2471 arp_prev = arp_events[
i];
2477 vl_api_registration_t *vl_reg;
2478 vl_reg = vl_api_client_index_to_registration (reg->client_index);
2479 ASSERT (vl_reg != NULL);
2480 if (reg && vl_api_can_send_msg (vl_reg))
2482 vl_api_ip4_arp_event_t * event = vl_msg_api_alloc (sizeof *event);
2483 clib_memset (event, 0, sizeof *event);
2484 event->_vl_msg_id = htons (VL_API_IP4_ARP_EVENT);
2485 event->client_index = reg->client_index;
2486 event->pid = reg->client_pid;
2488 ip4_address_encode(&arp_events[i].ip, event->ip);
2489 event->sw_if_index = htonl(arp_events[i].sw_if_index);
2490 mac_address_encode(&arp_events[i].mac, event->mac);
2491 vl_api_send_msg (vl_reg, (u8 *) event);
2508 && (now - last_nd) < 10.0)
2512 nd_prev = nd_events[
i];
2518 vl_api_registration_t *vl_reg;
2519 vl_reg = vl_api_client_index_to_registration (reg->client_index);
2520 if (vl_reg && vl_api_can_send_msg (vl_reg))
2522 vl_api_ip6_nd_event_t * event = vl_msg_api_alloc (sizeof *event);
2523 clib_memset (event, 0, sizeof *event);
2524 event->_vl_msg_id = htons (VL_API_IP6_ND_EVENT);
2525 event->client_index = reg->client_index;
2526 event->pid = reg->client_pid;
2528 ip6_address_encode(&nd_events[i].ip6, event->ip);
2529 event->sw_if_index = htonl(nd_events[i].sw_if_index);
2530 mac_address_encode(&nd_events[i].mac, event->mac);
2531 vl_api_send_msg (vl_reg, (u8 *) event);
2550 vl_api_registration_t *vl_reg;
2552 vl_api_client_index_to_registration (reg->client_index);
2553 if (vl_reg && vl_api_can_send_msg (vl_reg))
2556 sizeof (vl_api_ip6_ra_event_t) +
2557 vec_len (ra_events[i].prefixes) *
2558 sizeof (vl_api_ip6_ra_prefix_info_t);
2559 vl_api_ip6_ra_event_t *event =
2560 vl_msg_api_alloc (event_size);
2561 clib_memset (event, 0, event_size);
2562 event->_vl_msg_id = htons (VL_API_IP6_RA_EVENT);
2563 event->client_index = reg->client_index;
2564 event->pid = reg->client_pid;
2566 event->sw_if_index = clib_host_to_net_u32 (ra_events[i].sw_if_index);
2568 ip6_address_encode (&ra_events[i].router_address,
2569 event->router_addr);
2571 event->current_hop_limit = ra_events[i].current_hop_limit;
2572 event->flags = ra_events[i].flags;
2573 event->router_lifetime_in_sec =
2574 clib_host_to_net_u16 (ra_events
2575 [i].router_lifetime_in_sec);
2576 event->neighbor_reachable_time_in_msec =
2577 clib_host_to_net_u32 (ra_events
2578 [i].neighbor_reachable_time_in_msec);
2579 event->time_in_msec_between_retransmitted_neighbor_solicitations
2581 clib_host_to_net_u32 (ra_events
2582 [i].time_in_msec_between_retransmitted_neighbor_solicitations);
2585 clib_host_to_net_u32 (vec_len (ra_events[i].prefixes));
2586 vl_api_ip6_ra_prefix_info_t *prefix =
2587 (typeof (prefix)) event->prefixes;
2589 for (j = 0; j < vec_len (ra_events[i].prefixes); j++)
2591 ra_report_prefix_info_t *info =
2592 &ra_events[i].prefixes[j];
2593 ip_prefix_encode(&info->prefix, &prefix->prefix);
2594 prefix->flags = info->flags;
2595 prefix->valid_time =
2596 clib_host_to_net_u32 (info->valid_time);
2597 prefix->preferred_time =
2598 clib_host_to_net_u32 (info->preferred_time);
2602 vl_api_send_msg (vl_reg, (u8 *) event);
2619 .name =
"wildcard-ip4-arp-publisher-process",
2642 event->sw_if_index = htonl (sw_if_index);
2651 vl_api_want_ip4_arp_events_reply_t *rmp;
2667 rv = VNET_API_ERROR_INVALID_REGISTRATION;
2674 pool_put (am->wc_ip4_arp_events_registrations, rp);
2675 hash_unset (am->wc_ip4_arp_events_registration_hash,
2677 if (
pool_elts (am->wc_ip4_arp_events_registrations) == 0)
2685 rv = VNET_API_ERROR_INVALID_REGISTRATION;
2688 pool_get (am->wc_ip4_arp_events_registrations, rp);
2692 rp - am->wc_ip4_arp_events_registrations);
2715 event->_vl_msg_id = htons (VL_API_IP4_ARP_EVENT);
2717 memcpy (event->
ip, mp->
ip, 4);
2718 event->pid = mp->
pid;
2739 u32 *to_delete, *event_id;
2752 if (event->client_index == client_index)
2754 vec_add1(to_delete, event - am->arp_events);
2764 event->pid, event->ip,
2771 p =
hash_get (am->wc_ip4_arp_events_registration_hash, client_index);
2776 pool_put (am->wc_ip4_arp_events_registrations, rp);
2777 hash_unset (am->wc_ip4_arp_events_registration_hash, client_index);
2778 if (
pool_elts (am->wc_ip4_arp_events_registrations) == 0)
2791 vl_api_want_ip6_nd_events_reply_t *rmp;
2807 rv = VNET_API_ERROR_INVALID_REGISTRATION;
2814 pool_put (am->wc_ip6_nd_events_registrations, rp);
2815 hash_unset (am->wc_ip6_nd_events_registration_hash,
2817 if (
pool_elts (am->wc_ip6_nd_events_registrations) == 0)
2825 rv = VNET_API_ERROR_INVALID_REGISTRATION;
2828 pool_get (am->wc_ip6_nd_events_registrations, rp);
2832 rp - am->wc_ip6_nd_events_registrations);
2855 event->_vl_msg_id = ntohs (VL_API_IP6_ND_EVENT);
2858 event->pid = mp->
pid;
2878 u32 *to_delete, *event_id;
2891 if (event->client_index == client_index)
2893 vec_add1(to_delete, event - am->nd_events);
2903 event->pid, event->ip,
2910 p =
hash_get (am->wc_ip6_nd_events_registration_hash, client_index);
2915 pool_put (am->wc_ip6_nd_events_registrations, rp);
2916 hash_unset (am->wc_ip6_nd_events_registration_hash, client_index);
2917 if (
pool_elts (am->wc_ip6_nd_events_registrations) == 0)
2929 vl_api_want_ip6_ra_events_reply_t *rmp;
2939 rv = VNET_API_ERROR_INVALID_REGISTRATION;
2945 pool_put (am->ip6_ra_events_registrations, rp);
2953 rv = VNET_API_ERROR_INVALID_REGISTRATION;
2956 pool_get (am->ip6_ra_events_registrations, rp);
2960 rp - am->ip6_ra_events_registrations);
2973 p =
hash_get (am->ip6_ra_events_registration_hash, client_index);
2978 pool_put (am->ip6_ra_events_registrations, rp);
2979 hash_unset (am->ip6_ra_events_registration_hash, client_index);
2989 vl_api_proxy_arp_add_del_reply_t *rmp;
2998 if (~0 == fib_index)
3000 rv = VNET_API_ERROR_NO_SUCH_FIB;
3032 mp->_vl_msg_id = ntohs (VL_API_PROXY_ARP_DETAILS);
3075 mp->_vl_msg_id = ntohs (VL_API_PROXY_ARP_INTFC_DETAILS);
3108 vl_api_proxy_arp_intfc_enable_disable_reply_t *rmp;
3124 REPLY_MACRO (VL_API_PROXY_ARP_INTFC_ENABLE_DISABLE_REPLY);
3132 vl_api_ip_probe_neighbor_reply_t *rmp;
3155 REPLY_MACRO (VL_API_PROXY_ARP_INTFC_ENABLE_DISABLE_REPLY);
3163 vl_api_ip_scan_neighbor_enable_disable_reply_t *rmp;
3174 REPLY_MACRO (VL_API_IP_SCAN_NEIGHBOR_ENABLE_DISABLE_REPLY);
3183 static u32 *sw_if_indices_to_shut;
3188 int rv = VNET_API_ERROR_NO_SUCH_FIB;
3196 vnet_sw_interface_t * si;
3198 fib = pool_elt_at_index (im4->v4_fibs, fib_table->ft_index);
3200 if (fib->table_id != target_fib_id)
3204 mpls_fib_reset_labels (fib->table_id);
3207 vnet_proxy_arp_fib_reset (fib->table_id);
3210 vnet_set_ip4_flow_hash (fib->table_id, IP_FLOW_HASH_DEFAULT);
3212 vec_reset_length (sw_if_indices_to_shut);
3215 pool_foreach (si, im->sw_interfaces,
3217 u32 sw_if_index = si->sw_if_index;
3219 if (sw_if_index < vec_len (im4->fib_index_by_sw_if_index)
3220 && (im4->fib_index_by_sw_if_index[si->sw_if_index] ==
3222 vec_add1 (sw_if_indices_to_shut, si->sw_if_index);
3225 for (i = 0; i <
vec_len (sw_if_indices_to_shut); i++) {
3226 sw_if_index = sw_if_indices_to_shut[
i];
3250 static u32 *sw_if_indices_to_shut;
3255 int rv = VNET_API_ERROR_NO_SUCH_FIB;
3263 vnet_sw_interface_t * si;
3265 fib = pool_elt_at_index (im6->v6_fibs, fib_table->ft_index);
3267 if (fib->table_id != target_fib_id)
3270 vec_reset_length (sw_if_indices_to_shut);
3273 vnet_set_ip6_flow_hash (fib->table_id, IP_FLOW_HASH_DEFAULT);
3276 pool_foreach (si, im->sw_interfaces,
3278 if (im6->fib_index_by_sw_if_index[si->sw_if_index] ==
3280 vec_add1 (sw_if_indices_to_shut, si->sw_if_index);
3283 for (i = 0; i <
vec_len (sw_if_indices_to_shut); i++) {
3284 sw_if_index = sw_if_indices_to_shut[
i];
3306 vl_api_reset_fib_reply_t *rmp;
3320 vl_api_set_arp_neighbor_limit_reply_t *rmp;
3334 rv = VNET_API_ERROR_UNSPECIFIED;
3341 REPLY_MACRO (VL_API_SET_ARP_NEIGHBOR_LIMIT_REPLY);
3347 vl_api_ip_reassembly_set_reply_t *rmp;
3376 rmp->_vl_msg_id = ntohs (VL_API_IP_REASSEMBLY_GET_REPLY);
3402 vl_api_ip_reassembly_enable_disable_reply_t *rmp;
3412 REPLY_MACRO (VL_API_IP_REASSEMBLY_ENABLE_DISABLE_REPLY);
3427 mp->_vl_msg_id = ntohs (VL_API_IP_PUNT_REDIRECT_DETAILS);
3448 int rv __attribute__ ((unused)) = 0;
3455 if (~0 != sw_if_index)
3485 #define vl_msg_name_crc_list 3486 #include <vnet/ip/ip.api.h> 3487 #undef vl_msg_name_crc_list 3492 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 3493 foreach_vl_msg_name_crc_ip;
3503 vl_msg_api_set_handlers(VL_API_##N, #n, \ 3504 vl_api_##n##_t_handler, \ 3506 vl_api_##n##_t_endian, \ 3507 vl_api_##n##_t_print, \ 3508 sizeof(vl_api_##n##_t), 1); 3516 am->
is_mp_safe[VL_API_IP_ADD_DEL_ROUTE_REPLY] = 1;
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
ip_neighbor_flags_t flags
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
fib_protocol_t fp_proto
protocol type
u32 fib_entry_get_fib_index(fib_node_index_t fib_entry_index)
static void vl_api_proxy_arp_intfc_enable_disable_t_handler(vl_api_proxy_arp_intfc_enable_disable_t *mp)
Proxy ARP add / del request.
void ip_null_dpo_add_and_lock(dpo_proto_t proto, ip_null_dpo_action_t action, dpo_id_t *dpo)
ip46_address_t frp_addr
The next-hop address.
Dump IP unnumbered configurations.
void ip4_punt_redirect_add(u32 rx_sw_if_index, u32 tx_sw_if_index, ip46_address_t *nh)
Continue on to the next entry.
VL_MSG_API_REAPER_FUNCTION(want_ip4_arp_events_reaper)
static int nd_change_delete_callback(u32 pool_index, const mac_address_t *mac, u32 sw_if_index, const ip6_address_t *addr)
ip46_address_t fp_src_addr
A path that resolves via a DVR DPO.
#define hash_set(h, key, value)
Register for IP6 ND resolution event on recieving NA reply MAC/IP info from ICMP6 Neighbor Solicitati...
static void vl_api_ip6nd_proxy_add_del_t_handler(vl_api_ip6nd_proxy_add_del_t *mp)
void receive_dpo_add_or_lock(dpo_proto_t proto, u32 sw_if_index, const ip46_address_t *nh_addr, dpo_id_t *dpo)
ip_punt_redirect_rx_t punt_redirect
IP punt redirect configuration.
A representation of a fib path for fib_path_encode to convey the information to the caller...
static void vl_api_ip_container_proxy_add_del_t_handler(vl_api_ip_container_proxy_add_del_t *mp)
mpls_eos_bit_t frp_eos
EOS bit for the resolving label.
int vnet_set_ip4_flow_hash(u32 table_id, flow_hash_config_t flow_hash_config)
Register for ip6 router advertisement events.
static uword resolver_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
#define hash_unset(h, key)
void ip_prefix_decode(const vl_api_prefix_t *in, fib_prefix_t *out)
vl_api_fib_path_t path[count]
int ip6_neighbor_ra_prefix(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *prefix_addr, u8 prefix_len, u8 use_default, u32 val_lifetime, u32 pref_lifetime, u8 no_advertise, u8 off_link, u8 no_autoconfig, u8 no_onlink, u8 is_no)
static uword * vlib_process_wait_for_event(vlib_main_t *vm)
A representation of a path as described by a route producer.
static void vl_api_ip_neighbor_add_del_t_handler(vl_api_ip_neighbor_add_del_t *mp, vlib_main_t *vm)
vnet_main_t * vnet_get_main(void)
static fib_table_walk_rc_t api_ip6_fib_table_put_entries(fib_node_index_t fei, void *arg)
void mac_address_encode(const mac_address_t *in, u8 *out)
static walk_rc_t send_proxy_arp_details(const ip4_address_t *lo_addr, const ip4_address_t *hi_addr, u32 fib_index, void *data)
vl_api_ip_neighbor_t neighbor
vnet_interface_main_t interface_main
void icmp6_send_router_solicitation(vlib_main_t *vm, u32 sw_if_index, u8 stop, icmp6_send_router_solicitation_params_t *params)
u32 frp_mitf_flags
MFIB interface flags.
void ip4_punt_redirect_del(u32 rx_sw_if_index)
A pair of indicies, for the entry and interface resp.
Dump IP multicast fib table.
u32 fib_table_find_or_create_and_lock_w_name(fib_protocol_t proto, u32 table_id, fib_source_t src, const u8 *name)
Get the index of the FIB for a Table-ID.
fib_node_index_t fib_table_entry_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_route_path_t *paths)
Update an entry to have a new set of paths.
int ip_neighbor_add(const ip46_address_t *ip, ip46_type_t type, const mac_address_t *mac, u32 sw_if_index, ip_neighbor_flags_t flags, u32 *stats_index)
Proxy ARP interface dump request.
clib_error_t * call_ip6_neighbor_callbacks(void *data, _vnet_ip6_neighbor_function_list_elt_t *elt)
#define REPLY_MACRO2(t, body)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
Set max allowed ARP or ip6 neighbor entries request.
static f64 vlib_time_now(vlib_main_t *vm)
fib_node_index_t fib_table_entry_path_add2(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_route_path_t *rpath)
Add n paths to an entry (aka route) in the FIB.
A path that resolves via a BIER impostion object.
u32 fib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
ip_punt_redirect_detail_t * ip4_punt_redirect_entries(u32 sw_if_index)
clib_error_t * ip4_set_arp_limit(u32 arp_limit)
index_t frp_bier_imp
A path via a BIER imposition object.
ip6_neighbor_t * ip6_neighbors_entries(u32 sw_if_index)
u32 mpls_label_t
A label value only, i.e.
vl_api_mfib_path_t path[count]
void ip6_address_decode(const vl_api_ip6_address_t in, ip6_address_t *out)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static int nd_change_data_callback(u32 pool_index, const mac_address_t *new_mac, u32 sw_if_index, const ip6_address_t *address)
vl_api_punt_redirect_t punt
int ip6_neighbor_proxy_add_del(u32 sw_if_index, ip6_address_t *addr, u8 is_del)
void ip_table_delete(fib_protocol_t fproto, u32 table_id, u8 is_api)
vl_api_mfib_path_t path[count]
ip_lookup_main_t lookup_main
void vl_api_ip_reassembly_set_t_handler(vl_api_ip_reassembly_set_t *mp)
static void send_ip_mfib_details(vl_api_registration_t *reg, u32 context, u32 table_id, fib_node_index_t mfei)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
const fib_prefix_t * fib_entry_get_prefix(fib_node_index_t fib_entry_index)
static vl_api_ip_neighbor_flags_t ip_neighbor_flags_encode(ip_neighbor_flags_t f)
fib_node_index_t mfib_table_entry_update(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, fib_rpf_id_t rpf_id, mfib_entry_flags_t entry_flags)
Add a new (with no replication) or lock an existing entry.
dpo_proto_t frp_proto
The protocol of the address below.
IPv6 router advertisement config request.
vl_api_registration_t * reg
static void vl_api_proxy_arp_intfc_dump_t_handler(vl_api_proxy_arp_intfc_dump_t *mp)
struct api_ip6nd_proxy_fib_table_walk_ctx_t_ api_ip6nd_proxy_fib_table_walk_ctx_t
static clib_error_t * want_ip6_nd_events_reaper(u32 client_index)
A path that result in received traffic being recieved/recirculated so that it appears to have arrived...
void vl_api_ip_reassembly_enable_disable_t_handler(vl_api_ip_reassembly_enable_disable_t *mp)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static void vl_api_ip6nd_proxy_dump_t_handler(vl_api_ip6nd_proxy_dump_t *mp)
vl_api_fib_mpls_label_t next_hop_out_label_stack[next_hop_n_out_labels]
void * vl_msg_api_alloc(int nbytes)
static fib_table_walk_rc_t api_ip6nd_proxy_fib_table_walk(fib_node_index_t fei, void *arg)
void vl_api_ip_reassembly_get_t_handler(vl_api_ip_reassembly_get_t *mp)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
int ip_neighbor_del(const ip46_address_t *ip, ip46_type_t type, u32 sw_if_index)
#define clib_memcpy(d, s, n)
static void vl_api_ip_mfib_dump_t_handler(vl_api_ip_mfib_dump_t *mp)
A local path with a RPF-ID => multicast traffic.
enum walk_rc_t_ walk_rc_t
Walk return code.
static int vl_api_can_send_msg(vl_api_registration_t *rp)
static void handle_ip4_arp_event(u32 pool_index)
Proxy ARP add / del interface request.
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
u32 frp_sw_if_index
The interface.
Add / del table request A table can be added multiple times, but need be deleted only once...
Start / stop sending router solicitation.
void ip_neighbor_scan_enable_disable(ip_neighbor_scan_arg_t *arg)
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type...
static int add_del_mroute_check(fib_protocol_t table_proto, u32 table_id, u32 next_hop_sw_if_index, u8 is_local, u32 *fib_index)
Dump IP6 multicast fib table.
void fib_table_entry_special_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Remove a 'special' entry from the FIB.
clib_error_t * vnet_ip_container_proxy_add_del(vnet_ip_container_proxy_args_t *args)
enum ip_neighbor_flags_t_ ip_neighbor_flags_t
struct _vnet_ip_container_proxy_args vnet_ip_container_proxy_args_t
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
Recursion constraint of via a host prefix.
void proxy_arp_walk(proxy_arp_walk_t cb, void *data)
static void vl_api_ip6_mfib_dump_t_handler(vl_api_ip6_mfib_dump_t *mp)
Set interface source and L4 port-range request.
struct _vl_api_ip4_arp_event * arp_events
u32 mfib_table_find_or_create_and_lock_w_name(fib_protocol_t proto, u32 table_id, mfib_source_t src, const u8 *name)
Get the index of the FIB for a Table-ID.
void fib_table_flush(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Flush all entries from a table for the source.
Aggregrate type for a prefix.
int ip6_interface_enabled(vlib_main_t *vm, u32 sw_if_index)
static void vl_api_ip_dump_t_handler(vl_api_ip_dump_t *mp)
vnet_api_error_t ip6_reass_set(u32 timeout_ms, u32 max_reassemblies, u32 expire_walk_interval_ms)
set ip6 reassembly configuration
struct vl_api_ip_mfib_dump_ctc_t_ vl_api_ip_mfib_dump_ctc_t
static void api_ip6_fib_table_get_all(vl_api_registration_t *reg, vl_api_ip6_fib_dump_t *mp, fib_table_t *fib_table)
fib_node_index_t mfib_table_entry_path_update(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpath, mfib_itf_flags_t itf_flags)
Add n paths to an entry (aka route) in the FIB.
IPv6 interface enable / disable request.
ip46_address_t nh
The next-hop to send redirected packets to.
u32 mfib_entry_get_stats_index(fib_node_index_t fib_entry_index)
A path via a UDP encap object.
struct proxy_arp_walk_ctx_t_ proxy_arp_walk_ctx_t
enum fib_route_path_flags_t_ fib_route_path_flags_t
Path flags from the control plane.
struct mfib_table_t_ * mfibs
Vector of MFIBs.
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
fib_protocol_t dpo_proto_to_fib(dpo_proto_t dpo_proto)
u16 fp_len
The mask length.
static fib_node_index_t mroute_add_del_handler(u8 is_add, u8 is_local, u32 fib_index, const mfib_prefix_t *prefix, dpo_proto_t nh_proto, u32 entry_flags, fib_rpf_id_t rpf_id, u32 next_hop_sw_if_index, ip46_address_t *nh, u32 itf_flags, u32 bier_imp)
static void vl_api_set_arp_neighbor_limit_t_handler(vl_api_set_arp_neighbor_limit_t *mp)
static void vl_api_mfib_signal_dump_t_handler(vl_api_mfib_signal_dump_t *mp)
clib_error_t * ip6_probe_neighbor(vlib_main_t *vm, ip6_address_t *dst, u32 sw_if_index, u8 refresh)
int fib_entry_cmp_for_sort(void *i1, void *i2)
void send_ip_punt_redirect_details(vl_api_registration_t *reg, u32 context, u32 sw_if_index, ip_punt_redirect_rx_t *pr, u8 is_ipv6)
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
static void vl_api_ip_scan_neighbor_enable_disable_t_handler(vl_api_ip_scan_neighbor_enable_disable_t *mp)
ip_punt_redirect_detail_t * ip6_punt_redirect_entries(u32 sw_if_index)
u32 mfib_entry_get_fib_index(fib_node_index_t mfib_entry_index)
Configure IP source and L4 port-range check.
static int ip4_add_del_route_t_handler(vl_api_ip_add_del_route_t *mp, u32 *stats_index)
static int api_mroute_add_del_t_handler(vl_api_ip_mroute_add_del_t *mp, u32 *stats_index)
Set interface source check request.
vnet_api_error_t api_errno
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static int vl_api_ip6_mfib_table_dump_walk(fib_node_index_t fei, void *arg)
static void vl_api_want_ip6_nd_events_t_handler(vl_api_want_ip6_nd_events_t *mp)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
IP probe neighbor address on an interface by sending an ARP request (for IP4) or ICMP6 Neighbor Solic...
static fib_table_walk_rc_t vl_api_ip_fib_dump_walk(fib_node_index_t fei, void *arg)
vnet_api_error_t ip4_reass_set(u32 timeout_ms, u32 max_reassemblies, u32 expire_walk_interval_ms)
set ip4 reassembly configuration
uword * fib_index_by_table_id
Hash table mapping table id to fib index.
static mfib_itf_t * mfib_itf_get(index_t mi)
Get the MFIB interface representation.
void vnet_sw_interface_walk(vnet_main_t *vnm, vnet_sw_interface_walk_t fn, void *ctx)
Walk all the SW interfaces in the system.
void mfib_table_unlock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Take a reference counting lock on the table.
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
index_t classify_dpo_create(dpo_proto_t proto, u32 classify_table_index)
ip4_address_t ip4_address
void vl_api_ip_table_add_del_t_handler(vl_api_ip_table_add_del_t *mp)
static void vl_api_proxy_arp_add_del_t_handler(vl_api_proxy_arp_add_del_t *mp)
static void vl_api_sw_interface_ip6nd_ra_prefix_t_handler(vl_api_sw_interface_ip6nd_ra_prefix_t *mp)
vnet_api_error_t ip4_reass_get(u32 *timeout_ms, u32 *max_reassemblies, u32 *expire_walk_interval_ms)
get ip4 reassembly configuration
#define pool_put(P, E)
Free an object E in pool P.
IP6 Multicast FIB table response.
static void send_ip6_mfib_details(vpe_api_main_t *am, vl_api_registration_t *reg, u32 table_id, const mfib_prefix_t *pfx, fib_route_path_encode_t *api_rpaths, u32 context)
void fib_table_entry_path_remove2(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_route_path_t *rpath)
Remove n paths to an entry (aka route) in the FIB.
vl_api_fib_path_t path[count]
Configuration for each label value in the output-stack.
vnet_sw_interface_flags_t flags
Recursion constraint of via an attahced prefix.
Proxy ARP dump details reply.
fib_node_index_t * entries
Tell client about an IP4 ARP resolution event or MAC/IP info from ARP requests in L2 BDs...
static_always_inline int mac_address_equal(const mac_address_t *a, const mac_address_t *b)
static void send_ip6nd_proxy_details(vl_api_registration_t *reg, u32 context, const ip46_address_t *addr, u32 sw_if_index)
VLIB_API_INIT_FUNCTION(ip_api_hookup)
u32 expire_walk_interval_ms
void fib_table_unlock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Take a reference counting lock on the table.
static void vl_api_sw_interface_ip6_enable_disable_t_handler(vl_api_sw_interface_ip6_enable_disable_t *mp)
static void vl_api_set_ip_flow_hash_t_handler(vl_api_set_ip_flow_hash_t *mp)
fib_mpls_lsp_mode_t fml_mode
The LSP mode.
void ip6_fib_table_walk(u32 fib_index, fib_table_walk_fn_t fn, void *arg)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
void ra_set_publisher_node(uword node_index, uword event_type)
IOAM enable : Enable in-band OAM.
static mfib_entry_t * mfib_entry_get(fib_node_index_t index)
struct _vl_api_ip6_nd_event * nd_events
clib_error_t * ip4_probe_neighbor(vlib_main_t *vm, ip4_address_t *dst, u32 sw_if_index, u8 refresh)
void stats_dsunlock(void)
static void vl_api_ip_unnumbered_dump_t_handler(vl_api_ip_unnumbered_dump_t *mp)
API main structure, used by both vpp and binary API clients.
u32 fib_entry_get_resolving_interface(fib_node_index_t entry_index)
static clib_error_t * want_ip6_ra_events_reaper(u32 client_index)
An API client registration, only in vpp/vlib.
void wc_nd_set_publisher_node(uword node_index, uword event_type)
vl_api_registration_t * reg
#define BAD_SW_IF_INDEX_LABEL
Proxy ARP interface dump details reply.
struct vl_api_ip6_mfib_dump_ctc_t_ vl_api_ip6_mfib_dump_ctc_t
static int arp_change_data_callback(u32 pool_index, const mac_address_t *mac, u32 sw_if_index, const ip4_address_t *address)
static uword vnet_sw_if_index_is_api_valid(u32 sw_if_index)
fib_node_index_t ft_index
Index into FIB vector.
int fib_entry_is_sourced(fib_node_index_t fib_entry_index, fib_source_t source)
#define VLIB_REGISTER_NODE(x,...)
Set the ip flow hash config for a fib request.
fib_node_index_t fib_table_entry_special_dpo_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Update a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the...
static void send_ip_fib_details(vpe_api_main_t *am, vl_api_registration_t *reg, const fib_table_t *table, const fib_prefix_t *pfx, fib_route_path_encode_t *api_rpaths, u32 context)
u32 ft_table_id
Table ID (hash key) for this FIB.
static void vl_api_ip_punt_redirect_t_handler(vl_api_ip_punt_redirect_t *mp, vlib_main_t *vm)
static int ip6_add_del_route_t_handler(vl_api_ip_add_del_route_t *mp, u32 *stats_index)
static void vl_api_ip_container_proxy_dump_t_handler(vl_api_ip_container_proxy_dump_t *mp)
static uword ip6_address_is_zero(const ip6_address_t *a)
enum fib_table_walk_rc_t_ fib_table_walk_rc_t
return code controlling how a table walk proceeds
#define MPLS_LABEL_INVALID
#define vec_free(V)
Free vector's memory (no header).
void fib_table_entry_delete(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Delete a FIB entry.
struct vl_api_ip_fib_dump_walk_ctx_t_ vl_api_ip_fib_dump_walk_ctx_t
IP4 punt redirect per-rx interface configuration redirect punted traffic to another location...
static int ethernet_mac_address_equal(const u8 *a, const u8 *b)
u8 * ft_desc
Table description.
static void send_ip_details(vpe_api_main_t *am, vl_api_registration_t *reg, u32 sw_if_index, u8 is_ipv6, u32 context)
#define clib_warning(format, args...)
fib_node_index_t * entries
static vlib_node_registration_t wc_arp_process_node
(constructor) VLIB_REGISTER_NODE (wc_arp_process_node)
static void vl_api_ip_source_and_port_range_check_add_del_t_handler(vl_api_ip_source_and_port_range_check_add_del_t *mp)
clib_error_t * ip6_ioam_enable(int has_trace_option, int has_pot_option, int has_seqno_option, int has_analyse_option)
void wc_arp_set_publisher_node(uword node_index, uword event_type)
u32 fib_node_index_t
A typedef of a node index.
u32 tx_sw_if_index
the TX interface to send redirected packets
mfib_entry_flags_t mfe_flags
Route flags.
static void set_ip6_flow_hash(vl_api_set_ip_flow_hash_t *mp)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
void ip4_punt_policer_add_del(u8 is_add, u32 policer_index)
mpls_label_t fml_value
The label value.
void ip_container_proxy_walk(ip_container_proxy_cb_t cb, void *ctx)
int vnet_add_del_ip4_arp_change_event(vnet_main_t *vnm, arp_change_event_cb_t data_callback, u32 pid, void *address_arg, uword node_index, uword type_opaque, uword data, int is_add)
static void vl_api_proxy_arp_dump_t_handler(vl_api_proxy_arp_dump_t *mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
clib_error_t * enable_ip6_interface(vlib_main_t *vm, u32 sw_if_index)
IP unnumbered configurations.
int vnet_proxy_arp_add_del(ip4_address_t *lo_addr, ip4_address_t *hi_addr, u32 fib_index, int is_del)
Aggregrate type for a prefix.
enum fib_entry_flag_t_ fib_entry_flag_t
void ip6_punt_redirect_add(u32 rx_sw_if_index, u32 tx_sw_if_index, ip46_address_t *nh)
void ip6_punt_redirect_del(u32 rx_sw_if_index)
static void send_ip_address_details(vpe_api_main_t *am, vl_api_registration_t *reg, u8 *ip, u16 prefix_length, u32 sw_if_index, u8 is_ipv6, u32 context)
u32 unnumbered_sw_if_index
vnet_api_error_t ip4_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
static void vl_api_ioam_disable_t_handler(vl_api_ioam_disable_t *mp)
u32 fib_rpf_id_t
An RPF-ID is numerical value that is used RPF validate.
struct _vnet_classify_main vnet_classify_main_t
#define foreach_flow_hash_bit
int vnet_add_del_ip6_nd_change_event(vnet_main_t *vnm, ip6_nd_change_event_cb_t data_callback, u32 pid, void *address_arg, uword node_index, uword type_opaque, uword data, int is_add)
static void vl_api_reset_fib_t_handler(vl_api_reset_fib_t *mp)
void ip6_punt_policer_add_del(u8 is_add, u32 policer_index)
static int ip4_reset_fib_t_handler(vl_api_reset_fib_t *mp)
void vl_api_ip_mroute_add_del_t_handler(vl_api_ip_mroute_add_del_t *mp)
IP neighbor add / del request.
#define pool_put_index(p, i)
Free pool element with given index.
ip6_address_t ip6_address
int mfib_signal_send_one(struct vl_api_registration_ *reg, u32 context)
ip_lookup_main_t lookup_main
fib_node_index_t * entries
static int vl_api_ip_mfib_table_dump_walk(fib_node_index_t fei, void *arg)
static int arp_change_delete_callback(u32 pool_index, const mac_address_t *mac, u32 sw_if_index, const ip4_address_t *address)
static int ip_container_proxy_send_details(const fib_prefix_t *pfx, u32 sw_if_index, void *args)
static ip_neighbor_flags_t ip_neighbor_flags_decode(vl_api_ip_neighbor_flags_t v)
IPv6 router advertisement prefix config request.
IPv6 ND proxy details returned after request.
static void set_ip4_flow_hash(vl_api_set_ip_flow_hash_t *mp)
An interface associated with a particular MFIB entry.
IPv6 ND proxy dump request.
static uword wc_arp_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
A deag path using the packet's source not destination address.
static void vl_api_ip_source_check_interface_add_del_t_handler(vl_api_ip_source_check_interface_add_del_t *mp)
static void vl_api_ioam_enable_t_handler(vl_api_ioam_enable_t *mp)
fib_route_path_flags_t frp_flags
flags on the path
struct mfib_table_t_ * mfibs
Vector of MFIBs.
static void vl_api_ip_probe_neighbor_t_handler(vl_api_ip_probe_neighbor_t *mp)
#define clib_error_report(e)
void ip6_address_encode(const ip6_address_t *in, vl_api_ip6_address_t out)
int add_del_route_check(fib_protocol_t table_proto, u32 table_id, u32 next_hop_sw_if_index, dpo_proto_t next_hop_table_proto, u32 next_hop_table_id, u8 is_rpf_id, u32 *fib_index, u32 *next_hop_fib_index)
vnet_classify_main_t vnet_classify_main
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
u32 mft_table_id
Table ID (hash key) for this FIB.
From the control plane API.
void stats_dslock_with_hint(int hint, int tag)
static uword ip6_address_is_equal(const ip6_address_t *a, const ip6_address_t *b)
fib_rpf_id_t mfe_rpf_id
RPF-ID used when the packets ingress not from an interface.
A path that resolves via another table.
static clib_error_t * ip_api_hookup(vlib_main_t *vm)
u32 flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
static void vl_api_ip_fib_dump_t_handler(vl_api_ip_fib_dump_t *mp)
u32 fib_table_entry_get_stats_index(u32 fib_index, const fib_prefix_t *prefix)
Return the stats index for a FIB entry.
static vlib_node_registration_t ip_resolver_process_node
(constructor) VLIB_REGISTER_NODE (ip_resolver_process_node)
int vnet_set_ip6_flow_hash(u32 table_id, flow_hash_config_t flow_hash_config)
void fib_api_path_encode(const fib_route_path_encode_t *api_rpath, vl_api_fib_path_t *out)
IP neighboors dump response.
static vlib_main_t * vlib_get_main(void)
vl_api_punt_redirect_t punt
void fib_entry_encode(fib_node_index_t fib_entry_index, fib_route_path_encode_t **api_rpaths)
void mfib_entry_encode(fib_node_index_t mfib_entry_index, fib_route_path_encode_t **api_rpaths)
mpls_label_t frp_local_label
The MPLS local Label to reursively resolve through.
void ip_prefix_encode(const fib_prefix_t *in, vl_api_prefix_t *out)
struct _vlib_node_registration vlib_node_registration_t
fib_protocol_t fp_proto
protocol type
static void setup_message_id_table(api_main_t *am)
vl_api_ip_neighbor_t neighbor
static void * vlib_process_get_event_data(vlib_main_t *vm, uword *return_event_type_opaque)
mfib_table_t * mfib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
static void vl_api_ip_punt_police_t_handler(vl_api_ip_punt_police_t *mp, vlib_main_t *vm)
Enable/disable periodic IP neighbor scan.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void vl_api_want_ip4_arp_events_t_handler(vl_api_want_ip4_arp_events_t *mp)
const mfib_prefix_t * mfib_entry_get_prefix(fib_node_index_t mfib_entry_index)
u32 mfib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
ip6_neighbor_public_main_t ip6_neighbor_public_main
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
void ip4_address_decode(const vl_api_ip4_address_t in, ip4_address_t *out)
int ip6_neighbor_ra_config(vlib_main_t *vm, u32 sw_if_index, u8 suppress, u8 managed, u8 other, u8 ll_option, u8 send_unicast, u8 cease, u8 use_lifetime, u32 lifetime, u32 initial_count, u32 initial_interval, u32 max_interval, u32 min_interval, u8 is_no)
vnet_sw_interface_t * sw_interfaces
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
#define clib_error_get_code(err)
u8 mfs_buffer[MFIB_SIGNAL_BUFFER_SIZE]
A buffer copied from the DP plane that triggered the signal.
int ip4_source_and_port_range_check_add_del(ip4_address_t *address, u32 length, u32 vrf_id, u16 *low_ports, u16 *high_ports, int is_add)
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
u32 rx_sw_if_index
the RX interface
static clib_error_t * want_ip4_arp_events_reaper(u32 client_index)
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
static void vl_api_sw_interface_ip6nd_ra_config_t_handler(vl_api_sw_interface_ip6nd_ra_config_t *mp)
Tell client about an IP6 ND resolution or MAC/IP info from ICMP6 Neighbor Solicitation in L2 BDs...
vnet_api_error_t ip6_reass_get(u32 *timeout_ms, u32 *max_reassemblies, u32 *expire_walk_interval_ms)
get ip6 reassembly configuration
vl_api_address_t ip_address
static vnet_sw_interface_flags_t vnet_sw_interface_get_flags(vnet_main_t *vnm, u32 sw_if_index)
u32 mfi_sw_if_index
The SW IF index that this MFIB interface represents.
u8 * is_mp_safe
Message is mp safe vector.
A protocol Independent IP multicast FIB table.
ip4_main_t ip4_main
Global ip4 main structure.
static void vlib_process_put_event_data(vlib_main_t *vm, void *event_data)
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
IP6 FIB table entry response.
ip_neighbor_flags_t flags
Register for IP4 ARP resolution event on receing ARP reply or MAC/IP info from ARP requests in L2 BDs...
struct fib_table_t_ * fibs
Vector of FIBs.
Enable/disable reassembly feature.
void ip4_address_encode(const ip4_address_t *in, vl_api_ip4_address_t out)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define vec_foreach(var, vec)
Vector iterator.
vnet_api_error_t ip6_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
clib_error_t * clear_ioam_rewrite_fn(void)
static void vl_api_ip_punt_redirect_dump_t_handler(vl_api_ip_punt_redirect_dump_t *mp)
void ip_table_create(fib_protocol_t fproto, u32 table_id, u8 is_api, const u8 *name)
u8 fml_exp
EXP bits; valid only at imposition.
static void send_ip_neighbor_details(u32 sw_if_index, const ip46_address_t *ip_address, const mac_address_t *mac, ip_neighbor_flags_t flags, vl_api_registration_t *reg, u32 context)
static void vl_api_ip_address_dump_t_handler(vl_api_ip_address_dump_t *mp)
ethernet_arp_ip4_entry_t * ip4_neighbor_entries(u32 sw_if_index)
u32 expire_walk_interval_ms
static void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
_vnet_ip6_neighbor_function_list_elt_t * ra_report_functions
struct apt_ip6_fib_show_ctx_t_ api_ip6_fib_show_ctx_t
u16 fp_len
The mask length.
void mfib_table_entry_path_remove(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpath)
Remove n paths to an entry (aka route) in the FIB.
clib_error_t * disable_ip6_interface(vlib_main_t *vm, u32 sw_if_index)
fib_node_index_t mfs_entry
int ip6_source_and_port_range_check_add_del(ip6_address_t *address, u32 length, u32 vrf_id, u16 *low_ports, u16 *high_ports, int is_add)
vpe_api_main_t vpe_api_main
u32 frp_udp_encap_id
UDP encap ID.
void vl_api_ip_add_del_route_t_handler(vl_api_ip_add_del_route_t *mp)
#define ip46_address_is_zero(ip46)
void vl_mfib_signal_send_one(vl_api_registration_t *reg, u32 context, const mfib_signal_t *mfs)
static walk_rc_t send_proxy_arp_intfc_details(vnet_main_t *vnm, vnet_sw_interface_t *si, void *data)
static void handle_ip6_nd_event(u32 pool_index)
struct fib_table_t_ * fibs
u32 frp_fib_index
The FIB index to lookup the nexthop Only valid for recursive paths.
void mac_address_decode(const u8 *in, mac_address_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
static void vl_api_ip6nd_send_router_solicitation_t_handler(vl_api_ip6nd_send_router_solicitation_t *mp)
static void vl_api_ip_source_and_port_range_check_interface_add_del_t_handler(vl_api_ip_source_and_port_range_check_interface_add_del_t *mp)
#define foreach_ip_api_msg
int add_del_route_t_handler(u8 is_multipath, u8 is_add, u8 is_drop, u8 is_unreach, u8 is_prohibit, u8 is_local, u8 is_multicast, u8 is_classify, u32 classify_table_index, u8 is_resolve_host, u8 is_resolve_attached, u8 is_interface_rx, u8 is_rpf_id, u8 is_dvr, u8 is_source_lookup, u8 is_udp_encap, u32 fib_index, const fib_prefix_t *prefix, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_id, u32 next_hop_sw_if_index, u8 next_hop_fib_index, u16 next_hop_weight, u16 next_hop_preference, mpls_label_t next_hop_via_label, fib_mpls_label_t *next_hop_out_label_stack)
static void send_ip6_fib_details(vpe_api_main_t *am, vl_api_registration_t *reg, const fib_table_t *table, const fib_prefix_t *pfx, fib_route_path_encode_t *api_rpaths, u32 context)
const ip46_address_t zero_addr
ip46_address_t fp_grp_addr
The address type is not deriveable from the fp_addr member.
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
static void vl_api_ip6_fib_dump_t_handler(vl_api_ip6_fib_dump_t *mp)
#define VALIDATE_SW_IF_INDEX(mp)
A protocol Independent FIB table.
static int ip6_reset_fib_t_handler(vl_api_reset_fib_t *mp)
clib_error_t * ip6_set_neighbor_limit(u32 neighbor_limit)
static void vl_api_ip_neighbor_dump_t_handler(vl_api_ip_neighbor_dump_t *mp)
static void vl_api_want_ip6_ra_events_t_handler(vl_api_want_ip6_ra_events_t *mp)
static void send_ip_unnumbered_details(vpe_api_main_t *am, vl_api_registration_t *reg, u32 sw_if_index, u32 ip_sw_if_index, u32 context)
struct ip_container_proxy_walk_ctx_t_ ip_container_proxy_walk_ctx_t
int set_ip_source_and_port_range_check(vlib_main_t *vm, u32 *fib_index, u32 sw_if_index, u32 is_add)
static uword pool_elts(void *v)
Number of active elements in a pool.