home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 3 / hamradioversion3.0examsandprograms1992.iso / packet / n17jsrc / ppp.h < prev    next >
C/C++ Source or Header  |  1991-06-06  |  3KB  |  89 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. /*#define PPP_DEBUG_RAW*/
  25. /*#define PPP_DEBUG_OPTIONS       0x08*/
  26. #define PPP_DEBUG_CHECKS(x)     /*if(PPPtrace & 0x40) log(-1,x);*/
  27. #define PPP_DEBUG_ROUTINES(x)   /*if(PPPtrace & 0x80) log(-1,x);*/
  28.  
  29.  
  30. /* PPP definitions */
  31. #define    PPP_ALLOC    128    /* mbuf allocation increment */
  32.  
  33.  
  34. struct ppp_hdr {
  35.     byte_t addr;
  36. #define HDLC_ALL_ADDR        0xff    /* HDLC all-station */
  37.     byte_t control;
  38. #define HDLC_UI            0x03    /* HDLC Unnumbered Information */
  39.     int16 protocol;
  40. #define PPP_IP_PROTOCOL        0x0021    /* Internet Protocol */
  41. #define PPP_COMPR_PROTOCOL    0x002d    /* Van Jacobson Compressed TCP/IP */
  42. #define PPP_UNCOMP_PROTOCOL    0x002f    /* Van Jacobson Uncompressed TCP/IP */
  43. #define PPP_IPCP_PROTOCOL    0x8021    /* Internet Protocol Control Protocol */
  44. #define PPP_LCP_PROTOCOL    0xc021    /* Link Control Protocol */
  45. #define PPP_PAP_PROTOCOL    0xc023    /* Password Authentication Protocol */
  46. };
  47. #define PPP_HDR_LEN    4    /* Max bytes for PPP/HDLC envelope header */
  48.  
  49. /* HDLC envelope constants */
  50. #define HDLC_ENVLEN    0x06    /* Max bytes for HDLC envelope (outgoing) */
  51.  
  52. #define HDLC_FLAG    0x7e    /* HDLC async start/stop flag */
  53. #define HDLC_ESC_ASYNC    0x7d    /* HDLC transparency escape flag for async */
  54. #define HDLC_ESC_COMPL    0x20    /* HDLC transparency bit complement mask */
  55.  
  56. #define HDLC_FCS_START    0xffff    /* Starting bit string for FCS calculation */
  57. #define HDLC_FCS_FINAL    0xf0b8    /* FCS when summed over frame and sender FCS */
  58.  
  59.  
  60. /* In ppp.c: */
  61. int ntohppp __ARGS((struct ppp_hdr *ppp, struct mbuf **bpp));
  62.  
  63. int ppp_send __ARGS((struct mbuf *data,struct iface *iface,int32 gateway,
  64.     int prec,int del,int tput,int rel));
  65. int ppp_output __ARGS((struct iface *iface, char dest[], char source[],
  66.     int16 type, struct mbuf *data));
  67.  
  68. int ppp_init __ARGS((struct iface *iface));
  69. int ppp_free __ARGS((struct iface *iface));
  70. void ppp_proc __ARGS((struct iface *iface, struct mbuf *bp));
  71.  
  72. /* In pppcmd.c */
  73. extern int PPPtrace;        /* trace flag */
  74.  
  75. int ppp_discard     __ARGS((struct iface *ifp, struct mbuf *bp));
  76. int ppp_echo        __ARGS((struct iface *ifp, struct mbuf *bp));
  77. int ppp_status        __ARGS((struct iface *ifp));
  78.  
  79. int doppp_commands    __ARGS((int argc,char *argv[], void *p));
  80.  
  81. int doppp_active    __ARGS((int argc, char *argv[], void *p));
  82. int doppp_passive    __ARGS((int argc, char *argv[], void *p));
  83.  
  84. int doppp_close        __ARGS((int argc, char *argv[], void *p));
  85. int doppp_timeout    __ARGS((int argc, char *argv[], void *p));
  86. int doppp_try        __ARGS((int argc, char *argv[], void *p));
  87.  
  88. #endif    /* _PPP_H */
  89.