1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Implements C.len operator for clist and eclist types.

Thanks to Sergey Popovich for the original patch.
This commit is contained in:
Ondrej Zajicek
2013-10-02 14:57:29 +02:00
parent 28a10f84cb
commit 7ccb36d330
4 changed files with 11 additions and 3 deletions

View File

@@ -1067,7 +1067,9 @@ interpret(struct f_inst *what)
switch(v1.type) {
case T_PREFIX: res.val.i = v1.val.px.len; break;
case T_PATH: res.val.i = as_path_getlen(v1.val.ad); break;
default: runtime( "Prefix or path expected" );
case T_CLIST: res.val.i = int_set_get_size(v1.val.ad); break;
case T_ECLIST: res.val.i = ec_set_get_size(v1.val.ad); break;
default: runtime( "Prefix, path, clist or eclist expected" );
}
break;
case P('c','p'): /* Convert prefix to ... */