Greenbone Security Assistant  8.0.0
gsad_cmd.h File Reference

Headers for Response Data struct. More...

#include "gsad_content_type.h"
#include <glib.h>
Include dependency graph for gsad_cmd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct cmd_response_data cmd_response_data_t
 

Functions

cmd_response_data_t * cmd_response_data_new ()
 Allocates memory for a cmd_response_data_t sturct and initializes it. More...
 
void cmd_response_data_free (cmd_response_data_t *data)
 Frees the memory of a cmd_response_data_t struct. More...
 
void cmd_response_data_set_allow_caching (cmd_response_data_t *data, gboolean allow_caching)
 Set allow_caching flag of cmd_response_data_t struct. More...
 
gboolean cmd_response_data_is_allow_caching (cmd_response_data_t *data)
 Get allow_caching flag of cmd_response_data_t struct. More...
 
void cmd_response_data_set_content_type (cmd_response_data_t *data, content_type_t content_type)
 Set content type of cmd_response_data_t struct. More...
 
content_type_t cmd_response_data_get_content_type (cmd_response_data_t *data)
 Get content type of cmd_response_data_t struct. More...
 
void cmd_response_data_set_status_code (cmd_response_data_t *data, int http_status_code)
 Set status code of cmd_response_data_t struct. More...
 
int cmd_response_data_get_status_code (cmd_response_data_t *data)
 Get http status code of cmd_response_data_t struct. More...
 
void cmd_response_data_set_content_length (cmd_response_data_t *data, gsize content_length)
 Set response content length of cmd_response_data_t struct. More...
 
gsize cmd_response_data_get_content_length (cmd_response_data_t *data)
 Get response content length of cmd_response_data_t struct. More...
 
void cmd_response_data_set_content_disposition (cmd_response_data_t *data, gchar *content_disposition)
 Set content disposition of cmd_response_data_t struct. More...
 
const gchar * cmd_response_data_get_content_disposition (cmd_response_data_t *data)
 Get content disposition of cmd_response_data_t struct. More...
 
void cmd_response_data_set_content_type_string (cmd_response_data_t *data, gchar *content_type_string)
 Set a content type as string. More...
 
const gchar * cmd_response_data_get_content_type_string (cmd_response_data_t *data)
 Get a content type string if set. More...
 

Detailed Description

Headers for Response Data struct.

Definition in file gsad_cmd.h.

Typedef Documentation

◆ cmd_response_data_t

Definition at line 32 of file gsad_cmd.h.

Function Documentation

◆ cmd_response_data_free()

void cmd_response_data_free ( cmd_response_data_t *  data)

Frees the memory of a cmd_response_data_t struct.

If content_disposition of data is not NULL the content_disposition is also being freed.

Parameters
[in]dataThe cmd_response_data_t struct to free

Definition at line 81 of file gsad_cmd.c.

82 {
83  if (!data)
84  {
85  return;
86  }
87 
88  if (data->content_disposition)
89  {
90  g_free (data->content_disposition);
91  }
92 
93  if (data->content_type_string)
94  {
95  g_free (data->content_type_string);
96  }
97 
98  g_free (data);
99 }
gchar * content_type_string
Content type. Default is text/html
Definition: gsad_cmd.c:38
gchar * content_disposition
Content length of the response
Definition: gsad_cmd.c:40

References cmd_response_data::content_disposition, and cmd_response_data::content_type_string.

Referenced by handle_system_report(), and handler_send_response().

Here is the caller graph for this function:

◆ cmd_response_data_get_content_disposition()

const gchar* cmd_response_data_get_content_disposition ( cmd_response_data_t *  data)

Get content disposition of cmd_response_data_t struct.

Parameters
[in]dataCommand response data struct
Returns
Size of the response

Definition at line 226 of file gsad_cmd.c.

227 {
228  return data->content_disposition;
229 }
gchar * content_disposition
Content length of the response
Definition: gsad_cmd.c:40

References cmd_response_data::content_disposition.

Referenced by handler_send_response().

Here is the caller graph for this function:

◆ cmd_response_data_get_content_length()

gsize cmd_response_data_get_content_length ( cmd_response_data_t *  data)

Get response content length of cmd_response_data_t struct.

Parameters
[in]dataCommand response data struct
Returns
Content length of the response

Definition at line 200 of file gsad_cmd.c.

201 {
202  return data->content_length;
203 }
gsize content_length
Content type as string. Default is NULL.
Definition: gsad_cmd.c:39

References cmd_response_data::content_length.

Referenced by create_not_found_response(), and handler_create_response().

Here is the caller graph for this function:

◆ cmd_response_data_get_content_type()

content_type_t cmd_response_data_get_content_type ( cmd_response_data_t *  data)

Get content type of cmd_response_data_t struct.

Parameters
[in]dataCommand response data struct
Returns
The content type

