23 #include <sys/types.h> 26 #include <netinet/in.h> 71 #undef __included_bihash_template_h__ 99 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 104 #define foreach_vpe_api_msg \ 105 _(WANT_OAM_EVENTS, want_oam_events) \ 106 _(OAM_ADD_DEL, oam_add_del) \ 107 _(IS_ADDRESS_REACHABLE, is_address_reachable) \ 108 _(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \ 109 _(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \ 110 _(SW_INTERFACE_SET_L2_XCONNECT, sw_interface_set_l2_xconnect) \ 111 _(SW_INTERFACE_SET_L2_BRIDGE, sw_interface_set_l2_bridge) \ 112 _(CREATE_VLAN_SUBIF, create_vlan_subif) \ 113 _(CREATE_SUBIF, create_subif) \ 114 _(PROXY_ARP_ADD_DEL, proxy_arp_add_del) \ 115 _(PROXY_ARP_INTFC_ENABLE_DISABLE, proxy_arp_intfc_enable_disable) \ 116 _(VNET_GET_SUMMARY_STATS, vnet_get_summary_stats) \ 117 _(RESET_FIB, reset_fib) \ 118 _(CREATE_LOOPBACK, create_loopback) \ 119 _(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \ 120 _(CONTROL_PING, control_ping) \ 121 _(CLI_REQUEST, cli_request) \ 122 _(CLI_INBAND, cli_inband) \ 123 _(SET_ARP_NEIGHBOR_LIMIT, set_arp_neighbor_limit) \ 124 _(L2_PATCH_ADD_DEL, l2_patch_add_del) \ 125 _(CLASSIFY_SET_INTERFACE_IP_TABLE, classify_set_interface_ip_table) \ 126 _(CLASSIFY_SET_INTERFACE_L2_TABLES, classify_set_interface_l2_tables) \ 127 _(GET_NODE_INDEX, get_node_index) \ 128 _(ADD_NODE_NEXT, add_node_next) \ 129 _(L2_INTERFACE_EFP_FILTER, l2_interface_efp_filter) \ 130 _(SHOW_VERSION, show_version) \ 131 _(INTERFACE_NAME_RENUMBER, interface_name_renumber) \ 132 _(WANT_IP4_ARP_EVENTS, want_ip4_arp_events) \ 133 _(WANT_IP6_ND_EVENTS, want_ip6_nd_events) \ 134 _(INPUT_ACL_SET_INTERFACE, input_acl_set_interface) \ 135 _(DELETE_LOOPBACK, delete_loopback) \ 136 _(BD_IP_MAC_ADD_DEL, bd_ip_mac_add_del) \ 137 _(GET_NODE_GRAPH, get_node_graph) \ 138 _(IOAM_ENABLE, ioam_enable) \ 139 _(IOAM_DISABLE, ioam_disable) \ 140 _(GET_NEXT_INDEX, get_next_index) \ 141 _(PG_CREATE_INTERFACE, pg_create_interface) \ 142 _(PG_CAPTURE, pg_capture) \ 143 _(PG_ENABLE_DISABLE, pg_enable_disable) \ 144 _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \ 145 ip_source_and_port_range_check_add_del) \ 146 _(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \ 147 ip_source_and_port_range_check_interface_add_del) \ 148 _(DELETE_SUBIF, delete_subif) \ 150 _(FEATURE_ENABLE_DISABLE, feature_enable_disable) 153 #define QUOTE(x) QUOTE_(x) 178 p = hash_get (vam->a##_registration_hash, client_index); \ 180 rp = pool_elt_at_index (vam->a##_registrations, p[0]); \ 181 pool_put (vam->a##_registrations, rp); \ 182 hash_unset (vam->a##_registration_hash, client_index); \ 193 #define RESOLUTION_EVENT 1 194 #define RESOLUTION_PENDING_EVENT 2 195 #define IP4_ARP_EVENT 3 196 #define IP6_ND_EVENT 4 229 if (q->cursize < q->maxsize)
237 static f64 last_time;
244 clib_warning (
"arp event for %U to pid %d: queue stuffed!",
278 if (q->cursize < q->maxsize)
286 static f64 last_time;
293 clib_warning (
"ip6 nd event for %U to pid %d: queue stuffed!",
305 uword *event_data = 0;
326 for (i = 0; i <
vec_len (event_data); i++)
331 for (i = 0; i <
vec_len (event_data); i++)
348 .name =
"vpe-route-resolver-process",
363 sw_if_index, mp->
enable, 0, 0);
365 sw_if_index, mp->
enable, 0, 0);
367 sw_if_index, mp->
enable, 0, 0);
369 sw_if_index, mp->
enable, 0, 0);
393 rx_sw_if_index, 0, 0, 0, tx_sw_if_index);
403 REPLY_MACRO (VL_API_SW_INTERFACE_SET_L2_XCONNECT_REPLY);
429 rx_sw_if_index, bd_index, bvi, shg, 0);
438 REPLY_MACRO (VL_API_SW_INTERFACE_SET_L2_BRIDGE_REPLY);
454 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
461 rv = VNET_API_ERROR_UNSPECIFIED;
472 u32 sw_if_index = (
u32) ~ 0;
489 rv = VNET_API_ERROR_BOND_SLAVE_NOT_ALLOWED;
494 if (
id == 0 ||
id > 4095)
496 rv = VNET_API_ERROR_INVALID_VLAN;
505 rv = VNET_API_ERROR_VLAN_ALREADY_EXISTS;
509 memset (&
template, 0,
sizeof (
template));
512 template.sub.id = id;
513 template.sub.eth.raw_flags = 0;
514 template.sub.eth.flags.one_tag = 1;
515 template.sub.eth.outer_vlan_id = id;
516 template.sub.eth.flags.exact_match = 1;
522 rv = VNET_API_ERROR_INVALID_REGISTRATION;
527 *kp = sup_and_sub_key;
540 rmp->_vl_msg_id = htons (VL_API_CREATE_VLAN_SUBIF_REPLY);
552 u32 sw_if_index = ~0;
570 rv = VNET_API_ERROR_BOND_SLAVE_NOT_ALLOWED;
575 sub_id = ntohl (mp->
sub_id);
577 sup_and_sub_key = ((
u64) (sw_if_index) << 32) | (
u64) sub_id;
583 clib_warning (
"sup sw_if_index %d, sub id %d already exists\n",
584 sw_if_index, sub_id);
585 rv = VNET_API_ERROR_SUBIF_ALREADY_EXISTS;
589 memset (&
template, 0,
sizeof (
template));
591 template.sup_sw_if_index = sw_if_index;
592 template.sub.id = sub_id;
593 template.sub.eth.flags.no_tags = mp->
no_tags;
594 template.sub.eth.flags.one_tag = mp->
one_tag;
595 template.sub.eth.flags.two_tags = mp->
two_tags;
596 template.sub.eth.flags.dot1ad = mp->
dot1ad;
597 template.sub.eth.flags.exact_match = mp->
exact_match;
598 template.sub.eth.flags.default_sub = mp->
default_sub;
608 rv = VNET_API_ERROR_SUBIF_CREATE_FAILED;
613 *kp = sup_and_sub_key;
640 u32 fib_index,
int is_del);
649 rv = VNET_API_ERROR_NO_SUCH_FIB;
657 fib_index, mp->
is_add == 0);
687 REPLY_MACRO (VL_API_PROXY_ARP_INTFC_ENABLE_DISABLE_REPLY);
694 vpe_main_t *rm = &vpe_main;
703 u32 adj_index, sw_if_index;
711 increment_missing_api_client_counter (rm->vlib_main);
723 adj_index = ip6_fib_lookup (im6, sw_if_index, &
addr.ip6);
739 && adj->rewrite_header.sw_if_index == sw_if_index)
746 && adj->rewrite_header.sw_if_index == sw_if_index)
779 REPLY_MACRO (VL_API_SW_INTERFACE_SET_MPLS_ENABLE_REPLY);
793 q = vl_api_client_index_to_input_queue (reg->client_index);
796 mp = vl_msg_api_alloc (sizeof (*mp));
797 mp->_vl_msg_id = ntohs (VL_API_OAM_EVENT);
798 clib_memcpy (mp->dst_address, &t->dst_address,
799 sizeof (mp->dst_address));
800 mp->state = t->state;
801 vl_msg_api_send_shmem (q, (u8 *)&mp);
839 rmp->_vl_msg_id = ntohs (VL_API_VNET_SUMMARY_STATS_REPLY);
843 memset (total_pkts, 0,
sizeof (total_pkts));
844 memset (total_bytes, 0,
sizeof (total_bytes));
855 total_pkts[which] += v.
packets;
856 total_bytes[which] += v.
bytes;
874 u32 address_length: 6;
885 static u32 *sw_if_indices_to_shut;
891 int rv = VNET_API_ERROR_NO_SUCH_FIB;
899 fib = &fib_table->v4;
900 vnet_sw_interface_t * si;
902 if (fib->table_id != target_fib_id)
906 mpls_fib_reset_labels (fib->table_id);
909 vnet_proxy_arp_fib_reset (fib->table_id);
912 vnet_set_ip4_flow_hash (fib->table_id, IP_FLOW_HASH_DEFAULT);
914 vec_reset_length (sw_if_indices_to_shut);
917 pool_foreach (si, im->sw_interfaces,
919 u32 sw_if_index = si->sw_if_index;
921 if (sw_if_index < vec_len (im4->fib_index_by_sw_if_index)
922 && (im4->fib_index_by_sw_if_index[si->sw_if_index] ==
924 vec_add1 (sw_if_indices_to_shut, si->sw_if_index);
927 for (i = 0; i <
vec_len (sw_if_indices_to_shut); i++) {
928 sw_if_index = sw_if_indices_to_shut[
i];
953 static u32 *sw_if_indices_to_shut;
958 int rv = VNET_API_ERROR_NO_SUCH_FIB;
966 vnet_sw_interface_t * si;
967 fib = &(fib_table->v6);
969 if (fib->table_id != target_fib_id)
972 vec_reset_length (sw_if_indices_to_shut);
975 pool_foreach (si, im->sw_interfaces,
977 if (im6->fib_index_by_sw_if_index[si->sw_if_index] ==
979 vec_add1 (sw_if_indices_to_shut, si->sw_if_index);
982 for (i = 0; i <
vec_len (sw_if_indices_to_shut); i++) {
983 sw_if_index = sw_if_indices_to_shut[
i];
1010 rv = ip4_reset_fib_t_handler (mp);
1042 is_specified, user_instance);
1074 rmp->
vpe_pid = ntohl (getpid());
1082 u8 **shmem_vecp = (
u8 **) arg;
1088 shmem_vec = *shmem_vecp;
1097 clib_memcpy (shmem_vec + offset, buffer, buffer_bytes);
1102 *shmem_vecp = shmem_vec;
1122 rp->_vl_msg_id = ntohs (VL_API_CLI_REPLY);
1145 u8 **mem_vecp = (
u8 **) arg;
1146 u8 *mem_vec = *mem_vecp;
1150 clib_memcpy (mem_vec + offset, buffer, buffer_bytes);
1151 *mem_vecp = mem_vec;
1175 rmp->
length = htonl (len);
1200 rv = VNET_API_ERROR_UNSPECIFIED;
1207 REPLY_MACRO (VL_API_SET_ARP_NEIGHBOR_LIMIT_REPLY);
1229 REPLY_MACRO (VL_API_CLASSIFY_SET_INTERFACE_IP_TABLE_REPLY);
1237 u32 sw_if_index, ip4_table_index, ip6_table_index, other_table_index;
1258 if (ip4_table_index != ~0 || ip6_table_index != ~0
1259 || other_table_index != ~0)
1272 REPLY_MACRO (VL_API_CLASSIFY_SET_INTERFACE_L2_TABLES_REPLY);
1276 u32 sw_if_index,
u32 enable);
1290 REPLY_MACRO (VL_API_L2_INTERFACE_EFP_FILTER_REPLY);
1312 strncpy ((
char *) rmp->
build_directory, vpe_api_get_build_directory(),
1314 strncpy ((
char *) rmp->
version, vpe_api_get_version(),
1316 strncpy ((
char *) rmp->
build_date, vpe_api_get_build_date(),
1329 u32 node_index = ~0;
1334 rv = VNET_API_ERROR_NO_SUCH_NODE;
1336 node_index = n->
index;
1353 u32 next_node_index = ~0, next_index = ~0;
1360 rv = VNET_API_ERROR_NO_SUCH_NODE;
1368 rv = VNET_API_ERROR_NO_SUCH_NODE2;
1372 next_node_index = next_node->
index;
1378 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
1400 u32 next_index = ~0;
1406 rv = VNET_API_ERROR_NO_SUCH_NODE;
1413 rv = VNET_API_ERROR_NO_SUCH_NODE2;
1441 (
int) (mp->
is_add != 0));
1463 REPLY_MACRO (VL_API_INTERFACE_NAME_RENUMBER_REPLY);
1468 u32 sw_if_index,
u32 address)
1473 static f64 arp_event_last_time;
1491 (now - arp_event_last_time) < 10.0)))
1496 arp_event_last_time = now;
1510 static f64 nd_event_last_time;
1530 (now - nd_event_last_time) < 10.0)))
1535 nd_event_last_time = now;
1578 memset (event, 0,
sizeof (*event));
1580 event->_vl_msg_id = ntohs (VL_API_IP4_ARP_EVENT);
1591 vpe_resolver_process_node.index,
1599 vpe_resolver_process_node.index,
1617 memset (event, 0,
sizeof (*event));
1619 event->_vl_msg_id = ntohs (VL_API_IP6_ND_EVENT);
1630 vpe_resolver_process_node.index,
1638 vpe_resolver_process_node.index,
1659 ip6_table_index, l2_table_index, mp->
is_add);
1663 REPLY_MACRO (VL_API_INPUT_ACL_SET_INTERFACE_REPLY);
1768 u32 hw_if_index = ~0;
1774 if (hw_if_index != ~0)
1793 rv = VNET_API_ERROR_CANNOT_CREATE_PCAP_FILE;
1808 u32 stream_index = ~0;
1841 u16 *high_ports = 0;
1843 u16 tmp_low, tmp_high;
1849 if (num_ranges > 32)
1851 rv = VNET_API_ERROR_EXCEEDED_NUMBER_OF_RANGES_CAPACITY;
1858 for (i = 0; i < num_ranges; i++)
1864 if (tmp_low > tmp_high || tmp_low == 0 || tmp_high > 65535)
1866 rv = VNET_API_ERROR_INVALID_VALUE;
1870 vec_add1 (high_ports, tmp_high + 1);
1874 if ((is_ipv6 && mask_length > 128) || (!is_ipv6 && mask_length > 32))
1876 rv = VNET_API_ERROR_ADDRESS_LENGTH_MISMATCH;
1880 vrf_id = ntohl (mp->
vrf_id);
1884 rv = VNET_API_ERROR_INVALID_VALUE;
1896 high_ports, is_add);
1905 high_ports, is_add);
1911 REPLY_MACRO (VL_API_IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL_REPLY);
1940 if (vrf_id[i] != 0 && vrf_id[i] != ~0)
1946 rv = VNET_API_ERROR_INVALID_VALUE;
1950 fib_index[
i] = p[0];
1966 REPLY_MACRO (VL_API_IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL_REPLY);
2012 (
const char *) feature_name);
2014 rv = VNET_API_ERROR_INVALID_VALUE;
2020 if (reg->enable_disable_cb)
2021 error = reg->enable_disable_cb (sw_if_index, mp->
enable);
2024 (
const char *) feature_name,
2025 sw_if_index, mp->
enable, 0, 0);
2029 rv = VNET_API_ERROR_CANNOT_ENABLE_DISABLE_FEATURE;
2038 REPLY_MACRO (VL_API_FEATURE_ENABLE_DISABLE_REPLY);
2041 #define BOUNCE_HANDLER(nn) \ 2042 static void vl_api_##nn##_t_handler ( \ 2043 vl_api_##nn##_t *mp) \ 2045 vpe_client_registration_t *reg; \ 2046 vpe_api_main_t * vam = &vpe_api_main; \ 2047 unix_shared_memory_queue_t * q; \ 2050 pool_foreach(reg, vam->nn##_registrations, \ 2052 q = vl_api_client_index_to_input_queue (reg->client_index); \ 2059 if (q->cursize == q->maxsize) { \ 2060 clib_warning ("ERROR: receiver queue full, drop msg"); \ 2061 vl_msg_api_free (mp); \ 2064 vl_msg_api_send_shmem (q, (u8 *)&mp); \ 2068 vl_msg_api_free (mp); \ 2086 vl_msg_api_set_handlers(VL_API_##N, #n, \ 2087 vl_api_##n##_t_handler, \ 2089 vl_api_##n##_t_endian, \ 2090 vl_api_##n##_t_print, \ 2091 sizeof(vl_api_##n##_t), 1); 2100 += 5 *
sizeof (
u32x4);
2127 am->from_netconf_server_registration_hash =
hash_create (0,
sizeof (
uword));
2129 am->from_netconf_client_registration_hash =
hash_create (0,
sizeof (
uword));
2146 u64 baseva,
size, pvt_heap_size;
2148 const int max_buf_size = 4096;
2150 struct passwd _pw, *pw;
2151 struct group _grp, *grp;
2156 if (
unformat (input,
"prefix %s", &chroot_path))
2161 else if (
unformat (input,
"uid %d", &uid))
2163 else if (
unformat (input,
"gid %d", &gid))
2165 else if (
unformat (input,
"baseva %llx", &baseva))
2167 else if (
unformat (input,
"global-size %lldM", &size))
2169 else if (
unformat (input,
"global-size %lldG", &size))
2171 else if (
unformat (input,
"global-size %lld", &size))
2173 else if (
unformat (input,
"global-pvt-heap-size %lldM", &pvt_heap_size))
2175 else if (
unformat (input,
"global-pvt-heap-size size %lld",
2178 else if (
unformat (input,
"api-pvt-heap-size %lldM", &pvt_heap_size))
2180 else if (
unformat (input,
"api-pvt-heap-size size %lld",
2183 else if (
unformat (input,
"api-size %lldM", &size))
2185 else if (
unformat (input,
"api-size %lldG", &size))
2187 else if (
unformat (input,
"api-size %lld", &size))
2189 else if (
unformat (input,
"uid %s", &s))
2194 getpwnam_r (s, &_pw, buf,
vec_len (buf), &pw)) == ERANGE)
2195 && (
vec_len (buf) <= max_buf_size))
2204 "cannot fetch username %s", s);
2220 else if (
unformat (input,
"gid %s", &s))
2225 getgrnam_r (s, &_grp, buf,
vec_len (buf), &grp)) == ERANGE)
2226 && (
vec_len (buf) <= max_buf_size))
2235 "cannot fetch group %s", s);
2273 s =
format (s,
"bd mac/ip4 binding events");
2286 s =
format (s,
"bd mac/ip6 binding events");
2309 vlib_cli_output (vm,
"%U", format_arp_event, arp_event);
2314 vlib_cli_output (vm,
"%U", format_nd_event, nd_event);
2323 .path =
"show arp-nd-event registrations",
2325 .short_help =
"Show ip4 arp and ip6 nd event registrations",
2329 #define vl_msg_name_crc_list 2331 #undef vl_msg_name_crc_list 2336 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 2337 foreach_vl_msg_name_crc_memclnt;
2338 foreach_vl_msg_name_crc_vpe;
static u32 ip4_fib_lookup(ip4_main_t *im, u32 sw_if_index, ip4_address_t *dst)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
static void vl_api_create_loopback_t_handler(vl_api_create_loopback_t *mp)
static void vl_api_feature_enable_disable_t_handler(vl_api_feature_enable_disable_t *mp)
#define BAD_RX_SW_IF_INDEX_LABEL
Proxy ARP add / del request.
clib_error_t * pg_capture(pg_capture_args_t *a)
void mpls_sw_interface_enable_disable(mpls_main_t *mm, u32 sw_if_index, u8 is_enable)
static clib_error_t * memclnt_delete_callback(u32 client_index)
static void vl_api_want_ip4_arp_events_t_handler(vl_api_want_ip4_arp_events_t *mp)
#define hash_set(h, key, value)
Register for ip6 nd resolution events.
#define VALIDATE_TX_SW_IF_INDEX(mp)
sll srl srl sll sra u16x4 i
void vl_enable_disable_memory_api(vlib_main_t *vm, int yesno)
static void vl_api_reset_fib_t_handler(vl_api_reset_fib_t *mp)
static void svm_pop_heap(void *oldheap)
Reply for get next node index.
static void vl_api_interface_name_renumber_t_handler(vl_api_interface_name_renumber_t *mp)
vpe parser cli string response
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...
static void vl_api_vnet_get_summary_stats_t_handler(vl_api_vnet_get_summary_stats_t *mp)
#define foreach_vpe_api_msg
void vl_set_memory_gid(int gid)
void vlib_cli_input(vlib_main_t *vm, unformat_input_t *input, vlib_cli_output_function_t *function, uword function_arg)
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
iOAM Trace profile add / del response
vnet_main_t * vnet_get_main(void)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static int arp_change_data_callback(u32 pool_index, u8 *new_mac, u32 sw_if_index, u32 address)
void vl_set_global_pvt_heap_size(u64 size)
int vnet_set_ip6_classify_intfc(vlib_main_t *vm, u32 sw_if_index, u32 table_index)
vnet_interface_main_t interface_main
Control ping from client to api server request.
Fixed length block allocator.
#define REPLY_MACRO2(t, body)
Request for a single block of summary stats.
Set max allowed ARP or ip6 neighbor entries request.
static f64 vlib_time_now(vlib_main_t *vm)
int vnet_add_del_ip6_nd_change_event(vnet_main_t *vnm, void *data_callback, u32 pid, void *address_arg, uword node_index, uword type_opaque, uword data, int is_add)
VLIB_API_INIT_FUNCTION(vpe_api_hookup)
uword * stream_index_by_name
clib_error_t * ip4_set_arp_limit(u32 arp_limit)
static void vl_api_sw_interface_set_mpls_enable_t_handler(vl_api_sw_interface_set_mpls_enable_t *mp)
static clib_error_t * api_segment_config(vlib_main_t *vm, unformat_input_t *input)
static void vl_api_is_address_reachable_t_handler(vl_api_is_address_reachable_t *mp)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
int vnet_interface_name_renumber(u32 sw_if_index, u32 new_show_dev_instance)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
static void vl_api_punt_t_handler(vl_api_punt_t *mp)
Combined counter to hold both packets and byte differences.
struct _vlib_node_registration vlib_node_registration_t
void vnet_l2_input_classify_enable_disable(u32 sw_if_index, int enable_disable)
Enable/disable l2 input classification on a specific interface.
static void vl_api_set_arp_neighbor_limit_t_handler(vl_api_set_arp_neighbor_limit_t *mp)
#define hash_set_mem(h, key, value)
ip_lookup_main_t lookup_main
void vl_set_global_memory_baseva(u64 baseva)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
uword * sub_interface_sw_if_index_by_id
unformat_function_t unformat_vnet_sw_interface
void vl_set_api_pvt_heap_size(u64 size)
Set bridge domain ip to mac entry response.
u8 * vlib_node_serialize(vlib_node_main_t *nm, u8 *vector, u32 max_threads, int include_nexts, int include_stats)
Enable / disable packet generator request.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
L2 interface ethernet flow point filtering response.
static void vl_api_proxy_arp_add_del_t_handler(vl_api_proxy_arp_add_del_t *mp)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
trace_cfg_t * api_trace_cfg
static void vl_api_l2_patch_add_del_t_handler(vl_api_l2_patch_add_del_t *mp)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
Delete sub interface response.
Adjacency to drop this packet.
Interface bridge mode response.
static f64 vlib_last_vector_length_per_node(vlib_main_t *vm)
OAM add / del target response.
pub_sub_handler(oam_events, OAM_EVENTS)
u8 pcap_file_name[pcap_name_length]
PacketGenerator capture packets on given interface request.
static void vl_api_get_next_index_t_handler(vl_api_get_next_index_t *mp)
Get node index using name request.
Proxy ARP add / del request.
#define VNET_SW_INTERFACE_FLAG_PROXY_ARP
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
void vl_set_global_memory_size(u64 size)
#define VLIB_INIT_FUNCTION(x)
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 void vl_api_get_node_graph_t_handler(vl_api_get_node_graph_t *mp)
static void * svm_push_data_heap(svm_region_t *rp)
void vl_set_memory_uid(int uid)
vnet_feature_registration_t * vnet_get_feature_reg(const char *arc_name, const char *node_name)
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
vlib_combined_counter_main_t * combined_sw_if_counters
static uword ip6_address_is_equal(ip6_address_t *a, ip6_address_t *b)
Set interface source and L4 port-range request.
Reply for the vlan subinterface create request.
#define clib_error_return_fatal(e, args...)
struct _vl_api_ip4_arp_event * arp_events
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
void fib_table_flush(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Flush all entries from a table for the source.
#define clib_error_return(e, args...)
int vnet_l2_output_classify_set_tables(u32 sw_if_index, u32 ip4_table_index, u32 ip6_table_index, u32 other_table_index)
Set l2 per-protocol, per-interface output classification tables.
static void vl_api_want_ip6_nd_events_t_handler(vl_api_want_ip6_nd_events_t *mp)
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
static clib_error_t * vpe_api_init(vlib_main_t *vm)
static int ip6_reset_fib_t_handler(vl_api_reset_fib_t *mp)
int vnet_set_ip4_classify_intfc(vlib_main_t *vm, u32 sw_if_index, u32 table_index)
uword * bd_index_by_bd_id
clib_error_t * ip6_probe_neighbor(vlib_main_t *vm, ip6_address_t *dst, u32 sw_if_index)
Configure IP source and L4 port-range check.
Interface set vpath response.
uword * hw_interface_by_name
clib_error_t * ip4_probe_neighbor(vlib_main_t *vm, ip4_address_t *dst, u32 sw_if_index)
vnet_api_error_t api_errno
void dsunlock(stats_main_t *sm)
void vl_set_memory_root_path(char *root_path)
static uword resolver_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void vl_api_pg_enable_disable_t_handler(vl_api_pg_enable_disable_t *mp)
uword * fib_index_by_table_id
Hash table mapping table id to fib index.
Configure IP source and L4 port-range check reply.
counter_t packets
packet counter
static void shmem_cli_output(uword arg, u8 *buffer, uword buffer_bytes)
u32 new_show_dev_instance
Set/unset l2 classification tables for an interface response.
static void vl_api_pg_create_interface_t_handler(vl_api_pg_create_interface_t *mp)
static void vl_api_get_node_index_t_handler(vl_api_get_node_index_t *mp)
char * vpe_api_get_version(void)
static void vl_api_bd_ip_mac_add_del_t_handler(vl_api_bd_ip_mac_add_del_t *mp)
u32 vlib_combined_counter_n_counters(const vlib_combined_counter_main_t *cm)
The number of counters (not the number of per-thread counters)
static void vl_api_sw_interface_set_l2_bridge_t_handler(vl_api_sw_interface_set_l2_bridge_t *mp)
Set/unset l2 classification tables for an interface request.
void send_oam_event(oam_target_t *t)
static u8 * format_nd_event(u8 *s, va_list *args)
Set bridge domain ip to mac entry request.
u8 stream_name[stream_name_length]
uword * sw_if_index_by_sup_and_sub
Reply to the eature path enable/disable request.
static void vl_api_pg_capture_t_handler(vl_api_pg_capture_t *mp)
#define BAD_TX_SW_IF_INDEX_LABEL
Create loopback interface instance response.
u32 pg_interface_add_or_get(pg_main_t *pg, uword stream_index)
clib_error_t * vnet_punt_add_del(vlib_main_t *vm, u8 ipv, u8 protocol, u16 port, int is_add)
Request IP traffic punt to the local TCP/IP stack.
Tell client about an ip4 arp resolution event.
static void vl_api_classify_set_interface_ip_table_t_handler(vl_api_classify_set_interface_ip_table_t *mp)
Enable or Disable MPLS on and interface.
Set/unset interface classification table response.
IOAM enable : Enable in-band OAM.
#define REPLY_MACRO3(t, n, body)
struct _vl_api_ip6_nd_event * nd_events
IP Set the next node for a given node response.
Get node index using name request.
int vnet_create_loopback_interface(u32 *sw_if_indexp, u8 *mac_address, u8 is_specified, u32 user_instance)
static void vl_api_add_node_next_t_handler(vl_api_add_node_next_t *mp)
#define VNET_HW_INTERFACE_BOND_INFO_SLAVE
#define BAD_SW_IF_INDEX_LABEL
Delete loopback interface response.
#define VLIB_EARLY_CONFIG_FUNCTION(x, n,...)
PacketGenerator create interface request.
static int nd_change_data_callback(u32 pool_index, u8 *new_mac, u32 sw_if_index, ip6_address_t *address)
void * vl_msg_api_alloc(int nbytes)
Reply for Proxy ARP interface enable / disable request.
Reply for interface events registration.
static void vl_api_proxy_arp_intfc_enable_disable_t_handler(vl_api_proxy_arp_intfc_enable_disable_t *mp)
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
L2 interface patch add / del response.
int vnet_delete_sub_interface(u32 sw_if_index)
static vlib_node_registration_t vpe_resolver_process_node
(constructor) VLIB_REGISTER_NODE (vpe_resolver_process_node)
u32 bd_add_del_ip_mac(u32 bd_index, u8 *ip_addr, u8 *mac_addr, u8 is_ip6, u8 is_add)
Add/delete IP address to MAC address mapping.
#define vec_free(V)
Free vector's memory (no header).
int vnet_delete_loopback_interface(u32 sw_if_index)
static void vl_api_ioam_disable_t_handler(vl_api_ioam_disable_t *mp)
Set/unset the classification table for an interface request.
#define clib_warning(format, args...)
char * vpe_api_get_build_directory(void)
#define clib_memcpy(a, b, c)
Feature path enable/disable request.
static void inband_cli_output(uword arg, u8 *buffer, uword buffer_bytes)
clib_error_t * ip6_ioam_enable(int has_trace_option, int has_pot_option, int has_seqno_option, int has_analyse_option)
static void vl_api_show_version_t_handler(vl_api_show_version_t *mp)
static void vnet_interface_counter_unlock(vnet_interface_main_t *im)
Definitions for punt infrastructure.
int vnet_l2_input_classify_set_tables(u32 sw_if_index, u32 ip4_table_index, u32 ip6_table_index, u32 other_table_index)
Set l2 per-protocol, per-interface input classification tables.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Delete sub interface request.
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
int ip4_add_del_route_t_handler(vl_api_ip_add_del_route_t *mp)
static void vl_api_cli_request_t_handler(vl_api_cli_request_t *mp)
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
#define VALIDATE_RX_SW_IF_INDEX(mp)
PacketGenerator capture packets response.
int vnet_proxy_arp_add_del(ip4_address_t *lo_addr, ip4_address_t *hi_addr, u32 fib_index, int is_del)
Delete loopback interface request.
static void vl_api_sw_interface_set_vpath_t_handler(vl_api_sw_interface_set_vpath_t *mp)
#define VLIB_CLI_COMMAND(x,...)
Set L2 XConnect between two interfaces request.
static void vnet_interface_counter_lock(vnet_interface_main_t *im)
#define hash_create(elts, value_bytes)
#define VNET_SW_INTERFACE_FLAG_ADMIN_UP
Set L2 XConnect response.
#define pool_put_index(p, i)
Free pool element with given index.
Reply for vnet_get_summary_stats request.
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)
static uword ip6_address_is_zero(ip6_address_t *a)
static clib_error_t * show_ip_arp_nd_events_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void vl_api_classify_set_interface_l2_tables_t_handler(vl_api_classify_set_interface_l2_tables_t *mp)
int ip6_add_del_route_t_handler(vl_api_ip_add_del_route_t *mp)
static void vl_api_cli_inband_t_handler(vl_api_cli_inband_t *mp)
Reply for enable / disable packet generator.
ip_lookup_main_t lookup_main
static void setup_message_id_table(api_main_t *am)
int vpe_oam_add_del_target(ip4_address_t *src_address, ip4_address_t *dst_address, u32 fib_id, int is_add)
void pg_enable_disable(u32 stream_index, int is_enable)
int stats_memclnt_delete_callback(u32 client_index)
Reply for proxy arp add / del request.
Control ping from the client to the server response.
static void vl_api_create_vlan_subif_t_handler(vl_api_create_vlan_subif_t *mp)
Bitmaps built as vectors of machine words.
Set the next node for a given node request.
uword * next_slot_by_node
void handle_ip6_nd_event(u32 pool_index)
#define clib_error_report(e)
Query relative index via node names.
Is Address Reachable request - DISABLED.
Set max allowed ARP or ip6 neighbor entries response.
From the control plane API.
void l2_efp_filter_configure(vnet_main_t *vnet_main, u32 sw_if_index, u32 enable)
Enable/disable the EFP Filter check on the subinterface.
OAM add / del target request.
static void * clib_mem_alloc(uword size)
VL_MSG_API_REAPER_FUNCTION(memclnt_delete_callback)
static void vl_api_delete_subif_t_handler(vl_api_delete_subif_t *mp)
static void vl_api_ioam_enable_t_handler(vl_api_ioam_enable_t *mp)
static vlib_main_t * vlib_get_main(void)
static void vl_api_l2_interface_efp_filter_t_handler(vl_api_l2_interface_efp_filter_t *mp)
void vl_set_memory_region_name(char *name)
void dslock(stats_main_t *sm, int release_hint, int tag)
template key/value backing page structure
counter_t bytes
byte counter
static void vl_api_create_loopback_instance_t_handler(vl_api_create_loopback_instance_t *mp)
Interface bridge mode request.
void handle_ip4_arp_event(u32 pool_index)
Create loopback interface instance request.
u32 bd_find_or_add_bd_index(bd_main_t *bdm, u32 bd_id)
Get or create a bridge domain.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vnet_interface_main_t * interface_main
ip_lookup_next_t lookup_next_index
static void vl_api_sw_interface_set_l2_xconnect_t_handler(vl_api_sw_interface_set_l2_xconnect_t *mp)
vlib_node_main_t node_main
void * get_unformat_vnet_sw_interface(void)
Process a vpe parser cli string request.
static void vl_api_create_subif_t_handler(vl_api_create_subif_t *mp)
L2 interface ethernet flow point filtering enable/disable request.
static u8 * format_arp_event(u8 *s, va_list *args)
int vnet_l2_patch_add_del(u32 rx_sw_if_index, u32 tx_sw_if_index, int is_add)
PacketGenerator create interface response.
void vnet_l2_output_classify_enable_disable(u32 sw_if_index, int enable_disable)
Enable/disable l2 input classification on a specific interface.
Create loopback interface request.
#define clib_error_get_code(err)
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)
static void vl_api_delete_loopback_t_handler(vl_api_delete_loopback_t *mp)
A collection of combined counters.
vpe_api_main_t vpe_api_main
Create a new subinterface with the given vlan id.
Create loopback interface response.
L2 interface patch add / del request.
#define hash_get_mem(h, key)
static void vl_api_control_ping_t_handler(vl_api_control_ping_t *mp)
Tell client about an ip6 nd resolution or mac/ip event.
struct clib_bihash_value offset
template key/value backing page structure
Interface set vpath request.
char * vpe_api_get_build_date(void)
Segment Routing data structures definitions.
#define VLIB_REGISTER_NODE(x,...)
ip4_main_t ip4_main
Global ip4 main structure.
static void vl_api_input_acl_set_interface_t_handler(vl_api_input_acl_set_interface_t *mp)
#define clib_error_return_code(e, code, flags, args...)
Register for ip4 arp resolution events.
struct fib_table_t_ * fibs
Vector of FIBs.
This packet is to be rewritten and forwarded to the next processing node.
#define vec_foreach(var, vec)
Vector iterator.
clib_error_t * clear_ioam_rewrite_fn(void)
Reply for ip6 nd resolution events registration.
static int nd_change_delete_callback(u32 pool_index, u8 *notused)
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
static void vl_api_oam_add_del_t_handler(vl_api_oam_add_del_t *mp)
Set interface source and L4 port-range response.
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 * vnet_create_sw_interface(vnet_main_t *vnm, vnet_sw_interface_t *template, u32 *sw_if_index)
static int arp_change_delete_callback(u32 pool_index, u8 *notused)
Reply for MPLS state on an interface.
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)
static uword vnet_sw_interface_get_flags(vnet_main_t *vnm, u32 sw_if_index)
#define RESOLUTION_PENDING_EVENT
static clib_error_t * vpe_api_hookup(vlib_main_t *vm)
void vl_set_api_memory_size(u64 size)
typedef CLIB_PACKED(struct{ip4_address_t address;u32 address_length:6;u32 index:26;})
struct fib_table_t_ * fibs
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Reply to the punt request.
int vnet_add_del_ip4_arp_change_event(vnet_main_t *vnm, void *data_callback, u32 pid, void *address_arg, uword node_index, uword type_opaque, uword data, int is_add)
Punt traffic to the host.
pg_interface_t * interfaces
#define foreach_registration_hash
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)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".
static ip_adjacency_t * ip_get_adjacency(ip_lookup_main_t *lm, u32 adj_index)
#define VALIDATE_SW_IF_INDEX(mp)
A protocol Independent FIB table.
struct _vnet_feature_registration vnet_feature_registration_t
feature registration object
struct _unix_shared_memory_queue unix_shared_memory_queue_t
clib_error_t * ip6_set_neighbor_limit(u32 neighbor_limit)
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.