Rev 422 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
422 | giacomo | 1 | /* Linux ISDN subsystem, sync PPP, interface to ipppd |
2 | * |
||
3 | * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de) |
||
4 | * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg |
||
5 | * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de) |
||
6 | * Copyright 2000-2002 by Kai Germaschewski (kai@germaschewski.name) |
||
7 | * |
||
8 | * This software may be used and distributed according to the terms |
||
9 | * of the GNU General Public License, incorporated herein by reference. |
||
10 | * |
||
11 | */ |
||
12 | |||
13 | #ifndef _LINUX_ISDN_PPP_H |
||
14 | #define _LINUX_ISDN_PPP_H |
||
15 | |||
16 | #define CALLTYPE_INCOMING 0x1 |
||
17 | #define CALLTYPE_OUTGOING 0x2 |
||
18 | #define CALLTYPE_CALLBACK 0x4 |
||
19 | |||
20 | #define IPPP_VERSION "2.2.0" |
||
21 | |||
22 | struct pppcallinfo |
||
23 | { |
||
24 | int calltype; |
||
25 | unsigned char local_num[64]; |
||
26 | unsigned char remote_num[64]; |
||
27 | int charge_units; |
||
28 | }; |
||
29 | |||
30 | #define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo) |
||
31 | #define PPPIOCBUNDLE _IOW('t',129,int) |
||
32 | #define PPPIOCGMPFLAGS _IOR('t',130,int) |
||
33 | #define PPPIOCSMPFLAGS _IOW('t',131,int) |
||
34 | #define PPPIOCSMPMTU _IOW('t',132,int) |
||
35 | #define PPPIOCSMPMRU _IOW('t',133,int) |
||
36 | #define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long[8]) |
||
37 | #define PPPIOCSCOMPRESSOR _IOW('t',135,int) |
||
38 | #define PPPIOCGIFNAME _IOR('t',136,char[IFNAMSIZ]) |
||
39 | |||
40 | #define SC_MP_PROT 0x00000200 |
||
41 | #define SC_REJ_MP_PROT 0x00000400 |
||
42 | #define SC_OUT_SHORT_SEQ 0x00000800 |
||
43 | #define SC_IN_SHORT_SEQ 0x00004000 |
||
44 | |||
45 | #define ISDN_PPP_COMP_MAX_OPTIONS 16 |
||
46 | |||
47 | #define IPPP_COMP_FLAG_XMIT 0x1 |
||
48 | #define IPPP_COMP_FLAG_LINK 0x2 |
||
49 | |||
50 | struct isdn_ppp_comp_data { |
||
51 | int num; |
||
52 | unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS]; |
||
53 | int optlen; |
||
54 | int flags; |
||
55 | }; |
||
56 | |||
57 | #ifdef __KERNEL__ |
||
58 | |||
59 | #include <linux/skbuff.h> |
||
60 | #include <linux/ppp_defs.h> |
||
61 | |||
62 | #define DECOMP_ERR_NOMEM (-10) |
||
63 | |||
64 | /* |
||
65 | * We need a way for the decompressor to influence the generation of CCP |
||
66 | * Reset-Requests in a variety of ways. The decompressor is already returning |
||
67 | * a lot of information (generated skb length, error conditions) so we use |
||
68 | * another parameter. This parameter is a pointer to a structure which is |
||
69 | * to be marked valid by the decompressor and only in this case is ever used. |
||
70 | * Furthermore, the only case where this data is used is when the decom- |
||
71 | * pressor returns DECOMP_ERROR. |
||
72 | * |
||
73 | * We use this same struct for the reset entry of the compressor to commu- |
||
74 | * nicate to its caller how to deal with sending of a Reset Ack. In this |
||
75 | * case, expra is not used, but other options still apply (suppressing |
||
76 | * sending with rsend, appending arbitrary data, etc). |
||
77 | */ |
||
78 | |||
79 | #define IPPP_RESET_MAXDATABYTES 32 |
||
80 | |||
81 | struct isdn_ppp_resetparams { |
||
82 | unsigned char valid:1; /* rw Is this structure filled at all ? */ |
||
83 | unsigned char rsend:1; /* rw Should we send one at all ? */ |
||
84 | unsigned char idval:1; /* rw Is the id field valid ? */ |
||
85 | unsigned char dtval:1; /* rw Is the data field valid ? */ |
||
86 | unsigned char expra:1; /* rw Is an Ack expected for this Req ? */ |
||
87 | unsigned char id; /* wo Send CCP ResetReq with this id */ |
||
88 | unsigned short maxdlen; /* ro Max bytes to be stored in data field */ |
||
89 | unsigned short dlen; /* rw Bytes stored in data field */ |
||
90 | unsigned char *data; /* wo Data for ResetReq info field */ |
||
91 | }; |
||
92 | |||
93 | /* |
||
94 | * this is an 'old friend' from ppp-comp.h under a new name |
||
95 | * check the original include for more information |
||
96 | */ |
||
97 | struct isdn_ppp_compressor { |
||
98 | struct module *owner; |
||
99 | struct list_head list; |
||
100 | int num; /* CCP compression protocol number */ |
||
101 | |||
102 | void *(*alloc) (struct isdn_ppp_comp_data *); |
||
103 | void (*free) (void *state); |
||
104 | int (*init) (void *state, struct isdn_ppp_comp_data *, |
||
105 | int unit,int debug); |
||
106 | |||
107 | /* The reset entry needs to get more exact information about the |
||
108 | ResetReq or ResetAck it was called with. The parameters are |
||
109 | obvious. If reset is called without a Req or Ack frame which |
||
110 | could be handed into it, code MUST be set to 0. Using rsparm, |
||
111 | the reset entry can control if and how a ResetAck is returned. */ |
||
112 | |||
113 | void (*reset) (void *state, unsigned char code, unsigned char id, |
||
114 | unsigned char *data, unsigned len, |
||
115 | struct isdn_ppp_resetparams *rsparm); |
||
116 | |||
117 | int (*compress) (void *state, struct sk_buff *in, |
||
118 | struct sk_buff *skb_out, int proto); |
||
119 | |||
120 | int (*decompress) (void *state,struct sk_buff *in, |
||
121 | struct sk_buff *skb_out, |
||
122 | struct isdn_ppp_resetparams *rsparm); |
||
123 | |||
124 | void (*incomp) (void *state, struct sk_buff *in,int proto); |
||
125 | void (*stat) (void *state, struct compstat *stats); |
||
126 | }; |
||
127 | |||
128 | extern int isdn_ppp_register_compressor(struct isdn_ppp_compressor *); |
||
129 | extern int isdn_ppp_unregister_compressor(struct isdn_ppp_compressor *); |
||
130 | |||
131 | #endif /* __KERNEL__ */ |
||
132 | #endif /* _LINUX_ISDN_PPP_H */ |