source: branches/libc-0.6/src/emx/include/socks.h

Last change on this file was 1506, checked in by bird, 21 years ago

@unixroot. header reviews. ++

  • Property cvs2svn:cvs-rev set to 1.3
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 4.1 KB
Line 
1/* socks.h,v 1.3 2004/09/14 22:27:35 bird Exp */
2/** @file
3 * BSD
4 */
5/*-----------------------------------------------------------------
6Copyright (c) 1989 Regents of the University of California.
7All rights reserved.
8
9Redistribution and use in source and binary forms, with or without
10modification, are permitted provided that the following conditions
11are met:
121. Redistributions of source code must retain the above copyright
13 notice, this list of conditions and the following disclaimer.
142. Redistributions in binary form must reproduce the above copyright
15 notice, this list of conditions and the following disclaimer in the
16 documentation and/or other materials provided with the distribution.
173. All advertising materials mentioning features or use of this software
18 must display the following acknowledgement:
19 This product includes software developed by the University of
20 California, Berkeley and its contributors.
214. Neither the name of the University nor the names of its contributors
22 may be used to endorse or promote products derived from this software
23 without specific prior written permission.
24
25THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35SUCH DAMAGE.
36
37-----------------------------------------------------------------
38Portions Copyright (c) 1993, 1994 by NEC Systems Laboratory.
39
40Permission to use, copy, modify, and distribute this software for
41any purpose with or without fee is hereby granted, provided that
42the above copyright notice and this permission notice appear in all
43copies, and that the name of NEC Systems Laboratory not be used in
44advertising or publicity pertaining to distribution of the document
45or software without specific, written prior permission.
46
47THE SOFTWARE IS PROVIDED ``AS IS'' AND NEC SYSTEMS LABORATORY DISCLAIMS
48ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
49WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NEC
50SYSTEMS LABORATORY BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
51CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
52OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
53OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
54OR PERFORMANCE OF THIS SOFTWARE.
55
56-----------------------------------------------------------------*/
57#ifndef _SOCKS_H_
58#define _SOCKS_H_
59#include <netinet\in.h>
60
61/*
62 * Default port number for SOCKS services.
63 */
64#define SOCKS_DEF_PORT 1080
65
66/* Current SOCKS protocol version */
67#define SOCKS_VERSION 4
68
69/*
70** Response commands/codes
71*/
72#define SOCKS_CONNECT 1
73#define SOCKS_BIND 2
74#define SOCKS_RESULT 90
75#define SOCKS_FAIL 91
76#define SOCKS_NO_IDENTD 92 /* Failed to connect to Identd on client machine */
77#define SOCKS_BAD_ID 93 /* Client's Identd reported a different user-id */
78
79typedef unsigned long u_int32;
80
81typedef struct {
82 u_int32 host; /* in network byte order */
83 unsigned short port; /* in network byte oreder */
84 unsigned char version;
85 unsigned char cmd;
86} Socks_t;
87
88
89typedef struct socksdata {
90 /* the following feilds are for socks */
91 char * socks_server;
92 char * socks_serverlist;
93 int direct;
94 struct sockaddr_in cursin;
95 int socks_conn_sock;
96 unsigned short socks_port;
97 unsigned short socks_conn_port;
98 unsigned short socks_last_conn_port;
99 unsigned long socks_conn_host;
100 unsigned long socks_last_conn_host;
101 struct sockaddr_in socks_nsin;
102 struct sockaddr_in me;
103} SD;
104#endif
Note: See TracBrowser for help on using the repository browser.