Definition at line 148 of file gsad_cmd.c.

149 {
150  return data->content_type;
151 }
content_type_t content_type
HTTP status code.
Definition: gsad_cmd.c:37

References cmd_response_data::content_type.

Referenced by handler_send_response().

Here is the caller graph for this function:

◆ cmd_response_data_get_content_type_string()

const gchar* cmd_response_data_get_content_type_string ( cmd_response_data_t *  data)

Get a content type string if set.

Parameters
[in]dataCommand response data struct
Returns
Content type string if set

Definition at line 255 of file gsad_cmd.c.

256 {
257  return data->content_type_string;
258 }
gchar * content_type_string
Content type. Default is text/html
Definition: gsad_cmd.c:38

References cmd_response_data::content_type_string.

Referenced by handler_send_response().

Here is the caller graph for this function:

◆ cmd_response_data_get_status_code()

int cmd_response_data_get_status_code ( cmd_response_data_t *  data)

Get http status code of cmd_response_data_t struct.

Parameters
[in]dataCommand response data struct
Returns
HTTP status code

Definition at line 174 of file gsad_cmd.c.

175 {
176  return data->http_status_code;
177 }
int http_status_code
Whether the response may be cached.
Definition: gsad_cmd.c:36

References cmd_response_data::http_status_code.

Referenced by handler_send_response().

Here is the caller graph for this function:

◆ cmd_response_data_is_allow_caching()

gboolean cmd_response_data_is_allow_caching ( cmd_response_data_t *  data)

Get allow_caching flag of cmd_response_data_t struct.

Parameters
[in]dataCommand response data struct
Returns
The allow_caching flag

Definition at line 122 of file gsad_cmd.c.

123 {
124  return data->allow_caching;
125 }
gboolean allow_caching
Definition: gsad_cmd.c:35

References cmd_response_data::allow_caching.

Referenced by handler_send_response().

Here is the caller graph for this function:

◆ cmd_response_data_new()

cmd_response_data_t* cmd_response_data_new ( )

Allocates memory for a cmd_response_data_t sturct and initializes it.

Returns
Pointer to the newly allocated cmd_response_data_t struct

Definition at line 65 of file gsad_cmd.c.

66 {
67  cmd_response_data_t *data = g_malloc0 (sizeof (cmd_response_data_t));
69  return data;
70 }
Response information for commands.
Definition: gsad_cmd.c:33
static void cmd_response_data_init(cmd_response_data_t *data)
Initializes a cmd_response_data_t struct.
Definition: gsad_cmd.c:49

References cmd_response_data_init().

Referenced by handle_index(), handle_static_config(), handle_static_file(), handle_system_report(), handler_send_not_found(), and handler_send_reauthentication().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmd_response_data_set_allow_caching()

void cmd_response_data_set_allow_caching ( cmd_response_data_t *  data,
gboolean  allow_caching 
)

Set allow_caching flag of cmd_response_data_t struct.

Parameters
[in]dataCommand response data struct
[in]allow_cachingallow_caching flag to set

Definition at line 108 of file gsad_cmd.c.

110 {
111  data->allow_caching = (allow_caching != FALSE);
112 }
gboolean allow_caching
Definition: gsad_cmd.c:35

References cmd_response_data::allow_caching.

Referenced by handle_index(), handle_static_config(), and handle_static_file().

Here is the caller graph for this function:

◆ cmd_response_data_set_content_disposition()

void cmd_response_data_set_content_disposition ( cmd_response_data_t *  data,
gchar *  content_disposition 
)

Set content disposition of cmd_response_data_t struct.

Parameters
[in]dataCommand response data struct
[in]content_dispositionContent disposition

Definition at line 212 of file gsad_cmd.c.

214 {
215  data->content_disposition = content_disposition;
216 }
gchar * content_disposition
Content length of the response
Definition: gsad_cmd.c:40

References cmd_response_data::content_disposition.

Referenced by export_many(), export_preference_file_gmp(), export_resource(), and get_report().

Here is the caller graph for this function:

◆ cmd_response_data_set_content_length()

void cmd_response_data_set_content_length ( cmd_response_data_t *  data,
gsize  content_length 
)

Set response content length of cmd_response_data_t struct.

Parameters
[in]dataCommand response data struct
[in]content_lengthContent length of the response

Definition at line 186 of file gsad_cmd.c.

188 {
189  data->content_length = content_length;
190 }
gsize content_length
Content type as string. Default is NULL.
Definition: gsad_cmd.c:39

References cmd_response_data::content_length.

Referenced by create_not_found_response(), download_agent_gmp(), download_ca_pub(), download_credential_gmp(), download_key_pub(), download_ssl_cert(), export_many(), export_preference_file_gmp(), export_resource(), get_report(), get_system_report_gmp(), and gsad_message().

