25 #define vl_msg_id(n,h) n, 27 #include <lb/lb.api.h> 36 #include <lb/lb.api.h> 41 #include <lb/lb.api.h> 44 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 47 #define vl_api_version(n,v) static u32 api_version=(v); 48 #include <lb/lb.api.h> 51 #define vl_msg_name_crc_list 52 #include <lb/lb.api.h> 53 #undef vl_msg_name_crc_list 56 #define REPLY_MSG_ID_BASE lbm->msg_id_base 63 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + lbm->msg_id_base); 64 foreach_vl_msg_name_crc_lb;
71 vl_print (handle, (char *)s); \ 80 vl_api_lb_conf_reply_t * rmp;
102 s =
format (0,
"SCRIPT: lb_conf ");
116 vl_api_lb_conf_reply_t * rmp;
179 s =
format (0,
"SCRIPT: lb_add_del_vip ");
212 vl_api_lb_conf_reply_t * rmp;
215 ip46_address_t vip_ip_prefix;
218 sizeof(vip_ip_prefix.ip6));
220 ip46_address_t as_address;
223 sizeof(as_address.ip6));
242 s =
format (0,
"SCRIPT: lb_add_del_as ");
257 ip46_address_t vip_prefix;
260 vl_api_lb_flush_vip_reply_t * rmp;
267 memcpy (&(vip_prefix.ip6), mp->
ip_prefix,
sizeof(vip_prefix.ip6));
272 ntohs(mp->
port), &vip_index);
283 s =
format (0,
"SCRIPT: lb_add_del_vip ");
294 #define foreach_lb_plugin_api_msg \ 295 _(LB_CONF, lb_conf) \ 296 _(LB_ADD_DEL_VIP, lb_add_del_vip) \ 297 _(LB_ADD_DEL_AS, lb_add_del_as) \ 298 _(LB_FLUSH_VIP, lb_flush_vip) 308 vl_msg_api_set_handlers((VL_API_##N + lbm->msg_id_base), \ 310 vl_api_##n##_t_handler, \ 312 vl_api_##n##_t_endian, \ 313 vl_api_##n##_t_print, \ 314 sizeof(vl_api_##n##_t), 1);
int lb_vip_del_ass(u32 vip_index, ip46_address_t *addresses, u32 n, u8 flush)
static void vl_api_lb_conf_t_handler(vl_api_lb_conf_t *mp)
static void * vl_api_lb_add_del_vip_t_print(vl_api_lb_add_del_vip_t *mp, void *handle)
u32 per_cpu_sticky_buckets
Number of buckets in the per-cpu sticky hash table.
Optimized string handling code, including c11-compliant "safe C library" variants.
u16 msg_id_base
API dynamically registered base ID.
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.
u8 * format_ip46_prefix(u8 *s, va_list *args)
int lb_vip_add_ass(u32 vip_index, ip46_address_t *addresses, u32 n)
static void * vl_api_lb_conf_t_print(vl_api_lb_conf_t *mp, void *handle)
static void * vl_api_lb_add_del_as_t_print(vl_api_lb_add_del_as_t *mp, void *handle)
#define VLIB_INIT_FUNCTION(x)
u32 flow_timeout
Flow timeout in seconds.
vl_api_ip6_address_t ip6_src_address
int lb_vip_del(u32 vip_index)
#define foreach_lb_plugin_api_msg
int lb_flush_vip_as(u32 vip_index, u32 as_index)
Add an application server for a given VIP.
API main structure, used by both vpp and binary API clients.
#define ip46_prefix_is_ip4(ip46, len)
u32 new_flows_table_length
u32 sticky_buckets_per_core
Add a virtual address (or prefix)
lb_vip_type_t
The load balancer supports IPv4 and IPv6 traffic and GRE4, GRE6, L3DSR and NAT4, NAT6 encap...
int lb_vip_find_index(ip46_address_t *prefix, u8 plen, u8 protocol, u16 port, u32 *vip_index)
lb_vip_encap_args_t encap_args
Configure Load-Balancer global parameters (unlike the CLI, both ip4_src_address and ip6_src_address n...
int lb_vip_add(lb_vip_add_args_t args, u32 *vip_index)
static void * vl_api_lb_flush_vip_t_print(vl_api_lb_flush_vip_t *mp, void *handle)
vl_api_ip4_address_t ip4_src_address
static void vl_api_lb_add_del_vip_t_handler(vl_api_lb_add_del_vip_t *mp)
static void vl_api_lb_flush_vip_t_handler(vl_api_lb_flush_vip_t *mp)
static void vl_api_lb_add_del_as_t_handler(vl_api_lb_add_del_as_t *mp)
static void setup_message_id_table(lb_main_t *lbm, api_main_t *am)
static clib_error_t * lb_api_init(vlib_main_t *vm)
u16 vl_msg_api_get_msg_ids(const char *name, int n)