repl5_prot_private.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. #ifndef _REPL5_PROT_PRIVATE_H_
  7. #define _REPL5_PROT_PRIVATE_H_
  8. #define ACQUIRE_SUCCESS 101
  9. #define ACQUIRE_REPLICA_BUSY 102
  10. #define ACQUIRE_FATAL_ERROR 103
  11. #define ACQUIRE_CONSUMER_WAS_UPTODATE 104
  12. #define ACQUIRE_TRANSIENT_ERROR 105
  13. typedef struct private_repl_protocol
  14. {
  15. void (*delete)(struct private_repl_protocol **);
  16. void (*run)(struct private_repl_protocol *);
  17. int (*stop)(struct private_repl_protocol *);
  18. int (*status)(struct private_repl_protocol *);
  19. void (*notify_update)(struct private_repl_protocol *);
  20. void (*notify_agmt_changed)(struct private_repl_protocol *);
  21. void (*notify_window_opened)(struct private_repl_protocol *);
  22. void (*notify_window_closed)(struct private_repl_protocol *);
  23. void (*update_now)(struct private_repl_protocol *);
  24. PRLock *lock;
  25. PRCondVar *cvar;
  26. int stopped;
  27. int terminate;
  28. PRUint32 eventbits;
  29. Repl_Connection *conn;
  30. int last_acquire_response_code;
  31. Repl_Agmt *agmt;
  32. Object *replica_object;
  33. void *private;
  34. PRBool replica_acquired;
  35. int repl50consumer; /* Flag to tell us if this is a 5.0-style consumer we're talking to */
  36. } Private_Repl_Protocol;
  37. extern Private_Repl_Protocol *Repl_5_Inc_Protocol_new();
  38. extern Private_Repl_Protocol *Repl_5_Tot_Protocol_new();
  39. extern Private_Repl_Protocol *Windows_Inc_Protocol_new();
  40. extern Private_Repl_Protocol *Windows_Tot_Protocol_new();
  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. void release_replica(Private_Repl_Protocol *prp);
  56. int acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv);
  57. BerElement *entry2bere(const Slapi_Entry *e, char **excluded_attrs);
  58. CSN *get_current_csn(Slapi_DN *replarea_sdn);
  59. char* protocol_response2string (int response);
  60. int repl5_strip_fractional_mods(Repl_Agmt *agmt, LDAPMod **);
  61. void windows_release_replica(Private_Repl_Protocol *prp);
  62. int windows_acquire_replica(Private_Repl_Protocol *prp, RUV **ruv, int check_ruv);
  63. #endif /* _REPL5_PROT_PRIVATE_H_ */