ospf6_spf.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright (C) 2003 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. #ifndef OSPF6_SPF_H
  22. #define OSPF6_SPF_H
  23. /* Debug option */
  24. extern unsigned char conf_debug_ospf6_spf;
  25. #define OSPF6_DEBUG_SPF_PROCESS 0x01
  26. #define OSPF6_DEBUG_SPF_TIME 0x02
  27. #define OSPF6_DEBUG_SPF_DATABASE 0x04
  28. #define OSPF6_DEBUG_SPF_ON(level) \
  29. (conf_debug_ospf6_spf |= (level))
  30. #define OSPF6_DEBUG_SPF_OFF(level) \
  31. (conf_debug_ospf6_spf &= ~(level))
  32. #define IS_OSPF6_DEBUG_SPF(level) \
  33. (conf_debug_ospf6_spf & OSPF6_DEBUG_SPF_ ## level)
  34. /* Transit Vertex */
  35. struct ospf6_vertex
  36. {
  37. /* type of this vertex */
  38. u_int8_t type;
  39. /* Vertex Identifier */
  40. struct prefix vertex_id;
  41. /* Identifier String */
  42. char name[128];
  43. /* Associated Area */
  44. struct ospf6_area *area;
  45. /* Associated LSA */
  46. struct ospf6_lsa *lsa;
  47. /* Distance from Root (i.e. Cost) */
  48. u_int32_t cost;
  49. /* Router hops to this node */
  50. u_char hops;
  51. /* nexthops to this node */
  52. struct ospf6_nexthop nexthop[OSPF6_MULTI_PATH_LIMIT];
  53. /* capability bits */
  54. u_char capability;
  55. /* Optional capabilities */
  56. u_char options[3];
  57. /* For tree display */
  58. struct ospf6_vertex *parent;
  59. struct list *child_list;
  60. };
  61. #define OSPF6_VERTEX_TYPE_ROUTER 0x01
  62. #define OSPF6_VERTEX_TYPE_NETWORK 0x02
  63. #define VERTEX_IS_TYPE(t, v) \
  64. ((v)->type == OSPF6_VERTEX_TYPE_ ## t ? 1 : 0)
  65. void ospf6_spf_table_finish (struct ospf6_route_table *result_table);
  66. void ospf6_spf_calculation (u_int32_t router_id,
  67. struct ospf6_route_table *result_table,
  68. struct ospf6_area *oa);
  69. void ospf6_spf_schedule (struct ospf6_area *oa);
  70. void ospf6_spf_display_subtree (struct vty *vty, const char *prefix,
  71. int rest, struct ospf6_vertex *v);
  72. int config_write_ospf6_debug_spf (struct vty *vty);
  73. void install_element_ospf6_debug_spf ();
  74. void ospf6_spf_init ();
  75. #endif /* OSPF6_SPF_H */