hs-test: fixed timed out tests passing in the CI
[vpp.git] / src / plugins / lb / lb.api
1 option version = "1.1.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 {
17   u32 client_index;
18   u32 context;
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 {
42   u32 client_index;
43   u32 context;
44   vl_api_address_with_prefix_t pfx;
45   u8 protocol [default=255];
46   u16 port;
47   vl_api_lb_encap_type_t encap;
48   u8 dscp;
49   vl_api_lb_srv_type_t type ; /* LB_API_SRV_TYPE_CLUSTERIP */
50   u16 target_port;
51   u16 node_port;
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 a virtual address (or prefix)
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. (0) means 'all-port VIP'
63     @param encap - Encap is ip4 GRE(0) or ip6 GRE(1) or L3DSR(2) or NAT4(3) or NAT6(4).
64     @param dscp - DSCP bit corresponding to VIP(applicable in L3DSR mode only).
65     @param type - service type(applicable in NAT4/NAT6 mode only).
66     @param target_port - Pod's port corresponding to specific service(applicable in NAT4/NAT6 mode only).
67     @param node_port - Node's port(applicable in NAT4/NAT6 mode only).
68     @param new_flows_table_length - Size of the new connections flow table used
69            for this VIP (must be power of 2).
70     @param src_ip_sticky - source ip based sticky session.
71     @param is_del - The VIP should be removed.
72 */
73 autoreply  define lb_add_del_vip_v2 {
74   u32 client_index;
75   u32 context;
76   vl_api_address_with_prefix_t pfx;
77   u8 protocol [default=255];
78   u16 port;
79   vl_api_lb_encap_type_t encap;
80   u8 dscp;
81   vl_api_lb_srv_type_t type ; /* LB_API_SRV_TYPE_CLUSTERIP */
82   u16 target_port;
83   u16 node_port;
84   u32 new_flows_table_length [default=1024];
85   bool src_ip_sticky;
86   bool is_del;
87   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>] [src_ip_sticky] [del]";
88 };
89
90 /** \brief Add an application server for a given VIP
91     @param client_index - opaque cookie to identify the sender
92     @param context - sender context, to match reply w/ request
93     @param pfx - ip prefix and length
94     @param protocol - tcp or udp.
95     @param port - destination port.
96     @param as_address - The application server address (IPv4 in lower order 32 bits).
97     @param is_del - The AS should be removed.
98     @param is_flush - The sessions related to this AS should be flushed.
99 */
100 autoreply  define lb_add_del_as {
101   u32 client_index;
102   u32 context;
103   vl_api_address_with_prefix_t pfx;
104   u8 protocol [default=255];
105   u16 port;
106   vl_api_address_t as_address;
107   bool is_del;
108   bool is_flush;
109   option vat_help = "<vip-prefix> [protocol (tcp|udp) port <n>] [<address>] [del] [flush]";
110 };
111
112 /** \brief Flush a given vip
113     @param client_index - opaque cookie to identify the sender
114     @param context - sender context, to match reply w/ request
115     @param pfx - ip prefix and length
116     @param protocol - tcp or udp.
117     @param port - destination port.
118 */
119 autoreply  define lb_flush_vip {
120   u32 client_index;
121   u32 context;
122   vl_api_address_with_prefix_t pfx;
123   u8 protocol;
124   u16 port;
125 };
126
127 /** \brief Dump all vips
128     @param client_index - opaque cookie to identify the sender
129     @param context - sender context, to match reply w/ request
130 */
131 define lb_vip_dump{
132   u32 client_index;
133   u32 context;
134   vl_api_address_with_prefix_t pfx;
135   vl_api_prefix_matcher_t pfx_matcher;
136   u8 protocol [default=255];
137   u16 port;
138
139 };
140
141 /** \brief Reply all configured vip
142     @param context - sender context, to match reply w/ request
143     @param vip - all vip addrs.
144 */
145 define lb_vip_details {
146   u32 context;
147   vl_api_lb_vip_t vip;
148   vl_api_lb_encap_type_t encap;
149   vl_api_ip_dscp_t dscp;
150   vl_api_lb_srv_type_t srv_type;
151   u16 target_port;
152   u16 flow_table_length;
153 };
154
155 /** \brief dump AS list per VIP or all ASs for all VIPs
156     @param client_index - opaque cookie to identify the sender
157     @param context - sender context, to match reply w/ request
158     @param pfx - ip prefix and length.
159     @param protocol - tcp or udp.
160     @param port - destination port.
161 */
162 define lb_as_dump{
163   u32 client_index;
164   u32 context;
165   /* vip */
166   vl_api_address_with_prefix_t pfx;
167   u8 protocol;
168   u16 port;
169   option vat_help = "<vip-prefix> [protocol (tcp|udp) port <n>]";
170 };
171
172 /** \brief lb_as_details
173     @param context - sender context, to match reply w/ request
174     @param as - AS detail record
175 */
176 define lb_as_details {
177   u32 context;
178   vl_api_lb_vip_t vip;
179   vl_api_address_t app_srv;
180   u8 flags;
181   u32 in_use_since;
182 };
183
184 /** \brief Enable/disable NAT4 feature on the interface
185     @param client_index - opaque cookie to identify the sender
186     @param context - sender context, to match reply w/ request
187     @param is_add - true if add, false if delete
188     @param sw_if_index - software index of the interface
189 */
190 autoreply define lb_add_del_intf_nat4 {
191   u32 client_index;
192   u32 context;
193   bool is_add;
194   vl_api_interface_index_t sw_if_index;
195 };
196
197 /** \brief Enable/disable NAT6 feature on the interface
198     @param client_index - opaque cookie to identify the sender
199     @param context - sender context, to match reply w/ request
200     @param is_add - true if add, false if delete
201     @param sw_if_index - software index of the interface
202 */
203 autoreply define lb_add_del_intf_nat6 {
204   u32 client_index;
205   u32 context;
206   bool is_add;
207   vl_api_interface_index_t sw_if_index;
208 };