~hexmode/+junk/main

« back to all changes in this revision

Viewing changes to install-files/bin/apache/apache2.2.6/include/http_core.h

  • Committer: Mark A. Hershberger
  • Date: 2008-01-05 19:38:56 UTC
  • Revision ID: hershberger@spawn-xp-20080105193856-6rnzgwa4nehue3qj
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Licensed to the Apache Software Foundation (ASF) under one or more
 
2
 * contributor license agreements.  See the NOTICE file distributed with
 
3
 * this work for additional information regarding copyright ownership.
 
4
 * The ASF licenses this file to You under the Apache License, Version 2.0
 
5
 * (the "License"); you may not use this file except in compliance with
 
6
 * the License.  You may obtain a copy of the License at
 
7
 *
 
8
 *     http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 * Unless required by applicable law or agreed to in writing, software
 
11
 * distributed under the License is distributed on an "AS IS" BASIS,
 
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
 
15
 */
 
16
 
 
17
/**
 
18
 * @file  http_core.h
 
19
 * @brief CORE HTTP Daemon
 
20
 *
 
21
 * @defgroup APACHE_CORE_HTTPD Core HTTP Daemon
 
22
 * @ingroup  APACHE_CORE
 
23
 * @{
 
24
 */
 
25
 
 
26
#ifndef APACHE_HTTP_CORE_H
 
27
#define APACHE_HTTP_CORE_H
 
28
 
 
29
#include "apr.h"
 
30
#include "apr_hash.h"
 
31
#include "apr_optional.h"
 
32
#include "util_filter.h"
 
33
 
 
34
#if APR_HAVE_STRUCT_RLIMIT
 
35
#include <sys/time.h>
 
36
#include <sys/resource.h>
 
37
#endif
 
38
 
 
39
 
 
40
#ifdef __cplusplus
 
41
extern "C" {
 
42
#endif
 
43
 
 
44
/* ****************************************************************
 
45
 *
 
46
 * The most basic server code is encapsulated in a single module
 
47
 * known as the core, which is just *barely* functional enough to
 
48
 * serve documents, though not terribly well.
 
49
 *
 
50
 * Largely for NCSA back-compatibility reasons, the core needs to
 
51
 * make pieces of its config structures available to other modules.
 
52
 * The accessors are declared here, along with the interpretation
 
53
 * of one of them (allow_options).
 
54
 */
 
55
 
 
56
/**
 
57
 * @defgroup APACHE_CORE_HTTPD_ACESSORS Acessors
 
58
 *
 
59
 * @brief File/Directory Accessor directives
 
60
 *
 
61
 * @{
 
62
 */
 
63
 
 
64
/** No directives */
 
65
#define OPT_NONE 0
 
66
/** Indexes directive */
 
67
#define OPT_INDEXES 1
 
68
/**  Includes directive */
 
69
#define OPT_INCLUDES 2
 
70
/**  FollowSymLinks directive */
 
71
#define OPT_SYM_LINKS 4
 
72
/**  ExecCGI directive */
 
73
#define OPT_EXECCGI 8
 
74
/**  directive unset */
 
75
#define OPT_UNSET 16
 
76
/**  IncludesNOEXEC directive */
 
77
#define OPT_INCNOEXEC 32
 
78
/** SymLinksIfOwnerMatch directive */
 
79
#define OPT_SYM_OWNER 64
 
80
/** MultiViews directive */
 
81
#define OPT_MULTI 128
 
82
/**  All directives */
 
83
#define OPT_ALL (OPT_INDEXES|OPT_INCLUDES|OPT_SYM_LINKS|OPT_EXECCGI)
 
84
/** @} */
 
85
 
 
86
/**
 
87
 * @defgroup get_remote_host Remote Host Resolution 
 
88
 * @ingroup APACHE_CORE_HTTPD
 
89
 * @{
 
90
 */
 
91
/** REMOTE_HOST returns the hostname, or NULL if the hostname
 
92
 * lookup fails.  It will force a DNS lookup according to the
 
93
 * HostnameLookups setting.
 
94
 */
 
95
#define REMOTE_HOST (0)
 
96
 
 
97
/** REMOTE_NAME returns the hostname, or the dotted quad if the
 
98
 * hostname lookup fails.  It will force a DNS lookup according
 
99
 * to the HostnameLookups setting.
 
100
 */
 
101
#define REMOTE_NAME (1)
 
102
 
 
103
/** REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is
 
104
 * never forced.
 
105
 */
 
106
#define REMOTE_NOLOOKUP (2)
 
107
 
 
108
/** REMOTE_DOUBLE_REV will always force a DNS lookup, and also force
 
109
 * a double reverse lookup, regardless of the HostnameLookups
 
110
 * setting.  The result is the (double reverse checked) hostname,
 
111
 * or NULL if any of the lookups fail.
 
112
 */
 
113
#define REMOTE_DOUBLE_REV (3)
 
114
 
 
115
/** @} // get_remote_host */
 
116
 
 
117
/** all of the requirements must be met */
 
118
#define SATISFY_ALL 0
 
119
/**  any of the requirements must be met */
 
120
#define SATISFY_ANY 1
 
121
/** There are no applicable satisfy lines */
 
122
#define SATISFY_NOSPEC 2
 
123
 
 
124
/** Make sure we don't write less than 8000 bytes at any one time.
 
125
 */
 
126
#define AP_MIN_BYTES_TO_WRITE  8000
 
127
 
 
128
/** default maximum of internal redirects */
 
129
# define AP_DEFAULT_MAX_INTERNAL_REDIRECTS 10
 
130
 
 
131
/** default maximum subrequest nesting level */
 
132
# define AP_DEFAULT_MAX_SUBREQ_DEPTH 10
 
133
 
 
134
/**
 
135
 * Retrieve the value of Options for this request
 
136
 * @param r The current request
 
137
 * @return the Options bitmask
 
138
 */
 
139
AP_DECLARE(int) ap_allow_options(request_rec *r);
 
140
 
 
141
/**
 
142
 * Retrieve the value of the AllowOverride for this request
 
143
 * @param r The current request
 
144
 * @return the overrides bitmask
 
145
 */
 
146
AP_DECLARE(int) ap_allow_overrides(request_rec *r);
 
147
 
 
148
/**
 
149
 * Retrieve the value of the DefaultType directive, or text/plain if not set
 
150
 * @param r The current request
 
151
 * @return The default type
 
152
 */
 
153
AP_DECLARE(const char *) ap_default_type(request_rec *r);     
 
154
 
 
155
/**
 
156
 * Retrieve the document root for this server
 
157
 * @param r The current request
 
158
 * @warning Don't use this!  If your request went through a Userdir, or 
 
159
 * something like that, it'll screw you.  But it's back-compatible...
 
160
 * @return The document root
 
161
 */
 
162
AP_DECLARE(const char *) ap_document_root(request_rec *r);
 
163
 
 
164
/**
 
165
 * Lookup the remote client's DNS name or IP address
 
166
 * @ingroup get_remote_host
 
167
 * @param conn The current connection
 
168
 * @param dir_config The directory config vector from the request
 
169
 * @param type The type of lookup to perform.  One of:
 
170
 * <pre>
 
171
 *     REMOTE_HOST returns the hostname, or NULL if the hostname
 
172
 *                 lookup fails.  It will force a DNS lookup according to the
 
173
 *                 HostnameLookups setting.
 
174
 *     REMOTE_NAME returns the hostname, or the dotted quad if the
 
175
 *                 hostname lookup fails.  It will force a DNS lookup according
 
176
 *                 to the HostnameLookups setting.
 
177
 *     REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is
 
178
 *                     never forced.
 
179
 *     REMOTE_DOUBLE_REV will always force a DNS lookup, and also force
 
180
 *                   a double reverse lookup, regardless of the HostnameLookups
 
181
 *                   setting.  The result is the (double reverse checked) 
 
182
 *                   hostname, or NULL if any of the lookups fail.
 
183
 * </pre>
 
184
 * @param str_is_ip unless NULL is passed, this will be set to non-zero on output when an IP address 
 
185
 *        string is returned
 
186
 * @return The remote hostname
 
187
 */
 
188
AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config, int type, int *str_is_ip);
 
189
 
 
190
/**
 
191
 * Retrieve the login name of the remote user.  Undef if it could not be
 
192
 * determined
 
193
 * @param r The current request
 
194
 * @return The user logged in to the client machine
 
195
 */
 
