blob: a85ec84610534cfede5aed5f36d0df423b5006d3 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
2 * OSPF ABR functions.
3 * Copyright (C) 1999 Alex Zinin
4 *
5 * This file is part of GNU Zebra.
6 *
7 * GNU Zebra is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Zebra; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 */
22
23#ifndef _ZEBRA_OSPF_ABR_H
24#define _ZEBRA_OSPF_ABR_H
25
26#define OSPF_ABR_TASK_DELAY 7
27
28#define OSPF_AREA_RANGE_ADVERTISE (1 << 0)
29#define OSPF_AREA_RANGE_SUBSTITUTE (1 << 1)
30
31/* Area range. */
32struct ospf_area_range
33{
34 /* Area range address. */
35 struct in_addr addr;
36
37 /* Area range masklen. */
38 u_char masklen;
39
40 /* Flags. */
41 u_char flags;
42
43 /* Number of more specific prefixes. */
44 int specifics;
45
46 /* Addr and masklen to substitute. */
47 struct in_addr subst_addr;
48 u_char subst_masklen;
49
50 /* Range cost. */
51 u_int32_t cost;
52
53 /* Configured range cost. */
54 u_int32_t cost_config;
paul6c835672004-10-11 11:00:30 +000055#define OSPF_AREA_RANGE_COST_UNSPEC -1U
paul718e3742002-12-13 20:15:29 +000056};
57
58/* Prototypes. */
paul4dadc292005-05-06 21:37:42 +000059extern struct ospf_area_range *ospf_area_range_lookup (struct ospf_area *,
60 struct prefix_ipv4 *);
paul718e3742002-12-13 20:15:29 +000061
paul4dadc292005-05-06 21:37:42 +000062extern struct ospf_area_range *ospf_some_area_range_match (struct prefix_ipv4
63 *);
64
65extern struct ospf_area_range *ospf_area_range_lookup_next (struct ospf_area
66 *,
67 struct in_addr *,
68 int);
69
70extern int ospf_area_range_set (struct ospf *, struct in_addr,
71 struct prefix_ipv4 *, int);
72extern int ospf_area_range_cost_set (struct ospf *, struct in_addr,
73 struct prefix_ipv4 *, u_int32_t);
74extern int ospf_area_range_unset (struct ospf *, struct in_addr,
75 struct prefix_ipv4 *);
76extern int ospf_area_range_substitute_set (struct ospf *, struct in_addr,
77 struct prefix_ipv4 *,
78 struct prefix_ipv4 *);
79extern int ospf_area_range_substitute_unset (struct ospf *, struct in_addr,
80 struct prefix_ipv4 *);
81extern struct ospf_area_range *ospf_area_range_match_any (struct ospf *,
82 struct prefix_ipv4
83 *);
84extern int ospf_area_range_active (struct ospf_area_range *);
85extern int ospf_act_bb_connection (struct ospf *);
86
87extern void ospf_check_abr_status (struct ospf *);
88extern void ospf_abr_task (struct ospf *);
89extern void ospf_schedule_abr_task (struct ospf *);
paul718e3742002-12-13 20:15:29 +000090
91#endif /* _ZEBRA_OSPF_ABR_H */