71df09024cea5f2faa93da3bb9513ee96ba6bf22Timo Sirainen#ifndef CLIENT_CONNECTION_H
71df09024cea5f2faa93da3bb9513ee96ba6bf22Timo Sirainen#define CLIENT_CONNECTION_H
71df09024cea5f2faa93da3bb9513ee96ba6bf22Timo Sirainen
0a9cb42cbb135e3200cbfbb657820304cca8ecb8Timo Sirainen#include "net.h"
0a9cb42cbb135e3200cbfbb657820304cca8ecb8Timo Sirainen
c9dd53f7180a78668cbc1e6eb34d5b1722beccb9Aki Tuomi#define DOVEADM_LOG_CHANNEL_ID 'L'
c9dd53f7180a78668cbc1e6eb34d5b1722beccb9Aki Tuomi
0a9cb42cbb135e3200cbfbb657820304cca8ecb8Timo Sirainenstruct client_connection {
0a9cb42cbb135e3200cbfbb657820304cca8ecb8Timo Sirainen pool_t pool;
6fc40674e5a33787ae7fcd47a77a77ea20977994Aki Tuomi enum doveadm_client_type type;
5e327e031d1591f8bff17b67eba7139afbd36cddTimo Sirainen const char *name;
80a225c0b1f4bf322a562cc7c21d5891fb6895eeStephan Bosch
0a9cb42cbb135e3200cbfbb657820304cca8ecb8Timo Sirainen struct ip_addr local_ip, remote_ip;
009217abb57a24a4076092e8e4e165545747839eStephan Bosch in_port_t local_port, remote_port;
80a225c0b1f4bf322a562cc7c21d5891fb6895eeStephan Bosch
0a9cb42cbb135e3200cbfbb657820304cca8ecb8Timo Sirainen const struct doveadm_settings *set;
0a9cb42cbb135e3200cbfbb657820304cca8ecb8Timo Sirainen
80a225c0b1f4bf322a562cc7c21d5891fb6895eeStephan Bosch void (*free)(struct client_connection *conn);
0a9cb42cbb135e3200cbfbb657820304cca8ecb8Timo Sirainen};
0a9cb42cbb135e3200cbfbb657820304cca8ecb8Timo Sirainen
1172b608624245a5b05ca299d3279e34003ed308Timo Sirainenstruct client_connection *
e60c3e17c656c53da60f0ac51aa15e9ef2742d77Stephan Boschclient_connection_tcp_create(int fd, int listen_fd, bool ssl);
1e11a94ec50fc9b57eb2c859771c6a326ccaf86fAki Tuomistruct client_connection *
f300f927771a39549ce6cb7607129508e9041b4aStephan Boschclient_connection_http_create(int fd, bool ssl);
71df09024cea5f2faa93da3bb9513ee96ba6bf22Timo Sirainen
71df09024cea5f2faa93da3bb9513ee96ba6bf22Timo Sirainen#endif