|
OpenVAS Scanner 22.7.9
|
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 void | send_user_agent_via_ipc (struct ipc_context *ipc_context) |
| static void | user_agent_create () |
| Create and set the global User-Agent variable. | |
| gchar * | user_agent_set (const gchar *ua) |
| Set user-agent. | |
| const gchar * | user_agent_get (struct ipc_context *ipc_context) |
| 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 53 of file user_agent.c.
References get_plugin_preference(), user_agent, and vendor_version_get().
Referenced by user_agent_get().


| const gchar * user_agent_get | ( | struct ipc_context * | ipc_context | ) |
Get user-agent.
Definition at line 106 of file user_agent.c.
References send_user_agent_via_ipc(), user_agent, and user_agent_create().
Referenced by _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 85 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(), send_user_agent_via_ipc(), user_agent_create(), user_agent_get(), and user_agent_set().