]>
Commit | Line | Data |
---|---|---|
acddc0ed | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
eb5d44eb | 2 | /* |
3 | * IS-IS Rout(e)ing protocol - isis_spf.h | |
d62a17ae | 4 | * IS-IS Shortest Path First algorithm |
eb5d44eb | 5 | * |
6 | * Copyright (C) 2001,2002 Sampo Saaristo | |
d62a17ae | 7 | * Tampere University of Technology |
eb5d44eb | 8 | * Institute of Communications Engineering |
eb5d44eb | 9 | */ |
10 | ||
11 | #ifndef _ZEBRA_ISIS_SPF_H | |
12 | #define _ZEBRA_ISIS_SPF_H | |
13 | ||
c951ee6e RW |
14 | #include "isisd/isis_lfa.h" |
15 | ||
02cd317e | 16 | struct isis_spftree; |
eb5d44eb | 17 | |
75aa7aa1 RW |
18 | enum spf_type { |
19 | SPF_TYPE_FORWARD = 1, | |
20 | SPF_TYPE_REVERSE, | |
16fe8cff | 21 | SPF_TYPE_RLFA, |
c951ee6e | 22 | SPF_TYPE_TI_LFA, |
75aa7aa1 RW |
23 | }; |
24 | ||
7b36d36e RW |
25 | struct isis_spf_adj { |
26 | uint8_t id[ISIS_SYS_ID_LEN + 1]; | |
27 | struct isis_adjacency *adj; | |
28 | uint32_t metric; | |
29 | struct isis_ext_subtlvs *subtlvs; | |
2d560b3d | 30 | struct isis_lsp *lsp; |
7b36d36e RW |
31 | struct { |
32 | uint8_t desig_is_id[ISIS_SYS_ID_LEN + 1]; | |
7b36d36e RW |
33 | } lan; |
34 | uint8_t flags; | |
35 | #define F_ISIS_SPF_ADJ_BROADCAST 0x01 | |
36 | #define F_ISIS_SPF_ADJ_OLDMETRIC 0x02 | |
e886416f | 37 | #define F_ISIS_SPF_ADJ_METRIC_INFINITY 0x04 |
7b36d36e RW |
38 | }; |
39 | ||
40 | struct isis_spftree *isis_spftree_new(struct isis_area *area, | |
41 | struct lspdb_head *lspdb, | |
42 | const uint8_t *sysid, int level, | |
75aa7aa1 RW |
43 | enum spf_tree_id tree_id, |
44 | enum spf_type type, uint8_t flags); | |
2f7cc7bc RW |
45 | struct isis_vertex *isis_spf_prefix_sid_lookup(struct isis_spftree *spftree, |
46 | struct isis_prefix_sid *psid); | |
3dace42d CF |
47 | void isis_spf_invalidate_routes(struct isis_spftree *tree); |
48 | void isis_spf_verify_routes(struct isis_area *area, | |
49 | struct isis_spftree **trees); | |
694fa867 LS |
50 | void isis_spf_switchover_routes(struct isis_area *area, |
51 | struct isis_spftree **trees, int family, | |
52 | union g_addr *nexthop_ip, ifindex_t ifindex, | |
53 | int level); | |
d62a17ae | 54 | void isis_spftree_del(struct isis_spftree *spftree); |
55 | void spftree_area_init(struct isis_area *area); | |
56 | void spftree_area_del(struct isis_area *area); | |
c951ee6e RW |
57 | struct isis_lsp *isis_root_system_lsp(struct lspdb_head *lspdb, |
58 | const uint8_t *sysid); | |
d62db30d CF |
59 | #define isis_spf_schedule(area, level) \ |
60 | _isis_spf_schedule((area), (level), __func__, \ | |
61 | __FILE__, __LINE__) | |
62 | int _isis_spf_schedule(struct isis_area *area, int level, | |
63 | const char *func, const char *file, int line); | |
52a7c25e | 64 | void isis_print_spftree(struct vty *vty, struct isis_spftree *spftree); |
c951ee6e | 65 | void isis_print_routes(struct vty *vty, struct isis_spftree *spftree, |
d47d6089 | 66 | bool prefix_sid, bool backup); |
56ea2b21 | 67 | void isis_spf_init(void); |
02cd317e | 68 | void isis_spf_print(struct isis_spftree *spftree, struct vty *vty); |
471bb5da JG |
69 | void isis_spf_print_json(struct isis_spftree *spftree, |
70 | struct json_object *json); | |
7b36d36e | 71 | void isis_run_spf(struct isis_spftree *spftree); |
b30e837b CF |
72 | struct isis_spftree *isis_run_hopcount_spf(struct isis_area *area, |
73 | uint8_t *sysid, | |
74 | struct isis_spftree *spftree); | |
c951ee6e | 75 | |
8f15843b | 76 | void isis_spf_timer_free(void *run); |
eb5d44eb | 77 | #endif /* _ZEBRA_ISIS_SPF_H */ |