diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2008-10-27 00:20:22 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2008-10-27 00:20:22 +0100 |
commit | a98fbf0f12b5e83e25afa0f585ca6a4d4ac5f6bf (patch) | |
tree | f6c215cd05ec9278696fae7b8814b5071a4b3c6a /filter/filter.c | |
parent | a3b70dc499b64f41aa776b5b4afee5c7bfb8dfa6 (diff) | |
parent | 1567edea8d3da7da08092eef15bb3bd4544c6464 (diff) | |
download | bird-a98fbf0f12b5e83e25afa0f585ca6a4d4ac5f6bf.tar bird-a98fbf0f12b5e83e25afa0f585ca6a4d4ac5f6bf.zip |
Merge branch 'dev' into out
Diffstat (limited to 'filter/filter.c')
-rw-r--r-- | filter/filter.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/filter/filter.c b/filter/filter.c index 9cde3d9..7893d9a 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -69,6 +69,30 @@ pm_path_compare(struct f_path_mask *m1, struct f_path_mask *m2) } } +static void +pm_format(struct f_path_mask *p, byte *buf, unsigned int size) +{ + byte *end = buf + size - 16; + + while (p) + { + if (buf > end) + { + strcpy(buf, " ..."); + return; + } + + if (p->any) + buf += bsprintf(buf, "? "); + else + buf += bsprintf(buf, "%u ", p->val); + + p = p->next; + } + + *buf = 0; +} + /** * val_compare - compare two values * @v1: first value @@ -224,7 +248,7 @@ val_print(struct f_val v) case T_ENUM: PRINTF( "(enum %x)%d", v.type, v.val.i ); break; case T_PATH: as_path_format(v.val.ad, buf2, 1020); PRINTF( "(path %s)", buf2 ); break; case T_CLIST: int_set_format(v.val.ad, buf2, 1020); PRINTF( "(clist %s)", buf2 ); break; - case T_PATH_MASK: debug( "(pathmask " ); { struct f_path_mask *p = v.val.path_mask; while (p) { debug("%d ", p->val); p=p->next; } debug(")" ); } break; + case T_PATH_MASK: pm_format(v.val.path_mask, buf2, 1020); PRINTF( "(pathmask %s)", buf2 ); break; default: PRINTF( "[unknown type %x]", v.type ); #undef PRINTF } |