]> git.proxmox.com Git - mirror_frr.git/blame - isisd/isis_route.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / isisd / isis_route.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
eb5d44eb 2/*
3 * IS-IS Rout(e)ing protocol - isis_route.h
4 *
5 * Copyright (C) 2001,2002 Sampo Saaristo
d62a17ae 6 * Tampere University of Technology
eb5d44eb 7 * Institute of Communications Engineering
8 *
9 * based on ../ospf6d/ospf6_route.[ch]
10 * by Yasuhiro Ohara
eb5d44eb 11 */
12#ifndef _ZEBRA_ISIS_ROUTE_H
13#define _ZEBRA_ISIS_ROUTE_H
14
363be4dd 15#include "lib/nexthop.h"
eb5d44eb 16
d62a17ae 17struct isis_nexthop {
18 ifindex_t ifindex;
363be4dd
RW
19 int family;
20 union g_addr ip;
26f6acaf 21 uint8_t sysid[ISIS_SYS_ID_LEN];
d47d6089 22 struct isis_sr_psid_info sr;
c951ee6e 23 struct mpls_label_stack *label_stack;
eb5d44eb 24};
25
d62a17ae 26struct isis_route_info {
3f045a08
JB
27#define ISIS_ROUTE_FLAG_ACTIVE 0x01 /* active route for the prefix */
28#define ISIS_ROUTE_FLAG_ZEBRA_SYNCED 0x02 /* set when route synced to zebra */
29#define ISIS_ROUTE_FLAG_ZEBRA_RESYNC 0x04 /* set when route needs to sync */
d7c0a89a
QY
30 uint8_t flag;
31 uint32_t cost;
32 uint32_t depth;
d47d6089
RW
33 struct isis_sr_psid_info sr;
34 struct isis_sr_psid_info sr_previous;
d62a17ae 35 struct list *nexthops;
c951ee6e 36 struct isis_route_info *backup;
eb5d44eb 37};
38
6cf38339
RW
39DECLARE_HOOK(isis_route_update_hook,
40 (struct isis_area * area, struct prefix *prefix,
41 struct isis_route_info *route_info),
8451921b 42 (area, prefix, route_info));
6cf38339 43
c951ee6e
RW
44void isis_nexthop_delete(struct isis_nexthop *nexthop);
45void adjinfo2nexthop(int family, struct list *nexthops,
d47d6089 46 struct isis_adjacency *adj, struct isis_sr_psid_info *sr,
c951ee6e 47 struct mpls_label_stack *label_stack);
d47d6089
RW
48struct isis_route_info *
49isis_route_create(struct prefix *prefix, struct prefix_ipv6 *src_p,
50 uint32_t cost, uint32_t depth, struct isis_sr_psid_info *sr,
e886416f
RW
51 struct list *adjacencies, bool allow_ecmp,
52 struct isis_area *area, struct route_table *table);
16fe8cff
RW
53void isis_route_delete(struct isis_area *area, struct route_node *rode,
54 struct route_table *table);
eb5d44eb 55
3dace42d
CF
56/* Walk the given table and install new routes to zebra and remove old ones.
57 * route status is tracked using ISIS_ROUTE_FLAG_ACTIVE */
c951ee6e
RW
58void isis_route_verify_table(struct isis_area *area, struct route_table *table,
59 struct route_table *table_backup);
3dace42d
CF
60
61/* Same as isis_route_verify_table, but merge L1 and L2 routes before */
62void isis_route_verify_merge(struct isis_area *area,
63 struct route_table *level1_table,
c951ee6e
RW
64 struct route_table *level1_table_backup,
65 struct route_table *level2_table,
66 struct route_table *level2_table_backup);
3dace42d
CF
67
68/* Unset ISIS_ROUTE_FLAG_ACTIVE on all routes. Used before running spf. */
d62a17ae 69void isis_route_invalidate_table(struct isis_area *area,
70 struct route_table *table);
eb5d44eb 71
c951ee6e
RW
72/* Cleanup route node when freeing routing table. */
73void isis_route_node_cleanup(struct route_table *table,
74 struct route_node *node);
75
694fa867
LS
76void isis_route_switchover_nexthop(struct isis_area *area,
77 struct route_table *table, int family,
78 union g_addr *nexthop_addr,
79 ifindex_t ifindex);
80
eb5d44eb 81#endif /* _ZEBRA_ISIS_ROUTE_H */