summaryrefslogtreecommitdiffstats
path: root/src/vpp-api
AgeCommit message (Expand)AuthorFilesLines
2021-09-28api: API trace improvementsFilip Tehlar1-8/+0
2021-09-28misc: vpe.api messages dynamically allocatedOle Troan2-15/+7
2021-09-28build: complete python3 support, no hardcode pathNick Brown1-2/+3
2021-09-27tests: don't install vapi_c{,pp}_testDmitry Valter1-0/+2
2021-09-27misc: api move continuedFlorin Coras3-4/+8
2021-09-17build: use GNUInstallDirs install destinationsNick Brown1-1/+1
2021-08-31stats: check epoch in python vpp_stats lsOle Troan1-0/+3
2021-07-12papi: remove shared memory transportOle Troan3-154/+6
2021-06-25stats: reverts part of a fix on Python clientArthur de Kerhor1-12/+4
2021-06-25stats: fix race conditions in vpp-api stats clientArthur de Kerhor1-4/+12
2021-05-27build: kindly ask python not to polute src/Damjan Marion1-2/+2
2021-05-26tests: move vapi C/C++ test files into src/Damjan Marion4-0/+1538
2021-05-21stats: catch stat segment overrun in retry loopOle Troan1-3/+3
2021-05-13tests: move test source to vpp/testDave Wallace3-173/+0
2021-05-04stats: adding symlinks for nodes and interfaces in the stat segmentArthur de Kerhor2-47/+136
2021-04-28papi: change default to use socket transport instead of shared memory transportOle Troan1-2/+2
2021-04-15papi: fix ubuntu 1804 make test socket.close errorTianyu Li1-1/+1
2021-04-12tests: support attaching to existing vppKlement Sekera1-4/+4
2021-03-30stats: python: handle when pattern is not list in lsOle Troan1-0/+9
2021-03-26vlib: split vlib_main_t into global and per-threadDamjan Marion2-7/+0
2021-03-25stats: python vpp_stats rewrite to access stat segment directlyOle Troan1-296/+482
2021-03-16api: allow specifying no timeoutKlement Sekera1-1/+1
2021-03-15tests: use socket transport instead of shared memoryOle Troan2-7/+2
2021-03-05vppapigen: expose the values of per-message "options" in the api.json filesAndrew Yourtchenko1-1/+1
2021-02-16vapi: add dedicated return code for client timeoutPaul Vinciguerra2-4/+16
2021-02-15papi: add method to retrieve field optionsPaul Vinciguerra1-0/+9
2021-02-09papi: expose vpp_papi version to clientPaul Vinciguerra1-0/+6
2021-02-05papi: remove unused name from __all__Paul Vinciguerra1-1/+1
2020-12-18papi: remove import vpp_transport_socketPaul Vinciguerra1-2/+2
2020-12-08tests: restore vapi C++ test under Centos-8Paul Vinciguerra1-2/+1
2020-12-08papi: remove old client referencePaul Vinciguerra2-4/+1
2020-12-04papi: add support for enumflag part 1 of 2Paul Vinciguerra5-19/+160
2020-12-03papi: remove python2 patternsPaul Vinciguerra6-40/+18
2020-12-03papi: allow client control over loggersPaul Vinciguerra6-8/+56
2020-12-03stats: char-pointer arithmetic style-upVratko Polak1-6/+4
2020-12-02papi: improve unit testabilityPaul Vinciguerra3-23/+133
2020-12-02stats: void-pointer arithmetic fixElias Rudberg1-2/+3
2020-12-02papi: fix copy/paste errorPaul Vinciguerra1-2/+2
2020-11-25api: vat2 and json autogeneration for api messagesOle Troan2-4/+4
2020-11-17papi: remove dependency on aenumPaul Vinciguerra2-18/+2
2020-11-17tests: move vpp-api tests to src/vpe-api/testDave Wallace3-0/+174
2020-10-21stats: missing dimension in stat_set_simple_counterOle Troan2-8/+24
2020-10-07api: add heap alloc to vpp statsOle Troan3-1/+9
2020-09-28vppinfra: don't call dlmalloc API directly from the codeDamjan Marion1-1/+1
2020-09-28api: remove clib_mem_init from vppapiclient contructorOle Troan3-25/+23
2020-09-09stats: Fix stat_segment to set timeout directlyRajesh Goel1-0/+13
2020-08-17stats: Move misplaced comment blockVratko Polak1-3/+3
2020-08-13stats: remove offsets on vpp sideOle Troan3-51/+37
2020-08-11papi: allow unknown address familyOle Troan2-10/+71
2020-08-11stats: add timeout for in_progress access to stat segmentOle Troan2-8/+50
pan class="p">, .next_nodes = { [IP_PUNT_POLICER_NEXT_DROP] = "ip4-drop", }, }; VNET_FEATURE_INIT (ip4_punt_policer_node) = { .arc_name = "ip4-punt", .node_name = "ip4-punt-policer", .runs_before = VNET_FEATURES("ip4-punt-redirect"), }; /* *INDENT-ON* */ #define foreach_ip4_punt_redirect_error \ _(DROP, "ip4 punt redirect drop") typedef enum { #define _(sym,str) IP4_PUNT_REDIRECT_ERROR_##sym, foreach_ip4_punt_redirect_error #undef _ IP4_PUNT_REDIRECT_N_ERROR, } ip4_punt_redirect_error_t; static char *ip4_punt_redirect_error_strings[] = { #define _(sym,string) string, foreach_ip4_punt_redirect_error #undef _ }; VLIB_NODE_FN (ip4_punt_redirect_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return (ip_punt_redirect (vm, node, frame, vnet_feat_arc_ip4_punt.feature_arc_index, FIB_PROTOCOL_IP4)); } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (ip4_punt_redirect_node) = { .name = "ip4-punt-redirect", .vector_size = sizeof (u32), .n_next_nodes = IP_PUNT_REDIRECT_N_NEXT, .format_trace = format_ip_punt_redirect_trace, .n_errors = ARRAY_LEN(ip4_punt_redirect_error_strings), .error_strings = ip4_punt_redirect_error_strings, /* edit / add dispositions here */ .next_nodes = { [IP_PUNT_REDIRECT_NEXT_DROP] = "ip4-drop", [IP_PUNT_REDIRECT_NEXT_TX] = "ip4-rewrite", [IP_PUNT_REDIRECT_NEXT_ARP] = "ip4-arp", }, }; VNET_FEATURE_INIT (ip4_punt_redirect_node, static) = { .arc_name = "ip4-punt", .node_name = "ip4-punt-redirect", .runs_before = VNET_FEATURES("error-punt"), }; /* *INDENT-ON* */ VLIB_NODE_FN (ip4_drop_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { if (node->flags & VLIB_NODE_FLAG_TRACE) ip4_forward_next_trace (vm, node, frame, VLIB_TX); return ip_drop_or_punt (vm, node, frame, vnet_feat_arc_ip4_drop.feature_arc_index); } VLIB_NODE_FN (ip4_not_enabled_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { if (node->flags & VLIB_NODE_FLAG_TRACE) ip4_forward_next_trace (vm, node, frame, VLIB_TX); return ip_drop_or_punt (vm, node, frame, vnet_feat_arc_ip4_drop.feature_arc_index); } static uword ip4_punt (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { if (node->flags & VLIB_NODE_FLAG_TRACE) ip4_forward_next_trace (vm, node, frame, VLIB_TX); return ip_drop_or_punt (vm, node, frame, vnet_feat_arc_ip4_punt.feature_arc_index); } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (ip4_drop_node) = { .name = "ip4-drop", .vector_size = sizeof (u32), .format_trace = format_ip4_forward_next_trace, .n_next_nodes = 1, .next_nodes = { [0] = "error-drop", }, }; VLIB_REGISTER_NODE (ip4_not_enabled_node) = { .name = "ip4-not-enabled", .vector_size = sizeof (u32), .format_trace = format_ip4_forward_next_trace, .sibling_of = "ip4-drop", }; VLIB_REGISTER_NODE (ip4_punt_node) = { .function = ip4_punt, .name = "ip4-punt", .vector_size = sizeof (u32), .format_trace = format_ip4_forward_next_trace, .n_next_nodes = 1, .next_nodes = { [0] = "error-punt", }, }; VNET_FEATURE_INIT (ip4_punt_end_of_arc, static) = { .arc_name = "ip4-punt", .node_name = "error-punt", .runs_before = 0, /* not before any other features */ }; VNET_FEATURE_INIT (ip4_drop_end_of_arc, static) = { .arc_name = "ip4-drop", .node_name = "error-drop", .runs_before = 0, /* not before any other features */ }; /* *INDENT-ON */ #ifndef CLIB_MARCH_VARIANT void ip4_punt_policer_add_del (u8 is_add, u32 policer_index) { ip4_punt_policer_cfg.policer_index = policer_index; vnet_feature_enable_disable ("ip4-punt", "ip4-punt-policer", 0, is_add, 0, 0); } #endif /* CLIB_MARCH_VARIANT */ static clib_error_t * ip4_punt_police_cmd (vlib_main_t * vm, unformat_input_t * main_input, vlib_cli_command_t * cmd) { unformat_input_t _line_input, *line_input = &_line_input; clib_error_t *error = 0; u32 policer_index; u8 is_add = 1; policer_index = ~0; if (!unformat_user (main_input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "%d", &policer_index)) ; else if (unformat (line_input, "del")) is_add = 0; else if (unformat (line_input, "add")) is_add = 1; else { error = unformat_parse_error (line_input); goto done; } } if (is_add && ~0 == policer_index) { error = clib_error_return (0, "expected policer index `%U'", format_unformat_error, line_input); goto done; } if (!is_add) policer_index = ~0; ip4_punt_policer_add_del(is_add, policer_index); done: unformat_free (line_input); return (error); } /*? * * @cliexpar * @cliexcmd{set ip punt policer <INDEX>} ?*/ /* *INDENT-OFF* */ VLIB_CLI_COMMAND (ip4_punt_policer_command, static) = { .path = "ip punt policer", .function = ip4_punt_police_cmd, .short_help = "ip punt policer [add|del] <index>", }; /* *INDENT-ON* */ #ifndef CLIB_MARCH_VARIANT void ip4_punt_redirect_add (u32 rx_sw_if_index, u32 tx_sw_if_index, ip46_address_t * nh) { /* *INDENT-OFF* */ fib_route_path_t *rpaths = NULL, rpath = { .frp_proto = DPO_PROTO_IP4, .frp_addr = *nh, .frp_sw_if_index = tx_sw_if_index, .frp_weight = 1, .frp_fib_index = ~0, }; /* *INDENT-ON* */ vec_add1 (rpaths, rpath); ip4_punt_redirect_add_paths (rx_sw_if_index, rpaths); vec_free (rpaths); } void ip4_punt_redirect_add_paths (u32 rx_sw_if_index, fib_route_path_t * rpaths) { ip_punt_redirect_add (FIB_PROTOCOL_IP4, rx_sw_if_index, FIB_FORW_CHAIN_TYPE_UNICAST_IP4, rpaths); vnet_feature_enable_disable ("ip4-punt", "ip4-punt-redirect", 0, 1, 0, 0); } void ip4_punt_redirect_del (u32 rx_sw_if_index) { vnet_feature_enable_disable ("ip4-punt", "ip4-punt-redirect", 0, 0, 0, 0); ip_punt_redirect_del (FIB_PROTOCOL_IP4, rx_sw_if_index); } #endif /* CLIB_MARCH_VARIANT */ static clib_error_t * ip4_punt_redirect_cmd (vlib_main_t * vm, unformat_input_t * main_input, vlib_cli_command_t * cmd) { unformat_input_t _line_input, *line_input = &_line_input; ip46_address_t nh = { 0 }; clib_error_t *error = 0; u32 rx_sw_if_index = ~0; u32 tx_sw_if_index = ~0; vnet_main_t *vnm; u8 is_add; is_add = 1; vnm = vnet_get_main (); if (!unformat_user (main_input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "del")) is_add = 0; else if (unformat (line_input, "add")) is_add = 1; else if (unformat (line_input, "rx all")) rx_sw_if_index = ~0; else if (unformat (line_input, "rx %U", unformat_vnet_sw_interface, vnm, &rx_sw_if_index)) ; else if (unformat (line_input, "via %U %U", unformat_ip4_address, &nh.ip4, unformat_vnet_sw_interface, vnm, &tx_sw_if_index)) ; else if (unformat (line_input, "via %U", unformat_vnet_sw_interface, vnm, &tx_sw_if_index)) ; else { error = unformat_parse_error (line_input); goto done; } } if (~0 == rx_sw_if_index) { error = unformat_parse_error (line_input); goto done; } if (is_add) { ip4_punt_redirect_add (rx_sw_if_index, tx_sw_if_index, &nh); } else { ip4_punt_redirect_del (rx_sw_if_index); } done: unformat_free (line_input); return (error); } /*? * * @cliexpar * @cliexcmd{set ip punt policer} ?*/ /* *INDENT-OFF* */ VLIB_CLI_COMMAND (ip4_punt_redirect_command, static) = { .path = "ip punt redirect", .function = ip4_punt_redirect_cmd, .short_help = "ip punt redirect [add|del] rx [<interface>|all] via [<nh>] <tx_interface>", }; /* *INDENT-ON* */ static clib_error_t * ip4_punt_redirect_show_cmd (vlib_main_t * vm, unformat_input_t * main_input, vlib_cli_command_t * cmd) { vlib_cli_output (vm, "%U", format_ip_punt_redirect, FIB_PROTOCOL_IP4); return (NULL); } /*? * * @cliexpar * @cliexcmd{set ip punt redierect} ?*/ /* *INDENT-OFF* */ VLIB_CLI_COMMAND (show_ip4_punt_redirect_command, static) = { .path = "show ip punt redirect", .function = ip4_punt_redirect_show_cmd, .short_help = "show ip punt redirect", .is_mp_safe = 1, }; /* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */