Go to the documentation of this file.
2 #define MPPE_MAX_KEY_LEN 16
5 #define MPPE_OPT_40 0x01
6 #define MPPE_OPT_128 0x02
7 #define MPPE_OPT_STATEFUL 0x04
9 #define MPPE_OPT_56 0x08
10 #define MPPE_OPT_MPPC 0x10
11 #define MPPE_OPT_D 0x20
12 #define MPPE_OPT_UNSUPPORTED (MPPE_OPT_56|MPPE_OPT_MPPC|MPPE_OPT_D)
13 #define MPPE_OPT_UNKNOWN 0x40
22 #define MPPE_C_BIT 0x01
23 #define MPPE_D_BIT 0x10
24 #define MPPE_L_BIT 0x20
25 #define MPPE_S_BIT 0x40
26 #define MPPE_M_BIT 0x80
27 #define MPPE_H_BIT 0x01
30 #define MPPE_ALL_BITS (MPPE_D_BIT|MPPE_L_BIT|MPPE_S_BIT|MPPE_M_BIT|MPPE_H_BIT)
33 #define MPPE_OPTS_TO_CI(opts, ci) \
38 if (opts & MPPE_OPT_STATEFUL) \
41 *ptr++ = MPPE_H_BIT; \
47 if (opts & MPPE_OPT_128) \
49 if (opts & MPPE_OPT_40) \
55 #define MPPE_CI_TO_OPTS(ci, opts) \
62 if (!(ptr[0] & MPPE_H_BIT)) \
63 opts |= MPPE_OPT_STATEFUL; \
66 if (ptr[3] & MPPE_S_BIT) \
67 opts |= MPPE_OPT_128; \
68 if (ptr[3] & MPPE_L_BIT) \
69 opts |= MPPE_OPT_40; \
72 if (ptr[3] & MPPE_M_BIT) \
73 opts |= MPPE_OPT_56; \
74 if (ptr[3] & MPPE_D_BIT) \
76 if (ptr[3] & MPPE_C_BIT) \
77 opts |= MPPE_OPT_MPPC; \
80 if (ptr[0] & ~MPPE_H_BIT) \
81 opts |= MPPE_OPT_UNKNOWN; \
82 if (ptr[1] || ptr[2]) \
83 opts |= MPPE_OPT_UNKNOWN; \
84 if (ptr[3] & ~MPPE_ALL_BITS) \
85 opts |= MPPE_OPT_UNKNOWN; \