Home | History | Annotate | Line # | Download | only in net
if_sppp.h revision 1.16
      1  1.16    martin /*	$NetBSD: if_sppp.h,v 1.16 2002/03/02 16:23:42 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.15    martin 	u_int	hisauth;		/* one of SPPP_AUTHPROTO_* above */
     42  1.15    martin 	u_int	myauth;			/* one of SPPP_AUTHPROTO_* above */
     43  1.15    martin 	u_int	myname_length;		/* includes terminating 0 */
     44  1.15    martin 	u_int	mysecret_length;	/* includes terminating 0 */
     45  1.15    martin 	u_int	hisname_length;		/* includes terminating 0 */
     46  1.15    martin 	u_int	hissecret_length;	/* includes terminating 0 */
     47  1.15    martin 	u_int	myauthflags;
     48  1.15    martin 	u_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  1.13    martin 
     84  1.13    martin struct spppidletimeout {
     85  1.13    martin 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
     86  1.13    martin 	time_t	idle_seconds;		/* number of seconds idle before
     87  1.13    martin 					 * disconnect, 0 to disable idle-timeout */
     88  1.13    martin };
     89  1.13    martin 
     90  1.13    martin #define	SPPPGETIDLETO	_IOWR('i', 125, struct spppstatus)
     91  1.13    martin #define	SPPPSETIDLETO	_IOW('i', 126, struct spppstatus)
     92  1.14    martin 
     93  1.14    martin struct spppauthfailurestats {
     94  1.14    martin 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
     95  1.14    martin 	int	auth_failures;		/* number of LCP failures since last successfull TLU */
     96  1.14    martin 	int	max_failures;		/* max. allowed authorization failures */
     97  1.14    martin };
     98  1.14    martin 
     99  1.14    martin #define	SPPPGETAUTHFAILURES	_IOWR('i', 127, struct spppauthfailurestats)
    100  1.14    martin 
    101  1.14    martin struct spppauthfailuresettings {
    102  1.14    martin 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
    103  1.14    martin 	int	max_failures;		/* max. allowed authorization failures */
    104  1.14    martin };
    105  1.14    martin #define	SPPPSETAUTHFAILURE	_IOW('i', 128, struct spppauthfailuresettings)
    106  1.16    martin 
    107  1.16    martin /* set the DNS options we would like to query during PPP negotiation */
    108  1.16    martin struct spppdnssettings {
    109  1.16    martin 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
    110  1.16    martin 	int	query_dns;		/* bitmask (bits 0 and 1) for DNS options to query in IPCP */
    111  1.16    martin };
    112  1.16    martin #define	SPPPSETDNSOPTS		_IOW('i', 129, struct spppdnssettings)
    113  1.16    martin #define	SPPPGETDNSOPTS		_IOWR('i', 130, struct spppdnssettings)
    114  1.16    martin 
    115  1.16    martin /* get the DNS addresses we received from the peer */
    116  1.16    martin struct spppdnsaddrs {
    117  1.16    martin 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
    118  1.16    martin 	u_int32_t dns[2];		/* IP addresses */
    119  1.16    martin };
    120  1.16    martin 
    121  1.16    martin #define SPPPGETDNSADDRS		_IOWR('i', 131, struct spppdnsaddrs)
    122