ospf6_asbr.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (C) 2001 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_ASBR_H
  22. #define OSPF6_ASBR_H
  23. /* Debug option */
  24. extern unsigned char conf_debug_ospf6_asbr;
  25. #define OSPF6_DEBUG_ASBR_ON() \
  26. (conf_debug_ospf6_asbr = 1)
  27. #define OSPF6_DEBUG_ASBR_OFF() \
  28. (conf_debug_ospf6_asbr = 0)
  29. #define IS_OSPF6_DEBUG_ASBR \
  30. (conf_debug_ospf6_asbr)
  31. struct ospf6_external_info
  32. {
  33. /* External route type */
  34. int type;
  35. /* Originating Link State ID */
  36. u_int32_t id;
  37. struct in6_addr forwarding;
  38. /* u_int32_t tag; */
  39. };
  40. /* AS-External-LSA */
  41. struct ospf6_as_external_lsa
  42. {
  43. u_int32_t bits_metric;
  44. struct ospf6_prefix prefix;
  45. /* followed by none or one forwarding address */
  46. /* followed by none or one external route tag */
  47. /* followed by none or one referenced LS-ID */
  48. };
  49. #define OSPF6_ASBR_BIT_T ntohl (0x01000000)
  50. #define OSPF6_ASBR_BIT_F ntohl (0x02000000)
  51. #define OSPF6_ASBR_BIT_E ntohl (0x04000000)
  52. #define OSPF6_ASBR_METRIC(E) (ntohl ((E)->bits_metric & htonl (0x00ffffff)))
  53. #define OSPF6_ASBR_METRIC_SET(E,C) \
  54. { (E)->bits_metric &= htonl (0xff000000); \
  55. (E)->bits_metric |= htonl (0x00ffffff) & htonl (C); }
  56. void ospf6_asbr_lsa_add (struct ospf6_lsa *lsa);
  57. void ospf6_asbr_lsa_remove (struct ospf6_lsa *lsa);
  58. void ospf6_asbr_lsentry_add (struct ospf6_route *asbr_entry);
  59. void ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry);
  60. int ospf6_asbr_is_asbr (struct ospf6 *o);
  61. void
  62. ospf6_asbr_redistribute_add (int type, int ifindex, struct prefix *prefix,
  63. u_int nexthop_num, struct in6_addr *nexthop);
  64. void
  65. ospf6_asbr_redistribute_remove (int type, int ifindex, struct prefix *prefix);
  66. int ospf6_redistribute_config_write (struct vty *vty);
  67. void ospf6_asbr_init ();
  68. int config_write_ospf6_debug_asbr (struct vty *vty);
  69. void install_element_ospf6_debug_asbr ();
  70. #endif /* OSPF6_ASBR_H */