]>
Commit | Line | Data |
---|---|---|
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 | * | |
896014f4 DL |
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 | |
718e3744 | 20 | */ |
21 | ||
22 | #ifndef _ZEBRA_OSPF_ZEBRA_H | |
23 | #define _ZEBRA_OSPF_ZEBRA_H | |
24 | ||
31a5976b | 25 | #include "vty.h" |
3012671f | 26 | #include "hook.h" |
31a5976b | 27 | |
718e3744 | 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. */ | |
d62a17ae | 35 | struct ospf_distance { |
36 | /* Distance value for the IP source prefix. */ | |
d7c0a89a | 37 | uint8_t distance; |
718e3744 | 38 | |
d62a17ae | 39 | /* Name of the access-list to be matched. */ |
40 | char *access_list; | |
718e3744 | 41 | }; |
42 | ||
43 | /* Prototypes */ | |
aa530b62 | 44 | struct ospf_route; |
b5a8894d CS |
45 | extern void ospf_zebra_add(struct ospf *ospf, struct prefix_ipv4 *, |
46 | struct ospf_route *); | |
47 | extern void ospf_zebra_delete(struct ospf *ospf, struct prefix_ipv4 *, | |
48 | struct ospf_route *); | |
718e3744 | 49 | |
b5a8894d CS |
50 | extern void ospf_zebra_add_discard(struct ospf *ospf, struct prefix_ipv4 *); |
51 | extern void ospf_zebra_delete_discard(struct ospf *ospf, struct prefix_ipv4 *); | |
718e3744 | 52 | |
d62a17ae | 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 *); | |
d7c0a89a | 57 | extern void ospf_distribute_list_update(struct ospf *, int, unsigned short); |
718e3744 | 58 | |
d7c0a89a | 59 | extern int ospf_is_type_redistributed(struct ospf *, int, unsigned short); |
d62a17ae | 60 | extern void ospf_distance_reset(struct ospf *); |
d7c0a89a QY |
61 | extern uint8_t ospf_distance_apply(struct ospf *ospf, struct prefix_ipv4 *, |
62 | struct ospf_route *); | |
63 | extern struct ospf_external *ospf_external_lookup(struct ospf *, uint8_t, | |
64 | unsigned short); | |
65 | extern struct ospf_external *ospf_external_add(struct ospf *, uint8_t, | |
66 | unsigned short); | |
43e7abb5 OD |
67 | |
68 | struct sr_prefix; | |
69 | struct sr_nhlfe; | |
70 | extern void ospf_zebra_update_prefix_sid(const struct sr_prefix *srp); | |
71 | extern void ospf_zebra_delete_prefix_sid(const struct sr_prefix *srp); | |
72 | extern void ospf_zebra_send_adjacency_sid(int cmd, struct sr_nhlfe nhlfe); | |
73 | ||
d7c0a89a QY |
74 | extern void ospf_external_del(struct ospf *, uint8_t, unsigned short); |
75 | extern struct ospf_redist *ospf_redist_lookup(struct ospf *, uint8_t, | |
76 | unsigned short); | |
77 | extern struct ospf_redist *ospf_redist_add(struct ospf *, uint8_t, | |
78 | unsigned short); | |
79 | extern void ospf_redist_del(struct ospf *, uint8_t, unsigned short); | |
718e3744 | 80 | |
7bced643 IR |
81 | extern int ospf_redistribute_update(struct ospf *, struct ospf_redist *, int, |
82 | unsigned short, int, int); | |
83 | extern int ospf_redistribute_set(struct ospf *, struct ospf_redist *, int, | |
84 | unsigned short, int, int); | |
d7c0a89a | 85 | extern int ospf_redistribute_unset(struct ospf *, int, unsigned short); |
d62a17ae | 86 | extern int ospf_redistribute_default_set(struct ospf *, int, int, int); |
d62a17ae | 87 | extern int ospf_distribute_list_out_set(struct ospf *, int, const char *); |
88 | extern int ospf_distribute_list_out_unset(struct ospf *, int, const char *); | |
89 | extern void ospf_routemap_set(struct ospf_redist *, const char *); | |
90 | extern void ospf_routemap_unset(struct ospf_redist *); | |
10514170 RW |
91 | extern int ospf_zebra_gr_enable(struct ospf *ospf, uint32_t stale_time); |
92 | extern int ospf_zebra_gr_disable(struct ospf *ospf); | |
d62a17ae | 93 | extern int ospf_distance_set(struct vty *, struct ospf *, const char *, |
94 | const char *, const char *); | |
95 | extern int ospf_distance_unset(struct vty *, struct ospf *, const char *, | |
96 | const char *, const char *); | |
d7c0a89a | 97 | extern void ospf_zebra_init(struct thread_master *, unsigned short); |
b5a8894d CS |
98 | extern void ospf_zebra_vrf_register(struct ospf *ospf); |
99 | extern void ospf_zebra_vrf_deregister(struct ospf *ospf); | |
1febb13d S |
100 | bool ospf_external_default_routemap_apply_walk( |
101 | struct ospf *ospf, struct list *ext_list, | |
102 | struct external_info *default_ei); | |
103 | int ospf_external_info_apply_default_routemap(struct ospf *ospf, | |
104 | struct external_info *ei, | |
105 | struct external_info *default_ei); | |
aa530b62 JU |
106 | |
107 | extern void ospf_zebra_send_arp(const struct interface *ifp, | |
108 | const struct prefix *p); | |
d81b8e0e OD |
109 | bool ospf_zebra_label_manager_ready(void); |
110 | int ospf_zebra_label_manager_connect(void); | |
111 | int ospf_zebra_request_label_range(uint32_t base, uint32_t chunk_size); | |
112 | int ospf_zebra_release_label_range(uint32_t start, uint32_t end); | |
718e3744 | 113 | #endif /* _ZEBRA_OSPF_ZEBRA_H */ |