3 /**************************************************************************//**
5 * Header for EVEL library
7 * This file implements the EVEL library which is intended to provide a
8 * simple wrapper around the complexity of AT&T's Vendor Event Listener API so
9 * that VNFs can use it without worrying about details of the API transport.
11 * Zero return value is success (::EVEL_SUCCESS), non-zero is failure and will
12 * be one of ::EVEL_ERR_CODES.
17 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
19 * Licensed under the Apache License, Version 2.0 (the "License");
20 * you may not use this file except in compliance with the License.
21 * You may obtain a copy of the License at
22 * http://www.apache.org/licenses/LICENSE-2.0
24 * Unless required by applicable law or agreed to in writing, software
25 * distributed under the License is distributed on an "AS IS" BASIS,
26 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27 * See the License for the specific language governing permissions and
28 * limitations under the License.
29 *****************************************************************************/
40 #include "double_list.h"
42 /*****************************************************************************/
43 /* Supported API version. */
44 /*****************************************************************************/
45 #define EVEL_API_MAJOR_VERSION 3
46 #define EVEL_API_MINOR_VERSION 0
48 /**************************************************************************//**
51 * Error codes for EVEL low level interface
52 *****************************************************************************/
54 EVEL_SUCCESS, /** The operation was successful. */
55 EVEL_ERR_GEN_FAIL, /** Non-specific failure. */
56 EVEL_CURL_LIBRARY_FAIL, /** A cURL library operation failed. */
57 EVEL_PTHREAD_LIBRARY_FAIL, /** A Posix threads operation failed. */
58 EVEL_OUT_OF_MEMORY, /** A memory allocation failure occurred. */
59 EVEL_EVENT_BUFFER_FULL, /** Too many events in the ring-buffer. */
60 EVEL_EVENT_HANDLER_INACTIVE, /** Attempt to raise event when inactive. */
61 EVEL_NO_METADATA, /** Failed to retrieve OpenStack metadata. */
62 EVEL_BAD_METADATA, /** OpenStack metadata invalid format. */
63 EVEL_BAD_JSON_FORMAT, /** JSON failed to parse correctly. */
64 EVEL_JSON_KEY_NOT_FOUND, /** Failed to find the specified JSON key. */
65 EVEL_MAX_ERROR_CODES /** Maximum number of valid error codes. */
68 /**************************************************************************//**
71 * Variable levels of verbosity in the logging functions.
72 *****************************************************************************/
82 /*****************************************************************************/
83 /* Maximum string lengths. */
84 /*****************************************************************************/
85 #define EVEL_MAX_STRING_LEN 4096
86 #define EVEL_MAX_JSON_BODY 16000
87 #define EVEL_MAX_ERROR_STRING_LEN 255
88 #define EVEL_MAX_URL_LEN 511
90 /**************************************************************************//**
91 * This value represents there being no restriction on the reporting interval.
92 *****************************************************************************/
93 static const int EVEL_MEASUREMENT_INTERVAL_UKNOWN = 0;
95 /**************************************************************************//**
96 * How many events can be backed-up before we start dropping events on the
99 * @note This value should be tuned in accordance with expected burstiness of
100 * the event load and the expected response time of the ECOMP event
101 * listener so that the probability of the buffer filling is suitably
103 *****************************************************************************/
104 static const int EVEL_EVENT_BUFFER_DEPTH = 100;
106 /*****************************************************************************/
107 /* How many different IP Types-of-Service are supported. */
108 /*****************************************************************************/
109 #define EVEL_TOS_SUPPORTED 256
111 /**************************************************************************//**
112 * Event domains for the various events we support.
113 * JSON equivalent field: domain
114 *****************************************************************************/
116 EVEL_DOMAIN_INTERNAL, /** Internal event, not for external routing. */
117 EVEL_DOMAIN_HEARTBEAT, /** A Heartbeat event (event header only). */
118 EVEL_DOMAIN_FAULT, /** A Fault event. */
119 EVEL_DOMAIN_MEASUREMENT, /** A Measurement for VF Scaling event. */
120 EVEL_DOMAIN_MOBILE_FLOW, /** A Mobile Flow event. */
121 EVEL_DOMAIN_REPORT, /** A Measurement for VF Reporting event. */
122 EVEL_DOMAIN_SERVICE, /** A Service event. */
123 EVEL_DOMAIN_SIGNALING, /** A Signaling event. */
124 EVEL_DOMAIN_STATE_CHANGE, /** A State Change event. */
125 EVEL_DOMAIN_SYSLOG, /** A Syslog event. */
126 EVEL_DOMAIN_OTHER, /** Another event. */
127 EVEL_MAX_DOMAINS /** Maximum number of recognized Event types. */
128 } EVEL_EVENT_DOMAINS;
130 /**************************************************************************//**
132 * JSON equivalent field: priority
133 *****************************************************************************/
136 EVEL_PRIORITY_MEDIUM,
137 EVEL_PRIORITY_NORMAL,
140 } EVEL_EVENT_PRIORITIES;
142 /**************************************************************************//**
143 * Fault / Threshold severities.
144 * JSON equivalent field: eventSeverity
145 *****************************************************************************/
147 EVEL_SEVERITY_CRITICAL,
150 EVEL_SEVERITY_WARNING,
151 EVEL_SEVERITY_NORMAL,
155 /**************************************************************************//**
156 * Fault source types.
157 * JSON equivalent field: eventSourceType
158 *****************************************************************************/
166 EVEL_SOURCE_SLOT_THRESHOLD,
167 EVEL_SOURCE_PORT_THRESHOLD,
168 EVEL_SOURCE_VIRTUAL_MACHINE,
169 EVEL_SOURCE_VIRTUAL_NETWORK_FUNCTION,
170 /***************************************************************************/
171 /* START OF VENDOR-SPECIFIC VALUES */
173 /* Vendor-specific values should be added here, and handled appropriately */
174 /* in evel_event.c. */
175 /***************************************************************************/
177 /***************************************************************************/
178 /* END OF VENDOR-SPECIFIC VALUES */
179 /***************************************************************************/
180 EVEL_MAX_SOURCE_TYPES
183 /**************************************************************************//**
185 * JSON equivalent field: vfStatus
186 *****************************************************************************/
188 EVEL_VF_STATUS_ACTIVE,
190 EVEL_VF_STATUS_PREP_TERMINATE,
191 EVEL_VF_STATUS_READY_TERMINATE,
192 EVEL_VF_STATUS_REQ_TERMINATE,
196 /**************************************************************************//**
197 * Counter criticalities.
198 * JSON equivalent field: criticality
199 *****************************************************************************/
201 EVEL_COUNTER_CRITICALITY_CRIT,
202 EVEL_COUNTER_CRITICALITY_MAJ,
203 EVEL_MAX_COUNTER_CRITICALITIES
204 } EVEL_COUNTER_CRITICALITIES;
206 /**************************************************************************//**
208 * JSON equivalent field: alertAction
209 *****************************************************************************/
211 EVEL_ALERT_ACTION_CLEAR,
212 EVEL_ALERT_ACTION_CONT,
213 EVEL_ALERT_ACTION_SET,
214 EVEL_MAX_ALERT_ACTIONS
215 } EVEL_ALERT_ACTIONS;
217 /**************************************************************************//**
219 * JSON equivalent field: alertType
220 *****************************************************************************/
222 EVEL_ALERT_TYPE_CARD,
223 EVEL_ALERT_TYPE_ELEMENT,
224 EVEL_ALERT_TYPE_INTERFACE,
225 EVEL_ALERT_TYPE_SERVICE,
229 /**************************************************************************//**
231 * JSON equivalent fields: newState, oldState
232 *****************************************************************************/
234 EVEL_ENTITY_STATE_IN_SERVICE,
235 EVEL_ENTITY_STATE_MAINTENANCE,
236 EVEL_ENTITY_STATE_OUT_OF_SERVICE,
237 EVEL_MAX_ENTITY_STATES
240 /**************************************************************************//**
242 * JSON equivalent field: syslogFacility
243 *****************************************************************************/
245 EVEL_SYSLOG_FACILITY_KERNEL,
246 EVEL_SYSLOG_FACILITY_USER,
247 EVEL_SYSLOG_FACILITY_MAIL,
248 EVEL_SYSLOG_FACILITY_SYSTEM_DAEMON,
249 EVEL_SYSLOG_FACILITY_SECURITY_AUTH,
250 EVEL_SYSLOG_FACILITY_INTERNAL,
251 EVEL_SYSLOG_FACILITY_LINE_PRINTER,
252 EVEL_SYSLOG_FACILITY_NETWORK_NEWS,
253 EVEL_SYSLOG_FACILITY_UUCP,
254 EVEL_SYSLOG_FACILITY_CLOCK_DAEMON,
255 EVEL_SYSLOG_FACILITY_SECURITY_AUTH2,
256 EVEL_SYSLOG_FACILITY_FTP_DAEMON,
257 EVEL_SYSLOG_FACILITY_NTP,
258 EVEL_SYSLOG_FACILITY_LOG_AUDIT,
259 EVEL_SYSLOG_FACILITY_LOG_ALERT,
260 EVEL_SYSLOG_FACILITY_CLOCK_DAEMON2,
261 EVEL_SYSLOG_FACILITY_LOCAL0,
262 EVEL_SYSLOG_FACILITY_LOCAL1,
263 EVEL_SYSLOG_FACILITY_LOCAL2,
264 EVEL_SYSLOG_FACILITY_LOCAL3,
265 EVEL_SYSLOG_FACILITY_LOCAL4,
266 EVEL_SYSLOG_FACILITY_LOCAL5,
267 EVEL_SYSLOG_FACILITY_LOCAL6,
268 EVEL_SYSLOG_FACILITY_LOCAL7,
269 EVEL_MAX_SYSLOG_FACILITIES
270 } EVEL_SYSLOG_FACILITIES;
272 /**************************************************************************//**
274 * JSON equivalent fields: tcpFlagCountList, tcpFlagList
275 *****************************************************************************/
289 /**************************************************************************//**
290 * Mobile QCI Classes of Service.
291 * JSON equivalent fields: mobileQciCosCountList, mobileQciCosList
292 *****************************************************************************/
295 /***************************************************************************/
296 /* UMTS Classes of Service. */
297 /***************************************************************************/
298 EVEL_QCI_COS_UMTS_CONVERSATIONAL,
299 EVEL_QCI_COS_UMTS_STREAMING,
300 EVEL_QCI_COS_UMTS_INTERACTIVE,
301 EVEL_QCI_COS_UMTS_BACKGROUND,
303 /***************************************************************************/
304 /* LTE Classes of Service. */
305 /***************************************************************************/
319 EVEL_MAX_QCI_COS_TYPES
320 } EVEL_QCI_COS_TYPES;
322 /**************************************************************************//**
323 * Service Event endpoint description
324 * JSON equivalent field: endpointDesc
325 *****************************************************************************/
327 EVEL_SERVICE_ENDPOINT_CALLEE,
328 EVEL_SERVICE_ENDPOINT_CALLER,
329 EVEL_MAX_SERVICE_ENDPOINT_DESC
330 } EVEL_SERVICE_ENDPOINT_DESC;
332 /**************************************************************************//**
333 * Boolean type for EVEL library.
334 *****************************************************************************/
340 /**************************************************************************//**
341 * Optional parameter holder for double.
342 *****************************************************************************/
343 typedef struct evel_option_double
347 } EVEL_OPTION_DOUBLE;
349 /**************************************************************************//**
350 * Optional parameter holder for string.
351 *****************************************************************************/
352 typedef struct evel_option_string
356 } EVEL_OPTION_STRING;
358 /**************************************************************************//**
359 * Optional parameter holder for int.
360 *****************************************************************************/
361 typedef struct evel_option_int
367 /**************************************************************************//**
368 * Optional parameter holder for unsigned long long.
369 *****************************************************************************/
370 typedef struct evel_option_ull
372 unsigned long long value;
376 /**************************************************************************//**
377 * Optional parameter holder for time_t.
378 *****************************************************************************/
379 typedef struct evel_option_time
385 /*****************************************************************************/
386 /* Supported Common Event Header version. */
387 /*****************************************************************************/
388 #define EVEL_HEADER_MAJOR_VERSION 1
389 #define EVEL_HEADER_MINOR_VERSION 2
391 /**************************************************************************//**
393 * JSON equivalent field: commonEventHeader
394 *****************************************************************************/
395 typedef struct event_header {
396 /***************************************************************************/
398 /***************************************************************************/
402 /***************************************************************************/
403 /* Mandatory fields */
404 /***************************************************************************/
405 EVEL_EVENT_DOMAINS event_domain;
408 char * functional_role;
409 char * reporting_entity_name;
410 EVEL_EVENT_PRIORITIES priority;
411 unsigned long long start_epoch_microsec;
412 unsigned long long last_epoch_microsec;
415 /***************************************************************************/
416 /* Optional fields */
417 /***************************************************************************/
418 EVEL_OPTION_STRING event_type;
419 EVEL_OPTION_STRING source_id;
420 EVEL_OPTION_STRING reporting_entity_id;
424 /*****************************************************************************/
425 /* Supported Fault version. */
426 /*****************************************************************************/
427 #define EVEL_FAULT_MAJOR_VERSION 1
428 #define EVEL_FAULT_MINOR_VERSION 1
430 /**************************************************************************//**
432 * JSON equivalent field: faultFields
433 *****************************************************************************/
434 typedef struct event_fault {
435 /***************************************************************************/
436 /* Header and version */
437 /***************************************************************************/
442 /***************************************************************************/
443 /* Mandatory fields */
444 /***************************************************************************/
445 EVEL_SEVERITIES event_severity;
446 EVEL_SOURCE_TYPES event_source_type;
447 char * alarm_condition;
448 char * specific_problem;
449 EVEL_VF_STATUSES vf_status;
451 /***************************************************************************/
452 /* Optional fields */
453 /***************************************************************************/
454 EVEL_OPTION_STRING alarm_interface_a;
455 DLIST additional_info;
459 /**************************************************************************//**
460 * Fault Additional Info.
461 * JSON equivalent field: alarmAdditionalInformation
462 *****************************************************************************/
463 typedef struct fault_additional_info {
468 /*****************************************************************************/
469 /* Supported Measurement version. */
470 /*****************************************************************************/
471 #define EVEL_MEASUREMENT_MAJOR_VERSION 1
472 #define EVEL_MEASUREMENT_MINOR_VERSION 1
474 /**************************************************************************//**
476 * JSON equivalent field: errors
477 *****************************************************************************/
478 typedef struct measurement_errors {
479 int receive_discards;
481 int transmit_discards;
483 } MEASUREMENT_ERRORS;
485 /**************************************************************************//**
487 * JSON equivalent field: measurementsForVfScalingFields
488 *****************************************************************************/
489 typedef struct event_measurement {
490 /***************************************************************************/
491 /* Header and version */
492 /***************************************************************************/
497 /***************************************************************************/
498 /* Mandatory fields */
499 /***************************************************************************/
500 double measurement_interval;
502 /***************************************************************************/
503 /* Optional fields */
504 /***************************************************************************/
505 DLIST additional_measurements;
506 EVEL_OPTION_DOUBLE aggregate_cpu_usage;
508 EVEL_OPTION_INT concurrent_sessions;
509 EVEL_OPTION_INT configured_entities;
511 MEASUREMENT_ERRORS * errors;
513 DLIST filesystem_usage;
514 DLIST latency_distribution;
515 EVEL_OPTION_DOUBLE mean_request_latency;
516 EVEL_OPTION_DOUBLE memory_configured;
517 EVEL_OPTION_DOUBLE memory_used;
518 EVEL_OPTION_INT media_ports_in_use;
519 EVEL_OPTION_INT request_rate;
520 EVEL_OPTION_DOUBLE vnfc_scaling_metric;
525 /**************************************************************************//**
527 * JSON equivalent field: cpuUsage
528 *****************************************************************************/
529 typedef struct measurement_cpu_use {
532 } MEASUREMENT_CPU_USE;
534 /**************************************************************************//**
536 * JSON equivalent field: filesystemUsage
537 *****************************************************************************/
538 typedef struct measurement_fsys_use {
539 char * filesystem_name;
540 double block_configured;
543 double ephemeral_configured;
545 double ephemeral_used;
546 } MEASUREMENT_FSYS_USE;
548 /**************************************************************************//**
550 * JSON equivalent field: latencyBucketMeasure
551 *****************************************************************************/
552 typedef struct measurement_latency_bucket {
555 /***************************************************************************/
556 /* Optional fields */
557 /***************************************************************************/
558 EVEL_OPTION_DOUBLE high_end;
559 EVEL_OPTION_DOUBLE low_end;
561 } MEASUREMENT_LATENCY_BUCKET;
563 /**************************************************************************//**
565 * JSON equivalent field: vNicUsage
566 *****************************************************************************/
567 typedef struct measurement_vnic_use {
574 /***************************************************************************/
575 /* Optional fields */
576 /***************************************************************************/
577 EVEL_OPTION_INT broadcast_packets_in;
578 EVEL_OPTION_INT broadcast_packets_out;
579 EVEL_OPTION_INT multicast_packets_in;
580 EVEL_OPTION_INT multicast_packets_out;
581 EVEL_OPTION_INT unicast_packets_in;
582 EVEL_OPTION_INT unicast_packets_out;
584 } MEASUREMENT_VNIC_USE;
586 /**************************************************************************//**
588 * JSON equivalent field: codecsInUse
589 *****************************************************************************/
590 typedef struct measurement_codec_use {
593 } MEASUREMENT_CODEC_USE;
595 /**************************************************************************//**
597 * JSON equivalent field: featuresInUse
598 *****************************************************************************/
599 typedef struct measurement_feature_use {
601 int feature_utilization;
602 } MEASUREMENT_FEATURE_USE;
604 /**************************************************************************//**
606 * JSON equivalent field: additionalMeasurements
607 *****************************************************************************/
608 typedef struct measurement_group {
613 /**************************************************************************//**
614 * Custom Defined Measurement.
615 * JSON equivalent field: measurements
616 *****************************************************************************/
617 typedef struct custom_measurement {
620 } CUSTOM_MEASUREMENT;
622 /*****************************************************************************/
623 /* Supported Report version. */
624 /*****************************************************************************/
625 #define EVEL_REPORT_MAJOR_VERSION 1
626 #define EVEL_REPORT_MINOR_VERSION 1
628 /**************************************************************************//**
630 * JSON equivalent field: measurementsForVfReportingFields
632 * @note This is an experimental event type and is not currently a formal part
633 * of AT&T's specification.
634 *****************************************************************************/
635 typedef struct event_report {
636 /***************************************************************************/
637 /* Header and version */
638 /***************************************************************************/
643 /***************************************************************************/
644 /* Mandatory fields */
645 /***************************************************************************/
646 double measurement_interval;
648 /***************************************************************************/
649 /* Optional fields */
650 /***************************************************************************/
652 DLIST measurement_groups;
656 /**************************************************************************//**
657 * Mobile GTP Per Flow Metrics.
658 * JSON equivalent field: gtpPerFlowMetrics
659 *****************************************************************************/
660 typedef struct mobile_gtp_per_flow_metrics {
661 double avg_bit_error_rate;
662 double avg_packet_delay_variation;
663 int avg_packet_latency;
664 int avg_receive_throughput;
665 int avg_transmit_throughput;
666 int flow_activation_epoch;
667 int flow_activation_microsec;
668 int flow_deactivation_epoch;
669 int flow_deactivation_microsec;
670 time_t flow_deactivation_time;
672 int max_packet_delay_variation;
673 int num_activation_failures;
675 int num_bytes_received;
676 int num_bytes_transmitted;
677 int num_dropped_packets;
678 int num_l7_bytes_received;
679 int num_l7_bytes_transmitted;
680 int num_lost_packets;
681 int num_out_of_order_packets;
682 int num_packet_errors;
683 int num_packets_received_excl_retrans;
684 int num_packets_received_incl_retrans;
685 int num_packets_transmitted_incl_retrans;
688 int num_tunneled_l7_bytes_received;
690 int time_to_first_byte;
692 /***************************************************************************/
693 /* Optional fields */
694 /***************************************************************************/
695 EVEL_OPTION_INT ip_tos_counts[EVEL_TOS_SUPPORTED];
696 EVEL_OPTION_INT tcp_flag_counts[EVEL_MAX_TCP_FLAGS];
697 EVEL_OPTION_INT qci_cos_counts[EVEL_MAX_QCI_COS_TYPES];
698 EVEL_OPTION_INT dur_connection_failed_status;
699 EVEL_OPTION_INT dur_tunnel_failed_status;
700 EVEL_OPTION_STRING flow_activated_by;
701 EVEL_OPTION_TIME flow_activation_time;
702 EVEL_OPTION_STRING flow_deactivated_by;
703 EVEL_OPTION_STRING gtp_connection_status;
704 EVEL_OPTION_STRING gtp_tunnel_status;
705 EVEL_OPTION_INT large_packet_rtt;
706 EVEL_OPTION_DOUBLE large_packet_threshold;
707 EVEL_OPTION_INT max_receive_bit_rate;
708 EVEL_OPTION_INT max_transmit_bit_rate;
709 EVEL_OPTION_INT num_gtp_echo_failures;
710 EVEL_OPTION_INT num_gtp_tunnel_errors;
711 EVEL_OPTION_INT num_http_errors;
713 } MOBILE_GTP_PER_FLOW_METRICS;
715 /*****************************************************************************/
716 /* Supported Mobile Flow version. */
717 /*****************************************************************************/
718 #define EVEL_MOBILE_FLOW_MAJOR_VERSION 1
719 #define EVEL_MOBILE_FLOW_MINOR_VERSION 1
721 /**************************************************************************//**
723 * JSON equivalent field: mobileFlow
724 *****************************************************************************/
725 typedef struct event_mobile_flow {
726 /***************************************************************************/
727 /* Header and version */
728 /***************************************************************************/
733 /***************************************************************************/
734 /* Mandatory fields */
735 /***************************************************************************/
736 char * flow_direction;
737 MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics;
738 char * ip_protocol_type;
740 char * other_endpoint_ip_address;
741 int other_endpoint_port;
742 char * reporting_endpoint_ip_addr;
743 int reporting_endpoint_port;
745 /***************************************************************************/
746 /* Optional fields */
747 /***************************************************************************/
748 EVEL_OPTION_STRING application_type;
749 EVEL_OPTION_STRING app_protocol_type;
750 EVEL_OPTION_STRING app_protocol_version;
751 EVEL_OPTION_STRING cid;
752 EVEL_OPTION_STRING connection_type;
753 EVEL_OPTION_STRING ecgi;
754 EVEL_OPTION_STRING gtp_protocol_type;
755 EVEL_OPTION_STRING gtp_version;
756 EVEL_OPTION_STRING http_header;
757 EVEL_OPTION_STRING imei;
758 EVEL_OPTION_STRING imsi;
759 EVEL_OPTION_STRING lac;
760 EVEL_OPTION_STRING mcc;
761 EVEL_OPTION_STRING mnc;
762 EVEL_OPTION_STRING msisdn;
763 EVEL_OPTION_STRING other_functional_role;
764 EVEL_OPTION_STRING rac;
765 EVEL_OPTION_STRING radio_access_technology;
766 EVEL_OPTION_STRING sac;
767 EVEL_OPTION_INT sampling_algorithm;
768 EVEL_OPTION_STRING tac;
769 EVEL_OPTION_STRING tunnel_id;
770 EVEL_OPTION_STRING vlan_id;
774 /**************************************************************************//**
776 * JSON equivalent field: otherFields
777 *****************************************************************************/
778 typedef struct event_other {
784 /**************************************************************************//**
786 * JSON equivalent field: otherFields
787 *****************************************************************************/
788 typedef struct other_field {
793 /**************************************************************************//**
794 * Event Instance Identifier
795 * JSON equivalent field: eventInstanceIdentifier
796 *****************************************************************************/
797 typedef struct evel_event_instance_id {
799 /***************************************************************************/
800 /* Mandatory fields */
801 /***************************************************************************/
802 char * vendor_id; /* JSON: vendorId */
803 char * event_id; /* JSON: eventId */
805 /***************************************************************************/
806 /* Optional fields */
807 /***************************************************************************/
808 EVEL_OPTION_STRING product_id; /* JSON: productId */
809 EVEL_OPTION_STRING subsystem_id; /* JSON: subsystemId */
810 EVEL_OPTION_STRING event_friendly_name; /* JSON: eventFriendlyName */
812 } EVEL_EVENT_INSTANCE_ID;
814 /*****************************************************************************/
815 /* Supported Service Events version. */
816 /*****************************************************************************/
817 #define EVEL_SERVICE_MAJOR_VERSION 1
818 #define EVEL_SERVICE_MINOR_VERSION 1
820 /**************************************************************************//**
822 * JSON equivalent field: serviceEventsFields
823 *****************************************************************************/
824 typedef struct event_service {
825 /***************************************************************************/
826 /* Header and version */
827 /***************************************************************************/
832 /***************************************************************************/
833 /* Mandatory fields */
834 /***************************************************************************/
835 EVEL_EVENT_INSTANCE_ID instance_id; /* JSON: eventInstanceIdentifier */
837 /***************************************************************************/
838 /* Optional fields. */
839 /***************************************************************************/
840 EVEL_OPTION_STRING correlator; /* JSON: correlator */
841 DLIST additional_fields; /* JSON: additionalFields */
843 /***************************************************************************/
844 /* Optional fields within JSON equivalent object: codecSelected */
845 /***************************************************************************/
846 EVEL_OPTION_STRING codec; /* JSON: codec */
848 /***************************************************************************/
849 /* Optional fields within JSON equivalent object: codecSelectedTranscoding */
850 /***************************************************************************/
851 EVEL_OPTION_STRING callee_side_codec; /* JSON: calleeSideCodec */
852 EVEL_OPTION_STRING caller_side_codec; /* JSON: callerSideCodec */
854 /***************************************************************************/
855 /* Optional fields within JSON equivalent object: midCallRtcp */
856 /***************************************************************************/
857 EVEL_OPTION_STRING rtcp_data; /* JSON: rtcpData */
859 /***************************************************************************/
860 /* Optional fields within JSON equivalent object: endOfCallVqmSummaries */
861 /***************************************************************************/
862 EVEL_OPTION_STRING adjacency_name; /* JSON: adjacencyName */
863 EVEL_OPTION_STRING endpoint_description; /* JSON: endpointDescription */
864 EVEL_OPTION_INT endpoint_jitter; /* JSON: endpointJitter */
865 EVEL_OPTION_INT endpoint_rtp_oct_disc; /* JSON: endpointRtpOctetsDiscarded */
866 EVEL_OPTION_INT endpoint_rtp_oct_recv; /* JSON: endpointRtpOctetsReceived */
867 EVEL_OPTION_INT endpoint_rtp_oct_sent; /* JSON: endpointRtpOctetsSent */
868 EVEL_OPTION_INT endpoint_rtp_pkt_disc;/* JSON: endpointRtpPacketsDiscarded */
869 EVEL_OPTION_INT endpoint_rtp_pkt_recv; /* JSON: endpointRtpPacketsReceived */
870 EVEL_OPTION_INT endpoint_rtp_pkt_sent; /* JSON: endpointRtpPacketsSent */
871 EVEL_OPTION_INT local_jitter; /* JSON: localJitter */
872 EVEL_OPTION_INT local_rtp_oct_disc; /* JSON: localRtpOctetsDiscarded */
873 EVEL_OPTION_INT local_rtp_oct_recv; /* JSON: localRtpOctetsReceived */
874 EVEL_OPTION_INT local_rtp_oct_sent; /* JSON: localRtpOctetsSent */
875 EVEL_OPTION_INT local_rtp_pkt_disc; /* JSON: localRtpPacketsDiscarded */
876 EVEL_OPTION_INT local_rtp_pkt_recv; /* JSON: localRtpPacketsReceived */
877 EVEL_OPTION_INT local_rtp_pkt_sent; /* JSON: localRtpPacketsSent */
878 EVEL_OPTION_DOUBLE mos_cqe; /* JSON: mosCqe */
879 EVEL_OPTION_INT packets_lost; /* JSON: packetsLost */
880 EVEL_OPTION_DOUBLE packet_loss_percent; /* JSON: packetLossPercent */
881 EVEL_OPTION_INT r_factor; /* JSON: rFactor */
882 EVEL_OPTION_INT round_trip_delay; /* JSON: roundTripDelay */
884 /***************************************************************************/
885 /* Optional fields within JSON equivalent object: marker */
886 /***************************************************************************/
887 EVEL_OPTION_STRING phone_number; /* JSON: phoneNumber */
891 /*****************************************************************************/
892 /* Supported Signaling version. */
893 /*****************************************************************************/
894 #define EVEL_SIGNALING_MAJOR_VERSION 1
895 #define EVEL_SIGNALING_MINOR_VERSION 1
897 /**************************************************************************//**
899 * JSON equivalent field: signalingFields
900 *****************************************************************************/
901 typedef struct event_signaling {
902 /***************************************************************************/
903 /* Header and version */
904 /***************************************************************************/
909 /***************************************************************************/
910 /* Mandatory fields */
911 /***************************************************************************/
912 EVEL_EVENT_INSTANCE_ID instance_id; /* JSON: eventInstanceIdentifier */
914 /***************************************************************************/
915 /* Optional fields */
916 /***************************************************************************/
917 EVEL_OPTION_STRING correlator; /* JSON: correlator */
918 EVEL_OPTION_STRING local_ip_address; /* JSON: localIpAddress */
919 EVEL_OPTION_STRING local_port; /* JSON: localPort */
920 EVEL_OPTION_STRING remote_ip_address; /* JSON: remoteIpAddress */
921 EVEL_OPTION_STRING remote_port; /* JSON: remotePort */
922 EVEL_OPTION_STRING compressed_sip; /* JSON: compressedSip */
923 EVEL_OPTION_STRING summary_sip; /* JSON: summarySip */
927 /*****************************************************************************/
928 /* Supported State Change version. */
929 /*****************************************************************************/
930 #define EVEL_STATE_CHANGE_MAJOR_VERSION 1
931 #define EVEL_STATE_CHANGE_MINOR_VERSION 1
933 /**************************************************************************//**
935 * JSON equivalent field: stateChangeFields
936 *****************************************************************************/
937 typedef struct event_state_change {
938 /***************************************************************************/
939 /* Header and version */
940 /***************************************************************************/
945 /***************************************************************************/
946 /* Mandatory fields */
947 /***************************************************************************/
948 EVEL_ENTITY_STATE new_state;
949 EVEL_ENTITY_STATE old_state;
950 char * state_interface;
952 /***************************************************************************/
953 /* Optional fields */
954 /***************************************************************************/
955 DLIST additional_fields;
957 } EVENT_STATE_CHANGE;
959 /**************************************************************************//**
960 * State Change Additional Field.
961 * JSON equivalent field: additionalFields
962 *****************************************************************************/
963 typedef struct state_change_additional_field {
966 } STATE_CHANGE_ADDL_FIELD;
968 /*****************************************************************************/
969 /* Supported Syslog version. */
970 /*****************************************************************************/
971 #define EVEL_SYSLOG_MAJOR_VERSION 1
972 #define EVEL_SYSLOG_MINOR_VERSION 1
974 /**************************************************************************//**
976 * JSON equivalent field: syslogFields
977 *****************************************************************************/
978 typedef struct event_syslog {
979 /***************************************************************************/
980 /* Header and version */
981 /***************************************************************************/
986 /***************************************************************************/
987 /* Mandatory fields */
988 /***************************************************************************/
989 EVEL_SOURCE_TYPES event_source_type;
993 /***************************************************************************/
994 /* Optional fields */
995 /***************************************************************************/
996 DLIST additional_fields;
997 EVEL_OPTION_STRING event_source_host;
998 EVEL_OPTION_INT syslog_facility;
999 EVEL_OPTION_STRING syslog_proc;
1000 EVEL_OPTION_INT syslog_proc_id;
1001 EVEL_OPTION_STRING syslog_s_data;
1002 EVEL_OPTION_INT syslog_ver;
1006 /**************************************************************************//**
1007 * Syslog Additional Field.
1008 * JSON equivalent field: additionalFields
1009 *****************************************************************************/
1010 typedef struct syslog_additional_field {
1013 } SYSLOG_ADDL_FIELD;
1015 /**************************************************************************//**
1017 * JSON equivalent object: attCopyrightNotice
1018 *****************************************************************************/
1019 typedef struct copyright {
1020 char * useAndRedistribution;
1025 char * disclaimerLine1;
1026 char * disclaimerLine2;
1027 char * disclaimerLine3;
1028 char * disclaimerLine4;
1031 /**************************************************************************//**
1032 * Library initialization.
1034 * Initialize the EVEL library.
1036 * @note This function initializes the cURL library. Applications making use
1037 * of libcurl may need to pull the initialization out of here. Note
1038 * also that this function is not threadsafe as a result - refer to
1039 * libcurl's API documentation for relevant warnings.
1041 * @sa Matching Term function.
1043 * @param fqdn The API's FQDN or IP address.
1044 * @param port The API's port.
1045 * @param path The optional path (may be NULL).
1046 * @param topic The optional topic part of the URL (may be NULL).
1047 * @param secure Whether to use HTTPS (0=HTTP, 1=HTTPS).
1048 * @param username Username for Basic Authentication of requests.
1049 * @param password Password for Basic Authentication of requests.
1050 * @param source_type The kind of node we represent.
1051 * @param role The role this node undertakes.
1052 * @param verbosity 0 for normal operation, positive values for chattier
1055 * @returns Status code
1056 * @retval EVEL_SUCCESS On success
1057 * @retval ::EVEL_ERR_CODES On failure.
1058 *****************************************************************************/
1059 EVEL_ERR_CODES evel_initialize(const char * const fqdn,
1061 const char * const path,
1062 const char * const topic,
1064 const char * const username,
1065 const char * const password,
1066 EVEL_SOURCE_TYPES source_type,
1067 const char * const role,
1071 /**************************************************************************//**
1072 * Clean up the EVEL library.
1074 * @note that at present don't expect Init/Term cycling not to leak memory!
1076 * @returns Status code
1077 * @retval EVEL_SUCCESS On success
1078 * @retval "One of ::EVEL_ERR_CODES" On failure.
1079 *****************************************************************************/
1080 EVEL_ERR_CODES evel_terminate(void);
1082 EVEL_ERR_CODES evel_post_event(EVENT_HEADER * event);
1083 const char * evel_error_string(void);
1086 /**************************************************************************//**
1089 * Free off the event supplied. Will free all the contained allocated memory.
1091 * @note It is safe to free a NULL pointer.
1092 *****************************************************************************/
1093 void evel_free_event(void * event);
1095 /**************************************************************************//**
1096 * Encode the event as a JSON event object according to AT&T's schema.
1098 * @param json Pointer to where to store the JSON encoded data.
1099 * @param max_size Size of storage available in json_body.
1100 * @param event Pointer to the ::EVENT_HEADER to encode.
1101 * @returns Number of bytes actually written.
1102 *****************************************************************************/
1103 int evel_json_encode_event(char * json,
1105 EVENT_HEADER * event);
1107 /**************************************************************************//**
1108 * Callback function to provide returned data.
1110 * Copy data into the supplied buffer, write_callback::ptr, checking size
1113 * @returns Number of bytes placed into write_callback::ptr. 0 for EOF.
1114 *****************************************************************************/
1115 size_t evel_write_callback(void *contents,
1120 /*****************************************************************************/
1121 /*****************************************************************************/
1123 /* HEARTBEAT - (includes common header, too) */
1125 /*****************************************************************************/
1126 /*****************************************************************************/
1128 /**************************************************************************//**
1129 * Create a new heartbeat event.
1131 * @note that the heartbeat is just a "naked" commonEventHeader!
1133 * @returns pointer to the newly manufactured ::EVENT_HEADER. If the event is
1134 * not used it must be released using ::evel_free_event
1135 * @retval NULL Failed to create the event.
1136 *****************************************************************************/
1137 EVENT_HEADER * evel_new_heartbeat(void);
1139 /**************************************************************************//**
1140 * Free an event header.
1142 * Free off the event header supplied. Will free all the contained allocated
1145 * @note It does not free the header itself, since that may be part of a
1147 *****************************************************************************/
1148 void evel_free_header(EVENT_HEADER * const event);
1150 /**************************************************************************//**
1151 * Initialize a newly created event header.
1153 * @param header Pointer to the header being initialized.
1154 *****************************************************************************/
1155 void evel_init_header(EVENT_HEADER * const header);
1157 /**************************************************************************//**
1158 * Set the Event Type property of the event header.
1160 * @param header Pointer to the ::EVENT_HEADER.
1161 * @param type The Event Type to be set. ASCIIZ string. The caller
1162 * does not need to preserve the value once the function
1164 *****************************************************************************/
1165 void evel_header_type_set(EVENT_HEADER * const header,
1166 const char * const type);
1168 /**************************************************************************//**
1169 * Set the Start Epoch property of the event header.
1171 * @note The Start Epoch defaults to the time of event creation.
1173 * @param header Pointer to the ::EVENT_HEADER.
1174 * @param start_epoch_microsec
1175 * The start epoch to set, in microseconds.
1176 *****************************************************************************/
1177 void evel_start_epoch_set(EVENT_HEADER * const header,
1178 const unsigned long long start_epoch_microsec);
1180 /**************************************************************************//**
1181 * Set the Last Epoch property of the event header.
1183 * @note The Last Epoch defaults to the time of event creation.
1185 * @param header Pointer to the ::EVENT_HEADER.
1186 * @param last_epoch_microsec
1187 * The last epoch to set, in microseconds.
1188 *****************************************************************************/
1189 void evel_last_epoch_set(EVENT_HEADER * const header,
1190 const unsigned long long last_epoch_microsec);
1192 /**************************************************************************//**
1193 * Set the Reporting Entity Name property of the event header.
1195 * @note The Reporting Entity Name defaults to the OpenStack VM Name.
1197 * @param header Pointer to the ::EVENT_HEADER.
1198 * @param entity_name The entity name to set.
1199 *****************************************************************************/
1200 void evel_reporting_entity_name_set(EVENT_HEADER * const header,
1201 const char * const entity_name);
1203 /**************************************************************************//**
1204 * Set the Reporting Entity Id property of the event header.
1206 * @note The Reporting Entity Id defaults to the OpenStack VM UUID.
1208 * @param header Pointer to the ::EVENT_HEADER.
1209 * @param entity_id The entity id to set.
1210 *****************************************************************************/
1211 void evel_reporting_entity_id_set(EVENT_HEADER * const header,
1212 const char * const entity_id);
1214 /*****************************************************************************/
1215 /*****************************************************************************/
1219 /*****************************************************************************/
1220 /*****************************************************************************/
1222 /**************************************************************************//**
1223 * Create a new fault event.
1226 * @returns pointer to the newly manufactured ::EVENT_FAULT. If the event is
1227 * not used it must be released using ::evel_free_fault
1228 * @retval NULL Failed to create the event.
1229 *****************************************************************************/
1230 EVENT_FAULT * evel_new_fault(const char * const condition,
1231 const char * const specific_problem,
1232 EVEL_EVENT_PRIORITIES priority,
1233 EVEL_SEVERITIES severity);
1235 /**************************************************************************//**
1238 * Free off the Fault supplied. Will free all the contained allocated memory.
1240 * @note It does not free the Fault itself, since that may be part of a
1242 *****************************************************************************/
1243 void evel_free_fault(EVENT_FAULT * event);
1246 /**************************************************************************//**
1247 * Set the Alarm Interface A property of the Fault.
1249 * @note The property is treated as immutable: it is only valid to call
1250 * the setter once. However, we don't assert if the caller tries to
1251 * overwrite, just ignoring the update instead.
1253 * @param fault Pointer to the fault.
1254 * @param interface The Alarm Interface A to be set. ASCIIZ string. The caller
1255 * does not need to preserve the value once the function
1257 *****************************************************************************/
1258 void evel_fault_interface_set(EVENT_FAULT * fault,
1259 const char * const interface);
1261 /**************************************************************************//**
1262 * Add an additional value name/value pair to the Fault.
1264 * The name and value are null delimited ASCII strings. The library takes
1265 * a copy so the caller does not have to preserve values after the function
1268 * @param fault Pointer to the fault.
1269 * @param name ASCIIZ string with the attribute's name.
1270 * @param value ASCIIZ string with the attribute's value.
1271 *****************************************************************************/
1272 void evel_fault_addl_info_add(EVENT_FAULT * fault, char * name, char * value);
1274 /**************************************************************************//**
1275 * Set the Event Type property of the Fault.
1277 * @note The property is treated as immutable: it is only valid to call
1278 * the setter once. However, we don't assert if the caller tries to
1279 * overwrite, just ignoring the update instead.
1281 * @param fault Pointer to the fault.
1282 * @param type The Event Type to be set. ASCIIZ string. The caller
1283 * does not need to preserve the value once the function
1285 *****************************************************************************/
1286 void evel_fault_type_set(EVENT_FAULT * fault, const char * const type);
1288 /*****************************************************************************/
1289 /*****************************************************************************/
1293 /*****************************************************************************/
1294 /*****************************************************************************/
1296 /**************************************************************************//**
1297 * Create a new Measurement event.
1299 * @note The mandatory fields on the Measurement must be supplied to this
1300 * factory function and are immutable once set. Optional fields have
1301 * explicit setter functions, but again values may only be set once so
1302 * that the Measurement has immutable properties.
1304 * @param measurement_interval
1306 * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT. If the
1307 * event is not used (i.e. posted) it must be released using
1308 * ::evel_free_event.
1309 * @retval NULL Failed to create the event.
1310 *****************************************************************************/
1311 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval);
1313 /**************************************************************************//**
1314 * Free a Measurement.
1316 * Free off the Measurement supplied. Will free all the contained allocated
1319 * @note It does not free the Measurement itself, since that may be part of a
1321 *****************************************************************************/
1322 void evel_free_measurement(EVENT_MEASUREMENT * event);
1324 /**************************************************************************//**
1325 * Set the Event Type property of the Measurement.
1327 * @note The property is treated as immutable: it is only valid to call
1328 * the setter once. However, we don't assert if the caller tries to
1329 * overwrite, just ignoring the update instead.
1331 * @param measurement Pointer to the Measurement.
1332 * @param type The Event Type to be set. ASCIIZ string. The caller
1333 * does not need to preserve the value once the function
1335 *****************************************************************************/
1336 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
1337 const char * const type);
1339 /**************************************************************************//**
1340 * Set the Concurrent Sessions property of the Measurement.
1342 * @note The property is treated as immutable: it is only valid to call
1343 * the setter once. However, we don't assert if the caller tries to
1344 * overwrite, just ignoring the update instead.
1346 * @param measurement Pointer to the Measurement.
1347 * @param concurrent_sessions The Concurrent Sessions to be set.
1348 *****************************************************************************/
1349 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
1350 int concurrent_sessions);
1352 /**************************************************************************//**
1353 * Set the Configured Entities property of the Measurement.
1355 * @note The property is treated as immutable: it is only valid to call
1356 * the setter once. However, we don't assert if the caller tries to
1357 * overwrite, just ignoring the update instead.
1359 * @param measurement Pointer to the Measurement.
1360 * @param configured_entities The Configured Entities to be set.
1361 *****************************************************************************/
1362 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
1363 int configured_entities);
1365 /**************************************************************************//**
1366 * Add an additional set of Errors to the Measurement.
1368 * @note The property is treated as immutable: it is only valid to call
1369 * the setter once. However, we don't assert if the caller tries to
1370 * overwrite, just ignoring the update instead.
1372 * @param measurement Pointer to the measurement.
1373 * @param receive_discards The number of receive discards.
1374 * @param receive_errors The number of receive errors.
1375 * @param transmit_discards The number of transmit discards.
1376 * @param transmit_errors The number of transmit errors.
1377 *****************************************************************************/
1378 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
1379 int receive_discards,
1381 int transmit_discards,
1382 int transmit_errors);
1384 /**************************************************************************//**
1385 * Set the Mean Request Latency property of the Measurement.
1387 * @note The property is treated as immutable: it is only valid to call
1388 * the setter once. However, we don't assert if the caller tries to
1389 * overwrite, just ignoring the update instead.
1391 * @param measurement Pointer to the Measurement.
1392 * @param mean_request_latency The Mean Request Latency to be set.
1393 *****************************************************************************/
1394 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
1395 double mean_request_latency);
1397 /**************************************************************************//**
1398 * Set the Memory Configured property of the Measurement.
1400 * @note The property is treated as immutable: it is only valid to call
1401 * the setter once. However, we don't assert if the caller tries to
1402 * overwrite, just ignoring the update instead.
1404 * @param measurement Pointer to the Measurement.
1405 * @param memory_configured The Memory Configured to be set.
1406 *****************************************************************************/
1407 void evel_measurement_mem_cfg_set(EVENT_MEASUREMENT * measurement,
1408 double memory_configured);
1410 /**************************************************************************//**
1411 * Set the Memory Used property of the Measurement.
1413 * @note The property is treated as immutable: it is only valid to call
1414 * the setter once. However, we don't assert if the caller tries to
1415 * overwrite, just ignoring the update instead.
1417 * @param measurement Pointer to the Measurement.
1418 * @param memory_used The Memory Used to be set.
1419 *****************************************************************************/
1420 void evel_measurement_mem_used_set(EVENT_MEASUREMENT * measurement,
1421 double memory_used);
1423 /**************************************************************************//**
1424 * Set the Request Rate property of the Measurement.
1426 * @note The property is treated as immutable: it is only valid to call
1427 * the setter once. However, we don't assert if the caller tries to
1428 * overwrite, just ignoring the update instead.
1430 * @param measurement Pointer to the Measurement.
1431 * @param request_rate The Request Rate to be set.
1432 *****************************************************************************/
1433 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
1436 /**************************************************************************//**
1437 * Add an additional CPU usage value name/value pair to the Measurement.
1439 * The name and value are null delimited ASCII strings. The library takes
1440 * a copy so the caller does not have to preserve values after the function
1443 * @param measurement Pointer to the measurement.
1444 * @param id ASCIIZ string with the CPU's identifier.
1445 * @param usage CPU utilization.
1446 *****************************************************************************/
1447 void evel_measurement_cpu_use_add(EVENT_MEASUREMENT * measurement,
1448 char * id, double usage);
1450 /**************************************************************************//**
1451 * Add an additional File System usage value name/value pair to the
1454 * The filesystem_name is null delimited ASCII string. The library takes a
1455 * copy so the caller does not have to preserve values after the function
1458 * @param measurement Pointer to the measurement.
1459 * @param filesystem_name ASCIIZ string with the file-system's UUID.
1460 * @param block_configured Block storage configured.
1461 * @param block_used Block storage in use.
1462 * @param block_iops Block storage IOPS.
1463 * @param ephemeral_configured Ephemeral storage configured.
1464 * @param ephemeral_used Ephemeral storage in use.
1465 * @param ephemeral_iops Ephemeral storage IOPS.
1466 *****************************************************************************/
1467 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
1468 char * filesystem_name,
1469 double block_configured,
1472 double ephemeral_configured,
1473 double ephemeral_used,
1474 int ephemeral_iops);
1476 /**************************************************************************//**
1477 * Add a Feature usage value name/value pair to the Measurement.
1479 * The name is null delimited ASCII string. The library takes
1480 * a copy so the caller does not have to preserve values after the function
1483 * @param measurement Pointer to the measurement.
1484 * @param feature ASCIIZ string with the feature's name.
1485 * @param utilization Utilization of the feature.
1486 *****************************************************************************/
1487 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
1491 /**************************************************************************//**
1492 * Add a Additional Measurement value name/value pair to the Measurement.
1494 * The name is null delimited ASCII string. The library takes
1495 * a copy so the caller does not have to preserve values after the function
1498 * @param measurement Pointer to the Measurement.
1499 * @param group ASCIIZ string with the measurement group's name.
1500 * @param name ASCIIZ string containing the measurement's name.
1501 * @param name ASCIIZ string containing the measurement's value.
1502 *****************************************************************************/
1503 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
1504 const char * const group,
1505 const char * const name,
1506 const char * const value);
1508 /**************************************************************************//**
1509 * Add a Codec usage value name/value pair to the Measurement.
1511 * The name is null delimited ASCII string. The library takes
1512 * a copy so the caller does not have to preserve values after the function
1515 * @param measurement Pointer to the measurement.
1516 * @param codec ASCIIZ string with the codec's name.
1517 * @param utilization Utilization of the feature.
1518 *****************************************************************************/
1519 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
1523 /**************************************************************************//**
1525 * Set the Aggregate CPU Use property of the Measurement.
1527 * @note The property is treated as immutable: it is only valid to call
1528 * the setter once. However, we don't assert if the caller tries to
1529 * overwrite, just ignoring the update instead.
1531 * @param measurement Pointer to the measurement.
1532 * @param cpu_use The CPU use to set.
1533 *****************************************************************************/
1534 void evel_measurement_agg_cpu_use_set(EVENT_MEASUREMENT * measurement,
1537 /**************************************************************************//**
1538 * Set the Media Ports in Use property of the Measurement.
1540 * @note The property is treated as immutable: it is only valid to call
1541 * the setter once. However, we don't assert if the caller tries to
1542 * overwrite, just ignoring the update instead.
1544 * @param measurement Pointer to the measurement.
1545 * @param media_ports_in_use The media port usage to set.
1546 *****************************************************************************/
1547 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
1548 int media_ports_in_use);
1550 /**************************************************************************//**
1551 * Set the VNFC Scaling Metric property of the Measurement.
1553 * @note The property is treated as immutable: it is only valid to call
1554 * the setter once. However, we don't assert if the caller tries to
1555 * overwrite, just ignoring the update instead.
1557 * @param measurement Pointer to the measurement.
1558 * @param scaling_metric The scaling metric to set.
1559 *****************************************************************************/
1560 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
1561 double scaling_metric);
1563 /**************************************************************************//**
1564 * Create a new Latency Bucket to be added to a Measurement event.
1566 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
1567 * supplied to this factory function and are immutable once set.
1568 * Optional fields have explicit setter functions, but again values
1569 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
1570 * immutable properties.
1572 * @param count Count of events in this bucket.
1574 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
1575 * @retval NULL Failed to create the Latency Bucket.
1576 *****************************************************************************/
1577 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count);
1579 /**************************************************************************//**
1580 * Set the High End property of the Measurement Latency Bucket.
1582 * @note The property is treated as immutable: it is only valid to call
1583 * the setter once. However, we don't assert if the caller tries to
1584 * overwrite, just ignoring the update instead.
1586 * @param bucket Pointer to the Measurement Latency Bucket.
1587 * @param high_end High end of the bucket's range.
1588 *****************************************************************************/
1589 void evel_meas_latency_bucket_high_end_set(
1590 MEASUREMENT_LATENCY_BUCKET * const bucket,
1591 const double high_end);
1593 /**************************************************************************//**
1594 * Set the Low End property of the Measurement Latency Bucket.
1596 * @note The property is treated as immutable: it is only valid to call
1597 * the setter once. However, we don't assert if the caller tries to
1598 * overwrite, just ignoring the update instead.
1600 * @param bucket Pointer to the Measurement Latency Bucket.
1601 * @param low_end Low end of the bucket's range.
1602 *****************************************************************************/
1603 void evel_meas_latency_bucket_low_end_set(
1604 MEASUREMENT_LATENCY_BUCKET * const bucket,
1605 const double low_end);
1607 /**************************************************************************//**
1608 * Add an additional Measurement Latency Bucket to the specified event.
1610 * @param measurement Pointer to the Measurement event.
1611 * @param bucket Pointer to the Measurement Latency Bucket to add.
1612 *****************************************************************************/
1613 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
1614 MEASUREMENT_LATENCY_BUCKET * const bucket);
1616 /**************************************************************************//**
1617 * Add an additional Latency Distribution bucket to the Measurement.
1619 * This function implements the previous API, purely for convenience.
1621 * @param measurement Pointer to the measurement.
1622 * @param low_end Low end of the bucket's range.
1623 * @param high_end High end of the bucket's range.
1624 * @param count Count of events in this bucket.
1625 *****************************************************************************/
1626 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
1627 const double low_end,
1628 const double high_end,
1631 /**************************************************************************//**
1632 * Create a new vNIC Use to be added to a Measurement event.
1634 * @note The mandatory fields on the ::MEASUREMENT_VNIC_USE must be supplied
1635 * to this factory function and are immutable once set. Optional
1636 * fields have explicit setter functions, but again values may only be
1637 * set once so that the ::MEASUREMENT_VNIC_USE has immutable
1640 * @param vnic_id ASCIIZ string with the vNIC's ID.
1641 * @param packets_in Total packets received.
1642 * @param packets_out Total packets transmitted.
1643 * @param bytes_in Total bytes received.
1644 * @param bytes_out Total bytes transmitted.
1646 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_USE.
1647 * If the structure is not used it must be released using
1648 * ::evel_free_measurement_vnic_use.
1649 * @retval NULL Failed to create the vNIC Use.
1650 *****************************************************************************/
1651 MEASUREMENT_VNIC_USE * evel_new_measurement_vnic_use(char * const vnic_id,
1652 const int packets_in,
1653 const int packets_out,
1655 const int bytes_out);
1657 /**************************************************************************//**
1660 * Free off the ::MEASUREMENT_VNIC_USE supplied. Will free all the contained
1663 * @note It does not free the vNIC Use itself, since that may be part of a
1665 *****************************************************************************/
1666 void evel_free_measurement_vnic_use(MEASUREMENT_VNIC_USE * const vnic_use);
1668 /**************************************************************************//**
1669 * Set the Broadcast Packets Received property of the vNIC Use.
1671 * @note The property is treated as immutable: it is only valid to call
1672 * the setter once. However, we don't assert if the caller tries to
1673 * overwrite, just ignoring the update instead.
1675 * @param vnic_use Pointer to the vNIC Use.
1676 * @param broadcast_packets_in
1677 * Broadcast packets received.
1678 *****************************************************************************/
1679 void evel_vnic_use_bcast_pkt_in_set(MEASUREMENT_VNIC_USE * const vnic_use,
1680 const int broadcast_packets_in);
1682 /**************************************************************************//**
1683 * Set the Broadcast Packets Transmitted property of the vNIC Use.
1685 * @note The property is treated as immutable: it is only valid to call
1686 * the setter once. However, we don't assert if the caller tries to
1687 * overwrite, just ignoring the update instead.
1689 * @param vnic_use Pointer to the vNIC Use.
1690 * @param broadcast_packets_out
1691 * Broadcast packets transmitted.
1692 *****************************************************************************/
1693 void evel_vnic_use_bcast_pkt_out_set(MEASUREMENT_VNIC_USE * const vnic_use,
1694 const int broadcast_packets_out);
1696 /**************************************************************************//**
1697 * Set the Multicast Packets Received property of the vNIC Use.
1699 * @note The property is treated as immutable: it is only valid to call
1700 * the setter once. However, we don't assert if the caller tries to
1701 * overwrite, just ignoring the update instead.
1703 * @param vnic_use Pointer to the vNIC Use.
1704 * @param multicast_packets_in
1705 * Multicast packets received.
1706 *****************************************************************************/
1707 void evel_vnic_use_mcast_pkt_in_set(MEASUREMENT_VNIC_USE * const vnic_use,
1708 const int multicast_packets_in);
1710 /**************************************************************************//**
1711 * Set the Multicast Packets Transmitted property of the vNIC Use.
1713 * @note The property is treated as immutable: it is only valid to call
1714 * the setter once. However, we don't assert if the caller tries to
1715 * overwrite, just ignoring the update instead.
1717 * @param vnic_use Pointer to the vNIC Use.
1718 * @param multicast_packets_out
1719 * Multicast packets transmitted.
1720 *****************************************************************************/
1721 void evel_vnic_use_mcast_pkt_out_set(MEASUREMENT_VNIC_USE * const vnic_use,
1722 const int multicast_packets_out);
1724 /**************************************************************************//**
1725 * Set the Unicast Packets Received property of the vNIC Use.
1727 * @note The property is treated as immutable: it is only valid to call
1728 * the setter once. However, we don't assert if the caller tries to
1729 * overwrite, just ignoring the update instead.
1731 * @param vnic_use Pointer to the vNIC Use.
1732 * @param unicast_packets_in
1733 * Unicast packets received.
1734 *****************************************************************************/
1735 void evel_vnic_use_ucast_pkt_in_set(MEASUREMENT_VNIC_USE * const vnic_use,
1736 const int unicast_packets_in);
1738 /**************************************************************************//**
1739 * Set the Unicast Packets Transmitted property of the vNIC Use.
1741 * @note The property is treated as immutable: it is only valid to call
1742 * the setter once. However, we don't assert if the caller tries to
1743 * overwrite, just ignoring the update instead.
1745 * @param vnic_use Pointer to the vNIC Use.
1746 * @param unicast_packets_out
1747 * Unicast packets transmitted.
1748 *****************************************************************************/
1749 void evel_vnic_use_ucast_pkt_out_set(MEASUREMENT_VNIC_USE * const vnic_use,
1750 const int unicast_packets_out);
1752 /**************************************************************************//**
1753 * Add an additional vNIC Use to the specified Measurement event.
1755 * @param measurement Pointer to the measurement.
1756 * @param vnic_use Pointer to the vNIC Use to add.
1757 *****************************************************************************/
1758 void evel_meas_vnic_use_add(EVENT_MEASUREMENT * const measurement,
1759 MEASUREMENT_VNIC_USE * const vnic_use);
1761 /**************************************************************************//**
1762 * Add an additional vNIC usage record Measurement.
1764 * This function implements the previous API, purely for convenience.
1766 * The ID is null delimited ASCII string. The library takes a copy so the
1767 * caller does not have to preserve values after the function returns.
1769 * @param measurement Pointer to the measurement.
1770 * @param vnic_id ASCIIZ string with the vNIC's ID.
1771 * @param packets_in Total packets received.
1772 * @param packets_out Total packets transmitted.
1773 * @param broadcast_packets_in Broadcast packets received.
1774 * @param broadcast_packets_out Broadcast packets transmitted.
1775 * @param bytes_in Total bytes received.
1776 * @param bytes_out Total bytes transmitted.
1777 * @param multicast_packets_in Multicast packets received.
1778 * @param multicast_packets_out Multicast packets transmitted.
1779 * @param unicast_packets_in Unicast packets received.
1780 * @param unicast_packets_out Unicast packets transmitted.
1781 *****************************************************************************/
1782 void evel_measurement_vnic_use_add(EVENT_MEASUREMENT * const measurement,
1783 char * const vnic_id,
1784 const int packets_in,
1785 const int packets_out,
1786 const int broadcast_packets_in,
1787 const int broadcast_packets_out,
1789 const int bytes_out,
1790 const int multicast_packets_in,
1791 const int multicast_packets_out,
1792 const int unicast_packets_in,
1793 const int unicast_packets_out);
1795 /*****************************************************************************/
1796 /*****************************************************************************/
1800 /*****************************************************************************/
1801 /*****************************************************************************/
1803 /**************************************************************************//**
1804 * Create a new Report event.
1806 * @note The mandatory fields on the Report must be supplied to this
1807 * factory function and are immutable once set. Optional fields have
1808 * explicit setter functions, but again values may only be set once so
1809 * that the Report has immutable properties.
1811 * @param measurement_interval
1813 * @returns pointer to the newly manufactured ::EVENT_REPORT. If the event is
1814 * not used (i.e. posted) it must be released using
1815 * ::evel_free_report.
1816 * @retval NULL Failed to create the event.
1817 *****************************************************************************/
1818 EVENT_REPORT * evel_new_report(double measurement_interval);
1820 /**************************************************************************//**
1823 * Free off the Report supplied. Will free all the contained allocated memory.
1825 * @note It does not free the Report itself, since that may be part of a
1827 *****************************************************************************/
1828 void evel_free_report(EVENT_REPORT * event);
1830 /**************************************************************************//**
1831 * Set the Event Type property of the Report.
1833 * @note The property is treated as immutable: it is only valid to call
1834 * the setter once. However, we don't assert if the caller tries to
1835 * overwrite, just ignoring the update instead.
1837 * @param report Pointer to the Report.
1838 * @param type The Event Type to be set. ASCIIZ string. The caller
1839 * does not need to preserve the value once the function
1841 *****************************************************************************/
1842 void evel_report_type_set(EVENT_REPORT * report, const char * const type);
1844 /**************************************************************************//**
1845 * Add a Feature usage value name/value pair to the Report.
1847 * The name is null delimited ASCII string. The library takes
1848 * a copy so the caller does not have to preserve values after the function
1851 * @param report Pointer to the report.
1852 * @param feature ASCIIZ string with the feature's name.
1853 * @param utilization Utilization of the feature.
1854 *****************************************************************************/
1855 void evel_report_feature_use_add(EVENT_REPORT * report,
1859 /**************************************************************************//**
1860 * Add a Additional Measurement value name/value pair to the Report.
1862 * The name is null delimited ASCII string. The library takes
1863 * a copy so the caller does not have to preserve values after the function
1866 * @param report Pointer to the report.
1867 * @param group ASCIIZ string with the measurement group's name.
1868 * @param name ASCIIZ string containing the measurement's name.
1869 * @param value ASCIIZ string containing the measurement's value.
1870 *****************************************************************************/
1871 void evel_report_custom_measurement_add(EVENT_REPORT * report,
1872 const char * const group,
1873 const char * const name,
1874 const char * const value);
1876 /*****************************************************************************/
1877 /*****************************************************************************/
1881 /*****************************************************************************/
1882 /*****************************************************************************/
1884 /**************************************************************************//**
1885 * Create a new Mobile Flow event.
1887 * @note The mandatory fields on the Mobile Flow must be supplied to this
1888 * factory function and are immutable once set. Optional fields have
1889 * explicit setter functions, but again values may only be set once so
1890 * that the Mobile Flow has immutable properties.
1892 * @param flow_direction
1893 * @param gtp_per_flow_metrics
1894 * @param ip_protocol_type
1896 * @param other_endpoint_ip_address
1897 * @param other_endpoint_port
1898 * @param reporting_endpoint_ip_addr
1899 * @param reporting_endpoint_port
1901 * @returns pointer to the newly manufactured ::EVENT_MOBILE_FLOW. If the
1902 * event is not used (i.e. posted) it must be released using
1903 * ::evel_free_mobile_flow.
1904 * @retval NULL Failed to create the event.
1905 *****************************************************************************/
1906 EVENT_MOBILE_FLOW * evel_new_mobile_flow(
1907 const char * const flow_direction,
1908 MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics,
1909 const char * const ip_protocol_type,
1910 const char * const ip_version,
1911 const char * const other_endpoint_ip_address,
1912 int other_endpoint_port,
1913 const char * const reporting_endpoint_ip_addr,
1914 int reporting_endpoint_port);
1916 /**************************************************************************//**
1917 * Free a Mobile Flow.
1919 * Free off the Mobile Flow supplied. Will free all the contained allocated
1922 * @note It does not free the Mobile Flow itself, since that may be part of a
1924 *****************************************************************************/
1925 void evel_free_mobile_flow(EVENT_MOBILE_FLOW * event);
1927 /**************************************************************************//**
1928 * Set the Event Type property of the Mobile Flow.
1930 * @note The property is treated as immutable: it is only valid to call
1931 * the setter once. However, we don't assert if the caller tries to
1932 * overwrite, just ignoring the update instead.
1934 * @param mobile_flow Pointer to the Mobile Flow.
1935 * @param type The Event Type to be set. ASCIIZ string. The caller
1936 * does not need to preserve the value once the function
1938 *****************************************************************************/
1939 void evel_mobile_flow_type_set(EVENT_MOBILE_FLOW * mobile_flow,
1940 const char * const type);
1942 /**************************************************************************//**
1943 * Set the Application Type property of the Mobile Flow.
1945 * @note The property is treated as immutable: it is only valid to call
1946 * the setter once. However, we don't assert if the caller tries to
1947 * overwrite, just ignoring the update instead.
1949 * @param mobile_flow Pointer to the Mobile Flow.
1950 * @param type The Application Type to be set. ASCIIZ string. The caller
1951 * does not need to preserve the value once the function
1953 *****************************************************************************/
1954 void evel_mobile_flow_app_type_set(EVENT_MOBILE_FLOW * mobile_flow,
1955 const char * const type);
1957 /**************************************************************************//**
1958 * Set the Application Protocol Type property of the Mobile Flow.
1960 * @note The property is treated as immutable: it is only valid to call
1961 * the setter once. However, we don't assert if the caller tries to
1962 * overwrite, just ignoring the update instead.
1964 * @param mobile_flow Pointer to the Mobile Flow.
1965 * @param type The Application Protocol Type to be set. ASCIIZ string.
1966 * The caller does not need to preserve the value once the
1968 *****************************************************************************/
1969 void evel_mobile_flow_app_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
1970 const char * const type);
1972 /**************************************************************************//**
1973 * Set the Application Protocol Version property of the Mobile Flow.
1975 * @note The property is treated as immutable: it is only valid to call
1976 * the setter once. However, we don't assert if the caller tries to
1977 * overwrite, just ignoring the update instead.
1979 * @param mobile_flow Pointer to the Mobile Flow.
1980 * @param version The Application Protocol Version to be set. ASCIIZ
1981 * string. The caller does not need to preserve the value
1982 * once the function returns.
1983 *****************************************************************************/
1984 void evel_mobile_flow_app_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
1985 const char * const version);
1987 /**************************************************************************//**
1988 * Set the CID property of the Mobile Flow.
1990 * @note The property is treated as immutable: it is only valid to call
1991 * the setter once. However, we don't assert if the caller tries to
1992 * overwrite, just ignoring the update instead.
1994 * @param mobile_flow Pointer to the Mobile Flow.
1995 * @param cid The CID to be set. ASCIIZ string. The caller does not
1996 * need to preserve the value once the function returns.
1997 *****************************************************************************/
1998 void evel_mobile_flow_cid_set(EVENT_MOBILE_FLOW * mobile_flow,
1999 const char * const cid);
2001 /**************************************************************************//**
2002 * Set the Connection Type property of the Mobile Flow.
2004 * @note The property is treated as immutable: it is only valid to call
2005 * the setter once. However, we don't assert if the caller tries to
2006 * overwrite, just ignoring the update instead.
2008 * @param mobile_flow Pointer to the Mobile Flow.
2009 * @param type The Connection Type to be set. ASCIIZ string. The caller
2010 * does not need to preserve the value once the function
2012 *****************************************************************************/
2013 void evel_mobile_flow_con_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2014 const char * const type);
2016 /**************************************************************************//**
2017 * Set the ECGI property of the Mobile Flow.
2019 * @note The property is treated as immutable: it is only valid to call
2020 * the setter once. However, we don't assert if the caller tries to
2021 * overwrite, just ignoring the update instead.
2023 * @param mobile_flow Pointer to the Mobile Flow.
2024 * @param ecgi The ECGI to be set. ASCIIZ string. The caller does not
2025 * need to preserve the value once the function returns.
2026 *****************************************************************************/
2027 void evel_mobile_flow_ecgi_set(EVENT_MOBILE_FLOW * mobile_flow,
2028 const char * const ecgi);
2030 /**************************************************************************//**
2031 * Set the GTP Protocol Type property of the Mobile Flow.
2033 * @note The property is treated as immutable: it is only valid to call
2034 * the setter once. However, we don't assert if the caller tries to
2035 * overwrite, just ignoring the update instead.
2037 * @param mobile_flow Pointer to the Mobile Flow.
2038 * @param type The GTP Protocol Type to be set. ASCIIZ string. The
2039 * caller does not need to preserve the value once the
2041 *****************************************************************************/
2042 void evel_mobile_flow_gtp_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2043 const char * const type);
2045 /**************************************************************************//**
2046 * Set the GTP Protocol Version property of the Mobile Flow.
2048 * @note The property is treated as immutable: it is only valid to call
2049 * the setter once. However, we don't assert if the caller tries to
2050 * overwrite, just ignoring the update instead.
2052 * @param mobile_flow Pointer to the Mobile Flow.
2053 * @param version The GTP Protocol Version to be set. ASCIIZ string. The
2054 * caller does not need to preserve the value once the
2056 *****************************************************************************/
2057 void evel_mobile_flow_gtp_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2058 const char * const version);
2060 /**************************************************************************//**
2061 * Set the HTTP Header property of the Mobile Flow.
2063 * @note The property is treated as immutable: it is only valid to call
2064 * the setter once. However, we don't assert if the caller tries to
2065 * overwrite, just ignoring the update instead.
2067 * @param mobile_flow Pointer to the Mobile Flow.
2068 * @param header The HTTP header to be set. ASCIIZ string. The caller does
2069 * not need to preserve the value once the function returns.
2070 *****************************************************************************/
2071 void evel_mobile_flow_http_header_set(EVENT_MOBILE_FLOW * mobile_flow,
2072 const char * const header);
2074 /**************************************************************************//**
2075 * Set the IMEI property of the Mobile Flow.
2077 * @note The property is treated as immutable: it is only valid to call
2078 * the setter once. However, we don't assert if the caller tries to
2079 * overwrite, just ignoring the update instead.
2081 * @param mobile_flow Pointer to the Mobile Flow.
2082 * @param imei The IMEI to be set. ASCIIZ string. The caller does not
2083 * need to preserve the value once the function returns.
2084 *****************************************************************************/
2085 void evel_mobile_flow_imei_set(EVENT_MOBILE_FLOW * mobile_flow,
2086 const char * const imei);
2088 /**************************************************************************//**
2089 * Set the IMSI property of the Mobile Flow.
2091 * @note The property is treated as immutable: it is only valid to call
2092 * the setter once. However, we don't assert if the caller tries to
2093 * overwrite, just ignoring the update instead.
2095 * @param mobile_flow Pointer to the Mobile Flow.
2096 * @param imsi The IMSI to be set. ASCIIZ string. The caller does not
2097 * need to preserve the value once the function returns.
2098 *****************************************************************************/
2099 void evel_mobile_flow_imsi_set(EVENT_MOBILE_FLOW * mobile_flow,
2100 const char * const imsi);
2102 /**************************************************************************//**
2103 * Set the LAC property of the Mobile Flow.
2105 * @note The property is treated as immutable: it is only valid to call
2106 * the setter once. However, we don't assert if the caller tries to
2107 * overwrite, just ignoring the update instead.
2109 * @param mobile_flow Pointer to the Mobile Flow.
2110 * @param lac The LAC to be set. ASCIIZ string. The caller does not
2111 * need to preserve the value once the function returns.
2112 *****************************************************************************/
2113 void evel_mobile_flow_lac_set(EVENT_MOBILE_FLOW * mobile_flow,
2114 const char * const lac);
2116 /**************************************************************************//**
2117 * Set the MCC property of the Mobile Flow.
2119 * @note The property is treated as immutable: it is only valid to call
2120 * the setter once. However, we don't assert if the caller tries to
2121 * overwrite, just ignoring the update instead.
2123 * @param mobile_flow Pointer to the Mobile Flow.
2124 * @param mcc The MCC to be set. ASCIIZ string. The caller does not
2125 * need to preserve the value once the function returns.
2126 *****************************************************************************/
2127 void evel_mobile_flow_mcc_set(EVENT_MOBILE_FLOW * mobile_flow,
2128 const char * const mcc);
2130 /**************************************************************************//**
2131 * Set the MNC property of the Mobile Flow.
2133 * @note The property is treated as immutable: it is only valid to call
2134 * the setter once. However, we don't assert if the caller tries to
2135 * overwrite, just ignoring the update instead.
2137 * @param mobile_flow Pointer to the Mobile Flow.
2138 * @param mnc The MNC to be set. ASCIIZ string. The caller does not
2139 * need to preserve the value once the function returns.
2140 *****************************************************************************/
2141 void evel_mobile_flow_mnc_set(EVENT_MOBILE_FLOW * mobile_flow,
2142 const char * const mnc);
2144 /**************************************************************************//**
2145 * Set the MSISDN property of the Mobile Flow.
2147 * @note The property is treated as immutable: it is only valid to call
2148 * the setter once. However, we don't assert if the caller tries to
2149 * overwrite, just ignoring the update instead.
2151 * @param mobile_flow Pointer to the Mobile Flow.
2152 * @param msisdn The MSISDN to be set. ASCIIZ string. The caller does not
2153 * need to preserve the value once the function returns.
2154 *****************************************************************************/
2155 void evel_mobile_flow_msisdn_set(EVENT_MOBILE_FLOW * mobile_flow,
2156 const char * const msisdn);
2158 /**************************************************************************//**
2159 * Set the Other Functional Role property of the Mobile Flow.
2161 * @note The property is treated as immutable: it is only valid to call
2162 * the setter once. However, we don't assert if the caller tries to
2163 * overwrite, just ignoring the update instead.
2165 * @param mobile_flow Pointer to the Mobile Flow.
2166 * @param role The Other Functional Role to be set. ASCIIZ string. The
2167 * caller does not need to preserve the value once the
2169 *****************************************************************************/
2170 void evel_mobile_flow_other_func_role_set(EVENT_MOBILE_FLOW * mobile_flow,
2171 const char * const role);
2173 /**************************************************************************//**
2174 * Set the RAC property of the Mobile Flow.
2176 * @note The property is treated as immutable: it is only valid to call
2177 * the setter once. However, we don't assert if the caller tries to
2178 * overwrite, just ignoring the update instead.
2180 * @param mobile_flow Pointer to the Mobile Flow.
2181 * @param rac The RAC to be set. ASCIIZ string. The caller does not
2182 * need to preserve the value once the function returns.
2183 *****************************************************************************/
2184 void evel_mobile_flow_rac_set(EVENT_MOBILE_FLOW * mobile_flow,
2185 const char * const rac);
2187 /**************************************************************************//**
2188 * Set the Radio Access Technology property of the Mobile Flow.
2190 * @note The property is treated as immutable: it is only valid to call
2191 * the setter once. However, we don't assert if the caller tries to
2192 * overwrite, just ignoring the update instead.
2194 * @param mobile_flow Pointer to the Mobile Flow.
2195 * @param tech The Radio Access Technology to be set. ASCIIZ string. The
2196 * caller does not need to preserve the value once the
2198 *****************************************************************************/
2199 void evel_mobile_flow_radio_acc_tech_set(EVENT_MOBILE_FLOW * mobile_flow,
2200 const char * const tech);
2202 /**************************************************************************//**
2203 * Set the SAC property of the Mobile Flow.
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 mobile_flow Pointer to the Mobile Flow.
2210 * @param sac The SAC to be set. ASCIIZ string. The caller does not
2211 * need to preserve the value once the function returns.
2212 *****************************************************************************/
2213 void evel_mobile_flow_sac_set(EVENT_MOBILE_FLOW * mobile_flow,
2214 const char * const sac);
2216 /**************************************************************************//**
2217 * Set the Sampling Algorithm property of the Mobile Flow.
2219 * @note The property is treated as immutable: it is only valid to call
2220 * the setter once. However, we don't assert if the caller tries to
2221 * overwrite, just ignoring the update instead.
2223 * @param mobile_flow Pointer to the Mobile Flow.
2224 * @param algorithm The Sampling Algorithm to be set.
2225 *****************************************************************************/
2226 void evel_mobile_flow_samp_alg_set(EVENT_MOBILE_FLOW * mobile_flow,
2229 /**************************************************************************//**
2230 * Set the TAC property of the Mobile Flow.
2232 * @note The property is treated as immutable: it is only valid to call
2233 * the setter once. However, we don't assert if the caller tries to
2234 * overwrite, just ignoring the update instead.
2236 * @param mobile_flow Pointer to the Mobile Flow.
2237 * @param tac The TAC to be set. ASCIIZ string. The caller does not
2238 * need to preserve the value once the function returns.
2239 *****************************************************************************/
2240 void evel_mobile_flow_tac_set(EVENT_MOBILE_FLOW * mobile_flow,
2241 const char * const tac);
2243 /**************************************************************************//**
2244 * Set the Tunnel ID property of the Mobile Flow.
2246 * @note The property is treated as immutable: it is only valid to call
2247 * the setter once. However, we don't assert if the caller tries to
2248 * overwrite, just ignoring the update instead.
2250 * @param mobile_flow Pointer to the Mobile Flow.
2251 * @param tunnel_id The Tunnel ID to be set. ASCIIZ string. The caller does
2252 * not need to preserve the value once the function returns.
2253 *****************************************************************************/
2254 void evel_mobile_flow_tunnel_id_set(EVENT_MOBILE_FLOW * mobile_flow,
2255 const char * const tunnel_id);
2257 /**************************************************************************//**
2258 * Set the VLAN ID property of the Mobile Flow.
2260 * @note The property is treated as immutable: it is only valid to call
2261 * the setter once. However, we don't assert if the caller tries to
2262 * overwrite, just ignoring the update instead.
2264 * @param mobile_flow Pointer to the Mobile Flow.
2265 * @param vlan_id The VLAN ID to be set. ASCIIZ string. The caller does
2266 * not need to preserve the value once the function returns.
2267 *****************************************************************************/
2268 void evel_mobile_flow_vlan_id_set(EVENT_MOBILE_FLOW * mobile_flow,
2269 const char * const vlan_id);
2271 /**************************************************************************//**
2272 * Create a new Mobile GTP Per Flow Metrics.
2274 * @note The mandatory fields on the Mobile GTP Per Flow Metrics must be
2275 * supplied to this factory function and are immutable once set.
2276 * Optional fields have explicit setter functions, but again values
2277 * may only be set once so that the Mobile GTP Per Flow Metrics has
2278 * immutable properties.
2280 * @param avg_bit_error_rate
2281 * @param avg_packet_delay_variation
2282 * @param avg_packet_latency
2283 * @param avg_receive_throughput
2284 * @param avg_transmit_throughput
2285 * @param flow_activation_epoch
2286 * @param flow_activation_microsec
2287 * @param flow_deactivation_epoch
2288 * @param flow_deactivation_microsec
2289 * @param flow_deactivation_time
2290 * @param flow_status
2291 * @param max_packet_delay_variation
2292 * @param num_activation_failures
2293 * @param num_bit_errors
2294 * @param num_bytes_received
2295 * @param num_bytes_transmitted
2296 * @param num_dropped_packets
2297 * @param num_l7_bytes_received
2298 * @param num_l7_bytes_transmitted
2299 * @param num_lost_packets
2300 * @param num_out_of_order_packets
2301 * @param num_packet_errors
2302 * @param num_packets_received_excl_retrans
2303 * @param num_packets_received_incl_retrans
2304 * @param num_packets_transmitted_incl_retrans
2305 * @param num_retries
2306 * @param num_timeouts
2307 * @param num_tunneled_l7_bytes_received
2308 * @param round_trip_time
2309 * @param time_to_first_byte
2311 * @returns pointer to the newly manufactured ::MOBILE_GTP_PER_FLOW_METRICS.
2312 * If the structure is not used it must be released using
2313 * ::evel_free_mobile_gtp_flow_metrics.
2314 * @retval NULL Failed to create the event.
2315 *****************************************************************************/
2316 MOBILE_GTP_PER_FLOW_METRICS * evel_new_mobile_gtp_flow_metrics(
2317 double avg_bit_error_rate,
2318 double avg_packet_delay_variation,
2319 int avg_packet_latency,
2320 int avg_receive_throughput,
2321 int avg_transmit_throughput,
2322 int flow_activation_epoch,
2323 int flow_activation_microsec,
2324 int flow_deactivation_epoch,
2325 int flow_deactivation_microsec,
2326 time_t flow_deactivation_time,
2327 const char * const flow_status,
2328 int max_packet_delay_variation,
2329 int num_activation_failures,
2331 int num_bytes_received,
2332 int num_bytes_transmitted,
2333 int num_dropped_packets,
2334 int num_l7_bytes_received,
2335 int num_l7_bytes_transmitted,
2336 int num_lost_packets,
2337 int num_out_of_order_packets,
2338 int num_packet_errors,
2339 int num_packets_received_excl_retrans,
2340 int num_packets_received_incl_retrans,
2341 int num_packets_transmitted_incl_retrans,
2344 int num_tunneled_l7_bytes_received,
2345 int round_trip_time,
2346 int time_to_first_byte);
2348 /**************************************************************************//**
2349 * Free a Mobile GTP Per Flow Metrics.
2351 * Free off the Mobile GTP Per Flow Metrics supplied. Will free all the
2352 * contained allocated memory.
2354 * @note It does not free the Mobile GTP Per Flow Metrics itself, since that
2355 * may be part of a larger structure.
2356 *****************************************************************************/
2357 void evel_free_mobile_gtp_flow_metrics(MOBILE_GTP_PER_FLOW_METRICS * metrics);
2359 /**************************************************************************//**
2360 * Set the Duration of Connection Failed Status property of the Mobile GTP Per
2363 * @note The property is treated as immutable: it is only valid to call
2364 * the setter once. However, we don't assert if the caller tries to
2365 * overwrite, just ignoring the update instead.
2367 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2368 * @param duration The Duration of Connection Failed Status to be set.
2369 *****************************************************************************/
2370 void evel_mobile_gtp_metrics_dur_con_fail_set(
2371 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2374 /**************************************************************************//**
2375 * Set the Duration of Tunnel Failed Status property of the Mobile GTP Per Flow
2378 * @note The property is treated as immutable: it is only valid to call
2379 * the setter once. However, we don't assert if the caller tries to
2380 * overwrite, just ignoring the update instead.
2382 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2383 * @param duration The Duration of Tunnel Failed Status to be set.
2384 *****************************************************************************/
2385 void evel_mobile_gtp_metrics_dur_tun_fail_set(
2386 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2389 /**************************************************************************//**
2390 * Set the Activated By property of the Mobile GTP Per Flow metrics.
2392 * @note The property is treated as immutable: it is only valid to call
2393 * the setter once. However, we don't assert if the caller tries to
2394 * overwrite, just ignoring the update instead.
2396 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2397 * @param act_by The Activated By to be set. ASCIIZ string. The caller
2398 * does not need to preserve the value once the function
2400 *****************************************************************************/
2401 void evel_mobile_gtp_metrics_act_by_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
2402 const char * const act_by);
2404 /**************************************************************************//**
2405 * Set the Activation Time property of the Mobile GTP Per Flow metrics.
2407 * @note The property is treated as immutable: it is only valid to call
2408 * the setter once. However, we don't assert if the caller tries to
2409 * overwrite, just ignoring the update instead.
2411 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2412 * @param act_time The Activation Time to be set. ASCIIZ string. The caller
2413 * does not need to preserve the value once the function
2415 *****************************************************************************/
2416 void evel_mobile_gtp_metrics_act_time_set(
2417 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2420 /**************************************************************************//**
2421 * Set the Deactivated By property of the Mobile GTP Per Flow metrics.
2423 * @note The property is treated as immutable: it is only valid to call
2424 * the setter once. However, we don't assert if the caller tries to
2425 * overwrite, just ignoring the update instead.
2427 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2428 * @param deact_by The Deactivated By to be set. ASCIIZ string. The caller
2429 * does not need to preserve the value once the function
2431 *****************************************************************************/
2432 void evel_mobile_gtp_metrics_deact_by_set(
2433 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2434 const char * const deact_by);
2436 /**************************************************************************//**
2437 * Set the GTP Connection Status property of the Mobile GTP Per Flow metrics.
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 metrics Pointer to the Mobile GTP Per Flow Metrics.
2444 * @param status The GTP Connection Status to be set. ASCIIZ string. The
2445 * caller does not need to preserve the value once the
2447 *****************************************************************************/
2448 void evel_mobile_gtp_metrics_con_status_set(
2449 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2450 const char * const status);
2452 /**************************************************************************//**
2453 * Set the GTP Tunnel Status property of the Mobile GTP Per Flow metrics.
2455 * @note The property is treated as immutable: it is only valid to call
2456 * the setter once. However, we don't assert if the caller tries to
2457 * overwrite, just ignoring the update instead.
2459 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2460 * @param status The GTP Tunnel Status to be set. ASCIIZ string. The
2461 * caller does not need to preserve the value once the
2463 *****************************************************************************/
2464 void evel_mobile_gtp_metrics_tun_status_set(
2465 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2466 const char * const status);
2468 /**************************************************************************//**
2469 * Set an IP Type-of-Service count property of the Mobile GTP Per Flow metrics.
2471 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2472 * @param index The index of the IP Type-of-Service.
2473 * @param count The count.
2474 *****************************************************************************/
2475 void evel_mobile_gtp_metrics_iptos_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
2479 /**************************************************************************//**
2480 * Set the Large Packet Round-Trip Time property of the Mobile GTP Per Flow
2483 * @note The property is treated as immutable: it is only valid to call
2484 * the setter once. However, we don't assert if the caller tries to
2485 * overwrite, just ignoring the update instead.
2487 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2488 * @param rtt The Large Packet Round-Trip Time to be set.
2489 *****************************************************************************/
2490 void evel_mobile_gtp_metrics_large_pkt_rtt_set(
2491 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2494 /**************************************************************************//**
2495 * Set the Large Packet Threshold property of the Mobile GTP Per Flow Metrics.
2497 * @note The property is treated as immutable: it is only valid to call
2498 * the setter once. However, we don't assert if the caller tries to
2499 * overwrite, just ignoring the update instead.
2501 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2502 * @param threshold The Large Packet Threshold to be set.
2503 *****************************************************************************/
2504 void evel_mobile_gtp_metrics_large_pkt_thresh_set(
2505 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2508 /**************************************************************************//**
2509 * Set the Max Receive Bit Rate property of the Mobile GTP Per Flow Metrics.
2511 * @note The property is treated as immutable: it is only valid to call
2512 * the setter once. However, we don't assert if the caller tries to
2513 * overwrite, just ignoring the update instead.
2515 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2516 * @param rate The Max Receive Bit Rate to be set.
2517 *****************************************************************************/
2518 void evel_mobile_gtp_metrics_max_rcv_bit_rate_set(
2519 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2522 /**************************************************************************//**
2523 * Set the Max Transmit Bit Rate property of the Mobile GTP Per Flow Metrics.
2525 * @note The property is treated as immutable: it is only valid to call
2526 * the setter once. However, we don't assert if the caller tries to
2527 * overwrite, just ignoring the update instead.
2529 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2530 * @param rate The Max Transmit Bit Rate to be set.
2531 *****************************************************************************/
2532 void evel_mobile_gtp_metrics_max_trx_bit_rate_set(
2533 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2536 /**************************************************************************//**
2537 * Set the Number of GTP Echo Failures property of the Mobile GTP Per Flow
2540 * @note The property is treated as immutable: it is only valid to call
2541 * the setter once. However, we don't assert if the caller tries to
2542 * overwrite, just ignoring the update instead.
2544 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2545 * @param num The Number of GTP Echo Failures to be set.
2546 *****************************************************************************/
2547 void evel_mobile_gtp_metrics_num_echo_fail_set(
2548 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2551 /**************************************************************************//**
2552 * Set the Number of GTP Tunnel Errors property of the Mobile GTP Per Flow
2555 * @note The property is treated as immutable: it is only valid to call
2556 * the setter once. However, we don't assert if the caller tries to
2557 * overwrite, just ignoring the update instead.
2559 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2560 * @param num The Number of GTP Tunnel Errors to be set.
2561 *****************************************************************************/
2562 void evel_mobile_gtp_metrics_num_tun_fail_set(
2563 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2566 /**************************************************************************//**
2567 * Set the Number of HTTP Errors property of the Mobile GTP Per Flow Metrics.
2569 * @note The property is treated as immutable: it is only valid to call
2570 * the setter once. However, we don't assert if the caller tries to
2571 * overwrite, just ignoring the update instead.
2573 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2574 * @param num The Number of HTTP Errors to be set.
2575 *****************************************************************************/
2576 void evel_mobile_gtp_metrics_num_http_errors_set(
2577 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2580 /**************************************************************************//**
2581 * Add a TCP flag count to the metrics.
2583 * @note The property is treated as immutable: it is only valid to call
2584 * the setter once. However, we don't assert if the caller tries to
2585 * overwrite, just ignoring the update instead.
2587 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2588 * @param tcp_flag The TCP flag count to be updated.
2589 * @param count The associated flag count.
2590 *****************************************************************************/
2591 void evel_mobile_gtp_metrics_tcp_flag_count_add(
2592 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2593 const EVEL_TCP_FLAGS tcp_flag,
2596 /**************************************************************************//**
2597 * Add a QCI COS count to the metrics.
2599 * @note The property is treated as immutable: it is only valid to call
2600 * the setter once. However, we don't assert if the caller tries to
2601 * overwrite, just ignoring the update instead.
2603 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2604 * @param qci_cos The QCI COS count to be updated.
2605 * @param count The associated QCI COS count.
2606 *****************************************************************************/
2607 void evel_mobile_gtp_metrics_qci_cos_count_add(
2608 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2609 const EVEL_QCI_COS_TYPES qci_cos,
2612 /*****************************************************************************/
2613 /*****************************************************************************/
2615 /* SERVICE EVENTS */
2617 /*****************************************************************************/
2618 /*****************************************************************************/
2620 /**************************************************************************//**
2621 * Create a new Service event.
2623 * @note The mandatory fields on the Service must be supplied to
2624 * this factory function and are immutable once set. Optional fields
2625 * have explicit setter functions, but again values may only be set
2626 * once so that the event has immutable properties.
2627 * @param vendor_id The vendor id to encode in the event instance id.
2628 * @param event_id The vendor event id to encode in the event instance id.
2629 * @returns pointer to the newly manufactured ::EVENT_SERVICE. If the event
2630 * is not used (i.e. posted) it must be released using
2631 * ::evel_free_service.
2632 * @retval NULL Failed to create the event.
2633 *****************************************************************************/
2634 EVENT_SERVICE * evel_new_service(const char * const vendor_id,
2635 const char * const event_id);
2637 /**************************************************************************//**
2638 * Free a Service Events event.
2640 * Free off the event supplied. Will free all the contained allocated memory.
2642 * @note It does not free the event itself, since that may be part of a larger
2644 *****************************************************************************/
2645 void evel_free_service(EVENT_SERVICE * const event);
2647 /**************************************************************************//**
2648 * Set the Event Type property of the Service event.
2650 * @note The property is treated as immutable: it is only valid to call
2651 * the setter once. However, we don't assert if the caller tries to
2652 * overwrite, just ignoring the update instead.
2654 * @param event Pointer to the Service event.
2655 * @param type The Event Type to be set. ASCIIZ string. The caller
2656 * does not need to preserve the value once the function
2658 *****************************************************************************/
2659 void evel_service_type_set(EVENT_SERVICE * const event,
2660 const char * const type);
2662 /**************************************************************************//**
2663 * Set the Product Id property of the Service event.
2665 * @note The property is treated as immutable: it is only valid to call
2666 * the setter once. However, we don't assert if the caller tries to
2667 * overwrite, just ignoring the update instead.
2669 * @param event Pointer to the Service event.
2670 * @param product_id The vendor product id to be set. ASCIIZ string. The
2671 * caller does not need to preserve the value once the
2673 *****************************************************************************/
2674 void evel_service_product_id_set(EVENT_SERVICE * const event,
2675 const char * const product_id);
2677 /**************************************************************************//**
2678 * Set the Subsystem Id property of the Service event.
2680 * @note The property is treated as immutable: it is only valid to call
2681 * the setter once. However, we don't assert if the caller tries to
2682 * overwrite, just ignoring the update instead.
2684 * @param event Pointer to the Service event.
2685 * @param subsystem_id The vendor subsystem id to be set. ASCIIZ string. The
2686 * caller does not need to preserve the value once the
2688 *****************************************************************************/
2689 void evel_service_subsystem_id_set(EVENT_SERVICE * const event,
2690 const char * const subsystem_id);
2692 /**************************************************************************//**
2693 * Set the Friendly Name property of the Service event.
2695 * @note The property is treated as immutable: it is only valid to call
2696 * the setter once. However, we don't assert if the caller tries to
2697 * overwrite, just ignoring the update instead.
2699 * @param event Pointer to the Service event.
2700 * @param friendly_name The vendor friendly name to be set. ASCIIZ string. The
2701 * caller does not need to preserve the value once the
2703 *****************************************************************************/
2704 void evel_service_friendly_name_set(EVENT_SERVICE * const event,
2705 const char * const friendly_name);
2707 /**************************************************************************//**
2708 * Set the correlator property of the Service event.
2710 * @note The property is treated as immutable: it is only valid to call
2711 * the setter once. However, we don't assert if the caller tries to
2712 * overwrite, just ignoring the update instead.
2714 * @param event Pointer to the Service event.
2715 * @param correlator The correlator to be set. ASCIIZ string. The caller
2716 * does not need to preserve the value once the function
2718 *****************************************************************************/
2719 void evel_service_correlator_set(EVENT_SERVICE * const event,
2720 const char * const correlator);
2722 /**************************************************************************//**
2723 * Set the Codec property of the Service event.
2725 * @note The property is treated as immutable: it is only valid to call
2726 * the setter once. However, we don't assert if the caller tries to
2727 * overwrite, just ignoring the update instead.
2729 * @param event Pointer to the Service event.
2730 * @param codec The codec to be set. ASCIIZ string. The caller does not
2731 * need to preserve the value once the function returns.
2732 *****************************************************************************/
2733 void evel_service_codec_set(EVENT_SERVICE * const event,
2734 const char * const codec);
2736 /**************************************************************************//**
2737 * Set the Callee Side Codec property of the Service event.
2739 * @note The property is treated as immutable: it is only valid to call
2740 * the setter once. However, we don't assert if the caller tries to
2741 * overwrite, just ignoring the update instead.
2743 * @param event Pointer to the Service event.
2744 * @param codec The codec to be set. ASCIIZ string. The caller does not
2745 * need to preserve the value once the function returns.
2746 *****************************************************************************/
2747 void evel_service_callee_codec_set(EVENT_SERVICE * const event,
2748 const char * const codec);
2750 /**************************************************************************//**
2751 * Set the Caller Side Codec property of the Service event.
2753 * @note The property is treated as immutable: it is only valid to call
2754 * the setter once. However, we don't assert if the caller tries to
2755 * overwrite, just ignoring the update instead.
2757 * @param event Pointer to the Service event.
2758 * @param codec The codec to be set. ASCIIZ string. The caller does not
2759 * need to preserve the value once the function returns.
2760 *****************************************************************************/
2761 void evel_service_caller_codec_set(EVENT_SERVICE * const event,
2762 const char * const codec);
2764 /**************************************************************************//**
2765 * Set the RTCP Data property of the Service event.
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 event Pointer to the Service event.
2772 * @param rtcp_data The RTCP Data to be set. ASCIIZ string. The caller
2773 * does not need to preserve the value once the function
2775 *****************************************************************************/
2776 void evel_service_rtcp_data_set(EVENT_SERVICE * const event,
2777 const char * const rtcp_data);
2779 /**************************************************************************//**
2780 * Set the Adjacency Name property of the Service event.
2782 * @note The property is treated as immutable: it is only valid to call
2783 * the setter once. However, we don't assert if the caller tries to
2784 * overwrite, just ignoring the update instead.
2786 * @param event Pointer to the Service event.
2787 * @param adjacency_name
2788 * The adjacency name to be set. ASCIIZ string. The caller
2789 * does not need to preserve the value once the function
2791 *****************************************************************************/
2792 void evel_service_adjacency_name_set(EVENT_SERVICE * const event,
2793 const char * const adjacency_name);
2795 /**************************************************************************//**
2796 * Set the Endpoint Descriptor property of the Service event.
2798 * @note The property is treated as immutable: it is only valid to call
2799 * the setter once. However, we don't assert if the caller tries to
2800 * overwrite, just ignoring the update instead.
2802 * @param event Pointer to the Service event.
2803 * @param endpoint_desc The endpoint descriptor to be set.
2804 *****************************************************************************/
2805 void evel_service_endpoint_desc_set(
2806 EVENT_SERVICE * const event,
2807 const EVEL_SERVICE_ENDPOINT_DESC endpoint_desc);
2809 /**************************************************************************//**
2810 * Set the Endpoint Jitter property of the Service event.
2812 * @note The property is treated as immutable: it is only valid to call
2813 * the setter once. However, we don't assert if the caller tries to
2814 * overwrite, just ignoring the update instead.
2816 * @param event Pointer to the Service event.
2817 * @param jitter The jitter to be set.
2818 *****************************************************************************/
2819 void evel_service_endpoint_jitter_set(EVENT_SERVICE * const event,
2822 /**************************************************************************//**
2823 * Set the Endpoint Rtp Octets Discarded property of the Service event.
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 event Pointer to the Service event.
2830 * @param rtp_oct_disc The discard count.
2831 *****************************************************************************/
2832 void evel_service_endpoint_rtp_oct_disc_set(EVENT_SERVICE * const event,
2833 const int rtp_oct_disc);
2835 /**************************************************************************//**
2836 * Set the Endpoint Rtp Octets Received property of the Service event.
2838 * @note The property is treated as immutable: it is only valid to call
2839 * the setter once. However, we don't assert if the caller tries to
2840 * overwrite, just ignoring the update instead.
2842 * @param event Pointer to the Service event.
2843 * @param rtp_oct_recv The receive count.
2844 *****************************************************************************/
2845 void evel_service_endpoint_rtp_oct_recv_set(EVENT_SERVICE * const event,
2846 const int rtp_oct_recv);
2848 /**************************************************************************//**
2849 * Set the Endpoint Rtp Octets Sent property of the Service event.
2851 * @note The property is treated as immutable: it is only valid to call
2852 * the setter once. However, we don't assert if the caller tries to
2853 * overwrite, just ignoring the update instead.
2855 * @param event Pointer to the Service event.
2856 * @param rtp_oct_sent The send count.
2857 *****************************************************************************/
2858 void evel_service_endpoint_rtp_oct_sent_set(EVENT_SERVICE * const event,
2859 const int rtp_oct_sent);
2861 /**************************************************************************//**
2862 * Set the Endpoint Rtp Packets Discarded property of the Service event.
2864 * @note The property is treated as immutable: it is only valid to call
2865 * the setter once. However, we don't assert if the caller tries to
2866 * overwrite, just ignoring the update instead.
2868 * @param event Pointer to the Service event.
2869 * @param rtp_pkt_disc The discard count.
2870 *****************************************************************************/
2871 void evel_service_endpoint_rtp_pkt_disc_set(EVENT_SERVICE * const event,
2872 const int rtp_pkt_disc);
2874 /**************************************************************************//**
2875 * Set the Endpoint Rtp Packets Received property of the Service event.
2877 * @note The property is treated as immutable: it is only valid to call
2878 * the setter once. However, we don't assert if the caller tries to
2879 * overwrite, just ignoring the update instead.
2881 * @param event Pointer to the Service event.
2882 * @param rtp_pkt_recv The receive count.
2883 *****************************************************************************/
2884 void evel_service_endpoint_rtp_pkt_recv_set(EVENT_SERVICE * const event,
2885 const int rtp_pkt_recv);
2887 /**************************************************************************//**
2888 * Set the Endpoint Rtp Packets Sent property of the Service event.
2890 * @note The property is treated as immutable: it is only valid to call
2891 * the setter once. However, we don't assert if the caller tries to
2892 * overwrite, just ignoring the update instead.
2894 * @param event Pointer to the Service event.
2895 * @param rtp_pkt_sent The send count.
2896 *****************************************************************************/
2897 void evel_service_endpoint_rtp_pkt_sent_set(EVENT_SERVICE * const event,
2898 const int rtp_pkt_sent);
2900 /**************************************************************************//**
2901 * Set the Local Jitter property of the Service event.
2903 * @note The property is treated as immutable: it is only valid to call
2904 * the setter once. However, we don't assert if the caller tries to
2905 * overwrite, just ignoring the update instead.
2907 * @param event Pointer to the Service event.
2908 * @param jitter The jitter to be set.
2909 *****************************************************************************/
2910 void evel_service_local_jitter_set(EVENT_SERVICE * const event,
2913 /**************************************************************************//**
2914 * Set the Local Rtp Octets Discarded property of the Service event.
2916 * @note The property is treated as immutable: it is only valid to call
2917 * the setter once. However, we don't assert if the caller tries to
2918 * overwrite, just ignoring the update instead.
2920 * @param event Pointer to the Service event.
2921 * @param rtp_oct_disc The discard count.
2922 *****************************************************************************/
2923 void evel_service_local_rtp_oct_disc_set(EVENT_SERVICE * const event,
2924 const int rtp_oct_disc);
2926 /**************************************************************************//**
2927 * Set the Local Rtp Octets Received property of the Service event.
2929 * @note The property is treated as immutable: it is only valid to call
2930 * the setter once. However, we don't assert if the caller tries to
2931 * overwrite, just ignoring the update instead.
2933 * @param event Pointer to the Service event.
2934 * @param rtp_oct_recv The receive count.
2935 *****************************************************************************/
2936 void evel_service_local_rtp_oct_recv_set(EVENT_SERVICE * const event,
2937 const int rtp_oct_recv);
2939 /**************************************************************************//**
2940 * Set the Local Rtp Octets Sent property of the Service event.
2942 * @note The property is treated as immutable: it is only valid to call
2943 * the setter once. However, we don't assert if the caller tries to
2944 * overwrite, just ignoring the update instead.
2946 * @param event Pointer to the Service event.
2947 * @param rtp_oct_sent The send count.
2948 *****************************************************************************/
2949 void evel_service_local_rtp_oct_sent_set(EVENT_SERVICE * const event,
2950 const int rtp_oct_sent);
2952 /**************************************************************************//**
2953 * Set the Local Rtp Packets Discarded property of the Service event.
2955 * @note The property is treated as immutable: it is only valid to call
2956 * the setter once. However, we don't assert if the caller tries to
2957 * overwrite, just ignoring the update instead.
2959 * @param event Pointer to the Service event.
2960 * @param rtp_pkt_disc The discard count.
2961 *****************************************************************************/
2962 void evel_service_local_rtp_pkt_disc_set(EVENT_SERVICE * const event,
2963 const int rtp_pkt_disc);
2965 /**************************************************************************//**
2966 * Set the Local Rtp Packets Received property of the Service event.
2968 * @note The property is treated as immutable: it is only valid to call
2969 * the setter once. However, we don't assert if the caller tries to
2970 * overwrite, just ignoring the update instead.
2972 * @param event Pointer to the Service event.
2973 * @param rtp_pkt_recv The receive count.
2974 *****************************************************************************/
2975 void evel_service_local_rtp_pkt_recv_set(EVENT_SERVICE * const event,
2976 const int rtp_pkt_recv);
2978 /**************************************************************************//**
2979 * Set the Local Rtp Packets Sent property of the Service event.
2981 * @note The property is treated as immutable: it is only valid to call
2982 * the setter once. However, we don't assert if the caller tries to
2983 * overwrite, just ignoring the update instead.
2985 * @param event Pointer to the Service event.
2986 * @param rtp_pkt_sent The send count.
2987 *****************************************************************************/
2988 void evel_service_local_rtp_pkt_sent_set(EVENT_SERVICE * const event,
2989 const int rtp_pkt_sent);
2991 /**************************************************************************//**
2992 * Set the Mos Cqe property of the Service event.
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 event Pointer to the Service event.
2999 * @param mos_cqe The mosCqe to be set.
3000 *****************************************************************************/
3001 void evel_service_mos_cqe_set(EVENT_SERVICE * const event,
3002 const double mos_cqe);
3004 /**************************************************************************//**
3005 * Set the Packets Lost property of the Service event.
3007 * @note The property is treated as immutable: it is only valid to call
3008 * the setter once. However, we don't assert if the caller tries to
3009 * overwrite, just ignoring the update instead.
3011 * @param event Pointer to the Service event.
3012 * @param packets_lost The number of packets lost to be set.
3013 *****************************************************************************/
3014 void evel_service_packets_lost_set(EVENT_SERVICE * const event,
3015 const int packets_lost);
3017 /**************************************************************************//**
3018 * Set the packet Loss Percent property of the Service event.
3020 * @note The property is treated as immutable: it is only valid to call
3021 * the setter once. However, we don't assert if the caller tries to
3022 * overwrite, just ignoring the update instead.
3024 * @param event Pointer to the Service event.
3025 * @param packet_loss_percent
3026 * The packet loss in percent.
3027 *****************************************************************************/
3028 void evel_service_packet_loss_percent_set(EVENT_SERVICE * const event,
3029 const double packet_loss_percent);
3031 /**************************************************************************//**
3032 * Set the R Factor property of the Service event.
3034 * @note The property is treated as immutable: it is only valid to call
3035 * the setter once. However, we don't assert if the caller tries to
3036 * overwrite, just ignoring the update instead.
3038 * @param event Pointer to the Service event.
3039 * @param r_factor The R Factor to be set.
3040 *****************************************************************************/
3041 void evel_service_r_factor_set(EVENT_SERVICE * const event,
3042 const int r_factor);
3044 /**************************************************************************//**
3045 * Set the Round Trip Delay property of the Service event.
3047 * @note The property is treated as immutable: it is only valid to call
3048 * the setter once. However, we don't assert if the caller tries to
3049 * overwrite, just ignoring the update instead.
3051 * @param event Pointer to the Service event.
3052 * @param round_trip_delay
3053 * The Round trip delay to be set.
3054 *****************************************************************************/
3055 void evel_service_round_trip_delay_set(EVENT_SERVICE * const event,
3056 const int round_trip_delay);
3058 /**************************************************************************//**
3059 * Set the Phone Number property of the Service event.
3061 * @note The property is treated as immutable: it is only valid to call
3062 * the setter once. However, we don't assert if the caller tries to
3063 * overwrite, just ignoring the update instead.
3065 * @param event Pointer to the Service event.
3066 * @param phone_number The Phone Number to be set. ASCIIZ string. The caller
3067 * does not need to preserve the value once the function
3069 *****************************************************************************/
3070 void evel_service_phone_number_set(EVENT_SERVICE * const event,
3071 const char * const phone_number);
3073 /**************************************************************************//**
3074 * Add a name/value pair to the Service, under the additionalFields array.
3076 * The name and value are null delimited ASCII strings. The library takes
3077 * a copy so the caller does not have to preserve values after the function
3080 * @param event Pointer to the Service event.
3081 * @param name ASCIIZ string with the field's name. The caller does not
3082 * need to preserve the value once the function returns.
3083 * @param value ASCIIZ string with the field's value. The caller does not
3084 * need to preserve the value once the function returns.
3085 *****************************************************************************/
3086 void evel_service_addl_field_add(EVENT_SERVICE * const event,
3087 const char * const name,
3088 const char * const value);
3090 /*****************************************************************************/
3091 /*****************************************************************************/
3095 /*****************************************************************************/
3096 /*****************************************************************************/
3098 /**************************************************************************//**
3099 * Create a new Signaling event.
3101 * @note The mandatory fields on the Signaling must be supplied to
3102 * this factory function and are immutable once set. Optional fields
3103 * have explicit setter functions, but again values may only be set
3104 * once so that the event has immutable properties.
3105 * @param vendor_id The vendor id to encode in the event instance id.
3106 * @param event_id The vendor event id to encode in the event instance id.
3107 * @returns pointer to the newly manufactured ::EVENT_SIGNALING. If the event
3108 * is not used (i.e. posted) it must be released using
3109 * ::evel_free_signaling.
3110 * @retval NULL Failed to create the event.
3111 *****************************************************************************/
3112 EVENT_SIGNALING * evel_new_signaling(const char * const vendor_id,
3113 const char * const event_id);
3115 /**************************************************************************//**
3116 * Free a Signaling event.
3118 * Free off the event supplied. Will free all the contained allocated memory.
3120 * @note It does not free the event itself, since that may be part of a larger
3122 *****************************************************************************/
3123 void evel_free_signaling(EVENT_SIGNALING * const event);
3125 /**************************************************************************//**
3126 * Set the Event Type property of the Signaling event.
3128 * @note The property is treated as immutable: it is only valid to call
3129 * the setter once. However, we don't assert if the caller tries to
3130 * overwrite, just ignoring the update instead.
3132 * @param event Pointer to the Signaling event.
3133 * @param type The Event Type to be set. ASCIIZ string. The caller
3134 * does not need to preserve the value once the function
3136 *****************************************************************************/
3137 void evel_signaling_type_set(EVENT_SIGNALING * const event,
3138 const char * const type);
3140 /**************************************************************************//**
3141 * Set the Product Id property of the Signaling event.
3143 * @note The property is treated as immutable: it is only valid to call
3144 * the setter once. However, we don't assert if the caller tries to
3145 * overwrite, just ignoring the update instead.
3147 * @param event Pointer to the Signaling event.
3148 * @param product_id The vendor product id to be set. ASCIIZ string. The
3149 * caller does not need to preserve the value once the
3151 *****************************************************************************/
3152 void evel_signaling_product_id_set(EVENT_SIGNALING * const event,
3153 const char * const product_id);
3155 /**************************************************************************//**
3156 * Set the Subsystem Id property of the Signaling event.
3158 * @note The property is treated as immutable: it is only valid to call
3159 * the setter once. However, we don't assert if the caller tries to
3160 * overwrite, just ignoring the update instead.
3162 * @param event Pointer to the Signaling event.
3163 * @param subsystem_id The vendor subsystem id to be set. ASCIIZ string. The
3164 * caller does not need to preserve the value once the
3166 *****************************************************************************/
3167 void evel_signaling_subsystem_id_set(EVENT_SIGNALING * const event,
3168 const char * const subsystem_id);
3170 /**************************************************************************//**
3171 * Set the Friendly Name property of the Signaling event.
3173 * @note The property is treated as immutable: it is only valid to call
3174 * the setter once. However, we don't assert if the caller tries to
3175 * overwrite, just ignoring the update instead.
3177 * @param event Pointer to the Signaling event.
3178 * @param friendly_name The vendor friendly name to be set. ASCIIZ string. The
3179 * caller does not need to preserve the value once the
3181 *****************************************************************************/
3182 void evel_signaling_friendly_name_set(EVENT_SIGNALING * const event,
3183 const char * const friendly_name);
3185 /**************************************************************************//**
3186 * Set the Correlator property of the Signaling event.
3188 * @note The property is treated as immutable: it is only valid to call
3189 * the setter once. However, we don't assert if the caller tries to
3190 * overwrite, just ignoring the update instead.
3192 * @param event Pointer to the Signaling event.
3193 * @param correlator The correlator to be set. ASCIIZ string. The caller
3194 * does not need to preserve the value once the function
3196 *****************************************************************************/
3197 void evel_signaling_correlator_set(EVENT_SIGNALING * const event,
3198 const char * const correlator);
3200 /**************************************************************************//**
3201 * Set the Local Ip Address property of the Signaling event.
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 event Pointer to the Signaling event.
3208 * @param local_ip_address
3209 * The Local Ip Address to be set. ASCIIZ string. The
3210 * caller does not need to preserve the value once the
3212 *****************************************************************************/
3213 void evel_signaling_local_ip_address_set(EVENT_SIGNALING * const event,
3214 const char * const local_ip_address);
3216 /**************************************************************************//**
3217 * Set the Local Port property of the Signaling event.
3219 * @note The property is treated as immutable: it is only valid to call
3220 * the setter once. However, we don't assert if the caller tries to
3221 * overwrite, just ignoring the update instead.
3223 * @param event Pointer to the Signaling event.
3224 * @param local_port The Local Port to be set. ASCIIZ string. The caller
3225 * does not need to preserve the value once the function
3227 *****************************************************************************/
3228 void evel_signaling_local_port_set(EVENT_SIGNALING * const event,
3229 const char * const local_port);
3231 /**************************************************************************//**
3232 * Set the Remote Ip Address property of the Signaling event.
3234 * @note The property is treated as immutable: it is only valid to call
3235 * the setter once. However, we don't assert if the caller tries to
3236 * overwrite, just ignoring the update instead.
3238 * @param event Pointer to the Signaling event.
3239 * @param remote_ip_address
3240 * The Remote Ip Address to be set. ASCIIZ string. The
3241 * caller does not need to preserve the value once the
3243 *****************************************************************************/
3244 void evel_signaling_remote_ip_address_set(EVENT_SIGNALING * const event,
3245 const char * const remote_ip_address);
3247 /**************************************************************************//**
3248 * Set the Remote Port property of the Signaling event.
3250 * @note The property is treated as immutable: it is only valid to call
3251 * the setter once. However, we don't assert if the caller tries to
3252 * overwrite, just ignoring the update instead.
3254 * @param event Pointer to the Signaling event.
3255 * @param remote_port The Remote Port to be set. ASCIIZ string. The caller
3256 * does not need to preserve the value once the function
3258 *****************************************************************************/
3259 void evel_signaling_remote_port_set(EVENT_SIGNALING * const event,
3260 const char * const remote_port);
3262 /**************************************************************************//**
3263 * Set the Compressed SIP property of the Signaling event.
3265 * @note The property is treated as immutable: it is only valid to call
3266 * the setter once. However, we don't assert if the caller tries to
3267 * overwrite, just ignoring the update instead.
3269 * @param event Pointer to the Signaling event.
3270 * @param compressed_sip
3271 * The Compressed SIP to be set. ASCIIZ string. The caller
3272 * does not need to preserve the value once the function
3274 *****************************************************************************/
3275 void evel_signaling_compressed_sip_set(EVENT_SIGNALING * const event,
3276 const char * const compressed_sip);
3278 /**************************************************************************//**
3279 * Set the Summary SIP property of the Signaling event.
3281 * @note The property is treated as immutable: it is only valid to call
3282 * the setter once. However, we don't assert if the caller tries to
3283 * overwrite, just ignoring the update instead.
3285 * @param event Pointer to the Signaling event.
3286 * @param summary_sip The Summary SIP to be set. ASCIIZ string. The caller
3287 * does not need to preserve the value once the function
3289 *****************************************************************************/
3290 void evel_signaling_summary_sip_set(EVENT_SIGNALING * const event,
3291 const char * const summary_sip);
3293 /*****************************************************************************/
3294 /*****************************************************************************/
3298 /*****************************************************************************/
3299 /*****************************************************************************/
3301 /**************************************************************************//**
3302 * Create a new State Change event.
3304 * @note The mandatory fields on the Syslog must be supplied to this factory
3305 * function and are immutable once set. Optional fields have explicit
3306 * setter functions, but again values may only be set once so that the
3307 * Syslog has immutable properties.
3309 * @param new_state The new state of the reporting entity.
3310 * @param old_state The old state of the reporting entity.
3311 * @param interface The card or port name of the reporting entity.
3313 * @returns pointer to the newly manufactured ::EVENT_STATE_CHANGE. If the
3314 * event is not used it must be released using
3315 * ::evel_free_state_change
3316 * @retval NULL Failed to create the event.
3317 *****************************************************************************/
3318 EVENT_STATE_CHANGE * evel_new_state_change(const EVEL_ENTITY_STATE new_state,
3319 const EVEL_ENTITY_STATE old_state,
3320 const char * const interface);
3322 /**************************************************************************//**
3323 * Free a State Change.
3325 * Free off the State Change supplied. Will free all the contained allocated
3328 * @note It does not free the State Change itself, since that may be part of a
3330 *****************************************************************************/
3331 void evel_free_state_change(EVENT_STATE_CHANGE * const state_change);
3333 /**************************************************************************//**
3334 * Set the Event Type property of the State Change.
3336 * @note The property is treated as immutable: it is only valid to call
3337 * the setter once. However, we don't assert if the caller tries to
3338 * overwrite, just ignoring the update instead.
3340 * @param state_change Pointer to the ::EVENT_STATE_CHANGE.
3341 * @param type The Event Type to be set. ASCIIZ string. The caller
3342 * does not need to preserve the value once the function
3344 *****************************************************************************/
3345 void evel_state_change_type_set(EVENT_STATE_CHANGE * const state_change,
3346 const char * const type);
3348 /**************************************************************************//**
3349 * Add an additional field name/value pair to the State Change.
3351 * The name and value are null delimited ASCII strings. The library takes
3352 * a copy so the caller does not have to preserve values after the function
3355 * @param state_change Pointer to the ::EVENT_STATE_CHANGE.
3356 * @param name ASCIIZ string with the attribute's name. The caller
3357 * does not need to preserve the value once the function
3359 * @param value ASCIIZ string with the attribute's value. The caller
3360 * does not need to preserve the value once the function
3362 *****************************************************************************/
3363 void evel_state_change_addl_field_add(EVENT_STATE_CHANGE * const state_change,
3364 const char * const name,
3365 const char * const value);
3367 /*****************************************************************************/
3368 /*****************************************************************************/
3372 /*****************************************************************************/
3373 /*****************************************************************************/
3375 /**************************************************************************//**
3376 * Create a new syslog event.
3378 * @note The mandatory fields on the Syslog must be supplied to this factory
3379 * function and are immutable once set. Optional fields have explicit
3380 * setter functions, but again values may only be set once so that the
3381 * Syslog has immutable properties.
3383 * @param event_source_type
3387 * @returns pointer to the newly manufactured ::EVENT_SYSLOG. If the event is
3388 * not used it must be released using ::evel_free_syslog
3389 * @retval NULL Failed to create the event.
3390 *****************************************************************************/
3391 EVENT_SYSLOG * evel_new_syslog(EVEL_SOURCE_TYPES event_source_type,
3392 const char * const syslog_msg,
3393 const char * const syslog_tag);
3395 /**************************************************************************//**
3396 * Set the Event Type property of the Syslog.
3398 * @note The property is treated as immutable: it is only valid to call
3399 * the setter once. However, we don't assert if the caller tries to
3400 * overwrite, just ignoring the update instead.
3402 * @param syslog Pointer to the syslog.
3403 * @param type The Event Type to be set. ASCIIZ string. The caller
3404 * does not need to preserve the value once the function
3406 *****************************************************************************/
3407 void evel_syslog_type_set(EVENT_SYSLOG * syslog,
3408 const char * const type);
3410 /**************************************************************************//**
3413 * Free off the Syslog supplied. Will free all the contained allocated memory.
3415 * @note It does not free the Syslog itself, since that may be part of a
3417 *****************************************************************************/
3418 void evel_free_syslog(EVENT_SYSLOG * event);
3420 /**************************************************************************//**
3421 * Add an additional field name/value pair to the Syslog.
3423 * The name and value are null delimited ASCII strings. The library takes
3424 * a copy so the caller does not have to preserve values after the function
3427 * @param syslog Pointer to the syslog.
3428 * @param name ASCIIZ string with the attribute's name. The caller
3429 * does not need to preserve the value once the function
3431 * @param value ASCIIZ string with the attribute's value. The caller
3432 * does not need to preserve the value once the function
3434 *****************************************************************************/
3435 void evel_syslog_addl_field_add(EVENT_SYSLOG * syslog,
3439 /**************************************************************************//**
3440 * Set the Event Source Host property of the Syslog.
3442 * @note The property is treated as immutable: it is only valid to call
3443 * the setter once. However, we don't assert if the caller tries to
3444 * overwrite, just ignoring the update instead.
3446 * @param syslog Pointer to the Syslog.
3447 * @param host The Event Source Host to be set. ASCIIZ string. The
3448 * caller does not need to preserve the value once the
3450 *****************************************************************************/
3451 void evel_syslog_event_source_host_set(EVENT_SYSLOG * syslog,
3452 const char * const host);
3454 /**************************************************************************//**
3455 * Set the Syslog Facility property of the Syslog.
3457 * @note The property is treated as immutable: it is only valid to call
3458 * the setter once. However, we don't assert if the caller tries to
3459 * overwrite, just ignoring the update instead.
3461 * @param syslog Pointer to the Syslog.
3462 * @param facility The Syslog Facility to be set. ASCIIZ string. The caller
3463 * does not need to preserve the value once the function
3465 *****************************************************************************/
3466 void evel_syslog_facility_set(EVENT_SYSLOG * syslog,
3467 EVEL_SYSLOG_FACILITIES facility);
3469 /**************************************************************************//**
3470 * Set the Process property of the Syslog.
3472 * @note The property is treated as immutable: it is only valid to call
3473 * the setter once. However, we don't assert if the caller tries to
3474 * overwrite, just ignoring the update instead.
3476 * @param syslog Pointer to the Syslog.
3477 * @param proc The Process to be set. ASCIIZ string. The caller does
3478 * not need to preserve the value once the function returns.
3479 *****************************************************************************/
3480 void evel_syslog_proc_set(EVENT_SYSLOG * syslog, const char * const proc);
3482 /**************************************************************************//**
3483 * Set the Process ID property of the Syslog.
3485 * @note The property is treated as immutable: it is only valid to call
3486 * the setter once. However, we don't assert if the caller tries to
3487 * overwrite, just ignoring the update instead.
3489 * @param syslog Pointer to the Syslog.
3490 * @param proc_id The Process ID to be set.
3491 *****************************************************************************/
3492 void evel_syslog_proc_id_set(EVENT_SYSLOG * syslog, int proc_id);
3494 /**************************************************************************//**
3495 * Set the Version property of the Syslog.
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 syslog Pointer to the Syslog.
3502 * @param version The Version to be set.
3503 *****************************************************************************/
3504 void evel_syslog_version_set(EVENT_SYSLOG * syslog, int version);
3506 /**************************************************************************//**
3507 * Set the Structured Data property of the Syslog.
3509 * @note The property is treated as immutable: it is only valid to call
3510 * the setter once. However, we don't assert if the caller tries to
3511 * overwrite, just ignoring the update instead.
3513 * @param syslog Pointer to the Syslog.
3514 * @param s_data The Structured Data to be set. ASCIIZ string. The caller
3515 * does not need to preserve the value once the function
3517 *****************************************************************************/
3518 void evel_syslog_s_data_set(EVENT_SYSLOG * syslog, const char * const s_data);
3520 /*****************************************************************************/
3521 /*****************************************************************************/
3525 /*****************************************************************************/
3526 /*****************************************************************************/
3528 /**************************************************************************//**
3529 * Create a new other event.
3532 * @returns pointer to the newly manufactured ::EVENT_OTHER. If the event is
3533 * not used it must be released using ::evel_free_other.
3534 * @retval NULL Failed to create the event.
3535 *****************************************************************************/
3536 EVENT_OTHER * evel_new_other(void);
3538 /**************************************************************************//**
3541 * Free off the Other supplied. Will free all the contained allocated memory.
3543 * @note It does not free the Other itself, since that may be part of a
3545 *****************************************************************************/
3546 void evel_free_other(EVENT_OTHER * event);
3548 /**************************************************************************//**
3549 * Set the Event Type property of the Other.
3551 * @note The property is treated as immutable: it is only valid to call
3552 * the setter once. However, we don't assert if the caller tries to
3553 * overwrite, just ignoring the update instead.
3555 * @param other Pointer to the Other.
3556 * @param type The Event Type to be set. ASCIIZ string. The caller
3557 * does not need to preserve the value once the function
3559 *****************************************************************************/
3560 void evel_other_type_set(EVENT_OTHER * other,
3561 const char * const type);
3563 /**************************************************************************//**
3564 * Add a value name/value pair to the Other.
3566 * The name and value are null delimited ASCII strings. The library takes
3567 * a copy so the caller does not have to preserve values after the function
3570 * @param other Pointer to the Other.
3571 * @param name ASCIIZ string with the attribute's name.
3572 * @param value ASCIIZ string with the attribute's value.
3573 *****************************************************************************/
3574 void evel_other_field_add(EVENT_OTHER * other,
3578 /*****************************************************************************/
3579 /*****************************************************************************/
3583 /*****************************************************************************/
3584 /*****************************************************************************/
3586 /**************************************************************************//**
3587 * Return the current measurement interval provided by the Event Listener.
3589 * @returns The current measurement interval
3590 * @retval EVEL_MEASUREMENT_INTERVAL_UKNOWN (0) - interval has not been
3592 *****************************************************************************/
3593 int evel_get_measurement_interval();
3595 /*****************************************************************************/
3596 /*****************************************************************************/
3600 /*****************************************************************************/
3601 /*****************************************************************************/
3603 /*****************************************************************************/
3605 /*****************************************************************************/
3606 #define EVEL_DEBUG(FMT, ...) log_debug(EVEL_LOG_DEBUG, (FMT), ##__VA_ARGS__)
3607 #define EVEL_INFO(FMT, ...) log_debug(EVEL_LOG_INFO, (FMT), ##__VA_ARGS__)
3608 #define EVEL_SPAMMY(FMT, ...) log_debug(EVEL_LOG_SPAMMY, (FMT), ##__VA_ARGS__)
3609 #define EVEL_ERROR(FMT, ...) log_debug(EVEL_LOG_ERROR, "ERROR: " FMT, \
3611 #define EVEL_ENTER() \
3613 log_debug(EVEL_LOG_DEBUG, "Enter %s {", __FUNCTION__); \
3614 debug_indent += 2; \
3616 #define EVEL_EXIT() \
3618 debug_indent -= 2; \
3619 log_debug(EVEL_LOG_DEBUG, "Exit %s }", __FUNCTION__); \
3622 #define INDENT_SEPARATORS \
3623 "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "
3625 extern EVEL_LOG_LEVELS debug_level;
3626 extern int debug_indent;
3629 #define EVEL_DEBUG_ON() ((debug_level) >= EVEL_LOG_DEBUG)
3631 /**************************************************************************//**
3632 * Initialize logging
3634 * @param[in] level The debugging level - one of ::EVEL_LOG_LEVELS.
3635 * @param[in] ident The identifier for our logs.
3636 *****************************************************************************/
3637 void log_initialize(EVEL_LOG_LEVELS level, const char * ident);
3639 /**************************************************************************//**
3640 * Log debug information
3642 * Logs debugging information in a platform independent manner.
3644 * @param[in] level The debugging level - one of ::EVEL_LOG_LEVELS.
3645 * @param[in] format Log formatting string in printf format.
3646 * @param[in] ... Variable argument list.
3647 *****************************************************************************/
3648 void log_debug(EVEL_LOG_LEVELS level, char * format, ...);
3650 /***************************************************************************//*
3651 * Store the formatted string into the static error string and log the error.
3653 * @param format Error string in standard printf format.
3654 * @param ... Variable parameters to be substituted into the format string.
3655 *****************************************************************************/
3656 void log_error_state(char * format, ...);