Function to modify event source name 29/29429/1
authorGokul Singaraju <goksing@gmail.com>
Mon, 29 Jan 2018 04:58:35 +0000 (23:58 -0500)
committerGokul Singaraju <goksing@gmail.com>
Mon, 29 Jan 2018 05:00:22 +0000 (00:00 -0500)
Issue-ID: CERT-13
Change-Id: I7dc342bc7fcf99525958c32cd6c6c309344640fc
Signed-Off-by: Gokul SIngaraju <goksing@gmail.com>
vnfs/VES5.0/evel/evel-library/code/evel_library/evel.h
vnfs/VES5.0/evel/evel-library/code/evel_library/evel_event_mgr.c
vnfs/VES5.0/evel/evel-library/code/evel_library/evel_voicequality.c
vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c

index 896dd9d..5c05993 100644 (file)
@@ -1440,6 +1440,17 @@ EVEL_ERR_CODES evel_initialize(const char * const fqdn,
                                int verbosity
                                );
 
+/**************************************************************************//**
+ * Initialize value for vm_name for all coming events
+ * @param  source_name  Source name string.
+ *                      Must confirm with EVEL source name standard
+ * @returns Status code
+ * @retval  EVEL_SUCCESS      On success
+ * @retval  ::EVEL_ERR_CODES  On failure.
+ *****************************************************************************/
+EVEL_ERR_CODES evel_set_source_name(char * src_name);
+
+
 /**************************************************************************//**
  * Clean up the EVEL library.
  *
index d10543b..fb94daf 100644 (file)
@@ -477,7 +477,7 @@ EVEL_ERR_CODES event_handler_initialize(const char * const event_api_url,
   /***************************************************************************/
   if( ring_buf_size < EVEL_EVENT_BUFFER_DEPTH )
   {
-    log_error_state("Warning: Failed to initialize Ring buffer size to %d. "
+    log_error_state("Warning: Failed to initialize Ring buffer size to %d. ",
                     ring_buf_size);
     goto exit_label;
   }
index 543d509..04238d1 100644 (file)
@@ -467,7 +467,6 @@ void evel_json_encode_voice_quality(EVEL_JSON_BUFFER * jbuf,
   DLIST_ITEM * addlInfoItem = NULL;
 
   END_OF_CALL_VOICE_QUALITY_METRICS * vQMetrics = NULL;
-  DLIST_ITEM * vQMetricsItem = NULL;
 
   EVEL_ENTER();
 
index fceb893..b865074 100644 (file)
@@ -309,6 +309,7 @@ exit_label:
   return rc;
 }
 
+
 /**************************************************************************//**
  * Initialize default values for vm_name and vm_uuid - for testing purposes.
  *****************************************************************************/
@@ -340,6 +341,29 @@ void openstack_metadata_initialize()
 
 }
 
+/**************************************************************************//**
+ * Initialize value for vm_name for all coming events
+ * @param  source_name  Source name string.
+ *                      Must confirm with EVEL source name standard
+ * @returns Status code
+ * @retval  EVEL_SUCCESS      On success
+ * @retval  ::EVEL_ERR_CODES  On failure.
+ *****************************************************************************/
+EVEL_ERR_CODES evel_set_source_name(char * src_name)
+{
+  if( src_name && src_name[0] )
+  {
+      if( strlen(src_name) < MAX_METADATA_STRING ){
+          strcpy(vm_name,src_name);
+          return EVEL_SUCCESS;
+       } else 
+          EVEL_DEBUG("Event Source Name too long");
+  }
+  else
+     EVEL_DEBUG("Invalid Event Source Name string");
+  return EVEL_ERR_GEN_FAIL;
+}
+
 /**************************************************************************//**
  * Get a string value from supplied JSON by matching the key.
  *