diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2022-01-27 08:51:59 +0100 |
---|---|---|
committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2022-02-01 12:31:16 +0100 |
commit | be92fc9f1aae0f59e3d9f35bf9a557180b8ee7c6 (patch) | |
tree | 6cce785cde9a740ab1432119c9054e4f88e3288e /lib/stream.c | |
parent | build: FRR 8.3 development version (diff) | |
download | frr-be92fc9f1aae0f59e3d9f35bf9a557180b8ee7c6.tar.xz frr-be92fc9f1aae0f59e3d9f35bf9a557180b8ee7c6.zip |
bgpd: Convert bgp_addpath_encode_[tr]x() to bool from int
Rename addpath_encode[d] to addpath_capable to be consistent.
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'lib/stream.c')
-rw-r--r-- | lib/stream.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/stream.c b/lib/stream.c index 1557500c6..c15baa0a2 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -990,7 +990,7 @@ int stream_put_in6_addr_at(struct stream *s, size_t putp, /* Put prefix by nlri type format. */ int stream_put_prefix_addpath(struct stream *s, const struct prefix *p, - int addpath_encode, uint32_t addpath_tx_id) + bool addpath_capable, uint32_t addpath_tx_id) { size_t psize; size_t psize_with_addpath; @@ -999,7 +999,7 @@ int stream_put_prefix_addpath(struct stream *s, const struct prefix *p, psize = PSIZE(p->prefixlen); - if (addpath_encode) + if (addpath_capable) psize_with_addpath = psize + 4; else psize_with_addpath = psize; @@ -1009,7 +1009,7 @@ int stream_put_prefix_addpath(struct stream *s, const struct prefix *p, return 0; } - if (addpath_encode) { + if (addpath_capable) { s->data[s->endp++] = (uint8_t)(addpath_tx_id >> 24); s->data[s->endp++] = (uint8_t)(addpath_tx_id >> 16); s->data[s->endp++] = (uint8_t)(addpath_tx_id >> 8); @@ -1030,7 +1030,7 @@ int stream_put_prefix(struct stream *s, const struct prefix *p) /* Put NLRI with label */ int stream_put_labeled_prefix(struct stream *s, const struct prefix *p, - mpls_label_t *label, int addpath_encode, + mpls_label_t *label, bool addpath_capable, uint32_t addpath_tx_id) { size_t psize; @@ -1040,14 +1040,14 @@ int stream_put_labeled_prefix(struct stream *s, const struct prefix *p, STREAM_VERIFY_SANE(s); psize = PSIZE(p->prefixlen); - psize_with_addpath = psize + (addpath_encode ? 4 : 0); + psize_with_addpath = psize + (addpath_capable ? 4 : 0); if (STREAM_WRITEABLE(s) < (psize_with_addpath + 3)) { STREAM_BOUND_WARN(s, "put"); return 0; } - if (addpath_encode) { + if (addpath_capable) { s->data[s->endp++] = (uint8_t)(addpath_tx_id >> 24); s->data[s->endp++] = (uint8_t)(addpath_tx_id >> 16); s->data[s->endp++] = (uint8_t)(addpath_tx_id >> 8); |