OpenVAS Libraries  7.0.9
plugutils.h
Go to the documentation of this file.
1 /* OpenVAS
2  * $Id$
3  * Description: Header file for module plugutils.
4  *
5  * Authors:
6  * Renaud Deraison <deraison@nessus.org> (Original pre-fork development)
7  *
8  * Copyright:
9  * Based on work Copyright (C) 1998 - 2007 Tenable Network Security, Inc.
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25 
26 #ifndef OPENVAS_PLUGUTILS_H
27 #define OPENVAS_PLUGUTILS_H
28 
29 #include "../misc/arglists.h"
30 
31 #include "../base/nvti.h"
32 #include "../base/openvas_networking.h"
33 #include "kb.h"
34 
35 #define LEGACY_OID "1.3.6.1.4.1.25623.1.0."
36 
37 void scanner_add_port (struct arglist *, int, char *);
38 
39 
40 /*
41  * Arglist management at plugin-level
42  */
43 void plug_set_launch (struct arglist *, int);
44 int plug_get_launch (struct arglist *);
45 
46 void plug_set_dep (struct arglist *, const char *);
47 
48 void plug_set_xref (struct arglist *, char *, char *);
49 
50 void plug_set_tag (struct arglist *, char *, char *);
51 
52 void plug_set_ssl_cert (struct arglist *, char *);
53 void plug_set_ssl_key (struct arglist *, char *);
54 void plug_set_ssl_pem_password (struct arglist *, char *);
55 void plug_set_ssl_CA_file (struct arglist *, char *);
56 
57 
58 const char *plug_get_hostname (struct arglist *);
59 const char *plug_get_host_fqdn (struct arglist *);
60 unsigned int plug_get_host_open_port (struct arglist *desc);
61 
62 void plug_set_port_transport (struct arglist *, int, int);
63 
64 int plug_get_port_transport (struct arglist *, int);
65 
67 
68 /*
69  * Reporting functions
70  */
71 void proto_post_alarm (struct arglist *, int, const char *, const char *);
72 void post_alarm (struct arglist *, int, const char *);
73 void post_alarm_udp (struct arglist *, int, const char *);
74 #define post_alarm_tcp post_alarm
75 
76 void proto_post_error (struct arglist *, int, const char *, const char *);
77 void post_error (struct arglist *, int, const char *);
78 #define post_error_tcp post_error
79 
80 void proto_post_log (struct arglist *, int, const char *, const char *);
81 void post_log (struct arglist *, int, const char *);
82 #define post_log_tcp post_log
83 
84 
85 /*
86  * Management of the portlists
87  */
88 int host_get_port_state (struct arglist *, int);
89 int host_get_port_state_udp (struct arglist *, int);
90 
91 /* Not implemented
92 char * host_get_port_banner(struct arglist *, int);
93 */
94 
95 
96 /*
97  * Inter Plugins Communication functions
98  */
99 void plug_set_key (struct arglist *, char *, int, void *);
100 void plug_replace_key (struct arglist *, char *, int, void *);
101 void *plug_get_fresh_key (struct arglist *, char *, int *);
102 kb_t plug_get_kb (struct arglist *);
103 void *plug_get_key (struct arglist *, char *, int *);
104 
105 char *addslashes (char *);
106 char *rmslashes (char *);
107 
108 struct in6_addr *plug_get_host_ip (struct arglist *);
109 char *get_preference (struct arglist *, const char *);
110 void add_plugin_preference (struct arglist *, const char *, const char *,
111  const char *);
112 char *get_plugin_preference (struct arglist *, const char *);
113 const char *get_plugin_preference_fname (struct arglist *, const char *);
114 char *get_plugin_preference_file_content (struct arglist *, const char *);
115 const long get_plugin_preference_file_size (struct arglist *, const char *);
116 
117 char *find_in_path (char *, int);
118 
119 #endif
void proto_post_error(struct arglist *, int, const char *, const char *)
Definition: plugutils.c:651
void plug_set_ssl_cert(struct arglist *, char *)
Definition: plugutils.c:1317
const long get_plugin_preference_file_size(struct arglist *, const char *)
Get the file size of a plugins preference that is of type "file".
Definition: plugutils.c:842
int host_get_port_state(struct arglist *, int)
Definition: plugutils.c:372
int host_get_port_state_udp(struct arglist *, int)
Definition: plugutils.c:378
The structure of a information record that corresponds to a NVT.
Definition: nvti.h:64
int plug_get_launch(struct arglist *)
Definition: plugutils.c:218
void plug_set_ssl_CA_file(struct arglist *, char *)
Definition: plugutils.c:1339
char * get_plugin_preference(struct arglist *, const char *)
Definition: plugutils.c:686
Definition: kb.h:44
void plug_set_key(struct arglist *, char *, int, void *)
Definition: plugutils.c:974
void scanner_add_port(struct arglist *, int, char *)
Definition: plugutils.c:987
void * plug_get_key(struct arglist *, char *, int *)
Definition: plugutils.c:1060
void post_alarm_udp(struct arglist *, int, const char *)
char * rmslashes(char *)
Replaces escape codes (\n, \r) by the real value.
Definition: plugutils.c:121
void plug_set_ssl_key(struct arglist *, char *)
Definition: plugutils.c:1323
void plug_set_port_transport(struct arglist *, int, int)
Definition: plugutils.c:1274
void plug_set_tag(struct arglist *, char *, char *)
Definition: plugutils.c:172
void post_alarm(struct arglist *, int, const char *)
Definition: plugutils.c:625
void post_log(struct arglist *, int, const char *)
Post a log message about a tcp port.
Definition: plugutils.c:645
void plug_set_xref(struct arglist *, char *, char *)
Definition: plugutils.c:157
char * find_in_path(char *, int)
Definition: plugutils.c:1345
unsigned int plug_get_host_open_port(struct arglist *desc)
Definition: plugutils.c:1215
Definition: arglists.h:29
void proto_post_log(struct arglist *, int, const char *, const char *)
Post a log message.
Definition: plugutils.c:635
const char * plug_get_host_fqdn(struct arglist *)
Definition: plugutils.c:395
const char * plug_get_hostname(struct arglist *)
Definition: plugutils.c:385
struct in6_addr * plug_get_host_ip(struct arglist *)
Definition: plugutils.c:413
void plug_set_dep(struct arglist *, const char *)
Definition: plugutils.c:187
void * plug_get_fresh_key(struct arglist *, char *, int *)
Definition: plugutils.c:864
char * addslashes(char *)
Escapes \n and \r and \ in properly. The.
Definition: plugutils.c:68
kb_t plug_get_kb(struct arglist *)
Definition: plugutils.c:994
void proto_post_alarm(struct arglist *, int, const char *, const char *)
Definition: plugutils.c:618
void add_plugin_preference(struct arglist *, const char *, const char *, const char *)
Definition: plugutils.c:675
const char * get_plugin_preference_fname(struct arglist *, const char *)
Get the file name of a plugins preference that is of type "file".
Definition: plugutils.c:756
char * get_preference(struct arglist *, const char *)
Definition: plugutils.c:665
int plug_get_port_transport(struct arglist *, int)
Definition: plugutils.c:1288
void plug_set_ssl_pem_password(struct arglist *, char *)
Definition: plugutils.c:1329
struct arglist * plug_create_from_nvti_and_prefs(nvti_t *, struct arglist *)
Returns a (plugin) arglist assembled from the nvti.
Definition: plugutils.c:269
void plug_replace_key(struct arglist *, char *, int, void *)
Definition: plugutils.c:981
void plug_set_launch(struct arglist *, int)
Definition: plugutils.c:206
void post_error(struct arglist *, int, const char *)
Definition: plugutils.c:659
char * get_plugin_preference_file_content(struct arglist *, const char *)
Get the file contents of a plugins preference that is of type "file".
Definition: plugutils.c:810