00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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
00071 #include "sch_cons.h"
00072 #define SCH_CONS 0
00073
00074
00075 #include "sch_dummy.h"
00076 #define SCH_DUMMY 1
00077
00078
00079 #include "sch_generic.h"
00080 #define SCH_GENERIC 2
00081
00082
00083 #include "sch_pipe.h"
00084 #define SCH_PIPE 3
00085
00086 #define SCH_NONE 255
00087
00088 OSCAP_HIDDEN_END;
00089
00090 #endif