]> git.proxmox.com Git - mirror_frr.git/blob - ospfd/ospf_zebra.h
ospfd: Update TE to new Link State Edge key
[mirror_frr.git] / ospfd / ospf_zebra.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Zebra connect library for OSPFd
4 * Copyright (C) 1997, 98, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
5 */
6
7 #ifndef _ZEBRA_OSPF_ZEBRA_H
8 #define _ZEBRA_OSPF_ZEBRA_H
9
10 #include "vty.h"
11 #include "hook.h"
12
13 #define EXTERNAL_METRIC_TYPE_1 0
14 #define EXTERNAL_METRIC_TYPE_2 1
15
16 #define DEFAULT_ROUTE ZEBRA_ROUTE_MAX
17 #define DEFAULT_ROUTE_TYPE(T) ((T) == DEFAULT_ROUTE)
18
19 /* OSPF distance. */
20 struct ospf_distance {
21 /* Distance value for the IP source prefix. */
22 uint8_t distance;
23
24 /* Name of the access-list to be matched. */
25 char *access_list;
26 };
27
28 /* Prototypes */
29 struct ospf_route;
30 extern void ospf_zebra_add(struct ospf *ospf, struct prefix_ipv4 *,
31 struct ospf_route *);
32 extern void ospf_zebra_delete(struct ospf *ospf, struct prefix_ipv4 *,
33 struct ospf_route *);
34
35 extern void ospf_zebra_add_discard(struct ospf *ospf, struct prefix_ipv4 *);
36 extern void ospf_zebra_delete_discard(struct ospf *ospf, struct prefix_ipv4 *);
37
38 extern int ospf_redistribute_check(struct ospf *, struct external_info *,
39 int *);
40 extern int ospf_distribute_check_connected(struct ospf *,
41 struct external_info *);
42 extern void ospf_distribute_list_update(struct ospf *, int, unsigned short);
43
44 extern int ospf_is_type_redistributed(struct ospf *, int, unsigned short);
45 extern void ospf_distance_reset(struct ospf *);
46 extern uint8_t ospf_distance_apply(struct ospf *ospf, struct prefix_ipv4 *,
47 struct ospf_route *);
48 extern struct ospf_external *ospf_external_lookup(struct ospf *, uint8_t,
49 unsigned short);
50 extern struct ospf_external *ospf_external_add(struct ospf *, uint8_t,
51 unsigned short);
52
53 struct sr_prefix;
54 struct sr_nhlfe;
55 extern void ospf_zebra_update_prefix_sid(const struct sr_prefix *srp);
56 extern void ospf_zebra_delete_prefix_sid(const struct sr_prefix *srp);
57 extern void ospf_zebra_send_adjacency_sid(int cmd, struct sr_nhlfe nhlfe);
58
59 extern void ospf_external_del(struct ospf *, uint8_t, unsigned short);
60 extern struct ospf_redist *ospf_redist_lookup(struct ospf *, uint8_t,
61 unsigned short);
62 extern struct ospf_redist *ospf_redist_add(struct ospf *, uint8_t,
63 unsigned short);
64 extern void ospf_redist_del(struct ospf *, uint8_t, unsigned short);
65
66 extern int ospf_redistribute_update(struct ospf *, struct ospf_redist *, int,
67 unsigned short, int, int);
68 extern int ospf_redistribute_set(struct ospf *, struct ospf_redist *, int,
69 unsigned short, int, int);
70 extern int ospf_redistribute_unset(struct ospf *, int, unsigned short);
71 extern int ospf_redistribute_default_set(struct ospf *, int, int, int);
72 extern int ospf_distribute_list_out_set(struct ospf *, int, const char *);
73 extern int ospf_distribute_list_out_unset(struct ospf *, int, const char *);
74 extern void ospf_routemap_set(struct ospf_redist *, const char *);
75 extern void ospf_routemap_unset(struct ospf_redist *);
76 extern int ospf_zebra_gr_enable(struct ospf *ospf, uint32_t stale_time);
77 extern int ospf_zebra_gr_disable(struct ospf *ospf);
78 extern int ospf_distance_set(struct vty *, struct ospf *, const char *,
79 const char *, const char *);
80 extern int ospf_distance_unset(struct vty *, struct ospf *, const char *,
81 const char *, const char *);
82 extern void ospf_zebra_init(struct event_loop *m, unsigned short instance);
83 extern void ospf_zebra_vrf_register(struct ospf *ospf);
84 extern void ospf_zebra_vrf_deregister(struct ospf *ospf);
85 bool ospf_external_default_routemap_apply_walk(
86 struct ospf *ospf, struct list *ext_list,
87 struct external_info *default_ei);
88 int ospf_external_info_apply_default_routemap(struct ospf *ospf,
89 struct external_info *ei,
90 struct external_info *default_ei);
91
92 extern void ospf_zebra_send_arp(const struct interface *ifp,
93 const struct prefix *p);
94 bool ospf_zebra_label_manager_ready(void);
95 int ospf_zebra_label_manager_connect(void);
96 int ospf_zebra_request_label_range(uint32_t base, uint32_t chunk_size);
97 int ospf_zebra_release_label_range(uint32_t start, uint32_t end);
98 #endif /* _ZEBRA_OSPF_ZEBRA_H */