Amazon Kinesis Producer C SDK
Include.h File Reference
#include <com/amazonaws/kinesis/video/client/Include.h>
#include <com/amazonaws/kinesis/video/common/jsmn.h>
Include dependency graph for Include.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __AwsCredentials
 
struct  __RequestHeader
 
struct  __RequestInfo
 
struct  __CallInfo
 
struct  __AwsCredentialProvider
 

Macros

#define JSMN_HEADER
 
#define STATUS_COMMON_PRODUCER_BASE   0x15000000
 
#define STATUS_INVALID_AWS_CREDENTIALS_VERSION   STATUS_COMMON_PRODUCER_BASE + 0x00000008
 
#define STATUS_MAX_REQUEST_HEADER_COUNT   STATUS_COMMON_PRODUCER_BASE + 0x00000009
 
#define STATUS_MAX_REQUEST_HEADER_NAME_LEN   STATUS_COMMON_PRODUCER_BASE + 0x0000000a
 
#define STATUS_MAX_REQUEST_HEADER_VALUE_LEN   STATUS_COMMON_PRODUCER_BASE + 0x0000000b
 
#define STATUS_INVALID_API_CALL_RETURN_JSON   STATUS_COMMON_PRODUCER_BASE + 0x0000000c
 
#define STATUS_CURL_INIT_FAILED   STATUS_COMMON_PRODUCER_BASE + 0x0000000d
 
#define STATUS_CURL_LIBRARY_INIT_FAILED   STATUS_COMMON_PRODUCER_BASE + 0x0000000e
 
#define STATUS_HMAC_GENERATION_ERROR   STATUS_COMMON_PRODUCER_BASE + 0x00000010
 
#define STATUS_IOT_FAILED   STATUS_COMMON_PRODUCER_BASE + 0x00000011
 
#define STATUS_MAX_ROLE_ALIAS_LEN_EXCEEDED   STATUS_COMMON_PRODUCER_BASE + 0x00000012
 
#define STATUS_INVALID_USER_AGENT_LENGTH   STATUS_COMMON_PRODUCER_BASE + 0x00000015
 
#define STATUS_IOT_EXPIRATION_OCCURS_IN_PAST   STATUS_COMMON_PRODUCER_BASE + 0x00000017
 
#define STATUS_IOT_EXPIRATION_PARSING_FAILED   STATUS_COMMON_PRODUCER_BASE + 0x00000018
 
#define STATUS_MAX_IOT_THING_NAME_LENGTH   STATUS_COMMON_PRODUCER_BASE + 0x0000001e
 
#define STATUS_IOT_CREATE_LWS_CONTEXT_FAILED   STATUS_COMMON_PRODUCER_BASE + 0x0000001f
 
#define STATUS_INVALID_CA_CERT_PATH   STATUS_COMMON_PRODUCER_BASE + 0x00000020
 
#define STATUS_FILE_CREDENTIAL_PROVIDER_OPEN_FILE_FAILED   STATUS_COMMON_PRODUCER_BASE + 0x00000022
 
#define STATUS_FILE_CREDENTIAL_PROVIDER_INVALID_FILE_LENGTH   STATUS_COMMON_PRODUCER_BASE + 0x00000023
 
#define STATUS_FILE_CREDENTIAL_PROVIDER_INVALID_FILE_FORMAT   STATUS_COMMON_PRODUCER_BASE + 0x00000024
 
#define STATUS_COMMON_BASE   0x16000000
 
#define STATUS_CURL_PERFORM_FAILED   STATUS_COMMON_BASE + 0x00000001
 
#define STATUS_IOT_INVALID_RESPONSE_LENGTH   STATUS_COMMON_BASE + 0x00000002
 
#define STATUS_IOT_NULL_AWS_CREDS   STATUS_COMMON_BASE + 0x00000003
 
#define STATUS_IOT_INVALID_URI_LEN   STATUS_COMMON_BASE + 0x00000004
 
#define STATUS_TIMESTAMP_STRING_UNRECOGNIZED_FORMAT   STATUS_COMMON_BASE + 0x00000005
 
#define IS_RETRIABLE_COMMON_LIB_ERROR(error)
 
#define MAX_REGION_NAME_LEN   128
 
#define MAX_USER_AGENT_LEN   256
 
