1
2
3
4
5
6
7
8
9
10
11
12#ifndef _LINUX_ISDN_PPP_H
13#define _LINUX_ISDN_PPP_H
14
15
16
17
18#ifdef CONFIG_IPPP_FILTER
19#include <linux/filter.h>
20#endif
21#include <uapi/linux/isdn_ppp.h>
22
23#define DECOMP_ERR_NOMEM (-10)
24
25#define MP_END_FRAG 0x40
26#define MP_BEGIN_FRAG 0x80
27
28#define MP_MAX_QUEUE_LEN 16
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45#define IPPP_RESET_MAXDATABYTES 32
46
47struct isdn_ppp_resetparams {
48 unsigned char valid:1;
49 unsigned char rsend:1;
50 unsigned char idval:1;
51 unsigned char dtval:1;
52 unsigned char expra:1;
53 unsigned char id;
54 unsigned short maxdlen;
55 unsigned short dlen;
56 unsigned char *data;
57};
58
59
60
61
62
63struct isdn_ppp_compressor {
64 struct isdn_ppp_compressor *next, *prev;
65 struct module *owner;
66 int num;
67
68 void *(*alloc) (struct isdn_ppp_comp_data *);
69 void (*free) (void *state);
70 int (*init) (void *state, struct isdn_ppp_comp_data *,
71 int unit,int debug);
72
73
74
75
76
77
78
79 void (*reset) (void *state, unsigned char code, unsigned char id,
80 unsigned char *data, unsigned len,
81 struct isdn_ppp_resetparams *rsparm);
82
83 int (*compress) (void *state, struct sk_buff *in,
84 struct sk_buff *skb_out, int proto);
85
86 int (*decompress) (void *state,struct sk_buff *in,
87 struct sk_buff *skb_out,
88 struct isdn_ppp_resetparams *rsparm);
89
90 void (*incomp) (void *state, struct sk_buff *in,int proto);
91 void (*stat) (void *state, struct compstat *stats);
92};
93
94extern int isdn_ppp_register_compressor(struct isdn_ppp_compressor *);
95extern int isdn_ppp_unregister_compressor(struct isdn_ppp_compressor *);
96extern int isdn_ppp_dial_slave(char *);
97extern int isdn_ppp_hangup_slave(char *);
98
99typedef struct {
100 unsigned long seqerrs;
101 unsigned long frame_drops;
102 unsigned long overflows;
103 unsigned long max_queue_len;
104} isdn_mppp_stats;
105
106typedef struct {
107 int mp_mrru;
108 struct sk_buff * frags;
109 long frames;
110 unsigned int seq;
111
112
113 spinlock_t lock;
114 int ref_ct;
115
116 isdn_mppp_stats stats;
117} ippp_bundle;
118
119#define NUM_RCV_BUFFS 64
120
121struct ippp_buf_queue {
122 struct ippp_buf_queue *next;
123 struct ippp_buf_queue *last;
124 char *buf;
125 int len;
126};
127
128
129enum ippp_ccp_reset_states {
130 CCPResetIdle,
131 CCPResetSentReq,
132 CCPResetRcvdReq,
133 CCPResetSentAck,
134 CCPResetRcvdAck
135};
136
137struct ippp_ccp_reset_state {
138 enum ippp_ccp_reset_states state;
139 struct ippp_struct *is;
140 unsigned char id;
141 unsigned char ta:1;
142 unsigned char expra:1;
143 int dlen;
144 struct timer_list timer;
145
146
147
148 unsigned char data[IPPP_RESET_MAXDATABYTES];
149};
150
151
152
153struct ippp_ccp_reset {
154 struct ippp_ccp_reset_state *rs[256];
155 unsigned char lastid;
156};
157
158struct ippp_struct {
159 struct ippp_struct *next_link;
160 int state;
161 spinlock_t buflock;
162 struct ippp_buf_queue rq[NUM_RCV_BUFFS];
163 struct ippp_buf_queue *first;
164 struct ippp_buf_queue *last;
165 wait_queue_head_t wq;
166 struct task_struct *tk;
167 unsigned int mpppcfg;
168 unsigned int pppcfg;
169 unsigned int mru;
170 unsigned int mpmru;
171 unsigned int mpmtu;
172 unsigned int maxcid;
173 struct isdn_net_local_s *lp;
174 int unit;
175 int minor;
176 unsigned int last_link_seqno;
177 long mp_seqno;
178#ifdef CONFIG_ISDN_PPP_VJ
179 unsigned char *cbuf;
180 struct slcompress *slcomp;
181#endif
182#ifdef CONFIG_IPPP_FILTER
183 struct bpf_prog *pass_filter;
184 struct bpf_prog *active_filter;
185#endif
186 unsigned long debug;
187 struct isdn_ppp_compressor *compressor,*decompressor;
188 struct isdn_ppp_compressor *link_compressor,*link_decompressor;
189 void *decomp_stat,*comp_stat,*link_decomp_stat,*link_comp_stat;
190 struct ippp_ccp_reset *reset;
191 unsigned long compflags;
192};
193
194#endif
195