X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=vnfs%2FVESreporting_vLB5.0%2Fvpp_measurement_reporter.c;h=66368431b414e6b43d101a8b93b2aeb2b19590e8;hb=645a5594bf3e28eb94754fc6e25c0a896b10825b;hp=3eb984d560f120b76a0b0d7326f244e7020ccc1f;hpb=c4e488b0e69567f49c1f5b17efa288116d125fe5;p=demo.git diff --git a/vnfs/VESreporting_vLB5.0/vpp_measurement_reporter.c b/vnfs/VESreporting_vLB5.0/vpp_measurement_reporter.c index 3eb984d5..66368431 100644 --- a/vnfs/VESreporting_vLB5.0/vpp_measurement_reporter.c +++ b/vnfs/VESreporting_vLB5.0/vpp_measurement_reporter.c @@ -120,31 +120,63 @@ 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; + char* caFile = "/opt/config/onap-ca.crt"; + char* userName = "sample1"; + char* passWord = "sample1"; + + + if(argc == 6) + { + fqdn2 = argv[3]; + port2 = atoi(argv[4]); + vnic = argv[5]; + } + else + vnic = argv[3]; + MEASUREMENT_VNIC_PERFORMANCE * vnic_performance = NULL; printf("\nVector Packet Processing (VPP) measurement collection\n"); fflush(stdout); - if (argc != 4) + if (!((argc == 6) || (argc == 4))) { - fprintf(stderr, "Usage: %s | \n", argv[0]); + fprintf(stderr, "Usage: %s | | \n", argv[0]); + fprintf(stderr, "OR\n"); + fprintf(stderr, "Usage: %s | \n", argv[0]); exit(-1); } + srand(time(NULL)); /**************************************************************************/ /* Initialize */ /**************************************************************************/ if(evel_initialize(fqdn, /* FQDN */ - port, /* Port */ - NULL, /* optional path */ - NULL, /* optional topic */ - 0, /* HTTPS? */ - "", /* Username */ - "", /* Password */ - EVEL_SOURCE_VIRTUAL_MACHINE, /* Source type */ - "vLoadBalancer", /* Role */ - 1)) /* Verbosity */ + port, /* Port */ + fqdn2, /* Backup FQDN */ + port2, /* Backup port */ + NULL, /* optional path */ + NULL, /* optional topic */ + 100, /* Ring Buffer size */ + 1, /* HTTPS? */ + NULL, /* cert file */ + NULL, /* key file */ + caFile, /* ca info */ + NULL, /* ca file */ + 0, /* verify peer */ + 0, /* verify host */ + userName, /* Username */ + passWord, /* Password */ + "sample1", /* Username2 */ + "sample1", /* Password2 */ + NULL, /* Source ip */ + NULL, /* Backup Source IP */ + EVEL_SOURCE_VIRTUAL_MACHINE, /* Source type */ + "vLoadBalancer", /* Role */ + 1)) /* Verbosity */ { fprintf(stderr, "\nFailed to initialize the EVEL library!!!\n"); exit(-1); @@ -207,7 +239,7 @@ int main(int argc, char** argv) } vpp_m = evel_new_measurement(READ_INTERVAL,"vLoadBalancer","TrafficStats_1.2.3.4"); - vnic_performance = (MEASUREMENT_VNIC_PERFORMANCE *)evel_measurement_new_vnic_performance("eth0", "true"); + vnic_performance = (MEASUREMENT_VNIC_PERFORMANCE *)evel_measurement_new_vnic_performance(vnic, "true"); evel_meas_vnic_performance_add(vpp_m, vnic_performance); if(vpp_m != NULL) {