Open SCAP Library
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
src
XCCDF_POLICY
public
xccdf_policy.h
Go to the documentation of this file.
1
/*
2
* Copyright 2009 Red Hat Inc., Durham, North Carolina.
3
* All Rights Reserved.
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
*/
20
21
31
#ifndef XCCDF_POLICY_H_
32
#define XCCDF_POLICY_H_
33
34
#include <stdbool.h>
35
#include <time.h>
36
#include <
oscap.h
>
37
#include <
xccdf.h
>
38
#include <
reporter.h
>
39
44
struct
xccdf_policy_model
;
45
50
struct
xccdf_policy
;
51
56
struct
xccdf_value_binding
;
57
58
struct
xccdf_value_binding_iterator;
59
65
struct
xccdf_policy_iterator
;
66
67
/************************************************************/
68
75
struct
xccdf_policy_model
*
xccdf_policy_model_new
(
struct
xccdf_benchmark
*
benchmark
);
76
83
struct
xccdf_policy
*
xccdf_policy_new
(
struct
xccdf_policy_model
*
model
,
struct
xccdf_profile
*
profile
);
84
90
struct
xccdf_value_binding
*
xccdf_value_binding_new
(
void
);
91
96
void
xccdf_policy_model_free
(
struct
xccdf_policy_model
*);
97
102
void
xccdf_policy_free
(
struct
xccdf_policy
*);
103
108
void
xccdf_value_binding_free
(
struct
xccdf_value_binding
*);
109
119
bool
xccdf_policy_model_register_engine_callback
(
struct
xccdf_policy_model
* model,
char
* sys,
void
* func,
void
* usr);
120
151
bool
xccdf_policy_model_register_output_callback
(
struct
xccdf_policy_model
* model,
oscap_reporter
func,
void
* usr);
152
178
bool
xccdf_policy_model_register_start_callback
(
struct
xccdf_policy_model
* model,
oscap_reporter
func,
void
* usr);
179
180
/************************************************************/
194
struct
xccdf_policy_model
*
xccdf_policy_get_model
(
const
struct
xccdf_policy
* policy);
195
202
struct
xccdf_benchmark
*
xccdf_policy_model_get_benchmark
(
const
struct
xccdf_policy_model
* item);
203
208
struct
xccdf_value_binding_iterator *
xccdf_policy_get_values
(
const
struct
xccdf_policy
* item);
209
216
struct
xccdf_policy_iterator
*
xccdf_policy_model_get_policies
(
const
struct
xccdf_policy_model
*model);
217
224
struct
xccdf_select_iterator
*
xccdf_policy_get_selected_rules
(
struct
xccdf_policy
*);
225
231
struct
xccdf_profile
*
xccdf_policy_get_profile
(
const
struct
xccdf_policy
*);
232
238
struct
xccdf_select_iterator
*
xccdf_policy_get_selects
(
const
struct
xccdf_policy
*);
239
245
char
*
xccdf_value_binding_get_name
(
const
struct
xccdf_value_binding
*);
246
252
char
*
xccdf_value_binding_get_value
(
const
struct
xccdf_value_binding
*);
253
259
xccdf_value_type_t
xccdf_value_binding_get_type
(
const
struct
xccdf_value_binding
*);
260
266
xccdf_operator_t
xccdf_value_binding_get_operator
(
const
struct
xccdf_value_binding
*);
267
273
char
*
xccdf_value_binding_get_setvalue
(
const
struct
xccdf_value_binding
*);
274
279
struct
xccdf_result_iterator
*
xccdf_policy_get_results
(
const
struct
xccdf_policy
* policy);
280
286
struct
xccdf_result
*
xccdf_policy_get_result_by_id
(
struct
xccdf_policy
* policy,
const
char
*
id
);
287
294
const
char
*
xccdf_policy_get_id
(
struct
xccdf_policy
* policy);
295
303
struct
xccdf_policy
*
xccdf_policy_model_get_policy_by_id
(
struct
xccdf_policy_model
* policy_model,
const
char
*
id
);
304
305
/************************************************************/
308
/************************************************************/
321
bool
xccdf_policy_model_add_policy
(
struct
xccdf_policy_model
*,
struct
xccdf_policy
*);
322
328
bool
xccdf_policy_add_select
(
struct
xccdf_policy
*,
struct
xccdf_select
*);
329
335
bool
xccdf_policy_set_selected
(
struct
xccdf_policy
* policy,
char
* idref);
336
341
bool
xccdf_policy_add_result
(
struct
xccdf_policy
* policy,
struct
xccdf_result
* item);
342
348
bool
xccdf_policy_add_value
(
struct
xccdf_policy
*,
struct
xccdf_value_binding
*);
349
355
//bool xccdf_value_binding_add_check_export(struct xccdf_value_binding *, struct xccdf_check_export *);
361
struct
xccdf_select
*
xccdf_policy_get_select_by_id
(
struct
xccdf_policy
* policy,
const
char
*item_id);
362
363
/************************************************************/
366
/************************************************************/
390
struct
xccdf_result
*
xccdf_policy_evaluate
(
struct
xccdf_policy
* policy);
391
400
bool
xccdf_policy_resolve
(
struct
xccdf_policy
* policy);
401
408
struct
xccdf_item
*
xccdf_policy_tailor_item
(
struct
xccdf_policy
* policy,
struct
xccdf_item
* item);
409
413
struct
oscap_file_entry
;
414
416
struct
oscap_file_entry
*
oscap_file_entry_new
(
void
);
418
struct
oscap_file_entry
*
oscap_file_entry_dup
(
struct
oscap_file_entry
* file_entry);
420
void
oscap_file_entry_free
(
struct
oscap_file_entry
* entry);
422
const
char
*
oscap_file_entry_get_system
(
struct
oscap_file_entry
* entry);
424
const
char
*
oscap_file_entry_get_file
(
struct
oscap_file_entry
* entry);
425
429
struct
oscap_file_entry_iterator
;
430
432
const
struct
oscap_file_entry
*
oscap_file_entry_iterator_next
(
struct
oscap_file_entry_iterator
*it);
434
bool
oscap_file_entry_iterator_has_more
(
struct
oscap_file_entry_iterator
*it);
436
void
oscap_file_entry_iterator_free
(
struct
oscap_file_entry_iterator
*it);
438
void
oscap_file_entry_iterator_reset
(
struct
oscap_file_entry_iterator
*it);
439
443
struct
oscap_file_entry_list
;
444
446
struct
oscap_file_entry_list
*
oscap_file_entry_list_new
(
void
);
448
void
oscap_file_entry_list_free
(
struct
oscap_file_entry_list
* list);
450
struct
oscap_file_entry_iterator
*
oscap_file_entry_list_get_files
(
struct
oscap_file_entry_list
* list);
451
460
struct
oscap_file_entry_list
*
xccdf_policy_model_get_systems_and_files
(
struct
xccdf_policy_model
* policy_model);
461
469
struct
oscap_file_entry_list
*
xccdf_item_get_systems_and_files
(
struct
xccdf_item
* item);
470
476
struct
oscap_stringlist
*
xccdf_policy_model_get_files
(
struct
xccdf_policy_model
* policy_model);
477
483
struct
oscap_stringlist
*
xccdf_item_get_files
(
struct
xccdf_item
* item);
484
485
/************************************************************/
488
/************************************************************/
498
bool
xccdf_policy_iterator_has_more
(
struct
xccdf_policy_iterator
*it);
499
504
struct
xccdf_policy
*
xccdf_policy_iterator_next
(
struct
xccdf_policy_iterator
*it);
505
510
void
xccdf_policy_iterator_free
(
struct
xccdf_policy_iterator
*it);
511
516
void
xccdf_policy_iterator_reset
(
struct
xccdf_policy_iterator
*it);
517
522
bool
xccdf_value_binding_iterator_has_more(
struct
xccdf_value_binding_iterator *it);
523
528
struct
xccdf_value_binding
* xccdf_value_binding_iterator_next(
struct
xccdf_value_binding_iterator *it);
529
534
void
xccdf_value_binding_iterator_free(
struct
xccdf_value_binding_iterator *it);
535
540
void
xccdf_value_binding_iterator_reset(
struct
xccdf_value_binding_iterator *it);
541
549
struct
xccdf_score
*
xccdf_policy_get_score
(
struct
xccdf_policy
* policy,
struct
xccdf_result
* test_result,
const
char
* system);
550
556
char
*
xccdf_policy_substitute
(
const
char
*text,
struct
xccdf_policy
*policy);
557
558
/************************************************************/
561
/*
562
* @}
563
*/
564
#endif
565
566
Generated by
1.8.1.1