summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2019-04-19 14:01:42 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-04-19 14:01:42 +0000
commitc477a3fa2d36e10c6004f2c20fe89acdc0a51917 (patch)
tree97c13b6cf4e9e626f4de23f589523ab9484a164b /VNFs/DPPD-PROX
parent7a89c091708f4cddc9849f4a1d6e86403a2d2456 (diff)
parent8310d0fedb5fc13610b95e100c8639c97892a2b5 (diff)
Merge "PROX: update version"
Diffstat (limited to 'VNFs/DPPD-PROX')
-rw-r--r--VNFs/DPPD-PROX/display.c2
-rw-r--r--VNFs/DPPD-PROX/main.c2
-rw-r--r--VNFs/DPPD-PROX/version.h18
3 files changed, 11 insertions, 11 deletions
diff --git a/VNFs/DPPD-PROX/display.c b/VNFs/DPPD-PROX/display.c
index 2c52d448..d7421e85 100644
--- a/VNFs/DPPD-PROX/display.c
+++ b/VNFs/DPPD-PROX/display.c
@@ -541,7 +541,7 @@ static void draw_title(void)
{
char title_str[128];
- snprintf(title_str, sizeof(title_str), "%s %s: %s", PROGRAM_NAME, VERSION_STR, prox_cfg.name);
+ snprintf(title_str, sizeof(title_str), "%s %s: %s", PROGRAM_NAME, VERSION_STR(), prox_cfg.name);
wbkgd(win_title, COLOR_PAIR(BLACK_ON_GREEN));
title_len = strlen(title_str);
diff --git a/VNFs/DPPD-PROX/main.c b/VNFs/DPPD-PROX/main.c
index ed578c85..4a9ee881 100644
--- a/VNFs/DPPD-PROX/main.c
+++ b/VNFs/DPPD-PROX/main.c
@@ -1127,7 +1127,7 @@ int main(int argc, char **argv)
}
plog_init(prox_cfg.log_name, prox_cfg.log_name_pid);
- plog_info("=== " PROGRAM_NAME " " VERSION_STR " ===\n");
+ plog_info("=== " PROGRAM_NAME " %s ===\n", VERSION_STR());
plog_info("\tUsing DPDK %s\n", rte_version() + sizeof(RTE_VER_PREFIX));
read_rdt_info();
diff --git a/VNFs/DPPD-PROX/version.h b/VNFs/DPPD-PROX/version.h
index a1d01235..a9f46b66 100644
--- a/VNFs/DPPD-PROX/version.h
+++ b/VNFs/DPPD-PROX/version.h
@@ -17,18 +17,18 @@
#ifndef _VERSION_H_
#define _VERSION_H_
-#define STRINGIFY(s) #s
-#define SSTR(s) STRINGIFY(s)
-
/* PROGRAM_NAME defined through Makefile */
-#define VERSION_MAJOR 0
-#define VERSION_MINOR 41
+#define VERSION_MAJOR 0 // Pre-production
+#define VERSION_MINOR 1904 // 19.04 i.e. April 2019
#define VERSION_REV 0
+static inline char *VERSION_STR(void)
+{
+ static char version_buffer[32];
+ snprintf(version_buffer, sizeof(version_buffer), "%02d.%02d", VERSION_MINOR / 100, VERSION_MINOR % 100);
#if VERSION_REV > 0
-#define VERSION_STR "v" SSTR(VERSION_MAJOR) "." SSTR(VERSION_MINOR) "." SSTR(VERSION_REV)
-#else
-#define VERSION_STR "v" SSTR(VERSION_MAJOR) "." SSTR(VERSION_MINOR)
+ snprintf(version_buffer + strlen(version_buffer), sizeof(version_buffer) - strlen(version_buffer), ".%02d", VERSION_REV);
#endif
-
+ return version_buffer;
#endif /* _VERSION_H_ */
+}