options.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * $Id: options.h,v 1.1 2004/11/14 07:26:26 paulus Exp $
  3. *
  4. * Copyright (C) 1996 Lars Fenneberg
  5. *
  6. * See the file COPYRIGHT for the respective terms and conditions.
  7. * If the file is missing contact me at lf@elemental.net
  8. * and I'll send you a copy.
  9. *
  10. */
  11. #define OPTION_LEN 64
  12. /* ids for different option types */
  13. #define OT_STR (1<<0) /* string */
  14. #define OT_INT (1<<1) /* integer */
  15. #define OT_SRV (1<<2) /* server list */
  16. #define OT_AUO (1<<3) /* authentication order */
  17. #define OT_ANY ((unsigned int)~0) /* used internally */
  18. /* status types */
  19. #define ST_UNDEF (1<<0) /* option is undefined */
  20. typedef struct _option {
  21. char name[OPTION_LEN]; /* name of the option */
  22. int type, status; /* type and status */
  23. void *val; /* pointer to option value */
  24. } OPTION;
  25. static SERVER acctserver = {0};
  26. static SERVER authserver = {0};
  27. int default_tries = 4;
  28. int default_timeout = 60;
  29. static OPTION config_options[] = {
  30. /* internally used options */
  31. {"config_file", OT_STR, ST_UNDEF, NULL},
  32. /* General options */
  33. {"auth_order", OT_AUO, ST_UNDEF, NULL},
  34. {"login_tries", OT_INT, ST_UNDEF, &default_tries},
  35. {"login_timeout", OT_INT, ST_UNDEF, &default_timeout},
  36. {"nologin", OT_STR, ST_UNDEF, "/etc/nologin"},
  37. {"issue", OT_STR, ST_UNDEF, "/etc/radiusclient/issue"},
  38. /* RADIUS specific options */
  39. {"authserver", OT_SRV, ST_UNDEF, &authserver},
  40. {"acctserver", OT_SRV, ST_UNDEF, &acctserver},
  41. {"servers", OT_STR, ST_UNDEF, NULL},
  42. {"dictionary", OT_STR, ST_UNDEF, NULL},
  43. {"login_radius", OT_STR, ST_UNDEF, "/usr/sbin/login.radius"},
  44. {"seqfile", OT_STR, ST_UNDEF, NULL},
  45. {"mapfile", OT_STR, ST_UNDEF, NULL},
  46. {"default_realm", OT_STR, ST_UNDEF, NULL},
  47. {"radius_timeout", OT_INT, ST_UNDEF, NULL},
  48. {"radius_retries", OT_INT, ST_UNDEF, NULL},
  49. {"nas_identifier", OT_STR, ST_UNDEF, ""},
  50. {"bindaddr", OT_STR, ST_UNDEF, NULL},
  51. /* local options */
  52. {"login_local", OT_STR, ST_UNDEF, NULL},
  53. };
  54. static int num_options = ((sizeof(config_options))/(sizeof(config_options[0])));