OpenVAS Libraries  9.0.1
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 "arglists.h"
30 
31 #include "../base/nvti.h"
32 #include "../base/openvas_networking.h"
33 #include "../base/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 
44 void plug_set_dep (struct arglist *, const char *);
45 
46 void plug_set_xref (struct arglist *, char *, char *);
47 
48 void plug_set_tag (struct arglist *, char *, char *);
49 
50 void plug_set_ssl_cert (struct arglist *, char *);
51 void plug_set_ssl_key (struct arglist *, char *);
52 void plug_set_ssl_pem_password (struct arglist *, char *);
53 void plug_set_ssl_CA_file (struct arglist *, char *);
54 
55 
56 const char *plug_get_hostname (struct arglist *);
57 char *plug_get_host_fqdn (struct arglist *);
58 unsigned int plug_get_host_open_port (struct arglist *desc);
59 
60 void plug_set_port_transport (struct arglist *, int, int);
61 
62 int plug_get_port_transport (struct arglist *, int);
63 
64 struct arglist *
66 
67 /*
68  * Reporting functions
69  */
70 void proto_post_alarm (const char *, struct arglist *, int, const char *, const char *);
71 void post_alarm (const char *, struct arglist *, int, const char *);
72 void post_alarm_udp (struct arglist *, int, const char *);
73 #define post_alarm_tcp post_alarm
74 
75 void proto_post_error (const char *, struct arglist *, int, const char *, const char *);
76 void post_error (const char *, struct arglist *, int, const char *);
77 #define post_error_tcp post_error
78 
79 void proto_post_log (const char *, struct arglist *, int, const char *, const char *);
80 void post_log (const char *, struct arglist *, int, const char *);
81 #define post_log_tcp post_log
82 
83 
84 /*
85  * Management of the portlists
86  */
87 int host_get_port_state (struct arglist *, int);
88 int host_get_port_state_udp (struct arglist *, int);
89 
90 /* Not implemented
91 char * host_get_port_banner(struct arglist *, int);
92 */
93 
94 
95 /*
96  * Inter Plugins Communication functions
97  */
98 void plug_set_key (struct arglist *, char *, int, const void *);
99 void plug_replace_key (struct arglist *, char *, int, void *);
100 kb_t plug_get_kb (struct arglist *);
101 void *plug_get_key (struct arglist *, char *, int *);
102 
103 struct in6_addr *plug_get_host_ip (struct arglist *);
104 char *plug_get_host_ip_str (struct arglist *);
105 void add_plugin_preference (struct arglist *, const char *, const char *,
106  const char *);
107 char *get_plugin_preference (const char *, const char *);
108 const char *get_plugin_preference_fname (struct arglist *, const char *);
109 char *get_plugin_preference_file_content (struct arglist *, const char *);
110 long get_plugin_preference_file_size (struct arglist *, const char *);
111 
112 char *find_in_path (char *, int);
113 
114 #endif
void post_alarm(const char *, struct arglist *, int, const char *)
Definition: plugutils.c:430
void plug_set_ssl_cert(struct arglist *, char *)
Definition: plugutils.c:1001
void post_log(const char *, struct arglist *, int, const char *)
Post a log message about a tcp port.
Definition: plugutils.c:450
int host_get_port_state(struct arglist *, int)
Definition: plugutils.c:177
void proto_post_log(const char *, struct arglist *, int, const char *, const char *)
Post a log message.
Definition: plugutils.c:440
char * plug_get_host_ip_str(struct arglist *)
Definition: plugutils.c:227
int host_get_port_state_udp(struct arglist *, int)
Definition: plugutils.c:183
The structure of a information record that corresponds to a NVT.
Definition: nvti.h:64
void plug_set_ssl_CA_file(struct arglist *, char *)
Definition: plugutils.c:1023
void scanner_add_port(struct arglist *, int, char *)
Definition: plugutils.c:692
char * get_plugin_preference(const char *, const char *)
Definition: plugutils.c:481
void * plug_get_key(struct arglist *, char *, int *)
Definition: plugutils.c:756
void post_alarm_udp(struct arglist *, int, const char *)
void plug_set_ssl_key(struct arglist *, char *)
Definition: plugutils.c:1007
struct arglist * plug_create_from_nvti_and_prefs(const nvti_t *)
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:626
Top-level KB. This is to be inherited by KB implementations.
Definition: kb.h:77
void plug_set_port_transport(struct arglist *, int, int)
Definition: plugutils.c:964
void plug_set_tag(struct arglist *, char *, char *)
Definition: plugutils.c:72
void plug_set_xref(struct arglist *, char *, char *)
Definition: plugutils.c:57
char * find_in_path(char *, int)
Definition: plugutils.c:1029
unsigned int plug_get_host_open_port(struct arglist *desc)
Definition: plugutils.c:905
void proto_post_alarm(const char *, struct arglist *, int, const char *, const char *)
Definition: plugutils.c:423
void plug_set_key(struct arglist *, char *, int, const void *)
Definition: plugutils.c:647
Definition: arglists.h:29
const char * plug_get_hostname(struct arglist *)
Definition: plugutils.c:190
void proto_post_error(const char *, struct arglist *, int, const char *, const char *)
Definition: plugutils.c:456
struct in6_addr * plug_get_host_ip(struct arglist *)
Definition: plugutils.c:218
void plug_set_dep(struct arglist *, const char *)
Definition: plugutils.c:87
kb_t plug_get_kb(struct arglist *)
Definition: plugutils.c:699
void post_error(const char *, struct arglist *, int, const char *)
Definition: plugutils.c:464
void add_plugin_preference(struct arglist *, const char *, const char *, const char *)
Definition: plugutils.c:470
char * plug_get_host_fqdn(struct arglist *)
Definition: plugutils.c:200
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:540
int plug_get_port_transport(struct arglist *, int)
Definition: plugutils.c:978
void plug_set_ssl_pem_password(struct arglist *, char *)
Definition: plugutils.c:1013
void plug_replace_key(struct arglist *, char *, int, void *)
Definition: plugutils.c:670
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:594