]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zebra_nhg.h
zebra: Remove afi field in nexthop hash entry
[mirror_frr.git] / zebra / zebra_nhg.h
CommitLineData
ad28e79a
SW
1/* Zebra Nexthop Group header.
2 * Copyright (C) 2019 Cumulus Networks, Inc.
3 * Donald Sharp
4 * Stephen Worley
5 *
6 * This file is part of FRR.
7 *
8 * FRR is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * FRR is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with FRR; see the file COPYING. If not, write to the Free
20 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 * 02111-1307, USA.
22 */
23#ifndef __ZEBRA_NHG_H__
24#define __ZEBRA_NHG_H__
25
26#include "zebra/rib.h"
69171da2 27#include "lib/nexthop_group.h"
ad28e79a 28
69171da2 29struct nhg_hash_entry {
a95b8020 30 uint32_t id;
69171da2
DS
31 vrf_id_t vrf_id;
32
33 struct nexthop_group nhg;
34
35 uint32_t refcnt;
36 uint32_t dplane_ref;
c8ee3cdb
DS
37
38 uint32_t flags;
39/*
40 * Is this nexthop group valid, ie all nexthops are fully resolved.
41 * What is fully resolved? It's a nexthop that is either self contained
42 * and correct( ie no recursive pointer ) or a nexthop that is recursively
43 * resolved and correct.
44 */
45#define NEXTHOP_GROUP_VALID 0x1
46/*
47 * Has this nexthop group been installed? At this point in time, this
48 * means that the data-plane has been told about this nexthop group
49 * and it's possible usage by a route entry.
50 */
51#define NEXTHOP_GROUP_INSTALLED 0x2
69171da2
DS
52};
53
54void zebra_nhg_init(void);
55void zebra_nhg_terminate(void);
56
57extern uint32_t zebra_nhg_hash_key(const void *arg);
a95b8020 58extern uint32_t zebra_nhg_id_key(const void *arg);
69171da2
DS
59
60extern bool zebra_nhg_hash_equal(const void *arg1, const void *arg2);
a95b8020 61extern bool zebra_nhg_id_equal(const void *arg1, const void *arg2);
69171da2 62
8b5bdc8b 63extern void zebra_nhg_find(struct nexthop_group *nhg, struct route_entry *re);
a95b8020 64extern void zebra_nhg_find_id(uint32_t id, struct nexthop_group *nhg);
8b5bdc8b
SW
65void zebra_nhg_release(struct route_entry *re);
66
67extern int nexthop_active_update(struct route_node *rn, struct route_entry *re);
ad28e79a 68#endif