Home | History | Annotate | Line # | Download | only in net
if_sppp.h revision 1.14
      1 /*	$NetBSD: if_sppp.h,v 1.14 2002/01/07 10:49:02 martin Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 2002 Martin Husemann. All rights reserved.
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  *
     15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     25  * SUCH DAMAGE.
     26  *
     27  */
     28 
     29 /* ioctls used by the if_spppsubr.c driver */
     30 
     31 #define	SPPP_AUTHPROTO_NONE	0
     32 #define SPPP_AUTHPROTO_PAP	1
     33 #define SPPP_AUTHPROTO_CHAP	2
     34 
     35 #define SPPP_AUTHFLAG_NOCALLOUT		1	/* do not require authentication on */
     36 						/* callouts */
     37 #define SPPP_AUTHFLAG_NORECHALLENGE	2	/* do not re-challenge CHAP */
     38 
     39 struct spppauthcfg {
     40 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
     41 	int	hisauth;		/* one of SPPP_AUTHPROTO_* above */
     42 	int	myauth;			/* one of SPPP_AUTHPROTO_* above */
     43 	int	myname_length;		/* includes terminating 0 */
     44 	int	mysecret_length;	/* includes terminating 0 */
     45 	int	hisname_length;		/* includes terminating 0 */
     46 	int	hissecret_length;	/* includes terminating 0 */
     47 	int	myauthflags;
     48 	int	hisauthflags;
     49 	char	*myname;
     50 	char	*mysecret;
     51 	char	*hisname;
     52 	char	*hissecret;
     53 };
     54 
     55 #define	SPPPGETAUTHCFG	_IOWR('i', 120, struct spppauthcfg)
     56 #define	SPPPSETAUTHCFG	_IOW('i', 121, struct spppauthcfg)
     57 
     58 struct sppplcpcfg {
     59 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
     60 	int	lcp_timeout;		/* LCP timeout, in ticks */
     61 };
     62 
     63 #define	SPPPGETLCPCFG	_IOWR('i', 122, struct sppplcpcfg)
     64 #define	SPPPSETLCPCFG	_IOW('i', 123, struct sppplcpcfg)
     65 
     66 /*
     67  * Don't change the order of this.  Ordering the phases this way allows
     68  * for a comparision of ``pp_phase >= PHASE_AUTHENTICATE'' in order to
     69  * know whether LCP is up.
     70  */
     71 #define	SPPP_PHASE_DEAD		0
     72 #define	SPPP_PHASE_ESTABLISH	1
     73 #define	SPPP_PHASE_TERMINATE	2
     74 #define	SPPP_PHASE_AUTHENTICATE	3
     75 #define	SPPP_PHASE_NETWORK	4
     76 
     77 struct spppstatus {
     78 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
     79 	int	phase;			/* one of SPPP_PHASE_* above */
     80 };
     81 
     82 #define	SPPPGETSTATUS	_IOWR('i', 124, struct spppstatus)
     83 
     84 struct spppidletimeout {
     85 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
     86 	time_t	idle_seconds;		/* number of seconds idle before
     87 					 * disconnect, 0 to disable idle-timeout */
     88 };
     89 
     90 #define	SPPPGETIDLETO	_IOWR('i', 125, struct spppstatus)
     91 #define	SPPPSETIDLETO	_IOW('i', 126, struct spppstatus)
     92 
     93 struct spppauthfailurestats {
     94 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
     95 	int	auth_failures;		/* number of LCP failures since last successfull TLU */
     96 	int	max_failures;		/* max. allowed authorization failures */
     97 };
     98 
     99 #define	SPPPGETAUTHFAILURES	_IOWR('i', 127, struct spppauthfailurestats)
    100 
    101 struct spppauthfailuresettings {
    102 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
    103 	int	max_failures;		/* max. allowed authorization failures */
    104 };
    105 #define	SPPPSETAUTHFAILURE	_IOW('i', 128, struct spppauthfailuresettings)
    106