Apache HTTPD
ajp.h
Go to the documentation of this file.
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
26#ifndef AJP_H
27#define AJP_H
28
29#include "apr_version.h"
30#include "apr.h"
31
32#include "apr_hooks.h"
33#include "apr_lib.h"
34#include "apr_strings.h"
35#include "apr_buckets.h"
36#include "apr_md5.h"
37#include "apr_network_io.h"
38#include "apr_poll.h"
39#include "apr_pools.h"
40#include "apr_strings.h"
41#include "apr_uri.h"
42#include "apr_date.h"
43#include "apr_fnmatch.h"
44#define APR_WANT_STRFUNC
45#include "apr_want.h"
46
47#if APR_HAVE_NETINET_IN_H
48#include <netinet/in.h>
49#endif
50#if APR_HAVE_ARPA_INET_H
51#include <arpa/inet.h>
52#endif
53
54#define AJP13_DEF_HOST "127.0.0.1"
55#ifdef NETWARE
56#define AJP13_DEF_PORT 9009 /* default to 9009 since 8009 is used by OS */
57#else
58#define AJP13_DEF_PORT 8009
59#endif
60
61/* The following environment variables match mod_ssl! */
62#define AJP13_HTTPS_INDICATOR "HTTPS"
63#define AJP13_SSL_PROTOCOL_INDICATOR "SSL_PROTOCOL"
64#define AJP13_SSL_CLIENT_CERT_INDICATOR "SSL_CLIENT_CERT"
65#define AJP13_SSL_CIPHER_INDICATOR "SSL_CIPHER"
66#define AJP13_SSL_SESSION_INDICATOR "SSL_SESSION_ID"
67#define AJP13_SSL_KEY_SIZE_INDICATOR "SSL_CIPHER_USEKEYSIZE"
68
69#ifdef AJP_USE_HTTPD_WRAP
70#include "httpd_wrap.h"
71#else
72#include "httpd.h"
73#include "http_config.h"
74#include "http_request.h"
75#include "http_core.h"
76#include "http_protocol.h"
77#include "http_main.h"
78#include "http_log.h"
79#endif
80
81#include "mod_proxy.h"
82#include "util_ebcdic.h"
83
87#define AJP_EOVERFLOW (APR_OS_START_USERERR + 1)
89#define AJP_ETOSMALL (APR_OS_START_USERERR + 2)
91#define AJP_EINVAL (APR_OS_START_USERERR + 3)
93#define AJP_EBAD_SIGNATURE (APR_OS_START_USERERR + 4)
95#define AJP_ETOBIG (APR_OS_START_USERERR + 5)
97#define AJP_ENO_HEADER (APR_OS_START_USERERR + 6)
99#define AJP_EBAD_HEADER (APR_OS_START_USERERR + 7)
101#define AJP_EBAD_MESSAGE (APR_OS_START_USERERR + 8)
103#define AJP_ELOGFAIL (APR_OS_START_USERERR + 9)
105#define AJP_EBAD_METHOD (APR_OS_START_USERERR + 10)
106
107
109typedef struct ajp_msg ajp_msg_t;
110
127
131#define AJP13_WS_HEADER 0x1234
132#define AJP_HEADER_LEN 4
133#define AJP_HEADER_SZ_LEN 2
134#define AJP_HEADER_SZ 6
135#define AJP_MSG_BUFFER_SZ 8192
136#define AJP_MAX_BUFFER_SZ 65536
137#define AJP13_MAX_SEND_BODY_SZ (AJP_MAX_BUFFER_SZ - AJP_HEADER_SZ)
138#define AJP_PING_PONG_SZ 128
139
141#define CMD_AJP13_FORWARD_REQUEST (unsigned char)2
143#define CMD_AJP13_SEND_BODY_CHUNK (unsigned char)3
145#define CMD_AJP13_SEND_HEADERS (unsigned char)4
147#define CMD_AJP13_END_RESPONSE (unsigned char)5
149#define CMD_AJP13_GET_BODY_CHUNK (unsigned char)6
151#define CMD_AJP13_SHUTDOWN (unsigned char)7
153#define CMD_AJP13_PING (unsigned char)8
155#define CMD_AJP13_CPONG (unsigned char)9
157#define CMD_AJP13_CPING (unsigned char)10
158
174
182
190
198
207
216
225
236 int convert);
241#define ajp_msg_append_string(m, v) ajp_msg_append_string_ex(m, v, 1)
242
246#define ajp_msg_append_string_ascii(m, v) ajp_msg_append_string_ex(m, v, 0)
247
258
267
276
286
295
305
314
315
326
336
345
357
369
381 apr_size_t count, char **buf);
382
392
401
410
422 apr_uri_t *uri,
423 const char *secret);
424
434 request_rec *r,
436 ajp_msg_t **msg);
437
447 apr_size_t *len, ajp_msg_t **msg);
448
457 ajp_msg_t *msg, apr_size_t len);
458
466
475 ajp_msg_t *msg);
476
486 apr_uint16_t *len, char **ptr);
487
488
498
499
508 request_rec *r,
510
511
517const char *ajp_type_str(int type);
518
521#endif /* AJP_H */
522
const char apr_size_t len
Definition ap_regex.h:187
APR-UTIL Buckets/Bucket Brigades.
APR-UTIL date routines.
APR FNMatch Functions.
Apache hook functions.
APR general purpose library routines.
APR MD5 Routines.
APR Network library.
APR Poll interface.
APR memory allocation.
APR Strings library.
APR-UTIL URI Routines.
APR Versioning Interface.
APR Standard Headers Support.
apr_status_t ajp_send_header(apr_socket_t *sock, request_rec *r, apr_size_t buffsize, apr_uri_t *uri, const char *secret)
Definition ajp_header.c:688
apr_status_t ajp_msg_peek_uint8(ajp_msg_t *msg, apr_byte_t *rvalue)
Definition ajp_msg.c:465
apr_status_t ajp_parse_reuse(request_rec *r, ajp_msg_t *msg, apr_byte_t *reuse)
Definition ajp_header.c:850
int ajp_parse_type(request_rec *r, ajp_msg_t *msg)
Definition ajp_header.c:770
apr_status_t ajp_msg_get_uint32(ajp_msg_t *msg, apr_uint32_t *rvalue)
Definition ajp_msg.c:394
apr_status_t ajp_parse_data(request_rec *r, ajp_msg_t *msg, apr_uint16_t *len, char **ptr)
Definition ajp_header.c:804
apr_status_t ajp_msg_create(apr_pool_t *pool, apr_size_t size, ajp_msg_t **rmsg)
Definition ajp_msg.c:561
apr_status_t ajp_alloc_data_msg(apr_pool_t *pool, char **ptr, apr_size_t *len, ajp_msg_t **msg)
Definition ajp_header.c:875
apr_status_t ajp_msg_append_uint8(ajp_msg_t *msg, apr_byte_t value)
Definition ajp_msg.c:308
apr_status_t ajp_msg_get_bytes(ajp_msg_t *msg, apr_byte_t **rvalue, apr_size_t *rvalue_len)
Definition ajp_msg.c:530
apr_status_t ajp_msg_dump(apr_pool_t *pool, ajp_msg_t *msg, char *err, apr_size_t count, char **buf)
Definition ajp_msg.c:42
apr_status_t ajp_msg_reuse(ajp_msg_t *msg)
Definition ajp_msg.c:204
apr_status_t ajp_msg_peek_uint16(ajp_msg_t *msg, apr_uint16_t *rvalue)
Definition ajp_msg.c:442
apr_status_t ajp_msg_check_header(ajp_msg_t *msg, apr_size_t *len)
Definition ajp_msg.c:151
apr_status_t ajp_msg_log(request_rec *r, ajp_msg_t *msg, char *err)
Definition ajp_msg.c:115
apr_status_t ajp_msg_get_string(ajp_msg_t *msg, const char **rvalue)
Definition ajp_msg.c:501
apr_status_t ajp_msg_serialize_ping(ajp_msg_t *msg)
Definition ajp_msg.c:611
apr_status_t ajp_msg_serialize_cping(ajp_msg_t *msg)
Definition ajp_msg.c:632
apr_status_t ajp_msg_append_uint32(ajp_msg_t *msg, apr_uint32_t value)
Definition ajp_msg.c:260
apr_status_t ajp_ilink_receive(apr_socket_t *sock, ajp_msg_t *msg)
Definition ajp_link.c:74
apr_status_t ajp_msg_get_uint8(ajp_msg_t *msg, apr_byte_t *rvalue)
Definition ajp_msg.c:482
const char * ajp_type_str(int type)
Definition ajp_utils.c:121
apr_status_t ajp_send_data_msg(apr_socket_t *sock, ajp_msg_t *msg, apr_size_t len)
Definition ajp_header.c:892
apr_status_t ajp_msg_copy(ajp_msg_t *smsg, ajp_msg_t *dmsg)
Definition ajp_msg.c:583
apr_status_t ajp_msg_append_bytes(ajp_msg_t *msg, const apr_byte_t *value, apr_size_t valuelen)
Definition ajp_msg.c:369
apr_status_t ajp_msg_reset(ajp_msg_t *msg)
Definition ajp_msg.c:190
apr_status_t ajp_msg_append_uint16(ajp_msg_t *msg, apr_uint16_t value)
Definition ajp_msg.c:285
apr_status_t ajp_msg_end(ajp_msg_t *msg)
Definition ajp_msg.c:225
apr_status_t ajp_msg_get_uint16(ajp_msg_t *msg, apr_uint16_t *rvalue)
Definition ajp_msg.c:419
apr_status_t ajp_ilink_send(apr_socket_t *sock, ajp_msg_t *msg)
Definition ajp_link.c:21
apr_status_t ajp_parse_header(request_rec *r, proxy_dir_conf *conf, ajp_msg_t *msg)
Definition ajp_header.c:781
apr_status_t ajp_msg_append_string_ex(ajp_msg_t *msg, const char *value, int convert)
Definition ajp_msg.c:331
apr_status_t ajp_read_header(apr_socket_t *sock, request_rec *r, apr_size_t buffsize, ajp_msg_t **msg)
Definition ajp_header.c:725
request_rec * r
const unsigned char * buf
Definition util_md5.h:50
unsigned int count
Definition apr_md5.h:152
const char * uri
Definition apr_uri.h:159
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
const char * value
Definition apr_env.h:51
int apr_status_t
Definition apr_errno.h:44
int type
apr_socket_t * sock
apr_int32_t apr_int32_t apr_int32_t err
apr_int64_t apr_interval_time_t
Definition apr_time.h:55
Apache Configuration.
CORE HTTP Daemon.
Apache Logging library.
Command line options.
HTTP protocol handling.
Apache Request library.
HTTP Daemon routines.
static unsigned char * secret
Proxy Extension Module for Apache.
static apr_OFN_ajp_handle_cping_cpong_t * ajp_handle_cping_cpong
Definition ajp.h:113
apr_size_t header_len
Definition ajp.h:117
apr_size_t max_size
Definition ajp.h:125
apr_byte_t * buf
Definition ajp.h:115
apr_size_t len
Definition ajp.h:119
int server_side
Definition ajp.h:123
apr_size_t pos
Definition ajp.h:121
A structure that represents the current request.
Definition httpd.h:845
Utilities for EBCDIC conversion.
IN ULONG IN INT timeout