home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / src_1218.zip / PPPIPCP.H < prev    next >
C/C++ Source or Header  |  1991-08-06  |  2KB  |  60 lines

  1. #ifndef _PPPIPCP_H
  2. #define _PPPIPCP_H
  3.  
  4. #ifndef _SLHC_H
  5. #include "slhc.h"
  6. #endif
  7.  
  8.                     /* IPCP option types */
  9. #define IPCP_ADDRESS        0x01
  10. #define IPCP_COMPRESS        0x02
  11. #define IPCP_OPTION_LIMIT    0x02    /* highest # we can handle */
  12.  
  13. /* Table for IPCP configuration requests */
  14. struct ipcp_value_s {
  15.     int16 negotiate;        /* negotiation flags */
  16. #define IPCP_N_ADDRESS        (1 << IPCP_ADDRESS)
  17. #define IPCP_N_COMPRESS        (1 << IPCP_COMPRESS)
  18.  
  19.     int32 address;            /* address for this side */
  20.     int32 other;            /* address for other side */
  21.  
  22.     int16 compression;        /* Compression protocol */
  23.     int16 slots;            /* Slots (0-n)*/
  24.     byte_t slot_compress;        /* Slots may be compressed (flag)*/
  25. };
  26.  
  27. #define IPCP_SLOT_DEFAULT    16    /* Default # of slots */
  28. #define IPCP_SLOT_HI        64    /* Maximum # of slots */
  29. #define IPCP_SLOT_LO          1    /* Minimum # of slots */
  30. #define IPCP_SLOT_COMPRESS    0x01    /* May compress slot id */
  31.  
  32. struct ipcp_side_s {
  33.     int16 will_negotiate;
  34.     struct ipcp_value_s want;
  35.     struct ipcp_value_s work;
  36. };
  37.  
  38. /* Store address pool in otherwise unused address locations */
  39. #define peer_min    local.want.other    /* First IP address in pool */
  40. #define peer_max    remote.want.other    /* Last IP address in pool */
  41.  
  42. /* IPCP control block */
  43. struct ipcp_s {
  44.     struct ipcp_side_s local;
  45.     struct ipcp_side_s remote;
  46.  
  47.     struct slcompress *slhcp;    /* pointer to compression block */
  48. };
  49.  
  50. #define IPCP_REQ_TRY    20        /* REQ attempts */
  51. #define IPCP_NAK_TRY    10        /* NAK attempts */
  52. #define IPCP_TERM_TRY    10        /* tries on TERM REQ */
  53. #define IPCP_TIMEOUT    3        /* Seconds to wait for response */
  54.  
  55.  
  56. int doppp_ipcp    __ARGS((int argc, char *argv[], void *p));
  57. void ipcp_init    __ARGS((struct ppp_s *ppp_p));
  58.  
  59. #endif /* _PPPIPCP_H */
  60.