| cpe_dict.h | | cpe_dict.h | |
| | | | |
| skipping to change at line 39 | | skipping to change at line 39 | |
| * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A | |
| * | | * | |
| * Authors: | | * Authors: | |
| * Maros Barabas <mbarabas@redhat.com> | | * Maros Barabas <mbarabas@redhat.com> | |
| * Lukas Kuklinek <lkuklinek@redhat.com> | | * Lukas Kuklinek <lkuklinek@redhat.com> | |
| */ | | */ | |
| | | | |
| #ifndef CPEDICT_H_ | | #ifndef CPEDICT_H_ | |
| #define CPEDICT_H_ | | #define CPEDICT_H_ | |
| | | | |
|
| #include "cpe_uri.h" | | #include "cpe_name.h" | |
| #include "oscap.h" | | #include "oscap_text.h" | |
| | | | |
| /** | | /** | |
| * @struct cpe_dict_model | | * @struct cpe_dict_model | |
| * Structure representing a CPE dictionary. | | * Structure representing a CPE dictionary. | |
| */ | | */ | |
| struct cpe_dict_model; | | struct cpe_dict_model; | |
| | | | |
| /** | | /** | |
| * @struct cpe_item | | * @struct cpe_item | |
| * Structure representing single CPE dictionary item. | | * Structure representing single CPE dictionary item. | |
| | | | |
| skipping to change at line 244 | | skipping to change at line 244 | |
| * @param item document generator | | * @param item document generator | |
| */ | | */ | |
| const char *cpe_generator_get_schema_version(const struct cpe_generator *it
em); | | const char *cpe_generator_get_schema_version(const struct cpe_generator *it
em); | |
| | | | |
| /** cpe_generator functions to get timestamp from generator | | /** cpe_generator functions to get timestamp from generator | |
| * @memberof cpe_generator | | * @memberof cpe_generator | |
| * @param item document generator | | * @param item document generator | |
| */ | | */ | |
| const char *cpe_generator_get_timestamp(const struct cpe_generator *item); | | const char *cpe_generator_get_timestamp(const struct cpe_generator *item); | |
| | | | |
|
| | | /** cpe_dict_model functions to get the base version from CPE dictionary mo | |
| | | del | |
| | | * | |
| | | * The base version is the major CPE version, 1 or 2. These two versions di | |
| | | ffer | |
| | | * in namespace when exporting so we have to remember which version we load | |
| | | ed. | |
| | | * | |
| | | * CPE 1.0 also doesn't have cpe_generator structure inside so we can't get | |
| | | * the version info from there. | |
| | | * | |
| | | * @memberof cpe_dict_model | |
| | | * @param item dictionary model | |
| | | */ | |
| | | int cpe_dict_model_get_base_version(const struct cpe_dict_model *item); | |
| | | | |
| | | /** cpe_dict_model functions to get the base version from CPE dictionary mo | |
| | | del | |
| | | * @memberof cpe_dict_model | |
| | | * @param item dictionary model | |
| | | */ | |
| | | bool cpe_dict_model_set_base_version(struct cpe_dict_model *item, int base_ | |
| | | version); | |
| | | | |
| /** cpe_dict_model functions to get generator from CPE dictionary model | | /** cpe_dict_model functions to get generator from CPE dictionary model | |
| * @memberof cpe_dict_model | | * @memberof cpe_dict_model | |
| * @memberof cpe_generator | | * @memberof cpe_generator | |
| * @param item dictionary model | | * @param item dictionary model | |
| */ | | */ | |
| struct cpe_generator *cpe_dict_model_get_generator(const struct cpe_dict_mo
del *item); | | struct cpe_generator *cpe_dict_model_get_generator(const struct cpe_dict_mo
del *item); | |
| | | | |
| /** cpe_dict_model functions to get CPE items | | /** cpe_dict_model functions to get CPE items | |
| * @memberof cpe_dict_model | | * @memberof cpe_dict_model | |
| * @param item dictionary model | | * @param item dictionary model | |
| | | | |
| skipping to change at line 311 | | skipping to change at line 330 | |
| * @memberof cpe_version | | * @memberof cpe_version | |
| * @param item cpe_version | | * @param item cpe_version | |
| */ | | */ | |
| const char *cpe_version_get_value(const struct cpe_version *item); | | const char *cpe_version_get_value(const struct cpe_version *item); | |
| | | | |
| /** cpe_version functions to get value of version | | /** cpe_version functions to get value of version | |
| * @memberof cpe_version | | * @memberof cpe_version | |
| * @memberof cpe_update | | * @memberof cpe_update | |
| * @param item cpe_version | | * @param item cpe_version | |
| */ | | */ | |
|
| struct cpe_update_iterator *cpe_version_get_updates(const struct cpe_versio
n *items); | | struct cpe_update_iterator *cpe_version_get_updates(const struct cpe_versio
n *item); | |
| | | | |
| /** cpe_update functions to get updates of version | | /** cpe_update functions to get updates of version | |
| * @memberof cpe_update | | * @memberof cpe_update | |
| * @param item | | * @param item | |
| */ | | */ | |
| const char *cpe_update_get_value(const struct cpe_update *item); | | const char *cpe_update_get_value(const struct cpe_update *item); | |
| | | | |
| /** cpe_update functions to get editions of update | | /** cpe_update functions to get editions of update | |
| * @memberof cpe_update | | * @memberof cpe_update | |
| * @memberof cpe_edition | | * @memberof cpe_edition | |
| * @param item cpe_update of product element | | * @param item cpe_update of product element | |
| */ | | */ | |
|
| struct cpe_edition_iterator *cpe_update_get_editions(const struct cpe_updat
e *items); | | struct cpe_edition_iterator *cpe_update_get_editions(const struct cpe_updat
e *item); | |
| | | | |
| /** cpe_edition functions to get value of edition | | /** cpe_edition functions to get value of edition | |
| * @memberof cpe_edition | | * @memberof cpe_edition | |
| * @param item cpe_edition of update | | * @param item cpe_edition of update | |
| */ | | */ | |
| const char *cpe_edition_get_value(const struct cpe_edition *item); | | const char *cpe_edition_get_value(const struct cpe_edition *item); | |
| | | | |
| /** cpe_edition functions to get languages of edition | | /** cpe_edition functions to get languages of edition | |
| * @memberof cpe_edition | | * @memberof cpe_edition | |
| * @memberof cpe_language | | * @memberof cpe_language | |
| * @param item cpe_edition of update | | * @param item cpe_edition of update | |
| */ | | */ | |
|
| struct cpe_language_iterator *cpe_edition_get_languages(const struct cpe_ed
ition *items); | | struct cpe_language_iterator *cpe_edition_get_languages(const struct cpe_ed
ition *item); | |
| | | | |
| /** cpe_language functions to get value of language | | /** cpe_language functions to get value of language | |
| * @memberof cpe_language | | * @memberof cpe_language | |
| * @param item language | | * @param item language | |
| */ | | */ | |
| const char *cpe_language_get_value(const struct cpe_language *item); | | const char *cpe_language_get_value(const struct cpe_language *item); | |
| | | | |
| /************************************************************/ | | /************************************************************/ | |
| /** @} End of Getters group */ | | /** @} End of Getters group */ | |
| | | | |
| | | | |
| skipping to change at line 857 | | skipping to change at line 876 | |
| /** | | /** | |
| * Verify if CPE given by string is known according to specified dictionary | | * Verify if CPE given by string is known according to specified dictionary | |
| * @memberof cpe_name | | * @memberof cpe_name | |
| * @memberof cpe_dict_model | | * @memberof cpe_dict_model | |
| * @param cpe CPE to verify | | * @param cpe CPE to verify | |
| * @param dict used CPE dictionary | | * @param dict used CPE dictionary | |
| * @return true if dictionary contains given CPE | | * @return true if dictionary contains given CPE | |
| */ | | */ | |
| bool cpe_name_match_dict_str(const char *cpe, struct cpe_dict_model *dict); | | bool cpe_name_match_dict_str(const char *cpe, struct cpe_dict_model *dict); | |
| | | | |
|
| | | typedef bool *(*cpe_check_fn) (const char*, const char*, void*); | |
| | | | |
| | | /** | |
| | | * Verify whether given CPE is applicable to current platform by evaluating | |
| | | checks associated with it | |
| | | * | |
| | | * @memberof cpe_name | |
| | | * @memberof cpe_dict_model | |
| | | * @param cpe CPE to verify | |
| | | * @param dict used CPE dictionary | |
| | | * @return true if dictionary contains given CPE and the CPE is applicable | |
| | | */ | |
| | | bool cpe_name_applicable_dict(struct cpe_name *cpe, struct cpe_dict_model * | |
| | | dict, cpe_check_fn cb, void* usr); | |
| | | | |
| | | /// @memberof cpe_item | |
| | | bool cpe_item_is_applicable(struct cpe_item* item, cpe_check_fn cb, void* u | |
| | | sr); | |
| | | | |
| /************************************************************/ | | /************************************************************/ | |
| /** @} End of Evaluators group */ | | /** @} End of Evaluators group */ | |
| | | | |
| /** | | /** | |
| * Write the dict_model to a file. | | * Write the dict_model to a file. | |
| * @param dict CPE Dict model | | * @param dict CPE Dict model | |
| * @memberof cpe_dict_model | | * @memberof cpe_dict_model | |
| */ | | */ | |
| void cpe_dict_model_export(const struct cpe_dict_model *dict, const char *f
ile); | | void cpe_dict_model_export(const struct cpe_dict_model *dict, const char *f
ile); | |
| | | | |
| /** | | /** | |
| * Load new CPE dictionary from file | | * Load new CPE dictionary from file | |
| * @memberof cpe_dict_model | | * @memberof cpe_dict_model | |
| * @param file filename | | * @param file filename | |
| * @return new dictionary | | * @return new dictionary | |
| * @retval NULL on failure | | * @retval NULL on failure | |
| */ | | */ | |
| struct cpe_dict_model *cpe_dict_model_import(const char *file); | | struct cpe_dict_model *cpe_dict_model_import(const char *file); | |
| | | | |
|
| | | /** | |
| | | * Gets the file the CPE dict model was loaded from | |
| | | * @internal | |
| | | * This is necessary to figure out the full OVAL file path for applicabilit | |
| | | y | |
| | | * testing. We can't do applicability here in the CPE module because that | |
| | | * would create awful interdependencies. | |
| | | */ | |
| | | const char* cpe_dict_model_get_origin_file(const struct cpe_dict_model* dic | |
| | | t); | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| #endif /* _CPEDICT_H_ */ | | #endif /* _CPEDICT_H_ */ | |
| | | | |
End of changes. 7 change blocks. |
| 5 lines changed or deleted | | 59 lines changed or added | |
|
| oscap.h | | oscap.h | |
| | | | |
| skipping to change at line 38 | | skipping to change at line 38 | |
| * | | * | |
| * @addtogroup COMMON | | * @addtogroup COMMON | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| #ifndef OSCAP_H_ | | #ifndef OSCAP_H_ | |
| #define OSCAP_H_ | | #define OSCAP_H_ | |
| #include <stdbool.h> | | #include <stdbool.h> | |
| #include <wchar.h> | | #include <wchar.h> | |
| | | | |
|
| #include "text.h" | | #include "oscap_text.h" | |
| #include "reference.h" | | #include "oscap_reference.h" | |
| #include "reporter.h" | | | |
| | | | |
| /** | | /** | |
| * This macro will warn, when a deprecated function is used. | | * This macro will warn, when a deprecated function is used. | |
| */ | | */ | |
| #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) | | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) | |
| # define OSCAP_DEPRECATED(func) func __attribute__ ((deprecated)) | | # define OSCAP_DEPRECATED(func) func __attribute__ ((deprecated)) | |
| #elif defined(_MSC_VER) | | #elif defined(_MSC_VER) | |
| # define OSCAP_DEPRECATED(func) __declspec(deprecated) func | | # define OSCAP_DEPRECATED(func) __declspec(deprecated) func | |
| #else | | #else | |
| # pragma message("WARNING: You need to implement OSCAP_DEPRECATED for this
compiler---in order to get deprecation warnings.") | | # pragma message("WARNING: You need to implement OSCAP_DEPRECATED for this
compiler---in order to get deprecation warnings.") | |
| | | | |
| skipping to change at line 98 | | skipping to change at line 97 | |
| OSCAP_DOCUMENT_OVAL_RESULTS, ///< OVAL results file | | OSCAP_DOCUMENT_OVAL_RESULTS, ///< OVAL results file | |
| OSCAP_DOCUMENT_OVAL_DIRECTIVES, ///< OVAL directives file | | OSCAP_DOCUMENT_OVAL_DIRECTIVES, ///< OVAL directives file | |
| OSCAP_DOCUMENT_XCCDF, ///< XCCDF benchmark file | | OSCAP_DOCUMENT_XCCDF, ///< XCCDF benchmark file | |
| OSCAP_DOCUMENT_CPE_LANGUAGE, ///< CPE language file | | OSCAP_DOCUMENT_CPE_LANGUAGE, ///< CPE language file | |
| OSCAP_DOCUMENT_CPE_DICTIONARY, ///< CPE dictionary file | | OSCAP_DOCUMENT_CPE_DICTIONARY, ///< CPE dictionary file | |
| OSCAP_DOCUMENT_SCE_RESULT, ///< SCE result file | | OSCAP_DOCUMENT_SCE_RESULT, ///< SCE result file | |
| OSCAP_DOCUMENT_SDS, ///< Source Data Stream file | | OSCAP_DOCUMENT_SDS, ///< Source Data Stream file | |
| OSCAP_DOCUMENT_ARF ///< Result Data Stream file | | OSCAP_DOCUMENT_ARF ///< Result Data Stream file | |
| } oscap_document_type_t; | | } oscap_document_type_t; | |
| | | | |
|
| | | typedef int (*xml_reporter)(const char *file, int line, const char *msg, vo | |
| | | id *arg); | |
| | | | |
| /** | | /** | |
| * Validate a SCAP document file against a XML schema. | | * Validate a SCAP document file against a XML schema. | |
| * | | * | |
| * Schemas are searched relative to path specified by the OSCAP_SCHEMA_PATH
environment variable. | | * Schemas are searched relative to path specified by the OSCAP_SCHEMA_PATH
environment variable. | |
| * If the variable does not exist a default path is used (usually something
like $PREFIX/share/openscap/schemas). | | * If the variable does not exist a default path is used (usually something
like $PREFIX/share/openscap/schemas). | |
| * | | * | |
| * Directory structure must adhere $SCHEMA_PATH/$STANDARD/$VERSION/$SCHEMAF
ILE.xsd structure, where $STANDARD | | * Directory structure must adhere $SCHEMA_PATH/$STANDARD/$VERSION/$SCHEMAF
ILE.xsd structure, where $STANDARD | |
| * is oval, xccdf, etc., and $VERSION is a version of the standard. | | * is oval, xccdf, etc., and $VERSION is a version of the standard. | |
| * | | * | |
| * @param xmlfile File to be validated. | | * @param xmlfile File to be validated. | |
| * @param doctype Document type represented by the file. | | * @param doctype Document type represented by the file. | |
| * @param version Version of the document, use NULL for library's default. | | * @param version Version of the document, use NULL for library's default. | |
| * @param reporetr A reporter to by notified of encountered issues. Can be
NULL, if a binary document validates / does not validate answer is satisfac
tonary. | | * @param reporetr A reporter to by notified of encountered issues. Can be
NULL, if a binary document validates / does not validate answer is satisfac
tonary. | |
| * @param arg Argument for the reporter. | | * @param arg Argument for the reporter. | |
| * @return 0 on pass; -1 error; 1 fail | | * @return 0 on pass; -1 error; 1 fail | |
| */ | | */ | |
|
| int oscap_validate_document(const char *xmlfile, oscap_document_type_t doct
ype, const char *version, oscap_reporter reporter, void *arg); | | int oscap_validate_document(const char *xmlfile, oscap_document_type_t doct
ype, const char *version, xml_reporter reporter, void *arg); | |
| | | | |
| /** | | /** | |
| * Validate a SCAP document file against schematron rules. | | * Validate a SCAP document file against schematron rules. | |
| * | | * | |
| * The rules are searched relative to path specified by the OSCAP_SCHEMA_PA
TH environment variable. | | * The rules are searched relative to path specified by the OSCAP_SCHEMA_PA
TH environment variable. | |
| * If the variable does not exist a default path is used (usually something
like $PREFIX/share/openscap/schemas). | | * If the variable does not exist a default path is used (usually something
like $PREFIX/share/openscap/schemas). | |
| * | | * | |
| * @param xmlfile File to be validated. | | * @param xmlfile File to be validated. | |
| * @param doctype Document type represented by the file. | | * @param doctype Document type represented by the file. | |
| * @param version Version of the document, use NULL for library's default. | | * @param version Version of the document, use NULL for library's default. | |
| | | | |
End of changes. 3 change blocks. |
| 4 lines changed or deleted | | 6 lines changed or added | |
|
| oval_agent_api.h | | oval_agent_api.h | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| */ | | */ | |
| | | | |
| #ifndef OVAL_AGENT_API_H_ | | #ifndef OVAL_AGENT_API_H_ | |
| #define OVAL_AGENT_API_H_ | | #define OVAL_AGENT_API_H_ | |
| | | | |
| #include "oval_definitions.h" | | #include "oval_definitions.h" | |
| #include "oval_system_characteristics.h" | | #include "oval_system_characteristics.h" | |
| #include "oval_results.h" | | #include "oval_results.h" | |
| #include "oval_variables.h" | | #include "oval_variables.h" | |
| #include "oval_probe.h" | | #include "oval_probe.h" | |
|
| #include "reporter.h" | | | |
| | | | |
| struct oval_agent_session; | | struct oval_agent_session; | |
| | | | |
| /** | | /** | |
| * @var oval_agent_session_t | | * @var oval_agent_session_t | |
| * Agent session consists of connection to system checking engine, | | * Agent session consists of connection to system checking engine, | |
| * definition model, system characteristics model and results model. | | * definition model, system characteristics model and results model. | |
| */ | | */ | |
| typedef struct oval_agent_session oval_agent_session_t; | | typedef struct oval_agent_session oval_agent_session_t; | |
| | | | |
| /** | | /** | |
| * Create new session for OVAL agent from OVAL definition model | | * Create new session for OVAL agent from OVAL definition model | |
| * @param model OVAL Definition model | | * @param model OVAL Definition model | |
| * @param name Name of file that can be referenced from XCCDF Benchmark | | * @param name Name of file that can be referenced from XCCDF Benchmark | |
| */ | | */ | |
| oval_agent_session_t * oval_agent_new_session(struct oval_definition_model
* model, const char * name); | | oval_agent_session_t * oval_agent_new_session(struct oval_definition_model
* model, const char * name); | |
| | | | |
| /** | | /** | |
|
| | | * Retrieves OVAL definition model associated with given session | |
| | | */ | |
| | | struct oval_definition_model* oval_agent_get_definition_model(oval_agent_se | |
| | | ssion_t* ag_sess); | |
| | | | |
| | | /** | |
| * Set a product name for the provided agent session. The | | * Set a product name for the provided agent session. The | |
| * product name should be used for all newly created OVAL documents. If | | * product name should be used for all newly created OVAL documents. If | |
| * there already are some models in the session, they are modified as | | * there already are some models in the session, they are modified as | |
| * well. | | * well. | |
| */ | | */ | |
| void oval_agent_set_product_name(oval_agent_session_t *, char *); | | void oval_agent_set_product_name(oval_agent_session_t *, char *); | |
| | | | |
| /** | | /** | |
| * Probe the system and evaluate specified definition | | * Probe the system and evaluate specified definition | |
| * @return 0 on success; -1 error; 1 warning | | * @return 0 on success; -1 error; 1 warning | |
| */ | | */ | |
| int oval_agent_eval_definition(oval_agent_session_t *, const char *); | | int oval_agent_eval_definition(oval_agent_session_t *, const char *); | |
| | | | |
| /** | | /** | |
| * Get the OVAL result of a definition from an agent session | | * Get the OVAL result of a definition from an agent session | |
| * @return 0 on success; -1 error | | * @return 0 on success; -1 error | |
| */ | | */ | |
| int oval_agent_get_definition_result(oval_agent_session_t *, const char *,
oval_result_t *); | | int oval_agent_get_definition_result(oval_agent_session_t *, const char *,
oval_result_t *); | |
| | | | |
| /** | | /** | |
|
| | | * Get the OVAL result definition from an agent session | |
| | | * @return NULL if not found | |
| | | */ | |
| | | struct oval_result_definition * oval_agent_get_result_definition(oval_agent | |
| | | _session_t *ag_sess, const char *id); | |
| | | | |
| | | /** | |
| * Clean resuls that were generated in this agent session | | * Clean resuls that were generated in this agent session | |
| */ | | */ | |
| int oval_agent_reset_session(oval_agent_session_t * ag_sess); | | int oval_agent_reset_session(oval_agent_session_t * ag_sess); | |
| | | | |
| /** | | /** | |
| * Abort a running probe session | | * Abort a running probe session | |
| */ | | */ | |
| int oval_agent_abort_session(oval_agent_session_t *ag_sess); | | int oval_agent_abort_session(oval_agent_session_t *ag_sess); | |
| | | | |
|
| | | typedef int (*agent_reporter)(const struct oval_result_definition * res_def | |
| | | , void *arg); | |
| | | | |
| /** | | /** | |
| * Probe and evaluate all definitions from the content, call the callback f
unctions upon single evaluation | | * Probe and evaluate all definitions from the content, call the callback f
unctions upon single evaluation | |
| * @return 0 on success; -1 error; 1 warning | | * @return 0 on success; -1 error; 1 warning | |
| */ | | */ | |
|
| int oval_agent_eval_system(oval_agent_session_t * ag_sess, oscap_reporter c
b, void *arg); | | int oval_agent_eval_system(oval_agent_session_t * ag_sess, agent_reporter c
b, void *arg); | |
| | | | |
| /** | | /** | |
| * Get a result model from agent session | | * Get a result model from agent session | |
| */ | | */ | |
| struct oval_results_model * oval_agent_get_results_model(oval_agent_session
_t * ag_sess); | | struct oval_results_model * oval_agent_get_results_model(oval_agent_session
_t * ag_sess); | |
| /** | | /** | |
| * Get a filename under which was created | | * Get a filename under which was created | |
| */ | | */ | |
| const char * oval_agent_get_filename(oval_agent_session_t * ag_sess); | | const char * oval_agent_get_filename(oval_agent_session_t * ag_sess); | |
| | | | |
| /** | | /** | |
| * Finish OVAL agent session | | * Finish OVAL agent session | |
| */ | | */ | |
| void oval_agent_destroy_session(oval_agent_session_t * ag_sess); | | void oval_agent_destroy_session(oval_agent_session_t * ag_sess); | |
| | | | |
| /** | | /** | |
|
| * @) END OVALDEF | | * @} END OVALDEF | |
| * @) END OVALAGENT | | * @} END OVALAGENT | |
| */ | | */ | |
| #endif /**OVAL_AGENT_API_H_ */ | | #endif /**OVAL_AGENT_API_H_ */ | |
| | | | |
End of changes. 6 change blocks. |
| 4 lines changed or deleted | | 19 lines changed or added | |
|
| oval_definitions.h | | oval_definitions.h | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| * Authors: | | * Authors: | |
| * "David Niemoller" <David.Niemoller@g2-inc.com> | | * "David Niemoller" <David.Niemoller@g2-inc.com> | |
| */ | | */ | |
| | | | |
| #ifndef OVAL_DEFINITIONS | | #ifndef OVAL_DEFINITIONS | |
| #define OVAL_DEFINITIONS | | #define OVAL_DEFINITIONS | |
| | | | |
| #include "oval_types.h" | | #include "oval_types.h" | |
| #include "oval_version.h" | | #include "oval_version.h" | |
| #include <stdbool.h> | | #include <stdbool.h> | |
|
| #include <libxml/tree.h> | | | |
| | | | |
| /** | | /** | |
| * Affected family enumeration. | | * Affected family enumeration. | |
| * Since new family values can only be added with new version of the schema
, | | * Since new family values can only be added with new version of the schema
, | |
| * the value OVAL_AFCFML_UNDEFINED is to be used when the desired family is
not available | | * the value OVAL_AFCFML_UNDEFINED is to be used when the desired family is
not available | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| OVAL_AFCFML_UNKNOWN = 0, | | OVAL_AFCFML_UNKNOWN = 0, | |
| OVAL_AFCFML_CATOS = 1, | | OVAL_AFCFML_CATOS = 1, | |
| OVAL_AFCFML_IOS = 2, | | OVAL_AFCFML_IOS = 2, | |
| | | | |
| skipping to change at line 211 | | skipping to change at line 210 | |
| OVAL_FUNCTION_BEGIN = OVAL_FUNCTION + 1, | | OVAL_FUNCTION_BEGIN = OVAL_FUNCTION + 1, | |
| OVAL_FUNCTION_CONCAT = OVAL_FUNCTION + 2, | | OVAL_FUNCTION_CONCAT = OVAL_FUNCTION + 2, | |
| OVAL_FUNCTION_END = OVAL_FUNCTION + 3, | | OVAL_FUNCTION_END = OVAL_FUNCTION + 3, | |
| OVAL_FUNCTION_SPLIT = OVAL_FUNCTION + 4, | | OVAL_FUNCTION_SPLIT = OVAL_FUNCTION + 4, | |
| OVAL_FUNCTION_SUBSTRING = OVAL_FUNCTION + 5, | | OVAL_FUNCTION_SUBSTRING = OVAL_FUNCTION + 5, | |
| OVAL_FUNCTION_TIMEDIF = OVAL_FUNCTION + 6, | | OVAL_FUNCTION_TIMEDIF = OVAL_FUNCTION + 6, | |
| OVAL_FUNCTION_ESCAPE_REGEX = OVAL_FUNCTION + 7, | | OVAL_FUNCTION_ESCAPE_REGEX = OVAL_FUNCTION + 7, | |
| OVAL_FUNCTION_REGEX_CAPTURE = OVAL_FUNCTION + 8, | | OVAL_FUNCTION_REGEX_CAPTURE = OVAL_FUNCTION + 8, | |
| OVAL_FUNCTION_ARITHMETIC = OVAL_FUNCTION + 9, | | OVAL_FUNCTION_ARITHMETIC = OVAL_FUNCTION + 9, | |
| OVAL_FUNCTION_COUNT = OVAL_FUNCTION + 10, | | OVAL_FUNCTION_COUNT = OVAL_FUNCTION + 10, | |
|
| OVAL_FUNCTION_LAST = OVAL_FUNCTION + 11 | | OVAL_FUNCTION_UNIQUE = OVAL_FUNCTION + 11, | |
| | | OVAL_FUNCTION_LAST = OVAL_FUNCTION + 12 | |
| } oval_component_type_t; | | } oval_component_type_t; | |
| | | | |
| /// Arithmetic format enumeration | | /// Arithmetic format enumeration | |
| typedef enum { | | typedef enum { | |
| OVAL_ARITHMETIC_UNKNOWN = 0, | | OVAL_ARITHMETIC_UNKNOWN = 0, | |
| OVAL_ARITHMETIC_ADD = 1, | | OVAL_ARITHMETIC_ADD = 1, | |
| OVAL_ARITHMETIC_MULTIPLY = 2, | | OVAL_ARITHMETIC_MULTIPLY = 2, | |
| OVAL_ARITHMETIC_SUBTRACT = 3, //NOT YET SUPPORTED BY OVAL | | OVAL_ARITHMETIC_SUBTRACT = 3, //NOT YET SUPPORTED BY OVAL | |
| OVAL_ARITHMETIC_DIVIDE = 4 //NOT YET SUPPORTED BY OVAL | | OVAL_ARITHMETIC_DIVIDE = 4 //NOT YET SUPPORTED BY OVAL | |
| } oval_arithmetic_operation_t; | | } oval_arithmetic_operation_t; | |
| | | | |
| skipping to change at line 3175 | | skipping to change at line 3175 | |
| */ | | */ | |
| int oval_string_iterator_remaining(struct oval_string_iterator *); | | int oval_string_iterator_remaining(struct oval_string_iterator *); | |
| /** | | /** | |
| * Frees the iterator. | | * Frees the iterator. | |
| * @memberof oval_string_iterator | | * @memberof oval_string_iterator | |
| */ | | */ | |
| void oval_string_iterator_free(struct oval_string_iterator *); | | void oval_string_iterator_free(struct oval_string_iterator *); | |
| /** @} */ | | /** @} */ | |
| | | | |
| /** | | /** | |
|
| * @) END OVALDEF | | * @} END OVALDEF | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * Returns the version of the schema this document should be validated agai
nst | | * Returns the version of the schema this document should be validated agai
nst | |
| * | | * | |
| * Deallocate the result after use with "free(..)". | | * Deallocate the result after use with "free(..)". | |
| */ | | */ | |
| char *oval_determine_document_schema_version(const char *, oscap_document_t
ype_t); | | char *oval_determine_document_schema_version(const char *, oscap_document_t
ype_t); | |
| | | | |
|
| | | /* | |
| | | * Find out OVAL docuemnt type | |
| | | * @param document | |
| | | * @doc_type indentified document | |
| | | * @return -1 if an error occurred | |
| | | */ | |
| | | int oval_determine_document_type(const char *document, oscap_document_type_ | |
| | | t *doc_type); | |
| /** | | /** | |
|
| * @) END OVAL | | * @} END OVAL | |
| */ | | */ | |
| #endif | | #endif | |
| | | | |
End of changes. 5 change blocks. |
| 4 lines changed or deleted | | 12 lines changed or added | |
|
| oval_types.h | | oval_types.h | |
| | | | |
| skipping to change at line 148 | | skipping to change at line 148 | |
| typedef enum { | | typedef enum { | |
| OVAL_CATOS_LINE = OVAL_FAMILY_CATOS + 1, | | OVAL_CATOS_LINE = OVAL_FAMILY_CATOS + 1, | |
| OVAL_CATOS_MODULE = OVAL_FAMILY_CATOS + 2, | | OVAL_CATOS_MODULE = OVAL_FAMILY_CATOS + 2, | |
| OVAL_CATOS_VERSION_55 = OVAL_FAMILY_CATOS + 3, | | OVAL_CATOS_VERSION_55 = OVAL_FAMILY_CATOS + 3, | |
| OVAL_CATOS_VERSION = OVAL_FAMILY_CATOS + 4 | | OVAL_CATOS_VERSION = OVAL_FAMILY_CATOS + 4 | |
| } oval_catos_subtype_t; | | } oval_catos_subtype_t; | |
| | | | |
| /// ESX subtypes | | /// ESX subtypes | |
| typedef enum { | | typedef enum { | |
| OVAL_ESX_PATCH = OVAL_FAMILY_ESX + 1, | | OVAL_ESX_PATCH = OVAL_FAMILY_ESX + 1, | |
|
| OVAL_ESX_VERSION = OVAL_FAMILY_ESX + 2 | | OVAL_ESX_PATCH56 = OVAL_FAMILY_ESX + 2, | |
| | | OVAL_ESX_VERSION = OVAL_FAMILY_ESX + 3, | |
| | | OVAL_ESX_VISDKMANAGEDOBJECT = OVAL_FAMILY_ESX + 4 | |
| } oval_esx_subtype_t; | | } oval_esx_subtype_t; | |
| | | | |
| /// FreeBSD subtypes | | /// FreeBSD subtypes | |
| typedef enum { | | typedef enum { | |
| OVAL_FREEBSD_PORT_INFO = OVAL_FAMILY_FREEBSD + 1 | | OVAL_FREEBSD_PORT_INFO = OVAL_FAMILY_FREEBSD + 1 | |
| } oval_freebsd_subtype_t; | | } oval_freebsd_subtype_t; | |
| | | | |
| /// HPUX subtypes | | /// HPUX subtypes | |
| typedef enum { | | typedef enum { | |
| OVAL_HPUX_GETCONF = OVAL_FAMILY_HPUX + 1, | | OVAL_HPUX_GETCONF = OVAL_FAMILY_HPUX + 1, | |
| OVAL_HPUX_PATCH_53 = OVAL_FAMILY_HPUX + 2, | | OVAL_HPUX_PATCH_53 = OVAL_FAMILY_HPUX + 2, | |
| OVAL_HPUX_PATCH = OVAL_FAMILY_HPUX + 3, | | OVAL_HPUX_PATCH = OVAL_FAMILY_HPUX + 3, | |
| OVAL_HPUX_SOFTWARE_LIST = OVAL_FAMILY_HPUX + 4, | | OVAL_HPUX_SOFTWARE_LIST = OVAL_FAMILY_HPUX + 4, | |
|
| OVAL_HPUX_TRUSTED_ACCOUNTS = OVAL_FAMILY_HPUX + 5 | | OVAL_HPUX_TRUSTED_ACCOUNTS = OVAL_FAMILY_HPUX + 5, | |
| | | OVAL_HPUX_NDD = OVAL_FAMILY_HPUX + 6, | |
| | | OVAL_HPUX_SWLIST = OVAL_FAMILY_HPUX + 7, | |
| | | OVAL_HPUX_TRUSTED = OVAL_FAMILY_HPUX + 8 | |
| } oval_hpux_subtype_t; | | } oval_hpux_subtype_t; | |
| | | | |
| /// Platform independent subtypes | | /// Platform independent subtypes | |
| typedef enum { | | typedef enum { | |
| OVAL_INDEPENDENT_FAMILY = OVAL_FAMILY_INDEPENDENT + 1, | | OVAL_INDEPENDENT_FAMILY = OVAL_FAMILY_INDEPENDENT + 1, | |
| OVAL_INDEPENDENT_FILE_MD5 = OVAL_FAMILY_INDEPENDENT + 2, | | OVAL_INDEPENDENT_FILE_MD5 = OVAL_FAMILY_INDEPENDENT + 2, | |
| OVAL_INDEPENDENT_FILE_HASH = OVAL_FAMILY_INDEPENDENT + 3, | | OVAL_INDEPENDENT_FILE_HASH = OVAL_FAMILY_INDEPENDENT + 3, | |
| OVAL_INDEPENDENT_ENVIRONMENT_VARIABLE = OVAL_FAMILY_INDEPENDENT + 4, | | OVAL_INDEPENDENT_ENVIRONMENT_VARIABLE = OVAL_FAMILY_INDEPENDENT + 4, | |
| OVAL_INDEPENDENT_SQL = OVAL_FAMILY_INDEPENDENT + 5, | | OVAL_INDEPENDENT_SQL = OVAL_FAMILY_INDEPENDENT + 5, | |
| OVAL_INDEPENDENT_TEXT_FILE_CONTENT_54 = OVAL_FAMILY_INDEPENDENT + 6, | | OVAL_INDEPENDENT_TEXT_FILE_CONTENT_54 = OVAL_FAMILY_INDEPENDENT + 6, | |
| | | | |
| skipping to change at line 229 | | skipping to change at line 234 | |
| typedef enum { | | typedef enum { | |
| OVAL_PIXOS_LINE = OVAL_FAMILY_PIXOS + 1, | | OVAL_PIXOS_LINE = OVAL_FAMILY_PIXOS + 1, | |
| OVAL_PIXOS_VERSION = OVAL_FAMILY_PIXOS + 2 | | OVAL_PIXOS_VERSION = OVAL_FAMILY_PIXOS + 2 | |
| } oval_pixos_subtype_t; | | } oval_pixos_subtype_t; | |
| | | | |
| /// Solaris subtypes | | /// Solaris subtypes | |
| typedef enum { | | typedef enum { | |
| OVAL_SOLARIS_ISAINFO = OVAL_FAMILY_SOLARIS + 1, | | OVAL_SOLARIS_ISAINFO = OVAL_FAMILY_SOLARIS + 1, | |
| OVAL_SOLARIS_PACKAGE = OVAL_FAMILY_SOLARIS + 2, | | OVAL_SOLARIS_PACKAGE = OVAL_FAMILY_SOLARIS + 2, | |
| OVAL_SOLARIS_PATCH = OVAL_FAMILY_SOLARIS + 3, | | OVAL_SOLARIS_PATCH = OVAL_FAMILY_SOLARIS + 3, | |
|
| OVAL_SOLARIS_SMF = OVAL_FAMILY_SOLARIS + 4 | | OVAL_SOLARIS_SMF = OVAL_FAMILY_SOLARIS + 4, | |
| | | OVAL_SOLARIS_PATCH54 = OVAL_FAMILY_SOLARIS + 5, | |
| | | OVAL_SOLARIS_NDD = OVAL_FAMILY_SOLARIS + 6, | |
| | | OVAL_SOLARIS_PACKAGECHECK = OVAL_FAMILY_SOLARIS + 7 | |
| } oval_solaris_subtype_t; | | } oval_solaris_subtype_t; | |
| | | | |
| /// Unix subtypes | | /// Unix subtypes | |
| typedef enum { | | typedef enum { | |
| OVAL_UNIX_FILE = OVAL_FAMILY_UNIX + 1, | | OVAL_UNIX_FILE = OVAL_FAMILY_UNIX + 1, | |
| OVAL_UNIX_INETD = OVAL_FAMILY_UNIX + 2, | | OVAL_UNIX_INETD = OVAL_FAMILY_UNIX + 2, | |
| OVAL_UNIX_INTERFACE = OVAL_FAMILY_UNIX + 3, | | OVAL_UNIX_INTERFACE = OVAL_FAMILY_UNIX + 3, | |
| OVAL_UNIX_PASSWORD = OVAL_FAMILY_UNIX + 4, | | OVAL_UNIX_PASSWORD = OVAL_FAMILY_UNIX + 4, | |
| OVAL_UNIX_PROCESS = OVAL_FAMILY_UNIX + 5, | | OVAL_UNIX_PROCESS = OVAL_FAMILY_UNIX + 5, | |
| OVAL_UNIX_RUNLEVEL = OVAL_FAMILY_UNIX + 6, | | OVAL_UNIX_RUNLEVEL = OVAL_FAMILY_UNIX + 6, | |
| | | | |
End of changes. 3 change blocks. |
| 3 lines changed or deleted | | 11 lines changed or added | |
|
| xccdf_benchmark.h | | xccdf_benchmark.h | |
| /** | | /** | |
| * @addtogroup XCCDF | | * @addtogroup XCCDF | |
| * @{ | | * @{ | |
| * | | * | |
|
| * @file xccdf.h | | * @file xccdf_benchmark.h | |
| * Open-scap XCCDF library interface. | | * Open-scap XCCDF library interface. | |
| * @author Lukas Kuklinek <lkuklinek@redhat.com> | | * @author Lukas Kuklinek <lkuklinek@redhat.com> | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| * Copyright 2009 Red Hat Inc., Durham, North Carolina. | | * Copyright 2009 Red Hat Inc., Durham, North Carolina. | |
| * Copyright (C) 2010 Tresys Technology, LLC | | * Copyright (C) 2010 Tresys Technology, LLC | |
| * All Rights Reserved. | | * All Rights Reserved. | |
| * | | * | |
| * This library is free software; you can redistribute it and/or | | * This library is free software; you can redistribute it and/or | |
| | | | |
| skipping to change at line 39 | | skipping to change at line 39 | |
| * Authors: | | * Authors: | |
| * Lukas Kuklinek <lkuklinek@redhat.com> | | * Lukas Kuklinek <lkuklinek@redhat.com> | |
| * Josh Adams <jadams@tresys.com> | | * Josh Adams <jadams@tresys.com> | |
| */ | | */ | |
| | | | |
| #ifndef XCCDF_H_ | | #ifndef XCCDF_H_ | |
| #define XCCDF_H_ | | #define XCCDF_H_ | |
| | | | |
| #include <stdbool.h> | | #include <stdbool.h> | |
| #include <time.h> | | #include <time.h> | |
|
| #include "oscap.h" | | #include <oscap_reference.h> | |
| | | #include <oscap.h> | |
| | | #include "cpe_dict.h" | |
| | | | |
| /*--------------------*\ | | /*--------------------*\ | |
| | Enumerations | | | | Enumerations | | |
| \*--------------------*/ | | \*--------------------*/ | |
| | | | |
| /** | | /** | |
| * Type of an XCCDF object. | | * Type of an XCCDF object. | |
| * | | * | |
| * When checking the type, you can use either operator == for type equivale
nce, | | * When checking the type, you can use either operator == for type equivale
nce, | |
| * or operator & to take a type inheriritance hierarchy into account. | | * or operator & to take a type inheriritance hierarchy into account. | |
| | | | |
| skipping to change at line 783 | | skipping to change at line 785 | |
| void xccdf_value_free(struct xccdf_item *val); | | void xccdf_value_free(struct xccdf_item *val); | |
| /// @memberof xccdf_value | | /// @memberof xccdf_value | |
| struct xccdf_item *xccdf_value_to_item(struct xccdf_value *item); | | struct xccdf_item *xccdf_value_to_item(struct xccdf_value *item); | |
| /// @memberof xccdf_value | | /// @memberof xccdf_value | |
| struct xccdf_value * xccdf_value_clone(const struct xccdf_value * value); | | struct xccdf_value * xccdf_value_clone(const struct xccdf_value * value); | |
| | | | |
| /// @memberof xccdf_status | | /// @memberof xccdf_status | |
| struct xccdf_status *xccdf_status_new(void); | | struct xccdf_status *xccdf_status_new(void); | |
| /// @memberof xccdf_status | | /// @memberof xccdf_status | |
| struct xccdf_status * xccdf_status_clone(const struct xccdf_status * old_st
atus); | | struct xccdf_status * xccdf_status_clone(const struct xccdf_status * old_st
atus); | |
|
| /// @memeberof xccdf_status | | /// @memberof xccdf_status | |
| struct xccdf_status *xccdf_status_new_fill(const char *status, const char *
date); | | struct xccdf_status *xccdf_status_new_fill(const char *status, const char *
date); | |
| /// @memberof xccdf_status | | /// @memberof xccdf_status | |
| void xccdf_status_free(struct xccdf_status *status); | | void xccdf_status_free(struct xccdf_status *status); | |
| /// @memberof xccdf_notice | | /// @memberof xccdf_notice | |
| struct xccdf_notice *xccdf_notice_new(void); | | struct xccdf_notice *xccdf_notice_new(void); | |
| /// @memberof xccdf_notice | | /// @memberof xccdf_notice | |
| void xccdf_notice_free(struct xccdf_notice *notice); | | void xccdf_notice_free(struct xccdf_notice *notice); | |
| /// @memberof xccdf_notice | | /// @memberof xccdf_notice | |
| struct xccdf_notice * xccdf_notice_clone(const struct xccdf_notice * notice
); | | struct xccdf_notice * xccdf_notice_clone(const struct xccdf_notice * notice
); | |
| | | | |
| | | | |
| skipping to change at line 1828 | | skipping to change at line 1830 | |
| * @memberof xccdf_benchmark | | * @memberof xccdf_benchmark | |
| * @param id ID of the plain text to get. | | * @param id ID of the plain text to get. | |
| * @return Plain text content. | | * @return Plain text content. | |
| * @retval NULL if given plain text does not exist | | * @retval NULL if given plain text does not exist | |
| */ | | */ | |
| const char *xccdf_benchmark_get_plain_text(const struct xccdf_benchmark *be
nchmark, const char *id); | | const char *xccdf_benchmark_get_plain_text(const struct xccdf_benchmark *be
nchmark, const char *id); | |
| | | | |
| /** | | /** | |
| * Get benchmark xccdf:Item by ID. | | * Get benchmark xccdf:Item by ID. | |
| * @memberof xccdf_benchmark | | * @memberof xccdf_benchmark | |
|
| * @param item ID | | * @param id ID | |
| * @return Item with given ID | | * @return Item with given ID | |
| * @retval NULL if no such item exists | | * @retval NULL if no such item exists | |
| */ | | */ | |
| struct xccdf_item *xccdf_benchmark_get_item(const struct xccdf_benchmark *b
enchmark, const char *id); | | struct xccdf_item *xccdf_benchmark_get_item(const struct xccdf_benchmark *b
enchmark, const char *id); | |
| | | | |
| /** | | /** | |
| * Get a registered member of xccdf_benchmakr by ID. | | * Get a registered member of xccdf_benchmakr by ID. | |
| * @memberof xccdf_benchmark | | * @memberof xccdf_benchmark | |
| * @param type of member: either XCCDF_ITEM, XCCDF_PROFILE, or XCCDF_TESTRE
SULT | | * @param type of member: either XCCDF_ITEM, XCCDF_PROFILE, or XCCDF_TESTRE
SULT | |
| * @return xccdf_item with given ID and type | | * @return xccdf_item with given ID and type | |
| | | | |
| skipping to change at line 1879 | | skipping to change at line 1881 | |
| * @see xccdf_item | | * @see xccdf_item | |
| */ | | */ | |
| struct xccdf_item_iterator *xccdf_benchmark_get_content(const struct xccdf_
benchmark *benchmark); | | struct xccdf_item_iterator *xccdf_benchmark_get_content(const struct xccdf_
benchmark *benchmark); | |
| | | | |
| /** | | /** | |
| * @memberof xccdf_benchmark | | * @memberof xccdf_benchmark | |
| */ | | */ | |
| struct oscap_string_iterator *xccdf_benchmark_get_metadata(const struct xcc
df_benchmark *benchmark); | | struct oscap_string_iterator *xccdf_benchmark_get_metadata(const struct xcc
df_benchmark *benchmark); | |
| | | | |
| /** | | /** | |
|
| | | * @memberof xccdf_benchmark | |
| | | */ | |
| | | struct cpe_dict_model *xccdf_benchmark_get_cpe_list(const struct xccdf_benc | |
| | | hmark *benchmark); | |
| | | | |
| | | /** | |
| | | * @memberof xccdf_benchmark | |
| | | */ | |
| | | struct cpe_lang_model *xccdf_benchmark_get_cpe_lang_model(const struct xccd | |
| | | f_benchmark *benchmark); | |
| | | | |
| | | /** | |
| * @memberof xccdf_profile | | * @memberof xccdf_profile | |
| */ | | */ | |
| const char *xccdf_profile_get_id(const struct xccdf_profile *profile); | | const char *xccdf_profile_get_id(const struct xccdf_profile *profile); | |
| /** | | /** | |
| * @memberof xccdf_profile | | * @memberof xccdf_profile | |
| */ | | */ | |
| struct oscap_text_iterator *xccdf_profile_get_title(const struct xccdf_prof
ile *profile); | | struct oscap_text_iterator *xccdf_profile_get_title(const struct xccdf_prof
ile *profile); | |
| /** | | /** | |
| * @memberof xccdf_profile | | * @memberof xccdf_profile | |
| */ | | */ | |
| | | | |
| skipping to change at line 2436 | | skipping to change at line 2448 | |
| bool xccdf_select_get_selected(const struct xccdf_select *select); | | bool xccdf_select_get_selected(const struct xccdf_select *select); | |
| /// @memberof xccdf_select | | /// @memberof xccdf_select | |
| const char *xccdf_select_get_item(const struct xccdf_select *select); | | const char *xccdf_select_get_item(const struct xccdf_select *select); | |
| /// @memberof xccdf_select | | /// @memberof xccdf_select | |
| struct oscap_text_iterator *xccdf_select_get_remarks(const struct xccdf_sel
ect *select); | | struct oscap_text_iterator *xccdf_select_get_remarks(const struct xccdf_sel
ect *select); | |
| | | | |
| /// @memberof xccdf_warning | | /// @memberof xccdf_warning | |
| xccdf_warning_category_t xccdf_warning_get_category(const struct xccdf_warn
ing *warning); | | xccdf_warning_category_t xccdf_warning_get_category(const struct xccdf_warn
ing *warning); | |
| /// @memberof xccdf_warning | | /// @memberof xccdf_warning | |
| struct oscap_text *xccdf_warning_get_text(const struct xccdf_warning *warni
ng); | | struct oscap_text *xccdf_warning_get_text(const struct xccdf_warning *warni
ng); | |
|
| /// @memeberof xccdf_refine_rule | | /// @memberof xccdf_refine_rule | |
| const char * xccdf_refine_rule_get_item(const struct xccdf_refine_rule* rr
); | | const char * xccdf_refine_rule_get_item(const struct xccdf_refine_rule* rr
); | |
|
| /// @memeberof xccdf_refine_rule | | /// @memberof xccdf_refine_rule | |
| const char * xccdf_refine_rule_get_selector(const struct xccdf_refine_rule
* rr); | | const char * xccdf_refine_rule_get_selector(const struct xccdf_refine_rule
* rr); | |
|
| /// @memeberof xccdf_refine_rule | | /// @memberof xccdf_refine_rule | |
| xccdf_role_t xccdf_refine_rule_get_role(const struct xccdf_refine_rule* rr
); | | xccdf_role_t xccdf_refine_rule_get_role(const struct xccdf_refine_rule* rr
); | |
|
| /// @memeberof xccdf_refine_rule | | /// @memberof xccdf_refine_rule | |
| xccdf_level_t xccdf_refine_rule_get_severity(const struct xccdf_refine_rule
* rr); | | xccdf_level_t xccdf_refine_rule_get_severity(const struct xccdf_refine_rule
* rr); | |
|
| /// @memeberof xccdf_refine_rule | | /// @memberof xccdf_refine_rule | |
| struct oscap_text_iterator* xccdf_refine_rule_get_remarks(const struct xccd
f_refine_rule *rr); | | struct oscap_text_iterator* xccdf_refine_rule_get_remarks(const struct xccd
f_refine_rule *rr); | |
| /// @memberof xccdf_refine_rule | | /// @memberof xccdf_refine_rule | |
| xccdf_numeric xccdf_refine_rule_get_weight(const struct xccdf_refine_rule *
item); | | xccdf_numeric xccdf_refine_rule_get_weight(const struct xccdf_refine_rule *
item); | |
| /// @memberof xccdf_refine_rule | | /// @memberof xccdf_refine_rule | |
| bool xccdf_refine_rule_weight_defined(const struct xccdf_refine_rule *item)
; | | bool xccdf_refine_rule_weight_defined(const struct xccdf_refine_rule *item)
; | |
| /// @memberof xccdf_refine_value | | /// @memberof xccdf_refine_value | |
| const char * xccdf_refine_value_get_item(const struct xccdf_refine_valu
e* rv); | | const char * xccdf_refine_value_get_item(const struct xccdf_refine_valu
e* rv); | |
| /// @memberof xccdf_refine_value | | /// @memberof xccdf_refine_value | |
| const char * xccdf_refine_value_get_selector(const struct xccdf_refine_
value* rv); | | const char * xccdf_refine_value_get_selector(const struct xccdf_refine_
value* rv); | |
| /// @memberof xccdf_refine_value | | /// @memberof xccdf_refine_value | |
| | | | |
| skipping to change at line 2642 | | skipping to change at line 2654 | |
| /// @memberof xccdf_benchmark | | /// @memberof xccdf_benchmark | |
| bool xccdf_benchmark_set_version(struct xccdf_benchmark *item, const char *
newval); | | bool xccdf_benchmark_set_version(struct xccdf_benchmark *item, const char *
newval); | |
| /// @memberof xccdf_benchmark | | /// @memberof xccdf_benchmark | |
| bool xccdf_benchmark_set_version_time(struct xccdf_benchmark *item, time_t
newval); | | bool xccdf_benchmark_set_version_time(struct xccdf_benchmark *item, time_t
newval); | |
| /// @memberof xccdf_benchmark | | /// @memberof xccdf_benchmark | |
| bool xccdf_benchmark_set_version_update(struct xccdf_benchmark *item, const
char *newval); | | bool xccdf_benchmark_set_version_update(struct xccdf_benchmark *item, const
char *newval); | |
| /// @memberof xccdf_benchmark | | /// @memberof xccdf_benchmark | |
| bool xccdf_benchmark_set_schema_version(struct xccdf_benchmark* item, const
struct xccdf_version_info* newval); | | bool xccdf_benchmark_set_schema_version(struct xccdf_benchmark* item, const
struct xccdf_version_info* newval); | |
| /// @memberof xccdf_benchmark | | /// @memberof xccdf_benchmark | |
| bool xccdf_benchmark_add_metadata(struct xccdf_benchmark* item, const char*
metadata); | | bool xccdf_benchmark_add_metadata(struct xccdf_benchmark* item, const char*
metadata); | |
|
| | | /// @memberof xccdf_benchmark | |
| | | bool xccdf_benchmark_set_cpe_list(struct xccdf_benchmark* item, struct cpe_ | |
| | | dict_model* cpe_list); | |
| | | /// @memberof xccdf_benchmark | |
| | | bool xccdf_benchmark_set_cpe_lang_model(struct xccdf_benchmark* item, struc | |
| | | t cpe_lang_model* cpe_lang_model); | |
| /// @memberof xccdf_profile | | /// @memberof xccdf_profile | |
| bool xccdf_profile_set_note_tag(struct xccdf_profile *item, const char *new
val); | | bool xccdf_profile_set_note_tag(struct xccdf_profile *item, const char *new
val); | |
| /// @memberof xccdf_profile | | /// @memberof xccdf_profile | |
| bool xccdf_profile_set_id(struct xccdf_profile *item, const char *newval); | | bool xccdf_profile_set_id(struct xccdf_profile *item, const char *newval); | |
| /// @memberof xccdf_profile | | /// @memberof xccdf_profile | |
| bool xccdf_profile_set_abstract(struct xccdf_profile *item, bool newval); | | bool xccdf_profile_set_abstract(struct xccdf_profile *item, bool newval); | |
| /// @memberof xccdf_profile | | /// @memberof xccdf_profile | |
| bool xccdf_profile_set_prohibit_changes(struct xccdf_profile *item, bool ne
wval); | | bool xccdf_profile_set_prohibit_changes(struct xccdf_profile *item, bool ne
wval); | |
| /// @memberof xccdf_profile | | /// @memberof xccdf_profile | |
| bool xccdf_profile_set_extends(struct xccdf_profile *item, const char *newv
al); | | bool xccdf_profile_set_extends(struct xccdf_profile *item, const char *newv
al); | |
| | | | |
| skipping to change at line 2863 | | skipping to change at line 2878 | |
| struct xccdf_refine_value * xccdf_refine_value_clone(const struct xccdf_ref
ine_value * old_value); | | struct xccdf_refine_value * xccdf_refine_value_clone(const struct xccdf_ref
ine_value * old_value); | |
| /// @memberof xccdf_refine_value | | /// @memberof xccdf_refine_value | |
| bool xccdf_refine_value_set_item(struct xccdf_refine_value *obj, const char
*newval); | | bool xccdf_refine_value_set_item(struct xccdf_refine_value *obj, const char
*newval); | |
| /// @memberof xccdf_refine_value | | /// @memberof xccdf_refine_value | |
| bool xccdf_refine_value_set_selector(struct xccdf_refine_value *obj, const
char *newval); | | bool xccdf_refine_value_set_selector(struct xccdf_refine_value *obj, const
char *newval); | |
| /// @memberof xccdf_refine_value | | /// @memberof xccdf_refine_value | |
| bool xccdf_refine_value_set_oper(struct xccdf_refine_value *obj, xccdf_oper
ator_t newval); | | bool xccdf_refine_value_set_oper(struct xccdf_refine_value *obj, xccdf_oper
ator_t newval); | |
| | | | |
| /// @memberof xccdf_set_value | | /// @memberof xccdf_set_value | |
| struct xccdf_setvalue *xccdf_setvalue_new(void); | | struct xccdf_setvalue *xccdf_setvalue_new(void); | |
|
| /// @memeberof xccdf_set_value | | /// @memberof xccdf_set_value | |
| struct xccdf_setvalue * xccdf_setvalue_clone(const struct xccdf_setvalue *
old_value); | | struct xccdf_setvalue * xccdf_setvalue_clone(const struct xccdf_setvalue *
old_value); | |
| /// @memberof xccdf_set_value | | /// @memberof xccdf_set_value | |
| bool xccdf_setvalue_set_item(struct xccdf_setvalue *obj, const char *newval
); | | bool xccdf_setvalue_set_item(struct xccdf_setvalue *obj, const char *newval
); | |
| /// @memberof xccdf_set_value | | /// @memberof xccdf_set_value | |
| bool xccdf_setvalue_set_value(struct xccdf_setvalue *obj, const char *newva
l); | | bool xccdf_setvalue_set_value(struct xccdf_setvalue *obj, const char *newva
l); | |
| /// @memberof xccdf_plain_text | | /// @memberof xccdf_plain_text | |
| bool xccdf_plain_text_set_id(struct xccdf_plain_text *obj, const char *newv
al); | | bool xccdf_plain_text_set_id(struct xccdf_plain_text *obj, const char *newv
al); | |
| /// @memberof xccdf_plain_text | | /// @memberof xccdf_plain_text | |
| bool xccdf_plain_text_set_text(struct xccdf_plain_text *obj, const char *ne
wval); | | bool xccdf_plain_text_set_text(struct xccdf_plain_text *obj, const char *ne
wval); | |
| | | | |
| | | | |
| skipping to change at line 3297 | | skipping to change at line 3312 | |
| /** | | /** | |
| * Perform a textual substitution. | | * Perform a textual substitution. | |
| * Calls @a cb on each substitution (e.g. a cdf:sub element) of @a text and
returns a string with substitutions done. | | * Calls @a cb on each substitution (e.g. a cdf:sub element) of @a text and
returns a string with substitutions done. | |
| * @param text source text | | * @param text source text | |
| * @param cb substitution callback | | * @param cb substitution callback | |
| * @param arg arbitrary argument to be passed to he callback | | * @param arg arbitrary argument to be passed to he callback | |
| * @return substituted string (it is up to the caller to free it) | | * @return substituted string (it is up to the caller to free it) | |
| */ | | */ | |
| char* oscap_text_xccdf_substitute(const char *text, xccdf_substitution_func
cb, void *arg); | | char* oscap_text_xccdf_substitute(const char *text, xccdf_substitution_func
cb, void *arg); | |
| | | | |
|
| /************************************************************ | | /************************************************************/ | |
| ** @} End of XCCDF group */ | | /** @} End of XCCDF group */ | |
| | | /// @} | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 13 change blocks. |
| 13 lines changed or deleted | | 33 lines changed or added | |
|
| xccdf_policy.h | | xccdf_policy.h | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 37 | |
| * @author Dave Niemoller <david.niemoller@g2-inc.com> | | * @author Dave Niemoller <david.niemoller@g2-inc.com> | |
| */ | | */ | |
| | | | |
| #ifndef XCCDF_POLICY_H_ | | #ifndef XCCDF_POLICY_H_ | |
| #define XCCDF_POLICY_H_ | | #define XCCDF_POLICY_H_ | |
| | | | |
| #include <xccdf_benchmark.h> | | #include <xccdf_benchmark.h> | |
| #include <stdbool.h> | | #include <stdbool.h> | |
| #include <time.h> | | #include <time.h> | |
| #include <oscap.h> | | #include <oscap.h> | |
|
| #include <reporter.h> | | | |
| | | | |
| /** | | /** | |
| * @struct xccdf_policy_model | | * @struct xccdf_policy_model | |
| * Handle all policies for given XCCDF benchmark | | * Handle all policies for given XCCDF benchmark | |
| */ | | */ | |
| struct xccdf_policy_model; | | struct xccdf_policy_model; | |
| | | | |
| /** | | /** | |
| * @struct xccdf_policy | | * @struct xccdf_policy | |
| * Policy structure that abstract benchmark's profile | | * Policy structure that abstract benchmark's profile | |
| | | | |
| skipping to change at line 134 | | skipping to change at line 133 | |
| */ | | */ | |
| void xccdf_policy_free(struct xccdf_policy *); | | void xccdf_policy_free(struct xccdf_policy *); | |
| | | | |
| /** | | /** | |
| * Destructor of Value binding structure | | * Destructor of Value binding structure | |
| * @memberof xccdf_value_binding | | * @memberof xccdf_value_binding | |
| */ | | */ | |
| void xccdf_value_binding_free(struct xccdf_value_binding *); | | void xccdf_value_binding_free(struct xccdf_value_binding *); | |
| | | | |
| /** | | /** | |
|
| | | * Registers an additional CPE dictionary for applicability testing | |
| | | * The ones embedded in the evaluated XCCDF take precedence! | |
| | | */ | |
| | | bool xccdf_policy_model_add_cpe_dict(struct xccdf_policy_model * model, con | |
| | | st char * cpe_dict); | |
| | | | |
| | | /** | |
| * Function to register callback for checking system | | * Function to register callback for checking system | |
| * @param model XCCDF Policy Model | | * @param model XCCDF Policy Model | |
| * @param sys String representing given checking system | | * @param sys String representing given checking system | |
| * @param func Callback - pointer to function called by XCCDF Policy system
when rule parsed | | * @param func Callback - pointer to function called by XCCDF Policy system
when rule parsed | |
| * @param usr optional parameter for passing user data to callback | | * @param usr optional parameter for passing user data to callback | |
| * @memberof xccdf_policy_model | | * @memberof xccdf_policy_model | |
| * @return true if callback registered succesfully, false otherwise | | * @return true if callback registered succesfully, false otherwise | |
| */ | | */ | |
| bool xccdf_policy_model_register_engine_callback(struct xccdf_policy_model
* model, char * sys, void * func, void * usr); | | bool xccdf_policy_model_register_engine_callback(struct xccdf_policy_model
* model, char * sys, void * func, void * usr); | |
| | | | |
| /** | | /** | |
| * Function to register callback for checking system | | * Function to register callback for checking system | |
| * @param model XCCDF Policy Model | | * @param model XCCDF Policy Model | |
| * @param sys String representing given checking system | | * @param sys String representing given checking system | |
|
| * @param func Callback - pointer to function called by XCCDF Policy system
when rule parsed | | * @param eval_fn Callback - pointer to function called by XCCDF Policy sys
tem when rule parsed | |
| * @param usr optional parameter for passing user data to callback | | * @param usr optional parameter for passing user data to callback | |
| * @param query_fn - optional parameter for providing xccdf_policy_engine_q
uery_fn implementation for given system. | | * @param query_fn - optional parameter for providing xccdf_policy_engine_q
uery_fn implementation for given system. | |
| * @memberof xccdf_policy_model | | * @memberof xccdf_policy_model | |
| * @return true if callback registered succesfully, false otherwise | | * @return true if callback registered succesfully, false otherwise | |
| */ | | */ | |
| bool xccdf_policy_model_register_engine_and_query_callback(struct xccdf_pol
icy_model *model, char *sys, void *eval_fn, void *usr, xccdf_policy_engine_
query_fn query_fn); | | bool xccdf_policy_model_register_engine_and_query_callback(struct xccdf_pol
icy_model *model, char *sys, void *eval_fn, void *usr, xccdf_policy_engine_
query_fn query_fn); | |
| | | | |
|
| | | typedef int (*policy_reporter_output)(struct xccdf_rule_result *, void *); | |
| | | | |
| /** | | /** | |
| * Function to register output callback for checking system that will be ca
lled AFTER each rule evaluation. | | * Function to register output callback for checking system that will be ca
lled AFTER each rule evaluation. | |
| * @param model XCCDF Policy Model | | * @param model XCCDF Policy Model | |
| * @param func Callback - pointer to function called by XCCDF Policy system
when rule parsed | | * @param func Callback - pointer to function called by XCCDF Policy system
when rule parsed | |
| * @param usr optional parameter for passing user data to callback | | * @param usr optional parameter for passing user data to callback | |
| * @memberof xccdf_policy_model | | * @memberof xccdf_policy_model | |
| * @return true if callback registered succesfully, false otherwise | | * @return true if callback registered succesfully, false otherwise | |
|
| * \par Example | | | |
| * With the first function below (register output callback) user registers | | | |
| the callback that will be called after | | | |
| * each rule evalution is done. Second callback is registered as callback f | | | |
| or evaluation itself and will be called | | | |
| * during the evaluation. | | | |
| * \code | | | |
| * xccdf_policy_model_register_output_callback(policy_model, callback, NULL | | | |
| ); | | | |
| * xccdf_policy_model_register_engine_callback(policy_model, "http://oval.m | | | |
| itre.org/XMLSchema/oval-definitions-5", oval_agent_eval_rule, (void *) sess | | | |
| ); | | | |
| * \endcode | | | |
| * The example of callback: | | | |
| * \code | | | |
| * static int callback(const struct oscap_reporter_message *msg, void *arg) | | | |
| * { | | | |
| * xccdf_test_result_type_t result = oscap_reporter_message_get_user2n | | | |
| um(msg); | | | |
| * if (result == XCCDF_RESULT_NOT_SELECTED) return 0; | | | |
| * | | | |
| * printf("\n"); | | | |
| * printf("Rule ID:\r\t\t\033[1m%s\033[0;0m\n", oscap_reporter_message | | | |
| _get_user1str(msg)); | | | |
| * printf("Title:\r\t\t%s\n", oscap_reporter_message_get_user3str(msg) | | | |
| ); | | | |
| * printf("Result:\r\t\t\033[%sm%s\033[0m\n", RESULT_COLORS[result], x | | | |
| ccdf_test_result_type_get_text((xccdf_test_result_type_t) result)); | | | |
| * return 0; | | | |
| * } | | | |
| * \endcode | | | |
| */ | | */ | |
|
| bool xccdf_policy_model_register_output_callback(struct xccdf_policy_model | | bool xccdf_policy_model_register_output_callback(struct xccdf_policy_model | |
| * model, oscap_reporter func, void * usr); | | * model, policy_reporter_output func, void * usr); | |
| | | | |
| | | typedef int (*policy_reporter_start)(struct xccdf_rule *, void *); | |
| | | | |
| /** | | /** | |
| * Function to register start callback for checking system that will be cal
led BEFORE each rule evaluation. | | * Function to register start callback for checking system that will be cal
led BEFORE each rule evaluation. | |
| * @param model XCCDF Policy Model | | * @param model XCCDF Policy Model | |
| * @param func Callback - pointer to function called by XCCDF Policy system
when rule parsed | | * @param func Callback - pointer to function called by XCCDF Policy system
when rule parsed | |
| * @param usr optional parameter for passing user data to callback | | * @param usr optional parameter for passing user data to callback | |
| * @memberof xccdf_policy_model | | * @memberof xccdf_policy_model | |
| * @return true if callback registered succesfully, false otherwise | | * @return true if callback registered succesfully, false otherwise | |
|
| * \par Example | | | |
| * With the first function below (register start callback) user registers t | | | |
| he callback that will be called before | | | |
| * each rule evalution is started. Second callback is registered as callbac | | | |
| k for evaluation itself and will be called | | | |
| * during the evaluation. Last callback is registered output callback. | | | |
| * \code | | | |
| * xccdf_policy_model_register_start_callback(policy_model, callback_start, | | | |
| NULL); | | | |
| * xccdf_policy_model_register_engine_callback(policy_model, "http://oval.m | | | |
| itre.org/XMLSchema/oval-definitions-5", oval_agent_eval_rule, (void *) sess | | | |
| ); | | | |
| * xccdf_policy_model_register_output_callback(policy_model, callback_end, | | | |
| NULL); | | | |
| * \endcode | | | |
| * The example of callback_start: | | | |
| * \code | | | |
| * static int callback(const struct oscap_reporter_message *msg, void *arg) | | | |
| * { | | | |
| * printf("Evaluating rule \"%s\". Please wait.". oscap_reporter_messa | | | |
| ge_get_user1num(msg)); | | | |
| * return 0; | | | |
| * } | | | |
| * \endcode | | | |
| */ | | */ | |
|
| bool xccdf_policy_model_register_start_callback(struct xccdf_policy_model *
model, oscap_reporter func, void * usr); | | bool xccdf_policy_model_register_start_callback(struct xccdf_policy_model *
model, policy_reporter_start func, void * usr); | |
| | | | |
| /************************************************************/ | | /************************************************************/ | |
| /** | | /** | |
| * @name Getters | | * @name Getters | |
| * Return value is pointer to structure's member. Do not free unless you nu
ll the pointer in the structure. | | * Return value is pointer to structure's member. Do not free unless you nu
ll the pointer in the structure. | |
| * Use remove function otherwise. | | * Use remove function otherwise. | |
| * @{ | | * @{ | |
| * */ | | * */ | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 520 | | skipping to change at line 490 | |
| */ | | */ | |
| struct oscap_stringlist * xccdf_policy_model_get_files(struct xccdf_policy_
model * policy_model); | | struct oscap_stringlist * xccdf_policy_model_get_files(struct xccdf_policy_
model * policy_model); | |
| | | | |
| /** | | /** | |
| * Return names of files that are used in checks of particular rules. Every
check needs this file to be | | * Return names of files that are used in checks of particular rules. Every
check needs this file to be | |
| * evaluated properly. If this file will not be imported and bind to the XC
CDF Policy system the result | | * evaluated properly. If this file will not be imported and bind to the XC
CDF Policy system the result | |
| * of rule after evaluation will be "Not checked" | | * of rule after evaluation will be "Not checked" | |
| */ | | */ | |
| struct oscap_stringlist * xccdf_item_get_files(struct xccdf_item * item); | | struct oscap_stringlist * xccdf_item_get_files(struct xccdf_item * item); | |
| | | | |
|
| | | /** | |
| | | * Return result of the AND operation for two given attributes. | |
| | | * For more details about the attributes A and B please consult 'Table 26: | |
| | | Possible Results for a Single Test' from NISTIR-7275r4. | |
| | | * For more details about the AND operation please consult 'Table 12: Truth | |
| | | Table for AND' in the very same document. | |
| | | */ | |
| | | xccdf_test_result_type_t xccdf_test_result_resolve_and_operation(xccdf_test | |
| | | _result_type_t A, xccdf_test_result_type_t B); | |
| | | | |
| /************************************************************/ | | /************************************************************/ | |
| /** @} End of Evaluators group */ | | /** @} End of Evaluators group */ | |
| | | | |
| /************************************************************/ | | /************************************************************/ | |
| /** | | /** | |
| * @name Iterators | | * @name Iterators | |
| * @{ | | * @{ | |
| * */ | | * */ | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 596 | | skipping to change at line 573 | |
| /** | | /** | |
| * Perform textual substitution of cdf:sub elements with respect to given X
CCDF policy. | | * Perform textual substitution of cdf:sub elements with respect to given X
CCDF policy. | |
| * @param text text to be substituted | | * @param text text to be substituted | |
| * @param policy policy to be used | | * @param policy policy to be used | |
| */ | | */ | |
| char* xccdf_policy_substitute(const char *text, struct xccdf_policy *policy
); | | char* xccdf_policy_substitute(const char *text, struct xccdf_policy *policy
); | |
| | | | |
| /************************************************************/ | | /************************************************************/ | |
| /** @} End of Iterators group */ | | /** @} End of Iterators group */ | |
| | | | |
|
| /* | | /** | |
| * @} | | * @} | |
| */ | | */ | |
| #endif | | #endif | |
| | | | |
End of changes. 10 change blocks. |
| 61 lines changed or deleted | | 26 lines changed or added | |
|