xref: /dpdk/lib/eal/include/rte_version.h (revision a3c8a446)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4 
5 /**
6  * @file
7  * Definitions of DPDK version numbers
8  */
9 
10 #ifndef _RTE_VERSION_H_
11 #define _RTE_VERSION_H_
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #include <stdint.h>
18 #include <string.h>
19 #include <stdio.h>
20 #include <rte_common.h>
21 #include <rte_compat.h>
22 
23 /**
24  * Macro to compute a version number usable for comparisons
25  */
26 #define RTE_VERSION_NUM(a,b,c,d) ((a) << 24 | (b) << 16 | (c) << 8 | (d))
27 
28 /**
29  * All version numbers in one to compare with RTE_VERSION_NUM()
30  */
31 #define RTE_VERSION RTE_VERSION_NUM( \
32 			RTE_VER_YEAR, \
33 			RTE_VER_MONTH, \
34 			RTE_VER_MINOR, \
35 			RTE_VER_RELEASE)
36 
37 /**
38  * Function to return DPDK version prefix string
39  */
40 __rte_experimental
41 const char *rte_version_prefix(void);
42 
43 /**
44  * Function to return DPDK version year
45  */
46 __rte_experimental
47 unsigned int rte_version_year(void);
48 
49 /**
50  * Function to return DPDK version month
51  */
52 __rte_experimental
53 unsigned int rte_version_month(void);
54 
55 /**
56  * Function to return DPDK minor version number
57  */
58 __rte_experimental
59 unsigned int rte_version_minor(void);
60 
61 /**
62  * Function to return DPDK version suffix for any release candidates
63  */
64 __rte_experimental
65 const char *rte_version_suffix(void);
66 
67 /**
68  * Function to return DPDK version release candidate value
69  */
70 __rte_experimental
71 unsigned int rte_version_release(void);
72 
73 /**
74  * Function returning version string
75  * @return
76  *     DPDK version string
77  */
78 const char *rte_version(void);
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif /* RTE_VERSION_H */
85