osdep.h revision ce6676db
1/*
2Copyright 1987, 1998  The Open Group
3
4Permission to use, copy, modify, distribute, and sell this software and its
5documentation for any purpose is hereby granted without fee, provided that
6the above copyright notice appear in all copies and that both that
7copyright notice and this permission notice appear in supporting
8documentation.
9
10The above copyright notice and this permission notice shall be included in
11all copies or substantial portions of the Software.
12
13THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
16OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
17AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
20Except as contained in this notice, the name of The Open Group shall not be
21used in advertising or otherwise to promote the sale, use or other dealings
22in this Software without prior written authorization from The Open Group.
23 * Copyright 1990, 1991 Network Computing Devices;
24 * Portions Copyright 1987 by Digital Equipment Corporation
25 *
26 * Permission to use, copy, modify, distribute, and sell this software and its
27 * documentation for any purpose is hereby granted without fee, provided that
28 * the above copyright notice appear in all copies and that both that
29 * copyright notice and this permission notice appear in supporting
30 * documentation, and that the names of Network Computing Devices,
31 * or Digital not be used in advertising or
32 * publicity pertaining to distribution of the software without specific,
33 * written prior permission.  Network Computing Devices, or Digital
34 * make no representations about the
35 * suitability of this software for any purpose.  It is provided "as is"
36 * without express or implied warranty.
37 *
38 * NETWORK COMPUTING DEVICES, AND DIGITAL DISCLAIM ALL WARRANTIES WITH
39 * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
40 * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, OR DIGITAL BE
41 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
42 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
43 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
44 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
45 *
46 */
47
48#ifndef _OSDEP_H_
49#define	_OSDEP_H_
50
51#define	BOTIMEOUT	200	/* in milliseconds */
52#define	BUFSIZE		4096
53#define	BUFWATERMARK	8192
54#define	MAXBUFSIZE	(1 << 15)
55
56#ifdef _POSIX_SOURCE
57# include <limits.h>
58#else
59# define _POSIX_SOURCE
60# include <limits.h>
61# undef _POSIX_SOURCE
62#endif
63#include <sys/param.h>
64
65#ifndef PATH_MAX
66# ifndef PATH_MAX
67#  ifdef MAXPATHLEN
68#   define PATH_MAX MAXPATHLEN
69#  else
70#   define PATH_MAX 1024
71#  endif
72# endif
73#endif /* PATH_MAX */
74
75#define MAXSOCKS	MAXCLIENTS
76
77#include <stddef.h>
78
79typedef struct _connectionInput {
80    struct _connectionInput *next;
81    char       *buffer;		/* contains current client input */
82    char       *bufptr;		/* pointer to current start of data */
83    int         bufcnt;		/* count of bytes in buffer */
84    int         lenLastReq;
85    int         size;
86}           ConnectionInput, *ConnectionInputPtr;
87
88typedef struct _connectionOutput {
89    struct _connectionOutput *next;
90    int         size;
91    unsigned char *buf;
92    int         count;
93}           ConnectionOutput, *ConnectionOutputPtr;
94
95typedef struct _osComm {
96    int         fd;
97    ConnectionInputPtr input;
98    ConnectionOutputPtr output;
99    long        conn_time;	/* timestamp if not established, else 0  */
100    struct _XtransConnInfo *trans_conn; /* transport connection object */
101}           OsCommRec, *OsCommPtr;
102
103#endif				/* _OSDEP_H_ */
104