|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
50 else if (
unformat(line_input,
"del"))
52 else if (
unformat(line_input,
"protocol tcp"))
56 else if (
unformat(line_input,
"protocol udp"))
62 else if (
unformat(line_input,
"encap gre4"))
64 else if (
unformat(line_input,
"encap gre6"))
66 else if (
unformat(line_input,
"encap l3dsr"))
68 else if (
unformat(line_input,
"encap nat4"))
70 else if (
unformat(line_input,
"encap nat6"))
74 else if (
unformat(line_input,
"type clusterip"))
76 else if (
unformat(line_input,
"type nodeport"))
78 else if (
unformat(line_input,
"target_port %d", &target_port))
101 "should not configure dscp for none L3DSR.");
108 "dscp for L3DSR should be less than 64.");
183 .short_help =
"lb vip <prefix> "
184 "[protocol (tcp|udp) port <n>] "
185 "[encap (gre6|gre4|l3dsr|nat4|nat6)] "
187 "[type (nodeport|clusterip) target_port <n>] "
188 "[new_len <n>] [del]",
197 ip46_address_t vip_prefix, as_addr;
199 ip46_address_t *as_array = 0;
226 else if (
unformat(line_input,
"del"))
230 else if (
unformat(line_input,
"flush"))
234 else if (
unformat(line_input,
"protocol tcp"))
238 else if (
unformat(line_input,
"protocol udp"))
295 .short_help =
"lb as <vip-prefix> [protocol (tcp|udp) port <n>]"
296 " [<address> [<address> [...]]] [del] [flush]",
309 u32 per_cpu_sticky_buckets_log2 = 0;
323 else if (
unformat(line_input,
"buckets %d", &per_cpu_sticky_buckets))
325 else if (
unformat(line_input,
"buckets-log2 %d", &per_cpu_sticky_buckets_log2)) {
326 if (per_cpu_sticky_buckets_log2 >= 32)
328 per_cpu_sticky_buckets = 1 << per_cpu_sticky_buckets_log2;
329 }
else if (
unformat(line_input,
"timeout %d", &flow_timeout))
340 if ((ret =
lb_conf(&
ip4, &
ip6, per_cpu_sticky_buckets, flow_timeout))) {
354 .short_help =
"lb conf [ip4-src-address <addr>] [ip6-src-address <addr>] [buckets <n>] [timeout <s>]",
370 .short_help =
"show lb",
386 if (
unformat(&line_input,
"verbose"))
391 if (vip != lbm->
vips) {
402 .path =
"show lb vips",
403 .short_help =
"show lb vips [verbose]",
417 u32 * inside_sw_if_indices = 0;
429 else if (
unformat (line_input,
"del"))
446 0,
"%s %U failed", is_del ?
"del" :
"add",
457 0,
"%s %U failed", is_del ?
"del" :
"add",
481 .path =
"lb set interface nat4",
483 .short_help =
"lb set interface nat4 in <intfc> [del]",
495 .path =
"lb set interface nat6",
497 .short_help =
"lb set interface nat6 in <intfc> [del]",
516 ip46_address_t vip_prefix;
535 if (
unformat(line_input,
"protocol tcp"))
539 else if (
unformat(line_input,
"protocol udp"))
578 .path =
"lb flush vip",
579 .short_help =
"lb flush vip <prefix> "
580 "[protocol (tcp|udp) port <n>]",
590 .path =
"test lb flowtable flush",
591 .short_help =
"test lb flowtable flush",
uword unformat_ip46_prefix(unformat_input_t *input, va_list *args)
u32 per_cpu_sticky_buckets
Number of buckets in the per-cpu sticky hash table.
static clib_error_t * lb_set_interface_nat4_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
lb_vip_t * vips
Pool of all Virtual IPs.
#define clib_error_return(e, args...)
int lb_nat6_interface_add_del(u32 sw_if_index, int is_del)
int lb_vip_del_ass(u32 vip_index, ip46_address_t *addresses, u32 n, u8 flush)
ip4_address_t ip4_src_address
Source address used for IPv4 encapsulated traffic.
static vlib_cli_command_t lb_show_command
(constructor) VLIB_CLI_COMMAND (lb_show_command)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
int lb_nat4_interface_add_del(u32 sw_if_index, int is_del)
int lb_vip_del(u32 vip_index)
int lb_vip_add_ass(u32 vip_index, ip46_address_t *addresses, u32 n)
static vlib_cli_command_t lb_flowtable_flush_command
(constructor) VLIB_CLI_COMMAND (lb_flowtable_flush_command)
#define pool_foreach(VAR, POOL)
Iterate through pool.
static clib_error_t * lb_show_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
vnet_main_t * vnet_get_main(void)
#define VLIB_CLI_COMMAND(x,...)
ip6_address_t ip6_src_address
Source address used in IPv6 encapsulated traffic.
static clib_error_t * lb_show_vips_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static vlib_cli_command_t lb_show_vips_command
(constructor) VLIB_CLI_COMMAND (lb_show_vips_command)
Load balancing service is provided per VIP+protocol+port.
static vlib_cli_command_t lb_conf_command
(constructor) VLIB_CLI_COMMAND (lb_conf_command)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static vlib_cli_command_t lb_vip_command
(constructor) VLIB_CLI_COMMAND (lb_vip_command)
lb_vip_encap_args_t encap_args
int lb_vip_add(lb_vip_add_args_t args, u32 *vip_index)
static vlib_cli_command_t lb_set_interface_nat6_command
(constructor) VLIB_CLI_COMMAND (lb_set_interface_nat6_command)
static vlib_cli_command_t lb_flush_vip_command
(constructor) VLIB_CLI_COMMAND (lb_flush_vip_command)
#define vec_free(V)
Free vector's memory (no header).
static clib_error_t * lb_as_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
format_function_t format_lb_vip
unformat_function_t unformat_vnet_sw_interface
static clib_error_t * lb_flowtable_flush_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lb_set_interface_nat_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd, u8 is_nat6)
vl_api_ip_proto_t protocol
static clib_error_t * lb_vip_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_foreach(var, vec)
Vector iterator.
int lb_vip_find_index(ip46_address_t *prefix, u8 plen, u8 protocol, u16 port, u32 *vip_index)
format_function_t format_lb_main
static vlib_cli_command_t lb_as_command
(constructor) VLIB_CLI_COMMAND (lb_as_command)
static clib_error_t * lb_set_interface_nat6_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int lb_flush_vip_as(u32 vip_index, u32 as_index)
#define clib_warning(format, args...)
u32 flow_timeout
Flow timeout in seconds.
static clib_error_t * lb_flush_vip_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vl_api_interface_index_t sw_if_index
format_function_t format_lb_vip_detailed
#define ip46_prefix_is_ip4(ip46, len)
int lb_conf(ip4_address_t *ip4_address, ip6_address_t *ip6_address, u32 per_cpu_sticky_buckets, u32 flow_timeout)
Fix global load-balancer parameters.
static clib_error_t * lb_conf_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void lb_garbage_collection()
static vlib_cli_command_t lb_set_interface_nat4_command
(constructor) VLIB_CLI_COMMAND (lb_set_interface_nat4_command)
format_function_t format_vnet_sw_interface_name