From: Igor Putovny Date: Mon, 7 Jul 2025 14:07:52 +0000 (+0200) Subject: Add EC_SET_WALK X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f78834c4fb6fc5f3349828108ba4555a56720af;p=thirdparty%2Fbird.git Add EC_SET_WALK --- 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;