Home | History | Annotate | Line # | Download | only in net
if_slvar.h revision 1.24
      1 /*	$NetBSD: if_slvar.h,v 1.24 2001/06/14 05:44:24 itojun Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 1991, 1993
      5  *	The Regents of the University of California.  All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed by the University of
     18  *	California, Berkeley and its contributors.
     19  * 4. Neither the name of the University nor the names of its contributors
     20  *    may be used to endorse or promote products derived from this software
     21  *    without specific prior written permission.
     22  *
     23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33  * SUCH DAMAGE.
     34  *
     35  *	@(#)if_slvar.h	8.4 (Berkeley) 1/9/95
     36  */
     37 
     38 #ifndef _NET_IF_SLVAR_H_
     39 #define _NET_IF_SLVAR_H_
     40 
     41 /*
     42  * Definitions for SLIP interface data structures
     43  *
     44  * (This exists so programs like slstats can get at the definition
     45  *  of sl_softc.)
     46  */
     47 struct sl_softc {
     48 	struct	ifnet sc_if;		/* network-visible interface */
     49 	int	sc_unit;		/* XXX unit number */
     50 	struct	ifqueue sc_fastq;	/* interactive output queue */
     51 	struct	ifqueue sc_inq;		/* input queue */
     52 	struct	tty *sc_ttyp;		/* pointer to tty structure */
     53 	u_char	*sc_mp;			/* pointer to next available buf char */
     54 	u_char	*sc_ep;			/* pointer to last available buf char */
     55 	u_char	*sc_pktstart;		/* pointer to beginning of packet */
     56 	struct mbuf *sc_mbuf;		/* input buffer */
     57 	u_int	sc_flags;		/* see below */
     58 	u_int	sc_escape;	/* =1 if last char input was FRAME_ESCAPE */
     59 	long	sc_lasttime;		/* last time a char arrived */
     60 	long	sc_abortcount;		/* number of abort esacpe chars */
     61 	long	sc_starttime;		/* time of first abort in window */
     62 	long	sc_oqlen;		/* previous output queue size */
     63 	long	sc_otimeout;		/* number of times output's stalled */
     64 #ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
     65 	void	*sc_si;			/* softintr handle */
     66 #endif
     67 #ifdef __NetBSD__
     68 	int	sc_oldbufsize;		/* previous output buffer size */
     69 	int	sc_oldbufquot;		/* previous output buffer quoting */
     70 #endif
     71 #ifdef INET				/* XXX */
     72 	struct	slcompress sc_comp;	/* tcp compression data */
     73 #endif
     74 	struct timeval sc_lastpacket;	/* for watchdog */
     75 };
     76 
     77 /* internal flags */
     78 #define	SC_ERROR	0x0001		/* had an input error */
     79 
     80 /* visible flags */
     81 #define	SC_COMPRESS	IFF_LINK0	/* compress TCP traffic */
     82 #define	SC_NOICMP	IFF_LINK1	/* supress ICMP traffic */
     83 #define	SC_AUTOCOMP	IFF_LINK2	/* auto-enable TCP compression */
     84 
     85 #ifdef _KERNEL
     86 void	slattach __P((void));
     87 void	slclose __P((struct tty *));
     88 void	slinput __P((int, struct tty *));
     89 int	slioctl __P((struct ifnet *, u_long, caddr_t));
     90 int	slopen __P((dev_t, struct tty *));
     91 int	sloutput __P((struct ifnet *,
     92 	    struct mbuf *, struct sockaddr *, struct rtentry *));
     93 void	slstart __P((struct tty *));
     94 int	sltioctl __P((struct tty *, u_long, caddr_t, int));
     95 #endif /* _KERNEL */
     96 
     97 #endif /* _NET_IF_SLVAR_H_ */
     98