|
OpenVAS Scanner 23.40.3
|
This file contains all the misc. functions found in NASL. More...
#include "nasl_misc_funcs.h"#include "../misc/ftp_funcs.h"#include "../misc/heartbeat.h"#include "../misc/network.h"#include "../misc/plugutils.h"#include "../misc/vendorversion.h"#include "byteorder.h"#include "exec.h"#include "nasl_debug.h"#include "nasl_func.h"#include "nasl_global_ctxt.h"#include "nasl_lex_ctxt.h"#include "nasl_packet_forgery.h"#include "nasl_tree.h"#include "nasl_var.h"#include <errno.h>#include <glib.h>#include <gvm/util/compressutils.h>#include <gvm/util/kb.h>#include <stdbool.h>#include <stdlib.h>#include <string.h>#include <sys/time.h>#include <unistd.h>
Go to the source code of this file.
Macros | |
| #define | uint32 unsigned int |
| #define | NASL_EXIT_DEPRECATED 66 |
| #define | NASL_EXIT_NOTVULN 99 |
| #define | iac buffer[0] |
| #define | code buffer[1] |
| #define | option buffer[2] |
Variables | |
| static lex_ctxt * | mylexic = NULL |
This file contains all the misc. functions found in NASL.
Definition in file nasl_misc_funcs.c.
| #define code buffer[1] |
| #define iac buffer[0] |
Referenced by nasl_telnet_init().
| #define NASL_EXIT_DEPRECATED 66 |
Definition at line 41 of file nasl_misc_funcs.c.
| #define NASL_EXIT_NOTVULN 99 |
Definition at line 42 of file nasl_misc_funcs.c.
Referenced by nasl_do_exit().
| #define option buffer[2] |
Referenced by nasl_send(), nasl_telnet_init(), and set_default_openvas_prefs().
| #define uint32 unsigned int |
Definition at line 39 of file nasl_misc_funcs.c.
Definition at line 876 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_DATA, get_int_var_by_name(), nasl_perror(), SIVAL, TC::size, TC::str_val, and TC::x.

Definition at line 573 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_INT, get_func_ref_by_name(), get_str_var_by_num(), TC::i_val, nasl_perror(), and TC::x.

Definition at line 313 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_INT, get_int_var_by_num(), TC::i_val, NASL_EXIT_NOTVULN, ref_cell(), struct_lex_ctxt::ret_val, simple_register_host_detail(), struct_lex_ctxt::up_ctxt, and TC::x.

Definition at line 292 of file nasl_misc_funcs.c.
References dump_ctxt(), FAKE_CELL, and struct_lex_ctxt::up_ctxt.

Definition at line 231 of file nasl_misc_funcs.c.
References script_infos::alive, alloc_typed_cell(), check_host_still_alive(), close_stream_connection(), CONST_INT, script_infos::denial_port, TC::i_val, nasl_tcp_ping(), nsend(), open_stream_connection(), OPENVAS_ENCAPS_IP, plug_current_vhost(), plug_get_kb(), struct_lex_ctxt::recv_timeout, struct_lex_ctxt::script_infos, vendor_version_get(), and TC::x.

Definition at line 103 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_INT, ftp_get_pasv_address(), and get_int_var_by_name().

Definition at line 75 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_INT, ftp_log_in(), get_int_var_by_name(), get_str_var_by_name(), TC::i_val, and TC::x.

This function returns 1 on little-endian systems, 0 otherwise
Definition at line 899 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_INT, TC::i_val, val, and TC::x.

Definition at line 649 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_DATA, nasl_perror(), TC::size, TC::str_val, timeval(), and TC::x.

Definition at line 816 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_DATA, get_str_var_by_name(), get_var_size_by_name(), TC::size, TC::str_val, and TC::x.

Definition at line 841 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_DATA, get_str_var_by_name(), get_var_size_by_name(), TC::size, TC::str_val, and TC::x.

Definition at line 337 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_INT, get_var_type_by_num(), TC::i_val, VAR2_UNDEF, and TC::x.

Definition at line 466 of file nasl_misc_funcs.c.
References add_var_to_list(), alloc_typed_cell(), struct_lex_ctxt::ctx_vars, DYN_ARRAY, st_nasl_array::hash_elt, st_nasl_array::max_idx, nasl_get_var_by_num(), nasl_perror(), st_n_nasl_var::next_var, st_nasl_array::num_elt, TC::ref_val, st_nasl_string::s_siz, st_nasl_string::s_val, st_n_nasl_var::u, st_a_nasl_var::v, st_a_nasl_var::v_arr, st_a_nasl_var::v_int, st_a_nasl_var::v_str, VAR2_ARRAY, VAR2_INT, VAR2_STRING, VAR2_UNDEF, st_n_nasl_var::var_name, VAR_NAME_HASH, st_a_nasl_var::var_type, and TC::x.

