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