paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 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 | |
| 22 | #ifndef OSPF6_ASBR_H |
| 23 | #define OSPF6_ASBR_H |
| 24 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 25 | /* Debug option */ |
| 26 | extern unsigned char conf_debug_ospf6_asbr; |
| 27 | #define OSPF6_DEBUG_ASBR_ON() \ |
| 28 | (conf_debug_ospf6_asbr = 1) |
| 29 | #define OSPF6_DEBUG_ASBR_OFF() \ |
| 30 | (conf_debug_ospf6_asbr = 0) |
| 31 | #define IS_OSPF6_DEBUG_ASBR \ |
| 32 | (conf_debug_ospf6_asbr) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 33 | |
| 34 | struct ospf6_external_info |
| 35 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 36 | /* External route type */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 37 | int type; |
| 38 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 39 | /* Originating Link State ID */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 40 | u_int32_t id; |
| 41 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 42 | struct in6_addr forwarding; |
| 43 | /* u_int32_t tag; */ |
| 44 | }; |
| 45 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 46 | /* AS-External-LSA */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 47 | struct ospf6_as_external_lsa |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 48 | { |
| 49 | u_int32_t bits_metric; |
| 50 | |
| 51 | struct ospf6_prefix prefix; |
| 52 | /* followed by none or one forwarding address */ |
| 53 | /* followed by none or one external route tag */ |
| 54 | /* followed by none or one referenced LS-ID */ |
| 55 | }; |
| 56 | |
| 57 | #define OSPF6_ASBR_BIT_T ntohl (0x01000000) |
| 58 | #define OSPF6_ASBR_BIT_F ntohl (0x02000000) |
| 59 | #define OSPF6_ASBR_BIT_E ntohl (0x04000000) |
| 60 | |
| 61 | #define OSPF6_ASBR_METRIC(E) (ntohl ((E)->bits_metric & htonl (0x00ffffff))) |
| 62 | #define OSPF6_ASBR_METRIC_SET(E,C) \ |
| 63 | { (E)->bits_metric &= htonl (0xff000000); \ |
| 64 | (E)->bits_metric |= htonl (0x00ffffff) & htonl (C); } |
| 65 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 66 | extern void ospf6_asbr_lsa_add (struct ospf6_lsa *lsa); |
| 67 | extern void ospf6_asbr_lsa_remove (struct ospf6_lsa *lsa); |
| 68 | extern void ospf6_asbr_lsentry_add (struct ospf6_route *asbr_entry); |
| 69 | extern void ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 70 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 71 | extern int ospf6_asbr_is_asbr (struct ospf6 *o); |
| 72 | extern void ospf6_asbr_redistribute_add (int type, int ifindex, |
| 73 | struct prefix *prefix, |
| 74 | u_int nexthop_num, |
| 75 | struct in6_addr *nexthop); |
| 76 | extern void ospf6_asbr_redistribute_remove (int type, int ifindex, |
| 77 | struct prefix *prefix); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 78 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 79 | extern int ospf6_redistribute_config_write (struct vty *vty); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 80 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 81 | extern void ospf6_asbr_init (void); |
Tom Goff | ae2254a | 2010-11-10 13:01:41 -0800 | [diff] [blame^] | 82 | extern void ospf6_asbr_terminate (void); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 83 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 84 | extern int config_write_ospf6_debug_asbr (struct vty *vty); |
| 85 | extern void install_element_ospf6_debug_asbr (void); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 86 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 87 | #endif /* OSPF6_ASBR_H */ |