diff options
Diffstat (limited to 'include/linux/ppp-comp.h')
| -rw-r--r-- | include/linux/ppp-comp.h | 84 |
1 files changed, 3 insertions, 81 deletions
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h index e53ff65935dd..4ea1d377e1ad 100644 --- a/include/linux/ppp-comp.h +++ b/include/linux/ppp-comp.h | |||
| @@ -10,6 +10,9 @@ | |||
| 10 | #ifndef _NET_PPP_COMP_H | 10 | #ifndef _NET_PPP_COMP_H |
| 11 | #define _NET_PPP_COMP_H | 11 | #define _NET_PPP_COMP_H |
| 12 | 12 | ||
| 13 | #include <uapi/linux/ppp-comp.h> | ||
| 14 | |||
| 15 | |||
| 13 | struct module; | 16 | struct module; |
| 14 | 17 | ||
| 15 | /* | 18 | /* |
| @@ -98,87 +101,6 @@ struct compressor { | |||
| 98 | #define DECOMP_ERROR -1 /* error detected before decomp. */ | 101 | #define DECOMP_ERROR -1 /* error detected before decomp. */ |
| 99 | #define DECOMP_FATALERROR -2 /* error detected after decomp. */ | 102 | #define DECOMP_FATALERROR -2 /* error detected after decomp. */ |
| 100 | 103 | ||
| 101 | /* | ||
| 102 | * CCP codes. | ||
| 103 | */ | ||
| 104 | |||
| 105 | #define CCP_CONFREQ 1 | ||
| 106 | #define CCP_CONFACK 2 | ||
| 107 | #define CCP_TERMREQ 5 | ||
| 108 | #define CCP_TERMACK 6 | ||
| 109 | #define CCP_RESETREQ 14 | ||
| 110 | #define CCP_RESETACK 15 | ||
| 111 | |||
| 112 | /* | ||
| 113 | * Max # bytes for a CCP option | ||
| 114 | */ | ||
| 115 | |||
| 116 | #define CCP_MAX_OPTION_LENGTH 32 | ||
| 117 | |||
| 118 | /* | ||
| 119 | * Parts of a CCP packet. | ||
| 120 | */ | ||
| 121 | |||
| 122 | #define CCP_CODE(dp) ((dp)[0]) | ||
| 123 | #define CCP_ID(dp) ((dp)[1]) | ||
| 124 | #define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) | ||
| 125 | #define CCP_HDRLEN 4 | ||
| 126 | |||
| 127 | #define CCP_OPT_CODE(dp) ((dp)[0]) | ||
| 128 | #define CCP_OPT_LENGTH(dp) ((dp)[1]) | ||
| 129 | #define CCP_OPT_MINLEN 2 | ||
| 130 | |||
| 131 | /* | ||
| 132 | * Definitions for BSD-Compress. | ||
| 133 | */ | ||
| 134 | |||
| 135 | #define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ | ||
| 136 | #define CILEN_BSD_COMPRESS 3 /* length of config. option */ | ||
| 137 | |||
| 138 | /* Macros for handling the 3rd byte of the BSD-Compress config option. */ | ||
| 139 | #define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ | ||
| 140 | #define BSD_VERSION(x) ((x) >> 5) /* version of option format */ | ||
| 141 | #define BSD_CURRENT_VERSION 1 /* current version number */ | ||
| 142 | #define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) | ||
| 143 | |||
| 144 | #define BSD_MIN_BITS 9 /* smallest code size supported */ | ||
| 145 | #define BSD_MAX_BITS 15 /* largest code size supported */ | ||
| 146 | |||
| 147 | /* | ||
| 148 | * Definitions for Deflate. | ||
| 149 | */ | ||
| 150 | |||
| 151 | #define CI_DEFLATE 26 /* config option for Deflate */ | ||
| 152 | #define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ | ||
| 153 | #define CILEN_DEFLATE 4 /* length of its config option */ | ||
| 154 | |||
| 155 | #define DEFLATE_MIN_SIZE 9 | ||
| 156 | #define DEFLATE_MAX_SIZE 15 | ||
| 157 | #define DEFLATE_METHOD_VAL 8 | ||
| 158 | #define DEFLATE_SIZE(x) (((x) >> 4) + 8) | ||
| 159 | #define DEFLATE_METHOD(x) ((x) & 0x0F) | ||
| 160 | #define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) | ||
| 161 | #define DEFLATE_CHK_SEQUENCE 0 | ||
| 162 | |||
| 163 | /* | ||
| 164 | * Definitions for MPPE. | ||
| 165 | */ | ||
| 166 | |||
| 167 | #define CI_MPPE 18 /* config option for MPPE */ | ||
| 168 | #define CILEN_MPPE 6 /* length of config option */ | ||
| 169 | |||
| 170 | /* | ||
| 171 | * Definitions for other, as yet unsupported, compression methods. | ||
| 172 | */ | ||
| 173 | |||
| 174 | #define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ | ||
| 175 | #define CILEN_PREDICTOR_1 2 /* length of its config option */ | ||
| 176 | #define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ | ||
| 177 | #define CILEN_PREDICTOR_2 2 /* length of its config option */ | ||
| 178 | |||
| 179 | #ifdef __KERNEL__ | ||
| 180 | extern int ppp_register_compressor(struct compressor *); | 104 | extern int ppp_register_compressor(struct compressor *); |
| 181 | extern void ppp_unregister_compressor(struct compressor *); | 105 | extern void ppp_unregister_compressor(struct compressor *); |
| 182 | #endif /* __KERNEL__ */ | ||
| 183 | |||
| 184 | #endif /* _NET_PPP_COMP_H */ | 106 | #endif /* _NET_PPP_COMP_H */ |
