paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 2 | * Copyright (C) 2003 Yasuhiro Ohara |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 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 OSPF_AREA_H |
| 23 | #define OSPF_AREA_H |
| 24 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 25 | #include "ospf6_top.h" |
| 26 | |
| 27 | struct ospf6_area |
| 28 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 29 | /* Reference to Top data structure */ |
| 30 | struct ospf6 *ospf6; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 31 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 32 | /* Area-ID */ |
| 33 | u_int32_t area_id; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 34 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 35 | /* Area-ID string */ |
| 36 | char name[16]; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 37 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 38 | /* flag */ |
| 39 | u_char flag; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 40 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 41 | /* OSPF Option */ |
| 42 | u_char options[3]; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 43 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 44 | /* Summary routes to be originated (includes Configured Address Ranges) */ |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 45 | struct ospf6_route_table *range_table; |
| 46 | struct ospf6_route_table *summary_prefix; |
| 47 | struct ospf6_route_table *summary_router; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 48 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 49 | /* OSPF interface list */ |
| 50 | list if_list; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 51 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 52 | struct ospf6_lsdb *lsdb; |
| 53 | struct ospf6_lsdb *lsdb_self; |
| 54 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 55 | struct ospf6_route_table *spf_table; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 56 | struct ospf6_route_table *route_table; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 57 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 58 | struct thread *thread_spf_calculation; |
| 59 | struct thread *thread_route_calculation; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 60 | |
| 61 | struct thread *thread_router_lsa; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 62 | struct thread *thread_intra_prefix_lsa; |
| 63 | u_int32_t router_lsa_size_limit; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 64 | }; |
| 65 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 66 | #define OSPF6_AREA_ENABLE 0x01 |
| 67 | #define OSPF6_AREA_ACTIVE 0x02 |
| 68 | #define OSPF6_AREA_TRANSIT 0x04 /* TransitCapability */ |
| 69 | #define OSPF6_AREA_STUB 0x08 |
| 70 | |
| 71 | #define BACKBONE_AREA_ID (htonl (0)) |
| 72 | #define IS_AREA_BACKBONE(oa) ((oa)->area_id == BACKBONE_AREA_ID) |
| 73 | #define IS_AREA_ENABLED(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ENABLE)) |
| 74 | #define IS_AREA_ACTIVE(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_ACTIVE)) |
| 75 | #define IS_AREA_TRANSIT(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_TRANSIT)) |
| 76 | #define IS_AREA_STUB(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_STUB)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 77 | |
| 78 | /* prototypes */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 79 | int ospf6_area_cmp (void *va, void *vb); |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 80 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 81 | struct ospf6_area *ospf6_area_create (u_int32_t, struct ospf6 *); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 82 | void ospf6_area_delete (struct ospf6_area *); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 83 | struct ospf6_area *ospf6_area_lookup (u_int32_t, struct ospf6 *); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 84 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 85 | void ospf6_area_enable (struct ospf6_area *); |
| 86 | void ospf6_area_disable (struct ospf6_area *); |
| 87 | |
| 88 | void ospf6_area_show (struct vty *, struct ospf6_area *); |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 89 | |
| 90 | void ospf6_area_config_write (struct vty *vty); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 91 | void ospf6_area_init (); |
| 92 | |
| 93 | #endif /* OSPF_AREA_H */ |
| 94 | |