1
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4
|
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6
|
* THE BSD LICENSE
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8
|
* Redistribution and use in source and binary forms, with or without
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9
|
* modification, are permitted provided that the following conditions are met:
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11
|
* Redistributions of source code must retain the above copyright notice, this
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12
|
* list of conditions and the following disclaimer.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13
|
* Redistributions in binary form must reproduce the above copyright notice,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14
|
* this list of conditions and the following disclaimer in the documentation
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15
|
* and/or other materials provided with the distribution.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17
|
* Neither the name of the nor the names of its contributors may be
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18
|
* used to endorse or promote products derived from this software without
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19
|
* specific prior written permission.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25
|
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34
|
#ifndef PUBLIC_NSAPI_H
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35
|
#define PUBLIC_NSAPI_H
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38
|
* File: nsapi.h
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40
|
* Description:
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42
|
* This file defines an interface for extending the server with
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43
|
* in-process plug-ins.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
44
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
45
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46
|
#ifdef __cplusplus
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
47
|
extern "C" {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
49
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
50
|
/* NSAPI version defined by this header file */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51
|
#define NSAPI_VERSION 303
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
53
|
/* Define USE_NSAPI_VERSION to use a specific NSAPI version at compile time */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
54
|
#ifdef USE_NSAPI_VERSION
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
55
|
#if USE_NSAPI_VERSION < 300 || USE_NSAPI_VERSION > NSAPI_VERSION
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
56
|
#error This header file does not support the requested NSAPI version
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
57
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
58
|
#undef NSAPI_VERSION
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
59
|
#define NSAPI_VERSION USE_NSAPI_VERSION
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
60
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
61
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
62
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
63
|
/* --- Begin native platform configuration definitions --- */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
64
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
65
|
#if !defined(XP_WIN32) && !defined(XP_UNIX)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
66
|
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
67
|
#define XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
68
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
69
|
#define XP_UNIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
70
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
71
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
72
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
73
|
#ifdef XP_UNIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
74
|
#define NSAPI_PUBLIC
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
75
|
#define ZERO(ptr, len) memset(ptr, 0, len)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
76
|
#ifdef AIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
77
|
#define TCPLEN_T size_t
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
78
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
79
|
#ifdef HPUX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
80
|
#define TCPLEN_T int
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
81
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
82
|
#ifndef TCPLEN_T
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
83
|
#define TCPLEN_T socklen_t
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
84
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
85
|
#endif /* XP_UNIX */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
86
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
87
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
88
|
#define NSAPI_PUBLIC __declspec(dllexport)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
89
|
struct iovec {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
90
|
char *iov_base;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
91
|
unsigned iov_len;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
92
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
93
|
#ifndef S_ISDIR
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
94
|
#define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
95
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
96
|
#ifndef S_ISREG
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
97
|
#define S_ISREG(mode) ((mode & S_IFMT) == S_IFREG)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
98
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
99
|
#ifndef S_ISLNK
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
100
|
#define S_ISLNK(x) (0)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
101
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
102
|
#define caddr_t PCHAR
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
103
|
#define NEED_STRCASECMP
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
104
|
#define NEED_STRNCASECMP
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
105
|
#define ZERO(ptr, len) ZeroMemory(ptr, len)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
106
|
#define TCPLEN_T int
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
107
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
108
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
109
|
/* --- End native platform configuration definitions --- */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
110
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
111
|
/* --- Begin miscellaneous definitions --- */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
112
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
113
|
/* Used in some places as a length limit on error messages */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
114
|
#define MAGNUS_ERROR_LEN 1024
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
115
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
116
|
/* Carriage return and line feed */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
117
|
#define CR 13
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
118
|
#define LF 10
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
119
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
120
|
#define ENDLINE "\r\n"
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122
|
#define ENDLINE "\n"
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
125
|
/* mime.types file identification line */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
126
|
#define NCC_MT_MAGIC "#--Netscape Communications Corporation MIME Information"
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
127
|
#define NCC_MT_MAGIC_LEN 55
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
128
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
129
|
/* The character which separates extensions with cinfo_find */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
130
|
#define CINFO_SEPARATOR '.'
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
131
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
132
|
/* The maximum length of a line in a mime.types file */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
133
|
#define CINFO_MAX_LEN 1024
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
134
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
135
|
/* The maximum length of an error message */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136
|
#define MAX_ERROR_LEN 4096
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
137
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
138
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
139
|
* A warning is a minor mishap, such as a 404 being issued.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
140
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
141
|
#define LOG_WARN 0
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
142
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
143
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
144
|
* A misconfig is when there is a syntax error or permission violation in
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
145
|
* a config file.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
146
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
147
|
#define LOG_MISCONFIG 1
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
148
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
149
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150
|
* Security warnings are issued when authentication fails, or a host is
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151
|
* given a 403 return code.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
153
|
#define LOG_SECURITY 2
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
154
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
155
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
156
|
* A failure is when a request could not be fulfilled due to an internal
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
157
|
* problem, such as a CGI script exiting prematurely, or a filesystem
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
158
|
* permissions problem.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
160
|
#define LOG_FAILURE 3
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
162
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
163
|
* A catastrophe is a fatal server error such as running out of
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
164
|
* memory or processes, or a system call failing, or even a server crash.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
165
|
* The server child cannot recover from a catastrophe.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
166
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
167
|
#define LOG_CATASTROPHE 4
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
168
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
169
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
170
|
* Informational message, of no concern.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
171
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
172
|
#define LOG_INFORM 5
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
173
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
174
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
175
|
* Internal diagnostic message.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
176
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
177
|
#define LOG_VERBOSE 6
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
178
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
179
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
180
|
* The time format to use in the error log
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
181
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
182
|
#define ERR_TIMEFMT "[%d/%b/%Y:%H:%M:%S]"
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
183
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
184
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
185
|
/* The fd you will get if you are reporting errors to SYSLOG */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
186
|
#define ERRORS_TO_SYSLOG NULL
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
187
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
188
|
/* Return codes from file I/O routines */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
189
|
#define IO_OKAY 1
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
190
|
#define IO_ERROR -1
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
191
|
#define IO_EOF 0
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
192
|
#define NETBUF_EOF -1
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
193
|
#define NETBUF_ERROR -2
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
194
|
#define NETBUF_FULL -3
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
195
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
196
|
/* The disk page size on this machine. */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
197
|
#define FILE_BUFFERSIZE 4096
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
198
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
199
|
#ifdef XP_UNIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
200
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
201
|
#define FILE_PATHSEP '/'
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
202
|
#define FILE_PARENT "../"
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
203
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
204
|
#elif defined(XP_WIN32)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
205
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
206
|
#define FILE_PATHSEP '/'
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
207
|
#define FILE_PARENT "..\\"
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
208
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
209
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
210
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
211
|
#define NET_INFINITE_TIMEOUT 0
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
212
|
#define NET_ZERO_TIMEOUT -1
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
213
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
214
|
#ifdef USE_REGEX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
215
|
/* WILDPAT uses regular expressions */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
216
|
#define WILDPAT_VALID(exp) regexp_valid(exp)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
217
|
#define WILDPAT_MATCH(str, exp) regexp_match(str, exp)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
218
|
#define WILDPAT_CMP(str, exp) regexp_cmp(str, exp)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
219
|
#define WILDPAT_CASECMP(str, exp) regexp_casecmp(str, exp)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
220
|
#define WILDPAT_USES_REGEXP 1
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
221
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
222
|
/* WILDPAT uses shell expressions */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
223
|
#define WILDPAT_VALID(exp) shexp_valid(exp)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
224
|
#define WILDPAT_MATCH(str, exp) shexp_match(str, exp)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
225
|
#define WILDPAT_CMP(str, exp) shexp_cmp(str, exp)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
226
|
#define WILDPAT_CASECMP(str, exp) shexp_casecmp(str, exp)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
227
|
#define WILDPAT_USES_SHEXP 1
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
228
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
229
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
230
|
/* Define return codes from WILDPAT_VALID */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
231
|
#define NON_WILDPAT -1 /* exp is ordinary string */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
232
|
#define INVALID_WILDPAT -2 /* exp is an invalid pattern */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
233
|
#define VALID_WILDPAT 1 /* exp is a valid pattern */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
234
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
235
|
/* Define return codes from regexp_valid and shexp_valid */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
236
|
#define NON_SXP NON_WILDPAT /* exp is an ordinary string */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
237
|
#define INVALID_SXP INVALID_WILDPAT /* exp is an invalid shell exp */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
238
|
#define VALID_SXP VALID_WILDPAT /* exp is a valid shell exp */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
239
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
240
|
#define NON_REGEXP NON_SXP
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
241
|
#define INVALID_REGEXP INVALID_SXP
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
242
|
#define VALID_REGEXP VALID_SXP
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
243
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
244
|
#define SYSTHREAD_DEFAULT_PRIORITY 16
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
245
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
246
|
/* The longest line in the configuration file */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
247
|
#define CONF_MAXLEN 16384
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
248
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
249
|
#define HTTP_DATE_LEN 30
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
250
|
#define HTTP_DATE_FMT "%a, %d %b %Y %T GMT"
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
251
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
252
|
/* HTTP status codes */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
253
|
#define PROTOCOL_CONTINUE 100
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
254
|
#define PROTOCOL_SWITCHING 101
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
255
|
#define PROTOCOL_OK 200
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
256
|
#define PROTOCOL_CREATED 201
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
257
|
#define PROTOCOL_ACCEPTED 202
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
258
|
#define PROTOCOL_NONAUTHORITATIVE 203
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
259
|
#define PROTOCOL_NO_RESPONSE 204
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
260
|
#define PROTOCOL_NO_CONTENT 204
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
261
|
#define PROTOCOL_RESET_CONTENT 205
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
262
|
#define PROTOCOL_PARTIAL_CONTENT 206
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
263
|
#define PROTOCOL_MULTI_STATUS 207
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
264
|
#define PROTOCOL_MULTIPLE_CHOICES 300
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
265
|
#define PROTOCOL_MOVED_PERMANENTLY 301
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
266
|
#define PROTOCOL_REDIRECT 302
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
267
|
#define PROTOCOL_SEE_OTHER 303
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
268
|
#define PROTOCOL_NOT_MODIFIED 304
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
269
|
#define PROTOCOL_USE_PROXY 305
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
270
|
#define PROTOCOL_TEMPORARY_REDIRECT 307
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
271
|
#define PROTOCOL_BAD_REQUEST 400
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
272
|
#define PROTOCOL_UNAUTHORIZED 401
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
273
|
#define PROTOCOL_PAYMENT_REQUIRED 402
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
274
|
#define PROTOCOL_FORBIDDEN 403
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
275
|
#define PROTOCOL_NOT_FOUND 404
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
276
|
#define PROTOCOL_METHOD_NOT_ALLOWED 405
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
277
|
#define PROTOCOL_NOT_ACCEPTABLE 406
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
278
|
#define PROTOCOL_PROXY_UNAUTHORIZED 407
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
279
|
#define PROTOCOL_REQUEST_TIMEOUT 408
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
280
|
#define PROTOCOL_CONFLICT 409
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
281
|
#define PROTOCOL_GONE 410
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
282
|
#define PROTOCOL_LENGTH_REQUIRED 411
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
283
|
#define PROTOCOL_PRECONDITION_FAIL 412
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
284
|
#define PROTOCOL_ENTITY_TOO_LARGE 413
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
285
|
#define PROTOCOL_URI_TOO_LARGE 414
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
286
|
#define PROTOCOL_UNSUPPORTED_MEDIA_TYPE 415
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
287
|
#define PROTOCOL_REQUESTED_RANGE_NOT_SATISFIABLE 416
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
288
|
#define PROTOCOL_EXPECTATION_FAILED 417
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
289
|
#define PROTOCOL_LOCKED 423
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
290
|
#define PROTOCOL_FAILED_DEPENDENCY 424
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
291
|
#define PROTOCOL_SERVER_ERROR 500
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
292
|
#define PROTOCOL_NOT_IMPLEMENTED 501
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
293
|
#define PROTOCOL_BAD_GATEWAY 502
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
294
|
#define PROTOCOL_SERVICE_UNAVAILABLE 503
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
295
|
#define PROTOCOL_GATEWAY_TIMEOUT 504
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
296
|
#define PROTOCOL_VERSION_NOT_SUPPORTED 505
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
297
|
#define PROTOCOL_INSUFFICIENT_STORAGE 507
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
298
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
299
|
#define PROTOCOL_VERSION_HTTP09 9
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
300
|
#define PROTOCOL_VERSION_HTTP10 100
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
301
|
#define PROTOCOL_VERSION_HTTP11 101
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
302
|
#define CURRENT_PROTOCOL_VERSION PROTOCOL_VERSION_HTTP11
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
303
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
304
|
/* Definitions for HTTP over SSL */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
305
|
#define HTTPS_PORT 443
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
306
|
#define HTTPS_URL "https"
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
307
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
308
|
/* Definitions for HTTP over TCP */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
309
|
#define HTTP_PORT 80
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
310
|
#define HTTP_URL "http"
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
311
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
312
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
313
|
#define REQ_MAX_LINE 4096
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
314
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
315
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
316
|
* The REQ_ return codes. These codes are used to determine what the server
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
317
|
* should do after a particular module completes its task.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
318
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
319
|
* Func type functions return these as do many internal functions.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
320
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
321
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
322
|
/* The function performed its task, proceed with the request */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
323
|
#define REQ_PROCEED 0
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
324
|
/* The entire request should be aborted: An error occurred */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
325
|
#define REQ_ABORTED -1
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
326
|
/* The function performed no task, but proceed anyway */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
327
|
#define REQ_NOACTION -2
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
328
|
/* Tear down the session and exit */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
329
|
#define REQ_EXIT -3
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
330
|
/* Restart the entire request-response process */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
331
|
#define REQ_RESTART -4
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
332
|
/* Too busy to execute this now */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
333
|
#define REQ_TOOBUSY -5
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
334
|
|
3
|
335
|
|
|
336
|
/**** NSAPI extensions ****/
|
|
337
|
|
|
338
|
/* The function is still in progress (async extension) */
|
|
339
|
#define REQ_PROCESSING -8
|
|
340
|
|
|
341
|
/**** END NSAPI extensions ****/
|
|
342
|
|
1
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
343
|
/* --- End miscellaneous definitions --- */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
344
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
345
|
/* --- Begin native platform includes --- */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
346
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
347
|
#ifdef XP_UNIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
348
|
#include <unistd.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
349
|
#include <sys/file.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
350
|
#ifndef HPUX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
351
|
#include <sys/select.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
352
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
353
|
#include <sys/socket.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
354
|
#include <sys/time.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
355
|
#include <sys/types.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
356
|
#include <sys/uio.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
357
|
#include <fcntl.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
358
|
#include <dirent.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
359
|
#include <pwd.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
360
|
#include <netinet/in.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
361
|
#endif /* XP_UNIX */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
362
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
363
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
364
|
#include <wtypes.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
365
|
#include <winbase.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
366
|
#include <direct.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
367
|
#include <winsock.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
368
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
369
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
370
|
#include <sys/stat.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
371
|
#include <ctype.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
372
|
#include <stdio.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
373
|
#include <stdarg.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
374
|
#include <stdlib.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
375
|
#include <string.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
376
|
#include <errno.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
377
|
#include <time.h>
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
378
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
379
|
/* --- End native platform includes --- */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
380
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
381
|
/* --- Begin type definitions --- */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
382
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
383
|
/* NOTE: both SYS_FILE and SYS_NETFD are actually NSPR PRFileDesc * and can */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
384
|
/* be used with NSPR API calls (after casting them to PRFileDesc *) */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
385
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
386
|
#ifndef SYS_FILE_T
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
387
|
typedef void *SYS_FILE;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
388
|
#define SYS_FILE_T void *
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
389
|
#endif /* !SYS_FILE_T */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
390
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
391
|
#define SYS_ERROR_FD ((SYS_FILE)-1)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
392
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
393
|
#ifndef SYS_NETFD_T
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
394
|
typedef void *SYS_NETFD;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
395
|
#define SYS_NETFD_T void *
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
396
|
#endif /* !SYS_NETFD_T */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
397
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
398
|
/* Error value for a SYS_NETFD */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
399
|
#ifndef SYS_NET_ERRORFD
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
400
|
#define SYS_NET_ERRORFD ((SYS_NETFD)-1)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
401
|
#endif /* !SYS_NET_ERRORFD */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
402
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
403
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
404
|
* These structures were originally defined in nsapi.h, but those definitions
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
405
|
* were removed in iPlanet Web Server 4.0. The contents of these structures
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
406
|
* are now private to the server implementation and must not be accessed
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
407
|
* directly. Instead, use the objset_*, object_*, directive_table_*, and
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
408
|
* directive_* accessor functions.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
409
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
410
|
typedef struct directive directive;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
411
|
typedef struct dtable dtable;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
412
|
typedef struct httpd_object httpd_object;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
413
|
typedef struct httpd_objset httpd_objset;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
414
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
415
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
416
|
* Type: filebuffer, filebuf_t
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
417
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
418
|
* Description:
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
419
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
420
|
* This structure is used to represent a buffered file. On some
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
421
|
* systems the file may be memory-mapped. A filebuffer is created
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
422
|
* by filebuf_open(), and destroyed by filebuf_close().
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
423
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
424
|
* Notes:
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
425
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
426
|
* Direct access to the members of this structure, not using
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
427
|
* macros defined here, is discouraged.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
428
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
429
|
* The filebuf alias that used to be defined for this type was
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
430
|
* found to conflict with a C++ class of the same name, so it
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
431
|
* has been renamed to filebuf_t.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
432
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
433
|
typedef struct filebuffer filebuffer;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
434
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
435
|
/* Version of filebuffer when memory-mapped files are supported */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
436
|
struct filebuffer {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
437
|
SYS_FILE fd;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
438
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
439
|
HANDLE fdmap;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
440
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
441
|
caddr_t fp;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
442
|
int len;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
443
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
444
|
unsigned char *inbuf;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
445
|
int cursize;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
446
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
447
|
int pos;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
448
|
const char *errmsg;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
449
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
450
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
451
|
/* Return next character or IO_EOF */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
452
|
#define filebuf_getc(b) ((b)->pos == (b)->len ? IO_EOF : (int)((b)->fp)[(b)->pos++])
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
453
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
454
|
#define filebuf_iseof(b) ((b)->pos == (b)->len)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
455
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
456
|
/* C++ streamio defines a filebuf class. */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
457
|
typedef filebuffer filebuf_t;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
458
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
459
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
460
|
/* Use a filebuffer to read data from a pipe */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
461
|
#define pipebuf_getc(b) \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
462
|
((b)->pos != (b)->cursize ? (int)((b)->inbuf[(b)->pos++]) : pipebuf_next(b,1))
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
463
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
464
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
465
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
466
|
* Type: netbuf
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
467
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
468
|
* Description:
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
469
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
470
|
* This structure is used to represent a buffered network socket.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
471
|
* It is created by netbuf_open(), and destroyed by netbuf_close().
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
472
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
473
|
* Notes:
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
474
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
475
|
* Direct access to the members of this structure, not using
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
476
|
* macros defined here, is discouraged.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
477
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
478
|
* The inbuf field used to be (unsigned char *), but is now
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
479
|
* simply (char *). The value returned by the netbuf_getc()
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
480
|
* macro is (int).
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
481
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
482
|
typedef struct netbuf netbuf;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
483
|
struct netbuf {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
484
|
SYS_NETFD sd;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
485
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
486
|
int pos, cursize, maxsize, rdtimeout;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
487
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
488
|
CHAR address[64];
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
489
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
490
|
unsigned char *inbuf;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
491
|
char *errmsg;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
492
|
#ifndef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
493
|
char address[64];
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
494
|
#endif /* !XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
495
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
496
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
497
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
498
|
* netbuf_getc gets a character from the given network buffer and returns
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
499
|
* it (as an integer).
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
500
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
501
|
* It will return (int) IO_ERROR for an error and (int) IO_EOF for
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
502
|
* an error condition or EOF respectively.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
503
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
504
|
#define netbuf_getc(b) \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
505
|
((b)->pos != (b)->cursize ? (int)((b)->inbuf[(b)->pos++]) : netbuf_next(b,1))
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
506
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
507
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
508
|
* buffer_error returns the last error that occurred with buffer. Don't use
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
509
|
* this unless you know an error occurred. Independent of network/file type.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
510
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
511
|
#define buffer_error(b) ((b)->errmsg)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
512
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
513
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
514
|
* Type: sendfiledata
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
515
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
516
|
* Description:
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
517
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
518
|
* This structure is used to pass arguments to the net_sendfile()
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
519
|
* function. offset and len may be set to 0 to transmit a file in its
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
520
|
* entirety.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
521
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
522
|
typedef struct sendfiledata sendfiledata;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
523
|
struct sendfiledata {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
524
|
SYS_FILE fd; /* file to send */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
525
|
size_t offset; /* offset in file to start sending from */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
526
|
size_t len; /* number of bytes to send from file */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
527
|
const void *header; /* data to send before file */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
528
|
int hlen; /* number of bytes to send before file */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
529
|
const void *trailer; /* data to send after file */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
530
|
int tlen; /* number of bytes to send after file */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
531
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
532
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
533
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
534
|
* Type: NSAPIIOVec
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
535
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
536
|
* Description:
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
537
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
538
|
* This structure is used to pass arguments to the net_writev()
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
539
|
* and FilterWritevFunc() functions.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
540
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
541
|
#ifdef _LP64
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
542
|
typedef struct NSAPIIOVec NSAPIIOVec;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
543
|
struct NSAPIIOVec {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
544
|
char *iov_base;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
545
|
int iov_len;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
546
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
547
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
548
|
typedef struct iovec NSAPIIOVec;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
549
|
#endif /* _LP64 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
550
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
551
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
552
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
553
|
* Type: cinfo
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
554
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
555
|
* Description:
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
556
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
557
|
* This is a structure that captures the information in the name/value
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
558
|
* pairs on one line of a mime.types file. A cinfo structure is
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
559
|
* stored in the memory-resident database, indexed by each of the
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
560
|
* file extensions specified in the "exts" name/value pair. It
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
561
|
* defines various attributes of resources with names containing
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
562
|
* the specified file extensions.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
563
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
564
|
* Notes:
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
565
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
566
|
* Pointers to cinfo structures returned by this API may or may not
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
567
|
* need to freed by the caller. See the individual function
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
568
|
* descriptions.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
569
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
570
|
* The strings referenced by the fields of cinfo structures returned
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
571
|
* by this API should be considered read-only, and do not need to be
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
572
|
* freed by the caller, even when the cinfo structure does.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
573
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
574
|
typedef struct cinfo cinfo;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
575
|
struct cinfo {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
576
|
char *type;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
577
|
char *encoding;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
578
|
char *language;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
579
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
580
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
581
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
582
|
typedef void* CONDVAR;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
583
|
typedef void *COUNTING_SEMAPHORE;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
584
|
typedef void* CRITICAL;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
585
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
586
|
#ifdef XP_UNIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
587
|
typedef DIR* SYS_DIR;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
588
|
typedef struct dirent SYS_DIRENT;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
589
|
#endif /* XP_UNIX */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
590
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
591
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
592
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
593
|
typedef struct dirent_s dirent_s;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
594
|
struct dirent_s {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
595
|
char *d_name;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
596
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
597
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
598
|
typedef struct dir_s dir_s;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
599
|
struct dir_s {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
600
|
HANDLE dp;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
601
|
WIN32_FIND_DATA fdata;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
602
|
dirent_s de;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
603
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
604
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
605
|
typedef dir_s* SYS_DIR;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
606
|
typedef dirent_s SYS_DIRENT;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
607
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
608
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
609
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
610
|
typedef struct pb_param pb_param;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
611
|
struct pb_param {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
612
|
char *name,*value;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
613
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
614
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
615
|
typedef struct pb_entry pb_entry;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
616
|
struct pb_entry {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
617
|
pb_param *param;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
618
|
struct pb_entry *next;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
619
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
620
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
621
|
typedef struct pblock pblock;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
622
|
struct pblock {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
623
|
int hsize;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
624
|
struct pb_entry **ht;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
625
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
626
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
627
|
#ifndef POOL_HANDLE_T
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
628
|
#define POOL_HANDLE_T
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
629
|
typedef void *pool_handle_t;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
630
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
631
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
632
|
#ifndef SEMAPHORE_T
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
633
|
typedef void *SEMAPHORE;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
634
|
#define SEMAPHORE_T void *
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
635
|
#endif /* !SEMAPHORE_T */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
636
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
637
|
#define SESSION_HASHSIZE 5
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
638
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
639
|
typedef struct PListStruct_s PListStruct_s;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
640
|
typedef struct ACLListHandle ACLListHandle;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
641
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
642
|
#ifndef PR_AF_INET
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
643
|
typedef union PRNetAddr PRNetAddr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
644
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
645
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
646
|
typedef struct Session Session;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
647
|
typedef struct Request Request;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
648
|
struct Session {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
649
|
pblock *client; /* client-specific information */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
650
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
651
|
SYS_NETFD csd; /* client file descriptor */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
652
|
netbuf *inbuf; /* input buffer */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
653
|
int csd_open;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
654
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
655
|
struct in_addr iaddr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
656
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
657
|
pool_handle_t *pool;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
658
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
659
|
void *clauth; /* v2 ACL client authentication information */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
660
|
struct Session *next;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
661
|
int fill;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
662
|
struct sockaddr_in local_addr; /* local addr for this session */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
663
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
664
|
PListStruct_s *subject;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
665
|
int ssl; /* 0 = SSL OFF, 1 = SSL ON */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
666
|
int clientauth; /* 0 = client auth OFF, 1 = client auth ON */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
667
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
668
|
PRNetAddr *pr_client_addr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
669
|
PRNetAddr *pr_local_addr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
670
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
671
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
672
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
673
|
* FuncPtr is a pointer to an NSAPI SAF function
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
674
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
675
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
676
|
#ifdef XP_UNIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
677
|
typedef int Func(pblock *, Session *, Request *);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
678
|
#else /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
679
|
typedef int _cdecl Func(pblock *, Session *, Request *);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
680
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
681
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
682
|
typedef Func *FuncPtr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
683
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
684
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
685
|
* FuncStruct is a structure used in the static declaration of the
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
686
|
* functions. This static declaration is parsed into a hash table at
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
687
|
* startup.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
688
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
689
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
690
|
typedef struct FuncStruct FuncStruct;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
691
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
692
|
struct FuncStruct {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
693
|
const char * name;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
694
|
FuncPtr func;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
695
|
struct FuncStruct *next;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
696
|
unsigned flags;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
697
|
unsigned poolID;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
698
|
unsigned pool_resolved;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
699
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
700
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
701
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
702
|
* VSInitFunc, VSDestroyFunc, VSDirectiveInitFunc and VSDirectiveDestroyFunc
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
703
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
704
|
typedef struct VirtualServer VirtualServer;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
705
|
typedef int VSInitFunc(VirtualServer *incoming, const VirtualServer *current);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
706
|
typedef void VSDestroyFunc(VirtualServer *outgoing);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
707
|
typedef VSInitFunc *VSInitFuncPtr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
708
|
typedef VSDestroyFunc *VSDestroyFuncPtr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
709
|
typedef int VSDirectiveInitFunc(const directive *dir, VirtualServer *incoming, const VirtualServer *current);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
710
|
typedef void VSDirectiveDestroyFunc(const directive *dir, VirtualServer *outgoing);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
711
|
typedef VSDirectiveInitFunc *VSDirectiveInitFuncPtr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
712
|
typedef VSDirectiveDestroyFunc *VSDirectiveDestroyFuncPtr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
713
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
714
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
715
|
* Filter is an opaque filter identifier
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
716
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
717
|
typedef struct Filter Filter;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
718
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
719
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
720
|
* FilterContext stores context associated with a particular filter layer
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
721
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
722
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
723
|
typedef struct FilterContext FilterContext;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
724
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
725
|
struct FilterContext {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
726
|
pool_handle_t *pool; /* pool context was allocated from */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
727
|
Session *sn; /* session being processed */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
728
|
Request *rq; /* request being processed */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
729
|
void *data; /* filter-defined private data */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
730
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
731
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
732
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
733
|
* FilterLayer represents one layer of a filter stack
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
734
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
735
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
736
|
typedef struct FilterLayer FilterLayer;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
737
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
738
|
struct FilterLayer {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
739
|
Filter *filter; /* the filter at this layer in the filter stack */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
740
|
FilterContext *context; /* context for the filter */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
741
|
SYS_NETFD lower; /* access to the next filter layer in the stack */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
742
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
743
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
744
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
745
|
* Function prototypes for filter methods
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
746
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
747
|
typedef int (FilterInsertFunc)(FilterLayer *layer, pblock *pb);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
748
|
typedef void (FilterRemoveFunc)(FilterLayer *layer);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
749
|
typedef int (FilterFlushFunc)(FilterLayer *layer);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
750
|
typedef int (FilterReadFunc)(FilterLayer *layer, void *buf, int amount, int timeout);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
751
|
typedef int (FilterWriteFunc)(FilterLayer *layer, const void *buf, int amount);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
752
|
typedef int (FilterWritevFunc)(FilterLayer *layer, const NSAPIIOVec *iov, int iov_size);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
753
|
typedef int (FilterSendfileFunc)(FilterLayer *layer, sendfiledata *sfd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
754
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
755
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
756
|
* FilterMethods is passed to filter_create() to declare the filter methods for
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
757
|
* a new filter. Each instance of the FilterMethods structure should be
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
758
|
* initialized using the FILTER_METHODS_INITIALIZER macro.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
759
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
760
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
761
|
typedef struct FilterMethods FilterMethods;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
762
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
763
|
struct FilterMethods {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
764
|
size_t size;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
765
|
#if NSAPI_VERSION >= 302
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
766
|
FilterInsertFunc *insert;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
767
|
FilterRemoveFunc *remove;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
768
|
FilterFlushFunc *flush;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
769
|
FilterReadFunc *read;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
770
|
FilterWriteFunc *write;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
771
|
FilterWritevFunc *writev;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
772
|
FilterSendfileFunc *sendfile;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
773
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
774
|
void *reserved1;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
775
|
void *reserved2;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
776
|
void *reserved3;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
777
|
void *reserved4;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
778
|
void *reserved5;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
779
|
void *reserved6;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
780
|
void *reserved7;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
781
|
#endif /* NSAPI_VERSION >= 302 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
782
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
783
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
784
|
#define FILTER_METHODS_INITIALIZER \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
785
|
{ \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
786
|
sizeof(FilterMethods), \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
787
|
NULL, /* insert */ \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
788
|
NULL, /* remove */ \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
789
|
NULL, /* flush */ \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
790
|
NULL, /* read */ \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
791
|
NULL, /* write */ \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
792
|
NULL, /* writev */ \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
793
|
NULL /* sendfile */ \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
794
|
}
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
795
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
796
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
797
|
* Filter order definitions for filter_create()
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
798
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
799
|
#define FILTER_CONTENT_GENERATION 0xf0000
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
800
|
#define FILTER_CONTENT_TRANSLATION_HIGH 0xa0000
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
801
|
#define FILTER_CONTENT_TRANSLATION 0x90000
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
802
|
#define FILTER_CONTENT_TRANSLATION_LOW 0x80000
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
803
|
#define FILTER_CONTENT_CODING 0x50000
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
804
|
#define FILTER_TRANSFER_CODING 0x40000
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
805
|
#define FILTER_MESSAGE_CODING 0x30000
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
806
|
#define FILTER_TRANSPORT_CODING 0x20000
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
807
|
#define FILTER_NETWORK 0x10000
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
808
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
809
|
typedef struct shmem_s shmem_s;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
810
|
struct shmem_s {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
811
|
void *data; /* the data */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
812
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
813
|
HANDLE fdmap;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
814
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
815
|
int size; /* the maximum length of the data */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
816
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
817
|
char *name; /* internal use: filename to unlink if exposed */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
818
|
SYS_FILE fd; /* internal use: file descriptor for region */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
819
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
820
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
821
|
/* Define a handle for a thread */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
822
|
typedef void* SYS_THREAD;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
823
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
824
|
/* Define an error value for the thread handle */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
825
|
#define SYS_THREAD_ERROR NULL
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
826
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
827
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
828
|
typedef struct conf_global_vars_s conf_global_vars_s;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
829
|
struct conf_global_vars_s {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
830
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
831
|
/* What port we listen to */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
832
|
int Vport; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
833
|
#define server_portnum conf_getglobals()->Vport
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
834
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
835
|
/* What address to bind to */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
836
|
char *Vaddr; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
837
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
838
|
/* User to run as */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
839
|
struct passwd *Vuserpw;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
840
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
841
|
/* Directory to chroot to */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
842
|
char *Vchr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
843
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
844
|
/* Where to log our pid to */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
845
|
char *Vpidfn;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
846
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
847
|
#define pool_max conf_getglobals()->Vpool_max
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
848
|
int Vpool_max;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
849
|
#define pool_min conf_getglobals()->Vpool_min
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
850
|
int Vpool_min; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
851
|
#define pool_life conf_getglobals()->Vpool_life
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
852
|
int Vpool_life; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
853
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
854
|
/* For multiprocess UNIX servers, the maximum threads per process */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
855
|
#define pool_maxthreads conf_getglobals()->Vpool_maxthreads
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
856
|
int Vpool_maxthreads;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
857
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
858
|
#define pool_minthreads conf_getglobals()->Vpool_minthreads
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
859
|
int Vpool_minthreads; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
860
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
861
|
char *Vsecure_keyfn; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
862
|
char *Vsecure_certfn; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
863
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
864
|
#define security_active conf_getglobals()->Vsecurity_active
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
865
|
int Vsecurity_active;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
866
|
int Vssl3_active; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
867
|
int Vssl2_active; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
868
|
int Vsecure_auth; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
869
|
int Vsecurity_session_timeout;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
870
|
long Vssl3_session_timeout;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
871
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
872
|
/* The server's hostname as should be reported in self-ref URLs */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
873
|
#define server_hostname conf_getglobals()->Vserver_hostname
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
874
|
char *Vserver_hostname;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
875
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
876
|
/* The main object from which all are derived */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
877
|
#define root_object conf_getglobals()->Vroot_object
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
878
|
char *Vroot_object;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
879
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
880
|
/* The object set the administrator has asked us to load */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
881
|
#define std_os conf_getglobals()->Vstd_os
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
882
|
httpd_objset *Vstd_os;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
883
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
884
|
/* The root of ACL data structures */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
885
|
void *Vacl_root;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
886
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
887
|
/* The main error log, where all errors are logged */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
888
|
char *Vmaster_error_log;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
889
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
890
|
/* The server root directory (contains instance subdirectories) */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
891
|
#define server_root conf_getglobals()->Vserver_root
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
892
|
char *Vserver_root;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
893
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
894
|
/* This server's id */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
895
|
#define server_id conf_getglobals()->Vserver_id
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
896
|
char *Vserver_id;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
897
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
898
|
/* Admin server users file */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
899
|
char *Vadmin_users;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
900
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
901
|
/* The installation directory (contains bin and lib subdirectories) */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
902
|
char *Vnetsite_root;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
903
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
904
|
/* Digest authentication stale nonce timeout value */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
905
|
int digest_stale_timeout;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
906
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
907
|
int single_accept; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
908
|
int num_keep_alives; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
909
|
int log_verbose; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
910
|
int mmap_flags; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
911
|
int mmap_prots; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
912
|
int unused1;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
913
|
int unused2;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
914
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
915
|
/* Begin Enterprise 3.0 fields */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
916
|
int accept_language; /* turn accept-language on/off */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
917
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
918
|
char *mtahost;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
919
|
char *nntphost; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
920
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
921
|
/* The root of ACL data structures */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
922
|
void *Vacl_root_30;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
923
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
924
|
char *agentFilePath; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
925
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
926
|
int Allowed; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
927
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
928
|
pblock *genericGlobals; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
929
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
930
|
char *agentsACLFile; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
931
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
932
|
int wait_for_cgi; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
933
|
int cgiwatch_timeout; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
934
|
int started_by_watchdog;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
935
|
int restarted_by_watchdog;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
936
|
int old_accel_cache_enabled; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
937
|
int Vssl_cache_entries;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
938
|
int blocking_listen_socket; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
939
|
pblock **initfns;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
940
|
char *vs_config_file; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
941
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
942
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
943
|
/* Type used for Request rq_attr bit flags */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
944
|
#ifdef AIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
945
|
#define RQATTR unsigned
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
946
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
947
|
#define RQATTR unsigned long
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
948
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
949
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
950
|
struct Request {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
951
|
/* Server working variables */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
952
|
pblock *vars;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
953
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
954
|
/* The method, URI, and protocol revision of this request */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
955
|
pblock *reqpb;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
956
|
/* Protocol specific headers */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
957
|
int loadhdrs;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
958
|
pblock *headers;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
959
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
960
|
/* Server's response headers */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
961
|
int senthdrs;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
962
|
pblock *srvhdrs;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
963
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
964
|
/* The object set constructed to fulfill this request */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
965
|
httpd_objset *os;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
966
|
/* Array of objects that were created from .nsconfig files */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
967
|
httpd_objset *tmpos;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
968
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
969
|
/* The stat last returned by request_stat_path */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
970
|
char *statpath;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
971
|
char *staterr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
972
|
struct stat *finfo;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
973
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
974
|
/* access control state */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
975
|
int aclstate; /* ACL decision state */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
976
|
int acldirno; /* deciding ACL directive number */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
977
|
char *aclname; /* name of deciding ACL */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
978
|
pblock *aclpb; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
979
|
/* 3.0 ACL list pointer */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
980
|
ACLListHandle *acllist;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
981
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
982
|
int request_is_cacheable; /* */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
983
|
int directive_is_cacheable; /* set by SAFs with no external side effects that make decisions based solely on URI and path */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
984
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
985
|
char *cached_headers; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
986
|
int cached_headers_len; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
987
|
char *unused;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
988
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
989
|
/* HTTP/1.1 features */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
990
|
#define REQ_TIME(x) (x)->req_start
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
991
|
time_t req_start; /* time request arrived - used for selecting weak or strong cache validation */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
992
|
short protv_num; /* protocol version number */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
993
|
short method_num; /* method number */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
994
|
struct rq_attr {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
995
|
RQATTR abs_uri:1; /* set if absolute URI was used */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
996
|
RQATTR chunked:1; /* chunked transfer-coding */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
997
|
RQATTR keep_alive:1; /* connection keep-alive */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
998
|
RQATTR pipelined:1; /* request packet is pipelined */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
999
|
RQATTR internal_req:1; /* this was an internal request */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1000
|
RQATTR perm_req:1; /* don't FREE() this request */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1001
|
RQATTR header_file_present:1; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1002
|
RQATTR footer_file_present:1; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1003
|
RQATTR jvm_attached:1; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1004
|
RQATTR req_restarted:1; /* request was restarted */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1005
|
RQATTR jvm_request_locked:1; /* used for first-request serialization on some platforms */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1006
|
RQATTR default_type_set:1; /* set if default types were set using set-default-type objecttype function */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1007
|
RQATTR is_web_app:1; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1008
|
RQATTR ssl_unclean_shutdown:1; /* set if browser requires unclean SSL shutdown */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1009
|
RQATTR vary_accept_language:1; /* set if request was restarted based on an accept-language header */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1010
|
RQATTR reserved:17; /* if you add a flag, make sure to subtract from this */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1011
|
} rq_attr;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1012
|
char *hostname; /* hostname used to access server (always non-NULL) */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1013
|
int allowed; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1014
|
int byterange; /* OBSOLETE */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1015
|
short status_num; /* HTTP status code */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1016
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1017
|
int staterrno; /* used for rqstat */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1018
|
Request *orig_rq; /* original Request - used for internal redirects */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1019
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1020
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1021
|
/* Request attribute macros */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1022
|
#define ABS_URI(x) (x)->rq_attr.abs_uri
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1023
|
#define CHUNKED(x) (x)->rq_attr.chunked
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1024
|
#define KEEP_ALIVE(x) (x)->rq_attr.keep_alive
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1025
|
#define PIPELINED(x) (x)->rq_attr.pipelined
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1026
|
#define INTERNAL_REQUEST(x) (x)->rq_attr.internal_req
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1027
|
#define RESTARTED_REQUEST(x) (x)->rq_attr.req_restarted
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1028
|
#define PERM_REQUEST(x) (x)->rq_attr.perm_req
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1029
|
#define JVM_REQUEST_LOCKED(x) (x)->rq_attr.jvm_request_locked
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1030
|
#define SSL_UNCLEAN_SHUTDOWN(x) (x)->rq_attr.ssl_unclean_shutdown
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1031
|
#define VARY_ACCEPT_LANGUAGE(x) (x)->rq_attr.vary_accept_language
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1032
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1033
|
/* Define methods for HTTP/1.1 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1034
|
#define METHOD_HEAD 0
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1035
|
#define METHOD_GET 1
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1036
|
#define METHOD_PUT 2
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1037
|
#define METHOD_POST 3
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1038
|
#define METHOD_DELETE 4
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1039
|
#define METHOD_TRACE 5
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1040
|
#define METHOD_OPTIONS 6
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1041
|
/* The following methods are Netscape method extensions */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1042
|
#define METHOD_MOVE 7
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1043
|
#define METHOD_INDEX 8
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1044
|
#define METHOD_MKDIR 9
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1045
|
#define METHOD_RMDIR 10
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1046
|
#define METHOD_COPY 11
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1047
|
#define METHOD_MAX 12 /* Number of methods available on this server */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1048
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1049
|
#define ISMGET(r) ((r)->method_num == METHOD_GET)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1050
|
#define ISMHEAD(r) ((r)->method_num == METHOD_HEAD)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1051
|
#define ISMPUT(r) ((r)->method_num == METHOD_PUT)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1052
|
#define ISMPOST(r) ((r)->method_num == METHOD_POST)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1053
|
#define ISMDELETE(r) ((r)->method_num == METHOD_DELETE)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1054
|
#define ISMMOVE(r) ((r)->method_num == METHOD_MOVE)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1055
|
#define ISMINDEX(r) ((r)->method_num == METHOD_INDEX)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1056
|
#define ISMMKDIR(r) ((r)->method_num == METHOD_MKDIR)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1057
|
#define ISMRMDIR(r) ((r)->method_num == METHOD_RMDIR)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1058
|
#define ISMCOPY(r) ((r)->method_num == METHOD_COPY)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1059
|
#define ISMTRACE(r) ((r)->method_num == METHOD_TRACE)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1060
|
#define ISMOPTIONS(r) ((r)->method_num == METHOD_OPTIONS)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1061
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1062
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1063
|
/* --- End type definitions --- */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1064
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1065
|
/* --- Begin dispatch vector table definition --- */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1066
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1067
|
typedef struct nsapi_dispatch_s nsapi_dispatch_t;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1068
|
struct nsapi_dispatch_s {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1069
|
char *(*f_system_version)();
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1070
|
void *(*f_system_malloc)(int size);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1071
|
void *(*f_system_calloc)(int size);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1072
|
void *(*f_system_realloc)(void *ptr, int size);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1073
|
void (*f_system_free)(void *ptr);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1074
|
char *(*f_system_strdup)(const char *ptr);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1075
|
void *(*f_system_malloc_perm)(int size);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1076
|
void *(*f_system_calloc_perm)(int size);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1077
|
void *(*f_system_realloc_perm)(void *ptr, int size);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1078
|
void (*f_system_free_perm)(void *ptr);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1079
|
char *(*f_system_strdup_perm)(const char *ptr);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1080
|
int (*f_getThreadMallocKey)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1081
|
void (*f_magnus_atrestart)(void (*fn)(void *), void *data);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1082
|
filebuf_t *(*f_filebuf_open)(SYS_FILE fd, int sz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1083
|
netbuf *(*f_netbuf_open)(SYS_NETFD sd, int sz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1084
|
filebuf_t *(*f_filebuf_create)(SYS_FILE fd, caddr_t mmap_ptr,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1085
|
int mmap_len, int bufsz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1086
|
void (*f_filebuf_close_buffer)(filebuf_t *buf, int clean_mmap);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1087
|
filebuf_t *(*f_filebuf_open_nostat)(SYS_FILE fd, int sz,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1088
|
struct stat *finfo);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1089
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1090
|
filebuf_t *(*f_pipebuf_open)(SYS_FILE fd, int sz, struct stat *finfo);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1091
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1092
|
void *(*f_pipebuf_open)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1093
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1094
|
int (*f_filebuf_next)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1095
|
int (*f_netbuf_next)(netbuf *buf, int advance);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1096
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1097
|
int (*f_pipebuf_next)(filebuf_t *buf, int advance);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1098
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1099
|
int (*f_pipebuf_next)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1100
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1101
|
void (*f_filebuf_close)(filebuf_t *buf);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1102
|
void (*f_netbuf_close)(netbuf *buf);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1103
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1104
|
void (*f_pipebuf_close)(filebuf_t *buf);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1105
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1106
|
void (*f_pipebuf_close)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1107
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1108
|
int (*f_filebuf_grab)(filebuf_t *buf, int sz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1109
|
int (*f_netbuf_grab)(netbuf *buf, int sz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1110
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1111
|
int (*f_pipebuf_grab)(filebuf_t *buf, int sz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1112
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1113
|
int (*f_pipebuf_grab)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1114
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1115
|
int (*f_netbuf_buf2sd)(netbuf *buf, SYS_NETFD sd, int len);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1116
|
int (*f_filebuf_buf2sd)(filebuf_t *buf, SYS_NETFD sd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1117
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1118
|
int (*f_pipebuf_buf2sd)(filebuf_t *buf, SYS_NETFD sd, int len);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1119
|
int (*f_pipebuf_netbuf2sd)(netbuf *buf, SYS_FILE sd, int len);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1120
|
int (*f_pipebuf_netbuf2pipe)(netbuf *buf, SYS_NETFD sd, int len);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1121
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1122
|
int (*f_pipebuf_buf2sd)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1123
|
int (*f_pipebuf_netbuf2sd)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1124
|
int (*f_pipebuf_netbuf2pipe)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1125
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1126
|
void (*f_cinfo_init)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1127
|
void (*f_cinfo_terminate)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1128
|
char *(*f_cinfo_merge)(char *fn);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1129
|
cinfo *(*f_cinfo_find)(char *uri);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1130
|
cinfo *(*f_cinfo_lookup)(char *type);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1131
|
void (*f_cinfo_dump_database)(FILE *dump);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1132
|
CRITICAL (*f_crit_init)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1133
|
void (*f_crit_enter)(CRITICAL id);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1134
|
void (*f_crit_exit)(CRITICAL id);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1135
|
void (*f_crit_terminate)(CRITICAL id);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1136
|
CONDVAR (*f_condvar_init)(CRITICAL id);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1137
|
void (*f_condvar_wait)(CONDVAR cv);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1138
|
void (*f_condvar_notify)(CONDVAR cv);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1139
|
void (*f_condvar_notifyAll)(CONDVAR cv);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1140
|
void (*f_condvar_terminate)(CONDVAR cv);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1141
|
COUNTING_SEMAPHORE (*f_cs_init)(int initial_count);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1142
|
void (*f_cs_terminate)(COUNTING_SEMAPHORE csp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1143
|
int (*f_cs_wait)(COUNTING_SEMAPHORE csp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1144
|
int (*f_cs_trywait)(COUNTING_SEMAPHORE csp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1145
|
int (*f_cs_release)(COUNTING_SEMAPHORE csp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1146
|
void (*f_daemon_atrestart)(void (*fn)(void *), void *data);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1147
|
/* Obsolete: servssl_init() */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1148
|
void (*f_servssl_init)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1149
|
int (*f_ereport)(int degree, const char *fmt, ...);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1150
|
int (*f_ereport_v)(int degree, const char *fmt, va_list args);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1151
|
char *(*f_ereport_init)(const char *err_fn, const char *email,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1152
|
struct passwd *pwuser, const char *version,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1153
|
int restart);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1154
|
void (*f_ereport_terminate)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1155
|
SYS_FILE (*f_ereport_getfd)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1156
|
SYS_FILE (*f_system_fopenRO)(const char *path);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1157
|
SYS_FILE (*f_system_fopenWA)(const char *path);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1158
|
SYS_FILE (*f_system_fopenRW)(const char *path);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1159
|
SYS_FILE (*f_system_fopenWT)(const char *path);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1160
|
int (*f_system_fread)(SYS_FILE fd, void *buf, int sz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1161
|
int (*f_system_fwrite)(SYS_FILE fd, const void *buf,int sz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1162
|
int (*f_system_fwrite_atomic)(SYS_FILE fd, const void *buf, int sz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1163
|
int (*f_system_lseek)(SYS_FILE fd, int off, int wh);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1164
|
int (*f_system_fclose)(SYS_FILE fd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1165
|
int (*f_system_stat)(const char *name, struct stat *finfo);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1166
|
int (*f_system_rename)(const char *oldpath, const char *newpath);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1167
|
int (*f_system_unlink)(const char *path);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1168
|
int (*f_system_tlock)(SYS_FILE fd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1169
|
int (*f_system_flock)(SYS_FILE fd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1170
|
int (*f_system_ulock)(SYS_FILE fd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1171
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1172
|
SYS_DIR (*f_dir_open)(const char *path);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1173
|
SYS_DIRENT *(*f_dir_read)(SYS_DIR ds);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1174
|
void (*f_dir_close)(SYS_DIR ds);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1175
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1176
|
void *(*f_dir_open)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1177
|
void *(*f_dir_read)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1178
|
void (*f_dir_close)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1179
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1180
|
int (*f_dir_create_all)(char *dir);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1181
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1182
|
void *(*f_system_winsockerr)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1183
|
void *(*f_system_winerr)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1184
|
int (*f_system_pread)(SYS_FILE fd, void *buf, int sz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1185
|
int (*f_system_pwrite)(SYS_FILE fd, const void *buf, int sz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1186
|
void (*f_file_unix2local)(const char *path, char *p2);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1187
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1188
|
void *(*f_system_winsockerr)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1189
|
void *(*f_system_winerr)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1190
|
int (*f_system_pread)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1191
|
int (*f_system_pwrite)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1192
|
void (*f_file_unix2local)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1193
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1194
|
int (*f_system_nocoredumps)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1195
|
int (*f_file_setinherit)(SYS_FILE fd, int value);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1196
|
int (*f_file_notfound)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1197
|
char *(*f_system_errmsg)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1198
|
int (*f_system_errmsg_fn)(char **buff, size_t maxlen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1199
|
SYS_NETFD (*f_net_socket)(int domain, int type, int protocol);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1200
|
int (*f_net_listen)(SYS_NETFD s, int backlog);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1201
|
SYS_NETFD (*f_net_create_listener)(const char *ipaddr, int port);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1202
|
int (*f_net_connect)(SYS_NETFD s, const void *sockaddr, int namelen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1203
|
int (*f_net_getpeername)(SYS_NETFD s, struct sockaddr *name, int *namelen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1204
|
int (*f_net_close)(SYS_NETFD s);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1205
|
int (*f_net_bind)(SYS_NETFD s, const struct sockaddr *name, int namelen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1206
|
SYS_NETFD (*f_net_accept)(SYS_NETFD s, struct sockaddr *addr, int *addrlen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1207
|
int (*f_net_read)(SYS_NETFD sd, void *buf, int sz, int timeout);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1208
|
int (*f_net_write)(SYS_NETFD sd, const void *buf, int sz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1209
|
int (*f_net_writev)(SYS_NETFD sd, const NSAPIIOVec *iov, int iovlen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1210
|
int (*f_net_isalive)(SYS_NETFD sd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1211
|
char *(*f_net_ip2host)(const char *ip, int verify);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1212
|
int (*f_net_getsockopt)(SYS_NETFD s, int level, int optname,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1213
|
void *optval, int *optlen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1214
|
int (*f_net_setsockopt)(SYS_NETFD s, int level, int optname,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1215
|
const void *optval, int optlen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1216
|
int (*f_net_select)(int nfds, fd_set *r, fd_set *w, fd_set *e,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1217
|
struct timeval *timeout);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1218
|
int (*f_net_ioctl)(SYS_NETFD s, int tag, void *result);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1219
|
pb_param *(*f_param_create)(const char *name, const char *value);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1220
|
int (*f_param_free)(pb_param *pp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1221
|
pblock *(*f_pblock_create)(int n);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1222
|
void (*f_pblock_free)(pblock *pb);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1223
|
char *(*f_pblock_findval)(const char *name, const pblock *pb);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1224
|
pb_param *(*f_pblock_nvinsert)(const char *name, const char *value, pblock *pb);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1225
|
pb_param *(*f_pblock_nninsert)(const char *name, int value, pblock *pb);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1226
|
void (*f_pblock_pinsert)(pb_param *pp, pblock *pb);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1227
|
int (*f_pblock_str2pblock)(const char *str, pblock *pb);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1228
|
char *(*f_pblock_pblock2str)(const pblock *pb, char *str);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1229
|
int (*f_pblock_copy)(const pblock *src, pblock *dst);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1230
|
pblock *(*f_pblock_dup)(const pblock *src);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1231
|
char **(*f_pblock_pb2env)(const pblock *pb, char **env);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1232
|
pb_param *(*f_pblock_fr)(const char *name, pblock *pb, int remove);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1233
|
char * (*f_pblock_replace)(const char *name,char * new_value,pblock *pb);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1234
|
pool_handle_t *(*f_pool_create)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1235
|
void (*f_pool_destroy)(pool_handle_t *pool_handle);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1236
|
int (*f_pool_enabled)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1237
|
void *(*f_pool_malloc)(pool_handle_t *pool_handle, size_t size );
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1238
|
void (*f_pool_free)(pool_handle_t *pool_handle, void *ptr );
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1239
|
void *(*f_pool_calloc)(pool_handle_t *pool_handle, size_t nelem, size_t elsize);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1240
|
void *(*f_pool_realloc)(pool_handle_t *pool_handle, void *ptr, size_t size );
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1241
|
char *(*f_pool_strdup)(pool_handle_t *pool_handle, const char *orig_str );
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1242
|
int (*f_regexp_valid)(const char *exp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1243
|
int (*f_regexp_match)(const char *str, const char *exp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1244
|
int (*f_regexp_cmp)(const char *str, const char *exp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1245
|
int (*f_regexp_casecmp)(const char *str, const char *exp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1246
|
SEMAPHORE (*f_sem_init)(char *name, int number);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1247
|
void (*f_sem_terminate)(SEMAPHORE id);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1248
|
int (*f_sem_grab)(SEMAPHORE id);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1249
|
int (*f_sem_tgrab)(SEMAPHORE id);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1250
|
int (*f_sem_release)(SEMAPHORE id);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1251
|
Session *(*f_session_alloc)(SYS_NETFD csd, struct sockaddr_in *sac); /* internal */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1252
|
Session *(*f_session_fill)(Session *sn); /* internal */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1253
|
Session *(*f_session_create)(SYS_NETFD csd, struct sockaddr_in *sac);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1254
|
void (*f_session_free)(Session *sn);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1255
|
char *(*f_session_dns_lookup)(Session *sn, int verify);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1256
|
int (*f_shexp_valid)(const char *exp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1257
|
int (*f_shexp_match)(const char *str, const char *exp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1258
|
int (*f_shexp_cmp)(const char *str, const char *exp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1259
|
int (*f_shexp_casecmp)(const char *str, const char *exp);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1260
|
shmem_s *(*f_shmem_alloc)(char *name, int size, int expose);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1261
|
void (*f_shmem_free)(shmem_s *region);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1262
|
SYS_THREAD (*f_systhread_start)(int prio, int stksz, void (*fn)(void *), void *arg);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1263
|
SYS_THREAD (*f_systhread_current)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1264
|
void (*f_systhread_yield)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1265
|
SYS_THREAD (*f_systhread_attach)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1266
|
void (*f_systhread_detach)(SYS_THREAD thr);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1267
|
void (*f_systhread_terminate)(SYS_THREAD thr);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1268
|
void (*f_systhread_sleep)(int milliseconds);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1269
|
void (*f_systhread_init)(char *name);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1270
|
void (*f_systhread_timerset)(int usec);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1271
|
int (*f_systhread_newkey)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1272
|
void *(*f_systhread_getdata)(int key);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1273
|
void (*f_systhread_setdata)(int key, void *data);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1274
|
void (*f_systhread_set_default_stacksize)(unsigned long size);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1275
|
int (*f_util_getline)(filebuffer *buf, int lineno, int maxlen, char *l);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1276
|
char **(*f_util_env_create)(char **env, int n, int *pos);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1277
|
char *(*f_util_env_str)(const char *name, const char *value);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1278
|
void (*f_util_env_replace)(char **env, const char *name, const char *value);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1279
|
void (*f_util_env_free)(char **env);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1280
|
char **(*f_util_env_copy)(char **src, char **dst);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1281
|
char *(*f_util_env_find)(char **env, const char *name);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1282
|
char *(*f_util_hostname)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1283
|
int (*f_util_chdir2path)(char *path);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1284
|
int (*f_util_is_mozilla)(char *ua, char *major, char *minor);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1285
|
int (*f_util_is_url)(const char *url);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1286
|
int (*f_util_later_than)(const struct tm *lms, const char *ims);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1287
|
int (*f_util_time_equal)(const struct tm *lms, const char *ims);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1288
|
int (*f_util_str_time_equal)(const char *t1, const char *t2);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1289
|
int (*f_util_uri_is_evil)(const char *t);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1290
|
void (*f_util_uri_parse)(char *uri);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1291
|
void (*f_util_uri_unescape)(char *s);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1292
|
char *(*f_util_uri_escape)(char *d, const char *s);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1293
|
char *(*f_util_url_escape)(char *d, const char *s);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1294
|
char *(*f_util_sh_escape)(char *s);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1295
|
int (*f_util_mime_separator)(char *sep);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1296
|
int (*f_util_itoa)(int i, char *a);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1297
|
int (*f_util_vsprintf)(char *s, register const char *fmt, va_list args);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1298
|
int (*f_util_sprintf)(char *s, const char *fmt, ...);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1299
|
int (*f_util_vsnprintf)(char *s, int n, register const char *fmt,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1300
|
va_list args);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1301
|
int (*f_util_snprintf)(char *s, int n, const char *fmt, ...);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1302
|
int (*f_util_strftime)(char *s, const char *format, const struct tm *t);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1303
|
char *(*f_util_strtok)(char *s1, const char *s2, char **lasts);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1304
|
struct tm *(*f_util_localtime)(const time_t *clock, struct tm *res);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1305
|
char *(*f_util_ctime)(const time_t *clock, char *buf, int buflen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1306
|
char *(*f_util_strerror)(int errnum, char *msg, int buflen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1307
|
struct tm *(*f_util_gmtime)(const time_t *clock, struct tm *res);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1308
|
char *(*f_util_asctime)(const struct tm *tm,char *buf, int buflen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1309
|
#ifdef NEED_STRCASECMP
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1310
|
int (*f_util_strcasecmp)(const char *one, const char *two);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1311
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1312
|
int (*f_util_strcasecmp)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1313
|
#endif /* NEED_STRCASECMP */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1314
|
#ifdef NEED_STRNCASECMP
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1315
|
int (*f_util_strncasecmp)(const char *one, const char *two, int n);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1316
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1317
|
int (*f_util_strncasecmp)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1318
|
#endif /* NEED_STRNCASECMP */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1319
|
#ifdef XP_UNIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1320
|
int (*f_util_can_exec)(struct stat *finfo, uid_t uid, gid_t gid);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1321
|
struct passwd *(*f_util_getpwnam)(const char *name, struct passwd
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1322
|
*result, char *buffer, int buflen);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1323
|
pid_t (*f_util_waitpid)(pid_t pid, int *statptr, int options);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1324
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1325
|
int (*f_util_can_exec)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1326
|
void *(*f_util_getpwnam)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1327
|
int (*f_util_waitpid)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1328
|
#endif /* XP_UNIX */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1329
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1330
|
VOID (*f_util_delete_directory)(char *FileName, BOOL delete_directory);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1331
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1332
|
void (*f_util_delete_directory)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1333
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1334
|
void *(*f_conf_init)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1335
|
void *(*f_conf_run_init_functions)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1336
|
void (*f_conf_terminate)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1337
|
conf_global_vars_s *(*f_conf_getglobals)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1338
|
void (*f_func_init)(struct FuncStruct *func_standard);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1339
|
FuncPtr (*f_func_find)(char *name);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1340
|
int (*f_func_exec)(pblock *pb, Session *sn, Request *rq);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1341
|
struct FuncStruct *(*f_func_insert)(char *name, FuncPtr fn);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1342
|
int (*f_object_execute)(directive *inst, Session *sn, Request *rq);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1343
|
void *(*f_http_find_request)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1344
|
int (*f_http_parse_request)(char *t, Request *rq, Session *sn);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1345
|
int (*f_http_scan_headers)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1346
|
int (*f_http_start_response)(Session *sn, Request *rq);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1347
|
char **(*f_http_hdrs2env)(pblock *pb);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1348
|
void (*f_http_status)(Session *sn, Request *rq, int n, const char *r);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1349
|
int (*f_http_set_finfo)(Session *sn, Request *rq, struct stat *finfo);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1350
|
char *(*f_http_dump822)(pblock *pb, char *t, int *pos, int tsz);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1351
|
void (*f_http_finish_request)(Session *sn, Request *rq);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1352
|
void (*f_http_handle_session)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1353
|
char *(*f_http_uri2url)(const char *prefix, const char *suffix);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1354
|
char *(*f_http_uri2url_dynamic)(const char *prefix, const char *suffix,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1355
|
Session *sn, Request *rq);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1356
|
void (*f_http_set_keepalive_timeout)(int secs);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1357
|
int (*f_log_error_v)(int degree, const char *func, Session *sn,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1358
|
Request *rq, const char *fmt, va_list args);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1359
|
int (*f_log_error)(int degree, const char *func, Session *sn, Request *rq,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1360
|
const char *fmt, ...);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1361
|
int (*f_log_ereport_v)(int degree, const char *fmt, va_list args);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1362
|
int (*f_log_ereport)(int degree, const char *fmt, ...);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1363
|
httpd_object *(*f_object_create)(int nd, pblock *name);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1364
|
void (*f_object_free)(httpd_object *obj);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1365
|
void (*f_object_add_directive)(int dc, pblock *p, pblock *c,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1366
|
httpd_object *obj);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1367
|
httpd_objset *(*f_objset_scan_buffer)(filebuffer *buf, char *errstr,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1368
|
httpd_objset *os);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1369
|
httpd_objset *(*f_objset_create)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1370
|
void (*f_objset_free)(httpd_objset *os);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1371
|
void (*f_objset_free_setonly)(httpd_objset *os);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1372
|
httpd_object *(*f_objset_new_object)(pblock *name, httpd_objset *os);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1373
|
void (*f_objset_add_object)(httpd_object *obj, httpd_objset *os);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1374
|
void (*f_objset_add_init)(pblock *initfn, httpd_objset *os);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1375
|
httpd_object *(*f_objset_findbyname)(const char *name, httpd_objset *ign,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1376
|
httpd_objset *os);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1377
|
httpd_object *(*f_objset_findbyppath)(char *ppath, httpd_objset *ign,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1378
|
httpd_objset *os);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1379
|
Request *(*f_request_create)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1380
|
void (*f_request_free)(Request *req);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1381
|
Request *(*f_request_restart_internal)(const char *uri, Request *rq);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1382
|
int (*f_request_header)(char *name, char **value, Session *sn,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1383
|
Request *rq);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1384
|
struct stat *(*f_request_stat_path)(const char *path, Request *rq);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1385
|
const char *(*f_conf_getServerString)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1386
|
FuncPtr (*f_func_replace)(char *funcname, FuncPtr fn);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1387
|
int (*f_net_socketpair)(SYS_NETFD *pair);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1388
|
#ifdef XP_UNIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1389
|
SYS_NETFD (*f_net_dup2)(SYS_NETFD prfd, int osfd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1390
|
int (*f_net_is_STDOUT)(SYS_NETFD prfd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1391
|
int (*f_net_is_STDIN)(SYS_NETFD prfd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1392
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1393
|
void *(*f_net_dup2)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1394
|
int (*f_net_is_STDOUT)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1395
|
int (*f_net_is_STDIN)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1396
|
#endif /* XP_UNIX */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1397
|
int (*f_func_set_native_thread_flag)(char *name, int flags);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1398
|
#ifdef NET_SSL
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1399
|
void *(*f_random_create)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1400
|
void (*f_random_update)(void *rctx, unsigned char *inbuf, int length);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1401
|
void (*f_random_generate)(void *rctx, unsigned char *outbuf, int length);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1402
|
void (*f_random_destroy)(void *rctx);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1403
|
void *(*f_md5hash_create)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1404
|
void *(*f_md5hash_copy)(void *hctx);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1405
|
void (*f_md5hash_begin)(void *hctx);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1406
|
void (*f_md5hash_update)(void *hctx, unsigned char *inbuf, int length);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1407
|
void (*f_md5hash_end)(void *hctx, unsigned char *outbuf);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1408
|
void (*f_md5hash_destroy)(void *hctx);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1409
|
void (*f_md5hash_data)(unsigned char *outbuf, unsigned char *src, int length);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1410
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1411
|
void *(*f_random_create)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1412
|
void (*f_random_update)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1413
|
void (*f_random_generate)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1414
|
void (*f_random_destroy)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1415
|
void *(*f_md5hash_create)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1416
|
void *(*f_md5hash_copy)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1417
|
void (*f_md5hash_begin)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1418
|
void (*f_md5hash_update)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1419
|
void (*f_md5hash_end)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1420
|
void (*f_md5hash_destroy)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1421
|
void (*f_md5hash_data)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1422
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1423
|
int (*f_ACL_SetupEval)(struct ACLListHandle *acllist, Session *sn, Request *rq, char **rights, char **map_generic, const char *user);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1424
|
int (*f_netbuf_getbytes)(netbuf *buf, char *buffer, int size);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1425
|
char *(*f_servact_translate_uri)(char *uri, Session *sn);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1426
|
#ifdef NET_SSL
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1427
|
int (*f_rsa_set_priv_fn)(void *);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1428
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1429
|
int (*f_rsa_set_priv_fn)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1430
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1431
|
#ifdef XP_UNIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1432
|
int (*f_net_native_handle)(SYS_NETFD s);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1433
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1434
|
HANDLE (*f_net_native_handle)(SYS_NETFD s);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1435
|
#endif /* XP_UNIX */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1436
|
int (*f_internal_request)(Request *rq);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1437
|
char *(*f_util_cookie_find)(char *cookie, const char *name);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1438
|
char *(*f_util_cookie_next)(char *cookie, char **name, char **value);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1439
|
char *(*f_util_cookie_next_av_pair)(char *cookie, char **name, char **value);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1440
|
int (*f_objset_get_number_objects)(const httpd_objset *objset);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1441
|
const httpd_object *(*f_objset_get_object)(const httpd_objset *objset, int pos);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1442
|
const pblock * const *(*f_objset_get_initfns)(const httpd_objset *objset);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1443
|
const pblock *(*f_object_get_name)(const httpd_object *object);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1444
|
int (*f_object_get_num_directives)(const httpd_object *object);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1445
|
const dtable *(*f_object_get_directive_table)(const httpd_object *object, int n);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1446
|
int (*f_directive_table_get_num_directives)(const dtable *dt);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1447
|
const directive *(*f_directive_table_get_directive)(const dtable *dt, int pos);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1448
|
const pblock *(*f_directive_get_pblock)(const directive *);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1449
|
const FuncStruct *(*f_directive_get_funcstruct)(const directive *);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1450
|
const pblock *(*f_directive_get_client_pblock)(const directive *);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1451
|
#if NSAPI_VERSION >= 301
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1452
|
int (*f_vs_register_cb)(VSInitFunc *vs_init_func, VSDestroyFunc *vs_destroy_func);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1453
|
const char* (*f_vs_get_id)(const VirtualServer *vs);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1454
|
const char* (*f_vs_lookup_config_var)(const VirtualServer *vs, const char *name);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1455
|
int (*f_vs_alloc_slot)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1456
|
void* (*f_vs_set_data)(const VirtualServer *vs, int *slot, void *data);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1457
|
void* (*f_vs_get_data)(const VirtualServer *vs, int slot);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1458
|
const VirtualServer* (*f_request_get_vs)(Request *rq);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1459
|
httpd_objset* (*f_vs_get_httpd_objset)(VirtualServer *vs);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1460
|
httpd_object* (*f_vs_get_default_httpd_object)(VirtualServer *vs);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1461
|
char* (*f_vs_get_doc_root)(const VirtualServer *vs);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1462
|
char* (*f_vs_translate_uri)(const VirtualServer *vs, const char *uri);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1463
|
char* (*f_vs_get_mime_type)(const VirtualServer *vs, const char *uri);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1464
|
int (*f_vs_is_default_vs)(const VirtualServer *vs);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1465
|
void *(*f_vs_get_acllist)(const VirtualServer *vs);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1466
|
void (*f_vs_set_acllist)(VirtualServer *vs, void *acllist);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1467
|
int (*f_file_is_path_abs)(const char *path);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1468
|
char* (*f_file_canonicalize_path)(const char* path);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1469
|
int (*f_file_are_files_distinct)(SYS_FILE fd1, SYS_FILE fd2);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1470
|
int (*f_vs_directive_register_cb)(FuncPtr func, VSDirectiveInitFunc *vs_init_func, VSDirectiveDestroyFunc *vs_destroy_func);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1471
|
char* (*f_vs_substitute_vars)(const VirtualServer *vs, const char *string);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1472
|
const char *(*f_conf_getfilename)(void);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1473
|
const char *(*f_conf_getstring)(const char *name, const char *def);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1474
|
int (*f_conf_getboolean)(const char *name, int def);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1475
|
int (*f_conf_getinteger)(const char *name, int def);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1476
|
int (*f_conf_getboundedinteger)(const char *name, int min, int max, int def);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1477
|
void (*f_prepare_nsapi_thread)(Request *rq, Session *sn);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1478
|
#endif /* NSAPI_VERSION >= 301 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1479
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1480
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1481
|
#if NSAPI_VERSION >= 302
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1482
|
typedef struct nsapi302_dispatch_s nsapi302_dispatch_t;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1483
|
struct nsapi302_dispatch_s {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1484
|
int (*f_net_flush)(SYS_NETFD sd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1485
|
int (*f_net_sendfile)(SYS_NETFD sd, sendfiledata *sfd);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1486
|
const Filter *(*f_filter_create)(const char *name, int order, const FilterMethods *methods);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1487
|
const char *(*f_filter_name)(const Filter *filter);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1488
|
const Filter *(*f_filter_find)(const char *name);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1489
|
FilterLayer *(*f_filter_layer)(SYS_NETFD sd, const Filter *filter);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1490
|
int (*f_filter_insert)(SYS_NETFD sd, pblock *pb, Session *sn, Request *rq, void *data, const Filter *filter);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1491
|
int (*f_filter_remove)(SYS_NETFD sd, const Filter *filter);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1492
|
SYS_NETFD (*f_filter_create_stack)(Session *sn);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1493
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1494
|
#endif /* NSAPI_VERSION >= 302 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1495
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1496
|
#if NSAPI_VERSION >= 303
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1497
|
typedef struct nsapi303_dispatch_s nsapi303_dispatch_t;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1498
|
struct hostent;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1499
|
struct nsapi303_dispatch_s {
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1500
|
int (*f_dns_set_hostent)(struct hostent *he, Session *sn, Request *rq);
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1501
|
};
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1502
|
#endif /* NSAPI_VERSION >= 303 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1503
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1504
|
/* --- End dispatch vector table definition --- */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1505
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1506
|
/* --- Begin API macro definitions --- */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1507
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1508
|
#ifndef INTNSAPI
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1509
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1510
|
#if NSAPI_VERSION >= 301
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1511
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1512
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1513
|
* In Sun ONE Web Server 6.1 and higher, http_parse_request("", NULL, NULL)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1514
|
* returns the NSAPI version. In previous releases, it returns -1.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1515
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1516
|
#define __NSAPI_RUNTIME_VERSION \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1517
|
((*__nsapi30_table->f_http_parse_request)("", NULL, NULL))
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1518
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1519
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1520
|
* NSAPI_RUNTIME_VERSION returns the NSAPI version the server implements. The
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1521
|
* returned NSAPI version number is reliable only in iPlanet Web Server 6.0,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1522
|
* Netscape Enterprise Server 6.0, and Sun ONE Web Server 6.0 and higher.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1523
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1524
|
#define NSAPI_RUNTIME_VERSION \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1525
|
(__NSAPI_RUNTIME_VERSION > 0 ? __NSAPI_RUNTIME_VERSION : 301)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1526
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1527
|
#endif /* NSAPI_VERSION >= 301 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1528
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1529
|
#define system_version (*__nsapi30_table->f_system_version)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1530
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1531
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1532
|
* Depending on the system, memory allocated via these macros may come from
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1533
|
* an arena. If these functions are called from within an Init function, they
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1534
|
* will be allocated from permanent storage. Otherwise, they will be freed
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1535
|
* when the current request is finished.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1536
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1537
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1538
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1539
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1540
|
#endif /* !INTNSAPI */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1541
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1542
|
#ifdef XP_UNIX
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1543
|
#define dir_open opendir
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1544
|
#define dir_read readdir
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1545
|
#define dir_close closedir
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1546
|
#define dir_create(path) mkdir(path, 0755)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1547
|
#define dir_remove rmdir
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1548
|
#define system_chdir chdir
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1549
|
#define file_unix2local(path,p2) strcpy(p2,path)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1550
|
#endif /* XP_UNIX */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1551
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1552
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1553
|
#define dir_create _mkdir
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1554
|
#define dir_remove _rmdir
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1555
|
#define system_chdir SetCurrentDirectory
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1556
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1557
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1558
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1559
|
* Thread-safe variants of localtime and gmtime
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1560
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1561
|
#define system_localtime(curtime, ret) util_localtime(curtime, ret)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1562
|
#define system_gmtime(curtime, ret) util_gmtime(curtime, ret)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1563
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1564
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1565
|
* pblock_find finds the entry with the given name in pblock pb.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1566
|
*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1567
|
* If it is successful, it returns the param block. If not, it returns NULL.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1568
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1569
|
#define pblock_find(name, pb) (pblock_fr(name,pb,0))
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1570
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1571
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1572
|
* pblock_remove behaves exactly like pblock_find, but removes the given
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1573
|
* entry from pb.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1574
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1575
|
#define pblock_remove(name, pb) (pblock_fr(name,pb,1))
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1576
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1577
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1578
|
* session_dns returns the DNS hostname of the client of this session,
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1579
|
* and inserts it into the client pblock. Returns NULL if unavailable.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1580
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1581
|
#define session_dns(sn) session_dns_lookup(sn, 0)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1582
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1583
|
/*
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1584
|
* session_maxdns looks up a hostname from an IP address, and then verifies
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1585
|
* that the host is really who they claim to be.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1586
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1587
|
#define session_maxdns(sn) session_dns_lookup(sn, 1)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1588
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1589
|
#define protocol_start_response http_start_response
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1590
|
#define protocol_status http_status
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1591
|
#define protocol_set_finfo http_set_finfo
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1592
|
#define protocol_finish_request http_finish_request
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1593
|
#define protocol_uri2url http_uri2url
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1594
|
#define protocol_uri2url_dynamic http_uri2url_dynamic
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1595
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1596
|
#define request_translate_uri servact_translate_uri
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1597
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1598
|
/* --- OBSOLETE ----------------------------------------------------------
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1599
|
* The following macros/functions are obsolete and are only maintained for
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1600
|
* compatibility. Do not use them.
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1601
|
* -----------------------------------------------------------------------
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1602
|
*/
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1603
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1604
|
#define SYS_STDERR STDERR_FILENO
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1605
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1606
|
#ifdef XP_WIN32
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1607
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1608
|
typedef HANDLE pid_t;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1609
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1610
|
#define ERROR_PIPE \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1611
|
(ERROR_BROKEN_PIPE | ERROR_BAD_PIPE | \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1612
|
ERROR_PIPE_BUSY | ERROR_PIPE_LISTENING | ERROR_PIPE_NOT_CONNECTED)
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1613
|
#define CONVERT_TO_PRINTABLE_FORMAT(Filename) \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1614
|
{ \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1615
|
register char *s; \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1616
|
if (Filename) \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1617
|
for (s = Filename; *s; s++) \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1618
|
if ( *s == '\\') \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1619
|
*s = '/'; \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1620
|
}
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1621
|
#define CONVERT_TO_NATIVE_FS(Filename) \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1622
|
{ \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1623
|
register char *s; \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1624
|
if (Filename) \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1625
|
for (s = Filename; *s; s++) \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1626
|
if ( *s == '/') \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1627
|
*s = '\\'; \
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1628
|
}
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1629
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1630
|
#ifdef INTNSAPI
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1631
|
NSAPI_PUBLIC extern nsapi_dispatch_t *__nsapi30_table;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1632
|
#if NSAPI_VERSION >= 302
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1633
|
NSAPI_PUBLIC extern nsapi302_dispatch_t *__nsapi302_table;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1634
|
#endif /* NSAPI_VERSION >= 302 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1635
|
#if NSAPI_VERSION >= 303
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1636
|
NSAPI_PUBLIC extern nsapi303_dispatch_t *__nsapi303_table;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1637
|
#endif /* NSAPI_VERSION >= 303 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1638
|
#else
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1639
|
__declspec(dllimport) nsapi_dispatch_t *__nsapi30_table;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1640
|
#if NSAPI_VERSION >= 302
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1641
|
__declspec(dllimport) nsapi302_dispatch_t *__nsapi302_table;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1642
|
#endif /* NSAPI_VERSION >= 302 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1643
|
#if NSAPI_VERSION >= 303
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1644
|
__declspec(dllimport) nsapi303_dispatch_t *__nsapi303_table;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1645
|
#endif /* NSAPI_VERSION >= 303 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1646
|
#endif /* INTNSAPI */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1647
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1648
|
#else /* !XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1649
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1650
|
NSAPI_PUBLIC extern nsapi_dispatch_t *__nsapi30_table;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1651
|
#if NSAPI_VERSION >= 302
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1652
|
NSAPI_PUBLIC extern nsapi302_dispatch_t *__nsapi302_table;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1653
|
#endif /* NSAPI_VERSION >= 302 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1654
|
#if NSAPI_VERSION >= 303
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1655
|
NSAPI_PUBLIC extern nsapi303_dispatch_t *__nsapi303_table;
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1656
|
#endif /* NSAPI_VERSION >= 303 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1657
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1658
|
#endif /* XP_WIN32 */
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1659
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1660
|
#ifdef __cplusplus
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1661
|
}
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1662
|
#endif
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1663
|
|
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1664
|
#endif /* !PUBLIC_NSAPI_H */
|