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