OpenVAS Libraries  7.0.9
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 {
131  const char* ssh_credential_id;
132  const char* smb_credential_id;
133  const char* port_range;
134  const char* name;
135  const char* comment;
136  const char* hosts;
138 
142 static const omp_create_target_opts_t omp_create_target_opts_defaults =
143  { 0 };
144 
148 typedef struct
149 {
150  const char* name;
151  const char* duration;
152  int brief;
154 
158 static const omp_get_system_reports_opts_t omp_get_system_reports_opts_defaults =
159  { };
160 
164 typedef struct
165 {
166  int ultimate;
168 
172 static const omp_delete_opts_t omp_delete_opts_defaults =
173  { 0 };
174 
178 static const omp_delete_opts_t omp_delete_opts_ultimate_defaults =
179  { 1 };
180 
181 int check_response (gnutls_session_t *);
182 
183 int omp_read_create_response (gnutls_session_t*, gchar **);
184 
185 const char *omp_task_status (entity_t status_response);
186 
187 int omp_ping (gnutls_session_t *, int);
188 
189 int omp_authenticate (gnutls_session_t * session, const char *username,
190  const char *password);
191 
192 int omp_authenticate_info (gnutls_session_t * session, const char *username,
193  const char *, char **, char **, char **);
194 
195 int omp_create_task_rc (gnutls_session_t *, const char *, unsigned int,
196  const char *, const char *, char **);
197 
198 int omp_create_task (gnutls_session_t *, const char *, const char *,
199  const char *, const char *, gchar **);
200 
201 int omp_create_task_ext (gnutls_session_t *, omp_create_task_opts_t, gchar **);
202 
203 int omp_start_task_report (gnutls_session_t *, const char *, char **);
204 
205 int omp_resume_or_start_task_report (gnutls_session_t *, const char *, char **);
206 
207 int omp_resume_or_start_task (gnutls_session_t *, const char *);
208 
209 int omp_stop_task (gnutls_session_t *, const char *);
210 
211 int omp_pause_task (gnutls_session_t*, const char*);
212 
213 int omp_resume_paused_task (gnutls_session_t*, const char*);
214 
215 int omp_resume_stopped_task_report (gnutls_session_t*, const char*, char**);
216 
217 int omp_get_tasks (gnutls_session_t *, const char *, int, int, entity_t *);
218 
219 int omp_get_tasks_ext (gnutls_session_t *, omp_get_tasks_opts_t, entity_t *);
220 
221 int omp_get_task_ext (gnutls_session_t *, omp_get_task_opts_t, entity_t *);
222 
223 int omp_get_targets (gnutls_session_t *, const char *, int, int, entity_t *);
224 
225 int omp_get_report_ext (gnutls_session_t *, omp_get_report_opts_t, entity_t *);
226 
227 int omp_delete_task (gnutls_session_t *, const char *);
228 
229 int omp_delete_task_ext (gnutls_session_t *, const char *, omp_delete_opts_t);
230 
231 int omp_modify_task_file (gnutls_session_t *, const char *, const char *,
232  const void *, gsize);
233 
234 int omp_delete_report (gnutls_session_t*, const char*);
235 
236 int omp_create_target_ext (gnutls_session_t *, omp_create_target_opts_t,
237  gchar**);
238 
239 int omp_delete_target_ext (gnutls_session_t *, const char *, omp_delete_opts_t);
240 
241 int omp_delete_config_ext (gnutls_session_t *, const char *, omp_delete_opts_t);
242 
243 int omp_create_lsc_credential (gnutls_session_t *, const char *, const char *,
244  const char *, const char *, gchar **);
245 
246 int omp_create_lsc_credential_key (gnutls_session_t *, const char *,
247  const char *, const char *, const char *,
248  const char *, const char *, gchar **);
249 
250 int omp_delete_lsc_credential_ext (gnutls_session_t *, const char *,
252 
253 int omp_get_system_reports (gnutls_session_t *, const char *, int, entity_t *);
254 
255 int omp_get_system_reports_ext (gnutls_session_t *,
257  entity_t *);
258 
259 #if 0
260 {
261 #endif
262 #ifdef __cplusplus
263 }
264 #endif
265 
266 #endif /* not _OPENVAS_LIBRARIES_OMP_H */