Definition at line 669 of file nasl_misc_funcs.c.
References add_var_to_array(), alloc_typed_cell(), DYN_ARRAY, get_int_var_by_name(), get_int_var_by_num(), nasl_perror(), TC::ref_val, st_a_nasl_var::v, st_a_nasl_var::v_int, VAR2_INT, st_a_nasl_var::var_type, and TC::x.

Definition at line 418 of file nasl_misc_funcs.c.
References add_var_to_array(), add_var_to_list(), alloc_typed_cell(), struct_lex_ctxt::ctx_vars, DYN_ARRAY, nasl_get_var_by_num(), nasl_perror(), TC::ref_val, st_a_nasl_var::v, st_a_nasl_var::v_int, VAR2_DATA, VAR2_INT, VAR2_STRING, VAR2_UNDEF, var2str(), st_a_nasl_var::var_type, and TC::x.

This function takes any kind & any number of arguments and makes an array from them. If an argument is an array, its index are lost
Definition at line 354 of file nasl_misc_funcs.c.
References add_var_to_list(), alloc_typed_cell(), struct_lex_ctxt::ctx_vars, DYN_ARRAY, st_nasl_array::hash_elt, st_nasl_array::max_idx, nasl_get_var_by_num(), nasl_perror(), st_n_nasl_var::next_var, st_nasl_array::num_elt, TC::ref_val, st_n_nasl_var::u, st_a_nasl_var::v, st_a_nasl_var::v_arr, VAR2_ARRAY, VAR2_DATA, VAR2_INT, VAR2_STRING, VAR2_UNDEF, VAR_NAME_HASH, st_a_nasl_var::var_type, and TC::x.
Referenced by nasl_sort_array().


Definition at line 513 of file nasl_misc_funcs.c.
References alloc_typed_cell(), array_max_index(), CONST_INT, struct_lex_ctxt::ctx_vars, TC::i_val, nasl_get_var_by_num(), st_a_nasl_var::v, st_a_nasl_var::v_arr, VAR2_ARRAY, st_a_nasl_var::var_type, and TC::x.

Definition at line 735 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_INT, get_int_var_by_name(), and nasl_perror().

Definition at line 770 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_INT, hostname, TC::i_val, open_sock_opt_hn(), plug_get_key(), struct_lex_ctxt::script_infos, and TC::x.

Definition at line 46 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_INT, TC::i_val, and TC::x.

Definition at line 65 of file nasl_misc_funcs.c.
References FAKE_CELL, and get_int_var_by_num().

Definition at line 613 of file nasl_misc_funcs.c.
References st_nasl_array::max_idx, mylexic, nasl_make_list(), nasl_perror(), st_nasl_array::num_elt, TC::ref_val, var_cmp(), and TC::x.

Definition at line 199 of file nasl_misc_funcs.c.
References script_infos::alive, close_stream_connection(), script_infos::denial_port, deref_cell(), FAKE_CELL, TC::i_val, nasl_tcp_ping(), open_stream_connection(), OPENVAS_ENCAPS_IP, plug_get_host_open_port(), struct_lex_ctxt::recv_timeout, struct_lex_ctxt::script_infos, and TC::x.

Definition at line 124 of file nasl_misc_funcs.c.
References alloc_typed_cell(), code, CONST_DATA, get_int_var_by_num(), iac, nasl_perror(), option, read_stream_connection(), read_stream_connection_min(), TC::size, TC::str_val, write_stream_connection(), and TC::x.

Definition at line 534 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_DATA, struct_lex_ctxt::ctx_vars, nasl_get_var_by_num(), TC::size, TC::str_val, VAR2_ARRAY, VAR2_DATA, VAR2_INT, VAR2_STRING, VAR2_UNDEF, st_a_nasl_var::var_type, and TC::x.

Definition at line 638 of file nasl_misc_funcs.c.
References alloc_typed_cell(), CONST_INT, TC::i_val, and TC::x.

Definition at line 57 of file nasl_misc_funcs.c.
References FAKE_CELL, and get_int_var_by_num().

|
static |
Definition at line 299 of file nasl_misc_funcs.c.
References ARG_STRING, name, oid, struct_lex_ctxt::oid, plug_set_key(), and struct_lex_ctxt::script_infos.
Referenced by nasl_do_exit().


|
static |
Definition at line 597 of file nasl_misc_funcs.c.
References cell_cmp(), deref_cell(), mylexic, and var2cell().
Referenced by nasl_sort_array().


|
static |
Definition at line 594 of file nasl_misc_funcs.c.
Referenced by nasl_sort_array(), and var_cmp().