]>
Commit | Line | Data |
---|---|---|
eb5d44eb | 1 | /* |
2 | * IS-IS Rout(e)ing protocol - isis_route.h | |
3 | * | |
4 | * Copyright (C) 2001,2002 Sampo Saaristo | |
d62a17ae | 5 | * Tampere University of Technology |
eb5d44eb | 6 | * Institute of Communications Engineering |
7 | * | |
8 | * based on ../ospf6d/ospf6_route.[ch] | |
9 | * by Yasuhiro Ohara | |
10 | * | |
d62a17ae | 11 | * This program is free software; you can redistribute it and/or modify it |
12 | * under the terms of the GNU General Public Licenseas published by the Free | |
13 | * Software Foundation; either version 2 of the License, or (at your option) | |
eb5d44eb | 14 | * any later version. |
15 | * | |
d62a17ae | 16 | * This program is distributed in the hope that it will be useful,but WITHOUT |
17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
18 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
eb5d44eb | 19 | * more details. |
896014f4 DL |
20 | * |
21 | * You should have received a copy of the GNU General Public License along | |
22 | * with this program; see the file COPYING; if not, write to the Free Software | |
23 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
eb5d44eb | 24 | */ |
25 | #ifndef _ZEBRA_ISIS_ROUTE_H | |
26 | #define _ZEBRA_ISIS_ROUTE_H | |
27 | ||
363be4dd | 28 | #include "lib/nexthop.h" |
eb5d44eb | 29 | |
d62a17ae | 30 | struct isis_nexthop { |
31 | ifindex_t ifindex; | |
363be4dd RW |
32 | int family; |
33 | union g_addr ip; | |
26f6acaf | 34 | uint8_t sysid[ISIS_SYS_ID_LEN]; |
d47d6089 | 35 | struct isis_sr_psid_info sr; |
c951ee6e | 36 | struct mpls_label_stack *label_stack; |
eb5d44eb | 37 | }; |
38 | ||
d62a17ae | 39 | struct isis_route_info { |
3f045a08 JB |
40 | #define ISIS_ROUTE_FLAG_ACTIVE 0x01 /* active route for the prefix */ |
41 | #define ISIS_ROUTE_FLAG_ZEBRA_SYNCED 0x02 /* set when route synced to zebra */ | |
42 | #define ISIS_ROUTE_FLAG_ZEBRA_RESYNC 0x04 /* set when route needs to sync */ | |
d7c0a89a QY |
43 | uint8_t flag; |
44 | uint32_t cost; | |
45 | uint32_t depth; | |
d47d6089 RW |
46 | struct isis_sr_psid_info sr; |
47 | struct isis_sr_psid_info sr_previous; | |
d62a17ae | 48 | struct list *nexthops; |
c951ee6e | 49 | struct isis_route_info *backup; |
eb5d44eb | 50 | }; |
51 | ||
6cf38339 RW |
52 | DECLARE_HOOK(isis_route_update_hook, |
53 | (struct isis_area * area, struct prefix *prefix, | |
54 | struct isis_route_info *route_info), | |
55 | (area, prefix, route_info)) | |
56 | ||
c951ee6e RW |
57 | void isis_nexthop_delete(struct isis_nexthop *nexthop); |
58 | void adjinfo2nexthop(int family, struct list *nexthops, | |
d47d6089 | 59 | struct isis_adjacency *adj, struct isis_sr_psid_info *sr, |
c951ee6e | 60 | struct mpls_label_stack *label_stack); |
d47d6089 RW |
61 | struct isis_route_info * |
62 | isis_route_create(struct prefix *prefix, struct prefix_ipv6 *src_p, | |
63 | uint32_t cost, uint32_t depth, struct isis_sr_psid_info *sr, | |
e886416f RW |
64 | struct list *adjacencies, bool allow_ecmp, |
65 | struct isis_area *area, struct route_table *table); | |
16fe8cff RW |
66 | void isis_route_delete(struct isis_area *area, struct route_node *rode, |
67 | struct route_table *table); | |
eb5d44eb | 68 | |
3dace42d CF |
69 | /* Walk the given table and install new routes to zebra and remove old ones. |
70 | * route status is tracked using ISIS_ROUTE_FLAG_ACTIVE */ | |
c951ee6e RW |
71 | void isis_route_verify_table(struct isis_area *area, struct route_table *table, |
72 | struct route_table *table_backup); | |
3dace42d CF |
73 | |
74 | /* Same as isis_route_verify_table, but merge L1 and L2 routes before */ | |
75 | void isis_route_verify_merge(struct isis_area *area, | |
76 | struct route_table *level1_table, | |
c951ee6e RW |
77 | struct route_table *level1_table_backup, |
78 | struct route_table *level2_table, | |
79 | struct route_table *level2_table_backup); | |
3dace42d CF |
80 | |
81 | /* Unset ISIS_ROUTE_FLAG_ACTIVE on all routes. Used before running spf. */ | |
d62a17ae | 82 | void isis_route_invalidate_table(struct isis_area *area, |
83 | struct route_table *table); | |
eb5d44eb | 84 | |
c951ee6e RW |
85 | /* Cleanup route node when freeing routing table. */ |
86 | void isis_route_node_cleanup(struct route_table *table, | |
87 | struct route_node *node); | |
88 | ||
eb5d44eb | 89 | #endif /* _ZEBRA_ISIS_ROUTE_H */ |