File: libproxy.h

package info (click to toggle)
ayttm 0.4.6%2B34-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 11,608 kB
  • ctags: 11,226
file content (85 lines) | stat: -rw-r--r-- 2,271 bytes parent folder | download | duplicates (3)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
 * Ayttm
 *
 * Copyright (C) 2003, the Ayttm team
 * 
 * Ayttm is derivative of Everybuddy
 * Copyright (C) 1998-1999, Torrey Searle
 * proxy feature by Seb C.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */


#ifndef __LIBPROXY_H__
#define __LIBPROXY_H__


enum eProxyType
{
	PROXY_NONE = 0,
	PROXY_HTTP,
	PROXY_SOCKS4,
	PROXY_SOCKS5,
	
	PROXY_MAX
};


/* forward declaraions */
struct hostent;		/* #include <netdb.h> */
struct sockaddr;	/* #include <sys/socket.h> */


#ifdef __cplusplus
extern "C" {
#endif

#if defined(__MINGW32__) && defined(__IN_PLUGIN__)
#define extern __declspec(dllimport)
#endif

/* gethostbyname functions */
extern struct hostent	*proxy_gethostbyname( const char *host ) ;
extern struct hostent	*proxy_gethostbyname2( const char *host, int type ) ;

/* send/receive */
int	proxy_send( int s, const void *msg, int len, unsigned int flags );
int	proxy_recv( int s, void * buff, int len, unsigned int flags );

extern int proxy_get_proxy(void);

/* connect functions */
extern int	proxy_connect( int sockfd, struct sockaddr *serv_addr, int addrlen,
				void *cb, void *data, void *scb );
extern int	proxy_connect_host( const char *host, int port, void *cb, void *data, void *scb ) ;

/* proxy setting */
extern int	proxy_set_proxy( int proxy_type, const char *proxy_host, int proxy_port );

/* proxy authorization */
extern int			proxy_set_auth( const int required, const char *user, const char *passwd );
extern const char	*proxy_get_auth( void );

#if defined(__MINGW32__) && defined(__IN_PLUGIN__)
#define extern extern
#endif

#ifdef __cplusplus
}
#endif

#endif