mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Implements 'allow local as' option.
Similar to allowas-in option on other routers.
This commit is contained in:
@@ -244,10 +244,11 @@ as_path_get_first(struct adata *path, u32 *last_as)
|
||||
}
|
||||
|
||||
int
|
||||
as_path_is_member(struct adata *path, u32 as)
|
||||
as_path_contains(struct adata *path, u32 as, int min)
|
||||
{
|
||||
u8 *p = path->data;
|
||||
u8 *q = p+path->length;
|
||||
int num = 0;
|
||||
int i, n;
|
||||
|
||||
while (p<q)
|
||||
@@ -257,7 +258,8 @@ as_path_is_member(struct adata *path, u32 as)
|
||||
for(i=0; i<n; i++)
|
||||
{
|
||||
if (get_as(p) == as)
|
||||
return 1;
|
||||
if (++num == min)
|
||||
return 1;
|
||||
p += BS;
|
||||
}
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ int as_path_getlen(struct adata *path);
|
||||
int as_path_getlen_int(struct adata *path, int bs);
|
||||
int as_path_get_first(struct adata *path, u32 *orig_as);
|
||||
int as_path_get_last(struct adata *path, u32 *last_as);
|
||||
int as_path_is_member(struct adata *path, u32 as);
|
||||
int as_path_contains(struct adata *path, u32 as, int min);
|
||||
int as_path_match_set(struct adata *path, struct f_tree *set);
|
||||
struct adata *as_path_filter(struct linpool *pool, struct adata *path, struct f_tree *set, u32 key, int pos);
|
||||
|
||||
|
Reference in New Issue
Block a user