Home | History | Annotate | Line # | Download | only in net
if_pppoe.h revision 1.8.26.1
      1  1.8.26.1     rmind /* $NetBSD: if_pppoe.h,v 1.8.26.1 2007/03/12 05:59:13 rmind Exp $ */
      2       1.1    martin 
      3       1.3    martin /*-
      4       1.3    martin  * Copyright (c) 2002 The NetBSD Foundation, Inc.
      5       1.3    martin  * All rights reserved.
      6       1.3    martin  *
      7       1.3    martin  * This code is derived from software contributed to The NetBSD Foundation
      8       1.5    keihan  * by Martin Husemann <martin (at) NetBSD.org>.
      9       1.1    martin  *
     10       1.1    martin  * Redistribution and use in source and binary forms, with or without
     11       1.1    martin  * modification, are permitted provided that the following conditions
     12       1.1    martin  * are met:
     13       1.1    martin  * 1. Redistributions of source code must retain the above copyright
     14       1.1    martin  *    notice, this list of conditions and the following disclaimer.
     15       1.1    martin  * 2. Redistributions in binary form must reproduce the above copyright
     16       1.1    martin  *    notice, this list of conditions and the following disclaimer in the
     17       1.1    martin  *    documentation and/or other materials provided with the distribution.
     18       1.3    martin  * 3. All advertising materials mentioning features or use of this software
     19       1.3    martin  *    must display the following acknowledgement:
     20       1.3    martin  *        This product includes software developed by the NetBSD
     21       1.3    martin  *        Foundation, Inc. and its contributors.
     22       1.3    martin  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23       1.3    martin  *    contributors may be used to endorse or promote products derived
     24       1.3    martin  *    from this software without specific prior written permission.
     25       1.1    martin  *
     26       1.3    martin  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27       1.3    martin  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28       1.3    martin  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29       1.3    martin  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30       1.3    martin  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31       1.3    martin  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32       1.3    martin  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33       1.3    martin  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34       1.3    martin  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35       1.3    martin  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36       1.3    martin  * POSSIBILITY OF SUCH DAMAGE.
     37       1.1    martin  */
     38       1.1    martin 
     39       1.8      elad #ifndef _NET_IF_PPPOE_H_
     40       1.8      elad #define _NET_IF_PPPOE_H_
     41       1.8      elad 
     42       1.1    martin struct pppoediscparms {
     43       1.1    martin 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
     44       1.1    martin 	char	eth_ifname[IFNAMSIZ];	/* external ethernet interface name */
     45       1.7  christos 	const char *ac_name;		/* access concentrator name (or NULL) */
     46       1.1    martin 	size_t	ac_name_len;		/* on write: length of buffer for ac_name */
     47       1.7  christos 	const char *service_name;	/* service name (or NULL) */
     48       1.1    martin 	size_t	service_name_len;	/* on write: length of buffer for service name */
     49       1.1    martin };
     50       1.1    martin 
     51       1.1    martin #define	PPPOESETPARMS	_IOW('i', 110, struct pppoediscparms)
     52       1.2    martin #define	PPPOEGETPARMS	_IOWR('i', 111, struct pppoediscparms)
     53       1.2    martin 
     54       1.2    martin #define PPPOE_STATE_INITIAL	0
     55       1.2    martin #define PPPOE_STATE_PADI_SENT	1
     56       1.2    martin #define	PPPOE_STATE_PADR_SENT	2
     57       1.2    martin #define	PPPOE_STATE_SESSION	3
     58       1.2    martin #define	PPPOE_STATE_CLOSING	4
     59       1.4       oki /* passive */
     60       1.4       oki #define	PPPOE_STATE_PADO_SENT	1
     61       1.2    martin 
     62       1.2    martin struct pppoeconnectionstate {
     63       1.2    martin 	char	ifname[IFNAMSIZ];	/* pppoe interface name */
     64       1.2    martin 	u_int	state;			/* one of the PPPOE_STATE_ states above */
     65       1.2    martin 	u_int	session_id;		/* if state == PPPOE_STATE_SESSION */
     66       1.2    martin 	u_int	padi_retry_no;		/* number of retries already sent */
     67       1.2    martin 	u_int	padr_retry_no;
     68       1.2    martin };
     69       1.2    martin 
     70       1.2    martin #define PPPOEGETSESSION	_IOWR('i', 112, struct pppoeconnectionstate)
     71       1.2    martin 
     72       1.1    martin #ifdef _KERNEL
     73       1.1    martin 
     74       1.1    martin extern struct ifqueue ppoediscinq;
     75       1.1    martin extern struct ifqueue ppoeinq;
     76       1.1    martin 
     77       1.1    martin #ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
     78  1.8.26.1     rmind extern void *pppoe_softintr;			/* softinterrupt cookie */
     79       1.1    martin #else
     80       1.1    martin extern struct callout pppoe_softintr;		/* callout (poor mans softint) */
     81       1.1    martin extern void pppoe_softintr_handler(void*);	/* handler function */
     82       1.1    martin #endif
     83       1.1    martin 
     84       1.8      elad #endif /* _KERNEL */
     85       1.8      elad #endif /* !_NET_IF_PPPOE_H_ */
     86       1.1    martin 
     87