Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

gateway.c File Reference

Contains functions to connect to a server, possibly using a "forwarder" (i.e. More...


Data Structures

struct  socks_op
 Structure of a socks client operation. More...

struct  socks_reply
 Structure of a socks server reply. More...


Defines

#define SOCKS_REQUEST_GRANTED   90
#define SOCKS_REQUEST_REJECT   91
#define SOCKS_REQUEST_IDENT_FAILED   92
#define SOCKS_REQUEST_IDENT_CONFLICT   93

Functions

jb_socket socks4_connect (const struct forward_spec *fwd, const char *target_host, int target_port, struct client_state *csp)
jb_socket forwarded_connect (const struct forward_spec *fwd, struct http_request *http, struct client_state *csp)

Variables

const char gateway_rcs [] = "$Id: gateway.c,v 2.1 2002/06/04 17:55:24 jongfoster Exp $"
const char gateway_h_rcs [] = GATEWAY_H_VERSION
const char socks_userid [] = "anonymous"


Detailed Description

Contains functions to connect to a server, possibly using a "forwarder" (i.e.

HTTP proxy and/or a SOCKS4 proxy).

Log:
gateway.c,v
Revision 2.1 2002/06/04 17:55:24 jongfoster Adding comments

Revision 2.0 2002/06/04 14:34:21 jongfoster Moving source files to src/

Revision 1.16 2002/05/12 21:36:29 jongfoster Correcting function comments

Revision 1.15 2002/03/26 22:29:54 swa we have a new homepage!

Revision 1.14 2002/03/24 13:25:43 swa name change related issues

Revision 1.13 2002/03/13 00:29:59 jongfoster Killing warnings

Revision 1.12 2002/03/09 20:03:52 jongfoster

THIS WAS A MAJOR BUG - it caused frequent, unpredictable crashes, and also frequently caused JB to jump to 100% CPU and stay there. (Because it thought it had just read ((unsigned)-1) == 4Gb of data...)

Revision 1.11 2002/03/08 17:46:04 jongfoster Fixing int/size_t warnings

Revision 1.10 2002/03/07 03:50:19 oes

Revision 1.9 2001/10/25 03:40:48 david__schmidt Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple threads to call select() simultaneously. So, it's time to do a real, live, native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ (native). Both versions will work, but using __OS2__ offers multi-threading.

Revision 1.8 2001/09/13 20:10:12 jongfoster Fixing missing include under Windows

Revision 1.7 2001/09/12 17:58:26 steudten

add include <string.h>

Revision 1.6 2001/09/10 10:41:16 oes Added include in.h

Revision 1.5 2001/07/29 18:47:57 jongfoster Adding missing include project.h

Revision 1.4 2001/07/24 12:47:06 oes Applied BeOS support update by Eugenia

Revision 1.3 2001/06/09 10:55:28 jongfoster Changing BUFSIZ ==> BUFFER_SIZE

Revision 1.2 2001/06/07 23:11:38 jongfoster Removing gateways[] list - no longer used. Replacing function pointer in struct gateway with a directly called function forwarded_connect(), which can do the common task of deciding whether to connect to the web server or HTTP proxy. Replacing struct gateway with struct forward_spec Fixing bug with SOCKS4A and HTTP proxy server in combination. It was a bug which led to the connection being made to the web server rather than the HTTP proxy, and also a buffer overrun.

Revision 1.1.1.1 2001/05/15 13:58:54 oes Initial import of version 2.9.3 source tree


Define Documentation

#define SOCKS_REQUEST_GRANTED   90
 

SOCKS command code.

#define SOCKS_REQUEST_IDENT_CONFLICT   93
 

SOCKS command code.

#define SOCKS_REQUEST_IDENT_FAILED   92
 

SOCKS command code.

#define SOCKS_REQUEST_REJECT   91
 

SOCKS command code.


Function Documentation

jb_socket forwarded_connect const struct forward_spec   fwd,
struct http_request   http,
struct client_state   csp
 

Connect to a specified web server, possibly via a HTTP proxy and/or a SOCKS proxy.

Parameters:
fwd  the proxies to use when connecting.
http  the http request and apropos headers
csp  Current client state (buffers, headers, etc...)
Returns:
JB_INVALID_SOCKET => failure, else it is the socket file descriptor.

jb_socket socks4_connect const struct forward_spec   fwd,
const char *    target_host,
int    target_port,
struct client_state   csp
[static]
 

Connect to the SOCKS server, and connect through it to the specified server.

This handles all the SOCKS negotiation, and returns a file descriptor for a socket which can be treated as a normal (non-SOCKS) socket.

Parameters:
fwd  Specifies the SOCKS proxy to use.
target_host  The final server to connect to.
target_port  The final port to connect to.
csp  Current client state (buffers, headers, etc...)
Returns:
JB_INVALID_SOCKET => failure, else a socket file descriptor.


Variable Documentation

const char gateway_h_rcs[] = GATEWAY_H_VERSION
 

Version information about gateway.h.

const char gateway_rcs[] = "$Id: gateway.c,v 2.1 2002/06/04 17:55:24 jongfoster Exp $"
 

Version information about gateway.c.

const char socks_userid[] = "anonymous" [static]
 

The SOCKS user ID to use.


Generated on Tue Jun 4 18:54:49 2002 for Privoxy 3.1.1 by doxygen1.2.15