1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
7 * Definitions of DPDK version numbers
10 #ifndef _RTE_VERSION_H_
11 #define _RTE_VERSION_H_
20 #include <rte_common.h>
23 * String that appears before the version number
25 #define RTE_VER_PREFIX "DPDK"
28 * Major version/year number i.e. the yy in yy.mm.z
30 #define RTE_VER_YEAR 18
33 * Minor version/month number i.e. the mm in yy.mm.z
35 #define RTE_VER_MONTH 11
38 * Patch level number i.e. the z in yy.mm.z
40 #define RTE_VER_MINOR 0
43 * Extra string to be appended to version number
45 #define RTE_VER_SUFFIX "-rc"
48 * Patch release number
49 * 0-15 = release candidates
52 #define RTE_VER_RELEASE 4
55 * Macro to compute a version number usable for comparisons
57 #define RTE_VERSION_NUM(a,b,c,d) ((a) << 24 | (b) << 16 | (c) << 8 | (d))
60 * All version numbers in one to compare with RTE_VERSION_NUM()
62 #define RTE_VERSION RTE_VERSION_NUM( \
69 * Function returning version string
73 static inline const char *
76 static char version[32];
79 if (strlen(RTE_VER_SUFFIX) == 0)
80 snprintf(version, sizeof(version), "%s %d.%02d.%d",
86 snprintf(version, sizeof(version), "%s %d.%02d.%d%s%d",
92 RTE_VER_RELEASE < 16 ?
94 RTE_VER_RELEASE - 16);
102 #endif /* RTE_VERSION_H */