196
AP_DECLARE(const char *) ap_get_remote_logname(request_rec *r);
 
197
 
 
198
/* Used for constructing self-referencing URLs, and things like SERVER_PORT,
 
199
 * and SERVER_NAME.
 
200
 */
 
201
/**
 
202
 * build a fully qualified URL from the uri and information in the request rec
 
203
 * @param p The pool to allocate the URL from
 
204
 * @param uri The path to the requested file
 
205
 * @param r The current request
 
206
 * @return A fully qualified URL
 
207
 */
 
208
AP_DECLARE(char *) ap_construct_url(apr_pool_t *p, const char *uri, request_rec *r);
 
209
 
 
210
/**
 
211
 * Get the current server name from the request
 
212
 * @param r The current request
 
213
 * @return the server name
 
214
 */
 
215
AP_DECLARE(const char *) ap_get_server_name(request_rec *r);
 
216
 
 
217
/**
 
218
 * Get the current server port
 
219
 * @param r The current request
 
220
 * @return The server's port
 
221
 */
 
222
AP_DECLARE(apr_port_t) ap_get_server_port(const request_rec *r);
 
223
 
 
224
/**
 
225
 * Return the limit on bytes in request msg body 
 
226
 * @param r The current request
 
227
 * @return the maximum number of bytes in the request msg body
 
228
 */
 
229
AP_DECLARE(apr_off_t) ap_get_limit_req_body(const request_rec *r);
 
230
 
 
231
/**
 
232
 * Return the limit on bytes in XML request msg body
 
233
 * @param r The current request
 
234
 * @return the maximum number of bytes in XML request msg body
 
235
 */
 
236
AP_DECLARE(size_t) ap_get_limit_xml_body(const request_rec *r);
 
237
 
 
238
/**
 
239
 * Install a custom response handler for a given status
 
240
 * @param r The current request
 
241
 * @param status The status for which the custom response should be used
 
242
 * @param string The custom response.  This can be a static string, a file
 
243
 *               or a URL
 
244
 */
 
245
AP_DECLARE(void) ap_custom_response(request_rec *r, int status, const char *string);
 
246
 
 
247
/**
 
248
 * Check if the current request is beyond the configured max. number of redirects or subrequests
 
249
 * @param r The current request
 
250
 * @return true (is exceeded) or false
 
251
 */
 
252
AP_DECLARE(int) ap_is_recursion_limit_exceeded(const request_rec *r);
 
253
 
 
254
/**
 
255
 * Check for a definition from the server command line
 
256
 * @param name The define to check for
 
257
 * @return 1 if defined, 0 otherwise
 
258
 */
 
259
AP_DECLARE(int) ap_exists_config_define(const char *name);
 
260
/* FIXME! See STATUS about how */
 
261
AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r);
 
262
 
 
263
/* Authentication stuff.  This is one of the places where compatibility
 
264
 * with the old config files *really* hurts; they don't discriminate at
 
265
 * all between different authentication schemes, meaning that we need
 
266
 * to maintain common state for all of them in the core, and make it
 
267
 * available to the other modules through interfaces.
 
268
 */
 
269
 
 
270
/** @see require_line */
 
271
typedef struct require_line require_line;
 
272
 
 
273
/** 
 
274
 * @brief A structure to keep track of authorization requirements 
 
275
*/
 
276
struct require_line {
 
277
    /** Where the require line is in the config file. */
 
278
    apr_int64_t method_mask;
 
279
    /** The complete string from the command line */
 
280
    char *requirement;
 
281
};
 
282
     
 
283
/**
 
284
 * Return the type of authorization required for this request
 
285
 * @param r The current request
 
286
 * @return The authorization required
 
287
 */
 
288
AP_DECLARE(const char *) ap_auth_type(request_rec *r);
 
289
 
 
290
/**
 
291
 * Return the current Authorization realm
 
292
 * @param r The current request
 
293
 * @return The current authorization realm
 
294
 */
 
295
AP_DECLARE(const char *) ap_auth_name(request_rec *r);     
 
296
 
 
297
/**
 
298
 * How the requires lines must be met.
 
299
 * @param r The current request
 
300
 * @return How the requirements must be met.  One of:
 
301
 * <pre>
 
302
 *      SATISFY_ANY    -- any of the requirements must be met.
 
303
 *      SATISFY_ALL    -- all of the requirements must be met.
 
304
 *      SATISFY_NOSPEC -- There are no applicable satisfy lines
 
305
 * </pre>
 
306
 */
 
