Neale Ranns | 0bfe5d8 | 2016-08-25 15:29:12 +0100 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 44 | extern adj_index_t adj_rewrite_add_and_lock(fib_protocol_t nh_proto, |
Neale Ranns | 924d03a | 2016-10-19 08:25:46 +0100 | [diff] [blame] | 45 | vnet_link_t link_type, |
Neale Ranns | 0bfe5d8 | 2016-08-25 15:29:12 +0100 | [diff] [blame] | 46 | u32 sw_if_index, |
| 47 | u8 *rewrite); |
| 48 | |
| 49 | #endif |