• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

/home/pvrabec/project/openscap/openscap-0.6.3/src/XCCDF_POLICY/public/xccdf_policy.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2009 Red Hat Inc., Durham, North Carolina.
00003  * All Rights Reserved.
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2.1 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful, 
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software 
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  */
00020 
00021 
00031 #ifndef XCCDF_POLICY_H_
00032 #define XCCDF_POLICY_H_
00033 
00034 #include <stdbool.h>
00035 #include <time.h>
00036 #include <oscap.h>
00037 #include <xccdf.h>
00038 #include <reporter.h>
00039  
00044 struct xccdf_policy_model;
00045 
00050 struct xccdf_policy;
00051 
00056 struct xccdf_value_binding;
00057 
00058 struct xccdf_value_binding_iterator;
00059 
00065 struct xccdf_policy_iterator;
00066 
00067 /************************************************************/
00068 
00075 struct xccdf_policy_model *xccdf_policy_model_new(struct xccdf_benchmark *benchmark);
00076 
00083 struct xccdf_policy * xccdf_policy_new(struct xccdf_policy_model * model, struct xccdf_profile * profile);
00084 
00090 struct xccdf_value_binding * xccdf_value_binding_new(void);
00091 
00096 void xccdf_policy_model_free(struct xccdf_policy_model *);
00097 
00102 void xccdf_policy_free(struct xccdf_policy *);
00103 
00108 void xccdf_value_binding_free(struct xccdf_value_binding *);
00109 
00115 void xccdf_policy_export_variables(struct xccdf_policy *, char *export_namespace, const char *file);
00121 void xccdf_policy_export_controls (struct xccdf_policy *, char *export_namespace, const char *file);
00127 void xccdf_policy_import_results(struct xccdf_policy *, char *import_namespace, const char *file);
00133 void xccdf_policy_export_results(struct xccdf_policy *, char *scoring_model_namespace, const char *file);
00134 
00144 bool xccdf_policy_model_register_engine_callback(struct xccdf_policy_model * model, char * sys, void * func, void * usr);
00145 
00176 bool xccdf_policy_model_register_output_callback(struct xccdf_policy_model * model, oscap_reporter func, void * usr);
00177 
00203 bool xccdf_policy_model_register_start_callback(struct xccdf_policy_model * model, oscap_reporter func, void * usr);
00204 
00205 /************************************************************/
00219 struct xccdf_policy_model * xccdf_policy_get_model(const struct xccdf_policy * policy);
00220 
00227 struct xccdf_benchmark * xccdf_policy_model_get_benchmark(const struct xccdf_policy_model * item);
00228 
00233 struct xccdf_value_binding_iterator  * xccdf_policy_get_values(const struct xccdf_policy * item);
00234 
00241 struct xccdf_policy_iterator * xccdf_policy_model_get_policies(const struct xccdf_policy_model *model);
00242 
00249 struct xccdf_select_iterator * xccdf_policy_get_selected_rules(struct xccdf_policy *);
00250 
00256 struct xccdf_profile * xccdf_policy_get_profile(const struct xccdf_policy *);
00257 
00263 struct xccdf_select_iterator * xccdf_policy_get_selects(const struct xccdf_policy *);
00264 
00270 char * xccdf_value_binding_get_name(const struct xccdf_value_binding *);
00271 
00277 char * xccdf_value_binding_get_value(const struct xccdf_value_binding *);
00278 
00284 xccdf_value_type_t xccdf_value_binding_get_type(const struct xccdf_value_binding *);
00285 
00291 xccdf_operator_t xccdf_value_binding_get_operator(const struct xccdf_value_binding *);
00292 
00298 char * xccdf_value_binding_get_setvalue(const struct xccdf_value_binding *);
00299 
00304 struct xccdf_result_iterator * xccdf_policy_get_results(const struct xccdf_policy * policy);
00305 
00311 struct xccdf_result * xccdf_policy_get_result_by_id(struct xccdf_policy * policy, const char * id);
00312 
00319 const char * xccdf_policy_get_id(struct xccdf_policy * policy);
00320 
00328 struct xccdf_policy * xccdf_policy_model_get_policy_by_id(struct xccdf_policy_model * policy_model, const char * id);
00329 
00330 /************************************************************/
00333 /************************************************************/
00346 bool xccdf_policy_model_add_policy(struct xccdf_policy_model *, struct xccdf_policy *);
00347 
00353 bool xccdf_policy_add_select(struct xccdf_policy *, struct xccdf_select *);
00354 
00360 bool xccdf_policy_set_selected(struct xccdf_policy * policy, char * idref);
00361 
00366 bool xccdf_policy_add_result(struct xccdf_policy * policy, struct xccdf_result * item);
00367 
00373 bool xccdf_policy_add_value(struct xccdf_policy *, struct xccdf_value_binding *);
00374 
00380 //bool xccdf_value_binding_add_check_export(struct xccdf_value_binding *, struct xccdf_check_export *);
00381 
00382 /************************************************************/
00385 /************************************************************/
00409 struct xccdf_result *  xccdf_policy_evaluate(struct xccdf_policy * policy);
00410 
00419 bool xccdf_policy_resolve(struct xccdf_policy * policy);
00420 
00427 struct xccdf_item * xccdf_policy_tailor_item(struct xccdf_policy * policy, struct xccdf_item * item);
00428 
00434 struct oscap_stringlist * xccdf_policy_model_get_files(struct xccdf_policy_model * policy_model);
00435 
00436 /************************************************************/
00439 /************************************************************/
00449 bool xccdf_policy_iterator_has_more(struct xccdf_policy_iterator *it);
00450 
00455 struct xccdf_policy * xccdf_policy_iterator_next(struct xccdf_policy_iterator *it);
00456 
00461 void xccdf_policy_iterator_free(struct xccdf_policy_iterator *it);
00462 
00467 void xccdf_policy_iterator_reset(struct xccdf_policy_iterator *it);
00468 
00473 bool xccdf_value_binding_iterator_has_more(struct xccdf_value_binding_iterator *it);
00474 
00479 struct xccdf_value_binding * xccdf_value_binding_iterator_next(struct xccdf_value_binding_iterator *it);
00480 
00485 void xccdf_value_binding_iterator_free(struct xccdf_value_binding_iterator *it);
00486 
00491 void xccdf_value_binding_iterator_reset(struct xccdf_value_binding_iterator *it);
00492 
00500 struct xccdf_score * xccdf_policy_get_score(struct xccdf_policy * policy, struct xccdf_result * test_result, const char * system);
00501 
00502 /************************************************************/
00505 /*
00506  * @}
00507  */
00508 #endif
00509 
00510 

Generated on Tue Sep 14 2010 for Open SCAP Library by  doxygen 1.7.1