repl_globals.c 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. #ifdef HAVE_CONFIG_H
  39. # include <config.h>
  40. #endif
  41. #include "nspr.h"
  42. #include "repl.h"
  43. char *repl_plugin_name = REPL_PLUGIN_NAME;
  44. char *windows_repl_plugin_name = REPL_PLUGIN_NAME " - windows sync";
  45. char *repl_plugin_name_cl = REPL_PLUGIN_NAME " - changelog program";
  46. /* String constants (no need to change these for I18N) */
  47. #define CHANGETYPE_ADD "add"
  48. #define CHANGETYPE_DELETE "delete"
  49. #define CHANGETYPE_MODIFY "modify"
  50. #define CHANGETYPE_MODRDN "modrdn"
  51. #define CHANGETYPE_MODDN "moddn"
  52. #define ATTR_CHANGENUMBER "changenumber"
  53. #define ATTR_TARGETDN "targetdn"
  54. #define ATTR_CHANGETYPE "changetype"
  55. #define ATTR_NEWRDN "newrdn"
  56. #define ATTR_DELETEOLDRDN "deleteoldrdn"
  57. #define ATTR_CHANGES "changes"
  58. #define ATTR_NEWSUPERIOR "newsuperior"
  59. #define ATTR_CHANGETIME "changetime"
  60. #define ATTR_DATAVERSION "dataVersion"
  61. #define ATTR_CSN "csn"
  62. #define TYPE_COPYINGFROM "copyingFrom"
  63. #define TYPE_COPIEDFROM "copiedFrom"
  64. #define FILTER_COPYINGFROM "copyingFrom=*"
  65. #define FILTER_COPIEDFROM "copiedFrom=*"
  66. #define FILTER_OBJECTCLASS "objectclass=*"
  67. char *changetype_add = CHANGETYPE_ADD;
  68. char *changetype_delete = CHANGETYPE_DELETE;
  69. char *changetype_modify = CHANGETYPE_MODIFY;
  70. char *changetype_modrdn = CHANGETYPE_MODRDN;
  71. char *changetype_moddn = CHANGETYPE_MODDN;
  72. char *attr_changenumber = ATTR_CHANGENUMBER;
  73. char *attr_targetdn = ATTR_TARGETDN;
  74. char *attr_changetype = ATTR_CHANGETYPE;
  75. char *attr_newrdn = ATTR_NEWRDN;
  76. char *attr_deleteoldrdn = ATTR_DELETEOLDRDN;
  77. char *attr_changes = ATTR_CHANGES;
  78. char *attr_newsuperior = ATTR_NEWSUPERIOR;
  79. char *attr_changetime = ATTR_CHANGETIME;
  80. char *attr_dataversion = ATTR_DATAVERSION;
  81. char *attr_csn = ATTR_CSN;
  82. char *type_copyingFrom = TYPE_COPYINGFROM;
  83. char *type_copiedFrom = TYPE_COPIEDFROM;
  84. char *filter_copyingFrom = FILTER_COPYINGFROM;
  85. char *filter_copiedFrom = FILTER_COPIEDFROM;
  86. char *filter_objectclass = FILTER_OBJECTCLASS;
  87. char *type_cn = "cn";
  88. char *type_objectclass = "objectclass";
  89. /* Names for replica attributes */
  90. const char *attr_replicaId = "nsDS5ReplicaId";
  91. const char *attr_replicaRoot = "nsDS5ReplicaRoot";
  92. const char *attr_replicaType = "nsDS5ReplicaType";
  93. const char *attr_replicaBindDn = "nsDS5ReplicaBindDn";
  94. const char *attr_state = "nsState";
  95. const char *attr_flags = "nsds5Flags";
  96. const char *attr_replicaName = "nsds5ReplicaName";
  97. const char *attr_replicaReferral = "nsds5ReplicaReferral";
  98. const char *type_ruvElement = "nsds50ruv";
  99. const char *type_replicaPurgeDelay = "nsds5ReplicaPurgeDelay";
  100. const char *type_replicaChangeCount = "nsds5ReplicaChangeCount";
  101. const char *type_replicaTombstonePurgeInterval = "nsds5ReplicaTombstonePurgeInterval";
  102. const char *type_replicaLegacyConsumer = "nsds5ReplicaLegacyConsumer";
  103. const char *type_ruvElementUpdatetime = "nsruvReplicaLastModified";
  104. const char *type_replicaCleanRUV = "nsds5ReplicaCleanRUV";
  105. const char *type_replicaAbortCleanRUV = "nsds5ReplicaAbortCleanRUV";
  106. const char *type_replicaProtocolTimeout = "nsds5ReplicaProtocolTimeout";
  107. const char *type_replicaBackoffMin = "nsds5ReplicaBackoffMin";
  108. const char *type_replicaBackoffMax = "nsds5ReplicaBackoffMax";
  109. /* Attribute names for replication agreement attributes */
  110. const char *type_nsds5ReplicaHost = "nsds5ReplicaHost";
  111. const char *type_nsds5ReplicaPort = "nsds5ReplicaPort";
  112. const char *type_nsds5TransportInfo = "nsds5ReplicaTransportInfo";
  113. const char *type_nsds5ReplicaBindDN = "nsds5ReplicaBindDN";
  114. const char *type_nsds5ReplicaCredentials = "nsds5ReplicaCredentials";
  115. const char *type_nsds5ReplicaBindMethod = "nsds5ReplicaBindMethod";
  116. const char *type_nsds5ReplicaRoot = "nsds5ReplicaRoot";
  117. const char *type_nsds5ReplicatedAttributeList = "nsds5ReplicatedAttributeList";
  118. const char *type_nsds5ReplicatedAttributeListTotal = "nsds5ReplicatedAttributeListTotal";
  119. const char *type_nsds5ReplicaUpdateSchedule = "nsds5ReplicaUpdateSchedule";
  120. const char *type_nsds5ReplicaInitialize = "nsds5BeginReplicaRefresh";
  121. const char *type_nsds5ReplicaTimeout = "nsds5ReplicaTimeout";
  122. const char *type_nsds5ReplicaBusyWaitTime = "nsds5ReplicaBusyWaitTime";
  123. const char *type_nsds5ReplicaSessionPauseTime = "nsds5ReplicaSessionPauseTime";
  124. const char *type_nsds5ReplicaEnabled = "nsds5ReplicaEnabled";
  125. const char *type_nsds5ReplicaStripAttrs = "nsds5ReplicaStripAttrs";
  126. const char *type_nsds5ReplicaCleanRUVnotified = "nsds5ReplicaCleanRUVNotified";
  127. /* windows sync specific attributes */
  128. const char *type_nsds7WindowsReplicaArea = "nsds7WindowsReplicaSubtree";
  129. const char *type_nsds7DirectoryReplicaArea = "nsds7DirectoryReplicaSubtree";
  130. const char *type_nsds7CreateNewUsers = "nsds7NewWinUserSyncEnabled";
  131. const char *type_nsds7CreateNewGroups = "nsds7NewWinGroupSyncEnabled";
  132. const char *type_nsds7WindowsDomain = "nsds7WindowsDomain";
  133. const char *type_nsds7DirsyncCookie = "nsds7DirsyncCookie";
  134. const char *type_winSyncInterval = "winSyncInterval";
  135. const char *type_oneWaySync = "oneWaySync";
  136. const char *type_winsyncMoveAction = "winSyncMoveAction";
  137. const char *type_winSyncWindowsFilter = "winSyncWindowsFilter";
  138. const char *type_winSyncDirectoryFilter = "winSyncDirectoryFilter";
  139. const char *type_winSyncSubtreePair = "winSyncSubtreePair";
  140. /* To Allow Consumer Initialization when adding an agreement - */
  141. const char *type_nsds5BeginReplicaRefresh = "nsds5BeginReplicaRefresh";
  142. static int repl_active_threads;
  143. int
  144. decrement_repl_active_threads()
  145. {
  146. PR_AtomicIncrement(&repl_active_threads);
  147. return repl_active_threads;
  148. }
  149. int
  150. increment_repl_active_threads()
  151. {
  152. PR_AtomicDecrement(&repl_active_threads);
  153. return repl_active_threads;
  154. }