blob: fa842feb6589eba2210911c3966147348e905587 [file] [log] [blame]
Neale Ranns5f8f6172019-04-18 10:23:56 +00001/*
2 * nhrp.h: next-hop resolution
3 *
4 * Copyright (c) 2016 Cisco and/or its affiliates.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef __NHRP_H__
19#define __NHRP_H__
20
21#include <vnet/ip/ip.h>
22
23typedef struct nhrp_key_t_
24{
25 ip46_address_t nk_peer;
26 u32 nk_sw_if_index;
27} nhrp_key_t;
28
29typedef struct nhrp_entry_t_
30{
31 nhrp_key_t *ne_key;
32 fib_prefix_t ne_nh;
33 u32 ne_fib_index;
34} nhrp_entry_t;
35
36extern u8 *format_nhrp_entry (u8 * s, va_list * args);
37
38extern int nhrp_entry_add (u32 sw_if_index,
39 const ip46_address_t * peer,
40 u32 nh_table_id, const ip46_address_t * nh);
41
42extern int nhrp_entry_del (u32 sw_if_index, const ip46_address_t * peer);
43
44extern nhrp_entry_t *nhrp_entry_find (u32 sw_if_index,
45 const ip46_address_t * peer);
46extern nhrp_entry_t *nhrp_entry_get (index_t nei);
47
48extern void nhrp_entry_adj_stack (const nhrp_entry_t * ne, adj_index_t ai);
49
50typedef walk_rc_t (*nhrp_walk_cb_t) (index_t nei, void *ctx);
51
52extern void nhrp_walk (nhrp_walk_cb_t fn, void *ctx);
53
54#endif
55
56/*
57 * fd.io coding-style-patch-verification: ON
58 *
59 * Local Variables:
60 * eval: (c-set-style "gnu")
61 * End:
62 */