307
AP_DECLARE(int) ap_satisfies(request_rec *r);
 
308
 
 
309
/**
 
310
 * Retrieve information about all of the requires directives for this request
 
311
 * @param r The current request
 
312
 * @return An array of all requires directives for this request
 
313
 */
 
314
AP_DECLARE(const apr_array_header_t *) ap_requires(request_rec *r);    
 
315
 
 
316
#ifdef CORE_PRIVATE
 
317
 
 
318
/**
 
319
 * Core is also unlike other modules in being implemented in more than
 
320
 * one file... so, data structures are declared here, even though most of
 
321
 * the code that cares really is in http_core.c.  Also, another accessor.
 
322
 */
 
323
AP_DECLARE_DATA extern module core_module;
 
324
 
 
325
/**
 
326
 * @brief  Per-request configuration 
 
327
*/
 
328
typedef struct {
 
329
    /** bucket brigade used by getline for look-ahead and 
 
330
     * ap_get_client_block for holding left-over request body */
 
331
    struct apr_bucket_brigade *bb;
 
332
 
 
333
    /** an array of per-request working data elements, accessed
 
334
     * by ID using ap_get_request_note()
 
335
     * (Use ap_register_request_note() during initialization
 
336
     * to add elements)
 
337
     */
 
338
    void **notes;
 
339
 
 
340
    /** There is a script processor installed on the output filter chain,
 
341
     * so it needs the default_handler to deliver a (script) file into
 
342
     * the chain so it can process it. Normally, default_handler only
 
343
     * serves files on a GET request (assuming the file is actual content),
 
344
     * since other methods are not content-retrieval. This flag overrides
 
345
     * that behavior, stating that the "content" is actually a script and
 
346
     * won't actually be delivered as the response for the non-GET method.
 
347
     */
 
348
    int deliver_script;
 
349
 
 
350
    /** Custom response strings registered via ap_custom_response(),
 
351
     * or NULL; check per-dir config if nothing found here
 
352
     */
 
353
    char **response_code_strings; /* from ap_custom_response(), not from
 
354
                                   * ErrorDocument
 
355
                                   */
 
356
    /** Should addition of charset= be suppressed for this request?
 
357
     */
 
358
    int suppress_charset;
 
359
} core_request_config;
 
360
 
 
361
/* Standard entries that are guaranteed to be accessible via
 
362
 * ap_get_request_note() for each request (additional entries
 
363
 * can be added with ap_register_request_note())
 
364
 */
 
365
#define AP_NOTE_DIRECTORY_WALK 0
 
366
#define AP_NOTE_LOCATION_WALK  1
 
367
#define AP_NOTE_FILE_WALK      2
 
368
#define AP_NUM_STD_NOTES       3
 
369
 
 
370
/**
 
371
 * Reserve an element in the core_request_config->notes array
 
372
 * for some application-specific data
 
373
 * @return An integer key that can be passed to ap_get_request_note()
 
374
 *         during request processing to access this element for the
 
375
 *         current request.
 
376
 */
 
377
AP_DECLARE(apr_size_t) ap_register_request_note(void);
 
378
 
 
379
/**
 
380
 * Retrieve a pointer to an element in the core_request_config->notes array
 
381
 * @param r The request
 
382
 * @param note_num  A key for the element: either a value obtained from
 
383
 *        ap_register_request_note() or one of the predefined AP_NOTE_*
 
384
 *        values.
 
385
 * @return NULL if the note_num is invalid, otherwise a pointer to the
 
386
 *         requested note element.
 
387
 * @remark At the start of a request, each note element is NULL.  The
 
388
 *         handle provided by ap_get_request_note() is a pointer-to-pointer
 
389
 *         so that the caller can point the element to some app-specific
 
390
 *         data structure.  The caller should guarantee that any such
 
391
 *         structure will last as long as the request itself.
 
392
 */
 
393
AP_DECLARE(void **) ap_get_request_note(request_rec *r, apr_size_t note_num);
 
394
 
 
395
 
 
396
typedef unsigned char allow_options_t;
 
397
typedef unsigned char overrides_t;
 
