summaryrefslogtreecommitdiff
path: root/nest/a-path.c
diff options
context:
space:
mode:
Diffstat (limited to 'nest/a-path.c')
-rw-r--r--nest/a-path.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/nest/a-path.c b/nest/a-path.c
index 63ac402e..712e77a3 100644
--- a/nest/a-path.c
+++ b/nest/a-path.c
@@ -264,6 +264,29 @@ as_path_is_member(struct adata *path, u32 as)
return 0;
}
+int
+as_path_match_set(struct adata *path, struct f_tree *set)
+{
+ u8 *p = path->data;
+ u8 *q = p+path->length;
+ int i, n;
+
+ while (p<q)
+ {
+ n = p[1];
+ p += 2;
+ for (i=0; i<n; i++)
+ {
+ struct f_val v = {T_INT, .val.i = get_as(p)};
+ if (find_tree(set, v))
+ return 1;
+ p += BS;
+ }
+ }
+
+ return 0;
+}
+
struct pm_pos
{