1/*
2 * Copyright (C) 1999 Yasuhiro Ohara
3 *
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
25#include "prefix.h"
26
27/* Transit Vertex */
28struct ospf6_vertex
29{
30  /* type of this vertex */
31  u_int8_t type;
32
33  /* Vertex Identifier */
34  struct prefix_ls vertex_id;
35
36  /* Identifier String */
37  char string[128];
38
39  /* Associated LSA */
40  struct ospf6_lsa *lsa;
41
42  /* Distance from Root (Cost) */
43  u_int16_t distance;
44
45  /* Depth of this node */
46  u_char depth;
47
48  /* nexthops to this node */
49  struct linklist *nexthop_list;
50
51  /* upper nodes in spf tree */
52  list parent_list;
53
54  /* lower nodes in spf tree */
55  list path_list;
56
57  /* capability bits */
58  u_char capability_bits;
59
60  /* Optional capabilities */
61  u_char opt_capability[3];
62};
63
64#define OSPF6_VERTEX_TYPE_ROUTER  0x01
65#define OSPF6_VERTEX_TYPE_NETWORK 0x02
66
67struct ospf6_spftree
68{
69  /* calculation thread */
70  struct thread *t_spf_calculation;
71
72  /* root of this tree */
73  struct ospf6_vertex *root;
74
75  /* list for search */
76  list list;
77
78  /* statistics */
79  u_int32_t timerun;
80
81  struct timeval runtime_total;
82  struct timeval runtime_min;
83  struct timeval runtime_max;
84
85  struct timeval updated_time;
86  struct timeval interval_total;
87  struct timeval interval_min;
88  struct timeval interval_max;
89};
90
91int ospf6_spf_calculate_route (void *);
92
93void
94ospf6_spf_calculation_schedule (u_int32_t area_id);
95struct ospf6_spftree *ospf6_spftree_create ();
96void
97ospf6_spf_statistics_show (struct vty *vty, struct ospf6_spftree *spf_tree);
98void ospf6_spftree_delete (struct ospf6_spftree *spf_tree);
99
100void ospf6_spf_database_hook (struct ospf6_lsa *old, struct ospf6_lsa *new);
101
102void ospf6_spf_init ();
103
104#endif /* OSPF6_SPF_H */
105
106