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