windowsrepl.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. /* windows_private.c */
  42. typedef struct windowsprivate Dirsync_Private;
  43. Dirsync_Private* windows_private_new();
  44. void windows_private_set_windows_subtree (const Repl_Agmt *ra,const Slapi_DN* sdn );
  45. const Slapi_DN* windows_private_get_windows_subtree (const Repl_Agmt *ra);
  46. void windows_private_set_directory_subtree (const Repl_Agmt *ra,const Slapi_DN* sdn );
  47. const Slapi_DN* windows_private_get_directory_subtree (const Repl_Agmt *ra);
  48. LDAPControl* windows_private_dirsync_control(const Repl_Agmt *ra);
  49. ConnResult send_dirsync_search(Repl_Connection *conn);
  50. ConnResult windows_search_entry(Repl_Connection *conn, char* searchbase, char *filter, Slapi_Entry **entry);
  51. ConnResult windows_search_entry_ext(Repl_Connection *conn, char* searchbase, char *filter, Slapi_Entry **entry, LDAPControl **serverctrls);
  52. Slapi_Entry *windows_conn_get_search_result(Repl_Connection *conn );
  53. void windows_private_update_dirsync_control(const Repl_Agmt *ra,LDAPControl **controls );
  54. PRBool windows_private_dirsync_has_more(const Repl_Agmt *ra);
  55. void windows_private_null_dirsync_cookie(const Repl_Agmt *ra);
  56. int windows_private_save_dirsync_cookie(const Repl_Agmt *ra);
  57. int windows_private_load_dirsync_cookie(const Repl_Agmt *ra);
  58. void windows_private_set_create_users(const Repl_Agmt *ra, PRBool value);
  59. PRBool windows_private_create_users(const Repl_Agmt *ra);
  60. void windows_private_set_create_groups(const Repl_Agmt *ra, PRBool value);
  61. PRBool windows_private_create_groups(const Repl_Agmt *ra);
  62. const char *windows_private_get_windows_domain(const Repl_Agmt *ra);
  63. static void windows_private_set_windows_domain(const Repl_Agmt *ra, char *domain);
  64. int windows_private_get_isnt4(const Repl_Agmt *ra);
  65. void windows_private_set_isnt4(const Repl_Agmt *ra, int isit);
  66. int windows_private_get_iswin2k3(const Repl_Agmt *ra);
  67. void windows_private_set_iswin2k3(const Repl_Agmt *ra, int isit);
  68. Slapi_Filter* windows_private_get_directory_filter(const Repl_Agmt *ra);
  69. Slapi_Filter* windows_private_get_deleted_filter(const Repl_Agmt *ra);
  70. const char* windows_private_get_purl(const Repl_Agmt *ra);
  71. /* in windows_connection.c */
  72. ConnResult windows_conn_connect(Repl_Connection *conn);
  73. void windows_conn_disconnect(Repl_Connection *conn);
  74. void windows_conn_delete(Repl_Connection *conn);
  75. void windows_conn_get_error(Repl_Connection *conn, int *operation, int *error);
  76. ConnResult windows_conn_send_add(Repl_Connection *conn, const char *dn, LDAPMod **attrs,
  77. LDAPControl **server_controls, LDAPControl ***returned_controls);
  78. ConnResult windows_conn_send_delete(Repl_Connection *conn, const char *dn,
  79. LDAPControl **server_controls, LDAPControl ***returned_controls);
  80. ConnResult windows_conn_send_modify(Repl_Connection *conn, const char *dn, LDAPMod **mods,
  81. LDAPControl **server_controls, LDAPControl ***returned_controls);
  82. ConnResult windows_conn_send_rename(Repl_Connection *conn, const char *dn,
  83. const char *newrdn, const char *newparent, int deleteoldrdn,
  84. LDAPControl **server_controls, LDAPControl ***returned_controls);
  85. ConnResult windows_conn_send_extended_operation(Repl_Connection *conn, const char *extop_oid,
  86. struct berval *payload, char **retoidp, struct berval **retdatap,
  87. LDAPControl **server_controls, LDAPControl ***returned_controls);
  88. const char *windows_conn_get_status(Repl_Connection *conn);
  89. void windows_conn_start_linger(Repl_Connection *conn);
  90. void windows_conn_cancel_linger(Repl_Connection *conn);
  91. ConnResult windows_conn_replica_supports_ds5_repl(Repl_Connection *conn);
  92. ConnResult windows_conn_replica_supports_dirsync(Repl_Connection *conn);
  93. ConnResult windows_conn_replica_is_win2k3(Repl_Connection *conn);
  94. ConnResult windows_conn_read_entry_attribute(Repl_Connection *conn, const char *dn, char *type,
  95. struct berval ***returned_bvals);
  96. ConnResult windows_conn_push_schema(Repl_Connection *conn, CSN **remotecsn);
  97. void windows_conn_set_timeout(Repl_Connection *conn, long timeout);
  98. void windows_conn_set_agmt_changed(Repl_Connection *conn);
  99. /* Used to work around a schema incompatibility between Microsoft and the IETF */
  100. #define FAKE_STREET_ATTR_NAME "in#place#of#streetaddress"
  101. /* Used to work around contrained attribute legth for initials on AD */
  102. #define AD_INITIALS_LENGTH 6
  103. /* Used to check for pre-hashed passwords when syncing */
  104. #define PASSWD_CLEAR_PREFIX "{clear}"
  105. #define PASSWD_CLEAR_PREFIX_LEN 7
  106. /* Used for GUID format conversion */
  107. #define NTUNIQUEID_LENGTH 32
  108. #define AD_GUID_LENGTH 36