p2p_constants.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * Copyright 2004 The WebRTC Project Authors. All rights reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef P2P_BASE_P2P_CONSTANTS_H_
  11. #define P2P_BASE_P2P_CONSTANTS_H_
  12. #include <stddef.h>
  13. #include <stdint.h>
  14. #include "rtc_base/system/rtc_export.h"
  15. namespace cricket {
  16. // CN_ == "content name". When we initiate a session, we choose the
  17. // name, and when we receive a Gingle session, we provide default
  18. // names (since Gingle has no content names). But when we receive a
  19. // Jingle call, the content name can be anything, so don't rely on
  20. // these values being the same as the ones received.
  21. extern const char CN_AUDIO[];
  22. extern const char CN_VIDEO[];
  23. extern const char CN_DATA[];
  24. extern const char CN_OTHER[];
  25. // GN stands for group name
  26. extern const char GROUP_TYPE_BUNDLE[];
  27. RTC_EXPORT extern const int ICE_UFRAG_LENGTH;
  28. RTC_EXPORT extern const int ICE_PWD_LENGTH;
  29. extern const size_t ICE_UFRAG_MIN_LENGTH;
  30. extern const size_t ICE_PWD_MIN_LENGTH;
  31. extern const size_t ICE_UFRAG_MAX_LENGTH;
  32. extern const size_t ICE_PWD_MAX_LENGTH;
  33. RTC_EXPORT extern const int ICE_CANDIDATE_COMPONENT_RTP;
  34. RTC_EXPORT extern const int ICE_CANDIDATE_COMPONENT_RTCP;
  35. extern const int ICE_CANDIDATE_COMPONENT_DEFAULT;
  36. // RFC 4145, SDP setup attribute values.
  37. extern const char CONNECTIONROLE_ACTIVE_STR[];
  38. extern const char CONNECTIONROLE_PASSIVE_STR[];
  39. extern const char CONNECTIONROLE_ACTPASS_STR[];
  40. extern const char CONNECTIONROLE_HOLDCONN_STR[];
  41. // RFC 6762, the .local pseudo-top-level domain used for mDNS names.
  42. extern const char LOCAL_TLD[];
  43. // Constants for time intervals are in milliseconds unless otherwise stated.
  44. //
  45. // Most of the following constants are the default values of IceConfig
  46. // paramters. See IceConfig for detailed definition.
  47. //
  48. // Default value of IceConfig.receiving_timeout.
  49. extern const int RECEIVING_TIMEOUT;
  50. // Default value IceConfig.ice_check_min_interval.
  51. extern const int MIN_CHECK_RECEIVING_INTERVAL;
  52. // The next two ping intervals are at the ICE transport level.
  53. //
  54. // STRONG_PING_INTERVAL is applied when the selected connection is both
  55. // writable and receiving.
  56. //
  57. // Default value of IceConfig.ice_check_interval_strong_connectivity.
  58. extern const int STRONG_PING_INTERVAL;
  59. // WEAK_PING_INTERVAL is applied when the selected connection is either
  60. // not writable or not receiving.
  61. //
  62. // Defaul value of IceConfig.ice_check_interval_weak_connectivity.
  63. extern const int WEAK_PING_INTERVAL;
  64. // The next two ping intervals are at the candidate pair level.
  65. //
  66. // Writable candidate pairs are pinged at a slower rate once they are stabilized
  67. // and the channel is strongly connected.
  68. extern const int STRONG_AND_STABLE_WRITABLE_CONNECTION_PING_INTERVAL;
  69. // Writable candidate pairs are pinged at a faster rate while the connections
  70. // are stabilizing or the channel is weak.
  71. extern const int WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL;
  72. // Default value of IceConfig.backup_connection_ping_interval
  73. extern const int BACKUP_CONNECTION_PING_INTERVAL;
  74. // Defualt value of IceConfig.receiving_switching_delay.
  75. extern const int RECEIVING_SWITCHING_DELAY;
  76. // Default value of IceConfig.regather_on_failed_networks_interval.
  77. extern const int REGATHER_ON_FAILED_NETWORKS_INTERVAL;
  78. // Default vaule of IceConfig.ice_unwritable_timeout.
  79. extern const int CONNECTION_WRITE_CONNECT_TIMEOUT;
  80. // Default vaule of IceConfig.ice_unwritable_min_checks.
  81. extern const uint32_t CONNECTION_WRITE_CONNECT_FAILURES;
  82. // Default value of IceConfig.ice_inactive_timeout;
  83. extern const int CONNECTION_WRITE_TIMEOUT;
  84. // Default value of IceConfig.stun_keepalive_interval;
  85. extern const int STUN_KEEPALIVE_INTERVAL;
  86. // The following constants are used at the candidate pair level to determine the
  87. // state of a candidate pair.
  88. //
  89. // The timeout duration when a connection does not receive anything.
  90. extern const int WEAK_CONNECTION_RECEIVE_TIMEOUT;
  91. // A connection will be declared dead if it has not received anything for this
  92. // long.
  93. extern const int DEAD_CONNECTION_RECEIVE_TIMEOUT;
  94. // This is the length of time that we wait for a ping response to come back.
  95. extern const int CONNECTION_RESPONSE_TIMEOUT;
  96. // The minimum time we will wait before destroying a connection after creating
  97. // it.
  98. extern const int MIN_CONNECTION_LIFETIME;
  99. } // namespace cricket
  100. #endif // P2P_BASE_P2P_CONSTANTS_H_