Here is the caller graph for this function:

◆ cmd_response_data_set_content_type()

void cmd_response_data_set_content_type ( cmd_response_data_t *  data,
content_type_t  content_type 
)

Set content type of cmd_response_data_t struct.

Parameters
[in]dataCommand response data struct
[in]content_typeContent Type to set

Definition at line 134 of file gsad_cmd.c.

136 {
137  data->content_type = content_type;
138 }
content_type_t content_type
HTTP status code.
Definition: gsad_cmd.c:37
content_type
Content types.

References cmd_response_data::content_type.

Referenced by create_not_found_response(), envelope_gmp(), export_many(), export_preference_file_gmp(), export_resource(), file_content_response(), get_system_report_gmp(), gsad_message(), and save_setting_gmp().

Here is the caller graph for this function:

◆ cmd_response_data_set_content_type_string()

void cmd_response_data_set_content_type_string ( cmd_response_data_t *  data,
gchar *  content_type_string 
)

Set a content type as string.

If content type is set as a string content_type is set to GSAD_CONTENT_TYPE_STRING.

Parameters
[in]dataCommand response data struct
[in]content_type_stringContent type as string

Definition at line 241 of file gsad_cmd.c.

243 {
245  data->content_type_string = content_type_string;
246 }
gchar * content_type_string
Content type. Default is text/html
Definition: gsad_cmd.c:38
content_type_t content_type
HTTP status code.
Definition: gsad_cmd.c:37
Special marker for using content type string.

References cmd_response_data::content_type, cmd_response_data::content_type_string, and GSAD_CONTENT_TYPE_STRING.

Referenced by get_report().

Here is the caller graph for this function:

◆ cmd_response_data_set_status_code()

void cmd_response_data_set_status_code ( cmd_response_data_t *  data,
int  http_status_code 
)

Set status code of cmd_response_data_t struct.

Parameters
[in]dataCommand response data struct
[in]http_status_codeHTTP status code

Definition at line 160 of file gsad_cmd.c.

162 {
163  data->http_status_code = http_status_code;
164 }
int http_status_code
Whether the response may be cached.
Definition: gsad_cmd.c:36

References cmd_response_data::http_status_code.

Referenced by auth_settings_gmp(), bulk_delete_gmp(), check_modify_config(), clone_gmp(), create_agent_gmp(), create_alert_gmp(), create_asset_gmp(), create_config_gmp(), create_container_task_gmp(), create_credential_gmp(), create_filter_gmp(), create_group_gmp(), create_host_gmp(), create_not_found_response(), create_note_gmp(), create_override_gmp(), create_permission_gmp(), create_permissions_gmp(), create_port_list_gmp(), create_port_range_gmp(), create_report_gmp(), create_role_gmp(), create_scanner_gmp(), create_schedule_gmp(), create_tag_gmp(), create_target_gmp(), create_task_gmp(), create_ticket_gmp(), create_user_gmp(), delete_asset_gmp(), delete_resource(), download_agent_gmp(), download_ca_pub(), download_credential_gmp(), download_key_pub(), download_ssl_cert(), edit_alert(), edit_resource(), edit_role(), empty_trashcan_gmp(), export_many(), export_preference_file_gmp(), export_resource(), file_content_response(), get_aggregate_gmp(), get_alert(), get_alerts(), get_asset(), get_assets(), get_config(), get_config_family(), get_config_nvt(), get_feeds_gmp(), get_info(), get_many(), get_one(), get_report(), get_setting_gmp(), get_settings_gmp(), get_system_reports_gmp(), get_user(), get_users(), handle_static_config(), handler_send_reauthentication(), import_config_gmp(), import_port_list_gmp(), import_report_format_gmp(), manager_connect(), message_invalid(), move_task_gmp(), new_alert(), report_alert_gmp(), resource_action(), restore_gmp(), run_wizard_gmp(), save_agent_gmp(), save_alert_gmp(), save_asset_gmp(), save_auth_gmp(), save_config_family_gmp(), save_config_gmp(), save_config_nvt_gmp(), save_container_task_gmp(), save_credential_gmp(), save_filter_gmp(), save_group_gmp(), save_my_settings_gmp(), save_note_gmp(), save_osp_prefs(), save_override_gmp(), save_permission_gmp(), save_port_list_gmp(), save_report_format_gmp(), save_role_gmp(), save_scanner_gmp(), save_schedule_gmp(), save_setting_gmp(), save_tag_gmp(), save_target_gmp(), save_task_gmp(), save_ticket_gmp(), save_user_gmp(), set_http_status_from_entity(), simple_gmpf(), sync_config_gmp(), sync_feed(), test_alert_gmp(), toggle_tag_gmp(), verify_agent_gmp(), verify_report_format_gmp(), verify_scanner_gmp(), wizard(), and wizard_get().