home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / KA9Q212.ZIP / PPPLCP.H < prev    next >
C/C++ Source or Header  |  1993-03-07  |  3KB  |  87 lines

  1. /****************************************************************************
  2. *    $Id: ppplcp.h 1.2 92/08/11 22:44:55 ROOT_DOS Exp Locker: ROOT_DOS $
  3. *    11 Aug 92    1.2        GT    dolcp_open () public.                            *
  4. ****************************************************************************/
  5. #ifndef _PPPLCP_H
  6. #define _PPPLCP_H
  7.  
  8.                     /* LCP option types */
  9. #define LCP_MRU            0x01
  10. #define LCP_ACCM        0x02
  11. #define LCP_AUTHENT        0x03
  12. #define LCP_ENCRYPT        0x04
  13. #define LCP_MAGIC        0x05
  14. #define LCP_QUALITY        0x06
  15. #define LCP_PFC            0x07
  16. #define LCP_ACFC        0x08
  17. #define LCP_OPTION_LIMIT    0x08    /* highest # we can handle */
  18.  
  19. /* Table for LCP configuration requests */
  20. struct lcp_value_s {
  21.     int16 negotiate;        /* negotiation flags */
  22. #define LCP_N_MRU        (1 << LCP_MRU)
  23. #define LCP_N_ACCM        (1 << LCP_ACCM)
  24. #define LCP_N_AUTHENT        (1 << LCP_AUTHENT)
  25. #define LCP_N_ENCRYPT        (1 << LCP_ENCRYPT)
  26. #define LCP_N_MAGIC        (1 << LCP_MAGIC)
  27. #define LCP_N_QUALITY        (1 << LCP_QUALITY)
  28. #define LCP_N_PFC        (1 << LCP_PFC)
  29. #define LCP_N_ACFC        (1 << LCP_ACFC)
  30.  
  31.     int16 mru;            /* Maximum Receive Unit */
  32.     int32 accm;            /* Async Control Char Map */
  33.     int16 authentication;        /* Authentication protocol */
  34.     int16 encryption;        /* Encryption protocol */
  35.     int32 magic_number;        /* Magic number value */
  36.     int32 reporting_period;        /* Link Quality reporting period */
  37. };
  38.  
  39. /* Other configuration option values */
  40. #define LCP_ACCM_DEFAULT    0xffffffffL
  41. #define LCP_MRU_DEFAULT    1500
  42. #define LCP_MRU_HI    4096        /* High MRU limit */
  43. #define LCP_MRU_LO    128        /* Lower MRU limit */
  44.  
  45. /*
  46.  *    local.want:    Options to request.
  47.  *            Contains desired value.
  48.  *            Only non-default options need to be negotiated.
  49.  *            Initially, all are default.
  50.  *    local.will:    Options to accept in a NAK from remote.
  51.  *    local.work:    Options currently being negotiated.
  52.  *            Value is valid only when negotiate bit is set.
  53.  *
  54.  *    remote.want:    Options to suggest by NAK if not present in REQ.
  55.  *            Contains desired value.
  56.  *    remote.will:    Options to accept in a REQ from remote.
  57.  *    remote.work:    Options currently being negotiated.
  58.  *            Value is valid only when negotiate bit is set.
  59.  */
  60.  
  61. struct lcp_side_s {
  62.     int16    will_negotiate;
  63.     struct lcp_value_s want;
  64.     struct lcp_value_s work;
  65. };
  66.  
  67. /* LCP control block */
  68. struct lcp_s {
  69.     struct lcp_side_s local;
  70.     struct lcp_side_s remote;
  71. };
  72.  
  73. #define LCP_REQ_TRY    20        /* REQ attempts */
  74. #define LCP_NAK_TRY    10        /* NAK attempts */
  75. #define LCP_TERM_TRY    10        /* tries on TERM REQ */
  76. #define LCP_TIMEOUT    3        /* Seconds to wait for response */
  77.  
  78.  
  79. int doppp_lcp    __ARGS((int argc, char *argv[], void *p));
  80. int dolcp_open    __ARGS((int argc, char *argv[], void *p));
  81.  
  82. void ppp_ready    __ARGS((struct ppp_s *ppp_p));
  83.  
  84. void lcp_init    __ARGS((struct ppp_s *ppp_p));
  85.  
  86. #endif /* _PPPLCP_H */
  87.