c-icap-doc
0.1
|
Services related API.
More...
Data Structures | |
struct | ci_service_module |
Is the structure which implements a service More... | |
Typedefs | |
typedef struct ci_service_xdata | ci_service_xdata_t |
Stores required data and settings for a service | |
Functions | |
void | ci_service_set_istag (ci_service_xdata_t *srv_xdata, const char *istag) |
Sets the ISTAG for the service. More... | |
void | ci_service_set_xopts (ci_service_xdata_t *srv_xdata, uint64_t xopts) |
Sets the service x-headers mask which defines the X-Headers supported by the service.The c-icap server will advertise these headers in options responses. More... | |
void | ci_service_add_xopts (ci_service_xdata_t *srv_xdata, uint64_t xopts) |
it is similar to the function ci_service_set_xopts but just adds (not sets) the X-Headers defined by the xopts parameter to the existing x-headers mask of service. | |
void | ci_service_set_transfer_preview (ci_service_xdata_t *srv_xdata, const char *preview) |
Set the list of file extensions that should previewed by the service. More... | |
void | ci_service_set_transfer_ignore (ci_service_xdata_t *srv_xdata, const char *ignore) |
Set the list of file extensions that should NOT be send for this service. More... | |
void | ci_service_set_transfer_complete (ci_service_xdata_t *srv_xdata, const char *complete) |
Set the list of file extensions that should be send in their entirety (without preview) to this service. More... | |
void | ci_service_set_preview (ci_service_xdata_t *srv_xdata, int preview) |
Sets the maximum preview size supported by this service. More... | |
void | ci_service_enable_204 (ci_service_xdata_t *srv_xdata) |
Enable the allow 204 responses for this service. More... | |
void | ci_service_enable_206 (ci_service_xdata_t *srv_xdata) |
Enable the Partial Content 206 responses for this service. More... | |
void | ci_service_set_max_connections (ci_service_xdata_t *srv_xdata, int max_connections) |
Sets the maximum connection should opened by icap client to the c-icap for this service. More... | |
void | ci_service_set_options_ttl (ci_service_xdata_t *srv_xdata, int ttl) |
Sets the Options ttl for this service. More... | |
void | ci_service_add_option_handler (ci_service_xdata_t *srv_xdata, const char *name, int(*handler)(struct ci_request *)) |
Add a service handler for the service. More... | |
Services related API.
For detailed information about implementing a service look the documentation of struct ci_service_module
void ci_service_add_option_handler | ( | ci_service_xdata_t * | srv_xdata, |
const char * | name, | ||
int(*)(struct ci_request *) | handler | ||
) |
Add a service handler for the service.
Normally this function called in ci_service_module::mod_init_service() or ci_service_module::mod_post_init_service() function. The options handlers are running when the service receives an OPTIONS request to check for service health. They can add ICAP headers to the OPTIONS response and must return CI_OK on success, or CI_ERROR on failure. If one or more handlers failed the c-icap will produce a "500 Server Error" response.
srv_xdata | is a pointer to the c-icap internal service data. |
name | a name for the handler, used for debuging reasons |
handler | the handler |
void ci_service_enable_204 | ( | ci_service_xdata_t * | srv_xdata | ) |
Enable the allow 204 responses for this service.
The service will supports the allow 204 responses if the icap client support it too.
srv_xdata | is a pointer to the c-icap internal service data. |
void ci_service_enable_206 | ( | ci_service_xdata_t * | srv_xdata | ) |
Enable the Partial Content 206 responses for this service.
The service will supports the Partial Content 206 responses if the icap client support it too.
srv_xdata | is a pointer to the c-icap internal service data. |
void ci_service_set_istag | ( | ci_service_xdata_t * | srv_xdata, |
const char * | istag | ||
) |
Sets the ISTAG for the service.
Normally this function called in ci_service_module::mod_init_service() or ci_service_module::mod_post_init_service() function, while the service initialization.
srv_xdata | is a pointer to the c-icap internal service data. |
istag | is a string contains the new ISTAG for the service. The istag size can not be more than a size of SERVICE_ISTAG_SIZE. If the length of istag is greater than SERVICE_ISTAG_SIZE the extra bytes are ignored. |
void ci_service_set_max_connections | ( | ci_service_xdata_t * | srv_xdata, |
int | max_connections | ||
) |
Sets the maximum connection should opened by icap client to the c-icap for this service.
srv_xdata | is a pointer to the c-icap internal service data. |
max_connections | is the maximum connections |
void ci_service_set_options_ttl | ( | ci_service_xdata_t * | srv_xdata, |
int | ttl | ||
) |
Sets the Options ttl for this service.
srv_xdata | is a pointer to the c-icap internal service data. |
ttl | is the ttl value in seconds |
void ci_service_set_preview | ( | ci_service_xdata_t * | srv_xdata, |
int | preview | ||
) |
Sets the maximum preview size supported by this service.
srv_xdata | is a pointer to the c-icap internal service data. |
preview | is the size of preview data supported by this service |
void ci_service_set_transfer_complete | ( | ci_service_xdata_t * | srv_xdata, |
const char * | complete | ||
) |
Set the list of file extensions that should be send in their entirety (without preview) to this service.
The c-icap will inform the ICAP client that should send files which have the extensions contained in the complete string, in their entirety to this service.
srv_xdata | is a pointer to the c-icap internal service data. |
complete | is the string which contains the list of the file extensions. |
example usage:
void ci_service_set_transfer_ignore | ( | ci_service_xdata_t * | srv_xdata, |
const char * | ignore | ||
) |
Set the list of file extensions that should NOT be send for this service.
The c-icap will inform the ICAP client that should not send files which have the extensions contained in the ignore string.
srv_xdata | is a pointer to the c-icap internal service data. |
ignore | is the string which contains the list of the file extensions. |
example usage:
void ci_service_set_transfer_preview | ( | ci_service_xdata_t * | srv_xdata, |
const char * | preview | ||
) |
Set the list of file extensions that should previewed by the service.
The c-icap will inform the ICAP client that should send preview data for the files which have the extensions contained in the preview string. The wildcard value "*" specifies all files extensions, which is the default.
srv_xdata | is a pointer to the c-icap internal service data. |
preview | is the string which contains the list of the file extensions. |
example usage:
void ci_service_set_xopts | ( | ci_service_xdata_t * | srv_xdata, |
uint64_t | xopts | ||
) |
Sets the service x-headers mask which defines the X-Headers supported by the service.The c-icap server will advertise these headers in options responses.
Normally this function called in ci_service_module::mod_init_service() or ci_service_module::mod_post_init_service() function, while the service is initialized.
srv_xdata | is a pointer to the c-icap internal service data. |
xopts | is a compination of one or more of the following defines:
|
example usage:
For more informations about ICAP common X-Headers look at: http://www.icap-forum.org/documents/specification/draft-stecher-icap-subid-00.txt