/home/pvrabec/project/openscap/openscap-0.6.0/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 "_probe-api.h"
#include "probe-entcmp.h"
#include "encache.h"

Data Structures

struct  probe_varref_ctx
struct  probe_varref_ctx_ent

Defines

#define PROBE_SIGEXIT_CLEAN   1
#define PROBE_SIGEXIT_UNCLEAN   2
#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

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)
void * probe_worker (void *arg)
 Worker thread function.
int main (void)
 Common probe entry point.

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

Generated on 14 Jul 2010 for Open SCAP Library by  doxygen 1.6.1