<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6001.18226" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#000000 size=2>The following proposal is offered in support of <A href="https://www.redhat.com/archives/open-scap-list/2009-April/msg00016.html" name=00016><STRONG><FONT face="Times New Roman" size=3>[Open-scap] Re: OVAL API questions</FONT></STRONG></A>:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>CURRENT: OVAL DEFINITION CONTENT MANAGEMENT:<BR>What we have at present is an object model (Struct oval_object_model) and API for managing oval content. This model is populated by the method load_oval_definitions(struct oval_object_model *, struct import_source *, oval_xml_error_handler, void *), where the import source is a <oval_def:oval_definitions> stream. Notice that load_oval_definitions could well be invoked several times with diferent oval_definition streams but the same oval_object_model. To make sense of this operation requires some explicit business rules. For Example</DIV>
<DIV> </DIV>
<DIV> * No OVAL content model entity (Definition, Object, State, Variable) comprised by the oval_object_model is altered or removed by repeadted executions of load_oval_definitions.</DIV>
<DIV> </DIV>
<DIV>This form of business rule guarantees that the oval_object_model is characterized by a consistent set of model entities specified by id and version. This business rule becomes critical when considering OVAL in a policy composition framework (for example, OVAL application in conjuction with XCCEF).</DIV>
<DIV>The constraints imposed by this rule suggest the addition of the following function.</DIV>
<DIV>struct oval_object_model *update_oval_definitions(struct oval_object_model *oldModel, struct import_source *, oval_xml_error_handler, void *)</DIV>
<DIV>This function differs from load_oval_definitions as follows</DIV>
<DIV> </DIV>
<DIV> * A new oval_object_model is created and returned by the update_oval_definitions<BR> * If the oldModel contains a model entity (id=A, version=V) and the imput_source specifies no entity (id=A, ...) then (id=A, version=V) is contained by the returned model.<BR> * If the oldModel contains a model entity (id=A, version=V1) then the new model contains a content model entity (id=A, version=V2) then the new model contains (id=A, version=V2) if and only if V1<V2, otherwise the returned model contains the entity (id=A, version=V1). <BR> * If the input_source specifies a model entity (id=A, version=V) and the oldModel specifies no entity (id=A, ...) then (id=A, version=V) is contained by the returned model.</DIV>
<DIV> </DIV>
<DIV>The replacement of (id=A, version=V1) with (id=A, version=V2) is driven by the existence of a specification of the latter entity in the import_source offered to update_oval_definitions. As a matter of convenience, we can specify that</DIV>
<DIV> </DIV>
<DIV> struct oval_object_model *model = update_oval_definitions(NULL, source, ...);</DIV>
<DIV> </DIV>
<DIV>is equivalient to </DIV>
<DIV> </DIV>
<DIV> struct oval_object_model *model = oval_object_model_new;<BR> load_oval_definitions(model, source, ...);</DIV>
<DIV><BR>PROPOSED: OVAL SYSCHAR CONTENT MANAGEMENT</DIV>
<DIV>Using the OVAL content management model, we certainly could implement a function of the form:</DIV>
<DIV> void export_system_characteristics(struct oval_object_model*, struct oval_iterator_variable_binding *, export_target *);</DIV>
<DIV>At a more granular level of abstraction we could represent a syschar model having the functions.</DIV>
<DIV> </DIV>
<DIV>struct oval_syschar_model *oval_syschar_model_new(struct oval_object_model *, struct_oval_variable_binding *);</DIV>
<DIV>struct oval_syschar *get_oval_syschar(struct oval_syschar_model, char *object_id);</DIV>
<DIV>struct oval_iterator_syschar *oval_syschar_dependencies(struct oval_syschar *);</DIV>
<DIV> </DIV>
<DIV>The last function takes care of the syschars derived from objects that are composed from object sets.</DIV>
<DIV>This granular model would also provide the function</DIV>
<DIV> </DIV>
<DIV> void export_syschar_model(struct oval_syschar_model *);</DIV>
<DIV> </DIV>
<DIV>which would provide an implementation of export_system_charactaristics.</DIV></BODY></HTML>