Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
AJP API functions
Collaboration diagram for AJP API functions:

Macros

#define ajp_msg_append_string(m, v)   ajp_msg_append_string_ex(m, v, 1)
 
#define ajp_msg_append_string_ascii(m, v)   ajp_msg_append_string_ex(m, v, 0)
 

Functions

apr_status_t ajp_msg_check_header (ajp_msg_t *msg, apr_size_t *len)
 
apr_status_t ajp_msg_reset (ajp_msg_t *msg)
 
apr_status_t ajp_msg_reuse (ajp_msg_t *msg)
 
apr_status_t ajp_msg_end (ajp_msg_t *msg)
 
apr_status_t ajp_msg_append_uint32 (ajp_msg_t *msg, apr_uint32_t value)
 
apr_status_t ajp_msg_append_uint16 (ajp_msg_t *msg, apr_uint16_t value)
 
apr_status_t ajp_msg_append_uint8 (ajp_msg_t *msg, apr_byte_t value)
 
apr_status_t ajp_msg_append_string_ex (ajp_msg_t *msg, const char *value, int convert)
 
apr_status_t ajp_msg_append_bytes (ajp_msg_t *msg, const apr_byte_t *value, apr_size_t valuelen)
 
apr_status_t ajp_msg_get_uint32 (ajp_msg_t *msg, apr_uint32_t *rvalue)
 
apr_status_t ajp_msg_get_uint16 (ajp_msg_t *msg, apr_uint16_t *rvalue)
 
apr_status_t ajp_msg_peek_uint16 (ajp_msg_t *msg, apr_uint16_t *rvalue)
 
apr_status_t ajp_msg_get_uint8 (ajp_msg_t *msg, apr_byte_t *rvalue)
 
apr_status_t ajp_msg_peek_uint8 (ajp_msg_t *msg, apr_byte_t *rvalue)
 
apr_status_t ajp_msg_get_string (ajp_msg_t *msg, const char **rvalue)
 
apr_status_t ajp_msg_get_bytes (ajp_msg_t *msg, apr_byte_t **rvalue, apr_size_t *rvalue_len)
 
apr_status_t ajp_msg_create (apr_pool_t *pool, apr_size_t size, ajp_msg_t **rmsg)
 
apr_status_t ajp_msg_copy (ajp_msg_t *smsg, ajp_msg_t *dmsg)
 
apr_status_t ajp_msg_serialize_ping (ajp_msg_t *msg)
 
apr_status_t ajp_msg_serialize_cping (ajp_msg_t *msg)
 
apr_status_t ajp_msg_dump (apr_pool_t *pool, ajp_msg_t *msg, char *err, apr_size_t count, char **buf)
 
apr_status_t ajp_msg_log (request_rec *r, ajp_msg_t *msg, char *err)
 
apr_status_t ajp_ilink_send (apr_socket_t *sock, ajp_msg_t *msg)
 
apr_status_t ajp_ilink_receive (apr_socket_t *sock, ajp_msg_t *msg)
 
apr_status_t ajp_send_header (apr_socket_t *sock, request_rec *r, apr_size_t buffsize, apr_uri_t *uri, const char *secret)
 
apr_status_t ajp_read_header (apr_socket_t *sock, request_rec *r, apr_size_t buffsize, ajp_msg_t **msg)
 
apr_status_t ajp_alloc_data_msg (apr_pool_t *pool, char **ptr, apr_size_t *len, ajp_msg_t **msg)
 
apr_status_t ajp_send_data_msg (apr_socket_t *sock, ajp_msg_t *msg, apr_size_t len)
 
int ajp_parse_type (request_rec *r, ajp_msg_t *msg)
 
apr_status_t ajp_parse_header (request_rec *r, proxy_dir_conf *conf, ajp_msg_t *msg)
 
apr_status_t ajp_parse_data (request_rec *r, ajp_msg_t *msg, apr_uint16_t *len, char **ptr)
 
apr_status_t ajp_parse_reuse (request_rec *r, ajp_msg_t *msg, apr_byte_t *reuse)
 
apr_status_t ajp_handle_cping_cpong (apr_socket_t *sock, request_rec *r, apr_interval_time_t timeout)
 
const char * ajp_type_str (int type)
 

Detailed Description

