1 /*************************************************************************//**
3 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
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
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.
16 ****************************************************************************/
18 /**************************************************************************//**
20 * Header for EVEL library
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.
26 * Zero return value is success (::EVEL_SUCCESS), non-zero is failure and will
27 * be one of ::EVEL_ERR_CODES.
28 *****************************************************************************/
43 #include "double_list.h"
44 #include "hashtable.h"
46 /*****************************************************************************/
47 /* Supported API version. */
48 /*****************************************************************************/
49 #define EVEL_API_MAJOR_VERSION 5
50 #define EVEL_API_MINOR_VERSION 0
52 /**************************************************************************//**
55 * Error codes for EVEL low level interface
56 *****************************************************************************/
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. */
72 /**************************************************************************//**
75 * Variable levels of verbosity in the logging functions.
76 *****************************************************************************/
86 /*****************************************************************************/
87 /* Maximum string lengths. */
88 /*****************************************************************************/
89 #define EVEL_MAX_STRING_LEN 4096
90 #define EVEL_MAX_JSON_BODY 160000
91 #define EVEL_MAX_ERROR_STRING_LEN 255
92 #define EVEL_MAX_URL_LEN 511
94 /**************************************************************************//**
95 * This value represents there being no restriction on the reporting interval.
96 *****************************************************************************/
97 static const int EVEL_MEASUREMENT_INTERVAL_UKNOWN = 0;
99 /**************************************************************************//**
100 * How many events can be backed-up before we start dropping events on the
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
107 *****************************************************************************/
108 static const int EVEL_EVENT_BUFFER_DEPTH = 100;
110 /*****************************************************************************/
111 /* How many different IP Types-of-Service are supported. */
112 /*****************************************************************************/
113 #define EVEL_TOS_SUPPORTED 256
115 /**************************************************************************//**
116 * Event domains for the various events we support.
117 * JSON equivalent field: domain
118 *****************************************************************************/
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;
137 /**************************************************************************//**
139 * JSON equivalent field: priority
140 *****************************************************************************/
143 EVEL_PRIORITY_MEDIUM,
144 EVEL_PRIORITY_NORMAL,
147 } EVEL_EVENT_PRIORITIES;
149 /**************************************************************************//**
150 * Fault / Threshold severities.
151 * JSON equivalent field: eventSeverity
152 *****************************************************************************/
154 EVEL_SEVERITY_CRITICAL,
157 EVEL_SEVERITY_WARNING,
158 EVEL_SEVERITY_NORMAL,
162 /**************************************************************************//**
163 * Fault source types.
164 * JSON equivalent field: eventSourceType
165 *****************************************************************************/
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 */
180 /* Vendor-specific values should be added here, and handled appropriately */
181 /* in evel_event.c. */
182 /***************************************************************************/
184 /***************************************************************************/
185 /* END OF VENDOR-SPECIFIC VALUES */
186 /***************************************************************************/
187 EVEL_MAX_SOURCE_TYPES
190 /**************************************************************************//**
192 * JSON equivalent field: vfStatus
193 *****************************************************************************/
195 EVEL_VF_STATUS_ACTIVE,
197 EVEL_VF_STATUS_PREP_TERMINATE,
198 EVEL_VF_STATUS_READY_TERMINATE,
199 EVEL_VF_STATUS_REQ_TERMINATE,
203 /**************************************************************************//**
204 * Counter criticalities.
205 * JSON equivalent field: criticality
206 *****************************************************************************/
208 EVEL_COUNTER_CRITICALITY_CRIT,
209 EVEL_COUNTER_CRITICALITY_MAJ,
210 EVEL_MAX_COUNTER_CRITICALITIES
211 } EVEL_COUNTER_CRITICALITIES;
213 /**************************************************************************//**
215 * JSON equivalent field: alertAction
216 *****************************************************************************/
218 EVEL_ALERT_ACTION_CLEAR,
219 EVEL_ALERT_ACTION_CONT,
220 EVEL_ALERT_ACTION_SET,
221 EVEL_MAX_ALERT_ACTIONS
222 } EVEL_ALERT_ACTIONS;
224 /**************************************************************************//**
226 * JSON equivalent field: alertType
227 *****************************************************************************/
229 EVEL_ALERT_TYPE_CARD,
230 EVEL_ALERT_TYPE_ELEMENT,
231 EVEL_ALERT_TYPE_INTERFACE,
232 EVEL_ALERT_TYPE_SERVICE,
236 /**************************************************************************//**
238 * JSON equivalent fields: newState, oldState
239 *****************************************************************************/
241 EVEL_ENTITY_STATE_IN_SERVICE,
242 EVEL_ENTITY_STATE_MAINTENANCE,
243 EVEL_ENTITY_STATE_OUT_OF_SERVICE,
244 EVEL_MAX_ENTITY_STATES
247 /**************************************************************************//**
249 * JSON equivalent field: syslogFacility
250 *****************************************************************************/
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;
279 /**************************************************************************//**
281 * JSON equivalent fields: tcpFlagCountList, tcpFlagList
282 *****************************************************************************/
296 /**************************************************************************//**
297 * Mobile QCI Classes of Service.
298 * JSON equivalent fields: mobileQciCosCountList, mobileQciCosList
299 *****************************************************************************/
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,
310 /***************************************************************************/
311 /* LTE Classes of Service. */
312 /***************************************************************************/
326 EVEL_MAX_QCI_COS_TYPES
327 } EVEL_QCI_COS_TYPES;
329 /**************************************************************************//**
330 * Service Event endpoint description
331 * JSON equivalent field: endpointDesc
332 *****************************************************************************/
334 EVEL_SERVICE_ENDPOINT_CALLEE,
335 EVEL_SERVICE_ENDPOINT_CALLER,
336 EVEL_MAX_SERVICE_ENDPOINT_DESC
337 } EVEL_SERVICE_ENDPOINT_DESC;
339 /**************************************************************************//**
340 * Boolean type for EVEL library.
341 *****************************************************************************/
347 /**************************************************************************//**
348 * Optional parameter holder for double.
349 *****************************************************************************/
350 typedef struct evel_option_double
354 } EVEL_OPTION_DOUBLE;
356 /**************************************************************************//**
357 * Optional parameter holder for string.
358 *****************************************************************************/
359 typedef struct evel_option_string
363 } EVEL_OPTION_STRING;
365 /**************************************************************************//**
366 * Optional parameter holder for int.
367 *****************************************************************************/
368 typedef struct evel_option_int
374 /**************************************************************************//**
375 * Optional parameter holder for unsigned long long.
376 *****************************************************************************/
377 typedef struct evel_option_ull
379 unsigned long long value;
383 /**************************************************************************//**
384 * Optional parameter holder for time_t.
385 *****************************************************************************/
386 typedef struct evel_option_time
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
400 } EVEL_OPTION_INTHEADER_FIELDS;
402 /*****************************************************************************/
403 /* Supported Common Event Header version. */
404 /*****************************************************************************/
405 #define EVEL_HEADER_MAJOR_VERSION 3
406 #define EVEL_HEADER_MINOR_VERSION 0
408 #define EVEL_BATCH_MAJOR_VERSION 1
409 #define EVEL_BATCH_MINOR_VERSION 0
410 /**************************************************************************//**
412 * JSON equivalent field: commonEventHeader
413 *****************************************************************************/
414 typedef struct event_header {
415 /***************************************************************************/
417 /***************************************************************************/
421 /***************************************************************************/
422 /* Mandatory fields */
423 /***************************************************************************/
424 EVEL_EVENT_DOMAINS event_domain;
428 char * reporting_entity_name;
429 EVEL_EVENT_PRIORITIES priority;
430 unsigned long long start_epoch_microsec;
431 unsigned long long last_epoch_microsec;
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;
447 /**************************************************************************//**
448 * Initialize a newly created event header.
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);
457 /**************************************************************************//**
458 * Create a new Batch event.
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);
472 /**************************************************************************//**
473 * Add an Event into Batch Event
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
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);
484 /**************************************************************************//**
487 * Free off the Batch supplied. Will free all the contained allocated memory.
489 * @note It does not free the Batch itself, since that may be part of a
491 *****************************************************************************/
492 void evel_free_batch(EVENT_HEADER * event);
494 /*****************************************************************************/
495 /* Supported Fault version. */
496 /*****************************************************************************/
497 #define EVEL_FAULT_MAJOR_VERSION 2
498 #define EVEL_FAULT_MINOR_VERSION 1
500 /**************************************************************************//**
502 * JSON equivalent field: faultFields
503 *****************************************************************************/
504 typedef struct event_fault {
505 /***************************************************************************/
506 /* Header and version */
507 /***************************************************************************/
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;
521 /***************************************************************************/
522 /* Optional fields */
523 /***************************************************************************/
524 EVEL_OPTION_STRING category;
525 EVEL_OPTION_STRING alarm_interface_a;
526 DLIST additional_info;
530 /**************************************************************************//**
531 * Fault Additional Info.
532 * JSON equivalent field: alarmAdditionalInformation
533 *****************************************************************************/
534 typedef struct fault_additional_info {
540 /**************************************************************************//**
541 * optional field block for fields specific to heartbeat events
542 *****************************************************************************/
543 typedef struct event_heartbeat_fields
545 /***************************************************************************/
546 /* Header and version */
547 /***************************************************************************/
552 /***************************************************************************/
553 /* Mandatory fields */
554 /***************************************************************************/
555 double heartbeat_version;
556 int heartbeat_interval;
558 /***************************************************************************/
559 /* Optional fields */
560 /***************************************************************************/
561 DLIST additional_info;
563 } EVENT_HEARTBEAT_FIELD;
565 /**************************************************************************//**
566 * tuple which provides the name of a key along with its value and
568 *****************************************************************************/
569 typedef struct internal_key
572 EVEL_OPTION_INT keyorder;
573 EVEL_OPTION_STRING keyvalue;
576 /**************************************************************************//**
577 * meta-information about an instance of a jsonObject along with
578 * the actual object instance
579 *****************************************************************************/
580 typedef struct json_object_instance
584 unsigned long long objinst_epoch_microsec;
585 DLIST object_keys; /*EVEL_INTERNAL_KEY list */
587 } EVEL_JSON_OBJECT_INSTANCE;
588 #define MAX_JSON_TOKENS 128
589 /**************************************************************************//**
590 * Create a new json object instance.
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.
605 * Free off the json object instance supplied.
606 * Will free all the contained allocated memory.
608 *****************************************************************************/
609 void evel_free_jsonobjinst(EVEL_JSON_OBJECT_INSTANCE * objinst);
611 /**************************************************************************//**
612 * enrichment fields for internal VES Event Listener service use only,
613 * not supplied by event sources
614 *****************************************************************************/
615 typedef struct json_object
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 */
627 /**************************************************************************//**
628 * Create a new json object.
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.
643 * Free off the json object instance supplied.
644 * Will free all the contained allocated memory.
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
654 /**************************************************************************//**
656 * JSON equivalent field: errors
657 *****************************************************************************/
658 typedef struct measurement_errors {
659 int receive_discards;
661 int transmit_discards;
663 } MEASUREMENT_ERRORS;
665 /**************************************************************************//**
667 * JSON equivalent field: measurementsForVfScalingFields
668 *****************************************************************************/
669 typedef struct event_measurement {
670 /***************************************************************************/
671 /* Header and version */
672 /***************************************************************************/
677 /***************************************************************************/
678 /* Mandatory fields */
679 /***************************************************************************/
680 double measurement_interval;
682 /***************************************************************************/
683 /* Optional fields */
684 /***************************************************************************/
685 DLIST additional_info;
686 DLIST additional_measurements;
687 DLIST additional_objects;
689 EVEL_OPTION_INT concurrent_sessions;
690 EVEL_OPTION_INT configured_entities;
693 MEASUREMENT_ERRORS * errors;
695 DLIST filesystem_usage;
696 DLIST latency_distribution;
697 EVEL_OPTION_DOUBLE mean_request_latency;
699 EVEL_OPTION_INT media_ports_in_use;
700 EVEL_OPTION_INT request_rate;
701 EVEL_OPTION_INT vnfc_scaling_metric;
706 /**************************************************************************//**
708 * JSON equivalent field: cpuUsage
709 *****************************************************************************/
710 typedef struct measurement_cpu_use {
713 EVEL_OPTION_DOUBLE idle;
714 EVEL_OPTION_DOUBLE intrpt;
715 EVEL_OPTION_DOUBLE nice;
716 EVEL_OPTION_DOUBLE softirq;
717 EVEL_OPTION_DOUBLE steal;
718 EVEL_OPTION_DOUBLE sys;
719 EVEL_OPTION_DOUBLE user;
720 EVEL_OPTION_DOUBLE wait;
721 } MEASUREMENT_CPU_USE;
724 /**************************************************************************//**
726 * JSON equivalent field: diskUsage
727 *****************************************************************************/
728 typedef struct measurement_disk_use {
730 EVEL_OPTION_DOUBLE iotimeavg;
731 EVEL_OPTION_DOUBLE iotimelast;
732 EVEL_OPTION_DOUBLE iotimemax;
733 EVEL_OPTION_DOUBLE iotimemin;
734 EVEL_OPTION_DOUBLE mergereadavg;
735 EVEL_OPTION_DOUBLE mergereadlast;
736 EVEL_OPTION_DOUBLE mergereadmax;
737 EVEL_OPTION_DOUBLE mergereadmin;
738 EVEL_OPTION_DOUBLE mergewriteavg;
739 EVEL_OPTION_DOUBLE mergewritelast;
740 EVEL_OPTION_DOUBLE mergewritemax;
741 EVEL_OPTION_DOUBLE mergewritemin;
742 EVEL_OPTION_DOUBLE octetsreadavg;
743 EVEL_OPTION_DOUBLE octetsreadlast;
744 EVEL_OPTION_DOUBLE octetsreadmax;
745 EVEL_OPTION_DOUBLE octetsreadmin;
746 EVEL_OPTION_DOUBLE octetswriteavg;
747 EVEL_OPTION_DOUBLE octetswritelast;
748 EVEL_OPTION_DOUBLE octetswritemax;
749 EVEL_OPTION_DOUBLE octetswritemin;
750 EVEL_OPTION_DOUBLE opsreadavg;
751 EVEL_OPTION_DOUBLE opsreadlast;
752 EVEL_OPTION_DOUBLE opsreadmax;
753 EVEL_OPTION_DOUBLE opsreadmin;
754 EVEL_OPTION_DOUBLE opswriteavg;
755 EVEL_OPTION_DOUBLE opswritelast;
756 EVEL_OPTION_DOUBLE opswritemax;
757 EVEL_OPTION_DOUBLE opswritemin;
758 EVEL_OPTION_DOUBLE pendingopsavg;
759 EVEL_OPTION_DOUBLE pendingopslast;
760 EVEL_OPTION_DOUBLE pendingopsmax;
761 EVEL_OPTION_DOUBLE pendingopsmin;
762 EVEL_OPTION_DOUBLE timereadavg;
763 EVEL_OPTION_DOUBLE timereadlast;
764 EVEL_OPTION_DOUBLE timereadmax;
765 EVEL_OPTION_DOUBLE timereadmin;
766 EVEL_OPTION_DOUBLE timewriteavg;
767 EVEL_OPTION_DOUBLE timewritelast;
768 EVEL_OPTION_DOUBLE timewritemax;
769 EVEL_OPTION_DOUBLE timewritemin;
771 } MEASUREMENT_DISK_USE;
773 /**************************************************************************//**
774 * Add an additional Disk usage value name/value pair to the Measurement.
776 * The name and value are null delimited ASCII strings. The library takes
777 * a copy so the caller does not have to preserve values after the function
780 * @param measurement Pointer to the measurement.
781 * @param id ASCIIZ string with the CPU's identifier.
782 * @param usage Disk utilization.
783 *****************************************************************************/
784 MEASUREMENT_DISK_USE * evel_measurement_new_disk_use_add(EVENT_MEASUREMENT * measurement, char * id);
786 /**************************************************************************//**
788 * JSON equivalent field: filesystemUsage
789 *****************************************************************************/
790 typedef struct measurement_fsys_use {
791 char * filesystem_name;
792 double block_configured;
795 double ephemeral_configured;
796 double ephemeral_iops;
797 double ephemeral_used;
798 } MEASUREMENT_FSYS_USE;
800 /**************************************************************************//**
802 * JSON equivalent field: memoryUsage
803 *****************************************************************************/
804 typedef struct measurement_mem_use {
808 EVEL_OPTION_DOUBLE memcache;
809 EVEL_OPTION_DOUBLE memconfig;
810 EVEL_OPTION_DOUBLE memfree;
811 EVEL_OPTION_DOUBLE slabrecl;
812 EVEL_OPTION_DOUBLE slabunrecl;
813 EVEL_OPTION_DOUBLE memused;
814 } MEASUREMENT_MEM_USE;
816 /**************************************************************************//**
817 * Add an additional Memory usage value name/value pair to the Measurement.
819 * The name and value are null delimited ASCII strings. The library takes
820 * a copy so the caller does not have to preserve values after the function
823 * @param measurement Pointer to the measurement.
824 * @param id ASCIIZ string with the Memory identifier.
825 * @param vmidentifier ASCIIZ string with the VM's identifier.
826 * @param membuffsz Memory Size.
828 * @return Returns pointer to memory use structure in measurements
829 *****************************************************************************/
830 MEASUREMENT_MEM_USE * evel_measurement_new_mem_use_add(EVENT_MEASUREMENT * measurement,
831 char * id, char *vmidentifier, double membuffsz);
833 /**************************************************************************//**
834 * Set kilobytes of memory used for cache
836 * @note The property is treated as immutable: it is only valid to call
837 * the setter once. However, we don't assert if the caller tries to
838 * overwrite, just ignoring the update instead.
840 * @param mem_use Pointer to the Memory Use.
842 *****************************************************************************/
843 void evel_measurement_mem_use_memcache_set(MEASUREMENT_MEM_USE * const mem_use,
845 /**************************************************************************//**
846 * Set kilobytes of memory configured in the virtual machine on which the VNFC reporting
848 * @note The property is treated as immutable: it is only valid to call
849 * the setter once. However, we don't assert if the caller tries to
850 * overwrite, just ignoring the update instead.
852 * @param mem_use Pointer to the Memory Use.
854 *****************************************************************************/
855 void evel_measurement_mem_use_memconfig_set(MEASUREMENT_MEM_USE * const mem_use,
857 /**************************************************************************//**
858 * Set kilobytes of physical RAM left unused by the system
860 * @note The property is treated as immutable: it is only valid to call
861 * the setter once. However, we don't assert if the caller tries to
862 * overwrite, just ignoring the update instead.
864 * @param mem_use Pointer to the Memory Use.
866 *****************************************************************************/
867 void evel_measurement_mem_use_memfree_set(MEASUREMENT_MEM_USE * const mem_use,
869 /**************************************************************************//**
870 * Set the part of the slab that can be reclaimed such as caches measured in kilobytes
872 * @note The property is treated as immutable: it is only valid to call
873 * the setter once. However, we don't assert if the caller tries to
874 * overwrite, just ignoring the update instead.
876 * @param mem_use Pointer to the Memory Use.
878 *****************************************************************************/
879 void evel_measurement_mem_use_slab_reclaimed_set(MEASUREMENT_MEM_USE * const mem_use,
881 /**************************************************************************//**
882 * Set the part of the slab that cannot be reclaimed such as caches measured in kilobytes
884 * @note The property is treated as immutable: it is only valid to call
885 * the setter once. However, we don't assert if the caller tries to
886 * overwrite, just ignoring the update instead.
888 * @param mem_use Pointer to the Memory Use.
890 *****************************************************************************/
891 void evel_measurement_mem_use_slab_unreclaimable_set(MEASUREMENT_MEM_USE * const mem_use,
893 /**************************************************************************//**
894 * Set the total memory minus the sum of free, buffered, cached and slab memory in kilobytes
896 * @note The property is treated as immutable: it is only valid to call
897 * the setter once. However, we don't assert if the caller tries to
898 * overwrite, just ignoring the update instead.
900 * @param mem_use Pointer to the Memory Use.
902 *****************************************************************************/
903 void evel_measurement_mem_use_usedup_set(MEASUREMENT_MEM_USE * const mem_use,
905 /**************************************************************************//**
907 * JSON equivalent field: latencyBucketMeasure
908 *****************************************************************************/
909 typedef struct measurement_latency_bucket {
912 /***************************************************************************/
913 /* Optional fields */
914 /***************************************************************************/
915 EVEL_OPTION_DOUBLE high_end;
916 EVEL_OPTION_DOUBLE low_end;
918 } MEASUREMENT_LATENCY_BUCKET;
920 /**************************************************************************//**
922 * JSON equivalent field: vNicUsage
923 *****************************************************************************/
924 typedef struct measurement_vnic_performance {
925 /***************************************************************************/
926 /* Optional fields */
927 /***************************************************************************/
928 /*Cumulative count of broadcast packets received as read at the end of
929 the measurement interval*/
930 EVEL_OPTION_DOUBLE recvd_bcast_packets_acc;
931 /*Count of broadcast packets received within the measurement interval*/
932 EVEL_OPTION_DOUBLE recvd_bcast_packets_delta;
933 /*Cumulative count of discarded packets received as read at the end of
934 the measurement interval*/
935 EVEL_OPTION_DOUBLE recvd_discarded_packets_acc;
936 /*Count of discarded packets received within the measurement interval*/
937 EVEL_OPTION_DOUBLE recvd_discarded_packets_delta;
938 /*Cumulative count of error packets received as read at the end of
939 the measurement interval*/
940 EVEL_OPTION_DOUBLE recvd_error_packets_acc;
941 /*Count of error packets received within the measurement interval*/
942 EVEL_OPTION_DOUBLE recvd_error_packets_delta;
943 /*Cumulative count of multicast packets received as read at the end of
944 the measurement interval*/
945 EVEL_OPTION_DOUBLE recvd_mcast_packets_acc;
946 /*Count of mcast packets received within the measurement interval*/
947 EVEL_OPTION_DOUBLE recvd_mcast_packets_delta;
948 /*Cumulative count of octets received as read at the end of
949 the measurement interval*/
950 EVEL_OPTION_DOUBLE recvd_octets_acc;
951 /*Count of octets received within the measurement interval*/
952 EVEL_OPTION_DOUBLE recvd_octets_delta;
953 /*Cumulative count of all packets received as read at the end of
954 the measurement interval*/
955 EVEL_OPTION_DOUBLE recvd_total_packets_acc;
956 /*Count of all packets received within the measurement interval*/
957 EVEL_OPTION_DOUBLE recvd_total_packets_delta;
958 /*Cumulative count of unicast packets received as read at the end of
959 the measurement interval*/
960 EVEL_OPTION_DOUBLE recvd_ucast_packets_acc;
961 /*Count of unicast packets received within the measurement interval*/
962 EVEL_OPTION_DOUBLE recvd_ucast_packets_delta;
963 /*Cumulative count of transmitted broadcast packets at the end of
964 the measurement interval*/
965 EVEL_OPTION_DOUBLE tx_bcast_packets_acc;
966 /*Count of transmitted broadcast packets within the measurement interval*/
967 EVEL_OPTION_DOUBLE tx_bcast_packets_delta;
968 /*Cumulative count of transmit discarded packets at the end of
969 the measurement interval*/
970 EVEL_OPTION_DOUBLE tx_discarded_packets_acc;
971 /*Count of transmit discarded packets within the measurement interval*/
972 EVEL_OPTION_DOUBLE tx_discarded_packets_delta;
973 /*Cumulative count of transmit error packets at the end of
974 the measurement interval*/
975 EVEL_OPTION_DOUBLE tx_error_packets_acc;
976 /*Count of transmit error packets within the measurement interval*/
977 EVEL_OPTION_DOUBLE tx_error_packets_delta;
978 /*Cumulative count of transmit multicast packets at the end of
979 the measurement interval*/
980 EVEL_OPTION_DOUBLE tx_mcast_packets_acc;
981 /*Count of transmit multicast packets within the measurement interval*/
982 EVEL_OPTION_DOUBLE tx_mcast_packets_delta;
983 /*Cumulative count of transmit octets at the end of
984 the measurement interval*/
985 EVEL_OPTION_DOUBLE tx_octets_acc;
986 /*Count of transmit octets received within the measurement interval*/
987 EVEL_OPTION_DOUBLE tx_octets_delta;
988 /*Cumulative count of all transmit packets at the end of
989 the measurement interval*/
990 EVEL_OPTION_DOUBLE tx_total_packets_acc;
991 /*Count of transmit packets within the measurement interval*/
992 EVEL_OPTION_DOUBLE tx_total_packets_delta;
993 /*Cumulative count of all transmit unicast packets at the end of
994 the measurement interval*/
995 EVEL_OPTION_DOUBLE tx_ucast_packets_acc;
996 /*Count of transmit unicast packets within the measurement interval*/
997 EVEL_OPTION_DOUBLE tx_ucast_packets_delta;
998 /* Indicates whether vNicPerformance values are likely inaccurate
999 due to counter overflow or other condtions*/
1000 char *valuesaresuspect;
1003 } MEASUREMENT_VNIC_PERFORMANCE;
1005 /**************************************************************************//**
1007 * JSON equivalent field: codecsInUse
1008 *****************************************************************************/
1009 typedef struct measurement_codec_use {
1012 } MEASUREMENT_CODEC_USE;
1014 /**************************************************************************//**
1016 * JSON equivalent field: featuresInUse
1017 *****************************************************************************/
1018 typedef struct measurement_feature_use {
1020 int feature_utilization;
1021 } MEASUREMENT_FEATURE_USE;
1023 /**************************************************************************//**
1024 * Measurement Group.
1025 * JSON equivalent field: additionalMeasurements
1026 *****************************************************************************/
1027 typedef struct measurement_group {
1030 } MEASUREMENT_GROUP;
1032 /**************************************************************************//**
1033 * Custom Defined Measurement.
1034 * JSON equivalent field: measurements
1035 *****************************************************************************/
1036 typedef struct custom_measurement {
1039 } CUSTOM_MEASUREMENT;
1041 /*****************************************************************************/
1042 /* Supported Report version. */
1043 /*****************************************************************************/
1044 #define EVEL_REPORT_MAJOR_VERSION 1
1045 #define EVEL_REPORT_MINOR_VERSION 1
1047 /**************************************************************************//**
1049 * JSON equivalent field: measurementsForVfReportingFields
1051 * @note This is an experimental event type and is not currently a formal part
1052 * of AT&T's specification.
1053 *****************************************************************************/
1054 typedef struct event_report {
1055 /***************************************************************************/
1056 /* Header and version */
1057 /***************************************************************************/
1058 EVENT_HEADER header;
1062 /***************************************************************************/
1063 /* Mandatory fields */
1064 /***************************************************************************/
1065 double measurement_interval;
1067 /***************************************************************************/
1068 /* Optional fields */
1069 /***************************************************************************/
1070 DLIST feature_usage;
1071 DLIST measurement_groups;
1075 /**************************************************************************//**
1076 * Mobile GTP Per Flow Metrics.
1077 * JSON equivalent field: gtpPerFlowMetrics
1078 *****************************************************************************/
1079 typedef struct mobile_gtp_per_flow_metrics {
1080 double avg_bit_error_rate;
1081 double avg_packet_delay_variation;
1082 int avg_packet_latency;
1083 int avg_receive_throughput;
1084 int avg_transmit_throughput;
1085 int flow_activation_epoch;
1086 int flow_activation_microsec;
1087 int flow_deactivation_epoch;
1088 int flow_deactivation_microsec;
1089 time_t flow_deactivation_time;
1091 int max_packet_delay_variation;
1092 int num_activation_failures;
1094 int num_bytes_received;
1095 int num_bytes_transmitted;
1096 int num_dropped_packets;
1097 int num_l7_bytes_received;
1098 int num_l7_bytes_transmitted;
1099 int num_lost_packets;
1100 int num_out_of_order_packets;
1101 int num_packet_errors;
1102 int num_packets_received_excl_retrans;
1103 int num_packets_received_incl_retrans;
1104 int num_packets_transmitted_incl_retrans;
1107 int num_tunneled_l7_bytes_received;
1108 int round_trip_time;
1109 int time_to_first_byte;
1111 /***************************************************************************/
1112 /* Optional fields */
1113 /***************************************************************************/
1114 EVEL_OPTION_INT ip_tos_counts[EVEL_TOS_SUPPORTED];
1115 EVEL_OPTION_INT tcp_flag_counts[EVEL_MAX_TCP_FLAGS];
1116 EVEL_OPTION_INT qci_cos_counts[EVEL_MAX_QCI_COS_TYPES];
1117 EVEL_OPTION_INT dur_connection_failed_status;
1118 EVEL_OPTION_INT dur_tunnel_failed_status;
1119 EVEL_OPTION_STRING flow_activated_by;
1120 EVEL_OPTION_TIME flow_activation_time;
1121 EVEL_OPTION_STRING flow_deactivated_by;
1122 EVEL_OPTION_STRING gtp_connection_status;
1123 EVEL_OPTION_STRING gtp_tunnel_status;
1124 EVEL_OPTION_INT large_packet_rtt;
1125 EVEL_OPTION_DOUBLE large_packet_threshold;
1126 EVEL_OPTION_INT max_receive_bit_rate;
1127 EVEL_OPTION_INT max_transmit_bit_rate;
1128 EVEL_OPTION_INT num_gtp_echo_failures;
1129 EVEL_OPTION_INT num_gtp_tunnel_errors;
1130 EVEL_OPTION_INT num_http_errors;
1132 } MOBILE_GTP_PER_FLOW_METRICS;
1134 /*****************************************************************************/
1135 /* Supported Mobile Flow version. */
1136 /*****************************************************************************/
1137 #define EVEL_MOBILE_FLOW_MAJOR_VERSION 2
1138 #define EVEL_MOBILE_FLOW_MINOR_VERSION 0
1140 /**************************************************************************//**
1142 * JSON equivalent field: mobileFlow
1143 *****************************************************************************/
1144 typedef struct event_mobile_flow {
1145 /***************************************************************************/
1146 /* Header and version */
1147 /***************************************************************************/
1148 EVENT_HEADER header;
1152 /***************************************************************************/
1153 /* Mandatory fields */
1154 /***************************************************************************/
1155 char * flow_direction;
1156 MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics;
1157 char * ip_protocol_type;
1159 char * other_endpoint_ip_address;
1160 int other_endpoint_port;
1161 char * reporting_endpoint_ip_addr;
1162 int reporting_endpoint_port;
1163 DLIST additional_info; /* JSON: additionalFields */
1165 /***************************************************************************/
1166 /* Optional fields */
1167 /***************************************************************************/
1168 EVEL_OPTION_STRING application_type;
1169 EVEL_OPTION_STRING app_protocol_type;
1170 EVEL_OPTION_STRING app_protocol_version;
1171 EVEL_OPTION_STRING cid;
1172 EVEL_OPTION_STRING connection_type;
1173 EVEL_OPTION_STRING ecgi;
1174 EVEL_OPTION_STRING gtp_protocol_type;
1175 EVEL_OPTION_STRING gtp_version;
1176 EVEL_OPTION_STRING http_header;
1177 EVEL_OPTION_STRING imei;
1178 EVEL_OPTION_STRING imsi;
1179 EVEL_OPTION_STRING lac;
1180 EVEL_OPTION_STRING mcc;
1181 EVEL_OPTION_STRING mnc;
1182 EVEL_OPTION_STRING msisdn;
1183 EVEL_OPTION_STRING other_functional_role;
1184 EVEL_OPTION_STRING rac;
1185 EVEL_OPTION_STRING radio_access_technology;
1186 EVEL_OPTION_STRING sac;
1187 EVEL_OPTION_INT sampling_algorithm;
1188 EVEL_OPTION_STRING tac;
1189 EVEL_OPTION_STRING tunnel_id;
1190 EVEL_OPTION_STRING vlan_id;
1192 } EVENT_MOBILE_FLOW;
1194 /*****************************************************************************/
1195 /* Supported Other field version. */
1196 /*****************************************************************************/
1197 #define EVEL_OTHER_EVENT_MAJOR_VERSION 1
1198 #define EVEL_OTHER_EVENT_MINOR_VERSION 1
1200 /**************************************************************************//**
1202 * JSON equivalent field: otherFields
1203 *****************************************************************************/
1204 typedef struct event_other {
1205 EVENT_HEADER header;
1209 HASHTABLE_T *namedarrays; /* HASHTABLE_T */
1210 DLIST jsonobjects; /* DLIST of EVEL_JSON_OBJECT */
1214 /**************************************************************************//**
1216 * JSON equivalent field: otherFields
1217 *****************************************************************************/
1218 typedef struct other_field {
1224 /*****************************************************************************/
1225 /* Supported Service Events version. */
1226 /*****************************************************************************/
1227 #define EVEL_HEARTBEAT_FIELD_MAJOR_VERSION 1
1228 #define EVEL_HEARTBEAT_FIELD_MINOR_VERSION 1
1231 /*****************************************************************************/
1232 /* Supported Signaling version. */
1233 /*****************************************************************************/
1234 #define EVEL_SIGNALING_MAJOR_VERSION 1
1235 #define EVEL_SIGNALING_MINOR_VERSION 0
1237 /**************************************************************************//**
1238 * Vendor VNF Name fields.
1239 * JSON equivalent field: vendorVnfNameFields
1240 *****************************************************************************/
1241 typedef struct vendor_vnfname_field {
1243 EVEL_OPTION_STRING vfmodule;
1244 EVEL_OPTION_STRING vnfname;
1245 } VENDOR_VNFNAME_FIELD;
1247 /**************************************************************************//**
1249 * JSON equivalent field: signalingFields
1250 *****************************************************************************/
1251 typedef struct event_signaling {
1252 /***************************************************************************/
1253 /* Header and version */
1254 /***************************************************************************/
1255 EVENT_HEADER header;
1259 /***************************************************************************/
1260 /* Mandatory fields */
1261 /***************************************************************************/
1262 VENDOR_VNFNAME_FIELD vnfname_field;
1263 EVEL_OPTION_STRING correlator; /* JSON: correlator */
1264 EVEL_OPTION_STRING local_ip_address; /* JSON: localIpAddress */
1265 EVEL_OPTION_STRING local_port; /* JSON: localPort */
1266 EVEL_OPTION_STRING remote_ip_address; /* JSON: remoteIpAddress */
1267 EVEL_OPTION_STRING remote_port; /* JSON: remotePort */
1269 /***************************************************************************/
1270 /* Optional fields */
1271 /***************************************************************************/
1272 EVEL_OPTION_STRING compressed_sip; /* JSON: compressedSip */
1273 EVEL_OPTION_STRING summary_sip; /* JSON: summarySip */
1274 DLIST additional_info;
1278 /**************************************************************************//**
1279 * Sgnaling Additional Field.
1280 * JSON equivalent field: additionalFields
1281 *****************************************************************************/
1282 typedef struct signaling_additional_field {
1285 } SIGNALING_ADDL_FIELD;
1287 /*****************************************************************************/
1288 /* Supported State Change version. */
1289 /*****************************************************************************/
1290 #define EVEL_STATE_CHANGE_MAJOR_VERSION 1
1291 #define EVEL_STATE_CHANGE_MINOR_VERSION 2
1293 /**************************************************************************//**
1295 * JSON equivalent field: stateChangeFields
1296 *****************************************************************************/
1297 typedef struct event_state_change {
1298 /***************************************************************************/
1299 /* Header and version */
1300 /***************************************************************************/
1301 EVENT_HEADER header;
1305 /***************************************************************************/
1306 /* Mandatory fields */
1307 /***************************************************************************/
1308 EVEL_ENTITY_STATE new_state;
1309 EVEL_ENTITY_STATE old_state;
1310 char * state_interface;
1313 /***************************************************************************/
1314 /* Optional fields */
1315 /***************************************************************************/
1316 DLIST additional_fields;
1318 } EVENT_STATE_CHANGE;
1320 /**************************************************************************//**
1321 * State Change Additional Field.
1322 * JSON equivalent field: additionalFields
1323 *****************************************************************************/
1324 typedef struct state_change_additional_field {
1327 } STATE_CHANGE_ADDL_FIELD;
1329 /*****************************************************************************/
1330 /* Supported Syslog version. */
1331 /*****************************************************************************/
1332 #define EVEL_SYSLOG_MAJOR_VERSION 3
1333 #define EVEL_SYSLOG_MINOR_VERSION 0
1335 /**************************************************************************//**
1337 * JSON equivalent field: syslogFields
1338 *****************************************************************************/
1339 typedef struct event_syslog {
1340 /***************************************************************************/
1341 /* Header and version */
1342 /***************************************************************************/
1343 EVENT_HEADER header;
1347 /***************************************************************************/
1348 /* Mandatory fields */
1349 /***************************************************************************/
1350 EVEL_SOURCE_TYPES event_source_type;
1354 /***************************************************************************/
1355 /* Optional fields */
1356 /***************************************************************************/
1357 EVEL_OPTION_STRING additional_filters;
1358 EVEL_OPTION_STRING event_source_host;
1359 EVEL_OPTION_INT syslog_facility;
1360 EVEL_OPTION_INT syslog_priority;
1361 EVEL_OPTION_STRING syslog_proc;
1362 EVEL_OPTION_INT syslog_proc_id;
1363 EVEL_OPTION_STRING syslog_s_data;
1364 EVEL_OPTION_STRING syslog_sdid;
1365 EVEL_OPTION_STRING syslog_severity;
1367 EVEL_OPTION_INT syslog_ver;
1371 /**************************************************************************//**
1373 * JSON equivalent object: attCopyrightNotice
1374 *****************************************************************************/
1375 typedef struct copyright {
1376 char * useAndRedistribution;
1381 char * disclaimerLine1;
1382 char * disclaimerLine2;
1383 char * disclaimerLine3;
1384 char * disclaimerLine4;
1387 /**************************************************************************//**
1388 * Library initialization.
1390 * Initialize the EVEL library.
1392 * @note This function initializes the cURL library. Applications making use
1393 * of libcurl may need to pull the initialization out of here. Note
1394 * also that this function is not threadsafe as a result - refer to
1395 * libcurl's API documentation for relevant warnings.
1397 * @sa Matching Term function.
1399 * @param fqdn The API's FQDN or IP address.
1400 * @param port The API's port.
1401 * @param path The optional path (may be NULL).
1402 * @param topic The optional topic part of the URL (may be NULL).
1403 * @param secure Whether to use HTTPS (0=HTTP, 1=HTTPS).
1404 * @param username Username for Basic Authentication of requests.
1405 * @param password Password for Basic Authentication of requests.
1406 * @param source_type The kind of node we represent.
1407 * @param role The role this node undertakes.
1408 * @param verbosity 0 for normal operation, positive values for chattier
1411 * @returns Status code
1412 * @retval EVEL_SUCCESS On success
1413 * @retval ::EVEL_ERR_CODES On failure.
1414 *****************************************************************************/
1415 EVEL_ERR_CODES evel_initialize(const char * const fqdn,
1417 const char * const path,
1418 const char * const topic,
1420 const char * const username,
1421 const char * const password,
1422 EVEL_SOURCE_TYPES source_type,
1423 const char * const role,
1427 /**************************************************************************//**
1428 * Clean up the EVEL library.
1430 * @note that at present don't expect Init/Term cycling not to leak memory!
1432 * @returns Status code
1433 * @retval EVEL_SUCCESS On success
1434 * @retval "One of ::EVEL_ERR_CODES" On failure.
1435 *****************************************************************************/
1436 EVEL_ERR_CODES evel_terminate(void);
1438 EVEL_ERR_CODES evel_post_event(EVENT_HEADER * event);
1439 const char * evel_error_string(void);
1442 /**************************************************************************//**
1445 * Free off the event supplied. Will free all the contained allocated memory.
1447 * @note It is safe to free a NULL pointer.
1448 *****************************************************************************/
1449 void evel_free_event(void * event);
1451 /**************************************************************************//**
1452 * Encode the event as a JSON event object according to AT&T's schema.
1454 * @param json Pointer to where to store the JSON encoded data.
1455 * @param mode Event mode or Batch mode
1456 * @param max_size Size of storage available in json_body.
1457 * @param event Pointer to the ::EVENT_HEADER to encode.
1458 * @returns Number of bytes actually written.
1459 *****************************************************************************/
1460 int evel_json_encode_event(char * json,
1462 EVENT_HEADER * event);
1463 int evel_json_encode_batch_event(char * json,
1465 EVENT_HEADER * event);
1466 /**************************************************************************//**
1467 * Initialize an event instance id.
1469 * @param vfield Pointer to the event vnfname field being initialized.
1470 * @param vendor_id The vendor id to encode in the event instance id.
1471 * @param event_id The event id to encode in the event instance id.
1472 *****************************************************************************/
1473 void evel_init_vendor_field(VENDOR_VNFNAME_FIELD * const vfield,
1474 const char * const vendor_name);
1476 /**************************************************************************//**
1477 * Set the Vendor module property of the Vendor.
1479 * @note The property is treated as immutable: it is only valid to call
1480 * the setter once. However, we don't assert if the caller tries to
1481 * overwrite, just ignoring the update instead.
1483 * @param vfield Pointer to the Vendor field.
1484 * @param module_name The module name to be set. ASCIIZ string. The caller
1485 * does not need to preserve the value once the function
1487 *****************************************************************************/
1488 void evel_vendor_field_module_set(VENDOR_VNFNAME_FIELD * const vfield,
1489 const char * const module_name);
1490 /**************************************************************************//**
1491 * Set the Vendor module property of the Vendor.
1493 * @note The property is treated as immutable: it is only valid to call
1494 * the setter once. However, we don't assert if the caller tries to
1495 * overwrite, just ignoring the update instead.
1497 * @param vfield Pointer to the Vendor field.
1498 * @param module_name The module name to be set. ASCIIZ string. The caller
1499 * does not need to preserve the value once the function
1501 *****************************************************************************/
1502 void evel_vendor_field_vnfname_set(VENDOR_VNFNAME_FIELD * const vfield,
1503 const char * const vnfname);
1504 /**************************************************************************//**
1505 * Free an event instance id.
1507 * @param vfield Pointer to the event vnfname_field being freed.
1508 *****************************************************************************/
1509 void evel_free_event_vendor_field(VENDOR_VNFNAME_FIELD * const vfield);
1511 /**************************************************************************//**
1512 * Callback function to provide returned data.
1514 * Copy data into the supplied buffer, write_callback::ptr, checking size
1517 * @returns Number of bytes placed into write_callback::ptr. 0 for EOF.
1518 *****************************************************************************/
1519 size_t evel_write_callback(void *contents,
1524 /*****************************************************************************/
1525 /*****************************************************************************/
1527 /* HEARTBEAT - (includes common header, too) */
1529 /*****************************************************************************/
1530 /*****************************************************************************/
1532 /**************************************************************************//**
1533 * Create a new heartbeat event.
1535 * @note that the heartbeat is just a "naked" commonEventHeader!
1537 * @returns pointer to the newly manufactured ::EVENT_HEADER. If the event is
1538 * not used it must be released using ::evel_free_event
1539 * @retval NULL Failed to create the event.
1540 *****************************************************************************/
1541 EVENT_HEADER * evel_new_heartbeat(void);
1543 /**************************************************************************//**
1544 * Create a new heartbeat event of given name and type.
1546 * @note that the heartbeat is just a "naked" commonEventHeader!
1548 * @param event_name Unique Event Name: {DomainAbbreviation}_{AsdcModel or ApplicationPlatform}_{DescriptionOfInfoBeingConveyed}
1549 * @param event_id A universal identifier of the event for: troubleshooting, cross-referencing of alarms for alarm correlation, offline log analysis, etc
1551 * @returns pointer to the newly manufactured ::EVENT_HEADER. If the event is
1552 * not used it must be released using ::evel_free_event
1553 * @retval NULL Failed to create the event.
1554 *****************************************************************************/
1555 EVENT_HEADER * evel_new_heartbeat_nameid(const char* ev_name, const char *ev_id);
1558 /**************************************************************************//**
1559 * Free an event header.
1561 * Free off the event header supplied. Will free all the contained allocated
1564 * @note It does not free the header itself, since that may be part of a
1566 *****************************************************************************/
1567 void evel_free_header(EVENT_HEADER * const event);
1569 /**************************************************************************//**
1570 * Initialize a newly created event header.
1572 * @param header Pointer to the header being initialized.
1573 *****************************************************************************/
1574 void evel_init_header(EVENT_HEADER * const header,const char *const eventname);
1576 /**************************************************************************//**
1577 * Set the Event Type property of the event header.
1579 * @param header Pointer to the ::EVENT_HEADER.
1580 * @param type The Event Type to be set. ASCIIZ string. The caller
1581 * does not need to preserve the value once the function
1583 *****************************************************************************/
1584 void evel_header_type_set(EVENT_HEADER * const header,
1585 const char * const type);
1587 /**************************************************************************//**
1588 * Set the Start Epoch property of the event header.
1590 * @note The Start Epoch defaults to the time of event creation.
1592 * @param header Pointer to the ::EVENT_HEADER.
1593 * @param start_epoch_microsec
1594 * The start epoch to set, in microseconds.
1595 *****************************************************************************/
1596 void evel_start_epoch_set(EVENT_HEADER * const header,
1597 const unsigned long long start_epoch_microsec);
1599 /**************************************************************************//**
1600 * Set the Last Epoch property of the event header.
1602 * @note The Last Epoch defaults to the time of event creation.
1604 * @param header Pointer to the ::EVENT_HEADER.
1605 * @param last_epoch_microsec
1606 * The last epoch to set, in microseconds.
1607 *****************************************************************************/
1608 void evel_last_epoch_set(EVENT_HEADER * const header,
1609 const unsigned long long last_epoch_microsec);
1611 /**************************************************************************//**
1612 * Set the Reporting Entity Name property of the event header.
1614 * @note The Reporting Entity Name defaults to the OpenStack VM Name.
1616 * @param header Pointer to the ::EVENT_HEADER.
1617 * @param entity_name The entity name to set.
1618 *****************************************************************************/
1619 void evel_reporting_entity_name_set(EVENT_HEADER * const header,
1620 const char * const entity_name);
1622 /**************************************************************************//**
1623 * Set the Reporting Entity Id property of the event header.
1625 * @note The Reporting Entity Id defaults to the OpenStack VM UUID.
1627 * @param header Pointer to the ::EVENT_HEADER.
1628 * @param entity_id The entity id to set.
1629 *****************************************************************************/
1630 void evel_reporting_entity_id_set(EVENT_HEADER * const header,
1631 const char * const entity_id);
1633 /**************************************************************************//**
1634 * Set the NFC Naming code property of the event header.
1636 * @param header Pointer to the ::EVENT_HEADER.
1637 * @param nfcnamingcode String
1638 *****************************************************************************/
1639 void evel_nfcnamingcode_set(EVENT_HEADER * const header,
1640 const char * const nfcnam);
1641 /**************************************************************************//**
1642 * Set the NF Naming code property of the event header.
1644 * @param header Pointer to the ::EVENT_HEADER.
1645 * @param nfnamingcode String
1646 *****************************************************************************/
1647 void evel_nfnamingcode_set(EVENT_HEADER * const header,
1648 const char * const nfnam);
1650 /*****************************************************************************/
1651 /*****************************************************************************/
1655 /*****************************************************************************/
1656 /*****************************************************************************/
1658 /**************************************************************************//**
1659 * Create a new fault event.
1661 * @note The mandatory fields on the Fault must be supplied to this factory
1662 * function and are immutable once set. Optional fields have explicit
1663 * setter functions, but again values may only be set once so that the
1664 * Fault has immutable properties.
1665 * @param event_name Unique Event Name
1666 * @param event_id A universal identifier of the event for analysis etc
1667 * @param condition The condition indicated by the Fault.
1668 * @param specific_problem The specific problem triggering the fault.
1669 * @param priority The priority of the event.
1670 * @param severity The severity of the Fault.
1671 * @param ev_source_type Source of Alarm event
1672 * @param version fault version
1673 * @param status status of Virtual Function
1674 * @returns pointer to the newly manufactured ::EVENT_FAULT. If the event is
1675 * not used (i.e. posted) it must be released using ::evel_free_fault.
1676 * @retval NULL Failed to create the event.
1677 *****************************************************************************/
1678 EVENT_FAULT * evel_new_fault(const char* ev_name, const char *ev_id,
1679 const char * const condition,
1680 const char * const specific_problem,
1681 EVEL_EVENT_PRIORITIES priority,
1682 EVEL_SEVERITIES severity,
1683 EVEL_SOURCE_TYPES ev_source_type,
1684 EVEL_VF_STATUSES status);
1686 /**************************************************************************//**
1689 * Free off the Fault supplied. Will free all the contained allocated memory.
1691 * @note It does not free the Fault itself, since that may be part of a
1693 *****************************************************************************/
1694 void evel_free_fault(EVENT_FAULT * event);
1696 /**************************************************************************//**
1697 * Set the Fault Category property of the Fault.
1699 * @note The property is treated as immutable: it is only valid to call
1700 * the setter once. However, we don't assert if the caller tries to
1701 * overwrite, just ignoring the update instead.
1703 * @param fault Pointer to the fault.
1704 * @param category Category : license, link, routing, security, signaling.
1705 * ASCIIZ string. The caller
1706 * does not need to preserve the value once the function
1708 *****************************************************************************/
1709 void evel_fault_category_set(EVENT_FAULT * fault,
1710 const char * const category);
1712 /**************************************************************************//**
1713 * Set the Alarm Interface A property of the Fault.
1715 * @note The property is treated as immutable: it is only valid to call
1716 * the setter once. However, we don't assert if the caller tries to
1717 * overwrite, just ignoring the update instead.
1719 * @param fault Pointer to the fault.
1720 * @param interface The Alarm Interface A to be set. ASCIIZ string. The caller
1721 * does not need to preserve the value once the function
1723 *****************************************************************************/
1724 void evel_fault_interface_set(EVENT_FAULT * fault,
1725 const char * const interface);
1727 /**************************************************************************//**
1728 * Add an additional value name/value pair to the Fault.
1730 * The name and value are null delimited ASCII strings. The library takes
1731 * a copy so the caller does not have to preserve values after the function
1734 * @param fault Pointer to the fault.
1735 * @param name ASCIIZ string with the attribute's name.
1736 * @param value ASCIIZ string with the attribute's value.
1737 *****************************************************************************/
1738 void evel_fault_addl_info_add(EVENT_FAULT * fault, char * name, char * value);
1740 /**************************************************************************//**
1741 * Set the Event Type property of the Fault.
1743 * @note The property is treated as immutable: it is only valid to call
1744 * the setter once. However, we don't assert if the caller tries to
1745 * overwrite, just ignoring the update instead.
1747 * @param fault Pointer to the fault.
1748 * @param type The Event Type to be set. ASCIIZ string. The caller
1749 * does not need to preserve the value once the function
1751 *****************************************************************************/
1752 void evel_fault_type_set(EVENT_FAULT * fault, const char * const type);
1754 /*****************************************************************************/
1755 /*****************************************************************************/
1759 /*****************************************************************************/
1760 /*****************************************************************************/
1762 /**************************************************************************//**
1763 * Create a new Measurement event.
1765 * @note The mandatory fields on the Measurement must be supplied to this
1766 * factory function and are immutable once set. Optional fields have
1767 * explicit setter functions, but again values may only be set once so
1768 * that the Measurement has immutable properties.
1770 * @param measurement_interval
1771 * @param event_name Unique Event Name
1772 * @param event_id A universal identifier of the event for analysis etc
1774 * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT. If the
1775 * event is not used (i.e. posted) it must be released using
1776 * ::evel_free_event.
1777 * @retval NULL Failed to create the event.
1778 *****************************************************************************/
1779 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval,const char* ev_name, const char *ev_id);
1781 /**************************************************************************//**
1782 * Free a Measurement.
1784 * Free off the Measurement supplied. Will free all the contained allocated
1787 * @note It does not free the Measurement itself, since that may be part of a
1789 *****************************************************************************/
1790 void evel_free_measurement(EVENT_MEASUREMENT * event);
1792 /**************************************************************************//**
1793 * Set the Event Type property of the Measurement.
1795 * @note The property is treated as immutable: it is only valid to call
1796 * the setter once. However, we don't assert if the caller tries to
1797 * overwrite, just ignoring the update instead.
1799 * @param measurement Pointer to the Measurement.
1800 * @param type The Event Type to be set. ASCIIZ string. The caller
1801 * does not need to preserve the value once the function
1803 *****************************************************************************/
1804 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
1805 const char * const type);
1807 /**************************************************************************//**
1808 * Set the Concurrent Sessions property of the Measurement.
1810 * @note The property is treated as immutable: it is only valid to call
1811 * the setter once. However, we don't assert if the caller tries to
1812 * overwrite, just ignoring the update instead.
1814 * @param measurement Pointer to the Measurement.
1815 * @param concurrent_sessions The Concurrent Sessions to be set.
1816 *****************************************************************************/
1817 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
1818 int concurrent_sessions);
1820 /**************************************************************************//**
1821 * Set the Configured Entities property of the Measurement.
1823 * @note The property is treated as immutable: it is only valid to call
1824 * the setter once. However, we don't assert if the caller tries to
1825 * overwrite, just ignoring the update instead.
1827 * @param measurement Pointer to the Measurement.
1828 * @param configured_entities The Configured Entities to be set.
1829 *****************************************************************************/
1830 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
1831 int configured_entities);
1833 /**************************************************************************//**
1834 * Add an additional set of Errors to the Measurement.
1836 * @note The property is treated as immutable: it is only valid to call
1837 * the setter once. However, we don't assert if the caller tries to
1838 * overwrite, just ignoring the update instead.
1840 * @param measurement Pointer to the measurement.
1841 * @param receive_discards The number of receive discards.
1842 * @param receive_errors The number of receive errors.
1843 * @param transmit_discards The number of transmit discards.
1844 * @param transmit_errors The number of transmit errors.
1845 *****************************************************************************/
1846 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
1847 int receive_discards,
1849 int transmit_discards,
1850 int transmit_errors);
1852 /**************************************************************************//**
1853 * Set the Mean Request Latency property of the Measurement.
1855 * @note The property is treated as immutable: it is only valid to call
1856 * the setter once. However, we don't assert if the caller tries to
1857 * overwrite, just ignoring the update instead.
1859 * @param measurement Pointer to the Measurement.
1860 * @param mean_request_latency The Mean Request Latency to be set.
1861 *****************************************************************************/
1862 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
1863 double mean_request_latency);
1865 /**************************************************************************//**
1866 * Set the Request Rate property of the Measurement.
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.
1872 * @param measurement Pointer to the Measurement.
1873 * @param request_rate The Request Rate to be set.
1874 *****************************************************************************/
1875 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
1878 /**************************************************************************//**
1879 * Add an additional CPU usage value name/value pair to the Measurement.
1881 * The name and value are null delimited ASCII strings. The library takes
1882 * a copy so the caller does not have to preserve values after the function
1885 * @param measurement Pointer to the measurement.
1886 * @param id ASCIIZ string with the CPU's identifier.
1887 * @param usage CPU utilization.
1888 *****************************************************************************/
1889 MEASUREMENT_CPU_USE * evel_measurement_new_cpu_use_add(EVENT_MEASUREMENT * measurement, char * id, double usage);
1891 /**************************************************************************//**
1892 * Set the CPU Idle value in measurement interval
1893 * percentage of CPU time spent in the idle task
1895 * @note The property is treated as immutable: it is only valid to call
1896 * the setter once. However, we don't assert if the caller tries to
1897 * overwrite, just ignoring the update instead.
1899 * @param cpu_use Pointer to the CPU Use.
1901 *****************************************************************************/
1902 void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE *const cpu_use,
1905 /**************************************************************************//**
1906 * Set the percentage of time spent servicing interrupts
1908 * @note The property is treated as immutable: it is only valid to call
1909 * the setter once. However, we don't assert if the caller tries to
1910 * overwrite, just ignoring the update instead.
1912 * @param cpu_use Pointer to the CPU Use.
1914 *****************************************************************************/
1915 void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE * const cpu_use,
1918 /**************************************************************************//**
1919 * Set the percentage of time spent running user space processes that have been niced
1921 * @note The property is treated as immutable: it is only valid to call
1922 * the setter once. However, we don't assert if the caller tries to
1923 * overwrite, just ignoring the update instead.
1925 * @param cpu_use Pointer to the CPU Use.
1927 *****************************************************************************/
1928 void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE * const cpu_use,
1931 /**************************************************************************//**
1932 * Set the percentage of time spent handling soft irq interrupts
1934 * @note The property is treated as immutable: it is only valid to call
1935 * the setter once. However, we don't assert if the caller tries to
1936 * overwrite, just ignoring the update instead.
1938 * @param cpu_use Pointer to the CPU Use.
1940 *****************************************************************************/
1941 void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE * const cpu_use,
1943 /**************************************************************************//**
1944 * Set the percentage of time spent in involuntary wait
1946 * @note The property is treated as immutable: it is only valid to call
1947 * the setter once. However, we don't assert if the caller tries to
1948 * overwrite, just ignoring the update instead.
1950 * @param cpu_use Pointer to the CPU Use.
1952 *****************************************************************************/
1953 void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE * const cpu_use,
1955 /**************************************************************************//**
1956 * Set the percentage of time spent on system tasks running the kernel
1958 * @note The property is treated as immutable: it is only valid to call
1959 * the setter once. However, we don't assert if the caller tries to
1960 * overwrite, just ignoring the update instead.
1962 * @param cpu_use Pointer to the CPU Use.
1964 *****************************************************************************/
1965 void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE * const cpu_use,
1967 /**************************************************************************//**
1968 * Set the percentage of time spent running un-niced user space processes
1970 * @note The property is treated as immutable: it is only valid to call
1971 * the setter once. However, we don't assert if the caller tries to
1972 * overwrite, just ignoring the update instead.
1974 * @param cpu_use Pointer to the CPU Use.
1976 *****************************************************************************/
1977 void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE * const cpu_use,
1979 /**************************************************************************//**
1980 * Set the percentage of CPU time spent waiting for I/O operations to complete
1982 * @note The property is treated as immutable: it is only valid to call
1983 * the setter once. However, we don't assert if the caller tries to
1984 * overwrite, just ignoring the update instead.
1986 * @param cpu_use Pointer to the CPU Use.
1988 *****************************************************************************/
1989 void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE * const cpu_use,
1992 /**************************************************************************//**
1993 * Add an additional File System usage value name/value pair to the
1996 * The filesystem_name is null delimited ASCII string. The library takes a
1997 * copy so the caller does not have to preserve values after the function
2000 * @param measurement Pointer to the measurement.
2001 * @param filesystem_name ASCIIZ string with the file-system's UUID.
2002 * @param block_configured Block storage configured.
2003 * @param block_used Block storage in use.
2004 * @param block_iops Block storage IOPS.
2005 * @param ephemeral_configured Ephemeral storage configured.
2006 * @param ephemeral_used Ephemeral storage in use.
2007 * @param ephemeral_iops Ephemeral storage IOPS.
2008 *****************************************************************************/
2009 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
2010 char * filesystem_name,
2011 double block_configured,
2014 double ephemeral_configured,
2015 double ephemeral_used,
2016 double ephemeral_iops);
2018 /**************************************************************************//**
2019 * Add a Feature usage value name/value pair to the Measurement.
2021 * The name is null delimited ASCII string. The library takes
2022 * a copy so the caller does not have to preserve values after the function
2025 * @param measurement Pointer to the measurement.
2026 * @param feature ASCIIZ string with the feature's name.
2027 * @param utilization Utilization of the feature.
2028 *****************************************************************************/
2029 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
2033 /**************************************************************************//**
2034 * Add a Additional Measurement value name/value pair to the Measurement.
2036 * The name is null delimited ASCII string. The library takes
2037 * a copy so the caller does not have to preserve values after the function
2040 * @param measurement Pointer to the Measurement.
2041 * @param group ASCIIZ string with the measurement group's name.
2042 * @param name ASCIIZ string containing the measurement's name.
2043 * @param name ASCIIZ string containing the measurement's value.
2044 *****************************************************************************/
2045 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
2046 const char * const group,
2047 const char * const name,
2048 const char * const value);
2050 /**************************************************************************//**
2051 * Add a Codec usage value name/value pair to the Measurement.
2053 * The name is null delimited ASCII string. The library takes
2054 * a copy so the caller does not have to preserve values after the function
2057 * @param measurement Pointer to the measurement.
2058 * @param codec ASCIIZ string with the codec's name.
2059 * @param utilization Utilization of the feature.
2060 *****************************************************************************/
2061 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
2065 /**************************************************************************//**
2066 * Set the Media Ports in Use property of the Measurement.
2068 * @note The property is treated as immutable: it is only valid to call
2069 * the setter once. However, we don't assert if the caller tries to
2070 * overwrite, just ignoring the update instead.
2072 * @param measurement Pointer to the measurement.
2073 * @param media_ports_in_use The media port usage to set.
2074 *****************************************************************************/
2075 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
2076 int media_ports_in_use);
2078 /**************************************************************************//**
2079 * Set the VNFC Scaling Metric property of the Measurement.
2081 * @note The property is treated as immutable: it is only valid to call
2082 * the setter once. However, we don't assert if the caller tries to
2083 * overwrite, just ignoring the update instead.
2085 * @param measurement Pointer to the measurement.
2086 * @param scaling_metric The scaling metric to set.
2087 *****************************************************************************/
2088 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
2089 int scaling_metric);
2091 /**************************************************************************//**
2092 * Create a new Latency Bucket to be added to a Measurement event.
2094 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
2095 * supplied to this factory function and are immutable once set.
2096 * Optional fields have explicit setter functions, but again values
2097 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
2098 * immutable properties.
2100 * @param count Count of events in this bucket.
2102 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
2103 * @retval NULL Failed to create the Latency Bucket.
2104 *****************************************************************************/
2105 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count);
2107 /**************************************************************************//**
2108 * Set the High End property of the Measurement Latency Bucket.
2110 * @note The property is treated as immutable: it is only valid to call
2111 * the setter once. However, we don't assert if the caller tries to
2112 * overwrite, just ignoring the update instead.
2114 * @param bucket Pointer to the Measurement Latency Bucket.
2115 * @param high_end High end of the bucket's range.
2116 *****************************************************************************/
2117 void evel_meas_latency_bucket_high_end_set(
2118 MEASUREMENT_LATENCY_BUCKET * const bucket,
2119 const double high_end);
2121 /**************************************************************************//**
2122 * Set the Low End property of the Measurement Latency Bucket.
2124 * @note The property is treated as immutable: it is only valid to call
2125 * the setter once. However, we don't assert if the caller tries to
2126 * overwrite, just ignoring the update instead.
2128 * @param bucket Pointer to the Measurement Latency Bucket.
2129 * @param low_end Low end of the bucket's range.
2130 *****************************************************************************/
2131 void evel_meas_latency_bucket_low_end_set(
2132 MEASUREMENT_LATENCY_BUCKET * const bucket,
2133 const double low_end);
2135 /**************************************************************************//**
2136 * Add an additional Measurement Latency Bucket to the specified event.
2138 * @param measurement Pointer to the Measurement event.
2139 * @param bucket Pointer to the Measurement Latency Bucket to add.
2140 *****************************************************************************/
2141 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
2142 MEASUREMENT_LATENCY_BUCKET * const bucket);
2144 /**************************************************************************//**
2145 * Add an additional Latency Distribution bucket to the Measurement.
2147 * This function implements the previous API, purely for convenience.
2149 * @param measurement Pointer to the measurement.
2150 * @param low_end Low end of the bucket's range.
2151 * @param high_end High end of the bucket's range.
2152 * @param count Count of events in this bucket.
2153 *****************************************************************************/
2154 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
2155 const double low_end,
2156 const double high_end,
2159 /**************************************************************************//**
2160 * Create a new vNIC Use to be added to a Measurement event.
2162 * @note The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
2163 * to this factory function and are immutable once set. Optional
2164 * fields have explicit setter functions, but again values may only be
2165 * set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
2168 * @param vnic_id ASCIIZ string with the vNIC's ID.
2169 * @param val_suspect True or false confidence in data.
2171 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
2172 * If the structure is not used it must be released using
2173 * ::evel_measurement_free_vnic_performance.
2174 * @retval NULL Failed to create the vNIC Use.
2175 *****************************************************************************/
2176 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id, char * const val_suspect);
2178 /**************************************************************************//**
2181 * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied. Will free all the contained
2184 * @note It does not free the vNIC Use itself, since that may be part of a
2186 *****************************************************************************/
2187 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2189 /**************************************************************************//**
2190 * Set the Accumulated Broadcast Packets Received in measurement interval
2191 * property of the vNIC performance.
2193 * @note The property is treated as immutable: it is only valid to call
2194 * the setter once. However, we don't assert if the caller tries to
2195 * overwrite, just ignoring the update instead.
2197 * @param vnic_performance Pointer to the vNIC Use.
2198 * @param recvd_bcast_packets_acc
2199 *****************************************************************************/
2200 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2201 const double recvd_bcast_packets_acc);
2202 /**************************************************************************//**
2203 * Set the Delta Broadcast Packets Received in measurement interval
2204 * property of the vNIC performance.
2206 * @note The property is treated as immutable: it is only valid to call
2207 * the setter once. However, we don't assert if the caller tries to
2208 * overwrite, just ignoring the update instead.
2210 * @param vnic_performance Pointer to the vNIC Use.
2211 * @param recvd_bcast_packets_delta
2212 *****************************************************************************/
2213 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2214 const double recvd_bcast_packets_delta);
2215 /**************************************************************************//**
2216 * Set the Discarded Packets Received in measurement interval
2217 * property of the vNIC performance.
2219 * @note The property is treated as immutable: it is only valid to call
2220 * the setter once. However, we don't assert if the caller tries to
2221 * overwrite, just ignoring the update instead.
2223 * @param vnic_performance Pointer to the vNIC Use.
2224 * @param recvd_discard_packets_acc
2225 *****************************************************************************/
2226 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2227 const double recvd_discard_packets_acc);
2228 /**************************************************************************//**
2229 * Set the Delta Discarded Packets Received in measurement interval
2230 * property of the vNIC performance.
2232 * @note The property is treated as immutable: it is only valid to call
2233 * the setter once. However, we don't assert if the caller tries to
2234 * overwrite, just ignoring the update instead.
2236 * @param vnic_performance Pointer to the vNIC Use.
2237 * @param recvd_discard_packets_delta
2238 *****************************************************************************/
2239 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2240 const double recvd_discard_packets_delta);
2241 /**************************************************************************//**
2242 * Set the Error Packets Received in measurement interval
2243 * property of the vNIC performance.
2245 * @note The property is treated as immutable: it is only valid to call
2246 * the setter once. However, we don't assert if the caller tries to
2247 * overwrite, just ignoring the update instead.
2249 * @param vnic_performance Pointer to the vNIC Use.
2250 * @param recvd_error_packets_acc
2251 *****************************************************************************/
2252 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2253 const double recvd_error_packets_acc);
2254 /**************************************************************************//**
2255 * Set the Delta Error Packets Received in measurement interval
2256 * property of the vNIC performance.
2258 * @note The property is treated as immutable: it is only valid to call
2259 * the setter once. However, we don't assert if the caller tries to
2260 * overwrite, just ignoring the update instead.
2262 * @param vnic_performance Pointer to the vNIC Use.
2263 * @param recvd_error_packets_delta
2264 *****************************************************************************/
2265 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2266 const double recvd_error_packets_delta);
2267 /**************************************************************************//**
2268 * Set the Accumulated Multicast Packets Received in measurement interval
2269 * property of the vNIC performance.
2271 * @note The property is treated as immutable: it is only valid to call
2272 * the setter once. However, we don't assert if the caller tries to
2273 * overwrite, just ignoring the update instead.
2275 * @param vnic_performance Pointer to the vNIC Use.
2276 * @param recvd_mcast_packets_acc
2277 *****************************************************************************/
2278 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2279 const double recvd_mcast_packets_acc);
2280 /**************************************************************************//**
2281 * Set the Delta Multicast Packets Received in measurement interval
2282 * property of the vNIC performance.
2284 * @note The property is treated as immutable: it is only valid to call
2285 * the setter once. However, we don't assert if the caller tries to
2286 * overwrite, just ignoring the update instead.
2288 * @param vnic_performance Pointer to the vNIC Use.
2289 * @param recvd_mcast_packets_delta
2290 *****************************************************************************/
2291 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2292 const double recvd_mcast_packets_delta);
2293 /**************************************************************************//**
2294 * Set the Accumulated Octets Received in measurement interval
2295 * property of the vNIC performance.
2297 * @note The property is treated as immutable: it is only valid to call
2298 * the setter once. However, we don't assert if the caller tries to
2299 * overwrite, just ignoring the update instead.
2301 * @param vnic_performance Pointer to the vNIC Use.
2302 * @param recvd_octets_acc
2303 *****************************************************************************/
2304 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2305 const double recvd_octets_acc);
2306 /**************************************************************************//**
2307 * Set the Delta Octets Received in measurement interval
2308 * property of the vNIC performance.
2310 * @note The property is treated as immutable: it is only valid to call
2311 * the setter once. However, we don't assert if the caller tries to
2312 * overwrite, just ignoring the update instead.
2314 * @param vnic_performance Pointer to the vNIC Use.
2315 * @param recvd_octets_delta
2316 *****************************************************************************/
2317 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2318 const double recvd_octets_delta);
2319 /**************************************************************************//**
2320 * Set the Accumulated Total Packets Received in measurement interval
2321 * property of the vNIC performance.
2323 * @note The property is treated as immutable: it is only valid to call
2324 * the setter once. However, we don't assert if the caller tries to
2325 * overwrite, just ignoring the update instead.
2327 * @param vnic_performance Pointer to the vNIC Use.
2328 * @param recvd_total_packets_acc
2329 *****************************************************************************/
2330 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2331 const double recvd_total_packets_acc);
2332 /**************************************************************************//**
2333 * Set the Delta Total Packets Received in measurement interval
2334 * property of the vNIC performance.
2336 * @note The property is treated as immutable: it is only valid to call
2337 * the setter once. However, we don't assert if the caller tries to
2338 * overwrite, just ignoring the update instead.
2340 * @param vnic_performance Pointer to the vNIC Use.
2341 * @param recvd_total_packets_delta
2342 *****************************************************************************/
2343 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2344 const double recvd_total_packets_delta);
2345 /**************************************************************************//**
2346 * Set the Accumulated Unicast Packets Received in measurement interval
2347 * property of the vNIC performance.
2349 * @note The property is treated as immutable: it is only valid to call
2350 * the setter once. However, we don't assert if the caller tries to
2351 * overwrite, just ignoring the update instead.
2353 * @param vnic_performance Pointer to the vNIC Use.
2354 * @param recvd_ucast_packets_acc
2355 *****************************************************************************/
2356 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2357 const double recvd_ucast_packets_acc);
2358 /**************************************************************************//**
2359 * Set the Delta Unicast packets Received in measurement interval
2360 * property of the vNIC performance.
2362 * @note The property is treated as immutable: it is only valid to call
2363 * the setter once. However, we don't assert if the caller tries to
2364 * overwrite, just ignoring the update instead.
2366 * @param vnic_performance Pointer to the vNIC Use.
2367 * @param recvd_ucast_packets_delta
2368 *****************************************************************************/
2369 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2370 const double recvd_ucast_packets_delta);
2371 /**************************************************************************//**
2372 * Set the Transmitted Broadcast Packets in measurement interval
2373 * property of the vNIC performance.
2375 * @note The property is treated as immutable: it is only valid to call
2376 * the setter once. However, we don't assert if the caller tries to
2377 * overwrite, just ignoring the update instead.
2379 * @param vnic_performance Pointer to the vNIC Use.
2380 * @param tx_bcast_packets_acc
2381 *****************************************************************************/
2382 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2383 const double tx_bcast_packets_acc);
2384 /**************************************************************************//**
2385 * Set the Delta Broadcast packets Transmitted in measurement interval
2386 * property of the vNIC performance.
2388 * @note The property is treated as immutable: it is only valid to call
2389 * the setter once. However, we don't assert if the caller tries to
2390 * overwrite, just ignoring the update instead.
2392 * @param vnic_performance Pointer to the vNIC Use.
2393 * @param tx_bcast_packets_delta
2394 *****************************************************************************/
2395 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2396 const double tx_bcast_packets_delta);
2397 /**************************************************************************//**
2398 * Set the Transmitted Discarded Packets in measurement interval
2399 * property of the vNIC performance.
2401 * @note The property is treated as immutable: it is only valid to call
2402 * the setter once. However, we don't assert if the caller tries to
2403 * overwrite, just ignoring the update instead.
2405 * @param vnic_performance Pointer to the vNIC Use.
2406 * @param tx_discarded_packets_acc
2407 *****************************************************************************/
2408 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2409 const double tx_discarded_packets_acc);
2410 /**************************************************************************//**
2411 * Set the Delta Discarded packets Transmitted in measurement interval
2412 * property of the vNIC performance.
2414 * @note The property is treated as immutable: it is only valid to call
2415 * the setter once. However, we don't assert if the caller tries to
2416 * overwrite, just ignoring the update instead.
2418 * @param vnic_performance Pointer to the vNIC Use.
2419 * @param tx_discarded_packets_delta
2420 *****************************************************************************/
2421 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2422 const double tx_discarded_packets_delta);
2423 /**************************************************************************//**
2424 * Set the Transmitted Errored Packets in measurement interval
2425 * property of the vNIC performance.
2427 * @note The property is treated as immutable: it is only valid to call
2428 * the setter once. However, we don't assert if the caller tries to
2429 * overwrite, just ignoring the update instead.
2431 * @param vnic_performance Pointer to the vNIC Use.
2432 * @param tx_error_packets_acc
2433 *****************************************************************************/
2434 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2435 const double tx_error_packets_acc);
2436 /**************************************************************************//**
2437 * Set the Delta Errored packets Transmitted in measurement interval
2438 * property of the vNIC performance.
2440 * @note The property is treated as immutable: it is only valid to call
2441 * the setter once. However, we don't assert if the caller tries to
2442 * overwrite, just ignoring the update instead.
2444 * @param vnic_performance Pointer to the vNIC Use.
2445 * @param tx_error_packets_delta
2446 *****************************************************************************/
2447 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2448 const double tx_error_packets_delta);
2449 /**************************************************************************//**
2450 * Set the Transmitted Multicast Packets in measurement interval
2451 * property of the vNIC performance.
2453 * @note The property is treated as immutable: it is only valid to call
2454 * the setter once. However, we don't assert if the caller tries to
2455 * overwrite, just ignoring the update instead.
2457 * @param vnic_performance Pointer to the vNIC Use.
2458 * @param tx_mcast_packets_acc
2459 *****************************************************************************/
2460 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2461 const double tx_mcast_packets_acc);
2462 /**************************************************************************//**
2463 * Set the Delta Multicast packets Transmitted in measurement interval
2464 * property of the vNIC performance.
2466 * @note The property is treated as immutable: it is only valid to call
2467 * the setter once. However, we don't assert if the caller tries to
2468 * overwrite, just ignoring the update instead.
2470 * @param vnic_performance Pointer to the vNIC Use.
2471 * @param tx_mcast_packets_delta
2472 *****************************************************************************/
2473 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2474 const double tx_mcast_packets_delta);
2475 /**************************************************************************//**
2476 * Set the Transmitted Octets in measurement interval
2477 * property of the vNIC performance.
2479 * @note The property is treated as immutable: it is only valid to call
2480 * the setter once. However, we don't assert if the caller tries to
2481 * overwrite, just ignoring the update instead.
2483 * @param vnic_performance Pointer to the vNIC Use.
2484 * @param tx_octets_acc
2485 *****************************************************************************/
2486 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2487 const double tx_octets_acc);
2488 /**************************************************************************//**
2489 * Set the Delta Octets Transmitted in measurement interval
2490 * property of the vNIC performance.
2492 * @note The property is treated as immutable: it is only valid to call
2493 * the setter once. However, we don't assert if the caller tries to
2494 * overwrite, just ignoring the update instead.
2496 * @param vnic_performance Pointer to the vNIC Use.
2497 * @param tx_octets_delta
2498 *****************************************************************************/
2499 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2500 const double tx_octets_delta);
2501 /**************************************************************************//**
2502 * Set the Transmitted Total Packets in measurement interval
2503 * property of the vNIC performance.
2505 * @note The property is treated as immutable: it is only valid to call
2506 * the setter once. However, we don't assert if the caller tries to
2507 * overwrite, just ignoring the update instead.
2509 * @param vnic_performance Pointer to the vNIC Use.
2510 * @param tx_total_packets_acc
2511 *****************************************************************************/
2512 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2513 const double tx_total_packets_acc);
2514 /**************************************************************************//**
2515 * Set the Delta Total Packets Transmitted in measurement interval
2516 * property of the vNIC performance.
2518 * @note The property is treated as immutable: it is only valid to call
2519 * the setter once. However, we don't assert if the caller tries to
2520 * overwrite, just ignoring the update instead.
2522 * @param vnic_performance Pointer to the vNIC Use.
2523 * @param tx_total_packets_delta
2524 *****************************************************************************/
2525 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2526 const double tx_total_packets_delta);
2527 /**************************************************************************//**
2528 * Set the Transmitted Unicast Packets in measurement interval
2529 * property of the vNIC performance.
2531 * @note The property is treated as immutable: it is only valid to call
2532 * the setter once. However, we don't assert if the caller tries to
2533 * overwrite, just ignoring the update instead.
2535 * @param vnic_performance Pointer to the vNIC Use.
2536 * @param tx_ucast_packets_acc
2537 *****************************************************************************/
2538 void evel_vnic_performance_tx_ucast_packets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2539 const double tx_ucast_packets_acc);
2540 /**************************************************************************//**
2541 * Set the Delta Octets Transmitted in measurement interval
2542 * property of the vNIC performance.
2544 * @note The property is treated as immutable: it is only valid to call
2545 * the setter once. However, we don't assert if the caller tries to
2546 * overwrite, just ignoring the update instead.
2548 * @param vnic_performance Pointer to the vNIC Use.
2549 * @param tx_ucast_packets_delta
2550 *****************************************************************************/
2551 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2552 const double tx_ucast_packets_delta);
2554 /**************************************************************************//**
2555 * Add an additional vNIC Use to the specified Measurement event.
2557 * @param measurement Pointer to the measurement.
2558 * @param vnic_performance Pointer to the vNIC Use to add.
2559 *****************************************************************************/
2560 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2561 MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2563 /**************************************************************************//**
2564 * Add an additional vNIC usage record Measurement.
2566 * This function implements the previous API, purely for convenience.
2568 * The ID is null delimited ASCII string. The library takes a copy so the
2569 * caller does not have to preserve values after the function returns.
2571 * @param measurement Pointer to the measurement.
2572 * @param vnic_id ASCIIZ string with the vNIC's ID.
2573 * @param valset true or false confidence level
2574 * @param recvd_bcast_packets_acc Recieved broadcast packets
2575 * @param recvd_bcast_packets_delta Received delta broadcast packets
2576 * @param recvd_discarded_packets_acc Recieved discarded packets
2577 * @param recvd_discarded_packets_delta Received discarded delta packets
2578 * @param recvd_error_packets_acc Received error packets
2579 * @param recvd_error_packets_delta, Received delta error packets
2580 * @param recvd_mcast_packets_acc Received multicast packets
2581 * @param recvd_mcast_packets_delta Received delta multicast packets
2582 * @param recvd_octets_acc Received octets
2583 * @param recvd_octets_delta Received delta octets
2584 * @param recvd_total_packets_acc Received total packets
2585 * @param recvd_total_packets_delta Received delta total packets
2586 * @param recvd_ucast_packets_acc Received Unicast packets
2587 * @param recvd_ucast_packets_delta Received delta unicast packets
2588 * @param tx_bcast_packets_acc Transmitted broadcast packets
2589 * @param tx_bcast_packets_delta Transmitted delta broadcast packets
2590 * @param tx_discarded_packets_acc Transmitted packets discarded
2591 * @param tx_discarded_packets_delta Transmitted delta discarded packets
2592 * @param tx_error_packets_acc Transmitted error packets
2593 * @param tx_error_packets_delta Transmitted delta error packets
2594 * @param tx_mcast_packets_acc Transmitted multicast packets accumulated
2595 * @param tx_mcast_packets_delta Transmitted delta multicast packets
2596 * @param tx_octets_acc Transmitted octets
2597 * @param tx_octets_delta Transmitted delta octets
2598 * @param tx_total_packets_acc Transmitted total packets
2599 * @param tx_total_packets_delta Transmitted delta total packets
2600 * @param tx_ucast_packets_acc Transmitted Unicast packets
2601 * @param tx_ucast_packets_delta Transmitted delta Unicast packets
2602 *****************************************************************************/
2603 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2604 char * const vnic_id,
2606 double recvd_bcast_packets_acc,
2607 double recvd_bcast_packets_delta,
2608 double recvd_discarded_packets_acc,
2609 double recvd_discarded_packets_delta,
2610 double recvd_error_packets_acc,
2611 double recvd_error_packets_delta,
2612 double recvd_mcast_packets_acc,
2613 double recvd_mcast_packets_delta,
2614 double recvd_octets_acc,
2615 double recvd_octets_delta,
2616 double recvd_total_packets_acc,
2617 double recvd_total_packets_delta,
2618 double recvd_ucast_packets_acc,
2619 double recvd_ucast_packets_delta,
2620 double tx_bcast_packets_acc,
2621 double tx_bcast_packets_delta,
2622 double tx_discarded_packets_acc,
2623 double tx_discarded_packets_delta,
2624 double tx_error_packets_acc,
2625 double tx_error_packets_delta,
2626 double tx_mcast_packets_acc,
2627 double tx_mcast_packets_delta,
2628 double tx_octets_acc,
2629 double tx_octets_delta,
2630 double tx_total_packets_acc,
2631 double tx_total_packets_delta,
2632 double tx_ucast_packets_acc,
2633 double tx_ucast_packets_delta);
2635 /*****************************************************************************/
2636 /*****************************************************************************/
2640 /*****************************************************************************/
2641 /*****************************************************************************/
2643 /**************************************************************************//**
2644 * Create a new Report event.
2646 * @note The mandatory fields on the Report must be supplied to this
2647 * factory function and are immutable once set. Optional fields have
2648 * explicit setter functions, but again values may only be set once so
2649 * that the Report has immutable properties.
2651 * @param measurement_interval
2652 * @param event_name Unique Event Name
2653 * @param event_id A universal identifier of the event for analysis etc
2655 * @returns pointer to the newly manufactured ::EVENT_REPORT. If the event is
2656 * not used (i.e. posted) it must be released using
2657 * ::evel_free_report.
2658 * @retval NULL Failed to create the event.
2659 *****************************************************************************/
2660 EVENT_REPORT * evel_new_report(double measurement_interval,const char* ev_name, const char *ev_id);
2662 /**************************************************************************//**
2665 * Free off the Report supplied. Will free all the contained allocated memory.
2667 * @note It does not free the Report itself, since that may be part of a
2669 *****************************************************************************/
2670 void evel_free_report(EVENT_REPORT * event);
2672 /**************************************************************************//**
2673 * Set the Event Type property of the Report.
2675 * @note The property is treated as immutable: it is only valid to call
2676 * the setter once. However, we don't assert if the caller tries to
2677 * overwrite, just ignoring the update instead.
2679 * @param report Pointer to the Report.
2680 * @param type The Event Type to be set. ASCIIZ string. The caller
2681 * does not need to preserve the value once the function
2683 *****************************************************************************/
2684 void evel_report_type_set(EVENT_REPORT * report, const char * const type);
2686 /**************************************************************************//**
2687 * Add a Feature usage value name/value pair to the Report.
2689 * The name is null delimited ASCII string. The library takes
2690 * a copy so the caller does not have to preserve values after the function
2693 * @param report Pointer to the report.
2694 * @param feature ASCIIZ string with the feature's name.
2695 * @param utilization Utilization of the feature.
2696 *****************************************************************************/
2697 void evel_report_feature_use_add(EVENT_REPORT * report,
2701 /**************************************************************************//**
2702 * Add a Additional Measurement value name/value pair to the Report.
2704 * The name is null delimited ASCII string. The library takes
2705 * a copy so the caller does not have to preserve values after the function
2708 * @param report Pointer to the report.
2709 * @param group ASCIIZ string with the measurement group's name.
2710 * @param name ASCIIZ string containing the measurement's name.
2711 * @param value ASCIIZ string containing the measurement's value.
2712 *****************************************************************************/
2713 void evel_report_custom_measurement_add(EVENT_REPORT * report,
2714 const char * const group,
2715 const char * const name,
2716 const char * const value);
2718 /*****************************************************************************/
2719 /*****************************************************************************/
2723 /*****************************************************************************/
2724 /*****************************************************************************/
2726 /**************************************************************************//**
2727 * Create a new Mobile Flow event.
2729 * @note The mandatory fields on the Mobile Flow must be supplied to this
2730 * factory function and are immutable once set. Optional fields have
2731 * explicit setter functions, but again values may only be set once so
2732 * that the Mobile Flow has immutable properties.
2734 * @param event_name Unique Event Name
2735 * @param event_id A universal identifier of the event for analysis etc
2736 * @param flow_direction
2737 * @param gtp_per_flow_metrics
2738 * @param ip_protocol_type
2740 * @param other_endpoint_ip_address
2741 * @param other_endpoint_port
2742 * @param reporting_endpoint_ip_addr
2743 * @param reporting_endpoint_port
2745 * @returns pointer to the newly manufactured ::EVENT_MOBILE_FLOW. If the
2746 * event is not used (i.e. posted) it must be released using
2747 * ::evel_free_mobile_flow.
2748 * @retval NULL Failed to create the event.
2749 *****************************************************************************/
2750 EVENT_MOBILE_FLOW * evel_new_mobile_flow(
2751 const char* ev_name, const char *ev_id,
2752 const char * const flow_direction,
2753 MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics,
2754 const char * const ip_protocol_type,
2755 const char * const ip_version,
2756 const char * const other_endpoint_ip_address,
2757 int other_endpoint_port,
2758 const char * const reporting_endpoint_ip_addr,
2759 int reporting_endpoint_port);
2761 /**************************************************************************//**
2762 * Free a Mobile Flow.
2764 * Free off the Mobile Flow supplied. Will free all the contained allocated
2767 * @note It does not free the Mobile Flow itself, since that may be part of a
2769 *****************************************************************************/
2770 void evel_free_mobile_flow(EVENT_MOBILE_FLOW * event);
2772 /**************************************************************************//**
2773 * Set the Event Type property of the Mobile Flow.
2775 * @note The property is treated as immutable: it is only valid to call
2776 * the setter once. However, we don't assert if the caller tries to
2777 * overwrite, just ignoring the update instead.
2779 * @param mobile_flow Pointer to the Mobile Flow.
2780 * @param type The Event Type to be set. ASCIIZ string. The caller
2781 * does not need to preserve the value once the function
2783 *****************************************************************************/
2784 void evel_mobile_flow_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2785 const char * const type);
2787 /**************************************************************************//**
2788 * Set the Application Type property of the Mobile Flow.
2790 * @note The property is treated as immutable: it is only valid to call
2791 * the setter once. However, we don't assert if the caller tries to
2792 * overwrite, just ignoring the update instead.
2794 * @param mobile_flow Pointer to the Mobile Flow.
2795 * @param type The Application Type to be set. ASCIIZ string. The caller
2796 * does not need to preserve the value once the function
2798 *****************************************************************************/
2799 void evel_mobile_flow_app_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2800 const char * const type);
2802 /**************************************************************************//**
2803 * Set the Application Protocol Type property of the Mobile Flow.
2805 * @note The property is treated as immutable: it is only valid to call
2806 * the setter once. However, we don't assert if the caller tries to
2807 * overwrite, just ignoring the update instead.
2809 * @param mobile_flow Pointer to the Mobile Flow.
2810 * @param type The Application Protocol Type to be set. ASCIIZ string.
2811 * The caller does not need to preserve the value once the
2813 *****************************************************************************/
2814 void evel_mobile_flow_app_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2815 const char * const type);
2817 /**************************************************************************//**
2818 * Set the Application Protocol Version property of the Mobile Flow.
2820 * @note The property is treated as immutable: it is only valid to call
2821 * the setter once. However, we don't assert if the caller tries to
2822 * overwrite, just ignoring the update instead.
2824 * @param mobile_flow Pointer to the Mobile Flow.
2825 * @param version The Application Protocol Version to be set. ASCIIZ
2826 * string. The caller does not need to preserve the value
2827 * once the function returns.
2828 *****************************************************************************/
2829 void evel_mobile_flow_app_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2830 const char * const version);
2832 /**************************************************************************//**
2833 * Set the CID property of the Mobile Flow.
2835 * @note The property is treated as immutable: it is only valid to call
2836 * the setter once. However, we don't assert if the caller tries to
2837 * overwrite, just ignoring the update instead.
2839 * @param mobile_flow Pointer to the Mobile Flow.
2840 * @param cid The CID to be set. ASCIIZ string. The caller does not
2841 * need to preserve the value once the function returns.
2842 *****************************************************************************/
2843 void evel_mobile_flow_cid_set(EVENT_MOBILE_FLOW * mobile_flow,
2844 const char * const cid);
2846 /**************************************************************************//**
2847 * Set the Connection Type property of the Mobile Flow.
2849 * @note The property is treated as immutable: it is only valid to call
2850 * the setter once. However, we don't assert if the caller tries to
2851 * overwrite, just ignoring the update instead.
2853 * @param mobile_flow Pointer to the Mobile Flow.
2854 * @param type The Connection Type to be set. ASCIIZ string. The caller
2855 * does not need to preserve the value once the function
2857 *****************************************************************************/
2858 void evel_mobile_flow_con_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2859 const char * const type);
2861 /**************************************************************************//**
2862 * Set the ECGI property of the Mobile Flow.
2864 * @note The property is treated as immutable: it is only valid to call
2865 * the setter once. However, we don't assert if the caller tries to
2866 * overwrite, just ignoring the update instead.
2868 * @param mobile_flow Pointer to the Mobile Flow.
2869 * @param ecgi The ECGI to be set. ASCIIZ string. The caller does not
2870 * need to preserve the value once the function returns.
2871 *****************************************************************************/
2872 void evel_mobile_flow_ecgi_set(EVENT_MOBILE_FLOW * mobile_flow,
2873 const char * const ecgi);
2875 /**************************************************************************//**
2876 * Set the GTP Protocol Type property of the Mobile Flow.
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.
2882 * @param mobile_flow Pointer to the Mobile Flow.
2883 * @param type The GTP Protocol Type to be set. ASCIIZ string. The
2884 * caller does not need to preserve the value once the
2886 *****************************************************************************/
2887 void evel_mobile_flow_gtp_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2888 const char * const type);
2890 /**************************************************************************//**
2891 * Set the GTP Protocol Version property of the Mobile Flow.
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.
2897 * @param mobile_flow Pointer to the Mobile Flow.
2898 * @param version The GTP Protocol Version to be set. ASCIIZ string. The
2899 * caller does not need to preserve the value once the
2901 *****************************************************************************/
2902 void evel_mobile_flow_gtp_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2903 const char * const version);
2905 /**************************************************************************//**
2906 * Set the HTTP Header property of the Mobile Flow.
2908 * @note The property is treated as immutable: it is only valid to call
2909 * the setter once. However, we don't assert if the caller tries to
2910 * overwrite, just ignoring the update instead.
2912 * @param mobile_flow Pointer to the Mobile Flow.
2913 * @param header The HTTP header to be set. ASCIIZ string. The caller does
2914 * not need to preserve the value once the function returns.
2915 *****************************************************************************/
2916 void evel_mobile_flow_http_header_set(EVENT_MOBILE_FLOW * mobile_flow,
2917 const char * const header);
2919 /**************************************************************************//**
2920 * Set the IMEI property of the Mobile Flow.
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.
2926 * @param mobile_flow Pointer to the Mobile Flow.
2927 * @param imei The IMEI 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_imei_set(EVENT_MOBILE_FLOW * mobile_flow,
2931 const char * const imei);
2933 /**************************************************************************//**
2934 * Set the IMSI property of the Mobile Flow.
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.
2940 * @param mobile_flow Pointer to the Mobile Flow.
2941 * @param imsi The IMSI to be set. ASCIIZ string. The caller does not
2942 * need to preserve the value once the function returns.
2943 *****************************************************************************/
2944 void evel_mobile_flow_imsi_set(EVENT_MOBILE_FLOW * mobile_flow,
2945 const char * const imsi);
2947 /**************************************************************************//**
2948 * Set the LAC property of the Mobile Flow.
2950 * @note The property is treated as immutable: it is only valid to call
2951 * the setter once. However, we don't assert if the caller tries to
2952 * overwrite, just ignoring the update instead.
2954 * @param mobile_flow Pointer to the Mobile Flow.
2955 * @param lac The LAC to be set. ASCIIZ string. The caller does not
2956 * need to preserve the value once the function returns.
2957 *****************************************************************************/
2958 void evel_mobile_flow_lac_set(EVENT_MOBILE_FLOW * mobile_flow,
2959 const char * const lac);
2961 /**************************************************************************//**
2962 * Set the MCC property of the Mobile Flow.
2964 * @note The property is treated as immutable: it is only valid to call
2965 * the setter once. However, we don't assert if the caller tries to
2966 * overwrite, just ignoring the update instead.
2968 * @param mobile_flow Pointer to the Mobile Flow.
2969 * @param mcc The MCC to be set. ASCIIZ string. The caller does not
2970 * need to preserve the value once the function returns.
2971 *****************************************************************************/
2972 void evel_mobile_flow_mcc_set(EVENT_MOBILE_FLOW * mobile_flow,
2973 const char * const mcc);
2975 /**************************************************************************//**
2976 * Set the MNC property of the Mobile Flow.
2978 * @note The property is treated as immutable: it is only valid to call
2979 * the setter once. However, we don't assert if the caller tries to
2980 * overwrite, just ignoring the update instead.
2982 * @param mobile_flow Pointer to the Mobile Flow.
2983 * @param mnc The MNC to be set. ASCIIZ string. The caller does not
2984 * need to preserve the value once the function returns.
2985 *****************************************************************************/
2986 void evel_mobile_flow_mnc_set(EVENT_MOBILE_FLOW * mobile_flow,
2987 const char * const mnc);
2989 /**************************************************************************//**
2990 * Set the MSISDN property of the Mobile Flow.
2992 * @note The property is treated as immutable: it is only valid to call
2993 * the setter once. However, we don't assert if the caller tries to
2994 * overwrite, just ignoring the update instead.
2996 * @param mobile_flow Pointer to the Mobile Flow.
2997 * @param msisdn The MSISDN to be set. ASCIIZ string. The caller does not
2998 * need to preserve the value once the function returns.
2999 *****************************************************************************/
3000 void evel_mobile_flow_msisdn_set(EVENT_MOBILE_FLOW * mobile_flow,
3001 const char * const msisdn);
3003 /**************************************************************************//**
3004 * Set the Other Functional Role property of the Mobile Flow.
3006 * @note The property is treated as immutable: it is only valid to call
3007 * the setter once. However, we don't assert if the caller tries to
3008 * overwrite, just ignoring the update instead.
3010 * @param mobile_flow Pointer to the Mobile Flow.
3011 * @param role The Other Functional Role to be set. ASCIIZ string. The
3012 * caller does not need to preserve the value once the
3014 *****************************************************************************/
3015 void evel_mobile_flow_other_func_role_set(EVENT_MOBILE_FLOW * mobile_flow,
3016 const char * const role);
3018 /**************************************************************************//**
3019 * Set the RAC property of the Mobile Flow.
3021 * @note The property is treated as immutable: it is only valid to call
3022 * the setter once. However, we don't assert if the caller tries to
3023 * overwrite, just ignoring the update instead.
3025 * @param mobile_flow Pointer to the Mobile Flow.
3026 * @param rac The RAC to be set. ASCIIZ string. The caller does not
3027 * need to preserve the value once the function returns.
3028 *****************************************************************************/
3029 void evel_mobile_flow_rac_set(EVENT_MOBILE_FLOW * mobile_flow,
3030 const char * const rac);
3032 /**************************************************************************//**
3033 * Set the Radio Access Technology property of the Mobile Flow.
3035 * @note The property is treated as immutable: it is only valid to call
3036 * the setter once. However, we don't assert if the caller tries to
3037 * overwrite, just ignoring the update instead.
3039 * @param mobile_flow Pointer to the Mobile Flow.
3040 * @param tech The Radio Access Technology to be set. ASCIIZ string. The
3041 * caller does not need to preserve the value once the
3043 *****************************************************************************/
3044 void evel_mobile_flow_radio_acc_tech_set(EVENT_MOBILE_FLOW * mobile_flow,
3045 const char * const tech);
3047 /**************************************************************************//**
3048 * Set the SAC property of the Mobile Flow.
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.
3054 * @param mobile_flow Pointer to the Mobile Flow.
3055 * @param sac The SAC 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_sac_set(EVENT_MOBILE_FLOW * mobile_flow,
3059 const char * const sac);
3061 /**************************************************************************//**
3062 * Set the Sampling Algorithm property of the Mobile Flow.
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.
3068 * @param mobile_flow Pointer to the Mobile Flow.
3069 * @param algorithm The Sampling Algorithm to be set.
3070 *****************************************************************************/
3071 void evel_mobile_flow_samp_alg_set(EVENT_MOBILE_FLOW * mobile_flow,
3074 /**************************************************************************//**
3075 * Set the TAC property of the Mobile Flow.
3077 * @note The property is treated as immutable: it is only valid to call
3078 * the setter once. However, we don't assert if the caller tries to
3079 * overwrite, just ignoring the update instead.
3081 * @param mobile_flow Pointer to the Mobile Flow.
3082 * @param tac The TAC to be set. ASCIIZ string. The caller does not
3083 * need to preserve the value once the function returns.
3084 *****************************************************************************/
3085 void evel_mobile_flow_tac_set(EVENT_MOBILE_FLOW * mobile_flow,
3086 const char * const tac);
3088 /**************************************************************************//**
3089 * Set the Tunnel ID property of the Mobile Flow.
3091 * @note The property is treated as immutable: it is only valid to call
3092 * the setter once. However, we don't assert if the caller tries to
3093 * overwrite, just ignoring the update instead.
3095 * @param mobile_flow Pointer to the Mobile Flow.
3096 * @param tunnel_id The Tunnel ID to be set. ASCIIZ string. The caller does
3097 * not need to preserve the value once the function returns.
3098 *****************************************************************************/
3099 void evel_mobile_flow_tunnel_id_set(EVENT_MOBILE_FLOW * mobile_flow,
3100 const char * const tunnel_id);
3102 /**************************************************************************//**
3103 * Set the VLAN ID property of the Mobile Flow.
3105 * @note The property is treated as immutable: it is only valid to call
3106 * the setter once. However, we don't assert if the caller tries to
3107 * overwrite, just ignoring the update instead.
3109 * @param mobile_flow Pointer to the Mobile Flow.
3110 * @param vlan_id The VLAN ID to be set. ASCIIZ string. The caller does
3111 * not need to preserve the value once the function returns.
3112 *****************************************************************************/
3113 void evel_mobile_flow_vlan_id_set(EVENT_MOBILE_FLOW * mobile_flow,
3114 const char * const vlan_id);
3116 /**************************************************************************//**
3117 * Create a new Mobile GTP Per Flow Metrics.
3119 * @note The mandatory fields on the Mobile GTP Per Flow Metrics must be
3120 * supplied to this factory function and are immutable once set.
3121 * Optional fields have explicit setter functions, but again values
3122 * may only be set once so that the Mobile GTP Per Flow Metrics has
3123 * immutable properties.
3125 * @param avg_bit_error_rate
3126 * @param avg_packet_delay_variation
3127 * @param avg_packet_latency
3128 * @param avg_receive_throughput
3129 * @param avg_transmit_throughput
3130 * @param flow_activation_epoch
3131 * @param flow_activation_microsec
3132 * @param flow_deactivation_epoch
3133 * @param flow_deactivation_microsec
3134 * @param flow_deactivation_time
3135 * @param flow_status
3136 * @param max_packet_delay_variation
3137 * @param num_activation_failures
3138 * @param num_bit_errors
3139 * @param num_bytes_received
3140 * @param num_bytes_transmitted
3141 * @param num_dropped_packets
3142 * @param num_l7_bytes_received
3143 * @param num_l7_bytes_transmitted
3144 * @param num_lost_packets
3145 * @param num_out_of_order_packets
3146 * @param num_packet_errors
3147 * @param num_packets_received_excl_retrans
3148 * @param num_packets_received_incl_retrans
3149 * @param num_packets_transmitted_incl_retrans
3150 * @param num_retries
3151 * @param num_timeouts
3152 * @param num_tunneled_l7_bytes_received
3153 * @param round_trip_time
3154 * @param time_to_first_byte
3156 * @returns pointer to the newly manufactured ::MOBILE_GTP_PER_FLOW_METRICS.
3157 * If the structure is not used it must be released using
3158 * ::evel_free_mobile_gtp_flow_metrics.
3159 * @retval NULL Failed to create the event.
3160 *****************************************************************************/
3161 MOBILE_GTP_PER_FLOW_METRICS * evel_new_mobile_gtp_flow_metrics(
3162 double avg_bit_error_rate,
3163 double avg_packet_delay_variation,
3164 int avg_packet_latency,
3165 int avg_receive_throughput,
3166 int avg_transmit_throughput,
3167 int flow_activation_epoch,
3168 int flow_activation_microsec,
3169 int flow_deactivation_epoch,
3170 int flow_deactivation_microsec,
3171 time_t flow_deactivation_time,
3172 const char * const flow_status,
3173 int max_packet_delay_variation,
3174 int num_activation_failures,
3176 int num_bytes_received,
3177 int num_bytes_transmitted,
3178 int num_dropped_packets,
3179 int num_l7_bytes_received,
3180 int num_l7_bytes_transmitted,
3181 int num_lost_packets,
3182 int num_out_of_order_packets,
3183 int num_packet_errors,
3184 int num_packets_received_excl_retrans,
3185 int num_packets_received_incl_retrans,
3186 int num_packets_transmitted_incl_retrans,
3189 int num_tunneled_l7_bytes_received,
3190 int round_trip_time,
3191 int time_to_first_byte);
3193 /**************************************************************************//**
3194 * Free a Mobile GTP Per Flow Metrics.
3196 * Free off the Mobile GTP Per Flow Metrics supplied. Will free all the
3197 * contained allocated memory.
3199 * @note It does not free the Mobile GTP Per Flow Metrics itself, since that
3200 * may be part of a larger structure.
3201 *****************************************************************************/
3202 void evel_free_mobile_gtp_flow_metrics(MOBILE_GTP_PER_FLOW_METRICS * metrics);
3204 /**************************************************************************//**
3205 * Set the Duration of Connection Failed Status property of the Mobile GTP Per
3208 * @note The property is treated as immutable: it is only valid to call
3209 * the setter once. However, we don't assert if the caller tries to
3210 * overwrite, just ignoring the update instead.
3212 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3213 * @param duration The Duration of Connection Failed Status to be set.
3214 *****************************************************************************/
3215 void evel_mobile_gtp_metrics_dur_con_fail_set(
3216 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3219 /**************************************************************************//**
3220 * Set the Duration of Tunnel Failed Status property of the Mobile GTP Per Flow
3223 * @note The property is treated as immutable: it is only valid to call
3224 * the setter once. However, we don't assert if the caller tries to
3225 * overwrite, just ignoring the update instead.
3227 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3228 * @param duration The Duration of Tunnel Failed Status to be set.
3229 *****************************************************************************/
3230 void evel_mobile_gtp_metrics_dur_tun_fail_set(
3231 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3234 /**************************************************************************//**
3235 * Set the Activated By property of the Mobile GTP Per Flow metrics.
3237 * @note The property is treated as immutable: it is only valid to call
3238 * the setter once. However, we don't assert if the caller tries to
3239 * overwrite, just ignoring the update instead.
3241 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3242 * @param act_by The Activated By to be set. ASCIIZ string. The caller
3243 * does not need to preserve the value once the function
3245 *****************************************************************************/
3246 void evel_mobile_gtp_metrics_act_by_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3247 const char * const act_by);
3249 /**************************************************************************//**
3250 * Set the Activation Time property of the Mobile GTP Per Flow metrics.
3252 * @note The property is treated as immutable: it is only valid to call
3253 * the setter once. However, we don't assert if the caller tries to
3254 * overwrite, just ignoring the update instead.
3256 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3257 * @param act_time The Activation Time to be set. ASCIIZ string. The caller
3258 * does not need to preserve the value once the function
3260 *****************************************************************************/
3261 void evel_mobile_gtp_metrics_act_time_set(
3262 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3265 /**************************************************************************//**
3266 * Set the Deactivated By property of the Mobile GTP Per Flow metrics.
3268 * @note The property is treated as immutable: it is only valid to call
3269 * the setter once. However, we don't assert if the caller tries to
3270 * overwrite, just ignoring the update instead.
3272 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3273 * @param deact_by The Deactivated By to be set. ASCIIZ string. The caller
3274 * does not need to preserve the value once the function
3276 *****************************************************************************/
3277 void evel_mobile_gtp_metrics_deact_by_set(
3278 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3279 const char * const deact_by);
3281 /**************************************************************************//**
3282 * Set the GTP Connection Status property of the Mobile GTP Per Flow metrics.
3284 * @note The property is treated as immutable: it is only valid to call
3285 * the setter once. However, we don't assert if the caller tries to
3286 * overwrite, just ignoring the update instead.
3288 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3289 * @param status The GTP Connection Status to be set. ASCIIZ string. The
3290 * caller does not need to preserve the value once the
3292 *****************************************************************************/
3293 void evel_mobile_gtp_metrics_con_status_set(
3294 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3295 const char * const status);
3297 /**************************************************************************//**
3298 * Set the GTP Tunnel Status property of the Mobile GTP Per Flow metrics.
3300 * @note The property is treated as immutable: it is only valid to call
3301 * the setter once. However, we don't assert if the caller tries to
3302 * overwrite, just ignoring the update instead.
3304 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3305 * @param status The GTP Tunnel Status to be set. ASCIIZ string. The
3306 * caller does not need to preserve the value once the
3308 *****************************************************************************/
3309 void evel_mobile_gtp_metrics_tun_status_set(
3310 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3311 const char * const status);
3313 /**************************************************************************//**
3314 * Set an IP Type-of-Service count property of the Mobile GTP Per Flow metrics.
3316 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3317 * @param index The index of the IP Type-of-Service.
3318 * @param count The count.
3319 *****************************************************************************/
3320 void evel_mobile_gtp_metrics_iptos_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3324 /**************************************************************************//**
3325 * Set the Large Packet Round-Trip Time property of the Mobile GTP Per Flow
3328 * @note The property is treated as immutable: it is only valid to call
3329 * the setter once. However, we don't assert if the caller tries to
3330 * overwrite, just ignoring the update instead.
3332 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3333 * @param rtt The Large Packet Round-Trip Time to be set.
3334 *****************************************************************************/
3335 void evel_mobile_gtp_metrics_large_pkt_rtt_set(
3336 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3339 /**************************************************************************//**
3340 * Set the Large Packet Threshold property of the Mobile GTP Per Flow Metrics.
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.
3346 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3347 * @param threshold The Large Packet Threshold to be set.
3348 *****************************************************************************/
3349 void evel_mobile_gtp_metrics_large_pkt_thresh_set(
3350 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3353 /**************************************************************************//**
3354 * Set the Max Receive Bit Rate property of the Mobile GTP Per Flow Metrics.
3356 * @note The property is treated as immutable: it is only valid to call
3357 * the setter once. However, we don't assert if the caller tries to
3358 * overwrite, just ignoring the update instead.
3360 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3361 * @param rate The Max Receive Bit Rate to be set.
3362 *****************************************************************************/
3363 void evel_mobile_gtp_metrics_max_rcv_bit_rate_set(
3364 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3367 /**************************************************************************//**
3368 * Set the Max Transmit Bit Rate property of the Mobile GTP Per Flow Metrics.
3370 * @note The property is treated as immutable: it is only valid to call
3371 * the setter once. However, we don't assert if the caller tries to
3372 * overwrite, just ignoring the update instead.
3374 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3375 * @param rate The Max Transmit Bit Rate to be set.
3376 *****************************************************************************/
3377 void evel_mobile_gtp_metrics_max_trx_bit_rate_set(
3378 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3381 /**************************************************************************//**
3382 * Set the Number of GTP Echo Failures property of the Mobile GTP Per Flow
3385 * @note The property is treated as immutable: it is only valid to call
3386 * the setter once. However, we don't assert if the caller tries to
3387 * overwrite, just ignoring the update instead.
3389 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3390 * @param num The Number of GTP Echo Failures to be set.
3391 *****************************************************************************/
3392 void evel_mobile_gtp_metrics_num_echo_fail_set(
3393 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3396 /**************************************************************************//**
3397 * Set the Number of GTP Tunnel Errors property of the Mobile GTP Per Flow
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.
3404 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3405 * @param num The Number of GTP Tunnel Errors to be set.
3406 *****************************************************************************/
3407 void evel_mobile_gtp_metrics_num_tun_fail_set(
3408 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3411 /**************************************************************************//**
3412 * Set the Number of HTTP Errors property of the Mobile GTP Per Flow Metrics.
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.
3418 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3419 * @param num The Number of HTTP Errors to be set.
3420 *****************************************************************************/
3421 void evel_mobile_gtp_metrics_num_http_errors_set(
3422 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3425 /**************************************************************************//**
3426 * Add a TCP flag count to the metrics.
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.
3432 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3433 * @param tcp_flag The TCP flag count to be updated.
3434 * @param count The associated flag count.
3435 *****************************************************************************/
3436 void evel_mobile_gtp_metrics_tcp_flag_count_add(
3437 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3438 const EVEL_TCP_FLAGS tcp_flag,
3441 /**************************************************************************//**
3442 * Add a QCI COS count to the metrics.
3444 * @note The property is treated as immutable: it is only valid to call
3445 * the setter once. However, we don't assert if the caller tries to
3446 * overwrite, just ignoring the update instead.
3448 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3449 * @param qci_cos The QCI COS count to be updated.
3450 * @param count The associated QCI COS count.
3451 *****************************************************************************/
3452 void evel_mobile_gtp_metrics_qci_cos_count_add(
3453 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3454 const EVEL_QCI_COS_TYPES qci_cos,
3457 /*****************************************************************************/
3458 /*****************************************************************************/
3462 /*****************************************************************************/
3463 /*****************************************************************************/
3465 /**************************************************************************//**
3466 * Create a new Signaling event.
3468 * @note The mandatory fields on the Signaling must be supplied to
3469 * this factory function and are immutable once set. Optional fields
3470 * have explicit setter functions, but again values may only be set
3471 * once so that the event has immutable properties.
3472 * @param event_name Unique Event Name
3473 * @param event_id A universal identifier of the event for analysis etc
3474 * @param vendor_name The vendor id to encode in the event vnf field.
3475 * @param module The module to encode in the event.
3476 * @param vnfname The Virtual network function to encode in the event.
3477 * @returns pointer to the newly manufactured ::EVENT_SIGNALING. If the event
3478 * is not used (i.e. posted) it must be released using
3479 * ::evel_free_signaling.
3480 * @retval NULL Failed to create the event.
3481 *****************************************************************************/
3482 EVENT_SIGNALING * evel_new_signaling(const char* ev_name, const char *ev_id,
3483 const char * const vendor_name,
3484 const char * const correlator,
3485 const char * const local_ip_address,
3486 const char * const local_port,
3487 const char * const remote_ip_address,
3488 const char * const remote_port);
3490 /**************************************************************************//**
3491 * Free a Signaling event.
3493 * Free off the event supplied. Will free all the contained allocated memory.
3495 * @note It does not free the event itself, since that may be part of a larger
3497 *****************************************************************************/
3498 void evel_free_signaling(EVENT_SIGNALING * const event);
3500 /**************************************************************************//**
3501 * Set the Event Type property of the Signaling event.
3503 * @note The property is treated as immutable: it is only valid to call
3504 * the setter once. However, we don't assert if the caller tries to
3505 * overwrite, just ignoring the update instead.
3507 * @param event Pointer to the Signaling event.
3508 * @param type The Event Type to be set. ASCIIZ string. The caller
3509 * does not need to preserve the value once the function
3511 *****************************************************************************/
3512 void evel_signaling_type_set(EVENT_SIGNALING * const event,
3513 const char * const type);
3515 /**************************************************************************//**
3516 * Add an additional value name/value pair to the SIP signaling.
3518 * The name and value are null delimited ASCII strings. The library takes
3519 * a copy so the caller does not have to preserve values after the function
3522 * @param event Pointer to the fault.
3523 * @param name ASCIIZ string with the attribute's name. The caller
3524 * does not need to preserve the value once the function
3526 * @param value ASCIIZ string with the attribute's value. The caller
3527 * does not need to preserve the value once the function
3529 *****************************************************************************/
3530 void evel_signaling_addl_info_add(EVENT_SIGNALING * event, char * name, char * value);
3532 /**************************************************************************//**
3533 * Set the Correlator property of the Signaling event.
3535 * @note The property is treated as immutable: it is only valid to call
3536 * the setter once. However, we don't assert if the caller tries to
3537 * overwrite, just ignoring the update instead.
3539 * @param event Pointer to the Signaling event.
3540 * @param correlator The correlator to be set. ASCIIZ string. The caller
3541 * does not need to preserve the value once the function
3543 *****************************************************************************/
3544 void evel_signaling_correlator_set(EVENT_SIGNALING * const event,
3545 const char * const correlator);
3547 /**************************************************************************//**
3548 * Set the Local Ip Address property of the Signaling event.
3550 * @note The property is treated as immutable: it is only valid to call
3551 * the setter once. However, we don't assert if the caller tries to
3552 * overwrite, just ignoring the update instead.
3554 * @param event Pointer to the Signaling event.
3555 * @param local_ip_address
3556 * The Local Ip Address to be set. ASCIIZ string. The
3557 * caller does not need to preserve the value once the
3559 *****************************************************************************/
3560 void evel_signaling_local_ip_address_set(EVENT_SIGNALING * const event,
3561 const char * const local_ip_address);
3563 /**************************************************************************//**
3564 * Set the Local Port property of the Signaling event.
3566 * @note The property is treated as immutable: it is only valid to call
3567 * the setter once. However, we don't assert if the caller tries to
3568 * overwrite, just ignoring the update instead.
3570 * @param event Pointer to the Signaling event.
3571 * @param local_port The Local Port to be set. ASCIIZ string. The caller
3572 * does not need to preserve the value once the function
3574 *****************************************************************************/
3575 void evel_signaling_local_port_set(EVENT_SIGNALING * const event,
3576 const char * const local_port);
3578 /**************************************************************************//**
3579 * Set the Remote Ip Address property of the Signaling event.
3581 * @note The property is treated as immutable: it is only valid to call
3582 * the setter once. However, we don't assert if the caller tries to
3583 * overwrite, just ignoring the update instead.
3585 * @param event Pointer to the Signaling event.
3586 * @param remote_ip_address
3587 * The Remote Ip Address to be set. ASCIIZ string. The
3588 * caller does not need to preserve the value once the
3590 *****************************************************************************/
3591 void evel_signaling_remote_ip_address_set(EVENT_SIGNALING * const event,
3592 const char * const remote_ip_address);
3594 /**************************************************************************//**
3595 * Set the Remote Port property of the Signaling event.
3597 * @note The property is treated as immutable: it is only valid to call
3598 * the setter once. However, we don't assert if the caller tries to
3599 * overwrite, just ignoring the update instead.
3601 * @param event Pointer to the Signaling event.
3602 * @param remote_port The Remote Port to be set. ASCIIZ string. The caller
3603 * does not need to preserve the value once the function
3605 *****************************************************************************/
3606 void evel_signaling_remote_port_set(EVENT_SIGNALING * const event,
3607 const char * const remote_port);
3608 /**************************************************************************//**
3609 * Set the Vendor module property of the Signaling event.
3611 * @note The property is treated as immutable: it is only valid to call
3612 * the setter once. However, we don't assert if the caller tries to
3613 * overwrite, just ignoring the update instead.
3615 * @param event Pointer to the Signaling event.
3616 * @param modulename The module name to be set. ASCIIZ string. The caller
3617 * does not need to preserve the value once the function
3619 *****************************************************************************/
3620 void evel_signaling_vnfmodule_name_set(EVENT_SIGNALING * const event,
3621 const char * const module_name);
3622 /**************************************************************************//**
3623 * Set the Vendor module property of the Signaling event.
3625 * @note The property is treated as immutable: it is only valid to call
3626 * the setter once. However, we don't assert if the caller tries to
3627 * overwrite, just ignoring the update instead.
3629 * @param event Pointer to the Signaling event.
3630 * @param vnfname The Virtual Network function to be set. ASCIIZ string.
3631 * The caller does not need to preserve the value once
3632 * the function returns.
3633 *****************************************************************************/
3634 void evel_signaling_vnfname_set(EVENT_SIGNALING * const event,
3635 const char * const vnfname);
3637 /**************************************************************************//**
3638 * Set the Compressed SIP property of the Signaling event.
3640 * @note The property is treated as immutable: it is only valid to call
3641 * the setter once. However, we don't assert if the caller tries to
3642 * overwrite, just ignoring the update instead.
3644 * @param event Pointer to the Signaling event.
3645 * @param compressed_sip
3646 * The Compressed SIP to be set. ASCIIZ string. The caller
3647 * does not need to preserve the value once the function
3649 *****************************************************************************/
3650 void evel_signaling_compressed_sip_set(EVENT_SIGNALING * const event,
3651 const char * const compressed_sip);
3653 /**************************************************************************//**
3654 * Set the Summary SIP property of the Signaling event.
3656 * @note The property is treated as immutable: it is only valid to call
3657 * the setter once. However, we don't assert if the caller tries to
3658 * overwrite, just ignoring the update instead.
3660 * @param event Pointer to the Signaling event.
3661 * @param summary_sip The Summary SIP to be set. ASCIIZ string. The caller
3662 * does not need to preserve the value once the function
3664 *****************************************************************************/
3665 void evel_signaling_summary_sip_set(EVENT_SIGNALING * const event,
3666 const char * const summary_sip);
3669 /*****************************************************************************/
3670 /*****************************************************************************/
3674 /*****************************************************************************/
3675 /*****************************************************************************/
3677 /**************************************************************************//**
3678 * Create a new State Change event.
3680 * @note The mandatory fields on the Syslog must be supplied to this factory
3681 * function and are immutable once set. Optional fields have explicit
3682 * setter functions, but again values may only be set once so that the
3683 * Syslog has immutable properties.
3685 * @param event_name Unique Event Name
3686 * @param event_id A universal identifier of the event for analysis etc
3687 * @param new_state The new state of the reporting entity.
3688 * @param old_state The old state of the reporting entity.
3689 * @param interface The card or port name of the reporting entity.
3691 * @returns pointer to the newly manufactured ::EVENT_STATE_CHANGE. If the
3692 * event is not used it must be released using
3693 * ::evel_free_state_change
3694 * @retval NULL Failed to create the event.
3695 *****************************************************************************/
3696 EVENT_STATE_CHANGE * evel_new_state_change(const char* ev_name, const char *ev_id,
3697 const EVEL_ENTITY_STATE new_state,
3698 const EVEL_ENTITY_STATE old_state,
3699 const char * const interface);
3701 /**************************************************************************//**
3702 * Free a State Change.
3704 * Free off the State Change supplied. Will free all the contained allocated
3707 * @note It does not free the State Change itself, since that may be part of a
3709 *****************************************************************************/
3710 void evel_free_state_change(EVENT_STATE_CHANGE * const state_change);
3712 /**************************************************************************//**
3713 * Set the Event Type property of the State Change.
3715 * @note The property is treated as immutable: it is only valid to call
3716 * the setter once. However, we don't assert if the caller tries to
3717 * overwrite, just ignoring the update instead.
3719 * @param state_change Pointer to the ::EVENT_STATE_CHANGE.
3720 * @param type The Event Type to be set. ASCIIZ string. The caller
3721 * does not need to preserve the value once the function
3723 *****************************************************************************/
3724 void evel_state_change_type_set(EVENT_STATE_CHANGE * const state_change,
3725 const char * const type);
3727 /**************************************************************************//**
3728 * Add an additional field name/value pair to the State Change.
3730 * The name and value are null delimited ASCII strings. The library takes
3731 * a copy so the caller does not have to preserve values after the function
3734 * @param state_change Pointer to the ::EVENT_STATE_CHANGE.
3735 * @param name ASCIIZ string with the attribute's name. The caller
3736 * does not need to preserve the value once the function
3738 * @param value ASCIIZ string with the attribute's value. The caller
3739 * does not need to preserve the value once the function
3741 *****************************************************************************/
3742 void evel_state_change_addl_field_add(EVENT_STATE_CHANGE * const state_change,
3743 const char * const name,
3744 const char * const value);
3746 /*****************************************************************************/
3747 /*****************************************************************************/
3751 /*****************************************************************************/
3752 /*****************************************************************************/
3754 /**************************************************************************//**
3755 * Create a new syslog event.
3757 * @note The mandatory fields on the Syslog must be supplied to this factory
3758 * function and are immutable once set. Optional fields have explicit
3759 * setter functions, but again values may only be set once so that the
3760 * Syslog has immutable properties.
3762 * @param event_name Unique Event Name
3763 * @param event_id A universal identifier of the event for analysis etc
3764 * @param event_source_type
3769 * @returns pointer to the newly manufactured ::EVENT_SYSLOG. If the event is
3770 * not used it must be released using ::evel_free_syslog
3771 * @retval NULL Failed to create the event.
3772 *****************************************************************************/
3773 EVENT_SYSLOG * evel_new_syslog(const char* ev_name, const char *ev_id,
3774 EVEL_SOURCE_TYPES event_source_type,
3775 const char * const syslog_msg,
3776 const char * const syslog_tag);
3778 /**************************************************************************//**
3779 * Set the Event Type property of the Syslog.
3781 * @note The property is treated as immutable: it is only valid to call
3782 * the setter once. However, we don't assert if the caller tries to
3783 * overwrite, just ignoring the update instead.
3785 * @param syslog Pointer to the syslog.
3786 * @param type The Event Type to be set. ASCIIZ string. The caller
3787 * does not need to preserve the value once the function
3789 *****************************************************************************/
3790 void evel_syslog_type_set(EVENT_SYSLOG * syslog,
3791 const char * const type);
3793 /**************************************************************************//**
3796 * Free off the Syslog supplied. Will free all the contained allocated memory.
3798 * @note It does not free the Syslog itself, since that may be part of a
3800 *****************************************************************************/
3801 void evel_free_syslog(EVENT_SYSLOG * event);
3803 /**************************************************************************//**
3804 * Add an additional field name/value pair to the Syslog.
3806 * The name and value are null delimited ASCII strings. The library takes
3807 * a copy so the caller does not have to preserve values after the function
3810 * @param syslog Pointer to the syslog.
3811 * @param name ASCIIZ string with the attribute's name. The caller
3812 * does not need to preserve the value once the function
3814 * @param value ASCIIZ string with the attribute's value. The caller
3815 * does not need to preserve the value once the function
3817 *****************************************************************************/
3818 void evel_syslog_addl_field_add(EVENT_SYSLOG * syslog,
3822 /**************************************************************************//**
3823 * Set the Event Source Host property of the Syslog.
3825 * @note The property is treated as immutable: it is only valid to call
3826 * the setter once. However, we don't assert if the caller tries to
3827 * overwrite, just ignoring the update instead.
3829 * @param syslog Pointer to the Syslog.
3830 * @param host The Event Source Host to be set. ASCIIZ string. The
3831 * caller does not need to preserve the value once the
3833 *****************************************************************************/
3834 void evel_syslog_event_source_host_set(EVENT_SYSLOG * syslog,
3835 const char * const host);
3837 /**************************************************************************//**
3838 * Set the Syslog Facility property of the Syslog.
3840 * @note The property is treated as immutable: it is only valid to call
3841 * the setter once. However, we don't assert if the caller tries to
3842 * overwrite, just ignoring the update instead.
3844 * @param syslog Pointer to the Syslog.
3845 * @param facility The Syslog Facility to be set. ASCIIZ string. The caller
3846 * does not need to preserve the value once the function
3848 *****************************************************************************/
3849 void evel_syslog_facility_set(EVENT_SYSLOG * syslog,
3850 EVEL_SYSLOG_FACILITIES facility);
3852 /**************************************************************************//**
3853 * Set the Process property of the Syslog.
3855 * @note The property is treated as immutable: it is only valid to call
3856 * the setter once. However, we don't assert if the caller tries to
3857 * overwrite, just ignoring the update instead.
3859 * @param syslog Pointer to the Syslog.
3860 * @param proc The Process to be set. ASCIIZ string. The caller does
3861 * not need to preserve the value once the function returns.
3862 *****************************************************************************/
3863 void evel_syslog_proc_set(EVENT_SYSLOG * syslog, const char * const proc);
3865 /**************************************************************************//**
3866 * Set the Process ID property of the Syslog.
3868 * @note The property is treated as immutable: it is only valid to call
3869 * the setter once. However, we don't assert if the caller tries to
3870 * overwrite, just ignoring the update instead.
3872 * @param syslog Pointer to the Syslog.
3873 * @param proc_id The Process ID to be set.
3874 *****************************************************************************/
3875 void evel_syslog_proc_id_set(EVENT_SYSLOG * syslog, int proc_id);
3877 /**************************************************************************//**
3878 * Set the Version property of the Syslog.
3880 * @note The property is treated as immutable: it is only valid to call
3881 * the setter once. However, we don't assert if the caller tries to
3882 * overwrite, just ignoring the update instead.
3884 * @param syslog Pointer to the Syslog.
3885 * @param version The Version to be set.
3886 *****************************************************************************/
3887 void evel_syslog_version_set(EVENT_SYSLOG * syslog, int version);
3889 /**************************************************************************//**
3890 * Set the Structured Data property of the Syslog.
3892 * @note The property is treated as immutable: it is only valid to call
3893 * the setter once. However, we don't assert if the caller tries to
3894 * overwrite, just ignoring the update instead.
3896 * @param syslog Pointer to the Syslog.
3897 * @param s_data The Structured Data to be set. ASCIIZ string. The caller
3898 * does not need to preserve the value once the function
3900 *****************************************************************************/
3901 void evel_syslog_s_data_set(EVENT_SYSLOG * syslog, const char * const s_data);
3903 /**************************************************************************//**
3904 * Set the Structured SDID property of the Syslog.
3906 * @note The property is treated as immutable: it is only valid to call
3907 * the setter once. However, we don't assert if the caller tries to
3908 * overwrite, just ignoring the update instead.
3910 * @param syslog Pointer to the Syslog.
3911 * @param sdid The Structured Data to be set. ASCIIZ string. name@number
3912 * Caller does not need to preserve the value once the function
3914 *****************************************************************************/
3915 void evel_syslog_sdid_set(EVENT_SYSLOG * syslog, const char * const sdid);
3917 /**************************************************************************//**
3918 * Set the Structured Severity property of the Syslog.
3920 * @note The property is treated as immutable: it is only valid to call
3921 * the setter once. However, we don't assert if the caller tries to
3922 * overwrite, just ignoring the update instead.
3924 * @param syslog Pointer to the Syslog.
3925 * @param sdid The Structured Data to be set. ASCIIZ string.
3926 * Caller does not need to preserve the value once the function
3928 *****************************************************************************/
3929 void evel_syslog_severity_set(EVENT_SYSLOG * syslog, const char * const severty);
3932 /*****************************************************************************/
3933 /*****************************************************************************/
3937 /*****************************************************************************/
3938 /*****************************************************************************/
3940 /**************************************************************************//**
3941 * Create a new other event.
3943 * @param event_name Unique Event Name
3944 * @param event_id A universal identifier of the event for analysis etc
3946 * @returns pointer to the newly manufactured ::EVENT_OTHER. If the event is
3947 * not used it must be released using ::evel_free_other.
3948 * @retval NULL Failed to create the event.
3949 *****************************************************************************/
3950 EVENT_OTHER * evel_new_other(const char* ev_name, const char *ev_id);
3952 /**************************************************************************//**
3955 * Free off the Other supplied. Will free all the contained allocated memory.
3957 * @note It does not free the Other itself, since that may be part of a
3959 *****************************************************************************/
3960 void evel_free_other(EVENT_OTHER * event);
3962 /**************************************************************************//**
3963 * Set the Event Type property of the Other.
3965 * @note The property is treated as immutable: it is only valid to call
3966 * the setter once. However, we don't assert if the caller tries to
3967 * overwrite, just ignoring the update instead.
3969 * @param other Pointer to the Other.
3970 * @param type The Event Type to be set. ASCIIZ string. The caller
3971 * does not need to preserve the value once the function
3973 *****************************************************************************/
3974 void evel_other_type_set(EVENT_OTHER * other,
3975 const char * const type);
3977 /**************************************************************************//**
3978 * Add a value name/value pair to the Other.
3980 * The name and value are null delimited ASCII strings. The library takes
3981 * a copy so the caller does not have to preserve values after the function
3984 * @param other Pointer to the Other.
3985 * @param name ASCIIZ string with the attribute's name.
3986 * @param value ASCIIZ string with the attribute's value.
3987 *****************************************************************************/
3988 void evel_other_field_add(EVENT_OTHER * other,
3992 /*****************************************************************************/
3993 /*****************************************************************************/
3997 /*****************************************************************************/
3998 /*****************************************************************************/
4000 /**************************************************************************//**
4001 * Return the current measurement interval provided by the Event Listener.
4003 * @returns The current measurement interval
4004 * @retval EVEL_MEASUREMENT_INTERVAL_UKNOWN (0) - interval has not been
4006 *****************************************************************************/
4007 int evel_get_measurement_interval();
4009 /*****************************************************************************/
4010 /* Supported Report version. */
4011 /*****************************************************************************/
4012 #define EVEL_VOICEQ_MAJOR_VERSION 1
4013 #define EVEL_VOICEQ_MINOR_VERSION 1
4015 /**************************************************************************//**
4016 * End of Call Voice Quality Metrices
4017 * JSON equivalent field: endOfCallVqmSummaries
4018 *****************************************************************************/
4019 typedef struct end_of_call_vqm_summaries {
4020 /***************************************************************************/
4021 /* Mandatory fields */
4022 /***************************************************************************/
4023 char* adjacencyName;
4024 char* endpointDescription;
4026 /***************************************************************************/
4027 /* Optional fields */
4028 /***************************************************************************/
4029 EVEL_OPTION_INT endpointJitter;
4030 EVEL_OPTION_INT endpointRtpOctetsDiscarded;
4031 EVEL_OPTION_INT endpointRtpOctetsReceived;
4032 EVEL_OPTION_INT endpointRtpOctetsSent;
4033 EVEL_OPTION_INT endpointRtpPacketsDiscarded;
4034 EVEL_OPTION_INT endpointRtpPacketsReceived;
4035 EVEL_OPTION_INT endpointRtpPacketsSent;
4036 EVEL_OPTION_INT localJitter;
4037 EVEL_OPTION_INT localRtpOctetsDiscarded;
4038 EVEL_OPTION_INT localRtpOctetsReceived;
4039 EVEL_OPTION_INT localRtpOctetsSent;
4040 EVEL_OPTION_INT localRtpPacketsDiscarded;
4041 EVEL_OPTION_INT localRtpPacketsReceived;
4042 EVEL_OPTION_INT localRtpPacketsSent;
4043 EVEL_OPTION_INT mosCqe;
4044 EVEL_OPTION_INT packetsLost;
4045 EVEL_OPTION_INT packetLossPercent;
4046 EVEL_OPTION_INT rFactor;
4047 EVEL_OPTION_INT roundTripDelay;
4049 } END_OF_CALL_VOICE_QUALITY_METRICS;
4051 /**************************************************************************//**
4053 * JSON equivalent field: voiceQualityFields
4054 *****************************************************************************/
4056 typedef struct event_voiceQuality {
4057 /***************************************************************************/
4058 /* Header and version */
4059 /***************************************************************************/
4060 EVENT_HEADER header;
4064 /***************************************************************************/
4065 /* Mandatory fields */
4066 /***************************************************************************/
4068 char *calleeSideCodec;
4069 char *callerSideCodec;
4072 VENDOR_VNFNAME_FIELD vendorVnfNameFields;
4073 END_OF_CALL_VOICE_QUALITY_METRICS *endOfCallVqmSummaries;
4075 /***************************************************************************/
4076 /* Optional fields */
4077 /***************************************************************************/
4078 EVEL_OPTION_STRING phoneNumber;
4079 DLIST additionalInformation;
4081 } EVENT_VOICE_QUALITY;
4082 /**************************************************************************//**
4083 * Voice Quality Additional Info.
4084 * JSON equivalent field: additionalInformation
4085 *****************************************************************************/
4086 typedef struct voice_quality_additional_info {
4089 } VOICE_QUALITY_ADDL_INFO;
4091 /**************************************************************************//**
4092 * Create a new voice quality event.
4094 * @note The mandatory fields on the Voice Quality must be supplied to this
4095 * factory function and are immutable once set. Optional fields have
4096 * explicit setter functions, but again values may only be set once
4097 * so that the Voice Quality has immutable properties.
4098 * @param event_name Unique Event Name
4099 * @param event_id A universal identifier of the event for analysis etc
4100 * @param calleeSideCodec Callee codec for the call.
4101 * @param callerSideCodec Caller codec for the call.
4102 * @param correlator Constant across all events on this call.
4103 * @param midCallRtcp Base64 encoding of the binary RTCP data
4104 * (excluding Eth/IP/UDP headers).
4105 * @param vendorVnfNameFields Vendor, VNF and VfModule names.
4106 * @returns pointer to the newly manufactured ::EVENT_VOICE_QUALITY. If the
4107 * event is not used (i.e. posted) it must be released using
4108 ::evel_free_voice_quality.
4109 * @retval NULL Failed to create the event.
4110 *****************************************************************************/
4111 EVENT_VOICE_QUALITY * evel_new_voice_quality(const char* ev_name, const char *ev_id,
4112 const char * const calleeSideCodec,
4113 const char * const callerSideCodec, const char * const correlator,
4114 const char * const midCallRtcp, const char * const vendorVnfNameFields);
4116 /**************************************************************************//**
4117 * Set the Callee side codec for Call for domain Voice Quality
4119 * @note The property is treated as immutable: it is only valid to call
4120 * the setter once. However, we don't assert if the caller tries to
4121 * overwrite, just ignoring the update instead.
4123 * @param voiceQuality Pointer to the Voice Quality Event.
4124 * @param calleeCodecForCall The Callee Side Codec to be set. ASCIIZ
4125 * string. The caller does not need to
4126 * preserve the value once the function
4128 *****************************************************************************/
4129 void evel_voice_quality_callee_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
4130 const char * const calleeCodecForCall);
4132 /**************************************************************************//**
4133 * Set the Caller side codec for Call for domain Voice Quality
4135 * @note The property is treated as immutable: it is only valid to call
4136 * the setter once. However, we don't assert if the caller tries to
4137 * overwrite, just ignoring the update instead.
4139 * @param voiceQuality Pointer to the Voice Quality Event.
4140 * @param callerCodecForCall The Caller Side Codec to be set. ASCIIZ
4141 * string. The caller does not need to
4142 * preserve the value once the function
4144 *****************************************************************************/
4145 void evel_voice_quality_caller_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
4146 const char * const callerCodecForCall);
4148 /**************************************************************************//**
4149 * Set the correlator for domain Voice Quality
4151 * @note The property is treated as immutable: it is only valid to call
4152 * the setter once. However, we don't assert if the caller tries to
4153 * overwrite, just ignoring the update instead.
4155 * @param voiceQuality Pointer to the Voice Quality Event.
4156 * @param correlator The correlator value to be set. ASCIIZ
4157 * string. The caller does not need to
4158 * preserve the value once the function
4160 *****************************************************************************/
4161 void evel_voice_quality_correlator_set(EVENT_VOICE_QUALITY * voiceQuality,
4162 const char * const vCorrelator);
4164 /**************************************************************************//**
4165 * Set the RTCP Call Data for domain Voice Quality
4167 * @note The property is treated as immutable: it is only valid to call
4168 * the setter once. However, we don't assert if the caller tries to
4169 * overwrite, just ignoring the update instead.
4171 * @param voiceQuality Pointer to the Voice Quality Event.
4172 * @param rtcpCallData The RTCP Call Data to be set. ASCIIZ
4173 * string. The caller does not need to
4174 * preserve the value once the function
4176 *****************************************************************************/
4177 void evel_voice_quality_rtcp_data_set(EVENT_VOICE_QUALITY * voiceQuality,
4178 const char * const rtcpCallData);
4180 /**************************************************************************//**
4181 * Set the Vendor VNF Name fields for domain Voice Quality
4183 * @note The property is treated as immutable: it is only valid to call
4184 * the setter once. However, we don't assert if the caller tries to
4185 * overwrite, just ignoring the update instead.
4187 * @param voiceQuality Pointer to the Voice Quality Event.
4188 * @param nameFields The Vendor, VNF and VfModule names to be set.
4189 * ASCIIZ string. The caller does not need to
4190 * preserve the value once the function
4192 *****************************************************************************/
4193 void evel_voice_quality_name_fields_set(EVENT_VOICE_QUALITY * voiceQuality,
4194 const char * const nameFields);
4196 /**************************************************************************//**
4197 * Add an End of Call Voice Quality Metrices
4199 * The adjacencyName and endpointDescription is null delimited ASCII string.
4200 * The library takes a copy so the caller does not have to preserve values
4201 * after the function returns.
4203 * @param voiceQuality Pointer to the measurement.
4204 * @param adjacencyName Adjacency name
4205 * @param endpointDescription Enumeration: ‘Caller’, ‘Callee’.
4206 * @param endpointJitter Endpoint jitter
4207 * @param endpointRtpOctetsDiscarded Endpoint RTP octets discarded.
4208 * @param endpointRtpOctetsReceived Endpoint RTP octets received.
4209 * @param endpointRtpOctetsSent Endpoint RTP octets sent
4210 * @param endpointRtpPacketsDiscarded Endpoint RTP packets discarded.
4211 * @param endpointRtpPacketsReceived Endpoint RTP packets received.
4212 * @param endpointRtpPacketsSent Endpoint RTP packets sent.
4213 * @param localJitter Local jitter.
4214 * @param localRtpOctetsDiscarded Local RTP octets discarded.
4215 * @param localRtpOctetsReceived Local RTP octets received.
4216 * @param localRtpOctetsSent Local RTP octets sent.
4217 * @param localRtpPacketsDiscarded Local RTP packets discarded.
4218 * @param localRtpPacketsReceived Local RTP packets received.
4219 * @param localRtpPacketsSent Local RTP packets sent.
4220 * @param mosCqe Decimal range from 1 to 5
4222 * @param packetsLost No Packets lost
4223 * @param packetLossPercent Calculated percentage packet loss
4224 * @param rFactor rFactor from 0 to 100
4225 * @param roundTripDelay Round trip delay in milliseconds
4226 *****************************************************************************/
4227 void evel_voice_quality_end_metrics_add(EVENT_VOICE_QUALITY * voiceQuality,
4228 const char * adjacencyName, EVEL_SERVICE_ENDPOINT_DESC endpointDescription,
4230 int endpointRtpOctetsDiscarded,
4231 int endpointRtpOctetsReceived,
4232 int endpointRtpOctetsSent,
4233 int endpointRtpPacketsDiscarded,
4234 int endpointRtpPacketsReceived,
4235 int endpointRtpPacketsSent,
4237 int localRtpOctetsDiscarded,
4238 int localRtpOctetsReceived,
4239 int localRtpOctetsSent,
4240 int localRtpPacketsDiscarded,
4241 int localRtpPacketsReceived,
4242 int localRtpPacketsSent,
4245 int packetLossPercent,
4247 int roundTripDelay);
4249 /**************************************************************************//**
4250 * Free a Voice Quality.
4252 * Free off the Voce Quality supplied. Will free all the contained allocated
4255 * @note It does not free the Voice Quality itself, since that may be part of a
4257 *****************************************************************************/
4258 void evel_free_voice_quality(EVENT_VOICE_QUALITY * voiceQuality);
4260 /**************************************************************************//**
4261 * Add an additional value name/value pair to the Voice Quality.
4263 * The name and value are null delimited ASCII strings. The library takes
4264 * a copy so the caller does not have to preserve values after the function
4267 * @param fault Pointer to the fault.
4268 * @param name ASCIIZ string with the attribute's name. The caller
4269 * does not need to preserve the value once the function
4271 * @param value ASCIIZ string with the attribute's value. The caller
4272 * does not need to preserve the value once the function
4274 *****************************************************************************/
4275 void evel_voice_quality_addl_info_add(EVENT_VOICE_QUALITY * voiceQuality, char * name, char * value);
4278 /*****************************************************************************/
4279 /*****************************************************************************/
4281 /* THRESHOLD CROSSING ALERT */
4283 /*****************************************************************************/
4284 /*****************************************************************************/
4286 typedef enum evel_event_action {
4287 EVEL_EVENT_ACTION_CLEAR,
4288 EVEL_EVENT_ACTION_CONTINUE,
4289 EVEL_EVENT_ACTION_SET,
4290 EVEL_MAX_EVENT_ACTION
4293 typedef enum evel_alert_type {
4295 EVEL_ELEMENT_ANOMALY,
4296 EVEL_INTERFACE_ANOMALY,
4297 EVEL_SERVICE_ANOMALY,
4302 typedef struct perf_counter {
4305 char * thresholdCrossed;
4310 /*****************************************************************************/
4311 /* Supported Threshold Crossing version. */
4312 /*****************************************************************************/
4313 #define EVEL_THRESHOLD_CROSS_MAJOR_VERSION 2
4314 #define EVEL_THRESHOLD_CROSS_MINOR_VERSION 0
4316 /**************************************************************************//**
4317 * Threshold Crossing.
4318 * JSON equivalent field: Threshold Cross Fields
4319 *****************************************************************************/
4320 typedef struct event_threshold_cross {
4321 /***************************************************************************/
4322 /* Header and version */
4323 /***************************************************************************/
4324 EVENT_HEADER header;
4328 /***************************************************************************/
4329 /* Mandatory fields */
4330 /***************************************************************************/
4331 PERF_COUNTER additionalParameters;
4332 EVEL_EVENT_ACTION alertAction;
4333 char * alertDescription;
4334 EVEL_ALERT_TYPE alertType;
4335 unsigned long long collectionTimestamp;
4336 EVEL_SEVERITIES eventSeverity;
4337 unsigned long long eventStartTimestamp;
4339 /***************************************************************************/
4340 /* Optional fields */
4341 /***************************************************************************/
4342 DLIST additional_info;
4343 EVEL_OPTION_STRING alertValue;
4345 EVEL_OPTION_STRING dataCollector;
4346 EVEL_OPTION_STRING elementType;
4347 EVEL_OPTION_STRING interfaceName;
4348 EVEL_OPTION_STRING networkService;
4349 EVEL_OPTION_STRING possibleRootCause;
4351 } EVENT_THRESHOLD_CROSS;
4354 /**************************************************************************//**
4355 * Create a new Threshold Crossing Alert event.
4357 * @note The mandatory fields on the TCA must be supplied to this factory
4358 * function and are immutable once set. Optional fields have explicit
4359 * setter functions, but again values may only be set once so that the
4360 * TCA has immutable properties.
4362 * @param event_name Unique Event Name
4363 * @param event_id A universal identifier of the event for analysis etc
4364 * @param char* tcriticality Performance Counter Criticality MAJ MIN,
4365 * @param char* tname Performance Counter Threshold name
4366 * @param char* tthresholdCrossed Counter Threshold crossed value
4367 * @param char* tvalue Counter actual value
4368 * @param EVEL_EVENT_ACTION talertAction Alert set continue or clear
4369 * @param char* talertDescription
4370 * @param EVEL_ALERT_TYPE talertType Kind of anamoly
4371 * @param unsigned long long tcollectionTimestamp time at which alert was collected
4372 * @param EVEL_SEVERITIES teventSeverity Severity of Alert
4373 * @param unsigned long long teventStartTimestamp Time when this alert started
4375 * @returns pointer to the newly manufactured ::EVENT_THRESHOLD_CROSS. If the
4376 * event is not used it must be released using
4377 * ::evel_free_threshold_cross
4378 * @retval NULL Failed to create the event.
4379 *****************************************************************************/
4380 EVENT_THRESHOLD_CROSS * evel_new_threshold_cross(
4381 const char* ev_name, const char *ev_id,
4382 char * tcriticality,
4384 char * tthresholdCrossed,
4386 EVEL_EVENT_ACTION talertAction,
4387 char * talertDescription,
4388 EVEL_ALERT_TYPE talertType,
4389 unsigned long long tcollectionTimestamp,
4390 EVEL_SEVERITIES teventSeverity,
4391 unsigned long long teventStartTimestamp);
4393 /**************************************************************************//**
4394 * Free a Threshold cross event.
4396 * Free off the Threshold crossing event supplied. Will free all the contained allocated
4399 * @note It does not free the Threshold Cross itself, since that may be part of a
4401 *****************************************************************************/
4402 void evel_free_threshold_cross(EVENT_THRESHOLD_CROSS * const tcp);
4404 /**************************************************************************//**
4405 * Set the Event Type property of the Threshold Cross.
4407 * @note The property is treated as immutable: it is only valid to call
4408 * the setter once. However, we don't assert if the caller tries to
4409 * overwrite, just ignoring the update instead.
4411 * @param tcp Pointer to the ::EVENT_THRESHOLD_CROSS.
4412 * @param type The Event Type to be set. ASCIIZ string. The caller
4413 * does not need to preserve the value once the function
4415 *****************************************************************************/
4416 void evel_threshold_cross_type_set(EVENT_THRESHOLD_CROSS * const tcp, char * type);
4418 /**************************************************************************//**
4419 * Add an optional additional alertid value to Alert.
4421 * @param alertid Adds Alert ID
4422 *****************************************************************************/
4423 void evel_threshold_cross_alertid_add(EVENT_THRESHOLD_CROSS * const event,char * alertid);
4425 /**************************************************************************//**
4426 * Set the TCA probable Root cause.
4428 * @param sheader Possible root cause to Threshold
4429 *****************************************************************************/
4430 void evel_threshold_cross_possible_rootcause_set(EVENT_THRESHOLD_CROSS * const event, char * sheader);
4431 /**************************************************************************//**
4432 * Set the TCA networking cause.
4434 * @param sheader Possible networking service value to Threshold
4435 *****************************************************************************/
4436 void evel_threshold_cross_networkservice_set(EVENT_THRESHOLD_CROSS * const event, char * sheader);
4437 /**************************************************************************//**
4438 * Set the TCA Interface name.
4440 * @param sheader Interface name to threshold
4441 *****************************************************************************/
4442 void evel_threshold_cross_interfacename_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4443 /**************************************************************************//**
4444 * Set the TCA Data element type.
4446 * @param sheader element type of Threshold
4447 *****************************************************************************/
4448 void evel_threshold_cross_data_elementtype_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4449 /**************************************************************************//**
4450 * Set the TCA Data collector value.
4452 * @param sheader Data collector value
4453 *****************************************************************************/
4454 void evel_threshold_cross_data_collector_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4455 /**************************************************************************//**
4456 * Set the TCA alert value.
4458 * @param sheader Possible alert value
4459 *****************************************************************************/
4460 void evel_threshold_cross_alertvalue_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4462 /**************************************************************************//**
4463 * Add an additional field name/value pair to the THRESHOLD CROSS event.
4465 * The name and value are null delimited ASCII strings. The library takes
4466 * a copy so the caller does not have to preserve values after the function
4469 * @param state_change Pointer to the ::EVENT_THRESHOLD_CROSS.
4470 * @param name ASCIIZ string with the attribute's name. The caller
4471 * does not need to preserve the value once the function
4473 * @param value ASCIIZ string with the attribute's value. The caller
4474 * does not need to preserve the value once the function
4476 *****************************************************************************/
4477 void evel_threshold_cross_addl_info_add(EVENT_THRESHOLD_CROSS * const tcp,
4478 const char * const name,
4479 const char * const value);
4481 /*****************************************************************************/
4482 /*****************************************************************************/
4486 /*****************************************************************************/
4487 /*****************************************************************************/
4489 /*****************************************************************************/
4491 /*****************************************************************************/
4492 #define EVEL_DEBUG(FMT, ...) log_debug(EVEL_LOG_DEBUG, (FMT), ##__VA_ARGS__)
4493 #define EVEL_INFO(FMT, ...) log_debug(EVEL_LOG_INFO, (FMT), ##__VA_ARGS__)
4494 #define EVEL_SPAMMY(FMT, ...) log_debug(EVEL_LOG_SPAMMY, (FMT), ##__VA_ARGS__)
4495 #define EVEL_ERROR(FMT, ...) log_debug(EVEL_LOG_ERROR, "ERROR: " FMT, \
4497 #define EVEL_ENTER() \
4499 log_debug(EVEL_LOG_DEBUG, "Enter %s {", __FUNCTION__); \
4500 debug_indent += 2; \
4502 #define EVEL_EXIT() \
4504 debug_indent -= 2; \
4505 log_debug(EVEL_LOG_DEBUG, "Exit %s }", __FUNCTION__); \
4508 #define INDENT_SEPARATORS \
4509 "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "
4511 extern EVEL_LOG_LEVELS debug_level;
4512 extern int debug_indent;
4515 #define EVEL_DEBUG_ON() ((debug_level) >= EVEL_LOG_DEBUG)
4517 /**************************************************************************//**
4518 * Initialize logging
4520 * @param[in] level The debugging level - one of ::EVEL_LOG_LEVELS.
4521 * @param[in] ident The identifier for our logs.
4522 *****************************************************************************/
4523 void log_initialize(EVEL_LOG_LEVELS level, const char * ident);
4525 /**************************************************************************//**
4526 * Log debug information
4528 * Logs debugging information in a platform independent manner.
4530 * @param[in] level The debugging level - one of ::EVEL_LOG_LEVELS.
4531 * @param[in] format Log formatting string in printf format.
4532 * @param[in] ... Variable argument list.
4533 *****************************************************************************/
4534 void log_debug(EVEL_LOG_LEVELS level, char * format, ...);
4536 /***************************************************************************//*
4537 * Store the formatted string into the static error string and log the error.
4539 * @param format Error string in standard printf format.
4540 * @param ... Variable parameters to be substituted into the format string.
4541 *****************************************************************************/
4542 void log_error_state(char * format, ...);