VES EVEL Library VES 5.4.1 enhancements
[demo.git] / vnfs / VES5.0 / evel / evel-library / code / evel_library / evel.h
index 5c05993..8cdc4b5 100644 (file)
@@ -495,7 +495,7 @@ void evel_free_batch(EVENT_HEADER * event);
 /* Supported Fault version.                                                  */
 /*****************************************************************************/
 #define EVEL_FAULT_MAJOR_VERSION 2
-#define EVEL_FAULT_MINOR_VERSION 1
+#define EVEL_FAULT_MINOR_VERSION 0
 
 /**************************************************************************//**
  * Fault.
@@ -581,7 +581,7 @@ typedef struct json_object_instance
 {
 
   char *jsonstring;
-  unsigned long long objinst_epoch_microsec;
+  EVEL_OPTION_ULL objinst_epoch_microsec;
   DLIST object_keys; /*EVEL_INTERNAL_KEY list */
 
 } EVEL_JSON_OBJECT_INSTANCE;
@@ -649,7 +649,7 @@ void evel_free_jsonobject(EVEL_JSON_OBJECT * jsobj);
 /* Supported Measurement version.                                            */
 /*****************************************************************************/
 #define EVEL_MEASUREMENT_MAJOR_VERSION 2
-#define EVEL_MEASUREMENT_MINOR_VERSION 1
+#define EVEL_MEASUREMENT_MINOR_VERSION 0
 
 /**************************************************************************//**
  * Errors.
@@ -703,6 +703,37 @@ typedef struct event_measurement {
 
 } EVENT_MEASUREMENT;
 
+
+
+/**************************************************************************//**
+ * Add an additional value name/value pair to the Measurement.
+ *
+ * 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 measurement     Pointer to the measurement.
+ * @param name      ASCIIZ string with the attribute's name.  The caller
+ *                  does not need to preserve the value once the function
+ *                  returns.
+ * @param value     ASCIIZ string with the attribute's value.  The caller
+ *                  does not need to preserve the value once the function
+ *                  returns.
+ *****************************************************************************/
+void evel_measurement_addl_info_add(EVENT_MEASUREMENT * measurement, char * name, char * value);
+
+/**************************************************************************//**
+ * Add a json object to jsonObject list.
+ *
+ * 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 measurement     Pointer to the ScalingMeasurement
+ * @param jsonobj   Pointer to json object
+ *****************************************************************************/
+void evel_measurement_addl_object_add(EVENT_MEASUREMENT * measurement, EVEL_JSON_OBJECT *jsonobj);
+
 /**************************************************************************//**
  * CPU Usage.
  * JSON equivalent field: cpuUsage
@@ -1042,7 +1073,7 @@ typedef struct custom_measurement {
 /* Supported Report version.                                                 */
 /*****************************************************************************/
 #define EVEL_REPORT_MAJOR_VERSION 1
-#define EVEL_REPORT_MINOR_VERSION 1
+#define EVEL_REPORT_MINOR_VERSION 0
 
 /**************************************************************************//**
  * Report.
@@ -1195,7 +1226,7 @@ typedef struct event_mobile_flow {
 /* Supported Other field version.                                            */
 /*****************************************************************************/
 #define EVEL_OTHER_EVENT_MAJOR_VERSION 1
-#define EVEL_OTHER_EVENT_MINOR_VERSION 1
+#define EVEL_OTHER_EVENT_MINOR_VERSION 0
 
 /**************************************************************************//**
  * Other.
@@ -1225,7 +1256,7 @@ typedef struct other_field {
 /* Supported Service Events version.                                         */
 /*****************************************************************************/
 #define EVEL_HEARTBEAT_FIELD_MAJOR_VERSION 1
-#define EVEL_HEARTBEAT_FIELD_MINOR_VERSION 1
+#define EVEL_HEARTBEAT_FIELD_MINOR_VERSION 0
 
 
 /*****************************************************************************/
