summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_attr.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-11-02 18:35:20 +0100
committerDonald Sharp <sharpd@nvidia.com>2020-11-15 15:44:47 +0100
commit779fee9303e24223711c27065f000faa629dc9fa (patch)
treea901953dc30f2bdc8102b2fb2bf1c7bdf9ddf389 /bgpd/bgp_attr.h
parentbgpd: Convert attr->transit to use accessor functions (diff)
downloadfrr-779fee9303e24223711c27065f000faa629dc9fa.tar.xz
frr-779fee9303e24223711c27065f000faa629dc9fa.zip
bgpd: Abstract attr->cluster to accessor/set functions
Abstract the access of `attr->cluster` to appropriate accessor/set functionality. Future commits will allow us to move this data around to make `struct attr` smaller. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_attr.h')
-rw-r--r--bgpd/bgp_attr.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h
index 6f6dcf3a3..cfbf5d253 100644
--- a/bgpd/bgp_attr.h
+++ b/bgpd/bgp_attr.h
@@ -185,7 +185,7 @@ struct attr {
struct lcommunity *lcommunity;
/* Route-Reflector Cluster attribute */
- struct cluster_list *cluster;
+ struct cluster_list *cluster1;
/* Unknown transitive attribute. */
struct transit *transit;
@@ -331,7 +331,7 @@ struct transit {
#define BGP_CLUSTER_LIST_LENGTH(attr) \
(((attr)->flag & ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST)) \
- ? (attr)->cluster->length \
+ ? bgp_attr_get_cluster((attr))->length \
: 0)
typedef enum {
@@ -491,4 +491,15 @@ static inline void bgp_attr_set_transit(struct attr *attr,
{
attr->transit = transit;
}
+
+static inline struct cluster_list *bgp_attr_get_cluster(const struct attr *attr)
+{
+ return attr->cluster1;
+}
+
+static inline void bgp_attr_set_cluster(struct attr *attr,
+ struct cluster_list *cl)
+{
+ attr->cluster1 = cl;
+}
#endif /* _QUAGGA_BGP_ATTR_H */