1 |
#ifndef POLYTYPES_H |
2 |
#define POLYTYPES_H |
3 |
#include "ees_config.h" |
4 |
#if HAVE_STDDEF_H |
5 |
#include <stddef.h> |
6 |
#endif |
7 |
#if HAVE_WCHAR_H |
8 |
#include <wchar.h> |
9 |
#endif |
10 |
#if HAVE_STDIO_H |
11 |
#include <stdio.h> |
12 |
#endif |
13 |
#if HAVE_LINUX_LIMITS_H |
14 |
#include <linux/limits.h> |
15 |
#endif |
16 |
|
17 |
#define MAXPROCS 5 |
18 |
#define LCMAPS_MAXARGSTRING 2000 |
19 |
|
20 |
typedef void *lcmaps_proc_t; |
21 |
|
22 |
/*! Identifiers for linked process symbols */ |
23 |
typedef enum lcmaps_proctype_e |
24 |
{ |
25 |
INITPROC, /*!< this value corresponds to the plugin initialization function */ |
26 |
RUNPROC, /*!< this value corresponds to the plugin run function (get credentials) */ |
27 |
TERMPROC, /*!< this value corresponds to the plugin termination function */ |
28 |
INTROPROC, /*!< this value corresponds to the plugin introspect function */ |
29 |
VERIFYPROC, /*!< this value corresponds to the plugin verification function */ |
30 |
ENDOFPROCS /*< this is the last enumeration value */ |
31 |
} lcmaps_proctype_t; |
32 |
|
33 |
|
34 |
/*! Argument types */ |
35 |
typedef enum |
36 |
{ |
37 |
TYPE_NONE, |
38 |
TYPE_SCHAR, |
39 |
TYPE_UCHAR, |
40 |
TYPE_SHORT, |
41 |
TYPE_USHORT, |
42 |
TYPE_INT, |
43 |
TYPE_UINT, |
44 |
TYPE_LONGINT, |
45 |
TYPE_ULONGINT, |
46 |
#ifdef HAVE_LONG_LONG_INT |
47 |
TYPE_LONGLONGINT, |
48 |
TYPE_ULONGLONGINT, |
49 |
#endif |
50 |
TYPE_FLOAT, |
51 |
TYPE_DOUBLE, |
52 |
#ifdef HAVE_LONG_DOUBLE |
53 |
TYPE_LONGDOUBLE, |
54 |
#endif |
55 |
TYPE_CHAR, |
56 |
#ifdef HAVE_WINT_T |
57 |
TYPE_WIDE_CHAR, |
58 |
#endif |
59 |
TYPE_STRING, |
60 |
#ifdef HAVE_WCHAR_T |
61 |
TYPE_WIDE_STRING, |
62 |
#endif |
63 |
TYPE_POINTER, |
64 |
TYPE_COUNT_SCHAR_POINTER, |
65 |
TYPE_COUNT_SHORT_POINTER, |
66 |
TYPE_COUNT_INT_POINTER, |
67 |
TYPE_COUNT_LONGINT_POINTER, |
68 |
#ifdef HAVE_LONG_LONG_INT |
69 |
TYPE_COUNT_LONGLONGINT_POINTER, |
70 |
#endif |
71 |
TYPE_PEM, |
72 |
TYPE_X509, |
73 |
TYPE_STACK_OF_X509, |
74 |
TYPE_EVP_PKEY |
75 |
} arg_type; |
76 |
|
77 |
|
78 |
/*! |
79 |
* \brief Node structure to hold plugin nodes |
80 |
*/ |
81 |
typedef struct lcmaps_plugindl_s |
82 |
{ |
83 |
void * handle; /*!< dlopen handle to plugin module */ |
84 |
lcmaps_proc_t procs[MAXPROCS]; /*!< list of handles to interface functions of plugin */ |
85 |
char pluginname[FILENAME_MAX]; /*!< name of plugin */ |
86 |
char pluginargs[LCMAPS_MAXARGSTRING]; /*!< argument string */ |
87 |
int init_argc; /*!< number of arguments for the initialization function */ |
88 |
char * init_argv[ARG_MAX]; /*!< list of arguments for the initialization function */ |
89 |
struct lcmaps_plugindl_s * next; /*!< pointer to the next plugin in the plugin list */ |
90 |
} |
91 |
|
92 |
lcmaps_plugindl_t; |
93 |
|
94 |
|
95 |
/*! \brief Node structure to store AOS arguments */ |
96 |
typedef struct argument_s |
97 |
{ |
98 |
void* data; /*! a pointer to store the data */ |
99 |
int needs_free; /*! a flag that determines wheter the data should be free'd */ |
100 |
const char * label; /*! a label to identify the data */ |
101 |
arg_type type; /*! a type identifier */ |
102 |
struct argument_s * parent; /*! a pointer to the 'parent' object */ |
103 |
struct argument_s * next; /*! a pointer to the next node */ |
104 |
lcmaps_plugindl_t * setting_plugin; |
105 |
} |
106 |
argument_t; |
107 |
|
108 |
#endif |