Annotation of src/usr.bin/ssh/buffer.h, Revision 1.11
1.11 ! stevesk 1: /* $OpenBSD: buffer.h,v 1.10 2001/12/19 17:16:13 stevesk Exp $ */
! 2:
1.1 deraadt 3: /*
1.2 deraadt 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.
1.4 markus 8: *
1.6 deraadt 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".
1.2 deraadt 14: */
1.1 deraadt 15:
16: #ifndef BUFFER_H
17: #define BUFFER_H
18:
1.2 deraadt 19: typedef struct {
1.10 stevesk 20: u_char *buf; /* Buffer for data. */
1.9 markus 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. */
1.2 deraadt 24: } Buffer;
1.1 deraadt 25:
1.9 markus 26: void buffer_init(Buffer *);
27: void buffer_clear(Buffer *);
28: void buffer_free(Buffer *);
1.1 deraadt 29:
1.9 markus 30: u_int buffer_len(Buffer *);
1.10 stevesk 31: void *buffer_ptr(Buffer *);
1.9 markus 32:
1.10 stevesk 33: void buffer_append(Buffer *, const void *, u_int);
34: void *buffer_append_space(Buffer *, u_int);
1.9 markus 35:
1.10 stevesk 36: void buffer_get(Buffer *, void *, u_int);
1.9 markus 37:
38: void buffer_consume(Buffer *, u_int);
39: void buffer_consume_end(Buffer *, u_int);
40:
41: void buffer_dump(Buffer *);
1.1 deraadt 42:
1.2 deraadt 43: #endif /* BUFFER_H */