diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-10-01 12:50:29 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-10-03 12:48:56 +0200 |
commit | 66dbdbd993115c57acafdb776d2165d0b4a90a45 (patch) | |
tree | 802ed0a7926d5edca62fa0adeaf73ba203d2b2fb /nest/rt-attr.c | |
parent | f51b1f556595108d53b9f4580bfcb96bfbc85442 (diff) |
BGP: Support for large communities
Add support for large communities (draft-ietf-idr-large-community),
96bit alternative to RFC 1997 communities.
Thanks to Matt Griswold for the original patch.
Diffstat (limited to 'nest/rt-attr.c')
-rw-r--r-- | nest/rt-attr.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/nest/rt-attr.c b/nest/rt-attr.c index ab0069b5..9aeca846 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -828,6 +828,18 @@ ea_show_ec_set(struct cli *c, struct adata *ad, byte *pos, byte *buf, byte *end) } } +static inline void +ea_show_lc_set(struct cli *c, struct adata *ad, byte *pos, byte *buf, byte *end) +{ + int i = lc_set_format(ad, 0, pos, end - pos); + cli_printf(c, -1012, "\t%s", buf); + while (i) + { + i = lc_set_format(ad, i, buf, end - buf - 1); + cli_printf(c, -1012, "\t\t%s", buf); + } +} + /** * ea_show - print an &eattr to CLI * @c: destination CLI @@ -892,6 +904,9 @@ ea_show(struct cli *c, eattr *e) case EAF_TYPE_EC_SET: ea_show_ec_set(c, ad, pos, buf, end); return; + case EAF_TYPE_LC_SET: + ea_show_lc_set(c, ad, pos, buf, end); + return; case EAF_TYPE_UNDEF: default: bsprintf(pos, "<type %02x>", e->type); |