18#include <gvm/base/prefs.h>
24#define G_LOG_DOMAIN "lib misc"
35 const char *json = NULL;
41 g_warning (
"Unable to send %s to host process",
user_agent);
59 if (!ua || strlen (g_strstrip (ua)) == 0)
63 ua = g_strdup_printf (
"Mozilla/5.0 [en] (X11, U; OpenVAS-VT %s)",
64 OPENVAS_MISC_VERSION);
66 ua = g_strdup_printf (
"Mozilla/5.0 [en] (X11, U; %s)",
91 if (ua != NULL && ua[0] !=
'\0')
int ipc_send(struct ipc_context *context, enum ipc_relation to, const char *msg, size_t len)
sends given msg to the target based on the given context
void ipc_data_destroy(ipc_data_t **data)
destroys ipc_data.
struct ipc_data * ipc_data_type_from_user_agent(const char *user_agent, size_t user_agent_len)
initializes ipc_data for the User-Agent.
const char * ipc_data_to_json(struct ipc_data *data)
transforms ipc_data to a json string
char * get_plugin_preference(const char *oid, const char *name, int pref_id)
Get the a plugins preference.
Header file for module plugutils.
const gchar * user_agent_get(struct ipc_context *ipc_context)
Get user-agent.
static void send_user_agent_via_ipc(struct ipc_context *ipc_context)
gchar * user_agent_set(const gchar *ua)
Set user-agent.
static gchar * user_agent
user-agent, or NULL.
static void user_agent_create()
Create and set the global User-Agent variable.
Header file: user agent functions prototypes.
const gchar * vendor_version_get()
Get vendor version.
Header file: vendor version functions prototypes.