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