398
 
 
399
/*
 
400
 * Bits of info that go into making an ETag for a file
 
401
 * document.  Why a long?  Because char historically
 
402
 * proved too short for Options, and int can be different
 
403
 * sizes on different platforms.
 
404
 */
 
405
typedef unsigned long etag_components_t;
 
406
 
 
407
#define ETAG_UNSET 0
 
408
#define ETAG_NONE  (1 << 0)
 
409
#define ETAG_MTIME (1 << 1)
 
410
#define ETAG_INODE (1 << 2)
 
411
#define ETAG_SIZE  (1 << 3)
 
412
#define ETAG_BACKWARD (ETAG_MTIME | ETAG_INODE | ETAG_SIZE)
 
413
#define ETAG_ALL   (ETAG_MTIME | ETAG_INODE | ETAG_SIZE)
 
414
 
 
415
/**
 
416
 * @brief Server Signature Enumeration
 
417
 */
 
418
typedef enum {
 
419
    srv_sig_unset,
 
420
    srv_sig_off,
 
421
    srv_sig_on,
 
422
    srv_sig_withmail
 
423
} server_signature_e;
 
424
 
 
425
/** 
 
426
 * @brief Per-directory configuration 
 
427
 */
 
428
typedef struct {
 
429
    /** path of the directory/regex/etc. see also d_is_fnmatch/absolute below */
 
430
    char *d;
 
431
    /** the number of slashes in d */
 
432
    unsigned d_components;
 
433
 
 
434
    /** If (opts & OPT_UNSET) then no absolute assignment to options has
 
435
     * been made.
 
436
     * invariant: (opts_add & opts_remove) == 0
 
437
     * Which said another way means that the last relative (options + or -)
 
438
     * assignment made to each bit is recorded in exactly one of opts_add
 
439
     * or opts_remove.
 
440
     */
 
441
    allow_options_t opts;
 
442
    allow_options_t opts_add;
 
443
    allow_options_t opts_remove;
 
444
    overrides_t override;
 
445
    allow_options_t override_opts;
 
446
    
 
447
    /* MIME typing --- the core doesn't do anything at all with this,
 
448
     * but it does know what to slap on a request for a document which
 
449
     * goes untyped by other mechanisms before it slips out the door...
 
450
     */
 
451
    
 
452
    char *ap_default_type;
 
453
  
 
454
    /* Authentication stuff.  Groan... */
 
455
    
 
456
    int *satisfy; /* for every method one */
 
457
    char *ap_auth_type;
 
458
    char *ap_auth_name;
 
459
    apr_array_header_t *ap_requires;
 
460
 
 
461
    /* Custom response config. These can contain text or a URL to redirect to.
 
462
     * if response_code_strings is NULL then there are none in the config,
 
463
     * if it's not null then it's allocated to sizeof(char*)*RESPONSE_CODES.
 
464
     * This lets us do quick merges in merge_core_dir_configs().
 
465
     */
 
466
  
 
467
    char **response_code_strings; /* from ErrorDocument, not from
 
468
                                   * ap_custom_response() */
 
469
 
 
470
    /* Hostname resolution etc */
 
471
#define HOSTNAME_LOOKUP_OFF     0
 
472
#define HOSTNAME_LOOKUP_ON      1
 
473
#define HOSTNAME_LOOKUP_DOUBLE  2
 
474
#define HOSTNAME_LOOKUP_UNSET   3
 
475
    unsigned int hostname_lookups : 4;
 
476
 
 
477
    signed int content_md5 : 2;  /* calculate Content-MD5? */
 
478
 
 
479
#define USE_CANONICAL_NAME_OFF   (0)
 
480
#define USE_CANONICAL_NAME_ON    (1)
 
481
#define USE_CANONICAL_NAME_DNS   (2)
 
482
#define USE_CANONICAL_NAME_UNSET (3)
 
483
    unsigned use_canonical_name : 2;
 
484
 
 
485
    /* since is_fnmatch(conf->d) was being called so frequently in
 
486
     * directory_walk() and its relatives, this field was created and
 
487
     * is set to the result of that call.
 
488
     */
 
489
    unsigned d_is_fnmatch : 1;
 
490
 
 
491
    /* should we force a charset on any outgoing parameterless content-type?
 
492
     * if so, which charset?
 
493
     */
 
494
#define ADD_DEFAULT_CHARSET_OFF   (0)
 
495
#define ADD_DEFAULT_CHARSET_ON    (1)
 
496
#define ADD_DEFAULT_CHARSET_UNSET (2)
 
497
    unsigned add_default_charset : 2;
 
498
    const char *add_default_charset_name;
 
499
 
 
500
    /* System Resource Control */
 
501
#ifdef RLIMIT_CPU
 
502
    struct rlimit *limit_cpu;
 
503
#endif
 
504
#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS)
 
505
    struct rlimit *limit_mem;
 
506
#endif
 
507
#ifdef RLIMIT_NPROC
 
508
    struct rlimit *limit_nproc;
 
509
#endif
 
510
    apr_off_t limit_req_body;      /* limit on bytes in request msg body */
 
511
    long limit_xml_body;           /* limit on bytes in XML request msg body */
 
512
 
 
513
    /* logging options */
 
514
 
 
515
    server_signature_e server_signature;
 
516
 
 
517
    int loglevel;
 
518
    
 
519
    /* Access control */
 
520
    apr_array_header_t *sec_file;
 
521
    ap_regex_t *r;
 
522
 
 
523
    const char *mime_type;       /* forced with ForceType  */
 
524
    const char *handler;         /* forced with SetHandler */
 
525
    const char *output_filters;  /* forced with SetOutputFilters */
 
526
    const char *input_filters;   /* forced with SetInputFilters */
 
527
    int accept_path_info;        /* forced with AcceptPathInfo */
 
528
 
 
529
    apr_hash_t *ct_output_filters; /* added with AddOutputFilterByType */
 
530
 
 
531
    /*
 
532
     * What attributes/data should be included in ETag generation?
 
533
     */
 
534
    etag_components_t etag_bits;
 
535
    etag_components_t etag_add;
 
536
    etag_components_t etag_remove;
 
537
 
 
538
    /*
 
539
     * Run-time performance tuning
 
540
     */
 
541
#define ENABLE_MMAP_OFF    (0)
 
542
#define ENABLE_MMAP_ON     (1)
 
543
#define ENABLE_MMAP_UNSET  (2)
 
544
    unsigned int enable_mmap : 2;  /* whether files in this dir can be mmap'ed */
 
545
 
 
546
#define ENABLE_SENDFILE_OFF    (0)
 
547
#define ENABLE_SENDFILE_ON     (1)
 
548
#define ENABLE_SENDFILE_UNSET  (2)
 
549
    unsigned int enable_sendfile : 2;  /* files in this dir can be mmap'ed */
 
550
    unsigned int allow_encoded_slashes : 1; /* URLs may contain %2f w/o being
 
551
                                             * pitched indiscriminately */
 
552
 
 
553
#define USE_CANONICAL_PHYS_PORT_OFF   (0)
 
554
#define USE_CANONICAL_PHYS_PORT_ON    (1)
 
555
#define USE_CANONICAL_PHYS_PORT_UNSET (2)
 
556
    unsigned use_canonical_phys_port : 2;
 
557
 
 
558
} core_dir_config;
 
