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

/home/pvrabec/project/openscap/openscap-0.6.4/src/OVAL/probes/SEAP/_seap-scheme.h

00001 /*
00002  * Copyright 2009 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 
00023 #pragma once
00024 #ifndef _SEAP_SCHEME_H
00025 #define _SEAP_SCHEME_H
00026 
00027 #include <stddef.h>
00028 #include <stdint.h>
00029 #include <unistd.h>
00030 #include "_sexp-types.h"
00031 #include "_seap-types.h"
00032 #include "seap-descriptor.h"
00033 #include "generic/common.h"
00034 #include "../../../common/util.h"
00035 
00036 OSCAP_HIDDEN_START;
00037 
00038 typedef struct {
00039         const char *schstr;
00040         int     (*sch_connect)  (SEAP_desc_t *, const char *, uint32_t);
00041         int     (*sch_openfd)   (SEAP_desc_t *, int, uint32_t);
00042         int     (*sch_openfd2)  (SEAP_desc_t *, int, int, uint32_t);
00043         ssize_t (*sch_recv)     (SEAP_desc_t *, void *, size_t, uint32_t);
00044         ssize_t (*sch_send)     (SEAP_desc_t *, void *, size_t, uint32_t);
00045         int     (*sch_close)    (SEAP_desc_t *, uint32_t);
00046         ssize_t (*sch_sendsexp) (SEAP_desc_t *, SEXP_t *, uint32_t);
00047         int     (*sch_select)   (SEAP_desc_t *, int, uint16_t, uint32_t);
00048 } SEAP_schemefn_t;
00049 
00050 extern const SEAP_schemefn_t __schtbl[];
00051 
00052 #define SCH_CONNECT(idx, ...)  __schtbl[idx].sch_connect (__VA_ARGS__)
00053 #define SCH_OPENFD(idx, ...)   __schtbl[idx].sch_openfd (__VA_ARGS__)
00054 #define SCH_OPENFD2(idx, ...)  __schtbl[idx].sch_openfd2 (__VA_ARGS__)
00055 #define SCH_RECV(idx, ...)     __schtbl[idx].sch_recv (__VA_ARGS__)
00056 #define SCH_SEND(idx, ...)     __schtbl[idx].sch_send (__VA_ARGS__)
00057 #define SCH_CLOSE(idx, ...)    __schtbl[idx].sch_close (__VA_ARGS__)
00058 #define SCH_SENDSEXP(idx, ...) __schtbl[idx].sch_sendsexp (__VA_ARGS__)
00059 #define SCH_SELECT(idx, ...)   __schtbl[idx].sch_select (__VA_ARGS__)
00060 
00061 #define SEAP_IO_EVREAD  0x01
00062 #define SEAP_IO_EVWRITE 0x02
00063 #define SEAP_IO_EVANY   0x08
00064 
00065 #define SEAP_RECVBUF_SIZE 4*4096
00066 #define SEAP_SENDBUF_SIZE 4*4096
00067 
00068 SEAP_scheme_t SEAP_scheme_search (const SEAP_schemefn_t fntable[], const char *sch, size_t schlen);
00069 
00070 /* console */
00071 #include "sch_cons.h"
00072 #define SCH_CONS    0
00073 
00074 /* dummy */
00075 #include "sch_dummy.h"
00076 #define SCH_DUMMY   1
00077 
00078 /* generic */
00079 #include "sch_generic.h"
00080 #define SCH_GENERIC 2
00081 
00082 /* pipe */
00083 #include "sch_pipe.h"
00084 #define SCH_PIPE    3
00085 
00086 #define SCH_NONE    255
00087 
00088 OSCAP_HIDDEN_END;
00089 
00090 #endif /* _SEAP_SCHEME_H */

Generated on Wed Oct 20 2010 for Open SCAP Library by  doxygen 1.7.1