resubmit - 2 collector support-include readme ..
[demo.git] / vnfs / VESreporting_vFW5.0 / vpp_measurement_reporter.c
index c9c9bdc..7cf0414 100644 (file)
@@ -171,39 +171,58 @@ int main(int argc, char** argv)
   char* fqdn = argv[1];
   int port = atoi(argv[2]);
   char* vnic = argv[3];
+  char* fqdn2 = NULL;
+  int port2 = 0;
+
   MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL;
   //struct timeval tv_start;
 
+  if(argc == 6)
+  {
+     fqdn2 = argv[3];
+     port2 = atoi(argv[4]);
+     vnic = argv[5];
+  }
+
   printf("\nVector Packet Processing (VPP) measurement collection\n");
   fflush(stdout);
 
-  if (argc != 4)
+  if (!((argc == 6) || (argc == 4)))
   {
-    fprintf(stderr, "Usage: %s <FQDN>|<IP address> <port> <interface>\n", argv[0]);
+    fprintf(stderr, "Usage: %s <FQDN>|<IP address> <port> <FQDN>|<IP address> <port> <interface> \n", argv[0]);
+    fprintf(stderr, "OR\n");
+    fprintf(stderr, "Usage: %s <FQDN>|<IP address> <port> <interface> \n", argv[0]);
     exit(-1);
   }
+
   srand(time(NULL));
 
   /**************************************************************************/
   /* Initialize                                                             */
   /**************************************************************************/
   if(evel_initialize(fqdn,                         /* FQDN                  */
-                     port,                        /* Port                  */
-                     NULL,                         /* optional path         */
-                     NULL,                         /* optional topic        */
-                     0,                            /* HTTPS?                */
-                     NULL,                         /* cert file             */
-                     NULL,                         /* key  file             */
-                     NULL,                         /* ca   info             */
-                     NULL,                         /* ca   file             */
-                     0,                            /* verify peer           */
-                     0,                            /* verify host           */
-                     "",                           /* Username              */
-                     "",                           /* Password              */
-                     NULL,                         /* Source ip             */
-                     EVEL_SOURCE_VIRTUAL_MACHINE,  /* Source type           */
-                     "vFirewall",                         /* Role                  */
-                     1))                           /* Verbosity             */
+                       port,                         /* Port                  */
+                     fqdn2,                        /* Backup FQDN           */
+                     port2,                        /* Backup port           */
+                       NULL,                         /* optional path         */
+                       NULL,                         /* optional topic        */
+                       100,                          /* Ring Buffer size      */
+                       0,                            /* HTTPS?                */
+                       NULL,                         /* cert file             */
+                       NULL,                         /* key  file             */
+                       NULL,                         /* ca   info             */
+                       NULL,                         /* ca   file             */
+                       0,                            /* verify peer           */
+                       0,                            /* verify host           */
+                     "sample1",                    /* Username              */
+                     "sample1",                    /* Password              */
+                     "sample1",                    /* Username2             */
+                     "sample1",                    /* Password2             */
+                       NULL,                         /* Source ip             */
+                       NULL,                         /* Backup Source IP      */
+                       EVEL_SOURCE_VIRTUAL_MACHINE,  /* Source type           */
+                       "vFirewall",                  /* Role                  */
+                       1))                           /* Verbosity             */
   {
     fprintf(stderr, "\nFailed to initialize the EVEL library!!!\n");
     exit(-1);