00001 00014 /* 00015 * Copyright 2008 Red Hat Inc., Durham, North Carolina. 00016 * All Rights Reserved. 00017 * 00018 * This library is free software; you can redistribute it and/or 00019 * modify it under the terms of the GNU Lesser General Public 00020 * License as published by the Free Software Foundation; either 00021 * version 2.1 of the License, or (at your option) any later version. 00022 * 00023 * This library is distributed in the hope that it will be useful, 00024 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00025 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00026 * Lesser General Public License for more details. 00027 * 00028 * You should have received a copy of the GNU Lesser General Public 00029 * License along with this library; if not, write to the Free Software 00030 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00031 * 00032 * Authors: 00033 * "Daniel Kopecek" <dkopecek@redhat.com> 00034 */ 00035 00036 #pragma once 00037 #ifndef OVAL_PROBE_H 00038 #define OVAL_PROBE_H 00039 00040 #include <stdarg.h> 00041 #include <stdint.h> 00042 #include "oval_definitions.h" 00043 #include "oval_system_characteristics.h" 00044 00045 typedef struct oval_pctx oval_pctx_t; 00046 00051 oval_pctx_t *oval_pctx_new(struct oval_syschar_model *model); 00052 00057 void oval_pctx_free(oval_pctx_t *pctx) __attribute__ ((nonnull(1))); 00058 00059 /* 00060 * probe context flags 00061 */ 00062 #define OVAL_PCTX_FLAG_NOREPLY 0x0001 /* don't send probe result to library - just an ack */ 00063 #define OVAL_PCTX_FLAG_NORECONN 0x0002 /* don't try to reconnect on fatal errors */ 00064 #define OVAL_PCTX_FLAG_RUNALL 0x0004 /* execute all probes when executing the first */ 00065 #define OVAL_PCTX_FLAG_RUNNOW 0x0008 /* execute all probes immediately */ 00066 00067 #define OVAL_PCTX_FLAG_MASK (0x0001|0x0002|0x0004|0x0008) 00068 00074 int oval_pctx_setflag(oval_pctx_t *pctx, uint32_t flags) __attribute__ ((nonnull(1))); 00075 00081 int oval_pctx_unsetflag(oval_pctx_t *pctx, uint32_t flags) __attribute__ ((nonnull(1))); 00082 00083 /* 00084 * probe context attributes 00085 */ 00086 #define OVAL_PCTX_ATTR_RETRY 0x0001 /* set maximum retry count (send, connect) */ 00087 #define OVAL_PCTX_ATTR_RECVTIMEOUT 0x0002 /* set receive timeout - in miliseconds */ 00088 #define OVAL_PCTX_ATTR_SENDTIMEOUT 0x0003 /* set send timeout - in miliseconds */ 00089 #define OVAL_PCTX_ATTR_SCHEME 0x0004 /* set communication scheme */ 00090 #define OVAL_PCTX_ATTR_DIR 0x0005 /* set directory where the probes are located */ 00091 #define OVAL_PCTX_ATTR_MODEL 0x0006 /* set definition model - update registered commands is necessary */ 00092 00099 int oval_pctx_setattr(oval_pctx_t *pctx, uint32_t attr, ...) __attribute__ ((nonnull(1))); 00100 00106 int oval_probe_reset(oval_pctx_t *pctx, oval_subtype_t subtype) __attribute__ ((nonnull(1))); 00107 00113 int oval_probe_close(oval_pctx_t *pctx, oval_subtype_t subtype) __attribute__ ((nonnull(1))); 00114 00119 struct oval_sysinfo *oval_probe_sysinf_eval(oval_pctx_t *pctx) __attribute__ ((nonnull(1))); 00120 00126 struct oval_syschar *oval_probe_object_eval(oval_pctx_t *pctx, struct oval_object *object) __attribute__ ((nonnull(1, 2))); 00127 00128 #endif /* OVAL_PROBE_H */