123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- #ifndef APACHE_UTIL_FCGI_H
- #define APACHE_UTIL_FCGI_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "httpd.h"
- typedef struct {
-
- unsigned char version;
-
- unsigned char type;
-
- unsigned char requestIdB1;
- unsigned char requestIdB0;
-
- unsigned char contentLengthB1;
- unsigned char contentLengthB0;
-
- unsigned char paddingLength;
-
- unsigned char reserved;
- } ap_fcgi_header;
- #define AP_FCGI_HEADER_LEN 8
- #define AP_FCGI_MAX_CONTENT_LEN 65535
- #define AP_FCGI_VERSION_1 1
- #define AP_FCGI_BEGIN_REQUEST 1
- #define AP_FCGI_ABORT_REQUEST 2
- #define AP_FCGI_END_REQUEST 3
- #define AP_FCGI_PARAMS 4
- #define AP_FCGI_STDIN 5
- #define AP_FCGI_STDOUT 6
- #define AP_FCGI_STDERR 7
- #define AP_FCGI_DATA 8
- #define AP_FCGI_GET_VALUES 9
- #define AP_FCGI_GET_VALUES_RESULT 10
- #define AP_FCGI_UNKNOWN_TYPE 11
- #define AP_FCGI_MAXTYPE (AP_FCGI_UNKNOWN_TYPE)
- #define AP_FCGI_HDR_VERSION_OFFSET 0
- #define AP_FCGI_HDR_TYPE_OFFSET 1
- #define AP_FCGI_HDR_REQUEST_ID_B1_OFFSET 2
- #define AP_FCGI_HDR_REQUEST_ID_B0_OFFSET 3
- #define AP_FCGI_HDR_CONTENT_LEN_B1_OFFSET 4
- #define AP_FCGI_HDR_CONTENT_LEN_B0_OFFSET 5
- #define AP_FCGI_HDR_PADDING_LEN_OFFSET 6
- #define AP_FCGI_HDR_RESERVED_OFFSET 7
- typedef struct {
-
- unsigned char roleB1;
- unsigned char roleB0;
-
- unsigned char flags;
-
- unsigned char reserved[5];
- } ap_fcgi_begin_request_body;
- #define AP_FCGI_RESPONDER 1
- #define AP_FCGI_AUTHORIZER 2
- #define AP_FCGI_FILTER 3
- #define AP_FCGI_KEEP_CONN 1
- #define AP_FCGI_BRB_ROLEB1_OFFSET 0
- #define AP_FCGI_BRB_ROLEB0_OFFSET 1
- #define AP_FCGI_BRB_FLAGS_OFFSET 2
- #define AP_FCGI_BRB_RESERVED0_OFFSET 3
- #define AP_FCGI_BRB_RESERVED1_OFFSET 4
- #define AP_FCGI_BRB_RESERVED2_OFFSET 5
- #define AP_FCGI_BRB_RESERVED3_OFFSET 6
- #define AP_FCGI_BRB_RESERVED4_OFFSET 7
- AP_DECLARE(void) ap_fcgi_header_to_array(ap_fcgi_header *h,
- unsigned char a[]);
- AP_DECLARE(void) ap_fcgi_header_from_array(ap_fcgi_header *h,
- unsigned char a[]);
- AP_DECLARE(void) ap_fcgi_header_fields_from_array(unsigned char *version,
- unsigned char *type,
- apr_uint16_t *request_id,
- apr_uint16_t *content_len,
- unsigned char *padding_len,
- unsigned char a[]);
- AP_DECLARE(void) ap_fcgi_begin_request_body_to_array(ap_fcgi_begin_request_body *h,
- unsigned char a[]);
- AP_DECLARE(void) ap_fcgi_fill_in_header(ap_fcgi_header *header,
- unsigned char type,
- apr_uint16_t request_id,
- apr_uint16_t content_len,
- unsigned char padding_len);
- AP_DECLARE(void) ap_fcgi_fill_in_request_body(ap_fcgi_begin_request_body *brb,
- int role,
- unsigned char flags);
- AP_DECLARE(apr_size_t) ap_fcgi_encoded_env_len(apr_table_t *env,
- apr_size_t maxlen,
- int *starting_elem);
- AP_DECLARE(apr_status_t) ap_fcgi_encode_env(request_rec *r,
- apr_table_t *env,
- void *buffer,
- apr_size_t buflen,
- int *starting_elem);
- #define AP_FCGI_RESPONDER_STR "RESPONDER"
- #define AP_FCGI_AUTHORIZER_STR "AUTHORIZER"
- #define AP_FCGI_FILTER_STR "FILTER"
- #define AP_FCGI_APACHE_ROLE_AUTHENTICATOR_STR "AUTHENTICATOR"
- #define AP_FCGI_APACHE_ROLE_AUTHORIZER_STR "AUTHORIZER"
- #define AP_FCGI_APACHE_ROLE_ACCESS_CHECKER_STR "ACCESS_CHECKER"
- #ifdef __cplusplus
- }
- #endif
- #endif
|