]> git.proxmox.com Git - mirror_frr.git/blob - ospf6d/ospf6_abr.h
lib: mgmtd: add server-side connection code to mgmt_msg
[mirror_frr.git] / ospf6d / ospf6_abr.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Copyright (C) 2004 Yasuhiro Ohara
4 */
5
6 #ifndef OSPF6_ABR_H
7 #define OSPF6_ABR_H
8
9 /* for struct ospf6_route */
10 #include "ospf6_route.h"
11 /* for struct ospf6_prefix */
12 #include "ospf6_proto.h"
13
14 /* Debug option */
15 extern unsigned char conf_debug_ospf6_abr;
16 #define OSPF6_DEBUG_ABR_ON() (conf_debug_ospf6_abr = 1)
17 #define OSPF6_DEBUG_ABR_OFF() (conf_debug_ospf6_abr = 0)
18 #define IS_OSPF6_DEBUG_ABR (conf_debug_ospf6_abr)
19
20 /* Inter-Area-Prefix-LSA */
21 #define OSPF6_INTER_PREFIX_LSA_MIN_SIZE 4U /* w/o IPv6 prefix */
22 struct ospf6_inter_prefix_lsa {
23 uint32_t metric;
24 struct ospf6_prefix prefix;
25 };
26
27 /* Inter-Area-Router-LSA */
28 #define OSPF6_INTER_ROUTER_LSA_FIX_SIZE 12U
29 struct ospf6_inter_router_lsa {
30 uint8_t mbz;
31 uint8_t options[3];
32 uint32_t metric;
33 uint32_t router_id;
34 };
35
36 #define OSPF6_ABR_SUMMARY_METRIC(E) (ntohl ((E)->metric & htonl (0x00ffffff)))
37 #define OSPF6_ABR_SUMMARY_METRIC_SET(E, C) \
38 { \
39 (E)->metric &= htonl(0x00000000); \
40 (E)->metric |= htonl(0x00ffffff) & htonl(C); \
41 }
42
43 #define OSPF6_ABR_RANGE_CLEAR_COST(range) (range->path.cost = OSPF_AREA_RANGE_COST_UNSPEC)
44 #define IS_OSPF6_ABR(o) ((o)->flag & OSPF6_FLAG_ABR)
45
46 extern bool ospf6_check_and_set_router_abr(struct ospf6 *o);
47
48 extern void ospf6_abr_enable_area(struct ospf6_area *oa);
49 extern void ospf6_abr_disable_area(struct ospf6_area *oa);
50
51 extern int ospf6_abr_originate_summary_to_area(struct ospf6_route *route,
52 struct ospf6_area *area);
53 extern void ospf6_abr_originate_summary(struct ospf6_route *route,
54 struct ospf6 *ospf6);
55 extern void ospf6_abr_examin_summary(struct ospf6_lsa *lsa,
56 struct ospf6_area *oa);
57 extern void ospf6_abr_defaults_to_stub(struct ospf6 *ospf6);
58 extern void ospf6_abr_examin_brouter(uint32_t router_id,
59 struct ospf6_route *route,
60 struct ospf6 *ospf6);
61 extern void ospf6_abr_range_reset_cost(struct ospf6 *ospf6);
62 extern void ospf6_abr_prefix_resummarize(struct ospf6 *ospf6);
63
64 extern int config_write_ospf6_debug_abr(struct vty *vty);
65 extern void install_element_ospf6_debug_abr(void);
66 extern int ospf6_abr_config_write(struct vty *vty);
67 extern void ospf6_abr_old_route_remove(struct ospf6_lsa *lsa,
68 struct ospf6_route *old,
69 struct ospf6_route_table *table);
70 extern void ospf6_abr_old_path_update(struct ospf6_route *old_route,
71 struct ospf6_route *route,
72 struct ospf6_route_table *table);
73 extern void ospf6_abr_init(void);
74 extern void ospf6_abr_range_update(struct ospf6_route *range,
75 struct ospf6 *ospf6);
76 extern void ospf6_abr_remove_unapproved_summaries(struct ospf6 *ospf6);
77 extern int ospf6_ls_origin_same(struct ospf6_path *o_path,
78 struct ospf6_path *r_path);
79
80 #endif /*OSPF6_ABR_H*/