2 * Zebra neighbor table management
4 * Copyright (C) 2021 Nvidia
7 * This file is part of FRR.
9 * FRR is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2, or (at your option) any
14 * FRR is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
20 #ifndef _ZEBRA_NEIGH_H
21 #define _ZEBRA_NEIGH_H
27 #define zneigh_info zrouter.neigh_info
29 struct zebra_neigh_ent
{
36 #define ZEBRA_NEIGH_ENT_ACTIVE (1 << 0) /* can be used for traffic */
38 /* memory used for adding the neigt entry to zneigh_info->es_rb_tree */
39 RB_ENTRY(zebra_neigh_ent
) rb_node
;
41 /* list of pbr rules associated with this neigh */
42 struct list
*pbr_rule_list
;
44 RB_HEAD(zebra_neigh_rb_head
, zebra_neigh_ent
);
45 RB_PROTOTYPE(zebra_neigh_rb_head
, zebra_neigh_ent
, rb_node
, zebra_es_rb_cmp
);
47 struct zebra_neigh_info
{
48 /* RB tree of neighbor entries */
49 struct zebra_neigh_rb_head neigh_rb_tree
;
53 /****************************************************************************/
54 extern void zebra_neigh_add(struct interface
*ifp
, struct ipaddr
*ip
,
56 extern void zebra_neigh_del(struct interface
*ifp
, struct ipaddr
*ip
);
57 extern void zebra_neigh_show(struct vty
*vty
);
58 extern void zebra_neigh_init(void);
59 extern void zebra_neigh_terminate(void);
60 extern void zebra_neigh_deref(struct zebra_pbr_rule
*rule
);
61 extern void zebra_neigh_ref(int ifindex
, struct ipaddr
*ip
,
62 struct zebra_pbr_rule
*rule
);
64 #endif /* _ZEBRA_NEIGH_H */