Home | History | Annotate | Line # | Download | only in net
if_pppvar.h revision 1.6
      1  1.6  christos /*	$NetBSD: if_pppvar.h,v 1.6 1997/03/12 20:26:54 christos Exp $	*/
      2  1.6  christos /*	Id: if_pppvar.h,v 1.3 1996/07/01 01:04:37 paulus Exp	 */
      3  1.6  christos 
      4  1.1    paulus /*
      5  1.1    paulus  * if_pppvar.h - private structures and declarations for PPP.
      6  1.1    paulus  *
      7  1.1    paulus  * Copyright (c) 1994 The Australian National University.
      8  1.1    paulus  * All rights reserved.
      9  1.1    paulus  *
     10  1.1    paulus  * Permission to use, copy, modify, and distribute this software and its
     11  1.1    paulus  * documentation is hereby granted, provided that the above copyright
     12  1.1    paulus  * notice appears in all copies.  This software is provided without any
     13  1.1    paulus  * warranty, express or implied. The Australian National University
     14  1.1    paulus  * makes no representations about the suitability of this software for
     15  1.1    paulus  * any purpose.
     16  1.1    paulus  *
     17  1.1    paulus  * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
     18  1.1    paulus  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
     19  1.1    paulus  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
     20  1.1    paulus  * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
     21  1.1    paulus  * OF SUCH DAMAGE.
     22  1.1    paulus  *
     23  1.1    paulus  * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
     24  1.1    paulus  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
     25  1.1    paulus  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
     26  1.1    paulus  * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
     27  1.1    paulus  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
     28  1.1    paulus  * OR MODIFICATIONS.
     29  1.1    paulus  *
     30  1.1    paulus  * Copyright (c) 1989 Carnegie Mellon University.
     31  1.1    paulus  * All rights reserved.
     32  1.1    paulus  *
     33  1.1    paulus  * Redistribution and use in source and binary forms are permitted
     34  1.1    paulus  * provided that the above copyright notice and this paragraph are
     35  1.1    paulus  * duplicated in all such forms and that any documentation,
     36  1.1    paulus  * advertising materials, and other materials related to such
     37  1.1    paulus  * distribution and use acknowledge that the software was developed
     38  1.1    paulus  * by Carnegie Mellon University.  The name of the
     39  1.1    paulus  * University may not be used to endorse or promote products derived
     40  1.1    paulus  * from this software without specific prior written permission.
     41  1.1    paulus  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
     42  1.1    paulus  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
     43  1.1    paulus  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
     44  1.1    paulus  */
     45  1.1    paulus 
     46  1.1    paulus /*
     47  1.1    paulus  * Supported network protocols.  These values are used for
     48  1.1    paulus  * indexing sc_npmode.
     49  1.1    paulus  */
     50  1.1    paulus #define NP_IP	0		/* Internet Protocol */
     51  1.1    paulus #define NUM_NP	1		/* Number of NPs. */
     52  1.1    paulus 
     53  1.1    paulus /*
     54  1.1    paulus  * Structure describing each ppp unit.
     55  1.1    paulus  */
     56  1.1    paulus struct ppp_softc {
     57  1.1    paulus 	struct	ifnet sc_if;		/* network-visible interface */
     58  1.4   thorpej 	int	sc_unit;		/* XXX unit number */
     59  1.1    paulus 	u_int	sc_flags;		/* control/status bits; see if_ppp.h */
     60  1.1    paulus 	void	*sc_devp;		/* pointer to device-dep structure */
     61  1.1    paulus 	void	(*sc_start) __P((struct ppp_softc *));	/* start output proc */
     62  1.1    paulus 	void	(*sc_ctlp) __P((struct ppp_softc *)); /* rcvd control pkt */
     63  1.1    paulus 	void	(*sc_relinq) __P((struct ppp_softc *)); /* relinquish ifunit */
     64  1.1    paulus 	u_int16_t sc_mru;		/* max receive unit */
     65  1.1    paulus 	pid_t	sc_xfer;		/* used in transferring unit */
     66  1.1    paulus 	struct	ifqueue sc_rawq;	/* received packets */
     67  1.1    paulus 	struct	ifqueue sc_inq;		/* queue of input packets for daemon */
     68  1.1    paulus 	struct	ifqueue sc_fastq;	/* interactive output packet q */
     69  1.1    paulus 	struct	mbuf *sc_togo;		/* output packet ready to go */
     70  1.1    paulus 	struct	mbuf *sc_npqueue;	/* output packets not to be sent yet */
     71  1.1    paulus 	struct	mbuf **sc_npqtail;	/* ptr to last next ptr in npqueue */
     72  1.3    paulus 	struct	pppstat sc_stats;	/* count of bytes/pkts sent/rcvd */
     73  1.1    paulus 	caddr_t	sc_bpf;			/* hook for BPF */
     74  1.1    paulus 	enum	NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
     75  1.1    paulus 	struct	compressor *sc_xcomp;	/* transmit compressor */
     76  1.1    paulus 	void	*sc_xc_state;		/* transmit compressor state */
     77  1.1    paulus 	struct	compressor *sc_rcomp;	/* receive decompressor */
     78  1.1    paulus 	void	*sc_rc_state;		/* receive decompressor state */
     79  1.1    paulus 	time_t	sc_last_sent;		/* time (secs) last NP pkt sent */
     80  1.1    paulus 	time_t	sc_last_recv;		/* time (secs) last NP pkt rcvd */
     81  1.6  christos #ifdef PPP_FILTER
     82  1.3    paulus 	struct	bpf_program sc_pass_filt;   /* filter for packets to pass */
     83  1.3    paulus 	struct	bpf_program sc_active_filt; /* filter for "non-idle" packets */
     84  1.6  christos #endif /* PPP_FILTER */
     85  1.3    paulus #ifdef	VJC
     86  1.3    paulus 	struct	slcompress *sc_comp; 	/* vjc control buffer */
     87  1.3    paulus #endif
     88  1.6  christos 
     89  1.1    paulus 	/* Device-dependent part for async lines. */
     90  1.1    paulus 	ext_accm sc_asyncmap;		/* async control character map */
     91  1.1    paulus 	u_int32_t sc_rasyncmap;		/* receive async control char map */
     92  1.1    paulus 	struct	mbuf *sc_outm;		/* mbuf chain currently being output */
     93  1.1    paulus 	struct	mbuf *sc_m;		/* pointer to input mbuf chain */
     94  1.1    paulus 	struct	mbuf *sc_mc;		/* pointer to current input mbuf */
     95  1.1    paulus 	char	*sc_mp;			/* ptr to next char in input mbuf */
     96  1.1    paulus 	u_int16_t sc_ilen;		/* length of input packet so far */
     97  1.1    paulus 	u_int16_t sc_fcs;		/* FCS so far (input) */
     98  1.1    paulus 	u_int16_t sc_outfcs;		/* FCS so far for output packet */
     99  1.1    paulus 	u_char	sc_rawin[16];		/* chars as received */
    100  1.1    paulus 	int	sc_rawin_count;		/* # in sc_rawin */
    101  1.1    paulus };
    102  1.1    paulus 
    103  1.5     mikel #ifdef _KERNEL
    104  1.1    paulus struct	ppp_softc ppp_softc[NPPP];
    105  1.1    paulus 
    106  1.1    paulus struct	ppp_softc *pppalloc __P((pid_t pid));
    107  1.1    paulus void	pppdealloc __P((struct ppp_softc *sc));
    108  1.2    briggs int	pppioctl __P((struct ppp_softc *sc, u_long cmd, caddr_t data,
    109  1.1    paulus 		      int flag, struct proc *p));
    110  1.6  christos void	ppp_restart __P((struct ppp_softc *sc));
    111  1.1    paulus void	ppppktin __P((struct ppp_softc *sc, struct mbuf *m, int lost));
    112  1.1    paulus struct	mbuf *ppp_dequeue __P((struct ppp_softc *sc));
    113  1.5     mikel #endif /* _KERNEL */
    114