blob: 5757164814b8043c51184f2fac90b765bccdf974 [file] [log] [blame]
Damien Millerd4a8b7e1999-10-27 13:42:43 +10001/*
Damien Miller95def091999-11-25 00:26:21 +11002 * Author: Tatu Ylonen <ylo@cs.hut.fi>
Damien Miller95def091999-11-25 00:26:21 +11003 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved
Damien Miller95def091999-11-25 00:26:21 +11005 * Interface to packet compression for ssh.
Damien Miller4af51302000-04-16 11:18:38 +10006 *
Damien Millere4340be2000-09-16 13:29:08 +11007 * As far as I am concerned, the code I have written for this software
8 * can be used freely for any purpose. Any derived versions of this
9 * software must be clearly marked as such, and if the derived work is
10 * incompatible with the protocol description in the RFC file, it must be
11 * called by a name other than "ssh" or "Secure Shell".
Damien Miller95def091999-11-25 00:26:21 +110012 */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100013
Damien Millere4340be2000-09-16 13:29:08 +110014/* RCSID("$OpenBSD: compress.h,v 1.6 2000/09/07 20:27:50 deraadt Exp $"); */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100015
16#ifndef COMPRESS_H
17#define COMPRESS_H
18
Damien Miller5428f641999-11-25 11:54:57 +110019/*
20 * Initializes compression; level is compression level from 1 to 9 (as in
21 * gzip).
22 */
Damien Miller95def091999-11-25 00:26:21 +110023void buffer_compress_init(int level);
Damien Millerd4a8b7e1999-10-27 13:42:43 +100024
25/* Frees any data structures allocated by buffer_compress_init. */
Damien Miller95def091999-11-25 00:26:21 +110026void buffer_compress_uninit();
Damien Millerd4a8b7e1999-10-27 13:42:43 +100027
Damien Miller5428f641999-11-25 11:54:57 +110028/*
29 * Compresses the contents of input_buffer into output_buffer. All packets
30 * compressed using this function will form a single compressed data stream;
31 * however, data will be flushed at the end of every call so that each
32 * output_buffer can be decompressed independently (but in the appropriate
33 * order since they together form a single compression stream) by the
34 * receiver. This appends the compressed data to the output buffer.
35 */
Damien Miller95def091999-11-25 00:26:21 +110036void buffer_compress(Buffer * input_buffer, Buffer * output_buffer);
Damien Millerd4a8b7e1999-10-27 13:42:43 +100037
Damien Miller5428f641999-11-25 11:54:57 +110038/*
39 * Uncompresses the contents of input_buffer into output_buffer. All packets
40 * uncompressed using this function will form a single compressed data
41 * stream; however, data will be flushed at the end of every call so that
42 * each output_buffer. This must be called for the same size units that the
43 * buffer_compress was called, and in the same order that buffers compressed
44 * with that. This appends the uncompressed data to the output buffer.
45 */
Damien Miller95def091999-11-25 00:26:21 +110046void buffer_uncompress(Buffer * input_buffer, Buffer * output_buffer);
Damien Millerd4a8b7e1999-10-27 13:42:43 +100047
Damien Miller95def091999-11-25 00:26:21 +110048#endif /* COMPRESS_H */