summaryrefslogtreecommitdiff
path: root/sshbuf.h
diff options
context:
space:
mode:
Diffstat (limited to 'sshbuf.h')
-rw-r--r--sshbuf.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sshbuf.h b/sshbuf.h
index 52ff017cc..1ac4b8c0a 100644
--- a/sshbuf.h
+++ b/sshbuf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshbuf.h,v 1.7 2016/05/02 08:49:03 djm Exp $ */ 1/* $OpenBSD: sshbuf.h,v 1.8 2016/11/25 23:22:04 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2011 Damien Miller 3 * Copyright (c) 2011 Damien Miller
4 * 4 *
@@ -139,6 +139,14 @@ u_char *sshbuf_mutable_ptr(const struct sshbuf *buf);
139int sshbuf_check_reserve(const struct sshbuf *buf, size_t len); 139int sshbuf_check_reserve(const struct sshbuf *buf, size_t len);
140 140
141/* 141/*
142 * Preallocates len additional bytes in buf.
143 * Useful for cases where the caller knows how many bytes will ultimately be
144 * required to avoid realloc in the buffer code.
145 * Returns 0 on success, or a negative SSH_ERR_* error code on failure.
146 */
147int sshbuf_allocate(struct sshbuf *buf, size_t len);
148
149/*
142 * Reserve len bytes in buf. 150 * Reserve len bytes in buf.
143 * Returns 0 on success and a pointer to the first reserved byte via the 151 * Returns 0 on success and a pointer to the first reserved byte via the
144 * optional dpp parameter or a negative * SSH_ERR_* error code on failure. 152 * optional dpp parameter or a negative * SSH_ERR_* error code on failure.