]> git.proxmox.com Git - mirror_frr.git/blob - ospfd/ospf_abr.h
pimd: Option to get IGMP groups and sources for a particular interface
[mirror_frr.git] / ospfd / ospf_abr.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * OSPF ABR functions.
4 * Copyright (C) 1999 Alex Zinin
5 */
6
7 #ifndef _ZEBRA_OSPF_ABR_H
8 #define _ZEBRA_OSPF_ABR_H
9
10 #define OSPF_ABR_TASK_DELAY 5
11 #define OSPF_ABR_DNA_TIMER 10
12 /* Delay in announceing Non-DNA routers
13 * so that LSAs are completely synced
14 * before generating indication LSAs.
15 */
16
17 #define OSPF_AREA_RANGE_ADVERTISE (1 << 0)
18 #define OSPF_AREA_RANGE_SUBSTITUTE (1 << 1)
19
20 /* Area range. */
21 struct ospf_area_range {
22 /* Area range address. */
23 struct in_addr addr;
24
25 /* Area range masklen. */
26 uint8_t masklen;
27
28 /* Flags. */
29 uint8_t flags;
30
31 /* Number of more specific prefixes. */
32 int specifics;
33
34 /* Addr and masklen to substitute. */
35 struct in_addr subst_addr;
36 uint8_t subst_masklen;
37
38 /* Range cost. */
39 uint32_t cost;
40
41 /* Configured range cost. */
42 uint32_t cost_config;
43 };
44
45 /* Prototypes. */
46 extern struct ospf_area_range *ospf_area_range_lookup(struct ospf_area *,
47 struct prefix_ipv4 *);
48
49 extern struct ospf_area_range *ospf_some_area_range_match(struct prefix_ipv4 *);
50
51 extern struct ospf_area_range *
52 ospf_area_range_lookup_next(struct ospf_area *, struct in_addr *, int);
53
54 extern int ospf_area_range_set(struct ospf *, struct in_addr,
55 struct prefix_ipv4 *, int);
56 extern int ospf_area_range_cost_set(struct ospf *, struct in_addr,
57 struct prefix_ipv4 *, uint32_t);
58 extern int ospf_area_range_unset(struct ospf *, struct in_addr,
59 struct prefix_ipv4 *);
60 extern int ospf_area_range_substitute_set(struct ospf *, struct in_addr,
61 struct prefix_ipv4 *,
62 struct prefix_ipv4 *);
63 extern int ospf_area_range_substitute_unset(struct ospf *, struct in_addr,
64 struct prefix_ipv4 *);
65 extern struct ospf_area_range *ospf_area_range_match_any(struct ospf *,
66 struct prefix_ipv4 *);
67 extern int ospf_area_range_active(struct ospf_area_range *);
68 extern int ospf_act_bb_connection(struct ospf *);
69
70 extern void ospf_check_abr_status(struct ospf *);
71 extern void ospf_abr_task(struct ospf *);
72 extern void ospf_schedule_abr_task(struct ospf *);
73
74 extern void ospf_abr_announce_network_to_area(struct prefix_ipv4 *, uint32_t,
75 struct ospf_area *);
76 extern void ospf_abr_nssa_check_status(struct ospf *ospf);
77 extern void ospf_abr_generate_indication_lsa(struct ospf *ospf,
78 const struct ospf_area *area);
79 extern void ospf_flush_indication_lsas(struct ospf *ospf);
80 extern void ospf_generate_indication_lsa(struct ospf *ospf,
81 struct ospf_area *area);
82 extern bool ospf_check_fr_enabled_all(struct ospf *ospf);
83 extern void ospf_recv_indication_lsa_flush(struct ospf_lsa *lsa);
84
85 /** @brief Static inline functions.
86 * @param Area pointer.
87 * @return area Flood Reduction status.
88 */
89 static inline bool ospf_check_area_fr_enabled(const struct ospf_area *area)
90 {
91 return area->fr_info.enabled ? true : false;
92 }
93 #endif /* _ZEBRA_OSPF_ABR_H */