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 0
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 1
404 #define EVEL_HEADER_MINOR_VERSION 2
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 1
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;
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 1
1086 #define EVEL_MOBILE_FLOW_MINOR_VERSION 2
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 1
1179 /*****************************************************************************/
1180 /* Supported Signaling version. */
1181 /*****************************************************************************/
1182 #define EVEL_SIGNALING_MAJOR_VERSION 2
1183 #define EVEL_SIGNALING_MINOR_VERSION 1
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 1
1239 #define EVEL_STATE_CHANGE_MINOR_VERSION 2
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 1
1281 #define EVEL_SYSLOG_MINOR_VERSION 2
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 * Free an event header.
1491 * Free off the event header supplied. Will free all the contained allocated
1494 * @note It does not free the header itself, since that may be part of a
1496 *****************************************************************************/
1497 void evel_free_header(EVENT_HEADER * const event);
1499 /**************************************************************************//**
1500 * Initialize a newly created event header.
1502 * @param header Pointer to the header being initialized.
1503 *****************************************************************************/
1504 void evel_init_header(EVENT_HEADER * const header,const char *const eventname);
1506 /**************************************************************************//**
1507 * Set the Event Type property of the event header.
1509 * @param header Pointer to the ::EVENT_HEADER.
1510 * @param type The Event Type to be set. ASCIIZ string. The caller
1511 * does not need to preserve the value once the function
1513 *****************************************************************************/
1514 void evel_header_type_set(EVENT_HEADER * const header,
1515 const char * const type);
1517 /**************************************************************************//**
1518 * Set the Start Epoch property of the event header.
1520 * @note The Start Epoch defaults to the time of event creation.
1522 * @param header Pointer to the ::EVENT_HEADER.
1523 * @param start_epoch_microsec
1524 * The start epoch to set, in microseconds.
1525 *****************************************************************************/
1526 void evel_start_epoch_set(EVENT_HEADER * const header,
1527 const unsigned long long start_epoch_microsec);
1529 /**************************************************************************//**
1530 * Set the Last Epoch property of the event header.
1532 * @note The Last Epoch defaults to the time of event creation.
1534 * @param header Pointer to the ::EVENT_HEADER.
1535 * @param last_epoch_microsec
1536 * The last epoch to set, in microseconds.
1537 *****************************************************************************/
1538 void evel_last_epoch_set(EVENT_HEADER * const header,
1539 const unsigned long long last_epoch_microsec);
1541 /**************************************************************************//**
1542 * Set the Reporting Entity Name property of the event header.
1544 * @note The Reporting Entity Name defaults to the OpenStack VM Name.
1546 * @param header Pointer to the ::EVENT_HEADER.
1547 * @param entity_name The entity name to set.
1548 *****************************************************************************/
1549 void evel_reporting_entity_name_set(EVENT_HEADER * const header,
1550 const char * const entity_name);
1552 /**************************************************************************//**
1553 * Set the Reporting Entity Id property of the event header.
1555 * @note The Reporting Entity Id defaults to the OpenStack VM UUID.
1557 * @param header Pointer to the ::EVENT_HEADER.
1558 * @param entity_id The entity id to set.
1559 *****************************************************************************/
1560 void evel_reporting_entity_id_set(EVENT_HEADER * const header,
1561 const char * const entity_id);
1563 /*****************************************************************************/
1564 /*****************************************************************************/
1568 /*****************************************************************************/
1569 /*****************************************************************************/
1571 /**************************************************************************//**
1572 * Create a new fault event.
1574 * @note The mandatory fields on the Fault must be supplied to this factory
1575 * function and are immutable once set. Optional fields have explicit
1576 * setter functions, but again values may only be set once so that the
1577 * Fault has immutable properties.
1578 * @param condition The condition indicated by the Fault.
1579 * @param specific_problem The specific problem triggering the fault.
1580 * @param priority The priority of the event.
1581 * @param severity The severity of the Fault.
1582 * @param ev_source_type Source of Alarm event
1583 * @param version fault version
1584 * @param status status of Virtual Function
1585 * @returns pointer to the newly manufactured ::EVENT_FAULT. If the event is
1586 * not used (i.e. posted) it must be released using ::evel_free_fault.
1587 * @retval NULL Failed to create the event.
1588 *****************************************************************************/
1589 EVENT_FAULT * evel_new_fault(const char * const condition,
1590 const char * const specific_problem,
1591 EVEL_EVENT_PRIORITIES priority,
1592 EVEL_SEVERITIES severity,
1593 EVEL_SOURCE_TYPES ev_source_type,
1594 EVEL_VF_STATUSES status);
1596 /**************************************************************************//**
1599 * Free off the Fault supplied. Will free all the contained allocated memory.
1601 * @note It does not free the Fault itself, since that may be part of a
1603 *****************************************************************************/
1604 void evel_free_fault(EVENT_FAULT * event);
1606 /**************************************************************************//**
1607 * Set the Fault Category property of the Fault.
1609 * @note The property is treated as immutable: it is only valid to call
1610 * the setter once. However, we don't assert if the caller tries to
1611 * overwrite, just ignoring the update instead.
1613 * @param fault Pointer to the fault.
1614 * @param category Category : license, link, routing, security, signaling.
1615 * ASCIIZ string. The caller
1616 * does not need to preserve the value once the function
1618 *****************************************************************************/
1619 void evel_fault_category_set(EVENT_FAULT * fault,
1620 const char * const category);
1622 /**************************************************************************//**
1623 * Set the Alarm Interface A property of the Fault.
1625 * @note The property is treated as immutable: it is only valid to call
1626 * the setter once. However, we don't assert if the caller tries to
1627 * overwrite, just ignoring the update instead.
1629 * @param fault Pointer to the fault.
1630 * @param interface The Alarm Interface A to be set. ASCIIZ string. The caller
1631 * does not need to preserve the value once the function
1633 *****************************************************************************/
1634 void evel_fault_interface_set(EVENT_FAULT * fault,
1635 const char * const interface);
1637 /**************************************************************************//**
1638 * Add an additional value name/value pair to the Fault.
1640 * The name and value are null delimited ASCII strings. The library takes
1641 * a copy so the caller does not have to preserve values after the function
1644 * @param fault Pointer to the fault.
1645 * @param name ASCIIZ string with the attribute's name.
1646 * @param value ASCIIZ string with the attribute's value.
1647 *****************************************************************************/
1648 void evel_fault_addl_info_add(EVENT_FAULT * fault, char * name, char * value);
1650 /**************************************************************************//**
1651 * Set the Event Type property of the Fault.
1653 * @note The property is treated as immutable: it is only valid to call
1654 * the setter once. However, we don't assert if the caller tries to
1655 * overwrite, just ignoring the update instead.
1657 * @param fault Pointer to the fault.
1658 * @param type The Event Type to be set. ASCIIZ string. The caller
1659 * does not need to preserve the value once the function
1661 *****************************************************************************/
1662 void evel_fault_type_set(EVENT_FAULT * fault, const char * const type);
1664 /*****************************************************************************/
1665 /*****************************************************************************/
1669 /*****************************************************************************/
1670 /*****************************************************************************/
1672 /**************************************************************************//**
1673 * Create a new Measurement event.
1675 * @note The mandatory fields on the Measurement must be supplied to this
1676 * factory function and are immutable once set. Optional fields have
1677 * explicit setter functions, but again values may only be set once so
1678 * that the Measurement has immutable properties.
1680 * @param measurement_interval
1682 * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT. If the
1683 * event is not used (i.e. posted) it must be released using
1684 * ::evel_free_event.
1685 * @retval NULL Failed to create the event.
1686 *****************************************************************************/
1687 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval);
1689 /**************************************************************************//**
1690 * Free a Measurement.
1692 * Free off the Measurement supplied. Will free all the contained allocated
1695 * @note It does not free the Measurement itself, since that may be part of a
1697 *****************************************************************************/
1698 void evel_free_measurement(EVENT_MEASUREMENT * event);
1700 /**************************************************************************//**
1701 * Set the Event Type property of the Measurement.
1703 * @note The property is treated as immutable: it is only valid to call
1704 * the setter once. However, we don't assert if the caller tries to
1705 * overwrite, just ignoring the update instead.
1707 * @param measurement Pointer to the Measurement.
1708 * @param type The Event Type to be set. ASCIIZ string. The caller
1709 * does not need to preserve the value once the function
1711 *****************************************************************************/
1712 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
1713 const char * const type);
1715 /**************************************************************************//**
1716 * Set the Concurrent Sessions property of the Measurement.
1718 * @note The property is treated as immutable: it is only valid to call
1719 * the setter once. However, we don't assert if the caller tries to
1720 * overwrite, just ignoring the update instead.
1722 * @param measurement Pointer to the Measurement.
1723 * @param concurrent_sessions The Concurrent Sessions to be set.
1724 *****************************************************************************/
1725 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
1726 int concurrent_sessions);
1728 /**************************************************************************//**
1729 * Set the Configured Entities property of the Measurement.
1731 * @note The property is treated as immutable: it is only valid to call
1732 * the setter once. However, we don't assert if the caller tries to
1733 * overwrite, just ignoring the update instead.
1735 * @param measurement Pointer to the Measurement.
1736 * @param configured_entities The Configured Entities to be set.
1737 *****************************************************************************/
1738 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
1739 int configured_entities);
1741 /**************************************************************************//**
1742 * Add an additional set of Errors to the Measurement.
1744 * @note The property is treated as immutable: it is only valid to call
1745 * the setter once. However, we don't assert if the caller tries to
1746 * overwrite, just ignoring the update instead.
1748 * @param measurement Pointer to the measurement.
1749 * @param receive_discards The number of receive discards.
1750 * @param receive_errors The number of receive errors.
1751 * @param transmit_discards The number of transmit discards.
1752 * @param transmit_errors The number of transmit errors.
1753 *****************************************************************************/
1754 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
1755 int receive_discards,
1757 int transmit_discards,
1758 int transmit_errors);
1760 /**************************************************************************//**
1761 * Set the Mean Request Latency property of the Measurement.
1763 * @note The property is treated as immutable: it is only valid to call
1764 * the setter once. However, we don't assert if the caller tries to
1765 * overwrite, just ignoring the update instead.
1767 * @param measurement Pointer to the Measurement.
1768 * @param mean_request_latency The Mean Request Latency to be set.
1769 *****************************************************************************/
1770 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
1771 double mean_request_latency);
1773 /**************************************************************************//**
1774 * Set the Request Rate property of the Measurement.
1776 * @note The property is treated as immutable: it is only valid to call
1777 * the setter once. However, we don't assert if the caller tries to
1778 * overwrite, just ignoring the update instead.
1780 * @param measurement Pointer to the Measurement.
1781 * @param request_rate The Request Rate to be set.
1782 *****************************************************************************/
1783 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
1786 /**************************************************************************//**
1787 * Add an additional CPU usage value name/value pair to the Measurement.
1789 * The name and value are null delimited ASCII strings. The library takes
1790 * a copy so the caller does not have to preserve values after the function
1793 * @param measurement Pointer to the measurement.
1794 * @param id ASCIIZ string with the CPU's identifier.
1795 * @param usage CPU utilization.
1796 *****************************************************************************/
1797 MEASUREMENT_CPU_USE * evel_measurement_new_cpu_use_add(EVENT_MEASUREMENT * measurement, char * id, double usage);
1799 /**************************************************************************//**
1800 * Set the CPU Idle value in measurement interval
1801 * percentage of CPU time spent in the idle task
1803 * @note The property is treated as immutable: it is only valid to call
1804 * the setter once. However, we don't assert if the caller tries to
1805 * overwrite, just ignoring the update instead.
1807 * @param cpu_use Pointer to the CPU Use.
1809 *****************************************************************************/
1810 void evel_measurement_cpu_use_idle_set(MEASUREMENT_CPU_USE *const cpu_use,
1813 /**************************************************************************//**
1814 * Set the percentage of time spent servicing interrupts
1816 * @note The property is treated as immutable: it is only valid to call
1817 * the setter once. However, we don't assert if the caller tries to
1818 * overwrite, just ignoring the update instead.
1820 * @param cpu_use Pointer to the CPU Use.
1822 *****************************************************************************/
1823 void evel_measurement_cpu_use_interrupt_set(MEASUREMENT_CPU_USE * const cpu_use,
1826 /**************************************************************************//**
1827 * Set the percentage of time spent running user space processes that have been niced
1829 * @note The property is treated as immutable: it is only valid to call
1830 * the setter once. However, we don't assert if the caller tries to
1831 * overwrite, just ignoring the update instead.
1833 * @param cpu_use Pointer to the CPU Use.
1835 *****************************************************************************/
1836 void evel_measurement_cpu_use_nice_set(MEASUREMENT_CPU_USE * const cpu_use,
1839 /**************************************************************************//**
1840 * Set the percentage of time spent handling soft irq interrupts
1842 * @note The property is treated as immutable: it is only valid to call
1843 * the setter once. However, we don't assert if the caller tries to
1844 * overwrite, just ignoring the update instead.
1846 * @param cpu_use Pointer to the CPU Use.
1848 *****************************************************************************/
1849 void evel_measurement_cpu_use_softirq_set(MEASUREMENT_CPU_USE * const cpu_use,
1851 /**************************************************************************//**
1852 * Set the percentage of time spent in involuntary wait
1854 * @note The property is treated as immutable: it is only valid to call
1855 * the setter once. However, we don't assert if the caller tries to
1856 * overwrite, just ignoring the update instead.
1858 * @param cpu_use Pointer to the CPU Use.
1860 *****************************************************************************/
1861 void evel_measurement_cpu_use_steal_set(MEASUREMENT_CPU_USE * const cpu_use,
1863 /**************************************************************************//**
1864 * Set the percentage of time spent on system tasks running the kernel
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_system_set(MEASUREMENT_CPU_USE * const cpu_use,
1875 /**************************************************************************//**
1876 * Set the percentage of time spent running un-niced user space processes
1878 * @note The property is treated as immutable: it is only valid to call
1879 * the setter once. However, we don't assert if the caller tries to
1880 * overwrite, just ignoring the update instead.
1882 * @param cpu_use Pointer to the CPU Use.
1884 *****************************************************************************/
1885 void evel_measurement_cpu_use_usageuser_set(MEASUREMENT_CPU_USE * const cpu_use,
1887 /**************************************************************************//**
1888 * Set the percentage of CPU time spent waiting for I/O operations to complete
1890 * @note The property is treated as immutable: it is only valid to call
1891 * the setter once. However, we don't assert if the caller tries to
1892 * overwrite, just ignoring the update instead.
1894 * @param cpu_use Pointer to the CPU Use.
1896 *****************************************************************************/
1897 void evel_measurement_cpu_use_wait_set(MEASUREMENT_CPU_USE * const cpu_use,
1900 /**************************************************************************//**
1901 * Add an additional File System usage value name/value pair to the
1904 * The filesystem_name is null delimited ASCII string. The library takes a
1905 * copy so the caller does not have to preserve values after the function
1908 * @param measurement Pointer to the measurement.
1909 * @param filesystem_name ASCIIZ string with the file-system's UUID.
1910 * @param block_configured Block storage configured.
1911 * @param block_used Block storage in use.
1912 * @param block_iops Block storage IOPS.
1913 * @param ephemeral_configured Ephemeral storage configured.
1914 * @param ephemeral_used Ephemeral storage in use.
1915 * @param ephemeral_iops Ephemeral storage IOPS.
1916 *****************************************************************************/
1917 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
1918 char * filesystem_name,
1919 double block_configured,
1922 double ephemeral_configured,
1923 double ephemeral_used,
1924 int ephemeral_iops);
1926 /**************************************************************************//**
1927 * Add a Feature usage value name/value pair to the Measurement.
1929 * The name is null delimited ASCII string. The library takes
1930 * a copy so the caller does not have to preserve values after the function
1933 * @param measurement Pointer to the measurement.
1934 * @param feature ASCIIZ string with the feature's name.
1935 * @param utilization Utilization of the feature.
1936 *****************************************************************************/
1937 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
1941 /**************************************************************************//**
1942 * Add a Additional Measurement value name/value pair to the Measurement.
1944 * The name is null delimited ASCII string. The library takes
1945 * a copy so the caller does not have to preserve values after the function
1948 * @param measurement Pointer to the Measurement.
1949 * @param group ASCIIZ string with the measurement group's name.
1950 * @param name ASCIIZ string containing the measurement's name.
1951 * @param name ASCIIZ string containing the measurement's value.
1952 *****************************************************************************/
1953 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
1954 const char * const group,
1955 const char * const name,
1956 const char * const value);
1958 /**************************************************************************//**
1959 * Add a Codec usage value name/value pair to the Measurement.
1961 * The name is null delimited ASCII string. The library takes
1962 * a copy so the caller does not have to preserve values after the function
1965 * @param measurement Pointer to the measurement.
1966 * @param codec ASCIIZ string with the codec's name.
1967 * @param utilization Utilization of the feature.
1968 *****************************************************************************/
1969 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
1973 /**************************************************************************//**
1974 * Set the Media Ports in Use property of the Measurement.
1976 * @note The property is treated as immutable: it is only valid to call
1977 * the setter once. However, we don't assert if the caller tries to
1978 * overwrite, just ignoring the update instead.
1980 * @param measurement Pointer to the measurement.
1981 * @param media_ports_in_use The media port usage to set.
1982 *****************************************************************************/
1983 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
1984 int media_ports_in_use);
1986 /**************************************************************************//**
1987 * Set the VNFC Scaling Metric property of the Measurement.
1989 * @note The property is treated as immutable: it is only valid to call
1990 * the setter once. However, we don't assert if the caller tries to
1991 * overwrite, just ignoring the update instead.
1993 * @param measurement Pointer to the measurement.
1994 * @param scaling_metric The scaling metric to set.
1995 *****************************************************************************/
1996 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
1997 int scaling_metric);
1999 /**************************************************************************//**
2000 * Create a new Latency Bucket to be added to a Measurement event.
2002 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
2003 * supplied to this factory function and are immutable once set.
2004 * Optional fields have explicit setter functions, but again values
2005 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
2006 * immutable properties.
2008 * @param count Count of events in this bucket.
2010 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
2011 * @retval NULL Failed to create the Latency Bucket.
2012 *****************************************************************************/
2013 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count);
2015 /**************************************************************************//**
2016 * Set the High End property of the Measurement Latency Bucket.
2018 * @note The property is treated as immutable: it is only valid to call
2019 * the setter once. However, we don't assert if the caller tries to
2020 * overwrite, just ignoring the update instead.
2022 * @param bucket Pointer to the Measurement Latency Bucket.
2023 * @param high_end High end of the bucket's range.
2024 *****************************************************************************/
2025 void evel_meas_latency_bucket_high_end_set(
2026 MEASUREMENT_LATENCY_BUCKET * const bucket,
2027 const double high_end);
2029 /**************************************************************************//**
2030 * Set the Low End property of the Measurement Latency Bucket.
2032 * @note The property is treated as immutable: it is only valid to call
2033 * the setter once. However, we don't assert if the caller tries to
2034 * overwrite, just ignoring the update instead.
2036 * @param bucket Pointer to the Measurement Latency Bucket.
2037 * @param low_end Low end of the bucket's range.
2038 *****************************************************************************/
2039 void evel_meas_latency_bucket_low_end_set(
2040 MEASUREMENT_LATENCY_BUCKET * const bucket,
2041 const double low_end);
2043 /**************************************************************************//**
2044 * Add an additional Measurement Latency Bucket to the specified event.
2046 * @param measurement Pointer to the Measurement event.
2047 * @param bucket Pointer to the Measurement Latency Bucket to add.
2048 *****************************************************************************/
2049 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
2050 MEASUREMENT_LATENCY_BUCKET * const bucket);
2052 /**************************************************************************//**
2053 * Add an additional Latency Distribution bucket to the Measurement.
2055 * This function implements the previous API, purely for convenience.
2057 * @param measurement Pointer to the measurement.
2058 * @param low_end Low end of the bucket's range.
2059 * @param high_end High end of the bucket's range.
2060 * @param count Count of events in this bucket.
2061 *****************************************************************************/
2062 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
2063 const double low_end,
2064 const double high_end,
2067 /**************************************************************************//**
2068 * Create a new vNIC Use to be added to a Measurement event.
2070 * @note The mandatory fields on the ::MEASUREMENT_VNIC_PERFORMANCE must be supplied
2071 * to this factory function and are immutable once set. Optional
2072 * fields have explicit setter functions, but again values may only be
2073 * set once so that the ::MEASUREMENT_VNIC_PERFORMANCE has immutable
2076 * @param vnic_id ASCIIZ string with the vNIC's ID.
2077 * @param val_suspect True or false confidence in data.
2079 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_PERFORMANCE.
2080 * If the structure is not used it must be released using
2081 * ::evel_measurement_free_vnic_performance.
2082 * @retval NULL Failed to create the vNIC Use.
2083 *****************************************************************************/
2084 MEASUREMENT_VNIC_PERFORMANCE * evel_measurement_new_vnic_performance(char * const vnic_id, char * const val_suspect);
2086 /**************************************************************************//**
2089 * Free off the ::MEASUREMENT_VNIC_PERFORMANCE supplied. Will free all the contained
2092 * @note It does not free the vNIC Use itself, since that may be part of a
2094 *****************************************************************************/
2095 void evel_measurement_free_vnic_performance(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2097 /**************************************************************************//**
2098 * Set the Accumulated Broadcast Packets Received in measurement interval
2099 * property of the vNIC performance.
2101 * @note The property is treated as immutable: it is only valid to call
2102 * the setter once. However, we don't assert if the caller tries to
2103 * overwrite, just ignoring the update instead.
2105 * @param vnic_performance Pointer to the vNIC Use.
2106 * @param recvd_bcast_packets_acc
2107 *****************************************************************************/
2108 void evel_vnic_performance_rx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2109 const double recvd_bcast_packets_acc);
2110 /**************************************************************************//**
2111 * Set the Delta Broadcast Packets Received in measurement interval
2112 * property of the vNIC performance.
2114 * @note The property is treated as immutable: it is only valid to call
2115 * the setter once. However, we don't assert if the caller tries to
2116 * overwrite, just ignoring the update instead.
2118 * @param vnic_performance Pointer to the vNIC Use.
2119 * @param recvd_bcast_packets_delta
2120 *****************************************************************************/
2121 void evel_vnic_performance_rx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2122 const double recvd_bcast_packets_delta);
2123 /**************************************************************************//**
2124 * Set the Discarded Packets Received in measurement interval
2125 * property of the vNIC performance.
2127 * @note The property is treated as immutable: it is only valid to call
2128 * the setter once. However, we don't assert if the caller tries to
2129 * overwrite, just ignoring the update instead.
2131 * @param vnic_performance Pointer to the vNIC Use.
2132 * @param recvd_discard_packets_acc
2133 *****************************************************************************/
2134 void evel_vnic_performance_rx_discard_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2135 const double recvd_discard_packets_acc);
2136 /**************************************************************************//**
2137 * Set the Delta Discarded Packets Received in measurement interval
2138 * property of the vNIC performance.
2140 * @note The property is treated as immutable: it is only valid to call
2141 * the setter once. However, we don't assert if the caller tries to
2142 * overwrite, just ignoring the update instead.
2144 * @param vnic_performance Pointer to the vNIC Use.
2145 * @param recvd_discard_packets_delta
2146 *****************************************************************************/
2147 void evel_vnic_performance_rx_discard_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2148 const double recvd_discard_packets_delta);
2149 /**************************************************************************//**
2150 * Set the Error Packets Received in measurement interval
2151 * property of the vNIC performance.
2153 * @note The property is treated as immutable: it is only valid to call
2154 * the setter once. However, we don't assert if the caller tries to
2155 * overwrite, just ignoring the update instead.
2157 * @param vnic_performance Pointer to the vNIC Use.
2158 * @param recvd_error_packets_acc
2159 *****************************************************************************/
2160 void evel_vnic_performance_rx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2161 const double recvd_error_packets_acc);
2162 /**************************************************************************//**
2163 * Set the Delta Error Packets Received in measurement interval
2164 * property of the vNIC performance.
2166 * @note The property is treated as immutable: it is only valid to call
2167 * the setter once. However, we don't assert if the caller tries to
2168 * overwrite, just ignoring the update instead.
2170 * @param vnic_performance Pointer to the vNIC Use.
2171 * @param recvd_error_packets_delta
2172 *****************************************************************************/
2173 void evel_vnic_performance_rx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2174 const double recvd_error_packets_delta);
2175 /**************************************************************************//**
2176 * Set the Accumulated Multicast Packets Received in measurement interval
2177 * property of the vNIC performance.
2179 * @note The property is treated as immutable: it is only valid to call
2180 * the setter once. However, we don't assert if the caller tries to
2181 * overwrite, just ignoring the update instead.
2183 * @param vnic_performance Pointer to the vNIC Use.
2184 * @param recvd_mcast_packets_acc
2185 *****************************************************************************/
2186 void evel_vnic_performance_rx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2187 const double recvd_mcast_packets_acc);
2188 /**************************************************************************//**
2189 * Set the Delta Multicast Packets Received in measurement interval
2190 * property of the vNIC performance.
2192 * @note The property is treated as immutable: it is only valid to call
2193 * the setter once. However, we don't assert if the caller tries to
2194 * overwrite, just ignoring the update instead.
2196 * @param vnic_performance Pointer to the vNIC Use.
2197 * @param recvd_mcast_packets_delta
2198 *****************************************************************************/
2199 void evel_vnic_performance_rx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2200 const double recvd_mcast_packets_delta);
2201 /**************************************************************************//**
2202 * Set the Accumulated Octets Received in measurement interval
2203 * property of the vNIC performance.
2205 * @note The property is treated as immutable: it is only valid to call
2206 * the setter once. However, we don't assert if the caller tries to
2207 * overwrite, just ignoring the update instead.
2209 * @param vnic_performance Pointer to the vNIC Use.
2210 * @param recvd_octets_acc
2211 *****************************************************************************/
2212 void evel_vnic_performance_rx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2213 const double recvd_octets_acc);
2214 /**************************************************************************//**
2215 * Set the Delta Octets Received in measurement interval
2216 * property of the vNIC performance.
2218 * @note The property is treated as immutable: it is only valid to call
2219 * the setter once. However, we don't assert if the caller tries to
2220 * overwrite, just ignoring the update instead.
2222 * @param vnic_performance Pointer to the vNIC Use.
2223 * @param recvd_octets_delta
2224 *****************************************************************************/
2225 void evel_vnic_performance_rx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2226 const double recvd_octets_delta);
2227 /**************************************************************************//**
2228 * Set the Accumulated Total Packets Received in measurement interval
2229 * property of the vNIC performance.
2231 * @note The property is treated as immutable: it is only valid to call
2232 * the setter once. However, we don't assert if the caller tries to
2233 * overwrite, just ignoring the update instead.
2235 * @param vnic_performance Pointer to the vNIC Use.
2236 * @param recvd_total_packets_acc
2237 *****************************************************************************/
2238 void evel_vnic_performance_rx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2239 const double recvd_total_packets_acc);
2240 /**************************************************************************//**
2241 * Set the Delta Total Packets Received in measurement interval
2242 * property of the vNIC performance.
2244 * @note The property is treated as immutable: it is only valid to call
2245 * the setter once. However, we don't assert if the caller tries to
2246 * overwrite, just ignoring the update instead.
2248 * @param vnic_performance Pointer to the vNIC Use.
2249 * @param recvd_total_packets_delta
2250 *****************************************************************************/
2251 void evel_vnic_performance_rx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2252 const double recvd_total_packets_delta);
2253 /**************************************************************************//**
2254 * Set the Accumulated Unicast Packets Received in measurement interval
2255 * property of the vNIC performance.
2257 * @note The property is treated as immutable: it is only valid to call
2258 * the setter once. However, we don't assert if the caller tries to
2259 * overwrite, just ignoring the update instead.
2261 * @param vnic_performance Pointer to the vNIC Use.
2262 * @param recvd_ucast_packets_acc
2263 *****************************************************************************/
2264 void evel_vnic_performance_rx_ucast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2265 const double recvd_ucast_packets_acc);
2266 /**************************************************************************//**
2267 * Set the Delta Unicast packets Received in measurement interval
2268 * property of the vNIC performance.
2270 * @note The property is treated as immutable: it is only valid to call
2271 * the setter once. However, we don't assert if the caller tries to
2272 * overwrite, just ignoring the update instead.
2274 * @param vnic_performance Pointer to the vNIC Use.
2275 * @param recvd_ucast_packets_delta
2276 *****************************************************************************/
2277 void evel_vnic_performance_rx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2278 const double recvd_ucast_packets_delta);
2279 /**************************************************************************//**
2280 * Set the Transmitted Broadcast Packets in measurement interval
2281 * property of the vNIC performance.
2283 * @note The property is treated as immutable: it is only valid to call
2284 * the setter once. However, we don't assert if the caller tries to
2285 * overwrite, just ignoring the update instead.
2287 * @param vnic_performance Pointer to the vNIC Use.
2288 * @param tx_bcast_packets_acc
2289 *****************************************************************************/
2290 void evel_vnic_performance_tx_bcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2291 const double tx_bcast_packets_acc);
2292 /**************************************************************************//**
2293 * Set the Delta Broadcast packets Transmitted in measurement interval
2294 * property of the vNIC performance.
2296 * @note The property is treated as immutable: it is only valid to call
2297 * the setter once. However, we don't assert if the caller tries to
2298 * overwrite, just ignoring the update instead.
2300 * @param vnic_performance Pointer to the vNIC Use.
2301 * @param tx_bcast_packets_delta
2302 *****************************************************************************/
2303 void evel_vnic_performance_tx_bcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2304 const double tx_bcast_packets_delta);
2305 /**************************************************************************//**
2306 * Set the Transmitted Discarded Packets in measurement interval
2307 * property of the vNIC performance.
2309 * @note The property is treated as immutable: it is only valid to call
2310 * the setter once. However, we don't assert if the caller tries to
2311 * overwrite, just ignoring the update instead.
2313 * @param vnic_performance Pointer to the vNIC Use.
2314 * @param tx_discarded_packets_acc
2315 *****************************************************************************/
2316 void evel_vnic_performance_tx_discarded_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2317 const double tx_discarded_packets_acc);
2318 /**************************************************************************//**
2319 * Set the Delta Discarded packets Transmitted in measurement interval
2320 * property of the vNIC performance.
2322 * @note The property is treated as immutable: it is only valid to call
2323 * the setter once. However, we don't assert if the caller tries to
2324 * overwrite, just ignoring the update instead.
2326 * @param vnic_performance Pointer to the vNIC Use.
2327 * @param tx_discarded_packets_delta
2328 *****************************************************************************/
2329 void evel_vnic_performance_tx_discarded_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2330 const double tx_discarded_packets_delta);
2331 /**************************************************************************//**
2332 * Set the Transmitted Errored Packets in measurement interval
2333 * property of the vNIC performance.
2335 * @note The property is treated as immutable: it is only valid to call
2336 * the setter once. However, we don't assert if the caller tries to
2337 * overwrite, just ignoring the update instead.
2339 * @param vnic_performance Pointer to the vNIC Use.
2340 * @param tx_error_packets_acc
2341 *****************************************************************************/
2342 void evel_vnic_performance_tx_error_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2343 const double tx_error_packets_acc);
2344 /**************************************************************************//**
2345 * Set the Delta Errored packets Transmitted in measurement interval
2346 * property of the vNIC performance.
2348 * @note The property is treated as immutable: it is only valid to call
2349 * the setter once. However, we don't assert if the caller tries to
2350 * overwrite, just ignoring the update instead.
2352 * @param vnic_performance Pointer to the vNIC Use.
2353 * @param tx_error_packets_delta
2354 *****************************************************************************/
2355 void evel_vnic_performance_tx_error_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2356 const double tx_error_packets_delta);
2357 /**************************************************************************//**
2358 * Set the Transmitted Multicast Packets in measurement interval
2359 * property of the vNIC performance.
2361 * @note The property is treated as immutable: it is only valid to call
2362 * the setter once. However, we don't assert if the caller tries to
2363 * overwrite, just ignoring the update instead.
2365 * @param vnic_performance Pointer to the vNIC Use.
2366 * @param tx_mcast_packets_acc
2367 *****************************************************************************/
2368 void evel_vnic_performance_tx_mcast_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2369 const double tx_mcast_packets_acc);
2370 /**************************************************************************//**
2371 * Set the Delta Multicast packets Transmitted in measurement interval
2372 * property of the vNIC performance.
2374 * @note The property is treated as immutable: it is only valid to call
2375 * the setter once. However, we don't assert if the caller tries to
2376 * overwrite, just ignoring the update instead.
2378 * @param vnic_performance Pointer to the vNIC Use.
2379 * @param tx_mcast_packets_delta
2380 *****************************************************************************/
2381 void evel_vnic_performance_tx_mcast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2382 const double tx_mcast_packets_delta);
2383 /**************************************************************************//**
2384 * Set the Transmitted Octets in measurement interval
2385 * property of the vNIC performance.
2387 * @note The property is treated as immutable: it is only valid to call
2388 * the setter once. However, we don't assert if the caller tries to
2389 * overwrite, just ignoring the update instead.
2391 * @param vnic_performance Pointer to the vNIC Use.
2392 * @param tx_octets_acc
2393 *****************************************************************************/
2394 void evel_vnic_performance_tx_octets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2395 const double tx_octets_acc);
2396 /**************************************************************************//**
2397 * Set the Delta Octets Transmitted in measurement interval
2398 * property of the vNIC performance.
2400 * @note The property is treated as immutable: it is only valid to call
2401 * the setter once. However, we don't assert if the caller tries to
2402 * overwrite, just ignoring the update instead.
2404 * @param vnic_performance Pointer to the vNIC Use.
2405 * @param tx_octets_delta
2406 *****************************************************************************/
2407 void evel_vnic_performance_tx_octets_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2408 const double tx_octets_delta);
2409 /**************************************************************************//**
2410 * Set the Transmitted Total Packets in measurement interval
2411 * property of the vNIC performance.
2413 * @note The property is treated as immutable: it is only valid to call
2414 * the setter once. However, we don't assert if the caller tries to
2415 * overwrite, just ignoring the update instead.
2417 * @param vnic_performance Pointer to the vNIC Use.
2418 * @param tx_total_packets_acc
2419 *****************************************************************************/
2420 void evel_vnic_performance_tx_total_pkt_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2421 const double tx_total_packets_acc);
2422 /**************************************************************************//**
2423 * Set the Delta Total Packets Transmitted in measurement interval
2424 * property of the vNIC performance.
2426 * @note The property is treated as immutable: it is only valid to call
2427 * the setter once. However, we don't assert if the caller tries to
2428 * overwrite, just ignoring the update instead.
2430 * @param vnic_performance Pointer to the vNIC Use.
2431 * @param tx_total_packets_delta
2432 *****************************************************************************/
2433 void evel_vnic_performance_tx_total_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2434 const double tx_total_packets_delta);
2435 /**************************************************************************//**
2436 * Set the Transmitted Unicast Packets in measurement interval
2437 * property of the vNIC performance.
2439 * @note The property is treated as immutable: it is only valid to call
2440 * the setter once. However, we don't assert if the caller tries to
2441 * overwrite, just ignoring the update instead.
2443 * @param vnic_performance Pointer to the vNIC Use.
2444 * @param tx_ucast_packets_acc
2445 *****************************************************************************/
2446 void evel_vnic_performance_tx_ucast_packets_acc_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2447 const double tx_ucast_packets_acc);
2448 /**************************************************************************//**
2449 * Set the Delta Octets Transmitted in measurement interval
2450 * property of the vNIC performance.
2452 * @note The property is treated as immutable: it is only valid to call
2453 * the setter once. However, we don't assert if the caller tries to
2454 * overwrite, just ignoring the update instead.
2456 * @param vnic_performance Pointer to the vNIC Use.
2457 * @param tx_ucast_packets_delta
2458 *****************************************************************************/
2459 void evel_vnic_performance_tx_ucast_pkt_delta_set(MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance,
2460 const double tx_ucast_packets_delta);
2462 /**************************************************************************//**
2463 * Add an additional vNIC Use to the specified Measurement event.
2465 * @param measurement Pointer to the measurement.
2466 * @param vnic_performance Pointer to the vNIC Use to add.
2467 *****************************************************************************/
2468 void evel_meas_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2469 MEASUREMENT_VNIC_PERFORMANCE * const vnic_performance);
2471 /**************************************************************************//**
2472 * Add an additional vNIC usage record Measurement.
2474 * This function implements the previous API, purely for convenience.
2476 * The ID is null delimited ASCII string. The library takes a copy so the
2477 * caller does not have to preserve values after the function returns.
2479 * @param measurement Pointer to the measurement.
2480 * @param vnic_id ASCIIZ string with the vNIC's ID.
2481 * @param valset true or false confidence level
2482 * @param recvd_bcast_packets_acc Recieved broadcast packets
2483 * @param recvd_bcast_packets_delta Received delta broadcast packets
2484 * @param recvd_discarded_packets_acc Recieved discarded packets
2485 * @param recvd_discarded_packets_delta Received discarded delta packets
2486 * @param recvd_error_packets_acc Received error packets
2487 * @param recvd_error_packets_delta, Received delta error packets
2488 * @param recvd_mcast_packets_acc Received multicast packets
2489 * @param recvd_mcast_packets_delta Received delta multicast packets
2490 * @param recvd_octets_acc Received octets
2491 * @param recvd_octets_delta Received delta octets
2492 * @param recvd_total_packets_acc Received total packets
2493 * @param recvd_total_packets_delta Received delta total packets
2494 * @param recvd_ucast_packets_acc Received Unicast packets
2495 * @param recvd_ucast_packets_delta Received delta unicast packets
2496 * @param tx_bcast_packets_acc Transmitted broadcast packets
2497 * @param tx_bcast_packets_delta Transmitted delta broadcast packets
2498 * @param tx_discarded_packets_acc Transmitted packets discarded
2499 * @param tx_discarded_packets_delta Transmitted delta discarded packets
2500 * @param tx_error_packets_acc Transmitted error packets
2501 * @param tx_error_packets_delta Transmitted delta error packets
2502 * @param tx_mcast_packets_acc Transmitted multicast packets accumulated
2503 * @param tx_mcast_packets_delta Transmitted delta multicast packets
2504 * @param tx_octets_acc Transmitted octets
2505 * @param tx_octets_delta Transmitted delta octets
2506 * @param tx_total_packets_acc Transmitted total packets
2507 * @param tx_total_packets_delta Transmitted delta total packets
2508 * @param tx_ucast_packets_acc Transmitted Unicast packets
2509 * @param tx_ucast_packets_delta Transmitted delta Unicast packets
2510 *****************************************************************************/
2511 void evel_measurement_vnic_performance_add(EVENT_MEASUREMENT * const measurement,
2512 char * const vnic_id,
2514 double recvd_bcast_packets_acc,
2515 double recvd_bcast_packets_delta,
2516 double recvd_discarded_packets_acc,
2517 double recvd_discarded_packets_delta,
2518 double recvd_error_packets_acc,
2519 double recvd_error_packets_delta,
2520 double recvd_mcast_packets_acc,
2521 double recvd_mcast_packets_delta,
2522 double recvd_octets_acc,
2523 double recvd_octets_delta,
2524 double recvd_total_packets_acc,
2525 double recvd_total_packets_delta,
2526 double recvd_ucast_packets_acc,
2527 double recvd_ucast_packets_delta,
2528 double tx_bcast_packets_acc,
2529 double tx_bcast_packets_delta,
2530 double tx_discarded_packets_acc,
2531 double tx_discarded_packets_delta,
2532 double tx_error_packets_acc,
2533 double tx_error_packets_delta,
2534 double tx_mcast_packets_acc,
2535 double tx_mcast_packets_delta,
2536 double tx_octets_acc,
2537 double tx_octets_delta,
2538 double tx_total_packets_acc,
2539 double tx_total_packets_delta,
2540 double tx_ucast_packets_acc,
2541 double tx_ucast_packets_delta);
2543 /*****************************************************************************/
2544 /*****************************************************************************/
2548 /*****************************************************************************/
2549 /*****************************************************************************/
2551 /**************************************************************************//**
2552 * Create a new Report event.
2554 * @note The mandatory fields on the Report must be supplied to this
2555 * factory function and are immutable once set. Optional fields have
2556 * explicit setter functions, but again values may only be set once so
2557 * that the Report has immutable properties.
2559 * @param measurement_interval
2561 * @returns pointer to the newly manufactured ::EVENT_REPORT. If the event is
2562 * not used (i.e. posted) it must be released using
2563 * ::evel_free_report.
2564 * @retval NULL Failed to create the event.
2565 *****************************************************************************/
2566 EVENT_REPORT * evel_new_report(double measurement_interval);
2568 /**************************************************************************//**
2571 * Free off the Report supplied. Will free all the contained allocated memory.
2573 * @note It does not free the Report itself, since that may be part of a
2575 *****************************************************************************/
2576 void evel_free_report(EVENT_REPORT * event);
2578 /**************************************************************************//**
2579 * Set the Event Type property of the Report.
2581 * @note The property is treated as immutable: it is only valid to call
2582 * the setter once. However, we don't assert if the caller tries to
2583 * overwrite, just ignoring the update instead.
2585 * @param report Pointer to the Report.
2586 * @param type The Event Type to be set. ASCIIZ string. The caller
2587 * does not need to preserve the value once the function
2589 *****************************************************************************/
2590 void evel_report_type_set(EVENT_REPORT * report, const char * const type);
2592 /**************************************************************************//**
2593 * Add a Feature usage value name/value pair to the Report.
2595 * The name is null delimited ASCII string. The library takes
2596 * a copy so the caller does not have to preserve values after the function
2599 * @param report Pointer to the report.
2600 * @param feature ASCIIZ string with the feature's name.
2601 * @param utilization Utilization of the feature.
2602 *****************************************************************************/
2603 void evel_report_feature_use_add(EVENT_REPORT * report,
2607 /**************************************************************************//**
2608 * Add a Additional Measurement value name/value pair to the Report.
2610 * The name is null delimited ASCII string. The library takes
2611 * a copy so the caller does not have to preserve values after the function
2614 * @param report Pointer to the report.
2615 * @param group ASCIIZ string with the measurement group's name.
2616 * @param name ASCIIZ string containing the measurement's name.
2617 * @param value ASCIIZ string containing the measurement's value.
2618 *****************************************************************************/
2619 void evel_report_custom_measurement_add(EVENT_REPORT * report,
2620 const char * const group,
2621 const char * const name,
2622 const char * const value);
2624 /*****************************************************************************/
2625 /*****************************************************************************/
2629 /*****************************************************************************/
2630 /*****************************************************************************/
2632 /**************************************************************************//**
2633 * Create a new Mobile Flow event.
2635 * @note The mandatory fields on the Mobile Flow must be supplied to this
2636 * factory function and are immutable once set. Optional fields have
2637 * explicit setter functions, but again values may only be set once so
2638 * that the Mobile Flow has immutable properties.
2640 * @param flow_direction
2641 * @param gtp_per_flow_metrics
2642 * @param ip_protocol_type
2644 * @param other_endpoint_ip_address
2645 * @param other_endpoint_port
2646 * @param reporting_endpoint_ip_addr
2647 * @param reporting_endpoint_port
2649 * @returns pointer to the newly manufactured ::EVENT_MOBILE_FLOW. If the
2650 * event is not used (i.e. posted) it must be released using
2651 * ::evel_free_mobile_flow.
2652 * @retval NULL Failed to create the event.
2653 *****************************************************************************/
2654 EVENT_MOBILE_FLOW * evel_new_mobile_flow(
2655 const char * const flow_direction,
2656 MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics,
2657 const char * const ip_protocol_type,
2658 const char * const ip_version,
2659 const char * const other_endpoint_ip_address,
2660 int other_endpoint_port,
2661 const char * const reporting_endpoint_ip_addr,
2662 int reporting_endpoint_port);
2664 /**************************************************************************//**
2665 * Free a Mobile Flow.
2667 * Free off the Mobile Flow supplied. Will free all the contained allocated
2670 * @note It does not free the Mobile Flow itself, since that may be part of a
2672 *****************************************************************************/
2673 void evel_free_mobile_flow(EVENT_MOBILE_FLOW * event);
2675 /**************************************************************************//**
2676 * Set the Event Type property of the Mobile Flow.
2678 * @note The property is treated as immutable: it is only valid to call
2679 * the setter once. However, we don't assert if the caller tries to
2680 * overwrite, just ignoring the update instead.
2682 * @param mobile_flow Pointer to the Mobile Flow.
2683 * @param type The Event Type to be set. ASCIIZ string. The caller
2684 * does not need to preserve the value once the function
2686 *****************************************************************************/
2687 void evel_mobile_flow_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2688 const char * const type);
2690 /**************************************************************************//**
2691 * Set the Application Type property of the Mobile Flow.
2693 * @note The property is treated as immutable: it is only valid to call
2694 * the setter once. However, we don't assert if the caller tries to
2695 * overwrite, just ignoring the update instead.
2697 * @param mobile_flow Pointer to the Mobile Flow.
2698 * @param type The Application Type to be set. ASCIIZ string. The caller
2699 * does not need to preserve the value once the function
2701 *****************************************************************************/
2702 void evel_mobile_flow_app_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2703 const char * const type);
2705 /**************************************************************************//**
2706 * Set the Application Protocol Type property of the Mobile Flow.
2708 * @note The property is treated as immutable: it is only valid to call
2709 * the setter once. However, we don't assert if the caller tries to
2710 * overwrite, just ignoring the update instead.
2712 * @param mobile_flow Pointer to the Mobile Flow.
2713 * @param type The Application Protocol Type to be set. ASCIIZ string.
2714 * The caller does not need to preserve the value once the
2716 *****************************************************************************/
2717 void evel_mobile_flow_app_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2718 const char * const type);
2720 /**************************************************************************//**
2721 * Set the Application Protocol Version property of the Mobile Flow.
2723 * @note The property is treated as immutable: it is only valid to call
2724 * the setter once. However, we don't assert if the caller tries to
2725 * overwrite, just ignoring the update instead.
2727 * @param mobile_flow Pointer to the Mobile Flow.
2728 * @param version The Application Protocol Version to be set. ASCIIZ
2729 * string. The caller does not need to preserve the value
2730 * once the function returns.
2731 *****************************************************************************/
2732 void evel_mobile_flow_app_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2733 const char * const version);
2735 /**************************************************************************//**
2736 * Set the CID property of the Mobile Flow.
2738 * @note The property is treated as immutable: it is only valid to call
2739 * the setter once. However, we don't assert if the caller tries to
2740 * overwrite, just ignoring the update instead.
2742 * @param mobile_flow Pointer to the Mobile Flow.
2743 * @param cid The CID to be set. ASCIIZ string. The caller does not
2744 * need to preserve the value once the function returns.
2745 *****************************************************************************/
2746 void evel_mobile_flow_cid_set(EVENT_MOBILE_FLOW * mobile_flow,
2747 const char * const cid);
2749 /**************************************************************************//**
2750 * Set the Connection Type property of the Mobile Flow.
2752 * @note The property is treated as immutable: it is only valid to call
2753 * the setter once. However, we don't assert if the caller tries to
2754 * overwrite, just ignoring the update instead.
2756 * @param mobile_flow Pointer to the Mobile Flow.
2757 * @param type The Connection Type to be set. ASCIIZ string. The caller
2758 * does not need to preserve the value once the function
2760 *****************************************************************************/
2761 void evel_mobile_flow_con_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2762 const char * const type);
2764 /**************************************************************************//**
2765 * Set the ECGI property of the Mobile Flow.
2767 * @note The property is treated as immutable: it is only valid to call
2768 * the setter once. However, we don't assert if the caller tries to
2769 * overwrite, just ignoring the update instead.
2771 * @param mobile_flow Pointer to the Mobile Flow.
2772 * @param ecgi The ECGI to be set. ASCIIZ string. The caller does not
2773 * need to preserve the value once the function returns.
2774 *****************************************************************************/
2775 void evel_mobile_flow_ecgi_set(EVENT_MOBILE_FLOW * mobile_flow,
2776 const char * const ecgi);
2778 /**************************************************************************//**
2779 * Set the GTP Protocol Type property of the Mobile Flow.
2781 * @note The property is treated as immutable: it is only valid to call
2782 * the setter once. However, we don't assert if the caller tries to
2783 * overwrite, just ignoring the update instead.
2785 * @param mobile_flow Pointer to the Mobile Flow.
2786 * @param type The GTP Protocol Type to be set. ASCIIZ string. The
2787 * caller does not need to preserve the value once the
2789 *****************************************************************************/
2790 void evel_mobile_flow_gtp_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2791 const char * const type);
2793 /**************************************************************************//**
2794 * Set the GTP Protocol Version property of the Mobile Flow.
2796 * @note The property is treated as immutable: it is only valid to call
2797 * the setter once. However, we don't assert if the caller tries to
2798 * overwrite, just ignoring the update instead.
2800 * @param mobile_flow Pointer to the Mobile Flow.
2801 * @param version The GTP Protocol Version to be set. ASCIIZ string. The
2802 * caller does not need to preserve the value once the
2804 *****************************************************************************/
2805 void evel_mobile_flow_gtp_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2806 const char * const version);
2808 /**************************************************************************//**
2809 * Set the HTTP Header property of the Mobile Flow.
2811 * @note The property is treated as immutable: it is only valid to call
2812 * the setter once. However, we don't assert if the caller tries to
2813 * overwrite, just ignoring the update instead.
2815 * @param mobile_flow Pointer to the Mobile Flow.
2816 * @param header The HTTP header to be set. ASCIIZ string. The caller does
2817 * not need to preserve the value once the function returns.
2818 *****************************************************************************/
2819 void evel_mobile_flow_http_header_set(EVENT_MOBILE_FLOW * mobile_flow,
2820 const char * const header);
2822 /**************************************************************************//**
2823 * Set the IMEI property of the Mobile Flow.
2825 * @note The property is treated as immutable: it is only valid to call
2826 * the setter once. However, we don't assert if the caller tries to
2827 * overwrite, just ignoring the update instead.
2829 * @param mobile_flow Pointer to the Mobile Flow.
2830 * @param imei The IMEI to be set. ASCIIZ string. The caller does not
2831 * need to preserve the value once the function returns.
2832 *****************************************************************************/
2833 void evel_mobile_flow_imei_set(EVENT_MOBILE_FLOW * mobile_flow,
2834 const char * const imei);
2836 /**************************************************************************//**
2837 * Set the IMSI property of the Mobile Flow.
2839 * @note The property is treated as immutable: it is only valid to call
2840 * the setter once. However, we don't assert if the caller tries to
2841 * overwrite, just ignoring the update instead.
2843 * @param mobile_flow Pointer to the Mobile Flow.
2844 * @param imsi The IMSI to be set. ASCIIZ string. The caller does not
2845 * need to preserve the value once the function returns.
2846 *****************************************************************************/
2847 void evel_mobile_flow_imsi_set(EVENT_MOBILE_FLOW * mobile_flow,
2848 const char * const imsi);
2850 /**************************************************************************//**
2851 * Set the LAC 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 lac The LAC to be set. ASCIIZ string. The caller does not
2859 * need to preserve the value once the function returns.
2860 *****************************************************************************/
2861 void evel_mobile_flow_lac_set(EVENT_MOBILE_FLOW * mobile_flow,
2862 const char * const lac);
2864 /**************************************************************************//**
2865 * Set the MCC 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 mcc The MCC 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_mcc_set(EVENT_MOBILE_FLOW * mobile_flow,
2876 const char * const mcc);
2878 /**************************************************************************//**
2879 * Set the MNC 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 mnc The MNC 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_mnc_set(EVENT_MOBILE_FLOW * mobile_flow,
2890 const char * const mnc);
2892 /**************************************************************************//**
2893 * Set the MSISDN 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 msisdn The MSISDN 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_msisdn_set(EVENT_MOBILE_FLOW * mobile_flow,
2904 const char * const msisdn);
2906 /**************************************************************************//**
2907 * Set the Other Functional Role 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 role The Other Functional Role to be set. ASCIIZ string. The
2915 * caller does not need to preserve the value once the
2917 *****************************************************************************/
2918 void evel_mobile_flow_other_func_role_set(EVENT_MOBILE_FLOW * mobile_flow,
2919 const char * const role);
2921 /**************************************************************************//**
2922 * Set the RAC property of the Mobile Flow.
2924 * @note The property is treated as immutable: it is only valid to call
2925 * the setter once. However, we don't assert if the caller tries to
2926 * overwrite, just ignoring the update instead.
2928 * @param mobile_flow Pointer to the Mobile Flow.
2929 * @param rac The RAC to be set. ASCIIZ string. The caller does not
2930 * need to preserve the value once the function returns.
2931 *****************************************************************************/
2932 void evel_mobile_flow_rac_set(EVENT_MOBILE_FLOW * mobile_flow,
2933 const char * const rac);
2935 /**************************************************************************//**
2936 * Set the Radio Access Technology property of the Mobile Flow.
2938 * @note The property is treated as immutable: it is only valid to call
2939 * the setter once. However, we don't assert if the caller tries to
2940 * overwrite, just ignoring the update instead.
2942 * @param mobile_flow Pointer to the Mobile Flow.
2943 * @param tech The Radio Access Technology to be set. ASCIIZ string. The
2944 * caller does not need to preserve the value once the
2946 *****************************************************************************/
2947 void evel_mobile_flow_radio_acc_tech_set(EVENT_MOBILE_FLOW * mobile_flow,
2948 const char * const tech);
2950 /**************************************************************************//**
2951 * Set the SAC property of the Mobile Flow.
2953 * @note The property is treated as immutable: it is only valid to call
2954 * the setter once. However, we don't assert if the caller tries to
2955 * overwrite, just ignoring the update instead.
2957 * @param mobile_flow Pointer to the Mobile Flow.
2958 * @param sac The SAC to be set. ASCIIZ string. The caller does not
2959 * need to preserve the value once the function returns.
2960 *****************************************************************************/
2961 void evel_mobile_flow_sac_set(EVENT_MOBILE_FLOW * mobile_flow,
2962 const char * const sac);
2964 /**************************************************************************//**
2965 * Set the Sampling Algorithm property of the Mobile Flow.
2967 * @note The property is treated as immutable: it is only valid to call
2968 * the setter once. However, we don't assert if the caller tries to
2969 * overwrite, just ignoring the update instead.
2971 * @param mobile_flow Pointer to the Mobile Flow.
2972 * @param algorithm The Sampling Algorithm to be set.
2973 *****************************************************************************/
2974 void evel_mobile_flow_samp_alg_set(EVENT_MOBILE_FLOW * mobile_flow,
2977 /**************************************************************************//**
2978 * Set the TAC 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 tac The TAC to be set. ASCIIZ string. The caller does not
2986 * need to preserve the value once the function returns.
2987 *****************************************************************************/
2988 void evel_mobile_flow_tac_set(EVENT_MOBILE_FLOW * mobile_flow,
2989 const char * const tac);
2991 /**************************************************************************//**
2992 * Set the Tunnel ID property of the Mobile Flow.
2994 * @note The property is treated as immutable: it is only valid to call
2995 * the setter once. However, we don't assert if the caller tries to
2996 * overwrite, just ignoring the update instead.
2998 * @param mobile_flow Pointer to the Mobile Flow.
2999 * @param tunnel_id The Tunnel ID to be set. ASCIIZ string. The caller does
3000 * not need to preserve the value once the function returns.
3001 *****************************************************************************/
3002 void evel_mobile_flow_tunnel_id_set(EVENT_MOBILE_FLOW * mobile_flow,
3003 const char * const tunnel_id);
3005 /**************************************************************************//**
3006 * Set the VLAN ID property of the Mobile Flow.
3008 * @note The property is treated as immutable: it is only valid to call
3009 * the setter once. However, we don't assert if the caller tries to
3010 * overwrite, just ignoring the update instead.
3012 * @param mobile_flow Pointer to the Mobile Flow.
3013 * @param vlan_id The VLAN ID to be set. ASCIIZ string. The caller does
3014 * not need to preserve the value once the function returns.
3015 *****************************************************************************/
3016 void evel_mobile_flow_vlan_id_set(EVENT_MOBILE_FLOW * mobile_flow,
3017 const char * const vlan_id);
3019 /**************************************************************************//**
3020 * Create a new Mobile GTP Per Flow Metrics.
3022 * @note The mandatory fields on the Mobile GTP Per Flow Metrics must be
3023 * supplied to this factory function and are immutable once set.
3024 * Optional fields have explicit setter functions, but again values
3025 * may only be set once so that the Mobile GTP Per Flow Metrics has
3026 * immutable properties.
3028 * @param avg_bit_error_rate
3029 * @param avg_packet_delay_variation
3030 * @param avg_packet_latency
3031 * @param avg_receive_throughput
3032 * @param avg_transmit_throughput
3033 * @param flow_activation_epoch
3034 * @param flow_activation_microsec
3035 * @param flow_deactivation_epoch
3036 * @param flow_deactivation_microsec
3037 * @param flow_deactivation_time
3038 * @param flow_status
3039 * @param max_packet_delay_variation
3040 * @param num_activation_failures
3041 * @param num_bit_errors
3042 * @param num_bytes_received
3043 * @param num_bytes_transmitted
3044 * @param num_dropped_packets
3045 * @param num_l7_bytes_received
3046 * @param num_l7_bytes_transmitted
3047 * @param num_lost_packets
3048 * @param num_out_of_order_packets
3049 * @param num_packet_errors
3050 * @param num_packets_received_excl_retrans
3051 * @param num_packets_received_incl_retrans
3052 * @param num_packets_transmitted_incl_retrans
3053 * @param num_retries
3054 * @param num_timeouts
3055 * @param num_tunneled_l7_bytes_received
3056 * @param round_trip_time
3057 * @param time_to_first_byte
3059 * @returns pointer to the newly manufactured ::MOBILE_GTP_PER_FLOW_METRICS.
3060 * If the structure is not used it must be released using
3061 * ::evel_free_mobile_gtp_flow_metrics.
3062 * @retval NULL Failed to create the event.
3063 *****************************************************************************/
3064 MOBILE_GTP_PER_FLOW_METRICS * evel_new_mobile_gtp_flow_metrics(
3065 double avg_bit_error_rate,
3066 double avg_packet_delay_variation,
3067 int avg_packet_latency,
3068 int avg_receive_throughput,
3069 int avg_transmit_throughput,
3070 int flow_activation_epoch,
3071 int flow_activation_microsec,
3072 int flow_deactivation_epoch,
3073 int flow_deactivation_microsec,
3074 time_t flow_deactivation_time,
3075 const char * const flow_status,
3076 int max_packet_delay_variation,
3077 int num_activation_failures,
3079 int num_bytes_received,
3080 int num_bytes_transmitted,
3081 int num_dropped_packets,
3082 int num_l7_bytes_received,
3083 int num_l7_bytes_transmitted,
3084 int num_lost_packets,
3085 int num_out_of_order_packets,
3086 int num_packet_errors,
3087 int num_packets_received_excl_retrans,
3088 int num_packets_received_incl_retrans,
3089 int num_packets_transmitted_incl_retrans,
3092 int num_tunneled_l7_bytes_received,
3093 int round_trip_time,
3094 int time_to_first_byte);
3096 /**************************************************************************//**
3097 * Free a Mobile GTP Per Flow Metrics.
3099 * Free off the Mobile GTP Per Flow Metrics supplied. Will free all the
3100 * contained allocated memory.
3102 * @note It does not free the Mobile GTP Per Flow Metrics itself, since that
3103 * may be part of a larger structure.
3104 *****************************************************************************/
3105 void evel_free_mobile_gtp_flow_metrics(MOBILE_GTP_PER_FLOW_METRICS * metrics);
3107 /**************************************************************************//**
3108 * Set the Duration of Connection Failed Status property of the Mobile GTP Per
3111 * @note The property is treated as immutable: it is only valid to call
3112 * the setter once. However, we don't assert if the caller tries to
3113 * overwrite, just ignoring the update instead.
3115 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3116 * @param duration The Duration of Connection Failed Status to be set.
3117 *****************************************************************************/
3118 void evel_mobile_gtp_metrics_dur_con_fail_set(
3119 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3122 /**************************************************************************//**
3123 * Set the Duration of Tunnel Failed Status property of the Mobile GTP Per Flow
3126 * @note The property is treated as immutable: it is only valid to call
3127 * the setter once. However, we don't assert if the caller tries to
3128 * overwrite, just ignoring the update instead.
3130 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3131 * @param duration The Duration of Tunnel Failed Status to be set.
3132 *****************************************************************************/
3133 void evel_mobile_gtp_metrics_dur_tun_fail_set(
3134 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3137 /**************************************************************************//**
3138 * Set the Activated By property of the Mobile GTP Per Flow metrics.
3140 * @note The property is treated as immutable: it is only valid to call
3141 * the setter once. However, we don't assert if the caller tries to
3142 * overwrite, just ignoring the update instead.
3144 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3145 * @param act_by The Activated By to be set. ASCIIZ string. The caller
3146 * does not need to preserve the value once the function
3148 *****************************************************************************/
3149 void evel_mobile_gtp_metrics_act_by_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3150 const char * const act_by);
3152 /**************************************************************************//**
3153 * Set the Activation Time property of the Mobile GTP Per Flow metrics.
3155 * @note The property is treated as immutable: it is only valid to call
3156 * the setter once. However, we don't assert if the caller tries to
3157 * overwrite, just ignoring the update instead.
3159 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3160 * @param act_time The Activation Time to be set. ASCIIZ string. The caller
3161 * does not need to preserve the value once the function
3163 *****************************************************************************/
3164 void evel_mobile_gtp_metrics_act_time_set(
3165 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3168 /**************************************************************************//**
3169 * Set the Deactivated By property of the Mobile GTP Per Flow metrics.
3171 * @note The property is treated as immutable: it is only valid to call
3172 * the setter once. However, we don't assert if the caller tries to
3173 * overwrite, just ignoring the update instead.
3175 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3176 * @param deact_by The Deactivated By to be set. ASCIIZ string. The caller
3177 * does not need to preserve the value once the function
3179 *****************************************************************************/
3180 void evel_mobile_gtp_metrics_deact_by_set(
3181 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3182 const char * const deact_by);
3184 /**************************************************************************//**
3185 * Set the GTP Connection Status property of the Mobile GTP Per Flow metrics.
3187 * @note The property is treated as immutable: it is only valid to call
3188 * the setter once. However, we don't assert if the caller tries to
3189 * overwrite, just ignoring the update instead.
3191 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3192 * @param status The GTP Connection Status to be set. ASCIIZ string. The
3193 * caller does not need to preserve the value once the
3195 *****************************************************************************/
3196 void evel_mobile_gtp_metrics_con_status_set(
3197 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3198 const char * const status);
3200 /**************************************************************************//**
3201 * Set the GTP Tunnel Status property of the Mobile GTP Per Flow metrics.
3203 * @note The property is treated as immutable: it is only valid to call
3204 * the setter once. However, we don't assert if the caller tries to
3205 * overwrite, just ignoring the update instead.
3207 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3208 * @param status The GTP Tunnel Status to be set. ASCIIZ string. The
3209 * caller does not need to preserve the value once the
3211 *****************************************************************************/
3212 void evel_mobile_gtp_metrics_tun_status_set(
3213 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3214 const char * const status);
3216 /**************************************************************************//**
3217 * Set an IP Type-of-Service count property of the Mobile GTP Per Flow metrics.
3219 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3220 * @param index The index of the IP Type-of-Service.
3221 * @param count The count.
3222 *****************************************************************************/
3223 void evel_mobile_gtp_metrics_iptos_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
3227 /**************************************************************************//**
3228 * Set the Large Packet Round-Trip Time property of the Mobile GTP Per Flow
3231 * @note The property is treated as immutable: it is only valid to call
3232 * the setter once. However, we don't assert if the caller tries to
3233 * overwrite, just ignoring the update instead.
3235 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3236 * @param rtt The Large Packet Round-Trip Time to be set.
3237 *****************************************************************************/
3238 void evel_mobile_gtp_metrics_large_pkt_rtt_set(
3239 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3242 /**************************************************************************//**
3243 * Set the Large Packet Threshold 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 threshold The Large Packet Threshold to be set.
3251 *****************************************************************************/
3252 void evel_mobile_gtp_metrics_large_pkt_thresh_set(
3253 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3256 /**************************************************************************//**
3257 * Set the Max Receive Bit Rate property of the Mobile GTP Per Flow Metrics.
3259 * @note The property is treated as immutable: it is only valid to call
3260 * the setter once. However, we don't assert if the caller tries to
3261 * overwrite, just ignoring the update instead.
3263 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3264 * @param rate The Max Receive Bit Rate to be set.
3265 *****************************************************************************/
3266 void evel_mobile_gtp_metrics_max_rcv_bit_rate_set(
3267 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3270 /**************************************************************************//**
3271 * Set the Max Transmit Bit Rate property of the Mobile GTP Per Flow Metrics.
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 rate The Max Transmit Bit Rate to be set.
3279 *****************************************************************************/
3280 void evel_mobile_gtp_metrics_max_trx_bit_rate_set(
3281 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3284 /**************************************************************************//**
3285 * Set the Number of GTP Echo Failures property of the Mobile GTP Per Flow
3288 * @note The property is treated as immutable: it is only valid to call
3289 * the setter once. However, we don't assert if the caller tries to
3290 * overwrite, just ignoring the update instead.
3292 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3293 * @param num The Number of GTP Echo Failures to be set.
3294 *****************************************************************************/
3295 void evel_mobile_gtp_metrics_num_echo_fail_set(
3296 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3299 /**************************************************************************//**
3300 * Set the Number of GTP Tunnel Errors property of the Mobile GTP Per Flow
3303 * @note The property is treated as immutable: it is only valid to call
3304 * the setter once. However, we don't assert if the caller tries to
3305 * overwrite, just ignoring the update instead.
3307 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3308 * @param num The Number of GTP Tunnel Errors to be set.
3309 *****************************************************************************/
3310 void evel_mobile_gtp_metrics_num_tun_fail_set(
3311 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3314 /**************************************************************************//**
3315 * Set the Number of HTTP Errors property of the Mobile GTP Per Flow Metrics.
3317 * @note The property is treated as immutable: it is only valid to call
3318 * the setter once. However, we don't assert if the caller tries to
3319 * overwrite, just ignoring the update instead.
3321 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3322 * @param num The Number of HTTP Errors to be set.
3323 *****************************************************************************/
3324 void evel_mobile_gtp_metrics_num_http_errors_set(
3325 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3328 /**************************************************************************//**
3329 * Add a TCP flag count to the metrics.
3331 * @note The property is treated as immutable: it is only valid to call
3332 * the setter once. However, we don't assert if the caller tries to
3333 * overwrite, just ignoring the update instead.
3335 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3336 * @param tcp_flag The TCP flag count to be updated.
3337 * @param count The associated flag count.
3338 *****************************************************************************/
3339 void evel_mobile_gtp_metrics_tcp_flag_count_add(
3340 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3341 const EVEL_TCP_FLAGS tcp_flag,
3344 /**************************************************************************//**
3345 * Add a QCI COS count to the metrics.
3347 * @note The property is treated as immutable: it is only valid to call
3348 * the setter once. However, we don't assert if the caller tries to
3349 * overwrite, just ignoring the update instead.
3351 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
3352 * @param qci_cos The QCI COS count to be updated.
3353 * @param count The associated QCI COS count.
3354 *****************************************************************************/
3355 void evel_mobile_gtp_metrics_qci_cos_count_add(
3356 MOBILE_GTP_PER_FLOW_METRICS * metrics,
3357 const EVEL_QCI_COS_TYPES qci_cos,
3360 /*****************************************************************************/
3361 /*****************************************************************************/
3365 /*****************************************************************************/
3366 /*****************************************************************************/
3368 /**************************************************************************//**
3369 * Create a new Signaling event.
3371 * @note The mandatory fields on the Signaling must be supplied to
3372 * this factory function and are immutable once set. Optional fields
3373 * have explicit setter functions, but again values may only be set
3374 * once so that the event has immutable properties.
3375 * @param vendor_name The vendor id to encode in the event vnf field.
3376 * @param module The module to encode in the event.
3377 * @param vnfname The Virtual network function to encode in the event.
3378 * @returns pointer to the newly manufactured ::EVENT_SIGNALING. If the event
3379 * is not used (i.e. posted) it must be released using
3380 * ::evel_free_signaling.
3381 * @retval NULL Failed to create the event.
3382 *****************************************************************************/
3383 EVENT_SIGNALING * evel_new_signaling(const char * const vendor_name,
3384 const char * const correlator,
3385 const char * const local_ip_address,
3386 const char * const local_port,
3387 const char * const remote_ip_address,
3388 const char * const remote_port);
3390 /**************************************************************************//**
3391 * Free a Signaling event.
3393 * Free off the event supplied. Will free all the contained allocated memory.
3395 * @note It does not free the event itself, since that may be part of a larger
3397 *****************************************************************************/
3398 void evel_free_signaling(EVENT_SIGNALING * const event);
3400 /**************************************************************************//**
3401 * Set the Event Type property of the Signaling event.
3403 * @note The property is treated as immutable: it is only valid to call
3404 * the setter once. However, we don't assert if the caller tries to
3405 * overwrite, just ignoring the update instead.
3407 * @param event Pointer to the Signaling event.
3408 * @param type The Event Type to be set. ASCIIZ string. The caller
3409 * does not need to preserve the value once the function
3411 *****************************************************************************/
3412 void evel_signaling_type_set(EVENT_SIGNALING * const event,
3413 const char * const type);
3415 /**************************************************************************//**
3416 * Add an additional value name/value pair to the SIP signaling.
3418 * The name and value are null delimited ASCII strings. The library takes
3419 * a copy so the caller does not have to preserve values after the function
3422 * @param event Pointer to the fault.
3423 * @param name ASCIIZ string with the attribute's name. The caller
3424 * does not need to preserve the value once the function
3426 * @param value ASCIIZ string with the attribute's value. The caller
3427 * does not need to preserve the value once the function
3429 *****************************************************************************/
3430 void evel_signaling_addl_info_add(EVENT_SIGNALING * event, char * name, char * value);
3432 /**************************************************************************//**
3433 * Set the Correlator property of the Signaling event.
3435 * @note The property is treated as immutable: it is only valid to call
3436 * the setter once. However, we don't assert if the caller tries to
3437 * overwrite, just ignoring the update instead.
3439 * @param event Pointer to the Signaling event.
3440 * @param correlator The correlator to be set. ASCIIZ string. The caller
3441 * does not need to preserve the value once the function
3443 *****************************************************************************/
3444 void evel_signaling_correlator_set(EVENT_SIGNALING * const event,
3445 const char * const correlator);
3447 /**************************************************************************//**
3448 * Set the Local Ip Address property of the Signaling event.
3450 * @note The property is treated as immutable: it is only valid to call
3451 * the setter once. However, we don't assert if the caller tries to
3452 * overwrite, just ignoring the update instead.
3454 * @param event Pointer to the Signaling event.
3455 * @param local_ip_address
3456 * The Local Ip Address to be set. ASCIIZ string. The
3457 * caller does not need to preserve the value once the
3459 *****************************************************************************/
3460 void evel_signaling_local_ip_address_set(EVENT_SIGNALING * const event,
3461 const char * const local_ip_address);
3463 /**************************************************************************//**
3464 * Set the Local Port property of the Signaling event.
3466 * @note The property is treated as immutable: it is only valid to call
3467 * the setter once. However, we don't assert if the caller tries to
3468 * overwrite, just ignoring the update instead.
3470 * @param event Pointer to the Signaling event.
3471 * @param local_port The Local Port to be set. ASCIIZ string. The caller
3472 * does not need to preserve the value once the function
3474 *****************************************************************************/
3475 void evel_signaling_local_port_set(EVENT_SIGNALING * const event,
3476 const char * const local_port);
3478 /**************************************************************************//**
3479 * Set the Remote Ip Address property of the Signaling event.
3481 * @note The property is treated as immutable: it is only valid to call
3482 * the setter once. However, we don't assert if the caller tries to
3483 * overwrite, just ignoring the update instead.
3485 * @param event Pointer to the Signaling event.
3486 * @param remote_ip_address
3487 * The Remote Ip Address to be set. ASCIIZ string. The
3488 * caller does not need to preserve the value once the
3490 *****************************************************************************/
3491 void evel_signaling_remote_ip_address_set(EVENT_SIGNALING * const event,
3492 const char * const remote_ip_address);
3494 /**************************************************************************//**
3495 * Set the Remote Port property of the Signaling event.
3497 * @note The property is treated as immutable: it is only valid to call
3498 * the setter once. However, we don't assert if the caller tries to
3499 * overwrite, just ignoring the update instead.
3501 * @param event Pointer to the Signaling event.
3502 * @param remote_port The Remote Port to be set. ASCIIZ string. The caller
3503 * does not need to preserve the value once the function
3505 *****************************************************************************/
3506 void evel_signaling_remote_port_set(EVENT_SIGNALING * const event,
3507 const char * const remote_port);
3508 /**************************************************************************//**
3509 * Set the Vendor module 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 modulename The module name to be set. ASCIIZ string. The caller
3517 * does not need to preserve the value once the function
3519 *****************************************************************************/
3520 void evel_signaling_vnfmodule_name_set(EVENT_SIGNALING * const event,
3521 const char * const module_name);
3522 /**************************************************************************//**
3523 * Set the Vendor module property of the Signaling event.
3525 * @note The property is treated as immutable: it is only valid to call
3526 * the setter once. However, we don't assert if the caller tries to
3527 * overwrite, just ignoring the update instead.
3529 * @param event Pointer to the Signaling event.
3530 * @param vnfname The Virtual Network function to be set. ASCIIZ string.
3531 * The caller does not need to preserve the value once
3532 * the function returns.
3533 *****************************************************************************/
3534 void evel_signaling_vnfname_set(EVENT_SIGNALING * const event,
3535 const char * const vnfname);
3537 /**************************************************************************//**
3538 * Set the Compressed SIP property of the Signaling event.
3540 * @note The property is treated as immutable: it is only valid to call
3541 * the setter once. However, we don't assert if the caller tries to
3542 * overwrite, just ignoring the update instead.
3544 * @param event Pointer to the Signaling event.
3545 * @param compressed_sip
3546 * The Compressed SIP to be set. ASCIIZ string. The caller
3547 * does not need to preserve the value once the function
3549 *****************************************************************************/
3550 void evel_signaling_compressed_sip_set(EVENT_SIGNALING * const event,
3551 const char * const compressed_sip);
3553 /**************************************************************************//**
3554 * Set the Summary SIP 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 summary_sip The Summary SIP to be set. ASCIIZ string. The caller
3562 * does not need to preserve the value once the function
3564 *****************************************************************************/
3565 void evel_signaling_summary_sip_set(EVENT_SIGNALING * const event,
3566 const char * const summary_sip);
3569 /*****************************************************************************/
3570 /*****************************************************************************/
3574 /*****************************************************************************/
3575 /*****************************************************************************/
3577 /**************************************************************************//**
3578 * Create a new State Change event.
3580 * @note The mandatory fields on the Syslog must be supplied to this factory
3581 * function and are immutable once set. Optional fields have explicit
3582 * setter functions, but again values may only be set once so that the
3583 * Syslog has immutable properties.
3585 * @param new_state The new state of the reporting entity.
3586 * @param old_state The old state of the reporting entity.
3587 * @param interface The card or port name of the reporting entity.
3589 * @returns pointer to the newly manufactured ::EVENT_STATE_CHANGE. If the
3590 * event is not used it must be released using
3591 * ::evel_free_state_change
3592 * @retval NULL Failed to create the event.
3593 *****************************************************************************/
3594 EVENT_STATE_CHANGE * evel_new_state_change(const EVEL_ENTITY_STATE new_state,
3595 const EVEL_ENTITY_STATE old_state,
3596 const char * const interface);
3598 /**************************************************************************//**
3599 * Free a State Change.
3601 * Free off the State Change supplied. Will free all the contained allocated
3604 * @note It does not free the State Change itself, since that may be part of a
3606 *****************************************************************************/
3607 void evel_free_state_change(EVENT_STATE_CHANGE * const state_change);
3609 /**************************************************************************//**
3610 * Set the Event Type property of the State Change.
3612 * @note The property is treated as immutable: it is only valid to call
3613 * the setter once. However, we don't assert if the caller tries to
3614 * overwrite, just ignoring the update instead.
3616 * @param state_change Pointer to the ::EVENT_STATE_CHANGE.
3617 * @param type The Event Type to be set. ASCIIZ string. The caller
3618 * does not need to preserve the value once the function
3620 *****************************************************************************/
3621 void evel_state_change_type_set(EVENT_STATE_CHANGE * const state_change,
3622 const char * const type);
3624 /**************************************************************************//**
3625 * Add an additional field name/value pair to the State Change.
3627 * The name and value are null delimited ASCII strings. The library takes
3628 * a copy so the caller does not have to preserve values after the function
3631 * @param state_change Pointer to the ::EVENT_STATE_CHANGE.
3632 * @param name ASCIIZ string with the attribute's name. The caller
3633 * does not need to preserve the value once the function
3635 * @param value ASCIIZ string with the attribute's value. The caller
3636 * does not need to preserve the value once the function
3638 *****************************************************************************/
3639 void evel_state_change_addl_field_add(EVENT_STATE_CHANGE * const state_change,
3640 const char * const name,
3641 const char * const value);
3643 /*****************************************************************************/
3644 /*****************************************************************************/
3648 /*****************************************************************************/
3649 /*****************************************************************************/
3651 /**************************************************************************//**
3652 * Create a new syslog event.
3654 * @note The mandatory fields on the Syslog must be supplied to this factory
3655 * function and are immutable once set. Optional fields have explicit
3656 * setter functions, but again values may only be set once so that the
3657 * Syslog has immutable properties.
3659 * @param event_source_type
3664 * @returns pointer to the newly manufactured ::EVENT_SYSLOG. If the event is
3665 * not used it must be released using ::evel_free_syslog
3666 * @retval NULL Failed to create the event.
3667 *****************************************************************************/
3668 EVENT_SYSLOG * evel_new_syslog(EVEL_SOURCE_TYPES event_source_type,
3669 const char * const syslog_msg,
3670 const char * const syslog_tag);
3672 /**************************************************************************//**
3673 * Set the Event Type property of the Syslog.
3675 * @note The property is treated as immutable: it is only valid to call
3676 * the setter once. However, we don't assert if the caller tries to
3677 * overwrite, just ignoring the update instead.
3679 * @param syslog Pointer to the syslog.
3680 * @param type The Event Type to be set. ASCIIZ string. The caller
3681 * does not need to preserve the value once the function
3683 *****************************************************************************/
3684 void evel_syslog_type_set(EVENT_SYSLOG * syslog,
3685 const char * const type);
3687 /**************************************************************************//**
3690 * Free off the Syslog supplied. Will free all the contained allocated memory.
3692 * @note It does not free the Syslog itself, since that may be part of a
3694 *****************************************************************************/
3695 void evel_free_syslog(EVENT_SYSLOG * event);
3697 /**************************************************************************//**
3698 * Add an additional field name/value pair to the Syslog.
3700 * The name and value are null delimited ASCII strings. The library takes
3701 * a copy so the caller does not have to preserve values after the function
3704 * @param syslog Pointer to the syslog.
3705 * @param name ASCIIZ string with the attribute's name. The caller
3706 * does not need to preserve the value once the function
3708 * @param value ASCIIZ string with the attribute's value. The caller
3709 * does not need to preserve the value once the function
3711 *****************************************************************************/
3712 void evel_syslog_addl_field_add(EVENT_SYSLOG * syslog,
3716 /**************************************************************************//**
3717 * Set the Event Source Host property of the Syslog.
3719 * @note The property is treated as immutable: it is only valid to call
3720 * the setter once. However, we don't assert if the caller tries to
3721 * overwrite, just ignoring the update instead.
3723 * @param syslog Pointer to the Syslog.
3724 * @param host The Event Source Host to be set. ASCIIZ string. The
3725 * caller does not need to preserve the value once the
3727 *****************************************************************************/
3728 void evel_syslog_event_source_host_set(EVENT_SYSLOG * syslog,
3729 const char * const host);
3731 /**************************************************************************//**
3732 * Set the Syslog Facility property of the Syslog.
3734 * @note The property is treated as immutable: it is only valid to call
3735 * the setter once. However, we don't assert if the caller tries to
3736 * overwrite, just ignoring the update instead.
3738 * @param syslog Pointer to the Syslog.
3739 * @param facility The Syslog Facility to be set. ASCIIZ string. The caller
3740 * does not need to preserve the value once the function
3742 *****************************************************************************/
3743 void evel_syslog_facility_set(EVENT_SYSLOG * syslog,
3744 EVEL_SYSLOG_FACILITIES facility);
3746 /**************************************************************************//**
3747 * Set the Process property of the Syslog.
3749 * @note The property is treated as immutable: it is only valid to call
3750 * the setter once. However, we don't assert if the caller tries to
3751 * overwrite, just ignoring the update instead.
3753 * @param syslog Pointer to the Syslog.
3754 * @param proc The Process to be set. ASCIIZ string. The caller does
3755 * not need to preserve the value once the function returns.
3756 *****************************************************************************/
3757 void evel_syslog_proc_set(EVENT_SYSLOG * syslog, const char * const proc);
3759 /**************************************************************************//**
3760 * Set the Process ID property of the Syslog.
3762 * @note The property is treated as immutable: it is only valid to call
3763 * the setter once. However, we don't assert if the caller tries to
3764 * overwrite, just ignoring the update instead.
3766 * @param syslog Pointer to the Syslog.
3767 * @param proc_id The Process ID to be set.
3768 *****************************************************************************/
3769 void evel_syslog_proc_id_set(EVENT_SYSLOG * syslog, int proc_id);
3771 /**************************************************************************//**
3772 * Set the Version property of the Syslog.
3774 * @note The property is treated as immutable: it is only valid to call
3775 * the setter once. However, we don't assert if the caller tries to
3776 * overwrite, just ignoring the update instead.
3778 * @param syslog Pointer to the Syslog.
3779 * @param version The Version to be set.
3780 *****************************************************************************/
3781 void evel_syslog_version_set(EVENT_SYSLOG * syslog, int version);
3783 /**************************************************************************//**
3784 * Set the Structured Data property of the Syslog.
3786 * @note The property is treated as immutable: it is only valid to call
3787 * the setter once. However, we don't assert if the caller tries to
3788 * overwrite, just ignoring the update instead.
3790 * @param syslog Pointer to the Syslog.
3791 * @param s_data The Structured Data to be set. ASCIIZ string. The caller
3792 * does not need to preserve the value once the function
3794 *****************************************************************************/
3795 void evel_syslog_s_data_set(EVENT_SYSLOG * syslog, const char * const s_data);
3797 /**************************************************************************//**
3798 * Set the Structured SDID 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 sdid The Structured Data to be set. ASCIIZ string. name@number
3806 * Caller does not need to preserve the value once the function
3808 *****************************************************************************/
3809 void evel_syslog_sdid_set(EVENT_SYSLOG * syslog, const char * const sdid);
3811 /**************************************************************************//**
3812 * Set the Structured Severity property of the Syslog.
3814 * @note The property is treated as immutable: it is only valid to call
3815 * the setter once. However, we don't assert if the caller tries to
3816 * overwrite, just ignoring the update instead.
3818 * @param syslog Pointer to the Syslog.
3819 * @param sdid The Structured Data to be set. ASCIIZ string.
3820 * Caller does not need to preserve the value once the function
3822 *****************************************************************************/
3823 void evel_syslog_severity_set(EVENT_SYSLOG * syslog, const char * const severty);
3826 /*****************************************************************************/
3827 /*****************************************************************************/
3831 /*****************************************************************************/
3832 /*****************************************************************************/
3834 /**************************************************************************//**
3835 * Create a new other event.
3838 * @returns pointer to the newly manufactured ::EVENT_OTHER. If the event is
3839 * not used it must be released using ::evel_free_other.
3840 * @retval NULL Failed to create the event.
3841 *****************************************************************************/
3842 EVENT_OTHER * evel_new_other(void);
3844 /**************************************************************************//**
3847 * Free off the Other supplied. Will free all the contained allocated memory.
3849 * @note It does not free the Other itself, since that may be part of a
3851 *****************************************************************************/
3852 void evel_free_other(EVENT_OTHER * event);
3854 /**************************************************************************//**
3855 * Set the Event Type property of the Other.
3857 * @note The property is treated as immutable: it is only valid to call
3858 * the setter once. However, we don't assert if the caller tries to
3859 * overwrite, just ignoring the update instead.
3861 * @param other Pointer to the Other.
3862 * @param type The Event Type to be set. ASCIIZ string. The caller
3863 * does not need to preserve the value once the function
3865 *****************************************************************************/
3866 void evel_other_type_set(EVENT_OTHER * other,
3867 const char * const type);
3869 /**************************************************************************//**
3870 * Add a value name/value pair to the Other.
3872 * The name and value are null delimited ASCII strings. The library takes
3873 * a copy so the caller does not have to preserve values after the function
3876 * @param other Pointer to the Other.
3877 * @param name ASCIIZ string with the attribute's name.
3878 * @param value ASCIIZ string with the attribute's value.
3879 *****************************************************************************/
3880 void evel_other_field_add(EVENT_OTHER * other,
3884 /*****************************************************************************/
3885 /*****************************************************************************/
3889 /*****************************************************************************/
3890 /*****************************************************************************/
3892 /**************************************************************************//**
3893 * Return the current measurement interval provided by the Event Listener.
3895 * @returns The current measurement interval
3896 * @retval EVEL_MEASUREMENT_INTERVAL_UKNOWN (0) - interval has not been
3898 *****************************************************************************/
3899 int evel_get_measurement_interval();
3901 /*****************************************************************************/
3902 /* Supported Report version. */
3903 /*****************************************************************************/
3904 #define EVEL_VOICEQ_MAJOR_VERSION 1
3905 #define EVEL_VOICEQ_MINOR_VERSION 1
3907 /**************************************************************************//**
3908 * End of Call Voice Quality Metrices
3909 * JSON equivalent field: endOfCallVqmSummaries
3910 *****************************************************************************/
3911 typedef struct end_of_call_vqm_summaries {
3912 /***************************************************************************/
3913 /* Mandatory fields */
3914 /***************************************************************************/
3915 char* adjacencyName;
3916 char* endpointDescription;
3918 /***************************************************************************/
3919 /* Optional fields */
3920 /***************************************************************************/
3921 EVEL_OPTION_INT endpointJitter;
3922 EVEL_OPTION_INT endpointRtpOctetsDiscarded;
3923 EVEL_OPTION_INT endpointRtpOctetsReceived;
3924 EVEL_OPTION_INT endpointRtpOctetsSent;
3925 EVEL_OPTION_INT endpointRtpPacketsDiscarded;
3926 EVEL_OPTION_INT endpointRtpPacketsReceived;
3927 EVEL_OPTION_INT endpointRtpPacketsSent;
3928 EVEL_OPTION_INT localJitter;
3929 EVEL_OPTION_INT localRtpOctetsDiscarded;
3930 EVEL_OPTION_INT localRtpOctetsReceived;
3931 EVEL_OPTION_INT localRtpOctetsSent;
3932 EVEL_OPTION_INT localRtpPacketsDiscarded;
3933 EVEL_OPTION_INT localRtpPacketsReceived;
3934 EVEL_OPTION_INT localRtpPacketsSent;
3935 EVEL_OPTION_INT mosCqe;
3936 EVEL_OPTION_INT packetsLost;
3937 EVEL_OPTION_INT packetLossPercent;
3938 EVEL_OPTION_INT rFactor;
3939 EVEL_OPTION_INT roundTripDelay;
3941 } END_OF_CALL_VOICE_QUALITY_METRICS;
3943 /**************************************************************************//**
3945 * JSON equivalent field: voiceQualityFields
3946 *****************************************************************************/
3948 typedef struct event_voiceQuality {
3949 /***************************************************************************/
3950 /* Header and version */
3951 /***************************************************************************/
3952 EVENT_HEADER header;
3956 /***************************************************************************/
3957 /* Mandatory fields */
3958 /***************************************************************************/
3960 char *calleeSideCodec;
3961 char *callerSideCodec;
3964 VENDOR_VNFNAME_FIELD vendorVnfNameFields;
3965 END_OF_CALL_VOICE_QUALITY_METRICS *endOfCallVqmSummaries;
3967 /***************************************************************************/
3968 /* Optional fields */
3969 /***************************************************************************/
3970 EVEL_OPTION_STRING phoneNumber;
3971 DLIST additionalInformation;
3973 } EVENT_VOICE_QUALITY;
3974 /**************************************************************************//**
3975 * Voice Quality Additional Info.
3976 * JSON equivalent field: additionalInformation
3977 *****************************************************************************/
3978 typedef struct voice_quality_additional_info {
3981 } VOICE_QUALITY_ADDL_INFO;
3983 /**************************************************************************//**
3984 * Create a new voice quality event.
3986 * @note The mandatory fields on the Voice Quality must be supplied to this
3987 * factory function and are immutable once set. Optional fields have
3988 * explicit setter functions, but again values may only be set once
3989 * so that the Voice Quality has immutable properties.
3990 * @param calleeSideCodec Callee codec for the call.
3991 * @param callerSideCodec Caller codec for the call.
3992 * @param correlator Constant across all events on this call.
3993 * @param midCallRtcp Base64 encoding of the binary RTCP data
3994 * (excluding Eth/IP/UDP headers).
3995 * @param vendorVnfNameFields Vendor, VNF and VfModule names.
3996 * @returns pointer to the newly manufactured ::EVENT_VOICE_QUALITY. If the
3997 * event is not used (i.e. posted) it must be released using
3998 ::evel_free_voice_quality.
3999 * @retval NULL Failed to create the event.
4000 *****************************************************************************/
4001 EVENT_VOICE_QUALITY * evel_new_voice_quality(const char * const calleeSideCodec,
4002 const char * const callerSideCodec, const char * const correlator,
4003 const char * const midCallRtcp, const char * const vendorVnfNameFields);
4005 /**************************************************************************//**
4006 * Set the Callee side codec for Call for domain Voice Quality
4008 * @note The property is treated as immutable: it is only valid to call
4009 * the setter once. However, we don't assert if the caller tries to
4010 * overwrite, just ignoring the update instead.
4012 * @param voiceQuality Pointer to the Voice Quality Event.
4013 * @param calleeCodecForCall The Callee Side Codec to be set. ASCIIZ
4014 * string. The caller does not need to
4015 * preserve the value once the function
4017 *****************************************************************************/
4018 void evel_voice_quality_callee_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
4019 const char * const calleeCodecForCall);
4021 /**************************************************************************//**
4022 * Set the Caller side codec for Call for domain Voice Quality
4024 * @note The property is treated as immutable: it is only valid to call
4025 * the setter once. However, we don't assert if the caller tries to
4026 * overwrite, just ignoring the update instead.
4028 * @param voiceQuality Pointer to the Voice Quality Event.
4029 * @param callerCodecForCall The Caller Side Codec to be set. ASCIIZ
4030 * string. The caller does not need to
4031 * preserve the value once the function
4033 *****************************************************************************/
4034 void evel_voice_quality_caller_codec_set(EVENT_VOICE_QUALITY * voiceQuality,
4035 const char * const callerCodecForCall);
4037 /**************************************************************************//**
4038 * Set the correlator for domain Voice Quality
4040 * @note The property is treated as immutable: it is only valid to call
4041 * the setter once. However, we don't assert if the caller tries to
4042 * overwrite, just ignoring the update instead.
4044 * @param voiceQuality Pointer to the Voice Quality Event.
4045 * @param correlator The correlator value to be set. ASCIIZ
4046 * string. The caller does not need to
4047 * preserve the value once the function
4049 *****************************************************************************/
4050 void evel_voice_quality_correlator_set(EVENT_VOICE_QUALITY * voiceQuality,
4051 const char * const vCorrelator);
4053 /**************************************************************************//**
4054 * Set the RTCP Call Data for domain Voice Quality
4056 * @note The property is treated as immutable: it is only valid to call
4057 * the setter once. However, we don't assert if the caller tries to
4058 * overwrite, just ignoring the update instead.
4060 * @param voiceQuality Pointer to the Voice Quality Event.
4061 * @param rtcpCallData The RTCP Call Data to be set. ASCIIZ
4062 * string. The caller does not need to
4063 * preserve the value once the function
4065 *****************************************************************************/
4066 void evel_voice_quality_rtcp_data_set(EVENT_VOICE_QUALITY * voiceQuality,
4067 const char * const rtcpCallData);
4069 /**************************************************************************//**
4070 * Set the Vendor VNF Name fields for domain Voice Quality
4072 * @note The property is treated as immutable: it is only valid to call
4073 * the setter once. However, we don't assert if the caller tries to
4074 * overwrite, just ignoring the update instead.
4076 * @param voiceQuality Pointer to the Voice Quality Event.
4077 * @param nameFields The Vendor, VNF and VfModule names to be set.
4078 * ASCIIZ string. The caller does not need to
4079 * preserve the value once the function
4081 *****************************************************************************/
4082 void evel_voice_quality_name_fields_set(EVENT_VOICE_QUALITY * voiceQuality,
4083 const char * const nameFields);
4085 /**************************************************************************//**
4086 * Add an End of Call Voice Quality Metrices
4088 * The adjacencyName and endpointDescription is null delimited ASCII string.
4089 * The library takes a copy so the caller does not have to preserve values
4090 * after the function returns.
4092 * @param voiceQuality Pointer to the measurement.
4093 * @param adjacencyName Adjacency name
4094 * @param endpointDescription Enumeration: ‘Caller’, ‘Callee’.
4095 * @param endpointJitter Endpoint jitter
4096 * @param endpointRtpOctetsDiscarded Endpoint RTP octets discarded.
4097 * @param endpointRtpOctetsReceived Endpoint RTP octets received.
4098 * @param endpointRtpOctetsSent Endpoint RTP octets sent
4099 * @param endpointRtpPacketsDiscarded Endpoint RTP packets discarded.
4100 * @param endpointRtpPacketsReceived Endpoint RTP packets received.
4101 * @param endpointRtpPacketsSent Endpoint RTP packets sent.
4102 * @param localJitter Local jitter.
4103 * @param localRtpOctetsDiscarded Local RTP octets discarded.
4104 * @param localRtpOctetsReceived Local RTP octets received.
4105 * @param localRtpOctetsSent Local RTP octets sent.
4106 * @param localRtpPacketsDiscarded Local RTP packets discarded.
4107 * @param localRtpPacketsReceived Local RTP packets received.
4108 * @param localRtpPacketsSent Local RTP packets sent.
4109 * @param mosCqe Decimal range from 1 to 5
4111 * @param packetsLost No Packets lost
4112 * @param packetLossPercent Calculated percentage packet loss
4113 * @param rFactor rFactor from 0 to 100
4114 * @param roundTripDelay Round trip delay in milliseconds
4115 *****************************************************************************/
4116 void evel_voice_quality_end_metrics_add(EVENT_VOICE_QUALITY * voiceQuality,
4117 const char * adjacencyName, EVEL_SERVICE_ENDPOINT_DESC endpointDescription,
4119 int endpointRtpOctetsDiscarded,
4120 int endpointRtpOctetsReceived,
4121 int endpointRtpOctetsSent,
4122 int endpointRtpPacketsDiscarded,
4123 int endpointRtpPacketsReceived,
4124 int endpointRtpPacketsSent,
4126 int localRtpOctetsDiscarded,
4127 int localRtpOctetsReceived,
4128 int localRtpOctetsSent,
4129 int localRtpPacketsDiscarded,
4130 int localRtpPacketsReceived,
4131 int localRtpPacketsSent,
4134 int packetLossPercent,
4136 int roundTripDelay);
4138 /**************************************************************************//**
4139 * Free a Voice Quality.
4141 * Free off the Voce Quality supplied. Will free all the contained allocated
4144 * @note It does not free the Voice Quality itself, since that may be part of a
4146 *****************************************************************************/
4147 void evel_free_voice_quality(EVENT_VOICE_QUALITY * voiceQuality);
4149 /**************************************************************************//**
4150 * Add an additional value name/value pair to the Voice Quality.
4152 * The name and value are null delimited ASCII strings. The library takes
4153 * a copy so the caller does not have to preserve values after the function
4156 * @param fault Pointer to the fault.
4157 * @param name ASCIIZ string with the attribute's name. The caller
4158 * does not need to preserve the value once the function
4160 * @param value ASCIIZ string with the attribute's value. The caller
4161 * does not need to preserve the value once the function
4163 *****************************************************************************/
4164 void evel_voice_quality_addl_info_add(EVENT_VOICE_QUALITY * voiceQuality, char * name, char * value);
4167 /*****************************************************************************/
4168 /*****************************************************************************/
4170 /* THRESHOLD CROSSING ALERT */
4172 /*****************************************************************************/
4173 /*****************************************************************************/
4175 typedef enum evel_event_action {
4176 EVEL_EVENT_ACTION_CLEAR,
4177 EVEL_EVENT_ACTION_CONTINUE,
4178 EVEL_EVENT_ACTION_SET,
4179 EVEL_MAX_EVENT_ACTION
4182 typedef enum evel_alert_type {
4184 EVEL_ELEMENT_ANOMALY,
4185 EVEL_INTERFACE_ANOMALY,
4186 EVEL_SERVICE_ANOMALY,
4191 typedef struct perf_counter {
4194 char * thresholdCrossed;
4199 /*****************************************************************************/
4200 /* Supported Threshold Crossing version. */
4201 /*****************************************************************************/
4202 #define EVEL_THRESHOLD_CROSS_MAJOR_VERSION 1
4203 #define EVEL_THRESHOLD_CROSS_MINOR_VERSION 1
4205 /**************************************************************************//**
4206 * Threshold Crossing.
4207 * JSON equivalent field: Threshold Cross Fields
4208 *****************************************************************************/
4209 typedef struct event_threshold_cross {
4210 /***************************************************************************/
4211 /* Header and version */
4212 /***************************************************************************/
4213 EVENT_HEADER header;
4217 /***************************************************************************/
4218 /* Mandatory fields */
4219 /***************************************************************************/
4220 PERF_COUNTER additionalParameters;
4221 EVEL_EVENT_ACTION alertAction;
4222 char * alertDescription;
4223 EVEL_ALERT_TYPE alertType;
4224 unsigned long long collectionTimestamp;
4225 EVEL_SEVERITIES eventSeverity;
4226 unsigned long long eventStartTimestamp;
4228 /***************************************************************************/
4229 /* Optional fields */
4230 /***************************************************************************/
4231 DLIST additional_info;
4232 EVEL_OPTION_STRING alertValue;
4234 EVEL_OPTION_STRING dataCollector;
4235 EVEL_OPTION_STRING elementType;
4236 EVEL_OPTION_STRING interfaceName;
4237 EVEL_OPTION_STRING networkService;
4238 EVEL_OPTION_STRING possibleRootCause;
4240 } EVENT_THRESHOLD_CROSS;
4243 /**************************************************************************//**
4244 * Create a new Threshold Crossing Alert event.
4246 * @note The mandatory fields on the TCA must be supplied to this factory
4247 * function and are immutable once set. Optional fields have explicit
4248 * setter functions, but again values may only be set once so that the
4249 * TCA has immutable properties.
4251 * @param char* tcriticality Performance Counter Criticality MAJ MIN,
4252 * @param char* tname Performance Counter Threshold name
4253 * @param char* tthresholdCrossed Counter Threshold crossed value
4254 * @param char* tvalue Counter actual value
4255 * @param EVEL_EVENT_ACTION talertAction Alert set continue or clear
4256 * @param char* talertDescription
4257 * @param EVEL_ALERT_TYPE talertType Kind of anamoly
4258 * @param unsigned long long tcollectionTimestamp time at which alert was collected
4259 * @param EVEL_SEVERITIES teventSeverity Severity of Alert
4260 * @param unsigned long long teventStartTimestamp Time when this alert started
4262 * @returns pointer to the newly manufactured ::EVENT_THRESHOLD_CROSS. If the
4263 * event is not used it must be released using
4264 * ::evel_free_threshold_cross
4265 * @retval NULL Failed to create the event.
4266 *****************************************************************************/
4267 EVENT_THRESHOLD_CROSS * evel_new_threshold_cross(
4268 char * tcriticality,
4270 char * tthresholdCrossed,
4272 EVEL_EVENT_ACTION talertAction,
4273 char * talertDescription,
4274 EVEL_ALERT_TYPE talertType,
4275 unsigned long long tcollectionTimestamp,
4276 EVEL_SEVERITIES teventSeverity,
4277 unsigned long long teventStartTimestamp);
4279 /**************************************************************************//**
4280 * Free a Threshold cross event.
4282 * Free off the Threshold crossing event supplied. Will free all the contained allocated
4285 * @note It does not free the Threshold Cross itself, since that may be part of a
4287 *****************************************************************************/
4288 void evel_free_threshold_cross(EVENT_THRESHOLD_CROSS * const tcp);
4290 /**************************************************************************//**
4291 * Set the Event Type property of the Threshold Cross.
4293 * @note The property is treated as immutable: it is only valid to call
4294 * the setter once. However, we don't assert if the caller tries to
4295 * overwrite, just ignoring the update instead.
4297 * @param tcp Pointer to the ::EVENT_THRESHOLD_CROSS.
4298 * @param type The Event Type to be set. ASCIIZ string. The caller
4299 * does not need to preserve the value once the function
4301 *****************************************************************************/
4302 void evel_threshold_cross_type_set(EVENT_THRESHOLD_CROSS * const tcp, char * type);
4304 /**************************************************************************//**
4305 * Add an optional additional alertid value to Alert.
4307 * @param alertid Adds Alert ID
4308 *****************************************************************************/
4309 void evel_threshold_cross_alertid_add(EVENT_THRESHOLD_CROSS * const event,char * alertid);
4311 /**************************************************************************//**
4312 * Set the TCA probable Root cause.
4314 * @param sheader Possible root cause to Threshold
4315 *****************************************************************************/
4316 void evel_threshold_cross_possible_rootcause_set(EVENT_THRESHOLD_CROSS * const event, char * sheader);
4317 /**************************************************************************//**
4318 * Set the TCA networking cause.
4320 * @param sheader Possible networking service value to Threshold
4321 *****************************************************************************/
4322 void evel_threshold_cross_networkservice_set(EVENT_THRESHOLD_CROSS * const event, char * sheader);
4323 /**************************************************************************//**
4324 * Set the TCA Interface name.
4326 * @param sheader Interface name to threshold
4327 *****************************************************************************/
4328 void evel_threshold_cross_interfacename_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4329 /**************************************************************************//**
4330 * Set the TCA Data element type.
4332 * @param sheader element type of Threshold
4333 *****************************************************************************/
4334 void evel_threshold_cross_data_elementtype_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4335 /**************************************************************************//**
4336 * Set the TCA Data collector value.
4338 * @param sheader Data collector value
4339 *****************************************************************************/
4340 void evel_threshold_cross_data_collector_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4341 /**************************************************************************//**
4342 * Set the TCA alert value.
4344 * @param sheader Possible alert value
4345 *****************************************************************************/
4346 void evel_threshold_cross_alertvalue_set(EVENT_THRESHOLD_CROSS * const event,char * sheader);
4348 /**************************************************************************//**
4349 * Add an additional field name/value pair to the THRESHOLD CROSS event.
4351 * The name and value are null delimited ASCII strings. The library takes
4352 * a copy so the caller does not have to preserve values after the function
4355 * @param state_change Pointer to the ::EVENT_THRESHOLD_CROSS.
4356 * @param name ASCIIZ string with the attribute's name. The caller
4357 * does not need to preserve the value once the function
4359 * @param value ASCIIZ string with the attribute's value. The caller
4360 * does not need to preserve the value once the function
4362 *****************************************************************************/
4363 void evel_threshold_cross_addl_info_add(EVENT_THRESHOLD_CROSS * const tcp,
4364 const char * const name,
4365 const char * const value);
4367 /*****************************************************************************/
4368 /*****************************************************************************/
4372 /*****************************************************************************/
4373 /*****************************************************************************/
4375 /*****************************************************************************/
4377 /*****************************************************************************/
4378 #define EVEL_DEBUG(FMT, ...) log_debug(EVEL_LOG_DEBUG, (FMT), ##__VA_ARGS__)
4379 #define EVEL_INFO(FMT, ...) log_debug(EVEL_LOG_INFO, (FMT), ##__VA_ARGS__)
4380 #define EVEL_SPAMMY(FMT, ...) log_debug(EVEL_LOG_SPAMMY, (FMT), ##__VA_ARGS__)
4381 #define EVEL_ERROR(FMT, ...) log_debug(EVEL_LOG_ERROR, "ERROR: " FMT, \
4383 #define EVEL_ENTER() \
4385 log_debug(EVEL_LOG_DEBUG, "Enter %s {", __FUNCTION__); \
4386 debug_indent += 2; \
4388 #define EVEL_EXIT() \
4390 debug_indent -= 2; \
4391 log_debug(EVEL_LOG_DEBUG, "Exit %s }", __FUNCTION__); \
4394 #define INDENT_SEPARATORS \
4395 "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "
4397 extern EVEL_LOG_LEVELS debug_level;
4398 extern int debug_indent;
4401 #define EVEL_DEBUG_ON() ((debug_level) >= EVEL_LOG_DEBUG)
4403 /**************************************************************************//**
4404 * Initialize logging
4406 * @param[in] level The debugging level - one of ::EVEL_LOG_LEVELS.
4407 * @param[in] ident The identifier for our logs.
4408 *****************************************************************************/
4409 void log_initialize(EVEL_LOG_LEVELS level, const char * ident);
4411 /**************************************************************************//**
4412 * Log debug information
4414 * Logs debugging information in a platform independent manner.
4416 * @param[in] level The debugging level - one of ::EVEL_LOG_LEVELS.
4417 * @param[in] format Log formatting string in printf format.
4418 * @param[in] ... Variable argument list.
4419 *****************************************************************************/
4420 void log_debug(EVEL_LOG_LEVELS level, char * format, ...);
4422 /***************************************************************************//*
4423 * Store the formatted string into the static error string and log the error.
4425 * @param format Error string in standard printf format.
4426 * @param ... Variable parameters to be substituted into the format string.
4427 *****************************************************************************/
4428 void log_error_state(char * format, ...);