FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
lb.api
Go to the documentation of this file.
1 option version = "1.0.0";
2 import "plugins/lb/lb_types.api";
3 import "vnet/interface_types.api";
4 
5 /** \brief Configure Load-Balancer global parameters (unlike the CLI, both ip4_src_address and ip6_src_address need to be specified.
6  @param client_index - opaque cookie to identify the sender
7  @param context - sender context, to match reply w/ request
8  @param ip4_src_address - IPv4 address to be used as source for IPv4 traffic(applicable in GRE4/GRE6/NAT4/NAT6 mode only).
9  @param ip6_src_address - IPv6 address to be used as source for IPv6 traffic(applicable in GRE4/GRE6/NAT4/NAT6 mode only).
10  @param sticky_buckets_per_core - Number of buckets *per worker thread* in the
11  established flow table (must be power of 2).
12  @param flow_timeout - Time in seconds after which, if no packet is received
13  for a given flow, the flow is removed from the established flow table.
14 */
15 autoreply define lb_conf
16 {
19  vl_api_ip4_address_t ip4_src_address;
20  vl_api_ip6_address_t ip6_src_address;
21  u32 sticky_buckets_per_core [default=0xffffffff];
22  u32 flow_timeout [default=0xffffffff];
23  option vat_help = "[ip4-src-address <addr>] [ip6-src-address <addr>] [buckets <n>] [timeout <s>]";
24 };
25 
26 /** \brief Add a virtual address (or prefix)
27  @param client_index - opaque cookie to identify the sender
28  @param context - sender context, to match reply w/ request
29  @param pfx - ip prefix and length
30  @param protocol - tcp or udp.
31  @param port - destination port. (0) means 'all-port VIP'
32  @param encap - Encap is ip4 GRE(0) or ip6 GRE(1) or L3DSR(2) or NAT4(3) or NAT6(4).
33  @param dscp - DSCP bit corresponding to VIP(applicable in L3DSR mode only).
34  @param type - service type(applicable in NAT4/NAT6 mode only).
35  @param target_port - Pod's port corresponding to specific service(applicable in NAT4/NAT6 mode only).
36  @param node_port - Node's port(applicable in NAT4/NAT6 mode only).
37  @param new_flows_table_length - Size of the new connections flow table used
38  for this VIP (must be power of 2).
39  @param is_del - The VIP should be removed.
40 */
41 autoreply define lb_add_del_vip {
44  vl_api_address_with_prefix_t pfx;
45  u8 protocol [default=255];
47  vl_api_lb_encap_type_t encap;
49  vl_api_lb_srv_type_t type ; /* LB_API_SRV_TYPE_CLUSTERIP */
52  u32 new_flows_table_length [default=1024];
53  bool is_del;
54  option vat_help = "<prefix> [protocol (tcp|udp) port <n>] [encap (gre6|gre4|l3dsr|nat4|nat6)] [dscp <n>] [type (nodeport|clusterip) target_port <n>] [new_len <n>] [del]";
55 };
56 
57 /** \brief Add an application server for a given VIP
58  @param client_index - opaque cookie to identify the sender
59  @param context - sender context, to match reply w/ request
60  @param pfx - ip prefix and length
61  @param protocol - tcp or udp.
62  @param port - destination port.
63  @param as_address - The application server address (IPv4 in lower order 32 bits).
64  @param is_del - The AS should be removed.
65  @param is_flush - The sessions related to this AS should be flushed.
66 */
67 autoreply define lb_add_del_as {
70  vl_api_address_with_prefix_t pfx;
71  u8 protocol [default=255];
73  vl_api_address_t as_address;
74  bool is_del;
75  bool is_flush;
76  option vat_help = "<vip-prefix> [protocol (tcp|udp) port <n>] [<address>] [del] [flush]";
77 };
78 
79 /** \brief Flush a given vip
80  @param client_index - opaque cookie to identify the sender
81  @param context - sender context, to match reply w/ request
82  @param pfx - ip prefix and length
83  @param protocol - tcp or udp.
84  @param port - destination port.
85 */
86 autoreply define lb_flush_vip {
89  vl_api_address_with_prefix_t pfx;
92 };
93 
94 /** \brief Dump all vips
95  @param client_index - opaque cookie to identify the sender
96  @param context - sender context, to match reply w/ request
97 */
98 define lb_vip_dump{
101  vl_api_address_with_prefix_t pfx;
102  vl_api_prefix_matcher_t pfx_matcher;
103  u8 protocol [default=255];
105 
106 };
107 
108 /** \brief Reply all configured vip
109  @param context - sender context, to match reply w/ request
110  @param vip - all vip addrs.
111 */
112 define lb_vip_details {
114  vl_api_lb_vip_t vip;
115  vl_api_lb_encap_type_t encap;
116  vl_api_ip_dscp_t dscp;
117  vl_api_lb_srv_type_t srv_type;
120 };
121 
122 /** \brief dump AS list per VIP or all ASs for all VIPs
123  @param client_index - opaque cookie to identify the sender
124  @param context - sender context, to match reply w/ request
125  @param pfx - ip prefix and length.
126  @param protocol - tcp or udp.
127  @param port - destination port.
128 */
129 define lb_as_dump{
132  /* vip */
133  vl_api_address_with_prefix_t pfx;
136  option vat_help = "<vip-prefix> [protocol (tcp|udp) port <n>]";
137 };
138 
139 /** \brief lb_as_details
140  @param context - sender context, to match reply w/ request
141  @param as - AS detail record
142 */
143 define lb_as_details {
145  vl_api_lb_vip_t vip;
146  vl_api_address_t app_srv;
149 };
150 
151 /** \brief Enable/disable NAT4 feature on the interface
152  @param client_index - opaque cookie to identify the sender
153  @param context - sender context, to match reply w/ request
154  @param is_add - true if add, false if delete
155  @param sw_if_index - software index of the interface
156 */
157 autoreply define lb_add_del_intf_nat4 {
160  bool is_add;
161  vl_api_interface_index_t sw_if_index;
162 };
163 
164 /** \brief Enable/disable NAT6 feature on the interface
165  @param client_index - opaque cookie to identify the sender
166  @param context - sender context, to match reply w/ request
167  @param is_add - true if add, false if delete
168  @param sw_if_index - software index of the interface
169 */
170 autoreply define lb_add_del_intf_nat6 {
173  bool is_add;
174  vl_api_interface_index_t sw_if_index;
175 };
vl_api_lb_add_del_as_t::vat_help
option vat_help
Definition: lb.api:76
vl_api_lb_vip_details_t::context
u32 context
Definition: lb.api:113
vl_api_lb_add_del_intf_nat4_t::is_add
bool is_add
Definition: lb.api:160
vl_api_lb_vip_details_t::dscp
vl_api_ip_dscp_t dscp
Definition: lb.api:116
vl_api_lb_conf_t::ip4_src_address
vl_api_ip4_address_t ip4_src_address
Definition: lb.api:19
vl_api_lb_add_del_intf_nat4_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: lb.api:161
vl_api_lb_add_del_as_t
Add an application server for a given VIP.
Definition: lb.api:67
vl_api_lb_conf_t::client_index
u32 client_index
Definition: lb.api:17
vl_api_lb_add_del_vip_t
Add a virtual address (or prefix)
Definition: lb.api:41
vl_api_lb_add_del_vip_t::target_port
u16 target_port
Definition: lb.api:50
vl_api_lb_as_dump::pfx
vl_api_address_with_prefix_t pfx
Definition: lb.api:133
vl_api_lb_vip_details_t::flow_table_length
u16 flow_table_length
Definition: lb.api:119
version
option version
Definition: lb.api:1
vl_api_lb_as_details_t::flags
u8 flags
Definition: lb.api:147
vl_api_lb_add_del_as_t::client_index
u32 client_index
Definition: lb.api:68
vl_api_lb_vip_dump::context
u32 context
Definition: lb.api:100
vl_api_lb_vip_dump::port
u16 port
Definition: lb.api:104
vl_api_lb_add_del_intf_nat6_t::client_index
u32 client_index
Definition: lb.api:171
vl_api_lb_as_details_t::app_srv
vl_api_address_t app_srv
Definition: lb.api:146
vl_api_lb_vip_details_t::srv_type
vl_api_lb_srv_type_t srv_type
Definition: lb.api:117
u16
unsigned short u16
Definition: types.h:57
vl_api_lb_add_del_vip_t::vat_help
option vat_help
Definition: lb.api:54
vl_api_lb_add_del_vip_t::dscp
u8 dscp
Definition: lb.api:48
vl_api_lb_add_del_vip_t::encap
vl_api_lb_encap_type_t encap
Definition: lb.api:47
vl_api_lb_flush_vip_t::context
u32 context
Definition: lb.api:88
vl_api_lb_add_del_vip_t::pfx
vl_api_address_with_prefix_t pfx
Definition: lb.api:44
vl_api_lb_as_details_t
lb_as_details
Definition: lb.api:143
vl_api_lb_flush_vip_t
Flush a given vip.
Definition: lb.api:86
vl_api_lb_add_del_intf_nat6_t::context
u32 context
Definition: lb.api:172
vl_api_lb_as_details_t::vip
vl_api_lb_vip_t vip
Definition: lb.api:145
vl_api_lb_add_del_vip_t::port
u16 port
Definition: lb.api:46
vl_api_lb_vip_dump::protocol
u8 protocol[default=255]
Definition: lb.api:103
vl_api_lb_add_del_intf_nat4_t::context
u32 context
Definition: lb.api:159
vl_api_lb_add_del_vip_t::client_index
u32 client_index
Definition: lb.api:42
vl_api_lb_conf_t::flow_timeout
u32 flow_timeout[default=0xffffffff]
Definition: lb.api:22
vl_api_lb_vip_details_t::vip
vl_api_lb_vip_t vip
Definition: lb.api:114
vl_api_lb_add_del_as_t::is_del
bool is_del
Definition: lb.api:74
vl_api_lb_add_del_vip_t::type
vl_api_lb_srv_type_t type
Definition: lb.api:49
vl_api_lb_vip_details_t::encap
vl_api_lb_encap_type_t encap
Definition: lb.api:115
vl_api_lb_add_del_vip_t::protocol
u8 protocol[default=255]
Definition: lb.api:45
vl_api_lb_as_dump::vat_help
option vat_help
Definition: lb.api:136
vl_api_lb_add_del_vip_t::new_flows_table_length
u32 new_flows_table_length[default=1024]
Definition: lb.api:52
vl_api_lb_conf_t::ip6_src_address
vl_api_ip6_address_t ip6_src_address
Definition: lb.api:20
vl_api_lb_as_dump::client_index
_t u32 client_index
Definition: lb.api:130
vl_api_lb_add_del_as_t::port
u16 port
Definition: lb.api:72
vl_api_lb_vip_details_t::target_port
u16 target_port
Definition: lb.api:118
vl_api_lb_conf_t
Configure Load-Balancer global parameters (unlike the CLI, both ip4_src_address and ip6_src_address n...
Definition: lb.api:15
vl_api_lb_as_details_t::context
u32 context
Definition: lb.api:144
vl_api_lb_flush_vip_t::port
u16 port
Definition: lb.api:91
vl_api_lb_conf_t::context
u32 context
Definition: lb.api:18
vl_api_lb_add_del_intf_nat6_t::is_add
bool is_add
Definition: lb.api:173
vl_api_lb_as_details_t::in_use_since
u32 in_use_since
Definition: lb.api:148
vl_api_lb_add_del_vip_t::context
u32 context
Definition: lb.api:43
vl_api_lb_add_del_as_t::protocol
u8 protocol[default=255]
Definition: lb.api:71
vl_api_lb_as_dump::context
u32 context
Definition: lb.api:131
vl_api_lb_flush_vip_t::client_index
u32 client_index
Definition: lb.api:87
vl_api_lb_conf_t::sticky_buckets_per_core
u32 sticky_buckets_per_core[default=0xffffffff]
Definition: lb.api:21
vl_api_lb_vip_dump::pfx
vl_api_address_with_prefix_t pfx
Definition: lb.api:101
vl_api_lb_as_dump::port
u16 port
Definition: lb.api:135
vl_api_lb_add_del_as_t::is_flush
bool is_flush
Definition: lb.api:75
u32
unsigned int u32
Definition: types.h:88
protocol
vl_api_ip_proto_t protocol
Definition: lb_types.api:72
vl_api_lb_add_del_as_t::pfx
vl_api_address_with_prefix_t pfx
Definition: lb.api:70
vl_api_lb_add_del_intf_nat6_t
Enable/disable NAT6 feature on the interface.
Definition: lb.api:170
vl_api_lb_vip_dump
Dump all vips.
Definition: lb.api:98
vl_api_lb_as_dump
dump AS list per VIP or all ASs for all VIPs
Definition: lb.api:129
vl_api_lb_vip_details_t
Reply all configured vip.
Definition: lb.api:112
vl_api_lb_flush_vip_t::protocol
u8 protocol
Definition: lb.api:90
u8
unsigned char u8
Definition: types.h:56
vl_api_lb_add_del_intf_nat4_t::client_index
u32 client_index
Definition: lb.api:158
vl_api_lb_add_del_vip_t::is_del
bool is_del
Definition: lb.api:53
vl_api_lb_add_del_as_t::context
u32 context
Definition: lb.api:69
vl_api_lb_vip_dump::client_index
_t u32 client_index
Definition: lb.api:99
vl_api_lb_flush_vip_t::pfx
vl_api_address_with_prefix_t pfx
Definition: lb.api:89
vl_api_lb_add_del_vip_t::node_port
u16 node_port
Definition: lb.api:51
vl_api_lb_conf_t::vat_help
option vat_help
Definition: lb.api:23
lb_conf
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.
Definition: lb.c:476
vl_api_lb_add_del_as_t::as_address
vl_api_address_t as_address
Definition: lb.api:73
vl_api_lb_add_del_intf_nat6_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: lb.api:174
vl_api_lb_add_del_intf_nat4_t
Enable/disable NAT4 feature on the interface.
Definition: lb.api:157
vl_api_lb_as_dump::protocol
u8 protocol
Definition: lb.api:134
vl_api_lb_vip_dump::pfx_matcher
vl_api_prefix_matcher_t pfx_matcher
Definition: lb.api:102