]> git.proxmox.com Git - mirror_frr.git/blame - ospf6d/ospf6_abr.h
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / ospf6d / ospf6_abr.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
049207c3 2/*
3 * Copyright (C) 2004 Yasuhiro Ohara
049207c3 4 */
5
6#ifndef OSPF6_ABR_H
7#define OSPF6_ABR_H
8
a0bf59bc
DO
9/* for struct ospf6_route */
10#include "ospf6_route.h"
1f9a9fff
PJ
11/* for struct ospf6_prefix */
12#include "ospf6_proto.h"
a0bf59bc 13
049207c3 14/* Debug option */
15extern unsigned char conf_debug_ospf6_abr;
d62a17ae 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)
049207c3 19
20/* Inter-Area-Prefix-LSA */
abc7ef44 21#define OSPF6_INTER_PREFIX_LSA_MIN_SIZE 4U /* w/o IPv6 prefix */
d62a17ae 22struct ospf6_inter_prefix_lsa {
d7c0a89a 23 uint32_t metric;
d62a17ae 24 struct ospf6_prefix prefix;
049207c3 25};
26
27/* Inter-Area-Router-LSA */
abc7ef44 28#define OSPF6_INTER_ROUTER_LSA_FIX_SIZE 12U
d62a17ae 29struct ospf6_inter_router_lsa {
d7c0a89a
QY
30 uint8_t mbz;
31 uint8_t options[3];
32 uint32_t metric;
33 uint32_t router_id;
049207c3 34};
35
36#define OSPF6_ABR_SUMMARY_METRIC(E) (ntohl ((E)->metric & htonl (0x00ffffff)))
d62a17ae 37#define OSPF6_ABR_SUMMARY_METRIC_SET(E, C) \
38 { \
39 (E)->metric &= htonl(0x00000000); \
40 (E)->metric |= htonl(0x00ffffff) & htonl(C); \
41 }
049207c3 42
ca1f4309 43#define OSPF6_ABR_RANGE_CLEAR_COST(range) (range->path.cost = OSPF_AREA_RANGE_COST_UNSPEC)
ad500b22 44#define IS_OSPF6_ABR(o) ((o)->flag & OSPF6_FLAG_ABR)
ca1f4309 45
95b3f03d 46extern bool ospf6_check_and_set_router_abr(struct ospf6 *o);
6452df09 47
d62a17ae 48extern void ospf6_abr_enable_area(struct ospf6_area *oa);
49extern void ospf6_abr_disable_area(struct ospf6_area *oa);
3b68735f 50
d62a17ae 51extern int ospf6_abr_originate_summary_to_area(struct ospf6_route *route,
52 struct ospf6_area *area);
beadc736 53extern void ospf6_abr_originate_summary(struct ospf6_route *route,
54 struct ospf6 *ospf6);
d62a17ae 55extern void ospf6_abr_examin_summary(struct ospf6_lsa *lsa,
56 struct ospf6_area *oa);
f5f26b8f 57extern void ospf6_abr_defaults_to_stub(struct ospf6 *ospf6);
beadc736 58extern void ospf6_abr_examin_brouter(uint32_t router_id,
59 struct ospf6_route *route,
60 struct ospf6 *ospf6);
d62a17ae 61extern void ospf6_abr_range_reset_cost(struct ospf6 *ospf6);
62extern void ospf6_abr_prefix_resummarize(struct ospf6 *ospf6);
049207c3 63
d62a17ae 64extern int config_write_ospf6_debug_abr(struct vty *vty);
65extern void install_element_ospf6_debug_abr(void);
66extern int ospf6_abr_config_write(struct vty *vty);
6f19bb0e
CS
67extern void ospf6_abr_old_route_remove(struct ospf6_lsa *lsa,
68 struct ospf6_route *old,
e285b70d 69 struct ospf6_route_table *table);
6f19bb0e
CS
70extern void ospf6_abr_old_path_update(struct ospf6_route *old_route,
71 struct ospf6_route *route,
e285b70d 72 struct ospf6_route_table *table);
d62a17ae 73extern void ospf6_abr_init(void);
ad500b22
K
74extern void ospf6_abr_range_update(struct ospf6_route *range,
75 struct ospf6 *ospf6);
76extern void ospf6_abr_remove_unapproved_summaries(struct ospf6 *ospf6);
bc465fb6
MN
77extern int ospf6_ls_origin_same(struct ospf6_path *o_path,
78 struct ospf6_path *r_path);
049207c3 79
80#endif /*OSPF6_ABR_H*/