Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. bowelect.h
  5. Abstract:
  6. This module
  7. Author:
  8. Larry Osterman (larryo) 6-May-1991
  9. Revision History:
  10. 6-May-1991 larryo
  11. Created
  12. --*/
  13. #ifndef _BOWELECT_
  14. #define _BOWELECT_
  15. //
  16. // Timer values to respond to election requests.
  17. //
  18. #define MASTER_ELECTION_DELAY 100 // Master waits this long.
  19. #define BACKUP_ELECTION_DELAY_MIN 200 // Backup waits at least this long
  20. #define BACKUP_ELECTION_DELAY_MAX 600 // but no longer than this.
  21. #define ELECTION_DELAY_MIN 800 // Others wait at least this long
  22. #define ELECTION_DELAY_MAX 3000 // but no longer than this.
  23. #define ELECTION_RESPONSE_MIN 200 // Election response delay.
  24. #define ELECTION_RESPONSE_MAX 900 // Max electionresponse delay
  25. #define ELECTION_RESEND_DELAY 1000 // Resend election at this interval
  26. #define ELECTION_COUNT 4 // We must win election this many times.
  27. #define ELECTION_MAX 30 // Don't send more than 30 election
  28. // responses in an election
  29. #define ELECTION_EXEMPT_TIME (ELECTION_DELAY_MAX + (ELECTION_RESEND_DELAY*ELECTION_COUNT)*2)
  30. #define FIND_MASTER_WAIT (ELECTION_DELAY_MAX + ELECTION_RESEND_DELAY*(ELECTION_COUNT+2))
  31. #define FIND_MASTER_DELAY 1500 // Retry find master delay.
  32. #define FIND_MASTER_COUNT 6 // Number of times to retry FM
  33. #define TRANSPORT_BIND_TIME 3*1000 // Number of milliseconds to bind to transport.
  34. //
  35. // The reasonable amount of time that it would take for an election.
  36. //
  37. #define ELECTION_TIME ((ELECTION_DELAY_MAX * ELECTION_COUNT) + TRANSPORT_BIND_TIME)
  38. DATAGRAM_HANDLER(
  39. BowserHandleElection
  40. );
  41. NTSTATUS
  42. BowserSendElection(
  43. IN PUNICODE_STRING NameToSend,
  44. IN DGRECEIVER_NAME_TYPE NameType,
  45. IN PTRANSPORT Transport,
  46. IN BOOLEAN SendActualBrowserInfo
  47. );
  48. NTSTATUS
  49. GetMasterName (
  50. IN PIRP Irp,
  51. IN BOOLEAN Wait,
  52. IN BOOLEAN InFsd,
  53. IN PLMDR_REQUEST_PACKET InputBuffer,
  54. IN ULONG InputBufferLength
  55. );
  56. //NTSTATUS
  57. //BowserBackupFindMaster(
  58. // IN PTRANSPORT Transport,
  59. // IN PREQUEST_ELECTION_1 ElectionResponse,
  60. // IN ULONG BytesAvailable
  61. // );
  62. NTSTATUS
  63. BowserFindMaster(
  64. IN PTRANSPORT Transport
  65. );
  66. VOID
  67. BowserLoseElection(
  68. IN PTRANSPORT Transport
  69. );
  70. #endif // _BOWELECT_