559
 
 
560
/* Per-server core configuration */
 
561
 
 
562
typedef struct {
 
563
  
 
564
#ifdef GPROF
 
565
    char *gprof_dir;
 
566
#endif
 
567
 
 
568
    /* Name translations --- we want the core to be able to do *something*
 
569
     * so it's at least a minimally functional web server on its own (and
 
570
     * can be tested that way).  But let's keep it to the bare minimum:
 
571
     */
 
572
    const char *ap_document_root;
 
573
  
 
574
    /* Access control */
 
575
 
 
576
    char *access_name;
 
577
    apr_array_header_t *sec_dir;
 
578
    apr_array_header_t *sec_url;
 
579
 
 
580
    /* recursion backstopper */
 
581
    int redirect_limit; /* maximum number of internal redirects */
 
582
    int subreq_limit;   /* maximum nesting level of subrequests */
 
583
 
 
584
    const char *protocol;
 
585
    apr_table_t *accf_map;
 
586
 
 
587
    /* TRACE control */
 
588
#define AP_TRACE_UNSET    -1
 
589
#define AP_TRACE_DISABLE   0
 
590
#define AP_TRACE_ENABLE    1
 
591
#define AP_TRACE_EXTENDED  2
 
592
    int trace_enable;
 
593
 
 
594
} core_server_config;
 
