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

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