login-proxy.h revision 38c92ae79cebe87c2da6f8e29e1dcc4f5b5c88da
#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;
/* send a notification about proxy connection to proxy-notify pipe
every n seconds */
unsigned int notify_refresh_secs;
};
/* Called when new input comes from proxy. */
/* Create a proxy to given host. Returns NULL if failed. Given callback is
called when new input is available from proxy. */
const struct login_proxy_settings *set,
/* 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(const char *proxy_notify_pipe_path);
void login_proxy_deinit(void);
#endif