00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #pragma once
00037 #ifndef PROBE_API_H
00038 #define PROBE_API_H
00039
00040 #include <seap.h>
00041 #include <stdarg.h>
00042 #include <stdint.h>
00043 #include <stdbool.h>
00044 #include <pthread.h>
00045 #include <oval_definitions.h>
00046 #include <oval_system_characteristics.h>
00047 #include <oval_results.h>
00048
00049
00050
00051
00052
00057 SEXP_t *probe_item_build(const char *fmt, ...);
00058
00059
00071 #define probe_item_creat(name, attrs, ...) probe_obj_creat (name, attrs, __VA_ARGS__)
00072
00078 SEXP_t *probe_item_new(const char *name, SEXP_t * attrs);
00079
00087 SEXP_t *probe_item_attr_add(SEXP_t * item, const char *name, SEXP_t * val);
00088
00097 SEXP_t *probe_item_ent_add(SEXP_t * item, const char *name, SEXP_t * attrs, SEXP_t * val);
00098
00104 int probe_item_setstatus(SEXP_t * obj, oval_syschar_status_t status);
00105
00113 int probe_itement_setstatus(SEXP_t * obj, const char *name, uint32_t n, oval_syschar_status_t status);
00114
00118 struct id_desc_t;
00119
00125 SEXP_t *probe_item_newid(struct id_desc_t *id_desc);
00126
00131 void probe_item_resetid(struct id_desc_t *id_desc);
00132
00133
00134
00135
00136
00144 SEXP_t *probe_attr_creat(const char *name, const SEXP_t * val, ...);
00145
00146
00147
00148
00149
00154 SEXP_t *probe_obj_build(const char *fmt, ...);
00155
00167 SEXP_t *probe_obj_creat(const char *name, SEXP_t * attrs, ...);
00168
00175 SEXP_t *probe_obj_new(const char *name, SEXP_t * attrs);
00176
00183 SEXP_t *probe_obj_getent(const SEXP_t * obj, const char *name, uint32_t n);
00184
00192 SEXP_t *probe_obj_getentval(const SEXP_t * obj, const char *name, uint32_t n);
00193
00203 int probe_obj_getentvals(const SEXP_t * obj, const char *name, uint32_t n, SEXP_t ** res);
00204
00210 SEXP_t *probe_obj_getattrval(const SEXP_t * obj, const char *name);
00211
00217 bool probe_obj_attrexists(const SEXP_t * obj, const char *name);
00218
00224 int probe_obj_setstatus(SEXP_t * obj, oval_syschar_status_t status);
00225
00233 int probe_objent_setstatus(SEXP_t * obj, const char *name, uint32_t n, oval_syschar_status_t status);
00234
00239 char *probe_obj_getname(const SEXP_t * obj);
00240
00248 size_t probe_obj_getname_r(const SEXP_t * obj, char *buffer, size_t buflen);
00249
00250
00251
00252
00253
00262 SEXP_t *probe_ent_creat(const char *name, SEXP_t * attrs, SEXP_t * val, ...);
00263
00271 SEXP_t *probe_ent_creat1(const char *name, SEXP_t * attrs, SEXP_t * val);
00272
00280 SEXP_t *probe_ent_attr_add(SEXP_t * ent, const char *name, SEXP_t * val);
00281
00287 SEXP_t *probe_ent_getval(const SEXP_t * ent);
00288
00296 int probe_ent_getvals(const SEXP_t * ent, SEXP_t ** res);
00297
00303 SEXP_t *probe_ent_getattrval(const SEXP_t * ent, const char *name);
00304
00310 bool probe_ent_attrexists(const SEXP_t * ent, const char *name);
00311
00317 int probe_ent_setdatatype(SEXP_t * ent, oval_datatype_t type);
00318
00323 oval_datatype_t probe_ent_getdatatype(const SEXP_t * ent);
00324
00330 int probe_ent_setmask(SEXP_t * ent, bool mask);
00331
00336 bool probe_ent_getmask(const SEXP_t * ent);
00337
00343 int probe_ent_setstatus(SEXP_t * ent, oval_syschar_status_t status);
00344
00349 oval_syschar_status_t probe_ent_getstatus(const SEXP_t * ent);
00350
00355 char *probe_ent_getname(const SEXP_t * ent);
00356
00364 size_t probe_ent_getname_r(const SEXP_t * ent, char *buffer, size_t buflen);
00365
00370 void probe_free(SEXP_t * obj);
00371
00372 #define PROBE_EINVAL 1
00373 #define PROBE_ENOELM 2
00374 #define PROBE_ENOVAL 3
00375 #define PROBE_ENOATTR 4
00376 #define PROBE_EINIT 5
00377 #define PROBE_ENOMEM 6
00378 #define PROBE_EOPNOTSUPP 7
00379 #define PROBE_ERANGE 8
00380 #define PROBE_EDOM 9
00381 #define PROBE_EFAULT 10
00382 #define PROBE_EACCES 11
00383 #define PROBE_ESETEVAL 12
00384 #define PROBE_EFATAL 254
00385 #define PROBE_EUNKNOWN 255
00386
00387
00388 #define OVAL_STATUS_ERROR 1
00389 #define OVAL_STATUS_EXISTS 2
00390 #define OVAL_STATUS_DOESNOTEXIST 3
00391 #define OVAL_STATUS_NOTCOLLECTED 4
00392
00393 #define PROBECMD_STE_FETCH 1
00394 #define PROBECMD_OBJ_EVAL 2
00395
00396 void *probe_init(void) __attribute__ ((unused));
00397 void probe_fini(void *) __attribute__ ((unused));
00398 SEXP_t *probe_main(SEXP_t *, int *, void *) __attribute__ ((nonnull(1, 2)));
00399
00400 #endif