ospf_abr.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * OSPF ABR functions.
  3. * Copyright (C) 1999 Alex Zinin
  4. *
  5. * This file is part of GNU Zebra.
  6. *
  7. * GNU Zebra is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2, or (at your option) any
  10. * later version.
  11. *
  12. * GNU Zebra is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with GNU Zebra; see the file COPYING. If not, write to the Free
  19. * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  20. * 02111-1307, USA.
  21. */
  22. #ifndef _ZEBRA_OSPF_ABR_H
  23. #define _ZEBRA_OSPF_ABR_H
  24. #define OSPF_ABR_TASK_DELAY 7
  25. #define OSPF_AREA_RANGE_ADVERTISE (1 << 0)
  26. #define OSPF_AREA_RANGE_SUBSTITUTE (1 << 1)
  27. /* Area range. */
  28. struct ospf_area_range
  29. {
  30. /* Area range address. */
  31. struct in_addr addr;
  32. /* Area range masklen. */
  33. u_char masklen;
  34. /* Flags. */
  35. u_char flags;
  36. /* Number of more specific prefixes. */
  37. int specifics;
  38. /* Addr and masklen to substitute. */
  39. struct in_addr subst_addr;
  40. u_char subst_masklen;
  41. /* Range cost. */
  42. u_int32_t cost;
  43. /* Configured range cost. */
  44. u_int32_t cost_config;
  45. #define OSPF_AREA_RANGE_COST_UNSPEC -1U
  46. };
  47. /* Prototypes. */
  48. extern struct ospf_area_range *ospf_area_range_lookup (struct ospf_area *,
  49. struct prefix_ipv4 *);
  50. extern struct ospf_area_range *ospf_some_area_range_match (struct prefix_ipv4
  51. *);
  52. extern struct ospf_area_range *ospf_area_range_lookup_next (struct ospf_area
  53. *,
  54. struct in_addr *,
  55. int);
  56. extern int ospf_area_range_set (struct ospf *, struct in_addr,
  57. struct prefix_ipv4 *, int);
  58. extern int ospf_area_range_cost_set (struct ospf *, struct in_addr,
  59. struct prefix_ipv4 *, u_int32_t);
  60. extern int ospf_area_range_unset (struct ospf *, struct in_addr,
  61. struct prefix_ipv4 *);
  62. extern int ospf_area_range_substitute_set (struct ospf *, struct in_addr,
  63. struct prefix_ipv4 *,
  64. struct prefix_ipv4 *);
  65. extern int ospf_area_range_substitute_unset (struct ospf *, struct in_addr,
  66. struct prefix_ipv4 *);
  67. extern struct ospf_area_range *ospf_area_range_match_any (struct ospf *,
  68. struct prefix_ipv4
  69. *);
  70. extern int ospf_area_range_active (struct ospf_area_range *);
  71. extern int ospf_act_bb_connection (struct ospf *);
  72. extern void ospf_check_abr_status (struct ospf *);
  73. extern void ospf_abr_task (struct ospf *);
  74. extern void ospf_schedule_abr_task (struct ospf *);
  75. extern void ospf_abr_announce_network_to_area (struct prefix_ipv4 *,
  76. u_int32_t,
  77. struct ospf_area *);
  78. #endif /* _ZEBRA_OSPF_ABR_H */