OpenVAS Scanner  7.0.0~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 *);
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
post_error
void post_error(const char *, struct script_infos *, int, const char *)
Definition: plugutils.c:389
get_plugin_preference_file_size
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:541
host_get_port_state_udp
int host_get_port_state_udp(struct script_infos *, int)
Definition: plugutils.c:160
script_infos
Definition: scanneraux.h:43
plug_set_ssl_CA_file
void plug_set_ssl_CA_file(struct script_infos *, char *)
Definition: plugutils.c:900
plug_get_host_open_port
unsigned int plug_get_host_open_port(struct script_infos *desc)
Definition: plugutils.c:786
plug_set_ssl_key
void plug_set_ssl_key(struct script_infos *, char *)
Definition: plugutils.c:884
plug_current_vhost
const char * plug_current_vhost(void)
Definition: plugutils.c:57
post_alarm_udp
void post_alarm_udp(struct script_infos *, int, const char *)
proto_post_error
void proto_post_error(const char *, struct script_infos *, int, const char *, const char *)
Definition: plugutils.c:382
post_log
void post_log(const char *, struct script_infos *, int, const char *)
Post a log message about a tcp port.
Definition: plugutils.c:375
plug_get_host_fqdn
char * plug_get_host_fqdn(struct script_infos *)
Definition: plugutils.c:211
plug_get_host_ip
struct in6_addr * plug_get_host_ip(struct script_infos *)
Definition: plugutils.c:285
plug_get_kb
kb_t plug_get_kb(struct script_infos *)
Definition: plugutils.c:627
plug_replace_key_len
void plug_replace_key_len(struct script_infos *, char *, int, void *, size_t)
Definition: plugutils.c:592
plug_set_dep
void plug_set_dep(struct script_infos *, const char *)
Definition: plugutils.c:65
get_plugin_preference
char * get_plugin_preference(const char *, const char *)
Definition: plugutils.c:396
scanneraux.h
Auxiliary structures for scanner.
plug_get_host_ip_str
char * plug_get_host_ip_str(struct script_infos *)
Definition: plugutils.c:291
plug_set_ssl_cert
void plug_set_ssl_cert(struct script_infos *, char *)
Definition: plugutils.c:878
get_plugin_preference_fname
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:455
plug_set_key
void plug_set_key(struct script_infos *, char *, int, const void *)
Definition: plugutils.c:585
plug_get_host_source
char * plug_get_host_source(struct script_infos *, const char *)
Definition: plugutils.c:257
plug_replace_key
void plug_replace_key(struct script_infos *, char *, int, void *)
Definition: plugutils.c:615
plug_get_key
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:699
proto_post_log
void proto_post_log(const char *, struct script_infos *, int, const char *, const char *)
Post a log message.
Definition: plugutils.c:365
plug_get_host_fqdn_list
GSList * plug_get_host_fqdn_list(struct script_infos *)
Definition: plugutils.c:239
plug_set_port_transport
void plug_set_port_transport(struct script_infos *, int, int)
Definition: plugutils.c:841
plug_create_from_nvti_and_prefs
struct script_infos * plug_create_from_nvti_and_prefs(const nvti_t *)
post_alarm
void post_alarm(const char *, struct script_infos *, int, const char *)
Definition: plugutils.c:355
scanner_add_port
void scanner_add_port(struct script_infos *, int, char *)
Definition: plugutils.c:621
host_get_port_state
int host_get_port_state(struct script_infos *, int)
Definition: plugutils.c:154
plug_set_ssl_pem_password
void plug_set_ssl_pem_password(struct script_infos *, char *)
Definition: plugutils.c:890
get_plugin_preference_file_content
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:510
plug_set_key_len
void plug_set_key_len(struct script_infos *, char *, int, const void *, size_t)
Definition: plugutils.c:563
plug_get_port_transport
int plug_get_port_transport(struct script_infos *, int)
Definition: plugutils.c:854
plug_add_host_fqdn
int plug_add_host_fqdn(struct script_infos *, const char *, const char *)
Definition: plugutils.c:166
proto_post_alarm
void proto_post_alarm(const char *, struct script_infos *, int, const char *, const char *)
Definition: plugutils.c:348