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(c) <2016>, AT&T Intellectual Property. All other rights reserved.
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions are met:
22 * 1. Redistributions of source code must retain the above copyright notice,
23 * this list of conditions and the following disclaimer.
24 * 2. Redistributions in binary form must reproduce the above copyright notice,
25 * this list of conditions and the following disclaimer in the documentation
26 * and/or other materials provided with the distribution.
27 * 3. All advertising materials mentioning features or use of this software
28 * must display the following acknowledgement: This product includes
29 * software developed by the AT&T.
30 * 4. Neither the name of AT&T nor the names of its contributors may be used to
31 * endorse or promote products derived from this software without specific
32 * prior written permission.
34 * THIS SOFTWARE IS PROVIDED BY AT&T INTELLECTUAL PROPERTY ''AS IS'' AND ANY
35 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37 * DISCLAIMED. IN NO EVENT SHALL AT&T INTELLECTUAL PROPERTY BE LIABLE FOR ANY
38 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
41 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
43 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 *****************************************************************************/
55 #include "double_list.h"
57 /*****************************************************************************/
58 /* Supported API version. */
59 /*****************************************************************************/
60 #define EVEL_API_MAJOR_VERSION 3
61 #define EVEL_API_MINOR_VERSION 0
63 /**************************************************************************//**
66 * Error codes for EVEL low level interface
67 *****************************************************************************/
69 EVEL_SUCCESS, /** The operation was successful. */
70 EVEL_ERR_GEN_FAIL, /** Non-specific failure. */
71 EVEL_CURL_LIBRARY_FAIL, /** A cURL library operation failed. */
72 EVEL_PTHREAD_LIBRARY_FAIL, /** A Posix threads operation failed. */
73 EVEL_OUT_OF_MEMORY, /** A memory allocation failure occurred. */
74 EVEL_EVENT_BUFFER_FULL, /** Too many events in the ring-buffer. */
75 EVEL_EVENT_HANDLER_INACTIVE, /** Attempt to raise event when inactive. */
76 EVEL_NO_METADATA, /** Failed to retrieve OpenStack metadata. */
77 EVEL_BAD_METADATA, /** OpenStack metadata invalid format. */
78 EVEL_BAD_JSON_FORMAT, /** JSON failed to parse correctly. */
79 EVEL_JSON_KEY_NOT_FOUND, /** Failed to find the specified JSON key. */
80 EVEL_MAX_ERROR_CODES /** Maximum number of valid error codes. */
83 /**************************************************************************//**
86 * Variable levels of verbosity in the logging functions.
87 *****************************************************************************/
97 /*****************************************************************************/
98 /* Maximum string lengths. */
99 /*****************************************************************************/
100 #define EVEL_MAX_STRING_LEN 4096
101 #define EVEL_MAX_JSON_BODY 16000
102 #define EVEL_MAX_ERROR_STRING_LEN 255
103 #define EVEL_MAX_URL_LEN 511
105 /**************************************************************************//**
106 * This value represents there being no restriction on the reporting interval.
107 *****************************************************************************/
108 static const int EVEL_MEASUREMENT_INTERVAL_UKNOWN = 0;
110 /**************************************************************************//**
111 * How many events can be backed-up before we start dropping events on the
114 * @note This value should be tuned in accordance with expected burstiness of
115 * the event load and the expected response time of the ECOMP event
116 * listener so that the probability of the buffer filling is suitably
118 *****************************************************************************/
119 static const int EVEL_EVENT_BUFFER_DEPTH = 100;
121 /*****************************************************************************/
122 /* How many different IP Types-of-Service are supported. */
123 /*****************************************************************************/
124 #define EVEL_TOS_SUPPORTED 256
126 /**************************************************************************//**
127 * Event domains for the various events we support.
128 * JSON equivalent field: domain
129 *****************************************************************************/
131 EVEL_DOMAIN_INTERNAL, /** Internal event, not for external routing. */
132 EVEL_DOMAIN_HEARTBEAT, /** A Heartbeat event (event header only). */
133 EVEL_DOMAIN_FAULT, /** A Fault event. */
134 EVEL_DOMAIN_MEASUREMENT, /** A Measurement for VF Scaling event. */
135 EVEL_DOMAIN_MOBILE_FLOW, /** A Mobile Flow event. */
136 EVEL_DOMAIN_REPORT, /** A Measurement for VF Reporting event. */
137 EVEL_DOMAIN_SERVICE, /** A Service event. */
138 EVEL_DOMAIN_SIGNALING, /** A Signaling event. */
139 EVEL_DOMAIN_STATE_CHANGE, /** A State Change event. */
140 EVEL_DOMAIN_SYSLOG, /** A Syslog event. */
141 EVEL_DOMAIN_OTHER, /** Another event. */
142 EVEL_MAX_DOMAINS /** Maximum number of recognized Event types. */
143 } EVEL_EVENT_DOMAINS;
145 /**************************************************************************//**
147 * JSON equivalent field: priority
148 *****************************************************************************/
151 EVEL_PRIORITY_MEDIUM,
152 EVEL_PRIORITY_NORMAL,
155 } EVEL_EVENT_PRIORITIES;
157 /**************************************************************************//**
158 * Fault / Threshold severities.
159 * JSON equivalent field: eventSeverity
160 *****************************************************************************/
162 EVEL_SEVERITY_CRITICAL,
165 EVEL_SEVERITY_WARNING,
166 EVEL_SEVERITY_NORMAL,
170 /**************************************************************************//**
171 * Fault source types.
172 * JSON equivalent field: eventSourceType
173 *****************************************************************************/
181 EVEL_SOURCE_SLOT_THRESHOLD,
182 EVEL_SOURCE_PORT_THRESHOLD,
183 EVEL_SOURCE_VIRTUAL_MACHINE,
184 EVEL_SOURCE_VIRTUAL_NETWORK_FUNCTION,
185 /***************************************************************************/
186 /* START OF VENDOR-SPECIFIC VALUES */
188 /* Vendor-specific values should be added here, and handled appropriately */
189 /* in evel_event.c. */
190 /***************************************************************************/
192 /***************************************************************************/
193 /* END OF VENDOR-SPECIFIC VALUES */
194 /***************************************************************************/
195 EVEL_MAX_SOURCE_TYPES
198 /**************************************************************************//**
200 * JSON equivalent field: vfStatus
201 *****************************************************************************/
203 EVEL_VF_STATUS_ACTIVE,
205 EVEL_VF_STATUS_PREP_TERMINATE,
206 EVEL_VF_STATUS_READY_TERMINATE,
207 EVEL_VF_STATUS_REQ_TERMINATE,
211 /**************************************************************************//**
212 * Counter criticalities.
213 * JSON equivalent field: criticality
214 *****************************************************************************/
216 EVEL_COUNTER_CRITICALITY_CRIT,
217 EVEL_COUNTER_CRITICALITY_MAJ,
218 EVEL_MAX_COUNTER_CRITICALITIES
219 } EVEL_COUNTER_CRITICALITIES;
221 /**************************************************************************//**
223 * JSON equivalent field: alertAction
224 *****************************************************************************/
226 EVEL_ALERT_ACTION_CLEAR,
227 EVEL_ALERT_ACTION_CONT,
228 EVEL_ALERT_ACTION_SET,
229 EVEL_MAX_ALERT_ACTIONS
230 } EVEL_ALERT_ACTIONS;
232 /**************************************************************************//**
234 * JSON equivalent field: alertType
235 *****************************************************************************/
237 EVEL_ALERT_TYPE_CARD,
238 EVEL_ALERT_TYPE_ELEMENT,
239 EVEL_ALERT_TYPE_INTERFACE,
240 EVEL_ALERT_TYPE_SERVICE,
244 /**************************************************************************//**
246 * JSON equivalent fields: newState, oldState
247 *****************************************************************************/
249 EVEL_ENTITY_STATE_IN_SERVICE,
250 EVEL_ENTITY_STATE_MAINTENANCE,
251 EVEL_ENTITY_STATE_OUT_OF_SERVICE,
252 EVEL_MAX_ENTITY_STATES
255 /**************************************************************************//**
257 * JSON equivalent field: syslogFacility
258 *****************************************************************************/
260 EVEL_SYSLOG_FACILITY_KERNEL,
261 EVEL_SYSLOG_FACILITY_USER,
262 EVEL_SYSLOG_FACILITY_MAIL,
263 EVEL_SYSLOG_FACILITY_SYSTEM_DAEMON,
264 EVEL_SYSLOG_FACILITY_SECURITY_AUTH,
265 EVEL_SYSLOG_FACILITY_INTERNAL,
266 EVEL_SYSLOG_FACILITY_LINE_PRINTER,
267 EVEL_SYSLOG_FACILITY_NETWORK_NEWS,
268 EVEL_SYSLOG_FACILITY_UUCP,
269 EVEL_SYSLOG_FACILITY_CLOCK_DAEMON,
270 EVEL_SYSLOG_FACILITY_SECURITY_AUTH2,
271 EVEL_SYSLOG_FACILITY_FTP_DAEMON,
272 EVEL_SYSLOG_FACILITY_NTP,
273 EVEL_SYSLOG_FACILITY_LOG_AUDIT,
274 EVEL_SYSLOG_FACILITY_LOG_ALERT,
275 EVEL_SYSLOG_FACILITY_CLOCK_DAEMON2,
276 EVEL_SYSLOG_FACILITY_LOCAL0,
277 EVEL_SYSLOG_FACILITY_LOCAL1,
278 EVEL_SYSLOG_FACILITY_LOCAL2,
279 EVEL_SYSLOG_FACILITY_LOCAL3,
280 EVEL_SYSLOG_FACILITY_LOCAL4,
281 EVEL_SYSLOG_FACILITY_LOCAL5,
282 EVEL_SYSLOG_FACILITY_LOCAL6,
283 EVEL_SYSLOG_FACILITY_LOCAL7,
284 EVEL_MAX_SYSLOG_FACILITIES
285 } EVEL_SYSLOG_FACILITIES;
287 /**************************************************************************//**
289 * JSON equivalent fields: tcpFlagCountList, tcpFlagList
290 *****************************************************************************/
304 /**************************************************************************//**
305 * Mobile QCI Classes of Service.
306 * JSON equivalent fields: mobileQciCosCountList, mobileQciCosList
307 *****************************************************************************/
310 /***************************************************************************/
311 /* UMTS Classes of Service. */
312 /***************************************************************************/
313 EVEL_QCI_COS_UMTS_CONVERSATIONAL,
314 EVEL_QCI_COS_UMTS_STREAMING,
315 EVEL_QCI_COS_UMTS_INTERACTIVE,
316 EVEL_QCI_COS_UMTS_BACKGROUND,
318 /***************************************************************************/
319 /* LTE Classes of Service. */
320 /***************************************************************************/
334 EVEL_MAX_QCI_COS_TYPES
335 } EVEL_QCI_COS_TYPES;
337 /**************************************************************************//**
338 * Service Event endpoint description
339 * JSON equivalent field: endpointDesc
340 *****************************************************************************/
342 EVEL_SERVICE_ENDPOINT_CALLEE,
343 EVEL_SERVICE_ENDPOINT_CALLER,
344 EVEL_MAX_SERVICE_ENDPOINT_DESC
345 } EVEL_SERVICE_ENDPOINT_DESC;
347 /**************************************************************************//**
348 * Boolean type for EVEL library.
349 *****************************************************************************/
355 /**************************************************************************//**
356 * Optional parameter holder for double.
357 *****************************************************************************/
358 typedef struct evel_option_double
362 } EVEL_OPTION_DOUBLE;
364 /**************************************************************************//**
365 * Optional parameter holder for string.
366 *****************************************************************************/
367 typedef struct evel_option_string
371 } EVEL_OPTION_STRING;
373 /**************************************************************************//**
374 * Optional parameter holder for int.
375 *****************************************************************************/
376 typedef struct evel_option_int
382 /**************************************************************************//**
383 * Optional parameter holder for unsigned long long.
384 *****************************************************************************/
385 typedef struct evel_option_ull
387 unsigned long long value;
391 /**************************************************************************//**
392 * Optional parameter holder for time_t.
393 *****************************************************************************/
394 typedef struct evel_option_time
400 /*****************************************************************************/
401 /* Supported Common Event Header version. */
402 /*****************************************************************************/
403 #define EVEL_HEADER_MAJOR_VERSION 1
404 #define EVEL_HEADER_MINOR_VERSION 2
406 /**************************************************************************//**
408 * JSON equivalent field: commonEventHeader
409 *****************************************************************************/
410 typedef struct event_header {
411 /***************************************************************************/
413 /***************************************************************************/
417 /***************************************************************************/
418 /* Mandatory fields */
419 /***************************************************************************/
420 EVEL_EVENT_DOMAINS event_domain;
423 char * functional_role;
424 char * reporting_entity_name;
425 EVEL_EVENT_PRIORITIES priority;
426 unsigned long long start_epoch_microsec;
427 unsigned long long last_epoch_microsec;
430 /***************************************************************************/
431 /* Optional fields */
432 /***************************************************************************/
433 EVEL_OPTION_STRING event_type;
434 EVEL_OPTION_STRING source_id;
435 EVEL_OPTION_STRING reporting_entity_id;
439 /*****************************************************************************/
440 /* Supported Fault version. */
441 /*****************************************************************************/
442 #define EVEL_FAULT_MAJOR_VERSION 1
443 #define EVEL_FAULT_MINOR_VERSION 1
445 /**************************************************************************//**
447 * JSON equivalent field: faultFields
448 *****************************************************************************/
449 typedef struct event_fault {
450 /***************************************************************************/
451 /* Header and version */
452 /***************************************************************************/
457 /***************************************************************************/
458 /* Mandatory fields */
459 /***************************************************************************/
460 EVEL_SEVERITIES event_severity;
461 EVEL_SOURCE_TYPES event_source_type;
462 char * alarm_condition;
463 char * specific_problem;
464 EVEL_VF_STATUSES vf_status;
466 /***************************************************************************/
467 /* Optional fields */
468 /***************************************************************************/
469 EVEL_OPTION_STRING alarm_interface_a;
470 DLIST additional_info;
474 /**************************************************************************//**
475 * Fault Additional Info.
476 * JSON equivalent field: alarmAdditionalInformation
477 *****************************************************************************/
478 typedef struct fault_additional_info {
483 /*****************************************************************************/
484 /* Supported Measurement version. */
485 /*****************************************************************************/
486 #define EVEL_MEASUREMENT_MAJOR_VERSION 1
487 #define EVEL_MEASUREMENT_MINOR_VERSION 1
489 /**************************************************************************//**
491 * JSON equivalent field: errors
492 *****************************************************************************/
493 typedef struct measurement_errors {
494 int receive_discards;
496 int transmit_discards;
498 } MEASUREMENT_ERRORS;
500 /**************************************************************************//**
502 * JSON equivalent field: measurementsForVfScalingFields
503 *****************************************************************************/
504 typedef struct event_measurement {
505 /***************************************************************************/
506 /* Header and version */
507 /***************************************************************************/
512 /***************************************************************************/
513 /* Mandatory fields */
514 /***************************************************************************/
515 double measurement_interval;
517 /***************************************************************************/
518 /* Optional fields */
519 /***************************************************************************/
520 DLIST additional_measurements;
521 EVEL_OPTION_DOUBLE aggregate_cpu_usage;
523 EVEL_OPTION_INT concurrent_sessions;
524 EVEL_OPTION_INT configured_entities;
526 MEASUREMENT_ERRORS * errors;
528 DLIST filesystem_usage;
529 DLIST latency_distribution;
530 EVEL_OPTION_DOUBLE mean_request_latency;
531 EVEL_OPTION_DOUBLE memory_configured;
532 EVEL_OPTION_DOUBLE memory_used;
533 EVEL_OPTION_INT media_ports_in_use;
534 EVEL_OPTION_INT request_rate;
535 EVEL_OPTION_DOUBLE vnfc_scaling_metric;
540 /**************************************************************************//**
542 * JSON equivalent field: cpuUsage
543 *****************************************************************************/
544 typedef struct measurement_cpu_use {
547 } MEASUREMENT_CPU_USE;
549 /**************************************************************************//**
551 * JSON equivalent field: filesystemUsage
552 *****************************************************************************/
553 typedef struct measurement_fsys_use {
554 char * filesystem_name;
555 double block_configured;
558 double ephemeral_configured;
560 double ephemeral_used;
561 } MEASUREMENT_FSYS_USE;
563 /**************************************************************************//**
565 * JSON equivalent field: latencyBucketMeasure
566 *****************************************************************************/
567 typedef struct measurement_latency_bucket {
570 /***************************************************************************/
571 /* Optional fields */
572 /***************************************************************************/
573 EVEL_OPTION_DOUBLE high_end;
574 EVEL_OPTION_DOUBLE low_end;
576 } MEASUREMENT_LATENCY_BUCKET;
578 /**************************************************************************//**
580 * JSON equivalent field: vNicUsage
581 *****************************************************************************/
582 typedef struct measurement_vnic_use {
589 /***************************************************************************/
590 /* Optional fields */
591 /***************************************************************************/
592 EVEL_OPTION_INT broadcast_packets_in;
593 EVEL_OPTION_INT broadcast_packets_out;
594 EVEL_OPTION_INT multicast_packets_in;
595 EVEL_OPTION_INT multicast_packets_out;
596 EVEL_OPTION_INT unicast_packets_in;
597 EVEL_OPTION_INT unicast_packets_out;
599 } MEASUREMENT_VNIC_USE;
601 /**************************************************************************//**
603 * JSON equivalent field: codecsInUse
604 *****************************************************************************/
605 typedef struct measurement_codec_use {
608 } MEASUREMENT_CODEC_USE;
610 /**************************************************************************//**
612 * JSON equivalent field: featuresInUse
613 *****************************************************************************/
614 typedef struct measurement_feature_use {
616 int feature_utilization;
617 } MEASUREMENT_FEATURE_USE;
619 /**************************************************************************//**
621 * JSON equivalent field: additionalMeasurements
622 *****************************************************************************/
623 typedef struct measurement_group {
628 /**************************************************************************//**
629 * Custom Defined Measurement.
630 * JSON equivalent field: measurements
631 *****************************************************************************/
632 typedef struct custom_measurement {
635 } CUSTOM_MEASUREMENT;
637 /*****************************************************************************/
638 /* Supported Report version. */
639 /*****************************************************************************/
640 #define EVEL_REPORT_MAJOR_VERSION 1
641 #define EVEL_REPORT_MINOR_VERSION 1
643 /**************************************************************************//**
645 * JSON equivalent field: measurementsForVfReportingFields
647 * @note This is an experimental event type and is not currently a formal part
648 * of AT&T's specification.
649 *****************************************************************************/
650 typedef struct event_report {
651 /***************************************************************************/
652 /* Header and version */
653 /***************************************************************************/
658 /***************************************************************************/
659 /* Mandatory fields */
660 /***************************************************************************/
661 double measurement_interval;
663 /***************************************************************************/
664 /* Optional fields */
665 /***************************************************************************/
667 DLIST measurement_groups;
671 /**************************************************************************//**
672 * Mobile GTP Per Flow Metrics.
673 * JSON equivalent field: gtpPerFlowMetrics
674 *****************************************************************************/
675 typedef struct mobile_gtp_per_flow_metrics {
676 double avg_bit_error_rate;
677 double avg_packet_delay_variation;
678 int avg_packet_latency;
679 int avg_receive_throughput;
680 int avg_transmit_throughput;
681 int flow_activation_epoch;
682 int flow_activation_microsec;
683 int flow_deactivation_epoch;
684 int flow_deactivation_microsec;
685 time_t flow_deactivation_time;
687 int max_packet_delay_variation;
688 int num_activation_failures;
690 int num_bytes_received;
691 int num_bytes_transmitted;
692 int num_dropped_packets;
693 int num_l7_bytes_received;
694 int num_l7_bytes_transmitted;
695 int num_lost_packets;
696 int num_out_of_order_packets;
697 int num_packet_errors;
698 int num_packets_received_excl_retrans;
699 int num_packets_received_incl_retrans;
700 int num_packets_transmitted_incl_retrans;
703 int num_tunneled_l7_bytes_received;
705 int time_to_first_byte;
707 /***************************************************************************/
708 /* Optional fields */
709 /***************************************************************************/
710 EVEL_OPTION_INT ip_tos_counts[EVEL_TOS_SUPPORTED];
711 EVEL_OPTION_INT tcp_flag_counts[EVEL_MAX_TCP_FLAGS];
712 EVEL_OPTION_INT qci_cos_counts[EVEL_MAX_QCI_COS_TYPES];
713 EVEL_OPTION_INT dur_connection_failed_status;
714 EVEL_OPTION_INT dur_tunnel_failed_status;
715 EVEL_OPTION_STRING flow_activated_by;
716 EVEL_OPTION_TIME flow_activation_time;
717 EVEL_OPTION_STRING flow_deactivated_by;
718 EVEL_OPTION_STRING gtp_connection_status;
719 EVEL_OPTION_STRING gtp_tunnel_status;
720 EVEL_OPTION_INT large_packet_rtt;
721 EVEL_OPTION_DOUBLE large_packet_threshold;
722 EVEL_OPTION_INT max_receive_bit_rate;
723 EVEL_OPTION_INT max_transmit_bit_rate;
724 EVEL_OPTION_INT num_gtp_echo_failures;
725 EVEL_OPTION_INT num_gtp_tunnel_errors;
726 EVEL_OPTION_INT num_http_errors;
728 } MOBILE_GTP_PER_FLOW_METRICS;
730 /*****************************************************************************/
731 /* Supported Mobile Flow version. */
732 /*****************************************************************************/
733 #define EVEL_MOBILE_FLOW_MAJOR_VERSION 1
734 #define EVEL_MOBILE_FLOW_MINOR_VERSION 1
736 /**************************************************************************//**
738 * JSON equivalent field: mobileFlow
739 *****************************************************************************/
740 typedef struct event_mobile_flow {
741 /***************************************************************************/
742 /* Header and version */
743 /***************************************************************************/
748 /***************************************************************************/
749 /* Mandatory fields */
750 /***************************************************************************/
751 char * flow_direction;
752 MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics;
753 char * ip_protocol_type;
755 char * other_endpoint_ip_address;
756 int other_endpoint_port;
757 char * reporting_endpoint_ip_addr;
758 int reporting_endpoint_port;
760 /***************************************************************************/
761 /* Optional fields */
762 /***************************************************************************/
763 EVEL_OPTION_STRING application_type;
764 EVEL_OPTION_STRING app_protocol_type;
765 EVEL_OPTION_STRING app_protocol_version;
766 EVEL_OPTION_STRING cid;
767 EVEL_OPTION_STRING connection_type;
768 EVEL_OPTION_STRING ecgi;
769 EVEL_OPTION_STRING gtp_protocol_type;
770 EVEL_OPTION_STRING gtp_version;
771 EVEL_OPTION_STRING http_header;
772 EVEL_OPTION_STRING imei;
773 EVEL_OPTION_STRING imsi;
774 EVEL_OPTION_STRING lac;
775 EVEL_OPTION_STRING mcc;
776 EVEL_OPTION_STRING mnc;
777 EVEL_OPTION_STRING msisdn;
778 EVEL_OPTION_STRING other_functional_role;
779 EVEL_OPTION_STRING rac;
780 EVEL_OPTION_STRING radio_access_technology;
781 EVEL_OPTION_STRING sac;
782 EVEL_OPTION_INT sampling_algorithm;
783 EVEL_OPTION_STRING tac;
784 EVEL_OPTION_STRING tunnel_id;
785 EVEL_OPTION_STRING vlan_id;
789 /**************************************************************************//**
791 * JSON equivalent field: otherFields
792 *****************************************************************************/
793 typedef struct event_other {
799 /**************************************************************************//**
801 * JSON equivalent field: otherFields
802 *****************************************************************************/
803 typedef struct other_field {
808 /**************************************************************************//**
809 * Event Instance Identifier
810 * JSON equivalent field: eventInstanceIdentifier
811 *****************************************************************************/
812 typedef struct evel_event_instance_id {
814 /***************************************************************************/
815 /* Mandatory fields */
816 /***************************************************************************/
817 char * vendor_id; /* JSON: vendorId */
818 char * event_id; /* JSON: eventId */
820 /***************************************************************************/
821 /* Optional fields */
822 /***************************************************************************/
823 EVEL_OPTION_STRING product_id; /* JSON: productId */
824 EVEL_OPTION_STRING subsystem_id; /* JSON: subsystemId */
825 EVEL_OPTION_STRING event_friendly_name; /* JSON: eventFriendlyName */
827 } EVEL_EVENT_INSTANCE_ID;
829 /*****************************************************************************/
830 /* Supported Service Events version. */
831 /*****************************************************************************/
832 #define EVEL_SERVICE_MAJOR_VERSION 1
833 #define EVEL_SERVICE_MINOR_VERSION 1
835 /**************************************************************************//**
837 * JSON equivalent field: serviceEventsFields
838 *****************************************************************************/
839 typedef struct event_service {
840 /***************************************************************************/
841 /* Header and version */
842 /***************************************************************************/
847 /***************************************************************************/
848 /* Mandatory fields */
849 /***************************************************************************/
850 EVEL_EVENT_INSTANCE_ID instance_id; /* JSON: eventInstanceIdentifier */
852 /***************************************************************************/
853 /* Optional fields. */
854 /***************************************************************************/
855 EVEL_OPTION_STRING correlator; /* JSON: correlator */
856 DLIST additional_fields; /* JSON: additionalFields */
858 /***************************************************************************/
859 /* Optional fields within JSON equivalent object: codecSelected */
860 /***************************************************************************/
861 EVEL_OPTION_STRING codec; /* JSON: codec */
863 /***************************************************************************/
864 /* Optional fields within JSON equivalent object: codecSelectedTranscoding */
865 /***************************************************************************/
866 EVEL_OPTION_STRING callee_side_codec; /* JSON: calleeSideCodec */
867 EVEL_OPTION_STRING caller_side_codec; /* JSON: callerSideCodec */
869 /***************************************************************************/
870 /* Optional fields within JSON equivalent object: midCallRtcp */
871 /***************************************************************************/
872 EVEL_OPTION_STRING rtcp_data; /* JSON: rtcpData */
874 /***************************************************************************/
875 /* Optional fields within JSON equivalent object: endOfCallVqmSummaries */
876 /***************************************************************************/
877 EVEL_OPTION_STRING adjacency_name; /* JSON: adjacencyName */
878 EVEL_OPTION_STRING endpoint_description; /* JSON: endpointDescription */
879 EVEL_OPTION_INT endpoint_jitter; /* JSON: endpointJitter */
880 EVEL_OPTION_INT endpoint_rtp_oct_disc; /* JSON: endpointRtpOctetsDiscarded */
881 EVEL_OPTION_INT endpoint_rtp_oct_recv; /* JSON: endpointRtpOctetsReceived */
882 EVEL_OPTION_INT endpoint_rtp_oct_sent; /* JSON: endpointRtpOctetsSent */
883 EVEL_OPTION_INT endpoint_rtp_pkt_disc;/* JSON: endpointRtpPacketsDiscarded */
884 EVEL_OPTION_INT endpoint_rtp_pkt_recv; /* JSON: endpointRtpPacketsReceived */
885 EVEL_OPTION_INT endpoint_rtp_pkt_sent; /* JSON: endpointRtpPacketsSent */
886 EVEL_OPTION_INT local_jitter; /* JSON: localJitter */
887 EVEL_OPTION_INT local_rtp_oct_disc; /* JSON: localRtpOctetsDiscarded */
888 EVEL_OPTION_INT local_rtp_oct_recv; /* JSON: localRtpOctetsReceived */
889 EVEL_OPTION_INT local_rtp_oct_sent; /* JSON: localRtpOctetsSent */
890 EVEL_OPTION_INT local_rtp_pkt_disc; /* JSON: localRtpPacketsDiscarded */
891 EVEL_OPTION_INT local_rtp_pkt_recv; /* JSON: localRtpPacketsReceived */
892 EVEL_OPTION_INT local_rtp_pkt_sent; /* JSON: localRtpPacketsSent */
893 EVEL_OPTION_DOUBLE mos_cqe; /* JSON: mosCqe */
894 EVEL_OPTION_INT packets_lost; /* JSON: packetsLost */
895 EVEL_OPTION_DOUBLE packet_loss_percent; /* JSON: packetLossPercent */
896 EVEL_OPTION_INT r_factor; /* JSON: rFactor */
897 EVEL_OPTION_INT round_trip_delay; /* JSON: roundTripDelay */
899 /***************************************************************************/
900 /* Optional fields within JSON equivalent object: marker */
901 /***************************************************************************/
902 EVEL_OPTION_STRING phone_number; /* JSON: phoneNumber */
906 /*****************************************************************************/
907 /* Supported Signaling version. */
908 /*****************************************************************************/
909 #define EVEL_SIGNALING_MAJOR_VERSION 1
910 #define EVEL_SIGNALING_MINOR_VERSION 1
912 /**************************************************************************//**
914 * JSON equivalent field: signalingFields
915 *****************************************************************************/
916 typedef struct event_signaling {
917 /***************************************************************************/
918 /* Header and version */
919 /***************************************************************************/
924 /***************************************************************************/
925 /* Mandatory fields */
926 /***************************************************************************/
927 EVEL_EVENT_INSTANCE_ID instance_id; /* JSON: eventInstanceIdentifier */
929 /***************************************************************************/
930 /* Optional fields */
931 /***************************************************************************/
932 EVEL_OPTION_STRING correlator; /* JSON: correlator */
933 EVEL_OPTION_STRING local_ip_address; /* JSON: localIpAddress */
934 EVEL_OPTION_STRING local_port; /* JSON: localPort */
935 EVEL_OPTION_STRING remote_ip_address; /* JSON: remoteIpAddress */
936 EVEL_OPTION_STRING remote_port; /* JSON: remotePort */
937 EVEL_OPTION_STRING compressed_sip; /* JSON: compressedSip */
938 EVEL_OPTION_STRING summary_sip; /* JSON: summarySip */
942 /*****************************************************************************/
943 /* Supported State Change version. */
944 /*****************************************************************************/
945 #define EVEL_STATE_CHANGE_MAJOR_VERSION 1
946 #define EVEL_STATE_CHANGE_MINOR_VERSION 1
948 /**************************************************************************//**
950 * JSON equivalent field: stateChangeFields
951 *****************************************************************************/
952 typedef struct event_state_change {
953 /***************************************************************************/
954 /* Header and version */
955 /***************************************************************************/
960 /***************************************************************************/
961 /* Mandatory fields */
962 /***************************************************************************/
963 EVEL_ENTITY_STATE new_state;
964 EVEL_ENTITY_STATE old_state;
965 char * state_interface;
967 /***************************************************************************/
968 /* Optional fields */
969 /***************************************************************************/
970 DLIST additional_fields;
972 } EVENT_STATE_CHANGE;
974 /**************************************************************************//**
975 * State Change Additional Field.
976 * JSON equivalent field: additionalFields
977 *****************************************************************************/
978 typedef struct state_change_additional_field {
981 } STATE_CHANGE_ADDL_FIELD;
983 /*****************************************************************************/
984 /* Supported Syslog version. */
985 /*****************************************************************************/
986 #define EVEL_SYSLOG_MAJOR_VERSION 1
987 #define EVEL_SYSLOG_MINOR_VERSION 1
989 /**************************************************************************//**
991 * JSON equivalent field: syslogFields
992 *****************************************************************************/
993 typedef struct event_syslog {
994 /***************************************************************************/
995 /* Header and version */
996 /***************************************************************************/
1001 /***************************************************************************/
1002 /* Mandatory fields */
1003 /***************************************************************************/
1004 EVEL_SOURCE_TYPES event_source_type;
1008 /***************************************************************************/
1009 /* Optional fields */
1010 /***************************************************************************/
1011 DLIST additional_fields;
1012 EVEL_OPTION_STRING event_source_host;
1013 EVEL_OPTION_INT syslog_facility;
1014 EVEL_OPTION_STRING syslog_proc;
1015 EVEL_OPTION_INT syslog_proc_id;
1016 EVEL_OPTION_STRING syslog_s_data;
1017 EVEL_OPTION_INT syslog_ver;
1021 /**************************************************************************//**
1022 * Syslog Additional Field.
1023 * JSON equivalent field: additionalFields
1024 *****************************************************************************/
1025 typedef struct syslog_additional_field {
1028 } SYSLOG_ADDL_FIELD;
1030 /**************************************************************************//**
1032 * JSON equivalent object: attCopyrightNotice
1033 *****************************************************************************/
1034 typedef struct copyright {
1035 char * useAndRedistribution;
1040 char * disclaimerLine1;
1041 char * disclaimerLine2;
1042 char * disclaimerLine3;
1043 char * disclaimerLine4;
1046 /**************************************************************************//**
1047 * Library initialization.
1049 * Initialize the EVEL library.
1051 * @note This function initializes the cURL library. Applications making use
1052 * of libcurl may need to pull the initialization out of here. Note
1053 * also that this function is not threadsafe as a result - refer to
1054 * libcurl's API documentation for relevant warnings.
1056 * @sa Matching Term function.
1058 * @param fqdn The API's FQDN or IP address.
1059 * @param port The API's port.
1060 * @param path The optional path (may be NULL).
1061 * @param topic The optional topic part of the URL (may be NULL).
1062 * @param secure Whether to use HTTPS (0=HTTP, 1=HTTPS).
1063 * @param username Username for Basic Authentication of requests.
1064 * @param password Password for Basic Authentication of requests.
1065 * @param source_type The kind of node we represent.
1066 * @param role The role this node undertakes.
1067 * @param verbosity 0 for normal operation, positive values for chattier
1070 * @returns Status code
1071 * @retval EVEL_SUCCESS On success
1072 * @retval ::EVEL_ERR_CODES On failure.
1073 *****************************************************************************/
1074 EVEL_ERR_CODES evel_initialize(const char * const fqdn,
1076 const char * const path,
1077 const char * const topic,
1079 const char * const username,
1080 const char * const password,
1081 EVEL_SOURCE_TYPES source_type,
1082 const char * const role,
1086 /**************************************************************************//**
1087 * Clean up the EVEL library.
1089 * @note that at present don't expect Init/Term cycling not to leak memory!
1091 * @returns Status code
1092 * @retval EVEL_SUCCESS On success
1093 * @retval "One of ::EVEL_ERR_CODES" On failure.
1094 *****************************************************************************/
1095 EVEL_ERR_CODES evel_terminate(void);
1097 EVEL_ERR_CODES evel_post_event(EVENT_HEADER * event);
1098 const char * evel_error_string(void);
1101 /**************************************************************************//**
1104 * Free off the event supplied. Will free all the contained allocated memory.
1106 * @note It is safe to free a NULL pointer.
1107 *****************************************************************************/
1108 void evel_free_event(void * event);
1110 /**************************************************************************//**
1111 * Encode the event as a JSON event object according to AT&T's schema.
1113 * @param json Pointer to where to store the JSON encoded data.
1114 * @param max_size Size of storage available in json_body.
1115 * @param event Pointer to the ::EVENT_HEADER to encode.
1116 * @returns Number of bytes actually written.
1117 *****************************************************************************/
1118 int evel_json_encode_event(char * json,
1120 EVENT_HEADER * event);
1122 /**************************************************************************//**
1123 * Callback function to provide returned data.
1125 * Copy data into the supplied buffer, write_callback::ptr, checking size
1128 * @returns Number of bytes placed into write_callback::ptr. 0 for EOF.
1129 *****************************************************************************/
1130 size_t evel_write_callback(void *contents,
1135 /*****************************************************************************/
1136 /*****************************************************************************/
1138 /* HEARTBEAT - (includes common header, too) */
1140 /*****************************************************************************/
1141 /*****************************************************************************/
1143 /**************************************************************************//**
1144 * Create a new heartbeat event.
1146 * @note that the heartbeat is just a "naked" commonEventHeader!
1148 * @returns pointer to the newly manufactured ::EVENT_HEADER. If the event is
1149 * not used it must be released using ::evel_free_event
1150 * @retval NULL Failed to create the event.
1151 *****************************************************************************/
1152 EVENT_HEADER * evel_new_heartbeat(void);
1154 /**************************************************************************//**
1155 * Free an event header.
1157 * Free off the event header supplied. Will free all the contained allocated
1160 * @note It does not free the header itself, since that may be part of a
1162 *****************************************************************************/
1163 void evel_free_header(EVENT_HEADER * const event);
1165 /**************************************************************************//**
1166 * Initialize a newly created event header.
1168 * @param header Pointer to the header being initialized.
1169 *****************************************************************************/
1170 void evel_init_header(EVENT_HEADER * const header);
1172 /**************************************************************************//**
1173 * Set the Event Type property of the event header.
1175 * @param header Pointer to the ::EVENT_HEADER.
1176 * @param type The Event Type to be set. ASCIIZ string. The caller
1177 * does not need to preserve the value once the function
1179 *****************************************************************************/
1180 void evel_header_type_set(EVENT_HEADER * const header,
1181 const char * const type);
1183 /**************************************************************************//**
1184 * Set the Start Epoch property of the event header.
1186 * @note The Start Epoch defaults to the time of event creation.
1188 * @param header Pointer to the ::EVENT_HEADER.
1189 * @param start_epoch_microsec
1190 * The start epoch to set, in microseconds.
1191 *****************************************************************************/
1192 void evel_start_epoch_set(EVENT_HEADER * const header,
1193 const unsigned long long start_epoch_microsec);
1195 /**************************************************************************//**
1196 * Set the Last Epoch property of the event header.
1198 * @note The Last Epoch defaults to the time of event creation.
1200 * @param header Pointer to the ::EVENT_HEADER.
1201 * @param last_epoch_microsec
1202 * The last epoch to set, in microseconds.
1203 *****************************************************************************/
1204 void evel_last_epoch_set(EVENT_HEADER * const header,
1205 const unsigned long long last_epoch_microsec);
1207 /**************************************************************************//**
1208 * Set the Reporting Entity Name property of the event header.
1210 * @note The Reporting Entity Name defaults to the OpenStack VM Name.
1212 * @param header Pointer to the ::EVENT_HEADER.
1213 * @param entity_name The entity name to set.
1214 *****************************************************************************/
1215 void evel_reporting_entity_name_set(EVENT_HEADER * const header,
1216 const char * const entity_name);
1218 /**************************************************************************//**
1219 * Set the Reporting Entity Id property of the event header.
1221 * @note The Reporting Entity Id defaults to the OpenStack VM UUID.
1223 * @param header Pointer to the ::EVENT_HEADER.
1224 * @param entity_id The entity id to set.
1225 *****************************************************************************/
1226 void evel_reporting_entity_id_set(EVENT_HEADER * const header,
1227 const char * const entity_id);
1229 /*****************************************************************************/
1230 /*****************************************************************************/
1234 /*****************************************************************************/
1235 /*****************************************************************************/
1237 /**************************************************************************//**
1238 * Create a new fault event.
1241 * @returns pointer to the newly manufactured ::EVENT_FAULT. If the event is
1242 * not used it must be released using ::evel_free_fault
1243 * @retval NULL Failed to create the event.
1244 *****************************************************************************/
1245 EVENT_FAULT * evel_new_fault(const char * const condition,
1246 const char * const specific_problem,
1247 EVEL_EVENT_PRIORITIES priority,
1248 EVEL_SEVERITIES severity);
1250 /**************************************************************************//**
1253 * Free off the Fault supplied. Will free all the contained allocated memory.
1255 * @note It does not free the Fault itself, since that may be part of a
1257 *****************************************************************************/
1258 void evel_free_fault(EVENT_FAULT * event);
1261 /**************************************************************************//**
1262 * Set the Alarm Interface A property of the Fault.
1264 * @note The property is treated as immutable: it is only valid to call
1265 * the setter once. However, we don't assert if the caller tries to
1266 * overwrite, just ignoring the update instead.
1268 * @param fault Pointer to the fault.
1269 * @param interface The Alarm Interface A to be set. ASCIIZ string. The caller
1270 * does not need to preserve the value once the function
1272 *****************************************************************************/
1273 void evel_fault_interface_set(EVENT_FAULT * fault,
1274 const char * const interface);
1276 /**************************************************************************//**
1277 * Add an additional value name/value pair to the Fault.
1279 * The name and value are null delimited ASCII strings. The library takes
1280 * a copy so the caller does not have to preserve values after the function
1283 * @param fault Pointer to the fault.
1284 * @param name ASCIIZ string with the attribute's name.
1285 * @param value ASCIIZ string with the attribute's value.
1286 *****************************************************************************/
1287 void evel_fault_addl_info_add(EVENT_FAULT * fault, char * name, char * value);
1289 /**************************************************************************//**
1290 * Set the Event Type property of the Fault.
1292 * @note The property is treated as immutable: it is only valid to call
1293 * the setter once. However, we don't assert if the caller tries to
1294 * overwrite, just ignoring the update instead.
1296 * @param fault Pointer to the fault.
1297 * @param type The Event Type to be set. ASCIIZ string. The caller
1298 * does not need to preserve the value once the function
1300 *****************************************************************************/
1301 void evel_fault_type_set(EVENT_FAULT * fault, const char * const type);
1303 /*****************************************************************************/
1304 /*****************************************************************************/
1308 /*****************************************************************************/
1309 /*****************************************************************************/
1311 /**************************************************************************//**
1312 * Create a new Measurement event.
1314 * @note The mandatory fields on the Measurement must be supplied to this
1315 * factory function and are immutable once set. Optional fields have
1316 * explicit setter functions, but again values may only be set once so
1317 * that the Measurement has immutable properties.
1319 * @param measurement_interval
1321 * @returns pointer to the newly manufactured ::EVENT_MEASUREMENT. If the
1322 * event is not used (i.e. posted) it must be released using
1323 * ::evel_free_event.
1324 * @retval NULL Failed to create the event.
1325 *****************************************************************************/
1326 EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval);
1328 /**************************************************************************//**
1329 * Free a Measurement.
1331 * Free off the Measurement supplied. Will free all the contained allocated
1334 * @note It does not free the Measurement itself, since that may be part of a
1336 *****************************************************************************/
1337 void evel_free_measurement(EVENT_MEASUREMENT * event);
1339 /**************************************************************************//**
1340 * Set the Event Type 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 type The Event Type to be set. ASCIIZ string. The caller
1348 * does not need to preserve the value once the function
1350 *****************************************************************************/
1351 void evel_measurement_type_set(EVENT_MEASUREMENT * measurement,
1352 const char * const type);
1354 /**************************************************************************//**
1355 * Set the Concurrent Sessions property of the Measurement.
1357 * @note The property is treated as immutable: it is only valid to call
1358 * the setter once. However, we don't assert if the caller tries to
1359 * overwrite, just ignoring the update instead.
1361 * @param measurement Pointer to the Measurement.
1362 * @param concurrent_sessions The Concurrent Sessions to be set.
1363 *****************************************************************************/
1364 void evel_measurement_conc_sess_set(EVENT_MEASUREMENT * measurement,
1365 int concurrent_sessions);
1367 /**************************************************************************//**
1368 * Set the Configured Entities property of the Measurement.
1370 * @note The property is treated as immutable: it is only valid to call
1371 * the setter once. However, we don't assert if the caller tries to
1372 * overwrite, just ignoring the update instead.
1374 * @param measurement Pointer to the Measurement.
1375 * @param configured_entities The Configured Entities to be set.
1376 *****************************************************************************/
1377 void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT * measurement,
1378 int configured_entities);
1380 /**************************************************************************//**
1381 * Add an additional set of Errors to the Measurement.
1383 * @note The property is treated as immutable: it is only valid to call
1384 * the setter once. However, we don't assert if the caller tries to
1385 * overwrite, just ignoring the update instead.
1387 * @param measurement Pointer to the measurement.
1388 * @param receive_discards The number of receive discards.
1389 * @param receive_errors The number of receive errors.
1390 * @param transmit_discards The number of transmit discards.
1391 * @param transmit_errors The number of transmit errors.
1392 *****************************************************************************/
1393 void evel_measurement_errors_set(EVENT_MEASUREMENT * measurement,
1394 int receive_discards,
1396 int transmit_discards,
1397 int transmit_errors);
1399 /**************************************************************************//**
1400 * Set the Mean Request Latency property of the Measurement.
1402 * @note The property is treated as immutable: it is only valid to call
1403 * the setter once. However, we don't assert if the caller tries to
1404 * overwrite, just ignoring the update instead.
1406 * @param measurement Pointer to the Measurement.
1407 * @param mean_request_latency The Mean Request Latency to be set.
1408 *****************************************************************************/
1409 void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT * measurement,
1410 double mean_request_latency);
1412 /**************************************************************************//**
1413 * Set the Memory Configured property of the Measurement.
1415 * @note The property is treated as immutable: it is only valid to call
1416 * the setter once. However, we don't assert if the caller tries to
1417 * overwrite, just ignoring the update instead.
1419 * @param measurement Pointer to the Measurement.
1420 * @param memory_configured The Memory Configured to be set.
1421 *****************************************************************************/
1422 void evel_measurement_mem_cfg_set(EVENT_MEASUREMENT * measurement,
1423 double memory_configured);
1425 /**************************************************************************//**
1426 * Set the Memory Used property of the Measurement.
1428 * @note The property is treated as immutable: it is only valid to call
1429 * the setter once. However, we don't assert if the caller tries to
1430 * overwrite, just ignoring the update instead.
1432 * @param measurement Pointer to the Measurement.
1433 * @param memory_used The Memory Used to be set.
1434 *****************************************************************************/
1435 void evel_measurement_mem_used_set(EVENT_MEASUREMENT * measurement,
1436 double memory_used);
1438 /**************************************************************************//**
1439 * Set the Request Rate property of the Measurement.
1441 * @note The property is treated as immutable: it is only valid to call
1442 * the setter once. However, we don't assert if the caller tries to
1443 * overwrite, just ignoring the update instead.
1445 * @param measurement Pointer to the Measurement.
1446 * @param request_rate The Request Rate to be set.
1447 *****************************************************************************/
1448 void evel_measurement_request_rate_set(EVENT_MEASUREMENT * measurement,
1451 /**************************************************************************//**
1452 * Add an additional CPU usage value name/value pair to the Measurement.
1454 * The name and value are null delimited ASCII strings. The library takes
1455 * a copy so the caller does not have to preserve values after the function
1458 * @param measurement Pointer to the measurement.
1459 * @param id ASCIIZ string with the CPU's identifier.
1460 * @param usage CPU utilization.
1461 *****************************************************************************/
1462 void evel_measurement_cpu_use_add(EVENT_MEASUREMENT * measurement,
1463 char * id, double usage);
1465 /**************************************************************************//**
1466 * Add an additional File System usage value name/value pair to the
1469 * The filesystem_name is null delimited ASCII string. The library takes a
1470 * copy so the caller does not have to preserve values after the function
1473 * @param measurement Pointer to the measurement.
1474 * @param filesystem_name ASCIIZ string with the file-system's UUID.
1475 * @param block_configured Block storage configured.
1476 * @param block_used Block storage in use.
1477 * @param block_iops Block storage IOPS.
1478 * @param ephemeral_configured Ephemeral storage configured.
1479 * @param ephemeral_used Ephemeral storage in use.
1480 * @param ephemeral_iops Ephemeral storage IOPS.
1481 *****************************************************************************/
1482 void evel_measurement_fsys_use_add(EVENT_MEASUREMENT * measurement,
1483 char * filesystem_name,
1484 double block_configured,
1487 double ephemeral_configured,
1488 double ephemeral_used,
1489 int ephemeral_iops);
1491 /**************************************************************************//**
1492 * Add a Feature usage 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 feature ASCIIZ string with the feature's name.
1500 * @param utilization Utilization of the feature.
1501 *****************************************************************************/
1502 void evel_measurement_feature_use_add(EVENT_MEASUREMENT * measurement,
1506 /**************************************************************************//**
1507 * Add a Additional Measurement value name/value pair to the Measurement.
1509 * The name is null delimited ASCII string. The library takes
1510 * a copy so the caller does not have to preserve values after the function
1513 * @param measurement Pointer to the Measurement.
1514 * @param group ASCIIZ string with the measurement group's name.
1515 * @param name ASCIIZ string containing the measurement's name.
1516 * @param name ASCIIZ string containing the measurement's value.
1517 *****************************************************************************/
1518 void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT * measurement,
1519 const char * const group,
1520 const char * const name,
1521 const char * const value);
1523 /**************************************************************************//**
1524 * Add a Codec usage value name/value pair to the Measurement.
1526 * The name is null delimited ASCII string. The library takes
1527 * a copy so the caller does not have to preserve values after the function
1530 * @param measurement Pointer to the measurement.
1531 * @param codec ASCIIZ string with the codec's name.
1532 * @param utilization Utilization of the feature.
1533 *****************************************************************************/
1534 void evel_measurement_codec_use_add(EVENT_MEASUREMENT * measurement,
1538 /**************************************************************************//**
1540 * Set the Aggregate CPU Use property of the Measurement.
1542 * @note The property is treated as immutable: it is only valid to call
1543 * the setter once. However, we don't assert if the caller tries to
1544 * overwrite, just ignoring the update instead.
1546 * @param measurement Pointer to the measurement.
1547 * @param cpu_use The CPU use to set.
1548 *****************************************************************************/
1549 void evel_measurement_agg_cpu_use_set(EVENT_MEASUREMENT * measurement,
1552 /**************************************************************************//**
1553 * Set the Media Ports in Use property of the Measurement.
1555 * @note The property is treated as immutable: it is only valid to call
1556 * the setter once. However, we don't assert if the caller tries to
1557 * overwrite, just ignoring the update instead.
1559 * @param measurement Pointer to the measurement.
1560 * @param media_ports_in_use The media port usage to set.
1561 *****************************************************************************/
1562 void evel_measurement_media_port_use_set(EVENT_MEASUREMENT * measurement,
1563 int media_ports_in_use);
1565 /**************************************************************************//**
1566 * Set the VNFC Scaling Metric property of the Measurement.
1568 * @note The property is treated as immutable: it is only valid to call
1569 * the setter once. However, we don't assert if the caller tries to
1570 * overwrite, just ignoring the update instead.
1572 * @param measurement Pointer to the measurement.
1573 * @param scaling_metric The scaling metric to set.
1574 *****************************************************************************/
1575 void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT * measurement,
1576 double scaling_metric);
1578 /**************************************************************************//**
1579 * Create a new Latency Bucket to be added to a Measurement event.
1581 * @note The mandatory fields on the ::MEASUREMENT_LATENCY_BUCKET must be
1582 * supplied to this factory function and are immutable once set.
1583 * Optional fields have explicit setter functions, but again values
1584 * may only be set once so that the ::MEASUREMENT_LATENCY_BUCKET has
1585 * immutable properties.
1587 * @param count Count of events in this bucket.
1589 * @returns pointer to the newly manufactured ::MEASUREMENT_LATENCY_BUCKET.
1590 * @retval NULL Failed to create the Latency Bucket.
1591 *****************************************************************************/
1592 MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count);
1594 /**************************************************************************//**
1595 * Set the High End property of the Measurement Latency Bucket.
1597 * @note The property is treated as immutable: it is only valid to call
1598 * the setter once. However, we don't assert if the caller tries to
1599 * overwrite, just ignoring the update instead.
1601 * @param bucket Pointer to the Measurement Latency Bucket.
1602 * @param high_end High end of the bucket's range.
1603 *****************************************************************************/
1604 void evel_meas_latency_bucket_high_end_set(
1605 MEASUREMENT_LATENCY_BUCKET * const bucket,
1606 const double high_end);
1608 /**************************************************************************//**
1609 * Set the Low End property of the Measurement Latency Bucket.
1611 * @note The property is treated as immutable: it is only valid to call
1612 * the setter once. However, we don't assert if the caller tries to
1613 * overwrite, just ignoring the update instead.
1615 * @param bucket Pointer to the Measurement Latency Bucket.
1616 * @param low_end Low end of the bucket's range.
1617 *****************************************************************************/
1618 void evel_meas_latency_bucket_low_end_set(
1619 MEASUREMENT_LATENCY_BUCKET * const bucket,
1620 const double low_end);
1622 /**************************************************************************//**
1623 * Add an additional Measurement Latency Bucket to the specified event.
1625 * @param measurement Pointer to the Measurement event.
1626 * @param bucket Pointer to the Measurement Latency Bucket to add.
1627 *****************************************************************************/
1628 void evel_meas_latency_bucket_add(EVENT_MEASUREMENT * const measurement,
1629 MEASUREMENT_LATENCY_BUCKET * const bucket);
1631 /**************************************************************************//**
1632 * Add an additional Latency Distribution bucket to the Measurement.
1634 * This function implements the previous API, purely for convenience.
1636 * @param measurement Pointer to the measurement.
1637 * @param low_end Low end of the bucket's range.
1638 * @param high_end High end of the bucket's range.
1639 * @param count Count of events in this bucket.
1640 *****************************************************************************/
1641 void evel_measurement_latency_add(EVENT_MEASUREMENT * const measurement,
1642 const double low_end,
1643 const double high_end,
1646 /**************************************************************************//**
1647 * Create a new vNIC Use to be added to a Measurement event.
1649 * @note The mandatory fields on the ::MEASUREMENT_VNIC_USE must be supplied
1650 * to this factory function and are immutable once set. Optional
1651 * fields have explicit setter functions, but again values may only be
1652 * set once so that the ::MEASUREMENT_VNIC_USE has immutable
1655 * @param vnic_id ASCIIZ string with the vNIC's ID.
1656 * @param packets_in Total packets received.
1657 * @param packets_out Total packets transmitted.
1658 * @param bytes_in Total bytes received.
1659 * @param bytes_out Total bytes transmitted.
1661 * @returns pointer to the newly manufactured ::MEASUREMENT_VNIC_USE.
1662 * If the structure is not used it must be released using
1663 * ::evel_free_measurement_vnic_use.
1664 * @retval NULL Failed to create the vNIC Use.
1665 *****************************************************************************/
1666 MEASUREMENT_VNIC_USE * evel_new_measurement_vnic_use(char * const vnic_id,
1667 const int packets_in,
1668 const int packets_out,
1670 const int bytes_out);
1672 /**************************************************************************//**
1675 * Free off the ::MEASUREMENT_VNIC_USE supplied. Will free all the contained
1678 * @note It does not free the vNIC Use itself, since that may be part of a
1680 *****************************************************************************/
1681 void evel_free_measurement_vnic_use(MEASUREMENT_VNIC_USE * const vnic_use);
1683 /**************************************************************************//**
1684 * Set the Broadcast Packets Received property of the vNIC Use.
1686 * @note The property is treated as immutable: it is only valid to call
1687 * the setter once. However, we don't assert if the caller tries to
1688 * overwrite, just ignoring the update instead.
1690 * @param vnic_use Pointer to the vNIC Use.
1691 * @param broadcast_packets_in
1692 * Broadcast packets received.
1693 *****************************************************************************/
1694 void evel_vnic_use_bcast_pkt_in_set(MEASUREMENT_VNIC_USE * const vnic_use,
1695 const int broadcast_packets_in);
1697 /**************************************************************************//**
1698 * Set the Broadcast Packets Transmitted property of the vNIC Use.
1700 * @note The property is treated as immutable: it is only valid to call
1701 * the setter once. However, we don't assert if the caller tries to
1702 * overwrite, just ignoring the update instead.
1704 * @param vnic_use Pointer to the vNIC Use.
1705 * @param broadcast_packets_out
1706 * Broadcast packets transmitted.
1707 *****************************************************************************/
1708 void evel_vnic_use_bcast_pkt_out_set(MEASUREMENT_VNIC_USE * const vnic_use,
1709 const int broadcast_packets_out);
1711 /**************************************************************************//**
1712 * Set the Multicast Packets Received property of the vNIC Use.
1714 * @note The property is treated as immutable: it is only valid to call
1715 * the setter once. However, we don't assert if the caller tries to
1716 * overwrite, just ignoring the update instead.
1718 * @param vnic_use Pointer to the vNIC Use.
1719 * @param multicast_packets_in
1720 * Multicast packets received.
1721 *****************************************************************************/
1722 void evel_vnic_use_mcast_pkt_in_set(MEASUREMENT_VNIC_USE * const vnic_use,
1723 const int multicast_packets_in);
1725 /**************************************************************************//**
1726 * Set the Multicast Packets Transmitted property of the vNIC Use.
1728 * @note The property is treated as immutable: it is only valid to call
1729 * the setter once. However, we don't assert if the caller tries to
1730 * overwrite, just ignoring the update instead.
1732 * @param vnic_use Pointer to the vNIC Use.
1733 * @param multicast_packets_out
1734 * Multicast packets transmitted.
1735 *****************************************************************************/
1736 void evel_vnic_use_mcast_pkt_out_set(MEASUREMENT_VNIC_USE * const vnic_use,
1737 const int multicast_packets_out);
1739 /**************************************************************************//**
1740 * Set the Unicast Packets Received property of the vNIC Use.
1742 * @note The property is treated as immutable: it is only valid to call
1743 * the setter once. However, we don't assert if the caller tries to
1744 * overwrite, just ignoring the update instead.
1746 * @param vnic_use Pointer to the vNIC Use.
1747 * @param unicast_packets_in
1748 * Unicast packets received.
1749 *****************************************************************************/
1750 void evel_vnic_use_ucast_pkt_in_set(MEASUREMENT_VNIC_USE * const vnic_use,
1751 const int unicast_packets_in);
1753 /**************************************************************************//**
1754 * Set the Unicast Packets Transmitted property of the vNIC Use.
1756 * @note The property is treated as immutable: it is only valid to call
1757 * the setter once. However, we don't assert if the caller tries to
1758 * overwrite, just ignoring the update instead.
1760 * @param vnic_use Pointer to the vNIC Use.
1761 * @param unicast_packets_out
1762 * Unicast packets transmitted.
1763 *****************************************************************************/
1764 void evel_vnic_use_ucast_pkt_out_set(MEASUREMENT_VNIC_USE * const vnic_use,
1765 const int unicast_packets_out);
1767 /**************************************************************************//**
1768 * Add an additional vNIC Use to the specified Measurement event.
1770 * @param measurement Pointer to the measurement.
1771 * @param vnic_use Pointer to the vNIC Use to add.
1772 *****************************************************************************/
1773 void evel_meas_vnic_use_add(EVENT_MEASUREMENT * const measurement,
1774 MEASUREMENT_VNIC_USE * const vnic_use);
1776 /**************************************************************************//**
1777 * Add an additional vNIC usage record Measurement.
1779 * This function implements the previous API, purely for convenience.
1781 * The ID is null delimited ASCII string. The library takes a copy so the
1782 * caller does not have to preserve values after the function returns.
1784 * @param measurement Pointer to the measurement.
1785 * @param vnic_id ASCIIZ string with the vNIC's ID.
1786 * @param packets_in Total packets received.
1787 * @param packets_out Total packets transmitted.
1788 * @param broadcast_packets_in Broadcast packets received.
1789 * @param broadcast_packets_out Broadcast packets transmitted.
1790 * @param bytes_in Total bytes received.
1791 * @param bytes_out Total bytes transmitted.
1792 * @param multicast_packets_in Multicast packets received.
1793 * @param multicast_packets_out Multicast packets transmitted.
1794 * @param unicast_packets_in Unicast packets received.
1795 * @param unicast_packets_out Unicast packets transmitted.
1796 *****************************************************************************/
1797 void evel_measurement_vnic_use_add(EVENT_MEASUREMENT * const measurement,
1798 char * const vnic_id,
1799 const int packets_in,
1800 const int packets_out,
1801 const int broadcast_packets_in,
1802 const int broadcast_packets_out,
1804 const int bytes_out,
1805 const int multicast_packets_in,
1806 const int multicast_packets_out,
1807 const int unicast_packets_in,
1808 const int unicast_packets_out);
1810 /*****************************************************************************/
1811 /*****************************************************************************/
1815 /*****************************************************************************/
1816 /*****************************************************************************/
1818 /**************************************************************************//**
1819 * Create a new Report event.
1821 * @note The mandatory fields on the Report must be supplied to this
1822 * factory function and are immutable once set. Optional fields have
1823 * explicit setter functions, but again values may only be set once so
1824 * that the Report has immutable properties.
1826 * @param measurement_interval
1828 * @returns pointer to the newly manufactured ::EVENT_REPORT. If the event is
1829 * not used (i.e. posted) it must be released using
1830 * ::evel_free_report.
1831 * @retval NULL Failed to create the event.
1832 *****************************************************************************/
1833 EVENT_REPORT * evel_new_report(double measurement_interval);
1835 /**************************************************************************//**
1838 * Free off the Report supplied. Will free all the contained allocated memory.
1840 * @note It does not free the Report itself, since that may be part of a
1842 *****************************************************************************/
1843 void evel_free_report(EVENT_REPORT * event);
1845 /**************************************************************************//**
1846 * Set the Event Type property of the Report.
1848 * @note The property is treated as immutable: it is only valid to call
1849 * the setter once. However, we don't assert if the caller tries to
1850 * overwrite, just ignoring the update instead.
1852 * @param report Pointer to the Report.
1853 * @param type The Event Type to be set. ASCIIZ string. The caller
1854 * does not need to preserve the value once the function
1856 *****************************************************************************/
1857 void evel_report_type_set(EVENT_REPORT * report, const char * const type);
1859 /**************************************************************************//**
1860 * Add a Feature usage 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 feature ASCIIZ string with the feature's name.
1868 * @param utilization Utilization of the feature.
1869 *****************************************************************************/
1870 void evel_report_feature_use_add(EVENT_REPORT * report,
1874 /**************************************************************************//**
1875 * Add a Additional Measurement value name/value pair to the Report.
1877 * The name is null delimited ASCII string. The library takes
1878 * a copy so the caller does not have to preserve values after the function
1881 * @param report Pointer to the report.
1882 * @param group ASCIIZ string with the measurement group's name.
1883 * @param name ASCIIZ string containing the measurement's name.
1884 * @param value ASCIIZ string containing the measurement's value.
1885 *****************************************************************************/
1886 void evel_report_custom_measurement_add(EVENT_REPORT * report,
1887 const char * const group,
1888 const char * const name,
1889 const char * const value);
1891 /*****************************************************************************/
1892 /*****************************************************************************/
1896 /*****************************************************************************/
1897 /*****************************************************************************/
1899 /**************************************************************************//**
1900 * Create a new Mobile Flow event.
1902 * @note The mandatory fields on the Mobile Flow must be supplied to this
1903 * factory function and are immutable once set. Optional fields have
1904 * explicit setter functions, but again values may only be set once so
1905 * that the Mobile Flow has immutable properties.
1907 * @param flow_direction
1908 * @param gtp_per_flow_metrics
1909 * @param ip_protocol_type
1911 * @param other_endpoint_ip_address
1912 * @param other_endpoint_port
1913 * @param reporting_endpoint_ip_addr
1914 * @param reporting_endpoint_port
1916 * @returns pointer to the newly manufactured ::EVENT_MOBILE_FLOW. If the
1917 * event is not used (i.e. posted) it must be released using
1918 * ::evel_free_mobile_flow.
1919 * @retval NULL Failed to create the event.
1920 *****************************************************************************/
1921 EVENT_MOBILE_FLOW * evel_new_mobile_flow(
1922 const char * const flow_direction,
1923 MOBILE_GTP_PER_FLOW_METRICS * gtp_per_flow_metrics,
1924 const char * const ip_protocol_type,
1925 const char * const ip_version,
1926 const char * const other_endpoint_ip_address,
1927 int other_endpoint_port,
1928 const char * const reporting_endpoint_ip_addr,
1929 int reporting_endpoint_port);
1931 /**************************************************************************//**
1932 * Free a Mobile Flow.
1934 * Free off the Mobile Flow supplied. Will free all the contained allocated
1937 * @note It does not free the Mobile Flow itself, since that may be part of a
1939 *****************************************************************************/
1940 void evel_free_mobile_flow(EVENT_MOBILE_FLOW * event);
1942 /**************************************************************************//**
1943 * Set the Event 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 Event 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_type_set(EVENT_MOBILE_FLOW * mobile_flow,
1955 const char * const type);
1957 /**************************************************************************//**
1958 * Set the Application 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 Type to be set. ASCIIZ string. The caller
1966 * does not need to preserve the value once the function
1968 *****************************************************************************/
1969 void evel_mobile_flow_app_type_set(EVENT_MOBILE_FLOW * mobile_flow,
1970 const char * const type);
1972 /**************************************************************************//**
1973 * Set the Application Protocol Type 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 type The Application Protocol Type to be set. ASCIIZ string.
1981 * The caller does not need to preserve the value once the
1983 *****************************************************************************/
1984 void evel_mobile_flow_app_prot_type_set(EVENT_MOBILE_FLOW * mobile_flow,
1985 const char * const type);
1987 /**************************************************************************//**
1988 * Set the Application Protocol Version 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 version The Application Protocol Version to be set. ASCIIZ
1996 * string. The caller does not need to preserve the value
1997 * once the function returns.
1998 *****************************************************************************/
1999 void evel_mobile_flow_app_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2000 const char * const version);
2002 /**************************************************************************//**
2003 * Set the CID property of the Mobile Flow.
2005 * @note The property is treated as immutable: it is only valid to call
2006 * the setter once. However, we don't assert if the caller tries to
2007 * overwrite, just ignoring the update instead.
2009 * @param mobile_flow Pointer to the Mobile Flow.
2010 * @param cid The CID to be set. ASCIIZ string. The caller does not
2011 * need to preserve the value once the function returns.
2012 *****************************************************************************/
2013 void evel_mobile_flow_cid_set(EVENT_MOBILE_FLOW * mobile_flow,
2014 const char * const cid);
2016 /**************************************************************************//**
2017 * Set the Connection Type 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 type The Connection Type to be set. ASCIIZ string. The caller
2025 * does not need to preserve the value once the function
2027 *****************************************************************************/
2028 void evel_mobile_flow_con_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2029 const char * const type);
2031 /**************************************************************************//**
2032 * Set the ECGI property of the Mobile Flow.
2034 * @note The property is treated as immutable: it is only valid to call
2035 * the setter once. However, we don't assert if the caller tries to
2036 * overwrite, just ignoring the update instead.
2038 * @param mobile_flow Pointer to the Mobile Flow.
2039 * @param ecgi The ECGI to be set. ASCIIZ string. The caller does not
2040 * need to preserve the value once the function returns.
2041 *****************************************************************************/
2042 void evel_mobile_flow_ecgi_set(EVENT_MOBILE_FLOW * mobile_flow,
2043 const char * const ecgi);
2045 /**************************************************************************//**
2046 * Set the GTP Protocol Type 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 type The GTP Protocol Type 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_type_set(EVENT_MOBILE_FLOW * mobile_flow,
2058 const char * const type);
2060 /**************************************************************************//**
2061 * Set the GTP Protocol Version 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 version The GTP Protocol Version to be set. ASCIIZ string. The
2069 * caller does not need to preserve the value once the
2071 *****************************************************************************/
2072 void evel_mobile_flow_gtp_prot_ver_set(EVENT_MOBILE_FLOW * mobile_flow,
2073 const char * const version);
2075 /**************************************************************************//**
2076 * Set the HTTP Header property of the Mobile Flow.
2078 * @note The property is treated as immutable: it is only valid to call
2079 * the setter once. However, we don't assert if the caller tries to
2080 * overwrite, just ignoring the update instead.
2082 * @param mobile_flow Pointer to the Mobile Flow.
2083 * @param header The HTTP header to be set. ASCIIZ string. The caller does
2084 * not need to preserve the value once the function returns.
2085 *****************************************************************************/
2086 void evel_mobile_flow_http_header_set(EVENT_MOBILE_FLOW * mobile_flow,
2087 const char * const header);
2089 /**************************************************************************//**
2090 * Set the IMEI property of the Mobile Flow.
2092 * @note The property is treated as immutable: it is only valid to call
2093 * the setter once. However, we don't assert if the caller tries to
2094 * overwrite, just ignoring the update instead.
2096 * @param mobile_flow Pointer to the Mobile Flow.
2097 * @param imei The IMEI to be set. ASCIIZ string. The caller does not
2098 * need to preserve the value once the function returns.
2099 *****************************************************************************/
2100 void evel_mobile_flow_imei_set(EVENT_MOBILE_FLOW * mobile_flow,
2101 const char * const imei);
2103 /**************************************************************************//**
2104 * Set the IMSI property of the Mobile Flow.
2106 * @note The property is treated as immutable: it is only valid to call
2107 * the setter once. However, we don't assert if the caller tries to
2108 * overwrite, just ignoring the update instead.
2110 * @param mobile_flow Pointer to the Mobile Flow.
2111 * @param imsi The IMSI to be set. ASCIIZ string. The caller does not
2112 * need to preserve the value once the function returns.
2113 *****************************************************************************/
2114 void evel_mobile_flow_imsi_set(EVENT_MOBILE_FLOW * mobile_flow,
2115 const char * const imsi);
2117 /**************************************************************************//**
2118 * Set the LAC property of the Mobile Flow.
2120 * @note The property is treated as immutable: it is only valid to call
2121 * the setter once. However, we don't assert if the caller tries to
2122 * overwrite, just ignoring the update instead.
2124 * @param mobile_flow Pointer to the Mobile Flow.
2125 * @param lac The LAC to be set. ASCIIZ string. The caller does not
2126 * need to preserve the value once the function returns.
2127 *****************************************************************************/
2128 void evel_mobile_flow_lac_set(EVENT_MOBILE_FLOW * mobile_flow,
2129 const char * const lac);
2131 /**************************************************************************//**
2132 * Set the MCC property of the Mobile Flow.
2134 * @note The property is treated as immutable: it is only valid to call
2135 * the setter once. However, we don't assert if the caller tries to
2136 * overwrite, just ignoring the update instead.
2138 * @param mobile_flow Pointer to the Mobile Flow.
2139 * @param mcc The MCC to be set. ASCIIZ string. The caller does not
2140 * need to preserve the value once the function returns.
2141 *****************************************************************************/
2142 void evel_mobile_flow_mcc_set(EVENT_MOBILE_FLOW * mobile_flow,
2143 const char * const mcc);
2145 /**************************************************************************//**
2146 * Set the MNC property of the Mobile Flow.
2148 * @note The property is treated as immutable: it is only valid to call
2149 * the setter once. However, we don't assert if the caller tries to
2150 * overwrite, just ignoring the update instead.
2152 * @param mobile_flow Pointer to the Mobile Flow.
2153 * @param mnc The MNC to be set. ASCIIZ string. The caller does not
2154 * need to preserve the value once the function returns.
2155 *****************************************************************************/
2156 void evel_mobile_flow_mnc_set(EVENT_MOBILE_FLOW * mobile_flow,
2157 const char * const mnc);
2159 /**************************************************************************//**
2160 * Set the MSISDN property of the Mobile Flow.
2162 * @note The property is treated as immutable: it is only valid to call
2163 * the setter once. However, we don't assert if the caller tries to
2164 * overwrite, just ignoring the update instead.
2166 * @param mobile_flow Pointer to the Mobile Flow.
2167 * @param msisdn The MSISDN to be set. ASCIIZ string. The caller does not
2168 * need to preserve the value once the function returns.
2169 *****************************************************************************/
2170 void evel_mobile_flow_msisdn_set(EVENT_MOBILE_FLOW * mobile_flow,
2171 const char * const msisdn);
2173 /**************************************************************************//**
2174 * Set the Other Functional Role 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 role The Other Functional Role to be set. ASCIIZ string. The
2182 * caller does not need to preserve the value once the
2184 *****************************************************************************/
2185 void evel_mobile_flow_other_func_role_set(EVENT_MOBILE_FLOW * mobile_flow,
2186 const char * const role);
2188 /**************************************************************************//**
2189 * Set the RAC property of the Mobile Flow.
2191 * @note The property is treated as immutable: it is only valid to call
2192 * the setter once. However, we don't assert if the caller tries to
2193 * overwrite, just ignoring the update instead.
2195 * @param mobile_flow Pointer to the Mobile Flow.
2196 * @param rac The RAC to be set. ASCIIZ string. The caller does not
2197 * need to preserve the value once the function returns.
2198 *****************************************************************************/
2199 void evel_mobile_flow_rac_set(EVENT_MOBILE_FLOW * mobile_flow,
2200 const char * const rac);
2202 /**************************************************************************//**
2203 * Set the Radio Access Technology 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 tech The Radio Access Technology to be set. ASCIIZ string. The
2211 * caller does not need to preserve the value once the
2213 *****************************************************************************/
2214 void evel_mobile_flow_radio_acc_tech_set(EVENT_MOBILE_FLOW * mobile_flow,
2215 const char * const tech);
2217 /**************************************************************************//**
2218 * Set the SAC property of the Mobile Flow.
2220 * @note The property is treated as immutable: it is only valid to call
2221 * the setter once. However, we don't assert if the caller tries to
2222 * overwrite, just ignoring the update instead.
2224 * @param mobile_flow Pointer to the Mobile Flow.
2225 * @param sac The SAC to be set. ASCIIZ string. The caller does not
2226 * need to preserve the value once the function returns.
2227 *****************************************************************************/
2228 void evel_mobile_flow_sac_set(EVENT_MOBILE_FLOW * mobile_flow,
2229 const char * const sac);
2231 /**************************************************************************//**
2232 * Set the Sampling Algorithm property of the Mobile Flow.
2234 * @note The property is treated as immutable: it is only valid to call
2235 * the setter once. However, we don't assert if the caller tries to
2236 * overwrite, just ignoring the update instead.
2238 * @param mobile_flow Pointer to the Mobile Flow.
2239 * @param algorithm The Sampling Algorithm to be set.
2240 *****************************************************************************/
2241 void evel_mobile_flow_samp_alg_set(EVENT_MOBILE_FLOW * mobile_flow,
2244 /**************************************************************************//**
2245 * Set the TAC property of the Mobile Flow.
2247 * @note The property is treated as immutable: it is only valid to call
2248 * the setter once. However, we don't assert if the caller tries to
2249 * overwrite, just ignoring the update instead.
2251 * @param mobile_flow Pointer to the Mobile Flow.
2252 * @param tac The TAC to be set. ASCIIZ string. The caller does not
2253 * need to preserve the value once the function returns.
2254 *****************************************************************************/
2255 void evel_mobile_flow_tac_set(EVENT_MOBILE_FLOW * mobile_flow,
2256 const char * const tac);
2258 /**************************************************************************//**
2259 * Set the Tunnel ID property of the Mobile Flow.
2261 * @note The property is treated as immutable: it is only valid to call
2262 * the setter once. However, we don't assert if the caller tries to
2263 * overwrite, just ignoring the update instead.
2265 * @param mobile_flow Pointer to the Mobile Flow.
2266 * @param tunnel_id The Tunnel ID to be set. ASCIIZ string. The caller does
2267 * not need to preserve the value once the function returns.
2268 *****************************************************************************/
2269 void evel_mobile_flow_tunnel_id_set(EVENT_MOBILE_FLOW * mobile_flow,
2270 const char * const tunnel_id);
2272 /**************************************************************************//**
2273 * Set the VLAN ID property of the Mobile Flow.
2275 * @note The property is treated as immutable: it is only valid to call
2276 * the setter once. However, we don't assert if the caller tries to
2277 * overwrite, just ignoring the update instead.
2279 * @param mobile_flow Pointer to the Mobile Flow.
2280 * @param vlan_id The VLAN ID to be set. ASCIIZ string. The caller does
2281 * not need to preserve the value once the function returns.
2282 *****************************************************************************/
2283 void evel_mobile_flow_vlan_id_set(EVENT_MOBILE_FLOW * mobile_flow,
2284 const char * const vlan_id);
2286 /**************************************************************************//**
2287 * Create a new Mobile GTP Per Flow Metrics.
2289 * @note The mandatory fields on the Mobile GTP Per Flow Metrics must be
2290 * supplied to this factory function and are immutable once set.
2291 * Optional fields have explicit setter functions, but again values
2292 * may only be set once so that the Mobile GTP Per Flow Metrics has
2293 * immutable properties.
2295 * @param avg_bit_error_rate
2296 * @param avg_packet_delay_variation
2297 * @param avg_packet_latency
2298 * @param avg_receive_throughput
2299 * @param avg_transmit_throughput
2300 * @param flow_activation_epoch
2301 * @param flow_activation_microsec
2302 * @param flow_deactivation_epoch
2303 * @param flow_deactivation_microsec
2304 * @param flow_deactivation_time
2305 * @param flow_status
2306 * @param max_packet_delay_variation
2307 * @param num_activation_failures
2308 * @param num_bit_errors
2309 * @param num_bytes_received
2310 * @param num_bytes_transmitted
2311 * @param num_dropped_packets
2312 * @param num_l7_bytes_received
2313 * @param num_l7_bytes_transmitted
2314 * @param num_lost_packets
2315 * @param num_out_of_order_packets
2316 * @param num_packet_errors
2317 * @param num_packets_received_excl_retrans
2318 * @param num_packets_received_incl_retrans
2319 * @param num_packets_transmitted_incl_retrans
2320 * @param num_retries
2321 * @param num_timeouts
2322 * @param num_tunneled_l7_bytes_received
2323 * @param round_trip_time
2324 * @param time_to_first_byte
2326 * @returns pointer to the newly manufactured ::MOBILE_GTP_PER_FLOW_METRICS.
2327 * If the structure is not used it must be released using
2328 * ::evel_free_mobile_gtp_flow_metrics.
2329 * @retval NULL Failed to create the event.
2330 *****************************************************************************/
2331 MOBILE_GTP_PER_FLOW_METRICS * evel_new_mobile_gtp_flow_metrics(
2332 double avg_bit_error_rate,
2333 double avg_packet_delay_variation,
2334 int avg_packet_latency,
2335 int avg_receive_throughput,
2336 int avg_transmit_throughput,
2337 int flow_activation_epoch,
2338 int flow_activation_microsec,
2339 int flow_deactivation_epoch,
2340 int flow_deactivation_microsec,
2341 time_t flow_deactivation_time,
2342 const char * const flow_status,
2343 int max_packet_delay_variation,
2344 int num_activation_failures,
2346 int num_bytes_received,
2347 int num_bytes_transmitted,
2348 int num_dropped_packets,
2349 int num_l7_bytes_received,
2350 int num_l7_bytes_transmitted,
2351 int num_lost_packets,
2352 int num_out_of_order_packets,
2353 int num_packet_errors,
2354 int num_packets_received_excl_retrans,
2355 int num_packets_received_incl_retrans,
2356 int num_packets_transmitted_incl_retrans,
2359 int num_tunneled_l7_bytes_received,
2360 int round_trip_time,
2361 int time_to_first_byte);
2363 /**************************************************************************//**
2364 * Free a Mobile GTP Per Flow Metrics.
2366 * Free off the Mobile GTP Per Flow Metrics supplied. Will free all the
2367 * contained allocated memory.
2369 * @note It does not free the Mobile GTP Per Flow Metrics itself, since that
2370 * may be part of a larger structure.
2371 *****************************************************************************/
2372 void evel_free_mobile_gtp_flow_metrics(MOBILE_GTP_PER_FLOW_METRICS * metrics);
2374 /**************************************************************************//**
2375 * Set the Duration of Connection Failed Status property of the Mobile GTP Per
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 Connection Failed Status to be set.
2384 *****************************************************************************/
2385 void evel_mobile_gtp_metrics_dur_con_fail_set(
2386 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2389 /**************************************************************************//**
2390 * Set the Duration of Tunnel Failed Status property of the Mobile GTP Per Flow
2393 * @note The property is treated as immutable: it is only valid to call
2394 * the setter once. However, we don't assert if the caller tries to
2395 * overwrite, just ignoring the update instead.
2397 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2398 * @param duration The Duration of Tunnel Failed Status to be set.
2399 *****************************************************************************/
2400 void evel_mobile_gtp_metrics_dur_tun_fail_set(
2401 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2404 /**************************************************************************//**
2405 * Set the Activated By 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_by The Activated By 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_by_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
2417 const char * const act_by);
2419 /**************************************************************************//**
2420 * Set the Activation Time property of the Mobile GTP Per Flow metrics.
2422 * @note The property is treated as immutable: it is only valid to call
2423 * the setter once. However, we don't assert if the caller tries to
2424 * overwrite, just ignoring the update instead.
2426 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2427 * @param act_time The Activation Time to be set. ASCIIZ string. The caller
2428 * does not need to preserve the value once the function
2430 *****************************************************************************/
2431 void evel_mobile_gtp_metrics_act_time_set(
2432 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2435 /**************************************************************************//**
2436 * Set the Deactivated By property of the Mobile GTP Per Flow metrics.
2438 * @note The property is treated as immutable: it is only valid to call
2439 * the setter once. However, we don't assert if the caller tries to
2440 * overwrite, just ignoring the update instead.
2442 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2443 * @param deact_by The Deactivated By to be set. ASCIIZ string. The caller
2444 * does not need to preserve the value once the function
2446 *****************************************************************************/
2447 void evel_mobile_gtp_metrics_deact_by_set(
2448 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2449 const char * const deact_by);
2451 /**************************************************************************//**
2452 * Set the GTP Connection Status property of the Mobile GTP Per Flow metrics.
2454 * @note The property is treated as immutable: it is only valid to call
2455 * the setter once. However, we don't assert if the caller tries to
2456 * overwrite, just ignoring the update instead.
2458 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2459 * @param status The GTP Connection Status to be set. ASCIIZ string. The
2460 * caller does not need to preserve the value once the
2462 *****************************************************************************/
2463 void evel_mobile_gtp_metrics_con_status_set(
2464 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2465 const char * const status);
2467 /**************************************************************************//**
2468 * Set the GTP Tunnel Status property of the Mobile GTP Per Flow metrics.
2470 * @note The property is treated as immutable: it is only valid to call
2471 * the setter once. However, we don't assert if the caller tries to
2472 * overwrite, just ignoring the update instead.
2474 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2475 * @param status The GTP Tunnel Status to be set. ASCIIZ string. The
2476 * caller does not need to preserve the value once the
2478 *****************************************************************************/
2479 void evel_mobile_gtp_metrics_tun_status_set(
2480 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2481 const char * const status);
2483 /**************************************************************************//**
2484 * Set an IP Type-of-Service count property of the Mobile GTP Per Flow metrics.
2486 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2487 * @param index The index of the IP Type-of-Service.
2488 * @param count The count.
2489 *****************************************************************************/
2490 void evel_mobile_gtp_metrics_iptos_set(MOBILE_GTP_PER_FLOW_METRICS * metrics,
2494 /**************************************************************************//**
2495 * Set the Large Packet Round-Trip Time property of the Mobile GTP Per Flow
2498 * @note The property is treated as immutable: it is only valid to call
2499 * the setter once. However, we don't assert if the caller tries to
2500 * overwrite, just ignoring the update instead.
2502 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2503 * @param rtt The Large Packet Round-Trip Time to be set.
2504 *****************************************************************************/
2505 void evel_mobile_gtp_metrics_large_pkt_rtt_set(
2506 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2509 /**************************************************************************//**
2510 * Set the Large Packet Threshold property of the Mobile GTP Per Flow Metrics.
2512 * @note The property is treated as immutable: it is only valid to call
2513 * the setter once. However, we don't assert if the caller tries to
2514 * overwrite, just ignoring the update instead.
2516 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2517 * @param threshold The Large Packet Threshold to be set.
2518 *****************************************************************************/
2519 void evel_mobile_gtp_metrics_large_pkt_thresh_set(
2520 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2523 /**************************************************************************//**
2524 * Set the Max Receive Bit Rate property of the Mobile GTP Per Flow Metrics.
2526 * @note The property is treated as immutable: it is only valid to call
2527 * the setter once. However, we don't assert if the caller tries to
2528 * overwrite, just ignoring the update instead.
2530 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2531 * @param rate The Max Receive Bit Rate to be set.
2532 *****************************************************************************/
2533 void evel_mobile_gtp_metrics_max_rcv_bit_rate_set(
2534 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2537 /**************************************************************************//**
2538 * Set the Max Transmit Bit Rate property of the Mobile GTP Per Flow Metrics.
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 rate The Max Transmit Bit Rate to be set.
2546 *****************************************************************************/
2547 void evel_mobile_gtp_metrics_max_trx_bit_rate_set(
2548 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2551 /**************************************************************************//**
2552 * Set the Number of GTP Echo Failures 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 Echo Failures to be set.
2561 *****************************************************************************/
2562 void evel_mobile_gtp_metrics_num_echo_fail_set(
2563 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2566 /**************************************************************************//**
2567 * Set the Number of GTP Tunnel Errors property of the Mobile GTP Per Flow
2570 * @note The property is treated as immutable: it is only valid to call
2571 * the setter once. However, we don't assert if the caller tries to
2572 * overwrite, just ignoring the update instead.
2574 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2575 * @param num The Number of GTP Tunnel Errors to be set.
2576 *****************************************************************************/
2577 void evel_mobile_gtp_metrics_num_tun_fail_set(
2578 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2581 /**************************************************************************//**
2582 * Set the Number of HTTP Errors property of the Mobile GTP Per Flow Metrics.
2584 * @note The property is treated as immutable: it is only valid to call
2585 * the setter once. However, we don't assert if the caller tries to
2586 * overwrite, just ignoring the update instead.
2588 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2589 * @param num The Number of HTTP Errors to be set.
2590 *****************************************************************************/
2591 void evel_mobile_gtp_metrics_num_http_errors_set(
2592 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2595 /**************************************************************************//**
2596 * Add a TCP flag count to the metrics.
2598 * @note The property is treated as immutable: it is only valid to call
2599 * the setter once. However, we don't assert if the caller tries to
2600 * overwrite, just ignoring the update instead.
2602 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2603 * @param tcp_flag The TCP flag count to be updated.
2604 * @param count The associated flag count.
2605 *****************************************************************************/
2606 void evel_mobile_gtp_metrics_tcp_flag_count_add(
2607 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2608 const EVEL_TCP_FLAGS tcp_flag,
2611 /**************************************************************************//**
2612 * Add a QCI COS count to the metrics.
2614 * @note The property is treated as immutable: it is only valid to call
2615 * the setter once. However, we don't assert if the caller tries to
2616 * overwrite, just ignoring the update instead.
2618 * @param metrics Pointer to the Mobile GTP Per Flow Metrics.
2619 * @param qci_cos The QCI COS count to be updated.
2620 * @param count The associated QCI COS count.
2621 *****************************************************************************/
2622 void evel_mobile_gtp_metrics_qci_cos_count_add(
2623 MOBILE_GTP_PER_FLOW_METRICS * metrics,
2624 const EVEL_QCI_COS_TYPES qci_cos,
2627 /*****************************************************************************/
2628 /*****************************************************************************/
2630 /* SERVICE EVENTS */
2632 /*****************************************************************************/
2633 /*****************************************************************************/
2635 /**************************************************************************//**
2636 * Create a new Service event.
2638 * @note The mandatory fields on the Service must be supplied to
2639 * this factory function and are immutable once set. Optional fields
2640 * have explicit setter functions, but again values may only be set
2641 * once so that the event has immutable properties.
2642 * @param vendor_id The vendor id to encode in the event instance id.
2643 * @param event_id The vendor event id to encode in the event instance id.
2644 * @returns pointer to the newly manufactured ::EVENT_SERVICE. If the event
2645 * is not used (i.e. posted) it must be released using
2646 * ::evel_free_service.
2647 * @retval NULL Failed to create the event.
2648 *****************************************************************************/
2649 EVENT_SERVICE * evel_new_service(const char * const vendor_id,
2650 const char * const event_id);
2652 /**************************************************************************//**
2653 * Free a Service Events event.
2655 * Free off the event supplied. Will free all the contained allocated memory.
2657 * @note It does not free the event itself, since that may be part of a larger
2659 *****************************************************************************/
2660 void evel_free_service(EVENT_SERVICE * const event);
2662 /**************************************************************************//**
2663 * Set the Event Type 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 type The Event Type to be set. ASCIIZ string. The caller
2671 * does not need to preserve the value once the function
2673 *****************************************************************************/
2674 void evel_service_type_set(EVENT_SERVICE * const event,
2675 const char * const type);
2677 /**************************************************************************//**
2678 * Set the Product 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 product_id The vendor product id to be set. ASCIIZ string. The
2686 * caller does not need to preserve the value once the
2688 *****************************************************************************/
2689 void evel_service_product_id_set(EVENT_SERVICE * const event,
2690 const char * const product_id);
2692 /**************************************************************************//**
2693 * Set the Subsystem Id 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 subsystem_id The vendor subsystem id to be set. ASCIIZ string. The
2701 * caller does not need to preserve the value once the
2703 *****************************************************************************/
2704 void evel_service_subsystem_id_set(EVENT_SERVICE * const event,
2705 const char * const subsystem_id);
2707 /**************************************************************************//**
2708 * Set the Friendly Name 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 friendly_name The vendor friendly name to be set. ASCIIZ string. The
2716 * caller does not need to preserve the value once the
2718 *****************************************************************************/
2719 void evel_service_friendly_name_set(EVENT_SERVICE * const event,
2720 const char * const friendly_name);
2722 /**************************************************************************//**
2723 * Set the correlator 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 correlator The correlator to be set. ASCIIZ string. The caller
2731 * does not need to preserve the value once the function
2733 *****************************************************************************/
2734 void evel_service_correlator_set(EVENT_SERVICE * const event,
2735 const char * const correlator);
2737 /**************************************************************************//**
2738 * Set the Codec property of the Service event.
2740 * @note The property is treated as immutable: it is only valid to call
2741 * the setter once. However, we don't assert if the caller tries to
2742 * overwrite, just ignoring the update instead.
2744 * @param event Pointer to the Service event.
2745 * @param codec The codec to be set. ASCIIZ string. The caller does not
2746 * need to preserve the value once the function returns.
2747 *****************************************************************************/
2748 void evel_service_codec_set(EVENT_SERVICE * const event,
2749 const char * const codec);
2751 /**************************************************************************//**
2752 * Set the Callee Side Codec property of the Service event.
2754 * @note The property is treated as immutable: it is only valid to call
2755 * the setter once. However, we don't assert if the caller tries to
2756 * overwrite, just ignoring the update instead.
2758 * @param event Pointer to the Service event.
2759 * @param codec The codec to be set. ASCIIZ string. The caller does not
2760 * need to preserve the value once the function returns.
2761 *****************************************************************************/
2762 void evel_service_callee_codec_set(EVENT_SERVICE * const event,
2763 const char * const codec);
2765 /**************************************************************************//**
2766 * Set the Caller Side Codec property of the Service event.
2768 * @note The property is treated as immutable: it is only valid to call
2769 * the setter once. However, we don't assert if the caller tries to
2770 * overwrite, just ignoring the update instead.
2772 * @param event Pointer to the Service event.
2773 * @param codec The codec to be set. ASCIIZ string. The caller does not
2774 * need to preserve the value once the function returns.
2775 *****************************************************************************/
2776 void evel_service_caller_codec_set(EVENT_SERVICE * const event,
2777 const char * const codec);
2779 /**************************************************************************//**
2780 * Set the RTCP Data 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 rtcp_data The RTCP Data to be set. ASCIIZ string. The caller
2788 * does not need to preserve the value once the function
2790 *****************************************************************************/
2791 void evel_service_rtcp_data_set(EVENT_SERVICE * const event,
2792 const char * const rtcp_data);
2794 /**************************************************************************//**
2795 * Set the Adjacency Name property of the Service event.
2797 * @note The property is treated as immutable: it is only valid to call
2798 * the setter once. However, we don't assert if the caller tries to
2799 * overwrite, just ignoring the update instead.
2801 * @param event Pointer to the Service event.
2802 * @param adjacency_name
2803 * The adjacency name to be set. ASCIIZ string. The caller
2804 * does not need to preserve the value once the function
2806 *****************************************************************************/
2807 void evel_service_adjacency_name_set(EVENT_SERVICE * const event,
2808 const char * const adjacency_name);
2810 /**************************************************************************//**
2811 * Set the Endpoint Descriptor property of the Service event.
2813 * @note The property is treated as immutable: it is only valid to call
2814 * the setter once. However, we don't assert if the caller tries to
2815 * overwrite, just ignoring the update instead.
2817 * @param event Pointer to the Service event.
2818 * @param endpoint_desc The endpoint descriptor to be set.
2819 *****************************************************************************/
2820 void evel_service_endpoint_desc_set(
2821 EVENT_SERVICE * const event,
2822 const EVEL_SERVICE_ENDPOINT_DESC endpoint_desc);
2824 /**************************************************************************//**
2825 * Set the Endpoint Jitter property of the Service event.
2827 * @note The property is treated as immutable: it is only valid to call
2828 * the setter once. However, we don't assert if the caller tries to
2829 * overwrite, just ignoring the update instead.
2831 * @param event Pointer to the Service event.
2832 * @param jitter The jitter to be set.
2833 *****************************************************************************/
2834 void evel_service_endpoint_jitter_set(EVENT_SERVICE * const event,
2837 /**************************************************************************//**
2838 * Set the Endpoint Rtp Octets Discarded property of the Service event.
2840 * @note The property is treated as immutable: it is only valid to call
2841 * the setter once. However, we don't assert if the caller tries to
2842 * overwrite, just ignoring the update instead.
2844 * @param event Pointer to the Service event.
2845 * @param rtp_oct_disc The discard count.
2846 *****************************************************************************/
2847 void evel_service_endpoint_rtp_oct_disc_set(EVENT_SERVICE * const event,
2848 const int rtp_oct_disc);
2850 /**************************************************************************//**
2851 * Set the Endpoint Rtp Octets Received property of the Service event.
2853 * @note The property is treated as immutable: it is only valid to call
2854 * the setter once. However, we don't assert if the caller tries to
2855 * overwrite, just ignoring the update instead.
2857 * @param event Pointer to the Service event.
2858 * @param rtp_oct_recv The receive count.
2859 *****************************************************************************/
2860 void evel_service_endpoint_rtp_oct_recv_set(EVENT_SERVICE * const event,
2861 const int rtp_oct_recv);
2863 /**************************************************************************//**
2864 * Set the Endpoint Rtp Octets Sent property of the Service event.
2866 * @note The property is treated as immutable: it is only valid to call
2867 * the setter once. However, we don't assert if the caller tries to
2868 * overwrite, just ignoring the update instead.
2870 * @param event Pointer to the Service event.
2871 * @param rtp_oct_sent The send count.
2872 *****************************************************************************/
2873 void evel_service_endpoint_rtp_oct_sent_set(EVENT_SERVICE * const event,
2874 const int rtp_oct_sent);
2876 /**************************************************************************//**
2877 * Set the Endpoint Rtp Packets Discarded property of the Service event.
2879 * @note The property is treated as immutable: it is only valid to call
2880 * the setter once. However, we don't assert if the caller tries to
2881 * overwrite, just ignoring the update instead.
2883 * @param event Pointer to the Service event.
2884 * @param rtp_pkt_disc The discard count.
2885 *****************************************************************************/
2886 void evel_service_endpoint_rtp_pkt_disc_set(EVENT_SERVICE * const event,
2887 const int rtp_pkt_disc);
2889 /**************************************************************************//**
2890 * Set the Endpoint Rtp Packets Received property of the Service event.
2892 * @note The property is treated as immutable: it is only valid to call
2893 * the setter once. However, we don't assert if the caller tries to
2894 * overwrite, just ignoring the update instead.
2896 * @param event Pointer to the Service event.
2897 * @param rtp_pkt_recv The receive count.
2898 *****************************************************************************/
2899 void evel_service_endpoint_rtp_pkt_recv_set(EVENT_SERVICE * const event,
2900 const int rtp_pkt_recv);
2902 /**************************************************************************//**
2903 * Set the Endpoint Rtp Packets Sent property of the Service event.
2905 * @note The property is treated as immutable: it is only valid to call
2906 * the setter once. However, we don't assert if the caller tries to
2907 * overwrite, just ignoring the update instead.
2909 * @param event Pointer to the Service event.
2910 * @param rtp_pkt_sent The send count.
2911 *****************************************************************************/
2912 void evel_service_endpoint_rtp_pkt_sent_set(EVENT_SERVICE * const event,
2913 const int rtp_pkt_sent);
2915 /**************************************************************************//**
2916 * Set the Local Jitter property of the Service event.
2918 * @note The property is treated as immutable: it is only valid to call
2919 * the setter once. However, we don't assert if the caller tries to
2920 * overwrite, just ignoring the update instead.
2922 * @param event Pointer to the Service event.
2923 * @param jitter The jitter to be set.
2924 *****************************************************************************/
2925 void evel_service_local_jitter_set(EVENT_SERVICE * const event,
2928 /**************************************************************************//**
2929 * Set the Local Rtp Octets Discarded property of the Service event.
2931 * @note The property is treated as immutable: it is only valid to call
2932 * the setter once. However, we don't assert if the caller tries to
2933 * overwrite, just ignoring the update instead.
2935 * @param event Pointer to the Service event.
2936 * @param rtp_oct_disc The discard count.
2937 *****************************************************************************/
2938 void evel_service_local_rtp_oct_disc_set(EVENT_SERVICE * const event,
2939 const int rtp_oct_disc);
2941 /**************************************************************************//**
2942 * Set the Local Rtp Octets Received property of the Service event.
2944 * @note The property is treated as immutable: it is only valid to call
2945 * the setter once. However, we don't assert if the caller tries to
2946 * overwrite, just ignoring the update instead.
2948 * @param event Pointer to the Service event.
2949 * @param rtp_oct_recv The receive count.
2950 *****************************************************************************/
2951 void evel_service_local_rtp_oct_recv_set(EVENT_SERVICE * const event,
2952 const int rtp_oct_recv);
2954 /**************************************************************************//**
2955 * Set the Local Rtp Octets Sent property of the Service event.
2957 * @note The property is treated as immutable: it is only valid to call
2958 * the setter once. However, we don't assert if the caller tries to
2959 * overwrite, just ignoring the update instead.
2961 * @param event Pointer to the Service event.
2962 * @param rtp_oct_sent The send count.
2963 *****************************************************************************/
2964 void evel_service_local_rtp_oct_sent_set(EVENT_SERVICE * const event,
2965 const int rtp_oct_sent);
2967 /**************************************************************************//**
2968 * Set the Local Rtp Packets Discarded property of the Service event.
2970 * @note The property is treated as immutable: it is only valid to call
2971 * the setter once. However, we don't assert if the caller tries to
2972 * overwrite, just ignoring the update instead.
2974 * @param event Pointer to the Service event.
2975 * @param rtp_pkt_disc The discard count.
2976 *****************************************************************************/
2977 void evel_service_local_rtp_pkt_disc_set(EVENT_SERVICE * const event,
2978 const int rtp_pkt_disc);
2980 /**************************************************************************//**
2981 * Set the Local Rtp Packets Received property of the Service event.
2983 * @note The property is treated as immutable: it is only valid to call
2984 * the setter once. However, we don't assert if the caller tries to
2985 * overwrite, just ignoring the update instead.
2987 * @param event Pointer to the Service event.
2988 * @param rtp_pkt_recv The receive count.
2989 *****************************************************************************/
2990 void evel_service_local_rtp_pkt_recv_set(EVENT_SERVICE * const event,
2991 const int rtp_pkt_recv);
2993 /**************************************************************************//**
2994 * Set the Local Rtp Packets Sent property of the Service event.
2996 * @note The property is treated as immutable: it is only valid to call
2997 * the setter once. However, we don't assert if the caller tries to
2998 * overwrite, just ignoring the update instead.
3000 * @param event Pointer to the Service event.
3001 * @param rtp_pkt_sent The send count.
3002 *****************************************************************************/
3003 void evel_service_local_rtp_pkt_sent_set(EVENT_SERVICE * const event,
3004 const int rtp_pkt_sent);
3006 /**************************************************************************//**
3007 * Set the Mos Cqe property of the Service event.
3009 * @note The property is treated as immutable: it is only valid to call
3010 * the setter once. However, we don't assert if the caller tries to
3011 * overwrite, just ignoring the update instead.
3013 * @param event Pointer to the Service event.
3014 * @param mos_cqe The mosCqe to be set.
3015 *****************************************************************************/
3016 void evel_service_mos_cqe_set(EVENT_SERVICE * const event,
3017 const double mos_cqe);
3019 /**************************************************************************//**
3020 * Set the Packets Lost property of the Service event.
3022 * @note The property is treated as immutable: it is only valid to call
3023 * the setter once. However, we don't assert if the caller tries to
3024 * overwrite, just ignoring the update instead.
3026 * @param event Pointer to the Service event.
3027 * @param packets_lost The number of packets lost to be set.
3028 *****************************************************************************/
3029 void evel_service_packets_lost_set(EVENT_SERVICE * const event,
3030 const int packets_lost);
3032 /**************************************************************************//**
3033 * Set the packet Loss Percent property of the Service event.
3035 * @note The property is treated as immutable: it is only valid to call
3036 * the setter once. However, we don't assert if the caller tries to
3037 * overwrite, just ignoring the update instead.
3039 * @param event Pointer to the Service event.
3040 * @param packet_loss_percent
3041 * The packet loss in percent.
3042 *****************************************************************************/
3043 void evel_service_packet_loss_percent_set(EVENT_SERVICE * const event,
3044 const double packet_loss_percent);
3046 /**************************************************************************//**
3047 * Set the R Factor property of the Service event.
3049 * @note The property is treated as immutable: it is only valid to call
3050 * the setter once. However, we don't assert if the caller tries to
3051 * overwrite, just ignoring the update instead.
3053 * @param event Pointer to the Service event.
3054 * @param r_factor The R Factor to be set.
3055 *****************************************************************************/
3056 void evel_service_r_factor_set(EVENT_SERVICE * const event,
3057 const int r_factor);
3059 /**************************************************************************//**
3060 * Set the Round Trip Delay property of the Service event.
3062 * @note The property is treated as immutable: it is only valid to call
3063 * the setter once. However, we don't assert if the caller tries to
3064 * overwrite, just ignoring the update instead.
3066 * @param event Pointer to the Service event.
3067 * @param round_trip_delay
3068 * The Round trip delay to be set.
3069 *****************************************************************************/
3070 void evel_service_round_trip_delay_set(EVENT_SERVICE * const event,
3071 const int round_trip_delay);
3073 /**************************************************************************//**
3074 * Set the Phone Number property of the Service event.
3076 * @note The property is treated as immutable: it is only valid to call
3077 * the setter once. However, we don't assert if the caller tries to
3078 * overwrite, just ignoring the update instead.
3080 * @param event Pointer to the Service event.
3081 * @param phone_number The Phone Number to be set. ASCIIZ string. The caller
3082 * does not need to preserve the value once the function
3084 *****************************************************************************/
3085 void evel_service_phone_number_set(EVENT_SERVICE * const event,
3086 const char * const phone_number);
3088 /**************************************************************************//**
3089 * Add a name/value pair to the Service, under the additionalFields array.
3091 * The name and value are null delimited ASCII strings. The library takes
3092 * a copy so the caller does not have to preserve values after the function
3095 * @param event Pointer to the Service event.
3096 * @param name ASCIIZ string with the field's name. The caller does not
3097 * need to preserve the value once the function returns.
3098 * @param value ASCIIZ string with the field's value. The caller does not
3099 * need to preserve the value once the function returns.
3100 *****************************************************************************/
3101 void evel_service_addl_field_add(EVENT_SERVICE * const event,
3102 const char * const name,
3103 const char * const value);
3105 /*****************************************************************************/
3106 /*****************************************************************************/
3110 /*****************************************************************************/
3111 /*****************************************************************************/
3113 /**************************************************************************//**
3114 * Create a new Signaling event.
3116 * @note The mandatory fields on the Signaling must be supplied to
3117 * this factory function and are immutable once set. Optional fields
3118 * have explicit setter functions, but again values may only be set
3119 * once so that the event has immutable properties.
3120 * @param vendor_id The vendor id to encode in the event instance id.
3121 * @param event_id The vendor event id to encode in the event instance id.
3122 * @returns pointer to the newly manufactured ::EVENT_SIGNALING. If the event
3123 * is not used (i.e. posted) it must be released using
3124 * ::evel_free_signaling.
3125 * @retval NULL Failed to create the event.
3126 *****************************************************************************/
3127 EVENT_SIGNALING * evel_new_signaling(const char * const vendor_id,
3128 const char * const event_id);
3130 /**************************************************************************//**
3131 * Free a Signaling event.
3133 * Free off the event supplied. Will free all the contained allocated memory.
3135 * @note It does not free the event itself, since that may be part of a larger
3137 *****************************************************************************/
3138 void evel_free_signaling(EVENT_SIGNALING * const event);
3140 /**************************************************************************//**
3141 * Set the Event Type 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 type The Event Type to be set. ASCIIZ string. The caller
3149 * does not need to preserve the value once the function
3151 *****************************************************************************/
3152 void evel_signaling_type_set(EVENT_SIGNALING * const event,
3153 const char * const type);
3155 /**************************************************************************//**
3156 * Set the Product 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 product_id The vendor product id to be set. ASCIIZ string. The
3164 * caller does not need to preserve the value once the
3166 *****************************************************************************/
3167 void evel_signaling_product_id_set(EVENT_SIGNALING * const event,
3168 const char * const product_id);
3170 /**************************************************************************//**
3171 * Set the Subsystem Id 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 subsystem_id The vendor subsystem id to be set. ASCIIZ string. The
3179 * caller does not need to preserve the value once the
3181 *****************************************************************************/
3182 void evel_signaling_subsystem_id_set(EVENT_SIGNALING * const event,
3183 const char * const subsystem_id);
3185 /**************************************************************************//**
3186 * Set the Friendly Name 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 friendly_name The vendor friendly name to be set. ASCIIZ string. The
3194 * caller does not need to preserve the value once the
3196 *****************************************************************************/
3197 void evel_signaling_friendly_name_set(EVENT_SIGNALING * const event,
3198 const char * const friendly_name);
3200 /**************************************************************************//**
3201 * Set the Correlator 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 correlator The correlator to be set. ASCIIZ string. The caller
3209 * does not need to preserve the value once the function
3211 *****************************************************************************/
3212 void evel_signaling_correlator_set(EVENT_SIGNALING * const event,
3213 const char * const correlator);
3215 /**************************************************************************//**
3216 * Set the Local Ip Address property of the Signaling event.
3218 * @note The property is treated as immutable: it is only valid to call
3219 * the setter once. However, we don't assert if the caller tries to
3220 * overwrite, just ignoring the update instead.
3222 * @param event Pointer to the Signaling event.
3223 * @param local_ip_address
3224 * The Local Ip Address to be set. ASCIIZ string. The
3225 * caller does not need to preserve the value once the
3227 *****************************************************************************/
3228 void evel_signaling_local_ip_address_set(EVENT_SIGNALING * const event,
3229 const char * const local_ip_address);
3231 /**************************************************************************//**
3232 * Set the Local Port 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 local_port The Local Port to be set. ASCIIZ string. The caller
3240 * does not need to preserve the value once the function
3242 *****************************************************************************/
3243 void evel_signaling_local_port_set(EVENT_SIGNALING * const event,
3244 const char * const local_port);
3246 /**************************************************************************//**
3247 * Set the Remote Ip Address property of the Signaling event.
3249 * @note The property is treated as immutable: it is only valid to call
3250 * the setter once. However, we don't assert if the caller tries to
3251 * overwrite, just ignoring the update instead.
3253 * @param event Pointer to the Signaling event.
3254 * @param remote_ip_address
3255 * The Remote Ip Address to be set. ASCIIZ string. The
3256 * caller does not need to preserve the value once the
3258 *****************************************************************************/
3259 void evel_signaling_remote_ip_address_set(EVENT_SIGNALING * const event,
3260 const char * const remote_ip_address);
3262 /**************************************************************************//**
3263 * Set the Remote Port 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 remote_port The Remote Port to be set. ASCIIZ string. The caller
3271 * does not need to preserve the value once the function
3273 *****************************************************************************/
3274 void evel_signaling_remote_port_set(EVENT_SIGNALING * const event,
3275 const char * const remote_port);
3277 /**************************************************************************//**
3278 * Set the Compressed SIP property of the Signaling event.
3280 * @note The property is treated as immutable: it is only valid to call
3281 * the setter once. However, we don't assert if the caller tries to
3282 * overwrite, just ignoring the update instead.
3284 * @param event Pointer to the Signaling event.
3285 * @param compressed_sip
3286 * The Compressed SIP to be set. ASCIIZ string. The caller
3287 * does not need to preserve the value once the function
3289 *****************************************************************************/
3290 void evel_signaling_compressed_sip_set(EVENT_SIGNALING * const event,
3291 const char * const compressed_sip);
3293 /**************************************************************************//**
3294 * Set the Summary SIP property of the Signaling event.
3296 * @note The property is treated as immutable: it is only valid to call
3297 * the setter once. However, we don't assert if the caller tries to
3298 * overwrite, just ignoring the update instead.
3300 * @param event Pointer to the Signaling event.
3301 * @param summary_sip The Summary SIP to be set. ASCIIZ string. The caller
3302 * does not need to preserve the value once the function
3304 *****************************************************************************/
3305 void evel_signaling_summary_sip_set(EVENT_SIGNALING * const event,
3306 const char * const summary_sip);
3308 /*****************************************************************************/
3309 /*****************************************************************************/
3313 /*****************************************************************************/
3314 /*****************************************************************************/
3316 /**************************************************************************//**
3317 * Create a new State Change event.
3319 * @note The mandatory fields on the Syslog must be supplied to this factory
3320 * function and are immutable once set. Optional fields have explicit
3321 * setter functions, but again values may only be set once so that the
3322 * Syslog has immutable properties.
3324 * @param new_state The new state of the reporting entity.
3325 * @param old_state The old state of the reporting entity.
3326 * @param interface The card or port name of the reporting entity.
3328 * @returns pointer to the newly manufactured ::EVENT_STATE_CHANGE. If the
3329 * event is not used it must be released using
3330 * ::evel_free_state_change
3331 * @retval NULL Failed to create the event.
3332 *****************************************************************************/
3333 EVENT_STATE_CHANGE * evel_new_state_change(const EVEL_ENTITY_STATE new_state,
3334 const EVEL_ENTITY_STATE old_state,
3335 const char * const interface);
3337 /**************************************************************************//**
3338 * Free a State Change.
3340 * Free off the State Change supplied. Will free all the contained allocated
3343 * @note It does not free the State Change itself, since that may be part of a
3345 *****************************************************************************/
3346 void evel_free_state_change(EVENT_STATE_CHANGE * const state_change);
3348 /**************************************************************************//**
3349 * Set the Event Type property of the State Change.
3351 * @note The property is treated as immutable: it is only valid to call
3352 * the setter once. However, we don't assert if the caller tries to
3353 * overwrite, just ignoring the update instead.
3355 * @param state_change Pointer to the ::EVENT_STATE_CHANGE.
3356 * @param type The Event Type to be set. ASCIIZ string. The caller
3357 * does not need to preserve the value once the function
3359 *****************************************************************************/
3360 void evel_state_change_type_set(EVENT_STATE_CHANGE * const state_change,
3361 const char * const type);
3363 /**************************************************************************//**
3364 * Add an additional field name/value pair to the State Change.
3366 * The name and value are null delimited ASCII strings. The library takes
3367 * a copy so the caller does not have to preserve values after the function
3370 * @param state_change Pointer to the ::EVENT_STATE_CHANGE.
3371 * @param name ASCIIZ string with the attribute's name. The caller
3372 * does not need to preserve the value once the function
3374 * @param value ASCIIZ string with the attribute's value. The caller
3375 * does not need to preserve the value once the function
3377 *****************************************************************************/
3378 void evel_state_change_addl_field_add(EVENT_STATE_CHANGE * const state_change,
3379 const char * const name,
3380 const char * const value);
3382 /*****************************************************************************/
3383 /*****************************************************************************/
3387 /*****************************************************************************/
3388 /*****************************************************************************/
3390 /**************************************************************************//**
3391 * Create a new syslog event.
3393 * @note The mandatory fields on the Syslog must be supplied to this factory
3394 * function and are immutable once set. Optional fields have explicit
3395 * setter functions, but again values may only be set once so that the
3396 * Syslog has immutable properties.
3398 * @param event_source_type
3402 * @returns pointer to the newly manufactured ::EVENT_SYSLOG. If the event is
3403 * not used it must be released using ::evel_free_syslog
3404 * @retval NULL Failed to create the event.
3405 *****************************************************************************/
3406 EVENT_SYSLOG * evel_new_syslog(EVEL_SOURCE_TYPES event_source_type,
3407 const char * const syslog_msg,
3408 const char * const syslog_tag);
3410 /**************************************************************************//**
3411 * Set the Event Type property of the Syslog.
3413 * @note The property is treated as immutable: it is only valid to call
3414 * the setter once. However, we don't assert if the caller tries to
3415 * overwrite, just ignoring the update instead.
3417 * @param syslog Pointer to the syslog.
3418 * @param type The Event Type to be set. ASCIIZ string. The caller
3419 * does not need to preserve the value once the function
3421 *****************************************************************************/
3422 void evel_syslog_type_set(EVENT_SYSLOG * syslog,
3423 const char * const type);
3425 /**************************************************************************//**
3428 * Free off the Syslog supplied. Will free all the contained allocated memory.
3430 * @note It does not free the Syslog itself, since that may be part of a
3432 *****************************************************************************/
3433 void evel_free_syslog(EVENT_SYSLOG * event);
3435 /**************************************************************************//**
3436 * Add an additional field name/value pair to the Syslog.
3438 * The name and value are null delimited ASCII strings. The library takes
3439 * a copy so the caller does not have to preserve values after the function
3442 * @param syslog Pointer to the syslog.
3443 * @param name ASCIIZ string with the attribute's name. The caller
3444 * does not need to preserve the value once the function
3446 * @param value ASCIIZ string with the attribute's value. The caller
3447 * does not need to preserve the value once the function
3449 *****************************************************************************/
3450 void evel_syslog_addl_field_add(EVENT_SYSLOG * syslog,
3454 /**************************************************************************//**
3455 * Set the Event Source Host 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 host The Event Source Host to be set. ASCIIZ string. The
3463 * caller does not need to preserve the value once the
3465 *****************************************************************************/
3466 void evel_syslog_event_source_host_set(EVENT_SYSLOG * syslog,
3467 const char * const host);
3469 /**************************************************************************//**
3470 * Set the Syslog Facility 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 facility The Syslog Facility to be set. ASCIIZ string. The caller
3478 * does not need to preserve the value once the function
3480 *****************************************************************************/
3481 void evel_syslog_facility_set(EVENT_SYSLOG * syslog,
3482 EVEL_SYSLOG_FACILITIES facility);
3484 /**************************************************************************//**
3485 * Set the Process property of the Syslog.
3487 * @note The property is treated as immutable: it is only valid to call
3488 * the setter once. However, we don't assert if the caller tries to
3489 * overwrite, just ignoring the update instead.
3491 * @param syslog Pointer to the Syslog.
3492 * @param proc The Process to be set. ASCIIZ string. The caller does
3493 * not need to preserve the value once the function returns.
3494 *****************************************************************************/
3495 void evel_syslog_proc_set(EVENT_SYSLOG * syslog, const char * const proc);
3497 /**************************************************************************//**
3498 * Set the Process ID property of the Syslog.
3500 * @note The property is treated as immutable: it is only valid to call
3501 * the setter once. However, we don't assert if the caller tries to
3502 * overwrite, just ignoring the update instead.
3504 * @param syslog Pointer to the Syslog.
3505 * @param proc_id The Process ID to be set.
3506 *****************************************************************************/
3507 void evel_syslog_proc_id_set(EVENT_SYSLOG * syslog, int proc_id);
3509 /**************************************************************************//**
3510 * Set the Version property of the Syslog.
3512 * @note The property is treated as immutable: it is only valid to call
3513 * the setter once. However, we don't assert if the caller tries to
3514 * overwrite, just ignoring the update instead.
3516 * @param syslog Pointer to the Syslog.
3517 * @param version The Version to be set.
3518 *****************************************************************************/
3519 void evel_syslog_version_set(EVENT_SYSLOG * syslog, int version);
3521 /**************************************************************************//**
3522 * Set the Structured Data property of the Syslog.
3524 * @note The property is treated as immutable: it is only valid to call
3525 * the setter once. However, we don't assert if the caller tries to
3526 * overwrite, just ignoring the update instead.
3528 * @param syslog Pointer to the Syslog.
3529 * @param s_data The Structured Data to be set. ASCIIZ string. The caller
3530 * does not need to preserve the value once the function
3532 *****************************************************************************/
3533 void evel_syslog_s_data_set(EVENT_SYSLOG * syslog, const char * const s_data);
3535 /*****************************************************************************/
3536 /*****************************************************************************/
3540 /*****************************************************************************/
3541 /*****************************************************************************/
3543 /**************************************************************************//**
3544 * Create a new other event.
3547 * @returns pointer to the newly manufactured ::EVENT_OTHER. If the event is
3548 * not used it must be released using ::evel_free_other.
3549 * @retval NULL Failed to create the event.
3550 *****************************************************************************/
3551 EVENT_OTHER * evel_new_other(void);
3553 /**************************************************************************//**
3556 * Free off the Other supplied. Will free all the contained allocated memory.
3558 * @note It does not free the Other itself, since that may be part of a
3560 *****************************************************************************/
3561 void evel_free_other(EVENT_OTHER * event);
3563 /**************************************************************************//**
3564 * Set the Event Type property of the Other.
3566 * @note The property is treated as immutable: it is only valid to call
3567 * the setter once. However, we don't assert if the caller tries to
3568 * overwrite, just ignoring the update instead.
3570 * @param other Pointer to the Other.
3571 * @param type The Event Type to be set. ASCIIZ string. The caller
3572 * does not need to preserve the value once the function
3574 *****************************************************************************/
3575 void evel_other_type_set(EVENT_OTHER * other,
3576 const char * const type);
3578 /**************************************************************************//**
3579 * Add a value name/value pair to the Other.
3581 * The name and value are null delimited ASCII strings. The library takes
3582 * a copy so the caller does not have to preserve values after the function
3585 * @param other Pointer to the Other.
3586 * @param name ASCIIZ string with the attribute's name.
3587 * @param value ASCIIZ string with the attribute's value.
3588 *****************************************************************************/
3589 void evel_other_field_add(EVENT_OTHER * other,
3593 /*****************************************************************************/
3594 /*****************************************************************************/
3598 /*****************************************************************************/
3599 /*****************************************************************************/
3601 /**************************************************************************//**
3602 * Return the current measurement interval provided by the Event Listener.
3604 * @returns The current measurement interval
3605 * @retval EVEL_MEASUREMENT_INTERVAL_UKNOWN (0) - interval has not been
3607 *****************************************************************************/
3608 int evel_get_measurement_interval();
3610 /*****************************************************************************/
3611 /*****************************************************************************/
3615 /*****************************************************************************/
3616 /*****************************************************************************/
3618 /*****************************************************************************/
3620 /*****************************************************************************/
3621 #define EVEL_DEBUG(FMT, ...) log_debug(EVEL_LOG_DEBUG, (FMT), ##__VA_ARGS__)
3622 #define EVEL_INFO(FMT, ...) log_debug(EVEL_LOG_INFO, (FMT), ##__VA_ARGS__)
3623 #define EVEL_SPAMMY(FMT, ...) log_debug(EVEL_LOG_SPAMMY, (FMT), ##__VA_ARGS__)
3624 #define EVEL_ERROR(FMT, ...) log_debug(EVEL_LOG_ERROR, "ERROR: " FMT, \
3626 #define EVEL_ENTER() \
3628 log_debug(EVEL_LOG_DEBUG, "Enter %s {", __FUNCTION__); \
3629 debug_indent += 2; \
3631 #define EVEL_EXIT() \
3633 debug_indent -= 2; \
3634 log_debug(EVEL_LOG_DEBUG, "Exit %s }", __FUNCTION__); \
3637 #define INDENT_SEPARATORS \
3638 "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "
3640 extern EVEL_LOG_LEVELS debug_level;
3641 extern int debug_indent;
3644 #define EVEL_DEBUG_ON() ((debug_level) >= EVEL_LOG_DEBUG)
3646 /**************************************************************************//**
3647 * Initialize logging
3649 * @param[in] level The debugging level - one of ::EVEL_LOG_LEVELS.
3650 * @param[in] ident The identifier for our logs.
3651 *****************************************************************************/
3652 void log_initialize(EVEL_LOG_LEVELS level, const char * ident);
3654 /**************************************************************************//**
3655 * Log debug information
3657 * Logs debugging information in a platform independent manner.
3659 * @param[in] level The debugging level - one of ::EVEL_LOG_LEVELS.
3660 * @param[in] format Log formatting string in printf format.
3661 * @param[in] ... Variable argument list.
3662 *****************************************************************************/
3663 void log_debug(EVEL_LOG_LEVELS level, char * format, ...);
3665 /***************************************************************************//*
3666 * Store the formatted string into the static error string and log the error.
3668 * @param format Error string in standard printf format.
3669 * @param ... Variable parameters to be substituted into the format string.
3670 *****************************************************************************/
3671 void log_error_state(char * format, ...);