gcontini
2020-05-04 acc26caef272ec3e295a6566571b68f628e577fd
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/** 
 * \file
 * This file contains all the properties that are customizable on on a per-project basis eg:
 * 1) api parameter sizes
 * 2)
 *
 * It is safe to place the values that your project need to customize here, since each project get its own copy of this
 * file.
 */
 
/** 
 * \addtogroup api
 * @{
 */
 
#ifndef BUILD_PROPERTIES_H_
#define BUILD_PROPERTIES_H_
 
 
/**
 * This file contains all the properties that are customizable on on a per-project basis eg:
 * 1) api parameter sizes
 * 2) 
 *
 * It is safe to place the values that your project need to customize here, since each project get its own copy of this
 * file.
 */
 
#define LCC_PROJECT_NAME "@LCC_PROJECT_NAME@"
 
//License retrieval configuration
#define FIND_LICENSE_NEAR_MODULE true
#define FIND_LICENSE_WITH_ENV_VAR false
 
/**
 * License file name extension
 */
#define LCC_LICENSE_FILE_EXTENSION ".lic"
#define LCC_LICENSE_LOCATION_ENV_VAR "LICENSE_LOCATION"
#define LCC_LICENSE_DATA_ENV_VAR "LICENSE_DATA"
 
// Api structure limits
/**
 * Maximum size of a license file or base64 data
 */
#define LCC_API_MAX_LICENSE_DATA_LENGTH 1024 * 4
 
// define api structure sizes
#define LCC_API_PC_IDENTIFIER_SIZE 19
#define LCC_API_PROPRIETARY_DATA_SIZE 16
#define LCC_API_AUDIT_EVENT_NUM 5
#define LCC_API_AUDIT_EVENT_PARAM2 255
#define LCC_API_VERSION_LENGTH 15
#define LCC_API_FEATURE_NAME_SIZE 15
#define LCC_API_EXPIRY_DATE_SIZE 10
#define LCC_API_ERROR_BUFFER_SIZE 256
 
/**
This definition allows to specify a custom expression to verify the magic number passed in by the api.
*/
#define LCC_VERIFY_MAGIC (lic_info.m_magic == @LCC_PROJECT_MAGIC_NUM@)
 
/**
 *
 * Environment variable name that if defined will change the identification strategy used to generate the hardware
 * identifier. If a client has an unstable pc-identifier use this variable to generate one. Valid values are integers
 * defined in `LCC_IDENTIFICATION_STRATEGY` enum.
 */
#define LCC_IDENTIFICATION_STRATEGY_ENV_VAR "IDENTIFICATION_STRATEGY"
 
/**
 * \enum LCC_API_HW_IDENTIFICATION_STRATEGY
 *
 * This enum list all the possible pc identification strategy. It is to be used as a parameter of ::identify_pc
 *
 * ::STRATEGY_DEFAULT Should be used in most cases.
 */
enum LCC_API_HW_IDENTIFICATION_STRATEGY {
    /**
     * \brief Default strategy.
     *
     * This strategy try to detect which virtual environment the software is running in.
     *  - If no virtual environment is detected it will try the strategies defined in ::LCC_BARE_TO_METAL_STRATEGIES
     *  - If it detects the software is running in a virtual machine it will use ::LCC_VM_STRATEGIES
     *  - If it detects the software is running in a docker or in an LXC it will use ::LCC_DOCKER_STRATEGIES or
     * ::LCC_DOCKER_STRATEGIES
     *  - If it detects the software is running in a virtual machine in the cloud it will use ::LCC_CLOUD_STRATEGIES
     */
    STRATEGY_DEFAULT = -1,
    STRATEGY_ETHERNET = 0,
    STRATEGY_IP_ADDRESS = 1,
    STRATEGY_DISK_NUM = 2,
    STRATEGY_DISK_LABEL = 3,
    STRATEGY_MEMORY_CPU_SIZE = 4,
    STRATEGY_HOST_NAME = 5,
    STRATEGY_NONE = -2
};
 
/**
 * @addtogroup strategies
 * @{
 */
/**
 * List the strategies used when no virtual envrionment is detected
 */
#define LCC_BARE_TO_METAL_STRATEGIES { STRATEGY_ETHERNET, STRATEGY_DISK_LABEL, STRATEGY_NONE }
/**
 * List the strategies used when the software is executing in a virtual machine
 */
#define LCC_VM_STRATEGIES { STRATEGY_ETHERNET, STRATEGY_NONE }
#define LCC_LXC_STRATEGIES { STRATEGY_ETHERNET, STRATEGY_NONE }
#define LCC_DOCKER_STRATEGIES { STRATEGY_NONE }
/**
 * List the strategies used when it's detected an execution in the cloud
 */
#define LCC_CLOUD_STRATEGIES { STRATEGY_NONE }
 
/**
 * @}
 */
 
 
#endif
/**
 * @}
 */