/usr/include/openvas/plugutils.h is in libopenvas2-dev 2.0.4-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | /* OpenVAS
* $Id$
* Description: Header file for module plugutils.
*
* Authors:
* Renaud Deraison <deraison@nessus.org> (Original pre-fork development)
*
* Copyright:
* Based on work Copyright (C) 1998 - 2007 Tenable Network Security, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef OPENVAS_PLUGUTILS_H
#define OPENVAS_PLUGUTILS_H
#include "arglists.h"
void scanner_add_port(struct arglist*, int, char *);
/*
* Arglist management at plugin-level
*/
void plug_set_name(struct arglist *, const char *, const char *);
char*plug_get_name(struct arglist*);
void plug_set_path(struct arglist *, const char *);
char*plug_get_path(struct arglist *);
void plug_set_fname(struct arglist *, const char *);
char*plug_get_fname(struct arglist *);
void plug_set_cachefile(struct arglist *, const char *);
char*plug_get_cachefile(struct arglist *);
void plug_set_version(struct arglist *, const char *);
char*plug_get_version(struct arglist *);
void plug_set_timeout(struct arglist *, int);
int plug_get_timeout(struct arglist *);
void plug_set_launch(struct arglist *, int);
int plug_get_launch(struct arglist *);
void plug_set_summary(struct arglist *, const char *, const char*);
char*plug_get_summary(struct arglist *);
void plug_set_description(struct arglist *, const char *,const char *);
char*plug_get_description(struct arglist *);
void plug_set_category(struct arglist *, int);
int plug_get_category(struct arglist *);
void plug_set_copyright(struct arglist *, const char *, const char*);
char*plug_get_copyright(struct arglist *);
void plug_set_family(struct arglist * , const char *, const char *);
char*plug_get_family(struct arglist *);
void plug_set_dep(struct arglist *, const char *);
struct arglist * plug_get_deps(struct arglist*);
#define LEGACY_OID "1.3.6.1.4.1.25623.1.0."
void plug_set_id(struct arglist *, int);
int plug_get_id(struct arglist *);
void plug_set_oid(struct arglist *, char *);
char*plug_get_oid(struct arglist *);
void plug_set_cve_id(struct arglist *, char *);
char*plug_get_cve_id(struct arglist *);
void plug_set_bugtraq_id(struct arglist *, char *);
char*plug_get_bugtraq_id(struct arglist *);
void plug_set_xref(struct arglist *, char *, char *);
char * plug_get_xref(struct arglist *);
void plug_set_tag(struct arglist *, char *, char *);
char * plug_get_tag(struct arglist *);
void plug_set_sign_key_ids(struct arglist*, char*);
char* plug_get_sign_key_ids(struct arglist*);
void plug_set_ssl_cert(struct arglist*, char*);
void plug_set_ssl_key(struct arglist*, char*);
void plug_set_ssl_pem_password(struct arglist*, char*);
const char * plug_get_hostname(struct arglist *);
const char * plug_get_host_fqdn(struct arglist *);
void plug_add_host(struct arglist *, struct arglist *);
unsigned int plug_get_host_open_port(struct arglist * desc);
char* plug_get_cve_id(struct arglist*);
char* plug_get_bugtraq_id(struct arglist*);
void plug_require_key(struct arglist *, const char *);
struct arglist * plug_get_required_keys(struct arglist *);
void plug_mandatory_key(struct arglist *, const char *);
struct arglist * plug_get_mandatory_keys(struct arglist *);
void plug_exclude_key(struct arglist *, const char *);
struct arglist * plug_get_excluded_keys(struct arglist *);
void plug_require_port(struct arglist *, const char *);
struct arglist * plug_get_required_ports(struct arglist *);
void plug_require_udp_port(struct arglist*, const char *);
struct arglist * plug_get_required_udp_ports(struct arglist *);
int plug_get_port_transport(struct arglist*, int);
/*
* Reporting functions
*/
void proto_post_hole(struct arglist *, int, const char *, const char *);
void post_hole(struct arglist *, int, const char *);
void post_hole_udp(struct arglist *, int, const char *);
#define post_hole_tcp post_hole
void proto_post_info(struct arglist *, int, const char *, const char *);
void post_info(struct arglist *, int, const char *);
void post_info_udp(struct arglist *, int, const char *);
#define post_info_tcp post_info
void proto_post_note(struct arglist *, int, const char *, const char *);
void post_note(struct arglist *, int, const char *);
void post_note_udp(struct arglist *, int, const char *);
#define post_note_tcp post_note
void proto_post_debug(struct arglist *, int, const char *, const char *);
void post_debug(struct arglist *, int, const char *);
void post_debug_udp(struct arglist *, int, const char *);
#define post_debug_tcp post_debug
void proto_post_log(struct arglist *, int, const char *, const char *);
void post_log(struct arglist *, int, const char *);
void post_log_udp(struct arglist *, int, const char *);
#define post_log_tcp post_log
/*
* Management of the portlists
*/
void host_add_port(struct arglist *, int, int);
void host_add_port_udp(struct arglist *, int, int);
int host_get_port_state(struct arglist *, int);
int host_get_port_state_udp(struct arglist *, int);
/* Not implemented
char * host_get_port_banner(struct arglist *, int);
*/
/*
* Inter Plugins Communication functions
*/
void plug_set_key(struct arglist *, char *, int, void *);
void plug_replace_key(struct arglist *, char *, int, void *);
void * plug_get_fresh_key(struct arglist *, char *, int *);
struct kb_item ** plug_get_kb(struct arglist *);
void * plug_get_key(struct arglist *, char *, int *);
void * plug_get_key(struct arglist *, char *, int *);
char* nessuslib_version();
void nessus_lib_version(int *, int *, int *);
char* addslashes(char*);
char* rmslashes(char*);
struct in_addr * plug_get_host_ip(struct arglist *);
char * get_preference(struct arglist *, const char *);
void add_plugin_preference(struct arglist *, const char *, const char *, const char *);
char *get_plugin_preference(struct arglist *, const char *);
const char *get_plugin_preference_fname(struct arglist*, const char*);
char* find_in_path(char*, int);
int shared_socket_register ( struct arglist *, int, char *);
int shared_socket_acquire ( struct arglist *, char * );
int shared_socket_release ( struct arglist *, char * );
int shared_socket_destroy ( struct arglist *, char * );
/* in fact, these defines might better be in
* a separate files. They are inserted here
* simply bebause plugutils uses them a lot.
*/
#define INTERNAL_COMM_MSG_TYPE_CTRL (1 << 16)
#define INTERNAL_COMM_MSG_TYPE_KB (1 << 17)
#define INTERNAL_COMM_MSG_TYPE_DATA (1 << 18)
#define INTERNAL_COMM_MSG_SHARED_SOCKET (1 << 19)
#define INTERNAL_COMM_KB_REPLACE 1
#define INTERNAL_COMM_KB_GET 2
#define INTERNAL_COMM_KB_SENDING_INT 4
#define INTERNAL_COMM_KB_SENDING_STR 8
#define INTERNAL_COMM_KB_ERROR 16
#define INTERNAL_COMM_CTRL_FINISHED 1
#define INTERNAL_COMM_CTRL_ACK 2
#define INTERNAL_COMM_SHARED_SOCKET_REGISTER 1
#define INTERNAL_COMM_SHARED_SOCKET_ACQUIRE 2
#define INTERNAL_COMM_SHARED_SOCKET_RELEASE 4
#define INTERNAL_COMM_SHARED_SOCKET_DESTROY 8
#define INTERNAL_COMM_SHARED_SOCKET_DORECVMSG 16
#define INTERNAL_COMM_SHARED_SOCKET_BUSY 32
#define INTERNAL_COMM_SHARED_SOCKET_ERROR 64
/*
* Type of "transport layer", for encapsulated connections
* Only SSL is supported at this time.
* (Bad) examples of other layers could be SOCKS, httptunnel, icmptunnel,
* RMI over HTTP, DCOM over HTTP, TCP over TCP, etc.
*/
#define NESSUS_ENCAPS_IP 1
#define NESSUS_ENCAPS_SSLv23 2 /* Ask for compatibility options */
#define NESSUS_ENCAPS_SSLv2 3
#define NESSUS_ENCAPS_SSLv3 4
#define NESSUS_ENCAPS_TLSv1 5
#define IS_ENCAPS_SSL(x) ((x) >= NESSUS_ENCAPS_SSLv23 && (x) <= NESSUS_ENCAPS_TLSv1)
#endif
|