FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
libfreerdp/core/license.h
1
22#ifndef FREERDP_LIB_CORE_LICENSE_H
23#define FREERDP_LIB_CORE_LICENSE_H
24
25#include "rdp.h"
26#include "state.h"
27
28#include <freerdp/crypto/crypto.h>
29
30#include <freerdp/log.h>
31#include <freerdp/license.h>
32
33#include <winpr/stream.h>
34
35#define CLIENT_RANDOM_LENGTH 32
36
37typedef struct
38{
39 UINT32 dwVersion;
40 UINT32 cbCompanyName;
41 BYTE* pbCompanyName;
42 UINT32 cbProductId;
43 BYTE* pbProductId;
45
46typedef struct
47{
48 UINT16 type;
49 UINT16 length;
50 BYTE* data;
52
53typedef struct
54{
55 UINT32 count;
56 LICENSE_BLOB** array;
58
59FREERDP_LOCAL BOOL license_send_valid_client_error_packet(rdpRdp* rdp);
60
61FREERDP_LOCAL state_run_t license_recv(rdpLicense* license, wStream* s);
62
63/* the configuration is applied from settings. Set FreeRDP_ServerLicense* settings */
64FREERDP_LOCAL BOOL license_server_configure(rdpLicense* license);
65FREERDP_LOCAL BOOL license_server_send_request(rdpLicense* license);
66
67FREERDP_LOCAL void license_free(rdpLicense* license);
68
69WINPR_ATTR_MALLOC(license_free, 1)
70FREERDP_LOCAL rdpLicense* license_new(rdpRdp* rdp);
71
72#define LICENSE_TAG FREERDP_TAG("core.license")
73#ifdef WITH_DEBUG_LICENSE
74#define DEBUG_LICENSE(...) WLog_INFO(LICENSE_TAG, __VA_ARGS__)
75#else
76#define DEBUG_LICENSE(...) \
77 do \
78 { \
79 } while (0)
80#endif
81
82#endif /* FREERDP_LIB_CORE_LICENSE_H */