• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

/home/pvrabec/project/openscap/openscap-0.6.6/src/OVAL/probes/oval_fts.h

00001 /*
00002  * Copyright 2010 Red Hat Inc., Durham, North Carolina.
00003  * All Rights Reserved.
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2.1 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  * Authors:
00020  *      "Daniel Kopecek" <dkopecek@redhat.com>
00021  */
00022 #ifndef OVAL_FTS_H
00023 #define OVAL_FTS_H
00024 
00025 #include <sexp.h>
00026 #include <fts.h>
00027 #include <pcre.h>
00028 #include "fsdev.h"
00029 
00030 typedef struct {
00031         FTS    *ofts_fts;
00032 
00033         SEXP_t  *ofts_path;
00034         char   **ofts_st_path;       
00035         uint16_t ofts_st_path_count; 
00036         uint16_t ofts_st_path_index; 
00038         pcre       *ofts_path_regex;
00039         pcre_extra *ofts_path_regex_extra;
00040         bool        ofts_path_regex_Opartial; 
00042         SEXP_t *ofts_filename;
00043         SEXP_t *ofts_behaviors;
00044 
00045         bool ofts_nilfilename;
00046 
00047         int max_depth;
00048         int direction;
00049         int recurse;
00050         int filesystem;
00051 
00052         fsdev_t *localdevs;
00053 } OVAL_FTS;
00054 
00055 #define OVAL_RECURSE_DIRECTION_NONE 0 /* default */
00056 #define OVAL_RECURSE_DIRECTION_DOWN 1
00057 #define OVAL_RECURSE_DIRECTION_UP   2
00058 
00059 #define OVAL_RECURSE_FILES    0x01
00060 #define OVAL_RECURSE_DIRS     0x02
00061 #define OVAL_RECURSE_SYMLINKS 0x04
00062 
00063 #define OVAL_RECURSE_SYMLINKS_AND_DIRS (OVAL_RECURSE_SYMLINKS|OVAL_RECURSE_DIRS) /* default */
00064 #define OVAL_RECURSE_FILES_AND_DIRS    (OVAL_RECURSE_FILES|OVAL_RECURSE_SYMLINKS)
00065 
00066 #define OVAL_RECURSE_FS_LOCAL   0
00067 #define OVAL_RECURSE_FS_DEFINED 1
00068 #define OVAL_RECURSE_FS_ALL     2 /* default */
00069 
00070 typedef struct {
00071         char  *filepath; /* path + file */
00072         size_t filepath_len;
00073 
00074         char  *file;     /* file - shares memory with filepath! */
00075         size_t file_len;
00076 
00077         char  *path;     /* path - separate memory */
00078         size_t path_len;
00079 
00080         bool  nilfile;
00081 } OVAL_FTSENT;
00082 
00083 /*
00084  * OVAL FTS public API
00085  */
00086 OVAL_FTS    *oval_fts_open(SEXP_t *path, SEXP_t *filename, SEXP_t *filepath, SEXP_t *behaviors);
00087 OVAL_FTSENT *oval_fts_read(OVAL_FTS *ofts);
00088 int          oval_fts_close(OVAL_FTS *ofts);
00089 
00090 void oval_ftsent_free(OVAL_FTSENT *ofts_ent);
00091 
00092 #endif /* OVAL_FTS_H */

Generated on Thu Dec 9 2010 for Open SCAP Library by  doxygen 1.7.1