blob: 25e6bba8868151dd4d43728d4dd801f0ffe2bdef [file] [log] [blame]
Neale Ranns0bfe5d82016-08-25 15:29:12 +01001/*
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:
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 * @brief
17 * A rewrite adjacency has no key, and thus cannot be 'found' from the
18 * FIB resolution code. the client therefore needs to maange these adjacencies
19 */
20
21#ifndef __ADJ_REWRITE_H__
22#define __ADJ_REWRITE_H__
23
24#include <vnet/adj/adj_types.h>
25
26/**
27 * @brief
28 * Add (and lock) a new or lock an existing neighbour adjacency
29 *
30 * @param nh_proto
31 * The protocol for the next-hop address (v4 or v6)
32 *
33 * @param link_type
34 * A description of the protocol of the packets that will forward
35 * through this adj. On an ethernet interface this is the MAC header's
36 * ether-type
37 *
38 * @param sw_if_index
39 * The interface on which the peer resides
40 *
41 * @param rewrite
42 * The rewrite to prepend to packets
43 */
44extern adj_index_t adj_rewrite_add_and_lock(fib_protocol_t nh_proto,
Neale Ranns924d03a2016-10-19 08:25:46 +010045 vnet_link_t link_type,
Neale Ranns0bfe5d82016-08-25 15:29:12 +010046 u32 sw_if_index,
47 u8 *rewrite);
48
49#endif