File: xio-socks.h

package info (click to toggle)
socat 2.0.0~beta9-1
  • links: PTS
  • area: main
  • in suites: experimental
  • size: 3,740 kB
  • sloc: ansic: 30,875; sh: 11,630; makefile: 149
file content (38 lines) | stat: -rw-r--r-- 1,238 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
/* source: xio-socks.h */
/* Copyright Gerhard Rieger 2001-2007 */
/* Published under the GNU General Public License V.2, see file COPYING */

#ifndef __xio_socks_h_included
#define __xio_socks_h_included 1

#define SIZEOF_STRUCT_SOCKS4 sizeof(struct socks4head)

struct socks4request {
   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;

extern const union xioaddr_desc *xioaddrs_socks4_connect[];
extern const union xioaddr_desc *xioaddrs_socks4a_connect[];

extern int _xioopen_socks4_prepare(const char *targetport, struct opt *opts, char **socksport, struct socks4request *sockhead, size_t *headlen);
extern int
   _xioopen_socks4_connect0(struct single *xfd,
			    const char *hostname,	/* socks target host */
			    int socks4a,
			    struct socks4request *sockhead,
			    ssize_t *headlen,		/* get available space,
							   return used length*/
			    int level);
extern int _xioopen_socks4_connect(struct single *xfd,
				   struct socks4request *sockhead,
				   size_t headlen,
				   int level);

#endif /* !defined(__xio_socks_h_included) */