2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2002-12-13 21:15:29 +01:00
|
|
|
/*
|
|
|
|
* OSPFd main header.
|
|
|
|
* Copyright (C) 1998, 99, 2000 Kunihiro Ishiguro, Toshiaki Takada
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ZEBRA_OSPFD_H
|
|
|
|
#define _ZEBRA_OSPFD_H
|
|
|
|
|
2009-01-23 21:48:10 +01:00
|
|
|
#include <zebra.h>
|
2020-08-05 10:44:21 +02:00
|
|
|
#include "typesafe.h"
|
2016-12-07 13:25:38 +01:00
|
|
|
#include "qobj.h"
|
2013-10-23 02:42:18 +02:00
|
|
|
#include "libospf.h"
|
2020-07-22 19:31:14 +02:00
|
|
|
#include "ldp_sync.h"
|
2009-01-23 21:48:10 +01:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#include "filter.h"
|
2005-03-25 20:48:40 +01:00
|
|
|
#include "log.h"
|
2017-08-25 22:51:12 +02:00
|
|
|
#include "vrf.h"
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2015-05-29 05:48:31 +02:00
|
|
|
#include "ospf_memory.h"
|
2017-01-24 21:35:08 +01:00
|
|
|
#include "ospf_dump_api.h"
|
2015-05-29 05:48:31 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#define OSPF_VERSION 2
|
|
|
|
|
|
|
|
/* VTY port number. */
|
|
|
|
#define OSPF_VTY_PORT 2604
|
|
|
|
|
|
|
|
/* IP TTL for OSPF protocol. */
|
|
|
|
#define OSPF_IP_TTL 1
|
|
|
|
#define OSPF_VL_IP_TTL 100
|
|
|
|
|
|
|
|
/* Default configuration file name for ospfd. */
|
|
|
|
#define OSPF_DEFAULT_CONFIG "ospfd.conf"
|
|
|
|
|
2003-06-22 10:32:35 +02:00
|
|
|
#define OSPF_NSSA_TRANS_STABLE_DEFAULT 40
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
#define OSPF_ALLSPFROUTERS 0xe0000005 /* 224.0.0.5 */
|
|
|
|
#define OSPF_ALLDROUTERS 0xe0000006 /* 224.0.0.6 */
|
|
|
|
|
|
|
|
/* OSPF Authentication Type. */
|
|
|
|
#define OSPF_AUTH_NULL 0
|
|
|
|
#define OSPF_AUTH_SIMPLE 1
|
|
|
|
#define OSPF_AUTH_CRYPTOGRAPHIC 2
|
|
|
|
/* For Interface authentication setting default */
|
|
|
|
#define OSPF_AUTH_NOTSET -1
|
|
|
|
/* For the consumption and sanity of the command handler */
|
|
|
|
/* DO NIOT REMOVE!!! Need to detect whether a value has
|
|
|
|
been given or not in VLink command handlers */
|
|
|
|
#define OSPF_AUTH_CMD_NOTSEEN -2
|
|
|
|
|
|
|
|
/* OSPF options. */
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
#define OSPF_OPTION_MT 0x01 /* M/T */
|
2002-12-13 21:15:29 +01:00
|
|
|
#define OSPF_OPTION_E 0x02
|
|
|
|
#define OSPF_OPTION_MC 0x04
|
|
|
|
#define OSPF_OPTION_NP 0x08
|
|
|
|
#define OSPF_OPTION_EA 0x10
|
|
|
|
#define OSPF_OPTION_DC 0x20
|
|
|
|
#define OSPF_OPTION_O 0x40
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
#define OSPF_OPTION_DN 0x80
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* OSPF Database Description flags. */
|
|
|
|
#define OSPF_DD_FLAG_MS 0x01
|
|
|
|
#define OSPF_DD_FLAG_M 0x02
|
|
|
|
#define OSPF_DD_FLAG_I 0x04
|
|
|
|
#define OSPF_DD_FLAG_ALL 0x07
|
|
|
|
|
|
|
|
#define OSPF_LS_REFRESH_SHIFT (60 * 15)
|
|
|
|
#define OSPF_LS_REFRESH_JITTER 60
|
|
|
|
|
2023-04-06 19:40:23 +02:00
|
|
|
/* Default socket buffer size */
|
|
|
|
#define OSPF_DEFAULT_SOCK_BUFSIZE (8 * 1024 * 1024)
|
|
|
|
|
2023-06-15 23:50:24 +02:00
|
|
|
/* OSPF config processing timer thread */
|
|
|
|
extern struct event *t_ospf_cfg;
|
|
|
|
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
struct ospf_external {
|
2018-03-27 21:13:34 +02:00
|
|
|
unsigned short instance;
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
struct route_table *external_info;
|
|
|
|
};
|
|
|
|
|
2003-04-04 04:44:16 +02:00
|
|
|
/* OSPF master for system wide configuration and variables. */
|
|
|
|
struct ospf_master {
|
|
|
|
/* OSPF instance. */
|
|
|
|
struct list *ospf;
|
|
|
|
|
|
|
|
/* OSPF thread master. */
|
2023-03-07 20:14:41 +01:00
|
|
|
struct event_loop *master;
|
2003-04-04 04:44:16 +02:00
|
|
|
|
|
|
|
/* Various OSPF global configuration. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t options;
|
2017-07-27 16:09:00 +02:00
|
|
|
#define OSPF_MASTER_SHUTDOWN (1 << 0) /* deferred-shutdown */
|
2003-04-04 04:44:16 +02:00
|
|
|
};
|
|
|
|
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
struct ospf_redist {
|
2018-03-27 21:13:34 +02:00
|
|
|
unsigned short instance;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
/* Redistribute metric info. */
|
|
|
|
struct {
|
|
|
|
int type; /* External metric type (E1 or E2). */
|
|
|
|
int value; /* Value for static metric (24-bit).
|
|
|
|
-1 means metric value is not set. */
|
|
|
|
} dmetric;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
/* For redistribute route map. */
|
|
|
|
struct {
|
|
|
|
char *name;
|
|
|
|
struct route_map *map;
|
|
|
|
} route_map; /* +1 is for default-information */
|
|
|
|
#define ROUTEMAP_NAME(R) (R->route_map.name)
|
2022-11-21 11:32:53 +01:00
|
|
|
#define ROUTEMAP(R) (R->route_map.map)
|
|
|
|
};
|
|
|
|
|
|
|
|
/* OSPF area flood reduction info */
|
|
|
|
struct ospf_area_fr_info {
|
|
|
|
bool enabled; /* Area support for Flood Reduction */
|
|
|
|
bool configured; /* Flood Reduction configured per area knob */
|
|
|
|
bool state_changed; /* flood reduction state change info */
|
|
|
|
int router_lsas_recv_dc_bit; /* Number of unique router lsas
|
|
|
|
* received with DC bit set.
|
|
|
|
* (excluding self)
|
|
|
|
*/
|
|
|
|
bool area_ind_lsa_recvd; /* Indication lsa received in this area */
|
|
|
|
bool area_dc_clear; /* Area has atleast one lsa with dc bit 0(
|
|
|
|
* excluding indication lsa)
|
|
|
|
*/
|
|
|
|
struct ospf_lsa *indication_lsa_self; /* Indication LSA generated
|
|
|
|
* in the area.
|
|
|
|
*/
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
};
|
|
|
|
|
2019-08-01 18:49:50 +02:00
|
|
|
/* ospf->config */
|
|
|
|
enum {
|
|
|
|
OSPF_RFC1583_COMPATIBLE = (1 << 0),
|
|
|
|
OSPF_OPAQUE_CAPABLE = (1 << 2),
|
|
|
|
OSPF_LOG_ADJACENCY_CHANGES = (1 << 3),
|
|
|
|
OSPF_LOG_ADJACENCY_DETAIL = (1 << 4),
|
lib, ospfd, ospf6d, zebra: add OSPF opaque route attributes
Update ospfd and ospf6d to send opaque route attributes to
zebra. Those attributes are stored in the RIB and can be viewed
using the "show ip[v6] route" commands (other than that, they are
completely ignored by zebra).
Example:
```
debian# show ip route 192.168.1.0/24
Routing entry for 192.168.1.0/24
Known via "ospf", distance 110, metric 20, best
Last update 01:57:08 ago
* 10.0.1.2, via eth-rt2, weight 1
OSPF path type : External-2
OSPF tag : 0
debian#
debian# show ip route 192.168.1.0/24 json
{
"192.168.1.0\/24":[
{
"prefix":"192.168.1.0\/24",
"prefixLen":24,
"protocol":"ospf",
"vrfId":0,
"vrfName":"default",
"selected":true,
[snip]
"ospfPathType":"External-2",
"ospfTag":"0"
}
]
}
```
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21 03:15:55 +02:00
|
|
|
OSPF_SEND_EXTRA_DATA_TO_ZEBRA = (1 << 5),
|
2019-08-01 18:49:50 +02:00
|
|
|
};
|
|
|
|
|
2020-10-26 12:27:09 +01:00
|
|
|
/* TI-LFA */
|
|
|
|
enum protection_type {
|
|
|
|
OSPF_TI_LFA_UNDEFINED_PROTECTION,
|
|
|
|
OSPF_TI_LFA_LINK_PROTECTION,
|
|
|
|
OSPF_TI_LFA_NODE_PROTECTION,
|
|
|
|
};
|
|
|
|
|
2021-05-31 15:27:51 +02:00
|
|
|
/* OSPF nonstop forwarding aka Graceful Restart */
|
|
|
|
struct ospf_gr_info {
|
|
|
|
bool restart_support;
|
|
|
|
bool restart_in_progress;
|
|
|
|
bool prepare_in_progress;
|
|
|
|
bool finishing_restart;
|
|
|
|
uint32_t grace_period;
|
ospfd: add support for unplanned graceful restart
In practical terms, unplanned GR refers to the act of recovering
from a software crash without affecting the forwarding plane.
Unplanned GR and Planned GR work virtually the same, except for the
following difference: on planned GR, the router sends the Grace-LSAs
*before* restarting, whereas in unplanned GR the router sends the
Grace-LSAs immediately *after* restarting.
For unplanned GR to work, ospf6d was modified to send a
ZEBRA_CLIENT_GR_CAPABILITIES message to zebra as soon as GR is
enabled. This causes zebra to freeze the OSPF routes in the RIB as
soon as the ospfd daemon dies, for as long as the configured grace
period (the defaults is 120 seconds). Similarly, ospfd now stores in
non-volatile memory that GR is enabled as soon as GR is configured.
Those two things are no longer done during the GR preparation phase,
which only happens for planned GRs.
Unplanned GR will only take effect when the daemon is killed
abruptly (e.g. SIGSEGV, SIGKILL), otherwise all OSPF routes will
be uninstalled while ospfd is exiting. Once ospfd starts, it will
check whether GR is enabled and enter in the GR mode if necessary,
sending Grace-LSAs out all operational interfaces.
One disadvantage of unplanned GR is that the neighboring routers
might time out their corresponding adjacencies if ospfd takes too
long to come back up. This is especially the case when short dead
intervals are used (or BFD). For this and other reasons, planned
GR should be preferred whenever possible.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-03 17:09:20 +01:00
|
|
|
int reason;
|
|
|
|
char *exit_reason;
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_grace_period;
|
2021-05-31 15:27:51 +02:00
|
|
|
};
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* OSPF instance structure. */
|
|
|
|
struct ospf {
|
2015-05-20 03:03:54 +02:00
|
|
|
/* OSPF's running state based on the '[no] router ospf [<instance>]'
|
|
|
|
* config. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t oi_running;
|
2015-05-20 03:03:54 +02:00
|
|
|
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
/* OSPF instance ID */
|
2018-03-27 21:13:34 +02:00
|
|
|
unsigned short instance;
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* OSPF Router ID. */
|
|
|
|
struct in_addr router_id; /* Configured automatically. */
|
|
|
|
struct in_addr router_id_static; /* Configured manually. */
|
2017-11-02 15:54:45 +01:00
|
|
|
struct in_addr router_id_zebra;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-08-25 22:51:12 +02:00
|
|
|
vrf_id_t vrf_id; /* VRF Id */
|
|
|
|
char *name; /* VRF name */
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* ABR/ASBR internal flags. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t flags;
|
2002-12-13 21:15:29 +01:00
|
|
|
#define OSPF_FLAG_ABR 0x0001
|
|
|
|
#define OSPF_FLAG_ASBR 0x0002
|
|
|
|
|
|
|
|
/* ABR type. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t abr_type;
|
2002-12-13 21:15:29 +01:00
|
|
|
#define OSPF_ABR_UNKNOWN 0
|
|
|
|
#define OSPF_ABR_STAND 1
|
|
|
|
#define OSPF_ABR_IBM 2
|
|
|
|
#define OSPF_ABR_CISCO 3
|
|
|
|
#define OSPF_ABR_SHORTCUT 4
|
2005-07-12 22:04:22 +02:00
|
|
|
#define OSPF_ABR_DEFAULT OSPF_ABR_CISCO
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* NSSA ABR */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t anyNSSA; /* Bump for every NSSA attached. */
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2019-08-01 18:49:50 +02:00
|
|
|
/* Configuration bitmask, refer to enum above */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t config;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Opaque-LSA administrative flags. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t opaque;
|
2002-12-13 21:15:29 +01:00
|
|
|
#define OPAQUE_OPERATION_READY_BIT (1 << 0)
|
|
|
|
|
2005-10-29 Paul Jakma <paul.jakma@sun.com>
* (general) RFC3137 stub-router support
* ospfd.h: Add OSPF_OUTPUT_COST_INFINITE define.
(struct ospf_master) Add a OSPF_MASTER_SHUTDOWN flag for
options, to allow shutdown to distinguish between complete
shutdown and shutdown of a subset of ospf instances.
(struct ospf)
Add stub_router_{startup,shutdown_}time, configuration of startup
and shutdown time for stub-router.
Add t_graceful_shutdown struct thread, timer for graceful
shutdown, if needed.
(struct ospf_area) Add stub_router_state - run time state of
stub-router for an area. Add flags for ADMIN, IS and WAS
states.
Add t_stub_router, timer thread to resend router-lsa for an
area.
* ospf_lsa.c: (ospf_link_cost) new simple function to spit out
either the given lnks cost or infinite cost if stub-router is
in effect.
(lsa_link_{ptop,broadcast,virtuallink,ptomp}_set) use
previous function for transit-links.
(ospf_stub_router_timer) timer thread for end of startup stub
router. Change state as required for the area and setup
re-origination of router-lsa.
(ospf_stub_router_check) Check/do whether stub-router should be
enabled, and whether it requires timer to be setup.
(ospf_router_lsa_new) call previous function at top.
(ospf_router_lsa_originate) no external callers, made static.
* ospf_lsa.h: (ospf_router_lsa_originate) removed.
* ospf_main.c: (sigint) make static.
remove call to exit, as ospf_terminate now deals with
exiting.
* ospf_route.c: (ospf_terminate) removed, now in ospfd.c.
* ospf_vty.c: (show_ip_ospf_area) print out state of
stub-router, if active.
(show_ip_ospf) print out configuration of stub-router
support, and details of graceful-shutdown if the timer is
active.
((no)?ospf_max_metric_router_lsa_{admin,startup,shutdown}) new
commands to (de-)?configure stub-router support.
(config_write_stub_router) write out config of stub-router.
(ospf_config_write) call previous.
(ospf_vty_init) install the new stub-router commands.
* ospfd.c: various functions made static.
(ospf_new) Set defaults for stub-router. Graceful shutdown
is made to default on, just to be adventerous.
(ospf_graceful_shutdown_finish) new function, final part of
shutdown.
(ospf_graceful_shutdown_timer) timer thread wrapper for
graceful-shutdown.
(ospf_graceful_shutdown_check) check whether to setup timer
for shutdown or proceed directly to final shutdown.
(ospf_terminate) moved here from ospf_route.c, call
ospf_finish for each instance.
(ospf_finish) renamed to ospf_finish_final and made static.
(ospf_finish) new function, exported wrapper around
ospf_graceful_shutdown_check.
(ospf_finish_final) complete shutdown of an instance.
Add missing TIMER_OFF's of two timer threads.
(ospf_area_free) opaque self lsa timer should be turned off.
2005-10-29 14:50:09 +02:00
|
|
|
/* RFC3137 stub router. Configured time to stay stub / max-metric */
|
|
|
|
unsigned int stub_router_startup_time; /* seconds */
|
|
|
|
unsigned int stub_router_shutdown_time; /* seconds */
|
|
|
|
#define OSPF_STUB_ROUTER_UNCONFIGURED 0
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t stub_router_admin_set;
|
2012-12-03 20:17:24 +01:00
|
|
|
#define OSPF_STUB_ROUTER_ADMINISTRATIVE_SET 1
|
|
|
|
#define OSPF_STUB_ROUTER_ADMINISTRATIVE_UNSET 0
|
2005-10-29 Paul Jakma <paul.jakma@sun.com>
* (general) RFC3137 stub-router support
* ospfd.h: Add OSPF_OUTPUT_COST_INFINITE define.
(struct ospf_master) Add a OSPF_MASTER_SHUTDOWN flag for
options, to allow shutdown to distinguish between complete
shutdown and shutdown of a subset of ospf instances.
(struct ospf)
Add stub_router_{startup,shutdown_}time, configuration of startup
and shutdown time for stub-router.
Add t_graceful_shutdown struct thread, timer for graceful
shutdown, if needed.
(struct ospf_area) Add stub_router_state - run time state of
stub-router for an area. Add flags for ADMIN, IS and WAS
states.
Add t_stub_router, timer thread to resend router-lsa for an
area.
* ospf_lsa.c: (ospf_link_cost) new simple function to spit out
either the given lnks cost or infinite cost if stub-router is
in effect.
(lsa_link_{ptop,broadcast,virtuallink,ptomp}_set) use
previous function for transit-links.
(ospf_stub_router_timer) timer thread for end of startup stub
router. Change state as required for the area and setup
re-origination of router-lsa.
(ospf_stub_router_check) Check/do whether stub-router should be
enabled, and whether it requires timer to be setup.
(ospf_router_lsa_new) call previous function at top.
(ospf_router_lsa_originate) no external callers, made static.
* ospf_lsa.h: (ospf_router_lsa_originate) removed.
* ospf_main.c: (sigint) make static.
remove call to exit, as ospf_terminate now deals with
exiting.
* ospf_route.c: (ospf_terminate) removed, now in ospfd.c.
* ospf_vty.c: (show_ip_ospf_area) print out state of
stub-router, if active.
(show_ip_ospf) print out configuration of stub-router
support, and details of graceful-shutdown if the timer is
active.
((no)?ospf_max_metric_router_lsa_{admin,startup,shutdown}) new
commands to (de-)?configure stub-router support.
(config_write_stub_router) write out config of stub-router.
(ospf_config_write) call previous.
(ospf_vty_init) install the new stub-router commands.
* ospfd.c: various functions made static.
(ospf_new) Set defaults for stub-router. Graceful shutdown
is made to default on, just to be adventerous.
(ospf_graceful_shutdown_finish) new function, final part of
shutdown.
(ospf_graceful_shutdown_timer) timer thread wrapper for
graceful-shutdown.
(ospf_graceful_shutdown_check) check whether to setup timer
for shutdown or proceed directly to final shutdown.
(ospf_terminate) moved here from ospf_route.c, call
ospf_finish for each instance.
(ospf_finish) renamed to ospf_finish_final and made static.
(ospf_finish) new function, exported wrapper around
ospf_graceful_shutdown_check.
(ospf_finish_final) complete shutdown of an instance.
Add missing TIMER_OFF's of two timer threads.
(ospf_area_free) opaque self lsa timer should be turned off.
2005-10-29 14:50:09 +02:00
|
|
|
|
2012-09-24 19:26:53 +02:00
|
|
|
#define OSPF_STUB_MAX_METRIC_SUMMARY_COST 0x00ff0000
|
|
|
|
|
2015-07-27 07:56:25 +02:00
|
|
|
/* LSA timers */
|
|
|
|
unsigned int min_ls_interval; /* minimum delay between LSAs (in msec) */
|
|
|
|
unsigned int min_ls_arrival; /* minimum interarrival time between LSAs
|
|
|
|
(in msec) */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2005-10-29 Paul Jakma <paul.jakma@sun.com>
* (general) RFC3137 stub-router support
* ospfd.h: Add OSPF_OUTPUT_COST_INFINITE define.
(struct ospf_master) Add a OSPF_MASTER_SHUTDOWN flag for
options, to allow shutdown to distinguish between complete
shutdown and shutdown of a subset of ospf instances.
(struct ospf)
Add stub_router_{startup,shutdown_}time, configuration of startup
and shutdown time for stub-router.
Add t_graceful_shutdown struct thread, timer for graceful
shutdown, if needed.
(struct ospf_area) Add stub_router_state - run time state of
stub-router for an area. Add flags for ADMIN, IS and WAS
states.
Add t_stub_router, timer thread to resend router-lsa for an
area.
* ospf_lsa.c: (ospf_link_cost) new simple function to spit out
either the given lnks cost or infinite cost if stub-router is
in effect.
(lsa_link_{ptop,broadcast,virtuallink,ptomp}_set) use
previous function for transit-links.
(ospf_stub_router_timer) timer thread for end of startup stub
router. Change state as required for the area and setup
re-origination of router-lsa.
(ospf_stub_router_check) Check/do whether stub-router should be
enabled, and whether it requires timer to be setup.
(ospf_router_lsa_new) call previous function at top.
(ospf_router_lsa_originate) no external callers, made static.
* ospf_lsa.h: (ospf_router_lsa_originate) removed.
* ospf_main.c: (sigint) make static.
remove call to exit, as ospf_terminate now deals with
exiting.
* ospf_route.c: (ospf_terminate) removed, now in ospfd.c.
* ospf_vty.c: (show_ip_ospf_area) print out state of
stub-router, if active.
(show_ip_ospf) print out configuration of stub-router
support, and details of graceful-shutdown if the timer is
active.
((no)?ospf_max_metric_router_lsa_{admin,startup,shutdown}) new
commands to (de-)?configure stub-router support.
(config_write_stub_router) write out config of stub-router.
(ospf_config_write) call previous.
(ospf_vty_init) install the new stub-router commands.
* ospfd.c: various functions made static.
(ospf_new) Set defaults for stub-router. Graceful shutdown
is made to default on, just to be adventerous.
(ospf_graceful_shutdown_finish) new function, final part of
shutdown.
(ospf_graceful_shutdown_timer) timer thread wrapper for
graceful-shutdown.
(ospf_graceful_shutdown_check) check whether to setup timer
for shutdown or proceed directly to final shutdown.
(ospf_terminate) moved here from ospf_route.c, call
ospf_finish for each instance.
(ospf_finish) renamed to ospf_finish_final and made static.
(ospf_finish) new function, exported wrapper around
ospf_graceful_shutdown_check.
(ospf_finish_final) complete shutdown of an instance.
Add missing TIMER_OFF's of two timer threads.
(ospf_area_free) opaque self lsa timer should be turned off.
2005-10-29 14:50:09 +02:00
|
|
|
/* SPF parameters */
|
|
|
|
unsigned int spf_delay; /* SPF delay time. */
|
|
|
|
unsigned int spf_holdtime; /* SPF hold time. */
|
|
|
|
unsigned int spf_max_holdtime; /* SPF maximum-holdtime */
|
|
|
|
unsigned int
|
|
|
|
spf_hold_multiplier; /* Adaptive multiplier for hold time */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
int default_originate; /* Default information originate. */
|
|
|
|
#define DEFAULT_ORIGINATE_NONE 0
|
|
|
|
#define DEFAULT_ORIGINATE_ZEBRA 1
|
|
|
|
#define DEFAULT_ORIGINATE_ALWAYS 2
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t ref_bandwidth; /* Reference Bandwidth (Kbps). */
|
2002-12-13 21:15:29 +01:00
|
|
|
struct route_table *networks; /* OSPF config networks. */
|
2004-09-23 21:18:23 +02:00
|
|
|
struct list *vlinks; /* Configured Virtual-Links. */
|
|
|
|
struct list *areas; /* OSPF areas. */
|
2002-12-13 21:15:29 +01:00
|
|
|
struct route_table *nbr_nbma;
|
|
|
|
struct ospf_area *backbone; /* Pointer to the Backbone Area. */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-09-23 21:18:23 +02:00
|
|
|
struct list *oiflist; /* ospf interfaces */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t passive_interface_default; /* passive-interface default */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* LSDB of AS-external-LSAs. */
|
|
|
|
struct ospf_lsdb *lsdb;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Flags. */
|
|
|
|
int ase_calc; /* ASE calculation flag. */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-09-23 21:18:23 +02:00
|
|
|
struct list *opaque_lsa_self; /* Type-11 Opaque-LSAs */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Routing tables. */
|
|
|
|
struct route_table *old_table; /* Old routing table. */
|
|
|
|
struct route_table *new_table; /* Current routing table. */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-01-15 12:13:43 +01:00
|
|
|
struct route_table *oall_rtrs; /* Old router RT. */
|
|
|
|
struct route_table *all_rtrs; /* New routers RT. */
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
struct route_table *old_rtrs; /* Old ABR/ASBR RT. */
|
|
|
|
struct route_table *new_rtrs; /* New ABR/ASBR RT. */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
struct route_table *new_external_route; /* New External Route. */
|
|
|
|
struct route_table *old_external_route; /* Old External Route. */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
struct route_table *external_lsas; /* Database of external LSAs,
|
|
|
|
prefix is LSA's adv. network*/
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2015-05-20 01:36:05 +02:00
|
|
|
/* Time stamps */
|
2005-10-21 Paul Jakma <paul.jakma@sun.com>
* (general) SPF millisecond resolution timer with adaptive,
linear back-off holdtime. Prettification of ospf_timer_dump.
* ospf_dump.c: (ospf_timeval_dump) new function. The guts of
ospf_timer_dump, but made to be more dynamic in printing out
the relative timeval, sliding the precision printed out
according to the value.
(ospf_timer_dump) guts moved to ospf_timeval_dump.
* ospf_dump.h: export ospf_timeval_dump.
* ospf_flood.c: (ospf_flood) remove gettimeofday, use
the libzebra exported recent_time instead, as it's not
terribly critical to have time exactly right - the dropped
LSA will be retransmited to us if we don't ACK it.
* ospf_packet.c: (ospf_ls_upd_timer) Ditto, but here we're
not transmitting, just putting LSA back on update transmit list.
* ospfd.h: delay and holdtimes should be unsigned.
Add spf_max_holdtime and spf_hold_multiplier.
Update default defines for delay and hold time to be in msec.
(struct ospf) change the SPF timestamp to a struct timeval.
Remove ospf_timers_spf_(un)?set.
* ospfd.c: (ospf_timers_spf_{set,unset}) removed.
(ospf_new) initialise spf_max_holdtime and spf_hold_multiplier
* ospf_spf.c: (ospf_spf_calculate) SPF timestamp is a timeval
now, update with gettimeofday.
(ospf_spf_calculate_schedule) Change SPF timers to millisecond
resolution.
Make the holdtime be adaptive, with a linear increase in
holdtime ever consecutive SPF run which occurs within holdtime
of previous SPF, bounded by spf_max_holdtime.
* ospf_vty.c: Update spf timers commands.
(ospf_timers_spf_set) trivial helper.
(ospf_timers_throttle_spf_cmd) new command to set SPF delay,
initial hold and max hold times with millisecond resolution.
(ospf_timers_spf_cmd) Deprecated. Accept the old values,
convert to msec, truncate to new limits.
(no_ospf_timers_throttle_spf_cmd) set timers to defaults.
(no_ospf_timers_spf_cmd) deprecated form, same as previous.
(show_ip_ospf_cmd) Display SPF parameters and times.
(show_ip_ospf_neighbour_header) Centralise the 'sh ip os ne'
header.
(show_ip_ospf_neighbor_sub) Fix the field widths. Get rid of
the multiple spaces which were making the lines even longer.
(show_ip_ospf_neighbor_cmd) Use show_ip_ospf_neighbour_header
(show_ip_ospf_neighbor_all_cmd) ditto and fix the field
widths for NBMA neighbours.
(show_ip_ospf_neighbor_int) Use header function.
(show_ip_ospf_nbr_nbma_detail_sub) use sizeof for timebuf,
local array - safer.
(show_ip_ospf_neighbor_detail_sub) ditto
(ospf_vty_init) install the new SPF throttle timer commands.
2005-10-21 11:23:12 +02:00
|
|
|
struct timeval ts_spf; /* SPF calculation time stamp. */
|
2015-05-20 01:36:05 +02:00
|
|
|
struct timeval ts_spf_duration; /* Execution time of last SPF */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-12-04 19:46:37 +01:00
|
|
|
struct route_table *maxage_lsa; /* List of MaxAge LSA for deletion. */
|
2002-12-13 21:15:29 +01:00
|
|
|
int redistribute; /* Num of redistributed protocols. */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Threads. */
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_abr_task; /* ABR task timer. */
|
|
|
|
struct event *t_abr_fr; /* ABR FR timer. */
|
|
|
|
struct event *t_asbr_check; /* ASBR check timer. */
|
|
|
|
struct event *t_asbr_nssa_redist_update; /* ASBR NSSA redistribution
|
2021-04-12 15:34:20 +02:00
|
|
|
update timer. */
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_distribute_update; /* Distirbute list update timer. */
|
|
|
|
struct event *t_spf_calc; /* SPF calculation timer. */
|
|
|
|
struct event *t_ase_calc; /* ASE calculation timer. */
|
|
|
|
struct event *t_opaque_lsa_self; /* Type-11 Opaque-LSAs origin event. */
|
|
|
|
struct event *t_sr_update; /* Segment Routing update timer */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
ospfd: Fix maxage/flush to not try flood twice, remember maxages for longer
2006-05-30 Paul Jakma <paul.jakma@sun.com>
* (general) Fix confusion around MaxAge-ing and problem with
high-latency networks. Analysis and suggested fixes by
Phillip Spagnolo, in [quagga-dev 4132], on which this commit
expands slightly.
* ospf_flood.{c,h}: (ospf_lsa_flush) new function.
Scope-general form of existing flush functions, essentially
the dormant ospf_maxage_flood() but without the ambiguity of
whether it is responsible for flooding.
* ospf_lsa.c: (ospf_lsa_maxage) Role minimised to simply setup
LSA on the Maxage list and schedule removal - no more.
ospf_lsa_flush* being the primary way to kick-off flushes
of LSAs.
Don't hardcode the remover-timer value, which was too
short for very high-latency networks.
(ospf_maxage_lsa_remover) Just do what needs to be done to
remove maxage LSAs from the maxage list, remove the call
to ospf_flood_through().
Don't hardcode remove-timer value.
(ospf_lsa_{install,flush_schedule}) ospf_lsa_flush is the correct
entrypoint to flushing maxaged LSAs.
(lsa_header_set) Use a define for the initial age, useful for
testing.
* ospf_opaque.c: (ospf_opaque_lsa_refresh) ditto.
(ospf_opaque_lsa_flush_schedule) ditto.
* ospfd.h: ({struct ospf,ospf_new}) Add maxage_delay parameter,
interval to wait before running the maxage_remover. Supply a
suitable default.
Add a define for OSPF_LSA_INITIAL_AGE, see lsa_header_set().
2010-01-25 00:36:20 +01:00
|
|
|
unsigned int maxage_delay; /* Delay on Maxage remover timer, sec */
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_maxage; /* MaxAge LSA remover timer. */
|
|
|
|
struct event *t_maxage_walker; /* MaxAge LSA checking timer. */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event
|
2005-11-26 14:31:11 +01:00
|
|
|
*t_deferred_shutdown; /* deferred/stub-router shutdown timer*/
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_write;
|
2015-05-20 02:24:43 +02:00
|
|
|
#define OSPF_WRITE_INTERFACE_COUNT_DEFAULT 20
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_default_routemap_timer;
|
2020-05-03 11:25:55 +02:00
|
|
|
|
2015-05-20 02:24:43 +02:00
|
|
|
int write_oi_count; /* Num of packets sent per thread invocation */
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_read;
|
2002-12-13 21:15:29 +01:00
|
|
|
int fd;
|
2005-02-23 16:43:01 +01:00
|
|
|
struct stream *ibuf;
|
2004-09-23 21:18:23 +02:00
|
|
|
struct list *oi_write_q;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Distribute lists out of other route sources. */
|
|
|
|
struct {
|
|
|
|
char *name;
|
|
|
|
struct access_list *list;
|
|
|
|
} dlist[ZEBRA_ROUTE_MAX];
|
2003-04-04 04:44:16 +02:00
|
|
|
#define DISTRIBUTE_NAME(O,T) (O)->dlist[T].name
|
|
|
|
#define DISTRIBUTE_LIST(O,T) (O)->dlist[T].list
|
2002-12-13 21:15:29 +01:00
|
|
|
|
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-20 03:03:42 +02:00
|
|
|
/* OSPF redistribute configuration */
|
|
|
|
struct list *redist[ZEBRA_ROUTE_MAX + 1];
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2015-05-20 02:46:33 +02:00
|
|
|
/* Redistribute tag info. */
|
2016-10-01 20:42:34 +02:00
|
|
|
route_tag_t
|
|
|
|
dtag[ZEBRA_ROUTE_MAX + 1]; // Pending: cant configure as of now
|
2015-05-20 02:46:33 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
int default_metric; /* Default metric for redistribute. */
|
|
|
|
|
2023-03-08 01:13:53 +01:00
|
|
|
/* NSSA default-information-originate */
|
|
|
|
struct {
|
|
|
|
/* # of NSSA areas requesting default information */
|
|
|
|
uint16_t refcnt;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Whether a default route known through non-OSPF protocol is
|
|
|
|
* present in the RIB.
|
|
|
|
*/
|
|
|
|
bool status;
|
|
|
|
} nssa_default_import_check;
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#define OSPF_LSA_REFRESHER_GRANULARITY 10
|
|
|
|
#define OSPF_LSA_REFRESHER_SLOTS \
|
2016-05-18 15:36:38 +02:00
|
|
|
((OSPF_LS_REFRESH_TIME + OSPF_LS_REFRESH_SHIFT) \
|
|
|
|
/ OSPF_LSA_REFRESHER_GRANULARITY \
|
|
|
|
+ 1)
|
2002-12-13 21:15:29 +01:00
|
|
|
struct {
|
2018-03-27 21:13:34 +02:00
|
|
|
uint16_t index;
|
2004-09-23 21:18:23 +02:00
|
|
|
struct list *qs[OSPF_LSA_REFRESHER_SLOTS];
|
2002-12-13 21:15:29 +01:00
|
|
|
} lsa_refresh_queue;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_lsa_refresher;
|
2002-12-13 21:15:29 +01:00
|
|
|
time_t lsa_refresher_started;
|
|
|
|
#define OSPF_LSA_REFRESH_INTERVAL_DEFAULT 10
|
2018-03-27 21:13:34 +02:00
|
|
|
uint16_t lsa_refresh_interval;
|
2022-08-26 09:58:37 +02:00
|
|
|
uint16_t lsa_refresh_timer;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Distance parameter. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t distance_all;
|
|
|
|
uint8_t distance_intra;
|
|
|
|
uint8_t distance_inter;
|
|
|
|
uint8_t distance_external;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Statistics for LSA origination. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t lsa_originate_count;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Statistics for LSA used for new instantiation. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t rx_lsa_count;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
struct route_table *distance_table;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-11-07 03:17:19 +01:00
|
|
|
/* Used during ospf instance going down send LSDB
|
|
|
|
* update to neighbors immediatly */
|
|
|
|
uint8_t inst_shutdown;
|
|
|
|
|
2020-08-19 14:19:19 +02:00
|
|
|
/* Enable or disable sending proactive ARP requests. */
|
|
|
|
bool proactive_arp;
|
|
|
|
#define OSPF_PROACTIVE_ARP_DEFAULT true
|
|
|
|
|
2017-11-21 02:21:03 +01:00
|
|
|
/* Redistributed external information. */
|
|
|
|
struct list *external[ZEBRA_ROUTE_MAX + 1];
|
2020-08-21 13:46:56 +02:00
|
|
|
#define EXTERNAL_INFO(E) (E->external_info)
|
|
|
|
|
2022-04-02 13:27:28 +02:00
|
|
|
/* Graceful restart Helper supported configs*/
|
2020-08-21 13:46:56 +02:00
|
|
|
/* Supported grace interval*/
|
|
|
|
uint32_t supported_grace_time;
|
|
|
|
|
|
|
|
/* Helper support
|
|
|
|
* Supported : True
|
|
|
|
* Not Supported : False.
|
|
|
|
*/
|
|
|
|
bool is_helper_supported;
|
|
|
|
|
|
|
|
/* Support for strict LSA check.
|
|
|
|
* if it is set,Helper aborted
|
|
|
|
* upon a TOPO change.
|
|
|
|
*/
|
|
|
|
bool strict_lsa_check;
|
|
|
|
|
|
|
|
/* Support as HELPER only for
|
|
|
|
* planned restarts.
|
|
|
|
*/
|
|
|
|
bool only_planned_restart;
|
|
|
|
|
|
|
|
/* This list contains the advertisement
|
|
|
|
* routerids which are not support for HELPERs.
|
|
|
|
*/
|
|
|
|
struct hash *enable_rtr_list;
|
|
|
|
|
|
|
|
/* HELPER for number of active
|
|
|
|
* RESTARTERs.
|
|
|
|
*/
|
|
|
|
uint16_t active_restarter_cnt;
|
|
|
|
|
|
|
|
/* last HELPER exit reason */
|
|
|
|
uint32_t last_exit_reason;
|
2017-11-21 02:21:03 +01:00
|
|
|
|
2020-08-15 09:27:25 +02:00
|
|
|
/* delay timer to process external routes
|
|
|
|
* with summary address.
|
|
|
|
*/
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_external_aggr;
|
2020-08-15 09:27:25 +02:00
|
|
|
|
|
|
|
/* delay interval in seconds */
|
2022-01-28 15:01:54 +01:00
|
|
|
uint16_t aggr_delay_interval;
|
2020-08-15 09:27:25 +02:00
|
|
|
|
|
|
|
/* Table of configured Aggregate addresses */
|
|
|
|
struct route_table *rt_aggr_tbl;
|
|
|
|
|
|
|
|
/* used as argument for aggr delay
|
|
|
|
* timer thread.
|
|
|
|
*/
|
|
|
|
int aggr_action;
|
|
|
|
|
2021-02-11 11:05:12 +01:00
|
|
|
/* Max number of multiple paths
|
|
|
|
* to support ECMP.
|
|
|
|
*/
|
|
|
|
uint16_t max_multipath;
|
|
|
|
|
2020-07-22 19:31:14 +02:00
|
|
|
/* MPLS LDP-IGP Sync */
|
|
|
|
struct ldp_sync_info_cmd ldp_sync_cmd;
|
|
|
|
|
2021-05-31 15:27:51 +02:00
|
|
|
/* OSPF Graceful Restart info */
|
|
|
|
struct ospf_gr_info gr_info;
|
|
|
|
|
2020-08-05 10:44:21 +02:00
|
|
|
/* TI-LFA support for all interfaces. */
|
|
|
|
bool ti_lfa_enabled;
|
2020-10-26 12:27:09 +01:00
|
|
|
enum protection_type ti_lfa_protection_type;
|
2020-08-05 10:44:21 +02:00
|
|
|
|
2022-11-21 11:32:53 +01:00
|
|
|
/* Flood Reduction configuration state */
|
|
|
|
bool fr_configured;
|
|
|
|
|
2023-04-06 19:40:23 +02:00
|
|
|
/* Socket buffer sizes */
|
|
|
|
uint32_t recv_sock_bufsize;
|
|
|
|
uint32_t send_sock_bufsize;
|
|
|
|
|
2023-03-29 22:58:25 +02:00
|
|
|
/* Per-interface write socket */
|
|
|
|
bool intf_socket_enabled;
|
|
|
|
|
2016-12-07 13:25:38 +01:00
|
|
|
QOBJ_FIELDS;
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
2016-12-07 13:25:38 +01:00
|
|
|
DECLARE_QOBJ_TYPE(ospf);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2020-11-20 13:35:04 +01:00
|
|
|
enum ospf_ti_lfa_p_q_space_adjacency {
|
|
|
|
OSPF_TI_LFA_P_Q_SPACE_ADJACENT,
|
|
|
|
OSPF_TI_LFA_P_Q_SPACE_NON_ADJACENT,
|
|
|
|
};
|
|
|
|
|
2020-08-05 10:44:21 +02:00
|
|
|
enum ospf_ti_lfa_node_type {
|
|
|
|
OSPF_TI_LFA_UNDEFINED_NODE,
|
|
|
|
OSPF_TI_LFA_PQ_NODE,
|
|
|
|
OSPF_TI_LFA_P_NODE,
|
|
|
|
OSPF_TI_LFA_Q_NODE,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ospf_ti_lfa_node_info {
|
|
|
|
struct vertex *node;
|
|
|
|
enum ospf_ti_lfa_node_type type;
|
|
|
|
struct in_addr nexthop;
|
|
|
|
};
|
|
|
|
|
2020-11-20 13:35:04 +01:00
|
|
|
struct ospf_ti_lfa_inner_backup_path_info {
|
|
|
|
struct ospf_ti_lfa_node_info p_node_info;
|
|
|
|
struct ospf_ti_lfa_node_info q_node_info;
|
|
|
|
struct mpls_label_stack *label_stack;
|
|
|
|
};
|
|
|
|
|
2020-10-26 12:27:09 +01:00
|
|
|
struct protected_resource {
|
|
|
|
enum protection_type type;
|
|
|
|
|
|
|
|
/* Link Protection */
|
|
|
|
struct router_lsa_link *link;
|
|
|
|
|
|
|
|
/* Node Protection */
|
|
|
|
struct in_addr router_id;
|
|
|
|
};
|
|
|
|
|
2020-08-05 10:44:21 +02:00
|
|
|
PREDECL_RBTREE_UNIQ(q_spaces);
|
|
|
|
struct q_space {
|
|
|
|
struct vertex *root;
|
|
|
|
struct list *vertex_list;
|
|
|
|
struct mpls_label_stack *label_stack;
|
|
|
|
struct in_addr nexthop;
|
2020-11-18 17:38:27 +01:00
|
|
|
struct list *pc_path;
|
2020-11-20 13:35:04 +01:00
|
|
|
struct ospf_ti_lfa_node_info *p_node_info;
|
|
|
|
struct ospf_ti_lfa_node_info *q_node_info;
|
2020-08-05 10:44:21 +02:00
|
|
|
struct q_spaces_item q_spaces_item;
|
|
|
|
};
|
|
|
|
|
|
|
|
PREDECL_RBTREE_UNIQ(p_spaces);
|
|
|
|
struct p_space {
|
|
|
|
struct vertex *root;
|
2020-10-26 12:27:09 +01:00
|
|
|
struct protected_resource *protected_resource;
|
2020-08-05 10:44:21 +02:00
|
|
|
struct q_spaces_head *q_spaces;
|
|
|
|
struct list *vertex_list;
|
|
|
|
struct vertex *pc_spf;
|
|
|
|
struct list *pc_vertex_list;
|
|
|
|
struct p_spaces_item p_spaces_item;
|
|
|
|
};
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* OSPF area structure. */
|
|
|
|
struct ospf_area {
|
|
|
|
/* OSPF instance. */
|
2003-03-25 06:07:42 +01:00
|
|
|
struct ospf *ospf;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Zebra interface list belonging to the area. */
|
2004-09-23 21:18:23 +02:00
|
|
|
struct list *oiflist;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Area ID. */
|
|
|
|
struct in_addr area_id;
|
|
|
|
|
|
|
|
/* Area ID format. */
|
2017-05-19 20:38:02 +02:00
|
|
|
int area_id_fmt;
|
|
|
|
#define OSPF_AREA_ID_FMT_DOTTEDQUAD 1
|
|
|
|
#define OSPF_AREA_ID_FMT_DECIMAL 2
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Address range. */
|
2004-09-23 21:18:23 +02:00
|
|
|
struct list *address_range;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Configured variables. */
|
|
|
|
int external_routing; /* ExternalRoutingCapability. */
|
|
|
|
int no_summary; /* Don't inject summaries into stub.*/
|
|
|
|
int shortcut_configured; /* Area configured as shortcut. */
|
|
|
|
#define OSPF_SHORTCUT_DEFAULT 0
|
|
|
|
#define OSPF_SHORTCUT_ENABLE 1
|
|
|
|
#define OSPF_SHORTCUT_DISABLE 2
|
|
|
|
int shortcut_capability; /* Other ABRs agree on S-bit */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t default_cost; /* StubDefaultCost. */
|
2002-12-13 21:15:29 +01:00
|
|
|
int auth_type; /* Authentication type. */
|
2020-11-02 15:28:52 +01:00
|
|
|
int suppress_fa; /* Suppress forwarding address in NSSA ABR */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t NSSATranslatorRole; /* NSSA configured role */
|
2002-12-13 21:15:29 +01:00
|
|
|
#define OSPF_NSSA_ROLE_NEVER 0
|
2003-07-12 23:30:57 +02:00
|
|
|
#define OSPF_NSSA_ROLE_CANDIDATE 1
|
|
|
|
#define OSPF_NSSA_ROLE_ALWAYS 2
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t NSSATranslatorState; /* NSSA operational role */
|
2003-07-12 23:30:57 +02:00
|
|
|
#define OSPF_NSSA_TRANSLATE_DISABLED 0
|
|
|
|
#define OSPF_NSSA_TRANSLATE_ENABLED 1
|
2003-06-22 10:32:35 +02:00
|
|
|
int NSSATranslatorStabilityInterval;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t transit; /* TransitCapability. */
|
2002-12-13 21:15:29 +01:00
|
|
|
#define OSPF_TRANSIT_FALSE 0
|
|
|
|
#define OSPF_TRANSIT_TRUE 1
|
|
|
|
struct route_table *ranges; /* Configured Area Ranges. */
|
2023-03-08 01:13:53 +01:00
|
|
|
struct route_table *nssa_ranges; /* Configured NSSA Area Ranges. */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2005-10-29 Paul Jakma <paul.jakma@sun.com>
* (general) RFC3137 stub-router support
* ospfd.h: Add OSPF_OUTPUT_COST_INFINITE define.
(struct ospf_master) Add a OSPF_MASTER_SHUTDOWN flag for
options, to allow shutdown to distinguish between complete
shutdown and shutdown of a subset of ospf instances.
(struct ospf)
Add stub_router_{startup,shutdown_}time, configuration of startup
and shutdown time for stub-router.
Add t_graceful_shutdown struct thread, timer for graceful
shutdown, if needed.
(struct ospf_area) Add stub_router_state - run time state of
stub-router for an area. Add flags for ADMIN, IS and WAS
states.
Add t_stub_router, timer thread to resend router-lsa for an
area.
* ospf_lsa.c: (ospf_link_cost) new simple function to spit out
either the given lnks cost or infinite cost if stub-router is
in effect.
(lsa_link_{ptop,broadcast,virtuallink,ptomp}_set) use
previous function for transit-links.
(ospf_stub_router_timer) timer thread for end of startup stub
router. Change state as required for the area and setup
re-origination of router-lsa.
(ospf_stub_router_check) Check/do whether stub-router should be
enabled, and whether it requires timer to be setup.
(ospf_router_lsa_new) call previous function at top.
(ospf_router_lsa_originate) no external callers, made static.
* ospf_lsa.h: (ospf_router_lsa_originate) removed.
* ospf_main.c: (sigint) make static.
remove call to exit, as ospf_terminate now deals with
exiting.
* ospf_route.c: (ospf_terminate) removed, now in ospfd.c.
* ospf_vty.c: (show_ip_ospf_area) print out state of
stub-router, if active.
(show_ip_ospf) print out configuration of stub-router
support, and details of graceful-shutdown if the timer is
active.
((no)?ospf_max_metric_router_lsa_{admin,startup,shutdown}) new
commands to (de-)?configure stub-router support.
(config_write_stub_router) write out config of stub-router.
(ospf_config_write) call previous.
(ospf_vty_init) install the new stub-router commands.
* ospfd.c: various functions made static.
(ospf_new) Set defaults for stub-router. Graceful shutdown
is made to default on, just to be adventerous.
(ospf_graceful_shutdown_finish) new function, final part of
shutdown.
(ospf_graceful_shutdown_timer) timer thread wrapper for
graceful-shutdown.
(ospf_graceful_shutdown_check) check whether to setup timer
for shutdown or proceed directly to final shutdown.
(ospf_terminate) moved here from ospf_route.c, call
ospf_finish for each instance.
(ospf_finish) renamed to ospf_finish_final and made static.
(ospf_finish) new function, exported wrapper around
ospf_graceful_shutdown_check.
(ospf_finish_final) complete shutdown of an instance.
Add missing TIMER_OFF's of two timer threads.
(ospf_area_free) opaque self lsa timer should be turned off.
2005-10-29 14:50:09 +02:00
|
|
|
/* RFC3137 stub router state flags for area */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t stub_router_state;
|
2005-10-29 Paul Jakma <paul.jakma@sun.com>
* (general) RFC3137 stub-router support
* ospfd.h: Add OSPF_OUTPUT_COST_INFINITE define.
(struct ospf_master) Add a OSPF_MASTER_SHUTDOWN flag for
options, to allow shutdown to distinguish between complete
shutdown and shutdown of a subset of ospf instances.
(struct ospf)
Add stub_router_{startup,shutdown_}time, configuration of startup
and shutdown time for stub-router.
Add t_graceful_shutdown struct thread, timer for graceful
shutdown, if needed.
(struct ospf_area) Add stub_router_state - run time state of
stub-router for an area. Add flags for ADMIN, IS and WAS
states.
Add t_stub_router, timer thread to resend router-lsa for an
area.
* ospf_lsa.c: (ospf_link_cost) new simple function to spit out
either the given lnks cost or infinite cost if stub-router is
in effect.
(lsa_link_{ptop,broadcast,virtuallink,ptomp}_set) use
previous function for transit-links.
(ospf_stub_router_timer) timer thread for end of startup stub
router. Change state as required for the area and setup
re-origination of router-lsa.
(ospf_stub_router_check) Check/do whether stub-router should be
enabled, and whether it requires timer to be setup.
(ospf_router_lsa_new) call previous function at top.
(ospf_router_lsa_originate) no external callers, made static.
* ospf_lsa.h: (ospf_router_lsa_originate) removed.
* ospf_main.c: (sigint) make static.
remove call to exit, as ospf_terminate now deals with
exiting.
* ospf_route.c: (ospf_terminate) removed, now in ospfd.c.
* ospf_vty.c: (show_ip_ospf_area) print out state of
stub-router, if active.
(show_ip_ospf) print out configuration of stub-router
support, and details of graceful-shutdown if the timer is
active.
((no)?ospf_max_metric_router_lsa_{admin,startup,shutdown}) new
commands to (de-)?configure stub-router support.
(config_write_stub_router) write out config of stub-router.
(ospf_config_write) call previous.
(ospf_vty_init) install the new stub-router commands.
* ospfd.c: various functions made static.
(ospf_new) Set defaults for stub-router. Graceful shutdown
is made to default on, just to be adventerous.
(ospf_graceful_shutdown_finish) new function, final part of
shutdown.
(ospf_graceful_shutdown_timer) timer thread wrapper for
graceful-shutdown.
(ospf_graceful_shutdown_check) check whether to setup timer
for shutdown or proceed directly to final shutdown.
(ospf_terminate) moved here from ospf_route.c, call
ospf_finish for each instance.
(ospf_finish) renamed to ospf_finish_final and made static.
(ospf_finish) new function, exported wrapper around
ospf_graceful_shutdown_check.
(ospf_finish_final) complete shutdown of an instance.
Add missing TIMER_OFF's of two timer threads.
(ospf_area_free) opaque self lsa timer should be turned off.
2005-10-29 14:50:09 +02:00
|
|
|
#define OSPF_AREA_ADMIN_STUB_ROUTED (1 << 0) /* admin stub-router set */
|
|
|
|
#define OSPF_AREA_IS_STUB_ROUTED (1 << 1) /* stub-router active */
|
|
|
|
#define OSPF_AREA_WAS_START_STUB_ROUTED (1 << 2) /* startup SR was done */
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Area related LSDBs[Type1-4]. */
|
|
|
|
struct ospf_lsdb *lsdb;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Self-originated LSAs. */
|
|
|
|
struct ospf_lsa *router_lsa_self;
|
2004-09-23 21:18:23 +02:00
|
|
|
struct list *opaque_lsa_self; /* Type-10 Opaque-LSAs */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Area announce list. */
|
|
|
|
struct {
|
|
|
|
char *name;
|
|
|
|
struct access_list *list;
|
2008-02-26 10:16:09 +01:00
|
|
|
} _export;
|
|
|
|
#define EXPORT_NAME(A) (A)->_export.name
|
|
|
|
#define EXPORT_LIST(A) (A)->_export.list
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Area acceptance list. */
|
|
|
|
struct {
|
|
|
|
char *name;
|
|
|
|
struct access_list *list;
|
|
|
|
} import;
|
|
|
|
#define IMPORT_NAME(A) (A)->import.name
|
|
|
|
#define IMPORT_LIST(A) (A)->import.list
|
|
|
|
|
|
|
|
/* Type 3 LSA Area prefix-list. */
|
|
|
|
struct {
|
|
|
|
char *name;
|
|
|
|
struct prefix_list *list;
|
|
|
|
} plist_in;
|
|
|
|
#define PREFIX_LIST_IN(A) (A)->plist_in.list
|
|
|
|
#define PREFIX_NAME_IN(A) (A)->plist_in.name
|
|
|
|
|
|
|
|
struct {
|
|
|
|
char *name;
|
|
|
|
struct prefix_list *list;
|
|
|
|
} plist_out;
|
|
|
|
#define PREFIX_LIST_OUT(A) (A)->plist_out.list
|
|
|
|
#define PREFIX_NAME_OUT(A) (A)->plist_out.name
|
|
|
|
|
2023-03-08 01:13:53 +01:00
|
|
|
/* NSSA default-information-originate */
|
|
|
|
struct {
|
|
|
|
bool enabled;
|
|
|
|
int metric_type;
|
|
|
|
int metric_value;
|
|
|
|
} nssa_default_originate;
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Shortest Path Tree. */
|
|
|
|
struct vertex *spf;
|
2020-08-25 16:13:08 +02:00
|
|
|
struct list *spf_vertex_list;
|
|
|
|
|
2020-08-17 15:04:41 +02:00
|
|
|
bool spf_dry_run; /* flag for checking if the SPF calculation is
|
|
|
|
intended for the local RIB */
|
|
|
|
bool spf_root_node; /* flag for checking if the calculating node is the
|
|
|
|
root node of the SPF tree */
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2020-08-05 10:44:21 +02:00
|
|
|
/* TI-LFA protected link for SPF calculations */
|
2020-10-26 12:27:09 +01:00
|
|
|
struct protected_resource *spf_protected_resource;
|
2020-08-05 10:44:21 +02:00
|
|
|
|
|
|
|
/* P/Q spaces for TI-LFA */
|
|
|
|
struct p_spaces_head *p_spaces;
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Threads. */
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_stub_router; /* Stub-router timer */
|
|
|
|
struct event *t_opaque_lsa_self; /* Type-10 Opaque-LSAs origin. */
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Statistics field. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t spf_calculation; /* SPF Calculation Count. */
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2020-10-13 13:53:04 +02:00
|
|
|
/* reverse SPF (used for TI-LFA Q spaces) */
|
|
|
|
bool spf_reversed;
|
|
|
|
|
2015-05-20 01:36:05 +02:00
|
|
|
/* Time stamps. */
|
|
|
|
struct timeval ts_spf; /* SPF calculation time stamp. */
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Router count. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t abr_count; /* ABR router in this area. */
|
|
|
|
uint32_t asbr_count; /* ASBR router in this area. */
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Counters. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t act_ints; /* Active interfaces. */
|
|
|
|
uint32_t full_nbrs; /* Fully adjacent neighbors. */
|
|
|
|
uint32_t full_vls; /* Fully adjacent virtual neighbors. */
|
2022-11-21 11:32:53 +01:00
|
|
|
|
|
|
|
struct ospf_area_fr_info fr_info; /* Flood reduction info. */
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* OSPF config network structure. */
|
|
|
|
struct ospf_network {
|
|
|
|
/* Area ID. */
|
|
|
|
struct in_addr area_id;
|
2017-05-19 20:38:02 +02:00
|
|
|
int area_id_fmt;
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* OSPF NBMA neighbor structure. */
|
|
|
|
struct ospf_nbr_nbma {
|
|
|
|
/* Neighbor IP address. */
|
|
|
|
struct in_addr addr;
|
|
|
|
|
|
|
|
/* OSPF interface. */
|
|
|
|
struct ospf_interface *oi;
|
|
|
|
|
|
|
|
/* OSPF neighbor structure. */
|
|
|
|
struct ospf_neighbor *nbr;
|
|
|
|
|
|
|
|
/* Neighbor priority. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t priority;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Poll timer value. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t v_poll;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Poll timer thread. */
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_poll;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* State change. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t state_change;
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Macro. */
|
|
|
|
#define OSPF_AREA_SAME(X, Y) \
|
|
|
|
(memcmp((X->area_id), (Y->area_id), IPV4_MAX_BYTELEN) == 0)
|
|
|
|
|
2003-04-04 04:44:16 +02:00
|
|
|
#define IS_OSPF_ABR(O) ((O)->flags & OSPF_FLAG_ABR)
|
|
|
|
#define IS_OSPF_ASBR(O) ((O)->flags & OSPF_FLAG_ASBR)
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
#define OSPF_IS_AREA_ID_BACKBONE(I) ((I).s_addr == OSPF_AREA_BACKBONE)
|
|
|
|
#define OSPF_IS_AREA_BACKBONE(A) OSPF_IS_AREA_ID_BACKBONE ((A)->area_id)
|
|
|
|
|
|
|
|
#ifdef roundup
|
|
|
|
# define ROUNDUP(val, gran) roundup(val, gran)
|
|
|
|
#else /* roundup */
|
|
|
|
# define ROUNDUP(val, gran) (((val) - 1 | (gran) - 1) + 1)
|
|
|
|
#endif /* roundup */
|
|
|
|
|
|
|
|
#define LSA_OPTIONS_GET(area) \
|
|
|
|
(((area)->external_routing == OSPF_AREA_DEFAULT) ? OSPF_OPTION_E : 0)
|
2003-07-12 23:30:57 +02:00
|
|
|
#define LSA_OPTIONS_NSSA_GET(area) \
|
|
|
|
(((area)->external_routing == OSPF_AREA_NSSA) ? OSPF_OPTION_NP : 0)
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2022-05-20 20:19:08 +02:00
|
|
|
#define OSPF_TIMER_ON(T, F, V) event_add_timer(master, (F), ospf, (V), &(T))
|
|
|
|
#define OSPF_AREA_TIMER_ON(T, F, V) \
|
|
|
|
event_add_timer(master, (F), area, (V), &(T))
|
|
|
|
#define OSPF_POLL_TIMER_ON(T, F, V) \
|
|
|
|
event_add_timer(master, (F), nbr_nbma, (V), &(T))
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2003-04-04 04:44:16 +02:00
|
|
|
/* Extern variables. */
|
|
|
|
extern struct ospf_master *om;
|
2021-01-28 00:41:07 +01:00
|
|
|
extern unsigned short ospf_instance;
|
2009-05-15 19:47:45 +02:00
|
|
|
extern const int ospf_redistributed_proto_max;
|
2002-12-13 21:15:29 +01:00
|
|
|
extern struct zclient *zclient;
|
2023-03-07 20:14:41 +01:00
|
|
|
extern struct event_loop *master;
|
2002-12-13 21:15:29 +01:00
|
|
|
extern int ospf_zlog;
|
2017-10-11 16:11:07 +02:00
|
|
|
extern struct zebra_privs_t ospfd_privs;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Prototypes. */
|
2018-03-27 21:13:34 +02:00
|
|
|
extern const char *ospf_redist_string(unsigned int route_type);
|
2022-06-08 16:37:08 +02:00
|
|
|
extern struct ospf *ospf_lookup_instance(unsigned short instance);
|
2021-01-28 00:41:07 +01:00
|
|
|
extern struct ospf *ospf_lookup(unsigned short instance, const char *name);
|
2019-08-01 18:49:50 +02:00
|
|
|
extern struct ospf *ospf_get(unsigned short instance, const char *name,
|
|
|
|
bool *created);
|
2020-08-05 10:44:21 +02:00
|
|
|
extern struct ospf *ospf_new_alloc(unsigned short instance, const char *name);
|
2018-03-27 21:13:34 +02:00
|
|
|
extern struct ospf *ospf_lookup_by_inst_name(unsigned short instance,
|
2017-08-25 22:51:12 +02:00
|
|
|
const char *name);
|
|
|
|
extern struct ospf *ospf_lookup_by_vrf_id(vrf_id_t vrf_id);
|
2021-03-29 13:47:43 +02:00
|
|
|
extern uint32_t ospf_count_area_params(struct ospf *ospf);
|
2022-06-08 16:37:08 +02:00
|
|
|
extern void ospf_finish(struct ospf *ospf);
|
2020-12-23 14:20:22 +01:00
|
|
|
extern void ospf_process_refresh_data(struct ospf *ospf, bool reset);
|
2005-05-06 23:37:42 +02:00
|
|
|
extern void ospf_router_id_update(struct ospf *ospf);
|
2020-12-23 14:20:22 +01:00
|
|
|
extern void ospf_process_reset(struct ospf *ospf);
|
|
|
|
extern void ospf_neighbor_reset(struct ospf *ospf, struct in_addr nbr_id,
|
|
|
|
const char *nbr_str);
|
2022-06-08 16:37:08 +02:00
|
|
|
extern int ospf_network_set(struct ospf *ospf, struct prefix_ipv4 *p,
|
|
|
|
struct in_addr area_id, int df);
|
|
|
|
extern int ospf_network_unset(struct ospf *ospf, struct prefix_ipv4 *p,
|
|
|
|
struct in_addr aread_id);
|
|
|
|
extern int ospf_area_display_format_set(struct ospf *ospf,
|
|
|
|
struct ospf_area *area, int df);
|
|
|
|
extern int ospf_area_stub_set(struct ospf *ospf, struct in_addr area_id);
|
|
|
|
extern int ospf_area_stub_unset(struct ospf *ospf, struct in_addr area_id);
|
|
|
|
extern int ospf_area_no_summary_set(struct ospf *ospf, struct in_addr area_id);
|
|
|
|
extern int ospf_area_no_summary_unset(struct ospf *ospf,
|
|
|
|
struct in_addr area_id);
|
|
|
|
extern int ospf_area_nssa_set(struct ospf *ospf, struct in_addr area_id);
|
2023-03-08 01:13:53 +01:00
|
|
|
extern int ospf_area_nssa_unset(struct ospf *ospf, struct in_addr area_id);
|
2020-11-02 15:28:52 +01:00
|
|
|
extern int ospf_area_nssa_suppress_fa_set(struct ospf *ospf,
|
|
|
|
struct in_addr area_id);
|
|
|
|
extern int ospf_area_nssa_suppress_fa_unset(struct ospf *ospf,
|
|
|
|
struct in_addr area_id);
|
2022-06-08 16:37:08 +02:00
|
|
|
extern int ospf_area_nssa_translator_role_set(struct ospf *ospf,
|
|
|
|
struct in_addr area_id, int role);
|
2023-03-08 01:13:53 +01:00
|
|
|
extern void ospf_area_nssa_default_originate_set(struct ospf *ospf,
|
|
|
|
struct in_addr area_id,
|
|
|
|
int metric, int metric_type);
|
|
|
|
extern void ospf_area_nssa_default_originate_unset(struct ospf *ospf,
|
|
|
|
struct in_addr area_id);
|
2022-06-08 16:37:08 +02:00
|
|
|
extern int ospf_area_export_list_set(struct ospf *ospf,
|
|
|
|
struct ospf_area *area_id,
|
|
|
|
const char *list_name);
|
|
|
|
extern int ospf_area_export_list_unset(struct ospf *ospf,
|
|
|
|
struct ospf_area *area_id);
|
|
|
|
extern int ospf_area_import_list_set(struct ospf *ospf,
|
|
|
|
struct ospf_area *area_id,
|
|
|
|
const char *name);
|
|
|
|
extern int ospf_area_import_list_unset(struct ospf *ospf,
|
|
|
|
struct ospf_area *area_id);
|
|
|
|
extern int ospf_area_shortcut_set(struct ospf *ospf, struct ospf_area *area_id,
|
|
|
|
int mode);
|
|
|
|
extern int ospf_area_shortcut_unset(struct ospf *ospf,
|
|
|
|
struct ospf_area *area_id);
|
|
|
|
extern int ospf_timers_refresh_set(struct ospf *ospf, int interval);
|
|
|
|
extern int ospf_timers_refresh_unset(struct ospf *ospf);
|
2020-12-23 14:20:22 +01:00
|
|
|
void ospf_area_lsdb_discard_delete(struct ospf_area *area);
|
2022-06-08 16:37:08 +02:00
|
|
|
extern int ospf_nbr_nbma_set(struct ospf *ospf, struct in_addr nbr_addr);
|
|
|
|
extern int ospf_nbr_nbma_unset(struct ospf *ospf, struct in_addr nbr_addr);
|
|
|
|
extern int ospf_nbr_nbma_priority_set(struct ospf *ospf,
|
|
|
|
struct in_addr nbr_addr,
|
|
|
|
uint8_t priority);
|
|
|
|
extern int ospf_nbr_nbma_priority_unset(struct ospf *ospf,
|
|
|
|
struct in_addr nbr_addr);
|
|
|
|
extern int ospf_nbr_nbma_poll_interval_set(struct ospf *ospf,
|
|
|
|
struct in_addr nbr_addr,
|
|
|
|
unsigned int interval);
|
|
|
|
extern int ospf_nbr_nbma_poll_interval_unset(struct ospf *ospf,
|
|
|
|
struct in_addr addr);
|
|
|
|
extern void ospf_if_update(struct ospf *ospf, struct interface *ifp);
|
|
|
|
extern void ospf_ls_upd_queue_empty(struct ospf_interface *oi);
|
2005-05-06 23:37:42 +02:00
|
|
|
extern void ospf_terminate(void);
|
2022-06-08 16:37:08 +02:00
|
|
|
extern void ospf_nbr_nbma_if_update(struct ospf *ospf,
|
|
|
|
struct ospf_interface *oi);
|
|
|
|
extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup(struct ospf *ospf,
|
|
|
|
struct in_addr nbr_addr);
|
|
|
|
extern int ospf_oi_count(struct interface *ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-08-05 10:44:21 +02:00
|
|
|
extern struct ospf_area *ospf_area_new(struct ospf *ospf,
|
|
|
|
struct in_addr area_id);
|
2022-06-08 16:37:08 +02:00
|
|
|
extern struct ospf_area *ospf_area_get(struct ospf *ospf,
|
|
|
|
struct in_addr area_id);
|
|
|
|
extern void ospf_area_check_free(struct ospf *ospf, struct in_addr area_id);
|
|
|
|
extern struct ospf_area *ospf_area_lookup_by_area_id(struct ospf *ospf,
|
|
|
|
struct in_addr area_id);
|
|
|
|
extern void ospf_area_add_if(struct ospf_area *oa, struct ospf_interface *oi);
|
|
|
|
extern void ospf_area_del_if(struct ospf_area *oa, struct ospf_interface *oi);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-06-08 16:37:08 +02:00
|
|
|
extern void ospf_interface_area_set(struct ospf *ospf, struct interface *ifp);
|
|
|
|
extern void ospf_interface_area_unset(struct ospf *ospf, struct interface *ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2005-05-06 23:37:42 +02:00
|
|
|
extern void ospf_route_map_init(void);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2023-03-07 20:14:41 +01:00
|
|
|
extern void ospf_master_init(struct event_loop *master);
|
2017-08-25 22:51:12 +02:00
|
|
|
extern void ospf_vrf_init(void);
|
|
|
|
extern void ospf_vrf_terminate(void);
|
|
|
|
extern void ospf_vrf_link(struct ospf *ospf, struct vrf *vrf);
|
|
|
|
extern void ospf_vrf_unlink(struct ospf *ospf, struct vrf *vrf);
|
|
|
|
const char *ospf_vrf_id_to_name(vrf_id_t vrf_id);
|
2022-06-08 16:37:08 +02:00
|
|
|
int ospf_area_nssa_no_summary_set(struct ospf *ospf, struct in_addr area_id);
|
2017-10-07 22:26:13 +02:00
|
|
|
|
2019-11-12 20:17:14 +01:00
|
|
|
const char *ospf_get_name(const struct ospf *ospf);
|
2020-08-05 10:44:21 +02:00
|
|
|
extern struct ospf_interface *add_ospf_interface(struct connected *co,
|
|
|
|
struct ospf_area *area);
|
2023-04-06 19:40:23 +02:00
|
|
|
/* Update socket bufsize(s), after config change */
|
|
|
|
void ospf_update_bufsize(struct ospf *ospf, uint32_t recvsize,
|
|
|
|
uint32_t sendsize);
|
2020-08-05 10:44:21 +02:00
|
|
|
|
|
|
|
extern int p_spaces_compare_func(const struct p_space *a,
|
|
|
|
const struct p_space *b);
|
|
|
|
extern int q_spaces_compare_func(const struct q_space *a,
|
|
|
|
const struct q_space *b);
|
2020-10-30 08:44:04 +01:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* _ZEBRA_OSPFD_H */
|