scalab01.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ident "ldclt @(#)scalab01.h 1.3 01/03/14"
  2. /** BEGIN COPYRIGHT BLOCK
  3. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  4. * Copyright (C) 2006 Red Hat, Inc.
  5. * All rights reserved.
  6. *
  7. * License: GPL (version 3 or any later version).
  8. * See LICENSE for details.
  9. * END COPYRIGHT BLOCK **/
  10. #ifdef HAVE_CONFIG_H
  11. # include <config.h>
  12. #endif
  13. /*
  14. FILE : scalab01.h
  15. AUTHOR : Jean-Luc SCHWING
  16. VERSION : 1.0
  17. DATE : 12 January 2001
  18. DESCRIPTION :
  19. This file contains the definitions related to the
  20. scenario scalab01 of ldclt.
  21. LOCAL : None.
  22. HISTORY :
  23. ---------+--------------+------------------------------------------------------
  24. dd/mm/yy | Author | Comments
  25. ---------+--------------+------------------------------------------------------
  26. 12/01/01 | JL Schwing | Creation
  27. ---------+--------------+------------------------------------------------------
  28. 01/02/01 | JL Schwing | 1.2 : Protect against multiple choice of same user.
  29. ---------+--------------+------------------------------------------------------
  30. 14/03/01 | JL Schwing | 1.3 : Lint cleanup.
  31. ---------+--------------+------------------------------------------------------
  32. */
  33. #ifndef SCALAB01_H
  34. #define SCALAB01_H
  35. /*
  36. * Default values for scalab01
  37. */
  38. #define SCALAB01_ACC_ATTRIB "ntUserUnitsPerWeek"
  39. #define SCALAB01_DEF_MAX_CNX 5000
  40. #define SCALAB01_DEF_CNX_DURATION 3600
  41. #define SCALAB01_DEF_WAIT_TIME 10
  42. #define SCALAB01_LOCK_ATTRIB "ntUserFlags"
  43. #define SCALAB01_SUPER_USER_RDN "cn=super user"
  44. #define SCALAB01_SUPER_USER_PASSWORD "super user password"
  45. #define SCALAB01_VAL_LOCKED "1"
  46. #define SCALAB01_VAL_UNLOCKED "0"
  47. #define SCALAB01_MAX_LOCKING 4096
  48. /*
  49. * This structure is intended to memorize the information about
  50. * the "ISP" users connected.
  51. * Uses mainly static size data to save malloc()/free() calls.
  52. */
  53. typedef struct isp_user {
  54. char dn[MAX_DN_LENGTH]; /* User's DN */
  55. int cost; /* Cnx cost */
  56. int counter; /* To free it */
  57. struct isp_user *next; /* Next entry */
  58. } isp_user;
  59. /*
  60. * This is the scalab01 context structure.
  61. */
  62. typedef struct scalab01_context {
  63. int cnxduration; /* Max cnx duration */
  64. LDAP *ldapCtx; /* LDAP context */
  65. isp_user *list; /* ISP users list */
  66. ldclt_mutex_t list_mutex; /* Protect list */
  67. char *locking[SCALAB01_MAX_LOCKING];
  68. ldclt_mutex_t locking_mutex;
  69. int lockingMax;
  70. int maxcnxnb; /* Modem pool size */
  71. int nbcnx; /* Nb cnx to the modem */
  72. ldclt_mutex_t nbcnx_mutex; /* Protect nbcnx */
  73. int wait; /* Retry every this time */
  74. } scalab01_context;
  75. /*
  76. * Exported functions and structures
  77. */
  78. extern int doScalab01 (thread_context *tttctx);
  79. extern scalab01_context s1ctx;
  80. extern void *scalab01_control (void *);
  81. extern int scalab01_init (void); /*JLS 14-03-01*/
  82. #endif /* SCALAB01_H */
  83. /* End of file */