|
OpenVAS Scanner 23.40.3
|


Go to the source code of this file.
Data Structures | |
| struct | ipc_hostname |
| struct | ipc_user_agent |
| struct | ipc_lsc |
| 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 |
| typedef struct ipc_lsc | ipc_lsc_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. | |
| gboolean | ipc_get_lsc_data_ready_flag (ipc_data_t *data) |
| Get the package list from LSC IPC data. | |
| ipc_data_t * | 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. | |
| ipc_data_t * | 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. | |
| ipc_data_t * | ipc_data_type_from_lsc (gboolean data_ready) |
| initializes ipc_data for the table driven LSC. | |
| static void | ipc_lsc_destroy (ipc_lsc_t *data) |
| Free a LSC data structure. | |
| void | ipc_data_destroy (ipc_data_t **data) |
| destroys ipc_data. | |
| const char * | ipc_data_to_json (ipc_data_t *data) |
| transforms ipc_data to a json string | |
| ipc_data_t * | 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.
Definition at line 43 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 294 of file ipc_openvas.c.
References IPC_DT_ERROR, IPC_DT_HOSTNAME, IPC_DT_LSC, IPC_DT_NO_DATA, IPC_DT_USER_AGENT, ipc_hostname_destroy(), ipc_lsc_destroy(), and ipc_user_agent_destroy().
Referenced by add_hostname(), Ensure(), Ensure(), Ensure(), ipc_data_from_json(), nasl_update_table_driven_lsc_data(), process_ipc_data(), and send_user_agent_via_ipc().


| ipc_data_t * 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 400 of file ipc_openvas.c.
References ipc_lsc::data_ready, ipc_hostname::hostname, ipc_hostname::hostname_len, ipc_data_destroy(), IPC_DT_ERROR, IPC_DT_HOSTNAME, IPC_DT_LSC, IPC_DT_NO_DATA, IPC_DT_USER_AGENT, ipc_data::ipc_hostname, ipc_hostname_destroy(), ipc_data::ipc_lsc, 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(), Ensure(), Ensure(), Ensure(), and process_ipc_data().


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


| ipc_data_t * 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 149 of file ipc_openvas.c.
References free(), hostname, ipc_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().


| ipc_data_t * ipc_data_type_from_lsc | ( | gboolean | data_ready | ) |
initializes ipc_data for the table driven LSC.
| os_release | The OS release |
Definition at line 250 of file ipc_openvas.c.
References ipc_lsc::data_ready, free(), IPC_DT_LSC, ipc_data::ipc_lsc, and ipc_data::type.
Referenced by nasl_update_table_driven_lsc_data().


| ipc_data_t * 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 198 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 67 of file ipc_openvas.c.
References IPC_DT_ERROR, and ipc_data::type.
Referenced by Ensure(), ipc_data_to_json(), ipc_get_hostname_from_data(), ipc_get_hostname_source_from_data(), ipc_get_lsc_data_ready_flag(), 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 82 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(), Ensure(), 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 98 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(), Ensure(), Ensure(), and process_ipc_data().


| gboolean ipc_get_lsc_data_ready_flag | ( | ipc_data_t * | data | ) |
Get the package list from LSC IPC data.
| data | Data structure of IPC_DT_LSC type. |
@Return True if the data is ready for running with LSC, False otherwise.
Definition at line 130 of file ipc_openvas.c.
References ipc_lsc::data_ready, IPC_DT_LSC, ipc_get_data_type_from_data(), and ipc_data::ipc_lsc.
Referenced by 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 114 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(), Ensure(), and process_ipc_data().


|
static |
Free ipc_hostname_t data.
| data | The hostname data structure to be free()'ed |
Definition at line 178 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 LSC data structure.
| data | The lsc data structure to be free()'ed |
Definition at line 280 of file ipc_openvas.c.
Referenced by ipc_data_destroy().

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