OpenVAS Libraries  8.0.3
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 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 
66 struct arglist *
68 
69 /*
70  * Reporting functions
71  */
72 void proto_post_alarm (const char *, struct arglist *, int, const char *, const char *);
73 void post_alarm (const char *, struct arglist *, int, const char *);
74 void post_alarm_udp (struct arglist *, int, const char *);
75 #define post_alarm_tcp post_alarm
76 
77 void proto_post_error (const char *, struct arglist *, int, const char *, const char *);
78 void post_error (const char *, struct arglist *, int, const char *);
79 #define post_error_tcp post_error
80 
81 void proto_post_log (const char *, struct arglist *, int, const char *, const char *);
82 void post_log (const char *, struct arglist *, int, const char *);
83 #define post_log_tcp post_log
84 
85 
86 /*
87  * Management of the portlists
88  */
89 int host_get_port_state (struct arglist *, int);
90 int host_get_port_state_udp (struct arglist *, int);
91 
92 /* Not implemented
93 char * host_get_port_banner(struct arglist *, int);
94 */
95 
96 
97 /*
98  * Inter Plugins Communication functions
99  */
100 void plug_set_key (struct arglist *, char *, int, void *);
101 void plug_replace_key (struct arglist *, char *, int, void *);
102 kb_t plug_get_kb (struct arglist *);
103 void *plug_get_key (struct arglist *, char *, int *);
104 
105 struct in6_addr *plug_get_host_ip (struct arglist *);
106 char *plug_get_host_ip_str (struct arglist *);
107 void add_plugin_preference (struct arglist *, const char *, const char *,
108  const char *);
109 char *get_plugin_preference (const char *, const char *);
110 const char *get_plugin_preference_fname (struct arglist *, const char *);
111 char *get_plugin_preference_file_content (struct arglist *, const char *);
112 const long get_plugin_preference_file_size (struct arglist *, const char *);
113 
114 char *find_in_path (char *, int);
115 
116 #endif
void post_alarm(const char *, struct arglist *, int, const char *)
Definition: plugutils.c:501
void plug_set_ssl_cert(struct arglist *, char *)
Definition: plugutils.c:1075
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:705
void post_log(const char *, struct arglist *, int, const char *)
Post a log message about a tcp port.
Definition: plugutils.c:521
int host_get_port_state(struct arglist *, int)
Definition: plugutils.c:246
void proto_post_log(const char *, struct arglist *, int, const char *, const char *)
Post a log message.
Definition: plugutils.c:511
char * plug_get_host_ip_str(struct arglist *)
Definition: plugutils.c:297
int host_get_port_state_udp(struct arglist *, int)
Definition: plugutils.c:252
The structure of a information record that corresponds to a NVT.
Definition: nvti.h:64
int plug_get_launch(struct arglist *)
Definition: plugutils.c:114
void plug_set_ssl_CA_file(struct arglist *, char *)
Definition: plugutils.c:1097
void plug_set_key(struct arglist *, char *, int, void *)
Definition: plugutils.c:726
void scanner_add_port(struct arglist *, int, char *)
Definition: plugutils.c:763
char * get_plugin_preference(const char *, const char *)
Definition: plugutils.c:552
void * plug_get_key(struct arglist *, char *, int *)
Definition: plugutils.c:827
void post_alarm_udp(struct arglist *, int, const char *)
void plug_set_ssl_key(struct arglist *, char *)
Definition: plugutils.c:1081
struct arglist * plug_create_from_nvti_and_prefs(const nvti_t *)
Returns a (plugin) arglist assembled from the nvti.
Definition: plugutils.c:154
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:1038
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:1103
unsigned int plug_get_host_open_port(struct arglist *desc)
Definition: plugutils.c:979
void proto_post_alarm(const char *, struct arglist *, int, const char *, const char *)
Definition: plugutils.c:494
Definition: arglists.h:29
const char * plug_get_hostname(struct arglist *)
Definition: plugutils.c:259
void proto_post_error(const char *, struct arglist *, int, const char *, const char *)
Definition: plugutils.c:527
struct in6_addr * plug_get_host_ip(struct arglist *)
Definition: plugutils.c:287
void plug_set_dep(struct arglist *, const char *)
Definition: plugutils.c:87
kb_t plug_get_kb(struct arglist *)
Definition: plugutils.c:770
void post_error(const char *, struct arglist *, int, const char *)
Definition: plugutils.c:535
void add_plugin_preference(struct arglist *, const char *, const char *, const char *)
Definition: plugutils.c:541
char * plug_get_host_fqdn(struct arglist *)
Definition: plugutils.c:269
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:619
int plug_get_port_transport(struct arglist *, int)
Definition: plugutils.c:1052
void plug_set_ssl_pem_password(struct arglist *, char *)
Definition: plugutils.c:1087
void plug_replace_key(struct arglist *, char *, int, void *)
Definition: plugutils.c:749
void plug_set_launch(struct arglist *, int)
Definition: plugutils.c:106
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:673