|
Greenbone Security Assistant
8.0.0
|
#include "gsad_http.h"

Go to the source code of this file.
Typedefs | |
| typedef struct http_handler | http_handler_t |
| typedef void(* | http_handler_free_func_t) (http_handler_t *) |
| typedef int(* | http_handler_func_t) (http_connection_t *connection, const char *method, const char *url, gsad_connection_info_t *con_info, http_handler_t *handler, void *data) |
| typedef void(* http_handler_free_func_t) (http_handler_t *) |
Definition at line 32 of file gsad_http_handler.h.
| typedef int(* http_handler_func_t) (http_connection_t *connection, const char *method, const char *url, gsad_connection_info_t *con_info, http_handler_t *handler, void *data) |
Definition at line 34 of file gsad_http_handler.h.
| typedef struct http_handler http_handler_t |
Definition at line 30 of file gsad_http_handler.h.
| void cleanup_http_handlers | ( | ) |
Definition at line 804 of file gsad_http_handler.c.
References gvm_validator_free(), handlers, http_handler_free(), and http_validator.

| int handle_request | ( | void * | cls, |
| http_connection_t * | connection, | ||
| const char * | url, | ||
| const char * | method, | ||
| const char * | version, | ||
| const char * | upload_data, | ||
| size_t * | upload_data_size, | ||
| void ** | con_cls | ||
| ) |
HTTP request handler for GSAD.
This routine is an MHD_AccessHandlerCallback, the request handler for microhttpd.
| [in] | cls | A pointer to http_handler_t |
| [in] | connection | Connection handle, e.g. used to send response. |
| [in] | url | The URL requested. |
| [in] | method | "GET" or "POST", others are disregarded. |
| [in] | version | Not used for this callback. |
| [in] | upload_data | Data used for POST requests. |
| [in] | upload_data_size | Size of upload_data. |
| [out] | con_cls | For exchange of connection-related data (here a struct gsad_connection_info). |
Definition at line 832 of file gsad_http_handler.c.
References BAD_REQUEST_PAGE, gsad_connection_info::connectiontype, GSAD_CONTENT_TYPE_TEXT_HTML, handlers, http_handler_start(), MHD_HTTP_NOT_ACCEPTABLE, gsad_connection_info::params, params_mhd_add(), params_mhd_validate(), params_new(), POST_BUFFER_SIZE, gsad_connection_info::postprocessor, reconstruct_url(), send_response(), and serve_post().

| http_handler_t* http_handler_add | ( | http_handler_t * | handlers, |
| http_handler_t * | handler | ||
| ) |
Definition at line 94 of file gsad_http_handler.c.
References handlers, and http_handler::next.
Referenced by init_http_handlers(), and url_handler_add_func().

| void http_handler_free | ( | http_handler_t * | handler | ) |
Definition at line 166 of file gsad_http_handler.c.
References http_handler::free, http_handler_free(), and http_handler::next.
Referenced by cleanup_http_handlers(), http_handler_free(), method_router_free(), and url_handler_free().


| http_handler_t* http_handler_new | ( | http_handler_func_t | ) |
Definition at line 160 of file gsad_http_handler.c.
References http_handler_free_internal(), and http_handler_new_with_data().
Referenced by init_http_handlers(), and url_handler_add_func().


| int http_handler_next | ( | http_connection_t * | connection, |
| const char * | method, | ||
| const char * | url, | ||
| gsad_connection_info_t * | con_info, | ||
| http_handler_t * | handler, | ||
| void * | data | ||
| ) |
Definition at line 126 of file gsad_http_handler.c.
References http_handler::handle, and http_handler::next.
Referenced by handle_get_post(), handle_get_user(), handle_invalid_method(), handle_setup_credentials(), handle_setup_user(), handle_url(), and handle_validate().

| int http_handler_start | ( | http_connection_t * | connection, |
| const char * | method, | ||
| const char * | url, | ||
| gsad_connection_info_t * | con_info, | ||
| http_handler_t * | handler, | ||
| void * | data | ||
| ) |
Definition at line 114 of file gsad_http_handler.c.
References http_handler::handle.
Referenced by handle_get_post(), handle_request(), and handle_url().

| http_handler_t* init_http_handlers | ( | ) |
Definition at line 743 of file gsad_http_handler.c.
References gvm_validator_add(), gvm_validator_new(), handle_get_user(), handle_gmp_get(), handle_gmp_post(), handle_index(), handle_invalid_method(), handle_logout(), handle_not_found(), handle_setup_credentials(), handle_setup_user(), handle_static_config(), handle_static_file(), handle_system_report(), handle_validate(), handlers, http_handler_add(), http_handler_new(), http_validator, method_router_new(), method_router_set_get_handler(), method_router_set_post_handler(), SLAVE_ID_REGEXP, TOKEN_REGEXP, url_handler_add_func(), and url_handler_new().

| http_handler_t* method_router_new | ( | ) |
Definition at line 216 of file gsad_http_handler.c.
References method_router::get, handle_get_post(), http_handler_new_with_data(), method_router_free(), and method_router::post.
Referenced by init_http_handlers().


| void method_router_set_get_handler | ( | http_handler_t * | router, |
| http_handler_t * | handler | ||
| ) |
Definition at line 226 of file gsad_http_handler.c.
References http_handler::data, and method_router::get.
Referenced by init_http_handlers().

| void method_router_set_post_handler | ( | http_handler_t * | router, |
| http_handler_t * | handler | ||
| ) |
Definition at line 233 of file gsad_http_handler.c.
References http_handler::data, and method_router::post.
Referenced by init_http_handlers().

| http_handler_t* url_handler_add_func | ( | http_handler_t * | handlers, |
| const gchar * | regexp, | ||
| http_handler_func_t | handle | ||
| ) |
Definition at line 289 of file gsad_http_handler.c.
References handlers, http_handler_add(), http_handler_new(), and url_handler_new().
Referenced by init_http_handlers().


| http_handler_t* url_handler_new | ( | const gchar * | regexp, |
| http_handler_t * | handler | ||
| ) |
Definition at line 282 of file gsad_http_handler.c.
References handle_url(), http_handler_new_with_data(), url_handler_free(), and url_map_new().
Referenced by init_http_handlers(), and url_handler_add_func().

