summaryrefslogtreecommitdiffstats
path: root/common/elapi/elapi_priv.h
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-08-07 15:50:34 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-08-12 12:24:27 -0400
commit1771d32e945b758326951384f0e17121042ad74e (patch)
tree070df00bcb1e049a1bdf794922b9b970479942a8 /common/elapi/elapi_priv.h
parentd59ba3139bba2d28c1209f62c01a7017c26dd635 (diff)
downloadsssd-1771d32e945b758326951384f0e17121042ad74e.tar.gz
sssd-1771d32e945b758326951384f0e17121042ad74e.tar.xz
sssd-1771d32e945b758326951384f0e17121042ad74e.zip
ELAPI Next round of functionality - logging part of the interface
a) Added the main logging interface which allows creating dispatcher and logging messages or events. Can't actully log anything yet since the sinks are stubbed out. b) Made default template be a part of the default dispatcher. c) Updated UNIT test. d) Some of the calls are stubbed out but they are there to indicate where next round of work will be.
Diffstat (limited to 'common/elapi/elapi_priv.h')
-rw-r--r--common/elapi/elapi_priv.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/common/elapi/elapi_priv.h b/common/elapi/elapi_priv.h
index feb9a7f67..c536f4ecf 100644
--- a/common/elapi/elapi_priv.h
+++ b/common/elapi/elapi_priv.h
@@ -20,13 +20,95 @@
#ifndef ELAPI_PRIV_H
#define ELAPI_PRIV_H
+#include "collection.h"
+#include "elapi_async.h"
/* Classes of the collections used by ELAPI internally */
#define COL_CLASS_ELAPI_BASE 21000
#define COL_CLASS_ELAPI_EVENT COL_CLASS_ELAPI_BASE + 0
#define COL_CLASS_ELAPI_TEMPLATE COL_CLASS_ELAPI_BASE + 1
+#define COL_CLASS_ELAPI_SINK COL_CLASS_ELAPI_BASE + 2
/* Names for the collections */
#define E_TEMPLATE_NAME "template"
#define E_EVENT_NAME "event"
+
+#define ELAPI_DISPATCHER "dispatcher"
+#define ELAPI_SINKS "sinks"
+
+struct elapi_dispatcher {
+ char **sinks;
+ int need_to_free;
+ char *appname;
+ /*event_router_fn router; - FIXME - not defined yet */
+ struct collection_item *sink_list;
+ int sink_counter;
+ struct collection_item *ini_config;
+ /* Default event template */
+ struct collection_item *default_template;
+ /* Async processing related data */
+ elapi_add_fd add_fd_add_fn;
+ elapi_rem_fd add_fd_rem_fn;
+ elapi_add_timer add_timer_fn;
+ void *callers_data;
+ int async_mode;
+};
+
+/* Structure to pass data from logging function to sinks */
+struct elapi_sink_context {
+ struct collection_item *event;
+ struct elapi_dispatcher *handle;
+ char *format;
+ char *previous;
+ int previous_status;
+};
+
+/* The structure to hold a command and a result of the command execution */
+struct elapi_get_sink {
+ int action;
+ int found;
+};
+
+/* Function to create event using arg list */
+int elapi_create_event_with_vargs(struct collection_item **event,
+ struct collection_item *template,
+ struct collection_item *collection,
+ int mode, va_list args);
+
+/* Function to create event template using arg list */
+int elapi_create_event_template_with_vargs(struct collection_item **template,
+ unsigned base,
+ va_list args);
+
+/* Sink handler function */
+int elapi_internal_sink_handler(const char *sink,
+ int sink_len,
+ int type,
+ void *data,
+ int length,
+ void *passed_data,
+ int *stop);
+
+/* Internal sink cleanup function */
+int elapi_internal_sink_cleanup_handler(const char *sink,
+ int sink_len,
+ int type,
+ void *data,
+ int length,
+ void *passed_data,
+ int *stop);
+
+
+/* Create list of the sinks */
+int elapi_internal_construct_sink_list(struct elapi_dispatcher *handle);
+
+/* Function to add a sink to the collection */
+int elapi_internal_add_sink_to_collection(struct collection_item *sink_list,
+ char *sink,
+ char *appname);
+
+/* Send ELAPI config errors into a file */
+void elapi_internal_dump_errors_to_file(struct collection_item *error_list);
+
+
#endif