]>
git.proxmox.com Git - mirror_frr.git/blob - ospfd/ospf_zebra.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Zebra connect library for OSPFd
4 * Copyright (C) 1997, 98, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
7 #ifndef _ZEBRA_OSPF_ZEBRA_H
8 #define _ZEBRA_OSPF_ZEBRA_H
13 #define EXTERNAL_METRIC_TYPE_1 0
14 #define EXTERNAL_METRIC_TYPE_2 1
16 #define DEFAULT_ROUTE ZEBRA_ROUTE_MAX
17 #define DEFAULT_ROUTE_TYPE(T) ((T) == DEFAULT_ROUTE)
20 struct ospf_distance
{
21 /* Distance value for the IP source prefix. */
24 /* Name of the access-list to be matched. */
30 extern void ospf_zebra_add(struct ospf
*ospf
, struct prefix_ipv4
*,
32 extern void ospf_zebra_delete(struct ospf
*ospf
, struct prefix_ipv4
*,
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
*);
38 extern int ospf_redistribute_check(struct ospf
*, struct external_info
*,
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);
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
*,
48 extern struct ospf_external
*ospf_external_lookup(struct ospf
*, uint8_t,
50 extern struct ospf_external
*ospf_external_add(struct ospf
*, uint8_t,
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
);
59 extern void ospf_external_del(struct ospf
*, uint8_t, unsigned short);
60 extern struct ospf_redist
*ospf_redist_lookup(struct ospf
*, uint8_t,
62 extern struct ospf_redist
*ospf_redist_add(struct ospf
*, uint8_t,
64 extern void ospf_redist_del(struct ospf
*, uint8_t, unsigned short);
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 thread_master
*, unsigned short);
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
);
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 */