1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * IS-IS Rout(e)ing protocol - isis_route.h
5 * Copyright (C) 2001,2002 Sampo Saaristo
6 * Tampere University of Technology
7 * Institute of Communications Engineering
9 * based on ../ospf6d/ospf6_route.[ch]
12 #ifndef _ZEBRA_ISIS_ROUTE_H
13 #define _ZEBRA_ISIS_ROUTE_H
15 #include "lib/nexthop.h"
21 uint8_t sysid
[ISIS_SYS_ID_LEN
];
22 struct isis_sr_psid_info sr
;
23 struct mpls_label_stack
*label_stack
;
26 struct isis_route_info
{
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 */
33 struct isis_sr_psid_info sr
;
34 struct isis_sr_psid_info sr_previous
;
35 struct list
*nexthops
;
36 struct isis_route_info
*backup
;
39 DECLARE_HOOK(isis_route_update_hook
,
40 (struct isis_area
* area
, struct prefix
*prefix
,
41 struct isis_route_info
*route_info
),
42 (area
, prefix
, route_info
));
44 void isis_nexthop_delete(struct isis_nexthop
*nexthop
);
45 void adjinfo2nexthop(int family
, struct list
*nexthops
,
46 struct isis_adjacency
*adj
, struct isis_sr_psid_info
*sr
,
47 struct mpls_label_stack
*label_stack
);
48 struct isis_route_info
*
49 isis_route_create(struct prefix
*prefix
, struct prefix_ipv6
*src_p
,
50 uint32_t cost
, uint32_t depth
, struct isis_sr_psid_info
*sr
,
51 struct list
*adjacencies
, bool allow_ecmp
,
52 struct isis_area
*area
, struct route_table
*table
);
53 void isis_route_delete(struct isis_area
*area
, struct route_node
*rode
,
54 struct route_table
*table
);
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 */
58 void isis_route_verify_table(struct isis_area
*area
, struct route_table
*table
,
59 struct route_table
*table_backup
);
61 /* Same as isis_route_verify_table, but merge L1 and L2 routes before */
62 void isis_route_verify_merge(struct isis_area
*area
,
63 struct route_table
*level1_table
,
64 struct route_table
*level1_table_backup
,
65 struct route_table
*level2_table
,
66 struct route_table
*level2_table_backup
);
68 /* Unset ISIS_ROUTE_FLAG_ACTIVE on all routes. Used before running spf. */
69 void isis_route_invalidate_table(struct isis_area
*area
,
70 struct route_table
*table
);
72 /* Cleanup route node when freeing routing table. */
73 void isis_route_node_cleanup(struct route_table
*table
,
74 struct route_node
*node
);
76 void isis_route_switchover_nexthop(struct isis_area
*area
,
77 struct route_table
*table
, int family
,
78 union g_addr
*nexthop_addr
,
81 #endif /* _ZEBRA_ISIS_ROUTE_H */