1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
13 /* Initial features */
14 #define FEATURE_TTCN3 0x1u
15 #define FEATURE_CODEGEN 0x2u
16 #define FEATURE_TPGEN 0x4u
17 #define FEATURE_SINGLE 0x8u
18 #define FEATURE_MCTR 0x10u
19 #define FEATURE_HC 0x20u
20 #define FEATURE_LOGFORMAT 0x40u
21 /* Added in 1.2.pl0 */
22 #define FEATURE_ASN1 0x80u
23 #define FEATURE_RAW 0x100u
24 #define FEATURE_BER 0x200u
25 #define FEATURE_PER 0x400u
26 /* Added in 1.5.pl7 */
27 #define FEATURE_GUI 0x800u // deprecated mctr GUI was removed
28 /* Added in 1.5.pl8 */
29 #define FEATURE_TEXT 0x1000u
30 /* Added in 1.8.pl0 */
31 #define FEATURE_XER 0x2000u
33 /* Limitation types */
34 #define LIMIT_HOST 0x1
35 #define LIMIT_USER 0x2
37 /* Limit for expiration warning in days */
38 #define EXPIRY_WARNING 14
40 /* Where to send the license.
42 * The values 1,2,3 work as either an enumeration or a bit field. */
43 #define SENDTO_LICENSEE 1
44 #define SENDTO_CONTACT 2
47 /** "Cooked" license information suitable for processing. */
50 unsigned int unique_id
;
51 char *licensee_name
, *licensee_email
,
52 *licensee_company
, *licensee_department
;
53 char *contact_name
, *contact_email
;
55 time_t valid_from
, valid_until
;
56 unsigned long int host_id
;
58 unsigned int from_major
, from_minor
, from_patchlevel
,
59 to_major
, to_minor
, to_patchlevel
;
60 unsigned int feature_list
, limitation_type
;
61 unsigned int max_ptcs
;
64 /** Raw license information.
66 * The license file is a Base64-encode of a BER-encoded version of this structure.
68 * @note Modifying this structure will render it incompatible with
69 * previous versions of Titan (the size of the structure is checked) */
71 unsigned char unique_id
[4];
72 char licensee_name
[48], licensee_email
[48],
73 licensee_company
[48], licensee_department
[16];
74 unsigned char valid_from
[4], valid_until
[4];
75 unsigned char host_id
[4];
77 unsigned char from_major
[4], from_minor
[4], from_patchlevel
[4],
78 to_major
[4], to_minor
[4], to_patchlevel
[4];
79 unsigned char feature_list
[4], limitation_type
[4];
80 unsigned char max_ptcs
[4];
81 unsigned char dsa_signature
[48];
88 /** Load license information.
90 * Loads license information from the file specified in the
91 * \c TTCN3_LICENSE_FILE environment variable.
93 * Calls \c load_license_from_file()
95 * @param [out] lptr pointer to license data */
96 void load_license(license_struct
*lptr
);
98 /** Load license information from a specified file.
99 * @param [out] lptr pointer to license data
100 * @param [in] file_name string containing the license file name */
101 void load_license_from_file(license_struct
*lptr
, const char *file_name
);
104 * @param [in] lptr pointer to license data */
105 void free_license(license_struct
*lptr
);
107 /** Check if the license allows the use of the product.
109 * Verifies that we are within the license period, that the host or user
110 * restriction is satisfied, and the program version is within the limits
111 * allowed by the license.
113 * If the license is about to expire in less than \c EXPIRY_WARNING days,
114 * a warning is printed.
116 * If a check fails, function returns 0.
118 * @param [in] lptr pointer to license information
119 * @return 1 if the license is valid, 0 if invalid. */
120 int verify_license(const license_struct
*lptr
);
122 /** Check if the license allows the use of a certain feature.
124 * @param lptr pointer to license information
125 * @param feature feature to check. It should be one of the FEATURE_ macros.
126 * @return nonzero if feature is enabled, 0 if disabled. */
127 unsigned int check_feature(const license_struct
*lptr
, unsigned int feature
);
129 /** Print the details of the supplied license information
131 * @param [in] lptr pointer to license information */
132 void print_license(const license_struct
*lptr
);
134 /** Print information about the license used by the program.
136 * The license is loaded from the file specified by the \c TTCN3_LICENSE_FILE
137 * environment variable.
139 * This function terminates the program if the license is not valid. */
140 void print_license_info(void);
142 void init_openssl(void);
143 void free_openssl(void);
145 const char * openssl_version_str(void);
147 #if defined(WIN32) || defined(INTERIX)
148 long gethostid(void);
This page took 0.035195 seconds and 6 git commands to generate.