#define MAX_CUSTOM_USER_AGENT_LEN   128
 
#define MAX_CUSTOM_USER_AGENT_NAME_POSTFIX_LEN   32
 
#define MAX_ACCESS_KEY_LEN   128
 
#define MAX_SECRET_KEY_LEN   128
 
#define MAX_SESSION_TOKEN_LEN   2048
 
#define MAX_EXPIRATION_LEN   128
 
#define MAX_ROLE_ALIAS_LEN   128
 
#define MAX_IOT_THING_NAME_LEN   128
 
#define MAX_REQUEST_HEADER_NAME_LEN   128
 
#define MAX_REQUEST_HEADER_VALUE_LEN   2048
 
#define MAX_REQUEST_HEADER_STRING_LEN   (MAX_REQUEST_HEADER_NAME_LEN + MAX_REQUEST_HEADER_VALUE_LEN + 3)
 
#define MAX_CREDENTIAL_FILE_LEN   MAX_AUTH_LEN
 
#define CALL_INFO_ERROR_BUFFER_LEN   256
 
#define MAX_JSON_PARAMETER_STRING_LEN   (10 * 1024)
 
#define DEFAULT_VIDEO_TRACK_ID   1
 
#define DEFAULT_AUDIO_TRACK_ID   2
 
#define DEFAULT_AUDIO_ONLY_TRACK_ID   1
 
#define DEFAULT_ENDPOINT_CACHE_UPDATE_PERIOD   (40 * HUNDREDS_OF_NANOS_IN_A_MINUTE)
 
#define ENDPOINT_UPDATE_PERIOD_SENTINEL_VALUE   0
 
#define MAX_ENDPOINT_CACHE_UPDATE_PERIOD   (24 * HUNDREDS_OF_NANOS_IN_AN_HOUR)
 
#define ACCESS_KEY_ENV_VAR   ((PCHAR) "AWS_ACCESS_KEY_ID")
 
#define SECRET_KEY_ENV_VAR   ((PCHAR) "AWS_SECRET_ACCESS_KEY")
 
#define SESSION_TOKEN_ENV_VAR   ((PCHAR) "AWS_SESSION_TOKEN")
 
#define DEFAULT_REGION_ENV_VAR   ((PCHAR) "AWS_DEFAULT_REGION")
 
#define CACERT_PATH_ENV_VAR   ((PCHAR) "AWS_KVS_CACERT_PATH")
 
#define DEBUG_LOG_LEVEL_ENV_VAR   ((PCHAR) "AWS_KVS_LOG_LEVEL")
 
#define ENABLE_FILE_LOGGING   ((PCHAR) "AWS_ENABLE_FILE_LOGGING")
 
#define DEFAULT_KVS_CACERT_PATH   EMPTY_STRING
 
#define HTTPS_SCHEME_NAME   "https"
 
#define WSS_SCHEME_NAME   "wss"
 
#define HTTP_REQUEST_VERB_GET_STRING   (PCHAR) "GET"
 
#define HTTP_REQUEST_VERB_PUT_STRING   (PCHAR) "PUT"
 
#define HTTP_REQUEST_VERB_POST_STRING   (PCHAR) "POST"
 
#define SCHEMA_DELIMITER_STRING   (PCHAR) "://"
 
#define DEFAULT_CANONICAL_URI_STRING   (PCHAR) "/"
 
#define DEFAULT_AWS_REGION   "us-west-2"
 
#define CONTROL_PLANE_URI_PREFIX   "https://"
 
#define KINESIS_VIDEO_SERVICE_NAME   "kinesisvideo"
 
#define AWS_KVS_FIPS_ENDPOINT_POSTFIX   "-fips"
 
#define CONTROL_PLANE_URI_POSTFIX   ".amazonaws.com"
 
#define CONTROL_PLANE_URI_POSTFIX_CN   ".amazonaws.com.cn"
 
#define CONTROL_PLANE_URI_POSTFIX_ISO   ".c2s.ic.gov"
 
#define CONTROL_PLANE_URI_POSTFIX_ISO_B   ".sc2s.sgov.gov"
 
#define AWS_ISO_B_REGION_PREFIX   "us-isob-"
 
#define AWS_ISO_REGION_PREFIX   "us-iso-"
 
#define AWS_GOV_CLOUD_REGION_PREFIX   "us-gov-"
 
