From 29b6d125769417262b4841fe78e46813127a5d71 Mon Sep 17 00:00:00 2001 From: laforge Date: Sun, 17 Apr 2005 15:16:18 +0000 Subject: current working state (doesn't compile yet) --- include/ipfix_protocol.h | 31 ------------------------------- include/ulogd/ipfix_protocol.h | 32 ++++++++++++++++++++++++++++++++ include/ulogd/ulogd.h | 22 +++++++++++++--------- 3 files changed, 45 insertions(+), 40 deletions(-) delete mode 100644 include/ipfix_protocol.h create mode 100644 include/ulogd/ipfix_protocol.h (limited to 'include') diff --git a/include/ipfix_protocol.h b/include/ipfix_protocol.h deleted file mode 100644 index 94f9fc9..0000000 --- a/include/ipfix_protocol.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _IPFIX_PROTOCOL_H -#define _IPFIX_PROTOCOL_H - -/* This header file defines structures for the IPFIX protocol in accordance with - * draft-ietf-ipfix-protocol-03.txt */ - -#define IPFIX_VENDOR_NETFILTE 0x23424223 - -/* Section 8.1 */ -struct ipfix_msg_hdr { - u_int16_t version; - u_int16_t length; - u_int32_t export_time; - u_int32_t seq; - u_int32_t source_id; -}; - -/* Section 8.2 */ -struct ipfix_ietf_field { - u_int16_t type; - u_int16_t length; -}; - -struct ipfix_vendor_field { - u_int16_t type; - u_int16_t length; - u_int32_t enterprise_num; -}; - - -#endif diff --git a/include/ulogd/ipfix_protocol.h b/include/ulogd/ipfix_protocol.h new file mode 100644 index 0000000..95241cd --- /dev/null +++ b/include/ulogd/ipfix_protocol.h @@ -0,0 +1,32 @@ +#ifndef _IPFIX_PROTOCOL_H +#define _IPFIX_PROTOCOL_H + +/* This header file defines structures for the IPFIX protocol in accordance with + * draft-ietf-ipfix-protocol-03.txt */ + +#define IPFIX_VENDOR_IETF 0x00000000 +#define IPFIX_VENDOR_NETFILTER 0x23424223 + +/* Section 8.1 */ +struct ipfix_msg_hdr { + u_int16_t version; + u_int16_t length; + u_int32_t export_time; + u_int32_t seq; + u_int32_t source_id; +}; + +/* Section 8.2 */ +struct ipfix_ietf_field { + u_int16_t type; + u_int16_t length; +}; + +struct ipfix_vendor_field { + u_int16_t type; + u_int16_t length; + u_int32_t enterprise_num; +}; + + +#endif diff --git a/include/ulogd/ulogd.h b/include/ulogd/ulogd.h index 0dbdcc1..808f3a9 100644 --- a/include/ulogd/ulogd.h +++ b/include/ulogd/ulogd.h @@ -13,8 +13,11 @@ */ #include +#include +#include #include #include /* need this because of extension-sighandler */ +#include /* All types with MSB = 1 make use of value.ptr * other types use one of the union's member */ @@ -71,7 +74,7 @@ enum ulogd_dtype { /* structure describing an input / output parameter of a plugin */ struct ulogd_key { /* next interpreter return (key) in the global list */ - struct ulogd_iret *next; + struct ulogd_key *next; /* length of the returned value (only for lengthed types */ u_int32_t len; /* type of the returned value (ULOGD_IRET_...) */ @@ -100,10 +103,11 @@ struct ulogd_key { int64_t i64; void *ptr; } value; - struct ulogd_iret *source; + struct ulogd_key *source; } u; }; +struct ulogd_pluginstance; struct ulogd_plugin { /* global list of plugins */ struct list_head list; @@ -137,7 +141,7 @@ struct ulogd_plugin { int (*destructor)(struct ulogd_pluginstance *instance); /* configuration parameters */ - struct config_keyset config_kset; + struct config_keyset *config_kset; }; /* an instance of a plugin, element in a stack */ @@ -151,11 +155,11 @@ struct ulogd_pluginstance { /* name / id of this instance*/ char id[ULOGD_MAX_KEYLEN]; /* per-instance input keys */ - struct ulogd_input *input; + struct ulogd_key *input; /* per-instance output keys */ - struct ulogd_iret *output; + struct ulogd_key *output; /* per-instance config parameters (array) */ - config_entry_t *configs; + struct config_entry *configs; unsigned int num_configs; /* private data */ char private[0]; @@ -175,8 +179,8 @@ struct ulogd_keyh_entry { /* register a new interpreter plugin */ void ulogd_register_plugin(struct ulogd_plugin *me); -/* allocate a new ulogd_iret */ -struct ulogd_iret *alloc_ret(const u_int16_t type, const char*); +/* allocate a new ulogd_key */ +struct ulogd_key *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, ...); @@ -193,7 +197,7 @@ unsigned int interh_getid(const char *name); unsigned int keyh_getid(const char *name); /* get a result for a given key id */ -struct ulogd_iret *keyh_getres(unsigned int id); +struct ulogd_key *keyh_getres(unsigned int id); /* the key hash itself */ extern struct ulogd_keyh_entry *ulogd_keyh; -- cgit v1.2.3