#include <vat/vat.h>
#include <vlibapi/api.h>
#include <vlibmemory/api.h>
-#include <vlibsocket/api.h>
+
#include <vppinfra/error.h>
#include <lb/lb.h>
static int api_lb_conf (vat_main_t * vam)
{
unformat_input_t *i = vam->input;
- f64 timeout;
vl_api_lb_conf_t mps, *mp;
+ int ret;
if (!unformat(i, "%U %U %u %u",
unformat_ip4_address, &mps.ip4_src_address,
}
M(LB_CONF, mp);
- S;
- W;
-
- /* NOTREACHED */
- return 0;
+ S(mp);
+ W (ret);
+ return ret;
}
static int api_lb_add_del_vip (vat_main_t * vam)
{
unformat_input_t * i = vam->input;
- f64 timeout;
vl_api_lb_add_del_vip_t mps, *mp;
+ int ret;
mps.is_del = 0;
- mps.is_gre4 = 0;
+ mps.encap = LB_ENCAP_TYPE_GRE4;
if (!unformat(i, "%U",
unformat_ip46_prefix, mps.ip_prefix, &mps.prefix_length, IP46_TYPE_ANY)) {
}
if (unformat(i, "gre4")) {
- mps.is_gre4 = 1;
+ mps.encap = LB_ENCAP_TYPE_GRE4;
} else if (unformat(i, "gre6")) {
- mps.is_gre4 = 0;
+ mps.encap = LB_ENCAP_TYPE_GRE6;
+ } else if (unformat(i, "l3dsr")) {
+ mps.encap = LB_ENCAP_TYPE_L3DSR;
+ } else if (unformat(i, "nat4")) {
+ mps.encap = LB_ENCAP_TYPE_NAT4;
+ } else if (unformat(i, "nat6")) {
+ mps.encap = LB_ENCAP_TYPE_NAT6;
} else {
errmsg ("no encap\n");
return -99;
}
M(LB_ADD_DEL_VIP, mp);
- S;
- W;
- /* NOTREACHED */
- return 0;
+ S(mp);
+ W (ret);
+ return ret;
}
static int api_lb_add_del_as (vat_main_t * vam)
{
unformat_input_t * i = vam->input;
- f64 timeout;
vl_api_lb_add_del_as_t mps, *mp;
+ int ret;
mps.is_del = 0;
if (!unformat(i, "%U %U",
}
M(LB_ADD_DEL_AS, mp);
- S;
- W;
- /* NOTREACHED */
- return 0;
+ S(mp);
+ W (ret);
+ return ret;
}
/*
*/
#define foreach_vpe_api_msg \
_(lb_conf, "<ip4-src-addr> <ip6-src-address> <sticky_buckets_per_core> <flow_timeout>") \
-_(lb_add_del_vip, "<ip-prefix> [gre4|gre6] <new_table_len> [del]") \
+_(lb_add_del_vip, "<ip-prefix> [gre4|gre6|l3dsr|nat4|nat6] " \
+ "<dscp> <port> <target_port> " \
+ "<new_table_len> [del]") \
_(lb_add_del_as, "<vip-ip-prefix> <address> [del]")
static void