summaryrefslogtreecommitdiff
path: root/nest/attrs.h
diff options
context:
space:
mode:
authorAlexander Zubkov <green@qrator.net>2021-12-28 04:05:05 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2021-12-28 04:07:09 +0100
commit0e1fd7ea6af8aaeb68a23e320c2a0a0a8480d6de (patch)
treeb95846c505ae8b4d7ae72988a9d48f23be811a1b /nest/attrs.h
parente15e465720c428e765ab88fd587afb4f4f5d70ae (diff)
Filter: Add operators to find minimum and maximum element of sets
Add operators .min and .max to find minumum or maximum element in sets of types: clist, eclist, lclist. Example usage: bgp_community.min bgp_ext_community.max filter(bgp_large_community, [(as1, as2, *)]).min Signed-off-by: Alexander Zubkov <green@qrator.net>
Diffstat (limited to 'nest/attrs.h')
-rw-r--r--nest/attrs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/nest/attrs.h b/nest/attrs.h
index 50da817b..ef2b95e6 100644
--- a/nest/attrs.h
+++ b/nest/attrs.h
@@ -218,6 +218,12 @@ struct adata *ec_set_del_nontrans(struct linpool *pool, const struct adata *set)
struct adata *int_set_sort(struct linpool *pool, const struct adata *src);
struct adata *ec_set_sort(struct linpool *pool, const struct adata *src);
struct adata *lc_set_sort(struct linpool *pool, const struct adata *src);
+int int_set_min(const struct adata *list, u32 *val);
+int ec_set_min(const struct adata *list, u64 *val);
+int lc_set_min(const struct adata *list, lcomm *val);
+int int_set_max(const struct adata *list, u32 *val);
+int ec_set_max(const struct adata *list, u64 *val);
+int lc_set_max(const struct adata *list, lcomm *val);
void ec_set_sort_x(struct adata *set); /* Sort in place */