| 1 | /** |
| 2 | * @file cpelang_priv.h |
| 3 | * \brief Interface to Common Platform Enumeration (CPE) Language. |
| 4 | * |
| 5 | * See more details at http://nvd.nist.gov/cpe.cfm |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Copyright 2009 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 | * Maros Barabas <[email protected]> |
| 28 | */ |
| 29 | |
| 30 | #ifndef CPELANG_PRIV_H_ |
| 31 | #define CPELANG_PRIV_H_cxx . . $ `src/CPE/cpelang_priv.h:31:9`! |
| 32 | |
| 33 | #include <libxml/xmlreader.h> |
| 34 | #include <libxml/xmlwriter.h> |
| 35 | |
| 36 | #include "cpe_lang.h"cxx . . $ `<file>/src/CPE/public/cpe_lang.h`/ |
| 37 | #include "../common/util.h"cxx . . $ `<file>/src/common/util.h`/ |
| 38 | #include "../common/list.h"cxx . . $ `<file>/src/common/list.h`/ |
| 39 | #include "../common/elements.h"cxx . . $ `<file>/src/common/elements.h`/ |
| 40 | #include "../common/public/oscap.h"cxx . . $ `<file>/src/common/public/oscap.h`/ |
| 41 | |
| 42 | /** |
| 43 | * @cond INTERNAL |
| 44 | */ |
| 45 | /* @endcond */ |
| 46 | |
| 47 | /** |
| 48 | * @struct cpe_testexpr |
| 49 | * CPE language boolean expression |
| 50 | */ |
| 51 | struct cpe_testexprcxx . . $ cpe_testexpr# { |
| 52 | cpe_lang_oper_tcxx . . $ cpe_lang_oper_t# opercxx . . $ cpe_testexpr#oper.; ///< operator |
| 53 | unioncxx . . $ cpe_testexpr#$anonymous_type_0# { |
| 54 | struct oscap_listcxx . . $ oscap_list# *exprcxx . . $ cpe_testexpr#$anonymous_type_0#expr.; ///< array of subexpressions for operators |
| 55 | struct cpe_namecxx . . $ cpe_name# *cpecxx . . $ cpe_testexpr#$anonymous_type_0#cpe.; ///< CPE for match operation |
| 56 | structcxx . . $ cpe_testexpr#$anonymous_type_0#$anonymous_type_1# { |
| 57 | char* systemcxx . . $ cpe_testexpr#$anonymous_type_0#$anonymous_type_1#system.; |
| 58 | char* hrefcxx . . $ cpe_testexpr#$anonymous_type_0#$anonymous_type_1#href.; |
| 59 | char* idcxx . . $ cpe_testexpr#$anonymous_type_0#$anonymous_type_1#id.; |
| 60 | } checkcxx . . $ cpe_testexpr#$anonymous_type_0#check.; |
| 61 | } metacxx . . $ cpe_testexpr#meta.; ///< operation metadata |
| 62 | }; |
| 63 | |
| 64 | /** |
| 65 | * @struct cpe_lang_model |
| 66 | * CPE platform specification |
| 67 | */ |
| 68 | struct cpe_lang_modelcxx . . $ cpe_lang_model#; |
| 69 | |
| 70 | /** |
| 71 | * @struct cpe_platform |
| 72 | * Single platform representation in CPE language |
| 73 | */ |
| 74 | struct cpe_platformcxx . . $ cpe_platform#; |
| 75 | |
| 76 | /** |
| 77 | * Parse function for CPE Lang model |
| 78 | * @param reader xmlTextReaderPtr structure representing XML model |
| 79 | */ |
| 80 | struct cpe_lang_modelcxx . . $ cpe_lang_model# *cpe_lang_model_parsecxx . . $ cpe_lang_model_parse(8447744a0d5bc150).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader); |
| 81 | |
| 82 | /** |
| 83 | * Parse CPE platform structure |
| 84 | * @param reader xmlTextReaderPtr structure representing XML model |
| 85 | * @return cpe_platform structure with CPE platform item |
| 86 | */ |
| 87 | struct cpe_platformcxx . . $ cpe_platform# *cpe_platform_parsecxx . . $ cpe_platform_parse(e96662308652b494).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader); |
| 88 | |
| 89 | /** |
| 90 | * Parse CPE test expression structure |
| 91 | * @param reader xmlTextReaderPtr structure representing XML model |
| 92 | * @return cpe_testexpr structure with CPE test expression item |
| 93 | */ |
| 94 | struct cpe_testexprcxx . . $ cpe_testexpr# *cpe_testexpr_parsecxx . . $ cpe_testexpr_parse(1189dc68a4608772).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader); |
| 95 | |
| 96 | /** |
| 97 | * Function for export CPE language model to XML |
| 98 | * @param spec CPE language model structure |
| 99 | * @param file filename |
| 100 | */ |
| 101 | void cpe_lang_model_export_xmlcxx . . $ cpe_lang_model_export_xml(4858f5190288acad).(const struct cpe_lang_modelcxx . . $ cpe_lang_model# *spec, const char *file); |
| 102 | |
| 103 | /** |
| 104 | * Function for export CPE language top element |
| 105 | * @param writer xmlTextWriterPtr structure representing XML model |
| 106 | * @param spec CPE language model structure |
| 107 | */ |
| 108 | void cpe_lang_exportcxx . . $ cpe_lang_export(9a8ebb3e231da47).(const struct cpe_lang_modelcxx . . $ cpe_lang_model# *spec, xmlTextWriterPtrcxx . . $ xmlTextWriterPtr# writer); |
| 109 | |
| 110 | /** |
| 111 | * Function for export CPE platform element |
| 112 | * @param writer xmlTextWriterPtr structure representing XML model |
| 113 | * @param platform CPE platform structure |
| 114 | */ |
| 115 | void cpe_platform_exportcxx . . $ cpe_platform_export(4938b6f729357114).(const struct cpe_platformcxx . . $ cpe_platform# *platform, xmlTextWriterPtrcxx . . $ xmlTextWriterPtr# writer); |
| 116 | |
| 117 | /** |
| 118 | * Function for export CPE test expression element |
| 119 | * @param writer xmlTextWriterPtr structure representing XML model |
| 120 | * @param expr CPE test expression structure |
| 121 | */ |
| 122 | void cpe_testexpr_exportcxx . . $ cpe_testexpr_export(e58d3713c3eab562).(const struct cpe_testexprcxx . . $ cpe_testexpr# *expr, xmlTextWriterPtrcxx . . $ xmlTextWriterPtr# writer); |
| 123 | |
| 124 | char *cpe_lang_model_detect_version_privcxx . . $ cpe_lang_model_detect_version_priv(93c99f8009311dd0).(xmlTextReadercxx . . $ xmlTextReader# *reader); |
| 125 | |
| 126 | /** |
| 127 | * Sets the origin file hint |
| 128 | * @see cpe_lang_model_get_origin_file |
| 129 | */ |
| 130 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! cpe_lang_model_set_origin_filecxx . . $ cpe_lang_model_set_origin_file(fd8b5c7adb9a0def).(struct cpe_lang_modelcxx . . $ cpe_lang_model#* lang_model, const char* origin_file); |
| 131 | |
| 132 | /** |
| 133 | * Gets the file the CPE dict model was loaded from |
| 134 | * This is necessary to figure out the full OVAL file path for applicability |
| 135 | * testing. We can't do applicability here in the CPE module because that |
| 136 | * would create awful interdependencies. |
| 137 | */ |
| 138 | const char* cpe_lang_model_get_origin_filecxx . . $ cpe_lang_model_get_origin_file(45dc8957713def91).(const struct cpe_lang_modelcxx . . $ cpe_lang_model#* lang_model); |
| 139 | |
| 140 | |
| 141 | /** |
| 142 | * @cond INTERNAL |
| 143 | */ |
| 144 | /* @endcond */ |
| 145 | |
| 146 | #endif |