1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Zebra neighbor table management
5 * Copyright (C) 2021 Nvidia
10 #define _ZEBRA_NEIGH_H
16 #define zneigh_info zrouter.neigh_info
18 struct zebra_neigh_ent
{
25 #define ZEBRA_NEIGH_ENT_ACTIVE (1 << 0) /* can be used for traffic */
27 /* memory used for adding the neigt entry to zneigh_info->es_rb_tree */
28 RB_ENTRY(zebra_neigh_ent
) rb_node
;
30 /* list of pbr rules associated with this neigh */
31 struct list
*pbr_rule_list
;
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
);
36 struct zebra_neigh_info
{
37 /* RB tree of neighbor entries */
38 struct zebra_neigh_rb_head neigh_rb_tree
;
42 /****************************************************************************/
43 extern void zebra_neigh_add(struct interface
*ifp
, struct ipaddr
*ip
,
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
);
53 #endif /* _ZEBRA_NEIGH_H */