@@ -1287,8 +1318,8 @@ typedef struct signaling_additional_field {
 /*****************************************************************************/
 /* Supported State Change version.                                           */
 /*****************************************************************************/
-#define EVEL_STATE_CHANGE_MAJOR_VERSION 1
-#define EVEL_STATE_CHANGE_MINOR_VERSION 2
+#define EVEL_STATE_CHANGE_MAJOR_VERSION 2
+#define EVEL_STATE_CHANGE_MINOR_VERSION 0
 
 /**************************************************************************//**
  * State Change.
@@ -1398,6 +1429,8 @@ typedef struct copyright {
  *
  * @param   fqdn    The API's FQDN or IP address.
  * @param   port    The API's port.
+ * @param   bakup_fqdn    The API's FQDN or IP address.
+ * @param   bakup_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
@@ -1410,7 +1443,10 @@ typedef struct copyright {
  * @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   bakup_username  Username for Basic Authentication of Bakup FQDN.
+ * @param   bakup_password  Password for Basic Authentication of Bakup FQDN.
+ * @param   source_ip       The ip of node we represent.(NULL for default ip)
+ * @param   bakup_source_ip The ip bakup fqdn interface.(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
@@ -1422,6 +1458,8 @@ typedef struct copyright {
  *****************************************************************************/
 EVEL_ERR_CODES evel_initialize(const char * const fqdn,
                                int port,
+                               const char * const bakup_fqdn,
+                               int bakup_port,
                                const char * const path,
                                const char * const topic,
                                int ring_buf_size,
@@ -1434,7 +1472,10 @@ EVEL_ERR_CODES evel_initialize(const char * const fqdn,
                                long verify_host,
                                const char * const username,
                                const char * const password,
+                               const char * const bakup_username,
+                               const char * const bakup_password,
                                const char * const source_ip,
+                               const char * const bakup_source_ip,
                                EVEL_SOURCE_TYPES source_type,
                                const char * const role,
                                int verbosity
@@ -1581,6 +1622,22 @@ EVENT_HEADER * evel_new_heartbeat(void);
  *****************************************************************************/
 EVENT_HEADER * evel_new_heartbeat_nameid(const char* ev_name, const char *ev_id);
 
+/**************************************************************************//**
+ * Create a new Heartbeat fields event.
+ *
+ * @note    The mandatory fields on the Heartbeat fields 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 event has immutable properties.
+ * @param ev_name  Unique Event Name confirming Domain AsdcModel Description
+ * @param ev_id    A universal identifier of the event for: troubleshooting correlation, analysis, etc
+ * @param interval    heartbeat interval
+ * @returns pointer to the newly manufactured ::EVENT_HEARTBEAT_FIELD.  If the event
+ *          is not used (i.e. posted) it must be released using
+ *          ::evel_free_hrtbt_field.
+ * @retval  NULL  Failed to create the event.
+ *****************************************************************************/
+EVENT_HEARTBEAT_FIELD * evel_new_heartbeat_field(int interval,const char* ev_name, const char *ev_id);
 
 /**************************************************************************//**
  * Free an event header.
@@ -1611,6 +1668,24 @@ void evel_init_header(EVENT_HEADER * const header,const char *const eventname);
 void evel_header_type_set(EVENT_HEADER * const header,
                           const char * const type);
 
+/**************************************************************************//**
+ * Set the next event_sequence to use.
+ *
+ * @param sequence      The next sequence number to use.
+ *****************************************************************************/
+void evel_set_global_event_sequence(const int sequence);
+
+/**************************************************************************//**
+ * Set the Event Sequence property of the event header.
+ *
+ * @note This is mainly for tracking fault event sequence numbers
+ *
+ * @param header        Pointer to the ::EVENT_HEADER.
+ * @param sequence_number
+ * 
+ *****************************************************************************/
+void evel_event_sequence_set(EVENT_HEADER * const header,const int sequence_number);
+
 /**************************************************************************//**
  * Set the Start Epoch property of the event header.
  *
@@ -1646,6 +1721,17 @@ void evel_last_epoch_set(EVENT_HEADER * const header,
 void evel_reporting_entity_name_set(EVENT_HEADER * const header,
                                     const char * const entity_name);
 
+/**************************************************************************//**
+ * Set the Source Name property of the event header.
+ *
+ * @note The Source Name defaults to the OpenStack VM Name.
+ *
+ * @param header        Pointer to the ::EVENT_HEADER.
+ * @param entity_name   The source name to set.
+ *****************************************************************************/
+void evel_source_name_set(EVENT_HEADER * const header,
+                          const char * const source_name);
+
 /**************************************************************************//**
  * Set the Reporting Entity Id property of the event header.
  *
@@ -1657,6 +1743,17 @@ void evel_reporting_entity_name_set(EVENT_HEADER * const header,
 void evel_reporting_entity_id_set(EVENT_HEADER * const header,
                                   const char * const entity_id);
 
+/**************************************************************************//**
+ * Set the Source Id property of the event header.
+ *
+ * @note The Source Id defaults to the OpenStack VM UUID.
+ *
+ * @param header        Pointer to the ::EVENT_HEADER.
+ * @param entity_id     The Source id to set.
+ *****************************************************************************/
+void evel_source_id_set(EVENT_HEADER * const header,
+                        const char * const source_id);
+
 /**************************************************************************//**
  * Set the NFC Naming code property of the event header.
  *
@@ -4037,7 +4134,7 @@ int evel_get_measurement_interval();
 /* Supported Report version.                                                 */
 /*****************************************************************************/
 #define EVEL_VOICEQ_MAJOR_VERSION 1
-#define EVEL_VOICEQ_MINOR_VERSION 1
+#define EVEL_VOICEQ_MINOR_VERSION 0
 
 /**************************************************************************//**
  * End of Call Voice Quality Metrices