blob: 2948be0bb837d4c04dcbf2081f98b02d0d47d94b [file] [log] [blame]
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +00001/*
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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef P2P_BASE_P2PCONSTANTS_H_
12#define P2P_BASE_P2PCONSTANTS_H_
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000013
14#include <string>
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000015
Mirko Bonadeiac194142018-10-22 17:08:37 +020016#include "rtc_base/system/rtc_export.h"
17
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000018namespace cricket {
19
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000020// CN_ == "content name". When we initiate a session, we choose the
21// name, and when we receive a Gingle session, we provide default
22// names (since Gingle has no content names). But when we receive a
23// Jingle call, the content name can be anything, so don't rely on
24// these values being the same as the ones received.
25extern const char CN_AUDIO[];
26extern const char CN_VIDEO[];
27extern const char CN_DATA[];
28extern const char CN_OTHER[];
pthatcher@webrtc.org5ad41782014-12-23 22:14:15 +000029
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000030// GN stands for group name
31extern const char GROUP_TYPE_BUNDLE[];
32
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000033extern const int ICE_UFRAG_LENGTH;
Mirko Bonadeiac194142018-10-22 17:08:37 +020034RTC_EXPORT extern const int ICE_PWD_LENGTH;
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000035extern const size_t ICE_UFRAG_MIN_LENGTH;
36extern const size_t ICE_PWD_MIN_LENGTH;
37extern const size_t ICE_UFRAG_MAX_LENGTH;
38extern const size_t ICE_PWD_MAX_LENGTH;
pthatcher@webrtc.org5ad41782014-12-23 22:14:15 +000039
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000040extern const int ICE_CANDIDATE_COMPONENT_RTP;
41extern const int ICE_CANDIDATE_COMPONENT_RTCP;
42extern const int ICE_CANDIDATE_COMPONENT_DEFAULT;
43
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000044// RFC 4145, SDP setup attribute values.
45extern const char CONNECTIONROLE_ACTIVE_STR[];
46extern const char CONNECTIONROLE_PASSIVE_STR[];
47extern const char CONNECTIONROLE_ACTPASS_STR[];
48extern const char CONNECTIONROLE_HOLDCONN_STR[];
49
Qingsi Wang866e08d2018-03-22 17:54:23 -070050// Constants for time intervals are in milliseconds unless otherwise stated.
51//
52// Most of the following constants are the default values of IceConfig
53// paramters. See IceConfig for detailed definition.
54//
55// Default value of IceConfig.receiving_timeout.
56extern const int RECEIVING_TIMEOUT;
57// Default value IceConfig.ice_check_min_interval.
58extern const int MIN_CHECK_RECEIVING_INTERVAL;
59// The next two ping intervals are at the ICE transport level.
60//
61// STRONG_PING_INTERVAL is applied when the selected connection is both
62// writable and receiving.
63//
64// Default value of IceConfig.ice_check_interval_strong_connectivity.
65extern const int STRONG_PING_INTERVAL;
66// WEAK_PING_INTERVAL is applied when the selected connection is either
67// not writable or not receiving.
68//
69// Defaul value of IceConfig.ice_check_interval_weak_connectivity.
70extern const int WEAK_PING_INTERVAL;
71// The next two ping intervals are at the candidate pair level.
72//
73// Writable candidate pairs are pinged at a slower rate once they are stabilized
74// and the channel is strongly connected.
75extern const int STRONG_AND_STABLE_WRITABLE_CONNECTION_PING_INTERVAL;
76// Writable candidate pairs are pinged at a faster rate while the connections
77// are stabilizing or the channel is weak.
78extern const int WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL;
79// Default value of IceConfig.backup_connection_ping_interval
80extern const int BACKUP_CONNECTION_PING_INTERVAL;
81// Defualt value of IceConfig.receiving_switching_delay.
82extern const int RECEIVING_SWITCHING_DELAY;
83// Default value of IceConfig.regather_on_failed_networks_interval.
84extern const int REGATHER_ON_FAILED_NETWORKS_INTERVAL;
85// Default vaule of IceConfig.ice_unwritable_timeout.
86extern const int CONNECTION_WRITE_CONNECT_TIMEOUT;
87// Default vaule of IceConfig.ice_unwritable_min_checks.
88extern const uint32_t CONNECTION_WRITE_CONNECT_FAILURES;
89// Default value of IceConfig.stun_keepalive_interval;
90extern const int STUN_KEEPALIVE_INTERVAL;
91
92// The following constants are used at the candidate pair level to determine the
93// state of a candidate pair.
94//
95// The timeout duration when a connection does not receive anything.
96extern const int WEAK_CONNECTION_RECEIVE_TIMEOUT;
97// A connection will be declared dead if it has not received anything for this
98// long.
99extern const int DEAD_CONNECTION_RECEIVE_TIMEOUT;
100// The length of time we wait before timing out writability on a connection.
101extern const int CONNECTION_WRITE_TIMEOUT;
102// This is the length of time that we wait for a ping response to come back.
103extern const int CONNECTION_RESPONSE_TIMEOUT;
104// The minimum time we will wait before destroying a connection after creating
105// it.
106extern const int MIN_CONNECTION_LIFETIME;
Mirko Bonadei5f4d47b2018-08-22 17:41:22 +0000107
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +0000108} // namespace cricket
109
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200110#endif // P2P_BASE_P2PCONSTANTS_H_