]>
git.proxmox.com Git - mirror_frr.git/blob - ospfd/ospf_zebra.h
2 * Zebra connect library for OSPFd
3 * Copyright (C) 1997, 98, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
5 * This file is part of GNU Zebra.
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
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.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef _ZEBRA_OSPF_ZEBRA_H
23 #define _ZEBRA_OSPF_ZEBRA_H
28 #define EXTERNAL_METRIC_TYPE_1 0
29 #define EXTERNAL_METRIC_TYPE_2 1
31 #define DEFAULT_ROUTE ZEBRA_ROUTE_MAX
32 #define DEFAULT_ROUTE_TYPE(T) ((T) == DEFAULT_ROUTE)
35 struct ospf_distance
{
36 /* Distance value for the IP source prefix. */
39 /* Name of the access-list to be matched. */
44 extern void ospf_zebra_add(struct ospf
*ospf
, struct prefix_ipv4
*,
46 extern void ospf_zebra_delete(struct ospf
*ospf
, struct prefix_ipv4
*,
49 extern void ospf_zebra_add_discard(struct ospf
*ospf
, struct prefix_ipv4
*);
50 extern void ospf_zebra_delete_discard(struct ospf
*ospf
, struct prefix_ipv4
*);
52 extern int ospf_redistribute_check(struct ospf
*, struct external_info
*,
54 extern int ospf_distribute_check_connected(struct ospf
*,
55 struct external_info
*);
56 extern void ospf_distribute_list_update(struct ospf
*, int, unsigned short);
58 extern int ospf_is_type_redistributed(struct ospf
*, int, unsigned short);
59 extern void ospf_distance_reset(struct ospf
*);
60 extern uint8_t ospf_distance_apply(struct ospf
*ospf
, struct prefix_ipv4
*,
62 extern struct ospf_external
*ospf_external_lookup(struct ospf
*, uint8_t,
64 extern struct ospf_external
*ospf_external_add(struct ospf
*, uint8_t,
69 extern void ospf_zebra_update_prefix_sid(const struct sr_prefix
*srp
);
70 extern void ospf_zebra_delete_prefix_sid(const struct sr_prefix
*srp
);
71 extern void ospf_zebra_send_adjacency_sid(int cmd
, struct sr_nhlfe nhlfe
);
73 extern void ospf_external_del(struct ospf
*, uint8_t, unsigned short);
74 extern struct ospf_redist
*ospf_redist_lookup(struct ospf
*, uint8_t,
76 extern struct ospf_redist
*ospf_redist_add(struct ospf
*, uint8_t,
78 extern void ospf_redist_del(struct ospf
*, uint8_t, unsigned short);
80 extern int ospf_redistribute_set(struct ospf
*, int, unsigned short, int, int);
81 extern int ospf_redistribute_unset(struct ospf
*, int, unsigned short);
82 extern int ospf_redistribute_default_set(struct ospf
*, int, int, int);
83 extern int ospf_redistribute_default_unset(struct ospf
*);
84 extern int ospf_distribute_list_out_set(struct ospf
*, int, const char *);
85 extern int ospf_distribute_list_out_unset(struct ospf
*, int, const char *);
86 extern void ospf_routemap_set(struct ospf_redist
*, const char *);
87 extern void ospf_routemap_unset(struct ospf_redist
*);
88 extern int ospf_distance_set(struct vty
*, struct ospf
*, const char *,
89 const char *, const char *);
90 extern int ospf_distance_unset(struct vty
*, struct ospf
*, const char *,
91 const char *, const char *);
92 extern void ospf_zebra_init(struct thread_master
*, unsigned short);
93 extern void ospf_zebra_vrf_register(struct ospf
*ospf
);
94 extern void ospf_zebra_vrf_deregister(struct ospf
*ospf
);
95 bool ospf_external_default_routemap_apply_walk(
96 struct ospf
*ospf
, struct list
*ext_list
,
97 struct external_info
*default_ei
);
98 int ospf_external_info_apply_default_routemap(struct ospf
*ospf
,
99 struct external_info
*ei
,
100 struct external_info
*default_ei
);
101 #endif /* _ZEBRA_OSPF_ZEBRA_H */