Greenbone Security Assistant  8.0.0
gsad_http_handler.h
Go to the documentation of this file.
1 /* Copyright (C) 2016-2018 Greenbone Networks GmbH
2  *
3  * SPDX-License-Identifier: GPL-2.0-or-later
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
25 #ifndef _GSAD_HTTP_HANDLER_H
26 #define _GSAD_HTTP_HANDLER_H
27 
28 #include "gsad_http.h"
29 
31 
33 
34 typedef int (*http_handler_func_t) (http_connection_t *connection,
35  const char *method, const char *url,
36  gsad_connection_info_t *con_info,
37  http_handler_t *handler, void *data);
38 
41 
42 int
43 http_handler_next (http_connection_t *connection, const char *method,
44  const char *url, gsad_connection_info_t *con_info,
45  http_handler_t *handler, void *data);
46 
47 int
48 http_handler_start (http_connection_t *connection, const char *method,
49  const char *url, gsad_connection_info_t *con_info,
50  http_handler_t *handler, void *data);
51 
53 
54 void
56 
59 
60 void
62 
64 url_handler_new (const gchar *regexp, http_handler_t *handler);
65 
67 url_handler_add_func (http_handler_t *handlers, const gchar *regexp,
69 
72 
73 void
75 
76 void
78  http_handler_t *handler);
79 
80 int
81 handle_request (void *cls, http_connection_t *connection, const char *url,
82  const char *method, const char *version,
83  const char *upload_data, size_t *upload_data_size,
84  void **con_cls);
85 
86 #endif /* _GSAD_HTTP_HANDLER_H */
http_handler_t * init_http_handlers()
http_handler_func_t handle
http_handler_t * url_handler_new(const gchar *regexp, http_handler_t *handler)
http_handler_t * http_handler_new(http_handler_func_t)
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)
void http_handler_free(http_handler_t *handler)
http_handler_t * method_router_new()
HTTP handling of GSA.
struct MHD_Connection http_connection_t
Definition: gsad_http.h:135
http_handler_t * http_handler_add(http_handler_t *handlers, http_handler_t *handler)
Connection information.
Definition: gsad_http.h:125
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)
void(* http_handler_free_func_t)(http_handler_t *)
void method_router_set_get_handler(http_handler_t *router, http_handler_t *handler)
void method_router_set_post_handler(http_handler_t *router, http_handler_t *handler)
void cleanup_http_handlers()
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.
http_handler_t * url_handler_add_func(http_handler_t *handlers, const gchar *regexp, http_handler_func_t handle)
http_handler_t * handlers
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)