|
OpenVAS Scanner 23.40.3
|
Functions to set and get the User-Agent. More...
#include "user_agent.h"#include "ipc_openvas.h"#include "plugutils.h"#include "vendorversion.h"#include <glib.h>#include <gvm/base/prefs.h>
Go to the source code of this file.
Macros | |
| #define | G_LOG_DOMAIN "lib misc" |
| GLib logging domain. | |
Functions | |
| static int | send_user_agent_via_ipc (struct ipc_context *ipc_context) |
| static void | user_agent_create (void) |
| Create and set the global User-Agent variable. | |
| gchar * | user_agent_set (const gchar *ua) |
| Set user-agent. | |
| int | user_agent_get (struct ipc_context *ipc_context, char **useragent) |
| Get user-agent. | |
Variables | |
| static gchar * | user_agent = NULL |
| user-agent, or NULL. | |
Functions to set and get the User-Agent.
Definition in file user_agent.c.
| #define G_LOG_DOMAIN "lib misc" |
GLib logging domain.
Definition at line 24 of file user_agent.c.
|
static |
Definition at line 32 of file user_agent.c.
References ipc_data_destroy(), ipc_data_to_json(), ipc_data_type_from_user_agent(), IPC_MAIN, ipc_send(), and user_agent.
Referenced by user_agent_get().


|
static |
Create and set the global User-Agent variable.
@description Gets the User-Agent from the globals_settings.nasl script preferences. If it is not set, it uses the Vendor version. In case that there is no Vendor version, it creates one with a fix string and the nasl library version.
Definition at line 57 of file user_agent.c.
References get_plugin_preference(), user_agent, and vendor_version_get().
Referenced by user_agent_get().


| int user_agent_get | ( | struct ipc_context * | ipc_context, |
| char ** | useragent ) |
Get user-agent.
param[in] ipc_context IPC context for sending data to the parent process param[out] useragent the user agent if any set or an empty string.
Definition at line 114 of file user_agent.c.
References send_user_agent_via_ipc(), user_agent, and user_agent_create().
Referenced by _http2_req(), and _http_req().


| gchar * user_agent_set | ( | const gchar * | ua | ) |
Set user-agent.
Set the global user agent. This function overwrite the existing UA. Null or empty string are not allowed.
| [in] | ua | user-agent to be set. |
Return the old User-Agent. It must be free by the caller
Definition at line 89 of file user_agent.c.
References user_agent.
Referenced by process_ipc_data().

|
static |
user-agent, or NULL.
Definition at line 29 of file user_agent.c.
Referenced by ipc_data_type_from_user_agent(), ipc_get_lsc_os_release_from_data(), send_user_agent_via_ipc(), user_agent_create(), user_agent_get(), and user_agent_set().