Macro Definition Documentation

#define ajp_msg_append_string (   m,
 
)    ajp_msg_append_string_ex(m, v, 1)

Add a String in AJP message, and transform the String in ASCII if we're on an EBCDIC machine

#define ajp_msg_append_string_ascii (   m,
 
)    ajp_msg_append_string_ex(m, v, 0)

Add a String in AJP message.

Function Documentation

apr_status_t ajp_alloc_data_msg ( apr_pool_t pool,
char **  ptr,
apr_size_t len,
ajp_msg_t **  msg 
)

Allocate a msg to send data

Parameters
poolpool to allocate from
ptrdata buffer
lenthe length of allocated data buffer
msgreturned AJP message
Returns
APR_SUCCESS or error
apr_status_t ajp_handle_cping_cpong ( apr_socket_t sock,
request_rec r,
apr_interval_time_t  timeout 
)

Handle the CPING/CPONG messages

Parameters
sockbackend socket
rcurrent request
timeouttime window for receiving cpong reply
Returns
APR_SUCCESS or error
apr_status_t ajp_ilink_receive ( apr_socket_t sock,
ajp_msg_t msg 
)

Receive an AJP message from backend

Parameters
sockbackend socket
msgAJP message to put serialized message
Returns
APR_SUCCESS or error
apr_status_t ajp_ilink_send ( apr_socket_t sock,
ajp_msg_t msg 
)

Send an AJP message to backend

Parameters
sockbackend socket
msgAJP message to put serialized message
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_append_bytes ( ajp_msg_t msg,
const apr_byte_t value,
apr_size_t  valuelen 
)

Add a Byte array to AJP Message

Parameters
msgAJP Message to get value from
valuePointer to Byte array
valuelenByte array len
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_append_string_ex ( ajp_msg_t msg,
const char *  value,
int  convert 
)

Add a String in AJP message, and transform the String in ASCII if convert is set and we're on an EBCDIC machine

Parameters
msgAJP Message to get value from
valuePointer to String
convertWhen set told to convert String to ASCII
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_append_uint16 ( ajp_msg_t msg,
apr_uint16_t  value 
)

Add an unsigned 16bits value to AJP Message

Parameters
msgAJP Message to get value from
valuevalue to add to AJP Message
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_append_uint32 ( ajp_msg_t msg,
apr_uint32_t  value 
)

Add an unsigned 32bits value to AJP Message

Parameters
msgAJP Message to get value from
valuevalue to add to AJP Message
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_append_uint8 ( ajp_msg_t msg,
apr_byte_t  value 
)

Add an unsigned 8bits value to AJP Message

Parameters
msgAJP Message to get value from
valuevalue to add to AJP Message
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_check_header ( ajp_msg_t msg,
apr_size_t len 
)

Check a new AJP Message by looking at signature and return its size

Parameters
msgAJP Message to check
lenPointer to returned len
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_copy ( ajp_msg_t smsg,
ajp_msg_t dmsg 
)

Recopy an AJP Message to another

Parameters
smsgsource AJP message
dmsgdestination AJP message
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_create ( apr_pool_t pool,
apr_size_t  size,
ajp_msg_t **  rmsg 
)

Create an AJP Message from pool

Parameters
poolmemory pool to allocate AJP message from
sizesize of the buffer to create
rmsgPointer to newly created AJP message
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_dump ( apr_pool_t pool,
ajp_msg_t msg,
char *  err,
apr_size_t  count,
char **  buf 
)

Dump up to the first 1024 bytes on an AJP Message

Parameters
poolpool to allocate from
msgAJP Message to dump
errerror string to display
countthe number of bytes to dump
bufbuffer pointer for dump message
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_end ( ajp_msg_t msg)

Mark the end of an AJP Message

Parameters
msgAJP Message to end
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_get_bytes ( ajp_msg_t msg,
apr_byte_t **  rvalue,
apr_size_t rvalue_len 
)

Get a Byte array from AJP Message

Parameters
msgAJP Message to get value from
rvaluePointer where value will be returned
rvalue_lenPointer where Byte array len will be returned
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_get_string ( ajp_msg_t msg,
const char **  rvalue 
)

Get a String value from AJP Message

