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;
110 ip46_address_t prefix;
111 memcpy(&prefix.ip6, mp->
ip_prefix,
sizeof(prefix.ip6));
136 s =
format (0,
"SCRIPT: lb_add_del_vip ");
150 vl_api_lb_conf_reply_t * rmp;
170 s =
format (0,
"SCRIPT: lb_add_del_as ");
180 #define foreach_lb_plugin_api_msg \ 181 _(LB_CONF, lb_conf) \ 182 _(LB_ADD_DEL_VIP, lb_add_del_vip) \ 183 _(LB_ADD_DEL_AS, lb_add_del_as) 188 u8 *name =
format (0,
"lb_%08x%c", api_version, 0);
193 vl_msg_api_set_handlers((VL_API_##N + lbm->msg_id_base), \ 195 vl_api_##n##_t_handler, \ 197 vl_api_##n##_t_endian, \ 198 vl_api_##n##_t_print, \ 199 sizeof(vl_api_##n##_t), 1); 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 vl_msg_api_get_msg_ids(const char *name, int n)
u8 * format_ip46_prefix(u8 *s, va_list *args)
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.
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
Add an application server for a given VIP.
API main structure, used by both vpp and binary API clients.
int lb_vip_add(ip46_address_t *prefix, u8 plen, lb_vip_type_t type, u32 new_length, u32 *vip_index)
u32 new_flows_table_length
int lb_vip_del_ass(u32 vip_index, ip46_address_t *addresses, u32 n)
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 and GRE6 encap.
int lb_vip_find_index(ip46_address_t *prefix, u8 plen, u32 *vip_index)
Configure Load-Balancer global parameters.
static void vl_api_lb_add_del_vip_t_handler(vl_api_lb_add_del_vip_t *mp)
static void vl_api_lb_add_del_as_t_handler(vl_api_lb_add_del_as_t *mp)
#define ip46_prefix_is_ip4(ip46, len)
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)