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