-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathversion.h
93 lines (77 loc) · 2.55 KB
/
version.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) 2021 ETH Zurich
*/
#ifndef LF_VERSION_H
#define LF_VERSION_H
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
/**
* This file provides version information, including various compile time
* options.
* Furthermore, the version information can be exposed through the IPC
* interface.
*/
/* Stringify Macro Values */
#define xstr(a) str(a)
#define str(a) #a
#define LF_VERSION_MAJOR 0
#define LF_VERSION_MINOR 1
#define LF_VERSION_PATCH 0
#define LF_VERSION \
xstr(LF_VERSION_MAJOR) "." xstr(LF_VERSION_MINOR) "." xstr(LF_VERSION_PATCH)
#define LF_VERSION_GIT_STRING xstr(LF_VERSION_GIT)
#define LF_VERSION_LONG LF_VERSION "- Git: " LF_VERSION_GIT_STRING
#define LF_VERSION_OPTIONS_STRING(CO) #CO ": " xstr(CO) "\n"
#define LF_VERSION_MAIN_OPTIONS(M) \
M(LF_WORKER) \
M(LF_DRKEY_FETCHER) \
M(LF_CBCMAC) \
M(LF_LOG_DP_LEVEL)
#define LF_VERSION_MAIN_OPTIONS_STRING \
LF_VERSION_MAIN_OPTIONS(LF_VERSION_OPTIONS_STRING)
#define LF_VERSION_FEATURE_OPTIONS(M) \
M(LF_IPV6) \
M(LF_OFFLOAD_CKSUM) \
M(LF_JUMBO_FRAME)
#define LF_VERSION_FEATURE_OPTIONS_STRING \
LF_VERSION_FEATURE_OPTIONS(LF_VERSION_OPTIONS_STRING)
#define LF_VERSION_OMIT_OPTIONS(M) \
M(LF_WORKER_OMIT_TIME_UPDATE) \
M(LF_WORKER_OMIT_KEY_GET) \
M(LF_WORKER_OMIT_DECAPSULATION) \
M(LF_WORKER_OMIT_HASH_CHECK) \
M(LF_WORKER_OMIT_MAC_CHECK) \
M(LF_WORKER_OMIT_TIMESTAMP_CHECK) \
M(LF_WORKER_OMIT_DUPLICATE_CHECK) \
M(LF_WORKER_OMIT_RATELIMIT_CHECK)
#define LF_VERSION_OMIT_OPTIONS_STRING \
LF_VERSION_OMIT_OPTIONS(LF_VERSION_OPTIONS_STRING)
#define LF_VERSION_IGNORE_CHECK_OPTIONS(M) \
M(LF_WORKER_IGNORE_MAC_CHECK) \
M(LF_WORKER_IGNORE_TIMESTAMP_CHECK) \
M(LF_WORKER_IGNORE_DUPLICATE_CHECK) \
M(LF_WORKER_IGNORE_HASH_CHECK) \
M(LF_WORKER_IGNORE_DRKEY_TIMESTAMP_CHECK)
#define LF_VERSION_IGNORE_CHECK_OPTIONS_STRING \
LF_VERSION_IGNORE_CHECK_OPTIONS(LF_VERSION_OPTIONS_STRING)
// clang-format off
#define LF_VERSION_ALL \
LF_VERSION_LONG "\n" \
"- Main Options -\n" \
LF_VERSION_MAIN_OPTIONS_STRING \
"- Feature Options -\n" \
LF_VERSION_FEATURE_OPTIONS_STRING \
"- Omit Options -\n" \
LF_VERSION_OMIT_OPTIONS_STRING \
"- Ignore Checks Options -\n" \
LF_VERSION_IGNORE_CHECK_OPTIONS_STRING \
"- Plugins -\n" \
xstr(LF_PLUGINS)
// clang-format on
/**
* Register version IPC commands.
*/
int
lf_version_register_ipc();
#endif /* LF_VERSION_H */