login-proxy.h revision 86791365b10f45982c88e70f2eb94fd6c3fea151
#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. */
/* STARTTLS command was issued. */
void login_proxy_kill_idle(void);
void login_proxy_init(void);
void login_proxy_deinit(void);
#endif