login-proxy.h revision e0a049aa308a2e66044af3ef8e0fb70ce909ad41
#ifndef LOGIN_PROXY_H
#define LOGIN_PROXY_H
struct client;
struct login_proxy;
enum login_proxy_ssl_flags {
PROXY_SSL_FLAG_YES = 0x01,
/* Don't do SSL handshake immediately after connected */
PROXY_SSL_FLAG_STARTTLS = 0x02,
/* Don't require that the received certificate is valid */
PROXY_SSL_FLAG_ANY_CERT = 0x04
};
struct login_proxy_settings {
const char *host;
unsigned int port;
unsigned int connect_timeout_msecs;
};
/* Called when new input comes from proxy. */
typedef void proxy_callback_t(void *context);
/* Create a proxy to given host. Returns NULL if failed. Given callback is
called when new input is available from proxy. */
struct login_proxy *
#ifdef CONTEXT_TYPE_SAFETY
#else
#endif
/* Free the proxy. This should be called if authentication fails. */
connection. */
/* Detach proxy from client. This is done after the authentication is
successful and all that is left is the dummy proxying. */
struct ostream *client_output);
/* STARTTLS command was issued. */
void login_proxy_init(void);
void login_proxy_deinit(void);
#endif