31 #ifndef _NET_PPP_COMP_H 32 #define _NET_PPP_COMP_H 38 #ifndef DO_BSD_COMPRESS 39 #define DO_BSD_COMPRESS 0 44 #define DO_PREDICTOR_1 0 45 #define DO_PREDICTOR_2 0 55 void *(*comp_alloc)(u_char *options,
int opt_len);
57 void (*comp_free)(
void *state);
59 int (*comp_init)(
void *state, u_char *options,
int opt_len,
60 int unit,
int hdrlen,
int debug);
62 void (*comp_reset)(
void *state);
64 int (*compress)(
void *state, PACKETPTR *mret, PACKETPTR mp,
65 int orig_len,
int max_len);
67 void (*comp_stat)(
void *state,
struct compstat *stats);
70 void *(*decomp_alloc)(u_char *options,
int opt_len);
72 void (*decomp_free)(
void *state);
74 int (*decomp_init)(
void *state, u_char *options,
int opt_len,
75 int unit,
int hdrlen,
int mru,
int debug);
77 void (*decomp_reset)(
void *state);
79 int (*decompress)(
void *state, PACKETPTR mp, PACKETPTR *dmpp);
81 void (*incomp)(
void *state, PACKETPTR mp);
83 void (*decomp_stat)(
void *state,
struct compstat *stats);
96 #define DECOMP_ERROR 1 97 #define DECOMP_FATALERROR 2 102 #define CCP_CONFREQ 1 103 #define CCP_CONFACK 2 104 #define CCP_TERMREQ 5 105 #define CCP_TERMACK 6 106 #define CCP_RESETREQ 14 107 #define CCP_RESETACK 15 112 #define CCP_MAX_OPTION_LENGTH 32 117 #define CCP_CODE(dp) ((dp)[0]) 118 #define CCP_ID(dp) ((dp)[1]) 119 #define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) 122 #define CCP_OPT_CODE(dp) ((dp)[0]) 123 #define CCP_OPT_LENGTH(dp) ((dp)[1]) 124 #define CCP_OPT_MINLEN 2 129 #define CI_BSD_COMPRESS 21 130 #define CILEN_BSD_COMPRESS 3 133 #define BSD_NBITS(x) ((x) & 0x1F) 134 #define BSD_VERSION(x) ((x) >> 5) 135 #define BSD_CURRENT_VERSION 1 136 #define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) 138 #define BSD_MIN_BITS 9 139 #define BSD_MAX_BITS 15 144 #define CI_DEFLATE 26 145 #define CI_DEFLATE_DRAFT 24 146 #define CILEN_DEFLATE 4 148 #define DEFLATE_MIN_SIZE 8 149 #define DEFLATE_MAX_SIZE 15 150 #define DEFLATE_METHOD_VAL 8 151 #define DEFLATE_SIZE(x) (((x) >> 4) + DEFLATE_MIN_SIZE) 152 #define DEFLATE_METHOD(x) ((x) & 0x0F) 153 #define DEFLATE_MAKE_OPT(w) ((((w) - DEFLATE_MIN_SIZE) << 4) \ 154 + DEFLATE_METHOD_VAL) 155 #define DEFLATE_CHK_SEQUENCE 0 160 #define CI_PREDICTOR_1 1 161 #define CILEN_PREDICTOR_1 2 162 #define CI_PREDICTOR_2 2 163 #define CILEN_PREDICTOR_2 2 Definition: ppp_defs.h:128