blob: 6c40424fdbd22244254b46e582f553fc9bd85279 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
hasso508e53e2004-05-18 18:57:06 +00002 * Copyright (C) 2003 Yasuhiro Ohara
paul718e3742002-12-13 20:15:29 +00003 *
4 * This file is part of GNU Zebra.
5 *
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Zebra; see the file COPYING. If not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
22#ifndef OSPF6_SPF_H
23#define OSPF6_SPF_H
24
Dinesh Dutt3810e062013-08-24 07:54:09 +000025#include "ospf6_top.h"
26
hasso508e53e2004-05-18 18:57:06 +000027/* Debug option */
28extern unsigned char conf_debug_ospf6_spf;
hasso3b687352004-08-19 06:56:53 +000029#define OSPF6_DEBUG_SPF_PROCESS 0x01
30#define OSPF6_DEBUG_SPF_TIME 0x02
hasso2680aa22004-11-25 20:54:46 +000031#define OSPF6_DEBUG_SPF_DATABASE 0x04
hasso508e53e2004-05-18 18:57:06 +000032#define OSPF6_DEBUG_SPF_ON(level) \
33 (conf_debug_ospf6_spf |= (level))
34#define OSPF6_DEBUG_SPF_OFF(level) \
35 (conf_debug_ospf6_spf &= ~(level))
36#define IS_OSPF6_DEBUG_SPF(level) \
37 (conf_debug_ospf6_spf & OSPF6_DEBUG_SPF_ ## level)
paul718e3742002-12-13 20:15:29 +000038
39/* Transit Vertex */
40struct ospf6_vertex
41{
42 /* type of this vertex */
43 u_int8_t type;
44
45 /* Vertex Identifier */
hasso508e53e2004-05-18 18:57:06 +000046 struct prefix vertex_id;
paul718e3742002-12-13 20:15:29 +000047
48 /* Identifier String */
hasso508e53e2004-05-18 18:57:06 +000049 char name[128];
50
51 /* Associated Area */
52 struct ospf6_area *area;
paul718e3742002-12-13 20:15:29 +000053
54 /* Associated LSA */
55 struct ospf6_lsa *lsa;
56
hasso508e53e2004-05-18 18:57:06 +000057 /* Distance from Root (i.e. Cost) */
58 u_int32_t cost;
paul718e3742002-12-13 20:15:29 +000059
hasso508e53e2004-05-18 18:57:06 +000060 /* Router hops to this node */
61 u_char hops;
paul718e3742002-12-13 20:15:29 +000062
63 /* nexthops to this node */
hasso508e53e2004-05-18 18:57:06 +000064 struct ospf6_nexthop nexthop[OSPF6_MULTI_PATH_LIMIT];
paul718e3742002-12-13 20:15:29 +000065
66 /* capability bits */
hasso508e53e2004-05-18 18:57:06 +000067 u_char capability;
paul718e3742002-12-13 20:15:29 +000068
69 /* Optional capabilities */
hasso508e53e2004-05-18 18:57:06 +000070 u_char options[3];
71
72 /* For tree display */
73 struct ospf6_vertex *parent;
hasso52dc7ee2004-09-23 19:18:23 +000074 struct list *child_list;
paul718e3742002-12-13 20:15:29 +000075};
76
77#define OSPF6_VERTEX_TYPE_ROUTER 0x01
78#define OSPF6_VERTEX_TYPE_NETWORK 0x02
hasso508e53e2004-05-18 18:57:06 +000079#define VERTEX_IS_TYPE(t, v) \
80 ((v)->type == OSPF6_VERTEX_TYPE_ ## t ? 1 : 0)
paul718e3742002-12-13 20:15:29 +000081
Paul Jakma6ac29a52008-08-15 13:45:30 +010082extern void ospf6_spf_table_finish (struct ospf6_route_table *result_table);
83extern void ospf6_spf_calculation (u_int32_t router_id,
84 struct ospf6_route_table *result_table,
85 struct ospf6_area *oa);
Dinesh Dutt3810e062013-08-24 07:54:09 +000086extern void ospf6_spf_schedule (struct ospf6 *ospf);
paul718e3742002-12-13 20:15:29 +000087
Paul Jakma6ac29a52008-08-15 13:45:30 +010088extern void ospf6_spf_display_subtree (struct vty *vty, const char *prefix,
89 int rest, struct ospf6_vertex *v);
paul718e3742002-12-13 20:15:29 +000090
Dinesh Dutt3810e062013-08-24 07:54:09 +000091extern void ospf6_spf_config_write (struct vty *vty);
Paul Jakma6ac29a52008-08-15 13:45:30 +010092extern int config_write_ospf6_debug_spf (struct vty *vty);
93extern void install_element_ospf6_debug_spf (void);
94extern void ospf6_spf_init (void);
paul718e3742002-12-13 20:15:29 +000095
96#endif /* OSPF6_SPF_H */
97