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