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