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.
17 * @brief Mcast Adjacency
19 * The multicast adjacency forwards IP traffic on an interface toward a multicast
20 * group address. This is a different type of adjacency to a unicast adjacency
21 * since the application of the MAC header is different, and so the VLIB node
22 * visited is also different. DPO types have different VLIB nodes.
25 #ifndef __ADJ_MCAST_H__
26 #define __ADJ_MCAST_H__
28 #include <vnet/adj/adj_types.h>
29 #include <vnet/adj/adj_midchain.h>
33 * Add (and lock) a new or lock an existing mcast adjacency
36 * The protocol for the neighbours that we wish to mcast
39 * A description of the protocol of the packets that will forward
40 * through this adj. On an ethernet interface this is the MAC header's
44 * The interface on which to mcast
46 extern adj_index_t adj_mcast_add_or_lock(fib_protocol_t proto,
47 vnet_link_t link_type,
52 * Update the rewrite string for an existing adjacecny.
55 * The index of the adj to update
61 * The offset in the rewrite a which to write in packet's
65 * The mask to apply to the packet berfore the rewrite.
67 extern void adj_mcast_update_rewrite(adj_index_t adj_index,
74 * Update the rewrite string for an existing adjacecny and
75 * Convert the adjacency into a midchain
78 * The index of the adj to update
83 extern void adj_mcast_midchain_update_rewrite(adj_index_t adj_index,
84 adj_midchain_fixup_t fixup,
90 * @brief Walk the multicast Adjacencies on a given interface
92 extern void adj_mcast_walk (u32 sw_if_index,
93 fib_protocol_t adj_nh_proto,
98 * @brief Format/display a mcast adjacency.
100 extern u8* format_adj_mcast(u8* s, va_list *ap);
101 extern u8* format_adj_mcast_midchain(u8* s, va_list *ap);
104 * @brief Get the sze of the mcast adj DB. Test purposes only.
106 extern u32 adj_mcast_db_size(void);
110 * Module initialisation
112 extern void adj_mcast_module_init(void);