00001 #pragma once
00002 #ifndef _SEAP_SCHEME_H
00003 #define _SEAP_SCHEME_H
00004
00005 #include <stddef.h>
00006 #include <stdint.h>
00007 #include <unistd.h>
00008 #include "_sexp-types.h"
00009 #include "_seap-types.h"
00010 #include "seap-descriptor.h"
00011 #include "generic/common.h"
00012 #include "../../../common/util.h"
00013
00014 OSCAP_HIDDEN_START;
00015
00016 typedef struct {
00017 const char *schstr;
00018 int (*sch_connect) (SEAP_desc_t *, const char *, uint32_t);
00019 int (*sch_openfd) (SEAP_desc_t *, int, uint32_t);
00020 int (*sch_openfd2) (SEAP_desc_t *, int, int, uint32_t);
00021 ssize_t (*sch_recv) (SEAP_desc_t *, void *, size_t, uint32_t);
00022 ssize_t (*sch_send) (SEAP_desc_t *, void *, size_t, uint32_t);
00023 int (*sch_close) (SEAP_desc_t *, uint32_t);
00024 ssize_t (*sch_sendsexp) (SEAP_desc_t *, SEXP_t *, uint32_t);
00025 int (*sch_select) (SEAP_desc_t *, int, uint16_t, uint32_t);
00026 } SEAP_schemefn_t;
00027
00028 extern const SEAP_schemefn_t __schtbl[];
00029
00030 #define SCH_CONNECT(idx, ...) __schtbl[idx].sch_connect (__VA_ARGS__)
00031 #define SCH_OPENFD(idx, ...) __schtbl[idx].sch_openfd (__VA_ARGS__)
00032 #define SCH_OPENFD2(idx, ...) __schtbl[idx].sch_openfd2 (__VA_ARGS__)
00033 #define SCH_RECV(idx, ...) __schtbl[idx].sch_recv (__VA_ARGS__)
00034 #define SCH_SEND(idx, ...) __schtbl[idx].sch_send (__VA_ARGS__)
00035 #define SCH_CLOSE(idx, ...) __schtbl[idx].sch_close (__VA_ARGS__)
00036 #define SCH_SENDSEXP(idx, ...) __schtbl[idx].sch_sendsexp (__VA_ARGS__)
00037 #define SCH_SELECT(idx, ...) __schtbl[idx].sch_select (__VA_ARGS__)
00038
00039 #define SEAP_IO_EVREAD 0x01
00040 #define SEAP_IO_EVWRITE 0x02
00041 #define SEAP_IO_EVANY 0x08
00042
00043 #define SEAP_RECVBUF_SIZE 4*4096
00044 #define SEAP_SENDBUF_SIZE 4*4096
00045
00046 SEAP_scheme_t SEAP_scheme_search (const SEAP_schemefn_t fntable[], const char *sch, size_t schlen);
00047
00048
00049 #include "sch_cons.h"
00050 #define SCH_CONS 0
00051
00052
00053 #include "sch_dummy.h"
00054 #define SCH_DUMMY 1
00055
00056
00057 #include "sch_generic.h"
00058 #define SCH_GENERIC 2
00059
00060
00061 #include "sch_pipe.h"
00062 #define SCH_PIPE 3
00063
00064 #define SCH_NONE 255
00065
00066 OSCAP_HIDDEN_END;
00067
00068 #endif