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