home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 024 / psi110g.zip / PPP.H < prev    next >
C/C++ Source or Header  |  1994-04-17  |  3KB  |  81 lines

  1. #ifndef _PPP_H
  2. #define _PPP_H
  3. /*
  4.  *  This implementation of PPP is declared to be in the public domain.
  5.  *
  6.  *  Jan 91  Bill_Simpson@um.cc.umich.edu
  7.  *      Computer Systems Consulting Services
  8.  *
  9.  *  Acknowledgements and correction history may be found in PPP.C
  10.  */
  11.   
  12. #ifndef _GLOBAL_H
  13. #include "global.h"
  14. #endif
  15.   
  16. #ifndef _MBUF_H
  17. #include "mbuf.h"
  18. #endif
  19.   
  20. #ifndef _IFACE_H
  21. #include "iface.h"
  22. #endif
  23.   
  24.   
  25. /* PPP definitions */
  26. #define PPP_ALLOC   128 /* mbuf allocation increment */
  27.   
  28.   
  29. struct ppp_hdr {
  30.     byte_t addr;
  31. #define HDLC_ALL_ADDR       0xff    /* HDLC all-station */
  32.     byte_t control;
  33. #define HDLC_UI         0x03    /* HDLC Unnumbered Information */
  34.     int16 protocol;
  35. #define PPP_IP_PROTOCOL     0x0021  /* Internet Protocol */
  36. #define PPP_COMPR_PROTOCOL  0x002d  /* Van Jacobson Compressed TCP/IP */
  37. #define PPP_UNCOMP_PROTOCOL 0x002f  /* Van Jacobson Uncompressed TCP/IP */
  38. #define PPP_IPCP_PROTOCOL   0x8021  /* Internet Protocol Control Protocol */
  39. #define PPP_LCP_PROTOCOL    0xc021  /* Link Control Protocol */
  40. #define PPP_PAP_PROTOCOL    0xc023  /* Password Authentication Protocol */
  41. };
  42. #define PPP_HDR_LEN 4   /* Max bytes for PPP/HDLC envelope header */
  43.   
  44. /* HDLC envelope constants */
  45. #define HDLC_ENVLEN 8   /* Max bytes for HDLC envelope (outgoing) */
  46.   
  47. #define HDLC_FLAG   0x7e    /* HDLC async start/stop flag */
  48. #define HDLC_ESC_ASYNC  0x7d    /* HDLC transparency escape flag for async */
  49. #define HDLC_ESC_COMPL  0x20    /* HDLC transparency bit complement mask */
  50.   
  51. #define HDLC_FCS_START  0xffff  /* Starting bit string for FCS calculation */
  52. #define HDLC_FCS_FINAL  0xf0b8  /* FCS when summed over frame and sender FCS */
  53.   
  54.   
  55. /* In ppp.c: */
  56. int ppp_send __ARGS((struct mbuf *data,struct iface *iface,int32 gateway,
  57. int prec,int del,int tput,int rel));
  58. int ppp_output __ARGS((struct iface *iface, char dest[], char source[],
  59. int16 type, struct mbuf *data));
  60.   
  61. int ppp_init __ARGS((struct iface *iface));
  62. int ppp_free __ARGS((struct iface *iface));
  63. void ppp_proc __ARGS((struct iface *iface, struct mbuf *bp));
  64.   
  65. /* In pppcmd.c */
  66. extern int PPPtrace;        /* trace flag */
  67. extern struct iface *PPPiface;  /* iface for trace */
  68.   
  69. void ppp_show       __ARGS((struct iface *ifp));
  70.   
  71. int doppp_commands  __ARGS((int argc,char *argv[], void *p));
  72.   
  73. int doppp_active    __ARGS((int argc, char *argv[], void *p));
  74. int doppp_passive   __ARGS((int argc, char *argv[], void *p));
  75.   
  76. int doppp_close     __ARGS((int argc, char *argv[], void *p));
  77. int doppp_timeout   __ARGS((int argc, char *argv[], void *p));
  78. int doppp_try       __ARGS((int argc, char *argv[], void *p));
  79.   
  80. #endif  /* _PPP_H */
  81.