OpenVAS Scanner  7.0.1~git
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_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 *
83 plug_create_from_nvti_and_prefs (const nvti_t *);
84 
85 /*
86  * Reporting functions
87  */
88 
89 void
90 proto_post_alarm (const char *, struct script_infos *, int, const char *,
91  const char *);
92 
93 void
94 post_alarm (const char *, struct script_infos *, int, const char *);
95 
96 void
97 post_alarm_udp (struct script_infos *, int, const char *);
98 
99 #define post_alarm_tcp post_alarm
100 
101 void
102 proto_post_error (const char *, struct script_infos *, int, const char *,
103  const char *);
104 void
105 post_error (const char *, struct script_infos *, int, const char *);
106 
107 #define post_error_tcp post_error
108 
109 void
110 proto_post_log (const char *, struct script_infos *, int, const char *,
111  const char *);
112 void
113 post_log (const char *, struct script_infos *, int, const char *);
114 
115 #define post_log_tcp post_log
116 
117 /*
118  * Management of the portlists
119  */
120 
121 int
122 host_get_port_state (struct script_infos *, int);
123 
124 int
125 host_get_port_state_udp (struct script_infos *, int);
126 
127 /*
128  * Inter Plugins Communication functions
129  */
130 
131 void
132 plug_set_key (struct script_infos *, char *, int, const void *);
133 
134 void
135 plug_set_key_len (struct script_infos *, char *, int, const void *, size_t);
136 
137 void
138 plug_replace_key (struct script_infos *, char *, int, void *);
139 
140 void
141 plug_replace_key_len (struct script_infos *, char *, int, void *, size_t);
142 
143 kb_t
144 plug_get_kb (struct script_infos *);
145 
146 void *
147 plug_get_key (struct script_infos *, char *, int *, size_t *, int);
148 
149 struct in6_addr *
150 plug_get_host_ip (struct script_infos *);
151 
152 char *
154 
155 char *
156 get_plugin_preference (const char *, const char *, int);
157 
158 const char *
159 get_plugin_preference_fname (struct script_infos *, const char *);
160 
161 char *
162 get_plugin_preference_file_content (struct script_infos *, const char *);
163 
164 long
165 get_plugin_preference_file_size (struct script_infos *, const char *);
166 
167 #endif
unsigned int plug_get_host_open_port(struct script_infos *desc)
Definition: plugutils.c:817
void plug_set_ssl_key(struct script_infos *, char *)
Definition: plugutils.c:915
void post_error(const char *, struct script_infos *, int, const char *)
Definition: plugutils.c:389
int plug_add_host_fqdn(struct script_infos *, const char *, const char *)
Definition: plugutils.c:166
void proto_post_error(const char *, struct script_infos *, int, const char *, const char *)
Definition: plugutils.c:382
char * plug_get_host_fqdn(struct script_infos *)
Definition: plugutils.c:211
void plug_set_ssl_CA_file(struct script_infos *, char *)
Definition: plugutils.c:931
void plug_replace_key_len(struct script_infos *, char *, int, void *, size_t)
Definition: plugutils.c:623
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:375
struct in6_addr * plug_get_host_ip(struct script_infos *)
Definition: plugutils.c:285
const char * plug_current_vhost(void)
Definition: plugutils.c:57
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:486
void plug_set_key(struct script_infos *, char *, int, const void *)
Definition: plugutils.c:616
kb_t plug_get_kb(struct script_infos *)
Definition: plugutils.c:658
char * plug_get_host_source(struct script_infos *, const char *)
Definition: plugutils.c:257
struct script_infos * plug_create_from_nvti_and_prefs(const nvti_t *)
char * plug_get_host_ip_str(struct script_infos *)
Definition: plugutils.c:291
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:646
void plug_set_port_transport(struct script_infos *, int, int)
Definition: plugutils.c:872
char * get_plugin_preference(const char *, const char *, int)
Get the a plugins preference.
Definition: plugutils.c:408
void plug_set_ssl_cert(struct script_infos *, char *)
Definition: plugutils.c:909
void plug_set_ssl_pem_password(struct script_infos *, char *)
Definition: plugutils.c:921
void proto_post_log(const char *, struct script_infos *, int, const char *, const char *)
Post a log message.
Definition: plugutils.c:365
void plug_set_key_len(struct script_infos *, char *, int, const void *, size_t)
Definition: plugutils.c:594
int host_get_port_state(struct script_infos *, int)
Definition: plugutils.c:154
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:730
Auxiliary structures for scanner.
GSList * plug_get_host_fqdn_list(struct script_infos *)
Definition: plugutils.c:239
void proto_post_alarm(const char *, struct script_infos *, int, const char *, const char *)
Definition: plugutils.c:348
void post_alarm(const char *, struct script_infos *, int, const char *)
Definition: plugutils.c:355
void scanner_add_port(struct script_infos *, int, char *)
Definition: plugutils.c:652
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:572
int plug_get_port_transport(struct script_infos *, int)
Definition: plugutils.c:885
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:541
int host_get_port_state_udp(struct script_infos *, int)
Definition: plugutils.c:160