AT&T ECOMP Vendor Event Listener library  0.1
evel_demo.c
Go to the documentation of this file.
1 /**************************************************************************/
40 #include <stdio.h>
41 #include <stdlib.h>
42 #include <unistd.h>
43 #include <getopt.h>
44 #include <sys/signal.h>
45 #include <pthread.h>
46 #include <mcheck.h>
47 #include <sys/time.h>
48 
49 #include "evel.h"
50 #include "evel_demo.h"
51 #include "evel_test_control.h"
52 
53 /**************************************************************************/
58 static const struct option long_options[] = {
59  {"help", no_argument, 0, 'h'},
60  {"fqdn", required_argument, 0, 'f'},
61  {"port", required_argument, 0, 'n'},
62  {"path", required_argument, 0, 'p'},
63  {"topic", required_argument, 0, 't'},
64  {"https", no_argument, 0, 's'},
65  {"verbose", no_argument, 0, 'v'},
66  {"cycles", required_argument, 0, 'c'},
67  {"username", required_argument, 0, 'u'},
68  {"password", required_argument, 0, 'w'},
69  {"nothrott", no_argument, 0, 'x'},
70  {0, 0, 0, 0}
71  };
72 
73 /**************************************************************************/
76 static const char* short_options = "hf:n:p:t:sc:u:w:vx";
77 
78 /**************************************************************************/
81 static const char* usage_text =
82 "evel_demo [--help]\n"
83 " --fqdn <domain>\n"
84 " --port <port_number>\n"
85 " [--path <path>]\n"
86 " [--topic <topic>]\n"
87 " [--username <username>]\n"
88 " [--password <password>]\n"
89 " [--https]\n"
90 " [--cycles <cycles>]\n"
91 " [--nothrott]\n"
92 "\n"
93 "Demonstrate use of the ECOMP Vendor Event Listener API.\n"
94 "\n"
95 " -h Display this usage message.\n"
96 " --help\n"
97 "\n"
98 " -f The FQDN or IP address to the RESTful API.\n"
99 " --fqdn\n"
100 "\n"
101 " -n The port number the RESTful API.\n"
102 " --port\n"
103 "\n"
104 " -p The optional path prefix to the RESTful API.\n"
105 " --path\n"
106 "\n"
107 " -t The optional topic part of the RESTful API.\n"
108 " --topic\n"
109 "\n"
110 " -u The optional username for basic authentication of requests.\n"
111 " --username\n"
112 "\n"
113 " -w The optional password for basic authentication of requests.\n"
114 " --password\n"
115 "\n"
116 " -s Use HTTPS rather than HTTP for the transport.\n"
117 " --https\n"
118 "\n"
119 " -c Loop <cycles> times round the main loop. Default = 1.\n"
120 " --cycles\n"
121 "\n"
122 " -v Generate much chattier logs.\n"
123 " --verbose\n"
124 "\n"
125 " -x Exclude throttling commands from demonstration.\n"
126 " --nothrott\n";
127 
128 #define DEFAULT_SLEEP_SECONDS 3
129 #define MINIMUM_SLEEP_SECONDS 1
130 
131 unsigned long long epoch_start = 0;
132 
133 typedef enum {
139 } SERVICE_EVENT;
140 
141 /*****************************************************************************/
142 /* Local prototypes. */
143 /*****************************************************************************/
144 static void demo_heartbeat(void);
145 static void demo_fault(void);
146 static void demo_measurement(const int interval);
147 static void demo_mobile_flow(void);
148 static void demo_service(void);
149 static void demo_service_event(const SERVICE_EVENT service_event);
150 static void demo_signaling(void);
151 static void demo_state_change(void);
152 static void demo_syslog(void);
153 static void demo_other(void);
154 
155 /**************************************************************************/
158 static int glob_exit_now = 0;
159 
160 static char * api_fqdn = NULL;
161 static int api_port = 0;
162 static int api_secure = 0;
163 
164 static void show_usage(FILE* fp)
165 {
166  fputs(usage_text, fp);
167 }
168 
169 /**************************************************************************/
177 int main(int argc, char ** argv)
178 {
179  sigset_t sig_set;
180  pthread_t thread_id;
181  int option_index = 0;
182  int param = 0;
183  char * api_path = NULL;
184  char * api_topic = NULL;
185  char * api_username = "";
186  char * api_password = "";
187  int verbose_mode = 0;
188  int exclude_throttling = 0;
189  int cycles = 1;
190  int cycle;
191  int measurement_interval = EVEL_MEASUREMENT_INTERVAL_UKNOWN;
192 
193  /***************************************************************************/
194  /* We're very interested in memory management problems so check behavior. */
195  /***************************************************************************/
196  mcheck(NULL);
197 
198  if (argc < 2)
199  {
200  show_usage(stderr);
201  exit(-1);
202  }
203  param = getopt_long(argc, argv,
204  short_options,
205  long_options,
206  &option_index);
207  while (param != -1)
208  {
209  switch (param)
210  {
211  case 'h':
212  show_usage(stdout);
213  exit(0);
214  break;
215 
216  case 'f':
217  api_fqdn = optarg;
218  break;
219 
220  case 'n':
221  api_port = atoi(optarg);
222  break;
223 
224  case 'p':
225  api_path = optarg;
226  break;
227 
228  case 't':
229  api_topic = optarg;
230  break;
231 
232  case 'u':
233  api_username = optarg;
234  break;
235 
236  case 'w':
237  api_password = optarg;
238  break;
239 
240  case 's':
241  api_secure = 1;
242  break;
243 
244  case 'c':
245  cycles = atoi(optarg);
246  break;
247 
248  case 'v':
249  verbose_mode = 1;
250  break;
251 
252  case 'x':
253  exclude_throttling = 1;
254  break;
255 
256  case '?':
257  /*********************************************************************/
258  /* Unrecognized parameter - getopt_long already printed an error */
259  /* message. */
260  /*********************************************************************/
261  break;
262 
263  default:
264  fprintf(stderr, "Code error: recognized but missing option (%d)!\n",
265  param);
266  exit(-1);
267  }
268 
269  /*************************************************************************/
270  /* Extract next parameter. */
271  /*************************************************************************/
272  param = getopt_long(argc, argv,
273  short_options,
274  long_options,
275  &option_index);
276  }
277 
278  /***************************************************************************/
279  /* All the command-line has parsed cleanly, so now check that the options */
280  /* are meaningful. */
281  /***************************************************************************/
282  if (api_fqdn == NULL)
283  {
284  fprintf(stderr, "FQDN of the Vendor Event Listener API server must be "
285  "specified.\n");
286  exit(1);
287  }
288  if (api_port <= 0 || api_port > 65535)
289  {
290  fprintf(stderr, "Port for the Vendor Event Listener API server must be "
291  "specified between 1 and 65535.\n");
292  exit(1);
293  }
294  if (cycles <= 0)
295  {
296  fprintf(stderr, "Number of cycles around the main loop must be an"
297  "integer greater than zero.\n");
298  exit(1);
299  }
300 
301  /***************************************************************************/
302  /* Set up default signal behaviour. Block all signals we trap explicitly */
303  /* on the signal_watcher thread. */
304  /***************************************************************************/
305  sigemptyset(&sig_set);
306  sigaddset(&sig_set, SIGALRM);
307  sigaddset(&sig_set, SIGINT);
308  pthread_sigmask(SIG_BLOCK, &sig_set, NULL);
309 
310  /***************************************************************************/
311  /* Start the signal watcher thread. */
312  /***************************************************************************/
313  if (pthread_create(&thread_id, NULL, signal_watcher, &sig_set) != 0)
314  {
315  fprintf(stderr, "Failed to start signal watcher thread.");
316  exit(1);
317  }
318  pthread_detach(thread_id);
319 
320  /***************************************************************************/
321  /* Version info */
322  /***************************************************************************/
323  printf("%s built %s %s\n", argv[0], __DATE__, __TIME__);
324 
325  /***************************************************************************/
326  /* Initialize the EVEL interface. */
327  /***************************************************************************/
328  if (evel_initialize(api_fqdn,
329  api_port,
330  api_path,
331  api_topic,
332  api_secure,
333  api_username,
334  api_password,
336  "EVEL demo client",
337  verbose_mode))
338  {
339  fprintf(stderr, "Failed to initialize the EVEL library!!!");
340  exit(-1);
341  }
342  else
343  {
344  EVEL_INFO("Initialization completed");
345  }
346 
347  /***************************************************************************/
348  /* Work out a start time for measurements, and sleep for initial period. */
349  /***************************************************************************/
350  struct timeval tv_start;
351  gettimeofday(&tv_start, NULL);
352  epoch_start = tv_start.tv_usec + 1000000 * tv_start.tv_sec;
353  sleep(DEFAULT_SLEEP_SECONDS);
354 
355  /***************************************************************************/
356  /* MAIN LOOP */
357  /***************************************************************************/
358  printf("Starting %d loops...\n", cycles);
359  cycle = 0;
360  while (cycle++ < cycles)
361  {
362  EVEL_INFO("MAI: Starting main loop");
363  printf("\nStarting main loop %d\n", cycle);
364 
365  /*************************************************************************/
366  /* A 20s-long repeating cycle of behaviour. */
367  /*************************************************************************/
368  if (exclude_throttling == 0)
369  {
370  switch (cycle % 20)
371  {
372  case 1:
373  printf(" 1 - Resetting throttle specification for all domains\n");
375  api_secure,
376  api_fqdn,
377  api_port);
378  break;
379 
380  case 2:
381  printf(" 2 - Switching measurement interval to 2s\n");
383  api_secure,
384  api_fqdn,
385  api_port);
386  break;
387 
388  case 3:
389  printf(" 3 - Suppressing fault domain\n");
391  api_secure,
392  api_fqdn,
393  api_port);
394  break;
395 
396  case 4:
397  printf(" 4 - Suppressing measurement domain\n");
399  api_secure,
400  api_fqdn,
401  api_port);
402  break;
403 
404  case 5:
405  printf(" 5 - Switching measurement interval to 5s\n");
407  api_secure,
408  api_fqdn,
409  api_port);
410  break;
411 
412  case 6:
413  printf(" 6 - Suppressing mobile flow domain\n");
415  api_secure,
416  api_fqdn,
417  api_port);
418  break;
419 
420  case 7:
421  printf(" 7 - Suppressing state change domain\n");
423  api_secure,
424  api_fqdn,
425  api_port);
426  break;
427 
428  case 8:
429  printf(" 8 - Suppressing signaling domain\n");
431  api_secure,
432  api_fqdn,
433  api_port);
434  break;
435 
436  case 9:
437  printf(" 9 - Suppressing service event domain\n");
439  api_secure,
440  api_fqdn,
441  api_port);
442  break;
443 
444  case 10:
445  printf(" 10 - Switching measurement interval to 20s\n");
447  api_secure,
448  api_fqdn,
449  api_port);
450  break;
451 
452  case 11:
453  printf(" 11 - Suppressing syslog domain\n");
455  api_secure,
456  api_fqdn,
457  api_port);
458  break;
459 
460  case 12:
461  printf(" 12 - Switching measurement interval to 10s\n");
463  api_secure,
464  api_fqdn,
465  api_port);
466  break;
467 
468  case 15:
469  printf(" Requesting provide throttling spec\n");
471  api_secure,
472  api_fqdn,
473  api_port);
474  break;
475  }
476  }
477  fflush(stdout);
478 
479  /*************************************************************************/
480  /* Send a bunch of events. */
481  /*************************************************************************/
482  demo_heartbeat();
483  demo_fault();
484  demo_measurement((measurement_interval ==
485  EVEL_MEASUREMENT_INTERVAL_UKNOWN) ?
486  DEFAULT_SLEEP_SECONDS : measurement_interval);
487  demo_mobile_flow();
488  demo_service();
489  demo_signaling();
490  demo_state_change();
491  demo_syslog();
492  demo_other();
493 
494  /*************************************************************************/
495  /* MAIN RETRY LOOP. Check and implement the measurement interval. */
496  /*************************************************************************/
497  if (cycle <= cycles)
498  {
499  int sleep_time;
500 
501  /***********************************************************************/
502  /* We have a minimum loop time. */
503  /***********************************************************************/
504  sleep(MINIMUM_SLEEP_SECONDS);
505 
506  /***********************************************************************/
507  /* Get the latest measurement interval and sleep for the remainder. */
508  /***********************************************************************/
509  measurement_interval = evel_get_measurement_interval();
510  printf("Measurement Interval = %d\n", measurement_interval);
511 
512  if (measurement_interval == EVEL_MEASUREMENT_INTERVAL_UKNOWN)
513  {
515  }
516  else
517  {
518  sleep_time = measurement_interval - MINIMUM_SLEEP_SECONDS;
519  }
520  sleep(sleep_time);
521  }
522  }
523 
524  /***************************************************************************/
525  /* We are exiting, but allow the final set of events to be dispatched */
526  /* properly first. */
527  /***************************************************************************/
528  sleep(2);
529  printf("All done - exiting!\n");
530  return 0;
531 }
532 
533 /**************************************************************************/
541 void *signal_watcher(void *void_sig_set)
542 {
543  sigset_t *sig_set = (sigset_t *)void_sig_set;
544  int sig = 0;
545  int old_type = 0;
546  siginfo_t sig_info;
547 
548  /***************************************************************************/
549  /* Set this thread to be cancellable immediately. */
550  /***************************************************************************/
551  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old_type);
552 
553  while (!glob_exit_now)
554  {
555  /*************************************************************************/
556  /* Wait for a signal to be received. */
557  /*************************************************************************/
558  sig = sigwaitinfo(sig_set, &sig_info);
559  switch (sig)
560  {
561  case SIGALRM:
562  /*********************************************************************/
563  /* Failed to do something in the given amount of time. Exit. */
564  /*********************************************************************/
565  EVEL_ERROR( "Timeout alarm");
566  fprintf(stderr,"Timeout alarm - quitting!\n");
567  exit(2);
568  break;
569 
570  case SIGINT:
571  EVEL_INFO( "Interrupted - quitting");
572  printf("\n\nInterrupted - quitting!\n");
573  glob_exit_now = 1;
574  break;
575  }
576  }
577 
578  evel_terminate();
579  exit(0);
580  return(NULL);
581 }
582 
583 /**************************************************************************/
586 void demo_heartbeat(void)
587 {
588  EVENT_HEADER * heartbeat = NULL;
589  EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
590 
591  /***************************************************************************/
592  /* Heartbeat */
593  /***************************************************************************/
594  heartbeat = evel_new_heartbeat();
595  if (heartbeat != NULL)
596  {
597  evel_rc = evel_post_event(heartbeat);
598  if (evel_rc != EVEL_SUCCESS)
599  {
600  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
601  }
602  }
603  else
604  {
605  EVEL_ERROR("New Heartbeat failed");
606  }
607  printf(" Processed Heartbeat\n");
608 }
609 
610 /**************************************************************************/
613 void demo_fault(void)
614 {
615  EVENT_FAULT * fault = NULL;
616  EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
617 
618  /***************************************************************************/
619  /* Fault */
620  /***************************************************************************/
621  fault = evel_new_fault("An alarm condition",
622  "Things are broken",
625  if (fault != NULL)
626  {
627  evel_rc = evel_post_event((EVENT_HEADER *)fault);
628  if (evel_rc != EVEL_SUCCESS)
629  {
630  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
631  }
632  }
633  else
634  {
635  EVEL_ERROR("New Fault failed");
636  }
637  printf(" Processed empty Fault\n");
638 
639  fault = evel_new_fault("Another alarm condition",
640  "It broke badly",
643  if (fault != NULL)
644  {
645  evel_fault_type_set(fault, "Bad things happening");
646  evel_fault_interface_set(fault, "An Interface Card");
647  evel_rc = evel_post_event((EVENT_HEADER *)fault);
648  if (evel_rc != EVEL_SUCCESS)
649  {
650  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
651  }
652  }
653  else
654  {
655  EVEL_ERROR("New Fault failed");
656  }
657  printf(" Processed partial Fault\n");
658 
659  fault = evel_new_fault("My alarm condition",
660  "It broke very badly",
663  if (fault != NULL)
664  {
665  evel_fault_type_set(fault, "Bad things happen...");
666  evel_fault_interface_set(fault, "My Interface Card");
667  evel_fault_addl_info_add(fault, "name1", "value1");
668  evel_fault_addl_info_add(fault, "name2", "value2");
669  evel_rc = evel_post_event((EVENT_HEADER *)fault);
670  if (evel_rc != EVEL_SUCCESS)
671  {
672  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
673  }
674  }
675  else
676  {
677  EVEL_ERROR("New Fault failed");
678  }
679  printf(" Processed full Fault\n");
680 }
681 
682 /**************************************************************************/
685 void demo_measurement(const int interval)
686 {
687  EVENT_MEASUREMENT * measurement = NULL;
688  MEASUREMENT_LATENCY_BUCKET * bucket = NULL;
689  MEASUREMENT_VNIC_USE * vnic_use = NULL;
690  EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
691 
692  /***************************************************************************/
693  /* Measurement */
694  /***************************************************************************/
695  measurement = evel_new_measurement(interval);
696  if (measurement != NULL)
697  {
698  evel_measurement_type_set(measurement, "Perf management...");
699  evel_measurement_conc_sess_set(measurement, 1);
700  evel_measurement_cfg_ents_set(measurement, 2);
701  evel_measurement_mean_req_lat_set(measurement, 4.4);
702  evel_measurement_mem_cfg_set(measurement, 6.6);
703  evel_measurement_mem_used_set(measurement, 3.3);
704  evel_measurement_request_rate_set(measurement, 6);
705  evel_measurement_agg_cpu_use_set(measurement, 8.8);
706  evel_measurement_cpu_use_add(measurement, "cpu1", 11.11);
707  evel_measurement_cpu_use_add(measurement, "cpu2", 22.22);
708  evel_measurement_fsys_use_add(measurement,"00-11-22",100.11, 100.22, 33,
709  200.11, 200.22, 44);
710  evel_measurement_fsys_use_add(measurement,"33-44-55",300.11, 300.22, 55,
711  400.11, 400.22, 66);
712 
713  bucket = evel_new_meas_latency_bucket(20);
716  evel_meas_latency_bucket_add(measurement, bucket);
717 
718  bucket = evel_new_meas_latency_bucket(30);
721  evel_meas_latency_bucket_add(measurement, bucket);
722 
723  vnic_use = evel_new_measurement_vnic_use("eth0", 100, 200, 3, 4);
724  evel_vnic_use_bcast_pkt_in_set(vnic_use, 1);
725  evel_vnic_use_bcast_pkt_out_set(vnic_use, 2);
726  evel_vnic_use_mcast_pkt_in_set(vnic_use, 5);
727  evel_vnic_use_mcast_pkt_out_set(vnic_use, 6);
728  evel_vnic_use_ucast_pkt_in_set(vnic_use, 7);
729  evel_vnic_use_ucast_pkt_out_set(vnic_use, 8);
730  evel_meas_vnic_use_add(measurement, vnic_use);
731 
732  vnic_use = evel_new_measurement_vnic_use("eth1", 110, 240, 13, 14);
733  evel_vnic_use_bcast_pkt_in_set(vnic_use, 11);
734  evel_vnic_use_bcast_pkt_out_set(vnic_use, 12);
735  evel_vnic_use_mcast_pkt_in_set(vnic_use, 15);
736  evel_vnic_use_mcast_pkt_out_set(vnic_use, 16);
737  evel_vnic_use_ucast_pkt_in_set(vnic_use, 17);
738  evel_vnic_use_ucast_pkt_out_set(vnic_use, 18);
739  evel_meas_vnic_use_add(measurement, vnic_use);
740 
741  evel_measurement_errors_set(measurement, 1, 0, 2, 1);
742 
743  evel_measurement_feature_use_add(measurement, "FeatureA", 123);
744  evel_measurement_feature_use_add(measurement, "FeatureB", 567);
745 
746  evel_measurement_codec_use_add(measurement, "G711a", 91);
747  evel_measurement_codec_use_add(measurement, "G729ab", 92);
748 
749  evel_measurement_media_port_use_set(measurement, 1234);
750 
751  evel_measurement_vnfc_scaling_metric_set(measurement, 1234.5678);
752 
754  "Group1", "Name1", "Value1");
756  "Group2", "Name1", "Value1");
758  "Group2", "Name2", "Value2");
759 
760  /*************************************************************************/
761  /* Work out the time, to use as end of measurement period. */
762  /*************************************************************************/
763  struct timeval tv_now;
764  gettimeofday(&tv_now, NULL);
765  unsigned long long epoch_now = tv_now.tv_usec + 1000000 * tv_now.tv_sec;
766  evel_start_epoch_set(&measurement->header, epoch_start);
767  evel_last_epoch_set(&measurement->header, epoch_now);
768  epoch_start = epoch_now;
769  evel_reporting_entity_name_set(&measurement->header, "measurer");
770  evel_reporting_entity_id_set(&measurement->header, "measurer_id");
771 
772  evel_rc = evel_post_event((EVENT_HEADER *)measurement);
773  if (evel_rc != EVEL_SUCCESS)
774  {
775  EVEL_ERROR("Post Measurement failed %d (%s)",
776  evel_rc,
778  }
779  }
780  else
781  {
782  EVEL_ERROR("New Measurement failed");
783  }
784  printf(" Processed Measurement\n");
785 }
786 
787 /**************************************************************************/
790 void demo_mobile_flow(void)
791 {
792  MOBILE_GTP_PER_FLOW_METRICS * metrics = NULL;
793  EVENT_MOBILE_FLOW * mobile_flow = NULL;
794  EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
795 
796  /***************************************************************************/
797  /* Mobile Flow */
798  /***************************************************************************/
799  metrics = evel_new_mobile_gtp_flow_metrics(12.3,
800  3.12,
801  100,
802  2100,
803  500,
804  1470409421,
805  987,
806  1470409431,
807  11,
808  (time_t)1470409431,
809  "Working",
810  87,
811  3,
812  17,
813  123654,
814  4561,
815  0,
816  12,
817  10,
818  1,
819  3,
820  7,
821  899,
822  901,
823  302,
824  6,
825  2,
826  0,
827  110,
828  225);
829  if (metrics != NULL)
830  {
831  mobile_flow = evel_new_mobile_flow("Outbound",
832  metrics,
833  "TCP",
834  "IPv4",
835  "2.3.4.1",
836  2341,
837  "4.2.3.1",
838  4321);
839  if (mobile_flow != NULL)
840  {
841  evel_rc = evel_post_event((EVENT_HEADER *)mobile_flow);
842  if (evel_rc != EVEL_SUCCESS)
843  {
844  EVEL_ERROR("Post Mobile Flow failed %d (%s)",
845  evel_rc,
847  }
848  }
849  else
850  {
851  EVEL_ERROR("New Mobile Flow failed");
852  }
853  printf(" Processed empty Mobile Flow\n");
854  }
855  else
856  {
857  EVEL_ERROR("New GTP Per Flow Metrics failed - skipping Mobile Flow");
858  printf(" Skipped empty Mobile Flow\n");
859  }
860 
861  metrics = evel_new_mobile_gtp_flow_metrics(132.0001,
862  31.2,
863  101,
864  2101,
865  501,
866  1470409422,
867  988,
868  1470409432,
869  12,
870  (time_t)1470409432,
871  "Inactive",
872  88,
873  4,
874  18,
875  123655,
876  4562,
877  1,
878  13,
879  11,
880  2,
881  4,
882  8,
883  900,
884  902,
885  303,
886  7,
887  3,
888  1,
889  111,
890  226);
891  if (metrics != NULL)
892  {
893  mobile_flow = evel_new_mobile_flow("Inbound",
894  metrics,
895  "UDP",
896  "IPv6",
897  "2.3.4.2",
898  2342,
899  "4.2.3.2",
900  4322);
901  if (mobile_flow != NULL)
902  {
903  evel_mobile_flow_app_type_set(mobile_flow, "Demo application");
904  evel_mobile_flow_app_prot_type_set(mobile_flow, "GSM");
905  evel_mobile_flow_app_prot_ver_set(mobile_flow, "1");
906  evel_mobile_flow_cid_set(mobile_flow, "65535");
907  evel_mobile_flow_con_type_set(mobile_flow, "S1-U");
908  evel_mobile_flow_ecgi_set(mobile_flow, "e65535");
909  evel_mobile_flow_gtp_prot_type_set(mobile_flow, "GTP-U");
910  evel_mobile_flow_gtp_prot_ver_set(mobile_flow, "1");
912  "http://www.something.com");
913  evel_mobile_flow_imei_set(mobile_flow, "209917614823");
914  evel_mobile_flow_imsi_set(mobile_flow, "355251/05/850925/8");
915  evel_mobile_flow_lac_set(mobile_flow, "1");
916  evel_mobile_flow_mcc_set(mobile_flow, "410");
917  evel_mobile_flow_mnc_set(mobile_flow, "04");
918  evel_mobile_flow_msisdn_set(mobile_flow, "6017123456789");
919  evel_mobile_flow_other_func_role_set(mobile_flow, "MME");
920  evel_mobile_flow_rac_set(mobile_flow, "514");
921  evel_mobile_flow_radio_acc_tech_set(mobile_flow, "LTE");
922  evel_mobile_flow_sac_set(mobile_flow, "1");
923  evel_mobile_flow_samp_alg_set(mobile_flow, 1);
924  evel_mobile_flow_tac_set(mobile_flow, "2099");
925  evel_mobile_flow_tunnel_id_set(mobile_flow, "Tunnel 1");
926  evel_mobile_flow_vlan_id_set(mobile_flow, "15");
927 
928  evel_rc = evel_post_event((EVENT_HEADER *)mobile_flow);
929  if (evel_rc != EVEL_SUCCESS)
930  {
931  EVEL_ERROR("Post Mobile Flow failed %d (%s)",
932  evel_rc,
934  }
935  }
936  else
937  {
938  EVEL_ERROR("New Mobile Flow failed");
939  }
940  printf(" Processed partial Mobile Flow\n");
941  }
942  else
943  {
944  EVEL_ERROR("New GTP Per Flow Metrics failed - skipping Mobile Flow");
945  printf(" Skipped partial Mobile Flow\n");
946  }
947 
948  metrics = evel_new_mobile_gtp_flow_metrics(12.32,
949  3.122,
950  1002,
951  21002,
952  5002,
953  1470409423,
954  9872,
955  1470409433,
956  112,
957  (time_t)1470409433,
958  "Failed",
959  872,
960  32,
961  172,
962  1236542,
963  45612,
964  2,
965  122,
966  102,
967  12,
968  32,
969  72,
970  8992,
971  9012,
972  3022,
973  62,
974  22,
975  2,
976  1102,
977  2252);
978  if (metrics != NULL)
979  {
982  evel_mobile_gtp_metrics_act_by_set(metrics, "Remote");
983  evel_mobile_gtp_metrics_act_time_set(metrics, (time_t)1470409423);
984  evel_mobile_gtp_metrics_deact_by_set(metrics, "Remote");
985  evel_mobile_gtp_metrics_con_status_set(metrics, "Connected");
986  evel_mobile_gtp_metrics_tun_status_set(metrics, "Not tunneling");
987  evel_mobile_gtp_metrics_iptos_set(metrics, 1, 13);
988  evel_mobile_gtp_metrics_iptos_set(metrics, 17, 1);
989  evel_mobile_gtp_metrics_iptos_set(metrics, 4, 99);
1000  metrics, EVEL_QCI_COS_UMTS_CONVERSATIONAL, 11);
1002  metrics, EVEL_QCI_COS_LTE_65, 122);
1003 
1004  mobile_flow = evel_new_mobile_flow("Outbound",
1005  metrics,
1006  "RTP",
1007  "IPv8",
1008  "2.3.4.3",
1009  2343,
1010  "4.2.3.3",
1011  4323);
1012  if (mobile_flow != NULL)
1013  {
1014  evel_mobile_flow_app_type_set(mobile_flow, "Demo application 2");
1015  evel_mobile_flow_app_prot_type_set(mobile_flow, "GSM");
1016  evel_mobile_flow_app_prot_ver_set(mobile_flow, "2");
1017  evel_mobile_flow_cid_set(mobile_flow, "1");
1018  evel_mobile_flow_con_type_set(mobile_flow, "S1-U");
1019  evel_mobile_flow_ecgi_set(mobile_flow, "e1");
1020  evel_mobile_flow_gtp_prot_type_set(mobile_flow, "GTP-U");
1021  evel_mobile_flow_gtp_prot_ver_set(mobile_flow, "1");
1022  evel_mobile_flow_http_header_set(mobile_flow, "http://www.google.com");
1023  evel_mobile_flow_imei_set(mobile_flow, "209917614823");
1024  evel_mobile_flow_imsi_set(mobile_flow, "355251/05/850925/8");
1025  evel_mobile_flow_lac_set(mobile_flow, "1");
1026  evel_mobile_flow_mcc_set(mobile_flow, "410");
1027  evel_mobile_flow_mnc_set(mobile_flow, "04");
1028  evel_mobile_flow_msisdn_set(mobile_flow, "6017123456789");
1029  evel_mobile_flow_other_func_role_set(mobile_flow, "MMF");
1030  evel_mobile_flow_rac_set(mobile_flow, "514");
1031  evel_mobile_flow_radio_acc_tech_set(mobile_flow, "3G");
1032  evel_mobile_flow_sac_set(mobile_flow, "1");
1033  evel_mobile_flow_samp_alg_set(mobile_flow, 2);
1034  evel_mobile_flow_tac_set(mobile_flow, "2099");
1035  evel_mobile_flow_tunnel_id_set(mobile_flow, "Tunnel 2");
1036  evel_mobile_flow_vlan_id_set(mobile_flow, "4096");
1037 
1038  evel_rc = evel_post_event((EVENT_HEADER *)mobile_flow);
1039  if (evel_rc != EVEL_SUCCESS)
1040  {
1041  EVEL_ERROR("Post Mobile Flow failed %d (%s)",
1042  evel_rc,
1043  evel_error_string());
1044  }
1045  }
1046  else
1047  {
1048  EVEL_ERROR("New Mobile Flow failed");
1049  }
1050  printf(" Processed full Mobile Flow\n");
1051  }
1052  else
1053  {
1054  EVEL_ERROR("New GTP Per Flow Metrics failed - skipping Mobile Flow");
1055  printf(" Skipped full Mobile Flow\n");
1056  }
1057 }
1058 
1059 /**************************************************************************/
1062 void demo_service()
1063 {
1064  demo_service_event(SERVICE_CODEC);
1065  demo_service_event(SERVICE_TRANSCODING);
1066  demo_service_event(SERVICE_RTCP);
1067  demo_service_event(SERVICE_EOC_VQM);
1068  demo_service_event(SERVICE_MARKER);
1069 }
1070 
1071 void demo_service_event(const SERVICE_EVENT service_event)
1072 {
1073  EVENT_SERVICE * event = NULL;
1074  EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
1075 
1076  event = evel_new_service("vendor_x_id", "vendor_x_event_id");
1077  if (event != NULL)
1078  {
1079  evel_service_type_set(event, "Service Event");
1080  evel_service_product_id_set(event, "vendor_x_product_id");
1081  evel_service_subsystem_id_set(event, "vendor_x_subsystem_id");
1082  evel_service_friendly_name_set(event, "vendor_x_frieldly_name");
1083  evel_service_correlator_set(event, "vendor_x_correlator");
1084  evel_service_addl_field_add(event, "Name1", "Value1");
1085  evel_service_addl_field_add(event, "Name2", "Value2");
1086 
1087  switch (service_event)
1088  {
1089  case SERVICE_CODEC:
1090  evel_service_codec_set(event, "PCMA");
1091  break;
1092  case SERVICE_TRANSCODING:
1093  evel_service_callee_codec_set(event, "PCMA");
1094  evel_service_caller_codec_set(event, "G729A");
1095  break;
1096  case SERVICE_RTCP:
1097  evel_service_rtcp_data_set(event, "some_rtcp_data");
1098  break;
1099  case SERVICE_EOC_VQM:
1100  evel_service_adjacency_name_set(event, "vendor_x_adjacency");
1109  evel_service_local_jitter_set(event, 99);
1116  evel_service_mos_cqe_set(event, 12.255);
1117  evel_service_packets_lost_set(event, 157);
1119  evel_service_r_factor_set(event, 11);
1121  break;
1122  case SERVICE_MARKER:
1123  evel_service_phone_number_set(event, "0888888888");
1124  break;
1125  }
1126 
1127  evel_rc = evel_post_event((EVENT_HEADER *) event);
1128  if (evel_rc != EVEL_SUCCESS)
1129  {
1130  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
1131  }
1132  }
1133  else
1134  {
1135  EVEL_ERROR("New Service failed");
1136  }
1137  printf(" Processed Service Events\n");
1138 }
1139 
1140 /**************************************************************************/
1143 void demo_signaling(void)
1144 {
1145  EVENT_SIGNALING * event = NULL;
1146  EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
1147 
1148  event = evel_new_signaling("vendor_x_id", "vendor_x_event_id");
1149  if (event != NULL)
1150  {
1151  evel_signaling_type_set(event, "Signaling");
1152  evel_signaling_product_id_set(event, "vendor_x_product_id");
1153  evel_signaling_subsystem_id_set(event, "vendor_x_subsystem_id");
1154  evel_signaling_friendly_name_set(event, "vendor_x_frieldly_name");
1155  evel_signaling_correlator_set(event, "vendor_x_correlator");
1156  evel_signaling_local_ip_address_set(event, "1.0.3.1");
1157  evel_signaling_local_port_set(event, "1031");
1158  evel_signaling_remote_ip_address_set(event, "5.3.3.0");
1159  evel_signaling_remote_port_set(event, "5330");
1160  evel_signaling_compressed_sip_set(event, "compressed_sip");
1161  evel_signaling_summary_sip_set(event, "summary_sip");
1162  evel_rc = evel_post_event((EVENT_HEADER *) event);
1163  if (evel_rc != EVEL_SUCCESS)
1164  {
1165  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
1166  }
1167  }
1168  else
1169  {
1170  EVEL_ERROR("New Signaling failed");
1171  }
1172  printf(" Processed Signaling\n");
1173 }
1174 
1175 /**************************************************************************/
1178 void demo_state_change(void)
1179 {
1180  EVENT_STATE_CHANGE * state_change = NULL;
1181  EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
1182 
1183  /***************************************************************************/
1184  /* State Change */
1185  /***************************************************************************/
1188  "Interface");
1189  if (state_change != NULL)
1190  {
1191  evel_state_change_type_set(state_change, "State Change");
1192  evel_state_change_addl_field_add(state_change, "Name1", "Value1");
1193  evel_state_change_addl_field_add(state_change, "Name2", "Value2");
1194  evel_rc = evel_post_event((EVENT_HEADER *)state_change);
1195  if (evel_rc != EVEL_SUCCESS)
1196  {
1197  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
1198  }
1199  }
1200  else
1201  {
1202  EVEL_ERROR("New State Change failed");
1203  }
1204  printf(" Processed State Change\n");
1205 }
1206 
1207 /**************************************************************************/
1210 void demo_syslog(void)
1211 {
1212  EVENT_SYSLOG * syslog = NULL;
1213  EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
1214 
1215  /***************************************************************************/
1216  /* Syslog */
1217  /***************************************************************************/
1219  "EVEL library message",
1220  "EVEL");
1221  if (syslog != NULL)
1222  {
1223  evel_rc = evel_post_event((EVENT_HEADER *)syslog);
1224  if (evel_rc != EVEL_SUCCESS)
1225  {
1226  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
1227  }
1228  }
1229  else
1230  {
1231  EVEL_ERROR("New Syslog failed");
1232  }
1233  printf(" Processed empty Syslog\n");
1234 
1236  "EVEL library message",
1237  "EVEL");
1238  if (syslog != NULL)
1239  {
1240  evel_syslog_event_source_host_set(syslog, "Virtual host");
1242  evel_syslog_proc_set(syslog, "vnf_process");
1243  evel_syslog_proc_id_set(syslog, 1423);
1244  evel_syslog_version_set(syslog, 1);
1245  evel_syslog_addl_field_add(syslog, "Name1", "Value1");
1246  evel_syslog_addl_field_add(syslog, "Name2", "Value2");
1247  evel_syslog_addl_field_add(syslog, "Name3", "Value3");
1248  evel_syslog_addl_field_add(syslog, "Name4", "Value4");
1249  evel_rc = evel_post_event((EVENT_HEADER *)syslog);
1250  if (evel_rc != EVEL_SUCCESS)
1251  {
1252  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
1253  }
1254  }
1255  else
1256  {
1257  EVEL_ERROR("New Syslog failed");
1258  }
1259  printf(" Processed full Syslog\n");
1260 }
1261 
1262 /**************************************************************************/
1265 void demo_other(void)
1266 {
1267  EVENT_OTHER * other = NULL;
1268  EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
1269 
1270  /***************************************************************************/
1271  /* Other */
1272  /***************************************************************************/
1273  other = evel_new_other();
1274  if (other != NULL)
1275  {
1276  evel_rc = evel_post_event((EVENT_HEADER *)other);
1277  if (evel_rc != EVEL_SUCCESS)
1278  {
1279  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
1280  }
1281  }
1282  else
1283  {
1284  EVEL_ERROR("New Other failed");
1285  }
1286  printf(" Processed empty Other\n");
1287 
1288  other = evel_new_other();
1289  if (other != NULL)
1290  {
1291  evel_other_field_add(other,
1292  "Other field 1",
1293  "Other value 1");
1294  evel_rc = evel_post_event((EVENT_HEADER *)other);
1295  if (evel_rc != EVEL_SUCCESS)
1296  {
1297  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
1298  }
1299  }
1300  else
1301  {
1302  EVEL_ERROR("New Other failed");
1303  }
1304  printf(" Processed small Other\n");
1305 
1306  other = evel_new_other();
1307  if (other != NULL)
1308  {
1309  evel_other_field_add(other,
1310  "Other field A",
1311  "Other value A");
1312  evel_other_field_add(other,
1313  "Other field B",
1314  "Other value B");
1315  evel_other_field_add(other,
1316  "Other field C",
1317  "Other value C");
1318  evel_rc = evel_post_event((EVENT_HEADER *)other);
1319  if (evel_rc != EVEL_SUCCESS)
1320  {
1321  EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
1322  }
1323  }
1324  else
1325  {
1326  EVEL_ERROR("New Other failed");
1327  }
1328  printf(" Processed large Other\n");
1329 }
void evel_vnic_use_mcast_pkt_in_set(MEASUREMENT_VNIC_USE *const vnic_use, const int multicast_packets_in)
Set the Multicast Packets Received property of the vNIC Use.
void evel_mobile_flow_gtp_prot_ver_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const version)
Set the GTP Protocol Version property of the Mobile Flow.
void evel_mobile_flow_sac_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const sac)
Set the SAC property of the Mobile Flow.
void evel_syslog_proc_id_set(EVENT_SYSLOG *syslog, int proc_id)
Set the Process ID property of the Syslog.
Definition: evel_syslog.c:274
void evel_mobile_gtp_metrics_iptos_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, int index, int count)
Set an IP Type-of-Service count property of the Mobile GTP Per Flow metrics.
void evel_mobile_flow_mnc_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const mnc)
Set the MNC property of the Mobile Flow.
EVENT_HEADER header
Definition: evel.h:508
void evel_mobile_flow_cid_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const cid)
Set the CID property of the Mobile Flow.
void evel_mobile_gtp_metrics_tun_status_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, const char *const status)
Set the GTP Tunnel Status property of the Mobile GTP Per Flow metrics.
void evel_service_product_id_set(EVENT_SERVICE *const event, const char *const product_id)
Set the Product Id property of the Service event.
Definition: evel_service.c:204
EVEL_ERR_CODES evel_terminate(void)
Clean up the EVEL library.
Definition: evel.c:260
void evel_service_packet_loss_percent_set(EVENT_SERVICE *const event, const double packet_loss_percent)
Set the packet Loss Percent property of the Service event.
Definition: evel_service.c:922
#define EVEL_INFO(FMT,...)
Definition: evel.h:3622
void evel_measurement_request_rate_set(EVENT_MEASUREMENT *measurement, int request_rate)
Set the Request Rate property of the Measurement.
void evel_syslog_version_set(EVENT_SYSLOG *syslog, int version)
Set the Version property of the Syslog.
Definition: evel_syslog.c:302
void evel_signaling_summary_sip_set(EVENT_SIGNALING *const event, const char *const summary_sip)
Set the Summary SIP property of the Signaling event.
const char * evel_error_string(void)
Descriptive text for library errors.
Definition: evel_logging.c:87
void evel_reporting_entity_name_set(EVENT_HEADER *const header, const char *const entity_name)
Set the Reporting Entity Name property of the event header.
Definition: evel_event.c:234
void evel_mobile_gtp_metrics_dur_con_fail_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, int duration)
Set the Duration of Connection Failed Status property of the Mobile GTP Per Flow Metrics.
void evel_service_codec_set(EVENT_SERVICE *const event, const char *const codec)
Set the Codec property of the Service event.
Definition: evel_service.c:319
#define MINIMUM_SLEEP_SECONDS
Definition: evel_demo.c:129
void evel_fault_addl_info_add(EVENT_FAULT *fault, char *name, char *value)
Add an additional value name/value pair to the Fault.
Definition: evel_fault.c:125
EVENT_FAULT * evel_new_fault(const char *const condition, const char *const specific_problem, EVEL_EVENT_PRIORITIES priority, EVEL_SEVERITIES severity)
Create a new fault event.
Definition: evel_fault.c:60
Measurement.
Definition: evel.h:504
Utility to post test control commands to the test_collector testControl API.
void evel_mobile_gtp_metrics_con_status_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, const char *const status)
Set the GTP Connection Status property of the Mobile GTP Per Flow metrics.
void evel_test_control_scenario(const EVEL_TEST_CONTROL_SCENARIO scenario, const int secure, const char *fqdn, const int port)
POST a pre-set test scenario to the test_collector testControl API.
EVENT_OTHER * evel_new_other(void)
Create a new other event.
Definition: evel_other.c:53
void evel_mobile_flow_samp_alg_set(EVENT_MOBILE_FLOW *mobile_flow, int algorithm)
Set the Sampling Algorithm property of the Mobile Flow.
void evel_signaling_friendly_name_set(EVENT_SIGNALING *const event, const char *const friendly_name)
Set the Friendly Name property of the Signaling event.
void evel_mobile_flow_radio_acc_tech_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const tech)
Set the Radio Access Technology property of the Mobile Flow.
EVENT_SIGNALING * evel_new_signaling(const char *const vendor_id, const char *const event_id)
Create a new Signaling event.
void evel_vnic_use_bcast_pkt_out_set(MEASUREMENT_VNIC_USE *const vnic_use, const int broadcast_packets_out)
Set the Broadcast Packets Transmitted property of the vNIC Use.
void evel_measurement_conc_sess_set(EVENT_MEASUREMENT *measurement, int concurrent_sessions)
Set the Concurrent Sessions property of the Measurement.
void evel_service_callee_codec_set(EVENT_SERVICE *const event, const char *const codec)
Set the Callee Side Codec property of the Service event.
Definition: evel_service.c:347
void evel_vnic_use_mcast_pkt_out_set(MEASUREMENT_VNIC_USE *const vnic_use, const int multicast_packets_out)
Set the Multicast Packets Transmitted property of the vNIC Use.
void evel_other_field_add(EVENT_OTHER *other, char *name, char *value)
Add a value name/value pair to the Other.
Definition: evel_other.c:127
void evel_measurement_feature_use_add(EVENT_MEASUREMENT *measurement, char *feature, int utilization)
Add a Feature usage value name/value pair to the Measurement.
void evel_mobile_flow_msisdn_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const msisdn)
Set the MSISDN property of the Mobile Flow.
void evel_service_local_rtp_oct_sent_set(EVENT_SERVICE *const event, const int rtp_oct_sent)
Set the Local Rtp Octets Sent property of the Service event.
Definition: evel_service.c:759
EVENT_HEADER * evel_new_heartbeat(void)
Create a new heartbeat event.
Definition: evel_event.c:78
void evel_meas_latency_bucket_add(EVENT_MEASUREMENT *const measurement, MEASUREMENT_LATENCY_BUCKET *const bucket)
Add an additional Measurement Latency Bucket to the specified event.
void evel_signaling_local_port_set(EVENT_SIGNALING *const event, const char *const local_port)
Set the Local Port property of the Signaling event.
void evel_meas_vnic_use_add(EVENT_MEASUREMENT *const measurement, MEASUREMENT_VNIC_USE *const vnic_use)
Add an additional vNIC Use to the specified Measurement event.
#define DEFAULT_SLEEP_SECONDS
Definition: evel_demo.c:128
void evel_measurement_cfg_ents_set(EVENT_MEASUREMENT *measurement, int configured_entities)
Set the Configured Entities property of the Measurement.
void evel_signaling_type_set(EVENT_SIGNALING *const event, const char *const type)
Set the Event Type property of the Signaling event.
void evel_measurement_cpu_use_add(EVENT_MEASUREMENT *measurement, char *id, double usage)
Add an additional CPU usage value name/value pair to the Measurement.
EVENT_SERVICE * evel_new_service(const char *const vendor_id, const char *const event_id)
Create a new Service event.
Definition: evel_service.c:55
void evel_measurement_codec_use_add(EVENT_MEASUREMENT *measurement, char *codec, int utilization)
Add a Codec usage value name/value pair to the Measurement.
void evel_measurement_type_set(EVENT_MEASUREMENT *measurement, const char *const type)
Set the Event Type property of the Measurement.
void evel_measurement_mean_req_lat_set(EVENT_MEASUREMENT *measurement, double mean_request_latency)
Set the Mean Request Latency property of the Measurement.
Header for EVEL library.
void evel_service_local_rtp_oct_recv_set(EVENT_SERVICE *const event, const int rtp_oct_recv)
Set the Local Rtp Octets Received property of the Service event.
Definition: evel_service.c:732
void evel_fault_type_set(EVENT_FAULT *fault, const char *const type)
Set the Event Type property of the Fault.
Definition: evel_fault.c:194
EVEL_ERR_CODES evel_post_event(EVENT_HEADER *event)
Post an event.
void evel_mobile_flow_tac_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const tac)
Set the TAC property of the Mobile Flow.
void evel_service_local_rtp_oct_disc_set(EVENT_SERVICE *const event, const int rtp_oct_disc)
Set the Local Rtp Octets Discarded property of the Service event.
Definition: evel_service.c:705
void evel_mobile_flow_rac_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const rac)
Set the RAC property of the Mobile Flow.
State Change.
Definition: evel.h:952
void evel_service_endpoint_rtp_oct_sent_set(EVENT_SERVICE *const event, const int rtp_oct_sent)
Set the Endpoint Rtp Octets Sent property of the Service event.
Definition: evel_service.c:570
void evel_service_endpoint_rtp_pkt_sent_set(EVENT_SERVICE *const event, const int rtp_pkt_sent)
Set the Endpoint Rtp Packets Sent property of the Service event.
Definition: evel_service.c:651
void evel_signaling_remote_port_set(EVENT_SIGNALING *const event, const char *const remote_port)
Set the Remote Port property of the Signaling event.
void evel_service_subsystem_id_set(EVENT_SERVICE *const event, const char *const subsystem_id)
Set the Subsystem Id property of the Service event.
Definition: evel_service.c:233
void evel_syslog_proc_set(EVENT_SYSLOG *syslog, const char *const proc)
Set the Process property of the Syslog.
Definition: evel_syslog.c:248
int main(int argc, char **argv)
Main function.
Definition: evel_demo.c:177
void evel_service_addl_field_add(EVENT_SERVICE *const event, const char *const name, const char *const value)
Add a name/value pair to the Service, under the additionalFields array.
Definition: evel_service.c:163
void evel_vnic_use_bcast_pkt_in_set(MEASUREMENT_VNIC_USE *const vnic_use, const int broadcast_packets_in)
Set the Broadcast Packets Received property of the vNIC Use.
void evel_signaling_correlator_set(EVENT_SIGNALING *const event, const char *const correlator)
Set the Correlator property of the Signaling event.
EVENT_SYSLOG * evel_new_syslog(EVEL_SOURCE_TYPES event_source_type, const char *const syslog_msg, const char *const syslog_tag)
Create a new syslog event.
Definition: evel_syslog.c:56
void evel_state_change_addl_field_add(EVENT_STATE_CHANGE *const state_change, const char *const name, const char *const value)
Add an additional field name/value pair to the State Change.
Syslog.
Definition: evel.h:993
void evel_mobile_flow_app_type_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const type)
Set the Application Type property of the Mobile Flow.
EVENT_MOBILE_FLOW * evel_new_mobile_flow(const char *const flow_direction, MOBILE_GTP_PER_FLOW_METRICS *gtp_per_flow_metrics, const char *const ip_protocol_type, const char *const ip_version, const char *const other_endpoint_ip_address, int other_endpoint_port, const char *const reporting_endpoint_ip_addr, int reporting_endpoint_port)
Create a new Mobile Flow event.
void evel_meas_latency_bucket_low_end_set(MEASUREMENT_LATENCY_BUCKET *const bucket, const double low_end)
Set the Low End property of the Measurement Latency Bucket.
void evel_reporting_entity_id_set(EVENT_HEADER *const header, const char *const entity_id)
Set the Reporting Entity Id property of the event header.
Definition: evel_event.c:264
void evel_syslog_facility_set(EVENT_SYSLOG *syslog, EVEL_SYSLOG_FACILITIES facility)
Set the Syslog Facility property of the Syslog.
Definition: evel_syslog.c:219
EVEL_ERR_CODES evel_initialize(const char *const fqdn, int port, const char *const path, const char *const topic, int secure, const char *const username, const char *const password, EVEL_SOURCE_TYPES source_type, const char *const role, int verbosity)
Library initialization.
Definition: evel.c:93
void evel_measurement_media_port_use_set(EVENT_MEASUREMENT *measurement, int media_ports_in_use)
Set the Media Ports in Use property of the Measurement.
void evel_service_r_factor_set(EVENT_SERVICE *const event, const int r_factor)
Set the R Factor property of the Service event.
Definition: evel_service.c:949
void evel_measurement_fsys_use_add(EVENT_MEASUREMENT *measurement, char *filesystem_name, double block_configured, double block_used, int block_iops, double ephemeral_configured, double ephemeral_used, int ephemeral_iops)
Add an additional File System usage value name/value pair to the Measurement.
void evel_mobile_flow_con_type_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const type)
Set the Connection Type property of the Mobile Flow.
unsigned long long epoch_start
Definition: evel_demo.c:131
void evel_mobile_flow_vlan_id_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const vlan_id)
Set the VLAN ID property of the Mobile Flow.
void evel_signaling_local_ip_address_set(EVENT_SIGNALING *const event, const char *const local_ip_address)
Set the Local Ip Address property of the Signaling event.
#define EVEL_ERROR(FMT,...)
Definition: evel.h:3624
SERVICE_EVENT
Definition: evel_demo.c:133
void evel_service_packets_lost_set(EVENT_SERVICE *const event, const int packets_lost)
Set the Packets Lost property of the Service event.
Definition: evel_service.c:894
void evel_measurement_errors_set(EVENT_MEASUREMENT *measurement, int receive_discards, int receive_errors, int transmit_discards, int transmit_errors)
Add an additional set of Errors to the Measurement.
void evel_signaling_subsystem_id_set(EVENT_SIGNALING *const event, const char *const subsystem_id)
Set the Subsystem Id property of the Signaling event.
void * signal_watcher(void *void_sig_set)
Signal watcher.
Definition: evel_demo.c:541
void evel_vnic_use_ucast_pkt_out_set(MEASUREMENT_VNIC_USE *const vnic_use, const int unicast_packets_out)
Set the Unicast Packets Transmitted property of the vNIC Use.
EVEL_ERR_CODES
Error codes.
Definition: evel.h:68
void evel_vnic_use_ucast_pkt_in_set(MEASUREMENT_VNIC_USE *const vnic_use, const int unicast_packets_in)
Set the Unicast Packets Received property of the vNIC Use.
void evel_service_local_rtp_pkt_recv_set(EVENT_SERVICE *const event, const int rtp_pkt_recv)
Set the Local Rtp Packets Received property of the Service event.
Definition: evel_service.c:813
void evel_service_adjacency_name_set(EVENT_SERVICE *const event, const char *const adjacency_name)
Set the Adjacency Name property of the Service event.
Definition: evel_service.c:434
Includes for the ECOMP Vendor Event Listener library demo.
void evel_mobile_gtp_metrics_large_pkt_thresh_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, double threshold)
Set the Large Packet Threshold property of the Mobile GTP Per Flow Metrics.
void evel_measurement_custom_measurement_add(EVENT_MEASUREMENT *measurement, const char *const group, const char *const name, const char *const value)
Add a Additional Measurement value name/value pair to the Measurement.
void evel_mobile_flow_imsi_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const imsi)
Set the IMSI property of the Mobile Flow.
Mobile Flow.
Definition: evel.h:740
Latency Bucket.
Definition: evel.h:567
void evel_start_epoch_set(EVENT_HEADER *const header, const unsigned long long start_epoch_microsec)
Set the Start Epoch property of the event header.
Definition: evel_event.c:189
void evel_mobile_flow_http_header_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const header)
Set the HTTP Header property of the Mobile Flow.
EVENT_MEASUREMENT * evel_new_measurement(double measurement_interval)
Create a new Measurement event.
void evel_mobile_gtp_metrics_num_http_errors_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, int num)
Set the Number of HTTP Errors property of the Mobile GTP Per Flow Metrics.
void evel_mobile_gtp_metrics_deact_by_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, const char *const deact_by)
Set the Deactivated By property of the Mobile GTP Per Flow metrics.
int evel_get_measurement_interval()
Return the current measurement interval provided by the Event Listener.
void evel_meas_latency_bucket_high_end_set(MEASUREMENT_LATENCY_BUCKET *const bucket, const double high_end)
Set the High End property of the Measurement Latency Bucket.
void evel_service_endpoint_rtp_pkt_recv_set(EVENT_SERVICE *const event, const int rtp_pkt_recv)
Set the Endpoint Rtp Packets Received property of the Service event.
Definition: evel_service.c:624
void evel_mobile_gtp_metrics_num_tun_fail_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, int num)
Set the Number of GTP Tunnel Errors property of the Mobile GTP Per Flow Metrics.
void evel_mobile_flow_tunnel_id_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const tunnel_id)
Set the Tunnel ID property of the Mobile Flow.
MOBILE_GTP_PER_FLOW_METRICS * evel_new_mobile_gtp_flow_metrics(double avg_bit_error_rate, double avg_packet_delay_variation, int avg_packet_latency, int avg_receive_throughput, int avg_transmit_throughput, int flow_activation_epoch, int flow_activation_microsec, int flow_deactivation_epoch, int flow_deactivation_microsec, time_t flow_deactivation_time, const char *const flow_status, int max_packet_delay_variation, int num_activation_failures, int num_bit_errors, int num_bytes_received, int num_bytes_transmitted, int num_dropped_packets, int num_l7_bytes_received, int num_l7_bytes_transmitted, int num_lost_packets, int num_out_of_order_packets, int num_packet_errors, int num_packets_received_excl_retrans, int num_packets_received_incl_retrans, int num_packets_transmitted_incl_retrans, int num_retries, int num_timeouts, int num_tunneled_l7_bytes_received, int round_trip_time, int time_to_first_byte)
Create a new Mobile GTP Per Flow Metrics.
Service Events.
Definition: evel.h:839
void evel_test_control_meas_interval(const int interval, const int secure, const char *fqdn, const int port)
POST a measurement interval change to the test_collector testControl API.
void evel_state_change_type_set(EVENT_STATE_CHANGE *const state_change, const char *const type)
Set the Event Type property of the State Change.
void evel_mobile_gtp_metrics_tcp_flag_count_add(MOBILE_GTP_PER_FLOW_METRICS *metrics, const EVEL_TCP_FLAGS tcp_flag, const int count)
Add a TCP flag count to the metrics.
void evel_service_correlator_set(EVENT_SERVICE *const event, const char *const correlator)
Set the correlator property of the Service event.
Definition: evel_service.c:291
void evel_service_mos_cqe_set(EVENT_SERVICE *const event, const double mos_cqe)
Set the Mos Cqe property of the Service event.
Definition: evel_service.c:867
Other.
Definition: evel.h:793
void evel_service_endpoint_rtp_oct_recv_set(EVENT_SERVICE *const event, const int rtp_oct_recv)
Set the Endpoint Rtp Octets Received property of the Service event.
Definition: evel_service.c:543
void evel_service_round_trip_delay_set(EVENT_SERVICE *const event, const int round_trip_delay)
Set the Round Trip Delay property of the Service event.
Definition: evel_service.c:977
void evel_mobile_flow_lac_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const lac)
Set the LAC property of the Mobile Flow.
void evel_service_endpoint_desc_set(EVENT_SERVICE *const event, const EVEL_SERVICE_ENDPOINT_DESC endpoint_desc)
Set the Endpoint Descriptor property of the Service event.
Definition: evel_service.c:461
MEASUREMENT_LATENCY_BUCKET * evel_new_meas_latency_bucket(const int count)
Create a new Latency Bucket to be added to a Measurement event.
void evel_syslog_addl_field_add(EVENT_SYSLOG *syslog, char *name, char *value)
Add an additional field name/value pair to the Syslog.
Definition: evel_syslog.c:148
EVENT_STATE_CHANGE * evel_new_state_change(const EVEL_ENTITY_STATE new_state, const EVEL_ENTITY_STATE old_state, const char *const interface)
Create a new State Change event.
Mobile GTP Per Flow Metrics.
Definition: evel.h:675
MEASUREMENT_VNIC_USE * evel_new_measurement_vnic_use(char *const vnic_id, const int packets_in, const int packets_out, const int bytes_in, const int bytes_out)
Create a new vNIC Use to be added to a Measurement event.
Event header.
Definition: evel.h:410
void evel_mobile_gtp_metrics_max_trx_bit_rate_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, int rate)
Set the Max Transmit Bit Rate property of the Mobile GTP Per Flow Metrics.
void evel_measurement_mem_cfg_set(EVENT_MEASUREMENT *measurement, double memory_configured)
Set the Memory Configured property of the Measurement.
void evel_syslog_event_source_host_set(EVENT_SYSLOG *syslog, const char *const host)
Set the Event Source Host property of the Syslog.
Definition: evel_syslog.c:189
void evel_mobile_gtp_metrics_max_rcv_bit_rate_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, int rate)
Set the Max Receive Bit Rate property of the Mobile GTP Per Flow Metrics.
void evel_mobile_flow_gtp_prot_type_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const type)
Set the GTP Protocol Type property of the Mobile Flow.
void evel_mobile_gtp_metrics_large_pkt_rtt_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, int rtt)
Set the Large Packet Round-Trip Time property of the Mobile GTP Per Flow Metrics. ...
void evel_last_epoch_set(EVENT_HEADER *const header, const unsigned long long last_epoch_microsec)
Set the Last Epoch property of the event header.
Definition: evel_event.c:212
Signaling.
Definition: evel.h:916
Virtual NIC usage.
Definition: evel.h:582
void evel_service_phone_number_set(EVENT_SERVICE *const event, const char *const phone_number)
Set the Phone Number property of the Service event.
void evel_mobile_gtp_metrics_qci_cos_count_add(MOBILE_GTP_PER_FLOW_METRICS *metrics, const EVEL_QCI_COS_TYPES qci_cos, const int count)
Add a QCI COS count to the metrics.
void evel_measurement_mem_used_set(EVENT_MEASUREMENT *measurement, double memory_used)
Set the Memory Used property of the Measurement.
void evel_mobile_flow_imei_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const imei)
Set the IMEI property of the Mobile Flow.
void evel_signaling_compressed_sip_set(EVENT_SIGNALING *const event, const char *const compressed_sip)
Set the Compressed SIP property of the Signaling event.
void evel_signaling_product_id_set(EVENT_SIGNALING *const event, const char *const product_id)
Set the Product Id property of the Signaling event.
void evel_service_endpoint_rtp_pkt_disc_set(EVENT_SERVICE *const event, const int rtp_pkt_disc)
Set the Endpoint Rtp Packets Discarded property of the Service event.
Definition: evel_service.c:597
void evel_service_endpoint_rtp_oct_disc_set(EVENT_SERVICE *const event, const int rtp_oct_disc)
Set the Endpoint Rtp Octets Discarded property of the Service event.
Definition: evel_service.c:516
void evel_service_rtcp_data_set(EVENT_SERVICE *const event, const char *const rtcp_data)
Set the RTCP Data property of the Service event.
Definition: evel_service.c:404
void evel_mobile_flow_mcc_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const mcc)
Set the MCC property of the Mobile Flow.
void evel_mobile_flow_app_prot_type_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const type)
Set the Application Protocol Type property of the Mobile Flow.
void evel_service_friendly_name_set(EVENT_SERVICE *const event, const char *const friendly_name)
Set the Friendly Name property of the Service event.
Definition: evel_service.c:262
void evel_mobile_flow_ecgi_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const ecgi)
Set the ECGI property of the Mobile Flow.
void evel_measurement_agg_cpu_use_set(EVENT_MEASUREMENT *measurement, double cpu_use)
} Set the Aggregate CPU Use property of the Measurement.
void evel_measurement_vnfc_scaling_metric_set(EVENT_MEASUREMENT *measurement, double scaling_metric)
Set the VNFC Scaling Metric property of the Measurement.
void evel_service_local_rtp_pkt_sent_set(EVENT_SERVICE *const event, const int rtp_pkt_sent)
Set the Local Rtp Packets Sent property of the Service event.
Definition: evel_service.c:840
void evel_service_type_set(EVENT_SERVICE *const event, const char *const type)
Set the Event Type property of the Service event.
Definition: evel_service.c:135
void evel_service_caller_codec_set(EVENT_SERVICE *const event, const char *const codec)
Set the Caller Side Codec property of the Service event.
Definition: evel_service.c:375
void evel_service_local_jitter_set(EVENT_SERVICE *const event, const int jitter)
Set the Local Jitter property of the Service event.
Definition: evel_service.c:678
void evel_mobile_gtp_metrics_dur_tun_fail_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, int duration)
Set the Duration of Tunnel Failed Status property of the Mobile GTP Per Flow Metrics.
void evel_service_local_rtp_pkt_disc_set(EVENT_SERVICE *const event, const int rtp_pkt_disc)
Set the Local Rtp Packets Discarded property of the Service event.
Definition: evel_service.c:786
void evel_mobile_gtp_metrics_num_echo_fail_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, int num)
Set the Number of GTP Echo Failures property of the Mobile GTP Per Flow Metrics.
void evel_fault_interface_set(EVENT_FAULT *fault, const char *const interface)
Set the Alarm Interface A property of the Fault.
Definition: evel_fault.c:164
void evel_signaling_remote_ip_address_set(EVENT_SIGNALING *const event, const char *const remote_ip_address)
Set the Remote Ip Address property of the Signaling event.
void evel_service_endpoint_jitter_set(EVENT_SERVICE *const event, const int jitter)
Set the Endpoint Jitter property of the Service event.
Definition: evel_service.c:489
Fault.
Definition: evel.h:449
void evel_mobile_flow_app_prot_ver_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const version)
Set the Application Protocol Version property of the Mobile Flow.
void evel_mobile_gtp_metrics_act_time_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, time_t act_time)
Set the Activation Time property of the Mobile GTP Per Flow metrics.
void evel_mobile_gtp_metrics_act_by_set(MOBILE_GTP_PER_FLOW_METRICS *metrics, const char *const act_by)
Set the Activated By property of the Mobile GTP Per Flow metrics.
void evel_mobile_flow_other_func_role_set(EVENT_MOBILE_FLOW *mobile_flow, const char *const role)
Set the Other Functional Role property of the Mobile Flow.