Data Structures | Defines | Functions

/home/pvrabec/project/openscap/openscap-0.6.3/src/OVAL/probes/probe-main.c File Reference

common probe entry point More...

#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <signal.h>
#include <errno.h>
#include <config.h>
#include <alloc.h>
#include <assume.h>
#include <bfind.h>
#include "_probe-api.h"
#include "probe-entcmp.h"
#include "encache.h"

Data Structures

struct  probe_varref_ctx
struct  probe_varref_ctx_ent

Defines

#define _A(x)   assert(x)
#define PROBE_SIGEXIT_CLEAN   1
#define PROBE_SIGEXIT_UNCLEAN   2
#define OPTIONS_COUNT   (sizeof OSCAP_GSYM(options)/sizeof(probe_option_t))
#define MAX_EVAL_DEPTH   8
 maximum recursion depth for set evaluation
#define probe_set_foreach(elm_var, set_list)   SEXP_sublist_foreach (elm_var, set_list, 2, 1000)
#define CASE(__c1, __rest)   case (__c1): if (strcmp (__rest, member_name + 1) == 0)

Functions

probe_option_t OSCAP_GSYM (options)[]
bool probe_handle_varref_cstr (const char *ent_name)
bool probe_handle_varref_sexp (const SEXP_t *ent_name)
volatile int OSCAP_GSYM (sigexit)=0
 signal exit flag
SEAP_CTX_tOSCAP_GSYM (ctx)
 SEAP context.
int OSCAP_GSYM (sd)
 SEAP descriptor.
pcache_tOSCAP_GSYM (pcache)
 probe item cache
void * OSCAP_GSYM (probe_arg)
 pointer for probe_main, provided by probe_init
encache_tOSCAP_GSYM (encache)
 element name cache
struct id_desc_t OSCAP_GSYM (id_desc)
bool OSCAP_GSYM (varref_handling)
char ** OSCAP_GSYM (no_varref_ents)
size_t OSCAP_GSYM (no_varref_ents_cnt)=0
void * probe_worker (void *arg)
 Worker thread function.
SEXP_tprobe_prepare_filters (SEXP_t *obj)
bool probe_item_filtered (SEXP_t *item, SEXP_t *filters)
int main (void)
 Common probe entry point.
int probe_setoption (int option,...)

Detailed Description

common probe entry point

Author:
"Daniel Kopecek" <dkopecek@redhat.com>
"Tomas Heinrich" <theinric@redhat.com>

Function Documentation

int main ( void   ) 

Common probe entry point.

This is the common main function of all probe processes that initializes all the stuff needed at probe runtime. This function also contains the main loop which listens for new request and in case the result was already evaluated (it is stored in the item cache) it replies to the request immediately. In the other case a new thread is spawned which takes care of the evaluation and reply.

Returns:
0 on success, error code otherwise
void * probe_worker ( void *  arg  ) 

Worker thread function.

This functions handles the evalution of objects and sets.

Parameters:
arg SEAP message with the request which contains the object to be evaluated