595
 
 
596
/* for AddOutputFiltersByType in core.c */
 
597
void ap_add_output_filters_by_type(request_rec *r);
 
598
 
 
599
/* for http_config.c */
 
600
void ap_core_reorder_directories(apr_pool_t *, server_rec *);
 
601
 
 
602
/* for mod_perl */
 
603
AP_CORE_DECLARE(void) ap_add_per_dir_conf(server_rec *s, void *dir_config);
 
604
AP_CORE_DECLARE(void) ap_add_per_url_conf(server_rec *s, void *url_config);
 
605
AP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *url_config);
 
606
AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg);
 
607
 
 
608
/* Core filters; not exported. */
 
609
int ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,
 
610
                         ap_input_mode_t mode, apr_read_type_e block,
 
611
                         apr_off_t readbytes);
 
612
apr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *b);
 
613
 
 
614
#endif /* CORE_PRIVATE */
 
615
 
 
616
AP_DECLARE(const char*) ap_get_server_protocol(server_rec* s);
 
617
AP_DECLARE(void) ap_set_server_protocol(server_rec* s, const char* proto);
 
618
 
 
619
/* ----------------------------------------------------------------------
 
620
 *
 
621
 * Runtime status/management
 
622
 */
 
623
 
 
624
typedef enum {
 
625
    ap_mgmt_type_string,
 
626
    ap_mgmt_type_long,
 
627
    ap_mgmt_type_hash
 
628
} ap_mgmt_type_e;
 
629
 
 
630
typedef union {
 
631
    const char *s_value;
 
632
    long i_value;
 
633
    apr_hash_t *h_value;
 
634
} ap_mgmt_value;
 
635
 
 
636
typedef struct {
 
637
    const char *description;
 
638
    const char *name;
 
639
    ap_mgmt_type_e vtype;
 
640
    ap_mgmt_value v;
 
641
} ap_mgmt_item_t;
 
642
 
 
643
/* Handles for core filters */
 
644
extern AP_DECLARE_DATA ap_filter_rec_t *ap_subreq_core_filter_handle;
 
645
extern AP_DECLARE_DATA ap_filter_rec_t *ap_core_output_filter_handle;
 
646
extern AP_DECLARE_DATA ap_filter_rec_t *ap_content_length_filter_handle;
 
647
extern AP_DECLARE_DATA ap_filter_rec_t *ap_core_input_filter_handle;
 
648
 
 
649
/**
 
650
 * This hook provdes a way for modules to provide metrics/statistics about
 
651
 * their operational status.
 
652
 *
 
653
 * @param p A pool to use to create entries in the hash table
 
654
 * @param val The name of the parameter(s) that is wanted. This is
 
655
 *            tree-structured would be in the form ('*' is all the tree,
 
656
 *            'module.*' all of the module , 'module.foo.*', or
 
657
 *            'module.foo.bar' )
 
658
 * @param ht The hash table to store the results. Keys are item names, and
 
659
 *           the values point to ap_mgmt_item_t structures.
 
660
 * @ingroup hooks
 
661
 */
 
662
AP_DECLARE_HOOK(int, get_mgmt_items,
 
663
                (apr_pool_t *p, const char * val, apr_hash_t *ht))
 
664
 
 
665
/* ---------------------------------------------------------------------- */
 
666
 
 
667
/* ----------------------------------------------------------------------
 
668
 *
 
669
 * I/O logging with mod_logio
 
670
 */
 
671
 
 
672
APR_DECLARE_OPTIONAL_FN(void, ap_logio_add_bytes_out,
 
673
                        (conn_rec *c, apr_off_t bytes));
 
674
 
 
675
/* ----------------------------------------------------------------------
 
676
 *
 
677
 * ident lookups with mod_ident
 
678
 */
 
679
 
 
680
APR_DECLARE_OPTIONAL_FN(const char *, ap_ident_lookup,
 
681
                        (request_rec *r));
 
682
 
 
683
/* ---------------------------------------------------------------------- */
 
684
 
 
685
#ifdef __cplusplus
 
686
}
 
687
#endif
 
688
 
 
689
#endif  /* !APACHE_HTTP_CORE_H */
 
690
/** @} */