home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / SUN / PPP / SUNOS_OL / DDP_PPP.TAR / if_ppp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-03  |  2.4 KB  |  71 lines

  1. /*
  2.  * if_ppp.h - Point-to-Point Protocol definitions.
  3.  *
  4.  * Copyright (c) 1989 Carnegie Mellon University.
  5.  * All rights reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms are permitted
  8.  * provided that the above copyright notice and this paragraph are
  9.  * duplicated in all such forms and that any documentation,
  10.  * advertising materials, and other materials related to such
  11.  * distribution and use acknowledge that the software was developed
  12.  * by Carnegie Mellon University.  The name of the
  13.  * University may not be used to endorse or promote products derived
  14.  * from this software without specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  */
  19.  
  20. /*
  21.  * Standard PPP header.
  22.  */
  23. struct ppp_header {
  24.     u_char    ph_address;    /* Address Field */
  25.     u_char    ph_control;    /* Control Field */
  26.     u_short    ph_protocol;    /* Protocol Field */
  27. };
  28.  
  29. #define    PPP_ALLSTATIONS    0xff    /* All-Stations broadcast address */
  30. #define    PPP_UI        0x03    /* Unnumbered Information */
  31. #define    PPP_FLAG    0x7e    /* Flag Sequence */
  32. #define    PPP_ESCAPE    0x7d    /* Asynchronous Control Escape */
  33. #define    PPP_TRANS    0x20    /* Asynchronous transparency modifier */
  34.  
  35. /*
  36.  * Protocol types.
  37.  */
  38. #define PPP_IP        0x21    /* Internet Protocol */
  39. #define    PPP_XNS        0x25    /* Xerox NS */
  40.  
  41. /*
  42.  * Important FCS values.
  43.  */
  44. #define PPP_INITFCS    0xffff    /* Initial FCS value */
  45. #define PPP_GOODFCS    0xf0b8    /* Good final FCS value */
  46. #define PPP_FCS(fcs, c)    (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
  47.  
  48. #define    PPP_MTU        1500    /* Default MTU (size of Info field) */
  49. #define    PPP_HIWAT    1000    /* Don't start a new packet if HIWAT on queue */
  50. #define    CLISTRESERVE    1000    /* Can't let clists get too low */
  51.  
  52.  
  53. struct ppp_softc {
  54.     struct ifnet sc_if;    /* network-visible interface */
  55.     short    sc_flags;    /* see below */
  56.     short    sc_ilen;    /* length of input-packet-so-far */
  57.     struct    tty *sc_ttyp;    /* pointer to tty structure */
  58.     struct    mbuf *sc_m;    /* pointer to input mbuf chain */
  59.     struct    mbuf *sc_mc;    /* pointer to current input mbuf */
  60.     char    *sc_mp;        /* pointer to next char in input mbuf */
  61.     u_short    sc_fcs;        /* FCS so far */
  62.     u_long    sc_asyncmap;    /* async control character map */
  63.     struct    ifqueue sc_inq;    /* TTY side input queue */
  64. };
  65.  
  66. /* flags */
  67. #define    SC_ESCAPED    0x0001    /* saw a PPP_ESCAPE */
  68. #define    SC_FLUSH    0x0002    /* flush input until next PPP_FLAG */
  69.  
  70. #define t_sc T_LINEP
  71.