aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl
AgeCommit message (Expand)AuthorFilesLines
2020-09-29vcl svm: provide apps access to fifo chunksFlorin Coras2-22/+21
2020-09-28vppinfra: don't call dlmalloc API directly from the codeDamjan Marion1-4/+2
2020-09-17vcl: avoid heap use for ldp debugFlorin Coras1-5/+5
2020-09-16vcl: refactor bapi client index for sapi reuseFlorin Coras4-22/+26
2020-09-14vcl: add support for app socket apiFlorin Coras7-12/+456
2020-09-14vcl: cleanup bapi and wrk registrationFlorin Coras6-361/+360
2020-09-14vcl: always fill buffer or drain rx fifoFlorin Coras1-4/+16
2020-09-02vcl: handle svm fifo write failureFlorin Coras1-1/+3
2020-08-26vcl: fix duplicated key of session_index_to_vlsh_table in multiplehanlin2-11/+28
2020-08-25vcl: cleanup non-blocking connectFlorin Coras1-2/+16
2020-08-14vcl: rx dequeue notifications with epollFlorin Coras1-52/+57
2020-08-14vcl: minimize vpp to vcl rx eventsFlorin Coras1-1/+11
2020-08-13vcl: clear ct rx event on right fifoFlorin Coras1-1/+1
2020-08-12vcl: mt detection and cleanupFlorin Coras4-67/+109
2020-08-12vcl: support multi-threads with session migrationhanlin7-25/+261
2020-08-11vcl: support inter worker rpcFlorin Coras3-30/+167
2020-08-09vcl: fix getting wrong non-blocking flags issue in VPPCOM_ATTR_GET_FLAGS actionSimon Zhang1-2/+4
2020-08-04vcl: fix epoll timeoutFlorin Coras1-1/+1
2020-06-15vcl: move helper functions out of header fileFlorin Coras4-101/+105
2020-05-26vcl: fix ldp fcntl64Florin Coras3-40/+24
2020-05-26vcl: do not propagate epoll events if session closedFlorin Coras2-6/+17
2020-05-25vcl: fix udp connected checkFlorin Coras1-1/+1
2020-05-24vcl: add sendmsg/recvmsg for vlsh in ldpFlorin Coras1-65/+130
2020-05-21vcl: support connected udp listensFlorin Coras2-0/+8
2020-05-20vcl: nest vcl_mq_epfd to support epoll_wait without high CPU usagehanlin3-2/+125
2020-05-15vcl: remove udpc transportFlorin Coras2-9/+1
2020-05-14vcl svm: fix rx event losshanlin1-2/+5
2020-05-12vcl: de-init vcl on destroyFlorin Coras1-0/+1
2020-05-04vcl: allow vcl worker index to be set by applicationsPivo2-0/+11
2020-04-30vcl: disconnect both flavors of bapi transport on destroyFlorin Coras1-5/+8
2020-04-29vcl: add separate fcntl64 ldp handlerFlorin Coras1-5/+12
2020-04-25session vcl: propagate transport cleanup notificationsFlorin Coras1-0/+11
2020-04-25vcl: generate select events on read/write errorsFlorin Coras2-8/+9
2020-04-22vcl: fix use-after-freeBenoƮt Ganne1-1/+2
2020-04-20vcl: ensure sessions are open on select eventsFlorin Coras1-7/+5
2020-04-20vcl: expand vcl select maps in ldp if neededFlorin Coras1-4/+5
2020-04-17vcl: fix app destroyFlorin Coras3-21/+21
2020-04-07udp session: jumbo frames and configurable mtuFlorin Coras1-1/+0
2020-04-06vcl session: enforce full dgram reads/writesFlorin Coras2-24/+53
2020-04-06session udp: shared local endpointsFlorin Coras1-1/+3
2020-04-04misc: strcpy be goneDave Barach1-1/+1
2020-04-04vcl: fix vcl_test.py sonarcloud issueDave Wallace1-14/+9
2020-04-03session: improve error reportingFlorin Coras3-6/+4
2020-04-03session udp: fix transport flags and migrationFlorin Coras1-1/+1
2020-04-03session: remove obsolete apisFlorin Coras1-1/+1
2020-04-02udp session vcl: add udp iperf testFlorin Coras1-0/+36
2020-04-01session udp: support connect on listenersFlorin Coras3-5/+54
2020-04-01vcl: support sendto for dgramsFlorin Coras2-35/+45
2020-03-27vcl: support for uword segmentsFlorin Coras2-11/+11
2020-03-25session: api to add new transport typesFlorin Coras2-8/+0
) { unformat_input_t _line_input, *line_input = &_line_input; vnet_main_t *vnm = vnet_get_main (); nat66_main_t *nm = &nat66_main; clib_error_t *error = 0; u32 sw_if_index; u32 *inside_sw_if_indices = 0; u32 *outside_sw_if_indices = 0; u8 is_add = 1; int i, rv; if (!nm->enabled) return clib_error_return (0, "nat66 disabled"); /* Get a line of input. */ if (!unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "in %U", unformat_vnet_sw_interface, vnm, &sw_if_index)) vec_add1 (inside_sw_if_indices, sw_if_index); else if (unformat (line_input, "out %U", unformat_vnet_sw_interface, vnm, &sw_if_index)) vec_add1 (outside_sw_if_indices, sw_if_index); else if (unformat (line_input, "del")) is_add = 0; else { error = clib_error_return (0, "unknown input '%U'", format_unformat_error, line_input); goto done; } } if (vec_len (inside_sw_if_indices)) { for (i = 0; i < vec_len (inside_sw_if_indices); i++) { sw_if_index = inside_sw_if_indices[i]; rv = nat66_interface_add_del (sw_if_index, 1, is_add); switch (rv) { case VNET_API_ERROR_NO_SUCH_ENTRY: error = clib_error_return (0, "%U NAT66 feature not enabled.", format_vnet_sw_interface_name, vnm, vnet_get_sw_interface (vnm, sw_if_index)); goto done; case VNET_API_ERROR_VALUE_EXIST: error = clib_error_return (0, "%U NAT66 feature already enabled.", format_vnet_sw_interface_name, vnm, vnet_get_sw_interface (vnm, sw_if_index)); goto done; case VNET_API_ERROR_INVALID_VALUE: case VNET_API_ERROR_INVALID_VALUE_2: error = clib_error_return (0, "%U NAT66 feature enable/disable failed.", format_vnet_sw_interface_name, vnm, vnet_get_sw_interface (vnm, sw_if_index)); goto done; default: break; } } } if (vec_len (outside_sw_if_indices)) { for (i = 0; i < vec_len (outside_sw_if_indices); i++) { sw_if_index = outside_sw_if_indices[i]; rv = nat66_interface_add_del (sw_if_index, 0, is_add); switch (rv) { case VNET_API_ERROR_NO_SUCH_ENTRY: error = clib_error_return (0, "%U NAT66 feature not enabled.", format_vnet_sw_interface_name, vnm, vnet_get_sw_interface (vnm, sw_if_index)); goto done; case VNET_API_ERROR_VALUE_EXIST: error = clib_error_return (0, "%U NAT66 feature already enabled.", format_vnet_sw_interface_name, vnm, vnet_get_sw_interface (vnm, sw_if_index)); goto done; case VNET_API_ERROR_INVALID_VALUE: case VNET_API_ERROR_INVALID_VALUE_2: error = clib_error_return (0, "%U NAT66 feature enable/disable failed.", format_vnet_sw_interface_name, vnm, vnet_get_sw_interface (vnm, sw_if_index)); goto done; default: break; } } } done: unformat_free (line_input); vec_free (inside_sw_if_indices); vec_free (outside_sw_if_indices); return error; } static int nat66_cli_interface_walk (nat66_interface_t * i, void *ctx) { vlib_main_t *vm = ctx; vnet_main_t *vnm = vnet_get_main (); vlib_cli_output (vm, " %U %s", format_vnet_sw_interface_name, vnm, vnet_get_sw_interface (vnm, i->sw_if_index), nat66_interface_is_inside (i) ? "in" : "out"); return 0; } static clib_error_t * nat66_show_interfaces_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { nat66_main_t *nm = &nat66_main; if (!nm->enabled) return clib_error_return (0, "nat66 disabled"); vlib_cli_output (vm, "NAT66 interfaces:"); nat66_interfaces_walk (nat66_cli_interface_walk, vm); return 0; } static clib_error_t * nat66_add_del_static_mapping_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { nat66_main_t *nm = &nat66_main; unformat_input_t _line_input, *line_input = &_line_input; clib_error_t *error = 0; u8 is_add = 1; ip6_address_t l_addr, e_addr; u32 vrf_id = 0; int rv; if (!nm->enabled) return clib_error_return (0, "nat66 disabled"); /* Get a line of input. */ if (!unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "local %U external %U", unformat_ip6_address, &l_addr, unformat_ip6_address, &e_addr)) ; else if (unformat (line_input, "vrf %u", &vrf_id)) ; else if (unformat (line_input, "del")) is_add = 0; else { error = clib_error_return (0, "unknown input: '%U'", format_unformat_error, line_input); goto done; } } rv = nat66_static_mapping_add_del (&l_addr, &e_addr, vrf_id, is_add); switch (rv) { case VNET_API_ERROR_NO_SUCH_ENTRY: error = clib_error_return (0, "NAT66 static mapping entry not exist."); goto done; case VNET_API_ERROR_VALUE_EXIST: error = clib_error_return (0, "NAT66 static mapping entry exist."); goto done; default: break; } done: unformat_free (line_input); return error; } static int nat66_cli_static_mapping_walk (nat66_static_mapping_t * sm, void *ctx) { nat66_main_t *nm = &nat66_main; vlib_main_t *vm = ctx; fib_table_t *fib; vlib_counter_t vc; fib = fib_table_get (sm->fib_index, FIB_PROTOCOL_IP6); if (!fib) return -1; vlib_get_combined_counter (&nm->session_counters, sm - nm->sm, &vc); vlib_cli_output (vm, " local %U external %U vrf %d", format_ip6_address, &sm->l_addr, format_ip6_address, &sm->e_addr, fib->ft_table_id); vlib_cli_output (vm, " total pkts %lld, total bytes %lld", vc.packets, vc.bytes); return 0; } static clib_error_t * nat66_show_static_mappings_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { nat66_main_t *nm = &nat66_main; if (!nm->enabled) return clib_error_return (0, "nat66 disabled"); vlib_cli_output (vm, "NAT66 static mappings:"); nat66_static_mappings_walk (nat66_cli_static_mapping_walk, vm); return 0; } /*? * @cliexpar * @cliexstart{nat66 enable} * Enable NAT66 plugin * To enable NAT66 plugin * vpp# nat66 enable * To enable NAT66 plugin with outside-vrf id 10 * vpp# nat66 enable outside-vrf 10 * @cliexend ?*/ VLIB_CLI_COMMAND (nat66_enable_command, static) = { .path = "nat66 enable", .short_help = "nat66 enable [outside-vrf <vrf-id>]", .function = nat66_enable_command_fn, }; /*? * @cliexpar * @cliexstart{nat66 disable} * Disable NAT66 plugin * To disable NAT66 plugin * vpp# nat66 disable * @cliexend ?*/ VLIB_CLI_COMMAND (nat66_disable_command, static) = { .path = "nat66 disable", .short_help = "nat66 disable", .function = nat66_disable_command_fn, }; /*? * @cliexpar * @cliexstart{set interface nat66} * Enable/disable NAT66 feature on the interface. * To enable NAT66 feature with local (IPv6) network interface * GigabitEthernet0/8/0 and external (IPv4) network interface * GigabitEthernet0/a/0 use: * vpp# set interface nat66 in GigabitEthernet0/8/0 out GigabitEthernet0/a/0 * @cliexend ?*/ VLIB_CLI_COMMAND (set_interface_nat66_command, static) = { .path = "set interface nat66", .short_help = "set interface nat66 in|out <intfc> [del]", .function = nat66_interface_feature_command_fn, }; /*? * @cliexpar * @cliexstart{show nat66 interfaces} * Show interfaces with NAT66 feature. * To show interfaces with NAT66 feature use: * vpp# show nat66 interfaces * NAT66 interfaces: * GigabitEthernet0/8/0 in * GigabitEthernet0/a/0 out * @cliexend ?*/ VLIB_CLI_COMMAND (show_nat66_interfaces_command, static) = { .path = "show nat66 interfaces", .short_help = "show nat66 interfaces", .function = nat66_show_interfaces_command_fn, }; /*? * @cliexpar * @cliexstart{nat66 add static mapping} * Add/delete NAT66 static mapping entry. * To add NAT66 static mapping entry use: * vpp# nat66 add static mapping local fd01:1::4 external 2001:db8:c000:223:: * vpp# nat66 add static mapping local fd01:1::2 external 2001:db8:c000:221:: vrf 10 * @cliexend ?*/ VLIB_CLI_COMMAND (show_nat66_add_del_static_mapping_command, static) = { .path = "nat66 add static mapping", .short_help = "nat66 add static mapping local <ip6-addr> external <ip6-addr>" " [vfr <table-id>] [del]", .function = nat66_add_del_static_mapping_command_fn, }; /*? * @cliexpar * @cliexstart{show nat66 static mappings} * Show NAT66 static mappings. * To show NAT66 static mappings use: * vpp# show nat66 static mappings * NAT66 static mappings: * local fd01:1::4 external 2001:db8:c000:223:: vrf 0 * local fd01:1::2 external 2001:db8:c000:221:: vrf 10 * @cliexend ?*/ VLIB_CLI_COMMAND (show_nat66_static_mappings_command, static) = { .path = "show nat66 static mappings", .short_help = "show nat66 static mappings", .function = nat66_show_static_mappings_command_fn, }; /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */