FreeRDP
Loading...
Searching...
No Matches
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)
70WINPR_ATTR_NODISCARD
71FREERDP_LOCAL rdpLicense* license_new(rdpRdp* rdp);
72
73#define LICENSE_TAG FREERDP_TAG("core.license")
74#ifdef WITH_DEBUG_LICENSE
75#define DEBUG_LICENSE(...) WLog_INFO(LICENSE_TAG, __VA_ARGS__)
76#else
77#define DEBUG_LICENSE(...) \
78 do \
79 { \
80 } while (0)
81#endif
82
83#endif /* FREERDP_LIB_CORE_LICENSE_H */