diff options
Diffstat (limited to 'bufaux.h')
-rw-r--r-- | bufaux.h | 26 |
1 files changed, 3 insertions, 23 deletions
@@ -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 | */ | ||
25 | void buffer_put_bignum(Buffer *, BIGNUM *); | 21 | void buffer_put_bignum(Buffer *, BIGNUM *); |
26 | void buffer_put_bignum2(Buffer *, BIGNUM *); | 22 | void buffer_put_bignum2(Buffer *, BIGNUM *); |
27 | 23 | ||
28 | /* Retrieves an BIGNUM from the buffer. */ | ||
29 | int buffer_get_bignum(Buffer *, BIGNUM *); | 24 | int buffer_get_bignum(Buffer *, BIGNUM *); |
30 | int buffer_get_bignum2(Buffer *, BIGNUM *); | 25 | int buffer_get_bignum2(Buffer *, BIGNUM *); |
31 | 26 | ||
32 | /* Returns an integer from the buffer (4 bytes, msb first). */ | ||
33 | u_int buffer_get_int(Buffer *); | 27 | u_int buffer_get_int(Buffer *); |
34 | #ifdef HAVE_U_INT64_T | ||
35 | u_int64_t buffer_get_int64(Buffer *); | ||
36 | #endif | ||
37 | |||
38 | /* Stores an integer in the buffer in 4 bytes, msb first. */ | ||
39 | void buffer_put_int(Buffer *, u_int); | 28 | void buffer_put_int(Buffer *, u_int); |
29 | |||
40 | #ifdef HAVE_U_INT64_T | 30 | #ifdef HAVE_U_INT64_T |
31 | u_int64_t buffer_get_int64(Buffer *); | ||
41 | void buffer_put_int64(Buffer *, u_int64_t); | 32 | void buffer_put_int64(Buffer *, u_int64_t); |
42 | #endif | 33 | #endif |
43 | 34 | ||
44 | /* Returns a character from the buffer (0 - 255). */ | ||
45 | int buffer_get_char(Buffer *); | 35 | int buffer_get_char(Buffer *); |
46 | 36 | ||
47 | /* Stores a character in the buffer. */ | ||
48 | void buffer_put_char(Buffer *, int); | 37 | void 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 | */ | ||
58 | char *buffer_get_string(Buffer *, u_int *); | 39 | char *buffer_get_string(Buffer *, u_int *); |
59 | 40 | ||
60 | /* Stores and arbitrary binary string in the buffer. */ | ||
61 | void buffer_put_string(Buffer *, const void *, u_int); | 41 | void buffer_put_string(Buffer *, const void *, u_int); |
62 | void buffer_put_cstring(Buffer *, const char *); | 42 | void buffer_put_cstring(Buffer *, const char *); |
63 | 43 | ||