Parameters
msgAJP Message to get value from
rvaluePointer where value will be returned
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_get_uint16 ( ajp_msg_t msg,
apr_uint16_t rvalue 
)

Get a 16bits unsigned value from AJP Message

Parameters
msgAJP Message to get value from
rvaluePointer where value will be returned
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_get_uint32 ( ajp_msg_t msg,
apr_uint32_t rvalue 
)

Get a 32bits unsigned value from AJP Message

Parameters
msgAJP Message to get value from
rvaluePointer where value will be returned
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_get_uint8 ( ajp_msg_t msg,
apr_byte_t rvalue 
)

Get a 8bits unsigned value from AJP Message

Parameters
msgAJP Message to get value from
rvaluePointer where value will be returned
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_log ( request_rec r,
ajp_msg_t msg,
char *  err 
)

Log an AJP message

Parameters
rThe current request
msgAJP Message to dump
errerror string to display
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_peek_uint16 ( ajp_msg_t msg,
apr_uint16_t rvalue 
)

Peek a 16bits unsigned value from AJP Message, position in message is not updated

Parameters
msgAJP Message to get value from
rvaluePointer where value will be returned
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_peek_uint8 ( ajp_msg_t msg,
apr_byte_t rvalue 
)

Peek a 8bits unsigned value from AJP Message, position in message is not updated

Parameters
msgAJP Message to get value from
rvaluePointer where value will be returned
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_reset ( ajp_msg_t msg)

Reset an AJP Message

Parameters
msgAJP Message to reset
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_reuse ( ajp_msg_t msg)

Reuse an AJP Message

Parameters
msgAJP Message to reuse
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_serialize_cping ( ajp_msg_t msg)

Serialize in an AJP Message a CPING command

+--------------------—+ | CPING CMD (1 byte) | +--------------------—+

Parameters
msgAJP message to put serialized message
Returns
APR_SUCCESS or error
apr_status_t ajp_msg_serialize_ping ( ajp_msg_t msg)

Serialize in an AJP Message a PING command

+--------------------—+ | PING CMD (1 byte) | +--------------------—+

Parameters
msgAJP message to put serialized message
Returns
APR_SUCCESS or error
apr_status_t ajp_parse_data ( request_rec r,
ajp_msg_t msg,
apr_uint16_t len,
char **  ptr 
)

Parse the message body and return data address and length

Parameters
rcurrent request
msgAJP message
lenreturned AJP message length
ptrreturned data
Returns
APR_SUCCESS or error
apr_status_t ajp_parse_header ( request_rec r,
proxy_dir_conf conf,
ajp_msg_t msg 
)

Parse the header message from container

Parameters
rcurrent request
confproxy config
msgAJP message
Returns
APR_SUCCESS or error
apr_status_t ajp_parse_reuse ( request_rec r,
ajp_msg_t msg,
apr_byte_t reuse 
)

Check the reuse flag in CMD_AJP13_END_RESPONSE

Parameters
rcurrent request
msgAJP message
reusereturned reuse flag
Returns
APR_SUCCESS or error
int ajp_parse_type ( request_rec r,
ajp_msg_t msg 
)

Parse the message type

Parameters
rcurrent request
msgAJP message
Returns
AJP message type.
apr_status_t ajp_read_header ( apr_socket_t sock,
request_rec r,
apr_size_t  buffsize,
ajp_msg_t **  msg 
)

Read the ajp message and return the type of the message.

Parameters
sockbackend socket
rcurrent request
buffsizesize of the buffer.
msgreturned AJP message
Returns
APR_SUCCESS or error
apr_status_t ajp_send_data_msg ( apr_socket_t sock,
ajp_msg_t msg,
apr_size_t  len 
)

Send the data message

Parameters
sockbackend socket
msgAJP message to send
lenAJP message length
Returns
APR_SUCCESS or error
apr_status_t ajp_send_header ( apr_socket_t sock,
request_rec r,
apr_size_t  buffsize,
apr_uri_t uri,
const char *  secret 
)

Build the ajp header message and send it

Parameters
sockbackend socket
rcurrent request
buffsizemax size of the AJP packet.
urirequested uri
secretauthentication secret
Returns
APR_SUCCESS or error
const char* ajp_type_str ( int  type)

Convert numeric message type into string

Parameters
typeAJP message type
Returns
AJP message type as a string