Debian Codegraph @

src/OVAL/oval_sys_parser.c

raw symbols SCIP
1 /**
2 * @file oval_parser.c
3 * \brief Open Vulnerability and Assessment Language
4 *
5 * See more details at http://oval.mitre.org/
6 */
7
8 /*
9 * Copyright 2011 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 * "Peter Vrabec" <[email protected]
28 * "David Niemoller" <[email protected]>
29 */
30
31 #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`!
32 #include <config.h>cxx . . $ `<file>/build/config.h`/
33 #endif
34
35 #include <string.h>
36 #include <libxml/xmlreader.h>
37 #include <stddef.h>
38
39 #include "public/oval_agent_api.h"cxx . . $ `<file>/src/OVAL/public/oval_agent_api.h`/
40 #include "oval_agent_api_impl.h"cxx . . $ `<file>/src/OVAL/oval_agent_api_impl.h`/
41 #include "oval_parser_impl.h"cxx . . $ `<file>/src/OVAL/oval_parser_impl.h`/
42 #include "oval_definitions_impl.h"cxx . . $ `<file>/src/OVAL/oval_definitions_impl.h`/
43 #include "oval_system_characteristics_impl.h"cxx . . $ `<file>/src/OVAL/oval_system_characteristics_impl.h`/
44 #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/
45 #include "common/elements.h"cxx . . $ `<file>/src/common/elements.h`/
46 #include "common/debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/
47 #include "common/_error.h"cxx . . $ `<file>/src/common/_error.h`/
48
49 int oval_syschar_model_parsecxx . . $ oval_syschar_model_parse(b61d4daae99e998a).(xmlTextReaderPtrcxx . . $ xmlTextReaderPtr# reader, struct oval_parser_contextcxx . . $ oval_parser_context# *context)
50 {
51 int depth = xmlTextReaderDepthcxx . . $ xmlTextReaderDepth(82a242a19623f75).(reader);
52 int ret = 0;
53
54 xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(reader);
55 while ((xmlTextReaderDepthcxx . . $ xmlTextReaderDepth(82a242a19623f75).(reader) > depth) && (ret != -1 )) {
56 if (xmlTextReaderNodeTypecxx . . $ xmlTextReaderNodeType(82a242a19623f75).(reader) == XML_READER_TYPE_ELEMENTcxx . . $ XML_READER_TYPE_ELEMENT.) {
57 char *tagname = (char *)xmlTextReaderLocalNamecxx . . $ xmlTextReaderLocalName(3322afb275581432).(reader);
58 char *namespace = (char *)xmlTextReaderNamespaceUricxx . . $ xmlTextReaderNamespaceUri(3322afb275581432).(reader);
59
60 int is_ovalsys = 0;
61 if (namespace != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
62 is_ovalsys = strcmpcxx . . $ strcmp(5ae29d726ae57f88).((const char*)OVAL_SYSCHAR_NAMESPACEcxx . . $ `src/OVAL/oval_agent_api_impl.h:43:9`!, namespace) == 0;
63 }
64 if (is_ovalsys && (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(tagname, "generator") == 0)) {
65 struct oval_generatorcxx . . $ oval_generator# *gen;
66 gen = oval_syschar_model_get_generatorcxx . . $ oval_syschar_model_get_generator(21029f2f75a872d9).(context->syschar_modelcxx . . $ oval_parser_context#syschar_model.);
67 ret = oval_parser_parse_tagcxx . . $ oval_parser_parse_tag(4eaaf867ce26f59b).(reader, context, &oval_generator_parse_tagcxx . . $ oval_generator_parse_tag(cf369959597901d1)., gen);
68 } else if (is_ovalsys && (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(tagname, "system_info") == 0)) {
69 ret = oval_sysinfo_parse_tagcxx . . $ oval_sysinfo_parse_tag(b61d4daae99e998a).(reader, context);
70 } else if (is_ovalsys && (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(tagname, "collected_objects") == 0)) {
71 ret = oval_parser_parse_tagcxx . . $ oval_parser_parse_tag(4eaaf867ce26f59b).(reader, context, &oval_syschar_parse_tagcxx . . $ oval_syschar_parse_tag(cf369959597901d1)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
72 } else if (is_ovalsys && (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(tagname, "system_data") == 0)) {
73 ret = oval_parser_parse_tagcxx . . $ oval_parser_parse_tag(4eaaf867ce26f59b).(reader, context, &oval_sysitem_parse_tagcxx . . $ oval_sysitem_parse_tag(cf369959597901d1)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
74 } else {
75 dWcxx . . $ `src/common/debug_priv.h:62:9`!("Unprocessed tag: <%s:%s>.", namespace, tagname);
76 oval_parser_skip_tagcxx . . $ oval_parser_skip_tag(b61d4daae99e998a).(reader, context);
77 }
78
79 freecxx . . $ free(5d22bdacc48458e8).(tagname);
80 freecxx . . $ free(5d22bdacc48458e8).(namespace);
81 } else {
82 if (xmlTextReaderReadcxx . . $ xmlTextReaderRead(82a242a19623f75).(reader) != 1) {
83 ret = -1;
84 break;
85 }
86 }
87 }
88
89 return ret;
90 }
91