VOM: mroutes
[vpp.git] / src / vnet / ip / ip6_ll_table.h
1 /*
2  * Copyright (c) 2018 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:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15
16 #ifndef __IP6_LL_TABLE_H__
17 #define __IP6_LL_TABLE_H__
18
19 #include <vnet/ip/ip.h>
20
21 #include <vnet/ip/ip6_ll_types.h>
22
23 /**
24  * @brief
25  *   A protocol Independent IP multicast FIB table
26  */
27 typedef struct ip6_ll_table_t_
28 {
29   /**
30    * A vector, indexed by sw_if_index, of unicast IPv6 FIBs
31    */
32   u32 *ilt_fibs;
33
34   /**
35    * Total route counters
36    */
37   u32 ilt_total_route_counts;
38
39 } ip6_ll_table_t;
40
41 /**
42  * @brief
43  *  Perfom a longest prefix match in the non-forwarding table
44  *
45  * @param prefix
46  *  The prefix to lookup
47  *
48  * @return
49  *  The index of the fib_entry_t for the best match, which may be the default route
50  */
51 extern fib_node_index_t ip6_ll_table_lookup (const ip6_ll_prefix_t * prefix);
52
53 /**
54  * @brief
55  *  Perfom an exact match in the non-forwarding table
56  *
57  * @param prefix
58  *  The prefix to lookup
59  *
60  * @return
61  *  The index of the fib_entry_t for the exact match, or INVALID
62  *  is there is no match.
63  */
64 extern fib_node_index_t ip6_ll_table_lookup_exact_match
65   (const ip6_ll_prefix_t * prefix);
66
67 /**
68  * @brief
69  * Update an entry in the table. The falgs determine if the entry is
70  * LOCAL, in which case it's a receive, or not, in which case the entry
71  * will link to an adjacency.
72  *
73  * @param prefix
74  *  The prefix for the entry to add
75  *
76  * @return
77  *  the index of the fib_entry_t that is created (or existed already).
78  */
79 extern fib_node_index_t ip6_ll_table_entry_update
80   (const ip6_ll_prefix_t * prefix, fib_route_path_flags_t flags);
81
82 /**
83  * @brief
84  *  Delete a IP6 link-local entry.
85  *
86  * @param prefix
87  *  The prefix for the entry to remove
88  */
89 extern void ip6_ll_table_entry_delete (const ip6_ll_prefix_t * prefix);
90
91 /**
92  * @brief For use in the data plane. Get the underlying ip6 FIB
93  */
94 extern u32 ip6_ll_fib_get (u32 sw_if_index);
95
96 /*
97  * fd.io coding-style-patch-verification: ON
98  *
99  * Local Variables:
100  * eval: (c-set-style "gnu")
101  * End:
102  */
103
104 #endif