2002-01-15 15:28:08 +03:00
|
|
|
/* $NetBSD: if_sppp.h,v 1.15 2002/01/15 12:28:08 martin Exp $ */
|
1999-04-04 10:57:03 +04:00
|
|
|
|
1999-03-25 06:38:00 +03:00
|
|
|
/*
|
2002-01-04 15:21:24 +03:00
|
|
|
* Copyright (c) 2002 Martin Husemann. All rights reserved.
|
1999-03-25 06:38:00 +03:00
|
|
|
*
|
2002-01-04 15:21:24 +03:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
1999-04-04 10:07:56 +04:00
|
|
|
*
|
2002-01-04 15:21:24 +03:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
1999-03-25 06:38:00 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2002-01-04 15:21:24 +03:00
|
|
|
/* ioctls used by the if_spppsubr.c driver */
|
|
|
|
|
|
|
|
#define SPPP_AUTHPROTO_NONE 0
|
|
|
|
#define SPPP_AUTHPROTO_PAP 1
|
|
|
|
#define SPPP_AUTHPROTO_CHAP 2
|
|
|
|
|
|
|
|
#define SPPP_AUTHFLAG_NOCALLOUT 1 /* do not require authentication on */
|
|
|
|
/* callouts */
|
|
|
|
#define SPPP_AUTHFLAG_NORECHALLENGE 2 /* do not re-challenge CHAP */
|
|
|
|
|
|
|
|
struct spppauthcfg {
|
|
|
|
char ifname[IFNAMSIZ]; /* pppoe interface name */
|
2002-01-15 15:28:08 +03:00
|
|
|
u_int hisauth; /* one of SPPP_AUTHPROTO_* above */
|
|
|
|
u_int myauth; /* one of SPPP_AUTHPROTO_* above */
|
|
|
|
u_int myname_length; /* includes terminating 0 */
|
|
|
|
u_int mysecret_length; /* includes terminating 0 */
|
|
|
|
u_int hisname_length; /* includes terminating 0 */
|
|
|
|
u_int hissecret_length; /* includes terminating 0 */
|
|
|
|
u_int myauthflags;
|
|
|
|
u_int hisauthflags;
|
2002-01-04 15:21:24 +03:00
|
|
|
char *myname;
|
|
|
|
char *mysecret;
|
|
|
|
char *hisname;
|
|
|
|
char *hissecret;
|
1999-03-25 06:38:00 +03:00
|
|
|
};
|
|
|
|
|
2002-01-04 15:21:24 +03:00
|
|
|
#define SPPPGETAUTHCFG _IOWR('i', 120, struct spppauthcfg)
|
|
|
|
#define SPPPSETAUTHCFG _IOW('i', 121, struct spppauthcfg)
|
1999-04-04 10:07:56 +04:00
|
|
|
|
2002-01-04 15:21:24 +03:00
|
|
|
struct sppplcpcfg {
|
|
|
|
char ifname[IFNAMSIZ]; /* pppoe interface name */
|
|
|
|
int lcp_timeout; /* LCP timeout, in ticks */
|
1999-04-04 10:07:56 +04:00
|
|
|
};
|
|
|
|
|
2002-01-04 15:21:24 +03:00
|
|
|
#define SPPPGETLCPCFG _IOWR('i', 122, struct sppplcpcfg)
|
|
|
|
#define SPPPSETLCPCFG _IOW('i', 123, struct sppplcpcfg)
|
1999-04-04 10:07:56 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Don't change the order of this. Ordering the phases this way allows
|
|
|
|
* for a comparision of ``pp_phase >= PHASE_AUTHENTICATE'' in order to
|
|
|
|
* know whether LCP is up.
|
|
|
|
*/
|
2002-01-04 15:21:24 +03:00
|
|
|
#define SPPP_PHASE_DEAD 0
|
|
|
|
#define SPPP_PHASE_ESTABLISH 1
|
|
|
|
#define SPPP_PHASE_TERMINATE 2
|
|
|
|
#define SPPP_PHASE_AUTHENTICATE 3
|
|
|
|
#define SPPP_PHASE_NETWORK 4
|
|
|
|
|
|
|
|
struct spppstatus {
|
|
|
|
char ifname[IFNAMSIZ]; /* pppoe interface name */
|
|
|
|
int phase; /* one of SPPP_PHASE_* above */
|
1999-03-25 06:38:00 +03:00
|
|
|
};
|
|
|
|
|
2002-01-04 15:21:24 +03:00
|
|
|
#define SPPPGETSTATUS _IOWR('i', 124, struct spppstatus)
|
2002-01-06 23:14:29 +03:00
|
|
|
|
|
|
|
struct spppidletimeout {
|
|
|
|
char ifname[IFNAMSIZ]; /* pppoe interface name */
|
|
|
|
time_t idle_seconds; /* number of seconds idle before
|
|
|
|
* disconnect, 0 to disable idle-timeout */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SPPPGETIDLETO _IOWR('i', 125, struct spppstatus)
|
|
|
|
#define SPPPSETIDLETO _IOW('i', 126, struct spppstatus)
|
2002-01-07 13:49:02 +03:00
|
|
|
|
|
|
|
struct spppauthfailurestats {
|
|
|
|
char ifname[IFNAMSIZ]; /* pppoe interface name */
|
|
|
|
int auth_failures; /* number of LCP failures since last successfull TLU */
|
|
|
|
int max_failures; /* max. allowed authorization failures */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SPPPGETAUTHFAILURES _IOWR('i', 127, struct spppauthfailurestats)
|
|
|
|
|
|
|
|
struct spppauthfailuresettings {
|
|
|
|
char ifname[IFNAMSIZ]; /* pppoe interface name */
|
|
|
|
int max_failures; /* max. allowed authorization failures */
|
|
|
|
};
|
|
|
|
#define SPPPSETAUTHFAILURE _IOW('i', 128, struct spppauthfailuresettings)
|