|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
25 #include <vpp/app/version.h>
30 #include <lb/lb.api_enum.h>
31 #include <lb/lb.api_types.h>
33 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
35 #define REPLY_MSG_ID_BASE lbm->msg_id_base
41 vl_print (handle, (char *)s); \
50 vl_api_lb_conf_reply_t * rmp;
51 u32 sticky_buckets_per_core, flow_timeout;
63 sticky_buckets_per_core, flow_timeout);
73 vl_api_lb_conf_reply_t * rmp;
137 vl_api_lb_conf_reply_t * rmp;
140 ip46_address_t vip_ip_prefix;
141 ip46_address_t as_address;
166 (vl_api_lb_vip_dump_t * mp)
182 if (vip != lbm->
vips) {
183 msg_size =
sizeof (*rmp);
185 memset (rmp, 0, msg_size);
193 rmp->
vip.port = htons(vip->
port);
221 if (*as_index != 0) {
222 as = &lbm->
ass[*as_index];
223 msg_size =
sizeof (*rmp);
225 memset (rmp, 0, msg_size);
232 rmp->
vip.port = htons(vip->
port);
247 (vl_api_lb_as_dump_t * mp)
259 clib_memcpy(&
prefix.ip6, mp->pfx.address.un.ip6,
sizeof(mp->pfx.address.un.ip6));
261 dump_all = (
prefix.ip6.as_u64[0] == 0) && (
prefix.ip6.as_u64[1] == 0);
270 && (mp->port == vip->
port)) )
284 ip46_address_t vip_prefix;
287 vl_api_lb_flush_vip_reply_t * rmp;
294 memcpy (&(vip_prefix.ip6), mp->
pfx.address.un.ip6,
sizeof(vip_prefix.ip6));
296 vip_plen = mp->
pfx.len;
310 vl_api_lb_add_del_intf_nat4_reply_t *rmp;
330 vl_api_lb_add_del_intf_nat6_reply_t *rmp;
346 #include <lb/lb.api.c>
u16 msg_id_base
API dynamically registered base ID.
#define VALIDATE_SW_IF_INDEX(mp)
ip46_address_t prefix
A Virtual IP represents a given service delivered by a set of application servers.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
vl_api_ip4_address_t ip4_src_address
Each VIP is configured with a set of application server.
u32 per_cpu_sticky_buckets
Number of buckets in the per-cpu sticky hash table.
vl_api_interface_index_t sw_if_index
Add an application server for a given VIP.
Add a virtual address (or prefix)
#define clib_memcpy(d, s, n)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
lb_vip_t * vips
Pool of all Virtual IPs.
static clib_error_t * lb_api_init(vlib_main_t *vm)
ip46_address_t address
Destination address used to tunnel traffic towards that application server.
static void send_lb_as_details(vl_api_registration_t *reg, u32 context, lb_vip_t *vip)
vl_api_lb_srv_type_t srv_type
static void vl_api_lb_add_del_as_t_handler(vl_api_lb_add_del_as_t *mp)
int lb_nat6_interface_add_del(u32 sw_if_index, int is_del)
int lb_vip_del_ass(u32 vip_index, ip46_address_t *addresses, u32 n, u8 flush)
static void vl_api_lb_vip_dump_t_handler(vl_api_lb_vip_dump_t *mp)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u32 last_used
Rotating timestamp of when LB_AS_FLAGS_USED flag was last set.
u8 plen
The VIP prefix length.
int lb_nat4_interface_add_del(u32 sw_if_index, int is_del)
int lb_vip_del(u32 vip_index)
vl_api_lb_encap_type_t encap
vl_api_address_with_prefix_t pfx
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
Decode/Encode for struct/union types.
int lb_vip_add_ass(u32 vip_index, ip46_address_t *addresses, u32 n)
static void vl_api_lb_add_del_intf_nat4_t_handler(vl_api_lb_add_del_intf_nat4_t *mp)
#define pool_foreach(VAR, POOL)
Iterate through pool.
u32 flow_timeout[default=0xffffffff]
vnet_main_t * vnet_get_main(void)
vl_api_lb_srv_type_t type
vl_api_lb_encap_type_t encap
An API client registration, only in vpp/vlib.
u32 new_flows_table_length[default=1024]
vl_api_ip6_address_t ip6_src_address
static void vl_api_lb_add_del_intf_nat6_t_handler(vl_api_lb_add_del_intf_nat6_t *mp)
Configure Load-Balancer global parameters (unlike the CLI, both ip4_src_address and ip6_src_address n...
lb_vip_type_t type
The type of traffic for this.
lb_vip_encap_args_t encap_args
static void setup_message_id_table(api_main_t *am)
Load balancing service is provided per VIP+protocol+port.
lb_vip_encap_args_t encap_args
#define BAD_SW_IF_INDEX_LABEL
int lb_vip_add(lb_vip_add_args_t args, u32 *vip_index)
static void vl_api_lb_flush_vip_t_handler(vl_api_lb_flush_vip_t *mp)
u32 sticky_buckets_per_core[default=0xffffffff]
#define VLIB_INIT_FUNCTION(x)
vl_api_address_with_prefix_t pfx
Enable/disable NAT6 feature on the interface.
@ LB_API_ENCAP_TYPE_L3DSR
int lb_vip_find_index(ip46_address_t *prefix, u8 plen, u8 protocol, u16 port, u32 *vip_index)
static void vl_api_lb_add_del_vip_t_handler(vl_api_lb_add_del_vip_t *mp)
static void vl_api_lb_conf_t_handler(vl_api_lb_conf_t *mp)
lb_vip_type_t
The load balancer supports IPv4 and IPv6 traffic and GRE4, GRE6, L3DSR and NAT4, NAT6 encap.
Reply all configured vip.
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
int lb_flush_vip_as(u32 vip_index, u32 as_index)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
lb_as_t * ass
Pool of ASs.
u8 flags
Some per-AS flags.
static void vl_api_lb_as_dump_t_handler(vl_api_lb_as_dump_t *mp)
u32 flow_timeout
Flow timeout in seconds.
u32 new_flow_table_mask
New flows table length - 1 (length MUST be a power of 2)
vl_api_address_with_prefix_t pfx
u32 * as_indexes
Pool of AS indexes used for this VIP.
vl_api_interface_index_t sw_if_index
#define ip46_prefix_is_ip4(ip46, len)
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.
vl_api_fib_path_type_t type
vl_api_address_t as_address
vl_api_interface_index_t sw_if_index
void * vl_msg_api_alloc(int nbytes)
Enable/disable NAT4 feature on the interface.