windows_prot_private.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. * END COPYRIGHT BLOCK **/
  6. #include "repl5_prot_private.h"
  7. #ifndef _WINDOWS_PROT_PRIVATE_H_
  8. #define _WINDOWS_PROT_PRIVATE_H_
  9. #define ACQUIRE_SUCCESS 101
  10. #define ACQUIRE_REPLICA_BUSY 102
  11. #define ACQUIRE_FATAL_ERROR 103
  12. #define ACQUIRE_CONSUMER_WAS_UPTODATE 104
  13. #define ACQUIRE_TRANSIENT_ERROR 105
  14. typedef struct windows_private_repl_protocol
  15. {
  16. void (*delete)(struct windows_private_repl_protocol **);
  17. void (*run)(struct windows_private_repl_protocol *);
  18. int (*stop)(struct windows_private_repl_protocol *);
  19. int (*status)(struct windows_private_repl_protocol *);
  20. void (*notify_update)(struct windows_private_repl_protocol *);
  21. void (*notify_agmt_changed)(struct windows_private_repl_protocol *);
  22. void (*notify_window_opened)(struct windows_private_repl_protocol *);
  23. void (*notify_window_closed)(struct windows_private_repl_protocol *);
  24. void (*update_now)(struct windows_private_repl_protocol *);
  25. PRLock *lock;
  26. PRCondVar *cvar;
  27. int stopped;
  28. int terminate;
  29. PRUint32 eventbits;
  30. Repl_Connection *conn;
  31. int last_acquire_response_code;
  32. Repl_Agmt *agmt;
  33. Object *replica_object;
  34. void *private;
  35. PRBool replica_acquired;
  36. } Windows_Private_Repl_Protocol;
  37. /*
  38. extern Windows_Private_Repl_Protocol *Windows_Inc_Protocol_new();
  39. extern Windows_Private_Repl_Protocol *Windows_Tot_Protocol_new();
  40. */
  41. #define PROTOCOL_TERMINATION_NORMAL 301
  42. #define PROTOCOL_TERMINATION_ABNORMAL 302
  43. #define PROTOCOL_TERMINATION_NEEDS_TOTAL_UPDATE 303
  44. #define RESUME_DO_TOTAL_UPDATE 401
  45. #define RESUME_DO_INCREMENTAL_UPDATE 402
  46. #define RESUME_TERMINATE 403
  47. #define RESUME_SUSPEND 404
  48. /* Backoff timer settings for reconnect */
  49. #define PROTOCOL_BACKOFF_MINIMUM 3 /* 3 seconds */
  50. #define PROTOCOL_BACKOFF_MAXIMUM (60 * 5) /* 5 minutes */
  51. /* Backoff timer settings for replica busy reconnect */
  52. #define PROTOCOL_BUSY_BACKOFF_MINIMUM PROTOCOL_BACKOFF_MINIMUM
  53. #define PROTOCOL_BUSY_BACKOFF_MAXIMUM PROTOCOL_BUSY_BACKOFF_MINIMUM
  54. /* protocol related functions */
  55. CSN *get_current_csn(Slapi_DN *replarea_sdn);
  56. char* protocol_response2string (int response);
  57. void windows_dirsync_inc_run(Private_Repl_Protocol *prp);
  58. #endif /* _REPL5_PROT_PRIVATE_H_ */