version 1.6, 2000/03/28 20:25:14 |
version 1.7, 2000/04/14 10:30:31 |
|
|
/* |
/* |
* |
* |
* compress.c |
* compress.c |
* |
* |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* |
* |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
* All rights reserved |
* All rights reserved |
* |
* |
* Created: Wed Oct 25 22:12:46 1995 ylo |
* Created: Wed Oct 25 22:12:46 1995 ylo |
* |
* |
* Interface to packet compression for ssh. |
* Interface to packet compression for ssh. |
* |
* |
*/ |
*/ |
|
|
#include "includes.h" |
#include "includes.h" |
|
|
* (as in gzip). |
* (as in gzip). |
*/ |
*/ |
|
|
void |
void |
buffer_compress_init(int level) |
buffer_compress_init(int level) |
{ |
{ |
debug("Enabling compression at level %d.", level); |
debug("Enabling compression at level %d.", level); |
|
|
|
|
/* Frees any data structures allocated for compression. */ |
/* Frees any data structures allocated for compression. */ |
|
|
void |
void |
buffer_compress_uninit() |
buffer_compress_uninit() |
{ |
{ |
debug("compress outgoing: raw data %lu, compressed %lu, factor %.2f", |
debug("compress outgoing: raw data %lu, compressed %lu, factor %.2f", |
|
|
* receiver. This appends the compressed data to the output buffer. |
* receiver. This appends the compressed data to the output buffer. |
*/ |
*/ |
|
|
void |
void |
buffer_compress(Buffer * input_buffer, Buffer * output_buffer) |
buffer_compress(Buffer * input_buffer, Buffer * output_buffer) |
{ |
{ |
char buf[4096]; |
char buf[4096]; |
|
|
* with that. This appends the uncompressed data to the output buffer. |
* with that. This appends the uncompressed data to the output buffer. |
*/ |
*/ |
|
|
void |
void |
buffer_uncompress(Buffer * input_buffer, Buffer * output_buffer) |
buffer_uncompress(Buffer * input_buffer, Buffer * output_buffer) |
{ |
{ |
char buf[4096]; |
char buf[4096]; |