if_sppp.h revision 1.7.2.6 1 1.7.2.6 nathanw /* $NetBSD: if_sppp.h,v 1.7.2.6 2002/04/01 07:48:23 nathanw Exp $ */
2 1.4 explorer
3 1.1 explorer /*
4 1.7.2.4 nathanw * Copyright (c) 2002 Martin Husemann. All rights reserved.
5 1.1 explorer *
6 1.7.2.4 nathanw * Redistribution and use in source and binary forms, with or without
7 1.7.2.4 nathanw * modification, are permitted provided that the following conditions
8 1.7.2.4 nathanw * are met:
9 1.7.2.4 nathanw * 1. Redistributions of source code must retain the above copyright
10 1.7.2.4 nathanw * notice, this list of conditions and the following disclaimer.
11 1.7.2.4 nathanw * 2. Redistributions in binary form must reproduce the above copyright
12 1.7.2.4 nathanw * notice, this list of conditions and the following disclaimer in the
13 1.7.2.4 nathanw * documentation and/or other materials provided with the distribution.
14 1.7.2.4 nathanw *
15 1.7.2.4 nathanw * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 1.7.2.4 nathanw * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 1.7.2.4 nathanw * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 1.7.2.4 nathanw * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 1.7.2.4 nathanw * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 1.7.2.4 nathanw * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 1.7.2.4 nathanw * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 1.7.2.4 nathanw * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 1.7.2.4 nathanw * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 1.7.2.4 nathanw * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 1.7.2.4 nathanw * SUCH DAMAGE.
26 1.3 explorer *
27 1.1 explorer */
28 1.1 explorer
29 1.7.2.4 nathanw /* ioctls used by the if_spppsubr.c driver */
30 1.5 thorpej
31 1.7.2.4 nathanw #define SPPP_AUTHPROTO_NONE 0
32 1.7.2.4 nathanw #define SPPP_AUTHPROTO_PAP 1
33 1.7.2.4 nathanw #define SPPP_AUTHPROTO_CHAP 2
34 1.7.2.4 nathanw
35 1.7.2.4 nathanw #define SPPP_AUTHFLAG_NOCALLOUT 1 /* do not require authentication on */
36 1.7.2.4 nathanw /* callouts */
37 1.7.2.4 nathanw #define SPPP_AUTHFLAG_NORECHALLENGE 2 /* do not re-challenge CHAP */
38 1.7.2.4 nathanw
39 1.7.2.4 nathanw struct spppauthcfg {
40 1.7.2.4 nathanw char ifname[IFNAMSIZ]; /* pppoe interface name */
41 1.7.2.5 nathanw u_int hisauth; /* one of SPPP_AUTHPROTO_* above */
42 1.7.2.5 nathanw u_int myauth; /* one of SPPP_AUTHPROTO_* above */
43 1.7.2.5 nathanw u_int myname_length; /* includes terminating 0 */
44 1.7.2.5 nathanw u_int mysecret_length; /* includes terminating 0 */
45 1.7.2.5 nathanw u_int hisname_length; /* includes terminating 0 */
46 1.7.2.5 nathanw u_int hissecret_length; /* includes terminating 0 */
47 1.7.2.5 nathanw u_int myauthflags;
48 1.7.2.5 nathanw u_int hisauthflags;
49 1.7.2.4 nathanw char *myname;
50 1.7.2.4 nathanw char *mysecret;
51 1.7.2.4 nathanw char *hisname;
52 1.7.2.4 nathanw char *hissecret;
53 1.7.2.4 nathanw };
54 1.7.2.4 nathanw
55 1.7.2.4 nathanw #define SPPPGETAUTHCFG _IOWR('i', 120, struct spppauthcfg)
56 1.7.2.4 nathanw #define SPPPSETAUTHCFG _IOW('i', 121, struct spppauthcfg)
57 1.7.2.4 nathanw
58 1.7.2.4 nathanw struct sppplcpcfg {
59 1.7.2.4 nathanw char ifname[IFNAMSIZ]; /* pppoe interface name */
60 1.7.2.4 nathanw int lcp_timeout; /* LCP timeout, in ticks */
61 1.3 explorer };
62 1.3 explorer
63 1.7.2.4 nathanw #define SPPPGETLCPCFG _IOWR('i', 122, struct sppplcpcfg)
64 1.7.2.4 nathanw #define SPPPSETLCPCFG _IOW('i', 123, struct sppplcpcfg)
65 1.3 explorer
66 1.3 explorer /*
67 1.3 explorer * Don't change the order of this. Ordering the phases this way allows
68 1.3 explorer * for a comparision of ``pp_phase >= PHASE_AUTHENTICATE'' in order to
69 1.3 explorer * know whether LCP is up.
70 1.3 explorer */
71 1.7.2.4 nathanw #define SPPP_PHASE_DEAD 0
72 1.7.2.4 nathanw #define SPPP_PHASE_ESTABLISH 1
73 1.7.2.4 nathanw #define SPPP_PHASE_TERMINATE 2
74 1.7.2.4 nathanw #define SPPP_PHASE_AUTHENTICATE 3
75 1.7.2.4 nathanw #define SPPP_PHASE_NETWORK 4
76 1.1 explorer
77 1.7.2.4 nathanw struct spppstatus {
78 1.7.2.4 nathanw char ifname[IFNAMSIZ]; /* pppoe interface name */
79 1.7.2.4 nathanw int phase; /* one of SPPP_PHASE_* above */
80 1.7.2.4 nathanw };
81 1.1 explorer
82 1.7.2.4 nathanw #define SPPPGETSTATUS _IOWR('i', 124, struct spppstatus)
83 1.3 explorer
84 1.7.2.4 nathanw struct spppidletimeout {
85 1.7.2.4 nathanw char ifname[IFNAMSIZ]; /* pppoe interface name */
86 1.7.2.4 nathanw time_t idle_seconds; /* number of seconds idle before
87 1.7.2.4 nathanw * disconnect, 0 to disable idle-timeout */
88 1.7.2.4 nathanw };
89 1.7.2.4 nathanw
90 1.7.2.4 nathanw #define SPPPGETIDLETO _IOWR('i', 125, struct spppstatus)
91 1.7.2.4 nathanw #define SPPPSETIDLETO _IOW('i', 126, struct spppstatus)
92 1.3 explorer
93 1.7.2.4 nathanw struct spppauthfailurestats {
94 1.7.2.4 nathanw char ifname[IFNAMSIZ]; /* pppoe interface name */
95 1.7.2.4 nathanw int auth_failures; /* number of LCP failures since last successfull TLU */
96 1.7.2.4 nathanw int max_failures; /* max. allowed authorization failures */
97 1.7.2.4 nathanw };
98 1.3 explorer
99 1.7.2.4 nathanw #define SPPPGETAUTHFAILURES _IOWR('i', 127, struct spppauthfailurestats)
100 1.1 explorer
101 1.7.2.4 nathanw struct spppauthfailuresettings {
102 1.7.2.4 nathanw char ifname[IFNAMSIZ]; /* pppoe interface name */
103 1.7.2.4 nathanw int max_failures; /* max. allowed authorization failures */
104 1.7.2.4 nathanw };
105 1.7.2.4 nathanw #define SPPPSETAUTHFAILURE _IOW('i', 128, struct spppauthfailuresettings)
106 1.7.2.6 nathanw
107 1.7.2.6 nathanw /* set the DNS options we would like to query during PPP negotiation */
108 1.7.2.6 nathanw struct spppdnssettings {
109 1.7.2.6 nathanw char ifname[IFNAMSIZ]; /* pppoe interface name */
110 1.7.2.6 nathanw int query_dns; /* bitmask (bits 0 and 1) for DNS options to query in IPCP */
111 1.7.2.6 nathanw };
112 1.7.2.6 nathanw #define SPPPSETDNSOPTS _IOW('i', 129, struct spppdnssettings)
113 1.7.2.6 nathanw #define SPPPGETDNSOPTS _IOWR('i', 130, struct spppdnssettings)
114 1.7.2.6 nathanw
115 1.7.2.6 nathanw /* get the DNS addresses we received from the peer */
116 1.7.2.6 nathanw struct spppdnsaddrs {
117 1.7.2.6 nathanw char ifname[IFNAMSIZ]; /* pppoe interface name */
118 1.7.2.6 nathanw u_int32_t dns[2]; /* IP addresses */
119 1.7.2.6 nathanw };
120 1.7.2.6 nathanw
121 1.7.2.6 nathanw #define SPPPGETDNSADDRS _IOWR('i', 131, struct spppdnsaddrs)
122