00001
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #pragma once
00041 #ifndef PROBE_API_H
00042 #define PROBE_API_H
00043
00044 #include <seap.h>
00045 #include <stdarg.h>
00046 #include <stdint.h>
00047 #include <stdbool.h>
00048 #include <pthread.h>
00049 #include <oval_definitions.h>
00050 #include <oval_system_characteristics.h>
00051 #include <oval_results.h>
00052
00053
00054
00055
00056
00061 SEXP_t *probe_item_build(const char *fmt, ...);
00062
00063
00075 #define probe_item_creat(name, attrs, ...) probe_obj_creat (name, attrs, __VA_ARGS__)
00076
00082 SEXP_t *probe_item_new(const char *name, SEXP_t * attrs);
00083
00091 SEXP_t *probe_item_attr_add(SEXP_t * item, const char *name, SEXP_t * val);
00092
00101 SEXP_t *probe_item_ent_add(SEXP_t * item, const char *name, SEXP_t * attrs, SEXP_t * val);
00102
00108 int probe_item_setstatus(SEXP_t * obj, oval_syschar_status_t status);
00109
00117 int probe_itement_setstatus(SEXP_t * obj, const char *name, uint32_t n, oval_syschar_status_t status);
00118
00122 struct id_desc_t;
00123
00129 SEXP_t *probe_item_newid(struct id_desc_t *id_desc);
00130
00135 void probe_item_resetid(struct id_desc_t *id_desc);
00136
00137 #define probe_item_getent(item, name, n) probe_obj_getent (item, name, n)
00138
00139
00140
00141
00142
00150 SEXP_t *probe_attr_creat(const char *name, const SEXP_t * val, ...);
00151
00152
00153
00154
00155
00160 SEXP_t *probe_obj_build(const char *fmt, ...);
00161
00173 SEXP_t *probe_obj_creat(const char *name, SEXP_t * attrs, ...);
00174
00181 SEXP_t *probe_obj_new(const char *name, SEXP_t * attrs);
00182
00189 SEXP_t *probe_obj_getent(const SEXP_t * obj, const char *name, uint32_t n);
00190
00198 SEXP_t *probe_obj_getentval(const SEXP_t * obj, const char *name, uint32_t n);
00199
00209 int probe_obj_getentvals(const SEXP_t * obj, const char *name, uint32_t n, SEXP_t ** res);
00210
00216 SEXP_t *probe_obj_getattrval(const SEXP_t * obj, const char *name);
00217
00223 bool probe_obj_attrexists(const SEXP_t * obj, const char *name);
00224
00230 int probe_obj_setstatus(SEXP_t * obj, oval_syschar_status_t status);
00231
00239 int probe_objent_setstatus(SEXP_t * obj, const char *name, uint32_t n, oval_syschar_status_t status);
00240
00245 char *probe_obj_getname(const SEXP_t * obj);
00246
00254 size_t probe_obj_getname_r(const SEXP_t * obj, char *buffer, size_t buflen);
00255
00256
00257
00258
00259
00260 SEXP_t *_probe_cobj_new(oval_syschar_collection_flag_t flag, const SEXP_t *item_list);
00261 SEXP_t *_probe_cobj_get_items(const SEXP_t *cobj);
00262 oval_syschar_collection_flag_t _probe_cobj_get_flag(const SEXP_t *cobj);
00263 oval_syschar_collection_flag_t _probe_cobj_combine_flags(oval_syschar_collection_flag_t f1,
00264 oval_syschar_collection_flag_t f2,
00265 oval_setobject_operation_t op);
00266
00267
00268
00269
00270
00279 SEXP_t *probe_ent_creat(const char *name, SEXP_t * attrs, SEXP_t * val, ...);
00280
00288 SEXP_t *probe_ent_creat1(const char *name, SEXP_t * attrs, SEXP_t * val);
00289
00297 SEXP_t *probe_ent_attr_add(SEXP_t * ent, const char *name, SEXP_t * val);
00298
00304 SEXP_t *probe_ent_getval(const SEXP_t * ent);
00305
00313 int probe_ent_getvals(const SEXP_t * ent, SEXP_t ** res);
00314
00320 SEXP_t *probe_ent_getattrval(const SEXP_t * ent, const char *name);
00321
00327 bool probe_ent_attrexists(const SEXP_t * ent, const char *name);
00328
00334 int probe_ent_setdatatype(SEXP_t * ent, oval_datatype_t type);
00335
00340 oval_datatype_t probe_ent_getdatatype(const SEXP_t * ent);
00341
00347 int probe_ent_setmask(SEXP_t * ent, bool mask);
00348
00353 bool probe_ent_getmask(const SEXP_t * ent);
00354
00360 int probe_ent_setstatus(SEXP_t * ent, oval_syschar_status_t status);
00361
00366 oval_syschar_status_t probe_ent_getstatus(const SEXP_t * ent);
00367
00372 char *probe_ent_getname(const SEXP_t * ent);
00373
00381 size_t probe_ent_getname_r(const SEXP_t * ent, char *buffer, size_t buflen);
00382
00387 void probe_free(SEXP_t * obj);
00388
00389 #define PROBE_EINVAL 1
00390 #define PROBE_ENOELM 2
00391 #define PROBE_ENOVAL 3
00392 #define PROBE_ENOATTR 4
00393 #define PROBE_EINIT 5
00394 #define PROBE_ENOMEM 6
00395 #define PROBE_EOPNOTSUPP 7
00396 #define PROBE_ERANGE 8
00397 #define PROBE_EDOM 9
00398 #define PROBE_EFAULT 10
00399 #define PROBE_EACCES 11
00400 #define PROBE_ESETEVAL 12
00401 #define PROBE_ENOENT 13
00402 #define PROBE_EFATAL 254
00403 #define PROBE_EUNKNOWN 255
00404
00405 #define OVAL_STATUS_UNKNOWN SYSCHAR_STATUS_UNKNOWN
00406 #define OVAL_STATUS_ERROR SYSCHAR_STATUS_ERROR
00407 #define OVAL_STATUS_EXISTS SYSCHAR_STATUS_EXISTS
00408 #define OVAL_STATUS_DOESNOTEXIST SYSCHAR_STATUS_DOES_NOT_EXIST
00409 #define OVAL_STATUS_NOTCOLLECTED SYSCHAR_STATUS_NOT_COLLECTED
00410
00411 #define PROBECMD_STE_FETCH 1
00412 #define PROBECMD_OBJ_EVAL 2
00413
00414 void *probe_init(void) __attribute__ ((unused));
00415 void probe_fini(void *) __attribute__ ((unused));
00416 SEXP_t *probe_main(SEXP_t *, int *, void *) __attribute__ ((nonnull(1, 2)));
00417
00418 #endif