4#ifndef __KINESIS_VIDEO_WEBRTC_CLIENT_INCLUDE_I__
5#define __KINESIS_VIDEO_WEBRTC_CLIENT_INCLUDE_I__
30#include <openssl/bio.h>
31#include <openssl/err.h>
32#include <openssl/hmac.h>
33#include <openssl/md5.h>
34#include <openssl/rand.h>
35#include <openssl/sha.h>
36#include <openssl/ssl.h>
50#if __has_include(<mbedtls/build_info.h>)
51#include <mbedtls/build_info.h>
53#include <mbedtls/version.h>
56#include <mbedtls/version.h>
58#if defined(MBEDTLS_VERSION_NUMBER) && MBEDTLS_VERSION_MAJOR >= 4
59#define MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS
61#include <mbedtls/ssl.h>
62#include <mbedtls/error.h>
63#if defined(MBEDTLS_VERSION_NUMBER) && MBEDTLS_VERSION_MAJOR >= 4
64#include <mbedtls/private/entropy.h>
65#include <mbedtls/private/ctr_drbg.h>
66#include <mbedtls/md.h>
67#include <mbedtls/pk.h>
68#include <mbedtls/private/rsa.h>
69#include <mbedtls/private/ecp.h>
70#include <mbedtls/private/bignum.h>
72#include <mbedtls/entropy.h>
73#include <mbedtls/ctr_drbg.h>
74#if MBEDTLS_VERSION_NUMBER < 0x03000000
75#include <mbedtls/certs.h>
77#include <mbedtls/md.h>
81#if MBEDTLS_VERSION_MAJOR < 4 && !(defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_CTR_DRBG_C))
82#error "Building without MBEDTLS_ENTROPY_C/MBEDTLS_CTR_DRBG_C requires mbedTLS 4"
87#include <srtp3/srtp.h>
89#include <srtp2/srtp.h>
98#if !defined __WINDOWS_BUILD__
100#include <sys/types.h>
104#include <sys/types.h>
105#include <sys/socket.h>
108#include <arpa/inet.h>
110#include <netinet/tcp.h>
117#define ICE_MAX_UFRAG_LEN 256
118#define ICE_MAX_UPWD_LEN 256
121#define STUN_MAX_USERNAME_LEN (UINT16) 512
124#define STUN_MAX_REALM_LEN (UINT16) 128
127#define STUN_MAX_NONCE_LEN (UINT16) 128
130#define STUN_MAX_ERROR_PHRASE_LEN (UINT16) 128
133#define IPV6_ADDRESS_LENGTH (UINT16) 16
134#define IPV4_ADDRESS_LENGTH (UINT16) 4
136#define CERTIFICATE_FINGERPRINT_LENGTH 160
138#define MAX_UDP_PACKET_SIZE 65507
173static inline BOOL IS_NON_ROUTABLE_ADDR(
const PKvsIpAddress pAddress)
177 if (pAddress == NULL) {
182 if (IS_IPV6_ADDR(pAddress)) {
185 BOOL allZeroButLast = TRUE;
187 if (a[0] == 0xfe && (a[1] & 0xc0) == 0x80) {
190 if ((a[0] & 0xfe) == 0xfc) {
193 if (a[0] == 0x20 && a[1] == 0x01 && a[2] == 0x0d && a[3] == 0xb8) {
196 for (i = 0; i < 15; ++i) {
198 allZeroButLast = FALSE;
202 if (allZeroButLast && (a[15] == 0 || a[15] == 1)) {
210 if (!IS_IPV4_ADDR(pAddress)) {
224 if (b0 == 100 && b1 >= 64 && b1 <= 127) {
230 if (b0 == 169 && b1 == 254) {
233 if (b0 == 172 && b1 >= 16 && b1 <= 31) {
236 if (b0 == 192 && b1 == 0 && b2 == 0) {
239 if (b0 == 192 && b1 == 0 && b2 == 2) {
242 if (b0 == 192 && b1 == 88 && b2 == 99) {
245 if (b0 == 192 && b1 == 168) {
248 if (b0 == 198 && (b1 == 18 || b1 == 19)) {
251 if (b0 == 198 && b1 == 51 && b2 == 100) {
254 if (b0 == 203 && b1 == 0 && b2 == 113) {
265#define ALIGN_UP_TO_MACHINE_WORD(x) ROUND_UP((x), SIZEOF(SIZE_T))
329#define KVS_CONVERT_TIMESCALE(pts, from_timescale, to_timescale) (pts * to_timescale / from_timescale)
KVS_IP_FAMILY_TYPE
Definition Include_i.h:140
@ KVS_IP_FAMILY_TYPE_IPV4
Definition Include_i.h:142
@ KVS_IP_FAMILY_TYPE_NOT_SET
Definition Include_i.h:141
@ KVS_IP_FAMILY_TYPE_IPV6
Definition Include_i.h:143
#define IPV6_ADDRESS_LENGTH
Definition Include_i.h:133
STATUS generateJSONSafeString(PCHAR, UINT32)
Definition PeerConnection.c:715
struct DualKvsIpAddresses * PDualKvsIpAddresses
struct KvsIpAddress * PKvsIpAddress
STATUS getIpAddrStr(PKvsIpAddress pKvsIpAddress, PCHAR pBuffer, UINT32 bufferLen)
Definition Network.c:636
STATUS(* IceServerSetIpFunc)(UINT64, PCHAR, PDualKvsIpAddresses)
Definition Include_i.h:267
Definition Include_i.h:154
KvsIpAddress ipv4Address
Definition Include_i.h:155
KvsIpAddress ipv6Address
Definition Include_i.h:156
Definition Include_i.h:146
UINT16 port
Definition Include_i.h:148
BYTE address[(UINT16) 16]
Definition Include_i.h:149
BOOL isPointToPoint
Definition Include_i.h:150
UINT16 family
Definition Include_i.h:147
Definition SocketConnection.h:25
Definition TurnConnection.h:119