options.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:5k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* options.h - PPP option processing header */
  2. /* Copyright 1995 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01b,16jun95,dzb  moved in options flags and PPP_OPTIONS from pppd.h.
  7.                  made options flags into shift value macros and shifted macros.
  8.  removed usehostname option.
  9. 01a,19jan95,dzb  written.
  10. */
  11. #ifndef __INCoptionsh
  12. #define __INCoptionsh
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /* options flags */
  17. #define PPP_S_NO_ALL              0 /* Don't allow any options */
  18. #define PPP_S_PASSIVE_MODE        1 /* Set passive mode */
  19. #define PPP_S_SILENT_MODE         2 /* Set silent mode */
  20. #define PPP_S_DEFAULTROUTE        3 /* Add default route */
  21. #define PPP_S_PROXYARP            4 /* Add proxy ARP entry */
  22. #define PPP_S_IPCP_ACCEPT_LOCAL   5 /* Acpt peer's IP addr for us */
  23. #define PPP_S_IPCP_ACCEPT_REMOTE  6 /* Acpt peer's IP addr for it */
  24. #define PPP_S_NO_IP               7 /* Disable IP addr negot. */
  25. #define PPP_S_NO_ACC              8 /* Disable addr/control compr */
  26. #define PPP_S_NO_PC               9 /* Disable proto field compr */
  27. #define PPP_S_NO_VJ               10 /* Disable VJ compression */
  28. #define PPP_S_NO_VJCCOMP          11 /* Disable VJ conct-ID compr */
  29. #define PPP_S_NO_ASYNCMAP         12 /* Disable async map negot. */
  30. #define PPP_S_NO_MN               13 /* Disable magic num negot. */
  31. #define PPP_S_NO_MRU              14 /* Disable MRU negotiation */
  32. #define PPP_S_NO_PAP              15 /* Don't allow PAP auth */
  33. #define PPP_S_NO_CHAP             16 /* Don't allow CHAP auth */
  34. #define PPP_S_REQUIRE_PAP         17 /* Require PAP auth */
  35. #define PPP_S_REQUIRE_CHAP        18 /* Require CHAP auth */
  36. #define PPP_S_LOGIN               19 /* Use login dbase for PAP */
  37. #define PPP_S_DEBUG               20 /* Enable daemon debug mode */
  38. #define PPP_S_DRIVER_DEBUG        21 /* Enable driver debug mode */
  39. /* PPP options flag bitfield values */
  40. #define OPT_NO_ALL (1 << PPP_S_NO_ALL)
  41. #define OPT_PASSIVE_MODE (1 << PPP_S_PASSIVE_MODE)
  42. #define OPT_SILENT_MODE (1 << PPP_S_SILENT_MODE)
  43. #define OPT_DEFAULTROUTE (1 << PPP_S_DEFAULTROUTE)
  44. #define OPT_PROXYARP (1 << PPP_S_PROXYARP)
  45. #define OPT_IPCP_ACCEPT_LOCAL (1 << PPP_S_IPCP_ACCEPT_LOCAL)
  46. #define OPT_IPCP_ACCEPT_REMOTE (1 << PPP_S_IPCP_ACCEPT_REMOTE)
  47. #define OPT_NO_IP (1 << PPP_S_NO_IP)
  48. #define OPT_NO_ACC (1 << PPP_S_NO_ACC)
  49. #define OPT_NO_PC (1 << PPP_S_NO_PC)
  50. #define OPT_NO_VJ (1 << PPP_S_NO_VJ)
  51. #define OPT_NO_VJCCOMP (1 << PPP_S_NO_VJCCOMP)
  52. #define OPT_NO_ASYNCMAP (1 << PPP_S_NO_ASYNCMAP)
  53. #define OPT_NO_MN (1 << PPP_S_NO_MN)
  54. #define OPT_NO_MRU (1 << PPP_S_NO_MRU)
  55. #define OPT_NO_PAP (1 << PPP_S_NO_PAP)
  56. #define OPT_NO_CHAP (1 << PPP_S_NO_CHAP)
  57. #define OPT_REQUIRE_PAP (1 << PPP_S_REQUIRE_PAP)
  58. #define OPT_REQUIRE_CHAP (1 << PPP_S_REQUIRE_CHAP)
  59. #define OPT_LOGIN (1 << PPP_S_LOGIN)
  60. #define OPT_DEBUG (1 << PPP_S_DEBUG)
  61. #define OPT_DRIVER_DEBUG (1 << PPP_S_DRIVER_DEBUG)
  62. /* PPP configuration options */
  63. typedef struct ppp_options
  64.     {
  65.     int flags; /* Flag options */
  66.     char *asyncmap; /* Set the desired async map */
  67.     char *escape_chars; /* Set chars to escape on transmission */
  68.     char *vj_max_slots; /* Set maximum VJ compression header slots */
  69.     char *netmask; /* Set netmask value for negotiation */
  70.     char *mru; /* Set MRU value for negotiation */
  71.     char *mtu; /* Set MTU value for negotiation */
  72.     char *lcp_echo_failure; /* Set max # consecutive LCP echo failures */
  73.     char *lcp_echo_interval; /* Set time for LCP echo requests */
  74.     char *lcp_restart; /* Set timeout for LCP */
  75.     char *lcp_max_terminate; /* Set max # xmits for LCP term-reqs */
  76.     char *lcp_max_configure; /* Set max # xmits for LCP conf-reqs */
  77.     char *lcp_max_failure; /* Set max # conf-naks for LCP */
  78.     char *ipcp_restart; /* Set timeout for IPCP */
  79.     char *ipcp_max_terminate; /* Set max # xmits for IPCP term-reqs */
  80.     char *ipcp_max_configure; /* Set max # xmits for IPCP conf-reqs */
  81.     char *ipcp_max_failure; /* Set max # conf-naks for IPCP */
  82.     char *local_auth_name; /* Set local name for authentication */
  83.     char *remote_auth_name; /* Set remote name for authentication */
  84.     char *pap_file; /* Set the PAP secrets file */
  85.     char *pap_user_name; /* Set username for PAP auth with peer */
  86.     char *pap_passwd; /* Set password for PAP auth with peer */
  87.     char *pap_restart; /* Set timeout for PAP */
  88.     char *pap_max_authreq; /* Set max # xmits for PAP auth-reqs */
  89.     char *chap_file; /* Set the CHAP secrets file */
  90.     char *chap_restart; /* Set timeout for CHAP */
  91.     char *chap_interval; /* Set interval for CHAP rechallenge */
  92.     char *chap_max_challenge; /* Set max # xmits for CHAP challenge */
  93.     } PPP_OPTIONS;
  94. /* function declarations */
  95.  
  96. #if defined(__STDC__) || defined(__cplusplus)
  97.   
  98. extern int parse_args (int unit, char *devname, char *local_addr,
  99.                     char *remote_addr, int baud, PPP_OPTIONS *options,
  100.                     char *fileName);
  101. extern int options_from_file (char *fileName, int must_exist,
  102.                     int check_prot);
  103. extern int getword (FILE *f, char *word, int *newlinep, char *fileName);
  104. extern int setdevname (char *cp);
  105. extern int setipaddr (char *local_addr, char *remote_addr);
  106. extern void setipdefault (void);
  107. extern u_long GetMask (u_long addr);
  108. #else /* __STDC__ */
  109. extern int parse_args ();
  110. extern int options_from_file ();
  111. extern int getword ();
  112. extern int setdevname ();
  113. extern int setipaddr ();
  114. extern void setipdefault ();
  115. extern u_long GetMask ();
  116. #endif /* __STDC__ */
  117. #ifdef __cplusplus
  118. }
  119. #endif
  120. #endif /* __INCoptionsh */