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