Home | History | Annotate | Line # | Download | only in net
if_ppp.h revision 1.1
      1  1.1  deraadt /*
      2  1.1  deraadt  * if_ppp.h - Point-to-Point Protocol definitions.
      3  1.1  deraadt  *
      4  1.1  deraadt  * Copyright (c) 1989 Carnegie Mellon University.
      5  1.1  deraadt  * All rights reserved.
      6  1.1  deraadt  *
      7  1.1  deraadt  * Redistribution and use in source and binary forms are permitted
      8  1.1  deraadt  * provided that the above copyright notice and this paragraph are
      9  1.1  deraadt  * duplicated in all such forms and that any documentation,
     10  1.1  deraadt  * advertising materials, and other materials related to such
     11  1.1  deraadt  * distribution and use acknowledge that the software was developed
     12  1.1  deraadt  * by Carnegie Mellon University.  The name of the
     13  1.1  deraadt  * University may not be used to endorse or promote products derived
     14  1.1  deraadt  * from this software without specific prior written permission.
     15  1.1  deraadt  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
     16  1.1  deraadt  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
     17  1.1  deraadt  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
     18  1.1  deraadt  *
     19  1.1  deraadt  * Modified by Paul Mackerras (paulus (at) cs.anu.edu.au)
     20  1.1  deraadt  * PPP_MRU added, PPP_MTU changed to 296 (default only), added sc_outm.
     21  1.1  deraadt  *
     22  1.1  deraadt  *	$Id: if_ppp.h,v 1.1 1993/08/14 06:38:38 deraadt Exp $
     23  1.1  deraadt  */
     24  1.1  deraadt 
     25  1.1  deraadt /* Portions Copyright (C) 1990 Brad K. Clements (streams support)
     26  1.1  deraadt  *   (huh?  there isn't any streams support in this file)
     27  1.1  deraadt  */
     28  1.1  deraadt 
     29  1.1  deraadt /*
     30  1.1  deraadt  * Standard PPP header.
     31  1.1  deraadt  */
     32  1.1  deraadt struct ppp_header {
     33  1.1  deraadt 	u_char	ph_address;	/* Address Field */
     34  1.1  deraadt 	u_char	ph_control;	/* Control Field */
     35  1.1  deraadt 	u_short	ph_protocol;	/* Protocol Field */
     36  1.1  deraadt };
     37  1.1  deraadt 
     38  1.1  deraadt #define	PPP_ALLSTATIONS	0xff	/* All-Stations broadcast address */
     39  1.1  deraadt #define	PPP_UI		0x03	/* Unnumbered Information */
     40  1.1  deraadt #define	PPP_FLAG	0x7e	/* Flag Sequence */
     41  1.1  deraadt #define	PPP_ESCAPE	0x7d	/* Asynchronous Control Escape */
     42  1.1  deraadt #define	PPP_TRANS	0x20	/* Asynchronous transparency modifier */
     43  1.1  deraadt 
     44  1.1  deraadt /*
     45  1.1  deraadt  * Protocol types.
     46  1.1  deraadt  */
     47  1.1  deraadt #define PPP_IP		0x21	/* Internet Protocol */
     48  1.1  deraadt #define	PPP_XNS		0x25	/* Xerox NS */
     49  1.1  deraadt #define	PPP_VJC_COMP	0x2d	/* VJ compressed TCP */
     50  1.1  deraadt #define	PPP_VJC_UNCOMP	0x2f	/* VJ uncompressed TCP */
     51  1.1  deraadt #define PPP_LCP		0xc021	/* Link Control Protocol */
     52  1.1  deraadt 
     53  1.1  deraadt /*
     54  1.1  deraadt  * Important FCS values.
     55  1.1  deraadt  */
     56  1.1  deraadt #define PPP_INITFCS	0xffff	/* Initial FCS value */
     57  1.1  deraadt #define PPP_GOODFCS	0xf0b8	/* Good final FCS value */
     58  1.1  deraadt #define PPP_FCS(fcs, c)	(((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
     59  1.1  deraadt 
     60  1.1  deraadt #define	PPP_MTU		296	/* Default MTU (size of Info field) */
     61  1.1  deraadt #define PPP_MRU		1500	/* Default MRU (max receive unit) */
     62  1.1  deraadt #define	PPP_HIWAT	400	/* Don't start a new packet if HIWAT on que */
     63  1.1  deraadt 
     64  1.1  deraadt struct ppp_softc {
     65  1.1  deraadt 	struct ifnet sc_if;	/* network-visible interface */
     66  1.1  deraadt 	u_int	sc_flags;	/* see below */
     67  1.1  deraadt 	struct	tty *sc_ttyp;	/* pointer to tty structure */
     68  1.1  deraadt 	struct	mbuf *sc_outm;	/* mbuf chain being output currently */
     69  1.1  deraadt 	struct	mbuf *sc_m;	/* pointer to input mbuf chain */
     70  1.1  deraadt 	struct	mbuf *sc_mc;	/* pointer to current input mbuf */
     71  1.1  deraadt 	char	*sc_mp;		/* pointer to next char in input mbuf */
     72  1.1  deraadt 	short	sc_ilen;	/* length of input-packet-so-far */
     73  1.1  deraadt 	u_short	sc_fcs;		/* FCS so far */
     74  1.1  deraadt 	u_long	sc_asyncmap;	/* async control character map */
     75  1.1  deraadt 	struct	ifqueue sc_inq;	/* TTY side input queue */
     76  1.1  deraadt #ifdef	VJC
     77  1.1  deraadt 	struct	slcompress sc_comp; /* vjc control buffer */
     78  1.1  deraadt #endif
     79  1.1  deraadt 	u_int	sc_bytessent;
     80  1.1  deraadt 	u_int	sc_bytesrcvd;
     81  1.1  deraadt };
     82  1.1  deraadt 
     83  1.1  deraadt /* flags */
     84  1.1  deraadt #define	SC_ESCAPED	0x00010000	/* saw a PPP_ESCAPE */
     85  1.1  deraadt #define	SC_FLUSH	0x00020000	/* flush input until next PPP_FLAG */
     86  1.1  deraadt #define SC_COMP_PROT	0x00000001	/* protocol compression */
     87  1.1  deraadt #define SC_COMP_AC	0x00000002	/* header compression */
     88  1.1  deraadt #define	SC_COMP_TCP	0x00000004	/* TCP traffic (VJ) compression */
     89  1.1  deraadt 
     90  1.1  deraadt #define t_sc T_LINEP
     91  1.1  deraadt 
     92  1.1  deraadt /* this stuff doesn't belong here... */
     93  1.1  deraadt #define	PPPIOCGFLAGS	_IOR('t', 90, int)	/* get configuration flags */
     94  1.1  deraadt #define	PPPIOCSFLAGS	_IOW('t', 89, int)	/* set configuration flags */
     95  1.1  deraadt #define	PPPIOCGASYNCMAP	_IOR('t', 88, int)	/* get async map */
     96  1.1  deraadt #define	PPPIOCSASYNCMAP	_IOW('t', 87, int)	/* set async map */
     97  1.1  deraadt #define	PPPIOCGUNIT	_IOR('t', 86, int)	/* get ppp unit number */
     98  1.1  deraadt 
     99  1.1  deraadt /* old copies of PPP may have defined this */
    100  1.1  deraadt #if !defined(ifr_mtu)
    101  1.1  deraadt #define ifr_mtu	ifr_metric
    102  1.1  deraadt #endif
    103  1.1  deraadt 
    104