Skip to content

File SolidSyslogMbedTlsStream.h

File List > Interface > SolidSyslogMbedTlsStream.h

Go to the documentation of this file

#ifndef SOLIDSYSLOGMBEDTLSSTREAM_H
#define SOLIDSYSLOGMBEDTLSSTREAM_H

#include "ExternC.h"
#include "SolidSyslogSleep.h"
#include "SolidSyslogTlsHandshakeTimeoutFunction.h"

struct SolidSyslogStream;

/* Forward declarations keep the public header free of any mbedTLS include.
 * Integrators include the relevant mbedTLS headers themselves before this
 * one to bring the types into scope. See project_mbedtls_di_handles. */
struct mbedtls_ctr_drbg_context;
struct mbedtls_x509_crt;
struct mbedtls_pk_context;

EXTERN_C_BEGIN

    struct SolidSyslogMbedTlsStreamConfig
    {
        struct SolidSyslogStream* Transport;
        SolidSyslogSleepFunction Sleep; 
        SolidSyslogTlsHandshakeTimeoutFunction GetHandshakeTimeoutMs; 
        void* HandshakeTimeoutContext; 
        struct mbedtls_ctr_drbg_context* Rng; 
        struct mbedtls_x509_crt* CaChain; 
        const char* ServerName;
        struct mbedtls_x509_crt* ClientCertChain; 
        struct mbedtls_pk_context* ClientKey; 
    };

    struct SolidSyslogStream* SolidSyslogMbedTlsStream_Create(const struct SolidSyslogMbedTlsStreamConfig* config);
    void SolidSyslogMbedTlsStream_Destroy(struct SolidSyslogStream * base);

EXTERN_C_END

#endif /* SOLIDSYSLOGMBEDTLSSTREAM_H */