blob: f13183324232c6b82bfb80efde2ac94338ea0b78 [file] [log] [blame]
Damien Millerd4a8b7e1999-10-27 13:42:43 +10001/*
Damien Miller4af51302000-04-16 11:18:38 +10002 *
Damien Miller95def091999-11-25 00:26:21 +11003 * compress.h
Damien Miller4af51302000-04-16 11:18:38 +10004 *
Damien Miller95def091999-11-25 00:26:21 +11005 * Author: Tatu Ylonen <ylo@cs.hut.fi>
Damien Miller4af51302000-04-16 11:18:38 +10006 *
Damien Miller95def091999-11-25 00:26:21 +11007 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8 * All rights reserved
Damien Miller4af51302000-04-16 11:18:38 +10009 *
Damien Miller95def091999-11-25 00:26:21 +110010 * Created: Wed Oct 25 22:12:46 1995 ylo
Damien Miller4af51302000-04-16 11:18:38 +100011 *
Damien Miller95def091999-11-25 00:26:21 +110012 * Interface to packet compression for ssh.
Damien Miller4af51302000-04-16 11:18:38 +100013 *
Damien Miller95def091999-11-25 00:26:21 +110014 */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100015
Damien Miller4af51302000-04-16 11:18:38 +100016/* RCSID("$Id: compress.h,v 1.4 2000/04/16 01:18:42 damien Exp $"); */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100017
18#ifndef COMPRESS_H
19#define COMPRESS_H
20
Damien Miller5428f641999-11-25 11:54:57 +110021/*
22 * Initializes compression; level is compression level from 1 to 9 (as in
23 * gzip).
24 */
Damien Miller95def091999-11-25 00:26:21 +110025void buffer_compress_init(int level);
Damien Millerd4a8b7e1999-10-27 13:42:43 +100026
27/* Frees any data structures allocated by buffer_compress_init. */
Damien Miller95def091999-11-25 00:26:21 +110028void buffer_compress_uninit();
Damien Millerd4a8b7e1999-10-27 13:42:43 +100029
Damien Miller5428f641999-11-25 11:54:57 +110030/*
31 * Compresses the contents of input_buffer into output_buffer. All packets
32 * compressed using this function will form a single compressed data stream;
33 * however, data will be flushed at the end of every call so that each
34 * output_buffer can be decompressed independently (but in the appropriate
35 * order since they together form a single compression stream) by the
36 * receiver. This appends the compressed data to the output buffer.
37 */
Damien Miller95def091999-11-25 00:26:21 +110038void buffer_compress(Buffer * input_buffer, Buffer * output_buffer);
Damien Millerd4a8b7e1999-10-27 13:42:43 +100039
Damien Miller5428f641999-11-25 11:54:57 +110040/*
41 * Uncompresses the contents of input_buffer into output_buffer. All packets
42 * uncompressed using this function will form a single compressed data
43 * stream; however, data will be flushed at the end of every call so that
44 * each output_buffer. This must be called for the same size units that the
45 * buffer_compress was called, and in the same order that buffers compressed
46 * with that. This appends the uncompressed data to the output buffer.
47 */
Damien Miller95def091999-11-25 00:26:21 +110048void buffer_uncompress(Buffer * input_buffer, Buffer * output_buffer);
Damien Millerd4a8b7e1999-10-27 13:42:43 +100049
Damien Miller95def091999-11-25 00:26:21 +110050#endif /* COMPRESS_H */