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 
36 void
37 scanner_add_port (struct script_infos *, int, char *);
38 
39 /*
40  * Arglist management at plugin-level
41  */
42 
43 void
44 plug_set_dep (struct script_infos *, const char *);
45 
46 void
47 plug_set_ssl_cert (struct script_infos *, char *);
48 
49 void
50 plug_set_ssl_key (struct script_infos *, char *);
51 
52 void
53 plug_set_ssl_pem_password (struct script_infos *, char *);
54 
55 void
56 plug_set_ssl_CA_file (struct script_infos *, char *);
57 
58 const char *
59 plug_current_vhost (void);
60 
61 char *
63 
64 int
65 plug_add_host_fqdn (struct script_infos *, const char *, const char *);
66 
67 GSList *
69 
70 char *
71 plug_get_host_source (struct script_infos *, const char *);
72 
73 unsigned int
75 
76 void
77 plug_set_port_transport (struct script_infos *, int, int);
78 
79 int
81 
82 struct script_infos *
84 
85 /*
86  * Reporting functions
87  */
88 
89 void
90 proto_post_alarm (const char *, struct script_infos *, int, const char *,
91  const char *, const char *);
92 
93 void
94 post_alarm (const char *, struct script_infos *, int, const char *,
95  const char *);
96 
97 void
98 post_alarm_udp (struct script_infos *, int, const char *, const char *);
99 
100 #define post_alarm_tcp post_alarm
101 
102 void
103 proto_post_error (const char *, struct script_infos *, int, const char *,
104  const char *, const char *);
105 void
106 post_error (const char *, struct script_infos *, int, const char *,
107  const char *);
108 
109 #define post_error_tcp post_error
110 
111 void
112 proto_post_log (const char *, struct script_infos *, int, const char *,
113  const char *, const char *);
114 
115 void
116 post_log (const char *, struct script_infos *, int, const char *);
117 
118 void
119 post_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 
128 int
129 host_get_port_state (struct script_infos *, int);
130 
131 int
132 host_get_port_state_udp (struct script_infos *, int);
133 
134 /*
135  * Inter Plugins Communication functions
136  */
137 
138 void
139 plug_set_key (struct script_infos *, char *, int, const void *);
140 
141 void
142 plug_set_key_len (struct script_infos *, char *, int, const void *, size_t);
143 
144 void
145 plug_replace_key (struct script_infos *, char *, int, void *);
146 
147 void
148 plug_replace_key_len (struct script_infos *, char *, int, void *, size_t);
149 
150 kb_t
151 plug_get_kb (struct script_infos *);
152 
153 kb_t
155 
156 void *
157 plug_get_key (struct script_infos *, char *, int *, size_t *, int);
158 
159 struct in6_addr *
160 plug_get_host_ip (struct script_infos *);
161 
162 char *
164 
165 char *
166 get_plugin_preference (const char *, const char *, int);
167 
168 const char *
169 get_plugin_preference_fname (struct script_infos *, const char *);
170 
171 char *
172 get_plugin_preference_file_content (struct script_infos *, const char *);
173 
174 long
175 get_plugin_preference_file_size (struct script_infos *, const char *);
176 
177 #endif
char * plug_get_host_fqdn(struct script_infos *)
Definition: plugutils.c:252
struct in6_addr * plug_get_host_ip(struct script_infos *)
Definition: plugutils.c:326
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
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
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 plug_set_ssl_CA_file(struct script_infos *, char *)
Definition: plugutils.c:1002
unsigned int plug_get_host_open_port(struct script_infos *desc)
Definition: plugutils.c:888
char * plug_get_host_source(struct script_infos *, const char *)
Definition: plugutils.c:298
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
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 *)
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
void plug_set_dep(struct script_infos *, const char *)
Definition: plugutils.c:65
void plug_replace_key(struct script_infos *, char *, int, void *)
Definition: plugutils.c:711
GSList * plug_get_host_fqdn_list(struct script_infos *)
Definition: plugutils.c:280
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(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
char * get_plugin_preference(const char *, const char *, int)
Get the a plugins preference.
Definition: plugutils.c:462
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
char * plug_get_host_ip_str(struct script_infos *)
Definition: plugutils.c:332
void plug_set_ssl_pem_password(struct script_infos *, char *)
Definition: plugutils.c:992
int host_get_port_state_udp(struct script_infos *, int)
Definition: plugutils.c:160
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
struct script_infos * plug_create_from_nvti_and_prefs(const nvti_t *)
Auxiliary structures for scanner.
Definition: scanneraux.h:42