ctx.h | ctx.h | |||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
* @file ctx.h | * @file ctx.h | |||
* @brief The library context object. | * @brief The library context object. | |||
* @class ee_ctx ctx.h | * @class ee_ctx ctx.h | |||
* | * | |||
* The library context object is at the top of libee's class | * The library context object is at the top of libee's class | |||
* hierarchy. It serves as the "environement" (acutally context ;)) | * hierarchy. It serves as the "environement" (acutally context ;)) | |||
* in which all other ee library objects operate. | * in which all other ee library objects operate. | |||
*//* | *//* | |||
* | * | |||
* Libee - An Event Expression Library inspired by CEE | * Libee - An Event Expression Library inspired by CEE | |||
* Copyright 2010 by Rainer Gerhards and Adiscon GmbH. | * Copyright 2010-2011 by Rainer Gerhards and Adiscon GmbH. | |||
* | * | |||
* This file is part of libee. | * This file is part of libee. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
* version 2.1 of the License, or (at your option) any later version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* This library is distributed in the hope that it will be useful, | * This library is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
skipping to change at line 66 | skipping to change at line 66 | |||
* Most importantly, the compliance level defines how picky the | * Most importantly, the compliance level defines how picky the | |||
* lib is about verifying semantical correctness of the objects | * lib is about verifying semantical correctness of the objects | |||
* in question. | * in question. | |||
*/ | */ | |||
enum ee_compLevel { | enum ee_compLevel { | |||
ee_cl_NONE = 0, /**< everything is allowed */ | ee_cl_NONE = 0, /**< everything is allowed */ | |||
ee_cl_FULL /**< full verification is required */ | ee_cl_FULL /**< full verification is required */ | |||
}; | }; | |||
#define EE_CTX_FLAG_ENC_ULTRACOMPACT 1 | #define EE_CTX_FLAG_ENC_ULTRACOMPACT 1 | |||
#define EE_CTX_FLAG_INCLUDE_FLAT_TAGS 2 | ||||
struct ee_ctx_s { | struct ee_ctx_s { | |||
unsigned objID; /**< a magic number to prevent some memory adressing errors */ | unsigned objID; /**< a magic number to prevent some memory adressing errors */ | |||
void (*dbgCB)(void *cookie, char *msg, size_t lenMsg); | void (*dbgCB)(void *cookie, char *msg, size_t lenMsg); | |||
/**< user-provided debug output call back */ | /**< user-provided debug output call back */ | |||
void *dbgCookie; /**< cookie to be passed to debug ca llback */ | void *dbgCookie; /**< cookie to be passed to debug ca llback */ | |||
enum ee_compLevel compLevel; /**< our compliance level */ | enum ee_compLevel compLevel; /**< our compliance level */ | |||
unsigned short flags; /**< flags modifying behavior */ | unsigned short flags; /**< flags modifying behavior */ | |||
int fieldBucketSize; /**< default size for field buckets */ | int fieldBucketSize; /**< default size for field buckets */ | |||
int tagBucketSize; /**< default size for field buckets */ | int tagBucketSize; /**< default size for field buckets */ | |||
skipping to change at line 130 | skipping to change at line 131 | |||
* @memberof ee_ctx | * @memberof ee_ctx | |||
* @public | * @public | |||
* | * | |||
* @param ctx The context to be discarded. | * @param ctx The context to be discarded. | |||
* | * | |||
* @return Returns zero on success, something else otherwise. | * @return Returns zero on success, something else otherwise. | |||
*/ | */ | |||
int ee_exitCtx(ee_ctx ctx); | int ee_exitCtx(ee_ctx ctx); | |||
/** | /** | |||
* Set context flags. | ||||
* Note that all previsouly set flags are overridden when this | ||||
* method is called. If that is not desired, call ee_getFlags() | ||||
* first and manipulate the result as desired. | ||||
* | ||||
* @memberof ee_ctx | ||||
* @public | ||||
* | ||||
* @param ctx The context to be updated | ||||
* @param flags Flags to be set. Note that currently an integer is | ||||
* passed in, but we operate with short internally. | ||||
*/ | ||||
void ee_setFlags(ee_ctx ctx, unsigned int flags); | ||||
/** | ||||
* Get context flags. | ||||
* | ||||
* @memberof ee_ctx | ||||
* @public | ||||
* | ||||
* @param ctx The context to query | ||||
* @return currently set flags | ||||
* | ||||
*/ | ||||
unsigned int ee_getFlags(ee_ctx ctx); | ||||
/** | ||||
* Set encoding mode to ultra compact. | * Set encoding mode to ultra compact. | |||
* In this mode the encoders will generated the shortest | * In this mode the encoders will generated the shortest | |||
* string presentation possible, even if that means it will | * string presentation possible, even if that means it will | |||
* be very hard to read by a human. | * be very hard to read by a human. | |||
* | * | |||
* @memberof ee_ctx | * @memberof ee_ctx | |||
* @public | * @public | |||
* | * | |||
* @param ctx context to modify | * @param ctx context to modify | |||
*/ | */ | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 29 lines changed or added | |||
event.h | event.h | |||
---|---|---|---|---|
skipping to change at line 181 | skipping to change at line 181 | |||
*/ | */ | |||
int ee_getEventFieldAsString(struct ee_event *event, | int ee_getEventFieldAsString(struct ee_event *event, | |||
es_str_t *name, es_str_t **strVal); | es_str_t *name, es_str_t **strVal); | |||
/** | /** | |||
* Check if an event is classified via a specific tag. | * Check if an event is classified via a specific tag. | |||
* | * | |||
* @memberof ee_event | * @memberof ee_event | |||
* @public | * @public | |||
* | * | |||
* @param event event to look at | * @param[in] event event to look at | |||
* @param[in] str name of tag | * @param[in] str name of tag | |||
* | * | |||
* @return 0 if event is not classified with the tag, something | * @return 0 if event is not classified with the tag, something | |||
* else otherwise | * else otherwise | |||
*/ | */ | |||
int ee_EventHasTag(struct ee_event *event, es_str_t *tagname); | int ee_EventHasTag(struct ee_event *event, es_str_t *tagname); | |||
/** | /** | |||
* Obtain the event's tagbucket. | ||||
* | ||||
* @memberof ee_event | ||||
* @public | ||||
* | ||||
* @param[in] event event to process | ||||
* @param[out] tagbucket associated tagbucket. May be NULL if none is | ||||
* associated. | ||||
*/ | ||||
void ee_EventGetTagbucket(struct ee_event *event, struct ee_tagbucket **tag | ||||
bucket); | ||||
/** | ||||
* Format an event in syslog RFC 5424 format. | * Format an event in syslog RFC 5424 format. | |||
* | * | |||
* This method takes an event and creates a new string representation | * This method takes an event and creates a new string representation | |||
* in RFC5424 format. The string is passed to the caller, which then | * in RFC5424 format. The string is passed to the caller, which then | |||
* is responsible for freeing it. | * is responsible for freeing it. | |||
* | * | |||
* <b>This is part of the ezAPI for libee</b> | * <b>This is part of the ezAPI for libee</b> | |||
* | * | |||
* @memberof ee_event | * @memberof ee_event | |||
* @public | * @public | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 14 lines changed or added | |||
field.h | field.h | |||
---|---|---|---|---|
skipping to change at line 131 | skipping to change at line 131 | |||
* @public | * @public | |||
* | * | |||
* @param[in] ctx library context | * @param[in] ctx library context | |||
* @param[in] val value to add to field | * @param[in] val value to add to field | |||
* | * | |||
* @return 0 on success, something else otherwise | * @return 0 on success, something else otherwise | |||
*/ | */ | |||
int ee_addValueToField(struct ee_field *field, struct ee_value *val); | int ee_addValueToField(struct ee_field *field, struct ee_value *val); | |||
/** | /** | |||
* Add a string value to a field. | ||||
* This is primarily a shortcut to add a string value. For more | ||||
* details, see ee_addValueToField() doc, which also applies here. | ||||
* | ||||
* @memberof ee_field | ||||
* @public | ||||
* | ||||
* @param[in] field field to update | ||||
* @param[in] str string to add | ||||
* | ||||
* @return 0 on success, something else otherwise | ||||
*/ | ||||
int ee_addStrValueToField(struct ee_field *field, es_str_t *str); | ||||
/** | ||||
* Encode the current field with all its values in syslog format | * Encode the current field with all its values in syslog format | |||
* and append this representation to the provided string. | * and append this representation to the provided string. | |||
* | * | |||
* @memberof ee_value | * @memberof ee_value | |||
* @public | * @public | |||
* | * | |||
* @param[in] field field to enocde | * @param[in] field field to enocde | |||
* @param[out] str string to wich the encoded value is to be added. | * @param[out] str string to wich the encoded value is to be added. | |||
* Must have been allocated by the caller. | * Must have been allocated by the caller. | |||
* @returns 0 on success, something else otherwise | * @returns 0 on success, something else otherwise | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 15 lines changed or added | |||
libee.h | libee.h | |||
---|---|---|---|---|
/** | /** | |||
* @mainpage | * @mainpage | |||
* Libee - An Event Expression Library inspired by CEE | * Libee - An Event Expression Library inspired by CEE | |||
* | * | |||
* Copyright 2010 by Rainer Gerhards and Adiscon GmbH. | * Copyright 2010-2011 by Rainer Gerhards and Adiscon GmbH. | |||
* | * | |||
* CEE is an upcoming standard used to describe network events | * CEE is an upcoming standard used to describe network events | |||
* in a number of normalized formats. It's goal is to unify they currently | * in a number of normalized formats. It's goal is to unify they currently | |||
* many different representations that exist in the industry. | * many different representations that exist in the industry. | |||
* | * | |||
* The core idea of libee is to provide a small but hopefully convenient | * The core idea of libee is to provide a small but hopefully convenient | |||
* API layer above the CEE standard. However, CEE is not finished. At the | * API layer above the CEE standard. However, CEE is not finished. At the | |||
* time of this writing, CEE is under heavy development and even some of | * time of this writing, CEE is under heavy development and even some of | |||
* its core data structures (like the data dictionary and taxonmy) have | * its core data structures (like the data dictionary and taxonmy) have | |||
* not been fully specified. | * not been fully specified. | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
primitivetype.h | primitivetype.h | |||
---|---|---|---|---|
skipping to change at line 83 | skipping to change at line 83 | |||
* @param[in/out] offs offset where parsing has to start inside str. | * @param[in/out] offs offset where parsing has to start inside str. | |||
* Updated on exist. \b Note: if the parser consumed all characters, | * Updated on exist. \b Note: if the parser consumed all characters, | |||
* offs equals strlen(str) on exit. This is part of the interface and | * offs equals strlen(str) on exit. This is part of the interface and | |||
* the predicate for the caller to detect end of parsing. | * the predicate for the caller to detect end of parsing. | |||
* @param[in] ed string with extra data | * @param[in] ed string with extra data | |||
* @param[out] newVal new value object created if parsing was successful | * @param[out] newVal new value object created if parsing was successful | |||
* @return 0 on success, something else otherwise | * @return 0 on success, something else otherwise | |||
*/ | */ | |||
/** | /** | |||
* Parser for RFC5424 date. | ||||
*/ | ||||
int ee_parseRFC5424Date(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_ | ||||
t *ed, struct ee_value **newVal); | ||||
/** | ||||
* Parser for RFC3164 date. | * Parser for RFC3164 date. | |||
*/ | */ | |||
int ee_parseRFC3164Date(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_ t *ed, struct ee_value **newVal); | int ee_parseRFC3164Date(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_ t *ed, struct ee_value **newVal); | |||
/** | /** | |||
* Parser for numbers. | * Parser for numbers. | |||
*/ | */ | |||
int ee_parseNumber(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed , struct ee_value **newVal); | int ee_parseNumber(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed , struct ee_value **newVal); | |||
/** | /** | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added | |||
tagbucket.h | tagbucket.h | |||
---|---|---|---|---|
/** | /** | |||
* @file tagbucket.h | * @file tagbucket.h | |||
* @brief the tagbucket object | * @brief the tagbucket object | |||
* @class ee_tagbucket tagbucket.h | * @class ee_tagbucket tagbucket.h | |||
* | * | |||
*//* | *//* | |||
* | * | |||
* Libee - An Event Expression Library inspired by CEE | * Libee - An Event Expression Library inspired by CEE | |||
* Copyright 2010 by Rainer Gerhards and Adiscon GmbH. | * Copyright 2010-2011 by Rainer Gerhards and Adiscon GmbH. | |||
* | * | |||
* This file is part of libee. | * This file is part of libee. | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
* version 2.1 of the License, or (at your option) any later version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* This library is distributed in the hope that it will be useful, | * This library is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
skipping to change at line 112 | skipping to change at line 112 | |||
* Check if the tagbucket contains a specific tag. | * Check if the tagbucket contains a specific tag. | |||
* | * | |||
* @memberof ee_tagbucket | * @memberof ee_tagbucket | |||
* @public | * @public | |||
* | * | |||
* @param[in] tagbucket the tagbucket to check | * @param[in] tagbucket the tagbucket to check | |||
* @param[in] tagname name of the tag | * @param[in] tagname name of the tag | |||
* | * | |||
* @return 0 if tag not present, something else otherwise | * @return 0 if tag not present, something else otherwise | |||
*/ | */ | |||
int ee_BucketHasTag(struct ee_tagbucket *tagbucket, es_str_t *tagname); | int ee_TagbucketHasTag(struct ee_tagbucket *tagbucket, es_str_t *tagname); | |||
/** | ||||
* Iterate over all tags inside a tag bucket. | ||||
* On initial entry, cookie must be set to zero. The cookie returned | ||||
* from each call must be passed into the next call. If the returned | ||||
* cookie is NULL, no more tags are available (this may happen immediately | ||||
* if the tag bucket is empty). So the proper terminating condition to | ||||
* check for is returned cookie == NULL. The actual return code | ||||
* shall only be check for errors. Note that it is NOT permitted and | ||||
* can lead to fatal errors if the tagbucket is changed between calls. | ||||
* If the tagbucket changes, an initial call with a NULL-cookie must be | ||||
* made. | ||||
* | ||||
* @memberof ee_value | ||||
* @public | ||||
* | ||||
* @param[in] tagbucket tagbucket to process | ||||
* @param[in/out] cookie cookie - for details see description | ||||
* @param[out] tagname name of tag | ||||
* @return 0 if tag not present, something else otherwise | ||||
*/ | ||||
int ee_TagbucketGetNextTag(struct ee_tagbucket *tagbucket, void **cookie, e | ||||
s_str_t **tagname); | ||||
#endif /* #ifndef LIBEE_TAGBUCKET_H_INCLUDED */ | #endif /* #ifndef LIBEE_TAGBUCKET_H_INCLUDED */ | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 25 lines changed or added | |||
timestamp.h | timestamp.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* Lesser General Public License for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* You should have received a copy of the GNU Lesser General Public | * You should have received a copy of the GNU Lesser General Public | |||
* License along with this library; if not, write to the Free Software | * License along with this library; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA | |||
* | * | |||
* A copy of the LGPL v2.1 can be found in the file "COPYING" in this distr ibution. | * A copy of the LGPL v2.1 can be found in the file "COPYING" in this distr ibution. | |||
*/ | */ | |||
#ifndef LIBEE_TIMESTAMP_H_INCLUDED | #ifndef LIBEE_TIMESTAMP_H_INCLUDED | |||
#define LIBEE_TIMESTAMP_H_INCLUDED | #define LIBEE_TIMESTAMP_H_INCLUDED | |||
#include <time.h> /* needed for Solaris */ | ||||
/** | /** | |||
* An object to represent a CEE/XML timestamp. | * An object to represent a CEE/XML timestamp. | |||
* | * | |||
* TODO: maybe replace with something from libxml, as it is | * TODO: maybe replace with something from libxml, as it is | |||
* a xs:date type of stamp. | * a xs:date type of stamp. | |||
*/ | */ | |||
struct ee_timestamp { | struct ee_timestamp { | |||
time_t stamp; | time_t stamp; | |||
}; | }; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||