OpenVAS Libraries  7.0.7
omp.h
Go to the documentation of this file.
1 /* openvase-libraries/omp
2  * $Id$
3  * Description: Header for OMP client interface.
4  *
5  * Authors:
6  * Matthew Mundell <matt@mundell.ukfsn.org>
7  *
8  * Copyright:
9  * Copyright (C) 2009 Greenbone Networks GmbH
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License version 2,
13  * or, at your option, any later version as published by the Free
14  * Software Foundation
15  *
16  * This program 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
19  * GNU 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_LIBRARIES_OMP_H
27 #define _OPENVAS_LIBRARIES_OMP_H
28 
29 #include "xml.h"
30 
31 #ifdef __cplusplus
32 extern "C"
33 {
34 #if 0
35 }
36 #endif
37 #endif
38 
44 typedef struct
45 {
46  const char* sort_field;
47  const char* sort_order;
48  const char* format_id;
49  const char* levels;
50  const char* report_id;
52  int autofp;
53  /* Boolean flags: */
54  int overrides;
59 
63 static const omp_get_report_opts_t omp_get_report_opts_defaults =
64  {
65  "ROWID", "ascending", "a994b278-1f62-11e1-96ac-406186ea4fc5", "hmlgd"
66  };
67 
71 typedef struct
72 {
73  const char* filter;
74  const char* actions;
75  /* Boolean flags: */
76  int details;
77  int rcfile;
79 
83 static const omp_get_tasks_opts_t omp_get_tasks_opts_defaults =
84  { "" };
85 
89 typedef struct
90 {
91  const char* actions;
92  const char* task_id;
93  /* Boolean flags: */
94  int details;
95  int rcfile;
97 
101 static const omp_get_task_opts_t omp_get_task_opts_defaults =
102  { };
103 
109 typedef struct
110 {
111  const char* config_id;
112  const char* target_id;
113  const char* name;
114  const char* comment;
115  const char* max_hosts;
116  const char* max_checks;
118 
122 static const omp_create_task_opts_t omp_create_task_opts_defaults =
123  { };
124 
128 typedef struct
129 {
130  const char* ssh_credential_id;
131  const char* smb_credential_id;
132  const char* port_range;
133  const char* name;
134  const char* comment;
135  const char* hosts;
137 
141 static const omp_create_target_opts_t omp_create_target_opts_defaults =
142  { };
143 
147 typedef struct
148 {
149  const char* name;
150  const char* duration;
151  int brief;
153 
157 static const omp_get_system_reports_opts_t omp_get_system_reports_opts_defaults =
158  { };
159 
163 typedef struct
164 {
165  int ultimate;
167 
171 static const omp_delete_opts_t omp_delete_opts_defaults =
172  { 0 };
173 
177 static const omp_delete_opts_t omp_delete_opts_ultimate_defaults =
178  { 1 };
179 
180 int check_response (gnutls_session_t *);
181 
182 int omp_read_create_response (gnutls_session_t*, gchar **);
183 
184 const char *omp_task_status (entity_t status_response);
185 
186 int omp_ping (gnutls_session_t *, int);
187 
188 int omp_authenticate (gnutls_session_t * session, const char *username,
189  const char *password);
190 
191 int omp_authenticate_info (gnutls_session_t * session, const char *username,
192  const char *, char **, char **, char **);
193 
194 int omp_create_task_rc (gnutls_session_t *, const char *, unsigned int,
195  const char *, const char *, char **);
196 
197 int omp_create_task (gnutls_session_t *, const char *, const char *,
198  const char *, const char *, gchar **);
199 
200 int omp_create_task_ext (gnutls_session_t *, omp_create_task_opts_t, gchar **);
201 
202 int omp_start_task_report (gnutls_session_t *, const char *, char **);
203 
204 int omp_resume_or_start_task_report (gnutls_session_t *, const char *, char **);
205 
206 int omp_resume_or_start_task (gnutls_session_t *, const char *);
207 
208 int omp_stop_task (gnutls_session_t *, const char *);
209 
210 int omp_pause_task (gnutls_session_t*, const char*);
211 
212 int omp_resume_paused_task (gnutls_session_t*, const char*);
213 
214 int omp_resume_stopped_task_report (gnutls_session_t*, const char*, char**);
215 
216 int omp_get_tasks (gnutls_session_t *, const char *, int, int, entity_t *);
217 
218 int omp_get_tasks_ext (gnutls_session_t *, omp_get_tasks_opts_t, entity_t *);
219 
220 int omp_get_task_ext (gnutls_session_t *, omp_get_task_opts_t, entity_t *);
221 
222 int omp_get_targets (gnutls_session_t *, const char *, int, int, entity_t *);
223 
224 int omp_get_report_ext (gnutls_session_t *, omp_get_report_opts_t, entity_t *);
225 
226 int omp_delete_task (gnutls_session_t *, const char *);
227 
228 int omp_delete_task_ext (gnutls_session_t *, const char *, omp_delete_opts_t);
229 
230 int omp_modify_task_file (gnutls_session_t *, const char *, const char *,
231  const void *, gsize);
232 
233 int omp_delete_report (gnutls_session_t*, const char*);
234 
235 int omp_create_target_ext (gnutls_session_t *, omp_create_target_opts_t,
236  gchar**);
237 
238 int omp_delete_target_ext (gnutls_session_t *, const char *, omp_delete_opts_t);
239 
240 int omp_delete_config_ext (gnutls_session_t *, const char *, omp_delete_opts_t);
241 
242 int omp_create_lsc_credential (gnutls_session_t *, const char *, const char *,
243  const char *, const char *, gchar **);
244 
245 int omp_create_lsc_credential_key (gnutls_session_t *, const char *,
246  const char *, const char *, const char *,
247  const char *, const char *, gchar **);
248 
249 int omp_delete_lsc_credential_ext (gnutls_session_t *, const char *,
251 
252 int omp_get_system_reports (gnutls_session_t *, const char *, int, entity_t *);
253 
254 int omp_get_system_reports_ext (gnutls_session_t *,
256  entity_t *);
257 
258 #if 0
259 {
260 #endif
261 #ifdef __cplusplus
262 }
263 #endif
264 
265 #endif /* not _OPENVAS_LIBRARIES_OMP_H */