repl5_prot_private.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright 2001 Sun Microsystems, Inc.
  3. * Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
  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. } Private_Repl_Protocol;
  36. extern Private_Repl_Protocol *Repl_5_Inc_Protocol_new();
  37. extern Private_Repl_Protocol *Repl_5_Tot_Protocol_new();
  38. #define PROTOCOL_TERMINATION_NORMAL 301
  39. #define PROTOCOL_TERMINATION_ABNORMAL 302
  40. #define PROTOCOL_TERMINATION_NEEDS_TOTAL_UPDATE 303
  41. #define RESUME_DO_TOTAL_UPDATE 401
  42. #define RESUME_DO_INCREMENTAL_UPDATE 402
  43. #define RESUME_TERMINATE 403
  44. #define RESUME_SUSPEND 404
  45. /* Backoff timer settings for reconnect */
  46. #define PROTOCOL_BACKOFF_MINIMUM 3 /* 3 seconds */
  47. #define PROTOCOL_BACKOFF_MAXIMUM (60 * 5) /* 5 minutes */
  48. /* Backoff timer settings for replica busy reconnect */
  49. #define PROTOCOL_BUSY_BACKOFF_MINIMUM PROTOCOL_BACKOFF_MINIMUM
  50. #define PROTOCOL_BUSY_BACKOFF_MAXIMUM PROTOCOL_BUSY_BACKOFF_MINIMUM
  51. /* protocol related functions */
  52. void release_replica(Private_Repl_Protocol *prp);
  53. int acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv);
  54. BerElement *entry2bere(const Slapi_Entry *e);
  55. CSN *get_current_csn(Slapi_DN *replarea_sdn);
  56. char* protocol_response2string (int response);
  57. #endif /* _REPL5_PROT_PRIVATE_H_ */