b483b1f018eb7c6cfe2d87a546dbc301c2208287
[demo.git] / vnfs / VES5.0 / evel / evel-library / code / evel_library / evel.h
1 /*************************************************************************//**
2  *
3  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and 
14  * limitations under the License.
15  *
16  ****************************************************************************/
17
18 /**************************************************************************//**
19  * @file
20  * Header for EVEL library
21  *
22  * This file implements the EVEL library which is intended to provide a
23  * simple wrapper around the complexity of AT&T's Vendor Event Listener API so
24  * that VNFs can use it without worrying about details of the API transport.
25  *
26  * Zero return value is success (::EVEL_SUCCESS), non-zero is failure and will
27  * be one of ::EVEL_ERR_CODES.
28  *****************************************************************************/
29
30 #ifndef EVEL_INCLUDED
31 #define EVEL_INCLUDED
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include <stdbool.h>
38 #include <stdio.h>
39 #include <stdarg.h>
40 #include <time.h>
41
42 #include "jsmn.h"
43 #include "double_list.h"
44 #include "hashtable.h"
45
46 /*****************************************************************************/
47 /* Supported API version.                                                    */
48 /*****************************************************************************/
49 #define EVEL_API_MAJOR_VERSION 5
50 #define EVEL_API_MINOR_VERSION 0
51
52 /**************************************************************************//**
53  * Error codes
54  *
55  * Error codes for EVEL low level interface
56  *****************************************************************************/
57 typedef enum {
58   EVEL_SUCCESS,                   /** The operation was successful.          */
59   EVEL_ERR_GEN_FAIL,              /** Non-specific failure.                  */
60   EVEL_CURL_LIBRARY_FAIL,         /** A cURL library operation failed.       */
61   EVEL_PTHREAD_LIBRARY_FAIL,      /** A Posix threads operation failed.      */
62   EVEL_OUT_OF_MEMORY,             /** A memory allocation failure occurred.  */
63   EVEL_EVENT_BUFFER_FULL,         /** Too many events in the ring-buffer.    */
64   EVEL_EVENT_HANDLER_INACTIVE,    /** Attempt to raise event when inactive.  */
65   EVEL_NO_METADATA,               /** Failed to retrieve OpenStack metadata. */
66   EVEL_BAD_METADATA,              /** OpenStack metadata invalid format.     */
67   EVEL_BAD_JSON_FORMAT,           /** JSON failed to parse correctly.        */
68   EVEL_JSON_KEY_NOT_FOUND,        /** Failed to find the specified JSON key. */
69   EVEL_MAX_ERROR_CODES            /** Maximum number of valid error codes.   */
70 } EVEL_ERR_CODES;
71
72 /**************************************************************************//**
73  * Logging levels
74  *
75  * Variable levels of verbosity in the logging functions.
76  *****************************************************************************/
77 typedef enum {
78   EVEL_LOG_MIN               = 0,
79   EVEL_LOG_SPAMMY            = 30,
80   EVEL_LOG_DEBUG             = 40,
81   EVEL_LOG_INFO              = 50,
82   EVEL_LOG_ERROR             = 60,
83   EVEL_LOG_MAX               = 101
84 } EVEL_LOG_LEVELS;
85
86 /*****************************************************************************/
87 /* Maximum string lengths.                                                   */
88 /*****************************************************************************/
89 #define EVEL_MAX_STRING_LEN          4096
90 #define EVEL_MAX_JSON_BODY           524288
91 #define EVEL_MAX_ERROR_STRING_LEN    255
92 #define EVEL_MAX_URL_LEN             511
93
94 /**************************************************************************//**
95  * This value represents there being no restriction on the reporting interval.
96  *****************************************************************************/
97 static const int EVEL_MEASUREMENT_INTERVAL_UKNOWN = 0;
98
99 /**************************************************************************//**
100  * How many events can be backed-up before we start dropping events on the
101  * floor.
102  *
103  * @note  This value should be tuned in accordance with expected burstiness of
104  *        the event load and the expected response time of the ECOMP event
105  *        listener so that the probability of the buffer filling is suitably
106  *        low.
107  *****************************************************************************/
108 static const int EVEL_EVENT_BUFFER_DEPTH = 100;
109
110 /*****************************************************************************/
111 /* How many different IP Types-of-Service are supported.                     */
112 /*****************************************************************************/
113 #define EVEL_TOS_SUPPORTED      256
114
115 /**************************************************************************//**
116  * Event domains for the various events we support.
117  * JSON equivalent field: domain
118  *****************************************************************************/
119 typedef enum {
120   EVEL_DOMAIN_INTERNAL,       /** Internal event, not for external routing.  */
121   EVEL_DOMAIN_BATCH,          /** Batch event, composite event.              */
122   EVEL_DOMAIN_HEARTBEAT,      /** A Heartbeat event (event header only).     */
123   EVEL_DOMAIN_FAULT,          /** A Fault event.                             */
124   EVEL_DOMAIN_MEASUREMENT,    /** A Measurement for VF Scaling event.        */
125   EVEL_DOMAIN_MOBILE_FLOW,    /** A Mobile Flow event.                       */
126   EVEL_DOMAIN_REPORT,         /** A Measurement for VF Reporting event.      */
127   EVEL_DOMAIN_HEARTBEAT_FIELD,/** A Heartbeat field event.                   */
128   EVEL_DOMAIN_SIPSIGNALING,   /** A Signaling event.                         */
129   EVEL_DOMAIN_STATE_CHANGE,   /** A State Change event.                      */
130   EVEL_DOMAIN_SYSLOG,         /** A Syslog event.                            */
131   EVEL_DOMAIN_OTHER,          /** Another event.                             */
132   EVEL_DOMAIN_THRESHOLD_CROSS,  /** A Threshold Crossing  Event              */
133   EVEL_DOMAIN_VOICE_QUALITY,  /** A Voice Quality Event                      */
134   EVEL_MAX_DOMAINS            /** Maximum number of recognized Event types.  */
135 } EVEL_EVENT_DOMAINS;
136
137 /**************************************************************************//**
138  * Event priorities.
139  * JSON equivalent field: priority
140  *****************************************************************************/
141 typedef enum {
142   EVEL_PRIORITY_HIGH,
143   EVEL_PRIORITY_MEDIUM,
144   EVEL_PRIORITY_NORMAL,
145   EVEL_PRIORITY_LOW,
146   EVEL_MAX_PRIORITIES
147 } EVEL_EVENT_PRIORITIES;
148
149 /**************************************************************************//**
150  * Fault / Threshold severities.
151  * JSON equivalent field: eventSeverity
152  *****************************************************************************/
153 typedef enum {
154   EVEL_SEVERITY_CRITICAL,
155   EVEL_SEVERITY_MAJOR,
156   EVEL_SEVERITY_MINOR,
157   EVEL_SEVERITY_WARNING,
158   EVEL_SEVERITY_NORMAL,
159   EVEL_MAX_SEVERITIES
160 } EVEL_SEVERITIES;
161
162 /**************************************************************************//**
163  * Fault source types.
164  * JSON equivalent field: eventSourceType
165  *****************************************************************************/
166 typedef enum {
167   EVEL_SOURCE_OTHER,
168   EVEL_SOURCE_ROUTER,
169   EVEL_SOURCE_SWITCH,
170   EVEL_SOURCE_HOST,
171   EVEL_SOURCE_CARD,
172   EVEL_SOURCE_PORT,
173   EVEL_SOURCE_SLOT_THRESHOLD,
174   EVEL_SOURCE_PORT_THRESHOLD,
175   EVEL_SOURCE_VIRTUAL_MACHINE,
176   EVEL_SOURCE_VIRTUAL_NETWORK_FUNCTION,
177   /***************************************************************************/
178   /* START OF VENDOR-SPECIFIC VALUES                                         */
179   /*                                                                         */
180   /* Vendor-specific values should be added here, and handled appropriately  */
181   /* in evel_event.c.                                                        */
182   /***************************************************************************/
183
184   /***************************************************************************/
185   /* END OF VENDOR-SPECIFIC VALUES                                           */
186   /***************************************************************************/
187   EVEL_MAX_SOURCE_TYPES
188 } EVEL_SOURCE_TYPES;
189
190 /**************************************************************************//**
191  * Fault VNF Status.
192  * JSON equivalent field: vfStatus
193  *****************************************************************************/
194 typedef enum {
195   EVEL_VF_STATUS_ACTIVE,
196   EVEL_VF_STATUS_IDLE,
197   EVEL_VF_STATUS_PREP_TERMINATE,
198   EVEL_VF_STATUS_READY_TERMINATE,
199   EVEL_VF_STATUS_REQ_TERMINATE,
200   EVEL_MAX_VF_STATUSES
201 } EVEL_VF_STATUSES;
202
203 /**************************************************************************//**
204  * Counter criticalities.
205  * JSON equivalent field: criticality
206  *****************************************************************************/
207 typedef enum {
208   EVEL_COUNTER_CRITICALITY_CRIT,
209   EVEL_COUNTER_CRITICALITY_MAJ,
210   EVEL_MAX_COUNTER_CRITICALITIES
211 } EVEL_COUNTER_CRITICALITIES;
212
213 /**************************************************************************//**
214  * Alert actions.
215  * JSON equivalent field: alertAction
216  *****************************************************************************/
217 typedef enum {
218   EVEL_ALERT_ACTION_CLEAR,
219   EVEL_ALERT_ACTION_CONT,
220   EVEL_ALERT_ACTION_SET,
221   EVEL_MAX_ALERT_ACTIONS
222 } EVEL_ALERT_ACTIONS;
223
224 /**************************************************************************//**
225  * Alert types.
226  * JSON equivalent field: alertType
227  *****************************************************************************/
228 typedef enum {
229   EVEL_ALERT_TYPE_CARD,
230   EVEL_ALERT_TYPE_ELEMENT,
231   EVEL_ALERT_TYPE_INTERFACE,
232   EVEL_ALERT_TYPE_SERVICE,
233   EVEL_MAX_ALERT_TYPES
234 } EVEL_ALERT_TYPES;
235
236 /**************************************************************************//**
237  * Alert types.
238  * JSON equivalent fields: newState, oldState
239  *****************************************************************************/
240 typedef enum {
241   EVEL_ENTITY_STATE_IN_SERVICE,
242   EVEL_ENTITY_STATE_MAINTENANCE,
243   EVEL_ENTITY_STATE_OUT_OF_SERVICE,
244   EVEL_MAX_ENTITY_STATES
245 } EVEL_ENTITY_STATE;
246
247 /**************************************************************************//**
248  * Syslog facilities.
249  * JSON equivalent field: syslogFacility
250  *****************************************************************************/
251 typedef enum {
252   EVEL_SYSLOG_FACILITY_KERNEL,
253   EVEL_SYSLOG_FACILITY_USER,
254   EVEL_SYSLOG_FACILITY_MAIL,
255   EVEL_SYSLOG_FACILITY_SYSTEM_DAEMON,
256   EVEL_SYSLOG_FACILITY_SECURITY_AUTH,
257   EVEL_SYSLOG_FACILITY_INTERNAL,
258   EVEL_SYSLOG_FACILITY_LINE_PRINTER,
259   EVEL_SYSLOG_FACILITY_NETWORK_NEWS,
260   EVEL_SYSLOG_FACILITY_UUCP,
261   EVEL_SYSLOG_FACILITY_CLOCK_DAEMON,
262   EVEL_SYSLOG_FACILITY_SECURITY_AUTH2,
263   EVEL_SYSLOG_FACILITY_FTP_DAEMON,
264   EVEL_SYSLOG_FACILITY_NTP,
265   EVEL_SYSLOG_FACILITY_LOG_AUDIT,
266   EVEL_SYSLOG_FACILITY_LOG_ALERT,
267   EVEL_SYSLOG_FACILITY_CLOCK_DAEMON2,
268   EVEL_SYSLOG_FACILITY_LOCAL0,
269   EVEL_SYSLOG_FACILITY_LOCAL1,
270   EVEL_SYSLOG_FACILITY_LOCAL2,
271   EVEL_SYSLOG_FACILITY_LOCAL3,
272   EVEL_SYSLOG_FACILITY_LOCAL4,
273   EVEL_SYSLOG_FACILITY_LOCAL5,
274   EVEL_SYSLOG_FACILITY_LOCAL6,
275   EVEL_SYSLOG_FACILITY_LOCAL7,
276   EVEL_MAX_SYSLOG_FACILITIES
277 } EVEL_SYSLOG_FACILITIES;
278
279 /**************************************************************************//**
280  * TCP flags.
281  * JSON equivalent fields: tcpFlagCountList, tcpFlagList
282  *****************************************************************************/
283 typedef enum {
284   EVEL_TCP_NS,
285   EVEL_TCP_CWR,
286   EVEL_TCP_ECE,
287   EVEL_TCP_URG,
288   EVEL_TCP_ACK,
289   EVEL_TCP_PSH,
290   EVEL_TCP_RST,
291   EVEL_TCP_SYN,
292   EVEL_TCP_FIN,
293   EVEL_MAX_TCP_FLAGS
294 } EVEL_TCP_FLAGS;
295
296 /**************************************************************************//**
297  * Mobile QCI Classes of Service.
298  * JSON equivalent fields: mobileQciCosCountList, mobileQciCosList
299  *****************************************************************************/
300 typedef enum {
301
302   /***************************************************************************/
303   /* UMTS Classes of Service.                                                */
304   /***************************************************************************/
305   EVEL_QCI_COS_UMTS_CONVERSATIONAL,
306   EVEL_QCI_COS_UMTS_STREAMING,
307   EVEL_QCI_COS_UMTS_INTERACTIVE,
308   EVEL_QCI_COS_UMTS_BACKGROUND,
309
310   /***************************************************************************/
311   /* LTE Classes of Service.                                                 */
312   /***************************************************************************/
313   EVEL_QCI_COS_LTE_1,
314   EVEL_QCI_COS_LTE_2,
315   EVEL_QCI_COS_LTE_3,
316   EVEL_QCI_COS_LTE_4,
317   EVEL_QCI_COS_LTE_65,
318   EVEL_QCI_COS_LTE_66,
319   EVEL_QCI_COS_LTE_5,
320   EVEL_QCI_COS_LTE_6,
321   EVEL_QCI_COS_LTE_7,
322   EVEL_QCI_COS_LTE_8,
323   EVEL_QCI_COS_LTE_9,
324   EVEL_QCI_COS_LTE_69,
325   EVEL_QCI_COS_LTE_70,
326   EVEL_MAX_QCI_COS_TYPES
327 } EVEL_QCI_COS_TYPES;
328
329 /**************************************************************************//**
330  * Service Event endpoint description
331  * JSON equivalent field: endpointDesc
332  *****************************************************************************/
333 typedef enum {
334   EVEL_SERVICE_ENDPOINT_CALLEE,
335   EVEL_SERVICE_ENDPOINT_CALLER,
336   EVEL_MAX_SERVICE_ENDPOINT_DESC
337 } EVEL_SERVICE_ENDPOINT_DESC;
338
339 /**************************************************************************//**
340  * Boolean type for EVEL library.
341  *****************************************************************************/
342 typedef enum {
343   EVEL_FALSE,
344   EVEL_TRUE
345 } EVEL_BOOLEAN;
346
347 /**************************************************************************//**
348  * Optional parameter holder for double.
349  *****************************************************************************/
350 typedef struct evel_option_double
351 {
352   double value;
353   EVEL_BOOLEAN is_set;
354 } EVEL_OPTION_DOUBLE;
355
356 /**************************************************************************//**
357  * Optional parameter holder for string.
358  *****************************************************************************/
359 typedef struct evel_option_string
360 {
361   char * value;
362   EVEL_BOOLEAN is_set;
363 } EVEL_OPTION_STRING;
364
365 /**************************************************************************//**
366  * Optional parameter holder for int.
367  *****************************************************************************/
368 typedef struct evel_option_int
369 {
370   int value;
371   EVEL_BOOLEAN is_set;
372 } EVEL_OPTION_INT;
373
374 /**************************************************************************//**
375  * Optional parameter holder for unsigned long long.
376  *****************************************************************************/
377 typedef struct evel_option_ull
378 {
379   unsigned long long value;
380   EVEL_BOOLEAN is_set;
381 } EVEL_OPTION_ULL;
382
383 /**************************************************************************//**
384  * Optional parameter holder for time_t.
385  *****************************************************************************/
386 typedef struct evel_option_time
387 {
388   time_t value;
389   EVEL_BOOLEAN is_set;
390 } EVEL_OPTION_TIME;
391
392 /**************************************************************************//**
393  * enrichment fields for internal VES Event Listener service use only,
394  * not supplied by event sources
395  *****************************************************************************/
396 typedef struct internal_header_fields
397 {
398   void *object;
399   EVEL_BOOLEAN is_set;
400 } EVEL_OPTION_INTHEADER_FIELDS;
401
402 /*****************************************************************************/
403 /* Supported Common Event Header version.                                    */
404 /*****************************************************************************/
405 #define EVEL_HEADER_MAJOR_VERSION 3
406 #define EVEL_HEADER_MINOR_VERSION 0
407
408 #define EVEL_BATCH_MAJOR_VERSION 1
409 #define EVEL_BATCH_MINOR_VERSION 0
410 /**************************************************************************//**
411  * Event header.
412  * JSON equivalent field: commonEventHeader
413  *****************************************************************************/
414 typedef struct event_header {
415   /***************************************************************************/
416   /* Version                                                                 */
417   /***************************************************************************/
418   int major_version;
419   int minor_version;
420
421   /***************************************************************************/
422   /* Mandatory fields                                                        */
423   /***************************************************************************/
424   EVEL_EVENT_DOMAINS event_domain;
425   char * event_id;
426   char * event_name;
427   char * source_name;
428   char * reporting_entity_name;
429   EVEL_EVENT_PRIORITIES priority;
430   unsigned long long start_epoch_microsec;
431   unsigned long long last_epoch_microsec;
432   int sequence;
433
434   /***************************************************************************/
435   /* Optional fields                                                         */
436   /***************************************************************************/
437   EVEL_OPTION_STRING event_type;
438   EVEL_OPTION_STRING source_id;
439   EVEL_OPTION_STRING reporting_entity_id;
440   EVEL_OPTION_INTHEADER_FIELDS internal_field;
441   EVEL_OPTION_STRING nfcnaming_code;
442   EVEL_OPTION_STRING nfnaming_code;
443   DLIST batch_events;
444
445 } EVENT_HEADER;
446
447 /**************************************************************************//**
448  * Initialize a newly created event header.
449  *
450  * @param header  Pointer to the header being initialized.
451  * @param eventname Eventname string
452  * @param eventid   Event id : unique id for classification and analysis
453  * @param header  Pointer to the header being initialized.
454  *****************************************************************************/
455 void evel_init_header_nameid(EVENT_HEADER * const header,const char *const eventname, const char *eventid);
456
457 /**************************************************************************//**
458  * Create a new Batch event.
459  *
460  * @note    The mandatory fields on the Batch must be supplied to this factory
461  *          function and are immutable once set.  Optional fields have explicit
462  *          setter functions, but again values may only be set once so that the
463  *          Batch has immutable properties. At this time evename and eventid
464  *          for batch events are set but not used in json encoding
465  * @returns pointer to the newly manufactured ::EVENT_HEADER.  If the event is
466  *          not used (i.e. posted) it must be released using ::evel_free_batch.
467  * @retval  NULL  Failed to create the event.
468  *****************************************************************************/
469 EVENT_HEADER * evel_new_batch(const char* ev_name, const char *ev_id);
470
471
472 /**************************************************************************//**
473  * Add an Event into Batch Event
474  *
475  * The name and value are null delimited ASCII strings.  The library takes
476  * a copy so the caller does not have to preserve values after the function
477  * returns.
478  *
479  * @param other     Pointer to the Batch Event.
480  * @param jsonobj   Pointer to  additional Event
481  *****************************************************************************/
482 void evel_batch_add_event(EVENT_HEADER * batchev, EVENT_HEADER *child);
483
484 /**************************************************************************//**
485  * Free an Batch.
486  *
487  * Free off the Batch supplied.  Will free all the contained allocated memory.
488  *
489  * @note It does not free the Batch itself, since that may be part of a
490  * larger structure.
491  *****************************************************************************/
492 void evel_free_batch(EVENT_HEADER * event);
493
494 /*****************************************************************************/
495 /* Supported Fault version.                                                  */
496 /*****************************************************************************/
497 #define EVEL_FAULT_MAJOR_VERSION 2
498 #define EVEL_FAULT_MINOR_VERSION 1
499
500 /**************************************************************************//**
501  * Fault.
502  * JSON equivalent field: faultFields
503  *****************************************************************************/
504 typedef struct event_fault {
505   /***************************************************************************/
506   /* Header and version                                                      */
507   /***************************************************************************/
508   EVENT_HEADER header;
509   int major_version;
510   int minor_version;
511
512   /***************************************************************************/
513   /* Mandatory fields                                                        */
514   /***************************************************************************/
515   EVEL_SEVERITIES event_severity;
516   EVEL_SOURCE_TYPES event_source_type;
517   char * alarm_condition;
518   char * specific_problem;
519   EVEL_VF_STATUSES vf_status;
520
521   /***************************************************************************/
522   /* Optional fields                                                         */
523   /***************************************************************************/
524   EVEL_OPTION_STRING category;
525   EVEL_OPTION_STRING alarm_interface_a;
526   DLIST additional_info;
527
528 } EVENT_FAULT;
529
530 /**************************************************************************//**
531  * Fault Additional Info.
532  * JSON equivalent field: alarmAdditionalInformation
533  *****************************************************************************/
534 typedef struct fault_additional_info {
535   char * name;
536   char * value;
537 } FAULT_ADDL_INFO;
538
539
540 /**************************************************************************//**
541  * optional field block for fields specific to heartbeat events
542  *****************************************************************************/
543 typedef struct event_heartbeat_fields
544 {
545   /***************************************************************************/
546   /* Header and version                                                      */
547   /***************************************************************************/
548   EVENT_HEADER header;
549   int major_version;
550   int minor_version;
551
552   /***************************************************************************/
553   /* Mandatory fields                                                        */
554   /***************************************************************************/
555   double heartbeat_version;
556   int    heartbeat_interval;
557
558   /***************************************************************************/
559   /* Optional fields                                                         */
560   /***************************************************************************/
561   DLIST additional_info;
562
563 } EVENT_HEARTBEAT_FIELD;
564
565 /**************************************************************************//**
566  * tuple which provides the name of a key along with its value and
567  * relative order
568  *****************************************************************************/
569 typedef struct internal_key
570 {
571   char                *keyname;
572   EVEL_OPTION_INT      keyorder;
573   EVEL_OPTION_STRING   keyvalue;
574 } EVEL_INTERNAL_KEY;
575
576 /**************************************************************************//**
577  * meta-information about an instance of a jsonObject along with
578  * the actual object instance
579  *****************************************************************************/
580 typedef struct json_object_instance
581 {
582
583   char *jsonstring;
584   unsigned long long objinst_epoch_microsec;
585   DLIST object_keys; /*EVEL_INTERNAL_KEY list */
586
587 } EVEL_JSON_OBJECT_INSTANCE;
588 #define MAX_JSON_TOKENS 128
589 /**************************************************************************//**
590  * Create a new json object instance.
591  *
592  * @note    The mandatory fields on the Other must be supplied to this factory
593  *          function and are immutable once set.  Optional fields have explicit
594  *          setter functions, but again values may only be set once so that the
595  *          Other has immutable properties.
596  * @param   yourjson       json string.
597  * @returns pointer to the newly manufactured ::EVEL_JSON_OBJECT_INSTANCE.
598  *          not used (i.e. posted) it must be released using ::evel_free_jsonobjectinstance.
599  * @retval  NULL  Failed to create the json object instance.
600  *****************************************************************************/
601 EVEL_JSON_OBJECT_INSTANCE * evel_new_jsonobjinstance(const char *const yourjson);
602 /**************************************************************************//**
603  * Free an json object instance.
604  *
605  * Free off the json object instance supplied.
606  *  Will free all the contained allocated memory.
607  *
608  *****************************************************************************/
609 void evel_free_jsonobjinst(EVEL_JSON_OBJECT_INSTANCE * objinst);
610
611 /**************************************************************************//**
612  * enrichment fields for internal VES Event Listener service use only,
613  * not supplied by event sources
614  *****************************************************************************/
615 typedef struct json_object
616 {
617
618   char *object_name;
619   EVEL_OPTION_STRING objectschema;
620   EVEL_OPTION_STRING objectschemaurl;
621   EVEL_OPTION_STRING nfsubscribedobjname;
622   EVEL_OPTION_STRING nfsubscriptionid;
623   DLIST jsonobjectinstances;  /* EVEL_JSON_OBJECT_INSTANCE list */
624
625 } EVEL_JSON_OBJECT;
626
627 /**************************************************************************//**
628  * Create a new json object.
629  *
630  * @note    The mandatory fields on the Other must be supplied to this factory
631  *          function and are immutable once set.  Optional fields have explicit
632  *          setter functions, but again values may only be set once so that the
633  *          Other has immutable properties.
634  * @param name       name of the object.
635  * @returns pointer to the newly manufactured ::EVEL_JSON_OBJECT.
636  *          not used (i.e. posted) it must be released using ::evel_free_jsonobject.
637  * @retval  NULL  Failed to create the json object.
638  *****************************************************************************/
639 EVEL_JSON_OBJECT * evel_new_jsonobject(const char *const name);
640 /**************************************************************************//**
641  * Free an json object.
642  *
643  * Free off the json object instance supplied.
644  *  Will free all the contained allocated memory.
645  *
646  *****************************************************************************/
647 void evel_free_jsonobject(EVEL_JSON_OBJECT * jsobj);
648 /*****************************************************************************/
649 /* Supported Measurement version.                                            */
650 /*****************************************************************************/
651 #define EVEL_MEASUREMENT_MAJOR_VERSION 2
652 #define EVEL_MEASUREMENT_MINOR_VERSION 1
653
654 /**************************************************************************//**
655  * Errors.
656  * JSON equivalent field: errors
657  *****************************************************************************/
658 typedef struct measurement_errors {
659   int receive_discards;
660   int receive_errors;
661   int transmit_discards;
662   int transmit_errors;
663 } MEASUREMENT_ERRORS;
664
665 /**************************************************************************//**
666  * Measurement.
667  * JSON equivalent field: measurementsForVfScalingFields
668  *****************************************************************************/
669 typedef struct event_measurement {
670   /***************************************************************************/
671   /* Header and version                                                      */
672   /***************************************************************************/
673   EVENT_HEADER header;
674   int major_version;
675   int minor_version;
676
677   /***************************************************************************/
678   /* Mandatory fields                                                        */
679   /***************************************************************************/
680   double measurement_interval;
681
682   /***************************************************************************/
683   /* Optional fields                                                         */
684   /***************************************************************************/
685   DLIST additional_info;
686   DLIST additional_measurements;
687   DLIST additional_objects;
688   DLIST codec_usage;
689   EVEL_OPTION_INT concurrent_sessions;
690   EVEL_OPTION_INT configured_entities;
691   DLIST cpu_usage;
692   DLIST disk_usage;
693   MEASUREMENT_ERRORS * errors;
694   DLIST feature_usage;
695   DLIST filesystem_usage;
696   DLIST latency_distribution;
697   EVEL_OPTION_DOUBLE mean_request_latency;
698   DLIST mem_usage;
699   EVEL_OPTION_INT media_ports_in_use;
700   EVEL_OPTION_INT request_rate;
701   EVEL_OPTION_INT vnfc_scaling_metric;
702   DLIST vnic_usage;
703
704 } EVENT_MEASUREMENT;
705
706
707
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 1
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 1
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 1
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 1
1322 #define EVEL_STATE_CHANGE_MINOR_VERSION 2
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   path    The optional path (may be NULL).
1433  * @param   topic   The optional topic part of the URL (may be NULL).
1434  * @param   ring_buf_size   Ring buffer size (>=100) ~ Avg Messages in 1hr
1435  * @param   secure  Whether to use HTTPS (0=HTTP, 1=HTTPS).
1436  * @param   cert_file_path     Path to client certificate file
1437  * @param   key_file_path      Path to client key file
1438  * @param   ca_info            Path to CA info
1439  * @param   ca_file_path       Path to CA file
1440  * @param   verify_peer        SSL verification of peer 0 or 1
1441  * @param   verify_host        SSL verification of host 0 or 1
1442  * @param   username  Username for Basic Authentication of requests.
1443  * @param   password  Password for Basic Authentication of requests.
1444  * @param   source_ip The ip of node we represent.(NULL for default ip)
1445  * @param   source_type The kind of node we represent.
1446  * @param   role    The role this node undertakes.
1447  * @param   verbosity  0 for normal operation, positive values for chattier
1448  *                     logs.
1449  *
1450  * @returns Status code
1451  * @retval  EVEL_SUCCESS      On success
1452  * @retval  ::EVEL_ERR_CODES  On failure.
1453  *****************************************************************************/
1454 EVEL_ERR_CODES evel_initialize(const char * const fqdn,
1455                                int port,
1456                                const char * const path,
1457                                const char * const topic,
1458                                int ring_buf_size,
1459                                int secure,
1460                                const char * const cert_file_path,
1461                                const char * const key_file_path,
1462                                const char * const ca_info,
1463                                const char * const ca_file_path,
1464                                long verify_peer,
1465                                long verify_host,
1466                                const char * const username,
1467                                const char * const password,
1468                                const char * const source_ip,
1469                                EVEL_SOURCE_TYPES source_type,
1470                                const char * const role,
1471                                int verbosity
1472                                );
1473
1474 /**************************************************************************//**
1475  * Initialize value for vm_name for all coming events
1476  * @param  source_name  Source name string.
1477  *                      Must confirm with EVEL source name standard
1478  * @returns Status code
1479  * @retval  EVEL_SUCCESS      On success
1480  * @retval  ::EVEL_ERR_CODES  On failure.
1481  *****************************************************************************/
1482 EVEL_ERR_CODES evel_set_source_name(char * src_name);
1483
1484
1485 /**************************************************************************//**
1486  * Clean up the EVEL library.
1487  *
1488  * @note that at present don't expect Init/Term cycling not to leak memory!
1489  *
1490  * @returns Status code
1491  * @retval  EVEL_SUCCESS On success
1492  * @retval  "One of ::EVEL_ERR_CODES" On failure.
1493  *****************************************************************************/
1494 EVEL_ERR_CODES evel_terminate(void);
1495
1496 EVEL_ERR_CODES evel_post_event(EVENT_HEADER * event);
1497 const char * evel_error_string(void);
1498
1499
1500 /**************************************************************************//**
1501  * Free an event.
1502  *
1503  * Free off the event supplied.  Will free all the contained allocated memory.
1504  *
1505  * @note  It is safe to free a NULL pointer.
1506  *****************************************************************************/
1507 void evel_free_event(void * event);
1508
1509 /**************************************************************************//**
1510  * Encode the event as a JSON event object according to AT&T's schema.
1511  *
1512  * @param json      Pointer to where to store the JSON encoded data.
1513  * @param mode      Event mode or Batch mode
1514  * @param max_size  Size of storage available in json_body.
1515  * @param event     Pointer to the ::EVENT_HEADER to encode.
1516  * @returns Number of bytes actually written.
1517  *****************************************************************************/
1518 int evel_json_encode_event(char * json,
1519                            int max_size,
1520                            EVENT_HEADER * event);
1521 int evel_json_encode_batch_event(char * json,
1522                            int max_size,
1523                            EVENT_HEADER * event);
1524 /**************************************************************************//**
1525  * Initialize an event instance id.
1526  *
1527  * @param vfield        Pointer to the event vnfname field being initialized.
1528  * @param vendor_id     The vendor id to encode in the event instance id.
1529  * @param event_id      The event id to encode in the event instance id.
1530  *****************************************************************************/
1531 void evel_init_vendor_field(VENDOR_VNFNAME_FIELD * const vfield,
1532                                  const char * const vendor_name);
1533
1534 /**************************************************************************//**
1535  * Set the Vendor module property of the Vendor.
1536  *
1537  * @note  The property is treated as immutable: it is only valid to call
1538  *        the setter once.  However, we don't assert if the caller tries to
1539  *        overwrite, just ignoring the update instead.
1540  *
1541  * @param vfield        Pointer to the Vendor field.
1542  * @param module_name   The module name to be set. ASCIIZ string. The caller
1543  *                      does not need to preserve the value once the function
1544  *                      returns.
1545  *****************************************************************************/
1546 void evel_vendor_field_module_set(VENDOR_VNFNAME_FIELD * const vfield,
1547                                     const char * const module_name);
1548 /**************************************************************************//**
1549  * Set the Vendor module property of the Vendor.
1550  *
1551  * @note  The property is treated as immutable: it is only valid to call
1552  *        the setter once.  However, we don't assert if the caller tries to
1553  *        overwrite, just ignoring the update instead.
1554  *
1555  * @param vfield        Pointer to the Vendor field.
1556  * @param module_name   The module name to be set. ASCIIZ string. The caller
1557  *                      does not need to preserve the value once the function
1558  *                      returns.
1559  *****************************************************************************/
1560 void evel_vendor_field_vnfname_set(VENDOR_VNFNAME_FIELD * const vfield,
1561                                     const char * const vnfname);
1562 /**************************************************************************//**
1563  * Free an event instance id.
1564  *
1565  * @param vfield   Pointer to the event vnfname_field being freed.
1566  *****************************************************************************/
1567 void evel_free_event_vendor_field(VENDOR_VNFNAME_FIELD * const vfield);
1568
1569 /**************************************************************************//**
1570  * Callback function to provide returned data.
1571  *
1572  * Copy data into the supplied buffer, write_callback::ptr, checking size
1573  * limits.
1574  *
1575  * @returns   Number of bytes placed into write_callback::ptr. 0 for EOF.
1576  *****************************************************************************/
1577 size_t evel_write_callback(void *contents,
1578                            size_t size,
1579                            size_t nmemb,
1580                            void *userp);
1581
1582 /*****************************************************************************/
1583 /*****************************************************************************/
1584 /*                                                                           */
1585 /*   HEARTBEAT - (includes common header, too)                               */
1586 /*                                                                           */
1587 /*****************************************************************************/
1588 /*****************************************************************************/
1589
1590 /**************************************************************************//**
1591  * Create a new heartbeat event.
1592  *
1593  * @note that the heartbeat is just a "naked" commonEventHeader!
1594  *
1595  * @returns pointer to the newly manufactured ::EVENT_HEADER.  If the event is
1596  *          not used it must be released using ::evel_free_event
1597  * @retval  NULL  Failed to create the event.
1598  *****************************************************************************/
1599 EVENT_HEADER * evel_new_heartbeat(void);
1600
1601 /**************************************************************************//**
1602  * Create a new heartbeat event of given name and type.
1603  *
1604  * @note that the heartbeat is just a "naked" commonEventHeader!
1605  *
1606  * @param event_name    Unique Event Name: {DomainAbbreviation}_{AsdcModel or ApplicationPlatform}_{DescriptionOfInfoBeingConveyed}
1607  * @param event_id    A universal identifier of the event for: troubleshooting, cross-referencing of alarms for alarm correlation, offline log analysis, etc
1608  *
1609  * @returns pointer to the newly manufactured ::EVENT_HEADER.  If the event is
1610  *          not used it must be released using ::evel_free_event
1611  * @retval  NULL  Failed to create the event.
1612  *****************************************************************************/
1613 EVENT_HEADER * evel_new_heartbeat_nameid(const char* ev_name, const char *ev_id);
1614
1615
1616 /**************************************************************************//**
1617  * Free an event header.
1618  *
1619  * Free off the event header supplied.  Will free all the contained allocated
1620  * memory.
1621  *
1622  * @note It does not free the header itself, since that may be part of a
1623  * larger structure.
1624  *****************************************************************************/
1625 void evel_free_header(EVENT_HEADER * const event);
1626
1627 /**************************************************************************//**
1628  * Initialize a newly created event header.
1629  *
1630  * @param header  Pointer to the header being initialized.
1631  *****************************************************************************/
1632 void evel_init_header(EVENT_HEADER * const header,const char *const eventname);
1633
1634 /**************************************************************************//**
1635  * Set the Event Type property of the event header.
1636  *
1637  * @param header        Pointer to the ::EVENT_HEADER.
1638  * @param type          The Event Type to be set. ASCIIZ string. The caller
1639  *                      does not need to preserve the value once the function
1640  *                      returns.
1641  *****************************************************************************/
1642 void evel_header_type_set(EVENT_HEADER * const header,
1643                           const char * const type);
1644
1645 /**************************************************************************//**
1646  * Set the Start Epoch property of the event header.
1647  *
1648  * @note The Start Epoch defaults to the time of event creation.
1649  *
1650  * @param header        Pointer to the ::EVENT_HEADER.
1651  * @param start_epoch_microsec
1652  *                      The start epoch to set, in microseconds.
1653  *****************************************************************************/
1654 void evel_start_epoch_set(EVENT_HEADER * const header,
1655                           const unsigned long long start_epoch_microsec);
1656
1657 /**************************************************************************//**
1658  * Set the Last Epoch property of the event header.
1659  *
1660  * @note The Last Epoch defaults to the time of event creation.
1661  *
1662  * @param header        Pointer to the ::EVENT_HEADER.
1663  * @param last_epoch_microsec
1664  *                      The last epoch to set, in microseconds.
1665  *****************************************************************************/
1666 void evel_last_epoch_set(EVENT_HEADER * const header,
1667                          const unsigned long long last_epoch_microsec);
1668
1669 /**************************************************************************//**
1670  * Set the Reporting Entity Name property of the event header.
1671  *
1672  * @note The Reporting Entity Name defaults to the OpenStack VM Name.
1673  *
1674  * @param header        Pointer to the ::EVENT_HEADER.
1675  * @param entity_name   The entity name to set.
1676  *****************************************************************************/
1677 void evel_reporting_entity_name_set(EVENT_HEADER * const header,
1678                                     const char * const entity_name);
1679
1680 /**************************************************************************//**
1681  * Set the Reporting Entity Id property of the event header.
1682  *
1683  * @note The Reporting Entity Id defaults to the OpenStack VM UUID.
1684  *
1685  * @param header        Pointer to the ::EVENT_HEADER.
1686  * @param entity_id     The entity id to set.
1687  *****************************************************************************/
1688 void evel_reporting_entity_id_set(EVENT_HEADER * const header,
1689                                   const char * const entity_id);
1690
1691 /**************************************************************************//**
1692  * Set the NFC Naming code property of the event header.
1693  *
1694  * @param header        Pointer to the ::EVENT_HEADER.
1695  * @param nfcnamingcode String
1696  *****************************************************************************/
1697 void evel_nfcnamingcode_set(EVENT_HEADER * const header,
1698                          const char * const nfcnam);
1699 /**************************************************************************//**
1700  * Set the NF Naming code property of the event header.
1701  *
1702  * @param header        Pointer to the ::EVENT_HEADER.
1703  * @param nfnamingcode String
1704  *****************************************************************************/
1705 void evel_nfnamingcode_set(EVENT_HEADER * const header,
1706                          const char * const nfnam);
1707
1708 /*****************************************************************************/
1709 /*****************************************************************************/
1710 /*                                                                           */
1711 /*   FAULT                                                                   */
1712 /*                                                                           */
1713 /*****************************************************************************/
1714 /*****************************************************************************/
1715
1716 /**************************************************************************//**
1717  * Create a new fault event.
1718  *
1719  * @note    The mandatory fields on the Fault must be supplied to this factory
1720  *          function and are immutable once set.  Optional fields have explicit
1721  *          setter functions, but again values may only be set once so that the
1722  *          Fault has immutable properties.
1723  * @param event_name    Unique Event Name
1724  * @param event_id    A universal identifier of the event for analysis etc
1725  * @param   condition   The condition indicated by the Fault.
1726  * @param   specific_problem  The specific problem triggering the fault.
1727  * @param   priority    The priority of the event.
1728  * @param   severity    The severity of the Fault.
1729  * @param   ev_source_type    Source of Alarm event
1730  * @param   version     fault version
1731  * @param   status      status of Virtual Function
1732  * @returns pointer to the newly manufactured ::EVENT_FAULT.  If the event is
1733  *          not used (i.e. posted) it must be released using ::evel_free_fault.
1734  * @retval  NULL  Failed to create the event.
1735  *****************************************************************************/
1736 EVENT_FAULT * evel_new_fault(const char* ev_name, const char *ev_id,
1737                              const char * const condition,
1738                              const char * const specific_problem,
1739                              EVEL_EVENT_PRIORITIES priority,
1740                              EVEL_SEVERITIES severity,
1741                              EVEL_SOURCE_TYPES ev_source_type,
1742                              EVEL_VF_STATUSES status);
1743
1744 /**************************************************************************//**
1745  * Free a Fault.
1746  *
1747  * Free off the Fault supplied.  Will free all the contained allocated memory.
1748  *
1749  * @note It does not free the Fault itself, since that may be part of a
1750  * larger structure.
1751  *****************************************************************************/
1752 void evel_free_fault(EVENT_FAULT * event);
1753
1754 /**************************************************************************//**
1755  * Set the Fault Category property of the Fault.
1756  *
1757  * @note  The property is treated as immutable: it is only valid to call
1758  *        the setter once.  However, we don't assert if the caller tries to
1759  *        overwrite, just ignoring the update instead.
1760  *
1761  * @param fault      Pointer to the fault.
1762  * @param category   Category : license, link, routing, security, signaling.
1763  *                       ASCIIZ string. The caller
1764  *                   does not need to preserve the value once the function
1765  *                   returns.
1766  *****************************************************************************/
1767 void evel_fault_category_set(EVENT_FAULT * fault,
1768                               const char * const category);
1769
1770 /**************************************************************************//**
1771  * Set the Alarm Interface A property of the Fault.
1772  *
1773  * @note  The property is treated as immutable: it is only valid to call
1774  *        the setter once.  However, we don't assert if the caller tries to
1775  *        overwrite, just ignoring the update instead.
1776  *
1777  * @param fault      Pointer to the fault.
1778  * @param interface  The Alarm Interface A to be set. ASCIIZ string. The caller
1779  *                   does not need to preserve the value once the function
1780  *                   returns.
1781  *****************************************************************************/
1782 void evel_fault_interface_set(EVENT_FAULT * fault,
1783                               const char * const interface);
1784
1785 /**************************************************************************//**
1786  * Add an additional value name/value pair to the Fault.
1787  *
1788  * The name and value are null delimited ASCII strings.  The library takes
1789  * a copy so the caller does not have to preserve values after the function
1790  * returns.
1791  *
1792  * @param fault     Pointer to the fault.
1793  * @param name      ASCIIZ string with the attribute's name.
1794  * @param value     ASCIIZ string with the attribute's value.
1795  *****************************************************************************/
1796 void evel_fault_addl_info_add(EVENT_FAULT * fault, char * name, char * value);
1797
1798 /**************************************************************************//**
1799  * Set the Event Type 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 type       The Event Type 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_type_set(EVENT_FAULT * fault, const char * const type);
1811
1812 /*****************************************************************************/
1813 /*****************************************************************************/
1814 /*                                                                           */
1815 /*   MEASUREMENT                                                             */
1816 /*                                                                           */
1817 /*****************************************************************************/
1818 /*****************************************************************************/
1819
1820 /**************************************************************************//**
1821  * Create a new Measurement event.
1822  *
1823  * @note    The mandatory fields on the Measurement must be supplied to this
1824  *          factory function and are immutable once set.  Optional fields have
1825  *          explicit setter functions, but again values may only be set once so
1826  *          that the Measurement has immutable properties.
1827  *
1828  * @param   measurement_interval
1829  * @param event_name    Unique Event Name
1830  * @param event_id    A universal identifier of the event for analysis etc
1831  *
1832  * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT.  If the
1833  *          event is not used (i.e. posted) it must be released using
1834  *          ::evel_free_event.
1835  * @retval  NULL  Failed to create the event.
1836  *****************************************************************************/
1837 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval,const char* ev_name, const char *ev_id);
1838
1839 /**************************************************************************//**
1840  * Free a Measurement.
1841  *
1842  * Free off the Measurement supplied.  Will free all the contained allocated
1843  * memory.
1844  *
1845  * @note It does not free the Measurement itself, since that may be part of a
1846  * larger structure.
1847  *****************************************************************************/
1848 void evel_free_measurement(EVENT_MEASUREMENT * event);
1849
1850 /**************************************************************************//**
1851  * Set the Event Type property of the Measurement.
1852  *
1853  * @note  The property is treated as immutable: it is only valid to call
1854  *        the setter once.  However, we don't assert if the caller tries to
1855  *        overwrite, just ignoring the update instead.
1856  *
1857  * @param measurement Pointer to the Measurement.
1858  * @param type        The Event Type to be set. ASCIIZ string. The caller
1859  *                    does not need to preserve the value once the function
1860  *                    returns.
1861  *****************************************************************************/
1862 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
1863                                const char * const type);
1864
1865 /**************************************************************************//**
1866  * Set the Concurrent Sessions property of the Measurement.
1867  *
1868  * @note  The property is treated as immutable: it is only valid to call
1869  *        the setter once.  However, we don't assert if the caller tries to
1870  *        overwrite, just ignoring the update instead.
1871  *
1872  * @param measurement         Pointer to the Measurement.
1873  * @param concurrent_sessions The Concurrent Sessions to be set.
1874  *****************************************************************************/
1875 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
1876                                     int concurrent_sessions);
1877
1878 /**************************************************************************//**
1879  * Set the Configured Entities 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 configured_entities The Configured Entities to be set.
1887  *****************************************************************************/
1888 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
1889                                    int configured_entities);
1890
1891 /**************************************************************************//**
1892  * Add an additional set of Errors to the Measurement.
1893  *
1894  * @note  The property is treated as immutable: it is only valid to call
1895  *        the setter once.  However, we don't assert if the caller tries to
1896  *        overwrite, just ignoring the update instead.
1897  *
1898  * @param measurement       Pointer to the measurement.
1899  * @param receive_discards  The number of receive discards.
1900  * @param receive_errors    The number of receive errors.
1901  * @param transmit_discards The number of transmit discards.
1902  * @param transmit_errors   The number of transmit errors.
1903  *****************************************************************************/
1904 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
1905                                  int receive_discards,
1906                                  int receive_errors,
1907                                  int transmit_discards,
1908                                  int transmit_errors);
1909
1910 /**************************************************************************//**
1911  * Set the Mean Request Latency property of the Measurement.
1912  *
1913  * @note  The property is treated as immutable: it is only valid to call
1914  *        the setter once.  However, we don't assert if the caller tries to
1915  *        overwrite, just ignoring the update instead.
1916  *
1917  * @param measurement          Pointer to the Measurement.
1918  * @param mean_request_latency The Mean Request Latency to be set.
1919  *****************************************************************************/
1920 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
1921                                        double mean_request_latency);
1922
1923 /**************************************************************************//**
1924  * Set the Request Rate property of the Measurement.
1925  *
1926  * @note  The property is treated as immutable: it is only valid to call
1927  *        the setter once.  However, we don't assert if the caller tries to
1928  *        overwrite, just ignoring the update instead.
1929  *
1930  * @param measurement  Pointer to the Measurement.
1931  * @param request_rate The Request Rate to be set.
1932  *****************************************************************************/
1933 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
1934                                        int request_rate);
1935
1936 /**************************************************************************//**
1937  * Add an additional CPU usage value name/value pair to the Measurement.
1938  *
1939  * The name and value are null delimited ASCII strings.  The library takes
1940  * a copy so the caller does not have to preserve values after the function
1941  * returns.
1942  *
1943  * @param measurement   Pointer to the measurement.
1944  * @param id            ASCIIZ string with the CPU's identifier.
1945  * @param usage         CPU utilization.
1946  *****************************************************************************/
1947 MEASUREMENT_CPU_USE * evel_measurement_new_cpu_use_add(EVENT_MEASUREMENT * measurement, char * id, double usage);
1948
1949 /**************************************************************************//**
1950  * Set the CPU Idle value in measurement interval
1951  *   percentage of CPU time spent in the idle task
1952  *
1953  * @note  The property is treated as immutable: it is only valid to call
1954  *        the setter once.  However, we don't assert if the caller tries to
1955  *        overwrite, just ignoring the update instead.
1956  *
1957  * @param cpu_use      Pointer to the CPU Use.
1958  * @param val          double
1959  *****************************************************************************/
1960 void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE *const cpu_use,
1961                                     const double val);
1962
1963 /**************************************************************************//**
1964  * Set the percentage of time spent servicing interrupts
1965  *
1966  * @note  The property is treated as immutable: it is only valid to call
1967  *        the setter once.  However, we don't assert if the caller tries to
1968  *        overwrite, just ignoring the update instead.
1969  *
1970  * @param cpu_use      Pointer to the CPU Use.
1971  * @param val          double
1972  *****************************************************************************/
1973 void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE * const cpu_use,
1974                                     const double val);
1975
1976 /**************************************************************************//**
1977  * Set the percentage of time spent running user space processes that have been niced
1978  *
1979  * @note  The property is treated as immutable: it is only valid to call
1980  *        the setter once.  However, we don't assert if the caller tries to
1981  *        overwrite, just ignoring the update instead.
1982  *
1983  * @param cpu_use      Pointer to the CPU Use.
1984  * @param val          double
1985  *****************************************************************************/
1986 void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE * const cpu_use,
1987                                     const double val);
1988
1989 /**************************************************************************//**
1990  * Set the percentage of time spent handling soft irq interrupts
1991  *
1992  * @note  The property is treated as immutable: it is only valid to call
1993  *        the setter once.  However, we don't assert if the caller tries to
1994  *        overwrite, just ignoring the update instead.
1995  *
1996  * @param cpu_use      Pointer to the CPU Use.
1997  * @param val          double
1998  *****************************************************************************/
1999 void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE * const cpu_use,
2000                                     const double val);
2001 /**************************************************************************//**
2002  * Set the percentage of time spent in involuntary wait
2003  *
2004  * @note  The property is treated as immutable: it is only valid to call
2005  *        the setter once.  However, we don't assert if the caller tries to
2006  *        overwrite, just ignoring the update instead.
2007  *
2008  * @param cpu_use      Pointer to the CPU Use.
2009  * @param val          double
2010  *****************************************************************************/
2011 void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE * const cpu_use,
2012                                     const double val);
2013 /**************************************************************************//**
2014  * Set the percentage of time spent on system tasks running the kernel
2015  *
2016  * @note  The property is treated as immutable: it is only valid to call
2017  *        the setter once.  However, we don't assert if the caller tries to
2018  *        overwrite, just ignoring the update instead.
2019  *
2020  * @param cpu_use      Pointer to the CPU Use.
2021  * @param val          double
2022  *****************************************************************************/
2023 void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE * const cpu_use,
2024                                     const double val);
2025 /**************************************************************************//**
2026  * Set the percentage of time spent running un-niced user space processes
2027  *
2028  * @note  The property is treated as immutable: it is only valid to call
2029  *        the setter once.  However, we don't assert if the caller tries to
2030  *        overwrite, just ignoring the update instead.
2031  *
2032  * @param cpu_use      Pointer to the CPU Use.
2033  * @param val          double
2034  *****************************************************************************/
2035 void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE * const cpu_use,
2036                                     const double val);
2037 /**************************************************************************//**
2038  * Set the percentage of CPU time spent waiting for I/O operations to complete
2039  *
2040  * @note  The property is treated as immutable: it is only valid to call
2041  *        the setter once.  However, we don't assert if the caller tries to
2042  *        overwrite, just ignoring the update instead.
2043  *
2044  * @param cpu_use      Pointer to the CPU Use.
2045  * @param val          double
2046  *****************************************************************************/
2047 void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE * const cpu_use,
2048                                     const double val);
2049
2050 /**************************************************************************//**
2051  * Add an additional File System usage value name/value pair to the
2052  * Measurement.
2053  *
2054  * The filesystem_name is null delimited ASCII string.  The library takes a
2055  * copy so the caller does not have to preserve values after the function
2056  * returns.
2057  *
2058  * @param measurement     Pointer to the measurement.
2059  * @param filesystem_name   ASCIIZ string with the file-system's UUID.
2060  * @param block_configured  Block storage configured.
2061  * @param block_used        Block storage in use.
2062  * @param block_iops        Block storage IOPS.
2063  * @param ephemeral_configured  Ephemeral storage configured.
2064  * @param ephemeral_used        Ephemeral storage in use.
2065  * @param ephemeral_iops        Ephemeral storage IOPS.
2066  *****************************************************************************/
2067 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
2068                                    char * filesystem_name,
2069                                    double block_configured,
2070                                    double block_used,
2071                                    double block_iops,
2072                                    double ephemeral_configured,
2073                                    double ephemeral_used,
2074                                    double ephemeral_iops);
2075
2076 /**************************************************************************//**
2077  * Add a Feature usage value name/value pair to the Measurement.
2078  *
2079  * The name is null delimited ASCII string.  The library takes
2080  * a copy so the caller does not have to preserve values after the function
2081  * returns.
2082  *
2083  * @param measurement     Pointer to the measurement.
2084  * @param feature         ASCIIZ string with the feature's name.
2085  * @param utilization     Utilization of the feature.
2086  *****************************************************************************/
2087 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
2088                                       char * feature,
2089                                       int utilization);
2090
2091 /**************************************************************************//**
2092  * Add a Additional Measurement value name/value pair to the Measurement.
2093  *
2094  * The name is null delimited ASCII string.  The library takes
2095  * a copy so the caller does not have to preserve values after the function
2096  * returns.
2097  *
2098  * @param measurement   Pointer to the Measurement.
2099  * @param group    ASCIIZ string with the measurement group's name.
2100  * @param name     ASCIIZ string containing the measurement's name.
2101  * @param name     ASCIIZ string containing the measurement's value.
2102  *****************************************************************************/
2103 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
2104                                              const char * const group,
2105                                              const char * const name,
2106                                              const char * const value);
2107
2108 /**************************************************************************//**
2109  * Add a Codec usage value name/value pair to the Measurement.
2110  *
2111  * The name is null delimited ASCII string.  The library takes
2112  * a copy so the caller does not have to preserve values after the function
2113  * returns.
2114  *
2115  * @param measurement     Pointer to the measurement.
2116  * @param codec           ASCIIZ string with the codec's name.
2117  * @param utilization     Utilization of the feature.
2118  *****************************************************************************/
2119 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
2120                                     char * codec,
2121                                     int utilization);
2122
2123 /**************************************************************************//**
2124  * Set the Media Ports in Use property of the Measurement.
2125  *
2126  * @note  The property is treated as immutable: it is only valid to call
2127  *        the setter once.  However, we don't assert if the caller tries to
2128  *        overwrite, just ignoring the update instead.
2129  *
2130  * @param measurement         Pointer to the measurement.
2131  * @param media_ports_in_use  The media port usage to set.
2132  *****************************************************************************/
2133 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
2134                                          int media_ports_in_use);
2135
2136 /**************************************************************************//**
2137  * Set the VNFC Scaling Metric property of the Measurement.
2138  *
2139  * @note  The property is treated as immutable: it is only valid to call
2140  *        the setter once.  However, we don't assert if the caller tries to
2141  *        overwrite, just ignoring the update instead.
2142  *
2143  * @param measurement     Pointer to the measurement.
2144  * @param scaling_metric  The scaling metric to set.
2145  *****************************************************************************/
2146 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
2147                                               int scaling_metric);
2148
2149 /**************************************************************************//**
2150  * Create a new Latency Bucket to be added to a Measurement event.
2151  *
2152  * @note    The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
2153  *          supplied to this factory function and are immutable once set.
2154  *          Optional fields have explicit setter functions, but again values
2155  *          may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
2156  *          immutable properties.
2157  *
2158  * @param count         Count of events in this bucket.
2159  *
2160  * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
2161  * @retval  NULL  Failed to create the Latency Bucket.
2162  *****************************************************************************/
2163 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count);
2164
2165 /**************************************************************************//**
2166  * Set the High End property of the Measurement Latency Bucket.
2167  *
2168  * @note  The property is treated as immutable: it is only valid to call
2169  *        the setter once.  However, we don't assert if the caller tries to
2170  *        overwrite, just ignoring the update instead.
2171  *
2172  * @param bucket        Pointer to the Measurement Latency Bucket.
2173  * @param high_end      High end of the bucket's range.
2174  *****************************************************************************/
2175 void evel_meas_latency_bucket_high_end_set(
2176                                      MEASUREMENT_LATENCY_BUCKET * const bucket,
2177                                      const double high_end);
2178
2179 /**************************************************************************//**
2180  * Set the Low End property of the Measurement Latency Bucket.
2181  *
2182  * @note  The property is treated as immutable: it is only valid to call
2183  *        the setter once.  However, we don't assert if the caller tries to
2184  *        overwrite, just ignoring the update instead.
2185  *
2186  * @param bucket        Pointer to the Measurement Latency Bucket.
2187  * @param low_end       Low end of the bucket's range.
2188  *****************************************************************************/
2189 void evel_meas_latency_bucket_low_end_set(
2190                                      MEASUREMENT_LATENCY_BUCKET * const bucket,
2191                                      const double low_end);
2192
2193 /**************************************************************************//**
2194  * Add an additional Measurement Latency Bucket to the specified event.
2195  *
2196  * @param measurement   Pointer to the Measurement event.
2197  * @param bucket        Pointer to the Measurement Latency Bucket to add.
2198  *****************************************************************************/
2199 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
2200                                   MEASUREMENT_LATENCY_BUCKET * const bucket);
2201
2202 /**************************************************************************//**
2203  * Add an additional Latency Distribution bucket to the Measurement.
2204  *
2205  * This function implements the previous API, purely for convenience.
2206  *
2207  * @param measurement   Pointer to the measurement.
2208  * @param low_end       Low end of the bucket's range.
2209  * @param high_end      High end of the bucket's range.
2210  * @param count         Count of events in this bucket.
2211  *****************************************************************************/
2212 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
2213                                   const double low_end,
2214                                   const double high_end,
2215                                   const int count);
2216
2217 /**************************************************************************//**
2218  * Create a new vNIC Use to be added to a Measurement event.
2219  *
2220  * @note    The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
2221  *          to this factory function and are immutable once set. Optional
2222  *          fields have explicit setter functions, but again values may only be
2223  *          set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
2224  *          properties.
2225  *
2226  * @param vnic_id               ASCIIZ string with the vNIC's ID.
2227  * @param val_suspect           True or false confidence in data.
2228  *
2229  * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
2230  *          If the structure is not used it must be released using
2231  *          ::evel_measurement_free_vnic_performance.
2232  * @retval  NULL  Failed to create the vNIC Use.
2233  *****************************************************************************/
2234 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id, char * const val_suspect);
2235
2236 /**************************************************************************//**
2237  * Free a vNIC Use.
2238  *
2239  * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied.  Will free all the contained
2240  * allocated memory.
2241  *
2242  * @note It does not free the vNIC Use itself, since that may be part of a
2243  * larger structure.
2244  *****************************************************************************/
2245 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2246
2247 /**************************************************************************//**
2248  * Set the Accumulated Broadcast Packets Received in measurement interval
2249  * property of the vNIC performance.
2250  *
2251  * @note  The property is treated as immutable: it is only valid to call
2252  *        the setter once.  However, we don't assert if the caller tries to
2253  *        overwrite, just ignoring the update instead.
2254  *
2255  * @param vnic_performance      Pointer to the vNIC Use.
2256  * @param recvd_bcast_packets_acc
2257  *****************************************************************************/
2258 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2259                                     const double recvd_bcast_packets_acc);
2260 /**************************************************************************//**
2261  * Set the Delta Broadcast Packets Received in measurement interval
2262  * property of the vNIC performance.
2263  *
2264  * @note  The property is treated as immutable: it is only valid to call
2265  *        the setter once.  However, we don't assert if the caller tries to
2266  *        overwrite, just ignoring the update instead.
2267  *
2268  * @param vnic_performance      Pointer to the vNIC Use.
2269  * @param recvd_bcast_packets_delta
2270  *****************************************************************************/
2271 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2272                                     const double recvd_bcast_packets_delta);
2273 /**************************************************************************//**
2274  * Set the Discarded Packets Received in measurement interval
2275  * property of the vNIC performance.
2276  *
2277  * @note  The property is treated as immutable: it is only valid to call
2278  *        the setter once.  However, we don't assert if the caller tries to
2279  *        overwrite, just ignoring the update instead.
2280  *
2281  * @param vnic_performance      Pointer to the vNIC Use.
2282  * @param recvd_discard_packets_acc
2283  *****************************************************************************/
2284 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2285                                     const double recvd_discard_packets_acc);
2286 /**************************************************************************//**
2287  * Set the Delta Discarded Packets Received in measurement interval
2288  * property of the vNIC performance.
2289  *
2290  * @note  The property is treated as immutable: it is only valid to call
2291  *        the setter once.  However, we don't assert if the caller tries to
2292  *        overwrite, just ignoring the update instead.
2293  *
2294  * @param vnic_performance      Pointer to the vNIC Use.
2295  * @param recvd_discard_packets_delta
2296  *****************************************************************************/
2297 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2298                                     const double recvd_discard_packets_delta);
2299 /**************************************************************************//**
2300  * Set the Error Packets Received in measurement interval
2301  * property of the vNIC performance.
2302  *
2303  * @note  The property is treated as immutable: it is only valid to call
2304  *        the setter once.  However, we don't assert if the caller tries to
2305  *        overwrite, just ignoring the update instead.
2306  *
2307  * @param vnic_performance      Pointer to the vNIC Use.
2308  * @param recvd_error_packets_acc
2309  *****************************************************************************/
2310 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2311                                     const double recvd_error_packets_acc);
2312 /**************************************************************************//**
2313  * Set the Delta Error Packets Received in measurement interval
2314  * property of the vNIC performance.
2315  *
2316  * @note  The property is treated as immutable: it is only valid to call
2317  *        the setter once.  However, we don't assert if the caller tries to
2318  *        overwrite, just ignoring the update instead.
2319  *
2320  * @param vnic_performance      Pointer to the vNIC Use.
2321  * @param recvd_error_packets_delta
2322  *****************************************************************************/
2323 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2324                                     const double recvd_error_packets_delta);
2325 /**************************************************************************//**
2326  * Set the Accumulated Multicast Packets Received in measurement interval
2327  * property of the vNIC performance.
2328  *
2329  * @note  The property is treated as immutable: it is only valid to call
2330  *        the setter once.  However, we don't assert if the caller tries to
2331  *        overwrite, just ignoring the update instead.
2332  *
2333  * @param vnic_performance      Pointer to the vNIC Use.
2334  * @param recvd_mcast_packets_acc
2335  *****************************************************************************/
2336 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2337                                     const double recvd_mcast_packets_acc);
2338 /**************************************************************************//**
2339  * Set the Delta Multicast Packets Received in measurement interval
2340  * property of the vNIC performance.
2341  *
2342  * @note  The property is treated as immutable: it is only valid to call
2343  *        the setter once.  However, we don't assert if the caller tries to
2344  *        overwrite, just ignoring the update instead.
2345  *
2346  * @param vnic_performance      Pointer to the vNIC Use.
2347  * @param recvd_mcast_packets_delta
2348  *****************************************************************************/
2349 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2350                                     const double recvd_mcast_packets_delta);
2351 /**************************************************************************//**
2352  * Set the Accumulated Octets Received in measurement interval
2353  * property of the vNIC performance.
2354  *
2355  * @note  The property is treated as immutable: it is only valid to call
2356  *        the setter once.  However, we don't assert if the caller tries to
2357  *        overwrite, just ignoring the update instead.
2358  *
2359  * @param vnic_performance      Pointer to the vNIC Use.
2360  * @param recvd_octets_acc
2361  *****************************************************************************/
2362 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2363                                     const double recvd_octets_acc);
2364 /**************************************************************************//**
2365  * Set the Delta Octets Received in measurement interval
2366  * property of the vNIC performance.
2367  *
2368  * @note  The property is treated as immutable: it is only valid to call
2369  *        the setter once.  However, we don't assert if the caller tries to
2370  *        overwrite, just ignoring the update instead.
2371  *
2372  * @param vnic_performance      Pointer to the vNIC Use.
2373  * @param recvd_octets_delta
2374  *****************************************************************************/
2375 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2376                                     const double recvd_octets_delta);
2377 /**************************************************************************//**
2378  * Set the Accumulated Total Packets Received in measurement interval
2379  * property of the vNIC performance.
2380  *
2381  * @note  The property is treated as immutable: it is only valid to call
2382  *        the setter once.  However, we don't assert if the caller tries to
2383  *        overwrite, just ignoring the update instead.
2384  *
2385  * @param vnic_performance      Pointer to the vNIC Use.
2386  * @param recvd_total_packets_acc
2387  *****************************************************************************/
2388 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2389                                     const double recvd_total_packets_acc);
2390 /**************************************************************************//**
2391  * Set the Delta Total Packets Received in measurement interval
2392  * property of the vNIC performance.
2393  *
2394  * @note  The property is treated as immutable: it is only valid to call
2395  *        the setter once.  However, we don't assert if the caller tries to
2396  *        overwrite, just ignoring the update instead.
2397  *
2398  * @param vnic_performance      Pointer to the vNIC Use.
2399  * @param recvd_total_packets_delta
2400  *****************************************************************************/
2401 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2402                                     const double recvd_total_packets_delta);
2403 /**************************************************************************//**
2404  * Set the Accumulated Unicast Packets Received in measurement interval
2405  * property of the vNIC performance.
2406  *
2407  * @note  The property is treated as immutable: it is only valid to call
2408  *        the setter once.  However, we don't assert if the caller tries to
2409  *        overwrite, just ignoring the update instead.
2410  *
2411  * @param vnic_performance      Pointer to the vNIC Use.
2412  * @param recvd_ucast_packets_acc
2413  *****************************************************************************/
2414 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2415                                     const double recvd_ucast_packets_acc);
2416 /**************************************************************************//**
2417  * Set the Delta Unicast packets Received in measurement interval
2418  * property of the vNIC performance.
2419  *
2420  * @note  The property is treated as immutable: it is only valid to call
2421  *        the setter once.  However, we don't assert if the caller tries to
2422  *        overwrite, just ignoring the update instead.
2423  *
2424  * @param vnic_performance      Pointer to the vNIC Use.
2425  * @param recvd_ucast_packets_delta
2426  *****************************************************************************/
2427 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2428                                     const double recvd_ucast_packets_delta);
2429 /**************************************************************************//**
2430  * Set the Transmitted Broadcast Packets in measurement interval
2431  * property of the vNIC performance.
2432  *
2433  * @note  The property is treated as immutable: it is only valid to call
2434  *        the setter once.  However, we don't assert if the caller tries to
2435  *        overwrite, just ignoring the update instead.
2436  *
2437  * @param vnic_performance      Pointer to the vNIC Use.
2438  * @param tx_bcast_packets_acc
2439  *****************************************************************************/
2440 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2441                                     const double tx_bcast_packets_acc);
2442 /**************************************************************************//**
2443  * Set the Delta Broadcast packets Transmitted in measurement interval
2444  * property of the vNIC performance.
2445  *
2446  * @note  The property is treated as immutable: it is only valid to call
2447  *        the setter once.  However, we don't assert if the caller tries to
2448  *        overwrite, just ignoring the update instead.
2449  *
2450  * @param vnic_performance      Pointer to the vNIC Use.
2451  * @param tx_bcast_packets_delta
2452  *****************************************************************************/
2453 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2454                                     const double tx_bcast_packets_delta);
2455 /**************************************************************************//**
2456  * Set the Transmitted Discarded Packets in measurement interval
2457  * property of the vNIC performance.
2458  *
2459  * @note  The property is treated as immutable: it is only valid to call
2460  *        the setter once.  However, we don't assert if the caller tries to
2461  *        overwrite, just ignoring the update instead.
2462  *
2463  * @param vnic_performance      Pointer to the vNIC Use.
2464  * @param tx_discarded_packets_acc
2465  *****************************************************************************/
2466 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2467                                     const double tx_discarded_packets_acc);
2468 /**************************************************************************//**
2469  * Set the Delta Discarded packets Transmitted in measurement interval
2470  * property of the vNIC performance.
2471  *
2472  * @note  The property is treated as immutable: it is only valid to call
2473  *        the setter once.  However, we don't assert if the caller tries to
2474  *        overwrite, just ignoring the update instead.
2475  *
2476  * @param vnic_performance      Pointer to the vNIC Use.
2477  * @param tx_discarded_packets_delta
2478  *****************************************************************************/
2479 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2480                                     const double tx_discarded_packets_delta);
2481 /**************************************************************************//**
2482  * Set the Transmitted Errored Packets in measurement interval
2483  * property of the vNIC performance.
2484  *
2485  * @note  The property is treated as immutable: it is only valid to call
2486  *        the setter once.  However, we don't assert if the caller tries to
2487  *        overwrite, just ignoring the update instead.
2488  *
2489  * @param vnic_performance      Pointer to the vNIC Use.
2490  * @param tx_error_packets_acc
2491  *****************************************************************************/
2492 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2493                                     const double tx_error_packets_acc);
2494 /**************************************************************************//**
2495  * Set the Delta Errored packets Transmitted in measurement interval
2496  * property of the vNIC performance.
2497  *
2498  * @note  The property is treated as immutable: it is only valid to call
2499  *        the setter once.  However, we don't assert if the caller tries to
2500  *        overwrite, just ignoring the update instead.
2501  *
2502  * @param vnic_performance      Pointer to the vNIC Use.
2503  * @param tx_error_packets_delta
2504  *****************************************************************************/
2505 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2506                                     const double tx_error_packets_delta);
2507 /**************************************************************************//**
2508  * Set the Transmitted Multicast Packets in measurement interval
2509  * property of the vNIC performance.
2510  *
2511  * @note  The property is treated as immutable: it is only valid to call
2512  *        the setter once.  However, we don't assert if the caller tries to
2513  *        overwrite, just ignoring the update instead.
2514  *
2515  * @param vnic_performance      Pointer to the vNIC Use.
2516  * @param tx_mcast_packets_acc
2517  *****************************************************************************/
2518 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2519                                     const double tx_mcast_packets_acc);
2520 /**************************************************************************//**
2521  * Set the Delta Multicast packets Transmitted in measurement interval
2522  * property of the vNIC performance.
2523  *
2524  * @note  The property is treated as immutable: it is only valid to call
2525  *        the setter once.  However, we don't assert if the caller tries to
2526  *        overwrite, just ignoring the update instead.
2527  *
2528  * @param vnic_performance      Pointer to the vNIC Use.
2529  * @param tx_mcast_packets_delta
2530  *****************************************************************************/
2531 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2532                                     const double tx_mcast_packets_delta);
2533 /**************************************************************************//**
2534  * Set the Transmitted Octets in measurement interval
2535  * property of the vNIC performance.
2536  *
2537  * @note  The property is treated as immutable: it is only valid to call
2538  *        the setter once.  However, we don't assert if the caller tries to
2539  *        overwrite, just ignoring the update instead.
2540  *
2541  * @param vnic_performance      Pointer to the vNIC Use.
2542  * @param tx_octets_acc
2543  *****************************************************************************/
2544 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2545                                     const double tx_octets_acc);
2546 /**************************************************************************//**
2547  * Set the Delta Octets Transmitted in measurement interval
2548  * property of the vNIC performance.
2549  *
2550  * @note  The property is treated as immutable: it is only valid to call
2551  *        the setter once.  However, we don't assert if the caller tries to
2552  *        overwrite, just ignoring the update instead.
2553  *
2554  * @param vnic_performance      Pointer to the vNIC Use.
2555  * @param tx_octets_delta
2556  *****************************************************************************/
2557 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2558                                     const double tx_octets_delta);
2559 /**************************************************************************//**
2560  * Set the Transmitted Total Packets in measurement interval
2561  * property of the vNIC performance.
2562  *
2563  * @note  The property is treated as immutable: it is only valid to call
2564  *        the setter once.  However, we don't assert if the caller tries to
2565  *        overwrite, just ignoring the update instead.
2566  *
2567  * @param vnic_performance      Pointer to the vNIC Use.
2568  * @param tx_total_packets_acc
2569  *****************************************************************************/
2570 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2571                                     const double tx_total_packets_acc);
2572 /**************************************************************************//**
2573  * Set the Delta Total Packets Transmitted in measurement interval
2574  * property of the vNIC performance.
2575  *
2576  * @note  The property is treated as immutable: it is only valid to call
2577  *        the setter once.  However, we don't assert if the caller tries to
2578  *        overwrite, just ignoring the update instead.
2579  *
2580  * @param vnic_performance      Pointer to the vNIC Use.
2581  * @param tx_total_packets_delta
2582  *****************************************************************************/
2583 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2584                                     const double tx_total_packets_delta);
2585 /**************************************************************************//**
2586  * Set the Transmitted Unicast Packets in measurement interval
2587  * property of the vNIC performance.
2588  *
2589  * @note  The property is treated as immutable: it is only valid to call
2590  *        the setter once.  However, we don't assert if the caller tries to
2591  *        overwrite, just ignoring the update instead.
2592  *
2593  * @param vnic_performance      Pointer to the vNIC Use.
2594  * @param tx_ucast_packets_acc
2595  *****************************************************************************/
2596 void evel_vnic_performance_tx_ucast_packets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2597                                     const double tx_ucast_packets_acc);
2598 /**************************************************************************//**
2599  * Set the Delta Octets Transmitted in measurement interval
2600  * property of the vNIC performance.
2601  *
2602  * @note  The property is treated as immutable: it is only valid to call
2603  *        the setter once.  However, we don't assert if the caller tries to
2604  *        overwrite, just ignoring the update instead.
2605  *
2606  * @param vnic_performance      Pointer to the vNIC Use.
2607  * @param tx_ucast_packets_delta
2608  *****************************************************************************/
2609 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2610                                     const double tx_ucast_packets_delta);
2611
2612 /**************************************************************************//**
2613  * Add an additional vNIC Use to the specified Measurement event.
2614  *
2615  * @param measurement   Pointer to the measurement.
2616  * @param vnic_performance      Pointer to the vNIC Use to add.
2617  *****************************************************************************/
2618 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2619                             MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2620
2621 /**************************************************************************//**
2622  * Add an additional vNIC usage record Measurement.
2623  *
2624  * This function implements the previous API, purely for convenience.
2625  *
2626  * The ID is null delimited ASCII string.  The library takes a copy so the
2627  * caller does not have to preserve values after the function returns.
2628  *
2629  * @param measurement           Pointer to the measurement.
2630  * @param vnic_id               ASCIIZ string with the vNIC's ID.
2631  * @param valset                true or false confidence level
2632  * @param recvd_bcast_packets_acc         Recieved broadcast packets
2633  * @param recvd_bcast_packets_delta       Received delta broadcast packets
2634  * @param recvd_discarded_packets_acc     Recieved discarded packets
2635  * @param recvd_discarded_packets_delta   Received discarded delta packets
2636  * @param recvd_error_packets_acc         Received error packets
2637  * @param recvd_error_packets_delta,      Received delta error packets
2638  * @param recvd_mcast_packets_acc         Received multicast packets
2639  * @param recvd_mcast_packets_delta       Received delta multicast packets
2640  * @param recvd_octets_acc                Received octets
2641  * @param recvd_octets_delta              Received delta octets
2642  * @param recvd_total_packets_acc         Received total packets
2643  * @param recvd_total_packets_delta       Received delta total packets
2644  * @param recvd_ucast_packets_acc         Received Unicast packets
2645  * @param recvd_ucast_packets_delta       Received delta unicast packets
2646  * @param tx_bcast_packets_acc            Transmitted broadcast packets
2647  * @param tx_bcast_packets_delta          Transmitted delta broadcast packets
2648  * @param tx_discarded_packets_acc        Transmitted packets discarded
2649  * @param tx_discarded_packets_delta      Transmitted delta discarded packets
2650  * @param tx_error_packets_acc            Transmitted error packets
2651  * @param tx_error_packets_delta          Transmitted delta error packets
2652  * @param tx_mcast_packets_acc            Transmitted multicast packets accumulated
2653  * @param tx_mcast_packets_delta          Transmitted delta multicast packets
2654  * @param tx_octets_acc                   Transmitted octets
2655  * @param tx_octets_delta                 Transmitted delta octets
2656  * @param tx_total_packets_acc            Transmitted total packets
2657  * @param tx_total_packets_delta          Transmitted delta total packets
2658  * @param tx_ucast_packets_acc            Transmitted Unicast packets
2659  * @param tx_ucast_packets_delta          Transmitted delta Unicast packets
2660  *****************************************************************************/
2661 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2662                                char * const vnic_id,
2663                                char * valset,
2664                                double recvd_bcast_packets_acc,
2665                                double recvd_bcast_packets_delta,
2666                                double recvd_discarded_packets_acc,
2667                                double recvd_discarded_packets_delta,
2668                                double recvd_error_packets_acc,
2669                                double recvd_error_packets_delta,
2670                                double recvd_mcast_packets_acc,
2671                                double recvd_mcast_packets_delta,
2672                                double recvd_octets_acc,
2673                                double recvd_octets_delta,
2674                                double recvd_total_packets_acc,
2675                                double recvd_total_packets_delta,
2676                                double recvd_ucast_packets_acc,
2677                                double recvd_ucast_packets_delta,
2678                                double tx_bcast_packets_acc,
2679                                double tx_bcast_packets_delta,
2680                                double tx_discarded_packets_acc,
2681                                double tx_discarded_packets_delta,
2682                                double tx_error_packets_acc,
2683                                double tx_error_packets_delta,
2684                                double tx_mcast_packets_acc,
2685                                double tx_mcast_packets_delta,
2686                                double tx_octets_acc,
2687                                double tx_octets_delta,
2688                                double tx_total_packets_acc,
2689                                double tx_total_packets_delta,
2690                                double tx_ucast_packets_acc,
2691                                double tx_ucast_packets_delta);
2692
2693 /*****************************************************************************/
2694 /*****************************************************************************/
2695 /*                                                                           */
2696 /*   REPORT                                                                  */
2697 /*                                                                           */
2698 /*****************************************************************************/
2699 /*****************************************************************************/
2700
2701 /**************************************************************************//**
2702  * Create a new Report event.
2703  *
2704  * @note    The mandatory fields on the Report must be supplied to this
2705  *          factory function and are immutable once set.  Optional fields have
2706  *          explicit setter functions, but again values may only be set once so
2707  *          that the Report has immutable properties.
2708  *
2709  * @param   measurement_interval
2710  * @param event_name    Unique Event Name
2711  * @param event_id    A universal identifier of the event for analysis etc
2712  *
2713  * @returns pointer to the newly manufactured ::EVENT_REPORT.  If the event is
2714  *          not used (i.e. posted) it must be released using
2715  *          ::evel_free_report.
2716  * @retval  NULL  Failed to create the event.
2717  *****************************************************************************/
2718 EVENT_REPORT * evel_new_report(double measurement_interval,const char* ev_name, const char *ev_id);
2719
2720 /**************************************************************************//**
2721  * Free a Report.
2722  *
2723  * Free off the Report supplied.  Will free all the contained allocated memory.
2724  *
2725  * @note It does not free the Report itself, since that may be part of a
2726  * larger structure.
2727  *****************************************************************************/
2728 void evel_free_report(EVENT_REPORT * event);
2729
2730 /**************************************************************************//**
2731  * Set the Event Type property of the Report.
2732  *
2733  * @note  The property is treated as immutable: it is only valid to call
2734  *        the setter once.  However, we don't assert if the caller tries to
2735  *        overwrite, just ignoring the update instead.
2736  *
2737  * @param report Pointer to the Report.
2738  * @param type        The Event Type to be set. ASCIIZ string. The caller
2739  *                    does not need to preserve the value once the function
2740  *                    returns.
2741  *****************************************************************************/
2742 void evel_report_type_set(EVENT_REPORT * report, const char * const type);
2743
2744 /**************************************************************************//**
2745  * Add a Feature usage value name/value pair to the Report.
2746  *
2747  * The name is null delimited ASCII string.  The library takes
2748  * a copy so the caller does not have to preserve values after the function
2749  * returns.
2750  *
2751  * @param report          Pointer to the report.
2752  * @param feature         ASCIIZ string with the feature's name.
2753  * @param utilization     Utilization of the feature.
2754  *****************************************************************************/
2755 void evel_report_feature_use_add(EVENT_REPORT * report,
2756                                  char * feature,
2757                                  int utilization);
2758
2759 /**************************************************************************//**
2760  * Add a Additional Measurement value name/value pair to the Report.
2761  *
2762  * The name is null delimited ASCII string.  The library takes
2763  * a copy so the caller does not have to preserve values after the function
2764  * returns.
2765  *
2766  * @param report   Pointer to the report.
2767  * @param group    ASCIIZ string with the measurement group's name.
2768  * @param name     ASCIIZ string containing the measurement's name.
2769  * @param value    ASCIIZ string containing the measurement's value.
2770  *****************************************************************************/
2771 void evel_report_custom_measurement_add(EVENT_REPORT * report,
2772                                         const char * const group,
2773                                         const char * const name,
2774                                         const char * const value);
2775
2776 /*****************************************************************************/
2777 /*****************************************************************************/
2778 /*                                                                           */
2779 /*   MOBILE_FLOW                                                             */
2780 /*                                                                           */
2781 /*****************************************************************************/
2782 /*****************************************************************************/
2783
2784 /**************************************************************************//**
2785  * Create a new Mobile Flow event.
2786  *
2787  * @note    The mandatory fields on the Mobile Flow must be supplied to this
2788  *          factory function and are immutable once set.  Optional fields have
2789  *          explicit setter functions, but again values may only be set once so
2790  *          that the Mobile Flow has immutable properties.
2791  *
2792  * @param event_name    Unique Event Name
2793  * @param event_id    A universal identifier of the event for analysis etc
2794  * @param   flow_direction
2795  * @param   gtp_per_flow_metrics
2796  * @param   ip_protocol_type
2797  * @param   ip_version
2798  * @param   other_endpoint_ip_address
2799  * @param   other_endpoint_port
2800  * @param   reporting_endpoint_ip_addr
2801  * @param   reporting_endpoint_port
2802  *
2803  * @returns pointer to the newly manufactured ::EVENT_MOBILE_FLOW.  If the
2804  *          event is not used (i.e. posted) it must be released using
2805  *          ::evel_free_mobile_flow.
2806  * @retval  NULL  Failed to create the event.
2807  *****************************************************************************/
2808 EVENT_MOBILE_FLOW * evel_new_mobile_flow(
2809                       const char* ev_name, const char *ev_id,
2810                       const char * const flow_direction,
2811                       MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics,
2812                       const char * const ip_protocol_type,
2813                       const char * const ip_version,
2814                       const char * const other_endpoint_ip_address,
2815                       int other_endpoint_port,
2816                       const char * const reporting_endpoint_ip_addr,
2817                       int reporting_endpoint_port);
2818
2819 /**************************************************************************//**
2820  * Free a Mobile Flow.
2821  *
2822  * Free off the Mobile Flow supplied.  Will free all the contained allocated
2823  * memory.
2824  *
2825  * @note It does not free the Mobile Flow itself, since that may be part of a
2826  * larger structure.
2827  *****************************************************************************/
2828 void evel_free_mobile_flow(EVENT_MOBILE_FLOW * event);
2829
2830 /**************************************************************************//**
2831  * Set the Event Type property of the Mobile Flow.
2832  *
2833  * @note  The property is treated as immutable: it is only valid to call
2834  *        the setter once.  However, we don't assert if the caller tries to
2835  *        overwrite, just ignoring the update instead.
2836  *
2837  * @param mobile_flow Pointer to the Mobile Flow.
2838  * @param type        The Event Type to be set. ASCIIZ string. The caller
2839  *                    does not need to preserve the value once the function
2840  *                    returns.
2841  *****************************************************************************/
2842 void evel_mobile_flow_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2843                                const char * const type);
2844
2845 /**************************************************************************//**
2846  * Set the Application Type property of the Mobile Flow.
2847  *
2848  * @note  The property is treated as immutable: it is only valid to call
2849  *        the setter once.  However, we don't assert if the caller tries to
2850  *        overwrite, just ignoring the update instead.
2851  *
2852  * @param mobile_flow Pointer to the Mobile Flow.
2853  * @param type        The Application Type to be set. ASCIIZ string. The caller
2854  *                    does not need to preserve the value once the function
2855  *                    returns.
2856  *****************************************************************************/
2857 void evel_mobile_flow_app_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2858                                    const char * const type);
2859
2860 /**************************************************************************//**
2861  * Set the Application Protocol Type property of the Mobile Flow.
2862  *
2863  * @note  The property is treated as immutable: it is only valid to call
2864  *        the setter once.  However, we don't assert if the caller tries to
2865  *        overwrite, just ignoring the update instead.
2866  *
2867  * @param mobile_flow Pointer to the Mobile Flow.
2868  * @param type        The Application Protocol Type to be set. ASCIIZ string.
2869  *                    The caller does not need to preserve the value once the
2870  *                    function returns.
2871  *****************************************************************************/
2872 void evel_mobile_flow_app_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2873                                         const char * const type);
2874
2875 /**************************************************************************//**
2876  * Set the Application Protocol Version property of the Mobile Flow.
2877  *
2878  * @note  The property is treated as immutable: it is only valid to call
2879  *        the setter once.  However, we don't assert if the caller tries to
2880  *        overwrite, just ignoring the update instead.
2881  *
2882  * @param mobile_flow Pointer to the Mobile Flow.
2883  * @param version     The Application Protocol Version to be set. ASCIIZ
2884  *                    string.  The caller does not need to preserve the value
2885  *                    once the function returns.
2886  *****************************************************************************/
2887 void evel_mobile_flow_app_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2888                                        const char * const version);
2889
2890 /**************************************************************************//**
2891  * Set the CID property of the Mobile Flow.
2892  *
2893  * @note  The property is treated as immutable: it is only valid to call
2894  *        the setter once.  However, we don't assert if the caller tries to
2895  *        overwrite, just ignoring the update instead.
2896  *
2897  * @param mobile_flow Pointer to the Mobile Flow.
2898  * @param cid         The CID to be set. ASCIIZ string.  The caller does not
2899  *                    need to preserve the value once the function returns.
2900  *****************************************************************************/
2901 void evel_mobile_flow_cid_set(EVENT_MOBILE_FLOW * mobile_flow,
2902                               const char * const cid);
2903
2904 /**************************************************************************//**
2905  * Set the Connection Type property of the Mobile Flow.
2906  *
2907  * @note  The property is treated as immutable: it is only valid to call
2908  *        the setter once.  However, we don't assert if the caller tries to
2909  *        overwrite, just ignoring the update instead.
2910  *
2911  * @param mobile_flow Pointer to the Mobile Flow.
2912  * @param type        The Connection Type to be set. ASCIIZ string. The caller
2913  *                    does not need to preserve the value once the function
2914  *                    returns.
2915  *****************************************************************************/
2916 void evel_mobile_flow_con_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2917                                    const char * const type);
2918
2919 /**************************************************************************//**
2920  * Set the ECGI property of the Mobile Flow.
2921  *
2922  * @note  The property is treated as immutable: it is only valid to call
2923  *        the setter once.  However, we don't assert if the caller tries to
2924  *        overwrite, just ignoring the update instead.
2925  *
2926  * @param mobile_flow Pointer to the Mobile Flow.
2927  * @param ecgi        The ECGI to be set. ASCIIZ string.  The caller does not
2928  *                    need to preserve the value once the function returns.
2929  *****************************************************************************/
2930 void evel_mobile_flow_ecgi_set(EVENT_MOBILE_FLOW * mobile_flow,
2931                                const char * const ecgi);
2932
2933 /**************************************************************************//**
2934  * Set the GTP Protocol Type property of the Mobile Flow.
2935  *
2936  * @note  The property is treated as immutable: it is only valid to call
2937  *        the setter once.  However, we don't assert if the caller tries to
2938  *        overwrite, just ignoring the update instead.
2939  *
2940  * @param mobile_flow Pointer to the Mobile Flow.
2941  * @param type        The GTP Protocol Type to be set. ASCIIZ string.  The
2942  *                    caller does not need to preserve the value once the
2943  *                    function returns.
2944  *****************************************************************************/
2945 void evel_mobile_flow_gtp_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2946                                         const char * const type);
2947
2948 /**************************************************************************//**
2949  * Set the GTP Protocol Version property of the Mobile Flow.
2950  *
2951  * @note  The property is treated as immutable: it is only valid to call
2952  *        the setter once.  However, we don't assert if the caller tries to
2953  *        overwrite, just ignoring the update instead.
2954  *
2955  * @param mobile_flow Pointer to the Mobile Flow.
2956  * @param version     The GTP Protocol Version to be set. ASCIIZ string.  The
2957  *                    caller does not need to preserve the value once the
2958  *                    function returns.
2959  *****************************************************************************/
2960 void evel_mobile_flow_gtp_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2961                                        const char * const version);
2962
2963 /**************************************************************************//**
2964  * Set the HTTP Header property of the Mobile Flow.
2965  *
2966  * @note  The property is treated as immutable: it is only valid to call
2967  *        the setter once.  However, we don't assert if the caller tries to
2968  *        overwrite, just ignoring the update instead.
2969  *
2970  * @param mobile_flow Pointer to the Mobile Flow.
2971  * @param header      The HTTP header to be set. ASCIIZ string. The caller does
2972  *                    not need to preserve the value once the function returns.
2973  *****************************************************************************/
2974 void evel_mobile_flow_http_header_set(EVENT_MOBILE_FLOW * mobile_flow,
2975                                       const char * const header);
2976
2977 /**************************************************************************//**
2978  * Set the IMEI property of the Mobile Flow.
2979  *
2980  * @note  The property is treated as immutable: it is only valid to call
2981  *        the setter once.  However, we don't assert if the caller tries to
2982  *        overwrite, just ignoring the update instead.
2983  *
2984  * @param mobile_flow Pointer to the Mobile Flow.
2985  * @param imei        The IMEI to be set. ASCIIZ string.  The caller does not
2986  *                    need to preserve the value once the function returns.
2987  *****************************************************************************/
2988 void evel_mobile_flow_imei_set(EVENT_MOBILE_FLOW * mobile_flow,
2989                                const char * const imei);
2990
2991 /**************************************************************************//**
2992  * Set the IMSI 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 imsi        The IMSI to be set. ASCIIZ string.  The caller does not
3000  *                    need to preserve the value once the function returns.
3001  *****************************************************************************/
3002 void evel_mobile_flow_imsi_set(EVENT_MOBILE_FLOW * mobile_flow,
3003                                const char * const imsi);
3004
3005 /**************************************************************************//**
3006  * Set the LAC 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 lac         The LAC 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_lac_set(EVENT_MOBILE_FLOW * mobile_flow,
3017                               const char * const lac);
3018
3019 /**************************************************************************//**
3020  * Set the MCC 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 mcc         The MCC 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_mcc_set(EVENT_MOBILE_FLOW * mobile_flow,
3031                               const char * const mcc);
3032
3033 /**************************************************************************//**
3034  * Set the MNC 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 mnc         The MNC 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_mnc_set(EVENT_MOBILE_FLOW * mobile_flow,
3045                               const char * const mnc);
3046
3047 /**************************************************************************//**
3048  * Set the MSISDN 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 msisdn      The MSISDN 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_msisdn_set(EVENT_MOBILE_FLOW * mobile_flow,
3059                                  const char * const msisdn);
3060
3061 /**************************************************************************//**
3062  * Set the Other Functional Role 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 role        The Other Functional Role to be set. ASCIIZ string. The
3070  *                    caller does not need to preserve the value once the
3071  *                    function returns.
3072  *****************************************************************************/
3073 void evel_mobile_flow_other_func_role_set(EVENT_MOBILE_FLOW * mobile_flow,
3074                                           const char * const role);
3075
3076 /**************************************************************************//**
3077  * Set the RAC property of the Mobile Flow.
3078  *
3079  * @note  The property is treated as immutable: it is only valid to call
3080  *        the setter once.  However, we don't assert if the caller tries to
3081  *        overwrite, just ignoring the update instead.
3082  *
3083  * @param mobile_flow Pointer to the Mobile Flow.
3084  * @param rac         The RAC to be set. ASCIIZ string.  The caller does not
3085  *                    need to preserve the value once the function returns.
3086  *****************************************************************************/
3087 void evel_mobile_flow_rac_set(EVENT_MOBILE_FLOW * mobile_flow,
3088                               const char * const rac);
3089
3090 /**************************************************************************//**
3091  * Set the Radio Access Technology property of the Mobile Flow.
3092  *
3093  * @note  The property is treated as immutable: it is only valid to call
3094  *        the setter once.  However, we don't assert if the caller tries to
3095  *        overwrite, just ignoring the update instead.
3096  *
3097  * @param mobile_flow Pointer to the Mobile Flow.
3098  * @param tech        The Radio Access Technology to be set. ASCIIZ string. The
3099  *                    caller does not need to preserve the value once the
3100  *                    function returns.
3101  *****************************************************************************/
3102 void evel_mobile_flow_radio_acc_tech_set(EVENT_MOBILE_FLOW * mobile_flow,
3103                                          const char * const tech);
3104
3105 /**************************************************************************//**
3106  * Set the SAC property of the Mobile Flow.
3107  *
3108  * @note  The property is treated as immutable: it is only valid to call
3109  *        the setter once.  However, we don't assert if the caller tries to
3110  *        overwrite, just ignoring the update instead.
3111  *
3112  * @param mobile_flow Pointer to the Mobile Flow.
3113  * @param sac         The SAC to be set. ASCIIZ string.  The caller does not
3114  *                    need to preserve the value once the function returns.
3115  *****************************************************************************/
3116 void evel_mobile_flow_sac_set(EVENT_MOBILE_FLOW * mobile_flow,
3117                               const char * const sac);
3118
3119 /**************************************************************************//**
3120  * Set the Sampling Algorithm property of the Mobile Flow.
3121  *
3122  * @note  The property is treated as immutable: it is only valid to call
3123  *        the setter once.  However, we don't assert if the caller tries to
3124  *        overwrite, just ignoring the update instead.
3125  *
3126  * @param mobile_flow Pointer to the Mobile Flow.
3127  * @param algorithm   The Sampling Algorithm to be set.
3128  *****************************************************************************/
3129 void evel_mobile_flow_samp_alg_set(EVENT_MOBILE_FLOW * mobile_flow,
3130                                    int algorithm);
3131
3132 /**************************************************************************//**
3133  * Set the TAC property of the Mobile Flow.
3134  *
3135  * @note  The property is treated as immutable: it is only valid to call
3136  *        the setter once.  However, we don't assert if the caller tries to
3137  *        overwrite, just ignoring the update instead.
3138  *
3139  * @param mobile_flow Pointer to the Mobile Flow.
3140  * @param tac         The TAC to be set. ASCIIZ string.  The caller does not
3141  *                    need to preserve the value once the function returns.
3142  *****************************************************************************/
3143 void evel_mobile_flow_tac_set(EVENT_MOBILE_FLOW * mobile_flow,
3144                               const char * const tac);
3145
3146 /**************************************************************************//**
3147  * Set the Tunnel ID property of the Mobile Flow.
3148  *
3149  * @note  The property is treated as immutable: it is only valid to call
3150  *        the setter once.  However, we don't assert if the caller tries to
3151  *        overwrite, just ignoring the update instead.
3152  *
3153  * @param mobile_flow Pointer to the Mobile Flow.
3154  * @param tunnel_id   The Tunnel ID to be set. ASCIIZ string.  The caller does
3155  *                    not need to preserve the value once the function returns.
3156  *****************************************************************************/
3157 void evel_mobile_flow_tunnel_id_set(EVENT_MOBILE_FLOW * mobile_flow,
3158                                     const char * const tunnel_id);
3159
3160 /**************************************************************************//**
3161  * Set the VLAN ID 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 vlan_id     The VLAN ID to be set. ASCIIZ string.  The caller does
3169  *                    not need to preserve the value once the function returns.
3170  *****************************************************************************/
3171 void evel_mobile_flow_vlan_id_set(EVENT_MOBILE_FLOW * mobile_flow,
3172                                   const char * const vlan_id);
3173
3174 /**************************************************************************//**
3175  * Create a new Mobile GTP Per Flow Metrics.
3176  *
3177  * @note    The mandatory fields on the Mobile GTP Per Flow Metrics must be
3178  *          supplied to this factory function and are immutable once set.
3179  *          Optional fields have explicit setter functions, but again values
3180  *          may only be set once so that the Mobile GTP Per Flow Metrics has
3181  *          immutable properties.
3182  *
3183  * @param   avg_bit_error_rate
3184  * @param   avg_packet_delay_variation
3185  * @param   avg_packet_latency
3186  * @param   avg_receive_throughput
3187  * @param   avg_transmit_throughput
3188  * @param   flow_activation_epoch
3189  * @param   flow_activation_microsec
3190  * @param   flow_deactivation_epoch
3191  * @param   flow_deactivation_microsec
3192  * @param   flow_deactivation_time
3193  * @param   flow_status
3194  * @param   max_packet_delay_variation
3195  * @param   num_activation_failures
3196  * @param   num_bit_errors
3197  * @param   num_bytes_received
3198  * @param   num_bytes_transmitted
3199  * @param   num_dropped_packets
3200  * @param   num_l7_bytes_received
3201  * @param   num_l7_bytes_transmitted
3202  * @param   num_lost_packets
3203  * @param   num_out_of_order_packets
3204  * @param   num_packet_errors
3205  * @param   num_packets_received_excl_retrans
3206  * @param   num_packets_received_incl_retrans
3207  * @param   num_packets_transmitted_incl_retrans
3208  * @param   num_retries
3209  * @param   num_timeouts
3210  * @param   num_tunneled_l7_bytes_received
3211  * @param   round_trip_time
3212  * @param   time_to_first_byte
3213  *
3214  * @returns pointer to the newly manufactured ::MOBILE_GTP_PER_FLOW_METRICS.
3215  *          If the structure is not used it must be released using
3216  *          ::evel_free_mobile_gtp_flow_metrics.
3217  * @retval  NULL  Failed to create the event.
3218  *****************************************************************************/
3219 MOBILE_GTP_PER_FLOW_METRICS * evel_new_mobile_gtp_flow_metrics(
3220                                       double avg_bit_error_rate,
3221                                       double avg_packet_delay_variation,
3222                                       int avg_packet_latency,
3223                                       int avg_receive_throughput,
3224                                       int avg_transmit_throughput,
3225                                       int flow_activation_epoch,
3226                                       int flow_activation_microsec,
3227                                       int flow_deactivation_epoch,
3228                                       int flow_deactivation_microsec,
3229                                       time_t flow_deactivation_time,
3230                                       const char * const flow_status,
3231                                       int max_packet_delay_variation,
3232                                       int num_activation_failures,
3233                                       int num_bit_errors,
3234                                       int num_bytes_received,
3235                                       int num_bytes_transmitted,
3236                                       int num_dropped_packets,
3237                                       int num_l7_bytes_received,
3238                                       int num_l7_bytes_transmitted,
3239                                       int num_lost_packets,
3240                                       int num_out_of_order_packets,
3241                                       int num_packet_errors,
3242                                       int num_packets_received_excl_retrans,
3243                                       int num_packets_received_incl_retrans,
3244                                       int num_packets_transmitted_incl_retrans,
3245                                       int num_retries,
3246                                       int num_timeouts,
3247                                       int num_tunneled_l7_bytes_received,
3248                                       int round_trip_time,
3249                                       int time_to_first_byte);
3250
3251 /**************************************************************************//**
3252  * Free a Mobile GTP Per Flow Metrics.
3253  *
3254  * Free off the Mobile GTP Per Flow Metrics supplied.  Will free all the
3255  * contained allocated memory.
3256  *
3257  * @note It does not free the Mobile GTP Per Flow Metrics itself, since that
3258  * may be part of a larger structure.
3259  *****************************************************************************/
3260 void evel_free_mobile_gtp_flow_metrics(MOBILE_GTP_PER_FLOW_METRICS * metrics);
3261
3262 /**************************************************************************//**
3263  * Set the Duration of Connection Failed Status property of the Mobile GTP Per
3264  * Flow Metrics.
3265  *
3266  * @note  The property is treated as immutable: it is only valid to call
3267  *        the setter once.  However, we don't assert if the caller tries to
3268  *        overwrite, just ignoring the update instead.
3269  *
3270  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3271  * @param duration    The Duration of Connection Failed Status to be set.
3272  *****************************************************************************/
3273 void evel_mobile_gtp_metrics_dur_con_fail_set(
3274                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3275                                          int duration);
3276
3277 /**************************************************************************//**
3278  * Set the Duration of Tunnel Failed Status property of the Mobile GTP Per Flow
3279  * Metrics.
3280  *
3281  * @note  The property is treated as immutable: it is only valid to call
3282  *        the setter once.  However, we don't assert if the caller tries to
3283  *        overwrite, just ignoring the update instead.
3284  *
3285  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3286  * @param duration    The Duration of Tunnel Failed Status to be set.
3287  *****************************************************************************/
3288 void evel_mobile_gtp_metrics_dur_tun_fail_set(
3289                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3290                                          int duration);
3291
3292 /**************************************************************************//**
3293  * Set the Activated By property of the Mobile GTP Per Flow metrics.
3294  *
3295  * @note  The property is treated as immutable: it is only valid to call
3296  *        the setter once.  However, we don't assert if the caller tries to
3297  *        overwrite, just ignoring the update instead.
3298  *
3299  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3300  * @param act_by      The Activated By to be set.  ASCIIZ string. The caller
3301  *                    does not need to preserve the value once the function
3302  *                    returns.
3303  *****************************************************************************/
3304 void evel_mobile_gtp_metrics_act_by_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3305                                         const char * const act_by);
3306
3307 /**************************************************************************//**
3308  * Set the Activation Time property of the Mobile GTP Per Flow metrics.
3309  *
3310  * @note  The property is treated as immutable: it is only valid to call
3311  *        the setter once.  However, we don't assert if the caller tries to
3312  *        overwrite, just ignoring the update instead.
3313  *
3314  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3315  * @param act_time    The Activation Time to be set.  ASCIIZ string. The caller
3316  *                    does not need to preserve the value once the function
3317  *                    returns.
3318  *****************************************************************************/
3319 void evel_mobile_gtp_metrics_act_time_set(
3320                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3321                                          time_t act_time);
3322
3323 /**************************************************************************//**
3324  * Set the Deactivated By property of the Mobile GTP Per Flow metrics.
3325  *
3326  * @note  The property is treated as immutable: it is only valid to call
3327  *        the setter once.  However, we don't assert if the caller tries to
3328  *        overwrite, just ignoring the update instead.
3329  *
3330  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3331  * @param deact_by    The Deactivated By to be set.  ASCIIZ string. The caller
3332  *                    does not need to preserve the value once the function
3333  *                    returns.
3334  *****************************************************************************/
3335 void evel_mobile_gtp_metrics_deact_by_set(
3336                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3337                                          const char * const deact_by);
3338
3339 /**************************************************************************//**
3340  * Set the GTP Connection Status property of the Mobile GTP Per Flow metrics.
3341  *
3342  * @note  The property is treated as immutable: it is only valid to call
3343  *        the setter once.  However, we don't assert if the caller tries to
3344  *        overwrite, just ignoring the update instead.
3345  *
3346  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3347  * @param status      The GTP Connection Status to be set.  ASCIIZ string. The
3348  *                    caller does not need to preserve the value once the
3349  *                    function returns.
3350  *****************************************************************************/
3351 void evel_mobile_gtp_metrics_con_status_set(
3352                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3353                                          const char * const status);
3354
3355 /**************************************************************************//**
3356  * Set the GTP Tunnel Status property of the Mobile GTP Per Flow metrics.
3357  *
3358  * @note  The property is treated as immutable: it is only valid to call
3359  *        the setter once.  However, we don't assert if the caller tries to
3360  *        overwrite, just ignoring the update instead.
3361  *
3362  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3363  * @param status      The GTP Tunnel Status to be set.  ASCIIZ string. The
3364  *                    caller does not need to preserve the value once the
3365  *                    function returns.
3366  *****************************************************************************/
3367 void evel_mobile_gtp_metrics_tun_status_set(
3368                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3369                                          const char * const status);
3370
3371 /**************************************************************************//**
3372  * Set an IP Type-of-Service count property of the Mobile GTP Per Flow metrics.
3373  *
3374  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3375  * @param index       The index of the IP Type-of-Service.
3376  * @param count       The count.
3377  *****************************************************************************/
3378 void evel_mobile_gtp_metrics_iptos_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3379                                        int index,
3380                                        int count);
3381
3382 /**************************************************************************//**
3383  * Set the Large Packet Round-Trip Time property of the Mobile GTP Per Flow
3384  * 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 rtt         The Large Packet Round-Trip Time to be set.
3392  *****************************************************************************/
3393 void evel_mobile_gtp_metrics_large_pkt_rtt_set(
3394                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3395                                          int rtt);
3396
3397 /**************************************************************************//**
3398  * Set the Large Packet Threshold property of the Mobile GTP Per Flow Metrics.
3399  *
3400  * @note  The property is treated as immutable: it is only valid to call
3401  *        the setter once.  However, we don't assert if the caller tries to
3402  *        overwrite, just ignoring the update instead.
3403  *
3404  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3405  * @param threshold   The Large Packet Threshold to be set.
3406  *****************************************************************************/
3407 void evel_mobile_gtp_metrics_large_pkt_thresh_set(
3408                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3409                                          double threshold);
3410
3411 /**************************************************************************//**
3412  * Set the Max Receive Bit Rate property of the Mobile GTP Per Flow Metrics.
3413  *
3414  * @note  The property is treated as immutable: it is only valid to call
3415  *        the setter once.  However, we don't assert if the caller tries to
3416  *        overwrite, just ignoring the update instead.
3417  *
3418  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3419  * @param rate        The Max Receive Bit Rate to be set.
3420  *****************************************************************************/
3421 void evel_mobile_gtp_metrics_max_rcv_bit_rate_set(
3422                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3423                                          int rate);
3424
3425 /**************************************************************************//**
3426  * Set the Max Transmit Bit Rate 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 rate        The Max Transmit Bit Rate to be set.
3434  *****************************************************************************/
3435 void evel_mobile_gtp_metrics_max_trx_bit_rate_set(
3436                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3437                                          int rate);
3438
3439 /**************************************************************************//**
3440  * Set the Number of GTP Echo Failures property of the Mobile GTP Per Flow
3441  * Metrics.
3442  *
3443  * @note  The property is treated as immutable: it is only valid to call
3444  *        the setter once.  However, we don't assert if the caller tries to
3445  *        overwrite, just ignoring the update instead.
3446  *
3447  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3448  * @param num         The Number of GTP Echo Failures to be set.
3449  *****************************************************************************/
3450 void evel_mobile_gtp_metrics_num_echo_fail_set(
3451                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3452                                          int num);
3453
3454 /**************************************************************************//**
3455  * Set the Number of GTP Tunnel Errors property of the Mobile GTP Per Flow
3456  * Metrics.
3457  *
3458  * @note  The property is treated as immutable: it is only valid to call
3459  *        the setter once.  However, we don't assert if the caller tries to
3460  *        overwrite, just ignoring the update instead.
3461  *
3462  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3463  * @param num         The Number of GTP Tunnel Errors to be set.
3464  *****************************************************************************/
3465 void evel_mobile_gtp_metrics_num_tun_fail_set(
3466                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3467                                          int num);
3468
3469 /**************************************************************************//**
3470  * Set the Number of HTTP Errors property of the Mobile GTP Per Flow Metrics.
3471  *
3472  * @note  The property is treated as immutable: it is only valid to call
3473  *        the setter once.  However, we don't assert if the caller tries to
3474  *        overwrite, just ignoring the update instead.
3475  *
3476  * @param metrics     Pointer to the Mobile GTP Per Flow Metrics.
3477  * @param num         The Number of HTTP Errors to be set.
3478  *****************************************************************************/
3479 void evel_mobile_gtp_metrics_num_http_errors_set(
3480                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3481                                          int num);
3482
3483 /**************************************************************************//**
3484  * Add a TCP flag count to the 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 tcp_flag      The TCP flag count to be updated.
3492  * @param count         The associated flag count.
3493  *****************************************************************************/
3494 void evel_mobile_gtp_metrics_tcp_flag_count_add(
3495                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3496                                          const EVEL_TCP_FLAGS tcp_flag,
3497                                          const int count);
3498
3499 /**************************************************************************//**
3500  * Add a QCI COS count to the metrics.
3501  *
3502  * @note  The property is treated as immutable: it is only valid to call
3503  *        the setter once.  However, we don't assert if the caller tries to
3504  *        overwrite, just ignoring the update instead.
3505  *
3506  * @param metrics       Pointer to the Mobile GTP Per Flow Metrics.
3507  * @param qci_cos       The QCI COS count to be updated.
3508  * @param count         The associated QCI COS count.
3509  *****************************************************************************/
3510 void evel_mobile_gtp_metrics_qci_cos_count_add(
3511                                          MOBILE_GTP_PER_FLOW_METRICS * metrics,
3512                                          const EVEL_QCI_COS_TYPES qci_cos,
3513                                          const int count);
3514
3515 /*****************************************************************************/
3516 /*****************************************************************************/
3517 /*                                                                           */
3518 /*   SIGNALING                                                               */
3519 /*                                                                           */
3520 /*****************************************************************************/
3521 /*****************************************************************************/
3522
3523 /**************************************************************************//**
3524  * Create a new Signaling event.
3525  *
3526  * @note    The mandatory fields on the Signaling must be supplied to
3527  *          this factory function and are immutable once set.  Optional fields
3528  *          have explicit setter functions, but again values may only be set
3529  *          once so that the event has immutable properties.
3530  * @param event_name    Unique Event Name
3531  * @param event_id    A universal identifier of the event for analysis etc
3532  * @param vendor_name   The vendor id to encode in the event vnf field.
3533  * @param module        The module to encode in the event.
3534  * @param vnfname       The Virtual network function to encode in the event.
3535  * @returns pointer to the newly manufactured ::EVENT_SIGNALING.  If the event
3536  *          is not used (i.e. posted) it must be released using
3537  *          ::evel_free_signaling.
3538  * @retval  NULL  Failed to create the event.
3539  *****************************************************************************/
3540 EVENT_SIGNALING * evel_new_signaling(const char* ev_name, const char *ev_id,
3541                                      const char * const vendor_name,
3542                                      const char * const correlator,
3543                                      const char * const local_ip_address,
3544                                      const char * const local_port,
3545                                      const char * const remote_ip_address,
3546                                      const char * const remote_port);
3547
3548 /**************************************************************************//**
3549  * Free a Signaling event.
3550  *
3551  * Free off the event supplied.  Will free all the contained allocated memory.
3552  *
3553  * @note It does not free the event itself, since that may be part of a larger
3554  * structure.
3555  *****************************************************************************/
3556 void evel_free_signaling(EVENT_SIGNALING * const event);
3557
3558 /**************************************************************************//**
3559  * Set the Event Type property of the Signaling event.
3560  *
3561  * @note  The property is treated as immutable: it is only valid to call
3562  *        the setter once.  However, we don't assert if the caller tries to
3563  *        overwrite, just ignoring the update instead.
3564  *
3565  * @param event         Pointer to the Signaling event.
3566  * @param type          The Event Type to be set. ASCIIZ string. The caller
3567  *                      does not need to preserve the value once the function
3568  *                      returns.
3569  *****************************************************************************/
3570 void evel_signaling_type_set(EVENT_SIGNALING * const event,
3571                              const char * const type);
3572
3573 /**************************************************************************//**
3574  * Add an additional value name/value pair to the SIP signaling.
3575  *
3576  * The name and value are null delimited ASCII strings.  The library takes
3577  * a copy so the caller does not have to preserve values after the function
3578  * returns.
3579  *
3580  * @param event     Pointer to the fault.
3581  * @param name      ASCIIZ string with the attribute's name.  The caller
3582  *                  does not need to preserve the value once the function
3583  *                  returns.
3584  * @param value     ASCIIZ string with the attribute's value.  The caller
3585  *                  does not need to preserve the value once the function
3586  *                  returns.
3587  *****************************************************************************/
3588 void evel_signaling_addl_info_add(EVENT_SIGNALING * event, char * name, char * value);
3589
3590 /**************************************************************************//**
3591  * Set the Correlator property of the Signaling event.
3592  *
3593  * @note  The property is treated as immutable: it is only valid to call
3594  *        the setter once.  However, we don't assert if the caller tries to
3595  *        overwrite, just ignoring the update instead.
3596  *
3597  * @param event         Pointer to the Signaling event.
3598  * @param correlator    The correlator to be set. ASCIIZ string. The caller
3599  *                      does not need to preserve the value once the function
3600  *                      returns.
3601  *****************************************************************************/
3602 void evel_signaling_correlator_set(EVENT_SIGNALING * const event,
3603                                    const char * const correlator);
3604
3605 /**************************************************************************//**
3606  * Set the Local Ip Address property of the Signaling event.
3607  *
3608  * @note  The property is treated as immutable: it is only valid to call
3609  *        the setter once.  However, we don't assert if the caller tries to
3610  *        overwrite, just ignoring the update instead.
3611  *
3612  * @param event         Pointer to the Signaling event.
3613  * @param local_ip_address
3614  *                      The Local Ip Address to be set. ASCIIZ string. The
3615  *                      caller does not need to preserve the value once the
3616  *                      function returns.
3617  *****************************************************************************/
3618 void evel_signaling_local_ip_address_set(EVENT_SIGNALING * const event,
3619                                          const char * const local_ip_address);
3620
3621 /**************************************************************************//**
3622  * Set the Local Port property of the Signaling event.
3623  *
3624  * @note  The property is treated as immutable: it is only valid to call
3625  *        the setter once.  However, we don't assert if the caller tries to
3626  *        overwrite, just ignoring the update instead.
3627  *
3628  * @param event         Pointer to the Signaling event.
3629  * @param local_port    The Local Port to be set. ASCIIZ string. The caller
3630  *                      does not need to preserve the value once the function
3631  *                      returns.
3632  *****************************************************************************/
3633 void evel_signaling_local_port_set(EVENT_SIGNALING * const event,
3634                                    const char * const local_port);
3635
3636 /**************************************************************************//**
3637  * Set the Remote Ip Address property of the Signaling event.
3638  *
3639  * @note  The property is treated as immutable: it is only valid to call
3640  *        the setter once.  However, we don't assert if the caller tries to
3641  *        overwrite, just ignoring the update instead.
3642  *
3643  * @param event         Pointer to the Signaling event.
3644  * @param remote_ip_address
3645  *                      The Remote Ip Address to be set. ASCIIZ string. The
3646  *                      caller does not need to preserve the value once the
3647  *                      function returns.
3648  *****************************************************************************/
3649 void evel_signaling_remote_ip_address_set(EVENT_SIGNALING * const event,
3650                                          const char * const remote_ip_address);
3651
3652 /**************************************************************************//**
3653  * Set the Remote Port property of the Signaling event.
3654  *
3655  * @note  The property is treated as immutable: it is only valid to call
3656  *        the setter once.  However, we don't assert if the caller tries to
3657  *        overwrite, just ignoring the update instead.
3658  *
3659  * @param event         Pointer to the Signaling event.
3660  * @param remote_port   The Remote Port to be set. ASCIIZ string. The caller
3661  *                      does not need to preserve the value once the function
3662  *                      returns.
3663  *****************************************************************************/
3664 void evel_signaling_remote_port_set(EVENT_SIGNALING * const event,
3665                                     const char * const remote_port);
3666 /**************************************************************************//**
3667  * Set the Vendor module property of the Signaling event.
3668  *
3669  * @note  The property is treated as immutable: it is only valid to call
3670  *        the setter once.  However, we don't assert if the caller tries to
3671  *        overwrite, just ignoring the update instead.
3672  *
3673  * @param event         Pointer to the Signaling event.
3674  * @param modulename    The module name to be set. ASCIIZ string. The caller
3675  *                      does not need to preserve the value once the function
3676  *                      returns.
3677  *****************************************************************************/
3678 void evel_signaling_vnfmodule_name_set(EVENT_SIGNALING * const event,
3679                                     const char * const module_name);
3680 /**************************************************************************//**
3681  * Set the Vendor module 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 vnfname       The Virtual Network function to be set. ASCIIZ string.
3689  *                      The caller does not need to preserve the value once
3690  *                      the function returns.
3691  *****************************************************************************/
3692 void evel_signaling_vnfname_set(EVENT_SIGNALING * const event,
3693                                     const char * const vnfname);
3694
3695 /**************************************************************************//**
3696  * Set the Compressed SIP property of the Signaling event.
3697  *
3698  * @note  The property is treated as immutable: it is only valid to call
3699  *        the setter once.  However, we don't assert if the caller tries to
3700  *        overwrite, just ignoring the update instead.
3701  *
3702  * @param event         Pointer to the Signaling event.
3703  * @param compressed_sip
3704  *                      The Compressed SIP to be set. ASCIIZ string. The caller
3705  *                      does not need to preserve the value once the function
3706  *                      returns.
3707  *****************************************************************************/
3708 void evel_signaling_compressed_sip_set(EVENT_SIGNALING * const event,
3709                                        const char * const compressed_sip);
3710
3711 /**************************************************************************//**
3712  * Set the Summary SIP property of the Signaling event.
3713  *
3714  * @note  The property is treated as immutable: it is only valid to call
3715  *        the setter once.  However, we don't assert if the caller tries to
3716  *        overwrite, just ignoring the update instead.
3717  *
3718  * @param event         Pointer to the Signaling event.
3719  * @param summary_sip   The Summary SIP to be set. ASCIIZ string. The caller
3720  *                      does not need to preserve the value once the function
3721  *                      returns.
3722  *****************************************************************************/
3723 void evel_signaling_summary_sip_set(EVENT_SIGNALING * const event,
3724                                     const char * const summary_sip);
3725
3726
3727 /*****************************************************************************/
3728 /*****************************************************************************/
3729 /*                                                                           */
3730 /*   STATE CHANGE                                                            */
3731 /*                                                                           */
3732 /*****************************************************************************/
3733 /*****************************************************************************/
3734
3735 /**************************************************************************//**
3736  * Create a new State Change event.
3737  *
3738  * @note    The mandatory fields on the Syslog must be supplied to this factory
3739  *          function and are immutable once set.  Optional fields have explicit
3740  *          setter functions, but again values may only be set once so that the
3741  *          Syslog has immutable properties.
3742  *
3743  * @param event_name    Unique Event Name
3744  * @param event_id    A universal identifier of the event for analysis etc
3745  * @param new_state     The new state of the reporting entity.
3746  * @param old_state     The old state of the reporting entity.
3747  * @param interface     The card or port name of the reporting entity.
3748  *
3749  * @returns pointer to the newly manufactured ::EVENT_STATE_CHANGE.  If the
3750  *          event is not used it must be released using
3751  *          ::evel_free_state_change
3752  * @retval  NULL  Failed to create the event.
3753  *****************************************************************************/
3754 EVENT_STATE_CHANGE * evel_new_state_change(const char* ev_name, const char *ev_id,
3755                                            const EVEL_ENTITY_STATE new_state,
3756                                            const EVEL_ENTITY_STATE old_state,
3757                                            const char * const interface);
3758
3759 /**************************************************************************//**
3760  * Free a State Change.
3761  *
3762  * Free off the State Change supplied.  Will free all the contained allocated
3763  * memory.
3764  *
3765  * @note It does not free the State Change itself, since that may be part of a
3766  * larger structure.
3767  *****************************************************************************/
3768 void evel_free_state_change(EVENT_STATE_CHANGE * const state_change);
3769
3770 /**************************************************************************//**
3771  * Set the Event Type property of the State Change.
3772  *
3773  * @note  The property is treated as immutable: it is only valid to call
3774  *        the setter once.  However, we don't assert if the caller tries to
3775  *        overwrite, just ignoring the update instead.
3776  *
3777  * @param state_change  Pointer to the ::EVENT_STATE_CHANGE.
3778  * @param type          The Event Type to be set. ASCIIZ string. The caller
3779  *                      does not need to preserve the value once the function
3780  *                      returns.
3781  *****************************************************************************/
3782 void evel_state_change_type_set(EVENT_STATE_CHANGE * const state_change,
3783                                 const char * const type);
3784
3785 /**************************************************************************//**
3786  * Add an additional field name/value pair to the State Change.
3787  *
3788  * The name and value are null delimited ASCII strings.  The library takes
3789  * a copy so the caller does not have to preserve values after the function
3790  * returns.
3791  *
3792  * @param state_change  Pointer to the ::EVENT_STATE_CHANGE.
3793  * @param name          ASCIIZ string with the attribute's name.  The caller
3794  *                      does not need to preserve the value once the function
3795  *                      returns.
3796  * @param value         ASCIIZ string with the attribute's value.  The caller
3797  *                      does not need to preserve the value once the function
3798  *                      returns.
3799  *****************************************************************************/
3800 void evel_state_change_addl_field_add(EVENT_STATE_CHANGE * const state_change,
3801                                       const char * const name,
3802                                       const char * const value);
3803
3804 /*****************************************************************************/
3805 /*****************************************************************************/
3806 /*                                                                           */
3807 /*   SYSLOG                                                                  */
3808 /*                                                                           */
3809 /*****************************************************************************/
3810 /*****************************************************************************/
3811
3812 /**************************************************************************//**
3813  * Create a new syslog event.
3814  *
3815  * @note    The mandatory fields on the Syslog must be supplied to this factory
3816  *          function and are immutable once set.  Optional fields have explicit
3817  *          setter functions, but again values may only be set once so that the
3818  *          Syslog has immutable properties.
3819  *
3820  * @param event_name    Unique Event Name
3821  * @param event_id    A universal identifier of the event for analysis etc
3822  * @param   event_source_type
3823  * @param   syslog_msg
3824  * @param   syslog_tag
3825  * @param   version
3826  *
3827  * @returns pointer to the newly manufactured ::EVENT_SYSLOG.  If the event is
3828  *          not used it must be released using ::evel_free_syslog
3829  * @retval  NULL  Failed to create the event.
3830  *****************************************************************************/
3831 EVENT_SYSLOG * evel_new_syslog(const char* ev_name, const char *ev_id,
3832                                 EVEL_SOURCE_TYPES event_source_type,
3833                                const char * const syslog_msg,
3834                                const char * const syslog_tag);
3835
3836 /**************************************************************************//**
3837  * Set the Event Type property of the Syslog.
3838  *
3839  * @note  The property is treated as immutable: it is only valid to call
3840  *        the setter once.  However, we don't assert if the caller tries to
3841  *        overwrite, just ignoring the update instead.
3842  *
3843  * @param syslog      Pointer to the syslog.
3844  * @param type        The Event Type to be set. ASCIIZ string. The caller
3845  *                    does not need to preserve the value once the function
3846  *                    returns.
3847  *****************************************************************************/
3848 void evel_syslog_type_set(EVENT_SYSLOG * syslog,
3849                           const char * const type);
3850
3851 /**************************************************************************//**
3852  * Free a Syslog.
3853  *
3854  * Free off the Syslog supplied.  Will free all the contained allocated memory.
3855  *
3856  * @note It does not free the Syslog itself, since that may be part of a
3857  * larger structure.
3858  *****************************************************************************/
3859 void evel_free_syslog(EVENT_SYSLOG * event);
3860
3861 /**************************************************************************//**
3862  * Add an additional field name/value pair to the Syslog.
3863  *
3864  * The name and value are null delimited ASCII strings.  The library takes
3865  * a copy so the caller does not have to preserve values after the function
3866  * returns.
3867  *
3868  * @param syslog    Pointer to the syslog.
3869  * @param name      ASCIIZ string with the attribute's name.  The caller
3870  *                  does not need to preserve the value once the function
3871  *                  returns.
3872  * @param value     ASCIIZ string with the attribute's value.  The caller
3873  *                  does not need to preserve the value once the function
3874  *                  returns.
3875  *****************************************************************************/
3876 void evel_syslog_addl_field_add(EVENT_SYSLOG * syslog,
3877                                 char * name,
3878                                 char * value);
3879
3880 /**************************************************************************//**
3881  * Set the Event Source Host property of the Syslog.
3882  *
3883  * @note  The property is treated as immutable: it is only valid to call
3884  *        the setter once.  However, we don't assert if the caller tries to
3885  *        overwrite, just ignoring the update instead.
3886  *
3887  * @param syslog      Pointer to the Syslog.
3888  * @param host        The Event Source Host to be set.  ASCIIZ string. The
3889  *                    caller does not need to preserve the value once the
3890  *                    function returns.
3891  *****************************************************************************/
3892 void evel_syslog_event_source_host_set(EVENT_SYSLOG * syslog,
3893                                        const char * const host);
3894
3895 /**************************************************************************//**
3896  * Set the Syslog Facility property of the Syslog.
3897  *
3898  * @note  The property is treated as immutable: it is only valid to call
3899  *        the setter once.  However, we don't assert if the caller tries to
3900  *        overwrite, just ignoring the update instead.
3901  *
3902  * @param syslog      Pointer to the Syslog.
3903  * @param facility    The Syslog Facility to be set.  ASCIIZ string. The caller
3904  *                    does not need to preserve the value once the function
3905  *                    returns.
3906  *****************************************************************************/
3907 void evel_syslog_facility_set(EVENT_SYSLOG * syslog,
3908                               EVEL_SYSLOG_FACILITIES facility);
3909
3910 /**************************************************************************//**
3911  * Set the Process property of the Syslog.
3912  *
3913  * @note  The property is treated as immutable: it is only valid to call
3914  *        the setter once.  However, we don't assert if the caller tries to
3915  *        overwrite, just ignoring the update instead.
3916  *
3917  * @param syslog      Pointer to the Syslog.
3918  * @param proc        The Process to be set.  ASCIIZ string. The caller does
3919  *                    not need to preserve the value once the function returns.
3920  *****************************************************************************/
3921 void evel_syslog_proc_set(EVENT_SYSLOG * syslog, const char * const proc);
3922
3923 /**************************************************************************//**
3924  * Set the Process ID 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 proc_id     The Process ID to be set.
3932  *****************************************************************************/
3933 void evel_syslog_proc_id_set(EVENT_SYSLOG * syslog, int proc_id);
3934
3935 /**************************************************************************//**
3936  * Set the Version property of the Syslog.
3937  *
3938  * @note  The property is treated as immutable: it is only valid to call
3939  *        the setter once.  However, we don't assert if the caller tries to
3940  *        overwrite, just ignoring the update instead.
3941  *
3942  * @param syslog      Pointer to the Syslog.
3943  * @param version     The Version to be set.
3944  *****************************************************************************/
3945 void evel_syslog_version_set(EVENT_SYSLOG * syslog, int version);
3946
3947 /**************************************************************************//**
3948  * Set the Structured Data property of the Syslog.
3949  *
3950  * @note  The property is treated as immutable: it is only valid to call
3951  *        the setter once.  However, we don't assert if the caller tries to
3952  *        overwrite, just ignoring the update instead.
3953  *
3954  * @param syslog      Pointer to the Syslog.
3955  * @param s_data      The Structured Data to be set.  ASCIIZ string. The caller
3956  *                    does not need to preserve the value once the function
3957  *                    returns.
3958  *****************************************************************************/
3959 void evel_syslog_s_data_set(EVENT_SYSLOG * syslog, const char * const s_data);
3960
3961 /**************************************************************************//**
3962  * Set the Structured SDID property of the Syslog.
3963  *
3964  * @note  The property is treated as immutable: it is only valid to call
3965  *        the setter once.  However, we don't assert if the caller tries to
3966  *        overwrite, just ignoring the update instead.
3967  *
3968  * @param syslog     Pointer to the Syslog.
3969  * @param sdid     The Structured Data to be set. ASCIIZ string. name@number
3970  *                 Caller does not need to preserve the value once the function
3971  *                   returns.
3972  *****************************************************************************/
3973 void evel_syslog_sdid_set(EVENT_SYSLOG * syslog, const char * const sdid);
3974
3975 /**************************************************************************//**
3976  * Set the Structured Severity 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 sdid     The Structured Data to be set. ASCIIZ string. 
3984  *                 Caller does not need to preserve the value once the function
3985  *                   returns.
3986  *****************************************************************************/
3987 void evel_syslog_severity_set(EVENT_SYSLOG * syslog, const char * const severty);
3988
3989
3990 /*****************************************************************************/
3991 /*****************************************************************************/
3992 /*                                                                           */
3993 /*   OTHER                                                                   */
3994 /*                                                                           */
3995 /*****************************************************************************/
3996 /*****************************************************************************/
3997
3998 /**************************************************************************//**
3999  * Create a new other event.
4000  *
4001  * @param event_name    Unique Event Name
4002  * @param event_id    A universal identifier of the event for analysis etc
4003  *
4004  * @returns pointer to the newly manufactured ::EVENT_OTHER.  If the event is
4005  *          not used it must be released using ::evel_free_other.
4006  * @retval  NULL  Failed to create the event.
4007  *****************************************************************************/
4008 EVENT_OTHER * evel_new_other(const char* ev_name, const char *ev_id);
4009
4010 /**************************************************************************//**
4011  * Free an Other.
4012  *
4013  * Free off the Other supplied.  Will free all the contained allocated memory.
4014  *
4015  * @note It does not free the Other itself, since that may be part of a
4016  * larger structure.
4017  *****************************************************************************/
4018 void evel_free_other(EVENT_OTHER * event);
4019
4020 /**************************************************************************//**
4021  * Set the Event Type property of the Other.
4022  *
4023  * @note  The property is treated as immutable: it is only valid to call
4024  *        the setter once.  However, we don't assert if the caller tries to
4025  *        overwrite, just ignoring the update instead.
4026  *
4027  * @param other       Pointer to the Other.
4028  * @param type        The Event Type to be set. ASCIIZ string. The caller
4029  *                    does not need to preserve the value once the function
4030  *                    returns.
4031  *****************************************************************************/
4032 void evel_other_type_set(EVENT_OTHER * other,
4033                          const char * const type);
4034
4035 /**************************************************************************//**
4036  * Add a value name/value pair to the Other.
4037  *
4038  * The name and value are null delimited ASCII strings.  The library takes
4039  * a copy so the caller does not have to preserve values after the function
4040  * returns.
4041  *
4042  * @param other     Pointer to the Other.
4043  * @param name      ASCIIZ string with the attribute's name.
4044  * @param value     ASCIIZ string with the attribute's value.
4045  *****************************************************************************/
4046 void evel_other_field_add(EVENT_OTHER * other,
4047                           char * name,
4048                           char * value);
4049
4050 /*****************************************************************************/
4051 /*****************************************************************************/
4052 /*                                                                           */
4053 /*   THROTTLING                                                              */
4054 /*                                                                           */
4055 /*****************************************************************************/
4056 /*****************************************************************************/
4057
4058 /**************************************************************************//**
4059  * Return the current measurement interval provided by the Event Listener.
4060  *
4061  * @returns The current measurement interval
4062  * @retval  EVEL_MEASUREMENT_INTERVAL_UKNOWN (0) - interval has not been
4063  *          specified
4064  *****************************************************************************/
4065 int evel_get_measurement_interval();
4066
4067 /*****************************************************************************/
4068 /* Supported Report version.                                                 */
4069 /*****************************************************************************/
4070 #define EVEL_VOICEQ_MAJOR_VERSION 1
4071 #define EVEL_VOICEQ_MINOR_VERSION 1
4072
4073 /**************************************************************************//**
4074  * End of Call Voice Quality Metrices
4075  * JSON equivalent field: endOfCallVqmSummaries
4076  *****************************************************************************/
4077 typedef struct end_of_call_vqm_summaries {
4078         /***************************************************************************/
4079         /* Mandatory fields                                                        */
4080         /***************************************************************************/
4081         char* adjacencyName;
4082         char* endpointDescription;
4083
4084         /***************************************************************************/
4085         /* Optional fields                                                         */
4086         /***************************************************************************/
4087         EVEL_OPTION_INT endpointJitter;
4088         EVEL_OPTION_INT endpointRtpOctetsDiscarded;
4089         EVEL_OPTION_INT endpointRtpOctetsReceived;
4090         EVEL_OPTION_INT endpointRtpOctetsSent;
4091         EVEL_OPTION_INT endpointRtpPacketsDiscarded;
4092         EVEL_OPTION_INT endpointRtpPacketsReceived;
4093         EVEL_OPTION_INT endpointRtpPacketsSent;
4094         EVEL_OPTION_INT localJitter;
4095         EVEL_OPTION_INT localRtpOctetsDiscarded;
4096         EVEL_OPTION_INT localRtpOctetsReceived;
4097         EVEL_OPTION_INT localRtpOctetsSent;
4098         EVEL_OPTION_INT localRtpPacketsDiscarded;
4099         EVEL_OPTION_INT localRtpPacketsReceived;
4100         EVEL_OPTION_INT localRtpPacketsSent;
4101         EVEL_OPTION_INT mosCqe;
4102         EVEL_OPTION_INT packetsLost;
4103         EVEL_OPTION_INT packetLossPercent;
4104         EVEL_OPTION_INT rFactor;
4105         EVEL_OPTION_INT roundTripDelay;
4106
4107 } END_OF_CALL_VOICE_QUALITY_METRICS;
4108
4109 /**************************************************************************//**
4110 * Voice QUality.
4111 * JSON equivalent field: voiceQualityFields
4112 *****************************************************************************/
4113
4114 typedef struct event_voiceQuality {
4115         /***************************************************************************/
4116         /* Header and version                                                      */
4117         /***************************************************************************/
4118         EVENT_HEADER header;
4119         int major_version;
4120         int minor_version;
4121
4122         /***************************************************************************/
4123         /* Mandatory fields                                                        */
4124         /***************************************************************************/
4125         
4126         char *calleeSideCodec;
4127         char *callerSideCodec;
4128         char *correlator;
4129         char *midCallRtcp;
4130         VENDOR_VNFNAME_FIELD vendorVnfNameFields;
4131         END_OF_CALL_VOICE_QUALITY_METRICS *endOfCallVqmSummaries;
4132
4133         /***************************************************************************/
4134         /* Optional fields                                                         */
4135         /***************************************************************************/
4136         EVEL_OPTION_STRING phoneNumber;
4137         DLIST additionalInformation;
4138
4139 } EVENT_VOICE_QUALITY;
4140 /**************************************************************************//**
4141  * Voice Quality Additional Info.
4142  * JSON equivalent field: additionalInformation
4143  *****************************************************************************/
4144 typedef struct voice_quality_additional_info {
4145   char * name;
4146   char * value;
4147 } VOICE_QUALITY_ADDL_INFO;
4148
4149 /**************************************************************************//**
4150  * Create a new voice quality event.
4151  *
4152  * @note    The mandatory fields on the Voice Quality must be supplied to this 
4153  *          factory function and are immutable once set.  Optional fields have 
4154  *          explicit setter functions, but again values may only be set once 
4155  *          so that the Voice Quality has immutable properties.
4156  * @param event_name    Unique Event Name
4157  * @param event_id    A universal identifier of the event for analysis etc
4158  * @param   calleeSideCodec                     Callee codec for the call.
4159  * @param   callerSideCodec                     Caller codec for the call.
4160  * @param   correlator                          Constant across all events on this call.
4161  * @param   midCallRtcp                         Base64 encoding of the binary RTCP data
4162  *                                                                      (excluding Eth/IP/UDP headers).
4163  * @param   vendorVnfNameFields         Vendor, VNF and VfModule names.
4164  * @returns pointer to the newly manufactured ::EVENT_VOICE_QUALITY.  If the 
4165  *          event is not used (i.e. posted) it must be released using
4166                         ::evel_free_voice_quality.
4167  * @retval  NULL  Failed to create the event.
4168  *****************************************************************************/
4169 EVENT_VOICE_QUALITY * evel_new_voice_quality(const char* ev_name, const char *ev_id,
4170         const char * const calleeSideCodec,
4171         const char * const callerSideCodec, const char * const correlator,
4172         const char * const midCallRtcp, const char * const vendorVnfNameFields);
4173
4174 /**************************************************************************//**
4175  * Set the Callee side codec for Call for domain Voice Quality
4176  *
4177  * @note  The property is treated as immutable: it is only valid to call
4178  *        the setter once.  However, we don't assert if the caller tries to
4179  *        overwrite, just ignoring the update instead.
4180  *
4181  * @param voiceQuality                          Pointer to the Voice Quality Event.
4182  * @param calleeCodecForCall            The Callee Side Codec to be set.  ASCIIZ 
4183  *                                                                      string. The caller does not need to 
4184  *                                                                      preserve the value once the function
4185  *                                                                      returns.
4186  *****************************************************************************/
4187 void evel_voice_quality_callee_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
4188                                                                         const char * const calleeCodecForCall);
4189
4190 /**************************************************************************//**
4191  * Set the Caller side codec for Call for domain Voice Quality
4192  *
4193  * @note  The property is treated as immutable: it is only valid to call
4194  *        the setter once.  However, we don't assert if the caller tries to
4195  *        overwrite, just ignoring the update instead.
4196  *
4197  * @param voiceQuality                          Pointer to the Voice Quality Event.
4198  * @param callerCodecForCall            The Caller Side Codec to be set.  ASCIIZ 
4199  *                                                                      string. The caller does not need to 
4200  *                                                                      preserve the value once the function
4201  *                                                                      returns.
4202  *****************************************************************************/
4203 void evel_voice_quality_caller_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
4204                                                                         const char * const callerCodecForCall);
4205
4206 /**************************************************************************//**
4207  * Set the correlator for domain Voice Quality
4208  *
4209  * @note  The property is treated as immutable: it is only valid to call
4210  *        the setter once.  However, we don't assert if the caller tries to
4211  *        overwrite, just ignoring the update instead.
4212  *
4213  * @param voiceQuality                          Pointer to the Voice Quality Event.
4214  * @param correlator                            The correlator value to be set.  ASCIIZ 
4215  *                                                                      string. The caller does not need to 
4216  *                                                                      preserve the value once the function
4217  *                                                                      returns.
4218  *****************************************************************************/
4219 void evel_voice_quality_correlator_set(EVENT_VOICE_QUALITY * voiceQuality,
4220                                                                         const char * const vCorrelator);
4221
4222 /**************************************************************************//**
4223  * Set the RTCP Call Data for domain Voice Quality
4224  *
4225  * @note  The property is treated as immutable: it is only valid to call
4226  *        the setter once.  However, we don't assert if the caller tries to
4227  *        overwrite, just ignoring the update instead.
4228  *
4229  * @param voiceQuality                          Pointer to the Voice Quality Event.
4230  * @param rtcpCallData                  The RTCP Call Data to be set.  ASCIIZ 
4231  *                                                                      string. The caller does not need to 
4232  *                                                                      preserve the value once the function
4233  *                                                                      returns.
4234  *****************************************************************************/
4235 void evel_voice_quality_rtcp_data_set(EVENT_VOICE_QUALITY * voiceQuality,
4236                                                                         const char * const rtcpCallData);
4237
4238 /**************************************************************************//**
4239  * Set the Vendor VNF Name fields for domain Voice Quality
4240  *
4241  * @note  The property is treated as immutable: it is only valid to call
4242  *        the setter once.  However, we don't assert if the caller tries to
4243  *        overwrite, just ignoring the update instead.
4244  *
4245  * @param voiceQuality                          Pointer to the Voice Quality Event.
4246  * @param nameFields                    The Vendor, VNF and VfModule names to be set.   
4247  *                                                                      ASCIIZ string. The caller does not need to 
4248  *                                                                      preserve the value once the function
4249  *                                                                      returns.
4250  *****************************************************************************/
4251 void evel_voice_quality_name_fields_set(EVENT_VOICE_QUALITY * voiceQuality,
4252                                                                         const char * const nameFields);
4253
4254 /**************************************************************************//**
4255  * Add an End of Call Voice Quality Metrices
4256
4257  * The adjacencyName and endpointDescription is null delimited ASCII string.  
4258  * The library takes a copy so the caller does not have to preserve values
4259  * after the function returns.
4260  *
4261  * @param voiceQuality     Pointer to the measurement.
4262  * @param adjacencyName                                         Adjacency name
4263  * @param endpointDescription                           Enumeration: ‘Caller’, ‘Callee’.
4264  * @param endpointJitter                                        Endpoint jitter
4265  * @param endpointRtpOctetsDiscarded        Endpoint RTP octets discarded.
4266  * @param endpointRtpOctetsReceived                     Endpoint RTP octets received.
4267  * @param endpointRtpOctetsSent                         Endpoint RTP octets sent
4268  * @param endpointRtpPacketsDiscarded           Endpoint RTP packets discarded.
4269  * @param endpointRtpPacketsReceived            Endpoint RTP packets received.
4270  * @param endpointRtpPacketsSent                        Endpoint RTP packets sent.
4271  * @param localJitter                                           Local jitter.
4272  * @param localRtpOctetsDiscarded                       Local RTP octets discarded.
4273  * @param localRtpOctetsReceived                        Local RTP octets received.
4274  * @param localRtpOctetsSent                            Local RTP octets sent.
4275  * @param localRtpPacketsDiscarded                      Local RTP packets discarded.
4276  * @param localRtpPacketsReceived                       Local RTP packets received.
4277  * @param localRtpPacketsSent                           Local RTP packets sent.
4278  * @param mosCqe                                                        Decimal range from 1 to 5
4279  *                                                                                      (1 decimal place)
4280  * @param packetsLost                                           No      Packets lost
4281  * @param packetLossPercent                                     Calculated percentage packet loss 
4282  * @param rFactor                                                       rFactor from 0 to 100
4283  * @param roundTripDelay                                        Round trip delay in milliseconds
4284  *****************************************************************************/
4285 void evel_voice_quality_end_metrics_add(EVENT_VOICE_QUALITY * voiceQuality,
4286         const char * adjacencyName, EVEL_SERVICE_ENDPOINT_DESC endpointDescription,
4287         int endpointJitter,
4288         int endpointRtpOctetsDiscarded,
4289         int endpointRtpOctetsReceived,
4290         int endpointRtpOctetsSent,
4291         int endpointRtpPacketsDiscarded,
4292         int endpointRtpPacketsReceived,
4293         int endpointRtpPacketsSent,
4294         int localJitter,
4295         int localRtpOctetsDiscarded,
4296         int localRtpOctetsReceived,
4297         int localRtpOctetsSent,
4298         int localRtpPacketsDiscarded,
4299         int localRtpPacketsReceived,
4300         int localRtpPacketsSent,
4301         int mosCqe,
4302         int packetsLost,
4303         int packetLossPercent,
4304         int rFactor,
4305         int roundTripDelay);
4306
4307 /**************************************************************************//**
4308  * Free a Voice Quality.
4309  *
4310  * Free off the Voce Quality supplied.  Will free all the contained allocated
4311  * memory.
4312  *
4313  * @note It does not free the Voice Quality itself, since that may be part of a
4314  * larger structure.
4315  *****************************************************************************/
4316 void evel_free_voice_quality(EVENT_VOICE_QUALITY * voiceQuality);
4317
4318 /**************************************************************************//**
4319  * Add an additional value name/value pair to the Voice Quality.
4320  *
4321  * The name and value are null delimited ASCII strings.  The library takes
4322  * a copy so the caller does not have to preserve values after the function
4323  * returns.
4324  *
4325  * @param fault     Pointer to the fault.
4326  * @param name      ASCIIZ string with the attribute's name.  The caller
4327  *                  does not need to preserve the value once the function
4328  *                  returns.
4329  * @param value     ASCIIZ string with the attribute's value.  The caller
4330  *                  does not need to preserve the value once the function
4331  *                  returns.
4332  *****************************************************************************/
4333 void evel_voice_quality_addl_info_add(EVENT_VOICE_QUALITY * voiceQuality, char * name, char * value);
4334
4335
4336 /*****************************************************************************/
4337 /*****************************************************************************/
4338 /*                                                                           */
4339 /*   THRESHOLD CROSSING ALERT                                                */
4340 /*                                                                           */
4341 /*****************************************************************************/
4342 /*****************************************************************************/
4343
4344 typedef enum evel_event_action {
4345           EVEL_EVENT_ACTION_CLEAR,
4346           EVEL_EVENT_ACTION_CONTINUE,
4347           EVEL_EVENT_ACTION_SET,
4348           EVEL_MAX_EVENT_ACTION
4349 }EVEL_EVENT_ACTION;
4350         
4351 typedef enum evel_alert_type {
4352          EVEL_CARD_ANOMALY, 
4353          EVEL_ELEMENT_ANOMALY, 
4354          EVEL_INTERFACE_ANOMALY, 
4355          EVEL_SERVICE_ANOMALY,
4356          EVEL_MAX_ANOMALY
4357 }EVEL_ALERT_TYPE;
4358
4359
4360 typedef struct perf_counter {
4361         char * criticality;
4362         char * name;
4363         char * thresholdCrossed;
4364         char * value;
4365 }PERF_COUNTER;
4366
4367
4368 /*****************************************************************************/
4369 /* Supported Threshold Crossing version.                                     */
4370 /*****************************************************************************/
4371 #define EVEL_THRESHOLD_CROSS_MAJOR_VERSION 2
4372 #define EVEL_THRESHOLD_CROSS_MINOR_VERSION 0
4373
4374 /**************************************************************************//**
4375  * Threshold Crossing.
4376  * JSON equivalent field: Threshold Cross Fields
4377  *****************************************************************************/
4378 typedef struct event_threshold_cross {
4379   /***************************************************************************/
4380   /* Header and version                                                      */
4381   /***************************************************************************/
4382   EVENT_HEADER header;
4383   int major_version;
4384   int minor_version;
4385
4386   /***************************************************************************/
4387   /* Mandatory fields                                                        */
4388   /***************************************************************************/
4389   PERF_COUNTER additionalParameters;
4390   EVEL_EVENT_ACTION  alertAction;
4391   char *             alertDescription; 
4392   EVEL_ALERT_TYPE    alertType;
4393   unsigned long long collectionTimestamp; 
4394   EVEL_SEVERITIES    eventSeverity;
4395   unsigned long long eventStartTimestamp;
4396
4397   /***************************************************************************/
4398   /* Optional fields                                                         */
4399   /***************************************************************************/
4400   DLIST additional_info;
4401   EVEL_OPTION_STRING    alertValue;
4402   DLIST     alertidList;
4403   EVEL_OPTION_STRING    dataCollector;
4404   EVEL_OPTION_STRING    elementType;
4405   EVEL_OPTION_STRING    interfaceName;
4406   EVEL_OPTION_STRING    networkService;
4407   EVEL_OPTION_STRING    possibleRootCause;
4408
4409 } EVENT_THRESHOLD_CROSS;
4410
4411
4412 /**************************************************************************//**
4413  * Create a new Threshold Crossing Alert event.
4414  *
4415  * @note    The mandatory fields on the TCA must be supplied to this factory
4416  *          function and are immutable once set.  Optional fields have explicit
4417  *          setter functions, but again values may only be set once so that the
4418  *          TCA has immutable properties.
4419  *
4420  * @param event_name    Unique Event Name
4421  * @param event_id    A universal identifier of the event for analysis etc
4422  * @param char* tcriticality   Performance Counter Criticality MAJ MIN,
4423  * @param char* tname          Performance Counter Threshold name
4424  * @param char* tthresholdCrossed  Counter Threshold crossed value
4425  * @param char* tvalue             Counter actual value
4426  * @param EVEL_EVENT_ACTION talertAction   Alert set continue or clear
4427  * @param char*  talertDescription
4428  * @param EVEL_ALERT_TYPE     talertType    Kind of anamoly
4429  * @param unsigned long long  tcollectionTimestamp time at which alert was collected
4430  * @param EVEL_SEVERITIES     teventSeverity  Severity of Alert
4431  * @param unsigned long long  teventStartTimestamp Time when this alert started
4432  *
4433  * @returns pointer to the newly manufactured ::EVENT_THRESHOLD_CROSS.  If the
4434  *          event is not used it must be released using
4435  *          ::evel_free_threshold_cross
4436  * @retval  NULL  Failed to create the event.
4437  *****************************************************************************/
4438 EVENT_THRESHOLD_CROSS * evel_new_threshold_cross(
4439                                 const char* ev_name, const char *ev_id,
4440                                char * tcriticality,
4441                                char * tname,
4442                                char * tthresholdCrossed,
4443                                char * tvalue,
4444                                EVEL_EVENT_ACTION  talertAction,
4445                                char *             talertDescription, 
4446                                EVEL_ALERT_TYPE    talertType,
4447                                unsigned long long tcollectionTimestamp, 
4448                                EVEL_SEVERITIES    teventSeverity,
4449                                unsigned long long teventStartTimestamp);
4450
4451 /**************************************************************************//**
4452  * Free a Threshold cross event.
4453  *
4454  * Free off the Threshold crossing event supplied.  Will free all the contained allocated
4455  * memory.
4456  *
4457  * @note It does not free the Threshold Cross itself, since that may be part of a
4458  * larger structure.
4459  *****************************************************************************/
4460 void evel_free_threshold_cross(EVENT_THRESHOLD_CROSS * const tcp);
4461
4462 /**************************************************************************//**
4463  * Set the Event Type property of the Threshold Cross.
4464  *
4465  * @note  The property is treated as immutable: it is only valid to call
4466  *        the setter once.  However, we don't assert if the caller tries to
4467  *        overwrite, just ignoring the update instead.
4468  *
4469  * @param tcp  Pointer to the ::EVENT_THRESHOLD_CROSS.
4470  * @param type          The Event Type to be set. ASCIIZ string. The caller
4471  *                      does not need to preserve the value once the function
4472  *                      returns.
4473  *****************************************************************************/
4474 void evel_threshold_cross_type_set(EVENT_THRESHOLD_CROSS * const tcp, char * type);
4475
4476 /**************************************************************************//**
4477  * Add an optional additional alertid value to Alert.
4478  *
4479  * @param alertid  Adds Alert ID
4480  *****************************************************************************/
4481 void evel_threshold_cross_alertid_add(EVENT_THRESHOLD_CROSS * const event,char *  alertid);
4482
4483   /**************************************************************************//**
4484    * Set the TCA probable Root cause.
4485    *
4486    * @param sheader     Possible root cause to Threshold
4487    *****************************************************************************/
4488   void evel_threshold_cross_possible_rootcause_set(EVENT_THRESHOLD_CROSS * const event, char *  sheader);
4489   /**************************************************************************//**
4490    * Set the TCA networking cause.
4491    *
4492    * @param sheader     Possible networking service value to Threshold
4493    *****************************************************************************/
4494   void evel_threshold_cross_networkservice_set(EVENT_THRESHOLD_CROSS * const event, char *  sheader);
4495   /**************************************************************************//**
4496    * Set the TCA Interface name.
4497    *
4498    * @param sheader     Interface name to threshold
4499    *****************************************************************************/
4500   void evel_threshold_cross_interfacename_set(EVENT_THRESHOLD_CROSS * const event,char *  sheader);
4501   /**************************************************************************//**
4502    * Set the TCA Data element type.
4503    *
4504    * @param sheader     element type of Threshold
4505    *****************************************************************************/
4506   void evel_threshold_cross_data_elementtype_set(EVENT_THRESHOLD_CROSS * const event,char *  sheader);
4507   /**************************************************************************//**
4508    * Set the TCA Data collector value.
4509    *
4510    * @param sheader     Data collector value
4511    *****************************************************************************/
4512   void evel_threshold_cross_data_collector_set(EVENT_THRESHOLD_CROSS * const event,char *  sheader);
4513   /**************************************************************************//**
4514    * Set the TCA alert value.
4515    *
4516    * @param sheader     Possible alert value
4517    *****************************************************************************/
4518   void evel_threshold_cross_alertvalue_set(EVENT_THRESHOLD_CROSS * const event,char *  sheader);
4519
4520 /**************************************************************************//**
4521  * Add an additional field name/value pair to the THRESHOLD CROSS event.
4522  *
4523  * The name and value are null delimited ASCII strings.  The library takes
4524  * a copy so the caller does not have to preserve values after the function
4525  * returns.
4526  *
4527  * @param state_change  Pointer to the ::EVENT_THRESHOLD_CROSS.
4528  * @param name          ASCIIZ string with the attribute's name.  The caller
4529  *                      does not need to preserve the value once the function
4530  *                      returns.
4531  * @param value         ASCIIZ string with the attribute's value.  The caller
4532  *                      does not need to preserve the value once the function
4533  *                      returns.
4534  *****************************************************************************/
4535 void evel_threshold_cross_addl_info_add(EVENT_THRESHOLD_CROSS * const tcp,
4536                                       const char * const name,
4537                                       const char * const value);
4538
4539 /*****************************************************************************/
4540 /*****************************************************************************/
4541 /*                                                                           */
4542 /*   LOGGING                                                                 */
4543 /*                                                                           */
4544 /*****************************************************************************/
4545 /*****************************************************************************/
4546
4547 /*****************************************************************************/
4548 /* Debug macros.                                                             */
4549 /*****************************************************************************/
4550 #define EVEL_DEBUG(FMT, ...)   log_debug(EVEL_LOG_DEBUG, (FMT), ##__VA_ARGS__)
4551 #define EVEL_INFO(FMT, ...)    log_debug(EVEL_LOG_INFO, (FMT), ##__VA_ARGS__)
4552 #define EVEL_SPAMMY(FMT, ...)  log_debug(EVEL_LOG_SPAMMY, (FMT), ##__VA_ARGS__)
4553 #define EVEL_ERROR(FMT, ...)   log_debug(EVEL_LOG_ERROR, "ERROR: " FMT, \
4554                                          ##__VA_ARGS__)
4555 #define EVEL_ENTER()                                                          \
4556         {                                                                     \
4557           log_debug(EVEL_LOG_DEBUG, "Enter %s {", __FUNCTION__);              \
4558           debug_indent += 2;                                                  \
4559         }
4560 #define EVEL_EXIT()                                                           \
4561         {                                                                     \
4562           debug_indent -= 2;                                                  \
4563           log_debug(EVEL_LOG_DEBUG, "Exit %s }", __FUNCTION__);               \
4564         }
4565
4566 #define INDENT_SEPARATORS                                                     \
4567         "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "
4568
4569 extern EVEL_LOG_LEVELS debug_level;
4570 extern int debug_indent;
4571 extern FILE * fout;
4572
4573 #define EVEL_DEBUG_ON() ((debug_level) >= EVEL_LOG_DEBUG)
4574
4575 /**************************************************************************//**
4576  * Initialize logging
4577  *
4578  * @param[in] level  The debugging level - one of ::EVEL_LOG_LEVELS.
4579  * @param[in] ident  The identifier for our logs.
4580  *****************************************************************************/
4581 void log_initialize(EVEL_LOG_LEVELS level, const char * ident);
4582
4583 /**************************************************************************//**
4584  * Log debug information
4585  *
4586  * Logs debugging information in a platform independent manner.
4587  *
4588  * @param[in] level   The debugging level - one of ::EVEL_LOG_LEVELS.
4589  * @param[in] format  Log formatting string in printf format.
4590  * @param[in] ...     Variable argument list.
4591  *****************************************************************************/
4592 void log_debug(EVEL_LOG_LEVELS level, char * format, ...);
4593
4594 /***************************************************************************//*
4595  * Store the formatted string into the static error string and log the error.
4596  *
4597  * @param format  Error string in standard printf format.
4598  * @param ...     Variable parameters to be substituted into the format string.
4599  *****************************************************************************/
4600 void log_error_state(char * format, ...);
4601
4602 #ifdef __cplusplus
4603 }
4604 #endif
4605
4606 #endif
4607