Greenbone Security Assistant
Typedefs | Functions
gsad_http_handler.h File Reference
#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)
 

Functions

http_handler_thttp_handler_add (http_handler_t *handlers, http_handler_t *handler)
 
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)
 
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)
 
http_handler_thttp_handler_new (http_handler_func_t)
 
void http_handler_free (http_handler_t *handler)
 
http_handler_tinit_http_handlers ()
 
void cleanup_http_handlers ()
 
http_handler_turl_handler_new (const gchar *regexp, http_handler_t *handler)
 
http_handler_turl_handler_add_func (http_handler_t *handlers, const gchar *regexp, http_handler_func_t handle)
 
http_handler_tmethod_router_new ()
 
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)
 
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. More...
 

Typedef Documentation

◆ http_handler_free_func_t

typedef void(* http_handler_free_func_t) (http_handler_t *)

◆ http_handler_func_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)

◆ http_handler_t

typedef struct http_handler http_handler_t

Function Documentation

◆ cleanup_http_handlers()

void cleanup_http_handlers ( )

◆ handle_request()

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.

Parameters
[in]clsA pointer to http_handler_t
[in]connectionConnection handle, e.g. used to send response.
[in]urlThe URL requested.
[in]method"GET" or "POST", others are disregarded.
[in]versionNot used for this callback.
[in]upload_dataData used for POST requests.
[in]upload_data_sizeSize of upload_data.
[out]con_clsFor exchange of connection-related data (here a struct gsad_connection_info).
Returns
MHD_NO in case of problems. MHD_YES if all is OK.

◆ http_handler_add()

http_handler_t* http_handler_add ( http_handler_t handlers,
http_handler_t handler 
)

◆ http_handler_free()

void http_handler_free ( http_handler_t handler)

◆ http_handler_new()

http_handler_t* http_handler_new ( http_handler_func_t  func)

◆ http_handler_next()

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 
)

◆ http_handler_start()

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 
)

◆ init_http_handlers()

http_handler_t* init_http_handlers ( )

◆ method_router_new()

http_handler_t* method_router_new ( )

◆ method_router_set_get_handler()

void method_router_set_get_handler ( http_handler_t router,
http_handler_t handler 
)

◆ method_router_set_post_handler()

void method_router_set_post_handler ( http_handler_t router,
http_handler_t handler 
)

◆ url_handler_add_func()

http_handler_t* url_handler_add_func ( http_handler_t handlers,
const gchar *  regexp,
http_handler_func_t  handle 
)

◆ url_handler_new()

http_handler_t* url_handler_new ( const gchar *  regexp,
http_handler_t handler 
)