paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Zebra connect library for OSPFd |
| 3 | * Copyright (C) 1997, 98, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada |
| 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 |
| 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 20 | * Boston, MA 02111-1307, USA. |
| 21 | */ |
| 22 | |
| 23 | #ifndef _ZEBRA_OSPF_ZEBRA_H |
| 24 | #define _ZEBRA_OSPF_ZEBRA_H |
| 25 | |
paul | 31a5976 | 2005-11-14 11:11:11 +0000 | [diff] [blame] | 26 | #include "vty.h" |
| 27 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 28 | #define EXTERNAL_METRIC_TYPE_1 0 |
| 29 | #define EXTERNAL_METRIC_TYPE_2 1 |
| 30 | |
| 31 | #define DEFAULT_ROUTE ZEBRA_ROUTE_MAX |
| 32 | #define DEFAULT_ROUTE_TYPE(T) ((T) == DEFAULT_ROUTE) |
| 33 | |
| 34 | /* OSPF distance. */ |
| 35 | struct ospf_distance |
| 36 | { |
| 37 | /* Distance value for the IP source prefix. */ |
| 38 | u_char distance; |
| 39 | |
| 40 | /* Name of the access-list to be matched. */ |
| 41 | char *access_list; |
| 42 | }; |
| 43 | |
| 44 | /* Prototypes */ |
paul | 4dadc29 | 2005-05-06 21:37:42 +0000 | [diff] [blame] | 45 | extern void ospf_zclient_start (void); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 46 | |
paul | 4dadc29 | 2005-05-06 21:37:42 +0000 | [diff] [blame] | 47 | extern void ospf_zebra_add (struct prefix_ipv4 *, struct ospf_route *); |
| 48 | extern void ospf_zebra_delete (struct prefix_ipv4 *, struct ospf_route *); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 49 | |
paul | 4dadc29 | 2005-05-06 21:37:42 +0000 | [diff] [blame] | 50 | extern void ospf_zebra_add_discard (struct prefix_ipv4 *); |
| 51 | extern void ospf_zebra_delete_discard (struct prefix_ipv4 *); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 52 | |
paul | 4dadc29 | 2005-05-06 21:37:42 +0000 | [diff] [blame] | 53 | extern int ospf_redistribute_check (struct ospf *, struct external_info *, |
| 54 | int *); |
| 55 | extern int ospf_distribute_check_connected (struct ospf *, |
| 56 | struct external_info *); |
Andrew Certain | 0798cee | 2012-12-04 13:43:42 -0800 | [diff] [blame] | 57 | extern void ospf_distribute_list_update (struct ospf *, uintptr_t); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 58 | |
paul | 4dadc29 | 2005-05-06 21:37:42 +0000 | [diff] [blame] | 59 | extern int ospf_is_type_redistributed (int); |
| 60 | extern void ospf_distance_reset (struct ospf *); |
| 61 | extern u_char ospf_distance_apply (struct prefix_ipv4 *, struct ospf_route *); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 62 | |
paul | 4dadc29 | 2005-05-06 21:37:42 +0000 | [diff] [blame] | 63 | extern int ospf_redistribute_set (struct ospf *, int, int, int); |
| 64 | extern int ospf_redistribute_unset (struct ospf *, int); |
| 65 | extern int ospf_redistribute_default_set (struct ospf *, int, int, int); |
| 66 | extern int ospf_redistribute_default_unset (struct ospf *); |
| 67 | extern int ospf_distribute_list_out_set (struct ospf *, int, const char *); |
| 68 | extern int ospf_distribute_list_out_unset (struct ospf *, int, const char *); |
| 69 | extern void ospf_routemap_set (struct ospf *, int, const char *); |
| 70 | extern void ospf_routemap_unset (struct ospf *, int); |
| 71 | extern int ospf_distance_set (struct vty *, struct ospf *, const char *, |
| 72 | const char *, const char *); |
| 73 | extern int ospf_distance_unset (struct vty *, struct ospf *, const char *, |
| 74 | const char *, const char *); |
| 75 | extern void ospf_zebra_init (void); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 76 | |
| 77 | #endif /* _ZEBRA_OSPF_ZEBRA_H */ |
| 78 | |