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