1N/A * and decompression (as used by gzip) to the PPP code. 1N/A * Copyright (c) 1994 The Australian National University. 1N/A * All rights reserved. 1N/A * Permission to use, copy, modify, and distribute this software and its 1N/A * documentation is hereby granted, provided that the above copyright 1N/A * notice appears in all copies. This software is provided without any 1N/A * warranty, express or implied. The Australian National University 1N/A * makes no representations about the suitability of this software for 1N/A * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY 1N/A * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 1N/A * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 1N/A * THE AUSTRALIAN NATIONAL UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY 1N/A * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, 1N/A * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 1N/A * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 1N/A * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO 1N/A * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, 1N/A * State for a Deflate (de)compressor. 1N/A * Space allocation and freeing routines for use by zlib routines. 1N/A * Allocate space for a decompressor. 1N/A * Decompress a Deflate-compressed packet. 1N/A * Because of patent problems, we return DECOMP_ERROR for errors 1N/A * found by inspecting the input data and for system problems, but 1N/A * DECOMP_FATALERROR for any errors which could possibly be said to 1N/A * be being detected "after" decompression. For DECOMP_ERROR, 1N/A * we can issue a CCP reset-request; for DECOMP_FATALERROR, we may be 1N/A * infringing a patent of Motorola's if we do, so we take CCP down 1N/A * Given that the frame has the correct sequence number and a good FCS, 1N/A * errors such as invalid codes in the input most likely indicate a 1N/A * bug, so we return DECOMP_FATALERROR for them in order to turn off 1N/A * compression, even though they are detected by inspecting the input. 1N/A /* Check the sequence number. */ 1N/A printf(
"z_decompress%d: bad seq # %d, expected %d\n",
1N/A * Set up to call inflate. 1N/A printf(
"z_decompress%d: inflate returned %d (%s)\n",
1N/A ++
olen;
/* for suppressed protocol high byte */ 1N/A olen +=
2;
/* for address, control */ 1N/A printf(
"ppp_deflate%d: exceeded mru (%d > %d)\n",
1N/A * Incompressible data has arrived - add it to the history. 1N/A * Check that the protocol is one we handle. 1N/A printf(
"z_incomp%d: inflateIncomp returned %d (%s)\n",
1N/A#
endif /* DO_DEFLATE */