2 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
5 /* $OpenBSD: bufaux.h,v 1.18 2002/04/20 09:14:58 markus Exp $ */
16 * Author: Tatu Ylonen <ylo@cs.hut.fi>
17 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
20 * As far as I am concerned, the code I have written for this software
21 * can be used freely for any purpose. Any derived versions of this
22 * software must be clearly marked as such, and if the derived work is
23 * incompatible with the protocol description in the RFC file, it must be
24 * called by a name other than "ssh" or "Secure Shell".
28 #include <openssl/bn.h>
30 void buffer_put_bignum(Buffer
*, const BIGNUM
*);
31 void buffer_put_bignum2(Buffer
*, const BIGNUM
*);
32 void buffer_get_bignum(Buffer
*, BIGNUM
*);
33 void buffer_get_bignum2(Buffer
*, BIGNUM
*);
35 u_short
buffer_get_short(Buffer
*);
36 void buffer_put_short(Buffer
*, u_short
);
38 u_int
buffer_get_int(Buffer
*);
39 void buffer_put_int(Buffer
*, u_int
);
42 u_int64_t
buffer_get_int64(Buffer
*);
43 void buffer_put_int64(Buffer
*, u_int64_t
);
46 int buffer_get_char(Buffer
*);
47 void buffer_put_char(Buffer
*, int);
49 void *buffer_get_string(Buffer
*, u_int
*);
50 char *buffer_get_utf8_string(Buffer
*, uint_t
*);
51 void buffer_put_string(Buffer
*, const void *, u_int
);
52 void buffer_put_cstring(Buffer
*, const char *);
53 void buffer_put_utf8_string(Buffer
*, const char *, uint_t len
);
54 void buffer_put_utf8_cstring(Buffer
*, const char *);
56 #define buffer_skip_string(b) \
57 do { u_int l = buffer_get_int(b); buffer_consume(b, l); } while(0)
59 int buffer_put_bignum_ret(Buffer
*, const BIGNUM
*);
60 int buffer_get_bignum_ret(Buffer
*, BIGNUM
*);
61 int buffer_put_bignum2_ret(Buffer
*, const BIGNUM
*);
62 int buffer_get_bignum2_ret(Buffer
*, BIGNUM
*);
63 int buffer_get_short_ret(u_short
*, Buffer
*);
64 int buffer_get_int_ret(u_int
*, Buffer
*);
66 int buffer_get_int64_ret(u_int64_t
*, Buffer
*);
68 void *buffer_get_string_ret(Buffer
*, u_int
*);
69 int buffer_get_char_ret(char *, Buffer
*);
75 #endif /* _BUFAUX_H */