|
OpenVAS Scanner 23.23.1
|
#include "nasl_http2.h"#include "../misc/plugutils.h"#include "../misc/user_agent.h"#include "exec.h"#include "nasl_debug.h"#include "nasl_func.h"#include "nasl_global_ctxt.h"#include "nasl_lex_ctxt.h"#include "nasl_socket.h"#include "nasl_tree.h"#include "nasl_var.h"#include <ctype.h>#include <curl/curl.h>#include <gnutls/gnutls.h>#include <gvm/base/prefs.h>#include <gvm/util/kb.h>#include <string.h>Data Structures | |
| struct | handle_table_s |
| Struct to store handles. More... | |
| struct | string |
| Define a string struct for storing the response. More... | |
Macros | |
| #define | G_LOG_DOMAIN "lib nasl" |
| GLib log domain. | |
| #define | MAX_HANDLES 10 |
Typedefs | |
| typedef enum KEYWORD_E | KEYWORD |
| Allowed methods. | |
Enumerations | |
| enum | KEYWORD_E { POST , GET , PUT , DELETE , HEAD } |
| Allowed methods. More... | |
Functions | |
| static int | next_handle_id (void) |
| Get the new available handle identifier. | |
| tree_cell * | nasl_http2_handle (lex_ctxt *lexic) |
| Creates a handle for http requests. | |
| tree_cell * | nasl_http2_close_handle (lex_ctxt *lexic) |
| Close a handle for http requests previously initialized. | |
| static void | init_string (struct string *s) |
| Initialize the string struct to hold the response or header. | |
| static size_t | response_callback_fn (void *ptr, size_t size, size_t nmemb, void *struct_string) |
| Call back function to stored the response. | |
| static size_t | header_callback_fn (char *buffer, size_t size, size_t nmemb, void *struct_string) |
| Call back function to stored the header. | |
| static tree_cell * | _http2_req (lex_ctxt *lexic, KEYWORD keyword) |
| Perform an HTTP request. Forcing HTTP2 if possible. | |
| tree_cell * | nasl_http2_get_response_code (lex_ctxt *lexic) |
| Get the http response code after performing a HTTP request. | |
| tree_cell * | nasl_http2_set_custom_header (lex_ctxt *lexic) |
| Set a custom header element in the header. | |
| tree_cell * | nasl_http2_get (lex_ctxt *lexic) |
| Wrapper function for GET request. See @_http2_req. | |
| tree_cell * | nasl_http2_head (lex_ctxt *lexic) |
| Wrapper function for HEAD request. See @_http2_req. | |
| tree_cell * | nasl_http2_post (lex_ctxt *lexic) |
| Wrapper function for POST request. See @_http2_req. | |
| tree_cell * | nasl_http2_delete (lex_ctxt *lexic) |
| Wrapper function for DELETE request. See @_http2_req. | |
| tree_cell * | nasl_http2_put (lex_ctxt *lexic) |
| Wrapper function for PUT request. See @_http2_req. | |
Variables | |
| static struct handle_table_s * | handle_table [MAX_HANDLES] |
| Handle Table. | |
| #define G_LOG_DOMAIN "lib nasl" |
GLib log domain.
| #define MAX_HANDLES 10 |
| enum KEYWORD_E |
Perform an HTTP request. Forcing HTTP2 if possible.
| [in] | lexic | Lexical context of NASL interpreter. |
|
static |
Call back function to stored the header.
@description The function signature is the necessary to work with libcurl. It stores the header in s. It reallocate memory if necessary.
|
static |
Initialize the string struct to hold the response or header.
| s[in/out] | The string struct to be initialized |
Close a handle for http requests previously initialized.
| [in] | lexic | Lexical context of NASL interpreter. |
Wrapper function for DELETE request. See @_http2_req.
Get the http response code after performing a HTTP request.
| [in] | lexic | Lexical context of NASL interpreter. |
Creates a handle for http requests.
| [in] | lexic | Lexical context of NASL interpreter. |
Set a custom header element in the header.
| [in] | lexic | Lexical context of NASL interpreter. |
|
static |
Get the new available handle identifier.
|
static |
Call back function to stored the response.
@description The function signature is the necessary to work with libcurl. It stores the response in s. It reallocate memory if necessary.
|
static |
Handle Table.