bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / native / common / jk_ajp13.h
1 /*
2  *  Licensed to the Apache Software Foundation (ASF) under one or more
3  *  contributor license agreements.  See the NOTICE file distributed with
4  *  this work for additional information regarding copyright ownership.
5  *  The ASF licenses this file to You under the Apache License, Version 2.0
6  *  (the "License"); you may not use this file except in compliance with
7  *  the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  */
17
18 /***************************************************************************
19  * Description: Experimental bi-directionl protocol handler.               *
20  * Author:      Gal Shachor <shachor@il.ibm.com>                           *
21  * Version:     $Revision: 751213 $                                           *
22  ***************************************************************************/
23 #ifndef JK_AJP13_H
24 #define JK_AJP13_H
25
26 #include "jk_ajp_common.h"
27
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif                          /* __cplusplus */
32
33 #define AJP13_PROTO                 13
34 #define AJP13_WS_HEADER             0x1234
35 #define AJP13_SW_HEADER             0x4142      /* 'AB' */
36
37 #define AJP13_DEF_HOST              ("localhost")
38 #define AJP13_DEF_PORT              (8009)
39 #define AJP13_READ_BUF_SIZE         (8*1024)
40 #define AJP13_DEF_CACHE_SZ          (1)
41 #define JK_INTERNAL_ERROR           (-2)
42 #define JK_FATAL_ERROR              (-3)
43 #define JK_CLIENT_ERROR             (-4)
44 #define JK_SERVER_ERROR             (-5)
45 #define JK_CLIENT_RD_ERROR          (-6)
46 #define JK_CLIENT_WR_ERROR          (-7)
47 #define JK_STATUS_ERROR             (-8)
48 #define JK_STATUS_FATAL_ERROR       (-9)
49 #define JK_REPLY_TIMEOUT            (-10)
50 #define JK_AJP_PROTOCOL_ERROR       (-11)
51
52 #define AJP13_MAX_SEND_BODY_SZ      (DEF_BUFFER_SZ - 6)
53 #define AJP13_DEF_TIMEOUT           (0) /* Idle timout for pooled connections */
54
55 /*
56  * Message does not have a response (for example, JK_AJP13_END_RESPONSE)
57  */
58 #define JK_AJP13_ERROR              -1
59 /*
60  * Message does not have a response (for example, JK_AJP13_END_RESPONSE)
61  */
62 #define JK_AJP13_NO_RESPONSE        0
63 /*
64  * Message have a response.
65  */
66 #define JK_AJP13_HAS_RESPONSE       1
67
68 /*
69  * Forward a request from the web server to the servlet container.
70  */
71 #define JK_AJP13_FORWARD_REQUEST    (unsigned char)2
72
73 /*
74  * Write a body chunk from the servlet container to the web server
75  */
76 #define JK_AJP13_SEND_BODY_CHUNK    (unsigned char)3
77
78 /*
79  * Send response headers from the servlet container to the web server.
80  */
81 #define JK_AJP13_SEND_HEADERS       (unsigned char)4
82
83 /*
84  * Marks the end of response.
85  */
86 #define JK_AJP13_END_RESPONSE       (unsigned char)5
87
88 /*
89  * Marks the end of response.
90  */
91 #define JK_AJP13_GET_BODY_CHUNK     (unsigned char)6
92
93 /*
94  * Asks the container to shutdown
95  */
96 #define JK_AJP13_SHUTDOWN           (unsigned char)7
97
98 /*
99  * Told container to take control (secure login phase)
100  */
101 #define AJP13_PING_REQUEST          (unsigned char)8
102
103 /*
104  * Check if the container is alive
105  */
106 #define AJP13_CPING_REQUEST          (unsigned char)10
107
108 /*
109  * Reply from the container to alive request
110  */
111 #define AJP13_CPONG_REPLY            (unsigned char)9
112
113
114
115 /*
116  * Functions
117  */
118
119 int ajp13_marshal_shutdown_into_msgb(jk_msg_buf_t *msg,
120                                      jk_pool_t *p, jk_logger_t *l);
121
122 #ifdef __cplusplus
123 }
124 #endif                          /* __cplusplus */
125
126 #endif                          /* JK_AJP13_H */