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