socat/xio-socks.h

39 lines
1.2 KiB
C
Raw Permalink Normal View History

2008-02-24 10:09:01 +00:00
/* $Id: xio-socks.h,v 1.6.2.1 2006/07/24 19:18:30 gerhard Exp $ */
/* Copyright Gerhard Rieger 2001-2007 */
2008-01-27 12:00:08 +00:00
/* Published under the GNU General Public License V.2, see file COPYING */
#ifndef __xio_socks_h_included
#define __xio_socks_h_included 1
2008-02-24 10:09:01 +00:00
#define SIZEOF_STRUCT_SOCKS4 sizeof(struct socks4head)
struct socks4request {
2008-01-27 12:00:08 +00:00
uint8_t version;
uint8_t action;
uint16_t port;
uint32_t dest;
char userid[1]; /* just to have access via this struct */
} ;
extern const struct optdesc opt_socksport;
extern const struct optdesc opt_socksuser;
2008-02-24 10:09:01 +00:00
extern const union xioaddr_desc *xioaddrs_socks4_connect[];
extern const union xioaddr_desc *xioaddrs_socks4a_connect[];
2008-01-27 12:00:08 +00:00
2008-02-24 10:09:01 +00:00
extern int _xioopen_socks4_prepare(const char *targetport, struct opt *opts, char **socksport, struct socks4request *sockhead, size_t *headlen);
2008-01-27 12:00:08 +00:00
extern int
_xioopen_socks4_connect0(struct single *xfd,
const char *hostname, /* socks target host */
int socks4a,
2008-02-24 10:09:01 +00:00
struct socks4request *sockhead,
2008-01-27 12:00:08 +00:00
ssize_t *headlen, /* get available space,
return used length*/
int level);
extern int _xioopen_socks4_connect(struct single *xfd,
2008-02-24 10:09:01 +00:00
struct socks4request *sockhead,
2008-01-27 12:00:08 +00:00
size_t headlen,
int level);
#endif /* !defined(__xio_socks_h_included) */