aboutsummaryrefslogtreecommitdiffstats
path: root/vpp/vpp-api/api.c
diff options
context:
space:
mode:
authorPierre Pfister <ppfister@cisco.com>2016-07-15 09:19:39 +0100
committerChris Luke <chris_luke@comcast.com>2016-07-20 11:48:13 +0000
commit08e0312fe2ecb10e10acf334c71440df7be95cac (patch)
tree121f3aff1bfd7e5474fefd1226cbfbabd2ded6e4 /vpp/vpp-api/api.c
parent8c4072696d2805fc8d9d2f76d8955f710d192bdd (diff)
L2TP: Add option for custom fib id for outgoing encapsulated packets
If a custom fib ID is used (different from ~0), the associated fib is used to forward outgoing encapsulated packets. Otherwise, the fib used is the same as for any packet received on the original RX interface (L2TP does not modify RX interface index). Change-Id: I4533d5f7fa432c78c937d3acdd802d0d1c92a0c7 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Diffstat (limited to 'vpp/vpp-api/api.c')
-rw-r--r--vpp/vpp-api/api.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c
index f6b1b739..6a5a152e 100644
--- a/vpp/vpp-api/api.c
+++ b/vpp/vpp-api/api.c
@@ -4329,6 +4329,20 @@ static void vl_api_l2tpv3_create_tunnel_t_handler
goto out;
}
+ u32 encap_fib_index;
+
+ if (mp->encap_vrf_id != ~0) {
+ uword *p;
+ ip6_main_t *im = &ip6_main;
+ if (!(p = hash_get (im->fib_index_by_table_id, ntohl(mp->encap_vrf_id)))) {
+ rv = VNET_API_ERROR_NO_SUCH_FIB;
+ goto out;
+ }
+ encap_fib_index = p[0];
+ } else {
+ encap_fib_index = ~0;
+ }
+
rv = create_l2tpv3_ipv6_tunnel (lm,
(ip6_address_t *) mp->client_address,
(ip6_address_t *) mp->our_address,
@@ -4337,6 +4351,7 @@ static void vl_api_l2tpv3_create_tunnel_t_handler
clib_net_to_host_u64(mp->local_cookie),
clib_net_to_host_u64(mp->remote_cookie),
mp->l2_sublayer_present,
+ encap_fib_index,
&sw_if_index);
out: