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