OpenVAS Scanner 21.4.1
plugutils.h
Go to the documentation of this file.
1/* Portions Copyright (C) 2009-2021 Greenbone Networks GmbH
2 * Based on work Copyright (C) 1998 - 2007 Tenable Network Security, Inc.
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
26#ifndef OPENVAS_PLUGUTILS_H
27#define OPENVAS_PLUGUTILS_H
28
29#include "scanneraux.h" /* for struct script_infos */
30
31#include <gvm/base/nvti.h> /* for nvti_t */
32
33#define ARG_STRING 1
34#define ARG_INT 2
35
36void
37scanner_add_port (struct script_infos *, int, char *);
38
39/*
40 * Arglist management at plugin-level
41 */
42
43void
44plug_set_dep (struct script_infos *, const char *);
45
46void
47plug_set_ssl_cert (struct script_infos *, char *);
48
49void
50plug_set_ssl_key (struct script_infos *, char *);
51
52void
54
55void
56plug_set_ssl_CA_file (struct script_infos *, char *);
57
58const char *
60
61char *
63
64int
65plug_add_host_fqdn (struct script_infos *, const char *, const char *);
66
67GSList *
69
70char *
71plug_get_host_source (struct script_infos *, const char *);
72
73unsigned int
75
76void
77plug_set_port_transport (struct script_infos *, int, int);
78
79int
81
82struct script_infos *
84
85/*
86 * Reporting functions
87 */
88
89void
90proto_post_alarm (const char *, struct script_infos *, int, const char *,
91 const char *, const char *);
92
93void
94post_alarm (const char *, struct script_infos *, int, const char *,
95 const char *);
96
97void
98post_alarm_udp (struct script_infos *, int, const char *, const char *);
99
100#define post_alarm_tcp post_alarm
101
102void
103proto_post_error (const char *, struct script_infos *, int, const char *,
104 const char *, const char *);
105void
106post_error (const char *, struct script_infos *, int, const char *,
107 const char *);
108
109#define post_error_tcp post_error
110
111void
112proto_post_log (const char *, struct script_infos *, int, const char *,
113 const char *, const char *);
114
115void
116post_log (const char *, struct script_infos *, int, const char *);
117
118void
119post_log_with_uri (const char *, struct script_infos *, int, const char *,
120 const char *);
121
122#define post_log_tcp post_log
123
124/*
125 * Management of the portlists
126 */
127
128int
129host_get_port_state (struct script_infos *, int);
130
131int
133
134/*
135 * Inter Plugins Communication functions
136 */
137
138void
139plug_set_key (struct script_infos *, char *, int, const void *);
140
141void
142plug_set_key_len (struct script_infos *, char *, int, const void *, size_t);
143
144void
145plug_replace_key (struct script_infos *, char *, int, void *);
146
147void
148plug_replace_key_len (struct script_infos *, char *, int, void *, size_t);
149
150kb_t
151plug_get_kb (struct script_infos *);
152
153kb_t
155
156void *
157plug_get_key (struct script_infos *, char *, int *, size_t *, int);
158
159struct in6_addr *
161
162char *
164
165char *
166get_plugin_preference (const char *, const char *, int);
167
168const char *
169get_plugin_preference_fname (struct script_infos *, const char *);
170
171char *
172get_plugin_preference_file_content (struct script_infos *, const char *);
173
174long
175get_plugin_preference_file_size (struct script_infos *, const char *);
176
177#endif
void plug_set_ssl_cert(struct script_infos *, char *)
Definition: plugutils.c:980
void plug_set_port_transport(struct script_infos *, int, int)
Definition: plugutils.c:943
void proto_post_alarm(const char *, struct script_infos *, int, const char *, const char *, const char *)
Definition: plugutils.c:392
kb_t plug_get_kb(struct script_infos *)
Definition: plugutils.c:723
void post_log_with_uri(const char *, struct script_infos *, int, const char *, const char *)
Post a log message about a tcp port with a uri.
Definition: plugutils.c:429
void plug_set_key(struct script_infos *, char *, int, const void *)
Definition: plugutils.c:681
void plug_set_ssl_CA_file(struct script_infos *, char *)
Definition: plugutils.c:1002
char * get_plugin_preference(const char *, const char *, int)
Get the a plugins preference.
Definition: plugutils.c:462
char * plug_get_host_ip_str(struct script_infos *)
Definition: plugutils.c:332
unsigned int plug_get_host_open_port(struct script_infos *desc)
Definition: plugutils.c:888
void plug_set_ssl_key(struct script_infos *, char *)
Definition: plugutils.c:986
void proto_post_error(const char *, struct script_infos *, int, const char *, const char *, const char *)
Definition: plugutils.c:436
void plug_set_key_len(struct script_infos *, char *, int, const void *, size_t)
Definition: plugutils.c:658
char * plug_get_host_source(struct script_infos *, const char *)
Definition: plugutils.c:298
const char * plug_current_vhost(void)
Definition: plugutils.c:57
char * get_plugin_preference_file_content(struct script_infos *, const char *)
Get the file contents of a plugins preference that is of type "file".
Definition: plugutils.c:605
void post_error(const char *, struct script_infos *, int, const char *, const char *)
Definition: plugutils.c:443
void post_alarm_udp(struct script_infos *, int, const char *, const char *)
GSList * plug_get_host_fqdn_list(struct script_infos *)
Definition: plugutils.c:280
int plug_add_host_fqdn(struct script_infos *, const char *, const char *)
Definition: plugutils.c:218
long get_plugin_preference_file_size(struct script_infos *, const char *)
Get the file size of a plugins preference that is of type "file".
Definition: plugutils.c:636
void post_alarm(const char *, struct script_infos *, int, const char *, const char *)
Definition: plugutils.c:399
struct in6_addr * plug_get_host_ip(struct script_infos *)
Definition: plugutils.c:326
void plug_set_dep(struct script_infos *, const char *)
Definition: plugutils.c:65
char * plug_get_host_fqdn(struct script_infos *)
Definition: plugutils.c:252
void plug_replace_key(struct script_infos *, char *, int, void *)
Definition: plugutils.c:711
int host_get_port_state(struct script_infos *, int)
Definition: plugutils.c:154
void plug_replace_key_len(struct script_infos *, char *, int, void *, size_t)
Definition: plugutils.c:688
void post_log(const char *, struct script_infos *, int, const char *)
Post a log message about a tcp port.
Definition: plugutils.c:419
const char * get_plugin_preference_fname(struct script_infos *, const char *)
Get the file name of a plugins preference that is of type "file".
Definition: plugutils.c:550
void scanner_add_port(struct script_infos *, int, char *)
Definition: plugutils.c:717
kb_t plug_get_results_kb(struct script_infos *)
Definition: plugutils.c:729
void plug_set_ssl_pem_password(struct script_infos *, char *)
Definition: plugutils.c:992
void * plug_get_key(struct script_infos *, char *, int *, size_t *, int)
Get values from a kb under the given key name.
Definition: plugutils.c:801
int host_get_port_state_udp(struct script_infos *, int)
Definition: plugutils.c:160
struct script_infos * plug_create_from_nvti_and_prefs(const nvti_t *)
void proto_post_log(const char *, struct script_infos *, int, const char *, const char *, const char *)
Post a log message.
Definition: plugutils.c:409
int plug_get_port_transport(struct script_infos *, int)
Definition: plugutils.c:956
Auxiliary structures for scanner.
Definition: scanneraux.h:42