#define AWS_CN_REGION_PREFIX   "cn-"
 
#define DEFAULT_USER_AGENT_NAME   "AWS-SDK-KVS"
 
#define TAG_PARAM_JSON_TEMPLATE   "\n\t\t\"%s\": \"%s\","
 
#define REQUEST_HEADER_DELIMITER   ((PCHAR) ": ")
 
#define KVS_REQUEST_ID_HEADER_NAME   "x-amzn-RequestId"
 
#define MAX_REQUEST_HEADER_COUNT   200
 
#define MAX_REQUEST_HEADER_OUTPUT_DELIMITER   5
 
#define HTTP_STATUS_CODE_OK   200
 
#define HTTP_STATUS_CODE_REQUEST_TIMEOUT   408
 
#define MAX_JSON_TOKEN_COUNT   100
 
#define DEFAULT_LOW_SPEED_LIMIT   30
 
#define DEFAULT_LOW_SPEED_TIME_LIMIT   (30 * HUNDREDS_OF_NANOS_IN_A_SECOND)
 
#define REQUEST_HEADER_DELIMITER_SIZE   (2 * SIZEOF(CHAR))
 
#define AWS_CREDENTIALS_CURRENT_VERSION   0
 
#define DEFAULT_SSL_PORT_NUMBER   443
 
#define DEFAULT_NON_SSL_PORT_NUMBER   8080
 
#define SET_FILE_LOGGER()    createFileLogger(FILE_LOGGER_STRING_BUFFER_SIZE, FILE_LOGGER_LOG_FILE_COUNT, (PCHAR) FILE_LOGGER_LOG_FILE_DIRECTORY_PATH, TRUE, TRUE, NULL)
 
#define RESET_FILE_LOGGER()   freeFileLogger()
 

Typedefs

typedef struct __AwsCredentials AwsCredentials
 AWS Credentials declaration. More...
 
typedef struct __AwsCredentialsPAwsCredentials
 
typedef struct __RequestHeader RequestHeader
 Request Header structure. More...
 
typedef struct __RequestHeaderPRequestHeader
 
typedef struct __RequestInfo RequestInfo
 Request info structure. More...
 
typedef struct __RequestInfoPRequestInfo
 
typedef struct __CallInfo CallInfo
 Call Info structure. More...
 
typedef struct __CallInfoPCallInfo
 
typedef struct __AwsCredentialProviderPAwsCredentialProvider
 Abstract base for the credential provider. More...
 
typedef STATUS(* GetCredentialsFunc) (PAwsCredentialProvider, PAwsCredentials *)
 Function returning AWS credentials. More...
 
typedef struct __AwsCredentialProvider AwsCredentialProvider
 

Enumerations

enum  HTTP_REQUEST_VERB { HTTP_REQUEST_VERB_GET , HTTP_REQUEST_VERB_POST , HTTP_REQUEST_VERB_PUT }
 Types of verbs. More...
 
enum  SSL_CERTIFICATE_TYPE { SSL_CERTIFICATE_TYPE_NOT_SPECIFIED , SSL_CERTIFICATE_TYPE_DER , SSL_CERTIFICATE_TYPE_PEM , SSL_CERTIFICATE_TYPE_ENG }
 Request SSL certificate type Not specified, "DER", "PEM", "ENG". More...
 

Functions

PUBLIC_API STATUS createAwsCredentials (PCHAR, UINT32, PCHAR, UINT32, PCHAR, UINT32, UINT64, PAwsCredentials *)
 Creates an AWS credentials object. More...
 
PUBLIC_API STATUS freeAwsCredentials (PAwsCredentials *)
 Frees an Aws credentials object. More...
 
PUBLIC_API STATUS deserializeAwsCredentials (PBYTE)
 
PUBLIC_API STATUS createStaticCredentialProvider (PCHAR, UINT32, PCHAR, UINT32, PCHAR, UINT32, UINT64, PAwsCredentialProvider *)
 Creates a Static AWS credential provider object. More...
 
PUBLIC_API STATUS freeStaticCredentialProvider (PAwsCredentialProvider *)
 Frees a Static Aws credential provider object. More...
 
PUBLIC_API STATUS createCurlIotCredentialProvider (PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PAwsCredentialProvider *)
 Creates an IoT based AWS credential provider object using libCurl. More...
 
