summaryrefslogtreecommitdiffstats
path: root/common/elapi/elapi_sink.h
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-08-25 16:54:01 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-09-08 19:25:16 -0400
commitc5461b548d303e6e66e20048544814338b46efb5 (patch)
treeddf98cf7e498349739fb0c8e9612a0f962e14c41 /common/elapi/elapi_sink.h
parent7a9bee06e2bc5bcc75659e9a46bdffa870951d7a (diff)
downloadsssd-c5461b548d303e6e66e20048544814338b46efb5.tar.gz
sssd-c5461b548d303e6e66e20048544814338b46efb5.tar.xz
sssd-c5461b548d303e6e66e20048544814338b46efb5.zip
ELAPI sinks and providers
This patch drills down to the next level of ELAPI functionality. I adds the creation and loading of the sinks. It also implements a skeleton for the first low level provider which will be capable of writing to a file. The configuration ini file is extended to define new configuration parameters and their meanings.
Diffstat (limited to 'common/elapi/elapi_sink.h')
-rw-r--r--common/elapi/elapi_sink.h39
1 files changed, 10 insertions, 29 deletions
diff --git a/common/elapi/elapi_sink.h b/common/elapi/elapi_sink.h
index 40b12a266..41a89896f 100644
--- a/common/elapi/elapi_sink.h
+++ b/common/elapi/elapi_sink.h
@@ -31,48 +31,29 @@
#define SINK_LIB_NAME_SIZE 100
#define SINK_ENTRY_POINT "get_sink_info"
#define SINK_NAME_TEMPLATE "libelapi_sink_%s.so"
-#define SINK_NEVER_RETRY -1
/* Flags related to loading sinks */
#define SINK_FLAG_NO_LIMIT 0x00000000 /* NO limits to loading and manipulating this sink - default */
-#define SINK_FLAG_LOAD_SINGLE 0x00000001 /* Only allow one instance of the sink per process */
+#define SINK_FLAG_LOAD_SINGLE 0x00000001 /* Only allow one instance of the provider per process */
-struct data_descriptor {
- char *appname;
- void *config;
- void *internal_data;
-};
/* Log facility callbacks */
-typedef int (*init_fn)(struct data_descriptor *dblock);
-typedef void (*cleanup_fn)(struct data_descriptor *dblock);
-typedef int (*format_fn)(struct data_descriptor *dblock, const char *format_str, struct collection_item *event);
-typedef int (*submit_fn)(struct data_descriptor *dblock);
-typedef void (*close_fn)(struct data_descriptor *dblock);
+/* FIXME - the signatures need to take into the account async processing */
+typedef int (*init_fn)(void **priv_ctx, char *name, struct collection_item *ini_config);
+typedef int (*submit_fn)(void *priv_ctx, struct collection_item *event);
+typedef void (*close_fn)(void **priv_ctx);
-struct sink_capability {
- int retry_interval;
- int flags;
- int instance;
+struct sink_cpb {
init_fn init_cb;
- cleanup_fn cleanup_cb;
- format_fn format_cb;
submit_fn submit_cb;
close_fn close_cb;
};
-/* The only open function the link can expose */
-typedef void (*capability_fn)(struct sink_capability *sink_cpb_block);
+/* The only open function the sink can expose */
+typedef void (*sink_cpb_fn)(struct sink_cpb *sink_cpb_block);
-struct sink_descriptor {
- struct sink_capability sink_cpb_block;
- struct data_descriptor dblock;
- int suspended;
- time_t lasttry;
- void *lib_handle;
-};
-/*Standard capability function */
-void get_sink_info(struct sink_capability *sink_cpb_block);
+/* Standard capability function */
+void get_sink_info(struct sink_cpb *cpb_block);
#endif