From 5f78834c4fb6fc5f3349828108ba4555a56720af Mon Sep 17 00:00:00 2001 From: Igor Putovny Date: Mon, 7 Jul 2025 16:07:52 +0200 Subject: [PATCH] Add EC_SET_WALK --- nest/attrs.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nest/attrs.h b/nest/attrs.h index 0475afa72..9521a6505 100644 --- a/nest/attrs.h +++ b/nest/attrs.h @@ -185,6 +185,15 @@ static inline u64 ec_ip4(enum ec_subtype kind, u64 key, u64 val) static inline u64 ec_generic(u64 key, u64 val) { return (key << 32) | val; } +#define EC_SET_WALK_BEGIN(ad) \ + do { \ + const u32 *_z = int_set_get_data(ad); \ + const int _len = ec_set_get_size(ad); \ + u64 ec = 0; \ + for (int _i = 0; _i < _len; ec = ec_get(_z, _i), _i += 2) + +#define EC_SET_WALK_END } while (0) + /* Large community value */ typedef struct lcomm { u32 asn; -- 2.47.2