Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 1 | /* |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 2 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
| 4 | * All rights reserved |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 5 | * Interface to packet compression for ssh. |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 6 | * |
Damien Miller | e4340be | 2000-09-16 13:29:08 +1100 | [diff] [blame] | 7 | * 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 Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 12 | */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 13 | |
Kevin Steves | e765240 | 2000-12-28 22:16:00 +0000 | [diff] [blame] | 14 | /* RCSID("$OpenBSD: compress.h,v 1.7 2000/12/20 19:37:22 markus Exp $"); */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 15 | |
| 16 | #ifndef COMPRESS_H |
| 17 | #define COMPRESS_H |
| 18 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 19 | /* |
| 20 | * Initializes compression; level is compression level from 1 to 9 (as in |
| 21 | * gzip). |
| 22 | */ |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 23 | void buffer_compress_init(int level); |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 24 | |
| 25 | /* Frees any data structures allocated by buffer_compress_init. */ |
Kevin Steves | e765240 | 2000-12-28 22:16:00 +0000 | [diff] [blame] | 26 | void buffer_compress_uninit(void); |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 27 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 28 | /* |
| 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 Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 36 | void buffer_compress(Buffer * input_buffer, Buffer * output_buffer); |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 37 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 38 | /* |
| 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 Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 46 | void buffer_uncompress(Buffer * input_buffer, Buffer * output_buffer); |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 47 | |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 48 | #endif /* COMPRESS_H */ |