Amazon Kinesis Webrtc C SDK
IceAgent.h
Go to the documentation of this file.
1 /*******************************************
2 IceAgent internal include file
3 *******************************************/
4 #ifndef __KINESIS_VIDEO_WEBRTC_CLIENT_ICE_AGENT__
5 #define __KINESIS_VIDEO_WEBRTC_CLIENT_ICE_AGENT__
6 
7 #pragma once
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 #define KVS_ICE_MAX_CANDIDATE_PAIR_COUNT 1024
14 #define KVS_ICE_MAX_REMOTE_CANDIDATE_COUNT 100
15 #define KVS_ICE_MAX_LOCAL_CANDIDATE_COUNT 100
16 #define KVS_ICE_GATHER_REFLEXIVE_AND_RELAYED_CANDIDATE_TIMEOUT (10 * HUNDREDS_OF_NANOS_IN_A_SECOND)
17 #define KVS_ICE_CONNECTIVITY_CHECK_TIMEOUT \
18  (12 * HUNDREDS_OF_NANOS_IN_A_SECOND) // This should be greater than KVS_ICE_GATHER_REFLEXIVE_AND_RELAYED_CANDIDATE_TIMEOUT to ensure there is
19  // buffer wait time for connectivity checks with the pairs formed with near timeout created pairs
20 #define KVS_ICE_CANDIDATE_NOMINATION_TIMEOUT \
21  (12 * HUNDREDS_OF_NANOS_IN_A_SECOND) // This should be greater than KVS_ICE_GATHER_REFLEXIVE_AND_RELAYED_CANDIDATE_TIMEOUT to ensure there is some
22  // buffer for nomination with near timeout generated candidates
23 #define KVS_ICE_SEND_KEEP_ALIVE_INTERVAL (15 * HUNDREDS_OF_NANOS_IN_A_SECOND)
24 #define KVS_ICE_TURN_CONNECTION_SHUTDOWN_TIMEOUT (1 * HUNDREDS_OF_NANOS_IN_A_SECOND)
25 #define KVS_ICE_DEFAULT_TIMER_START_DELAY (3 * HUNDREDS_OF_NANOS_IN_A_MILLISECOND)
26 #define KVS_ICE_SHORT_CHECK_DELAY (50 * HUNDREDS_OF_NANOS_IN_A_MILLISECOND)
27 
28 // Ta in https://tools.ietf.org/html/rfc8445
29 #define KVS_ICE_CONNECTION_CHECK_POLLING_INTERVAL (50 * HUNDREDS_OF_NANOS_IN_A_MILLISECOND)
30 #define KVS_ICE_STATE_READY_TIMER_POLLING_INTERVAL (1 * HUNDREDS_OF_NANOS_IN_A_SECOND)
31 /* Control the calling rate of iceCandidateGatheringTimerTask. Can affect STUN TURN candidate gathering time */
32 #define KVS_ICE_GATHER_CANDIDATE_TIMER_POLLING_INTERVAL (50 * HUNDREDS_OF_NANOS_IN_A_MILLISECOND)
33 
34 /* ICE should've received at least one keep alive within this period. Since keep alives are send every 15s */
35 #define KVS_ICE_ENTER_STATE_DISCONNECTION_GRACE_PERIOD (2 * KVS_ICE_SEND_KEEP_ALIVE_INTERVAL)
36 #define KVS_ICE_ENTER_STATE_FAILED_GRACE_PERIOD (15 * HUNDREDS_OF_NANOS_IN_A_SECOND)
37 
38 #define STUN_HEADER_MAGIC_BYTE_OFFSET 4
39 
40 #define KVS_ICE_MAX_RELAY_CANDIDATE_COUNT 4
41 #define KVS_ICE_MAX_NEW_LOCAL_CANDIDATES_TO_REPORT_AT_ONCE 10
42 
43 // https://tools.ietf.org/html/rfc5245#section-4.1.2.1
44 #define ICE_PRIORITY_HOST_CANDIDATE_TYPE_PREFERENCE 126
45 #define ICE_PRIORITY_SERVER_REFLEXIVE_CANDIDATE_TYPE_PREFERENCE 100
46 #define ICE_PRIORITY_PEER_REFLEXIVE_CANDIDATE_TYPE_PREFERENCE 110
47 #define ICE_PRIORITY_RELAYED_CANDIDATE_TYPE_PREFERENCE 0
48 #define ICE_PRIORITY_LOCAL_PREFERENCE 65535
49 
50 #define IS_STUN_PACKET(pBuf) (getInt32(*(PUINT32) ((pBuf) + STUN_HEADER_MAGIC_BYTE_OFFSET)) == STUN_HEADER_MAGIC_COOKIE)
51 #define GET_STUN_PACKET_SIZE(pBuf) ((UINT32) getInt16(*(PINT16) ((pBuf) + SIZEOF(UINT16))))
52 
53 #define IS_CANN_PAIR_SENDING_FROM_RELAYED(p) ((p)->local->iceCandidateType == ICE_CANDIDATE_TYPE_RELAYED)
54 
55 #define KVS_ICE_DEFAULT_TURN_PROTOCOL KVS_SOCKET_PROTOCOL_TCP
56 
57 #define ICE_HASH_TABLE_BUCKET_COUNT 100
58 #define ICE_HASH_TABLE_BUCKET_LENGTH 2
59 
60 #define ICE_CANDIDATE_ID_LEN 8
61 
62 #define STATS_NOT_APPLICABLE_STR (PCHAR) "N/A"
63 
64 #define ICE_STATE_MACHINE_NAME (PCHAR) "ICE"
65 
66 typedef enum {
71 
72 typedef VOID (*IceInboundPacketFunc)(UINT64, PBYTE, UINT32);
73 typedef VOID (*IceConnectionStateChangedFunc)(UINT64, UINT64);
74 typedef VOID (*IceNewLocalCandidateFunc)(UINT64, PCHAR);
75 
76 typedef struct __IceAgent IceAgent;
77 typedef struct __IceAgent* PIceAgent;
78 
82 typedef struct {
83  CHAR url[MAX_ICE_CONFIG_URI_LEN + 1];
84  CHAR protocol[MAX_PROTOCOL_LENGTH + 1];
85  INT32 port;
90 
91 typedef struct {
92  CHAR url[MAX_ICE_CONFIG_URI_LEN + 1];
94  CHAR protocol[MAX_PROTOCOL_LENGTH + 1];
95  CHAR relayProtocol[MAX_PROTOCOL_LENGTH + 1];
97  INT32 priority;
98  INT32 port;
99  CHAR candidateType[MAX_CANDIDATE_TYPE_LENGTH + 1];
101 
102 typedef struct {
103  CHAR localCandidateId[MAX_CANDIDATE_ID_LENGTH + 1];
104  CHAR remoteCandidateId[MAX_CANDIDATE_ID_LENGTH + 1];
106  BOOL nominated;
111  UINT64 packetsSent;
113  UINT64 bytesSent;
114  UINT64 bytesReceived;
134  UINT64 requestsSent;
136  UINT64 responsesSent;
139 
140 typedef struct {
141  UINT64 customData;
147 
148 typedef struct {
150  BOOL isRemote;
154  UINT32 priority;
156  UINT32 foundation;
157  /* If candidate is local and relay, then store the
158  * pTurnConnection this candidate is associated to */
160 
161  /* store pointer to iceAgent to pass it to incomingDataHandler in incomingRelayedDataHandler
162  * we pass pTurnConnectionTrack as customData to incomingRelayedDataHandler to avoid look up
163  * pTurnConnection every time. */
165 
166  /* If candidate is local. Indicate whether candidate
167  * has been reported through IceNewLocalCandidateFunc */
168  BOOL reported;
169  CHAR id[ICE_CANDIDATE_ID_LEN + 1];
172 
173 typedef struct {
176  BOOL nominated;
178  UINT64 priority;
182  PHashTable requestSentTime;
187 
188 typedef struct {
193  UINT64 iceServerParsingTime[MAX_ICE_SERVERS_COUNT];
198 
199 struct __IceAgent {
200  volatile ATOMIC_BOOL agentStartGathering;
201  volatile ATOMIC_BOOL remoteCredentialReceived;
202  volatile ATOMIC_BOOL candidateGatheringFinished;
203  volatile ATOMIC_BOOL shutdown;
204  volatile ATOMIC_BOOL restart;
205  volatile ATOMIC_BOOL processStun;
206  volatile ATOMIC_BOOL addedRelayCandidate;
207  volatile ATOMIC_BOOL stopGathering;
208 
214 
219 
221 
222  PDoubleList localCandidates;
223  PDoubleList remoteCandidates;
224  // store PIceCandidatePair which will be immediately checked for connectivity when the timer is fired.
225  PStackQueue triggeredCheckQueue;
226  PDoubleList iceCandidatePairs;
227 
230  UINT64 tieBreaker;
231 
232  MUTEX lock;
233 
234  // timer tasks
238 
239  // Current ice agent state
241  // The state machine
242  PStateMachine pStateMachine;
244  UINT64 stateEndTime;
247 
249 
252 
255 
257 
259 
260  TIMER_QUEUE_HANDLE timerQueueHandle;
264 
267 
268  // Pre-allocated stun packets
271 
272  // store transaction ids for stun binding request.
274 
278 };
279 
281 // internal functions
283 
295 STATUS createIceAgent(PCHAR, PCHAR, PIceAgentCallbacks, PRtcConfiguration, TIMER_QUEUE_HANDLE, PConnectionListener, PIceAgent*);
296 
302 STATUS freeIceAgent(PIceAgent*);
303 
313 
324 STATUS iceAgentStartAgent(PIceAgent, PCHAR, PCHAR, BOOL);
325 
334 
344 STATUS iceCandidateSerialize(PIceCandidate, PCHAR, PUINT32);
345 
355 STATUS iceAgentSendPacket(PIceAgent, PBYTE, UINT32);
356 
366 
378 
389 
401 STATUS iceAgentRestart(PIceAgent, PCHAR, PCHAR);
402 
405 
406 // Incoming data handling functions
407 STATUS incomingDataHandler(UINT64, PSocketConnection, PBYTE, UINT32, PKvsIpAddress, PKvsIpAddress);
410 
411 // IceCandidate functions
413 STATUS findCandidateWithIp(PKvsIpAddress, PDoubleList, PIceCandidate*);
415 
416 // IceCandidatePair functions
419 STATUS insertIceCandidatePair(PDoubleList, PIceCandidatePair);
423 
428 
433 
438 
439 // timer callbacks. timer callbacks are interlocked by time queue lock.
440 STATUS iceAgentStateTransitionTimerCallback(UINT32, UINT64, UINT64);
441 STATUS iceAgentSendKeepAliveTimerCallback(UINT32, UINT64, UINT64);
442 STATUS iceAgentGatherCandidateTimerCallback(UINT32, UINT64, UINT64);
443 
444 // Default time callback for the state machine
445 UINT64 iceAgentGetCurrentTime(UINT64);
446 
450 STATUS iceAgentFatalError(PIceAgent, STATUS);
452 
457 
459 
460 #ifdef __cplusplus
461 }
462 #endif
463 #endif /* __KINESIS_VIDEO_WEBRTC_CLIENT_ICE_AGENT__ */
STATUS iceAgentGatherCandidateTimerCallback(UINT32, UINT64, UINT64)
Definition: IceAgent.c:1594
STATUS iceAgentSendKeepAliveTimerCallback(UINT32, UINT64, UINT64)
Definition: IceAgent.c:1552
struct IceAgentCallbacks * PIceAgentCallbacks
STATUS iceAgentInitRelayCandidate(PIceAgent, UINT32, KVS_SOCKET_PROTOCOL)
Definition: IceAgent.c:1878
STATUS iceAgentConnectedStateSetup(PIceAgent)
Definition: IceAgent.c:2080
STATUS iceAgentSendPacket(PIceAgent, PBYTE, UINT32)
Definition: IceAgent.c:664
STATUS pruneUnconnectedIceCandidatePair(PIceAgent)
Definition: IceAgent.c:1267
VOID(* IceConnectionStateChangedFunc)(UINT64, UINT64)
Definition: IceAgent.h:73
STATUS freeIceAgent(PIceAgent *)
Definition: IceAgent.c:169
UINT64 computeCandidatePairPriority(PIceCandidatePair, BOOL)
Definition: IceAgent.c:2895
struct RtcIceServerDiagnostics * PRtcIceServerDiagnostics
STATUS iceCandidatePairCheckConnection(PStunPacket, PIceAgent, PIceCandidatePair)
Definition: IceAgent.c:1300
ICE_CANDIDATE_STATE
Definition: IceAgent.h:66
@ ICE_CANDIDATE_STATE_INVALID
Definition: IceAgent.h:69
@ ICE_CANDIDATE_STATE_NEW
Definition: IceAgent.h:67
@ ICE_CANDIDATE_STATE_VALID
Definition: IceAgent.h:68
STATUS iceAgentInvalidateCandidatePair(PIceAgent)
Definition: IceAgent.c:2349
STATUS iceAgentShutdown(PIceAgent)
Definition: IceAgent.c:782
#define ICE_CANDIDATE_ID_LEN
Definition: IceAgent.h:60
STATUS iceAgentSendCandidateNomination(PIceAgent)
Definition: IceAgent.c:1696
STATUS iceCandidateSerialize(PIceCandidate, PCHAR, PUINT32)
Definition: IceAgent.c:2456
STATUS incomingDataHandler(UINT64, PSocketConnection, PBYTE, UINT32, PKvsIpAddress, PKvsIpAddress)
Definition: IceAgent.c:2402
STATUS iceAgentPopulateSdpMediaDescriptionCandidates(PIceAgent, PSdpMediaDescription, UINT32, PUINT32)
Definition: IceAgent.c:742
STATUS getIceAgentStats(PIceAgent, PKvsIceAgentMetrics)
Definition: IceAgent.c:2932
STATUS iceAgentValidateKvsRtcConfig(PKvsRtcConfiguration)
Definition: IceAgent.c:292
STATUS updateCandidateAddress(PIceCandidate, PKvsIpAddress)
Definition: IceAgent.c:2845
STATUS iceAgentReadyStateSetup(PIceAgent)
Definition: IceAgent.c:2193
STATUS freeIceCandidatePair(PIceCandidatePair *)
Definition: IceAgent.c:1173
STATUS findCandidateWithIp(PKvsIpAddress, PDoubleList, PIceCandidate *)
Definition: IceAgent.c:1005
struct IceAgentProfileDiagnostics * PIceAgentProfileDiagnostics
VOID(* IceInboundPacketFunc)(UINT64, PBYTE, UINT32)
Definition: IceAgent.h:72
UINT32 computeCandidatePriority(PIceCandidate)
Definition: IceAgent.c:2861
VOID iceAgentLogNewCandidate(PIceCandidate)
Definition: IceAgent.c:2817
VOID(* IceNewLocalCandidateFunc)(UINT64, PCHAR)
Definition: IceAgent.h:74
struct RtcIceCandidatePairDiagnostics * PRtcIceCandidatePairDiagnostics
STATUS iceAgentCheckConnectionStateSetup(PIceAgent)
Definition: IceAgent.c:1965
struct IceCandidatePair * PIceCandidatePair
STATUS findIceCandidatePairWithLocalSocketConnectionAndRemoteAddr(PIceAgent, PSocketConnection, PKvsIpAddress, BOOL, PIceCandidatePair *)
Definition: IceAgent.c:1230
STATUS createIceAgent(PCHAR, PCHAR, PIceAgentCallbacks, PRtcConfiguration, TIMER_QUEUE_HANDLE, PConnectionListener, PIceAgent *)
Definition: IceAgent.c:24
struct IceCandidate * PIceCandidate
STATUS iceAgentInitRelayCandidates(PIceAgent)
Definition: IceAgent.c:1830
STATUS updateSelectedLocalRemoteCandidateStats(PIceAgent)
Definition: IceAgent.c:2068
STATUS insertIceCandidatePair(PDoubleList, PIceCandidatePair)
Definition: IceAgent.c:1195
STATUS iceAgentSendSrflxCandidateRequest(PIceAgent)
Definition: IceAgent.c:1434
STATUS findCandidateWithSocketConnection(PSocketConnection, PDoubleList, PIceCandidate *)
Definition: IceAgent.c:1040
STATUS iceAgentStateTransitionTimerCallback(UINT32, UINT64, UINT64)
Definition: IceAgent.c:1409
STATUS iceAgentStartGathering(PIceAgent)
Definition: IceAgent.c:619
STATUS iceAgentInitSrflxCandidate(PIceAgent)
Definition: IceAgent.c:1736
struct __IceAgent * PIceAgent
Definition: IceAgent.h:77
PCHAR iceAgentGetCandidateTypeStr(ICE_CANDIDATE_TYPE)
Definition: IceAgent.c:2911
STATUS iceAgentInitHostCandidate(PIceAgent)
Definition: IceAgent.c:494
STATUS createIceCandidatePairs(PIceAgent, PIceCandidate, BOOL)
Definition: IceAgent.c:1075
STATUS iceAgentSendStunPacket(PStunPacket, PBYTE, UINT32, PIceAgent, PIceCandidate, PKvsIpAddress)
Definition: IceAgent.c:1350
STATUS iceAgentFatalError(PIceAgent, STATUS)
Definition: IceAgent.c:2803
STATUS handleStunPacket(PIceAgent, PBYTE, UINT32, PSocketConnection, PKvsIpAddress, PKvsIpAddress)
Definition: IceAgent.c:2497
STATUS iceAgentAddRemoteCandidate(PIceAgent, PCHAR)
Definition: IceAgent.c:352
STATUS iceAgentNominatingStateSetup(PIceAgent)
Definition: IceAgent.c:2150
STATUS iceAgentCheckCandidatePairConnection(PIceAgent)
Definition: IceAgent.c:1497
STATUS incomingRelayedDataHandler(UINT64, PSocketConnection, PBYTE, UINT32, PKvsIpAddress, PKvsIpAddress)
Definition: IceAgent.c:2378
STATUS iceAgentStartAgent(PIceAgent, PCHAR, PCHAR, BOOL)
Definition: IceAgent.c:571
STATUS iceAgentCheckPeerReflexiveCandidate(PIceAgent, PKvsIpAddress, UINT32, BOOL, PSocketConnection)
Definition: IceAgent.c:2745
UINT64 iceAgentGetCurrentTime(UINT64)
Definition: IceAgent.c:2926
struct RtcIceCandidateDiagnostics * PRtcIceCandidateDiagnostics
STATUS iceAgentRestart(PIceAgent, PCHAR, PCHAR)
Definition: IceAgent.c:862
STATUS iceAgentReportNewLocalCandidate(PIceAgent, PIceCandidate)
Definition: IceAgent.c:328
STATUS iceAgentNominateCandidatePair(PIceAgent)
Definition: IceAgent.c:2290
STATUS(* IceServerSetIpFunc)(UINT64, PCHAR, PKvsIpAddress)
Definition: Include_i.h:111
#define MAX_LOCAL_NETWORK_INTERFACE_COUNT
Definition: Network.h:13
KVS_SOCKET_PROTOCOL
Definition: Network.h:48
#define KVS_IP_ADDRESS_STRING_BUFFER_LEN
Definition: Network.h:18
#define MAX_CANDIDATE_TYPE_LENGTH
Definition: Stats.h:76
ICE_CANDIDATE_PAIR_STATE
Indicates computing states in the checklist Reference: https://www.w3.org/TR/webrtc-stats/#rtcstatsic...
Definition: Stats.h:137
ICE_CANDIDATE_TYPE
Definition: Stats.h:97
#define MAX_ICE_SERVERS_COUNT
Definition: Include.h:622
#define MAX_ICE_CONFIG_CREDENTIAL_LEN
Definition: Include.h:456
#define MAX_ICE_CONFIG_USER_NAME_LEN
Definition: Include.h:450
ICE_TRANSPORT_POLICY
ICE_TRANSPORT_POLICY restrict which ICE candidates are used in a session.
Definition: Include.h:843
#define MAX_ICE_CONFIG_URI_LEN
Definition: Stats.h:30
#define MAX_PROTOCOL_LENGTH
Definition: Stats.h:60
#define MAX_CANDIDATE_ID_LENGTH
Definition: Stats.h:25
Definition: ConnectionListener.h:19
Definition: IceAgent.h:140
IceNewLocalCandidateFunc newLocalCandidateFn
Definition: IceAgent.h:144
IceInboundPacketFunc inboundPacketFn
Definition: IceAgent.h:142
UINT64 customData
Definition: IceAgent.h:141
IceServerSetIpFunc setStunServerIpFn
Definition: IceAgent.h:145
IceConnectionStateChangedFunc connectionStateChangedFn
Definition: IceAgent.h:143
Definition: IceAgent.h:188
UINT64 relayCandidateSetUpTime
Definition: IceAgent.h:192
UINT64 localCandidateGatheringTime
Definition: IceAgent.h:189
UINT64 candidateGatheringTime
Definition: IceAgent.h:195
UINT64 hostCandidateSetUpTime
Definition: IceAgent.h:190
UINT64 srflxCandidateSetUpTime
Definition: IceAgent.h:191
UINT64 iceAgentSetUpTime
Definition: IceAgent.h:196
UINT64 iceCandidatePairNominationTime
Definition: IceAgent.h:194
Definition: IceAgent.h:173
PTransactionIdStore pTransactionIdStore
Definition: IceAgent.h:180
UINT64 roundTripTime
Definition: IceAgent.h:183
PIceCandidate local
Definition: IceAgent.h:174
PHashTable requestSentTime
Definition: IceAgent.h:182
UINT64 responsesReceived
Definition: IceAgent.h:184
BOOL firstStunRequest
Definition: IceAgent.h:177
ICE_CANDIDATE_PAIR_STATE state
Definition: IceAgent.h:179
PIceCandidate remote
Definition: IceAgent.h:175
PRtcIceCandidatePairDiagnostics pRtcIceCandidatePairDiagnostics
Definition: IceAgent.h:185
UINT64 lastDataSentTime
Definition: IceAgent.h:181
BOOL nominated
Definition: IceAgent.h:176
UINT64 priority
Definition: IceAgent.h:178
Definition: IceAgent.h:148
PSocketConnection pSocketConnection
Definition: IceAgent.h:152
BOOL reported
Definition: IceAgent.h:168
UINT32 iceServerIndex
Definition: IceAgent.h:155
KvsIpAddress ipAddress
Definition: IceAgent.h:151
UINT32 priority
Definition: IceAgent.h:154
struct __TurnConnection * pTurnConnection
Definition: IceAgent.h:159
BOOL isRemote
Definition: IceAgent.h:150
KVS_SOCKET_PROTOCOL remoteProtocol
Definition: IceAgent.h:170
UINT32 foundation
Definition: IceAgent.h:156
PIceAgent pIceAgent
Definition: IceAgent.h:164
ICE_CANDIDATE_TYPE iceCandidateType
Definition: IceAgent.h:149
ICE_CANDIDATE_STATE state
Definition: IceAgent.h:153
Definition: IceUtils.h:53
KVS ICE Agent Collection of ICE agent related stats. Can be expanded in the future.
Definition: Include.h:1564
Definition: Include_i.h:99
Definition: Include.h:1166
Custom data type to allow setting UINT32 data type to NULL since C does not support setting basic dat...
Definition: NullableDefs.h:105
The Configuration defines a set of parameters to configure how the peer-to-peer communication establi...
Definition: Include.h:1214
Definition: IceAgent.h:91
INT32 priority
Computed using the formula in https://tools.ietf.org/html/rfc5245#section-15.1.
Definition: IceAgent.h:97
INT32 port
Port number of the candidate.
Definition: IceAgent.h:98
Definition: IceAgent.h:102
BOOL nominated
Definition: IceAgent.h:106
UINT64 bytesReceived
Total number of bytes (minus header and padding) received on this candidate pair.
Definition: IceAgent.h:114
UINT64 bytesDiscardedOnSend
Total number of bytes for this candidate pair discarded due to socket errors.
Definition: IceAgent.h:137
ICE_CANDIDATE_PAIR_STATE state
State of checklist for the local-remote candidate pair.
Definition: IceAgent.h:105
UINT64 lastRequestTimestamp
Definition: IceAgent.h:120
UINT64 lastResponseTimestamp
Represents the timestamp at which the last STUN response was received on this particular candidate pa...
Definition: IceAgent.h:123
UINT64 lastPacketReceivedTimestamp
Definition: IceAgent.h:117
UINT64 requestsSent
The total number of connectivity check requests sent (without retransmissions).
Definition: IceAgent.h:134
NullableUint32 circuitBreakerTriggerCount
Definition: IceAgent.h:108
UINT64 bytesSent
Total number of bytes (minus header and padding) sent on this candidate pair.
Definition: IceAgent.h:113
DOUBLE availableOutgoingBitrate
Definition: IceAgent.h:129
DOUBLE currentRoundTripTime
Latest round trip time (seconds)
Definition: IceAgent.h:128
UINT64 requestsReceived
Total number of connectivity check requests received (including retransmission)
Definition: IceAgent.h:133
UINT64 lastPacketSentTimestamp
Definition: IceAgent.h:115
UINT32 packetsDiscardedOnSend
Total number of packets discarded for candidate pair due to socket errors,.
Definition: IceAgent.h:110
DOUBLE totalRoundTripTime
Definition: IceAgent.h:124
UINT64 packetsReceived
Total number of packets received on this candidate pair.
Definition: IceAgent.h:112
UINT64 responsesReceived
The total number of connectivity check responses received.
Definition: IceAgent.h:135
UINT64 firstRequestTimestamp
Represents the timestamp at which the first STUN request was sent on this particular candidate pair.
Definition: IceAgent.h:119
UINT64 packetsSent
Total number of packets sent on this candidate pair;.
Definition: IceAgent.h:111
DOUBLE availableIncomingBitrate
Definition: IceAgent.h:131
UINT64 responsesSent
The total number of connectivity check responses sent.
Definition: IceAgent.h:136
Definition: IceAgent.h:82
UINT64 totalRoundTripTime
Sum of RTTs of all the requests for which response has been received.
Definition: IceAgent.h:88
UINT64 totalResponsesReceived
Total number of responses received from the server.
Definition: IceAgent.h:87
UINT64 totalRequestsSent
Total amount of requests that have been sent to the server.
Definition: IceAgent.h:86
INT32 port
Port number used by client.
Definition: IceAgent.h:85
Definition: Sdp.h:163
Definition: Stun.h:357
Definition: IceUtils.h:31
Definition: IceAgent.h:199
volatile ATOMIC_BOOL restart
Definition: IceAgent.h:204
volatile ATOMIC_BOOL agentStartGathering
Definition: IceAgent.h:200
ICE_TRANSPORT_POLICY iceTransportPolicy
Definition: IceAgent.h:265
KvsIpAddress localNetworkInterfaces[MAX_LOCAL_NETWORK_INTERFACE_COUNT]
Definition: IceAgent.h:253
UINT32 iceAgentStateTimerTask
Definition: IceAgent.h:235
UINT64 lastDataReceivedTime
Definition: IceAgent.h:261
TIMER_QUEUE_HANDLE timerQueueHandle
Definition: IceAgent.h:260
PStunPacket pBindingIndication
Definition: IceAgent.h:269
BOOL isControlling
Definition: IceAgent.h:229
UINT64 iceAgentState
Definition: IceAgent.h:240
PIceCandidatePair pDataSendingIceCandidatePair
Definition: IceAgent.h:246
BOOL detectedDisconnection
Definition: IceAgent.h:262
CHAR combinedUserName[(MAX_ICE_CONFIG_USER_NAME_LEN+1)<< 1]
the combination of remote user name and local user name.
Definition: IceAgent.h:213
PTransactionIdStore pStunBindingRequestTransactionIdStore
Definition: IceAgent.h:273
PDoubleList localCandidates
Definition: IceAgent.h:222
MUTEX lock
Definition: IceAgent.h:232
CHAR localPassword[MAX_ICE_CONFIG_CREDENTIAL_LEN+1]
Definition: IceAgent.h:210
UINT32 relayCandidateCount
Definition: IceAgent.h:258
volatile ATOMIC_BOOL shutdown
Definition: IceAgent.h:203
PDoubleList iceCandidatePairs
Definition: IceAgent.h:226
PRtcIceCandidateDiagnostics pRtcSelectedLocalIceCandidateDiagnostics
Definition: IceAgent.h:216
UINT32 keepAliveTimerTask
Definition: IceAgent.h:236
PStateMachine pStateMachine
Definition: IceAgent.h:242
PHashTable requestTimestampDiagnostics
Definition: IceAgent.h:220
PStackQueue triggeredCheckQueue
Definition: IceAgent.h:225
KvsRtcConfiguration kvsRtcConfiguration
Definition: IceAgent.h:266
volatile ATOMIC_BOOL addedRelayCandidate
Definition: IceAgent.h:206
volatile ATOMIC_BOOL processStun
Definition: IceAgent.h:205
UINT64 iceAgentStartTime
Definition: IceAgent.h:277
UINT32 foundationCounter
Definition: IceAgent.h:256
UINT64 tieBreaker
Definition: IceAgent.h:230
STATUS iceAgentStatus
Definition: IceAgent.h:243
CHAR remoteUsername[MAX_ICE_CONFIG_USER_NAME_LEN+1]
Definition: IceAgent.h:211
UINT64 disconnectionGracePeriodEndTime
Definition: IceAgent.h:263
volatile ATOMIC_BOOL stopGathering
Definition: IceAgent.h:207
PStunPacket pBindingRequest
Definition: IceAgent.h:270
UINT64 candidateGatheringProcessEndTime
Definition: IceAgent.h:276
PRtcIceCandidateDiagnostics pRtcSelectedRemoteIceCandidateDiagnostics
Definition: IceAgent.h:217
volatile ATOMIC_BOOL candidateGatheringFinished
Definition: IceAgent.h:202
IceAgentCallbacks iceAgentCallbacks
Definition: IceAgent.h:248
UINT64 stateEndTime
Definition: IceAgent.h:244
PDoubleList remoteCandidates
Definition: IceAgent.h:223
PConnectionListener pConnectionListener
Definition: IceAgent.h:228
UINT32 iceCandidateGatheringTimerTask
Definition: IceAgent.h:237
UINT64 candidateGatheringStartTime
Definition: IceAgent.h:275
UINT32 iceServersCount
Definition: IceAgent.h:251
IceAgentProfileDiagnostics iceAgentProfileDiagnostics
Definition: IceAgent.h:218
CHAR remotePassword[MAX_ICE_CONFIG_CREDENTIAL_LEN+1]
Definition: IceAgent.h:212
IceServer iceServers[MAX_ICE_SERVERS_COUNT]
Definition: IceAgent.h:250
UINT32 localNetworkInterfaceCount
Definition: IceAgent.h:254
volatile ATOMIC_BOOL remoteCredentialReceived
Definition: IceAgent.h:201
CHAR localUsername[MAX_ICE_CONFIG_USER_NAME_LEN+1]
Definition: IceAgent.h:209
PRtcIceServerDiagnostics pRtcIceServerDiagnostics[MAX_ICE_SERVERS_COUNT]
Definition: IceAgent.h:215
UINT64 candidateGatheringEndTime
Definition: IceAgent.h:245
Definition: SocketConnection.h:25
Definition: TurnConnection.h:119