From b88db902b05194f0ce444e1f6acb795f5b0fb6b3 Mon Sep 17 00:00:00 2001 From: laforge Date: Sun, 10 Oct 2004 21:31:54 +0000 Subject: intermediate development snapshot --- include/ulogd/ulogd.h | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/ulogd/ulogd.h b/include/ulogd/ulogd.h index b3ce46e..7c3aa15 100644 --- a/include/ulogd/ulogd.h +++ b/include/ulogd/ulogd.h @@ -68,9 +68,9 @@ enum ulogd_dtype { }; /* structure describing an input / output parameter of a plugin */ -typedef struct ulogd_key { +struct ulogd_key { /* next interpreter return (key) in the global list */ - struct ulog_iret *next; + struct ulogd_iret *next; /* length of the returned value (only for lengthed types */ u_int32_t len; /* type of the returned value (ULOGD_IRET_...) */ @@ -99,11 +99,11 @@ typedef struct ulogd_key { int64_t i64; void *ptr; } value; - struct ulog_ket *source; + struct ulogd_iret *source; } u; -} ulogd_iret_t; +}; -typedef struct ulogd_plugin { +struct ulogd_plugin { /* global list of plugins */ struct list_head list; /* name of this plugin (predefined by plugin) */ @@ -134,28 +134,33 @@ typedef struct ulogd_plugin { /* function to destruct an existing pluginstance */ int (*destructor)(struct ulogd_pluginstance *instance); /* configuration parameters */ - config_entry_t *configs; -} ulogd_interpreter_t; + struct config_keyest config_kset; +}; /* an instance of a plugin, element in a stack */ -typedef struct ulogd_pluginstance { - /* global list of pluginstance stacks */ +struct ulogd_pluginstance { + /* global list of pluginstance stacks. only valid for first item */ struct list_head stack_list; /* local list of plugins in this stack */ struct list_head list; /* plugin (master) */ struct ulogd_plugin *plugin; + /* name / id of this instance*/ + char id[ULOGD_MAX_KEYLEN]; /* per-instance input keys */ struct ulogd_input *input; /* per-instance output keys */ struct ulogd_iret *output; + /* per-instance config parameters (array) */ + config_entry_t *configs; + unsigned int num_configs; /* private data */ char private[0]; -} ulogd_pluginstance_t; +}; /* entries of the key hash */ struct ulogd_keyh_entry { - ulog_interpreter_t *interp; /* interpreter for this key */ + struct ulogd_plugin *interp; /* interpreter for this key */ unsigned int offset; /* offset within interpreter */ const char *name; /* name of this particular key */ }; @@ -165,10 +170,10 @@ struct ulogd_keyh_entry { ***********************************************************************/ /* register a new interpreter plugin */ -void ulogd_register_plugin(ulog_plugin_t *me); +void ulogd_register_plugin(struct ulogd_plugin *me); -/* allocate a new ulog_iret_t */ -ulog_iret_t *alloc_ret(const u_int16_t type, const char*); +/* allocate a new ulogd_iret */ +struct ulogd_iret *alloc_ret(const u_int16_t type, const char*); /* write a message to the daemons' logfile */ void __ulogd_log(int level, char *file, int line, const char *message, ...); @@ -185,7 +190,7 @@ unsigned int interh_getid(const char *name); unsigned int keyh_getid(const char *name); /* get a result for a given key id */ -ulog_iret_t *keyh_getres(unsigned int id); +struct ulogd_iret *keyh_getres(unsigned int id); /* the key hash itself */ extern struct ulogd_keyh_entry *ulogd_keyh; -- cgit v1.2.3