linked_attrs.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 "slapi-private.h"
  22. #include "prclist.h"
  23. #include "ldif.h"
  24. /*
  25. * Plug-in defines
  26. */
  27. #define LINK_PLUGIN_SUBSYSTEM "linkedattrs-plugin"
  28. #define LINK_FEATURE_DESC "Linked Attributes"
  29. #define LINK_PLUGIN_DESC "Linked Attributes plugin"
  30. #define LINK_INT_POSTOP_DESC "Linked Attributes internal postop plugin"
  31. #define LINK_POSTOP_DESC "Linked Attributes postop plugin"
  32. /*
  33. * Config type defines
  34. */
  35. #define LINK_LINK_TYPE "linkType"
  36. #define LINK_MANAGED_TYPE "managedType"
  37. #define LINK_SCOPE "linkScope"
  38. /*
  39. * Other defines
  40. */
  41. #define DN_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.12"
  42. /*
  43. * Linked list of config entries.
  44. */
  45. struct configEntry
  46. {
  47. PRCList list;
  48. char *dn;
  49. char *linktype;
  50. char *managedtype;
  51. char *scope;
  52. Slapi_DN *suffix;
  53. Slapi_Mutex *lock;
  54. };
  55. /*
  56. * Linked list used for indexing config entries
  57. * by managed type.
  58. */
  59. struct configIndex
  60. {
  61. PRCList list;
  62. struct configEntry *config;
  63. };
  64. /*
  65. * Fixup task private data.
  66. */
  67. typedef struct _task_data
  68. {
  69. char *linkdn;
  70. char *bind_dn;
  71. } task_data;
  72. /*
  73. * Debug functions - global, for the debugger
  74. */
  75. void linked_attrs_dump_config(void);
  76. void linked_attrs_dump_config_index(void);
  77. void linked_attrs_dump_config_entry(struct configEntry *);
  78. /*
  79. * Config fetch function
  80. */
  81. PRCList *linked_attrs_get_config(void);
  82. /*
  83. * Config cache locking functions
  84. */
  85. void linked_attrs_read_lock(void);
  86. void linked_attrs_write_lock(void);
  87. void linked_attrs_unlock(void);
  88. /*
  89. * Plugin identity functions
  90. */
  91. void linked_attrs_set_plugin_id(void *pluginID);
  92. void *linked_attrs_get_plugin_id(void);
  93. void linked_attrs_set_plugin_dn(const char *pluginDN);
  94. char *linked_attrs_get_plugin_dn(void);
  95. /*
  96. * Fixup task callback
  97. */
  98. int linked_attrs_fixup_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int *returncode, char *returntext, void *arg);
  99. extern int plugin_is_betxn;