summaryrefslogtreecommitdiffstats
path: root/bgpd/bgpd.h
diff options
context:
space:
mode:
authorPascal Mathis <mail@pascalmathis.com>2018-05-21 12:09:25 +0200
committerPascal Mathis <mail@pascalmathis.com>2018-05-27 19:41:25 +0200
commit70ee29b4db0465ce58da486d80aba5615fa04b2c (patch)
tree5be80c7fbf756bd10efcea283ae63406107e1845 /bgpd/bgpd.h
parentbgpd: Improve group overrides for AF flags (diff)
downloadfrr-70ee29b4db0465ce58da486d80aba5615fa04b2c.tar.xz
frr-70ee29b4db0465ce58da486d80aba5615fa04b2c.zip
bgpd: Improve group overrides for AF filters
This commit adds the same peer-group override capabilites as d122d7cf7 for all filter/map options that can be enabled/disabled on each address-family of a BGP peer. All currently existing filter/map options are being supported: filter-list, distribute-list, prefix-list, route-map and unsuppress-map To implement this behavior, a new peer attribute 'filter_override' has been added together with various PEER_FT_ (filter type) constants for tracking the state of each filter in the same way as it is being done with 'af_flags_override'. Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
Diffstat (limited to 'bgpd/bgpd.h')
-rw-r--r--bgpd/bgpd.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 334c73d2d..bfa80c3ce 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -1031,6 +1031,32 @@ struct peer {
/* Filter structure. */
struct bgp_filter filter[AFI_MAX][SAFI_MAX];
+ /*
+ * Parallel array to filter that indicates whether each filter
+ * originates from a peer-group or if it is config that is specific to
+ * this individual peer. If a filter is set independent of the
+ * peer-group the appropriate bit should be set here. If this peer is a
+ * peer-group, this memory region should be all zeros. The assumption
+ * is that the default state for all flags is unset. Due to filters
+ * having a direction (e.g. in/out/...), this array has a third
+ * dimension for storing the overrides independently per direction.
+ *
+ * Notes:
+ * - if a filter for an individual peer is unset, the corresponding
+ * override flag is unset and the peer is considered to be back in
+ * sync with the peer-group.
+ * - This does *not* contain the filter values, rather it contains
+ * whether the filter in filter (struct bgp_filter) is peer-specific.
+ */
+ uint8_t filter_override[AFI_MAX][SAFI_MAX][(FILTER_MAX > RMAP_MAX)
+ ? FILTER_MAX
+ : RMAP_MAX];
+#define PEER_FT_DISTRIBUTE_LIST (1 << 0) /* distribute-list */
+#define PEER_FT_FILTER_LIST (1 << 1) /* filter-list */
+#define PEER_FT_PREFIX_LIST (1 << 2) /* prefix-list */
+#define PEER_FT_ROUTE_MAP (1 << 3) /* route-map */
+#define PEER_FT_UNSUPPRESS_MAP (1 << 4) /* unsuppress-map */
+
/* ORF Prefix-list */
struct prefix_list *orf_plist[AFI_MAX][SAFI_MAX];