if_sppp.h revision 1.12 1 1.12 martin /* $NetBSD: if_sppp.h,v 1.12 2002/01/04 12:21:25 martin Exp $ */
2 1.4 explorer
3 1.1 explorer /*
4 1.12 martin * Copyright (c) 2002 Martin Husemann. All rights reserved.
5 1.1 explorer *
6 1.12 martin * Redistribution and use in source and binary forms, with or without
7 1.12 martin * modification, are permitted provided that the following conditions
8 1.12 martin * are met:
9 1.12 martin * 1. Redistributions of source code must retain the above copyright
10 1.12 martin * notice, this list of conditions and the following disclaimer.
11 1.12 martin * 2. Redistributions in binary form must reproduce the above copyright
12 1.12 martin * notice, this list of conditions and the following disclaimer in the
13 1.12 martin * documentation and/or other materials provided with the distribution.
14 1.12 martin *
15 1.12 martin * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 1.12 martin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 1.12 martin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 1.12 martin * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 1.12 martin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 1.12 martin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 1.12 martin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 1.12 martin * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 1.12 martin * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 1.12 martin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 1.12 martin * SUCH DAMAGE.
26 1.3 explorer *
27 1.1 explorer */
28 1.1 explorer
29 1.12 martin /* ioctls used by the if_spppsubr.c driver */
30 1.3 explorer
31 1.12 martin #define SPPP_AUTHPROTO_NONE 0
32 1.12 martin #define SPPP_AUTHPROTO_PAP 1
33 1.12 martin #define SPPP_AUTHPROTO_CHAP 2
34 1.12 martin
35 1.12 martin #define SPPP_AUTHFLAG_NOCALLOUT 1 /* do not require authentication on */
36 1.12 martin /* callouts */
37 1.12 martin #define SPPP_AUTHFLAG_NORECHALLENGE 2 /* do not re-challenge CHAP */
38 1.12 martin
39 1.12 martin struct spppauthcfg {
40 1.12 martin char ifname[IFNAMSIZ]; /* pppoe interface name */
41 1.12 martin int hisauth; /* one of SPPP_AUTHPROTO_* above */
42 1.12 martin int myauth; /* one of SPPP_AUTHPROTO_* above */
43 1.12 martin int myname_length; /* includes terminating 0 */
44 1.12 martin int mysecret_length; /* includes terminating 0 */
45 1.12 martin int hisname_length; /* includes terminating 0 */
46 1.12 martin int hissecret_length; /* includes terminating 0 */
47 1.12 martin int myauthflags;
48 1.12 martin int hisauthflags;
49 1.12 martin char *myname;
50 1.12 martin char *mysecret;
51 1.12 martin char *hisname;
52 1.12 martin char *hissecret;
53 1.12 martin };
54 1.12 martin
55 1.12 martin #define SPPPGETAUTHCFG _IOWR('i', 120, struct spppauthcfg)
56 1.12 martin #define SPPPSETAUTHCFG _IOW('i', 121, struct spppauthcfg)
57 1.12 martin
58 1.12 martin struct sppplcpcfg {
59 1.12 martin char ifname[IFNAMSIZ]; /* pppoe interface name */
60 1.12 martin int lcp_timeout; /* LCP timeout, in ticks */
61 1.1 explorer };
62 1.1 explorer
63 1.12 martin #define SPPPGETLCPCFG _IOWR('i', 122, struct sppplcpcfg)
64 1.12 martin #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.12 martin #define SPPP_PHASE_DEAD 0
72 1.12 martin #define SPPP_PHASE_ESTABLISH 1
73 1.12 martin #define SPPP_PHASE_TERMINATE 2
74 1.12 martin #define SPPP_PHASE_AUTHENTICATE 3
75 1.12 martin #define SPPP_PHASE_NETWORK 4
76 1.12 martin
77 1.12 martin struct spppstatus {
78 1.12 martin char ifname[IFNAMSIZ]; /* pppoe interface name */
79 1.12 martin int phase; /* one of SPPP_PHASE_* above */
80 1.1 explorer };
81 1.1 explorer
82 1.12 martin #define SPPPGETSTATUS _IOWR('i', 124, struct spppstatus)
83