2 * Copyright (c) 2016 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.
19 #include <vnet/vnet.h>
20 #include <vnet/ip/ip.h>
21 #include <vnet/fib/fib_node.h>
23 #include <vppinfra/bihash_24_8.h>
24 #include <vppinfra/bihash_template.h>
26 #define ila_foreach_type \
29 _(VNID4, 2, "vnid-ip4") \
30 _(VNID6, 3, "vnid-ip6") \
31 _(VNIDM, 4, "vnid-multicast")
34 #define _(i,n,s) ILA_TYPE_##i = n,
39 #define ila_csum_foreach_type \
40 _(NO_ACTION, 0, "no-action") \
41 _(NEUTRAL_MAP, 1, "neutral-map") \
42 _(ADJUST_TRANSPORT, 2, "adjust-transport")
45 #define _(i,n,s) ILA_CSUM_MODE_##i = n,
51 #define ila_foreach_direction \
52 _(BIDIR, 0, "bidir") \
53 _(SIR2ILA, 1, "sir2ila") \
54 _(ILA2SIR, 2, "ila2sir")
57 #define _(i,n,s) ILA_DIR_##i = n,
66 fib_node_t ila_fib_node;
68 ip6_address_t sir_address;
69 ip6_address_t ila_address;
70 ip6_address_t next_hop;
71 ila_csum_mode_t csum_mode;
75 * The FIB entry index for the next-hop
77 fib_node_index_t next_hop_fib_entry_index;
80 * The child index on the FIB entry
82 u32 next_hop_child_index;
85 * The next DPO in the grpah to follow
91 ila_entry_t *entries; //Pool of ILA entries
93 u64 lookup_table_nbuckets;
94 u64 lookup_table_size;
95 clib_bihash_24_8_t id_to_entry_table;
97 u32 ip6_lookup_next_index;
103 ip6_address_t sir_address;
104 ip6_address_t next_hop_address;
108 ila_csum_mode_t csum_mode;
111 } ila_add_del_entry_args_t;
113 int ila_add_del_entry (ila_add_del_entry_args_t * args);
114 int ila_interface (u32 sw_if_index, u8 disable);