|
OpenVAS Scanner 22.7.9
|


Go to the source code of this file.
Data Structures | |
| struct | ipc_hostname |
| struct | ipc_user_agent |
| struct | ipc_data |
Macros | |
| #define | G_LOG_DOMAIN "lib misc" |
| GLib logging domain. | |
Typedefs | |
| typedef struct ipc_hostname | ipc_hostname_t |
| typedef struct ipc_user_agent | ipc_user_agent_t |
Functions | |
| enum ipc_data_type | ipc_get_data_type_from_data (ipc_data_t *data) |
| Get the data type in data. | |
| gchar * | ipc_get_hostname_from_data (ipc_data_t *data) |
| Get the hostname from IPC data. | |
| gchar * | ipc_get_hostname_source_from_data (ipc_data_t *data) |
| Get the vhost hostname source from IPC data. | |
| gchar * | ipc_get_user_agent_from_data (ipc_data_t *data) |
| Get the User-Agent from IPC data. | |
| struct ipc_data * | ipc_data_type_from_hostname (const char *source, size_t source_len, const char *hostname, size_t hostname_len) |
| initializes ipc_data for a hostname data. | |
| static void | ipc_hostname_destroy (ipc_hostname_t *data) |
| Free ipc_hostname_t 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. | |
| static void | ipc_user_agent_destroy (ipc_user_agent_t *data) |
| Free a user agent data structure. | |
| void | ipc_data_destroy (ipc_data_t **data) |
| destroys ipc_data. | |
| const char * | ipc_data_to_json (struct ipc_data *data) |
| transforms ipc_data to a json string | |
| struct ipc_data * | ipc_data_from_json (const char *json, size_t len) |
| transforms json string to a ipc_data struct | |
| #define G_LOG_DOMAIN "lib misc" |
GLib logging domain.
Definition at line 13 of file ipc_openvas.c.
| typedef struct ipc_hostname ipc_hostname_t |
Definition at line 26 of file ipc_openvas.c.
| typedef struct ipc_user_agent ipc_user_agent_t |
Definition at line 35 of file ipc_openvas.c.
| void ipc_data_destroy | ( | ipc_data_t ** | data | ) |
destroys ipc_data.
| data | the ipc_data to be destroyed. |
Definition at line 224 of file ipc_openvas.c.
References IPC_DT_ERROR, IPC_DT_HOSTNAME, IPC_DT_USER_AGENT, ipc_hostname_destroy(), and ipc_user_agent_destroy().
Referenced by add_hostname(), Ensure(), ipc_data_from_json(), process_ipc_data(), and send_user_agent_via_ipc().


| struct ipc_data * ipc_data_from_json | ( | const char * | json, |
| size_t | len | ||
| ) |
transforms json string to a ipc_data struct
| json | the json representation to be transformed. |
| len | the length of the json representation |
Definition at line 319 of file ipc_openvas.c.
References ipc_hostname::hostname, ipc_hostname::hostname_len, ipc_data_destroy(), IPC_DT_ERROR, IPC_DT_HOSTNAME, IPC_DT_USER_AGENT, ipc_data::ipc_hostname, ipc_hostname_destroy(), ipc_data::ipc_user_agent, len, ipc_hostname::source, ipc_hostname::source_len, ipc_data::type, ipc_user_agent::user_agent, and ipc_user_agent::user_agent_len.
Referenced by Ensure(), and process_ipc_data().


| const char * ipc_data_to_json | ( | struct ipc_data * | data | ) |
transforms ipc_data to a json string
| data | the ipc_data to be transformed. |
Definition at line 251 of file ipc_openvas.c.
References ipc_hostname::hostname, IPC_DT_ERROR, IPC_DT_HOSTNAME, IPC_DT_USER_AGENT, ipc_get_data_type_from_data(), ipc_data::ipc_hostname, ipc_data::ipc_user_agent, ipc_hostname::source, ipc_data::type, and ipc_user_agent::user_agent.
Referenced by add_hostname(), Ensure(), and send_user_agent_via_ipc().


| struct ipc_data * ipc_data_type_from_hostname | ( | const char * | source, |
| size_t | source_len, | ||
| const char * | hostname, | ||
| size_t | hostname_len | ||
| ) |
initializes ipc_data for a hostname data.
| source | the source of the hostname |
| hostname | the name of the host |
Definition at line 124 of file ipc_openvas.c.
References free(), ipc_hostname::hostname, hostname, ipc_hostname::hostname_len, IPC_DT_HOSTNAME, ipc_data::ipc_hostname, ipc_hostname::source, ipc_hostname::source_len, and ipc_data::type.
Referenced by add_hostname(), and Ensure().


| 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.
| user_agent | The User-Agent |
| user_agent_len | Length of the user agent string. |
Definition at line 173 of file ipc_openvas.c.
References free(), IPC_DT_USER_AGENT, ipc_data::ipc_user_agent, ipc_data::type, ipc_user_agent::user_agent, user_agent, and ipc_user_agent::user_agent_len.
Referenced by Ensure(), and send_user_agent_via_ipc().


| enum ipc_data_type ipc_get_data_type_from_data | ( | ipc_data_t * | data | ) |
Get the data type in data.
| data | Structure containing the data and data type |
@Return The corresponding ipc_data_type, IPC_DT_ERROR on error.
Definition at line 58 of file ipc_openvas.c.
References IPC_DT_ERROR, and ipc_data::type.
Referenced by ipc_data_to_json(), ipc_get_hostname_from_data(), ipc_get_hostname_source_from_data(), ipc_get_user_agent_from_data(), and process_ipc_data().

| gchar * ipc_get_hostname_from_data | ( | ipc_data_t * | data | ) |
Get the hostname from IPC data.
| data | Data structure of IPC_DT_HOSNAME type. |
@Return a string containing the hostname, NULL on error.
Definition at line 73 of file ipc_openvas.c.
References ipc_hostname::hostname, IPC_DT_HOSTNAME, ipc_get_data_type_from_data(), and ipc_data::ipc_hostname.
Referenced by Ensure(), and process_ipc_data().


| gchar * ipc_get_hostname_source_from_data | ( | ipc_data_t * | data | ) |
Get the vhost hostname source from IPC data.
| data | Data structure of IPC_DT_HOSNAME type. |
@Return a string containing the vhost hostname source, NULL on error.
Definition at line 89 of file ipc_openvas.c.
References IPC_DT_HOSTNAME, ipc_get_data_type_from_data(), ipc_data::ipc_hostname, and ipc_hostname::source.
Referenced by Ensure(), and process_ipc_data().


| gchar * ipc_get_user_agent_from_data | ( | ipc_data_t * | data | ) |
Get the User-Agent from IPC data.
| data | Data structure of IPC_DT_USER_AGENT type. |
@Return a string containing the User-Agent, NULL on error.
Definition at line 105 of file ipc_openvas.c.
References IPC_DT_USER_AGENT, ipc_get_data_type_from_data(), ipc_data::ipc_user_agent, and ipc_user_agent::user_agent.
Referenced by Ensure(), and process_ipc_data().


|
static |
Free ipc_hostname_t data.
| data | The hostname data structure to be free()'ed |
Definition at line 153 of file ipc_openvas.c.
References ipc_hostname::hostname, and ipc_hostname::source.
Referenced by ipc_data_destroy(), and ipc_data_from_json().

|
static |
Free a user agent data structure.
| data | The user agent data structure to be free()'ed |
Definition at line 207 of file ipc_openvas.c.
References ipc_user_agent::user_agent.
Referenced by ipc_data_destroy().
