1
0

linked_attrs.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2009 Red Hat, Inc.
  3. * All rights reserved.
  4. *
  5. * License: GPL (version 3 or any later version).
  6. * See LICENSE for details.
  7. * END COPYRIGHT BLOCK **/
  8. #ifdef HAVE_CONFIG_H
  9. # include <config.h>
  10. #endif
  11. /*
  12. * Linked attributes plug-in header file
  13. */
  14. #include <stdio.h>
  15. #include <ctype.h>
  16. #include <string.h>
  17. #include <errno.h>
  18. #include "portable.h"
  19. #include "nspr.h"
  20. #include "slapi-plugin.h"
  21. #include "prclist.h"
  22. #include "ldif.h"
  23. /*
  24. * Plug-in defines
  25. */
  26. #define LINK_PLUGIN_SUBSYSTEM "linkedattrs-plugin"
  27. #define LINK_FEATURE_DESC "Linked Attributes"
  28. #define LINK_PLUGIN_DESC "Linked Attributes plugin"
  29. #define LINK_INT_POSTOP_DESC "Linked Attributes internal postop plugin"
  30. #define LINK_POSTOP_DESC "Linked Attributes postop plugin"
  31. /*
  32. * Config type defines
  33. */
  34. #define LINK_LINK_TYPE "linkType"
  35. #define LINK_MANAGED_TYPE "managedType"
  36. #define LINK_SCOPE "linkScope"
  37. /*
  38. * Other defines
  39. */
  40. #define DN_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.12"
  41. /*
  42. * Linked list of config entries.
  43. */
  44. struct configEntry {
  45. PRCList list;
  46. char *dn;
  47. char *linktype;
  48. char *managedtype;
  49. char *scope;
  50. Slapi_DN *suffix;
  51. Slapi_Mutex *lock;
  52. };
  53. /*
  54. * Linked list used for indexing config entries
  55. * by managed type.
  56. */
  57. struct configIndex {
  58. PRCList list;
  59. struct configEntry *config;
  60. };
  61. /*
  62. * Fixup task private data.
  63. */
  64. typedef struct _task_data
  65. {
  66. char *linkdn;
  67. char *bind_dn;
  68. } task_data;
  69. /*
  70. * Debug functions - global, for the debugger
  71. */
  72. void linked_attrs_dump_config();
  73. void linked_attrs_dump_config_index();
  74. void linked_attrs_dump_config_entry(struct configEntry *);
  75. /*
  76. * Config fetch function
  77. */
  78. PRCList *linked_attrs_get_config();
  79. /*
  80. * Config cache locking functions
  81. */
  82. void linked_attrs_read_lock();
  83. void linked_attrs_write_lock();
  84. void linked_attrs_unlock();
  85. /*
  86. * Plugin identity functions
  87. */
  88. void linked_attrs_set_plugin_id(void *pluginID);
  89. void *linked_attrs_get_plugin_id();
  90. void linked_attrs_set_plugin_dn(const char *pluginDN);
  91. char *linked_attrs_get_plugin_dn();
  92. /*
  93. * Fixup task callback
  94. */
  95. int linked_attrs_fixup_task_add(Slapi_PBlock *pb, Slapi_Entry *e,
  96. Slapi_Entry *eAfter, int *returncode,
  97. char *returntext, void *arg);
  98. extern int plugin_is_betxn;