PUBLIC_API STATUS createLwsIotCredentialProvider (PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PAwsCredentialProvider *)
 Creates an IoT based AWS credential provider object using libWebSockets. More...
 
PUBLIC_API STATUS createCurlIotCredentialProviderWithTimeAndTimeout (PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, UINT64, UINT64, GetCurrentTimeFunc, UINT64, PAwsCredentialProvider *)
 Creates an IoT based AWS credential provider object with time function which is based on libCurl. More...
 
PUBLIC_API STATUS createCurlIotCredentialProviderWithTime (PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, GetCurrentTimeFunc, UINT64, PAwsCredentialProvider *)
 Creates an IoT based AWS credential provider object with time function which is based on libCurl. More...
 
PUBLIC_API STATUS createLwsIotCredentialProviderWithTime (PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, GetCurrentTimeFunc, UINT64, PAwsCredentialProvider *)
 Creates an IoT based AWS credential provider object with time function which is based on libWebSockets. More...
 
PUBLIC_API STATUS freeIotCredentialProvider (PAwsCredentialProvider *)
 Frees an IoT based Aws credential provider object. More...
 
PUBLIC_API STATUS createFileCredentialProvider (PCHAR, PAwsCredentialProvider *)
 Creates a File based AWS credential provider object. More...
 
PUBLIC_API STATUS createFileCredentialProviderWithTime (PCHAR, GetCurrentTimeFunc, UINT64, PAwsCredentialProvider *)
 Creates a File based AWS credential provider object. More...
 
PUBLIC_API STATUS freeFileCredentialProvider (PAwsCredentialProvider *)
 Frees a File based Aws credential provider object. More...
 
PUBLIC_API STATUS createRequestInfo (PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, SSL_CERTIFICATE_TYPE, PCHAR, UINT64, UINT64, UINT64, UINT64, PAwsCredentials, PRequestInfo *)
 Creates a Request Info object. More...
 
PUBLIC_API STATUS freeRequestInfo (PRequestInfo *)
 Frees a Request Info object. More...
 
PUBLIC_API STATUS signAwsRequestInfo (PRequestInfo)
 Signs a request by appending SigV4 headers. More...
 
PUBLIC_API STATUS signAwsRequestInfoQueryParam (PRequestInfo)
 Signs a request by appending SigV4 query param. More...
 
PUBLIC_API STATUS getRequestHost (PCHAR, PCHAR *, PCHAR *)
 Gets a request host string. More...
 
PUBLIC_API BOOL compareJsonString (PCHAR, jsmntok_t *, jsmntype_t, PCHAR)
 Compares JSON strings taking into account the type. More...
 
PUBLIC_API STATUS convertTimestampToEpoch (PCHAR, UINT64, PUINT64)
 Converts the timestamp string to time. More...
 
PUBLIC_API STATUS getUserAgentString (PCHAR, PCHAR, UINT32, PCHAR)
 Creates a user agent string. More...
 
PUBLIC_API STATUS requestRequiresSecureConnection (PCHAR, PBOOL)
 Checks whether the request URL requires a secure connection. More...
 
PUBLIC_API STATUS setRequestHeader (PRequestInfo, PCHAR, UINT32, PCHAR, UINT32)
 Sets a header in the request info. More...
 
PUBLIC_API STATUS removeRequestHeader (PRequestInfo, PCHAR)
 Removes a header from the headers list if exists. More...
 
PUBLIC_API STATUS removeRequestHeaders (PRequestInfo)
 Removes and deletes all headers. More...
 
PUBLIC_API STATUS createRequestHeader (PCHAR, UINT32, PCHAR, UINT32, PRequestHeader *)
 Creates a request header. More...
 
PUBLIC_API SERVICE_CALL_RESULT getServiceCallResultFromHttpStatus (UINT32)
 Convenience method to convert HTTP statuses to SERVICE_CALL_RESULT status. More...
 
PUBLIC_API STATUS releaseCallInfo (PCallInfo)
 Releases the CallInfo allocations. More...
 
PUBLIC_API STATUS createFileLogger (UINT64, UINT64, PCHAR, BOOL, BOOL, logPrintFunc *)
 Creates a file based logger object and installs the global logger callback function. More...
 
PUBLIC_API STATUS freeFileLogger ()
 Frees the static file logger object and resets the global logging function if it was previously set by the create function. More...
 
