~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/ppp-comp.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * ppp-comp.h - Definitions for doing PPP packet compression.
  4  *
  5  * Copyright 1994-1998 Paul Mackerras.
  6  */
  7 #ifndef _NET_PPP_COMP_H
  8 #define _NET_PPP_COMP_H
  9 
 10 #include <uapi/linux/ppp-comp.h>
 11 
 12 struct compstat;
 13 struct module;
 14 
 15 /*
 16  * The following symbols control whether we include code for
 17  * various compression methods.
 18  */
 19 
 20 #ifndef DO_BSD_COMPRESS
 21 #define DO_BSD_COMPRESS 1       /* by default, include BSD-Compress */
 22 #endif
 23 #ifndef DO_DEFLATE
 24 #define DO_DEFLATE      1       /* by default, include Deflate */
 25 #endif
 26 #define DO_PREDICTOR_1  0
 27 #define DO_PREDICTOR_2  0
 28 
 29 /*
 30  * Structure giving methods for compression/decompression.
 31  */
 32 
 33 struct compressor {
 34         int     compress_proto; /* CCP compression protocol number */
 35 
 36         /* Allocate space for a compressor (transmit side) */
 37         void    *(*comp_alloc) (unsigned char *options, int opt_len);
 38 
 39         /* Free space used by a compressor */
 40         void    (*comp_free) (void *state);
 41 
 42         /* Initialize a compressor */
 43         int     (*comp_init) (void *state, unsigned char *options,
 44                               int opt_len, int unit, int opthdr, int debug);
 45 
 46         /* Reset a compressor */
 47         void    (*comp_reset) (void *state);
 48 
 49         /* Compress a packet */
 50         int     (*compress) (void *state, unsigned char *rptr,
 51                               unsigned char *obuf, int isize, int osize);
 52 
 53         /* Return compression statistics */
 54         void    (*comp_stat) (void *state, struct compstat *stats);
 55 
 56         /* Allocate space for a decompressor (receive side) */
 57         void    *(*decomp_alloc) (unsigned char *options, int opt_len);
 58 
 59         /* Free space used by a decompressor */
 60         void    (*decomp_free) (void *state);
 61 
 62         /* Initialize a decompressor */
 63         int     (*decomp_init) (void *state, unsigned char *options,
 64                                 int opt_len, int unit, int opthdr, int mru,
 65                                 int debug);
 66 
 67         /* Reset a decompressor */
 68         void    (*decomp_reset) (void *state);
 69 
 70         /* Decompress a packet. */
 71         int     (*decompress) (void *state, unsigned char *ibuf, int isize,
 72                                 unsigned char *obuf, int osize);
 73 
 74         /* Update state for an incompressible packet received */
 75         void    (*incomp) (void *state, unsigned char *ibuf, int icnt);
 76 
 77         /* Return decompression statistics */
 78         void    (*decomp_stat) (void *state, struct compstat *stats);
 79 
 80         /* Used in locking compressor modules */
 81         struct module *owner;
 82         /* Extra skb space needed by the compressor algorithm */
 83         unsigned int comp_extra;
 84 };
 85 
 86 /*
 87  * The return value from decompress routine is the length of the
 88  * decompressed packet if successful, otherwise DECOMP_ERROR
 89  * or DECOMP_FATALERROR if an error occurred.
 90  * 
 91  * We need to make this distinction so that we can disable certain
 92  * useful functionality, namely sending a CCP reset-request as a result
 93  * of an error detected after decompression.  This is to avoid infringing
 94  * a patent held by Motorola.
 95  * Don't you just lurve software patents.
 96  */
 97 
 98 #define DECOMP_ERROR            -1      /* error detected before decomp. */
 99 #define DECOMP_FATALERROR       -2      /* error detected after decomp. */
100 
101 extern int ppp_register_compressor(struct compressor *);
102 extern void ppp_unregister_compressor(struct compressor *);
103 #endif /* _NET_PPP_COMP_H */
104 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php