2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2002-12-13 21:15:29 +01:00
|
|
|
/*
|
2004-05-18 20:57:06 +02:00
|
|
|
* Copyright (C) 2003 Yasuhiro Ohara
|
2002-12-13 21:15:29 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OSPF6_INTRA_H
|
|
|
|
#define OSPF6_INTRA_H
|
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
/* Debug option */
|
|
|
|
extern unsigned char conf_debug_ospf6_brouter;
|
2020-03-27 13:39:01 +01:00
|
|
|
extern in_addr_t conf_debug_ospf6_brouter_specific_router_id;
|
|
|
|
extern in_addr_t conf_debug_ospf6_brouter_specific_area_id;
|
2006-05-15 12:39:30 +02:00
|
|
|
#define OSPF6_DEBUG_BROUTER_SUMMARY 0x01
|
|
|
|
#define OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER 0x02
|
|
|
|
#define OSPF6_DEBUG_BROUTER_SPECIFIC_AREA 0x04
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
#define OSPF6_DEBUG_BROUTER_ON() \
|
|
|
|
(conf_debug_ospf6_brouter |= OSPF6_DEBUG_BROUTER_SUMMARY)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
#define OSPF6_DEBUG_BROUTER_OFF() \
|
|
|
|
(conf_debug_ospf6_brouter &= ~OSPF6_DEBUG_BROUTER_SUMMARY)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
#define IS_OSPF6_DEBUG_BROUTER \
|
|
|
|
(conf_debug_ospf6_brouter & OSPF6_DEBUG_BROUTER_SUMMARY)
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
#define OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_ON(router_id) \
|
|
|
|
do { \
|
|
|
|
conf_debug_ospf6_brouter_specific_router_id = (router_id); \
|
|
|
|
conf_debug_ospf6_brouter |= \
|
|
|
|
OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER; \
|
|
|
|
} while (0)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
#define OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_OFF() \
|
|
|
|
do { \
|
|
|
|
conf_debug_ospf6_brouter_specific_router_id = 0; \
|
|
|
|
conf_debug_ospf6_brouter &= \
|
|
|
|
~OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER; \
|
|
|
|
} while (0)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
#define IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER \
|
|
|
|
(conf_debug_ospf6_brouter & OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
#define IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_ID(router_id) \
|
|
|
|
(IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER \
|
|
|
|
&& conf_debug_ospf6_brouter_specific_router_id == (router_id))
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
#define OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ON(area_id) \
|
|
|
|
do { \
|
|
|
|
conf_debug_ospf6_brouter_specific_area_id = (area_id); \
|
|
|
|
conf_debug_ospf6_brouter |= OSPF6_DEBUG_BROUTER_SPECIFIC_AREA; \
|
|
|
|
} while (0)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
#define OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_OFF() \
|
|
|
|
do { \
|
|
|
|
conf_debug_ospf6_brouter_specific_area_id = 0; \
|
|
|
|
conf_debug_ospf6_brouter &= \
|
|
|
|
~OSPF6_DEBUG_BROUTER_SPECIFIC_AREA; \
|
|
|
|
} while (0)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
#define IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA \
|
|
|
|
(conf_debug_ospf6_brouter & OSPF6_DEBUG_BROUTER_SPECIFIC_AREA)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2006-05-15 12:39:30 +02:00
|
|
|
#define IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(area_id) \
|
|
|
|
(IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA \
|
|
|
|
&& conf_debug_ospf6_brouter_specific_area_id == (area_id))
|
|
|
|
|
2013-08-24 10:00:37 +02:00
|
|
|
enum stub_router_mode {
|
|
|
|
OSPF6_NOT_STUB_ROUTER,
|
|
|
|
OSPF6_IS_STUB_ROUTER,
|
|
|
|
OSPF6_IS_STUB_ROUTER_V6,
|
|
|
|
};
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
#define ROUTER_LSDESC_IS_TYPE(t, x) \
|
|
|
|
((((struct ospf6_router_lsdesc *)(x))->type \
|
|
|
|
== OSPF6_ROUTER_LSDESC_##t) \
|
|
|
|
? 1 \
|
|
|
|
: 0)
|
|
|
|
#define ROUTER_LSDESC_GET_METRIC(x) \
|
|
|
|
(ntohs(((struct ospf6_router_lsdesc *)(x))->metric))
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
#define ROUTER_LSDESC_GET_IFID(x) \
|
|
|
|
(ntohl(((struct ospf6_router_lsdesc *)(x))->interface_id))
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
#define ROUTER_LSDESC_GET_NBR_IFID(x) \
|
|
|
|
(ntohl(((struct ospf6_router_lsdesc *)(x))->neighbor_interface_id))
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
#define ROUTER_LSDESC_GET_NBR_ROUTERID(x) \
|
|
|
|
(((struct ospf6_router_lsdesc *)(x))->neighbor_router_id)
|
|
|
|
|
2014-06-04 06:53:35 +02:00
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
#define OSPF6_ROUTER_LSA_SCHEDULE(oa) \
|
|
|
|
do { \
|
2017-04-25 00:33:25 +02:00
|
|
|
if (CHECK_FLAG((oa)->flag, OSPF6_AREA_ENABLE)) \
|
2022-05-20 20:19:08 +02:00
|
|
|
event_add_event(master, ospf6_router_lsa_originate, \
|
|
|
|
oa, 0, &(oa)->thread_router_lsa); \
|
2004-05-18 20:57:06 +02:00
|
|
|
} while (0)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
#define OSPF6_NETWORK_LSA_SCHEDULE(oi) \
|
|
|
|
do { \
|
2017-04-25 00:33:25 +02:00
|
|
|
if (!CHECK_FLAG((oi)->flag, OSPF6_INTERFACE_DISABLE)) \
|
2022-05-20 20:19:08 +02:00
|
|
|
event_add_event(master, ospf6_network_lsa_originate, \
|
|
|
|
oi, 0, &(oi)->thread_network_lsa); \
|
2004-05-18 20:57:06 +02:00
|
|
|
} while (0)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
#define OSPF6_LINK_LSA_SCHEDULE(oi) \
|
|
|
|
do { \
|
2017-04-25 00:33:25 +02:00
|
|
|
if (!CHECK_FLAG((oi)->flag, OSPF6_INTERFACE_DISABLE)) \
|
2022-05-20 20:19:08 +02:00
|
|
|
event_add_event(master, ospf6_link_lsa_originate, oi, \
|
|
|
|
0, &(oi)->thread_link_lsa); \
|
2004-05-18 20:57:06 +02:00
|
|
|
} while (0)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
#define OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(oa) \
|
|
|
|
do { \
|
2017-04-25 00:33:25 +02:00
|
|
|
if (CHECK_FLAG((oa)->flag, OSPF6_AREA_ENABLE)) \
|
2022-05-20 20:19:08 +02:00
|
|
|
event_add_event( \
|
2017-04-25 00:33:25 +02:00
|
|
|
master, ospf6_intra_prefix_lsa_originate_stub, \
|
|
|
|
oa, 0, &(oa)->thread_intra_prefix_lsa); \
|
2004-05-18 20:57:06 +02:00
|
|
|
} while (0)
|
2024-05-15 08:46:58 +02:00
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
#define OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT(oi) \
|
|
|
|
do { \
|
2017-04-25 00:33:25 +02:00
|
|
|
if (!CHECK_FLAG((oi)->flag, OSPF6_INTERFACE_DISABLE)) \
|
2022-05-20 20:19:08 +02:00
|
|
|
event_add_event( \
|
2017-04-25 00:33:25 +02:00
|
|
|
master, \
|
|
|
|
ospf6_intra_prefix_lsa_originate_transit, oi, \
|
|
|
|
0, &(oi)->thread_intra_prefix_lsa); \
|
2004-05-18 20:57:06 +02:00
|
|
|
} while (0)
|
2017-07-17 14:03:14 +02:00
|
|
|
|
ospf6d: Handle Premature Aging of LSAs
RFC 2328 (14.1) Premature aging of LSAs from
routing domain :
When ospf6d is going away (router going down),
send MAXAGEd self originated LSAs to all
neighbors in routing domain to trigger
Premature aging to remove from resepective LSDBs.
Neighbor Router Reboot:
Upon receiving Self-originate MAXAGEd LSA, simply
discard, Current copy could be non maxaged latest.
For neighbor advertised LSA's (current copy in LSDB)
is set to MAXAGE but received new LSA with Non-MAXAGE
(with current age), discard the current MAXAGE LSA,
Send latest copy of LSA to neighbors and update the
LSDB with new LSA.
When a neighbor transition to FULL, trigger AS-External
LSAs update from external LSDB to new neighbor.
Testing:
R1 ---- DUT --- R5
| \
R2 R3
|
R4
Area 1: R5 and DUT
Area 0: DUT, R1, R2, R3
Area 2: R2 R4
Add IPv6 static routes at R5
Redistribute kernel routes at R5,
Validate routes at R4, redistributed via backbone
to area 2.
Stop n start frr.service at R5 and validated
MAXAGE LSAs then recent age LSAs in Database at DUT-R4.
Validated external routes installed DUT to R4.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-01-26 23:53:43 +01:00
|
|
|
#define OSPF6_AS_EXTERN_LSA_SCHEDULE(oi) \
|
|
|
|
do { \
|
|
|
|
if (!CHECK_FLAG((oi)->flag, OSPF6_INTERFACE_DISABLE)) \
|
2022-05-20 20:19:08 +02:00
|
|
|
event_add_event(master, ospf6_orig_as_external_lsa, \
|
|
|
|
oi, 0, &(oi)->thread_as_extern_lsa); \
|
ospf6d: Handle Premature Aging of LSAs
RFC 2328 (14.1) Premature aging of LSAs from
routing domain :
When ospf6d is going away (router going down),
send MAXAGEd self originated LSAs to all
neighbors in routing domain to trigger
Premature aging to remove from resepective LSDBs.
Neighbor Router Reboot:
Upon receiving Self-originate MAXAGEd LSA, simply
discard, Current copy could be non maxaged latest.
For neighbor advertised LSA's (current copy in LSDB)
is set to MAXAGE but received new LSA with Non-MAXAGE
(with current age), discard the current MAXAGE LSA,
Send latest copy of LSA to neighbors and update the
LSDB with new LSA.
When a neighbor transition to FULL, trigger AS-External
LSAs update from external LSDB to new neighbor.
Testing:
R1 ---- DUT --- R5
| \
R2 R3
|
R4
Area 1: R5 and DUT
Area 0: DUT, R1, R2, R3
Area 2: R2 R4
Add IPv6 static routes at R5
Redistribute kernel routes at R5,
Validate routes at R4, redistributed via backbone
to area 2.
Stop n start frr.service at R5 and validated
MAXAGE LSAs then recent age LSAs in Database at DUT-R4.
Validated external routes installed DUT to R4.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-01-26 23:53:43 +01:00
|
|
|
} while (0)
|
|
|
|
|
2021-07-02 18:01:32 +02:00
|
|
|
#define OSPF6_ROUTER_LSA_EXECUTE(oa) \
|
|
|
|
do { \
|
|
|
|
if (CHECK_FLAG((oa)->flag, OSPF6_AREA_ENABLE)) \
|
2022-12-11 14:06:25 +01:00
|
|
|
event_execute(master, ospf6_router_lsa_originate, oa, \
|
2023-07-11 22:03:38 +02:00
|
|
|
0, NULL); \
|
2021-07-02 18:01:32 +02:00
|
|
|
} while (0)
|
|
|
|
|
2004-08-15 07:52:07 +02:00
|
|
|
#define OSPF6_NETWORK_LSA_EXECUTE(oi) \
|
|
|
|
do { \
|
2022-12-25 16:26:52 +01:00
|
|
|
EVENT_OFF((oi)->thread_network_lsa); \
|
2023-07-11 22:03:38 +02:00
|
|
|
event_execute(master, ospf6_network_lsa_originate, oi, 0, \
|
|
|
|
NULL); \
|
2004-08-15 07:52:07 +02:00
|
|
|
} while (0)
|
ospf6d: Handle Premature Aging of LSAs
RFC 2328 (14.1) Premature aging of LSAs from
routing domain :
When ospf6d is going away (router going down),
send MAXAGEd self originated LSAs to all
neighbors in routing domain to trigger
Premature aging to remove from resepective LSDBs.
Neighbor Router Reboot:
Upon receiving Self-originate MAXAGEd LSA, simply
discard, Current copy could be non maxaged latest.
For neighbor advertised LSA's (current copy in LSDB)
is set to MAXAGE but received new LSA with Non-MAXAGE
(with current age), discard the current MAXAGE LSA,
Send latest copy of LSA to neighbors and update the
LSDB with new LSA.
When a neighbor transition to FULL, trigger AS-External
LSAs update from external LSDB to new neighbor.
Testing:
R1 ---- DUT --- R5
| \
R2 R3
|
R4
Area 1: R5 and DUT
Area 0: DUT, R1, R2, R3
Area 2: R2 R4
Add IPv6 static routes at R5
Redistribute kernel routes at R5,
Validate routes at R4, redistributed via backbone
to area 2.
Stop n start frr.service at R5 and validated
MAXAGE LSAs then recent age LSAs in Database at DUT-R4.
Validated external routes installed DUT to R4.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-01-26 23:53:43 +01:00
|
|
|
|
2021-07-02 18:01:32 +02:00
|
|
|
#define OSPF6_LINK_LSA_EXECUTE(oi) \
|
|
|
|
do { \
|
|
|
|
if (!CHECK_FLAG((oi)->flag, OSPF6_INTERFACE_DISABLE)) \
|
2022-12-11 14:06:25 +01:00
|
|
|
event_execute(master, ospf6_link_lsa_originate, oi, \
|
2023-07-11 22:03:38 +02:00
|
|
|
0, NULL); \
|
2021-07-02 18:01:32 +02:00
|
|
|
} while (0)
|
|
|
|
|
2004-08-15 07:52:07 +02:00
|
|
|
#define OSPF6_INTRA_PREFIX_LSA_EXECUTE_TRANSIT(oi) \
|
|
|
|
do { \
|
2022-12-25 16:26:52 +01:00
|
|
|
EVENT_OFF((oi)->thread_intra_prefix_lsa); \
|
2022-12-11 14:06:25 +01:00
|
|
|
event_execute(master, \
|
|
|
|
ospf6_intra_prefix_lsa_originate_transit, oi, \
|
2023-07-11 22:03:38 +02:00
|
|
|
0, NULL); \
|
2004-08-15 07:52:07 +02:00
|
|
|
} while (0)
|
|
|
|
|
ospf6d: Handle Premature Aging of LSAs
RFC 2328 (14.1) Premature aging of LSAs from
routing domain :
When ospf6d is going away (router going down),
send MAXAGEd self originated LSAs to all
neighbors in routing domain to trigger
Premature aging to remove from resepective LSDBs.
Neighbor Router Reboot:
Upon receiving Self-originate MAXAGEd LSA, simply
discard, Current copy could be non maxaged latest.
For neighbor advertised LSA's (current copy in LSDB)
is set to MAXAGE but received new LSA with Non-MAXAGE
(with current age), discard the current MAXAGE LSA,
Send latest copy of LSA to neighbors and update the
LSDB with new LSA.
When a neighbor transition to FULL, trigger AS-External
LSAs update from external LSDB to new neighbor.
Testing:
R1 ---- DUT --- R5
| \
R2 R3
|
R4
Area 1: R5 and DUT
Area 0: DUT, R1, R2, R3
Area 2: R2 R4
Add IPv6 static routes at R5
Redistribute kernel routes at R5,
Validate routes at R4, redistributed via backbone
to area 2.
Stop n start frr.service at R5 and validated
MAXAGE LSAs then recent age LSAs in Database at DUT-R4.
Validated external routes installed DUT to R4.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-01-26 23:53:43 +01:00
|
|
|
#define OSPF6_AS_EXTERN_LSA_EXECUTE(oi) \
|
|
|
|
do { \
|
2022-12-25 16:26:52 +01:00
|
|
|
EVENT_OFF((oi)->thread_as_extern_lsa); \
|
2023-07-11 22:03:38 +02:00
|
|
|
event_execute(master, ospf6_orig_as_external_lsa, oi, 0, NULL);\
|
ospf6d: Handle Premature Aging of LSAs
RFC 2328 (14.1) Premature aging of LSAs from
routing domain :
When ospf6d is going away (router going down),
send MAXAGEd self originated LSAs to all
neighbors in routing domain to trigger
Premature aging to remove from resepective LSDBs.
Neighbor Router Reboot:
Upon receiving Self-originate MAXAGEd LSA, simply
discard, Current copy could be non maxaged latest.
For neighbor advertised LSA's (current copy in LSDB)
is set to MAXAGE but received new LSA with Non-MAXAGE
(with current age), discard the current MAXAGE LSA,
Send latest copy of LSA to neighbors and update the
LSDB with new LSA.
When a neighbor transition to FULL, trigger AS-External
LSAs update from external LSDB to new neighbor.
Testing:
R1 ---- DUT --- R5
| \
R2 R3
|
R4
Area 1: R5 and DUT
Area 0: DUT, R1, R2, R3
Area 2: R2 R4
Add IPv6 static routes at R5
Redistribute kernel routes at R5,
Validate routes at R4, redistributed via backbone
to area 2.
Stop n start frr.service at R5 and validated
MAXAGE LSAs then recent age LSAs in Database at DUT-R4.
Validated external routes installed DUT to R4.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-01-26 23:53:43 +01:00
|
|
|
} while (0)
|
2004-08-15 07:52:07 +02:00
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
/* Function Prototypes */
|
2018-03-27 21:13:34 +02:00
|
|
|
extern char *ospf6_router_lsdesc_lookup(uint8_t type, uint32_t interface_id,
|
|
|
|
uint32_t neighbor_interface_id,
|
|
|
|
uint32_t neighbor_router_id,
|
2008-08-15 14:45:30 +02:00
|
|
|
struct ospf6_lsa *lsa);
|
2018-03-27 21:13:34 +02:00
|
|
|
extern char *ospf6_network_lsdesc_lookup(uint32_t router_id,
|
2008-08-15 14:45:30 +02:00
|
|
|
struct ospf6_lsa *lsa);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2013-08-24 10:00:37 +02:00
|
|
|
extern int ospf6_router_is_stub_router(struct ospf6_lsa *lsa);
|
2022-03-01 22:18:12 +01:00
|
|
|
extern void ospf6_router_lsa_originate(struct event *thread);
|
|
|
|
extern void ospf6_network_lsa_originate(struct event *thread);
|
|
|
|
extern void ospf6_link_lsa_originate(struct event *thread);
|
|
|
|
extern void ospf6_intra_prefix_lsa_originate_transit(struct event *thread);
|
|
|
|
extern void ospf6_intra_prefix_lsa_originate_stub(struct event *thread);
|
2008-08-15 14:45:30 +02:00
|
|
|
extern void ospf6_intra_prefix_lsa_add(struct ospf6_lsa *lsa);
|
|
|
|
extern void ospf6_intra_prefix_lsa_remove(struct ospf6_lsa *lsa);
|
2022-03-01 22:18:12 +01:00
|
|
|
extern void ospf6_orig_as_external_lsa(struct event *thread);
|
2008-08-15 14:45:30 +02:00
|
|
|
extern void ospf6_intra_route_calculation(struct ospf6_area *oa);
|
|
|
|
extern void ospf6_intra_brouter_calculation(struct ospf6_area *oa);
|
2018-04-02 23:37:10 +02:00
|
|
|
extern void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa,
|
|
|
|
struct ospf6_route *old,
|
|
|
|
struct ospf6_route *route);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2008-08-15 14:45:30 +02:00
|
|
|
extern void ospf6_intra_init(void);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2008-08-15 14:45:30 +02:00
|
|
|
extern int config_write_ospf6_debug_brouter(struct vty *vty);
|
|
|
|
extern void install_element_ospf6_debug_brouter(void);
|
2006-05-15 12:39:30 +02:00
|
|
|
|
2004-05-18 20:57:06 +02:00
|
|
|
#endif /* OSPF6_LSA_H */
|