3 /*************************************************************************//**
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 ****************************************************************************/
20 /**************************************************************************//**
22 * Header for EVEL library
24 * This file implements the EVEL library which is intended to provide a
25 * simple wrapper around the complexity of AT&T's Vendor Event Listener API so
26 * that VNFs can use it without worrying about details of the API transport.
28 * Zero return value is success (::EVEL_SUCCESS), non-zero is failure and will
29 * be one of ::EVEL_ERR_CODES.
30 *****************************************************************************/
42 #include "double_list.h"
43 #include "hashtable.h"
45 /*****************************************************************************/
46 /* Supported API version. */
47 /*****************************************************************************/
48 #define EVEL_API_MAJOR_VERSION 5
49 #define EVEL_API_MINOR_VERSION 3
51 /**************************************************************************//**
54 * Error codes for EVEL low level interface
55 *****************************************************************************/
57 EVEL_SUCCESS, /** The operation was successful. */
58 EVEL_ERR_GEN_FAIL, /** Non-specific failure. */
59 EVEL_CURL_LIBRARY_FAIL, /** A cURL library operation failed. */
60 EVEL_PTHREAD_LIBRARY_FAIL, /** A Posix threads operation failed. */
61 EVEL_OUT_OF_MEMORY, /** A memory allocation failure occurred. */
62 EVEL_EVENT_BUFFER_FULL, /** Too many events in the ring-buffer. */
63 EVEL_EVENT_HANDLER_INACTIVE, /** Attempt to raise event when inactive. */
64 EVEL_NO_METADATA, /** Failed to retrieve OpenStack metadata. */
65 EVEL_BAD_METADATA, /** OpenStack metadata invalid format. */
66 EVEL_BAD_JSON_FORMAT, /** JSON failed to parse correctly. */
67 EVEL_JSON_KEY_NOT_FOUND, /** Failed to find the specified JSON key. */
68 EVEL_MAX_ERROR_CODES /** Maximum number of valid error codes. */
71 /**************************************************************************//**
74 * Variable levels of verbosity in the logging functions.
75 *****************************************************************************/
85 /*****************************************************************************/
86 /* Maximum string lengths. */
87 /*****************************************************************************/
88 #define EVEL_MAX_STRING_LEN 4096
89 #define EVEL_MAX_JSON_BODY 16000
90 #define EVEL_MAX_ERROR_STRING_LEN 255
91 #define EVEL_MAX_URL_LEN 511
93 /**************************************************************************//**
94 * This value represents there being no restriction on the reporting interval.
95 *****************************************************************************/
96 static const int EVEL_MEASUREMENT_INTERVAL_UKNOWN = 0;
98 /**************************************************************************//**
99 * How many events can be backed-up before we start dropping events on the
102 * @note This value should be tuned in accordance with expected burstiness of
103 * the event load and the expected response time of the ECOMP event
104 * listener so that the probability of the buffer filling is suitably
106 *****************************************************************************/
107 static const int EVEL_EVENT_BUFFER_DEPTH = 100;
109 /*****************************************************************************/
110 /* How many different IP Types-of-Service are supported. */
111 /*****************************************************************************/
112 #define EVEL_TOS_SUPPORTED 256
114 /**************************************************************************//**
115 * Event domains for the various events we support.
116 * JSON equivalent field: domain
117 *****************************************************************************/
119 EVEL_DOMAIN_INTERNAL, /** Internal event, not for external routing. */
120 EVEL_DOMAIN_HEARTBEAT, /** A Heartbeat event (event header only). */
121 EVEL_DOMAIN_FAULT, /** A Fault event. */
122 EVEL_DOMAIN_MEASUREMENT, /** A Measurement for VF Scaling event. */
123 EVEL_DOMAIN_MOBILE_FLOW, /** A Mobile Flow event. */
124 EVEL_DOMAIN_REPORT, /** A Measurement for VF Reporting event. */
125 EVEL_DOMAIN_HEARTBEAT_FIELD,/** A Heartbeat field event. */
126 EVEL_DOMAIN_SIPSIGNALING, /** A Signaling event. */
127 EVEL_DOMAIN_STATE_CHANGE, /** A State Change event. */
128 EVEL_DOMAIN_SYSLOG, /** A Syslog event. */
129 EVEL_DOMAIN_OTHER, /** Another event. */
130 EVEL_DOMAIN_THRESHOLD_CROSS, /** A Threshold Crossing Event */
131 EVEL_DOMAIN_VOICE_QUALITY, /** A Voice Quality Event */
132 EVEL_MAX_DOMAINS /** Maximum number of recognized Event types. */
133 } EVEL_EVENT_DOMAINS;
135 /**************************************************************************//**
137 * JSON equivalent field: priority
138 *****************************************************************************/
141 EVEL_PRIORITY_MEDIUM,
142 EVEL_PRIORITY_NORMAL,
145 } EVEL_EVENT_PRIORITIES;
147 /**************************************************************************//**
148 * Fault / Threshold severities.
149 * JSON equivalent field: eventSeverity
150 *****************************************************************************/
152 EVEL_SEVERITY_CRITICAL,
155 EVEL_SEVERITY_WARNING,
156 EVEL_SEVERITY_NORMAL,
160 /**************************************************************************//**
161 * Fault source types.
162 * JSON equivalent field: eventSourceType
163 *****************************************************************************/
171 EVEL_SOURCE_SLOT_THRESHOLD,
172 EVEL_SOURCE_PORT_THRESHOLD,
173 EVEL_SOURCE_VIRTUAL_MACHINE,
174 EVEL_SOURCE_VIRTUAL_NETWORK_FUNCTION,
175 /***************************************************************************/
176 /* START OF VENDOR-SPECIFIC VALUES */
178 /* Vendor-specific values should be added here, and handled appropriately */
179 /* in evel_event.c. */
180 /***************************************************************************/
182 /***************************************************************************/
183 /* END OF VENDOR-SPECIFIC VALUES */
184 /***************************************************************************/
185 EVEL_MAX_SOURCE_TYPES
188 /**************************************************************************//**
190 * JSON equivalent field: vfStatus
191 *****************************************************************************/
193 EVEL_VF_STATUS_ACTIVE,
195 EVEL_VF_STATUS_PREP_TERMINATE,
196 EVEL_VF_STATUS_READY_TERMINATE,
197 EVEL_VF_STATUS_REQ_TERMINATE,
201 /**************************************************************************//**
202 * Counter criticalities.
203 * JSON equivalent field: criticality
204 *****************************************************************************/
206 EVEL_COUNTER_CRITICALITY_CRIT,
207 EVEL_COUNTER_CRITICALITY_MAJ,
208 EVEL_MAX_COUNTER_CRITICALITIES
209 } EVEL_COUNTER_CRITICALITIES;
211 /**************************************************************************//**
213 * JSON equivalent field: alertAction
214 *****************************************************************************/
216 EVEL_ALERT_ACTION_CLEAR,
217 EVEL_ALERT_ACTION_CONT,
218 EVEL_ALERT_ACTION_SET,
219 EVEL_MAX_ALERT_ACTIONS
220 } EVEL_ALERT_ACTIONS;
222 /**************************************************************************//**
224 * JSON equivalent field: alertType
225 *****************************************************************************/
227 EVEL_ALERT_TYPE_CARD,
228 EVEL_ALERT_TYPE_ELEMENT,
229 EVEL_ALERT_TYPE_INTERFACE,
230 EVEL_ALERT_TYPE_SERVICE,
234 /**************************************************************************//**
236 * JSON equivalent fields: newState, oldState
237 *****************************************************************************/
239 EVEL_ENTITY_STATE_IN_SERVICE,
240 EVEL_ENTITY_STATE_MAINTENANCE,
241 EVEL_ENTITY_STATE_OUT_OF_SERVICE,
242 EVEL_MAX_ENTITY_STATES
245 /**************************************************************************//**
247 * JSON equivalent field: syslogFacility
248 *****************************************************************************/
250 EVEL_SYSLOG_FACILITY_KERNEL,
251 EVEL_SYSLOG_FACILITY_USER,
252 EVEL_SYSLOG_FACILITY_MAIL,
253 EVEL_SYSLOG_FACILITY_SYSTEM_DAEMON,
254 EVEL_SYSLOG_FACILITY_SECURITY_AUTH,
255 EVEL_SYSLOG_FACILITY_INTERNAL,
256 EVEL_SYSLOG_FACILITY_LINE_PRINTER,
257 EVEL_SYSLOG_FACILITY_NETWORK_NEWS,
258 EVEL_SYSLOG_FACILITY_UUCP,
259 EVEL_SYSLOG_FACILITY_CLOCK_DAEMON,
260 EVEL_SYSLOG_FACILITY_SECURITY_AUTH2,
261 EVEL_SYSLOG_FACILITY_FTP_DAEMON,
262 EVEL_SYSLOG_FACILITY_NTP,
263 EVEL_SYSLOG_FACILITY_LOG_AUDIT,
264 EVEL_SYSLOG_FACILITY_LOG_ALERT,
265 EVEL_SYSLOG_FACILITY_CLOCK_DAEMON2,
266 EVEL_SYSLOG_FACILITY_LOCAL0,
267 EVEL_SYSLOG_FACILITY_LOCAL1,
268 EVEL_SYSLOG_FACILITY_LOCAL2,
269 EVEL_SYSLOG_FACILITY_LOCAL3,
270 EVEL_SYSLOG_FACILITY_LOCAL4,
271 EVEL_SYSLOG_FACILITY_LOCAL5,
272 EVEL_SYSLOG_FACILITY_LOCAL6,
273 EVEL_SYSLOG_FACILITY_LOCAL7,
274 EVEL_MAX_SYSLOG_FACILITIES
275 } EVEL_SYSLOG_FACILITIES;
277 /**************************************************************************//**
279 * JSON equivalent fields: tcpFlagCountList, tcpFlagList
280 *****************************************************************************/
294 /**************************************************************************//**
295 * Mobile QCI Classes of Service.
296 * JSON equivalent fields: mobileQciCosCountList, mobileQciCosList
297 *****************************************************************************/
300 /***************************************************************************/
301 /* UMTS Classes of Service. */
302 /***************************************************************************/
303 EVEL_QCI_COS_UMTS_CONVERSATIONAL,
304 EVEL_QCI_COS_UMTS_STREAMING,
305 EVEL_QCI_COS_UMTS_INTERACTIVE,
306 EVEL_QCI_COS_UMTS_BACKGROUND,
308 /***************************************************************************/
309 /* LTE Classes of Service. */
310 /***************************************************************************/
324 EVEL_MAX_QCI_COS_TYPES
325 } EVEL_QCI_COS_TYPES;
327 /**************************************************************************//**
328 * Service Event endpoint description
329 * JSON equivalent field: endpointDesc
330 *****************************************************************************/
332 EVEL_SERVICE_ENDPOINT_CALLEE,
333 EVEL_SERVICE_ENDPOINT_CALLER,
334 EVEL_MAX_SERVICE_ENDPOINT_DESC
335 } EVEL_SERVICE_ENDPOINT_DESC;
337 /**************************************************************************//**
338 * Boolean type for EVEL library.
339 *****************************************************************************/
345 /**************************************************************************//**
346 * Optional parameter holder for double.
347 *****************************************************************************/
348 typedef struct evel_option_double
352 } EVEL_OPTION_DOUBLE;
354 /**************************************************************************//**
355 * Optional parameter holder for string.
356 *****************************************************************************/
357 typedef struct evel_option_string
361 } EVEL_OPTION_STRING;
363 /**************************************************************************//**
364 * Optional parameter holder for int.
365 *****************************************************************************/
366 typedef struct evel_option_int
372 /**************************************************************************//**
373 * Optional parameter holder for unsigned long long.
374 *****************************************************************************/
375 typedef struct evel_option_ull
377 unsigned long long value;
381 /**************************************************************************//**
382 * Optional parameter holder for time_t.
383 *****************************************************************************/
384 typedef struct evel_option_time
390 /**************************************************************************//**
391 * enrichment fields for internal VES Event Listener service use only,
392 * not supplied by event sources
393 *****************************************************************************/
394 typedef struct internal_header_fields
398 } EVEL_OPTION_INTHEADER_FIELDS;
400 /*****************************************************************************/
401 /* Supported Common Event Header version. */
402 /*****************************************************************************/
403 #define EVEL_HEADER_MAJOR_VERSION 3
404 #define EVEL_HEADER_MINOR_VERSION 0
406 /**************************************************************************//**
408 * JSON equivalent field: commonEventHeader
409 *****************************************************************************/
410 typedef struct event_header {
411 /***************************************************************************/
413 /***************************************************************************/
417 /***************************************************************************/
418 /* Mandatory fields */
419 /***************************************************************************/
420 EVEL_EVENT_DOMAINS event_domain;
424 char * reporting_entity_name;
425 EVEL_EVENT_PRIORITIES priority;
426 unsigned long long start_epoch_microsec;
427 unsigned long long last_epoch_microsec;
430 /***************************************************************************/
431 /* Optional fields */
432 /***************************************************************************/
433 EVEL_OPTION_STRING event_type;
434 EVEL_OPTION_STRING source_id;
435 EVEL_OPTION_STRING reporting_entity_id;
436 EVEL_OPTION_INTHEADER_FIELDS internal_field;
437 EVEL_OPTION_STRING nfcnaming_code;
438 EVEL_OPTION_STRING nfnaming_code;
442 /*****************************************************************************/
443 /* Supported Fault version. */
444 /*****************************************************************************/
445 #define EVEL_FAULT_MAJOR_VERSION 2
446 #define EVEL_FAULT_MINOR_VERSION 1
448 /**************************************************************************//**
450 * JSON equivalent field: faultFields
451 *****************************************************************************/
452 typedef struct event_fault {
453 /***************************************************************************/
454 /* Header and version */
455 /***************************************************************************/
460 /***************************************************************************/
461 /* Mandatory fields */
462 /***************************************************************************/
463 EVEL_SEVERITIES event_severity;
464 EVEL_SOURCE_TYPES event_source_type;
465 char * alarm_condition;
466 char * specific_problem;
467 EVEL_VF_STATUSES vf_status;
469 /***************************************************************************/
470 /* Optional fields */
471 /***************************************************************************/
472 EVEL_OPTION_STRING category;
473 EVEL_OPTION_STRING alarm_interface_a;
474 DLIST additional_info;
478 /**************************************************************************//**
479 * Fault Additional Info.
480 * JSON equivalent field: alarmAdditionalInformation
481 *****************************************************************************/
482 typedef struct fault_additional_info {
488 /**************************************************************************//**
489 * optional field block for fields specific to heartbeat events
490 *****************************************************************************/
491 typedef struct event_heartbeat_fields
493 /***************************************************************************/
494 /* Header and version */
495 /***************************************************************************/
500 /***************************************************************************/
501 /* Mandatory fields */
502 /***************************************************************************/
503 double heartbeat_version;
504 int heartbeat_interval;
506 /***************************************************************************/
507 /* Optional fields */
508 /***************************************************************************/
509 DLIST additional_info;
511 } EVENT_HEARTBEAT_FIELD;
513 /**************************************************************************//**
514 * tuple which provides the name of a key along with its value and
516 *****************************************************************************/
517 typedef struct internal_key
520 EVEL_OPTION_INT keyorder;
521 EVEL_OPTION_STRING keyvalue;
524 /**************************************************************************//**
525 * meta-information about an instance of a jsonObject along with
526 * the actual object instance
527 *****************************************************************************/
528 typedef struct json_object_instance
532 unsigned long long objinst_epoch_microsec;
533 DLIST object_keys; /*EVEL_INTERNAL_KEY list */
535 } EVEL_JSON_OBJECT_INSTANCE;
536 #define MAX_JSON_TOKENS 128
537 /**************************************************************************//**
538 * Create a new json object instance.
540 * @note The mandatory fields on the Other must be supplied to this factory
541 * function and are immutable once set. Optional fields have explicit
542 * setter functions, but again values may only be set once so that the
543 * Other has immutable properties.
544 * @param yourjson json string.
545 * @returns pointer to the newly manufactured ::EVEL_JSON_OBJECT_INSTANCE.
546 * not used (i.e. posted) it must be released using ::evel_free_jsonobjectinstance.
547 * @retval NULL Failed to create the json object instance.
548 *****************************************************************************/
549 EVEL_JSON_OBJECT_INSTANCE * evel_new_jsonobjinstance(const char *const yourjson);
550 /**************************************************************************//**
551 * Free an json object instance.
553 * Free off the json object instance supplied.
554 * Will free all the contained allocated memory.
556 *****************************************************************************/
557 void evel_free_jsonobjinst(EVEL_JSON_OBJECT_INSTANCE * objinst);
559 /**************************************************************************//**
560 * enrichment fields for internal VES Event Listener service use only,
561 * not supplied by event sources
562 *****************************************************************************/
563 typedef struct json_object
567 EVEL_OPTION_STRING objectschema;
568 EVEL_OPTION_STRING objectschemaurl;
569 EVEL_OPTION_STRING nfsubscribedobjname;
570 EVEL_OPTION_STRING nfsubscriptionid;
571 DLIST jsonobjectinstances; /* EVEL_JSON_OBJECT_INSTANCE list */
575 /**************************************************************************//**
576 * Create a new json object.
578 * @note The mandatory fields on the Other must be supplied to this factory
579 * function and are immutable once set. Optional fields have explicit
580 * setter functions, but again values may only be set once so that the
581 * Other has immutable properties.
582 * @param name name of the object.
583 * @returns pointer to the newly manufactured ::EVEL_JSON_OBJECT.
584 * not used (i.e. posted) it must be released using ::evel_free_jsonobject.
585 * @retval NULL Failed to create the json object.
586 *****************************************************************************/
587 EVEL_JSON_OBJECT * evel_new_jsonobject(const char *const name);
588 /**************************************************************************//**
589 * Free an json object.
591 * Free off the json object instance supplied.
592 * Will free all the contained allocated memory.
594 *****************************************************************************/
595 void evel_free_jsonobject(EVEL_JSON_OBJECT * jsobj);
596 /*****************************************************************************/
597 /* Supported Measurement version. */
598 /*****************************************************************************/
599 #define EVEL_MEASUREMENT_MAJOR_VERSION 2
600 #define EVEL_MEASUREMENT_MINOR_VERSION 0
602 /**************************************************************************//**
604 * JSON equivalent field: errors
605 *****************************************************************************/
606 typedef struct measurement_errors {
607 int receive_discards;
609 int transmit_discards;
611 } MEASUREMENT_ERRORS;
613 /**************************************************************************//**
615 * JSON equivalent field: measurementsForVfScalingFields
616 *****************************************************************************/
617 typedef struct event_measurement {
618 /***************************************************************************/
619 /* Header and version */
620 /***************************************************************************/
625 /***************************************************************************/
626 /* Mandatory fields */
627 /***************************************************************************/
628 double measurement_interval;
630 /***************************************************************************/
631 /* Optional fields */
632 /***************************************************************************/
633 DLIST additional_info;
634 DLIST additional_measurements;
635 DLIST additional_objects;
637 EVEL_OPTION_INT concurrent_sessions;
638 EVEL_OPTION_INT configured_entities;
641 MEASUREMENT_ERRORS * errors;
643 DLIST filesystem_usage;
644 DLIST latency_distribution;
645 EVEL_OPTION_DOUBLE mean_request_latency;
647 EVEL_OPTION_INT media_ports_in_use;
648 EVEL_OPTION_INT request_rate;
649 EVEL_OPTION_INT vnfc_scaling_metric;
654 /**************************************************************************//**
656 * JSON equivalent field: cpuUsage
657 *****************************************************************************/
658 typedef struct measurement_cpu_use {
661 EVEL_OPTION_DOUBLE idle;
662 EVEL_OPTION_DOUBLE intrpt;
663 EVEL_OPTION_DOUBLE nice;
664 EVEL_OPTION_DOUBLE softirq;
665 EVEL_OPTION_DOUBLE steal;
666 EVEL_OPTION_DOUBLE sys;
667 EVEL_OPTION_DOUBLE user;
668 EVEL_OPTION_DOUBLE wait;
669 } MEASUREMENT_CPU_USE;
672 /**************************************************************************//**
674 * JSON equivalent field: diskUsage
675 *****************************************************************************/
676 typedef struct measurement_disk_use {
678 EVEL_OPTION_DOUBLE iotimeavg;
679 EVEL_OPTION_DOUBLE iotimelast;
680 EVEL_OPTION_DOUBLE iotimemax;
681 EVEL_OPTION_DOUBLE iotimemin;
682 EVEL_OPTION_DOUBLE mergereadavg;
683 EVEL_OPTION_DOUBLE mergereadlast;
684 EVEL_OPTION_DOUBLE mergereadmax;
685 EVEL_OPTION_DOUBLE mergereadmin;
686 EVEL_OPTION_DOUBLE mergewriteavg;
687 EVEL_OPTION_DOUBLE mergewritelast;
688 EVEL_OPTION_DOUBLE mergewritemax;
689 EVEL_OPTION_DOUBLE mergewritemin;
690 EVEL_OPTION_DOUBLE octetsreadavg;
691 EVEL_OPTION_DOUBLE octetsreadlast;
692 EVEL_OPTION_DOUBLE octetsreadmax;
693 EVEL_OPTION_DOUBLE octetsreadmin;
694 EVEL_OPTION_DOUBLE octetswriteavg;
695 EVEL_OPTION_DOUBLE octetswritelast;
696 EVEL_OPTION_DOUBLE octetswritemax;
697 EVEL_OPTION_DOUBLE octetswritemin;
698 EVEL_OPTION_DOUBLE opsreadavg;
699 EVEL_OPTION_DOUBLE opsreadlast;
700 EVEL_OPTION_DOUBLE opsreadmax;
701 EVEL_OPTION_DOUBLE opsreadmin;
702 EVEL_OPTION_DOUBLE opswriteavg;
703 EVEL_OPTION_DOUBLE opswritelast;
704 EVEL_OPTION_DOUBLE opswritemax;
705 EVEL_OPTION_DOUBLE opswritemin;
706 EVEL_OPTION_DOUBLE pendingopsavg;
707 EVEL_OPTION_DOUBLE pendingopslast;
708 EVEL_OPTION_DOUBLE pendingopsmax;
709 EVEL_OPTION_DOUBLE pendingopsmin;
710 EVEL_OPTION_DOUBLE timereadavg;
711 EVEL_OPTION_DOUBLE timereadlast;
712 EVEL_OPTION_DOUBLE timereadmax;
713 EVEL_OPTION_DOUBLE timereadmin;
714 EVEL_OPTION_DOUBLE timewriteavg;
715 EVEL_OPTION_DOUBLE timewritelast;
716 EVEL_OPTION_DOUBLE timewritemax;
717 EVEL_OPTION_DOUBLE timewritemin;
719 } MEASUREMENT_DISK_USE;
721 /**************************************************************************//**
722 * Add an additional Disk usage value name/value pair to the Measurement.
724 * The name and value are null delimited ASCII strings. The library takes
725 * a copy so the caller does not have to preserve values after the function
728 * @param measurement Pointer to the measurement.
729 * @param id ASCIIZ string with the CPU's identifier.
730 * @param usage Disk utilization.
731 *****************************************************************************/
732 MEASUREMENT_DISK_USE * evel_measurement_new_disk_use_add(EVENT_MEASUREMENT * measurement, char * id);
734 /**************************************************************************//**
736 * JSON equivalent field: filesystemUsage
737 *****************************************************************************/
738 typedef struct measurement_fsys_use {
739 char * filesystem_name;
740 double block_configured;
743 double ephemeral_configured;
744 double ephemeral_iops;
745 double ephemeral_used;
746 } MEASUREMENT_FSYS_USE;
748 /**************************************************************************//**
750 * JSON equivalent field: memoryUsage
751 *****************************************************************************/
752 typedef struct measurement_mem_use {
756 EVEL_OPTION_DOUBLE memcache;
757 EVEL_OPTION_DOUBLE memconfig;
758 EVEL_OPTION_DOUBLE memfree;
759 EVEL_OPTION_DOUBLE slabrecl;
760 EVEL_OPTION_DOUBLE slabunrecl;
761 EVEL_OPTION_DOUBLE memused;
762 } MEASUREMENT_MEM_USE;
764 /**************************************************************************//**
765 * Add an additional Memory usage value name/value pair to the Measurement.
767 * The name and value are null delimited ASCII strings. The library takes
768 * a copy so the caller does not have to preserve values after the function
771 * @param measurement Pointer to the measurement.
772 * @param id ASCIIZ string with the Memory identifier.
773 * @param vmidentifier ASCIIZ string with the VM's identifier.
774 * @param membuffsz Memory Size.
776 * @return Returns pointer to memory use structure in measurements
777 *****************************************************************************/
778 MEASUREMENT_MEM_USE * evel_measurement_new_mem_use_add(EVENT_MEASUREMENT * measurement,
779 char * id, char *vmidentifier, double membuffsz);
781 /**************************************************************************//**
782 * Set kilobytes of memory used for cache
784 * @note The property is treated as immutable: it is only valid to call
785 * the setter once. However, we don't assert if the caller tries to
786 * overwrite, just ignoring the update instead.
788 * @param mem_use Pointer to the Memory Use.
790 *****************************************************************************/
791 void evel_measurement_mem_use_memcache_set(MEASUREMENT_MEM_USE * const mem_use,
793 /**************************************************************************//**
794 * Set kilobytes of memory configured in the virtual machine on which the VNFC reporting
796 * @note The property is treated as immutable: it is only valid to call
797 * the setter once. However, we don't assert if the caller tries to
798 * overwrite, just ignoring the update instead.
800 * @param mem_use Pointer to the Memory Use.
802 *****************************************************************************/
803 void evel_measurement_mem_use_memconfig_set(MEASUREMENT_MEM_USE * const mem_use,
805 /**************************************************************************//**
806 * Set kilobytes of physical RAM left unused by the system
808 * @note The property is treated as immutable: it is only valid to call
809 * the setter once. However, we don't assert if the caller tries to
810 * overwrite, just ignoring the update instead.
812 * @param mem_use Pointer to the Memory Use.
814 *****************************************************************************/
815 void evel_measurement_mem_use_memfree_set(MEASUREMENT_MEM_USE * const mem_use,
817 /**************************************************************************//**
818 * Set the part of the slab that can be reclaimed such as caches measured in kilobytes
820 * @note The property is treated as immutable: it is only valid to call
821 * the setter once. However, we don't assert if the caller tries to
822 * overwrite, just ignoring the update instead.
824 * @param mem_use Pointer to the Memory Use.
826 *****************************************************************************/
827 void evel_measurement_mem_use_slab_reclaimed_set(MEASUREMENT_MEM_USE * const mem_use,
829 /**************************************************************************//**
830 * Set the part of the slab that cannot be reclaimed such as caches measured in kilobytes
832 * @note The property is treated as immutable: it is only valid to call
833 * the setter once. However, we don't assert if the caller tries to
834 * overwrite, just ignoring the update instead.
836 * @param mem_use Pointer to the Memory Use.
838 *****************************************************************************/
839 void evel_measurement_mem_use_slab_unreclaimable_set(MEASUREMENT_MEM_USE * const mem_use,
841 /**************************************************************************//**
842 * Set the total memory minus the sum of free, buffered, cached and slab memory in kilobytes
844 * @note The property is treated as immutable: it is only valid to call
845 * the setter once. However, we don't assert if the caller tries to
846 * overwrite, just ignoring the update instead.
848 * @param mem_use Pointer to the Memory Use.
850 *****************************************************************************/
851 void evel_measurement_mem_use_usedup_set(MEASUREMENT_MEM_USE * const mem_use,
853 /**************************************************************************//**
855 * JSON equivalent field: latencyBucketMeasure
856 *****************************************************************************/
857 typedef struct measurement_latency_bucket {
860 /***************************************************************************/
861 /* Optional fields */
862 /***************************************************************************/
863 EVEL_OPTION_DOUBLE high_end;
864 EVEL_OPTION_DOUBLE low_end;
866 } MEASUREMENT_LATENCY_BUCKET;
868 /**************************************************************************//**
870 * JSON equivalent field: vNicUsage
871 *****************************************************************************/
872 typedef struct measurement_vnic_performance {
873 /***************************************************************************/
874 /* Optional fields */
875 /***************************************************************************/
876 /*Cumulative count of broadcast packets received as read at the end of
877 the measurement interval*/
878 EVEL_OPTION_DOUBLE recvd_bcast_packets_acc;
879 /*Count of broadcast packets received within the measurement interval*/
880 EVEL_OPTION_DOUBLE recvd_bcast_packets_delta;
881 /*Cumulative count of discarded packets received as read at the end of
882 the measurement interval*/
883 EVEL_OPTION_DOUBLE recvd_discarded_packets_acc;
884 /*Count of discarded packets received within the measurement interval*/
885 EVEL_OPTION_DOUBLE recvd_discarded_packets_delta;
886 /*Cumulative count of error packets received as read at the end of
887 the measurement interval*/
888 EVEL_OPTION_DOUBLE recvd_error_packets_acc;
889 /*Count of error packets received within the measurement interval*/
890 EVEL_OPTION_DOUBLE recvd_error_packets_delta;
891 /*Cumulative count of multicast packets received as read at the end of
892 the measurement interval*/
893 EVEL_OPTION_DOUBLE recvd_mcast_packets_acc;
894 /*Count of mcast packets received within the measurement interval*/
895 EVEL_OPTION_DOUBLE recvd_mcast_packets_delta;
896 /*Cumulative count of octets received as read at the end of
897 the measurement interval*/
898 EVEL_OPTION_DOUBLE recvd_octets_acc;
899 /*Count of octets received within the measurement interval*/
900 EVEL_OPTION_DOUBLE recvd_octets_delta;
901 /*Cumulative count of all packets received as read at the end of
902 the measurement interval*/
903 EVEL_OPTION_DOUBLE recvd_total_packets_acc;
904 /*Count of all packets received within the measurement interval*/
905 EVEL_OPTION_DOUBLE recvd_total_packets_delta;
906 /*Cumulative count of unicast packets received as read at the end of
907 the measurement interval*/
908 EVEL_OPTION_DOUBLE recvd_ucast_packets_acc;
909 /*Count of unicast packets received within the measurement interval*/
910 EVEL_OPTION_DOUBLE recvd_ucast_packets_delta;
911 /*Cumulative count of transmitted broadcast packets at the end of
912 the measurement interval*/
913 EVEL_OPTION_DOUBLE tx_bcast_packets_acc;
914 /*Count of transmitted broadcast packets within the measurement interval*/
915 EVEL_OPTION_DOUBLE tx_bcast_packets_delta;
916 /*Cumulative count of transmit discarded packets at the end of
917 the measurement interval*/
918 EVEL_OPTION_DOUBLE tx_discarded_packets_acc;
919 /*Count of transmit discarded packets within the measurement interval*/
920 EVEL_OPTION_DOUBLE tx_discarded_packets_delta;
921 /*Cumulative count of transmit error packets at the end of
922 the measurement interval*/
923 EVEL_OPTION_DOUBLE tx_error_packets_acc;
924 /*Count of transmit error packets within the measurement interval*/
925 EVEL_OPTION_DOUBLE tx_error_packets_delta;
926 /*Cumulative count of transmit multicast packets at the end of
927 the measurement interval*/
928 EVEL_OPTION_DOUBLE tx_mcast_packets_acc;
929 /*Count of transmit multicast packets within the measurement interval*/
930 EVEL_OPTION_DOUBLE tx_mcast_packets_delta;
931 /*Cumulative count of transmit octets at the end of
932 the measurement interval*/
933 EVEL_OPTION_DOUBLE tx_octets_acc;
934 /*Count of transmit octets received within the measurement interval*/
935 EVEL_OPTION_DOUBLE tx_octets_delta;
936 /*Cumulative count of all transmit packets at the end of
937 the measurement interval*/
938 EVEL_OPTION_DOUBLE tx_total_packets_acc;
939 /*Count of transmit packets within the measurement interval*/
940 EVEL_OPTION_DOUBLE tx_total_packets_delta;
941 /*Cumulative count of all transmit unicast packets at the end of
942 the measurement interval*/
943 EVEL_OPTION_DOUBLE tx_ucast_packets_acc;
944 /*Count of transmit unicast packets within the measurement interval*/
945 EVEL_OPTION_DOUBLE tx_ucast_packets_delta;
946 /* Indicates whether vNicPerformance values are likely inaccurate
947 due to counter overflow or other condtions*/
948 char *valuesaresuspect;
951 } MEASUREMENT_VNIC_PERFORMANCE;
953 /**************************************************************************//**
955 * JSON equivalent field: codecsInUse
956 *****************************************************************************/
957 typedef struct measurement_codec_use {
960 } MEASUREMENT_CODEC_USE;
962 /**************************************************************************//**
964 * JSON equivalent field: featuresInUse
965 *****************************************************************************/
966 typedef struct measurement_feature_use {
968 int feature_utilization;
969 } MEASUREMENT_FEATURE_USE;
971 /**************************************************************************//**
973 * JSON equivalent field: additionalMeasurements
974 *****************************************************************************/
975 typedef struct measurement_group {
980 /**************************************************************************//**
981 * Custom Defined Measurement.
982 * JSON equivalent field: measurements
983 *****************************************************************************/
984 typedef struct custom_measurement {
987 } CUSTOM_MEASUREMENT;
989 /*****************************************************************************/
990 /* Supported Report version. */
991 /*****************************************************************************/
992 #define EVEL_REPORT_MAJOR_VERSION 1
993 #define EVEL_REPORT_MINOR_VERSION 1
995 /**************************************************************************//**
997 * JSON equivalent field: measurementsForVfReportingFields
999 * @note This is an experimental event type and is not currently a formal part
1000 * of AT&T's specification.
1001 *****************************************************************************/
1002 typedef struct event_report {
1003 /***************************************************************************/
1004 /* Header and version */
1005 /***************************************************************************/
1006 EVENT_HEADER header;
1010 /***************************************************************************/
1011 /* Mandatory fields */
1012 /***************************************************************************/
1013 double measurement_interval;
1015 /***************************************************************************/
1016 /* Optional fields */
1017 /***************************************************************************/
1018 DLIST feature_usage;
1019 DLIST measurement_groups;
1023 /**************************************************************************//**
1024 * Mobile GTP Per Flow Metrics.
1025 * JSON equivalent field: gtpPerFlowMetrics
1026 *****************************************************************************/
1027 typedef struct mobile_gtp_per_flow_metrics {
1028 double avg_bit_error_rate;
1029 double avg_packet_delay_variation;
1030 int avg_packet_latency;
1031 int avg_receive_throughput;
1032 int avg_transmit_throughput;
1033 int flow_activation_epoch;
1034 int flow_activation_microsec;
1035 int flow_deactivation_epoch;
1036 int flow_deactivation_microsec;
1037 time_t flow_deactivation_time;
1039 int max_packet_delay_variation;
1040 int num_activation_failures;
1042 int num_bytes_received;
1043 int num_bytes_transmitted;
1044 int num_dropped_packets;
1045 int num_l7_bytes_received;
1046 int num_l7_bytes_transmitted;
1047 int num_lost_packets;
1048 int num_out_of_order_packets;
1049 int num_packet_errors;
1050 int num_packets_received_excl_retrans;
1051 int num_packets_received_incl_retrans;
1052 int num_packets_transmitted_incl_retrans;
1055 int num_tunneled_l7_bytes_received;
1056 int round_trip_time;
1057 int time_to_first_byte;
1059 /***************************************************************************/
1060 /* Optional fields */
1061 /***************************************************************************/
1062 EVEL_OPTION_INT ip_tos_counts[EVEL_TOS_SUPPORTED];
1063 EVEL_OPTION_INT tcp_flag_counts[EVEL_MAX_TCP_FLAGS];
1064 EVEL_OPTION_INT qci_cos_counts[EVEL_MAX_QCI_COS_TYPES];
1065 EVEL_OPTION_INT dur_connection_failed_status;
1066 EVEL_OPTION_INT dur_tunnel_failed_status;
1067 EVEL_OPTION_STRING flow_activated_by;
1068 EVEL_OPTION_TIME flow_activation_time;
1069 EVEL_OPTION_STRING flow_deactivated_by;
1070 EVEL_OPTION_STRING gtp_connection_status;
1071 EVEL_OPTION_STRING gtp_tunnel_status;
1072 EVEL_OPTION_INT large_packet_rtt;
1073 EVEL_OPTION_DOUBLE large_packet_threshold;
1074 EVEL_OPTION_INT max_receive_bit_rate;
1075 EVEL_OPTION_INT max_transmit_bit_rate;
1076 EVEL_OPTION_INT num_gtp_echo_failures;
1077 EVEL_OPTION_INT num_gtp_tunnel_errors;
1078 EVEL_OPTION_INT num_http_errors;
1080 } MOBILE_GTP_PER_FLOW_METRICS;
1082 /*****************************************************************************/
1083 /* Supported Mobile Flow version. */
1084 /*****************************************************************************/
1085 #define EVEL_MOBILE_FLOW_MAJOR_VERSION 2
1086 #define EVEL_MOBILE_FLOW_MINOR_VERSION 0
1088 /**************************************************************************//**
1090 * JSON equivalent field: mobileFlow
1091 *****************************************************************************/
1092 typedef struct event_mobile_flow {
1093 /***************************************************************************/
1094 /* Header and version */
1095 /***************************************************************************/
1096 EVENT_HEADER header;
1100 /***************************************************************************/
1101 /* Mandatory fields */
1102 /***************************************************************************/
1103 char * flow_direction;
1104 MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics;
1105 char * ip_protocol_type;
1107 char * other_endpoint_ip_address;
1108 int other_endpoint_port;
1109 char * reporting_endpoint_ip_addr;
1110 int reporting_endpoint_port;
1111 DLIST additional_info; /* JSON: additionalFields */
1113 /***************************************************************************/
1114 /* Optional fields */
1115 /***************************************************************************/
1116 EVEL_OPTION_STRING application_type;
1117 EVEL_OPTION_STRING app_protocol_type;
1118 EVEL_OPTION_STRING app_protocol_version;
1119 EVEL_OPTION_STRING cid;
1120 EVEL_OPTION_STRING connection_type;
1121 EVEL_OPTION_STRING ecgi;
1122 EVEL_OPTION_STRING gtp_protocol_type;
1123 EVEL_OPTION_STRING gtp_version;
1124 EVEL_OPTION_STRING http_header;
1125 EVEL_OPTION_STRING imei;
1126 EVEL_OPTION_STRING imsi;
1127 EVEL_OPTION_STRING lac;
1128 EVEL_OPTION_STRING mcc;
1129 EVEL_OPTION_STRING mnc;
1130 EVEL_OPTION_STRING msisdn;
1131 EVEL_OPTION_STRING other_functional_role;
1132 EVEL_OPTION_STRING rac;
1133 EVEL_OPTION_STRING radio_access_technology;
1134 EVEL_OPTION_STRING sac;
1135 EVEL_OPTION_INT sampling_algorithm;
1136 EVEL_OPTION_STRING tac;
1137 EVEL_OPTION_STRING tunnel_id;
1138 EVEL_OPTION_STRING vlan_id;
1140 } EVENT_MOBILE_FLOW;
1142 /*****************************************************************************/
1143 /* Supported Other field version. */
1144 /*****************************************************************************/
1145 #define EVEL_OTHER_EVENT_MAJOR_VERSION 1
1146 #define EVEL_OTHER_EVENT_MINOR_VERSION 1
1148 /**************************************************************************//**
1150 * JSON equivalent field: otherFields
1151 *****************************************************************************/
1152 typedef struct event_other {
1153 EVENT_HEADER header;
1157 HASHTABLE_T *namedarrays; /* HASHTABLE_T */
1158 DLIST jsonobjects; /* DLIST of EVEL_JSON_OBJECT */
1162 /**************************************************************************//**
1164 * JSON equivalent field: otherFields
1165 *****************************************************************************/
1166 typedef struct other_field {
1172 /*****************************************************************************/
1173 /* Supported Service Events version. */
1174 /*****************************************************************************/
1175 #define EVEL_HEARTBEAT_FIELD_MAJOR_VERSION 1
1176 #define EVEL_HEARTBEAT_FIELD_MINOR_VERSION 0
1179 /*****************************************************************************/
1180 /* Supported Signaling version. */
1181 /*****************************************************************************/
1182 #define EVEL_SIGNALING_MAJOR_VERSION 1
1183 #define EVEL_SIGNALING_MINOR_VERSION 0
1185 /**************************************************************************//**
1186 * Vendor VNF Name fields.
1187 * JSON equivalent field: vendorVnfNameFields
1188 *****************************************************************************/
1189 typedef struct vendor_vnfname_field {
1191 EVEL_OPTION_STRING vfmodule;
1192 EVEL_OPTION_STRING vnfname;
1193 } VENDOR_VNFNAME_FIELD;
1195 /**************************************************************************//**
1197 * JSON equivalent field: signalingFields
1198 *****************************************************************************/
1199 typedef struct event_signaling {
1200 /***************************************************************************/
1201 /* Header and version */
1202 /***************************************************************************/
1203 EVENT_HEADER header;
1207 /***************************************************************************/
1208 /* Mandatory fields */
1209 /***************************************************************************/
1210 VENDOR_VNFNAME_FIELD vnfname_field;
1211 EVEL_OPTION_STRING correlator; /* JSON: correlator */
1212 EVEL_OPTION_STRING local_ip_address; /* JSON: localIpAddress */
1213 EVEL_OPTION_STRING local_port; /* JSON: localPort */
1214 EVEL_OPTION_STRING remote_ip_address; /* JSON: remoteIpAddress */
1215 EVEL_OPTION_STRING remote_port; /* JSON: remotePort */
1217 /***************************************************************************/
1218 /* Optional fields */
1219 /***************************************************************************/
1220 EVEL_OPTION_STRING compressed_sip; /* JSON: compressedSip */
1221 EVEL_OPTION_STRING summary_sip; /* JSON: summarySip */
1222 DLIST additional_info;
1226 /**************************************************************************//**
1227 * Sgnaling Additional Field.
1228 * JSON equivalent field: additionalFields
1229 *****************************************************************************/
1230 typedef struct signaling_additional_field {
1233 } SIGNALING_ADDL_FIELD;
1235 /*****************************************************************************/
1236 /* Supported State Change version. */
1237 /*****************************************************************************/
1238 #define EVEL_STATE_CHANGE_MAJOR_VERSION 2
1239 #define EVEL_STATE_CHANGE_MINOR_VERSION 0
1241 /**************************************************************************//**
1243 * JSON equivalent field: stateChangeFields
1244 *****************************************************************************/
1245 typedef struct event_state_change {
1246 /***************************************************************************/
1247 /* Header and version */
1248 /***************************************************************************/
1249 EVENT_HEADER header;
1253 /***************************************************************************/
1254 /* Mandatory fields */
1255 /***************************************************************************/
1256 EVEL_ENTITY_STATE new_state;
1257 EVEL_ENTITY_STATE old_state;
1258 char * state_interface;
1261 /***************************************************************************/
1262 /* Optional fields */
1263 /***************************************************************************/
1264 DLIST additional_fields;
1266 } EVENT_STATE_CHANGE;
1268 /**************************************************************************//**
1269 * State Change Additional Field.
1270 * JSON equivalent field: additionalFields
1271 *****************************************************************************/
1272 typedef struct state_change_additional_field {
1275 } STATE_CHANGE_ADDL_FIELD;
1277 /*****************************************************************************/
1278 /* Supported Syslog version. */
1279 /*****************************************************************************/
1280 #define EVEL_SYSLOG_MAJOR_VERSION 3
1281 #define EVEL_SYSLOG_MINOR_VERSION 0
1283 /**************************************************************************//**
1285 * JSON equivalent field: syslogFields
1286 *****************************************************************************/
1287 typedef struct event_syslog {
1288 /***************************************************************************/
1289 /* Header and version */
1290 /***************************************************************************/
1291 EVENT_HEADER header;
1295 /***************************************************************************/
1296 /* Mandatory fields */
1297 /***************************************************************************/
1298 EVEL_SOURCE_TYPES event_source_type;
1302 /***************************************************************************/
1303 /* Optional fields */
1304 /***************************************************************************/
1305 EVEL_OPTION_STRING additional_filters;
1306 EVEL_OPTION_STRING event_source_host;
1307 EVEL_OPTION_INT syslog_facility;
1308 EVEL_OPTION_INT syslog_priority;
1309 EVEL_OPTION_STRING syslog_proc;
1310 EVEL_OPTION_INT syslog_proc_id;
1311 EVEL_OPTION_STRING syslog_s_data;
1312 EVEL_OPTION_STRING syslog_sdid;
1313 EVEL_OPTION_STRING syslog_severity;
1315 EVEL_OPTION_INT syslog_ver;
1319 /**************************************************************************//**
1321 * JSON equivalent object: attCopyrightNotice
1322 *****************************************************************************/
1323 typedef struct copyright {
1324 char * useAndRedistribution;
1329 char * disclaimerLine1;
1330 char * disclaimerLine2;
1331 char * disclaimerLine3;
1332 char * disclaimerLine4;
1335 /**************************************************************************//**
1336 * Library initialization.
1338 * Initialize the EVEL library.
1340 * @note This function initializes the cURL library. Applications making use
1341 * of libcurl may need to pull the initialization out of here. Note
1342 * also that this function is not threadsafe as a result - refer to
1343 * libcurl's API documentation for relevant warnings.
1345 * @sa Matching Term function.
1347 * @param fqdn The API's FQDN or IP address.
1348 * @param port The API's port.
1349 * @param path The optional path (may be NULL).
1350 * @param topic The optional topic part of the URL (may be NULL).
1351 * @param secure Whether to use HTTPS (0=HTTP, 1=HTTPS).
1352 * @param username Username for Basic Authentication of requests.
1353 * @param password Password for Basic Authentication of requests.
1354 * @param source_type The kind of node we represent.
1355 * @param role The role this node undertakes.
1356 * @param verbosity 0 for normal operation, positive values for chattier
1359 * @returns Status code
1360 * @retval EVEL_SUCCESS On success
1361 * @retval ::EVEL_ERR_CODES On failure.
1362 *****************************************************************************/
1363 EVEL_ERR_CODES evel_initialize(const char * const fqdn,
1365 const char * const path,
1366 const char * const topic,
1368 const char * const username,
1369 const char * const password,
1370 EVEL_SOURCE_TYPES source_type,
1371 const char * const role,
1375 /**************************************************************************//**
1376 * Clean up the EVEL library.
1378 * @note that at present don't expect Init/Term cycling not to leak memory!
1380 * @returns Status code
1381 * @retval EVEL_SUCCESS On success
1382 * @retval "One of ::EVEL_ERR_CODES" On failure.
1383 *****************************************************************************/
1384 EVEL_ERR_CODES evel_terminate(void);
1386 EVEL_ERR_CODES evel_post_event(EVENT_HEADER * event);
1387 const char * evel_error_string(void);
1390 /**************************************************************************//**
1393 * Free off the event supplied. Will free all the contained allocated memory.
1395 * @note It is safe to free a NULL pointer.
1396 *****************************************************************************/
1397 void evel_free_event(void * event);
1399 /**************************************************************************//**
1400 * Encode the event as a JSON event object according to AT&T's schema.
1402 * @param json Pointer to where to store the JSON encoded data.
1403 * @param max_size Size of storage available in json_body.
1404 * @param event Pointer to the ::EVENT_HEADER to encode.
1405 * @returns Number of bytes actually written.
1406 *****************************************************************************/
1407 int evel_json_encode_event(char * json,
1409 EVENT_HEADER * event);
1411 /**************************************************************************//**
1412 * Initialize an event instance id.
1414 * @param vfield Pointer to the event vnfname field being initialized.
1415 * @param vendor_id The vendor id to encode in the event instance id.
1416 * @param event_id The event id to encode in the event instance id.
1417 *****************************************************************************/
1418 void evel_init_vendor_field(VENDOR_VNFNAME_FIELD * const vfield,
1419 const char * const vendor_name);
1421 /**************************************************************************//**
1422 * Set the Vendor module property of the Vendor.
1424 * @note The property is treated as immutable: it is only valid to call
1425 * the setter once. However, we don't assert if the caller tries to
1426 * overwrite, just ignoring the update instead.
1428 * @param vfield Pointer to the Vendor field.
1429 * @param module_name The module name to be set. ASCIIZ string. The caller
1430 * does not need to preserve the value once the function
1432 *****************************************************************************/
1433 void evel_vendor_field_module_set(VENDOR_VNFNAME_FIELD * const vfield,
1434 const char * const module_name);
1435 /**************************************************************************//**
1436 * Set the Vendor module property of the Vendor.
1438 * @note The property is treated as immutable: it is only valid to call
1439 * the setter once. However, we don't assert if the caller tries to
1440 * overwrite, just ignoring the update instead.
1442 * @param vfield Pointer to the Vendor field.
1443 * @param module_name The module name to be set. ASCIIZ string. The caller
1444 * does not need to preserve the value once the function
1446 *****************************************************************************/
1447 void evel_vendor_field_vnfname_set(VENDOR_VNFNAME_FIELD * const vfield,
1448 const char * const vnfname);
1449 /**************************************************************************//**
1450 * Free an event instance id.
1452 * @param vfield Pointer to the event vnfname_field being freed.
1453 *****************************************************************************/
1454 void evel_free_event_vendor_field(VENDOR_VNFNAME_FIELD * const vfield);
1456 /**************************************************************************//**
1457 * Callback function to provide returned data.
1459 * Copy data into the supplied buffer, write_callback::ptr, checking size
1462 * @returns Number of bytes placed into write_callback::ptr. 0 for EOF.
1463 *****************************************************************************/
1464 size_t evel_write_callback(void *contents,
1469 /*****************************************************************************/
1470 /*****************************************************************************/
1472 /* HEARTBEAT - (includes common header, too) */
1474 /*****************************************************************************/
1475 /*****************************************************************************/
1477 /**************************************************************************//**
1478 * Create a new heartbeat event.
1480 * @note that the heartbeat is just a "naked" commonEventHeader!
1482 * @returns pointer to the newly manufactured ::EVENT_HEADER. If the event is
1483 * not used it must be released using ::evel_free_event
1484 * @retval NULL Failed to create the event.
1485 *****************************************************************************/
1486 EVENT_HEADER * evel_new_heartbeat(void);
1488 /**************************************************************************//**
1489 * Create a new heartbeat event of given name and type.
1491 * @note that the heartbeat is just a "naked" commonEventHeader!
1493 * @param event_name Unique Event Name confirming Domain AsdcModel Description
1494 * @param event_id A universal identifier of the event for: troubleshooting correlation, analysis, etc
1496 * @returns pointer to the newly manufactured ::EVENT_HEADER. If the event is
1497 * not used it must be released using ::evel_free_event
1498 * @retval NULL Failed to create the event.
1499 *****************************************************************************/
1500 EVENT_HEADER * evel_new_heartbeat_nameid(const char* ev_name, const char *ev_id);
1503 /**************************************************************************//**
1504 * Free an event header.
1506 * Free off the event header supplied. Will free all the contained allocated
1509 * @note It does not free the header itself, since that may be part of a
1511 *****************************************************************************/
1512 void evel_free_header(EVENT_HEADER * const event);
1514 /**************************************************************************//**
1515 * Initialize a newly created event header.
1517 * @param header Pointer to the header being initialized.
1518 *****************************************************************************/
1519 void evel_init_header(EVENT_HEADER * const header,const char *const eventname);
1521 /**************************************************************************//**
1522 * Set the Event Type property of the event header.
1524 * @param header Pointer to the ::EVENT_HEADER.
1525 * @param type The Event Type to be set. ASCIIZ string. The caller
1526 * does not need to preserve the value once the function
1528 *****************************************************************************/
1529 void evel_header_type_set(EVENT_HEADER * const header,
1530 const char * const type);
1532 /**************************************************************************//**
1533 * Set the Start Epoch property of the event header.
1535 * @note The Start Epoch defaults to the time of event creation.
1537 * @param header Pointer to the ::EVENT_HEADER.
1538 * @param start_epoch_microsec
1539 * The start epoch to set, in microseconds.
1540 *****************************************************************************/
1541 void evel_start_epoch_set(EVENT_HEADER * const header,
1542 const unsigned long long start_epoch_microsec);
1544 /**************************************************************************//**
1545 * Set the Last Epoch property of the event header.
1547 * @note The Last Epoch defaults to the time of event creation.
1549 * @param header Pointer to the ::EVENT_HEADER.
1550 * @param last_epoch_microsec
1551 * The last epoch to set, in microseconds.
1552 *****************************************************************************/
1553 void evel_last_epoch_set(EVENT_HEADER * const header,
1554 const unsigned long long last_epoch_microsec);
1556 /**************************************************************************//**
1557 * Set the Reporting Entity Name property of the event header.
1559 * @note The Reporting Entity Name defaults to the OpenStack VM Name.
1561 * @param header Pointer to the ::EVENT_HEADER.
1562 * @param entity_name The entity name to set.
1563 *****************************************************************************/
1564 void evel_reporting_entity_name_set(EVENT_HEADER * const header,
1565 const char * const entity_name);
1567 /**************************************************************************//**
1568 * Set the Reporting Entity Id property of the event header.
1570 * @note The Reporting Entity Id defaults to the OpenStack VM UUID.
1572 * @param header Pointer to the ::EVENT_HEADER.
1573 * @param entity_id The entity id to set.
1574 *****************************************************************************/
1575 void evel_reporting_entity_id_set(EVENT_HEADER * const header,
1576 const char * const entity_id);
1578 /**************************************************************************//**
1579 * Set the NFC Naming code property of the event header.
1581 * @param header Pointer to the ::EVENT_HEADER.
1582 * @param nfcnamingcode String
1583 *****************************************************************************/
1584 void evel_nfcnamingcode_set(EVENT_HEADER * const header,
1585 const char * const nfcnam);
1586 /**************************************************************************//**
1587 * Set the NF Naming code property of the event header.
1589 * @param header Pointer to the ::EVENT_HEADER.
1590 * @param nfnamingcode String
1591 *****************************************************************************/
1592 void evel_nfnamingcode_set(EVENT_HEADER * const header,
1593 const char * const nfnam);
1595 /*****************************************************************************/
1596 /*****************************************************************************/
1600 /*****************************************************************************/
1601 /*****************************************************************************/
1603 /**************************************************************************//**
1604 * Create a new fault event.
1606 * @note The mandatory fields on the Fault must be supplied to this factory
1607 * function and are immutable once set. Optional fields have explicit
1608 * setter functions, but again values may only be set once so that the
1609 * Fault has immutable properties.
1610 * @param event_name Unique Event Name
1611 * @param event_id A universal identifier of the event for analysis etc
1612 * @param condition The condition indicated by the Fault.
1613 * @param specific_problem The specific problem triggering the fault.
1614 * @param priority The priority of the event.
1615 * @param severity The severity of the Fault.
1616 * @param ev_source_type Source of Alarm event
1617 * @param version fault version
1618 * @param status status of Virtual Function
1619 * @returns pointer to the newly manufactured ::EVENT_FAULT. If the event is
1620 * not used (i.e. posted) it must be released using ::evel_free_fault.
1621 * @retval NULL Failed to create the event.
1622 *****************************************************************************/
1623 EVENT_FAULT * evel_new_fault(const char* ev_name, const char *ev_id,
1624 const char * const condition,
1625 const char * const specific_problem,
1626 EVEL_EVENT_PRIORITIES priority,
1627 EVEL_SEVERITIES severity,
1628 EVEL_SOURCE_TYPES ev_source_type,
1629 EVEL_VF_STATUSES status);
1631 /**************************************************************************//**
1634 * Free off the Fault supplied. Will free all the contained allocated memory.
1636 * @note It does not free the Fault itself, since that may be part of a
1638 *****************************************************************************/
1639 void evel_free_fault(EVENT_FAULT * event);
1641 /**************************************************************************//**
1642 * Set the Fault Category property of the Fault.
1644 * @note The property is treated as immutable: it is only valid to call
1645 * the setter once. However, we don't assert if the caller tries to
1646 * overwrite, just ignoring the update instead.
1648 * @param fault Pointer to the fault.
1649 * @param category Category : license, link, routing, security, signaling.
1650 * ASCIIZ string. The caller
1651 * does not need to preserve the value once the function
1653 *****************************************************************************/
1654 void evel_fault_category_set(EVENT_FAULT * fault,
1655 const char * const category);
1657 /**************************************************************************//**
1658 * Set the Alarm Interface A property of the Fault.
1660 * @note The property is treated as immutable: it is only valid to call
1661 * the setter once. However, we don't assert if the caller tries to
1662 * overwrite, just ignoring the update instead.
1664 * @param fault Pointer to the fault.
1665 * @param interface The Alarm Interface A to be set. ASCIIZ string. The caller
1666 * does not need to preserve the value once the function
1668 *****************************************************************************/
1669 void evel_fault_interface_set(EVENT_FAULT * fault,
1670 const char * const interface);
1672 /**************************************************************************//**
1673 * Add an additional value name/value pair to the Fault.
1675 * The name and value are null delimited ASCII strings. The library takes
1676 * a copy so the caller does not have to preserve values after the function
1679 * @param fault Pointer to the fault.
1680 * @param name ASCIIZ string with the attribute's name.
1681 * @param value ASCIIZ string with the attribute's value.
1682 *****************************************************************************/
1683 void evel_fault_addl_info_add(EVENT_FAULT * fault, char * name, char * value);
1685 /**************************************************************************//**
1686 * Set the Event Type property of the Fault.
1688 * @note The property is treated as immutable: it is only valid to call
1689 * the setter once. However, we don't assert if the caller tries to
1690 * overwrite, just ignoring the update instead.
1692 * @param fault Pointer to the fault.
1693 * @param type The Event Type to be set. ASCIIZ string. The caller
1694 * does not need to preserve the value once the function
1696 *****************************************************************************/
1697 void evel_fault_type_set(EVENT_FAULT * fault, const char * const type);
1699 /*****************************************************************************/
1700 /*****************************************************************************/
1704 /*****************************************************************************/
1705 /*****************************************************************************/
1707 /**************************************************************************//**
1708 * Create a new Measurement event.
1710 * @note The mandatory fields on the Measurement must be supplied to this
1711 * factory function and are immutable once set. Optional fields have
1712 * explicit setter functions, but again values may only be set once so
1713 * that the Measurement has immutable properties.
1715 * @param measurement_interval
1716 * @param event_name Unique Event Name
1717 * @param event_id A universal identifier of the event for analysis etc
1719 * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT. If the
1720 * event is not used (i.e. posted) it must be released using
1721 * ::evel_free_event.
1722 * @retval NULL Failed to create the event.
1723 *****************************************************************************/
1724 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval,const char* ev_name, const char *ev_id);
1726 /**************************************************************************//**
1727 * Free a Measurement.
1729 * Free off the Measurement supplied. Will free all the contained allocated
1732 * @note It does not free the Measurement itself, since that may be part of a
1734 *****************************************************************************/
1735 void evel_free_measurement(EVENT_MEASUREMENT * event);
1737 /**************************************************************************//**
1738 * Set the Event Type property of the Measurement.
1740 * @note The property is treated as immutable: it is only valid to call
1741 * the setter once. However, we don't assert if the caller tries to
1742 * overwrite, just ignoring the update instead.
1744 * @param measurement Pointer to the Measurement.
1745 * @param type The Event Type to be set. ASCIIZ string. The caller
1746 * does not need to preserve the value once the function
1748 *****************************************************************************/
1749 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
1750 const char * const type);
1752 /**************************************************************************//**
1753 * Set the Concurrent Sessions property of the Measurement.
1755 * @note The property is treated as immutable: it is only valid to call
1756 * the setter once. However, we don't assert if the caller tries to
1757 * overwrite, just ignoring the update instead.
1759 * @param measurement Pointer to the Measurement.
1760 * @param concurrent_sessions The Concurrent Sessions to be set.
1761 *****************************************************************************/
1762 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
1763 int concurrent_sessions);
1765 /**************************************************************************//**
1766 * Set the Configured Entities property of the Measurement.
1768 * @note The property is treated as immutable: it is only valid to call
1769 * the setter once. However, we don't assert if the caller tries to
1770 * overwrite, just ignoring the update instead.
1772 * @param measurement Pointer to the Measurement.
1773 * @param configured_entities The Configured Entities to be set.
1774 *****************************************************************************/
1775 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
1776 int configured_entities);
1778 /**************************************************************************//**
1779 * Add an additional set of Errors to the Measurement.
1781 * @note The property is treated as immutable: it is only valid to call
1782 * the setter once. However, we don't assert if the caller tries to
1783 * overwrite, just ignoring the update instead.
1785 * @param measurement Pointer to the measurement.
1786 * @param receive_discards The number of receive discards.
1787 * @param receive_errors The number of receive errors.
1788 * @param transmit_discards The number of transmit discards.
1789 * @param transmit_errors The number of transmit errors.
1790 *****************************************************************************/
1791 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
1792 int receive_discards,
1794 int transmit_discards,
1795 int transmit_errors);
1797 /**************************************************************************//**
1798 * Set the Mean Request Latency property of the Measurement.
1800 * @note The property is treated as immutable: it is only valid to call
1801 * the setter once. However, we don't assert if the caller tries to
1802 * overwrite, just ignoring the update instead.
1804 * @param measurement Pointer to the Measurement.
1805 * @param mean_request_latency The Mean Request Latency to be set.
1806 *****************************************************************************/
1807 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
1808 double mean_request_latency);
1810 /**************************************************************************//**
1811 * Set the Request Rate property of the Measurement.
1813 * @note The property is treated as immutable: it is only valid to call
1814 * the setter once. However, we don't assert if the caller tries to
1815 * overwrite, just ignoring the update instead.
1817 * @param measurement Pointer to the Measurement.
1818 * @param request_rate The Request Rate to be set.
1819 *****************************************************************************/
1820 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
1823 /**************************************************************************//**
1824 * Add an additional CPU usage value name/value pair to the Measurement.
1826 * The name and value are null delimited ASCII strings. The library takes
1827 * a copy so the caller does not have to preserve values after the function
1830 * @param measurement Pointer to the measurement.
1831 * @param id ASCIIZ string with the CPU's identifier.
1832 * @param usage CPU utilization.
1833 *****************************************************************************/
1834 MEASUREMENT_CPU_USE * evel_measurement_new_cpu_use_add(EVENT_MEASUREMENT * measurement, char * id, double usage);
1836 /**************************************************************************//**
1837 * Set the CPU Idle value in measurement interval
1838 * percentage of CPU time spent in the idle task
1840 * @note The property is treated as immutable: it is only valid to call
1841 * the setter once. However, we don't assert if the caller tries to
1842 * overwrite, just ignoring the update instead.
1844 * @param cpu_use Pointer to the CPU Use.
1846 *****************************************************************************/
1847 void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE *const cpu_use,
1850 /**************************************************************************//**
1851 * Set the percentage of time spent servicing interrupts
1853 * @note The property is treated as immutable: it is only valid to call
1854 * the setter once. However, we don't assert if the caller tries to
1855 * overwrite, just ignoring the update instead.
1857 * @param cpu_use Pointer to the CPU Use.
1859 *****************************************************************************/
1860 void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE * const cpu_use,
1863 /**************************************************************************//**
1864 * Set the percentage of time spent running user space processes that have been niced
1866 * @note The property is treated as immutable: it is only valid to call
1867 * the setter once. However, we don't assert if the caller tries to
1868 * overwrite, just ignoring the update instead.
1870 * @param cpu_use Pointer to the CPU Use.
1872 *****************************************************************************/
1873 void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE * const cpu_use,
1876 /**************************************************************************//**
1877 * Set the percentage of time spent handling soft irq interrupts
1879 * @note The property is treated as immutable: it is only valid to call
1880 * the setter once. However, we don't assert if the caller tries to
1881 * overwrite, just ignoring the update instead.
1883 * @param cpu_use Pointer to the CPU Use.
1885 *****************************************************************************/
1886 void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE * const cpu_use,
1888 /**************************************************************************//**
1889 * Set the percentage of time spent in involuntary wait
1891 * @note The property is treated as immutable: it is only valid to call
1892 * the setter once. However, we don't assert if the caller tries to
1893 * overwrite, just ignoring the update instead.
1895 * @param cpu_use Pointer to the CPU Use.
1897 *****************************************************************************/
1898 void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE * const cpu_use,
1900 /**************************************************************************//**
1901 * Set the percentage of time spent on system tasks running the kernel
1903 * @note The property is treated as immutable: it is only valid to call
1904 * the setter once. However, we don't assert if the caller tries to
1905 * overwrite, just ignoring the update instead.
1907 * @param cpu_use Pointer to the CPU Use.
1909 *****************************************************************************/
1910 void evel_measurement_cpu_use_system_set(MEASUREMENT_CPU_USE * const cpu_use,
1912 /**************************************************************************//**
1913 * Set the percentage of time spent running un-niced user space processes
1915 * @note The property is treated as immutable: it is only valid to call
1916 * the setter once. However, we don't assert if the caller tries to
1917 * overwrite, just ignoring the update instead.
1919 * @param cpu_use Pointer to the CPU Use.
1921 *****************************************************************************/
1922 void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE * const cpu_use,
1924 /**************************************************************************//**
1925 * Set the percentage of CPU time spent waiting for I/O operations to complete
1927 * @note The property is treated as immutable: it is only valid to call
1928 * the setter once. However, we don't assert if the caller tries to
1929 * overwrite, just ignoring the update instead.
1931 * @param cpu_use Pointer to the CPU Use.
1933 *****************************************************************************/
1934 void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE * const cpu_use,
1937 /**************************************************************************//**
1938 * Add an additional File System usage value name/value pair to the
1941 * The filesystem_name is null delimited ASCII string. The library takes a
1942 * copy so the caller does not have to preserve values after the function
1945 * @param measurement Pointer to the measurement.
1946 * @param filesystem_name ASCIIZ string with the file-system's UUID.
1947 * @param block_configured Block storage configured.
1948 * @param block_used Block storage in use.
1949 * @param block_iops Block storage IOPS.
1950 * @param ephemeral_configured Ephemeral storage configured.
1951 * @param ephemeral_used Ephemeral storage in use.
1952 * @param ephemeral_iops Ephemeral storage IOPS.
1953 *****************************************************************************/
1954 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
1955 char * filesystem_name,
1956 double block_configured,
1959 double ephemeral_configured,
1960 double ephemeral_used,
1961 double ephemeral_iops);
1963 /**************************************************************************//**
1964 * Add a Feature usage value name/value pair to the Measurement.
1966 * The name is null delimited ASCII string. The library takes
1967 * a copy so the caller does not have to preserve values after the function
1970 * @param measurement Pointer to the measurement.
1971 * @param feature ASCIIZ string with the feature's name.
1972 * @param utilization Utilization of the feature.
1973 *****************************************************************************/
1974 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
1978 /**************************************************************************//**
1979 * Add a Additional Measurement value name/value pair to the Measurement.
1981 * The name is null delimited ASCII string. The library takes
1982 * a copy so the caller does not have to preserve values after the function
1985 * @param measurement Pointer to the Measurement.
1986 * @param group ASCIIZ string with the measurement group's name.
1987 * @param name ASCIIZ string containing the measurement's name.
1988 * @param name ASCIIZ string containing the measurement's value.
1989 *****************************************************************************/
1990 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
1991 const char * const group,
1992 const char * const name,
1993 const char * const value);
1995 /**************************************************************************//**
1996 * Add a Codec usage value name/value pair to the Measurement.
1998 * The name is null delimited ASCII string. The library takes
1999 * a copy so the caller does not have to preserve values after the function
2002 * @param measurement Pointer to the measurement.
2003 * @param codec ASCIIZ string with the codec's name.
2004 * @param utilization Utilization of the feature.
2005 *****************************************************************************/
2006 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
2010 /**************************************************************************//**
2011 * Set the Media Ports in Use property of the Measurement.
2013 * @note The property is treated as immutable: it is only valid to call
2014 * the setter once. However, we don't assert if the caller tries to
2015 * overwrite, just ignoring the update instead.
2017 * @param measurement Pointer to the measurement.
2018 * @param media_ports_in_use The media port usage to set.
2019 *****************************************************************************/
2020 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
2021 int media_ports_in_use);
2023 /**************************************************************************//**
2024 * Set the VNFC Scaling Metric property of the Measurement.
2026 * @note The property is treated as immutable: it is only valid to call
2027 * the setter once. However, we don't assert if the caller tries to
2028 * overwrite, just ignoring the update instead.
2030 * @param measurement Pointer to the measurement.
2031 * @param scaling_metric The scaling metric to set.
2032 *****************************************************************************/
2033 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
2034 int scaling_metric);
2036 /**************************************************************************//**
2037 * Create a new Latency Bucket to be added to a Measurement event.
2039 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
2040 * supplied to this factory function and are immutable once set.
2041 * Optional fields have explicit setter functions, but again values
2042 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
2043 * immutable properties.
2045 * @param count Count of events in this bucket.
2047 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
2048 * @retval NULL Failed to create the Latency Bucket.
2049 *****************************************************************************/
2050 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count);
2052 /**************************************************************************//**
2053 * Set the High End property of the Measurement Latency Bucket.
2055 * @note The property is treated as immutable: it is only valid to call
2056 * the setter once. However, we don't assert if the caller tries to
2057 * overwrite, just ignoring the update instead.
2059 * @param bucket Pointer to the Measurement Latency Bucket.
2060 * @param high_end High end of the bucket's range.
2061 *****************************************************************************/
2062 void evel_meas_latency_bucket_high_end_set(
2063 MEASUREMENT_LATENCY_BUCKET * const bucket,
2064 const double high_end);
2066 /**************************************************************************//**
2067 * Set the Low End property of the Measurement Latency Bucket.
2069 * @note The property is treated as immutable: it is only valid to call
2070 * the setter once. However, we don't assert if the caller tries to
2071 * overwrite, just ignoring the update instead.
2073 * @param bucket Pointer to the Measurement Latency Bucket.
2074 * @param low_end Low end of the bucket's range.
2075 *****************************************************************************/
2076 void evel_meas_latency_bucket_low_end_set(
2077 MEASUREMENT_LATENCY_BUCKET * const bucket,
2078 const double low_end);
2080 /**************************************************************************//**
2081 * Add an additional Measurement Latency Bucket to the specified event.
2083 * @param measurement Pointer to the Measurement event.
2084 * @param bucket Pointer to the Measurement Latency Bucket to add.
2085 *****************************************************************************/
2086 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
2087 MEASUREMENT_LATENCY_BUCKET * const bucket);
2089 /**************************************************************************//**
2090 * Add an additional Latency Distribution bucket to the Measurement.
2092 * This function implements the previous API, purely for convenience.
2094 * @param measurement Pointer to the measurement.
2095 * @param low_end Low end of the bucket's range.
2096 * @param high_end High end of the bucket's range.
2097 * @param count Count of events in this bucket.
2098 *****************************************************************************/
2099 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
2100 const double low_end,
2101 const double high_end,
2104 /**************************************************************************//**
2105 * Create a new vNIC Use to be added to a Measurement event.
2107 * @note The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
2108 * to this factory function and are immutable once set. Optional
2109 * fields have explicit setter functions, but again values may only be
2110 * set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
2113 * @param vnic_id ASCIIZ string with the vNIC's ID.
2114 * @param val_suspect True or false confidence in data.
2116 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
2117 * If the structure is not used it must be released using
2118 * ::evel_measurement_free_vnic_performance.
2119 * @retval NULL Failed to create the vNIC Use.
2120 *****************************************************************************/
2121 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id, char * const val_suspect);
2123 /**************************************************************************//**
2126 * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied. Will free all the contained
2129 * @note It does not free the vNIC Use itself, since that may be part of a
2131 *****************************************************************************/
2132 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2134 /**************************************************************************//**
2135 * Set the Accumulated Broadcast Packets Received in measurement interval
2136 * property of the vNIC performance.
2138 * @note The property is treated as immutable: it is only valid to call
2139 * the setter once. However, we don't assert if the caller tries to
2140 * overwrite, just ignoring the update instead.
2142 * @param vnic_performance Pointer to the vNIC Use.
2143 * @param recvd_bcast_packets_acc
2144 *****************************************************************************/
2145 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2146 const double recvd_bcast_packets_acc);
2147 /**************************************************************************//**
2148 * Set the Delta Broadcast Packets Received in measurement interval
2149 * property of the vNIC performance.
2151 * @note The property is treated as immutable: it is only valid to call
2152 * the setter once. However, we don't assert if the caller tries to
2153 * overwrite, just ignoring the update instead.
2155 * @param vnic_performance Pointer to the vNIC Use.
2156 * @param recvd_bcast_packets_delta
2157 *****************************************************************************/
2158 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2159 const double recvd_bcast_packets_delta);
2160 /**************************************************************************//**
2161 * Set the Discarded Packets Received in measurement interval
2162 * property of the vNIC performance.
2164 * @note The property is treated as immutable: it is only valid to call
2165 * the setter once. However, we don't assert if the caller tries to
2166 * overwrite, just ignoring the update instead.
2168 * @param vnic_performance Pointer to the vNIC Use.
2169 * @param recvd_discard_packets_acc
2170 *****************************************************************************/
2171 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2172 const double recvd_discard_packets_acc);
2173 /**************************************************************************//**
2174 * Set the Delta Discarded Packets Received in measurement interval
2175 * property of the vNIC performance.
2177 * @note The property is treated as immutable: it is only valid to call
2178 * the setter once. However, we don't assert if the caller tries to
2179 * overwrite, just ignoring the update instead.
2181 * @param vnic_performance Pointer to the vNIC Use.
2182 * @param recvd_discard_packets_delta
2183 *****************************************************************************/
2184 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2185 const double recvd_discard_packets_delta);
2186 /**************************************************************************//**
2187 * Set the Error Packets Received in measurement interval
2188 * property of the vNIC performance.
2190 * @note The property is treated as immutable: it is only valid to call
2191 * the setter once. However, we don't assert if the caller tries to
2192 * overwrite, just ignoring the update instead.
2194 * @param vnic_performance Pointer to the vNIC Use.
2195 * @param recvd_error_packets_acc
2196 *****************************************************************************/
2197 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2198 const double recvd_error_packets_acc);
2199 /**************************************************************************//**
2200 * Set the Delta Error Packets Received in measurement interval
2201 * property of the vNIC performance.
2203 * @note The property is treated as immutable: it is only valid to call
2204 * the setter once. However, we don't assert if the caller tries to
2205 * overwrite, just ignoring the update instead.
2207 * @param vnic_performance Pointer to the vNIC Use.
2208 * @param recvd_error_packets_delta
2209 *****************************************************************************/
2210 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2211 const double recvd_error_packets_delta);
2212 /**************************************************************************//**
2213 * Set the Accumulated Multicast Packets Received in measurement interval
2214 * property of the vNIC performance.
2216 * @note The property is treated as immutable: it is only valid to call
2217 * the setter once. However, we don't assert if the caller tries to
2218 * overwrite, just ignoring the update instead.
2220 * @param vnic_performance Pointer to the vNIC Use.
2221 * @param recvd_mcast_packets_acc
2222 *****************************************************************************/
2223 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2224 const double recvd_mcast_packets_acc);
2225 /**************************************************************************//**
2226 * Set the Delta Multicast Packets Received in measurement interval
2227 * property of the vNIC performance.
2229 * @note The property is treated as immutable: it is only valid to call
2230 * the setter once. However, we don't assert if the caller tries to
2231 * overwrite, just ignoring the update instead.
2233 * @param vnic_performance Pointer to the vNIC Use.
2234 * @param recvd_mcast_packets_delta
2235 *****************************************************************************/
2236 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2237 const double recvd_mcast_packets_delta);
2238 /**************************************************************************//**
2239 * Set the Accumulated Octets Received in measurement interval
2240 * property of the vNIC performance.
2242 * @note The property is treated as immutable: it is only valid to call
2243 * the setter once. However, we don't assert if the caller tries to
2244 * overwrite, just ignoring the update instead.
2246 * @param vnic_performance Pointer to the vNIC Use.
2247 * @param recvd_octets_acc
2248 *****************************************************************************/
2249 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2250 const double recvd_octets_acc);
2251 /**************************************************************************//**
2252 * Set the Delta Octets Received in measurement interval
2253 * property of the vNIC performance.
2255 * @note The property is treated as immutable: it is only valid to call
2256 * the setter once. However, we don't assert if the caller tries to
2257 * overwrite, just ignoring the update instead.
2259 * @param vnic_performance Pointer to the vNIC Use.
2260 * @param recvd_octets_delta
2261 *****************************************************************************/
2262 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2263 const double recvd_octets_delta);
2264 /**************************************************************************//**
2265 * Set the Accumulated Total Packets Received in measurement interval
2266 * property of the vNIC performance.
2268 * @note The property is treated as immutable: it is only valid to call
2269 * the setter once. However, we don't assert if the caller tries to
2270 * overwrite, just ignoring the update instead.
2272 * @param vnic_performance Pointer to the vNIC Use.
2273 * @param recvd_total_packets_acc
2274 *****************************************************************************/
2275 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2276 const double recvd_total_packets_acc);
2277 /**************************************************************************//**
2278 * Set the Delta Total Packets Received in measurement interval
2279 * property of the vNIC performance.
2281 * @note The property is treated as immutable: it is only valid to call
2282 * the setter once. However, we don't assert if the caller tries to
2283 * overwrite, just ignoring the update instead.
2285 * @param vnic_performance Pointer to the vNIC Use.
2286 * @param recvd_total_packets_delta
2287 *****************************************************************************/
2288 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2289 const double recvd_total_packets_delta);
2290 /**************************************************************************//**
2291 * Set the Accumulated Unicast Packets Received in measurement interval
2292 * property of the vNIC performance.
2294 * @note The property is treated as immutable: it is only valid to call
2295 * the setter once. However, we don't assert if the caller tries to
2296 * overwrite, just ignoring the update instead.
2298 * @param vnic_performance Pointer to the vNIC Use.
2299 * @param recvd_ucast_packets_acc
2300 *****************************************************************************/
2301 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2302 const double recvd_ucast_packets_acc);
2303 /**************************************************************************//**
2304 * Set the Delta Unicast packets Received in measurement interval
2305 * property of the vNIC performance.
2307 * @note The property is treated as immutable: it is only valid to call
2308 * the setter once. However, we don't assert if the caller tries to
2309 * overwrite, just ignoring the update instead.
2311 * @param vnic_performance Pointer to the vNIC Use.
2312 * @param recvd_ucast_packets_delta
2313 *****************************************************************************/
2314 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2315 const double recvd_ucast_packets_delta);
2316 /**************************************************************************//**
2317 * Set the Transmitted Broadcast Packets in measurement interval
2318 * property of the vNIC performance.
2320 * @note The property is treated as immutable: it is only valid to call
2321 * the setter once. However, we don't assert if the caller tries to
2322 * overwrite, just ignoring the update instead.
2324 * @param vnic_performance Pointer to the vNIC Use.
2325 * @param tx_bcast_packets_acc
2326 *****************************************************************************/
2327 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2328 const double tx_bcast_packets_acc);
2329 /**************************************************************************//**
2330 * Set the Delta Broadcast packets Transmitted in measurement interval
2331 * property of the vNIC performance.
2333 * @note The property is treated as immutable: it is only valid to call
2334 * the setter once. However, we don't assert if the caller tries to
2335 * overwrite, just ignoring the update instead.
2337 * @param vnic_performance Pointer to the vNIC Use.
2338 * @param tx_bcast_packets_delta
2339 *****************************************************************************/
2340 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2341 const double tx_bcast_packets_delta);
2342 /**************************************************************************//**
2343 * Set the Transmitted Discarded Packets in measurement interval
2344 * property of the vNIC performance.
2346 * @note The property is treated as immutable: it is only valid to call
2347 * the setter once. However, we don't assert if the caller tries to
2348 * overwrite, just ignoring the update instead.
2350 * @param vnic_performance Pointer to the vNIC Use.
2351 * @param tx_discarded_packets_acc
2352 *****************************************************************************/
2353 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2354 const double tx_discarded_packets_acc);
2355 /**************************************************************************//**
2356 * Set the Delta Discarded packets Transmitted in measurement interval
2357 * property of the vNIC performance.
2359 * @note The property is treated as immutable: it is only valid to call
2360 * the setter once. However, we don't assert if the caller tries to
2361 * overwrite, just ignoring the update instead.
2363 * @param vnic_performance Pointer to the vNIC Use.
2364 * @param tx_discarded_packets_delta
2365 *****************************************************************************/
2366 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2367 const double tx_discarded_packets_delta);
2368 /**************************************************************************//**
2369 * Set the Transmitted Errored Packets in measurement interval
2370 * property of the vNIC performance.
2372 * @note The property is treated as immutable: it is only valid to call
2373 * the setter once. However, we don't assert if the caller tries to
2374 * overwrite, just ignoring the update instead.
2376 * @param vnic_performance Pointer to the vNIC Use.
2377 * @param tx_error_packets_acc
2378 *****************************************************************************/
2379 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2380 const double tx_error_packets_acc);
2381 /**************************************************************************//**
2382 * Set the Delta Errored packets Transmitted in measurement interval
2383 * property of the vNIC performance.
2385 * @note The property is treated as immutable: it is only valid to call
2386 * the setter once. However, we don't assert if the caller tries to
2387 * overwrite, just ignoring the update instead.
2389 * @param vnic_performance Pointer to the vNIC Use.
2390 * @param tx_error_packets_delta
2391 *****************************************************************************/
2392 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2393 const double tx_error_packets_delta);
2394 /**************************************************************************//**
2395 * Set the Transmitted Multicast Packets in measurement interval
2396 * property of the vNIC performance.
2398 * @note The property is treated as immutable: it is only valid to call
2399 * the setter once. However, we don't assert if the caller tries to
2400 * overwrite, just ignoring the update instead.
2402 * @param vnic_performance Pointer to the vNIC Use.
2403 * @param tx_mcast_packets_acc
2404 *****************************************************************************/
2405 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2406 const double tx_mcast_packets_acc);
2407 /**************************************************************************//**
2408 * Set the Delta Multicast packets Transmitted in measurement interval
2409 * property of the vNIC performance.
2411 * @note The property is treated as immutable: it is only valid to call
2412 * the setter once. However, we don't assert if the caller tries to
2413 * overwrite, just ignoring the update instead.
2415 * @param vnic_performance Pointer to the vNIC Use.
2416 * @param tx_mcast_packets_delta
2417 *****************************************************************************/
2418 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2419 const double tx_mcast_packets_delta);
2420 /**************************************************************************//**
2421 * Set the Transmitted Octets in measurement interval
2422 * property of the vNIC performance.
2424 * @note The property is treated as immutable: it is only valid to call
2425 * the setter once. However, we don't assert if the caller tries to
2426 * overwrite, just ignoring the update instead.
2428 * @param vnic_performance Pointer to the vNIC Use.
2429 * @param tx_octets_acc
2430 *****************************************************************************/
2431 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2432 const double tx_octets_acc);
2433 /**************************************************************************//**
2434 * Set the Delta Octets Transmitted in measurement interval
2435 * property of the vNIC performance.
2437 * @note The property is treated as immutable: it is only valid to call
2438 * the setter once. However, we don't assert if the caller tries to
2439 * overwrite, just ignoring the update instead.
2441 * @param vnic_performance Pointer to the vNIC Use.
2442 * @param tx_octets_delta
2443 *****************************************************************************/
2444 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2445 const double tx_octets_delta);
2446 /**************************************************************************//**
2447 * Set the Transmitted Total Packets in measurement interval
2448 * property of the vNIC performance.
2450 * @note The property is treated as immutable: it is only valid to call
2451 * the setter once. However, we don't assert if the caller tries to
2452 * overwrite, just ignoring the update instead.
2454 * @param vnic_performance Pointer to the vNIC Use.
2455 * @param tx_total_packets_acc
2456 *****************************************************************************/
2457 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2458 const double tx_total_packets_acc);
2459 /**************************************************************************//**
2460 * Set the Delta Total Packets Transmitted in measurement interval
2461 * property of the vNIC performance.
2463 * @note The property is treated as immutable: it is only valid to call
2464 * the setter once. However, we don't assert if the caller tries to
2465 * overwrite, just ignoring the update instead.
2467 * @param vnic_performance Pointer to the vNIC Use.
2468 * @param tx_total_packets_delta
2469 *****************************************************************************/
2470 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2471 const double tx_total_packets_delta);
2472 /**************************************************************************//**
2473 * Set the Transmitted Unicast Packets in measurement interval
2474 * property of the vNIC performance.
2476 * @note The property is treated as immutable: it is only valid to call
2477 * the setter once. However, we don't assert if the caller tries to
2478 * overwrite, just ignoring the update instead.
2480 * @param vnic_performance Pointer to the vNIC Use.
2481 * @param tx_ucast_packets_acc
2482 *****************************************************************************/
2483 void evel_vnic_performance_tx_ucast_packets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2484 const double tx_ucast_packets_acc);
2485 /**************************************************************************//**
2486 * Set the Delta Octets Transmitted in measurement interval
2487 * property of the vNIC performance.
2489 * @note The property is treated as immutable: it is only valid to call
2490 * the setter once. However, we don't assert if the caller tries to
2491 * overwrite, just ignoring the update instead.
2493 * @param vnic_performance Pointer to the vNIC Use.
2494 * @param tx_ucast_packets_delta
2495 *****************************************************************************/
2496 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2497 const double tx_ucast_packets_delta);
2499 /**************************************************************************//**
2500 * Add an additional vNIC Use to the specified Measurement event.
2502 * @param measurement Pointer to the measurement.
2503 * @param vnic_performance Pointer to the vNIC Use to add.
2504 *****************************************************************************/
2505 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2506 MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2508 /**************************************************************************//**
2509 * Add an additional vNIC usage record Measurement.
2511 * This function implements the previous API, purely for convenience.
2513 * The ID is null delimited ASCII string. The library takes a copy so the
2514 * caller does not have to preserve values after the function returns.
2516 * @param measurement Pointer to the measurement.
2517 * @param vnic_id ASCIIZ string with the vNIC's ID.
2518 * @param valset true or false confidence level
2519 * @param recvd_bcast_packets_acc Recieved broadcast packets
2520 * @param recvd_bcast_packets_delta Received delta broadcast packets
2521 * @param recvd_discarded_packets_acc Recieved discarded packets
2522 * @param recvd_discarded_packets_delta Received discarded delta packets
2523 * @param recvd_error_packets_acc Received error packets
2524 * @param recvd_error_packets_delta, Received delta error packets
2525 * @param recvd_mcast_packets_acc Received multicast packets
2526 * @param recvd_mcast_packets_delta Received delta multicast packets
2527 * @param recvd_octets_acc Received octets
2528 * @param recvd_octets_delta Received delta octets
2529 * @param recvd_total_packets_acc Received total packets
2530 * @param recvd_total_packets_delta Received delta total packets
2531 * @param recvd_ucast_packets_acc Received Unicast packets
2532 * @param recvd_ucast_packets_delta Received delta unicast packets
2533 * @param tx_bcast_packets_acc Transmitted broadcast packets
2534 * @param tx_bcast_packets_delta Transmitted delta broadcast packets
2535 * @param tx_discarded_packets_acc Transmitted packets discarded
2536 * @param tx_discarded_packets_delta Transmitted delta discarded packets
2537 * @param tx_error_packets_acc Transmitted error packets
2538 * @param tx_error_packets_delta Transmitted delta error packets
2539 * @param tx_mcast_packets_acc Transmitted multicast packets accumulated
2540 * @param tx_mcast_packets_delta Transmitted delta multicast packets
2541 * @param tx_octets_acc Transmitted octets
2542 * @param tx_octets_delta Transmitted delta octets
2543 * @param tx_total_packets_acc Transmitted total packets
2544 * @param tx_total_packets_delta Transmitted delta total packets
2545 * @param tx_ucast_packets_acc Transmitted Unicast packets
2546 * @param tx_ucast_packets_delta Transmitted delta Unicast packets
2547 *****************************************************************************/
2548 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2549 char * const vnic_id,
2551 double recvd_bcast_packets_acc,
2552 double recvd_bcast_packets_delta,
2553 double recvd_discarded_packets_acc,
2554 double recvd_discarded_packets_delta,
2555 double recvd_error_packets_acc,
2556 double recvd_error_packets_delta,
2557 double recvd_mcast_packets_acc,
2558 double recvd_mcast_packets_delta,
2559 double recvd_octets_acc,
2560 double recvd_octets_delta,
2561 double recvd_total_packets_acc,
2562 double recvd_total_packets_delta,
2563 double recvd_ucast_packets_acc,
2564 double recvd_ucast_packets_delta,
2565 double tx_bcast_packets_acc,
2566 double tx_bcast_packets_delta,
2567 double tx_discarded_packets_acc,
2568 double tx_discarded_packets_delta,
2569 double tx_error_packets_acc,
2570 double tx_error_packets_delta,
2571 double tx_mcast_packets_acc,
2572 double tx_mcast_packets_delta,
2573 double tx_octets_acc,
2574 double tx_octets_delta,
2575 double tx_total_packets_acc,
2576 double tx_total_packets_delta,
2577 double tx_ucast_packets_acc,
2578 double tx_ucast_packets_delta);
2580 /*****************************************************************************/
2581 /*****************************************************************************/
2585 /*****************************************************************************/
2586 /*****************************************************************************/
2588 /**************************************************************************//**
2589 * Create a new Report event.
2591 * @note The mandatory fields on the Report must be supplied to this
2592 * factory function and are immutable once set. Optional fields have
2593 * explicit setter functions, but again values may only be set once so
2594 * that the Report has immutable properties.
2596 * @param measurement_interval
2597 * @param event_name Unique Event Name
2598 * @param event_id A universal identifier of the event for analysis etc
2600 * @returns pointer to the newly manufactured ::EVENT_REPORT. If the event is
2601 * not used (i.e. posted) it must be released using
2602 * ::evel_free_report.
2603 * @retval NULL Failed to create the event.
2604 *****************************************************************************/
2605 EVENT_REPORT * evel_new_report(double measurement_interval,const char* ev_name, const char *ev_id);
2607 /**************************************************************************//**
2610 * Free off the Report supplied. Will free all the contained allocated memory.
2612 * @note It does not free the Report itself, since that may be part of a
2614 *****************************************************************************/
2615 void evel_free_report(EVENT_REPORT * event);
2617 /**************************************************************************//**
2618 * Set the Event Type property of the Report.
2620 * @note The property is treated as immutable: it is only valid to call
2621 * the setter once. However, we don't assert if the caller tries to
2622 * overwrite, just ignoring the update instead.
2624 * @param report Pointer to the Report.
2625 * @param type The Event Type to be set. ASCIIZ string. The caller
2626 * does not need to preserve the value once the function
2628 *****************************************************************************/
2629 void evel_report_type_set(EVENT_REPORT * report, const char * const type);
2631 /**************************************************************************//**
2632 * Add a Feature usage value name/value pair to the Report.
2634 * The name is null delimited ASCII string. The library takes
2635 * a copy so the caller does not have to preserve values after the function
2638 * @param report Pointer to the report.
2639 * @param feature ASCIIZ string with the feature's name.
2640 * @param utilization Utilization of the feature.
2641 *****************************************************************************/
2642 void evel_report_feature_use_add(EVENT_REPORT * report,
2646 /**************************************************************************//**
2647 * Add a Additional Measurement value name/value pair to the Report.
2649 * The name is null delimited ASCII string. The library takes
2650 * a copy so the caller does not have to preserve values after the function
2653 * @param report Pointer to the report.
2654 * @param group ASCIIZ string with the measurement group's name.
2655 * @param name ASCIIZ string containing the measurement's name.
2656 * @param value ASCIIZ string containing the measurement's value.
2657 *****************************************************************************/
2658 void evel_report_custom_measurement_add(EVENT_REPORT * report,
2659 const char * const group,
2660 const char * const name,
2661 const char * const value);
2663 /*****************************************************************************/
2664 /*****************************************************************************/
2668 /*****************************************************************************/
2669 /*****************************************************************************/
2671 /**************************************************************************//**
2672 * Create a new Mobile Flow event.
2674 * @note The mandatory fields on the Mobile Flow must be supplied to this
2675 * factory function and are immutable once set. Optional fields have
2676 * explicit setter functions, but again values may only be set once so
2677 * that the Mobile Flow has immutable properties.
2679 * @param event_name Unique Event Name
2680 * @param event_id A universal identifier of the event for analysis etc
2681 * @param flow_direction
2682 * @param gtp_per_flow_metrics
2683 * @param ip_protocol_type
2685 * @param other_endpoint_ip_address
2686 * @param other_endpoint_port
2687 * @param reporting_endpoint_ip_addr
2688 * @param reporting_endpoint_port
2690 * @returns pointer to the newly manufactured ::EVENT_MOBILE_FLOW. If the
2691 * event is not used (i.e. posted) it must be released using
2692 * ::evel_free_mobile_flow.
2693 * @retval NULL Failed to create the event.
2694 *****************************************************************************/
2695 EVENT_MOBILE_FLOW * evel_new_mobile_flow(
2696 const char* ev_name, const char *ev_id,
2697 const char * const flow_direction,
2698 MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics,
2699 const char * const ip_protocol_type,
2700 const char * const ip_version,
2701 const char * const other_endpoint_ip_address,
2702 int other_endpoint_port,
2703 const char * const reporting_endpoint_ip_addr,
2704 int reporting_endpoint_port);
2706 /**************************************************************************//**
2707 * Free a Mobile Flow.
2709 * Free off the Mobile Flow supplied. Will free all the contained allocated
2712 * @note It does not free the Mobile Flow itself, since that may be part of a
2714 *****************************************************************************/
2715 void evel_free_mobile_flow(EVENT_MOBILE_FLOW * event);
2717 /**************************************************************************//**
2718 * Set the Event Type property of the Mobile Flow.
2720 * @note The property is treated as immutable: it is only valid to call
2721 * the setter once. However, we don't assert if the caller tries to
2722 * overwrite, just ignoring the update instead.
2724 * @param mobile_flow Pointer to the Mobile Flow.
2725 * @param type The Event Type to be set. ASCIIZ string. The caller
2726 * does not need to preserve the value once the function
2728 *****************************************************************************/
2729 void evel_mobile_flow_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2730 const char * const type);
2732 /**************************************************************************//**
2733 * Set the Application Type property of the Mobile Flow.
2735 * @note The property is treated as immutable: it is only valid to call
2736 * the setter once. However, we don't assert if the caller tries to
2737 * overwrite, just ignoring the update instead.
2739 * @param mobile_flow Pointer to the Mobile Flow.
2740 * @param type The Application Type to be set. ASCIIZ string. The caller
2741 * does not need to preserve the value once the function
2743 *****************************************************************************/
2744 void evel_mobile_flow_app_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2745 const char * const type);
2747 /**************************************************************************//**
2748 * Set the Application Protocol Type property of the Mobile Flow.
2750 * @note The property is treated as immutable: it is only valid to call
2751 * the setter once. However, we don't assert if the caller tries to
2752 * overwrite, just ignoring the update instead.
2754 * @param mobile_flow Pointer to the Mobile Flow.
2755 * @param type The Application Protocol Type to be set. ASCIIZ string.
2756 * The caller does not need to preserve the value once the
2758 *****************************************************************************/
2759 void evel_mobile_flow_app_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2760 const char * const type);
2762 /**************************************************************************//**
2763 * Set the Application Protocol Version property of the Mobile Flow.
2765 * @note The property is treated as immutable: it is only valid to call
2766 * the setter once. However, we don't assert if the caller tries to
2767 * overwrite, just ignoring the update instead.
2769 * @param mobile_flow Pointer to the Mobile Flow.
2770 * @param version The Application Protocol Version to be set. ASCIIZ
2771 * string. The caller does not need to preserve the value
2772 * once the function returns.
2773 *****************************************************************************/
2774 void evel_mobile_flow_app_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2775 const char * const version);
2777 /**************************************************************************//**
2778 * Set the CID property of the Mobile Flow.
2780 * @note The property is treated as immutable: it is only valid to call
2781 * the setter once. However, we don't assert if the caller tries to
2782 * overwrite, just ignoring the update instead.
2784 * @param mobile_flow Pointer to the Mobile Flow.
2785 * @param cid The CID to be set. ASCIIZ string. The caller does not
2786 * need to preserve the value once the function returns.
2787 *****************************************************************************/
2788 void evel_mobile_flow_cid_set(EVENT_MOBILE_FLOW * mobile_flow,
2789 const char * const cid);
2791 /**************************************************************************//**
2792 * Set the Connection Type property of the Mobile Flow.
2794 * @note The property is treated as immutable: it is only valid to call
2795 * the setter once. However, we don't assert if the caller tries to
2796 * overwrite, just ignoring the update instead.
2798 * @param mobile_flow Pointer to the Mobile Flow.
2799 * @param type The Connection Type to be set. ASCIIZ string. The caller
2800 * does not need to preserve the value once the function
2802 *****************************************************************************/
2803 void evel_mobile_flow_con_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2804 const char * const type);
2806 /**************************************************************************//**
2807 * Set the ECGI property of the Mobile Flow.
2809 * @note The property is treated as immutable: it is only valid to call
2810 * the setter once. However, we don't assert if the caller tries to
2811 * overwrite, just ignoring the update instead.
2813 * @param mobile_flow Pointer to the Mobile Flow.
2814 * @param ecgi The ECGI to be set. ASCIIZ string. The caller does not
2815 * need to preserve the value once the function returns.
2816 *****************************************************************************/
2817 void evel_mobile_flow_ecgi_set(EVENT_MOBILE_FLOW * mobile_flow,
2818 const char * const ecgi);
2820 /**************************************************************************//**
2821 * Set the GTP Protocol Type property of the Mobile Flow.
2823 * @note The property is treated as immutable: it is only valid to call
2824 * the setter once. However, we don't assert if the caller tries to
2825 * overwrite, just ignoring the update instead.
2827 * @param mobile_flow Pointer to the Mobile Flow.
2828 * @param type The GTP Protocol Type to be set. ASCIIZ string. The
2829 * caller does not need to preserve the value once the
2831 *****************************************************************************/
2832 void evel_mobile_flow_gtp_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2833 const char * const type);
2835 /**************************************************************************//**
2836 * Set the GTP Protocol Version property of the Mobile Flow.
2838 * @note The property is treated as immutable: it is only valid to call
2839 * the setter once. However, we don't assert if the caller tries to
2840 * overwrite, just ignoring the update instead.
2842 * @param mobile_flow Pointer to the Mobile Flow.
2843 * @param version The GTP Protocol Version to be set. ASCIIZ string. The
2844 * caller does not need to preserve the value once the
2846 *****************************************************************************/
2847 void evel_mobile_flow_gtp_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2848 const char * const version);
2850 /**************************************************************************//**
2851 * Set the HTTP Header property of the Mobile Flow.
2853 * @note The property is treated as immutable: it is only valid to call
2854 * the setter once. However, we don't assert if the caller tries to
2855 * overwrite, just ignoring the update instead.
2857 * @param mobile_flow Pointer to the Mobile Flow.
2858 * @param header The HTTP header to be set. ASCIIZ string. The caller does
2859 * not need to preserve the value once the function returns.
2860 *****************************************************************************/
2861 void evel_mobile_flow_http_header_set(EVENT_MOBILE_FLOW * mobile_flow,
2862 const char * const header);
2864 /**************************************************************************//**
2865 * Set the IMEI property of the Mobile Flow.
2867 * @note The property is treated as immutable: it is only valid to call
2868 * the setter once. However, we don't assert if the caller tries to
2869 * overwrite, just ignoring the update instead.
2871 * @param mobile_flow Pointer to the Mobile Flow.
2872 * @param imei The IMEI to be set. ASCIIZ string. The caller does not
2873 * need to preserve the value once the function returns.
2874 *****************************************************************************/
2875 void evel_mobile_flow_imei_set(EVENT_MOBILE_FLOW * mobile_flow,
2876 const char * const imei);
2878 /**************************************************************************//**
2879 * Set the IMSI property of the Mobile Flow.
2881 * @note The property is treated as immutable: it is only valid to call
2882 * the setter once. However, we don't assert if the caller tries to
2883 * overwrite, just ignoring the update instead.
2885 * @param mobile_flow Pointer to the Mobile Flow.
2886 * @param imsi The IMSI to be set. ASCIIZ string. The caller does not
2887 * need to preserve the value once the function returns.
2888 *****************************************************************************/
2889 void evel_mobile_flow_imsi_set(EVENT_MOBILE_FLOW * mobile_flow,
2890 const char * const imsi);
2892 /**************************************************************************//**
2893 * Set the LAC property of the Mobile Flow.
2895 * @note The property is treated as immutable: it is only valid to call
2896 * the setter once. However, we don't assert if the caller tries to
2897 * overwrite, just ignoring the update instead.
2899 * @param mobile_flow Pointer to the Mobile Flow.
2900 * @param lac The LAC to be set. ASCIIZ string. The caller does not
2901 * need to preserve the value once the function returns.
2902 *****************************************************************************/
2903 void evel_mobile_flow_lac_set(EVENT_MOBILE_FLOW * mobile_flow,
2904 const char * const lac);
2906 /**************************************************************************//**
2907 * Set the MCC property of the Mobile Flow.
2909 * @note The property is treated as immutable: it is only valid to call
2910 * the setter once. However, we don't assert if the caller tries to
2911 * overwrite, just ignoring the update instead.
2913 * @param mobile_flow Pointer to the Mobile Flow.
2914 * @param mcc The MCC to be set. ASCIIZ string. The caller does not
2915 * need to preserve the value once the function returns.
2916 *****************************************************************************/
2917 void evel_mobile_flow_mcc_set(EVENT_MOBILE_FLOW * mobile_flow,
2918 const char * const mcc);
2920 /**************************************************************************//**
2921 * Set the MNC property of the Mobile Flow.
2923 * @note The property is treated as immutable: it is only valid to call
2924 * the setter once. However, we don't assert if the caller tries to
2925 * overwrite, just ignoring the update instead.
2927 * @param mobile_flow Pointer to the Mobile Flow.
2928 * @param mnc The MNC to be set. ASCIIZ string. The caller does not
2929 * need to preserve the value once the function returns.
2930 *****************************************************************************/
2931 void evel_mobile_flow_mnc_set(EVENT_MOBILE_FLOW * mobile_flow,
2932 const char * const mnc);
2934 /**************************************************************************//**
2935 * Set the MSISDN property of the Mobile Flow.
2937 * @note The property is treated as immutable: it is only valid to call
2938 * the setter once. However, we don't assert if the caller tries to
2939 * overwrite, just ignoring the update instead.
2941 * @param mobile_flow Pointer to the Mobile Flow.
2942 * @param msisdn The MSISDN to be set. ASCIIZ string. The caller does not
2943 * need to preserve the value once the function returns.
2944 *****************************************************************************/
2945 void evel_mobile_flow_msisdn_set(EVENT_MOBILE_FLOW * mobile_flow,
2946 const char * const msisdn);
2948 /**************************************************************************//**
2949 * Set the Other Functional Role property of the Mobile Flow.
2951 * @note The property is treated as immutable: it is only valid to call
2952 * the setter once. However, we don't assert if the caller tries to
2953 * overwrite, just ignoring the update instead.
2955 * @param mobile_flow Pointer to the Mobile Flow.
2956 * @param role The Other Functional Role to be set. ASCIIZ string. The
2957 * caller does not need to preserve the value once the
2959 *****************************************************************************/
2960 void evel_mobile_flow_other_func_role_set(EVENT_MOBILE_FLOW * mobile_flow,
2961 const char * const role);
2963 /**************************************************************************//**
2964 * Set the RAC property of the Mobile Flow.
2966 * @note The property is treated as immutable: it is only valid to call
2967 * the setter once. However, we don't assert if the caller tries to
2968 * overwrite, just ignoring the update instead.
2970 * @param mobile_flow Pointer to the Mobile Flow.
2971 * @param rac The RAC to be set. ASCIIZ string. The caller does not
2972 * need to preserve the value once the function returns.
2973 *****************************************************************************/
2974 void evel_mobile_flow_rac_set(EVENT_MOBILE_FLOW * mobile_flow,
2975 const char * const rac);
2977 /**************************************************************************//**
2978 * Set the Radio Access Technology property of the Mobile Flow.
2980 * @note The property is treated as immutable: it is only valid to call
2981 * the setter once. However, we don't assert if the caller tries to
2982 * overwrite, just ignoring the update instead.
2984 * @param mobile_flow Pointer to the Mobile Flow.
2985 * @param tech The Radio Access Technology to be set. ASCIIZ string. The
2986 * caller does not need to preserve the value once the
2988 *****************************************************************************/
2989 void evel_mobile_flow_radio_acc_tech_set(EVENT_MOBILE_FLOW * mobile_flow,
2990 const char * const tech);
2992 /**************************************************************************//**
2993 * Set the SAC property of the Mobile Flow.
2995 * @note The property is treated as immutable: it is only valid to call
2996 * the setter once. However, we don't assert if the caller tries to
2997 * overwrite, just ignoring the update instead.
2999 * @param mobile_flow Pointer to the Mobile Flow.
3000 * @param sac The SAC to be set. ASCIIZ string. The caller does not
3001 * need to preserve the value once the function returns.
3002 *****************************************************************************/
3003 void evel_mobile_flow_sac_set(EVENT_MOBILE_FLOW * mobile_flow,
3004 const char * const sac);
3006 /**************************************************************************//**
3007 * Set the Sampling Algorithm property of the Mobile Flow.
3009 * @note The property is treated as immutable: it is only valid to call
3010 * the setter once. However, we don't assert if the caller tries to
3011 * overwrite, just ignoring the update instead.
3013 * @param mobile_flow Pointer to the Mobile Flow.
3014 * @param algorithm The Sampling Algorithm to be set.
3015 *****************************************************************************/
3016 void evel_mobile_flow_samp_alg_set(EVENT_MOBILE_FLOW * mobile_flow,
3019 /**************************************************************************//**
3020 * Set the TAC property of the Mobile Flow.
3022 * @note The property is treated as immutable: it is only valid to call
3023 * the setter once. However, we don't assert if the caller tries to
3024 * overwrite, just ignoring the update instead.
3026 * @param mobile_flow Pointer to the Mobile Flow.
3027 * @param tac The TAC to be set. ASCIIZ string. The caller does not
3028 * need to preserve the value once the function returns.
3029 *****************************************************************************/
3030 void evel_mobile_flow_tac_set(EVENT_MOBILE_FLOW * mobile_flow,
3031 const char * const tac);
3033 /**************************************************************************//**
3034 * Set the Tunnel ID property of the Mobile Flow.
3036 * @note The property is treated as immutable: it is only valid to call
3037 * the setter once. However, we don't assert if the caller tries to
3038 * overwrite, just ignoring the update instead.
3040 * @param mobile_flow Pointer to the Mobile Flow.
3041 * @param tunnel_id The Tunnel ID to be set. ASCIIZ string. The caller does
3042 * not need to preserve the value once the function returns.
3043 *****************************************************************************/
3044 void evel_mobile_flow_tunnel_id_set(EVENT_MOBILE_FLOW * mobile_flow,
3045 const char * const tunnel_id);
3047 /**************************************************************************//**
3048 * Set the VLAN ID 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 vlan_id The VLAN ID to be set. ASCIIZ string. The caller does
3056 * not need to preserve the value once the function returns.
3057 *****************************************************************************/
3058 void evel_mobile_flow_vlan_id_set(EVENT_MOBILE_FLOW * mobile_flow,
3059 const char * const vlan_id);
3061 /**************************************************************************//**
3062 * Create a new Mobile GTP Per Flow Metrics.
3064 * @note The mandatory fields on the Mobile GTP Per Flow Metrics must be
3065 * supplied to this factory function and are immutable once set.
3066 * Optional fields have explicit setter functions, but again values
3067 * may only be set once so that the Mobile GTP Per Flow Metrics has
3068 * immutable properties.
3070 * @param avg_bit_error_rate
3071 * @param avg_packet_delay_variation
3072 * @param avg_packet_latency
3073 * @param avg_receive_throughput
3074 * @param avg_transmit_throughput
3075 * @param flow_activation_epoch
3076 * @param flow_activation_microsec
3077 * @param flow_deactivation_epoch
3078 * @param flow_deactivation_microsec
3079 * @param flow_deactivation_time
3080 * @param flow_status
3081 * @param max_packet_delay_variation
3082 * @param num_activation_failures
3083 * @param num_bit_errors
3084 * @param num_bytes_received
3085 * @param num_bytes_transmitted
3086 * @param num_dropped_packets
3087 * @param num_l7_bytes_received
3088 * @param num_l7_bytes_transmitted
3089 * @param num_lost_packets
3090 * @param num_out_of_order_packets
3091 * @param num_packet_errors
3092 * @param num_packets_received_excl_retrans
3093 * @param num_packets_received_incl_retrans
3094 * @param num_packets_transmitted_incl_retrans
3095 * @param num_retries
3096 * @param num_timeouts
3097 * @param num_tunneled_l7_bytes_received
3098 * @param round_trip_time
3099 * @param time_to_first_byte
3101 * @returns pointer to the newly manufactured ::MOBILE_GTP_PER_FLOW_METRICS.
3102 * If the structure is not used it must be released using
3103 * ::evel_free_mobile_gtp_flow_metrics.
3104 * @retval NULL Failed to create the event.
3105 *****************************************************************************/
3106 MOBILE_GTP_PER_FLOW_METRICS * evel_new_mobile_gtp_flow_metrics(
3107 double avg_bit_error_rate,
3108 double avg_packet_delay_variation,
3109 int avg_packet_latency,
3110 int avg_receive_throughput,
3111 int avg_transmit_throughput,
3112 int flow_activation_epoch,
3113 int flow_activation_microsec,
3114 int flow_deactivation_epoch,
3115 int flow_deactivation_microsec,
3116 time_t flow_deactivation_time,
3117 const char * const flow_status,
3118 int max_packet_delay_variation,
3119 int num_activation_failures,
3121 int num_bytes_received,
3122 int num_bytes_transmitted,
3123 int num_dropped_packets,
3124 int num_l7_bytes_received,
3125 int num_l7_bytes_transmitted,
3126 int num_lost_packets,
3127 int num_out_of_order_packets,
3128 int num_packet_errors,
3129 int num_packets_received_excl_retrans,
3130 int num_packets_received_incl_retrans,
3131 int num_packets_transmitted_incl_retrans,
3134 int num_tunneled_l7_bytes_received,
3135 int round_trip_time,
3136 int time_to_first_byte);
3138 /**************************************************************************//**
3139 * Free a Mobile GTP Per Flow Metrics.
3141 * Free off the Mobile GTP Per Flow Metrics supplied. Will free all the
3142 * contained allocated memory.
3144 * @note It does not free the Mobile GTP Per Flow Metrics itself, since that
3145 * may be part of a larger structure.
3146 *****************************************************************************/
3147 void evel_free_mobile_gtp_flow_metrics(MOBILE_GTP_PER_FLOW_METRICS * metrics);
3149 /**************************************************************************//**
3150 * Set the Duration of Connection Failed Status property of the Mobile GTP Per
3153 * @note The property is treated as immutable: it is only valid to call
3154 * the setter once. However, we don't assert if the caller tries to
3155 * overwrite, just ignoring the update instead.
3157 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3158 * @param duration The Duration of Connection Failed Status to be set.
3159 *****************************************************************************/
3160 void evel_mobile_gtp_metrics_dur_con_fail_set(
3161 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3164 /**************************************************************************//**
3165 * Set the Duration of Tunnel Failed Status property of the Mobile GTP Per Flow
3168 * @note The property is treated as immutable: it is only valid to call
3169 * the setter once. However, we don't assert if the caller tries to
3170 * overwrite, just ignoring the update instead.
3172 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3173 * @param duration The Duration of Tunnel Failed Status to be set.
3174 *****************************************************************************/
3175 void evel_mobile_gtp_metrics_dur_tun_fail_set(
3176 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3179 /**************************************************************************//**
3180 * Set the Activated By property of the Mobile GTP Per Flow metrics.
3182 * @note The property is treated as immutable: it is only valid to call
3183 * the setter once. However, we don't assert if the caller tries to
3184 * overwrite, just ignoring the update instead.
3186 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3187 * @param act_by The Activated By to be set. ASCIIZ string. The caller
3188 * does not need to preserve the value once the function
3190 *****************************************************************************/
3191 void evel_mobile_gtp_metrics_act_by_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3192 const char * const act_by);
3194 /**************************************************************************//**
3195 * Set the Activation Time property of the Mobile GTP Per Flow metrics.
3197 * @note The property is treated as immutable: it is only valid to call
3198 * the setter once. However, we don't assert if the caller tries to
3199 * overwrite, just ignoring the update instead.
3201 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3202 * @param act_time The Activation Time to be set. ASCIIZ string. The caller
3203 * does not need to preserve the value once the function
3205 *****************************************************************************/
3206 void evel_mobile_gtp_metrics_act_time_set(
3207 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3210 /**************************************************************************//**
3211 * Set the Deactivated By property of the Mobile GTP Per Flow metrics.
3213 * @note The property is treated as immutable: it is only valid to call
3214 * the setter once. However, we don't assert if the caller tries to
3215 * overwrite, just ignoring the update instead.
3217 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3218 * @param deact_by The Deactivated By to be set. ASCIIZ string. The caller
3219 * does not need to preserve the value once the function
3221 *****************************************************************************/
3222 void evel_mobile_gtp_metrics_deact_by_set(
3223 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3224 const char * const deact_by);
3226 /**************************************************************************//**
3227 * Set the GTP Connection Status property of the Mobile GTP Per Flow metrics.
3229 * @note The property is treated as immutable: it is only valid to call
3230 * the setter once. However, we don't assert if the caller tries to
3231 * overwrite, just ignoring the update instead.
3233 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3234 * @param status The GTP Connection Status to be set. ASCIIZ string. The
3235 * caller does not need to preserve the value once the
3237 *****************************************************************************/
3238 void evel_mobile_gtp_metrics_con_status_set(
3239 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3240 const char * const status);
3242 /**************************************************************************//**
3243 * Set the GTP Tunnel Status property of the Mobile GTP Per Flow metrics.
3245 * @note The property is treated as immutable: it is only valid to call
3246 * the setter once. However, we don't assert if the caller tries to
3247 * overwrite, just ignoring the update instead.
3249 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3250 * @param status The GTP Tunnel Status to be set. ASCIIZ string. The
3251 * caller does not need to preserve the value once the
3253 *****************************************************************************/
3254 void evel_mobile_gtp_metrics_tun_status_set(
3255 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3256 const char * const status);
3258 /**************************************************************************//**
3259 * Set an IP Type-of-Service count property of the Mobile GTP Per Flow metrics.
3261 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3262 * @param index The index of the IP Type-of-Service.
3263 * @param count The count.
3264 *****************************************************************************/
3265 void evel_mobile_gtp_metrics_iptos_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3269 /**************************************************************************//**
3270 * Set the Large Packet Round-Trip Time property of the Mobile GTP Per Flow
3273 * @note The property is treated as immutable: it is only valid to call
3274 * the setter once. However, we don't assert if the caller tries to
3275 * overwrite, just ignoring the update instead.
3277 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3278 * @param rtt The Large Packet Round-Trip Time to be set.
3279 *****************************************************************************/
3280 void evel_mobile_gtp_metrics_large_pkt_rtt_set(
3281 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3284 /**************************************************************************//**
3285 * Set the Large Packet Threshold property of the Mobile GTP Per Flow Metrics.
3287 * @note The property is treated as immutable: it is only valid to call
3288 * the setter once. However, we don't assert if the caller tries to
3289 * overwrite, just ignoring the update instead.
3291 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3292 * @param threshold The Large Packet Threshold to be set.
3293 *****************************************************************************/
3294 void evel_mobile_gtp_metrics_large_pkt_thresh_set(
3295 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3298 /**************************************************************************//**
3299 * Set the Max Receive Bit Rate property of the Mobile GTP Per Flow Metrics.
3301 * @note The property is treated as immutable: it is only valid to call
3302 * the setter once. However, we don't assert if the caller tries to
3303 * overwrite, just ignoring the update instead.
3305 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3306 * @param rate The Max Receive Bit Rate to be set.
3307 *****************************************************************************/
3308 void evel_mobile_gtp_metrics_max_rcv_bit_rate_set(
3309 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3312 /**************************************************************************//**
3313 * Set the Max Transmit Bit Rate property of the Mobile GTP Per Flow Metrics.
3315 * @note The property is treated as immutable: it is only valid to call
3316 * the setter once. However, we don't assert if the caller tries to
3317 * overwrite, just ignoring the update instead.
3319 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3320 * @param rate The Max Transmit Bit Rate to be set.
3321 *****************************************************************************/
3322 void evel_mobile_gtp_metrics_max_trx_bit_rate_set(
3323 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3326 /**************************************************************************//**
3327 * Set the Number of GTP Echo Failures property of the Mobile GTP Per Flow
3330 * @note The property is treated as immutable: it is only valid to call
3331 * the setter once. However, we don't assert if the caller tries to
3332 * overwrite, just ignoring the update instead.
3334 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3335 * @param num The Number of GTP Echo Failures to be set.
3336 *****************************************************************************/
3337 void evel_mobile_gtp_metrics_num_echo_fail_set(
3338 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3341 /**************************************************************************//**
3342 * Set the Number of GTP Tunnel Errors property of the Mobile GTP Per Flow
3345 * @note The property is treated as immutable: it is only valid to call
3346 * the setter once. However, we don't assert if the caller tries to
3347 * overwrite, just ignoring the update instead.
3349 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3350 * @param num The Number of GTP Tunnel Errors to be set.
3351 *****************************************************************************/
3352 void evel_mobile_gtp_metrics_num_tun_fail_set(
3353 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3356 /**************************************************************************//**
3357 * Set the Number of HTTP Errors property of the Mobile GTP Per Flow Metrics.
3359 * @note The property is treated as immutable: it is only valid to call
3360 * the setter once. However, we don't assert if the caller tries to
3361 * overwrite, just ignoring the update instead.
3363 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3364 * @param num The Number of HTTP Errors to be set.
3365 *****************************************************************************/
3366 void evel_mobile_gtp_metrics_num_http_errors_set(
3367 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3370 /**************************************************************************//**
3371 * Add a TCP flag count to the metrics.
3373 * @note The property is treated as immutable: it is only valid to call
3374 * the setter once. However, we don't assert if the caller tries to
3375 * overwrite, just ignoring the update instead.
3377 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3378 * @param tcp_flag The TCP flag count to be updated.
3379 * @param count The associated flag count.
3380 *****************************************************************************/
3381 void evel_mobile_gtp_metrics_tcp_flag_count_add(
3382 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3383 const EVEL_TCP_FLAGS tcp_flag,
3386 /**************************************************************************//**
3387 * Add a QCI COS count to the metrics.
3389 * @note The property is treated as immutable: it is only valid to call
3390 * the setter once. However, we don't assert if the caller tries to
3391 * overwrite, just ignoring the update instead.
3393 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3394 * @param qci_cos The QCI COS count to be updated.
3395 * @param count The associated QCI COS count.
3396 *****************************************************************************/
3397 void evel_mobile_gtp_metrics_qci_cos_count_add(
3398 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3399 const EVEL_QCI_COS_TYPES qci_cos,
3402 /*****************************************************************************/
3403 /*****************************************************************************/
3407 /*****************************************************************************/
3408 /*****************************************************************************/
3410 /**************************************************************************//**
3411 * Create a new Signaling event.
3413 * @note The mandatory fields on the Signaling must be supplied to
3414 * this factory function and are immutable once set. Optional fields
3415 * have explicit setter functions, but again values may only be set
3416 * once so that the event has immutable properties.
3417 * @param event_name Unique Event Name
3418 * @param event_id A universal identifier of the event for analysis etc
3419 * @param vendor_name The vendor id to encode in the event vnf field.
3420 * @param module The module to encode in the event.
3421 * @param vnfname The Virtual network function to encode in the event.
3422 * @returns pointer to the newly manufactured ::EVENT_SIGNALING. If the event
3423 * is not used (i.e. posted) it must be released using
3424 * ::evel_free_signaling.
3425 * @retval NULL Failed to create the event.
3426 *****************************************************************************/
3427 EVENT_SIGNALING * evel_new_signaling(const char* ev_name, const char *ev_id,
3428 const char * const vendor_name,
3429 const char * const correlator,
3430 const char * const local_ip_address,
3431 const char * const local_port,
3432 const char * const remote_ip_address,
3433 const char * const remote_port);
3435 /**************************************************************************//**
3436 * Free a Signaling event.
3438 * Free off the event supplied. Will free all the contained allocated memory.
3440 * @note It does not free the event itself, since that may be part of a larger
3442 *****************************************************************************/
3443 void evel_free_signaling(EVENT_SIGNALING * const event);
3445 /**************************************************************************//**
3446 * Set the Event Type property of the Signaling event.
3448 * @note The property is treated as immutable: it is only valid to call
3449 * the setter once. However, we don't assert if the caller tries to
3450 * overwrite, just ignoring the update instead.
3452 * @param event Pointer to the Signaling event.
3453 * @param type The Event Type to be set. ASCIIZ string. The caller
3454 * does not need to preserve the value once the function
3456 *****************************************************************************/
3457 void evel_signaling_type_set(EVENT_SIGNALING * const event,
3458 const char * const type);
3460 /**************************************************************************//**
3461 * Add an additional value name/value pair to the SIP signaling.
3463 * The name and value are null delimited ASCII strings. The library takes
3464 * a copy so the caller does not have to preserve values after the function
3467 * @param event Pointer to the fault.
3468 * @param name ASCIIZ string with the attribute's name. The caller
3469 * does not need to preserve the value once the function
3471 * @param value ASCIIZ string with the attribute's value. The caller
3472 * does not need to preserve the value once the function
3474 *****************************************************************************/
3475 void evel_signaling_addl_info_add(EVENT_SIGNALING * event, char * name, char * value);
3477 /**************************************************************************//**
3478 * Set the Correlator property of the Signaling event.
3480 * @note The property is treated as immutable: it is only valid to call
3481 * the setter once. However, we don't assert if the caller tries to
3482 * overwrite, just ignoring the update instead.
3484 * @param event Pointer to the Signaling event.
3485 * @param correlator The correlator to be set. ASCIIZ string. The caller
3486 * does not need to preserve the value once the function
3488 *****************************************************************************/
3489 void evel_signaling_correlator_set(EVENT_SIGNALING * const event,
3490 const char * const correlator);
3492 /**************************************************************************//**
3493 * Set the Local Ip Address property of the Signaling event.
3495 * @note The property is treated as immutable: it is only valid to call
3496 * the setter once. However, we don't assert if the caller tries to
3497 * overwrite, just ignoring the update instead.
3499 * @param event Pointer to the Signaling event.
3500 * @param local_ip_address
3501 * The Local Ip Address to be set. ASCIIZ string. The
3502 * caller does not need to preserve the value once the
3504 *****************************************************************************/
3505 void evel_signaling_local_ip_address_set(EVENT_SIGNALING * const event,
3506 const char * const local_ip_address);
3508 /**************************************************************************//**
3509 * Set the Local Port property of the Signaling event.
3511 * @note The property is treated as immutable: it is only valid to call
3512 * the setter once. However, we don't assert if the caller tries to
3513 * overwrite, just ignoring the update instead.
3515 * @param event Pointer to the Signaling event.
3516 * @param local_port The Local Port to be set. ASCIIZ string. The caller
3517 * does not need to preserve the value once the function
3519 *****************************************************************************/
3520 void evel_signaling_local_port_set(EVENT_SIGNALING * const event,
3521 const char * const local_port);
3523 /**************************************************************************//**
3524 * Set the Remote Ip Address property of the Signaling event.
3526 * @note The property is treated as immutable: it is only valid to call
3527 * the setter once. However, we don't assert if the caller tries to
3528 * overwrite, just ignoring the update instead.
3530 * @param event Pointer to the Signaling event.
3531 * @param remote_ip_address
3532 * The Remote Ip Address to be set. ASCIIZ string. The
3533 * caller does not need to preserve the value once the
3535 *****************************************************************************/
3536 void evel_signaling_remote_ip_address_set(EVENT_SIGNALING * const event,
3537 const char * const remote_ip_address);
3539 /**************************************************************************//**
3540 * Set the Remote Port property of the Signaling event.
3542 * @note The property is treated as immutable: it is only valid to call
3543 * the setter once. However, we don't assert if the caller tries to
3544 * overwrite, just ignoring the update instead.
3546 * @param event Pointer to the Signaling event.
3547 * @param remote_port The Remote Port to be set. ASCIIZ string. The caller
3548 * does not need to preserve the value once the function
3550 *****************************************************************************/
3551 void evel_signaling_remote_port_set(EVENT_SIGNALING * const event,
3552 const char * const remote_port);
3553 /**************************************************************************//**
3554 * Set the Vendor module property of the Signaling event.
3556 * @note The property is treated as immutable: it is only valid to call
3557 * the setter once. However, we don't assert if the caller tries to
3558 * overwrite, just ignoring the update instead.
3560 * @param event Pointer to the Signaling event.
3561 * @param modulename The module name to be set. ASCIIZ string. The caller
3562 * does not need to preserve the value once the function
3564 *****************************************************************************/
3565 void evel_signaling_vnfmodule_name_set(EVENT_SIGNALING * const event,
3566 const char * const module_name);
3567 /**************************************************************************//**
3568 * Set the Vendor module property of the Signaling event.
3570 * @note The property is treated as immutable: it is only valid to call
3571 * the setter once. However, we don't assert if the caller tries to
3572 * overwrite, just ignoring the update instead.
3574 * @param event Pointer to the Signaling event.
3575 * @param vnfname The Virtual Network function to be set. ASCIIZ string.
3576 * The caller does not need to preserve the value once
3577 * the function returns.
3578 *****************************************************************************/
3579 void evel_signaling_vnfname_set(EVENT_SIGNALING * const event,
3580 const char * const vnfname);
3582 /**************************************************************************//**
3583 * Set the Compressed SIP property of the Signaling event.
3585 * @note The property is treated as immutable: it is only valid to call
3586 * the setter once. However, we don't assert if the caller tries to
3587 * overwrite, just ignoring the update instead.
3589 * @param event Pointer to the Signaling event.
3590 * @param compressed_sip
3591 * The Compressed SIP to be set. ASCIIZ string. The caller
3592 * does not need to preserve the value once the function
3594 *****************************************************************************/
3595 void evel_signaling_compressed_sip_set(EVENT_SIGNALING * const event,
3596 const char * const compressed_sip);
3598 /**************************************************************************//**
3599 * Set the Summary SIP property of the Signaling event.
3601 * @note The property is treated as immutable: it is only valid to call
3602 * the setter once. However, we don't assert if the caller tries to
3603 * overwrite, just ignoring the update instead.
3605 * @param event Pointer to the Signaling event.
3606 * @param summary_sip The Summary SIP to be set. ASCIIZ string. The caller
3607 * does not need to preserve the value once the function
3609 *****************************************************************************/
3610 void evel_signaling_summary_sip_set(EVENT_SIGNALING * const event,
3611 const char * const summary_sip);
3614 /*****************************************************************************/
3615 /*****************************************************************************/
3619 /*****************************************************************************/
3620 /*****************************************************************************/
3622 /**************************************************************************//**
3623 * Create a new State Change event.
3625 * @note The mandatory fields on the Syslog must be supplied to this factory
3626 * function and are immutable once set. Optional fields have explicit
3627 * setter functions, but again values may only be set once so that the
3628 * Syslog has immutable properties.
3630 * @param event_name Unique Event Name
3631 * @param event_id A universal identifier of the event for analysis etc
3632 * @param new_state The new state of the reporting entity.
3633 * @param old_state The old state of the reporting entity.
3634 * @param interface The card or port name of the reporting entity.
3636 * @returns pointer to the newly manufactured ::EVENT_STATE_CHANGE. If the
3637 * event is not used it must be released using
3638 * ::evel_free_state_change
3639 * @retval NULL Failed to create the event.
3640 *****************************************************************************/
3641 EVENT_STATE_CHANGE * evel_new_state_change(const char* ev_name, const char *ev_id,
3642 const EVEL_ENTITY_STATE new_state,
3643 const EVEL_ENTITY_STATE old_state,
3644 const char * const interface);
3646 /**************************************************************************//**
3647 * Free a State Change.
3649 * Free off the State Change supplied. Will free all the contained allocated
3652 * @note It does not free the State Change itself, since that may be part of a
3654 *****************************************************************************/
3655 void evel_free_state_change(EVENT_STATE_CHANGE * const state_change);
3657 /**************************************************************************//**
3658 * Set the Event Type property of the State Change.
3660 * @note The property is treated as immutable: it is only valid to call
3661 * the setter once. However, we don't assert if the caller tries to
3662 * overwrite, just ignoring the update instead.
3664 * @param state_change Pointer to the ::EVENT_STATE_CHANGE.
3665 * @param type The Event Type to be set. ASCIIZ string. The caller
3666 * does not need to preserve the value once the function
3668 *****************************************************************************/
3669 void evel_state_change_type_set(EVENT_STATE_CHANGE * const state_change,
3670 const char * const type);
3672 /**************************************************************************//**
3673 * Add an additional field name/value pair to the State Change.
3675 * The name and value are null delimited ASCII strings. The library takes
3676 * a copy so the caller does not have to preserve values after the function
3679 * @param state_change Pointer to the ::EVENT_STATE_CHANGE.
3680 * @param name ASCIIZ string with the attribute's name. The caller
3681 * does not need to preserve the value once the function
3683 * @param value ASCIIZ string with the attribute's value. The caller
3684 * does not need to preserve the value once the function
3686 *****************************************************************************/
3687 void evel_state_change_addl_field_add(EVENT_STATE_CHANGE * const state_change,
3688 const char * const name,
3689 const char * const value);
3691 /*****************************************************************************/
3692 /*****************************************************************************/
3696 /*****************************************************************************/
3697 /*****************************************************************************/
3699 /**************************************************************************//**
3700 * Create a new syslog event.
3702 * @note The mandatory fields on the Syslog must be supplied to this factory
3703 * function and are immutable once set. Optional fields have explicit
3704 * setter functions, but again values may only be set once so that the
3705 * Syslog has immutable properties.
3707 * @param event_name Unique Event Name
3708 * @param event_id A universal identifier of the event for analysis etc
3709 * @param event_source_type
3714 * @returns pointer to the newly manufactured ::EVENT_SYSLOG. If the event is
3715 * not used it must be released using ::evel_free_syslog
3716 * @retval NULL Failed to create the event.
3717 *****************************************************************************/
3718 EVENT_SYSLOG * evel_new_syslog(const char* ev_name, const char *ev_id,
3719 EVEL_SOURCE_TYPES event_source_type,
3720 const char * const syslog_msg,
3721 const char * const syslog_tag);
3723 /**************************************************************************//**
3724 * Set the Event Type property of the Syslog.
3726 * @note The property is treated as immutable: it is only valid to call
3727 * the setter once. However, we don't assert if the caller tries to
3728 * overwrite, just ignoring the update instead.
3730 * @param syslog Pointer to the syslog.
3731 * @param type The Event Type to be set. ASCIIZ string. The caller
3732 * does not need to preserve the value once the function
3734 *****************************************************************************/
3735 void evel_syslog_type_set(EVENT_SYSLOG * syslog,
3736 const char * const type);
3738 /**************************************************************************//**
3741 * Free off the Syslog supplied. Will free all the contained allocated memory.
3743 * @note It does not free the Syslog itself, since that may be part of a
3745 *****************************************************************************/
3746 void evel_free_syslog(EVENT_SYSLOG * event);
3748 /**************************************************************************//**
3749 * Add an additional field name/value pair to the Syslog.
3751 * The name and value are null delimited ASCII strings. The library takes
3752 * a copy so the caller does not have to preserve values after the function
3755 * @param syslog Pointer to the syslog.
3756 * @param name ASCIIZ string with the attribute's name. The caller
3757 * does not need to preserve the value once the function
3759 * @param value ASCIIZ string with the attribute's value. The caller
3760 * does not need to preserve the value once the function
3762 *****************************************************************************/
3763 void evel_syslog_addl_field_add(EVENT_SYSLOG * syslog,
3767 /**************************************************************************//**
3768 * Set the Event Source Host property of the Syslog.
3770 * @note The property is treated as immutable: it is only valid to call
3771 * the setter once. However, we don't assert if the caller tries to
3772 * overwrite, just ignoring the update instead.
3774 * @param syslog Pointer to the Syslog.
3775 * @param host The Event Source Host to be set. ASCIIZ string. The
3776 * caller does not need to preserve the value once the
3778 *****************************************************************************/
3779 void evel_syslog_event_source_host_set(EVENT_SYSLOG * syslog,
3780 const char * const host);
3782 /**************************************************************************//**
3783 * Set the Syslog Facility property of the Syslog.
3785 * @note The property is treated as immutable: it is only valid to call
3786 * the setter once. However, we don't assert if the caller tries to
3787 * overwrite, just ignoring the update instead.
3789 * @param syslog Pointer to the Syslog.
3790 * @param facility The Syslog Facility to be set. ASCIIZ string. The caller
3791 * does not need to preserve the value once the function
3793 *****************************************************************************/
3794 void evel_syslog_facility_set(EVENT_SYSLOG * syslog,
3795 EVEL_SYSLOG_FACILITIES facility);
3797 /**************************************************************************//**
3798 * Set the Process property of the Syslog.
3800 * @note The property is treated as immutable: it is only valid to call
3801 * the setter once. However, we don't assert if the caller tries to
3802 * overwrite, just ignoring the update instead.
3804 * @param syslog Pointer to the Syslog.
3805 * @param proc The Process to be set. ASCIIZ string. The caller does
3806 * not need to preserve the value once the function returns.
3807 *****************************************************************************/
3808 void evel_syslog_proc_set(EVENT_SYSLOG * syslog, const char * const proc);
3810 /**************************************************************************//**
3811 * Set the Process ID property of the Syslog.
3813 * @note The property is treated as immutable: it is only valid to call
3814 * the setter once. However, we don't assert if the caller tries to
3815 * overwrite, just ignoring the update instead.
3817 * @param syslog Pointer to the Syslog.
3818 * @param proc_id The Process ID to be set.
3819 *****************************************************************************/
3820 void evel_syslog_proc_id_set(EVENT_SYSLOG * syslog, int proc_id);
3822 /**************************************************************************//**
3823 * Set the Version 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 version The Version to be set.
3831 *****************************************************************************/
3832 void evel_syslog_version_set(EVENT_SYSLOG * syslog, int version);
3834 /**************************************************************************//**
3835 * Set the Structured Data property of the Syslog.
3837 * @note The property is treated as immutable: it is only valid to call
3838 * the setter once. However, we don't assert if the caller tries to
3839 * overwrite, just ignoring the update instead.
3841 * @param syslog Pointer to the Syslog.
3842 * @param s_data The Structured Data to be set. ASCIIZ string. The caller
3843 * does not need to preserve the value once the function
3845 *****************************************************************************/
3846 void evel_syslog_s_data_set(EVENT_SYSLOG * syslog, const char * const s_data);
3848 /**************************************************************************//**
3849 * Set the Structured SDID property of the Syslog.
3851 * @note The property is treated as immutable: it is only valid to call
3852 * the setter once. However, we don't assert if the caller tries to
3853 * overwrite, just ignoring the update instead.
3855 * @param syslog Pointer to the Syslog.
3856 * @param sdid The Structured Data to be set. ASCIIZ string. name@number
3857 * Caller does not need to preserve the value once the function
3859 *****************************************************************************/
3860 void evel_syslog_sdid_set(EVENT_SYSLOG * syslog, const char * const sdid);
3862 /**************************************************************************//**
3863 * Set the Structured Severity property of the Syslog.
3865 * @note The property is treated as immutable: it is only valid to call
3866 * the setter once. However, we don't assert if the caller tries to
3867 * overwrite, just ignoring the update instead.
3869 * @param syslog Pointer to the Syslog.
3870 * @param sdid The Structured Data to be set. ASCIIZ string.
3871 * Caller does not need to preserve the value once the function
3873 *****************************************************************************/
3874 void evel_syslog_severity_set(EVENT_SYSLOG * syslog, const char * const severty);
3877 /*****************************************************************************/
3878 /*****************************************************************************/
3882 /*****************************************************************************/
3883 /*****************************************************************************/
3885 /**************************************************************************//**
3886 * Create a new other event.
3888 * @param event_name Unique Event Name
3889 * @param event_id A universal identifier of the event for analysis etc
3891 * @returns pointer to the newly manufactured ::EVENT_OTHER. If the event is
3892 * not used it must be released using ::evel_free_other.
3893 * @retval NULL Failed to create the event.
3894 *****************************************************************************/
3895 EVENT_OTHER * evel_new_other(const char* ev_name, const char *ev_id);
3897 /**************************************************************************//**
3900 * Free off the Other supplied. Will free all the contained allocated memory.
3902 * @note It does not free the Other itself, since that may be part of a
3904 *****************************************************************************/
3905 void evel_free_other(EVENT_OTHER * event);
3907 /**************************************************************************//**
3908 * Set the Event Type property of the Other.
3910 * @note The property is treated as immutable: it is only valid to call
3911 * the setter once. However, we don't assert if the caller tries to
3912 * overwrite, just ignoring the update instead.
3914 * @param other Pointer to the Other.
3915 * @param type The Event Type to be set. ASCIIZ string. The caller
3916 * does not need to preserve the value once the function
3918 *****************************************************************************/
3919 void evel_other_type_set(EVENT_OTHER * other,
3920 const char * const type);
3922 /**************************************************************************//**
3923 * Add a value name/value pair to the Other.
3925 * The name and value are null delimited ASCII strings. The library takes
3926 * a copy so the caller does not have to preserve values after the function
3929 * @param other Pointer to the Other.
3930 * @param name ASCIIZ string with the attribute's name.
3931 * @param value ASCIIZ string with the attribute's value.
3932 *****************************************************************************/
3933 void evel_other_field_add(EVENT_OTHER * other,
3937 /*****************************************************************************/
3938 /*****************************************************************************/
3942 /*****************************************************************************/
3943 /*****************************************************************************/
3945 /**************************************************************************//**
3946 * Return the current measurement interval provided by the Event Listener.
3948 * @returns The current measurement interval
3949 * @retval EVEL_MEASUREMENT_INTERVAL_UKNOWN (0) - interval has not been
3951 *****************************************************************************/
3952 int evel_get_measurement_interval();
3954 /*****************************************************************************/
3955 /* Supported Report version. */
3956 /*****************************************************************************/
3957 #define EVEL_VOICEQ_MAJOR_VERSION 1
3958 #define EVEL_VOICEQ_MINOR_VERSION 0
3960 /**************************************************************************//**
3961 * End of Call Voice Quality Metrices
3962 * JSON equivalent field: endOfCallVqmSummaries
3963 *****************************************************************************/
3964 typedef struct end_of_call_vqm_summaries {
3965 /***************************************************************************/
3966 /* Mandatory fields */
3967 /***************************************************************************/
3968 char* adjacencyName;
3969 char* endpointDescription;
3971 /***************************************************************************/
3972 /* Optional fields */
3973 /***************************************************************************/
3974 EVEL_OPTION_INT endpointJitter;
3975 EVEL_OPTION_INT endpointRtpOctetsDiscarded;
3976 EVEL_OPTION_INT endpointRtpOctetsReceived;
3977 EVEL_OPTION_INT endpointRtpOctetsSent;
3978 EVEL_OPTION_INT endpointRtpPacketsDiscarded;
3979 EVEL_OPTION_INT endpointRtpPacketsReceived;
3980 EVEL_OPTION_INT endpointRtpPacketsSent;
3981 EVEL_OPTION_INT localJitter;
3982 EVEL_OPTION_INT localRtpOctetsDiscarded;
3983 EVEL_OPTION_INT localRtpOctetsReceived;
3984 EVEL_OPTION_INT localRtpOctetsSent;
3985 EVEL_OPTION_INT localRtpPacketsDiscarded;
3986 EVEL_OPTION_INT localRtpPacketsReceived;
3987 EVEL_OPTION_INT localRtpPacketsSent;
3988 EVEL_OPTION_INT mosCqe;
3989 EVEL_OPTION_INT packetsLost;
3990 EVEL_OPTION_INT packetLossPercent;
3991 EVEL_OPTION_INT rFactor;
3992 EVEL_OPTION_INT roundTripDelay;
3994 } END_OF_CALL_VOICE_QUALITY_METRICS;
3996 /**************************************************************************//**
3998 * JSON equivalent field: voiceQualityFields
3999 *****************************************************************************/
4001 typedef struct event_voiceQuality {
4002 /***************************************************************************/
4003 /* Header and version */
4004 /***************************************************************************/
4005 EVENT_HEADER header;
4009 /***************************************************************************/
4010 /* Mandatory fields */
4011 /***************************************************************************/
4013 char *calleeSideCodec;
4014 char *callerSideCodec;
4017 VENDOR_VNFNAME_FIELD vendorVnfNameFields;
4018 END_OF_CALL_VOICE_QUALITY_METRICS *endOfCallVqmSummaries;
4020 /***************************************************************************/
4021 /* Optional fields */
4022 /***************************************************************************/
4023 EVEL_OPTION_STRING phoneNumber;
4024 DLIST additionalInformation;
4026 } EVENT_VOICE_QUALITY;
4027 /**************************************************************************//**
4028 * Voice Quality Additional Info.
4029 * JSON equivalent field: additionalInformation
4030 *****************************************************************************/
4031 typedef struct voice_quality_additional_info {
4034 } VOICE_QUALITY_ADDL_INFO;
4036 /**************************************************************************//**
4037 * Create a new voice quality event.
4039 * @note The mandatory fields on the Voice Quality must be supplied to this
4040 * factory function and are immutable once set. Optional fields have
4041 * explicit setter functions, but again values may only be set once
4042 * so that the Voice Quality has immutable properties.
4043 * @param event_name Unique Event Name
4044 * @param event_id A universal identifier of the event for analysis etc
4045 * @param calleeSideCodec Callee codec for the call.
4046 * @param callerSideCodec Caller codec for the call.
4047 * @param correlator Constant across all events on this call.
4048 * @param midCallRtcp Base64 encoding of the binary RTCP data
4049 * (excluding Eth/IP/UDP headers).
4050 * @param vendorVnfNameFields Vendor, VNF and VfModule names.
4051 * @returns pointer to the newly manufactured ::EVENT_VOICE_QUALITY. If the
4052 * event is not used (i.e. posted) it must be released using
4053 ::evel_free_voice_quality.
4054 * @retval NULL Failed to create the event.
4055 *****************************************************************************/
4056 EVENT_VOICE_QUALITY * evel_new_voice_quality(const char* ev_name, const char *ev_id,
4057 const char * const calleeSideCodec,
4058 const char * const callerSideCodec, const char * const correlator,
4059 const char * const midCallRtcp, const char * const vendorVnfNameFields);
4061 /**************************************************************************//**
4062 * Set the Callee side codec for Call for domain Voice Quality
4064 * @note The property is treated as immutable: it is only valid to call
4065 * the setter once. However, we don't assert if the caller tries to
4066 * overwrite, just ignoring the update instead.
4068 * @param voiceQuality Pointer to the Voice Quality Event.
4069 * @param calleeCodecForCall The Callee Side Codec to be set. ASCIIZ
4070 * string. The caller does not need to
4071 * preserve the value once the function
4073 *****************************************************************************/
4074 void evel_voice_quality_callee_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
4075 const char * const calleeCodecForCall);
4077 /**************************************************************************//**
4078 * Set the Caller side codec for Call for domain Voice Quality
4080 * @note The property is treated as immutable: it is only valid to call
4081 * the setter once. However, we don't assert if the caller tries to
4082 * overwrite, just ignoring the update instead.
4084 * @param voiceQuality Pointer to the Voice Quality Event.
4085 * @param callerCodecForCall The Caller Side Codec to be set. ASCIIZ
4086 * string. The caller does not need to
4087 * preserve the value once the function
4089 *****************************************************************************/
4090 void evel_voice_quality_caller_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
4091 const char * const callerCodecForCall);
4093 /**************************************************************************//**
4094 * Set the correlator for domain Voice Quality
4096 * @note The property is treated as immutable: it is only valid to call
4097 * the setter once. However, we don't assert if the caller tries to
4098 * overwrite, just ignoring the update instead.
4100 * @param voiceQuality Pointer to the Voice Quality Event.
4101 * @param correlator The correlator value to be set. ASCIIZ
4102 * string. The caller does not need to
4103 * preserve the value once the function
4105 *****************************************************************************/
4106 void evel_voice_quality_correlator_set(EVENT_VOICE_QUALITY * voiceQuality,
4107 const char * const vCorrelator);
4109 /**************************************************************************//**
4110 * Set the RTCP Call Data for domain Voice Quality
4112 * @note The property is treated as immutable: it is only valid to call
4113 * the setter once. However, we don't assert if the caller tries to
4114 * overwrite, just ignoring the update instead.
4116 * @param voiceQuality Pointer to the Voice Quality Event.
4117 * @param rtcpCallData The RTCP Call Data to be set. ASCIIZ
4118 * string. The caller does not need to
4119 * preserve the value once the function
4121 *****************************************************************************/
4122 void evel_voice_quality_rtcp_data_set(EVENT_VOICE_QUALITY * voiceQuality,
4123 const char * const rtcpCallData);
4125 /**************************************************************************//**
4126 * Set the Vendor VNF Name fields for domain Voice Quality
4128 * @note The property is treated as immutable: it is only valid to call
4129 * the setter once. However, we don't assert if the caller tries to
4130 * overwrite, just ignoring the update instead.
4132 * @param voiceQuality Pointer to the Voice Quality Event.
4133 * @param nameFields The Vendor, VNF and VfModule names to be set.
4134 * ASCIIZ string. The caller does not need to
4135 * preserve the value once the function
4137 *****************************************************************************/
4138 void evel_voice_quality_name_fields_set(EVENT_VOICE_QUALITY * voiceQuality,
4139 const char * const nameFields);
4141 /**************************************************************************//**
4142 * Add an End of Call Voice Quality Metrices
4144 * The adjacencyName and endpointDescription is null delimited ASCII string.
4145 * The library takes a copy so the caller does not have to preserve values
4146 * after the function returns.
4148 * @param voiceQuality Pointer to the measurement.
4149 * @param adjacencyName Adjacency name
4150 * @param endpointDescription Enumeration: ‘Caller’, ‘Callee’.
4151 * @param endpointJitter Endpoint jitter
4152 * @param endpointRtpOctetsDiscarded Endpoint RTP octets discarded.
4153 * @param endpointRtpOctetsReceived Endpoint RTP octets received.
4154 * @param endpointRtpOctetsSent Endpoint RTP octets sent
4155 * @param endpointRtpPacketsDiscarded Endpoint RTP packets discarded.
4156 * @param endpointRtpPacketsReceived Endpoint RTP packets received.
4157 * @param endpointRtpPacketsSent Endpoint RTP packets sent.
4158 * @param localJitter Local jitter.
4159 * @param localRtpOctetsDiscarded Local RTP octets discarded.
4160 * @param localRtpOctetsReceived Local RTP octets received.
4161 * @param localRtpOctetsSent Local RTP octets sent.
4162 * @param localRtpPacketsDiscarded Local RTP packets discarded.
4163 * @param localRtpPacketsReceived Local RTP packets received.
4164 * @param localRtpPacketsSent Local RTP packets sent.
4165 * @param mosCqe Decimal range from 1 to 5
4167 * @param packetsLost No Packets lost
4168 * @param packetLossPercent Calculated percentage packet loss
4169 * @param rFactor rFactor from 0 to 100
4170 * @param roundTripDelay Round trip delay in milliseconds
4171 *****************************************************************************/
4172 void evel_voice_quality_end_metrics_add(EVENT_VOICE_QUALITY * voiceQuality,
4173 const char * adjacencyName, EVEL_SERVICE_ENDPOINT_DESC endpointDescription,
4175 int endpointRtpOctetsDiscarded,
4176 int endpointRtpOctetsReceived,
4177 int endpointRtpOctetsSent,
4178 int endpointRtpPacketsDiscarded,
4179 int endpointRtpPacketsReceived,
4180 int endpointRtpPacketsSent,
4182 int localRtpOctetsDiscarded,
4183 int localRtpOctetsReceived,
4184 int localRtpOctetsSent,
4185 int localRtpPacketsDiscarded,
4186 int localRtpPacketsReceived,
4187 int localRtpPacketsSent,
4190 int packetLossPercent,
4192 int roundTripDelay);
4194 /**************************************************************************//**
4195 * Free a Voice Quality.
4197 * Free off the Voce Quality supplied. Will free all the contained allocated
4200 * @note It does not free the Voice Quality itself, since that may be part of a
4202 *****************************************************************************/
4203 void evel_free_voice_quality(EVENT_VOICE_QUALITY * voiceQuality);
4205 /**************************************************************************//**
4206 * Add an additional value name/value pair to the Voice Quality.
4208 * The name and value are null delimited ASCII strings. The library takes
4209 * a copy so the caller does not have to preserve values after the function
4212 * @param fault Pointer to the fault.
4213 * @param name ASCIIZ string with the attribute's name. The caller
4214 * does not need to preserve the value once the function
4216 * @param value ASCIIZ string with the attribute's value. The caller
4217 * does not need to preserve the value once the function
4219 *****************************************************************************/
4220 void evel_voice_quality_addl_info_add(EVENT_VOICE_QUALITY * voiceQuality, char * name, char * value);
4223 /*****************************************************************************/
4224 /*****************************************************************************/
4226 /* THRESHOLD CROSSING ALERT */
4228 /*****************************************************************************/
4229 /*****************************************************************************/
4231 typedef enum evel_event_action {
4232 EVEL_EVENT_ACTION_CLEAR,
4233 EVEL_EVENT_ACTION_CONTINUE,
4234 EVEL_EVENT_ACTION_SET,
4235 EVEL_MAX_EVENT_ACTION
4238 typedef enum evel_alert_type {
4240 EVEL_ELEMENT_ANOMALY,
4241 EVEL_INTERFACE_ANOMALY,
4242 EVEL_SERVICE_ANOMALY,
4247 typedef struct perf_counter {
4250 char * thresholdCrossed;
4255 /*****************************************************************************/
4256 /* Supported Threshold Crossing version. */
4257 /*****************************************************************************/
4258 #define EVEL_THRESHOLD_CROSS_MAJOR_VERSION 2
4259 #define EVEL_THRESHOLD_CROSS_MINOR_VERSION 0
4261 /**************************************************************************//**
4262 * Threshold Crossing.
4263 * JSON equivalent field: Threshold Cross Fields
4264 *****************************************************************************/
4265 typedef struct event_threshold_cross {
4266 /***************************************************************************/
4267 /* Header and version */
4268 /***************************************************************************/
4269 EVENT_HEADER header;
4273 /***************************************************************************/
4274 /* Mandatory fields */
4275 /***************************************************************************/
4276 PERF_COUNTER additionalParameters;
4277 EVEL_EVENT_ACTION alertAction;
4278 char * alertDescription;
4279 EVEL_ALERT_TYPE alertType;
4280 unsigned long long collectionTimestamp;
4281 EVEL_SEVERITIES eventSeverity;
4282 unsigned long long eventStartTimestamp;
4284 /***************************************************************************/
4285 /* Optional fields */
4286 /***************************************************************************/
4287 DLIST additional_info;
4288 EVEL_OPTION_STRING alertValue;
4290 EVEL_OPTION_STRING dataCollector;
4291 EVEL_OPTION_STRING elementType;
4292 EVEL_OPTION_STRING interfaceName;
4293 EVEL_OPTION_STRING networkService;
4294 EVEL_OPTION_STRING possibleRootCause;
4296 } EVENT_THRESHOLD_CROSS;
4299 /**************************************************************************//**
4300 * Create a new Threshold Crossing Alert event.
4302 * @note The mandatory fields on the TCA must be supplied to this factory
4303 * function and are immutable once set. Optional fields have explicit
4304 * setter functions, but again values may only be set once so that the
4305 * TCA has immutable properties.
4307 * @param event_name Unique Event Name
4308 * @param event_id A universal identifier of the event for analysis etc
4309 * @param char* tcriticality Performance Counter Criticality MAJ MIN,
4310 * @param char* tname Performance Counter Threshold name
4311 * @param char* tthresholdCrossed Counter Threshold crossed value
4312 * @param char* tvalue Counter actual value
4313 * @param EVEL_EVENT_ACTION talertAction Alert set continue or clear
4314 * @param char* talertDescription
4315 * @param EVEL_ALERT_TYPE talertType Kind of anamoly
4316 * @param unsigned long long tcollectionTimestamp time at which alert was collected
4317 * @param EVEL_SEVERITIES teventSeverity Severity of Alert
4318 * @param unsigned long long teventStartTimestamp Time when this alert started
4320 * @returns pointer to the newly manufactured ::EVENT_THRESHOLD_CROSS. If the
4321 * event is not used it must be released using
4322 * ::evel_free_threshold_cross
4323 * @retval NULL Failed to create the event.
4324 *****************************************************************************/
4325 EVENT_THRESHOLD_CROSS * evel_new_threshold_cross(
4326 const char* ev_name, const char *ev_id,
4327 char * tcriticality,
4329 char * tthresholdCrossed,
4331 EVEL_EVENT_ACTION talertAction,
4332 char * talertDescription,
4333 EVEL_ALERT_TYPE talertType,
4334 unsigned long long tcollectionTimestamp,
4335 EVEL_SEVERITIES teventSeverity,
4336 unsigned long long teventStartTimestamp);
4338 /**************************************************************************//**
4339 * Free a Threshold cross event.
4341 * Free off the Threshold crossing event supplied. Will free all the contained allocated
4344 * @note It does not free the Threshold Cross itself, since that may be part of a
4346 *****************************************************************************/
4347 void evel_free_threshold_cross(EVENT_THRESHOLD_CROSS * const tcp);
4349 /**************************************************************************//**
4350 * Set the Event Type property of the Threshold Cross.
4352 * @note The property is treated as immutable: it is only valid to call
4353 * the setter once. However, we don't assert if the caller tries to
4354 * overwrite, just ignoring the update instead.
4356 * @param tcp Pointer to the ::EVENT_THRESHOLD_CROSS.
4357 * @param type The Event Type to be set. ASCIIZ string. The caller
4358 * does not need to preserve the value once the function
4360 *****************************************************************************/
4361 void evel_threshold_cross_type_set(EVENT_THRESHOLD_CROSS * const tcp, char * type);
4363 /**************************************************************************//**
4364 * Add an optional additional alertid value to Alert.
4366 * @param alertid Adds Alert ID
4367 *****************************************************************************/
4368 void evel_threshold_cross_alertid_add(EVENT_THRESHOLD_CROSS * const event,char * alertid);
4370 /**************************************************************************//**
4371 * Set the TCA probable Root cause.
4373 * @param sheader Possible root cause to Threshold
4374 *****************************************************************************/
4375 void evel_threshold_cross_possible_rootcause_set(EVENT_THRESHOLD_CROSS * const event, char * sheader);
4376 /**************************************************************************//**
4377 * Set the TCA networking cause.
4379 * @param sheader Possible networking service value to Threshold
4380 *****************************************************************************/
4381 void evel_threshold_cross_networkservice_set(EVENT_THRESHOLD_CROSS * const event, char * sheader);
4382 /**************************************************************************//**
4383 * Set the TCA Interface name.
4385 * @param sheader Interface name to threshold
4386 *****************************************************************************/
4387 void evel_threshold_cross_interfacename_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4388 /**************************************************************************//**
4389 * Set the TCA Data element type.
4391 * @param sheader element type of Threshold
4392 *****************************************************************************/
4393 void evel_threshold_cross_data_elementtype_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4394 /**************************************************************************//**
4395 * Set the TCA Data collector value.
4397 * @param sheader Data collector value
4398 *****************************************************************************/
4399 void evel_threshold_cross_data_collector_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4400 /**************************************************************************//**
4401 * Set the TCA alert value.
4403 * @param sheader Possible alert value
4404 *****************************************************************************/
4405 void evel_threshold_cross_alertvalue_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4407 /**************************************************************************//**
4408 * Add an additional field name/value pair to the THRESHOLD CROSS event.
4410 * The name and value are null delimited ASCII strings. The library takes
4411 * a copy so the caller does not have to preserve values after the function
4414 * @param state_change Pointer to the ::EVENT_THRESHOLD_CROSS.
4415 * @param name ASCIIZ string with the attribute's name. The caller
4416 * does not need to preserve the value once the function
4418 * @param value ASCIIZ string with the attribute's value. The caller
4419 * does not need to preserve the value once the function
4421 *****************************************************************************/
4422 void evel_threshold_cross_addl_info_add(EVENT_THRESHOLD_CROSS * const tcp,
4423 const char * const name,
4424 const char * const value);
4426 /*****************************************************************************/
4427 /*****************************************************************************/
4431 /*****************************************************************************/
4432 /*****************************************************************************/
4434 /*****************************************************************************/
4436 /*****************************************************************************/
4437 #define EVEL_DEBUG(FMT, ...) log_debug(EVEL_LOG_DEBUG, (FMT), ##__VA_ARGS__)
4438 #define EVEL_INFO(FMT, ...) log_debug(EVEL_LOG_INFO, (FMT), ##__VA_ARGS__)
4439 #define EVEL_SPAMMY(FMT, ...) log_debug(EVEL_LOG_SPAMMY, (FMT), ##__VA_ARGS__)
4440 #define EVEL_ERROR(FMT, ...) log_debug(EVEL_LOG_ERROR, "ERROR: " FMT, \
4442 #define EVEL_ENTER() \
4444 log_debug(EVEL_LOG_DEBUG, "Enter %s {", __FUNCTION__); \
4445 debug_indent += 2; \
4447 #define EVEL_EXIT() \
4449 debug_indent -= 2; \
4450 log_debug(EVEL_LOG_DEBUG, "Exit %s }", __FUNCTION__); \
4453 #define INDENT_SEPARATORS \
4454 "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "
4456 extern EVEL_LOG_LEVELS debug_level;
4457 extern int debug_indent;
4460 #define EVEL_DEBUG_ON() ((debug_level) >= EVEL_LOG_DEBUG)
4462 /**************************************************************************//**
4463 * Initialize logging
4465 * @param[in] level The debugging level - one of ::EVEL_LOG_LEVELS.
4466 * @param[in] ident The identifier for our logs.
4467 *****************************************************************************/
4468 void log_initialize(EVEL_LOG_LEVELS level, const char * ident);
4470 /**************************************************************************//**
4471 * Log debug information
4473 * Logs debugging information in a platform independent manner.
4475 * @param[in] level The debugging level - one of ::EVEL_LOG_LEVELS.
4476 * @param[in] format Log formatting string in printf format.
4477 * @param[in] ... Variable argument list.
4478 *****************************************************************************/
4479 void log_debug(EVEL_LOG_LEVELS level, char * format, ...);
4481 /***************************************************************************//*
4482 * Store the formatted string into the static error string and log the error.
4484 * @param format Error string in standard printf format.
4485 * @param ... Variable parameters to be substituted into the format string.
4486 *****************************************************************************/
4487 void log_error_state(char * format, ...);