0001
0002
0003
0004
0005
0006
0007 #ifndef _NET_PPP_COMP_H
0008 #define _NET_PPP_COMP_H
0009
0010 #include <uapi/linux/ppp-comp.h>
0011
0012 struct compstat;
0013 struct module;
0014
0015
0016
0017
0018
0019
0020 #ifndef DO_BSD_COMPRESS
0021 #define DO_BSD_COMPRESS 1
0022 #endif
0023 #ifndef DO_DEFLATE
0024 #define DO_DEFLATE 1
0025 #endif
0026 #define DO_PREDICTOR_1 0
0027 #define DO_PREDICTOR_2 0
0028
0029
0030
0031
0032
0033 struct compressor {
0034 int compress_proto;
0035
0036
0037 void *(*comp_alloc) (unsigned char *options, int opt_len);
0038
0039
0040 void (*comp_free) (void *state);
0041
0042
0043 int (*comp_init) (void *state, unsigned char *options,
0044 int opt_len, int unit, int opthdr, int debug);
0045
0046
0047 void (*comp_reset) (void *state);
0048
0049
0050 int (*compress) (void *state, unsigned char *rptr,
0051 unsigned char *obuf, int isize, int osize);
0052
0053
0054 void (*comp_stat) (void *state, struct compstat *stats);
0055
0056
0057 void *(*decomp_alloc) (unsigned char *options, int opt_len);
0058
0059
0060 void (*decomp_free) (void *state);
0061
0062
0063 int (*decomp_init) (void *state, unsigned char *options,
0064 int opt_len, int unit, int opthdr, int mru,
0065 int debug);
0066
0067
0068 void (*decomp_reset) (void *state);
0069
0070
0071 int (*decompress) (void *state, unsigned char *ibuf, int isize,
0072 unsigned char *obuf, int osize);
0073
0074
0075 void (*incomp) (void *state, unsigned char *ibuf, int icnt);
0076
0077
0078 void (*decomp_stat) (void *state, struct compstat *stats);
0079
0080
0081 struct module *owner;
0082
0083 unsigned int comp_extra;
0084 };
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098 #define DECOMP_ERROR -1
0099 #define DECOMP_FATALERROR -2
0100
0101 extern int ppp_register_compressor(struct compressor *);
0102 extern void ppp_unregister_compressor(struct compressor *);
0103 #endif