24 #define vl_msg_id(n,h) n, 26 #include <lb/lb.api.h> 35 #include <lb/lb.api.h> 40 #include <lb/lb.api.h> 43 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 46 #define vl_api_version(n,v) static u32 api_version=(v); 47 #include <lb/lb.api.h> 50 #define vl_msg_name_crc_list 51 #include <lb/lb.api.h> 52 #undef vl_msg_name_crc_list 55 #define REPLY_MSG_ID_BASE lbm->msg_id_base 62 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + lbm->msg_id_base); 63 foreach_vl_msg_name_crc_lb;
70 vl_print (handle, (char *)s); \ 79 vl_api_lb_conf_reply_t * rmp;
94 s =
format (0,
"SCRIPT: lb_conf ");
108 vl_api_lb_conf_reply_t * rmp;
112 if((mp->
protocol != IP_PROTOCOL_TCP)
113 && (mp->
protocol != IP_PROTOCOL_UDP))
170 s =
format (0,
"SCRIPT: lb_add_del_vip ");
203 vl_api_lb_conf_reply_t * rmp;
206 ip46_address_t vip_ip_prefix;
209 sizeof(vip_ip_prefix.ip6));
211 ip46_address_t as_address;
214 sizeof(as_address.ip6));
233 s =
format (0,
"SCRIPT: lb_add_del_as ");
248 ip46_address_t vip_prefix;
251 vl_api_lb_flush_vip_reply_t * rmp;
258 memcpy (&(vip_prefix.ip6), mp->
ip_prefix,
sizeof(vip_prefix.ip6));
274 s =
format (0,
"SCRIPT: lb_add_del_vip ");
285 #define foreach_lb_plugin_api_msg \ 286 _(LB_CONF, lb_conf) \ 287 _(LB_ADD_DEL_VIP, lb_add_del_vip) \ 288 _(LB_ADD_DEL_AS, lb_add_del_as) \ 289 _(LB_FLUSH_VIP, lb_flush_vip) 299 vl_msg_api_set_handlers((VL_API_##N + lbm->msg_id_base), \ 301 vl_api_##n##_t_handler, \ 303 vl_api_##n##_t_endian, \ 304 vl_api_##n##_t_print, \ 305 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)
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)
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.
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)
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)