| 1 | /** |
| 2 | * @file oval_results_impl.h |
| 3 | * \brief Open Vulnerability and Assessment Language |
| 4 | * |
| 5 | * See more details at http://oval.mitre.org/ |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Copyright 2009--2013 Red Hat Inc., Durham, North Carolina. |
| 10 | * All Rights Reserved. |
| 11 | * |
| 12 | * This library is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU Lesser General Public |
| 14 | * License as published by the Free Software Foundation; either |
| 15 | * version 2.1 of the License, or (at your option) any later version. |
| 16 | * |
| 17 | * This library is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 20 | * Lesser General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU Lesser General Public |
| 23 | * License along with this library; if not, write to the Free Software |
| 24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 25 | * |
| 26 | * Authors: |
| 27 | * "David Niemoller" <[email protected]> |
| 28 | * Šimon Lukašík |
| 29 | */ |
| 30 | |
| 31 | #ifndef OVAL_RESULTS_IMPL_H_ |
| 32 | #define OVAL_RESULTS_IMPL_H_ |
| 33 | |
| 34 | #include "oval_results.h" |
| 35 | |
| 36 | #include "OVAL/oval_definitions_impl.h" |
| 37 | #include "OVAL/oval_system_characteristics_impl.h" |
| 38 | #include "OVAL/adt/oval_smc_impl.h" |
| 39 | |
| 40 | #include "common/list.h" |
| 41 | #include "common/util.h" |
| 42 | #include "source/oscap_source_priv.h" |
| 43 | |
| 44 | |
| 45 | int oval_result_system_parse_tag(xmlTextReaderPtr, struct oval_parser_context *, void *); |
| 46 | xmlNode *oval_result_system_to_dom(struct oval_result_system *, struct oval_results_model *, struct oval_directives_model *, xmlDocPtr, xmlNode *); |
| 47 | |
| 48 | struct oval_result_test *oval_result_system_get_new_test(struct oval_result_system *, struct oval_test *, int variable_instance); |
| 49 | |
| 50 | int oval_result_definition_parse_tag(xmlTextReaderPtr, struct oval_parser_context *, void *); |
| 51 | struct oval_result_definition *make_result_definition_from_oval_definition( |
| 52 | struct oval_result_system *, struct oval_definition *, |
| 53 | struct oscap_list *, int variable_instance); |
| 54 | xmlNode *oval_result_definition_to_dom(struct oval_result_definition *, oval_result_directive_content_t, xmlDocPtr, xmlNode *); |
| 55 | int oval_result_definition_get_variable_instance_hint(const struct oval_result_definition *definition); |
| 56 | void oval_result_definition_set_variable_instance_hint(struct oval_result_definition *definition, int new_hint_value); |
| 57 | |
| 58 | struct oval_result_test *make_result_test_from_oval_test(struct oval_result_system *system, struct oval_test *oval_test, int variable_instance); |
| 59 | |
| 60 | int oval_result_test_parse_tag(xmlTextReaderPtr, struct oval_parser_context *, void *); |
| 61 | xmlNode *oval_result_test_to_dom(struct oval_result_test *, xmlDocPtr, xmlNode *); |
| 62 | |
| 63 | |
| 64 | int oval_result_item_parse_tag(xmlTextReaderPtr, struct oval_parser_context *, struct oval_result_system *, oscap_consumer_func, void *); |
| 65 | xmlNode *oval_result_item_to_dom(struct oval_result_item *, xmlDocPtr, xmlNode *); |
| 66 | |
| 67 | struct oval_result_criteria_node *make_result_criteria_node_from_oval_criteria_node(struct oval_result_system *, struct oval_criteria_node *, struct oscap_list *, int variable_instance); |
| 68 | |
| 69 | int oval_result_criteria_node_parse(xmlTextReaderPtr, struct oval_parser_context *, struct oval_result_system *, oscap_consumer_func, void *); |
| 70 | oval_result_t oval_result_criteria_node_negate(struct oval_result_criteria_node *node, oval_result_t result); |
| 71 | xmlNode *oval_result_criteria_node_to_dom(struct oval_result_criteria_node *, xmlDocPtr, xmlNode *); |
| 72 | |
| 73 | oval_result_t oval_result_parse(xmlTextReaderPtr, char *, oval_result_t); |
| 74 | |
| 75 | struct oval_result_definition *oval_result_system_get_new_definition(struct oval_result_system *, |
| 76 | struct oval_definition *, |
| 77 | int variable_instance); |
| 78 | struct oval_result_definition *oval_result_system_get_new_definition_with_check(struct oval_result_system *, struct oval_definition *, struct oscap_list *, int); |
| 79 | |
| 80 | struct oval_result_test *oval_result_system_get_test(struct oval_result_system *, char *); |
| 81 | |
| 82 | struct oresults { |
| 83 | int true_cnt; |
| 84 | int false_cnt; |
| 85 | int unknown_cnt; |
| 86 | int error_cnt; |
| 87 | int noteval_cnt; |
| 88 | int notappl_cnt; |
| 89 | }; |
| 90 | |
| 91 | int ores_add_res(struct oresults *ores, oval_result_t res); |
| 92 | void ores_clear(struct oresults *ores); |
| 93 | oval_result_t ores_get_result_bychk(struct oresults *ores, oval_check_t check); |
| 94 | oval_result_t ores_get_result_byopr(struct oresults *ores, oval_operator_t op); |
| 95 | |
| 96 | #if defined(OVAL_PROBES_ENABLED) |
| 97 | struct oval_results_model *oval_results_model_new_with_probe_session(struct oval_definition_model *definition_model, struct oval_syschar_model **syschar_models, struct oval_probe_session *probe_session); |
| 98 | #endif |
| 99 | struct oval_probe_session *oval_results_model_get_probe_session(struct oval_results_model *model); |
| 100 | void oval_results_model_add_system(struct oval_results_model *, struct oval_result_system *); |
| 101 | |
| 102 | struct oval_result_definition_iterator *oval_result_definition_iterator_new(struct oval_smc *mapping); |
| 103 | struct oval_result_test_iterator *oval_result_test_iterator_new(struct oval_smc *mapping); |
| 104 | |
| 105 | const char *oval_result_test_get_id(const struct oval_result_test *test); |
| 106 | |
| 107 | |
| 108 | struct oval_result_definition *oval_result_system_prepare_definition(struct oval_result_system *sys, const char *id); |
| 109 | |
| 110 | |
| 111 | #endif /* OVAL_RESULTS_IMPL_H_ */ |