File: libproxy.h

package info (click to toggle)
everybuddy 0.2.1beta6-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,936 kB
  • ctags: 5,627
  • sloc: ansic: 50,783; sh: 8,559; yacc: 191; makefile: 182; perl: 97; lex: 50
file content (63 lines) | stat: -rw-r--r-- 1,857 bytes parent folder | download
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
/*
 * 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 _INC_LIBPROXY_H
#define _INC_LIBPROXY_H

#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include "config.h"

#define PROXY_NONE 0
#define PROXY_HTTP 1
#define PROXY_SOCKS4 2		
#define PROXY_SOCKS5 3		

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

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 );


/* connect function */
extern int proxy_connect(int  sockfd, struct sockaddr *serv_addr, int
			 addrlen ) ;

/* proxy setting */
extern int proxy_set_proxy(int proxy_type,char *proxy_host,int proxy_port);
/* proxy user and password setting */
extern int proxy_set_auth(const char *user, const char *passwd );

/* variable for external testing .. Must use proxy_set_proxy to change
   value */ 
extern int proxy_type;
extern char * proxy_host;
extern int proxy_port;

#endif