]> andersk Git - gssapi-openssh.git/blame - openssh/buffer.h
applied http://www.psc.edu/networking/projects/hpn-ssh/openssh-4.3p1-hpn11-none.diff...
[gssapi-openssh.git] / openssh / buffer.h
CommitLineData
dec6d9fe 1/* $OpenBSD: buffer.h,v 1.13 2005/03/14 11:46:56 markus Exp $ */
e9a17296 2
3c0ef626 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
5 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6 * All rights reserved
7 * Code for manipulating FIFO buffers.
8 *
9 * As far as I am concerned, the code I have written for this software
10 * can be used freely for any purpose. Any derived versions of this
11 * software must be clearly marked as such, and if the derived work is
12 * incompatible with the protocol description in the RFC file, it must be
13 * called by a name other than "ssh" or "Secure Shell".
14 */
15
3c0ef626 16#ifndef BUFFER_H
17#define BUFFER_H
18
19typedef struct {
e9a17296 20 u_char *buf; /* Buffer for data. */
3c0ef626 21 u_int alloc; /* Number of bytes allocated for data. */
22 u_int offset; /* Offset of first byte containing data. */
23 u_int end; /* Offset of last byte containing data. */
24} Buffer;
25
dec6d9fe 26#define BUFFER_MAX_CHUNK 0x100000
27#define BUFFER_MAX_LEN 0xa00000
e90c2d47 28#define BUFFER_MAX_HPN_LEN (2<<29)-1
dec6d9fe 29
3c0ef626 30void buffer_init(Buffer *);
31void buffer_clear(Buffer *);
32void buffer_free(Buffer *);
33
34u_int buffer_len(Buffer *);
e9a17296 35void *buffer_ptr(Buffer *);
3c0ef626 36
e9a17296 37void buffer_append(Buffer *, const void *, u_int);
38void *buffer_append_space(Buffer *, u_int);
3c0ef626 39
e9a17296 40void buffer_get(Buffer *, void *, u_int);
3c0ef626 41
42void buffer_consume(Buffer *, u_int);
43void buffer_consume_end(Buffer *, u_int);
44
45void buffer_dump(Buffer *);
46
996d5e62 47int buffer_get_ret(Buffer *, void *, u_int);
48int buffer_consume_ret(Buffer *, u_int);
49int buffer_consume_end_ret(Buffer *, u_int);
50
3c0ef626 51#endif /* BUFFER_H */
This page took 0.058456 seconds and 5 git commands to generate.