paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 2 | * Copyright (C) 2003 Yasuhiro Ohara |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 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 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 25 | /* Debug option */ |
| 26 | extern unsigned char conf_debug_ospf6_spf; |
| 27 | #define OSPF6_DEBUG_SPF_SUMMARY 0x01 |
| 28 | #define OSPF6_DEBUG_SPF_DETAIL 0x02 |
| 29 | #define OSPF6_DEBUG_SPF_ON(level) \ |
| 30 | (conf_debug_ospf6_spf |= (level)) |
| 31 | #define OSPF6_DEBUG_SPF_OFF(level) \ |
| 32 | (conf_debug_ospf6_spf &= ~(level)) |
| 33 | #define IS_OSPF6_DEBUG_SPF(level) \ |
| 34 | (conf_debug_ospf6_spf & OSPF6_DEBUG_SPF_ ## level) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 35 | |
| 36 | /* Transit Vertex */ |
| 37 | struct ospf6_vertex |
| 38 | { |
| 39 | /* type of this vertex */ |
| 40 | u_int8_t type; |
| 41 | |
| 42 | /* Vertex Identifier */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 43 | struct prefix vertex_id; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 44 | |
| 45 | /* Identifier String */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 46 | char name[128]; |
| 47 | |
| 48 | /* Associated Area */ |
| 49 | struct ospf6_area *area; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 50 | |
| 51 | /* Associated LSA */ |
| 52 | struct ospf6_lsa *lsa; |
| 53 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 54 | /* Distance from Root (i.e. Cost) */ |
| 55 | u_int32_t cost; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 56 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 57 | /* Router hops to this node */ |
| 58 | u_char hops; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 59 | |
| 60 | /* nexthops to this node */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 61 | struct ospf6_nexthop nexthop[OSPF6_MULTI_PATH_LIMIT]; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 62 | |
| 63 | /* capability bits */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 64 | u_char capability; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 65 | |
| 66 | /* Optional capabilities */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 67 | u_char options[3]; |
| 68 | |
| 69 | /* For tree display */ |
| 70 | struct ospf6_vertex *parent; |
| 71 | list child_list; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 72 | }; |
| 73 | |
| 74 | #define OSPF6_VERTEX_TYPE_ROUTER 0x01 |
| 75 | #define OSPF6_VERTEX_TYPE_NETWORK 0x02 |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 76 | #define VERTEX_IS_TYPE(t, v) \ |
| 77 | ((v)->type == OSPF6_VERTEX_TYPE_ ## t ? 1 : 0) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 78 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 79 | void ospf6_spf_table_finish (struct ospf6_route_table *result_table); |
| 80 | void ospf6_spf_calculation (u_int32_t router_id, |
| 81 | struct ospf6_route_table *result_table, |
| 82 | struct ospf6_area *oa); |
| 83 | void ospf6_spf_schedule (struct ospf6_area *oa); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 84 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 85 | void ospf6_spf_display_subtree (struct vty *vty, char *prefix, |
| 86 | int rest, struct ospf6_vertex *v); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 87 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 88 | int config_write_ospf6_debug_spf (struct vty *vty); |
| 89 | void install_element_ospf6_debug_spf (); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 90 | void ospf6_spf_init (); |
| 91 | |
| 92 | #endif /* OSPF6_SPF_H */ |
| 93 | |