1
2
3
4
5
6
7 #ifndef _NET_PPP_COMP_H
8 #define _NET_PPP_COMP_H
9
10 #include <uapi/linux/ppp-comp.h>
11
12
13 struct module;
14
15
16
17
18
19
20 #ifndef DO_BSD_COMPRESS
21 #define DO_BSD_COMPRESS 1
22 #endif
23 #ifndef DO_DEFLATE
24 #define DO_DEFLATE 1
25 #endif
26 #define DO_PREDICTOR_1 0
27 #define DO_PREDICTOR_2 0
28
29
30
31
32
33 struct compressor {
34 int compress_proto;
35
36
37 void *(*comp_alloc) (unsigned char *options, int opt_len);
38
39
40 void (*comp_free) (void *state);
41
42
43 int (*comp_init) (void *state, unsigned char *options,
44 int opt_len, int unit, int opthdr, int debug);
45
46
47 void (*comp_reset) (void *state);
48
49
50 int (*compress) (void *state, unsigned char *rptr,
51 unsigned char *obuf, int isize, int osize);
52
53
54 void (*comp_stat) (void *state, struct compstat *stats);
55
56
57 void *(*decomp_alloc) (unsigned char *options, int opt_len);
58
59
60 void (*decomp_free) (void *state);
61
62
63 int (*decomp_init) (void *state, unsigned char *options,
64 int opt_len, int unit, int opthdr, int mru,
65 int debug);
66
67
68 void (*decomp_reset) (void *state);
69
70
71 int (*decompress) (void *state, unsigned char *ibuf, int isize,
72 unsigned char *obuf, int osize);
73
74
75 void (*incomp) (void *state, unsigned char *ibuf, int icnt);
76
77
78 void (*decomp_stat) (void *state, struct compstat *stats);
79
80
81 struct module *owner;
82
83 unsigned int comp_extra;
84 };
85
86
87
88
89
90
91
92
93
94
95
96
97
98 #define DECOMP_ERROR -1
99 #define DECOMP_FATALERROR -2
100
101 extern int ppp_register_compressor(struct compressor *);
102 extern void ppp_unregister_compressor(struct compressor *);
103 #endif