summaryrefslogtreecommitdiff
path: root/bufaux.h
diff options
context:
space:
mode:
Diffstat (limited to 'bufaux.h')
-rw-r--r--bufaux.h26
1 files changed, 3 insertions, 23 deletions
diff --git a/bufaux.h b/bufaux.h
index 765ee5e79..d1af09881 100644
--- a/bufaux.h
+++ b/bufaux.h
@@ -10,7 +10,7 @@
10 * called by a name other than "ssh" or "Secure Shell". 10 * called by a name other than "ssh" or "Secure Shell".
11 */ 11 */
12 12
13/* RCSID("$OpenBSD: bufaux.h,v 1.12 2001/06/26 06:32:48 itojun Exp $"); */ 13/* RCSID("$OpenBSD: bufaux.h,v 1.13 2001/06/26 17:27:22 markus Exp $"); */
14 14
15#ifndef BUFAUX_H 15#ifndef BUFAUX_H
16#define BUFAUX_H 16#define BUFAUX_H
@@ -18,46 +18,26 @@
18#include "buffer.h" 18#include "buffer.h"
19#include <openssl/bn.h> 19#include <openssl/bn.h>
20 20
21/*
22 * Stores an BIGNUM in the buffer with a 2-byte msb first bit count, followed
23 * by (bits+7)/8 bytes of binary data, msb first.
24 */
25void buffer_put_bignum(Buffer *, BIGNUM *); 21void buffer_put_bignum(Buffer *, BIGNUM *);
26void buffer_put_bignum2(Buffer *, BIGNUM *); 22void buffer_put_bignum2(Buffer *, BIGNUM *);
27 23
28/* Retrieves an BIGNUM from the buffer. */
29int buffer_get_bignum(Buffer *, BIGNUM *); 24int buffer_get_bignum(Buffer *, BIGNUM *);
30int buffer_get_bignum2(Buffer *, BIGNUM *); 25int buffer_get_bignum2(Buffer *, BIGNUM *);
31 26
32/* Returns an integer from the buffer (4 bytes, msb first). */
33u_int buffer_get_int(Buffer *); 27u_int buffer_get_int(Buffer *);
34#ifdef HAVE_U_INT64_T
35u_int64_t buffer_get_int64(Buffer *);
36#endif
37
38/* Stores an integer in the buffer in 4 bytes, msb first. */
39void buffer_put_int(Buffer *, u_int); 28void buffer_put_int(Buffer *, u_int);
29
40#ifdef HAVE_U_INT64_T 30#ifdef HAVE_U_INT64_T
31u_int64_t buffer_get_int64(Buffer *);
41void buffer_put_int64(Buffer *, u_int64_t); 32void buffer_put_int64(Buffer *, u_int64_t);
42#endif 33#endif
43 34
44/* Returns a character from the buffer (0 - 255). */
45int buffer_get_char(Buffer *); 35int buffer_get_char(Buffer *);
46 36
47/* Stores a character in the buffer. */
48void buffer_put_char(Buffer *, int); 37void buffer_put_char(Buffer *, int);
49 38
50/*
51 * Returns an arbitrary binary string from the buffer. The string cannot be
52 * longer than 256k. The returned value points to memory allocated with
53 * xmalloc; it is the responsibility of the calling function to free the
54 * data. If length_ptr is non-NULL, the length of the returned data will be
55 * stored there. A null character will be automatically appended to the
56 * returned string, and is not counted in length.
57 */
58char *buffer_get_string(Buffer *, u_int *); 39char *buffer_get_string(Buffer *, u_int *);
59 40
60/* Stores and arbitrary binary string in the buffer. */
61void buffer_put_string(Buffer *, const void *, u_int); 41void buffer_put_string(Buffer *, const void *, u_int);
62void buffer_put_cstring(Buffer *, const char *); 42void buffer_put_cstring(Buffer *, const char *);
63 43