/*
 * cs_internal.h
 *
 *  Created on: 14 Mar 2018
 *      Author: development
 */

#ifndef MODULES_SSL_SSL_MC_PRIVATE_H_
#define MODULES_SSL_SSL_MC_PRIVATE_H_

#define MCTLS_PROTOCOL "spp"

#include <openssl/ssl.h>
#include "httpd.h"

typedef unsigned char CONTEXT_ID;

int
mctls_IsMultiContext(
		const SSL* cpt_ssl);

int
mctls_GetContextIdByName(
		const SSL *cpt_Ssl,
		const char *cps_ContextName,
		CONTEXT_ID /*out*/ *puc_ContextID);

int
mctls_GetDefaultContext(
		const SSL *cpt_Ssl,
		CONTEXT_ID /*out*/ *puc_ContextID);

int
mctls_GetActiveContext(
		const SSL *cpt_Ssl,
		CONTEXT_ID /*out*/ *puc_CurrentContext);

int
mctls_SetActiveContext(
		SSL *pt_Ssl,
		CONTEXT_ID uc_NewContext,
		CONTEXT_ID *puc_OldContext);

int
MC_SetActiveContextByName(
		conn_rec *pt_Conn,
		const char *cps_ContextName,
		CONTEXT_ID *puc_PreviousContext);

int
MC_SetActiveContextByID(
		conn_rec *pt_Conn,
		CONTEXT_ID uc_NewContext,
		CONTEXT_ID *puc_PreviousContext);

#endif /* MODULES_CONTEXTSPLIT_CS_INTERNAL_H_ */
