2 * Copyright (c) 2019 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
17 * A L3 cross connect will send all traffic that is received on the input
18 * interface to the [set of] paths requested.
19 * It is a much more memory efficient solution than using a separate IP table
20 * for each input interface and much faster than an ABF match all rule.
26 #include <vnet/fib/fib_node.h>
28 #define L3XC_PLUGIN_VERSION_MAJOR 1
29 #define L3XC_PLUGIN_VERSION_MINOR 0
33 typedef struct l3xc_t_
35 CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
37 * Linkage into the FIB graph
42 * The path-list describing how to forward in case of a match
44 fib_node_index_t l3xc_pl;
46 fib_protocol_t l3xc_proto;
49 * Sibling index on the path-list
65 * Create or update an L3XC Policy
67 * @param sw_if_index_index the input interface
68 * @param rpaths The set of paths to add to the forwarding set
71 extern int l3xc_update (u32 sw_if_index,
72 u8 is_ip6, const fib_route_path_t * rpaths);
77 * @param sw_if_index_index the input interface
79 extern int l3xc_delete (u32 sw_if_index, u8 is_ip6);
82 * Callback function invoked during a walk of all policies
84 typedef int (*l3xc_walk_cb_t) (index_t l3xci, void *ctx);
87 * Walk/visit each of the L3XC policies
89 extern void l3xc_walk (l3xc_walk_cb_t cb, void *ctx);
92 * Find a L3 XC object from an interfce and FIB protocol
94 extern index_t l3xc_find (u32 sw_if_index, fib_protocol_t fproto);
97 * Data-plane functions
99 extern l3xc_t *l3xc_pool;
101 static_always_inline l3xc_t *
104 return (pool_elt_at_index (l3xc_pool, index));
107 extern vlib_node_registration_t l3xc_ip4_node;
108 extern vlib_node_registration_t l3xc_ip6_node;
111 * fd.io coding-style-patch-verification: ON
114 * eval: (c-set-style "gnu")