2 * ppp-comp.h - Definitions for doing PPP packet compression.
4 * Copyright (c) 1994 The Australian National University.
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation is hereby granted, provided that the above copyright
9 * notice appears in all copies. This software is provided without any
10 * warranty, express or implied. The Australian National University
11 * makes no representations about the suitability of this software for
14 * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
15 * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
16 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
17 * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
20 * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
21 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
23 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
24 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
27 * $Id: ppp-comp.h,v 1.1 1994/08/31 23:55:58 paulus Exp $
31 * Structure giving methods for compression/decompression.
34 int compress_proto; /* CCP compression protocol number */
36 /* Allocate space for a compressor (transmit side) */
37 void *(*comp_alloc) __P((u_char *options, int opt_len));
38 /* Free space used by a compressor */
39 void (*comp_free) __P((void *state));
40 /* Initialize a compressor */
41 int (*comp_init) __P((void *state, u_char *options, int opt_len,
42 int unit, int debug));
43 /* Reset a compressor */
44 void (*comp_reset) __P((void *state));
45 /* Compress a packet */
46 int (*compress) __P((void *state, PACKET **mret,
47 PACKET *mp, int orig_len, int max_len));
49 /* Allocate space for a decompressor (receive side) */
50 void *(*decomp_alloc) __P((u_char *options, int opt_len));
51 /* Free space used by a decompressor */
52 void (*decomp_free) __P((void *state));
53 /* Initialize a decompressor */
54 int (*decomp_init) __P((void *state, u_char *options, int opt_len,
55 int unit, int mru, int debug));
56 /* Reset a decompressor */
57 void (*decomp_reset) __P((void *state));
58 /* Decompress a packet. */
59 PACKET *(*decompress) __P((void *state, PACKET *mp,
61 /* Update state for an incompressible packet received */
62 void (*incomp) __P((void *state, PACKET *mp));
72 #define CCP_RESETREQ 14
73 #define CCP_RESETACK 15
76 * Max # bytes for a CCP option
78 #define CCP_MAX_OPTION_LENGTH 32
81 * Parts of a CCP packet.
83 #define CCP_CODE(dp) ((dp)[0])
84 #define CCP_ID(dp) ((dp)[1])
85 #define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3])
88 #define CCP_OPT_CODE(dp) ((dp)[0])
89 #define CCP_OPT_LENGTH(dp) ((dp)[1])
90 #define CCP_OPT_MINLEN 2