cpe_dict.h | cpe_dict.h | |||
---|---|---|---|---|
skipping to change at line 876 | 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 | * Verify whether given CPE is applicable to current platform by evaluating checks associated with it | |||
* | * | |||
* @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 and the CPE is applicable | * @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); | bool cpe_name_applicable_dict(struct cpe_name *cpe, struct cpe_dict_model * dict, cpe_check_fn cb, void* usr); | |||
skipping to change at line 912 | skipping to change at line 910 | |||
/** | /** | |||
* 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); | |||
/** | /** | |||
* Sets the origin file hint | ||||
* @note This is intended for internal use only! | ||||
* @see cpe_dict_model_get_origin_file | ||||
*/ | ||||
bool cpe_dict_model_set_origin_file(struct cpe_dict_model* dict, const char | ||||
* origin_file); | ||||
/** | ||||
* Gets the file the CPE dict model was loaded from | * Gets the file the CPE dict model was loaded from | |||
* @internal | * @internal | |||
* This is necessary to figure out the full OVAL file path for applicabilit y | * 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 | * testing. We can't do applicability here in the CPE module because that | |||
* would create awful interdependencies. | * would create awful interdependencies. | |||
*/ | */ | |||
const char* cpe_dict_model_get_origin_file(const struct cpe_dict_model* dic t); | const char* cpe_dict_model_get_origin_file(const struct cpe_dict_model* dic t); | |||
/** @} */ | /** @} */ | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 8 lines changed or added | |||
cpe_lang.h | cpe_lang.h | |||
---|---|---|---|---|
skipping to change at line 51 | skipping to change at line 51 | |||
#include "cpe_name.h" | #include "cpe_name.h" | |||
#include "oscap_text.h" | #include "oscap_text.h" | |||
/** | /** | |||
* CPE language operators | * CPE language operators | |||
*/ | */ | |||
typedef enum { | typedef enum { | |||
CPE_LANG_OPER_INVALID = 0x00, ///< invalid or unknown operation | CPE_LANG_OPER_INVALID = 0x00, ///< invalid or unknown operation | |||
CPE_LANG_OPER_AND = 0x01, ///< logical AND | CPE_LANG_OPER_AND = 0x01, ///< logical AND | |||
CPE_LANG_OPER_OR = 0x02, ///< logical OR | CPE_LANG_OPER_OR = 0x02, ///< logical OR | |||
CPE_LANG_OPER_MATCH = 0x04, ///< match against specified CPE | CPE_LANG_OPER_MATCH = 0x04, ///< fact-ref = match given CPE name | |||
against available dictionaries | ||||
CPE_LANG_OPER_CHECK = 0x08, ///< check-ref = evaluate given check | ||||
CPE_LANG_OPER_MASK = 0xFF, ///< mask to extract the operator w/ o possible negation | CPE_LANG_OPER_MASK = 0xFF, ///< mask to extract the operator w/ o possible negation | |||
CPE_LANG_OPER_NOT = 0x100, ///< negate | CPE_LANG_OPER_NOT = 0x100, ///< negate | |||
CPE_LANG_OPER_NAND = CPE_LANG_OPER_AND | CPE_LANG_OPER_NOT, | CPE_LANG_OPER_NAND = CPE_LANG_OPER_AND | CPE_LANG_OPER_NOT, | |||
CPE_LANG_OPER_NOR = CPE_LANG_OPER_OR | CPE_LANG_OPER_NOT, | CPE_LANG_OPER_NOR = CPE_LANG_OPER_OR | CPE_LANG_OPER_NOT, | |||
} cpe_lang_oper_t; | } cpe_lang_oper_t; | |||
/** | /** | |||
* @struct cpe_lang_model | * @struct cpe_lang_model | |||
skipping to change at line 143 | skipping to change at line 144 | |||
struct cpe_testexpr_iterator *cpe_testexpr_get_meta_expr(const struct cpe_t estexpr *item); | struct cpe_testexpr_iterator *cpe_testexpr_get_meta_expr(const struct cpe_t estexpr *item); | |||
/** | /** | |||
* Get CPE name to match against. | * Get CPE name to match against. | |||
* Only valid for CPE_LANG_OPER_MATCH. | * Only valid for CPE_LANG_OPER_MATCH. | |||
* @memberof cpe_testexpr | * @memberof cpe_testexpr | |||
*/ | */ | |||
const struct cpe_name *cpe_testexpr_get_meta_cpe(const struct cpe_testexpr *item); | const struct cpe_name *cpe_testexpr_get_meta_cpe(const struct cpe_testexpr *item); | |||
/** | /** | |||
* Get check system to evaluate | ||||
* Only valid for CPE_LANG_OPER_CHECK. | ||||
* @memberof cpe_testexpr | ||||
*/ | ||||
const char* cpe_testexpr_get_meta_check_system(const struct cpe_testexpr *i | ||||
tem); | ||||
/** | ||||
* Get check href to evaluate | ||||
* Only valid for CPE_LANG_OPER_CHECK. | ||||
* @memberof cpe_testexpr | ||||
*/ | ||||
const char* cpe_testexpr_get_meta_check_href(const struct cpe_testexpr *ite | ||||
m); | ||||
/** | ||||
* Get check idref to evaluate | ||||
* Only valid for CPE_LANG_OPER_CHECK. | ||||
* @memberof cpe_testexpr | ||||
*/ | ||||
const char* cpe_testexpr_get_meta_check_id(const struct cpe_testexpr *item) | ||||
; | ||||
/** | ||||
* Function to get next expr from array | * Function to get next expr from array | |||
* @param expr CPE Test expression structure | * @param expr CPE Test expression structure | |||
* @memberof cpe_testexpr | * @memberof cpe_testexpr | |||
*/ | */ | |||
const struct cpe_testexpr *cpe_testexpr_get_next(const struct cpe_testexpr *expr); | const struct cpe_testexpr *cpe_testexpr_get_next(const struct cpe_testexpr *expr); | |||
/** | /** | |||
* cpe_lang_model function to get CPE platforms | * cpe_lang_model function to get CPE platforms | |||
* @memberof cpe_lang_model | * @memberof cpe_lang_model | |||
*/ | */ | |||
struct cpe_platform_iterator *cpe_lang_model_get_platforms(const struct cpe _lang_model *item); | struct cpe_platform_iterator *cpe_lang_model_get_platforms(const struct cpe _lang_model *item); | |||
/** | /** | |||
* cpe_lang_model function to get CPE platforms | * cpe_lang_model function to get CPE platforms | |||
* @memberof cpe_lang_model | * @memberof cpe_lang_model | |||
*/ | */ | |||
struct cpe_platform *cpe_lang_model_get_item(const struct cpe_lang_model *i tem, const char *key); | struct cpe_platform *cpe_lang_model_get_item(const struct cpe_lang_model *i tem, const char *key); | |||
/** | /** | |||
* Verify whether given CPE platform idref is applicable by evaluating test | ||||
expression associated with it | ||||
* | ||||
* @memberof cpe_lang_model | ||||
* @param platform idref to the platform to verify (do not pass with "#" pr | ||||
epended) | ||||
* @param lang_model used CPE language model | ||||
* @return true if lang model contains given platform and the platform is a | ||||
pplicable | ||||
*/ | ||||
bool cpe_platform_applicable_lang_model(const char* platform, struct cpe_la | ||||
ng_model *lang_model, cpe_check_fn check_cb, cpe_dict_fn dict_cb, void* usr | ||||
); | ||||
/** | ||||
* cpe_platform functions to get id | * cpe_platform functions to get id | |||
* @memberof cpe_platform | * @memberof cpe_platform | |||
*/ | */ | |||
const char *cpe_platform_get_id(const struct cpe_platform *item); | const char *cpe_platform_get_id(const struct cpe_platform *item); | |||
/** | /** | |||
* cpe_platform functions to get remark | * cpe_platform functions to get remark | |||
* @memberof cpe_platform | * @memberof cpe_platform | |||
*/ | */ | |||
const char *cpe_platform_get_remark(const struct cpe_platform *item); | const char *cpe_platform_get_remark(const struct cpe_platform *item); | |||
/** | /** | |||
skipping to change at line 323 | skipping to change at line 355 | |||
* */ | * */ | |||
/** | /** | |||
* Get supported version of CPE language XML | * Get supported version of CPE language XML | |||
* @return version of XML file format | * @return version of XML file format | |||
* @memberof cpe_lang_model | * @memberof cpe_lang_model | |||
*/ | */ | |||
const char * cpe_lang_model_supported(void); | const char * cpe_lang_model_supported(void); | |||
/** | /** | |||
* Detect version of given CPE language XML | ||||
* @memberof cpe_lang_model | ||||
*/ | ||||
char * cpe_lang_model_detect_version(const char* file); | ||||
/** | ||||
* Function to match cpe in platform | * Function to match cpe in platform | |||
* @param cpe to be matched with | * @param cpe to be matched with | |||
* @param n size | * @param n size | |||
* @param platform CPE platform | * @param platform CPE platform | |||
* @memberof cpe_platform | * @memberof cpe_platform | |||
*/ | */ | |||
bool cpe_platform_match_cpe(struct cpe_name **cpe, size_t n, const struct c pe_platform *platform); | bool cpe_platform_match_cpe(struct cpe_name **cpe, size_t n, const struct c pe_platform *platform); | |||
/************************************************************/ | /************************************************************/ | |||
/** @} End of Evaluators group */ | /** @} End of Evaluators group */ | |||
/** | /** | |||
* Load CPE language model from a XML document. | * Load CPE language model from a XML document. | |||
* @memberof cpe_lang_model | * @memberof cpe_lang_model | |||
*/ | */ | |||
struct cpe_lang_model *cpe_lang_model_import(const char *file); | struct cpe_lang_model *cpe_lang_model_import(const char *file); | |||
/** | /** | |||
* Sets the origin file hint | ||||
* @note This is intended for internal use only! | ||||
* @see cpe_lang_model_get_origin_file | ||||
*/ | ||||
bool cpe_lang_model_set_origin_file(struct cpe_lang_model* lang_model, cons | ||||
t char* origin_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_lang_model_get_origin_file(const struct cpe_lang_model* lan | ||||
g_model); | ||||
/** | ||||
* Write the lang_model to a file. | * Write the lang_model to a file. | |||
* @memberof cpe_lang_model | * @memberof cpe_lang_model | |||
* @param spec CPE lang model | * @param spec CPE lang model | |||
* @param file filename | * @param file filename | |||
*/ | */ | |||
void cpe_lang_model_export(const struct cpe_lang_model *spec, const char *f ile); | void cpe_lang_model_export(const struct cpe_lang_model *spec, const char *f ile); | |||
/**@}*/ | /**@}*/ | |||
/**@}*/ | /**@}*/ | |||
End of changes. 5 change blocks. | ||||
1 lines changed or deleted | 67 lines changed or added | |||
cpe_name.h | cpe_name.h | |||
---|---|---|---|---|
skipping to change at line 352 | skipping to change at line 352 | |||
*/ | */ | |||
const char * cpe_name_supported(void); | const char * cpe_name_supported(void); | |||
/************************************************************/ | /************************************************************/ | |||
/** @} End of Evaluators group */ | /** @} End of Evaluators group */ | |||
/**@}*/ | /**@}*/ | |||
/**@}*/ | /**@}*/ | |||
/** | ||||
* Shared callback definition used to evaluate checks to perform applicabil | ||||
ity tests | ||||
* | ||||
* first arg = system | ||||
* second arg = href | ||||
* third arg = check name / id | ||||
* fourth arg = arbitrary pointer / user data | ||||
* | ||||
* returns true = applicable, false = not applicable | ||||
*/ | ||||
typedef bool *(*cpe_check_fn) (const char*, const char*, const char*, void* | ||||
); | ||||
/** | ||||
* Shared callback definition used to match CPE names to perform applicabil | ||||
ity tests | ||||
* | ||||
* first argument = cpe name to match | ||||
* second argument = arbitrary pointer / user data | ||||
* returns true = matched to existing applicable name, false = not matched/ | ||||
not applicable | ||||
*/ | ||||
typedef bool *(*cpe_dict_fn) (const struct cpe_name*, void*); | ||||
#endif /* _CPEURI_H_ */ | #endif /* _CPEURI_H_ */ | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 25 lines changed or added | |||
oscap.h | oscap.h | |||
---|---|---|---|---|
skipping to change at line 92 | skipping to change at line 92 | |||
/// SCAP document type identifiers | /// SCAP document type identifiers | |||
typedef enum oscap_document_type { | typedef enum oscap_document_type { | |||
OSCAP_DOCUMENT_OVAL_DEFINITIONS = 1, ///< OVAL Definitions file | OSCAP_DOCUMENT_OVAL_DEFINITIONS = 1, ///< OVAL Definitions file | |||
OSCAP_DOCUMENT_OVAL_VARIABLES, ///< OVAL Variables | OSCAP_DOCUMENT_OVAL_VARIABLES, ///< OVAL Variables | |||
OSCAP_DOCUMENT_OVAL_SYSCHAR, ///< OVAL system characteristi cs file | OSCAP_DOCUMENT_OVAL_SYSCHAR, ///< OVAL system characteristi cs file | |||
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_CVE_FEED, ///< CVE NVD feed | ||||
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); | 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. | |||
* | * | |||
skipping to change at line 134 | skipping to change at line 135 | |||
* @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 outfile Report from schematron validation is written into the out file. If NULL, stdou will be used. | * @param outfile Report from schematron validation is written into the out file. If NULL, stdou will be used. | |||
* @return 0 on pass; <0 error; >0 fail | * @return 0 on pass; <0 error; >0 fail | |||
*/ | */ | |||
int oscap_schematron_validate_document(const char *xmlfile, oscap_document_ type_t doctype, const char *version, const char *outfile); | int oscap_schematron_validate_document(const char *xmlfile, oscap_document_ type_t doctype, const char *version, const char *outfile); | |||
/** | /** | |||
* Apply a XSLT stylesheet to a XML file. | * Apply a XSLT stylesheet to a XML file. | |||
* | * | |||
* Stylesheets are searched relative to path specified by the OSCAP_XSLT_PA TH environment variable. | * If xsltfile is not an absolute path, the file will be searched relativel y to a path specified by the OSCAP_XSLT_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). | |||
* | * | |||
* @param xmlfile File to be transformed. | * @param xmlfile File to be transformed. | |||
* @param xsltfile XSLT filename | * @param xsltfile XSLT file | |||
* @param outfile Result file shall be written here (NULL for stdout). | * @param outfile Result file shall be written here (NULL for stdout). | |||
* @param params list of key-value pairs to pass to the stylesheet. | * @param params list of key-value pairs to pass to the stylesheet. | |||
* @return the number of bytes written or -1 in case of failure | * @return the number of bytes written or -1 in case of failure | |||
*/ | */ | |||
int oscap_apply_xslt(const char *xmlfile, const char *xsltfile, const char *outfile, const char **params); | int oscap_apply_xslt(const char *xmlfile, const char *xsltfile, const char *outfile, const char **params); | |||
/** | /** | |||
* Function returns path used to locate OpenSCAP XML schemas | * Function returns path used to locate OpenSCAP XML schemas | |||
*/ | */ | |||
const char * oscap_path_to_schemas(void); | const char * oscap_path_to_schemas(void); | |||
/** | /** | |||
* Function returns path used to locate OpenSCAP Schematron files | * Function returns path used to locate OpenSCAP Schematron files | |||
*/ | */ | |||
const char * oscap_path_to_schematron(void); | const char * oscap_path_to_schematron(void); | |||
/** | ||||
* Determine document type | ||||
*/ | ||||
int oscap_determine_document_type(const char *document, oscap_document_type | ||||
_t *doc_type); | ||||
/************************************************************/ | /************************************************************/ | |||
/** @} validation group end */ | /** @} validation group end */ | |||
/** @} */ | /** @} */ | |||
#endif | #endif | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 9 lines changed or added | |||
oval_agent_xccdf_api.h | oval_agent_xccdf_api.h | |||
---|---|---|---|---|
skipping to change at line 55 | skipping to change at line 55 | |||
* @param it XCCDF Value Binding iterator with value bindings | * @param it XCCDF Value Binding iterator with value bindings | |||
* @param usr Void pointer to the user data structure | * @param usr Void pointer to the user data structure | |||
* @return XCCDF test result type of evaluated rule | * @return XCCDF test result type of evaluated rule | |||
* | * | |||
*/ | */ | |||
typedef xccdf_test_result_type_t (xccdf_policy_eval_rule_cb_t) (struct xccd f_policy * policy, const char * rule_id, | typedef xccdf_test_result_type_t (xccdf_policy_eval_rule_cb_t) (struct xccd f_policy * policy, const char * rule_id, | |||
const char * id, struct xccdf_value_binding_iterator * it, void * u sr); | const char * id, struct xccdf_value_binding_iterator * it, void * u sr); | |||
/** | /** | |||
* Internal OVAL Agent Callback that can be used to evaluate XCCDF content. | * Internal OVAL Agent Callback that can be used to evaluate XCCDF content. | |||
* | ||||
* You can either register this function with xccdf_policy (old fashioned w | ||||
ay | ||||
* as described in the example bellow). Alternativelly you can use high lev | ||||
el | ||||
* function xccdf_policy_model_register_engine_oval() (recommended) which w | ||||
ill | ||||
* register the oval_engine. | ||||
* | ||||
* \par Example | * \par Example | |||
* Next example shows common use of this function in evaluation proccess of XCCDF file. | * Next example shows common use of this function in evaluation proccess of XCCDF file. | |||
* \par | * \par | |||
* \code | * \code | |||
* struct oval_definition_model * def_model = oval_definition_model_import (oval_file); | * struct oval_definition_model * def_model = oval_definition_model_import (oval_file); | |||
* struct xccdf_benchmark * benchmark = xccdf_benchmark_import(file); | * struct xccdf_benchmark * benchmark = xccdf_benchmark_import(file); | |||
* struct xccdf_policy_model * policy_model = xccdf_policy_model_new(bench mark); | * struct xccdf_policy_model * policy_model = xccdf_policy_model_new(bench mark); | |||
* struct oval_agent_session * sess = oval_agent_new_session(def_model, "n ame-of-file"); | * struct oval_agent_session * sess = oval_agent_new_session(def_model, "n ame-of-file"); | |||
* ... | * ... | |||
* xccdf_policy_model_register_engine_callback(policy_model, "http://oval. mitre.org/XMLSchema/oval-definitions-5", oval_agent_eval_rule, (void *) ses s); | * xccdf_policy_model_register_engine_and_query_callback(policy_model, "ht tp://oval.mitre.org/XMLSchema/oval-definitions-5", oval_agent_eval_rule, (v oid *) sess, NULL); | |||
* \endcode | * \endcode | |||
* | * | |||
*/ | */ | |||
xccdf_test_result_type_t oval_agent_eval_rule(struct xccdf_policy * policy, const char * rule_id, const char * id, const char * href, | xccdf_test_result_type_t oval_agent_eval_rule(struct xccdf_policy * policy, const char * rule_id, const char * id, const char * href, | |||
struct xccdf_value_binding_iterator * it, | struct xccdf_value_binding_iterator * it, | |||
struct xccdf_check_import_iterator * check_import_it, | struct xccdf_check_import_iterator * check_import_it, | |||
void * usr); | void * usr); | |||
/** | /** | |||
* Resolve variables from XCCDF Value Bindings and set their values to OVAL Variables | * Resolve variables from XCCDF Value Bindings and set their values to OVAL Variables | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 10 lines changed or added | |||
oval_definitions.h | oval_definitions.h | |||
---|---|---|---|---|
skipping to change at line 3185 | skipping to change at line 3185 | |||
* @} 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. 1 change blocks. | ||||
8 lines changed or deleted | 0 lines changed or added | |||
oval_probe.h | oval_probe.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
* License along with this library; if not, write to the Free Software | * License along with this library; if not, write to the Free Software | |||
* 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: | |||
* "Daniel Kopecek" <dkopecek@redhat.com> | * "Daniel Kopecek" <dkopecek@redhat.com> | |||
*/ | */ | |||
#pragma once | #pragma once | |||
#ifndef OVAL_PROBE_H | #ifndef OVAL_PROBE_H | |||
#define OVAL_PROBE_H | #define OVAL_PROBE_H | |||
#include <stdio.h> | ||||
#include <stdarg.h> | #include <stdarg.h> | |||
#include <stdint.h> | #include <stdint.h> | |||
#include "oval_definitions.h" | #include "oval_definitions.h" | |||
#include "oval_system_characteristics.h" | #include "oval_system_characteristics.h" | |||
#include "oval_probe_session.h" | #include "oval_probe_session.h" | |||
/* | /* | |||
* probe session flags | * probe session flags | |||
*/ | */ | |||
#define OVAL_PDFLAG_NOREPLY 0x0001 /**< don't send probe result to libr ary - just an ack */ | #define OVAL_PDFLAG_NOREPLY 0x0001 /**< don't send probe result to libr ary - just an ack */ | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
scap_ds.h | scap_ds.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
* Authors: | * Authors: | |||
* Martin Preisler <mpreisle@redhat.com> | * Martin Preisler <mpreisle@redhat.com> | |||
*/ | */ | |||
#ifndef OPENSCAP_DS_H | #ifndef OPENSCAP_DS_H | |||
#define OPENSCAP_DS_H | #define OPENSCAP_DS_H | |||
#include "oscap.h" | #include "oscap.h" | |||
/** | /** | |||
* @brief checks whether given file contains a source data stream | ||||
* | ||||
* @param xccdf_file | ||||
* Path to the file we want checked | ||||
* | ||||
* @returns | ||||
* 0 if given file is *likely* a source data stream | ||||
* 1 if given file is *likely not* a source data stream | ||||
* -1 in case of errors (file not found or root element not found) | ||||
* | ||||
* @par | ||||
* This check is only "preliminary", it is designed to be reasonably fast | ||||
* and won't do validation! It looks at the root element only. | ||||
*/ | ||||
int ds_is_sds(const char* xccdf_file); | ||||
/** | ||||
* @brief takes given source data stream and decomposes it into separate fi les | * @brief takes given source data stream and decomposes it into separate fi les | |||
* | * | |||
* This function bases the output on an XCCDF embedded in the "checklists" | * This function bases the output on an XCCDF embedded in the "checklists" | |||
* element in the datastream. Most of the times this is what everybody want s. | * element in the datastream. Most of the times this is what everybody want s. | |||
* | * | |||
* If you want to decompose just an OVAL file or some other custom behavior , | * If you want to decompose just an OVAL file or some other custom behavior , | |||
* see ds_sds_decompose_custom. | * see ds_sds_decompose_custom. | |||
* | * | |||
* @param input_file | * @param input_file | |||
* File containing a datastream collection we want to decompose parts f rom | * File containing a datastream collection we want to decompose parts f rom | |||
skipping to change at line 149 | skipping to change at line 132 | |||
* @param target_file | * @param target_file | |||
* Path to the file where the result data stream will be stored | * Path to the file where the result data stream will be stored | |||
* | * | |||
* @returns | * @returns | |||
* 0 if no errors were encountered | * 0 if no errors were encountered | |||
* -1 in case of errors | * -1 in case of errors | |||
*/ | */ | |||
int ds_rds_create(const char* sds_file, const char* xccdf_result_file, | int ds_rds_create(const char* sds_file, const char* xccdf_result_file, | |||
const char** oval_result_files, const char* target_file); | const char** oval_result_files, const char* target_file); | |||
/** | ||||
* @struct ds_stream_index | ||||
* | ||||
* Contains information about one particular "<data-stream>" element in | ||||
* the datastream collection (also called SDS = source datastream). Is | ||||
* contained inside ds_sds_index which indexes the entire datastream collec | ||||
tion. | ||||
* | ||||
* Only contains IDs, does not contain the data of components themselves! | ||||
* See ds_sds_decompose for that. | ||||
* | ||||
* Inside it are components divided into categories called "containers". | ||||
* These are "checks", "checklists", "dictionaries" and "extended-component | ||||
s". | ||||
* See the specification for more details about their meaning. | ||||
* | ||||
* @see ds_sds_index | ||||
*/ | ||||
struct ds_stream_index; | ||||
/// @memberof ds_stream_index | ||||
struct ds_stream_index* ds_stream_index_new(void); | ||||
/// @memberof ds_stream_index | ||||
void ds_stream_index_free(struct ds_stream_index* s); | ||||
/** | ||||
* @brief Gets ID of the <data-stream> element the index represents. | ||||
* | ||||
* @memberof ds_stream_index | ||||
*/ | ||||
const char* ds_stream_index_get_id(struct ds_stream_index* s); | ||||
/** | ||||
* @brief Timestamp of creation OR modification of the <data-stream> elemen | ||||
t the index represents. | ||||
* | ||||
* @memberof ds_stream_index | ||||
*/ | ||||
const char* ds_stream_index_get_timestamp(struct ds_stream_index* s); | ||||
/** | ||||
* @brief scap-version of the the <data-stream> element the index represent | ||||
s. | ||||
* | ||||
* @memberof ds_stream_index | ||||
*/ | ||||
const char* ds_stream_index_get_version(struct ds_stream_index* s); | ||||
/** | ||||
* @brief Retrieves iterator over all components inside the <checks> elemen | ||||
t. | ||||
* | ||||
* @memberof ds_stream_index | ||||
*/ | ||||
struct oscap_string_iterator* ds_stream_index_get_checks(struct ds_stream_i | ||||
ndex* s); | ||||
/** | ||||
* @brief Retrieves iterator over all components inside the <checklists> el | ||||
ement. | ||||
* | ||||
* @memberof ds_stream_index | ||||
*/ | ||||
struct oscap_string_iterator* ds_stream_index_get_checklists(struct ds_stre | ||||
am_index* s); | ||||
/** | ||||
* @brief Retrieves iterator over all components inside the <dictionaries> | ||||
element. | ||||
* | ||||
* @memberof ds_stream_index | ||||
*/ | ||||
struct oscap_string_iterator* ds_stream_index_get_dictionaries(struct ds_st | ||||
ream_index* s); | ||||
/** | ||||
* @brief Retrieves iterator over all components inside the <extended-compo | ||||
nents> element. | ||||
* | ||||
* @memberof ds_stream_index | ||||
*/ | ||||
struct oscap_string_iterator* ds_stream_index_get_extended_components(struc | ||||
t ds_stream_index* s); | ||||
/** | ||||
* @struct ds_sds_index | ||||
* | ||||
* Represents <data-stream-collection> element - the root element of each | ||||
* source datastream. Its purpose is to provide IDs and other metadata. | ||||
* | ||||
* Contains a list of ds_stream_index structures, each representing one | ||||
* data-stream inside the collection. | ||||
* | ||||
* @see ds_stream_index | ||||
*/ | ||||
struct ds_sds_index; | ||||
/// @memberof ds_sds_index | ||||
struct ds_sds_index* ds_sds_index_new(void); | ||||
/// @memberof ds_sds_index | ||||
void ds_sds_index_free(struct ds_sds_index* s); | ||||
/** | ||||
* @brief retrieves a stream index by data-stream ID | ||||
* | ||||
* @memberof ds_sds_index | ||||
*/ | ||||
struct ds_stream_index* ds_sds_index_get_stream(struct ds_sds_index* s, con | ||||
st char* stream_id); | ||||
/** | ||||
* @brief retrieves all streams indexed inside this structure | ||||
* | ||||
* @memberof ds_sds_index | ||||
*/ | ||||
struct ds_stream_index_iterator* ds_sds_index_get_streams(struct ds_sds_ind | ||||
ex* s); | ||||
/** | ||||
* @brief imports given source datastream and indexes it | ||||
* | ||||
* @memberof ds_sds_index | ||||
*/ | ||||
struct ds_sds_index *ds_sds_index_import(const char* file); | ||||
/** | ||||
* @struct ds_stream_index_iterator | ||||
* @see oscap_iterator | ||||
*/ | ||||
struct ds_stream_index_iterator; | ||||
/// @memberof ds_stream_index_iterator | ||||
struct ds_stream_index *ds_stream_index_iterator_next(struct ds_stream_inde | ||||
x_iterator *it); | ||||
/// @memberof ds_stream_index_iterator | ||||
bool ds_stream_index_iterator_has_more(struct ds_stream_index_iterator *it) | ||||
; | ||||
/// @memberof ds_stream_index_iterator | ||||
void ds_stream_index_iterator_free(struct ds_stream_index_iterator *it); | ||||
/************************************************************/ | /************************************************************/ | |||
/** @} End of DS group */ | /** @} End of DS group */ | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
17 lines changed or deleted | 140 lines changed or added | |||
xccdf_benchmark.h | xccdf_benchmark.h | |||
---|---|---|---|---|
skipping to change at line 117 | skipping to change at line 117 | |||
} xccdf_operator_t; | } xccdf_operator_t; | |||
/// Boolean operators for logical expressions | /// Boolean operators for logical expressions | |||
typedef enum { | typedef enum { | |||
XCCDF_OPERATOR_AND = 0x0002, ///< Logical and. | XCCDF_OPERATOR_AND = 0x0002, ///< Logical and. | |||
XCCDF_OPERATOR_OR = 0x0003, ///< Logical or. | XCCDF_OPERATOR_OR = 0x0003, ///< Logical or. | |||
} xccdf_bool_operator_t; | } xccdf_bool_operator_t; | |||
/// XCCDF error, complexity, disruption, or severity level | /// XCCDF error, complexity, disruption, or severity level | |||
typedef enum { | typedef enum { | |||
XCCDF_LEVEL_NOT_DEFINED = 0, | ||||
XCCDF_UNKNOWN = 1, ///< Unknown. | XCCDF_UNKNOWN = 1, ///< Unknown. | |||
XCCDF_INFO, ///< Info. | XCCDF_INFO, ///< Info. | |||
XCCDF_LOW, ///< Low. | XCCDF_LOW, ///< Low. | |||
XCCDF_MEDIUM, ///< Medium. | XCCDF_MEDIUM, ///< Medium. | |||
XCCDF_HIGH ///< High. | XCCDF_HIGH ///< High. | |||
} xccdf_level_t; | } xccdf_level_t; | |||
/// Severity of an xccdf_message. | /// Severity of an xccdf_message. | |||
typedef enum { | typedef enum { | |||
XCCDF_MSG_INFO = XCCDF_INFO, ///< Info. | XCCDF_MSG_INFO = XCCDF_INFO, ///< Info. | |||
skipping to change at line 983 | skipping to change at line 984 | |||
/// @memberof xccdf_target_identifier | /// @memberof xccdf_target_identifier | |||
void xccdf_target_identifier_free(struct xccdf_target_identifier *ti); | void xccdf_target_identifier_free(struct xccdf_target_identifier *ti); | |||
/// @memberof xccdf_instance | /// @memberof xccdf_instance | |||
struct xccdf_instance *xccdf_instance_new(void); | struct xccdf_instance *xccdf_instance_new(void); | |||
/// @memberof xccdf_instance | /// @memberof xccdf_instance | |||
struct xccdf_instance * xccdf_instance_clone(const struct xccdf_instance * instance); | struct xccdf_instance * xccdf_instance_clone(const struct xccdf_instance * instance); | |||
/// @memberof xccdf_instance | /// @memberof xccdf_instance | |||
void xccdf_instance_free(struct xccdf_instance *inst); | void xccdf_instance_free(struct xccdf_instance *inst); | |||
/* | ||||
* Get an iterator to the list of XCCDF value's possible (or suggested) val | ||||
ues. | ||||
* @ralates xccdf_value | ||||
* @retval NULL on failure (e.g. the value is not a string) | ||||
*/ | ||||
// struct oscap_string_iterator* xccdf_value_choices_string(const struct xc | ||||
cdf_value* value); | ||||
/** | ||||
* Get an iterator to the XCCDF value's source URIs. | ||||
* @memberof xccdf_value | ||||
*/ | ||||
/* struct oscap_string_iterator* xccdf_value_get_sources(const struct xccdf | ||||
_value* value); TODO */ | ||||
/// @memberof xccdf_value_instance | /// @memberof xccdf_value_instance | |||
struct oscap_string_iterator *xccdf_value_instance_get_choices(const struct xccdf_value_instance *item); | struct oscap_string_iterator *xccdf_value_instance_get_choices(const struct xccdf_value_instance *item); | |||
/************************************************************/ | /************************************************************/ | |||
/** | /** | |||
* @name Iterators | * @name Iterators | |||
* @{ | * @{ | |||
* */ | * */ | |||
/** | /** | |||
skipping to change at line 1688 | skipping to change at line 1676 | |||
* @memberof xccdf_item | * @memberof xccdf_item | |||
*/ | */ | |||
struct oscap_string_iterator *xccdf_item_get_conflicts(const struct xccdf_i tem* item); | struct oscap_string_iterator *xccdf_item_get_conflicts(const struct xccdf_i tem* item); | |||
/** | /** | |||
* @memberof xccdf_item | * @memberof xccdf_item | |||
*/ | */ | |||
struct oscap_stringlist_iterator *xccdf_item_get_requires(const struct xccd f_item* item); | struct oscap_stringlist_iterator *xccdf_item_get_requires(const struct xccd f_item* item); | |||
/** | /** | |||
* @memberof xccdf_item | * @memberof xccdf_item | |||
*/ | */ | |||
xccdf_status_type_t xccdf_item_get_current_status(const struct xccdf_item * item); | struct xccdf_status * xccdf_item_get_current_status(const struct xccdf_item *item); | |||
/** | /** | |||
* @memberof xccdf_item | * @memberof xccdf_item | |||
*/ | */ | |||
bool xccdf_item_get_hidden(const struct xccdf_item *item); | bool xccdf_item_get_hidden(const struct xccdf_item *item); | |||
/** | /** | |||
* @memberof xccdf_item | * @memberof xccdf_item | |||
*/ | */ | |||
bool xccdf_item_get_selected(const struct xccdf_item *item); | bool xccdf_item_get_selected(const struct xccdf_item *item); | |||
/** | /** | |||
* @memberof xccdf_item | * @memberof xccdf_item | |||
skipping to change at line 1800 | skipping to change at line 1788 | |||
* @memberof xccdf_benchmark | * @memberof xccdf_benchmark | |||
*/ | */ | |||
struct oscap_reference_iterator *xccdf_benchmark_get_references(const struc t xccdf_benchmark *benchmark); | struct oscap_reference_iterator *xccdf_benchmark_get_references(const struc t xccdf_benchmark *benchmark); | |||
/** | /** | |||
* @memberof xccdf_benchmark | * @memberof xccdf_benchmark | |||
*/ | */ | |||
struct oscap_string_iterator *xccdf_benchmark_get_platforms(const struct xc cdf_benchmark *benchmark); | struct oscap_string_iterator *xccdf_benchmark_get_platforms(const struct xc cdf_benchmark *benchmark); | |||
/** | /** | |||
* @memberof xccdf_benchmark | * @memberof xccdf_benchmark | |||
*/ | */ | |||
xccdf_status_type_t xccdf_benchmark_get_status_current(const struct xccdf_b enchmark *benchmark); | struct xccdf_status * xccdf_benchmark_get_status_current(const struct xccdf _benchmark *benchmark); | |||
/** | /** | |||
* @memberof xccdf_benchmark | * @memberof xccdf_benchmark | |||
*/ | */ | |||
struct xccdf_plain_text_iterator *xccdf_benchmark_get_plain_texts(const str uct xccdf_benchmark *item); | struct xccdf_plain_text_iterator *xccdf_benchmark_get_plain_texts(const str uct xccdf_benchmark *item); | |||
/** | /** | |||
* @memberof xccdf_benchmark | * @memberof xccdf_benchmark | |||
*/ | */ | |||
struct xccdf_result_iterator* xccdf_benchmark_get_results(const struct xccd f_benchmark *bench); | struct xccdf_result_iterator* xccdf_benchmark_get_results(const struct xccd f_benchmark *bench); | |||
/** | /** | |||
* @memberof xccdf_benchmark | * @memberof xccdf_benchmark | |||
skipping to change at line 1941 | skipping to change at line 1929 | |||
* @memberof xccdf_profile | * @memberof xccdf_profile | |||
*/ | */ | |||
struct oscap_reference_iterator *xccdf_profile_get_dc_statuses(const struct xccdf_profile *profile); | struct oscap_reference_iterator *xccdf_profile_get_dc_statuses(const struct xccdf_profile *profile); | |||
/** | /** | |||
* @memberof xccdf_profile | * @memberof xccdf_profile | |||
*/ | */ | |||
struct oscap_reference_iterator *xccdf_profile_get_references(const struct xccdf_profile *profile); | struct oscap_reference_iterator *xccdf_profile_get_references(const struct xccdf_profile *profile); | |||
/** | /** | |||
* @memberof xccdf_profile | * @memberof xccdf_profile | |||
*/ | */ | |||
xccdf_status_type_t xccdf_profile_get_status_current(const struct xccdf_pro | struct xccdf_status * xccdf_profile_get_status_current(const struct xccdf_p | |||
file *profile); | rofile *profile); | |||
/** | ||||
* @memberof xccdf_profile | ||||
*/ | ||||
/* const char* xccdf_profile_note_get_tag(const struct xccdf_profile* profi | ||||
le); TODO */ | ||||
/** | /** | |||
* @memberof xccdf_profile | * @memberof xccdf_profile | |||
*/ | */ | |||
struct xccdf_select_iterator *xccdf_profile_get_selects(const struct xccdf_ profile *profile); | struct xccdf_select_iterator *xccdf_profile_get_selects(const struct xccdf_ profile *profile); | |||
/** | /** | |||
* @memberof xccdf_profile | * @memberof xccdf_profile | |||
*/ | */ | |||
struct xccdf_setvalue_iterator *xccdf_profile_get_setvalues(const struct xc cdf_profile *profile); | struct xccdf_setvalue_iterator *xccdf_profile_get_setvalues(const struct xc cdf_profile *profile); | |||
/** | /** | |||
* @memberof xccdf_profile | * @memberof xccdf_profile | |||
skipping to change at line 2057 | skipping to change at line 2041 | |||
* @memberof xccdf_rule | * @memberof xccdf_rule | |||
*/ | */ | |||
struct oscap_reference_iterator *xccdf_rule_get_dc_statuses(const struct xc cdf_rule *rule); | struct oscap_reference_iterator *xccdf_rule_get_dc_statuses(const struct xc cdf_rule *rule); | |||
/** | /** | |||
* @memberof xccdf_rule | * @memberof xccdf_rule | |||
*/ | */ | |||
struct oscap_reference_iterator *xccdf_rule_get_references(const struct xcc df_rule *rule); | struct oscap_reference_iterator *xccdf_rule_get_references(const struct xcc df_rule *rule); | |||
/** | /** | |||
* @memberof xccdf_rule | * @memberof xccdf_rule | |||
*/ | */ | |||
xccdf_status_type_t xccdf_rule_get_status_current(const struct xccdf_rule * rule); | struct xccdf_status * xccdf_rule_get_status_current(const struct xccdf_rule *rule); | |||
/** | /** | |||
* @memberof xccdf_rule | * @memberof xccdf_rule | |||
*/ | */ | |||
const char *xccdf_rule_get_impact_metric(const struct xccdf_rule *rule); | const char *xccdf_rule_get_impact_metric(const struct xccdf_rule *rule); | |||
/** | /** | |||
* @memberof xccdf_rule | * @memberof xccdf_rule | |||
*/ | */ | |||
xccdf_role_t xccdf_rule_get_role(const struct xccdf_rule *rule); | xccdf_role_t xccdf_rule_get_role(const struct xccdf_rule *rule); | |||
/** | /** | |||
* @memberof xccdf_rule | * @memberof xccdf_rule | |||
skipping to change at line 2161 | skipping to change at line 2145 | |||
bool xccdf_group_get_selected(const struct xccdf_group *group); | bool xccdf_group_get_selected(const struct xccdf_group *group); | |||
/// @memberof xccdf_group | /// @memberof xccdf_group | |||
struct oscap_string_iterator *xccdf_group_get_platforms(const struct xccdf_ group *group); | struct oscap_string_iterator *xccdf_group_get_platforms(const struct xccdf_ group *group); | |||
/// @memberof xccdf_group | /// @memberof xccdf_group | |||
struct xccdf_status_iterator *xccdf_group_get_statuses(const struct xccdf_g roup *group); | struct xccdf_status_iterator *xccdf_group_get_statuses(const struct xccdf_g roup *group); | |||
/// @memberof xccdf_group | /// @memberof xccdf_group | |||
struct oscap_reference_iterator *xccdf_group_get_dc_statuses(const struct x ccdf_group *group); | struct oscap_reference_iterator *xccdf_group_get_dc_statuses(const struct x ccdf_group *group); | |||
/// @memberof xccdf_group | /// @memberof xccdf_group | |||
struct oscap_reference_iterator *xccdf_group_get_references(const struct xc cdf_group *group); | struct oscap_reference_iterator *xccdf_group_get_references(const struct xc cdf_group *group); | |||
/// @memberof xccdf_group | /// @memberof xccdf_group | |||
xccdf_status_type_t xccdf_group_get_status_current(const struct xccdf_group *group); | struct xccdf_status * xccdf_group_get_status_current(const struct xccdf_gro up *group); | |||
/// @memberof xccdf_group | /// @memberof xccdf_group | |||
struct oscap_string_iterator *xccdf_group_get_conflicts(const struct xccdf_ group* group); | struct oscap_string_iterator *xccdf_group_get_conflicts(const struct xccdf_ group* group); | |||
/// @memberof xccdf_group | /// @memberof xccdf_group | |||
struct oscap_stringlist_iterator *xccdf_group_get_requires(const struct xcc df_group* group); | struct oscap_stringlist_iterator *xccdf_group_get_requires(const struct xcc df_group* group); | |||
/// @memberof xccdf_group | /// @memberof xccdf_group | |||
struct oscap_string_iterator *xccdf_group_get_metadata(const struct xccdf_g roup *group); | struct oscap_string_iterator *xccdf_group_get_metadata(const struct xccdf_g roup *group); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
struct oscap_text_iterator *xccdf_value_get_title(const struct xccdf_value *value); | struct oscap_text_iterator *xccdf_value_get_title(const struct xccdf_value *value); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
skipping to change at line 2192 | skipping to change at line 2176 | |||
bool xccdf_value_get_hidden(const struct xccdf_value *value); | bool xccdf_value_get_hidden(const struct xccdf_value *value); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
bool xccdf_value_get_interactive(const struct xccdf_value *value); | bool xccdf_value_get_interactive(const struct xccdf_value *value); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
struct xccdf_status_iterator *xccdf_value_get_statuses(const struct xccdf_v alue *value); | struct xccdf_status_iterator *xccdf_value_get_statuses(const struct xccdf_v alue *value); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
struct oscap_reference_iterator *xccdf_value_get_dc_statuses(const struct x ccdf_value *value); | struct oscap_reference_iterator *xccdf_value_get_dc_statuses(const struct x ccdf_value *value); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
struct oscap_reference_iterator *xccdf_value_get_references(const struct xc cdf_value *value); | struct oscap_reference_iterator *xccdf_value_get_references(const struct xc cdf_value *value); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
xccdf_status_type_t xccdf_value_get_status_current(const struct xccdf_value *value); | struct xccdf_status * xccdf_value_get_status_current(const struct xccdf_val ue *value); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
xccdf_value_type_t xccdf_value_get_type(const struct xccdf_value *value); | xccdf_value_type_t xccdf_value_get_type(const struct xccdf_value *value); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
xccdf_interface_hint_t xccdf_value_get_interface_hint(const struct xccdf_va lue *value); | xccdf_interface_hint_t xccdf_value_get_interface_hint(const struct xccdf_va lue *value); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
xccdf_operator_t xccdf_value_get_oper(const struct xccdf_value *value); | xccdf_operator_t xccdf_value_get_oper(const struct xccdf_value *value); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
struct xccdf_value_instance *xccdf_value_get_instance_by_selector(const str uct xccdf_value *value, const char *selector); | struct xccdf_value_instance *xccdf_value_get_instance_by_selector(const str uct xccdf_value *value, const char *selector); | |||
/// @memberof xccdf_value | /// @memberof xccdf_value | |||
bool xccdf_value_add_instance(struct xccdf_value *value, struct xccdf_value _instance *instance); | bool xccdf_value_add_instance(struct xccdf_value *value, struct xccdf_value _instance *instance); | |||
skipping to change at line 2272 | skipping to change at line 2256 | |||
* Return value's parent in the grouping hierarchy. | * Return value's parent in the grouping hierarchy. | |||
* Returned item will be either a value or a benchmark. | * Returned item will be either a value or a benchmark. | |||
* @memberof xccdf_value | * @memberof xccdf_value | |||
*/ | */ | |||
struct xccdf_item *xccdf_value_get_parent(const struct xccdf_value *value); | struct xccdf_item *xccdf_value_get_parent(const struct xccdf_value *value); | |||
/// @memberof xccdf_status | /// @memberof xccdf_status | |||
time_t xccdf_status_get_date(const struct xccdf_status *status); | time_t xccdf_status_get_date(const struct xccdf_status *status); | |||
/// @memberof xccdf_status | /// @memberof xccdf_status | |||
xccdf_status_type_t xccdf_status_get_status(const struct xccdf_status *stat us); | xccdf_status_type_t xccdf_status_get_status(const struct xccdf_status *stat us); | |||
/// @memberof xccdf_status | ||||
const char *xccdf_status_type_to_text(xccdf_status_type_t id); | ||||
/// @memberof xccdf_notice | /// @memberof xccdf_notice | |||
const char *xccdf_notice_get_id(const struct xccdf_notice *notice); | const char *xccdf_notice_get_id(const struct xccdf_notice *notice); | |||
/// @memberof xccdf_notice | /// @memberof xccdf_notice | |||
struct oscap_text *xccdf_notice_get_text(const struct xccdf_notice *notice) ; | struct oscap_text *xccdf_notice_get_text(const struct xccdf_notice *notice) ; | |||
/// @memberof xccdf_model | /// @memberof xccdf_model | |||
const char *xccdf_model_get_system(const struct xccdf_model *model); | const char *xccdf_model_get_system(const struct xccdf_model *model); | |||
/// @memberof xccdf_model | ||||
/* const char* xccdf_model_get_param(const struct xccdf_model* model, const | ||||
char* param_name); TODO */ | ||||
/// @memberof xccdf_ident | /// @memberof xccdf_ident | |||
const char *xccdf_ident_get_id(const struct xccdf_ident *ident); | const char *xccdf_ident_get_id(const struct xccdf_ident *ident); | |||
/// @memberof xccdf_ident | /// @memberof xccdf_ident | |||
const char *xccdf_ident_get_system(const struct xccdf_ident *ident); | const char *xccdf_ident_get_system(const struct xccdf_ident *ident); | |||
/// @memberof xccdf_check | /// @memberof xccdf_check | |||
const char *xccdf_check_get_id(const struct xccdf_check *check); | const char *xccdf_check_get_id(const struct xccdf_check *check); | |||
/** | /** | |||
* True if the check is a complex check. | * True if the check is a complex check. | |||
* @memberof xccdf_check | * @memberof xccdf_check | |||
End of changes. 10 change blocks. | ||||
31 lines changed or deleted | 11 lines changed or added | |||
xccdf_policy.h | xccdf_policy.h | |||
---|---|---|---|---|
skipping to change at line 89 | skipping to change at line 89 | |||
* is always user data as registered. Second argument defines the query. Th ird argument is | * is always user data as registered. Second argument defines the query. Th ird argument is | |||
* dependent on query and defined as follows: | * dependent on query and defined as follows: | |||
* - (const char *)href -- for POLICY_ENGINE_QUERY_NAMES_FOR_HREF | * - (const char *)href -- for POLICY_ENGINE_QUERY_NAMES_FOR_HREF | |||
* | * | |||
* Expected return type depends also on query as follows: | * Expected return type depends also on query as follows: | |||
* - (struct oscap_stringlists *) -- for POLICY_ENGINE_QUERY_NAMES_FOR_HRE F | * - (struct oscap_stringlists *) -- for POLICY_ENGINE_QUERY_NAMES_FOR_HRE F | |||
* - NULL shall be returned if the function doesn't understand the query. | * - NULL shall be returned if the function doesn't understand the query. | |||
*/ | */ | |||
typedef void *(*xccdf_policy_engine_query_fn) (void *, xccdf_policy_engine_ query_t, void *); | typedef void *(*xccdf_policy_engine_query_fn) (void *, xccdf_policy_engine_ query_t, void *); | |||
/** | ||||
* Type of function which implements OpenSCAP checking engine. | ||||
* | ||||
* This function defines basic interface between XCCDF module and thee chec | ||||
king engine. | ||||
* For each checking engine required for evaluation there should be at leas | ||||
t one such | ||||
* function registerd. The registered function is then used by xccdf_policy | ||||
module to | ||||
* perform evaluation on the machine. | ||||
*/ | ||||
typedef xccdf_test_result_type_t (*xccdf_policy_engine_eval_fn) (struct xcc | ||||
df_policy *policy, const char *rule_id, const char *definition_id, const ch | ||||
ar *href_if, struct xccdf_value_binding_iterator *value_binding_it, struct | ||||
xccdf_check_import_iterator *check_imports_it, void *user_data); | ||||
/************************************************************/ | /************************************************************/ | |||
/** | /** | |||
* Constructor of Policy Model structure | * Constructor of Policy Model structure | |||
* @param benchmark Struct xccdf_benchmark with benchmark model | * @param benchmark Struct xccdf_benchmark with benchmark model | |||
* @return new xccdf_policy_model | * @return new xccdf_policy_model | |||
* @memberof xccdf_policy_model | * @memberof xccdf_policy_model | |||
*/ | */ | |||
struct xccdf_policy_model *xccdf_policy_model_new(struct xccdf_benchmark *b enchmark); | struct xccdf_policy_model *xccdf_policy_model_new(struct xccdf_benchmark *b enchmark); | |||
skipping to change at line 134 | skipping to change at line 144 | |||
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 | * Registers an additional CPE dictionary for applicability testing | |||
* The ones embedded in the evaluated XCCDF take precedence! | * The one embedded in the evaluated XCCDF take precedence! | |||
*/ | */ | |||
bool xccdf_policy_model_add_cpe_dict(struct xccdf_policy_model * model, con st char * cpe_dict); | bool xccdf_policy_model_add_cpe_dict(struct xccdf_policy_model * model, con st char * cpe_dict); | |||
/** | /** | |||
* Registers an additional CPE lang model for applicability testing | ||||
* The one embedded in the evaluated XCCDF take precedence! | ||||
*/ | ||||
bool xccdf_policy_model_add_cpe_lang_model(struct xccdf_policy_model * mode | ||||
l, const char * cpe_lang); | ||||
/** | ||||
* Registers an additional CPE resource (either dictionary or language) | ||||
* Autodetects given file and acts accordingly. | ||||
* The one embedded in the evaluated XCCDF take precedence! | ||||
*/ | ||||
bool xccdf_policy_model_add_cpe_autodetect(struct xccdf_policy_model *model | ||||
, const char* filepath); | ||||
/** | ||||
* 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 | |||
* | ||||
* @deprecated This function is deprecated by xccdf_policy_model_register_e | ||||
ngine_and_query_callback | ||||
* and might be dropped from future releases. | ||||
*/ | */ | |||
bool xccdf_policy_model_register_engine_callback(struct xccdf_policy_model * model, char * sys, void * func, void * usr); | OSCAP_DEPRECATED(bool xccdf_policy_model_register_engine_callback(struct xc cdf_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 eval_fn Callback - pointer to function called by XCCDF Policy sys tem 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, xccdf_policy_engine_eval_fn eval_fn, void *usr , xccdf_policy_engine_query_fn query_fn); | |||
typedef int (*policy_reporter_output)(struct xccdf_rule_result *, void *); | 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 | |||
skipping to change at line 387 | skipping to change at line 413 | |||
/** | /** | |||
* Call the checking engine for each selected rule in given policy structur e | * Call the checking engine for each selected rule in given policy structur e | |||
* @param policy given Policy to evaluate | * @param policy given Policy to evaluate | |||
* @memberof xccdf_policy | * @memberof xccdf_policy | |||
* @return true if evaluation pass or false in case of error | * @return true if evaluation pass or false in case of error | |||
* \par Example | * \par Example | |||
* Before each policy evaluation user has to register callback that will be called for each check. | * Before each policy evaluation user has to register callback that will be called for each check. | |||
* Every checking engine must have registered callback or the particular ch eck will be skipped. | * Every checking engine must have registered callback or the particular ch eck will be skipped. | |||
* In the code below is used the predefined function \ref oval_agent_eval_r ule for evaluation OVAL checks: | * In the code below is used the predefined function \ref oval_agent_eval_r ule for evaluation OVAL checks: | |||
* \code | * \code | |||
* xccdf_policy_model_register_engine_callback(policy_model, "http://oval.m itre.org/XMLSchema/oval-definitions-5", oval_agent_eval_rule, (void *) usr) ; | * xccdf_policy_model_register_engine_oval(policy_mode, agent_session) | |||
* \endcode | * \endcode | |||
* \par | * \par | |||
* If you use this predefined OVAL callback, user data structure (last para meter of register function) \b MUST be of type \ref\a oval_agent_session_t: | * If you use this predefined OVAL callback, user data structure (last para meter of register function) \b MUST be of type \ref\a oval_agent_session_t: | |||
* \code | * \code | |||
* struct oval_agent_session * sess = oval_agent_new_session((struct oval_d efinition_model *) model, "name-of-file"); | * struct oval_agent_session * sess = oval_agent_new_session((struct oval_d efinition_model *) model, "name-of-file"); | |||
* \endcode | * \endcode | |||
* */ | * */ | |||
struct xccdf_result * xccdf_policy_evaluate(struct xccdf_policy * policy); | struct xccdf_result * xccdf_policy_evaluate(struct xccdf_policy * policy); | |||
/** | /** | |||
End of changes. 7 change blocks. | ||||
4 lines changed or deleted | 39 lines changed or added | |||