From 0ccad8a2b0b744d7ed64f53ab6e70a8d6aba69e6 Mon Sep 17 00:00:00 2001 From: Acee Lindem Date: Wed, 17 Apr 2024 20:14:56 +0000 Subject: ospfd: Add prefix-list filtering of OSPF neighbors on OSPF interface This commit adds the capabiity to filter OSPF neighbors using a prefix-list with rules matching the neighbor's IP source address. Configuration, filtering, immediate neighbor pruning, topo-tests, and documentation are included. The command is: ip ospf neighbor-filter [A.B.C.D] Signed-off-by: Acee Lindem --- ospfd/ospf_interface.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ospfd/ospf_interface.h') diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h index 721ab1a9d7..2e53fbfbfa 100644 --- a/ospfd/ospf_interface.h +++ b/ospfd/ospf_interface.h @@ -124,6 +124,9 @@ struct ospf_if_params { /* Opaque LSA capability at interface level (see RFC5250) */ DECLARE_IF_PARAM(bool, opaque_capable); + + /* Name of prefix-list name for packet source address filtering. */ + DECLARE_IF_PARAM(char *, nbr_filter_name); }; enum { MEMBER_ALLROUTERS = 0, @@ -242,6 +245,9 @@ struct ospf_interface { /* List of configured NBMA neighbor. */ struct list *nbr_nbma; + /* Configured prefix-list for filtering neighbors. */ + struct prefix_list *nbr_filter; + /* Graceful-Restart data. */ struct { struct { @@ -367,6 +373,7 @@ extern void ospf_crypt_key_add(struct list *list, struct crypt_key *key); extern int ospf_crypt_key_delete(struct list *list, uint8_t key_id); extern uint8_t ospf_default_iftype(struct interface *ifp); extern int ospf_interface_neighbor_count(struct ospf_interface *oi); +extern void ospf_intf_neighbor_filter_apply(struct ospf_interface *oi); /* Set all multicast memberships appropriately based on the type and state of the interface. */ -- cgit v1.2.3