OpenVAS Scanner  6.0.1
plugutils.h
Go to the documentation of this file.
1 /* Portions Copyright (C) 2009-2019 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_xref (struct script_infos *, char *, char *);
48 
49 void
50 plug_set_tag (struct script_infos *, char *, char *);
51 
52 void
53 plug_set_ssl_cert (struct script_infos *, char *);
54 
55 void
56 plug_set_ssl_key (struct script_infos *, char *);
57 
58 void
59 plug_set_ssl_pem_password (struct script_infos *, char *);
60 
61 void
62 plug_set_ssl_CA_file (struct script_infos *, char *);
63 
64 const char *
65 plug_current_vhost (void);
66 
67 char *
69 
70 int
71 plug_add_host_fqdn (struct script_infos *, const char *, const char *);
72 
73 GSList *
75 
76 char *
77 plug_get_host_source (struct script_infos *, const char *);
78 
79 unsigned int
81 
82 void
83 plug_set_port_transport (struct script_infos *, int, int);
84 
85 int
87 
88 struct script_infos *
89 plug_create_from_nvti_and_prefs (const nvti_t *);
90 
91 /*
92  * Reporting functions
93  */
94 
95 void
96 proto_post_alarm (const char *, struct script_infos *, int, const char *,
97  const char *);
98 
99 void
100 post_alarm (const char *, struct script_infos *, int, const char *);
101 
102 void
103 post_alarm_udp (struct script_infos *, int, const char *);
104 
105 #define post_alarm_tcp post_alarm
106 
107 void
108 proto_post_error (const char *, struct script_infos *, int, const char *,
109  const char *);
110 void
111 post_error (const char *, struct script_infos *, int, const char *);
112 
113 #define post_error_tcp post_error
114 
115 void
116 proto_post_log (const char *, struct script_infos *, int, const char *,
117  const char *);
118 void
119 post_log (const char *, struct script_infos *, int, const char *);
120 
121 #define post_log_tcp post_log
122 
123 /*
124  * Management of the portlists
125  */
126 
127 int
128 host_get_port_state (struct script_infos *, int);
129 
130 int
131 host_get_port_state_udp (struct script_infos *, int);
132 
133 /*
134  * Inter Plugins Communication functions
135  */
136 
137 void
138 plug_set_key (struct script_infos *, char *, int, const void *);
139 
140 void
141 plug_set_key_len (struct script_infos *, char *, int, const void *, size_t);
142 
143 void
144 plug_replace_key (struct script_infos *, char *, int, void *);
145 
146 void
147 plug_replace_key_len (struct script_infos *, char *, int, void *, size_t);
148 
149 kb_t
150 plug_get_kb (struct script_infos *);
151 
152 void *
153 plug_get_key (struct script_infos *, char *, int *, size_t *, int);
154 
155 struct in6_addr *
156 plug_get_host_ip (struct script_infos *);
157 
158 char *
160 
161 void
162 add_plugin_preference (struct script_infos *, const char *, const char *,
163  const char *);
164 char *
165 get_plugin_preference (const char *, const char *);
166 
167 const char *
168 get_plugin_preference_fname (struct script_infos *, const char *);
169 
170 char *
171 get_plugin_preference_file_content (struct script_infos *, const char *);
172 
173 long
174 get_plugin_preference_file_size (struct script_infos *, const char *);
175 
176 #endif
void add_plugin_preference(struct script_infos *, const char *, const char *, const char *)
Definition: plugutils.c:525
unsigned int plug_get_host_open_port(struct script_infos *desc)
Definition: plugutils.c:929
void plug_set_ssl_key(struct script_infos *, char *)
Definition: plugutils.c:1027
void post_error(const char *, struct script_infos *, int, const char *)
Definition: plugutils.c:518
int plug_add_host_fqdn(struct script_infos *, const char *, const char *)
Definition: plugutils.c:206
void proto_post_error(const char *, struct script_infos *, int, const char *, const char *)
Definition: plugutils.c:511
char * plug_get_host_fqdn(struct script_infos *)
Definition: plugutils.c:251
void plug_set_tag(struct script_infos *, char *, char *)
Definition: plugutils.c:90
void plug_set_ssl_CA_file(struct script_infos *, char *)
Definition: plugutils.c:1043
void plug_replace_key_len(struct script_infos *, char *, int, void *, size_t)
Definition: plugutils.c:747
void post_alarm_udp(struct script_infos *, int, const char *)
void post_log(const char *, struct script_infos *, int, const char *)
Post a log message about a tcp port.
Definition: plugutils.c:504
char * get_plugin_preference(const char *, const char *)
Definition: plugutils.c:536
struct in6_addr * plug_get_host_ip(struct script_infos *)
Definition: plugutils.c:325
const char * plug_current_vhost(void)
Definition: plugutils.c:67
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:610
void plug_set_key(struct script_infos *, char *, int, const void *)
Definition: plugutils.c:740
kb_t plug_get_kb(struct script_infos *)
Definition: plugutils.c:782
char * plug_get_host_source(struct script_infos *, const char *)
Definition: plugutils.c:297
struct script_infos * plug_create_from_nvti_and_prefs(const nvti_t *)
char * plug_get_host_ip_str(struct script_infos *)
Definition: plugutils.c:331
void plug_set_dep(struct script_infos *, const char *)
Definition: plugutils.c:105
void plug_replace_key(struct script_infos *, char *, int, void *)
Definition: plugutils.c:770
void plug_set_xref(struct script_infos *, char *, char *)
Definition: plugutils.c:75
void plug_set_port_transport(struct script_infos *, int, int)
Definition: plugutils.c:984
void plug_set_ssl_cert(struct script_infos *, char *)
Definition: plugutils.c:1021
void plug_set_ssl_pem_password(struct script_infos *, char *)
Definition: plugutils.c:1033
void proto_post_log(const char *, struct script_infos *, int, const char *, const char *)
Post a log message.
Definition: plugutils.c:494
void plug_set_key_len(struct script_infos *, char *, int, const void *, size_t)
Definition: plugutils.c:718
int host_get_port_state(struct script_infos *, int)
Definition: plugutils.c:194
void * plug_get_key(struct script_infos *, char *, int *, size_t *, int)
Definition: plugutils.c:842
Auxiliary structures for scanner.
GSList * plug_get_host_fqdn_list(struct script_infos *)
Definition: plugutils.c:279
void proto_post_alarm(const char *, struct script_infos *, int, const char *, const char *)
Definition: plugutils.c:477
void post_alarm(const char *, struct script_infos *, int, const char *)
Definition: plugutils.c:484
void scanner_add_port(struct script_infos *, int, char *)
Definition: plugutils.c:776
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:696
Definition: scanneraux.h:44
int plug_get_port_transport(struct script_infos *, int)
Definition: plugutils.c:997
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:665
int host_get_port_state_udp(struct script_infos *, int)
Definition: plugutils.c:200