summaryrefslogtreecommitdiff
path: root/bufaux.c
diff options
context:
space:
mode:
Diffstat (limited to 'bufaux.c')
-rw-r--r--bufaux.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/bufaux.c b/bufaux.c
index 5853ee600..149677f74 100644
--- a/bufaux.c
+++ b/bufaux.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: bufaux.c,v 1.14 2000/12/19 23:17:55 markus Exp $"); 40RCSID("$OpenBSD: bufaux.c,v 1.15 2001/01/10 22:56:22 markus Exp $");
41 41
42#include "ssh.h" 42#include "ssh.h"
43#include <openssl/bn.h> 43#include <openssl/bn.h>
@@ -152,6 +152,14 @@ buffer_get_int(Buffer *buffer)
152 return GET_32BIT(buf); 152 return GET_32BIT(buf);
153} 153}
154 154
155u_int64_t
156buffer_get_int64(Buffer *buffer)
157{
158 u_char buf[8];
159 buffer_get(buffer, (char *) buf, 8);
160 return GET_64BIT(buf);
161}
162
155/* 163/*
156 * Stores an integer in the buffer in 4 bytes, msb first. 164 * Stores an integer in the buffer in 4 bytes, msb first.
157 */ 165 */
@@ -163,6 +171,14 @@ buffer_put_int(Buffer *buffer, u_int value)
163 buffer_append(buffer, buf, 4); 171 buffer_append(buffer, buf, 4);
164} 172}
165 173
174void
175buffer_put_int64(Buffer *buffer, u_int64_t value)
176{
177 char buf[8];
178 PUT_64BIT(buf, value);
179 buffer_append(buffer, buf, 8);
180}
181
166/* 182/*
167 * Returns an arbitrary binary string from the buffer. The string cannot 183 * Returns an arbitrary binary string from the buffer. The string cannot
168 * be longer than 256k. The returned value points to memory allocated 184 * be longer than 256k. The returned value points to memory allocated