summaryrefslogtreecommitdiffstats
path: root/imap/proxy.h
blob: 85566b5a71e20e901f3e77dffe7d1a2c5e4d4bcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef	proxy_h
#define	proxy_h

/*
** Copyright 2004 Double Precision, Inc.
** See COPYING for distribution information.
*/


struct proxyinfo {
	const char *host;
	int port;

	int (*connected_func)(int, const char *, void *);
	void *void_arg;
};

int connect_proxy(struct proxyinfo *);
void proxyloop(int);

struct proxybuf {
	char buffer[256];
	char *bufptr;
	size_t bufleft;
};

int proxy_readline(int fd, struct proxybuf *pb,
		   char *linebuf,
		   size_t linebuflen,
		   int imapmode);
int proxy_write(int fd, const char *hostname,
		const char *buf, size_t buf_len);

#endif