#include <vnet/interface.h>
#include <vnet/api_errno.h>
#include <vnet/feature/feature.h>
+#include <vnet/fib/fib_table.h>
#include <vnet/vnet_msg_enum.h>
memcpy (&prefix.ip6, mp->nh_addr6, sizeof (prefix.ip6));
rv = sr_cli_localsid (mp->is_del,
- (ip6_address_t *) & mp->localsid, 0,
+ (ip6_address_t *) & mp->localsid, 128,
mp->end_psp,
mp->behavior,
ntohl (mp->sw_if_index),
/*
* sr_policy_add (ip6_address_t *bsid, ip6_address_t *segments,
- * u32 weight, u8 behavior, u32 fib_table, u8 is_encap)
+ * u32 weight, u8 behavior, u32 fib_table, u8 is_encap,
+ * u16 behavior, void *plugin_mem)
*/
int rv = 0;
rv = sr_policy_add ((ip6_address_t *) & mp->bsid_addr,
segments,
ntohl (mp->sids.weight),
- mp->type, ntohl (mp->fib_table), mp->is_encap);
+ mp->type, ntohl (mp->fib_table), mp->is_encap, 0, NULL);
vec_free (segments);
REPLY_MACRO (VL_API_SR_POLICY_ADD_REPLY);
else
clib_memcpy (rmp->xconnect_nh_addr6, &t->next_hop.ip6,
sizeof (ip6_address_t));
- rmp->xconnect_iface_or_vrf_table = htonl (t->sw_if_index);
+
+ if (t->behavior == SR_BEHAVIOR_T || t->behavior == SR_BEHAVIOR_DT6)
+ rmp->xconnect_iface_or_vrf_table =
+ htonl (fib_table_get_table_id (t->sw_if_index, FIB_PROTOCOL_IP6));
+ else if (t->behavior == SR_BEHAVIOR_DT4)
+ rmp->xconnect_iface_or_vrf_table =
+ htonl (fib_table_get_table_id (t->sw_if_index, FIB_PROTOCOL_IP4));
+ else
+ rmp->xconnect_iface_or_vrf_table = htonl (t->sw_if_index);
+
rmp->context = context;
vl_api_send_msg (reg, (u8 *) rmp);
static clib_error_t *
sr_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \