119fa793ef95c15c10ceb244b5b5590ff2745c34
[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           524288
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   cert_file_path     Path to client certificate file
1405  * @param   key_file_path      Path to client key file
1406  * @param   ca_info            Path to CA info
1407  * @param   ca_file_path       Path to CA file
1408  * @param   verify_peer        SSL verification of peer 0 or 1
1409  * @param   verify_host        SSL verification of host 0 or 1
1410  * @param   username  Username for Basic Authentication of requests.
1411  * @param   password  Password for Basic Authentication of requests.
1412  * @param   source_ip The ip of node we represent.(NULL for default ip)
1413  * @param   source_type The kind of node we represent.
1414  * @param   role    The role this node undertakes.
1415  * @param   verbosity  0 for normal operation, positive values for chattier
1416  *                     logs.
1417  *
1418  * @returns Status code
1419  * @retval  EVEL_SUCCESS      On success
1420  * @retval  ::EVEL_ERR_CODES  On failure.
1421  *****************************************************************************/
1422 EVEL_ERR_CODES evel_initialize(const char * const fqdn,
1423                                int port,
1424                                const char * const path,
1425                                const char * const topic,
1426                                int secure,
1427                                const char * const cert_file_path,
1428                                const char * const key_file_path,
1429                                const char * const ca_info,
1430                                const char * const ca_file_path,
1431                                long verify_peer,
1432                                long verify_host,
1433                                const char * const username,
1434                                const char * const password,
1435                                const char * const source_ip,
1436                                EVEL_SOURCE_TYPES source_type,
1437                                const char * const role,
1438                                int verbosity
1439                                );
1440
1441 /**************************************************************************//**
1442  * Clean up the EVEL library.
1443  *
1444  * @note that at present don't expect Init/Term cycling not to leak memory!
1445  *
1446  * @returns Status code
1447  * @retval  EVEL_SUCCESS On success
1448  * @retval  "One of ::EVEL_ERR_CODES" On failure.
1449  *****************************************************************************/
1450 EVEL_ERR_CODES evel_terminate(void);
1451
1452 EVEL_ERR_CODES evel_post_event(EVENT_HEADER * event);
1453 const char * evel_error_string(void);
1454
1455
1456 /**************************************************************************//**
1457  * Free an event.
1458  *
1459  * Free off the event supplied.  Will free all the contained allocated memory.
1460  *
1461  * @note  It is safe to free a NULL pointer.
1462  *****************************************************************************/
1463 void evel_free_event(void * event);
1464
1465 /**************************************************************************//**
1466  * Encode the event as a JSON event object according to AT&T's schema.
1467  *
1468  * @param json      Pointer to where to store the JSON encoded data.
1469  * @param mode      Event mode or Batch mode
1470  * @param max_size  Size of storage available in json_body.
1471  * @param event     Pointer to the ::EVENT_HEADER to encode.
1472  * @returns Number of bytes actually written.
1473  *****************************************************************************/
1474 int evel_json_encode_event(char * json,
1475                            int max_size,
1476                            EVENT_HEADER * event);
1477 int evel_json_encode_batch_event(char * json,
1478                            int max_size,
1479                            EVENT_HEADER * event);
1480 /**************************************************************************//**
1481  * Initialize an event instance id.
1482  *
1483  * @param vfield        Pointer to the event vnfname field being initialized.
1484  * @param vendor_id     The vendor id to encode in the event instance id.
1485  * @param event_id      The event id to encode in the event instance id.
1486  *****************************************************************************/
1487 void evel_init_vendor_field(VENDOR_VNFNAME_FIELD * const vfield,
1488                                  const char * const vendor_name);
1489
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_module_set(VENDOR_VNFNAME_FIELD * const vfield,
1503                                     const char * const module_name);
1504 /**************************************************************************//**
1505  * Set the Vendor module property of the Vendor.
1506  *
1507  * @note  The property is treated as immutable: it is only valid to call
1508  *        the setter once.  However, we don't assert if the caller tries to
1509  *        overwrite, just ignoring the update instead.
1510  *
1511  * @param vfield        Pointer to the Vendor field.
1512  * @param module_name   The module name to be set. ASCIIZ string. The caller
1513  *                      does not need to preserve the value once the function
1514  *                      returns.
1515  *****************************************************************************/
1516 void evel_vendor_field_vnfname_set(VENDOR_VNFNAME_FIELD * const vfield,
1517                                     const char * const vnfname);
1518 /**************************************************************************//**
1519  * Free an event instance id.
1520  *
1521  * @param vfield   Pointer to the event vnfname_field being freed.
1522  *****************************************************************************/
1523 void evel_free_event_vendor_field(VENDOR_VNFNAME_FIELD * const vfield);
1524
1525 /**************************************************************************//**
1526  * Callback function to provide returned data.
1527  *
1528  * Copy data into the supplied buffer, write_callback::ptr, checking size
1529  * limits.
1530  *
1531  * @returns   Number of bytes placed into write_callback::ptr. 0 for EOF.
1532  *****************************************************************************/
1533 size_t evel_write_callback(void *contents,
1534                            size_t size,
1535                            size_t nmemb,
1536                            void *userp);
1537
1538 /*****************************************************************************/
1539 /*****************************************************************************/
1540 /*                                                                           */
1541 /*   HEARTBEAT - (includes common header, too)                               */
1542 /*                                                                           */
1543 /*****************************************************************************/
1544 /*****************************************************************************/
1545
1546 /**************************************************************************//**
1547  * Create a new heartbeat event.
1548  *
1549  * @note that the heartbeat is just a "naked" commonEventHeader!
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(void);
1556
1557 /**************************************************************************//**
1558  * Create a new heartbeat event of given name and type.
1559  *
1560  * @note that the heartbeat is just a "naked" commonEventHeader!
1561  *
1562  * @param event_name    Unique Event Name: {DomainAbbreviation}_{AsdcModel or ApplicationPlatform}_{DescriptionOfInfoBeingConveyed}
1563  * @param event_id    A universal identifier of the event for: troubleshooting, cross-referencing of alarms for alarm correlation, offline log analysis, etc
1564  *
1565  * @returns pointer to the newly manufactured ::EVENT_HEADER.  If the event is
1566  *          not used it must be released using ::evel_free_event
1567  * @retval  NULL  Failed to create the event.
1568  *****************************************************************************/
1569 EVENT_HEADER * evel_new_heartbeat_nameid(const char* ev_name, const char *ev_id);
1570
1571
1572 /**************************************************************************//**
1573  * Free an event header.
1574  *
1575  * Free off the event header supplied.  Will free all the contained allocated
1576  * memory.
1577  *
1578  * @note It does not free the header itself, since that may be part of a
1579  * larger structure.
1580  *****************************************************************************/
1581 void evel_free_header(EVENT_HEADER * const event);
1582
1583 /**************************************************************************//**
1584  * Initialize a newly created event header.
1585  *
1586  * @param header  Pointer to the header being initialized.
1587  *****************************************************************************/
1588 void evel_init_header(EVENT_HEADER * const header,const char *const eventname);
1589
1590 /**************************************************************************//**
1591  * Set the Event Type property of the event header.
1592  *
1593  * @param header        Pointer to the ::EVENT_HEADER.
1594  * @param type          The Event Type to be set. ASCIIZ string. The caller
1595  *                      does not need to preserve the value once the function
1596  *                      returns.
1597  *****************************************************************************/
1598 void evel_header_type_set(EVENT_HEADER * const header,
1599                           const char * const type);
1600
1601 /**************************************************************************//**
1602  * Set the Start Epoch property of the event header.
1603  *
1604  * @note The Start Epoch defaults to the time of event creation.
1605  *
1606  * @param header        Pointer to the ::EVENT_HEADER.
1607  * @param start_epoch_microsec
1608  *                      The start epoch to set, in microseconds.
1609  *****************************************************************************/
1610 void evel_start_epoch_set(EVENT_HEADER * const header,
1611                           const unsigned long long start_epoch_microsec);
1612
1613 /**************************************************************************//**
1614  * Set the Last Epoch property of the event header.
1615  *
1616  * @note The Last Epoch defaults to the time of event creation.
1617  *
1618  * @param header        Pointer to the ::EVENT_HEADER.
1619  * @param last_epoch_microsec
1620  *                      The last epoch to set, in microseconds.
1621  *****************************************************************************/
1622 void evel_last_epoch_set(EVENT_HEADER * const header,
1623                          const unsigned long long last_epoch_microsec);
1624
1625 /**************************************************************************//**
1626  * Set the Reporting Entity Name property of the event header.
1627  *
1628  * @note The Reporting Entity Name defaults to the OpenStack VM Name.
1629  *
1630  * @param header        Pointer to the ::EVENT_HEADER.
1631  * @param entity_name   The entity name to set.
1632  *****************************************************************************/
1633 void evel_reporting_entity_name_set(EVENT_HEADER * const header,
1634                                     const char * const entity_name);
1635
1636 /**************************************************************************//**
1637  * Set the Reporting Entity Id property of the event header.
1638  *
1639  * @note The Reporting Entity Id defaults to the OpenStack VM UUID.
1640  *
1641  * @param header        Pointer to the ::EVENT_HEADER.
1642  * @param entity_id     The entity id to set.
1643  *****************************************************************************/
1644 void evel_reporting_entity_id_set(EVENT_HEADER * const header,
1645                                   const char * const entity_id);
1646
1647 /**************************************************************************//**
1648  * Set the NFC Naming code property of the event header.
1649  *
1650  * @param header        Pointer to the ::EVENT_HEADER.
1651  * @param nfcnamingcode String
1652  *****************************************************************************/
1653 void evel_nfcnamingcode_set(EVENT_HEADER * const header,
1654                          const char * const nfcnam);
1655 /**************************************************************************//**
1656  * Set the NF Naming code property of the event header.
1657  *
1658  * @param header        Pointer to the ::EVENT_HEADER.
1659  * @param nfnamingcode String
1660  *****************************************************************************/
1661 void evel_nfnamingcode_set(EVENT_HEADER * const header,
1662                          const char * const nfnam);
1663
1664 /*****************************************************************************/
1665 /*****************************************************************************/
1666 /*                                                                           */
1667 /*   FAULT                                                                   */
1668 /*                                                                           */
1669 /*****************************************************************************/
1670 /*****************************************************************************/
1671
1672 /**************************************************************************//**
1673  * Create a new fault event.
1674  *
1675  * @note    The mandatory fields on the Fault must be supplied to this factory
1676  *          function and are immutable once set.  Optional fields have explicit
1677  *          setter functions, but again values may only be set once so that the
1678  *          Fault has immutable properties.
1679  * @param event_name    Unique Event Name
1680  * @param event_id    A universal identifier of the event for analysis etc
1681  * @param   condition   The condition indicated by the Fault.
1682  * @param   specific_problem  The specific problem triggering the fault.
1683  * @param   priority    The priority of the event.
1684  * @param   severity    The severity of the Fault.
1685  * @param   ev_source_type    Source of Alarm event
1686  * @param   version     fault version
1687  * @param   status      status of Virtual Function
1688  * @returns pointer to the newly manufactured ::EVENT_FAULT.  If the event is
1689  *          not used (i.e. posted) it must be released using ::evel_free_fault.
1690  * @retval  NULL  Failed to create the event.
1691  *****************************************************************************/
1692 EVENT_FAULT * evel_new_fault(const char* ev_name, const char *ev_id,
1693                              const char * const condition,
1694                              const char * const specific_problem,
1695                              EVEL_EVENT_PRIORITIES priority,
1696                              EVEL_SEVERITIES severity,
1697                              EVEL_SOURCE_TYPES ev_source_type,
1698                              EVEL_VF_STATUSES status);
1699
1700 /**************************************************************************//**
1701  * Free a Fault.
1702  *
1703  * Free off the Fault supplied.  Will free all the contained allocated memory.
1704  *
1705  * @note It does not free the Fault itself, since that may be part of a
1706  * larger structure.
1707  *****************************************************************************/
1708 void evel_free_fault(EVENT_FAULT * event);
1709
1710 /**************************************************************************//**
1711  * Set the Fault Category property of the Fault.
1712  *
1713  * @note  The property is treated as immutable: it is only valid to call
1714  *        the setter once.  However, we don't assert if the caller tries to
1715  *        overwrite, just ignoring the update instead.
1716  *
1717  * @param fault      Pointer to the fault.
1718  * @param category   Category : license, link, routing, security, signaling.
1719  *                       ASCIIZ string. The caller
1720  *                   does not need to preserve the value once the function
1721  *                   returns.
1722  *****************************************************************************/
1723 void evel_fault_category_set(EVENT_FAULT * fault,
1724                               const char * const category);
1725
1726 /**************************************************************************//**
1727  * Set the Alarm Interface A property of the Fault.
1728  *
1729  * @note  The property is treated as immutable: it is only valid to call
1730  *        the setter once.  However, we don't assert if the caller tries to
1731  *        overwrite, just ignoring the update instead.
1732  *
1733  * @param fault      Pointer to the fault.
1734  * @param interface  The Alarm Interface A to be set. ASCIIZ string. The caller
1735  *                   does not need to preserve the value once the function
1736  *                   returns.
1737  *****************************************************************************/
1738 void evel_fault_interface_set(EVENT_FAULT * fault,
1739                               const char * const interface);
1740
1741 /**************************************************************************//**
1742  * Add an additional value name/value pair to the Fault.
1743  *
1744  * The name and value are null delimited ASCII strings.  The library takes
1745  * a copy so the caller does not have to preserve values after the function
1746  * returns.
1747  *
1748  * @param fault     Pointer to the fault.
1749  * @param name      ASCIIZ string with the attribute's name.
1750  * @param value     ASCIIZ string with the attribute's value.
1751  *****************************************************************************/
1752 void evel_fault_addl_info_add(EVENT_FAULT * fault, char * name, char * value);
1753
1754 /**************************************************************************//**
1755  * Set the Event Type property of the Fault.
1756  *
1757  * @note  The property is treated as immutable: it is only valid to call
1758  *        the setter once.  However, we don't assert if the caller tries to
1759  *        overwrite, just ignoring the update instead.
1760  *
1761  * @param fault      Pointer to the fault.
1762  * @param type       The Event Type to be set. ASCIIZ string. The caller
1763  *                   does not need to preserve the value once the function
1764  *                   returns.
1765  *****************************************************************************/
1766 void evel_fault_type_set(EVENT_FAULT * fault, const char * const type);
1767
1768 /*****************************************************************************/
1769 /*****************************************************************************/
1770 /*                                                                           */
1771 /*   MEASUREMENT                                                             */
1772 /*                                                                           */
1773 /*****************************************************************************/
1774 /*****************************************************************************/
1775
1776 /**************************************************************************//**
1777  * Create a new Measurement event.
1778  *
1779  * @note    The mandatory fields on the Measurement must be supplied to this
1780  *          factory function and are immutable once set.  Optional fields have
1781  *          explicit setter functions, but again values may only be set once so
1782  *          that the Measurement has immutable properties.
1783  *
1784  * @param   measurement_interval
1785  * @param event_name    Unique Event Name
1786  * @param event_id    A universal identifier of the event for analysis etc
1787  *
1788  * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT.  If the
1789  *          event is not used (i.e. posted) it must be released using
1790  *          ::evel_free_event.
1791  * @retval  NULL  Failed to create the event.
1792  *****************************************************************************/
1793 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval,const char* ev_name, const char *ev_id);
1794
1795 /**************************************************************************//**
1796  * Free a Measurement.
1797  *
1798  * Free off the Measurement supplied.  Will free all the contained allocated
1799  * memory.
1800  *
1801  * @note It does not free the Measurement itself, since that may be part of a
1802  * larger structure.
1803  *****************************************************************************/
1804 void evel_free_measurement(EVENT_MEASUREMENT * event);
1805
1806 /**************************************************************************//**
1807  * Set the Event Type property of the Measurement.
1808  *
1809  * @note  The property is treated as immutable: it is only valid to call
1810  *        the setter once.  However, we don't assert if the caller tries to
1811  *        overwrite, just ignoring the update instead.
1812  *
1813  * @param measurement Pointer to the Measurement.
1814  * @param type        The Event Type to be set. ASCIIZ string. The caller
1815  *                    does not need to preserve the value once the function
1816  *                    returns.
1817  *****************************************************************************/
1818 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
1819                                const char * const type);
1820
1821 /**************************************************************************//**
1822  * Set the Concurrent Sessions property of the Measurement.
1823  *
1824  * @note  The property is treated as immutable: it is only valid to call
1825  *        the setter once.  However, we don't assert if the caller tries to
1826  *        overwrite, just ignoring the update instead.
1827  *
1828  * @param measurement         Pointer to the Measurement.
1829  * @param concurrent_sessions The Concurrent Sessions to be set.
1830  *****************************************************************************/
1831 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
1832                                     int concurrent_sessions);
1833
1834 /**************************************************************************//**
1835  * Set the Configured Entities property of the Measurement.
1836  *
1837  * @note  The property is treated as immutable: it is only valid to call
1838  *        the setter once.  However, we don't assert if the caller tries to
1839  *        overwrite, just ignoring the update instead.
1840  *
1841  * @param measurement         Pointer to the Measurement.
1842  * @param configured_entities The Configured Entities to be set.
1843  *****************************************************************************/
1844 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
1845                                    int configured_entities);
1846
1847 /**************************************************************************//**
1848  * Add an additional set of Errors to the Measurement.
1849  *
1850  * @note  The property is treated as immutable: it is only valid to call
1851  *        the setter once.  However, we don't assert if the caller tries to
1852  *        overwrite, just ignoring the update instead.
1853  *
1854  * @param measurement       Pointer to the measurement.
1855  * @param receive_discards  The number of receive discards.
1856  * @param receive_errors    The number of receive errors.
1857  * @param transmit_discards The number of transmit discards.
1858  * @param transmit_errors   The number of transmit errors.
1859  *****************************************************************************/
1860 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
1861                                  int receive_discards,
1862                                  int receive_errors,
1863                                  int transmit_discards,
1864                                  int transmit_errors);
1865
1866 /**************************************************************************//**
1867  * Set the Mean Request Latency property of the Measurement.
1868  *
1869  * @note  The property is treated as immutable: it is only valid to call
1870  *        the setter once.  However, we don't assert if the caller tries to
1871  *        overwrite, just ignoring the update instead.
1872  *
1873  * @param measurement          Pointer to the Measurement.
1874  * @param mean_request_latency The Mean Request Latency to be set.
1875  *****************************************************************************/
1876 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
1877                                        double mean_request_latency);
1878
1879 /**************************************************************************//**
1880  * Set the Request Rate property of the Measurement.
1881  *
1882  * @note  The property is treated as immutable: it is only valid to call
1883  *        the setter once.  However, we don't assert if the caller tries to
1884  *        overwrite, just ignoring the update instead.
1885  *
1886  * @param measurement  Pointer to the Measurement.
1887  * @param request_rate The Request Rate to be set.
1888  *****************************************************************************/
1889 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
1890                                        int request_rate);
1891
1892 /**************************************************************************//**
1893  * Add an additional CPU usage value name/value pair to the Measurement.
1894  *
1895  * The name and value are null delimited ASCII strings.  The library takes
1896  * a copy so the caller does not have to preserve values after the function
1897  * returns.
1898  *
1899  * @param measurement   Pointer to the measurement.
1900  * @param id            ASCIIZ string with the CPU's identifier.
1901  * @param usage         CPU utilization.
1902  *****************************************************************************/
1903 MEASUREMENT_CPU_USE * evel_measurement_new_cpu_use_add(EVENT_MEASUREMENT * measurement, char * id, double usage);
1904
1905 /**************************************************************************//**
1906  * Set the CPU Idle value in measurement interval
1907  *   percentage of CPU time spent in the idle task
1908  *
1909  * @note  The property is treated as immutable: it is only valid to call
1910  *        the setter once.  However, we don't assert if the caller tries to
1911  *        overwrite, just ignoring the update instead.
1912  *
1913  * @param cpu_use      Pointer to the CPU Use.
1914  * @param val          double
1915  *****************************************************************************/
1916 void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE *const cpu_use,
1917                                     const double val);
1918
1919 /**************************************************************************//**
1920  * Set the percentage of time spent servicing interrupts
1921  *
1922  * @note  The property is treated as immutable: it is only valid to call
1923  *        the setter once.  However, we don't assert if the caller tries to
1924  *        overwrite, just ignoring the update instead.
1925  *
1926  * @param cpu_use      Pointer to the CPU Use.
1927  * @param val          double
1928  *****************************************************************************/
1929 void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE * const cpu_use,
1930                                     const double val);
1931
1932 /**************************************************************************//**
1933  * Set the percentage of time spent running user space processes that have been niced
1934  *
1935  * @note  The property is treated as immutable: it is only valid to call
1936  *        the setter once.  However, we don't assert if the caller tries to
1937  *        overwrite, just ignoring the update instead.
1938  *
1939  * @param cpu_use      Pointer to the CPU Use.
1940  * @param val          double
1941  *****************************************************************************/
1942 void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE * const cpu_use,
1943                                     const double val);
1944
1945 /**************************************************************************//**
1946  * Set the percentage of time spent handling soft irq interrupts
1947  *
1948  * @note  The property is treated as immutable: it is only valid to call
1949  *        the setter once.  However, we don't assert if the caller tries to
1950  *        overwrite, just ignoring the update instead.
1951  *
1952  * @param cpu_use      Pointer to the CPU Use.
1953  * @param val          double
1954  *****************************************************************************/
1955 void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE * const cpu_use,
1956                                     const double val);
1957 /**************************************************************************//**
1958  * Set the percentage of time spent in involuntary wait
1959  *
1960  * @note  The property is treated as immutable: it is only valid to call
1961  *        the setter once.  However, we don't assert if the caller tries to
1962  *        overwrite, just ignoring the update instead.
1963  *
1964  * @param cpu_use      Pointer to the CPU Use.
1965  * @param val          double
1966  *****************************************************************************/
1967 void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE * const cpu_use,
1968                                     const double val);
1969 /**************************************************************************//**
1970  * Set the percentage of time spent on system tasks running the kernel
1971  *
1972  * @note  The property is treated as immutable: it is only valid to call
1973  *        the setter once.  However, we don't assert if the caller tries to
1974  *        overwrite, just ignoring the update instead.
1975  *
1976  * @param cpu_use      Pointer to the CPU Use.
1977  * @param val          double
1978  *****************************************************************************/
1979 void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE * const cpu_use,
1980                                     const double val);
1981 /**************************************************************************//**
1982  * Set the percentage of time spent running un-niced user space processes
1983  *
1984  * @note  The property is treated as immutable: it is only valid to call
1985  *        the setter once.  However, we don't assert if the caller tries to
1986  *        overwrite, just ignoring the update instead.
1987  *
1988  * @param cpu_use      Pointer to the CPU Use.
1989  * @param val          double
1990  *****************************************************************************/
1991 void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE * const cpu_use,
1992                                     const double val);
1993 /**************************************************************************//**
1994  * Set the percentage of CPU time spent waiting for I/O operations to complete
1995  *
1996  * @note  The property is treated as immutable: it is only valid to call
1997  *        the setter once.  However, we don't assert if the caller tries to
1998  *        overwrite, just ignoring the update instead.
1999  *
2000  * @param cpu_use      Pointer to the CPU Use.
2001  * @param val          double
2002  *****************************************************************************/
2003 void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE * const cpu_use,
2004                                     const double val);
2005
2006 /**************************************************************************//**
2007  * Add an additional File System usage value name/value pair to the
2008  * Measurement.
2009  *
2010  * The filesystem_name is null delimited ASCII string.  The library takes a
2011  * copy so the caller does not have to preserve values after the function
2012  * returns.
2013  *
2014  * @param measurement     Pointer to the measurement.
2015  * @param filesystem_name   ASCIIZ string with the file-system's UUID.
2016  * @param block_configured  Block storage configured.
2017  * @param block_used        Block storage in use.
2018  * @param block_iops        Block storage IOPS.
2019  * @param ephemeral_configured  Ephemeral storage configured.
2020  * @param ephemeral_used        Ephemeral storage in use.
2021  * @param ephemeral_iops        Ephemeral storage IOPS.
2022  *****************************************************************************/
2023 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
2024                                    char * filesystem_name,
2025                                    double block_configured,
2026                                    double block_used,
2027                                    double block_iops,
2028                                    double ephemeral_configured,
2029                                    double ephemeral_used,
2030                                    double ephemeral_iops);
2031
2032 /**************************************************************************//**
2033  * Add a Feature usage value name/value pair to the Measurement.
2034  *
2035  * The name is null delimited ASCII string.  The library takes
2036  * a copy so the caller does not have to preserve values after the function
2037  * returns.
2038  *
2039  * @param measurement     Pointer to the measurement.
2040  * @param feature         ASCIIZ string with the feature's name.
2041  * @param utilization     Utilization of the feature.
2042  *****************************************************************************/
2043 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
2044                                       char * feature,
2045                                       int utilization);
2046
2047 /**************************************************************************//**
2048  * Add a Additional Measurement value name/value pair to the Measurement.
2049  *
2050  * The name is null delimited ASCII string.  The library takes
2051  * a copy so the caller does not have to preserve values after the function
2052  * returns.
2053  *
2054  * @param measurement   Pointer to the Measurement.
2055  * @param group    ASCIIZ string with the measurement group's name.
2056  * @param name     ASCIIZ string containing the measurement's name.
2057  * @param name     ASCIIZ string containing the measurement's value.
2058  *****************************************************************************/
2059 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
2060                                              const char * const group,
2061                                              const char * const name,
2062                                              const char * const value);
2063
2064 /**************************************************************************//**
2065  * Add a Codec usage value name/value pair to the Measurement.
2066  *
2067  * The name is null delimited ASCII string.  The library takes
2068  * a copy so the caller does not have to preserve values after the function
2069  * returns.
2070  *
2071  * @param measurement     Pointer to the measurement.
2072  * @param codec           ASCIIZ string with the codec's name.
2073  * @param utilization     Utilization of the feature.
2074  *****************************************************************************/
2075 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
2076                                     char * codec,
2077                                     int utilization);
2078
2079 /**************************************************************************//**
2080  * Set the Media Ports in Use property of the Measurement.
2081  *
2082  * @note  The property is treated as immutable: it is only valid to call
2083  *        the setter once.  However, we don't assert if the caller tries to
2084  *        overwrite, just ignoring the update instead.
2085  *
2086  * @param measurement         Pointer to the measurement.
2087  * @param media_ports_in_use  The media port usage to set.
2088  *****************************************************************************/
2089 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
2090                                          int media_ports_in_use);
2091
2092 /**************************************************************************//**
2093  * Set the VNFC Scaling Metric property of the Measurement.
2094  *
2095  * @note  The property is treated as immutable: it is only valid to call
2096  *        the setter once.  However, we don't assert if the caller tries to
2097  *        overwrite, just ignoring the update instead.
2098  *
2099  * @param measurement     Pointer to the measurement.
2100  * @param scaling_metric  The scaling metric to set.
2101  *****************************************************************************/
2102 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
2103                                               int scaling_metric);
2104
2105 /**************************************************************************//**
2106  * Create a new Latency Bucket to be added to a Measurement event.
2107  *
2108  * @note    The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
2109  *          supplied to this factory function and are immutable once set.
2110  *          Optional fields have explicit setter functions, but again values
2111  *          may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
2112  *          immutable properties.
2113  *
2114  * @param count         Count of events in this bucket.
2115  *
2116  * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
2117  * @retval  NULL  Failed to create the Latency Bucket.
2118  *****************************************************************************/
2119 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count);
2120
2121 /**************************************************************************//**
2122  * Set the High 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 high_end      High end of the bucket's range.
2130  *****************************************************************************/
2131 void evel_meas_latency_bucket_high_end_set(
2132                                      MEASUREMENT_LATENCY_BUCKET * const bucket,
2133                                      const double high_end);
2134
2135 /**************************************************************************//**
2136  * Set the Low End property of the Measurement Latency Bucket.
2137  *
2138  * @note  The property is treated as immutable: it is only valid to call
2139  *        the setter once.  However, we don't assert if the caller tries to
2140  *        overwrite, just ignoring the update instead.
2141  *
2142  * @param bucket        Pointer to the Measurement Latency Bucket.
2143  * @param low_end       Low end of the bucket's range.
2144  *****************************************************************************/
2145 void evel_meas_latency_bucket_low_end_set(
2146                                      MEASUREMENT_LATENCY_BUCKET * const bucket,
2147                                      const double low_end);
2148
2149 /**************************************************************************//**
2150  * Add an additional Measurement Latency Bucket to the specified event.
2151  *
2152  * @param measurement   Pointer to the Measurement event.
2153  * @param bucket        Pointer to the Measurement Latency Bucket to add.
2154  *****************************************************************************/
2155 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
2156                                   MEASUREMENT_LATENCY_BUCKET * const bucket);
2157
2158 /**************************************************************************//**
2159  * Add an additional Latency Distribution bucket to the Measurement.
2160  *
2161  * This function implements the previous API, purely for convenience.
2162  *
2163  * @param measurement   Pointer to the measurement.
2164  * @param low_end       Low end of the bucket's range.
2165  * @param high_end      High end of the bucket's range.
2166  * @param count         Count of events in this bucket.
2167  *****************************************************************************/
2168 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
2169                                   const double low_end,
2170                                   const double high_end,
2171                                   const int count);
2172
2173 /**************************************************************************//**
2174  * Create a new vNIC Use to be added to a Measurement event.
2175  *
2176  * @note    The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
2177  *          to this factory function and are immutable once set. Optional
2178  *          fields have explicit setter functions, but again values may only be
2179  *          set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
2180  *          properties.
2181  *
2182  * @param vnic_id               ASCIIZ string with the vNIC's ID.
2183  * @param val_suspect           True or false confidence in data.
2184  *
2185  * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
2186  *          If the structure is not used it must be released using
2187  *          ::evel_measurement_free_vnic_performance.
2188  * @retval  NULL  Failed to create the vNIC Use.
2189  *****************************************************************************/
2190 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id, char * const val_suspect);
2191
2192 /**************************************************************************//**
2193  * Free a vNIC Use.
2194  *
2195  * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied.  Will free all the contained
2196  * allocated memory.
2197  *
2198  * @note It does not free the vNIC Use itself, since that may be part of a
2199  * larger structure.
2200  *****************************************************************************/
2201 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2202
2203 /**************************************************************************//**
2204  * Set the Accumulated Broadcast Packets Received in measurement interval
2205  * property of the vNIC performance.
2206  *
2207  * @note  The property is treated as immutable: it is only valid to call
2208  *        the setter once.  However, we don't assert if the caller tries to
2209  *        overwrite, just ignoring the update instead.
2210  *
2211  * @param vnic_performance      Pointer to the vNIC Use.
2212  * @param recvd_bcast_packets_acc
2213  *****************************************************************************/
2214 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2215                                     const double recvd_bcast_packets_acc);
2216 /**************************************************************************//**
2217  * Set the Delta Broadcast Packets Received in measurement interval
2218  * property of the vNIC performance.
2219  *
2220  * @note  The property is treated as immutable: it is only valid to call
2221  *        the setter once.  However, we don't assert if the caller tries to
2222  *        overwrite, just ignoring the update instead.
2223  *
2224  * @param vnic_performance      Pointer to the vNIC Use.
2225  * @param recvd_bcast_packets_delta
2226  *****************************************************************************/
2227 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2228                                     const double recvd_bcast_packets_delta);
2229 /**************************************************************************//**
2230  * Set the Discarded Packets Received in measurement interval
2231  * property of the vNIC performance.
2232  *
2233  * @note  The property is treated as immutable: it is only valid to call
2234  *        the setter once.  However, we don't assert if the caller tries to
2235  *        overwrite, just ignoring the update instead.
2236  *
2237  * @param vnic_performance      Pointer to the vNIC Use.
2238  * @param recvd_discard_packets_acc
2239  *****************************************************************************/
2240 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2241                                     const double recvd_discard_packets_acc);
2242 /**************************************************************************//**
2243  * Set the Delta Discarded Packets Received in measurement interval
2244  * property of the vNIC performance.
2245  *
2246  * @note  The property is treated as immutable: it is only valid to call
2247  *        the setter once.  However, we don't assert if the caller tries to
2248  *        overwrite, just ignoring the update instead.
2249  *
2250  * @param vnic_performance      Pointer to the vNIC Use.
2251  * @param recvd_discard_packets_delta
2252  *****************************************************************************/
2253 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2254                                     const double recvd_discard_packets_delta);
2255 /**************************************************************************//**
2256  * Set the Error Packets Received in measurement interval
2257  * property of the vNIC performance.
2258  *
2259  * @note  The property is treated as immutable: it is only valid to call
2260  *        the setter once.  However, we don't assert if the caller tries to
2261  *        overwrite, just ignoring the update instead.
2262  *
2263  * @param vnic_performance      Pointer to the vNIC Use.
2264  * @param recvd_error_packets_acc
2265  *****************************************************************************/
2266 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2267                                     const double recvd_error_packets_acc);
2268 /**************************************************************************//**
2269  * Set the Delta Error Packets Received in measurement interval
2270  * property of the vNIC performance.
2271  *
2272  * @note  The property is treated as immutable: it is only valid to call
2273  *        the setter once.  However, we don't assert if the caller tries to
2274  *        overwrite, just ignoring the update instead.
2275  *
2276  * @param vnic_performance      Pointer to the vNIC Use.
2277  * @param recvd_error_packets_delta
2278  *****************************************************************************/
2279 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2280                                     const double recvd_error_packets_delta);
2281 /**************************************************************************//**
2282  * Set the Accumulated Multicast Packets Received in measurement interval
2283  * property of the vNIC performance.
2284  *
2285  * @note  The property is treated as immutable: it is only valid to call
2286  *        the setter once.  However, we don't assert if the caller tries to
2287  *        overwrite, just ignoring the update instead.
2288  *
2289  * @param vnic_performance      Pointer to the vNIC Use.
2290  * @param recvd_mcast_packets_acc
2291  *****************************************************************************/
2292 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2293                                     const double recvd_mcast_packets_acc);
2294 /**************************************************************************//**
2295  * Set the Delta Multicast Packets Received in measurement interval
2296  * property of the vNIC performance.
2297  *
2298  * @note  The property is treated as immutable: it is only valid to call
2299  *        the setter once.  However, we don't assert if the caller tries to
2300  *        overwrite, just ignoring the update instead.
2301  *
2302  * @param vnic_performance      Pointer to the vNIC Use.
2303  * @param recvd_mcast_packets_delta
2304  *****************************************************************************/
2305 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2306                                     const double recvd_mcast_packets_delta);
2307 /**************************************************************************//**
2308  * Set the Accumulated Octets Received in measurement interval
2309  * property of the vNIC performance.
2310  *
2311  * @note  The property is treated as immutable: it is only valid to call
2312  *        the setter once.  However, we don't assert if the caller tries to
2313  *        overwrite, just ignoring the update instead.
2314  *
2315  * @param vnic_performance      Pointer to the vNIC Use.
2316  * @param recvd_octets_acc
2317  *****************************************************************************/
2318 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2319                                     const double recvd_octets_acc);
2320 /**************************************************************************//**
2321  * Set the Delta Octets Received in measurement interval
2322  * property of the vNIC performance.
2323  *
2324  * @note  The property is treated as immutable: it is only valid to call
2325  *        the setter once.  However, we don't assert if the caller tries to
2326  *        overwrite, just ignoring the update instead.
2327  *
2328  * @param vnic_performance      Pointer to the vNIC Use.
2329  * @param recvd_octets_delta
2330  *****************************************************************************/
2331 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2332                                     const double recvd_octets_delta);
2333 /**************************************************************************//**
2334  * Set the Accumulated Total Packets Received in measurement interval
2335  * property of the vNIC performance.
2336  *
2337  * @note  The property is treated as immutable: it is only valid to call
2338  *        the setter once.  However, we don't assert if the caller tries to
2339  *        overwrite, just ignoring the update instead.
2340  *
2341  * @param vnic_performance      Pointer to the vNIC Use.
2342  * @param recvd_total_packets_acc
2343  *****************************************************************************/
2344 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2345                                     const double recvd_total_packets_acc);
2346 /**************************************************************************//**
2347  * Set the Delta Total Packets Received in measurement interval
2348  * property of the vNIC performance.
2349  *
2350  * @note  The property is treated as immutable: it is only valid to call
2351  *        the setter once.  However, we don't assert if the caller tries to
2352  *        overwrite, just ignoring the update instead.
2353  *
2354  * @param vnic_performance      Pointer to the vNIC Use.
2355  * @param recvd_total_packets_delta
2356  *****************************************************************************/
2357 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2358                                     const double recvd_total_packets_delta);
2359 /**************************************************************************//**
2360  * Set the Accumulated Unicast Packets Received in measurement interval
2361  * property of the vNIC performance.
2362  *
2363  * @note  The property is treated as immutable: it is only valid to call
2364  *        the setter once.  However, we don't assert if the caller tries to
2365  *        overwrite, just ignoring the update instead.
2366  *
2367  * @param vnic_performance      Pointer to the vNIC Use.
2368  * @param recvd_ucast_packets_acc
2369  *****************************************************************************/
2370 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2371                                     const double recvd_ucast_packets_acc);
2372 /**************************************************************************//**
2373  * Set the Delta Unicast packets Received in measurement interval
2374  * property of the vNIC performance.
2375  *
2376  * @note  The property is treated as immutable: it is only valid to call
2377  *        the setter once.  However, we don't assert if the caller tries to
2378  *        overwrite, just ignoring the update instead.
2379  *
2380  * @param vnic_performance      Pointer to the vNIC Use.
2381  * @param recvd_ucast_packets_delta
2382  *****************************************************************************/
2383 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2384                                     const double recvd_ucast_packets_delta);
2385 /**************************************************************************//**
2386  * Set the Transmitted Broadcast Packets in measurement interval
2387  * property of the vNIC performance.
2388  *
2389  * @note  The property is treated as immutable: it is only valid to call
2390  *        the setter once.  However, we don't assert if the caller tries to
2391  *        overwrite, just ignoring the update instead.
2392  *
2393  * @param vnic_performance      Pointer to the vNIC Use.
2394  * @param tx_bcast_packets_acc
2395  *****************************************************************************/
2396 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2397                                     const double tx_bcast_packets_acc);
2398 /**************************************************************************//**
2399  * Set the Delta Broadcast packets Transmitted in measurement interval
2400  * property of the vNIC performance.
2401  *
2402  * @note  The property is treated as immutable: it is only valid to call
2403  *        the setter once.  However, we don't assert if the caller tries to
2404  *        overwrite, just ignoring the update instead.
2405  *
2406  * @param vnic_performance      Pointer to the vNIC Use.
2407  * @param tx_bcast_packets_delta
2408  *****************************************************************************/
2409 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2410                                     const double tx_bcast_packets_delta);
2411 /**************************************************************************//**
2412  * Set the Transmitted Discarded Packets in measurement interval
2413  * property of the vNIC performance.
2414  *
2415  * @note  The property is treated as immutable: it is only valid to call
2416  *        the setter once.  However, we don't assert if the caller tries to
2417  *        overwrite, just ignoring the update instead.
2418  *
2419  * @param vnic_performance      Pointer to the vNIC Use.
2420  * @param tx_discarded_packets_acc
2421  *****************************************************************************/
2422 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2423                                     const double tx_discarded_packets_acc);
2424 /**************************************************************************//**
2425  * Set the Delta Discarded packets Transmitted in measurement interval
2426  * property of the vNIC performance.
2427  *
2428  * @note  The property is treated as immutable: it is only valid to call
2429  *        the setter once.  However, we don't assert if the caller tries to
2430  *        overwrite, just ignoring the update instead.
2431  *
2432  * @param vnic_performance      Pointer to the vNIC Use.
2433  * @param tx_discarded_packets_delta
2434  *****************************************************************************/
2435 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2436                                     const double tx_discarded_packets_delta);
2437 /**************************************************************************//**
2438  * Set the Transmitted Errored Packets in measurement interval
2439  * property of the vNIC performance.
2440  *
2441  * @note  The property is treated as immutable: it is only valid to call
2442  *        the setter once.  However, we don't assert if the caller tries to
2443  *        overwrite, just ignoring the update instead.
2444  *
2445  * @param vnic_performance      Pointer to the vNIC Use.
2446  * @param tx_error_packets_acc
2447  *****************************************************************************/
2448 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2449                                     const double tx_error_packets_acc);
2450 /**************************************************************************//**
2451  * Set the Delta Errored packets Transmitted in measurement interval
2452  * property of the vNIC performance.
2453  *
2454  * @note  The property is treated as immutable: it is only valid to call
2455  *        the setter once.  However, we don't assert if the caller tries to
2456  *        overwrite, just ignoring the update instead.
2457  *
2458  * @param vnic_performance      Pointer to the vNIC Use.
2459  * @param tx_error_packets_delta
2460  *****************************************************************************/
2461 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2462                                     const double tx_error_packets_delta);
2463 /**************************************************************************//**
2464  * Set the Transmitted Multicast Packets in measurement interval
2465  * property of the vNIC performance.
2466  *
2467  * @note  The property is treated as immutable: it is only valid to call
2468  *        the setter once.  However, we don't assert if the caller tries to
2469  *        overwrite, just ignoring the update instead.
2470  *
2471  * @param vnic_performance      Pointer to the vNIC Use.
2472  * @param tx_mcast_packets_acc
2473  *****************************************************************************/
2474 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2475                                     const double tx_mcast_packets_acc);
2476 /**************************************************************************//**
2477  * Set the Delta Multicast packets Transmitted in measurement interval
2478  * property of the vNIC performance.
2479  *
2480  * @note  The property is treated as immutable: it is only valid to call
2481  *        the setter once.  However, we don't assert if the caller tries to
2482  *        overwrite, just ignoring the update instead.
2483  *
2484  * @param vnic_performance      Pointer to the vNIC Use.
2485  * @param tx_mcast_packets_delta
2486  *****************************************************************************/
2487 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2488                                     const double tx_mcast_packets_delta);
2489 /**************************************************************************//**
2490  * Set the Transmitted Octets in measurement interval
2491  * property of the vNIC performance.
2492  *
2493  * @note  The property is treated as immutable: it is only valid to call
2494  *        the setter once.  However, we don't assert if the caller tries to
2495  *        overwrite, just ignoring the update instead.
2496  *
2497  * @param vnic_performance      Pointer to the vNIC Use.
2498  * @param tx_octets_acc
2499  *****************************************************************************/
2500 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2501                                     const double tx_octets_acc);
2502 /**************************************************************************//**
2503  * Set the Delta Octets Transmitted in measurement interval
2504  * property of the vNIC performance.
2505  *
2506  * @note  The property is treated as immutable: it is only valid to call
2507  *        the setter once.  However, we don't assert if the caller tries to
2508  *        overwrite, just ignoring the update instead.
2509  *
2510  * @param vnic_performance      Pointer to the vNIC Use.
2511  * @param tx_octets_delta
2512  *****************************************************************************/
2513 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2514                                     const double tx_octets_delta);
2515 /**************************************************************************//**
2516  * Set the Transmitted Total Packets in measurement interval
2517  * property of the vNIC performance.
2518  *
2519  * @note  The property is treated as immutable: it is only valid to call
2520  *        the setter once.  However, we don't assert if the caller tries to
2521  *        overwrite, just ignoring the update instead.
2522  *
2523  * @param vnic_performance      Pointer to the vNIC Use.
2524  * @param tx_total_packets_acc
2525  *****************************************************************************/
2526 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2527                                     const double tx_total_packets_acc);
2528 /**************************************************************************//**
2529  * Set the Delta Total Packets Transmitted in measurement interval
2530  * property of the vNIC performance.
2531  *
2532  * @note  The property is treated as immutable: it is only valid to call
2533  *        the setter once.  However, we don't assert if the caller tries to
2534  *        overwrite, just ignoring the update instead.
2535  *
2536  * @param vnic_performance      Pointer to the vNIC Use.
2537  * @param tx_total_packets_delta
2538  *****************************************************************************/
2539 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2540                                     const double tx_total_packets_delta);
2541 /**************************************************************************//**
2542  * Set the Transmitted Unicast Packets in measurement interval
2543  * property of the vNIC performance.
2544  *
2545  * @note  The property is treated as immutable: it is only valid to call
2546  *        the setter once.  However, we don't assert if the caller tries to
2547  *        overwrite, just ignoring the update instead.
2548  *
2549  * @param vnic_performance      Pointer to the vNIC Use.
2550  * @param tx_ucast_packets_acc
2551  *****************************************************************************/
2552 void evel_vnic_performance_tx_ucast_packets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2553                                     const double tx_ucast_packets_acc);
2554 /**************************************************************************//**
2555  * Set the Delta Octets Transmitted in measurement interval
2556  * property of the vNIC performance.
2557  *
2558  * @note  The property is treated as immutable: it is only valid to call
2559  *        the setter once.  However, we don't assert if the caller tries to
2560  *        overwrite, just ignoring the update instead.
2561  *
2562  * @param vnic_performance      Pointer to the vNIC Use.
2563  * @param tx_ucast_packets_delta
2564  *****************************************************************************/
2565 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2566                                     const double tx_ucast_packets_delta);
2567
2568 /**************************************************************************//**
2569  * Add an additional vNIC Use to the specified Measurement event.
2570  *
2571  * @param measurement   Pointer to the measurement.
2572  * @param vnic_performance      Pointer to the vNIC Use to add.
2573  *****************************************************************************/
2574 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2575                             MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2576
2577 /**************************************************************************//**
2578  * Add an additional vNIC usage record Measurement.
2579  *
2580  * This function implements the previous API, purely for convenience.
2581  *
2582  * The ID is null delimited ASCII string.  The library takes a copy so the
2583  * caller does not have to preserve values after the function returns.
2584  *
2585  * @param measurement           Pointer to the measurement.
2586  * @param vnic_id               ASCIIZ string with the vNIC's ID.
2587  * @param valset                true or false confidence level
2588  * @param recvd_bcast_packets_acc         Recieved broadcast packets
2589  * @param recvd_bcast_packets_delta       Received delta broadcast packets
2590  * @param recvd_discarded_packets_acc     Recieved discarded packets
2591  * @param recvd_discarded_packets_delta   Received discarded delta packets
2592  * @param recvd_error_packets_acc         Received error packets
2593  * @param recvd_error_packets_delta,      Received delta error packets
2594  * @param recvd_mcast_packets_acc         Received multicast packets
2595  * @param recvd_mcast_packets_delta       Received delta multicast packets
2596  * @param recvd_octets_acc                Received octets
2597  * @param recvd_octets_delta              Received delta octets
2598  * @param recvd_total_packets_acc         Received total packets
2599  * @param recvd_total_packets_delta       Received delta total packets
2600  * @param recvd_ucast_packets_acc         Received Unicast packets
2601  * @param recvd_ucast_packets_delta       Received delta unicast packets
2602  * @param tx_bcast_packets_acc            Transmitted broadcast packets
2603  * @param tx_bcast_packets_delta          Transmitted delta broadcast packets
2604  * @param tx_discarded_packets_acc        Transmitted packets discarded
2605  * @param tx_discarded_packets_delta      Transmitted delta discarded packets
2606  * @param tx_error_packets_acc            Transmitted error packets
2607  * @param tx_error_packets_delta          Transmitted delta error packets
2608  * @param tx_mcast_packets_acc            Transmitted multicast packets accumulated
2609  * @param tx_mcast_packets_delta          Transmitted delta multicast packets
2610  * @param tx_octets_acc                   Transmitted octets
2611  * @param tx_octets_delta                 Transmitted delta octets
2612  * @param tx_total_packets_acc            Transmitted total packets
2613  * @param tx_total_packets_delta          Transmitted delta total packets
2614  * @param tx_ucast_packets_acc            Transmitted Unicast packets
2615  * @param tx_ucast_packets_delta          Transmitted delta Unicast packets
2616  *****************************************************************************/
2617 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2618                                char * const vnic_id,
2619                                char * valset,
2620                                double recvd_bcast_packets_acc,
2621                                double recvd_bcast_packets_delta,
2622                                double recvd_discarded_packets_acc,
2623                                double recvd_discarded_packets_delta,
2624                                double recvd_error_packets_acc,
2625                                double recvd_error_packets_delta,
2626                                double recvd_mcast_packets_acc,
2627                                double recvd_mcast_packets_delta,
2628                                double recvd_octets_acc,
2629                                double recvd_octets_delta,
2630                                double recvd_total_packets_acc,
2631                                double recvd_total_packets_delta,
2632                                double recvd_ucast_packets_acc,
2633                                double recvd_ucast_packets_delta,
2634                                double tx_bcast_packets_acc,
2635                                double tx_bcast_packets_delta,
2636                                double tx_discarded_packets_acc,
2637                                double tx_discarded_packets_delta,
2638                                double tx_error_packets_acc,
2639                                double tx_error_packets_delta,
2640                                double tx_mcast_packets_acc,
2641                                double tx_mcast_packets_delta,
2642                                double tx_octets_acc,
2643                                double tx_octets_delta,
2644                                double tx_total_packets_acc,
2645                                double tx_total_packets_delta,
2646                                double tx_ucast_packets_acc,
2647                                double tx_ucast_packets_delta);
2648
2649 /*****************************************************************************/
2650 /*****************************************************************************/
2651 /*                                                                           */
2652 /*   REPORT                                                                  */
2653 /*                                                                           */
2654 /*****************************************************************************/
2655 /*****************************************************************************/
2656
2657 /**************************************************************************//**
2658  * Create a new Report event.
2659  *
2660  * @note    The mandatory fields on the Report must be supplied to this
2661  *          factory function and are immutable once set.  Optional fields have
2662  *          explicit setter functions, but again values may only be set once so
2663  *          that the Report has immutable properties.
2664  *
2665  * @param   measurement_interval
2666  * @param event_name    Unique Event Name
2667  * @param event_id    A universal identifier of the event for analysis etc
2668  *
2669  * @returns pointer to the newly manufactured ::EVENT_REPORT.  If the event is
2670  *          not used (i.e. posted) it must be released using
2671  *          ::evel_free_report.
2672  * @retval  NULL  Failed to create the event.
2673  *****************************************************************************/
2674 EVENT_REPORT * evel_new_report(double measurement_interval,const char* ev_name, const char *ev_id);
2675
2676 /**************************************************************************//**
2677  * Free a Report.
2678  *
2679  * Free off the Report supplied.  Will free all the contained allocated memory.
2680  *
2681  * @note It does not free the Report itself, since that may be part of a
2682  * larger structure.
2683  *****************************************************************************/
2684 void evel_free_report(EVENT_REPORT * event);
2685
2686 /**************************************************************************//**
2687  * Set the Event Type property of the Report.
2688  *
2689  * @note  The property is treated as immutable: it is only valid to call
2690  *        the setter once.  However, we don't assert if the caller tries to
2691  *        overwrite, just ignoring the update instead.
2692  *
2693  * @param report Pointer to the Report.
2694  * @param type        The Event Type to be set. ASCIIZ string. The caller
2695  *                    does not need to preserve the value once the function
2696  *                    returns.
2697  *****************************************************************************/
2698 void evel_report_type_set(EVENT_REPORT * report, const char * const type);
2699
2700 /**************************************************************************//**
2701  * Add a Feature usage value name/value pair to the Report.
2702  *
2703  * The name is null delimited ASCII string.  The library takes
2704  * a copy so the caller does not have to preserve values after the function
2705  * returns.
2706  *
2707  * @param report          Pointer to the report.
2708  * @param feature         ASCIIZ string with the feature's name.
2709  * @param utilization     Utilization of the feature.
2710  *****************************************************************************/
2711 void evel_report_feature_use_add(EVENT_REPORT * report,
2712                                  char * feature,
2713                                  int utilization);
2714
2715 /**************************************************************************//**
2716  * Add a Additional Measurement value name/value pair to the Report.
2717  *
2718  * The name is null delimited ASCII string.  The library takes
2719  * a copy so the caller does not have to preserve values after the function
2720  * returns.
2721  *
2722  * @param report   Pointer to the report.
2723  * @param group    ASCIIZ string with the measurement group's name.
2724  * @param name     ASCIIZ string containing the measurement's name.
2725  * @param value    ASCIIZ string containing the measurement's value.
2726  *****************************************************************************/
2727 void evel_report_custom_measurement_add(EVENT_REPORT * report,
2728                                         const char * const group,
2729                                         const char * const name,
2730                                         const char * const value);
2731
2732 /*****************************************************************************/
2733 /*****************************************************************************/
2734 /*                                                                           */
2735 /*   MOBILE_FLOW                                                             */
2736 /*                                                                           */
2737 /*****************************************************************************/
2738 /*****************************************************************************/
2739
2740 /**************************************************************************//**
2741  * Create a new Mobile Flow event.
2742  *
2743  * @note    The mandatory fields on the Mobile Flow must be supplied to this
2744  *          factory function and are immutable once set.  Optional fields have
2745  *          explicit setter functions, but again values may only be set once so
2746  *          that the Mobile Flow has immutable properties.
2747  *
2748  * @param event_name    Unique Event Name
2749  * @param event_id    A universal identifier of the event for analysis etc
2750  * @param   flow_direction
2751  * @param   gtp_per_flow_metrics
2752  * @param   ip_protocol_type
2753  * @param   ip_version
2754  * @param   other_endpoint_ip_address
2755  * @param   other_endpoint_port
2756  * @param   reporting_endpoint_ip_addr
2757  * @param   reporting_endpoint_port
2758  *
2759  * @returns pointer to the newly manufactured ::EVENT_MOBILE_FLOW.  If the
2760  *          event is not used (i.e. posted) it must be released using
2761  *          ::evel_free_mobile_flow.
2762  * @retval  NULL  Failed to create the event.
2763  *****************************************************************************/
2764 EVENT_MOBILE_FLOW * evel_new_mobile_flow(
2765                       const char* ev_name, const char *ev_id,
2766                       const char * const flow_direction,
2767                       MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics,
2768                       const char * const ip_protocol_type,
2769                       const char * const ip_version,
2770                       const char * const other_endpoint_ip_address,
2771                       int other_endpoint_port,
2772                       const char * const reporting_endpoint_ip_addr,
2773                       int reporting_endpoint_port);
2774
2775 /**************************************************************************//**
2776  * Free a Mobile Flow.
2777  *
2778  * Free off the Mobile Flow supplied.  Will free all the contained allocated
2779  * memory.
2780  *
2781  * @note It does not free the Mobile Flow itself, since that may be part of a
2782  * larger structure.
2783  *****************************************************************************/
2784 void evel_free_mobile_flow(EVENT_MOBILE_FLOW * event);
2785
2786 /**************************************************************************//**
2787  * Set the Event Type property of the Mobile Flow.
2788  *
2789  * @note  The property is treated as immutable: it is only valid to call
2790  *        the setter once.  However, we don't assert if the caller tries to
2791  *        overwrite, just ignoring the update instead.
2792  *
2793  * @param mobile_flow Pointer to the Mobile Flow.
2794  * @param type        The Event Type to be set. ASCIIZ string. The caller
2795  *                    does not need to preserve the value once the function
2796  *                    returns.
2797  *****************************************************************************/
2798 void evel_mobile_flow_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2799                                const char * const type);
2800
2801 /**************************************************************************//**
2802  * Set the Application Type property of the Mobile Flow.
2803  *
2804  * @note  The property is treated as immutable: it is only valid to call
2805  *        the setter once.  However, we don't assert if the caller tries to
2806  *        overwrite, just ignoring the update instead.
2807  *
2808  * @param mobile_flow Pointer to the Mobile Flow.
2809  * @param type        The Application Type to be set. ASCIIZ string. The caller
2810  *                    does not need to preserve the value once the function
2811  *                    returns.
2812  *****************************************************************************/
2813 void evel_mobile_flow_app_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2814                                    const char * const type);
2815
2816 /**************************************************************************//**
2817  * Set the Application Protocol Type property of the Mobile Flow.
2818  *
2819  * @note  The property is treated as immutable: it is only valid to call
2820  *        the setter once.  However, we don't assert if the caller tries to
2821  *        overwrite, just ignoring the update instead.
2822  *
2823  * @param mobile_flow Pointer to the Mobile Flow.
2824  * @param type        The Application Protocol Type to be set. ASCIIZ string.
2825  *                    The caller does not need to preserve the value once the
2826  *                    function returns.
2827  *****************************************************************************/
2828 void evel_mobile_flow_app_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2829                                         const char * const type);
2830
2831 /**************************************************************************//**
2832  * Set the Application Protocol Version property of the Mobile Flow.
2833  *
2834  * @note  The property is treated as immutable: it is only valid to call
2835  *        the setter once.  However, we don't assert if the caller tries to
2836  *        overwrite, just ignoring the update instead.
2837  *
2838  * @param mobile_flow Pointer to the Mobile Flow.
2839  * @param version     The Application Protocol Version to be set. ASCIIZ
2840  *                    string.  The caller does not need to preserve the value
2841  *                    once the function returns.
2842  *****************************************************************************/
2843 void evel_mobile_flow_app_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2844                                        const char * const version);
2845
2846 /**************************************************************************//**
2847  * Set the CID 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 cid         The CID to be set. ASCIIZ string.  The caller does not
2855  *                    need to preserve the value once the function returns.
2856  *****************************************************************************/
2857 void evel_mobile_flow_cid_set(EVENT_MOBILE_FLOW * mobile_flow,
2858                               const char * const cid);
2859
2860 /**************************************************************************//**
2861  * Set the Connection Type property of the Mobile Flow.
2862  *
2863  * @note  The property is treated as immutable: it is only valid to call
2864  *        the setter once.  However, we don't assert if the caller tries to
2865  *        overwrite, just ignoring the update instead.
2866  *
2867  * @param mobile_flow Pointer to the Mobile Flow.
2868  * @param type        The Connection Type to be set. ASCIIZ string. The caller
2869  *                    does not need to preserve the value once the function
2870  *                    returns.
2871  *****************************************************************************/
2872 void evel_mobile_flow_con_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2873                                    const char * const type);
2874
2875 /**************************************************************************//**
2876  * Set the ECGI 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 ecgi        The ECGI to be set. ASCIIZ string.  The caller does not
2884  *                    need to preserve the value once the function returns.
2885  *****************************************************************************/
2886 void evel_mobile_flow_ecgi_set(EVENT_MOBILE_FLOW * mobile_flow,
2887                                const char * const ecgi);
2888
2889 /**************************************************************************//**
2890  * Set the GTP Protocol Type property of the Mobile Flow.
2891  *
2892  * @note  The property is treated as immutable: it is only valid to call
2893  *        the setter once.  However, we don't assert if the caller tries to
2894  *        overwrite, just ignoring the update instead.
2895  *
2896  * @param mobile_flow Pointer to the Mobile Flow.
2897  * @param type        The GTP Protocol Type to be set. ASCIIZ string.  The
2898  *                    caller does not need to preserve the value once the
2899  *                    function returns.
2900  *****************************************************************************/
2901 void evel_mobile_flow_gtp_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2902                                         const char * const type);
2903
2904 /**************************************************************************//**
2905  * Set the GTP Protocol Version property of the Mobile Flow.
2906  *
2907  * @note  The property is treated as immutable: it is only valid to call
2908  *        the setter once.  However, we don't assert if the caller tries to
2909  *        overwrite, just ignoring the update instead.
2910  *
2911  * @param mobile_flow Pointer to the Mobile Flow.
2912  * @param version     The GTP Protocol Version to be set. ASCIIZ string.  The
2913  *                    caller does not need to preserve the value once the
2914  *                    function returns.
2915  *****************************************************************************/
2916 void evel_mobile_flow_gtp_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2917                                        const char * const version);
2918
2919 /**************************************************************************//**
2920  * Set the HTTP Header 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 header      The HTTP header to be set. ASCIIZ string. The caller does
2928  *                    not need to preserve the value once the function returns.
2929  *****************************************************************************/
2930 void evel_mobile_flow_http_header_set(EVENT_MOBILE_FLOW * mobile_flow,
2931                                       const char * const header);
2932
2933 /**************************************************************************//**
2934  * Set the IMEI 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 imei        The IMEI 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_imei_set(EVENT_MOBILE_FLOW * mobile_flow,
2945                                const char * const imei);
2946
2947 /**************************************************************************//**
2948  * Set the IMSI 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 imsi        The IMSI 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_imsi_set(EVENT_MOBILE_FLOW * mobile_flow,
2959                                const char * const imsi);
2960
2961 /**************************************************************************//**
2962  * Set the LAC 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 lac         The LAC 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_lac_set(EVENT_MOBILE_FLOW * mobile_flow,
2973                               const char * const lac);
2974
2975 /**************************************************************************//**
2976  * Set the MCC 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 mcc         The MCC 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_mcc_set(EVENT_MOBILE_FLOW * mobile_flow,
2987                               const char * const mcc);
2988
2989 /**************************************************************************//**
2990  * Set the MNC 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 mnc         The MNC 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_mnc_set(EVENT_MOBILE_FLOW * mobile_flow,
3001                               const char * const mnc);
3002
3003 /**************************************************************************//**
3004  * Set the MSISDN 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 msisdn      The MSISDN to be set. ASCIIZ string.  The caller does not
3012  *                    need to preserve the value once the function returns.
3013  *****************************************************************************/
3014 void evel_mobile_flow_msisdn_set(EVENT_MOBILE_FLOW * mobile_flow,
3015                                  const char * const msisdn);
3016
3017 /**************************************************************************//**
3018  * Set the Other Functional Role property of the Mobile Flow.
3019  *
3020  * @note  The property is treated as immutable: it is only valid to call
3021  *        the setter once.  However, we don't assert if the caller tries to
3022  *        overwrite, just ignoring the update instead.
3023  *
3024  * @param mobile_flow Pointer to the Mobile Flow.
3025  * @param role        The Other Functional Role to be set. ASCIIZ string. The
3026  *                    caller does not need to preserve the value once the
3027  *                    function returns.
3028  *****************************************************************************/
3029 void evel_mobile_flow_other_func_role_set(EVENT_MOBILE_FLOW * mobile_flow,
3030                                           const char * const role);
3031
3032 /**************************************************************************//**
3033  * Set the RAC 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 rac         The RAC to be set. ASCIIZ string.  The caller does not
3041  *                    need to preserve the value once the function returns.
3042  *****************************************************************************/
3043 void evel_mobile_flow_rac_set(EVENT_MOBILE_FLOW * mobile_flow,
3044                               const char * const rac);
3045
3046 /**************************************************************************//**
3047  * Set the Radio Access Technology property of the Mobile Flow.
3048  *
3049  * @note  The property is treated as immutable: it is only valid to call
3050  *        the setter once.  However, we don't assert if the caller tries to
3051  *        overwrite, just ignoring the update instead.
3052  *
3053  * @param mobile_flow Pointer to the Mobile Flow.
3054  * @param tech        The Radio Access Technology to be set. ASCIIZ string. The
3055  *                    caller does not need to preserve the value once the
3056  *                    function returns.
3057  *****************************************************************************/
3058 void evel_mobile_flow_radio_acc_tech_set(EVENT_MOBILE_FLOW * mobile_flow,
3059                                          const char * const tech);
3060
3061 /**************************************************************************//**
3062  * Set the SAC 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 sac         The SAC to be set. ASCIIZ string.  The caller does not
3070  *                    need to preserve the value once the function returns.
3071  *****************************************************************************/
3072 void evel_mobile_flow_sac_set(EVENT_MOBILE_FLOW * mobile_flow,
3073                               const char * const sac);
3074
3075 /**************************************************************************//**
3076  * Set the Sampling Algorithm property of the Mobile Flow.
3077  *
3078  * @note  The property is treated as immutable: it is only valid to call
3079  *        the setter once.  However, we don't assert if the caller tries to
3080  *        overwrite, just ignoring the update instead.
3081  *
3082  * @param mobile_flow Pointer to the Mobile Flow.
3083  * @param algorithm   The Sampling Algorithm to be set.
3084  *****************************************************************************/
3085 void evel_mobile_flow_samp_alg_set(EVENT_MOBILE_FLOW * mobile_flow,
3086                                    int algorithm);
3087
3088 /**************************************************************************//**
3089  * Set the TAC 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 tac         The TAC to be set. ASCIIZ string.  The caller does not
3097  *                    need to preserve the value once the function returns.
3098  *****************************************************************************/
3099 void evel_mobile_flow_tac_set(EVENT_MOBILE_FLOW * mobile_flow,
3100                               const char * const tac);
3101
3102 /**************************************************************************//**
3103  * Set the Tunnel 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 tunnel_id   The Tunnel 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_tunnel_id_set(EVENT_MOBILE_FLOW * mobile_flow,
3114                                     const char * const tunnel_id);
3115
3116 /**************************************************************************//**
3117  * Set the VLAN ID property of the Mobile Flow.
3118  *
3119  * @note  The property is treated as immutable: it is only valid to call
3120  *        the setter once.  However, we don't assert if the caller tries to
3121  *        overwrite, just ignoring the update instead.
3122  *
3123  * @param mobile_flow Pointer to the Mobile Flow.
3124  * @param vlan_id     The VLAN ID to be set. ASCIIZ string.  The caller does
3125  *                    not need to preserve the value once the function returns.
3126  *****************************************************************************/
3127 void evel_mobile_flow_vlan_id_set(EVENT_MOBILE_FLOW * mobile_flow,
3128                                   const char * const vlan_id);
3129
3130 /**************************************************************************//**
3131  * Create a new Mobile GTP Per Flow Metrics.
3132  *
3133  * @note    The mandatory fields on the Mobile GTP Per Flow Metrics must be
3134  *          supplied to this factory function and are immutable once set.
3135  *          Optional fields have explicit setter functions, but again values
3136  *          may only be set once so that the Mobile GTP Per Flow Metrics has
3137  *          immutable properties.
3138  *
3139  * @param   avg_bit_error_rate
3140  * @param   avg_packet_delay_variation
3141  * @param   avg_packet_latency
3142  * @param   avg_receive_throughput
3143  * @param   avg_transmit_throughput
3144  * @param   flow_activation_epoch
3145  * @param   flow_activation_microsec
3146  * @param   flow_deactivation_epoch
3147  * @param   flow_deactivation_microsec
3148  * @param   flow_deactivation_time
3149  * @param   flow_status
3150  * @param   max_packet_delay_variation
3151  * @param   num_activation_failures
3152  * @param   num_bit_errors
3153  * @param   num_bytes_received
3154  * @param   num_bytes_transmitted
3155  * @param   num_dropped_packets
3156  * @param   num_l7_bytes_received
3157  * @param   num_l7_bytes_transmitted
3158  * @param   num_lost_packets
3159  * @param   num_out_of_order_packets
3160  * @param   num_packet_errors
3161  * @param   num_packets_received_excl_retrans
3162  * @param   num_packets_received_incl_retrans
3163  * @param   num_packets_transmitted_incl_retrans
3164  * @param   num_retries
3165  * @param   num_timeouts
3166  * @param   num_tunneled_l7_bytes_received
3167  * @param   round_trip_time
3168  * @param   time_to_first_byte
3169  *
3170  * @returns pointer to the newly manufactured ::MOBILE_GTP_PER_FLOW_METRICS.
3171  *          If the structure is not used it must be released using
3172  *          ::evel_free_mobile_gtp_flow_metrics.
3173  * @retval  NULL  Failed to create the event.
3174  *****************************************************************************/
3175 MOBILE_GTP_PER_FLOW_METRICS * evel_new_mobile_gtp_flow_metrics(
3176                                       double avg_bit_error_rate,
3177                                       double avg_packet_delay_variation,
3178                                       int avg_packet_latency,
3179                                       int avg_receive_throughput,
3180                                       int avg_transmit_throughput,
3181                                       int flow_activation_epoch,
3182                                       int flow_activation_microsec,
3183                                       int flow_deactivation_epoch,
3184                                       int flow_deactivation_microsec,
3185                                       time_t flow_deactivation_time,
3186                                       const char * const flow_status,
3187                                       int max_packet_delay_variation,
3188                                       int num_activation_failures,
3189                                       int num_bit_errors,
3190                                       int num_bytes_received,
3191                                       int num_bytes_transmitted,
3192                                       int num_dropped_packets,
3193                                       int num_l7_bytes_received,
3194                                       int num_l7_bytes_transmitted,
3195                                       int num_lost_packets,
3196                                       int num_out_of_order_packets,
3197                                       int num_packet_errors,
3198                                       int num_packets_received_excl_retrans,
3199                                       int num_packets_received_incl_retrans,
3200                                       int num_packets_transmitted_incl_retrans,
3201                                       int num_retries,
3202                                       int num_timeouts,
3203                                       int num_tunneled_l7_bytes_received,
3204                                       int round_trip_time,
3205                                       int time_to_first_byte);
3206
3207 /**************************************************************************//**
3208  * Free a Mobile GTP Per Flow Metrics.
3209  *
3210  * Free off the Mobile GTP Per Flow Metrics supplied.  Will free all the
3211  * contained allocated memory.
3212  *
3213  * @note It does not free the Mobile GTP Per Flow Metrics itself, since that
3214  * may be part of a larger structure.
3215  *****************************************************************************/
3216 void evel_free_mobile_gtp_flow_metrics(MOBILE_GTP_PER_FLOW_METRICS * metrics);
3217
3218 /**************************************************************************//**
3219  * Set the Duration of Connection Failed Status property of the Mobile GTP Per
3220  * Flow Metrics.
3221  *
3222  * @note  The property is treated as immutable: it is only valid to call
3223  *        the setter once.  However, we don't assert if the caller tries to
3224  *        overwrite, just ignoring the update instead.
3225  *
3226  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3227  * @param duration    The Duration of Connection Failed Status to be set.
3228  *****************************************************************************/
3229 void evel_mobile_gtp_metrics_dur_con_fail_set(
3230                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3231                                          int duration);
3232
3233 /**************************************************************************//**
3234  * Set the Duration of Tunnel Failed Status property of the Mobile GTP Per Flow
3235  * 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 duration    The Duration of Tunnel Failed Status to be set.
3243  *****************************************************************************/
3244 void evel_mobile_gtp_metrics_dur_tun_fail_set(
3245                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3246                                          int duration);
3247
3248 /**************************************************************************//**
3249  * Set the Activated By property of the Mobile GTP Per Flow metrics.
3250  *
3251  * @note  The property is treated as immutable: it is only valid to call
3252  *        the setter once.  However, we don't assert if the caller tries to
3253  *        overwrite, just ignoring the update instead.
3254  *
3255  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3256  * @param act_by      The Activated By to be set.  ASCIIZ string. The caller
3257  *                    does not need to preserve the value once the function
3258  *                    returns.
3259  *****************************************************************************/
3260 void evel_mobile_gtp_metrics_act_by_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3261                                         const char * const act_by);
3262
3263 /**************************************************************************//**
3264  * Set the Activation Time property of the Mobile GTP Per Flow metrics.
3265  *
3266  * @note  The property is treated as immutable: it is only valid to call
3267  *        the setter once.  However, we don't assert if the caller tries to
3268  *        overwrite, just ignoring the update instead.
3269  *
3270  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3271  * @param act_time    The Activation Time to be set.  ASCIIZ string. The caller
3272  *                    does not need to preserve the value once the function
3273  *                    returns.
3274  *****************************************************************************/
3275 void evel_mobile_gtp_metrics_act_time_set(
3276                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3277                                          time_t act_time);
3278
3279 /**************************************************************************//**
3280  * Set the Deactivated By property of the Mobile GTP Per Flow metrics.
3281  *
3282  * @note  The property is treated as immutable: it is only valid to call
3283  *        the setter once.  However, we don't assert if the caller tries to
3284  *        overwrite, just ignoring the update instead.
3285  *
3286  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3287  * @param deact_by    The Deactivated By to be set.  ASCIIZ string. The caller
3288  *                    does not need to preserve the value once the function
3289  *                    returns.
3290  *****************************************************************************/
3291 void evel_mobile_gtp_metrics_deact_by_set(
3292                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3293                                          const char * const deact_by);
3294
3295 /**************************************************************************//**
3296  * Set the GTP Connection Status property of the Mobile GTP Per Flow metrics.
3297  *
3298  * @note  The property is treated as immutable: it is only valid to call
3299  *        the setter once.  However, we don't assert if the caller tries to
3300  *        overwrite, just ignoring the update instead.
3301  *
3302  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3303  * @param status      The GTP Connection Status to be set.  ASCIIZ string. The
3304  *                    caller does not need to preserve the value once the
3305  *                    function returns.
3306  *****************************************************************************/
3307 void evel_mobile_gtp_metrics_con_status_set(
3308                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3309                                          const char * const status);
3310
3311 /**************************************************************************//**
3312  * Set the GTP Tunnel Status property of the Mobile GTP Per Flow metrics.
3313  *
3314  * @note  The property is treated as immutable: it is only valid to call
3315  *        the setter once.  However, we don't assert if the caller tries to
3316  *        overwrite, just ignoring the update instead.
3317  *
3318  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3319  * @param status      The GTP Tunnel Status to be set.  ASCIIZ string. The
3320  *                    caller does not need to preserve the value once the
3321  *                    function returns.
3322  *****************************************************************************/
3323 void evel_mobile_gtp_metrics_tun_status_set(
3324                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3325                                          const char * const status);
3326
3327 /**************************************************************************//**
3328  * Set an IP Type-of-Service count property of the Mobile GTP Per Flow metrics.
3329  *
3330  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3331  * @param index       The index of the IP Type-of-Service.
3332  * @param count       The count.
3333  *****************************************************************************/
3334 void evel_mobile_gtp_metrics_iptos_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3335                                        int index,
3336                                        int count);
3337
3338 /**************************************************************************//**
3339  * Set the Large Packet Round-Trip Time property of the Mobile GTP Per Flow
3340  * 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 rtt         The Large Packet Round-Trip Time to be set.
3348  *****************************************************************************/
3349 void evel_mobile_gtp_metrics_large_pkt_rtt_set(
3350                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3351                                          int rtt);
3352
3353 /**************************************************************************//**
3354  * Set the Large Packet Threshold 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 threshold   The Large Packet Threshold to be set.
3362  *****************************************************************************/
3363 void evel_mobile_gtp_metrics_large_pkt_thresh_set(
3364                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3365                                          double threshold);
3366
3367 /**************************************************************************//**
3368  * Set the Max Receive 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 Receive Bit Rate to be set.
3376  *****************************************************************************/
3377 void evel_mobile_gtp_metrics_max_rcv_bit_rate_set(
3378                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3379                                          int rate);
3380
3381 /**************************************************************************//**
3382  * Set the Max Transmit Bit Rate property of the Mobile GTP Per Flow Metrics.
3383  *
3384  * @note  The property is treated as immutable: it is only valid to call
3385  *        the setter once.  However, we don't assert if the caller tries to
3386  *        overwrite, just ignoring the update instead.
3387  *
3388  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3389  * @param rate        The Max Transmit Bit Rate to be set.
3390  *****************************************************************************/
3391 void evel_mobile_gtp_metrics_max_trx_bit_rate_set(
3392                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3393                                          int rate);
3394
3395 /**************************************************************************//**
3396  * Set the Number of GTP Echo Failures property of the Mobile GTP Per Flow
3397  * Metrics.
3398  *
3399  * @note  The property is treated as immutable: it is only valid to call
3400  *        the setter once.  However, we don't assert if the caller tries to
3401  *        overwrite, just ignoring the update instead.
3402  *
3403  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3404  * @param num         The Number of GTP Echo Failures to be set.
3405  *****************************************************************************/
3406 void evel_mobile_gtp_metrics_num_echo_fail_set(
3407                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3408                                          int num);
3409
3410 /**************************************************************************//**
3411  * Set the Number of GTP Tunnel Errors property of the Mobile GTP Per Flow
3412  * 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 GTP Tunnel Errors to be set.
3420  *****************************************************************************/
3421 void evel_mobile_gtp_metrics_num_tun_fail_set(
3422                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3423                                          int num);
3424
3425 /**************************************************************************//**
3426  * Set the Number of HTTP Errors property of the Mobile GTP Per Flow 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 num         The Number of HTTP Errors to be set.
3434  *****************************************************************************/
3435 void evel_mobile_gtp_metrics_num_http_errors_set(
3436                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3437                                          int num);
3438
3439 /**************************************************************************//**
3440  * Add a TCP flag count to the metrics.
3441  *
3442  * @note  The property is treated as immutable: it is only valid to call
3443  *        the setter once.  However, we don't assert if the caller tries to
3444  *        overwrite, just ignoring the update instead.
3445  *
3446  * @param metrics       Pointer to the Mobile GTP Per Flow Metrics.
3447  * @param tcp_flag      The TCP flag count to be updated.
3448  * @param count         The associated flag count.
3449  *****************************************************************************/
3450 void evel_mobile_gtp_metrics_tcp_flag_count_add(
3451                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3452                                          const EVEL_TCP_FLAGS tcp_flag,
3453                                          const int count);
3454
3455 /**************************************************************************//**
3456  * Add a QCI COS count to the metrics.
3457  *
3458  * @note  The property is treated as immutable: it is only valid to call
3459  *        the setter once.  However, we don't assert if the caller tries to
3460  *        overwrite, just ignoring the update instead.
3461  *
3462  * @param metrics       Pointer to the Mobile GTP Per Flow Metrics.
3463  * @param qci_cos       The QCI COS count to be updated.
3464  * @param count         The associated QCI COS count.
3465  *****************************************************************************/
3466 void evel_mobile_gtp_metrics_qci_cos_count_add(
3467                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3468                                          const EVEL_QCI_COS_TYPES qci_cos,
3469                                          const int count);
3470
3471 /*****************************************************************************/
3472 /*****************************************************************************/
3473 /*                                                                           */
3474 /*   SIGNALING                                                               */
3475 /*                                                                           */
3476 /*****************************************************************************/
3477 /*****************************************************************************/
3478
3479 /**************************************************************************//**
3480  * Create a new Signaling event.
3481  *
3482  * @note    The mandatory fields on the Signaling must be supplied to
3483  *          this factory function and are immutable once set.  Optional fields
3484  *          have explicit setter functions, but again values may only be set
3485  *          once so that the event has immutable properties.
3486  * @param event_name    Unique Event Name
3487  * @param event_id    A universal identifier of the event for analysis etc
3488  * @param vendor_name   The vendor id to encode in the event vnf field.
3489  * @param module        The module to encode in the event.
3490  * @param vnfname       The Virtual network function to encode in the event.
3491  * @returns pointer to the newly manufactured ::EVENT_SIGNALING.  If the event
3492  *          is not used (i.e. posted) it must be released using
3493  *          ::evel_free_signaling.
3494  * @retval  NULL  Failed to create the event.
3495  *****************************************************************************/
3496 EVENT_SIGNALING * evel_new_signaling(const char* ev_name, const char *ev_id,
3497                                      const char * const vendor_name,
3498                                      const char * const correlator,
3499                                      const char * const local_ip_address,
3500                                      const char * const local_port,
3501                                      const char * const remote_ip_address,
3502                                      const char * const remote_port);
3503
3504 /**************************************************************************//**
3505  * Free a Signaling event.
3506  *
3507  * Free off the event supplied.  Will free all the contained allocated memory.
3508  *
3509  * @note It does not free the event itself, since that may be part of a larger
3510  * structure.
3511  *****************************************************************************/
3512 void evel_free_signaling(EVENT_SIGNALING * const event);
3513
3514 /**************************************************************************//**
3515  * Set the Event Type property of the Signaling event.
3516  *
3517  * @note  The property is treated as immutable: it is only valid to call
3518  *        the setter once.  However, we don't assert if the caller tries to
3519  *        overwrite, just ignoring the update instead.
3520  *
3521  * @param event         Pointer to the Signaling event.
3522  * @param type          The Event Type to be set. ASCIIZ string. The caller
3523  *                      does not need to preserve the value once the function
3524  *                      returns.
3525  *****************************************************************************/
3526 void evel_signaling_type_set(EVENT_SIGNALING * const event,
3527                              const char * const type);
3528
3529 /**************************************************************************//**
3530  * Add an additional value name/value pair to the SIP signaling.
3531  *
3532  * The name and value are null delimited ASCII strings.  The library takes
3533  * a copy so the caller does not have to preserve values after the function
3534  * returns.
3535  *
3536  * @param event     Pointer to the fault.
3537  * @param name      ASCIIZ string with the attribute's name.  The caller
3538  *                  does not need to preserve the value once the function
3539  *                  returns.
3540  * @param value     ASCIIZ string with the attribute's value.  The caller
3541  *                  does not need to preserve the value once the function
3542  *                  returns.
3543  *****************************************************************************/
3544 void evel_signaling_addl_info_add(EVENT_SIGNALING * event, char * name, char * value);
3545
3546 /**************************************************************************//**
3547  * Set the Correlator property of the Signaling event.
3548  *
3549  * @note  The property is treated as immutable: it is only valid to call
3550  *        the setter once.  However, we don't assert if the caller tries to
3551  *        overwrite, just ignoring the update instead.
3552  *
3553  * @param event         Pointer to the Signaling event.
3554  * @param correlator    The correlator to be set. ASCIIZ string. The caller
3555  *                      does not need to preserve the value once the function
3556  *                      returns.
3557  *****************************************************************************/
3558 void evel_signaling_correlator_set(EVENT_SIGNALING * const event,
3559                                    const char * const correlator);
3560
3561 /**************************************************************************//**
3562  * Set the Local Ip Address property of the Signaling event.
3563  *
3564  * @note  The property is treated as immutable: it is only valid to call
3565  *        the setter once.  However, we don't assert if the caller tries to
3566  *        overwrite, just ignoring the update instead.
3567  *
3568  * @param event         Pointer to the Signaling event.
3569  * @param local_ip_address
3570  *                      The Local Ip Address to be set. ASCIIZ string. The
3571  *                      caller does not need to preserve the value once the
3572  *                      function returns.
3573  *****************************************************************************/
3574 void evel_signaling_local_ip_address_set(EVENT_SIGNALING * const event,
3575                                          const char * const local_ip_address);
3576
3577 /**************************************************************************//**
3578  * Set the Local Port property of the Signaling event.
3579  *
3580  * @note  The property is treated as immutable: it is only valid to call
3581  *        the setter once.  However, we don't assert if the caller tries to
3582  *        overwrite, just ignoring the update instead.
3583  *
3584  * @param event         Pointer to the Signaling event.
3585  * @param local_port    The Local Port to be set. ASCIIZ string. The caller
3586  *                      does not need to preserve the value once the function
3587  *                      returns.
3588  *****************************************************************************/
3589 void evel_signaling_local_port_set(EVENT_SIGNALING * const event,
3590                                    const char * const local_port);
3591
3592 /**************************************************************************//**
3593  * Set the Remote Ip Address property of the Signaling event.
3594  *
3595  * @note  The property is treated as immutable: it is only valid to call
3596  *        the setter once.  However, we don't assert if the caller tries to
3597  *        overwrite, just ignoring the update instead.
3598  *
3599  * @param event         Pointer to the Signaling event.
3600  * @param remote_ip_address
3601  *                      The Remote Ip Address to be set. ASCIIZ string. The
3602  *                      caller does not need to preserve the value once the
3603  *                      function returns.
3604  *****************************************************************************/
3605 void evel_signaling_remote_ip_address_set(EVENT_SIGNALING * const event,
3606                                          const char * const remote_ip_address);
3607
3608 /**************************************************************************//**
3609  * Set the Remote Port 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 remote_port   The Remote Port 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_remote_port_set(EVENT_SIGNALING * const event,
3621                                     const char * const remote_port);
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 modulename    The module name to be set. ASCIIZ string. The caller
3631  *                      does not need to preserve the value once the function
3632  *                      returns.
3633  *****************************************************************************/
3634 void evel_signaling_vnfmodule_name_set(EVENT_SIGNALING * const event,
3635                                     const char * const module_name);
3636 /**************************************************************************//**
3637  * Set the Vendor module property of the Signaling event.
3638  *
3639  * @note  The property is treated as immutable: it is only valid to call
3640  *        the setter once.  However, we don't assert if the caller tries to
3641  *        overwrite, just ignoring the update instead.
3642  *
3643  * @param event         Pointer to the Signaling event.
3644  * @param vnfname       The Virtual Network function to be set. ASCIIZ string.
3645  *                      The caller does not need to preserve the value once
3646  *                      the function returns.
3647  *****************************************************************************/
3648 void evel_signaling_vnfname_set(EVENT_SIGNALING * const event,
3649                                     const char * const vnfname);
3650
3651 /**************************************************************************//**
3652  * Set the Compressed SIP property of the Signaling event.
3653  *
3654  * @note  The property is treated as immutable: it is only valid to call
3655  *        the setter once.  However, we don't assert if the caller tries to
3656  *        overwrite, just ignoring the update instead.
3657  *
3658  * @param event         Pointer to the Signaling event.
3659  * @param compressed_sip
3660  *                      The Compressed SIP to be set. ASCIIZ string. The caller
3661  *                      does not need to preserve the value once the function
3662  *                      returns.
3663  *****************************************************************************/
3664 void evel_signaling_compressed_sip_set(EVENT_SIGNALING * const event,
3665                                        const char * const compressed_sip);
3666
3667 /**************************************************************************//**
3668  * Set the Summary SIP property of the Signaling event.
3669  *
3670  * @note  The property is treated as immutable: it is only valid to call
3671  *        the setter once.  However, we don't assert if the caller tries to
3672  *        overwrite, just ignoring the update instead.
3673  *
3674  * @param event         Pointer to the Signaling event.
3675  * @param summary_sip   The Summary SIP to be set. ASCIIZ string. The caller
3676  *                      does not need to preserve the value once the function
3677  *                      returns.
3678  *****************************************************************************/
3679 void evel_signaling_summary_sip_set(EVENT_SIGNALING * const event,
3680                                     const char * const summary_sip);
3681
3682
3683 /*****************************************************************************/
3684 /*****************************************************************************/
3685 /*                                                                           */
3686 /*   STATE CHANGE                                                            */
3687 /*                                                                           */
3688 /*****************************************************************************/
3689 /*****************************************************************************/
3690
3691 /**************************************************************************//**
3692  * Create a new State Change event.
3693  *
3694  * @note    The mandatory fields on the Syslog must be supplied to this factory
3695  *          function and are immutable once set.  Optional fields have explicit
3696  *          setter functions, but again values may only be set once so that the
3697  *          Syslog has immutable properties.
3698  *
3699  * @param event_name    Unique Event Name
3700  * @param event_id    A universal identifier of the event for analysis etc
3701  * @param new_state     The new state of the reporting entity.
3702  * @param old_state     The old state of the reporting entity.
3703  * @param interface     The card or port name of the reporting entity.
3704  *
3705  * @returns pointer to the newly manufactured ::EVENT_STATE_CHANGE.  If the
3706  *          event is not used it must be released using
3707  *          ::evel_free_state_change
3708  * @retval  NULL  Failed to create the event.
3709  *****************************************************************************/
3710 EVENT_STATE_CHANGE * evel_new_state_change(const char* ev_name, const char *ev_id,
3711                                            const EVEL_ENTITY_STATE new_state,
3712                                            const EVEL_ENTITY_STATE old_state,
3713                                            const char * const interface);
3714
3715 /**************************************************************************//**
3716  * Free a State Change.
3717  *
3718  * Free off the State Change supplied.  Will free all the contained allocated
3719  * memory.
3720  *
3721  * @note It does not free the State Change itself, since that may be part of a
3722  * larger structure.
3723  *****************************************************************************/
3724 void evel_free_state_change(EVENT_STATE_CHANGE * const state_change);
3725
3726 /**************************************************************************//**
3727  * Set the Event Type property of the State Change.
3728  *
3729  * @note  The property is treated as immutable: it is only valid to call
3730  *        the setter once.  However, we don't assert if the caller tries to
3731  *        overwrite, just ignoring the update instead.
3732  *
3733  * @param state_change  Pointer to the ::EVENT_STATE_CHANGE.
3734  * @param type          The Event Type to be set. ASCIIZ string. The caller
3735  *                      does not need to preserve the value once the function
3736  *                      returns.
3737  *****************************************************************************/
3738 void evel_state_change_type_set(EVENT_STATE_CHANGE * const state_change,
3739                                 const char * const type);
3740
3741 /**************************************************************************//**
3742  * Add an additional field name/value pair to the State Change.
3743  *
3744  * The name and value are null delimited ASCII strings.  The library takes
3745  * a copy so the caller does not have to preserve values after the function
3746  * returns.
3747  *
3748  * @param state_change  Pointer to the ::EVENT_STATE_CHANGE.
3749  * @param name          ASCIIZ string with the attribute's name.  The caller
3750  *                      does not need to preserve the value once the function
3751  *                      returns.
3752  * @param value         ASCIIZ string with the attribute's value.  The caller
3753  *                      does not need to preserve the value once the function
3754  *                      returns.
3755  *****************************************************************************/
3756 void evel_state_change_addl_field_add(EVENT_STATE_CHANGE * const state_change,
3757                                       const char * const name,
3758                                       const char * const value);
3759
3760 /*****************************************************************************/
3761 /*****************************************************************************/
3762 /*                                                                           */
3763 /*   SYSLOG                                                                  */
3764 /*                                                                           */
3765 /*****************************************************************************/
3766 /*****************************************************************************/
3767
3768 /**************************************************************************//**
3769  * Create a new syslog event.
3770  *
3771  * @note    The mandatory fields on the Syslog must be supplied to this factory
3772  *          function and are immutable once set.  Optional fields have explicit
3773  *          setter functions, but again values may only be set once so that the
3774  *          Syslog has immutable properties.
3775  *
3776  * @param event_name    Unique Event Name
3777  * @param event_id    A universal identifier of the event for analysis etc
3778  * @param   event_source_type
3779  * @param   syslog_msg
3780  * @param   syslog_tag
3781  * @param   version
3782  *
3783  * @returns pointer to the newly manufactured ::EVENT_SYSLOG.  If the event is
3784  *          not used it must be released using ::evel_free_syslog
3785  * @retval  NULL  Failed to create the event.
3786  *****************************************************************************/
3787 EVENT_SYSLOG * evel_new_syslog(const char* ev_name, const char *ev_id,
3788                                 EVEL_SOURCE_TYPES event_source_type,
3789                                const char * const syslog_msg,
3790                                const char * const syslog_tag);
3791
3792 /**************************************************************************//**
3793  * Set the Event Type property of the Syslog.
3794  *
3795  * @note  The property is treated as immutable: it is only valid to call
3796  *        the setter once.  However, we don't assert if the caller tries to
3797  *        overwrite, just ignoring the update instead.
3798  *
3799  * @param syslog      Pointer to the syslog.
3800  * @param type        The Event Type to be set. ASCIIZ string. The caller
3801  *                    does not need to preserve the value once the function
3802  *                    returns.
3803  *****************************************************************************/
3804 void evel_syslog_type_set(EVENT_SYSLOG * syslog,
3805                           const char * const type);
3806
3807 /**************************************************************************//**
3808  * Free a Syslog.
3809  *
3810  * Free off the Syslog supplied.  Will free all the contained allocated memory.
3811  *
3812  * @note It does not free the Syslog itself, since that may be part of a
3813  * larger structure.
3814  *****************************************************************************/
3815 void evel_free_syslog(EVENT_SYSLOG * event);
3816
3817 /**************************************************************************//**
3818  * Add an additional field name/value pair to the Syslog.
3819  *
3820  * The name and value are null delimited ASCII strings.  The library takes
3821  * a copy so the caller does not have to preserve values after the function
3822  * returns.
3823  *
3824  * @param syslog    Pointer to the syslog.
3825  * @param name      ASCIIZ string with the attribute's name.  The caller
3826  *                  does not need to preserve the value once the function
3827  *                  returns.
3828  * @param value     ASCIIZ string with the attribute's value.  The caller
3829  *                  does not need to preserve the value once the function
3830  *                  returns.
3831  *****************************************************************************/
3832 void evel_syslog_addl_field_add(EVENT_SYSLOG * syslog,
3833                                 char * name,
3834                                 char * value);
3835
3836 /**************************************************************************//**
3837  * Set the Event Source Host property of the Syslog.
3838  *
3839  * @note  The property is treated as immutable: it is only valid to call
3840  *        the setter once.  However, we don't assert if the caller tries to
3841  *        overwrite, just ignoring the update instead.
3842  *
3843  * @param syslog      Pointer to the Syslog.
3844  * @param host        The Event Source Host to be set.  ASCIIZ string. The
3845  *                    caller does not need to preserve the value once the
3846  *                    function returns.
3847  *****************************************************************************/
3848 void evel_syslog_event_source_host_set(EVENT_SYSLOG * syslog,
3849                                        const char * const host);
3850
3851 /**************************************************************************//**
3852  * Set the Syslog Facility property of the Syslog.
3853  *
3854  * @note  The property is treated as immutable: it is only valid to call
3855  *        the setter once.  However, we don't assert if the caller tries to
3856  *        overwrite, just ignoring the update instead.
3857  *
3858  * @param syslog      Pointer to the Syslog.
3859  * @param facility    The Syslog Facility to be set.  ASCIIZ string. The caller
3860  *                    does not need to preserve the value once the function
3861  *                    returns.
3862  *****************************************************************************/
3863 void evel_syslog_facility_set(EVENT_SYSLOG * syslog,
3864                               EVEL_SYSLOG_FACILITIES facility);
3865
3866 /**************************************************************************//**
3867  * Set the Process property of the Syslog.
3868  *
3869  * @note  The property is treated as immutable: it is only valid to call
3870  *        the setter once.  However, we don't assert if the caller tries to
3871  *        overwrite, just ignoring the update instead.
3872  *
3873  * @param syslog      Pointer to the Syslog.
3874  * @param proc        The Process to be set.  ASCIIZ string. The caller does
3875  *                    not need to preserve the value once the function returns.
3876  *****************************************************************************/
3877 void evel_syslog_proc_set(EVENT_SYSLOG * syslog, const char * const proc);
3878
3879 /**************************************************************************//**
3880  * Set the Process ID property of the Syslog.
3881  *
3882  * @note  The property is treated as immutable: it is only valid to call
3883  *        the setter once.  However, we don't assert if the caller tries to
3884  *        overwrite, just ignoring the update instead.
3885  *
3886  * @param syslog      Pointer to the Syslog.
3887  * @param proc_id     The Process ID to be set.
3888  *****************************************************************************/
3889 void evel_syslog_proc_id_set(EVENT_SYSLOG * syslog, int proc_id);
3890
3891 /**************************************************************************//**
3892  * Set the Version property of the Syslog.
3893  *
3894  * @note  The property is treated as immutable: it is only valid to call
3895  *        the setter once.  However, we don't assert if the caller tries to
3896  *        overwrite, just ignoring the update instead.
3897  *
3898  * @param syslog      Pointer to the Syslog.
3899  * @param version     The Version to be set.
3900  *****************************************************************************/
3901 void evel_syslog_version_set(EVENT_SYSLOG * syslog, int version);
3902
3903 /**************************************************************************//**
3904  * Set the Structured Data 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 s_data      The Structured Data to be set.  ASCIIZ string. The caller
3912  *                    does not need to preserve the value once the function
3913  *                    returns.
3914  *****************************************************************************/
3915 void evel_syslog_s_data_set(EVENT_SYSLOG * syslog, const char * const s_data);
3916
3917 /**************************************************************************//**
3918  * Set the Structured SDID 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. name@number
3926  *                 Caller does not need to preserve the value once the function
3927  *                   returns.
3928  *****************************************************************************/
3929 void evel_syslog_sdid_set(EVENT_SYSLOG * syslog, const char * const sdid);
3930
3931 /**************************************************************************//**
3932  * Set the Structured Severity property of the Syslog.
3933  *
3934  * @note  The property is treated as immutable: it is only valid to call
3935  *        the setter once.  However, we don't assert if the caller tries to
3936  *        overwrite, just ignoring the update instead.
3937  *
3938  * @param syslog     Pointer to the Syslog.
3939  * @param sdid     The Structured Data to be set. ASCIIZ string. 
3940  *                 Caller does not need to preserve the value once the function
3941  *                   returns.
3942  *****************************************************************************/
3943 void evel_syslog_severity_set(EVENT_SYSLOG * syslog, const char * const severty);
3944
3945
3946 /*****************************************************************************/
3947 /*****************************************************************************/
3948 /*                                                                           */
3949 /*   OTHER                                                                   */
3950 /*                                                                           */
3951 /*****************************************************************************/
3952 /*****************************************************************************/
3953
3954 /**************************************************************************//**
3955  * Create a new other event.
3956  *
3957  * @param event_name    Unique Event Name
3958  * @param event_id    A universal identifier of the event for analysis etc
3959  *
3960  * @returns pointer to the newly manufactured ::EVENT_OTHER.  If the event is
3961  *          not used it must be released using ::evel_free_other.
3962  * @retval  NULL  Failed to create the event.
3963  *****************************************************************************/
3964 EVENT_OTHER * evel_new_other(const char* ev_name, const char *ev_id);
3965
3966 /**************************************************************************//**
3967  * Free an Other.
3968  *
3969  * Free off the Other supplied.  Will free all the contained allocated memory.
3970  *
3971  * @note It does not free the Other itself, since that may be part of a
3972  * larger structure.
3973  *****************************************************************************/
3974 void evel_free_other(EVENT_OTHER * event);
3975
3976 /**************************************************************************//**
3977  * Set the Event Type property of the Other.
3978  *
3979  * @note  The property is treated as immutable: it is only valid to call
3980  *        the setter once.  However, we don't assert if the caller tries to
3981  *        overwrite, just ignoring the update instead.
3982  *
3983  * @param other       Pointer to the Other.
3984  * @param type        The Event Type to be set. ASCIIZ string. The caller
3985  *                    does not need to preserve the value once the function
3986  *                    returns.
3987  *****************************************************************************/
3988 void evel_other_type_set(EVENT_OTHER * other,
3989                          const char * const type);
3990
3991 /**************************************************************************//**
3992  * Add a value name/value pair to the Other.
3993  *
3994  * The name and value are null delimited ASCII strings.  The library takes
3995  * a copy so the caller does not have to preserve values after the function
3996  * returns.
3997  *
3998  * @param other     Pointer to the Other.
3999  * @param name      ASCIIZ string with the attribute's name.
4000  * @param value     ASCIIZ string with the attribute's value.
4001  *****************************************************************************/
4002 void evel_other_field_add(EVENT_OTHER * other,
4003                           char * name,
4004                           char * value);
4005
4006 /*****************************************************************************/
4007 /*****************************************************************************/
4008 /*                                                                           */
4009 /*   THROTTLING                                                              */
4010 /*                                                                           */
4011 /*****************************************************************************/
4012 /*****************************************************************************/
4013
4014 /**************************************************************************//**
4015  * Return the current measurement interval provided by the Event Listener.
4016  *
4017  * @returns The current measurement interval
4018  * @retval  EVEL_MEASUREMENT_INTERVAL_UKNOWN (0) - interval has not been
4019  *          specified
4020  *****************************************************************************/
4021 int evel_get_measurement_interval();
4022
4023 /*****************************************************************************/
4024 /* Supported Report version.                                                 */
4025 /*****************************************************************************/
4026 #define EVEL_VOICEQ_MAJOR_VERSION 1
4027 #define EVEL_VOICEQ_MINOR_VERSION 1
4028
4029 /**************************************************************************//**
4030  * End of Call Voice Quality Metrices
4031  * JSON equivalent field: endOfCallVqmSummaries
4032  *****************************************************************************/
4033 typedef struct end_of_call_vqm_summaries {
4034         /***************************************************************************/
4035         /* Mandatory fields                                                        */
4036         /***************************************************************************/
4037         char* adjacencyName;
4038         char* endpointDescription;
4039
4040         /***************************************************************************/
4041         /* Optional fields                                                         */
4042         /***************************************************************************/
4043         EVEL_OPTION_INT endpointJitter;
4044         EVEL_OPTION_INT endpointRtpOctetsDiscarded;
4045         EVEL_OPTION_INT endpointRtpOctetsReceived;
4046         EVEL_OPTION_INT endpointRtpOctetsSent;
4047         EVEL_OPTION_INT endpointRtpPacketsDiscarded;
4048         EVEL_OPTION_INT endpointRtpPacketsReceived;
4049         EVEL_OPTION_INT endpointRtpPacketsSent;
4050         EVEL_OPTION_INT localJitter;
4051         EVEL_OPTION_INT localRtpOctetsDiscarded;
4052         EVEL_OPTION_INT localRtpOctetsReceived;
4053         EVEL_OPTION_INT localRtpOctetsSent;
4054         EVEL_OPTION_INT localRtpPacketsDiscarded;
4055         EVEL_OPTION_INT localRtpPacketsReceived;
4056         EVEL_OPTION_INT localRtpPacketsSent;
4057         EVEL_OPTION_INT mosCqe;
4058         EVEL_OPTION_INT packetsLost;
4059         EVEL_OPTION_INT packetLossPercent;
4060         EVEL_OPTION_INT rFactor;
4061         EVEL_OPTION_INT roundTripDelay;
4062
4063 } END_OF_CALL_VOICE_QUALITY_METRICS;
4064
4065 /**************************************************************************//**
4066 * Voice QUality.
4067 * JSON equivalent field: voiceQualityFields
4068 *****************************************************************************/
4069
4070 typedef struct event_voiceQuality {
4071         /***************************************************************************/
4072         /* Header and version                                                      */
4073         /***************************************************************************/
4074         EVENT_HEADER header;
4075         int major_version;
4076         int minor_version;
4077
4078         /***************************************************************************/
4079         /* Mandatory fields                                                        */
4080         /***************************************************************************/
4081         
4082         char *calleeSideCodec;
4083         char *callerSideCodec;
4084         char *correlator;
4085         char *midCallRtcp;
4086         VENDOR_VNFNAME_FIELD vendorVnfNameFields;
4087         END_OF_CALL_VOICE_QUALITY_METRICS *endOfCallVqmSummaries;
4088
4089         /***************************************************************************/
4090         /* Optional fields                                                         */
4091         /***************************************************************************/
4092         EVEL_OPTION_STRING phoneNumber;
4093         DLIST additionalInformation;
4094
4095 } EVENT_VOICE_QUALITY;
4096 /**************************************************************************//**
4097  * Voice Quality Additional Info.
4098  * JSON equivalent field: additionalInformation
4099  *****************************************************************************/
4100 typedef struct voice_quality_additional_info {
4101   char * name;
4102   char * value;
4103 } VOICE_QUALITY_ADDL_INFO;
4104
4105 /**************************************************************************//**
4106  * Create a new voice quality event.
4107  *
4108  * @note    The mandatory fields on the Voice Quality must be supplied to this 
4109  *          factory function and are immutable once set.  Optional fields have 
4110  *          explicit setter functions, but again values may only be set once 
4111  *          so that the Voice Quality has immutable properties.
4112  * @param event_name    Unique Event Name
4113  * @param event_id    A universal identifier of the event for analysis etc
4114  * @param   calleeSideCodec                     Callee codec for the call.
4115  * @param   callerSideCodec                     Caller codec for the call.
4116  * @param   correlator                          Constant across all events on this call.
4117  * @param   midCallRtcp                         Base64 encoding of the binary RTCP data
4118  *                                                                      (excluding Eth/IP/UDP headers).
4119  * @param   vendorVnfNameFields         Vendor, VNF and VfModule names.
4120  * @returns pointer to the newly manufactured ::EVENT_VOICE_QUALITY.  If the 
4121  *          event is not used (i.e. posted) it must be released using
4122                         ::evel_free_voice_quality.
4123  * @retval  NULL  Failed to create the event.
4124  *****************************************************************************/
4125 EVENT_VOICE_QUALITY * evel_new_voice_quality(const char* ev_name, const char *ev_id,
4126         const char * const calleeSideCodec,
4127         const char * const callerSideCodec, const char * const correlator,
4128         const char * const midCallRtcp, const char * const vendorVnfNameFields);
4129
4130 /**************************************************************************//**
4131  * Set the Callee side codec for Call for domain Voice Quality
4132  *
4133  * @note  The property is treated as immutable: it is only valid to call
4134  *        the setter once.  However, we don't assert if the caller tries to
4135  *        overwrite, just ignoring the update instead.
4136  *
4137  * @param voiceQuality                          Pointer to the Voice Quality Event.
4138  * @param calleeCodecForCall            The Callee Side Codec to be set.  ASCIIZ 
4139  *                                                                      string. The caller does not need to 
4140  *                                                                      preserve the value once the function
4141  *                                                                      returns.
4142  *****************************************************************************/
4143 void evel_voice_quality_callee_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
4144                                                                         const char * const calleeCodecForCall);
4145
4146 /**************************************************************************//**
4147  * Set the Caller side codec for Call for domain Voice Quality
4148  *
4149  * @note  The property is treated as immutable: it is only valid to call
4150  *        the setter once.  However, we don't assert if the caller tries to
4151  *        overwrite, just ignoring the update instead.
4152  *
4153  * @param voiceQuality                          Pointer to the Voice Quality Event.
4154  * @param callerCodecForCall            The Caller Side Codec to be set.  ASCIIZ 
4155  *                                                                      string. The caller does not need to 
4156  *                                                                      preserve the value once the function
4157  *                                                                      returns.
4158  *****************************************************************************/
4159 void evel_voice_quality_caller_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
4160                                                                         const char * const callerCodecForCall);
4161
4162 /**************************************************************************//**
4163  * Set the correlator for domain Voice Quality
4164  *
4165  * @note  The property is treated as immutable: it is only valid to call
4166  *        the setter once.  However, we don't assert if the caller tries to
4167  *        overwrite, just ignoring the update instead.
4168  *
4169  * @param voiceQuality                          Pointer to the Voice Quality Event.
4170  * @param correlator                            The correlator value to be set.  ASCIIZ 
4171  *                                                                      string. The caller does not need to 
4172  *                                                                      preserve the value once the function
4173  *                                                                      returns.
4174  *****************************************************************************/
4175 void evel_voice_quality_correlator_set(EVENT_VOICE_QUALITY * voiceQuality,
4176                                                                         const char * const vCorrelator);
4177
4178 /**************************************************************************//**
4179  * Set the RTCP Call Data for domain Voice Quality
4180  *
4181  * @note  The property is treated as immutable: it is only valid to call
4182  *        the setter once.  However, we don't assert if the caller tries to
4183  *        overwrite, just ignoring the update instead.
4184  *
4185  * @param voiceQuality                          Pointer to the Voice Quality Event.
4186  * @param rtcpCallData                  The RTCP Call Data to be set.  ASCIIZ 
4187  *                                                                      string. The caller does not need to 
4188  *                                                                      preserve the value once the function
4189  *                                                                      returns.
4190  *****************************************************************************/
4191 void evel_voice_quality_rtcp_data_set(EVENT_VOICE_QUALITY * voiceQuality,
4192                                                                         const char * const rtcpCallData);
4193
4194 /**************************************************************************//**
4195  * Set the Vendor VNF Name fields for domain Voice Quality
4196  *
4197  * @note  The property is treated as immutable: it is only valid to call
4198  *        the setter once.  However, we don't assert if the caller tries to
4199  *        overwrite, just ignoring the update instead.
4200  *
4201  * @param voiceQuality                          Pointer to the Voice Quality Event.
4202  * @param nameFields                    The Vendor, VNF and VfModule names to be set.   
4203  *                                                                      ASCIIZ string. The caller does not need to 
4204  *                                                                      preserve the value once the function
4205  *                                                                      returns.
4206  *****************************************************************************/
4207 void evel_voice_quality_name_fields_set(EVENT_VOICE_QUALITY * voiceQuality,
4208                                                                         const char * const nameFields);
4209
4210 /**************************************************************************//**
4211  * Add an End of Call Voice Quality Metrices
4212
4213  * The adjacencyName and endpointDescription is null delimited ASCII string.  
4214  * The library takes a copy so the caller does not have to preserve values
4215  * after the function returns.
4216  *
4217  * @param voiceQuality     Pointer to the measurement.
4218  * @param adjacencyName                                         Adjacency name
4219  * @param endpointDescription                           Enumeration: ‘Caller’, ‘Callee’.
4220  * @param endpointJitter                                        Endpoint jitter
4221  * @param endpointRtpOctetsDiscarded        Endpoint RTP octets discarded.
4222  * @param endpointRtpOctetsReceived                     Endpoint RTP octets received.
4223  * @param endpointRtpOctetsSent                         Endpoint RTP octets sent
4224  * @param endpointRtpPacketsDiscarded           Endpoint RTP packets discarded.
4225  * @param endpointRtpPacketsReceived            Endpoint RTP packets received.
4226  * @param endpointRtpPacketsSent                        Endpoint RTP packets sent.
4227  * @param localJitter                                           Local jitter.
4228  * @param localRtpOctetsDiscarded                       Local RTP octets discarded.
4229  * @param localRtpOctetsReceived                        Local RTP octets received.
4230  * @param localRtpOctetsSent                            Local RTP octets sent.
4231  * @param localRtpPacketsDiscarded                      Local RTP packets discarded.
4232  * @param localRtpPacketsReceived                       Local RTP packets received.
4233  * @param localRtpPacketsSent                           Local RTP packets sent.
4234  * @param mosCqe                                                        Decimal range from 1 to 5
4235  *                                                                                      (1 decimal place)
4236  * @param packetsLost                                           No      Packets lost
4237  * @param packetLossPercent                                     Calculated percentage packet loss 
4238  * @param rFactor                                                       rFactor from 0 to 100
4239  * @param roundTripDelay                                        Round trip delay in milliseconds
4240  *****************************************************************************/
4241 void evel_voice_quality_end_metrics_add(EVENT_VOICE_QUALITY * voiceQuality,
4242         const char * adjacencyName, EVEL_SERVICE_ENDPOINT_DESC endpointDescription,
4243         int endpointJitter,
4244         int endpointRtpOctetsDiscarded,
4245         int endpointRtpOctetsReceived,
4246         int endpointRtpOctetsSent,
4247         int endpointRtpPacketsDiscarded,
4248         int endpointRtpPacketsReceived,
4249         int endpointRtpPacketsSent,
4250         int localJitter,
4251         int localRtpOctetsDiscarded,
4252         int localRtpOctetsReceived,
4253         int localRtpOctetsSent,
4254         int localRtpPacketsDiscarded,
4255         int localRtpPacketsReceived,
4256         int localRtpPacketsSent,
4257         int mosCqe,
4258         int packetsLost,
4259         int packetLossPercent,
4260         int rFactor,
4261         int roundTripDelay);
4262
4263 /**************************************************************************//**
4264  * Free a Voice Quality.
4265  *
4266  * Free off the Voce Quality supplied.  Will free all the contained allocated
4267  * memory.
4268  *
4269  * @note It does not free the Voice Quality itself, since that may be part of a
4270  * larger structure.
4271  *****************************************************************************/
4272 void evel_free_voice_quality(EVENT_VOICE_QUALITY * voiceQuality);
4273
4274 /**************************************************************************//**
4275  * Add an additional value name/value pair to the Voice Quality.
4276  *
4277  * The name and value are null delimited ASCII strings.  The library takes
4278  * a copy so the caller does not have to preserve values after the function
4279  * returns.
4280  *
4281  * @param fault     Pointer to the fault.
4282  * @param name      ASCIIZ string with the attribute's name.  The caller
4283  *                  does not need to preserve the value once the function
4284  *                  returns.
4285  * @param value     ASCIIZ string with the attribute's value.  The caller
4286  *                  does not need to preserve the value once the function
4287  *                  returns.
4288  *****************************************************************************/
4289 void evel_voice_quality_addl_info_add(EVENT_VOICE_QUALITY * voiceQuality, char * name, char * value);
4290
4291
4292 /*****************************************************************************/
4293 /*****************************************************************************/
4294 /*                                                                           */
4295 /*   THRESHOLD CROSSING ALERT                                                */
4296 /*                                                                           */
4297 /*****************************************************************************/
4298 /*****************************************************************************/
4299
4300 typedef enum evel_event_action {
4301           EVEL_EVENT_ACTION_CLEAR,
4302           EVEL_EVENT_ACTION_CONTINUE,
4303           EVEL_EVENT_ACTION_SET,
4304           EVEL_MAX_EVENT_ACTION
4305 }EVEL_EVENT_ACTION;
4306         
4307 typedef enum evel_alert_type {
4308          EVEL_CARD_ANOMALY, 
4309          EVEL_ELEMENT_ANOMALY, 
4310          EVEL_INTERFACE_ANOMALY, 
4311          EVEL_SERVICE_ANOMALY,
4312          EVEL_MAX_ANOMALY
4313 }EVEL_ALERT_TYPE;
4314
4315
4316 typedef struct perf_counter {
4317         char * criticality;
4318         char * name;
4319         char * thresholdCrossed;
4320         char * value;
4321 }PERF_COUNTER;
4322
4323
4324 /*****************************************************************************/
4325 /* Supported Threshold Crossing version.                                     */
4326 /*****************************************************************************/
4327 #define EVEL_THRESHOLD_CROSS_MAJOR_VERSION 2
4328 #define EVEL_THRESHOLD_CROSS_MINOR_VERSION 0
4329
4330 /**************************************************************************//**
4331  * Threshold Crossing.
4332  * JSON equivalent field: Threshold Cross Fields
4333  *****************************************************************************/
4334 typedef struct event_threshold_cross {
4335   /***************************************************************************/
4336   /* Header and version                                                      */
4337   /***************************************************************************/
4338   EVENT_HEADER header;
4339   int major_version;
4340   int minor_version;
4341
4342   /***************************************************************************/
4343   /* Mandatory fields                                                        */
4344   /***************************************************************************/
4345   PERF_COUNTER additionalParameters;
4346   EVEL_EVENT_ACTION  alertAction;
4347   char *             alertDescription; 
4348   EVEL_ALERT_TYPE    alertType;
4349   unsigned long long collectionTimestamp; 
4350   EVEL_SEVERITIES    eventSeverity;
4351   unsigned long long eventStartTimestamp;
4352
4353   /***************************************************************************/
4354   /* Optional fields                                                         */
4355   /***************************************************************************/
4356   DLIST additional_info;
4357   EVEL_OPTION_STRING    alertValue;
4358   DLIST     alertidList;
4359   EVEL_OPTION_STRING    dataCollector;
4360   EVEL_OPTION_STRING    elementType;
4361   EVEL_OPTION_STRING    interfaceName;
4362   EVEL_OPTION_STRING    networkService;
4363   EVEL_OPTION_STRING    possibleRootCause;
4364
4365 } EVENT_THRESHOLD_CROSS;
4366
4367
4368 /**************************************************************************//**
4369  * Create a new Threshold Crossing Alert event.
4370  *
4371  * @note    The mandatory fields on the TCA must be supplied to this factory
4372  *          function and are immutable once set.  Optional fields have explicit
4373  *          setter functions, but again values may only be set once so that the
4374  *          TCA has immutable properties.
4375  *
4376  * @param event_name    Unique Event Name
4377  * @param event_id    A universal identifier of the event for analysis etc
4378  * @param char* tcriticality   Performance Counter Criticality MAJ MIN,
4379  * @param char* tname          Performance Counter Threshold name
4380  * @param char* tthresholdCrossed  Counter Threshold crossed value
4381  * @param char* tvalue             Counter actual value
4382  * @param EVEL_EVENT_ACTION talertAction   Alert set continue or clear
4383  * @param char*  talertDescription
4384  * @param EVEL_ALERT_TYPE     talertType    Kind of anamoly
4385  * @param unsigned long long  tcollectionTimestamp time at which alert was collected
4386  * @param EVEL_SEVERITIES     teventSeverity  Severity of Alert
4387  * @param unsigned long long  teventStartTimestamp Time when this alert started
4388  *
4389  * @returns pointer to the newly manufactured ::EVENT_THRESHOLD_CROSS.  If the
4390  *          event is not used it must be released using
4391  *          ::evel_free_threshold_cross
4392  * @retval  NULL  Failed to create the event.
4393  *****************************************************************************/
4394 EVENT_THRESHOLD_CROSS * evel_new_threshold_cross(
4395                                 const char* ev_name, const char *ev_id,
4396                                char * tcriticality,
4397                                char * tname,
4398                                char * tthresholdCrossed,
4399                                char * tvalue,
4400                                EVEL_EVENT_ACTION  talertAction,
4401                                char *             talertDescription, 
4402                                EVEL_ALERT_TYPE    talertType,
4403                                unsigned long long tcollectionTimestamp, 
4404                                EVEL_SEVERITIES    teventSeverity,
4405                                unsigned long long teventStartTimestamp);
4406
4407 /**************************************************************************//**
4408  * Free a Threshold cross event.
4409  *
4410  * Free off the Threshold crossing event supplied.  Will free all the contained allocated
4411  * memory.
4412  *
4413  * @note It does not free the Threshold Cross itself, since that may be part of a
4414  * larger structure.
4415  *****************************************************************************/
4416 void evel_free_threshold_cross(EVENT_THRESHOLD_CROSS * const tcp);
4417
4418 /**************************************************************************//**
4419  * Set the Event Type property of the Threshold Cross.
4420  *
4421  * @note  The property is treated as immutable: it is only valid to call
4422  *        the setter once.  However, we don't assert if the caller tries to
4423  *        overwrite, just ignoring the update instead.
4424  *
4425  * @param tcp  Pointer to the ::EVENT_THRESHOLD_CROSS.
4426  * @param type          The Event Type to be set. ASCIIZ string. The caller
4427  *                      does not need to preserve the value once the function
4428  *                      returns.
4429  *****************************************************************************/
4430 void evel_threshold_cross_type_set(EVENT_THRESHOLD_CROSS * const tcp, char * type);
4431
4432 /**************************************************************************//**
4433  * Add an optional additional alertid value to Alert.
4434  *
4435  * @param alertid  Adds Alert ID
4436  *****************************************************************************/
4437 void evel_threshold_cross_alertid_add(EVENT_THRESHOLD_CROSS * const event,char *  alertid);
4438
4439   /**************************************************************************//**
4440    * Set the TCA probable Root cause.
4441    *
4442    * @param sheader     Possible root cause to Threshold
4443    *****************************************************************************/
4444   void evel_threshold_cross_possible_rootcause_set(EVENT_THRESHOLD_CROSS * const event, char *  sheader);
4445   /**************************************************************************//**
4446    * Set the TCA networking cause.
4447    *
4448    * @param sheader     Possible networking service value to Threshold
4449    *****************************************************************************/
4450   void evel_threshold_cross_networkservice_set(EVENT_THRESHOLD_CROSS * const event, char *  sheader);
4451   /**************************************************************************//**
4452    * Set the TCA Interface name.
4453    *
4454    * @param sheader     Interface name to threshold
4455    *****************************************************************************/
4456   void evel_threshold_cross_interfacename_set(EVENT_THRESHOLD_CROSS * const event,char *  sheader);
4457   /**************************************************************************//**
4458    * Set the TCA Data element type.
4459    *
4460    * @param sheader     element type of Threshold
4461    *****************************************************************************/
4462   void evel_threshold_cross_data_elementtype_set(EVENT_THRESHOLD_CROSS * const event,char *  sheader);
4463   /**************************************************************************//**
4464    * Set the TCA Data collector value.
4465    *
4466    * @param sheader     Data collector value
4467    *****************************************************************************/
4468   void evel_threshold_cross_data_collector_set(EVENT_THRESHOLD_CROSS * const event,char *  sheader);
4469   /**************************************************************************//**
4470    * Set the TCA alert value.
4471    *
4472    * @param sheader     Possible alert value
4473    *****************************************************************************/
4474   void evel_threshold_cross_alertvalue_set(EVENT_THRESHOLD_CROSS * const event,char *  sheader);
4475
4476 /**************************************************************************//**
4477  * Add an additional field name/value pair to the THRESHOLD CROSS event.
4478  *
4479  * The name and value are null delimited ASCII strings.  The library takes
4480  * a copy so the caller does not have to preserve values after the function
4481  * returns.
4482  *
4483  * @param state_change  Pointer to the ::EVENT_THRESHOLD_CROSS.
4484  * @param name          ASCIIZ string with the attribute's name.  The caller
4485  *                      does not need to preserve the value once the function
4486  *                      returns.
4487  * @param value         ASCIIZ string with the attribute's value.  The caller
4488  *                      does not need to preserve the value once the function
4489  *                      returns.
4490  *****************************************************************************/
4491 void evel_threshold_cross_addl_info_add(EVENT_THRESHOLD_CROSS * const tcp,
4492                                       const char * const name,
4493                                       const char * const value);
4494
4495 /*****************************************************************************/
4496 /*****************************************************************************/
4497 /*                                                                           */
4498 /*   LOGGING                                                                 */
4499 /*                                                                           */
4500 /*****************************************************************************/
4501 /*****************************************************************************/
4502
4503 /*****************************************************************************/
4504 /* Debug macros.                                                             */
4505 /*****************************************************************************/
4506 #define EVEL_DEBUG(FMT, ...)   log_debug(EVEL_LOG_DEBUG, (FMT), ##__VA_ARGS__)
4507 #define EVEL_INFO(FMT, ...)    log_debug(EVEL_LOG_INFO, (FMT), ##__VA_ARGS__)
4508 #define EVEL_SPAMMY(FMT, ...)  log_debug(EVEL_LOG_SPAMMY, (FMT), ##__VA_ARGS__)
4509 #define EVEL_ERROR(FMT, ...)   log_debug(EVEL_LOG_ERROR, "ERROR: " FMT, \
4510                                          ##__VA_ARGS__)
4511 #define EVEL_ENTER()                                                          \
4512         {                                                                     \
4513           log_debug(EVEL_LOG_DEBUG, "Enter %s {", __FUNCTION__);              \
4514           debug_indent += 2;                                                  \
4515         }
4516 #define EVEL_EXIT()                                                           \
4517         {                                                                     \
4518           debug_indent -= 2;                                                  \
4519           log_debug(EVEL_LOG_DEBUG, "Exit %s }", __FUNCTION__);               \
4520         }
4521
4522 #define INDENT_SEPARATORS                                                     \
4523         "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "
4524
4525 extern EVEL_LOG_LEVELS debug_level;
4526 extern int debug_indent;
4527 extern FILE * fout;
4528
4529 #define EVEL_DEBUG_ON() ((debug_level) >= EVEL_LOG_DEBUG)
4530
4531 /**************************************************************************//**
4532  * Initialize logging
4533  *
4534  * @param[in] level  The debugging level - one of ::EVEL_LOG_LEVELS.
4535  * @param[in] ident  The identifier for our logs.
4536  *****************************************************************************/
4537 void log_initialize(EVEL_LOG_LEVELS level, const char * ident);
4538
4539 /**************************************************************************//**
4540  * Log debug information
4541  *
4542  * Logs debugging information in a platform independent manner.
4543  *
4544  * @param[in] level   The debugging level - one of ::EVEL_LOG_LEVELS.
4545  * @param[in] format  Log formatting string in printf format.
4546  * @param[in] ...     Variable argument list.
4547  *****************************************************************************/
4548 void log_debug(EVEL_LOG_LEVELS level, char * format, ...);
4549
4550 /***************************************************************************//*
4551  * Store the formatted string into the static error string and log the error.
4552  *
4553  * @param format  Error string in standard printf format.
4554  * @param ...     Variable parameters to be substituted into the format string.
4555  *****************************************************************************/
4556 void log_error_state(char * format, ...);
4557
4558 #ifdef __cplusplus
4559 }
4560 #endif
4561
4562 #endif
4563