-#ifndef EVEL_INCLUDED
-#define EVEL_INCLUDED
/*************************************************************************//**
*
* Copyright © 2017 AT&T Intellectual Property. All rights reserved.
* be one of ::EVEL_ERR_CODES.
*****************************************************************************/
+#ifndef EVEL_INCLUDED
+#define EVEL_INCLUDED
+
#ifdef __cplusplus
extern "C" {
#endif
/* Maximum string lengths. */
/*****************************************************************************/
#define EVEL_MAX_STRING_LEN 4096
-#define EVEL_MAX_JSON_BODY 16000
+#define EVEL_MAX_JSON_BODY 524288
#define EVEL_MAX_ERROR_STRING_LEN 255
#define EVEL_MAX_URL_LEN 511
*****************************************************************************/
typedef enum {
EVEL_DOMAIN_INTERNAL, /** Internal event, not for external routing. */
+ EVEL_DOMAIN_BATCH, /** Batch event, composite event. */
EVEL_DOMAIN_HEARTBEAT, /** A Heartbeat event (event header only). */
EVEL_DOMAIN_FAULT, /** A Fault event. */
EVEL_DOMAIN_MEASUREMENT, /** A Measurement for VF Scaling event. */
/*****************************************************************************/
/* Supported Common Event Header version. */
/*****************************************************************************/
-#define EVEL_HEADER_MAJOR_VERSION 1
-#define EVEL_HEADER_MINOR_VERSION 2
+#define EVEL_HEADER_MAJOR_VERSION 3
+#define EVEL_HEADER_MINOR_VERSION 0
+#define EVEL_BATCH_MAJOR_VERSION 1
+#define EVEL_BATCH_MINOR_VERSION 0
/**************************************************************************//**
* Event header.
* JSON equivalent field: commonEventHeader
EVEL_OPTION_INTHEADER_FIELDS internal_field;
EVEL_OPTION_STRING nfcnaming_code;
EVEL_OPTION_STRING nfnaming_code;
+ DLIST batch_events;
} EVENT_HEADER;
+/**************************************************************************//**
+ * Initialize a newly created event header.
+ *
+ * @param header Pointer to the header being initialized.
+ * @param eventname Eventname string
+ * @param eventid Event id : unique id for classification and analysis
+ * @param header Pointer to the header being initialized.
+ *****************************************************************************/
+void evel_init_header_nameid(EVENT_HEADER * const header,const char *const eventname, const char *eventid);
+
+/**************************************************************************//**
+ * Create a new Batch event.
+ *
+ * @note The mandatory fields on the Batch must be supplied to this factory
+ * function and are immutable once set. Optional fields have explicit
+ * setter functions, but again values may only be set once so that the
+ * Batch has immutable properties. At this time evename and eventid
+ * for batch events are set but not used in json encoding
+ * @returns pointer to the newly manufactured ::EVENT_HEADER. If the event is
+ * not used (i.e. posted) it must be released using ::evel_free_batch.
+ * @retval NULL Failed to create the event.
+ *****************************************************************************/
+EVENT_HEADER * evel_new_batch(const char* ev_name, const char *ev_id);
+
+
+/**************************************************************************//**
+ * Add an Event into Batch Event
+ *
+ * The name and value are null delimited ASCII strings. The library takes
+ * a copy so the caller does not have to preserve values after the function
+ * returns.
+ *
+ * @param other Pointer to the Batch Event.
+ * @param jsonobj Pointer to additional Event
+ *****************************************************************************/
+void evel_batch_add_event(EVENT_HEADER * batchev, EVENT_HEADER *child);
+
+/**************************************************************************//**
+ * Free an Batch.
+ *
+ * Free off the Batch supplied. Will free all the contained allocated memory.
+ *
+ * @note It does not free the Batch itself, since that may be part of a
+ * larger structure.
+ *****************************************************************************/
+void evel_free_batch(EVENT_HEADER * event);
+
/*****************************************************************************/
/* Supported Fault version. */
/*****************************************************************************/
/*****************************************************************************/
/* Supported Mobile Flow version. */
/*****************************************************************************/
-#define EVEL_MOBILE_FLOW_MAJOR_VERSION 1
-#define EVEL_MOBILE_FLOW_MINOR_VERSION 2
+#define EVEL_MOBILE_FLOW_MAJOR_VERSION 2
+#define EVEL_MOBILE_FLOW_MINOR_VERSION 0
/**************************************************************************//**
* Mobile Flow.
/*****************************************************************************/
/* Supported Signaling version. */
/*****************************************************************************/
-#define EVEL_SIGNALING_MAJOR_VERSION 2
-#define EVEL_SIGNALING_MINOR_VERSION 1
+#define EVEL_SIGNALING_MAJOR_VERSION 1
+#define EVEL_SIGNALING_MINOR_VERSION 0
/**************************************************************************//**
* Vendor VNF Name fields.
/*****************************************************************************/
/* Supported Syslog version. */
/*****************************************************************************/
-#define EVEL_SYSLOG_MAJOR_VERSION 1
-#define EVEL_SYSLOG_MINOR_VERSION 2
+#define EVEL_SYSLOG_MAJOR_VERSION 3
+#define EVEL_SYSLOG_MINOR_VERSION 0
/**************************************************************************//**
* Syslog.
* @param port The API's port.
* @param path The optional path (may be NULL).
* @param topic The optional topic part of the URL (may be NULL).
+ * @param ring_buf_size Ring buffer size (>=100) ~ Avg Messages in 1hr
* @param secure Whether to use HTTPS (0=HTTP, 1=HTTPS).
+ * @param cert_file_path Path to client certificate file
+ * @param key_file_path Path to client key file
+ * @param ca_info Path to CA info
+ * @param ca_file_path Path to CA file
+ * @param verify_peer SSL verification of peer 0 or 1
+ * @param verify_host SSL verification of host 0 or 1
* @param username Username for Basic Authentication of requests.
* @param password Password for Basic Authentication of requests.
+ * @param source_ip The ip of node we represent.(NULL for default ip)
* @param source_type The kind of node we represent.
* @param role The role this node undertakes.
* @param verbosity 0 for normal operation, positive values for chattier
int port,
const char * const path,
const char * const topic,
+ int ring_buf_size,
int secure,
+ const char * const cert_file_path,
+ const char * const key_file_path,
+ const char * const ca_info,
+ const char * const ca_file_path,
+ long verify_peer,
+ long verify_host,
const char * const username,
const char * const password,
+ const char * const source_ip,
EVEL_SOURCE_TYPES source_type,
const char * const role,
int verbosity
* Encode the event as a JSON event object according to AT&T's schema.
*
* @param json Pointer to where to store the JSON encoded data.
+ * @param mode Event mode or Batch mode
* @param max_size Size of storage available in json_body.
* @param event Pointer to the ::EVENT_HEADER to encode.
* @returns Number of bytes actually written.
int evel_json_encode_event(char * json,
int max_size,
EVENT_HEADER * event);
-
+int evel_json_encode_batch_event(char * json,
+ int max_size,
+ EVENT_HEADER * event);
/**************************************************************************//**
* Initialize an event instance id.
*
*
* @note that the heartbeat is just a "naked" commonEventHeader!
*
- * @param event_name Unique Event Name confirming Domain AsdcModel Description
- * @param event_id A universal identifier of the event for: troubleshooting correlation, analysis, etc
+ * @param event_name Unique Event Name: {DomainAbbreviation}_{AsdcModel or ApplicationPlatform}_{DescriptionOfInfoBeingConveyed}
+ * @param event_id A universal identifier of the event for: troubleshooting, cross-referencing of alarms for alarm correlation, offline log analysis, etc
*
* @returns pointer to the newly manufactured ::EVENT_HEADER. If the event is
* not used it must be released using ::evel_free_event
/*****************************************************************************/
/* Supported Threshold Crossing version. */
/*****************************************************************************/
-#define EVEL_THRESHOLD_CROSS_MAJOR_VERSION 1
-#define EVEL_THRESHOLD_CROSS_MINOR_VERSION 1
+#define EVEL_THRESHOLD_CROSS_MAJOR_VERSION 2
+#define EVEL_THRESHOLD_CROSS_MINOR_VERSION 0
/**************************************************************************//**
* Threshold Crossing.