00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00029 #ifndef OVAL_AGENT_API_H_
00030 #define OVAL_AGENT_API_H_
00031
00032 #include "oval_definitions.h"
00033 #include "oval_system_characteristics.h"
00034 #include "oval_results.h"
00035
00036
00038 typedef enum {
00039 XML_VALIDITY_WARNING = 1,
00040 XML_VALIDITY_ERROR = 2,
00041 XML_WARNING = 3,
00042 XML_ERROR = 4,
00043 OVAL_LOG_INFO = 15,
00044 OVAL_LOG_DEBUG = 16,
00045 OVAL_LOG_WARN = 17
00046 } oval_xml_severity_t;
00047
00048 struct oval_xml_error {
00049 void *user_arg;
00050 char *message;
00051 oval_xml_severity_t severity;
00052 int line_number;
00053 char *system_id;
00054 };
00055
00057 typedef int (*oval_xml_error_handler) (struct oval_xml_error *, void *user_arg);
00058
00063 struct oval_export_target;
00068 struct oval_import_source;
00069
00075 struct oval_import_source *oval_import_source_new_file(char *filename);
00076
00080 void oval_import_source_free(
00081 struct oval_import_source *source);
00082
00088 struct oval_export_target *oval_export_target_new_file(char *filename, char* encoding);
00089
00093 void oval_export_target_free(struct oval_export_target *target);
00094
00105 struct oval_definition_model;
00120 struct oval_variable_model;
00137 struct oval_syschar_model;
00138
00155 struct oval_results_model;
00156
00170 struct oval_definition_model *oval_definition_model_new(void);
00171
00175 struct oval_definition_model *oval_definition_model_clone(struct oval_definition_model *);
00176
00177
00178
00179
00180
00181 void oval_definition_model_free(struct oval_definition_model * model);
00182
00193 int oval_definition_model_import(
00194 struct oval_definition_model *model,
00195 struct oval_import_source *source,
00196 oval_xml_error_handler error_handler, void *client);
00197
00198
00199
00207 struct oval_definition *oval_definition_model_get_definition(
00208 struct oval_definition_model *model,
00209 char *id);
00210
00218 struct oval_test *oval_definition_model_get_test(
00219 struct oval_definition_model *model,
00220 char *id);
00221
00229 struct oval_object *oval_definition_model_get_object(
00230 struct oval_definition_model *model,
00231 char *id);
00232
00240 struct oval_state *oval_definition_model_get_state(
00241 struct oval_definition_model *model,
00242 char *id);
00243
00251 struct oval_variable *oval_definition_model_get_variable(
00252 struct oval_definition_model *model,
00253 char *id);
00254
00260 struct oval_definition_iterator *oval_definition_model_get_definitions(
00261 struct oval_definition_model *model);
00262
00268 struct oval_test_iterator *oval_definition_model_get_tests(
00269 struct oval_definition_model *model);
00270
00276 struct oval_object_iterator *oval_definition_model_get_objects(
00277 struct oval_definition_model *model);
00278
00284 struct oval_state_iterator *oval_definition_model_get_states(
00285 struct oval_definition_model *model);
00286
00292 struct oval_variable_iterator *oval_definition_model_get_variables(
00293 struct oval_definition_model *model);
00294
00295 int oval_definition_model_export(
00296 struct oval_definition_model *, struct oval_export_target *);
00297
00298
00299 void oval_definition_model_add_definition(struct oval_definition_model *, struct oval_definition *);
00300 void oval_definition_model_add_test(struct oval_definition_model *, struct oval_test *);
00301 void oval_definition_model_add_object(struct oval_definition_model *, struct oval_object *);
00302 void oval_definition_model_add_state(struct oval_definition_model *, struct oval_state *);
00303 void oval_definition_model_add_variable(struct oval_definition_model *, struct oval_variable *);
00304
00308 void oval_definition_model_bind_variable_model
00309 (struct oval_definition_model *, struct oval_variable_model *);
00322 struct oval_variable_model *oval_variable_model_new(void);
00323
00327 struct oval_variable_model *oval_variable_model_clone(struct oval_variable_model *);
00328
00329
00334 void oval_variable_model_free(struct oval_variable_model *);
00335
00345 void oval_variable_model_import
00346 (struct oval_variable_model *,
00347 struct oval_import_source *,
00348 oval_xml_error_handler, void*);
00349
00356 void oval_variable_model_export
00357 (struct oval_variable_model *,
00358 struct oval_export_target *);
00359
00364 struct oval_string_iterator *oval_variable_model_get_variable_ids
00365 (struct oval_variable_model *);
00366
00373 oval_datatype_t oval_variable_model_get_datatype
00374 (struct oval_variable_model *, char *);
00375
00382 const char *oval_variable_model_get_comment
00383 (struct oval_variable_model *, char *);
00384
00391 struct oval_string_iterator *oval_variable_model_get_values
00392 (struct oval_variable_model *, char *);
00393
00394
00395 void oval_variable_model_add(struct oval_variable_model *model, char *varid, const char* comment, oval_datatype_t datatype, char *value);
00396
00411 struct oval_syschar_model *oval_syschar_model_new(
00412 struct oval_definition_model *definition_model);
00413
00417 struct oval_syschar_model *oval_syschar_model_clone(struct oval_syschar_model *);
00418
00423 void oval_syschar_model_free(struct oval_syschar_model *model);
00424
00429 struct oval_definition_model *oval_syschar_model_get_definition_model(
00430 struct oval_syschar_model *model);
00435 struct oval_syschar_iterator *oval_syschar_model_get_syschars(
00436 struct oval_syschar_model *model);
00437
00442 struct oval_sysinfo *oval_syschar_model_get_sysinfo(struct oval_syschar_model *model);
00443
00451 struct oval_syschar *oval_syschar_model_get_syschar(
00452 struct oval_syschar_model *model,
00453 char *object_id);
00454
00455
00459 void oval_syschar_model_bind_variable_model
00460 (struct oval_syschar_model *, struct oval_variable_model *);
00461
00462
00466 void oval_syschar_model_probe_objects(struct oval_syschar_model *);
00467
00471 int oval_syschar_model_export(
00472 struct oval_syschar_model *, struct oval_export_target *);
00473
00477 void oval_syschar_model_import(struct oval_syschar_model*, struct oval_import_source*,
00478 oval_xml_error_handler, void*);
00479
00495 struct oval_results_model *oval_results_model_new(
00496 struct oval_definition_model *definition_model, struct oval_syschar_model **);
00497
00501 struct oval_results_model *oval_results_model_clone(struct oval_results_model *);
00502
00507 void oval_results_model_free(struct oval_results_model *model);
00508
00509
00514 struct oval_definition_model *oval_results_model_get_definition_model
00515 (struct oval_results_model *model);
00516
00521 struct oval_result_system_iterator *oval_results_model_get_systems
00522 (struct oval_results_model *);
00523
00524 void oval_results_model_add_system(struct oval_results_model *, struct oval_result_system *);
00525
00533 struct oval_result_directives *oval_results_model_import
00534 (struct oval_results_model *, struct oval_import_source *,
00535 oval_xml_error_handler, void*);
00536
00540 struct oval_result_directives *oval_result_directives_new(void);
00541
00545 void oval_result_directives_free(struct oval_result_directives *);
00546
00552 int oval_results_model_export(struct oval_results_model *, struct oval_result_directives *, struct oval_export_target *);
00553
00554
00555 struct oval_sysinfo *oval_sysinfo_probe (void);
00556
00560 struct oval_syschar *oval_object_probe(struct oval_object *, struct oval_definition_model *model);
00561
00566 #endif