Open SCAP Library
cce.h
Go to the documentation of this file.
1 
8 /*
9  * Copyright 2008-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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  * Authors:
27  * Lukas Kuklinek <lkuklinek@redhat.com>
28  * Riley C. Porter <Riley.Porter@g2-inc.com>
29  */
30 
31 #include <stdbool.h>
32 #include "oscap.h"
33 #include "oscap_export.h"
34 
35 #ifndef _CCE_H
36 #define _CCE_H
37 
42 struct cce;
43 
48 struct cce_entry;
49 
54 struct cce_reference;
55 
56 /************************************************************/
68 OSCAP_API struct cce_entry_iterator *cce_get_entries(const struct cce *cce);
69 
75 OSCAP_API struct cce_entry *cce_get_entry(const struct cce *cce, const char *id);
76 
81 OSCAP_API const char *cce_entry_get_id(const struct cce_entry *cce);
82 
87 OSCAP_API const char *cce_entry_get_description(const struct cce_entry *cce);
88 
93 OSCAP_API struct oscap_string_iterator *cce_entry_get_params(const struct cce_entry *cce);
94 
99 OSCAP_API struct oscap_string_iterator *cce_entry_get_tech_mechs(const struct cce_entry *cce);
100 
105 OSCAP_API struct cce_reference_iterator *cce_entry_get_references(const struct cce_entry *cce);
106 
111 OSCAP_API const char *cce_reference_get_source(const struct cce_reference *ref);
112 
117 OSCAP_API const char *cce_reference_get_value(const struct cce_reference *ref);
118 
119 /************************************************************/
122 /************************************************************/
139 OSCAP_API void cce_reference_iterator_free(struct cce_reference_iterator *it);
141 OSCAP_API void cce_reference_iterator_reset(struct cce_reference_iterator *it);
142 
148 struct cce_entry_iterator;
150 OSCAP_API struct cce_entry *cce_entry_iterator_next(struct cce_entry_iterator *it);
152 OSCAP_API bool cce_entry_iterator_has_more(struct cce_entry_iterator *it);
154 OSCAP_API void cce_entry_iterator_free(struct cce_entry_iterator *it);
156 OSCAP_API void cce_entry_iterator_reset(struct cce_entry_iterator *it);
157 
158 /************************************************************/
167 OSCAP_API struct cce *cce_new(const char *fname);
168 
175 OSCAP_API void cce_free(struct cce *cce);
176 
177 /************************************************************/
189 OSCAP_API bool cce_validate(const char *filename);
190 
196 OSCAP_API const char * cce_supported(void);
197 
198 /************************************************************/
203 #endif
Structure holding a CCE reference.
Definition: cce_priv.h:54
OSCAP_API struct cce_entry * cce_get_entry(const struct cce *cce, const char *id)
Get an CCE entry by ID.
OSCAP_API const char * cce_reference_get_value(const struct cce_reference *ref)
Get contents of CCE reference.
General OpenScap functions and types.
OSCAP_API bool cce_entry_iterator_has_more(struct cce_entry_iterator *it)
OSCAP_API struct cce_reference * cce_reference_iterator_next(struct cce_reference_iterator *it)
Structure holding CCE entries.
Definition: cce_priv.h:41
OSCAP_API bool cce_reference_iterator_has_more(struct cce_reference_iterator *it)
OSCAP_API struct cce * cce_new(const char *fname)
Create a new CCE structure from XML file.
Definition: cce.c:99
OSCAP_API const char * cce_supported(void)
Get supported version of CCE XML.
Definition: cce.c:106
OSCAP_API struct cce_entry * cce_entry_iterator_next(struct cce_entry_iterator *it)
Iterator over CCE entries.
Iterator over CCE references.
OSCAP_API const char * cce_entry_get_id(const struct cce_entry *cce)
Get CCE entry ID.
Structure holding single CCE entry data.
Definition: cce_priv.h:46
OSCAP_API bool cce_validate(const char *filename)
Vlaidate CCE XML file.
Definition: cce.c:111
OSCAP_API void cce_reference_iterator_reset(struct cce_reference_iterator *it)
OSCAP_API void cce_entry_iterator_free(struct cce_entry_iterator *it)
OSCAP_API struct oscap_string_iterator * cce_entry_get_params(const struct cce_entry *cce)
Get an iterator to CCE entry&#39;s parameters.
OSCAP_API const char * cce_entry_get_description(const struct cce_entry *cce)
Get CCE entry desription.
OSCAP_API struct cce_reference_iterator * cce_entry_get_references(const struct cce_entry *cce)
Get an iterator to CCE entry&#39;s references.
OSCAP_API struct oscap_string_iterator * cce_entry_get_tech_mechs(const struct cce_entry *cce)
Get an iterator to CCE entry&#39;s technical mechanisms.
OSCAP_API void cce_free(struct cce *cce)
CCE structure destructor.
Definition: cce.c:53
String iterator.
OSCAP_API void cce_reference_iterator_free(struct cce_reference_iterator *it)
OSCAP_API const char * cce_reference_get_source(const struct cce_reference *ref)
Get source of CCE reference.
OSCAP_API void cce_entry_iterator_reset(struct cce_entry_iterator *it)
OSCAP_API struct cce_entry_iterator * cce_get_entries(const struct cce *cce)
Get an iterator to the contents of the CCE.