• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

/home/pvrabec/project/openscap/openscap-0.6.6/src/OVAL/probes/public/probe-api.h

Go to the documentation of this file.
00001 
00035 /*
00036  * Copyright 2009 Red Hat Inc., Durham, North Carolina.
00037  * All Rights Reserved.
00038  *
00039  * This library is free software; you can redistribute it and/or
00040  * modify it under the terms of the GNU Lesser General Public
00041  * License as published by the Free Software Foundation; either
00042  * version 2.1 of the License, or (at your option) any later version.
00043  *
00044  * This library is distributed in the hope that it will be useful, 
00045  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00046  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00047  * Lesser General Public License for more details.
00048  *
00049  * You should have received a copy of the GNU Lesser General Public
00050  * License along with this library; if not, write to the Free Software 
00051  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00052  *
00053  * Authors:
00054  *      Daniel Kopecek <dkopecek@redhat.com>
00055  */
00056 
00057 #pragma once
00058 #ifndef PROBE_API_H
00059 #define PROBE_API_H
00060 
00061 #include <seap.h>
00062 #include <stdarg.h>
00063 #include <stdint.h>
00064 #include <stdbool.h>
00065 #include <pthread.h>
00066 #include <oval_definitions.h>
00067 #include <oval_system_characteristics.h>
00068 #include <oval_results.h>
00069 
00070 /*
00071  * items
00072  */
00073 
00078 SEXP_t *probe_item_build(const char *fmt, ...);
00079 
00080 /* SEXP_t *probe_item_creat (const char *name, SEXP_t *attrs, ...); */
00092 SEXP_t *probe_item_creat(const char *name, SEXP_t * attrs, ...);
00093 
00099 SEXP_t *probe_item_new(const char *name, SEXP_t * attrs);
00100 
00108 SEXP_t *probe_item_attr_add(SEXP_t * item, const char *name, SEXP_t * val);
00109 
00118 SEXP_t *probe_item_ent_add(SEXP_t * item, const char *name, SEXP_t * attrs, SEXP_t * val);
00119 
00125 int probe_item_setstatus(SEXP_t * obj, oval_syschar_status_t status);
00126 
00134 int probe_itement_setstatus(SEXP_t * obj, const char *name, uint32_t n, oval_syschar_status_t status);
00135 
00139 struct id_desc_t;
00140 
00146 SEXP_t *probe_item_newid(struct id_desc_t *id_desc);
00147 
00152 void probe_item_resetidctr(struct id_desc_t *id_desc);
00153 
00154 #define probe_item_getent(item, name, n) probe_obj_getent (item, name, n)
00155 
00156 /*
00157  * attributes
00158  */
00159 
00167 SEXP_t *probe_attr_creat(const char *name, const SEXP_t * val, ...);
00168 
00169 /*
00170  * objects
00171  */
00172 
00177 SEXP_t *probe_obj_build(const char *fmt, ...);
00178 
00190 SEXP_t *probe_obj_creat(const char *name, SEXP_t * attrs, ...);
00191 
00198 SEXP_t *probe_obj_new(const char *name, SEXP_t * attrs);
00199 
00206 SEXP_t *probe_obj_getent(const SEXP_t * obj, const char *name, uint32_t n);
00207 
00215 SEXP_t *probe_obj_getentval(const SEXP_t * obj, const char *name, uint32_t n);
00216 
00226 int probe_obj_getentvals(const SEXP_t * obj, const char *name, uint32_t n, SEXP_t ** res);
00227 
00233 SEXP_t *probe_obj_getattrval(const SEXP_t * obj, const char *name);
00234 
00240 bool probe_obj_attrexists(const SEXP_t * obj, const char *name);
00241 
00247 int probe_obj_setstatus(SEXP_t * obj, oval_syschar_status_t status);
00248 
00256 int probe_objent_setstatus(SEXP_t * obj, const char *name, uint32_t n, oval_syschar_status_t status);
00257 
00262 char *probe_obj_getname(const SEXP_t * obj);
00263 
00271 size_t probe_obj_getname_r(const SEXP_t * obj, char *buffer, size_t buflen);
00272 
00273 /*
00274  * collected objects
00275  */
00276 
00277 SEXP_t *probe_cobj_new(oval_syschar_collection_flag_t flag, SEXP_t *msg_list, SEXP_t *item_list);
00278 int probe_cobj_add_msg(SEXP_t *cobj, const SEXP_t *msg);
00279 SEXP_t *probe_cobj_get_msgs(const SEXP_t *cobj);
00280 int probe_cobj_add_item(SEXP_t *cobj, const SEXP_t *item);
00281 SEXP_t *probe_cobj_get_items(const SEXP_t *cobj);
00282 void probe_cobj_set_flag(SEXP_t *cobj, oval_syschar_collection_flag_t flag);
00283 oval_syschar_collection_flag_t probe_cobj_get_flag(const SEXP_t *cobj);
00284 oval_syschar_collection_flag_t probe_cobj_combine_flags(oval_syschar_collection_flag_t f1,
00285                                                         oval_syschar_collection_flag_t f2,
00286                                                         oval_setobject_operation_t op);
00287 oval_syschar_collection_flag_t probe_cobj_compute_flag(SEXP_t *cobj);
00288 
00289 /*
00290  * messages
00291  */
00292 
00293 SEXP_t *probe_msg_creat(oval_message_level_t level, char *message);
00294 
00295 /*
00296  * entities
00297  */
00298 
00307 SEXP_t *probe_ent_creat(const char *name, SEXP_t * attrs, SEXP_t * val, ...);
00308 
00316 SEXP_t *probe_ent_creat1(const char *name, SEXP_t * attrs, SEXP_t * val);
00317 
00325 SEXP_t *probe_ent_attr_add(SEXP_t * ent, const char *name, SEXP_t * val);
00326 
00332 SEXP_t *probe_ent_getval(const SEXP_t * ent);
00333 
00341 int probe_ent_getvals(const SEXP_t * ent, SEXP_t ** res);
00342 
00348 SEXP_t *probe_ent_getattrval(const SEXP_t * ent, const char *name);
00349 
00355 bool probe_ent_attrexists(const SEXP_t * ent, const char *name);
00356 
00362 int probe_ent_setdatatype(SEXP_t * ent, oval_datatype_t type);
00363 
00368 oval_datatype_t probe_ent_getdatatype(const SEXP_t * ent);
00369 
00375 int probe_ent_setmask(SEXP_t * ent, bool mask);
00376 
00381 bool probe_ent_getmask(const SEXP_t * ent);
00382 
00388 int probe_ent_setstatus(SEXP_t * ent, oval_syschar_status_t status);
00389 
00394 oval_syschar_status_t probe_ent_getstatus(const SEXP_t * ent);
00395 
00400 char *probe_ent_getname(const SEXP_t * ent);
00401 
00409 size_t probe_ent_getname_r(const SEXP_t * ent, char *buffer, size_t buflen);
00410 
00415 void probe_free(SEXP_t * obj);
00416 
00417 #define PROBE_EINVAL     1      
00418 #define PROBE_ENOELM     2      
00419 #define PROBE_ENOVAL     3      
00420 #define PROBE_ENOATTR    4      
00421 #define PROBE_EINIT      5      
00422 #define PROBE_ENOMEM     6      
00423 #define PROBE_EOPNOTSUPP 7      
00424 #define PROBE_ERANGE     8      
00425 #define PROBE_EDOM       9      
00426 #define PROBE_EFAULT    10      
00427 #define PROBE_EACCES    11      
00428 #define PROBE_ESETEVAL  12      
00429 #define PROBE_ENOENT    13      
00430 #define PROBE_EFATAL   254      
00431 #define PROBE_EUNKNOWN 255      
00433 #define OVAL_STATUS_UNKNOWN      SYSCHAR_STATUS_UNKNOWN
00434 #define OVAL_STATUS_ERROR        SYSCHAR_STATUS_ERROR
00435 #define OVAL_STATUS_EXISTS       SYSCHAR_STATUS_EXISTS
00436 #define OVAL_STATUS_DOESNOTEXIST SYSCHAR_STATUS_DOES_NOT_EXIST
00437 #define OVAL_STATUS_NOTCOLLECTED SYSCHAR_STATUS_NOT_COLLECTED
00438 
00439 #define PROBECMD_STE_FETCH 1 
00440 #define PROBECMD_OBJ_EVAL  2 
00441 #define PROBECMD_RESET     3 
00443 void *probe_init(void) __attribute__ ((unused));
00444 void probe_fini(void *) __attribute__ ((unused));
00445 int probe_main(SEXP_t *, SEXP_t *, void *) __attribute__ ((nonnull(1, 2)));
00446 
00447 #define PROBE_VARREF_HANDLING 0
00448 #define PROBE_RESULT_CACHING  1
00449 
00450 int probe_setoption(int option, ...);
00451 
00452 SEXP_t *probe_prepare_filters(SEXP_t *obj);
00453 bool probe_item_filtered(SEXP_t *item, SEXP_t *filters);
00454 
00455 int probe_result_additem(SEXP_t *result, SEXP_t *item);
00456 
00457 #endif                          /* PROBE_API_H */

Generated on Thu Dec 9 2010 for Open SCAP Library by  doxygen 1.7.1