summaryrefslogtreecommitdiffstats
path: root/lib/stream.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-11-15 20:32:18 +0100
committerMark Stapp <mjs@voltanet.io>2019-12-06 16:12:14 +0100
commitd3d77ec42f9ece5a52e5af26b7ff2fb5607ad6c4 (patch)
treea2bf3d29cc503f5de1f9f084e03826f2585d31f9 /lib/stream.c
parentMerge pull request #5472 from mjstapp/fix_dplane_prov_flags (diff)
downloadfrr-d3d77ec42f9ece5a52e5af26b7ff2fb5607ad6c4.tar.xz
frr-d3d77ec42f9ece5a52e5af26b7ff2fb5607ad6c4.zip
lib: use const in several stream lib apis
Add some const to some stream apis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'lib/stream.c')
-rw-r--r--lib/stream.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/stream.c b/lib/stream.c
index 2e1a0193a..dd4d5bd96 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -812,7 +812,7 @@ int stream_put_ipv4(struct stream *s, uint32_t l)
}
/* Put long word to the stream. */
-int stream_put_in_addr(struct stream *s, struct in_addr *addr)
+int stream_put_in_addr(struct stream *s, const struct in_addr *addr)
{
STREAM_VERIFY_SANE(s);
@@ -828,7 +828,8 @@ int stream_put_in_addr(struct stream *s, struct in_addr *addr)
}
/* Put in_addr at location in the stream. */
-int stream_put_in_addr_at(struct stream *s, size_t putp, struct in_addr *addr)
+int stream_put_in_addr_at(struct stream *s, size_t putp,
+ const struct in_addr *addr)
{
STREAM_VERIFY_SANE(s);
@@ -842,7 +843,8 @@ int stream_put_in_addr_at(struct stream *s, size_t putp, struct in_addr *addr)
}
/* Put in6_addr at location in the stream. */
-int stream_put_in6_addr_at(struct stream *s, size_t putp, struct in6_addr *addr)
+int stream_put_in6_addr_at(struct stream *s, size_t putp,
+ const struct in6_addr *addr)
{
STREAM_VERIFY_SANE(s);
@@ -856,7 +858,7 @@ int stream_put_in6_addr_at(struct stream *s, size_t putp, struct in6_addr *addr)
}
/* Put prefix by nlri type format. */
-int stream_put_prefix_addpath(struct stream *s, struct prefix *p,
+int stream_put_prefix_addpath(struct stream *s, const struct prefix *p,
int addpath_encode, uint32_t addpath_tx_id)
{
size_t psize;
@@ -890,7 +892,7 @@ int stream_put_prefix_addpath(struct stream *s, struct prefix *p,
return psize;
}
-int stream_put_prefix(struct stream *s, struct prefix *p)
+int stream_put_prefix(struct stream *s, const struct prefix *p)
{
return stream_put_prefix_addpath(s, p, 0, 0);
}