isis_spf.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * IS-IS Rout(e)ing protocol - isis_spf.h
  3. * IS-IS Shortest Path First algorithm
  4. *
  5. * Copyright (C) 2001,2002 Sampo Saaristo
  6. * Tampere University of Technology
  7. * Institute of Communications Engineering
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public Licenseas published by the Free
  11. * Software Foundation; either version 2 of the License, or (at your option)
  12. * any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,but WITHOUT
  15. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  17. * more details.
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. */
  22. #ifndef _ZEBRA_ISIS_SPF_H
  23. #define _ZEBRA_ISIS_SPF_H
  24. enum vertextype
  25. {
  26. VTYPE_PSEUDO_IS = 1,
  27. VTYPE_PSEUDO_TE_IS,
  28. VTYPE_NONPSEUDO_IS,
  29. VTYPE_NONPSEUDO_TE_IS,
  30. VTYPE_ES,
  31. VTYPE_IPREACH_INTERNAL,
  32. VTYPE_IPREACH_EXTERNAL,
  33. VTYPE_IPREACH_TE
  34. #ifdef HAVE_IPV6
  35. ,
  36. VTYPE_IP6REACH_INTERNAL,
  37. VTYPE_IP6REACH_EXTERNAL
  38. #endif /* HAVE_IPV6 */
  39. };
  40. /*
  41. * Triple <N, d(N), {Adj(N)}>
  42. */
  43. struct isis_vertex
  44. {
  45. enum vertextype type;
  46. union
  47. {
  48. u_char id[ISIS_SYS_ID_LEN + 1];
  49. struct prefix prefix;
  50. } N;
  51. u_int32_t d_N; /* d(N) Distance from this IS */
  52. u_int16_t depth; /* The depth in the imaginary tree */
  53. struct list *Adj_N; /* {Adj(N)} next hop or neighbor list */
  54. struct list *parents; /* list of parents for ECMP */
  55. struct list *children; /* list of children used for tree dump */
  56. };
  57. struct isis_spftree
  58. {
  59. struct thread *t_spf; /* spf threads */
  60. struct list *paths; /* the SPT */
  61. struct list *tents; /* TENT */
  62. struct isis_area *area; /* back pointer to area */
  63. int pending; /* already scheduled */
  64. unsigned int runcount; /* number of runs since uptime */
  65. time_t last_run_timestamp; /* last run timestamp for scheduling */
  66. time_t last_run_duration; /* last run duration in msec */
  67. };
  68. struct isis_spftree * isis_spftree_new (struct isis_area *area);
  69. void isis_spftree_del (struct isis_spftree *spftree);
  70. void isis_spftree_adj_del (struct isis_spftree *spftree,
  71. struct isis_adjacency *adj);
  72. void spftree_area_init (struct isis_area *area);
  73. void spftree_area_del (struct isis_area *area);
  74. void spftree_area_adj_del (struct isis_area *area,
  75. struct isis_adjacency *adj);
  76. int isis_spf_schedule (struct isis_area *area, int level);
  77. void isis_spf_cmds_init (void);
  78. #ifdef HAVE_IPV6
  79. int isis_spf_schedule6 (struct isis_area *area, int level);
  80. #endif
  81. #endif /* _ZEBRA_ISIS_SPF_H */