if_pppoe.h revision 1.1.2.4 1 1.1.2.4 nathanw /* $NetBSD: if_pppoe.h,v 1.1.2.4 2002/02/28 04:15:01 nathanw Exp $ */
2 1.1.2.2 nathanw
3 1.1.2.2 nathanw /*
4 1.1.2.2 nathanw * Copyright (c) 2001 Martin Husemann. All rights reserved.
5 1.1.2.2 nathanw *
6 1.1.2.2 nathanw * Redistribution and use in source and binary forms, with or without
7 1.1.2.2 nathanw * modification, are permitted provided that the following conditions
8 1.1.2.2 nathanw * are met:
9 1.1.2.2 nathanw * 1. Redistributions of source code must retain the above copyright
10 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer.
11 1.1.2.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
12 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer in the
13 1.1.2.2 nathanw * documentation and/or other materials provided with the distribution.
14 1.1.2.2 nathanw *
15 1.1.2.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 1.1.2.2 nathanw * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 1.1.2.2 nathanw * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 1.1.2.2 nathanw * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 1.1.2.2 nathanw * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 1.1.2.2 nathanw * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 1.1.2.2 nathanw * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 1.1.2.2 nathanw * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 1.1.2.2 nathanw * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 1.1.2.2 nathanw * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 1.1.2.2 nathanw * SUCH DAMAGE.
26 1.1.2.2 nathanw *
27 1.1.2.2 nathanw */
28 1.1.2.2 nathanw
29 1.1.2.2 nathanw struct pppoediscparms {
30 1.1.2.2 nathanw char ifname[IFNAMSIZ]; /* pppoe interface name */
31 1.1.2.2 nathanw char eth_ifname[IFNAMSIZ]; /* external ethernet interface name */
32 1.1.2.2 nathanw char *ac_name; /* access concentrator name (or NULL) */
33 1.1.2.2 nathanw size_t ac_name_len; /* on write: length of buffer for ac_name */
34 1.1.2.2 nathanw char *service_name; /* service name (or NULL) */
35 1.1.2.2 nathanw size_t service_name_len; /* on write: length of buffer for service name */
36 1.1.2.2 nathanw };
37 1.1.2.2 nathanw
38 1.1.2.2 nathanw #define PPPOESETPARMS _IOW('i', 110, struct pppoediscparms)
39 1.1.2.3 nathanw #define PPPOEGETPARMS _IOWR('i', 111, struct pppoediscparms)
40 1.1.2.3 nathanw
41 1.1.2.3 nathanw #define PPPOE_STATE_INITIAL 0
42 1.1.2.3 nathanw #define PPPOE_STATE_PADI_SENT 1
43 1.1.2.3 nathanw #define PPPOE_STATE_PADR_SENT 2
44 1.1.2.3 nathanw #define PPPOE_STATE_SESSION 3
45 1.1.2.3 nathanw #define PPPOE_STATE_CLOSING 4
46 1.1.2.3 nathanw
47 1.1.2.3 nathanw struct pppoeconnectionstate {
48 1.1.2.3 nathanw char ifname[IFNAMSIZ]; /* pppoe interface name */
49 1.1.2.3 nathanw u_int state; /* one of the PPPOE_STATE_ states above */
50 1.1.2.3 nathanw u_int session_id; /* if state == PPPOE_STATE_SESSION */
51 1.1.2.3 nathanw u_int padi_retry_no; /* number of retries already sent */
52 1.1.2.3 nathanw u_int padr_retry_no;
53 1.1.2.3 nathanw };
54 1.1.2.3 nathanw
55 1.1.2.3 nathanw #define PPPOEGETSESSION _IOWR('i', 112, struct pppoeconnectionstate)
56 1.1.2.3 nathanw
57 1.1.2.3 nathanw struct pppoeidletimeoutcfg {
58 1.1.2.3 nathanw char ifname[IFNAMSIZ]; /* pppoe interface name */
59 1.1.2.3 nathanw u_long idle_timeout; /* idle timeout in seconds */
60 1.1.2.3 nathanw };
61 1.1.2.3 nathanw
62 1.1.2.3 nathanw #define PPPOEGETIDLETIMEOUT _IOWR('i', 113, struct pppoeidletimeoutcfg)
63 1.1.2.3 nathanw #define PPPOESETIDLETIMEOUT _IOW('i', 114, struct pppoeidletimeoutcfg)
64 1.1.2.2 nathanw
65 1.1.2.2 nathanw #ifdef _KERNEL
66 1.1.2.2 nathanw
67 1.1.2.2 nathanw extern struct ifqueue ppoediscinq;
68 1.1.2.2 nathanw extern struct ifqueue ppoeinq;
69 1.1.2.2 nathanw
70 1.1.2.2 nathanw #ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
71 1.1.2.2 nathanw extern void * pppoe_softintr; /* softinterrupt cookie */
72 1.1.2.2 nathanw #else
73 1.1.2.2 nathanw extern struct callout pppoe_softintr; /* callout (poor mans softint) */
74 1.1.2.2 nathanw extern void pppoe_softintr_handler(void*); /* handler function */
75 1.1.2.2 nathanw #endif
76 1.1.2.2 nathanw
77 1.1.2.2 nathanw #endif /* _KERNEL */
78 1.1.2.2 nathanw
79