utils.c headerfile.
More...
#include "../misc/scanneraux.h"
#include <sys/types.h>
Go to the source code of this file.
◆ check_host_still_alive()
| int check_host_still_alive |
( |
kb_t | kb, |
|
|
const char * | hostname ) |
Check if the hosts is still alive and set it as dead if not.
- Parameters
-
| kb | Host kb where the host is set as dead. |
- Returns
- 1 if considered alive, 0 if it is dead. -1 on error or option disabled.
◆ data_left()
◆ get_max_checks_number()
| int get_max_checks_number |
( |
void | | ) |
|
Get the max number of plugins to launch against the remote host at the same time
◆ get_max_hosts_number()
| int get_max_hosts_number |
( |
void | | ) |
|
Get the max number of hosts to test at the same time.
◆ is_scanner_only_pref()
| int is_scanner_only_pref |
( |
const char * | pref | ) |
|
◆ process_alive()
| int process_alive |
( |
pid_t | pid | ) |
|
Determines if a process is alive - as reliably as we can
◆ store_file()
| int store_file |
( |
struct scan_globals * | globals, |
|
|
const char * | file, |
|
|
const char * | file_hash ) |
Stores a file type preference in a hash table.
- Parameters
-
| globals | Global struct. |
| file | File content. |
| file_hash | hash to reference the file. |
- Returns
- 0 if successful, -1 in case of errors.
◆ wait_for_children1()
| void wait_for_children1 |
( |
void | | ) |
|
◆ write_host_stats()
| void write_host_stats |
( |
kb_t | kb, |
|
|
const char * | scan_id, |
|
|
const char * | ip ) |
Reads the script stats from the kb and generate a string in json format to be stored in the disk.
- Parameters
-
| kb | the host knowledge base to get the information from. |
| scan_id | Scan ID for the file name. |
| ip | target IP address. |
◆ write_script_stats()
| void write_script_stats |
( |
const char * | buf, |
|
|
const char * | path, |
|
|
int | mode ) |
Writes scripts stats into a file.
- Parameters
-
| buf | String to write. |
| path | Path to the file to write into. |
| mode | 2 to create the file, 0 to append text to the file, 1 to finish the json list removing the trailing comma before appending the last text in the buffer. |