diff --git a/src/include/com/amazonaws/kinesis/video/webrtcclient/Include.h b/src/include/com/amazonaws/kinesis/video/webrtcclient/Include.h index 5d3da7659c..535e34509f 100644 --- a/src/include/com/amazonaws/kinesis/video/webrtcclient/Include.h +++ b/src/include/com/amazonaws/kinesis/video/webrtcclient/Include.h @@ -460,11 +460,6 @@ extern "C" { */ #define MAX_SIGNALING_ENDPOINT_URI_LEN 512 -/** - * Maximum allowed ICE URI length - */ -#define MAX_ICE_CONFIG_URI_LEN 256 - /** * Maximum allowed correlation ID length */ diff --git a/src/include/com/amazonaws/kinesis/video/webrtcclient/Stats.h b/src/include/com/amazonaws/kinesis/video/webrtcclient/Stats.h index 72fffb67ba..5f555b793c 100644 --- a/src/include/com/amazonaws/kinesis/video/webrtcclient/Stats.h +++ b/src/include/com/amazonaws/kinesis/video/webrtcclient/Stats.h @@ -24,6 +24,11 @@ extern "C" { */ #define MAX_CANDIDATE_ID_LENGTH 9U +/** + * Maximum allowed ICE URI length + */ +#define MAX_ICE_CONFIG_URI_LEN 256 + /** * Maximum allowed relay protocol length */ @@ -65,6 +70,12 @@ extern "C" { #define MAX_STATS_STRING_LENGTH 255U /*!@} */ +/** + * Maximum length of candidate type (host, srflx, relay, prflx, unknown) + */ +#define MAX_CANDIDATE_TYPE_LENGTH 10U +/*!@} */ + /** * @brief DOMString type is used to store strings of size 256 bytes (inclusive of '\0' character * @@ -233,8 +244,8 @@ typedef struct { * Reference: https://www.w3.org/TR/webrtc-stats/#ice-server-dict* */ typedef struct { - DOMString url; //!< STUN/TURN server URL - DOMString protocol; //!< Valid values: UDP, TCP + CHAR url[MAX_ICE_CONFIG_URI_LEN + 1]; //!< STUN/TURN server URL + CHAR protocol[MAX_PROTOCOL_LENGTH + 1]; //!< Valid values: UDP, TCP UINT32 iceServerIndex; //!< Ice server index to get stats from. Not available in spec! Needs to be //!< populated by the application to get specific server stats INT32 port; //!< Port number used by client @@ -268,14 +279,13 @@ typedef struct { typedef struct { DOMString url; //!< For local candidates this is the URL of the ICE server from which the candidate was obtained - DOMString transportId; //!< Not used currently. ID of object that was inspected for RTCTransportStats CHAR address[IP_ADDR_STR_LENGTH + 1]; //!< IPv4 or IPv6 address of the candidate - DOMString protocol; //!< Valid values: UDP, TCP - DOMString relayProtocol; //!< Protocol used by endpoint to communicate with TURN server. (Only for local candidate) + CHAR protocol[MAX_PROTOCOL_LENGTH + 1]; //!< Valid values: UDP, TCP + CHAR relayProtocol[MAX_PROTOCOL_LENGTH + 1]; //!< Protocol used by endpoint to communicate with TURN server. (Only for local candidate) //!< Valid values: UDP, TCP, TLS INT32 priority; //!< Computed using the formula in https://tools.ietf.org/html/rfc5245#section-15.1 INT32 port; //!< Port number of the candidate - DOMString candidateType; //!< Type of local/remote ICE candidate + CHAR candidateType[MAX_CANDIDATE_TYPE_LENGTH + 1]; //!< Type of local/remote ICE candidate } RtcIceCandidateStats, *PRtcIceCandidateStats; /** diff --git a/src/source/Ice/IceAgent.h b/src/source/Ice/IceAgent.h index 098b5ca222..e58445a0e1 100644 --- a/src/source/Ice/IceAgent.h +++ b/src/source/Ice/IceAgent.h @@ -90,14 +90,13 @@ typedef struct { typedef struct { DOMString url; //!< For local candidates this is the URL of the ICE server from which the candidate was obtained - DOMString transportId[MAX_STATS_STRING_LENGTH + 1]; //!< ID of object that was inspected for RTCTransportStats CHAR address[KVS_IP_ADDRESS_STRING_BUFFER_LEN]; //!< IPv4 or IPv6 address of the candidate - DOMString protocol; //!< Valid values: UDP, TCP - DOMString relayProtocol; //!< Protocol used by endpoint to communicate with TURN server. + CHAR protocol[MAX_PROTOCOL_LENGTH + 1]; //!< Valid values: UDP, TCP + CHAR relayProtocol[MAX_PROTOCOL_LENGTH + 1]; //!< Protocol used by endpoint to communicate with TURN server. //!< Valid values: UDP, TCP, TLS INT32 priority; //!< Computed using the formula in https://tools.ietf.org/html/rfc5245#section-15.1 INT32 port; //!< Port number of the candidate - DOMString candidateType; //!< Type of local/remote ICE candidate + CHAR candidateType[MAX_CANDIDATE_TYPE_LENGTH + 1] //!< Type of local/remote ICE candidate } RtcIceCandidateDiagnostics, *PRtcIceCandidateDiagnostics; typedef struct {