24 ip46_address_t vip_prefix, as_addr;
56 .short_help =
"lb bypass <prefix> <address> [disable]",
65 ip46_address_t prefix;
82 if (
unformat(line_input,
"new_len %d", &new_len))
84 else if (
unformat(line_input,
"del"))
86 else if (
unformat(line_input,
"encap gre4"))
88 else if (
unformat(line_input,
"encap gre6"))
108 if ((ret =
lb_vip_add(&prefix, plen, type, new_len, &index))) {
125 .short_help =
"lb vip <prefix> [encap (gre6|gre4)] [new_len <n>] [del]",
134 ip46_address_t vip_prefix, as_addr;
136 ip46_address_t *as_array = 0;
155 }
else if (
unformat(line_input,
"del")) {
191 .short_help =
"lb as <vip-prefix> [<address> [<address> [...]]] [del]",
204 u32 per_cpu_sticky_buckets_log2 = 0;
217 else if (
unformat(line_input,
"buckets %d", &per_cpu_sticky_buckets))
219 else if (
unformat(line_input,
"buckets-log2 %d", &per_cpu_sticky_buckets_log2)) {
220 if (per_cpu_sticky_buckets_log2 >= 32)
222 per_cpu_sticky_buckets = 1 << per_cpu_sticky_buckets_log2;
223 }
else if (
unformat(line_input,
"timeout %d", &flow_timeout))
234 if ((ret =
lb_conf(&ip4, &ip6, per_cpu_sticky_buckets, flow_timeout)))
243 .short_help =
"lb conf [ip4-src-address <addr>] [ip6-src-address <addr>] [buckets <n>] [timeout <s>]",
259 .short_help =
"show lb",
275 if (
unformat(&line_input,
"verbose"))
279 vlib_cli_output(vm,
"%U\n", verbose?format_lb_vip_detailed:format_lb_vip, vip);
288 .path =
"show lb vips",
289 .short_help =
"show lb vips [verbose]",
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
u32 per_cpu_sticky_buckets
Number of buckets in the per-cpu sticky hash table.
static clib_error_t * lb_conf_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
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.
int lb_vip_add_ass(u32 vip_index, ip46_address_t *addresses, u32 n)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
uword unformat_ip46_prefix(unformat_input_t *input, va_list *args)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
u32 flow_timeout
Flow timeout in seconds.
#define clib_warning(format, args...)
static clib_error_t * lb_show_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lb_vip_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
lb_vip_t * vips
Pool of all Virtual IPs.
ip4_address_t ip4_src_address
Source address used for IPv4 encapsulated traffic.
int lb_vip_del(u32 vip_index)
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_main
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define ip46_prefix_is_ip4(ip46, len)
int lb_vip_add(ip46_address_t *prefix, u8 plen, lb_vip_type_t type, u32 new_length, u32 *vip_index)
#define vec_free(V)
Free vector's memory (no header).
static clib_error_t * lb_show_vips_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int lb_as_lookup_bypass(u32 vip_index, ip46_address_t *address, u8 is_disable)
Updates the adjacency index stored in the AS such that the second IP lookup (after encap) can be bypa...
int lb_vip_del_ass(u32 vip_index, ip46_address_t *addresses, u32 n)
static clib_error_t * lb_bypass_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
lb_vip_type_t
The load balancer supports IPv4 and IPv6 traffic and GRE4 and GRE6 encap.
int lb_vip_find_index(ip46_address_t *prefix, u8 plen, u32 *vip_index)
ip6_address_t ip6_src_address
Source address used in IPv6 encapsulated traffic.
VLIB_CLI_COMMAND(set_interface_ip_source_and_port_range_check_command, static)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void lb_garbage_collection()
#define clib_error_return(e, args...)
Load balancing service is provided per VIP.