Main Page | Namespace List | Class List | Directories | File List | Class Members | File Members

bufaux.h

Go to the documentation of this file.
00001 /*      $OpenBSD: bufaux.h,v 1.21 2005/03/10 22:01:05 deraadt Exp $     */
00002 
00003 /*
00004  * Author: Tatu Ylonen <ylo@cs.hut.fi>
00005  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
00006  *                    All rights reserved
00007  *
00008  * As far as I am concerned, the code I have written for this software
00009  * can be used freely for any purpose.  Any derived versions of this
00010  * software must be clearly marked as such, and if the derived work is
00011  * incompatible with the protocol description in the RFC file, it must be
00012  * called by a name other than "ssh" or "Secure Shell".
00013  */
00014 
00015 #ifndef BUFAUX_H
00016 #define BUFAUX_H
00017 
00018 #include "buffer.h"
00019 #include <openssl/bn.h>
00020 
00021 void    buffer_put_bignum(Buffer *, const BIGNUM *);
00022 void    buffer_put_bignum2(Buffer *, const BIGNUM *);
00023 void    buffer_get_bignum(Buffer *, BIGNUM *);
00024 void    buffer_get_bignum2(Buffer *, BIGNUM *);
00025 
00026 u_short buffer_get_short(Buffer *);
00027 void    buffer_put_short(Buffer *, u_short);
00028 
00029 u_int   buffer_get_int(Buffer *);
00030 void    buffer_put_int(Buffer *, u_int);
00031 
00032 u_int64_t buffer_get_int64(Buffer *);
00033 void    buffer_put_int64(Buffer *, u_int64_t);
00034 
00035 int     buffer_get_char(Buffer *);
00036 void    buffer_put_char(Buffer *, int);
00037 
00038 void   *buffer_get_string(Buffer *, u_int *);
00039 void    buffer_put_string(Buffer *, const void *, u_int);
00040 void    buffer_put_cstring(Buffer *, const char *);
00041 
00042 #define buffer_skip_string(b) \
00043     do { u_int l = buffer_get_int(b); buffer_consume(b, l); } while (0)
00044 
00045 int     buffer_put_bignum_ret(Buffer *, const BIGNUM *);
00046 int     buffer_get_bignum_ret(Buffer *, BIGNUM *);
00047 int     buffer_put_bignum2_ret(Buffer *, const BIGNUM *);
00048 int     buffer_get_bignum2_ret(Buffer *, BIGNUM *);
00049 int     buffer_get_short_ret(u_short *, Buffer *);
00050 int     buffer_get_int_ret(u_int *, Buffer *);
00051 int     buffer_get_int64_ret(u_int64_t *, Buffer *);
00052 void    *buffer_get_string_ret(Buffer *, u_int *);
00053 int     buffer_get_char_ret(char *, Buffer *);
00054 
00055 #endif                          /* BUFAUX_H */

© sourcejam.com 2005-2008