ospf6_lsdb.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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_LSDB_H
  22. #define OSPF6_LSDB_H
  23. #include "prefix.h"
  24. #include "table.h"
  25. struct ospf6_lsdb
  26. {
  27. void *data; /* data structure that holds this lsdb */
  28. struct route_table *table;
  29. u_int32_t count;
  30. void (*hook_add) (struct ospf6_lsa *);
  31. void (*hook_remove) (struct ospf6_lsa *);
  32. };
  33. /* Function Prototypes */
  34. extern struct ospf6_lsdb *ospf6_lsdb_create (void *data);
  35. extern void ospf6_lsdb_delete (struct ospf6_lsdb *lsdb);
  36. extern struct ospf6_lsa *ospf6_lsdb_lookup (u_int16_t type, u_int32_t id,
  37. u_int32_t adv_router,
  38. struct ospf6_lsdb *lsdb);
  39. extern struct ospf6_lsa *ospf6_lsdb_lookup_next (u_int16_t type, u_int32_t id,
  40. u_int32_t adv_router,
  41. struct ospf6_lsdb *lsdb);
  42. extern void ospf6_lsdb_add (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb);
  43. extern void ospf6_lsdb_remove (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb);
  44. extern struct ospf6_lsa *ospf6_lsdb_head (struct ospf6_lsdb *lsdb);
  45. extern struct ospf6_lsa *ospf6_lsdb_next (struct ospf6_lsa *lsa);
  46. extern struct ospf6_lsa *ospf6_lsdb_type_router_head (u_int16_t type,
  47. u_int32_t adv_router,
  48. struct ospf6_lsdb *lsdb);
  49. extern struct ospf6_lsa *ospf6_lsdb_type_router_next (u_int16_t type,
  50. u_int32_t adv_router,
  51. struct ospf6_lsa *lsa);
  52. extern struct ospf6_lsa *ospf6_lsdb_type_head (u_int16_t type,
  53. struct ospf6_lsdb *lsdb);
  54. extern struct ospf6_lsa *ospf6_lsdb_type_next (u_int16_t type,
  55. struct ospf6_lsa *lsa);
  56. extern void ospf6_lsdb_remove_all (struct ospf6_lsdb *lsdb);
  57. extern void ospf6_lsdb_lsa_unlock (struct ospf6_lsa *lsa);
  58. enum ospf_lsdb_show_level {
  59. OSPF6_LSDB_SHOW_LEVEL_NORMAL = 0,
  60. OSPF6_LSDB_SHOW_LEVEL_DETAIL,
  61. OSPF6_LSDB_SHOW_LEVEL_INTERNAL,
  62. OSPF6_LSDB_SHOW_LEVEL_DUMP,
  63. };
  64. extern void ospf6_lsdb_show (struct vty *vty,
  65. enum ospf_lsdb_show_level level, u_int16_t *type,
  66. u_int32_t *id, u_int32_t *adv_router,
  67. struct ospf6_lsdb *lsdb);
  68. extern u_int32_t ospf6_new_ls_id (u_int16_t type, u_int32_t adv_router,
  69. struct ospf6_lsdb *lsdb);
  70. extern u_int32_t ospf6_new_ls_seqnum (u_int16_t type, u_int32_t id,
  71. u_int32_t adv_router,
  72. struct ospf6_lsdb *lsdb);
  73. extern int ospf6_lsdb_maxage_remover (struct ospf6_lsdb *lsdb);
  74. #endif /* OSPF6_LSDB_H */