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> 53 vl_print (handle, (char *)s); \ 65 #define REPLY_MACRO(t) \ 67 unix_shared_memory_queue_t * q = \ 68 vl_api_client_index_to_input_queue (mp->client_index); \ 72 rmp = vl_msg_api_alloc (sizeof (*rmp)); \ 73 rmp->_vl_msg_id = ntohs((t)+lbm->msg_id_base); \ 74 rmp->context = mp->context; \ 75 rmp->retval = ntohl(rv); \ 77 vl_msg_api_send_shmem (q, (u8 *)&rmp); \ 100 s =
format (0,
"SCRIPT: lb_conf ");
116 ip46_address_t prefix;
117 memcpy(&prefix.ip6, mp->
ip_prefix,
sizeof(prefix.ip6));
142 s =
format (0,
"SCRIPT: lb_add_del_vip ");
176 s =
format (0,
"SCRIPT: lb_add_del_as ");
186 #define foreach_lb_plugin_api_msg \ 187 _(LB_CONF, lb_conf) \ 188 _(LB_ADD_DEL_VIP, lb_add_del_vip) \ 189 _(LB_ADD_DEL_AS, lb_add_del_as) 194 u8 *name =
format (0,
"lb_%08x%c", api_version, 0);
199 vl_msg_api_set_handlers((VL_API_##N + lbm->msg_id_base), \ 201 vl_api_##n##_t_handler, \ 203 vl_api_##n##_t_endian, \ 204 vl_api_##n##_t_print, \ 205 sizeof(vl_api_##n##_t), 1);
static void vl_api_lb_conf_t_handler(vl_api_lb_conf_t *mp)
static clib_error_t * lb_api_init(vlib_main_t *vm)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
u16 msg_id_base
API dynamically registered base ID.
u8 * format_ip46_prefix(u8 *s, va_list *args)
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 foreach_lb_plugin_api_msg
static void * vl_api_lb_conf_t_print(vl_api_lb_conf_t *mp, void *handle)
#define VLIB_INIT_FUNCTION(x)
static void * vl_api_lb_add_del_as_t_print(vl_api_lb_add_del_as_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_add_del_vip_t_print(vl_api_lb_add_del_vip_t *mp, void *handle)
int lb_vip_del(u32 vip_index)
Add an application server for a given VIP.
#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)
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)
static void vl_api_lb_add_del_as_t_handler(vl_api_lb_add_del_as_t *mp)
Configure Load-Balancer global parameters.
u16 vl_msg_api_get_msg_ids(char *name, int n)