]> git.proxmox.com Git - mirror_frr.git/blame - ospfd/ospf_zebra.h
Merge remote-tracking branch 'origin/master' into EIGRP
[mirror_frr.git] / ospfd / ospf_zebra.h
CommitLineData
718e3744 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
31a5976b 26#include "vty.h"
3012671f 27#include "hook.h"
31a5976b 28
718e3744 29#define EXTERNAL_METRIC_TYPE_1 0
30#define EXTERNAL_METRIC_TYPE_2 1
31
32#define DEFAULT_ROUTE ZEBRA_ROUTE_MAX
33#define DEFAULT_ROUTE_TYPE(T) ((T) == DEFAULT_ROUTE)
34
35/* OSPF distance. */
36struct ospf_distance
37{
38 /* Distance value for the IP source prefix. */
39 u_char distance;
40
41 /* Name of the access-list to be matched. */
42 char *access_list;
43};
44
45/* Prototypes */
4dadc291 46extern void ospf_zebra_add (struct prefix_ipv4 *, struct ospf_route *);
47extern void ospf_zebra_delete (struct prefix_ipv4 *, struct ospf_route *);
718e3744 48
4dadc291 49extern void ospf_zebra_add_discard (struct prefix_ipv4 *);
50extern void ospf_zebra_delete_discard (struct prefix_ipv4 *);
718e3744 51
4dadc291 52extern int ospf_redistribute_check (struct ospf *, struct external_info *,
53 int *);
54extern int ospf_distribute_check_connected (struct ospf *,
55 struct external_info *);
7c8ff89e 56extern void ospf_distribute_list_update (struct ospf *, uintptr_t, u_short);
718e3744 57
7c8ff89e 58extern int ospf_is_type_redistributed (int, u_short);
4dadc291 59extern void ospf_distance_reset (struct ospf *);
60extern u_char ospf_distance_apply (struct prefix_ipv4 *, struct ospf_route *);
7c8ff89e
DS
61extern struct ospf_external *ospf_external_lookup (u_char, u_short);
62extern struct ospf_external *ospf_external_add (u_char, u_short);
63extern void ospf_external_del (u_char, u_short);
64extern struct ospf_redist *ospf_redist_lookup (struct ospf *, u_char, u_short);
65extern struct ospf_redist *ospf_redist_add (struct ospf *, u_char, u_short);
66extern void ospf_redist_del (struct ospf *, u_char, u_short);
718e3744 67
7c8ff89e
DS
68
69extern int ospf_redistribute_set (struct ospf *, int, u_short, int, int);
70extern int ospf_redistribute_unset (struct ospf *, int, u_short);
4dadc291 71extern int ospf_redistribute_default_set (struct ospf *, int, int, int);
72extern int ospf_redistribute_default_unset (struct ospf *);
73extern int ospf_distribute_list_out_set (struct ospf *, int, const char *);
74extern int ospf_distribute_list_out_unset (struct ospf *, int, const char *);
7c8ff89e
DS
75extern void ospf_routemap_set (struct ospf_redist *, const char *);
76extern void ospf_routemap_unset (struct ospf_redist *);
4dadc291 77extern int ospf_distance_set (struct vty *, struct ospf *, const char *,
78 const char *, const char *);
79extern int ospf_distance_unset (struct vty *, struct ospf *, const char *,
80 const char *, const char *);
4140ca4d 81extern void ospf_zebra_init(struct thread_master *, u_short);
718e3744 82
3012671f
DL
83DECLARE_HOOK(ospf_if_update, (struct interface *ifp), (ifp))
84DECLARE_HOOK(ospf_if_delete, (struct interface *ifp), (ifp))
85
718e3744 86#endif /* _ZEBRA_OSPF_ZEBRA_H */
87