ajp.h revision 742318b93e89c311f66b55f426c4d9cf2c14628b
181e56d8b348d301d615ccf5465ae600fee2867berikabele/* Licensed to the Apache Software Foundation (ASF) under one or more
181e56d8b348d301d615ccf5465ae600fee2867berikabele * contributor license agreements. See the NOTICE file distributed with
181e56d8b348d301d615ccf5465ae600fee2867berikabele * this work for additional information regarding copyright ownership.
2470bf1424599e7876e1f5b6db234a6a66282ef8slive * The ASF licenses this file to You under the Apache License, Version 2.0
2470bf1424599e7876e1f5b6db234a6a66282ef8slive * (the "License"); you may not use this file except in compliance with
2470bf1424599e7876e1f5b6db234a6a66282ef8slive * the License. You may obtain a copy of the License at
5a58787efeb02a1c3f06569d019ad81fd2efa06end * Unless required by applicable law or agreed to in writing, software
5a58787efeb02a1c3f06569d019ad81fd2efa06end * distributed under the License is distributed on an "AS IS" BASIS,
5a58787efeb02a1c3f06569d019ad81fd2efa06end * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5a58787efeb02a1c3f06569d019ad81fd2efa06end * See the License for the specific language governing permissions and
5a58787efeb02a1c3f06569d019ad81fd2efa06end * limitations under the License.
4b5981e276e93df97c34e4da05ca5cf8bbd937dand * @brief Apache Jserv Protocol
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd * @defgroup AJP_defines AJP definitions
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd * @ingroup MOD_PROXY
7eb26bcd90adad324330ce83e1b90ebe54a28948nd#define AJP13_DEF_PORT 9009 /* default to 9009 since 8009 is used by OS */
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen/* The following environment variables match mod_ssl! */
9afc027f0d7f85979066cd278a271a4930b5ad11slive#define AJP13_SSL_CLIENT_CERT_INDICATOR "SSL_CLIENT_CERT"
dc1eee5ace4a2dec38d0b37d6daf9efb7e3c81b7kess#define AJP13_SSL_KEY_SIZE_INDICATOR "SSL_CIPHER_USEKEYSIZE"
9afc027f0d7f85979066cd278a271a4930b5ad11slive/** AJP Specific error codes
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen/** Buffer overflow exception */
9afc027f0d7f85979066cd278a271a4930b5ad11slive/** Destination Buffer is to small */
9afc027f0d7f85979066cd278a271a4930b5ad11slive/** Invalid input parameters */
5a58787efeb02a1c3f06569d019ad81fd2efa06end/** Bad message signature */
5a58787efeb02a1c3f06569d019ad81fd2efa06end/** Incoming message too bg */
2470bf1424599e7876e1f5b6db234a6a66282ef8slive/** Missing message header */
2470bf1424599e7876e1f5b6db234a6a66282ef8slive/** Bad message header */
9afc027f0d7f85979066cd278a271a4930b5ad11slive/** Bad message */
9afc027f0d7f85979066cd278a271a4930b5ad11slive/** Cant log via AJP14 */
9afc027f0d7f85979066cd278a271a4930b5ad11slive/** Bad request method */
2470bf1424599e7876e1f5b6db234a6a66282ef8slive/** A structure that represents ajp message */
2470bf1424599e7876e1f5b6db234a6a66282ef8slive/** A structure that represents ajp message */
2470bf1424599e7876e1f5b6db234a6a66282ef8slive /** The buffer holding a AJP message */
2470bf1424599e7876e1f5b6db234a6a66282ef8slive /** The length of AJP message header (defaults to AJP_HEADER_LEN) */
1494875b08f5d3f65e9b7e844bc830a1d21101d1kess /** The length of AJP message */
1494875b08f5d3f65e9b7e844bc830a1d21101d1kess /** The current read position */
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen /** Flag indicating the origing of the message */
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen /** The size of the buffer */
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen * Signature for the messages sent from Apache to tomcat
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen#define AJP13_MAX_SEND_BODY_SZ (AJP_MAX_BUFFER_SZ - AJP_HEADER_SZ)
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen/** Send a request from web server to container*/
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen/** Write a body chunk from the servlet container to the web server */
0091285a38c741ee51224a98002108e842495df5rbowen/** Send response headers from the servlet container to the web server. */
0091285a38c741ee51224a98002108e842495df5rbowen/** Marks the end of response. */
0091285a38c741ee51224a98002108e842495df5rbowen/** Get further data from the web server if it hasn't all been transferred yet. */
0091285a38c741ee51224a98002108e842495df5rbowen/** The web server asks the container to shut itself down. */
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen/** Webserver ask container to take control (logon phase) */
9bcfc3697a91b5215893a7d0206865b13fc72148nd/** Container response to cping request */
9bcfc3697a91b5215893a7d0206865b13fc72148nd/** Webserver check if container is alive, since container should respond by cpong */
5a58787efeb02a1c3f06569d019ad81fd2efa06end * @defgroup AJP_api AJP API functions
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen * @ingroup MOD_PROXY
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen * Check a new AJP Message by looking at signature and return its size
9afc027f0d7f85979066cd278a271a4930b5ad11slive * @param msg AJP Message to check
9afc027f0d7f85979066cd278a271a4930b5ad11slive * @param len Pointer to returned len
9afc027f0d7f85979066cd278a271a4930b5ad11slive * @return APR_SUCCESS or error
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowenapr_status_t ajp_msg_check_header(ajp_msg_t *msg, apr_size_t *len);
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen * Reset an AJP Message
0091285a38c741ee51224a98002108e842495df5rbowen * @param msg AJP Message to reset
0091285a38c741ee51224a98002108e842495df5rbowen * @return APR_SUCCESS or error
144c96f1a9d2f0c8bfccafea655dae120f7470d2colm * Reuse an AJP Message
144c96f1a9d2f0c8bfccafea655dae120f7470d2colm * @param msg AJP Message to reuse
144c96f1a9d2f0c8bfccafea655dae120f7470d2colm * @return APR_SUCCESS or error
144c96f1a9d2f0c8bfccafea655dae120f7470d2colm * Mark the end of an AJP Message
144c96f1a9d2f0c8bfccafea655dae120f7470d2colm * @param msg AJP Message to end
144c96f1a9d2f0c8bfccafea655dae120f7470d2colm * @return APR_SUCCESS or error
144c96f1a9d2f0c8bfccafea655dae120f7470d2colm * Add an unsigned 32bits value to AJP Message
144c96f1a9d2f0c8bfccafea655dae120f7470d2colm * @param msg AJP Message to get value from
144c96f1a9d2f0c8bfccafea655dae120f7470d2colm * @param value value to add to AJP Message
144c96f1a9d2f0c8bfccafea655dae120f7470d2colm * @return APR_SUCCESS or error
e45879d70a535d2700c2b4720d99830ae0da1d6acolmapr_status_t ajp_msg_append_uint32(ajp_msg_t *msg, apr_uint32_t value);
e45879d70a535d2700c2b4720d99830ae0da1d6acolm * Add an unsigned 16bits value to AJP Message
e45879d70a535d2700c2b4720d99830ae0da1d6acolm * @param msg AJP Message to get value from
e45879d70a535d2700c2b4720d99830ae0da1d6acolm * @param value value to add to AJP Message
e45879d70a535d2700c2b4720d99830ae0da1d6acolm * @return APR_SUCCESS or error
e45879d70a535d2700c2b4720d99830ae0da1d6acolmapr_status_t ajp_msg_append_uint16(ajp_msg_t *msg, apr_uint16_t value);
e45879d70a535d2700c2b4720d99830ae0da1d6acolm * Add an unsigned 8bits value to AJP Message
e45879d70a535d2700c2b4720d99830ae0da1d6acolm * @param msg AJP Message to get value from
e45879d70a535d2700c2b4720d99830ae0da1d6acolm * @param value value to add to AJP Message
e45879d70a535d2700c2b4720d99830ae0da1d6acolm * @return APR_SUCCESS or error
5a58787efeb02a1c3f06569d019ad81fd2efa06endapr_status_t ajp_msg_append_uint8(ajp_msg_t *msg, apr_byte_t value);
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd * Add a String in AJP message, and transform the String in ASCII
97a3ecc40b65d5f8e865bbe0b1c9325d8c016e34nd * if convert is set and we're on an EBCDIC machine
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd * @param msg AJP Message to get value from
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd * @param value Pointer to String
4b22542f6f38567cae7873b176188a6622f67eb0fielding * @param convert When set told to convert String to ASCII
5a58787efeb02a1c3f06569d019ad81fd2efa06end * @return APR_SUCCESS or error
int convert);
request_rec *r,
request_rec *r,