]> git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_neigh.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / zebra / zebra_neigh.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Zebra neighbor table management
4 *
5 * Copyright (C) 2021 Nvidia
6 * Anuradha Karuppiah
7 */
8
9 #ifndef _ZEBRA_NEIGH_H
10 #define _ZEBRA_NEIGH_H
11
12 #include <zebra.h>
13
14 #include "if.h"
15
16 #define zneigh_info zrouter.neigh_info
17
18 struct zebra_neigh_ent {
19 ifindex_t ifindex;
20 struct ipaddr ip;
21
22 struct ethaddr mac;
23
24 uint32_t flags;
25 #define ZEBRA_NEIGH_ENT_ACTIVE (1 << 0) /* can be used for traffic */
26
27 /* memory used for adding the neigt entry to zneigh_info->es_rb_tree */
28 RB_ENTRY(zebra_neigh_ent) rb_node;
29
30 /* list of pbr rules associated with this neigh */
31 struct list *pbr_rule_list;
32 };
33 RB_HEAD(zebra_neigh_rb_head, zebra_neigh_ent);
34 RB_PROTOTYPE(zebra_neigh_rb_head, zebra_neigh_ent, rb_node, zebra_es_rb_cmp);
35
36 struct zebra_neigh_info {
37 /* RB tree of neighbor entries */
38 struct zebra_neigh_rb_head neigh_rb_tree;
39 };
40
41
42 /****************************************************************************/
43 extern void zebra_neigh_add(struct interface *ifp, struct ipaddr *ip,
44 struct ethaddr *mac);
45 extern void zebra_neigh_del(struct interface *ifp, struct ipaddr *ip);
46 extern void zebra_neigh_show(struct vty *vty);
47 extern void zebra_neigh_init(void);
48 extern void zebra_neigh_terminate(void);
49 extern void zebra_neigh_deref(struct zebra_pbr_rule *rule);
50 extern void zebra_neigh_ref(int ifindex, struct ipaddr *ip,
51 struct zebra_pbr_rule *rule);
52
53 #endif /* _ZEBRA_NEIGH_H */