Merge "removed vFW vLB extra executables"
[demo.git] / VES5.0 / evel / evel-library / code / evel_library / evel.h
1 #ifndef EVEL_INCLUDED
2 #define EVEL_INCLUDED
3 /**************************************************************************//**
4  * @file
5  * Header for EVEL library
6  *
7  * This file implements the EVEL library which is intended to provide a
8  * simple wrapper around the complexity of AT&T's Vendor Event Listener API so
9  * that VNFs can use it without worrying about details of the API transport.
10  *
11  * Zero return value is success (::EVEL_SUCCESS), non-zero is failure and will
12  * be one of ::EVEL_ERR_CODES.
13  *
14  * License
15  * -------
16  *
17  * Copyright(c) <2016>, AT&T Intellectual Property.  All other rights reserved.
18  *
19  * Redistribution and use in source and binary forms, with or without
20  * modification, are permitted provided that the following conditions are met:
21  *
22  * 1. Redistributions of source code must retain the above copyright notice,
23  *    this list of conditions and the following disclaimer.
24  * 2. Redistributions in binary form must reproduce the above copyright notice,
25  *    this list of conditions and the following disclaimer in the documentation
26  *    and/or other materials provided with the distribution.
27  * 3. All advertising materials mentioning features or use of this software
28  *    must display the following acknowledgement:  This product includes
29  *    software developed by the AT&T.
30  * 4. Neither the name of AT&T nor the names of its contributors may be used to
31  *    endorse or promote products derived from this software without specific
32  *    prior written permission.
33  *
34  * THIS SOFTWARE IS PROVIDED BY AT&T INTELLECTUAL PROPERTY ''AS IS'' AND ANY
35  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37  * DISCLAIMED. IN NO EVENT SHALL AT&T INTELLECTUAL PROPERTY BE LIABLE FOR ANY
38  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
41  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
43  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44  *****************************************************************************/
45
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49
50 #include <stdbool.h>
51 #include <stdio.h>
52 #include <stdarg.h>
53 #include <time.h>
54
55 #include "jsmn.h"
56 #include "double_list.h"
57 #include "hashtable.h"
58
59 /*****************************************************************************/
60 /* Supported API version.                                                    */
61 /*****************************************************************************/
62 #define EVEL_API_MAJOR_VERSION 5
63 #define EVEL_API_MINOR_VERSION 0
64
65 /**************************************************************************//**
66  * Error codes
67  *
68  * Error codes for EVEL low level interface
69  *****************************************************************************/
70 typedef enum {
71   EVEL_SUCCESS,                   /** The operation was successful.          */
72   EVEL_ERR_GEN_FAIL,              /** Non-specific failure.                  */
73   EVEL_CURL_LIBRARY_FAIL,         /** A cURL library operation failed.       */
74   EVEL_PTHREAD_LIBRARY_FAIL,      /** A Posix threads operation failed.      */
75   EVEL_OUT_OF_MEMORY,             /** A memory allocation failure occurred.  */
76   EVEL_EVENT_BUFFER_FULL,         /** Too many events in the ring-buffer.    */
77   EVEL_EVENT_HANDLER_INACTIVE,    /** Attempt to raise event when inactive.  */
78   EVEL_NO_METADATA,               /** Failed to retrieve OpenStack metadata. */
79   EVEL_BAD_METADATA,              /** OpenStack metadata invalid format.     */
80   EVEL_BAD_JSON_FORMAT,           /** JSON failed to parse correctly.        */
81   EVEL_JSON_KEY_NOT_FOUND,        /** Failed to find the specified JSON key. */
82   EVEL_MAX_ERROR_CODES            /** Maximum number of valid error codes.   */
83 } EVEL_ERR_CODES;
84
85 /**************************************************************************//**
86  * Logging levels
87  *
88  * Variable levels of verbosity in the logging functions.
89  *****************************************************************************/
90 typedef enum {
91   EVEL_LOG_MIN               = 0,
92   EVEL_LOG_SPAMMY            = 30,
93   EVEL_LOG_DEBUG             = 40,
94   EVEL_LOG_INFO              = 50,
95   EVEL_LOG_ERROR             = 60,
96   EVEL_LOG_MAX               = 101
97 } EVEL_LOG_LEVELS;
98
99 /*****************************************************************************/
100 /* Maximum string lengths.                                                   */
101 /*****************************************************************************/
102 #define EVEL_MAX_STRING_LEN          4096
103 #define EVEL_MAX_JSON_BODY           16000
104 #define EVEL_MAX_ERROR_STRING_LEN    255
105 #define EVEL_MAX_URL_LEN             511
106
107 /**************************************************************************//**
108  * This value represents there being no restriction on the reporting interval.
109  *****************************************************************************/
110 static const int EVEL_MEASUREMENT_INTERVAL_UKNOWN = 0;
111
112 /**************************************************************************//**
113  * How many events can be backed-up before we start dropping events on the
114  * floor.
115  *
116  * @note  This value should be tuned in accordance with expected burstiness of
117  *        the event load and the expected response time of the ECOMP event
118  *        listener so that the probability of the buffer filling is suitably
119  *        low.
120  *****************************************************************************/
121 static const int EVEL_EVENT_BUFFER_DEPTH = 100;
122
123 /*****************************************************************************/
124 /* How many different IP Types-of-Service are supported.                     */
125 /*****************************************************************************/
126 #define EVEL_TOS_SUPPORTED      256
127
128 /**************************************************************************//**
129  * Event domains for the various events we support.
130  * JSON equivalent field: domain
131  *****************************************************************************/
132 typedef enum {
133   EVEL_DOMAIN_INTERNAL,       /** Internal event, not for external routing.  */
134   EVEL_DOMAIN_HEARTBEAT,      /** A Heartbeat event (event header only).     */
135   EVEL_DOMAIN_FAULT,          /** A Fault event.                             */
136   EVEL_DOMAIN_MEASUREMENT,    /** A Measurement for VF Scaling event.        */
137   EVEL_DOMAIN_MOBILE_FLOW,    /** A Mobile Flow event.                       */
138   EVEL_DOMAIN_REPORT,         /** A Measurement for VF Reporting event.      */
139   EVEL_DOMAIN_HEARTBEAT_FIELD,/** A Heartbeat field event.                   */
140   EVEL_DOMAIN_SIPSIGNALING,   /** A Signaling event.                         */
141   EVEL_DOMAIN_STATE_CHANGE,   /** A State Change event.                      */
142   EVEL_DOMAIN_SYSLOG,         /** A Syslog event.                            */
143   EVEL_DOMAIN_OTHER,          /** Another event.                             */
144   EVEL_DOMAIN_VOICE_QUALITY,  /** A Voice Quality Event                      */
145   EVEL_MAX_DOMAINS            /** Maximum number of recognized Event types.  */
146 } EVEL_EVENT_DOMAINS;
147
148 /**************************************************************************//**
149  * Event priorities.
150  * JSON equivalent field: priority
151  *****************************************************************************/
152 typedef enum {
153   EVEL_PRIORITY_HIGH,
154   EVEL_PRIORITY_MEDIUM,
155   EVEL_PRIORITY_NORMAL,
156   EVEL_PRIORITY_LOW,
157   EVEL_MAX_PRIORITIES
158 } EVEL_EVENT_PRIORITIES;
159
160 /**************************************************************************//**
161  * Fault / Threshold severities.
162  * JSON equivalent field: eventSeverity
163  *****************************************************************************/
164 typedef enum {
165   EVEL_SEVERITY_CRITICAL,
166   EVEL_SEVERITY_MAJOR,
167   EVEL_SEVERITY_MINOR,
168   EVEL_SEVERITY_WARNING,
169   EVEL_SEVERITY_NORMAL,
170   EVEL_MAX_SEVERITIES
171 } EVEL_SEVERITIES;
172
173 /**************************************************************************//**
174  * Fault source types.
175  * JSON equivalent field: eventSourceType
176  *****************************************************************************/
177 typedef enum {
178   EVEL_SOURCE_OTHER,
179   EVEL_SOURCE_ROUTER,
180   EVEL_SOURCE_SWITCH,
181   EVEL_SOURCE_HOST,
182   EVEL_SOURCE_CARD,
183   EVEL_SOURCE_PORT,
184   EVEL_SOURCE_SLOT_THRESHOLD,
185   EVEL_SOURCE_PORT_THRESHOLD,
186   EVEL_SOURCE_VIRTUAL_MACHINE,
187   EVEL_SOURCE_VIRTUAL_NETWORK_FUNCTION,
188   /***************************************************************************/
189   /* START OF VENDOR-SPECIFIC VALUES                                         */
190   /*                                                                         */
191   /* Vendor-specific values should be added here, and handled appropriately  */
192   /* in evel_event.c.                                                        */
193   /***************************************************************************/
194
195   /***************************************************************************/
196   /* END OF VENDOR-SPECIFIC VALUES                                           */
197   /***************************************************************************/
198   EVEL_MAX_SOURCE_TYPES
199 } EVEL_SOURCE_TYPES;
200
201 /**************************************************************************//**
202  * Fault VNF Status.
203  * JSON equivalent field: vfStatus
204  *****************************************************************************/
205 typedef enum {
206   EVEL_VF_STATUS_ACTIVE,
207   EVEL_VF_STATUS_IDLE,
208   EVEL_VF_STATUS_PREP_TERMINATE,
209   EVEL_VF_STATUS_READY_TERMINATE,
210   EVEL_VF_STATUS_REQ_TERMINATE,
211   EVEL_MAX_VF_STATUSES
212 } EVEL_VF_STATUSES;
213
214 /**************************************************************************//**
215  * Counter criticalities.
216  * JSON equivalent field: criticality
217  *****************************************************************************/
218 typedef enum {
219   EVEL_COUNTER_CRITICALITY_CRIT,
220   EVEL_COUNTER_CRITICALITY_MAJ,
221   EVEL_MAX_COUNTER_CRITICALITIES
222 } EVEL_COUNTER_CRITICALITIES;
223
224 /**************************************************************************//**
225  * Alert actions.
226  * JSON equivalent field: alertAction
227  *****************************************************************************/
228 typedef enum {
229   EVEL_ALERT_ACTION_CLEAR,
230   EVEL_ALERT_ACTION_CONT,
231   EVEL_ALERT_ACTION_SET,
232   EVEL_MAX_ALERT_ACTIONS
233 } EVEL_ALERT_ACTIONS;
234
235 /**************************************************************************//**
236  * Alert types.
237  * JSON equivalent field: alertType
238  *****************************************************************************/
239 typedef enum {
240   EVEL_ALERT_TYPE_CARD,
241   EVEL_ALERT_TYPE_ELEMENT,
242   EVEL_ALERT_TYPE_INTERFACE,
243   EVEL_ALERT_TYPE_SERVICE,
244   EVEL_MAX_ALERT_TYPES
245 } EVEL_ALERT_TYPES;
246
247 /**************************************************************************//**
248  * Alert types.
249  * JSON equivalent fields: newState, oldState
250  *****************************************************************************/
251 typedef enum {
252   EVEL_ENTITY_STATE_IN_SERVICE,
253   EVEL_ENTITY_STATE_MAINTENANCE,
254   EVEL_ENTITY_STATE_OUT_OF_SERVICE,
255   EVEL_MAX_ENTITY_STATES
256 } EVEL_ENTITY_STATE;
257
258 /**************************************************************************//**
259  * Syslog facilities.
260  * JSON equivalent field: syslogFacility
261  *****************************************************************************/
262 typedef enum {
263   EVEL_SYSLOG_FACILITY_KERNEL,
264   EVEL_SYSLOG_FACILITY_USER,
265   EVEL_SYSLOG_FACILITY_MAIL,
266   EVEL_SYSLOG_FACILITY_SYSTEM_DAEMON,
267   EVEL_SYSLOG_FACILITY_SECURITY_AUTH,
268   EVEL_SYSLOG_FACILITY_INTERNAL,
269   EVEL_SYSLOG_FACILITY_LINE_PRINTER,
270   EVEL_SYSLOG_FACILITY_NETWORK_NEWS,
271   EVEL_SYSLOG_FACILITY_UUCP,
272   EVEL_SYSLOG_FACILITY_CLOCK_DAEMON,
273   EVEL_SYSLOG_FACILITY_SECURITY_AUTH2,
274   EVEL_SYSLOG_FACILITY_FTP_DAEMON,
275   EVEL_SYSLOG_FACILITY_NTP,
276   EVEL_SYSLOG_FACILITY_LOG_AUDIT,
277   EVEL_SYSLOG_FACILITY_LOG_ALERT,
278   EVEL_SYSLOG_FACILITY_CLOCK_DAEMON2,
279   EVEL_SYSLOG_FACILITY_LOCAL0,
280   EVEL_SYSLOG_FACILITY_LOCAL1,
281   EVEL_SYSLOG_FACILITY_LOCAL2,
282   EVEL_SYSLOG_FACILITY_LOCAL3,
283   EVEL_SYSLOG_FACILITY_LOCAL4,
284   EVEL_SYSLOG_FACILITY_LOCAL5,
285   EVEL_SYSLOG_FACILITY_LOCAL6,
286   EVEL_SYSLOG_FACILITY_LOCAL7,
287   EVEL_MAX_SYSLOG_FACILITIES
288 } EVEL_SYSLOG_FACILITIES;
289
290 /**************************************************************************//**
291  * TCP flags.
292  * JSON equivalent fields: tcpFlagCountList, tcpFlagList
293  *****************************************************************************/
294 typedef enum {
295   EVEL_TCP_NS,
296   EVEL_TCP_CWR,
297   EVEL_TCP_ECE,
298   EVEL_TCP_URG,
299   EVEL_TCP_ACK,
300   EVEL_TCP_PSH,
301   EVEL_TCP_RST,
302   EVEL_TCP_SYN,
303   EVEL_TCP_FIN,
304   EVEL_MAX_TCP_FLAGS
305 } EVEL_TCP_FLAGS;
306
307 /**************************************************************************//**
308  * Mobile QCI Classes of Service.
309  * JSON equivalent fields: mobileQciCosCountList, mobileQciCosList
310  *****************************************************************************/
311 typedef enum {
312
313   /***************************************************************************/
314   /* UMTS Classes of Service.                                                */
315   /***************************************************************************/
316   EVEL_QCI_COS_UMTS_CONVERSATIONAL,
317   EVEL_QCI_COS_UMTS_STREAMING,
318   EVEL_QCI_COS_UMTS_INTERACTIVE,
319   EVEL_QCI_COS_UMTS_BACKGROUND,
320
321   /***************************************************************************/
322   /* LTE Classes of Service.                                                 */
323   /***************************************************************************/
324   EVEL_QCI_COS_LTE_1,
325   EVEL_QCI_COS_LTE_2,
326   EVEL_QCI_COS_LTE_3,
327   EVEL_QCI_COS_LTE_4,
328   EVEL_QCI_COS_LTE_65,
329   EVEL_QCI_COS_LTE_66,
330   EVEL_QCI_COS_LTE_5,
331   EVEL_QCI_COS_LTE_6,
332   EVEL_QCI_COS_LTE_7,
333   EVEL_QCI_COS_LTE_8,
334   EVEL_QCI_COS_LTE_9,
335   EVEL_QCI_COS_LTE_69,
336   EVEL_QCI_COS_LTE_70,
337   EVEL_MAX_QCI_COS_TYPES
338 } EVEL_QCI_COS_TYPES;
339
340 /**************************************************************************//**
341  * Service Event endpoint description
342  * JSON equivalent field: endpointDesc
343  *****************************************************************************/
344 typedef enum {
345   EVEL_SERVICE_ENDPOINT_CALLEE,
346   EVEL_SERVICE_ENDPOINT_CALLER,
347   EVEL_MAX_SERVICE_ENDPOINT_DESC
348 } EVEL_SERVICE_ENDPOINT_DESC;
349
350 /**************************************************************************//**
351  * Boolean type for EVEL library.
352  *****************************************************************************/
353 typedef enum {
354   EVEL_FALSE,
355   EVEL_TRUE
356 } EVEL_BOOLEAN;
357
358 /**************************************************************************//**
359  * Optional parameter holder for double.
360  *****************************************************************************/
361 typedef struct evel_option_double
362 {
363   double value;
364   EVEL_BOOLEAN is_set;
365 } EVEL_OPTION_DOUBLE;
366
367 /**************************************************************************//**
368  * Optional parameter holder for string.
369  *****************************************************************************/
370 typedef struct evel_option_string
371 {
372   char * value;
373   EVEL_BOOLEAN is_set;
374 } EVEL_OPTION_STRING;
375
376 /**************************************************************************//**
377  * Optional parameter holder for int.
378  *****************************************************************************/
379 typedef struct evel_option_int
380 {
381   int value;
382   EVEL_BOOLEAN is_set;
383 } EVEL_OPTION_INT;
384
385 /**************************************************************************//**
386  * Optional parameter holder for unsigned long long.
387  *****************************************************************************/
388 typedef struct evel_option_ull
389 {
390   unsigned long long value;
391   EVEL_BOOLEAN is_set;
392 } EVEL_OPTION_ULL;
393
394 /**************************************************************************//**
395  * Optional parameter holder for time_t.
396  *****************************************************************************/
397 typedef struct evel_option_time
398 {
399   time_t value;
400   EVEL_BOOLEAN is_set;
401 } EVEL_OPTION_TIME;
402
403 /**************************************************************************//**
404  * enrichment fields for internal VES Event Listener service use only,
405  * not supplied by event sources
406  *****************************************************************************/
407 typedef struct internal_header_fields
408 {
409   void *object;
410   EVEL_BOOLEAN is_set;
411 } EVEL_OPTION_INTHEADER_FIELDS;
412
413 /*****************************************************************************/
414 /* Supported Common Event Header version.                                    */
415 /*****************************************************************************/
416 #define EVEL_HEADER_MAJOR_VERSION 1
417 #define EVEL_HEADER_MINOR_VERSION 2
418
419 /**************************************************************************//**
420  * Event header.
421  * JSON equivalent field: commonEventHeader
422  *****************************************************************************/
423 typedef struct event_header {
424   /***************************************************************************/
425   /* Version                                                                 */
426   /***************************************************************************/
427   int major_version;
428   int minor_version;
429
430   /***************************************************************************/
431   /* Mandatory fields                                                        */
432   /***************************************************************************/
433   EVEL_EVENT_DOMAINS event_domain;
434   char * event_id;
435   char * event_name;
436   char * source_name;
437   char * reporting_entity_name;
438   EVEL_EVENT_PRIORITIES priority;
439   unsigned long long start_epoch_microsec;
440   unsigned long long last_epoch_microsec;
441   int sequence;
442
443   /***************************************************************************/
444   /* Optional fields                                                         */
445   /***************************************************************************/
446   EVEL_OPTION_STRING event_type;
447   EVEL_OPTION_STRING source_id;
448   EVEL_OPTION_STRING reporting_entity_id;
449   EVEL_OPTION_INTHEADER_FIELDS internal_field;
450   EVEL_OPTION_STRING nfcnaming_code;
451   EVEL_OPTION_STRING nfnaming_code;
452
453 } EVENT_HEADER;
454
455 /*****************************************************************************/
456 /* Supported Fault version.                                                  */
457 /*****************************************************************************/
458 #define EVEL_FAULT_MAJOR_VERSION 2
459 #define EVEL_FAULT_MINOR_VERSION 1
460
461 /**************************************************************************//**
462  * Fault.
463  * JSON equivalent field: faultFields
464  *****************************************************************************/
465 typedef struct event_fault {
466   /***************************************************************************/
467   /* Header and version                                                      */
468   /***************************************************************************/
469   EVENT_HEADER header;
470   int major_version;
471   int minor_version;
472
473   /***************************************************************************/
474   /* Mandatory fields                                                        */
475   /***************************************************************************/
476   EVEL_SEVERITIES event_severity;
477   EVEL_SOURCE_TYPES event_source_type;
478   char * alarm_condition;
479   char * specific_problem;
480   EVEL_VF_STATUSES vf_status;
481
482   /***************************************************************************/
483   /* Optional fields                                                         */
484   /***************************************************************************/
485   EVEL_OPTION_STRING category;
486   EVEL_OPTION_STRING alarm_interface_a;
487   DLIST additional_info;
488
489 } EVENT_FAULT;
490
491 /**************************************************************************//**
492  * Fault Additional Info.
493  * JSON equivalent field: alarmAdditionalInformation
494  *****************************************************************************/
495 typedef struct fault_additional_info {
496   char * name;
497   char * value;
498 } FAULT_ADDL_INFO;
499
500
501 /**************************************************************************//**
502  * optional field block for fields specific to heartbeat events
503  *****************************************************************************/
504 typedef struct event_heartbeat_fields
505 {
506   /***************************************************************************/
507   /* Header and version                                                      */
508   /***************************************************************************/
509   EVENT_HEADER header;
510   int major_version;
511   int minor_version;
512
513   /***************************************************************************/
514   /* Mandatory fields                                                        */
515   /***************************************************************************/
516   double heartbeat_version;
517   int    heartbeat_interval;
518
519   /***************************************************************************/
520   /* Optional fields                                                         */
521   /***************************************************************************/
522   DLIST additional_info;
523
524 } EVENT_HEARTBEAT_FIELD;
525
526 /**************************************************************************//**
527  * tuple which provides the name of a key along with its value and
528  * relative order
529  *****************************************************************************/
530 typedef struct internal_key
531 {
532   char                *keyname;
533   EVEL_OPTION_INT      keyorder;
534   EVEL_OPTION_STRING   keyvalue;
535 } EVEL_INTERNAL_KEY;
536
537 /**************************************************************************//**
538  * meta-information about an instance of a jsonObject along with
539  * the actual object instance
540  *****************************************************************************/
541 typedef struct json_object_instance
542 {
543
544   char *jsonstring;
545   unsigned long long objinst_epoch_microsec;
546   DLIST object_keys; /*EVEL_INTERNAL_KEY list */
547
548 } EVEL_JSON_OBJECT_INSTANCE;
549 #define MAX_JSON_TOKENS 128
550 /**************************************************************************//**
551  * Create a new json object instance.
552  *
553  * @note    The mandatory fields on the Other must be supplied to this factory
554  *          function and are immutable once set.  Optional fields have explicit
555  *          setter functions, but again values may only be set once so that the
556  *          Other has immutable properties.
557  * @param   yourjson       json string.
558  * @returns pointer to the newly manufactured ::EVEL_JSON_OBJECT_INSTANCE.
559  *          not used (i.e. posted) it must be released using ::evel_free_jsonobjectinstance.
560  * @retval  NULL  Failed to create the json object instance.
561  *****************************************************************************/
562 EVEL_JSON_OBJECT_INSTANCE * evel_new_jsonobjinstance(const char *const yourjson);
563 /**************************************************************************//**
564  * Free an json object instance.
565  *
566  * Free off the json object instance supplied.
567  *  Will free all the contained allocated memory.
568  *
569  *****************************************************************************/
570 void evel_free_jsonobjinst(EVEL_JSON_OBJECT_INSTANCE * objinst);
571
572 /**************************************************************************//**
573  * enrichment fields for internal VES Event Listener service use only,
574  * not supplied by event sources
575  *****************************************************************************/
576 typedef struct json_object
577 {
578
579   char *object_name;
580   EVEL_OPTION_STRING objectschema;
581   EVEL_OPTION_STRING objectschemaurl;
582   EVEL_OPTION_STRING nfsubscribedobjname;
583   EVEL_OPTION_STRING nfsubscriptionid;
584   DLIST jsonobjectinstances;  /* EVEL_JSON_OBJECT_INSTANCE list */
585
586 } EVEL_JSON_OBJECT;
587
588 /**************************************************************************//**
589  * Create a new json object.
590  *
591  * @note    The mandatory fields on the Other must be supplied to this factory
592  *          function and are immutable once set.  Optional fields have explicit
593  *          setter functions, but again values may only be set once so that the
594  *          Other has immutable properties.
595  * @param name       name of the object.
596  * @returns pointer to the newly manufactured ::EVEL_JSON_OBJECT.
597  *          not used (i.e. posted) it must be released using ::evel_free_jsonobject.
598  * @retval  NULL  Failed to create the json object.
599  *****************************************************************************/
600 EVEL_JSON_OBJECT * evel_new_jsonobject(const char *const name);
601 /**************************************************************************//**
602  * Free an json object.
603  *
604  * Free off the json object instance supplied.
605  *  Will free all the contained allocated memory.
606  *
607  *****************************************************************************/
608 void evel_free_jsonobject(EVEL_JSON_OBJECT * jsobj);
609 /*****************************************************************************/
610 /* Supported Measurement version.                                            */
611 /*****************************************************************************/
612 #define EVEL_MEASUREMENT_MAJOR_VERSION 2
613 #define EVEL_MEASUREMENT_MINOR_VERSION 1
614
615 /**************************************************************************//**
616  * Errors.
617  * JSON equivalent field: errors
618  *****************************************************************************/
619 typedef struct measurement_errors {
620   int receive_discards;
621   int receive_errors;
622   int transmit_discards;
623   int transmit_errors;
624 } MEASUREMENT_ERRORS;
625
626 /**************************************************************************//**
627  * Measurement.
628  * JSON equivalent field: measurementsForVfScalingFields
629  *****************************************************************************/
630 typedef struct event_measurement {
631   /***************************************************************************/
632   /* Header and version                                                      */
633   /***************************************************************************/
634   EVENT_HEADER header;
635   int major_version;
636   int minor_version;
637
638   /***************************************************************************/
639   /* Mandatory fields                                                        */
640   /***************************************************************************/
641   double measurement_interval;
642
643   /***************************************************************************/
644   /* Optional fields                                                         */
645   /***************************************************************************/
646   DLIST additional_info;
647   DLIST additional_measurements;
648   DLIST additional_objects;
649   DLIST codec_usage;
650   EVEL_OPTION_INT concurrent_sessions;
651   EVEL_OPTION_INT configured_entities;
652   DLIST cpu_usage;
653   DLIST disk_usage;
654   MEASUREMENT_ERRORS * errors;
655   DLIST feature_usage;
656   DLIST filesystem_usage;
657   DLIST latency_distribution;
658   EVEL_OPTION_DOUBLE mean_request_latency;
659   DLIST mem_usage;
660   EVEL_OPTION_INT media_ports_in_use;
661   EVEL_OPTION_INT request_rate;
662   EVEL_OPTION_INT vnfc_scaling_metric;
663   DLIST vnic_usage;
664
665 } EVENT_MEASUREMENT;
666
667 /**************************************************************************//**
668  * CPU Usage.
669  * JSON equivalent field: cpuUsage
670  *****************************************************************************/
671 typedef struct measurement_cpu_use {
672   char * id;
673   double usage;
674   EVEL_OPTION_DOUBLE idle;
675   EVEL_OPTION_DOUBLE intrpt;
676   EVEL_OPTION_DOUBLE nice;
677   EVEL_OPTION_DOUBLE softirq;
678   EVEL_OPTION_DOUBLE steal;
679   EVEL_OPTION_DOUBLE sys;
680   EVEL_OPTION_DOUBLE user;
681   EVEL_OPTION_DOUBLE wait;
682 } MEASUREMENT_CPU_USE;
683
684
685 /**************************************************************************//**
686  * Disk Usage.
687  * JSON equivalent field: diskUsage
688  *****************************************************************************/
689 typedef struct measurement_disk_use {
690   char * id;
691   EVEL_OPTION_DOUBLE iotimeavg;
692   EVEL_OPTION_DOUBLE iotimelast;
693   EVEL_OPTION_DOUBLE iotimemax;
694   EVEL_OPTION_DOUBLE iotimemin;
695   EVEL_OPTION_DOUBLE mergereadavg;
696   EVEL_OPTION_DOUBLE mergereadlast;
697   EVEL_OPTION_DOUBLE mergereadmax;
698   EVEL_OPTION_DOUBLE mergereadmin;
699   EVEL_OPTION_DOUBLE mergewriteavg;
700   EVEL_OPTION_DOUBLE mergewritelast;
701   EVEL_OPTION_DOUBLE mergewritemax;
702   EVEL_OPTION_DOUBLE mergewritemin;
703   EVEL_OPTION_DOUBLE octetsreadavg;
704   EVEL_OPTION_DOUBLE octetsreadlast;
705   EVEL_OPTION_DOUBLE octetsreadmax;
706   EVEL_OPTION_DOUBLE octetsreadmin;
707   EVEL_OPTION_DOUBLE octetswriteavg;
708   EVEL_OPTION_DOUBLE octetswritelast;
709   EVEL_OPTION_DOUBLE octetswritemax;
710   EVEL_OPTION_DOUBLE octetswritemin;
711   EVEL_OPTION_DOUBLE opsreadavg;
712   EVEL_OPTION_DOUBLE opsreadlast;
713   EVEL_OPTION_DOUBLE opsreadmax;
714   EVEL_OPTION_DOUBLE opsreadmin;
715   EVEL_OPTION_DOUBLE opswriteavg;
716   EVEL_OPTION_DOUBLE opswritelast;
717   EVEL_OPTION_DOUBLE opswritemax;
718   EVEL_OPTION_DOUBLE opswritemin;
719   EVEL_OPTION_DOUBLE pendingopsavg;
720   EVEL_OPTION_DOUBLE pendingopslast;
721   EVEL_OPTION_DOUBLE pendingopsmax;
722   EVEL_OPTION_DOUBLE pendingopsmin;
723   EVEL_OPTION_DOUBLE timereadavg;
724   EVEL_OPTION_DOUBLE timereadlast;
725   EVEL_OPTION_DOUBLE timereadmax;
726   EVEL_OPTION_DOUBLE timereadmin;
727   EVEL_OPTION_DOUBLE timewriteavg;
728   EVEL_OPTION_DOUBLE timewritelast;
729   EVEL_OPTION_DOUBLE timewritemax;
730   EVEL_OPTION_DOUBLE timewritemin;
731
732 } MEASUREMENT_DISK_USE;
733
734 /**************************************************************************//**
735  * Add an additional Disk usage value name/value pair to the Measurement.
736  *
737  * The name and value are null delimited ASCII strings.  The library takes
738  * a copy so the caller does not have to preserve values after the function
739  * returns.
740  *
741  * @param measurement   Pointer to the measurement.
742  * @param id            ASCIIZ string with the CPU's identifier.
743  * @param usage         Disk utilization.
744  *****************************************************************************/
745 MEASUREMENT_DISK_USE * evel_measurement_new_disk_use_add(EVENT_MEASUREMENT * measurement, char * id);
746
747 /**************************************************************************//**
748  * Filesystem Usage.
749  * JSON equivalent field: filesystemUsage
750  *****************************************************************************/
751 typedef struct measurement_fsys_use {
752   char * filesystem_name;
753   double block_configured;
754   int block_iops;
755   double block_used;
756   double ephemeral_configured;
757   int ephemeral_iops;
758   double ephemeral_used;
759 } MEASUREMENT_FSYS_USE;
760
761 /**************************************************************************//**
762  * Memory Usage.
763  * JSON equivalent field: memoryUsage
764  *****************************************************************************/
765 typedef struct measurement_mem_use {
766   char * id;
767   char * vmid;
768   double membuffsz;
769   EVEL_OPTION_DOUBLE memcache;
770   EVEL_OPTION_DOUBLE memconfig;
771   EVEL_OPTION_DOUBLE memfree;
772   EVEL_OPTION_DOUBLE slabrecl;
773   EVEL_OPTION_DOUBLE slabunrecl;
774   EVEL_OPTION_DOUBLE memused;
775 } MEASUREMENT_MEM_USE;
776
777 /**************************************************************************//**
778  * Add an additional Memory usage value name/value pair to the Measurement.
779  *
780  * The name and value are null delimited ASCII strings.  The library takes
781  * a copy so the caller does not have to preserve values after the function
782  * returns.
783  *
784  * @param measurement   Pointer to the measurement.
785  * @param id            ASCIIZ string with the Memory identifier.
786  * @param vmidentifier  ASCIIZ string with the VM's identifier.
787  * @param membuffsz     Memory Size.
788  *
789  * @return  Returns pointer to memory use structure in measurements
790  *****************************************************************************/
791 MEASUREMENT_MEM_USE * evel_measurement_new_mem_use_add(EVENT_MEASUREMENT * measurement,
792                                  char * id,  char *vmidentifier,  double membuffsz);
793
794 /**************************************************************************//**
795  * Set kilobytes of memory used for cache
796  *
797  * @note  The property is treated as immutable: it is only valid to call
798  *        the setter once.  However, we don't assert if the caller tries to
799  *        overwrite, just ignoring the update instead.
800  *
801  * @param mem_use      Pointer to the Memory Use.
802  * @param val          double
803  *****************************************************************************/
804 void evel_measurement_mem_use_memcache_set(MEASUREMENT_MEM_USE * const mem_use,
805                                     const double val);
806 /**************************************************************************//**
807  * Set kilobytes of memory configured in the virtual machine on which the VNFC reporting
808  *
809  * @note  The property is treated as immutable: it is only valid to call
810  *        the setter once.  However, we don't assert if the caller tries to
811  *        overwrite, just ignoring the update instead.
812  *
813  * @param mem_use      Pointer to the Memory Use.
814  * @param val          double
815  *****************************************************************************/
816 void evel_measurement_mem_use_memconfig_set(MEASUREMENT_MEM_USE * const mem_use,
817                                     const double val);
818 /**************************************************************************//**
819  * Set kilobytes of physical RAM left unused by the system
820  *
821  * @note  The property is treated as immutable: it is only valid to call
822  *        the setter once.  However, we don't assert if the caller tries to
823  *        overwrite, just ignoring the update instead.
824  *
825  * @param mem_use      Pointer to the Memory Use.
826  * @param val          double
827  *****************************************************************************/
828 void evel_measurement_mem_use_memfree_set(MEASUREMENT_MEM_USE * const mem_use,
829                                     const double val);
830 /**************************************************************************//**
831  * Set the part of the slab that can be reclaimed such as caches measured in kilobytes
832  *
833  * @note  The property is treated as immutable: it is only valid to call
834  *        the setter once.  However, we don't assert if the caller tries to
835  *        overwrite, just ignoring the update instead.
836  *
837  * @param mem_use      Pointer to the Memory Use.
838  * @param val          double
839  *****************************************************************************/
840 void evel_measurement_mem_use_slab_reclaimed_set(MEASUREMENT_MEM_USE * const mem_use,
841                                     const double val);
842 /**************************************************************************//**
843  * Set the part of the slab that cannot be reclaimed such as caches measured in kilobytes
844  *
845  * @note  The property is treated as immutable: it is only valid to call
846  *        the setter once.  However, we don't assert if the caller tries to
847  *        overwrite, just ignoring the update instead.
848  *
849  * @param mem_use      Pointer to the Memory Use.
850  * @param val          double
851  *****************************************************************************/
852 void evel_measurement_mem_use_slab_unreclaimable_set(MEASUREMENT_MEM_USE * const mem_use,
853                                     const double val);
854 /**************************************************************************//**
855  * Set the total memory minus the sum of free, buffered, cached and slab memory in kilobytes
856  *
857  * @note  The property is treated as immutable: it is only valid to call
858  *        the setter once.  However, we don't assert if the caller tries to
859  *        overwrite, just ignoring the update instead.
860  *
861  * @param mem_use      Pointer to the Memory Use.
862  * @param val          double
863  *****************************************************************************/
864 void evel_measurement_mem_use_usedup_set(MEASUREMENT_MEM_USE * const mem_use,
865                                     const double val);
866 /**************************************************************************//**
867  * Latency Bucket.
868  * JSON equivalent field: latencyBucketMeasure
869  *****************************************************************************/
870 typedef struct measurement_latency_bucket {
871   int count;
872
873   /***************************************************************************/
874   /* Optional fields                                                         */
875   /***************************************************************************/
876   EVEL_OPTION_DOUBLE high_end;
877   EVEL_OPTION_DOUBLE low_end;
878
879 } MEASUREMENT_LATENCY_BUCKET;
880
881 /**************************************************************************//**
882  * Virtual NIC usage.
883  * JSON equivalent field: vNicUsage
884  *****************************************************************************/
885 typedef struct measurement_vnic_performance {
886   /***************************************************************************/
887   /* Optional fields                                                         */
888   /***************************************************************************/
889   /*Cumulative count of broadcast packets received as read at the end of
890    the measurement interval*/
891   EVEL_OPTION_DOUBLE recvd_bcast_packets_acc;
892   /*Count of broadcast packets received within the measurement interval*/
893   EVEL_OPTION_DOUBLE recvd_bcast_packets_delta;
894   /*Cumulative count of discarded packets received as read at the end of
895    the measurement interval*/
896   EVEL_OPTION_DOUBLE recvd_discarded_packets_acc;
897   /*Count of discarded packets received within the measurement interval*/
898   EVEL_OPTION_DOUBLE recvd_discarded_packets_delta;
899   /*Cumulative count of error packets received as read at the end of
900    the measurement interval*/
901   EVEL_OPTION_DOUBLE recvd_error_packets_acc;
902   /*Count of error packets received within the measurement interval*/
903   EVEL_OPTION_DOUBLE recvd_error_packets_delta;
904   /*Cumulative count of multicast packets received as read at the end of
905    the measurement interval*/
906   EVEL_OPTION_DOUBLE recvd_mcast_packets_acc;
907   /*Count of mcast packets received within the measurement interval*/
908   EVEL_OPTION_DOUBLE recvd_mcast_packets_delta;
909   /*Cumulative count of octets received as read at the end of
910    the measurement interval*/
911   EVEL_OPTION_DOUBLE recvd_octets_acc;
912   /*Count of octets received within the measurement interval*/
913   EVEL_OPTION_DOUBLE recvd_octets_delta;
914   /*Cumulative count of all packets received as read at the end of
915    the measurement interval*/
916   EVEL_OPTION_DOUBLE recvd_total_packets_acc;
917   /*Count of all packets received within the measurement interval*/
918   EVEL_OPTION_DOUBLE recvd_total_packets_delta;
919   /*Cumulative count of unicast packets received as read at the end of
920    the measurement interval*/
921   EVEL_OPTION_DOUBLE recvd_ucast_packets_acc;
922   /*Count of unicast packets received within the measurement interval*/
923   EVEL_OPTION_DOUBLE recvd_ucast_packets_delta;
924   /*Cumulative count of transmitted broadcast packets at the end of
925    the measurement interval*/
926   EVEL_OPTION_DOUBLE tx_bcast_packets_acc;
927   /*Count of transmitted broadcast packets within the measurement interval*/
928   EVEL_OPTION_DOUBLE tx_bcast_packets_delta;
929   /*Cumulative count of transmit discarded packets at the end of
930    the measurement interval*/
931   EVEL_OPTION_DOUBLE tx_discarded_packets_acc;
932   /*Count of transmit discarded packets within the measurement interval*/
933   EVEL_OPTION_DOUBLE tx_discarded_packets_delta;
934   /*Cumulative count of transmit error packets at the end of
935    the measurement interval*/
936   EVEL_OPTION_DOUBLE tx_error_packets_acc;
937   /*Count of transmit error packets within the measurement interval*/
938   EVEL_OPTION_DOUBLE tx_error_packets_delta;
939   /*Cumulative count of transmit multicast packets at the end of
940    the measurement interval*/
941   EVEL_OPTION_DOUBLE tx_mcast_packets_acc;
942   /*Count of transmit multicast packets within the measurement interval*/
943   EVEL_OPTION_DOUBLE tx_mcast_packets_delta;
944   /*Cumulative count of transmit octets at the end of
945    the measurement interval*/
946   EVEL_OPTION_DOUBLE tx_octets_acc;
947   /*Count of transmit octets received within the measurement interval*/
948   EVEL_OPTION_DOUBLE tx_octets_delta;
949   /*Cumulative count of all transmit packets at the end of
950    the measurement interval*/
951   EVEL_OPTION_DOUBLE tx_total_packets_acc;
952   /*Count of transmit packets within the measurement interval*/
953   EVEL_OPTION_DOUBLE tx_total_packets_delta;
954   /*Cumulative count of all transmit unicast packets at the end of
955    the measurement interval*/
956   EVEL_OPTION_DOUBLE tx_ucast_packets_acc;
957   /*Count of transmit unicast packets within the measurement interval*/
958   EVEL_OPTION_DOUBLE tx_ucast_packets_delta;
959   /* Indicates whether vNicPerformance values are likely inaccurate
960            due to counter overflow or other condtions*/
961   char *valuesaresuspect;
962   char *vnic_id;
963
964 } MEASUREMENT_VNIC_PERFORMANCE;
965
966 /**************************************************************************//**
967  * Codec Usage.
968  * JSON equivalent field: codecsInUse
969  *****************************************************************************/
970 typedef struct measurement_codec_use {
971   char * codec_id;
972   int number_in_use;
973 } MEASUREMENT_CODEC_USE;
974
975 /**************************************************************************//**
976  * Feature Usage.
977  * JSON equivalent field: featuresInUse
978  *****************************************************************************/
979 typedef struct measurement_feature_use {
980   char * feature_id;
981   int feature_utilization;
982 } MEASUREMENT_FEATURE_USE;
983
984 /**************************************************************************//**
985  * Measurement Group.
986  * JSON equivalent field: additionalMeasurements
987  *****************************************************************************/
988 typedef struct measurement_group {
989   char * name;
990   DLIST measurements;
991 } MEASUREMENT_GROUP;
992
993 /**************************************************************************//**
994  * Custom Defined Measurement.
995  * JSON equivalent field: measurements
996  *****************************************************************************/
997 typedef struct custom_measurement {
998   char * name;
999   char * value;
1000 } CUSTOM_MEASUREMENT;
1001
1002 /*****************************************************************************/
1003 /* Supported Report version.                                                 */
1004 /*****************************************************************************/
1005 #define EVEL_REPORT_MAJOR_VERSION 1
1006 #define EVEL_REPORT_MINOR_VERSION 1
1007
1008 /**************************************************************************//**
1009  * Report.
1010  * JSON equivalent field: measurementsForVfReportingFields
1011  *
1012  * @note  This is an experimental event type and is not currently a formal part
1013  *        of AT&T's specification.
1014  *****************************************************************************/
1015 typedef struct event_report {
1016   /***************************************************************************/
1017   /* Header and version                                                      */
1018   /***************************************************************************/
1019   EVENT_HEADER header;
1020   int major_version;
1021   int minor_version;
1022
1023   /***************************************************************************/
1024   /* Mandatory fields                                                        */
1025   /***************************************************************************/
1026   double measurement_interval;
1027
1028   /***************************************************************************/
1029   /* Optional fields                                                         */
1030   /***************************************************************************/
1031   DLIST feature_usage;
1032   DLIST measurement_groups;
1033
1034 } EVENT_REPORT;
1035
1036 /**************************************************************************//**
1037  * Mobile GTP Per Flow Metrics.
1038  * JSON equivalent field: gtpPerFlowMetrics
1039  *****************************************************************************/
1040 typedef struct mobile_gtp_per_flow_metrics {
1041   double avg_bit_error_rate;
1042   double avg_packet_delay_variation;
1043   int avg_packet_latency;
1044   int avg_receive_throughput;
1045   int avg_transmit_throughput;
1046   int flow_activation_epoch;
1047   int flow_activation_microsec;
1048   int flow_deactivation_epoch;
1049   int flow_deactivation_microsec;
1050   time_t flow_deactivation_time;
1051   char * flow_status;
1052   int max_packet_delay_variation;
1053   int num_activation_failures;
1054   int num_bit_errors;
1055   int num_bytes_received;
1056   int num_bytes_transmitted;
1057   int num_dropped_packets;
1058   int num_l7_bytes_received;
1059   int num_l7_bytes_transmitted;
1060   int num_lost_packets;
1061   int num_out_of_order_packets;
1062   int num_packet_errors;
1063   int num_packets_received_excl_retrans;
1064   int num_packets_received_incl_retrans;
1065   int num_packets_transmitted_incl_retrans;
1066   int num_retries;
1067   int num_timeouts;
1068   int num_tunneled_l7_bytes_received;
1069   int round_trip_time;
1070   int time_to_first_byte;
1071
1072   /***************************************************************************/
1073   /* Optional fields                                                         */
1074   /***************************************************************************/
1075   EVEL_OPTION_INT ip_tos_counts[EVEL_TOS_SUPPORTED];
1076   EVEL_OPTION_INT tcp_flag_counts[EVEL_MAX_TCP_FLAGS];
1077   EVEL_OPTION_INT qci_cos_counts[EVEL_MAX_QCI_COS_TYPES];
1078   EVEL_OPTION_INT dur_connection_failed_status;
1079   EVEL_OPTION_INT dur_tunnel_failed_status;
1080   EVEL_OPTION_STRING flow_activated_by;
1081   EVEL_OPTION_TIME flow_activation_time;
1082   EVEL_OPTION_STRING flow_deactivated_by;
1083   EVEL_OPTION_STRING gtp_connection_status;
1084   EVEL_OPTION_STRING gtp_tunnel_status;
1085   EVEL_OPTION_INT large_packet_rtt;
1086   EVEL_OPTION_DOUBLE large_packet_threshold;
1087   EVEL_OPTION_INT max_receive_bit_rate;
1088   EVEL_OPTION_INT max_transmit_bit_rate;
1089   EVEL_OPTION_INT num_gtp_echo_failures;
1090   EVEL_OPTION_INT num_gtp_tunnel_errors;
1091   EVEL_OPTION_INT num_http_errors;
1092
1093 } MOBILE_GTP_PER_FLOW_METRICS;
1094
1095 /*****************************************************************************/
1096 /* Supported Mobile Flow version.                                            */
1097 /*****************************************************************************/
1098 #define EVEL_MOBILE_FLOW_MAJOR_VERSION 1
1099 #define EVEL_MOBILE_FLOW_MINOR_VERSION 2
1100
1101 /**************************************************************************//**
1102  * Mobile Flow.
1103  * JSON equivalent field: mobileFlow
1104  *****************************************************************************/
1105 typedef struct event_mobile_flow {
1106   /***************************************************************************/
1107   /* Header and version                                                      */
1108   /***************************************************************************/
1109   EVENT_HEADER header;
1110   int major_version;
1111   int minor_version;
1112
1113   /***************************************************************************/
1114   /* Mandatory fields                                                        */
1115   /***************************************************************************/
1116   char * flow_direction;
1117   MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics;
1118   char * ip_protocol_type;
1119   char * ip_version;
1120   char * other_endpoint_ip_address;
1121   int other_endpoint_port;
1122   char * reporting_endpoint_ip_addr;
1123   int reporting_endpoint_port;
1124   DLIST additional_info;                         /* JSON: additionalFields */
1125
1126   /***************************************************************************/
1127   /* Optional fields                                                         */
1128   /***************************************************************************/
1129   EVEL_OPTION_STRING application_type;
1130   EVEL_OPTION_STRING app_protocol_type;
1131   EVEL_OPTION_STRING app_protocol_version;
1132   EVEL_OPTION_STRING cid;
1133   EVEL_OPTION_STRING connection_type;
1134   EVEL_OPTION_STRING ecgi;
1135   EVEL_OPTION_STRING gtp_protocol_type;
1136   EVEL_OPTION_STRING gtp_version;
1137   EVEL_OPTION_STRING http_header;
1138   EVEL_OPTION_STRING imei;
1139   EVEL_OPTION_STRING imsi;
1140   EVEL_OPTION_STRING lac;
1141   EVEL_OPTION_STRING mcc;
1142   EVEL_OPTION_STRING mnc;
1143   EVEL_OPTION_STRING msisdn;
1144   EVEL_OPTION_STRING other_functional_role;
1145   EVEL_OPTION_STRING rac;
1146   EVEL_OPTION_STRING radio_access_technology;
1147   EVEL_OPTION_STRING sac;
1148   EVEL_OPTION_INT sampling_algorithm;
1149   EVEL_OPTION_STRING tac;
1150   EVEL_OPTION_STRING tunnel_id;
1151   EVEL_OPTION_STRING vlan_id;
1152
1153 } EVENT_MOBILE_FLOW;
1154
1155 /*****************************************************************************/
1156 /* Supported Other field version.                                            */
1157 /*****************************************************************************/
1158 #define EVEL_OTHER_EVENT_MAJOR_VERSION 1
1159 #define EVEL_OTHER_EVENT_MINOR_VERSION 1
1160
1161 /**************************************************************************//**
1162  * Other.
1163  * JSON equivalent field: otherFields
1164  *****************************************************************************/
1165 typedef struct event_other {
1166   EVENT_HEADER header;
1167   int major_version;
1168   int minor_version;
1169
1170   HASHTABLE_T *namedarrays; /* HASHTABLE_T */
1171   DLIST jsonobjects; /* DLIST of EVEL_JSON_OBJECT */
1172   DLIST namedvalues;
1173 } EVENT_OTHER;
1174
1175 /**************************************************************************//**
1176  * Other Field.
1177  * JSON equivalent field: otherFields
1178  *****************************************************************************/
1179 typedef struct other_field {
1180   char * name;
1181   char * value;
1182 } OTHER_FIELD;
1183
1184
1185 /*****************************************************************************/
1186 /* Supported Service Events version.                                         */
1187 /*****************************************************************************/
1188 #define EVEL_HEARTBEAT_FIELD_MAJOR_VERSION 1
1189 #define EVEL_HEARTBEAT_FIELD_MINOR_VERSION 1
1190
1191
1192 /*****************************************************************************/
1193 /* Supported Signaling version.                                              */
1194 /*****************************************************************************/
1195 #define EVEL_SIGNALING_MAJOR_VERSION 2
1196 #define EVEL_SIGNALING_MINOR_VERSION 1
1197
1198 /**************************************************************************//**
1199  * Vendor VNF Name fields.
1200  * JSON equivalent field: vendorVnfNameFields
1201  *****************************************************************************/
1202 typedef struct vendor_vnfname_field {
1203   char * vendorname;
1204   EVEL_OPTION_STRING vfmodule;
1205   EVEL_OPTION_STRING vnfname;
1206 } VENDOR_VNFNAME_FIELD;
1207
1208 /**************************************************************************//**
1209  * Signaling.
1210  * JSON equivalent field: signalingFields
1211  *****************************************************************************/
1212 typedef struct event_signaling {
1213   /***************************************************************************/
1214   /* Header and version                                                      */
1215   /***************************************************************************/
1216   EVENT_HEADER header;
1217   int major_version;
1218   int minor_version;
1219
1220   /***************************************************************************/
1221   /* Mandatory fields                                                        */
1222   /***************************************************************************/
1223   VENDOR_VNFNAME_FIELD vnfname_field;
1224   EVEL_OPTION_STRING correlator;                         /* JSON: correlator */
1225   EVEL_OPTION_STRING local_ip_address;               /* JSON: localIpAddress */
1226   EVEL_OPTION_STRING local_port;                          /* JSON: localPort */
1227   EVEL_OPTION_STRING remote_ip_address;             /* JSON: remoteIpAddress */
1228   EVEL_OPTION_STRING remote_port;                        /* JSON: remotePort */
1229
1230   /***************************************************************************/
1231   /* Optional fields                                                         */
1232   /***************************************************************************/
1233   EVEL_OPTION_STRING compressed_sip;                  /* JSON: compressedSip */
1234   EVEL_OPTION_STRING summary_sip;                        /* JSON: summarySip */
1235   DLIST additional_info;
1236
1237 } EVENT_SIGNALING;
1238
1239 /**************************************************************************//**
1240  * Sgnaling Additional Field.
1241  * JSON equivalent field: additionalFields
1242  *****************************************************************************/
1243 typedef struct signaling_additional_field {
1244   char * name;
1245   char * value;
1246 } SIGNALING_ADDL_FIELD;
1247
1248 /*****************************************************************************/
1249 /* Supported State Change version.                                           */
1250 /*****************************************************************************/
1251 #define EVEL_STATE_CHANGE_MAJOR_VERSION 1
1252 #define EVEL_STATE_CHANGE_MINOR_VERSION 2
1253
1254 /**************************************************************************//**
1255  * State Change.
1256  * JSON equivalent field: stateChangeFields
1257  *****************************************************************************/
1258 typedef struct event_state_change {
1259   /***************************************************************************/
1260   /* Header and version                                                      */
1261   /***************************************************************************/
1262   EVENT_HEADER header;
1263   int major_version;
1264   int minor_version;
1265
1266   /***************************************************************************/
1267   /* Mandatory fields                                                        */
1268   /***************************************************************************/
1269   EVEL_ENTITY_STATE new_state;
1270   EVEL_ENTITY_STATE old_state;
1271   char * state_interface;
1272   double version;
1273
1274   /***************************************************************************/
1275   /* Optional fields                                                         */
1276   /***************************************************************************/
1277   DLIST additional_fields;
1278
1279 } EVENT_STATE_CHANGE;
1280
1281 /**************************************************************************//**
1282  * State Change Additional Field.
1283  * JSON equivalent field: additionalFields
1284  *****************************************************************************/
1285 typedef struct state_change_additional_field {
1286   char * name;
1287   char * value;
1288 } STATE_CHANGE_ADDL_FIELD;
1289
1290 /*****************************************************************************/
1291 /* Supported Syslog version.                                                 */
1292 /*****************************************************************************/
1293 #define EVEL_SYSLOG_MAJOR_VERSION 1
1294 #define EVEL_SYSLOG_MINOR_VERSION 2
1295
1296 /**************************************************************************//**
1297  * Syslog.
1298  * JSON equivalent field: syslogFields
1299  *****************************************************************************/
1300 typedef struct event_syslog {
1301   /***************************************************************************/
1302   /* Header and version                                                      */
1303   /***************************************************************************/
1304   EVENT_HEADER header;
1305   int major_version;
1306   int minor_version;
1307
1308   /***************************************************************************/
1309   /* Mandatory fields                                                        */
1310   /***************************************************************************/
1311   EVEL_SOURCE_TYPES event_source_type;
1312   char * syslog_msg;
1313   char * syslog_tag;
1314
1315   /***************************************************************************/
1316   /* Optional fields                                                         */
1317   /***************************************************************************/
1318   EVEL_OPTION_STRING additional_filters;
1319   EVEL_OPTION_STRING event_source_host;
1320   EVEL_OPTION_INT syslog_facility;
1321   EVEL_OPTION_INT syslog_priority;
1322   EVEL_OPTION_STRING syslog_proc;
1323   EVEL_OPTION_INT syslog_proc_id;
1324   EVEL_OPTION_STRING syslog_s_data;
1325   EVEL_OPTION_STRING syslog_sdid;
1326   EVEL_OPTION_STRING syslog_severity;
1327   double syslog_fver;
1328   EVEL_OPTION_INT syslog_ver;
1329
1330 } EVENT_SYSLOG;
1331
1332 /**************************************************************************//**
1333  * Copyright.
1334  * JSON equivalent object: attCopyrightNotice
1335  *****************************************************************************/
1336 typedef struct copyright {
1337   char * useAndRedistribution;
1338   char * condition1;
1339   char * condition2;
1340   char * condition3;
1341   char * condition4;
1342   char * disclaimerLine1;
1343   char * disclaimerLine2;
1344   char * disclaimerLine3;
1345   char * disclaimerLine4;
1346 } COPYRIGHT;
1347
1348 /**************************************************************************//**
1349  * Library initialization.
1350  *
1351  * Initialize the EVEL library.
1352  *
1353  * @note  This function initializes the cURL library.  Applications making use
1354  *        of libcurl may need to pull the initialization out of here.  Note
1355  *        also that this function is not threadsafe as a result - refer to
1356  *        libcurl's API documentation for relevant warnings.
1357  *
1358  * @sa  Matching Term function.
1359  *
1360  * @param   fqdn    The API's FQDN or IP address.
1361  * @param   port    The API's port.
1362  * @param   path    The optional path (may be NULL).
1363  * @param   topic   The optional topic part of the URL (may be NULL).
1364  * @param   secure  Whether to use HTTPS (0=HTTP, 1=HTTPS).
1365  * @param   username  Username for Basic Authentication of requests.
1366  * @param   password  Password for Basic Authentication of requests.
1367  * @param   source_type The kind of node we represent.
1368  * @param   role    The role this node undertakes.
1369  * @param   verbosity  0 for normal operation, positive values for chattier
1370  *                     logs.
1371  *
1372  * @returns Status code
1373  * @retval  EVEL_SUCCESS      On success
1374  * @retval  ::EVEL_ERR_CODES  On failure.
1375  *****************************************************************************/
1376 EVEL_ERR_CODES evel_initialize(const char * const fqdn,
1377                                int port,
1378                                const char * const path,
1379                                const char * const topic,
1380                                int secure,
1381                                const char * const username,
1382                                const char * const password,
1383                                EVEL_SOURCE_TYPES source_type,
1384                                const char * const role,
1385                                int verbosity
1386                                );
1387
1388 /**************************************************************************//**
1389  * Clean up the EVEL library.
1390  *
1391  * @note that at present don't expect Init/Term cycling not to leak memory!
1392  *
1393  * @returns Status code
1394  * @retval  EVEL_SUCCESS On success
1395  * @retval  "One of ::EVEL_ERR_CODES" On failure.
1396  *****************************************************************************/
1397 EVEL_ERR_CODES evel_terminate(void);
1398
1399 EVEL_ERR_CODES evel_post_event(EVENT_HEADER * event);
1400 const char * evel_error_string(void);
1401
1402
1403 /**************************************************************************//**
1404  * Free an event.
1405  *
1406  * Free off the event supplied.  Will free all the contained allocated memory.
1407  *
1408  * @note  It is safe to free a NULL pointer.
1409  *****************************************************************************/
1410 void evel_free_event(void * event);
1411
1412 /**************************************************************************//**
1413  * Encode the event as a JSON event object according to AT&T's schema.
1414  *
1415  * @param json      Pointer to where to store the JSON encoded data.
1416  * @param max_size  Size of storage available in json_body.
1417  * @param event     Pointer to the ::EVENT_HEADER to encode.
1418  * @returns Number of bytes actually written.
1419  *****************************************************************************/
1420 int evel_json_encode_event(char * json,
1421                            int max_size,
1422                            EVENT_HEADER * event);
1423
1424 /**************************************************************************//**
1425  * Callback function to provide returned data.
1426  *
1427  * Copy data into the supplied buffer, write_callback::ptr, checking size
1428  * limits.
1429  *
1430  * @returns   Number of bytes placed into write_callback::ptr. 0 for EOF.
1431  *****************************************************************************/
1432 size_t evel_write_callback(void *contents,
1433                            size_t size,
1434                            size_t nmemb,
1435                            void *userp);
1436
1437 /*****************************************************************************/
1438 /*****************************************************************************/
1439 /*                                                                           */
1440 /*   HEARTBEAT - (includes common header, too)                               */
1441 /*                                                                           */
1442 /*****************************************************************************/
1443 /*****************************************************************************/
1444
1445 /**************************************************************************//**
1446  * Create a new heartbeat event.
1447  *
1448  * @note that the heartbeat is just a "naked" commonEventHeader!
1449  *
1450  * @returns pointer to the newly manufactured ::EVENT_HEADER.  If the event is
1451  *          not used it must be released using ::evel_free_event
1452  * @retval  NULL  Failed to create the event.
1453  *****************************************************************************/
1454 EVENT_HEADER * evel_new_heartbeat(void);
1455
1456 /**************************************************************************//**
1457  * Free an event header.
1458  *
1459  * Free off the event header supplied.  Will free all the contained allocated
1460  * memory.
1461  *
1462  * @note It does not free the header itself, since that may be part of a
1463  * larger structure.
1464  *****************************************************************************/
1465 void evel_free_header(EVENT_HEADER * const event);
1466
1467 /**************************************************************************//**
1468  * Initialize a newly created event header.
1469  *
1470  * @param header  Pointer to the header being initialized.
1471  *****************************************************************************/
1472 void evel_init_header(EVENT_HEADER * const header,const char *const eventname);
1473
1474 /**************************************************************************//**
1475  * Set the Event Type property of the event header.
1476  *
1477  * @param header        Pointer to the ::EVENT_HEADER.
1478  * @param type          The Event Type to be set. ASCIIZ string. The caller
1479  *                      does not need to preserve the value once the function
1480  *                      returns.
1481  *****************************************************************************/
1482 void evel_header_type_set(EVENT_HEADER * const header,
1483                           const char * const type);
1484
1485 /**************************************************************************//**
1486  * Set the Start Epoch property of the event header.
1487  *
1488  * @note The Start Epoch defaults to the time of event creation.
1489  *
1490  * @param header        Pointer to the ::EVENT_HEADER.
1491  * @param start_epoch_microsec
1492  *                      The start epoch to set, in microseconds.
1493  *****************************************************************************/
1494 void evel_start_epoch_set(EVENT_HEADER * const header,
1495                           const unsigned long long start_epoch_microsec);
1496
1497 /**************************************************************************//**
1498  * Set the Last Epoch property of the event header.
1499  *
1500  * @note The Last Epoch defaults to the time of event creation.
1501  *
1502  * @param header        Pointer to the ::EVENT_HEADER.
1503  * @param last_epoch_microsec
1504  *                      The last epoch to set, in microseconds.
1505  *****************************************************************************/
1506 void evel_last_epoch_set(EVENT_HEADER * const header,
1507                          const unsigned long long last_epoch_microsec);
1508
1509 /**************************************************************************//**
1510  * Set the Reporting Entity Name property of the event header.
1511  *
1512  * @note The Reporting Entity Name defaults to the OpenStack VM Name.
1513  *
1514  * @param header        Pointer to the ::EVENT_HEADER.
1515  * @param entity_name   The entity name to set.
1516  *****************************************************************************/
1517 void evel_reporting_entity_name_set(EVENT_HEADER * const header,
1518                                     const char * const entity_name);
1519
1520 /**************************************************************************//**
1521  * Set the Reporting Entity Id property of the event header.
1522  *
1523  * @note The Reporting Entity Id defaults to the OpenStack VM UUID.
1524  *
1525  * @param header        Pointer to the ::EVENT_HEADER.
1526  * @param entity_id     The entity id to set.
1527  *****************************************************************************/
1528 void evel_reporting_entity_id_set(EVENT_HEADER * const header,
1529                                   const char * const entity_id);
1530
1531 /*****************************************************************************/
1532 /*****************************************************************************/
1533 /*                                                                           */
1534 /*   FAULT                                                                   */
1535 /*                                                                           */
1536 /*****************************************************************************/
1537 /*****************************************************************************/
1538
1539 /**************************************************************************//**
1540  * Create a new fault event.
1541  *
1542  * @note    The mandatory fields on the Fault must be supplied to this factory
1543  *          function and are immutable once set.  Optional fields have explicit
1544  *          setter functions, but again values may only be set once so that the
1545  *          Fault has immutable properties.
1546  * @param   condition   The condition indicated by the Fault.
1547  * @param   specific_problem  The specific problem triggering the fault.
1548  * @param   priority    The priority of the event.
1549  * @param   severity    The severity of the Fault.
1550  * @param   ev_source_type    Source of Alarm event
1551  * @param   version     fault version
1552  * @param   status      status of Virtual Function
1553  * @returns pointer to the newly manufactured ::EVENT_FAULT.  If the event is
1554  *          not used (i.e. posted) it must be released using ::evel_free_fault.
1555  * @retval  NULL  Failed to create the event.
1556  *****************************************************************************/
1557 EVENT_FAULT * evel_new_fault(const char * const condition,
1558                              const char * const specific_problem,
1559                              EVEL_EVENT_PRIORITIES priority,
1560                              EVEL_SEVERITIES severity,
1561                              EVEL_SOURCE_TYPES ev_source_type,
1562                              EVEL_VF_STATUSES status);
1563
1564 /**************************************************************************//**
1565  * Free a Fault.
1566  *
1567  * Free off the Fault supplied.  Will free all the contained allocated memory.
1568  *
1569  * @note It does not free the Fault itself, since that may be part of a
1570  * larger structure.
1571  *****************************************************************************/
1572 void evel_free_fault(EVENT_FAULT * event);
1573
1574 /**************************************************************************//**
1575  * Set the Fault Category property of the Fault.
1576  *
1577  * @note  The property is treated as immutable: it is only valid to call
1578  *        the setter once.  However, we don't assert if the caller tries to
1579  *        overwrite, just ignoring the update instead.
1580  *
1581  * @param fault      Pointer to the fault.
1582  * @param category   Category : license, link, routing, security, signaling.
1583  *                       ASCIIZ string. The caller
1584  *                   does not need to preserve the value once the function
1585  *                   returns.
1586  *****************************************************************************/
1587 void evel_fault_category_set(EVENT_FAULT * fault,
1588                               const char * const category);
1589
1590 /**************************************************************************//**
1591  * Set the Alarm Interface A property of the Fault.
1592  *
1593  * @note  The property is treated as immutable: it is only valid to call
1594  *        the setter once.  However, we don't assert if the caller tries to
1595  *        overwrite, just ignoring the update instead.
1596  *
1597  * @param fault      Pointer to the fault.
1598  * @param interface  The Alarm Interface A to be set. ASCIIZ string. The caller
1599  *                   does not need to preserve the value once the function
1600  *                   returns.
1601  *****************************************************************************/
1602 void evel_fault_interface_set(EVENT_FAULT * fault,
1603                               const char * const interface);
1604
1605 /**************************************************************************//**
1606  * Add an additional value name/value pair to the Fault.
1607  *
1608  * The name and value are null delimited ASCII strings.  The library takes
1609  * a copy so the caller does not have to preserve values after the function
1610  * returns.
1611  *
1612  * @param fault     Pointer to the fault.
1613  * @param name      ASCIIZ string with the attribute's name.
1614  * @param value     ASCIIZ string with the attribute's value.
1615  *****************************************************************************/
1616 void evel_fault_addl_info_add(EVENT_FAULT * fault, char * name, char * value);
1617
1618 /**************************************************************************//**
1619  * Set the Event Type property of the Fault.
1620  *
1621  * @note  The property is treated as immutable: it is only valid to call
1622  *        the setter once.  However, we don't assert if the caller tries to
1623  *        overwrite, just ignoring the update instead.
1624  *
1625  * @param fault      Pointer to the fault.
1626  * @param type       The Event Type to be set. ASCIIZ string. The caller
1627  *                   does not need to preserve the value once the function
1628  *                   returns.
1629  *****************************************************************************/
1630 void evel_fault_type_set(EVENT_FAULT * fault, const char * const type);
1631
1632 /*****************************************************************************/
1633 /*****************************************************************************/
1634 /*                                                                           */
1635 /*   MEASUREMENT                                                             */
1636 /*                                                                           */
1637 /*****************************************************************************/
1638 /*****************************************************************************/
1639
1640 /**************************************************************************//**
1641  * Create a new Measurement event.
1642  *
1643  * @note    The mandatory fields on the Measurement must be supplied to this
1644  *          factory function and are immutable once set.  Optional fields have
1645  *          explicit setter functions, but again values may only be set once so
1646  *          that the Measurement has immutable properties.
1647  *
1648  * @param   measurement_interval
1649  *
1650  * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT.  If the
1651  *          event is not used (i.e. posted) it must be released using
1652  *          ::evel_free_event.
1653  * @retval  NULL  Failed to create the event.
1654  *****************************************************************************/
1655 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval);
1656
1657 /**************************************************************************//**
1658  * Free a Measurement.
1659  *
1660  * Free off the Measurement supplied.  Will free all the contained allocated
1661  * memory.
1662  *
1663  * @note It does not free the Measurement itself, since that may be part of a
1664  * larger structure.
1665  *****************************************************************************/
1666 void evel_free_measurement(EVENT_MEASUREMENT * event);
1667
1668 /**************************************************************************//**
1669  * Set the Event Type property of the Measurement.
1670  *
1671  * @note  The property is treated as immutable: it is only valid to call
1672  *        the setter once.  However, we don't assert if the caller tries to
1673  *        overwrite, just ignoring the update instead.
1674  *
1675  * @param measurement Pointer to the Measurement.
1676  * @param type        The Event Type to be set. ASCIIZ string. The caller
1677  *                    does not need to preserve the value once the function
1678  *                    returns.
1679  *****************************************************************************/
1680 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
1681                                const char * const type);
1682
1683 /**************************************************************************//**
1684  * Set the Concurrent Sessions property of the Measurement.
1685  *
1686  * @note  The property is treated as immutable: it is only valid to call
1687  *        the setter once.  However, we don't assert if the caller tries to
1688  *        overwrite, just ignoring the update instead.
1689  *
1690  * @param measurement         Pointer to the Measurement.
1691  * @param concurrent_sessions The Concurrent Sessions to be set.
1692  *****************************************************************************/
1693 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
1694                                     int concurrent_sessions);
1695
1696 /**************************************************************************//**
1697  * Set the Configured Entities property of the Measurement.
1698  *
1699  * @note  The property is treated as immutable: it is only valid to call
1700  *        the setter once.  However, we don't assert if the caller tries to
1701  *        overwrite, just ignoring the update instead.
1702  *
1703  * @param measurement         Pointer to the Measurement.
1704  * @param configured_entities The Configured Entities to be set.
1705  *****************************************************************************/
1706 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
1707                                    int configured_entities);
1708
1709 /**************************************************************************//**
1710  * Add an additional set of Errors to the Measurement.
1711  *
1712  * @note  The property is treated as immutable: it is only valid to call
1713  *        the setter once.  However, we don't assert if the caller tries to
1714  *        overwrite, just ignoring the update instead.
1715  *
1716  * @param measurement       Pointer to the measurement.
1717  * @param receive_discards  The number of receive discards.
1718  * @param receive_errors    The number of receive errors.
1719  * @param transmit_discards The number of transmit discards.
1720  * @param transmit_errors   The number of transmit errors.
1721  *****************************************************************************/
1722 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
1723                                  int receive_discards,
1724                                  int receive_errors,
1725                                  int transmit_discards,
1726                                  int transmit_errors);
1727
1728 /**************************************************************************//**
1729  * Set the Mean Request Latency property of the Measurement.
1730  *
1731  * @note  The property is treated as immutable: it is only valid to call
1732  *        the setter once.  However, we don't assert if the caller tries to
1733  *        overwrite, just ignoring the update instead.
1734  *
1735  * @param measurement          Pointer to the Measurement.
1736  * @param mean_request_latency The Mean Request Latency to be set.
1737  *****************************************************************************/
1738 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
1739                                        double mean_request_latency);
1740
1741 /**************************************************************************//**
1742  * Set the Request Rate property of the Measurement.
1743  *
1744  * @note  The property is treated as immutable: it is only valid to call
1745  *        the setter once.  However, we don't assert if the caller tries to
1746  *        overwrite, just ignoring the update instead.
1747  *
1748  * @param measurement  Pointer to the Measurement.
1749  * @param request_rate The Request Rate to be set.
1750  *****************************************************************************/
1751 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
1752                                        int request_rate);
1753
1754 /**************************************************************************//**
1755  * Add an additional CPU usage value name/value pair to the Measurement.
1756  *
1757  * The name and value are null delimited ASCII strings.  The library takes
1758  * a copy so the caller does not have to preserve values after the function
1759  * returns.
1760  *
1761  * @param measurement   Pointer to the measurement.
1762  * @param id            ASCIIZ string with the CPU's identifier.
1763  * @param usage         CPU utilization.
1764  *****************************************************************************/
1765 MEASUREMENT_CPU_USE * evel_measurement_new_cpu_use_add(EVENT_MEASUREMENT * measurement, char * id, double usage);
1766
1767 /**************************************************************************//**
1768  * Set the CPU Idle value in measurement interval
1769  *   percentage of CPU time spent in the idle task
1770  *
1771  * @note  The property is treated as immutable: it is only valid to call
1772  *        the setter once.  However, we don't assert if the caller tries to
1773  *        overwrite, just ignoring the update instead.
1774  *
1775  * @param cpu_use      Pointer to the CPU Use.
1776  * @param val          double
1777  *****************************************************************************/
1778 void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE *const cpu_use,
1779                                     const double val);
1780
1781 /**************************************************************************//**
1782  * Set the percentage of time spent servicing interrupts
1783  *
1784  * @note  The property is treated as immutable: it is only valid to call
1785  *        the setter once.  However, we don't assert if the caller tries to
1786  *        overwrite, just ignoring the update instead.
1787  *
1788  * @param cpu_use      Pointer to the CPU Use.
1789  * @param val          double
1790  *****************************************************************************/
1791 void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE * const cpu_use,
1792                                     const double val);
1793
1794 /**************************************************************************//**
1795  * Set the percentage of time spent running user space processes that have been niced
1796  *
1797  * @note  The property is treated as immutable: it is only valid to call
1798  *        the setter once.  However, we don't assert if the caller tries to
1799  *        overwrite, just ignoring the update instead.
1800  *
1801  * @param cpu_use      Pointer to the CPU Use.
1802  * @param val          double
1803  *****************************************************************************/
1804 void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE * const cpu_use,
1805                                     const double val);
1806
1807 /**************************************************************************//**
1808  * Set the percentage of time spent handling soft irq interrupts
1809  *
1810  * @note  The property is treated as immutable: it is only valid to call
1811  *        the setter once.  However, we don't assert if the caller tries to
1812  *        overwrite, just ignoring the update instead.
1813  *
1814  * @param cpu_use      Pointer to the CPU Use.
1815  * @param val          double
1816  *****************************************************************************/
1817 void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE * const cpu_use,
1818                                     const double val);
1819 /**************************************************************************//**
1820  * Set the percentage of time spent in involuntary wait
1821  *
1822  * @note  The property is treated as immutable: it is only valid to call
1823  *        the setter once.  However, we don't assert if the caller tries to
1824  *        overwrite, just ignoring the update instead.
1825  *
1826  * @param cpu_use      Pointer to the CPU Use.
1827  * @param val          double
1828  *****************************************************************************/
1829 void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE * const cpu_use,
1830                                     const double val);
1831 /**************************************************************************//**
1832  * Set the percentage of time spent on system tasks running the kernel
1833  *
1834  * @note  The property is treated as immutable: it is only valid to call
1835  *        the setter once.  However, we don't assert if the caller tries to
1836  *        overwrite, just ignoring the update instead.
1837  *
1838  * @param cpu_use      Pointer to the CPU Use.
1839  * @param val          double
1840  *****************************************************************************/
1841 void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE * const cpu_use,
1842                                     const double val);
1843 /**************************************************************************//**
1844  * Set the percentage of time spent running un-niced user space processes
1845  *
1846  * @note  The property is treated as immutable: it is only valid to call
1847  *        the setter once.  However, we don't assert if the caller tries to
1848  *        overwrite, just ignoring the update instead.
1849  *
1850  * @param cpu_use      Pointer to the CPU Use.
1851  * @param val          double
1852  *****************************************************************************/
1853 void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE * const cpu_use,
1854                                     const double val);
1855 /**************************************************************************//**
1856  * Set the percentage of CPU time spent waiting for I/O operations to complete
1857  *
1858  * @note  The property is treated as immutable: it is only valid to call
1859  *        the setter once.  However, we don't assert if the caller tries to
1860  *        overwrite, just ignoring the update instead.
1861  *
1862  * @param cpu_use      Pointer to the CPU Use.
1863  * @param val          double
1864  *****************************************************************************/
1865 void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE * const cpu_use,
1866                                     const double val);
1867
1868 /**************************************************************************//**
1869  * Add an additional File System usage value name/value pair to the
1870  * Measurement.
1871  *
1872  * The filesystem_name is null delimited ASCII string.  The library takes a
1873  * copy so the caller does not have to preserve values after the function
1874  * returns.
1875  *
1876  * @param measurement     Pointer to the measurement.
1877  * @param filesystem_name   ASCIIZ string with the file-system's UUID.
1878  * @param block_configured  Block storage configured.
1879  * @param block_used        Block storage in use.
1880  * @param block_iops        Block storage IOPS.
1881  * @param ephemeral_configured  Ephemeral storage configured.
1882  * @param ephemeral_used        Ephemeral storage in use.
1883  * @param ephemeral_iops        Ephemeral storage IOPS.
1884  *****************************************************************************/
1885 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
1886                                    char * filesystem_name,
1887                                    double block_configured,
1888                                    double block_used,
1889                                    int block_iops,
1890                                    double ephemeral_configured,
1891                                    double ephemeral_used,
1892                                    int ephemeral_iops);
1893
1894 /**************************************************************************//**
1895  * Add a Feature usage value name/value pair to the Measurement.
1896  *
1897  * The name is null delimited ASCII string.  The library takes
1898  * a copy so the caller does not have to preserve values after the function
1899  * returns.
1900  *
1901  * @param measurement     Pointer to the measurement.
1902  * @param feature         ASCIIZ string with the feature's name.
1903  * @param utilization     Utilization of the feature.
1904  *****************************************************************************/
1905 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
1906                                       char * feature,
1907                                       int utilization);
1908
1909 /**************************************************************************//**
1910  * Add a Additional Measurement value name/value pair to the Measurement.
1911  *
1912  * The name is null delimited ASCII string.  The library takes
1913  * a copy so the caller does not have to preserve values after the function
1914  * returns.
1915  *
1916  * @param measurement   Pointer to the Measurement.
1917  * @param group    ASCIIZ string with the measurement group's name.
1918  * @param name     ASCIIZ string containing the measurement's name.
1919  * @param name     ASCIIZ string containing the measurement's value.
1920  *****************************************************************************/
1921 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
1922                                              const char * const group,
1923                                              const char * const name,
1924                                              const char * const value);
1925
1926 /**************************************************************************//**
1927  * Add a Codec usage value name/value pair to the Measurement.
1928  *
1929  * The name is null delimited ASCII string.  The library takes
1930  * a copy so the caller does not have to preserve values after the function
1931  * returns.
1932  *
1933  * @param measurement     Pointer to the measurement.
1934  * @param codec           ASCIIZ string with the codec's name.
1935  * @param utilization     Utilization of the feature.
1936  *****************************************************************************/
1937 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
1938                                     char * codec,
1939                                     int utilization);
1940
1941 /**************************************************************************//**
1942  * Set the Media Ports in Use property of the Measurement.
1943  *
1944  * @note  The property is treated as immutable: it is only valid to call
1945  *        the setter once.  However, we don't assert if the caller tries to
1946  *        overwrite, just ignoring the update instead.
1947  *
1948  * @param measurement         Pointer to the measurement.
1949  * @param media_ports_in_use  The media port usage to set.
1950  *****************************************************************************/
1951 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
1952                                          int media_ports_in_use);
1953
1954 /**************************************************************************//**
1955  * Set the VNFC Scaling Metric property of the Measurement.
1956  *
1957  * @note  The property is treated as immutable: it is only valid to call
1958  *        the setter once.  However, we don't assert if the caller tries to
1959  *        overwrite, just ignoring the update instead.
1960  *
1961  * @param measurement     Pointer to the measurement.
1962  * @param scaling_metric  The scaling metric to set.
1963  *****************************************************************************/
1964 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
1965                                               int scaling_metric);
1966
1967 /**************************************************************************//**
1968  * Create a new Latency Bucket to be added to a Measurement event.
1969  *
1970  * @note    The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
1971  *          supplied to this factory function and are immutable once set.
1972  *          Optional fields have explicit setter functions, but again values
1973  *          may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
1974  *          immutable properties.
1975  *
1976  * @param count         Count of events in this bucket.
1977  *
1978  * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
1979  * @retval  NULL  Failed to create the Latency Bucket.
1980  *****************************************************************************/
1981 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count);
1982
1983 /**************************************************************************//**
1984  * Set the High End property of the Measurement Latency Bucket.
1985  *
1986  * @note  The property is treated as immutable: it is only valid to call
1987  *        the setter once.  However, we don't assert if the caller tries to
1988  *        overwrite, just ignoring the update instead.
1989  *
1990  * @param bucket        Pointer to the Measurement Latency Bucket.
1991  * @param high_end      High end of the bucket's range.
1992  *****************************************************************************/
1993 void evel_meas_latency_bucket_high_end_set(
1994                                      MEASUREMENT_LATENCY_BUCKET * const bucket,
1995                                      const double high_end);
1996
1997 /**************************************************************************//**
1998  * Set the Low End property of the Measurement Latency Bucket.
1999  *
2000  * @note  The property is treated as immutable: it is only valid to call
2001  *        the setter once.  However, we don't assert if the caller tries to
2002  *        overwrite, just ignoring the update instead.
2003  *
2004  * @param bucket        Pointer to the Measurement Latency Bucket.
2005  * @param low_end       Low end of the bucket's range.
2006  *****************************************************************************/
2007 void evel_meas_latency_bucket_low_end_set(
2008                                      MEASUREMENT_LATENCY_BUCKET * const bucket,
2009                                      const double low_end);
2010
2011 /**************************************************************************//**
2012  * Add an additional Measurement Latency Bucket to the specified event.
2013  *
2014  * @param measurement   Pointer to the Measurement event.
2015  * @param bucket        Pointer to the Measurement Latency Bucket to add.
2016  *****************************************************************************/
2017 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
2018                                   MEASUREMENT_LATENCY_BUCKET * const bucket);
2019
2020 /**************************************************************************//**
2021  * Add an additional Latency Distribution bucket to the Measurement.
2022  *
2023  * This function implements the previous API, purely for convenience.
2024  *
2025  * @param measurement   Pointer to the measurement.
2026  * @param low_end       Low end of the bucket's range.
2027  * @param high_end      High end of the bucket's range.
2028  * @param count         Count of events in this bucket.
2029  *****************************************************************************/
2030 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
2031                                   const double low_end,
2032                                   const double high_end,
2033                                   const int count);
2034
2035 /**************************************************************************//**
2036  * Create a new vNIC Use to be added to a Measurement event.
2037  *
2038  * @note    The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
2039  *          to this factory function and are immutable once set. Optional
2040  *          fields have explicit setter functions, but again values may only be
2041  *          set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
2042  *          properties.
2043  *
2044  * @param vnic_id               ASCIIZ string with the vNIC's ID.
2045  * @param val_suspect           True or false confidence in data.
2046  *
2047  * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
2048  *          If the structure is not used it must be released using
2049  *          ::evel_measurement_free_vnic_performance.
2050  * @retval  NULL  Failed to create the vNIC Use.
2051  *****************************************************************************/
2052 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id, char * const val_suspect);
2053
2054 /**************************************************************************//**
2055  * Free a vNIC Use.
2056  *
2057  * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied.  Will free all the contained
2058  * allocated memory.
2059  *
2060  * @note It does not free the vNIC Use itself, since that may be part of a
2061  * larger structure.
2062  *****************************************************************************/
2063 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2064
2065 /**************************************************************************//**
2066  * Set the Accumulated Broadcast Packets Received in measurement interval
2067  * property of the vNIC performance.
2068  *
2069  * @note  The property is treated as immutable: it is only valid to call
2070  *        the setter once.  However, we don't assert if the caller tries to
2071  *        overwrite, just ignoring the update instead.
2072  *
2073  * @param vnic_performance      Pointer to the vNIC Use.
2074  * @param recvd_bcast_packets_acc
2075  *****************************************************************************/
2076 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2077                                     const double recvd_bcast_packets_acc);
2078 /**************************************************************************//**
2079  * Set the Delta Broadcast Packets Received in measurement interval
2080  * property of the vNIC performance.
2081  *
2082  * @note  The property is treated as immutable: it is only valid to call
2083  *        the setter once.  However, we don't assert if the caller tries to
2084  *        overwrite, just ignoring the update instead.
2085  *
2086  * @param vnic_performance      Pointer to the vNIC Use.
2087  * @param recvd_bcast_packets_delta
2088  *****************************************************************************/
2089 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2090                                     const double recvd_bcast_packets_delta);
2091 /**************************************************************************//**
2092  * Set the Discarded Packets Received in measurement interval
2093  * property of the vNIC performance.
2094  *
2095  * @note  The property is treated as immutable: it is only valid to call
2096  *        the setter once.  However, we don't assert if the caller tries to
2097  *        overwrite, just ignoring the update instead.
2098  *
2099  * @param vnic_performance      Pointer to the vNIC Use.
2100  * @param recvd_discard_packets_acc
2101  *****************************************************************************/
2102 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2103                                     const double recvd_discard_packets_acc);
2104 /**************************************************************************//**
2105  * Set the Delta Discarded Packets Received in measurement interval
2106  * property of the vNIC performance.
2107  *
2108  * @note  The property is treated as immutable: it is only valid to call
2109  *        the setter once.  However, we don't assert if the caller tries to
2110  *        overwrite, just ignoring the update instead.
2111  *
2112  * @param vnic_performance      Pointer to the vNIC Use.
2113  * @param recvd_discard_packets_delta
2114  *****************************************************************************/
2115 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2116                                     const double recvd_discard_packets_delta);
2117 /**************************************************************************//**
2118  * Set the Error Packets Received in measurement interval
2119  * property of the vNIC performance.
2120  *
2121  * @note  The property is treated as immutable: it is only valid to call
2122  *        the setter once.  However, we don't assert if the caller tries to
2123  *        overwrite, just ignoring the update instead.
2124  *
2125  * @param vnic_performance      Pointer to the vNIC Use.
2126  * @param recvd_error_packets_acc
2127  *****************************************************************************/
2128 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2129                                     const double recvd_error_packets_acc);
2130 /**************************************************************************//**
2131  * Set the Delta Error Packets Received in measurement interval
2132  * property of the vNIC performance.
2133  *
2134  * @note  The property is treated as immutable: it is only valid to call
2135  *        the setter once.  However, we don't assert if the caller tries to
2136  *        overwrite, just ignoring the update instead.
2137  *
2138  * @param vnic_performance      Pointer to the vNIC Use.
2139  * @param recvd_error_packets_delta
2140  *****************************************************************************/
2141 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2142                                     const double recvd_error_packets_delta);
2143 /**************************************************************************//**
2144  * Set the Accumulated Multicast Packets Received in measurement interval
2145  * property of the vNIC performance.
2146  *
2147  * @note  The property is treated as immutable: it is only valid to call
2148  *        the setter once.  However, we don't assert if the caller tries to
2149  *        overwrite, just ignoring the update instead.
2150  *
2151  * @param vnic_performance      Pointer to the vNIC Use.
2152  * @param recvd_mcast_packets_acc
2153  *****************************************************************************/
2154 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2155                                     const double recvd_mcast_packets_acc);
2156 /**************************************************************************//**
2157  * Set the Delta Multicast Packets Received in measurement interval
2158  * property of the vNIC performance.
2159  *
2160  * @note  The property is treated as immutable: it is only valid to call
2161  *        the setter once.  However, we don't assert if the caller tries to
2162  *        overwrite, just ignoring the update instead.
2163  *
2164  * @param vnic_performance      Pointer to the vNIC Use.
2165  * @param recvd_mcast_packets_delta
2166  *****************************************************************************/
2167 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2168                                     const double recvd_mcast_packets_delta);
2169 /**************************************************************************//**
2170  * Set the Accumulated Octets Received in measurement interval
2171  * property of the vNIC performance.
2172  *
2173  * @note  The property is treated as immutable: it is only valid to call
2174  *        the setter once.  However, we don't assert if the caller tries to
2175  *        overwrite, just ignoring the update instead.
2176  *
2177  * @param vnic_performance      Pointer to the vNIC Use.
2178  * @param recvd_octets_acc
2179  *****************************************************************************/
2180 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2181                                     const double recvd_octets_acc);
2182 /**************************************************************************//**
2183  * Set the Delta Octets Received in measurement interval
2184  * property of the vNIC performance.
2185  *
2186  * @note  The property is treated as immutable: it is only valid to call
2187  *        the setter once.  However, we don't assert if the caller tries to
2188  *        overwrite, just ignoring the update instead.
2189  *
2190  * @param vnic_performance      Pointer to the vNIC Use.
2191  * @param recvd_octets_delta
2192  *****************************************************************************/
2193 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2194                                     const double recvd_octets_delta);
2195 /**************************************************************************//**
2196  * Set the Accumulated Total Packets Received in measurement interval
2197  * property of the vNIC performance.
2198  *
2199  * @note  The property is treated as immutable: it is only valid to call
2200  *        the setter once.  However, we don't assert if the caller tries to
2201  *        overwrite, just ignoring the update instead.
2202  *
2203  * @param vnic_performance      Pointer to the vNIC Use.
2204  * @param recvd_total_packets_acc
2205  *****************************************************************************/
2206 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2207                                     const double recvd_total_packets_acc);
2208 /**************************************************************************//**
2209  * Set the Delta Total Packets Received in measurement interval
2210  * property of the vNIC performance.
2211  *
2212  * @note  The property is treated as immutable: it is only valid to call
2213  *        the setter once.  However, we don't assert if the caller tries to
2214  *        overwrite, just ignoring the update instead.
2215  *
2216  * @param vnic_performance      Pointer to the vNIC Use.
2217  * @param recvd_total_packets_delta
2218  *****************************************************************************/
2219 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2220                                     const double recvd_total_packets_delta);
2221 /**************************************************************************//**
2222  * Set the Accumulated Unicast Packets Received in measurement interval
2223  * property of the vNIC performance.
2224  *
2225  * @note  The property is treated as immutable: it is only valid to call
2226  *        the setter once.  However, we don't assert if the caller tries to
2227  *        overwrite, just ignoring the update instead.
2228  *
2229  * @param vnic_performance      Pointer to the vNIC Use.
2230  * @param recvd_ucast_packets_acc
2231  *****************************************************************************/
2232 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2233                                     const double recvd_ucast_packets_acc);
2234 /**************************************************************************//**
2235  * Set the Delta Unicast packets Received in measurement interval
2236  * property of the vNIC performance.
2237  *
2238  * @note  The property is treated as immutable: it is only valid to call
2239  *        the setter once.  However, we don't assert if the caller tries to
2240  *        overwrite, just ignoring the update instead.
2241  *
2242  * @param vnic_performance      Pointer to the vNIC Use.
2243  * @param recvd_ucast_packets_delta
2244  *****************************************************************************/
2245 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2246                                     const double recvd_ucast_packets_delta);
2247 /**************************************************************************//**
2248  * Set the Transmitted Broadcast Packets in measurement interval
2249  * property of the vNIC performance.
2250  *
2251  * @note  The property is treated as immutable: it is only valid to call
2252  *        the setter once.  However, we don't assert if the caller tries to
2253  *        overwrite, just ignoring the update instead.
2254  *
2255  * @param vnic_performance      Pointer to the vNIC Use.
2256  * @param tx_bcast_packets_acc
2257  *****************************************************************************/
2258 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2259                                     const double tx_bcast_packets_acc);
2260 /**************************************************************************//**
2261  * Set the Delta Broadcast packets Transmitted in measurement interval
2262  * property of the vNIC performance.
2263  *
2264  * @note  The property is treated as immutable: it is only valid to call
2265  *        the setter once.  However, we don't assert if the caller tries to
2266  *        overwrite, just ignoring the update instead.
2267  *
2268  * @param vnic_performance      Pointer to the vNIC Use.
2269  * @param tx_bcast_packets_delta
2270  *****************************************************************************/
2271 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2272                                     const double tx_bcast_packets_delta);
2273 /**************************************************************************//**
2274  * Set the Transmitted Discarded Packets in measurement interval
2275  * property of the vNIC performance.
2276  *
2277  * @note  The property is treated as immutable: it is only valid to call
2278  *        the setter once.  However, we don't assert if the caller tries to
2279  *        overwrite, just ignoring the update instead.
2280  *
2281  * @param vnic_performance      Pointer to the vNIC Use.
2282  * @param tx_discarded_packets_acc
2283  *****************************************************************************/
2284 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2285                                     const double tx_discarded_packets_acc);
2286 /**************************************************************************//**
2287  * Set the Delta Discarded packets Transmitted in measurement interval
2288  * property of the vNIC performance.
2289  *
2290  * @note  The property is treated as immutable: it is only valid to call
2291  *        the setter once.  However, we don't assert if the caller tries to
2292  *        overwrite, just ignoring the update instead.
2293  *
2294  * @param vnic_performance      Pointer to the vNIC Use.
2295  * @param tx_discarded_packets_delta
2296  *****************************************************************************/
2297 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2298                                     const double tx_discarded_packets_delta);
2299 /**************************************************************************//**
2300  * Set the Transmitted Errored Packets in measurement interval
2301  * property of the vNIC performance.
2302  *
2303  * @note  The property is treated as immutable: it is only valid to call
2304  *        the setter once.  However, we don't assert if the caller tries to
2305  *        overwrite, just ignoring the update instead.
2306  *
2307  * @param vnic_performance      Pointer to the vNIC Use.
2308  * @param tx_error_packets_acc
2309  *****************************************************************************/
2310 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2311                                     const double tx_error_packets_acc);
2312 /**************************************************************************//**
2313  * Set the Delta Errored packets Transmitted in measurement interval
2314  * property of the vNIC performance.
2315  *
2316  * @note  The property is treated as immutable: it is only valid to call
2317  *        the setter once.  However, we don't assert if the caller tries to
2318  *        overwrite, just ignoring the update instead.
2319  *
2320  * @param vnic_performance      Pointer to the vNIC Use.
2321  * @param tx_error_packets_delta
2322  *****************************************************************************/
2323 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2324                                     const double tx_error_packets_delta);
2325 /**************************************************************************//**
2326  * Set the Transmitted Multicast Packets in measurement interval
2327  * property of the vNIC performance.
2328  *
2329  * @note  The property is treated as immutable: it is only valid to call
2330  *        the setter once.  However, we don't assert if the caller tries to
2331  *        overwrite, just ignoring the update instead.
2332  *
2333  * @param vnic_performance      Pointer to the vNIC Use.
2334  * @param tx_mcast_packets_acc
2335  *****************************************************************************/
2336 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2337                                     const double tx_mcast_packets_acc);
2338 /**************************************************************************//**
2339  * Set the Delta Multicast packets Transmitted in measurement interval
2340  * property of the vNIC performance.
2341  *
2342  * @note  The property is treated as immutable: it is only valid to call
2343  *        the setter once.  However, we don't assert if the caller tries to
2344  *        overwrite, just ignoring the update instead.
2345  *
2346  * @param vnic_performance      Pointer to the vNIC Use.
2347  * @param tx_mcast_packets_delta
2348  *****************************************************************************/
2349 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2350                                     const double tx_mcast_packets_delta);
2351 /**************************************************************************//**
2352  * Set the Transmitted Octets in measurement interval
2353  * property of the vNIC performance.
2354  *
2355  * @note  The property is treated as immutable: it is only valid to call
2356  *        the setter once.  However, we don't assert if the caller tries to
2357  *        overwrite, just ignoring the update instead.
2358  *
2359  * @param vnic_performance      Pointer to the vNIC Use.
2360  * @param tx_octets_acc
2361  *****************************************************************************/
2362 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2363                                     const double tx_octets_acc);
2364 /**************************************************************************//**
2365  * Set the Delta Octets Transmitted in measurement interval
2366  * property of the vNIC performance.
2367  *
2368  * @note  The property is treated as immutable: it is only valid to call
2369  *        the setter once.  However, we don't assert if the caller tries to
2370  *        overwrite, just ignoring the update instead.
2371  *
2372  * @param vnic_performance      Pointer to the vNIC Use.
2373  * @param tx_octets_delta
2374  *****************************************************************************/
2375 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2376                                     const double tx_octets_delta);
2377 /**************************************************************************//**
2378  * Set the Transmitted Total Packets in measurement interval
2379  * property of the vNIC performance.
2380  *
2381  * @note  The property is treated as immutable: it is only valid to call
2382  *        the setter once.  However, we don't assert if the caller tries to
2383  *        overwrite, just ignoring the update instead.
2384  *
2385  * @param vnic_performance      Pointer to the vNIC Use.
2386  * @param tx_total_packets_acc
2387  *****************************************************************************/
2388 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2389                                     const double tx_total_packets_acc);
2390 /**************************************************************************//**
2391  * Set the Delta Total Packets Transmitted in measurement interval
2392  * property of the vNIC performance.
2393  *
2394  * @note  The property is treated as immutable: it is only valid to call
2395  *        the setter once.  However, we don't assert if the caller tries to
2396  *        overwrite, just ignoring the update instead.
2397  *
2398  * @param vnic_performance      Pointer to the vNIC Use.
2399  * @param tx_total_packets_delta
2400  *****************************************************************************/
2401 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2402                                     const double tx_total_packets_delta);
2403 /**************************************************************************//**
2404  * Set the Transmitted Unicast Packets in measurement interval
2405  * property of the vNIC performance.
2406  *
2407  * @note  The property is treated as immutable: it is only valid to call
2408  *        the setter once.  However, we don't assert if the caller tries to
2409  *        overwrite, just ignoring the update instead.
2410  *
2411  * @param vnic_performance      Pointer to the vNIC Use.
2412  * @param tx_ucast_packets_acc
2413  *****************************************************************************/
2414 void evel_vnic_performance_tx_ucast_packets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2415                                     const double tx_ucast_packets_acc);
2416 /**************************************************************************//**
2417  * Set the Delta Octets Transmitted in measurement interval
2418  * property of the vNIC performance.
2419  *
2420  * @note  The property is treated as immutable: it is only valid to call
2421  *        the setter once.  However, we don't assert if the caller tries to
2422  *        overwrite, just ignoring the update instead.
2423  *
2424  * @param vnic_performance      Pointer to the vNIC Use.
2425  * @param tx_ucast_packets_delta
2426  *****************************************************************************/
2427 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2428                                     const double tx_ucast_packets_delta);
2429
2430 /**************************************************************************//**
2431  * Add an additional vNIC Use to the specified Measurement event.
2432  *
2433  * @param measurement   Pointer to the measurement.
2434  * @param vnic_performance      Pointer to the vNIC Use to add.
2435  *****************************************************************************/
2436 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2437                             MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2438
2439 /**************************************************************************//**
2440  * Add an additional vNIC usage record Measurement.
2441  *
2442  * This function implements the previous API, purely for convenience.
2443  *
2444  * The ID is null delimited ASCII string.  The library takes a copy so the
2445  * caller does not have to preserve values after the function returns.
2446  *
2447  * @param measurement           Pointer to the measurement.
2448  * @param vnic_id               ASCIIZ string with the vNIC's ID.
2449  * @param valset                true or false confidence level
2450  * @param recvd_bcast_packets_acc         Recieved broadcast packets
2451  * @param recvd_bcast_packets_delta       Received delta broadcast packets
2452  * @param recvd_discarded_packets_acc     Recieved discarded packets
2453  * @param recvd_discarded_packets_delta   Received discarded delta packets
2454  * @param recvd_error_packets_acc         Received error packets
2455  * @param recvd_error_packets_delta,      Received delta error packets
2456  * @param recvd_mcast_packets_acc         Received multicast packets
2457  * @param recvd_mcast_packets_delta       Received delta multicast packets
2458  * @param recvd_octets_acc                Received octets
2459  * @param recvd_octets_delta              Received delta octets
2460  * @param recvd_total_packets_acc         Received total packets
2461  * @param recvd_total_packets_delta       Received delta total packets
2462  * @param recvd_ucast_packets_acc         Received Unicast packets
2463  * @param recvd_ucast_packets_delta       Received delta unicast packets
2464  * @param tx_bcast_packets_acc            Transmitted broadcast packets
2465  * @param tx_bcast_packets_delta          Transmitted delta broadcast packets
2466  * @param tx_discarded_packets_acc        Transmitted packets discarded
2467  * @param tx_discarded_packets_delta      Transmitted delta discarded packets
2468  * @param tx_error_packets_acc            Transmitted error packets
2469  * @param tx_error_packets_delta          Transmitted delta error packets
2470  * @param tx_mcast_packets_acc            Transmitted multicast packets accumulated
2471  * @param tx_mcast_packets_delta          Transmitted delta multicast packets
2472  * @param tx_octets_acc                   Transmitted octets
2473  * @param tx_octets_delta                 Transmitted delta octets
2474  * @param tx_total_packets_acc            Transmitted total packets
2475  * @param tx_total_packets_delta          Transmitted delta total packets
2476  * @param tx_ucast_packets_acc            Transmitted Unicast packets
2477  * @param tx_ucast_packets_delta          Transmitted delta Unicast packets
2478  *****************************************************************************/
2479 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2480                                char * const vnic_id,
2481                                char * valset,
2482                                double recvd_bcast_packets_acc,
2483                                double recvd_bcast_packets_delta,
2484                                double recvd_discarded_packets_acc,
2485                                double recvd_discarded_packets_delta,
2486                                double recvd_error_packets_acc,
2487                                double recvd_error_packets_delta,
2488                                double recvd_mcast_packets_acc,
2489                                double recvd_mcast_packets_delta,
2490                                double recvd_octets_acc,
2491                                double recvd_octets_delta,
2492                                double recvd_total_packets_acc,
2493                                double recvd_total_packets_delta,
2494                                double recvd_ucast_packets_acc,
2495                                double recvd_ucast_packets_delta,
2496                                double tx_bcast_packets_acc,
2497                                double tx_bcast_packets_delta,
2498                                double tx_discarded_packets_acc,
2499                                double tx_discarded_packets_delta,
2500                                double tx_error_packets_acc,
2501                                double tx_error_packets_delta,
2502                                double tx_mcast_packets_acc,
2503                                double tx_mcast_packets_delta,
2504                                double tx_octets_acc,
2505                                double tx_octets_delta,
2506                                double tx_total_packets_acc,
2507                                double tx_total_packets_delta,
2508                                double tx_ucast_packets_acc,
2509                                double tx_ucast_packets_delta);
2510
2511 /*****************************************************************************/
2512 /*****************************************************************************/
2513 /*                                                                           */
2514 /*   REPORT                                                                  */
2515 /*                                                                           */
2516 /*****************************************************************************/
2517 /*****************************************************************************/
2518
2519 /**************************************************************************//**
2520  * Create a new Report event.
2521  *
2522  * @note    The mandatory fields on the Report must be supplied to this
2523  *          factory function and are immutable once set.  Optional fields have
2524  *          explicit setter functions, but again values may only be set once so
2525  *          that the Report has immutable properties.
2526  *
2527  * @param   measurement_interval
2528  *
2529  * @returns pointer to the newly manufactured ::EVENT_REPORT.  If the event is
2530  *          not used (i.e. posted) it must be released using
2531  *          ::evel_free_report.
2532  * @retval  NULL  Failed to create the event.
2533  *****************************************************************************/
2534 EVENT_REPORT * evel_new_report(double measurement_interval);
2535
2536 /**************************************************************************//**
2537  * Free a Report.
2538  *
2539  * Free off the Report supplied.  Will free all the contained allocated memory.
2540  *
2541  * @note It does not free the Report itself, since that may be part of a
2542  * larger structure.
2543  *****************************************************************************/
2544 void evel_free_report(EVENT_REPORT * event);
2545
2546 /**************************************************************************//**
2547  * Set the Event Type property of the Report.
2548  *
2549  * @note  The property is treated as immutable: it is only valid to call
2550  *        the setter once.  However, we don't assert if the caller tries to
2551  *        overwrite, just ignoring the update instead.
2552  *
2553  * @param report Pointer to the Report.
2554  * @param type        The Event Type to be set. ASCIIZ string. The caller
2555  *                    does not need to preserve the value once the function
2556  *                    returns.
2557  *****************************************************************************/
2558 void evel_report_type_set(EVENT_REPORT * report, const char * const type);
2559
2560 /**************************************************************************//**
2561  * Add a Feature usage value name/value pair to the Report.
2562  *
2563  * The name is null delimited ASCII string.  The library takes
2564  * a copy so the caller does not have to preserve values after the function
2565  * returns.
2566  *
2567  * @param report          Pointer to the report.
2568  * @param feature         ASCIIZ string with the feature's name.
2569  * @param utilization     Utilization of the feature.
2570  *****************************************************************************/
2571 void evel_report_feature_use_add(EVENT_REPORT * report,
2572                                  char * feature,
2573                                  int utilization);
2574
2575 /**************************************************************************//**
2576  * Add a Additional Measurement value name/value pair to the Report.
2577  *
2578  * The name is null delimited ASCII string.  The library takes
2579  * a copy so the caller does not have to preserve values after the function
2580  * returns.
2581  *
2582  * @param report   Pointer to the report.
2583  * @param group    ASCIIZ string with the measurement group's name.
2584  * @param name     ASCIIZ string containing the measurement's name.
2585  * @param value    ASCIIZ string containing the measurement's value.
2586  *****************************************************************************/
2587 void evel_report_custom_measurement_add(EVENT_REPORT * report,
2588                                         const char * const group,
2589                                         const char * const name,
2590                                         const char * const value);
2591
2592 /*****************************************************************************/
2593 /*****************************************************************************/
2594 /*                                                                           */
2595 /*   MOBILE_FLOW                                                             */
2596 /*                                                                           */
2597 /*****************************************************************************/
2598 /*****************************************************************************/
2599
2600 /**************************************************************************//**
2601  * Create a new Mobile Flow event.
2602  *
2603  * @note    The mandatory fields on the Mobile Flow must be supplied to this
2604  *          factory function and are immutable once set.  Optional fields have
2605  *          explicit setter functions, but again values may only be set once so
2606  *          that the Mobile Flow has immutable properties.
2607  *
2608  * @param   flow_direction
2609  * @param   gtp_per_flow_metrics
2610  * @param   ip_protocol_type
2611  * @param   ip_version
2612  * @param   other_endpoint_ip_address
2613  * @param   other_endpoint_port
2614  * @param   reporting_endpoint_ip_addr
2615  * @param   reporting_endpoint_port
2616  *
2617  * @returns pointer to the newly manufactured ::EVENT_MOBILE_FLOW.  If the
2618  *          event is not used (i.e. posted) it must be released using
2619  *          ::evel_free_mobile_flow.
2620  * @retval  NULL  Failed to create the event.
2621  *****************************************************************************/
2622 EVENT_MOBILE_FLOW * evel_new_mobile_flow(
2623                       const char * const flow_direction,
2624                       MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics,
2625                       const char * const ip_protocol_type,
2626                       const char * const ip_version,
2627                       const char * const other_endpoint_ip_address,
2628                       int other_endpoint_port,
2629                       const char * const reporting_endpoint_ip_addr,
2630                       int reporting_endpoint_port);
2631
2632 /**************************************************************************//**
2633  * Free a Mobile Flow.
2634  *
2635  * Free off the Mobile Flow supplied.  Will free all the contained allocated
2636  * memory.
2637  *
2638  * @note It does not free the Mobile Flow itself, since that may be part of a
2639  * larger structure.
2640  *****************************************************************************/
2641 void evel_free_mobile_flow(EVENT_MOBILE_FLOW * event);
2642
2643 /**************************************************************************//**
2644  * Set the Event Type property of the Mobile Flow.
2645  *
2646  * @note  The property is treated as immutable: it is only valid to call
2647  *        the setter once.  However, we don't assert if the caller tries to
2648  *        overwrite, just ignoring the update instead.
2649  *
2650  * @param mobile_flow Pointer to the Mobile Flow.
2651  * @param type        The Event Type to be set. ASCIIZ string. The caller
2652  *                    does not need to preserve the value once the function
2653  *                    returns.
2654  *****************************************************************************/
2655 void evel_mobile_flow_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2656                                const char * const type);
2657
2658 /**************************************************************************//**
2659  * Set the Application Type property of the Mobile Flow.
2660  *
2661  * @note  The property is treated as immutable: it is only valid to call
2662  *        the setter once.  However, we don't assert if the caller tries to
2663  *        overwrite, just ignoring the update instead.
2664  *
2665  * @param mobile_flow Pointer to the Mobile Flow.
2666  * @param type        The Application Type to be set. ASCIIZ string. The caller
2667  *                    does not need to preserve the value once the function
2668  *                    returns.
2669  *****************************************************************************/
2670 void evel_mobile_flow_app_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2671                                    const char * const type);
2672
2673 /**************************************************************************//**
2674  * Set the Application Protocol Type property of the Mobile Flow.
2675  *
2676  * @note  The property is treated as immutable: it is only valid to call
2677  *        the setter once.  However, we don't assert if the caller tries to
2678  *        overwrite, just ignoring the update instead.
2679  *
2680  * @param mobile_flow Pointer to the Mobile Flow.
2681  * @param type        The Application Protocol Type to be set. ASCIIZ string.
2682  *                    The caller does not need to preserve the value once the
2683  *                    function returns.
2684  *****************************************************************************/
2685 void evel_mobile_flow_app_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2686                                         const char * const type);
2687
2688 /**************************************************************************//**
2689  * Set the Application Protocol Version property of the Mobile Flow.
2690  *
2691  * @note  The property is treated as immutable: it is only valid to call
2692  *        the setter once.  However, we don't assert if the caller tries to
2693  *        overwrite, just ignoring the update instead.
2694  *
2695  * @param mobile_flow Pointer to the Mobile Flow.
2696  * @param version     The Application Protocol Version to be set. ASCIIZ
2697  *                    string.  The caller does not need to preserve the value
2698  *                    once the function returns.
2699  *****************************************************************************/
2700 void evel_mobile_flow_app_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2701                                        const char * const version);
2702
2703 /**************************************************************************//**
2704  * Set the CID property of the Mobile Flow.
2705  *
2706  * @note  The property is treated as immutable: it is only valid to call
2707  *        the setter once.  However, we don't assert if the caller tries to
2708  *        overwrite, just ignoring the update instead.
2709  *
2710  * @param mobile_flow Pointer to the Mobile Flow.
2711  * @param cid         The CID to be set. ASCIIZ string.  The caller does not
2712  *                    need to preserve the value once the function returns.
2713  *****************************************************************************/
2714 void evel_mobile_flow_cid_set(EVENT_MOBILE_FLOW * mobile_flow,
2715                               const char * const cid);
2716
2717 /**************************************************************************//**
2718  * Set the Connection Type property of the Mobile Flow.
2719  *
2720  * @note  The property is treated as immutable: it is only valid to call
2721  *        the setter once.  However, we don't assert if the caller tries to
2722  *        overwrite, just ignoring the update instead.
2723  *
2724  * @param mobile_flow Pointer to the Mobile Flow.
2725  * @param type        The Connection Type to be set. ASCIIZ string. The caller
2726  *                    does not need to preserve the value once the function
2727  *                    returns.
2728  *****************************************************************************/
2729 void evel_mobile_flow_con_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2730                                    const char * const type);
2731
2732 /**************************************************************************//**
2733  * Set the ECGI property of the Mobile Flow.
2734  *
2735  * @note  The property is treated as immutable: it is only valid to call
2736  *        the setter once.  However, we don't assert if the caller tries to
2737  *        overwrite, just ignoring the update instead.
2738  *
2739  * @param mobile_flow Pointer to the Mobile Flow.
2740  * @param ecgi        The ECGI to be set. ASCIIZ string.  The caller does not
2741  *                    need to preserve the value once the function returns.
2742  *****************************************************************************/
2743 void evel_mobile_flow_ecgi_set(EVENT_MOBILE_FLOW * mobile_flow,
2744                                const char * const ecgi);
2745
2746 /**************************************************************************//**
2747  * Set the GTP Protocol Type property of the Mobile Flow.
2748  *
2749  * @note  The property is treated as immutable: it is only valid to call
2750  *        the setter once.  However, we don't assert if the caller tries to
2751  *        overwrite, just ignoring the update instead.
2752  *
2753  * @param mobile_flow Pointer to the Mobile Flow.
2754  * @param type        The GTP Protocol Type to be set. ASCIIZ string.  The
2755  *                    caller does not need to preserve the value once the
2756  *                    function returns.
2757  *****************************************************************************/
2758 void evel_mobile_flow_gtp_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2759                                         const char * const type);
2760
2761 /**************************************************************************//**
2762  * Set the GTP Protocol Version property of the Mobile Flow.
2763  *
2764  * @note  The property is treated as immutable: it is only valid to call
2765  *        the setter once.  However, we don't assert if the caller tries to
2766  *        overwrite, just ignoring the update instead.
2767  *
2768  * @param mobile_flow Pointer to the Mobile Flow.
2769  * @param version     The GTP Protocol Version to be set. ASCIIZ string.  The
2770  *                    caller does not need to preserve the value once the
2771  *                    function returns.
2772  *****************************************************************************/
2773 void evel_mobile_flow_gtp_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2774                                        const char * const version);
2775
2776 /**************************************************************************//**
2777  * Set the HTTP Header property of the Mobile Flow.
2778  *
2779  * @note  The property is treated as immutable: it is only valid to call
2780  *        the setter once.  However, we don't assert if the caller tries to
2781  *        overwrite, just ignoring the update instead.
2782  *
2783  * @param mobile_flow Pointer to the Mobile Flow.
2784  * @param header      The HTTP header to be set. ASCIIZ string. The caller does
2785  *                    not need to preserve the value once the function returns.
2786  *****************************************************************************/
2787 void evel_mobile_flow_http_header_set(EVENT_MOBILE_FLOW * mobile_flow,
2788                                       const char * const header);
2789
2790 /**************************************************************************//**
2791  * Set the IMEI property of the Mobile Flow.
2792  *
2793  * @note  The property is treated as immutable: it is only valid to call
2794  *        the setter once.  However, we don't assert if the caller tries to
2795  *        overwrite, just ignoring the update instead.
2796  *
2797  * @param mobile_flow Pointer to the Mobile Flow.
2798  * @param imei        The IMEI to be set. ASCIIZ string.  The caller does not
2799  *                    need to preserve the value once the function returns.
2800  *****************************************************************************/
2801 void evel_mobile_flow_imei_set(EVENT_MOBILE_FLOW * mobile_flow,
2802                                const char * const imei);
2803
2804 /**************************************************************************//**
2805  * Set the IMSI property of the Mobile Flow.
2806  *
2807  * @note  The property is treated as immutable: it is only valid to call
2808  *        the setter once.  However, we don't assert if the caller tries to
2809  *        overwrite, just ignoring the update instead.
2810  *
2811  * @param mobile_flow Pointer to the Mobile Flow.
2812  * @param imsi        The IMSI to be set. ASCIIZ string.  The caller does not
2813  *                    need to preserve the value once the function returns.
2814  *****************************************************************************/
2815 void evel_mobile_flow_imsi_set(EVENT_MOBILE_FLOW * mobile_flow,
2816                                const char * const imsi);
2817
2818 /**************************************************************************//**
2819  * Set the LAC property of the Mobile Flow.
2820  *
2821  * @note  The property is treated as immutable: it is only valid to call
2822  *        the setter once.  However, we don't assert if the caller tries to
2823  *        overwrite, just ignoring the update instead.
2824  *
2825  * @param mobile_flow Pointer to the Mobile Flow.
2826  * @param lac         The LAC to be set. ASCIIZ string.  The caller does not
2827  *                    need to preserve the value once the function returns.
2828  *****************************************************************************/
2829 void evel_mobile_flow_lac_set(EVENT_MOBILE_FLOW * mobile_flow,
2830                               const char * const lac);
2831
2832 /**************************************************************************//**
2833  * Set the MCC property of the Mobile Flow.
2834  *
2835  * @note  The property is treated as immutable: it is only valid to call
2836  *        the setter once.  However, we don't assert if the caller tries to
2837  *        overwrite, just ignoring the update instead.
2838  *
2839  * @param mobile_flow Pointer to the Mobile Flow.
2840  * @param mcc         The MCC to be set. ASCIIZ string.  The caller does not
2841  *                    need to preserve the value once the function returns.
2842  *****************************************************************************/
2843 void evel_mobile_flow_mcc_set(EVENT_MOBILE_FLOW * mobile_flow,
2844                               const char * const mcc);
2845
2846 /**************************************************************************//**
2847  * Set the MNC property of the Mobile Flow.
2848  *
2849  * @note  The property is treated as immutable: it is only valid to call
2850  *        the setter once.  However, we don't assert if the caller tries to
2851  *        overwrite, just ignoring the update instead.
2852  *
2853  * @param mobile_flow Pointer to the Mobile Flow.
2854  * @param mnc         The MNC to be set. ASCIIZ string.  The caller does not
2855  *                    need to preserve the value once the function returns.
2856  *****************************************************************************/
2857 void evel_mobile_flow_mnc_set(EVENT_MOBILE_FLOW * mobile_flow,
2858                               const char * const mnc);
2859
2860 /**************************************************************************//**
2861  * Set the MSISDN property of the Mobile Flow.
2862  *
2863  * @note  The property is treated as immutable: it is only valid to call
2864  *        the setter once.  However, we don't assert if the caller tries to
2865  *        overwrite, just ignoring the update instead.
2866  *
2867  * @param mobile_flow Pointer to the Mobile Flow.
2868  * @param msisdn      The MSISDN to be set. ASCIIZ string.  The caller does not
2869  *                    need to preserve the value once the function returns.
2870  *****************************************************************************/
2871 void evel_mobile_flow_msisdn_set(EVENT_MOBILE_FLOW * mobile_flow,
2872                                  const char * const msisdn);
2873
2874 /**************************************************************************//**
2875  * Set the Other Functional Role property of the Mobile Flow.
2876  *
2877  * @note  The property is treated as immutable: it is only valid to call
2878  *        the setter once.  However, we don't assert if the caller tries to
2879  *        overwrite, just ignoring the update instead.
2880  *
2881  * @param mobile_flow Pointer to the Mobile Flow.
2882  * @param role        The Other Functional Role to be set. ASCIIZ string. The
2883  *                    caller does not need to preserve the value once the
2884  *                    function returns.
2885  *****************************************************************************/
2886 void evel_mobile_flow_other_func_role_set(EVENT_MOBILE_FLOW * mobile_flow,
2887                                           const char * const role);
2888
2889 /**************************************************************************//**
2890  * Set the RAC property of the Mobile Flow.
2891  *
2892  * @note  The property is treated as immutable: it is only valid to call
2893  *        the setter once.  However, we don't assert if the caller tries to
2894  *        overwrite, just ignoring the update instead.
2895  *
2896  * @param mobile_flow Pointer to the Mobile Flow.
2897  * @param rac         The RAC to be set. ASCIIZ string.  The caller does not
2898  *                    need to preserve the value once the function returns.
2899  *****************************************************************************/
2900 void evel_mobile_flow_rac_set(EVENT_MOBILE_FLOW * mobile_flow,
2901                               const char * const rac);
2902
2903 /**************************************************************************//**
2904  * Set the Radio Access Technology property of the Mobile Flow.
2905  *
2906  * @note  The property is treated as immutable: it is only valid to call
2907  *        the setter once.  However, we don't assert if the caller tries to
2908  *        overwrite, just ignoring the update instead.
2909  *
2910  * @param mobile_flow Pointer to the Mobile Flow.
2911  * @param tech        The Radio Access Technology to be set. ASCIIZ string. The
2912  *                    caller does not need to preserve the value once the
2913  *                    function returns.
2914  *****************************************************************************/
2915 void evel_mobile_flow_radio_acc_tech_set(EVENT_MOBILE_FLOW * mobile_flow,
2916                                          const char * const tech);
2917
2918 /**************************************************************************//**
2919  * Set the SAC property of the Mobile Flow.
2920  *
2921  * @note  The property is treated as immutable: it is only valid to call
2922  *        the setter once.  However, we don't assert if the caller tries to
2923  *        overwrite, just ignoring the update instead.
2924  *
2925  * @param mobile_flow Pointer to the Mobile Flow.
2926  * @param sac         The SAC to be set. ASCIIZ string.  The caller does not
2927  *                    need to preserve the value once the function returns.
2928  *****************************************************************************/
2929 void evel_mobile_flow_sac_set(EVENT_MOBILE_FLOW * mobile_flow,
2930                               const char * const sac);
2931
2932 /**************************************************************************//**
2933  * Set the Sampling Algorithm property of the Mobile Flow.
2934  *
2935  * @note  The property is treated as immutable: it is only valid to call
2936  *        the setter once.  However, we don't assert if the caller tries to
2937  *        overwrite, just ignoring the update instead.
2938  *
2939  * @param mobile_flow Pointer to the Mobile Flow.
2940  * @param algorithm   The Sampling Algorithm to be set.
2941  *****************************************************************************/
2942 void evel_mobile_flow_samp_alg_set(EVENT_MOBILE_FLOW * mobile_flow,
2943                                    int algorithm);
2944
2945 /**************************************************************************//**
2946  * Set the TAC property of the Mobile Flow.
2947  *
2948  * @note  The property is treated as immutable: it is only valid to call
2949  *        the setter once.  However, we don't assert if the caller tries to
2950  *        overwrite, just ignoring the update instead.
2951  *
2952  * @param mobile_flow Pointer to the Mobile Flow.
2953  * @param tac         The TAC to be set. ASCIIZ string.  The caller does not
2954  *                    need to preserve the value once the function returns.
2955  *****************************************************************************/
2956 void evel_mobile_flow_tac_set(EVENT_MOBILE_FLOW * mobile_flow,
2957                               const char * const tac);
2958
2959 /**************************************************************************//**
2960  * Set the Tunnel ID property of the Mobile Flow.
2961  *
2962  * @note  The property is treated as immutable: it is only valid to call
2963  *        the setter once.  However, we don't assert if the caller tries to
2964  *        overwrite, just ignoring the update instead.
2965  *
2966  * @param mobile_flow Pointer to the Mobile Flow.
2967  * @param tunnel_id   The Tunnel ID to be set. ASCIIZ string.  The caller does
2968  *                    not need to preserve the value once the function returns.
2969  *****************************************************************************/
2970 void evel_mobile_flow_tunnel_id_set(EVENT_MOBILE_FLOW * mobile_flow,
2971                                     const char * const tunnel_id);
2972
2973 /**************************************************************************//**
2974  * Set the VLAN ID property of the Mobile Flow.
2975  *
2976  * @note  The property is treated as immutable: it is only valid to call
2977  *        the setter once.  However, we don't assert if the caller tries to
2978  *        overwrite, just ignoring the update instead.
2979  *
2980  * @param mobile_flow Pointer to the Mobile Flow.
2981  * @param vlan_id     The VLAN ID to be set. ASCIIZ string.  The caller does
2982  *                    not need to preserve the value once the function returns.
2983  *****************************************************************************/
2984 void evel_mobile_flow_vlan_id_set(EVENT_MOBILE_FLOW * mobile_flow,
2985                                   const char * const vlan_id);
2986
2987 /**************************************************************************//**
2988  * Create a new Mobile GTP Per Flow Metrics.
2989  *
2990  * @note    The mandatory fields on the Mobile GTP Per Flow Metrics must be
2991  *          supplied to this factory function and are immutable once set.
2992  *          Optional fields have explicit setter functions, but again values
2993  *          may only be set once so that the Mobile GTP Per Flow Metrics has
2994  *          immutable properties.
2995  *
2996  * @param   avg_bit_error_rate
2997  * @param   avg_packet_delay_variation
2998  * @param   avg_packet_latency
2999  * @param   avg_receive_throughput
3000  * @param   avg_transmit_throughput
3001  * @param   flow_activation_epoch
3002  * @param   flow_activation_microsec
3003  * @param   flow_deactivation_epoch
3004  * @param   flow_deactivation_microsec
3005  * @param   flow_deactivation_time
3006  * @param   flow_status
3007  * @param   max_packet_delay_variation
3008  * @param   num_activation_failures
3009  * @param   num_bit_errors
3010  * @param   num_bytes_received
3011  * @param   num_bytes_transmitted
3012  * @param   num_dropped_packets
3013  * @param   num_l7_bytes_received
3014  * @param   num_l7_bytes_transmitted
3015  * @param   num_lost_packets
3016  * @param   num_out_of_order_packets
3017  * @param   num_packet_errors
3018  * @param   num_packets_received_excl_retrans
3019  * @param   num_packets_received_incl_retrans
3020  * @param   num_packets_transmitted_incl_retrans
3021  * @param   num_retries
3022  * @param   num_timeouts
3023  * @param   num_tunneled_l7_bytes_received
3024  * @param   round_trip_time
3025  * @param   time_to_first_byte
3026  *
3027  * @returns pointer to the newly manufactured ::MOBILE_GTP_PER_FLOW_METRICS.
3028  *          If the structure is not used it must be released using
3029  *          ::evel_free_mobile_gtp_flow_metrics.
3030  * @retval  NULL  Failed to create the event.
3031  *****************************************************************************/
3032 MOBILE_GTP_PER_FLOW_METRICS * evel_new_mobile_gtp_flow_metrics(
3033                                       double avg_bit_error_rate,
3034                                       double avg_packet_delay_variation,
3035                                       int avg_packet_latency,
3036                                       int avg_receive_throughput,
3037                                       int avg_transmit_throughput,
3038                                       int flow_activation_epoch,
3039                                       int flow_activation_microsec,
3040                                       int flow_deactivation_epoch,
3041                                       int flow_deactivation_microsec,
3042                                       time_t flow_deactivation_time,
3043                                       const char * const flow_status,
3044                                       int max_packet_delay_variation,
3045                                       int num_activation_failures,
3046                                       int num_bit_errors,
3047                                       int num_bytes_received,
3048                                       int num_bytes_transmitted,
3049                                       int num_dropped_packets,
3050                                       int num_l7_bytes_received,
3051                                       int num_l7_bytes_transmitted,
3052                                       int num_lost_packets,
3053                                       int num_out_of_order_packets,
3054                                       int num_packet_errors,
3055                                       int num_packets_received_excl_retrans,
3056                                       int num_packets_received_incl_retrans,
3057                                       int num_packets_transmitted_incl_retrans,
3058                                       int num_retries,
3059                                       int num_timeouts,
3060                                       int num_tunneled_l7_bytes_received,
3061                                       int round_trip_time,
3062                                       int time_to_first_byte);
3063
3064 /**************************************************************************//**
3065  * Free a Mobile GTP Per Flow Metrics.
3066  *
3067  * Free off the Mobile GTP Per Flow Metrics supplied.  Will free all the
3068  * contained allocated memory.
3069  *
3070  * @note It does not free the Mobile GTP Per Flow Metrics itself, since that
3071  * may be part of a larger structure.
3072  *****************************************************************************/
3073 void evel_free_mobile_gtp_flow_metrics(MOBILE_GTP_PER_FLOW_METRICS * metrics);
3074
3075 /**************************************************************************//**
3076  * Set the Duration of Connection Failed Status property of the Mobile GTP Per
3077  * Flow Metrics.
3078  *
3079  * @note  The property is treated as immutable: it is only valid to call
3080  *        the setter once.  However, we don't assert if the caller tries to
3081  *        overwrite, just ignoring the update instead.
3082  *
3083  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3084  * @param duration    The Duration of Connection Failed Status to be set.
3085  *****************************************************************************/
3086 void evel_mobile_gtp_metrics_dur_con_fail_set(
3087                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3088                                          int duration);
3089
3090 /**************************************************************************//**
3091  * Set the Duration of Tunnel Failed Status property of the Mobile GTP Per Flow
3092  * Metrics.
3093  *
3094  * @note  The property is treated as immutable: it is only valid to call
3095  *        the setter once.  However, we don't assert if the caller tries to
3096  *        overwrite, just ignoring the update instead.
3097  *
3098  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3099  * @param duration    The Duration of Tunnel Failed Status to be set.
3100  *****************************************************************************/
3101 void evel_mobile_gtp_metrics_dur_tun_fail_set(
3102                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3103                                          int duration);
3104
3105 /**************************************************************************//**
3106  * Set the Activated By property of the Mobile GTP Per Flow metrics.
3107  *
3108  * @note  The property is treated as immutable: it is only valid to call
3109  *        the setter once.  However, we don't assert if the caller tries to
3110  *        overwrite, just ignoring the update instead.
3111  *
3112  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3113  * @param act_by      The Activated By to be set.  ASCIIZ string. The caller
3114  *                    does not need to preserve the value once the function
3115  *                    returns.
3116  *****************************************************************************/
3117 void evel_mobile_gtp_metrics_act_by_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3118                                         const char * const act_by);
3119
3120 /**************************************************************************//**
3121  * Set the Activation Time property of the Mobile GTP Per Flow metrics.
3122  *
3123  * @note  The property is treated as immutable: it is only valid to call
3124  *        the setter once.  However, we don't assert if the caller tries to
3125  *        overwrite, just ignoring the update instead.
3126  *
3127  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3128  * @param act_time    The Activation Time to be set.  ASCIIZ string. The caller
3129  *                    does not need to preserve the value once the function
3130  *                    returns.
3131  *****************************************************************************/
3132 void evel_mobile_gtp_metrics_act_time_set(
3133                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3134                                          time_t act_time);
3135
3136 /**************************************************************************//**
3137  * Set the Deactivated By property of the Mobile GTP Per Flow metrics.
3138  *
3139  * @note  The property is treated as immutable: it is only valid to call
3140  *        the setter once.  However, we don't assert if the caller tries to
3141  *        overwrite, just ignoring the update instead.
3142  *
3143  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3144  * @param deact_by    The Deactivated By to be set.  ASCIIZ string. The caller
3145  *                    does not need to preserve the value once the function
3146  *                    returns.
3147  *****************************************************************************/
3148 void evel_mobile_gtp_metrics_deact_by_set(
3149                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3150                                          const char * const deact_by);
3151
3152 /**************************************************************************//**
3153  * Set the GTP Connection Status property of the Mobile GTP Per Flow metrics.
3154  *
3155  * @note  The property is treated as immutable: it is only valid to call
3156  *        the setter once.  However, we don't assert if the caller tries to
3157  *        overwrite, just ignoring the update instead.
3158  *
3159  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3160  * @param status      The GTP Connection Status to be set.  ASCIIZ string. The
3161  *                    caller does not need to preserve the value once the
3162  *                    function returns.
3163  *****************************************************************************/
3164 void evel_mobile_gtp_metrics_con_status_set(
3165                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3166                                          const char * const status);
3167
3168 /**************************************************************************//**
3169  * Set the GTP Tunnel Status property of the Mobile GTP Per Flow metrics.
3170  *
3171  * @note  The property is treated as immutable: it is only valid to call
3172  *        the setter once.  However, we don't assert if the caller tries to
3173  *        overwrite, just ignoring the update instead.
3174  *
3175  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3176  * @param status      The GTP Tunnel Status to be set.  ASCIIZ string. The
3177  *                    caller does not need to preserve the value once the
3178  *                    function returns.
3179  *****************************************************************************/
3180 void evel_mobile_gtp_metrics_tun_status_set(
3181                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3182                                          const char * const status);
3183
3184 /**************************************************************************//**
3185  * Set an IP Type-of-Service count property of the Mobile GTP Per Flow metrics.
3186  *
3187  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3188  * @param index       The index of the IP Type-of-Service.
3189  * @param count       The count.
3190  *****************************************************************************/
3191 void evel_mobile_gtp_metrics_iptos_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3192                                        int index,
3193                                        int count);
3194
3195 /**************************************************************************//**
3196  * Set the Large Packet Round-Trip Time property of the Mobile GTP Per Flow
3197  * Metrics.
3198  *
3199  * @note  The property is treated as immutable: it is only valid to call
3200  *        the setter once.  However, we don't assert if the caller tries to
3201  *        overwrite, just ignoring the update instead.
3202  *
3203  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3204  * @param rtt         The Large Packet Round-Trip Time to be set.
3205  *****************************************************************************/
3206 void evel_mobile_gtp_metrics_large_pkt_rtt_set(
3207                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3208                                          int rtt);
3209
3210 /**************************************************************************//**
3211  * Set the Large Packet Threshold property of the Mobile GTP Per Flow Metrics.
3212  *
3213  * @note  The property is treated as immutable: it is only valid to call
3214  *        the setter once.  However, we don't assert if the caller tries to
3215  *        overwrite, just ignoring the update instead.
3216  *
3217  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3218  * @param threshold   The Large Packet Threshold to be set.
3219  *****************************************************************************/
3220 void evel_mobile_gtp_metrics_large_pkt_thresh_set(
3221                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3222                                          double threshold);
3223
3224 /**************************************************************************//**
3225  * Set the Max Receive Bit Rate property of the Mobile GTP Per Flow Metrics.
3226  *
3227  * @note  The property is treated as immutable: it is only valid to call
3228  *        the setter once.  However, we don't assert if the caller tries to
3229  *        overwrite, just ignoring the update instead.
3230  *
3231  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3232  * @param rate        The Max Receive Bit Rate to be set.
3233  *****************************************************************************/
3234 void evel_mobile_gtp_metrics_max_rcv_bit_rate_set(
3235                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3236                                          int rate);
3237
3238 /**************************************************************************//**
3239  * Set the Max Transmit Bit Rate property of the Mobile GTP Per Flow Metrics.
3240  *
3241  * @note  The property is treated as immutable: it is only valid to call
3242  *        the setter once.  However, we don't assert if the caller tries to
3243  *        overwrite, just ignoring the update instead.
3244  *
3245  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3246  * @param rate        The Max Transmit Bit Rate to be set.
3247  *****************************************************************************/
3248 void evel_mobile_gtp_metrics_max_trx_bit_rate_set(
3249                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3250                                          int rate);
3251
3252 /**************************************************************************//**
3253  * Set the Number of GTP Echo Failures property of the Mobile GTP Per Flow
3254  * Metrics.
3255  *
3256  * @note  The property is treated as immutable: it is only valid to call
3257  *        the setter once.  However, we don't assert if the caller tries to
3258  *        overwrite, just ignoring the update instead.
3259  *
3260  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3261  * @param num         The Number of GTP Echo Failures to be set.
3262  *****************************************************************************/
3263 void evel_mobile_gtp_metrics_num_echo_fail_set(
3264                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3265                                          int num);
3266
3267 /**************************************************************************//**
3268  * Set the Number of GTP Tunnel Errors property of the Mobile GTP Per Flow
3269  * Metrics.
3270  *
3271  * @note  The property is treated as immutable: it is only valid to call
3272  *        the setter once.  However, we don't assert if the caller tries to
3273  *        overwrite, just ignoring the update instead.
3274  *
3275  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3276  * @param num         The Number of GTP Tunnel Errors to be set.
3277  *****************************************************************************/
3278 void evel_mobile_gtp_metrics_num_tun_fail_set(
3279                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3280                                          int num);
3281
3282 /**************************************************************************//**
3283  * Set the Number of HTTP Errors property of the Mobile GTP Per Flow Metrics.
3284  *
3285  * @note  The property is treated as immutable: it is only valid to call
3286  *        the setter once.  However, we don't assert if the caller tries to
3287  *        overwrite, just ignoring the update instead.
3288  *
3289  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3290  * @param num         The Number of HTTP Errors to be set.
3291  *****************************************************************************/
3292 void evel_mobile_gtp_metrics_num_http_errors_set(
3293                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3294                                          int num);
3295
3296 /**************************************************************************//**
3297  * Add a TCP flag count to the metrics.
3298  *
3299  * @note  The property is treated as immutable: it is only valid to call
3300  *        the setter once.  However, we don't assert if the caller tries to
3301  *        overwrite, just ignoring the update instead.
3302  *
3303  * @param metrics       Pointer to the Mobile GTP Per Flow Metrics.
3304  * @param tcp_flag      The TCP flag count to be updated.
3305  * @param count         The associated flag count.
3306  *****************************************************************************/
3307 void evel_mobile_gtp_metrics_tcp_flag_count_add(
3308                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3309                                          const EVEL_TCP_FLAGS tcp_flag,
3310                                          const int count);
3311
3312 /**************************************************************************//**
3313  * Add a QCI COS count to the metrics.
3314  *
3315  * @note  The property is treated as immutable: it is only valid to call
3316  *        the setter once.  However, we don't assert if the caller tries to
3317  *        overwrite, just ignoring the update instead.
3318  *
3319  * @param metrics       Pointer to the Mobile GTP Per Flow Metrics.
3320  * @param qci_cos       The QCI COS count to be updated.
3321  * @param count         The associated QCI COS count.
3322  *****************************************************************************/
3323 void evel_mobile_gtp_metrics_qci_cos_count_add(
3324                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3325                                          const EVEL_QCI_COS_TYPES qci_cos,
3326                                          const int count);
3327
3328 /*****************************************************************************/
3329 /*****************************************************************************/
3330 /*                                                                           */
3331 /*   SIGNALING                                                               */
3332 /*                                                                           */
3333 /*****************************************************************************/
3334 /*****************************************************************************/
3335
3336 /**************************************************************************//**
3337  * Create a new Signaling event.
3338  *
3339  * @note    The mandatory fields on the Signaling must be supplied to
3340  *          this factory function and are immutable once set.  Optional fields
3341  *          have explicit setter functions, but again values may only be set
3342  *          once so that the event has immutable properties.
3343  * @param vendor_name   The vendor id to encode in the event vnf field.
3344  * @param module        The module to encode in the event.
3345  * @param vnfname       The Virtual network function to encode in the event.
3346  * @returns pointer to the newly manufactured ::EVENT_SIGNALING.  If the event
3347  *          is not used (i.e. posted) it must be released using
3348  *          ::evel_free_signaling.
3349  * @retval  NULL  Failed to create the event.
3350  *****************************************************************************/
3351 EVENT_SIGNALING * evel_new_signaling(const char * const vendor_name,
3352                                      const char * const correlator,
3353                                      const char * const local_ip_address,
3354                                      const char * const local_port,
3355                                      const char * const remote_ip_address,
3356                                      const char * const remote_port);
3357
3358 /**************************************************************************//**
3359  * Free a Signaling event.
3360  *
3361  * Free off the event supplied.  Will free all the contained allocated memory.
3362  *
3363  * @note It does not free the event itself, since that may be part of a larger
3364  * structure.
3365  *****************************************************************************/
3366 void evel_free_signaling(EVENT_SIGNALING * const event);
3367
3368 /**************************************************************************//**
3369  * Set the Event Type property of the Signaling event.
3370  *
3371  * @note  The property is treated as immutable: it is only valid to call
3372  *        the setter once.  However, we don't assert if the caller tries to
3373  *        overwrite, just ignoring the update instead.
3374  *
3375  * @param event         Pointer to the Signaling event.
3376  * @param type          The Event Type to be set. ASCIIZ string. The caller
3377  *                      does not need to preserve the value once the function
3378  *                      returns.
3379  *****************************************************************************/
3380 void evel_signaling_type_set(EVENT_SIGNALING * const event,
3381                              const char * const type);
3382
3383 /**************************************************************************//**
3384  * Add an additional value name/value pair to the SIP signaling.
3385  *
3386  * The name and value are null delimited ASCII strings.  The library takes
3387  * a copy so the caller does not have to preserve values after the function
3388  * returns.
3389  *
3390  * @param event     Pointer to the fault.
3391  * @param name      ASCIIZ string with the attribute's name.  The caller
3392  *                  does not need to preserve the value once the function
3393  *                  returns.
3394  * @param value     ASCIIZ string with the attribute's value.  The caller
3395  *                  does not need to preserve the value once the function
3396  *                  returns.
3397  *****************************************************************************/
3398 void evel_signaling_addl_info_add(EVENT_SIGNALING * event, char * name, char * value);
3399
3400 /**************************************************************************//**
3401  * Set the Correlator property of the Signaling event.
3402  *
3403  * @note  The property is treated as immutable: it is only valid to call
3404  *        the setter once.  However, we don't assert if the caller tries to
3405  *        overwrite, just ignoring the update instead.
3406  *
3407  * @param event         Pointer to the Signaling event.
3408  * @param correlator    The correlator to be set. ASCIIZ string. The caller
3409  *                      does not need to preserve the value once the function
3410  *                      returns.
3411  *****************************************************************************/
3412 void evel_signaling_correlator_set(EVENT_SIGNALING * const event,
3413                                    const char * const correlator);
3414
3415 /**************************************************************************//**
3416  * Set the Local Ip Address property of the Signaling event.
3417  *
3418  * @note  The property is treated as immutable: it is only valid to call
3419  *        the setter once.  However, we don't assert if the caller tries to
3420  *        overwrite, just ignoring the update instead.
3421  *
3422  * @param event         Pointer to the Signaling event.
3423  * @param local_ip_address
3424  *                      The Local Ip Address to be set. ASCIIZ string. The
3425  *                      caller does not need to preserve the value once the
3426  *                      function returns.
3427  *****************************************************************************/
3428 void evel_signaling_local_ip_address_set(EVENT_SIGNALING * const event,
3429                                          const char * const local_ip_address);
3430
3431 /**************************************************************************//**
3432  * Set the Local Port property of the Signaling event.
3433  *
3434  * @note  The property is treated as immutable: it is only valid to call
3435  *        the setter once.  However, we don't assert if the caller tries to
3436  *        overwrite, just ignoring the update instead.
3437  *
3438  * @param event         Pointer to the Signaling event.
3439  * @param local_port    The Local Port to be set. ASCIIZ string. The caller
3440  *                      does not need to preserve the value once the function
3441  *                      returns.
3442  *****************************************************************************/
3443 void evel_signaling_local_port_set(EVENT_SIGNALING * const event,
3444                                    const char * const local_port);
3445
3446 /**************************************************************************//**
3447  * Set the Remote Ip Address property of the Signaling event.
3448  *
3449  * @note  The property is treated as immutable: it is only valid to call
3450  *        the setter once.  However, we don't assert if the caller tries to
3451  *        overwrite, just ignoring the update instead.
3452  *
3453  * @param event         Pointer to the Signaling event.
3454  * @param remote_ip_address
3455  *                      The Remote Ip Address to be set. ASCIIZ string. The
3456  *                      caller does not need to preserve the value once the
3457  *                      function returns.
3458  *****************************************************************************/
3459 void evel_signaling_remote_ip_address_set(EVENT_SIGNALING * const event,
3460                                          const char * const remote_ip_address);
3461
3462 /**************************************************************************//**
3463  * Set the Remote Port property of the Signaling event.
3464  *
3465  * @note  The property is treated as immutable: it is only valid to call
3466  *        the setter once.  However, we don't assert if the caller tries to
3467  *        overwrite, just ignoring the update instead.
3468  *
3469  * @param event         Pointer to the Signaling event.
3470  * @param remote_port   The Remote Port to be set. ASCIIZ string. The caller
3471  *                      does not need to preserve the value once the function
3472  *                      returns.
3473  *****************************************************************************/
3474 void evel_signaling_remote_port_set(EVENT_SIGNALING * const event,
3475                                     const char * const remote_port);
3476 /**************************************************************************//**
3477  * Set the Vendor module property of the Signaling event.
3478  *
3479  * @note  The property is treated as immutable: it is only valid to call
3480  *        the setter once.  However, we don't assert if the caller tries to
3481  *        overwrite, just ignoring the update instead.
3482  *
3483  * @param event         Pointer to the Signaling event.
3484  * @param modulename    The module name to be set. ASCIIZ string. The caller
3485  *                      does not need to preserve the value once the function
3486  *                      returns.
3487  *****************************************************************************/
3488 void evel_signaling_vnfmodule_name_set(EVENT_SIGNALING * const event,
3489                                     const char * const module_name);
3490 /**************************************************************************//**
3491  * Set the Vendor module property of the Signaling event.
3492  *
3493  * @note  The property is treated as immutable: it is only valid to call
3494  *        the setter once.  However, we don't assert if the caller tries to
3495  *        overwrite, just ignoring the update instead.
3496  *
3497  * @param event         Pointer to the Signaling event.
3498  * @param vnfname       The Virtual Network function to be set. ASCIIZ string.
3499  *                      The caller does not need to preserve the value once
3500  *                      the function returns.
3501  *****************************************************************************/
3502 void evel_signaling_vnfname_set(EVENT_SIGNALING * const event,
3503                                     const char * const vnfname);
3504
3505 /**************************************************************************//**
3506  * Set the Compressed SIP property of the Signaling event.
3507  *
3508  * @note  The property is treated as immutable: it is only valid to call
3509  *        the setter once.  However, we don't assert if the caller tries to
3510  *        overwrite, just ignoring the update instead.
3511  *
3512  * @param event         Pointer to the Signaling event.
3513  * @param compressed_sip
3514  *                      The Compressed SIP to be set. ASCIIZ string. The caller
3515  *                      does not need to preserve the value once the function
3516  *                      returns.
3517  *****************************************************************************/
3518 void evel_signaling_compressed_sip_set(EVENT_SIGNALING * const event,
3519                                        const char * const compressed_sip);
3520
3521 /**************************************************************************//**
3522  * Set the Summary SIP property of the Signaling event.
3523  *
3524  * @note  The property is treated as immutable: it is only valid to call
3525  *        the setter once.  However, we don't assert if the caller tries to
3526  *        overwrite, just ignoring the update instead.
3527  *
3528  * @param event         Pointer to the Signaling event.
3529  * @param summary_sip   The Summary SIP to be set. ASCIIZ string. The caller
3530  *                      does not need to preserve the value once the function
3531  *                      returns.
3532  *****************************************************************************/
3533 void evel_signaling_summary_sip_set(EVENT_SIGNALING * const event,
3534                                     const char * const summary_sip);
3535
3536
3537 /*****************************************************************************/
3538 /*****************************************************************************/
3539 /*                                                                           */
3540 /*   STATE CHANGE                                                            */
3541 /*                                                                           */
3542 /*****************************************************************************/
3543 /*****************************************************************************/
3544
3545 /**************************************************************************//**
3546  * Create a new State Change event.
3547  *
3548  * @note    The mandatory fields on the Syslog must be supplied to this factory
3549  *          function and are immutable once set.  Optional fields have explicit
3550  *          setter functions, but again values may only be set once so that the
3551  *          Syslog has immutable properties.
3552  *
3553  * @param new_state     The new state of the reporting entity.
3554  * @param old_state     The old state of the reporting entity.
3555  * @param interface     The card or port name of the reporting entity.
3556  *
3557  * @returns pointer to the newly manufactured ::EVENT_STATE_CHANGE.  If the
3558  *          event is not used it must be released using
3559  *          ::evel_free_state_change
3560  * @retval  NULL  Failed to create the event.
3561  *****************************************************************************/
3562 EVENT_STATE_CHANGE * evel_new_state_change(const EVEL_ENTITY_STATE new_state,
3563                                            const EVEL_ENTITY_STATE old_state,
3564                                            const char * const interface);
3565
3566 /**************************************************************************//**
3567  * Free a State Change.
3568  *
3569  * Free off the State Change supplied.  Will free all the contained allocated
3570  * memory.
3571  *
3572  * @note It does not free the State Change itself, since that may be part of a
3573  * larger structure.
3574  *****************************************************************************/
3575 void evel_free_state_change(EVENT_STATE_CHANGE * const state_change);
3576
3577 /**************************************************************************//**
3578  * Set the Event Type property of the State Change.
3579  *
3580  * @note  The property is treated as immutable: it is only valid to call
3581  *        the setter once.  However, we don't assert if the caller tries to
3582  *        overwrite, just ignoring the update instead.
3583  *
3584  * @param state_change  Pointer to the ::EVENT_STATE_CHANGE.
3585  * @param type          The Event Type to be set. ASCIIZ string. The caller
3586  *                      does not need to preserve the value once the function
3587  *                      returns.
3588  *****************************************************************************/
3589 void evel_state_change_type_set(EVENT_STATE_CHANGE * const state_change,
3590                                 const char * const type);
3591
3592 /**************************************************************************//**
3593  * Add an additional field name/value pair to the State Change.
3594  *
3595  * The name and value are null delimited ASCII strings.  The library takes
3596  * a copy so the caller does not have to preserve values after the function
3597  * returns.
3598  *
3599  * @param state_change  Pointer to the ::EVENT_STATE_CHANGE.
3600  * @param name          ASCIIZ string with the attribute's name.  The caller
3601  *                      does not need to preserve the value once the function
3602  *                      returns.
3603  * @param value         ASCIIZ string with the attribute's value.  The caller
3604  *                      does not need to preserve the value once the function
3605  *                      returns.
3606  *****************************************************************************/
3607 void evel_state_change_addl_field_add(EVENT_STATE_CHANGE * const state_change,
3608                                       const char * const name,
3609                                       const char * const value);
3610
3611 /*****************************************************************************/
3612 /*****************************************************************************/
3613 /*                                                                           */
3614 /*   SYSLOG                                                                  */
3615 /*                                                                           */
3616 /*****************************************************************************/
3617 /*****************************************************************************/
3618
3619 /**************************************************************************//**
3620  * Create a new syslog event.
3621  *
3622  * @note    The mandatory fields on the Syslog must be supplied to this factory
3623  *          function and are immutable once set.  Optional fields have explicit
3624  *          setter functions, but again values may only be set once so that the
3625  *          Syslog has immutable properties.
3626  *
3627  * @param   event_source_type
3628  * @param   syslog_msg
3629  * @param   syslog_tag
3630  * @param   version
3631  *
3632  * @returns pointer to the newly manufactured ::EVENT_SYSLOG.  If the event is
3633  *          not used it must be released using ::evel_free_syslog
3634  * @retval  NULL  Failed to create the event.
3635  *****************************************************************************/
3636 EVENT_SYSLOG * evel_new_syslog(EVEL_SOURCE_TYPES event_source_type,
3637                                const char * const syslog_msg,
3638                                const char * const syslog_tag);
3639
3640 /**************************************************************************//**
3641  * Set the Event Type property of the Syslog.
3642  *
3643  * @note  The property is treated as immutable: it is only valid to call
3644  *        the setter once.  However, we don't assert if the caller tries to
3645  *        overwrite, just ignoring the update instead.
3646  *
3647  * @param syslog      Pointer to the syslog.
3648  * @param type        The Event Type to be set. ASCIIZ string. The caller
3649  *                    does not need to preserve the value once the function
3650  *                    returns.
3651  *****************************************************************************/
3652 void evel_syslog_type_set(EVENT_SYSLOG * syslog,
3653                           const char * const type);
3654
3655 /**************************************************************************//**
3656  * Free a Syslog.
3657  *
3658  * Free off the Syslog supplied.  Will free all the contained allocated memory.
3659  *
3660  * @note It does not free the Syslog itself, since that may be part of a
3661  * larger structure.
3662  *****************************************************************************/
3663 void evel_free_syslog(EVENT_SYSLOG * event);
3664
3665 /**************************************************************************//**
3666  * Add an additional field name/value pair to the Syslog.
3667  *
3668  * The name and value are null delimited ASCII strings.  The library takes
3669  * a copy so the caller does not have to preserve values after the function
3670  * returns.
3671  *
3672  * @param syslog    Pointer to the syslog.
3673  * @param name      ASCIIZ string with the attribute's name.  The caller
3674  *                  does not need to preserve the value once the function
3675  *                  returns.
3676  * @param value     ASCIIZ string with the attribute's value.  The caller
3677  *                  does not need to preserve the value once the function
3678  *                  returns.
3679  *****************************************************************************/
3680 void evel_syslog_addl_field_add(EVENT_SYSLOG * syslog,
3681                                 char * name,
3682                                 char * value);
3683
3684 /**************************************************************************//**
3685  * Set the Event Source Host property of the Syslog.
3686  *
3687  * @note  The property is treated as immutable: it is only valid to call
3688  *        the setter once.  However, we don't assert if the caller tries to
3689  *        overwrite, just ignoring the update instead.
3690  *
3691  * @param syslog      Pointer to the Syslog.
3692  * @param host        The Event Source Host to be set.  ASCIIZ string. The
3693  *                    caller does not need to preserve the value once the
3694  *                    function returns.
3695  *****************************************************************************/
3696 void evel_syslog_event_source_host_set(EVENT_SYSLOG * syslog,
3697                                        const char * const host);
3698
3699 /**************************************************************************//**
3700  * Set the Syslog Facility property of the Syslog.
3701  *
3702  * @note  The property is treated as immutable: it is only valid to call
3703  *        the setter once.  However, we don't assert if the caller tries to
3704  *        overwrite, just ignoring the update instead.
3705  *
3706  * @param syslog      Pointer to the Syslog.
3707  * @param facility    The Syslog Facility to be set.  ASCIIZ string. The caller
3708  *                    does not need to preserve the value once the function
3709  *                    returns.
3710  *****************************************************************************/
3711 void evel_syslog_facility_set(EVENT_SYSLOG * syslog,
3712                               EVEL_SYSLOG_FACILITIES facility);
3713
3714 /**************************************************************************//**
3715  * Set the Process property of the Syslog.
3716  *
3717  * @note  The property is treated as immutable: it is only valid to call
3718  *        the setter once.  However, we don't assert if the caller tries to
3719  *        overwrite, just ignoring the update instead.
3720  *
3721  * @param syslog      Pointer to the Syslog.
3722  * @param proc        The Process to be set.  ASCIIZ string. The caller does
3723  *                    not need to preserve the value once the function returns.
3724  *****************************************************************************/
3725 void evel_syslog_proc_set(EVENT_SYSLOG * syslog, const char * const proc);
3726
3727 /**************************************************************************//**
3728  * Set the Process ID property of the Syslog.
3729  *
3730  * @note  The property is treated as immutable: it is only valid to call
3731  *        the setter once.  However, we don't assert if the caller tries to
3732  *        overwrite, just ignoring the update instead.
3733  *
3734  * @param syslog      Pointer to the Syslog.
3735  * @param proc_id     The Process ID to be set.
3736  *****************************************************************************/
3737 void evel_syslog_proc_id_set(EVENT_SYSLOG * syslog, int proc_id);
3738
3739 /**************************************************************************//**
3740  * Set the Version property of the Syslog.
3741  *
3742  * @note  The property is treated as immutable: it is only valid to call
3743  *        the setter once.  However, we don't assert if the caller tries to
3744  *        overwrite, just ignoring the update instead.
3745  *
3746  * @param syslog      Pointer to the Syslog.
3747  * @param version     The Version to be set.
3748  *****************************************************************************/
3749 void evel_syslog_version_set(EVENT_SYSLOG * syslog, int version);
3750
3751 /**************************************************************************//**
3752  * Set the Structured Data property of the Syslog.
3753  *
3754  * @note  The property is treated as immutable: it is only valid to call
3755  *        the setter once.  However, we don't assert if the caller tries to
3756  *        overwrite, just ignoring the update instead.
3757  *
3758  * @param syslog      Pointer to the Syslog.
3759  * @param s_data      The Structured Data to be set.  ASCIIZ string. The caller
3760  *                    does not need to preserve the value once the function
3761  *                    returns.
3762  *****************************************************************************/
3763 void evel_syslog_s_data_set(EVENT_SYSLOG * syslog, const char * const s_data);
3764
3765 /**************************************************************************//**
3766  * Set the Structured SDID property of the Syslog.
3767  *
3768  * @note  The property is treated as immutable: it is only valid to call
3769  *        the setter once.  However, we don't assert if the caller tries to
3770  *        overwrite, just ignoring the update instead.
3771  *
3772  * @param syslog     Pointer to the Syslog.
3773  * @param sdid     The Structured Data to be set. ASCIIZ string. name@number
3774  *                 Caller does not need to preserve the value once the function
3775  *                   returns.
3776  *****************************************************************************/
3777 void evel_syslog_sdid_set(EVENT_SYSLOG * syslog, const char * const sdid);
3778
3779 /**************************************************************************//**
3780  * Set the Structured Severity property of the Syslog.
3781  *
3782  * @note  The property is treated as immutable: it is only valid to call
3783  *        the setter once.  However, we don't assert if the caller tries to
3784  *        overwrite, just ignoring the update instead.
3785  *
3786  * @param syslog     Pointer to the Syslog.
3787  * @param sdid     The Structured Data to be set. ASCIIZ string. 
3788  *                 Caller does not need to preserve the value once the function
3789  *                   returns.
3790  *****************************************************************************/
3791 void evel_syslog_severity_set(EVENT_SYSLOG * syslog, const char * const severty);
3792
3793
3794 /*****************************************************************************/
3795 /*****************************************************************************/
3796 /*                                                                           */
3797 /*   OTHER                                                                   */
3798 /*                                                                           */
3799 /*****************************************************************************/
3800 /*****************************************************************************/
3801
3802 /**************************************************************************//**
3803  * Create a new other event.
3804  *
3805  *
3806  * @returns pointer to the newly manufactured ::EVENT_OTHER.  If the event is
3807  *          not used it must be released using ::evel_free_other.
3808  * @retval  NULL  Failed to create the event.
3809  *****************************************************************************/
3810 EVENT_OTHER * evel_new_other(void);
3811
3812 /**************************************************************************//**
3813  * Free an Other.
3814  *
3815  * Free off the Other supplied.  Will free all the contained allocated memory.
3816  *
3817  * @note It does not free the Other itself, since that may be part of a
3818  * larger structure.
3819  *****************************************************************************/
3820 void evel_free_other(EVENT_OTHER * event);
3821
3822 /**************************************************************************//**
3823  * Set the Event Type property of the Other.
3824  *
3825  * @note  The property is treated as immutable: it is only valid to call
3826  *        the setter once.  However, we don't assert if the caller tries to
3827  *        overwrite, just ignoring the update instead.
3828  *
3829  * @param other       Pointer to the Other.
3830  * @param type        The Event Type to be set. ASCIIZ string. The caller
3831  *                    does not need to preserve the value once the function
3832  *                    returns.
3833  *****************************************************************************/
3834 void evel_other_type_set(EVENT_OTHER * other,
3835                          const char * const type);
3836
3837 /**************************************************************************//**
3838  * Add a value name/value pair to the Other.
3839  *
3840  * The name and value are null delimited ASCII strings.  The library takes
3841  * a copy so the caller does not have to preserve values after the function
3842  * returns.
3843  *
3844  * @param other     Pointer to the Other.
3845  * @param name      ASCIIZ string with the attribute's name.
3846  * @param value     ASCIIZ string with the attribute's value.
3847  *****************************************************************************/
3848 void evel_other_field_add(EVENT_OTHER * other,
3849                           char * name,
3850                           char * value);
3851
3852 /*****************************************************************************/
3853 /*****************************************************************************/
3854 /*                                                                           */
3855 /*   THROTTLING                                                              */
3856 /*                                                                           */
3857 /*****************************************************************************/
3858 /*****************************************************************************/
3859
3860 /**************************************************************************//**
3861  * Return the current measurement interval provided by the Event Listener.
3862  *
3863  * @returns The current measurement interval
3864  * @retval  EVEL_MEASUREMENT_INTERVAL_UKNOWN (0) - interval has not been
3865  *          specified
3866  *****************************************************************************/
3867 int evel_get_measurement_interval();
3868
3869 /*****************************************************************************/
3870 /* Supported Report version.                                                 */
3871 /*****************************************************************************/
3872 #define EVEL_VOICEQ_MAJOR_VERSION 1
3873 #define EVEL_VOICEQ_MINOR_VERSION 1
3874
3875 /**************************************************************************//**
3876 * Voice QUality.
3877 * JSON equivalent field: voiceQualityFields
3878 *****************************************************************************/
3879
3880 typedef struct event_voiceQuality {
3881         /***************************************************************************/
3882         /* Header and version                                                      */
3883         /***************************************************************************/
3884         EVENT_HEADER header;
3885         int major_version;
3886         int minor_version;
3887
3888         /***************************************************************************/
3889         /* Mandatory fields                                                        */
3890         /***************************************************************************/
3891         
3892         char *calleeSideCodec;
3893         char *callerSideCodec;
3894         char *correlator;
3895         char *midCallRtcp;
3896         VENDOR_VNFNAME_FIELD vendorVnfNameFields;
3897
3898         /***************************************************************************/
3899         /* Optional fields                                                         */
3900         /***************************************************************************/
3901         EVEL_OPTION_STRING phoneNumber;
3902         DLIST additionalInformation;
3903         DLIST endOfCallVqmSummaries;
3904
3905 } EVENT_VOICE_QUALITY;
3906
3907 /**************************************************************************//**
3908  * End of Call Voice Quality Metrices
3909  * JSON equivalent field: endOfCallVqmSummaries
3910  *****************************************************************************/
3911 typedef struct end_of_call_vqm_summaries {
3912         /***************************************************************************/
3913         /* Mandatory fields                                                        */
3914         /***************************************************************************/
3915         char* adjacencyName;
3916         char* endpointDescription;
3917
3918         /***************************************************************************/
3919         /* Optional fields                                                         */
3920         /***************************************************************************/
3921         EVEL_OPTION_INT endpointJitter;
3922         EVEL_OPTION_INT endpointRtpOctetsDiscarded;
3923         EVEL_OPTION_INT endpointRtpOctetsReceived;
3924         EVEL_OPTION_INT endpointRtpOctetsSent;
3925         EVEL_OPTION_INT endpointRtpPacketsDiscarded;
3926         EVEL_OPTION_INT endpointRtpPacketsReceived;
3927         EVEL_OPTION_INT endpointRtpPacketsSent;
3928         EVEL_OPTION_INT localJitter;
3929         EVEL_OPTION_INT localRtpOctetsDiscarded;
3930         EVEL_OPTION_INT localRtpOctetsReceived;
3931         EVEL_OPTION_INT localRtpOctetsSent;
3932         EVEL_OPTION_INT localRtpPacketsDiscarded;
3933         EVEL_OPTION_INT localRtpPacketsReceived;
3934         EVEL_OPTION_INT localRtpPacketsSent;
3935         EVEL_OPTION_INT mosCqe;
3936         EVEL_OPTION_INT packetsLost;
3937         EVEL_OPTION_INT packetLossPercent;
3938         EVEL_OPTION_INT rFactor;
3939         EVEL_OPTION_INT roundTripDelay;
3940
3941 } END_OF_CALL_VOICE_QUALITY_METRICS;
3942
3943 /**************************************************************************//**
3944  * Voice Quality Additional Info.
3945  * JSON equivalent field: additionalInformation
3946  *****************************************************************************/
3947 typedef struct voice_quality_additional_info {
3948   char * name;
3949   char * value;
3950 } VOICE_QUALITY_ADDL_INFO;
3951
3952 /**************************************************************************//**
3953  * Create a new voice quality event.
3954  *
3955  * @note    The mandatory fields on the Voice Quality must be supplied to this 
3956  *          factory function and are immutable once set.  Optional fields have 
3957  *          explicit setter functions, but again values may only be set once 
3958  *          so that the Voice Quality has immutable properties.
3959  * @param   calleeSideCodec                     Callee codec for the call.
3960  * @param   callerSideCodec                     Caller codec for the call.
3961  * @param   correlator                          Constant across all events on this call.
3962  * @param   midCallRtcp                         Base64 encoding of the binary RTCP data
3963  *                                                                      (excluding Eth/IP/UDP headers).
3964  * @param   vendorVnfNameFields         Vendor, VNF and VfModule names.
3965  * @returns pointer to the newly manufactured ::EVENT_VOICE_QUALITY.  If the 
3966  *          event is not used (i.e. posted) it must be released using
3967                         ::evel_free_voice_quality.
3968  * @retval  NULL  Failed to create the event.
3969  *****************************************************************************/
3970 EVENT_VOICE_QUALITY * evel_new_voice_quality(const char * const calleeSideCodec,
3971         const char * const callerSideCodec, const char * const correlator,
3972         const char * const midCallRtcp, const char * const vendorVnfNameFields);
3973
3974 /**************************************************************************//**
3975  * Set the Callee side codec for Call for domain Voice Quality
3976  *
3977  * @note  The property is treated as immutable: it is only valid to call
3978  *        the setter once.  However, we don't assert if the caller tries to
3979  *        overwrite, just ignoring the update instead.
3980  *
3981  * @param voiceQuality                          Pointer to the Voice Quality Event.
3982  * @param calleeCodecForCall            The Callee Side Codec to be set.  ASCIIZ 
3983  *                                                                      string. The caller does not need to 
3984  *                                                                      preserve the value once the function
3985  *                                                                      returns.
3986  *****************************************************************************/
3987 void evel_voice_quality_callee_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
3988                                                                         const char * const calleeCodecForCall);
3989
3990 /**************************************************************************//**
3991  * Set the Caller side codec for Call for domain Voice Quality
3992  *
3993  * @note  The property is treated as immutable: it is only valid to call
3994  *        the setter once.  However, we don't assert if the caller tries to
3995  *        overwrite, just ignoring the update instead.
3996  *
3997  * @param voiceQuality                          Pointer to the Voice Quality Event.
3998  * @param callerCodecForCall            The Caller Side Codec to be set.  ASCIIZ 
3999  *                                                                      string. The caller does not need to 
4000  *                                                                      preserve the value once the function
4001  *                                                                      returns.
4002  *****************************************************************************/
4003 void evel_voice_quality_caller_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
4004                                                                         const char * const callerCodecForCall);
4005
4006 /**************************************************************************//**
4007  * Set the correlator for domain Voice Quality
4008  *
4009  * @note  The property is treated as immutable: it is only valid to call
4010  *        the setter once.  However, we don't assert if the caller tries to
4011  *        overwrite, just ignoring the update instead.
4012  *
4013  * @param voiceQuality                          Pointer to the Voice Quality Event.
4014  * @param correlator                            The correlator value to be set.  ASCIIZ 
4015  *                                                                      string. The caller does not need to 
4016  *                                                                      preserve the value once the function
4017  *                                                                      returns.
4018  *****************************************************************************/
4019 void evel_voice_quality_correlator_set(EVENT_VOICE_QUALITY * voiceQuality,
4020                                                                         const char * const vCorrelator);
4021
4022 /**************************************************************************//**
4023  * Set the RTCP Call Data for domain Voice Quality
4024  *
4025  * @note  The property is treated as immutable: it is only valid to call
4026  *        the setter once.  However, we don't assert if the caller tries to
4027  *        overwrite, just ignoring the update instead.
4028  *
4029  * @param voiceQuality                          Pointer to the Voice Quality Event.
4030  * @param rtcpCallData                  The RTCP Call Data to be set.  ASCIIZ 
4031  *                                                                      string. The caller does not need to 
4032  *                                                                      preserve the value once the function
4033  *                                                                      returns.
4034  *****************************************************************************/
4035 void evel_voice_quality_rtcp_data_set(EVENT_VOICE_QUALITY * voiceQuality,
4036                                                                         const char * const rtcpCallData);
4037
4038 /**************************************************************************//**
4039  * Set the Vendor VNF Name fields for domain Voice Quality
4040  *
4041  * @note  The property is treated as immutable: it is only valid to call
4042  *        the setter once.  However, we don't assert if the caller tries to
4043  *        overwrite, just ignoring the update instead.
4044  *
4045  * @param voiceQuality                          Pointer to the Voice Quality Event.
4046  * @param nameFields                    The Vendor, VNF and VfModule names to be set.   
4047  *                                                                      ASCIIZ string. The caller does not need to 
4048  *                                                                      preserve the value once the function
4049  *                                                                      returns.
4050  *****************************************************************************/
4051 void evel_voice_quality_name_fields_set(EVENT_VOICE_QUALITY * voiceQuality,
4052                                                                         const char * const nameFields);
4053
4054 /**************************************************************************//**
4055  * Add an End of Call Voice Quality Metrices
4056
4057  * The adjacencyName and endpointDescription is null delimited ASCII string.  
4058  * The library takes a copy so the caller does not have to preserve values
4059  * after the function returns.
4060  *
4061  * @param voiceQuality     Pointer to the measurement.
4062  * @param adjacencyName                                         Adjacency name
4063  * @param endpointDescription                           Enumeration: ‘Caller’, ‘Callee’.
4064  * @param endpointJitter                                        Endpoint jitter
4065  * @param endpointRtpOctetsDiscarded        Endpoint RTP octets discarded.
4066  * @param endpointRtpOctetsReceived                     Endpoint RTP octets received.
4067  * @param endpointRtpOctetsSent                         Endpoint RTP octets sent
4068  * @param endpointRtpPacketsDiscarded           Endpoint RTP packets discarded.
4069  * @param endpointRtpPacketsReceived            Endpoint RTP packets received.
4070  * @param endpointRtpPacketsSent                        Endpoint RTP packets sent.
4071  * @param localJitter                                           Local jitter.
4072  * @param localRtpOctetsDiscarded                       Local RTP octets discarded.
4073  * @param localRtpOctetsReceived                        Local RTP octets received.
4074  * @param localRtpOctetsSent                            Local RTP octets sent.
4075  * @param localRtpPacketsDiscarded                      Local RTP packets discarded.
4076  * @param localRtpPacketsReceived                       Local RTP packets received.
4077  * @param localRtpPacketsSent                           Local RTP packets sent.
4078  * @param mosCqe                                                        Decimal range from 1 to 5
4079  *                                                                                      (1 decimal place)
4080  * @param packetsLost                                           No      Packets lost
4081  * @param packetLossPercent                                     Calculated percentage packet loss 
4082  * @param rFactor                                                       rFactor from 0 to 100
4083  * @param roundTripDelay                                        Round trip delay in milliseconds
4084  *****************************************************************************/
4085 void evel_voice_quality_end_metrics_add(EVENT_VOICE_QUALITY * voiceQuality,
4086         const char * adjacencyName, EVEL_SERVICE_ENDPOINT_DESC endpointDescription,
4087         int endpointJitter,
4088         int endpointRtpOctetsDiscarded,
4089         int endpointRtpOctetsReceived,
4090         int endpointRtpOctetsSent,
4091         int endpointRtpPacketsDiscarded,
4092         int endpointRtpPacketsReceived,
4093         int endpointRtpPacketsSent,
4094         int localJitter,
4095         int localRtpOctetsDiscarded,
4096         int localRtpOctetsReceived,
4097         int localRtpOctetsSent,
4098         int localRtpPacketsDiscarded,
4099         int localRtpPacketsReceived,
4100         int localRtpPacketsSent,
4101         int mosCqe,
4102         int packetsLost,
4103         int packetLossPercent,
4104         int rFactor,
4105         int roundTripDelay);
4106
4107 /**************************************************************************//**
4108  * Free a Voice Quality.
4109  *
4110  * Free off the Voce Quality supplied.  Will free all the contained allocated
4111  * memory.
4112  *
4113  * @note It does not free the Voice Quality itself, since that may be part of a
4114  * larger structure.
4115  *****************************************************************************/
4116 void evel_free_voice_quality(EVENT_VOICE_QUALITY * voiceQuality);
4117
4118 /**************************************************************************//**
4119  * Add an additional value name/value pair to the Voice Quality.
4120  *
4121  * The name and value are null delimited ASCII strings.  The library takes
4122  * a copy so the caller does not have to preserve values after the function
4123  * returns.
4124  *
4125  * @param fault     Pointer to the fault.
4126  * @param name      ASCIIZ string with the attribute's name.  The caller
4127  *                  does not need to preserve the value once the function
4128  *                  returns.
4129  * @param value     ASCIIZ string with the attribute's value.  The caller
4130  *                  does not need to preserve the value once the function
4131  *                  returns.
4132  *****************************************************************************/
4133 void evel_voice_quality_addl_info_add(EVENT_VOICE_QUALITY * voiceQuality, char * name, char * value);
4134
4135
4136 /*****************************************************************************/
4137 /*****************************************************************************/
4138 /*                                                                           */
4139 /*   LOGGING                                                                 */
4140 /*                                                                           */
4141 /*****************************************************************************/
4142 /*****************************************************************************/
4143
4144 /*****************************************************************************/
4145 /* Debug macros.                                                             */
4146 /*****************************************************************************/
4147 #define EVEL_DEBUG(FMT, ...)   log_debug(EVEL_LOG_DEBUG, (FMT), ##__VA_ARGS__)
4148 #define EVEL_INFO(FMT, ...)    log_debug(EVEL_LOG_INFO, (FMT), ##__VA_ARGS__)
4149 #define EVEL_SPAMMY(FMT, ...)  log_debug(EVEL_LOG_SPAMMY, (FMT), ##__VA_ARGS__)
4150 #define EVEL_ERROR(FMT, ...)   log_debug(EVEL_LOG_ERROR, "ERROR: " FMT, \
4151                                          ##__VA_ARGS__)
4152 #define EVEL_ENTER()                                                          \
4153         {                                                                     \
4154           log_debug(EVEL_LOG_DEBUG, "Enter %s {", __FUNCTION__);              \
4155           debug_indent += 2;                                                  \
4156         }
4157 #define EVEL_EXIT()                                                           \
4158         {                                                                     \
4159           debug_indent -= 2;                                                  \
4160           log_debug(EVEL_LOG_DEBUG, "Exit %s }", __FUNCTION__);               \
4161         }
4162
4163 #define INDENT_SEPARATORS                                                     \
4164         "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "
4165
4166 extern EVEL_LOG_LEVELS debug_level;
4167 extern int debug_indent;
4168 extern FILE * fout;
4169
4170 #define EVEL_DEBUG_ON() ((debug_level) >= EVEL_LOG_DEBUG)
4171
4172 /**************************************************************************//**
4173  * Initialize logging
4174  *
4175  * @param[in] level  The debugging level - one of ::EVEL_LOG_LEVELS.
4176  * @param[in] ident  The identifier for our logs.
4177  *****************************************************************************/
4178 void log_initialize(EVEL_LOG_LEVELS level, const char * ident);
4179
4180 /**************************************************************************//**
4181  * Log debug information
4182  *
4183  * Logs debugging information in a platform independent manner.
4184  *
4185  * @param[in] level   The debugging level - one of ::EVEL_LOG_LEVELS.
4186  * @param[in] format  Log formatting string in printf format.
4187  * @param[in] ...     Variable argument list.
4188  *****************************************************************************/
4189 void log_debug(EVEL_LOG_LEVELS level, char * format, ...);
4190
4191 /***************************************************************************//*
4192  * Store the formatted string into the static error string and log the error.
4193  *
4194  * @param format  Error string in standard printf format.
4195  * @param ...     Variable parameters to be substituted into the format string.
4196  *****************************************************************************/
4197 void log_error_state(char * format, ...);
4198
4199 #ifdef __cplusplus
4200 }
4201 #endif
4202
4203 #endif
4204