PUBLIC_API STATUS initializeSslCallbacks ()
 
PUBLIC_API STATUS releaseSslCallbacks ()
 

Macro Definition Documentation

◆ DEFAULT_AUDIO_ONLY_TRACK_ID

#define DEFAULT_AUDIO_ONLY_TRACK_ID   1

Default Audio only track ID to be used

◆ DEFAULT_AUDIO_TRACK_ID

#define DEFAULT_AUDIO_TRACK_ID   2

Default Audio track ID to be used

◆ DEFAULT_ENDPOINT_CACHE_UPDATE_PERIOD

#define DEFAULT_ENDPOINT_CACHE_UPDATE_PERIOD   (40 * HUNDREDS_OF_NANOS_IN_A_MINUTE)

Default period for the cached endpoint update

◆ DEFAULT_KVS_CACERT_PATH

#define DEFAULT_KVS_CACERT_PATH   EMPTY_STRING

◆ DEFAULT_VIDEO_TRACK_ID

#define DEFAULT_VIDEO_TRACK_ID   1

Default Video track ID to be used

◆ ENDPOINT_UPDATE_PERIOD_SENTINEL_VALUE

#define ENDPOINT_UPDATE_PERIOD_SENTINEL_VALUE   0

Sentinel value indicating to use default update period

◆ IS_RETRIABLE_COMMON_LIB_ERROR

#define IS_RETRIABLE_COMMON_LIB_ERROR (   error)
Value:
#define STATUS_IOT_CREATE_LWS_CONTEXT_FAILED
Definition: Include.h:48
#define STATUS_CURL_LIBRARY_INIT_FAILED
Definition: Include.h:40
#define STATUS_IOT_EXPIRATION_OCCURS_IN_PAST
Definition: Include.h:45
#define STATUS_INVALID_API_CALL_RETURN_JSON
Definition: Include.h:38
#define STATUS_FILE_CREDENTIAL_PROVIDER_INVALID_FILE_LENGTH
Definition: Include.h:51
#define STATUS_FILE_CREDENTIAL_PROVIDER_OPEN_FILE_FAILED
Definition: Include.h:50
#define STATUS_HMAC_GENERATION_ERROR
Definition: Include.h:41
#define STATUS_CURL_INIT_FAILED
Definition: Include.h:39
#define STATUS_FILE_CREDENTIAL_PROVIDER_INVALID_FILE_FORMAT
Definition: Include.h:52
#define STATUS_IOT_EXPIRATION_PARSING_FAILED
Definition: Include.h:46
#define STATUS_IOT_INVALID_RESPONSE_LENGTH
Definition: Include.h:70
#define STATUS_IOT_NULL_AWS_CREDS
Definition: Include.h:71
#define STATUS_IOT_INVALID_URI_LEN
Definition: Include.h:72
#define STATUS_CURL_PERFORM_FAILED
Definition: Include.h:69

Macro for checking whether the status code should be retried by the continuous retry logic

◆ JSMN_HEADER

#define JSMN_HEADER

Main public include file

◆ MAX_ENDPOINT_CACHE_UPDATE_PERIOD

#define MAX_ENDPOINT_CACHE_UPDATE_PERIOD   (24 * HUNDREDS_OF_NANOS_IN_AN_HOUR)

Max period for the cached endpoint update

◆ RESET_FILE_LOGGER

#define RESET_FILE_LOGGER ( )    freeFileLogger()

◆ SET_FILE_LOGGER

#define SET_FILE_LOGGER ( )     createFileLogger(FILE_LOGGER_STRING_BUFFER_SIZE, FILE_LOGGER_LOG_FILE_COUNT, (PCHAR) FILE_LOGGER_LOG_FILE_DIRECTORY_PATH, TRUE, TRUE, NULL)

Helper macros to be used in pairs at the application start and end

Function Documentation

◆ initializeSslCallbacks()

PUBLIC_API STATUS initializeSslCallbacks ( )

Initializes global SSL callbacks

Returns
- STATUS code of the execution
Here is the caller graph for this function:

◆ releaseSslCallbacks()

PUBLIC_API STATUS releaseSslCallbacks ( )

Releases the global SSL callbacks.

Returns
- STATUS code of the execution
Here is the caller graph for this function: