1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef _ROUTER_H
13#define _ROUTER_H
14
15#define ROUTER_NAME "wanrouter"
16#define ROUTER_VERSION 1
17#define ROUTER_RELEASE 1
18#define ROUTER_IOCTL 'W'
19#define ROUTER_MAGIC 0x524D4157L
20
21enum router_ioctls
22{
23 ROUTER_SETUP = ROUTER_IOCTL<<8,
24 ROUTER_DOWN,
25 ROUTER_STAT,
26 ROUTER_IFNEW,
27 ROUTER_IFDEL,
28 ROUTER_IFSTAT,
29 ROUTER_USER = (ROUTER_IOCTL<<8)+16,
30 ROUTER_USER_MAX = (ROUTER_IOCTL<<8)+31
31};
32
33#define PROC_DATA_PORT_0 0x8000
34#define PROC_DATA_PORT_1 0x8001
35
36#define NLPID_IP 0xCC
37#define NLPID_SNAP 0x80
38#define NLPID_CLNP 0x81
39#define NLPID_ESIS 0x82
40#define NLPID_ISIS 0x83
41#define NLPID_Q933 0x08
42
43#define WAN_IFNAME_SZ 15
44#define WAN_DRVNAME_SZ 15
45#define WAN_ADDRESS_SZ 31
46#define USED_BY_FIELD 8
47
48#define UDP_PTPIPE_TYPE 0x01
49#define UDP_FPIPE_TYPE 0x02
50#define UDP_CPIPE_TYPE 0x03
51#define UDP_DRVSTATS_TYPE 0x04
52#define UDP_INVALID_TYPE 0x05
53
54#define CMD_OK 0
55#define CMD_TIMEOUT 0xFF
56
57#define UDP_PKT_FRM_STACK 0x00
58#define UDP_PKT_FRM_NETWORK 0x01
59
60#define MAX_INTR_TEST_COUNTER 100
61
62#define CRITICAL_IN_ISR 0xA1
63#define CRITICAL_INTR_HANDLED 0xB1
64
65typedef struct wan_x25_conf
66{
67 unsigned lo_pvc;
68 unsigned hi_pvc;
69 unsigned lo_svc;
70 unsigned hi_svc;
71 unsigned hdlc_window;
72 unsigned pkt_window;
73 unsigned t1;
74 unsigned t2;
75 unsigned t4;
76 unsigned n2;
77 unsigned t10_t20;
78 unsigned t11_t21;
79 unsigned t12_t22;
80 unsigned t13_t23;
81 unsigned t16_t26;
82 unsigned t28;
83 unsigned r10_r20;
84 unsigned r12_r22;
85 unsigned r13_r23;
86 unsigned ccitt_compat;
87 unsigned x25_conf_opt;
88 unsigned char LAPB_hdlc_only;
89 unsigned char logging;
90 unsigned char oob_on_modem;
91} wan_x25_conf_t;
92
93typedef struct wan_fr_conf
94{
95 unsigned signalling;
96 unsigned t391;
97 unsigned t392;
98 unsigned n391;
99 unsigned n392;
100 unsigned n393;
101 unsigned dlci_num;
102 unsigned dlci[100];
103} wan_fr_conf_t;
104
105typedef struct wan_ppp_conf
106{
107 unsigned restart_tmr;
108 unsigned auth_rsrt_tmr;
109 unsigned auth_wait_tmr;
110 unsigned mdm_fail_tmr;
111 unsigned dtr_drop_tmr;
112 unsigned connect_tmout;
113 unsigned conf_retry;
114 unsigned term_retry;
115 unsigned fail_retry;
116 unsigned auth_retry;
117 unsigned auth_options;
118 unsigned ip_options;
119 char authenticator;
120 char ip_mode;
121} wan_ppp_conf_t;
122
123typedef struct wan_chdlc_conf
124{
125 unsigned char ignore_dcd;
126 unsigned char ignore_cts;
127 unsigned char ignore_keepalive;
128 unsigned char hdlc_streaming;
129 unsigned char receive_only;
130 unsigned keepalive_tx_tmr;
131 unsigned keepalive_rx_tmr;
132 unsigned keepalive_err_margin;
133 unsigned slarp_timer;
134} wan_chdlc_conf_t;
135
136typedef struct wandev_conf
137{
138 unsigned magic;
139 unsigned config_id;
140
141 unsigned ioport;
142 unsigned long maddr;
143 unsigned msize;
144 int irq;
145 int dma;
146 char S514_CPU_no[1];
147 unsigned PCI_slot_no;
148 char auto_pci_cfg;
149 char comm_port;
150 unsigned bps;
151 unsigned mtu;
152 unsigned udp_port;
153 unsigned char ttl;
154 unsigned char ft1;
155 char interface;
156 char clocking;
157 char line_coding;
158 char station;
159 char connection;
160 char read_mode;
161 char receive_only;
162 char tty;
163 unsigned tty_major;
164 unsigned tty_minor;
165 unsigned tty_mode;
166 char backup;
167 unsigned hw_opt[4];
168 unsigned reserved[4];
169
170 unsigned data_size;
171 void* data;
172 union
173 {
174 wan_x25_conf_t x25;
175 wan_ppp_conf_t ppp;
176 wan_fr_conf_t fr;
177 wan_chdlc_conf_t chdlc;
178 } u;
179} wandev_conf_t;
180
181#define WANCONFIG_X25 101
182#define WANCONFIG_FR 102
183#define WANCONFIG_PPP 103
184#define WANCONFIG_CHDLC 104
185#define WANCONFIG_BSC 105
186#define WANCONFIG_HDLC 106
187#define WANCONFIG_MPPP 107
188
189#define WANOPT_OFF 0
190#define WANOPT_ON 1
191#define WANOPT_NO 0
192#define WANOPT_YES 1
193
194#define WANOPT_RS232 0
195#define WANOPT_V35 1
196
197#define WANOPT_NRZ 0
198#define WANOPT_NRZI 1
199#define WANOPT_FM0 2
200#define WANOPT_FM1 3
201
202#define WANOPT_POINTTOPOINT 0
203#define WANOPT_MULTIDROP 1
204
205#define WANOPT_EXTERNAL 0
206#define WANOPT_INTERNAL 1
207
208#define WANOPT_DTE 0
209#define WANOPT_DCE 1
210#define WANOPT_CPE 0
211#define WANOPT_NODE 1
212#define WANOPT_SECONDARY 0
213#define WANOPT_PRIMARY 1
214
215#define WANOPT_PERMANENT 0
216#define WANOPT_SWITCHED 1
217#define WANOPT_ONDEMAND 2
218
219#define WANOPT_FR_ANSI 1
220#define WANOPT_FR_Q933 2
221#define WANOPT_FR_LMI 3
222
223#define WANOPT_PPP_STATIC 0
224#define WANOPT_PPP_HOST 1
225#define WANOPT_PPP_PEER 2
226
227#define WANOPT_ONE 1
228#define WANOPT_TWO 2
229#define WANOPT_ONE_AND_HALF 3
230
231#define WANOPT_NONE 0
232#define WANOPT_ODD 1
233#define WANOPT_EVEN 2
234
235#define WANOPT_PRI 0
236#define WANOPT_SEC 1
237
238#define WANOPT_INTR 0
239#define WANOPT_POLL 1
240
241#define WANOPT_TTY_SYNC 0
242#define WANOPT_TTY_ASYNC 1
243
244typedef struct wandev_stat
245{
246 unsigned state;
247 unsigned ndev;
248
249 unsigned connection;
250 unsigned media_type;
251 unsigned mtu;
252
253 unsigned modem_status;
254 unsigned rx_frames;
255 unsigned rx_overruns;
256 unsigned rx_crc_err;
257 unsigned rx_aborts;
258 unsigned rx_bad_length;
259 unsigned rx_dropped;
260 unsigned tx_frames;
261 unsigned tx_underruns;
262 unsigned tx_timeouts;
263 unsigned tx_rejects;
264
265 unsigned rx_bad_format;
266 unsigned rx_bad_addr;
267 unsigned tx_retries;
268 unsigned reserved[16];
269} wandev_stat_t;
270
271enum wan_states
272{
273 WAN_UNCONFIGURED,
274 WAN_DISCONNECTED,
275 WAN_CONNECTING,
276 WAN_CONNECTED,
277 WAN_LIMIT,
278 WAN_DUALPORT,
279 WAN_DISCONNECTING,
280 WAN_FT1_READY
281};
282
283enum {
284 WAN_LOCAL_IP,
285 WAN_POINTOPOINT_IP,
286 WAN_NETMASK_IP,
287 WAN_BROADCAST_IP
288};
289
290#define WAN_MODEM_CTS 0x0001
291#define WAN_MODEM_DCD 0x0002
292#define WAN_MODEM_DTR 0x0010
293#define WAN_MODEM_RTS 0x0020
294
295typedef struct wanif_conf
296{
297 unsigned magic;
298 unsigned config_id;
299 char name[WAN_IFNAME_SZ+1];
300 char addr[WAN_ADDRESS_SZ+1];
301 char usedby[USED_BY_FIELD];
302 unsigned idle_timeout;
303 unsigned hold_timeout;
304 unsigned cir;
305 unsigned bc;
306 unsigned be;
307 unsigned char enable_IPX;
308 unsigned char inarp;
309 unsigned inarp_interval;
310 unsigned long network_number;
311 char mc;
312 char local_addr[WAN_ADDRESS_SZ+1];
313 unsigned char port;
314 unsigned char protocol;
315 char pap;
316 char chap;
317 unsigned char userid[511];
318 unsigned char passwd[511];
319 unsigned char sysname[31];
320 unsigned char ignore_dcd;
321 unsigned char ignore_cts;
322 unsigned char ignore_keepalive;
323 unsigned char hdlc_streaming;
324 unsigned keepalive_tx_tmr;
325 unsigned keepalive_rx_tmr;
326 unsigned keepalive_err_margin;
327 unsigned slarp_timer;
328 unsigned char ttl;
329 char interface;
330 char clocking;
331 unsigned bps;
332 unsigned mtu;
333 unsigned char if_down;
334 unsigned char gateway;
335 unsigned char true_if_encoding;
336
337 unsigned char asy_data_trans;
338 unsigned char rts_hs_for_receive;
339 unsigned char xon_xoff_hs_for_receive;
340 unsigned char xon_xoff_hs_for_transmit;
341 unsigned char dcd_hs_for_transmit;
342 unsigned char cts_hs_for_transmit;
343 unsigned char async_mode;
344 unsigned tx_bits_per_char;
345 unsigned rx_bits_per_char;
346 unsigned stop_bits;
347 unsigned char parity;
348 unsigned break_timer;
349 unsigned inter_char_timer;
350 unsigned rx_complete_length;
351 unsigned xon_char;
352 unsigned xoff_char;
353 unsigned char receive_only;
354} wanif_conf_t;
355
356#endif
357